diff --git a/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_xsub_one/tb_lofar2_unb2b_sdp_station_xsub_one_xst_offload.vhd b/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_xsub_one/tb_lofar2_unb2b_sdp_station_xsub_one_xst_offload.vhd index fc24b687fddfaee847726ec8b8e5690f254aa374..3ea6397634aea1802adacf6985b0f7f951f34c18 100644 --- a/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_xsub_one/tb_lofar2_unb2b_sdp_station_xsub_one_xst_offload.vhd +++ b/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_xsub_one/tb_lofar2_unb2b_sdp_station_xsub_one_xst_offload.vhd @@ -220,7 +220,7 @@ BEGIN -- Enable xsub ---------------------------------------------------------------------------- mmf_mm_bus_wr(c_mm_file_reg_bsn_sync_scheduler_xsub, 1, c_ctrl_interval_size, tb_clk); -- Interval size - mmf_mm_bus_wr(c_mm_file_reg_bsn_sync_scheduler_xsub, 2, 1, tb_clk); -- first write low then high part + mmf_mm_bus_wr(c_mm_file_reg_bsn_sync_scheduler_xsub, 2, c_nof_block_per_sync, tb_clk); -- first write low then high part mmf_mm_bus_wr(c_mm_file_reg_bsn_sync_scheduler_xsub, 3, 0, tb_clk); -- assume v_bsn < 2**31-1 mmf_mm_bus_wr(c_mm_file_reg_bsn_sync_scheduler_xsub, 0, 1, tb_clk); -- enable ---------------------------------------------------------------------------- diff --git a/applications/lofar2/libraries/sdp/src/vhdl/node_sdp_correlator.vhd b/applications/lofar2/libraries/sdp/src/vhdl/node_sdp_correlator.vhd index 365c07803a5df9b5a92ab26327a41612bd613976..530ce569f6a5528af4e6b18a1cbc189deac959c5 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/node_sdp_correlator.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/node_sdp_correlator.vhd @@ -243,7 +243,7 @@ BEGIN --------------------------------------------------------------- -- REG_NOF_CROSSLETS --------------------------------------------------------------- - u_crosslets_info : ENTITY common_lib.mms_common_reg + u_nof_crosslets : ENTITY common_lib.mms_common_reg GENERIC MAP( g_mm_reg => c_sdp_mm_reg_nof_crosslets ) @@ -261,8 +261,10 @@ BEGIN in_reg => nof_crosslets, out_reg => nof_crosslets_reg ); - -- Force nof crosslets to max nof crosslets if a higher value is written via MM. - nof_crosslets <= nof_crosslets_reg WHEN TO_UINT(nof_crosslets_reg) <= c_sdp_N_crosslets_max ELSE TO_UVEC(c_sdp_N_crosslets_max, c_sdp_nof_crosslets_reg_w); + -- Force nof crosslets to max nof crosslets if a higher value is written or to 1 if a lower value is written via MM. + nof_crosslets <= TO_UVEC(1, c_sdp_nof_crosslets_reg_w) WHEN TO_UINT(nof_crosslets_reg) < 1 ELSE + nof_crosslets_reg WHEN TO_UINT(nof_crosslets_reg) <= c_sdp_N_crosslets_max ELSE + TO_UVEC(c_sdp_N_crosslets_max, c_sdp_nof_crosslets_reg_w); --------------------------------------------------------------- -- XST UDP offload diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd index a3300309701ba5fae13e00f2966376d56677d608..cafa91bba0f77eb072ad29b1026fbfb47ee789ac 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd @@ -332,7 +332,7 @@ PACKAGE sdp_pkg is adr_w => 1, dat_w => ceil_log2(c_sdp_N_crosslets_max+1), nof_dat => 1, - init_sl => '1'); -- Default = 1 + init_sl => '0'); -- Default = 1 CONSTANT c_sdp_nof_crosslets_reg_w : NATURAL := c_sdp_mm_reg_nof_crosslets.nof_dat*c_sdp_mm_reg_nof_crosslets.dat_w; CONSTANT c_sdp_xst_nof_clk_per_sync_min : NATURAL := (c_sdp_f_adc_MHz *10**6) / 10; -- 0.1 second diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd index 974a74304118ebb2c067209ed61e0d5a870270b9..fe11feeeb7a37c7fecd7761e744e89e0556dc073 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd @@ -244,12 +244,11 @@ BEGIN v.start_pulse := '1'; v.start_address := 0; v.block_count := 0; + IF g_statistics_type = "XST" AND TO_UINT(nof_crosslets) = 1 THEN + v.block_count := c_sdp_N_crosslets_max; -- Instead of setting v.block_count to 0 we need to set it to N_crosslets_max = 7 to prevent another block to stream out. + END IF; v.crosslet_count := 0; v.nof_crosslets := TO_UINT(nof_crosslets); -- register nof_crosslets to make sure it does not change during packet output. - -- Disable output by setting block_count to c_nof_packets-1 when the nof_crosslets is set to 0. - IF g_statistics_type = "XST" AND TO_UINT(nof_crosslets) = 0 THEN - v.block_count := c_nof_packets-1; - END IF; ELSIF done = '1' THEN -- Use done to start next packets IF r.block_count < c_nof_packets-1 THEN @@ -260,27 +259,26 @@ BEGIN END IF; v.start_pulse := '1'; v.block_count := r.block_count + 1; + + IF g_statistics_type = "XST" THEN + IF r.crosslet_count < r.nof_crosslets-1 THEN + v.crosslet_count := r.crosslet_count + 1; + ELSE + v.crosslet_count := 0; + v.block_count := r.block_count + 1 + c_sdp_N_crosslets_max - r.nof_crosslets; -- skip block indices for unused XST blocks. + END IF; + END IF; + ELSE -- Prepare for next trigger interval. v.start_address := 0; v.block_count := 0; + v.crosslet_count := 0; END IF; - - IF g_statistics_type = "XST" THEN - IF r.crosslet_count < r.nof_crosslets-1 THEN - v.crosslet_count := r.crosslet_count + 1; - ELSE - v.crosslet_count := 0; - IF r.block_count < c_nof_packets-1 THEN -- skip block indices for unused XST blocks - v.block_count := r.block_count + 1 + c_sdp_N_crosslets_max - r.nof_crosslets; - END IF; - END IF; - END IF; - END IF; - -- Release header info per packet offload IF trigger = '1' OR done = '1' THEN + -- Release header info per packet offload v.dp_header_info := dp_header_info; END IF; nxt_r <= v;