diff --git a/src/spicelib/devices/vbic/vbic.c b/src/spicelib/devices/vbic/vbic.c index 682a7f25b..df398a1ce 100644 --- a/src/spicelib/devices/vbic/vbic.c +++ b/src/spicelib/devices/vbic/vbic.c @@ -184,7 +184,8 @@ IFparm VBICmPTable[] = { /* model parameters */ IOP("vbc_max", VBIC_MOD_VBC_MAX, IF_REAL, "maximum voltage B-C junction"), IOPR("bvbc", VBIC_MOD_VBC_MAX, IF_REAL, "maximum voltage B-C junction"), IOP("vce_max", VBIC_MOD_VCE_MAX, IF_REAL, "maximum voltage C-E branch"), - IOPR("bvce", VBIC_MOD_VCE_MAX, IF_REAL, "maximum voltage C-E branch") + IOPR("bvce", VBIC_MOD_VCE_MAX, IF_REAL, "maximum voltage C-E branch"), + IOP("selft", VBIC_MOD_SELFT, IF_INTEGER, "0: self-heating off, 1: self-heating on") }; char *VBICnames[] = { diff --git a/src/spicelib/devices/vbic/vbicdefs.h b/src/spicelib/devices/vbic/vbicdefs.h index 1ed3f31f1..50653a95f 100644 --- a/src/spicelib/devices/vbic/vbicdefs.h +++ b/src/spicelib/devices/vbic/vbicdefs.h @@ -457,6 +457,7 @@ typedef struct sVBICmodel { /* model structure for a vbic */ double VBICtempExpAVC; double VBICthermalResist; double VBICthermalCapacitance; + int VBICselft; double VBICpunchThroughVoltageBC; double VBICdeplCapCoeff1; double VBICfixedCapacitanceCS; @@ -571,6 +572,7 @@ typedef struct sVBICmodel { /* model structure for a vbic */ unsigned VBICtempExpNFGiven : 1; unsigned VBICtempExpAVCGiven : 1; unsigned VBICthermalResistGiven : 1; + unsigned VBICselftGiven : 1; unsigned VBICthermalCapacitanceGiven : 1; unsigned VBICpunchThroughVoltageBCGiven : 1; unsigned VBICdeplCapCoeff1Given : 1; @@ -734,6 +736,7 @@ enum { VBIC_MOD_VBE_MAX, VBIC_MOD_VBC_MAX, VBIC_MOD_VCE_MAX, + VBIC_MOD_SELFT, }; /* device questions */ diff --git a/src/spicelib/devices/vbic/vbicmask.c b/src/spicelib/devices/vbic/vbicmask.c index d5f61d901..e8d1f94a1 100644 --- a/src/spicelib/devices/vbic/vbicmask.c +++ b/src/spicelib/devices/vbic/vbicmask.c @@ -369,6 +369,9 @@ VBICmAsk(CKTcircuit *ckt, GENmodel *instPtr, int which, IFvalue *value) else value->sValue = "pnp"; return(OK); + case VBIC_MOD_SELFT: + value->iValue = here->VBICselft; + return(OK); default: return(E_BADPARM); } diff --git a/src/spicelib/devices/vbic/vbicmpar.c b/src/spicelib/devices/vbic/vbicmpar.c index 16bd00386..73ed58ad6 100644 --- a/src/spicelib/devices/vbic/vbicmpar.c +++ b/src/spicelib/devices/vbic/vbicmpar.c @@ -509,6 +509,10 @@ VBICmParam(int param, IFvalue *value, GENmodel *inModel) mods->VBICvceMax = value->rValue; mods->VBICvceMaxGiven = TRUE; break; + case VBIC_MOD_SELFT: + mods->VBICselft = value->iValue; + mods->VBICselftGiven = TRUE; + break; default: return(E_BADPARM); } diff --git a/src/spicelib/devices/vbic/vbicsetup.c b/src/spicelib/devices/vbic/vbicsetup.c index ef6b238ea..a0945d47c 100644 --- a/src/spicelib/devices/vbic/vbicsetup.c +++ b/src/spicelib/devices/vbic/vbicsetup.c @@ -391,6 +391,9 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if(!model->VBICvceMaxGiven) { model->VBICvceMax = 1e99; } + if(!model->VBICselftGiven) { + model->VBICselft = 0; + } /* loop through all the instances of the model */ for (here = VBICinstances(model); here != NULL ; @@ -472,7 +475,8 @@ VBICsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } } - if((model->VBICthermalResistGiven) && (model->VBICthermalResist > 0.0)) + if((model->VBICthermalResistGiven) && (model->VBICthermalResist > 0.0) + && model->VBICselftGiven && model->VBICselft == 1) here->VBIC_selfheat = 1; else here->VBIC_selfheat = 0;