mirror of
https://github.com/fpganinja/taxi.git
synced 2025-12-12 10:08:39 -08:00
Testbench cleanup for cocotb 2.0
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -160,7 +160,7 @@ async def run_test_nack(dut):
|
||||
await RisingEdge(dut.clk)
|
||||
|
||||
|
||||
if cocotb.SIM_NAME:
|
||||
if getattr(cocotb, 'top', None) is not None:
|
||||
|
||||
for test in [
|
||||
run_test_write,
|
||||
|
||||
@@ -131,7 +131,7 @@ async def run_test_nack(dut):
|
||||
await RisingEdge(dut.clk)
|
||||
|
||||
|
||||
if cocotb.SIM_NAME:
|
||||
if getattr(cocotb, 'top', None) is not None:
|
||||
|
||||
for test in [
|
||||
run_test_write,
|
||||
|
||||
@@ -95,7 +95,7 @@ async def run_test(dut, payload_lengths=None, payload_data=None):
|
||||
await RisingEdge(dut.clk)
|
||||
|
||||
|
||||
if cocotb.SIM_NAME:
|
||||
if getattr(cocotb, 'top', None) is not None:
|
||||
|
||||
factory = TestFactory(run_test)
|
||||
factory.generate_tests()
|
||||
|
||||
@@ -131,7 +131,7 @@ def cycle_pause():
|
||||
return itertools.cycle([1, 1, 1, 0])
|
||||
|
||||
|
||||
if cocotb.SIM_NAME:
|
||||
if getattr(cocotb, 'top', None) is not None:
|
||||
|
||||
for test in [run_test_write, run_test_read]:
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ def prbs_payload(length):
|
||||
return bytearray([next(gen) for x in range(length)])
|
||||
|
||||
|
||||
if cocotb.SIM_NAME:
|
||||
if getattr(cocotb, 'top', None) is not None:
|
||||
|
||||
for test in [run_test_tx, run_test_rx]:
|
||||
factory = TestFactory(test)
|
||||
|
||||
Reference in New Issue
Block a user