devices/mos*: 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 committed by rlar
parent 9c04f01991
commit ae78dd06ef
5 changed files with 28 additions and 0 deletions

View File

@ -52,6 +52,12 @@ MOS1temp(GENmodel *inModel, CKTcircuit *ckt)
/* 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,6 +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,12 @@ 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

@ -51,6 +51,12 @@ MOS6temp(GENmodel *inModel, CKTcircuit *ckt)
/* 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,6 +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;