From 099e2c13ebc6abe58bdcedb474678bd3149b1a48 Mon Sep 17 00:00:00 2001 From: dwarning Date: Fri, 25 Sep 2020 21:05:12 +0200 Subject: [PATCH] VDMOS handle thermal as a flag --- src/spicelib/devices/vdmos/vdmosacld.c | 2 +- src/spicelib/devices/vdmos/vdmosconv.c | 2 +- src/spicelib/devices/vdmos/vdmosdefs.h | 1 - src/spicelib/devices/vdmos/vdmosload.c | 2 +- src/spicelib/devices/vdmos/vdmosnoi.c | 2 +- src/spicelib/devices/vdmos/vdmospar.c | 1 - src/spicelib/devices/vdmos/vdmosset.c | 6 +++--- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/spicelib/devices/vdmos/vdmosacld.c b/src/spicelib/devices/vdmos/vdmosacld.c index 9e20e29ad..67aa39f10 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->VDMOSthermalGiven) && (model->VDMOSrthjcGiven); + selfheat = (here->VDMOSthermal) && (model->VDMOSrthjcGiven); if (here->VDMOSmode < 0) { xnrm=0; xrev=1; diff --git a/src/spicelib/devices/vdmos/vdmosconv.c b/src/spicelib/devices/vdmos/vdmosconv.c index aa810b8ce..24ac3a13a 100644 --- a/src/spicelib/devices/vdmos/vdmosconv.c +++ b/src/spicelib/devices/vdmos/vdmosconv.c @@ -44,7 +44,7 @@ VDMOSconvTest(GENmodel *inModel, CKTcircuit *ckt) delvds = vds - *(ckt->CKTstate0 + here->VDMOSvds); delvgd = vgd-vgdo; - selfheat = (here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven); + selfheat = (here->VDMOSthermal) && (model->VDMOSrthjcGiven); if (selfheat) { delTemp = *(ckt->CKTrhs + here->VDMOStempNode); deldelTemp = delTemp - *(ckt->CKTstate0 + here->VDMOSdelTemp); diff --git a/src/spicelib/devices/vdmos/vdmosdefs.h b/src/spicelib/devices/vdmos/vdmosdefs.h index 56b6ae769..60ac33475 100644 --- a/src/spicelib/devices/vdmos/vdmosdefs.h +++ b/src/spicelib/devices/vdmos/vdmosdefs.h @@ -155,7 +155,6 @@ typedef struct sVDMOSinstance { unsigned VDMOSsNodePrimeSet :1; unsigned VDMOSicVDSGiven :1; unsigned VDMOSicVGSGiven :1; - unsigned VDMOSthermalGiven : 1; /* flag indicate self heating on */ unsigned VDMOSvonGiven : 1; unsigned VDMOSvdsatGiven :1; unsigned VDMOSmodeGiven :1; diff --git a/src/spicelib/devices/vdmos/vdmosload.c b/src/spicelib/devices/vdmos/vdmosload.c index 927aee292..1e7b5b552 100644 --- a/src/spicelib/devices/vdmos/vdmosload.c +++ b/src/spicelib/devices/vdmos/vdmosload.c @@ -80,7 +80,7 @@ VDMOSload(GENmodel *inModel, CKTcircuit *ckt) here = VDMOSnextInstance(here)) { Temp = here->VDMOStemp; - selfheat = (here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven); + selfheat = (here->VDMOSthermal) && (model->VDMOSrthjcGiven); if (selfheat) Check_th = 1; else diff --git a/src/spicelib/devices/vdmos/vdmosnoi.c b/src/spicelib/devices/vdmos/vdmosnoi.c index a31a34485..273d4f34e 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->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) + if ((inst->VDMOSthermal) && (model->VDMOSrthjcGiven)) tempRatioSH = inst->VDMOSTempSH / ckt->CKTtemp; else tempRatioSH = 1.0; diff --git a/src/spicelib/devices/vdmos/vdmospar.c b/src/spicelib/devices/vdmos/vdmospar.c index f3c1deb7d..ba9733164 100644 --- a/src/spicelib/devices/vdmos/vdmospar.c +++ b/src/spicelib/devices/vdmos/vdmospar.c @@ -55,7 +55,6 @@ VDMOSparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select) break; case VDMOS_THERMAL: here->VDMOSthermal = (value->iValue != 0); - here->VDMOSthermalGiven = TRUE; break; case VDMOS_IC: /* FALLTHROUGH added to suppress GCC warning due to diff --git a/src/spicelib/devices/vdmos/vdmosset.c b/src/spicelib/devices/vdmos/vdmosset.c index f12393030..22365c3ea 100644 --- a/src/spicelib/devices/vdmos/vdmosset.c +++ b/src/spicelib/devices/vdmos/vdmosset.c @@ -374,7 +374,7 @@ VDMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, here->VDIOposPrimeNode = here->VDMOSsNode; } - if ((here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) { + if ((here->VDMOSthermal) && (model->VDMOSrthjcGiven)) { if (here->VDMOStempNode == -1) { error = CKTmkVolt(ckt,&tmp,here->VDMOSname,"Tj"); if (error) return(error); @@ -435,7 +435,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ TSTALLOC(VDIORPsPtr, VDIOposPrimeNode, VDMOSsNode); TSTALLOC(VDIORPrpPtr, VDIOposPrimeNode, VDIOposPrimeNode); - if ((here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) { + if ((here->VDMOSthermal) && (model->VDMOSrthjcGiven)) { TSTALLOC(VDMOSTemptempPtr, VDMOStempNode, VDMOStempNode); /* Transistor thermal contribution */ TSTALLOC(VDMOSTempdpPtr, VDMOStempNode, VDMOSdNodePrime); TSTALLOC(VDMOSTempspPtr, VDMOStempNode, VDMOSsNodePrime); @@ -498,7 +498,7 @@ VDMOSunsetup(GENmodel *inModel, CKTcircuit *ckt) CKTdltNNum(ckt, here->VDIOposPrimeNode); here->VDIOposPrimeNode = 0; - if ((here->VDMOSthermalGiven) && (model->VDMOSrthjcGiven)) { + if ((here->VDMOSthermal) && (model->VDMOSrthjcGiven)) { if (here->VDMOStNodePrime > 0) CKTdltNNum(ckt, here->VDMOStNodePrime); here->VDMOStNodePrime = 0;