mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-09 17:08:38 -08:00
eth: Use shared counter for fractional part of pause quanta
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -607,6 +607,8 @@ async def run_test_pfc(dut, ifg=12):
|
||||
test_frame = XgmiiFrame.from_payload(bytes(test_pkt))
|
||||
await tb.xgmii_source.send(test_frame)
|
||||
|
||||
dut.rx_pfc_ack.value = 0xff
|
||||
|
||||
for i in range(8):
|
||||
for k in range(200):
|
||||
await RisingEdge(dut.tx_clk)
|
||||
|
||||
@@ -623,7 +623,7 @@ async def run_test_pfc(dut, ifg=12, enable_gen=None, mii_sel=True):
|
||||
dut.tx_pfc_req.value = 0x00
|
||||
dut.tx_pfc_resend.value = 0
|
||||
dut.rx_pfc_en.value = 0xff
|
||||
dut.rx_pfc_ack.value = 0
|
||||
dut.rx_pfc_ack.value = 0x00
|
||||
|
||||
dut.tx_lfc_pause_en.value = 0
|
||||
dut.tx_pause_req.value = 0
|
||||
@@ -682,6 +682,8 @@ async def run_test_pfc(dut, ifg=12, enable_gen=None, mii_sel=True):
|
||||
test_frame = GmiiFrame.from_payload(bytes(test_pkt))
|
||||
await tb.gmii_source.send(test_frame)
|
||||
|
||||
dut.rx_pfc_ack.value = 0xff
|
||||
|
||||
for i in range(8):
|
||||
for k in range(500):
|
||||
await RisingEdge(dut.tx_clk)
|
||||
|
||||
@@ -487,7 +487,7 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
dut.tx_pfc_req.value = 0x00
|
||||
dut.tx_pfc_resend.value = 0
|
||||
dut.rx_pfc_en.value = 0xff
|
||||
dut.rx_pfc_ack.value = 0
|
||||
dut.rx_pfc_ack.value = 0x00
|
||||
|
||||
dut.tx_lfc_pause_en.value = 0
|
||||
dut.tx_pause_req.value = 0
|
||||
@@ -546,6 +546,8 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
test_frame = GmiiFrame.from_payload(bytes(test_pkt))
|
||||
await tb.gmii_phy.rx.send(test_frame)
|
||||
|
||||
dut.rx_pfc_ack.value = 0xff
|
||||
|
||||
for i in range(8):
|
||||
for k in range(500):
|
||||
await RisingEdge(dut.tx_clk)
|
||||
|
||||
@@ -490,7 +490,7 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
dut.tx_pfc_req.value = 0x00
|
||||
dut.tx_pfc_resend.value = 0
|
||||
dut.rx_pfc_en.value = 0xff
|
||||
dut.rx_pfc_ack.value = 0
|
||||
dut.rx_pfc_ack.value = 0x00
|
||||
|
||||
dut.tx_lfc_pause_en.value = 0
|
||||
dut.tx_pause_req.value = 0
|
||||
@@ -549,6 +549,8 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
test_frame = GmiiFrame.from_payload(bytes(test_pkt))
|
||||
await tb.rgmii_phy.rx.send(test_frame)
|
||||
|
||||
dut.rx_pfc_ack.value = 0xff
|
||||
|
||||
for i in range(8):
|
||||
for k in range(500):
|
||||
await RisingEdge(dut.rx_clk)
|
||||
|
||||
@@ -451,7 +451,7 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
dut.tx_pfc_req.value = 0x00
|
||||
dut.tx_pfc_resend.value = 0
|
||||
dut.rx_pfc_en.value = 0xff
|
||||
dut.rx_pfc_ack.value = 0
|
||||
dut.rx_pfc_ack.value = 0x00
|
||||
|
||||
dut.tx_lfc_pause_en.value = 0
|
||||
dut.tx_pause_req.value = 0
|
||||
@@ -510,6 +510,8 @@ async def run_test_pfc(dut, ifg=12, speed=1000e6):
|
||||
test_frame = GmiiFrame.from_payload(bytes(test_pkt))
|
||||
await tb.mii_phy.rx.send(test_frame)
|
||||
|
||||
dut.rx_pfc_ack.value = 0xff
|
||||
|
||||
for i in range(8):
|
||||
for k in range(500):
|
||||
await RisingEdge(dut.tx_clk)
|
||||
|
||||
@@ -668,6 +668,8 @@ async def run_test_pfc(dut, ifg=12):
|
||||
test_frame = XgmiiFrame.from_payload(bytes(test_pkt))
|
||||
await tb.serdes_source.send(test_frame)
|
||||
|
||||
dut.rx_pfc_ack.value = 0xff
|
||||
|
||||
for i in range(8):
|
||||
for k in range(200):
|
||||
await RisingEdge(dut.tx_clk)
|
||||
|
||||
@@ -121,7 +121,7 @@ async def run_test_lfc(dut):
|
||||
tb.log.info("pause time : %g s", pause_time)
|
||||
tb.log.info("pause quanta : %f", pause_quanta)
|
||||
|
||||
assert round(pause_quanta) == 100
|
||||
assert round(pause_quanta/4) == 100//4
|
||||
|
||||
tb.log.info("Test release time accuracy (with refresh)")
|
||||
eth = Ether(src='5A:51:52:53:54:55', dst='01:80:C2:00:00:01', type=0x8808)
|
||||
@@ -151,7 +151,7 @@ async def run_test_lfc(dut):
|
||||
tb.log.info("pause time : %g s", pause_time)
|
||||
tb.log.info("pause quanta : %f", pause_quanta)
|
||||
|
||||
assert round(pause_quanta) == 100
|
||||
assert round(pause_quanta/4) == 100//4
|
||||
|
||||
tb.log.info("Test explicit release")
|
||||
eth = Ether(src='5A:51:52:53:54:55', dst='01:80:C2:00:00:01', type=0x8808)
|
||||
@@ -230,7 +230,7 @@ async def run_test_pfc(dut):
|
||||
tb.log.info("pause time : %g s", pause_time)
|
||||
tb.log.info("pause quanta : %f", pause_quanta)
|
||||
|
||||
assert round(pause_quanta) == 100
|
||||
assert round(pause_quanta/4) == 100//4
|
||||
|
||||
tb.log.info("Test release time accuracy (with refresh)")
|
||||
eth = Ether(src='5A:51:52:53:54:55', dst='01:80:C2:00:00:01', type=0x8808)
|
||||
@@ -260,7 +260,7 @@ async def run_test_pfc(dut):
|
||||
tb.log.info("pause time : %g s", pause_time)
|
||||
tb.log.info("pause quanta : %f", pause_quanta)
|
||||
|
||||
assert round(pause_quanta) == 100
|
||||
assert round(pause_quanta/4) == 100//4
|
||||
|
||||
tb.log.info("Test explicit release")
|
||||
eth = Ether(src='5A:51:52:53:54:55', dst='01:80:C2:00:00:01', type=0x8808)
|
||||
@@ -316,7 +316,7 @@ async def run_test_pfc(dut):
|
||||
tb.log.info("pause time : %g s", pause_time)
|
||||
tb.log.info("pause quanta : %f", pause_quanta)
|
||||
|
||||
assert round(pause_quanta) == (k+1)*10
|
||||
assert round(pause_quanta/4) == (k+1)*10//4
|
||||
|
||||
dut.rx_pfc_ack.value = 0
|
||||
|
||||
@@ -358,7 +358,7 @@ async def run_test_pfc(dut):
|
||||
tb.log.info("pause time : %g s", pause_time)
|
||||
tb.log.info("pause quanta : %f", pause_quanta)
|
||||
|
||||
assert round(pause_quanta) == 100
|
||||
assert round(pause_quanta/4) == 100//4
|
||||
|
||||
await RisingEdge(dut.clk)
|
||||
await RisingEdge(dut.clk)
|
||||
|
||||
@@ -143,7 +143,7 @@ async def run_test_lfc(dut):
|
||||
tb.log.info("refresh time : %g s", refresh_time)
|
||||
tb.log.info("refresh quanta : %f", refresh_quanta)
|
||||
|
||||
assert round(refresh_quanta) == 100
|
||||
assert round(refresh_quanta/4) == 100//4
|
||||
|
||||
start_time = get_sim_time('sec')
|
||||
|
||||
@@ -216,7 +216,7 @@ async def run_test_pfc(dut):
|
||||
tb.log.info("refresh time : %g s", refresh_time)
|
||||
tb.log.info("refresh quanta : %f", refresh_quanta)
|
||||
|
||||
assert round(refresh_quanta) == 100
|
||||
assert round(refresh_quanta/4) == 100//4
|
||||
|
||||
start_time = get_sim_time('sec')
|
||||
|
||||
@@ -248,7 +248,7 @@ async def run_test_pfc(dut):
|
||||
tb.log.info("refresh time : %g s", refresh_time)
|
||||
tb.log.info("refresh quanta : %f", refresh_quanta)
|
||||
|
||||
assert round(refresh_quanta) == 100
|
||||
assert round(refresh_quanta/4) == 100//4
|
||||
|
||||
start_time = get_sim_time('sec')
|
||||
|
||||
@@ -301,7 +301,7 @@ async def run_test_pfc(dut):
|
||||
tb.log.info("refresh time : %g s", refresh_time)
|
||||
tb.log.info("refresh quanta : %f", refresh_quanta)
|
||||
|
||||
assert round(refresh_quanta) == 100
|
||||
assert round(refresh_quanta/4) == 100//4
|
||||
|
||||
start_time = get_sim_time('sec')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user