From 36c79f262c5662bb50620cddc9ce21a0c1109df2 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 21 Jun 2024 01:03:08 +0200 Subject: [PATCH] add @symref (in addition to @symname) substitution in spice_sym_def processing --- src/actions.c | 2 ++ src/token.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/actions.c b/src/actions.c index 774b86a1..9741dd52 100644 --- a/src/actions.c +++ b/src/actions.c @@ -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 diff --git a/src/token.c b/src/token.c index 892b0455..9116c953 100644 --- a/src/token.c +++ b/src/token.c @@ -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);