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
e390c5db
Commit
e390c5db
authored
8 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added g_channel_incr and g_err_incr. Default 1, but this enables using e.g. 0 for fixed valeus.
parent
ef229edc
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd
+16
-10
16 additions, 10 deletions
libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd
with
16 additions
and
10 deletions
libraries/base/dp/tb/vhdl/dp_stream_stimuli.vhd
+
16
−
10
View file @
e390c5db
...
...
@@ -23,6 +23,10 @@
-- . The dp_stream_stimuli generates as stream of packets with counter data.
-- Description:
--
-- Remark:
-- . The stimuli empty = 0 because the data in proc_dp_gen_block_data() is
-- generated with one symbol per data (because symbol_w = data_w).
--
-- Usage:
-- . See tb_dp_example_no_dut for usage example
--
...
...
@@ -48,10 +52,12 @@ ENTITY dp_stream_stimuli IS
-- initializations
g_sync_period
:
NATURAL
:
=
10
;
g_sync_offset
:
NATURAL
:
=
7
;
g_data_init
:
NATURAL
:
=
0
;
g_bsn_init
:
STD_LOGIC_VECTOR
(
c_dp_stream_bsn_w
-1
DOWNTO
0
)
:
=
X"0000000000000000"
;
-- X"0877665544332211"
g_err_init
:
NATURAL
:
=
247
;
g_channel_init
:
NATURAL
:
=
5
;
-- fixed
g_data_init
:
NATURAL
:
=
0
;
-- choose some easy to recognize and unique value, data will increment at every sop
g_bsn_init
:
STD_LOGIC_VECTOR
(
c_dp_stream_bsn_w
-1
DOWNTO
0
)
:
=
X"0000000000000000"
;
-- X"0877665544332211", bsn will increment at every sop
g_err_init
:
NATURAL
:
=
247
;
-- choose some easy to recognize and unique value
g_err_incr
:
NATURAL
:
=
1
;
-- when 0 keep fixed at init value, when 1 increment at every sop
g_channel_init
:
NATURAL
:
=
5
;
-- choose some easy to recognize and unique value
g_channel_incr
:
NATURAL
:
=
1
;
-- when 0 keep fixed at init value, when 1 increment at every sop
-- specific
g_in_dat_w
:
NATURAL
:
=
32
;
g_nof_repeat
:
NATURAL
:
=
5
;
...
...
@@ -116,9 +122,9 @@ BEGIN
-- Adjust initial sosi field values by -1 to compensate for auto increment
v_sosi
.
bsn
:
=
INCR_UVEC
(
g_bsn_init
,
-1
);
v_sosi
.
channel
:
=
INCR_UVEC
(
TO_DP_CHANNEL
(
g_channel_init
),
-
1
);
v_sosi
.
channel
:
=
INCR_UVEC
(
TO_DP_CHANNEL
(
g_channel_init
),
-
g_channel_incr
);
v_sosi
.
data
:
=
INCR_UVEC
(
TO_DP_DATA
(
g_data_init
),
-
g_pkt_len
);
v_sosi
.
err
:
=
INCR_UVEC
(
TO_DP_ERROR
(
g_err_init
),
-
1
);
v_sosi
.
err
:
=
INCR_UVEC
(
TO_DP_ERROR
(
g_err_init
),
-
g_err_incr
);
i_src_out
<=
c_dp_sosi_rst
;
proc_common_wait_until_low
(
clk
,
rst
);
...
...
@@ -129,10 +135,10 @@ BEGIN
-- Auto increment v_sosi field values for this packet
v_sosi
.
bsn
:
=
INCR_UVEC
(
v_sosi
.
bsn
,
1
);
v_sosi
.
sync
:
=
sel_a_b
((
UNSIGNED
(
v_sosi
.
bsn
)
MOD
g_sync_period
)
=
g_sync_offset
,
'1'
,
'0'
);
-- insert sync starting at BSN=g_sync_offset and with period g_sync_period
v_sosi
.
channel
:
=
INCR_UVEC
(
v_sosi
.
channel
,
1
);
v_sosi
.
channel
:
=
INCR_UVEC
(
v_sosi
.
channel
,
g_channel_incr
);
v_sosi
.
data
:
=
INCR_UVEC
(
v_sosi
.
data
,
g_pkt_len
);
v_sosi
.
data
:
=
RESIZE_DP_DATA
(
v_sosi
.
data
(
g_in_dat_w
-1
DOWNTO
0
));
-- wrap when >= 2**g_in_dat_w
v_sosi
.
err
:
=
INCR_UVEC
(
v_sosi
.
err
,
1
);
v_sosi
.
err
:
=
INCR_UVEC
(
v_sosi
.
err
,
g_err_incr
);
-- Send packet
proc_dp_gen_block_data
(
g_in_dat_w
,
TO_UINT
(
v_sosi
.
data
),
g_pkt_len
,
TO_UINT
(
v_sosi
.
channel
),
TO_UINT
(
v_sosi
.
err
),
v_sosi
.
sync
,
v_sosi
.
bsn
,
clk
,
stimuli_en
,
src_in
,
i_src_out
);
...
...
@@ -154,8 +160,8 @@ BEGIN
-- Determine and keep last expected sosi field values after end of stimuli
-- . e_qual
v_last
.
bsn
:
=
STD_LOGIC_VECTOR
(
UNSIGNED
(
g_bsn_init
)
+
g_nof_repeat
-1
);
v_last
.
channel
:
=
TO_DP_CHANNEL
(
g_channel_init
+
g_nof_repeat
-1
);
v_last
.
err
:
=
TO_DP_ERROR
(
g_err_init
+
g_nof_repeat
-1
);
v_last
.
channel
:
=
TO_DP_CHANNEL
(
g_channel_init
+
(
g_nof_repeat
-1
)
*
g_channel_incr
)
;
v_last
.
err
:
=
TO_DP_ERROR
(
g_err_init
+
(
g_nof_repeat
-1
)
*
g_err_incr
)
;
-- . account for g_pkt_len
v_last
.
data
:
=
INCR_UVEC
(
v_sosi
.
data
,
g_pkt_len
-1
);
v_last
.
data
:
=
RESIZE_DP_DATA
(
v_last
.
data
(
g_in_dat_w
-1
DOWNTO
0
));
-- wrap when >= 2**g_in_dat_w
...
...
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