diff --git a/src/spicelib/devices/bjt/bjtask.c b/src/spicelib/devices/bjt/bjtask.c index 5b1ae876f..9b87a2b10 100644 --- a/src/spicelib/devices/bjt/bjtask.c +++ b/src/spicelib/devices/bjt/bjtask.c @@ -22,7 +22,6 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue { BJTinstance *here = (BJTinstance*)instPtr; double tmp; - int itmp; double vr; double vi; double sr; @@ -232,6 +231,7 @@ BJTask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value, IFvalue return(OK); case BJT_QUEST_SENS_CPLX: if(ckt->CKTsenInfo){ + int itmp; itmp = select->iValue + 1; value->cValue.real= *(ckt->CKTsenInfo->SEN_RHS[itmp]+ here->BJTsenParmNo); diff --git a/src/spicelib/devices/bjt/bjtload.c b/src/spicelib/devices/bjt/bjtload.c index c8e5043c8..116948f94 100644 --- a/src/spicelib/devices/bjt/bjtload.c +++ b/src/spicelib/devices/bjt/bjtload.c @@ -521,11 +521,11 @@ next1: vtn=vt*here->BJTtemissionCoeffF; * Kull's Quasi-Saturation model */ if (model->BJTintCollResistGiven) { - double Kbci,Kbci_Vbci,Kbcx,Kbcx_Vbcx; - double rKp1,rKp1_Vbci,rKp1_Vbcx,xvar1,xvar1_Vbci,xvar1_Vbcx; - double Vcorr,Vcorr_Vbci,Vcorr_Vbcx,Iohm,Iohm_Vrci,Iohm_Vbci,Iohm_Vbcx; - double quot,quot_Vrci; if (vrci > 0.) { + double Kbci,Kbci_Vbci,Kbcx,Kbcx_Vbcx; + double rKp1,rKp1_Vbci,rKp1_Vbcx,xvar1,xvar1_Vbci,xvar1_Vbcx; + double Vcorr,Vcorr_Vbci,Vcorr_Vbcx,Iohm,Iohm_Vrci,Iohm_Vbci,Iohm_Vbcx; + double quot,quot_Vrci; Kbci = sqrt(1+here->BJTtepiDoping*exp(vbc/vt)); Kbci_Vbci = here->BJTtepiDoping*exp(vbc/vt)/(2*vt*Kbci); Kbcx = sqrt(1+here->BJTtepiDoping*exp(vbcx/vt)); diff --git a/src/spicelib/devices/bjt/bjtsload.c b/src/spicelib/devices/bjt/bjtsload.c index 46b8b6c95..23db486f0 100644 --- a/src/spicelib/devices/bjt/bjtsload.c +++ b/src/spicelib/devices/bjt/bjtsload.c @@ -314,7 +314,6 @@ restore: *(ckt->CKTstate0 + here->BJTstate + i) = *(SaveState0 + i); } *(ckt->CKTstate1 + here->BJTcexbc) = *(SaveState0 + 21); - *(ckt->CKTstate1 + here->BJTcexbc) = *(SaveState0 + 21); here->BJTcapbe = *(SaveState0 + 23) ; here->BJTcapbc = *(SaveState0 + 24) ; here->BJTcapsub = *(SaveState0 + 25) ; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddld.c b/src/spicelib/devices/bsim3soi_dd/b3soiddld.c index 388fc1aad..bb2402e2b 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddld.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddld.c @@ -3996,14 +3996,7 @@ if (here->B3SOIDDdebugMod > 2) gTtdp = - (gTtg + gTtb + gTte + gTtsp); } - if (model->B3SOIDDtype > 0) - { - ceqqg = ceqqg; - ceqqb = ceqqb; - ceqqe = ceqqe; - ceqqd = ceqqd; - } - else + if (model->B3SOIDDtype < 0) { ceqbodcon = -ceqbodcon; ceqbody = -ceqbody; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdld.c b/src/spicelib/devices/bsim3soi_fd/b3soifdld.c index 8967217a5..1f72b89a6 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdld.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdld.c @@ -3116,14 +3116,7 @@ if (here->B3SOIFDdebugMod > 2) gTtdp = - (gTtg + gTtb + gTte + gTtsp); } - if (model->B3SOIFDtype > 0) - { - ceqqg = ceqqg; - ceqqb = ceqqb; - ceqqe = ceqqe; - ceqqd = ceqqd; - } - else + if (model->B3SOIFDtype < 0) { ceqbodcon = -ceqbodcon; ceqbody = -ceqbody; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdld.c b/src/spicelib/devices/bsim3soi_pd/b3soipdld.c index 65a6855cd..1f917c098 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdld.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdld.c @@ -3977,14 +3977,7 @@ for (; model != NULL; model = B3SOIPDnextModel(model)) gTtdp = - (gTtg + gTtb + gTtsp); } - if (model->B3SOIPDtype > 0) - { - ceqqg = ceqqg; - ceqqb = ceqqb; - ceqqe = ceqqe; - ceqqd = ceqqd; - } - else + if (model->B3SOIPDtype < 0) { ceqbodcon = -ceqbodcon; ceqbody = -ceqbody; diff --git a/src/spicelib/devices/bsim3v0/b3v0ld.c b/src/spicelib/devices/bsim3v0/b3v0ld.c index 668fd277c..705f308c6 100644 --- a/src/spicelib/devices/bsim3v0/b3v0ld.c +++ b/src/spicelib/devices/bsim3v0/b3v0ld.c @@ -1847,10 +1847,12 @@ line900: if (model->BSIM3v0type > 0) { ceqbs += (here->BSIM3v0cbs - (here->BSIM3v0gbs - ckt->CKTgmin) * vbs); ceqbd += (here->BSIM3v0cbd - (here->BSIM3v0gbd - ckt->CKTgmin) * vbd); + /* ceqqg = ceqqg; ceqqb = ceqqb; ceqqd = ceqqd; cqcheq = cqcheq; + */ } else { ceqbs = -ceqbs - (here->BSIM3v0cbs - (here->BSIM3v0gbs diff --git a/src/spicelib/devices/bsim3v1/b3v1ld.c b/src/spicelib/devices/bsim3v1/b3v1ld.c index 7b751e0fb..61362a3d0 100644 --- a/src/spicelib/devices/bsim3v1/b3v1ld.c +++ b/src/spicelib/devices/bsim3v1/b3v1ld.c @@ -2353,10 +2353,12 @@ line900: if (model->BSIM3v1type > 0) { ceqbs += (here->BSIM3v1cbs - (here->BSIM3v1gbs - ckt->CKTgmin) * vbs); ceqbd += (here->BSIM3v1cbd - (here->BSIM3v1gbd - ckt->CKTgmin) * vbd); + /* ceqqg = ceqqg; ceqqb = ceqqb; ceqqd = ceqqd; cqcheq = cqcheq; + */ } else { ceqbs = -ceqbs - (here->BSIM3v1cbs - (here->BSIM3v1gbs diff --git a/src/spicelib/devices/bsimsoi/b4soild.c b/src/spicelib/devices/bsimsoi/b4soild.c index 64a5d1ebd..29e4a7caa 100644 --- a/src/spicelib/devices/bsimsoi/b4soild.c +++ b/src/spicelib/devices/bsimsoi/b4soild.c @@ -10263,14 +10263,7 @@ line900: = gdtotb = ceqgdtot = 0.0; } - if (model->B4SOItype > 0) - { - ceqqg = ceqqg; - ceqqb = ceqqb; - ceqqe = ceqqe; - ceqqd = ceqqd; - } - else + if (model->B4SOItype < 0) { ceqbodcon = -ceqbodcon; ceqbody = -ceqbody; diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index 688550265..43b5180c9 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -458,7 +458,7 @@ int load_opus(const char *name) add_device(num, devs, 1); #ifdef TRACE - printf("Got %u devices.\n", num); + printf("Got %d devices.\n", num); #endif @@ -486,7 +486,7 @@ int load_opus(const char *name) add_udn(num, udns); #ifdef TRACE - printf("Got %u udns.\n", num); + printf("Got %d udns.\n", num); #endif /* Give the code model access to facilities provided by ngspice. */ diff --git a/src/spicelib/devices/ind/indsacl.c b/src/spicelib/devices/ind/indsacl.c index 719bea901..f6066f9b6 100644 --- a/src/spicelib/devices/ind/indsacl.c +++ b/src/spicelib/devices/ind/indsacl.c @@ -148,7 +148,7 @@ INDsAcLoad(GENmodel *inModel, CKTcircuit *ckt) #ifdef SENSDEBUG fprintf(stdout,"cind = %.5e,icind = %.5e\n",cind,icind); fprintf(stdout,"val = %.5e,ival = %.5e\n",val,ival); - fprintf(stdout,"brEq = %.5e,senparmno = %.5e\n", + fprintf(stdout,"brEq = %d,senparmno = %d\n", here->INDbrEq,here->INDsenParmNo); #endif /* SENSDEBUG */ diff --git a/src/spicelib/devices/vdmos/vdmosask.c b/src/spicelib/devices/vdmos/vdmosask.c index 02fcc7e1e..f29ee0d03 100644 --- a/src/spicelib/devices/vdmos/vdmosask.c +++ b/src/spicelib/devices/vdmos/vdmosask.c @@ -166,9 +166,6 @@ VDMOSask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, value->rValue += fabs(*(ckt->CKTstate0 + here->VDMOScqgd) * (*(ckt->CKTrhsOld + here->VDMOSgNode) - *(ckt->CKTrhsOld + here->VDMOSdNode))); - } - if ((ckt->CKTcurrentAnalysis & DOING_TRAN) && - !(ckt->CKTmode & MODETRANOP)) { value->rValue += fabs(*(ckt->CKTstate0 + here->VDMOScqgs) * (*(ckt->CKTrhsOld + here->VDMOSgNode) - *(ckt->CKTrhsOld + here->VDMOSsNode))); diff --git a/src/spicelib/devices/vdmos/vdmosconv.c b/src/spicelib/devices/vdmos/vdmosconv.c index 24ac3a13a..c51a94a0a 100644 --- a/src/spicelib/devices/vdmos/vdmosconv.c +++ b/src/spicelib/devices/vdmos/vdmosconv.c @@ -49,7 +49,6 @@ VDMOSconvTest(GENmodel *inModel, CKTcircuit *ckt) delTemp = *(ckt->CKTrhs + here->VDMOStempNode); deldelTemp = delTemp - *(ckt->CKTstate0 + here->VDMOSdelTemp); } else { - delTemp = 0.0; deldelTemp = 0.0; } diff --git a/src/spicelib/devices/vdmos/vdmosload.c b/src/spicelib/devices/vdmos/vdmosload.c index 341f24811..7fb688a8f 100644 --- a/src/spicelib/devices/vdmos/vdmosload.c +++ b/src/spicelib/devices/vdmos/vdmosload.c @@ -803,7 +803,7 @@ bypass: /* * charge storage elements */ - double czero, czof2, diffcharge, deplcharge, diffcap, deplcap; + double czero, diffcharge, deplcharge, diffcap, deplcap; czero = here->VDIOtJctCap; if (vd < here->VDIOtDepCap) { arg = 1 - vd / here->VDIOtJctPot; @@ -811,6 +811,7 @@ bypass: deplcharge = here->VDIOtJctPot*czero*(1 - arg*sarg) / (1 - here->VDIOtGradingCoeff); deplcap = czero*sarg; } else { + double czof2; czof2 = czero / here->VDIOtF2; deplcharge = czero*here->VDIOtF1 + czof2*(here->VDIOtF3*(vd - here->VDIOtDepCap) + (here->VDIOtGradingCoeff / (here->VDIOtJctPot + here->VDIOtJctPot))*(vd*vd - here->VDIOtDepCap*here->VDIOtDepCap));