do not process @#n:resolved_net attributes if net_name=true not set on symbol or instance and option "show netnames on symbol pins/floaters" is not enabled

This commit is contained in:
stefan schippers 2023-05-28 08:13:01 +02:00
parent 5043b14921
commit 620217788f
2 changed files with 16 additions and 8 deletions

View File

@ -3277,8 +3277,8 @@ const char *translate(int inst, const char* s)
if(!pin_attr_value && is_net_name) {
char *instprop = xctx->inst[inst].prop_ptr;
char *symprop = (xctx->inst[inst].ptr + xctx->sym)->prop_ptr;
if(s_pnetname && (!strcmp(get_tok_value(instprop, "net_name", 0), "true") ||
!strcmp(get_tok_value(symprop, "net_name", 0), "true"))) {
if(s_pnetname && (!strcmp(get_tok_value(symprop, "net_name", 0), "true") ||
!strcmp(get_tok_value(instprop, "net_name", 0), "true"))) {
prepare_netlist_structs(0);
my_strdup2(_ALLOC_ID_, &pin_attr_value,
xctx->inst[inst].node && xctx->inst[inst].node[n] ? xctx->inst[inst].node[n] : "?");
@ -3291,12 +3291,20 @@ const char *translate(int inst, const char* s)
/* @#n:resolved_net attribute (n = pin number or name) will translate to hierarchy-resolved net */
if(!pin_attr_value && !strcmp(pin_attr, "resolved_net")) {
char *rn = NULL;
prepare_netlist_structs(0);
if(xctx->inst[inst].node && xctx->inst[inst].node[n]) {
rn = resolved_net(xctx->inst[inst].node[n]);
char *instprop = xctx->inst[inst].prop_ptr;
char *symprop = (xctx->inst[inst].ptr + xctx->sym)->prop_ptr;
dbg(1, "translate(): resolved_net: %s, symbol %s\n", xctx->current_name, xctx->inst[inst].name);
if(s_pnetname && (!strcmp(get_tok_value(symprop, "net_name", 0), "true") ||
!strcmp(get_tok_value(instprop, "net_name", 0), "true"))) {
prepare_netlist_structs(0);
if(xctx->inst[inst].node && xctx->inst[inst].node[n]) {
rn = resolved_net(xctx->inst[inst].node[n]);
}
my_strdup2(_ALLOC_ID_, &pin_attr_value, rn ? rn : "?");
if(rn) my_free(_ALLOC_ID_, &rn);
} else {
my_strdup2(_ALLOC_ID_, &pin_attr_value, "");
}
my_strdup2(_ALLOC_ID_, &pin_attr_value, rn ? rn : "?");
if(rn) my_free(_ALLOC_ID_, &rn);
}
if(!pin_attr_value ) my_strdup(_ALLOC_ID_, &pin_attr_value, "--UNDEF--");

View File

@ -5881,7 +5881,7 @@ proc build_widgets { {topwin {} } } {
-command {
input_line "Enter Symbol width ($symbol_width)" "set symbol_width" $symbol_width
}
$topwin.menubar.option.menu add checkbutton -label "Show net names on symbol pins" -variable show_pin_net_names \
$topwin.menubar.option.menu add checkbutton -label "Show net names on symbol pins/floaters" -variable show_pin_net_names \
-command {
xschem update_all_sym_bboxes
xschem redraw