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

Stream 0 and streams >= 2 carry the same input data, stream 1 carries zero data.

parent 98f207ac
No related branches found
No related tags found
No related merge requests found
......@@ -103,7 +103,7 @@ entity tb_fil_ppf_wide_file_data is
-- requant_remove_lsb : natural; -- = 1
-- requant_remove_msb : natural; -- = 0
-- end record;
g_fil_ppf : t_fil_ppf := (4, 0, 32, 16, 1, 1, 8, 16, 16);
g_fil_ppf : t_fil_ppf := (4, 0, 128, 16, 2, 1, 8, 16, 16);
-- type t_fil_ppf is record
-- wb_factor : natural; -- = 4, the wideband factor
-- nof_chan : natural; -- = default 0, defines the number of channels (=time-multiplexed input signals): nof channels = 2**nof_chan
......@@ -112,19 +112,14 @@ entity tb_fil_ppf_wide_file_data is
-- nof_streams : natural; -- = 1, the number of streams that are served by the same coefficients.
-- backoff_w : natural; -- = 0, number of bits for input backoff to avoid output overflow
-- in_dat_w : natural; -- = 8, number of input bits per stream
-- out_dat_w : natural; -- = 23, number of output bits (per stream). It is set to in_dat_w+coef_dat_w-1 = 23 to be sure the requantizer
-- does not remove any of the data in order to be able to verify with the original coefficients values.
-- out_dat_w : natural; -- = 16, number of output bits (per stream)
-- coef_dat_w : natural; -- = 16, data width of the FIR coefficients
-- end record;
--g_coefs_file_prefix : string := "hex/run_pfir_m_pfir_coeff_fircls1";
--g_data_file : string := "data/run_pfir_m_sinusoid_chirp_8b_16taps_128points_16b_16b.dat"; -- coefs, input and output data for 1 stream
--g_data_file_nof_lines : natural := 25600; -- number of lines with input data that is available in the g_data_file
--g_data_file_nof_read : natural := 5000; -- number of lines with input data to read and simulate, must be <= g_data_file_nof_lines
g_coefs_file_prefix : string := "hex/run_pfb_complex_m_pfir_coeff_fircls1";
g_data_file : string := "data/run_pfb_complex_m_phasor_8b_16taps_32points_16b_16b.dat"; -- coefs, input and output data for 1 stream
g_data_file_nof_lines : natural := 1600; -- number of lines with input data that is available in the g_data_file
g_data_file_nof_read : natural := 1600; -- number of lines with input data to read and simulate, must be <= g_data_file_nof_lines
g_coefs_file_prefix : string := "hex/run_pfir_m_pfir_coeff_fircls1";
g_data_file : string := "data/run_pfir_m_sinusoid_chirp_8b_16taps_128points_16b_16b.dat"; -- coefs, input and output data for 1 stream
g_data_file_nof_lines : natural := 25600; -- number of lines with input data that is available in the g_data_file
g_data_file_nof_read : natural := 5000; -- number of lines with input data to read and simulate, must be <= g_data_file_nof_lines
g_enable_in_val_gaps : boolean := FALSE
);
end entity tb_fil_ppf_wide_file_data;
......@@ -248,8 +243,14 @@ begin
for P in 0 to g_fil_ppf.wb_factor-1 loop -- parallel
vP := g_fil_ppf.wb_factor-1-P; -- time to big endian
for S in 0 to g_fil_ppf.nof_streams-1 loop -- parallel
in_dat_arr(vP*g_fil_ppf.nof_streams + S) <= TO_SVEC(input_data_arr(I*g_fil_ppf.wb_factor + P), c_fil_slv_w);
in_val <= '1';
if S=1 then
-- if present then stream 1 carries zero data to be able to recognize the stream order in the wave window
in_dat_arr(vP*g_fil_ppf.nof_streams + S) <= (OTHERS=>'0');
else
-- stream 0 and if present the other streams >= 2 carry the same input reference data to verify the filter function
in_dat_arr(vP*g_fil_ppf.nof_streams + S) <= TO_SVEC(input_data_arr(I*g_fil_ppf.wb_factor + P), c_fil_slv_w);
end if;
in_val <= '1';
end loop;
end loop;
in_val <= '1';
......@@ -352,11 +353,17 @@ begin
for P in 0 to g_fil_ppf.wb_factor-1 loop -- parallel
vP := g_fil_ppf.wb_factor-1-P;
for S in 0 to g_fil_ppf.nof_streams-1 loop -- parallel
-- all streams carry the same data
v_out_dat := TO_SINT(out_dat_arr(vP*g_fil_ppf.nof_streams + S));
v_exp_dat := expected_data_arr(vI*g_fil_ppf.wb_factor + P);
assert v_out_dat <= v_exp_dat + c_diff_margin and
v_out_dat >= v_exp_dat - c_diff_margin report "Output data error" severity error;
if S=1 then
-- stream 1 carries zero data
v_exp_dat := 0;
assert v_out_dat = v_exp_dat report "Output data error (stream 1 not zero)" severity error;
else
-- stream 0 and all other streams >= 2 carry the same data
v_exp_dat := expected_data_arr(vI*g_fil_ppf.wb_factor + P);
assert v_out_dat <= v_exp_dat + c_diff_margin and
v_out_dat >= v_exp_dat - c_diff_margin report "Output data error" severity error;
end if;
end loop;
end loop;
if vK < c_nof_channels-1 then -- serial
......
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