Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekcyjna committed Nov 19, 2023
1 parent 6bbeb5a commit 504623a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/common/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _wrapping_function(self):
# forward to amaranth
yield
# Do early forward to amaranth
if not isinstance(command, CoreblocksCommand):
elif not isinstance(command, CoreblocksCommand):
# Pass everything else to amaranth simulator without modifications
response = yield command
elif isinstance(command, Now):
Expand Down Expand Up @@ -196,7 +196,8 @@ def run_until_with_callbacks(self, deadline, *, run_passive=False):
"""
# Convert deadline in seconds into internal amaranth 1 ps units
deadline = deadline * 1e12
while cast(Any, self)._engine.now < deadline and (self.advance() or run_passive):
assert cast(Any,self)._engine.now <= deadline
while (self.advance() or run_passive) and cast(Any,self)._engine.now < deadline:
for callback in self.one_shot_callbacks:
callback()
self.one_shot_callbacks.clear()
Expand Down

0 comments on commit 504623a

Please sign in to comment.