pysim.back: fix add_sync_process wrapper to handle signals correctly.
authorwhitequark <whitequark@whitequark.org>
Fri, 14 Dec 2018 16:21:53 +0000 (16:21 +0000)
committerwhitequark <whitequark@whitequark.org>
Fri, 14 Dec 2018 16:21:53 +0000 (16:21 +0000)
nmigen/back/pysim.py

index ba32dbf2c858f80dbf7be6f728065d49749e9dc9..f0bfba101370af2b1723eaa8c778e9daf58a729f 100644 (file)
@@ -243,7 +243,9 @@ class Simulator:
             try:
                 result = process.send(None)
                 while True:
-                    result = process.send((yield (result or Tick(domain))))
+                    if result is None:
+                        result = Tick(domain)
+                    result = process.send((yield result))
             except StopIteration:
                 pass
         self.add_process(sync_process())