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
3cb44a58
Commit
3cb44a58
authored
1 year ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Fixed verification of g_bsn_increment. Prepared support for g_pkt_len_unmerge /= g_pkt_len_merge.
parent
8407f100
No related branches found
No related tags found
1 merge request
!357
Move func_sdp_bdo_cep_hdr_field_sel_dest() from sdp_bdo_pkg to...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/base/dp/tb/vhdl/tb_dp_packet_merge_unmerge.vhd
+33
-16
33 additions, 16 deletions
libraries/base/dp/tb/vhdl/tb_dp_packet_merge_unmerge.vhd
libraries/base/dp/tb/vhdl/tb_tb_dp_packet_merge_unmerge.vhd
+20
-19
20 additions, 19 deletions
libraries/base/dp/tb/vhdl/tb_tb_dp_packet_merge_unmerge.vhd
with
53 additions
and
35 deletions
libraries/base/dp/tb/vhdl/tb_dp_packet_merge_unmerge.vhd
+
33
−
16
View file @
3cb44a58
...
...
@@ -21,11 +21,24 @@
-- Purpose:
-- . Test bench for dp_packet_merge and dp_packet_unmerge
-- Description:
-- . The p_stimuli_st uses proc_dp_gen_block_data to generate g_nof_repeat packets for the DUT. The output of the DUT needs
-- to be similar e.g. by means of an inverse DUT component so that the proc_dp_verify_* procedures can be used to verify
-- that the counter data in the sosi data fields is passed on correctly. Furthermore the proc_dp_verify_* procedures
-- verify that the test bench has yielded output results at all and that the output valid, sop, eop, and ready fits the
-- streaming interface specification.
-- . The p_stimuli_st uses proc_dp_gen_block_data to generate g_nof_repeat
-- stimuli_src_out packets of length g_pkt_len_merge.
-- The u_dp_packet_merge merges g_nof_pkt packets from stimuli_src_out into
-- dp_packet_merge_src_out.
-- The p_stimuli_unmerge provides stimuli for the .err and .empty fields of
-- dp_packet_merge_src_out to get dp_packet_merge_sosi
-- The u_dp_packet_unmerge unmerges the dp_packet_merge_sosi into packets
-- of length g_pkt_len_unmerge into verify_snk_in.
-- If g_pkt_len_unmerge /= g_pkt_len_merge, then the last unmerged packet
-- may be shorter then g_pkt_len_unmerge, to contain the remaining data.
--
-- p_stimuli_st --> u_dp_packet_merge --+--> u_dp_packet_unmerge --> p_verify
-- ^
-- |
-- p_stimuli_unmerge --/
--
-- . Flow control is verified via g_flow_control_*.
--
-- Usage:
-- > as 10
-- > run -all
...
...
@@ -49,11 +62,12 @@ entity tb_dp_packet_merge_unmerge is
-- specific
g_pipeline_ready
:
boolean
:
=
true
;
g_data_w
:
natural
:
=
16
;
g_nof_repeat
:
natural
:
=
2
4
;
g_nof_repeat
:
natural
:
=
1
4
;
g_nof_pkt
:
natural
:
=
3
;
g_pkt_len
:
natural
:
=
29
;
g_pkt_len_merge
:
natural
:
=
9
;
g_pkt_len_unmerge
:
natural
:
=
9
;
g_pkt_gap
:
natural
:
=
0
;
g_bsn_increment
:
natural
:
=
0
g_bsn_increment
:
natural
:
=
2
);
end
tb_dp_packet_merge_unmerge
;
...
...
@@ -70,6 +84,8 @@ architecture tb of tb_dp_packet_merge_unmerge is
constant
c_data_max
:
unsigned
(
g_data_w
-
1
downto
0
)
:
=
(
others
=>
'1'
);
constant
c_data_init
:
integer
:
=
-1
;
constant
c_bsn_init
:
std_logic_vector
(
c_dp_stream_bsn_w
-
1
downto
0
)
:
=
X"0000000000000000"
;
-- X"0877665544332211"
constant
c_bsn_increment_w
:
natural
:
=
ceil_log2
(
g_bsn_increment
+
1
);
constant
c_unsigned_bsn_increment
:
unsigned
(
c_bsn_increment_w
-
1
downto
0
)
:
=
to_unsigned
(
g_bsn_increment
,
c_bsn_increment_w
);
constant
c_nof_pkt_not_zero
:
natural
:
=
sel_a_b
(
g_nof_pkt
=
0
,
1
,
g_nof_pkt
);
constant
c_nof_merged_sop
:
natural
:
=
sel_a_b
(
g_nof_pkt
=
0
,
0
,
ceil_div
(
g_nof_repeat
,
c_nof_pkt_not_zero
));
...
...
@@ -165,11 +181,11 @@ begin
v_sosi
.
bsn
:
=
INCR_UVEC
(
v_sosi
.
bsn
,
g_bsn_increment
);
-- insert sync starting at BSN = c_sync_offset and with period c_sync_period
v_sosi
.
sync
:
=
sel_a_b
((
unsigned
(
v_sosi
.
bsn
)
mod
c_sync_period
)
=
c_sync_offset
,
'1'
,
'0'
);
v_sosi
.
data
:
=
INCR_UVEC
(
v_sosi
.
data
,
g_pkt_len
);
v_sosi
.
data
:
=
INCR_UVEC
(
v_sosi
.
data
,
g_pkt_len
_merge
);
v_sosi
.
data
:
=
RESIZE_DP_DATA
(
v_sosi
.
data
(
g_data_w
-
1
downto
0
));
-- wrap when >= 2**g_data_w
-- Send packet
proc_dp_gen_block_data
(
g_data_w
,
TO_UINT
(
v_sosi
.
data
),
g_pkt_len
,
proc_dp_gen_block_data
(
g_data_w
,
TO_UINT
(
v_sosi
.
data
),
g_pkt_len
_merge
,
c_channel
,
c_err
,
v_sosi
.
sync
,
v_sosi
.
bsn
,
clk
,
stimuli_en
,
stimuli_src_in
,
stimuli_src_out
);
...
...
@@ -182,8 +198,8 @@ begin
-- . e_at_least
v_sosi
.
bsn
:
=
std_logic_vector
(
unsigned
(
c_bsn_init
)
+
c_verify_at_least
*
g_nof_pkt
);
-- . account for g_pkt_len
v_sosi
.
data
:
=
INCR_UVEC
(
v_sosi
.
data
,
g_pkt_len
-
1
);
-- . account for g_pkt_len
_merge
v_sosi
.
data
:
=
INCR_UVEC
(
v_sosi
.
data
,
g_pkt_len
_merge
-
1
);
v_sosi
.
data
:
=
RESIZE_DP_DATA
(
v_sosi
.
data
(
g_data_w
-
1
downto
0
));
-- wrap when >= 2**g_data_w
expected_verify_snk_in
<=
v_sosi
;
...
...
@@ -201,6 +217,7 @@ begin
------------------------------------------------------------------------------
-- DATA VERIFICATION
-- . p_verify
------------------------------------------------------------------------------
-- Start verify after first valid, sop or eop
...
...
@@ -221,7 +238,7 @@ begin
verify_snk_in
.
valid
,
verify_snk_in
.
data
,
prev_verify_snk_in
.
data
);
-- Verify that the output is incrementing BSN, like the input stimuli
proc_dp_verify_data
(
"verify_snk_in.bsn"
,
c_rl
,
c_unsigned_0
,
c_unsigned_
0
,
proc_dp_verify_data
(
"verify_snk_in.bsn"
,
c_rl
,
c_unsigned_0
,
c_unsigned_
bsn_increment
,
clk
,
verify_en_sop
,
verify_snk_out
.
ready
,
verify_snk_in
.
sop
,
verify_snk_in
.
bsn
,
prev_verify_snk_in
.
bsn
);
...
...
@@ -287,7 +304,7 @@ begin
------------------------------------------------------------------------------
p_stimuli_unmerge
:
process
(
dp_packet_merge_src_out
)
begin
dp_packet_merge_sosi
<=
dp_packet_merge_src_out
;
dp_packet_merge_sosi
<=
dp_packet_merge_src_out
;
-- Use counter as err field stimulus, per merged packet. Use
-- offset to distinguish err and empty values
dp_packet_merge_sosi
.
err
<=
TO_DP_ERROR
(
merged_pkt_cnt
);
...
...
@@ -312,8 +329,8 @@ begin
generic
map
(
g_use_ready
=>
c_use_ready
,
g_pipeline_ready
=>
g_pipeline_ready
,
g_nof_pkt
_max
=>
g_nof_pkt
,
g_pkt_len
=>
g_pkt_len
,
g_nof_pkt
=>
g_nof_pkt
,
g_pkt_len
=>
g_pkt_len
_unmerge
,
g_bsn_increment
=>
g_bsn_increment
)
port
map
(
...
...
This diff is collapsed.
Click to expand it.
libraries/base/dp/tb/vhdl/tb_tb_dp_packet_merge_unmerge.vhd
+
20
−
19
View file @
3cb44a58
...
...
@@ -43,28 +43,29 @@ begin
-- g_data_w : natural := 4;
-- g_nof_repeat : natural := 20;
-- g_nof_pkt : natural := 3;
-- g_pkt_len : natural := 29;
-- g_pkt_len_merge : natural := 29;
-- g_pkt_len_unmerge : natural := 29;
-- g_pkt_gap : natural := 0;
-- g_bsn_increment : natural := 0;
u_act_act_8_nof_0
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
0
,
29
,
0
,
1
);
u_act_act_8_nof_1
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
1
,
29
,
0
,
1
);
u_act_act_8_nof_2
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
2
,
29
,
0
,
1
);
u_act_act_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
0
,
1
);
u_act_act_8_nof_4
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
4
,
29
,
0
,
1
);
u_act_act_8_nof_4_bsn_0
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
4
,
29
,
0
,
0
);
--
u_act_act_8_nof_4_bsn_2 : entity work.tb_dp_packet_merge_unmerge generic map ( e_active, e_active, true, 8, c_nof_repeat, 4, 29, 0, 2);
u_act_act_8_nof_5
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
5
,
29
,
0
,
1
);
u_act_act_8_nof_6
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
6
,
29
,
0
,
1
);
u_act_act_8_nof_7
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
7
,
29
,
0
,
1
);
u_act_act_8_nof_0
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
0
,
29
,
29
,
0
,
1
);
u_act_act_8_nof_1
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
1
,
29
,
29
,
0
,
1
);
u_act_act_8_nof_2
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
2
,
29
,
29
,
0
,
1
);
u_act_act_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
0
,
1
);
u_act_act_8_nof_4
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
4
,
29
,
29
,
0
,
1
);
u_act_act_8_nof_4_bsn_0
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
4
,
29
,
29
,
0
,
0
);
u_act_act_8_nof_4_bsn_2
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
4
,
29
,
29
,
0
,
2
);
u_act_act_8_nof_5
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
5
,
29
,
29
,
0
,
1
);
u_act_act_8_nof_6
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
6
,
29
,
29
,
0
,
1
);
u_act_act_8_nof_7
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_active
,
e_active
,
true
,
8
,
c_nof_repeat
,
7
,
29
,
29
,
0
,
1
);
u_rnd_act_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
0
,
1
);
u_rnd_rnd_8_nof_3_comb
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_random
,
false
,
8
,
c_nof_repeat
,
3
,
29
,
0
,
1
);
u_rnd_rnd_8_nof_3_reg
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_random
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
0
,
1
);
u_pls_act_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_pulse
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
0
,
1
);
u_pls_rnd_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_pulse
,
e_random
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
0
,
1
);
u_pls_pls_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_pulse
,
e_pulse
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
0
,
1
);
u_rnd_act_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
0
,
1
);
u_rnd_rnd_8_nof_3_comb
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_random
,
false
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
0
,
1
);
u_rnd_rnd_8_nof_3_reg
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_random
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
0
,
1
);
u_pls_act_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_pulse
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
0
,
1
);
u_pls_rnd_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_pulse
,
e_random
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
0
,
1
);
u_pls_pls_8_nof_3
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_pulse
,
e_pulse
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
0
,
1
);
u_rnd_act_8_nof_1
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_active
,
true
,
8
,
c_nof_repeat
,
1
,
29
,
0
,
1
);
u_rnd_act_8_nof_3_gap
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
17
,
1
);
u_rnd_act_8_nof_1
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_active
,
true
,
8
,
c_nof_repeat
,
1
,
29
,
29
,
0
,
1
);
u_rnd_act_8_nof_3_gap
:
entity
work
.
tb_dp_packet_merge_unmerge
generic
map
(
e_random
,
e_active
,
true
,
8
,
c_nof_repeat
,
3
,
29
,
29
,
17
,
1
);
end
tb
;
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