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

Support c_noiseGoldenFile for c_twiddle_w = 18b and for 20b.

parent 37087f0e
No related branches found
No related tags found
1 merge request!234Use g_round_even = false in tb, because golden results use round half away...
This diff is collapsed.
......@@ -42,7 +42,18 @@
-- compare it with the rTwoSDF implementation output file result.
-- 2) The rTwoSDF implementation output file is also kept in SVN as golden
-- reference result to allow verification using a file diff command like
-- e.g. WinMerge. This then avoids the need to run MATLAB to verify.
-- e.g. meld or WinMerge. This then avoids the need to run MATLAB to
-- verify. E.g.:
--
-- diff build/unb2c/modelsim/rTwoSDF/data/test/out/uniNoise_out.txt
-- build/unb2c/modelsim/rTwoSDF/data/test/out/uniNoise_p1024_in8_out14_out.txt
--
-- The uniNoise_p1024_in8_out14_out.txt uses c_twiddle_w = 18 bit.
-- The uniNoise_p1024_in8_out14_out_tw20.txt golden results was created by
-- running the tb with g_use_reorder = true and copying the created
-- uniNoise_out.txt. Using meld shows that the golden result files for
-- c_twiddle_w = 18 b and 20 b only differ by +-1 for some values, as
-- expected.
--
-- The tb asserts an error when the output does not match the expected output
-- that is read from the golden reference file. The output is also written
......@@ -77,12 +88,12 @@ use work.twiddlesPkg.all;
entity tb_rTwoSDF is
generic(
-- generics for tb
g_use_uniNoise_file : boolean := true;
g_use_uniNoise_file : boolean := true; -- golden results currently only available for false (noise data)
g_in_en : natural := 1; -- 1 = always active, others = random control
-- generics for rTwoSDF
g_use_reorder : boolean := false; -- tb supports both true and false
g_use_reorder : boolean := true; -- tb supports both true and false, use true to create golden output file
g_nof_points : natural := 1024;
g_in_dat_w : natural := 8;
g_in_dat_w : natural := 8; -- use g_in_dat_w = 8 when g_use_uniNoise_file = true
g_out_dat_w : natural := 14;
g_guard_w : natural := 2 -- guard bits are used to avoid overflow in single FFT stage.
);
......@@ -96,6 +107,7 @@ architecture tb of tb_rTwoSDF is
constant c_nof_points_w : natural := ceil_log2(g_nof_points);
-- input/output data width
constant c_twiddle_w : natural := wTyp'length;
constant c_stage_dat_w : natural := sel_a_b(g_out_dat_w > c_dsp_mult_w, g_out_dat_w, c_dsp_mult_w); -- number of bits used between the stages
-- input/output files
......@@ -103,13 +115,15 @@ architecture tb of tb_rTwoSDF is
constant c_repeat : natural := 2; -- >= 2 to have sufficent frames for c_outputFile evaluation by testFFT_output.m
-- input from uniform noise file created automatically by MATLAB testFFT_input.m
constant c_noiseInputFile : string := "data/test/in/uniNoise_p" & natural'image(g_nof_points)& "_b"& natural'image(g_in_dat_w) &"_in.txt";
constant c_noiseGoldenFile : string := "data/test/out/uniNoise_p" & natural'image(g_nof_points)& "_in"& natural'image(g_in_dat_w) &"_out"&natural'image(g_out_dat_w) &"_out.txt";
constant c_noiseOutputFile : string := "data/test/out/uniNoise_out.txt";
constant c_noiseInputFile : string := "data/test/in/uniNoise_p" & natural'image(g_nof_points) & "_b" & natural'image(g_in_dat_w) & "_in.txt";
constant c_noiseGoldenFile_tw18 : string := "data/test/out/uniNoise_p" & natural'image(g_nof_points) & "_in" & natural'image(g_in_dat_w) & "_out" & natural'image(g_out_dat_w) & "_out.txt";
constant c_noiseGoldenFile_tw20 : string := "data/test/out/uniNoise_p" & natural'image(g_nof_points) & "_in" & natural'image(g_in_dat_w) & "_out" & natural'image(g_out_dat_w) & "_out_tw" & natural'image(c_twiddle_w) & ".txt";
constant c_noiseGoldenFile : string := sel_a_b(c_twiddle_w = 18, c_noiseGoldenFile_tw18, c_noiseGoldenFile_tw20);
constant c_noiseOutputFile : string := "data/test/out/uniNoise_out.txt";
-- input from manually created file
constant c_impulseInputFile : string := "data/test/in/impulse_p" & natural'image(g_nof_points)& "_b"& natural'image(g_in_dat_w)& "_in.txt";
constant c_impulseGoldenFile : string := "data/test/out/impulse_p" & natural'image(g_nof_points)& "_b"& natural'image(g_in_dat_w)& "_out.txt";
constant c_impulseInputFile : string := "data/test/in/impulse_p" & natural'image(g_nof_points)& "_b" & natural'image(g_in_dat_w)& "_in.txt";
constant c_impulseGoldenFile : string := "data/test/out/impulse_p" & natural'image(g_nof_points)& "_b" & natural'image(g_in_dat_w)& "_out.txt";
constant c_impulseOutputFile : string := "data/test/out/impulse_out.txt";
-- determine active stimuli and result files
......
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