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

Use v_span, v_len.

parent 2f89ae19
No related branches found
No related tags found
1 merge request!198Clarified reading one WPFB unit into sp_subband_powers_arr2. Updated comments....
Pipeline #24312 failed
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
-- --
-- 4) Read beamlet statistics (BST) via ram_st_bst and verify with -- 4) Read beamlet statistics (BST) via ram_st_bst and verify with
-- c_exp_beamlet_power_sp_0 at c_sdp_N_sub-1 - c_subband_sp_0. -- c_exp_beamlet_power_sp_0 at c_sdp_N_sub-1 - c_subband_sp_0.
-- View sp_beamlet_power_0 in Wave window -- View pol_beamlet_power_0 in Wave window
-- 5) Compare SST with BST. -- 5) Compare SST with BST.
-- 6) Verify 10GbE output. -- 6) Verify 10GbE output.
-- --
...@@ -135,27 +135,30 @@ ARCHITECTURE tb OF tb_lofar2_unb2b_sdp_station_bf IS ...@@ -135,27 +135,30 @@ ARCHITECTURE tb OF tb_lofar2_unb2b_sdp_station_bf IS
); );
-- WG -- WG
CONSTANT c_full_scale_ampl : REAL := REAL(2**(14-1)-1); -- = full scale of WG
CONSTANT c_bsn_start_wg : NATURAL := c_init_bsn + 2; -- start WG at this BSN to instead of some BSN, to avoid mismatches in exact expected data values CONSTANT c_bsn_start_wg : NATURAL := c_init_bsn + 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 -- . ampl
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_ampl_full_scale : NATURAL := 2**(c_sdp_W_adc-1); -- full scale (FS) of WG, will just cause clipping of +FS to +FS-1
CONSTANT c_wg_freq_offset : REAL := 0.0/11.0; -- in freq_unit CONSTANT c_wg_ampl_lsb : REAL := c_diag_wg_ampl_unit / REAL(c_wg_ampl_full_scale); -- amplitude in number of LSbit resolution steps
CONSTANT c_subband_sp_0 : REAL := 102.0; -- Select subband at index 102 = 102/1024 * 200MHz = 19.921875 MHz CONSTANT c_ampl_sp_0 : NATURAL := c_wg_ampl_full_scale / 2; -- in number of lsb
CONSTANT c_wg_ampl_lsb : REAL := c_diag_wg_ampl_unit / c_full_scale_ampl; -- amplitude in number of LSbit resolution steps
CONSTANT c_exp_wg_power_sp_0 : REAL := REAL(c_ampl_sp_0**2)/2.0 * REAL(c_nof_clk_per_sync); CONSTANT c_exp_wg_power_sp_0 : REAL := REAL(c_ampl_sp_0**2)/2.0 * REAL(c_nof_clk_per_sync);
-- . phase
CONSTANT c_phase_sp_0 : REAL := 0.0; -- phase offset in degrees
-- . freq
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_subband_sp_0 : NATURAL := 102; -- Select subband at index 102 = 102/1024 * 200MHz = 19.921875 MHz
-- WPFB -- WPFB
CONSTANT c_wb_leakage_bin : NATURAL := c_wpfb_sim.nof_points / c_wpfb_sim.wb_factor; -- = 256, leakage will occur in this bin if FIR wb_factor is reversed CONSTANT c_wb_leakage_bin : NATURAL := c_wpfb_sim.nof_points / c_wpfb_sim.wb_factor; -- = 256, leakage will occur in this bin if FIR wb_factor is reversed
CONSTANT c_exp_sp_beamlet_power_ratio : REAL := 1.0/8.0; -- depends on internal WPFB quantization and FIR coefficients CONSTANT c_exp_pol_beamlet_power_ratio : REAL := 1.0/8.0; -- depends on internal WPFB quantization and FIR coefficients
CONSTANT c_exp_sp_beamlet_power_sum_ratio : REAL := c_exp_sp_beamlet_power_ratio; -- because all sinus power is expected in one subband CONSTANT c_exp_pol_beamlet_power_sum_ratio : REAL := c_exp_pol_beamlet_power_ratio; -- because all sinus power is expected in one subband
CONSTANT c_exp_beamlet_power_sp_0 : REAL := c_exp_wg_power_sp_0 * c_exp_sp_beamlet_power_ratio; CONSTANT c_exp_beamlet_power_sp_0 : REAL := c_exp_wg_power_sp_0 * c_exp_pol_beamlet_power_ratio;
TYPE t_real_arr IS ARRAY (INTEGER RANGE <>) OF REAL; TYPE t_real_arr IS ARRAY (INTEGER RANGE <>) OF REAL;
TYPE t_slv_64_subbands_arr IS ARRAY (INTEGER RANGE <>) OF t_slv_64_arr(0 TO c_sdp_N_sub); TYPE t_slv_64_subbands_arr IS ARRAY (INTEGER RANGE <>) OF t_slv_64_arr(0 TO c_sdp_N_sub);
TYPE t_slv_64_beamlets_arr IS ARRAY (INTEGER RANGE <>) OF t_slv_64_arr(0 TO c_sdp_S_sub_bf); TYPE t_slv_64_beamlets_arr IS ARRAY (INTEGER RANGE <>) OF t_slv_64_arr(0 TO c_sdp_S_sub_bf);
-- BF -- BF
CONSTANT c_exp_beamlet_index : NATURAL := NATURAL(c_subband_sp_0) * c_sdp_N_pol_bf; CONSTANT c_exp_beamlet_index : NATURAL := c_subband_sp_0 * c_sdp_N_pol_bf;
CONSTANT c_exp_beamlet_re : STD_LOGIC_VECTOR(7 DOWNTO 0) := x"81"; -- = -127, derived from simulation CONSTANT c_exp_beamlet_re : STD_LOGIC_VECTOR(7 DOWNTO 0) := x"81"; -- = -127, derived from simulation
CONSTANT c_exp_beamlet_im : STD_LOGIC_VECTOR(7 DOWNTO 0) := x"7F"; -- = +127, derived from simulation CONSTANT c_exp_beamlet_im : STD_LOGIC_VECTOR(7 DOWNTO 0) := x"7F"; -- = +127, derived from simulation
...@@ -212,15 +215,19 @@ ARCHITECTURE tb OF tb_lofar2_unb2b_sdp_station_bf IS ...@@ -212,15 +215,19 @@ ARCHITECTURE tb OF tb_lofar2_unb2b_sdp_station_bf IS
SIGNAL current_bsn_wg : STD_LOGIC_VECTOR(c_dp_stream_bsn_w-1 DOWNTO 0); SIGNAL current_bsn_wg : STD_LOGIC_VECTOR(c_dp_stream_bsn_w-1 DOWNTO 0);
-- WPFB -- WPFB
SIGNAL sp_subband_powers_arr2 : t_slv_64_subbands_arr(c_sdp_N_pol-1 DOWNTO 0); -- [sp][sub] -- . Read sp_subband_powers_arr2 = SST for both sp 0 and 1, because these
-- are processed by the same PFB, to see the quantization crosstalk of
SIGNAL sp_beamlet_powers_arr2 : t_slv_64_beamlets_arr(c_sdp_N_beamsets*c_sdp_N_pol_bf-1 DOWNTO 0); -- [sp][sub] -- the separate function in the PFB. No need to also read the SST for
SIGNAL sp_beamlet_power_0 : REAL; -- sp 2 : 11.
SIGNAL sp_beamlet_power_sum : t_real_arr(c_sdp_N_beamsets*c_sdp_N_pol_bf-1 DOWNTO 0) := (OTHERS=>0.0); SIGNAL sp_subband_powers_arr2 : t_slv_64_subbands_arr(c_sdp_N_pol-1 DOWNTO 0); -- [pol][sub], for X,Y pair of sp0, sp1
SIGNAL sp_beamlet_power_sum_0 : REAL;
SIGNAL sp_beamlet_power_ratio_0 : REAL; SIGNAL pol_beamlet_powers_arr2 : t_slv_64_beamlets_arr(c_sdp_N_beamsets*c_sdp_N_pol_bf-1 DOWNTO 0); -- [bset*pol][blet]
SIGNAL sp_beamlet_power_sum_ratio_0 : REAL; SIGNAL pol_beamlet_power_0 : REAL;
SIGNAL sp_beamlet_power_leakage_sum_0 : REAL; SIGNAL pol_beamlet_power_sum : t_real_arr(c_sdp_N_beamsets*c_sdp_N_pol_bf-1 DOWNTO 0) := (OTHERS=>0.0);
SIGNAL pol_beamlet_power_sum_0 : REAL;
SIGNAL pol_beamlet_power_ratio_0 : REAL;
SIGNAL pol_beamlet_power_sum_ratio_0 : REAL;
SIGNAL pol_beamlet_power_leakage_sum_0 : REAL;
-- 10GbE -- 10GbE
SIGNAL rx_beamlet_arr_re : t_slv_8_arr(c_sdp_cep_nof_blocks_per_packet-1 DOWNTO 0); -- [3:0] SIGNAL rx_beamlet_arr_re : t_slv_8_arr(c_sdp_cep_nof_blocks_per_packet-1 DOWNTO 0); -- [3:0]
...@@ -319,7 +326,7 @@ BEGIN ...@@ -319,7 +326,7 @@ BEGIN
g_sim_node_nr => c_node_nr, g_sim_node_nr => c_node_nr,
g_wpfb => c_wpfb_sim, g_wpfb => c_wpfb_sim,
g_bsn_nof_clk_per_sync => c_nof_clk_per_sync, g_bsn_nof_clk_per_sync => c_nof_clk_per_sync,
g_scope_selected_subband => NATURAL(c_subband_sp_0) g_scope_selected_subband => c_subband_sp_0
) )
PORT MAP ( PORT MAP (
-- GENERAL -- GENERAL
...@@ -439,9 +446,12 @@ BEGIN ...@@ -439,9 +446,12 @@ BEGIN
p_mm_stimuli : PROCESS p_mm_stimuli : PROCESS
VARIABLE v_bsn : NATURAL; VARIABLE v_bsn : NATURAL;
VARIABLE v_sp_beamlet_power : REAL;
VARIABLE v_sp_subband_power : REAL; VARIABLE v_sp_subband_power : REAL;
VARIABLE v_W, v_T, v_U, v_S, v_B : NATURAL; -- array indicies VARIABLE v_pol_beamlet_power : REAL;
VARIABLE v_data_lo, v_data_hi : STD_LOGIC_VECTOR(c_word_w-1 DOWNTO 0);
VARIABLE v_stat_data : STD_LOGIC_VECTOR(c_longword_w-1 DOWNTO 0);
VARIABLE v_len, v_span, v_A : NATURAL; -- address ranges, indices
VARIABLE v_W, v_P, v_U, v_S, v_B : NATURAL; -- array indicies
VARIABLE v_re, v_im : INTEGER; VARIABLE v_re, v_im : INTEGER;
VARIABLE v_re_exp, v_im_exp : INTEGER; VARIABLE v_re_exp, v_im_exp : INTEGER;
VARIABLE v_offset : NATURAL; VARIABLE v_offset : NATURAL;
...@@ -586,8 +596,8 @@ BEGIN ...@@ -586,8 +596,8 @@ BEGIN
-- 2 : freq[30:0] -- 2 : freq[30:0]
-- 3 : ampl[16:0] -- 3 : ampl[16:0]
mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 0, 1024*2**16 + 1, tb_clk); -- nof_samples, mode calc mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 0, 1024*2**16 + 1, tb_clk); -- nof_samples, mode calc
mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 1, INTEGER( 0.0 * c_diag_wg_phase_unit), tb_clk); -- phase offset in degrees mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 1, INTEGER(c_phase_sp_0 * c_diag_wg_phase_unit), tb_clk); -- phase offset in degrees
mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 2, INTEGER((c_subband_sp_0+c_wg_freq_offset) * c_wg_subband_freq_unit), tb_clk); -- freq mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 2, INTEGER(REAL(c_subband_sp_0) * c_wg_subband_freq_unit), tb_clk); -- freq
mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 3, INTEGER(REAL(c_ampl_sp_0) * c_wg_ampl_lsb), tb_clk); -- ampl mmf_mm_bus_wr(c_mm_file_reg_diag_wg, 3, INTEGER(REAL(c_ampl_sp_0) * c_wg_ampl_lsb), tb_clk); -- ampl
-- Read current BSN -- Read current BSN
...@@ -617,25 +627,29 @@ BEGIN ...@@ -617,25 +627,29 @@ BEGIN
-- . there are c_sdp_N_sub = 512 subbands per signal path -- . there are c_sdp_N_sub = 512 subbands per signal path
-- . one complex WPFB can process two real inputs A, B, is c_sdp_Q_fft = c_sdp_N_pol = 2 -- . one complex WPFB can process two real inputs A, B, is c_sdp_Q_fft = c_sdp_N_pol = 2
-- . the subbands are output alternately so A0 B0 A1 B1 ... A511 B511 for input A, B -- . the subbands are output alternately so A0 B0 A1 B1 ... A511 B511 for input A, B
-- . the subband statistics multiple WPFB units appear in order in the ram_st_sst address map -- . the subband statistics for multiple WPFB units appear in order in the ram_st_sst address map
-- . the subband statistics are stored first lo word 0 then hi word 1 -- . the subband statistics are stored first lo word 0 then hi word 1
v_len := c_sdp_N_sub * c_sdp_N_pol * c_stat_data_sz; -- 2048 = 512 * 2 * 64/32
FOR I IN 0 TO c_sdp_N_pol*c_sdp_N_sub*c_stat_data_sz-1 LOOP -- 2048 = 2 * 512 * 64/32 FOR I IN 0 TO v_len - 1 LOOP
v_W := I MOD c_stat_data_sz; -- 0, 1 per statistics word v_W := I MOD c_stat_data_sz; -- 0, 1 per statistics word, word index
v_T := (I / c_stat_data_sz) MOD c_sdp_N_pol; -- 0, 1 per pol v_P := (I / c_stat_data_sz) MOD c_sdp_N_pol; -- 0, 1 per SP pol, poilarization index
v_U := I / (c_sdp_N_pol*c_stat_data_sz*c_sdp_N_sub); -- / 2048 v_U := I / v_len; -- / 2048, pfb unit index, range(P_pfb = 6)
v_S := v_T + v_U * c_sdp_N_pol; v_S := v_P + v_U * c_sdp_N_pol; -- signal input index, range(S_pn = 12)
v_B := (I / (c_sdp_N_pol*c_stat_data_sz)) MOD c_sdp_N_sub; -- 0:511 per dual pol v_B := (I / (c_sdp_N_pol * c_stat_data_sz)) MOD c_sdp_N_sub; -- subband index, range(N_sub = 512) per dual pol
-- Only read sp 0, pol 0 (v_S = 0) v_A := I; -- MM address (v_len = v_span)
IF v_S=0 THEN -- Only read sp 0 and sp 1 (v_S = 0, v_S = 1) to see digital crosstalk between two real inputs of PFB
IF v_W=0 THEN IF v_U = 0 THEN -- v_U = 0 is equivalent to signal input index v_S = 0 OR v_S = 1
IF v_W = 0 THEN
-- low part -- low part
mmf_mm_bus_rd(c_mm_file_ram_st_sst, I, rd_data, tb_clk); mmf_mm_bus_rd(c_mm_file_ram_st_sst, v_A, rd_data, tb_clk);
sp_subband_powers_arr2(v_S)(v_B)(31 DOWNTO 0) <= rd_data; v_data_lo := rd_data;
ELSE ELSE
-- high part -- high part
mmf_mm_bus_rd(c_mm_file_ram_st_sst, I, rd_data, tb_clk); mmf_mm_bus_rd(c_mm_file_ram_st_sst, v_A, rd_data, tb_clk);
sp_subband_powers_arr2(v_S)(v_B)(63 DOWNTO 32) <= rd_data; v_data_hi := rd_data;
v_stat_data := v_data_hi & v_data_lo;
sp_subband_powers_arr2(v_S)(v_B) <= v_stat_data;
END IF; END IF;
END IF; END IF;
END LOOP; END LOOP;
...@@ -644,47 +658,46 @@ BEGIN ...@@ -644,47 +658,46 @@ BEGIN
-- Read beamlet statistics -- Read beamlet statistics
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- . the beamlet statistics are c_stat_data_sz = 2 word power values. -- . the beamlet statistics are c_stat_data_sz = 2 word power values.
-- . there are c_sdp_S_sub_bf = 488 subbands per signal path -- . there are c_sdp_S_sub_bf = 488 dual pol beamlets
-- . the subbands are output alternately so A0 B0 A1 B1 ... A5487 B487 for input A, B -- . the beamlets are output alternately so A0 B0 A1 B1 ... A487 B487 for input A, B
-- . the subband statistics multiple units appear in order in the ram_st_bst address map -- . the beamlet statistics for multiple beamsets appear in order in the ram_st_bst address map
-- . the subband statistics are stored first lo word 0 then hi word 1 -- . the beamlet statistics are stored first lo word 0 then hi word 1
FOR I IN 0 TO c_sdp_N_pol_bf*c_sdp_S_sub_bf*c_stat_data_sz-1 LOOP v_len := c_sdp_S_sub_bf * c_sdp_N_pol_bf * c_stat_data_sz; -- = 1952 = 488 * 2 * 64/32
v_W := I MOD c_stat_data_sz; v_span := true_log_pow2(v_len); -- = 2048
v_T := (I / c_stat_data_sz) MOD c_sdp_N_pol_bf; FOR I IN 0 TO v_len - 1 LOOP
v_U := I / (c_sdp_N_pol_bf*c_stat_data_sz*c_sdp_S_sub_bf); v_W := I MOD c_stat_data_sz; -- 0, 1 per statistics word, word index
v_S := v_T + v_U * c_sdp_N_pol_bf; v_P := (I / c_stat_data_sz) MOD c_sdp_N_pol_bf; -- 0, 1 per BF pol, poilarization index
v_B := (I / (c_sdp_N_pol_bf*c_stat_data_sz)) MOD c_sdp_S_sub_bf; v_U := I / v_len; -- / 1952, beamset unit index, range(N_beamsets = 2)
-- Only read beamset 0, pol 0 (v_S = 0) v_S := v_P + v_U * c_sdp_N_pol_bf; -- beamset * pol index, range(N_beamsets * N_pol_bf = 4)
IF v_S=0 THEN v_B := (I / (c_sdp_N_pol_bf * c_stat_data_sz)) MOD c_sdp_S_sub_bf; -- beamlet index, range(S_sub_bf = 488) per dual pol
IF v_W=0 THEN v_A := I MOD v_len + v_U * v_span; -- MM address
-- Only read beamset 0, pol 0 and 1 (v_U = 0)
IF v_U = 0 THEN -- v_U = 0 is equivalent to beamset * pol index v_S = 0 OR v_S = 1
IF v_W = 0 THEN
-- low part -- low part
--mmf_mm_bus_rd(c_mm_file_ram_st_bst, I+(c_sdp_N_pol_bf*c_sdp_N_sub*c_stat_data_sz), rd_data, tb_clk); mmf_mm_bus_rd(c_mm_file_ram_st_bst, v_A, rd_data, tb_clk);
mmf_mm_bus_rd(c_mm_file_ram_st_bst, I, rd_data, tb_clk); v_data_lo := rd_data;
sp_beamlet_powers_arr2(v_S)(v_B)(31 DOWNTO 0) <= rd_data;
ELSE ELSE
-- high part -- high part
--mmf_mm_bus_rd(c_mm_file_ram_st_bst, I+(c_sdp_N_pol_bf*c_sdp_N_sub*c_stat_data_sz), rd_data, tb_clk); mmf_mm_bus_rd(c_mm_file_ram_st_bst, v_A, rd_data, tb_clk);
mmf_mm_bus_rd(c_mm_file_ram_st_bst, I, rd_data, tb_clk); v_data_hi := rd_data;
sp_beamlet_powers_arr2(v_S)(v_B)(63 DOWNTO 32) <= rd_data; v_stat_data := v_data_hi & v_data_lo;
-- Convert STD_LOGIC_VECTOR to REAL pol_beamlet_powers_arr2(v_S)(v_B) <= v_stat_data;
v_sp_beamlet_power := REAL(TO_UINT(rd_data(29 DOWNTO 0) &
sp_beamlet_powers_arr2(v_S)(v_B)(31 DOWNTO 30)))*2.0**30 +
REAL(TO_UINT(sp_beamlet_powers_arr2(v_S)(v_B)(29 DOWNTO 0)));
-- sum -- sum
sp_beamlet_power_sum(v_S) <= sp_beamlet_power_sum(v_S) + v_sp_beamlet_power; v_pol_beamlet_power := TO_UREAL(v_stat_data);
pol_beamlet_power_sum(v_S) <= pol_beamlet_power_sum(v_S) + v_pol_beamlet_power;
END IF; END IF;
END IF; END IF;
END LOOP; END LOOP;
-- sp_beamlet_power_sum is the sum of all subband powers per SP, this value will be close to sp_beamlet_power -- pol_beamlet_power_sum is the sum of all subband powers per SP, this value will be close to pol_beamlet_power
-- because the input is a sinus, so most power will be in 1 subband. The sp_beamlet_power_leakage_sum shows -- because the input is a sinus, so most power will be in 1 subband. The pol_beamlet_power_leakage_sum shows
-- how much power from the input sinus at a specific subband has leaked into the 511 other subbands. -- how much power from the input sinus at a specific subband has leaked into the 511 other subbands.
sp_beamlet_power_0 <= pol_beamlet_power_0 <= TO_UREAL(pol_beamlet_powers_arr2(0)(c_subband_sp_0));
REAL(TO_UINT(sp_beamlet_powers_arr2(0)(INTEGER(ROUND(c_subband_sp_0)))(61 DOWNTO 30)))*2.0**30 +
REAL(TO_UINT(sp_beamlet_powers_arr2(0)(INTEGER(ROUND(c_subband_sp_0)))(29 DOWNTO 0)));
sp_beamlet_power_sum_0 <= sp_beamlet_power_sum(0); pol_beamlet_power_sum_0 <= pol_beamlet_power_sum(0);
proc_common_wait_some_cycles(tb_clk, 1); proc_common_wait_some_cycles(tb_clk, 1);
...@@ -692,42 +705,38 @@ BEGIN ...@@ -692,42 +705,38 @@ BEGIN
-- Verify subband statistics -- Verify subband statistics
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
FOR I IN 0 TO c_sdp_N_pol*c_sdp_S_sub_bf-1 LOOP FOR I IN 0 TO c_sdp_N_pol*c_sdp_S_sub_bf-1 LOOP
v_T := I MOD c_sdp_N_pol; v_P := I MOD c_sdp_N_pol;
v_U := I / (c_sdp_N_pol*c_sdp_S_sub_bf); v_U := I / (c_sdp_N_pol*c_sdp_S_sub_bf);
v_S := v_T + v_U * c_sdp_N_pol; v_S := v_P + v_U * c_sdp_N_pol;
v_B := (I / c_sdp_N_pol) MOD c_sdp_S_sub_bf; v_B := (I / c_sdp_N_pol) MOD c_sdp_S_sub_bf;
IF v_S=0 THEN IF v_S = 0 THEN
-- Convert STD_LOGIC_VECTOR to REAL -- Convert STD_LOGIC_VECTOR to REAL
v_sp_beamlet_power := REAL(TO_UINT(rd_data(29 DOWNTO 0) & v_pol_beamlet_power := TO_UREAL(pol_beamlet_powers_arr2(v_S)(v_B));
sp_beamlet_powers_arr2(v_S)(v_B)(31 DOWNTO 30)))*2.0**30 +
REAL(TO_UINT(sp_beamlet_powers_arr2(v_S)(v_B)(29 DOWNTO 0)));
-- Convert STD_LOGIC_VECTOR to REAL -- Convert STD_LOGIC_VECTOR to REAL
v_sp_subband_power := REAL(TO_UINT(rd_data(29 DOWNTO 0) & v_sp_subband_power := TO_UREAL(sp_subband_powers_arr2(v_S)(v_B));
sp_subband_powers_arr2(v_S)(v_B)(31 DOWNTO 30)))*2.0**30 +
REAL(TO_UINT(sp_subband_powers_arr2(v_S)(v_B)(29 DOWNTO 0)));
-- verify if subband power and beamlet power are the same. This is expected because we only use 1 WG input and the BF weights have unit value. -- verify if subband power and beamlet power are the same. This is expected because we only use 1 WG input and the BF weights have unit value.
-- the difference should not be larger than 0.5% (+/- 2^13 for low values) -- the difference should not be larger than 0.5% (+/- 2^13 for low values)
ASSERT v_sp_beamlet_power > 0.995 * v_sp_subband_power -2.0**13 REPORT "index ("& integer'image(v_S) &","& integer'image(v_B) &"): Subband power = "& real'image(v_sp_subband_power) &" and Beamlet power = "& real'image(v_sp_beamlet_power) &" are not equal" SEVERITY ERROR; ASSERT v_pol_beamlet_power > 0.995 * v_sp_subband_power -2.0**13 REPORT "index ("& integer'image(v_S) &","& integer'image(v_B) &"): Subband power = "& real'image(v_sp_subband_power) &" and Beamlet power = "& real'image(v_pol_beamlet_power) &" are not equal" SEVERITY ERROR;
ASSERT v_sp_beamlet_power < 1.005 * v_sp_subband_power +2.0**13 REPORT "index ("& integer'image(v_S) &","& integer'image(v_B) &"): Subband power = "& real'image(v_sp_subband_power) &" and Beamlet power = "& real'image(v_sp_beamlet_power) &" are not equal" SEVERITY ERROR; ASSERT v_pol_beamlet_power < 1.005 * v_sp_subband_power +2.0**13 REPORT "index ("& integer'image(v_S) &","& integer'image(v_B) &"): Subband power = "& real'image(v_sp_subband_power) &" and Beamlet power = "& real'image(v_pol_beamlet_power) &" are not equal" SEVERITY ERROR;
END IF; END IF;
END LOOP; END LOOP;
-- verify expected subband power based on WG power -- verify expected subband power based on WG power
IF sp_beamlet_power_sum_0>0.0 THEN ASSERT sp_beamlet_power_0 > c_lo_factor * c_exp_beamlet_power_sp_0 REPORT "Wrong beamlet power for SP 0" SEVERITY ERROR; END IF; IF pol_beamlet_power_sum_0>0.0 THEN ASSERT pol_beamlet_power_0 > c_lo_factor * c_exp_beamlet_power_sp_0 REPORT "Wrong beamlet power for SP 0" SEVERITY ERROR; END IF;
IF sp_beamlet_power_sum_0>0.0 THEN ASSERT sp_beamlet_power_0 < c_hi_factor * c_exp_beamlet_power_sp_0 REPORT "Wrong beamlet power for SP 0" SEVERITY ERROR; END IF; IF pol_beamlet_power_sum_0>0.0 THEN ASSERT pol_beamlet_power_0 < c_hi_factor * c_exp_beamlet_power_sp_0 REPORT "Wrong beamlet power for SP 0" SEVERITY ERROR; END IF;
-- view c_exp_sp_beamlet_power_ratio in Wave window -- view c_exp_pol_beamlet_power_ratio in Wave window
IF sp_beamlet_power_sum_0>0.0 THEN sp_beamlet_power_ratio_0 <= sp_beamlet_power_0/sp_beamlet_power_sum_0; END IF; IF pol_beamlet_power_sum_0>0.0 THEN pol_beamlet_power_ratio_0 <= pol_beamlet_power_0/pol_beamlet_power_sum_0; END IF;
-- view c_exp_sp_beamlet_power_sum_ratio in Wave window -- view c_exp_pol_beamlet_power_sum_ratio in Wave window
-- The sp_beamlet_power_sum_ratio show similar information as sp_beamlet_power_leakage_sum, because when -- The pol_beamlet_power_sum_ratio show similar information as pol_beamlet_power_leakage_sum, because when
-- sp_beamlet_power_leakage_sum is small then sp_beamlet_power_sum_ratio ~= sp_beamlet_power_ratio. -- pol_beamlet_power_leakage_sum is small then pol_beamlet_power_sum_ratio ~= pol_beamlet_power_ratio.
IF sp_beamlet_power_sum_0>0.0 THEN sp_beamlet_power_sum_ratio_0 <= sp_beamlet_power_sum_0/sp_beamlet_power_0; END IF; IF pol_beamlet_power_sum_0>0.0 THEN pol_beamlet_power_sum_ratio_0 <= pol_beamlet_power_sum_0/pol_beamlet_power_0; END IF;
-- View sp_beamlet_power_leakage_sum in Wave window -- View pol_beamlet_power_leakage_sum in Wave window
IF sp_beamlet_power_sum_0>0.0 THEN sp_beamlet_power_leakage_sum_0 <= sp_beamlet_power_sum_0 - sp_beamlet_power_0; END IF; IF pol_beamlet_power_sum_0>0.0 THEN pol_beamlet_power_leakage_sum_0 <= pol_beamlet_power_sum_0 - pol_beamlet_power_0; END IF;
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
-- Verify 10GbE UDP offload -- Verify 10GbE UDP offload
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment