From 654722ce144b158770d673a8413dc4d055b17ae3 Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 14 Dec 2018 13:43:08 +0000 Subject: [PATCH] back.pysim: add gtkw traces even more robustly. --- nmigen/back/pysim.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index 469ef4b..c7e3f0f 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -556,16 +556,19 @@ class Simulator: gtkw_save.treeopen("top") gtkw_save.zoom_markers(math.log(self._epsilon / self._fastest_clock) - 14) - for domain, cd in self._domains.items(): - with gtkw_save.group("d.{}".format(domain)): - if cd.rst is not None: - gtkw_save.trace(self._vcd_names[cd.rst]) - gtkw_save.trace(self._vcd_names[cd.clk]) - - for signal in self._gtkw_signals: + def add_trace(signal, **kwargs): if signal in self._vcd_names: if len(signal) > 1: suffix = "[{}:0]".format(len(signal) - 1) else: suffix = "" - gtkw_save.trace(self._vcd_names[signal] + suffix) + gtkw_save.trace(self._vcd_names[signal] + suffix, **kwargs) + + for domain, cd in self._domains.items(): + with gtkw_save.group("d.{}".format(domain)): + if cd.rst is not None: + add_trace(cd.rst) + add_trace(cd.clk) + + for signal in self._gtkw_signals: + add_trace(signal) -- 2.30.2