Skip to content
Snippets Groups Projects
Commit ae612c79 authored by Reinier van der Walle's avatar Reinier van der Walle
Browse files

processed review comments

parent c153649f
No related branches found
No related tags found
1 merge request!183Resolve L2SDP-557
Pipeline #22653 passed
...@@ -199,37 +199,37 @@ BEGIN ...@@ -199,37 +199,37 @@ BEGIN
-- Using v_bsn_at_sync to ensure correct behavior when in_sosi has no latency compared to bs_sosi. -- Using v_bsn_at_sync to ensure correct behavior when in_sosi has no latency compared to bs_sosi.
VARIABLE v_bsn_at_sync : STD_LOGIC_VECTOR(g_bsn_w-1 DOWNTO 0); VARIABLE v_bsn_at_sync : STD_LOGIC_VECTOR(g_bsn_w-1 DOWNTO 0);
BEGIN BEGIN
v_bsn_at_sync := bsn_at_sync_reg; v_bsn_at_sync := bsn_at_sync_reg;
v_bsn_ok := bsn_ok_reg; v_bsn_ok := bsn_ok_reg;
out_valid <= out_valid_reg; out_valid <= out_valid_reg;
cnt_discarded_en <= '0';
IF bs_sosi.sync = '1' THEN IF bs_sosi.sync = '1' THEN
v_bsn_at_sync := bs_sosi.bsn; v_bsn_at_sync := bs_sosi.bsn(g_bsn_w-1 DOWNTO 0);
END IF; END IF;
IF TO_UINT(in_sosi.channel) = g_check_channel THEN IF TO_UINT(in_sosi.channel) = g_check_channel THEN
-- Compare bsn at sync of in_sosi to bsn at sync of bs_sosi.
IF in_sosi.sync = '1' THEN IF in_sosi.sync = '1' THEN
IF in_sosi.bsn = v_bsn_at_sync THEN -- Compare bsn at sync of in_sosi to bsn at sync of bs_sosi.
IF UNSIGNED(in_sosi.bsn(g_bsn_w-1 DOWNTO 0)) = UNSIGNED(v_bsn_at_sync) THEN
v_bsn_ok := '1'; v_bsn_ok := '1';
ELSE ELSE
v_bsn_ok := '0'; v_bsn_ok := '0';
END IF; END IF;
-- set cnt_discarded_en to control u_discarded_counter.
cnt_discarded_en <= NOT v_bsn_ok;
END IF; END IF;
-- Setting out_valid to control the discarding at packet level. -- Setting out_valid to control the discarding at packet level.
IF in_sosi.sop = '1' THEN IF in_sosi.sop = '1' THEN
out_valid <= v_bsn_ok; out_valid <= v_bsn_ok;
END IF; END IF;
-- set cnt_discarded_en to control u_discarded_counter.
cnt_discarded_en <= in_sosi.sync AND NOT v_bsn_ok;
ELSE ELSE
IF in_sosi.sop = '1' THEN IF in_sosi.sop = '1' THEN
out_valid <= '1'; -- Packets with channel unequal to g_check_channel are always valid out_valid <= '1'; -- Packets with channel unequal to g_check_channel are always valid
END IF; END IF;
cnt_discarded_en <= '0'; -- Packets with channel unequal to g_check_channel cannot be discarded.
END IF; END IF;
bsn_ok <= v_bsn_ok; -- bsn_ok is used to indicate if the bsn is correct for the entire sync period of g_check_channel. bsn_ok <= v_bsn_ok; -- bsn_ok is used to indicate if the bsn is correct for the entire sync period of g_check_channel.
bsn_at_sync <= v_bsn_at_sync; -- register to store the bsn at sync of bs_sosi. bsn_at_sync <= v_bsn_at_sync; -- register to store the bsn at sync of bs_sosi.
......
...@@ -63,7 +63,11 @@ ARCHITECTURE tb OF tb_dp_block_validate_bsn_at_sync IS ...@@ -63,7 +63,11 @@ ARCHITECTURE tb OF tb_dp_block_validate_bsn_at_sync IS
CONSTANT c_gap_size : NATURAL := 4; CONSTANT c_gap_size : NATURAL := 4;
CONSTANT c_nof_sync : NATURAL := 5; CONSTANT c_nof_sync : NATURAL := 5;
CONSTANT c_nof_blk : NATURAL := g_nof_blocks_per_sync * c_nof_sync; CONSTANT c_nof_blk : NATURAL := g_nof_blocks_per_sync * c_nof_sync;
-- choosing c_check_channel such that it corresponds with a channel from stimuli on a sync because the channel field is generated by a counter. -- The u_stimuli_in creates counter data in stimuli_sosi.channel. Therefore
-- choose some c_check_channel value (> 0, < c_nof_blk) that will occur in
-- the future. Hence this c_check_channel value will occur once in the tb,
-- because stimuli_sosi.channel keeps incrementing. Choosing c_check_channel
-- such that it corresponds with a channel from stimuli on a sync pulse.
CONSTANT c_check_channel : NATURAL := g_nof_blocks_per_sync; -- can be c_check_channel MOD g_nof_blocks_per_sync = 0 but not larger than c_nof_blk. CONSTANT c_check_channel : NATURAL := g_nof_blocks_per_sync; -- can be c_check_channel MOD g_nof_blocks_per_sync = 0 but not larger than c_nof_blk.
SIGNAL dp_clk : STD_LOGIC := '1'; SIGNAL dp_clk : STD_LOGIC := '1';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment