From 0c9cd9084cc8635c9af74ae14469d10a9e31a08e Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Mon, 26 Oct 2020 13:34:02 -0700 Subject: [PATCH] Fix pause handling --- cocotbext/axi/stream.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/cocotbext/axi/stream.py b/cocotbext/axi/stream.py index 112a07c..6d7e8dc 100644 --- a/cocotbext/axi/stream.py +++ b/cocotbext/axi/stream.py @@ -146,18 +146,17 @@ class StreamSource(object): await RisingEdge(self.clock) if (ready_sample and valid_sample) or (not valid_sample): - if self.drive_obj: - if not self.pause: - self.bus.drive(self.drive_obj) - self.drive_obj = None - self.drive_sync.set() - if self.valid is not None: - self.valid <= 1 + if self.drive_obj and not self.pause: + self.bus.drive(self.drive_obj) + self.drive_obj = None + self.drive_sync.set() + if self.valid is not None: + self.valid <= 1 self.active = True else: if self.valid is not None: self.valid <= 0 - self.active = False + self.active = bool(self.drive_obj) async def _run(self): while True: