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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
11f6dd6e
Commit
11f6dd6e
authored
10 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Connect dp_clk directly. Connect tr_ref_clk_*, but only support XAUI yet.
parent
d868d1ae
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/io/tr_10GbE/tb/vhdl/tb_tr_10GbE.vhd
+38
-45
38 additions, 45 deletions
libraries/io/tr_10GbE/tb/vhdl/tb_tr_10GbE.vhd
with
38 additions
and
45 deletions
libraries/io/tr_10GbE/tb/vhdl/tb_tr_10GbE.vhd
+
38
−
45
View file @
11f6dd6e
...
...
@@ -72,7 +72,7 @@ ARCHITECTURE tb OF tb_tr_10GbE IS
CONSTANT
dp_clk_period
:
TIME
:
=
5
ns
;
-- 200 MHz
CONSTANT
cal_clk_period
:
TIME
:
=
25
ns
;
-- 40 MHz
CONSTANT
clk_156_period
:
TIME
:
=
6
.
4
ns
;
-- 156.25 MHz
CONSTANT
phy_delay
:
TIME
:
=
sel_a_b
(
g_sim_level
>
0
,
clk_156_period
*
1
,
1
ns
);
-- the sim_xaui only work
s
with
out unit PHY
delays
CONSTANT
phy_delay
:
TIME
:
=
sel_a_b
(
g_sim_level
>
0
,
0
ns
,
1
ns
);
-- the sim_xaui
and sim_10gbase_r
only work with
zero or tr_clk
delays
CONSTANT
c_nof_channels
:
NATURAL
:
=
1
;
CONSTANT
c_rl
:
NATURAL
:
=
1
;
...
...
@@ -97,18 +97,15 @@ ARCHITECTURE tb OF tb_tr_10GbE IS
-- Clocks and reset
SIGNAL
rx_end
:
STD_LOGIC
:
=
'0'
;
SIGNAL
clk_644
:
STD_LOGIC
:
=
'1'
;
-- 644.53125 MHz
SIGNAL
clk_312
:
STD_LOGIC
:
=
'1'
;
-- 312.5 MHz
SIGNAL
clk_156
:
STD_LOGIC
:
=
'1'
;
-- 156.25 MHz
SIGNAL
rst_156
:
STD_LOGIC
;
-- reset synchronous with clk_156
SIGNAL
cal_clk
:
STD_LOGIC
:
=
'1'
;
-- calibration clock
SIGNAL
mm_clk
:
STD_LOGIC
:
=
'1'
;
-- memory-mapped bus clock
SIGNAL
mm_rst
:
STD_LOGIC
;
-- reset synchronous with mm_clk
SIGNAL
dp_clk
:
STD_LOGIC
:
=
'1'
;
-- data path clock
SIGNAL
dp_rst
:
STD_LOGIC
;
-- reset synchronous with dp_clk
SIGNAL
clk_644
:
STD_LOGIC
:
=
'1'
;
-- 644.53125 MHz
SIGNAL
clk_156
:
STD_LOGIC
:
=
'1'
;
-- 156.25 MHz
SIGNAL
rst_156
:
STD_LOGIC
;
-- reset synchronous with clk_156
SIGNAL
tx_clk
:
STD_LOGIC
;
SIGNAL
tx_rst
:
STD_LOGIC
;
-- reset synchronous with tx_clk
SIGNAL
rx_clk
:
STD_LOGIC
;
SIGNAL
rx_rst
:
STD_LOGIC
;
-- reset synchronous with rx_clk
-- MAC 10G control interface
SIGNAL
mm_init
:
STD_LOGIC
:
=
'1'
;
...
...
@@ -135,12 +132,12 @@ ARCHITECTURE tb OF tb_tr_10GbE IS
SIGNAL
rx_sosi_data
:
STD_LOGIC_VECTOR
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
-- 64 bit
-- PHY XAUI serial I/O
SIGNAL
xaui_tx_
out_arr
:
t_xaui_arr
(
c_nof_channels
-1
DOWNTO
0
);
SIGNAL
xaui_rx_
in_
arr
:
t_xaui_arr
(
c_nof_channels
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
(
OTHERS
=>
'0'
));
SIGNAL
xaui_tx_
arr
:
t_xaui_arr
(
c_nof_channels
-1
DOWNTO
0
);
SIGNAL
xaui_rx_arr
:
t_xaui_arr
(
c_nof_channels
-1
DOWNTO
0
)
:
=
(
OTHERS
=>
(
OTHERS
=>
'0'
));
-- PHY 10GBASE-R serial IO
SIGNAL
serial_tx_
out_arr
:
STD_LOGIC_VECTOR
(
c_nof_channels
-1
downto
0
);
SIGNAL
serial_rx_
in_
arr
:
STD_LOGIC_VECTOR
(
c_nof_channels
-1
downto
0
)
:
=
(
OTHERS
=>
'0'
);
SIGNAL
serial_tx_
arr
:
STD_LOGIC_VECTOR
(
c_nof_channels
-1
downto
0
);
SIGNAL
serial_rx_arr
:
STD_LOGIC_VECTOR
(
c_nof_channels
-1
downto
0
)
:
=
(
OTHERS
=>
'0'
);
-- Verification
SIGNAL
expected_sosi_arr
:
t_dp_sosi_arr
(
0
TO
c_nof_pkt
-1
);
...
...
@@ -160,8 +157,6 @@ BEGIN
mm_rst
<=
'1'
,
'0'
AFTER
mm_clk_period
*
10
;
dp_rst
<=
'1'
,
'0'
AFTER
dp_clk_period
*
10
;
rst_156
<=
'1'
,
'0'
AFTER
clk_156_period
*
4
;
tx_rst
<=
'1'
,
'0'
AFTER
clk_156_period
*
10
;
rx_rst
<=
'1'
,
'0'
AFTER
clk_156_period
*
10
;
-- debug signals to ease monitoring in wave window
tx_sosi_data
<=
tx_sosi
.
data
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
...
...
@@ -198,9 +193,9 @@ BEGIN
tx_sosi
<=
c_dp_sosi_rst
;
WHILE
mm_init
/=
'0'
LOOP
WAIT
UNTIL
rising_edge
(
tx
_clk
);
WAIT
UNTIL
rising_edge
(
dp
_clk
);
END
LOOP
;
proc_common_wait_some_cycles
(
tx
_clk
,
10
);
proc_common_wait_some_cycles
(
dp
_clk
,
10
);
-- Loopback txp->rxp so use promiscuous mode or use DST_MAC = c_src_mac to send to itself
...
...
@@ -210,12 +205,12 @@ BEGIN
-- . For I>46 the payload length is I and empty = 4 - (I mod 4)
FOR
I
IN
0
TO
c_nof_pkt
-1
LOOP
proc_tech_mac_10g_tx_packet
(
total_header
,
c_pkt_length_arr
(
I
),
g_data_type
,
c_rl
,
c_nof_tx_not_valid
,
tx
_clk
,
tx_en
,
tx_siso
,
tx_sosi
);
proc_common_wait_some_cycles
(
tx
_clk
,
0
);
proc_tech_mac_10g_tx_packet
(
total_header
,
c_pkt_length_arr
(
I
),
g_data_type
,
c_rl
,
c_nof_tx_not_valid
,
dp
_clk
,
tx_en
,
tx_siso
,
tx_sosi
);
proc_common_wait_some_cycles
(
dp
_clk
,
0
);
END
LOOP
;
proc_common_wait_some_cycles
(
tx
_clk
,
c_pkt_length_arr
(
c_nof_pkt
-1
)
/
c_tech_mac_10g_symbols_per_beat
);
proc_common_wait_some_cycles
(
tx
_clk
,
100
);
proc_common_wait_some_cycles
(
dp
_clk
,
c_pkt_length_arr
(
c_nof_pkt
-1
)
/
c_tech_mac_10g_symbols_per_beat
);
proc_common_wait_some_cycles
(
dp
_clk
,
100
);
rx_end
<=
'1'
;
WAIT
;
END
PROCESS
;
...
...
@@ -227,12 +222,12 @@ BEGIN
rx_siso
<=
c_dp_siso_hold
;
WHILE
mm_init
/=
'0'
LOOP
WAIT
UNTIL
rising_edge
(
rx
_clk
);
WAIT
UNTIL
rising_edge
(
dp
_clk
);
END
LOOP
;
-- Receive forever
WHILE
TRUE
LOOP
proc_tech_mac_10g_rx_packet
(
total_header
,
g_data_type
,
rx
_clk
,
rx_sosi
,
rx_siso
);
proc_tech_mac_10g_rx_packet
(
total_header
,
g_data_type
,
dp
_clk
,
rx_sosi
,
rx_siso
);
rx_toggle
<=
NOT
rx_toggle
;
END
LOOP
;
...
...
@@ -240,10 +235,10 @@ BEGIN
END
PROCESS
;
p_ff_store_tx_sosi_at_eop
:
PROCESS
(
tx
_clk
)
p_ff_store_tx_sosi_at_eop
:
PROCESS
(
dp
_clk
)
VARIABLE
vI
:
NATURAL
:
=
0
;
BEGIN
IF
rising_edge
(
tx
_clk
)
THEN
IF
rising_edge
(
dp
_clk
)
THEN
IF
tx_sosi
.
eop
=
'1'
THEN
expected_sosi_arr
(
vI
)
<=
tx_sosi
;
vI
:
=
vI
+
1
;
...
...
@@ -251,11 +246,11 @@ BEGIN
END
IF
;
END
PROCESS
;
p_ff_verify_rx_sosi_at_eop
:
PROCESS
(
rx
_clk
)
p_ff_verify_rx_sosi_at_eop
:
PROCESS
(
dp
_clk
)
VARIABLE
vI
:
NATURAL
:
=
0
;
VARIABLE
vLow
:
NATURAL
:
=
0
;
BEGIN
IF
rising_edge
(
rx
_clk
)
THEN
IF
rising_edge
(
dp
_clk
)
THEN
rx_sosi_reg
<=
rx_sosi
;
-- use rx_sosi_reg for verification at eop to account for once cycle latency in expected_sosi_arr()
IF
rx_sosi_reg
.
eop
=
'1'
THEN
IF
g_no_dut
=
FALSE
THEN
...
...
@@ -279,17 +274,11 @@ BEGIN
END
PROCESS
;
no_dut
:
IF
g_no_dut
=
TRUE
GENERATE
tx_clk
<=
clk_156
;
rx_clk
<=
clk_156
;
rx_sosi
<=
tx_sosi
;
tx_siso
<=
rx_siso
;
END
GENERATE
;
gen_dut
:
IF
g_no_dut
=
FALSE
GENERATE
tx_clk
<=
dp_clk
;
rx_clk
<=
dp_clk
;
tx_siso
<=
tx_siso_arr
(
0
);
tx_sosi_arr
(
0
)
<=
tx_sosi
;
...
...
@@ -308,9 +297,13 @@ BEGIN
g_word_alignment_padding
=>
TRUE
)
PORT
MAP
(
tr_clk_156
=>
clk_156
,
tr_rst_156
=>
rst_156
,
-- Transceiver PLL reference clock
tr_ref_clk_644
=>
clk_644
,
-- 644.531250 MHz for 10GBASE-R
tr_ref_clk_312
=>
clk_312
,
-- 312.5 MHz for 10GBASE-R
tr_ref_clk_156
=>
clk_156
,
-- 156.25 MHz for 10GBASE-R or for XAUI
tr_ref_rst_156
=>
rst_156
,
-- for 10GBASE-R or for XAUI
-- Calibration & reconfig clock
cal_rec_clk
=>
cal_clk
,
-- MM interface
...
...
@@ -327,8 +320,8 @@ BEGIN
mdio_miso_arr
=>
OPEN
,
-- DP interface
dp_rst
=>
tx
_rst
,
dp_clk
=>
tx
_clk
,
dp_rst
=>
dp
_rst
,
dp_clk
=>
dp
_clk
,
snk_out_arr
=>
tx_siso_arr
,
snk_in_arr
=>
tx_sosi_arr
,
...
...
@@ -337,12 +330,12 @@ BEGIN
src_out_arr
=>
rx_sosi_arr
,
-- Serial XAUI interface
xaui_tx_
out_arr
=>
xaui_tx_
out_
arr
,
xaui_rx_
in_
arr
=>
xaui_rx_
in_
arr
,
xaui_tx_
arr
=>
xaui_tx_arr
,
xaui_rx_arr
=>
xaui_rx_arr
,
-- Serial IO
serial_tx_
out_arr
=>
serial_tx_
out_
arr
,
serial_rx_
in_
arr
=>
serial_rx_
in_
arr
,
serial_tx_
arr
=>
serial_tx_arr
,
serial_rx_arr
=>
serial_rx_arr
,
-- MDIO interface
mdio_rst
=>
OPEN
,
...
...
@@ -353,12 +346,12 @@ BEGIN
END
GENERATE
;
-- Loopback PHY
xaui_rx_
in_
arr
<=
TRANSPORT
xaui_tx_
out_
arr
AFTER
phy_delay
;
-- XAUI
serial_rx_
in_
arr
<=
TRANSPORT
serial_tx_
out_
arr
AFTER
phy_delay
;
-- 10GBASE-R
xaui_rx_arr
<=
TRANSPORT
xaui_tx_arr
AFTER
phy_delay
;
-- XAUI
serial_rx_arr
<=
TRANSPORT
serial_tx_arr
AFTER
phy_delay
;
-- 10GBASE-R
-- Verification
tx_pkt_cnt
<=
tx_pkt_cnt
+
1
WHEN
tx_sosi
.
sop
=
'1'
AND
rising_edge
(
tx
_clk
);
rx_pkt_cnt
<=
rx_pkt_cnt
+
1
WHEN
rx_sosi
.
eop
=
'1'
AND
rising_edge
(
rx
_clk
);
tx_pkt_cnt
<=
tx_pkt_cnt
+
1
WHEN
tx_sosi
.
sop
=
'1'
AND
rising_edge
(
dp
_clk
);
rx_pkt_cnt
<=
rx_pkt_cnt
+
1
WHEN
rx_sosi
.
eop
=
'1'
AND
rising_edge
(
dp
_clk
);
p_tb_end
:
PROCESS
BEGIN
...
...
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