Avoid use of "trace_bit" to print trace bits
authorCesar Strauss <cestrauss@gmail.com>
Wed, 18 Nov 2020 10:55:31 +0000 (07:55 -0300)
committerCesar Strauss <cestrauss@gmail.com>
Wed, 18 Nov 2020 10:55:31 +0000 (07:55 -0300)
It turns out, "trace_bit" really depends on the "trace_bits" context to
update flags. Use the normal "trace" call instead.

src/nmutil/gtkw.py

index 83a7db1722e3c3362d3c491a9f6824ffd368a883..8f15bd8d0313f0475f76c6b5e17b0aec6624d1ab 100644 (file)
@@ -145,12 +145,10 @@ def write_gtkw(gtkw_name, vcd_name, gtkw_dom, gtkw_style=None,
                     node_color = colors.get(node_style.get('color'))
                     node_base = node_style.get('base')
                     display = node_style.get('display')
-                    if 'bit' not in node_style:
-                        gtkw.trace(signal_name, color=node_color,
-                                   datafmt=node_base, alias=display)
-                    else:
+                    if 'bit' in node_style:
                         bit = node_style['bit']
-                        gtkw.trace_bit(bit, signal_name, color=node_color,
-                                       alias=display)
+                        signal_name = f'({bit}){signal_name}'
+                    gtkw.trace(signal_name, color=node_color,
+                               datafmt=node_base, alias=display)
 
         walk(gtkw_dom, root_style)