Browse Source

BSIM3v3.3.0 added

pre-master-46
dwarning 19 years ago
parent
commit
8be6630ccd
  1. 23
      src/spicelib/devices/bsim3/b3.c
  2. 339
      src/spicelib/devices/bsim3/b3acld.c
  3. 24
      src/spicelib/devices/bsim3/b3ask.c
  4. 110
      src/spicelib/devices/bsim3/b3check.c
  5. 14
      src/spicelib/devices/bsim3/b3cvtest.c
  6. 14
      src/spicelib/devices/bsim3/b3del.c
  7. 13
      src/spicelib/devices/bsim3/b3dest.c
  8. 16
      src/spicelib/devices/bsim3/b3getic.c
  9. 860
      src/spicelib/devices/bsim3/b3ld.c
  10. 54
      src/spicelib/devices/bsim3/b3mask.c
  11. 12
      src/spicelib/devices/bsim3/b3mdel.c
  12. 67
      src/spicelib/devices/bsim3/b3mpar.c
  13. 258
      src/spicelib/devices/bsim3/b3noi.c
  14. 17
      src/spicelib/devices/bsim3/b3par.c
  15. 71
      src/spicelib/devices/bsim3/b3pzld.c
  16. 307
      src/spicelib/devices/bsim3/b3set.c
  17. 303
      src/spicelib/devices/bsim3/b3temp.c
  18. 15
      src/spicelib/devices/bsim3/b3trunc.c
  19. 74
      src/spicelib/devices/bsim3/bsim3def.h
  20. 27
      src/spicelib/devices/bsim3/bsim3ext.h
  21. 2
      src/spicelib/devices/bsim3/bsim3init.c
  22. 1
      src/spicelib/devices/bsim3/bsim3itf.h

