Skip to content

Commit 7ca1477

Browse files
committed
wip
1 parent 25330bf commit 7ca1477

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

nmigen/sim/_pycoro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def reset(self):
3333

3434
def src_loc(self):
3535
coroutine = self.coroutine
36-
while coroutine.gi_yieldfrom is not None:
36+
while coroutine.gi_yieldfrom is not None and inspect.isgenerator(coroutine.gi_yieldfrom):
3737
coroutine = coroutine.gi_yieldfrom
3838
if inspect.isgenerator(coroutine):
3939
frame = coroutine.gi_frame

nmigen/sim/cxxsim.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,15 @@ def reset(self):
118118
def _real_step(self):
119119
while True:
120120
self._state.eval()
121+
122+
ran = False
121123
for process in self._processes:
122124
if process.runnable:
123125
process.runnable = False
124126
process.run()
127+
ran = True
125128

126-
if not self._state.commit():
129+
if not self._state.commit() and not ran:
127130
break
128131

129132
for vcd_writer, vcd_file in self._vcd_writers:

0 commit comments

Comments
 (0)