mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-09 00:48:40 -08:00
eth: Use unpacked arrays for multidimensional ports
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -95,8 +95,8 @@ class TB:
|
||||
dut.cfg_tx_pfc_eth_type.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_en.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue([0]*8)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue([0]*8)
|
||||
dut.cfg_rx_lfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_rx_lfc_en.setimmediatevalue(0)
|
||||
dut.cfg_rx_pfc_opcode.setimmediatevalue(0)
|
||||
@@ -554,8 +554,8 @@ async def run_test_pfc(dut, ifg=12):
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 1
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_tx_pfc_quanta.value = [0xFFFF]*8
|
||||
dut.cfg_tx_pfc_refresh.value = [0x7F00]*8
|
||||
|
||||
dut.cfg_rx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_rx_pfc_en.value = 1
|
||||
|
||||
@@ -121,8 +121,8 @@ logic [47:0] cfg_tx_pfc_eth_src;
|
||||
logic [15:0] cfg_tx_pfc_eth_type;
|
||||
logic [15:0] cfg_tx_pfc_opcode;
|
||||
logic cfg_tx_pfc_en;
|
||||
logic [7:0][15:0] cfg_tx_pfc_quanta;
|
||||
logic [7:0][15:0] cfg_tx_pfc_refresh;
|
||||
logic [15:0] cfg_tx_pfc_quanta[8];
|
||||
logic [15:0] cfg_tx_pfc_refresh[8];
|
||||
logic [15:0] cfg_rx_lfc_opcode;
|
||||
logic cfg_rx_lfc_en;
|
||||
logic [15:0] cfg_rx_pfc_opcode;
|
||||
|
||||
@@ -102,8 +102,8 @@ class TB:
|
||||
dut.cfg_tx_pfc_eth_type.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_en.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue([0]*8)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue([0]*8)
|
||||
dut.cfg_rx_lfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_rx_lfc_en.setimmediatevalue(0)
|
||||
dut.cfg_rx_pfc_opcode.setimmediatevalue(0)
|
||||
@@ -541,8 +541,8 @@ async def run_test_pfc(dut, ifg=12, enable_gen=None, mii_sel=True):
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 1
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_tx_pfc_quanta.value = [0xFFFF]*8
|
||||
dut.cfg_tx_pfc_refresh.value = [0x7F00]*8
|
||||
|
||||
dut.cfg_rx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_rx_pfc_en.value = 1
|
||||
|
||||
@@ -125,8 +125,8 @@ logic [47:0] cfg_tx_pfc_eth_src;
|
||||
logic [15:0] cfg_tx_pfc_eth_type;
|
||||
logic [15:0] cfg_tx_pfc_opcode;
|
||||
logic cfg_tx_pfc_en;
|
||||
logic [7:0][15:0] cfg_tx_pfc_quanta;
|
||||
logic [7:0][15:0] cfg_tx_pfc_refresh;
|
||||
logic [15:0] cfg_tx_pfc_quanta[8];
|
||||
logic [15:0] cfg_tx_pfc_refresh[8];
|
||||
logic [15:0] cfg_rx_lfc_opcode;
|
||||
logic cfg_rx_lfc_en;
|
||||
logic [15:0] cfg_rx_pfc_opcode;
|
||||
|
||||
@@ -94,8 +94,8 @@ class TB:
|
||||
dut.cfg_tx_pfc_eth_type.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_en.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue([0]*8)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue([0]*8)
|
||||
dut.cfg_rx_lfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_rx_lfc_en.setimmediatevalue(0)
|
||||
dut.cfg_rx_pfc_opcode.setimmediatevalue(0)
|
||||
@@ -494,8 +494,8 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 1
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_tx_pfc_quanta.value = [0xFFFF]*8
|
||||
dut.cfg_tx_pfc_refresh.value = [0x7F00]*8
|
||||
|
||||
dut.cfg_rx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_rx_pfc_en.value = 1
|
||||
|
||||
@@ -129,8 +129,8 @@ logic [47:0] cfg_tx_pfc_eth_src;
|
||||
logic [15:0] cfg_tx_pfc_eth_type;
|
||||
logic [15:0] cfg_tx_pfc_opcode;
|
||||
logic cfg_tx_pfc_en;
|
||||
logic [7:0][15:0] cfg_tx_pfc_quanta;
|
||||
logic [7:0][15:0] cfg_tx_pfc_refresh;
|
||||
logic [15:0] cfg_tx_pfc_quanta[8];
|
||||
logic [15:0] cfg_tx_pfc_refresh[8];
|
||||
logic [15:0] cfg_rx_lfc_opcode;
|
||||
logic cfg_rx_lfc_en;
|
||||
logic [15:0] cfg_rx_pfc_opcode;
|
||||
|
||||
@@ -87,8 +87,8 @@ class TB:
|
||||
dut.cfg_tx_pfc_eth_type.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_en.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue([0]*8)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue([0]*8)
|
||||
dut.cfg_rx_lfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_rx_lfc_en.setimmediatevalue(0)
|
||||
dut.cfg_rx_pfc_opcode.setimmediatevalue(0)
|
||||
@@ -495,8 +495,8 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 1
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_tx_pfc_quanta.value = [0xFFFF]*8
|
||||
dut.cfg_tx_pfc_refresh.value = [0x7F00]*8
|
||||
|
||||
dut.cfg_rx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_rx_pfc_en.value = 1
|
||||
|
||||
@@ -128,8 +128,8 @@ logic [47:0] cfg_tx_pfc_eth_src;
|
||||
logic [15:0] cfg_tx_pfc_eth_type;
|
||||
logic [15:0] cfg_tx_pfc_opcode;
|
||||
logic cfg_tx_pfc_en;
|
||||
logic [7:0][15:0] cfg_tx_pfc_quanta;
|
||||
logic [7:0][15:0] cfg_tx_pfc_refresh;
|
||||
logic [15:0] cfg_tx_pfc_quanta[8];
|
||||
logic [15:0] cfg_tx_pfc_refresh[8];
|
||||
logic [15:0] cfg_rx_lfc_opcode;
|
||||
logic cfg_rx_lfc_en;
|
||||
logic [15:0] cfg_rx_pfc_opcode;
|
||||
|
||||
@@ -87,8 +87,8 @@ class TB:
|
||||
dut.cfg_tx_pfc_eth_type.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_en.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue([0]*8)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue([0]*8)
|
||||
dut.cfg_rx_lfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_rx_lfc_en.setimmediatevalue(0)
|
||||
dut.cfg_rx_pfc_opcode.setimmediatevalue(0)
|
||||
@@ -456,8 +456,8 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 1
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_tx_pfc_quanta.value = [0xFFFF]*8
|
||||
dut.cfg_tx_pfc_refresh.value = [0x7F00]*8
|
||||
|
||||
dut.cfg_rx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_rx_pfc_en.value = 1
|
||||
|
||||
@@ -126,8 +126,8 @@ logic [47:0] cfg_tx_pfc_eth_src;
|
||||
logic [15:0] cfg_tx_pfc_eth_type;
|
||||
logic [15:0] cfg_tx_pfc_opcode;
|
||||
logic cfg_tx_pfc_en;
|
||||
logic [7:0][15:0] cfg_tx_pfc_quanta;
|
||||
logic [7:0][15:0] cfg_tx_pfc_refresh;
|
||||
logic [15:0] cfg_tx_pfc_quanta[8];
|
||||
logic [15:0] cfg_tx_pfc_refresh[8];
|
||||
logic [15:0] cfg_rx_lfc_opcode;
|
||||
logic cfg_rx_lfc_en;
|
||||
logic [15:0] cfg_rx_pfc_opcode;
|
||||
|
||||
@@ -95,8 +95,8 @@ class TB:
|
||||
dut.cfg_tx_pfc_eth_type.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_en.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue([0]*8)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue([0]*8)
|
||||
dut.cfg_rx_lfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_rx_lfc_en.setimmediatevalue(0)
|
||||
dut.cfg_rx_pfc_opcode.setimmediatevalue(0)
|
||||
@@ -614,8 +614,8 @@ async def run_test_pfc(dut, ifg=12):
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 1
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_tx_pfc_quanta.value = [0xFFFF]*8
|
||||
dut.cfg_tx_pfc_refresh.value = [0x7F00]*8
|
||||
|
||||
dut.cfg_rx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_rx_pfc_en.value = 1
|
||||
|
||||
@@ -139,8 +139,8 @@ logic [47:0] cfg_tx_pfc_eth_src;
|
||||
logic [15:0] cfg_tx_pfc_eth_type;
|
||||
logic [15:0] cfg_tx_pfc_opcode;
|
||||
logic cfg_tx_pfc_en;
|
||||
logic [7:0][15:0] cfg_tx_pfc_quanta;
|
||||
logic [7:0][15:0] cfg_tx_pfc_refresh;
|
||||
logic [15:0] cfg_tx_pfc_quanta[8];
|
||||
logic [15:0] cfg_tx_pfc_refresh[8];
|
||||
logic [15:0] cfg_rx_lfc_opcode;
|
||||
logic cfg_rx_lfc_en;
|
||||
logic [15:0] cfg_rx_pfc_opcode;
|
||||
|
||||
@@ -61,8 +61,8 @@ class TB:
|
||||
dut.cfg_tx_pfc_eth_type.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_opcode.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_en.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue(0)
|
||||
dut.cfg_tx_pfc_quanta.setimmediatevalue([0]*8)
|
||||
dut.cfg_tx_pfc_refresh.setimmediatevalue([0]*8)
|
||||
dut.cfg_quanta_step.setimmediatevalue(256)
|
||||
dut.cfg_quanta_clk_en.setimmediatevalue(1)
|
||||
|
||||
@@ -113,9 +113,6 @@ async def run_test_lfc(dut):
|
||||
dut.tx_lfc_req.value = 0
|
||||
dut.tx_lfc_resend.value = 0
|
||||
|
||||
dut.tx_pfc_req.value = 0x00
|
||||
dut.tx_pfc_resend.value = 0
|
||||
|
||||
dut.cfg_tx_lfc_eth_dst.value = 0x0180C2000001
|
||||
dut.cfg_tx_lfc_eth_src.value = 0x5A5152535455
|
||||
dut.cfg_tx_lfc_eth_type.value = 0x8808
|
||||
@@ -123,13 +120,6 @@ async def run_test_lfc(dut):
|
||||
dut.cfg_tx_lfc_en.value = 1
|
||||
dut.cfg_tx_lfc_quanta.value = 0xFFFF
|
||||
dut.cfg_tx_lfc_refresh.value = 0x7F00
|
||||
dut.cfg_tx_pfc_eth_dst.value = 0x0180C2000001
|
||||
dut.cfg_tx_pfc_eth_src.value = 0x5A5152535455
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 0
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_quanta_step.value = int(10000*256 / (512*156.25))
|
||||
dut.cfg_quanta_clk_en.value = 1
|
||||
|
||||
@@ -193,32 +183,22 @@ async def run_test_pfc(dut):
|
||||
|
||||
await tb.reset()
|
||||
|
||||
dut.tx_lfc_req.value = 0
|
||||
dut.tx_lfc_resend.value = 0
|
||||
|
||||
dut.tx_pfc_req.value = 0x00
|
||||
dut.tx_pfc_resend.value = 0
|
||||
|
||||
dut.cfg_tx_lfc_eth_dst.value = 0x0180C2000001
|
||||
dut.cfg_tx_lfc_eth_src.value = 0x5A5152535455
|
||||
dut.cfg_tx_lfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_lfc_opcode.value = 0x0001
|
||||
dut.cfg_tx_lfc_en.value = 0
|
||||
dut.cfg_tx_lfc_quanta.value = 0xFFFF
|
||||
dut.cfg_tx_lfc_refresh.value = 0x7F00
|
||||
dut.cfg_tx_pfc_eth_dst.value = 0x0180C2000001
|
||||
dut.cfg_tx_pfc_eth_src.value = 0x5A5152535455
|
||||
dut.cfg_tx_pfc_eth_type.value = 0x8808
|
||||
dut.cfg_tx_pfc_opcode.value = 0x0101
|
||||
dut.cfg_tx_pfc_en.value = 1
|
||||
dut.cfg_tx_pfc_quanta.value = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
|
||||
dut.cfg_tx_pfc_refresh.value = 0x7F007F007F007F007F007F007F007F00
|
||||
dut.cfg_tx_pfc_quanta.value = [0xFFFF]*8
|
||||
dut.cfg_tx_pfc_refresh.value = [0x7F00]*8
|
||||
dut.cfg_quanta_step.value = int(10000*256 / (512*156.25))
|
||||
dut.cfg_quanta_clk_en.value = 1
|
||||
|
||||
tb.log.info("Test pause")
|
||||
|
||||
dut.cfg_tx_pfc_refresh.value = 0x00640064006400640064006400640064
|
||||
dut.cfg_tx_pfc_refresh.value = [0x0064]*8
|
||||
|
||||
dut.tx_pfc_req.value = 0x01
|
||||
start_time = None
|
||||
@@ -248,7 +228,7 @@ async def run_test_pfc(dut):
|
||||
|
||||
tb.log.info("Test all channels")
|
||||
|
||||
dut.cfg_tx_pfc_refresh.value = 0x00640064006400640064006400640064
|
||||
dut.cfg_tx_pfc_refresh.value = [0x0064]*8
|
||||
|
||||
for ch in range(8):
|
||||
|
||||
@@ -280,7 +260,7 @@ async def run_test_pfc(dut):
|
||||
|
||||
tb.log.info("Test isolation")
|
||||
|
||||
dut.cfg_tx_pfc_refresh.value = 0x00640064006400640064006400640064
|
||||
dut.cfg_tx_pfc_refresh.value = [0x0064]*8
|
||||
|
||||
dut.tx_pfc_req.value = 0x01
|
||||
start_time = None
|
||||
|
||||
Reference in New Issue
Block a user