From 8aa62f2efa788c8f72e9f558bfcc2befc86b6a33 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 9 Feb 2024 18:39:09 +0100 Subject: [PATCH] parametric models in subcircuits (model=@mod in instances, mod=xxx in parent instantiation) --- src/actions.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/actions.c b/src/actions.c index bf2ace20..796fc87f 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1863,6 +1863,7 @@ void get_additional_symbols(int what) Int_hashentry *found; Int_hashtable sym_table = {NULL, 0}; struct stat buf; + int is_gen = 0; if(what == 1) { /* start */ int_hash_init(&sym_table, HASHSIZE); @@ -1901,7 +1902,10 @@ void get_additional_symbols(int what) ignore_schematic = !strcmp(default_schematic, "ignore"); dbg(1, "get_additional_symbols(): inst=%d, sch=%s\n", i, sch); - if(is_generator(sch)) { + + is_gen = is_generator(sch); + + if(is_gen) { my_strdup2(_ALLOC_ID_, &sym, sch); dbg(1, "get_additional_symbols(): generator\n"); } else { @@ -1928,7 +1932,7 @@ void get_additional_symbols(int what) subst_token(xctx->sym[j].prop_ptr, "default_schematic", NULL)); /* delete attribute */ } /* if symbol has no corresponding schematic file use symbol base schematic */ - if(symbol_base_sch[0]) { + if(!is_gen && symbol_base_sch[0]) { my_strdup(_ALLOC_ID_, &xctx->sym[j].prop_ptr, subst_token(xctx->sym[j].prop_ptr, "schematic", symbol_base_sch)); }