From 9282ea670e117ba90f2ebdb493b94d164c56ce5a Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 31 May 2024 11:50:02 +0200 Subject: [PATCH] fix bus_tap netlisting with bus pin (pin # 1) connected to unnamed net. If Tap pin (pin # 0) was already named as #net... (unnamed net ) delete and take name from bus pin and tap index --- src/netlist.c | 5 ++++- xschem_library/examples/test_bus_tap.sch | 7 +------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/netlist.c b/src/netlist.c index 739704ca..99fe80b4 100644 --- a/src/netlist.c +++ b/src/netlist.c @@ -1160,7 +1160,9 @@ static int instcheck(int n, int p) if(rects > 1 && bus_tap && p == 1) { char *node_base_name = NULL; const char *tap; - dbg(1, "instcheck: bus tap node: %s\n", inst[n].node[p]); + if(inst[n].node && inst[n].node[0] && inst[n].node[0][0] == '#') { + my_free(_ALLOC_ID_, &inst[n].node[0]); /* bus tap forces net name on pin 0 (the tap) */ + } /* delete any previously set unnamed net */ if(!inst[n].node[0]) { /* still unnamed */ /* tap = get_tok_value(inst[n].prop_ptr, "lab", 0); */ tap = inst[n].lab; @@ -1194,6 +1196,7 @@ static int instcheck(int n, int p) } else { if(for_netlist>0) err |= signal_short("Bus tap", inst[n].node[p], inst[n].node[0]); } + dbg(1, "instcheck: bus tap node: p=%d, %s, tap=%s\n", p, inst[n].node[p], inst[n].node[0]); my_free(_ALLOC_ID_, &node_base_name); } diff --git a/xschem_library/examples/test_bus_tap.sch b/xschem_library/examples/test_bus_tap.sch index fd2f75be..e97a4834 100644 --- a/xschem_library/examples/test_bus_tap.sch +++ b/xschem_library/examples/test_bus_tap.sch @@ -223,12 +223,7 @@ m=1 } C {title.sym} 160 -30 0 0 {name=l9 -author="tcleval(Stefan Schippers[ - if \{$show_pin_net_names == 0\} \{ - set show_pin_net_names 1 - xschem update_all_sym_bboxes - \}] -)"} +author="Stefan Schippers"} C {lab_pin.sym} 170 -790 0 0 {name=p11 sig_type=std_logic lab=DIN[15..0] } C {bus_tap.sym} 270 -790 1 0 {name=l10 lab=0