From: Cesar Strauss Date: Tue, 17 Nov 2020 10:53:37 +0000 (-0300) Subject: Add support for displaying individual bits from wide signals X-Git-Tag: 24jan2021_ls180~7 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c643ef6266b3486a893bbb1f477e8241f3bd909;p=nmutil.git Add support for displaying individual bits from wide signals --- 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)