From c5705e28fc3542c557e8393ce095fe3876403d87 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sat, 3 May 2025 12:02:22 +0200 Subject: [PATCH] resolved_net(): resolve multiple levels of port-by-attribute propagation --- src/hilight.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hilight.c b/src/hilight.c index 4fc02baa..c3520bb7 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -2101,14 +2101,16 @@ char *resolved_net(const char *net) n_s1 = NULL; my_strdup2(_ALLOC_ID_, &resolved_net, net_name); dbg(1, "resolved_net(): resolved_net=%s\n", resolved_net); - if(xctx->currsch > 0) { /* check if net passed by attribute instead of by port */ - const char *ptr = get_tok_value(xctx->hier_attr[xctx->currsch - 1].prop_ptr, resolved_net, 0); + while(level > start_level) { /* check if net passed by attribute instead of by port */ + const char *ptr = get_tok_value(xctx->hier_attr[level - 1].prop_ptr, resolved_net, 0); if(ptr && ptr[0]) { my_strdup2(_ALLOC_ID_, &resolved_net, ptr); - level--; - dbg(1, "lcc[%d].prop_ptr=%s\n", xctx->currsch - 1, xctx->hier_attr[xctx->currsch - 1].prop_ptr); + dbg(1, "lcc[%d].prop_ptr=%s\n", level - 1, xctx->hier_attr[level - 1].prop_ptr); dbg(1, "resolved_net(): resolved_net=%s\n", resolved_net); + } else { + break; } + level--; } while(level > start_level) { /* get net from parent nets attached to port if resolved_net is a port */ entry = str_hash_lookup(&xctx->portmap[level], resolved_net, NULL, XLOOKUP);