diff --git a/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub.vhd b/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub.vhd index 0fe6bf7aed8d37c628b42219866ec7245209addd..44f22b5dbe0e4c6e6190adda0914f29621adfb2d 100644 --- a/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub.vhd +++ b/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub.vhd @@ -107,7 +107,6 @@ ARCHITECTURE tb OF tb_lofar2_unb2b_sdp_station_fsub IS TyPE t_slv_64_subbands_arr IS ARRAY (INTEGER RANGE <>) OF t_slv_64_arr(0 TO c_sdp_N_sub); -- MM - CONSTANT c_mm_file_reg_ppsh : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "PIO_PPS"; CONSTANT c_mm_file_reg_bsn_source_v2 : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_BSN_SOURCE_V2"; CONSTANT c_mm_file_reg_bsn_scheduler_wg : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_BSN_SCHEDULER"; CONSTANT c_mm_file_reg_diag_wg : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_WG"; @@ -250,12 +249,12 @@ BEGIN proc_common_wait_until_hi_lo(ext_clk, ext_pps); ---------------------------------------------------------------------------- - -- Enable BS + -- Enable BSN ---------------------------------------------------------------------------- mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 3, 0, tb_clk); mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 2, 0, tb_clk); -- Init BSN = 0 mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 1, c_nof_clk_per_sync, tb_clk); -- nof_block_per_sync - mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 0, 16#00000003#, tb_clk); -- Enable BS at PPS + mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 0, 16#00000003#, tb_clk); -- Enable BSN at PPS ---------------------------------------------------------------------------- -- Enable WG diff --git a/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub_sst_offload.vhd b/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub_sst_offload.vhd index 1c03a1ae3d0ae8bb3f6cc96a9d808c4a50b97242..ac3bffbe3e31ee2d4815f4d42c2d7bb2279103ec 100644 --- a/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub_sst_offload.vhd +++ b/applications/lofar2/designs/lofar2_unb2b_sdp_station/revisions/lofar2_unb2b_sdp_station_fsub/tb_lofar2_unb2b_sdp_station_fsub_sst_offload.vhd @@ -28,7 +28,8 @@ -- -- 1) Enable BSN source and enable UDP offload -- --- 2) Verify ethernet statistics using eth_statistics +-- 2) Verify ethernet statistics using eth_statistics, it checks the number of +-- received packets and the total number of valid data. The content of the packets is not verified. -- -- Usage: -- > as 7 # default @@ -74,22 +75,9 @@ ARCHITECTURE tb OF tb_lofar2_unb2b_sdp_station_fsub_sst_offload IS CONSTANT c_pps_period : NATURAL := c_nof_clk_per_sync; CONSTANT c_wpfb_sim : t_wpfb := func_wpfb_set_nof_block_per_sync(c_sdp_wpfb_subbands, c_nof_block_per_sync); - -- WG - CONSTANT c_full_scale_ampl : REAL := REAL(2**(14-1)-1); -- = full scale of WG - CONSTANT c_bsn_start_wg : NATURAL := 2; -- start WG at this BSN to instead of some BSN, to avoid mismatches in exact expected data values - CONSTANT c_ampl_sp_0 : NATURAL := 2**(c_sdp_W_adc-1)/2; -- in number of lsb - CONSTANT c_wg_subband_freq_unit : REAL := c_diag_wg_freq_unit/REAL(c_sdp_N_fft); -- subband freq = Fs/1024 = 200 MSps/1024 = 195312.5 Hz sinus - CONSTANT c_wg_freq_offset : REAL := 0.0/11.0; -- in freq_unit - CONSTANT c_subband_sp_0 : REAL := 102.0; -- Select subband at index 102 = 102/1024 * 200MHz = 19.921875 MHz - CONSTANT c_wg_ampl_lsb : REAL := c_diag_wg_ampl_unit / c_full_scale_ampl; -- amplitude in number of LSbit resolution steps - -- MM - CONSTANT c_mm_file_reg_ppsh : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "PIO_PPS"; CONSTANT c_mm_file_reg_bsn_source_v2 : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_BSN_SOURCE_V2"; - CONSTANT c_mm_file_reg_bsn_scheduler_wg : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_BSN_SCHEDULER"; - CONSTANT c_mm_file_reg_diag_wg : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_WG"; CONSTANT c_mm_file_reg_stat_enable : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_STAT_ENABLE"; - CONSTANT c_mm_file_reg_stat_hdr_info : STRING := mmf_unb_file_prefix(c_unb_nr, c_node_nr) & "REG_STAT_HDR_INFO"; -- Tb SIGNAL tb_end : STD_LOGIC := '0'; @@ -98,13 +86,13 @@ ARCHITECTURE tb OF tb_lofar2_unb2b_sdp_station_fsub_sst_offload IS SIGNAL rd_data : STD_LOGIC_VECTOR(c_32-1 DOWNTO 0) := (OTHERS => '0'); SIGNAL eth_done : STD_LOGIC := '0'; - -- WG - SIGNAL current_bsn_wg : STD_LOGIC_VECTOR(c_dp_stream_bsn_w-1 DOWNTO 0); - -- . 1GbE output - CONSTANT c_eth_check_nof_packets : NATURAL := 12; -- received packets in 1 sync period - CONSTANT c_eth_check_nof_valid : NATURAL := c_eth_check_nof_packets * 1044; - CONSTANT c_eth_runtime_timeout : TIME := 100 ms; -- factor 2 margin + CONSTANT c_eth_check_nof_packets : NATURAL := c_sdp_S_pn; -- received packets in 1 sync period + CONSTANT c_eth_header_size : NATURAL := 19; -- words + CONSTANT c_eth_crc_size : NATURAL := 1; -- word + CONSTANT c_eth_packet_size : NATURAL := c_eth_header_size + c_eth_crc_size + c_sdp_N_sub * (c_sdp_W_statistic / c_word_w); -- 20 + 512 * 2 = 1044 + CONSTANT c_eth_check_nof_valid : NATURAL := c_eth_check_nof_packets * c_eth_packet_size; + CONSTANT c_eth_runtime_timeout : TIME := 2 * c_nof_clk_per_sync * c_ext_clk_period; -- eth statistics should be done at the second sync interval -- DUT SIGNAL ext_clk : STD_LOGIC := '0'; @@ -168,8 +156,7 @@ BEGIN g_sim_unb_nr => c_unb_nr, g_sim_node_nr => c_node_nr, g_wpfb => c_wpfb_sim, - g_bsn_nof_clk_per_sync => c_nof_clk_per_sync, - g_scope_selected_subband => NATURAL(c_subband_sp_0) + g_bsn_nof_clk_per_sync => c_nof_clk_per_sync ) PORT MAP ( -- GENERAL @@ -220,12 +207,12 @@ BEGIN WAIT FOR 1 us; ---------------------------------------------------------------------------- - -- Enable BS + -- Enable BSN ---------------------------------------------------------------------------- mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 3, 0, tb_clk); mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 2, 0, tb_clk); -- Init BSN = 0 mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 1, c_nof_clk_per_sync, tb_clk); -- nof_block_per_sync - mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 0, 16#00000001#, tb_clk); -- Enable BS at PPS + mmf_mm_bus_wr(c_mm_file_reg_bsn_source_v2, 0, 16#00000001#, tb_clk); -- Enable BSN immediately ---------------------------------------------------------------------------- -- Offload enable diff --git a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd index 1485e648eb28cfc11cd3a93743023ebd75e006f7..30ff635d11b41dea803c2aa1ce11dc937c199319 100644 --- a/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd +++ b/applications/lofar2/libraries/sdp/src/vhdl/sdp_pkg.vhd @@ -93,6 +93,7 @@ PACKAGE sdp_pkg is CONSTANT c_sdp_W_bf_weight : NATURAL := 16; CONSTANT c_sdp_W_fir_coef : NATURAL := 16; CONSTANT c_sdp_W_gn_id : NATURAL := 5; + CONSTANT c_sdp_W_statistic : NATURAL := 64; CONSTANT c_sdp_W_sub_magnitude : NATURAL := 2; CONSTANT c_sdp_W_sub_weight : NATURAL := 16; CONSTANT c_sdp_W_subband : NATURAL := 18;