From d17ee3decbcda4e0a1b5fe326eb275183b75de8c Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 21 Dec 2018 10:25:28 +0000 Subject: [PATCH] back.pysim: fix an issue with too few funclet slots. --- nmigen/back/pysim.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index 7baa654..2d86d0a 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -437,6 +437,8 @@ class Simulator: self._domain_signals[domain] = bitarray() self._domain_signals[domain].append(False) + self._funclets.append(set()) + self._domain_triggers.append(None) if self._vcd_writer: self._vcd_signals.append(set()) @@ -520,10 +522,7 @@ class Simulator: funclet = compiler(statements) def add_funclet(signal, funclet): - signal_slot = self._signal_slots[signal] - while len(self._funclets) <= signal_slot: - self._funclets.append(set()) - self._funclets[signal_slot].add(funclet) + self._funclets[self._signal_slots[signal]].add(funclet) for signal in compiler.sensitivity: add_funclet(signal, funclet) -- 2.30.2