Skip to content
Snippets Groups Projects
Commit b9e01b2d authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Improve rx_beamlet_valid.

parent cb7f45fd
No related branches found
No related tags found
1 merge request!311Correct beamlet output indexing in tr_10GbE_src_out.data. Verify exact beamlet...
Pipeline #44823 passed
......@@ -41,17 +41,22 @@
-- . verify subband 99.5 in beamset 1
-- . These subbands also appear at about half power in the other beamset
-- but these values are not verified, because they are at the edge of
-- the subband and will in practise not be used. Since the purpose of
-- the 2x oversampled filterbank is to only use the beamlet frequencies
-- that are around the center of the subband, so the half of the
-- subbands from beamset 0 and half of the subbands from beamset 1.
-- the subband and will in practise not be used. Therefore choose WG
-- c_wg_ampl_sp_2 = c_wg_ampl_sp_0 / 3 to distinghuis them.
-- The purpose of the 2x oversampled filterbank is to only use the
-- beamlet frequencies that are around the center of the subband, so
-- the half of the subbands from beamset 0 and half of the subbands
-- from beamset 1.
--
-- Usage:
-- > as 7 # default
-- > as 12 # for detailed debugging
-- > run -a
-- manually add missing beamlet_arr2_im/re to wave window
-- manually add top level generics/constants to wave window
-- . manually add missing beamlet_arr2_im/re to wave window, and manually
-- copy beamlet_arr2_im[195:215] and [1170:1190] and the rx_beamlet_*
-- index signals to have a more compact view of the relevant indices.
-- . If c_subband_phase = 0.0 then beamlet_arr2_re entries are 0.
-- . manually add top level generics/constants to wave window.
--
-- Remark: TB is based on tb_lofar2_unb2c_sdp_station_bf.
-------------------------------------------------------------------------------
......@@ -101,9 +106,9 @@ ARCHITECTURE tb OF tb_disturb2_unb2b_sdp_station_full_wg IS
-- 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
-- . ampl
CONSTANT c_beamlet_scale : REAL := 1.0 / 2.0**8;
CONSTANT c_beamlet_scale : REAL := 1.0 / 2.0**9;
CONSTANT c_wg_ampl_sp_0 : NATURAL := NATURAL(7.0 / c_beamlet_scale); -- choose < 8.0 to have no beamlet output overflow with unit weights and unit beamlet scale
CONSTANT c_wg_ampl_sp_2 : NATURAL := c_wg_ampl_sp_0 / 2; -- use different ampl for sp_0 and sp_2 to distinghuis them
CONSTANT c_wg_ampl_sp_2 : NATURAL := c_wg_ampl_sp_0 / 3; -- use different ampl for sp_0 and sp_2 to distinghuis them
-- . phase
CONSTANT c_subband_phase : REAL := 0.0; -- wanted subband phase in degrees = WG phase at sop
CONSTANT c_wg_latency : INTEGER := c_diag_wg_latency - 0; -- -0 to account for BSN scheduler start trigger latency
......@@ -406,14 +411,12 @@ BEGIN
-- Read 3 packets to make sure we get 1 from each beamset. It can happen that two packets
-- (but not three) from the same beamset are received back to back.
FOR packet IN 0 TO 8 LOOP
rx_beamlet_valid <= '0';
FOR packet IN 0 TO 24 LOOP
-- Get beamlet_index from packet header
proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.sop);
FOR I IN 0 TO 8 LOOP -- Packet header is 9.25 words wide, which can be discarded
IF I = 7 THEN
v_beamlet_index_offset := c_sdp_N_pol_bf * TO_UINT(tr_10GbE_src_out.data(39 DOWNTO 24)); -- Read beamlet index
v_beamlet_index_offset := c_sdp_N_pol_bf * TO_UINT(tr_10GbE_src_out.data(39 DOWNTO 24)); -- Read beamlet index
rx_beamlet_index_offset <= v_beamlet_index_offset;
END IF;
proc_common_wait_until_high(ext_clk, tr_10GbE_src_out.valid);
......@@ -460,6 +463,10 @@ BEGIN
beamlet_arr2_re(v_beamlet_index_offset + c_sdp_N_pol_bf * c_sdp_cep_nof_beamlets_per_block-1) <= tr_10GbE_src_out.data(55 DOWNTO 48);
-- Loop for next block in packet
END LOOP;
-- Make rx_beamlet_valid low for next header or after loop during verify.
-- Cannot wait one ext_clk cycle here to include last beamlet of block,
-- because next packet sop may follow immediately after this packet eop.
rx_beamlet_valid <= '0';
-- Loop and wait for next packet.
END LOOP;
......@@ -478,9 +485,6 @@ BEGIN
print_str("WPFB:");
print_str(". c_exp_subband_ampl_sp_0 = " & real_to_str(c_exp_subband_ampl_sp_0, 20, 6));
print_str(". c_exp_subband_ampl_sp_2 = " & real_to_str(c_exp_subband_ampl_sp_2, 20, 6));
print_str("BF:");
print_str(". c_exp_beamlet_ampl_sp_0 = " & real_to_str(c_exp_beamlet_ampl_sp_0, 20, 6));
print_str(". c_exp_beamlet_ampl_sp_2 = " & real_to_str(c_exp_beamlet_ampl_sp_2, 20, 6));
print_str("");
print_str("Beamlet output: (sp_0 at mid subband, sp_2 at subband edge, so at mid of os subband):");
print_str(". c_exp_beamlet_index = " & int_to_str(c_exp_beamlet_index));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment