From 6c643ef6266b3486a893bbb1f477e8241f3bd909 Mon Sep 17 00:00:00 2001 From: Cesar Strauss Date: Tue, 17 Nov 2020 07:53:37 -0300 Subject: [PATCH] Add support for displaying individual bits from wide signals --- src/nmutil/gtkw.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/nmutil/gtkw.py b/src/nmutil/gtkw.py index ff1b237..83a7db1 100644 --- a/src/nmutil/gtkw.py +++ b/src/nmutil/gtkw.py @@ -35,6 +35,7 @@ def write_gtkw(gtkw_name, vcd_name, gtkw_dom, gtkw_style=None, * base: numerical base for value display * display: alternate text to display in the signal pane * comment: comment to display in the signal pane + * bit: select a bit from a wide signal. MSB is zero, unfortunately **gtkw_dom format** @@ -144,7 +145,12 @@ 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') - gtkw.trace(signal_name, color=node_color, - datafmt=node_base, alias=display) + if 'bit' not in node_style: + gtkw.trace(signal_name, color=node_color, + datafmt=node_base, alias=display) + else: + bit = node_style['bit'] + gtkw.trace_bit(bit, signal_name, color=node_color, + alias=display) walk(gtkw_dom, root_style) -- 2.30.2