From c75ddaf6ab7a3aee813eb632172283b70ecf07c5 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 8 Sep 2023 01:16:52 +0200 Subject: [PATCH] hilight_parent_pins(): if two or more child pins are attached to the same parent net hilighting one of these child pins will not propagate to parent if the unhilight child pin comes after the hilight pin. This is now fixed. Going up in hierarchy will never clear parent hilights. It is recommended to clear all probes before tracking child pin propagation with hilights upstream. --- src/hilight.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/hilight.c b/src/hilight.c index de4f7f86..f35570d8 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -501,8 +501,8 @@ void hilight_parent_pins(void) * this is used when descending into symbols created from generators */ if(inst_number == -1) inst_number = 1; - dbg(1, "hilight_parent_pins(): previous_instance=%d\n", xctx->previous_instance[xctx->currsch]); - dbg(1, "hilight_parent_pins(): inst_number=%d\n", inst_number); + dbg(0, "hilight_parent_pins(): previous_instance=%d\n", xctx->previous_instance[xctx->currsch]); + dbg(0, "hilight_parent_pins(): inst_number=%d\n", inst_number); rects = (xctx->inst[i].ptr+ xctx->sym)->rects[PINLAYER]; @@ -511,13 +511,15 @@ void hilight_parent_pins(void) char *p_n_s1, *p_n_s2; if(!xctx->inst[i].node || !xctx->inst[i].node[j]) continue; my_strdup(_ALLOC_ID_, &net_node, expandlabel(xctx->inst[i].node[j], &net_mult)); - dbg(1, "hilight_parent_pins(): net_node=%s\n", net_node); + dbg(0, "hilight_parent_pins(): net_node=%s\n", net_node); pin_name = get_tok_value((xctx->inst[i].ptr+ xctx->sym)->rect[PINLAYER][j].prop_ptr,"name",0); + dbg(0, "pin_name=%s\n", pin_name); if(!pin_name[0]) continue; my_strdup(_ALLOC_ID_, &pin_node, expandlabel(pin_name, &mult)); - dbg(1, "hilight_parent_pins(): pin_node=%s\n", pin_node); + dbg(0, "hilight_parent_pins(): pin_node=%s\n", pin_node); p_n_s1 = pin_node; + dbg(0, "p_n_s1=%s\n", p_n_s1); for(k = 1; k<=mult; ++k) { xctx->currsch++; /* entry = bus_hilight_hash_lookup(find_nth(pin_node, ",", k), 0, XLOOKUP); */ @@ -526,13 +528,22 @@ void hilight_parent_pins(void) xctx->currsch--; if(entry) { + dbg(0, "found hilight entry in child: %s\n", entry->token); bus_hilight_hash_lookup(find_nth(net_node, ",", ((inst_number - 1) * mult + k - 1) % net_mult + 1), entry->value, XINSERT); } else { - bus_hilight_hash_lookup(find_nth(net_node, ",", - ((inst_number - 1) * mult + k - 1) % net_mult + 1), 0, XDELETE); + /* This causes deleting a parent node hilight if two or more child pins + * (where only one or some of them hilighted) are attached to the same parent net + * Commenting out below two lines will never unhilight parent nets when going up + * in the hierarchy. If you want to see how child pins propagate upstream + * you should unhilight all net probes, hilight the desired child pins and then go up */ + + /* + * bus_hilight_hash_lookup(find_nth(net_node, ",", + * ((inst_number - 1) * mult + k - 1) % net_mult + 1), 0, XDELETE); + */ } } }