diff --git a/src/spicelib/devices/mos3/mos3.c b/src/spicelib/devices/mos3/mos3.c index 3d4532ea2..b64ea5829 100644 --- a/src/spicelib/devices/mos3/mos3.c +++ b/src/spicelib/devices/mos3/mos3.c @@ -37,6 +37,7 @@ IFparm MOS3pTable[] = { /* parameters */ IOPAU("icvbs", MOS3_IC_VBS, IF_REAL , "Initial B-S voltage"), IOPU("ic", MOS3_IC, IF_REALVEC, "Vector of D-S, G-S, B-S voltages"), IOPU("temp", MOS3_TEMP, IF_REAL , "Instance operating temperature"), + IOPU("dtemp", MOS3_DTEMP, IF_REAL , "Instance temperature difference"), IP("sens_l", MOS3_L_SENS, IF_FLAG, "flag to request sensitivity WRT length"), IP("sens_w", MOS3_W_SENS, IF_FLAG, "flag to request sensitivity WRT width"), OPU("dnode", MOS3_DNODE, IF_INTEGER, "Number of drain node"), diff --git a/src/spicelib/devices/mos3/mos3acld.c b/src/spicelib/devices/mos3/mos3acld.c index 761f5e47a..ea2d82854 100644 --- a/src/spicelib/devices/mos3/mos3acld.c +++ b/src/spicelib/devices/mos3/mos3acld.c @@ -14,9 +14,7 @@ Modified: 2000 AlansFixes int -MOS3acLoad(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +MOS3acLoad(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3ask.c b/src/spicelib/devices/mos3/mos3ask.c index 5275b6578..ef413f9dd 100644 --- a/src/spicelib/devices/mos3/mos3ask.c +++ b/src/spicelib/devices/mos3/mos3ask.c @@ -15,12 +15,8 @@ Modified: 2000 AlansFixes /*ARGSUSED*/ int -MOS3ask(ckt,inst,which,value,select) - CKTcircuit *ckt; - GENinstance *inst; - int which; - IFvalue *value; - IFvalue *select; +MOS3ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, + IFvalue *select) { MOS3instance *here = (MOS3instance *)inst; double vr; @@ -33,6 +29,9 @@ MOS3ask(ckt,inst,which,value,select) case MOS3_TEMP: value->rValue = here->MOS3temp-CONSTCtoK; return(OK); + case MOS3_DTEMP: + value->rValue = here->MOS3dtemp; + return(OK); case MOS3_CGS: value->rValue = 2* *(ckt->CKTstate0 + here->MOS3capgs); return(OK); diff --git a/src/spicelib/devices/mos3/mos3conv.c b/src/spicelib/devices/mos3/mos3conv.c index 2da77c09f..5c18abc37 100644 --- a/src/spicelib/devices/mos3/mos3conv.c +++ b/src/spicelib/devices/mos3/mos3conv.c @@ -10,9 +10,7 @@ Author: 1985 Thomas L. Quarles #include "suffix.h" int -MOS3convTest(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +MOS3convTest(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3defs.h b/src/spicelib/devices/mos3/mos3defs.h index 8569eb597..c0cff0ef6 100644 --- a/src/spicelib/devices/mos3/mos3defs.h +++ b/src/spicelib/devices/mos3/mos3defs.h @@ -43,6 +43,7 @@ typedef struct sMOS3instance { double MOS3sourceConductance; /*conductance of source(or 0):set in setup*/ double MOS3drainConductance; /*conductance of drain(or 0):set in setup*/ double MOS3temp; /* operating temperature of this instance */ + double MOS3dtemp; /* temperature difference for this instance */ double MOS3tTransconductance; /* temperature corrected transconductance*/ double MOS3tSurfMob; /* temperature corrected surface mobility */ @@ -91,7 +92,8 @@ typedef struct sMOS3instance { unsigned MOS3off :1;/* non-zero to indicate device is off for dc analysis*/ unsigned MOS3tempGiven :1; /* instance temperature specified */ - unsigned MOS3mGiven :1; + unsigned MOS3dtempGiven :1; /* instance temperature difference specified */ + unsigned MOS3mGiven :1; unsigned MOS3lGiven :1; unsigned MOS3wGiven :1; unsigned MOS3drainAreaGiven :1; @@ -496,7 +498,8 @@ typedef struct sMOS3model { /* model structure for a resistor */ #define MOS3_TEMP 77 #define MOS3_SOURCERESIST 78 #define MOS3_DRAINRESIST 79 -#define MOS3_M 80 +#define MOS3_M 80 +#define MOS3_DTEMP 81 /* model parameters */ #define MOS3_MOD_VTO 101 diff --git a/src/spicelib/devices/mos3/mos3del.c b/src/spicelib/devices/mos3/mos3del.c index a67d0b24d..2028bdd42 100644 --- a/src/spicelib/devices/mos3/mos3del.c +++ b/src/spicelib/devices/mos3/mos3del.c @@ -12,10 +12,7 @@ Author: 1985 Thomas L. Quarles int -MOS3delete(inModel,name,inst) - GENmodel *inModel; - IFuid name; - GENinstance **inst; +MOS3delete(GENmodel *inModel, IFuid name, GENinstance **inst) { MOS3model *model = (MOS3model *)inModel; MOS3instance **fast = (MOS3instance **)inst; diff --git a/src/spicelib/devices/mos3/mos3dest.c b/src/spicelib/devices/mos3/mos3dest.c index f8b4cadc9..df7131bde 100644 --- a/src/spicelib/devices/mos3/mos3dest.c +++ b/src/spicelib/devices/mos3/mos3dest.c @@ -11,8 +11,7 @@ Author: 1985 Thomas L. Quarles void -MOS3destroy(inModel) - GENmodel **inModel; +MOS3destroy(GENmodel **inModel) { MOS3model **model = (MOS3model **)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3dist.c b/src/spicelib/devices/mos3/mos3dist.c index c8f762a49..25f1a8347 100644 --- a/src/spicelib/devices/mos3/mos3dist.c +++ b/src/spicelib/devices/mos3/mos3dist.c @@ -11,11 +11,7 @@ Author: 1988 Jaijeet S Roychowdhury #include "suffix.h" int -MOS3disto(mode,genmodel,ckt) - GENmodel *genmodel; - CKTcircuit *ckt; - int mode; - +MOS3disto(int mode, GENmodel *genmodel, CKTcircuit *ckt) /* assuming here that ckt->CKTomega has been initialised to * the correct value */ diff --git a/src/spicelib/devices/mos3/mos3dset.c b/src/spicelib/devices/mos3/mos3dset.c index ecebbeaf3..1da1b1fe3 100644 --- a/src/spicelib/devices/mos3/mos3dset.c +++ b/src/spicelib/devices/mos3/mos3dset.c @@ -15,9 +15,7 @@ Modified: 2000 AlansFixes #include "suffix.h" int -MOS3dSetup(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +MOS3dSetup(GENmodel *inModel, CKTcircuit *ckt) /* actually load the current value into the * sparse matrix previously provided */ diff --git a/src/spicelib/devices/mos3/mos3ext.h b/src/spicelib/devices/mos3/mos3ext.h index 4807683a0..843d68329 100644 --- a/src/spicelib/devices/mos3/mos3ext.h +++ b/src/spicelib/devices/mos3/mos3ext.h @@ -4,7 +4,6 @@ Author: 1985 Thomas L. Quarles Modified: 2000 AlansFixes **********/ -#ifdef __STDC__ extern int MOS3acLoad(GENmodel*,CKTcircuit*); extern int MOS3ask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int MOS3convTest(GENmodel *,CKTcircuit *); @@ -29,28 +28,3 @@ 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*); -#else /* stdc */ -extern int MOS3acLoad(); -extern int MOS3ask(); -extern int MOS3convTest(); -extern int MOS3delete(); -extern void MOS3destroy(); -extern int MOS3getic(); -extern int MOS3load(); -extern int MOS3mAsk(); -extern int MOS3mDelete(); -extern int MOS3mParam(); -extern int MOS3param(); -extern int MOS3pzLoad(); -extern int MOS3sAcLoad(); -extern int MOS3sLoad(); -extern void MOS3sPrint(); -extern int MOS3sSetup(); -extern int MOS3sUpdate(); -extern int MOS3setup(); -extern int MOS3unsetup(); -extern int MOS3temp(); -extern int MOS3trunc(); -extern int MOS3disto(); -extern int MOS3noise(); -#endif /* stdc */ diff --git a/src/spicelib/devices/mos3/mos3ic.c b/src/spicelib/devices/mos3/mos3ic.c index 8341b69d0..05d0443a8 100644 --- a/src/spicelib/devices/mos3/mos3ic.c +++ b/src/spicelib/devices/mos3/mos3ic.c @@ -13,9 +13,7 @@ Author: 1985 Thomas L. Quarles int -MOS3getic(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +MOS3getic(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3mask.c b/src/spicelib/devices/mos3/mos3mask.c index 84f599820..2f2c6a156 100644 --- a/src/spicelib/devices/mos3/mos3mask.c +++ b/src/spicelib/devices/mos3/mos3mask.c @@ -18,11 +18,7 @@ Modified: 2000 AlansFixes /*ARGSUSED*/ int -MOS3mAsk(ckt,inst,which,value) - CKTcircuit *ckt; - GENmodel *inst; - int which; - IFvalue *value; +MOS3mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value) { MOS3model *here = (MOS3model *)inst; switch(which) { diff --git a/src/spicelib/devices/mos3/mos3mdel.c b/src/spicelib/devices/mos3/mos3mdel.c index 6deeffe3f..0a230684e 100644 --- a/src/spicelib/devices/mos3/mos3mdel.c +++ b/src/spicelib/devices/mos3/mos3mdel.c @@ -12,10 +12,7 @@ Author: 1985 Thomas L. Quarles int -MOS3mDelete(inModel,modname,kill) - GENmodel **inModel; - IFuid modname; - GENmodel *kill; +MOS3mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) { MOS3model **model = (MOS3model **)inModel; MOS3model *modfast = (MOS3model *)kill; diff --git a/src/spicelib/devices/mos3/mos3mpar.c b/src/spicelib/devices/mos3/mos3mpar.c index a9ee5fbe5..3e3563b18 100644 --- a/src/spicelib/devices/mos3/mos3mpar.c +++ b/src/spicelib/devices/mos3/mos3mpar.c @@ -15,10 +15,7 @@ Modified: 2000 AlansFixes int -MOS3mParam(param,value,inModel) - int param; - IFvalue *value; - GENmodel *inModel; +MOS3mParam(int param, IFvalue *value, GENmodel *inModel) { MOS3model *model = (MOS3model *)inModel; switch(param) { diff --git a/src/spicelib/devices/mos3/mos3noi.c b/src/spicelib/devices/mos3/mos3noi.c index adf6c8e45..96f33a573 100644 --- a/src/spicelib/devices/mos3/mos3noi.c +++ b/src/spicelib/devices/mos3/mos3noi.c @@ -24,13 +24,8 @@ extern void NevalSrc(); extern double Nintegrate(); int -MOS3noise (mode, operation, genmodel, ckt, data, OnDens) - int mode; - int operation; - GENmodel *genmodel; - CKTcircuit *ckt; - Ndata *data; - double *OnDens; +MOS3noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, + Ndata *data, double *OnDens) { MOS3model *firstModel = (MOS3model *) genmodel; MOS3model *model; diff --git a/src/spicelib/devices/mos3/mos3par.c b/src/spicelib/devices/mos3/mos3par.c index 87dd024cc..2cf27a8cb 100644 --- a/src/spicelib/devices/mos3/mos3par.c +++ b/src/spicelib/devices/mos3/mos3par.c @@ -16,11 +16,7 @@ Modified: 2000 AlansFixes /* ARGSUSED */ int -MOS3param(param,value,inst,select) - int param; - IFvalue *value; - GENinstance *inst; - IFvalue *select; +MOS3param(int param, IFvalue *value, GENinstance *inst, IFvalue *select) { MOS3instance *here = (MOS3instance *)inst; switch(param) { @@ -80,6 +76,10 @@ MOS3param(param,value,inst,select) here->MOS3temp = value->rValue+CONSTCtoK; here->MOS3tempGiven = TRUE; break; + case MOS3_DTEMP: + here->MOS3dtemp = value->rValue; + here->MOS3dtempGiven = TRUE; + break; case MOS3_IC: switch(value->v.numValue){ case 3: diff --git a/src/spicelib/devices/mos3/mos3pzld.c b/src/spicelib/devices/mos3/mos3pzld.c index 1776b319b..a44f0a598 100644 --- a/src/spicelib/devices/mos3/mos3pzld.c +++ b/src/spicelib/devices/mos3/mos3pzld.c @@ -15,10 +15,7 @@ Modified: 2000 AlansFixes int -MOS3pzLoad(inModel,ckt,s) - GENmodel *inModel; - CKTcircuit *ckt; - SPcomplex *s; +MOS3pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3sacl.c b/src/spicelib/devices/mos3/mos3sacl.c index 5d334e8e8..a4117cedc 100644 --- a/src/spicelib/devices/mos3/mos3sacl.c +++ b/src/spicelib/devices/mos3/mos3sacl.c @@ -1,6 +1,8 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles + +This function is obsolete (was used by an old sensitivity analysis) **********/ /* actually load the current ac sensitivity @@ -16,9 +18,7 @@ Author: 1985 Thomas L. Quarles #include "suffix.h" int -MOS3sAcLoad(inModel,ckt) -GENmodel *inModel; -CKTcircuit *ckt; +MOS3sAcLoad(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3set.c b/src/spicelib/devices/mos3/mos3set.c index 2662957f1..8fc9d4e4d 100644 --- a/src/spicelib/devices/mos3/mos3set.c +++ b/src/spicelib/devices/mos3/mos3set.c @@ -1,6 +1,6 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Thomas L. Quarlesù +Author: 1985 Thomas L. Quarlesù Modified: 2000 AlansFixes **********/ @@ -16,11 +16,7 @@ Modified: 2000 AlansFixes #define EPSSIL (11.7 * 8.854214871e-12) int -MOS3setup(matrix,inModel,ckt,states) - SMPmatrix *matrix; - GENmodel *inModel; - CKTcircuit *ckt; - int *states; +MOS3setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) /* load the MOS3 device structure with those pointers needed later * for fast matrix loading */ @@ -264,9 +260,7 @@ if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\ } int -MOS3unsetup(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +MOS3unsetup(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3sld.c b/src/spicelib/devices/mos3/mos3sld.c index cea6e2437..d33664af4 100644 --- a/src/spicelib/devices/mos3/mos3sld.c +++ b/src/spicelib/devices/mos3/mos3sld.c @@ -2,6 +2,8 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles Modified: 2000 AlansFixes + +This function is obsolete (was used by an old sensitivity analysis) **********/ /* actually load the current sensitivity @@ -16,9 +18,7 @@ Modified: 2000 AlansFixes #include "suffix.h" int -MOS3sLoad(inModel,ckt) -GENmodel *inModel; -CKTcircuit *ckt; +MOS3sLoad(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3sprt.c b/src/spicelib/devices/mos3/mos3sprt.c index 1bc20e8ac..cd6573e27 100644 --- a/src/spicelib/devices/mos3/mos3sprt.c +++ b/src/spicelib/devices/mos3/mos3sprt.c @@ -2,6 +2,8 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles Modified: 2000 AlansFixes + +This function is obsolete (was used by an old sensitivity analysis) **********/ /* Pretty print the sensitivity info for all the MOS3 @@ -16,9 +18,7 @@ Modified: 2000 AlansFixes #include "suffix.h" void -MOS3sPrint(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +MOS3sPrint(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3sset.c b/src/spicelib/devices/mos3/mos3sset.c index 23ba965ad..4d10762d0 100644 --- a/src/spicelib/devices/mos3/mos3sset.c +++ b/src/spicelib/devices/mos3/mos3sset.c @@ -1,6 +1,8 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles + +This function is obsolete (was used by an old sensitivity analysis) **********/ /* loop through all the devices and @@ -15,9 +17,7 @@ Author: 1985 Thomas L. Quarles #include "suffix.h" int -MOS3sSetup(info,inModel) - SENstruct *info; - GENmodel *inModel; +MOS3sSetup(SENstruct *info, GENmodel *inModel) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3supd.c b/src/spicelib/devices/mos3/mos3supd.c index 22e294e1c..e09472b5c 100644 --- a/src/spicelib/devices/mos3/mos3supd.c +++ b/src/spicelib/devices/mos3/mos3supd.c @@ -1,6 +1,8 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles + +This function is obsolete (was used by an old sensitivity analysis) **********/ #include "ngspice.h" @@ -11,9 +13,7 @@ Author: 1985 Thomas L. Quarles #include "suffix.h" int -MOS3sUpdate(inModel,ckt) -GENmodel *inModel; -CKTcircuit *ckt; +MOS3sUpdate(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; diff --git a/src/spicelib/devices/mos3/mos3temp.c b/src/spicelib/devices/mos3/mos3temp.c index d226ab369..52934f339 100644 --- a/src/spicelib/devices/mos3/mos3temp.c +++ b/src/spicelib/devices/mos3/mos3temp.c @@ -15,9 +15,7 @@ Modified: 2000 AlansFixes #define EPSSIL (11.7 * 8.854214871e-12) int -MOS3temp(inModel,ckt) - GENmodel *inModel; - CKTcircuit *ckt; +MOS3temp(GENmodel *inModel, CKTcircuit *ckt) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here; @@ -126,8 +124,12 @@ MOS3temp(inModel,ckt) /* perform the parameter defaulting */ + if(!here->MOS3dtempGiven) { + here->MOS3dtemp = 0.0; + } + if(!here->MOS3tempGiven) { - here->MOS3temp = ckt->CKTtemp; + here->MOS3temp = ckt->CKTtemp + here->MOS3dtemp; } vt = here->MOS3temp * CONSTKoverQ; ratio = here->MOS3temp/model->MOS3tnom; diff --git a/src/spicelib/devices/mos3/mos3trun.c b/src/spicelib/devices/mos3/mos3trun.c index a60659996..3ec6922a4 100644 --- a/src/spicelib/devices/mos3/mos3trun.c +++ b/src/spicelib/devices/mos3/mos3trun.c @@ -10,10 +10,7 @@ Author: 1985 Thomas L. Quarles #include "suffix.h" int -MOS3trunc(inModel,ckt,timeStep) - GENmodel *inModel; - CKTcircuit *ckt; - double *timeStep; +MOS3trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) { MOS3model *model = (MOS3model *)inModel; MOS3instance *here;