Skip to content
Snippets Groups Projects
Commit 2c5c8448 authored by Wesley W. Terpstra's avatar Wesley W. Terpstra
Browse files

eb2: pop FIFOs only when both ready

parent c9217dfe
No related merge requests found
......@@ -28,7 +28,7 @@ use work.wishbone_pkg.all;
use work.eb_internals_pkg.all;
use work.genram_pkg.all;
-- r_dat_o is valid when r_empty_o=0
-- r_dat_o is valid when r_empty_o=0 (show ahead)
-- w_dat_i is valid when w_push_i =1
-- r_pop_i affects r_empty_o on the next cycle
-- w_push_i affects w_full_o on the next cycle
......
......@@ -60,7 +60,7 @@ architecture rtl of eb_tx_mux is
signal r_tx_stb : std_logic;
signal s_can_tx : std_logic;
signal s_dat_mux : t_wishbone_data;
signal s_empty_mux : std_logic;
signal s_tag_mux : std_logic;
signal s_pass_mux : std_logic;
signal s_cfg_mux : std_logic;
signal s_wbm_mux : std_logic;
......@@ -83,7 +83,7 @@ begin
tx_dat_o <= (others => '0');
elsif rising_edge(clk_i) then
if s_can_tx = '1' then -- is prior operation complete?
r_tx_stb <= not s_empty_mux and r_tag_valid;
r_tx_stb <= not s_tag_mux and r_tag_valid;
tx_dat_o <= s_dat_mux;
-- Control the TX cycle line
if r_tag_valid = '1' then
......@@ -108,40 +108,40 @@ begin
(others => '-') when others; -- c_tag_drop_tx
with r_tag_value select
s_empty_mux <=
pass_empty_i when c_tag_pass_tx,
pass_empty_i when c_tag_pass_on,
cfg_empty_i when c_tag_cfg_req,
cfg_empty_i when c_tag_cfg_ign,
wbm_empty_i when c_tag_wbm_req,
wbm_empty_i when c_tag_wbm_ign,
'0' when others; -- c_tag_drop_tx
s_tag_mux <=
pass_empty_i when c_tag_pass_tx,
pass_empty_i when c_tag_pass_on,
cfg_empty_i when c_tag_cfg_req,
(pass_empty_i or cfg_empty_i) when c_tag_cfg_ign,
wbm_empty_i when c_tag_wbm_req,
(pass_empty_i or wbm_empty_i) when c_tag_wbm_ign,
'0' when others; -- c_tag_drop_tx
with r_tag_value select
s_pass_mux <=
'1' when c_tag_pass_tx,
'1' when c_tag_pass_on,
'1' when c_tag_cfg_ign,
'1' when c_tag_wbm_ign,
'0' when others; -- c_tag_drop_tx, c_tag_cfg_req, c_tag_wbm_req
pass_empty_i when c_tag_pass_tx,
pass_empty_i when c_tag_pass_on,
(pass_empty_i or cfg_empty_i) when c_tag_cfg_ign,
(pass_empty_i or wbm_empty_i) when c_tag_wbm_ign,
'1' when others; -- c_tag_drop_tx, c_tag_cfg_req, c_tag_wbm_req
with r_tag_value select
s_cfg_mux <=
'1' when c_tag_cfg_req,
'1' when c_tag_cfg_ign,
'0' when others;
cfg_empty_i when c_tag_cfg_req,
(pass_empty_i or cfg_empty_i) when c_tag_cfg_ign,
'1' when others;
with r_tag_value select
s_wbm_mux <=
'1' when c_tag_wbm_req,
'1' when c_tag_wbm_ign,
'0' when others;
wbm_empty_i when c_tag_wbm_req,
(pass_empty_i or wbm_empty_i) when c_tag_wbm_ign,
'1' when others;
-- Pop the queue we fed into TX
pass_pop_o <= s_can_tx and r_tag_valid and not pass_empty_i and s_pass_mux;
cfg_pop_o <= s_can_tx and r_tag_valid and not cfg_empty_i and s_cfg_mux;
wbm_pop_o <= s_can_tx and r_tag_valid and not wbm_empty_i and s_wbm_mux;
s_tag_pop <= s_can_tx and r_tag_valid and not s_empty_mux;
pass_pop_o <= s_can_tx and r_tag_valid and not s_pass_mux;
cfg_pop_o <= s_can_tx and r_tag_valid and not s_cfg_mux;
wbm_pop_o <= s_can_tx and r_tag_valid and not s_wbm_mux;
s_tag_pop <= s_can_tx and r_tag_valid and not s_tag_mux;
-- Pop the tag FIFO if the register is empty/emptied
tag_pop_o <= not tag_empty_i and (s_tag_pop or not r_tag_valid);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment