Browse Source

Re-added some defines.

pre-master-46
pnenzi 23 years ago
parent
commit
5c26919de1
  1. 37
      src/spicelib/devices/mos6/mos6load.c

37
src/spicelib/devices/mos6/mos6load.c

@ -73,12 +73,24 @@ MOS6load(GENmodel *inModel, CKTcircuit *ckt)
double capgd; /* total gate-drain capacitance */ double capgd; /* total gate-drain capacitance */
double capgb; /* total gate-bulk capacitance */ double capgb; /* total gate-bulk capacitance */
int Check; int Check;
#ifndef NOBYPASS
double tempv; double tempv;
#endif /*NOBYPASS*/
int error; int error;
#ifdef CAPBYPASS
int senflag;
#endif /* CAPBYPASS */
int SenCond; int SenCond;
int m; int m;
#ifdef CAPBYPASS
senflag = 0;
if(ckt->CKTsenInfo && ckt->CKTsenInfo->SENstatus == PERTURBATION &&
(ckt->CKTsenInfo->SENmode & (ACSEN | TRANSEN))) {
senflag = 1;
}
#endif /* CAPBYPASS */
/* loop through all the MOS6 device models */ /* loop through all the MOS6 device models */
for( ; model != NULL; model = model->MOS6nextModel ) { for( ; model != NULL; model = model->MOS6nextModel ) {
@ -260,7 +272,7 @@ MOS6load(GENmodel *inModel, CKTcircuit *ckt)
/* /*
*/ */
#ifndef NOBYPASS
/* now lets see if we can bypass (ugh) */ /* now lets see if we can bypass (ugh) */
/* the following mess should be one if statement, but /* the following mess should be one if statement, but
* many compilers can't handle it all at once, so it * many compilers can't handle it all at once, so it
@ -288,7 +300,7 @@ MOS6load(GENmodel *inModel, CKTcircuit *ckt)
if( (fabs(cdhat- here->MOS6cd) < if( (fabs(cdhat- here->MOS6cd) <
ckt->CKTreltol * MAX(fabs(cdhat),fabs( ckt->CKTreltol * MAX(fabs(cdhat),fabs(
here->MOS6cd)) + ckt->CKTabstol) ) { here->MOS6cd)) + ckt->CKTabstol) ) {
/* bypass code */
/* bypass code *
/* nothing interesting has changed since last /* nothing interesting has changed since last
* iteration on this device, so we just * iteration on this device, so we just
* copy all the values computed last iteration out * copy all the values computed last iteration out
@ -320,6 +332,7 @@ MOS6load(GENmodel *inModel, CKTcircuit *ckt)
} }
goto bypass; goto bypass;
} }
#endif /*NOBYPASS*/
/* /*
*/ */
@ -556,9 +569,17 @@ next1: if(vbs <= -3*vt) {
* *
*.. bulk-drain and bulk-source depletion capacitances *.. bulk-drain and bulk-source depletion capacitances
*/ */
#ifdef CAPBYPASS
if(((ckt->CKTmode & (MODEINITPRED | MODEINITTRAN) ) ||
FABS(delvbs) >= ckt->CKTreltol * MAX(FABS(vbs),
FABS(*(ckt->CKTstate0+here->MOS6vbs)))+
ckt->CKTvoltTol)|| senflag)
#endif /*CAPBYPASS*/
{ {
/* can't bypass the diode capacitance calculations */ /* can't bypass the diode capacitance calculations */
#ifdef CAPZEROBYPASS
if(here->MOS6Cbs != 0 || here->MOS6Cbssw != 0 ) { if(here->MOS6Cbs != 0 || here->MOS6Cbssw != 0 ) {
#endif /*CAPZEROBYPASS*/
if (vbs < here->MOS6tDepCap){ if (vbs < here->MOS6tDepCap){
arg=1-vbs/here->MOS6tBulkPot; arg=1-vbs/here->MOS6tBulkPot;
/* /*
@ -610,14 +631,24 @@ next1: if(vbs <= -3*vt) {
vbs*(here->MOS6f2s+vbs*(here->MOS6f3s/2)); vbs*(here->MOS6f2s+vbs*(here->MOS6f3s/2));
here->MOS6capbs=here->MOS6f2s+here->MOS6f3s*vbs; here->MOS6capbs=here->MOS6f2s+here->MOS6f3s*vbs;
} }
#ifdef CAPZEROBYPASS
} else { } else {
*(ckt->CKTstate0 + here->MOS6qbs) = 0; *(ckt->CKTstate0 + here->MOS6qbs) = 0;
here->MOS6capbs=0; here->MOS6capbs=0;
} }
#endif /*CAPZEROBYPASS*/
} }
#ifdef CAPBYPASS
if(((ckt->CKTmode & (MODEINITPRED | MODEINITTRAN) ) ||
FABS(delvbd) >= ckt->CKTreltol * MAX(FABS(vbd),
FABS(*(ckt->CKTstate0+here->MOS6vbd)))+
ckt->CKTvoltTol)|| senflag)
#endif /*CAPBYPASS*/
/* can't bypass the diode capacitance calculations */ /* can't bypass the diode capacitance calculations */
{ {
#ifdef CAPZEROBYPASS
if(here->MOS6Cbd != 0 || here->MOS6Cbdsw != 0 ) { if(here->MOS6Cbd != 0 || here->MOS6Cbdsw != 0 ) {
#endif /*CAPZEROBYPASS*/
if (vbd < here->MOS6tDepCap) { if (vbd < here->MOS6tDepCap) {
arg=1-vbd/here->MOS6tBulkPot; arg=1-vbd/here->MOS6tBulkPot;
/* /*
@ -664,10 +695,12 @@ next1: if(vbs <= -3*vt) {
vbd * (here->MOS6f2d + vbd * here->MOS6f3d/2); vbd * (here->MOS6f2d + vbd * here->MOS6f3d/2);
here->MOS6capbd=here->MOS6f2d + vbd * here->MOS6f3d; here->MOS6capbd=here->MOS6f2d + vbd * here->MOS6f3d;
} }
#ifdef CAPZEROBYPASS
} else { } else {
*(ckt->CKTstate0 + here->MOS6qbd) = 0; *(ckt->CKTstate0 + here->MOS6qbd) = 0;
here->MOS6capbd = 0; here->MOS6capbd = 0;
} }
#endif /*CAPZEROBYPASS*/
} }
/* /*

Loading…
Cancel
Save