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 bfacace8b2242da2c5cd1473e67e4f6df1ea99ce..a10f7d020e1248f294300d48213b9058b921e575 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 @@ -32,7 +32,7 @@ -- Usage: -- > as 8 -- > run -a --- . for header: view test_offload_sosi and the rx_sdp_stat_header.app fields +-- . for header: view rx_offload_sosi and the rx_sdp_stat_header.app fields -- . for payload: view rx_val, rx_data and exp_data ------------------------------------------------------------------------------- @@ -172,15 +172,15 @@ ARCHITECTURE tb OF tb_sdp_statistics_offload IS SIGNAL in_crosslets_info_rec : t_sdp_crosslets_info; SIGNAL in_crosslets_info_slv : STD_LOGIC_VECTOR(c_sdp_crosslets_info_reg_w-1 DOWNTO 0); - SIGNAL offload_data : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0); -- 32 bit - SIGNAL offload_sosi : t_dp_sosi; - SIGNAL offload_siso : t_dp_siso := c_dp_siso_rst; + SIGNAL sdp_offload_data : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0); -- 32 bit + SIGNAL sdp_offload_sosi : t_dp_sosi; + SIGNAL sdp_offload_siso : t_dp_siso := c_dp_siso_rst; - SIGNAL test_offload_en : STD_LOGIC := '0'; - SIGNAL test_offload_data : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0); -- 32 bit - SIGNAL test_offload_sosi : t_dp_sosi := c_dp_sosi_rst; - SIGNAL test_offload_sop_cnt : NATURAL := 0; - SIGNAL test_offload_eop_cnt : NATURAL := 0; + SIGNAL rx_offload_en : STD_LOGIC := '0'; + SIGNAL rx_offload_data : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0); -- 32 bit + SIGNAL rx_offload_sosi : t_dp_sosi := c_dp_sosi_rst; + SIGNAL rx_offload_sop_cnt : NATURAL := 0; + SIGNAL rx_offload_eop_cnt : NATURAL := 0; SIGNAL rx_hdr_fields_out : STD_LOGIC_VECTOR(1023 DOWNTO 0); SIGNAL rx_hdr_fields_raw : STD_LOGIC_VECTOR(1023 DOWNTO 0) := (OTHERS => '0'); @@ -316,7 +316,7 @@ BEGIN proc_mem_mm_bus_wr(c_reg_enable_mm_addr_enable, 1, mm_clk, enable_miso, enable_mosi); proc_common_wait_some_cycles(mm_clk, c_cross_clock_domain_latency); proc_common_wait_some_cycles(dp_clk, 1); - test_offload_en <= '1'; + rx_offload_en <= '1'; WAIT; END PROCESS; @@ -324,31 +324,31 @@ BEGIN p_test_counters : PROCESS(dp_clk) BEGIN IF rising_edge(dp_clk) THEN - -- Count test_offload_sosi packets - IF test_offload_sosi.sop = '1' THEN - test_offload_sop_cnt <= test_offload_sop_cnt + 1; -- early count + -- Count rx_offload_sosi packets + IF rx_offload_sosi.sop = '1' THEN + rx_offload_sop_cnt <= rx_offload_sop_cnt + 1; -- early count END IF; - IF test_offload_sosi.eop = '1' THEN - test_offload_eop_cnt <= test_offload_eop_cnt + 1; -- after count + IF rx_offload_sosi.eop = '1' THEN + rx_offload_eop_cnt <= rx_offload_eop_cnt + 1; -- after count END IF; END IF; END PROCESS; - -- Count sync intervals using in_sosi.sync, because there is no test_offload_sosi.sync + -- Count sync intervals using in_sosi.sync, because there is no rx_offload_sosi.sync in_sync_cnt <= in_sync_cnt + 1 WHEN rising_edge(dp_clk) AND in_sosi.sync = '1'; - test_sync_cnt <= in_sync_cnt - 1; -- optionally adjust to fit test_offload_sosi + test_sync_cnt <= in_sync_cnt - 1; -- optionally adjust to fit rx_offload_sosi -- derive current X_sq correlator cell index - cur_X_sq_cell <= (test_offload_eop_cnt / g_nof_crosslets) MOD c_nof_used_P_sq; + cur_X_sq_cell <= (rx_offload_eop_cnt / g_nof_crosslets) MOD c_nof_used_P_sq; -- derive current N_crosslets index index - cur_crosslet <= test_offload_eop_cnt MOD g_nof_crosslets; + cur_crosslet <= rx_offload_eop_cnt MOD g_nof_crosslets; -- derive source RN index 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 - -- verify it at test_offload_sosi.eop. + -- Prepare exp_sdp_stat_header before rx_offload_sosi.eop, so that p_exp_sdp_stat_header can + -- verify it at rx_offload_sosi.eop. -- For all statistics exp_dp_bsn <= TO_SVEC(c_bsn_init + 1 + test_sync_cnt * c_nof_block_per_sync, 64); @@ -433,25 +433,25 @@ BEGIN rx_sdp_stat_header <= func_sdp_map_stat_header(rx_hdr_fields_raw); - p_verify_header : PROCESS(test_offload_sosi) + p_verify_header : PROCESS(rx_offload_sosi) VARIABLE v_bool : BOOLEAN; BEGIN - -- Prepare exp_sdp_stat_header before test_offload_sosi.eop, so that it can be verified at test_offload_sosi.eop - IF test_offload_sosi.eop = '1' THEN + -- Prepare exp_sdp_stat_header before rx_offload_sosi.eop, so that it can be verified at rx_offload_sosi.eop + IF rx_offload_sosi.eop = '1' THEN v_bool := func_sdp_verify_stat_header(g_statistics_type, rx_sdp_stat_header, exp_sdp_stat_header); END IF; END PROCESS; -- Count number of packets in a sync interval. - -- There is no active test_offload_sosi.sync to restart the count, therefore - -- use in_sosi.sync to reset the count for the next test_offload_sosi.sync + -- There is no active rx_offload_sosi.sync to restart the count, therefore + -- use in_sosi.sync to reset the count for the next rx_offload_sosi.sync -- interval p_rx_packet_cnt : PROCESS(dp_clk) BEGIN IF rising_edge(dp_clk) THEN IF in_sosi.sync = '1' THEN rx_packet_cnt <= 0; - ELSIF test_offload_sosi.eop = '1' THEN + ELSIF rx_offload_sosi.eop = '1' THEN rx_packet_cnt <= rx_packet_cnt + 1; END IF; END IF; @@ -470,10 +470,10 @@ BEGIN p_verify_nof_valid_per_packet : PROCESS(dp_clk) BEGIN IF rising_edge(dp_clk) THEN - IF test_offload_sosi.eop = '1' THEN + IF rx_offload_sosi.eop = '1' THEN rx_valid_cnt <= 0; ASSERT rx_valid_cnt = c_packet_size - 1 REPORT "Wrong number of valid per packet" SEVERITY ERROR; - ELSIF test_offload_sosi.valid = '1' THEN + ELSIF rx_offload_sosi.valid = '1' THEN rx_valid_cnt <= rx_valid_cnt + 1; END IF; END IF; @@ -493,8 +493,8 @@ BEGIN BEGIN IF rising_edge(dp_clk) THEN rx_val <= '0'; - v_rx_data := TO_UINT(test_offload_sosi.data); - IF test_offload_sosi.valid = '1' THEN + v_rx_data := TO_UINT(rx_offload_sosi.data); + IF rx_offload_sosi.valid = '1' THEN IF g_statistics_type = "SST" THEN -- Indices: -- W: 0 1 2 3 4 5 ... 1022 1023 @@ -659,10 +659,10 @@ BEGIN reg_hdr_dat_mosi => offload_rx_hdr_dat_mosi, reg_hdr_dat_miso => offload_rx_hdr_dat_miso, - snk_in_arr(0) => offload_sosi, - snk_out_arr(0) => offload_siso, + snk_in_arr(0) => sdp_offload_sosi, + snk_out_arr(0) => sdp_offload_siso, - src_out_arr(0) => test_offload_sosi, + src_out_arr(0) => rx_offload_sosi, hdr_fields_out_arr(0) => rx_hdr_fields_out, hdr_fields_raw_arr(0) => rx_hdr_fields_raw @@ -697,8 +697,8 @@ BEGIN -- ST in_sosi => in_sosi, - out_sosi => offload_sosi, - out_siso => offload_siso, + out_sosi => sdp_offload_sosi, + out_siso => sdp_offload_siso, -- Inputs from other blocks eth_src_mac => c_eth_src_mac, @@ -717,7 +717,7 @@ BEGIN ASSERT c_crosslets_info_rec = func_sdp_map_crosslets_info(c_crosslets_info_slv) REPORT "Error in func_sdp_map_crosslets_info()" SEVERITY FAILURE; -- To view the 32 bit 1GbE offload data more easily in the Wave window - offload_data <= offload_sosi.data(c_word_w-1 DOWNTO 0); - test_offload_data <= test_offload_sosi.data(c_word_w-1 DOWNTO 0); + offload_data <= sdp_offload_sosi.data(c_word_w-1 DOWNTO 0); + rx_offload_data <= rx_offload_sosi.data(c_word_w-1 DOWNTO 0); END tb;