From bce364eef58484c48b88dea5f50799c4b772a155 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Sun, 21 Mar 2021 18:39:10 -0700 Subject: [PATCH] Ensure idle event is set when queue is empty --- cocotbext/axi/axis.py | 3 +++ cocotbext/axi/stream.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/cocotbext/axi/axis.py b/cocotbext/axi/axis.py index a674d6c..52ccb78 100644 --- a/cocotbext/axi/axis.py +++ b/cocotbext/axi/axis.py @@ -367,6 +367,9 @@ class AxiStreamBase(Reset): self._run_cr = None self.active = False + + if self.queue.empty(): + self.idle_event.set() else: self.log.info("Reset de-asserted") if self._run_cr is None: diff --git a/cocotbext/axi/stream.py b/cocotbext/axi/stream.py index 1293a40..d2f4ad8 100644 --- a/cocotbext/axi/stream.py +++ b/cocotbext/axi/stream.py @@ -145,6 +145,9 @@ class StreamBase(Reset): self._run_cr = None self.active = False + + if self.queue.empty(): + self.idle_event.set() else: self.log.info("Reset de-asserted") if self._run_cr is None: