mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-07 16:28:40 -08:00
eth: Clean up casts
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -138,11 +138,11 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.rx_clk)
|
await RisingEdge(dut.rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
tx_frames = []
|
tx_frames = []
|
||||||
@@ -195,11 +195,11 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.rx_clk)
|
await RisingEdge(dut.rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
|
|
||||||
|
|||||||
@@ -83,11 +83,11 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.gmii_rx_clk)
|
await RisingEdge(dut.gmii_rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
|
|
||||||
@@ -122,11 +122,11 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.gmii_rx_clk)
|
await RisingEdge(dut.gmii_rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
|
|
||||||
|
|||||||
@@ -150,11 +150,11 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.rx_clk)
|
await RisingEdge(dut.rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
tx_frames = []
|
tx_frames = []
|
||||||
@@ -207,11 +207,11 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.rx_clk)
|
await RisingEdge(dut.rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
|
|
||||||
|
|||||||
@@ -99,11 +99,11 @@ async def run_test_rx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.rgmii_rx_clk)
|
await RisingEdge(dut.rgmii_rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
|
|
||||||
@@ -138,11 +138,11 @@ async def run_test_tx(dut, payload_lengths=None, payload_data=None, ifg=12, spee
|
|||||||
await RisingEdge(dut.rgmii_rx_clk)
|
await RisingEdge(dut.rgmii_rx_clk)
|
||||||
|
|
||||||
if speed == 10e6:
|
if speed == 10e6:
|
||||||
assert dut.link_speed == 0
|
assert int(dut.link_speed.value) == 0
|
||||||
elif speed == 100e6:
|
elif speed == 100e6:
|
||||||
assert dut.link_speed == 1
|
assert int(dut.link_speed.value) == 1
|
||||||
else:
|
else:
|
||||||
assert dut.link_speed == 2
|
assert int(dut.link_speed.value) == 2
|
||||||
|
|
||||||
test_frames = [payload_data(x) for x in payload_lengths()]
|
test_frames = [payload_data(x) for x in payload_lengths()]
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ async def run_test_pfc(dut):
|
|||||||
|
|
||||||
await tb.send_mcf(test_pkt)
|
await tb.send_mcf(test_pkt)
|
||||||
|
|
||||||
while dut.rx_pfc_req.value == 0x00:
|
while int(dut.rx_pfc_req.value) == 0x00:
|
||||||
await RisingEdge(dut.clk)
|
await RisingEdge(dut.clk)
|
||||||
dut.rx_pfc_ack.value = 0x01
|
dut.rx_pfc_ack.value = 0x01
|
||||||
|
|
||||||
@@ -299,14 +299,14 @@ async def run_test_pfc(dut):
|
|||||||
|
|
||||||
await tb.send_mcf(test_pkt)
|
await tb.send_mcf(test_pkt)
|
||||||
|
|
||||||
while dut.rx_pfc_req.value != 0xff:
|
while int(dut.rx_pfc_req.value) != 0xff:
|
||||||
await RisingEdge(dut.clk)
|
await RisingEdge(dut.clk)
|
||||||
dut.rx_pfc_ack.value = 0xff
|
dut.rx_pfc_ack.value = 0xff
|
||||||
|
|
||||||
start_time = get_sim_time('sec')
|
start_time = get_sim_time('sec')
|
||||||
|
|
||||||
for k in range(8):
|
for k in range(8):
|
||||||
while dut.rx_pfc_req.value & (1 << k) != 0x00:
|
while int(dut.rx_pfc_req.value) & (1 << k) != 0x00:
|
||||||
await RisingEdge(dut.clk)
|
await RisingEdge(dut.clk)
|
||||||
stop_time = get_sim_time('sec')
|
stop_time = get_sim_time('sec')
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ async def run_test_pfc(dut):
|
|||||||
|
|
||||||
await tb.send_mcf(test_pkt)
|
await tb.send_mcf(test_pkt)
|
||||||
|
|
||||||
while dut.rx_pfc_req.value & 0x01 == 0x00:
|
while int(dut.rx_pfc_req.value) & 0x01 == 0x00:
|
||||||
await RisingEdge(dut.clk)
|
await RisingEdge(dut.clk)
|
||||||
dut.rx_pfc_ack.value = 0x01
|
dut.rx_pfc_ack.value = 0x01
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ async def run_test_pfc(dut):
|
|||||||
|
|
||||||
await tb.send_mcf(test_pkt)
|
await tb.send_mcf(test_pkt)
|
||||||
|
|
||||||
while dut.rx_pfc_req.value & 0x02 == 0x00:
|
while int(dut.rx_pfc_req.value) & 0x02 == 0x00:
|
||||||
await RisingEdge(dut.clk)
|
await RisingEdge(dut.clk)
|
||||||
dut.rx_pfc_ack.value = 0x03
|
dut.rx_pfc_ack.value = 0x03
|
||||||
|
|
||||||
@@ -346,7 +346,7 @@ async def run_test_pfc(dut):
|
|||||||
|
|
||||||
await tb.send_mcf(test_pkt)
|
await tb.send_mcf(test_pkt)
|
||||||
|
|
||||||
while dut.rx_pfc_req.value:
|
while int(dut.rx_pfc_req.value):
|
||||||
await RisingEdge(dut.clk)
|
await RisingEdge(dut.clk)
|
||||||
stop_time = get_sim_time('sec')
|
stop_time = get_sim_time('sec')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user