diff --git a/src/include/ngspice/cktdefs.h b/src/include/ngspice/cktdefs.h index c0a32582d..d2ed108da 100644 --- a/src/include/ngspice/cktdefs.h +++ b/src/include/ngspice/cktdefs.h @@ -111,6 +111,7 @@ struct CKTcircuit { double *CKTrhsOld; /* previous rhs value for convergence testing */ double *CKTfvk ; /* KCL Verification array */ + int *CKTnodeIsLinear ; /* Flag to indicate if a node is linear or non-linear */ double *CKTrhsSpare; /* spare rhs value for reordering */ double *CKTirhs; /* current rhs value - being loaded (imag) */ diff --git a/src/include/ngspice/devdefs.h b/src/include/ngspice/devdefs.h index f86390dbb..03c668367 100644 --- a/src/include/ngspice/devdefs.h +++ b/src/include/ngspice/devdefs.h @@ -112,6 +112,10 @@ typedef struct SPICEdev { int *DEVinstSize; /* size of an instance */ int *DEVmodSize; /* size of a model */ + /* Francesco Lannutti */ + int (*DEVnodeIsNonLinear)(GENmodel *, CKTcircuit *) ; + /* Routine to declare a node as NonLinear */ + } SPICEdev; /* instance of structure for each possible type of device */ diff --git a/src/maths/ni/niconv.c b/src/maths/ni/niconv.c index 3736b891b..517b36e33 100644 --- a/src/maths/ni/niconv.c +++ b/src/maths/ni/niconv.c @@ -73,7 +73,7 @@ NIconvTest(CKTcircuit *ckt) for (i = 1 ; i <= size ; i++) { node = node->next ; - if (node->type == SP_VOLTAGE) + if ((node->type == SP_VOLTAGE) && (!ckt->CKTnodeIsLinear [i])) { #ifdef STEPDEBUG diff --git a/src/maths/ni/nireinit.c b/src/maths/ni/nireinit.c index 3c2641fc4..bfb6b4e50 100644 --- a/src/maths/ni/nireinit.c +++ b/src/maths/ni/nireinit.c @@ -21,10 +21,7 @@ Author: 1985 Thomas L. Quarles int NIreinit( CKTcircuit *ckt) { - int size; -#ifdef PREDICTOR - int i; -#endif + int i, size; size = SMPmatSize(ckt->CKTmatrix); CKALLOC(CKTrhs,size+1,double); @@ -34,6 +31,9 @@ NIreinit( CKTcircuit *ckt) CKALLOC(CKTirhs,size+1,double); CKALLOC(CKTirhsOld,size+1,double); CKALLOC(CKTirhsSpare,size+1,double); + CKALLOC(CKTnodeIsLinear,size+1,int); + for (i = 0 ; i <= size ; i++) + ckt->CKTnodeIsLinear [i] = 1 ; #ifdef PREDICTOR CKALLOC(CKTpred,size+1,double); for( i=0;i<8;i++) { diff --git a/src/spicelib/analysis/cktsetup.c b/src/spicelib/analysis/cktsetup.c index 446749094..2e6a05351 100644 --- a/src/spicelib/analysis/cktsetup.c +++ b/src/spicelib/analysis/cktsetup.c @@ -127,6 +127,20 @@ CKTsetup(CKTcircuit *ckt) /* gtri - end - Setup for adding rshunt option resistors */ #endif + + /** Marking node as Non-Linear when needed + * By default every node is Linear + */ + for (i = 0 ; i < DEVmaxnum ; i++) + { + if (DEVices[i] && DEVices[i]->DEVnodeIsNonLinear && ckt->CKThead[i]) + { + error = DEVices[i]->DEVnodeIsNonLinear (ckt->CKThead[i], ckt) ; + if (error) + return (error) ; + } + } + return(OK); } diff --git a/src/spicelib/devices/asrc/Makefile.am b/src/spicelib/devices/asrc/Makefile.am index 01f292d21..56895b0d7 100644 --- a/src/spicelib/devices/asrc/Makefile.am +++ b/src/spicelib/devices/asrc/Makefile.am @@ -17,6 +17,7 @@ libasrc_la_SOURCES = \ asrcinit.h \ asrcload.c \ asrcmdel.c \ + asrcnode.c \ asrcpar.c \ asrcpzld.c \ asrcset.c \ diff --git a/src/spicelib/devices/asrc/asrcext.h b/src/spicelib/devices/asrc/asrcext.h index a0a23f636..9b99b26d0 100644 --- a/src/spicelib/devices/asrc/asrcext.h +++ b/src/spicelib/devices/asrc/asrcext.h @@ -16,3 +16,4 @@ extern int ASRCacLoad(GENmodel*,CKTcircuit*); extern int ASRCsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int ASRCunsetup(GENmodel*,CKTcircuit*); extern int ASRCtemp(GENmodel*,CKTcircuit*); +extern int ASRCnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/asrc/asrcinit.c b/src/spicelib/devices/asrc/asrcinit.c index a9339deee..8d2c20281 100644 --- a/src/spicelib/devices/asrc/asrcinit.c +++ b/src/spicelib/devices/asrc/asrcinit.c @@ -73,7 +73,8 @@ SPICEdev ASRCinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &ASRCiSize, - /* DEVmodSize */ &ASRCmSize + /* DEVmodSize */ &ASRCmSize, + /* DEVnodeIsNonLinear */ ASRCnodeIsNonLinear }; diff --git a/src/spicelib/devices/asrc/asrcnode.c b/src/spicelib/devices/asrc/asrcnode.c new file mode 100644 index 000000000..d16066310 --- /dev/null +++ b/src/spicelib/devices/asrc/asrcnode.c @@ -0,0 +1,28 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "asrcdefs.h" +#include "ngspice/sperror.h" + +int +ASRCnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + ASRCmodel *model = (ASRCmodel *)inModel ; + ASRCinstance *here ; + + /* loop through all the ASRC models */ + for ( ; model != NULL ; model = model->ASRCnextModel) + { + /* loop through all the instances of the model */ + for (here = model->ASRCinstances ; here != NULL ; here = here->ASRCnextInstance) + { + ckt->CKTnodeIsLinear [here->ASRCposNode] = 0 ; + ckt->CKTnodeIsLinear [here->ASRCnegNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bjt/Makefile.am b/src/spicelib/devices/bjt/Makefile.am index 8b4ab3664..dd9f886ab 100644 --- a/src/spicelib/devices/bjt/Makefile.am +++ b/src/spicelib/devices/bjt/Makefile.am @@ -22,6 +22,7 @@ libbjt_la_SOURCES = \ bjtmask.c \ bjtmdel.c \ bjtmpar.c \ + bjtnode.c \ bjtnoise.c \ bjtparam.c \ bjtpzld.c \ diff --git a/src/spicelib/devices/bjt/bjtext.h b/src/spicelib/devices/bjt/bjtext.h index 69e5c3322..d4c6675a3 100644 --- a/src/spicelib/devices/bjt/bjtext.h +++ b/src/spicelib/devices/bjt/bjtext.h @@ -31,5 +31,6 @@ extern int BJTtrunc(GENmodel*,CKTcircuit*,double*); extern int BJTdisto(int,GENmodel*,CKTcircuit*); extern int BJTnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int BJTdSetup(GENmodel*, register CKTcircuit*); +extern int BJTnodeIsNonLinear (GENmodel *, CKTcircuit *) ; #endif diff --git a/src/spicelib/devices/bjt/bjtinit.c b/src/spicelib/devices/bjt/bjtinit.c index c412225b9..47df76b69 100644 --- a/src/spicelib/devices/bjt/bjtinit.c +++ b/src/spicelib/devices/bjt/bjtinit.c @@ -72,7 +72,8 @@ SPICEdev BJTinfo = { /* description from struct IFdevice */ /* DEVacct */ NULL, #endif /* DEVinstSize */ &BJTiSize, - /* DEVmodSize */ &BJTmSize + /* DEVmodSize */ &BJTmSize, + /* DEVnodeIsNonLinear */ BJTnodeIsNonLinear }; diff --git a/src/spicelib/devices/bjt/bjtnode.c b/src/spicelib/devices/bjt/bjtnode.c new file mode 100644 index 000000000..69382e4cc --- /dev/null +++ b/src/spicelib/devices/bjt/bjtnode.c @@ -0,0 +1,31 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bjtdefs.h" +#include "ngspice/sperror.h" + +int +BJTnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BJTmodel *model = (BJTmodel *)inModel ; + BJTinstance *here ; + + /* loop through all the BJT models */ + for ( ; model != NULL ; model = model->BJTnextModel) + { + /* loop through all the instances of the model */ + for (here = model->BJTinstances ; here != NULL ; here = here->BJTnextInstance) + { + ckt->CKTnodeIsLinear [here->BJTcolPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->BJTbasePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->BJTemitPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->BJTsubstNode] = 0 ; + ckt->CKTnodeIsLinear [here->BJTsubstConNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim1/Makefile.am b/src/spicelib/devices/bsim1/Makefile.am index da088cf5b..64559702d 100644 --- a/src/spicelib/devices/bsim1/Makefile.am +++ b/src/spicelib/devices/bsim1/Makefile.am @@ -19,6 +19,7 @@ libbsim1_la_SOURCES = \ b1moscap.c \ b1mpar.c \ b1par.c \ + b1node.c \ b1noi.c \ b1pzld.c \ b1set.c \ diff --git a/src/spicelib/devices/bsim1/b1node.c b/src/spicelib/devices/bsim1/b1node.c new file mode 100644 index 000000000..8e871531b --- /dev/null +++ b/src/spicelib/devices/bsim1/b1node.c @@ -0,0 +1,30 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim1def.h" +#include "ngspice/sperror.h" + +int +B1nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + B1model *model = (B1model *)inModel ; + B1instance *here ; + + /* loop through all the BSIM1 models */ + for ( ; model != NULL ; model = model->B1nextModel) + { + /* loop through all the instances of the model */ + for (here = model->B1instances ; here != NULL ; here = here->B1nextInstance) + { + ckt->CKTnodeIsLinear [here->B1dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B1sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B1gNode] = 0 ; + ckt->CKTnodeIsLinear [here->B1bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim1/bsim1ext.h b/src/spicelib/devices/bsim1/bsim1ext.h index e859e3009..a21c5127b 100644 --- a/src/spicelib/devices/bsim1/bsim1ext.h +++ b/src/spicelib/devices/bsim1/bsim1ext.h @@ -29,3 +29,4 @@ extern int B1temp(GENmodel*,CKTcircuit*); extern int B1trunc(GENmodel*,CKTcircuit*,double*); extern int B1disto(int,GENmodel*,CKTcircuit*); extern int B1dSetup(GENmodel*, register CKTcircuit*); +extern int B1nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim1/bsim1init.c b/src/spicelib/devices/bsim1/bsim1init.c index 38cadef6e..fe123493c 100644 --- a/src/spicelib/devices/bsim1/bsim1init.c +++ b/src/spicelib/devices/bsim1/bsim1init.c @@ -72,7 +72,8 @@ SPICEdev B1info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &B1iSize, - /* DEVmodSize */ &B1mSize + /* DEVmodSize */ &B1mSize, + /* DEVnodeIsNonLinear */ B1nodeIsNonLinear }; diff --git a/src/spicelib/devices/bsim2/Makefile.am b/src/spicelib/devices/bsim2/Makefile.am index ea8ae9855..369eb1ecd 100644 --- a/src/spicelib/devices/bsim2/Makefile.am +++ b/src/spicelib/devices/bsim2/Makefile.am @@ -16,6 +16,7 @@ libbsim2_la_SOURCES = \ b2mdel.c \ b2moscap.c \ b2mpar.c \ + b2node.c \ b2noi.c \ b2par.c \ b2pzld.c \ diff --git a/src/spicelib/devices/bsim2/b2node.c b/src/spicelib/devices/bsim2/b2node.c new file mode 100644 index 000000000..51be6f94c --- /dev/null +++ b/src/spicelib/devices/bsim2/b2node.c @@ -0,0 +1,30 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim2def.h" +#include "ngspice/sperror.h" + +int +B2nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + B2model *model = (B2model *)inModel ; + B2instance *here ; + + /* loop through all the BSIM2 models */ + for ( ; model != NULL ; model = model->B2nextModel) + { + /* loop through all the instances of the model */ + for (here = model->B2instances ; here != NULL ; here = here->B2nextInstance) + { + ckt->CKTnodeIsLinear [here->B2dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B2sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B2gNode] = 0 ; + ckt->CKTnodeIsLinear [here->B2bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim2/bsim2ext.h b/src/spicelib/devices/bsim2/bsim2ext.h index ab7b800da..d819d8a38 100644 --- a/src/spicelib/devices/bsim2/bsim2ext.h +++ b/src/spicelib/devices/bsim2/bsim2ext.h @@ -25,3 +25,4 @@ extern int B2setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int B2unsetup(GENmodel*,CKTcircuit*); extern int B2temp(GENmodel*,CKTcircuit*); extern int B2trunc(GENmodel*,CKTcircuit*,double*); +extern int B2nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim2/bsim2init.c b/src/spicelib/devices/bsim2/bsim2init.c index 9af87b53c..e452176a3 100644 --- a/src/spicelib/devices/bsim2/bsim2init.c +++ b/src/spicelib/devices/bsim2/bsim2init.c @@ -72,7 +72,8 @@ SPICEdev B2info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &B2iSize, - /* DEVmodSize */ &B2mSize + /* DEVmodSize */ &B2mSize, + /* DEVnodeIsNonLinear */ B2nodeIsNonLinear }; diff --git a/src/spicelib/devices/bsim3/Makefile.am b/src/spicelib/devices/bsim3/Makefile.am index 2871b0f2e..1317c4c76 100644 --- a/src/spicelib/devices/bsim3/Makefile.am +++ b/src/spicelib/devices/bsim3/Makefile.am @@ -15,6 +15,7 @@ libbsim3_la_SOURCES = \ b3mask.c \ b3mdel.c \ b3mpar.c \ + b3node.c \ b3noi.c \ b3par.c \ b3pzld.c \ diff --git a/src/spicelib/devices/bsim3/b3node.c b/src/spicelib/devices/bsim3/b3node.c new file mode 100644 index 000000000..85624d864 --- /dev/null +++ b/src/spicelib/devices/bsim3/b3node.c @@ -0,0 +1,29 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim3def.h" +#include "ngspice/sperror.h" + +int +BSIM3nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM3model *model = (BSIM3model *)inModel ; + BSIM3instance *here ; + + /* loop through all the BSIM3 models */ + for ( ; model != NULL ; model = model->BSIM3nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM3instances ; here != NULL ; here = here->BSIM3nextInstance) + { + ckt->CKTnodeIsLinear [here->BSIM3dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3qNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim3/bsim3ext.h b/src/spicelib/devices/bsim3/bsim3ext.h index 71662ea8b..ef00e8538 100644 --- a/src/spicelib/devices/bsim3/bsim3ext.h +++ b/src/spicelib/devices/bsim3/bsim3ext.h @@ -28,3 +28,4 @@ extern int BSIM3temp(GENmodel*,CKTcircuit*); extern int BSIM3trunc(GENmodel*,CKTcircuit*,double*); extern int BSIM3noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int BSIM3unsetup(GENmodel*,CKTcircuit*); +extern int BSIM3nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim3/bsim3init.c b/src/spicelib/devices/bsim3/bsim3init.c index 48c2f08ae..99efa1d0e 100644 --- a/src/spicelib/devices/bsim3/bsim3init.c +++ b/src/spicelib/devices/bsim3/bsim3init.c @@ -71,7 +71,8 @@ SPICEdev BSIM3info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &BSIM3iSize, - /* DEVmodSize */ &BSIM3mSize + /* DEVmodSize */ &BSIM3mSize, + /* DEVnodeIsNonLinear */ BSIM3nodeIsNonLinear }; diff --git a/src/spicelib/devices/bsim3soi_dd/Makefile.am b/src/spicelib/devices/bsim3soi_dd/Makefile.am index 5187d67e3..bcc68edcf 100644 --- a/src/spicelib/devices/bsim3soi_dd/Makefile.am +++ b/src/spicelib/devices/bsim3soi_dd/Makefile.am @@ -2,29 +2,30 @@ noinst_LTLIBRARIES = libbsim3soidd.la -libbsim3soidd_la_SOURCES = \ - b3soidd.c \ - b3soiddacld.c \ - b3soiddask.c \ - b3soiddcheck.c \ - b3soiddcvtest.c \ - b3soidddel.c \ - b3soidddest.c \ - b3soiddgetic.c \ - b3soiddld.c \ - b3soiddmask.c \ - b3soiddmdel.c \ - b3soiddmpar.c \ - b3soiddnoi.c \ - b3soiddpar.c \ - b3soiddpzld.c \ - b3soiddset.c \ - b3soiddtemp.c \ - b3soiddtrunc.c \ - b3soidddef.h \ - b3soiddext.h \ - b3soiddinit.c \ - b3soiddinit.h \ +libbsim3soidd_la_SOURCES = \ + b3soidd.c \ + b3soiddacld.c \ + b3soiddask.c \ + b3soiddcheck.c \ + b3soiddcvtest.c \ + b3soidddel.c \ + b3soidddest.c \ + b3soiddgetic.c \ + b3soiddld.c \ + b3soiddmask.c \ + b3soiddmdel.c \ + b3soiddmpar.c \ + b3soiddnode.c \ + b3soiddnoi.c \ + b3soiddpar.c \ + b3soiddpzld.c \ + b3soiddset.c \ + b3soiddtemp.c \ + b3soiddtrunc.c \ + b3soidddef.h \ + b3soiddext.h \ + b3soiddinit.c \ + b3soiddinit.h \ b3soidditf.h diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddext.h b/src/spicelib/devices/bsim3soi_dd/b3soiddext.h index 1d5d90695..9f0870708 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddext.h +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddext.h @@ -28,3 +28,4 @@ extern int B3SOIDDtemp(GENmodel*,CKTcircuit*); extern int B3SOIDDtrunc(GENmodel*,CKTcircuit*,double*); extern int B3SOIDDnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int B3SOIDDunsetup(GENmodel*,CKTcircuit*); +extern int B3SOIDDnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c b/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c index d3b0fb490..9c3788ad0 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddinit.c @@ -69,7 +69,8 @@ SPICEdev B3SOIDDinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &B3SOIDDiSize, - /* DEVmodSize */ &B3SOIDDmSize + /* DEVmodSize */ &B3SOIDDmSize, + /* DEVnodeIsNonLinear */ B3SOIDDnodeIsNonLinear }; SPICEdev * diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddnode.c b/src/spicelib/devices/bsim3soi_dd/b3soiddnode.c new file mode 100644 index 000000000..f993ddc82 --- /dev/null +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddnode.c @@ -0,0 +1,79 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "b3soidddef.h" +#include "ngspice/sperror.h" + +int +B3SOIDDnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + B3SOIDDmodel *model = (B3SOIDDmodel *)inModel ; + B3SOIDDinstance *here ; + + /* loop through all the B3SOIDD models */ + for ( ; model != NULL ; model = model->B3SOIDDnextModel) + { + /* loop through all the instances of the model */ + for (here = model->B3SOIDDinstances ; here != NULL ; here = here->B3SOIDDnextInstance) + { + ckt->CKTnodeIsLinear [here->B3SOIDDdNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDsNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDtempNode] = 0 ; + if ((here->B3SOIDDdebugMod > 1) || (here->B3SOIDDdebugMod == -1)) + { + ckt->CKTnodeIsLinear [here->B3SOIDDvbsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDidsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDicNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDibsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDibdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDiiiNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDigidlNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDitunNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDibpNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDabeffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDvbs0effNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDvbseffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDxcNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDcbbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDcbdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDcbgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqbfNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqjsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqjdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDgmNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDgmbsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDgdsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDgmeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDvbs0teffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDvthNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDvgsteffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDxcsatNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqaccNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqsub0Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqsubs1Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqsubs2Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDqgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDvdscvNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDvcscvNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDcbeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDdum1Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDdum2Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDdum3Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDdum4Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDdum5Node] = 0 ; + } + ckt->CKTnodeIsLinear [here->B3SOIDDgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIDDpNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim3soi_fd/Makefile.am b/src/spicelib/devices/bsim3soi_fd/Makefile.am index aac0e863a..16fcf03c0 100644 --- a/src/spicelib/devices/bsim3soi_fd/Makefile.am +++ b/src/spicelib/devices/bsim3soi_fd/Makefile.am @@ -2,29 +2,30 @@ noinst_LTLIBRARIES = libbsim3soifd.la -libbsim3soifd_la_SOURCES = \ - b3soifd.c \ - b3soifdacld.c \ - b3soifdask.c \ - b3soifdcheck.c \ - b3soifdcvtest.c \ - b3soifddel.c \ - b3soifddest.c \ - b3soifdgetic.c \ - b3soifdld.c \ - b3soifdmask.c \ - b3soifdmdel.c \ - b3soifdmpar.c \ - b3soifdnoi.c \ - b3soifdpar.c \ - b3soifdpzld.c \ - b3soifdset.c \ - b3soifdtemp.c \ - b3soifdtrunc.c \ - b3soifddef.h \ - b3soifdext.h \ - b3soifdinit.c \ - b3soifdinit.h \ +libbsim3soifd_la_SOURCES = \ + b3soifd.c \ + b3soifdacld.c \ + b3soifdask.c \ + b3soifdcheck.c \ + b3soifdcvtest.c \ + b3soifddel.c \ + b3soifddest.c \ + b3soifdgetic.c \ + b3soifdld.c \ + b3soifdmask.c \ + b3soifdmdel.c \ + b3soifdmpar.c \ + b3soifdnode.c \ + b3soifdnoi.c \ + b3soifdpar.c \ + b3soifdpzld.c \ + b3soifdset.c \ + b3soifdtemp.c \ + b3soifdtrunc.c \ + b3soifddef.h \ + b3soifdext.h \ + b3soifdinit.c \ + b3soifdinit.h \ b3soifditf.h diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdext.h b/src/spicelib/devices/bsim3soi_fd/b3soifdext.h index 1c6ed33dd..acdf39dc3 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdext.h +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdext.h @@ -28,4 +28,4 @@ extern int B3SOIFDtemp(GENmodel*,CKTcircuit*); extern int B3SOIFDtrunc(GENmodel*,CKTcircuit*,double*); extern int B3SOIFDnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int B3SOIFDunsetup(GENmodel*,CKTcircuit*); - +extern int B3SOIFDnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c b/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c index 27b3a6d43..1667c8462 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdinit.c @@ -70,7 +70,8 @@ SPICEdev B3SOIFDinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize*/ &B3SOIFDiSize, - /* DEVmodSize*/ &B3SOIFDmSize + /* DEVmodSize*/ &B3SOIFDmSize, + /* DEVnodeIsNonLinear */ B3SOIFDnodeIsNonLinear }; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdnode.c b/src/spicelib/devices/bsim3soi_fd/b3soifdnode.c new file mode 100644 index 000000000..cd4280763 --- /dev/null +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdnode.c @@ -0,0 +1,79 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "b3soifddef.h" +#include "ngspice/sperror.h" + +int +B3SOIFDnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + B3SOIFDmodel *model = (B3SOIFDmodel *)inModel ; + B3SOIFDinstance *here ; + + /* loop through all the B3SOIFD models */ + for ( ; model != NULL ; model = model->B3SOIFDnextModel) + { + /* loop through all the instances of the model */ + for (here = model->B3SOIFDinstances ; here != NULL ; here = here->B3SOIFDnextInstance) + { + ckt->CKTnodeIsLinear [here->B3SOIFDdNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDsNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDtempNode] = 0 ; + if ((here->B3SOIFDdebugMod > 1) || (here->B3SOIFDdebugMod == -1)) + { + ckt->CKTnodeIsLinear [here->B3SOIFDvbsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDidsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDicNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDibsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDibdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDiiiNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDigidlNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDitunNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDibpNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDabeffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDvbs0effNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDvbseffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDxcNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDcbbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDcbdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDcbgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqbfNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqjsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqjdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDgmNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDgmbsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDgdsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDgmeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDvbs0teffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDvthNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDvgsteffNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDxcsatNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqaccNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqsub0Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqsubs1Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqsubs2Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDqgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDvdscvNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDvcscvNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDcbeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDdum1Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDdum2Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDdum3Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDdum4Node] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDdum5Node] = 0 ; + } + ckt->CKTnodeIsLinear [here->B3SOIFDgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIFDpNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim3soi_pd/Makefile.am b/src/spicelib/devices/bsim3soi_pd/Makefile.am index f363b1d0e..877b09218 100644 --- a/src/spicelib/devices/bsim3soi_pd/Makefile.am +++ b/src/spicelib/devices/bsim3soi_pd/Makefile.am @@ -2,29 +2,30 @@ noinst_LTLIBRARIES = libbsim3soipd.la -libbsim3soipd_la_SOURCES = \ - b3soipd.c \ - b3soipdacld.c \ - b3soipdask.c \ - b3soipdcheck.c \ - b3soipdcvtest.c \ - b3soipddel.c \ - b3soipddest.c \ - b3soipdgetic.c \ - b3soipdld.c \ - b3soipdmask.c \ - b3soipdmdel.c \ - b3soipdmpar.c \ - b3soipdnoi.c \ - b3soipdpar.c \ - b3soipdpzld.c \ - b3soipdset.c \ - b3soipdtemp.c \ - b3soipdtrunc.c \ - b3soipddef.h \ - b3soipdext.h \ - b3soipdinit.c \ - b3soipdinit.h \ +libbsim3soipd_la_SOURCES = \ + b3soipd.c \ + b3soipdacld.c \ + b3soipdask.c \ + b3soipdcheck.c \ + b3soipdcvtest.c \ + b3soipddel.c \ + b3soipddest.c \ + b3soipdgetic.c \ + b3soipdld.c \ + b3soipdmask.c \ + b3soipdmdel.c \ + b3soipdmpar.c \ + b3soipdnode.c \ + b3soipdnoi.c \ + b3soipdpar.c \ + b3soipdpzld.c \ + b3soipdset.c \ + b3soipdtemp.c \ + b3soipdtrunc.c \ + b3soipddef.h \ + b3soipdext.h \ + b3soipdinit.c \ + b3soipdinit.h \ b3soipditf.h diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdext.h b/src/spicelib/devices/bsim3soi_pd/b3soipdext.h index ea2951794..8f94ec599 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdext.h +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdext.h @@ -28,3 +28,4 @@ extern int B3SOIPDtemp(GENmodel*,CKTcircuit*); extern int B3SOIPDtrunc(GENmodel*,CKTcircuit*,double*); extern int B3SOIPDnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int B3SOIPDunsetup(GENmodel*,CKTcircuit*); +extern int B3SOIPDnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c b/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c index 1fdab9690..18c8c2918 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdinit.c @@ -71,7 +71,8 @@ SPICEdev B3SOIPDinfo = { /* DEVacct*/ NULL, #endif /* DEVinstSize*/ &B3SOIPDiSize, - /* DEVmodSize*/ &B3SOIPDmSize + /* DEVmodSize*/ &B3SOIPDmSize, + /* DEVnodeIsNonLinear */ B3SOIPDnodeIsNonLinear }; SPICEdev * diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdnode.c b/src/spicelib/devices/bsim3soi_pd/b3soipdnode.c new file mode 100644 index 000000000..3c448e0b3 --- /dev/null +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdnode.c @@ -0,0 +1,55 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "b3soipddef.h" +#include "ngspice/sperror.h" + +int +B3SOIPDnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + B3SOIPDmodel *model = (B3SOIPDmodel *)inModel ; + B3SOIPDinstance *here ; + + /* loop through all the B3SOIPD models */ + for ( ; model != NULL ; model = model->B3SOIPDnextModel) + { + /* loop through all the instances of the model */ + for (here = model->B3SOIPDinstances ; here != NULL ; here = here->B3SOIPDnextInstance) + { + ckt->CKTnodeIsLinear [here->B3SOIPDdNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDsNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDtempNode] = 0 ; + if (here->B3SOIPDdebugMod != 0) + { + ckt->CKTnodeIsLinear [here->B3SOIPDvbsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDidsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDicNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDibsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDibdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDiiiNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDigNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDgiggNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDgigdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDgigbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDigidlNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDitunNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDibpNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDcbbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDcbdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDcbgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDqbfNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDqjsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDqjdNode] = 0 ; + } + ckt->CKTnodeIsLinear [here->B3SOIPDgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B3SOIPDpNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim3v0/Makefile.am b/src/spicelib/devices/bsim3v0/Makefile.am index 4db27a86d..c5d136942 100644 --- a/src/spicelib/devices/bsim3v0/Makefile.am +++ b/src/spicelib/devices/bsim3v0/Makefile.am @@ -14,6 +14,7 @@ libbsim3v0_la_SOURCES = \ b3v0mask.c \ b3v0mdel.c \ b3v0mpar.c \ + b3v0node.c \ b3v0noi.c \ b3v0par.c \ b3v0pzld.c \ diff --git a/src/spicelib/devices/bsim3v0/b3v0node.c b/src/spicelib/devices/bsim3v0/b3v0node.c new file mode 100644 index 000000000..6feab17db --- /dev/null +++ b/src/spicelib/devices/bsim3v0/b3v0node.c @@ -0,0 +1,31 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim3v0def.h" +#include "ngspice/sperror.h" + +int +BSIM3v0nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM3v0model *model = (BSIM3v0model *)inModel ; + BSIM3v0instance *here ; + + /* loop through all the BSIM3v0 models */ + for ( ; model != NULL ; model = model->BSIM3v0nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM3v0instances ; here != NULL ; here = here->BSIM3v0nextInstance) + { + ckt->CKTnodeIsLinear [here->BSIM3v0dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v0sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v0qNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v0gNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v0bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim3v0/bsim3v0ext.h b/src/spicelib/devices/bsim3v0/bsim3v0ext.h index 02ad75173..efbeea27e 100644 --- a/src/spicelib/devices/bsim3v0/bsim3v0ext.h +++ b/src/spicelib/devices/bsim3v0/bsim3v0ext.h @@ -26,5 +26,5 @@ extern int BSIM3v0setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int BSIM3v0temp(GENmodel*,CKTcircuit*); extern int BSIM3v0trunc(GENmodel*,CKTcircuit*,double*); extern int BSIM3v0noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); -extern int BSIM3v0unsetup(GENmodel *, CKTcircuit *); - +extern int BSIM3v0unsetup(GENmodel *, CKTcircuit *); +extern int BSIM3v0nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim3v0/bsim3v0init.c b/src/spicelib/devices/bsim3v0/bsim3v0init.c index 43a8e1575..3b7588b42 100644 --- a/src/spicelib/devices/bsim3v0/bsim3v0init.c +++ b/src/spicelib/devices/bsim3v0/bsim3v0init.c @@ -70,7 +70,8 @@ SPICEdev B3v0info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &BSIM3v0iSize, - /* DEVmodSize */ &BSIM3v0mSize + /* DEVmodSize */ &BSIM3v0mSize, + /* DEVnodeIsNonLinear */ BSIM3v0nodeIsNonLinear }; diff --git a/src/spicelib/devices/bsim3v1/Makefile.am b/src/spicelib/devices/bsim3v1/Makefile.am index 9ede60cb9..0a6708b07 100644 --- a/src/spicelib/devices/bsim3v1/Makefile.am +++ b/src/spicelib/devices/bsim3v1/Makefile.am @@ -15,6 +15,7 @@ libbsim3v1_la_SOURCES = \ b3v1mask.c \ b3v1mdel.c \ b3v1mpar.c \ + b3v1node.c \ b3v1noi.c \ b3v1par.c \ b3v1pzld.c \ diff --git a/src/spicelib/devices/bsim3v1/b3v1node.c b/src/spicelib/devices/bsim3v1/b3v1node.c new file mode 100644 index 000000000..2349d7e11 --- /dev/null +++ b/src/spicelib/devices/bsim3v1/b3v1node.c @@ -0,0 +1,31 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim3v1def.h" +#include "ngspice/sperror.h" + +int +BSIM3v1nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM3v1model *model = (BSIM3v1model *)inModel ; + BSIM3v1instance *here ; + + /* loop through all the BSIM3v1 models */ + for ( ; model != NULL ; model = model->BSIM3v1nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM3v1instances ; here != NULL ; here = here->BSIM3v1nextInstance) + { + ckt->CKTnodeIsLinear [here->BSIM3v1dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v1sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v1qNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v1gNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v1bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim3v1/bsim3v1ext.h b/src/spicelib/devices/bsim3v1/bsim3v1ext.h index 67c96c37e..a3c9c304d 100644 --- a/src/spicelib/devices/bsim3v1/bsim3v1ext.h +++ b/src/spicelib/devices/bsim3v1/bsim3v1ext.h @@ -28,4 +28,4 @@ extern int BSIM3v1temp(GENmodel *, CKTcircuit *); extern int BSIM3v1trunc(GENmodel *, CKTcircuit *, double *); extern int BSIM3v1noise(int, int, GENmodel *, CKTcircuit *, Ndata *, double *); extern int BSIM3v1unsetup(GENmodel *, CKTcircuit *); - +extern int BSIM3v1nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim3v1/bsim3v1init.c b/src/spicelib/devices/bsim3v1/bsim3v1init.c index 170807bdb..19c7ad160 100644 --- a/src/spicelib/devices/bsim3v1/bsim3v1init.c +++ b/src/spicelib/devices/bsim3v1/bsim3v1init.c @@ -70,7 +70,8 @@ SPICEdev BSIM3v1info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &BSIM3v1iSize, - /* DEVmodSize */ &BSIM3v1mSize + /* DEVmodSize */ &BSIM3v1mSize, + /* DEVnodeIsNonLinear */ BSIM3v1nodeIsNonLinear }; diff --git a/src/spicelib/devices/bsim3v32/Makefile.am b/src/spicelib/devices/bsim3v32/Makefile.am index 37674d382..9a67b1d40 100644 --- a/src/spicelib/devices/bsim3v32/Makefile.am +++ b/src/spicelib/devices/bsim3v32/Makefile.am @@ -15,6 +15,7 @@ libbsim3v32_la_SOURCES = \ b3v32mask.c \ b3v32mdel.c \ b3v32mpar.c \ + b3v32node.c \ b3v32noi.c \ b3v32par.c \ b3v32pzld.c \ diff --git a/src/spicelib/devices/bsim3v32/b3v32node.c b/src/spicelib/devices/bsim3v32/b3v32node.c new file mode 100644 index 000000000..8cdba132d --- /dev/null +++ b/src/spicelib/devices/bsim3v32/b3v32node.c @@ -0,0 +1,31 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim3v32def.h" +#include "ngspice/sperror.h" + +int +BSIM3v32nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM3v32model *model = (BSIM3v32model *)inModel ; + BSIM3v32instance *here ; + + /* loop through all the BSIM3v32 models */ + for ( ; model != NULL ; model = model->BSIM3v32nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM3v32instances ; here != NULL ; here = here->BSIM3v32nextInstance) + { + ckt->CKTnodeIsLinear [here->BSIM3v32dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v32sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v32qNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v32gNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM3v32bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim3v32/bsim3v32ext.h b/src/spicelib/devices/bsim3v32/bsim3v32ext.h index b64496f6d..ce6d0cd1b 100644 --- a/src/spicelib/devices/bsim3v32/bsim3v32ext.h +++ b/src/spicelib/devices/bsim3v32/bsim3v32ext.h @@ -29,3 +29,4 @@ extern int BSIM3v32temp(GENmodel*,CKTcircuit*); extern int BSIM3v32trunc(GENmodel*,CKTcircuit*,double*); extern int BSIM3v32noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int BSIM3v32unsetup(GENmodel*,CKTcircuit*); +extern int BSIM3v32nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim3v32/bsim3v32init.c b/src/spicelib/devices/bsim3v32/bsim3v32init.c index 544a189d6..0bdd10f04 100644 --- a/src/spicelib/devices/bsim3v32/bsim3v32init.c +++ b/src/spicelib/devices/bsim3v32/bsim3v32init.c @@ -71,7 +71,8 @@ SPICEdev BSIM3v32info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &BSIM3v32iSize, - /* DEVmodSize */ &BSIM3v32mSize + /* DEVmodSize */ &BSIM3v32mSize, + /* DEVnodeIsNonLinear */ BSIM3v32nodeIsNonLinear }; diff --git a/src/spicelib/devices/bsim4/Makefile.am b/src/spicelib/devices/bsim4/Makefile.am index 9403a4129..862f52ae7 100644 --- a/src/spicelib/devices/bsim4/Makefile.am +++ b/src/spicelib/devices/bsim4/Makefile.am @@ -16,6 +16,7 @@ libbsim4_la_SOURCES = \ b4mask.c \ b4mdel.c \ b4mpar.c \ + b4node.c \ b4noi.c \ b4par.c \ b4pzld.c \ diff --git a/src/spicelib/devices/bsim4/b4node.c b/src/spicelib/devices/bsim4/b4node.c new file mode 100644 index 000000000..dfb6b7cda --- /dev/null +++ b/src/spicelib/devices/bsim4/b4node.c @@ -0,0 +1,46 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim4def.h" +#include "ngspice/sperror.h" + +int +BSIM4nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM4model *model = (BSIM4model *)inModel ; + BSIM4instance *here ; + + /* loop through all the BSIM4 models */ + for ( ; model != NULL ; model = model->BSIM4nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM4instances ; here != NULL ; here = here->BSIM4nextInstance) + { + +#ifdef STEPDEBUG + fprintf (stderr, "here->BSIM4dNodePrime: %d\n", here->BSIM4dNodePrime) ; + fprintf (stderr, "here->BSIM4sNodePrime: %d\n", here->BSIM4sNodePrime) ; + fprintf (stderr, "here->BSIM4gNodePrime: %d\n", here->BSIM4gNodePrime) ; + fprintf (stderr, "here->BSIM4gNodeMid: %d\n", here->BSIM4gNodeMid) ; + fprintf (stderr, "here->BSIM4dbNode: %d\n", here->BSIM4dbNode) ; + fprintf (stderr, "here->BSIM4bNodePrime: %d\n", here->BSIM4bNodePrime) ; + fprintf (stderr, "here->BSIM4sbNode: %d\n", here->BSIM4sbNode) ; + fprintf (stderr, "here->BSIM4qNode: %d\n", here->BSIM4qNode) ; +#endif + + ckt->CKTnodeIsLinear [here->BSIM4dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4sNodePrime] = 0 ; +// ckt->CKTnodeIsLinear [here->BSIM4gNodePrime] = 0 ; +// ckt->CKTnodeIsLinear [here->BSIM4gNodeMid] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4dbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4bNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4sbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4qNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim4/bsim4ext.h b/src/spicelib/devices/bsim4/bsim4ext.h index 171406ae5..965951f03 100644 --- a/src/spicelib/devices/bsim4/bsim4ext.h +++ b/src/spicelib/devices/bsim4/bsim4ext.h @@ -28,3 +28,4 @@ extern int BSIM4temp(GENmodel*,CKTcircuit*); extern int BSIM4trunc(GENmodel*,CKTcircuit*,double*); extern int BSIM4noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int BSIM4unsetup(GENmodel*,CKTcircuit*); +extern int BSIM4nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim4/bsim4init.c b/src/spicelib/devices/bsim4/bsim4init.c index 88b4fd97c..b447a927a 100644 --- a/src/spicelib/devices/bsim4/bsim4init.c +++ b/src/spicelib/devices/bsim4/bsim4init.c @@ -72,7 +72,8 @@ SPICEdev BSIM4info = { NULL, /* DEVacct */ #endif &BSIM4iSize, /* DEVinstSize */ - &BSIM4mSize /* DEVmodSize */ + &BSIM4mSize, /* DEVmodSize */ + BSIM4nodeIsNonLinear /* DEVnodeIsNonLinear */ }; diff --git a/src/spicelib/devices/bsim4v4/Makefile.am b/src/spicelib/devices/bsim4v4/Makefile.am index a4f55eb42..c92a2a6e3 100644 --- a/src/spicelib/devices/bsim4v4/Makefile.am +++ b/src/spicelib/devices/bsim4v4/Makefile.am @@ -16,6 +16,7 @@ libbsim4v4_la_SOURCES = \ b4v4mask.c \ b4v4mdel.c \ b4v4mpar.c \ + b4v4node.c \ b4v4noi.c \ b4v4par.c \ b4v4pzld.c \ diff --git a/src/spicelib/devices/bsim4v4/b4v4node.c b/src/spicelib/devices/bsim4v4/b4v4node.c new file mode 100644 index 000000000..a033750a0 --- /dev/null +++ b/src/spicelib/devices/bsim4v4/b4v4node.c @@ -0,0 +1,34 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim4v4def.h" +#include "ngspice/sperror.h" + +int +BSIM4v4nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM4v4model *model = (BSIM4v4model *)inModel ; + BSIM4v4instance *here ; + + /* loop through all the BSIM4v4 models */ + for ( ; model != NULL ; model = model->BSIM4v4nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM4v4instances ; here != NULL ; here = here->BSIM4v4nextInstance) + { + ckt->CKTnodeIsLinear [here->BSIM4v4dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v4sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v4gNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v4gNodeMid] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v4dbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v4bNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v4sbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v4qNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim4v4/bsim4v4ext.h b/src/spicelib/devices/bsim4v4/bsim4v4ext.h index fd5fce099..70bf7fb40 100644 --- a/src/spicelib/devices/bsim4v4/bsim4v4ext.h +++ b/src/spicelib/devices/bsim4v4/bsim4v4ext.h @@ -29,5 +29,4 @@ extern int BSIM4v4temp(GENmodel*,CKTcircuit*); extern int BSIM4v4trunc(GENmodel*,CKTcircuit*,double*); extern int BSIM4v4noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int BSIM4v4unsetup(GENmodel*,CKTcircuit*); - - +extern int BSIM4v4nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim4v4/bsim4v4init.c b/src/spicelib/devices/bsim4v4/bsim4v4init.c index b50bd92fa..e72a4a9e0 100644 --- a/src/spicelib/devices/bsim4v4/bsim4v4init.c +++ b/src/spicelib/devices/bsim4v4/bsim4v4init.c @@ -72,7 +72,8 @@ SPICEdev BSIM4v4info = { NULL, /* DEVacct */ #endif &BSIM4v4iSize, /* DEVinstSize */ - &BSIM4v4mSize /* DEVmodSize */ + &BSIM4v4mSize, /* DEVmodSize */ + BSIM4v4nodeIsNonLinear /* DEVnodeIsNonLinear */ }; diff --git a/src/spicelib/devices/bsim4v5/Makefile.am b/src/spicelib/devices/bsim4v5/Makefile.am index a7ab65505..ec5a80d91 100644 --- a/src/spicelib/devices/bsim4v5/Makefile.am +++ b/src/spicelib/devices/bsim4v5/Makefile.am @@ -16,6 +16,7 @@ libbsim4v5_la_SOURCES = \ b4v5mask.c \ b4v5mdel.c \ b4v5mpar.c \ + b4v5node.c \ b4v5noi.c \ b4v5par.c \ b4v5pzld.c \ diff --git a/src/spicelib/devices/bsim4v5/b4v5node.c b/src/spicelib/devices/bsim4v5/b4v5node.c new file mode 100644 index 000000000..c344a6167 --- /dev/null +++ b/src/spicelib/devices/bsim4v5/b4v5node.c @@ -0,0 +1,34 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim4v5def.h" +#include "ngspice/sperror.h" + +int +BSIM4v5nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM4v5model *model = (BSIM4v5model *)inModel ; + BSIM4v5instance *here ; + + /* loop through all the BSIM4v5 models */ + for ( ; model != NULL ; model = model->BSIM4v5nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM4v5instances ; here != NULL ; here = here->BSIM4v5nextInstance) + { + ckt->CKTnodeIsLinear [here->BSIM4v5dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v5sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v5gNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v5gNodeMid] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v5dbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v5bNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v5sbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v5qNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim4v5/bsim4v5ext.h b/src/spicelib/devices/bsim4v5/bsim4v5ext.h index 511969bfb..35f5989d3 100644 --- a/src/spicelib/devices/bsim4v5/bsim4v5ext.h +++ b/src/spicelib/devices/bsim4v5/bsim4v5ext.h @@ -28,3 +28,4 @@ extern int BSIM4v5temp(GENmodel*,CKTcircuit*); extern int BSIM4v5trunc(GENmodel*,CKTcircuit*,double*); extern int BSIM4v5noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int BSIM4v5unsetup(GENmodel*,CKTcircuit*); +extern int BSIM4v5nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim4v5/bsim4v5init.c b/src/spicelib/devices/bsim4v5/bsim4v5init.c index 5289072a7..3bc4fb9c9 100644 --- a/src/spicelib/devices/bsim4v5/bsim4v5init.c +++ b/src/spicelib/devices/bsim4v5/bsim4v5init.c @@ -72,7 +72,8 @@ SPICEdev BSIM4v5info = { NULL, /* DEVacct */ #endif &BSIM4v5iSize, /* DEVinstSize */ - &BSIM4v5mSize /* DEVmodSize */ + &BSIM4v5mSize, /* DEVmodSize */ + BSIM4v5nodeIsNonLinear /* DEVnodeIsNonLinear */ }; diff --git a/src/spicelib/devices/bsim4v6/Makefile.am b/src/spicelib/devices/bsim4v6/Makefile.am index 0815d57eb..4e4b9644a 100644 --- a/src/spicelib/devices/bsim4v6/Makefile.am +++ b/src/spicelib/devices/bsim4v6/Makefile.am @@ -5,21 +5,22 @@ noinst_LTLIBRARIES = libbsim4v6.la libbsim4v6_la_SOURCES = \ b4v6.c \ b4v6acld.c \ - b4v6ask.c \ + b4v6ask.c \ b4v6check.c \ b4v6cvtest.c \ - b4v6del.c \ + b4v6del.c \ b4v6dest.c \ - b4v6geo.c \ + b4v6geo.c \ b4v6getic.c \ - b4v6ld.c \ + b4v6ld.c \ b4v6mask.c \ b4v6mdel.c \ b4v6mpar.c \ - b4v6noi.c \ - b4v6par.c \ + b4v6node.c \ + b4v6noi.c \ + b4v6par.c \ b4v6pzld.c \ - b4v6set.c \ + b4v6set.c \ b4v6temp.c \ b4v6trunc.c \ bsim4v6def.h \ diff --git a/src/spicelib/devices/bsim4v6/b4v6node.c b/src/spicelib/devices/bsim4v6/b4v6node.c new file mode 100644 index 000000000..f63e4cf38 --- /dev/null +++ b/src/spicelib/devices/bsim4v6/b4v6node.c @@ -0,0 +1,34 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "bsim4v6def.h" +#include "ngspice/sperror.h" + +int +BSIM4v6nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + BSIM4v6model *model = (BSIM4v6model *)inModel ; + BSIM4v6instance *here ; + + /* loop through all the BSIM4v6 models */ + for ( ; model != NULL ; model = model->BSIM4v6nextModel) + { + /* loop through all the instances of the model */ + for (here = model->BSIM4v6instances ; here != NULL ; here = here->BSIM4v6nextInstance) + { + ckt->CKTnodeIsLinear [here->BSIM4v6dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v6sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v6gNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v6gNodeMid] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v6dbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v6bNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v6sbNode] = 0 ; + ckt->CKTnodeIsLinear [here->BSIM4v6qNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/bsim4v6/bsim4v6ext.h b/src/spicelib/devices/bsim4v6/bsim4v6ext.h index c78426430..7bb9f6b12 100644 --- a/src/spicelib/devices/bsim4v6/bsim4v6ext.h +++ b/src/spicelib/devices/bsim4v6/bsim4v6ext.h @@ -28,3 +28,4 @@ extern int BSIM4v6temp(GENmodel*,CKTcircuit*); extern int BSIM4v6trunc(GENmodel*,CKTcircuit*,double*); extern int BSIM4v6noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int BSIM4v6unsetup(GENmodel*,CKTcircuit*); +extern int BSIM4v6nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsim4v6/bsim4v6init.c b/src/spicelib/devices/bsim4v6/bsim4v6init.c index 96b027d7e..519d0ff1d 100644 --- a/src/spicelib/devices/bsim4v6/bsim4v6init.c +++ b/src/spicelib/devices/bsim4v6/bsim4v6init.c @@ -72,7 +72,8 @@ SPICEdev BSIM4v6info = { NULL, /* DEVacct */ #endif &BSIM4v6iSize, /* DEVinstSize */ - &BSIM4v6mSize /* DEVmodSize */ + &BSIM4v6mSize, /* DEVmodSize */ + BSIM4v6nodeIsNonLinear /* DEVnodeIsNonLinear */ }; diff --git a/src/spicelib/devices/bsimsoi/Makefile.am b/src/spicelib/devices/bsimsoi/Makefile.am index 7a7ed8ea0..ece831287 100644 --- a/src/spicelib/devices/bsimsoi/Makefile.am +++ b/src/spicelib/devices/bsimsoi/Makefile.am @@ -2,30 +2,31 @@ noinst_LTLIBRARIES = libbsim4soi.la -libbsim4soi_la_SOURCES = \ - b4soi.c \ - b4soiacld.c \ - b4soiask.c \ - b4soicheck.c \ - b4soicvtest.c \ - b4soidel.c \ - b4soidest.c \ - b4soigetic.c \ - b4soild.c \ - b4soimask.c \ - b4soimdel.c \ - b4soimpar.c \ - b4soinoi.c \ - b4soipar.c \ - b4soipzld.c \ - b4soiset.c \ - b4soitemp.c \ - b4soitrunc.c \ - b4soidef.h \ - b4soiext.h \ - b4soiinit.c \ - b4soiinit.h \ - b4soiitf.h +libbsim4soi_la_SOURCES = \ + b4soi.c \ + b4soiacld.c \ + b4soiask.c \ + b4soicheck.c \ + b4soicvtest.c \ + b4soidel.c \ + b4soidest.c \ + b4soigetic.c \ + b4soild.c \ + b4soimask.c \ + b4soimdel.c \ + b4soimpar.c \ + b4soinode.c \ + b4soinoi.c \ + b4soipar.c \ + b4soipzld.c \ + b4soiset.c \ + b4soitemp.c \ + b4soitrunc.c \ + b4soidef.h \ + b4soiext.h \ + b4soiinit.c \ + b4soiinit.h \ + b4soiitf.h diff --git a/src/spicelib/devices/bsimsoi/b4soiext.h b/src/spicelib/devices/bsimsoi/b4soiext.h index a3c663f6f..0ec40e28a 100644 --- a/src/spicelib/devices/bsimsoi/b4soiext.h +++ b/src/spicelib/devices/bsimsoi/b4soiext.h @@ -30,3 +30,4 @@ extern int B4SOItemp(GENmodel*,CKTcircuit*); extern int B4SOItrunc(GENmodel*,CKTcircuit*,double*); extern int B4SOInoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int B4SOIunsetup(GENmodel*,CKTcircuit*); +extern int B4SOInodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/bsimsoi/b4soiinit.c b/src/spicelib/devices/bsimsoi/b4soiinit.c index fa88a6740..25835aa24 100644 --- a/src/spicelib/devices/bsimsoi/b4soiinit.c +++ b/src/spicelib/devices/bsimsoi/b4soiinit.c @@ -70,7 +70,8 @@ SPICEdev B4SOIinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &B4SOIiSize, - /* DEVmodSize */ &B4SOImSize + /* DEVmodSize */ &B4SOImSize, + /* DEVnodeIsNonLinear */ B4SOInodeIsNonLinear }; SPICEdev * diff --git a/src/spicelib/devices/bsimsoi/b4soinode.c b/src/spicelib/devices/bsimsoi/b4soinode.c new file mode 100644 index 000000000..7b6b8c9b1 --- /dev/null +++ b/src/spicelib/devices/bsimsoi/b4soinode.c @@ -0,0 +1,58 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "b4soidef.h" +#include "ngspice/sperror.h" + +int +B4SOInodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + B4SOImodel *model = (B4SOImodel *)inModel ; + B4SOIinstance *here ; + + /* loop through all the BSIMSOI models */ + for ( ; model != NULL ; model = model->B4SOInextModel) + { + /* loop through all the instances of the model */ + for (here = model->B4SOIinstances ; here != NULL ; here = here->B4SOInextInstance) + { + ckt->CKTnodeIsLinear [here->B4SOIdNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIsNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOItempNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIgNodeMid] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIdbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIsbNode] = 0 ; + if (here->B4SOIdebugMod != 0) + { + ckt->CKTnodeIsLinear [here->B4SOIvbsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIidsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIicNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIibsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIibdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIiiiNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIigNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIgiggNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIgigdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIgigbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIigidlNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIitunNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIibpNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIcbbNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIcbdNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIcbgNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIqbfNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIqjsNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIqjdNode] = 0 ; + } + ckt->CKTnodeIsLinear [here->B4SOIeNode] = 0 ; + ckt->CKTnodeIsLinear [here->B4SOIpNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/cap/capinit.c b/src/spicelib/devices/cap/capinit.c index 5e0b14fc5..fe5f37122 100644 --- a/src/spicelib/devices/cap/capinit.c +++ b/src/spicelib/devices/cap/capinit.c @@ -71,7 +71,8 @@ SPICEdev CAPinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &CAPiSize, - /* DEVmodSize */ &CAPmSize + /* DEVmodSize */ &CAPmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/cccs/cccsinit.c b/src/spicelib/devices/cccs/cccsinit.c index 1a86cb79c..15fb3f063 100644 --- a/src/spicelib/devices/cccs/cccsinit.c +++ b/src/spicelib/devices/cccs/cccsinit.c @@ -71,7 +71,8 @@ SPICEdev CCCSinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &CCCSiSize, - /* DEVmodSize */ &CCCSmSize + /* DEVmodSize */ &CCCSmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/ccvs/ccvsinit.c b/src/spicelib/devices/ccvs/ccvsinit.c index 24ad03d9f..a52895f19 100644 --- a/src/spicelib/devices/ccvs/ccvsinit.c +++ b/src/spicelib/devices/ccvs/ccvsinit.c @@ -72,7 +72,8 @@ SPICEdev CCVSinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &CCVSiSize, - /* DEVmodSize */ &CCVSmSize + /* DEVmodSize */ &CCVSmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/cpl/cplinit.c b/src/spicelib/devices/cpl/cplinit.c index a2a987c54..51575227d 100644 --- a/src/spicelib/devices/cpl/cplinit.c +++ b/src/spicelib/devices/cpl/cplinit.c @@ -72,7 +72,8 @@ SPICEdev CPLinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &CPLiSize, -/* DEVmodSize */ &CPLmSize +/* DEVmodSize */ &CPLmSize, +/* DEVnodeIsLinear */ NULL }; diff --git a/src/spicelib/devices/csw/cswinit.c b/src/spicelib/devices/csw/cswinit.c index 2ad8fd87a..a536ef7a1 100644 --- a/src/spicelib/devices/csw/cswinit.c +++ b/src/spicelib/devices/csw/cswinit.c @@ -74,7 +74,8 @@ SPICEdev CSWinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &CSWiSize, - /* DEVmodSize */ &CSWmSize + /* DEVmodSize */ &CSWmSize, + /* DEVnodeIsLinear */ NULL }; diff --git a/src/spicelib/devices/dio/Makefile.am b/src/spicelib/devices/dio/Makefile.am index 7218d39b0..9b9f9cba5 100644 --- a/src/spicelib/devices/dio/Makefile.am +++ b/src/spicelib/devices/dio/Makefile.am @@ -21,6 +21,7 @@ libdio_la_SOURCES = \ diomask.c \ diomdel.c \ diompar.c \ + dionode.c \ dionoise.c \ dioparam.c \ diopzld.c \ diff --git a/src/spicelib/devices/dio/dioext.h b/src/spicelib/devices/dio/dioext.h index bb0a132d0..4583195cb 100644 --- a/src/spicelib/devices/dio/dioext.h +++ b/src/spicelib/devices/dio/dioext.h @@ -28,4 +28,4 @@ extern int DIOtrunc(GENmodel*,CKTcircuit*,double*); extern int DIOdisto(int,GENmodel*,CKTcircuit*); extern int DIOnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int DIOdSetup(DIOmodel*,CKTcircuit*); - +extern int DIOnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/dio/dioinit.c b/src/spicelib/devices/dio/dioinit.c index 9ccece87e..68075152f 100644 --- a/src/spicelib/devices/dio/dioinit.c +++ b/src/spicelib/devices/dio/dioinit.c @@ -73,7 +73,8 @@ SPICEdev DIOinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &DIOiSize, - /* DEVmodSize */ &DIOmSize + /* DEVmodSize */ &DIOmSize, + /* DEVnodeIsNonLinear */ DIOnodeIsNonLinear }; diff --git a/src/spicelib/devices/dio/dionode.c b/src/spicelib/devices/dio/dionode.c new file mode 100644 index 000000000..0f19a8795 --- /dev/null +++ b/src/spicelib/devices/dio/dionode.c @@ -0,0 +1,28 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "diodefs.h" +#include "ngspice/sperror.h" + +int +DIOnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + DIOmodel *model = (DIOmodel *)inModel ; + DIOinstance *here ; + + /* loop through all the DIO models */ + for ( ; model != NULL ; model = model->DIOnextModel) + { + /* loop through all the instances of the model */ + for (here = model->DIOinstances ; here != NULL ; here = here->DIOnextInstance) + { + ckt->CKTnodeIsLinear [here->DIOposPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->DIOnegNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/hfet1/Makefile.am b/src/spicelib/devices/hfet1/Makefile.am index 5d9ef9eee..d2d1a21b7 100644 --- a/src/spicelib/devices/hfet1/Makefile.am +++ b/src/spicelib/devices/hfet1/Makefile.am @@ -18,6 +18,7 @@ libhfet_la_SOURCES = \ hfetmask.c \ hfetmdel.c \ hfetmpar.c \ + hfetnode.c \ hfetparam.c \ hfetpzl.c \ hfetsetup.c \ diff --git a/src/spicelib/devices/hfet1/hfetext.h b/src/spicelib/devices/hfet1/hfetext.h index 36d866f2d..caa55afe7 100644 --- a/src/spicelib/devices/hfet1/hfetext.h +++ b/src/spicelib/devices/hfet1/hfetext.h @@ -18,3 +18,4 @@ extern int HFETAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int HFETAtemp(GENmodel*,CKTcircuit*); extern int HFETAtrunc(GENmodel*,CKTcircuit*,double*); extern int HFETAunsetup(GENmodel*,CKTcircuit*); +extern int HFETAnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/hfet1/hfetinit.c b/src/spicelib/devices/hfet1/hfetinit.c index 9affd0801..8cff12d4e 100644 --- a/src/spicelib/devices/hfet1/hfetinit.c +++ b/src/spicelib/devices/hfet1/hfetinit.c @@ -72,7 +72,8 @@ SPICEdev HFETAinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &HFETAiSize, - /* DEVmodSize */ &HFETAmSize + /* DEVmodSize */ &HFETAmSize, + /* DEVnodeIsNonLinear */ HFETAnodeIsNonLinear }; diff --git a/src/spicelib/devices/hfet1/hfetnode.c b/src/spicelib/devices/hfet1/hfetnode.c new file mode 100644 index 000000000..90c5612ab --- /dev/null +++ b/src/spicelib/devices/hfet1/hfetnode.c @@ -0,0 +1,31 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "hfetdefs.h" +#include "ngspice/sperror.h" + +int +HFETAnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + HFETAmodel *model = (HFETAmodel *)inModel ; + HFETAinstance *here ; + + /* loop through all the HFETA models */ + for ( ; model != NULL ; model = model->HFETAnextModel) + { + /* loop through all the instances of the model */ + for (here = model->HFETAinstances ; here != NULL ; here = here->HFETAnextInstance) + { + ckt->CKTnodeIsLinear [here->HFETAsourcePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->HFETAdrainPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->HFETAgatePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->HFETAdrainPrmPrmNode] = 0 ; + ckt->CKTnodeIsLinear [here->HFETAsourcePrmPrmNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/hfet2/Makefile.am b/src/spicelib/devices/hfet2/Makefile.am index 743fae0a2..b0a8c5b0f 100644 --- a/src/spicelib/devices/hfet2/Makefile.am +++ b/src/spicelib/devices/hfet2/Makefile.am @@ -18,6 +18,7 @@ libhfet2_la_SOURCES = \ hfet2mask.c \ hfet2mdel.c \ hfet2mpar.c \ + hfet2node.c \ hfet2param.c \ hfet2pzl.c \ hfet2setup.c \ diff --git a/src/spicelib/devices/hfet2/hfet2ext.h b/src/spicelib/devices/hfet2/hfet2ext.h index 243861744..75369a790 100644 --- a/src/spicelib/devices/hfet2/hfet2ext.h +++ b/src/spicelib/devices/hfet2/hfet2ext.h @@ -18,3 +18,4 @@ extern int HFET2setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int HFET2temp(GENmodel*,CKTcircuit*); extern int HFET2trunc(GENmodel*,CKTcircuit*,double*); extern int HFET2unsetup( GENmodel*,CKTcircuit*); +extern int HFET2nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/hfet2/hfet2init.c b/src/spicelib/devices/hfet2/hfet2init.c index 10de5b4d5..f66633a86 100644 --- a/src/spicelib/devices/hfet2/hfet2init.c +++ b/src/spicelib/devices/hfet2/hfet2init.c @@ -72,7 +72,8 @@ SPICEdev HFET2info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &HFET2iSize, - /* DEVmodSize */ &HFET2mSize + /* DEVmodSize */ &HFET2mSize, + /* DEVnodeIsNonLinear */ HFET2nodeIsNonLinear }; diff --git a/src/spicelib/devices/hfet2/hfet2node.c b/src/spicelib/devices/hfet2/hfet2node.c new file mode 100644 index 000000000..30bcaeec4 --- /dev/null +++ b/src/spicelib/devices/hfet2/hfet2node.c @@ -0,0 +1,29 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "hfet2defs.h" +#include "ngspice/sperror.h" + +int +HFET2nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + HFET2model *model = (HFET2model *)inModel ; + HFET2instance *here ; + + /* loop through all the HFET2 models */ + for ( ; model != NULL ; model = model->HFET2nextModel) + { + /* loop through all the instances of the model */ + for (here = model->HFET2instances ; here != NULL ; here = here->HFET2nextInstance) + { + ckt->CKTnodeIsLinear [here->HFET2sourcePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->HFET2drainPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->HFET2gateNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/hisim2/Makefile.am b/src/spicelib/devices/hisim2/Makefile.am index 33fff2074..ef0c313be 100644 --- a/src/spicelib/devices/hisim2/Makefile.am +++ b/src/spicelib/devices/hisim2/Makefile.am @@ -23,6 +23,7 @@ libhisim2_la_SOURCES = hisim2.h \ hsm2mask.c \ hsm2mdel.c \ hsm2mpar.c \ + hsm2node.c \ hsm2noi.c \ hsm2par.c \ hsm2pzld.c \ diff --git a/src/spicelib/devices/hisim2/hsm2ext.h b/src/spicelib/devices/hisim2/hsm2ext.h index 0d7225cd2..6eda4563c 100644 --- a/src/spicelib/devices/hisim2/hsm2ext.h +++ b/src/spicelib/devices/hisim2/hsm2ext.h @@ -37,3 +37,4 @@ extern int HSM2unsetup(GENmodel*,CKTcircuit*); extern int HSM2temp(GENmodel*,CKTcircuit*); extern int HSM2trunc(GENmodel*,CKTcircuit*,double*); extern int HSM2noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); +extern int HSM2nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/hisim2/hsm2init.c b/src/spicelib/devices/hisim2/hsm2init.c index 28c526e2f..337ef7ebf 100644 --- a/src/spicelib/devices/hisim2/hsm2init.c +++ b/src/spicelib/devices/hisim2/hsm2init.c @@ -70,7 +70,8 @@ SPICEdev HSM2info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &HSM2iSize, - /* DEVmodSize */ &HSM2mSize + /* DEVmodSize */ &HSM2mSize, + /* DEVnodeIsNonLinear */ HSM2nodeIsNonLinear }; diff --git a/src/spicelib/devices/hisim2/hsm2node.c b/src/spicelib/devices/hisim2/hsm2node.c new file mode 100644 index 000000000..9dd8c8ca1 --- /dev/null +++ b/src/spicelib/devices/hisim2/hsm2node.c @@ -0,0 +1,32 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "hsm2def.h" +#include "ngspice/sperror.h" + +int +HSM2nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + HSM2model *model = (HSM2model *)inModel ; + HSM2instance *here ; + + /* loop through all the HSM2 models */ + for ( ; model != NULL ; model = model->HSM2nextModel) + { + /* loop through all the instances of the model */ + for (here = model->HSM2instances ; here != NULL ; here = here->HSM2nextInstance) + { + ckt->CKTnodeIsLinear [here->HSM2dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSM2sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSM2gNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSM2dbNode] = 0 ; + ckt->CKTnodeIsLinear [here->HSM2bNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSM2sbNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/hisimhv1/Makefile.am b/src/spicelib/devices/hisimhv1/Makefile.am index ea6d9e6fe..3f6d13019 100644 --- a/src/spicelib/devices/hisimhv1/Makefile.am +++ b/src/spicelib/devices/hisimhv1/Makefile.am @@ -23,6 +23,7 @@ libhisimhv1_la_SOURCES = hisimhv.h \ hsmhvmask.c \ hsmhvmdel.c \ hsmhvmpar.c \ + hsmhvnode.c \ hsmhvnoi.c \ hsmhvpar.c \ hsmhvpzld.c \ diff --git a/src/spicelib/devices/hisimhv1/hsmhvext.h b/src/spicelib/devices/hisimhv1/hsmhvext.h index ec4f306bf..16ffdf799 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvext.h +++ b/src/spicelib/devices/hisimhv1/hsmhvext.h @@ -37,3 +37,4 @@ extern int HSMHVunsetup(GENmodel*,CKTcircuit*); extern int HSMHVtemp(GENmodel*,CKTcircuit*); extern int HSMHVtrunc(GENmodel*,CKTcircuit*,double*); extern int HSMHVnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); +extern int HSMHVnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/hisimhv1/hsmhvinit.c b/src/spicelib/devices/hisimhv1/hsmhvinit.c index 53d7759a0..d11f72b6a 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvinit.c +++ b/src/spicelib/devices/hisimhv1/hsmhvinit.c @@ -70,7 +70,8 @@ SPICEdev HSMHVinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &HSMHViSize, - /* DEVmodSize */ &HSMHVmSize + /* DEVmodSize */ &HSMHVmSize, + /* DEVnodeIsNonLinear */ HSMHVnodeIsNonLinear }; diff --git a/src/spicelib/devices/hisimhv1/hsmhvnode.c b/src/spicelib/devices/hisimhv1/hsmhvnode.c new file mode 100644 index 000000000..ded982f1c --- /dev/null +++ b/src/spicelib/devices/hisimhv1/hsmhvnode.c @@ -0,0 +1,35 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "hsmhvdef.h" +#include "ngspice/sperror.h" + +int +HSMHVnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + HSMHVmodel *model = (HSMHVmodel *)inModel ; + HSMHVinstance *here ; + + /* loop through all the HSMHV models */ + for ( ; model != NULL ; model = model->HSMHVnextModel) + { + /* loop through all the instances of the model */ + for (here = model->HSMHVinstances ; here != NULL ; here = here->HSMHVnextInstance) + { + ckt->CKTnodeIsLinear [here->HSMHVdNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVsNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVgNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVdbNode] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVbNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVsbNode] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVtempNode] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVqiNode] = 0 ; + ckt->CKTnodeIsLinear [here->HSMHVqbNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/ind/indinit.c b/src/spicelib/devices/ind/indinit.c index 7eea1fcd2..8e50bacad 100644 --- a/src/spicelib/devices/ind/indinit.c +++ b/src/spicelib/devices/ind/indinit.c @@ -71,7 +71,8 @@ SPICEdev INDinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &INDiSize, - /* DEVmodSize */ &INDmSize + /* DEVmodSize */ &INDmSize, + /* DEVnodeIsNonLinear */ NULL }; @@ -139,8 +140,9 @@ SPICEdev MUTinfo = { /* DEVdump */ NULL, /* DEVacct */ NULL, #endif - &MUTiSize, - &MUTmSize + /* DEVinstSize */ &MUTiSize, + /* DEVmodSize */ &MUTmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/isrc/isrcinit.c b/src/spicelib/devices/isrc/isrcinit.c index da4301fe7..3cfb594b3 100644 --- a/src/spicelib/devices/isrc/isrcinit.c +++ b/src/spicelib/devices/isrc/isrcinit.c @@ -72,7 +72,8 @@ SPICEdev ISRCinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &ISRCiSize, - /* DEVmodSize */ &ISRCmSize + /* DEVmodSize */ &ISRCmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/jfet/Makefile.am b/src/spicelib/devices/jfet/Makefile.am index fc4907373..638e5d4ba 100644 --- a/src/spicelib/devices/jfet/Makefile.am +++ b/src/spicelib/devices/jfet/Makefile.am @@ -20,6 +20,7 @@ libjfet_la_SOURCES = \ jfetmask.c \ jfetmdel.c \ jfetmpar.c \ + jfetnode.c \ jfetnoi.c \ jfetpar.c \ jfetpzld.c \ diff --git a/src/spicelib/devices/jfet/jfetext.h b/src/spicelib/devices/jfet/jfetext.h index 475bdbe1a..8d1bf7ab6 100644 --- a/src/spicelib/devices/jfet/jfetext.h +++ b/src/spicelib/devices/jfet/jfetext.h @@ -22,3 +22,4 @@ extern int JFETtrunc(GENmodel*,CKTcircuit*,double*); extern int JFETdisto(int,GENmodel*,CKTcircuit*); extern int JFETnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int JFETdSetup(GENmodel*,CKTcircuit*); +extern int JFETnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/jfet/jfetinit.c b/src/spicelib/devices/jfet/jfetinit.c index d2a67d1cf..04edab98c 100644 --- a/src/spicelib/devices/jfet/jfetinit.c +++ b/src/spicelib/devices/jfet/jfetinit.c @@ -72,7 +72,8 @@ SPICEdev JFETinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &JFETiSize, - /* DEVmodSize */ &JFETmSize + /* DEVmodSize */ &JFETmSize, + /* DEVnodeIsNonLinear */ JFETnodeIsNonLinear }; diff --git a/src/spicelib/devices/jfet/jfetnode.c b/src/spicelib/devices/jfet/jfetnode.c new file mode 100644 index 000000000..5a88f79ae --- /dev/null +++ b/src/spicelib/devices/jfet/jfetnode.c @@ -0,0 +1,29 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "jfetdefs.h" +#include "ngspice/sperror.h" + +int +JFETnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + JFETmodel *model = (JFETmodel *)inModel ; + JFETinstance *here ; + + /* loop through all the JFET models */ + for ( ; model != NULL ; model = model->JFETnextModel) + { + /* loop through all the instances of the model */ + for (here = model->JFETinstances ; here != NULL ; here = here->JFETnextInstance) + { + ckt->CKTnodeIsLinear [here->JFETsourcePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->JFETdrainPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->JFETgateNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/jfet2/Makefile.am b/src/spicelib/devices/jfet2/Makefile.am index f8789cd9b..2a4199507 100644 --- a/src/spicelib/devices/jfet2/Makefile.am +++ b/src/spicelib/devices/jfet2/Makefile.am @@ -18,6 +18,7 @@ libjfet2_la_SOURCES = \ jfet2mask.c \ jfet2mdel.c \ jfet2mpar.c \ + jfet2node.c \ jfet2noi.c \ jfet2par.c \ jfet2parm.h \ diff --git a/src/spicelib/devices/jfet2/jfet2ext.h b/src/spicelib/devices/jfet2/jfet2ext.h index fc330fe59..4ba82fdd8 100644 --- a/src/spicelib/devices/jfet2/jfet2ext.h +++ b/src/spicelib/devices/jfet2/jfet2ext.h @@ -22,3 +22,4 @@ extern int JFET2unsetup(GENmodel*,CKTcircuit*); extern int JFET2temp(GENmodel*,CKTcircuit*); extern int JFET2trunc(GENmodel*,CKTcircuit*,double*); extern int JFET2noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); +extern int JFET2nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/jfet2/jfet2init.c b/src/spicelib/devices/jfet2/jfet2init.c index 5f1ee084e..d152fbab2 100644 --- a/src/spicelib/devices/jfet2/jfet2init.c +++ b/src/spicelib/devices/jfet2/jfet2init.c @@ -72,7 +72,8 @@ SPICEdev JFET2info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &JFET2iSize, - /* DEVmodSize */ &JFET2mSize + /* DEVmodSize */ &JFET2mSize, + /* DEVnodeIsNonLinear */ JFET2nodeIsNonLinear }; diff --git a/src/spicelib/devices/jfet2/jfet2node.c b/src/spicelib/devices/jfet2/jfet2node.c new file mode 100644 index 000000000..0b41bc3ac --- /dev/null +++ b/src/spicelib/devices/jfet2/jfet2node.c @@ -0,0 +1,29 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "jfet2defs.h" +#include "ngspice/sperror.h" + +int +JFET2nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + JFET2model *model = (JFET2model *)inModel ; + JFET2instance *here ; + + /* loop through all the JFET2 models */ + for ( ; model != NULL ; model = model->JFET2nextModel) + { + /* loop through all the instances of the model */ + for (here = model->JFET2instances ; here != NULL ; here = here->JFET2nextInstance) + { + ckt->CKTnodeIsLinear [here->JFET2sourcePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->JFET2drainPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->JFET2gateNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/ltra/ltrainit.c b/src/spicelib/devices/ltra/ltrainit.c index 5cb81e1bf..2bb17cc78 100644 --- a/src/spicelib/devices/ltra/ltrainit.c +++ b/src/spicelib/devices/ltra/ltrainit.c @@ -72,7 +72,8 @@ SPICEdev LTRAinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ <RAiSize, - /* DEVmodSize */ <RAmSize + /* DEVmodSize */ <RAmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/mes/Makefile.am b/src/spicelib/devices/mes/Makefile.am index 3d0c3b3d5..26abe963c 100644 --- a/src/spicelib/devices/mes/Makefile.am +++ b/src/spicelib/devices/mes/Makefile.am @@ -20,6 +20,7 @@ libmes_la_SOURCES = \ mesmask.c \ mesmdel.c \ mesmpar.c \ + mesnode.c \ mesnoise.c \ mesparam.c \ mespzld.c \ diff --git a/src/spicelib/devices/mes/mesext.h b/src/spicelib/devices/mes/mesext.h index 7ff419573..b9ccbbb78 100644 --- a/src/spicelib/devices/mes/mesext.h +++ b/src/spicelib/devices/mes/mesext.h @@ -22,4 +22,4 @@ extern int MEStrunc(GENmodel*,CKTcircuit*,double*); extern int MESdisto(int,GENmodel*,CKTcircuit*); extern int MESnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int MESdSetup(GENmodel*,CKTcircuit*); - +extern int MESnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/mes/mesinit.c b/src/spicelib/devices/mes/mesinit.c index 81db8ac17..d39f2c89a 100644 --- a/src/spicelib/devices/mes/mesinit.c +++ b/src/spicelib/devices/mes/mesinit.c @@ -72,7 +72,8 @@ SPICEdev MESinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &MESiSize, - /* DEVmodSize */ &MESmSize + /* DEVmodSize */ &MESmSize, + /* DEVnodeIsNonLinear */ MESnodeIsNonLinear }; diff --git a/src/spicelib/devices/mes/mesnode.c b/src/spicelib/devices/mes/mesnode.c new file mode 100644 index 000000000..4e546167d --- /dev/null +++ b/src/spicelib/devices/mes/mesnode.c @@ -0,0 +1,29 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "mesdefs.h" +#include "ngspice/sperror.h" + +int +MESnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + MESmodel *model = (MESmodel *)inModel ; + MESinstance *here ; + + /* loop through all the MES models */ + for ( ; model != NULL ; model = model->MESnextModel) + { + /* loop through all the instances of the model */ + for (here = model->MESinstances ; here != NULL ; here = here->MESnextInstance) + { + ckt->CKTnodeIsLinear [here->MESsourcePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->MESdrainPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->MESgateNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/mesa/Makefile.am b/src/spicelib/devices/mesa/Makefile.am index 79e6f7555..119d4b60b 100644 --- a/src/spicelib/devices/mesa/Makefile.am +++ b/src/spicelib/devices/mesa/Makefile.am @@ -18,6 +18,7 @@ libmesa_la_SOURCES = \ mesamask.c \ mesamdel.c \ mesamparam.c \ + mesanode.c \ mesaparam.c \ mesapzl.c \ mesasetup.c \ diff --git a/src/spicelib/devices/mesa/mesaext.h b/src/spicelib/devices/mesa/mesaext.h index a1967cf44..6f6c1334d 100644 --- a/src/spicelib/devices/mesa/mesaext.h +++ b/src/spicelib/devices/mesa/mesaext.h @@ -18,3 +18,4 @@ extern int MESAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int MESAtemp(GENmodel*,CKTcircuit*); extern int MESAtrunc(GENmodel*,CKTcircuit*,double*); extern int MESAunsetup(GENmodel*,CKTcircuit*); +extern int MESAnodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/mesa/mesainit.c b/src/spicelib/devices/mesa/mesainit.c index fac27cc1e..2c9f42578 100644 --- a/src/spicelib/devices/mesa/mesainit.c +++ b/src/spicelib/devices/mesa/mesainit.c @@ -72,7 +72,8 @@ SPICEdev MESAinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &MESAiSize, - /* DEVmodSize */ &MESAmSize + /* DEVmodSize */ &MESAmSize, + /* DEVnodeIsNonLinear */ MESAnodeIsNonLinear }; diff --git a/src/spicelib/devices/mesa/mesanode.c b/src/spicelib/devices/mesa/mesanode.c new file mode 100644 index 000000000..857282738 --- /dev/null +++ b/src/spicelib/devices/mesa/mesanode.c @@ -0,0 +1,31 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "mesadefs.h" +#include "ngspice/sperror.h" + +int +MESAnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + MESAmodel *model = (MESAmodel *)inModel ; + MESAinstance *here ; + + /* loop through all the MESA models */ + for ( ; model != NULL ; model = model->MESAnextModel) + { + /* loop through all the instances of the model */ + for (here = model->MESAinstances ; here != NULL ; here = here->MESAnextInstance) + { + ckt->CKTnodeIsLinear [here->MESAsourcePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->MESAdrainPrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->MESAgatePrimeNode] = 0 ; + ckt->CKTnodeIsLinear [here->MESAsourcePrmPrmNode] = 0 ; + ckt->CKTnodeIsLinear [here->MESAdrainPrmPrmNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/mos1/Makefile.am b/src/spicelib/devices/mos1/Makefile.am index e523c113c..7b0f728c7 100644 --- a/src/spicelib/devices/mos1/Makefile.am +++ b/src/spicelib/devices/mos1/Makefile.am @@ -21,6 +21,7 @@ libmos1_la_SOURCES = \ mos1mask.c \ mos1mdel.c \ mos1mpar.c \ + mos1node.c \ mos1noi.c \ mos1par.c \ mos1pzld.c \ diff --git a/src/spicelib/devices/mos1/mos1ext.h b/src/spicelib/devices/mos1/mos1ext.h index b1ed69d52..d198c1d86 100644 --- a/src/spicelib/devices/mos1/mos1ext.h +++ b/src/spicelib/devices/mos1/mos1ext.h @@ -28,3 +28,4 @@ extern int MOS1convTest(GENmodel*,CKTcircuit*); extern int MOS1disto(int,GENmodel*,CKTcircuit*); extern int MOS1noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int MOS1dSetup(GENmodel*,CKTcircuit*); +extern int MOS1nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/mos1/mos1init.c b/src/spicelib/devices/mos1/mos1init.c index 85f30088d..c66987378 100644 --- a/src/spicelib/devices/mos1/mos1init.c +++ b/src/spicelib/devices/mos1/mos1init.c @@ -72,7 +72,8 @@ SPICEdev MOS1info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &MOS1iSize, - /* DEVmodSize */ &MOS1mSize + /* DEVmodSize */ &MOS1mSize, + /* DEVnodeIsNonLinear */ MOS1nodeIsNonLinear }; diff --git a/src/spicelib/devices/mos1/mos1node.c b/src/spicelib/devices/mos1/mos1node.c new file mode 100644 index 000000000..787e09ee5 --- /dev/null +++ b/src/spicelib/devices/mos1/mos1node.c @@ -0,0 +1,30 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "mos1defs.h" +#include "ngspice/sperror.h" + +int +MOS1nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + MOS1model *model = (MOS1model *)inModel ; + MOS1instance *here ; + + /* loop through all the MOS1 models */ + for ( ; model != NULL ; model = model->MOS1nextModel) + { + /* loop through all the instances of the model */ + for (here = model->MOS1instances ; here != NULL ; here = here->MOS1nextInstance) + { + ckt->CKTnodeIsLinear [here->MOS1dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS1sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS1gNode] = 0 ; + ckt->CKTnodeIsLinear [here->MOS1bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/mos2/Makefile.am b/src/spicelib/devices/mos2/Makefile.am index a27ddc9d2..8f9cb0bd1 100644 --- a/src/spicelib/devices/mos2/Makefile.am +++ b/src/spicelib/devices/mos2/Makefile.am @@ -21,6 +21,7 @@ libmos2_la_SOURCES = \ mos2mask.c \ mos2mdel.c \ mos2mpar.c \ + mos2node.c \ mos2noi.c \ mos2par.c \ mos2pzld.c \ diff --git a/src/spicelib/devices/mos2/mos2ext.h b/src/spicelib/devices/mos2/mos2ext.h index 46a8a3e38..6364ae5ad 100644 --- a/src/spicelib/devices/mos2/mos2ext.h +++ b/src/spicelib/devices/mos2/mos2ext.h @@ -27,5 +27,5 @@ extern int MOS2temp(GENmodel*,CKTcircuit*); extern int MOS2trunc(GENmodel*,CKTcircuit*,double*); extern int MOS2disto(int,GENmodel*,CKTcircuit*); extern int MOS2noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); - extern int MOS2dSetup(GENmodel*,CKTcircuit*); +extern int MOS2nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/mos2/mos2init.c b/src/spicelib/devices/mos2/mos2init.c index e7e47fd9b..647128be3 100644 --- a/src/spicelib/devices/mos2/mos2init.c +++ b/src/spicelib/devices/mos2/mos2init.c @@ -72,7 +72,8 @@ SPICEdev MOS2info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &MOS2iSize, - /* DEVmodSize */ &MOS2mSize + /* DEVmodSize */ &MOS2mSize, + /* DEVnodeIsNonLinear */ MOS2nodeIsNonLinear }; diff --git a/src/spicelib/devices/mos2/mos2node.c b/src/spicelib/devices/mos2/mos2node.c new file mode 100644 index 000000000..287ab8156 --- /dev/null +++ b/src/spicelib/devices/mos2/mos2node.c @@ -0,0 +1,30 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "mos2defs.h" +#include "ngspice/sperror.h" + +int +MOS2nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + MOS2model *model = (MOS2model *)inModel ; + MOS2instance *here ; + + /* loop through all the MOS2 models */ + for ( ; model != NULL ; model = model->MOS2nextModel) + { + /* loop through all the instances of the model */ + for (here = model->MOS2instances ; here != NULL ; here = here->MOS2nextInstance) + { + ckt->CKTnodeIsLinear [here->MOS2dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS2sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS2gNode] = 0 ; + ckt->CKTnodeIsLinear [here->MOS2bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/mos3/Makefile.am b/src/spicelib/devices/mos3/Makefile.am index 7419051a9..fe0f1eac6 100644 --- a/src/spicelib/devices/mos3/Makefile.am +++ b/src/spicelib/devices/mos3/Makefile.am @@ -21,6 +21,7 @@ libmos3_la_SOURCES = \ mos3mask.c \ mos3mdel.c \ mos3mpar.c \ + mos3node.c \ mos3noi.c \ mos3par.c \ mos3pzld.c \ diff --git a/src/spicelib/devices/mos3/mos3ext.h b/src/spicelib/devices/mos3/mos3ext.h index 843d68329..9777be02d 100644 --- a/src/spicelib/devices/mos3/mos3ext.h +++ b/src/spicelib/devices/mos3/mos3ext.h @@ -28,3 +28,4 @@ extern int MOS3trunc(GENmodel*,CKTcircuit*,double*); extern int MOS3disto(int,GENmodel*,CKTcircuit*); extern int MOS3noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int MOS3dSetup(GENmodel*,CKTcircuit*); +extern int MOS3nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/mos3/mos3init.c b/src/spicelib/devices/mos3/mos3init.c index a096977ba..93f81face 100644 --- a/src/spicelib/devices/mos3/mos3init.c +++ b/src/spicelib/devices/mos3/mos3init.c @@ -72,7 +72,8 @@ SPICEdev MOS3info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &MOS3iSize, - /* DEVmodSize */ &MOS3mSize + /* DEVmodSize */ &MOS3mSize, + /* DEVnodeIsNonLinear */ MOS3nodeIsNonLinear }; diff --git a/src/spicelib/devices/mos3/mos3node.c b/src/spicelib/devices/mos3/mos3node.c new file mode 100644 index 000000000..09a7c2efa --- /dev/null +++ b/src/spicelib/devices/mos3/mos3node.c @@ -0,0 +1,30 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "mos3defs.h" +#include "ngspice/sperror.h" + +int +MOS3nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + MOS3model *model = (MOS3model *)inModel ; + MOS3instance *here ; + + /* loop through all the MOS3 models */ + for ( ; model != NULL ; model = model->MOS3nextModel) + { + /* loop through all the instances of the model */ + for (here = model->MOS3instances ; here != NULL ; here = here->MOS3nextInstance) + { + ckt->CKTnodeIsLinear [here->MOS3dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS3sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS3gNode] = 0 ; + ckt->CKTnodeIsLinear [here->MOS3bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/mos6/Makefile.am b/src/spicelib/devices/mos6/Makefile.am index 5161dbac3..876c8c5c5 100644 --- a/src/spicelib/devices/mos6/Makefile.am +++ b/src/spicelib/devices/mos6/Makefile.am @@ -16,6 +16,7 @@ libmos6_la_SOURCES = \ mos6load.c \ mos6mask.c \ mos6mpar.c \ + mos6node.c \ mos6par.c \ mos6set.c \ mos6temp.c \ diff --git a/src/spicelib/devices/mos6/mos6ext.h b/src/spicelib/devices/mos6/mos6ext.h index e5d203145..297974142 100644 --- a/src/spicelib/devices/mos6/mos6ext.h +++ b/src/spicelib/devices/mos6/mos6ext.h @@ -19,3 +19,4 @@ extern int MOS6unsetup(GENmodel*,CKTcircuit*); extern int MOS6temp(GENmodel*,CKTcircuit*); extern int MOS6trunc(GENmodel*,CKTcircuit*,double*); extern int MOS6convTest(GENmodel*,CKTcircuit*); +extern int MOS6nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/mos6/mos6init.c b/src/spicelib/devices/mos6/mos6init.c index febf8f691..8cde3a3de 100644 --- a/src/spicelib/devices/mos6/mos6init.c +++ b/src/spicelib/devices/mos6/mos6init.c @@ -72,7 +72,8 @@ SPICEdev MOS6info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &MOS6iSize, - /* DEVmodSize */ &MOS6mSize + /* DEVmodSize */ &MOS6mSize, + /* DEVnodeIsNonLinear */ MOS6nodeIsNonLinear }; diff --git a/src/spicelib/devices/mos6/mos6node.c b/src/spicelib/devices/mos6/mos6node.c new file mode 100644 index 000000000..a9bc47f09 --- /dev/null +++ b/src/spicelib/devices/mos6/mos6node.c @@ -0,0 +1,30 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "mos6defs.h" +#include "ngspice/sperror.h" + +int +MOS6nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + MOS6model *model = (MOS6model *)inModel ; + MOS6instance *here ; + + /* loop through all the MOS6 models */ + for ( ; model != NULL ; model = model->MOS6nextModel) + { + /* loop through all the instances of the model */ + for (here = model->MOS6instances ; here != NULL ; here = here->MOS6nextInstance) + { + ckt->CKTnodeIsLinear [here->MOS6dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS6sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS6gNode] = 0 ; + ckt->CKTnodeIsLinear [here->MOS6bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/mos9/Makefile.am b/src/spicelib/devices/mos9/Makefile.am index 5db83e4c0..6c557b4ce 100644 --- a/src/spicelib/devices/mos9/Makefile.am +++ b/src/spicelib/devices/mos9/Makefile.am @@ -21,6 +21,7 @@ libmos9_la_SOURCES = \ mos9mask.c \ mos9mdel.c \ mos9mpar.c \ + mos9node.c \ mos9noi.c \ mos9par.c \ mos9pzld.c \ diff --git a/src/spicelib/devices/mos9/mos9ext.h b/src/spicelib/devices/mos9/mos9ext.h index c2af0a136..4497953c7 100644 --- a/src/spicelib/devices/mos9/mos9ext.h +++ b/src/spicelib/devices/mos9/mos9ext.h @@ -28,3 +28,4 @@ extern int MOS9trunc(GENmodel*,CKTcircuit*,double*); extern int MOS9disto(int,GENmodel*,CKTcircuit*); extern int MOS9noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int MOS9dSetup(GENmodel*,CKTcircuit*); +extern int MOS9nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/mos9/mos9init.c b/src/spicelib/devices/mos9/mos9init.c index 10a3e82d9..cf1d9b7c8 100644 --- a/src/spicelib/devices/mos9/mos9init.c +++ b/src/spicelib/devices/mos9/mos9init.c @@ -72,7 +72,8 @@ SPICEdev MOS9info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &MOS9iSize, - /* DEVmodSize */ &MOS9mSize + /* DEVmodSize */ &MOS9mSize, + /* DEVnodeIsNonLinear */ MOS9nodeIsNonLinear }; diff --git a/src/spicelib/devices/mos9/mos9node.c b/src/spicelib/devices/mos9/mos9node.c new file mode 100644 index 000000000..b03096a70 --- /dev/null +++ b/src/spicelib/devices/mos9/mos9node.c @@ -0,0 +1,30 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "mos9defs.h" +#include "ngspice/sperror.h" + +int +MOS9nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + MOS9model *model = (MOS9model *)inModel ; + MOS9instance *here ; + + /* loop through all the MOS9 models */ + for ( ; model != NULL ; model = model->MOS9nextModel) + { + /* loop through all the instances of the model */ + for (here = model->MOS9instances ; here != NULL ; here = here->MOS9nextInstance) + { + ckt->CKTnodeIsLinear [here->MOS9dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS9sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->MOS9gNode] = 0 ; + ckt->CKTnodeIsLinear [here->MOS9bNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/res/resinit.c b/src/spicelib/devices/res/resinit.c index e713e603b..1b92472e1 100644 --- a/src/spicelib/devices/res/resinit.c +++ b/src/spicelib/devices/res/resinit.c @@ -72,7 +72,8 @@ SPICEdev RESinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &RESiSize, - /* DEVmodSize */ &RESmSize + /* DEVmodSize */ &RESmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/soi3/Makefile.am b/src/spicelib/devices/soi3/Makefile.am index 09b1591dd..4d7060ded 100644 --- a/src/spicelib/devices/soi3/Makefile.am +++ b/src/spicelib/devices/soi3/Makefile.am @@ -20,6 +20,7 @@ libsoi3_la_SOURCES = \ soi3mask.c \ soi3mdel.c \ soi3mpar.c \ + soi3node.c \ soi3nois.c \ soi3par.c \ soi3set.c \ diff --git a/src/spicelib/devices/soi3/soi3ext.h b/src/spicelib/devices/soi3/soi3ext.h index c7e194acd..38ea2805f 100644 --- a/src/spicelib/devices/soi3/soi3ext.h +++ b/src/spicelib/devices/soi3/soi3ext.h @@ -65,3 +65,4 @@ extern int SOI3convTest(GENmodel*,CKTcircuit*); /* extern int SOI3disto(int,GENmodel*,CKTcircuit*); */ extern int SOI3noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); +extern int SOI3nodeIsNonLinear (GENmodel *, CKTcircuit *) ; diff --git a/src/spicelib/devices/soi3/soi3init.c b/src/spicelib/devices/soi3/soi3init.c index 9a4a8f676..29e3589e1 100644 --- a/src/spicelib/devices/soi3/soi3init.c +++ b/src/spicelib/devices/soi3/soi3init.c @@ -72,7 +72,8 @@ SPICEdev SOI3info = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &SOI3iSize, - /* DEVmodSize */ &SOI3mSize + /* DEVmodSize */ &SOI3mSize, + /* DEVnodeIsNonLinear */ SOI3nodeIsNonLinear }; diff --git a/src/spicelib/devices/soi3/soi3node.c b/src/spicelib/devices/soi3/soi3node.c new file mode 100644 index 000000000..5f15572e5 --- /dev/null +++ b/src/spicelib/devices/soi3/soi3node.c @@ -0,0 +1,36 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "soi3defs.h" +#include "ngspice/sperror.h" + +int +SOI3nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + SOI3model *model = (SOI3model *)inModel ; + SOI3instance *here ; + + /* loop through all the SOI3 models */ + for ( ; model != NULL ; model = model->SOI3nextModel) + { + /* loop through all the instances of the model */ + for (here = model->SOI3instances ; here != NULL ; here = here->SOI3nextInstance) + { + ckt->CKTnodeIsLinear [here->SOI3dNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3sNodePrime] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3tout1Node] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3tout2Node] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3tout3Node] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3tout4Node] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3gfNode] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3gbNode] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3bNode] = 0 ; + ckt->CKTnodeIsLinear [here->SOI3toutNode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/sw/swinit.c b/src/spicelib/devices/sw/swinit.c index 4daf3f41e..cf8049300 100644 --- a/src/spicelib/devices/sw/swinit.c +++ b/src/spicelib/devices/sw/swinit.c @@ -73,7 +73,8 @@ SPICEdev SWinfo = { /* DEVacct */ NULL, #endif /* CIDER */ /* DEVinstSize */ &SWiSize, - /* DEVmodSize */ &SWmSize + /* DEVmodSize */ &SWmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/tra/trainit.c b/src/spicelib/devices/tra/trainit.c index c6c0883b8..38601b2ed 100644 --- a/src/spicelib/devices/tra/trainit.c +++ b/src/spicelib/devices/tra/trainit.c @@ -72,7 +72,8 @@ SPICEdev TRAinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &TRAiSize, - /* DEVmodSize */ &TRAmSize + /* DEVmodSize */ &TRAmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/txl/txlinit.c b/src/spicelib/devices/txl/txlinit.c index 1e8a72d37..2437ed414 100644 --- a/src/spicelib/devices/txl/txlinit.c +++ b/src/spicelib/devices/txl/txlinit.c @@ -76,8 +76,9 @@ SPICEdev TXLinfo = { /* DEVdump */ NULL, /* DEVacct */ NULL, #endif - &TXLiSize, - &TXLmSize + /* DEVinstSize */ &TXLiSize, + /* DEVmodSize */ &TXLmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/urc/urcinit.c b/src/spicelib/devices/urc/urcinit.c index 31c2eb8a1..d415f9774 100644 --- a/src/spicelib/devices/urc/urcinit.c +++ b/src/spicelib/devices/urc/urcinit.c @@ -72,7 +72,8 @@ SPICEdev URCinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &URCiSize, - /* DEVmodSize */ &URCmSize + /* DEVmodSize */ &URCmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/vbic/Makefile.am b/src/spicelib/devices/vbic/Makefile.am index 0ea84de4f..ccbb722c0 100644 --- a/src/spicelib/devices/vbic/Makefile.am +++ b/src/spicelib/devices/vbic/Makefile.am @@ -19,6 +19,7 @@ libvbic_la_SOURCES = \ vbicmask.c \ vbicmdel.c \ vbicmpar.c \ + vbicnode.c \ vbicnoise.c \ vbicparam.c \ vbicpzld.c \ diff --git a/src/spicelib/devices/vbic/vbicext.h b/src/spicelib/devices/vbic/vbicext.h index 96e0d11bc..8e97121e5 100644 --- a/src/spicelib/devices/vbic/vbicext.h +++ b/src/spicelib/devices/vbic/vbicext.h @@ -25,5 +25,6 @@ extern int VBICunsetup(GENmodel*,CKTcircuit*); extern int VBICtemp(GENmodel*,CKTcircuit*); extern int VBICtrunc(GENmodel*,CKTcircuit*,double*); extern int VBICnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); +extern int VBICnodeIsNonLinear (GENmodel *, CKTcircuit *) ; #endif diff --git a/src/spicelib/devices/vbic/vbicinit.c b/src/spicelib/devices/vbic/vbicinit.c index 1ddfabb15..6cb4f1796 100644 --- a/src/spicelib/devices/vbic/vbicinit.c +++ b/src/spicelib/devices/vbic/vbicinit.c @@ -77,7 +77,8 @@ SPICEdev VBICinfo = { NULL, /* DEVacct */ #endif &VBICiSize, /* DEVinstSize */ - &VBICmSize /* DEVmodSize */ + &VBICmSize, /* DEVmodSize */ + VBICnodeIsNonLinear /* DEVnodeIsNonLinear */ }; diff --git a/src/spicelib/devices/vbic/vbicnode.c b/src/spicelib/devices/vbic/vbicnode.c new file mode 100644 index 000000000..447ae8a66 --- /dev/null +++ b/src/spicelib/devices/vbic/vbicnode.c @@ -0,0 +1,33 @@ +/********** +Author: 2013 Francesco Lannutti +**********/ + +#include "ngspice/ngspice.h" +#include "ngspice/cktdefs.h" +#include "vbicdefs.h" +#include "ngspice/sperror.h" + +int +VBICnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt) +{ + VBICmodel *model = (VBICmodel *)inModel ; + VBICinstance *here ; + + /* loop through all the VBIC models */ + for ( ; model != NULL ; model = model->VBICnextModel) + { + /* loop through all the instances of the model */ + for (here = model->VBICinstances ; here != NULL ; here = here->VBICnextInstance) + { + ckt->CKTnodeIsLinear [here->VBICcollCXNode] = 0 ; + ckt->CKTnodeIsLinear [here->VBICbaseBXNode] = 0 ; + ckt->CKTnodeIsLinear [here->VBICemitEINode] = 0 ; + ckt->CKTnodeIsLinear [here->VBICsubsSINode] = 0 ; + ckt->CKTnodeIsLinear [here->VBICcollCINode] = 0 ; + ckt->CKTnodeIsLinear [here->VBICbaseBPNode] = 0 ; + ckt->CKTnodeIsLinear [here->VBICbaseBINode] = 0 ; + } + } + + return (OK) ; +} diff --git a/src/spicelib/devices/vccs/vccsinit.c b/src/spicelib/devices/vccs/vccsinit.c index bf633a526..4c7c02dca 100644 --- a/src/spicelib/devices/vccs/vccsinit.c +++ b/src/spicelib/devices/vccs/vccsinit.c @@ -72,8 +72,8 @@ SPICEdev VCCSinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &VCCSiSize, - /* DEVmodSize */ &VCCSmSize - + /* DEVmodSize */ &VCCSmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/vcvs/vcvsinit.c b/src/spicelib/devices/vcvs/vcvsinit.c index b48f3cbf0..8b87288e4 100644 --- a/src/spicelib/devices/vcvs/vcvsinit.c +++ b/src/spicelib/devices/vcvs/vcvsinit.c @@ -72,7 +72,8 @@ SPICEdev VCVSinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &VCVSiSize, - /* DEVmodSize */ &VCVSmSize + /* DEVmodSize */ &VCVSmSize, + /* DEVnodeIsNonLinear */ NULL }; diff --git a/src/spicelib/devices/vsrc/vsrcinit.c b/src/spicelib/devices/vsrc/vsrcinit.c index f33d93e43..6e6f02e88 100644 --- a/src/spicelib/devices/vsrc/vsrcinit.c +++ b/src/spicelib/devices/vsrc/vsrcinit.c @@ -72,7 +72,8 @@ SPICEdev VSRCinfo = { /* DEVacct */ NULL, #endif /* DEVinstSize */ &VSRCiSize, - /* DEVmodSize */ &VSRCmSize + /* DEVmodSize */ &VSRCmSize, + /* DEVnodeIsNonLinear */ NULL };