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
7b9f8875
Commit
7b9f8875
authored
10 years ago
by
Pepping
Browse files
Options
Downloads
Patches
Plain Diff
Copy
parent
3f057bcd
Branches
Branches containing commit
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/tb_dp_reinterleave.vhd
+139
-0
139 additions, 0 deletions
libraries/base/dp/tb/vhdl/tb_dp_reinterleave.vhd
with
139 additions
and
0 deletions
libraries/base/dp/tb/vhdl/tb_dp_reinterleave.vhd
0 → 100644
+
139
−
0
View file @
7b9f8875
-------------------------------------------------------------------------------
--
-- Copyright (C) 2012
-- ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
-- P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-------------------------------------------------------------------------------
LIBRARY
IEEE
,
common_lib
;
USE
IEEE
.
STD_LOGIC_1164
.
ALL
;
USE
work
.
dp_stream_pkg
.
ALL
;
USE
common_lib
.
common_pkg
.
ALL
;
USE
common_lib
.
tb_common_pkg
.
ALL
;
USE
work
.
tb_dp_pkg
.
ALL
;
-- Purpose: Test bench to check reinterleave function on DP level
-- Usage:
-- > as 6
-- > run 2us
-- Remark:
-- This TB is only used to visually inspect the wave window to see
-- if all functions well on DP level. The actual reinterleaving itself
-- is verified more thoroughly in tb_common_reinterleave.
ENTITY
tb_dp_reinterleave
IS
GENERIC
(
g_dat_w
:
NATURAL
:
=
16
;
g_nof_in
:
NATURAL
:
=
4
;
g_deint_block_size
:
NATURAL
:
=
2
;
g_nof_out
:
NATURAL
:
=
4
;
g_inter_block_size
:
NATURAL
:
=
2
;
g_use_complex
:
BOOLEAN
:
=
TRUE
;
g_align_out
:
BOOLEAN
:
=
TRUE
);
END
;
ARCHITECTURE
rtl
OF
tb_dp_reinterleave
IS
TYPE
t_dat_arr
IS
ARRAY
(
INTEGER
RANGE
<>
)
OF
STD_LOGIC_VECTOR
(
g_dat_w
-1
DOWNTO
0
);
TYPE
t_val_arr
IS
ARRAY
(
INTEGER
RANGE
<>
)
OF
STD_LOGIC
;
-----------------------------------------------------------------------------
-- Standard TB clocking, RST and control
-----------------------------------------------------------------------------
CONSTANT
c_clk_period
:
TIME
:
=
10
ns
;
SIGNAL
clk
:
STD_LOGIC
:
=
'1'
;
SIGNAL
rst
:
STD_LOGIC
;
SIGNAL
tb_end
:
STD_LOGIC
:
=
'0'
;
SIGNAL
cnt_ena
:
STD_LOGIC
;
-----------------------------------------------------------------------------
--I/O streams
-----------------------------------------------------------------------------
CONSTANT
c_input_val
:
NATURAL
:
=
192
;
CONSTANT
c_input_inval
:
NATURAL
:
=
64
;
SIGNAL
snk_in_arr
:
t_dp_sosi_arr
(
g_nof_in
-1
DOWNTO
0
);
SIGNAL
snk_out_arr
:
t_dp_siso_arr
(
g_nof_in
-1
DOWNTO
0
);
SIGNAL
src_out_arr
:
t_dp_sosi_arr
(
g_nof_out
-1
DOWNTO
0
);
BEGIN
-----------------------------------------------------------------------------
-- Standard TB clocking, RST and control
-----------------------------------------------------------------------------
clk
<=
NOT
clk
OR
tb_end
AFTER
c_clk_period
/
2
;
rst
<=
'1'
,
'0'
AFTER
3
*
c_clk_period
;
-----------------------------------------------------------------------------
-- Generate g_nof_in test data streams with counter data
-----------------------------------------------------------------------------
cnt_ena
<=
'0'
,
'1'
AFTER
20
*
c_clk_period
;
gen_cnt_dat
:
FOR
i
IN
0
TO
g_nof_in
-1
GENERATE
p_stimuli
:
PROCESS
VARIABLE
v_bsn
:
STD_LOGIC_VECTOR
(
c_dp_stream_bsn_w
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
'0'
);
BEGIN
WHILE
TRUE
LOOP
WAIT
UNTIL
rising_edge
(
clk
);
proc_dp_gen_block_data
(
1
,
sel_a_b
(
g_use_complex
,
FALSE
,
TRUE
),
g_dat_w
,
g_dat_w
,
0
,
0
,
0
,
c_input_val
,
0
,
0
,
'1'
,
v_bsn
,
clk
,
cnt_ena
,
snk_out_arr
(
i
),
snk_in_arr
(
i
));
proc_common_wait_some_cycles
(
clk
,
c_input_inval
);
v_bsn
:
=
INCR_UVEC
(
v_bsn
,
1
);
END
LOOP
;
END
PROCESS
;
-----------------------------------------------------------------------------
-- The I/O of common_reinterleave and its lower level components operate
-- on the same data width share the same clock, so if g_nof_in>g_nof_out,
-- lower the effective input data rate accordingly by introducing gaps.
-----------------------------------------------------------------------------
p_cnt_dat_gaps
:
PROCESS
BEGIN
snk_out_arr
(
i
)
.
xon
<=
'1'
;
snk_out_arr
(
i
)
.
ready
<=
'0'
;
WAIT
FOR
c_clk_period
*
(
ceil_div
(
g_nof_in
,
g_nof_out
)
-1
);
snk_out_arr
(
i
)
.
ready
<=
'1'
;
WAIT
FOR
c_clk_period
;
END
PROCESS
;
END
GENERATE
;
-----------------------------------------------------------------------------
-- DUT
-----------------------------------------------------------------------------
u_reinterleave
:
ENTITY
work
.
dp_reinterleave
GENERIC
MAP
(
g_nof_in
=>
g_nof_in
,
g_deint_block_size
=>
g_deint_block_size
,
g_nof_out
=>
g_nof_out
,
g_inter_block_size
=>
g_inter_block_size
,
g_dat_w
=>
g_dat_w
,
g_use_complex
=>
g_use_complex
,
g_align_out
=>
g_align_out
)
PORT
MAP
(
rst
=>
rst
,
clk
=>
clk
,
snk_in_arr
=>
snk_in_arr
,
src_out_arr
=>
src_out_arr
);
END
rtl
;
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