diff --git a/lib/emac/emac_jb.vhd b/lib/emac/emac_jb.vhd index 650569c..f06cf2b 100644 --- a/lib/emac/emac_jb.vhd +++ b/lib/emac/emac_jb.vhd @@ -71,6 +71,7 @@ ARCHITECTURE behavior OF emac_jb IS signal host_data_reg : unsigned(31 downto 0); signal host_tx_size : unsigned(15 downto 0); + signal tx_fill_size : word_ptr_t; signal tx_fill_cnt : word_ptr_t; signal tx_fill_ptr : word_ptr_t; signal tx_fill_rdy : std_logic; @@ -91,7 +92,6 @@ ARCHITECTURE behavior OF emac_jb IS signal tx_free_en : std_logic; signal tx_uncommit_en : std_logic; - signal tx_host_size_adj : word_ptr_t; signal tx_fill_remain : unsigned(1 downto 0); signal tx_xfer_size : word_ptr_t; @@ -170,7 +170,7 @@ begin tx_ram_en_a <= '1'; tx_ram_we_a <= tx_commit_en or tx_fill_cnt_adv; tx_ram_tag_in_a <= tx_fill_remain & "01" when tx_commit_en = '1' else "0000"; - tx_ram_data_in_a <= resize(tx_host_size_adj, 16) & resize(tx_alloc_base, 16) when tx_commit_en = '1' else host_data_reg; + tx_ram_data_in_a <= resize(tx_fill_size, 16) & resize(tx_alloc_base, 16) when tx_commit_en = '1' else host_data_reg; tx_ram_addr_a <= tx_alloc_base when tx_commit_en = '1' else tx_fill_ptr; piso_din_be <= (others => '1'); @@ -275,13 +275,13 @@ alloc_request_logic: elsif tx_alloc_req_en = '1' and tx_alloc_req = '0' then tx_alloc_req <= '1'; tx_fill_remain <= host_tx_size(1 downto 0); - tx_host_size_adj <= host_tx_size(word_ptr_t'left+2 downto 2); + tx_fill_size <= host_tx_size(word_ptr_t'left+2 downto 2); if host_tx_size(1 downto 0) /= "00" then - tx_host_size_adj <= host_tx_size(word_ptr_t'left+2 downto 2) + 1; + tx_fill_size <= host_tx_size(word_ptr_t'left+2 downto 2) + 1; end if; elsif tx_alloc_ack = '1' then tx_alloc_req <= '0'; - tx_alloc_size <= tx_host_size_adj; + tx_alloc_size <= tx_fill_size; end if; end if; end process; @@ -306,7 +306,7 @@ alloc_eval_logic: if rising_edge(CLK_I) then tx_alloc_OK <= '0'; if tx_alloc_req = '1' then - if tx_host_size_adj < tx_nwords_free then + if tx_fill_size < tx_nwords_free then tx_alloc_OK <= '1'; end if; end if; @@ -321,7 +321,7 @@ tx_nwords_free_counter: if tx_flush_en = '1' then tx_nwords_free <= (others => '1'); elsif tx_alloc_en = '1' then - tx_nwords_free <= tx_nwords_free - tx_host_size_adj; + tx_nwords_free <= tx_nwords_free - tx_fill_size; elsif tx_free_en = '1' then tx_nwords_free <= tx_nwords_free + tx_xfer_size; end if;