diff --git a/src/spicelib/devices/vdmos/vdmosacld.c b/src/spicelib/devices/vdmos/vdmosacld.c index 4a4826994..920cbd611 100644 --- a/src/spicelib/devices/vdmos/vdmosacld.c +++ b/src/spicelib/devices/vdmos/vdmosacld.c @@ -133,19 +133,22 @@ VDMOSacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->VDIORPdPtr +1) -= xceq; if (selfheat) { - *(here->VDMOSDPtempPtr) += GmT; + // Everything is computed for m parallel instances... so scale gthjc and gthja accordingly + double gthjc = here->VDMOSm / model->VDMOSrthjc; + double gthca = here->VDMOSm / model->VDMOSrthca; + *(here->VDMOSDPtempPtr) += GmT; *(here->VDMOSSPtempPtr) += -GmT; - *(here->VDMOSTemptempPtr) += gTtt + 1/model->VDMOSrthjc; - *(here->VDMOSTempgpPtr) += gTtg; - *(here->VDMOSTempdpPtr) += gTtdp; - *(here->VDMOSTempspPtr) += gTtsp; - *(here->VDMOSTemptcasePtr) += -1/model->VDMOSrthjc; - *(here->VDMOSTcasetempPtr) += -1/model->VDMOSrthjc; - *(here->VDMOSTcasetcasePtr) += 1/model->VDMOSrthjc + 1/model->VDMOSrthca; - *(here->VDMOSTptpPtr) += 1/model->VDMOSrthca; - *(here->VDMOSTptcasePtr) += -1/model->VDMOSrthca; - *(here->VDMOSTcasetpPtr) += -1/model->VDMOSrthca; + *(here->VDMOSTemptempPtr) += gTtt + gthjc; + *(here->VDMOSTempgpPtr) += gTtg; + *(here->VDMOSTempdpPtr) += gTtdp; + *(here->VDMOSTempspPtr) += gTtsp; + *(here->VDMOSTemptcasePtr) += -gthjc; + *(here->VDMOSTcasetempPtr) += -gthjc; + *(here->VDMOSTcasetcasePtr) += gthjc + gthca; + *(here->VDMOSTptpPtr) += gthca; + *(here->VDMOSTptcasePtr) += -gthca; + *(here->VDMOSTcasetpPtr) += -gthca; *(here->VDMOSCktTtpPtr) += 1.0; *(here->VDMOSTpcktTPtr) += 1.0; diff --git a/src/spicelib/devices/vdmos/vdmosload.c b/src/spicelib/devices/vdmos/vdmosload.c index ac15a251b..5e93d9174 100644 --- a/src/spicelib/devices/vdmos/vdmosload.c +++ b/src/spicelib/devices/vdmos/vdmosload.c @@ -67,16 +67,17 @@ VDMOSload(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the VDMOS device models */ for (; model != NULL; model = VDMOSnextModel(model)) { - /* VDMOS capacitance parameters */ - const double cgdmin = model->VDMOScgdmin; - const double cgdmax = model->VDMOScgdmax; - const double a = model->VDMOSa; - const double cgs = model->VDMOScgs; /* loop through all the instances of the model */ for (here = VDMOSinstances(model); here != NULL; here = VDMOSnextInstance(here)) { + /* VDMOS capacitance parameters */ + const double cgdmin = here->VDMOSm * model->VDMOScgdmin; + const double cgdmax = here->VDMOSm * model->VDMOScgdmax; + const double a = model->VDMOSa; + const double cgs = here->VDMOSm * model->VDMOScgs; + Temp = here->VDMOStemp; selfheat = (here->VDMOSthermal) && (model->VDMOSrthjcGiven); if (selfheat) @@ -462,8 +463,7 @@ VDMOSload(GENmodel *inModel, CKTcircuit *ckt) * you must add in the other half from previous time * and the constant part */ - // Everything is computed for m parallel instances... scale ggdmin, cgdmax, and cgs accordingly - DevCapVDMOS(vgd, here->VDMOSm*cgdmin, here->VDMOSm*cgdmax, a, here->VDMOSm*cgs, + DevCapVDMOS(vgd, cgdmin, cgdmax, a, cgs, (ckt->CKTstate0 + here->VDMOScapgs), (ckt->CKTstate0 + here->VDMOScapgd)); // Everything is computed for m parallel instances... so scale cthj accordingly