23
src/spicelib/devices/bsim3/b3.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0 beta, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
**********/
#include "ngspice.h"
@ -26,6 +25,7 @@ IOP( "nrd", BSIM3_NRD, IF_REAL , "Number of squares in drain"),
IOP( "nrs", BSIM3_NRS, IF_REAL , "Number of squares in source"),
IOP( "off", BSIM3_OFF, IF_FLAG , "Device is initially off"),
IOP( "nqsmod", BSIM3_NQSMOD, IF_INTEGER, "Non-quasi-static model selector"),
IOP( "acnqsmod", BSIM3_ACNQSMOD, IF_INTEGER, "AC NQS model selector"),
IP( "ic", BSIM3_IC, IF_REALVEC , "Vector of DS,GS,BS initial voltages"),
OP( "gmbs", BSIM3_GMBS, IF_REAL, "Gmb"),
OP( "gm", BSIM3_GM, IF_REAL, "Gm"),
@ -42,7 +42,7 @@ IFparm BSIM3mPTable[] = { /* model parameters */
IOP( "capmod", BSIM3_MOD_CAPMOD, IF_INTEGER, "Capacitance model selector"),
IOP( "mobmod", BSIM3_MOD_MOBMOD, IF_INTEGER, "Mobility model selector"),
IOP( "noimod", BSIM3_MOD_NOIMOD, IF_INTEGER, "Noise model selector"),
IOP( "acm", BSIM3_MOD_ACMMOD, IF_INTEGER, "Area calculation method selector"),
IOP( "acnqsmod", BSIM3_MOD_ACNQSMOD, IF_INTEGER, "AC NQS model selector"),
IOP( "paramchk", BSIM3_MOD_PARAMCHK, IF_INTEGER, "Model parameter checking selector"),
IOP( "binunit", BSIM3_MOD_BINUNIT, IF_INTEGER, "Bin unit selector"),
IOP( "version", BSIM3_MOD_VERSION, IF_STRING, " parameter for model version"),
@ -147,6 +147,7 @@ IOP( "acde", BSIM3_MOD_ACDE, IF_REAL, "Exponential coefficient for finite charge
IOP( "moin", BSIM3_MOD_MOIN, IF_REAL, "Coefficient for gate-bias dependent surface potential"),
IOP( "noff", BSIM3_MOD_NOFF, IF_REAL, "C-V turn-on/off parameter"),
IOP( "voffcv", BSIM3_MOD_VOFFCV, IF_REAL, "C-V lateral-shift parameter"),
IOP( "lintnoi", BSIM3_MOD_LINTNOI, IF_REAL, "lint offset for noise calculation"),
IOP( "lint", BSIM3_MOD_LINT, IF_REAL, "Length reduction parameter"),
IOP( "ll", BSIM3_MOD_LL, IF_REAL, "Length reduction parameter"),
IOP( "llc", BSIM3_MOD_LLC, IF_REAL, "Length reduction parameter for CV"),
@ -158,10 +159,6 @@ IOP( "lwl", BSIM3_MOD_LWL, IF_REAL, "Length reduction parameter"),
IOP( "lwlc", BSIM3_MOD_LWLC, IF_REAL, "Length reduction parameter for CV"),
IOP( "lmin", BSIM3_MOD_LMIN, IF_REAL, "Minimum length for the model"),
IOP( "lmax", BSIM3_MOD_LMAX, IF_REAL, "Maximum length for the model"),
IOP( "xl", BSIM3_MOD_XL, IF_REAL, "Length correction parameter"),
IOP( "xw", BSIM3_MOD_XW, IF_REAL, "Width correction parameter"),
IOP( "wr", BSIM3_MOD_WR, IF_REAL, "Width dependence of rds"),
IOP( "wint", BSIM3_MOD_WINT, IF_REAL, "Width reduction parameter"),
IOP( "dwg", BSIM3_MOD_DWG, IF_REAL, "Width reduction parameter"),
@ -190,14 +187,6 @@ IOP( "cle", BSIM3_MOD_CLE, IF_REAL, "Vdsat parameter for C-V model"),
IOP( "dwc", BSIM3_MOD_DWC, IF_REAL, "Delta W for C-V model"),
IOP( "dlc", BSIM3_MOD_DLC, IF_REAL, "Delta L for C-V model"),
IOP( "hdif", BSIM3_MOD_HDIF, IF_REAL, "ACM Parameter: Distance Gate - contact"),
IOP( "ldif", BSIM3_MOD_LDIF, IF_REAL, "ACM Parameter: Length of LDD Gate-Source/Drain"),
IOP( "ld", BSIM3_MOD_LD, IF_REAL, "ACM Parameter: Length of LDD under Gate"),
IOP( "rd", BSIM3_MOD_RD, IF_REAL, "ACM Parameter: Resistance of LDD drain side"),
IOP( "rs", BSIM3_MOD_RS, IF_REAL, "ACM Parameter: Resistance of LDD source side"),
IOP( "rdc", BSIM3_MOD_RS, IF_REAL, "ACM Parameter: Resistance contact drain side"),
IOP( "rsc", BSIM3_MOD_RS, IF_REAL, "ACM Parameter: Resistance contact source side"),
IOP( "alpha0", BSIM3_MOD_ALPHA0, IF_REAL, "substrate current model parameter"),
IOP( "alpha1", BSIM3_MOD_ALPHA1, IF_REAL, "substrate current model parameter"),
IOP( "beta0", BSIM3_MOD_BETA0, IF_REAL, "substrate current model parameter"),

339
src/spicelib/devices/bsim3/b3acld.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0 beta, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3acld.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3acld.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
**********/
#include "ngspice.h"
@ -17,7 +16,9 @@
int
BSIM3acLoad (GENmodel *inModel, CKTcircuit *ckt)
BSIM3acLoad(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{
BSIM3model *model = (BSIM3model*)inModel;
BSIM3instance *here;
@ -25,29 +26,106 @@ double xcggb, xcgdb, xcgsb, xcbgb, xcbdb, xcbsb, xcddb, xcssb, xcdgb;
double gdpr, gspr, gds, gbd, gbs, capbd, capbs, xcsgb, xcdsb, xcsdb;
double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb, omega;
double GSoverlapCap, GDoverlapCap, GBoverlapCap, FwdSum, RevSum, Gm, Gmbs;
double dxpart, sxpart, xgtg, xgtd, xgts, xgtb;
double xcqgb = 0.0, xcqdb = 0.0, xcqsb = 0.0, xcqbb = 0.0;
double dxpart, sxpart, xgtg, xgtd, xgts, xgtb, xcqgb, xcqdb, xcqsb, xcqbb;
double gbspsp, gbbdp, gbbsp, gbspg, gbspb;
double gbspdp, gbdpdp, gbdpg, gbdpb, gbdpsp;
double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs;
double dsxpart_dVd, dsxpart_dVg, dsxpart_dVb, dsxpart_dVs;
double T1, CoxWL, qcheq, Cdg, Cdd, Cds, Csg, Csd, Css;
double T1, CoxWL, qcheq, Cdg, Cdd, Cds, Cdb, Csg, Csd, Css, Csb;
double ScalingFactor = 1.0e-9;
/* For ACNQSMOD */
double T0, T2, T3, gmr, gmbsr, gdsr, gmi, gmbsi, gdsi;
double Cddr, Cdgr, Cdsr, Csdr, Csgr, Cssr, Cgdr, Cggr, Cgsr;
double Cddi, Cdgi, Cdsi, Cdbi, Csdi, Csgi, Cssi, Csbi;
double Cgdi, Cggi, Cgsi, Cgbi, Gmi, Gmbsi, FwdSumi, RevSumi;
double xcdgbi, xcsgbi, xcddbi, xcdsbi, xcsdbi, xcssbi, xcdbbi;
double xcsbbi, xcggbi, xcgdbi, xcgsbi, xcgbbi;
double m;
omega = ckt->CKTomega;
for (; model != NULL; model = model->BSIM3nextModel)
{ for (here = model->BSIM3instances; here!= NULL;
here = here->BSIM3nextInstance)
{
{
if (here->BSIM3owner != ARCHme)
continue;
if (here->BSIM3mode >= 0)
{ Gm = here->BSIM3gm;
Gmbs = here->BSIM3gmbs;
Csd = -(here->BSIM3cddb + here->BSIM3cgdb + here->BSIM3cbdb);
Csg = -(here->BSIM3cdgb + here->BSIM3cggb + here->BSIM3cbgb);
Css = -(here->BSIM3cdsb + here->BSIM3cgsb + here->BSIM3cbsb);
if (here->BSIM3acnqsMod)
{ T0 = omega * here->BSIM3taunet;
T1 = T0 * T0;
T2 = 1.0 / (1.0 + T1);
T3 = T0 * T2;
gmr = here->BSIM3gm * T2;
gmbsr = here->BSIM3gmbs * T2;
gds = here->BSIM3gds * T2;
gmi = -here->BSIM3gm * T3;
gmbsi = -here->BSIM3gmbs * T3;
gdsi = -here->BSIM3gds * T3;
Cddr = here->BSIM3cddb * T2;
Cdgr = here->BSIM3cdgb * T2;
Cdsr = here->BSIM3cdsb * T2;
Cddi = here->BSIM3cddb * T3 * omega;
Cdgi = here->BSIM3cdgb * T3 * omega;
Cdsi = here->BSIM3cdsb * T3 * omega;
Cdbi = -(Cddi + Cdgi + Cdsi);
Csdr = Csd * T2;
Csgr = Csg * T2;
Cssr = Css * T2;
Csdi = Csd * T3 * omega;
Csgi = Csg * T3 * omega;
Cssi = Css * T3 * omega;
Csbi = -(Csdi + Csgi + Cssi);
Cgdr = -(Cddr + Csdr + here->BSIM3cbdb);
Cggr = -(Cdgr + Csgr + here->BSIM3cbgb);
Cgsr = -(Cdsr + Cssr + here->BSIM3cbsb);
Cgdi = -(Cddi + Csdi);
Cggi = -(Cdgi + Csgi);
Cgsi = -(Cdsi + Cssi);
Cgbi = -(Cgdi + Cggi + Cgsi);
}
else /* QS */
{ gmr = here->BSIM3gm;
gmbsr = here->BSIM3gmbs;
gds = here->BSIM3gds;
gmi = gmbsi = gdsi = 0.0;
Cddr = here->BSIM3cddb;
Cdgr = here->BSIM3cdgb;
Cdsr = here->BSIM3cdsb;
Cddi = Cdgi = Cdsi = Cdbi = 0.0;
Csdr = Csd;
Csgr = Csg;
Cssr = Css;
Csdi = Csgi = Cssi = Csbi = 0.0;
Cgdr = here->BSIM3cgdb;
Cggr = here->BSIM3cggb;
Cgsr = here->BSIM3cgsb;
Cgdi = Cggi = Cgsi = Cgbi = 0.0;
}
if (here->BSIM3mode >= 0)
{ Gm = gmr;
Gmbs = gmbsr;
FwdSum = Gm + Gmbs;
RevSum = 0.0;
Gmi = gmi;
Gmbsi = gmbsi;
FwdSumi = Gmi + Gmbsi;
RevSumi = 0.0;
gbbdp = -here->BSIM3gbds;
gbbsp = here->BSIM3gbds + here->BSIM3gbgs + here->BSIM3gbbs;
@ -62,18 +140,18 @@ double m;
gbspb = 0.0;
gbspsp = 0.0;
if (here->BSIM3nqsMod == 0)
{ cggb = here->BSIM3cggb;
cgsb = here->BSIM3cgsb;
cgdb = here->BSIM3cgdb;
if (here->BSIM3nqsMod == 0 || here->BSIM3acnqsMod == 1)
{ cggb = Cggr;
cgsb = Cgsr;
cgdb = Cgdr;
cbgb = here->BSIM3cbgb;
cbsb = here->BSIM3cbsb;
cbdb = here->BSIM3cbdb;
cdgb = here->BSIM3cdgb;
cdsb = here->BSIM3cdsb;
cddb = here->BSIM3cddb;
cdgb = Cdgr;
cdsb = Cdsr;
cddb = Cddr;
xgtg = xgtd = xgts = xgtb = 0.0;
sxpart = 0.6;
@ -139,12 +217,28 @@ double m;
dsxpart_dVs = -ddxpart_dVs;
dsxpart_dVb = -(dsxpart_dVd + dsxpart_dVg + dsxpart_dVs);
}
xcdgbi = Cdgi;
xcsgbi = Csgi;
xcddbi = Cddi;
xcdsbi = Cdsi;
xcsdbi = Csdi;
xcssbi = Cssi;
xcdbbi = Cdbi;
xcsbbi = Csbi;
xcggbi = Cggi;
xcgdbi = Cgdi;
xcgsbi = Cgsi;
xcgbbi = Cgbi;
}
else
{ Gm = -here->BSIM3gm;
Gmbs = -here->BSIM3gmbs;
{ Gm = -gmr;
Gmbs = -gmbsr;
FwdSum = 0.0;
RevSum = -(Gm + Gmbs);
Gmi = -gmi;
Gmbsi = -gmbsi;
FwdSumi = 0.0;
RevSumi = -(Gmi + Gmbsi);
gbbsp = -here->BSIM3gbds;
gbbdp = here->BSIM3gbds + here->BSIM3gbgs + here->BSIM3gbbs;
@ -159,18 +253,18 @@ double m;
gbspb = here->BSIM3gbbs;
gbspdp = -(gbspg + gbspsp + gbspb);
if (here->BSIM3nqsMod == 0)
{ cggb = here->BSIM3cggb;
cgsb = here->BSIM3cgdb;
cgdb = here->BSIM3cgsb;
if (here->BSIM3nqsMod == 0 || here->BSIM3acnqsMod == 1)
{ cggb = Cggr;
cgsb = Cgdr;
cgdb = Cgsr;
cbgb = here->BSIM3cbgb;
cbsb = here->BSIM3cbdb;
cbdb = here->BSIM3cbsb;
cdgb = -(here->BSIM3cdgb + cggb + cbgb);
cdsb = -(here->BSIM3cddb + cgsb + cbsb);
cddb = -(here->BSIM3cdsb + cgdb + cbdb);
cdgb = -(Cdgr + cggb + cbgb);
cdsb = -(Cddr + cgsb + cbsb);
cddb = -(Cdsr + cgdb + cbdb);
xgtg = xgtd = xgts = xgtb = 0.0;
sxpart = 0.4;
@ -236,12 +330,23 @@ double m;
ddxpart_dVs = -dsxpart_dVs;
ddxpart_dVb = -(ddxpart_dVd + ddxpart_dVg + ddxpart_dVs);
}
xcdgbi = Csgi;
xcsgbi = Cdgi;
xcddbi = Cssi;
xcdsbi = Csdi;
xcsdbi = Cdsi;
xcssbi = Cddi;
xcdbbi = Csbi;
xcsbbi = Cdbi;
xcggbi = Cggi;
xcgdbi = Cgsi;
xcgsbi = Cgdi;
xcgbbi = Cgbi;
}
T1 = *(ckt->CKTstate0 + here->BSIM3qdef) * here->BSIM3gtau;
gdpr = here->BSIM3drainConductance;
gspr = here->BSIM3sourceConductance;
gds = here->BSIM3gds;
gbd = here->BSIM3gbd;
gbs = here->BSIM3gbs;
capbd = here->BSIM3capbd;
@ -267,97 +372,91 @@ double m;
m = here->BSIM3m;
*(here->BSIM3GgPtr + 1) += m * xcggb;
*(here->BSIM3BbPtr + 1) -=
m * (xcbgb + xcbdb + xcbsb);
*(here->BSIM3DPdpPtr + 1) += m * xcddb;
*(here->BSIM3SPspPtr + 1) += m * xcssb;
*(here->BSIM3GbPtr + 1) -=
m * (xcggb + xcgdb + xcgsb);
*(here->BSIM3GdpPtr + 1) += m * xcgdb;
*(here->BSIM3GspPtr + 1) += m * xcgsb;
*(here->BSIM3BgPtr + 1) += m * xcbgb;
*(here->BSIM3BdpPtr + 1) += m * xcbdb;
*(here->BSIM3BspPtr + 1) += m * xcbsb;
*(here->BSIM3DPgPtr + 1) += m * xcdgb;
*(here->BSIM3DPbPtr + 1) -=
m * (xcdgb + xcddb + xcdsb);
*(here->BSIM3DPspPtr + 1) += m * xcdsb;
*(here->BSIM3SPgPtr + 1) += m * xcsgb;
*(here->BSIM3SPbPtr + 1) -=
m * (xcsgb + xcsdb + xcssb);
*(here->BSIM3SPdpPtr + 1) += m * xcsdb;
*(here->BSIM3DdPtr) += m * gdpr;
*(here->BSIM3SsPtr) += m * gspr;
*(here->BSIM3BbPtr) +=
m * (gbd + gbs - here->BSIM3gbbs);
*(here->BSIM3DPdpPtr) +=
m * (gdpr + gds + gbd + RevSum +
dxpart * xgtd + T1 * ddxpart_dVd +
gbdpdp);
*(here->BSIM3SPspPtr) +=
m * (gspr + gds + gbs + FwdSum +
sxpart * xgts + T1 * dsxpart_dVs +
gbspsp);
*(here->BSIM3DdpPtr) -= m * gdpr;
*(here->BSIM3SspPtr) -= m * gspr;
*(here->BSIM3BgPtr) -= m * here->BSIM3gbgs;
*(here->BSIM3BdpPtr) -= m * (gbd - gbbdp);
*(here->BSIM3BspPtr) -= m * (gbs - gbbsp);
*(here->BSIM3DPdPtr) -= m * gdpr;
*(here->BSIM3DPgPtr) +=
m * (Gm + dxpart * xgtg + T1 * ddxpart_dVg +
gbdpg);
*(here->BSIM3DPbPtr) -=
m * (gbd - Gmbs - dxpart * xgtb -
T1 * ddxpart_dVb - gbdpb);
*(here->BSIM3DPspPtr) -=
m * (gds + FwdSum - dxpart * xgts -
T1 * ddxpart_dVs - gbdpsp);
*(here->BSIM3SPgPtr) -=
m * (Gm - sxpart * xgtg - T1 * dsxpart_dVg -
gbspg);
*(here->BSIM3SPsPtr) -= m * gspr;
*(here->BSIM3SPbPtr) -=
m * (gbs + Gmbs - sxpart * xgtb -
T1 * dsxpart_dVb - gbspb);
*(here->BSIM3SPdpPtr) -=
m * (gds + RevSum - sxpart * xgtd -
T1 * dsxpart_dVd - gbspdp);
*(here->BSIM3GgPtr) -= m * xgtg;
*(here->BSIM3GbPtr) -= m * xgtb;
*(here->BSIM3GdpPtr) -= m * xgtd;
*(here->BSIM3GspPtr) -= m * xgts;
if (here->BSIM3nqsMod)
{
*(here->BSIM3QqPtr + 1) +=
m * omega * ScalingFactor;
*(here->BSIM3QgPtr + 1) -= m * xcqgb;
*(here->BSIM3QdpPtr + 1) -= m * xcqdb;
*(here->BSIM3QspPtr + 1) -= m * xcqsb;
*(here->BSIM3QbPtr + 1) -= m * xcqbb;
*(here->BSIM3QqPtr) += m * here->BSIM3gtau;
*(here->BSIM3DPqPtr) +=
m * (dxpart * here->BSIM3gtau);
*(here->BSIM3SPqPtr) +=
m * (sxpart * here->BSIM3gtau);
*(here->BSIM3GqPtr) -= m * here->BSIM3gtau;
*(here->BSIM3QgPtr) += m * xgtg;
*(here->BSIM3QdpPtr) += m * xgtd;
*(here->BSIM3QspPtr) += m * xgts;
*(here->BSIM3QbPtr) += m * xgtb;
}
}
*(here->BSIM3GgPtr +1) += m * xcggb;
*(here->BSIM3BbPtr +1) -= m * (xcbgb + xcbdb + xcbsb);
*(here->BSIM3DPdpPtr +1) += m * (xcddb + gdsi + RevSumi);
*(here->BSIM3SPspPtr +1) += m * (xcssb + gdsi + FwdSumi);
*(here->BSIM3GbPtr +1) -= m * (xcggb + xcgdb + xcgsb);
*(here->BSIM3GdpPtr +1) += m * xcgdb;
*(here->BSIM3GspPtr +1) += m * xcgsb;
*(here->BSIM3BgPtr +1) += m * xcbgb;
*(here->BSIM3BdpPtr +1) += m * xcbdb;
*(here->BSIM3BspPtr +1) += m * xcbsb;
*(here->BSIM3DPgPtr +1) += m * (xcdgb + Gmi);
*(here->BSIM3DPbPtr +1) -= m * (xcdgb + xcddb + xcdsb + Gmbsi);
*(here->BSIM3DPspPtr +1) += m * (xcdsb - gdsi - FwdSumi);
*(here->BSIM3SPgPtr +1) += m * (xcsgb - Gmi);
*(here->BSIM3SPbPtr +1) -= m * (xcsgb + xcsdb + xcssb - Gmbsi);
*(here->BSIM3SPdpPtr +1) += m * (xcsdb - gdsi - RevSumi);
*(here->BSIM3DdPtr) += m * gdpr;
*(here->BSIM3SsPtr) += m * gspr;
*(here->BSIM3BbPtr) += m * (gbd + gbs - here->BSIM3gbbs);
*(here->BSIM3DPdpPtr) += m * (gdpr + gds + gbd + RevSum + xcddbi
+ dxpart * xgtd + T1 * ddxpart_dVd + gbdpdp);
*(here->BSIM3SPspPtr) += m * (gspr + gds + gbs + FwdSum + xcssbi
+ sxpart * xgts + T1 * dsxpart_dVs + gbspsp);
*(here->BSIM3DdpPtr) -= m * gdpr;
*(here->BSIM3SspPtr) -= m * gspr;
*(here->BSIM3BgPtr) -= m * here->BSIM3gbgs;
*(here->BSIM3BdpPtr) -= m * (gbd - gbbdp);
*(here->BSIM3BspPtr) -= m * (gbs - gbbsp);
*(here->BSIM3DPdPtr) -= m * gdpr;
*(here->BSIM3DPgPtr) += m * (Gm + dxpart * xgtg + T1 * ddxpart_dVg
+ gbdpg + xcdgbi);
*(here->BSIM3DPbPtr) -= m * (gbd - Gmbs - dxpart * xgtb
- T1 * ddxpart_dVb - gbdpb - xcdbbi);
*(here->BSIM3DPspPtr) -= m * (gds + FwdSum - dxpart * xgts
- T1 * ddxpart_dVs - gbdpsp - xcdsbi);
*(here->BSIM3SPgPtr) -= m * (Gm - sxpart * xgtg - T1 * dsxpart_dVg
- gbspg - xcsgbi);
*(here->BSIM3SPsPtr) -= m * gspr;
*(here->BSIM3SPbPtr) -= m * (gbs + Gmbs - sxpart * xgtb
- T1 * dsxpart_dVb - gbspb - xcsbbi);
*(here->BSIM3SPdpPtr) -= m * (gds + RevSum - sxpart * xgtd
- T1 * dsxpart_dVd - gbspdp - xcsdbi);
*(here->BSIM3GgPtr) -= m * (xgtg - xcggbi);
*(here->BSIM3GbPtr) -= m * (xgtb - xcgbbi);
*(here->BSIM3GdpPtr) -= m * (xgtd - xcgdbi);
*(here->BSIM3GspPtr) -= m * (xgts - xcgsbi);
if (here->BSIM3nqsMod)
{ if (here->BSIM3acnqsMod)
{ (*(here->BSIM3QqPtr) += m * 1.0);
(*(here->BSIM3QgPtr) += 0.0);
(*(here->BSIM3QdpPtr) += 0.0);
(*(here->BSIM3QspPtr) += 0.0);
(*(here->BSIM3QbPtr) += 0.0);
(*(here->BSIM3DPqPtr) += 0.0);
(*(here->BSIM3SPqPtr) += 0.0);
(*(here->BSIM3GqPtr) += 0.0);
} else {
*(here->BSIM3QqPtr +1) += m * omega * ScalingFactor;
*(here->BSIM3QgPtr +1) -= m * xcqgb;
*(here->BSIM3QdpPtr +1) -= m * xcqdb;
*(here->BSIM3QspPtr +1) -= m * xcqsb;
*(here->BSIM3QbPtr +1) -= m * xcqbb;
*(here->BSIM3QqPtr) += m * here->BSIM3gtau;
*(here->BSIM3DPqPtr) += m * dxpart * here->BSIM3gtau;
*(here->BSIM3SPqPtr) += m * sxpart * here->BSIM3gtau;
*(here->BSIM3GqPtr) -= m * here->BSIM3gtau;
*(here->BSIM3QgPtr) += m * xgtg;
*(here->BSIM3QdpPtr) += m * xgtd;
*(here->BSIM3QspPtr) += m * xgts;
*(here->BSIM3QbPtr) += m * xgtb;
}
}
}
}
return(OK);
}

24
src/spicelib/devices/bsim3/b3ask.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3ask.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3ask.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified bt Paolo Nenzi 2002 and Dietmar Warning 2003
**********/
#include "ngspice.h"
@ -18,8 +17,12 @@
#include "suffix.h"
int
BSIM3ask (CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value,
IFvalue *select)
BSIM3ask(ckt,inst,which,value,select)
CKTcircuit *ckt;
GENinstance *inst;
int which;
IFvalue *value;
IFvalue *select;
{
BSIM3instance *here = (BSIM3instance*)inst;
@ -30,9 +33,9 @@ BSIM3instance *here = (BSIM3instance*)inst;
case BSIM3_W:
value->rValue = here->BSIM3w;
return(OK);
case BSIM3_M:
value->rValue = here->BSIM3m;
return (OK);
case BSIM3_M:
value->rValue = here->BSIM3m;
return(OK);
case BSIM3_AS:
value->rValue = here->BSIM3sourceArea;
return(OK);
@ -57,6 +60,9 @@ BSIM3instance *here = (BSIM3instance*)inst;
case BSIM3_NQSMOD:
value->iValue = here->BSIM3nqsMod;
return(OK);
case BSIM3_ACNQSMOD:
value->iValue = here->BSIM3acnqsMod;
return(OK);
case BSIM3_IC_VBS:
value->rValue = here->BSIM3icVBS;
return(OK);

110
src/spicelib/devices/bsim3/b3check.c

@ -1,13 +1,13 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3check.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3check.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Author: 2001 Xuemei Xi.
* Modified by Xuemei Xi, 10/05, 12/14, 2001.
* Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
* Modified by Xuemei Xi, 07/29/2005.
**********/
#include "ngspice.h"
@ -20,7 +20,10 @@
#include "suffix.h"
int
BSIM3checkModel (BSIM3model *model, BSIM3instance *here, CKTcircuit *ckt)
BSIM3checkModel(model, here, ckt)
BSIM3model *model;
BSIM3instance *here;
CKTcircuit *ckt;
{
struct bsim3SizeDependParam *pParam;
int Fatal_Flag = 0;
@ -28,34 +31,20 @@ FILE *fplog;
if ((fplog = fopen("b3v3check.log", "w")) != NULL)
{ pParam = here->pParam;
fprintf(fplog, "BSIM3v3.3.0 Parameter Checking.\n");
if (strcmp(model->BSIM3version, "3.3.0"))
{ fprintf(fplog, "Warning: This model is BSIM3v3.3.0; you specified a wrong version number.\n");
printf("Warning: This model is BSIM3v3.3.0; you specified a wrong version number.\n");
}
fprintf(fplog, "Model = %s\n", model->BSIM3modName);
fprintf (fplog,
"BSIM3 Model (Supports: v3.2, v3.2.2, v3.2.3, v3.2.4)\n");
fprintf (fplog, "Parameter Checking.\n");
fprintf (fplog, "Model = %s\n", model->BSIM3modName);
fprintf (fplog, "W = %g, L = %g, M = %g\n", here->BSIM3w,
here->BSIM3l, here->BSIM3m);
if ((strcmp(model->BSIM3version, "3.2.4")) && (strcmp(model->BSIM3version, "3.24"))
&& (strcmp(model->BSIM3version, "3.2.3")) && (strcmp(model->BSIM3version, "3.23"))
&& (strcmp(model->BSIM3version, "3.2.2")) && (strcmp(model->BSIM3version, "3.22"))
&& (strcmp(model->BSIM3version, "3.2")) && (strcmp(model->BSIM3version, "3.20")))
{
fprintf (fplog,
"Warning: This model supports BSIM3v3.2, BSIM3v3.2.2, BSIM3v3.2.3, BSIM3v3.2.4\n");
fprintf (fplog,
"You specified a wrong version number. Working now with BSIM3v3.2.4.\n");
printf ("Warning: This model supports BSIM3v3.2, BSIM3v3.2.2, BSIM3v3.2.3, BSIM3v3.2.4\n");
printf ("You specified a wrong version number. Working now with BSIM3v3.2.4.\n");
}
if (pParam->BSIM3nlx < -pParam->BSIM3leff)
{ fprintf(fplog, "Fatal: Nlx = %g is less than -Leff.\n",
if (pParam->BSIM3nlx < -pParam->BSIM3leff)
{ fprintf(fplog, "Fatal: Nlx = %g is less than -Leff.\n",
pParam->BSIM3nlx);
printf("Fatal: Nlx = %g is less than -Leff.\n",
printf("Fatal: Nlx = %g is less than -Leff.\n",
pParam->BSIM3nlx);
Fatal_Flag = 1;
}
Fatal_Flag = 1;
}
if (model->BSIM3tox <= 0.0)
{ fprintf(fplog, "Fatal: Tox = %g is not positive.\n",
@ -71,6 +60,14 @@ FILE *fplog;
Fatal_Flag = 1;
}
if (model->BSIM3lintnoi > pParam->BSIM3leff/2)
{ fprintf(fplog, "Fatal: Lintnoi = %g is too large - Leff for noise is negative.\n",
model->BSIM3lintnoi);
printf("Fatal: Lintnoi = %g is too large - Leff for noise is negative.\n",
model->BSIM3lintnoi);
Fatal_Flag = 1;
}
if (pParam->BSIM3npeak <= 0.0)
{ fprintf(fplog, "Fatal: Nch = %g is not positive.\n",
pParam->BSIM3npeak);
@ -176,25 +173,22 @@ FILE *fplog;
printf("Warning: Pscbe2 = %g is not positive.\n", pParam->BSIM3pscbe2);
}
/* acm model */
if (model->BSIM3acmMod == 0) {
if (model->BSIM3unitLengthSidewallJctCap > 0.0 ||
model->BSIM3unitLengthGateSidewallJctCap > 0.0)
{
if (here->BSIM3drainPerimeter < pParam->BSIM3weff)
{ fprintf(fplog, "Warning: Pd = %g is less than W.\n",
here->BSIM3drainPerimeter);
printf("Warning: Pd = %g is less than W.\n",
here->BSIM3drainPerimeter);
}
if (here->BSIM3sourcePerimeter < pParam->BSIM3weff)
{ fprintf(fplog, "Warning: Ps = %g is less than W.\n",
here->BSIM3sourcePerimeter);
printf("Warning: Ps = %g is less than W.\n",
here->BSIM3sourcePerimeter);
}
}
}
if (model->BSIM3unitLengthSidewallJctCap > 0.0 ||
model->BSIM3unitLengthGateSidewallJctCap > 0.0)
{
if (here->BSIM3drainPerimeter < pParam->BSIM3weff)
{ fprintf(fplog, "Warning: Pd = %g is less than W.\n",
here->BSIM3drainPerimeter);
printf("Warning: Pd = %g is less than W.\n",
here->BSIM3drainPerimeter);
}
if (here->BSIM3sourcePerimeter < pParam->BSIM3weff)
{ fprintf(fplog, "Warning: Ps = %g is less than W.\n",
here->BSIM3sourcePerimeter);
printf("Warning: Ps = %g is less than W.\n",
here->BSIM3sourcePerimeter);
}
}
if (pParam->BSIM3noff < 0.1)
{ fprintf(fplog, "Warning: Noff = %g is too small.\n",
@ -387,7 +381,6 @@ FILE *fplog;
pParam->BSIM3a2);
pParam->BSIM3a2 = 1.0;
pParam->BSIM3a1 = 0.0;
}
if (pParam->BSIM3rdsw < 0.0)
@ -398,13 +391,14 @@ FILE *fplog;
pParam->BSIM3rdsw = 0.0;
pParam->BSIM3rds0 = 0.0;
}
else if ((pParam->BSIM3rds0 > 0.0) && (pParam->BSIM3rds0 < 0.001))
{ fprintf(fplog, "Warning: Rds at current temperature = %g is less than 0.001 ohm. Set to zero.\n",
pParam->BSIM3rds0);
printf("Warning: Rds at current temperature = %g is less than 0.001 ohm. Set to zero.\n",
pParam->BSIM3rds0);
pParam->BSIM3rds0 = 0.0;
}
if (pParam->BSIM3rds0 < 0.0)
{ fprintf(fplog, "Warning: Rds at current temperature = %g is negative. Set to zero.\n",
pParam->BSIM3rds0);
printf("Warning: Rds at current temperature = %g is negative. Set to zero.\n",
pParam->BSIM3rds0);
pParam->BSIM3rds0 = 0.0;
}
if (pParam->BSIM3vsattemp < 1.0e3)
{ fprintf(fplog, "Warning: Vsat at current temperature = %g may be too small.\n", pParam->BSIM3vsattemp);
printf("Warning: Vsat at current temperature = %g may be too small.\n", pParam->BSIM3vsattemp);

14
src/spicelib/devices/bsim3/b3cvtest.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3cvtest.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3cvtest.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002
**********/
#include "ngspice.h"
@ -20,7 +19,9 @@
int
BSIM3convTest (GENmodel *inModel, CKTcircuit *ckt)
BSIM3convTest(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{
BSIM3model *model = (BSIM3model*)inModel;
BSIM3instance *here;
@ -33,11 +34,10 @@ double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
for (here = model->BSIM3instances; here != NULL ;
here=here->BSIM3nextInstance)
{
if (here->BSIM3owner != ARCHme)
continue;
vbs = model->BSIM3type
vbs = model->BSIM3type
* (*(ckt->CKTrhsOld+here->BSIM3bNode)
- *(ckt->CKTrhsOld+here->BSIM3sNodePrime));
vgs = model->BSIM3type

14
src/spicelib/devices/bsim3/b3del.c

@ -1,13 +1,12 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3del.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3del.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Xuemei Xi, 10/05, 12/14, 2001.
* Modified by Paolo Nenzi 2002
**********/
#include "ngspice.h"
@ -18,7 +17,10 @@
int
BSIM3delete (GENmodel *inModel, IFuid name, GENinstance **inInst)
BSIM3delete(inModel,name,inInst)
GENmodel *inModel;
IFuid name;
GENinstance **inInst;
{
BSIM3instance **fast = (BSIM3instance**)inInst;
BSIM3model *model = (BSIM3model*)inModel;
@ -38,3 +40,5 @@ BSIM3instance *here;
}
return(E_NODEV);
}

13
src/spicelib/devices/bsim3/b3dest.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3dest.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3dest.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002
**********/
#include "ngspice.h"
@ -14,7 +13,8 @@
#include "suffix.h"
void
BSIM3destroy (GENmodel **inModel)
BSIM3destroy(inModel)
GENmodel **inModel;
{
BSIM3model **model = (BSIM3model**)inModel;
BSIM3instance *here;
@ -36,3 +36,6 @@ BSIM3model *oldmod = NULL;
*model = NULL;
return;
}

16
src/spicelib/devices/bsim3/b3getic.c

@ -1,8 +1,8 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/14/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3getic.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3getic.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
@ -16,18 +16,20 @@
int
BSIM3getic (GENmodel *inModel, CKTcircuit *ckt)
BSIM3getic(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{
BSIM3model *model = (BSIM3model*)inModel;
BSIM3instance *here;
for (; model ; model = model->BSIM3nextModel)
{ for (here = model->BSIM3instances; here; here = here->BSIM3nextInstance)
{
if (here->BSIM3owner != ARCHme)
{
if (here->BSIM3owner != ARCHme)
continue;
if (!here->BSIM3icVBSGiven)
if (!here->BSIM3icVBSGiven)
{ here->BSIM3icVBS = *(ckt->CKTrhs + here->BSIM3bNode)
- *(ckt->CKTrhs + here->BSIM3sNode);
}

860
src/spicelib/devices/bsim3/b3ld.c
File diff suppressed because it is too large
View File

54
src/spicelib/devices/bsim3/b3mask.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3mask.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3mask.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
**********/
#include "ngspice.h"
@ -18,7 +17,11 @@
#include "suffix.h"
int
BSIM3mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
BSIM3mAsk(ckt,inst,which,value)
CKTcircuit *ckt;
GENmodel *inst;
int which;
IFvalue *value;
{
BSIM3model *model = (BSIM3model *)inst;
switch(which)
@ -37,8 +40,8 @@ BSIM3mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
case BSIM3_MOD_NOIMOD:
value->iValue = model->BSIM3noiMod;
return(OK);
case BSIM3_MOD_ACMMOD:
value->iValue = model->BSIM3acmMod;
case BSIM3_MOD_ACNQSMOD:
value->iValue = model->BSIM3acnqsMod;
return(OK);
case BSIM3_MOD_VERSION :
value->sValue = model->BSIM3version;
@ -331,29 +334,6 @@ BSIM3mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
value->rValue = model->BSIM3tpbswg;
return(OK);
/* acm model */
case BSIM3_MOD_HDIF:
value->rValue = model->BSIM3hdif;
return(OK);
case BSIM3_MOD_LDIF:
value->rValue = model->BSIM3ldif;
return(OK);
case BSIM3_MOD_LD:
value->rValue = model->BSIM3ld;
return(OK);
case BSIM3_MOD_RD:
value->rValue = model->BSIM3rd;
return(OK);
case BSIM3_MOD_RS:
value->rValue = model->BSIM3rs;
return(OK);
case BSIM3_MOD_RDC:
value->rValue = model->BSIM3rdc;
return(OK);
case BSIM3_MOD_RSC:
value->rValue = model->BSIM3rsc;
return(OK);
/* Length dependence */
case BSIM3_MOD_LCDSC :
value->rValue = model->BSIM3lcdsc;
@ -1167,6 +1147,9 @@ BSIM3mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
case BSIM3_MOD_XTI:
value->rValue = model->BSIM3jctTempExponent;
return(OK);
case BSIM3_MOD_LINTNOI:
value->rValue = model->BSIM3lintnoi;
return(OK);
case BSIM3_MOD_LINT:
value->rValue = model->BSIM3Lint;
return(OK);
@ -1233,14 +1216,6 @@ BSIM3mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
case BSIM3_MOD_WMAX:
value->rValue = model->BSIM3Wmax;
return(OK);
case BSIM3_MOD_XL:
value->rValue = model->BSIM3xl;
return(OK);
case BSIM3_MOD_XW:
value->rValue = model->BSIM3xw;
return(OK);
case BSIM3_MOD_NOIA:
value->rValue = model->BSIM3oxideTrapDensityA;
return(OK);
@ -1267,3 +1242,6 @@ BSIM3mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
}
/* NOTREACHED */
}

12
src/spicelib/devices/bsim3/b3mdel.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3mdel.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3mdel.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002
**********/
#include "ngspice.h"
@ -15,7 +14,10 @@
#include "suffix.h"
int
BSIM3mDelete (GENmodel **inModel, IFuid modname, GENmodel *kill)
BSIM3mDelete(inModel,modname,kill)
GENmodel **inModel;
IFuid modname;
GENmodel *kill;
{
BSIM3model **model = (BSIM3model**)inModel;
BSIM3model *modfast = (BSIM3model*)kill;

67
src/spicelib/devices/bsim3/b3mpar.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3mpar.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3mpar.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
**********/
#include "ngspice.h"
@ -17,7 +16,10 @@
int
BSIM3mParam(int param, IFvalue *value, GENmodel *inMod)
BSIM3mParam(param,value,inMod)
int param;
IFvalue *value;
GENmodel *inMod;
{
BSIM3model *mod = (BSIM3model*)inMod;
switch(param)
@ -37,15 +39,15 @@ BSIM3mParam(int param, IFvalue *value, GENmodel *inMod)
mod->BSIM3capMod = value->iValue;
mod->BSIM3capModGiven = TRUE;
break;
case BSIM3_MOD_ACMMOD:
mod->BSIM3acmMod = value->iValue;
mod->BSIM3acmModGiven = TRUE;
break;
case BSIM3_MOD_NOIMOD :
mod->BSIM3noiMod = value->iValue;
mod->BSIM3noiModGiven = TRUE;
break;
case BSIM3_MOD_VERSION :
case BSIM3_MOD_ACNQSMOD :
mod->BSIM3acnqsMod = value->iValue;
mod->BSIM3acnqsModGiven = TRUE;
break;
case BSIM3_MOD_VERSION :
mod->BSIM3version = value->sValue;
mod->BSIM3versionGiven = TRUE;
break;
@ -436,36 +438,6 @@ BSIM3mParam(int param, IFvalue *value, GENmodel *inMod)
mod->BSIM3tpbswgGiven = TRUE;
break;
/* acm model */
case BSIM3_MOD_HDIF:
mod->BSIM3hdif = value->rValue;
mod->BSIM3hdifGiven = TRUE;
break;
case BSIM3_MOD_LDIF:
mod->BSIM3ldif = value->rValue;
mod->BSIM3ldifGiven = TRUE;
break;
case BSIM3_MOD_LD:
mod->BSIM3ld = value->rValue;
mod->BSIM3ldGiven = TRUE;
break;
case BSIM3_MOD_RD:
mod->BSIM3rd = value->rValue;
mod->BSIM3rdGiven = TRUE;
break;
case BSIM3_MOD_RS:
mod->BSIM3rs = value->rValue;
mod->BSIM3rsGiven = TRUE;
break;
case BSIM3_MOD_RDC:
mod->BSIM3rdc = value->rValue;
mod->BSIM3rdcGiven = TRUE;
break;
case BSIM3_MOD_RSC:
mod->BSIM3rsc = value->rValue;
mod->BSIM3rscGiven = TRUE;
break;
/* Length dependence */
case BSIM3_MOD_LCDSC :
mod->BSIM3lcdsc = value->rValue;
@ -1496,7 +1468,7 @@ BSIM3mParam(int param, IFvalue *value, GENmodel *inMod)
break;
case BSIM3_MOD_TNOM :
mod->BSIM3tnom = value->rValue + CONSTCtoK;
mod->BSIM3tnom = value->rValue;
mod->BSIM3tnomGiven = TRUE;
break;
case BSIM3_MOD_CGSO :
@ -1571,6 +1543,10 @@ BSIM3mParam(int param, IFvalue *value, GENmodel *inMod)
mod->BSIM3jctTempExponent = value->rValue;
mod->BSIM3jctTempExponentGiven = TRUE;
break;
case BSIM3_MOD_LINTNOI:
mod->BSIM3lintnoi = value->rValue;
mod->BSIM3lintnoiGiven = TRUE;
break;
case BSIM3_MOD_LINT :
mod->BSIM3Lint = value->rValue;
mod->BSIM3LintGiven = TRUE;
@ -1660,15 +1636,6 @@ BSIM3mParam(int param, IFvalue *value, GENmodel *inMod)
mod->BSIM3WmaxGiven = TRUE;
break;
case BSIM3_MOD_XL:
mod->BSIM3xl = value->rValue;
mod->BSIM3xlGiven = TRUE;
break;
case BSIM3_MOD_XW:
mod->BSIM3xw = value->rValue;
mod->BSIM3xwGiven = TRUE;
break;
case BSIM3_MOD_NOIA :
mod->BSIM3oxideTrapDensityA = value->rValue;
mod->BSIM3oxideTrapDensityAGiven = TRUE;

258
src/spicelib/devices/bsim3/b3noi.c

@ -1,13 +1,12 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3noi.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3noi.c of BSIM3v3.3.0
* Author: 1995 Gary W. Ng and Min-Chie Jeng.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Xuemei Xi, 10/05, 12/21, 2001.
* Modified bt Paolo Nenzi 2002 and Dietmar Warning 2003
* Modified by Xuemei Xi, 10/05/2001.
**********/
#include "ngspice.h"
@ -42,48 +41,47 @@
If model->BSIM3noiMod = 4,
Channel thermal noise = BSIM3 model
Flicker noise = SPICE2 model
If model->BSIM3noiMod = 5,
Channel thermal noise = SPICE2 model with linear/sat fix
Flicker noise = SPICE2 model
If model->BSIM3noiMod = 6,
Channel thermal noise = SPICE2 model with linear/sat fix
Flicker noise = BSIM3 model
*/
extern void NevalSrc();
extern double Nintegrate();
/*
* The StrongInversionNoiseEval function has been modified in
* the release 3.2.4 of BSIM3 model. To accomodate both the old
* and the new code, I have renamed according to the following:
*
*
* BSIM3v3.2.4 -> StrongInversionNoiseEvalNew
* Previous -> StrongInversionNoiseEvalOld
*
* 2002 Paolo Nenzi
*/
/*
* JX: 1/f noise model is smoothed out 12/18/01.
*/
double
StrongInversionNoiseEvalNew(double Vds, BSIM3model *model,
BSIM3instance *here, double freq, double temp)
StrongInversionNoiseEval(Vds, model, here, freq, temp)
double Vds, freq, temp;
BSIM3model *model;
BSIM3instance *here;
{
struct bsim3SizeDependParam *pParam;
double cd, esat, DelClm, EffFreq, N0, Nl;
double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi;
double cd, esat, DelClm, EffFreq, N0, Nl, Vgst, Leff, Leffsq;
double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi;
pParam = here->pParam;
cd = fabs(here->BSIM3cd);
Leff = pParam->BSIM3leff - 2.0 * model->BSIM3lintnoi;
Leffsq = Leff * Leff;
esat = 2.0 * pParam->BSIM3vsattemp / here->BSIM3ueff;
if(model->BSIM3em<=0.0) DelClm = 0.0;
else {
T0 = ((((Vds - here->BSIM3Vdseff) / pParam->BSIM3litl)
+ model->BSIM3em) / esat);
DelClm = pParam->BSIM3litl * log (MAX(T0, N_MINLOG));
if (DelClm < 0.0) DelClm = 0.0; /* bugfix */
}
EffFreq = pow(freq, model->BSIM3ef);
T1 = CHARGE * CHARGE * 8.62e-5 * cd * temp * here->BSIM3ueff;
T2 = 1.0e8 * EffFreq * here->BSIM3Abulk * model->BSIM3cox
* pParam->BSIM3leff * pParam->BSIM3leff;
T2 = 1.0e8 * EffFreq * here->BSIM3Abulk * model->BSIM3cox * Leffsq;
N0 = model->BSIM3cox * here->BSIM3Vgsteff / CHARGE;
Nl = model->BSIM3cox * here->BSIM3Vgsteff
* (1.0 - here->BSIM3AbovVgst2Vtm * here->BSIM3Vdseff) / CHARGE;
@ -94,8 +92,7 @@ double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi;
T5 = model->BSIM3oxideTrapDensityC * 0.5 * (N0 * N0 - Nl * Nl);
T6 = 8.62e-5 * temp * cd * cd;
T7 = 1.0e8 * EffFreq * pParam->BSIM3leff
* pParam->BSIM3leff * pParam->BSIM3weff;
T7 = 1.0e8 * EffFreq * Leffsq * pParam->BSIM3weff;
T8 = model->BSIM3oxideTrapDensityA + model->BSIM3oxideTrapDensityB * Nl
+ model->BSIM3oxideTrapDensityC * Nl * Nl;
T9 = (Nl + 2.0e14) * (Nl + 2.0e14);
@ -104,81 +101,13 @@ double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi;
return Ssi;
}
/*
* The code for releases: BSIM3V32, BSIM3V322, BSIM3V323
* follows
*/
double
StrongInversionNoiseEvalOld(double vgs, double vds, BSIM3model *model,
BSIM3instance *here, double freq, double temp)
{
struct bsim3SizeDependParam *pParam;
double cd, esat, DelClm, EffFreq, N0, Nl, Vgst;
double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ssi;
pParam = here->pParam;
cd = fabs (here->BSIM3cd);
/* Added revision dependent code */
if (model->BSIM3intVersion < BSIM3V323)
{
if (vds > here->BSIM3vdsat)
{
esat = 2.0 * pParam->BSIM3vsattemp / here->BSIM3ueff;
T0 = ((((vds - here->BSIM3vdsat) / pParam->BSIM3litl) +
model->BSIM3em) / esat);
DelClm = pParam->BSIM3litl * log (MAX (T0, N_MINLOG));
}
else
DelClm = 0.0;
}
else
{
if (model->BSIM3em <= 0.0) /* flicker noise modified -JX */
DelClm = 0.0;
else if (vds > here->BSIM3vdsat)
{
esat = 2.0 * pParam->BSIM3vsattemp / here->BSIM3ueff;
T0 = ((((vds - here->BSIM3vdsat) / pParam->BSIM3litl) +
model->BSIM3em) / esat);
DelClm = pParam->BSIM3litl * log (MAX (T0, N_MINLOG));
}
else
DelClm = 0.0;
}
EffFreq = pow (freq, model->BSIM3ef);
T1 = CHARGE * CHARGE * 8.62e-5 * cd * temp * here->BSIM3ueff;
T2 = 1.0e8 * EffFreq * model->BSIM3cox
* pParam->BSIM3leff * pParam->BSIM3leff;
Vgst = vgs - here->BSIM3von;
N0 = model->BSIM3cox * Vgst / CHARGE;
if (N0 < 0.0)
N0 = 0.0;
Nl = model->BSIM3cox * (Vgst - MIN (vds, here->BSIM3vdsat)) / CHARGE;
if (Nl < 0.0)
Nl = 0.0;
T3 = model->BSIM3oxideTrapDensityA
* log (MAX (((N0 + 2.0e14) / (Nl + 2.0e14)), N_MINLOG));
T4 = model->BSIM3oxideTrapDensityB * (N0 - Nl);
T5 = model->BSIM3oxideTrapDensityC * 0.5 * (N0 * N0 - Nl * Nl);
T6 = 8.62e-5 * temp * cd * cd;
T7 = 1.0e8 * EffFreq * pParam->BSIM3leff
* pParam->BSIM3leff * pParam->BSIM3weff;
T8 = model->BSIM3oxideTrapDensityA + model->BSIM3oxideTrapDensityB * Nl
+ model->BSIM3oxideTrapDensityC * Nl * Nl;
T9 = (Nl + 2.0e14) * (Nl + 2.0e14);
Ssi = T1 / T2 * (T3 + T4 + T5) + T6 / T7 * DelClm * T8 / T9;
return Ssi;
}
int
BSIM3noise (int mode, int operation, GENmodel *inModel, CKTcircuit *ckt,
Ndata *data, double *OnDens)
BSIM3noise (mode, operation, inModel, ckt, data, OnDens)
int mode, operation;
GENmodel *inModel;
CKTcircuit *ckt;
Ndata *data;
double *OnDens;
{
BSIM3model *model = (BSIM3model *)inModel;
BSIM3instance *here;
@ -190,8 +119,9 @@ double noizDens[BSIM3NSRCS];
double lnNdens[BSIM3NSRCS];
double vgs, vds, Slimit;
double T1, T10, T11;
double Ssi, Swi;
double N0, Nl;
double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13;
double n, ExpArg, Ssi, Swi;
double m;
@ -291,40 +221,39 @@ int i;
switch( model->BSIM3noiMod )
{ case 1:
case 3:
NevalSrc(&noizDens[BSIM3IDNOIZ],
&lnNdens[BSIM3IDNOIZ], ckt,
THERMNOISE, here->BSIM3dNodePrime,
here->BSIM3sNodePrime,
(2.0 / 3.0 * fabs(here->BSIM3gm
+ here->BSIM3gds
+ here->BSIM3gmbs)) * m);
NevalSrc(&noizDens[BSIM3IDNOIZ],
&lnNdens[BSIM3IDNOIZ], ckt,
THERMNOISE, here->BSIM3dNodePrime,
here->BSIM3sNodePrime,
2.0 * fabs(here->BSIM3gm
+ here->BSIM3gds
+ here->BSIM3gmbs) / 3.0 * m);
break;
case 5:
case 6:
vds = MIN(*(ckt->CKTstates[0] + here->BSIM3vds), here->BSIM3vdsat);
NevalSrc(&noizDens[BSIM3IDNOIZ],
&lnNdens[BSIM3IDNOIZ], ckt,
THERMNOISE, here->BSIM3dNodePrime,
here->BSIM3sNodePrime,
(3.0 - vds / here->BSIM3vdsat)
* fabs(here->BSIM3gm
+ here->BSIM3gds
+ here->BSIM3gmbs) / 3.0 * m);
break;
case 2:
case 4:
/* Added revision dependent code */
if (model->BSIM3intVersion == BSIM3V324)
{
NevalSrc(&noizDens[BSIM3IDNOIZ],
NevalSrc(&noizDens[BSIM3IDNOIZ],
&lnNdens[BSIM3IDNOIZ], ckt,
THERMNOISE, here->BSIM3dNodePrime,
here->BSIM3sNodePrime,
(m * here->BSIM3ueff
* fabs(here->BSIM3qinv)
/ (pParam->BSIM3leff * pParam->BSIM3leff
+ here->BSIM3ueff * fabs(here->BSIM3qinv)
/ (pParam->BSIM3leff * pParam->BSIM3leff
+ here->BSIM3ueff *fabs(here->BSIM3qinv)
* here->BSIM3rds))); /* bugfix */
}
else
{ /* for all versions lower then 3.2.4 */
NevalSrc(&noizDens[BSIM3IDNOIZ],
&lnNdens[BSIM3IDNOIZ], ckt,
THERMNOISE, here->BSIM3dNodePrime,
here->BSIM3sNodePrime,
(m * here->BSIM3ueff
* fabs(here->BSIM3qinv
/ (pParam->BSIM3leff
* pParam->BSIM3leff))));
}
break;
}
NevalSrc(&noizDens[BSIM3FLNOIZ], (double*) NULL,
@ -334,6 +263,7 @@ int i;
switch( model->BSIM3noiMod )
{ case 1:
case 4:
case 5:
noizDens[BSIM3FLNOIZ] *= m * model->BSIM3kf
* exp(model->BSIM3af
* log(MAX(fabs(here->BSIM3cd),
@ -345,66 +275,32 @@ int i;
break;
case 2:
case 3:
vgs = *(ckt->CKTstates[0] + here->BSIM3vgs);
vds = *(ckt->CKTstates[0] + here->BSIM3vds);
case 6:
vds = *(ckt->CKTstates[0] + here->BSIM3vds);
if (vds < 0.0)
{ vds = -vds;
vgs = vgs + vds;
}
/* Added revision dependent code */
if (model->BSIM3intVersion == BSIM3V324)
{
Ssi = StrongInversionNoiseEvalNew(vds, model,
Ssi = StrongInversionNoiseEval(vds, model,
here, data->freq, ckt->CKTtemp);
T10 = model->BSIM3oxideTrapDensityA
* 8.62e-5 * ckt->CKTtemp;
T11 = pParam->BSIM3weff
* pParam->BSIM3leff
* pow(data->freq, model->BSIM3ef)
* 4.0e36;
Swi = T10 / T11 * here->BSIM3cd
* here->BSIM3cd;
T1 = Swi + Ssi;
if (T1 > 0.0)
noizDens[BSIM3FLNOIZ] *= m * (Ssi * Swi) / T1;
else
noizDens[BSIM3FLNOIZ] *= 0.0;
}
else
{ /* for all versions lower then 3.2.4 */
if (vgs >= here->BSIM3von + 0.1)
{
Ssi = StrongInversionNoiseEvalOld(vgs, vds, model,
here, data->freq, ckt->CKTtemp);
noizDens[BSIM3FLNOIZ] *= m * Ssi;
}
else
{
pParam = here->pParam;
T10 = model->BSIM3oxideTrapDensityA
* 8.62e-5 * ckt->CKTtemp;
T11 = pParam->BSIM3weff
* pParam-> BSIM3leff
* pow (data->freq, model->BSIM3ef)
* 4.0e36;
Swi = T10 / T11 * here->BSIM3cd * here->BSIM3cd;
Slimit = StrongInversionNoiseEvalOld(
here->BSIM3von + 0.1, vds, model,
here, data->freq, ckt->CKTtemp);
T1 = Swi + Slimit;
if (T1 > 0.0)
noizDens[BSIM3FLNOIZ] *= m * (Slimit * Swi) / T1;
else
noizDens[BSIM3FLNOIZ] *= 0.0;
}
}
break;
}
T10 = model->BSIM3oxideTrapDensityA
* 8.62e-5 * ckt->CKTtemp;
T11 = pParam->BSIM3weff
* pParam->BSIM3leff
* pow(data->freq, model->BSIM3ef)
* 4.0e36;
Swi = T10 / T11 * here->BSIM3cd
* here->BSIM3cd;
T1 = Swi + Ssi;
if (T1 > 0.0)
noizDens[BSIM3FLNOIZ] *= m * (Ssi * Swi) / T1;
else
noizDens[BSIM3FLNOIZ] *= 0.0;
break;
}
lnNdens[BSIM3FLNOIZ] =
log(MAX(noizDens[BSIM3FLNOIZ], N_MINLOG));
log(MAX(noizDens[BSIM3FLNOIZ], N_MINLOG));
noizDens[BSIM3TOTNOIZ] = noizDens[BSIM3RDNOIZ]
+ noizDens[BSIM3RSNOIZ]
+ noizDens[BSIM3IDNOIZ]

17
src/spicelib/devices/bsim3/b3par.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3par.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3par.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
**********/
#include "ngspice.h"
@ -17,7 +16,11 @@
#include "fteext.h"
int
BSIM3param (int param, IFvalue *value, GENinstance *inst, IFvalue *select)
BSIM3param(param,value,inst,select)
int param;
IFvalue *value;
GENinstance *inst;
IFvalue *select;
{
double scale;
@ -80,6 +83,10 @@ BSIM3param (int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->BSIM3nqsMod = value->iValue;
here->BSIM3nqsModGiven = TRUE;
break;
case BSIM3_ACNQSMOD:
here->BSIM3acnqsMod = value->iValue;
here->BSIM3acnqsModGiven = TRUE;
break;
case BSIM3_IC:
switch(value->v.numValue){
case 3:

71
src/spicelib/devices/bsim3/b3pzld.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3pzld.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3pzld.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002
**********/
#include "ngspice.h"
@ -17,7 +16,10 @@
#include "suffix.h"
int
BSIM3pzLoad (GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
BSIM3pzLoad(inModel,ckt,s)
GENmodel *inModel;
CKTcircuit *ckt;
SPcomplex *s;
{
BSIM3model *model = (BSIM3model*)inModel;
BSIM3instance *here;
@ -26,13 +28,12 @@ double xcdgb, xcddb, xcdsb, xcdbb, xcsgb, xcsdb, xcssb, xcsbb;
double gdpr, gspr, gds, gbd, gbs, capbd, capbs, FwdSum, RevSum, Gm, Gmbs;
double cggb, cgdb, cgsb, cbgb, cbdb, cbsb, cddb, cdgb, cdsb;
double GSoverlapCap, GDoverlapCap, GBoverlapCap;
double dxpart, sxpart, xgtg, xgtd, xgts, xgtb;
double xcqgb = 0.0, xcqdb = 0.0, xcqsb = 0.0, xcqbb = 0.0;
double dxpart, sxpart, xgtg, xgtd, xgts, xgtb, xcqgb, xcqdb, xcqsb, xcqbb;
double gbspsp, gbbdp, gbbsp, gbspg, gbspb;
double gbspdp, gbdpdp, gbdpg, gbdpb, gbdpsp;
double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs;
double dsxpart_dVd, dsxpart_dVg, dsxpart_dVb, dsxpart_dVs;
double T1, CoxWL, qcheq, Cdg, Cdd, Cds, Csg, Csd, Css;
double T1, CoxWL, qcheq, Cdg, Cdd, Cds, Cdb, Csg, Csd, Css, Csb;
double ScalingFactor = 1.0e-9;
double m;
@ -61,7 +62,7 @@ double m;
gbspb = 0.0;
gbspsp = 0.0;
if (here->BSIM3nqsMod == 0)
if (here->BSIM3nqsMod == 0 && here->BSIM3acnqsMod == 0)
{ cggb = here->BSIM3cggb;
cgsb = here->BSIM3cgsb;
cgdb = here->BSIM3cgdb;
@ -158,7 +159,7 @@ double m;
gbspb = here->BSIM3gbbs;
gbspdp = -(gbspg + gbspsp + gbspb);
if (here->BSIM3nqsMod == 0)
if (here->BSIM3nqsMod == 0 && here->BSIM3acnqsMod == 0)
{ cggb = here->BSIM3cggb;
cgsb = here->BSIM3cgdb;
cgdb = here->BSIM3cgsb;
@ -320,30 +321,30 @@ double m;
*(here->BSIM3BdpPtr) -= m * (gbd - gbbdp);
*(here->BSIM3BspPtr) -= m * (gbs - gbbsp);
*(here->BSIM3DPgPtr) += Gm + dxpart * xgtg
+ T1 * ddxpart_dVg + gbdpg;
*(here->BSIM3DPdpPtr) += gdpr + gds + gbd + RevSum
+ dxpart * xgtd + T1 * ddxpart_dVd + gbdpdp;
*(here->BSIM3DPspPtr) -= gds + FwdSum - dxpart * xgts
- T1 * ddxpart_dVs - gbdpsp;
*(here->BSIM3DPbPtr) -= gbd - Gmbs - dxpart * xgtb
- T1 * ddxpart_dVb - gbdpb;
*(here->BSIM3SPgPtr) -= Gm - sxpart * xgtg
- T1 * dsxpart_dVg - gbspg;
*(here->BSIM3SPspPtr) += gspr + gds + gbs + FwdSum
+ sxpart * xgts + T1 * dsxpart_dVs + gbspsp;
*(here->BSIM3SPbPtr) -= gbs + Gmbs - sxpart * xgtb
- T1 * dsxpart_dVb - gbspb;
*(here->BSIM3SPdpPtr) -= gds + RevSum - sxpart * xgtd
- T1 * dsxpart_dVd - gbspdp;
*(here->BSIM3GgPtr) -= xgtg;
*(here->BSIM3GbPtr) -= xgtb;
*(here->BSIM3GdpPtr) -= xgtd;
*(here->BSIM3GspPtr) -= xgts;
if (here->BSIM3nqsMod)
*(here->BSIM3DPgPtr) += m * (Gm + dxpart * xgtg
+ T1 * ddxpart_dVg + gbdpg);
*(here->BSIM3DPdpPtr) += m * (gdpr + gds + gbd + RevSum
+ dxpart * xgtd + T1 * ddxpart_dVd + gbdpdp);
*(here->BSIM3DPspPtr) -= m * (gds + FwdSum - dxpart * xgts
- T1 * ddxpart_dVs - gbdpsp);
*(here->BSIM3DPbPtr) -= m * (gbd - Gmbs - dxpart * xgtb
- T1 * ddxpart_dVb - gbdpb);
*(here->BSIM3SPgPtr) -= m * (Gm - sxpart * xgtg
- T1 * dsxpart_dVg - gbspg);
*(here->BSIM3SPspPtr) += m * (gspr + gds + gbs + FwdSum
+ sxpart * xgts + T1 * dsxpart_dVs + gbspsp);
*(here->BSIM3SPbPtr) -= m * (gbs + Gmbs - sxpart * xgtb
- T1 * dsxpart_dVb - gbspb);
*(here->BSIM3SPdpPtr) -= m * (gds + RevSum - sxpart * xgtd
- T1 * dsxpart_dVd - gbspdp);
*(here->BSIM3GgPtr) -= m * xgtg;
*(here->BSIM3GbPtr) -= m * xgtb;
*(here->BSIM3GdpPtr) -= m * xgtd;
*(here->BSIM3GspPtr) -= m * xgts;
if (here->BSIM3nqsMod || here->BSIM3acnqsMod)
{ *(here->BSIM3QqPtr ) += m * (s->real * ScalingFactor);
*(here->BSIM3QqPtr +1) += m * (s->imag * ScalingFactor);
*(here->BSIM3QgPtr ) -= m * (xcqgb * s->real);
@ -353,7 +354,7 @@ double m;
*(here->BSIM3QbPtr ) -= m * (xcqbb * s->real);
*(here->BSIM3QbPtr +1) -= m * (xcqbb * s->imag);
*(here->BSIM3QspPtr ) -= m * (xcqsb * s->real);
*(here->BSIM3QspPtr +1) -= xcqsb * s->imag;
*(here->BSIM3QspPtr +1) -= m * (xcqsb * s->imag);
*(here->BSIM3GqPtr) -= m * (here->BSIM3gtau);
*(here->BSIM3DPqPtr) += m * (dxpart * here->BSIM3gtau);

307
src/spicelib/devices/bsim3/b3set.c

@ -1,8 +1,8 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3set.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3set.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
@ -27,16 +27,18 @@
#define Meter2Micron 1.0e6
int
BSIM3setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt,
int *states)
BSIM3setup(matrix,inModel,ckt,states)
SMPmatrix *matrix;
GENmodel *inModel;
CKTcircuit *ckt;
int *states;
{
BSIM3model *model = (BSIM3model*)inModel;
BSIM3instance *here;
int error;
CKTnode *tmp;
CKTnode *tmpNode;
IFuid tmpName;
double tmp1, tmp2;
/* loop through all the BSIM3 device models */
for( ; model != NULL; model = model->BSIM3nextModel )
@ -52,37 +54,16 @@ IFuid tmpName;
model->BSIM3paramChk = 0;
if (!model->BSIM3capModGiven)
model->BSIM3capMod = 3;
if (!model->BSIM3acmModGiven)
model->BSIM3acmMod = 0;
if (!model->BSIM3noiModGiven)
model->BSIM3noiMod = 1;
/* If the user does not provide the model revision,
* we always choose the most recent.
*/
if (!model->BSIM3versionGiven)
model->BSIM3version = "3.2.4";
/* I have added below the code that translate model string
* into an integer. This trick is meant to speed up the
* revision testing instruction, since comparing integer
* is faster than comparing strings.
* Paolo Nenzi 2002
*/
if ((!strcmp(model->BSIM3version, "3.2.4"))||(!strcmp(model->BSIM3version, "3.24")))
model->BSIM3intVersion = BSIM3V324;
else if ((!strcmp(model->BSIM3version, "3.2.3"))||(!strcmp(model->BSIM3version, "3.23")))
model->BSIM3intVersion = BSIM3V323;
else if ((!strcmp(model->BSIM3version, "3.2.2"))||(!strcmp(model->BSIM3version, "3.22")))
model->BSIM3intVersion = BSIM3V322;
else if ((!strcmp(model->BSIM3version, "3.2"))||(!strcmp(model->BSIM3version, "3.20")))
model->BSIM3intVersion = BSIM3V32;
else
model->BSIM3intVersion = BSIM3V3OLD;
/* BSIM3V3OLD is a placeholder for pre 3.2 revision
* This model should not be used for pre 3.2 models.
*/
if (!model->BSIM3acnqsModGiven)
model->BSIM3acnqsMod = 0;
else if ((model->BSIM3acnqsMod != 0) && (model->BSIM3acnqsMod != 1))
{ model->BSIM3acnqsMod = 0;
printf("Warning: acnqsMod has been set to its default value: 0.\n");
}
if (!model->BSIM3versionGiven)
model->BSIM3version = "3.3.0";
if (!model->BSIM3toxGiven)
model->BSIM3tox = 150.0e-10;
model->BSIM3cox = 3.453133e-11 / model->BSIM3tox;
@ -90,15 +71,15 @@ IFuid tmpName;
model->BSIM3toxm = model->BSIM3tox;
if (!model->BSIM3cdscGiven)
model->BSIM3cdsc = 2.4e-4; /* unit Q/V/m^2 */
model->BSIM3cdsc = 2.4e-4; /* unit Q/V/m^2 */
if (!model->BSIM3cdscbGiven)
model->BSIM3cdscb = 0.0; /* unit Q/V/m^2 */
if (!model->BSIM3cdscdGiven)
model->BSIM3cdscd = 0.0; /* unit Q/V/m^2 */
model->BSIM3cdscb = 0.0; /* unit Q/V/m^2 */
if (!model->BSIM3cdscdGiven)
model->BSIM3cdscd = 0.0; /* unit Q/V/m^2 */
if (!model->BSIM3citGiven)
model->BSIM3cit = 0.0; /* unit Q/V/m^2 */
model->BSIM3cit = 0.0; /* unit Q/V/m^2 */
if (!model->BSIM3nfactorGiven)
model->BSIM3nfactor = 1;
model->BSIM3nfactor = 1;
if (!model->BSIM3xjGiven)
model->BSIM3xj = .15e-6;
if (!model->BSIM3vsatGiven)
@ -122,9 +103,9 @@ IFuid tmpName;
if (!model->BSIM3ngateGiven)
model->BSIM3ngate = 0; /* unit 1/cm3 */
if (!model->BSIM3vbmGiven)
model->BSIM3vbm = -3.0;
model->BSIM3vbm = -3.0;
if (!model->BSIM3xtGiven)
model->BSIM3xt = 1.55e-7;
model->BSIM3xt = 1.55e-7;
if (!model->BSIM3kt1Given)
model->BSIM3kt1 = -0.11; /* unit V */
if (!model->BSIM3kt1lGiven)
@ -174,9 +155,9 @@ IFuid tmpName;
if (!model->BSIM3u0Given)
model->BSIM3u0 = (model->BSIM3type == NMOS) ? 0.067 : 0.025;
if (!model->BSIM3uteGiven)
model->BSIM3ute = -1.5;
model->BSIM3ute = -1.5;
if (!model->BSIM3voffGiven)
model->BSIM3voff = -0.08;
model->BSIM3voff = -0.08;
if (!model->BSIM3deltaGiven)
model->BSIM3delta = 0.01;
if (!model->BSIM3rdswGiven)
@ -260,33 +241,17 @@ IFuid tmpName;
if (!model->BSIM3tpbswgGiven)
model->BSIM3tpbswg = 0.0;
/* acm model */
if (!model->BSIM3hdifGiven)
model->BSIM3hdif = 0.0;
if (!model->BSIM3ldifGiven)
model->BSIM3ldif = 0.0;
if (!model->BSIM3ldGiven)
model->BSIM3ld = 0.0;
if (!model->BSIM3rdGiven)
model->BSIM3rd = 0.0;
if (!model->BSIM3rsGiven)
model->BSIM3rs = 0.0;
if (!model->BSIM3rdcGiven)
model->BSIM3rdc = 0.0;
if (!model->BSIM3rscGiven)
model->BSIM3rsc = 0.0;
/* Length dependence */
/* Length dependence */
if (!model->BSIM3lcdscGiven)
model->BSIM3lcdsc = 0.0;
model->BSIM3lcdsc = 0.0;
if (!model->BSIM3lcdscbGiven)
model->BSIM3lcdscb = 0.0;
if (!model->BSIM3lcdscdGiven)
model->BSIM3lcdscd = 0.0;
model->BSIM3lcdscb = 0.0;
if (!model->BSIM3lcdscdGiven)
model->BSIM3lcdscd = 0.0;
if (!model->BSIM3lcitGiven)
model->BSIM3lcit = 0.0;
model->BSIM3lcit = 0.0;
if (!model->BSIM3lnfactorGiven)
model->BSIM3lnfactor = 0.0;
model->BSIM3lnfactor = 0.0;
if (!model->BSIM3lxjGiven)
model->BSIM3lxj = 0.0;
if (!model->BSIM3lvsatGiven)
@ -310,9 +275,9 @@ IFuid tmpName;
if (!model->BSIM3lngateGiven)
model->BSIM3lngate = 0.0;
if (!model->BSIM3lvbmGiven)
model->BSIM3lvbm = 0.0;
model->BSIM3lvbm = 0.0;
if (!model->BSIM3lxtGiven)
model->BSIM3lxt = 0.0;
model->BSIM3lxt = 0.0;
if (!model->BSIM3lkt1Given)
model->BSIM3lkt1 = 0.0;
if (!model->BSIM3lkt1lGiven)
@ -360,9 +325,9 @@ IFuid tmpName;
if (!model->BSIM3lu0Given)
model->BSIM3lu0 = 0.0;
if (!model->BSIM3luteGiven)
model->BSIM3lute = 0.0;
model->BSIM3lute = 0.0;
if (!model->BSIM3lvoffGiven)
model->BSIM3lvoff = 0.0;
model->BSIM3lvoff = 0.0;
if (!model->BSIM3ldeltaGiven)
model->BSIM3ldelta = 0.0;
if (!model->BSIM3lrdswGiven)
@ -435,17 +400,17 @@ IFuid tmpName;
if (!model->BSIM3lvoffcvGiven)
model->BSIM3lvoffcv = 0.0;
/* Width dependence */
/* Width dependence */
if (!model->BSIM3wcdscGiven)
model->BSIM3wcdsc = 0.0;
model->BSIM3wcdsc = 0.0;
if (!model->BSIM3wcdscbGiven)
model->BSIM3wcdscb = 0.0;
if (!model->BSIM3wcdscdGiven)
model->BSIM3wcdscd = 0.0;
model->BSIM3wcdscb = 0.0;
if (!model->BSIM3wcdscdGiven)
model->BSIM3wcdscd = 0.0;
if (!model->BSIM3wcitGiven)
model->BSIM3wcit = 0.0;
model->BSIM3wcit = 0.0;
if (!model->BSIM3wnfactorGiven)
model->BSIM3wnfactor = 0.0;
model->BSIM3wnfactor = 0.0;
if (!model->BSIM3wxjGiven)
model->BSIM3wxj = 0.0;
if (!model->BSIM3wvsatGiven)
@ -469,9 +434,9 @@ IFuid tmpName;
if (!model->BSIM3wngateGiven)
model->BSIM3wngate = 0.0;
if (!model->BSIM3wvbmGiven)
model->BSIM3wvbm = 0.0;
model->BSIM3wvbm = 0.0;
if (!model->BSIM3wxtGiven)
model->BSIM3wxt = 0.0;
model->BSIM3wxt = 0.0;
if (!model->BSIM3wkt1Given)
model->BSIM3wkt1 = 0.0;
if (!model->BSIM3wkt1lGiven)
@ -519,9 +484,9 @@ IFuid tmpName;
if (!model->BSIM3wu0Given)
model->BSIM3wu0 = 0.0;
if (!model->BSIM3wuteGiven)
model->BSIM3wute = 0.0;
model->BSIM3wute = 0.0;
if (!model->BSIM3wvoffGiven)
model->BSIM3wvoff = 0.0;
model->BSIM3wvoff = 0.0;
if (!model->BSIM3wdeltaGiven)
model->BSIM3wdelta = 0.0;
if (!model->BSIM3wrdswGiven)
@ -594,17 +559,17 @@ IFuid tmpName;
if (!model->BSIM3wvoffcvGiven)
model->BSIM3wvoffcv = 0.0;
/* Cross-term dependence */
/* Cross-term dependence */
if (!model->BSIM3pcdscGiven)
model->BSIM3pcdsc = 0.0;
model->BSIM3pcdsc = 0.0;
if (!model->BSIM3pcdscbGiven)
model->BSIM3pcdscb = 0.0;
if (!model->BSIM3pcdscdGiven)
model->BSIM3pcdscd = 0.0;
model->BSIM3pcdscb = 0.0;
if (!model->BSIM3pcdscdGiven)
model->BSIM3pcdscd = 0.0;
if (!model->BSIM3pcitGiven)
model->BSIM3pcit = 0.0;
model->BSIM3pcit = 0.0;
if (!model->BSIM3pnfactorGiven)
model->BSIM3pnfactor = 0.0;
model->BSIM3pnfactor = 0.0;
if (!model->BSIM3pxjGiven)
model->BSIM3pxj = 0.0;
if (!model->BSIM3pvsatGiven)
@ -629,9 +594,9 @@ IFuid tmpName;
if (!model->BSIM3pngateGiven)
model->BSIM3pngate = 0.0;
if (!model->BSIM3pvbmGiven)
model->BSIM3pvbm = 0.0;
model->BSIM3pvbm = 0.0;
if (!model->BSIM3pxtGiven)
model->BSIM3pxt = 0.0;
model->BSIM3pxt = 0.0;
if (!model->BSIM3pkt1Given)
model->BSIM3pkt1 = 0.0;
if (!model->BSIM3pkt1lGiven)
@ -679,9 +644,9 @@ IFuid tmpName;
if (!model->BSIM3pu0Given)
model->BSIM3pu0 = 0.0;
if (!model->BSIM3puteGiven)
model->BSIM3pute = 0.0;
model->BSIM3pute = 0.0;
if (!model->BSIM3pvoffGiven)
model->BSIM3pvoff = 0.0;
model->BSIM3pvoff = 0.0;
if (!model->BSIM3pdeltaGiven)
model->BSIM3pdelta = 0.0;
if (!model->BSIM3prdswGiven)
@ -756,9 +721,11 @@ IFuid tmpName;
/* unit degree celcius */
if (!model->BSIM3tnomGiven)
model->BSIM3tnom = ckt->CKTnomTemp;
/* else
model->BSIM3tnom = model->BSIM3tnom + 273.15; */
model->BSIM3tnom = ckt->CKTnomTemp;
else
model->BSIM3tnom = model->BSIM3tnom + 273.15;
if (!model->BSIM3lintnoiGiven)
model->BSIM3lintnoi = 0.0; /* unit m */
if (!model->BSIM3LintGiven)
model->BSIM3Lint = 0.0;
if (!model->BSIM3LlGiven)
@ -807,35 +774,29 @@ IFuid tmpName;
model->BSIM3dwc = model->BSIM3Wint;
if (!model->BSIM3dlcGiven)
model->BSIM3dlc = model->BSIM3Lint;
if (!model->BSIM3xlGiven)
model->BSIM3xl = 0.0;
if (!model->BSIM3xwGiven)
model->BSIM3xw = 0.0;
if (!model->BSIM3cfGiven)
if (!model->BSIM3cfGiven)
model->BSIM3cf = 2.0 * EPSOX / PI
* log(1.0 + 0.4e-6 / model->BSIM3tox);
* log(1.0 + 0.4e-6 / model->BSIM3tox);
if (!model->BSIM3cgdoGiven)
{ if (model->BSIM3dlcGiven && (model->BSIM3dlc > 0.0))
{ model->BSIM3cgdo = model->BSIM3dlc * model->BSIM3cox
- model->BSIM3cgdl ;
}
else
model->BSIM3cgdo = 0.6 * model->BSIM3xj * model->BSIM3cox;
}
{ if (model->BSIM3dlcGiven && (model->BSIM3dlc > 0.0))
{ model->BSIM3cgdo = model->BSIM3dlc * model->BSIM3cox
- model->BSIM3cgdl ;
}
else
model->BSIM3cgdo = 0.6 * model->BSIM3xj * model->BSIM3cox;
}
if (!model->BSIM3cgsoGiven)
{ if (model->BSIM3dlcGiven && (model->BSIM3dlc > 0.0))
{ model->BSIM3cgso = model->BSIM3dlc * model->BSIM3cox
- model->BSIM3cgsl ;
}
else
model->BSIM3cgso = 0.6 * model->BSIM3xj * model->BSIM3cox;
}
{ if (model->BSIM3dlcGiven && (model->BSIM3dlc > 0.0))
{ model->BSIM3cgso = model->BSIM3dlc * model->BSIM3cox
- model->BSIM3cgsl ;
}
else
model->BSIM3cgso = 0.6 * model->BSIM3xj * model->BSIM3cox;
}
if (!model->BSIM3cgboGiven)
{ model->BSIM3cgbo = 2.0 * model->BSIM3dwc * model->BSIM3cox;
}
{ model->BSIM3cgbo = 2.0 * model->BSIM3dwc * model->BSIM3cox;
}
if (!model->BSIM3xpartGiven)
model->BSIM3xpart = 0.0;
if (!model->BSIM3sheetResistanceGiven)
@ -867,24 +828,24 @@ IFuid tmpName;
if (!model->BSIM3jctTempExponentGiven)
model->BSIM3jctTempExponent = 3.0;
if (!model->BSIM3oxideTrapDensityAGiven)
{ if (model->BSIM3type == NMOS)
{ if (model->BSIM3type == NMOS)
model->BSIM3oxideTrapDensityA = 1e20;
else
model->BSIM3oxideTrapDensityA=9.9e18;
}
}
if (!model->BSIM3oxideTrapDensityBGiven)
{ if (model->BSIM3type == NMOS)
{ if (model->BSIM3type == NMOS)
model->BSIM3oxideTrapDensityB = 5e4;
else
model->BSIM3oxideTrapDensityB = 2.4e3;
}
}
if (!model->BSIM3oxideTrapDensityCGiven)
{ if (model->BSIM3type == NMOS)
{ if (model->BSIM3type == NMOS)
model->BSIM3oxideTrapDensityC = -1.4e-12;
else
model->BSIM3oxideTrapDensityC = 1.4e-12;
}
}
if (!model->BSIM3emGiven)
model->BSIM3em = 4.1e7; /* V/m */
if (!model->BSIM3efGiven)
@ -896,26 +857,20 @@ IFuid tmpName;
/* loop through all the instances of the model */
for (here = model->BSIM3instances; here != NULL ;
here=here->BSIM3nextInstance)
{
{
if (here->BSIM3owner == ARCHme)
{
/* allocate a chunk of the state vector */
here->BSIM3states = *states;
*states += BSIM3numStates;
}
/* perform the parameter defaulting */
if (!here->BSIM3drainAreaGiven)
here->BSIM3drainArea = 0.0;
if (!here->BSIM3drainPerimeterGiven)
here->BSIM3drainPerimeter = 0.0;
if (!here->BSIM3drainSquaresGiven)
{
if (model->BSIM3acmMod == 0)
here->BSIM3drainSquares = 1.0;
else
here->BSIM3drainSquares = 0.0;
}
here->BSIM3drainSquares = 1.0;
if (!here->BSIM3icVBSGiven)
here->BSIM3icVBS = 0.0;
if (!here->BSIM3icVDSGiven)
@ -929,86 +884,56 @@ IFuid tmpName;
if (!here->BSIM3sourcePerimeterGiven)
here->BSIM3sourcePerimeter = 0.0;
if (!here->BSIM3sourceSquaresGiven)
{
if (model->BSIM3acmMod == 0)
here->BSIM3sourceSquares = 1.0;
else
here->BSIM3sourceSquares = 0.0;
}
here->BSIM3sourceSquares = 1.0;
if (!here->BSIM3wGiven)
here->BSIM3w = 5.0e-6;
if (!here->BSIM3nqsModGiven)
here->BSIM3nqsMod = 0;
if (!here->BSIM3acnqsModGiven)
here->BSIM3acnqsMod = model->BSIM3acnqsMod;
else if ((here->BSIM3acnqsMod != 0) && (here->BSIM3acnqsMod != 1))
{ here->BSIM3acnqsMod = model->BSIM3acnqsMod;
printf("Warning: acnqsMod has been set to its global value %d.\n",
model->BSIM3acnqsMod);
}
if (!here->BSIM3mGiven)
here->BSIM3m = 1;
/* process drain series resistance */
if ( ((model->BSIM3sheetResistance > 0.0) &&
(here->BSIM3drainSquares > 0.0) && (here->BSIM3dNodePrime == 0))
||((model->BSIM3sheetResistance > 0.0) &&
(model->BSIM3hdif > 0.0) && (here->BSIM3dNodePrime == 0))
||((model->BSIM3rd > 0.0) &&
(model->BSIM3ldif > 0.0) && (here->BSIM3dNodePrime == 0))
||((model->BSIM3rd > 0.0) &&
(model->BSIM3ld > 0.0) && (here->BSIM3dNodePrime == 0))
||((model->BSIM3rsc > 0.0) && (here->BSIM3dNodePrime == 0))
)
{ error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"drain");
if ((model->BSIM3sheetResistance > 0.0) &&
(here->BSIM3drainSquares > 0.0 ) &&
(here->BSIM3dNodePrime == 0))
{ error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"drain");
if(error) return(error);
here->BSIM3dNodePrime = tmp->number;
if (ckt->CKTcopyNodesets) {
if (CKTinst2Node(ckt,here,1,&tmpNode,&tmpName)==OK) {
if (tmpNode->nsGiven) {
tmp->nodeset=tmpNode->nodeset;
tmp->nsGiven=tmpNode->nsGiven;
}
}
}
}
else
{ here->BSIM3dNodePrime = here->BSIM3dNode;
else
{ here->BSIM3dNodePrime = here->BSIM3dNode;
}
/* process source series resistance */
if ( ((model->BSIM3sheetResistance > 0.0) &&
(here->BSIM3sourceSquares > 0.0) && (here->BSIM3sNodePrime == 0))
||((model->BSIM3sheetResistance > 0.0) &&
(model->BSIM3hdif > 0.0) && (here->BSIM3sNodePrime == 0))
||((model->BSIM3rs > 0.0) &&
(model->BSIM3ldif > 0.0) && (here->BSIM3sNodePrime == 0))
||((model->BSIM3rs > 0.0) &&
(model->BSIM3ld > 0.0) && (here->BSIM3sNodePrime == 0))
||((model->BSIM3rsc > 0.0) && (here->BSIM3sNodePrime == 0))
)
{ error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"source");
if ((model->BSIM3sheetResistance > 0.0) &&
(here->BSIM3sourceSquares > 0.0 ) &&
(here->BSIM3sNodePrime == 0))
{ error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"source");
if(error) return(error);
here->BSIM3sNodePrime = tmp->number;
if (ckt->CKTcopyNodesets) {
if (CKTinst2Node(ckt,here,3,&tmpNode,&tmpName)==OK) {
if (tmpNode->nsGiven) {
tmp->nodeset=tmpNode->nodeset;
tmp->nsGiven=tmpNode->nsGiven;
}
}
}
}
else
{ here->BSIM3sNodePrime = here->BSIM3sNode;
else
{ here->BSIM3sNodePrime = here->BSIM3sNode;
}
/* internal charge node */
if ((here->BSIM3nqsMod) && (here->BSIM3qNode == 0))
{ error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"charge");
{ error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"charge");
if(error) return(error);
here->BSIM3qNode = tmp->number;
}
else
{ here->BSIM3qNode = 0;
else
{ here->BSIM3qNode = 0;
}
/* set Sparse Matrix Pointers */

303
src/spicelib/devices/bsim3/b3temp.c

@ -1,14 +1,15 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3temp.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3temp.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
**********/
/* Lmin, Lmax, Wmin, Wmax */
#include "ngspice.h"
#include "smpdefs.h"
#include "cktdefs.h"
@ -30,13 +31,15 @@
/* ARGSUSED */
int
BSIM3temp (GENmodel *inModel, CKTcircuit *ckt)
BSIM3temp(inModel,ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{
BSIM3model *model = (BSIM3model*) inModel;
BSIM3instance *here;
struct bsim3SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam;
double tmp, tmp1, tmp2, tmp3, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, Ldrn, Wdrn;
double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom;
double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Dw, Dl, Vtm0, Tnom;
double Nvtm, SourceSatCurrent, DrainSatCurrent;
int Size_Not_Found;
@ -55,8 +58,6 @@ int Size_Not_Found;
{ model->BSIM3GatesidewallJctPotential = 0.1;
fprintf(stderr, "Given pbswg is less than 0.1. Pbswg is set to 0.1.\n");
}
/* va: was memory leakage - free old node, (or better use again?) */
FREE(model->pSizeDependParamKnot);
model->pSizeDependParamKnot = NULL;
pLastKnot = NULL;
@ -97,95 +98,26 @@ int Size_Not_Found;
delTemp = ckt->CKTtemp - model->BSIM3tnom;
T0 = model->BSIM3tcj * delTemp;
if (T0 >= -1.0)
{
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
model->BSIM3unitAreaTempJctCap =
model->BSIM3unitAreaJctCap * (1.0 + T0);
break;
case BSIM3V322:
case BSIM3V32:
default:
model->BSIM3unitAreaJctCap *= 1.0 + T0;
}
{ model->BSIM3unitAreaTempJctCap = model->BSIM3unitAreaJctCap * (1.0 + T0);
}
else if (model->BSIM3unitAreaJctCap > 0.0)
{
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
model->BSIM3unitAreaTempJctCap = 0.0;
break;
case BSIM3V322:
case BSIM3V32:
default:
model->BSIM3unitAreaJctCap = 0.0;
}
{ model->BSIM3unitAreaTempJctCap = 0.0;
fprintf(stderr, "Temperature effect has caused cj to be negative. Cj is clamped to zero.\n");
}
T0 = model->BSIM3tcjsw * delTemp;
if (T0 >= -1.0)
{
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
model->BSIM3unitLengthSidewallTempJctCap =
model->BSIM3unitLengthSidewallJctCap * (1.0 + T0);
break;
case BSIM3V322:
case BSIM3V32:
default:
model->BSIM3unitLengthSidewallJctCap *= 1.0 + T0;
}
{ model->BSIM3unitLengthSidewallTempJctCap = model->BSIM3unitLengthSidewallJctCap * (1.0 + T0);
}
else if (model->BSIM3unitLengthSidewallJctCap > 0.0)
{
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
model->BSIM3unitLengthSidewallTempJctCap = 0.0;
break;
case BSIM3V322:
case BSIM3V32:
default:
model->BSIM3unitLengthSidewallJctCap = 0.0;
}
{ model->BSIM3unitLengthSidewallTempJctCap = 0.0;
fprintf(stderr, "Temperature effect has caused cjsw to be negative. Cjsw is clamped to zero.\n");
}
T0 = model->BSIM3tcjswg * delTemp;
if (T0 >= -1.0)
{
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
model->BSIM3unitLengthGateSidewallTempJctCap =
model->BSIM3unitLengthGateSidewallJctCap * (1.0 + T0);
break;
case BSIM3V322:
case BSIM3V32:
default:
model->BSIM3unitLengthGateSidewallJctCap *= 1.0 + T0;
}
{ model->BSIM3unitLengthGateSidewallTempJctCap = model->BSIM3unitLengthGateSidewallJctCap * (1.0 + T0);
}
else if (model->BSIM3unitLengthGateSidewallJctCap > 0.0)
{
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
model->BSIM3unitLengthGateSidewallTempJctCap = 0.0;
break;
case BSIM3V322:
case BSIM3V32:
default:
model->BSIM3unitLengthGateSidewallJctCap = 0.0;
}
{ model->BSIM3unitLengthGateSidewallTempJctCap = 0.0;
fprintf(stderr, "Temperature effect has caused cjswg to be negative. Cjswg is clamped to zero.\n");
}
@ -215,17 +147,14 @@ int Size_Not_Found;
here = here->BSIM3nextInstance)
{
if (here->BSIM3owner != ARCHme) continue;
pSizeDependParamKnot = model->pSizeDependParamKnot;
pSizeDependParamKnot = model->pSizeDependParamKnot;
Size_Not_Found = 1;
while ((pSizeDependParamKnot != NULL) && Size_Not_Found)
{ if ((here->BSIM3l == pSizeDependParamKnot->Length)
&& (here->BSIM3w == pSizeDependParamKnot->Width))
{ Size_Not_Found = 0;
here->pParam = pSizeDependParamKnot;
if (model->BSIM3intVersion > BSIM3V322)
{
pParam = here->pParam; /*bug-fix */
}
pParam = here->pParam; /*bug-fix */
}
else
{ pLastKnot = pSizeDependParamKnot;
@ -266,7 +195,7 @@ int Size_Not_Found;
+ model->BSIM3Wwlc / (T2 * T3);
pParam->BSIM3dwc = model->BSIM3dwc + tmp2;
pParam->BSIM3leff = here->BSIM3l + model->BSIM3xl - 2.0 * pParam->BSIM3dl;
pParam->BSIM3leff = here->BSIM3l - 2.0 * pParam->BSIM3dl;
if (pParam->BSIM3leff <= 0.0)
{ IFuid namarray[2];
namarray[0] = model->BSIM3modName;
@ -277,7 +206,7 @@ int Size_Not_Found;
return(E_BADPARM);
}
pParam->BSIM3weff = here->BSIM3w + model->BSIM3xw - 2.0 * pParam->BSIM3dw;
pParam->BSIM3weff = here->BSIM3w - 2.0 * pParam->BSIM3dw;
if (pParam->BSIM3weff <= 0.0)
{ IFuid namarray[2];
namarray[0] = model->BSIM3modName;
@ -288,7 +217,7 @@ int Size_Not_Found;
return(E_BADPARM);
}
pParam->BSIM3leffCV = here->BSIM3l + model->BSIM3xl - 2.0 * pParam->BSIM3dlc;
pParam->BSIM3leffCV = here->BSIM3l - 2.0 * pParam->BSIM3dlc;
if (pParam->BSIM3leffCV <= 0.0)
{ IFuid namarray[2];
namarray[0] = model->BSIM3modName;
@ -299,7 +228,7 @@ int Size_Not_Found;
return(E_BADPARM);
}
pParam->BSIM3weffCV = here->BSIM3w + model->BSIM3xw - 2.0 * pParam->BSIM3dwc;
pParam->BSIM3weffCV = here->BSIM3w - 2.0 * pParam->BSIM3dwc;
if (pParam->BSIM3weffCV <= 0.0)
{ IFuid namarray[2];
namarray[0] = model->BSIM3modName;
@ -862,179 +791,59 @@ int Size_Not_Found;
* pParam->BSIM3sqrtPhi;
/* End of vfbzb */
}
else /* !Size_Not_Found */
{
/* va: pParam might be uninitialized, if !Size_Not_Found */
pParam = here->pParam;
}
/* process source/drain series resistance */
/* acm model */
if (model->BSIM3acmMod == 0)
{
here->BSIM3drainConductance = model->BSIM3sheetResistance
* here->BSIM3drainSquares;
here->BSIM3sourceConductance = model->BSIM3sheetResistance
* here->BSIM3sourceSquares;
}
else
{
if (here->BSIM3drainSquaresGiven)
{
here->BSIM3drainConductance = (model->BSIM3ld + model->BSIM3ldif)/(here->BSIM3w + model->BSIM3xw)*model->BSIM3rd
+ model->BSIM3sheetResistance * here->BSIM3drainSquares + model->BSIM3rdc;
}
else
{
here->BSIM3drainConductance = ((model->BSIM3ld + model->BSIM3ldif)*model->BSIM3rd
+ model->BSIM3hdif*model->BSIM3sheetResistance)/(here->BSIM3w + model->BSIM3xw) + model->BSIM3rdc;
}
if (here->BSIM3sourceSquaresGiven)
{
here->BSIM3sourceConductance = (model->BSIM3ld + model->BSIM3ldif)/(here->BSIM3w + model->BSIM3xw)*model->BSIM3rs
+ model->BSIM3sheetResistance * here->BSIM3sourceSquares + model->BSIM3rsc;
}
else
{
here->BSIM3sourceConductance = ((model->BSIM3ld + model->BSIM3ldif)*model->BSIM3rs
+ model->BSIM3hdif*model->BSIM3sheetResistance)/(here->BSIM3w + model->BSIM3xw) + model->BSIM3rsc;
}
}
here->BSIM3drainConductance = model->BSIM3sheetResistance
* here->BSIM3drainSquares;
if (here->BSIM3drainConductance > 0.0)
here->BSIM3drainConductance = 1.0
/ here->BSIM3drainConductance;
/ here->BSIM3drainConductance;
else
here->BSIM3drainConductance = 0.0;
here->BSIM3sourceConductance = model->BSIM3sheetResistance
* here->BSIM3sourceSquares;
if (here->BSIM3sourceConductance > 0.0)
here->BSIM3sourceConductance = 1.0
/ here->BSIM3sourceConductance;
else
here->BSIM3sourceConductance = 0.0;
here->BSIM3cgso = pParam->BSIM3cgso;
here->BSIM3cgdo = pParam->BSIM3cgdo;
Nvtm = model->BSIM3vtm * model->BSIM3jctEmissionCoeff;
if (model->BSIM3acmMod == 0)
{
if ((here->BSIM3sourceArea <= 0.0) &&
(here->BSIM3sourcePerimeter <= 0.0))
{ SourceSatCurrent = 1.0e-14;
}
else
{ SourceSatCurrent = here->BSIM3sourceArea
* model->BSIM3jctTempSatCurDensity
+ here->BSIM3sourcePerimeter
* model->BSIM3jctSidewallTempSatCurDensity;
}
if ((SourceSatCurrent > 0.0) && (model->BSIM3ijth > 0.0))
{ here->BSIM3vjsm = Nvtm * log(model->BSIM3ijth
/ SourceSatCurrent + 1.0);
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
case BSIM3V322:
here->BSIM3IsEvjsm =
SourceSatCurrent * exp(here->BSIM3vjsm / Nvtm);
break;
case BSIM3V32:
default:
/* Do nothing */
break;
}
}
if ((here->BSIM3drainArea <= 0.0) &&
(here->BSIM3drainPerimeter <= 0.0))
{ DrainSatCurrent = 1.0e-14;
}
else
{ DrainSatCurrent = here->BSIM3drainArea
* model->BSIM3jctTempSatCurDensity
+ here->BSIM3drainPerimeter
* model->BSIM3jctSidewallTempSatCurDensity;
}
if ((DrainSatCurrent > 0.0) && (model->BSIM3ijth > 0.0))
{ here->BSIM3vjdm = Nvtm * log(model->BSIM3ijth
/ DrainSatCurrent + 1.0);
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
case BSIM3V322:
here->BSIM3IsEvjdm =
DrainSatCurrent * exp(here->BSIM3vjdm / Nvtm);
break;
case BSIM3V32:
default:
/* Do nothing */
break;
}
}
if ((here->BSIM3sourceArea <= 0.0) &&
(here->BSIM3sourcePerimeter <= 0.0))
{ SourceSatCurrent = 1.0e-14;
}
else
{
SourceSatCurrent = 0.0;
if (!here->BSIM3sourceAreaGiven)
{
here->BSIM3sourceArea = 2.0 * model->BSIM3hdif * pParam->BSIM3weff;
}
SourceSatCurrent = here->BSIM3sourceArea * model->BSIM3jctTempSatCurDensity;
if (!here->BSIM3sourcePerimeterGiven)
{
here->BSIM3sourcePerimeter = 4.0 * model->BSIM3hdif + 2.0 * pParam->BSIM3weff;
}
SourceSatCurrent = SourceSatCurrent + here->BSIM3sourcePerimeter * model->BSIM3jctSidewallTempSatCurDensity;
if (SourceSatCurrent <= 0.0) SourceSatCurrent = 1.0e-14;
if ((SourceSatCurrent > 0.0) && (model->BSIM3ijth > 0.0))
{ here->BSIM3vjsm = Nvtm * log(model->BSIM3ijth
/ SourceSatCurrent + 1.0);
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
case BSIM3V322:
here->BSIM3IsEvjsm =
SourceSatCurrent * exp(here->BSIM3vjsm / Nvtm);
break;
case BSIM3V32:
default:
/* Do nothing */
break;
}
}
{ SourceSatCurrent = here->BSIM3sourceArea
* model->BSIM3jctTempSatCurDensity
+ here->BSIM3sourcePerimeter
* model->BSIM3jctSidewallTempSatCurDensity;
}
if ((SourceSatCurrent > 0.0) && (model->BSIM3ijth > 0.0))
{ here->BSIM3vjsm = Nvtm * log(model->BSIM3ijth
/ SourceSatCurrent + 1.0);
here->BSIM3IsEvjsm = SourceSatCurrent * exp(here->BSIM3vjsm
/ Nvtm);
}
DrainSatCurrent = 0.0;
if (!here->BSIM3drainAreaGiven)
{
here->BSIM3drainArea = 2.0 * model->BSIM3hdif * pParam->BSIM3weff;
}
DrainSatCurrent = here->BSIM3drainArea * model->BSIM3jctTempSatCurDensity;
if (!here->BSIM3drainPerimeterGiven)
{
here->BSIM3drainPerimeter = 4.0 * model->BSIM3hdif + 2.0 * pParam->BSIM3weff;
}
DrainSatCurrent = DrainSatCurrent + here->BSIM3drainPerimeter * model->BSIM3jctSidewallTempSatCurDensity;
if (DrainSatCurrent <= 0.0) DrainSatCurrent = 1.0e-14;
if ((DrainSatCurrent > 0.0) && (model->BSIM3ijth > 0.0))
{ here->BSIM3vjdm = Nvtm * log(model->BSIM3ijth
/ DrainSatCurrent + 1.0);
/* Added revision dependent code */
switch (model->BSIM3intVersion) {
case BSIM3V324:
case BSIM3V323:
case BSIM3V322:
here->BSIM3IsEvjdm =
DrainSatCurrent * exp(here->BSIM3vjdm / Nvtm);
break;
case BSIM3V32:
default:
/* Do nothing */
break;
}
}
if ((here->BSIM3drainArea <= 0.0) &&
(here->BSIM3drainPerimeter <= 0.0))
{ DrainSatCurrent = 1.0e-14;
}
else
{ DrainSatCurrent = here->BSIM3drainArea
* model->BSIM3jctTempSatCurDensity
+ here->BSIM3drainPerimeter
* model->BSIM3jctSidewallTempSatCurDensity;
}
if ((DrainSatCurrent > 0.0) && (model->BSIM3ijth > 0.0))
{ here->BSIM3vjdm = Nvtm * log(model->BSIM3ijth
/ DrainSatCurrent + 1.0);
here->BSIM3IsEvjdm = DrainSatCurrent * exp(here->BSIM3vjdm
/ Nvtm);
}
}
}

15
src/spicelib/devices/bsim3/b3trunc.c

@ -1,12 +1,11 @@
/**** BSIM3v3.2.4, Released by Xuemei Xi 12/21/2001 ****/
/**** BSIM3v3.3.0, Released by Xuemei Xi 07/29/2005 ****/
/**********
* Copyright 2001 Regents of the University of California. All rights reserved.
* File: b3trunc.c of BSIM3v3.2.4
* Copyright 2004 Regents of the University of California. All rights reserved.
* File: b3trunc.c of BSIM3v3.3.0
* Author: 1995 Min-Chie Jeng and Mansun Chan.
* Author: 1997-1999 Weidong Liu.
* Author: 2001 Xuemei Xi
* Modified by Poalo Nenzi 2002
**********/
#include "ngspice.h"
@ -17,7 +16,10 @@
int
BSIM3trunc (GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
BSIM3trunc(inModel,ckt,timeStep)
GENmodel *inModel;
CKTcircuit *ckt;
double *timeStep;
{
BSIM3model *model = (BSIM3model*)inModel;
BSIM3instance *here;
@ -48,3 +50,6 @@ BSIM3instance *here;
}
return(OK);
}

74
src/spicelib/devices/bsim3/bsim3def.h

@ -1,9 +1,8 @@
/**********
Copyright 2001 Regents of the University of California. All rights reserved.
Copyright 2004 Regents of the University of California. All rights reserved.
Author: 1995 Min-Chie Jeng and Mansun Chan.
Author: 1997-1999 Weidong Liu.
Author: 2001 Xuemei Xi
Modified by Paolo Nenzi 2002 and Dietmar Warning 2003
Author: 2001- Xuemei Xi
File: bsim3def.h
**********/
@ -21,7 +20,7 @@ typedef struct sBSIM3instance
struct sBSIM3model *BSIM3modPtr;
struct sBSIM3instance *BSIM3nextInstance;
IFuid BSIM3name;
int BSIM3owner; /* number of owner process */
int BSIM3owner; /* number of owner process */
int BSIM3states; /* index into state table for this device */
int BSIM3dNode;
int BSIM3gNode;
@ -61,6 +60,7 @@ typedef struct sBSIM3instance
int BSIM3off;
int BSIM3mode;
int BSIM3nqsMod;
int BSIM3acnqsMod;
/* OP point */
double BSIM3qinv;
@ -109,6 +109,7 @@ typedef struct sBSIM3instance
double BSIM3Vdseff;
double BSIM3Abulk;
double BSIM3AbovVgst2Vtm;
double BSIM3taunet;
struct bsim3SizeDependParam *pParam;
@ -127,6 +128,7 @@ typedef struct sBSIM3instance
unsigned BSIM3icVDSGiven :1;
unsigned BSIM3icVGSGiven :1;
unsigned BSIM3nqsModGiven :1;
unsigned BSIM3acnqsModGiven :1;
double *BSIM3DdPtr;
double *BSIM3GgPtr;
@ -352,20 +354,11 @@ typedef struct sBSIM3model
int BSIM3mobMod;
int BSIM3capMod;
int BSIM3acmMod;
int BSIM3noiMod;
int BSIM3acnqsMod;
int BSIM3binUnit;
int BSIM3paramChk;
char *BSIM3version;
/* The following field is an integer coding
* of BSIM3version.
*/
int BSIM3intVersion;
#define BSIM3V324 324 /* BSIM3 V3.2.4 */
#define BSIM3V323 323 /* BSIM3 V3.2.3 */
#define BSIM3V322 322 /* BSIM3 V3.2.2 */
#define BSIM3V32 32 /* BSIM3 V3.2 */
#define BSIM3V3OLD 0 /* Old model */
double BSIM3tox;
double BSIM3toxm;
double BSIM3cdsc;
@ -463,15 +456,6 @@ typedef struct sBSIM3model
double BSIM3tpbsw;
double BSIM3tpbswg;
/* acm model */
double BSIM3hdif;
double BSIM3ldif;
double BSIM3ld;
double BSIM3rd;
double BSIM3rs;
double BSIM3rdc;
double BSIM3rsc;
/* Length Dependence */
double BSIM3lcdsc;
double BSIM3lcdscb;
@ -780,9 +764,6 @@ typedef struct sBSIM3model
double BSIM3Wmin;
double BSIM3Wmax;
/* acm model */
double BSIM3xl;
double BSIM3xw;
/* Pre-calculated constants */
/* MCJ: move to size-dependent param. */
@ -810,6 +791,7 @@ typedef struct sBSIM3model
double BSIM3ef;
double BSIM3af;
double BSIM3kf;
double BSIM3lintnoi; /* lint offset for noise calculation */
struct bsim3SizeDependParam *pSizeDependParamKnot;
@ -817,9 +799,9 @@ typedef struct sBSIM3model
unsigned BSIM3mobModGiven :1;
unsigned BSIM3binUnitGiven :1;
unsigned BSIM3capModGiven :1;
unsigned BSIM3acmModGiven :1;
unsigned BSIM3paramChkGiven :1;
unsigned BSIM3noiModGiven :1;
unsigned BSIM3acnqsModGiven :1;
unsigned BSIM3typeGiven :1;
unsigned BSIM3toxGiven :1;
unsigned BSIM3versionGiven :1;
@ -919,14 +901,6 @@ typedef struct sBSIM3model
unsigned BSIM3tpbswGiven :1;
unsigned BSIM3tpbswgGiven :1;
/* acm model */
unsigned BSIM3hdifGiven :1;
unsigned BSIM3ldifGiven :1;
unsigned BSIM3ldGiven :1;
unsigned BSIM3rdGiven :1;
unsigned BSIM3rsGiven :1;
unsigned BSIM3rdcGiven :1;
unsigned BSIM3rscGiven :1;
/* Length dependence */
unsigned BSIM3lcdscGiven :1;
@ -1218,6 +1192,7 @@ typedef struct sBSIM3model
unsigned BSIM3efGiven :1;
unsigned BSIM3afGiven :1;
unsigned BSIM3kfGiven :1;
unsigned BSIM3lintnoiGiven :1;
unsigned BSIM3LintGiven :1;
unsigned BSIM3LlGiven :1;
@ -1243,10 +1218,6 @@ typedef struct sBSIM3model
unsigned BSIM3WminGiven :1;
unsigned BSIM3WmaxGiven :1;
/* acm model */
unsigned BSIM3xlGiven :1;
unsigned BSIM3xwGiven :1;
} BSIM3model;
@ -1259,7 +1230,7 @@ typedef struct sBSIM3model
/* device parameters */
#define BSIM3_W 1
#define BSIM3_L 2
#define BSIM3_M 15
#define BSIM3_M 16
#define BSIM3_AS 3
#define BSIM3_AD 4
#define BSIM3_PS 5
@ -1272,10 +1243,10 @@ typedef struct sBSIM3model
#define BSIM3_IC_VGS 12
#define BSIM3_IC 13
#define BSIM3_NQSMOD 14
#define BSIM3_ACNQSMOD 15
/* model parameters */
#define BSIM3_MOD_CAPMOD 101
#define BSIM3_MOD_ACMMOD 102
#define BSIM3_MOD_MOBMOD 103
#define BSIM3_MOD_NOIMOD 104
@ -1386,6 +1357,8 @@ typedef struct sBSIM3model
#define BSIM3_MOD_TPBSW 206
#define BSIM3_MOD_TPBSWG 207
#define BSIM3_MOD_VOFFCV 208
#define BSIM3_MOD_LINTNOI 209
#define BSIM3_MOD_ACNQSMOD 210
/* Length dependence */
#define BSIM3_MOD_LCDSC 251
@ -1740,18 +1713,6 @@ typedef struct sBSIM3model
#define BSIM3_MOD_WWC 701
#define BSIM3_MOD_WWLC 702
/* acm parameters */
#define BSIM3_MOD_XL 703
#define BSIM3_MOD_XW 704
#define BSIM3_MOD_HDIF 711
#define BSIM3_MOD_LDIF 712
#define BSIM3_MOD_LD 713
#define BSIM3_MOD_RD 714
#define BSIM3_MOD_RS 715
#define BSIM3_MOD_RDC 716
#define BSIM3_MOD_RSC 717
/* device questions */
#define BSIM3_DNODE 751
#define BSIM3_GNODE 752
@ -1800,11 +1761,18 @@ typedef struct sBSIM3model
#include "bsim3ext.h"
#ifdef __STDC__
extern void BSIM3evaluate(double,double,double,BSIM3instance*,BSIM3model*,
double*,double*,double*, double*, double*, double*, double*,
double*, double*, double*, double*, double*, double*, double*,
double*, double*, double*, double*, CKTcircuit*);
extern int BSIM3debug(BSIM3model*, BSIM3instance*, CKTcircuit*, int);
extern int BSIM3checkModel(BSIM3model*, BSIM3instance*, CKTcircuit*);
#else /* stdc */
extern void BSIM3evaluate();
extern int BSIM3debug();
extern int BSIM3checkModel();
#endif /* stdc */
#endif /*BSIM3*/

27
src/spicelib/devices/bsim3/bsim3ext.h

@ -1,11 +1,11 @@
/**********
Copyright 1999 Regents of the University of California. All rights reserved.
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1991 JianHui Huang and Min-Chie Jeng.
Modified by Yuhua Cheng to use BSIM3v3 in Spice3f5 (Jan. 1997)
Modified by Paolo Nenzi 2002
File: bsim3ext.h
**********/
#ifdef __STDC__
extern int BSIM3acLoad(GENmodel *,CKTcircuit*);
extern int BSIM3ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*);
extern int BSIM3convTest(GENmodel *,CKTcircuit*);
@ -29,3 +29,26 @@ extern int BSIM3temp(GENmodel*,CKTcircuit*);
extern int BSIM3trunc(GENmodel*,CKTcircuit*,double*);
extern int BSIM3noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
extern int BSIM3unsetup(GENmodel*,CKTcircuit*);
#else /* stdc */
extern int BSIM3acLoad();
extern int BSIM3delete();
extern void BSIM3destroy();
extern int BSIM3getic();
extern int BSIM3load();
extern int BSIM3mDelete();
extern int BSIM3ask();
extern int BSIM3mAsk();
extern int BSIM3convTest();
extern int BSIM3temp();
extern int BSIM3mParam();
extern void BSIM3mosCap();
extern int BSIM3param();
extern int BSIM3pzLoad();
extern int BSIM3setup();
extern int BSIM3trunc();
extern int BSIM3noise();
extern int BSIM3unsetup();
#endif /* stdc */

2
src/spicelib/devices/bsim3/bsim3init.c

@ -81,3 +81,5 @@ get_bsim3_info(void)
{
return &BSIM3info;
}

1
src/spicelib/devices/bsim3/bsim3itf.h

@ -1,7 +1,6 @@
/**********
Copyright 1999 Regents of the University of California. All rights reserved.
Author: 1991 JianHui Huang and Min-Chie Jeng.
Modified by Paolo Nenzi 2002
File: bsim3itf.h
**********/

Loading…
Cancel
Save