From 030e088b25dfd53556a1e5c9bd1e9862daa7264c Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Wed, 24 Mar 2021 16:24:18 -0700 Subject: [PATCH] Revert back to cocotb.fork --- cocotbext/eth/gmii.py | 8 ++++---- cocotbext/eth/mii.py | 6 +++--- cocotbext/eth/ptp.py | 2 +- cocotbext/eth/reset.py | 2 +- cocotbext/eth/rgmii.py | 8 ++++---- cocotbext/eth/xgmii.py | 4 ++-- tests/gmii/test_gmii.py | 4 ++-- tests/mii/test_mii.py | 4 ++-- tests/ptp_clock/test_ptp_clock.py | 2 +- tests/rgmii/test_rgmii.py | 4 ++-- tests/xgmii/test_xgmii.py | 4 ++-- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cocotbext/eth/gmii.py b/cocotbext/eth/gmii.py index d1e432a..c1a3c92 100644 --- a/cocotbext/eth/gmii.py +++ b/cocotbext/eth/gmii.py @@ -254,7 +254,7 @@ class GmiiSource(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None @@ -415,7 +415,7 @@ class GmiiSink(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None @@ -510,12 +510,12 @@ class GmiiPhy: self._clock_cr.kill() if self.speed == 1000e6: - self._clock_cr = cocotb.scheduler.start_soon(self._run_clocks(8*1e9/self.speed)) + self._clock_cr = cocotb.fork(self._run_clocks(8*1e9/self.speed)) self.tx.mii_mode = False self.rx.mii_mode = False self.tx.clock = self.gtx_clk else: - self._clock_cr = cocotb.scheduler.start_soon(self._run_clocks(4*1e9/self.speed)) + self._clock_cr = cocotb.fork(self._run_clocks(4*1e9/self.speed)) self.tx.mii_mode = True self.rx.mii_mode = True self.tx.clock = self.tx_clk diff --git a/cocotbext/eth/mii.py b/cocotbext/eth/mii.py index bc2a62c..22b7e74 100644 --- a/cocotbext/eth/mii.py +++ b/cocotbext/eth/mii.py @@ -155,7 +155,7 @@ class MiiSource(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None @@ -309,7 +309,7 @@ class MiiSink(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None @@ -398,7 +398,7 @@ class MiiPhy: if self._clock_cr is not None: self._clock_cr.kill() - self._clock_cr = cocotb.scheduler.start_soon(self._run_clocks(4*1e9/self.speed)) + self._clock_cr = cocotb.fork(self._run_clocks(4*1e9/self.speed)) async def _run_clocks(self, period): half_period = get_sim_steps(period / 2.0, 'ns') diff --git a/cocotbext/eth/ptp.py b/cocotbext/eth/ptp.py index 9a6f8b2..d87e09b 100644 --- a/cocotbext/eth/ptp.py +++ b/cocotbext/eth/ptp.py @@ -204,7 +204,7 @@ class PtpClock(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): while True: diff --git a/cocotbext/eth/reset.py b/cocotbext/eth/reset.py index b0f0cb5..dca90aa 100644 --- a/cocotbext/eth/reset.py +++ b/cocotbext/eth/reset.py @@ -33,7 +33,7 @@ class Reset: self._reset_state = True if reset_signal is not None: - cocotb.scheduler.start_soon(self._run_reset(reset_signal, bool(active_level))) + cocotb.fork(self._run_reset(reset_signal, bool(active_level))) self._update_reset() diff --git a/cocotbext/eth/rgmii.py b/cocotbext/eth/rgmii.py index c48e89e..2befbc4 100644 --- a/cocotbext/eth/rgmii.py +++ b/cocotbext/eth/rgmii.py @@ -153,7 +153,7 @@ class RgmiiSource(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None @@ -323,7 +323,7 @@ class RgmiiSink(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None @@ -427,11 +427,11 @@ class RgmiiPhy: self._clock_cr.kill() if self.speed == 1000e6: - self._clock_cr = cocotb.scheduler.start_soon(self._run_clock(8*1e9/self.speed)) + self._clock_cr = cocotb.fork(self._run_clock(8*1e9/self.speed)) self.tx.mii_mode = False self.rx.mii_mode = False else: - self._clock_cr = cocotb.scheduler.start_soon(self._run_clock(4*1e9/self.speed)) + self._clock_cr = cocotb.fork(self._run_clock(4*1e9/self.speed)) self.tx.mii_mode = True self.rx.mii_mode = True diff --git a/cocotbext/eth/xgmii.py b/cocotbext/eth/xgmii.py index c8c500d..033eede 100644 --- a/cocotbext/eth/xgmii.py +++ b/cocotbext/eth/xgmii.py @@ -258,7 +258,7 @@ class XgmiiSource(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None @@ -437,7 +437,7 @@ class XgmiiSink(Reset): else: self.log.info("Reset de-asserted") if self._run_cr is None: - self._run_cr = cocotb.scheduler.start_soon(self._run()) + self._run_cr = cocotb.fork(self._run()) async def _run(self): frame = None diff --git a/tests/gmii/test_gmii.py b/tests/gmii/test_gmii.py index a72b6ef..e18a929 100644 --- a/tests/gmii/test_gmii.py +++ b/tests/gmii/test_gmii.py @@ -47,7 +47,7 @@ class TB: self._enable_generator = None self._enable_cr = None - cocotb.scheduler.start_soon(Clock(dut.clk, 2, units="ns").start()) + cocotb.fork(Clock(dut.clk, 2, units="ns").start()) self.source = GmiiSource(dut.gmii_d, dut.gmii_er, dut.gmii_en, dut.clk, dut.rst, dut.gmii_clk_en, dut.gmii_mii_sel) @@ -76,7 +76,7 @@ class TB: self._enable_generator = generator if self._enable_generator is not None: - self._enable_cr = cocotb.scheduler.start_soon(self._run_enable()) + self._enable_cr = cocotb.fork(self._run_enable()) def clear_enable_generator(self): self.set_enable_generator(None) diff --git a/tests/mii/test_mii.py b/tests/mii/test_mii.py index 8f7cbf0..3d146f8 100644 --- a/tests/mii/test_mii.py +++ b/tests/mii/test_mii.py @@ -47,7 +47,7 @@ class TB: self._enable_generator = None self._enable_cr = None - cocotb.scheduler.start_soon(Clock(dut.clk, 2, units="ns").start()) + cocotb.fork(Clock(dut.clk, 2, units="ns").start()) self.source = MiiSource(dut.mii_d, dut.mii_er, dut.mii_en, dut.clk, dut.rst, dut.mii_clk_en) @@ -75,7 +75,7 @@ class TB: self._enable_generator = generator if self._enable_generator is not None: - self._enable_cr = cocotb.scheduler.start_soon(self._run_enable()) + self._enable_cr = cocotb.fork(self._run_enable()) def clear_enable_generator(self): self.set_enable_generator(None) diff --git a/tests/ptp_clock/test_ptp_clock.py b/tests/ptp_clock/test_ptp_clock.py index 6588914..e114dd2 100644 --- a/tests/ptp_clock/test_ptp_clock.py +++ b/tests/ptp_clock/test_ptp_clock.py @@ -43,7 +43,7 @@ class TB: self.log = logging.getLogger("cocotb.tb") self.log.setLevel(logging.DEBUG) - cocotb.scheduler.start_soon(Clock(dut.clk, 6.4, units="ns").start()) + cocotb.fork(Clock(dut.clk, 6.4, units="ns").start()) self.ptp_clock = PtpClock( ts_96=dut.ts_96, diff --git a/tests/rgmii/test_rgmii.py b/tests/rgmii/test_rgmii.py index 166be9e..e45f649 100644 --- a/tests/rgmii/test_rgmii.py +++ b/tests/rgmii/test_rgmii.py @@ -47,7 +47,7 @@ class TB: self._enable_generator = None self._enable_cr = None - cocotb.scheduler.start_soon(Clock(dut.clk, 2, units="ns").start()) + cocotb.fork(Clock(dut.clk, 2, units="ns").start()) self.source = RgmiiSource(dut.rgmii_d, dut.rgmii_ctl, dut.clk, dut.rst, dut.rgmii_clk_en, dut.rgmii_mii_sel) self.sink = RgmiiSink(dut.rgmii_d, dut.rgmii_ctl, dut.clk, dut.rst, dut.rgmii_clk_en, dut.rgmii_mii_sel) @@ -74,7 +74,7 @@ class TB: self._enable_generator = generator if self._enable_generator is not None: - self._enable_cr = cocotb.scheduler.start_soon(self._run_enable()) + self._enable_cr = cocotb.fork(self._run_enable()) def clear_enable_generator(self): self.set_enable_generator(None) diff --git a/tests/xgmii/test_xgmii.py b/tests/xgmii/test_xgmii.py index 87fb9ec..0ffd5d7 100644 --- a/tests/xgmii/test_xgmii.py +++ b/tests/xgmii/test_xgmii.py @@ -48,7 +48,7 @@ class TB: self._enable_generator = None self._enable_cr = None - cocotb.scheduler.start_soon(Clock(dut.clk, 2, units="ns").start()) + cocotb.fork(Clock(dut.clk, 2, units="ns").start()) self.source = XgmiiSource(dut.xgmii_d, dut.xgmii_c, dut.clk, dut.rst, dut.xgmii_clk_en) self.sink = XgmiiSink(dut.xgmii_d, dut.xgmii_c, dut.clk, dut.rst, dut.xgmii_clk_en) @@ -74,7 +74,7 @@ class TB: self._enable_generator = generator if self._enable_generator is not None: - self._enable_cr = cocotb.scheduler.start_soon(self._run_enable()) + self._enable_cr = cocotb.fork(self._run_enable()) def clear_enable_generator(self): self.set_enable_generator(None)