back.pysim: fix an off-by-1 in add_sync_process().
authorwhitequark <whitequark@whitequark.org>
Tue, 18 Dec 2018 04:43:04 +0000 (04:43 +0000)
committerwhitequark <whitequark@whitequark.org>
Tue, 18 Dec 2018 04:43:04 +0000 (04:43 +0000)
nmigen/back/pysim.py

index 65357bf233141ace0dc4234b6bd212280a61cea5..5a6b5ade9656252970dd0978e33887f03af82b2a 100644 (file)
@@ -342,10 +342,11 @@ class Simulator:
             try:
                 result = None
                 while True:
+                    self._process_loc[sync_process] = self._name_process(process)
+                    result = process.send(result)
                     if result is None:
                         result = Tick(domain)
-                    self._process_loc[sync_process] = self._name_process(process)
-                    result = process.send((yield result))
+                    result = yield result
             except StopIteration:
                 pass
         sync_process = sync_process()