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
a83dd0c5
Commit
a83dd0c5
authored
10 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Use g_no_dut instead of c_loopback_st.
parent
a4c7d69f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/technology/eth_10g/tb_tb_tech_eth_10g.vhd
+8
-6
8 additions, 6 deletions
libraries/technology/eth_10g/tb_tb_tech_eth_10g.vhd
libraries/technology/eth_10g/tb_tech_eth_10g.vhd
+81
-79
81 additions, 79 deletions
libraries/technology/eth_10g/tb_tech_eth_10g.vhd
with
89 additions
and
85 deletions
libraries/technology/eth_10g/tb_tb_tech_eth_10g.vhd
+
8
−
6
View file @
a83dd0c5
...
@@ -43,23 +43,25 @@ ARCHITECTURE tb OF tb_tb_tech_eth_10g IS
...
@@ -43,23 +43,25 @@ ARCHITECTURE tb OF tb_tb_tech_eth_10g IS
CONSTANT
c_156
:
TIME
:
=
6
.
4
ns
;
CONSTANT
c_156
:
TIME
:
=
6
.
4
ns
;
CONSTANT
c_data_type
:
NATURAL
:
=
c_tb_tech_mac_10g_data_type_symbols
;
CONSTANT
c_data_type
:
NATURAL
:
=
c_tb_tech_mac_10g_data_type_symbols
;
CONSTANT
c_tb_end_vec
:
STD_LOGIC_VECTOR
(
1
DOWNTO
0
)
:
=
(
OTHERS
=>
'1'
);
CONSTANT
c_tb_end_vec
:
STD_LOGIC_VECTOR
(
7
DOWNTO
0
)
:
=
(
OTHERS
=>
'1'
);
SIGNAL
tb_end_vec
:
STD_LOGIC_VECTOR
(
1
DOWNTO
0
)
:
=
c_tb_end_vec
;
-- sufficiently long to fit all tb instances
SIGNAL
tb_end_vec
:
STD_LOGIC_VECTOR
(
7
DOWNTO
0
)
:
=
c_tb_end_vec
;
-- sufficiently long to fit all tb instances
BEGIN
BEGIN
-- g_technology : NATURAL := c_tech_select_default;
-- g_technology : NATURAL := c_tech_select_default;
-- g_tb_end : BOOLEAN := TRUE; -- when TRUE then tb_end ends this simulation, else a higher multi-testbench will end the simulation
-- g_tb_end : BOOLEAN := TRUE; -- when TRUE then tb_end ends this simulation, else a higher multi-testbench will end the simulation
-- g_sim_level : NATURAL := 0; -- 0 = use IP; 1 = use fast serdes model
-- g_no_dut : BOOLEAN := FALSE; -- default FALSE to verify the DUT, else use TRUE to verify the tb itself without the DUT
-- g_sim_level : NATURAL := 0; -- 0 = use IP; 1 = use fast serdes model
-- g_ref_clk_644_period : TIME := tech_pll_clk_644_period; -- for 10GBASE-R
-- g_ref_clk_644_period : TIME := tech_pll_clk_644_period; -- for 10GBASE-R
-- g_ref_clk_156_period : TIME := 6.4 ns; -- for XAUI
-- g_ref_clk_156_period : TIME := 6.4 ns; -- for XAUI
-- g_data_type : NATURAL := c_tb_tech_mac_10g_data_type_symbols;
-- g_data_type : NATURAL := c_tb_tech_mac_10g_data_type_symbols;
-- g_verify_link_recovery : BOOLEAN := TRUE;
-- g_verify_link_recovery : BOOLEAN := TRUE;
-- g_link_status_check : STD_LOGIC_VECTOR(c_tech_mac_10g_link_status_w-1 DOWNTO 0) := "11";
-- g_link_status_check : STD_LOGIC_VECTOR(c_tech_mac_10g_link_status_w-1 DOWNTO 0) := "11";
-- g_use_serial_rx_in : BOOLEAN := FALSE
-- g_use_serial_rx_in : BOOLEAN := FALSE
-- default FALSE when this tb is ran standalone, else use TRUE to simulate a link between two instances of this tb
u_tech_eth_10g
:
ENTITY
work
.
tb_tech_eth_10g
GENERIC
MAP
(
c_tech_select_default
,
FALSE
,
0
,
c_644
,
c_156
,
c_data_type
,
TRUE
,
"11"
,
FALSE
)
PORT
MAP
(
tb_end_vec
(
0
));
u_no_dut
:
ENTITY
work
.
tb_tech_eth_10g
GENERIC
MAP
(
c_tech_select_default
,
FALSE
,
TRUE
,
0
,
c_644
,
c_156
,
c_data_type
,
TRUE
,
"11"
,
FALSE
)
PORT
MAP
(
tb_end_vec
(
0
));
u_sim_eth_10g
:
ENTITY
work
.
tb_tech_eth_10g
GENERIC
MAP
(
c_tech_select_default
,
FALSE
,
1
,
c_644
,
c_156
,
c_data_type
,
TRUE
,
"11"
,
FALSE
)
PORT
MAP
(
tb_end_vec
(
1
));
u_tech_eth_10g
:
ENTITY
work
.
tb_tech_eth_10g
GENERIC
MAP
(
c_tech_select_default
,
FALSE
,
FALSE
,
0
,
c_644
,
c_156
,
c_data_type
,
TRUE
,
"11"
,
FALSE
)
PORT
MAP
(
tb_end_vec
(
1
));
u_sim_eth_10g
:
ENTITY
work
.
tb_tech_eth_10g
GENERIC
MAP
(
c_tech_select_default
,
FALSE
,
FALSE
,
1
,
c_644
,
c_156
,
c_data_type
,
TRUE
,
"11"
,
FALSE
)
PORT
MAP
(
tb_end_vec
(
2
));
p_tb_end
:
PROCESS
p_tb_end
:
PROCESS
BEGIN
BEGIN
...
...
This diff is collapsed.
Click to expand it.
libraries/technology/eth_10g/tb_tech_eth_10g.vhd
+
81
−
79
View file @
a83dd0c5
...
@@ -48,13 +48,14 @@ ENTITY tb_tech_eth_10g IS
...
@@ -48,13 +48,14 @@ ENTITY tb_tech_eth_10g IS
GENERIC
(
GENERIC
(
g_technology
:
NATURAL
:
=
c_tech_select_default
;
g_technology
:
NATURAL
:
=
c_tech_select_default
;
g_tb_end
:
BOOLEAN
:
=
TRUE
;
-- when TRUE then tb_end ends this simulation, else a higher multi-testbench will end the simulation
g_tb_end
:
BOOLEAN
:
=
TRUE
;
-- when TRUE then tb_end ends this simulation, else a higher multi-testbench will end the simulation
g_sim_level
:
NATURAL
:
=
1
;
-- 0 = use IP; 1 = use fast serdes model
g_no_dut
:
BOOLEAN
:
=
FALSE
;
-- default FALSE to verify the DUT, else use TRUE to verify the tb itself without the DUT
g_sim_level
:
NATURAL
:
=
1
;
-- 0 = use IP; 1 = use fast serdes model
g_ref_clk_644_period
:
TIME
:
=
tech_pll_clk_644_period
;
-- for 10GBASE-R
g_ref_clk_644_period
:
TIME
:
=
tech_pll_clk_644_period
;
-- for 10GBASE-R
g_ref_clk_156_period
:
TIME
:
=
6
.
4
ns
;
-- for XAUI
g_ref_clk_156_period
:
TIME
:
=
6
.
4
ns
;
-- for XAUI
g_data_type
:
NATURAL
:
=
c_tb_tech_mac_10g_data_type_symbols
;
g_data_type
:
NATURAL
:
=
c_tb_tech_mac_10g_data_type_symbols
;
g_verify_link_recovery
:
BOOLEAN
:
=
TRUE
;
g_verify_link_recovery
:
BOOLEAN
:
=
TRUE
;
g_link_status_check
:
STD_LOGIC_VECTOR
(
c_tech_mac_10g_link_status_w
-1
DOWNTO
0
)
:
=
"11"
;
g_link_status_check
:
STD_LOGIC_VECTOR
(
c_tech_mac_10g_link_status_w
-1
DOWNTO
0
)
:
=
"11"
;
g_use_serial_rx_in
:
BOOLEAN
:
=
FALSE
g_use_serial_rx_in
:
BOOLEAN
:
=
FALSE
-- default FALSE when this tb is ran standalone, else use TRUE to simulate a link between two instances of this tb
);
);
PORT
(
PORT
(
tb_end
:
OUT
STD_LOGIC
;
tb_end
:
OUT
STD_LOGIC
;
...
@@ -70,12 +71,14 @@ END tb_tech_eth_10g;
...
@@ -70,12 +71,14 @@ END tb_tech_eth_10g;
ARCHITECTURE
tb
OF
tb_tech_eth_10g
IS
ARCHITECTURE
tb
OF
tb_tech_eth_10g
IS
CONSTANT
phy_delay
:
TIME
:
=
0
ns
;
CONSTANT
c_sim
:
BOOLEAN
:
=
TRUE
;
-- tr_xaui_align_dly has time delay ~ 1 sec, so not suitable for simulation
CONSTANT
c_nof_channels
:
NATURAL
:
=
1
;
-- fixed in this tb
CONSTANT
cal_clk_period
:
TIME
:
=
25
ns
;
-- 40 MHz
CONSTANT
phy_delay
:
TIME
:
=
0
ns
;
CONSTANT
c_phy_loopback
:
BOOLEAN
:
=
NOT
g_use_serial_rx_in
;
CONSTANT
c_phy_loopback
:
BOOLEAN
:
=
NOT
g_use_serial_rx_in
;
CONSTANT
c_st_loopback
:
BOOLEAN
:
=
FALSE
;
-- default FALSE to verify the DUT, else use TRUE to verify the tb itself without the DUT
CONSTANT
c_rl
:
NATURAL
:
=
1
;
CONSTANT
c_nof_tx_not_valid
:
NATURAL
:
=
0
;
-- when > 0 then pull tx valid low for c_nof_tx_not_valid beats during tx
CONSTANT
c_pkt_length_arr1
:
t_nat_natural_arr
:
=
array_init
(
0
,
50
,
1
)
&
(
1472
,
1473
)
&
9000
;
-- frame longer than 1518-46 = 1472 is received with rx_sosi.err = 8
CONSTANT
c_pkt_length_arr1
:
t_nat_natural_arr
:
=
array_init
(
0
,
50
,
1
)
&
(
1472
,
1473
)
&
9000
;
-- frame longer than 1518-46 = 1472 is received with rx_sosi.err = 8
-- jumbo frame is 9018-46 = 8972
-- jumbo frame is 9018-46 = 8972
CONSTANT
c_pkt_length_arr2
:
t_nat_natural_arr
:
=
array_init
(
46
,
10
,
139
)
&
1472
;
CONSTANT
c_pkt_length_arr2
:
t_nat_natural_arr
:
=
array_init
(
46
,
10
,
139
)
&
1472
;
...
@@ -99,6 +102,7 @@ ARCHITECTURE tb OF tb_tech_eth_10g IS
...
@@ -99,6 +102,7 @@ ARCHITECTURE tb OF tb_tech_eth_10g IS
-- Clocks and reset
-- Clocks and reset
SIGNAL
rx_end
:
STD_LOGIC
:
=
'0'
;
SIGNAL
rx_end
:
STD_LOGIC
:
=
'0'
;
SIGNAL
cal_clk
:
STD_LOGIC
:
=
'1'
;
-- calibration clock
SIGNAL
mm_clk
:
STD_LOGIC
:
=
'0'
;
-- memory-mapped bus clock
SIGNAL
mm_clk
:
STD_LOGIC
:
=
'0'
;
-- memory-mapped bus clock
SIGNAL
mm_rst
:
STD_LOGIC
;
-- reset synchronous with mm_clk
SIGNAL
mm_rst
:
STD_LOGIC
;
-- reset synchronous with mm_clk
...
@@ -125,26 +129,22 @@ ARCHITECTURE tb OF tb_tech_eth_10g IS
...
@@ -125,26 +129,22 @@ ARCHITECTURE tb OF tb_tech_eth_10g IS
-- 10G MAC control interface
-- 10G MAC control interface
SIGNAL
mm_init
:
STD_LOGIC
:
=
'1'
;
SIGNAL
mm_init
:
STD_LOGIC
:
=
'1'
;
SIGNAL
m
m
_mosi
:
t_mem_mosi
;
SIGNAL
m
ac
_mosi
:
t_mem_mosi
;
SIGNAL
m
m
_mosi_wrdata
:
STD_LOGIC_VECTOR
(
c_word_w
-1
DOWNTO
0
);
-- 32 bit;
SIGNAL
m
ac
_mosi_wrdata
:
STD_LOGIC_VECTOR
(
c_word_w
-1
DOWNTO
0
);
-- 32 bit;
SIGNAL
m
m
_miso
:
t_mem_miso
;
SIGNAL
m
ac
_miso
:
t_mem_miso
;
SIGNAL
m
m
_miso_rdval
:
STD_LOGIC
;
SIGNAL
m
ac
_miso_rdval
:
STD_LOGIC
;
SIGNAL
m
m
_miso_rddata
:
STD_LOGIC_VECTOR
(
c_word_w
-1
DOWNTO
0
);
-- 32 bit;
SIGNAL
m
ac
_miso_rddata
:
STD_LOGIC_VECTOR
(
c_word_w
-1
DOWNTO
0
);
-- 32 bit;
-- 10G MAC transmit interface
-- 10G MAC transmit interface
-- . The tb is the ST source
-- . The tb is the ST source
SIGNAL
tx_siso
:
t_dp_siso
;
SIGNAL
tx_siso
:
t_dp_siso
;
SIGNAL
tx_siso_arr
:
t_dp_siso_arr
(
0
DOWNTO
0
);
SIGNAL
tx_sosi
:
t_dp_sosi
;
SIGNAL
tx_sosi
:
t_dp_sosi
;
SIGNAL
tx_sosi_arr
:
t_dp_sosi_arr
(
0
DOWNTO
0
);
SIGNAL
tx_sosi_data
:
STD_LOGIC_VECTOR
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
-- 64 bit
SIGNAL
tx_sosi_data
:
STD_LOGIC_VECTOR
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
-- 64 bit
-- 10G MAC receive interface
-- 10G MAC receive interface
-- . The tb is the ST sink
-- . The tb is the ST sink
SIGNAL
rx_siso
:
t_dp_siso
;
SIGNAL
rx_siso
:
t_dp_siso
;
SIGNAL
rx_siso_arr
:
t_dp_siso_arr
(
0
DOWNTO
0
);
SIGNAL
rx_sosi
:
t_dp_sosi
;
SIGNAL
rx_sosi
:
t_dp_sosi
;
SIGNAL
rx_sosi_arr
:
t_dp_sosi_arr
(
0
DOWNTO
0
);
SIGNAL
rx_sosi_data
:
STD_LOGIC_VECTOR
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
-- 64 bit
SIGNAL
rx_sosi_data
:
STD_LOGIC_VECTOR
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
-- 64 bit
-- PHY serial IO
-- PHY serial IO
...
@@ -166,10 +166,12 @@ ARCHITECTURE tb OF tb_tech_eth_10g IS
...
@@ -166,10 +166,12 @@ ARCHITECTURE tb OF tb_tech_eth_10g IS
BEGIN
BEGIN
cal_clk
<=
NOT
cal_clk
AFTER
cal_clk_period
/
2
;
-- Calibration clock
-- debug signals to ease monitoring in wave window
-- debug signals to ease monitoring in wave window
m
m
_mosi_wrdata
<=
m
m
_mosi
.
wrdata
(
c_word_w
-1
DOWNTO
0
);
m
ac
_mosi_wrdata
<=
m
ac
_mosi
.
wrdata
(
c_word_w
-1
DOWNTO
0
);
m
m
_miso_rddata
<=
m
m
_miso
.
rddata
(
c_word_w
-1
DOWNTO
0
);
m
ac
_miso_rddata
<=
m
ac
_miso
.
rddata
(
c_word_w
-1
DOWNTO
0
);
m
m
_miso_rdval
<=
'1'
WHEN
m
m
_mosi
.
rd
=
'1'
AND
m
m
_miso
.
waitrequest
=
'0'
ELSE
'0'
;
-- c_rd_latency = 1
m
ac
_miso_rdval
<=
'1'
WHEN
m
ac
_mosi
.
rd
=
'1'
AND
m
ac
_miso
.
waitrequest
=
'0'
ELSE
'0'
;
-- c_rd_latency = 1
tx_sosi_data
<=
tx_sosi
.
data
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
tx_sosi_data
<=
tx_sosi
.
data
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
rx_sosi_data
<=
rx_sosi
.
data
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
rx_sosi_data
<=
rx_sosi
.
data
(
c_tech_mac_10g_data_w
-1
DOWNTO
0
);
...
@@ -187,8 +189,8 @@ BEGIN
...
@@ -187,8 +189,8 @@ BEGIN
mm_clk
=>
mm_clk
,
mm_clk
=>
mm_clk
,
mm_rst
=>
mm_rst
,
mm_rst
=>
mm_rst
,
mm_init
=>
mm_init
,
mm_init
=>
mm_init
,
m
m
_mosi
=>
m
m
_mosi
,
m
ac
_mosi
=>
m
ac
_mosi
,
m
m
_miso
=>
m
m
_miso
m
ac
_miso
=>
m
ac
_miso
);
);
-- Packet transmitter
-- Packet transmitter
...
@@ -202,26 +204,19 @@ BEGIN
...
@@ -202,26 +204,19 @@ BEGIN
PORT
MAP
(
PORT
MAP
(
mm_init
=>
mm_init
,
mm_init
=>
mm_init
,
total_header
=>
total_header
,
total_header
=>
total_header
,
clk_156
=>
tb_tx_clk
,
tx_clk
=>
tb_tx_clk
,
tx_siso
=>
tx_siso
,
tx_siso
=>
tx_siso
,
tx_sosi
=>
tx_sosi
,
tx_sosi
=>
tx_sosi
,
link_fault
=>
link_fault
,
link_fault
=>
link_fault
,
tx_end
=>
rx_end
tx_end
=>
rx_end
);
);
-- Rewire DP to DP array type.
tx_sosi_arr
(
0
)
<=
tx_sosi
;
tx_siso
<=
tx_siso_arr
(
0
);
rx_siso_arr
(
0
)
<=
rx_siso
;
rx_sosi
<=
rx_sosi_arr
(
0
);
-- Generate reference clocks
-- Generate reference clocks
gen_ref_clocks_xaui
:
IF
g_technology
=
c_tech_stratixiv
GENERATE
gen_ref_clocks_xaui
:
IF
g_technology
=
c_tech_stratixiv
GENERATE
tr_ref_clk_644
<=
'X'
;
tr_ref_clk_644
<=
'X'
;
tr_ref_clk_312
<=
'X'
;
tr_ref_clk_312
<=
'X'
;
tr_ref_clk_156
<=
NOT
tr_ref_clk_156
AFTER
g_ref_clk_156_period
/
2
;
tr_ref_clk_156
<=
NOT
tr_ref_clk_156
AFTER
g_ref_clk_156_period
/
2
;
tr_ref_rst_156
<=
'0'
AFTER
g_ref_clk_156_period
*
5
;
tr_ref_rst_156
<=
'1'
,
'0'
AFTER
g_ref_clk_156_period
*
5
;
END
GENERATE
;
END
GENERATE
;
gen_ref_clocks_10gbase_r
:
IF
g_technology
=
c_tech_arria10
GENERATE
gen_ref_clocks_10gbase_r
:
IF
g_technology
=
c_tech_arria10
GENERATE
...
@@ -244,7 +239,7 @@ BEGIN
...
@@ -244,7 +239,7 @@ BEGIN
u_tech_eth_10g_clocks
:
ENTITY
work
.
tech_eth_10g_clocks
u_tech_eth_10g_clocks
:
ENTITY
work
.
tech_eth_10g_clocks
GENERIC
MAP
(
GENERIC
MAP
(
g_technology
=>
g_technology
,
g_technology
=>
g_technology
,
g_nof_channels
=>
1
g_nof_channels
=>
c_nof_channels
)
)
PORT
MAP
(
PORT
MAP
(
-- Input clocks
-- Input clocks
...
@@ -274,79 +269,86 @@ BEGIN
...
@@ -274,79 +269,86 @@ BEGIN
eth_rx_rst_arr
(
0
)
=>
tb_rx_rst
eth_rx_rst_arr
(
0
)
=>
tb_rx_rst
);
);
no_dut
:
IF
c_st_loopback
=
TRUE
GENERATE
no_dut
:
IF
g_no_dut
=
TRUE
GENERATE
tx_rst_arr_out
<=
(
OTHERS
=>
tr_ref_rst_156
);
rx_clk_arr_out
<=
(
OTHERS
=>
tr_ref_clk_156
);
rx_rst_arr_out
<=
(
OTHERS
=>
tr_ref_rst_156
);
rx_sosi
<=
tx_sosi
;
rx_sosi
<=
tx_sosi
;
tx_siso
<=
rx_siso
;
tx_siso
<=
rx_siso
;
END
GENERATE
;
END
GENERATE
;
gen_dut
:
IF
c_st_loopback
=
FALSE
GENERATE
gen_dut
:
IF
g_no_dut
=
FALSE
GENERATE
dut
:
ENTITY
work
.
tech_eth_10g
dut
:
ENTITY
work
.
tech_eth_10g
GENERIC
MAP
(
GENERIC
MAP
(
g_technology
=>
g_technology
,
g_technology
=>
g_technology
,
g_sim
=>
TRUE
,
g_sim
=>
c_sim
,
g_sim_level
=>
g_sim_level
,
g_sim_level
=>
g_sim_level
,
g_nof_channels
=>
1
,
g_nof_channels
=>
c_nof_channels
,
g_link_status_check
=>
g_link_status_check
,
g_link_status_check
=>
g_link_status_check
,
g_pre_header_padding
=>
TRUE
g_pre_header_padding
=>
TRUE
)
)
PORT
MAP
(
PORT
MAP
(
-- Transceiver PLL reference clock
-- Transceiver PLL reference clock
tr_ref_clk_644
=>
tb_ref_clk_644
,
tr_ref_clk_644
=>
tb_ref_clk_644
,
tr_ref_clk_312
=>
tb_ref_clk_312
,
tr_ref_clk_312
=>
tb_ref_clk_312
,
tr_ref_clk_156
=>
tb_ref_clk_156
,
tr_ref_clk_156
=>
tb_ref_clk_156
,
tr_ref_rst_156
=>
tb_ref_rst_156
,
tr_ref_rst_156
=>
tb_ref_rst_156
,
-- Calibration & reconfig clock
cal_rec_clk
=>
cal_clk
,
-- for XAUI
-- MM
-- MM
mm_clk
=>
mm_clk
,
mm_clk
=>
mm_clk
,
mm_rst
=>
mm_rst
,
mm_rst
=>
mm_rst
,
mac_mosi
=>
m
m
_mosi
,
-- CSR = control status register
mac_mosi
=>
m
ac
_mosi
,
-- CSR = control status register
mac_miso
=>
m
m
_miso
,
mac_miso
=>
m
ac
_miso
,
-- XAUI clocks
-- XAUI clocks
tx_clk_arr_in
(
0
)
=>
tb_tx_clk
,
-- 156.25 MHz, externally connect tr_ref_clk_156 to tx_clk_arr or connect rx_clk_arr to tx_clk_arr
tx_clk_arr_in
(
0
)
=>
tb_tx_clk
,
-- 156.25 MHz, externally connect tr_ref_clk_156 to tx_clk_arr or connect rx_clk_arr to tx_clk_arr
tx_rst_arr_out
=>
tx_rst_arr_out
,
tx_rst_arr_out
=>
tx_rst_arr_out
,
rx_clk_arr_out
=>
rx_clk_arr_out
,
rx_clk_arr_out
=>
rx_clk_arr_out
,
rx_clk_arr_in
(
0
)
=>
tb_rx_clk
,
-- externally connect to rx_clk_arr_out to avoid clock delta-delay
rx_clk_arr_in
(
0
)
=>
tb_rx_clk
,
-- externally connect to rx_clk_arr_out to avoid clock delta-delay
rx_rst_arr_out
=>
rx_rst_arr_out
,
rx_rst_arr_out
=>
rx_rst_arr_out
,
-- ST
-- ST
tx_snk_in_arr
=>
tx_sosi
_arr
,
-- 64 bit data @ 156 tb_tx_clk
tx_snk_in_arr
(
0
)
=>
tx_sosi
,
-- 64 bit data @ 156 tb_tx_clk
tx_snk_out_arr
=>
tx_siso
_arr
,
tx_snk_out_arr
(
0
)
=>
tx_siso
,
rx_src_out_arr
=>
rx_sosi
_arr
,
-- 64 bit data @ 156 tb_rx_clk
rx_src_out_arr
(
0
)
=>
rx_sosi
,
-- 64 bit data @ 156 tb_rx_clk
rx_src_in_arr
=>
rx_siso
_arr
,
rx_src_in_arr
(
0
)
=>
rx_siso
,
-- PHY serial IO
-- PHY serial IO
-- . 10GBASE-R (single lane)
-- . 10GBASE-R (single lane)
serial_tx_arr
=>
serial_tx_arr
,
serial_tx_arr
=>
serial_tx_arr
,
serial_rx_arr
=>
serial_rx_arr
,
serial_rx_arr
=>
serial_rx_arr
,
-- . XAUI (four lanes)
-- . XAUI (four lanes)
xaui_tx_arr
=>
xaui_tx_arr
,
xaui_tx_arr
=>
xaui_tx_arr
,
xaui_rx_arr
=>
xaui_rx_arr
xaui_rx_arr
=>
xaui_rx_arr
);
);
END
GENERATE
;
END
GENERATE
;
u_link_connect
:
ENTITY
tech_mac_10g_lib
.
tb_tech_mac_10g_link_connect
u_link_connect
:
ENTITY
tech_mac_10g_lib
.
tb_tech_mac_10g_link_connect
GENERIC
MAP
(
GENERIC
MAP
(
g_loopback
=>
c_phy_loopback
,
-- default TRUE for loopback tx to rx, else use FALSE to connect tx-tx, rx-rx between two tb devices
g_loopback
=>
c_phy_loopback
,
-- default TRUE for loopback tx to rx, else use FALSE to connect tx-tx, rx-rx between two tb devices
g_link_delay
=>
phy_delay
g_link_delay
=>
phy_delay
)
)
PORT
MAP
(
PORT
MAP
(
link_fault
=>
link_fault
,
-- when '1' then forces rx_serial_arr(0)='0'
link_fault
=>
link_fault
,
-- when '1' then forces rx_serial_arr(0)='0'
-- 10GBASE-R serial layer connect
-- 10GBASE-R serial layer connect
serial_tx
_arr
=>
serial_tx_arr
,
serial_tx
=>
serial_tx_arr
(
0
)
,
serial_rx
_arr
=>
serial_rx_arr
,
-- connects to delayed tx_serial_arr(0) when g_loopback=TRUE else to rx_serial_in
serial_rx
=>
serial_rx_arr
(
0
)
,
-- connects to delayed tx_serial_arr(0) when g_loopback=TRUE else to rx_serial_in
serial_tx_out
=>
serial_tx_out
,
-- connects to delayed tx_serial_arr(0)
serial_tx_out
=>
serial_tx_out
,
-- connects to delayed tx_serial_arr(0)
serial_rx_in
=>
serial_rx_in
,
-- used when g_loopback=FALSE
serial_rx_in
=>
serial_rx_in
,
-- used when g_loopback=FALSE
-- XAUI serial layer connect
-- XAUI serial layer connect
xaui_tx
_arr
=>
xaui_tx_arr
,
xaui_tx
=>
xaui_tx_arr
(
0
)
,
xaui_rx
_arr
=>
xaui_rx_arr
,
-- connects to delayed xaui_tx_arr(0) when g_loopback=TRUE else to xaui_rx_in
xaui_rx
=>
xaui_rx_arr
(
0
)
,
-- connects to delayed xaui_tx_arr(0) when g_loopback=TRUE else to xaui_rx_in
xaui_tx_out
=>
xaui_tx_out
,
-- connects to delayed xaui_tx_arr(0)
xaui_tx_out
=>
xaui_tx_out
,
-- connects to delayed xaui_tx_arr(0)
xaui_rx_in
=>
xaui_rx_in
-- used when g_loopback=FALSE
xaui_rx_in
=>
xaui_rx_in
-- used when g_loopback=FALSE
);
);
-- Packet receiver
-- Packet receiver
...
@@ -357,7 +359,7 @@ BEGIN
...
@@ -357,7 +359,7 @@ BEGIN
PORT
MAP
(
PORT
MAP
(
mm_init
=>
mm_init
,
mm_init
=>
mm_init
,
total_header
=>
total_header
,
total_header
=>
total_header
,
clk_156
=>
tb_rx_clk
,
rx_clk
=>
tb_rx_clk
,
rx_sosi
=>
rx_sosi
,
rx_sosi
=>
rx_sosi
,
rx_siso
=>
rx_siso
,
rx_siso
=>
rx_siso
,
rx_toggle
=>
rx_toggle
rx_toggle
=>
rx_toggle
...
@@ -366,28 +368,28 @@ BEGIN
...
@@ -366,28 +368,28 @@ BEGIN
-- Verification
-- Verification
u_verify_rx_at_eop
:
ENTITY
tech_mac_10g_lib
.
tb_tech_mac_10_verify_rx_at_eop
u_verify_rx_at_eop
:
ENTITY
tech_mac_10g_lib
.
tb_tech_mac_10_verify_rx_at_eop
GENERIC
MAP
(
GENERIC
MAP
(
g_no_padding
=>
FALSE
,
g_no_padding
=>
g_no_dut
,
g_pkt_length_arr
=>
c_pkt_length_arr
g_pkt_length_arr
=>
c_pkt_length_arr
)
)
PORT
MAP
(
PORT
MAP
(
tx_clk
_156
=>
tb_tx_clk
,
tx_clk
=>
tb_tx_clk
,
tx_sosi
=>
tx_sosi
,
tx_sosi
=>
tx_sosi
,
rx_clk
_156
=>
tb_rx_clk
,
rx_clk
=>
tb_rx_clk
,
rx_sosi
=>
rx_sosi
rx_sosi
=>
rx_sosi
);
);
u_verify_rx_pkt_cnt
:
ENTITY
tech_mac_10g_lib
.
tb_tech_mac_10g_verify_rx_pkt_cnt
u_verify_rx_pkt_cnt
:
ENTITY
tech_mac_10g_lib
.
tb_tech_mac_10g_verify_rx_pkt_cnt
GENERIC
MAP
(
GENERIC
MAP
(
g_nof_pkt
=>
c_nof_pkt
g_nof_pkt
=>
c_nof_pkt
)
)
PORT
MAP
(
PORT
MAP
(
tx_clk
_156
=>
tb_tx_clk
,
tx_clk
=>
tb_tx_clk
,
tx_sosi
=>
tx_sosi
,
tx_sosi
=>
tx_sosi
,
rx_clk
_156
=>
tb_rx_clk
,
rx_clk
=>
tb_rx_clk
,
rx_sosi
=>
rx_sosi
,
rx_sosi
=>
rx_sosi
,
tx_pkt_cnt
=>
tx_pkt_cnt
,
tx_pkt_cnt
=>
tx_pkt_cnt
,
rx_pkt_cnt
=>
rx_pkt_cnt
,
rx_pkt_cnt
=>
rx_pkt_cnt
,
rx_end
=>
rx_end
rx_end
=>
rx_end
);
);
p_tb_end
:
PROCESS
p_tb_end
:
PROCESS
...
...
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