Check if toxp+dtox!=toxe with double precision tolerance.

This commit is contained in:
Árpád Bűrmen 2025-09-12 10:10:48 +02:00
parent e4aa062156
commit 740670805e
1 changed files with 5 additions and 1 deletions

View File

@ -122,8 +122,12 @@ int Fatal_Flag = 0;
if(model->BSIM4mtrlMod == 0) if(model->BSIM4mtrlMod == 0)
{ {
double chktol = fabs(model->BSIM4toxe);
if (fabs(model->BSIM4toxp)>chktol) chktol = fabs(model->BSIM4toxp);
if (fabs(model->BSIM4dtox)>chktol) chktol = fabs(model->BSIM4dtox);
chktol=chktol*1e-14;
if ((model->BSIM4toxeGiven) && (model->BSIM4toxpGiven) && (model->BSIM4dtoxGiven) if ((model->BSIM4toxeGiven) && (model->BSIM4toxpGiven) && (model->BSIM4dtoxGiven)
&& (model->BSIM4toxe != (model->BSIM4toxp + model->BSIM4dtox))) && (fabs(model->BSIM4toxe-(model->BSIM4toxp + model->BSIM4dtox))>chktol))
{ printf("Warning: toxe, toxp and dtox all given and toxe != toxp + dtox; dtox ignored.\n"); { printf("Warning: toxe, toxp and dtox all given and toxe != toxp + dtox; dtox ignored.\n");
} }
else if ((model->BSIM4toxeGiven) && (!model->BSIM4toxpGiven)) else if ((model->BSIM4toxeGiven) && (!model->BSIM4toxpGiven))