diff --git a/src/spicelib/devices/bjt/bjtdefs.h b/src/spicelib/devices/bjt/bjtdefs.h index c8d526cb1..4d1870763 100644 --- a/src/spicelib/devices/bjt/bjtdefs.h +++ b/src/spicelib/devices/bjt/bjtdefs.h @@ -73,6 +73,10 @@ typedef struct sBJTinstance { double BJTtf1; /* temperature adjusted polynomial coefficient */ double BJTtf4; /* temperature adjusted polynomial coefficient */ double BJTtf5; /* temperature adjusted polynomial coefficient */ + double BJTtf2; /* temperature adjusted polynomial coefficient */ + double BJTtf3; /* temperature adjusted polynomial coefficient */ + double BJTtf6; /* temperature adjusted polynomial coefficient */ + double BJTtf7; /* temperature adjusted polynomial coefficient */ double BJTtVcrit; /* temperature adjusted critical voltage */ double BJTtSubVcrit; /* temperature adjusted substrate critical voltage */ double BJTtSubSatCur; /* temperature adjusted subst. saturation current */ diff --git a/src/spicelib/devices/bjt/bjtdset.c b/src/spicelib/devices/bjt/bjtdset.c index 9236dd291..83cb9446e 100644 --- a/src/spicelib/devices/bjt/bjtdset.c +++ b/src/spicelib/devices/bjt/bjtdset.c @@ -580,8 +580,8 @@ int BJTdSetup(GENmodel *inModel, CKTcircuit *ckt) czbe*xme*(xme+1)*sarg/(arg*arg*pe*pe*6); } else { f1=here->BJTtf1; - f2=model->BJTf2; - f3=model->BJTf3; + f2=here->BJTtf2; + f3=here->BJTtf3; czbef2=czbe/f2; lcapbe1 = czbef2*(f3+xme*vbe/pe); lcapbe2 = 0.5*xme*czbef2/pe; @@ -594,8 +594,8 @@ int BJTdSetup(GENmodel *inModel, CKTcircuit *ckt) fcpc=here->BJTtf4; f1=here->BJTtf5; - f2=model->BJTf6; - f3=model->BJTf7; + f2=here->BJTtf6; + f3=here->BJTtf7; if (vbc < fcpc) { arg=1-vbc/pc; sarg=exp(-xmc*log(arg)); diff --git a/src/spicelib/devices/bjt/bjtload.c b/src/spicelib/devices/bjt/bjtload.c index f44e4f1bf..a4cfc8574 100644 --- a/src/spicelib/devices/bjt/bjtload.c +++ b/src/spicelib/devices/bjt/bjtload.c @@ -593,8 +593,8 @@ next1: vtn=vt*here->BJTtemissionCoeffF; capbe=tf*gbe+czbe*sarg; } else { f1=here->BJTtf1; - f2=model->BJTf2; - f3=model->BJTf3; + f2=here->BJTtf2; + f3=here->BJTtf3; czbef2=czbe/f2; *(ckt->CKTstate0 + here->BJTqbe) = tf*cbe+czbe*f1+czbef2* (f3*(vbe-fcpe) +(xme/(pe+pe))*(vbe*vbe-fcpe*fcpe)); @@ -602,8 +602,8 @@ next1: vtn=vt*here->BJTtemissionCoeffF; } fcpc=here->BJTtf4; f1=here->BJTtf5; - f2=model->BJTf6; - f3=model->BJTf7; + f2=here->BJTtf6; + f3=here->BJTtf7; if (vbc < fcpc) { arg=1-vbc/pc; sarg=exp(-xmc*log(arg)); diff --git a/src/spicelib/devices/bjt/bjttemp.c b/src/spicelib/devices/bjt/bjttemp.c index 40f803b89..8456eb42f 100644 --- a/src/spicelib/devices/bjt/bjttemp.c +++ b/src/spicelib/devices/bjt/bjttemp.c @@ -92,12 +92,6 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt) model->BJTdepletionCapCoeff=.5; } xfc = log(1-model->BJTdepletionCapCoeff); - model->BJTf2 = exp((1 + model->BJTjunctionExpBE) * xfc); - model->BJTf3 = 1 - model->BJTdepletionCapCoeff * - (1 + model->BJTjunctionExpBE); - model->BJTf6 = exp((1+model->BJTjunctionExpBC)*xfc); - model->BJTf7 = 1 - model->BJTdepletionCapCoeff * - (1 + model->BJTjunctionExpBC); /* loop through all the instances of the model */ for (here = BJTinstances(model); here != NULL ; @@ -265,6 +259,12 @@ BJTtemp(GENmodel *inModel, CKTcircuit *ckt) log(vt / (CONSTroot2*here->BJTtSatCur*here->BJTarea)); here->BJTtSubVcrit = vt * log(vt / (CONSTroot2*here->BJTtSubSatCur*here->BJTarea)); + here->BJTtf2 = exp((1 + here->BJTtjunctionExpBE) * xfc); + here->BJTtf3 = 1 - model->BJTdepletionCapCoeff * + (1 + here->BJTtjunctionExpBE); + here->BJTtf6 = exp((1 + here->BJTtjunctionExpBC)*xfc); + here->BJTtf7 = 1 - model->BJTdepletionCapCoeff * + (1 + here->BJTtjunctionExpBC); } }