add @symref (in addition to @symname) substitution in spice_sym_def processing

This commit is contained in:
stefan schippers 2024-06-21 01:03:08 +02:00
parent fa4d4a0970
commit 36c79f262c
2 changed files with 5 additions and 1 deletions

View File

@ -1977,10 +1977,12 @@ void get_additional_symbols(int what)
my_strdup2(_ALLOC_ID_, &templ, get_tok_value(symptr->prop_ptr, "template", 0));
my_mstrcat(_ALLOC_ID_, &symname_attr, "symname=", get_cell(sym, 0), NULL);
my_mstrcat(_ALLOC_ID_, &symname_attr, " symref=", abs_sym_path(get_sym_name(i, 9999, 1), ""), NULL);
my_strdup(_ALLOC_ID_, &spice_sym_def,
translate3(spice_sym_def, 1, xctx->inst[i].prop_ptr,
templ,
symname_attr));
dbg(1, "get_additional_symbols(): spice_sym_def=%s\n", spice_sym_def);
my_free(_ALLOC_ID_, &templ);
my_free(_ALLOC_ID_, &symname_attr);
/* if instance symbol has default_schematic set to ignore copy the symbol anyway, since

View File

@ -1845,12 +1845,14 @@ static int has_included_subcircuit(int inst, int symbol, char **result)
my_strdup2(_ALLOC_ID_, &symname, xctx->sym[symbol].name);
}
my_mstrcat(_ALLOC_ID_, &symname_attr, "symname=", get_cell(symname, 0), NULL);
my_mstrcat(_ALLOC_ID_, &symname_attr, " symref=", abs_sym_path(get_sym_name(inst, 9999, 1), ""), NULL);
translated_sym_def = translate3(spice_sym_def, 1, xctx->inst[inst].prop_ptr,
templ,
symname_attr);
strtolower(symname);
dbg(1, "has_included_subcircuit(): translated_sym_def=%s\n", translated_sym_def);
tclvareval("has_included_subcircuit {", get_cell(symname, 0), "} {",
translated_sym_def, "}", NULL);
translated_sym_def, "}", NULL);
my_free(_ALLOC_ID_, &templ);
my_free(_ALLOC_ID_, &symname);
my_free(_ALLOC_ID_, &symname_attr);