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
78640739
Commit
78640739
authored
3 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Simplified tb verification by using delayed input sosi.
parent
3b074870
No related branches found
No related tags found
1 merge request
!156
Added first version of dp_bsn_align_v2.vhd with mmp and tb. This was...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/dp/tb/vhdl/tb_dp_bsn_align_v2.vhd
+25
-49
25 additions, 49 deletions
libraries/base/dp/tb/vhdl/tb_dp_bsn_align_v2.vhd
with
25 additions
and
49 deletions
libraries/base/dp/tb/vhdl/tb_dp_bsn_align_v2.vhd
+
25
−
49
View file @
78640739
...
@@ -72,12 +72,13 @@ ARCHITECTURE tb OF tb_dp_bsn_align_v2 IS
...
@@ -72,12 +72,13 @@ ARCHITECTURE tb OF tb_dp_bsn_align_v2 IS
CONSTANT
c_gap_size
:
NATURAL
:
=
g_block_period
-
g_block_size
;
CONSTANT
c_gap_size
:
NATURAL
:
=
g_block_period
-
g_block_size
;
CONSTANT
c_dut_latency
:
NATURAL
:
=
g_pipeline_input
+
g_rd_latency
+
2
;
CONSTANT
c_dut_latency
:
NATURAL
:
=
g_pipeline_input
+
g_rd_latency
+
2
;
CONSTANT
c_align_latency_nof_valid
:
NATURAL
:
=
g_bsn_latency_max
*
g_block_size
;
CONSTANT
c_align_latency_nof_blocks
:
NATURAL
:
=
g_bsn_latency_max
;
-- DUT buffer latency in number blocks
CONSTANT
c_align_latency_nof_clk
:
NATURAL
:
=
g_bsn_latency_max
*
g_block_period
;
CONSTANT
c_align_latency_nof_valid
:
NATURAL
:
=
g_bsn_latency_max
*
g_block_size
;
-- DUT buffer latency in number of data samples
CONSTANT
c_align_latency_nof_clk
:
NATURAL
:
=
g_bsn_latency_max
*
g_block_period
;
-- DUT buffer latency in number clk cycles
CONSTANT
c_total_latency
:
NATURAL
:
=
c_dut_latency
+
c_align_latency_nof_clk
;
CONSTANT
c_total_latency
:
NATURAL
:
=
c_dut_latency
+
c_align_latency_nof_clk
;
CONSTANT
c_verify_nof_blocks
:
NATURAL
:
=
g_tb_nof_blocks
-
g_bs
n_latency_
max
;
-- skip last blocks
CONSTANT
c_verify_nof_blocks
:
NATURAL
:
=
g_tb_nof_blocks
-
c_alig
n_latency_
nof_blocks
;
-- skip last blocks
that are still in the DUT buffer
TYPE
t_tb_state
IS
(
s_idle
,
s_start
,
s_restart
,
s_disable
,
s_lost
);
TYPE
t_tb_state
IS
(
s_idle
,
s_start
,
s_restart
);
TYPE
t_data_arr
IS
ARRAY
(
g_nof_streams
-1
DOWNTO
0
)
OF
STD_LOGIC_VECTOR
(
c_data_w
-1
DOWNTO
0
);
TYPE
t_data_arr
IS
ARRAY
(
g_nof_streams
-1
DOWNTO
0
)
OF
STD_LOGIC_VECTOR
(
c_data_w
-1
DOWNTO
0
);
TYPE
t_bsn_arr
IS
ARRAY
(
g_nof_streams
-1
DOWNTO
0
)
OF
STD_LOGIC_VECTOR
(
c_bsn_w
-1
DOWNTO
0
);
TYPE
t_bsn_arr
IS
ARRAY
(
g_nof_streams
-1
DOWNTO
0
)
OF
STD_LOGIC_VECTOR
(
c_bsn_w
-1
DOWNTO
0
);
...
@@ -133,6 +134,7 @@ ARCHITECTURE tb OF tb_dp_bsn_align_v2 IS
...
@@ -133,6 +134,7 @@ ARCHITECTURE tb OF tb_dp_bsn_align_v2 IS
SIGNAL
out_eop_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
);
SIGNAL
out_eop_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
);
SIGNAL
out_val_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
);
SIGNAL
out_val_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
);
SIGNAL
out_data_arr
:
t_data_arr
;
SIGNAL
out_data_arr
:
t_data_arr
;
SIGNAL
hold_data_arr
:
t_data_arr
;
SIGNAL
out_bsn_arr
:
t_bsn_arr
;
SIGNAL
out_bsn_arr
:
t_bsn_arr
;
SIGNAL
out_channel_arr
:
t_channel_arr
;
SIGNAL
out_channel_arr
:
t_channel_arr
;
SIGNAL
out_err_arr
:
t_err_arr
;
SIGNAL
out_err_arr
:
t_err_arr
;
...
@@ -145,13 +147,10 @@ ARCHITECTURE tb OF tb_dp_bsn_align_v2 IS
...
@@ -145,13 +147,10 @@ ARCHITECTURE tb OF tb_dp_bsn_align_v2 IS
SIGNAL
out_sosi_arr_exp
:
t_dp_sosi_arr
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
c_dp_sosi_rst
);
SIGNAL
out_sosi_arr_exp
:
t_dp_sosi_arr
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
c_dp_sosi_rst
);
SIGNAL
out_sosi_exp
:
t_dp_sosi
;
SIGNAL
out_sosi_exp
:
t_dp_sosi
;
SIGNAL
verify_done_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
verify_done_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
verify_en_prev_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
verify_sosi_en_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
verify_en_delayed_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
hold_out_sop_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
hold_out_sop_arr
:
STD_LOGIC_VECTOR
(
g_nof_streams
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
prev_out_bsn_arr
:
t_bsn_arr
;
SIGNAL
expected_out_bsn_arr
:
t_bsn_arr
;
SIGNAL
expected_out_bsn_arr
:
t_bsn_arr
;
SIGNAL
prev_out_data_arr
:
t_data_arr
;
SIGNAL
expected_out_data_arr
:
t_data_arr
;
SIGNAL
expected_out_data_arr
:
t_data_arr
;
-- Return input delay as function of inputs stream index I
-- Return input delay as function of inputs stream index I
...
@@ -205,7 +204,7 @@ BEGIN
...
@@ -205,7 +204,7 @@ BEGIN
END
LOOP
;
END
LOOP
;
-- End of stimuli, g_bsn_latency_max blocks remain in DUT buffer
-- End of stimuli, g_bsn_latency_max blocks remain in DUT buffer
expected_out_bsn_arr
(
I
)
<=
TO_UVEC
(
v_bsn
-1
-
g_bs
n_latency_
max
,
c_bsn_w
);
expected_out_bsn_arr
(
I
)
<=
TO_UVEC
(
v_bsn
-1
-
c_alig
n_latency_
nof_blocks
,
c_bsn_w
);
expected_out_data_arr
(
I
)
<=
TO_UVEC
(
v_data
-1
-
c_align_latency_nof_valid
,
c_data_w
);
expected_out_data_arr
(
I
)
<=
TO_UVEC
(
v_data
-1
-
c_align_latency_nof_valid
,
c_data_w
);
proc_common_wait_some_cycles
(
clk
,
100
);
proc_common_wait_some_cycles
(
clk
,
100
);
...
@@ -226,8 +225,7 @@ BEGIN
...
@@ -226,8 +225,7 @@ BEGIN
tb_state
<=
s_idle
;
tb_state
<=
s_idle
;
IF
restart_cnt
=
0
THEN
tb_state
<=
s_start
;
END
IF
;
IF
restart_cnt
=
0
THEN
tb_state
<=
s_start
;
END
IF
;
IF
restart_cnt
=
1
THEN
tb_state
<=
s_restart
;
END
IF
;
IF
restart_cnt
=
1
THEN
tb_state
<=
s_restart
;
END
IF
;
IF
restart_cnt
=
3
THEN
tb_state
<=
s_disable
;
END
IF
;
IF
restart_cnt
>
1
THEN
tb_state
<=
s_restart
;
END
IF
;
IF
restart_cnt
=
4
THEN
tb_state
<=
s_lost
;
END
IF
;
END
PROCESS
;
END
PROCESS
;
-- Create latency misalignment between the input streams
-- Create latency misalignment between the input streams
...
@@ -274,58 +272,36 @@ BEGIN
...
@@ -274,58 +272,36 @@ BEGIN
out_sosi_arr_exp
<=
ref_sosi_arr_dly
WHEN
rising_edge
(
clk
);
out_sosi_arr_exp
<=
ref_sosi_arr_dly
WHEN
rising_edge
(
clk
);
out_sosi_exp
<=
out_sosi_arr_exp
(
0
);
-- take out_sosi_exp control and info from out_sosi_arr_exp(0)
out_sosi_exp
<=
out_sosi_arr_exp
(
0
);
-- take out_sosi_exp control and info from out_sosi_arr_exp(0)
------------------------------------------------------------------------------
gen_verify_ctrl
:
FOR
I
IN
g_nof_streams
-1
DOWNTO
0
GENERATE
-- a) Use proc_dp_verify_()
------------------------------------------------------------------------------
p_verify_en_prev_arr
:
PROCESS
BEGIN
WAIT
UNTIL
rising_edge
(
clk
);
IF
g_tb_diff_delay_max
<=
c_align_latency_nof_clk
THEN
-- Can only verify incrementing sosi data when no blocks get lost
-- Use sop to skip sample of first block from verification, because then there is no prev_out_bsn_arr, prev_out_data_arr yet
IF
out_sosi_exp
.
sop
=
'1'
THEN
verify_en_prev_arr
<=
(
OTHERS
=>
'0'
);
IF
TO_UINT
(
out_sosi_exp
.
bsn
)
-
c_bsn_init
<
c_verify_nof_blocks
THEN
verify_en_prev_arr
<=
(
OTHERS
=>
'1'
);
END
IF
;
END
IF
;
END
IF
;
END
PROCESS
;
gen_verify_prev_sosi
:
FOR
I
IN
g_nof_streams
-1
DOWNTO
0
GENERATE
-- Actual verification of the output streams
-- . Verify that sop and eop come in pairs
-- . Verify that sop and eop come in pairs
proc_dp_verify_sop_and_eop
(
clk
,
out_val_arr
(
I
),
out_sop_arr
(
I
),
out_eop_arr
(
I
),
hold_out_sop_arr
(
I
));
proc_dp_verify_sop_and_eop
(
clk
,
out_val_arr
(
I
),
out_sop_arr
(
I
),
out_eop_arr
(
I
),
hold_out_sop_arr
(
I
));
-- . Verify that the output is incrementing, like the input stimuli
-- . No data verification here, using p_verify_sosi is easier than using proc_dp_verify_data().
proc_dp_verify_data
(
"out_sosi_arr().data"
,
c_rl
,
clk
,
verify_en_prev_arr
(
I
),
out_siso_arr
(
I
)
.
ready
,
out_val_arr
(
I
),
out_data_arr
(
I
),
prev_out_data_arr
(
I
));
proc_dp_verify_data
(
"out_sosi_arr().bsn"
,
c_rl
,
clk
,
verify_en_prev_arr
(
I
),
out_siso_arr
(
I
)
.
ready
,
out_sop_arr
(
I
),
out_bsn_arr
(
I
),
prev_out_bsn_arr
(
I
));
-- . Verify that the stimuli have been applied at all
-- . Verify that the stimuli have been applied at all
proc_dp_verify_value
(
"out_data_arr"
,
e_equal
,
clk
,
verify_done_arr
(
I
),
expected_out_data_arr
(
I
),
prev_out_data_arr
(
I
));
hold_data_arr
(
I
)
<=
out_data_arr
(
I
)
WHEN
out_val_arr
(
I
)
=
'1'
;
-- hold last valid data
proc_dp_verify_value
(
"out_bsn_arr"
,
e_equal
,
clk
,
verify_done_arr
(
I
),
expected_out_bsn_arr
(
I
),
prev_out_bsn_arr
(
I
));
proc_dp_verify_value
(
"out_data_arr"
,
e_equal
,
clk
,
verify_done_arr
(
I
),
expected_out_data_arr
(
I
),
hold_data_arr
(
I
));
proc_dp_verify_value
(
"out_bsn_arr"
,
e_equal
,
clk
,
verify_done_arr
(
I
),
expected_out_bsn_arr
(
I
),
out_bsn_arr
(
I
));
END
GENERATE
;
END
GENERATE
;
------------------------------------------------------------------------------
-- . Use delayed in_sosi_arr as expected out_sosi_arr, this is possible
-- b) Use delayed in_sosi_arr as expected out_sosi_arr
-- because the DUT has no flow control and has a fixed latency.
------------------------------------------------------------------------------
p_verify_sosi_en_arr
:
PROCESS
(
out_sosi_exp
)
p_verify_en_delayed_arr
:
PROCESS
(
out_sosi_exp
)
BEGIN
BEGIN
IF
g_tb_diff_delay_max
<=
c_align_latency_nof_clk
THEN
IF
g_tb_diff_delay_max
<=
c_align_latency_nof_clk
THEN
-- Can only verify incrementing sosi data when no blocks get lost
verify_sosi_en_arr
<=
(
OTHERS
=>
'1'
);
-- Skip sample of first block from verification, because then there is no prev_out_bsn_arr, prev_out_data_arr yet
verify_en_delayed_arr
<=
(
OTHERS
=>
'1'
);
IF
TO_UINT
(
out_sosi_exp
.
bsn
)
-
c_bsn_init
>=
c_verify_nof_blocks
THEN
IF
TO_UINT
(
out_sosi_exp
.
bsn
)
-
c_bsn_init
>=
c_verify_nof_blocks
THEN
verify_
en_delayed
_arr
<=
(
OTHERS
=>
'0'
);
verify_
sosi_en
_arr
<=
(
OTHERS
=>
'0'
);
END
IF
;
END
IF
;
END
IF
;
END
IF
;
END
PROCESS
;
END
PROCESS
;
gen_verify_
delayed_sosi
:
FOR
I
IN
g_nof_streams
-1
DOWNTO
0
GENERATE
gen_verify_
streams
:
FOR
I
IN
g_nof_streams
-1
DOWNTO
0
GENERATE
p_verify_
data
:
PROCESS
(
clk
)
p_verify_
sosi
:
PROCESS
(
clk
)
BEGIN
BEGIN
IF
rising_edge
(
clk
)
THEN
IF
rising_edge
(
clk
)
THEN
IF
verify_
en_delayed
_arr
(
I
)
=
'1'
AND
out_sosi_arr_exp
(
I
)
.
valid
=
'1'
THEN
IF
verify_
sosi_en
_arr
(
I
)
=
'1'
AND
out_sosi_arr_exp
(
I
)
.
valid
=
'1'
THEN
ASSERT
out_sosi_arr
(
I
)
.
sync
=
out_sosi_arr_exp
(
I
)
.
sync
REPORT
"Wrong sync for output "
&
int_to_str
(
I
)
SEVERITY
ERROR
;
ASSERT
out_sosi_arr
(
I
)
.
sync
=
out_sosi_arr_exp
(
I
)
.
sync
REPORT
"Wrong sync for output "
&
int_to_str
(
I
)
SEVERITY
ERROR
;
ASSERT
out_sosi_arr
(
I
)
.
sop
=
out_sosi_arr_exp
(
I
)
.
sop
REPORT
"Wrong sop for output "
&
int_to_str
(
I
)
SEVERITY
ERROR
;
ASSERT
out_sosi_arr
(
I
)
.
sop
=
out_sosi_arr_exp
(
I
)
.
sop
REPORT
"Wrong sop for output "
&
int_to_str
(
I
)
SEVERITY
ERROR
;
ASSERT
out_sosi_arr
(
I
)
.
eop
=
out_sosi_arr_exp
(
I
)
.
eop
REPORT
"Wrong eop for output "
&
int_to_str
(
I
)
SEVERITY
ERROR
;
ASSERT
out_sosi_arr
(
I
)
.
eop
=
out_sosi_arr_exp
(
I
)
.
eop
REPORT
"Wrong eop for output "
&
int_to_str
(
I
)
SEVERITY
ERROR
;
...
...
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