Skip to content
GitLab
Explore
Sign in
Register
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
df84ed9e
Commit
df84ed9e
authored
Jun 11, 2014
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added purpose and usage. Use hton() from common_pkg.vhd. The tb simulates OK.
parent
c3269529
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/technology/ip_stratixiv/tse_sgmii_lvds/tb/vhdl/tb_ip_stratixiv_tse_sgmii_lvds.vhd
+21
-10
21 additions, 10 deletions
...tse_sgmii_lvds/tb/vhdl/tb_ip_stratixiv_tse_sgmii_lvds.vhd
with
21 additions
and
10 deletions
libraries/technology/ip_stratixiv/tse_sgmii_lvds/tb/vhdl/tb_ip_stratixiv_tse_sgmii_lvds.vhd
+
21
−
10
View file @
df84ed9e
...
@@ -19,6 +19,17 @@
...
@@ -19,6 +19,17 @@
--
--
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Purpose: Testbench for ip_stratixiv_tse_sgmii_lvds.
-- Description:
-- The testbench in /testbench/tse_sgmii_lvds/tse_sgmii_lvds_tb.vhd that is
-- generated by the MegaWizard provides an elaborate testbench. For
-- Uniboard purposes in tb/ a minimal testbench tb_tse_sgmii_lvds.vhd was
-- derived manually from the generated testbench. This tb_tse_sgmii_lvds
-- is more easy to use.
-- Usage:
-- > as 10
-- > run 50 us
LIBRARY
IEEE
,
common_lib
;
LIBRARY
IEEE
,
common_lib
;
USE
IEEE
.
std_logic_1164
.
ALL
;
USE
IEEE
.
std_logic_1164
.
ALL
;
USE
IEEE
.
numeric_std
.
ALL
;
USE
IEEE
.
numeric_std
.
ALL
;
...
@@ -247,15 +258,15 @@ ARCHITECTURE tb OF tb_ip_stratixiv_tse_sgmii_lvds IS
...
@@ -247,15 +258,15 @@ ARCHITECTURE tb OF tb_ip_stratixiv_tse_sgmii_lvds IS
-- DST MAC
-- DST MAC
dp_src_out
.
empty
<=
STD_LOGIC_VECTOR
(
TO_UNSIGNED
(
0
,
c_tse_empty_w
));
dp_src_out
.
empty
<=
STD_LOGIC_VECTOR
(
TO_UNSIGNED
(
0
,
c_tse_empty_w
));
dp_src_out
.
data
<=
(
OTHERS
=>
'0'
);
dp_src_out
.
data
<=
(
OTHERS
=>
'0'
);
dp_src_out
.
data
(
15
DOWNTO
0
)
<=
hton
s
(
dst_mac_addr
(
15
DOWNTO
0
));
-- send to itself
dp_src_out
.
data
(
15
DOWNTO
0
)
<=
hton
(
dst_mac_addr
(
15
DOWNTO
0
));
-- send to itself
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'1'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'1'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
dp_src_out
.
data
<=
hton
l
(
dst_mac_addr
(
47
DOWNTO
16
));
dp_src_out
.
data
<=
hton
(
dst_mac_addr
(
47
DOWNTO
16
));
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'0'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'0'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
-- SRC MAC
-- SRC MAC
dp_src_out
.
data
<=
hton
l
(
src_mac_addr
(
31
DOWNTO
0
));
dp_src_out
.
data
<=
hton
(
src_mac_addr
(
31
DOWNTO
0
));
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'0'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'0'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
-- SRC MAC & ETHERTYPE
-- SRC MAC & ETHERTYPE
dp_src_out
.
data
<=
hton
s
(
src_mac_addr
(
47
DOWNTO
32
))
&
hton
s
(
c_eth_ethertype
);
dp_src_out
.
data
<=
hton
(
src_mac_addr
(
47
DOWNTO
32
))
&
hton
(
c_eth_ethertype
);
-- DATA
-- DATA
FOR
I
IN
0
TO
c_nof_data_beats
-1
LOOP
FOR
I
IN
0
TO
c_nof_data_beats
-1
LOOP
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'0'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
proc_ready_latency
(
c_tx_ready_latency
,
dp_clk
,
dp_src_in
.
ready
,
'1'
,
'0'
,
'0'
,
dp_src_out
.
valid
,
dp_src_out
.
sop
,
dp_src_out
.
eop
);
...
@@ -333,16 +344,16 @@ ARCHITECTURE tb OF tb_ip_stratixiv_tse_sgmii_lvds IS
...
@@ -333,16 +344,16 @@ ARCHITECTURE tb OF tb_ip_stratixiv_tse_sgmii_lvds IS
-- Verify DST MAC
-- Verify DST MAC
proc_valid_sop
(
dp_clk
,
dp_snk_in
.
valid
,
dp_snk_in
.
sop
);
proc_valid_sop
(
dp_clk
,
dp_snk_in
.
valid
,
dp_snk_in
.
sop
);
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
16
)
=
X"0000"
REPORT
"RX: Alignment half word not zero"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
16
)
=
X"0000"
REPORT
"RX: Alignment half word not zero"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
15
DOWNTO
0
)
=
hton
s
(
dst_mac_addr
(
15
DOWNTO
0
))
REPORT
"RX: Wrong dst_mac_addr(15 DOWNTO 0)"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
15
DOWNTO
0
)
=
hton
(
dst_mac_addr
(
15
DOWNTO
0
))
REPORT
"RX: Wrong dst_mac_addr(15 DOWNTO 0)"
SEVERITY
ERROR
;
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
0
)
=
hton
l
(
dst_mac_addr
(
47
DOWNTO
16
))
REPORT
"RX: Wrong dst_mac_addr(47 DOWNTO 16)"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
0
)
=
hton
(
dst_mac_addr
(
47
DOWNTO
16
))
REPORT
"RX: Wrong dst_mac_addr(47 DOWNTO 16)"
SEVERITY
ERROR
;
-- Verify SRC MAC
-- Verify SRC MAC
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
0
)
=
hton
l
(
src_mac_addr
(
31
DOWNTO
0
))
REPORT
"RX: Wrong src_mac_addr(31 DOWNTO 0)"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
0
)
=
hton
(
src_mac_addr
(
31
DOWNTO
0
))
REPORT
"RX: Wrong src_mac_addr(31 DOWNTO 0)"
SEVERITY
ERROR
;
-- Verify SRC MAC & ETHERTYPE
-- Verify SRC MAC & ETHERTYPE
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
16
)
=
hton
s
(
src_mac_addr
(
47
DOWNTO
32
))
REPORT
"RX: Wrong src_mac_addr(47 DOWNTO 32)"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
31
DOWNTO
16
)
=
hton
(
src_mac_addr
(
47
DOWNTO
32
))
REPORT
"RX: Wrong src_mac_addr(47 DOWNTO 32)"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
15
DOWNTO
0
)
=
hton
s
(
c_eth_ethertype
)
REPORT
"RX: Wrong ethertype"
SEVERITY
ERROR
;
ASSERT
dp_snk_in
.
data
(
15
DOWNTO
0
)
=
hton
(
c_eth_ethertype
)
REPORT
"RX: Wrong ethertype"
SEVERITY
ERROR
;
-- Verify DATA
-- Verify DATA
v_first
:
=
TRUE
;
v_first
:
=
TRUE
;
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
proc_valid
(
dp_clk
,
dp_snk_in
.
valid
);
...
...
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