Skip to content
GitLab
Explore
Sign in
Register
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
44a140aa
Commit
44a140aa
authored
9 years ago
by
Zanting
Browse files
Options
Downloads
Patches
Plain Diff
Commit before move to new library common_mult
parent
92a45716
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/common/tb/vhdl/tb_common_complex_mult.vhd
+10
-146
10 additions, 146 deletions
libraries/base/common/tb/vhdl/tb_common_complex_mult.vhd
with
10 additions
and
146 deletions
libraries/base/common/tb/vhdl/tb_common_complex_mult.vhd
+
10
−
146
View file @
44a140aa
...
@@ -26,9 +26,10 @@
...
@@ -26,9 +26,10 @@
-- > as 10
-- > as 10
-- > run -all -- signal tb_end will stop the simulation by stopping the clk
-- > run -all -- signal tb_end will stop the simulation by stopping the clk
LIBRARY
IEEE
;
LIBRARY
IEEE
,
technology_lib
,
tech_mult_lib
,
ip_stratixiv_mult_lib
;
USE
IEEE
.
std_logic_1164
.
ALL
;
USE
IEEE
.
std_logic_1164
.
ALL
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
technology_lib
.
technology_select_pkg
.
ALL
;
USE
work
.
common_pkg
.
ALL
;
USE
work
.
common_pkg
.
ALL
;
USE
work
.
common_lfsr_sequences_pkg
.
ALL
;
USE
work
.
common_lfsr_sequences_pkg
.
ALL
;
USE
work
.
tb_common_pkg
.
ALL
;
USE
work
.
tb_common_pkg
.
ALL
;
...
@@ -55,6 +56,8 @@ ARCHITECTURE tb OF tb_common_complex_mult IS
...
@@ -55,6 +56,8 @@ ARCHITECTURE tb OF tb_common_complex_mult IS
CONSTANT
c_max
:
INTEGER
:
=
2
**
(
g_in_dat_w
-1
)
-1
;
CONSTANT
c_max
:
INTEGER
:
=
2
**
(
g_in_dat_w
-1
)
-1
;
CONSTANT
c_min
:
INTEGER
:
=
-2
**
(
g_in_dat_w
-1
);
CONSTANT
c_min
:
INTEGER
:
=
-2
**
(
g_in_dat_w
-1
);
CONSTANT
c_technology
:
NATURAL
:
=
c_tech_select_default
;
SIGNAL
tb_end
:
STD_LOGIC
:
=
'0'
;
SIGNAL
tb_end
:
STD_LOGIC
:
=
'0'
;
SIGNAL
rst
:
STD_LOGIC
;
SIGNAL
rst
:
STD_LOGIC
;
SIGNAL
clk
:
STD_LOGIC
:
=
'0'
;
SIGNAL
clk
:
STD_LOGIC
:
=
'0'
;
...
@@ -69,31 +72,16 @@ ARCHITECTURE tb OF tb_common_complex_mult IS
...
@@ -69,31 +72,16 @@ ARCHITECTURE tb OF tb_common_complex_mult IS
SIGNAL
in_val
:
STD_LOGIC
;
-- in_val is only passed on to out_val
SIGNAL
in_val
:
STD_LOGIC
;
-- in_val is only passed on to out_val
SIGNAL
result_val_expected
:
STD_LOGIC
;
SIGNAL
result_val_expected
:
STD_LOGIC
;
SIGNAL
result_val_rtl
:
STD_LOGIC
;
SIGNAL
result_val_rtl
:
STD_LOGIC
;
SIGNAL
result_val_str
:
STD_LOGIC
;
SIGNAL
result_val_str_stratix4
:
STD_LOGIC
;
SIGNAL
result_val_stratix4
:
STD_LOGIC
;
SIGNAL
result_val_stratix4
:
STD_LOGIC
;
SIGNAL
result_val_altera_rtl
:
STD_LOGIC
;
SIGNAL
result_val_rtl_dsp
:
STD_LOGIC
;
SIGNAL
dut_val_rtl_dsp
:
STD_LOGIC
;
SIGNAL
out_result_re
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
-- combinatorial result
SIGNAL
out_result_re
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
-- combinatorial result
SIGNAL
out_result_im
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
out_result_im
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_expected
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
-- pipelined results
SIGNAL
result_re_expected
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
-- pipelined results
SIGNAL
result_re_rtl
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_rtl
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_str
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_str_stratix4
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_stratix4
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_stratix4
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_altera_rtl
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_re_rtl_dsp
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_expected
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_expected
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_rtl
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_rtl
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_str
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_str_stratix4
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_stratix4
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_stratix4
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_altera_rtl
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
result_im_rtl_dsp
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
dut_re_rtl_dsp
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
SIGNAL
dut_im_rtl_dsp
:
STD_LOGIC_VECTOR
(
g_out_dat_w
-1
DOWNTO
0
);
BEGIN
BEGIN
...
@@ -229,8 +217,10 @@ BEGIN
...
@@ -229,8 +217,10 @@ BEGIN
out_dat
=>
result_val_expected
out_dat
=>
result_val_expected
);
);
u_dut_rtl
:
ENTITY
work
.
common_complex_mult
(
rtl
)
u_dut_rtl
:
ENTITY
work
.
common_complex_mult
GENERIC
MAP
(
GENERIC
MAP
(
g_technology
=>
c_technology
,
g_variant
=>
"RTL"
,
g_in_a_w
=>
g_in_dat_w
,
g_in_a_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
...
@@ -254,33 +244,10 @@ BEGIN
...
@@ -254,33 +244,10 @@ BEGIN
out_val
=>
result_val_rtl
out_val
=>
result_val_rtl
);
);
u_dut_str
:
ENTITY
work
.
common_complex_mult
(
str
)
u_dut_stratix4
:
ENTITY
work
.
common_complex_mult
GENERIC
MAP
(
g_in_a_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
g_conjugate_b
=>
g_conjugate_b
,
g_pipeline_input
=>
g_pipeline_input
,
g_pipeline_product
=>
g_pipeline_product
,
g_pipeline_adder
=>
g_pipeline_adder
,
g_pipeline_output
=>
g_pipeline_output
)
PORT
MAP
(
rst
=>
rst
,
clk
=>
clk
,
clken
=>
'1'
,
in_ar
=>
in_ar
,
in_ai
=>
in_ai
,
in_br
=>
in_br
,
in_bi
=>
in_bi
,
in_val
=>
in_val
,
out_pr
=>
result_re_str
,
out_pi
=>
result_im_str
,
out_val
=>
result_val_str
);
u_dut_stratix4
:
ENTITY
work
.
common_complex_mult
(
stratix4
)
GENERIC
MAP
(
GENERIC
MAP
(
g_technology
=>
c_technology
,
g_variant
=>
"IP"
,
g_in_a_w
=>
g_in_dat_w
,
g_in_a_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
...
@@ -304,94 +271,6 @@ BEGIN
...
@@ -304,94 +271,6 @@ BEGIN
out_val
=>
result_val_stratix4
out_val
=>
result_val_stratix4
);
);
u_dut_str_stratix4
:
ENTITY
work
.
common_complex_mult
(
str_stratix4
)
GENERIC
MAP
(
g_in_a_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
g_conjugate_b
=>
g_conjugate_b
,
g_pipeline_input
=>
g_pipeline_input
,
g_pipeline_product
=>
g_pipeline_product
,
g_pipeline_adder
=>
g_pipeline_adder
,
g_pipeline_output
=>
g_pipeline_output
)
PORT
MAP
(
rst
=>
rst
,
clk
=>
clk
,
clken
=>
'1'
,
in_ar
=>
in_ar
,
in_ai
=>
in_ai
,
in_br
=>
in_br
,
in_bi
=>
in_bi
,
in_val
=>
in_val
,
out_pr
=>
result_re_str_stratix4
,
out_pi
=>
result_im_str_stratix4
,
out_val
=>
result_val_str_stratix4
);
u_dut_altera_rtl
:
ENTITY
work
.
common_complex_mult
(
altera_rtl
)
GENERIC
MAP
(
g_in_a_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
g_conjugate_b
=>
g_conjugate_b
,
g_pipeline_input
=>
g_pipeline_input
,
g_pipeline_product
=>
g_pipeline_product
,
g_pipeline_adder
=>
g_pipeline_adder
,
g_pipeline_output
=>
g_pipeline_output
)
PORT
MAP
(
rst
=>
rst
,
clk
=>
clk
,
clken
=>
'1'
,
in_ar
=>
in_ar
,
in_ai
=>
in_ai
,
in_br
=>
in_br
,
in_bi
=>
in_bi
,
in_val
=>
in_val
,
out_pr
=>
result_re_altera_rtl
,
out_pi
=>
result_im_altera_rtl
,
out_val
=>
result_val_altera_rtl
);
u_dut_rtl_dsp
:
ENTITY
work
.
common_complex_mult
(
rtl_dsp
)
GENERIC
MAP
(
g_in_a_w
=>
g_in_dat_w
,
g_in_b_w
=>
g_in_dat_w
,
g_out_p_w
=>
g_out_dat_w
,
g_conjugate_b
=>
g_conjugate_b
,
g_pipeline_input
=>
1
,
g_pipeline_product
=>
0
,
g_pipeline_adder
=>
0
,
g_pipeline_output
=>
1
)
PORT
MAP
(
rst
=>
rst
,
clk
=>
clk
,
clken
=>
'1'
,
in_ar
=>
in_ar
,
in_ai
=>
in_ai
,
in_br
=>
in_br
,
in_bi
=>
in_bi
,
in_val
=>
in_val
,
out_pr
=>
dut_re_rtl_dsp
,
out_pi
=>
dut_im_rtl_dsp
,
out_val
=>
dut_val_rtl_dsp
);
-- increase rtl_dsp latency to 3
p_dut_rtl_dsp_clk
:
PROCESS
(
rst
,
clk
)
BEGIN
IF
rst
=
'1'
THEN
result_re_rtl_dsp
<=
(
OTHERS
=>
'0'
);
result_im_rtl_dsp
<=
(
OTHERS
=>
'0'
);
result_val_rtl_dsp
<=
'0'
;
ELSIF
rising_edge
(
clk
)
THEN
result_re_rtl_dsp
<=
dut_re_rtl_dsp
;
result_im_rtl_dsp
<=
dut_im_rtl_dsp
;
result_val_rtl_dsp
<=
dut_val_rtl_dsp
;
END
IF
;
END
PROCESS
;
p_verify
:
PROCESS
(
rst
,
clk
)
p_verify
:
PROCESS
(
rst
,
clk
)
BEGIN
BEGIN
...
@@ -401,25 +280,10 @@ BEGIN
...
@@ -401,25 +280,10 @@ BEGIN
ASSERT
result_im_rtl
=
result_im_expected
REPORT
"Error: IM wrong RTL result"
SEVERITY
ERROR
;
ASSERT
result_im_rtl
=
result_im_expected
REPORT
"Error: IM wrong RTL result"
SEVERITY
ERROR
;
ASSERT
result_val_rtl
=
result_val_expected
REPORT
"Error: VAL wrong RTL result"
SEVERITY
ERROR
;
ASSERT
result_val_rtl
=
result_val_expected
REPORT
"Error: VAL wrong RTL result"
SEVERITY
ERROR
;
ASSERT
result_re_str
=
result_re_expected
REPORT
"Error: RE wrong STR result"
SEVERITY
ERROR
;
ASSERT
result_im_str
=
result_im_expected
REPORT
"Error: IM wrong STR result"
SEVERITY
ERROR
;
ASSERT
result_val_str
=
result_val_expected
REPORT
"Error: VAL wrong STR result"
SEVERITY
ERROR
;
ASSERT
result_re_stratix4
=
result_re_expected
REPORT
"Error: RE wrong stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_re_stratix4
=
result_re_expected
REPORT
"Error: RE wrong stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_im_stratix4
=
result_im_expected
REPORT
"Error: IM wrong stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_im_stratix4
=
result_im_expected
REPORT
"Error: IM wrong stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_val_stratix4
=
result_val_expected
REPORT
"Error: VAL wrong stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_val_stratix4
=
result_val_expected
REPORT
"Error: VAL wrong stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_re_str_stratix4
=
result_re_expected
REPORT
"Error: RE wrong STR_stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_im_str_stratix4
=
result_im_expected
REPORT
"Error: IM wrong STR_stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_val_str_stratix4
=
result_val_expected
REPORT
"Error: VAL wrong STR_stratix4 result"
SEVERITY
ERROR
;
ASSERT
result_re_altera_rtl
=
result_re_expected
REPORT
"Error: RE wrong altera_rtl result"
SEVERITY
ERROR
;
ASSERT
result_im_altera_rtl
=
result_im_expected
REPORT
"Error: IM wrong altera_rtl result"
SEVERITY
ERROR
;
ASSERT
result_val_altera_rtl
=
result_val_expected
REPORT
"Error: VAL wrong altera_rtl result"
SEVERITY
ERROR
;
ASSERT
result_re_rtl_dsp
=
result_re_expected
REPORT
"Error: RE wrong rtl_dsp result"
SEVERITY
ERROR
;
ASSERT
result_im_rtl_dsp
=
result_im_expected
REPORT
"Error: IM wrong rtl_dsp result"
SEVERITY
ERROR
;
ASSERT
result_val_rtl_dsp
=
result_val_expected
REPORT
"Error: VAL wrong rtl_dsp result"
SEVERITY
ERROR
;
END
IF
;
END
IF
;
END
IF
;
END
IF
;
END
PROCESS
;
END
PROCESS
;
...
...
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