diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index 1a1756b54..aa117c116 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -177,9 +177,20 @@ struct admsaux { int n_admsaux; struct admsaux *a_admsaux; +unsigned int adms_candidates; + +void +mark_adms_candidates(char c) +{ + if('A' <= c && c <= 'Z') + adms_candidates |= (1 << (c - 'A')); +} + void mark_adms(int type) { + mark_adms_candidates('U'); + if(type >= n_admsaux) { int i; a_admsaux = TREALLOC(struct admsaux, a_admsaux, type+1); diff --git a/src/spicelib/parser/inppas2.c b/src/spicelib/parser/inppas2.c index 271cb857b..56636ced5 100644 --- a/src/spicelib/parser/inppas2.c +++ b/src/spicelib/parser/inppas2.c @@ -96,6 +96,14 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) if(islower(c)) c = (char) toupper(c); + extern unsigned int adms_candidates; + if('A' <= c && c <= 'Z' && + ((adms_candidates >> (c - 'A')) & 1) && + INP2tryadms(ckt, tab, current)) { + INP2tryadms_do(ckt, tab, current); + continue; + } + switch (c) { case ' ': @@ -223,10 +231,7 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) case 'U': /* Uname [l=] [n=] */ - if(INP2tryadms(ckt, tab, current)) - INP2tryadms_do(ckt, tab, current); - else - INP2U(ckt, tab, current); + INP2U(ckt, tab, current); break; /* Kspice addition - saj */