diff --git a/src/math/tb/taxi_mt19937/test_taxi_mt19937.py b/src/math/tb/taxi_mt19937/test_taxi_mt19937.py index 7bab4a1..99ce023 100644 --- a/src/math/tb/taxi_mt19937/test_taxi_mt19937.py +++ b/src/math/tb/taxi_mt19937/test_taxi_mt19937.py @@ -20,7 +20,6 @@ import cocotb_test.simulator import cocotb from cocotb.clock import Clock from cocotb.triggers import RisingEdge -from cocotb.regression import TestFactory from cocotbext.axi import AxiStreamBus, AxiStreamSink @@ -62,6 +61,15 @@ class TB(object): await RisingEdge(self.dut.clk) +def cycle_pause(): + return itertools.cycle([1, 1, 1, 0]) + + +@cocotb.test() +@cocotb.parametrize( + ("seed", [None, 0x12345678]), + ("backpressure_inserter", [None, cycle_pause]), +) async def run_test(dut, seed=None, backpressure_inserter=None): tb = TB(dut) @@ -99,18 +107,6 @@ async def run_test(dut, seed=None, backpressure_inserter=None): await RisingEdge(dut.clk) -def cycle_pause(): - return itertools.cycle([1, 1, 1, 0]) - - -if getattr(cocotb, 'top', None) is not None: - - factory = TestFactory(run_test) - factory.add_option("backpressure_inserter", [None, cycle_pause]) - factory.add_option("seed", [None, 0x12345678]) - factory.generate_tests() - - # cocotb-test tests_dir = os.path.dirname(__file__)