From 9c1b11bb810ac7c6a686ccdc4ce7c81c66b624e7 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 6 Feb 2020 17:19:47 +0000 Subject: [PATCH] back.pysim: emit toplevel inputs in VCD files as well. Before this commit, only signals driven from fragments (in practice, everything except toplevel inputs) would get written to a VCD file. Not having toplevel inputs in the dump made debugging ~impossible. After this commit, all signals the fragment refers to get written to a VCD file. (More specifically, all signals the compiler assigns an index to, i.e. signals the generated code reads or writes.) Fixes #280. --- nmigen/back/pysim.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index 63455fc..0187a07 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -704,9 +704,6 @@ class _FragmentCompiler: self.signal_names[signal].add(hierarchical_signal_name) for domain_name, domain_signals in fragment.drivers.items(): - for domain_signal in domain_signals: - add_signal_name(domain_signal) - domain_stmts = LHSGroupFilter(domain_signals)(fragment.statements) domain_process = _CompiledProcess(self.state, comb=domain_name is None, name=".".join((*hierarchy, "<{}>".format(domain_name or "comb")))) @@ -762,6 +759,9 @@ class _FragmentCompiler: processes.add(domain_process) + for used_signal in domain_process.context.indexes: + add_signal_name(used_signal) + for subfragment_index, (subfragment, subfragment_name) in enumerate(fragment.subfragments): if subfragment_name is None: subfragment_name = "U${}".format(subfragment_index) -- 2.30.2