Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tdc-core
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
hdl-core-lib
tdc-core
Commits
2de556c1
Commit
2de556c1
authored
13 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Downloads
Patches
Plain Diff
controller: better test bench
parent
e30d6303
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tb/controller/tb_controller.vhd
+11
-2
11 additions, 2 deletions
tb/controller/tb_controller.vhd
with
11 additions
and
2 deletions
tb/controller/tb_controller.vhd
+
11
−
2
View file @
2de556c1
...
...
@@ -27,7 +27,7 @@ use work.tdc_package.all;
entity
tb_controller
is
generic
(
g_RAW_COUNT
:
positive
:
=
3
;
g_FP_COUNT
:
positive
:
=
4
;
g_FP_COUNT
:
positive
:
=
5
;
g_FCOUNTER_WIDTH
:
positive
:
=
3
);
end
entity
;
...
...
@@ -159,7 +159,7 @@ begin
end
if
;
end
process
;
-- this should divide by 2.
oc_freq
<=
(
0
=>
'1'
,
others
=>
'0'
);
oc_freq
<=
(
1
=>
'1'
,
others
=>
'0'
);
oc_sfreq
<=
(
0
=>
'1'
,
others
=>
'0'
);
-- channel mux
...
...
@@ -174,6 +174,8 @@ begin
cs_last
<=
'1'
;
process
variable
v_bin_width
:
integer
;
variable
v_step
:
integer
;
begin
reset
<=
'1'
;
wait
until
rising_edge
(
clk
);
...
...
@@ -182,6 +184,13 @@ begin
wait
until
ready
=
'1'
;
-- verify written LUT contents
v_bin_width
:
=
2
**
(
g_FP_COUNT
-
g_RAW_COUNT
);
v_step
:
=
v_bin_width
/
2
;
-- divided by 2 by online calibration (see frequencies above)
for
i
in
1
to
2
**
g_RAW_COUNT
-1
loop
assert
to_integer
(
unsigned
(
lut_memory
(
i
)))
=
v_step
*
(
i
-1
)
severity
failure
;
end
loop
;
report
"Test passed."
;
end_simulation
<=
true
;
wait
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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