back.pysim: continue running simulator processes until they suspend.
authorwhitequark <whitequark@whitequark.org>
Tue, 18 Dec 2018 03:05:16 +0000 (03:05 +0000)
committerwhitequark <whitequark@whitequark.org>
Tue, 18 Dec 2018 03:05:16 +0000 (03:05 +0000)
nmigen/back/pysim.py

index 1871389ae47988da824adc04f19fc740330f88df..5cb7ebf2173be136a37b338ea72a7543d735d04a 100644 (file)
@@ -554,10 +554,12 @@ class Simulator:
                         interval = cmd.interval
                     self._wait_deadline[process] = self._timestamp + interval
                     self._suspended.add(process)
+                    break
 
                 elif isinstance(cmd, Tick):
                     self._wait_tick[process] = cmd.domain
                     self._suspended.add(process)
+                    break
 
                 elif isinstance(cmd, Passive):
                     self._passive.add(process)
@@ -594,7 +596,7 @@ class Simulator:
                     raise TypeError("Received unsupported command '{!r}' from process '{}'"
                                     .format(cmd, self._name_process(process)))
 
-                break
+                cmd = process.send(None)
 
         except StopIteration:
             self._processes.remove(process)