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 ee230cc31c3f325471d368daf8609602adc5b408..45f4be06831c117b547a6c89da4c4cdc061fb3f6 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_statistics_offload.vhd @@ -135,6 +135,7 @@ ENTITY sdp_statistics_offload IS ip_src_addr : IN STD_LOGIC_VECTOR(c_network_ip_addr_w-1 DOWNTO 0); gn_index : IN NATURAL; + ring_info : IN t_ring_info := c_ring_info_rst; -- only needed for XST sdp_info : IN t_sdp_info; subband_calibrated_flag : IN STD_LOGIC := '0'; nof_crosslets : IN STD_LOGIC_VECTOR(c_sdp_nof_crosslets_reg_w-1 DOWNTO 0) := (OTHERS => '0'); @@ -294,13 +295,13 @@ BEGIN -- Derive and pipeline dynamic parameters gn_index_reg <= gn_index WHEN rising_edge(dp_clk); pn_index <= func_sdp_gn_index_to_pn_index(gn_index) WHEN rising_edge(dp_clk); - rn_index <= gn_index - TO_UINT(sdp_info.O_rn) WHEN rising_edge(dp_clk); + rn_index <= gn_index - TO_UINT(ring_info.O_rn) WHEN rising_edge(dp_clk); local_si_offset <= pn_index * c_sdp_S_pn WHEN rising_edge(dp_clk); nof_cycles_dly <= gn_index * g_offload_time WHEN rising_edge(dp_clk); nof_packets <= func_sdp_get_stat_nof_packets(g_statistics_type, c_sdp_S_pn, g_P_sq, r.nof_crosslets) WHEN rising_edge(dp_clk); - remote_rn <= func_nof_hops_to_source_rn(r.instance_count, rn_index, TO_UINT(sdp_info.N_rn), g_crosslets_direction); - remote_gn <= TO_UINT(sdp_info.O_rn) + remote_rn; + remote_rn <= func_ring_nof_hops_to_source_rn(r.instance_count, rn_index, TO_UINT(ring_info.N_rn), g_crosslets_direction); + remote_gn <= TO_UINT(ring_info.O_rn) + remote_rn; remote_pn <= func_sdp_gn_index_to_pn_index(remote_gn) WHEN rising_edge(dp_clk); remote_si_offset <= remote_pn * c_sdp_S_pn WHEN rising_edge(dp_clk); diff --git a/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_statistics_offload.vhd b/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_statistics_offload.vhd index 24e9ea2bd2849c2ac9bce59626b9caa68c9a95eb..0c30fa8fb3a9d587e752b79d106fd4715073fec6 100644 --- a/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_statistics_offload.vhd +++ b/applications/lofar2/libraries/sdp/tb/vhdl/tb_sdp_statistics_offload.vhd @@ -101,13 +101,15 @@ ARCHITECTURE tb OF tb_sdp_statistics_offload IS '1', -- f_adc, 0 = 160 MHz, 1 = 200 MHz '0', -- fsub_type, 0 = critically sampled, 1 = oversampled '0', -- beam_repositioning_flag - x"01", -- O_si, not used - x"02", -- N_si, not used - TO_UVEC(g_O_rn, 8), -- O_rn - TO_UVEC(g_N_rn, 8), -- N_rn x"1400" -- block_period = 5120 ); + CONSTANT c_exp_ring_info : t_ring_info := (TO_UVEC(g_O_rn, 8), -- GN index of first GN in ring + TO_UVEC(g_N_rn, 8), -- number of GN in ring + '0', -- use_cable_to_next_rn + '0' -- use_cable_to_previous_rn + ); + CONSTANT c_beamlet_index : NATURAL := g_beamset_id * c_sdp_S_sub_bf; CONSTANT c_crosslets_info_rec : t_sdp_crosslets_info := (offset_arr => (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), step => 16); @@ -340,7 +342,7 @@ BEGIN cur_crosslet <= test_offload_eop_cnt MOD g_nof_crosslets; -- derive source RN index - source_rn <= func_nof_hops_to_source_rn(cur_X_sq_cell, rn_index, g_N_rn, g_crosslets_direction); + source_rn <= func_ring_nof_hops_to_source_rn(cur_X_sq_cell, rn_index, g_N_rn, g_crosslets_direction); source_gn <= g_O_rn + source_rn; -- Prepare exp_sdp_stat_header before test_offload_sosi.eop, so that p_exp_sdp_stat_header can @@ -702,7 +704,7 @@ BEGIN ip_src_addr => c_ip_src_addr, gn_index => gn_index, - + ring_info => c_exp_ring_info, sdp_info => c_exp_sdp_info, subband_calibrated_flag => subband_calibrated_flag, nof_crosslets => c_mm_nof_crosslets,