Use start_soon instead of fork

This commit is contained in:
Alex Forencich
2021-12-08 21:38:12 -08:00
parent 2b0b12c68d
commit 3f7193b77c
7 changed files with 18 additions and 18 deletions

View File

@@ -124,7 +124,7 @@ class TagContext:
def _start(self):
if self._cr is None:
self._cr = cocotb.fork(self._process_queue())
self._cr = cocotb.start_soon(self._process_queue())
def _flush(self):
flushed_cmds = []
@@ -392,9 +392,9 @@ class AxiMasterWrite(Region, Reset):
else:
self.log.info("Reset de-asserted")
if self._process_write_cr is None:
self._process_write_cr = cocotb.fork(self._process_write())
self._process_write_cr = cocotb.start_soon(self._process_write())
if self._process_write_resp_cr is None:
self._process_write_resp_cr = cocotb.fork(self._process_write_resp())
self._process_write_resp_cr = cocotb.start_soon(self._process_write_resp())
async def _process_write(self):
while True:
@@ -737,9 +737,9 @@ class AxiMasterRead(Region, Reset):
else:
self.log.info("Reset de-asserted")
if self._process_read_cr is None:
self._process_read_cr = cocotb.fork(self._process_read())
self._process_read_cr = cocotb.start_soon(self._process_read())
if self._process_read_resp_cr is None:
self._process_read_resp_cr = cocotb.fork(self._process_read_resp())
self._process_read_resp_cr = cocotb.start_soon(self._process_read_resp())
async def _process_read(self):
while True:

View File

@@ -102,7 +102,7 @@ class AxiSlaveWrite(Reset):
else:
self.log.info("Reset de-asserted")
if self._process_write_cr is None:
self._process_write_cr = cocotb.fork(self._process_write())
self._process_write_cr = cocotb.start_soon(self._process_write())
async def _process_write(self):
while True:
@@ -259,7 +259,7 @@ class AxiSlaveRead(Reset):
else:
self.log.info("Reset de-asserted")
if self._process_read_cr is None:
self._process_read_cr = cocotb.fork(self._process_read())
self._process_read_cr = cocotb.start_soon(self._process_read())
async def _process_read(self):
while True:

View File

@@ -220,9 +220,9 @@ class AxiLiteMasterWrite(Region, Reset):
else:
self.log.info("Reset de-asserted")
if self._process_write_cr is None:
self._process_write_cr = cocotb.fork(self._process_write())
self._process_write_cr = cocotb.start_soon(self._process_write())
if self._process_write_resp_cr is None:
self._process_write_resp_cr = cocotb.fork(self._process_write_resp())
self._process_write_resp_cr = cocotb.start_soon(self._process_write_resp())
async def _process_write(self):
while True:
@@ -437,9 +437,9 @@ class AxiLiteMasterRead(Region, Reset):
else:
self.log.info("Reset de-asserted")
if self._process_read_cr is None:
self._process_read_cr = cocotb.fork(self._process_read())
self._process_read_cr = cocotb.start_soon(self._process_read())
if self._process_read_resp_cr is None:
self._process_read_resp_cr = cocotb.fork(self._process_read_resp())
self._process_read_resp_cr = cocotb.start_soon(self._process_read_resp())
async def _process_read(self):
while True:

View File

@@ -97,7 +97,7 @@ class AxiLiteSlaveWrite(Reset):
else:
self.log.info("Reset de-asserted")
if self._process_write_cr is None:
self._process_write_cr = cocotb.fork(self._process_write())
self._process_write_cr = cocotb.start_soon(self._process_write())
async def _process_write(self):
while True:
@@ -210,7 +210,7 @@ class AxiLiteSlaveRead(Reset):
else:
self.log.info("Reset de-asserted")
if self._process_read_cr is None:
self._process_read_cr = cocotb.fork(self._process_read())
self._process_read_cr = cocotb.start_soon(self._process_read())
async def _process_read(self):
while True:

View File

@@ -366,7 +366,7 @@ class AxiStreamBase(Reset):
else:
self.log.info("Reset de-asserted")
if self._run_cr is None:
self._run_cr = cocotb.fork(self._run())
self._run_cr = cocotb.start_soon(self._run())
async def _run(self):
raise NotImplementedError()
@@ -388,7 +388,7 @@ class AxiStreamPause:
self._pause_generator = generator
if self._pause_generator is not None:
self._pause_cr = cocotb.fork(self._run_pause())
self._pause_cr = cocotb.start_soon(self._run_pause())
def clear_pause_generator(self):
self.set_pause_generator(None)

View File

@@ -33,7 +33,7 @@ class Reset:
self._reset_state = True
if reset_signal is not None:
cocotb.fork(self._run_reset(reset_signal, bool(active_level)))
cocotb.start_soon(self._run_reset(reset_signal, bool(active_level)))
self._update_reset()

View File

@@ -153,7 +153,7 @@ class StreamBase(Reset):
else:
self.log.info("Reset de-asserted")
if self._run_cr is None:
self._run_cr = cocotb.fork(self._run())
self._run_cr = cocotb.start_soon(self._run())
async def _run(self):
raise NotImplementedError()
@@ -175,7 +175,7 @@ class StreamPause:
self._pause_generator = generator
if self._pause_generator is not None:
self._pause_cr = cocotb.fork(self._run_pause())
self._pause_cr = cocotb.start_soon(self._run_pause())
def clear_pause_generator(self):
self.set_pause_generator(None)