diff --git a/src/spicelib/devices/vdmos/vdmosacld.c b/src/spicelib/devices/vdmos/vdmosacld.c index 6a5276372..2a95a90e2 100644 --- a/src/spicelib/devices/vdmos/vdmosacld.c +++ b/src/spicelib/devices/vdmos/vdmosacld.c @@ -35,7 +35,7 @@ VDMOSacLoad(GENmodel *inModel, CKTcircuit *ckt) for(here = VDMOSinstances(model); here!= NULL; here = VDMOSnextInstance(here)) { - selfheat = (here->VDMOStnodeoutGiven) && (model->VDMOSrthjc != 0.0); + selfheat = (here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven); if (here->VDMOSmode < 0) { xnrm=0; xrev=1; diff --git a/src/spicelib/devices/vdmos/vdmosdefs.h b/src/spicelib/devices/vdmos/vdmosdefs.h index 6aaee1645..8fe805a0d 100644 --- a/src/spicelib/devices/vdmos/vdmosdefs.h +++ b/src/spicelib/devices/vdmos/vdmosdefs.h @@ -42,8 +42,8 @@ typedef struct sVDMOSinstance { const int VDMOSdNode; /* number of the gate node of the mosfet */ const int VDMOSgNode; /* number of the gate node of the mosfet */ const int VDMOSsNode; /* number of the source node of the mosfet */ - const int VDMOStempNode; /* number of the temperature node of the mosfet */ - const int VDMOStcaseNode; /* number of the 2nd temperature node of the mosfet */ + int VDMOStempNode; /* number of the temperature node of the mosfet */ + int VDMOStcaseNode; /* number of the 2nd temperature node of the mosfet */ int VDMOSdNodePrime; /* number of the internal drain node of the mosfet */ int VDMOSsNodePrime; /* number of the internal source node of the mosfet */ int VDMOSgNodePrime; /* number of the internal gate node of the mosfet */ diff --git a/src/spicelib/devices/vdmos/vdmosload.c b/src/spicelib/devices/vdmos/vdmosload.c index 55ff97a41..233eb6100 100644 --- a/src/spicelib/devices/vdmos/vdmosload.c +++ b/src/spicelib/devices/vdmos/vdmosload.c @@ -104,7 +104,7 @@ VDMOSload(GENmodel *inModel, CKTcircuit *ckt) for (here = VDMOSinstances(model); here != NULL; here = VDMOSnextInstance(here)) { - selfheat = (here->VDMOStnodeoutGiven) && (model->VDMOSrthjc != 0.0); + selfheat = (here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven); if (selfheat) Check_mos = 1; else diff --git a/src/spicelib/devices/vdmos/vdmosnoi.c b/src/spicelib/devices/vdmos/vdmosnoi.c index 222f686be..48fe0dda8 100644 --- a/src/spicelib/devices/vdmos/vdmosnoi.c +++ b/src/spicelib/devices/vdmos/vdmosnoi.c @@ -91,7 +91,7 @@ VDMOSnoise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, switch (mode) { case N_DENS: - if ((inst->VDMOStnodeoutGiven) && (model->VDMOSrthjc != 0.0)) + if ((inst->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) tempRatioSH = inst->VDMOSTempSH / ckt->CKTtemp; else tempRatioSH = 1.0; diff --git a/src/spicelib/devices/vdmos/vdmosset.c b/src/spicelib/devices/vdmos/vdmosset.c index e8aa30fdf..c763b76bc 100644 --- a/src/spicelib/devices/vdmos/vdmosset.c +++ b/src/spicelib/devices/vdmos/vdmosset.c @@ -119,7 +119,7 @@ VDMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, model->VDMOSeg = 1.11; if (!model->VDMOSrthjcGiven) - model->VDMOSrthjc = 0; + model->VDMOSrthjc = 1.0e-03; if (!model->VDMOSrthcaGiven) model->VDMOSrthca = 100; @@ -312,17 +312,30 @@ VDMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, here->VDIOposPrimeNode = here->VDMOSsNode; } - if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjc!=0.0)) { - if(here->VDMOSvcktTbranch == 0) { + if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) { + if (here->VDMOStempNode == -1) { + error = CKTmkVolt(ckt,&tmp,here->VDMOSname,"Tj"); + if (error) return(error); + here->VDMOStempNode = tmp->number; + } + if (here->VDMOStcaseNode == -1) { + error = CKTmkVolt(ckt,&tmp,here->VDMOSname,"Tc"); + if (error) return(error); + here->VDMOStcaseNode = tmp->number; + } + if(here->VDMOSvcktTbranch == 0) { error = CKTmkCur(ckt,&tmp,here->VDMOSname,"VcktTemp"); if(error) return(error); here->VDMOSvcktTbranch = tmp->number; - } + } if (here->VDMOStNodePrime == 0) { - error = CKTmkVolt(ckt, &tmp, here->VDMOSname, "thermal node"); + error = CKTmkVolt(ckt, &tmp, here->VDMOSname, "cktTemp"); if (error) return(error); here->VDMOStNodePrime = tmp->number; } + } else { + here->VDMOStempNode = 0; + here->VDMOStcaseNode = 0; } /* macro to make elements with built in test for out of memory */ @@ -331,7 +344,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ return(E_NOMEM);\ } } while(0) - if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjc!=0.0)) { + if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) { TSTALLOC(VDMOSTemptempPtr, VDMOStempNode, VDMOStempNode); TSTALLOC(VDMOSTempdpPtr, VDMOStempNode, VDMOSdNodePrime); TSTALLOC(VDMOSTempspPtr, VDMOStempNode, VDMOSsNodePrime); @@ -415,7 +428,7 @@ VDMOSunsetup(GENmodel *inModel, CKTcircuit *ckt) CKTdltNNum(ckt, here->VDIOposPrimeNode); here->VDIOposPrimeNode = 0; - if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjc!=0.0)) { + if ((here->VDMOStnodeoutGiven) && (model->VDMOSrthjcGiven)) { if (here->VDMOStNodePrime > 0) CKTdltNNum(ckt, here->VDMOStNodePrime); here->VDMOStNodePrime = 0;