From 9b34d99e512655c88536296d218ec95527db3c18 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 7 Jul 2012 20:13:05 +0200 Subject: [PATCH] emphasize the adms3 `U' device hijack --- src/spicelib/parser/inp.h | 3 +++ src/spicelib/parser/inp2u.c | 21 ++++++++++++++------- src/spicelib/parser/inppas2.c | 4 ++++ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/spicelib/parser/inp.h b/src/spicelib/parser/inp.h index 9c679d9a7..d41b84b94 100644 --- a/src/spicelib/parser/inp.h +++ b/src/spicelib/parser/inp.h @@ -33,6 +33,9 @@ void INP2W(CKTcircuit *ckt, INPtables *tab, card *current); void INP2Y(CKTcircuit *ckt, INPtables *tab, card *current); void INP2Z(CKTcircuit *ckt, INPtables *tab, card *current); +#if ADMS >= 3 +void INP2adms(CKTcircuit *ckt, INPtables *tab, card *current); +#endif /* ptfuncs.c */ diff --git a/src/spicelib/parser/inp2u.c b/src/spicelib/parser/inp2u.c index 18e704016..ae489801b 100644 --- a/src/spicelib/parser/inp2u.c +++ b/src/spicelib/parser/inp2u.c @@ -11,10 +11,10 @@ Author: 1988 Thomas L. Quarles #include "ngspice/fteext.h" #include "inp.h" -void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) -{ #if ADMS >= 3 +void INP2adms(CKTcircuit *ckt, INPtables * tab, card * current) +{ /* Uname ... [param1=] [param1=] ... */ char *line; /* the part of the current line left to parse */ @@ -29,7 +29,7 @@ void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) double leadval; /* actual value of unlabeled number */ #ifdef TRACE - printf("INP2U: Parsing '%s'\n", current->line); + printf("INP2adms: Parsing '%s'\n", current->line); #endif nsize = 0; @@ -43,7 +43,7 @@ void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) while(!INPlookMod(name) && (*line != '\0')) { #ifdef TRACE - printf("INP2U: found node %s\n",name); + printf("INP2adms: found node %s\n",name); #endif nsize++; node=TREALLOC(CKTnode*,node,nsize); @@ -56,7 +56,7 @@ void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) thismodel = NULL; INPinsert(&name, tab); #ifdef TRACE - printf("INP2U: found dynamic model %s\n",name); + printf("INP2adms: found dynamic model %s\n",name); #endif current->error = INPgetMod(ckt, name, &thismodel, tab); if (thismodel == NULL) { @@ -72,15 +72,21 @@ void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) } PARSECALL((&line, ckt, thismodel->INPmodType, fast, &leadval, &waslead, tab)); #ifdef TRACE - printf("INP2U: Looking up model done\n"); + printf("INP2adms: Looking up model done\n"); #endif } } else { fprintf(stderr, "Unable to find definition of model %s\n", name); controlled_exit(EXIT_BAD); } +} + #else + + +void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) +{ /* Uname [l=] [n=] */ int mytype; /* the type my lookup says URC is */ @@ -141,5 +147,6 @@ void INP2U(CKTcircuit *ckt, INPtables * tab, card * current) IFC(bindNode, (ckt, fast, 2, node2)); IFC(bindNode, (ckt, fast, 3, node3)); PARSECALL((&line, ckt, type, fast, &leadval, &waslead, tab)); -#endif } + +#endif /* ADMS */ diff --git a/src/spicelib/parser/inppas2.c b/src/spicelib/parser/inppas2.c index c16b879fa..0718a6247 100644 --- a/src/spicelib/parser/inppas2.c +++ b/src/spicelib/parser/inppas2.c @@ -221,7 +221,11 @@ void INPpas2(CKTcircuit *ckt, card * data, INPtables * tab, TSKtask *task) case 'U': /* Uname [l=] [n=] */ +#if ADMS >= 3 + INP2adms(ckt, tab, current); +#else INP2U(ckt, tab, current); +#endif break; /* Kspice addition - saj */