subckt.c, do not put model names into numparam hash table xpressn.c, re-enable error message to alert name redefinition

This commit is contained in:
h_vogt 2016-04-17 16:34:20 +02:00 committed by rlar
parent 85fdadc683
commit c5d4e3220d
2 changed files with 13 additions and 7 deletions

View File

@ -528,8 +528,17 @@ nupa_define(dico_t *dico,
Subcircuit expansion is o.k., we have to deal with this numparam Subcircuit expansion is o.k., we have to deal with this numparam
behaviour later. (H. Vogt 090426) behaviour later. (H. Vogt 090426)
*/ */
if (0) message(dico, "%s is already used,\n cannot be redefined\n", t);
message(dico, "%s: cannot redefine\n", t); #if 0
if ((c == 'U') && (tpe == 'U'))
message(dico, "%s is already used as subcircuit name,\n cannot be used for another subcircuit\n", t);
else if ((c == 'U') && (tpe == 'O'))
message(dico, "%s is already used as subcircuit name,\n cannot be used for model\n", t);
else if ((c == 'O') && (tpe == 'U'))
message(dico, "%s is already used as model name,\n cannot be used for subcircuit\n", t);
else if ((c == 'O') && (tpe == 'O'))
message(dico, "%s is already used as model name,\n cannot be reused for another model\n", t);
#endif
} }
} }

View File

@ -233,13 +233,10 @@ inp_subcktexpand(struct line *deck) {
#endif #endif
ok = nupa_signal(NUPADECKCOPY, NULL); ok = nupa_signal(NUPADECKCOPY, NULL);
/* get the subckt/model names from the deck */ /* get the subckt names from the deck */
for (c = deck; c; c = c->li_next) { /* first Numparam pass */ for (c = deck; c; c = c->li_next) /* first Numparam pass */
if (ciprefix(".subckt", c->li_line)) if (ciprefix(".subckt", c->li_line))
nupa_scan(c->li_line, c->li_linenum, TRUE); nupa_scan(c->li_line, c->li_linenum, TRUE);
if (ciprefix(".model", c->li_line))
nupa_scan(c->li_line, c->li_linenum, FALSE);
}
/* now copy instances */ /* now copy instances */
for (c = deck; c; c = c->li_next) /* first Numparam pass */ for (c = deck; c; c = c->li_next) /* first Numparam pass */
c->li_line = nupa_copy(c->li_line, c->li_linenum); c->li_line = nupa_copy(c->li_line, c->li_linenum);