From 4b472bf5d247924a4ae43bce3b347e11792e5aeb Mon Sep 17 00:00:00 2001 From: Reinier van der Walle <walle@astron.nl> Date: Tue, 28 Sep 2021 13:54:54 +0200 Subject: [PATCH] processed review comments --- .../lofar2/libraries/sdp/sdp.peripheral.yaml | 3 +- .../lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd | 1 - .../sdp/src/vhdl/sdp_statistics_offload.vhd | 36 ++++++++----------- libraries/dsp/st/st.peripheral.yaml | 2 +- 4 files changed, 18 insertions(+), 24 deletions(-) diff --git a/applications/lofar2/libraries/sdp/sdp.peripheral.yaml b/applications/lofar2/libraries/sdp/sdp.peripheral.yaml index c5d2937af8..25a06589b5 100644 --- a/applications/lofar2/libraries/sdp/sdp.peripheral.yaml +++ b/applications/lofar2/libraries/sdp/sdp.peripheral.yaml @@ -55,7 +55,8 @@ peripherals: mm_port_type: REG mm_port_span: 2 * MM_BUS_SIZE mm_port_description: | - "The SDP nof crosslets contains the number of crosslets that are being sent out the UDP offload" + "The SDP nof crosslets contains the number of crosslets that are being sent out the UDP offload + where 1 <= nof_crosslets <= N_crosslets_max" fields: - - { field_name: nof_crosslets, access_mode: RW, address_offset: 0x0 } - - { field_name: unused, access_mode: RW, address_offset: 0x4 } diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd index cafa91bba0..a8342a4910 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd @@ -69,7 +69,6 @@ PACKAGE sdp_pkg is -- L3 SDP Decision: SDP Parameter definitions CONSTANT c_sdp_f_adc_MHz : NATURAL := 200; CONSTANT c_sdp_N_beamsets : NATURAL := 2; - CONSTANT c_sdp_N_crosslets : NATURAL := 1; CONSTANT c_sdp_N_crosslets_max : NATURAL := 7; CONSTANT c_sdp_N_fft : NATURAL := 1024; CONSTANT c_sdp_N_pn_lb : NATURAL := 16; 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 27d6bd5abe..202357ec78 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd @@ -159,7 +159,6 @@ ARCHITECTURE str OF sdp_statistics_offload IS SIGNAL bsn_at_sync : STD_LOGIC_VECTOR(63 DOWNTO 0) := (OTHERS => '0'); SIGNAL selected_crosslet_arr : t_selected_crosslet_arr(c_sdp_N_crosslets_max-1 DOWNTO 0); - --SIGNAL sdp_data_id : STD_LOGIC_VECTOR(31 DOWNTO 0); BEGIN @@ -244,31 +243,26 @@ 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 := 1; + v.crosslet_count := 0; v.nof_crosslets := TO_UINT(nof_crosslets); -- register nof_crosslets to make sure it does not change during packet output. ELSIF done = '1' THEN -- Use done to start next packets - IF r.block_count < c_nof_packets-1 THEN - IF r.block_count MOD c_nof_data_per_step = 0 THEN - v.start_address := r.block_count / c_nof_data_per_step * c_block_size; -- jump to first packet in next block - ELSE - v.start_address := r.start_address + c_data_size; -- step to next packet within block + IF r.block_count < c_nof_packets-1 THEN + IF g_statistics_type /= "XST" OR r.crosslet_count < r.nof_crosslets-1 THEN + IF r.block_count MOD c_nof_data_per_step = 0 THEN + v.start_address := r.block_count / c_nof_data_per_step * c_block_size; -- jump to first packet in next block + ELSE + v.start_address := r.start_address + c_data_size; -- step to next packet within block + END IF; + v.start_pulse := '1'; + v.block_count := r.block_count + 1; + v.crosslet_count := r.crosslet_count + 1; + ELSE + v.crosslet_count := 0; + -- skip block indices for unused XST blocks in this P_sq iteration by setting the block count to the next multiple of N_crosslets_max i.e. 7, 14, 21, etc. + v.block_count := r.block_count + 1 + (c_sdp_N_crosslets_max - r.nof_crosslets); 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; diff --git a/libraries/dsp/st/st.peripheral.yaml b/libraries/dsp/st/st.peripheral.yaml index f09f398525..e6f4c5cb08 100644 --- a/libraries/dsp/st/st.peripheral.yaml +++ b/libraries/dsp/st/st.peripheral.yaml @@ -139,7 +139,7 @@ peripherals: # Parameters of pi_st_xst.py, fixed in node_sdp_correlator.vhd / sdp_pkg.vhd - { name: g_nof_streams, value: 9 } # P_sq # Parameters of st_xst.vhd, st_xsq_arr.vhd fixed in node_sdp_correlator.vhd / sdp_pkg.vhd - - { name: g_nof_crosslets, value: 7 } # N_crosslets + - { name: g_nof_crosslets, value: 7 } # N_crosslets_max - { name: g_nof_signal_inputs, value: 12 } # S_pn = 12 - { name: g_in_data_w, value: 16 } # W_crosslet = 16 - { name: g_stat_data_w, value: 64 } # W_statistic = 64 -- GitLab