prevent NaN in sqrt for negative value of model parameter PHI

This commit is contained in:
dwarning 2013-06-25 22:03:32 +02:00
parent e40b1a354c
commit 868235b3b2
5 changed files with 25 additions and 4 deletions

View File

@ -51,7 +51,11 @@ MOS1temp(GENmodel *inModel, CKTcircuit *ckt)
pbfact1 = -2*vtnom *(1.5*log(fact1)+CHARGE*arg1);
/* now model parameter preprocessing */
if (model->MOS1phi <= 0.0) {
SPfrontEnd->IFerror (ERR_FATAL,
"%s: Phi is not positive.",&model->MOS1modName);
return(E_BADPARM);
}
if(!model->MOS1oxideThicknessGiven || model->MOS1oxideThickness == 0) {
model->MOS1oxideCapFactor = 0;
} else {

View File

@ -53,7 +53,11 @@ MOS2temp(GENmodel *inModel, CKTcircuit *ckt)
arg1 = -egfet1/(kt1+kt1)+1.1150877/(CONSTboltz*(REFTEMP+REFTEMP));
pbfact1 = -2*vtnom *(1.5*log(fact1)+CHARGE*arg1);
if (model->MOS2phi <= 0.0) {
SPfrontEnd->IFerror (ERR_FATAL,
"%s: Phi is not positive.",&model->MOS2modName);
return(E_BADPARM);
}
if(!model->MOS2oxideThicknessGiven) {
model->MOS2oxideThickness = 1e-7;
}

View File

@ -53,6 +53,11 @@ MOS3temp(GENmodel *inModel, CKTcircuit *ckt)
CONSTKoverQ);
ni_temp=1.45e16*nifact;
if (model->MOS3phi <= 0.0) {
SPfrontEnd->IFerror (ERR_FATAL,
"%s: Phi is not positive.",&model->MOS3modName);
return(E_BADPARM);
}
model->MOS3oxideCapFactor = 3.9 * 8.854214871e-12/
model->MOS3oxideThickness;
if(!model->MOS3surfaceMobilityGiven) model->MOS3surfaceMobility=600;

View File

@ -50,7 +50,11 @@ MOS6temp(GENmodel *inModel, CKTcircuit *ckt)
pbfact1 = -2*vtnom *(1.5*log(fact1)+CHARGE*arg1);
/* now model parameter preprocessing */
if (model->MOS6phi <= 0.0) {
SPfrontEnd->IFerror (ERR_FATAL,
"%s: Phi is not positive.",&model->MOS6modName);
return(E_BADPARM);
}
if(!model->MOS6oxideThicknessGiven || model->MOS6oxideThickness == 0) {
model->MOS6oxideCapFactor = 0;
} else {

View File

@ -54,7 +54,11 @@ MOS9temp(GENmodel *inModel, CKTcircuit *ckt)
CONSTKoverQ);
ni_temp=1.45e16*nifact;
if (model->MOS9phi <= 0.0) {
SPfrontEnd->IFerror (ERR_FATAL,
"%s: Phi is not positive.",&model->MOS9modName);
return(E_BADPARM);
}
model->MOS9oxideCapFactor = 3.9 * 8.854214871e-12/
model->MOS9oxideThickness;
if(!model->MOS9surfaceMobilityGiven) model->MOS9surfaceMobility=600;