Added areab and areac instance parameters to bjt level2.
This commit is contained in:
parent
1da56dbe45
commit
2f8588d326
|
|
@ -24,7 +24,9 @@ IFparm BJT2pTable[] = { /* parameters */
|
|||
IOPU("off", BJT2_OFF, IF_FLAG, "Device initially off"),
|
||||
IOPAU("icvbe", BJT2_IC_VBE, IF_REAL, "Initial B-E voltage"),
|
||||
IOPAU("icvce", BJT2_IC_VCE, IF_REAL, "Initial C-E voltage"),
|
||||
IOPU("area", BJT2_AREA, IF_REAL, "Area factor"),
|
||||
IOPU("area", BJT2_AREA, IF_REAL, "(Emitter) Area factor"),
|
||||
IOPU("areab", BJT2_AREAB, IF_REAL, "Base area factor"),
|
||||
IOPU("areac", BJT2_AREAC, IF_REAL, "Collector area factor"),
|
||||
IOPU("m", BJT2_M, IF_REAL, "Parallel Multiplier"),
|
||||
IP("ic", BJT2_IC, IF_REALVEC, "Initial condition vector"),
|
||||
IP("sens_area",BJT2_AREA_SENS,IF_FLAG, "flag to request sensitivity WRT area"),
|
||||
|
|
@ -105,7 +107,7 @@ IFparm BJT2mPTable[] = { /* model parameters */
|
|||
IOP("isc", BJT2_MOD_ISC, IF_REAL, "B-C leakage saturation current"),
|
||||
#ifdef BJT2_COMPAT
|
||||
IOP("c4", BJT2_MOD_C4, IF_REAL, "Obsolete parameter name"),
|
||||
#ifdef SPICE2COMPAT
|
||||
#endif
|
||||
IOP("nc", BJT2_MOD_NC, IF_REAL, "B-C leakage emission coefficient"),
|
||||
IOP("rb", BJT2_MOD_RB, IF_REAL, "Zero bias base resistance"),
|
||||
IOP("irb", BJT2_MOD_IRB, IF_REAL, "Current for base resistance=(rb+rbm)/2"),
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@ BJT2ask(CKTcircuit *ckt, GENinstance *instPtr, int which, IFvalue *value,
|
|||
case BJT2_AREA:
|
||||
value->rValue = here->BJT2area;
|
||||
return(OK);
|
||||
case BJT2_AREAB:
|
||||
value->rValue = here->BJT2areab;
|
||||
return(OK);
|
||||
case BJT2_AREAC:
|
||||
value->rValue = here->BJT2areac;
|
||||
return(OK);
|
||||
case BJT2_M:
|
||||
value->rValue = here->BJT2m;
|
||||
return(OK);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,9 @@ typedef struct sBJT2instance {
|
|||
/* Substrate connection is either base prime *
|
||||
* or collector prime depending on whether *
|
||||
* the device is VERTICAL or LATERAL */
|
||||
double BJT2area; /* area factor for the bjt2 */
|
||||
double BJT2area; /* (emitter) area factor for the bjt2 */
|
||||
double BJT2areab; /* base area factor for the bjt2 */
|
||||
double BJT2areac; /* collector area factor for the bjt2 */
|
||||
double BJT2m; /* parallel multiplier */
|
||||
double BJT2icVBE; /* initial condition voltage B-E*/
|
||||
double BJT2icVCE; /* initial condition voltage C-E*/
|
||||
|
|
@ -118,13 +120,15 @@ typedef struct sBJT2instance {
|
|||
* (collector prime,base) */
|
||||
|
||||
unsigned BJT2off :1; /* 'off' flag for bjt2 */
|
||||
unsigned BJT2tempGiven :1; /* temperature given for bjt2 instance*/
|
||||
unsigned BJT2dtempGiven :1; /* temperature given for bjt2 instance*/
|
||||
unsigned BJT2areaGiven :1; /* flag to indicate area was specified */
|
||||
unsigned BJT2mGiven :1; /* flag to indicate m parameter specified */
|
||||
unsigned BJT2icVBEGiven :1; /* flag to indicate VBE init. cond. given */
|
||||
unsigned BJT2icVCEGiven :1; /* flag to indicate VCE init. cond. given */
|
||||
unsigned BJT2senPertFlag :1; /* indictes whether the the parameter of
|
||||
unsigned BJT2tempGiven :1; /* temperature given for bjt2 instance*/
|
||||
unsigned BJT2dtempGiven :1; /* temperature given for bjt2 instance*/
|
||||
unsigned BJT2areaGiven :1; /* flag to indicate (emitter) area was specified */
|
||||
unsigned BJT2areabGiven :1; /* flag to indicate base area was specified */
|
||||
unsigned BJT2areacGiven :1; /* flag to indicate collector area was specified */
|
||||
unsigned BJT2mGiven :1; /* flag to indicate m parameter specified */
|
||||
unsigned BJT2icVBEGiven :1; /* flag to indicate VBE init. cond. given */
|
||||
unsigned BJT2icVCEGiven :1; /* flag to indicate VCE init. cond. given */
|
||||
unsigned BJT2senPertFlag :1; /* indictes whether the the parameter of
|
||||
the particular instance is to be perturbed */
|
||||
|
||||
int BJT2senParmNo; /* parameter # for sensitivity use;
|
||||
|
|
@ -442,7 +446,11 @@ typedef struct sBJT2model { /* model structure for a bjt2 */
|
|||
#define PNP -1
|
||||
#endif /*NPN*/
|
||||
|
||||
|
||||
/*
|
||||
* BJT2 defaults to vertical for both NPN and
|
||||
* PNP devices. It is possible to alter this
|
||||
* behavior defining the GEOMETRY_COMPAT macro.
|
||||
*/
|
||||
#ifndef VERTICAL
|
||||
#define VERTICAL 1
|
||||
#define LATERAL -1
|
||||
|
|
@ -459,6 +467,8 @@ typedef struct sBJT2model { /* model structure for a bjt2 */
|
|||
#define BJT2_TEMP 7
|
||||
#define BJT2_DTEMP 8
|
||||
#define BJT2_M 9
|
||||
#define BJT2_AREAB 10
|
||||
#define BJT2_AREAC 11
|
||||
|
||||
/* model parameters */
|
||||
#define BJT2_MOD_NPN 101
|
||||
|
|
|
|||
|
|
@ -162,8 +162,14 @@ for( ; model != NULL; model = model->BJT2nextModel ) {
|
|||
c2=here->BJT2tBEleakCur*here->BJT2area * here->BJT2m;
|
||||
vte=model->BJT2leakBEemissionCoeff*vt;
|
||||
oikr=model->BJT2invRollOffR/(here->BJT2area * here->BJT2m);
|
||||
c4=here->BJT2tBCleakCur*here->BJT2area * here->BJT2m;
|
||||
vtc=model->BJT2leakBCemissionCoeff*vt;
|
||||
|
||||
c4=here->BJT2tBCleakCur * here->BJT2m;
|
||||
if (model->BJT2subs == VERTICAL)
|
||||
c4 *= here->BJT2areab;
|
||||
else
|
||||
c4 *= here->BJT2areac; /* lateral transistor */
|
||||
|
||||
vtc=model->BJT2leakBCemissionCoeff*vt;
|
||||
xjrb=model->BJT2baseCurrentHalfResist*here->BJT2area * here->BJT2m;
|
||||
|
||||
|
||||
|
|
@ -485,14 +491,28 @@ d_ibb.d3_r3 = 6.0*gbb3;
|
|||
pe=here->BJT2tBEpot;
|
||||
xme=model->BJT2junctionExpBE;
|
||||
cdis=model->BJT2baseFractionBCcap;
|
||||
ctot=here->BJT2tBCcap*here->BJT2area * here->BJT2m;
|
||||
czbc=ctot*cdis;
|
||||
|
||||
ctot=here->BJT2tBCcap * here->BJT2m;
|
||||
|
||||
if (model->BJT2subs == VERTICAL)
|
||||
ctot *= here->BJT2areab;
|
||||
else
|
||||
ctot *= here->BJT2areac;
|
||||
|
||||
czbc=ctot*cdis;
|
||||
czbx=ctot-czbc;
|
||||
pc=here->BJT2tBCpot;
|
||||
xmc=model->BJT2junctionExpBC;
|
||||
fcpe=here->BJT2tDepCap;
|
||||
czcs=model->BJT2capSub*here->BJT2area * here->BJT2m; /* PN */
|
||||
ps=model->BJT2potentialSubstrate;
|
||||
|
||||
czcs=model->BJT2capSub * here->BJT2m; /* PN */
|
||||
|
||||
if (model->BJT2subs == VERTICAL)
|
||||
czcs *= here->BJT2areac;
|
||||
else
|
||||
czcs *= here->BJT2areab;
|
||||
|
||||
ps=model->BJT2potentialSubstrate;
|
||||
xms=model->BJT2exponentialSubstrate;
|
||||
xtf=model->BJT2transitTimeBiasCoeffF;
|
||||
ovtf=model->BJT2transitTimeVBCFactor;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
SPICEdev BJT2info = {
|
||||
{
|
||||
"BJT2",
|
||||
"Bipolar Junction Transistor (AG)",
|
||||
"Bipolar Junction Transistor Level 2",
|
||||
|
||||
&BJT2nSize,
|
||||
&BJT2nSize,
|
||||
|
|
|
|||
|
|
@ -175,8 +175,13 @@ BJT2load(GENmodel *inModel, CKTcircuit *ckt)
|
|||
c2=here->BJT2tBEleakCur*here->BJT2area;
|
||||
vte=model->BJT2leakBEemissionCoeff*vt;
|
||||
oikr=model->BJT2invRollOffR/here->BJT2area;
|
||||
c4=here->BJT2tBCleakCur*here->BJT2area;
|
||||
vtc=model->BJT2leakBCemissionCoeff*vt;
|
||||
|
||||
if (model->BJT2subs == VERTICAL)
|
||||
c4=here->BJT2tBCleakCur * here->BJT2areab;
|
||||
else
|
||||
c4=here->BJT2tBCleakCur * here->BJT2areac;
|
||||
|
||||
vtc=model->BJT2leakBCemissionCoeff*vt;
|
||||
td=model->BJT2excessPhaseFactor;
|
||||
xjrb=model->BJT2baseCurrentHalfResist*here->BJT2area;
|
||||
|
||||
|
|
@ -525,14 +530,24 @@ next1: vtn=vt*model->BJT2emissionCoeffF;
|
|||
pe=here->BJT2tBEpot;
|
||||
xme=model->BJT2junctionExpBE;
|
||||
cdis=model->BJT2baseFractionBCcap;
|
||||
ctot=here->BJT2tBCcap*here->BJT2area;
|
||||
czbc=ctot*cdis;
|
||||
|
||||
if (model->BJT2subs == VERTICAL)
|
||||
ctot=here->BJT2tBCcap*here->BJT2areab;
|
||||
else
|
||||
ctot=here->BJT2tBCcap*here->BJT2areac;
|
||||
|
||||
czbc=ctot*cdis;
|
||||
czbx=ctot-czbc;
|
||||
pc=here->BJT2tBCpot;
|
||||
xmc=model->BJT2junctionExpBC;
|
||||
fcpe=here->BJT2tDepCap;
|
||||
czsub=here->BJT2tSubcap*here->BJT2area;
|
||||
ps=here->BJT2tSubpot;
|
||||
|
||||
if (model->BJT2subs == VERTICAL)
|
||||
czsub=here->BJT2tSubcap*here->BJT2areac;
|
||||
else
|
||||
czsub=here->BJT2tSubcap*here->BJT2areab;
|
||||
|
||||
ps=here->BJT2tSubpot;
|
||||
xms=model->BJT2exponentialSubstrate;
|
||||
xtf=model->BJT2transitTimeBiasCoeffF;
|
||||
ovtf=model->BJT2transitTimeVBCFactor;
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@ BJT2param(int param, IFvalue *value, GENinstance *instPtr, IFvalue *select)
|
|||
here->BJT2area = value->rValue;
|
||||
here->BJT2areaGiven = TRUE;
|
||||
break;
|
||||
case BJT2_AREAB:
|
||||
here->BJT2areab = value->rValue;
|
||||
here->BJT2areabGiven = TRUE;
|
||||
break;
|
||||
case BJT2_AREAC:
|
||||
here->BJT2areac = value->rValue;
|
||||
here->BJT2areacGiven = TRUE;
|
||||
break;
|
||||
case BJT2_M:
|
||||
here->BJT2m = value->rValue;
|
||||
here->BJT2mGiven = TRUE;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ BJT2pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
|
|||
+ (-xcmu+xgm) * (s->real));
|
||||
*(here->BJT2colPrimeBasePrimePtr + 1) += m * ((-xcmu+xgm)
|
||||
* (s->imag));
|
||||
*(here->BJT2colPrimeEmitPrimePtr) += m *b((-gm-go)
|
||||
*(here->BJT2colPrimeEmitPrimePtr) += m *((-gm-go)
|
||||
+ (-xgm) * (s->real));
|
||||
*(here->BJT2colPrimeEmitPrimePtr + 1) += m * ((-xgm) *
|
||||
(s->imag));
|
||||
|
|
|
|||
|
|
@ -195,7 +195,13 @@ BJT2setup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
if(!here->BJT2areaGiven) {
|
||||
here->BJT2area = 1;
|
||||
}
|
||||
|
||||
if(!here->BJT2areabGiven) {
|
||||
here->BJT2areab = here->BJT2area;
|
||||
}
|
||||
if(!here->BJT2areacGiven) {
|
||||
here->BJT2areac = here->BJT2area;
|
||||
}
|
||||
|
||||
if(!here->BJT2mGiven) {
|
||||
here->BJT2m = 1.0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue