From 65702719e821f0578ef2754b141c287ca08f73f5 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 18 Dec 2018 04:43:04 +0000 Subject: [PATCH] back.pysim: fix an off-by-1 in add_sync_process(). --- nmigen/back/pysim.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index 65357bf..5a6b5ad 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -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() -- 2.30.2