Skip to content
Snippets Groups Projects
Commit 4212e0ff authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Merge branch 'master' into L2SDP-563

parents b861763b 59535c8a
No related branches found
No related tags found
1 merge request!184Corrected using c_mm_file_reg_bsn_sync_scheduler_xsub. Shortened the sim speed...
Pipeline #23215 passed
...@@ -9,7 +9,6 @@ lofar2_unb2b_sdp_station_bf-rc125dfd6d | 2021-04-21 | R vd Walle ...@@ -9,7 +9,6 @@ lofar2_unb2b_sdp_station_bf-rc125dfd6d | 2021-04-21 | R vd Walle
lofar2_unb2b_sdp_station_bf-r087d98be6 | 2021-06-14 | R vd Walle | See $UPE_GEAR/peripherals/tc_lofar2_unb2b_beamformer.py lofar2_unb2b_sdp_station_bf-r087d98be6 | 2021-06-14 | R vd Walle | See $UPE_GEAR/peripherals/tc_lofar2_unb2b_beamformer.py
lofar2_unb2b_sdp_station_xsub_one-r087d98be6 | 2021-06-14 | R vd Walle | lofar2_unb2b_sdp_station_xsub_one-r087d98be6 | 2021-06-14 | R vd Walle |
unb2b_minimal-rce6b96eed | 2021-08-26 | P. Donker | unb2b_minimal with new mmap, rbf maid with option --unb2_factory unb2b_minimal-rce6b96eed | 2021-08-26 | P. Donker | unb2b_minimal with new mmap, rbf maid with option --unb2_factory
lofar2_unb2c_sdp_station_full-rbd06c78bb | 2021-11-11 | R vd Walle | Deprecated, statistics packets have wrong data_id. Better use newer version.
lofar2_unb2b_sdp_station_full-r8026db491 | 2021-11-15 | R vd Walle | Deprecated, statistics packets have wrong data_id. Better use newer version. lofar2_unb2b_sdp_station_full-r8026db491 | 2021-11-15 | R vd Walle | Deprecated, statistics packets have wrong data_id. Better use newer version.
lofar2_unb2b_sdp_station_full-r13eddc87d | 2021-12-14 | R vd Walle | Lofar2 SDP station full design for UniBoard2b. lofar2_unb2b_sdp_station_full-r13eddc87d | 2021-12-14 | R vd Walle | Lofar2 SDP station full design for UniBoard2b.
lofar2_unb2c_sdp_station_full-rcfca746a9 | 2021-12-14 | R vd Walle | Lofar2 SDP station full design for UniBoard2c. lofar2_unb2c_sdp_station_full-rfc9844d8e | 2021-12-16 | R vd Walle | Lofar2 SDP station full design for UniBoard2c.
File deleted
...@@ -133,7 +133,6 @@ BEGIN ...@@ -133,7 +133,6 @@ BEGIN
); );
-- discarded counter -- discarded counter
cnt_discarded_en <= '1' WHEN in_sosi.sync = '1' AND bsn_ok = '0' ELSE '0';
u_discarded_counter : ENTITY common_lib.common_counter u_discarded_counter : ENTITY common_lib.common_counter
GENERIC MAP ( GENERIC MAP (
g_width => c_word_w, g_width => c_word_w,
...@@ -187,16 +186,55 @@ BEGIN ...@@ -187,16 +186,55 @@ BEGIN
-- MM registers in st_clk domain -- MM registers in st_clk domain
reg_wr_arr => OPEN, reg_wr_arr => OPEN,
reg_rd_arr => OPEN, reg_rd_arr => OPEN,
in_reg => count_reg, -- read only in_reg => count_reg, -- read only
out_reg => OPEN -- no write out_reg => OPEN -- no write
); );
bsn_at_sync <= bs_sosi.bsn WHEN bs_sosi.sync = '1' ELSE bsn_at_sync_reg; -- Process to check the bsn at sync. It captures the bsn at the sync of bs_sosi. Then compares that bsn to
bsn_ok <= bsn_ok_reg WHEN in_sosi.sync = '0' ELSE '1' WHEN in_sosi.bsn = bsn_at_sync ELSE '0'; -- the bsn at sync of in_sosi. If they are unequal all packets during that sync period with in_sosi.channel
out_valid <= '1' WHEN in_sosi.sop = '1' AND TO_UINT(in_sosi.channel) /= g_check_channel ELSE -- equal to g_check_channel are discarded.
bsn_ok WHEN in_sosi.sop = '1' AND TO_UINT(in_sosi.channel) = g_check_channel ELSE p_bsn_check : PROCESS(bs_sosi, in_sosi, bsn_at_sync_reg, bsn_ok_reg, out_valid_reg)
out_valid_reg; -- v_bsn_ok used for the first in_sosi packet of a sync period as sync and sop are both '1'.
VARIABLE v_bsn_ok : STD_LOGIC;
-- 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);
BEGIN
v_bsn_at_sync := bsn_at_sync_reg;
v_bsn_ok := bsn_ok_reg;
out_valid <= out_valid_reg;
cnt_discarded_en <= '0';
IF bs_sosi.sync = '1' THEN
v_bsn_at_sync := bs_sosi.bsn(g_bsn_w-1 DOWNTO 0);
END IF;
IF TO_UINT(in_sosi.channel) = g_check_channel THEN
IF in_sosi.sync = '1' 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';
ELSE
v_bsn_ok := '0';
END IF;
-- set cnt_discarded_en to control u_discarded_counter.
cnt_discarded_en <= NOT v_bsn_ok;
END IF;
-- Setting out_valid to control the discarding at packet level.
IF in_sosi.sop = '1' THEN
out_valid <= v_bsn_ok;
END IF;
ELSE
IF in_sosi.sop = '1' THEN
out_valid <= '1'; -- Packets with channel unequal to g_check_channel are always valid
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_at_sync <= v_bsn_at_sync; -- register to store the bsn at sync of bs_sosi.
END PROCESS;
p_dp_clk : PROCESS(dp_rst, dp_clk) p_dp_clk : PROCESS(dp_rst, dp_clk)
BEGIN BEGIN
IF dp_rst='1' THEN IF dp_rst='1' THEN
......
...@@ -46,8 +46,7 @@ ENTITY tb_dp_block_validate_bsn_at_sync IS ...@@ -46,8 +46,7 @@ ENTITY tb_dp_block_validate_bsn_at_sync IS
GENERIC ( GENERIC (
g_nof_blocks_per_sync : NATURAL := 5; g_nof_blocks_per_sync : NATURAL := 5;
g_nof_data_per_blk : NATURAL := 6; g_nof_data_per_blk : NATURAL := 6;
g_bsn_init : NATURAL := 7; -- >= g_nof_blocks_per_sync for discarded sync, < g_nof_blocks_per_sync for no discarded sync, g_bsn_init : NATURAL := 7 -- >= g_nof_blocks_per_sync for discarded sync, < g_nof_blocks_per_sync for no discarded sync.
g_check_channel : NATURAL := 8 -- channel to check, the channel field is a counter value.
); );
END tb_dp_block_validate_bsn_at_sync; END tb_dp_block_validate_bsn_at_sync;
...@@ -64,6 +63,12 @@ ARCHITECTURE tb OF tb_dp_block_validate_bsn_at_sync IS ...@@ -64,6 +63,12 @@ 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;
-- 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.
SIGNAL dp_clk : STD_LOGIC := '1'; SIGNAL dp_clk : STD_LOGIC := '1';
SIGNAL mm_clk : STD_LOGIC := '1'; SIGNAL mm_clk : STD_LOGIC := '1';
...@@ -146,7 +151,7 @@ BEGIN ...@@ -146,7 +151,7 @@ BEGIN
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
u_dut : ENTITY work.dp_block_validate_bsn_at_sync u_dut : ENTITY work.dp_block_validate_bsn_at_sync
GENERIC MAP ( GENERIC MAP (
g_check_channel => g_check_channel g_check_channel => c_check_channel
) )
PORT MAP ( PORT MAP (
dp_rst => rst, dp_rst => rst,
...@@ -191,8 +196,9 @@ BEGIN ...@@ -191,8 +196,9 @@ BEGIN
VARIABLE v_valid_blk : BOOLEAN := TRUE; VARIABLE v_valid_blk : BOOLEAN := TRUE;
BEGIN BEGIN
IF rising_edge(dp_clk) THEN IF rising_edge(dp_clk) THEN
IF reference_sosi.sop = '1' THEN IF reference_sosi.sop = '1' THEN --Decide for each block if it should be valid.
IF g_bsn_init >= g_nof_blocks_per_sync AND TO_UINT(reference_sosi.channel) = g_check_channel THEN -- A block can only be discarded if its channel field corresponds with the check_channel.
IF g_bsn_init >= g_nof_blocks_per_sync AND TO_UINT(reference_sosi.channel) = c_check_channel THEN
v_valid_blk := FALSE; v_valid_blk := FALSE;
ELSE ELSE
v_valid_blk := TRUE; v_valid_blk := TRUE;
...@@ -220,10 +226,8 @@ BEGIN ...@@ -220,10 +226,8 @@ BEGIN
proc_mem_mm_bus_rd(0, mm_clk, reg_miso, reg_mosi); proc_mem_mm_bus_rd(0, mm_clk, reg_miso, reg_mosi);
proc_mem_mm_bus_rd_latency(1, mm_clk); proc_mem_mm_bus_rd_latency(1, mm_clk);
IF g_bsn_init = g_nof_blocks_per_sync THEN -- should have c_nof_sync discarded sync IF g_bsn_init >= g_nof_blocks_per_sync THEN -- should have 1 discarded sync
ASSERT c_nof_sync = TO_UINT(reg_miso.rddata(c_word_w-1 DOWNTO 0)) REPORT "Wrong discarded sync count" SEVERITY ERROR; ASSERT 1 = TO_UINT(reg_miso.rddata(c_word_w-1 DOWNTO 0)) REPORT "Wrong discarded sync count" SEVERITY ERROR;
ELSIF g_bsn_init > g_nof_blocks_per_sync THEN -- should have c_nof_sync -1 discarded sync
ASSERT c_nof_sync-1 = TO_UINT(reg_miso.rddata(c_word_w-1 DOWNTO 0)) REPORT "Wrong discarded sync count" SEVERITY ERROR;
ELSE -- 0 discarded sync ELSE -- 0 discarded sync
ASSERT 0 = TO_UINT(reg_miso.rddata(c_word_w-1 DOWNTO 0)) REPORT "Wrong discarded sync count" SEVERITY ERROR; ASSERT 0 = TO_UINT(reg_miso.rddata(c_word_w-1 DOWNTO 0)) REPORT "Wrong discarded sync count" SEVERITY ERROR;
END IF; END IF;
......
...@@ -43,13 +43,10 @@ ARCHITECTURE tb OF tb_tb_dp_block_validate_bsn_at_sync IS ...@@ -43,13 +43,10 @@ ARCHITECTURE tb OF tb_tb_dp_block_validate_bsn_at_sync IS
BEGIN BEGIN
-- g_nof_blocks_per_sync : NATURAL := 5; -- g_nof_blocks_per_sync : NATURAL := 5;
-- g_nof_data_per_blk : NATURAL := 6; -- g_nof_data_per_blk : NATURAL := 6;
-- g_bsn_init : NATURAL := 7; -- >= g_nof_blocks_per_sync for discarded sync, < g_nof_blocks_per_sync for no discarded sync, -- g_bsn_init : NATURAL := 7 -- >= g_nof_blocks_per_sync for discarded sync, < g_nof_blocks_per_sync for no discarded sync.
-- g_check_channel : NATURAL := 8 -- channel to check, the channel field is a counter value.
u_smaller : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, c_blk_per_sync - 4); -- g_bsn_init < g_nof_blocks_per_sync
u_smaller : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, 0, 8); -- g_bsn_init < g_nof_blocks_per_sync u_equal : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, c_blk_per_sync); -- g_bsn_init = g_nof_blocks_per_sync
u_equal : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, 5, 8); -- g_bsn_init = g_nof_blocks_per_sync u_larger : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, c_blk_per_sync + 4); -- g_bsn_init > g_nof_blocks_per_sync
u_larger : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, 8, 8); -- g_bsn_init > g_nof_blocks_per_sync
u_ch_on_sync : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, 5, 10); -- g_check_channel MOD c_blk_per_sync = 0,
u_no_ch : ENTITY work.tb_dp_block_validate_bsn_at_sync GENERIC MAP(c_blk_per_sync, c_data_per_blk, 8, 500); -- channel will never reach 500
END tb; END tb;
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