From: whitequark Date: Thu, 6 Feb 2020 17:19:47 +0000 (+0000) Subject: back.pysim: emit toplevel inputs in VCD files as well. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c1b11bb810ac7c6a686ccdc4ce7c81c66b624e7;p=nmigen.git 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. --- 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)