diff --git a/lib/emac/src/emac_rx.vhd b/lib/emac/src/emac_rx.vhd index 1f5bdd0..62e8032 100644 --- a/lib/emac/src/emac_rx.vhd +++ b/lib/emac/src/emac_rx.vhd @@ -122,6 +122,7 @@ begin ctrl_out.rx_size <= cmd_fifo_dout(31 downto 16); ctrl_out.rx_vld <= not cmd_fifo_empty; ctrl_out.rx_er <= mii_rx_er; + ctrl_out.ram_ovf <= xfer_ram_full; dout <= ram_dout_a; diff --git a/lib/emac/src/emac_top_jb.vhd b/lib/emac/src/emac_top_jb.vhd index bb82cc2..9e53b3b 100644 --- a/lib/emac/src/emac_top_jb.vhd +++ b/lib/emac/src/emac_top_jb.vhd @@ -111,26 +111,27 @@ registers_read: rx_ctrl_in.data_read <= '0'; ACK_O <= rx_dout_vld and CYC_I and not WE_I; DAT_O <= rx_dout; - if (STB_I and CYC_I) = '1' then + if (STB_I and CYC_I) = '1' and WE_I = '0' then case ADDR_I(5 downto 2) is when "0000" => - ACK_O <= not WE_I; + ACK_O <= '1'; DAT_O <= (others => '0'); DAT_O(31) <= tx_ctrl_in.tx_er; DAT_O(30) <= mii_rx_er; DAT_O(29) <= mii_col; DAT_O(28) <= mii_crs; + DAT_O(18) <= rx_ctrl_out.ram_ovf; DAT_O(17) <= tx_ctrl_out.tx_req; DAT_O(16) <= rx_ctrl_out.rx_vld; DAT_O(5) <= tx_int_en; DAT_O(4) <= rx_int_en; when "0001" => - ACK_O <= not WE_I; + ACK_O <= '1'; DAT_O <= tx_ctrl_out.tx_size & rx_ctrl_out.rx_size; when "0010" => - rx_ctrl_in.data_read <= not WE_I; + rx_ctrl_in.data_read <= '1'; when others => null; end case; diff --git a/lib/emac/src/emac_types.vhd b/lib/emac/src/emac_types.vhd index df5117a..9a28e6d 100644 --- a/lib/emac/src/emac_types.vhd +++ b/lib/emac/src/emac_types.vhd @@ -33,6 +33,7 @@ package emac_types is type rx_ctrl_out_t is record rx_er : std_logic; rx_vld : std_logic; + ram_ovf : std_logic; rx_size : unsigned(15 downto 0); end record;