Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
ffcc06fd
Commit
ffcc06fd
authored
3 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Support c_noiseGoldenFile for c_twiddle_w = 18b and for 20b.
parent
37087f0e
No related branches found
Branches containing commit
No related tags found
1 merge request
!234
Use g_round_even = false in tb, because golden results use round half away...
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/dsp/rTwoSDF/tb/data/test/out/uniNoise_p1024_in8_out14_out_tw20.txt
+6145
-0
6145 additions, 0 deletions
...DF/tb/data/test/out/uniNoise_p1024_in8_out14_out_tw20.txt
libraries/dsp/rTwoSDF/tb/vhdl/tb_rTwoSDF.vhd
+23
-9
23 additions, 9 deletions
libraries/dsp/rTwoSDF/tb/vhdl/tb_rTwoSDF.vhd
with
6168 additions
and
9 deletions
libraries/dsp/rTwoSDF/tb/data/test/out/uniNoise_p1024_in8_out14_out_tw20.txt
0 → 100644
+
6145
−
0
View file @
ffcc06fd
This diff is collapsed.
Click to expand it.
libraries/dsp/rTwoSDF/tb/vhdl/tb_rTwoSDF.vhd
+
23
−
9
View file @
ffcc06fd
...
...
@@ -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
:
=
fals
e
;
-- tb supports both true and false
g_use_reorder
:
boolean
:
=
tru
e
;
-- 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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment