Browse Source

Revert "Remove instance parameter temp. To specify offset to ambient temperature use dtemp instead."

This reverts commit 3340df46ca.
pre-master-46
dwarning 5 months ago
parent
commit
600ff13796
  1. 1
      src/spicelib/devices/vdmos/vdmos.c
  2. 3
      src/spicelib/devices/vdmos/vdmosask.c
  3. 14
      src/spicelib/devices/vdmos/vdmosdefs.h
  4. 16
      src/spicelib/devices/vdmos/vdmosload.c
  5. 4
      src/spicelib/devices/vdmos/vdmospar.c
  6. 4
      src/spicelib/devices/vdmos/vdmosset.c
  7. 5
      src/spicelib/devices/vdmos/vdmostemp.c

1
src/spicelib/devices/vdmos/vdmos.c

@ -16,6 +16,7 @@ IFparm VDMOSpTable[] = { /* parameters */
IP("off", VDMOS_OFF, IF_FLAG, "Device initially off"), IP("off", VDMOS_OFF, IF_FLAG, "Device initially off"),
IOPU("icvds", VDMOS_IC_VDS, IF_REAL, "Initial D-S voltage"), IOPU("icvds", VDMOS_IC_VDS, IF_REAL, "Initial D-S voltage"),
IOPU("icvgs", VDMOS_IC_VGS, IF_REAL, "Initial G-S voltage"), IOPU("icvgs", VDMOS_IC_VGS, IF_REAL, "Initial G-S voltage"),
IOPU("temp", VDMOS_TEMP, IF_REAL, "Instance temperature"),
IOPU("dtemp", VDMOS_DTEMP, IF_REAL, "Instance temperature difference"), IOPU("dtemp", VDMOS_DTEMP, IF_REAL, "Instance temperature difference"),
IP( "ic", VDMOS_IC, IF_REALVEC, "Vector of D-S, G-S voltages"), IP( "ic", VDMOS_IC, IF_REALVEC, "Vector of D-S, G-S voltages"),

3
src/spicelib/devices/vdmos/vdmosask.c

@ -23,6 +23,9 @@ VDMOSask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
NG_IGNORE(select); NG_IGNORE(select);
switch(which) { switch(which) {
case VDMOS_TEMP:
value->rValue = here->VDMOStemp - CONSTCtoK;
return(OK);
case VDMOS_DTEMP: case VDMOS_DTEMP:
value->rValue = here->VDMOSdtemp; value->rValue = here->VDMOSdtemp;
return(OK); return(OK);

14
src/spicelib/devices/vdmos/vdmosdefs.h

@ -148,6 +148,7 @@ typedef struct sVDMOSinstance {
int VDMOSmode; /* device mode : 1 = normal, -1 = inverse */ int VDMOSmode; /* device mode : 1 = normal, -1 = inverse */
unsigned VDMOSoff:1; /* non-zero to indicate device is off for dc analysis*/ unsigned VDMOSoff:1; /* non-zero to indicate device is off for dc analysis*/
unsigned VDMOStempGiven :1; /* instance temperature specified */
unsigned VDMOSdtempGiven :1; /* instance delta temperature specified */ unsigned VDMOSdtempGiven :1; /* instance delta temperature specified */
unsigned VDMOSmGiven :1; unsigned VDMOSmGiven :1;
unsigned VDMOSdNodePrimeSet :1; unsigned VDMOSdNodePrimeSet :1;
@ -346,10 +347,10 @@ typedef struct sVDMOSmodel { /* model structure for a resistor */
double VDMOSgateResistance; double VDMOSgateResistance;
double VDMOSqsResistance; double VDMOSqsResistance;
double VDMOSqsVoltage; double VDMOSqsVoltage;
double VDMOStransconductance; /* input - use tTransconductance */
double VDMOStransconductance; /* input - use tTransconductance */
double VDMOSoxideCapFactor; double VDMOSoxideCapFactor;
double VDMOSvth0; /* input - use tVth */
double VDMOSphi; /* input - use tPhi */
double VDMOSvth0; /* input - use tVth */
double VDMOSphi; /* input - use tPhi */
double VDMOSlambda; double VDMOSlambda;
double VDMOStheta; double VDMOStheta;
double VDMOSfNcoef; double VDMOSfNcoef;
@ -365,10 +366,10 @@ typedef struct sVDMOSmodel { /* model structure for a resistor */
double VDMOSrds; double VDMOSrds;
/* body diode */ /* body diode */
double VDIOjunctionCap; /* input - use tCj */
double VDIOjunctionPot; /* input - use tJctPot */
double VDIOjunctionCap; /* input - use tCj */
double VDIOjunctionPot; /* input - use tJctPot */
double VDIOdepletionCapCoeff; double VDIOdepletionCapCoeff;
double VDIOjctSatCur; /* input - use tSatCur */
double VDIOjctSatCur; /* input - use tSatCur */
double VDIObv; double VDIObv;
double VDIOibv; double VDIOibv;
double VDIObrkdEmissionCoeff; double VDIObrkdEmissionCoeff;
@ -497,6 +498,7 @@ enum {
VDMOS_CG, VDMOS_CG,
VDMOS_CS, VDMOS_CS,
VDMOS_POWER, VDMOS_POWER,
VDMOS_TEMP,
VDMOS_M, VDMOS_M,
VDMOS_DTEMP, VDMOS_DTEMP,
VDMOS_THERMAL, VDMOS_THERMAL,

16
src/spicelib/devices/vdmos/vdmosload.c

@ -296,18 +296,16 @@ VDMOSload(GENmodel *inModel, CKTcircuit *ckt)
/* Calculate temperature dependent values for self-heating effect */ /* Calculate temperature dependent values for self-heating effect */
if (selfheat) { if (selfheat) {
Beta = here->VDMOStTransconductance;
dBeta_dT = Beta * model->VDMOSmu * pow(Temp, model->VDMOSmu-1) / pow(model->VDMOStnom, model->VDMOSmu);
rd0T = here->VDMOSdrainResistance;
if (model->VDMOStexp0Given)
drd0T_dT = rd0T * model->VDMOStexp0 * pow(Temp, model->VDMOStexp0-1) / pow(model->VDMOStnom, model->VDMOStexp0);
else
drd0T_dT = rd0T * (model->VDMOStrd1 + model->VDMOStrd2*(2*model->VDMOStnom*Temp - model->VDMOStnom*model->VDMOStnom));
double TempRatio = Temp / here->VDMOStemp;
Beta = here->VDMOStTransconductance * pow(TempRatio,model->VDMOSmu);
dBeta_dT = Beta * model->VDMOSmu / Temp;
rd0T = here->VDMOSdrainResistance * pow(TempRatio, model->VDMOStexp0);
drd0T_dT = rd0T * model->VDMOStexp0 / Temp;
rd1T = 0.0; rd1T = 0.0;
drd1T_dT = 0.0; drd1T_dT = 0.0;
if (model->VDMOSqsGiven) { if (model->VDMOSqsGiven) {
rd1T = here->VDMOSqsResistance;
drd1T_dT = rd1T * model->VDMOStexp1 * pow(Temp, model->VDMOStexp1-1) / pow(model->VDMOStnom, model->VDMOStexp1);
rd1T = here->VDMOSqsResistance * pow(TempRatio, model->VDMOStexp1);
drd1T_dT = rd1T * model->VDMOStexp1 / Temp;
} }
} else { } else {
Beta = here->VDMOStTransconductance; Beta = here->VDMOStTransconductance;

4
src/spicelib/devices/vdmos/vdmospar.c

@ -30,6 +30,10 @@ VDMOSparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
scale = 1; scale = 1;
switch (param) { switch (param) {
case VDMOS_TEMP:
here->VDMOStemp = value->rValue+CONSTCtoK;
here->VDMOStempGiven = TRUE;
break;
case VDMOS_DTEMP: case VDMOS_DTEMP:
here->VDMOSdtemp = value->rValue; here->VDMOSdtemp = value->rValue;
here->VDMOSdtempGiven = TRUE; here->VDMOSdtempGiven = TRUE;

4
src/spicelib/devices/vdmos/vdmosset.c

@ -304,10 +304,6 @@ VDMOSsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
here->VDIOconductance = 0.0; here->VDIOconductance = 0.0;
} }
if (!here->VDMOSdtempGiven) here->VDMOSdtemp = 0.0;
here->VDMOStemp = ckt->CKTtemp + here->VDMOSdtemp;
if (model->VDMOSdrainResistance > 0) { if (model->VDMOSdrainResistance > 0) {
if (here->VDMOSdNodePrime == 0) { if (here->VDMOSdNodePrime == 0) {
error = CKTmkVolt(ckt, &tmp, here->VDMOSname, "drain"); error = CKTmkVolt(ckt, &tmp, here->VDMOSname, "drain");

5
src/spicelib/devices/vdmos/vdmostemp.c

@ -191,6 +191,11 @@ VDMOStemp(GENmodel *inModel, CKTcircuit *ckt)
/* loop through all the instances */ /* loop through all the instances */
for(here=VDMOSinstances(model);here;here=VDMOSnextInstance(here)) { for(here=VDMOSinstances(model);here;here=VDMOSnextInstance(here)) {
if(!here->VDMOSdtempGiven) here->VDMOSdtemp = 0.0;
if(!here->VDMOStempGiven)
here->VDMOStemp = ckt->CKTtemp + here->VDMOSdtemp;
VDMOStempUpdate(model, here, here->VDMOStemp, ckt); VDMOStempUpdate(model, here, here->VDMOStemp, ckt);
} /* instance */ } /* instance */

Loading…
Cancel
Save