diff --git a/src/spicelib/devices/bsim3v2/.cvsignore b/src/spicelib/devices/bsim3v2/.cvsignore
deleted file mode 100644
index dc4caac80..000000000
--- a/src/spicelib/devices/bsim3v2/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile.in
-Makefile
-.deps
-.libs
-*.lo
-*.la
diff --git a/src/spicelib/devices/bsim3v2/ChangeLog b/src/spicelib/devices/bsim3v2/ChangeLog
deleted file mode 100644
index 097f34cde..000000000
--- a/src/spicelib/devices/bsim3v2/ChangeLog
+++ /dev/null
@@ -1,17 +0,0 @@
-2000-01-29 Paolo Nenzi
- * bsim3v2def.h : Added BSIM3V2owner to the BSIM3V2instance structure
- for compatibility with Cider. This spice uses a modificed version of
- devices, as desscribed in the CIDer package, for a "parallel"
- processing support.
-
- * b3v2{acld,cvtest,getic,ld,pzld,set,temp,trunc}.c:
- added the check if the current instance is a task of this
- processor. This is part of the "parallel" support of Cider.
-
-2000-01-16 Emmanuel Rouat
-
- * *.c : replaced all FABS macros by the 'fabs' function
-
- * *.c : had to rename structure bsim3SizeDependParam into
- BSIM3V2SizeDependParam for consistency
-
diff --git a/src/spicelib/devices/bsim3v2/Makefile.am b/src/spicelib/devices/bsim3v2/Makefile.am
deleted file mode 100644
index 7de6dd908..000000000
--- a/src/spicelib/devices/bsim3v2/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-noinst_LIBRARIES = libbsim3v2.a
-
-libbsim3v2_a_SOURCES = \
- b3v2.c \
- b3v2acld.c \
- b3v2ask.c \
- b3v2check.c \
- b3v2cvtest.c \
- b3v2del.c \
- b3v2dest.c \
- b3v2getic.c \
- b3v2ld.c \
- b3v2mask.c \
- b3v2mdel.c \
- b3v2mpar.c \
- b3v2noi.c \
- b3v2par.c \
- b3v2pzld.c \
- b3v2set.c \
- b3v2temp.c \
- b3v2trunc.c \
- bsim3v2def.h \
- bsim3v2ext.h \
- bsim3v2init.c \
- bsim3v2init.h \
- bsim3v2itf.h
-
-
-
-INCLUDES = -I$(top_srcdir)/src/include
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/spicelib/devices/bsim3v2/b3v2.c b/src/spicelib/devices/bsim3v2/b3v2.c
deleted file mode 100644
index df0b58565..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2.c
+++ /dev/null
@@ -1,477 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: b3v2.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "devdefs.h"
-#include "bsim3v2def.h"
-#include "suffix.h"
-
-IFparm BSIM3V2pTable[] = { /* parameters */
-IOP( "l", BSIM3V2_L, IF_REAL , "Length"),
-IOP( "w", BSIM3V2_W, IF_REAL , "Width"),
-IOP( "ad", BSIM3V2_AD, IF_REAL , "Drain area"),
-IOP( "as", BSIM3V2_AS, IF_REAL , "Source area"),
-IOP( "pd", BSIM3V2_PD, IF_REAL , "Drain perimeter"),
-IOP( "ps", BSIM3V2_PS, IF_REAL , "Source perimeter"),
-IOP( "nrd", BSIM3V2_NRD, IF_REAL , "Number of squares in drain"),
-IOP( "nrs", BSIM3V2_NRS, IF_REAL , "Number of squares in source"),
-IOP( "off", BSIM3V2_OFF, IF_FLAG , "Device is initially off"),
-IOP( "nqsmod", BSIM3V2_NQSMOD, IF_INTEGER, "Non-quasi-static model selector"),
-IP( "ic", BSIM3V2_IC, IF_REALVEC , "Vector of DS,GS,BS initial voltages"),
-OP( "gmbs", BSIM3V2_GMBS, IF_REAL, "Gmb"),
-OP( "gm", BSIM3V2_GM, IF_REAL, "Gm"),
-OP( "gds", BSIM3V2_GDS, IF_REAL, "Gds"),
-OP( "vdsat", BSIM3V2_VDSAT, IF_REAL, "Vdsat"),
-OP( "vth", BSIM3V2_VON, IF_REAL, "Vth"),
-OP( "id", BSIM3V2_CD, IF_REAL, "Ids"),
-OP( "vbs", BSIM3V2_VBS, IF_REAL, "Vbs"),
-OP( "vgs", BSIM3V2_VGS, IF_REAL, "Vgs"),
-OP( "vds", BSIM3V2_VDS, IF_REAL, "Vds"),
-};
-
-IFparm BSIM3V2mPTable[] = { /* model parameters */
-IOP( "capmod", BSIM3V2_MOD_CAPMOD, IF_INTEGER, "Capacitance model selector"),
-IOP( "mobmod", BSIM3V2_MOD_MOBMOD, IF_INTEGER, "Mobility model selector"),
-IOP( "noimod", BSIM3V2_MOD_NOIMOD, IF_INTEGER, "Noise model selector"),
-IOP( "paramchk", BSIM3V2_MOD_PARAMCHK, IF_INTEGER, "Model parameter checking selector"),
-IOP( "binunit", BSIM3V2_MOD_BINUNIT, IF_INTEGER, "Bin unit selector"),
-IOP( "version", BSIM3V2_MOD_VERSION, IF_REAL, " parameter for model version"),
-IOP( "tox", BSIM3V2_MOD_TOX, IF_REAL, "Gate oxide thickness in meters"),
-
-IOP( "toxm", BSIM3V2_MOD_TOXM, IF_REAL, "Gate oxide thickness used in extraction"),
-IOP( "cdsc", BSIM3V2_MOD_CDSC, IF_REAL, "Drain/Source and channel coupling capacitance"),
-IOP( "cdscb", BSIM3V2_MOD_CDSCB, IF_REAL, "Body-bias dependence of cdsc"),
-IOP( "cdscd", BSIM3V2_MOD_CDSCD, IF_REAL, "Drain-bias dependence of cdsc"),
-IOP( "cit", BSIM3V2_MOD_CIT, IF_REAL, "Interface state capacitance"),
-IOP( "nfactor", BSIM3V2_MOD_NFACTOR, IF_REAL, "Subthreshold swing Coefficient"),
-IOP( "xj", BSIM3V2_MOD_XJ, IF_REAL, "Junction depth in meters"),
-IOP( "vsat", BSIM3V2_MOD_VSAT, IF_REAL, "Saturation velocity at tnom"),
-IOP( "at", BSIM3V2_MOD_AT, IF_REAL, "Temperature coefficient of vsat"),
-IOP( "a0", BSIM3V2_MOD_A0, IF_REAL, "Non-uniform depletion width effect coefficient."),
-IOP( "ags", BSIM3V2_MOD_AGS, IF_REAL, "Gate bias coefficient of Abulk."),
-IOP( "a1", BSIM3V2_MOD_A1, IF_REAL, "Non-saturation effect coefficient"),
-IOP( "a2", BSIM3V2_MOD_A2, IF_REAL, "Non-saturation effect coefficient"),
-IOP( "keta", BSIM3V2_MOD_KETA, IF_REAL, "Body-bias coefficient of non-uniform depletion width effect."),
-IOP( "nsub", BSIM3V2_MOD_NSUB, IF_REAL, "Substrate doping concentration"),
-IOP( "nch", BSIM3V2_MOD_NPEAK, IF_REAL, "Channel doping concentration"),
-IOP( "ngate", BSIM3V2_MOD_NGATE, IF_REAL, "Poly-gate doping concentration"),
-IOP( "gamma1", BSIM3V2_MOD_GAMMA1, IF_REAL, "Vth body coefficient"),
-IOP( "gamma2", BSIM3V2_MOD_GAMMA2, IF_REAL, "Vth body coefficient"),
-IOP( "vbx", BSIM3V2_MOD_VBX, IF_REAL, "Vth transition body Voltage"),
-IOP( "vbm", BSIM3V2_MOD_VBM, IF_REAL, "Maximum body voltage"),
-
-IOP( "xt", BSIM3V2_MOD_XT, IF_REAL, "Doping depth"),
-IOP( "k1", BSIM3V2_MOD_K1, IF_REAL, "Bulk effect coefficient 1"),
-IOP( "kt1", BSIM3V2_MOD_KT1, IF_REAL, "Temperature coefficient of Vth"),
-IOP( "kt1l", BSIM3V2_MOD_KT1L, IF_REAL, "Temperature coefficient of Vth"),
-IOP( "kt2", BSIM3V2_MOD_KT2, IF_REAL, "Body-coefficient of kt1"),
-IOP( "k2", BSIM3V2_MOD_K2, IF_REAL, "Bulk effect coefficient 2"),
-IOP( "k3", BSIM3V2_MOD_K3, IF_REAL, "Narrow width effect coefficient"),
-IOP( "k3b", BSIM3V2_MOD_K3B, IF_REAL, "Body effect coefficient of k3"),
-IOP( "w0", BSIM3V2_MOD_W0, IF_REAL, "Narrow width effect parameter"),
-IOP( "nlx", BSIM3V2_MOD_NLX, IF_REAL, "Lateral non-uniform doping effect"),
-IOP( "dvt0", BSIM3V2_MOD_DVT0, IF_REAL, "Short channel effect coeff. 0"),
-IOP( "dvt1", BSIM3V2_MOD_DVT1, IF_REAL, "Short channel effect coeff. 1"),
-IOP( "dvt2", BSIM3V2_MOD_DVT2, IF_REAL, "Short channel effect coeff. 2"),
-IOP( "dvt0w", BSIM3V2_MOD_DVT0W, IF_REAL, "Narrow Width coeff. 0"),
-IOP( "dvt1w", BSIM3V2_MOD_DVT1W, IF_REAL, "Narrow Width effect coeff. 1"),
-IOP( "dvt2w", BSIM3V2_MOD_DVT2W, IF_REAL, "Narrow Width effect coeff. 2"),
-IOP( "drout", BSIM3V2_MOD_DROUT, IF_REAL, "DIBL coefficient of output resistance"),
-IOP( "dsub", BSIM3V2_MOD_DSUB, IF_REAL, "DIBL coefficient in the subthreshold region"),
-IOP( "vth0", BSIM3V2_MOD_VTH0, IF_REAL,"Threshold voltage"),
-IOP( "vtho", BSIM3V2_MOD_VTH0, IF_REAL,"Threshold voltage"),
-IOP( "ua", BSIM3V2_MOD_UA, IF_REAL, "Linear gate dependence of mobility"),
-IOP( "ua1", BSIM3V2_MOD_UA1, IF_REAL, "Temperature coefficient of ua"),
-IOP( "ub", BSIM3V2_MOD_UB, IF_REAL, "Quadratic gate dependence of mobility"),
-IOP( "ub1", BSIM3V2_MOD_UB1, IF_REAL, "Temperature coefficient of ub"),
-IOP( "uc", BSIM3V2_MOD_UC, IF_REAL, "Body-bias dependence of mobility"),
-IOP( "uc1", BSIM3V2_MOD_UC1, IF_REAL, "Temperature coefficient of uc"),
-IOP( "u0", BSIM3V2_MOD_U0, IF_REAL, "Low-field mobility at Tnom"),
-IOP( "ute", BSIM3V2_MOD_UTE, IF_REAL, "Temperature coefficient of mobility"),
-IOP( "voff", BSIM3V2_MOD_VOFF, IF_REAL, "Threshold voltage offset"),
-IOP( "tnom", BSIM3V2_MOD_TNOM, IF_REAL, "Parameter measurement temperature"),
-IOP( "cgso", BSIM3V2_MOD_CGSO, IF_REAL, "Gate-source overlap capacitance per width"),
-IOP( "cgdo", BSIM3V2_MOD_CGDO, IF_REAL, "Gate-drain overlap capacitance per width"),
-IOP( "cgbo", BSIM3V2_MOD_CGBO, IF_REAL, "Gate-bulk overlap capacitance per length"),
-IOP( "xpart", BSIM3V2_MOD_XPART, IF_REAL, "Channel charge partitioning"),
-IOP( "elm", BSIM3V2_MOD_ELM, IF_REAL, "Non-quasi-static Elmore Constant Parameter"),
-IOP( "delta", BSIM3V2_MOD_DELTA, IF_REAL, "Effective Vds parameter"),
-IOP( "rsh", BSIM3V2_MOD_RSH, IF_REAL, "Source-drain sheet resistance"),
-IOP( "rdsw", BSIM3V2_MOD_RDSW, IF_REAL, "Source-drain resistance per width"),
-
-IOP( "prwg", BSIM3V2_MOD_PRWG, IF_REAL, "Gate-bias effect on parasitic resistance "),
-IOP( "prwb", BSIM3V2_MOD_PRWB, IF_REAL, "Body-effect on parasitic resistance "),
-
-IOP( "prt", BSIM3V2_MOD_PRT, IF_REAL, "Temperature coefficient of parasitic resistance "),
-IOP( "eta0", BSIM3V2_MOD_ETA0, IF_REAL, "Subthreshold region DIBL coefficient"),
-IOP( "etab", BSIM3V2_MOD_ETAB, IF_REAL, "Subthreshold region DIBL coefficient"),
-IOP( "pclm", BSIM3V2_MOD_PCLM, IF_REAL, "Channel length modulation Coefficient"),
-IOP( "pdiblc1", BSIM3V2_MOD_PDIBL1, IF_REAL, "Drain-induced barrier lowering coefficient"),
-IOP( "pdiblc2", BSIM3V2_MOD_PDIBL2, IF_REAL, "Drain-induced barrier lowering coefficient"),
-IOP( "pdiblcb", BSIM3V2_MOD_PDIBLB, IF_REAL, "Body-effect on drain-induced barrier lowering"),
-IOP( "pscbe1", BSIM3V2_MOD_PSCBE1, IF_REAL, "Substrate current body-effect coefficient"),
-IOP( "pscbe2", BSIM3V2_MOD_PSCBE2, IF_REAL, "Substrate current body-effect coefficient"),
-IOP( "pvag", BSIM3V2_MOD_PVAG, IF_REAL, "Gate dependence of output resistance parameter"),
-IOP( "js", BSIM3V2_MOD_JS, IF_REAL, "Source/drain junction reverse saturation current density"),
-IOP( "jsw", BSIM3V2_MOD_JSW, IF_REAL, "Sidewall junction reverse saturation current density"),
-IOP( "pb", BSIM3V2_MOD_PB, IF_REAL, "Source/drain junction built-in potential"),
-IOP( "nj", BSIM3V2_MOD_NJ, IF_REAL, "Source/drain junction emission coefficient"),
-IOP( "xti", BSIM3V2_MOD_XTI, IF_REAL, "Junction current temperature exponent"),
-IOP( "mj", BSIM3V2_MOD_MJ, IF_REAL, "Source/drain bottom junction capacitance grading coefficient"),
-IOP( "pbsw", BSIM3V2_MOD_PBSW, IF_REAL, "Source/drain sidewall junction capacitance built in potential"),
-IOP( "mjsw", BSIM3V2_MOD_MJSW, IF_REAL, "Source/drain sidewall junction capacitance grading coefficient"),
-IOP( "pbswg", BSIM3V2_MOD_PBSWG, IF_REAL, "Source/drain (gate side) sidewall junction capacitance built in potential"),
-IOP( "mjswg", BSIM3V2_MOD_MJSWG, IF_REAL, "Source/drain (gate side) sidewall junction capacitance grading coefficient"),
-IOP( "cj", BSIM3V2_MOD_CJ, IF_REAL, "Source/drain bottom junction capacitance per unit area"),
-IOP( "vfbcv", BSIM3V2_MOD_VFBCV, IF_REAL, "Flat Band Voltage parameter for capmod=0 only"),
-IOP( "vfb", BSIM3V2_MOD_VFB, IF_REAL, "Flat Band Voltage"),
-IOP( "cjsw", BSIM3V2_MOD_CJSW, IF_REAL, "Source/drain sidewall junction capacitance per unit periphery"),
-IOP( "cjswg", BSIM3V2_MOD_CJSWG, IF_REAL, "Source/drain (gate side) sidewall junction capacitance per unit width"),
-IOP( "tpb", BSIM3V2_MOD_TPB, IF_REAL, "Temperature coefficient of pb"),
-IOP( "tcj", BSIM3V2_MOD_TCJ, IF_REAL, "Temperature coefficient of cj"),
-IOP( "tpbsw", BSIM3V2_MOD_TPBSW, IF_REAL, "Temperature coefficient of pbsw"),
-IOP( "tcjsw", BSIM3V2_MOD_TCJSW, IF_REAL, "Temperature coefficient of cjsw"),
-IOP( "tpbswg", BSIM3V2_MOD_TPBSWG, IF_REAL, "Temperature coefficient of pbswg"),
-IOP( "tcjswg", BSIM3V2_MOD_TCJSWG, IF_REAL, "Temperature coefficient of cjswg"),
-IOP( "acde", BSIM3V2_MOD_ACDE, IF_REAL, "Exponential coefficient for finite charge thickness"),
-IOP( "moin", BSIM3V2_MOD_MOIN, IF_REAL, "Coefficient for gate-bias dependent surface potential"),
-IOP( "noff", BSIM3V2_MOD_NOFF, IF_REAL, "C-V turn-on/off parameter"),
-IOP( "voffcv", BSIM3V2_MOD_VOFFCV, IF_REAL, "C-V lateral-shift parameter"),
-IOP( "lint", BSIM3V2_MOD_LINT, IF_REAL, "Length reduction parameter"),
-IOP( "ll", BSIM3V2_MOD_LL, IF_REAL, "Length reduction parameter"),
-IOP( "llc", BSIM3V2_MOD_LLC, IF_REAL, "Length reduction parameter for CV"),
-IOP( "lln", BSIM3V2_MOD_LLN, IF_REAL, "Length reduction parameter"),
-IOP( "lw", BSIM3V2_MOD_LW, IF_REAL, "Length reduction parameter"),
-IOP( "lwc", BSIM3V2_MOD_LWC, IF_REAL, "Length reduction parameter for CV"),
-IOP( "lwn", BSIM3V2_MOD_LWN, IF_REAL, "Length reduction parameter"),
-IOP( "lwl", BSIM3V2_MOD_LWL, IF_REAL, "Length reduction parameter"),
-IOP( "lwlc", BSIM3V2_MOD_LWLC, IF_REAL, "Length reduction parameter for CV"),
-IOP( "lmin", BSIM3V2_MOD_LMIN, IF_REAL, "Minimum length for the model"),
-IOP( "lmax", BSIM3V2_MOD_LMAX, IF_REAL, "Maximum length for the model"),
-
-IOP( "wr", BSIM3V2_MOD_WR, IF_REAL, "Width dependence of rds"),
-IOP( "wint", BSIM3V2_MOD_WINT, IF_REAL, "Width reduction parameter"),
-IOP( "dwg", BSIM3V2_MOD_DWG, IF_REAL, "Width reduction parameter"),
-IOP( "dwb", BSIM3V2_MOD_DWB, IF_REAL, "Width reduction parameter"),
-
-IOP( "wl", BSIM3V2_MOD_WL, IF_REAL, "Width reduction parameter"),
-IOP( "wlc", BSIM3V2_MOD_WLC, IF_REAL, "Width reduction parameter for CV"),
-IOP( "wln", BSIM3V2_MOD_WLN, IF_REAL, "Width reduction parameter"),
-IOP( "ww", BSIM3V2_MOD_WW, IF_REAL, "Width reduction parameter"),
-IOP( "wwc", BSIM3V2_MOD_WWC, IF_REAL, "Width reduction parameter for CV"),
-IOP( "wwn", BSIM3V2_MOD_WWN, IF_REAL, "Width reduction parameter"),
-IOP( "wwl", BSIM3V2_MOD_WWL, IF_REAL, "Width reduction parameter"),
-IOP( "wwlc", BSIM3V2_MOD_WWLC, IF_REAL, "Width reduction parameter for CV"),
-IOP( "wmin", BSIM3V2_MOD_WMIN, IF_REAL, "Minimum width for the model"),
-IOP( "wmax", BSIM3V2_MOD_WMAX, IF_REAL, "Maximum width for the model"),
-
-IOP( "b0", BSIM3V2_MOD_B0, IF_REAL, "Abulk narrow width parameter"),
-IOP( "b1", BSIM3V2_MOD_B1, IF_REAL, "Abulk narrow width parameter"),
-
-IOP( "cgsl", BSIM3V2_MOD_CGSL, IF_REAL, "New C-V model parameter"),
-IOP( "cgdl", BSIM3V2_MOD_CGDL, IF_REAL, "New C-V model parameter"),
-IOP( "ckappa", BSIM3V2_MOD_CKAPPA, IF_REAL, "New C-V model parameter"),
-IOP( "cf", BSIM3V2_MOD_CF, IF_REAL, "Fringe capacitance parameter"),
-IOP( "clc", BSIM3V2_MOD_CLC, IF_REAL, "Vdsat parameter for C-V model"),
-IOP( "cle", BSIM3V2_MOD_CLE, IF_REAL, "Vdsat parameter for C-V model"),
-IOP( "dwc", BSIM3V2_MOD_DWC, IF_REAL, "Delta W for C-V model"),
-IOP( "dlc", BSIM3V2_MOD_DLC, IF_REAL, "Delta L for C-V model"),
-
-IOP( "alpha0", BSIM3V2_MOD_ALPHA0, IF_REAL, "substrate current model parameter"),
-IOP( "alpha1", BSIM3V2_MOD_ALPHA1, IF_REAL, "substrate current model parameter"),
-IOP( "beta0", BSIM3V2_MOD_BETA0, IF_REAL, "substrate current model parameter"),
-IOP( "ijth", BSIM3V2_MOD_IJTH, IF_REAL, "Diode limiting current"),
-
-IOP( "lcdsc", BSIM3V2_MOD_LCDSC, IF_REAL, "Length dependence of cdsc"),
-IOP( "lcdscb", BSIM3V2_MOD_LCDSCB, IF_REAL, "Length dependence of cdscb"),
-IOP( "lcdscd", BSIM3V2_MOD_LCDSCD, IF_REAL, "Length dependence of cdscd"),
-IOP( "lcit", BSIM3V2_MOD_LCIT, IF_REAL, "Length dependence of cit"),
-IOP( "lnfactor", BSIM3V2_MOD_LNFACTOR, IF_REAL, "Length dependence of nfactor"),
-IOP( "lxj", BSIM3V2_MOD_LXJ, IF_REAL, "Length dependence of xj"),
-IOP( "lvsat", BSIM3V2_MOD_LVSAT, IF_REAL, "Length dependence of vsat"),
-IOP( "lat", BSIM3V2_MOD_LAT, IF_REAL, "Length dependence of at"),
-IOP( "la0", BSIM3V2_MOD_LA0, IF_REAL, "Length dependence of a0"),
-IOP( "lags", BSIM3V2_MOD_LAGS, IF_REAL, "Length dependence of ags"),
-IOP( "la1", BSIM3V2_MOD_LA1, IF_REAL, "Length dependence of a1"),
-IOP( "la2", BSIM3V2_MOD_LA2, IF_REAL, "Length dependence of a2"),
-IOP( "lketa", BSIM3V2_MOD_LKETA, IF_REAL, "Length dependence of keta"),
-IOP( "lnsub", BSIM3V2_MOD_LNSUB, IF_REAL, "Length dependence of nsub"),
-IOP( "lnch", BSIM3V2_MOD_LNPEAK, IF_REAL, "Length dependence of nch"),
-IOP( "lngate", BSIM3V2_MOD_LNGATE, IF_REAL, "Length dependence of ngate"),
-IOP( "lgamma1", BSIM3V2_MOD_LGAMMA1, IF_REAL, "Length dependence of gamma1"),
-IOP( "lgamma2", BSIM3V2_MOD_LGAMMA2, IF_REAL, "Length dependence of gamma2"),
-IOP( "lvbx", BSIM3V2_MOD_LVBX, IF_REAL, "Length dependence of vbx"),
-IOP( "lvbm", BSIM3V2_MOD_LVBM, IF_REAL, "Length dependence of vbm"),
-IOP( "lxt", BSIM3V2_MOD_LXT, IF_REAL, "Length dependence of xt"),
-IOP( "lk1", BSIM3V2_MOD_LK1, IF_REAL, "Length dependence of k1"),
-IOP( "lkt1", BSIM3V2_MOD_LKT1, IF_REAL, "Length dependence of kt1"),
-IOP( "lkt1l", BSIM3V2_MOD_LKT1L, IF_REAL, "Length dependence of kt1l"),
-IOP( "lkt2", BSIM3V2_MOD_LKT2, IF_REAL, "Length dependence of kt2"),
-IOP( "lk2", BSIM3V2_MOD_LK2, IF_REAL, "Length dependence of k2"),
-IOP( "lk3", BSIM3V2_MOD_LK3, IF_REAL, "Length dependence of k3"),
-IOP( "lk3b", BSIM3V2_MOD_LK3B, IF_REAL, "Length dependence of k3b"),
-IOP( "lw0", BSIM3V2_MOD_LW0, IF_REAL, "Length dependence of w0"),
-IOP( "lnlx", BSIM3V2_MOD_LNLX, IF_REAL, "Length dependence of nlx"),
-IOP( "ldvt0", BSIM3V2_MOD_LDVT0, IF_REAL, "Length dependence of dvt0"),
-IOP( "ldvt1", BSIM3V2_MOD_LDVT1, IF_REAL, "Length dependence of dvt1"),
-IOP( "ldvt2", BSIM3V2_MOD_LDVT2, IF_REAL, "Length dependence of dvt2"),
-IOP( "ldvt0w", BSIM3V2_MOD_LDVT0W, IF_REAL, "Length dependence of dvt0w"),
-IOP( "ldvt1w", BSIM3V2_MOD_LDVT1W, IF_REAL, "Length dependence of dvt1w"),
-IOP( "ldvt2w", BSIM3V2_MOD_LDVT2W, IF_REAL, "Length dependence of dvt2w"),
-IOP( "ldrout", BSIM3V2_MOD_LDROUT, IF_REAL, "Length dependence of drout"),
-IOP( "ldsub", BSIM3V2_MOD_LDSUB, IF_REAL, "Length dependence of dsub"),
-IOP( "lvth0", BSIM3V2_MOD_LVTH0, IF_REAL,"Length dependence of vto"),
-IOP( "lvtho", BSIM3V2_MOD_LVTH0, IF_REAL,"Length dependence of vto"),
-IOP( "lua", BSIM3V2_MOD_LUA, IF_REAL, "Length dependence of ua"),
-IOP( "lua1", BSIM3V2_MOD_LUA1, IF_REAL, "Length dependence of ua1"),
-IOP( "lub", BSIM3V2_MOD_LUB, IF_REAL, "Length dependence of ub"),
-IOP( "lub1", BSIM3V2_MOD_LUB1, IF_REAL, "Length dependence of ub1"),
-IOP( "luc", BSIM3V2_MOD_LUC, IF_REAL, "Length dependence of uc"),
-IOP( "luc1", BSIM3V2_MOD_LUC1, IF_REAL, "Length dependence of uc1"),
-IOP( "lu0", BSIM3V2_MOD_LU0, IF_REAL, "Length dependence of u0"),
-IOP( "lute", BSIM3V2_MOD_LUTE, IF_REAL, "Length dependence of ute"),
-IOP( "lvoff", BSIM3V2_MOD_LVOFF, IF_REAL, "Length dependence of voff"),
-IOP( "lelm", BSIM3V2_MOD_LELM, IF_REAL, "Length dependence of elm"),
-IOP( "ldelta", BSIM3V2_MOD_LDELTA, IF_REAL, "Length dependence of delta"),
-IOP( "lrdsw", BSIM3V2_MOD_LRDSW, IF_REAL, "Length dependence of rdsw "),
-
-IOP( "lprwg", BSIM3V2_MOD_LPRWG, IF_REAL, "Length dependence of prwg "),
-IOP( "lprwb", BSIM3V2_MOD_LPRWB, IF_REAL, "Length dependence of prwb "),
-
-IOP( "lprt", BSIM3V2_MOD_LPRT, IF_REAL, "Length dependence of prt "),
-IOP( "leta0", BSIM3V2_MOD_LETA0, IF_REAL, "Length dependence of eta0"),
-IOP( "letab", BSIM3V2_MOD_LETAB, IF_REAL, "Length dependence of etab"),
-IOP( "lpclm", BSIM3V2_MOD_LPCLM, IF_REAL, "Length dependence of pclm"),
-IOP( "lpdiblc1", BSIM3V2_MOD_LPDIBL1, IF_REAL, "Length dependence of pdiblc1"),
-IOP( "lpdiblc2", BSIM3V2_MOD_LPDIBL2, IF_REAL, "Length dependence of pdiblc2"),
-IOP( "lpdiblcb", BSIM3V2_MOD_LPDIBLB, IF_REAL, "Length dependence of pdiblcb"),
-IOP( "lpscbe1", BSIM3V2_MOD_LPSCBE1, IF_REAL, "Length dependence of pscbe1"),
-IOP( "lpscbe2", BSIM3V2_MOD_LPSCBE2, IF_REAL, "Length dependence of pscbe2"),
-IOP( "lpvag", BSIM3V2_MOD_LPVAG, IF_REAL, "Length dependence of pvag"),
-IOP( "lwr", BSIM3V2_MOD_LWR, IF_REAL, "Length dependence of wr"),
-IOP( "ldwg", BSIM3V2_MOD_LDWG, IF_REAL, "Length dependence of dwg"),
-IOP( "ldwb", BSIM3V2_MOD_LDWB, IF_REAL, "Length dependence of dwb"),
-IOP( "lb0", BSIM3V2_MOD_LB0, IF_REAL, "Length dependence of b0"),
-IOP( "lb1", BSIM3V2_MOD_LB1, IF_REAL, "Length dependence of b1"),
-IOP( "lcgsl", BSIM3V2_MOD_LCGSL, IF_REAL, "Length dependence of cgsl"),
-IOP( "lcgdl", BSIM3V2_MOD_LCGDL, IF_REAL, "Length dependence of cgdl"),
-IOP( "lckappa", BSIM3V2_MOD_LCKAPPA, IF_REAL, "Length dependence of ckappa"),
-IOP( "lcf", BSIM3V2_MOD_LCF, IF_REAL, "Length dependence of cf"),
-IOP( "lclc", BSIM3V2_MOD_LCLC, IF_REAL, "Length dependence of clc"),
-IOP( "lcle", BSIM3V2_MOD_LCLE, IF_REAL, "Length dependence of cle"),
-IOP( "lalpha0", BSIM3V2_MOD_LALPHA0, IF_REAL, "Length dependence of alpha0"),
-IOP( "lalpha1", BSIM3V2_MOD_LALPHA1, IF_REAL, "Length dependence of alpha1"),
-IOP( "lbeta0", BSIM3V2_MOD_LBETA0, IF_REAL, "Length dependence of beta0"),
-IOP( "lvfbcv", BSIM3V2_MOD_LVFBCV, IF_REAL, "Length dependence of vfbcv"),
-IOP( "lvfb", BSIM3V2_MOD_LVFB, IF_REAL, "Length dependence of vfb"),
-IOP( "lacde", BSIM3V2_MOD_LACDE, IF_REAL, "Length dependence of acde"),
-IOP( "lmoin", BSIM3V2_MOD_LMOIN, IF_REAL, "Length dependence of moin"),
-IOP( "lnoff", BSIM3V2_MOD_LNOFF, IF_REAL, "Length dependence of noff"),
-IOP( "lvoffcv", BSIM3V2_MOD_LVOFFCV, IF_REAL, "Length dependence of voffcv"),
-IOP( "wcdsc", BSIM3V2_MOD_WCDSC, IF_REAL, "Width dependence of cdsc"),
-IOP( "wcdscb", BSIM3V2_MOD_WCDSCB, IF_REAL, "Width dependence of cdscb"),
-IOP( "wcdscd", BSIM3V2_MOD_WCDSCD, IF_REAL, "Width dependence of cdscd"),
-IOP( "wcit", BSIM3V2_MOD_WCIT, IF_REAL, "Width dependence of cit"),
-IOP( "wnfactor", BSIM3V2_MOD_WNFACTOR, IF_REAL, "Width dependence of nfactor"),
-IOP( "wxj", BSIM3V2_MOD_WXJ, IF_REAL, "Width dependence of xj"),
-IOP( "wvsat", BSIM3V2_MOD_WVSAT, IF_REAL, "Width dependence of vsat"),
-IOP( "wat", BSIM3V2_MOD_WAT, IF_REAL, "Width dependence of at"),
-IOP( "wa0", BSIM3V2_MOD_WA0, IF_REAL, "Width dependence of a0"),
-IOP( "wags", BSIM3V2_MOD_WAGS, IF_REAL, "Width dependence of ags"),
-IOP( "wa1", BSIM3V2_MOD_WA1, IF_REAL, "Width dependence of a1"),
-IOP( "wa2", BSIM3V2_MOD_WA2, IF_REAL, "Width dependence of a2"),
-IOP( "wketa", BSIM3V2_MOD_WKETA, IF_REAL, "Width dependence of keta"),
-IOP( "wnsub", BSIM3V2_MOD_WNSUB, IF_REAL, "Width dependence of nsub"),
-IOP( "wnch", BSIM3V2_MOD_WNPEAK, IF_REAL, "Width dependence of nch"),
-IOP( "wngate", BSIM3V2_MOD_WNGATE, IF_REAL, "Width dependence of ngate"),
-IOP( "wgamma1", BSIM3V2_MOD_WGAMMA1, IF_REAL, "Width dependence of gamma1"),
-IOP( "wgamma2", BSIM3V2_MOD_WGAMMA2, IF_REAL, "Width dependence of gamma2"),
-IOP( "wvbx", BSIM3V2_MOD_WVBX, IF_REAL, "Width dependence of vbx"),
-IOP( "wvbm", BSIM3V2_MOD_WVBM, IF_REAL, "Width dependence of vbm"),
-IOP( "wxt", BSIM3V2_MOD_WXT, IF_REAL, "Width dependence of xt"),
-IOP( "wk1", BSIM3V2_MOD_WK1, IF_REAL, "Width dependence of k1"),
-IOP( "wkt1", BSIM3V2_MOD_WKT1, IF_REAL, "Width dependence of kt1"),
-IOP( "wkt1l", BSIM3V2_MOD_WKT1L, IF_REAL, "Width dependence of kt1l"),
-IOP( "wkt2", BSIM3V2_MOD_WKT2, IF_REAL, "Width dependence of kt2"),
-IOP( "wk2", BSIM3V2_MOD_WK2, IF_REAL, "Width dependence of k2"),
-IOP( "wk3", BSIM3V2_MOD_WK3, IF_REAL, "Width dependence of k3"),
-IOP( "wk3b", BSIM3V2_MOD_WK3B, IF_REAL, "Width dependence of k3b"),
-IOP( "ww0", BSIM3V2_MOD_WW0, IF_REAL, "Width dependence of w0"),
-IOP( "wnlx", BSIM3V2_MOD_WNLX, IF_REAL, "Width dependence of nlx"),
-IOP( "wdvt0", BSIM3V2_MOD_WDVT0, IF_REAL, "Width dependence of dvt0"),
-IOP( "wdvt1", BSIM3V2_MOD_WDVT1, IF_REAL, "Width dependence of dvt1"),
-IOP( "wdvt2", BSIM3V2_MOD_WDVT2, IF_REAL, "Width dependence of dvt2"),
-IOP( "wdvt0w", BSIM3V2_MOD_WDVT0W, IF_REAL, "Width dependence of dvt0w"),
-IOP( "wdvt1w", BSIM3V2_MOD_WDVT1W, IF_REAL, "Width dependence of dvt1w"),
-IOP( "wdvt2w", BSIM3V2_MOD_WDVT2W, IF_REAL, "Width dependence of dvt2w"),
-IOP( "wdrout", BSIM3V2_MOD_WDROUT, IF_REAL, "Width dependence of drout"),
-IOP( "wdsub", BSIM3V2_MOD_WDSUB, IF_REAL, "Width dependence of dsub"),
-IOP( "wvth0", BSIM3V2_MOD_WVTH0, IF_REAL,"Width dependence of vto"),
-IOP( "wvtho", BSIM3V2_MOD_WVTH0, IF_REAL,"Width dependence of vto"),
-IOP( "wua", BSIM3V2_MOD_WUA, IF_REAL, "Width dependence of ua"),
-IOP( "wua1", BSIM3V2_MOD_WUA1, IF_REAL, "Width dependence of ua1"),
-IOP( "wub", BSIM3V2_MOD_WUB, IF_REAL, "Width dependence of ub"),
-IOP( "wub1", BSIM3V2_MOD_WUB1, IF_REAL, "Width dependence of ub1"),
-IOP( "wuc", BSIM3V2_MOD_WUC, IF_REAL, "Width dependence of uc"),
-IOP( "wuc1", BSIM3V2_MOD_WUC1, IF_REAL, "Width dependence of uc1"),
-IOP( "wu0", BSIM3V2_MOD_WU0, IF_REAL, "Width dependence of u0"),
-IOP( "wute", BSIM3V2_MOD_WUTE, IF_REAL, "Width dependence of ute"),
-IOP( "wvoff", BSIM3V2_MOD_WVOFF, IF_REAL, "Width dependence of voff"),
-IOP( "welm", BSIM3V2_MOD_WELM, IF_REAL, "Width dependence of elm"),
-IOP( "wdelta", BSIM3V2_MOD_WDELTA, IF_REAL, "Width dependence of delta"),
-IOP( "wrdsw", BSIM3V2_MOD_WRDSW, IF_REAL, "Width dependence of rdsw "),
-
-IOP( "wprwg", BSIM3V2_MOD_WPRWG, IF_REAL, "Width dependence of prwg "),
-IOP( "wprwb", BSIM3V2_MOD_WPRWB, IF_REAL, "Width dependence of prwb "),
-
-IOP( "wprt", BSIM3V2_MOD_WPRT, IF_REAL, "Width dependence of prt"),
-IOP( "weta0", BSIM3V2_MOD_WETA0, IF_REAL, "Width dependence of eta0"),
-IOP( "wetab", BSIM3V2_MOD_WETAB, IF_REAL, "Width dependence of etab"),
-IOP( "wpclm", BSIM3V2_MOD_WPCLM, IF_REAL, "Width dependence of pclm"),
-IOP( "wpdiblc1", BSIM3V2_MOD_WPDIBL1, IF_REAL, "Width dependence of pdiblc1"),
-IOP( "wpdiblc2", BSIM3V2_MOD_WPDIBL2, IF_REAL, "Width dependence of pdiblc2"),
-IOP( "wpdiblcb", BSIM3V2_MOD_WPDIBLB, IF_REAL, "Width dependence of pdiblcb"),
-IOP( "wpscbe1", BSIM3V2_MOD_WPSCBE1, IF_REAL, "Width dependence of pscbe1"),
-IOP( "wpscbe2", BSIM3V2_MOD_WPSCBE2, IF_REAL, "Width dependence of pscbe2"),
-IOP( "wpvag", BSIM3V2_MOD_WPVAG, IF_REAL, "Width dependence of pvag"),
-IOP( "wwr", BSIM3V2_MOD_WWR, IF_REAL, "Width dependence of wr"),
-IOP( "wdwg", BSIM3V2_MOD_WDWG, IF_REAL, "Width dependence of dwg"),
-IOP( "wdwb", BSIM3V2_MOD_WDWB, IF_REAL, "Width dependence of dwb"),
-IOP( "wb0", BSIM3V2_MOD_WB0, IF_REAL, "Width dependence of b0"),
-IOP( "wb1", BSIM3V2_MOD_WB1, IF_REAL, "Width dependence of b1"),
-IOP( "wcgsl", BSIM3V2_MOD_WCGSL, IF_REAL, "Width dependence of cgsl"),
-IOP( "wcgdl", BSIM3V2_MOD_WCGDL, IF_REAL, "Width dependence of cgdl"),
-IOP( "wckappa", BSIM3V2_MOD_WCKAPPA, IF_REAL, "Width dependence of ckappa"),
-IOP( "wcf", BSIM3V2_MOD_WCF, IF_REAL, "Width dependence of cf"),
-IOP( "wclc", BSIM3V2_MOD_WCLC, IF_REAL, "Width dependence of clc"),
-IOP( "wcle", BSIM3V2_MOD_WCLE, IF_REAL, "Width dependence of cle"),
-IOP( "walpha0", BSIM3V2_MOD_WALPHA0, IF_REAL, "Width dependence of alpha0"),
-IOP( "walpha1", BSIM3V2_MOD_WALPHA1, IF_REAL, "Width dependence of alpha1"),
-IOP( "wbeta0", BSIM3V2_MOD_WBETA0, IF_REAL, "Width dependence of beta0"),
-IOP( "wvfbcv", BSIM3V2_MOD_WVFBCV, IF_REAL, "Width dependence of vfbcv"),
-IOP( "wvfb", BSIM3V2_MOD_WVFB, IF_REAL, "Width dependence of vfb"),
-IOP( "wacde", BSIM3V2_MOD_WACDE, IF_REAL, "Width dependence of acde"),
-IOP( "wmoin", BSIM3V2_MOD_WMOIN, IF_REAL, "Width dependence of moin"),
-IOP( "wnoff", BSIM3V2_MOD_WNOFF, IF_REAL, "Width dependence of noff"),
-IOP( "wvoffcv", BSIM3V2_MOD_WVOFFCV, IF_REAL, "Width dependence of voffcv"),
-
-IOP( "pcdsc", BSIM3V2_MOD_PCDSC, IF_REAL, "Cross-term dependence of cdsc"),
-IOP( "pcdscb", BSIM3V2_MOD_PCDSCB, IF_REAL, "Cross-term dependence of cdscb"),
-IOP( "pcdscd", BSIM3V2_MOD_PCDSCD, IF_REAL, "Cross-term dependence of cdscd"),
-IOP( "pcit", BSIM3V2_MOD_PCIT, IF_REAL, "Cross-term dependence of cit"),
-IOP( "pnfactor", BSIM3V2_MOD_PNFACTOR, IF_REAL, "Cross-term dependence of nfactor"),
-IOP( "pxj", BSIM3V2_MOD_PXJ, IF_REAL, "Cross-term dependence of xj"),
-IOP( "pvsat", BSIM3V2_MOD_PVSAT, IF_REAL, "Cross-term dependence of vsat"),
-IOP( "pat", BSIM3V2_MOD_PAT, IF_REAL, "Cross-term dependence of at"),
-IOP( "pa0", BSIM3V2_MOD_PA0, IF_REAL, "Cross-term dependence of a0"),
-IOP( "pags", BSIM3V2_MOD_PAGS, IF_REAL, "Cross-term dependence of ags"),
-IOP( "pa1", BSIM3V2_MOD_PA1, IF_REAL, "Cross-term dependence of a1"),
-IOP( "pa2", BSIM3V2_MOD_PA2, IF_REAL, "Cross-term dependence of a2"),
-IOP( "pketa", BSIM3V2_MOD_PKETA, IF_REAL, "Cross-term dependence of keta"),
-IOP( "pnsub", BSIM3V2_MOD_PNSUB, IF_REAL, "Cross-term dependence of nsub"),
-IOP( "pnch", BSIM3V2_MOD_PNPEAK, IF_REAL, "Cross-term dependence of nch"),
-IOP( "pngate", BSIM3V2_MOD_PNGATE, IF_REAL, "Cross-term dependence of ngate"),
-IOP( "pgamma1", BSIM3V2_MOD_PGAMMA1, IF_REAL, "Cross-term dependence of gamma1"),
-IOP( "pgamma2", BSIM3V2_MOD_PGAMMA2, IF_REAL, "Cross-term dependence of gamma2"),
-IOP( "pvbx", BSIM3V2_MOD_PVBX, IF_REAL, "Cross-term dependence of vbx"),
-IOP( "pvbm", BSIM3V2_MOD_PVBM, IF_REAL, "Cross-term dependence of vbm"),
-IOP( "pxt", BSIM3V2_MOD_PXT, IF_REAL, "Cross-term dependence of xt"),
-IOP( "pk1", BSIM3V2_MOD_PK1, IF_REAL, "Cross-term dependence of k1"),
-IOP( "pkt1", BSIM3V2_MOD_PKT1, IF_REAL, "Cross-term dependence of kt1"),
-IOP( "pkt1l", BSIM3V2_MOD_PKT1L, IF_REAL, "Cross-term dependence of kt1l"),
-IOP( "pkt2", BSIM3V2_MOD_PKT2, IF_REAL, "Cross-term dependence of kt2"),
-IOP( "pk2", BSIM3V2_MOD_PK2, IF_REAL, "Cross-term dependence of k2"),
-IOP( "pk3", BSIM3V2_MOD_PK3, IF_REAL, "Cross-term dependence of k3"),
-IOP( "pk3b", BSIM3V2_MOD_PK3B, IF_REAL, "Cross-term dependence of k3b"),
-IOP( "pw0", BSIM3V2_MOD_PW0, IF_REAL, "Cross-term dependence of w0"),
-IOP( "pnlx", BSIM3V2_MOD_PNLX, IF_REAL, "Cross-term dependence of nlx"),
-IOP( "pdvt0", BSIM3V2_MOD_PDVT0, IF_REAL, "Cross-term dependence of dvt0"),
-IOP( "pdvt1", BSIM3V2_MOD_PDVT1, IF_REAL, "Cross-term dependence of dvt1"),
-IOP( "pdvt2", BSIM3V2_MOD_PDVT2, IF_REAL, "Cross-term dependence of dvt2"),
-IOP( "pdvt0w", BSIM3V2_MOD_PDVT0W, IF_REAL, "Cross-term dependence of dvt0w"),
-IOP( "pdvt1w", BSIM3V2_MOD_PDVT1W, IF_REAL, "Cross-term dependence of dvt1w"),
-IOP( "pdvt2w", BSIM3V2_MOD_PDVT2W, IF_REAL, "Cross-term dependence of dvt2w"),
-IOP( "pdrout", BSIM3V2_MOD_PDROUT, IF_REAL, "Cross-term dependence of drout"),
-IOP( "pdsub", BSIM3V2_MOD_PDSUB, IF_REAL, "Cross-term dependence of dsub"),
-IOP( "pvth0", BSIM3V2_MOD_PVTH0, IF_REAL,"Cross-term dependence of vto"),
-IOP( "pvtho", BSIM3V2_MOD_PVTH0, IF_REAL,"Cross-term dependence of vto"),
-IOP( "pua", BSIM3V2_MOD_PUA, IF_REAL, "Cross-term dependence of ua"),
-IOP( "pua1", BSIM3V2_MOD_PUA1, IF_REAL, "Cross-term dependence of ua1"),
-IOP( "pub", BSIM3V2_MOD_PUB, IF_REAL, "Cross-term dependence of ub"),
-IOP( "pub1", BSIM3V2_MOD_PUB1, IF_REAL, "Cross-term dependence of ub1"),
-IOP( "puc", BSIM3V2_MOD_PUC, IF_REAL, "Cross-term dependence of uc"),
-IOP( "puc1", BSIM3V2_MOD_PUC1, IF_REAL, "Cross-term dependence of uc1"),
-IOP( "pu0", BSIM3V2_MOD_PU0, IF_REAL, "Cross-term dependence of u0"),
-IOP( "pute", BSIM3V2_MOD_PUTE, IF_REAL, "Cross-term dependence of ute"),
-IOP( "pvoff", BSIM3V2_MOD_PVOFF, IF_REAL, "Cross-term dependence of voff"),
-IOP( "pelm", BSIM3V2_MOD_PELM, IF_REAL, "Cross-term dependence of elm"),
-IOP( "pdelta", BSIM3V2_MOD_PDELTA, IF_REAL, "Cross-term dependence of delta"),
-IOP( "prdsw", BSIM3V2_MOD_PRDSW, IF_REAL, "Cross-term dependence of rdsw "),
-
-IOP( "pprwg", BSIM3V2_MOD_PPRWG, IF_REAL, "Cross-term dependence of prwg "),
-IOP( "pprwb", BSIM3V2_MOD_PPRWB, IF_REAL, "Cross-term dependence of prwb "),
-
-IOP( "pprt", BSIM3V2_MOD_PPRT, IF_REAL, "Cross-term dependence of prt "),
-IOP( "peta0", BSIM3V2_MOD_PETA0, IF_REAL, "Cross-term dependence of eta0"),
-IOP( "petab", BSIM3V2_MOD_PETAB, IF_REAL, "Cross-term dependence of etab"),
-IOP( "ppclm", BSIM3V2_MOD_PPCLM, IF_REAL, "Cross-term dependence of pclm"),
-IOP( "ppdiblc1", BSIM3V2_MOD_PPDIBL1, IF_REAL, "Cross-term dependence of pdiblc1"),
-IOP( "ppdiblc2", BSIM3V2_MOD_PPDIBL2, IF_REAL, "Cross-term dependence of pdiblc2"),
-IOP( "ppdiblcb", BSIM3V2_MOD_PPDIBLB, IF_REAL, "Cross-term dependence of pdiblcb"),
-IOP( "ppscbe1", BSIM3V2_MOD_PPSCBE1, IF_REAL, "Cross-term dependence of pscbe1"),
-IOP( "ppscbe2", BSIM3V2_MOD_PPSCBE2, IF_REAL, "Cross-term dependence of pscbe2"),
-IOP( "ppvag", BSIM3V2_MOD_PPVAG, IF_REAL, "Cross-term dependence of pvag"),
-IOP( "pwr", BSIM3V2_MOD_PWR, IF_REAL, "Cross-term dependence of wr"),
-IOP( "pdwg", BSIM3V2_MOD_PDWG, IF_REAL, "Cross-term dependence of dwg"),
-IOP( "pdwb", BSIM3V2_MOD_PDWB, IF_REAL, "Cross-term dependence of dwb"),
-IOP( "pb0", BSIM3V2_MOD_PB0, IF_REAL, "Cross-term dependence of b0"),
-IOP( "pb1", BSIM3V2_MOD_PB1, IF_REAL, "Cross-term dependence of b1"),
-IOP( "pcgsl", BSIM3V2_MOD_PCGSL, IF_REAL, "Cross-term dependence of cgsl"),
-IOP( "pcgdl", BSIM3V2_MOD_PCGDL, IF_REAL, "Cross-term dependence of cgdl"),
-IOP( "pckappa", BSIM3V2_MOD_PCKAPPA, IF_REAL, "Cross-term dependence of ckappa"),
-IOP( "pcf", BSIM3V2_MOD_PCF, IF_REAL, "Cross-term dependence of cf"),
-IOP( "pclc", BSIM3V2_MOD_PCLC, IF_REAL, "Cross-term dependence of clc"),
-IOP( "pcle", BSIM3V2_MOD_PCLE, IF_REAL, "Cross-term dependence of cle"),
-IOP( "palpha0", BSIM3V2_MOD_PALPHA0, IF_REAL, "Cross-term dependence of alpha0"),
-IOP( "palpha1", BSIM3V2_MOD_PALPHA1, IF_REAL, "Cross-term dependence of alpha1"),
-IOP( "pbeta0", BSIM3V2_MOD_PBETA0, IF_REAL, "Cross-term dependence of beta0"),
-IOP( "pvfbcv", BSIM3V2_MOD_PVFBCV, IF_REAL, "Cross-term dependence of vfbcv"),
-IOP( "pvfb", BSIM3V2_MOD_PVFB, IF_REAL, "Cross-term dependence of vfb"),
-IOP( "pacde", BSIM3V2_MOD_PACDE, IF_REAL, "Cross-term dependence of acde"),
-IOP( "pmoin", BSIM3V2_MOD_PMOIN, IF_REAL, "Cross-term dependence of moin"),
-IOP( "pnoff", BSIM3V2_MOD_PNOFF, IF_REAL, "Cross-term dependence of noff"),
-IOP( "pvoffcv", BSIM3V2_MOD_PVOFFCV, IF_REAL, "Cross-term dependence of voffcv"),
-
-IOP( "noia", BSIM3V2_MOD_NOIA, IF_REAL, "Flicker noise parameter"),
-IOP( "noib", BSIM3V2_MOD_NOIB, IF_REAL, "Flicker noise parameter"),
-IOP( "noic", BSIM3V2_MOD_NOIC, IF_REAL, "Flicker noise parameter"),
-IOP( "em", BSIM3V2_MOD_EM, IF_REAL, "Flicker noise parameter"),
-IOP( "ef", BSIM3V2_MOD_EF, IF_REAL, "Flicker noise frequency exponent"),
-IOP( "af", BSIM3V2_MOD_AF, IF_REAL, "Flicker noise exponent"),
-IOP( "kf", BSIM3V2_MOD_KF, IF_REAL, "Flicker noise coefficient"),
-
-IP( "nmos", BSIM3V2_MOD_NMOS, IF_FLAG, "Flag to indicate NMOS"),
-IP( "pmos", BSIM3V2_MOD_PMOS, IF_FLAG, "Flag to indicate PMOS"),
-};
-
-char *BSIM3V2names[] = {
- "Drain",
- "Gate",
- "Source",
- "Bulk",
- "Charge"
-};
-
-int BSIM3V2nSize = NUMELEMS(BSIM3V2names);
-int BSIM3V2pTSize = NUMELEMS(BSIM3V2pTable);
-int BSIM3V2mPTSize = NUMELEMS(BSIM3V2mPTable);
-int BSIM3V2iSize = sizeof(BSIM3V2instance);
-int BSIM3V2mSize = sizeof(BSIM3V2model);
-
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2acld.c b/src/spicelib/devices/bsim3v2/b3v2acld.c
deleted file mode 100644
index 160ef7b4a..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2acld.c
+++ /dev/null
@@ -1,337 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: b3acld.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "suffix.h"
-
-
-int
-BSIM3V2acLoad(inModel,ckt)
-GENmodel *inModel;
-CKTcircuit *ckt;
-{
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance *here;
-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, 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;
-
- omega = ckt->CKTomega;
- for (; model != NULL; model = model->BSIM3V2nextModel)
- { for (here = model->BSIM3V2instances; here!= NULL;
- here = here->BSIM3V2nextInstance)
-
- { if (here->BSIM3V2owner != ARCHme) continue;
- if (here->BSIM3V2mode >= 0)
- { Gm = here->BSIM3V2gm;
- Gmbs = here->BSIM3V2gmbs;
- FwdSum = Gm + Gmbs;
- RevSum = 0.0;
-
- gbbdp = -here->BSIM3V2gbds;
- gbbsp = here->BSIM3V2gbds + here->BSIM3V2gbgs + here->BSIM3V2gbbs;
-
- gbdpg = here->BSIM3V2gbgs;
- gbdpb = here->BSIM3V2gbbs;
- gbdpdp = here->BSIM3V2gbds;
- gbdpsp = -(gbdpg + gbdpb + gbdpdp);
-
- gbspdp = 0.0;
- gbspg = 0.0;
- gbspb = 0.0;
- gbspsp = 0.0;
-
- if (here->BSIM3V2nqsMod == 0)
- { cggb = here->BSIM3V2cggb;
- cgsb = here->BSIM3V2cgsb;
- cgdb = here->BSIM3V2cgdb;
-
- cbgb = here->BSIM3V2cbgb;
- cbsb = here->BSIM3V2cbsb;
- cbdb = here->BSIM3V2cbdb;
-
- cdgb = here->BSIM3V2cdgb;
- cdsb = here->BSIM3V2cdsb;
- cddb = here->BSIM3V2cddb;
-
- xgtg = xgtd = xgts = xgtb = 0.0;
- sxpart = 0.6;
- dxpart = 0.4;
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb
- = ddxpart_dVs = 0.0;
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb
- = dsxpart_dVs = 0.0;
- }
- else
- { cggb = cgdb = cgsb = 0.0;
- cbgb = cbdb = cbsb = 0.0;
- cdgb = cddb = cdsb = 0.0;
-
- xgtg = here->BSIM3V2gtg;
- xgtd = here->BSIM3V2gtd;
- xgts = here->BSIM3V2gts;
- xgtb = here->BSIM3V2gtb;
-
- xcqgb = here->BSIM3V2cqgb * omega;
- xcqdb = here->BSIM3V2cqdb * omega;
- xcqsb = here->BSIM3V2cqsb * omega;
- xcqbb = here->BSIM3V2cqbb * omega;
-
- CoxWL = model->BSIM3V2cox * here->pParam->BSIM3V2weffCV
- * here->pParam->BSIM3V2leffCV;
- qcheq = -(here->BSIM3V2qgate + here->BSIM3V2qbulk);
- if (fabs(qcheq) <= 1.0e-5 * CoxWL)
- { if (model->BSIM3V2xpart < 0.5)
- { dxpart = 0.4;
- }
- else if (model->BSIM3V2xpart > 0.5)
- { dxpart = 0.0;
- }
- else
- { dxpart = 0.5;
- }
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb
- = ddxpart_dVs = 0.0;
- }
- else
- { dxpart = here->BSIM3V2qdrn / qcheq;
- Cdd = here->BSIM3V2cddb;
- Csd = -(here->BSIM3V2cgdb + here->BSIM3V2cddb
- + here->BSIM3V2cbdb);
- ddxpart_dVd = (Cdd - dxpart * (Cdd + Csd)) / qcheq;
- Cdg = here->BSIM3V2cdgb;
- Csg = -(here->BSIM3V2cggb + here->BSIM3V2cdgb
- + here->BSIM3V2cbgb);
- ddxpart_dVg = (Cdg - dxpart * (Cdg + Csg)) / qcheq;
-
- Cds = here->BSIM3V2cdsb;
- Css = -(here->BSIM3V2cgsb + here->BSIM3V2cdsb
- + here->BSIM3V2cbsb);
- ddxpart_dVs = (Cds - dxpart * (Cds + Css)) / qcheq;
-
- ddxpart_dVb = -(ddxpart_dVd + ddxpart_dVg
- + ddxpart_dVs);
- }
- sxpart = 1.0 - dxpart;
- dsxpart_dVd = -ddxpart_dVd;
- dsxpart_dVg = -ddxpart_dVg;
- dsxpart_dVs = -ddxpart_dVs;
- dsxpart_dVb = -(dsxpart_dVd + dsxpart_dVg + dsxpart_dVs);
- }
- }
- else
- { Gm = -here->BSIM3V2gm;
- Gmbs = -here->BSIM3V2gmbs;
- FwdSum = 0.0;
- RevSum = -(Gm + Gmbs);
-
- gbbsp = -here->BSIM3V2gbds;
- gbbdp = here->BSIM3V2gbds + here->BSIM3V2gbgs + here->BSIM3V2gbbs;
-
- gbdpg = 0.0;
- gbdpsp = 0.0;
- gbdpb = 0.0;
- gbdpdp = 0.0;
-
- gbspg = here->BSIM3V2gbgs;
- gbspsp = here->BSIM3V2gbds;
- gbspb = here->BSIM3V2gbbs;
- gbspdp = -(gbspg + gbspsp + gbspb);
-
- if (here->BSIM3V2nqsMod == 0)
- { cggb = here->BSIM3V2cggb;
- cgsb = here->BSIM3V2cgdb;
- cgdb = here->BSIM3V2cgsb;
-
- cbgb = here->BSIM3V2cbgb;
- cbsb = here->BSIM3V2cbdb;
- cbdb = here->BSIM3V2cbsb;
-
- cdgb = -(here->BSIM3V2cdgb + cggb + cbgb);
- cdsb = -(here->BSIM3V2cddb + cgsb + cbsb);
- cddb = -(here->BSIM3V2cdsb + cgdb + cbdb);
-
- xgtg = xgtd = xgts = xgtb = 0.0;
- sxpart = 0.4;
- dxpart = 0.6;
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb
- = ddxpart_dVs = 0.0;
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb
- = dsxpart_dVs = 0.0;
- }
- else
- { cggb = cgdb = cgsb = 0.0;
- cbgb = cbdb = cbsb = 0.0;
- cdgb = cddb = cdsb = 0.0;
-
- xgtg = here->BSIM3V2gtg;
- xgtd = here->BSIM3V2gts;
- xgts = here->BSIM3V2gtd;
- xgtb = here->BSIM3V2gtb;
-
- xcqgb = here->BSIM3V2cqgb * omega;
- xcqdb = here->BSIM3V2cqsb * omega;
- xcqsb = here->BSIM3V2cqdb * omega;
- xcqbb = here->BSIM3V2cqbb * omega;
-
- CoxWL = model->BSIM3V2cox * here->pParam->BSIM3V2weffCV
- * here->pParam->BSIM3V2leffCV;
- qcheq = -(here->BSIM3V2qgate + here->BSIM3V2qbulk);
- if (fabs(qcheq) <= 1.0e-5 * CoxWL)
- { if (model->BSIM3V2xpart < 0.5)
- { sxpart = 0.4;
- }
- else if (model->BSIM3V2xpart > 0.5)
- { sxpart = 0.0;
- }
- else
- { sxpart = 0.5;
- }
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb
- = dsxpart_dVs = 0.0;
- }
- else
- { sxpart = here->BSIM3V2qdrn / qcheq;
- Css = here->BSIM3V2cddb;
- Cds = -(here->BSIM3V2cgdb + here->BSIM3V2cddb
- + here->BSIM3V2cbdb);
- dsxpart_dVs = (Css - sxpart * (Css + Cds)) / qcheq;
- Csg = here->BSIM3V2cdgb;
- Cdg = -(here->BSIM3V2cggb + here->BSIM3V2cdgb
- + here->BSIM3V2cbgb);
- dsxpart_dVg = (Csg - sxpart * (Csg + Cdg)) / qcheq;
-
- Csd = here->BSIM3V2cdsb;
- Cdd = -(here->BSIM3V2cgsb + here->BSIM3V2cdsb
- + here->BSIM3V2cbsb);
- dsxpart_dVd = (Csd - sxpart * (Csd + Cdd)) / qcheq;
-
- dsxpart_dVb = -(dsxpart_dVd + dsxpart_dVg
- + dsxpart_dVs);
- }
- dxpart = 1.0 - sxpart;
- ddxpart_dVd = -dsxpart_dVd;
- ddxpart_dVg = -dsxpart_dVg;
- ddxpart_dVs = -dsxpart_dVs;
- ddxpart_dVb = -(ddxpart_dVd + ddxpart_dVg + ddxpart_dVs);
- }
- }
-
- T1 = *(ckt->CKTstate0 + here->BSIM3V2qdef) * here->BSIM3V2gtau;
- gdpr = here->BSIM3V2drainConductance;
- gspr = here->BSIM3V2sourceConductance;
- gds = here->BSIM3V2gds;
- gbd = here->BSIM3V2gbd;
- gbs = here->BSIM3V2gbs;
- capbd = here->BSIM3V2capbd;
- capbs = here->BSIM3V2capbs;
-
- GSoverlapCap = here->BSIM3V2cgso;
- GDoverlapCap = here->BSIM3V2cgdo;
- GBoverlapCap = here->pParam->BSIM3V2cgbo;
-
- xcdgb = (cdgb - GDoverlapCap) * omega;
- xcddb = (cddb + capbd + GDoverlapCap) * omega;
- xcdsb = cdsb * omega;
- xcsgb = -(cggb + cbgb + cdgb + GSoverlapCap) * omega;
- xcsdb = -(cgdb + cbdb + cddb) * omega;
- xcssb = (capbs + GSoverlapCap - (cgsb + cbsb + cdsb)) * omega;
- xcggb = (cggb + GDoverlapCap + GSoverlapCap + GBoverlapCap)
- * omega;
- xcgdb = (cgdb - GDoverlapCap ) * omega;
- xcgsb = (cgsb - GSoverlapCap) * omega;
- xcbgb = (cbgb - GBoverlapCap) * omega;
- xcbdb = (cbdb - capbd ) * omega;
- xcbsb = (cbsb - capbs ) * omega;
-
- *(here->BSIM3V2GgPtr +1) += xcggb;
- *(here->BSIM3V2BbPtr +1) -= xcbgb + xcbdb + xcbsb;
- *(here->BSIM3V2DPdpPtr +1) += xcddb;
- *(here->BSIM3V2SPspPtr +1) += xcssb;
- *(here->BSIM3V2GbPtr +1) -= xcggb + xcgdb + xcgsb;
- *(here->BSIM3V2GdpPtr +1) += xcgdb;
- *(here->BSIM3V2GspPtr +1) += xcgsb;
- *(here->BSIM3V2BgPtr +1) += xcbgb;
- *(here->BSIM3V2BdpPtr +1) += xcbdb;
- *(here->BSIM3V2BspPtr +1) += xcbsb;
- *(here->BSIM3V2DPgPtr +1) += xcdgb;
- *(here->BSIM3V2DPbPtr +1) -= xcdgb + xcddb + xcdsb;
- *(here->BSIM3V2DPspPtr +1) += xcdsb;
- *(here->BSIM3V2SPgPtr +1) += xcsgb;
- *(here->BSIM3V2SPbPtr +1) -= xcsgb + xcsdb + xcssb;
- *(here->BSIM3V2SPdpPtr +1) += xcsdb;
-
- *(here->BSIM3V2DdPtr) += gdpr;
- *(here->BSIM3V2SsPtr) += gspr;
- *(here->BSIM3V2BbPtr) += gbd + gbs - here->BSIM3V2gbbs;
- *(here->BSIM3V2DPdpPtr) += gdpr + gds + gbd + RevSum
- + dxpart * xgtd + T1 * ddxpart_dVd + gbdpdp;
- *(here->BSIM3V2SPspPtr) += gspr + gds + gbs + FwdSum
- + sxpart * xgts + T1 * dsxpart_dVs + gbspsp;
-
- *(here->BSIM3V2DdpPtr) -= gdpr;
- *(here->BSIM3V2SspPtr) -= gspr;
-
- *(here->BSIM3V2BgPtr) -= here->BSIM3V2gbgs;
- *(here->BSIM3V2BdpPtr) -= gbd - gbbdp;
- *(here->BSIM3V2BspPtr) -= gbs - gbbsp;
-
- *(here->BSIM3V2DPdPtr) -= gdpr;
- *(here->BSIM3V2DPgPtr) += Gm + dxpart * xgtg + T1 * ddxpart_dVg
- + gbdpg;
- *(here->BSIM3V2DPbPtr) -= gbd - Gmbs - dxpart * xgtb
- - T1 * ddxpart_dVb - gbdpb;
- *(here->BSIM3V2DPspPtr) -= gds + FwdSum - dxpart * xgts
- - T1 * ddxpart_dVs - gbdpsp;
-
- *(here->BSIM3V2SPgPtr) -= Gm - sxpart * xgtg - T1 * dsxpart_dVg
- - gbspg;
- *(here->BSIM3V2SPsPtr) -= gspr;
- *(here->BSIM3V2SPbPtr) -= gbs + Gmbs - sxpart * xgtb
- - T1 * dsxpart_dVb - gbspb;
- *(here->BSIM3V2SPdpPtr) -= gds + RevSum - sxpart * xgtd
- - T1 * dsxpart_dVd - gbspdp;
-
- *(here->BSIM3V2GgPtr) -= xgtg;
- *(here->BSIM3V2GbPtr) -= xgtb;
- *(here->BSIM3V2GdpPtr) -= xgtd;
- *(here->BSIM3V2GspPtr) -= xgts;
-
- if (here->BSIM3V2nqsMod)
- { *(here->BSIM3V2QqPtr +1) += omega;
- *(here->BSIM3V2QgPtr +1) -= xcqgb;
- *(here->BSIM3V2QdpPtr +1) -= xcqdb;
- *(here->BSIM3V2QspPtr +1) -= xcqsb;
- *(here->BSIM3V2QbPtr +1) -= xcqbb;
-
- *(here->BSIM3V2QqPtr) += here->BSIM3V2gtau;
-
- *(here->BSIM3V2DPqPtr) += dxpart * here->BSIM3V2gtau;
- *(here->BSIM3V2SPqPtr) += sxpart * here->BSIM3V2gtau;
- *(here->BSIM3V2GqPtr) -= here->BSIM3V2gtau;
-
- *(here->BSIM3V2QgPtr) += xgtg;
- *(here->BSIM3V2QdpPtr) += xgtd;
- *(here->BSIM3V2QspPtr) += xgts;
- *(here->BSIM3V2QbPtr) += xgtb;
- }
- }
- }
- return(OK);
-}
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2ask.c b/src/spicelib/devices/bsim3v2/b3v2ask.c
deleted file mode 100644
index 5580399e6..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2ask.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2ask.c
-**********/
-
-#include "ngspice.h"
-#include
-#include
-#include "ifsim.h"
-#include "cktdefs.h"
-#include "devdefs.h"
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "suffix.h"
-
-int
-BSIM3V2ask(ckt,inst,which,value,select)
-CKTcircuit *ckt;
-GENinstance *inst;
-int which;
-IFvalue *value;
-IFvalue *select;
-{
-BSIM3V2instance *here = (BSIM3V2instance*)inst;
-
- switch(which)
- { case BSIM3V2_L:
- value->rValue = here->BSIM3V2l;
- return(OK);
- case BSIM3V2_W:
- value->rValue = here->BSIM3V2w;
- return(OK);
- case BSIM3V2_AS:
- value->rValue = here->BSIM3V2sourceArea;
- return(OK);
- case BSIM3V2_AD:
- value->rValue = here->BSIM3V2drainArea;
- return(OK);
- case BSIM3V2_PS:
- value->rValue = here->BSIM3V2sourcePerimeter;
- return(OK);
- case BSIM3V2_PD:
- value->rValue = here->BSIM3V2drainPerimeter;
- return(OK);
- case BSIM3V2_NRS:
- value->rValue = here->BSIM3V2sourceSquares;
- return(OK);
- case BSIM3V2_NRD:
- value->rValue = here->BSIM3V2drainSquares;
- return(OK);
- case BSIM3V2_OFF:
- value->rValue = here->BSIM3V2off;
- return(OK);
- case BSIM3V2_NQSMOD:
- value->iValue = here->BSIM3V2nqsMod;
- return(OK);
- case BSIM3V2_IC_VBS:
- value->rValue = here->BSIM3V2icVBS;
- return(OK);
- case BSIM3V2_IC_VDS:
- value->rValue = here->BSIM3V2icVDS;
- return(OK);
- case BSIM3V2_IC_VGS:
- value->rValue = here->BSIM3V2icVGS;
- return(OK);
- case BSIM3V2_DNODE:
- value->iValue = here->BSIM3V2dNode;
- return(OK);
- case BSIM3V2_GNODE:
- value->iValue = here->BSIM3V2gNode;
- return(OK);
- case BSIM3V2_SNODE:
- value->iValue = here->BSIM3V2sNode;
- return(OK);
- case BSIM3V2_BNODE:
- value->iValue = here->BSIM3V2bNode;
- return(OK);
- case BSIM3V2_DNODEPRIME:
- value->iValue = here->BSIM3V2dNodePrime;
- return(OK);
- case BSIM3V2_SNODEPRIME:
- value->iValue = here->BSIM3V2sNodePrime;
- return(OK);
- case BSIM3V2_SOURCECONDUCT:
- value->rValue = here->BSIM3V2sourceConductance;
- return(OK);
- case BSIM3V2_DRAINCONDUCT:
- value->rValue = here->BSIM3V2drainConductance;
- return(OK);
- case BSIM3V2_VBD:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2vbd);
- return(OK);
- case BSIM3V2_VBS:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2vbs);
- return(OK);
- case BSIM3V2_VGS:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2vgs);
- return(OK);
- case BSIM3V2_VDS:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2vds);
- return(OK);
- case BSIM3V2_CD:
- value->rValue = here->BSIM3V2cd;
- return(OK);
- case BSIM3V2_CBS:
- value->rValue = here->BSIM3V2cbs;
- return(OK);
- case BSIM3V2_CBD:
- value->rValue = here->BSIM3V2cbd;
- return(OK);
- case BSIM3V2_GM:
- value->rValue = here->BSIM3V2gm;
- return(OK);
- case BSIM3V2_GDS:
- value->rValue = here->BSIM3V2gds;
- return(OK);
- case BSIM3V2_GMBS:
- value->rValue = here->BSIM3V2gmbs;
- return(OK);
- case BSIM3V2_GBD:
- value->rValue = here->BSIM3V2gbd;
- return(OK);
- case BSIM3V2_GBS:
- value->rValue = here->BSIM3V2gbs;
- return(OK);
- case BSIM3V2_QB:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2qb);
- return(OK);
- case BSIM3V2_CQB:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2cqb);
- return(OK);
- case BSIM3V2_QG:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2qg);
- return(OK);
- case BSIM3V2_CQG:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2cqg);
- return(OK);
- case BSIM3V2_QD:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2qd);
- return(OK);
- case BSIM3V2_CQD:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2cqd);
- return(OK);
- case BSIM3V2_CGG:
- value->rValue = here->BSIM3V2cggb;
- return(OK);
- case BSIM3V2_CGD:
- value->rValue = here->BSIM3V2cgdb;
- return(OK);
- case BSIM3V2_CGS:
- value->rValue = here->BSIM3V2cgsb;
- return(OK);
- case BSIM3V2_CDG:
- value->rValue = here->BSIM3V2cdgb;
- return(OK);
- case BSIM3V2_CDD:
- value->rValue = here->BSIM3V2cddb;
- return(OK);
- case BSIM3V2_CDS:
- value->rValue = here->BSIM3V2cdsb;
- return(OK);
- case BSIM3V2_CBG:
- value->rValue = here->BSIM3V2cbgb;
- return(OK);
- case BSIM3V2_CBDB:
- value->rValue = here->BSIM3V2cbdb;
- return(OK);
- case BSIM3V2_CBSB:
- value->rValue = here->BSIM3V2cbsb;
- return(OK);
- case BSIM3V2_CAPBD:
- value->rValue = here->BSIM3V2capbd;
- return(OK);
- case BSIM3V2_CAPBS:
- value->rValue = here->BSIM3V2capbs;
- return(OK);
- case BSIM3V2_VON:
- value->rValue = here->BSIM3V2von;
- return(OK);
- case BSIM3V2_VDSAT:
- value->rValue = here->BSIM3V2vdsat;
- return(OK);
- case BSIM3V2_QBS:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2qbs);
- return(OK);
- case BSIM3V2_QBD:
- value->rValue = *(ckt->CKTstate0 + here->BSIM3V2qbd);
- return(OK);
- default:
- return(E_BADPARM);
- }
- /* NOTREACHED */
-}
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2check.c b/src/spicelib/devices/bsim3v2/b3v2check.c
deleted file mode 100644
index 14056d79a..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2check.c
+++ /dev/null
@@ -1,428 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: Min-Chie Jeng.
-Modified by Weidong Liu (1997-1998).
-File: b3v2check.c
-**********/
-
-#include "ngspice.h"
-#include
-#include
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "trandefs.h"
-#include "const.h"
-#include "sperror.h"
-#include "devdefs.h"
-#include "suffix.h"
-
-int
-BSIM3V2checkModel(model, here, ckt)
-BSIM3V2model *model;
-BSIM3V2instance *here;
-CKTcircuit *ckt;
-{
-struct BSIM3V2SizeDependParam *pParam;
-int Fatal_Flag = 0;
-FILE *fplog;
-
- if ((fplog = fopen("b3v3check.log", "w")) != NULL)
- { pParam = here->pParam;
- fprintf(fplog, "BSIM3V3.2 Parameter Check\n");
- fprintf(fplog, "Model = %s\n", model->BSIM3V2modName);
- fprintf(fplog, "W = %g, L = %g\n", here->BSIM3V2w, here->BSIM3V2l);
-
-
- if (pParam->BSIM3V2nlx < -pParam->BSIM3V2leff)
- { fprintf(fplog, "Fatal: Nlx = %g is less than -Leff.\n",
- pParam->BSIM3V2nlx);
- printf("Fatal: Nlx = %g is less than -Leff.\n",
- pParam->BSIM3V2nlx);
- Fatal_Flag = 1;
- }
-
- if (model->BSIM3V2tox <= 0.0)
- { fprintf(fplog, "Fatal: Tox = %g is not positive.\n",
- model->BSIM3V2tox);
- printf("Fatal: Tox = %g is not positive.\n", model->BSIM3V2tox);
- Fatal_Flag = 1;
- }
-
- if (model->BSIM3V2toxm <= 0.0)
- { fprintf(fplog, "Fatal: Toxm = %g is not positive.\n",
- model->BSIM3V2toxm);
- printf("Fatal: Toxm = %g is not positive.\n", model->BSIM3V2toxm);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2npeak <= 0.0)
- { fprintf(fplog, "Fatal: Nch = %g is not positive.\n",
- pParam->BSIM3V2npeak);
- printf("Fatal: Nch = %g is not positive.\n",
- pParam->BSIM3V2npeak);
- Fatal_Flag = 1;
- }
- if (pParam->BSIM3V2nsub <= 0.0)
- { fprintf(fplog, "Fatal: Nsub = %g is not positive.\n",
- pParam->BSIM3V2nsub);
- printf("Fatal: Nsub = %g is not positive.\n",
- pParam->BSIM3V2nsub);
- Fatal_Flag = 1;
- }
- if (pParam->BSIM3V2ngate < 0.0)
- { fprintf(fplog, "Fatal: Ngate = %g is not positive.\n",
- pParam->BSIM3V2ngate);
- printf("Fatal: Ngate = %g Ngate is not positive.\n",
- pParam->BSIM3V2ngate);
- Fatal_Flag = 1;
- }
- if (pParam->BSIM3V2ngate > 1.e25)
- { fprintf(fplog, "Fatal: Ngate = %g is too high.\n",
- pParam->BSIM3V2ngate);
- printf("Fatal: Ngate = %g Ngate is too high\n",
- pParam->BSIM3V2ngate);
- Fatal_Flag = 1;
- }
- if (pParam->BSIM3V2xj <= 0.0)
- { fprintf(fplog, "Fatal: Xj = %g is not positive.\n",
- pParam->BSIM3V2xj);
- printf("Fatal: Xj = %g is not positive.\n", pParam->BSIM3V2xj);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2dvt1 < 0.0)
- { fprintf(fplog, "Fatal: Dvt1 = %g is negative.\n",
- pParam->BSIM3V2dvt1);
- printf("Fatal: Dvt1 = %g is negative.\n", pParam->BSIM3V2dvt1);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2dvt1w < 0.0)
- { fprintf(fplog, "Fatal: Dvt1w = %g is negative.\n",
- pParam->BSIM3V2dvt1w);
- printf("Fatal: Dvt1w = %g is negative.\n", pParam->BSIM3V2dvt1w);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2w0 == -pParam->BSIM3V2weff)
- { fprintf(fplog, "Fatal: (W0 + Weff) = 0 causing divided-by-zero.\n");
- printf("Fatal: (W0 + Weff) = 0 causing divided-by-zero.\n");
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2dsub < 0.0)
- { fprintf(fplog, "Fatal: Dsub = %g is negative.\n", pParam->BSIM3V2dsub);
- printf("Fatal: Dsub = %g is negative.\n", pParam->BSIM3V2dsub);
- Fatal_Flag = 1;
- }
- if (pParam->BSIM3V2b1 == -pParam->BSIM3V2weff)
- { fprintf(fplog, "Fatal: (B1 + Weff) = 0 causing divided-by-zero.\n");
- printf("Fatal: (B1 + Weff) = 0 causing divided-by-zero.\n");
- Fatal_Flag = 1;
- }
- if (pParam->BSIM3V2u0temp <= 0.0)
- { fprintf(fplog, "Fatal: u0 at current temperature = %g is not positive.\n", pParam->BSIM3V2u0temp);
- printf("Fatal: u0 at current temperature = %g is not positive.\n",
- pParam->BSIM3V2u0temp);
- Fatal_Flag = 1;
- }
-
-/* Check delta parameter */
- if (pParam->BSIM3V2delta < 0.0)
- { fprintf(fplog, "Fatal: Delta = %g is less than zero.\n",
- pParam->BSIM3V2delta);
- printf("Fatal: Delta = %g is less than zero.\n", pParam->BSIM3V2delta);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2vsattemp <= 0.0)
- { fprintf(fplog, "Fatal: Vsat at current temperature = %g is not positive.\n", pParam->BSIM3V2vsattemp);
- printf("Fatal: Vsat at current temperature = %g is not positive.\n",
- pParam->BSIM3V2vsattemp);
- Fatal_Flag = 1;
- }
-/* Check Rout parameters */
- if (pParam->BSIM3V2pclm <= 0.0)
- { fprintf(fplog, "Fatal: Pclm = %g is not positive.\n", pParam->BSIM3V2pclm);
- printf("Fatal: Pclm = %g is not positive.\n", pParam->BSIM3V2pclm);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2drout < 0.0)
- { fprintf(fplog, "Fatal: Drout = %g is negative.\n", pParam->BSIM3V2drout);
- printf("Fatal: Drout = %g is negative.\n", pParam->BSIM3V2drout);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2pscbe2 <= 0.0)
- { fprintf(fplog, "Warning: Pscbe2 = %g is not positive.\n",
- pParam->BSIM3V2pscbe2);
- printf("Warning: Pscbe2 = %g is not positive.\n", pParam->BSIM3V2pscbe2);
- }
-
- if (model->BSIM3V2unitLengthSidewallJctCap > 0.0 ||
- model->BSIM3V2unitLengthGateSidewallJctCap > 0.0)
- {
- if (here->BSIM3V2drainPerimeter < pParam->BSIM3V2weff)
- { fprintf(fplog, "Warning: Pd = %g is less than W.\n",
- here->BSIM3V2drainPerimeter);
- printf("Warning: Pd = %g is less than W.\n",
- here->BSIM3V2drainPerimeter);
- }
- if (here->BSIM3V2sourcePerimeter < pParam->BSIM3V2weff)
- { fprintf(fplog, "Warning: Ps = %g is less than W.\n",
- here->BSIM3V2sourcePerimeter);
- printf("Warning: Ps = %g is less than W.\n",
- here->BSIM3V2sourcePerimeter);
- }
- }
-
- if (pParam->BSIM3V2noff < 0.1)
- { fprintf(fplog, "Warning: Noff = %g is too small.\n",
- pParam->BSIM3V2noff);
- printf("Warning: Noff = %g is too small.\n", pParam->BSIM3V2noff);
- }
- if (pParam->BSIM3V2noff > 4.0)
- { fprintf(fplog, "Warning: Noff = %g is too large.\n",
- pParam->BSIM3V2noff);
- printf("Warning: Noff = %g is too large.\n", pParam->BSIM3V2noff);
- }
-
- if (pParam->BSIM3V2voffcv < -0.5)
- { fprintf(fplog, "Warning: Voffcv = %g is too small.\n",
- pParam->BSIM3V2voffcv);
- printf("Warning: Voffcv = %g is too small.\n", pParam->BSIM3V2voffcv);
- }
- if (pParam->BSIM3V2voffcv > 0.5)
- { fprintf(fplog, "Warning: Voffcv = %g is too large.\n",
- pParam->BSIM3V2voffcv);
- printf("Warning: Voffcv = %g is too large.\n", pParam->BSIM3V2voffcv);
- }
-
- if (model->BSIM3V2ijth < 0.0)
- { fprintf(fplog, "Fatal: Ijth = %g cannot be negative.\n",
- model->BSIM3V2ijth);
- printf("Fatal: Ijth = %g cannot be negative.\n", model->BSIM3V2ijth);
- Fatal_Flag = 1;
- }
-
-/* Check capacitance parameters */
- if (pParam->BSIM3V2clc < 0.0)
- { fprintf(fplog, "Fatal: Clc = %g is negative.\n", pParam->BSIM3V2clc);
- printf("Fatal: Clc = %g is negative.\n", pParam->BSIM3V2clc);
- Fatal_Flag = 1;
- }
-
- if (pParam->BSIM3V2moin < 5.0)
- { fprintf(fplog, "Warning: Moin = %g is too small.\n",
- pParam->BSIM3V2moin);
- printf("Warning: Moin = %g is too small.\n", pParam->BSIM3V2moin);
- }
- if (pParam->BSIM3V2moin > 25.0)
- { fprintf(fplog, "Warning: Moin = %g is too large.\n",
- pParam->BSIM3V2moin);
- printf("Warning: Moin = %g is too large.\n", pParam->BSIM3V2moin);
- }
-
- if (pParam->BSIM3V2acde < 0.4)
- { fprintf(fplog, "Warning: Acde = %g is too small.\n",
- pParam->BSIM3V2acde);
- printf("Warning: Acde = %g is too small.\n", pParam->BSIM3V2acde);
- }
- if (pParam->BSIM3V2acde > 1.6)
- { fprintf(fplog, "Warning: Acde = %g is too large.\n",
- pParam->BSIM3V2acde);
- printf("Warning: Acde = %g is too large.\n", pParam->BSIM3V2acde);
- }
-
- if (model->BSIM3V2paramChk ==1)
- {
-/* Check L and W parameters */
- if (pParam->BSIM3V2leff <= 5.0e-8)
- { fprintf(fplog, "Warning: Leff = %g may be too small.\n",
- pParam->BSIM3V2leff);
- printf("Warning: Leff = %g may be too small.\n",
- pParam->BSIM3V2leff);
- }
-
- if (pParam->BSIM3V2leffCV <= 5.0e-8)
- { fprintf(fplog, "Warning: Leff for CV = %g may be too small.\n",
- pParam->BSIM3V2leffCV);
- printf("Warning: Leff for CV = %g may be too small.\n",
- pParam->BSIM3V2leffCV);
- }
-
- if (pParam->BSIM3V2weff <= 1.0e-7)
- { fprintf(fplog, "Warning: Weff = %g may be too small.\n",
- pParam->BSIM3V2weff);
- printf("Warning: Weff = %g may be too small.\n",
- pParam->BSIM3V2weff);
- }
-
- if (pParam->BSIM3V2weffCV <= 1.0e-7)
- { fprintf(fplog, "Warning: Weff for CV = %g may be too small.\n",
- pParam->BSIM3V2weffCV);
- printf("Warning: Weff for CV = %g may be too small.\n",
- pParam->BSIM3V2weffCV);
- }
-
-/* Check threshold voltage parameters */
- if (pParam->BSIM3V2nlx < 0.0)
- { fprintf(fplog, "Warning: Nlx = %g is negative.\n", pParam->BSIM3V2nlx);
- printf("Warning: Nlx = %g is negative.\n", pParam->BSIM3V2nlx);
- }
- if (model->BSIM3V2tox < 1.0e-9)
- { fprintf(fplog, "Warning: Tox = %g is less than 10A.\n",
- model->BSIM3V2tox);
- printf("Warning: Tox = %g is less than 10A.\n", model->BSIM3V2tox);
- }
-
- if (pParam->BSIM3V2npeak <= 1.0e15)
- { fprintf(fplog, "Warning: Nch = %g may be too small.\n",
- pParam->BSIM3V2npeak);
- printf("Warning: Nch = %g may be too small.\n",
- pParam->BSIM3V2npeak);
- }
- else if (pParam->BSIM3V2npeak >= 1.0e21)
- { fprintf(fplog, "Warning: Nch = %g may be too large.\n",
- pParam->BSIM3V2npeak);
- printf("Warning: Nch = %g may be too large.\n",
- pParam->BSIM3V2npeak);
- }
-
- if (pParam->BSIM3V2nsub <= 1.0e14)
- { fprintf(fplog, "Warning: Nsub = %g may be too small.\n",
- pParam->BSIM3V2nsub);
- printf("Warning: Nsub = %g may be too small.\n",
- pParam->BSIM3V2nsub);
- }
- else if (pParam->BSIM3V2nsub >= 1.0e21)
- { fprintf(fplog, "Warning: Nsub = %g may be too large.\n",
- pParam->BSIM3V2nsub);
- printf("Warning: Nsub = %g may be too large.\n",
- pParam->BSIM3V2nsub);
- }
-
- if ((pParam->BSIM3V2ngate > 0.0) &&
- (pParam->BSIM3V2ngate <= 1.e18))
- { fprintf(fplog, "Warning: Ngate = %g is less than 1.E18cm^-3.\n",
- pParam->BSIM3V2ngate);
- printf("Warning: Ngate = %g is less than 1.E18cm^-3.\n",
- pParam->BSIM3V2ngate);
- }
-
- if (pParam->BSIM3V2dvt0 < 0.0)
- { fprintf(fplog, "Warning: Dvt0 = %g is negative.\n",
- pParam->BSIM3V2dvt0);
- printf("Warning: Dvt0 = %g is negative.\n", pParam->BSIM3V2dvt0);
- }
-
- if (fabs(1.0e-6 / (pParam->BSIM3V2w0 + pParam->BSIM3V2weff)) > 10.0)
- { fprintf(fplog, "Warning: (W0 + Weff) may be too small.\n");
- printf("Warning: (W0 + Weff) may be too small.\n");
- }
-
-/* Check subthreshold parameters */
- if (pParam->BSIM3V2nfactor < 0.0)
- { fprintf(fplog, "Warning: Nfactor = %g is negative.\n",
- pParam->BSIM3V2nfactor);
- printf("Warning: Nfactor = %g is negative.\n", pParam->BSIM3V2nfactor);
- }
- if (pParam->BSIM3V2cdsc < 0.0)
- { fprintf(fplog, "Warning: Cdsc = %g is negative.\n",
- pParam->BSIM3V2cdsc);
- printf("Warning: Cdsc = %g is negative.\n", pParam->BSIM3V2cdsc);
- }
- if (pParam->BSIM3V2cdscd < 0.0)
- { fprintf(fplog, "Warning: Cdscd = %g is negative.\n",
- pParam->BSIM3V2cdscd);
- printf("Warning: Cdscd = %g is negative.\n", pParam->BSIM3V2cdscd);
- }
-/* Check DIBL parameters */
- if (pParam->BSIM3V2eta0 < 0.0)
- { fprintf(fplog, "Warning: Eta0 = %g is negative.\n",
- pParam->BSIM3V2eta0);
- printf("Warning: Eta0 = %g is negative.\n", pParam->BSIM3V2eta0);
- }
-
-/* Check Abulk parameters */
- if (fabs(1.0e-6 / (pParam->BSIM3V2b1 + pParam->BSIM3V2weff)) > 10.0)
- { fprintf(fplog, "Warning: (B1 + Weff) may be too small.\n");
- printf("Warning: (B1 + Weff) may be too small.\n");
- }
-
-
-/* Check Saturation parameters */
- if (pParam->BSIM3V2a2 < 0.01)
- { fprintf(fplog, "Warning: A2 = %g is too small. Set to 0.01.\n", pParam->BSIM3V2a2);
- printf("Warning: A2 = %g is too small. Set to 0.01.\n",
- pParam->BSIM3V2a2);
- pParam->BSIM3V2a2 = 0.01;
- }
- else if (pParam->BSIM3V2a2 > 1.0)
- { fprintf(fplog, "Warning: A2 = %g is larger than 1. A2 is set to 1 and A1 is set to 0.\n",
- pParam->BSIM3V2a2);
- printf("Warning: A2 = %g is larger than 1. A2 is set to 1 and A1 is set to 0.\n",
- pParam->BSIM3V2a2);
- pParam->BSIM3V2a2 = 1.0;
- pParam->BSIM3V2a1 = 0.0;
-
- }
-
- if (pParam->BSIM3V2rdsw < 0.0)
- { fprintf(fplog, "Warning: Rdsw = %g is negative. Set to zero.\n",
- pParam->BSIM3V2rdsw);
- printf("Warning: Rdsw = %g is negative. Set to zero.\n",
- pParam->BSIM3V2rdsw);
- pParam->BSIM3V2rdsw = 0.0;
- pParam->BSIM3V2rds0 = 0.0;
- }
- else if ((pParam->BSIM3V2rds0 > 0.0) && (pParam->BSIM3V2rds0 < 0.001))
- { fprintf(fplog, "Warning: Rds at current temperature = %g is less than 0.001 ohm. Set to zero.\n",
- pParam->BSIM3V2rds0);
- printf("Warning: Rds at current temperature = %g is less than 0.001 ohm. Set to zero.\n",
- pParam->BSIM3V2rds0);
- pParam->BSIM3V2rds0 = 0.0;
- }
- if (pParam->BSIM3V2vsattemp < 1.0e3)
- { fprintf(fplog, "Warning: Vsat at current temperature = %g may be too small.\n", pParam->BSIM3V2vsattemp);
- printf("Warning: Vsat at current temperature = %g may be too small.\n", pParam->BSIM3V2vsattemp);
- }
-
- if (pParam->BSIM3V2pdibl1 < 0.0)
- { fprintf(fplog, "Warning: Pdibl1 = %g is negative.\n",
- pParam->BSIM3V2pdibl1);
- printf("Warning: Pdibl1 = %g is negative.\n", pParam->BSIM3V2pdibl1);
- }
- if (pParam->BSIM3V2pdibl2 < 0.0)
- { fprintf(fplog, "Warning: Pdibl2 = %g is negative.\n",
- pParam->BSIM3V2pdibl2);
- printf("Warning: Pdibl2 = %g is negative.\n", pParam->BSIM3V2pdibl2);
- }
-/* Check overlap capacitance parameters */
- if (model->BSIM3V2cgdo < 0.0)
- { fprintf(fplog, "Warning: cgdo = %g is negative. Set to zero.\n", model->BSIM3V2cgdo);
- printf("Warning: cgdo = %g is negative. Set to zero.\n", model->BSIM3V2cgdo);
- model->BSIM3V2cgdo = 0.0;
- }
- if (model->BSIM3V2cgso < 0.0)
- { fprintf(fplog, "Warning: cgso = %g is negative. Set to zero.\n", model->BSIM3V2cgso);
- printf("Warning: cgso = %g is negative. Set to zero.\n", model->BSIM3V2cgso);
- model->BSIM3V2cgso = 0.0;
- }
- if (model->BSIM3V2cgbo < 0.0)
- { fprintf(fplog, "Warning: cgbo = %g is negative. Set to zero.\n", model->BSIM3V2cgbo);
- printf("Warning: cgbo = %g is negative. Set to zero.\n", model->BSIM3V2cgbo);
- model->BSIM3V2cgbo = 0.0;
- }
-
- }/* loop for the parameter check for warning messages */
- fclose(fplog);
- }
- else
- { fprintf(stderr, "Warning: Can't open log file. Parameter checking skipped.\n");
- }
-
- return(Fatal_Flag);
-}
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2cvtest.c b/src/spicelib/devices/bsim3v2/b3v2cvtest.c
deleted file mode 100644
index b6e8e105b..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2cvtest.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2cvtest.c
-**********/
-
-#include "ngspice.h"
-#include
-#include
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "trandefs.h"
-#include "const.h"
-#include "devdefs.h"
-#include "sperror.h"
-#include "suffix.h"
-
-
-int
-BSIM3V2convTest(inModel,ckt)
-GENmodel *inModel;
-CKTcircuit *ckt;
-{
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance *here;
-double delvbd, delvbs, delvds, delvgd, delvgs, vbd, vbs, vds;
-double cbd, cbhat, cbs, cd, cdhat, tol, vgd, vgdo, vgs;
-
- /* loop through all the BSIM3V2 device models */
- for (; model != NULL; model = model->BSIM3V2nextModel)
- { /* loop through all the instances of the model */
- for (here = model->BSIM3V2instances; here != NULL ;
- here=here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2owner != ARCHme) continue;
- vbs = model->BSIM3V2type
- * (*(ckt->CKTrhsOld+here->BSIM3V2bNode)
- - *(ckt->CKTrhsOld+here->BSIM3V2sNodePrime));
- vgs = model->BSIM3V2type
- * (*(ckt->CKTrhsOld+here->BSIM3V2gNode)
- - *(ckt->CKTrhsOld+here->BSIM3V2sNodePrime));
- vds = model->BSIM3V2type
- * (*(ckt->CKTrhsOld+here->BSIM3V2dNodePrime)
- - *(ckt->CKTrhsOld+here->BSIM3V2sNodePrime));
- vbd = vbs - vds;
- vgd = vgs - vds;
- vgdo = *(ckt->CKTstate0 + here->BSIM3V2vgs)
- - *(ckt->CKTstate0 + here->BSIM3V2vds);
- delvbs = vbs - *(ckt->CKTstate0 + here->BSIM3V2vbs);
- delvbd = vbd - *(ckt->CKTstate0 + here->BSIM3V2vbd);
- delvgs = vgs - *(ckt->CKTstate0 + here->BSIM3V2vgs);
- delvds = vds - *(ckt->CKTstate0 + here->BSIM3V2vds);
- delvgd = vgd-vgdo;
-
- cd = here->BSIM3V2cd - here->BSIM3V2cbd;
- if (here->BSIM3V2mode >= 0)
- { cd += here->BSIM3V2csub;
- cdhat = cd - here->BSIM3V2gbd * delvbd
- + (here->BSIM3V2gmbs + here->BSIM3V2gbbs) * delvbs
- + (here->BSIM3V2gm + here->BSIM3V2gbgs) * delvgs
- + (here->BSIM3V2gds + here->BSIM3V2gbds) * delvds;
- }
- else
- { cdhat = cd + (here->BSIM3V2gmbs - here->BSIM3V2gbd) * delvbd
- + here->BSIM3V2gm * delvgd - here->BSIM3V2gds * delvds;
- }
-
- /*
- * check convergence
- */
- if ((here->BSIM3V2off == 0) || (!(ckt->CKTmode & MODEINITFIX)))
- { tol = ckt->CKTreltol * MAX(fabs(cdhat), fabs(cd))
- + ckt->CKTabstol;
- if (fabs(cdhat - cd) >= tol)
- { ckt->CKTnoncon++;
- return(OK);
- }
- cbs = here->BSIM3V2cbs;
- cbd = here->BSIM3V2cbd;
- if (here->BSIM3V2mode >= 0)
- { cbhat = cbs + cbd - here->BSIM3V2csub
- + here->BSIM3V2gbd * delvbd
- + (here->BSIM3V2gbs - here->BSIM3V2gbbs) * delvbs
- - here->BSIM3V2gbgs * delvgs
- - here->BSIM3V2gbds * delvds;
- }
- else
- { cbhat = cbs + cbd - here->BSIM3V2csub
- + here->BSIM3V2gbs * delvbs
- + (here->BSIM3V2gbd - here->BSIM3V2gbbs) * delvbd
- - here->BSIM3V2gbgs * delvgd
- + here->BSIM3V2gbds * delvds;
- }
- tol = ckt->CKTreltol * MAX(fabs(cbhat),
- fabs(cbs + cbd - here->BSIM3V2csub)) + ckt->CKTabstol;
- if (fabs(cbhat - (cbs + cbd - here->BSIM3V2csub)) > tol)
- { ckt->CKTnoncon++;
- return(OK);
- }
- }
- }
- }
- return(OK);
-}
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2del.c b/src/spicelib/devices/bsim3v2/b3v2del.c
deleted file mode 100644
index 948ddd19e..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2del.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2del.c
-**********/
-/*
- */
-
-#include "ngspice.h"
-#include
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "gendefs.h"
-#include "suffix.h"
-
-
-int
-BSIM3V2delete(inModel,name,inInst)
-GENmodel *inModel;
-IFuid name;
-GENinstance **inInst;
-{
-BSIM3V2instance **fast = (BSIM3V2instance**)inInst;
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance **prev = NULL;
-BSIM3V2instance *here;
-
- for (; model ; model = model->BSIM3V2nextModel)
- { prev = &(model->BSIM3V2instances);
- for (here = *prev; here ; here = *prev)
- { if (here->BSIM3V2name == name || (fast && here==*fast))
- { *prev= here->BSIM3V2nextInstance;
- FREE(here);
- return(OK);
- }
- prev = &(here->BSIM3V2nextInstance);
- }
- }
- return(E_NODEV);
-}
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2dest.c b/src/spicelib/devices/bsim3v2/b3v2dest.c
deleted file mode 100644
index 024113c1b..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2dest.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2dest.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "bsim3v2def.h"
-#include "suffix.h"
-
-void
-BSIM3V2destroy(inModel)
-GENmodel **inModel;
-{
-BSIM3V2model **model = (BSIM3V2model**)inModel;
-BSIM3V2instance *here;
-BSIM3V2instance *prev = NULL;
-BSIM3V2model *mod = *model;
-BSIM3V2model *oldmod = NULL;
-
- for (; mod ; mod = mod->BSIM3V2nextModel)
- { if(oldmod) FREE(oldmod);
- oldmod = mod;
- prev = (BSIM3V2instance *)NULL;
- for (here = mod->BSIM3V2instances; here; here = here->BSIM3V2nextInstance)
- { if(prev) FREE(prev);
- prev = here;
- }
- if(prev) FREE(prev);
- }
- if(oldmod) FREE(oldmod);
- *model = NULL;
- return;
-}
-
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2getic.c b/src/spicelib/devices/bsim3v2/b3v2getic.c
deleted file mode 100644
index 1c7f64752..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2getic.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2getic.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "suffix.h"
-
-
-int
-BSIM3V2getic(inModel,ckt)
-GENmodel *inModel;
-CKTcircuit *ckt;
-{
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance *here;
-
- for (; model ; model = model->BSIM3V2nextModel)
- { for (here = model->BSIM3V2instances; here; here = here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2owner != ARCHme) continue;
- if(!here->BSIM3V2icVBSGiven)
- { here->BSIM3V2icVBS = *(ckt->CKTrhs + here->BSIM3V2bNode)
- - *(ckt->CKTrhs + here->BSIM3V2sNode);
- }
- if (!here->BSIM3V2icVDSGiven)
- { here->BSIM3V2icVDS = *(ckt->CKTrhs + here->BSIM3V2dNode)
- - *(ckt->CKTrhs + here->BSIM3V2sNode);
- }
- if (!here->BSIM3V2icVGSGiven)
- { here->BSIM3V2icVGS = *(ckt->CKTrhs + here->BSIM3V2gNode)
- - *(ckt->CKTrhs + here->BSIM3V2sNode);
- }
- }
- }
- return(OK);
-}
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2ld.c b/src/spicelib/devices/bsim3v2/b3v2ld.c
deleted file mode 100644
index 7d3e0f727..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2ld.c
+++ /dev/null
@@ -1,2906 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1991 JianHui Huang and Min-Chie Jeng.
-Modified by Mansun Chan (1995).
-Modified by Weidong Liu (1997-1998).
-File: b3ld.c 1/3/92
-**********/
-
-#include "ngspice.h"
-#include
-#include
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "trandefs.h"
-#include "const.h"
-#include "sperror.h"
-#include "devdefs.h"
-#include "suffix.h"
-
-#define MAX_EXP 5.834617425e14
-#define MIN_EXP 1.713908431e-15
-#define EXP_THRESHOLD 34.0
-#define EPSOX 3.453133e-11
-#define EPSSI 1.03594e-10
-#define Charge_q 1.60219e-19
-#define DELTA_1 0.02
-#define DELTA_2 0.02
-#define DELTA_3 0.02
-#define DELTA_4 0.02
-
-
-int
-BSIM3V2load(inModel,ckt)
-GENmodel *inModel;
-CKTcircuit *ckt;
-{
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance *here;
-double SourceSatCurrent, DrainSatCurrent;
-double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst;
-double cdrain, cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq;
-double czbd, czbdsw, czbdswg, czbs, czbssw, czbsswg, evbd, evbs, arg, sarg;
-double delvbd, delvbs, delvds, delvgd, delvgs;
-double Vfbeff, dVfbeff_dVg, dVfbeff_dVd, dVfbeff_dVb, V3, V4;
-double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb, gcgdb, gcggb, gcgsb, gcsdb;
-double gcsgb, gcssb, tol, MJ, MJSW, MJSWG;
-double vbd, vbs, vds, vgb, vgd, vgs, vgdo, xfact;
-double qgate, qbulk, qdrn, qsrc, qinoi, cqgate, cqbulk, cqdrn;
-double Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum;
-double Vgs_eff, Vfb, dVfb_dVb, dVfb_dVd, dVbs_dVb;
-double Phis, dPhis_dVb, sqrtPhis, dsqrtPhis_dVb, Vth, dVth_dVb, dVth_dVd;
-double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtm;
-double Vgdt, Vgsaddvth, Vgsaddvth2, Vgsaddvth1o3, Vtm;
-double n, dn_dVb, dn_dVd, voffcv, noff, dnoff_dVd, dnoff_dVb;
-double ExpArg, ExpArg1, V0, CoxWLcen, QovCox, LINK;
-double DeltaPhi, dDeltaPhi_dVg, dDeltaPhi_dVd, dDeltaPhi_dVb;
-double Cox, Tox, Tcen, dTcen_dVg, dTcen_dVd, dTcen_dVb;
-double Ccen, Coxeff, dCoxeff_dVg, dCoxeff_dVd, dCoxeff_dVb;
-double Denomi, dDenomi_dVg, dDenomi_dVd, dDenomi_dVb;
-double ueff, dueff_dVg, dueff_dVd, dueff_dVb;
-double Esat, dEsat_dVg, dEsat_dVd, dEsat_dVb, Vdsat, Vdsat0;
-double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb;
-double Ilimit, Iexp, dIexp_dVg, dIexp_dVd, dIexp_dVb;
-double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat, dAlphaz_dVg, dAlphaz_dVb;
-double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, Va2, dVa_dVd, dVa_dVg, dVa_dVb;
-double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb;
-double Arg1, Arg2, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL;
-double dqbulk_dVb, dVgdt_dVg, dVgdt_dVd, dVgdt_dVb;
-double T0, dT0_dVg, dT0_dVd, dT0_dVb;
-double T1, dT1_dVg, dT1_dVd, dT1_dVb;
-double T2, dT2_dVg, dT2_dVd, dT2_dVb;
-double T3, dT3_dVg, dT3_dVd, dT3_dVb;
-double T4, dT4_dVg, dT4_dVd, dT4_dVb;
-double T5, dT5_dVg, dT5_dVd, dT5_dVb;
-double T6, dT6_dVg, dT6_dVd, dT6_dVb;
-double T7, dT7_dVg, dT7_dVd, dT7_dVb;
-double T8, dT8_dVg, dT8_dVd, dT8_dVb;
-double T9, dT9_dVg, dT9_dVd, dT9_dVb;
-double T10, dT10_dVg, dT10_dVb, dT10_dVd;
-double T11, T12;
-double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb;
-double T100, T101;
-double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb;
-double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb;
-double VAHCE, dVAHCE_dVg, dVAHCE_dVd, dVAHCE_dVb;
-double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb, Delt_vth, dDelt_vth_dVb;
-double Theta0, dTheta0_dVb, Theta1, dTheta1_dVb;
-double Thetarout, dThetarout_dVb, TempRatio, tmp1, tmp2, tmp3, tmp4;
-double DIBL_Sft, dDIBL_Sft_dVd, DIBL_fact, Lambda, dLambda_dVg;
-double Rout_Vgs_factor, dRout_Vgs_factor_dVg, dRout_Vgs_factor_dVb;
-double dRout_Vgs_factor_dVd, Idtot, Ibtot;
-double tempv, a1, ScalingFactor;
-
-double Vgsteff, dVgsteff_dVg, dVgsteff_dVd, dVgsteff_dVb;
-double Vdseff, dVdseff_dVg, dVdseff_dVd, dVdseff_dVb;
-double VdseffCV, dVdseffCV_dVg, dVdseffCV_dVd, dVdseffCV_dVb;
-double diffVds, diffVdsCV, dAbulk_dVg;
-double beta, dbeta_dVg, dbeta_dVd, dbeta_dVb;
-double gche, dgche_dVg, dgche_dVd, dgche_dVb;
-double fgche1, dfgche1_dVg, dfgche1_dVd, dfgche1_dVb;
-double fgche2, dfgche2_dVg, dfgche2_dVd, dfgche2_dVb;
-double Idl, dIdl_dVg, dIdl_dVd, dIdl_dVb;
-double Idsa, dIdsa_dVg, dIdsa_dVd, dIdsa_dVb;
-double Ids, Gm, Gds, Gmb;
-double Isub, Isubd, Isubs, Gbd, Gbg, Gbb;
-double VASCBE, dVASCBE_dVg, dVASCBE_dVd, dVASCBE_dVb;
-double CoxWovL;
-double Rds, dRds_dVg, dRds_dVb, WVCox, WVCoxRds;
-double Vgst2Vtm, VdsatCV, dVdsatCV_dVd, dVdsatCV_dVg, dVdsatCV_dVb;
-double Leff, Weff, dWeff_dVg, dWeff_dVb;
-double AbulkCV, dAbulkCV_dVb;
-double qgdo, qgso, cgdo, cgso;
-
-double qcheq, qdef, gqdef, cqdef, cqcheq, gtau_diff, gtau_drift, csreq;
-double gcqdb,gcqsb,gcqgb,gcqbb,vss;
-double dxpart, sxpart, ggtg, ggtd, ggts, ggtb;
-double ddxpart_dVd, ddxpart_dVg, ddxpart_dVb, ddxpart_dVs;
-double dsxpart_dVd, dsxpart_dVg, dsxpart_dVb, dsxpart_dVs;
-
-double gbspsp, gbbdp, gbbsp, gbspg, gbspb, gbspdp;
-double gbdpdp, gbdpg, gbdpb, gbdpsp;
-double Cgg, Cgd, Cgs, Cgb, Cdg, Cdd, Cds, Cdb, Qg, Qd;
-double Csg, Csd, Css, Csb, Cbg, Cbd, Cbs, Cbb, Qs, Qb;
-double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Csg1, Csd1, Csb1, Qac0, Qsub0;
-double dQac0_dVg, dQac0_dVd, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb;
-
-struct BSIM3V2SizeDependParam *pParam;
-int ByPass, Check, ChargeComputationNeeded, error;
-
-ScalingFactor = 1.0e-9;
-ChargeComputationNeeded =
- ((ckt->CKTmode & (MODEAC | MODETRAN | MODEINITSMSIG)) ||
- ((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)))
- ? 1 : 0;
-for (; model != NULL; model = model->BSIM3V2nextModel)
-{ for (here = model->BSIM3V2instances; here != NULL;
- here = here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2owner != ARCHme) continue;
- Check = 1;
- ByPass = 0;
- pParam = here->pParam;
- if ((ckt->CKTmode & MODEINITSMSIG))
- { vbs = *(ckt->CKTstate0 + here->BSIM3V2vbs);
- vgs = *(ckt->CKTstate0 + here->BSIM3V2vgs);
- vds = *(ckt->CKTstate0 + here->BSIM3V2vds);
- qdef = *(ckt->CKTstate0 + here->BSIM3V2qdef);
- }
- else if ((ckt->CKTmode & MODEINITTRAN))
- { vbs = *(ckt->CKTstate1 + here->BSIM3V2vbs);
- vgs = *(ckt->CKTstate1 + here->BSIM3V2vgs);
- vds = *(ckt->CKTstate1 + here->BSIM3V2vds);
- qdef = *(ckt->CKTstate1 + here->BSIM3V2qdef);
- }
- else if ((ckt->CKTmode & MODEINITJCT) && !here->BSIM3V2off)
- { vds = model->BSIM3V2type * here->BSIM3V2icVDS;
- vgs = model->BSIM3V2type * here->BSIM3V2icVGS;
- vbs = model->BSIM3V2type * here->BSIM3V2icVBS;
- qdef = 0.0;
-
- if ((vds == 0.0) && (vgs == 0.0) && (vbs == 0.0) &&
- ((ckt->CKTmode & (MODETRAN | MODEAC|MODEDCOP |
- MODEDCTRANCURVE)) || (!(ckt->CKTmode & MODEUIC))))
- { vbs = 0.0;
- vgs = model->BSIM3V2type * pParam->BSIM3V2vth0 + 0.1;
- vds = 0.1;
- }
- }
- else if ((ckt->CKTmode & (MODEINITJCT | MODEINITFIX)) &&
- (here->BSIM3V2off))
- { qdef = vbs = vgs = vds = 0.0;
- }
- else
- {
-#ifndef PREDICTOR
- if ((ckt->CKTmode & MODEINITPRED))
- { xfact = ckt->CKTdelta / ckt->CKTdeltaOld[1];
- *(ckt->CKTstate0 + here->BSIM3V2vbs) =
- *(ckt->CKTstate1 + here->BSIM3V2vbs);
- vbs = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM3V2vbs))
- - (xfact * (*(ckt->CKTstate2 + here->BSIM3V2vbs)));
- *(ckt->CKTstate0 + here->BSIM3V2vgs) =
- *(ckt->CKTstate1 + here->BSIM3V2vgs);
- vgs = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM3V2vgs))
- - (xfact * (*(ckt->CKTstate2 + here->BSIM3V2vgs)));
- *(ckt->CKTstate0 + here->BSIM3V2vds) =
- *(ckt->CKTstate1 + here->BSIM3V2vds);
- vds = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM3V2vds))
- - (xfact * (*(ckt->CKTstate2 + here->BSIM3V2vds)));
- *(ckt->CKTstate0 + here->BSIM3V2vbd) =
- *(ckt->CKTstate0 + here->BSIM3V2vbs)
- - *(ckt->CKTstate0 + here->BSIM3V2vds);
- *(ckt->CKTstate0 + here->BSIM3V2qdef) =
- *(ckt->CKTstate1 + here->BSIM3V2qdef);
- qdef = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM3V2qdef))
- -(xfact * (*(ckt->CKTstate2 + here->BSIM3V2qdef)));
- }
- else
- {
-#endif /* PREDICTOR */
- vbs = model->BSIM3V2type
- * (*(ckt->CKTrhsOld + here->BSIM3V2bNode)
- - *(ckt->CKTrhsOld + here->BSIM3V2sNodePrime));
- vgs = model->BSIM3V2type
- * (*(ckt->CKTrhsOld + here->BSIM3V2gNode)
- - *(ckt->CKTrhsOld + here->BSIM3V2sNodePrime));
- vds = model->BSIM3V2type
- * (*(ckt->CKTrhsOld + here->BSIM3V2dNodePrime)
- - *(ckt->CKTrhsOld + here->BSIM3V2sNodePrime));
- qdef = model->BSIM3V2type
- * (*(ckt->CKTrhsOld + here->BSIM3V2qNode));
-#ifndef PREDICTOR
- }
-#endif /* PREDICTOR */
-
- vbd = vbs - vds;
- vgd = vgs - vds;
- vgdo = *(ckt->CKTstate0 + here->BSIM3V2vgs)
- - *(ckt->CKTstate0 + here->BSIM3V2vds);
- delvbs = vbs - *(ckt->CKTstate0 + here->BSIM3V2vbs);
- delvbd = vbd - *(ckt->CKTstate0 + here->BSIM3V2vbd);
- delvgs = vgs - *(ckt->CKTstate0 + here->BSIM3V2vgs);
- delvds = vds - *(ckt->CKTstate0 + here->BSIM3V2vds);
- delvgd = vgd - vgdo;
-
- if (here->BSIM3V2mode >= 0)
- { Idtot = here->BSIM3V2cd + here->BSIM3V2csub - here->BSIM3V2cbd;
- cdhat = Idtot - here->BSIM3V2gbd * delvbd
- + (here->BSIM3V2gmbs + here->BSIM3V2gbbs) * delvbs
- + (here->BSIM3V2gm + here->BSIM3V2gbgs) * delvgs
- + (here->BSIM3V2gds + here->BSIM3V2gbds) * delvds;
- Ibtot = here->BSIM3V2cbs + here->BSIM3V2cbd - here->BSIM3V2csub;
- cbhat = Ibtot + here->BSIM3V2gbd * delvbd
- + (here->BSIM3V2gbs - here->BSIM3V2gbbs) * delvbs
- - here->BSIM3V2gbgs * delvgs
- - here->BSIM3V2gbds * delvds;
- }
- else
- { Idtot = here->BSIM3V2cd - here->BSIM3V2cbd;
- cdhat = Idtot - (here->BSIM3V2gbd - here->BSIM3V2gmbs) * delvbd
- + here->BSIM3V2gm * delvgd
- - here->BSIM3V2gds * delvds;
- Ibtot = here->BSIM3V2cbs + here->BSIM3V2cbd - here->BSIM3V2csub;
- cbhat = Ibtot + here->BSIM3V2gbs * delvbs
- + (here->BSIM3V2gbd - here->BSIM3V2gbbs) * delvbd
- - here->BSIM3V2gbgs * delvgd
- + here->BSIM3V2gbds * delvds;
- }
-
- /* following should be one big if connected by && all over
- * the place, but some C compilers can't handle that, so
- * we split it up here to let them digest it in stages
- */
-
- if ((!(ckt->CKTmode & MODEINITPRED)) && (ckt->CKTbypass))
- if ((fabs(delvbs) < (ckt->CKTreltol * MAX(fabs(vbs),
- fabs(*(ckt->CKTstate0+here->BSIM3V2vbs))) + ckt->CKTvoltTol)))
- if ((fabs(delvbd) < (ckt->CKTreltol * MAX(fabs(vbd),
- fabs(*(ckt->CKTstate0+here->BSIM3V2vbd))) + ckt->CKTvoltTol)))
- if ((fabs(delvgs) < (ckt->CKTreltol * MAX(fabs(vgs),
- fabs(*(ckt->CKTstate0+here->BSIM3V2vgs))) + ckt->CKTvoltTol)))
- if ((fabs(delvds) < (ckt->CKTreltol * MAX(fabs(vds),
- fabs(*(ckt->CKTstate0+here->BSIM3V2vds))) + ckt->CKTvoltTol)))
- if ((fabs(cdhat - Idtot) < ckt->CKTreltol
- * MAX(fabs(cdhat),fabs(Idtot)) + ckt->CKTabstol))
- { tempv = MAX(fabs(cbhat),fabs(Ibtot)) + ckt->CKTabstol;
- if ((fabs(cbhat - Ibtot)) < ckt->CKTreltol * tempv)
- { /* bypass code */
- vbs = *(ckt->CKTstate0 + here->BSIM3V2vbs);
- vbd = *(ckt->CKTstate0 + here->BSIM3V2vbd);
- vgs = *(ckt->CKTstate0 + here->BSIM3V2vgs);
- vds = *(ckt->CKTstate0 + here->BSIM3V2vds);
- qdef = *(ckt->CKTstate0 + here->BSIM3V2qdef);
-
- vgd = vgs - vds;
- vgb = vgs - vbs;
-
- cdrain = here->BSIM3V2cd;
- if ((ckt->CKTmode & (MODETRAN | MODEAC)) ||
- ((ckt->CKTmode & MODETRANOP) &&
- (ckt->CKTmode & MODEUIC)))
- { ByPass = 1;
- qgate = here->BSIM3V2qgate;
- qbulk = here->BSIM3V2qbulk;
- qdrn = here->BSIM3V2qdrn;
- goto line755;
- }
- else
- { goto line850;
- }
- }
- }
-
- von = here->BSIM3V2von;
- if (*(ckt->CKTstate0 + here->BSIM3V2vds) >= 0.0)
- { vgs = DEVfetlim(vgs, *(ckt->CKTstate0+here->BSIM3V2vgs), von);
- vds = vgs - vgd;
- vds = DEVlimvds(vds, *(ckt->CKTstate0 + here->BSIM3V2vds));
- vgd = vgs - vds;
-
- }
- else
- { vgd = DEVfetlim(vgd, vgdo, von);
- vds = vgs - vgd;
- vds = -DEVlimvds(-vds, -(*(ckt->CKTstate0+here->BSIM3V2vds)));
- vgs = vgd + vds;
- }
-
- if (vds >= 0.0)
- { vbs = DEVpnjlim(vbs, *(ckt->CKTstate0 + here->BSIM3V2vbs),
- CONSTvt0, model->BSIM3V2vcrit, &Check);
- vbd = vbs - vds;
-
- }
- else
- { vbd = DEVpnjlim(vbd, *(ckt->CKTstate0 + here->BSIM3V2vbd),
- CONSTvt0, model->BSIM3V2vcrit, &Check);
- vbs = vbd + vds;
- }
- }
-
- /* determine DC current and derivatives */
- vbd = vbs - vds;
- vgd = vgs - vds;
- vgb = vgs - vbs;
-
- /* Source/drain junction diode DC model begins */
- Nvtm = model->BSIM3V2vtm * model->BSIM3V2jctEmissionCoeff;
- if ((here->BSIM3V2sourceArea <= 0.0) && (here->BSIM3V2sourcePerimeter <= 0.0))
- { SourceSatCurrent = 1.0e-14;
- }
- else
- { SourceSatCurrent = here->BSIM3V2sourceArea
- * model->BSIM3V2jctTempSatCurDensity
- + here->BSIM3V2sourcePerimeter
- * model->BSIM3V2jctSidewallTempSatCurDensity;
- }
- if (SourceSatCurrent <= 0.0)
- { here->BSIM3V2gbs = ckt->CKTgmin;
- here->BSIM3V2cbs = here->BSIM3V2gbs * vbs;
- }
- else
- { if (model->BSIM3V2ijth == 0.0)
- { evbs = exp(vbs / Nvtm);
- here->BSIM3V2gbs = SourceSatCurrent * evbs / Nvtm + ckt->CKTgmin;
- here->BSIM3V2cbs = SourceSatCurrent * (evbs - 1.0)
- + ckt->CKTgmin * vbs;
- }
- else
- { if (vbs < here->BSIM3V2vjsm)
- { evbs = exp(vbs / Nvtm);
- here->BSIM3V2gbs = SourceSatCurrent * evbs / Nvtm + ckt->CKTgmin;
- here->BSIM3V2cbs = SourceSatCurrent * (evbs - 1.0)
- + ckt->CKTgmin * vbs;
- }
- else
- { T0 = (SourceSatCurrent + model->BSIM3V2ijth) / Nvtm;
- here->BSIM3V2gbs = T0 + ckt->CKTgmin;
- here->BSIM3V2cbs = model->BSIM3V2ijth + ckt->CKTgmin * vbs
- + T0 * (vbs - here->BSIM3V2vjsm);
- }
- }
- }
-
- if ((here->BSIM3V2drainArea <= 0.0) && (here->BSIM3V2drainPerimeter <= 0.0))
- { DrainSatCurrent = 1.0e-14;
- }
- else
- { DrainSatCurrent = here->BSIM3V2drainArea
- * model->BSIM3V2jctTempSatCurDensity
- + here->BSIM3V2drainPerimeter
- * model->BSIM3V2jctSidewallTempSatCurDensity;
- }
- if (DrainSatCurrent <= 0.0)
- { here->BSIM3V2gbd = ckt->CKTgmin;
- here->BSIM3V2cbd = here->BSIM3V2gbd * vbd;
- }
- else
- { if (model->BSIM3V2ijth == 0.0)
- { evbd = exp(vbd / Nvtm);
- here->BSIM3V2gbd = DrainSatCurrent * evbd / Nvtm + ckt->CKTgmin;
- here->BSIM3V2cbd = DrainSatCurrent * (evbd - 1.0)
- + ckt->CKTgmin * vbd;
- }
- else
- { if (vbd < here->BSIM3V2vjdm)
- { evbd = exp(vbd / Nvtm);
- here->BSIM3V2gbd = DrainSatCurrent * evbd / Nvtm + ckt->CKTgmin;
- here->BSIM3V2cbd = DrainSatCurrent * (evbd - 1.0)
- + ckt->CKTgmin * vbd;
- }
- else
- { T0 = (DrainSatCurrent + model->BSIM3V2ijth) / Nvtm;
- here->BSIM3V2gbd = T0 + ckt->CKTgmin;
- here->BSIM3V2cbd = model->BSIM3V2ijth + ckt->CKTgmin * vbd
- + T0 * (vbd - here->BSIM3V2vjdm);
- }
- }
- }
- /* End of diode DC model */
-
- if (vds >= 0.0)
- { /* normal mode */
- here->BSIM3V2mode = 1;
- Vds = vds;
- Vgs = vgs;
- Vbs = vbs;
- }
- else
- { /* inverse mode */
- here->BSIM3V2mode = -1;
- Vds = -vds;
- Vgs = vgd;
- Vbs = vbd;
- }
-
- T0 = Vbs - pParam->BSIM3V2vbsc - 0.001;
- T1 = sqrt(T0 * T0 - 0.004 * pParam->BSIM3V2vbsc);
- Vbseff = pParam->BSIM3V2vbsc + 0.5 * (T0 + T1);
- dVbseff_dVb = 0.5 * (1.0 + T0 / T1);
- if (Vbseff < Vbs)
- { Vbseff = Vbs;
- } /* Added to avoid the possible numerical problems due to computer accuracy. See comments for diffVds */
-
- if (Vbseff > 0.0)
- { T0 = pParam->BSIM3V2phi / (pParam->BSIM3V2phi + Vbseff);
- Phis = pParam->BSIM3V2phi * T0;
- dPhis_dVb = -T0 * T0;
- sqrtPhis = pParam->BSIM3V2phis3 / (pParam->BSIM3V2phi + 0.5 * Vbseff);
- dsqrtPhis_dVb = -0.5 * sqrtPhis * sqrtPhis / pParam->BSIM3V2phis3;
- }
- else
- { Phis = pParam->BSIM3V2phi - Vbseff;
- dPhis_dVb = -1.0;
- sqrtPhis = sqrt(Phis);
- dsqrtPhis_dVb = -0.5 / sqrtPhis;
- }
- Xdep = pParam->BSIM3V2Xdep0 * sqrtPhis / pParam->BSIM3V2sqrtPhi;
- dXdep_dVb = (pParam->BSIM3V2Xdep0 / pParam->BSIM3V2sqrtPhi)
- * dsqrtPhis_dVb;
-
- Leff = pParam->BSIM3V2leff;
- Vtm = model->BSIM3V2vtm;
-/* Vth Calculation */
- T3 = sqrt(Xdep);
- V0 = pParam->BSIM3V2vbi - pParam->BSIM3V2phi;
-
- T0 = pParam->BSIM3V2dvt2 * Vbseff;
- if (T0 >= - 0.5)
- { T1 = 1.0 + T0;
- T2 = pParam->BSIM3V2dvt2;
- }
- else /* Added to avoid any discontinuity problems caused by dvt2 */
- { T4 = 1.0 / (3.0 + 8.0 * T0);
- T1 = (1.0 + 3.0 * T0) * T4;
- T2 = pParam->BSIM3V2dvt2 * T4 * T4;
- }
- lt1 = model->BSIM3V2factor1 * T3 * T1;
- dlt1_dVb = model->BSIM3V2factor1 * (0.5 / T3 * T1 * dXdep_dVb + T3 * T2);
-
- T0 = pParam->BSIM3V2dvt2w * Vbseff;
- if (T0 >= - 0.5)
- { T1 = 1.0 + T0;
- T2 = pParam->BSIM3V2dvt2w;
- }
- else /* Added to avoid any discontinuity problems caused by dvt2w */
- { T4 = 1.0 / (3.0 + 8.0 * T0);
- T1 = (1.0 + 3.0 * T0) * T4;
- T2 = pParam->BSIM3V2dvt2w * T4 * T4;
- }
- ltw = model->BSIM3V2factor1 * T3 * T1;
- dltw_dVb = model->BSIM3V2factor1 * (0.5 / T3 * T1 * dXdep_dVb + T3 * T2);
-
- T0 = -0.5 * pParam->BSIM3V2dvt1 * Leff / lt1;
- if (T0 > -EXP_THRESHOLD)
- { T1 = exp(T0);
- Theta0 = T1 * (1.0 + 2.0 * T1);
- dT1_dVb = -T0 / lt1 * T1 * dlt1_dVb;
- dTheta0_dVb = (1.0 + 4.0 * T1) * dT1_dVb;
- }
- else
- { T1 = MIN_EXP;
- Theta0 = T1 * (1.0 + 2.0 * T1);
- dTheta0_dVb = 0.0;
- }
-
- here->BSIM3V2thetavth = pParam->BSIM3V2dvt0 * Theta0;
- Delt_vth = here->BSIM3V2thetavth * V0;
- dDelt_vth_dVb = pParam->BSIM3V2dvt0 * dTheta0_dVb * V0;
-
- T0 = -0.5 * pParam->BSIM3V2dvt1w * pParam->BSIM3V2weff * Leff / ltw;
- if (T0 > -EXP_THRESHOLD)
- { T1 = exp(T0);
- T2 = T1 * (1.0 + 2.0 * T1);
- dT1_dVb = -T0 / ltw * T1 * dltw_dVb;
- dT2_dVb = (1.0 + 4.0 * T1) * dT1_dVb;
- }
- else
- { T1 = MIN_EXP;
- T2 = T1 * (1.0 + 2.0 * T1);
- dT2_dVb = 0.0;
- }
-
- T0 = pParam->BSIM3V2dvt0w * T2;
- T2 = T0 * V0;
- dT2_dVb = pParam->BSIM3V2dvt0w * dT2_dVb * V0;
-
- TempRatio = ckt->CKTtemp / model->BSIM3V2tnom - 1.0;
- T0 = sqrt(1.0 + pParam->BSIM3V2nlx / Leff);
- T1 = pParam->BSIM3V2k1ox * (T0 - 1.0) * pParam->BSIM3V2sqrtPhi
- + (pParam->BSIM3V2kt1 + pParam->BSIM3V2kt1l / Leff
- + pParam->BSIM3V2kt2 * Vbseff) * TempRatio;
- tmp2 = model->BSIM3V2tox * pParam->BSIM3V2phi
- / (pParam->BSIM3V2weff + pParam->BSIM3V2w0);
-
- T3 = pParam->BSIM3V2eta0 + pParam->BSIM3V2etab * Vbseff;
- if (T3 < 1.0e-4) /* avoid discontinuity problems caused by etab */
- { T9 = 1.0 / (3.0 - 2.0e4 * T3);
- T3 = (2.0e-4 - T3) * T9;
- T4 = T9 * T9;
- }
- else
- { T4 = 1.0;
- }
- dDIBL_Sft_dVd = T3 * pParam->BSIM3V2theta0vb0;
- DIBL_Sft = dDIBL_Sft_dVd * Vds;
-
- Vth = model->BSIM3V2type * pParam->BSIM3V2vth0 - pParam->BSIM3V2k1
- * pParam->BSIM3V2sqrtPhi + pParam->BSIM3V2k1ox * sqrtPhis
- - pParam->BSIM3V2k2ox * Vbseff - Delt_vth - T2 + (pParam->BSIM3V2k3
- + pParam->BSIM3V2k3b * Vbseff) * tmp2 + T1 - DIBL_Sft;
-
- here->BSIM3V2von = Vth;
-
- dVth_dVb = pParam->BSIM3V2k1ox * dsqrtPhis_dVb - pParam->BSIM3V2k2ox
- - dDelt_vth_dVb - dT2_dVb + pParam->BSIM3V2k3b * tmp2
- - pParam->BSIM3V2etab * Vds * pParam->BSIM3V2theta0vb0 * T4
- + pParam->BSIM3V2kt2 * TempRatio;
- dVth_dVd = -dDIBL_Sft_dVd;
-
-/* Calculate n */
- tmp2 = pParam->BSIM3V2nfactor * EPSSI / Xdep;
- tmp3 = pParam->BSIM3V2cdsc + pParam->BSIM3V2cdscb * Vbseff
- + pParam->BSIM3V2cdscd * Vds;
- tmp4 = (tmp2 + tmp3 * Theta0 + pParam->BSIM3V2cit) / model->BSIM3V2cox;
- if (tmp4 >= -0.5)
- { n = 1.0 + tmp4;
- dn_dVb = (-tmp2 / Xdep * dXdep_dVb + tmp3 * dTheta0_dVb
- + pParam->BSIM3V2cdscb * Theta0) / model->BSIM3V2cox;
- dn_dVd = pParam->BSIM3V2cdscd * Theta0 / model->BSIM3V2cox;
- }
- else
- /* avoid discontinuity problems caused by tmp4 */
- { T0 = 1.0 / (3.0 + 8.0 * tmp4);
- n = (1.0 + 3.0 * tmp4) * T0;
- T0 *= T0;
- dn_dVb = (-tmp2 / Xdep * dXdep_dVb + tmp3 * dTheta0_dVb
- + pParam->BSIM3V2cdscb * Theta0) / model->BSIM3V2cox * T0;
- dn_dVd = pParam->BSIM3V2cdscd * Theta0 / model->BSIM3V2cox * T0;
- }
-
-/* Poly Gate Si Depletion Effect */
- T0 = pParam->BSIM3V2vfb + pParam->BSIM3V2phi;
- if ((pParam->BSIM3V2ngate > 1.e18) && (pParam->BSIM3V2ngate < 1.e25)
- && (Vgs > T0))
- /* added to avoid the problem caused by ngate */
- { T1 = 1.0e6 * Charge_q * EPSSI * pParam->BSIM3V2ngate
- / (model->BSIM3V2cox * model->BSIM3V2cox);
- T4 = sqrt(1.0 + 2.0 * (Vgs - T0) / T1);
- T2 = T1 * (T4 - 1.0);
- T3 = 0.5 * T2 * T2 / T1; /* T3 = Vpoly */
- T7 = 1.12 - T3 - 0.05;
- T6 = sqrt(T7 * T7 + 0.224);
- T5 = 1.12 - 0.5 * (T7 + T6);
- Vgs_eff = Vgs - T5;
- dVgs_eff_dVg = 1.0 - (0.5 - 0.5 / T4) * (1.0 + T7 / T6);
- }
- else
- { Vgs_eff = Vgs;
- dVgs_eff_dVg = 1.0;
- }
- Vgst = Vgs_eff - Vth;
-
-/* Effective Vgst (Vgsteff) Calculation */
-
- T10 = 2.0 * n * Vtm;
- VgstNVt = Vgst / T10;
- ExpArg = (2.0 * pParam->BSIM3V2voff - Vgst) / T10;
-
- /* MCJ: Very small Vgst */
- if (VgstNVt > EXP_THRESHOLD)
- { Vgsteff = Vgst;
- dVgsteff_dVg = dVgs_eff_dVg;
- dVgsteff_dVd = -dVth_dVd;
- dVgsteff_dVb = -dVth_dVb;
- }
- else if (ExpArg > EXP_THRESHOLD)
- { T0 = (Vgst - pParam->BSIM3V2voff) / (n * Vtm);
- ExpVgst = exp(T0);
- Vgsteff = Vtm * pParam->BSIM3V2cdep0 / model->BSIM3V2cox * ExpVgst;
- dVgsteff_dVg = Vgsteff / (n * Vtm);
- dVgsteff_dVd = -dVgsteff_dVg * (dVth_dVd + T0 * Vtm * dn_dVd);
- dVgsteff_dVb = -dVgsteff_dVg * (dVth_dVb + T0 * Vtm * dn_dVb);
- dVgsteff_dVg *= dVgs_eff_dVg;
- }
- else
- { ExpVgst = exp(VgstNVt);
- T1 = T10 * log(1.0 + ExpVgst);
- dT1_dVg = ExpVgst / (1.0 + ExpVgst);
- dT1_dVb = -dT1_dVg * (dVth_dVb + Vgst / n * dn_dVb)
- + T1 / n * dn_dVb;
- dT1_dVd = -dT1_dVg * (dVth_dVd + Vgst / n * dn_dVd)
- + T1 / n * dn_dVd;
-
- dT2_dVg = -model->BSIM3V2cox / (Vtm * pParam->BSIM3V2cdep0)
- * exp(ExpArg);
- T2 = 1.0 - T10 * dT2_dVg;
- dT2_dVd = -dT2_dVg * (dVth_dVd - 2.0 * Vtm * ExpArg * dn_dVd)
- + (T2 - 1.0) / n * dn_dVd;
- dT2_dVb = -dT2_dVg * (dVth_dVb - 2.0 * Vtm * ExpArg * dn_dVb)
- + (T2 - 1.0) / n * dn_dVb;
-
- Vgsteff = T1 / T2;
- T3 = T2 * T2;
- dVgsteff_dVg = (T2 * dT1_dVg - T1 * dT2_dVg) / T3 * dVgs_eff_dVg;
- dVgsteff_dVd = (T2 * dT1_dVd - T1 * dT2_dVd) / T3;
- dVgsteff_dVb = (T2 * dT1_dVb - T1 * dT2_dVb) / T3;
- }
-
-/* Calculate Effective Channel Geometry */
- T9 = sqrtPhis - pParam->BSIM3V2sqrtPhi;
- Weff = pParam->BSIM3V2weff - 2.0 * (pParam->BSIM3V2dwg * Vgsteff
- + pParam->BSIM3V2dwb * T9);
- dWeff_dVg = -2.0 * pParam->BSIM3V2dwg;
- dWeff_dVb = -2.0 * pParam->BSIM3V2dwb * dsqrtPhis_dVb;
-
- if (Weff < 2.0e-8) /* to avoid the discontinuity problem due to Weff*/
- { T0 = 1.0 / (6.0e-8 - 2.0 * Weff);
- Weff = 2.0e-8 * (4.0e-8 - Weff) * T0;
- T0 *= T0 * 4.0e-16;
- dWeff_dVg *= T0;
- dWeff_dVb *= T0;
- }
-
- T0 = pParam->BSIM3V2prwg * Vgsteff + pParam->BSIM3V2prwb * T9;
- if (T0 >= -0.9)
- { Rds = pParam->BSIM3V2rds0 * (1.0 + T0);
- dRds_dVg = pParam->BSIM3V2rds0 * pParam->BSIM3V2prwg;
- dRds_dVb = pParam->BSIM3V2rds0 * pParam->BSIM3V2prwb * dsqrtPhis_dVb;
- }
- else
- /* to avoid the discontinuity problem due to prwg and prwb*/
- { T1 = 1.0 / (17.0 + 20.0 * T0);
- Rds = pParam->BSIM3V2rds0 * (0.8 + T0) * T1;
- T1 *= T1;
- dRds_dVg = pParam->BSIM3V2rds0 * pParam->BSIM3V2prwg * T1;
- dRds_dVb = pParam->BSIM3V2rds0 * pParam->BSIM3V2prwb * dsqrtPhis_dVb
- * T1;
- }
-
-/* Calculate Abulk */
- T1 = 0.5 * pParam->BSIM3V2k1ox / sqrtPhis;
- dT1_dVb = -T1 / sqrtPhis * dsqrtPhis_dVb;
-
- T9 = sqrt(pParam->BSIM3V2xj * Xdep);
- tmp1 = Leff + 2.0 * T9;
- T5 = Leff / tmp1;
- tmp2 = pParam->BSIM3V2a0 * T5;
- tmp3 = pParam->BSIM3V2weff + pParam->BSIM3V2b1;
- tmp4 = pParam->BSIM3V2b0 / tmp3;
- T2 = tmp2 + tmp4;
- dT2_dVb = -T9 / tmp1 / Xdep * dXdep_dVb;
- T6 = T5 * T5;
- T7 = T5 * T6;
-
- Abulk0 = 1.0 + T1 * T2;
- dAbulk0_dVb = T1 * tmp2 * dT2_dVb + T2 * dT1_dVb;
-
- T8 = pParam->BSIM3V2ags * pParam->BSIM3V2a0 * T7;
- dAbulk_dVg = -T1 * T8;
- Abulk = Abulk0 + dAbulk_dVg * Vgsteff;
- dAbulk_dVb = dAbulk0_dVb - T8 * Vgsteff * (dT1_dVb
- + 3.0 * T1 * dT2_dVb);
-
- if (Abulk0 < 0.1) /* added to avoid the problems caused by Abulk0 */
- { T9 = 1.0 / (3.0 - 20.0 * Abulk0);
- Abulk0 = (0.2 - Abulk0) * T9;
- dAbulk0_dVb *= T9 * T9;
- }
-
- if (Abulk < 0.1)
- /* added to avoid the problems caused by Abulk */
- { T9 = 1.0 / (3.0 - 20.0 * Abulk);
- Abulk = (0.2 - Abulk) * T9;
- dAbulk_dVb *= T9 * T9;
- }
-
- T2 = pParam->BSIM3V2keta * Vbseff;
- if (T2 >= -0.9)
- { T0 = 1.0 / (1.0 + T2);
- dT0_dVb = -pParam->BSIM3V2keta * T0 * T0;
- }
- else
- /* added to avoid the problems caused by Keta */
- { T1 = 1.0 / (0.8 + T2);
- T0 = (17.0 + 20.0 * T2) * T1;
- dT0_dVb = -pParam->BSIM3V2keta * T1 * T1;
- }
- dAbulk_dVg *= T0;
- dAbulk_dVb = dAbulk_dVb * T0 + Abulk * dT0_dVb;
- dAbulk0_dVb = dAbulk0_dVb * T0 + Abulk0 * dT0_dVb;
- Abulk *= T0;
- Abulk0 *= T0;
-
-
-/* Mobility calculation */
- if (model->BSIM3V2mobMod == 1)
- { T0 = Vgsteff + Vth + Vth;
- T2 = pParam->BSIM3V2ua + pParam->BSIM3V2uc * Vbseff;
- T3 = T0 / model->BSIM3V2tox;
- T5 = T3 * (T2 + pParam->BSIM3V2ub * T3);
- dDenomi_dVg = (T2 + 2.0 * pParam->BSIM3V2ub * T3) / model->BSIM3V2tox;
- dDenomi_dVd = dDenomi_dVg * 2.0 * dVth_dVd;
- dDenomi_dVb = dDenomi_dVg * 2.0 * dVth_dVb + pParam->BSIM3V2uc * T3;
- }
- else if (model->BSIM3V2mobMod == 2)
- { T5 = Vgsteff / model->BSIM3V2tox * (pParam->BSIM3V2ua
- + pParam->BSIM3V2uc * Vbseff + pParam->BSIM3V2ub * Vgsteff
- / model->BSIM3V2tox);
- dDenomi_dVg = (pParam->BSIM3V2ua + pParam->BSIM3V2uc * Vbseff
- + 2.0 * pParam->BSIM3V2ub * Vgsteff / model->BSIM3V2tox)
- / model->BSIM3V2tox;
- dDenomi_dVd = 0.0;
- dDenomi_dVb = Vgsteff * pParam->BSIM3V2uc / model->BSIM3V2tox;
- }
- else
- { T0 = Vgsteff + Vth + Vth;
- T2 = 1.0 + pParam->BSIM3V2uc * Vbseff;
- T3 = T0 / model->BSIM3V2tox;
- T4 = T3 * (pParam->BSIM3V2ua + pParam->BSIM3V2ub * T3);
- T5 = T4 * T2;
- dDenomi_dVg = (pParam->BSIM3V2ua + 2.0 * pParam->BSIM3V2ub * T3) * T2
- / model->BSIM3V2tox;
- dDenomi_dVd = dDenomi_dVg * 2.0 * dVth_dVd;
- dDenomi_dVb = dDenomi_dVg * 2.0 * dVth_dVb + pParam->BSIM3V2uc * T4;
- }
-
- if (T5 >= -0.8)
- { Denomi = 1.0 + T5;
- }
- else /* Added to avoid the discontinuity problem caused by ua and ub*/
- { T9 = 1.0 / (7.0 + 10.0 * T5);
- Denomi = (0.6 + T5) * T9;
- T9 *= T9;
- dDenomi_dVg *= T9;
- dDenomi_dVd *= T9;
- dDenomi_dVb *= T9;
- }
-
- here->BSIM3V2ueff = ueff = pParam->BSIM3V2u0temp / Denomi;
- T9 = -ueff / Denomi;
- dueff_dVg = T9 * dDenomi_dVg;
- dueff_dVd = T9 * dDenomi_dVd;
- dueff_dVb = T9 * dDenomi_dVb;
-
-/* Saturation Drain Voltage Vdsat */
- WVCox = Weff * pParam->BSIM3V2vsattemp * model->BSIM3V2cox;
- WVCoxRds = WVCox * Rds;
-
- Esat = 2.0 * pParam->BSIM3V2vsattemp / ueff;
- EsatL = Esat * Leff;
- T0 = -EsatL /ueff;
- dEsatL_dVg = T0 * dueff_dVg;
- dEsatL_dVd = T0 * dueff_dVd;
- dEsatL_dVb = T0 * dueff_dVb;
-
- /* Sqrt() */
- a1 = pParam->BSIM3V2a1;
- if (a1 == 0.0)
- { Lambda = pParam->BSIM3V2a2;
- dLambda_dVg = 0.0;
- }
- else if (a1 > 0.0)
-/* Added to avoid the discontinuity problem
- caused by a1 and a2 (Lambda) */
- { T0 = 1.0 - pParam->BSIM3V2a2;
- T1 = T0 - pParam->BSIM3V2a1 * Vgsteff - 0.0001;
- T2 = sqrt(T1 * T1 + 0.0004 * T0);
- Lambda = pParam->BSIM3V2a2 + T0 - 0.5 * (T1 + T2);
- dLambda_dVg = 0.5 * pParam->BSIM3V2a1 * (1.0 + T1 / T2);
- }
- else
- { T1 = pParam->BSIM3V2a2 + pParam->BSIM3V2a1 * Vgsteff - 0.0001;
- T2 = sqrt(T1 * T1 + 0.0004 * pParam->BSIM3V2a2);
- Lambda = 0.5 * (T1 + T2);
- dLambda_dVg = 0.5 * pParam->BSIM3V2a1 * (1.0 + T1 / T2);
- }
-
- Vgst2Vtm = Vgsteff + 2.0 * Vtm;
- if (Rds > 0)
- { tmp2 = dRds_dVg / Rds + dWeff_dVg / Weff;
- tmp3 = dRds_dVb / Rds + dWeff_dVb / Weff;
- }
- else
- { tmp2 = dWeff_dVg / Weff;
- tmp3 = dWeff_dVb / Weff;
- }
- if ((Rds == 0.0) && (Lambda == 1.0))
- { T0 = 1.0 / (Abulk * EsatL + Vgst2Vtm);
- tmp1 = 0.0;
- T1 = T0 * T0;
- T2 = Vgst2Vtm * T0;
- T3 = EsatL * Vgst2Vtm;
- Vdsat = T3 * T0;
-
- dT0_dVg = -(Abulk * dEsatL_dVg + EsatL * dAbulk_dVg + 1.0) * T1;
- dT0_dVd = -(Abulk * dEsatL_dVd) * T1;
- dT0_dVb = -(Abulk * dEsatL_dVb + dAbulk_dVb * EsatL) * T1;
-
- dVdsat_dVg = T3 * dT0_dVg + T2 * dEsatL_dVg + EsatL * T0;
- dVdsat_dVd = T3 * dT0_dVd + T2 * dEsatL_dVd;
- dVdsat_dVb = T3 * dT0_dVb + T2 * dEsatL_dVb;
- }
- else
- { tmp1 = dLambda_dVg / (Lambda * Lambda);
- T9 = Abulk * WVCoxRds;
- T8 = Abulk * T9;
- T7 = Vgst2Vtm * T9;
- T6 = Vgst2Vtm * WVCoxRds;
- T0 = 2.0 * Abulk * (T9 - 1.0 + 1.0 / Lambda);
- dT0_dVg = 2.0 * (T8 * tmp2 - Abulk * tmp1
- + (2.0 * T9 + 1.0 / Lambda - 1.0) * dAbulk_dVg);
-
- dT0_dVb = 2.0 * (T8 * (2.0 / Abulk * dAbulk_dVb + tmp3)
- + (1.0 / Lambda - 1.0) * dAbulk_dVb);
- dT0_dVd = 0.0;
- T1 = Vgst2Vtm * (2.0 / Lambda - 1.0) + Abulk * EsatL + 3.0 * T7;
-
- dT1_dVg = (2.0 / Lambda - 1.0) - 2.0 * Vgst2Vtm * tmp1
- + Abulk * dEsatL_dVg + EsatL * dAbulk_dVg + 3.0 * (T9
- + T7 * tmp2 + T6 * dAbulk_dVg);
- dT1_dVb = Abulk * dEsatL_dVb + EsatL * dAbulk_dVb
- + 3.0 * (T6 * dAbulk_dVb + T7 * tmp3);
- dT1_dVd = Abulk * dEsatL_dVd;
-
- T2 = Vgst2Vtm * (EsatL + 2.0 * T6);
- dT2_dVg = EsatL + Vgst2Vtm * dEsatL_dVg
- + T6 * (4.0 + 2.0 * Vgst2Vtm * tmp2);
- dT2_dVb = Vgst2Vtm * (dEsatL_dVb + 2.0 * T6 * tmp3);
- dT2_dVd = Vgst2Vtm * dEsatL_dVd;
-
- T3 = sqrt(T1 * T1 - 2.0 * T0 * T2);
- Vdsat = (T1 - T3) / T0;
-
- dT3_dVg = (T1 * dT1_dVg - 2.0 * (T0 * dT2_dVg + T2 * dT0_dVg))
- / T3;
- dT3_dVd = (T1 * dT1_dVd - 2.0 * (T0 * dT2_dVd + T2 * dT0_dVd))
- / T3;
- dT3_dVb = (T1 * dT1_dVb - 2.0 * (T0 * dT2_dVb + T2 * dT0_dVb))
- / T3;
-
- dVdsat_dVg = (dT1_dVg - (T1 * dT1_dVg - dT0_dVg * T2
- - T0 * dT2_dVg) / T3 - Vdsat * dT0_dVg) / T0;
- dVdsat_dVb = (dT1_dVb - (T1 * dT1_dVb - dT0_dVb * T2
- - T0 * dT2_dVb) / T3 - Vdsat * dT0_dVb) / T0;
- dVdsat_dVd = (dT1_dVd - (T1 * dT1_dVd - T0 * dT2_dVd) / T3) / T0;
- }
- here->BSIM3V2vdsat = Vdsat;
-
-/* Effective Vds (Vdseff) Calculation */
- T1 = Vdsat - Vds - pParam->BSIM3V2delta;
- dT1_dVg = dVdsat_dVg;
- dT1_dVd = dVdsat_dVd - 1.0;
- dT1_dVb = dVdsat_dVb;
-
- T2 = sqrt(T1 * T1 + 4.0 * pParam->BSIM3V2delta * Vdsat);
- T0 = T1 / T2;
- T3 = 2.0 * pParam->BSIM3V2delta / T2;
- dT2_dVg = T0 * dT1_dVg + T3 * dVdsat_dVg;
- dT2_dVd = T0 * dT1_dVd + T3 * dVdsat_dVd;
- dT2_dVb = T0 * dT1_dVb + T3 * dVdsat_dVb;
-
- Vdseff = Vdsat - 0.5 * (T1 + T2);
- dVdseff_dVg = dVdsat_dVg - 0.5 * (dT1_dVg + dT2_dVg);
- dVdseff_dVd = dVdsat_dVd - 0.5 * (dT1_dVd + dT2_dVd);
- dVdseff_dVb = dVdsat_dVb - 0.5 * (dT1_dVb + dT2_dVb);
-
-/* Calculate VAsat */
- tmp4 = 1.0 - 0.5 * Abulk * Vdsat / Vgst2Vtm;
- T9 = WVCoxRds * Vgsteff;
- T8 = T9 / Vgst2Vtm;
- T0 = EsatL + Vdsat + 2.0 * T9 * tmp4;
-
- T7 = 2.0 * WVCoxRds * tmp4;
- dT0_dVg = dEsatL_dVg + dVdsat_dVg + T7 * (1.0 + tmp2 * Vgsteff)
- - T8 * (Abulk * dVdsat_dVg - Abulk * Vdsat / Vgst2Vtm
- + Vdsat * dAbulk_dVg);
-
- dT0_dVb = dEsatL_dVb + dVdsat_dVb + T7 * tmp3 * Vgsteff
- - T8 * (dAbulk_dVb * Vdsat + Abulk * dVdsat_dVb);
- dT0_dVd = dEsatL_dVd + dVdsat_dVd - T8 * Abulk * dVdsat_dVd;
-
- T9 = WVCoxRds * Abulk;
- T1 = 2.0 / Lambda - 1.0 + T9;
- dT1_dVg = -2.0 * tmp1 + WVCoxRds * (Abulk * tmp2 + dAbulk_dVg);
- dT1_dVb = dAbulk_dVb * WVCoxRds + T9 * tmp3;
-
- Vasat = T0 / T1;
- dVasat_dVg = (dT0_dVg - Vasat * dT1_dVg) / T1;
- dVasat_dVb = (dT0_dVb - Vasat * dT1_dVb) / T1;
- dVasat_dVd = dT0_dVd / T1;
-
- if (Vdseff > Vds)
- Vdseff = Vds; /* This code is added to fixed the problem
- caused by computer precision when
- Vds is very close to Vdseff. */
- diffVds = Vds - Vdseff;
-/* Calculate VACLM */
- if ((pParam->BSIM3V2pclm > 0.0) && (diffVds > 1.0e-10))
- { T0 = 1.0 / (pParam->BSIM3V2pclm * Abulk * pParam->BSIM3V2litl);
- dT0_dVb = -T0 / Abulk * dAbulk_dVb;
- dT0_dVg = -T0 / Abulk * dAbulk_dVg;
-
- T2 = Vgsteff / EsatL;
- T1 = Leff * (Abulk + T2);
- dT1_dVg = Leff * ((1.0 - T2 * dEsatL_dVg) / EsatL + dAbulk_dVg);
- dT1_dVb = Leff * (dAbulk_dVb - T2 * dEsatL_dVb / EsatL);
- dT1_dVd = -T2 * dEsatL_dVd / Esat;
-
- T9 = T0 * T1;
- VACLM = T9 * diffVds;
- dVACLM_dVg = T0 * dT1_dVg * diffVds - T9 * dVdseff_dVg
- + T1 * diffVds * dT0_dVg;
- dVACLM_dVb = (dT0_dVb * T1 + T0 * dT1_dVb) * diffVds
- - T9 * dVdseff_dVb;
- dVACLM_dVd = T0 * dT1_dVd * diffVds + T9 * (1.0 - dVdseff_dVd);
- }
- else
- { VACLM = MAX_EXP;
- dVACLM_dVd = dVACLM_dVg = dVACLM_dVb = 0.0;
- }
-
-/* Calculate VADIBL */
- if (pParam->BSIM3V2thetaRout > 0.0)
- { T8 = Abulk * Vdsat;
- T0 = Vgst2Vtm * T8;
- dT0_dVg = Vgst2Vtm * Abulk * dVdsat_dVg + T8
- + Vgst2Vtm * Vdsat * dAbulk_dVg;
- dT0_dVb = Vgst2Vtm * (dAbulk_dVb * Vdsat + Abulk * dVdsat_dVb);
- dT0_dVd = Vgst2Vtm * Abulk * dVdsat_dVd;
-
- T1 = Vgst2Vtm + T8;
- dT1_dVg = 1.0 + Abulk * dVdsat_dVg + Vdsat * dAbulk_dVg;
- dT1_dVb = Abulk * dVdsat_dVb + dAbulk_dVb * Vdsat;
- dT1_dVd = Abulk * dVdsat_dVd;
-
- T9 = T1 * T1;
- T2 = pParam->BSIM3V2thetaRout;
- VADIBL = (Vgst2Vtm - T0 / T1) / T2;
- dVADIBL_dVg = (1.0 - dT0_dVg / T1 + T0 * dT1_dVg / T9) / T2;
- dVADIBL_dVb = (-dT0_dVb / T1 + T0 * dT1_dVb / T9) / T2;
- dVADIBL_dVd = (-dT0_dVd / T1 + T0 * dT1_dVd / T9) / T2;
-
- T7 = pParam->BSIM3V2pdiblb * Vbseff;
- if (T7 >= -0.9)
- { T3 = 1.0 / (1.0 + T7);
- VADIBL *= T3;
- dVADIBL_dVg *= T3;
- dVADIBL_dVb = (dVADIBL_dVb - VADIBL * pParam->BSIM3V2pdiblb)
- * T3;
- dVADIBL_dVd *= T3;
- }
- else
-/* Added to avoid the discontinuity problem caused by pdiblcb */
- { T4 = 1.0 / (0.8 + T7);
- T3 = (17.0 + 20.0 * T7) * T4;
- dVADIBL_dVg *= T3;
- dVADIBL_dVb = dVADIBL_dVb * T3
- - VADIBL * pParam->BSIM3V2pdiblb * T4 * T4;
- dVADIBL_dVd *= T3;
- VADIBL *= T3;
- }
- }
- else
- { VADIBL = MAX_EXP;
- dVADIBL_dVd = dVADIBL_dVg = dVADIBL_dVb = 0.0;
- }
-
-/* Calculate VA */
-
- T8 = pParam->BSIM3V2pvag / EsatL;
- T9 = T8 * Vgsteff;
- if (T9 > -0.9)
- { T0 = 1.0 + T9;
- dT0_dVg = T8 * (1.0 - Vgsteff * dEsatL_dVg / EsatL);
- dT0_dVb = -T9 * dEsatL_dVb / EsatL;
- dT0_dVd = -T9 * dEsatL_dVd / EsatL;
- }
- else /* Added to avoid the discontinuity problems caused by pvag */
- { T1 = 1.0 / (17.0 + 20.0 * T9);
- T0 = (0.8 + T9) * T1;
- T1 *= T1;
- dT0_dVg = T8 * (1.0 - Vgsteff * dEsatL_dVg / EsatL) * T1;
-
- T9 *= T1 / EsatL;
- dT0_dVb = -T9 * dEsatL_dVb;
- dT0_dVd = -T9 * dEsatL_dVd;
- }
-
- tmp1 = VACLM * VACLM;
- tmp2 = VADIBL * VADIBL;
- tmp3 = VACLM + VADIBL;
-
- T1 = VACLM * VADIBL / tmp3;
- tmp3 *= tmp3;
- dT1_dVg = (tmp1 * dVADIBL_dVg + tmp2 * dVACLM_dVg) / tmp3;
- dT1_dVd = (tmp1 * dVADIBL_dVd + tmp2 * dVACLM_dVd) / tmp3;
- dT1_dVb = (tmp1 * dVADIBL_dVb + tmp2 * dVACLM_dVb) / tmp3;
-
- Va = Vasat + T0 * T1;
- dVa_dVg = dVasat_dVg + T1 * dT0_dVg + T0 * dT1_dVg;
- dVa_dVd = dVasat_dVd + T1 * dT0_dVd + T0 * dT1_dVd;
- dVa_dVb = dVasat_dVb + T1 * dT0_dVb + T0 * dT1_dVb;
-
-/* Calculate VASCBE */
- if (pParam->BSIM3V2pscbe2 > 0.0)
- { if (diffVds > pParam->BSIM3V2pscbe1 * pParam->BSIM3V2litl
- / EXP_THRESHOLD)
- { T0 = pParam->BSIM3V2pscbe1 * pParam->BSIM3V2litl / diffVds;
- VASCBE = Leff * exp(T0) / pParam->BSIM3V2pscbe2;
- T1 = T0 * VASCBE / diffVds;
- dVASCBE_dVg = T1 * dVdseff_dVg;
- dVASCBE_dVd = -T1 * (1.0 - dVdseff_dVd);
- dVASCBE_dVb = T1 * dVdseff_dVb;
- }
- else
- { VASCBE = MAX_EXP * Leff/pParam->BSIM3V2pscbe2;
- dVASCBE_dVg = dVASCBE_dVd = dVASCBE_dVb = 0.0;
- }
- }
- else
- { VASCBE = MAX_EXP;
- dVASCBE_dVg = dVASCBE_dVd = dVASCBE_dVb = 0.0;
- }
-
-/* Calculate Ids */
- CoxWovL = model->BSIM3V2cox * Weff / Leff;
- beta = ueff * CoxWovL;
- dbeta_dVg = CoxWovL * dueff_dVg + beta * dWeff_dVg / Weff;
- dbeta_dVd = CoxWovL * dueff_dVd;
- dbeta_dVb = CoxWovL * dueff_dVb + beta * dWeff_dVb / Weff;
-
- T0 = 1.0 - 0.5 * Abulk * Vdseff / Vgst2Vtm;
- dT0_dVg = -0.5 * (Abulk * dVdseff_dVg
- - Abulk * Vdseff / Vgst2Vtm + Vdseff * dAbulk_dVg) / Vgst2Vtm;
- dT0_dVd = -0.5 * Abulk * dVdseff_dVd / Vgst2Vtm;
- dT0_dVb = -0.5 * (Abulk * dVdseff_dVb + dAbulk_dVb * Vdseff)
- / Vgst2Vtm;
-
- fgche1 = Vgsteff * T0;
- dfgche1_dVg = Vgsteff * dT0_dVg + T0;
- dfgche1_dVd = Vgsteff * dT0_dVd;
- dfgche1_dVb = Vgsteff * dT0_dVb;
-
- T9 = Vdseff / EsatL;
- fgche2 = 1.0 + T9;
- dfgche2_dVg = (dVdseff_dVg - T9 * dEsatL_dVg) / EsatL;
- dfgche2_dVd = (dVdseff_dVd - T9 * dEsatL_dVd) / EsatL;
- dfgche2_dVb = (dVdseff_dVb - T9 * dEsatL_dVb) / EsatL;
-
- gche = beta * fgche1 / fgche2;
- dgche_dVg = (beta * dfgche1_dVg + fgche1 * dbeta_dVg
- - gche * dfgche2_dVg) / fgche2;
- dgche_dVd = (beta * dfgche1_dVd + fgche1 * dbeta_dVd
- - gche * dfgche2_dVd) / fgche2;
- dgche_dVb = (beta * dfgche1_dVb + fgche1 * dbeta_dVb
- - gche * dfgche2_dVb) / fgche2;
-
- T0 = 1.0 + gche * Rds;
- T9 = Vdseff / T0;
- Idl = gche * T9;
-
- dIdl_dVg = (gche * dVdseff_dVg + T9 * dgche_dVg) / T0
- - Idl * gche / T0 * dRds_dVg ;
-
- dIdl_dVd = (gche * dVdseff_dVd + T9 * dgche_dVd) / T0;
- dIdl_dVb = (gche * dVdseff_dVb + T9 * dgche_dVb
- - Idl * dRds_dVb * gche) / T0;
-
- T9 = diffVds / Va;
- T0 = 1.0 + T9;
- Idsa = Idl * T0;
- dIdsa_dVg = T0 * dIdl_dVg - Idl * (dVdseff_dVg + T9 * dVa_dVg) / Va;
- dIdsa_dVd = T0 * dIdl_dVd + Idl * (1.0 - dVdseff_dVd
- - T9 * dVa_dVd) / Va;
- dIdsa_dVb = T0 * dIdl_dVb - Idl * (dVdseff_dVb + T9 * dVa_dVb) / Va;
-
- T9 = diffVds / VASCBE;
- T0 = 1.0 + T9;
- Ids = Idsa * T0;
-
- Gm = T0 * dIdsa_dVg - Idsa * (dVdseff_dVg + T9 * dVASCBE_dVg) / VASCBE;
- Gds = T0 * dIdsa_dVd + Idsa * (1.0 - dVdseff_dVd
- - T9 * dVASCBE_dVd) / VASCBE;
- Gmb = T0 * dIdsa_dVb - Idsa * (dVdseff_dVb
- + T9 * dVASCBE_dVb) / VASCBE;
-
- Gds += Gm * dVgsteff_dVd;
- Gmb += Gm * dVgsteff_dVb;
- Gm *= dVgsteff_dVg;
- Gmb *= dVbseff_dVb;
-
- /* Substrate current begins */
- tmp = pParam->BSIM3V2alpha0 + pParam->BSIM3V2alpha1 * Leff;
- if ((tmp <= 0.0) || (pParam->BSIM3V2beta0 <= 0.0))
- { Isub = Gbd = Gbb = Gbg = 0.0;
- }
- else
- { T2 = tmp / Leff;
- if (diffVds > pParam->BSIM3V2beta0 / EXP_THRESHOLD)
- { T0 = -pParam->BSIM3V2beta0 / diffVds;
- T1 = T2 * diffVds * exp(T0);
- T3 = T1 / diffVds * (T0 - 1.0);
- dT1_dVg = T3 * dVdseff_dVg;
- dT1_dVd = T3 * (dVdseff_dVd - 1.0);
- dT1_dVb = T3 * dVdseff_dVb;
- }
- else
- { T3 = T2 * MIN_EXP;
- T1 = T3 * diffVds;
- dT1_dVg = -T3 * dVdseff_dVg;
- dT1_dVd = T3 * (1.0 - dVdseff_dVd);
- dT1_dVb = -T3 * dVdseff_dVb;
- }
- Isub = T1 * Idsa;
- Gbg = T1 * dIdsa_dVg + Idsa * dT1_dVg;
- Gbd = T1 * dIdsa_dVd + Idsa * dT1_dVd;
- Gbb = T1 * dIdsa_dVb + Idsa * dT1_dVb;
-
- Gbd += Gbg * dVgsteff_dVd;
- Gbb += Gbg * dVgsteff_dVb;
- Gbg *= dVgsteff_dVg;
- Gbb *= dVbseff_dVb; /* bug fixing */
- }
-
- cdrain = Ids;
- here->BSIM3V2gds = Gds;
- here->BSIM3V2gm = Gm;
- here->BSIM3V2gmbs = Gmb;
-
- here->BSIM3V2gbbs = Gbb;
- here->BSIM3V2gbgs = Gbg;
- here->BSIM3V2gbds = Gbd;
-
- here->BSIM3V2csub = Isub;
-
- /* BSIM3V2 thermal noise Qinv calculated from all capMod
- * 0, 1, 2 & 3 stored in here->BSIM3V2qinv 1/1998 */
-
- if ((model->BSIM3V2xpart < 0) || (!ChargeComputationNeeded))
- { qgate = qdrn = qsrc = qbulk = 0.0;
- here->BSIM3V2cggb = here->BSIM3V2cgsb = here->BSIM3V2cgdb = 0.0;
- here->BSIM3V2cdgb = here->BSIM3V2cdsb = here->BSIM3V2cddb = 0.0;
- here->BSIM3V2cbgb = here->BSIM3V2cbsb = here->BSIM3V2cbdb = 0.0;
- here->BSIM3V2cqdb = here->BSIM3V2cqsb = here->BSIM3V2cqgb
- = here->BSIM3V2cqbb = 0.0;
- here->BSIM3V2gtau = 0.0;
- goto finished;
- }
- else if (model->BSIM3V2capMod == 0)
- {
- if (Vbseff < 0.0)
- { Vbseff = Vbs;
- dVbseff_dVb = 1.0;
- }
- else
- { Vbseff = pParam->BSIM3V2phi - Phis;
- dVbseff_dVb = -dPhis_dVb;
- }
-
- Vfb = pParam->BSIM3V2vfbcv;
- Vth = Vfb + pParam->BSIM3V2phi + pParam->BSIM3V2k1ox * sqrtPhis;
- Vgst = Vgs_eff - Vth;
- dVth_dVb = pParam->BSIM3V2k1ox * dsqrtPhis_dVb;
- dVgst_dVb = -dVth_dVb;
- dVgst_dVg = dVgs_eff_dVg;
-
- CoxWL = model->BSIM3V2cox * pParam->BSIM3V2weffCV
- * pParam->BSIM3V2leffCV;
- Arg1 = Vgs_eff - Vbseff - Vfb;
-
- if (Arg1 <= 0.0)
- { qgate = CoxWL * Arg1;
- qbulk = -qgate;
- qdrn = 0.0;
-
- here->BSIM3V2cggb = CoxWL * dVgs_eff_dVg;
- here->BSIM3V2cgdb = 0.0;
- here->BSIM3V2cgsb = CoxWL * (dVbseff_dVb - dVgs_eff_dVg);
-
- here->BSIM3V2cdgb = 0.0;
- here->BSIM3V2cddb = 0.0;
- here->BSIM3V2cdsb = 0.0;
-
- here->BSIM3V2cbgb = -CoxWL * dVgs_eff_dVg;
- here->BSIM3V2cbdb = 0.0;
- here->BSIM3V2cbsb = -here->BSIM3V2cgsb;
- here->BSIM3V2qinv = 0.0;
- }
- else if (Vgst <= 0.0)
- { T1 = 0.5 * pParam->BSIM3V2k1ox;
- T2 = sqrt(T1 * T1 + Arg1);
- qgate = CoxWL * pParam->BSIM3V2k1ox * (T2 - T1);
- qbulk = -qgate;
- qdrn = 0.0;
-
- T0 = CoxWL * T1 / T2;
- here->BSIM3V2cggb = T0 * dVgs_eff_dVg;
- here->BSIM3V2cgdb = 0.0;
- here->BSIM3V2cgsb = T0 * (dVbseff_dVb - dVgs_eff_dVg);
-
- here->BSIM3V2cdgb = 0.0;
- here->BSIM3V2cddb = 0.0;
- here->BSIM3V2cdsb = 0.0;
-
- here->BSIM3V2cbgb = -here->BSIM3V2cggb;
- here->BSIM3V2cbdb = 0.0;
- here->BSIM3V2cbsb = -here->BSIM3V2cgsb;
- here->BSIM3V2qinv = 0.0;
- }
- else
- { One_Third_CoxWL = CoxWL / 3.0;
- Two_Third_CoxWL = 2.0 * One_Third_CoxWL;
-
- AbulkCV = Abulk0 * pParam->BSIM3V2abulkCVfactor;
- dAbulkCV_dVb = pParam->BSIM3V2abulkCVfactor * dAbulk0_dVb;
- Vdsat = Vgst / AbulkCV;
- dVdsat_dVg = dVgs_eff_dVg / AbulkCV;
- dVdsat_dVb = - (Vdsat * dAbulkCV_dVb + dVth_dVb)/ AbulkCV;
-
- if (model->BSIM3V2xpart > 0.5)
- { /* 0/100 Charge partition model */
- if (Vdsat <= Vds)
- { /* saturation region */
- T1 = Vdsat / 3.0;
- qgate = CoxWL * (Vgs_eff - Vfb
- - pParam->BSIM3V2phi - T1);
- T2 = -Two_Third_CoxWL * Vgst;
- qbulk = -(qgate + T2);
- qdrn = 0.0;
-
- here->BSIM3V2cggb = One_Third_CoxWL * (3.0
- - dVdsat_dVg) * dVgs_eff_dVg;
- T2 = -One_Third_CoxWL * dVdsat_dVb;
- here->BSIM3V2cgsb = -(here->BSIM3V2cggb + T2);
- here->BSIM3V2cgdb = 0.0;
-
- here->BSIM3V2cdgb = 0.0;
- here->BSIM3V2cddb = 0.0;
- here->BSIM3V2cdsb = 0.0;
-
- here->BSIM3V2cbgb = -(here->BSIM3V2cggb
- - Two_Third_CoxWL * dVgs_eff_dVg);
- T3 = -(T2 + Two_Third_CoxWL * dVth_dVb);
- here->BSIM3V2cbsb = -(here->BSIM3V2cbgb + T3);
- here->BSIM3V2cbdb = 0.0;
- here->BSIM3V2qinv = -(qgate + qbulk);
- }
- else
- { /* linear region */
- Alphaz = Vgst / Vdsat;
- T1 = 2.0 * Vdsat - Vds;
- T2 = Vds / (3.0 * T1);
- T3 = T2 * Vds;
- T9 = 0.25 * CoxWL;
- T4 = T9 * Alphaz;
- T7 = 2.0 * Vds - T1 - 3.0 * T3;
- T8 = T3 - T1 - 2.0 * Vds;
- qgate = CoxWL * (Vgs_eff - Vfb
- - pParam->BSIM3V2phi - 0.5 * (Vds - T3));
- T10 = T4 * T8;
- qdrn = T4 * T7;
- qbulk = -(qgate + qdrn + T10);
-
- T5 = T3 / T1;
- here->BSIM3V2cggb = CoxWL * (1.0 - T5 * dVdsat_dVg)
- * dVgs_eff_dVg;
- T11 = -CoxWL * T5 * dVdsat_dVb;
- here->BSIM3V2cgdb = CoxWL * (T2 - 0.5 + 0.5 * T5);
- here->BSIM3V2cgsb = -(here->BSIM3V2cggb + T11
- + here->BSIM3V2cgdb);
- T6 = 1.0 / Vdsat;
- dAlphaz_dVg = T6 * (1.0 - Alphaz * dVdsat_dVg);
- dAlphaz_dVb = -T6 * (dVth_dVb + Alphaz * dVdsat_dVb);
- T7 = T9 * T7;
- T8 = T9 * T8;
- T9 = 2.0 * T4 * (1.0 - 3.0 * T5);
- here->BSIM3V2cdgb = (T7 * dAlphaz_dVg - T9
- * dVdsat_dVg) * dVgs_eff_dVg;
- T12 = T7 * dAlphaz_dVb - T9 * dVdsat_dVb;
- here->BSIM3V2cddb = T4 * (3.0 - 6.0 * T2 - 3.0 * T5);
- here->BSIM3V2cdsb = -(here->BSIM3V2cdgb + T12
- + here->BSIM3V2cddb);
-
- T9 = 2.0 * T4 * (1.0 + T5);
- T10 = (T8 * dAlphaz_dVg - T9 * dVdsat_dVg)
- * dVgs_eff_dVg;
- T11 = T8 * dAlphaz_dVb - T9 * dVdsat_dVb;
- T12 = T4 * (2.0 * T2 + T5 - 1.0);
- T0 = -(T10 + T11 + T12);
-
- here->BSIM3V2cbgb = -(here->BSIM3V2cggb
- + here->BSIM3V2cdgb + T10);
- here->BSIM3V2cbdb = -(here->BSIM3V2cgdb
- + here->BSIM3V2cddb + T12);
- here->BSIM3V2cbsb = -(here->BSIM3V2cgsb
- + here->BSIM3V2cdsb + T0);
- here->BSIM3V2qinv = -(qgate + qbulk);
- }
- }
- else if (model->BSIM3V2xpart < 0.5)
- { /* 40/60 Charge partition model */
- if (Vds >= Vdsat)
- { /* saturation region */
- T1 = Vdsat / 3.0;
- qgate = CoxWL * (Vgs_eff - Vfb
- - pParam->BSIM3V2phi - T1);
- T2 = -Two_Third_CoxWL * Vgst;
- qbulk = -(qgate + T2);
- qdrn = 0.4 * T2;
-
- here->BSIM3V2cggb = One_Third_CoxWL * (3.0
- - dVdsat_dVg) * dVgs_eff_dVg;
- T2 = -One_Third_CoxWL * dVdsat_dVb;
- here->BSIM3V2cgsb = -(here->BSIM3V2cggb + T2);
- here->BSIM3V2cgdb = 0.0;
-
- T3 = 0.4 * Two_Third_CoxWL;
- here->BSIM3V2cdgb = -T3 * dVgs_eff_dVg;
- here->BSIM3V2cddb = 0.0;
- T4 = T3 * dVth_dVb;
- here->BSIM3V2cdsb = -(T4 + here->BSIM3V2cdgb);
-
- here->BSIM3V2cbgb = -(here->BSIM3V2cggb
- - Two_Third_CoxWL * dVgs_eff_dVg);
- T3 = -(T2 + Two_Third_CoxWL * dVth_dVb);
- here->BSIM3V2cbsb = -(here->BSIM3V2cbgb + T3);
- here->BSIM3V2cbdb = 0.0;
- here->BSIM3V2qinv = -(qgate + qbulk);
- }
- else
- { /* linear region */
- Alphaz = Vgst / Vdsat;
- T1 = 2.0 * Vdsat - Vds;
- T2 = Vds / (3.0 * T1);
- T3 = T2 * Vds;
- T9 = 0.25 * CoxWL;
- T4 = T9 * Alphaz;
- qgate = CoxWL * (Vgs_eff - Vfb - pParam->BSIM3V2phi
- - 0.5 * (Vds - T3));
-
- T5 = T3 / T1;
- here->BSIM3V2cggb = CoxWL * (1.0 - T5 * dVdsat_dVg)
- * dVgs_eff_dVg;
- tmp = -CoxWL * T5 * dVdsat_dVb;
- here->BSIM3V2cgdb = CoxWL * (T2 - 0.5 + 0.5 * T5);
- here->BSIM3V2cgsb = -(here->BSIM3V2cggb
- + here->BSIM3V2cgdb + tmp);
-
- T6 = 1.0 / Vdsat;
- dAlphaz_dVg = T6 * (1.0 - Alphaz * dVdsat_dVg);
- dAlphaz_dVb = -T6 * (dVth_dVb + Alphaz * dVdsat_dVb);
-
- T6 = 8.0 * Vdsat * Vdsat - 6.0 * Vdsat * Vds
- + 1.2 * Vds * Vds;
- T8 = T2 / T1;
- T7 = Vds - T1 - T8 * T6;
- qdrn = T4 * T7;
- T7 *= T9;
- tmp = T8 / T1;
- tmp1 = T4 * (2.0 - 4.0 * tmp * T6
- + T8 * (16.0 * Vdsat - 6.0 * Vds));
-
- here->BSIM3V2cdgb = (T7 * dAlphaz_dVg - tmp1
- * dVdsat_dVg) * dVgs_eff_dVg;
- T10 = T7 * dAlphaz_dVb - tmp1 * dVdsat_dVb;
- here->BSIM3V2cddb = T4 * (2.0 - (1.0 / (3.0 * T1
- * T1) + 2.0 * tmp) * T6 + T8
- * (6.0 * Vdsat - 2.4 * Vds));
- here->BSIM3V2cdsb = -(here->BSIM3V2cdgb
- + T10 + here->BSIM3V2cddb);
-
- T7 = 2.0 * (T1 + T3);
- qbulk = -(qgate - T4 * T7);
- T7 *= T9;
- T0 = 4.0 * T4 * (1.0 - T5);
- T12 = (-T7 * dAlphaz_dVg - here->BSIM3V2cdgb
- - T0 * dVdsat_dVg) * dVgs_eff_dVg;
- T11 = -T7 * dAlphaz_dVb - T10 - T0 * dVdsat_dVb;
- T10 = -4.0 * T4 * (T2 - 0.5 + 0.5 * T5)
- - here->BSIM3V2cddb;
- tmp = -(T10 + T11 + T12);
-
- here->BSIM3V2cbgb = -(here->BSIM3V2cggb
- + here->BSIM3V2cdgb + T12);
- here->BSIM3V2cbdb = -(here->BSIM3V2cgdb
- + here->BSIM3V2cddb + T11);
- here->BSIM3V2cbsb = -(here->BSIM3V2cgsb
- + here->BSIM3V2cdsb + tmp);
- here->BSIM3V2qinv = -(qgate + qbulk);
- }
- }
- else
- { /* 50/50 partitioning */
- if (Vds >= Vdsat)
- { /* saturation region */
- T1 = Vdsat / 3.0;
- qgate = CoxWL * (Vgs_eff - Vfb
- - pParam->BSIM3V2phi - T1);
- T2 = -Two_Third_CoxWL * Vgst;
- qbulk = -(qgate + T2);
- qdrn = 0.5 * T2;
-
- here->BSIM3V2cggb = One_Third_CoxWL * (3.0
- - dVdsat_dVg) * dVgs_eff_dVg;
- T2 = -One_Third_CoxWL * dVdsat_dVb;
- here->BSIM3V2cgsb = -(here->BSIM3V2cggb + T2);
- here->BSIM3V2cgdb = 0.0;
-
- here->BSIM3V2cdgb = -One_Third_CoxWL * dVgs_eff_dVg;
- here->BSIM3V2cddb = 0.0;
- T4 = One_Third_CoxWL * dVth_dVb;
- here->BSIM3V2cdsb = -(T4 + here->BSIM3V2cdgb);
-
- here->BSIM3V2cbgb = -(here->BSIM3V2cggb
- - Two_Third_CoxWL * dVgs_eff_dVg);
- T3 = -(T2 + Two_Third_CoxWL * dVth_dVb);
- here->BSIM3V2cbsb = -(here->BSIM3V2cbgb + T3);
- here->BSIM3V2cbdb = 0.0;
- here->BSIM3V2qinv = -(qgate + qbulk);
- }
- else
- { /* linear region */
- Alphaz = Vgst / Vdsat;
- T1 = 2.0 * Vdsat - Vds;
- T2 = Vds / (3.0 * T1);
- T3 = T2 * Vds;
- T9 = 0.25 * CoxWL;
- T4 = T9 * Alphaz;
- qgate = CoxWL * (Vgs_eff - Vfb - pParam->BSIM3V2phi
- - 0.5 * (Vds - T3));
-
- T5 = T3 / T1;
- here->BSIM3V2cggb = CoxWL * (1.0 - T5 * dVdsat_dVg)
- * dVgs_eff_dVg;
- tmp = -CoxWL * T5 * dVdsat_dVb;
- here->BSIM3V2cgdb = CoxWL * (T2 - 0.5 + 0.5 * T5);
- here->BSIM3V2cgsb = -(here->BSIM3V2cggb
- + here->BSIM3V2cgdb + tmp);
-
- T6 = 1.0 / Vdsat;
- dAlphaz_dVg = T6 * (1.0 - Alphaz * dVdsat_dVg);
- dAlphaz_dVb = -T6 * (dVth_dVb + Alphaz * dVdsat_dVb);
-
- T7 = T1 + T3;
- qdrn = -T4 * T7;
- qbulk = - (qgate + qdrn + qdrn);
- T7 *= T9;
- T0 = T4 * (2.0 * T5 - 2.0);
-
- here->BSIM3V2cdgb = (T0 * dVdsat_dVg - T7
- * dAlphaz_dVg) * dVgs_eff_dVg;
- T12 = T0 * dVdsat_dVb - T7 * dAlphaz_dVb;
- here->BSIM3V2cddb = T4 * (1.0 - 2.0 * T2 - T5);
- here->BSIM3V2cdsb = -(here->BSIM3V2cdgb + T12
- + here->BSIM3V2cddb);
-
- here->BSIM3V2cbgb = -(here->BSIM3V2cggb
- + 2.0 * here->BSIM3V2cdgb);
- here->BSIM3V2cbdb = -(here->BSIM3V2cgdb
- + 2.0 * here->BSIM3V2cddb);
- here->BSIM3V2cbsb = -(here->BSIM3V2cgsb
- + 2.0 * here->BSIM3V2cdsb);
- here->BSIM3V2qinv = -(qgate + qbulk);
- }
- }
- }
- }
- else
- { if (Vbseff < 0.0)
- { VbseffCV = Vbseff;
- dVbseffCV_dVb = 1.0;
- }
- else
- { VbseffCV = pParam->BSIM3V2phi - Phis;
- dVbseffCV_dVb = -dPhis_dVb;
- }
-
- CoxWL = model->BSIM3V2cox * pParam->BSIM3V2weffCV
- * pParam->BSIM3V2leffCV;
-
- /* Seperate VgsteffCV with noff and voffcv */
- noff = n * pParam->BSIM3V2noff;
- dnoff_dVd = pParam->BSIM3V2noff * dn_dVd;
- dnoff_dVb = pParam->BSIM3V2noff * dn_dVb;
- T0 = Vtm * noff;
- voffcv = pParam->BSIM3V2voffcv;
- VgstNVt = (Vgst - voffcv) / T0;
-
- if (VgstNVt > EXP_THRESHOLD)
- { Vgsteff = Vgst - voffcv;
- dVgsteff_dVg = dVgs_eff_dVg;
- dVgsteff_dVd = -dVth_dVd;
- dVgsteff_dVb = -dVth_dVb;
- }
- else if (VgstNVt < -EXP_THRESHOLD)
- { Vgsteff = T0 * log(1.0 + MIN_EXP);
- dVgsteff_dVg = 0.0;
- dVgsteff_dVd = Vgsteff / noff;
- dVgsteff_dVb = dVgsteff_dVd * dnoff_dVb;
- dVgsteff_dVd *= dnoff_dVd;
- }
- else
- { ExpVgst = exp(VgstNVt);
- Vgsteff = T0 * log(1.0 + ExpVgst);
- dVgsteff_dVg = ExpVgst / (1.0 + ExpVgst);
- dVgsteff_dVd = -dVgsteff_dVg * (dVth_dVd + (Vgst - voffcv)
- / noff * dnoff_dVd) + Vgsteff / noff * dnoff_dVd;
- dVgsteff_dVb = -dVgsteff_dVg * (dVth_dVb + (Vgst - voffcv)
- / noff * dnoff_dVb) + Vgsteff / noff * dnoff_dVb;
- dVgsteff_dVg *= dVgs_eff_dVg;
- } /* End of VgsteffCV - Weidong 5/1998 */
-
- if (model->BSIM3V2capMod == 1)
- { if (model->BSIM3V2version < 3.2)
- { Vfb = Vth - pParam->BSIM3V2phi - pParam->BSIM3V2k1ox * sqrtPhis;
- dVfb_dVb = dVth_dVb - pParam->BSIM3V2k1ox * dsqrtPhis_dVb;
- dVfb_dVd = dVth_dVd;
- }
- else
- { Vfb = pParam->BSIM3V2vfbzb;
- dVfb_dVb = dVfb_dVd = 0.0;
- }
-
- Arg1 = Vgs_eff - VbseffCV - Vfb - Vgsteff;
-
- if (Arg1 <= 0.0)
- { qgate = CoxWL * Arg1;
- Cgg = CoxWL * (dVgs_eff_dVg - dVgsteff_dVg);
- Cgd = -CoxWL * (dVfb_dVd + dVgsteff_dVd);
- Cgb = -CoxWL * (dVfb_dVb + dVbseffCV_dVb + dVgsteff_dVb);
- }
- else
- { T0 = 0.5 * pParam->BSIM3V2k1ox;
- T1 = sqrt(T0 * T0 + Arg1);
- T2 = CoxWL * T0 / T1;
-
- qgate = CoxWL * pParam->BSIM3V2k1ox * (T1 - T0);
-
- Cgg = T2 * (dVgs_eff_dVg - dVgsteff_dVg);
- Cgd = -T2 * (dVfb_dVd + dVgsteff_dVd);
- Cgb = -T2 * (dVfb_dVb + dVbseffCV_dVb + dVgsteff_dVb);
- }
- qbulk = -qgate;
- Cbg = -Cgg;
- Cbd = -Cgd;
- Cbb = -Cgb;
-
- One_Third_CoxWL = CoxWL / 3.0;
- Two_Third_CoxWL = 2.0 * One_Third_CoxWL;
- AbulkCV = Abulk0 * pParam->BSIM3V2abulkCVfactor;
- dAbulkCV_dVb = pParam->BSIM3V2abulkCVfactor * dAbulk0_dVb;
- VdsatCV = Vgsteff / AbulkCV;
- if (VdsatCV < Vds)
- { dVdsatCV_dVg = 1.0 / AbulkCV;
- dVdsatCV_dVb = -VdsatCV * dAbulkCV_dVb / AbulkCV;
- T0 = Vgsteff - VdsatCV / 3.0;
- dT0_dVg = 1.0 - dVdsatCV_dVg / 3.0;
- dT0_dVb = -dVdsatCV_dVb / 3.0;
- qgate += CoxWL * T0;
- Cgg1 = CoxWL * dT0_dVg;
- Cgb1 = CoxWL * dT0_dVb + Cgg1 * dVgsteff_dVb;
- Cgd1 = Cgg1 * dVgsteff_dVd;
- Cgg1 *= dVgsteff_dVg;
- Cgg += Cgg1;
- Cgb += Cgb1;
- Cgd += Cgd1;
-
- T0 = VdsatCV - Vgsteff;
- dT0_dVg = dVdsatCV_dVg - 1.0;
- dT0_dVb = dVdsatCV_dVb;
- qbulk += One_Third_CoxWL * T0;
- Cbg1 = One_Third_CoxWL * dT0_dVg;
- Cbb1 = One_Third_CoxWL * dT0_dVb + Cbg1 * dVgsteff_dVb;
- Cbd1 = Cbg1 * dVgsteff_dVd;
- Cbg1 *= dVgsteff_dVg;
- Cbg += Cbg1;
- Cbb += Cbb1;
- Cbd += Cbd1;
-
- if (model->BSIM3V2xpart > 0.5)
- T0 = -Two_Third_CoxWL;
- else if (model->BSIM3V2xpart < 0.5)
- T0 = -0.4 * CoxWL;
- else
- T0 = -One_Third_CoxWL;
-
- qsrc = T0 * Vgsteff;
- Csg = T0 * dVgsteff_dVg;
- Csb = T0 * dVgsteff_dVb;
- Csd = T0 * dVgsteff_dVd;
- Cgb *= dVbseff_dVb;
- Cbb *= dVbseff_dVb;
- Csb *= dVbseff_dVb;
- }
- else
- { T0 = AbulkCV * Vds;
- T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.e-20);
- T2 = Vds / T1;
- T3 = T0 * T2;
- dT3_dVg = -12.0 * T2 * T2 * AbulkCV;
- dT3_dVd = 6.0 * T0 * (4.0 * Vgsteff - T0) / T1 / T1 - 0.5;
- dT3_dVb = 12.0 * T2 * T2 * dAbulkCV_dVb * Vgsteff;
-
- qgate += CoxWL * (Vgsteff - 0.5 * Vds + T3);
- Cgg1 = CoxWL * (1.0 + dT3_dVg);
- Cgb1 = CoxWL * dT3_dVb + Cgg1 * dVgsteff_dVb;
- Cgd1 = CoxWL * dT3_dVd + Cgg1 * dVgsteff_dVd;
- Cgg1 *= dVgsteff_dVg;
- Cgg += Cgg1;
- Cgb += Cgb1;
- Cgd += Cgd1;
-
- qbulk += CoxWL * (1.0 - AbulkCV) * (0.5 * Vds - T3);
- Cbg1 = -CoxWL * ((1.0 - AbulkCV) * dT3_dVg);
- Cbb1 = -CoxWL * ((1.0 - AbulkCV) * dT3_dVb
- + (0.5 * Vds - T3) * dAbulkCV_dVb)
- + Cbg1 * dVgsteff_dVb;
- Cbd1 = -CoxWL * (1.0 - AbulkCV) * dT3_dVd
- + Cbg1 * dVgsteff_dVd;
- Cbg1 *= dVgsteff_dVg;
- Cbg += Cbg1;
- Cbb += Cbb1;
- Cbd += Cbd1;
-
- if (model->BSIM3V2xpart > 0.5)
- { /* 0/100 Charge petition model */
- T1 = T1 + T1;
- qsrc = -CoxWL * (0.5 * Vgsteff + 0.25 * T0
- - T0 * T0 / T1);
- Csg = -CoxWL * (0.5 + 24.0 * T0 * Vds / T1 / T1
- * AbulkCV);
- Csb = -CoxWL * (0.25 * Vds * dAbulkCV_dVb
- - 12.0 * T0 * Vds / T1 / T1 * (4.0 * Vgsteff - T0)
- * dAbulkCV_dVb) + Csg * dVgsteff_dVb;
- Csd = -CoxWL * (0.25 * AbulkCV - 12.0 * AbulkCV * T0
- / T1 / T1 * (4.0 * Vgsteff - T0))
- + Csg * dVgsteff_dVd;
- Csg *= dVgsteff_dVg;
- }
- else if (model->BSIM3V2xpart < 0.5)
- { /* 40/60 Charge petition model */
- T1 = T1 / 12.0;
- T2 = 0.5 * CoxWL / (T1 * T1);
- T3 = Vgsteff * (2.0 * T0 * T0 / 3.0 + Vgsteff
- * (Vgsteff - 4.0 * T0 / 3.0))
- - 2.0 * T0 * T0 * T0 / 15.0;
- qsrc = -T2 * T3;
- T4 = 4.0 / 3.0 * Vgsteff * (Vgsteff - T0)
- + 0.4 * T0 * T0;
- Csg = -2.0 * qsrc / T1 - T2 * (Vgsteff * (3.0
- * Vgsteff - 8.0 * T0 / 3.0)
- + 2.0 * T0 * T0 / 3.0);
- Csb = (qsrc / T1 * Vds + T2 * T4 * Vds) * dAbulkCV_dVb
- + Csg * dVgsteff_dVb;
- Csd = (qsrc / T1 + T2 * T4) * AbulkCV
- + Csg * dVgsteff_dVd;
- Csg *= dVgsteff_dVg;
- }
- else
- { /* 50/50 Charge petition model */
- qsrc = -0.5 * (qgate + qbulk);
- Csg = -0.5 * (Cgg1 + Cbg1);
- Csb = -0.5 * (Cgb1 + Cbb1);
- Csd = -0.5 * (Cgd1 + Cbd1);
- }
- Cgb *= dVbseff_dVb;
- Cbb *= dVbseff_dVb;
- Csb *= dVbseff_dVb;
- }
- qdrn = -(qgate + qbulk + qsrc);
- here->BSIM3V2cggb = Cgg;
- here->BSIM3V2cgsb = -(Cgg + Cgd + Cgb);
- here->BSIM3V2cgdb = Cgd;
- here->BSIM3V2cdgb = -(Cgg + Cbg + Csg);
- here->BSIM3V2cdsb = (Cgg + Cgd + Cgb + Cbg + Cbd + Cbb
- + Csg + Csd + Csb);
- here->BSIM3V2cddb = -(Cgd + Cbd + Csd);
- here->BSIM3V2cbgb = Cbg;
- here->BSIM3V2cbsb = -(Cbg + Cbd + Cbb);
- here->BSIM3V2cbdb = Cbd;
- here->BSIM3V2qinv = -(qgate + qbulk);
- }
-
- else if (model->BSIM3V2capMod == 2)
- { if (model->BSIM3V2version < 3.2)
- { Vfb = Vth - pParam->BSIM3V2phi - pParam->BSIM3V2k1ox * sqrtPhis;
- dVfb_dVb = dVth_dVb - pParam->BSIM3V2k1ox * dsqrtPhis_dVb;
- dVfb_dVd = dVth_dVd;
- }
- else
- { Vfb = pParam->BSIM3V2vfbzb;
- dVfb_dVb = dVfb_dVd = 0.0;
- }
-
- V3 = Vfb - Vgs_eff + VbseffCV - DELTA_3;
- if (Vfb <= 0.0)
- { T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * Vfb);
- T2 = -DELTA_3 / T0;
- }
- else
- { T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * Vfb);
- T2 = DELTA_3 / T0;
- }
-
- T1 = 0.5 * (1.0 + V3 / T0);
- Vfbeff = Vfb - 0.5 * (V3 + T0);
- dVfbeff_dVd = (1.0 - T1 - T2) * dVfb_dVd;
- dVfbeff_dVg = T1 * dVgs_eff_dVg;
- dVfbeff_dVb = (1.0 - T1 - T2) * dVfb_dVb
- - T1 * dVbseffCV_dVb;
- Qac0 = CoxWL * (Vfbeff - Vfb);
- dQac0_dVg = CoxWL * dVfbeff_dVg;
- dQac0_dVd = CoxWL * (dVfbeff_dVd - dVfb_dVd);
- dQac0_dVb = CoxWL * (dVfbeff_dVb - dVfb_dVb);
-
- T0 = 0.5 * pParam->BSIM3V2k1ox;
- T3 = Vgs_eff - Vfbeff - VbseffCV - Vgsteff;
- if (pParam->BSIM3V2k1ox == 0.0)
- { T1 = 0.0;
- T2 = 0.0;
- }
- else if (T3 < 0.0)
- { T1 = T0 + T3 / pParam->BSIM3V2k1ox;
- T2 = CoxWL;
- }
- else
- { T1 = sqrt(T0 * T0 + T3);
- T2 = CoxWL * T0 / T1;
- }
-
- Qsub0 = CoxWL * pParam->BSIM3V2k1ox * (T1 - T0);
-
- dQsub0_dVg = T2 * (dVgs_eff_dVg - dVfbeff_dVg - dVgsteff_dVg);
- dQsub0_dVd = -T2 * (dVfbeff_dVd + dVgsteff_dVd);
- dQsub0_dVb = -T2 * (dVfbeff_dVb + dVbseffCV_dVb
- + dVgsteff_dVb);
-
- AbulkCV = Abulk0 * pParam->BSIM3V2abulkCVfactor;
- dAbulkCV_dVb = pParam->BSIM3V2abulkCVfactor * dAbulk0_dVb;
- VdsatCV = Vgsteff / AbulkCV;
-
- V4 = VdsatCV - Vds - DELTA_4;
- T0 = sqrt(V4 * V4 + 4.0 * DELTA_4 * VdsatCV);
- VdseffCV = VdsatCV - 0.5 * (V4 + T0);
- T1 = 0.5 * (1.0 + V4 / T0);
- T2 = DELTA_4 / T0;
- T3 = (1.0 - T1 - T2) / AbulkCV;
- dVdseffCV_dVg = T3;
- dVdseffCV_dVd = T1;
- dVdseffCV_dVb = -T3 * VdsatCV * dAbulkCV_dVb;
-
- T0 = AbulkCV * VdseffCV;
- T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1e-20);
- T2 = VdseffCV / T1;
- T3 = T0 * T2;
-
- T4 = (1.0 - 12.0 * T2 * T2 * AbulkCV);
- T5 = (6.0 * T0 * (4.0 * Vgsteff - T0) / (T1 * T1) - 0.5);
- T6 = 12.0 * T2 * T2 * Vgsteff;
-
- qinoi = -CoxWL * (Vgsteff - 0.5 * T0 + AbulkCV * T3);
- qgate = CoxWL * (Vgsteff - 0.5 * VdseffCV + T3);
- Cgg1 = CoxWL * (T4 + T5 * dVdseffCV_dVg);
- Cgd1 = CoxWL * T5 * dVdseffCV_dVd + Cgg1 * dVgsteff_dVd;
- Cgb1 = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
- + Cgg1 * dVgsteff_dVb;
- Cgg1 *= dVgsteff_dVg;
-
- T7 = 1.0 - AbulkCV;
- qbulk = CoxWL * T7 * (0.5 * VdseffCV - T3);
- T4 = -T7 * (T4 - 1.0);
- T5 = -T7 * T5;
- T6 = -(T7 * T6 + (0.5 * VdseffCV - T3));
- Cbg1 = CoxWL * (T4 + T5 * dVdseffCV_dVg);
- Cbd1 = CoxWL * T5 * dVdseffCV_dVd + Cbg1 * dVgsteff_dVd;
- Cbb1 = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
- + Cbg1 * dVgsteff_dVb;
- Cbg1 *= dVgsteff_dVg;
-
- if (model->BSIM3V2xpart > 0.5)
- { /* 0/100 Charge petition model */
- T1 = T1 + T1;
- qsrc = -CoxWL * (0.5 * Vgsteff + 0.25 * T0
- - T0 * T0 / T1);
- T7 = (4.0 * Vgsteff - T0) / (T1 * T1);
- T4 = -(0.5 + 24.0 * T0 * T0 / (T1 * T1));
- T5 = -(0.25 * AbulkCV - 12.0 * AbulkCV * T0 * T7);
- T6 = -(0.25 * VdseffCV - 12.0 * T0 * VdseffCV * T7);
- Csg = CoxWL * (T4 + T5 * dVdseffCV_dVg);
- Csd = CoxWL * T5 * dVdseffCV_dVd + Csg * dVgsteff_dVd;
- Csb = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
- + Csg * dVgsteff_dVb;
- Csg *= dVgsteff_dVg;
- }
- else if (model->BSIM3V2xpart < 0.5)
- { /* 40/60 Charge petition model */
- T1 = T1 / 12.0;
- T2 = 0.5 * CoxWL / (T1 * T1);
- T3 = Vgsteff * (2.0 * T0 * T0 / 3.0 + Vgsteff
- * (Vgsteff - 4.0 * T0 / 3.0))
- - 2.0 * T0 * T0 * T0 / 15.0;
- qsrc = -T2 * T3;
- T7 = 4.0 / 3.0 * Vgsteff * (Vgsteff - T0)
- + 0.4 * T0 * T0;
- T4 = -2.0 * qsrc / T1 - T2 * (Vgsteff * (3.0
- * Vgsteff - 8.0 * T0 / 3.0)
- + 2.0 * T0 * T0 / 3.0);
- T5 = (qsrc / T1 + T2 * T7) * AbulkCV;
- T6 = (qsrc / T1 * VdseffCV + T2 * T7 * VdseffCV);
- Csg = (T4 + T5 * dVdseffCV_dVg);
- Csd = T5 * dVdseffCV_dVd + Csg * dVgsteff_dVd;
- Csb = (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
- + Csg * dVgsteff_dVb;
- Csg *= dVgsteff_dVg;
- }
- else
- { /* 50/50 Charge petition model */
- qsrc = -0.5 * (qgate + qbulk);
- Csg = -0.5 * (Cgg1 + Cbg1);
- Csb = -0.5 * (Cgb1 + Cbb1);
- Csd = -0.5 * (Cgd1 + Cbd1);
- }
-
- qgate += Qac0 + Qsub0;
- qbulk -= (Qac0 + Qsub0);
- qdrn = -(qgate + qbulk + qsrc);
-
- Cgg = dQac0_dVg + dQsub0_dVg + Cgg1;
- Cgd = dQac0_dVd + dQsub0_dVd + Cgd1;
- Cgb = dQac0_dVb + dQsub0_dVb + Cgb1;
-
- Cbg = Cbg1 - dQac0_dVg - dQsub0_dVg;
- Cbd = Cbd1 - dQac0_dVd - dQsub0_dVd;
- Cbb = Cbb1 - dQac0_dVb - dQsub0_dVb;
-
- Cgb *= dVbseff_dVb;
- Cbb *= dVbseff_dVb;
- Csb *= dVbseff_dVb;
-
- here->BSIM3V2cggb = Cgg;
- here->BSIM3V2cgsb = -(Cgg + Cgd + Cgb);
- here->BSIM3V2cgdb = Cgd;
- here->BSIM3V2cdgb = -(Cgg + Cbg + Csg);
- here->BSIM3V2cdsb = (Cgg + Cgd + Cgb + Cbg + Cbd + Cbb
- + Csg + Csd + Csb);
- here->BSIM3V2cddb = -(Cgd + Cbd + Csd);
- here->BSIM3V2cbgb = Cbg;
- here->BSIM3V2cbsb = -(Cbg + Cbd + Cbb);
- here->BSIM3V2cbdb = Cbd;
- here->BSIM3V2qinv = qinoi;
- }
-
- /* New Charge-Thickness capMod (CTM) begins - Weidong 7/1997 */
- else if (model->BSIM3V2capMod == 3)
- { V3 = pParam->BSIM3V2vfbzb - Vgs_eff + VbseffCV - DELTA_3;
- if (pParam->BSIM3V2vfbzb <= 0.0)
- { T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * pParam->BSIM3V2vfbzb);
- T2 = -DELTA_3 / T0;
- }
- else
- { T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * pParam->BSIM3V2vfbzb);
- T2 = DELTA_3 / T0;
- }
-
- T1 = 0.5 * (1.0 + V3 / T0);
- Vfbeff = pParam->BSIM3V2vfbzb - 0.5 * (V3 + T0);
- dVfbeff_dVg = T1 * dVgs_eff_dVg;
- dVfbeff_dVb = -T1 * dVbseffCV_dVb;
-
- Cox = model->BSIM3V2cox;
- Tox = 1.0e8 * model->BSIM3V2tox;
- T0 = (Vgs_eff - VbseffCV - pParam->BSIM3V2vfbzb) / Tox;
- dT0_dVg = dVgs_eff_dVg / Tox;
- dT0_dVb = -dVbseffCV_dVb / Tox;
-
- tmp = T0 * pParam->BSIM3V2acde;
- if ((-EXP_THRESHOLD < tmp) && (tmp < EXP_THRESHOLD))
- { Tcen = pParam->BSIM3V2ldeb * exp(tmp);
- dTcen_dVg = pParam->BSIM3V2acde * Tcen;
- dTcen_dVb = dTcen_dVg * dT0_dVb;
- dTcen_dVg *= dT0_dVg;
- }
- else if (tmp <= -EXP_THRESHOLD)
- { Tcen = pParam->BSIM3V2ldeb * MIN_EXP;
- dTcen_dVg = dTcen_dVb = 0.0;
- }
- else
- { Tcen = pParam->BSIM3V2ldeb * MAX_EXP;
- dTcen_dVg = dTcen_dVb = 0.0;
- }
-
- LINK = 1.0e-3 * model->BSIM3V2tox;
- V3 = pParam->BSIM3V2ldeb - Tcen - LINK;
- V4 = sqrt(V3 * V3 + 4.0 * LINK * pParam->BSIM3V2ldeb);
- Tcen = pParam->BSIM3V2ldeb - 0.5 * (V3 + V4);
- T1 = 0.5 * (1.0 + V3 / V4);
- dTcen_dVg *= T1;
- dTcen_dVb *= T1;
-
- Ccen = EPSSI / Tcen;
- T2 = Cox / (Cox + Ccen);
- Coxeff = T2 * Ccen;
- T3 = -Ccen / Tcen;
- dCoxeff_dVg = T2 * T2 * T3;
- dCoxeff_dVb = dCoxeff_dVg * dTcen_dVb;
- dCoxeff_dVg *= dTcen_dVg;
- CoxWLcen = CoxWL * Coxeff / Cox;
-
- Qac0 = CoxWLcen * (Vfbeff - pParam->BSIM3V2vfbzb);
- QovCox = Qac0 / Coxeff;
- dQac0_dVg = CoxWLcen * dVfbeff_dVg
- + QovCox * dCoxeff_dVg;
- dQac0_dVb = CoxWLcen * dVfbeff_dVb
- + QovCox * dCoxeff_dVb;
-
- T0 = 0.5 * pParam->BSIM3V2k1ox;
- T3 = Vgs_eff - Vfbeff - VbseffCV - Vgsteff;
- if (pParam->BSIM3V2k1ox == 0.0)
- { T1 = 0.0;
- T2 = 0.0;
- }
- else if (T3 < 0.0)
- { T1 = T0 + T3 / pParam->BSIM3V2k1ox;
- T2 = CoxWLcen;
- }
- else
- { T1 = sqrt(T0 * T0 + T3);
- T2 = CoxWLcen * T0 / T1;
- }
-
- Qsub0 = CoxWLcen * pParam->BSIM3V2k1ox * (T1 - T0);
- QovCox = Qsub0 / Coxeff;
- dQsub0_dVg = T2 * (dVgs_eff_dVg - dVfbeff_dVg - dVgsteff_dVg)
- + QovCox * dCoxeff_dVg;
- dQsub0_dVd = -T2 * dVgsteff_dVd;
- dQsub0_dVb = -T2 * (dVfbeff_dVb + dVbseffCV_dVb + dVgsteff_dVb)
- + QovCox * dCoxeff_dVb;
-
- /* Gate-bias dependent delta Phis begins */
- if (pParam->BSIM3V2k1ox <= 0.0)
- { Denomi = 0.25 * pParam->BSIM3V2moin * Vtm;
- T0 = 0.5 * pParam->BSIM3V2sqrtPhi;
- }
- else
- { Denomi = pParam->BSIM3V2moin * Vtm
- * pParam->BSIM3V2k1ox * pParam->BSIM3V2k1ox;
- T0 = pParam->BSIM3V2k1ox * pParam->BSIM3V2sqrtPhi;
- }
- T1 = 2.0 * T0 + Vgsteff;
-
- DeltaPhi = Vtm * log(1.0 + T1 * Vgsteff / Denomi);
- dDeltaPhi_dVg = 2.0 * Vtm * (T1 -T0) / (Denomi + T1 * Vgsteff);
- dDeltaPhi_dVd = dDeltaPhi_dVg * dVgsteff_dVd;
- dDeltaPhi_dVb = dDeltaPhi_dVg * dVgsteff_dVb;
- /* End of delta Phis */
-
- T3 = 4.0 * (Vth - pParam->BSIM3V2vfbzb - pParam->BSIM3V2phi);
- Tox += Tox;
- if (T3 >= 0.0)
- T0 = (Vgsteff + T3) / Tox;
- else
- T0 = (Vgsteff + 1.0e-20) / Tox;
- tmp = exp(0.7 * log(T0));
- T1 = 1.0 + tmp;
- T2 = 0.7 * tmp / (T0 * Tox);
- Tcen = 1.9e-9 / T1;
- dTcen_dVg = -1.9e-9 * T2 / T1 /T1;
- dTcen_dVd = dTcen_dVg * (4.0 * dVth_dVd + dVgsteff_dVd);
- dTcen_dVb = dTcen_dVg * (4.0 * dVth_dVb + dVgsteff_dVb);
- dTcen_dVg *= dVgsteff_dVg;
-
- Ccen = EPSSI / Tcen;
- T0 = Cox / (Cox + Ccen);
- Coxeff = T0 * Ccen;
- T1 = -Ccen / Tcen;
- dCoxeff_dVg = T0 * T0 * T1;
- dCoxeff_dVd = dCoxeff_dVg * dTcen_dVd;
- dCoxeff_dVb = dCoxeff_dVg * dTcen_dVb;
- dCoxeff_dVg *= dTcen_dVg;
- CoxWLcen = CoxWL * Coxeff / Cox;
-
- AbulkCV = Abulk0 * pParam->BSIM3V2abulkCVfactor;
- dAbulkCV_dVb = pParam->BSIM3V2abulkCVfactor * dAbulk0_dVb;
- VdsatCV = (Vgsteff - DeltaPhi) / AbulkCV;
- V4 = VdsatCV - Vds - DELTA_4;
- T0 = sqrt(V4 * V4 + 4.0 * DELTA_4 * VdsatCV);
- VdseffCV = VdsatCV - 0.5 * (V4 + T0);
- T1 = 0.5 * (1.0 + V4 / T0);
- T2 = DELTA_4 / T0;
- T3 = (1.0 - T1 - T2) / AbulkCV;
- T4 = T3 * ( 1.0 - dDeltaPhi_dVg);
- dVdseffCV_dVg = T4;
- dVdseffCV_dVd = T1;
- dVdseffCV_dVb = -T3 * VdsatCV * dAbulkCV_dVb;
-
- T0 = AbulkCV * VdseffCV;
- T1 = Vgsteff - DeltaPhi;
- T2 = 12.0 * (T1 - 0.5 * T0 + 1.0e-20);
- T3 = T0 / T2;
- T4 = 1.0 - 12.0 * T3 * T3;
- T5 = AbulkCV * (6.0 * T0 * (4.0 * T1 - T0) / (T2 * T2) - 0.5);
- T6 = T5 * VdseffCV / AbulkCV;
-
- qgate = qinoi = CoxWLcen * (T1 - T0 * (0.5 - T3));
- QovCox = qgate / Coxeff;
- Cgg1 = CoxWLcen * (T4 * (1.0 - dDeltaPhi_dVg)
- + T5 * dVdseffCV_dVg);
- Cgd1 = CoxWLcen * T5 * dVdseffCV_dVd + Cgg1
- * dVgsteff_dVd + QovCox * dCoxeff_dVd;
- Cgb1 = CoxWLcen * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
- + Cgg1 * dVgsteff_dVb + QovCox * dCoxeff_dVb;
- Cgg1 = Cgg1 * dVgsteff_dVg + QovCox * dCoxeff_dVg;
-
-
- T7 = 1.0 - AbulkCV;
- T8 = T2 * T2;
- T9 = 12.0 * T7 * T0 * T0 / (T8 * AbulkCV);
- T10 = T9 * (1.0 - dDeltaPhi_dVg);
- T11 = -T7 * T5 / AbulkCV;
- T12 = -(T9 * T1 / AbulkCV + VdseffCV * (0.5 - T0 / T2));
-
- qbulk = CoxWLcen * T7 * (0.5 * VdseffCV - T0 * VdseffCV / T2);
- QovCox = qbulk / Coxeff;
- Cbg1 = CoxWLcen * (T10 + T11 * dVdseffCV_dVg);
- Cbd1 = CoxWLcen * T11 * dVdseffCV_dVd + Cbg1
- * dVgsteff_dVd + QovCox * dCoxeff_dVd;
- Cbb1 = CoxWLcen * (T11 * dVdseffCV_dVb + T12 * dAbulkCV_dVb)
- + Cbg1 * dVgsteff_dVb + QovCox * dCoxeff_dVb;
- Cbg1 = Cbg1 * dVgsteff_dVg + QovCox * dCoxeff_dVg;
-
- if (model->BSIM3V2xpart > 0.5)
- { /* 0/100 partition */
- qsrc = -CoxWLcen * (T1 / 2.0 + T0 / 4.0
- - 0.5 * T0 * T0 / T2);
- QovCox = qsrc / Coxeff;
- T2 += T2;
- T3 = T2 * T2;
- T7 = -(0.25 - 12.0 * T0 * (4.0 * T1 - T0) / T3);
- T4 = -(0.5 + 24.0 * T0 * T0 / T3) * (1.0 - dDeltaPhi_dVg);
- T5 = T7 * AbulkCV;
- T6 = T7 * VdseffCV;
-
- Csg = CoxWLcen * (T4 + T5 * dVdseffCV_dVg);
- Csd = CoxWLcen * T5 * dVdseffCV_dVd + Csg * dVgsteff_dVd
- + QovCox * dCoxeff_dVd;
- Csb = CoxWLcen * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
- + Csg * dVgsteff_dVb + QovCox * dCoxeff_dVb;
- Csg = Csg * dVgsteff_dVg + QovCox * dCoxeff_dVg;
- }
- else if (model->BSIM3V2xpart < 0.5)
- { /* 40/60 partition */
- T2 = T2 / 12.0;
- T3 = 0.5 * CoxWLcen / (T2 * T2);
- T4 = T1 * (2.0 * T0 * T0 / 3.0 + T1 * (T1 - 4.0
- * T0 / 3.0)) - 2.0 * T0 * T0 * T0 / 15.0;
- qsrc = -T3 * T4;
- QovCox = qsrc / Coxeff;
- T8 = 4.0 / 3.0 * T1 * (T1 - T0) + 0.4 * T0 * T0;
- T5 = -2.0 * qsrc / T2 - T3 * (T1 * (3.0 * T1 - 8.0
- * T0 / 3.0) + 2.0 * T0 * T0 / 3.0);
- T6 = AbulkCV * (qsrc / T2 + T3 * T8);
- T7 = T6 * VdseffCV / AbulkCV;
-
- Csg = T5 * (1.0 - dDeltaPhi_dVg) + T6 * dVdseffCV_dVg;
- Csd = Csg * dVgsteff_dVd + T6 * dVdseffCV_dVd
- + QovCox * dCoxeff_dVd;
- Csb = Csg * dVgsteff_dVb + T6 * dVdseffCV_dVb
- + T7 * dAbulkCV_dVb + QovCox * dCoxeff_dVb;
- Csg = Csg * dVgsteff_dVg + QovCox * dCoxeff_dVg;
- }
- else
- { /* 50/50 partition */
- qsrc = -0.5 * qgate;
- Csg = -0.5 * Cgg1;
- Csd = -0.5 * Cgd1;
- Csb = -0.5 * Cgb1;
- }
-
- qgate += Qac0 + Qsub0 - qbulk;
- qbulk -= (Qac0 + Qsub0);
- qdrn = -(qgate + qbulk + qsrc);
-
- Cbg = Cbg1 - dQac0_dVg - dQsub0_dVg;
- Cbd = Cbd1 - dQsub0_dVd;
- Cbb = Cbb1 - dQac0_dVb - dQsub0_dVb;
-
- Cgg = Cgg1 - Cbg;
- Cgd = Cgd1 - Cbd;
- Cgb = Cgb1 - Cbb;
-
- Cgb *= dVbseff_dVb;
- Cbb *= dVbseff_dVb;
- Csb *= dVbseff_dVb;
-
- here->BSIM3V2cggb = Cgg;
- here->BSIM3V2cgsb = -(Cgg + Cgd + Cgb);
- here->BSIM3V2cgdb = Cgd;
- here->BSIM3V2cdgb = -(Cgg + Cbg + Csg);
- here->BSIM3V2cdsb = (Cgg + Cgd + Cgb + Cbg + Cbd + Cbb
- + Csg + Csd + Csb);
- here->BSIM3V2cddb = -(Cgd + Cbd + Csd);
- here->BSIM3V2cbgb = Cbg;
- here->BSIM3V2cbsb = -(Cbg + Cbd + Cbb);
- here->BSIM3V2cbdb = Cbd;
- here->BSIM3V2qinv = -qinoi;
- } /* End of CTM */
- }
-
-finished:
- /* Returning Values to Calling Routine */
- /*
- * COMPUTE EQUIVALENT DRAIN CURRENT SOURCE
- */
-
- here->BSIM3V2qgate = qgate;
- here->BSIM3V2qbulk = qbulk;
- here->BSIM3V2qdrn = qdrn;
- here->BSIM3V2cd = cdrain;
-
- if (ChargeComputationNeeded)
- { /* charge storage elements
- * bulk-drain and bulk-source depletion capacitances
- * czbd : zero bias drain junction capacitance
- * czbs : zero bias source junction capacitance
- * czbdsw: zero bias drain junction sidewall capacitance
- along field oxide
- * czbssw: zero bias source junction sidewall capacitance
- along field oxide
- * czbdswg: zero bias drain junction sidewall capacitance
- along gate side
- * czbsswg: zero bias source junction sidewall capacitance
- along gate side
- */
-
- czbd = model->BSIM3V2unitAreaJctCap * here->BSIM3V2drainArea;
- czbs = model->BSIM3V2unitAreaJctCap * here->BSIM3V2sourceArea;
- if (here->BSIM3V2drainPerimeter < pParam->BSIM3V2weff)
- {
- czbdswg = model->BSIM3V2unitLengthGateSidewallJctCap
- * here->BSIM3V2drainPerimeter;
- czbdsw = 0.0;
- }
- else
- {
- czbdsw = model->BSIM3V2unitLengthSidewallJctCap
- * (here->BSIM3V2drainPerimeter - pParam->BSIM3V2weff);
- czbdswg = model->BSIM3V2unitLengthGateSidewallJctCap
- * pParam->BSIM3V2weff;
- }
- if (here->BSIM3V2sourcePerimeter < pParam->BSIM3V2weff)
- {
- czbssw = 0.0;
- czbsswg = model->BSIM3V2unitLengthGateSidewallJctCap
- * here->BSIM3V2sourcePerimeter;
- }
- else
- {
- czbssw = model->BSIM3V2unitLengthSidewallJctCap
- * (here->BSIM3V2sourcePerimeter - pParam->BSIM3V2weff);
- czbsswg = model->BSIM3V2unitLengthGateSidewallJctCap
- * pParam->BSIM3V2weff;
- }
-
- MJ = model->BSIM3V2bulkJctBotGradingCoeff;
- MJSW = model->BSIM3V2bulkJctSideGradingCoeff;
- MJSWG = model->BSIM3V2bulkJctGateSideGradingCoeff;
-
- /* Source Bulk Junction */
- if (vbs == 0.0)
- { *(ckt->CKTstate0 + here->BSIM3V2qbs) = 0.0;
- here->BSIM3V2capbs = czbs + czbssw + czbsswg;
- }
- else if (vbs < 0.0)
- { if (czbs > 0.0)
- { arg = 1.0 - vbs / model->BSIM3V2PhiB;
- if (MJ == 0.5)
- sarg = 1.0 / sqrt(arg);
- else
- sarg = exp(-MJ * log(arg));
- *(ckt->CKTstate0 + here->BSIM3V2qbs) = model->BSIM3V2PhiB * czbs
- * (1.0 - arg * sarg) / (1.0 - MJ);
- here->BSIM3V2capbs = czbs * sarg;
- }
- else
- { *(ckt->CKTstate0 + here->BSIM3V2qbs) = 0.0;
- here->BSIM3V2capbs = 0.0;
- }
- if (czbssw > 0.0)
- { arg = 1.0 - vbs / model->BSIM3V2PhiBSW;
- if (MJSW == 0.5)
- sarg = 1.0 / sqrt(arg);
- else
- sarg = exp(-MJSW * log(arg));
- *(ckt->CKTstate0 + here->BSIM3V2qbs) += model->BSIM3V2PhiBSW * czbssw
- * (1.0 - arg * sarg) / (1.0 - MJSW);
- here->BSIM3V2capbs += czbssw * sarg;
- }
- if (czbsswg > 0.0)
- { arg = 1.0 - vbs / model->BSIM3V2PhiBSWG;
- if (MJSWG == 0.5)
- sarg = 1.0 / sqrt(arg);
- else
- sarg = exp(-MJSWG * log(arg));
- *(ckt->CKTstate0 + here->BSIM3V2qbs) += model->BSIM3V2PhiBSWG * czbsswg
- * (1.0 - arg * sarg) / (1.0 - MJSWG);
- here->BSIM3V2capbs += czbsswg * sarg;
- }
-
- }
- else
- { T0 = czbs + czbssw + czbsswg;
- T1 = vbs * (czbs * MJ / model->BSIM3V2PhiB + czbssw * MJSW
- / model->BSIM3V2PhiBSW + czbsswg * MJSWG / model->BSIM3V2PhiBSWG);
- *(ckt->CKTstate0 + here->BSIM3V2qbs) = vbs * (T0 + 0.5 * T1);
- here->BSIM3V2capbs = T0 + T1;
- }
-
- /* Drain Bulk Junction */
- if (vbd == 0.0)
- { *(ckt->CKTstate0 + here->BSIM3V2qbd) = 0.0;
- here->BSIM3V2capbd = czbd + czbdsw + czbdswg;
- }
- else if (vbd < 0.0)
- { if (czbd > 0.0)
- { arg = 1.0 - vbd / model->BSIM3V2PhiB;
- if (MJ == 0.5)
- sarg = 1.0 / sqrt(arg);
- else
- sarg = exp(-MJ * log(arg));
- *(ckt->CKTstate0 + here->BSIM3V2qbd) = model->BSIM3V2PhiB * czbd
- * (1.0 - arg * sarg) / (1.0 - MJ);
- here->BSIM3V2capbd = czbd * sarg;
- }
- else
- { *(ckt->CKTstate0 + here->BSIM3V2qbd) = 0.0;
- here->BSIM3V2capbd = 0.0;
- }
- if (czbdsw > 0.0)
- { arg = 1.0 - vbd / model->BSIM3V2PhiBSW;
- if (MJSW == 0.5)
- sarg = 1.0 / sqrt(arg);
- else
- sarg = exp(-MJSW * log(arg));
- *(ckt->CKTstate0 + here->BSIM3V2qbd) += model->BSIM3V2PhiBSW * czbdsw
- * (1.0 - arg * sarg) / (1.0 - MJSW);
- here->BSIM3V2capbd += czbdsw * sarg;
- }
- if (czbdswg > 0.0)
- { arg = 1.0 - vbd / model->BSIM3V2PhiBSWG;
- if (MJSWG == 0.5)
- sarg = 1.0 / sqrt(arg);
- else
- sarg = exp(-MJSWG * log(arg));
- *(ckt->CKTstate0 + here->BSIM3V2qbd) += model->BSIM3V2PhiBSWG * czbdswg
- * (1.0 - arg * sarg) / (1.0 - MJSWG);
- here->BSIM3V2capbd += czbdswg * sarg;
- }
- }
- else
- { T0 = czbd + czbdsw + czbdswg;
- T1 = vbd * (czbd * MJ / model->BSIM3V2PhiB + czbdsw * MJSW
- / model->BSIM3V2PhiBSW + czbdswg * MJSWG / model->BSIM3V2PhiBSWG);
- *(ckt->CKTstate0 + here->BSIM3V2qbd) = vbd * (T0 + 0.5 * T1);
- here->BSIM3V2capbd = T0 + T1;
- }
- }
-
- /*
- * check convergence
- */
- if ((here->BSIM3V2off == 0) || (!(ckt->CKTmode & MODEINITFIX))) {
- if (Check == 1) {
- ckt->CKTnoncon++;
- }
- }
- *(ckt->CKTstate0 + here->BSIM3V2vbs) = vbs;
- *(ckt->CKTstate0 + here->BSIM3V2vbd) = vbd;
- *(ckt->CKTstate0 + here->BSIM3V2vgs) = vgs;
- *(ckt->CKTstate0 + here->BSIM3V2vds) = vds;
- *(ckt->CKTstate0 + here->BSIM3V2qdef) = qdef;
-
- /* bulk and channel charge plus overlaps */
-
- if (!ChargeComputationNeeded)
- goto line850;
-
-line755:
- /* NQS (Mansun 11/1993) modified by Weidong & Min-Chie 1997-1998 */
- if (here->BSIM3V2nqsMod)
- { qcheq = -(qbulk + qgate);
-
- here->BSIM3V2cqgb = -(here->BSIM3V2cggb + here->BSIM3V2cbgb);
- here->BSIM3V2cqdb = -(here->BSIM3V2cgdb + here->BSIM3V2cbdb);
- here->BSIM3V2cqsb = -(here->BSIM3V2cgsb + here->BSIM3V2cbsb);
- here->BSIM3V2cqbb = -(here->BSIM3V2cqgb + here->BSIM3V2cqdb
- + here->BSIM3V2cqsb);
-
- gtau_drift = fabs(pParam->BSIM3V2tconst * qcheq) * ScalingFactor;
- T0 = pParam->BSIM3V2leffCV * pParam->BSIM3V2leffCV;
- gtau_diff = 16.0 * pParam->BSIM3V2u0temp * model->BSIM3V2vtm / T0
- * ScalingFactor;
- here->BSIM3V2gtau = gtau_drift + gtau_diff;
- }
-
- if (model->BSIM3V2capMod == 0)
- { if (vgd < 0.0)
- {
- cgdo = pParam->BSIM3V2cgdo;
- qgdo = pParam->BSIM3V2cgdo * vgd;
- }
- else
- { cgdo = pParam->BSIM3V2cgdo;
- qgdo = pParam->BSIM3V2cgdo * vgd;
- }
-
- if (vgs < 0.0)
- {
- cgso = pParam->BSIM3V2cgso;
- qgso = pParam->BSIM3V2cgso * vgs;
- }
- else
- { cgso = pParam->BSIM3V2cgso;
- qgso = pParam->BSIM3V2cgso * vgs;
- }
- }
- else if (model->BSIM3V2capMod == 1)
- { if (vgd < 0.0)
- { T1 = sqrt(1.0 - 4.0 * vgd / pParam->BSIM3V2ckappa);
- cgdo = pParam->BSIM3V2cgdo + pParam->BSIM3V2weffCV
- * pParam->BSIM3V2cgdl / T1;
- qgdo = pParam->BSIM3V2cgdo * vgd - pParam->BSIM3V2weffCV * 0.5
- * pParam->BSIM3V2cgdl * pParam->BSIM3V2ckappa * (T1 - 1.0);
- }
- else
- { cgdo = pParam->BSIM3V2cgdo + pParam->BSIM3V2weffCV
- * pParam->BSIM3V2cgdl;
- qgdo = (pParam->BSIM3V2weffCV * pParam->BSIM3V2cgdl
- + pParam->BSIM3V2cgdo) * vgd;
- }
-
- if (vgs < 0.0)
- { T1 = sqrt(1.0 - 4.0 * vgs / pParam->BSIM3V2ckappa);
- cgso = pParam->BSIM3V2cgso + pParam->BSIM3V2weffCV
- * pParam->BSIM3V2cgsl / T1;
- qgso = pParam->BSIM3V2cgso * vgs - pParam->BSIM3V2weffCV * 0.5
- * pParam->BSIM3V2cgsl * pParam->BSIM3V2ckappa * (T1 - 1.0);
- }
- else
- { cgso = pParam->BSIM3V2cgso + pParam->BSIM3V2weffCV
- * pParam->BSIM3V2cgsl;
- qgso = (pParam->BSIM3V2weffCV * pParam->BSIM3V2cgsl
- + pParam->BSIM3V2cgso) * vgs;
- }
- }
- else
- { T0 = vgd + DELTA_1;
- T1 = sqrt(T0 * T0 + 4.0 * DELTA_1);
- T2 = 0.5 * (T0 - T1);
-
- T3 = pParam->BSIM3V2weffCV * pParam->BSIM3V2cgdl;
- T4 = sqrt(1.0 - 4.0 * T2 / pParam->BSIM3V2ckappa);
- cgdo = pParam->BSIM3V2cgdo + T3 - T3 * (1.0 - 1.0 / T4)
- * (0.5 - 0.5 * T0 / T1);
- qgdo = (pParam->BSIM3V2cgdo + T3) * vgd - T3 * (T2
- + 0.5 * pParam->BSIM3V2ckappa * (T4 - 1.0));
-
- T0 = vgs + DELTA_1;
- T1 = sqrt(T0 * T0 + 4.0 * DELTA_1);
- T2 = 0.5 * (T0 - T1);
- T3 = pParam->BSIM3V2weffCV * pParam->BSIM3V2cgsl;
- T4 = sqrt(1.0 - 4.0 * T2 / pParam->BSIM3V2ckappa);
- cgso = pParam->BSIM3V2cgso + T3 - T3 * (1.0 - 1.0 / T4)
- * (0.5 - 0.5 * T0 / T1);
- qgso = (pParam->BSIM3V2cgso + T3) * vgs - T3 * (T2
- + 0.5 * pParam->BSIM3V2ckappa * (T4 - 1.0));
- }
-
- here->BSIM3V2cgdo = cgdo;
- here->BSIM3V2cgso = cgso;
-
- ag0 = ckt->CKTag[0];
- if (here->BSIM3V2mode > 0)
- { if (here->BSIM3V2nqsMod == 0)
- { gcggb = (here->BSIM3V2cggb + cgdo + cgso
- + pParam->BSIM3V2cgbo ) * ag0;
- gcgdb = (here->BSIM3V2cgdb - cgdo) * ag0;
- gcgsb = (here->BSIM3V2cgsb - cgso) * ag0;
-
- gcdgb = (here->BSIM3V2cdgb - cgdo) * ag0;
- gcddb = (here->BSIM3V2cddb + here->BSIM3V2capbd + cgdo) * ag0;
- gcdsb = here->BSIM3V2cdsb * ag0;
-
- gcsgb = -(here->BSIM3V2cggb + here->BSIM3V2cbgb
- + here->BSIM3V2cdgb + cgso) * ag0;
- gcsdb = -(here->BSIM3V2cgdb + here->BSIM3V2cbdb
- + here->BSIM3V2cddb) * ag0;
- gcssb = (here->BSIM3V2capbs + cgso - (here->BSIM3V2cgsb
- + here->BSIM3V2cbsb + here->BSIM3V2cdsb)) * ag0;
-
- gcbgb = (here->BSIM3V2cbgb - pParam->BSIM3V2cgbo) * ag0;
- gcbdb = (here->BSIM3V2cbdb - here->BSIM3V2capbd) * ag0;
- gcbsb = (here->BSIM3V2cbsb - here->BSIM3V2capbs) * ag0;
-
- qgd = qgdo;
- qgs = qgso;
- qgb = pParam->BSIM3V2cgbo * vgb;
- qgate += qgd + qgs + qgb;
- qbulk -= qgb;
- qdrn -= qgd;
- qsrc = -(qgate + qbulk + qdrn);
-
- ggtg = ggtd = ggtb = ggts = 0.0;
- sxpart = 0.6;
- dxpart = 0.4;
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb = ddxpart_dVs = 0.0;
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb = dsxpart_dVs = 0.0;
- }
- else
- { if (qcheq > 0.0)
- T0 = pParam->BSIM3V2tconst * qdef * ScalingFactor;
- else
- T0 = -pParam->BSIM3V2tconst * qdef * ScalingFactor;
- ggtg = here->BSIM3V2gtg = T0 * here->BSIM3V2cqgb;
- ggtd = here->BSIM3V2gtd = T0 * here->BSIM3V2cqdb;
- ggts = here->BSIM3V2gts = T0 * here->BSIM3V2cqsb;
- ggtb = here->BSIM3V2gtb = T0 * here->BSIM3V2cqbb;
- gqdef = ScalingFactor * ag0;
-
- gcqgb = here->BSIM3V2cqgb * ag0;
- gcqdb = here->BSIM3V2cqdb * ag0;
- gcqsb = here->BSIM3V2cqsb * ag0;
- gcqbb = here->BSIM3V2cqbb * ag0;
-
- gcggb = (cgdo + cgso + pParam->BSIM3V2cgbo ) * ag0;
- gcgdb = -cgdo * ag0;
- gcgsb = -cgso * ag0;
-
- gcdgb = -cgdo * ag0;
- gcddb = (here->BSIM3V2capbd + cgdo) * ag0;
- gcdsb = 0.0;
-
- gcsgb = -cgso * ag0;
- gcsdb = 0.0;
- gcssb = (here->BSIM3V2capbs + cgso) * ag0;
-
- gcbgb = -pParam->BSIM3V2cgbo * ag0;
- gcbdb = -here->BSIM3V2capbd * ag0;
- gcbsb = -here->BSIM3V2capbs * ag0;
-
- CoxWL = model->BSIM3V2cox * pParam->BSIM3V2weffCV
- * pParam->BSIM3V2leffCV;
- if (fabs(qcheq) <= 1.0e-5 * CoxWL)
- { if (model->BSIM3V2xpart < 0.5)
- { dxpart = 0.4;
- }
- else if (model->BSIM3V2xpart > 0.5)
- { dxpart = 0.0;
- }
- else
- { dxpart = 0.5;
- }
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb
- = ddxpart_dVs = 0.0;
- }
- else
- { dxpart = qdrn / qcheq;
- Cdd = here->BSIM3V2cddb;
- Csd = -(here->BSIM3V2cgdb + here->BSIM3V2cddb
- + here->BSIM3V2cbdb);
- ddxpart_dVd = (Cdd - dxpart * (Cdd + Csd)) / qcheq;
- Cdg = here->BSIM3V2cdgb;
- Csg = -(here->BSIM3V2cggb + here->BSIM3V2cdgb
- + here->BSIM3V2cbgb);
- ddxpart_dVg = (Cdg - dxpart * (Cdg + Csg)) / qcheq;
-
- Cds = here->BSIM3V2cdsb;
- Css = -(here->BSIM3V2cgsb + here->BSIM3V2cdsb
- + here->BSIM3V2cbsb);
- ddxpart_dVs = (Cds - dxpart * (Cds + Css)) / qcheq;
-
- ddxpart_dVb = -(ddxpart_dVd + ddxpart_dVg + ddxpart_dVs);
- }
- sxpart = 1.0 - dxpart;
- dsxpart_dVd = -ddxpart_dVd;
- dsxpart_dVg = -ddxpart_dVg;
- dsxpart_dVs = -ddxpart_dVs;
- dsxpart_dVb = -(dsxpart_dVd + dsxpart_dVg + dsxpart_dVs);
-
- qgd = qgdo;
- qgs = qgso;
- qgb = pParam->BSIM3V2cgbo * vgb;
- qgate = qgd + qgs + qgb;
- qbulk = -qgb;
- qdrn = -qgd;
- qsrc = -(qgate + qbulk + qdrn);
- }
- }
- else
- { if (here->BSIM3V2nqsMod == 0)
- { gcggb = (here->BSIM3V2cggb + cgdo + cgso
- + pParam->BSIM3V2cgbo ) * ag0;
- gcgdb = (here->BSIM3V2cgsb - cgdo) * ag0;
- gcgsb = (here->BSIM3V2cgdb - cgso) * ag0;
-
- gcdgb = -(here->BSIM3V2cggb + here->BSIM3V2cbgb
- + here->BSIM3V2cdgb + cgdo) * ag0;
- gcddb = (here->BSIM3V2capbd + cgdo - (here->BSIM3V2cgsb
- + here->BSIM3V2cbsb + here->BSIM3V2cdsb)) * ag0;
- gcdsb = -(here->BSIM3V2cgdb + here->BSIM3V2cbdb
- + here->BSIM3V2cddb) * ag0;
-
- gcsgb = (here->BSIM3V2cdgb - cgso) * ag0;
- gcsdb = here->BSIM3V2cdsb * ag0;
- gcssb = (here->BSIM3V2cddb + here->BSIM3V2capbs + cgso) * ag0;
-
- gcbgb = (here->BSIM3V2cbgb - pParam->BSIM3V2cgbo) * ag0;
- gcbdb = (here->BSIM3V2cbsb - here->BSIM3V2capbd) * ag0;
- gcbsb = (here->BSIM3V2cbdb - here->BSIM3V2capbs) * ag0;
-
- qgd = qgdo;
- qgs = qgso;
- qgb = pParam->BSIM3V2cgbo * vgb;
- qgate += qgd + qgs + qgb;
- qbulk -= qgb;
- qsrc = qdrn - qgs;
- qdrn = -(qgate + qbulk + qsrc);
-
- ggtg = ggtd = ggtb = ggts = 0.0;
- sxpart = 0.4;
- dxpart = 0.6;
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb = ddxpart_dVs = 0.0;
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb = dsxpart_dVs = 0.0;
- }
- else
- { if (qcheq > 0.0)
- T0 = pParam->BSIM3V2tconst * qdef * ScalingFactor;
- else
- T0 = -pParam->BSIM3V2tconst * qdef * ScalingFactor;
- ggtg = here->BSIM3V2gtg = T0 * here->BSIM3V2cqgb;
- ggts = here->BSIM3V2gtd = T0 * here->BSIM3V2cqdb;
- ggtd = here->BSIM3V2gts = T0 * here->BSIM3V2cqsb;
- ggtb = here->BSIM3V2gtb = T0 * here->BSIM3V2cqbb;
- gqdef = ScalingFactor * ag0;
-
- gcqgb = here->BSIM3V2cqgb * ag0;
- gcqdb = here->BSIM3V2cqsb * ag0;
- gcqsb = here->BSIM3V2cqdb * ag0;
- gcqbb = here->BSIM3V2cqbb * ag0;
-
- gcggb = (cgdo + cgso + pParam->BSIM3V2cgbo) * ag0;
- gcgdb = -cgdo * ag0;
- gcgsb = -cgso * ag0;
-
- gcdgb = -cgdo * ag0;
- gcddb = (here->BSIM3V2capbd + cgdo) * ag0;
- gcdsb = 0.0;
-
- gcsgb = -cgso * ag0;
- gcsdb = 0.0;
- gcssb = (here->BSIM3V2capbs + cgso) * ag0;
-
- gcbgb = -pParam->BSIM3V2cgbo * ag0;
- gcbdb = -here->BSIM3V2capbd * ag0;
- gcbsb = -here->BSIM3V2capbs * ag0;
-
- CoxWL = model->BSIM3V2cox * pParam->BSIM3V2weffCV
- * pParam->BSIM3V2leffCV;
- if (fabs(qcheq) <= 1.0e-5 * CoxWL)
- { if (model->BSIM3V2xpart < 0.5)
- { sxpart = 0.4;
- }
- else if (model->BSIM3V2xpart > 0.5)
- { sxpart = 0.0;
- }
- else
- { sxpart = 0.5;
- }
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb
- = dsxpart_dVs = 0.0;
- }
- else
- { sxpart = qdrn / qcheq;
- Css = here->BSIM3V2cddb;
- Cds = -(here->BSIM3V2cgdb + here->BSIM3V2cddb
- + here->BSIM3V2cbdb);
- dsxpart_dVs = (Css - sxpart * (Css + Cds)) / qcheq;
- Csg = here->BSIM3V2cdgb;
- Cdg = -(here->BSIM3V2cggb + here->BSIM3V2cdgb
- + here->BSIM3V2cbgb);
- dsxpart_dVg = (Csg - sxpart * (Csg + Cdg)) / qcheq;
-
- Csd = here->BSIM3V2cdsb;
- Cdd = -(here->BSIM3V2cgsb + here->BSIM3V2cdsb
- + here->BSIM3V2cbsb);
- dsxpart_dVd = (Csd - sxpart * (Csd + Cdd)) / qcheq;
-
- dsxpart_dVb = -(dsxpart_dVd + dsxpart_dVg + dsxpart_dVs);
- }
- dxpart = 1.0 - sxpart;
- ddxpart_dVd = -dsxpart_dVd;
- ddxpart_dVg = -dsxpart_dVg;
- ddxpart_dVs = -dsxpart_dVs;
- ddxpart_dVb = -(ddxpart_dVd + ddxpart_dVg + ddxpart_dVs);
-
- qgd = qgdo;
- qgs = qgso;
- qgb = pParam->BSIM3V2cgbo * vgb;
- qgate = qgd + qgs + qgb;
- qbulk = -qgb;
- qsrc = -qgs;
- qdrn = -(qgate + qbulk + qsrc);
- }
- }
-
- cqdef = cqcheq = 0.0;
- if (ByPass) goto line860;
-
- *(ckt->CKTstate0 + here->BSIM3V2qg) = qgate;
- *(ckt->CKTstate0 + here->BSIM3V2qd) = qdrn
- - *(ckt->CKTstate0 + here->BSIM3V2qbd);
- *(ckt->CKTstate0 + here->BSIM3V2qb) = qbulk
- + *(ckt->CKTstate0 + here->BSIM3V2qbd)
- + *(ckt->CKTstate0 + here->BSIM3V2qbs);
-
- if (here->BSIM3V2nqsMod)
- { *(ckt->CKTstate0 + here->BSIM3V2qcdump) = qdef * ScalingFactor;
- *(ckt->CKTstate0 + here->BSIM3V2qcheq) = qcheq;
- }
-
- /* store small signal parameters */
- if (ckt->CKTmode & MODEINITSMSIG)
- { goto line1000;
- }
- if (!ChargeComputationNeeded)
- goto line850;
-
- if (ckt->CKTmode & MODEINITTRAN)
- { *(ckt->CKTstate1 + here->BSIM3V2qb) =
- *(ckt->CKTstate0 + here->BSIM3V2qb);
- *(ckt->CKTstate1 + here->BSIM3V2qg) =
- *(ckt->CKTstate0 + here->BSIM3V2qg);
- *(ckt->CKTstate1 + here->BSIM3V2qd) =
- *(ckt->CKTstate0 + here->BSIM3V2qd);
- if (here->BSIM3V2nqsMod)
- { *(ckt->CKTstate1 + here->BSIM3V2qcheq) =
- *(ckt->CKTstate0 + here->BSIM3V2qcheq);
- *(ckt->CKTstate1 + here->BSIM3V2qcdump) =
- *(ckt->CKTstate0 + here->BSIM3V2qcdump);
- }
- }
-
- error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM3V2qb);
- if (error)
- return(error);
- error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM3V2qg);
- if (error)
- return(error);
- error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM3V2qd);
- if (error)
- return(error);
- if (here->BSIM3V2nqsMod)
- { error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM3V2qcdump);
- if (error)
- return(error);
- error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM3V2qcheq);
- if (error)
- return(error);
- }
-
- goto line860;
-
-line850:
- /* initialize to zero charge conductance and current */
- ceqqg = ceqqb = ceqqd = 0.0;
- cqcheq = cqdef = 0.0;
-
- gcdgb = gcddb = gcdsb = 0.0;
- gcsgb = gcsdb = gcssb = 0.0;
- gcggb = gcgdb = gcgsb = 0.0;
- gcbgb = gcbdb = gcbsb = 0.0;
-
- gqdef = gcqgb = gcqdb = gcqsb = gcqbb = 0.0;
- ggtg = ggtd = ggtb = ggts = 0.0;
- sxpart = (1.0 - (dxpart = (here->BSIM3V2mode > 0) ? 0.4 : 0.6));
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb = ddxpart_dVs = 0.0;
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb = dsxpart_dVs = 0.0;
-
- if (here->BSIM3V2nqsMod)
- here->BSIM3V2gtau = 16.0 * pParam->BSIM3V2u0temp * model->BSIM3V2vtm
- / pParam->BSIM3V2leffCV / pParam->BSIM3V2leffCV
- * ScalingFactor;
- else
- here->BSIM3V2gtau = 0.0;
-
- goto line900;
-
-line860:
- /* evaluate equivalent charge current */
-
- cqgate = *(ckt->CKTstate0 + here->BSIM3V2cqg);
- cqbulk = *(ckt->CKTstate0 + here->BSIM3V2cqb);
- cqdrn = *(ckt->CKTstate0 + here->BSIM3V2cqd);
-
- ceqqg = cqgate - gcggb * vgb + gcgdb * vbd + gcgsb * vbs;
- ceqqb = cqbulk - gcbgb * vgb + gcbdb * vbd + gcbsb * vbs;
- ceqqd = cqdrn - gcdgb * vgb + gcddb * vbd + gcdsb * vbs;
-
- if (here->BSIM3V2nqsMod)
- { T0 = ggtg * vgb - ggtd * vbd - ggts * vbs;
- ceqqg += T0;
- T1 = qdef * here->BSIM3V2gtau;
- ceqqd -= dxpart * T0 + T1 * (ddxpart_dVg * vgb - ddxpart_dVd
- * vbd - ddxpart_dVs * vbs);
- cqdef = *(ckt->CKTstate0 + here->BSIM3V2cqcdump) - gqdef * qdef;
- cqcheq = *(ckt->CKTstate0 + here->BSIM3V2cqcheq)
- - (gcqgb * vgb - gcqdb * vbd - gcqsb * vbs) + T0;
- }
-
- if (ckt->CKTmode & MODEINITTRAN)
- { *(ckt->CKTstate1 + here->BSIM3V2cqb) =
- *(ckt->CKTstate0 + here->BSIM3V2cqb);
- *(ckt->CKTstate1 + here->BSIM3V2cqg) =
- *(ckt->CKTstate0 + here->BSIM3V2cqg);
- *(ckt->CKTstate1 + here->BSIM3V2cqd) =
- *(ckt->CKTstate0 + here->BSIM3V2cqd);
-
- if (here->BSIM3V2nqsMod)
- { *(ckt->CKTstate1 + here->BSIM3V2cqcheq) =
- *(ckt->CKTstate0 + here->BSIM3V2cqcheq);
- *(ckt->CKTstate1 + here->BSIM3V2cqcdump) =
- *(ckt->CKTstate0 + here->BSIM3V2cqcdump);
- }
- }
-
- /*
- * load current vector
- */
-line900:
-
- if (here->BSIM3V2mode >= 0)
- { Gm = here->BSIM3V2gm;
- Gmbs = here->BSIM3V2gmbs;
- FwdSum = Gm + Gmbs;
- RevSum = 0.0;
- cdreq = model->BSIM3V2type * (cdrain - here->BSIM3V2gds * vds
- - Gm * vgs - Gmbs * vbs);
-
- ceqbd = -model->BSIM3V2type * (here->BSIM3V2csub
- - here->BSIM3V2gbds * vds - here->BSIM3V2gbgs * vgs
- - here->BSIM3V2gbbs * vbs);
- ceqbs = 0.0;
-
- gbbdp = -here->BSIM3V2gbds;
- gbbsp = (here->BSIM3V2gbds + here->BSIM3V2gbgs + here->BSIM3V2gbbs);
-
- gbdpg = here->BSIM3V2gbgs;
- gbdpdp = here->BSIM3V2gbds;
- gbdpb = here->BSIM3V2gbbs;
- gbdpsp = -(gbdpg + gbdpdp + gbdpb);
-
- gbspg = 0.0;
- gbspdp = 0.0;
- gbspb = 0.0;
- gbspsp = 0.0;
- }
- else
- { Gm = -here->BSIM3V2gm;
- Gmbs = -here->BSIM3V2gmbs;
- FwdSum = 0.0;
- RevSum = -(Gm + Gmbs);
- cdreq = -model->BSIM3V2type * (cdrain + here->BSIM3V2gds * vds
- + Gm * vgd + Gmbs * vbd);
-
- ceqbs = -model->BSIM3V2type * (here->BSIM3V2csub
- + here->BSIM3V2gbds * vds - here->BSIM3V2gbgs * vgd
- - here->BSIM3V2gbbs * vbd);
- ceqbd = 0.0;
-
- gbbsp = -here->BSIM3V2gbds;
- gbbdp = (here->BSIM3V2gbds + here->BSIM3V2gbgs + here->BSIM3V2gbbs);
-
- gbdpg = 0.0;
- gbdpsp = 0.0;
- gbdpb = 0.0;
- gbdpdp = 0.0;
-
- gbspg = here->BSIM3V2gbgs;
- gbspsp = here->BSIM3V2gbds;
- gbspb = here->BSIM3V2gbbs;
- gbspdp = -(gbspg + gbspsp + gbspb);
- }
-
- if (model->BSIM3V2type > 0)
- { ceqbs += (here->BSIM3V2cbs - here->BSIM3V2gbs * vbs);
- ceqbd += (here->BSIM3V2cbd - here->BSIM3V2gbd * vbd);
- /*
- ceqqg = ceqqg;
- ceqqb = ceqqb;
- ceqqd = ceqqd;
- cqdef = cqdef;
- cqcheq = cqcheq;
- */
- }
- else
- { ceqbs -= (here->BSIM3V2cbs - here->BSIM3V2gbs * vbs);
- ceqbd -= (here->BSIM3V2cbd - here->BSIM3V2gbd * vbd);
- ceqqg = -ceqqg;
- ceqqb = -ceqqb;
- ceqqd = -ceqqd;
- cqdef = -cqdef;
- cqcheq = -cqcheq;
- }
-
- (*(ckt->CKTrhs + here->BSIM3V2gNode) -= ceqqg);
- (*(ckt->CKTrhs + here->BSIM3V2bNode) -=(ceqbs + ceqbd + ceqqb));
- (*(ckt->CKTrhs + here->BSIM3V2dNodePrime) += (ceqbd - cdreq - ceqqd));
- (*(ckt->CKTrhs + here->BSIM3V2sNodePrime) += (cdreq + ceqbs + ceqqg
- + ceqqb + ceqqd));
- if (here->BSIM3V2nqsMod)
- *(ckt->CKTrhs + here->BSIM3V2qNode) += (cqcheq - cqdef);
-
- /*
- * load y matrix
- */
-
- T1 = qdef * here->BSIM3V2gtau;
- (*(here->BSIM3V2DdPtr) += here->BSIM3V2drainConductance);
- (*(here->BSIM3V2GgPtr) += gcggb - ggtg);
- (*(here->BSIM3V2SsPtr) += here->BSIM3V2sourceConductance);
- (*(here->BSIM3V2BbPtr) += here->BSIM3V2gbd + here->BSIM3V2gbs
- - gcbgb - gcbdb - gcbsb - here->BSIM3V2gbbs);
- (*(here->BSIM3V2DPdpPtr) += here->BSIM3V2drainConductance
- + here->BSIM3V2gds + here->BSIM3V2gbd
- + RevSum + gcddb + dxpart * ggtd
- + T1 * ddxpart_dVd + gbdpdp);
- (*(here->BSIM3V2SPspPtr) += here->BSIM3V2sourceConductance
- + here->BSIM3V2gds + here->BSIM3V2gbs
- + FwdSum + gcssb + sxpart * ggts
- + T1 * dsxpart_dVs + gbspsp);
- (*(here->BSIM3V2DdpPtr) -= here->BSIM3V2drainConductance);
- (*(here->BSIM3V2GbPtr) -= gcggb + gcgdb + gcgsb + ggtb);
- (*(here->BSIM3V2GdpPtr) += gcgdb - ggtd);
- (*(here->BSIM3V2GspPtr) += gcgsb - ggts);
- (*(here->BSIM3V2SspPtr) -= here->BSIM3V2sourceConductance);
- (*(here->BSIM3V2BgPtr) += gcbgb - here->BSIM3V2gbgs);
- (*(here->BSIM3V2BdpPtr) += gcbdb - here->BSIM3V2gbd + gbbdp);
- (*(here->BSIM3V2BspPtr) += gcbsb - here->BSIM3V2gbs + gbbsp);
- (*(here->BSIM3V2DPdPtr) -= here->BSIM3V2drainConductance);
- (*(here->BSIM3V2DPgPtr) += Gm + gcdgb + dxpart * ggtg
- + T1 * ddxpart_dVg + gbdpg);
- (*(here->BSIM3V2DPbPtr) -= here->BSIM3V2gbd - Gmbs + gcdgb + gcddb
- + gcdsb - dxpart * ggtb
- - T1 * ddxpart_dVb - gbdpb);
- (*(here->BSIM3V2DPspPtr) -= here->BSIM3V2gds + FwdSum - gcdsb
- - dxpart * ggts - T1 * ddxpart_dVs - gbdpsp);
- (*(here->BSIM3V2SPgPtr) += gcsgb - Gm + sxpart * ggtg
- + T1 * dsxpart_dVg + gbspg);
- (*(here->BSIM3V2SPsPtr) -= here->BSIM3V2sourceConductance);
- (*(here->BSIM3V2SPbPtr) -= here->BSIM3V2gbs + Gmbs + gcsgb + gcsdb
- + gcssb - sxpart * ggtb
- - T1 * dsxpart_dVb - gbspb);
- (*(here->BSIM3V2SPdpPtr) -= here->BSIM3V2gds + RevSum - gcsdb
- - sxpart * ggtd - T1 * dsxpart_dVd - gbspdp);
-
- if (here->BSIM3V2nqsMod)
- { *(here->BSIM3V2QqPtr) += (gqdef + here->BSIM3V2gtau);
-
- *(here->BSIM3V2DPqPtr) += (dxpart * here->BSIM3V2gtau);
- *(here->BSIM3V2SPqPtr) += (sxpart * here->BSIM3V2gtau);
- *(here->BSIM3V2GqPtr) -= here->BSIM3V2gtau;
-
- *(here->BSIM3V2QgPtr) += (ggtg - gcqgb);
- *(here->BSIM3V2QdpPtr) += (ggtd - gcqdb);
- *(here->BSIM3V2QspPtr) += (ggts - gcqsb);
- *(here->BSIM3V2QbPtr) += (ggtb - gcqbb);
- }
-
-line1000: ;
-
- } /* End of Mosfet Instance */
-} /* End of Model Instance */
-
-return(OK);
-}
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2mask.c b/src/spicelib/devices/bsim3v2/b3v2mask.c
deleted file mode 100644
index 73f7a3b8d..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2mask.c
+++ /dev/null
@@ -1,1239 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: b3v2mask.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "ifsim.h"
-#include "cktdefs.h"
-#include "devdefs.h"
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "suffix.h"
-
-int
-BSIM3V2mAsk(ckt,inst,which,value)
-CKTcircuit *ckt;
-GENmodel *inst;
-int which;
-IFvalue *value;
-{
- BSIM3V2model *model = (BSIM3V2model *)inst;
- switch(which)
- { case BSIM3V2_MOD_MOBMOD:
- value->iValue = model->BSIM3V2mobMod;
- return(OK);
- case BSIM3V2_MOD_PARAMCHK:
- value->iValue = model->BSIM3V2paramChk;
- return(OK);
- case BSIM3V2_MOD_BINUNIT:
- value->iValue = model->BSIM3V2binUnit;
- return(OK);
- case BSIM3V2_MOD_CAPMOD:
- value->iValue = model->BSIM3V2capMod;
- return(OK);
- case BSIM3V2_MOD_NOIMOD:
- value->iValue = model->BSIM3V2noiMod;
- return(OK);
- case BSIM3V2_MOD_VERSION :
- value->rValue = model->BSIM3V2version;
- return(OK);
- case BSIM3V2_MOD_TOX :
- value->rValue = model->BSIM3V2tox;
- return(OK);
- case BSIM3V2_MOD_TOXM :
- value->rValue = model->BSIM3V2toxm;
- return(OK);
- case BSIM3V2_MOD_CDSC :
- value->rValue = model->BSIM3V2cdsc;
- return(OK);
- case BSIM3V2_MOD_CDSCB :
- value->rValue = model->BSIM3V2cdscb;
- return(OK);
-
- case BSIM3V2_MOD_CDSCD :
- value->rValue = model->BSIM3V2cdscd;
- return(OK);
-
- case BSIM3V2_MOD_CIT :
- value->rValue = model->BSIM3V2cit;
- return(OK);
- case BSIM3V2_MOD_NFACTOR :
- value->rValue = model->BSIM3V2nfactor;
- return(OK);
- case BSIM3V2_MOD_XJ:
- value->rValue = model->BSIM3V2xj;
- return(OK);
- case BSIM3V2_MOD_VSAT:
- value->rValue = model->BSIM3V2vsat;
- return(OK);
- case BSIM3V2_MOD_AT:
- value->rValue = model->BSIM3V2at;
- return(OK);
- case BSIM3V2_MOD_A0:
- value->rValue = model->BSIM3V2a0;
- return(OK);
-
- case BSIM3V2_MOD_AGS:
- value->rValue = model->BSIM3V2ags;
- return(OK);
-
- case BSIM3V2_MOD_A1:
- value->rValue = model->BSIM3V2a1;
- return(OK);
- case BSIM3V2_MOD_A2:
- value->rValue = model->BSIM3V2a2;
- return(OK);
- case BSIM3V2_MOD_KETA:
- value->rValue = model->BSIM3V2keta;
- return(OK);
- case BSIM3V2_MOD_NSUB:
- value->rValue = model->BSIM3V2nsub;
- return(OK);
- case BSIM3V2_MOD_NPEAK:
- value->rValue = model->BSIM3V2npeak;
- return(OK);
- case BSIM3V2_MOD_NGATE:
- value->rValue = model->BSIM3V2ngate;
- return(OK);
- case BSIM3V2_MOD_GAMMA1:
- value->rValue = model->BSIM3V2gamma1;
- return(OK);
- case BSIM3V2_MOD_GAMMA2:
- value->rValue = model->BSIM3V2gamma2;
- return(OK);
- case BSIM3V2_MOD_VBX:
- value->rValue = model->BSIM3V2vbx;
- return(OK);
- case BSIM3V2_MOD_VBM:
- value->rValue = model->BSIM3V2vbm;
- return(OK);
- case BSIM3V2_MOD_XT:
- value->rValue = model->BSIM3V2xt;
- return(OK);
- case BSIM3V2_MOD_K1:
- value->rValue = model->BSIM3V2k1;
- return(OK);
- case BSIM3V2_MOD_KT1:
- value->rValue = model->BSIM3V2kt1;
- return(OK);
- case BSIM3V2_MOD_KT1L:
- value->rValue = model->BSIM3V2kt1l;
- return(OK);
- case BSIM3V2_MOD_KT2 :
- value->rValue = model->BSIM3V2kt2;
- return(OK);
- case BSIM3V2_MOD_K2 :
- value->rValue = model->BSIM3V2k2;
- return(OK);
- case BSIM3V2_MOD_K3:
- value->rValue = model->BSIM3V2k3;
- return(OK);
- case BSIM3V2_MOD_K3B:
- value->rValue = model->BSIM3V2k3b;
- return(OK);
- case BSIM3V2_MOD_W0:
- value->rValue = model->BSIM3V2w0;
- return(OK);
- case BSIM3V2_MOD_NLX:
- value->rValue = model->BSIM3V2nlx;
- return(OK);
- case BSIM3V2_MOD_DVT0 :
- value->rValue = model->BSIM3V2dvt0;
- return(OK);
- case BSIM3V2_MOD_DVT1 :
- value->rValue = model->BSIM3V2dvt1;
- return(OK);
- case BSIM3V2_MOD_DVT2 :
- value->rValue = model->BSIM3V2dvt2;
- return(OK);
- case BSIM3V2_MOD_DVT0W :
- value->rValue = model->BSIM3V2dvt0w;
- return(OK);
- case BSIM3V2_MOD_DVT1W :
- value->rValue = model->BSIM3V2dvt1w;
- return(OK);
- case BSIM3V2_MOD_DVT2W :
- value->rValue = model->BSIM3V2dvt2w;
- return(OK);
- case BSIM3V2_MOD_DROUT :
- value->rValue = model->BSIM3V2drout;
- return(OK);
- case BSIM3V2_MOD_DSUB :
- value->rValue = model->BSIM3V2dsub;
- return(OK);
- case BSIM3V2_MOD_VTH0:
- value->rValue = model->BSIM3V2vth0;
- return(OK);
- case BSIM3V2_MOD_UA:
- value->rValue = model->BSIM3V2ua;
- return(OK);
- case BSIM3V2_MOD_UA1:
- value->rValue = model->BSIM3V2ua1;
- return(OK);
- case BSIM3V2_MOD_UB:
- value->rValue = model->BSIM3V2ub;
- return(OK);
- case BSIM3V2_MOD_UB1:
- value->rValue = model->BSIM3V2ub1;
- return(OK);
- case BSIM3V2_MOD_UC:
- value->rValue = model->BSIM3V2uc;
- return(OK);
- case BSIM3V2_MOD_UC1:
- value->rValue = model->BSIM3V2uc1;
- return(OK);
- case BSIM3V2_MOD_U0:
- value->rValue = model->BSIM3V2u0;
- return(OK);
- case BSIM3V2_MOD_UTE:
- value->rValue = model->BSIM3V2ute;
- return(OK);
- case BSIM3V2_MOD_VOFF:
- value->rValue = model->BSIM3V2voff;
- return(OK);
- case BSIM3V2_MOD_DELTA:
- value->rValue = model->BSIM3V2delta;
- return(OK);
- case BSIM3V2_MOD_RDSW:
- value->rValue = model->BSIM3V2rdsw;
- return(OK);
- case BSIM3V2_MOD_PRWG:
- value->rValue = model->BSIM3V2prwg;
- return(OK);
- case BSIM3V2_MOD_PRWB:
- value->rValue = model->BSIM3V2prwb;
- return(OK);
- case BSIM3V2_MOD_PRT:
- value->rValue = model->BSIM3V2prt;
- return(OK);
- case BSIM3V2_MOD_ETA0:
- value->rValue = model->BSIM3V2eta0;
- return(OK);
- case BSIM3V2_MOD_ETAB:
- value->rValue = model->BSIM3V2etab;
- return(OK);
- case BSIM3V2_MOD_PCLM:
- value->rValue = model->BSIM3V2pclm;
- return(OK);
- case BSIM3V2_MOD_PDIBL1:
- value->rValue = model->BSIM3V2pdibl1;
- return(OK);
- case BSIM3V2_MOD_PDIBL2:
- value->rValue = model->BSIM3V2pdibl2;
- return(OK);
- case BSIM3V2_MOD_PDIBLB:
- value->rValue = model->BSIM3V2pdiblb;
- return(OK);
- case BSIM3V2_MOD_PSCBE1:
- value->rValue = model->BSIM3V2pscbe1;
- return(OK);
- case BSIM3V2_MOD_PSCBE2:
- value->rValue = model->BSIM3V2pscbe2;
- return(OK);
- case BSIM3V2_MOD_PVAG:
- value->rValue = model->BSIM3V2pvag;
- return(OK);
- case BSIM3V2_MOD_WR:
- value->rValue = model->BSIM3V2wr;
- return(OK);
- case BSIM3V2_MOD_DWG:
- value->rValue = model->BSIM3V2dwg;
- return(OK);
- case BSIM3V2_MOD_DWB:
- value->rValue = model->BSIM3V2dwb;
- return(OK);
- case BSIM3V2_MOD_B0:
- value->rValue = model->BSIM3V2b0;
- return(OK);
- case BSIM3V2_MOD_B1:
- value->rValue = model->BSIM3V2b1;
- return(OK);
- case BSIM3V2_MOD_ALPHA0:
- value->rValue = model->BSIM3V2alpha0;
- return(OK);
- case BSIM3V2_MOD_ALPHA1:
- value->rValue = model->BSIM3V2alpha1;
- return(OK);
- case BSIM3V2_MOD_BETA0:
- value->rValue = model->BSIM3V2beta0;
- return(OK);
- case BSIM3V2_MOD_IJTH:
- value->rValue = model->BSIM3V2ijth;
- return(OK);
- case BSIM3V2_MOD_VFB:
- value->rValue = model->BSIM3V2vfb;
- return(OK);
-
- case BSIM3V2_MOD_ELM:
- value->rValue = model->BSIM3V2elm;
- return(OK);
- case BSIM3V2_MOD_CGSL:
- value->rValue = model->BSIM3V2cgsl;
- return(OK);
- case BSIM3V2_MOD_CGDL:
- value->rValue = model->BSIM3V2cgdl;
- return(OK);
- case BSIM3V2_MOD_CKAPPA:
- value->rValue = model->BSIM3V2ckappa;
- return(OK);
- case BSIM3V2_MOD_CF:
- value->rValue = model->BSIM3V2cf;
- return(OK);
- case BSIM3V2_MOD_CLC:
- value->rValue = model->BSIM3V2clc;
- return(OK);
- case BSIM3V2_MOD_CLE:
- value->rValue = model->BSIM3V2cle;
- return(OK);
- case BSIM3V2_MOD_DWC:
- value->rValue = model->BSIM3V2dwc;
- return(OK);
- case BSIM3V2_MOD_DLC:
- value->rValue = model->BSIM3V2dlc;
- return(OK);
- case BSIM3V2_MOD_VFBCV:
- value->rValue = model->BSIM3V2vfbcv;
- return(OK);
- case BSIM3V2_MOD_ACDE:
- value->rValue = model->BSIM3V2acde;
- return(OK);
- case BSIM3V2_MOD_MOIN:
- value->rValue = model->BSIM3V2moin;
- return(OK);
- case BSIM3V2_MOD_NOFF:
- value->rValue = model->BSIM3V2noff;
- return(OK);
- case BSIM3V2_MOD_VOFFCV:
- value->rValue = model->BSIM3V2voffcv;
- return(OK);
- case BSIM3V2_MOD_TCJ:
- value->rValue = model->BSIM3V2tcj;
- return(OK);
- case BSIM3V2_MOD_TPB:
- value->rValue = model->BSIM3V2tpb;
- return(OK);
- case BSIM3V2_MOD_TCJSW:
- value->rValue = model->BSIM3V2tcjsw;
- return(OK);
- case BSIM3V2_MOD_TPBSW:
- value->rValue = model->BSIM3V2tpbsw;
- return(OK);
- case BSIM3V2_MOD_TCJSWG:
- value->rValue = model->BSIM3V2tcjswg;
- return(OK);
- case BSIM3V2_MOD_TPBSWG:
- value->rValue = model->BSIM3V2tpbswg;
- return(OK);
-
- /* Length dependence */
- case BSIM3V2_MOD_LCDSC :
- value->rValue = model->BSIM3V2lcdsc;
- return(OK);
- case BSIM3V2_MOD_LCDSCB :
- value->rValue = model->BSIM3V2lcdscb;
- return(OK);
- case BSIM3V2_MOD_LCDSCD :
- value->rValue = model->BSIM3V2lcdscd;
- return(OK);
- case BSIM3V2_MOD_LCIT :
- value->rValue = model->BSIM3V2lcit;
- return(OK);
- case BSIM3V2_MOD_LNFACTOR :
- value->rValue = model->BSIM3V2lnfactor;
- return(OK);
- case BSIM3V2_MOD_LXJ:
- value->rValue = model->BSIM3V2lxj;
- return(OK);
- case BSIM3V2_MOD_LVSAT:
- value->rValue = model->BSIM3V2lvsat;
- return(OK);
- case BSIM3V2_MOD_LAT:
- value->rValue = model->BSIM3V2lat;
- return(OK);
- case BSIM3V2_MOD_LA0:
- value->rValue = model->BSIM3V2la0;
- return(OK);
- case BSIM3V2_MOD_LAGS:
- value->rValue = model->BSIM3V2lags;
- return(OK);
- case BSIM3V2_MOD_LA1:
- value->rValue = model->BSIM3V2la1;
- return(OK);
- case BSIM3V2_MOD_LA2:
- value->rValue = model->BSIM3V2la2;
- return(OK);
- case BSIM3V2_MOD_LKETA:
- value->rValue = model->BSIM3V2lketa;
- return(OK);
- case BSIM3V2_MOD_LNSUB:
- value->rValue = model->BSIM3V2lnsub;
- return(OK);
- case BSIM3V2_MOD_LNPEAK:
- value->rValue = model->BSIM3V2lnpeak;
- return(OK);
- case BSIM3V2_MOD_LNGATE:
- value->rValue = model->BSIM3V2lngate;
- return(OK);
- case BSIM3V2_MOD_LGAMMA1:
- value->rValue = model->BSIM3V2lgamma1;
- return(OK);
- case BSIM3V2_MOD_LGAMMA2:
- value->rValue = model->BSIM3V2lgamma2;
- return(OK);
- case BSIM3V2_MOD_LVBX:
- value->rValue = model->BSIM3V2lvbx;
- return(OK);
- case BSIM3V2_MOD_LVBM:
- value->rValue = model->BSIM3V2lvbm;
- return(OK);
- case BSIM3V2_MOD_LXT:
- value->rValue = model->BSIM3V2lxt;
- return(OK);
- case BSIM3V2_MOD_LK1:
- value->rValue = model->BSIM3V2lk1;
- return(OK);
- case BSIM3V2_MOD_LKT1:
- value->rValue = model->BSIM3V2lkt1;
- return(OK);
- case BSIM3V2_MOD_LKT1L:
- value->rValue = model->BSIM3V2lkt1l;
- return(OK);
- case BSIM3V2_MOD_LKT2 :
- value->rValue = model->BSIM3V2lkt2;
- return(OK);
- case BSIM3V2_MOD_LK2 :
- value->rValue = model->BSIM3V2lk2;
- return(OK);
- case BSIM3V2_MOD_LK3:
- value->rValue = model->BSIM3V2lk3;
- return(OK);
- case BSIM3V2_MOD_LK3B:
- value->rValue = model->BSIM3V2lk3b;
- return(OK);
- case BSIM3V2_MOD_LW0:
- value->rValue = model->BSIM3V2lw0;
- return(OK);
- case BSIM3V2_MOD_LNLX:
- value->rValue = model->BSIM3V2lnlx;
- return(OK);
- case BSIM3V2_MOD_LDVT0:
- value->rValue = model->BSIM3V2ldvt0;
- return(OK);
- case BSIM3V2_MOD_LDVT1 :
- value->rValue = model->BSIM3V2ldvt1;
- return(OK);
- case BSIM3V2_MOD_LDVT2 :
- value->rValue = model->BSIM3V2ldvt2;
- return(OK);
- case BSIM3V2_MOD_LDVT0W :
- value->rValue = model->BSIM3V2ldvt0w;
- return(OK);
- case BSIM3V2_MOD_LDVT1W :
- value->rValue = model->BSIM3V2ldvt1w;
- return(OK);
- case BSIM3V2_MOD_LDVT2W :
- value->rValue = model->BSIM3V2ldvt2w;
- return(OK);
- case BSIM3V2_MOD_LDROUT :
- value->rValue = model->BSIM3V2ldrout;
- return(OK);
- case BSIM3V2_MOD_LDSUB :
- value->rValue = model->BSIM3V2ldsub;
- return(OK);
- case BSIM3V2_MOD_LVTH0:
- value->rValue = model->BSIM3V2lvth0;
- return(OK);
- case BSIM3V2_MOD_LUA:
- value->rValue = model->BSIM3V2lua;
- return(OK);
- case BSIM3V2_MOD_LUA1:
- value->rValue = model->BSIM3V2lua1;
- return(OK);
- case BSIM3V2_MOD_LUB:
- value->rValue = model->BSIM3V2lub;
- return(OK);
- case BSIM3V2_MOD_LUB1:
- value->rValue = model->BSIM3V2lub1;
- return(OK);
- case BSIM3V2_MOD_LUC:
- value->rValue = model->BSIM3V2luc;
- return(OK);
- case BSIM3V2_MOD_LUC1:
- value->rValue = model->BSIM3V2luc1;
- return(OK);
- case BSIM3V2_MOD_LU0:
- value->rValue = model->BSIM3V2lu0;
- return(OK);
- case BSIM3V2_MOD_LUTE:
- value->rValue = model->BSIM3V2lute;
- return(OK);
- case BSIM3V2_MOD_LVOFF:
- value->rValue = model->BSIM3V2lvoff;
- return(OK);
- case BSIM3V2_MOD_LDELTA:
- value->rValue = model->BSIM3V2ldelta;
- return(OK);
- case BSIM3V2_MOD_LRDSW:
- value->rValue = model->BSIM3V2lrdsw;
- return(OK);
- case BSIM3V2_MOD_LPRWB:
- value->rValue = model->BSIM3V2lprwb;
- return(OK);
- case BSIM3V2_MOD_LPRWG:
- value->rValue = model->BSIM3V2lprwg;
- return(OK);
- case BSIM3V2_MOD_LPRT:
- value->rValue = model->BSIM3V2lprt;
- return(OK);
- case BSIM3V2_MOD_LETA0:
- value->rValue = model->BSIM3V2leta0;
- return(OK);
- case BSIM3V2_MOD_LETAB:
- value->rValue = model->BSIM3V2letab;
- return(OK);
- case BSIM3V2_MOD_LPCLM:
- value->rValue = model->BSIM3V2lpclm;
- return(OK);
- case BSIM3V2_MOD_LPDIBL1:
- value->rValue = model->BSIM3V2lpdibl1;
- return(OK);
- case BSIM3V2_MOD_LPDIBL2:
- value->rValue = model->BSIM3V2lpdibl2;
- return(OK);
- case BSIM3V2_MOD_LPDIBLB:
- value->rValue = model->BSIM3V2lpdiblb;
- return(OK);
- case BSIM3V2_MOD_LPSCBE1:
- value->rValue = model->BSIM3V2lpscbe1;
- return(OK);
- case BSIM3V2_MOD_LPSCBE2:
- value->rValue = model->BSIM3V2lpscbe2;
- return(OK);
- case BSIM3V2_MOD_LPVAG:
- value->rValue = model->BSIM3V2lpvag;
- return(OK);
- case BSIM3V2_MOD_LWR:
- value->rValue = model->BSIM3V2lwr;
- return(OK);
- case BSIM3V2_MOD_LDWG:
- value->rValue = model->BSIM3V2ldwg;
- return(OK);
- case BSIM3V2_MOD_LDWB:
- value->rValue = model->BSIM3V2ldwb;
- return(OK);
- case BSIM3V2_MOD_LB0:
- value->rValue = model->BSIM3V2lb0;
- return(OK);
- case BSIM3V2_MOD_LB1:
- value->rValue = model->BSIM3V2lb1;
- return(OK);
- case BSIM3V2_MOD_LALPHA0:
- value->rValue = model->BSIM3V2lalpha0;
- return(OK);
- case BSIM3V2_MOD_LALPHA1:
- value->rValue = model->BSIM3V2lalpha1;
- return(OK);
- case BSIM3V2_MOD_LBETA0:
- value->rValue = model->BSIM3V2lbeta0;
- return(OK);
- case BSIM3V2_MOD_LVFB:
- value->rValue = model->BSIM3V2lvfb;
- return(OK);
-
- case BSIM3V2_MOD_LELM:
- value->rValue = model->BSIM3V2lelm;
- return(OK);
- case BSIM3V2_MOD_LCGSL:
- value->rValue = model->BSIM3V2lcgsl;
- return(OK);
- case BSIM3V2_MOD_LCGDL:
- value->rValue = model->BSIM3V2lcgdl;
- return(OK);
- case BSIM3V2_MOD_LCKAPPA:
- value->rValue = model->BSIM3V2lckappa;
- return(OK);
- case BSIM3V2_MOD_LCF:
- value->rValue = model->BSIM3V2lcf;
- return(OK);
- case BSIM3V2_MOD_LCLC:
- value->rValue = model->BSIM3V2lclc;
- return(OK);
- case BSIM3V2_MOD_LCLE:
- value->rValue = model->BSIM3V2lcle;
- return(OK);
- case BSIM3V2_MOD_LVFBCV:
- value->rValue = model->BSIM3V2lvfbcv;
- return(OK);
- case BSIM3V2_MOD_LACDE:
- value->rValue = model->BSIM3V2lacde;
- return(OK);
- case BSIM3V2_MOD_LMOIN:
- value->rValue = model->BSIM3V2lmoin;
- return(OK);
- case BSIM3V2_MOD_LNOFF:
- value->rValue = model->BSIM3V2lnoff;
- return(OK);
- case BSIM3V2_MOD_LVOFFCV:
- value->rValue = model->BSIM3V2lvoffcv;
- return(OK);
-
- /* Width dependence */
- case BSIM3V2_MOD_WCDSC :
- value->rValue = model->BSIM3V2wcdsc;
- return(OK);
- case BSIM3V2_MOD_WCDSCB :
- value->rValue = model->BSIM3V2wcdscb;
- return(OK);
- case BSIM3V2_MOD_WCDSCD :
- value->rValue = model->BSIM3V2wcdscd;
- return(OK);
- case BSIM3V2_MOD_WCIT :
- value->rValue = model->BSIM3V2wcit;
- return(OK);
- case BSIM3V2_MOD_WNFACTOR :
- value->rValue = model->BSIM3V2wnfactor;
- return(OK);
- case BSIM3V2_MOD_WXJ:
- value->rValue = model->BSIM3V2wxj;
- return(OK);
- case BSIM3V2_MOD_WVSAT:
- value->rValue = model->BSIM3V2wvsat;
- return(OK);
- case BSIM3V2_MOD_WAT:
- value->rValue = model->BSIM3V2wat;
- return(OK);
- case BSIM3V2_MOD_WA0:
- value->rValue = model->BSIM3V2wa0;
- return(OK);
- case BSIM3V2_MOD_WAGS:
- value->rValue = model->BSIM3V2wags;
- return(OK);
- case BSIM3V2_MOD_WA1:
- value->rValue = model->BSIM3V2wa1;
- return(OK);
- case BSIM3V2_MOD_WA2:
- value->rValue = model->BSIM3V2wa2;
- return(OK);
- case BSIM3V2_MOD_WKETA:
- value->rValue = model->BSIM3V2wketa;
- return(OK);
- case BSIM3V2_MOD_WNSUB:
- value->rValue = model->BSIM3V2wnsub;
- return(OK);
- case BSIM3V2_MOD_WNPEAK:
- value->rValue = model->BSIM3V2wnpeak;
- return(OK);
- case BSIM3V2_MOD_WNGATE:
- value->rValue = model->BSIM3V2wngate;
- return(OK);
- case BSIM3V2_MOD_WGAMMA1:
- value->rValue = model->BSIM3V2wgamma1;
- return(OK);
- case BSIM3V2_MOD_WGAMMA2:
- value->rValue = model->BSIM3V2wgamma2;
- return(OK);
- case BSIM3V2_MOD_WVBX:
- value->rValue = model->BSIM3V2wvbx;
- return(OK);
- case BSIM3V2_MOD_WVBM:
- value->rValue = model->BSIM3V2wvbm;
- return(OK);
- case BSIM3V2_MOD_WXT:
- value->rValue = model->BSIM3V2wxt;
- return(OK);
- case BSIM3V2_MOD_WK1:
- value->rValue = model->BSIM3V2wk1;
- return(OK);
- case BSIM3V2_MOD_WKT1:
- value->rValue = model->BSIM3V2wkt1;
- return(OK);
- case BSIM3V2_MOD_WKT1L:
- value->rValue = model->BSIM3V2wkt1l;
- return(OK);
- case BSIM3V2_MOD_WKT2 :
- value->rValue = model->BSIM3V2wkt2;
- return(OK);
- case BSIM3V2_MOD_WK2 :
- value->rValue = model->BSIM3V2wk2;
- return(OK);
- case BSIM3V2_MOD_WK3:
- value->rValue = model->BSIM3V2wk3;
- return(OK);
- case BSIM3V2_MOD_WK3B:
- value->rValue = model->BSIM3V2wk3b;
- return(OK);
- case BSIM3V2_MOD_WW0:
- value->rValue = model->BSIM3V2ww0;
- return(OK);
- case BSIM3V2_MOD_WNLX:
- value->rValue = model->BSIM3V2wnlx;
- return(OK);
- case BSIM3V2_MOD_WDVT0:
- value->rValue = model->BSIM3V2wdvt0;
- return(OK);
- case BSIM3V2_MOD_WDVT1 :
- value->rValue = model->BSIM3V2wdvt1;
- return(OK);
- case BSIM3V2_MOD_WDVT2 :
- value->rValue = model->BSIM3V2wdvt2;
- return(OK);
- case BSIM3V2_MOD_WDVT0W :
- value->rValue = model->BSIM3V2wdvt0w;
- return(OK);
- case BSIM3V2_MOD_WDVT1W :
- value->rValue = model->BSIM3V2wdvt1w;
- return(OK);
- case BSIM3V2_MOD_WDVT2W :
- value->rValue = model->BSIM3V2wdvt2w;
- return(OK);
- case BSIM3V2_MOD_WDROUT :
- value->rValue = model->BSIM3V2wdrout;
- return(OK);
- case BSIM3V2_MOD_WDSUB :
- value->rValue = model->BSIM3V2wdsub;
- return(OK);
- case BSIM3V2_MOD_WVTH0:
- value->rValue = model->BSIM3V2wvth0;
- return(OK);
- case BSIM3V2_MOD_WUA:
- value->rValue = model->BSIM3V2wua;
- return(OK);
- case BSIM3V2_MOD_WUA1:
- value->rValue = model->BSIM3V2wua1;
- return(OK);
- case BSIM3V2_MOD_WUB:
- value->rValue = model->BSIM3V2wub;
- return(OK);
- case BSIM3V2_MOD_WUB1:
- value->rValue = model->BSIM3V2wub1;
- return(OK);
- case BSIM3V2_MOD_WUC:
- value->rValue = model->BSIM3V2wuc;
- return(OK);
- case BSIM3V2_MOD_WUC1:
- value->rValue = model->BSIM3V2wuc1;
- return(OK);
- case BSIM3V2_MOD_WU0:
- value->rValue = model->BSIM3V2wu0;
- return(OK);
- case BSIM3V2_MOD_WUTE:
- value->rValue = model->BSIM3V2wute;
- return(OK);
- case BSIM3V2_MOD_WVOFF:
- value->rValue = model->BSIM3V2wvoff;
- return(OK);
- case BSIM3V2_MOD_WDELTA:
- value->rValue = model->BSIM3V2wdelta;
- return(OK);
- case BSIM3V2_MOD_WRDSW:
- value->rValue = model->BSIM3V2wrdsw;
- return(OK);
- case BSIM3V2_MOD_WPRWB:
- value->rValue = model->BSIM3V2wprwb;
- return(OK);
- case BSIM3V2_MOD_WPRWG:
- value->rValue = model->BSIM3V2wprwg;
- return(OK);
- case BSIM3V2_MOD_WPRT:
- value->rValue = model->BSIM3V2wprt;
- return(OK);
- case BSIM3V2_MOD_WETA0:
- value->rValue = model->BSIM3V2weta0;
- return(OK);
- case BSIM3V2_MOD_WETAB:
- value->rValue = model->BSIM3V2wetab;
- return(OK);
- case BSIM3V2_MOD_WPCLM:
- value->rValue = model->BSIM3V2wpclm;
- return(OK);
- case BSIM3V2_MOD_WPDIBL1:
- value->rValue = model->BSIM3V2wpdibl1;
- return(OK);
- case BSIM3V2_MOD_WPDIBL2:
- value->rValue = model->BSIM3V2wpdibl2;
- return(OK);
- case BSIM3V2_MOD_WPDIBLB:
- value->rValue = model->BSIM3V2wpdiblb;
- return(OK);
- case BSIM3V2_MOD_WPSCBE1:
- value->rValue = model->BSIM3V2wpscbe1;
- return(OK);
- case BSIM3V2_MOD_WPSCBE2:
- value->rValue = model->BSIM3V2wpscbe2;
- return(OK);
- case BSIM3V2_MOD_WPVAG:
- value->rValue = model->BSIM3V2wpvag;
- return(OK);
- case BSIM3V2_MOD_WWR:
- value->rValue = model->BSIM3V2wwr;
- return(OK);
- case BSIM3V2_MOD_WDWG:
- value->rValue = model->BSIM3V2wdwg;
- return(OK);
- case BSIM3V2_MOD_WDWB:
- value->rValue = model->BSIM3V2wdwb;
- return(OK);
- case BSIM3V2_MOD_WB0:
- value->rValue = model->BSIM3V2wb0;
- return(OK);
- case BSIM3V2_MOD_WB1:
- value->rValue = model->BSIM3V2wb1;
- return(OK);
- case BSIM3V2_MOD_WALPHA0:
- value->rValue = model->BSIM3V2walpha0;
- return(OK);
- case BSIM3V2_MOD_WALPHA1:
- value->rValue = model->BSIM3V2walpha1;
- return(OK);
- case BSIM3V2_MOD_WBETA0:
- value->rValue = model->BSIM3V2wbeta0;
- return(OK);
- case BSIM3V2_MOD_WVFB:
- value->rValue = model->BSIM3V2wvfb;
- return(OK);
-
- case BSIM3V2_MOD_WELM:
- value->rValue = model->BSIM3V2welm;
- return(OK);
- case BSIM3V2_MOD_WCGSL:
- value->rValue = model->BSIM3V2wcgsl;
- return(OK);
- case BSIM3V2_MOD_WCGDL:
- value->rValue = model->BSIM3V2wcgdl;
- return(OK);
- case BSIM3V2_MOD_WCKAPPA:
- value->rValue = model->BSIM3V2wckappa;
- return(OK);
- case BSIM3V2_MOD_WCF:
- value->rValue = model->BSIM3V2wcf;
- return(OK);
- case BSIM3V2_MOD_WCLC:
- value->rValue = model->BSIM3V2wclc;
- return(OK);
- case BSIM3V2_MOD_WCLE:
- value->rValue = model->BSIM3V2wcle;
- return(OK);
- case BSIM3V2_MOD_WVFBCV:
- value->rValue = model->BSIM3V2wvfbcv;
- return(OK);
- case BSIM3V2_MOD_WACDE:
- value->rValue = model->BSIM3V2wacde;
- return(OK);
- case BSIM3V2_MOD_WMOIN:
- value->rValue = model->BSIM3V2wmoin;
- return(OK);
- case BSIM3V2_MOD_WNOFF:
- value->rValue = model->BSIM3V2wnoff;
- return(OK);
- case BSIM3V2_MOD_WVOFFCV:
- value->rValue = model->BSIM3V2wvoffcv;
- return(OK);
-
- /* Cross-term dependence */
- case BSIM3V2_MOD_PCDSC :
- value->rValue = model->BSIM3V2pcdsc;
- return(OK);
- case BSIM3V2_MOD_PCDSCB :
- value->rValue = model->BSIM3V2pcdscb;
- return(OK);
- case BSIM3V2_MOD_PCDSCD :
- value->rValue = model->BSIM3V2pcdscd;
- return(OK);
- case BSIM3V2_MOD_PCIT :
- value->rValue = model->BSIM3V2pcit;
- return(OK);
- case BSIM3V2_MOD_PNFACTOR :
- value->rValue = model->BSIM3V2pnfactor;
- return(OK);
- case BSIM3V2_MOD_PXJ:
- value->rValue = model->BSIM3V2pxj;
- return(OK);
- case BSIM3V2_MOD_PVSAT:
- value->rValue = model->BSIM3V2pvsat;
- return(OK);
- case BSIM3V2_MOD_PAT:
- value->rValue = model->BSIM3V2pat;
- return(OK);
- case BSIM3V2_MOD_PA0:
- value->rValue = model->BSIM3V2pa0;
- return(OK);
- case BSIM3V2_MOD_PAGS:
- value->rValue = model->BSIM3V2pags;
- return(OK);
- case BSIM3V2_MOD_PA1:
- value->rValue = model->BSIM3V2pa1;
- return(OK);
- case BSIM3V2_MOD_PA2:
- value->rValue = model->BSIM3V2pa2;
- return(OK);
- case BSIM3V2_MOD_PKETA:
- value->rValue = model->BSIM3V2pketa;
- return(OK);
- case BSIM3V2_MOD_PNSUB:
- value->rValue = model->BSIM3V2pnsub;
- return(OK);
- case BSIM3V2_MOD_PNPEAK:
- value->rValue = model->BSIM3V2pnpeak;
- return(OK);
- case BSIM3V2_MOD_PNGATE:
- value->rValue = model->BSIM3V2pngate;
- return(OK);
- case BSIM3V2_MOD_PGAMMA1:
- value->rValue = model->BSIM3V2pgamma1;
- return(OK);
- case BSIM3V2_MOD_PGAMMA2:
- value->rValue = model->BSIM3V2pgamma2;
- return(OK);
- case BSIM3V2_MOD_PVBX:
- value->rValue = model->BSIM3V2pvbx;
- return(OK);
- case BSIM3V2_MOD_PVBM:
- value->rValue = model->BSIM3V2pvbm;
- return(OK);
- case BSIM3V2_MOD_PXT:
- value->rValue = model->BSIM3V2pxt;
- return(OK);
- case BSIM3V2_MOD_PK1:
- value->rValue = model->BSIM3V2pk1;
- return(OK);
- case BSIM3V2_MOD_PKT1:
- value->rValue = model->BSIM3V2pkt1;
- return(OK);
- case BSIM3V2_MOD_PKT1L:
- value->rValue = model->BSIM3V2pkt1l;
- return(OK);
- case BSIM3V2_MOD_PKT2 :
- value->rValue = model->BSIM3V2pkt2;
- return(OK);
- case BSIM3V2_MOD_PK2 :
- value->rValue = model->BSIM3V2pk2;
- return(OK);
- case BSIM3V2_MOD_PK3:
- value->rValue = model->BSIM3V2pk3;
- return(OK);
- case BSIM3V2_MOD_PK3B:
- value->rValue = model->BSIM3V2pk3b;
- return(OK);
- case BSIM3V2_MOD_PW0:
- value->rValue = model->BSIM3V2pw0;
- return(OK);
- case BSIM3V2_MOD_PNLX:
- value->rValue = model->BSIM3V2pnlx;
- return(OK);
- case BSIM3V2_MOD_PDVT0 :
- value->rValue = model->BSIM3V2pdvt0;
- return(OK);
- case BSIM3V2_MOD_PDVT1 :
- value->rValue = model->BSIM3V2pdvt1;
- return(OK);
- case BSIM3V2_MOD_PDVT2 :
- value->rValue = model->BSIM3V2pdvt2;
- return(OK);
- case BSIM3V2_MOD_PDVT0W :
- value->rValue = model->BSIM3V2pdvt0w;
- return(OK);
- case BSIM3V2_MOD_PDVT1W :
- value->rValue = model->BSIM3V2pdvt1w;
- return(OK);
- case BSIM3V2_MOD_PDVT2W :
- value->rValue = model->BSIM3V2pdvt2w;
- return(OK);
- case BSIM3V2_MOD_PDROUT :
- value->rValue = model->BSIM3V2pdrout;
- return(OK);
- case BSIM3V2_MOD_PDSUB :
- value->rValue = model->BSIM3V2pdsub;
- return(OK);
- case BSIM3V2_MOD_PVTH0:
- value->rValue = model->BSIM3V2pvth0;
- return(OK);
- case BSIM3V2_MOD_PUA:
- value->rValue = model->BSIM3V2pua;
- return(OK);
- case BSIM3V2_MOD_PUA1:
- value->rValue = model->BSIM3V2pua1;
- return(OK);
- case BSIM3V2_MOD_PUB:
- value->rValue = model->BSIM3V2pub;
- return(OK);
- case BSIM3V2_MOD_PUB1:
- value->rValue = model->BSIM3V2pub1;
- return(OK);
- case BSIM3V2_MOD_PUC:
- value->rValue = model->BSIM3V2puc;
- return(OK);
- case BSIM3V2_MOD_PUC1:
- value->rValue = model->BSIM3V2puc1;
- return(OK);
- case BSIM3V2_MOD_PU0:
- value->rValue = model->BSIM3V2pu0;
- return(OK);
- case BSIM3V2_MOD_PUTE:
- value->rValue = model->BSIM3V2pute;
- return(OK);
- case BSIM3V2_MOD_PVOFF:
- value->rValue = model->BSIM3V2pvoff;
- return(OK);
- case BSIM3V2_MOD_PDELTA:
- value->rValue = model->BSIM3V2pdelta;
- return(OK);
- case BSIM3V2_MOD_PRDSW:
- value->rValue = model->BSIM3V2prdsw;
- return(OK);
- case BSIM3V2_MOD_PPRWB:
- value->rValue = model->BSIM3V2pprwb;
- return(OK);
- case BSIM3V2_MOD_PPRWG:
- value->rValue = model->BSIM3V2pprwg;
- return(OK);
- case BSIM3V2_MOD_PPRT:
- value->rValue = model->BSIM3V2pprt;
- return(OK);
- case BSIM3V2_MOD_PETA0:
- value->rValue = model->BSIM3V2peta0;
- return(OK);
- case BSIM3V2_MOD_PETAB:
- value->rValue = model->BSIM3V2petab;
- return(OK);
- case BSIM3V2_MOD_PPCLM:
- value->rValue = model->BSIM3V2ppclm;
- return(OK);
- case BSIM3V2_MOD_PPDIBL1:
- value->rValue = model->BSIM3V2ppdibl1;
- return(OK);
- case BSIM3V2_MOD_PPDIBL2:
- value->rValue = model->BSIM3V2ppdibl2;
- return(OK);
- case BSIM3V2_MOD_PPDIBLB:
- value->rValue = model->BSIM3V2ppdiblb;
- return(OK);
- case BSIM3V2_MOD_PPSCBE1:
- value->rValue = model->BSIM3V2ppscbe1;
- return(OK);
- case BSIM3V2_MOD_PPSCBE2:
- value->rValue = model->BSIM3V2ppscbe2;
- return(OK);
- case BSIM3V2_MOD_PPVAG:
- value->rValue = model->BSIM3V2ppvag;
- return(OK);
- case BSIM3V2_MOD_PWR:
- value->rValue = model->BSIM3V2pwr;
- return(OK);
- case BSIM3V2_MOD_PDWG:
- value->rValue = model->BSIM3V2pdwg;
- return(OK);
- case BSIM3V2_MOD_PDWB:
- value->rValue = model->BSIM3V2pdwb;
- return(OK);
- case BSIM3V2_MOD_PB0:
- value->rValue = model->BSIM3V2pb0;
- return(OK);
- case BSIM3V2_MOD_PB1:
- value->rValue = model->BSIM3V2pb1;
- return(OK);
- case BSIM3V2_MOD_PALPHA0:
- value->rValue = model->BSIM3V2palpha0;
- return(OK);
- case BSIM3V2_MOD_PALPHA1:
- value->rValue = model->BSIM3V2palpha1;
- return(OK);
- case BSIM3V2_MOD_PBETA0:
- value->rValue = model->BSIM3V2pbeta0;
- return(OK);
- case BSIM3V2_MOD_PVFB:
- value->rValue = model->BSIM3V2pvfb;
- return(OK);
-
- case BSIM3V2_MOD_PELM:
- value->rValue = model->BSIM3V2pelm;
- return(OK);
- case BSIM3V2_MOD_PCGSL:
- value->rValue = model->BSIM3V2pcgsl;
- return(OK);
- case BSIM3V2_MOD_PCGDL:
- value->rValue = model->BSIM3V2pcgdl;
- return(OK);
- case BSIM3V2_MOD_PCKAPPA:
- value->rValue = model->BSIM3V2pckappa;
- return(OK);
- case BSIM3V2_MOD_PCF:
- value->rValue = model->BSIM3V2pcf;
- return(OK);
- case BSIM3V2_MOD_PCLC:
- value->rValue = model->BSIM3V2pclc;
- return(OK);
- case BSIM3V2_MOD_PCLE:
- value->rValue = model->BSIM3V2pcle;
- return(OK);
- case BSIM3V2_MOD_PVFBCV:
- value->rValue = model->BSIM3V2pvfbcv;
- return(OK);
- case BSIM3V2_MOD_PACDE:
- value->rValue = model->BSIM3V2pacde;
- return(OK);
- case BSIM3V2_MOD_PMOIN:
- value->rValue = model->BSIM3V2pmoin;
- return(OK);
- case BSIM3V2_MOD_PNOFF:
- value->rValue = model->BSIM3V2pnoff;
- return(OK);
- case BSIM3V2_MOD_PVOFFCV:
- value->rValue = model->BSIM3V2pvoffcv;
- return(OK);
-
- case BSIM3V2_MOD_TNOM :
- value->rValue = model->BSIM3V2tnom;
- return(OK);
- case BSIM3V2_MOD_CGSO:
- value->rValue = model->BSIM3V2cgso;
- return(OK);
- case BSIM3V2_MOD_CGDO:
- value->rValue = model->BSIM3V2cgdo;
- return(OK);
- case BSIM3V2_MOD_CGBO:
- value->rValue = model->BSIM3V2cgbo;
- return(OK);
- case BSIM3V2_MOD_XPART:
- value->rValue = model->BSIM3V2xpart;
- return(OK);
- case BSIM3V2_MOD_RSH:
- value->rValue = model->BSIM3V2sheetResistance;
- return(OK);
- case BSIM3V2_MOD_JS:
- value->rValue = model->BSIM3V2jctSatCurDensity;
- return(OK);
- case BSIM3V2_MOD_JSW:
- value->rValue = model->BSIM3V2jctSidewallSatCurDensity;
- return(OK);
- case BSIM3V2_MOD_PB:
- value->rValue = model->BSIM3V2bulkJctPotential;
- return(OK);
- case BSIM3V2_MOD_MJ:
- value->rValue = model->BSIM3V2bulkJctBotGradingCoeff;
- return(OK);
- case BSIM3V2_MOD_PBSW:
- value->rValue = model->BSIM3V2sidewallJctPotential;
- return(OK);
- case BSIM3V2_MOD_MJSW:
- value->rValue = model->BSIM3V2bulkJctSideGradingCoeff;
- return(OK);
- case BSIM3V2_MOD_CJ:
- value->rValue = model->BSIM3V2unitAreaJctCap;
- return(OK);
- case BSIM3V2_MOD_CJSW:
- value->rValue = model->BSIM3V2unitLengthSidewallJctCap;
- return(OK);
- case BSIM3V2_MOD_PBSWG:
- value->rValue = model->BSIM3V2GatesidewallJctPotential;
- return(OK);
- case BSIM3V2_MOD_MJSWG:
- value->rValue = model->BSIM3V2bulkJctGateSideGradingCoeff;
- return(OK);
- case BSIM3V2_MOD_CJSWG:
- value->rValue = model->BSIM3V2unitLengthGateSidewallJctCap;
- return(OK);
- case BSIM3V2_MOD_NJ:
- value->rValue = model->BSIM3V2jctEmissionCoeff;
- return(OK);
- case BSIM3V2_MOD_XTI:
- value->rValue = model->BSIM3V2jctTempExponent;
- return(OK);
- case BSIM3V2_MOD_LINT:
- value->rValue = model->BSIM3V2Lint;
- return(OK);
- case BSIM3V2_MOD_LL:
- value->rValue = model->BSIM3V2Ll;
- return(OK);
- case BSIM3V2_MOD_LLC:
- value->rValue = model->BSIM3V2Llc;
- return(OK);
- case BSIM3V2_MOD_LLN:
- value->rValue = model->BSIM3V2Lln;
- return(OK);
- case BSIM3V2_MOD_LW:
- value->rValue = model->BSIM3V2Lw;
- return(OK);
- case BSIM3V2_MOD_LWC:
- value->rValue = model->BSIM3V2Lwc;
- return(OK);
- case BSIM3V2_MOD_LWN:
- value->rValue = model->BSIM3V2Lwn;
- return(OK);
- case BSIM3V2_MOD_LWL:
- value->rValue = model->BSIM3V2Lwl;
- return(OK);
- case BSIM3V2_MOD_LWLC:
- value->rValue = model->BSIM3V2Lwlc;
- return(OK);
- case BSIM3V2_MOD_LMIN:
- value->rValue = model->BSIM3V2Lmin;
- return(OK);
- case BSIM3V2_MOD_LMAX:
- value->rValue = model->BSIM3V2Lmax;
- return(OK);
- case BSIM3V2_MOD_WINT:
- value->rValue = model->BSIM3V2Wint;
- return(OK);
- case BSIM3V2_MOD_WL:
- value->rValue = model->BSIM3V2Wl;
- return(OK);
- case BSIM3V2_MOD_WLC:
- value->rValue = model->BSIM3V2Wlc;
- return(OK);
- case BSIM3V2_MOD_WLN:
- value->rValue = model->BSIM3V2Wln;
- return(OK);
- case BSIM3V2_MOD_WW:
- value->rValue = model->BSIM3V2Ww;
- return(OK);
- case BSIM3V2_MOD_WWC:
- value->rValue = model->BSIM3V2Wwc;
- return(OK);
- case BSIM3V2_MOD_WWN:
- value->rValue = model->BSIM3V2Wwn;
- return(OK);
- case BSIM3V2_MOD_WWL:
- value->rValue = model->BSIM3V2Wwl;
- return(OK);
- case BSIM3V2_MOD_WWLC:
- value->rValue = model->BSIM3V2Wwlc;
- return(OK);
- case BSIM3V2_MOD_WMIN:
- value->rValue = model->BSIM3V2Wmin;
- return(OK);
- case BSIM3V2_MOD_WMAX:
- value->rValue = model->BSIM3V2Wmax;
- return(OK);
- case BSIM3V2_MOD_NOIA:
- value->rValue = model->BSIM3V2oxideTrapDensityA;
- return(OK);
- case BSIM3V2_MOD_NOIB:
- value->rValue = model->BSIM3V2oxideTrapDensityB;
- return(OK);
- case BSIM3V2_MOD_NOIC:
- value->rValue = model->BSIM3V2oxideTrapDensityC;
- return(OK);
- case BSIM3V2_MOD_EM:
- value->rValue = model->BSIM3V2em;
- return(OK);
- case BSIM3V2_MOD_EF:
- value->rValue = model->BSIM3V2ef;
- return(OK);
- case BSIM3V2_MOD_AF:
- value->rValue = model->BSIM3V2af;
- return(OK);
- case BSIM3V2_MOD_KF:
- value->rValue = model->BSIM3V2kf;
- return(OK);
- default:
- return(E_BADPARM);
- }
- /* NOTREACHED */
-}
-
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2mdel.c b/src/spicelib/devices/bsim3v2/b3v2mdel.c
deleted file mode 100644
index e5109f277..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2mdel.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2mdel.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "suffix.h"
-
-int
-BSIM3V2mDelete(inModel,modname,kill)
-GENmodel **inModel;
-IFuid modname;
-GENmodel *kill;
-{
-BSIM3V2model **model = (BSIM3V2model**)inModel;
-BSIM3V2model *modfast = (BSIM3V2model*)kill;
-BSIM3V2instance *here;
-BSIM3V2instance *prev = NULL;
-BSIM3V2model **oldmod;
-
- oldmod = model;
- for (; *model ; model = &((*model)->BSIM3V2nextModel))
- { if ((*model)->BSIM3V2modName == modname ||
- (modfast && *model == modfast))
- goto delgot;
- oldmod = model;
- }
- return(E_NOMOD);
-
-delgot:
- *oldmod = (*model)->BSIM3V2nextModel; /* cut deleted device out of list */
- for (here = (*model)->BSIM3V2instances; here; here = here->BSIM3V2nextInstance)
- { if(prev) FREE(prev);
- prev = here;
- }
- if(prev) FREE(prev);
- FREE(*model);
- return(OK);
-}
-
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2mpar.c b/src/spicelib/devices/bsim3v2/b3v2mpar.c
deleted file mode 100644
index 568bcae70..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2mpar.c
+++ /dev/null
@@ -1,1675 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: b3v2mpar.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "bsim3v2def.h"
-#include "ifsim.h"
-#include "sperror.h"
-#include "suffix.h"
-
-
-int
-BSIM3V2mParam(param,value,inMod)
-int param;
-IFvalue *value;
-GENmodel *inMod;
-{
- BSIM3V2model *mod = (BSIM3V2model*)inMod;
- switch(param)
- { case BSIM3V2_MOD_MOBMOD :
- mod->BSIM3V2mobMod = value->iValue;
- mod->BSIM3V2mobModGiven = TRUE;
- break;
- case BSIM3V2_MOD_BINUNIT :
- mod->BSIM3V2binUnit = value->iValue;
- mod->BSIM3V2binUnitGiven = TRUE;
- break;
- case BSIM3V2_MOD_PARAMCHK :
- mod->BSIM3V2paramChk = value->iValue;
- mod->BSIM3V2paramChkGiven = TRUE;
- break;
- case BSIM3V2_MOD_CAPMOD :
- mod->BSIM3V2capMod = value->iValue;
- mod->BSIM3V2capModGiven = TRUE;
- break;
- case BSIM3V2_MOD_NOIMOD :
- mod->BSIM3V2noiMod = value->iValue;
- mod->BSIM3V2noiModGiven = TRUE;
- break;
- case BSIM3V2_MOD_VERSION :
- mod->BSIM3V2version = value->rValue;
- mod->BSIM3V2versionGiven = TRUE;
- break;
- case BSIM3V2_MOD_TOX :
- mod->BSIM3V2tox = value->rValue;
- mod->BSIM3V2toxGiven = TRUE;
- break;
- case BSIM3V2_MOD_TOXM :
- mod->BSIM3V2toxm = value->rValue;
- mod->BSIM3V2toxmGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_CDSC :
- mod->BSIM3V2cdsc = value->rValue;
- mod->BSIM3V2cdscGiven = TRUE;
- break;
- case BSIM3V2_MOD_CDSCB :
- mod->BSIM3V2cdscb = value->rValue;
- mod->BSIM3V2cdscbGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_CDSCD :
- mod->BSIM3V2cdscd = value->rValue;
- mod->BSIM3V2cdscdGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_CIT :
- mod->BSIM3V2cit = value->rValue;
- mod->BSIM3V2citGiven = TRUE;
- break;
- case BSIM3V2_MOD_NFACTOR :
- mod->BSIM3V2nfactor = value->rValue;
- mod->BSIM3V2nfactorGiven = TRUE;
- break;
- case BSIM3V2_MOD_XJ:
- mod->BSIM3V2xj = value->rValue;
- mod->BSIM3V2xjGiven = TRUE;
- break;
- case BSIM3V2_MOD_VSAT:
- mod->BSIM3V2vsat = value->rValue;
- mod->BSIM3V2vsatGiven = TRUE;
- break;
- case BSIM3V2_MOD_A0:
- mod->BSIM3V2a0 = value->rValue;
- mod->BSIM3V2a0Given = TRUE;
- break;
-
- case BSIM3V2_MOD_AGS:
- mod->BSIM3V2ags= value->rValue;
- mod->BSIM3V2agsGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_A1:
- mod->BSIM3V2a1 = value->rValue;
- mod->BSIM3V2a1Given = TRUE;
- break;
- case BSIM3V2_MOD_A2:
- mod->BSIM3V2a2 = value->rValue;
- mod->BSIM3V2a2Given = TRUE;
- break;
- case BSIM3V2_MOD_AT:
- mod->BSIM3V2at = value->rValue;
- mod->BSIM3V2atGiven = TRUE;
- break;
- case BSIM3V2_MOD_KETA:
- mod->BSIM3V2keta = value->rValue;
- mod->BSIM3V2ketaGiven = TRUE;
- break;
- case BSIM3V2_MOD_NSUB:
- mod->BSIM3V2nsub = value->rValue;
- mod->BSIM3V2nsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_NPEAK:
- mod->BSIM3V2npeak = value->rValue;
- mod->BSIM3V2npeakGiven = TRUE;
- if (mod->BSIM3V2npeak > 1.0e20)
- mod->BSIM3V2npeak *= 1.0e-6;
- break;
- case BSIM3V2_MOD_NGATE:
- mod->BSIM3V2ngate = value->rValue;
- mod->BSIM3V2ngateGiven = TRUE;
- if (mod->BSIM3V2ngate > 1.0e23)
- mod->BSIM3V2ngate *= 1.0e-6;
- break;
- case BSIM3V2_MOD_GAMMA1:
- mod->BSIM3V2gamma1 = value->rValue;
- mod->BSIM3V2gamma1Given = TRUE;
- break;
- case BSIM3V2_MOD_GAMMA2:
- mod->BSIM3V2gamma2 = value->rValue;
- mod->BSIM3V2gamma2Given = TRUE;
- break;
- case BSIM3V2_MOD_VBX:
- mod->BSIM3V2vbx = value->rValue;
- mod->BSIM3V2vbxGiven = TRUE;
- break;
- case BSIM3V2_MOD_VBM:
- mod->BSIM3V2vbm = value->rValue;
- mod->BSIM3V2vbmGiven = TRUE;
- break;
- case BSIM3V2_MOD_XT:
- mod->BSIM3V2xt = value->rValue;
- mod->BSIM3V2xtGiven = TRUE;
- break;
- case BSIM3V2_MOD_K1:
- mod->BSIM3V2k1 = value->rValue;
- mod->BSIM3V2k1Given = TRUE;
- break;
- case BSIM3V2_MOD_KT1:
- mod->BSIM3V2kt1 = value->rValue;
- mod->BSIM3V2kt1Given = TRUE;
- break;
- case BSIM3V2_MOD_KT1L:
- mod->BSIM3V2kt1l = value->rValue;
- mod->BSIM3V2kt1lGiven = TRUE;
- break;
- case BSIM3V2_MOD_KT2:
- mod->BSIM3V2kt2 = value->rValue;
- mod->BSIM3V2kt2Given = TRUE;
- break;
- case BSIM3V2_MOD_K2:
- mod->BSIM3V2k2 = value->rValue;
- mod->BSIM3V2k2Given = TRUE;
- break;
- case BSIM3V2_MOD_K3:
- mod->BSIM3V2k3 = value->rValue;
- mod->BSIM3V2k3Given = TRUE;
- break;
- case BSIM3V2_MOD_K3B:
- mod->BSIM3V2k3b = value->rValue;
- mod->BSIM3V2k3bGiven = TRUE;
- break;
- case BSIM3V2_MOD_NLX:
- mod->BSIM3V2nlx = value->rValue;
- mod->BSIM3V2nlxGiven = TRUE;
- break;
- case BSIM3V2_MOD_W0:
- mod->BSIM3V2w0 = value->rValue;
- mod->BSIM3V2w0Given = TRUE;
- break;
- case BSIM3V2_MOD_DVT0:
- mod->BSIM3V2dvt0 = value->rValue;
- mod->BSIM3V2dvt0Given = TRUE;
- break;
- case BSIM3V2_MOD_DVT1:
- mod->BSIM3V2dvt1 = value->rValue;
- mod->BSIM3V2dvt1Given = TRUE;
- break;
- case BSIM3V2_MOD_DVT2:
- mod->BSIM3V2dvt2 = value->rValue;
- mod->BSIM3V2dvt2Given = TRUE;
- break;
- case BSIM3V2_MOD_DVT0W:
- mod->BSIM3V2dvt0w = value->rValue;
- mod->BSIM3V2dvt0wGiven = TRUE;
- break;
- case BSIM3V2_MOD_DVT1W:
- mod->BSIM3V2dvt1w = value->rValue;
- mod->BSIM3V2dvt1wGiven = TRUE;
- break;
- case BSIM3V2_MOD_DVT2W:
- mod->BSIM3V2dvt2w = value->rValue;
- mod->BSIM3V2dvt2wGiven = TRUE;
- break;
- case BSIM3V2_MOD_DROUT:
- mod->BSIM3V2drout = value->rValue;
- mod->BSIM3V2droutGiven = TRUE;
- break;
- case BSIM3V2_MOD_DSUB:
- mod->BSIM3V2dsub = value->rValue;
- mod->BSIM3V2dsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_VTH0:
- mod->BSIM3V2vth0 = value->rValue;
- mod->BSIM3V2vth0Given = TRUE;
- break;
- case BSIM3V2_MOD_UA:
- mod->BSIM3V2ua = value->rValue;
- mod->BSIM3V2uaGiven = TRUE;
- break;
- case BSIM3V2_MOD_UA1:
- mod->BSIM3V2ua1 = value->rValue;
- mod->BSIM3V2ua1Given = TRUE;
- break;
- case BSIM3V2_MOD_UB:
- mod->BSIM3V2ub = value->rValue;
- mod->BSIM3V2ubGiven = TRUE;
- break;
- case BSIM3V2_MOD_UB1:
- mod->BSIM3V2ub1 = value->rValue;
- mod->BSIM3V2ub1Given = TRUE;
- break;
- case BSIM3V2_MOD_UC:
- mod->BSIM3V2uc = value->rValue;
- mod->BSIM3V2ucGiven = TRUE;
- break;
- case BSIM3V2_MOD_UC1:
- mod->BSIM3V2uc1 = value->rValue;
- mod->BSIM3V2uc1Given = TRUE;
- break;
- case BSIM3V2_MOD_U0 :
- mod->BSIM3V2u0 = value->rValue;
- mod->BSIM3V2u0Given = TRUE;
- break;
- case BSIM3V2_MOD_UTE :
- mod->BSIM3V2ute = value->rValue;
- mod->BSIM3V2uteGiven = TRUE;
- break;
- case BSIM3V2_MOD_VOFF:
- mod->BSIM3V2voff = value->rValue;
- mod->BSIM3V2voffGiven = TRUE;
- break;
- case BSIM3V2_MOD_DELTA :
- mod->BSIM3V2delta = value->rValue;
- mod->BSIM3V2deltaGiven = TRUE;
- break;
- case BSIM3V2_MOD_RDSW:
- mod->BSIM3V2rdsw = value->rValue;
- mod->BSIM3V2rdswGiven = TRUE;
- break;
- case BSIM3V2_MOD_PRWG:
- mod->BSIM3V2prwg = value->rValue;
- mod->BSIM3V2prwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_PRWB:
- mod->BSIM3V2prwb = value->rValue;
- mod->BSIM3V2prwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_PRT:
- mod->BSIM3V2prt = value->rValue;
- mod->BSIM3V2prtGiven = TRUE;
- break;
- case BSIM3V2_MOD_ETA0:
- mod->BSIM3V2eta0 = value->rValue;
- mod->BSIM3V2eta0Given = TRUE;
- break;
- case BSIM3V2_MOD_ETAB:
- mod->BSIM3V2etab = value->rValue;
- mod->BSIM3V2etabGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCLM:
- mod->BSIM3V2pclm = value->rValue;
- mod->BSIM3V2pclmGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDIBL1:
- mod->BSIM3V2pdibl1 = value->rValue;
- mod->BSIM3V2pdibl1Given = TRUE;
- break;
- case BSIM3V2_MOD_PDIBL2:
- mod->BSIM3V2pdibl2 = value->rValue;
- mod->BSIM3V2pdibl2Given = TRUE;
- break;
- case BSIM3V2_MOD_PDIBLB:
- mod->BSIM3V2pdiblb = value->rValue;
- mod->BSIM3V2pdiblbGiven = TRUE;
- break;
- case BSIM3V2_MOD_PSCBE1:
- mod->BSIM3V2pscbe1 = value->rValue;
- mod->BSIM3V2pscbe1Given = TRUE;
- break;
- case BSIM3V2_MOD_PSCBE2:
- mod->BSIM3V2pscbe2 = value->rValue;
- mod->BSIM3V2pscbe2Given = TRUE;
- break;
- case BSIM3V2_MOD_PVAG:
- mod->BSIM3V2pvag = value->rValue;
- mod->BSIM3V2pvagGiven = TRUE;
- break;
- case BSIM3V2_MOD_WR :
- mod->BSIM3V2wr = value->rValue;
- mod->BSIM3V2wrGiven = TRUE;
- break;
- case BSIM3V2_MOD_DWG :
- mod->BSIM3V2dwg = value->rValue;
- mod->BSIM3V2dwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_DWB :
- mod->BSIM3V2dwb = value->rValue;
- mod->BSIM3V2dwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_B0 :
- mod->BSIM3V2b0 = value->rValue;
- mod->BSIM3V2b0Given = TRUE;
- break;
- case BSIM3V2_MOD_B1 :
- mod->BSIM3V2b1 = value->rValue;
- mod->BSIM3V2b1Given = TRUE;
- break;
- case BSIM3V2_MOD_ALPHA0 :
- mod->BSIM3V2alpha0 = value->rValue;
- mod->BSIM3V2alpha0Given = TRUE;
- break;
- case BSIM3V2_MOD_ALPHA1 :
- mod->BSIM3V2alpha1 = value->rValue;
- mod->BSIM3V2alpha1Given = TRUE;
- break;
- case BSIM3V2_MOD_BETA0 :
- mod->BSIM3V2beta0 = value->rValue;
- mod->BSIM3V2beta0Given = TRUE;
- break;
- case BSIM3V2_MOD_IJTH :
- mod->BSIM3V2ijth = value->rValue;
- mod->BSIM3V2ijthGiven = TRUE;
- break;
- case BSIM3V2_MOD_VFB :
- mod->BSIM3V2vfb = value->rValue;
- mod->BSIM3V2vfbGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_ELM :
- mod->BSIM3V2elm = value->rValue;
- mod->BSIM3V2elmGiven = TRUE;
- break;
- case BSIM3V2_MOD_CGSL :
- mod->BSIM3V2cgsl = value->rValue;
- mod->BSIM3V2cgslGiven = TRUE;
- break;
- case BSIM3V2_MOD_CGDL :
- mod->BSIM3V2cgdl = value->rValue;
- mod->BSIM3V2cgdlGiven = TRUE;
- break;
- case BSIM3V2_MOD_CKAPPA :
- mod->BSIM3V2ckappa = value->rValue;
- mod->BSIM3V2ckappaGiven = TRUE;
- break;
- case BSIM3V2_MOD_CF :
- mod->BSIM3V2cf = value->rValue;
- mod->BSIM3V2cfGiven = TRUE;
- break;
- case BSIM3V2_MOD_CLC :
- mod->BSIM3V2clc = value->rValue;
- mod->BSIM3V2clcGiven = TRUE;
- break;
- case BSIM3V2_MOD_CLE :
- mod->BSIM3V2cle = value->rValue;
- mod->BSIM3V2cleGiven = TRUE;
- break;
- case BSIM3V2_MOD_DWC :
- mod->BSIM3V2dwc = value->rValue;
- mod->BSIM3V2dwcGiven = TRUE;
- break;
- case BSIM3V2_MOD_DLC :
- mod->BSIM3V2dlc = value->rValue;
- mod->BSIM3V2dlcGiven = TRUE;
- break;
- case BSIM3V2_MOD_VFBCV :
- mod->BSIM3V2vfbcv = value->rValue;
- mod->BSIM3V2vfbcvGiven = TRUE;
- break;
- case BSIM3V2_MOD_ACDE :
- mod->BSIM3V2acde = value->rValue;
- mod->BSIM3V2acdeGiven = TRUE;
- break;
- case BSIM3V2_MOD_MOIN :
- mod->BSIM3V2moin = value->rValue;
- mod->BSIM3V2moinGiven = TRUE;
- break;
- case BSIM3V2_MOD_NOFF :
- mod->BSIM3V2noff = value->rValue;
- mod->BSIM3V2noffGiven = TRUE;
- break;
- case BSIM3V2_MOD_VOFFCV :
- mod->BSIM3V2voffcv = value->rValue;
- mod->BSIM3V2voffcvGiven = TRUE;
- break;
- case BSIM3V2_MOD_TCJ :
- mod->BSIM3V2tcj = value->rValue;
- mod->BSIM3V2tcjGiven = TRUE;
- break;
- case BSIM3V2_MOD_TPB :
- mod->BSIM3V2tpb = value->rValue;
- mod->BSIM3V2tpbGiven = TRUE;
- break;
- case BSIM3V2_MOD_TCJSW :
- mod->BSIM3V2tcjsw = value->rValue;
- mod->BSIM3V2tcjswGiven = TRUE;
- break;
- case BSIM3V2_MOD_TPBSW :
- mod->BSIM3V2tpbsw = value->rValue;
- mod->BSIM3V2tpbswGiven = TRUE;
- break;
- case BSIM3V2_MOD_TCJSWG :
- mod->BSIM3V2tcjswg = value->rValue;
- mod->BSIM3V2tcjswgGiven = TRUE;
- break;
- case BSIM3V2_MOD_TPBSWG :
- mod->BSIM3V2tpbswg = value->rValue;
- mod->BSIM3V2tpbswgGiven = TRUE;
- break;
-
- /* Length dependence */
- case BSIM3V2_MOD_LCDSC :
- mod->BSIM3V2lcdsc = value->rValue;
- mod->BSIM3V2lcdscGiven = TRUE;
- break;
-
-
- case BSIM3V2_MOD_LCDSCB :
- mod->BSIM3V2lcdscb = value->rValue;
- mod->BSIM3V2lcdscbGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCDSCD :
- mod->BSIM3V2lcdscd = value->rValue;
- mod->BSIM3V2lcdscdGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCIT :
- mod->BSIM3V2lcit = value->rValue;
- mod->BSIM3V2lcitGiven = TRUE;
- break;
- case BSIM3V2_MOD_LNFACTOR :
- mod->BSIM3V2lnfactor = value->rValue;
- mod->BSIM3V2lnfactorGiven = TRUE;
- break;
- case BSIM3V2_MOD_LXJ:
- mod->BSIM3V2lxj = value->rValue;
- mod->BSIM3V2lxjGiven = TRUE;
- break;
- case BSIM3V2_MOD_LVSAT:
- mod->BSIM3V2lvsat = value->rValue;
- mod->BSIM3V2lvsatGiven = TRUE;
- break;
-
-
- case BSIM3V2_MOD_LA0:
- mod->BSIM3V2la0 = value->rValue;
- mod->BSIM3V2la0Given = TRUE;
- break;
- case BSIM3V2_MOD_LAGS:
- mod->BSIM3V2lags = value->rValue;
- mod->BSIM3V2lagsGiven = TRUE;
- break;
- case BSIM3V2_MOD_LA1:
- mod->BSIM3V2la1 = value->rValue;
- mod->BSIM3V2la1Given = TRUE;
- break;
- case BSIM3V2_MOD_LA2:
- mod->BSIM3V2la2 = value->rValue;
- mod->BSIM3V2la2Given = TRUE;
- break;
- case BSIM3V2_MOD_LAT:
- mod->BSIM3V2lat = value->rValue;
- mod->BSIM3V2latGiven = TRUE;
- break;
- case BSIM3V2_MOD_LKETA:
- mod->BSIM3V2lketa = value->rValue;
- mod->BSIM3V2lketaGiven = TRUE;
- break;
- case BSIM3V2_MOD_LNSUB:
- mod->BSIM3V2lnsub = value->rValue;
- mod->BSIM3V2lnsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_LNPEAK:
- mod->BSIM3V2lnpeak = value->rValue;
- mod->BSIM3V2lnpeakGiven = TRUE;
- if (mod->BSIM3V2lnpeak > 1.0e20)
- mod->BSIM3V2lnpeak *= 1.0e-6;
- break;
- case BSIM3V2_MOD_LNGATE:
- mod->BSIM3V2lngate = value->rValue;
- mod->BSIM3V2lngateGiven = TRUE;
- if (mod->BSIM3V2lngate > 1.0e23)
- mod->BSIM3V2lngate *= 1.0e-6;
- break;
- case BSIM3V2_MOD_LGAMMA1:
- mod->BSIM3V2lgamma1 = value->rValue;
- mod->BSIM3V2lgamma1Given = TRUE;
- break;
- case BSIM3V2_MOD_LGAMMA2:
- mod->BSIM3V2lgamma2 = value->rValue;
- mod->BSIM3V2lgamma2Given = TRUE;
- break;
- case BSIM3V2_MOD_LVBX:
- mod->BSIM3V2lvbx = value->rValue;
- mod->BSIM3V2lvbxGiven = TRUE;
- break;
- case BSIM3V2_MOD_LVBM:
- mod->BSIM3V2lvbm = value->rValue;
- mod->BSIM3V2lvbmGiven = TRUE;
- break;
- case BSIM3V2_MOD_LXT:
- mod->BSIM3V2lxt = value->rValue;
- mod->BSIM3V2lxtGiven = TRUE;
- break;
- case BSIM3V2_MOD_LK1:
- mod->BSIM3V2lk1 = value->rValue;
- mod->BSIM3V2lk1Given = TRUE;
- break;
- case BSIM3V2_MOD_LKT1:
- mod->BSIM3V2lkt1 = value->rValue;
- mod->BSIM3V2lkt1Given = TRUE;
- break;
- case BSIM3V2_MOD_LKT1L:
- mod->BSIM3V2lkt1l = value->rValue;
- mod->BSIM3V2lkt1lGiven = TRUE;
- break;
- case BSIM3V2_MOD_LKT2:
- mod->BSIM3V2lkt2 = value->rValue;
- mod->BSIM3V2lkt2Given = TRUE;
- break;
- case BSIM3V2_MOD_LK2:
- mod->BSIM3V2lk2 = value->rValue;
- mod->BSIM3V2lk2Given = TRUE;
- break;
- case BSIM3V2_MOD_LK3:
- mod->BSIM3V2lk3 = value->rValue;
- mod->BSIM3V2lk3Given = TRUE;
- break;
- case BSIM3V2_MOD_LK3B:
- mod->BSIM3V2lk3b = value->rValue;
- mod->BSIM3V2lk3bGiven = TRUE;
- break;
- case BSIM3V2_MOD_LNLX:
- mod->BSIM3V2lnlx = value->rValue;
- mod->BSIM3V2lnlxGiven = TRUE;
- break;
- case BSIM3V2_MOD_LW0:
- mod->BSIM3V2lw0 = value->rValue;
- mod->BSIM3V2lw0Given = TRUE;
- break;
- case BSIM3V2_MOD_LDVT0:
- mod->BSIM3V2ldvt0 = value->rValue;
- mod->BSIM3V2ldvt0Given = TRUE;
- break;
- case BSIM3V2_MOD_LDVT1:
- mod->BSIM3V2ldvt1 = value->rValue;
- mod->BSIM3V2ldvt1Given = TRUE;
- break;
- case BSIM3V2_MOD_LDVT2:
- mod->BSIM3V2ldvt2 = value->rValue;
- mod->BSIM3V2ldvt2Given = TRUE;
- break;
- case BSIM3V2_MOD_LDVT0W:
- mod->BSIM3V2ldvt0w = value->rValue;
- mod->BSIM3V2ldvt0wGiven = TRUE;
- break;
- case BSIM3V2_MOD_LDVT1W:
- mod->BSIM3V2ldvt1w = value->rValue;
- mod->BSIM3V2ldvt1wGiven = TRUE;
- break;
- case BSIM3V2_MOD_LDVT2W:
- mod->BSIM3V2ldvt2w = value->rValue;
- mod->BSIM3V2ldvt2wGiven = TRUE;
- break;
- case BSIM3V2_MOD_LDROUT:
- mod->BSIM3V2ldrout = value->rValue;
- mod->BSIM3V2ldroutGiven = TRUE;
- break;
- case BSIM3V2_MOD_LDSUB:
- mod->BSIM3V2ldsub = value->rValue;
- mod->BSIM3V2ldsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_LVTH0:
- mod->BSIM3V2lvth0 = value->rValue;
- mod->BSIM3V2lvth0Given = TRUE;
- break;
- case BSIM3V2_MOD_LUA:
- mod->BSIM3V2lua = value->rValue;
- mod->BSIM3V2luaGiven = TRUE;
- break;
- case BSIM3V2_MOD_LUA1:
- mod->BSIM3V2lua1 = value->rValue;
- mod->BSIM3V2lua1Given = TRUE;
- break;
- case BSIM3V2_MOD_LUB:
- mod->BSIM3V2lub = value->rValue;
- mod->BSIM3V2lubGiven = TRUE;
- break;
- case BSIM3V2_MOD_LUB1:
- mod->BSIM3V2lub1 = value->rValue;
- mod->BSIM3V2lub1Given = TRUE;
- break;
- case BSIM3V2_MOD_LUC:
- mod->BSIM3V2luc = value->rValue;
- mod->BSIM3V2lucGiven = TRUE;
- break;
- case BSIM3V2_MOD_LUC1:
- mod->BSIM3V2luc1 = value->rValue;
- mod->BSIM3V2luc1Given = TRUE;
- break;
- case BSIM3V2_MOD_LU0 :
- mod->BSIM3V2lu0 = value->rValue;
- mod->BSIM3V2lu0Given = TRUE;
- break;
- case BSIM3V2_MOD_LUTE :
- mod->BSIM3V2lute = value->rValue;
- mod->BSIM3V2luteGiven = TRUE;
- break;
- case BSIM3V2_MOD_LVOFF:
- mod->BSIM3V2lvoff = value->rValue;
- mod->BSIM3V2lvoffGiven = TRUE;
- break;
- case BSIM3V2_MOD_LDELTA :
- mod->BSIM3V2ldelta = value->rValue;
- mod->BSIM3V2ldeltaGiven = TRUE;
- break;
- case BSIM3V2_MOD_LRDSW:
- mod->BSIM3V2lrdsw = value->rValue;
- mod->BSIM3V2lrdswGiven = TRUE;
- break;
- case BSIM3V2_MOD_LPRWB:
- mod->BSIM3V2lprwb = value->rValue;
- mod->BSIM3V2lprwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_LPRWG:
- mod->BSIM3V2lprwg = value->rValue;
- mod->BSIM3V2lprwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_LPRT:
- mod->BSIM3V2lprt = value->rValue;
- mod->BSIM3V2lprtGiven = TRUE;
- break;
- case BSIM3V2_MOD_LETA0:
- mod->BSIM3V2leta0 = value->rValue;
- mod->BSIM3V2leta0Given = TRUE;
- break;
- case BSIM3V2_MOD_LETAB:
- mod->BSIM3V2letab = value->rValue;
- mod->BSIM3V2letabGiven = TRUE;
- break;
- case BSIM3V2_MOD_LPCLM:
- mod->BSIM3V2lpclm = value->rValue;
- mod->BSIM3V2lpclmGiven = TRUE;
- break;
- case BSIM3V2_MOD_LPDIBL1:
- mod->BSIM3V2lpdibl1 = value->rValue;
- mod->BSIM3V2lpdibl1Given = TRUE;
- break;
- case BSIM3V2_MOD_LPDIBL2:
- mod->BSIM3V2lpdibl2 = value->rValue;
- mod->BSIM3V2lpdibl2Given = TRUE;
- break;
- case BSIM3V2_MOD_LPDIBLB:
- mod->BSIM3V2lpdiblb = value->rValue;
- mod->BSIM3V2lpdiblbGiven = TRUE;
- break;
- case BSIM3V2_MOD_LPSCBE1:
- mod->BSIM3V2lpscbe1 = value->rValue;
- mod->BSIM3V2lpscbe1Given = TRUE;
- break;
- case BSIM3V2_MOD_LPSCBE2:
- mod->BSIM3V2lpscbe2 = value->rValue;
- mod->BSIM3V2lpscbe2Given = TRUE;
- break;
- case BSIM3V2_MOD_LPVAG:
- mod->BSIM3V2lpvag = value->rValue;
- mod->BSIM3V2lpvagGiven = TRUE;
- break;
- case BSIM3V2_MOD_LWR :
- mod->BSIM3V2lwr = value->rValue;
- mod->BSIM3V2lwrGiven = TRUE;
- break;
- case BSIM3V2_MOD_LDWG :
- mod->BSIM3V2ldwg = value->rValue;
- mod->BSIM3V2ldwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_LDWB :
- mod->BSIM3V2ldwb = value->rValue;
- mod->BSIM3V2ldwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_LB0 :
- mod->BSIM3V2lb0 = value->rValue;
- mod->BSIM3V2lb0Given = TRUE;
- break;
- case BSIM3V2_MOD_LB1 :
- mod->BSIM3V2lb1 = value->rValue;
- mod->BSIM3V2lb1Given = TRUE;
- break;
- case BSIM3V2_MOD_LALPHA0 :
- mod->BSIM3V2lalpha0 = value->rValue;
- mod->BSIM3V2lalpha0Given = TRUE;
- break;
- case BSIM3V2_MOD_LALPHA1 :
- mod->BSIM3V2lalpha1 = value->rValue;
- mod->BSIM3V2lalpha1Given = TRUE;
- break;
- case BSIM3V2_MOD_LBETA0 :
- mod->BSIM3V2lbeta0 = value->rValue;
- mod->BSIM3V2lbeta0Given = TRUE;
- break;
- case BSIM3V2_MOD_LVFB :
- mod->BSIM3V2lvfb = value->rValue;
- mod->BSIM3V2lvfbGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_LELM :
- mod->BSIM3V2lelm = value->rValue;
- mod->BSIM3V2lelmGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCGSL :
- mod->BSIM3V2lcgsl = value->rValue;
- mod->BSIM3V2lcgslGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCGDL :
- mod->BSIM3V2lcgdl = value->rValue;
- mod->BSIM3V2lcgdlGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCKAPPA :
- mod->BSIM3V2lckappa = value->rValue;
- mod->BSIM3V2lckappaGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCF :
- mod->BSIM3V2lcf = value->rValue;
- mod->BSIM3V2lcfGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCLC :
- mod->BSIM3V2lclc = value->rValue;
- mod->BSIM3V2lclcGiven = TRUE;
- break;
- case BSIM3V2_MOD_LCLE :
- mod->BSIM3V2lcle = value->rValue;
- mod->BSIM3V2lcleGiven = TRUE;
- break;
- case BSIM3V2_MOD_LVFBCV :
- mod->BSIM3V2lvfbcv = value->rValue;
- mod->BSIM3V2lvfbcvGiven = TRUE;
- break;
- case BSIM3V2_MOD_LACDE :
- mod->BSIM3V2lacde = value->rValue;
- mod->BSIM3V2lacdeGiven = TRUE;
- break;
- case BSIM3V2_MOD_LMOIN :
- mod->BSIM3V2lmoin = value->rValue;
- mod->BSIM3V2lmoinGiven = TRUE;
- break;
- case BSIM3V2_MOD_LNOFF :
- mod->BSIM3V2lnoff = value->rValue;
- mod->BSIM3V2lnoffGiven = TRUE;
- break;
- case BSIM3V2_MOD_LVOFFCV :
- mod->BSIM3V2lvoffcv = value->rValue;
- mod->BSIM3V2lvoffcvGiven = TRUE;
- break;
-
- /* Width dependence */
- case BSIM3V2_MOD_WCDSC :
- mod->BSIM3V2wcdsc = value->rValue;
- mod->BSIM3V2wcdscGiven = TRUE;
- break;
-
-
- case BSIM3V2_MOD_WCDSCB :
- mod->BSIM3V2wcdscb = value->rValue;
- mod->BSIM3V2wcdscbGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCDSCD :
- mod->BSIM3V2wcdscd = value->rValue;
- mod->BSIM3V2wcdscdGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCIT :
- mod->BSIM3V2wcit = value->rValue;
- mod->BSIM3V2wcitGiven = TRUE;
- break;
- case BSIM3V2_MOD_WNFACTOR :
- mod->BSIM3V2wnfactor = value->rValue;
- mod->BSIM3V2wnfactorGiven = TRUE;
- break;
- case BSIM3V2_MOD_WXJ:
- mod->BSIM3V2wxj = value->rValue;
- mod->BSIM3V2wxjGiven = TRUE;
- break;
- case BSIM3V2_MOD_WVSAT:
- mod->BSIM3V2wvsat = value->rValue;
- mod->BSIM3V2wvsatGiven = TRUE;
- break;
-
-
- case BSIM3V2_MOD_WA0:
- mod->BSIM3V2wa0 = value->rValue;
- mod->BSIM3V2wa0Given = TRUE;
- break;
- case BSIM3V2_MOD_WAGS:
- mod->BSIM3V2wags = value->rValue;
- mod->BSIM3V2wagsGiven = TRUE;
- break;
- case BSIM3V2_MOD_WA1:
- mod->BSIM3V2wa1 = value->rValue;
- mod->BSIM3V2wa1Given = TRUE;
- break;
- case BSIM3V2_MOD_WA2:
- mod->BSIM3V2wa2 = value->rValue;
- mod->BSIM3V2wa2Given = TRUE;
- break;
- case BSIM3V2_MOD_WAT:
- mod->BSIM3V2wat = value->rValue;
- mod->BSIM3V2watGiven = TRUE;
- break;
- case BSIM3V2_MOD_WKETA:
- mod->BSIM3V2wketa = value->rValue;
- mod->BSIM3V2wketaGiven = TRUE;
- break;
- case BSIM3V2_MOD_WNSUB:
- mod->BSIM3V2wnsub = value->rValue;
- mod->BSIM3V2wnsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_WNPEAK:
- mod->BSIM3V2wnpeak = value->rValue;
- mod->BSIM3V2wnpeakGiven = TRUE;
- if (mod->BSIM3V2wnpeak > 1.0e20)
- mod->BSIM3V2wnpeak *= 1.0e-6;
- break;
- case BSIM3V2_MOD_WNGATE:
- mod->BSIM3V2wngate = value->rValue;
- mod->BSIM3V2wngateGiven = TRUE;
- if (mod->BSIM3V2wngate > 1.0e23)
- mod->BSIM3V2wngate *= 1.0e-6;
- break;
- case BSIM3V2_MOD_WGAMMA1:
- mod->BSIM3V2wgamma1 = value->rValue;
- mod->BSIM3V2wgamma1Given = TRUE;
- break;
- case BSIM3V2_MOD_WGAMMA2:
- mod->BSIM3V2wgamma2 = value->rValue;
- mod->BSIM3V2wgamma2Given = TRUE;
- break;
- case BSIM3V2_MOD_WVBX:
- mod->BSIM3V2wvbx = value->rValue;
- mod->BSIM3V2wvbxGiven = TRUE;
- break;
- case BSIM3V2_MOD_WVBM:
- mod->BSIM3V2wvbm = value->rValue;
- mod->BSIM3V2wvbmGiven = TRUE;
- break;
- case BSIM3V2_MOD_WXT:
- mod->BSIM3V2wxt = value->rValue;
- mod->BSIM3V2wxtGiven = TRUE;
- break;
- case BSIM3V2_MOD_WK1:
- mod->BSIM3V2wk1 = value->rValue;
- mod->BSIM3V2wk1Given = TRUE;
- break;
- case BSIM3V2_MOD_WKT1:
- mod->BSIM3V2wkt1 = value->rValue;
- mod->BSIM3V2wkt1Given = TRUE;
- break;
- case BSIM3V2_MOD_WKT1L:
- mod->BSIM3V2wkt1l = value->rValue;
- mod->BSIM3V2wkt1lGiven = TRUE;
- break;
- case BSIM3V2_MOD_WKT2:
- mod->BSIM3V2wkt2 = value->rValue;
- mod->BSIM3V2wkt2Given = TRUE;
- break;
- case BSIM3V2_MOD_WK2:
- mod->BSIM3V2wk2 = value->rValue;
- mod->BSIM3V2wk2Given = TRUE;
- break;
- case BSIM3V2_MOD_WK3:
- mod->BSIM3V2wk3 = value->rValue;
- mod->BSIM3V2wk3Given = TRUE;
- break;
- case BSIM3V2_MOD_WK3B:
- mod->BSIM3V2wk3b = value->rValue;
- mod->BSIM3V2wk3bGiven = TRUE;
- break;
- case BSIM3V2_MOD_WNLX:
- mod->BSIM3V2wnlx = value->rValue;
- mod->BSIM3V2wnlxGiven = TRUE;
- break;
- case BSIM3V2_MOD_WW0:
- mod->BSIM3V2ww0 = value->rValue;
- mod->BSIM3V2ww0Given = TRUE;
- break;
- case BSIM3V2_MOD_WDVT0:
- mod->BSIM3V2wdvt0 = value->rValue;
- mod->BSIM3V2wdvt0Given = TRUE;
- break;
- case BSIM3V2_MOD_WDVT1:
- mod->BSIM3V2wdvt1 = value->rValue;
- mod->BSIM3V2wdvt1Given = TRUE;
- break;
- case BSIM3V2_MOD_WDVT2:
- mod->BSIM3V2wdvt2 = value->rValue;
- mod->BSIM3V2wdvt2Given = TRUE;
- break;
- case BSIM3V2_MOD_WDVT0W:
- mod->BSIM3V2wdvt0w = value->rValue;
- mod->BSIM3V2wdvt0wGiven = TRUE;
- break;
- case BSIM3V2_MOD_WDVT1W:
- mod->BSIM3V2wdvt1w = value->rValue;
- mod->BSIM3V2wdvt1wGiven = TRUE;
- break;
- case BSIM3V2_MOD_WDVT2W:
- mod->BSIM3V2wdvt2w = value->rValue;
- mod->BSIM3V2wdvt2wGiven = TRUE;
- break;
- case BSIM3V2_MOD_WDROUT:
- mod->BSIM3V2wdrout = value->rValue;
- mod->BSIM3V2wdroutGiven = TRUE;
- break;
- case BSIM3V2_MOD_WDSUB:
- mod->BSIM3V2wdsub = value->rValue;
- mod->BSIM3V2wdsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_WVTH0:
- mod->BSIM3V2wvth0 = value->rValue;
- mod->BSIM3V2wvth0Given = TRUE;
- break;
- case BSIM3V2_MOD_WUA:
- mod->BSIM3V2wua = value->rValue;
- mod->BSIM3V2wuaGiven = TRUE;
- break;
- case BSIM3V2_MOD_WUA1:
- mod->BSIM3V2wua1 = value->rValue;
- mod->BSIM3V2wua1Given = TRUE;
- break;
- case BSIM3V2_MOD_WUB:
- mod->BSIM3V2wub = value->rValue;
- mod->BSIM3V2wubGiven = TRUE;
- break;
- case BSIM3V2_MOD_WUB1:
- mod->BSIM3V2wub1 = value->rValue;
- mod->BSIM3V2wub1Given = TRUE;
- break;
- case BSIM3V2_MOD_WUC:
- mod->BSIM3V2wuc = value->rValue;
- mod->BSIM3V2wucGiven = TRUE;
- break;
- case BSIM3V2_MOD_WUC1:
- mod->BSIM3V2wuc1 = value->rValue;
- mod->BSIM3V2wuc1Given = TRUE;
- break;
- case BSIM3V2_MOD_WU0 :
- mod->BSIM3V2wu0 = value->rValue;
- mod->BSIM3V2wu0Given = TRUE;
- break;
- case BSIM3V2_MOD_WUTE :
- mod->BSIM3V2wute = value->rValue;
- mod->BSIM3V2wuteGiven = TRUE;
- break;
- case BSIM3V2_MOD_WVOFF:
- mod->BSIM3V2wvoff = value->rValue;
- mod->BSIM3V2wvoffGiven = TRUE;
- break;
- case BSIM3V2_MOD_WDELTA :
- mod->BSIM3V2wdelta = value->rValue;
- mod->BSIM3V2wdeltaGiven = TRUE;
- break;
- case BSIM3V2_MOD_WRDSW:
- mod->BSIM3V2wrdsw = value->rValue;
- mod->BSIM3V2wrdswGiven = TRUE;
- break;
- case BSIM3V2_MOD_WPRWB:
- mod->BSIM3V2wprwb = value->rValue;
- mod->BSIM3V2wprwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_WPRWG:
- mod->BSIM3V2wprwg = value->rValue;
- mod->BSIM3V2wprwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_WPRT:
- mod->BSIM3V2wprt = value->rValue;
- mod->BSIM3V2wprtGiven = TRUE;
- break;
- case BSIM3V2_MOD_WETA0:
- mod->BSIM3V2weta0 = value->rValue;
- mod->BSIM3V2weta0Given = TRUE;
- break;
- case BSIM3V2_MOD_WETAB:
- mod->BSIM3V2wetab = value->rValue;
- mod->BSIM3V2wetabGiven = TRUE;
- break;
- case BSIM3V2_MOD_WPCLM:
- mod->BSIM3V2wpclm = value->rValue;
- mod->BSIM3V2wpclmGiven = TRUE;
- break;
- case BSIM3V2_MOD_WPDIBL1:
- mod->BSIM3V2wpdibl1 = value->rValue;
- mod->BSIM3V2wpdibl1Given = TRUE;
- break;
- case BSIM3V2_MOD_WPDIBL2:
- mod->BSIM3V2wpdibl2 = value->rValue;
- mod->BSIM3V2wpdibl2Given = TRUE;
- break;
- case BSIM3V2_MOD_WPDIBLB:
- mod->BSIM3V2wpdiblb = value->rValue;
- mod->BSIM3V2wpdiblbGiven = TRUE;
- break;
- case BSIM3V2_MOD_WPSCBE1:
- mod->BSIM3V2wpscbe1 = value->rValue;
- mod->BSIM3V2wpscbe1Given = TRUE;
- break;
- case BSIM3V2_MOD_WPSCBE2:
- mod->BSIM3V2wpscbe2 = value->rValue;
- mod->BSIM3V2wpscbe2Given = TRUE;
- break;
- case BSIM3V2_MOD_WPVAG:
- mod->BSIM3V2wpvag = value->rValue;
- mod->BSIM3V2wpvagGiven = TRUE;
- break;
- case BSIM3V2_MOD_WWR :
- mod->BSIM3V2wwr = value->rValue;
- mod->BSIM3V2wwrGiven = TRUE;
- break;
- case BSIM3V2_MOD_WDWG :
- mod->BSIM3V2wdwg = value->rValue;
- mod->BSIM3V2wdwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_WDWB :
- mod->BSIM3V2wdwb = value->rValue;
- mod->BSIM3V2wdwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_WB0 :
- mod->BSIM3V2wb0 = value->rValue;
- mod->BSIM3V2wb0Given = TRUE;
- break;
- case BSIM3V2_MOD_WB1 :
- mod->BSIM3V2wb1 = value->rValue;
- mod->BSIM3V2wb1Given = TRUE;
- break;
- case BSIM3V2_MOD_WALPHA0 :
- mod->BSIM3V2walpha0 = value->rValue;
- mod->BSIM3V2walpha0Given = TRUE;
- break;
- case BSIM3V2_MOD_WALPHA1 :
- mod->BSIM3V2walpha1 = value->rValue;
- mod->BSIM3V2walpha1Given = TRUE;
- break;
- case BSIM3V2_MOD_WBETA0 :
- mod->BSIM3V2wbeta0 = value->rValue;
- mod->BSIM3V2wbeta0Given = TRUE;
- break;
- case BSIM3V2_MOD_WVFB :
- mod->BSIM3V2wvfb = value->rValue;
- mod->BSIM3V2wvfbGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_WELM :
- mod->BSIM3V2welm = value->rValue;
- mod->BSIM3V2welmGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCGSL :
- mod->BSIM3V2wcgsl = value->rValue;
- mod->BSIM3V2wcgslGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCGDL :
- mod->BSIM3V2wcgdl = value->rValue;
- mod->BSIM3V2wcgdlGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCKAPPA :
- mod->BSIM3V2wckappa = value->rValue;
- mod->BSIM3V2wckappaGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCF :
- mod->BSIM3V2wcf = value->rValue;
- mod->BSIM3V2wcfGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCLC :
- mod->BSIM3V2wclc = value->rValue;
- mod->BSIM3V2wclcGiven = TRUE;
- break;
- case BSIM3V2_MOD_WCLE :
- mod->BSIM3V2wcle = value->rValue;
- mod->BSIM3V2wcleGiven = TRUE;
- break;
- case BSIM3V2_MOD_WVFBCV :
- mod->BSIM3V2wvfbcv = value->rValue;
- mod->BSIM3V2wvfbcvGiven = TRUE;
- break;
- case BSIM3V2_MOD_WACDE :
- mod->BSIM3V2wacde = value->rValue;
- mod->BSIM3V2wacdeGiven = TRUE;
- break;
- case BSIM3V2_MOD_WMOIN :
- mod->BSIM3V2wmoin = value->rValue;
- mod->BSIM3V2wmoinGiven = TRUE;
- break;
- case BSIM3V2_MOD_WNOFF :
- mod->BSIM3V2wnoff = value->rValue;
- mod->BSIM3V2wnoffGiven = TRUE;
- break;
- case BSIM3V2_MOD_WVOFFCV :
- mod->BSIM3V2wvoffcv = value->rValue;
- mod->BSIM3V2wvoffcvGiven = TRUE;
- break;
-
- /* Cross-term dependence */
- case BSIM3V2_MOD_PCDSC :
- mod->BSIM3V2pcdsc = value->rValue;
- mod->BSIM3V2pcdscGiven = TRUE;
- break;
-
-
- case BSIM3V2_MOD_PCDSCB :
- mod->BSIM3V2pcdscb = value->rValue;
- mod->BSIM3V2pcdscbGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCDSCD :
- mod->BSIM3V2pcdscd = value->rValue;
- mod->BSIM3V2pcdscdGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCIT :
- mod->BSIM3V2pcit = value->rValue;
- mod->BSIM3V2pcitGiven = TRUE;
- break;
- case BSIM3V2_MOD_PNFACTOR :
- mod->BSIM3V2pnfactor = value->rValue;
- mod->BSIM3V2pnfactorGiven = TRUE;
- break;
- case BSIM3V2_MOD_PXJ:
- mod->BSIM3V2pxj = value->rValue;
- mod->BSIM3V2pxjGiven = TRUE;
- break;
- case BSIM3V2_MOD_PVSAT:
- mod->BSIM3V2pvsat = value->rValue;
- mod->BSIM3V2pvsatGiven = TRUE;
- break;
-
-
- case BSIM3V2_MOD_PA0:
- mod->BSIM3V2pa0 = value->rValue;
- mod->BSIM3V2pa0Given = TRUE;
- break;
- case BSIM3V2_MOD_PAGS:
- mod->BSIM3V2pags = value->rValue;
- mod->BSIM3V2pagsGiven = TRUE;
- break;
- case BSIM3V2_MOD_PA1:
- mod->BSIM3V2pa1 = value->rValue;
- mod->BSIM3V2pa1Given = TRUE;
- break;
- case BSIM3V2_MOD_PA2:
- mod->BSIM3V2pa2 = value->rValue;
- mod->BSIM3V2pa2Given = TRUE;
- break;
- case BSIM3V2_MOD_PAT:
- mod->BSIM3V2pat = value->rValue;
- mod->BSIM3V2patGiven = TRUE;
- break;
- case BSIM3V2_MOD_PKETA:
- mod->BSIM3V2pketa = value->rValue;
- mod->BSIM3V2pketaGiven = TRUE;
- break;
- case BSIM3V2_MOD_PNSUB:
- mod->BSIM3V2pnsub = value->rValue;
- mod->BSIM3V2pnsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_PNPEAK:
- mod->BSIM3V2pnpeak = value->rValue;
- mod->BSIM3V2pnpeakGiven = TRUE;
- if (mod->BSIM3V2pnpeak > 1.0e20)
- mod->BSIM3V2pnpeak *= 1.0e-6;
- break;
- case BSIM3V2_MOD_PNGATE:
- mod->BSIM3V2pngate = value->rValue;
- mod->BSIM3V2pngateGiven = TRUE;
- if (mod->BSIM3V2pngate > 1.0e23)
- mod->BSIM3V2pngate *= 1.0e-6;
- break;
- case BSIM3V2_MOD_PGAMMA1:
- mod->BSIM3V2pgamma1 = value->rValue;
- mod->BSIM3V2pgamma1Given = TRUE;
- break;
- case BSIM3V2_MOD_PGAMMA2:
- mod->BSIM3V2pgamma2 = value->rValue;
- mod->BSIM3V2pgamma2Given = TRUE;
- break;
- case BSIM3V2_MOD_PVBX:
- mod->BSIM3V2pvbx = value->rValue;
- mod->BSIM3V2pvbxGiven = TRUE;
- break;
- case BSIM3V2_MOD_PVBM:
- mod->BSIM3V2pvbm = value->rValue;
- mod->BSIM3V2pvbmGiven = TRUE;
- break;
- case BSIM3V2_MOD_PXT:
- mod->BSIM3V2pxt = value->rValue;
- mod->BSIM3V2pxtGiven = TRUE;
- break;
- case BSIM3V2_MOD_PK1:
- mod->BSIM3V2pk1 = value->rValue;
- mod->BSIM3V2pk1Given = TRUE;
- break;
- case BSIM3V2_MOD_PKT1:
- mod->BSIM3V2pkt1 = value->rValue;
- mod->BSIM3V2pkt1Given = TRUE;
- break;
- case BSIM3V2_MOD_PKT1L:
- mod->BSIM3V2pkt1l = value->rValue;
- mod->BSIM3V2pkt1lGiven = TRUE;
- break;
- case BSIM3V2_MOD_PKT2:
- mod->BSIM3V2pkt2 = value->rValue;
- mod->BSIM3V2pkt2Given = TRUE;
- break;
- case BSIM3V2_MOD_PK2:
- mod->BSIM3V2pk2 = value->rValue;
- mod->BSIM3V2pk2Given = TRUE;
- break;
- case BSIM3V2_MOD_PK3:
- mod->BSIM3V2pk3 = value->rValue;
- mod->BSIM3V2pk3Given = TRUE;
- break;
- case BSIM3V2_MOD_PK3B:
- mod->BSIM3V2pk3b = value->rValue;
- mod->BSIM3V2pk3bGiven = TRUE;
- break;
- case BSIM3V2_MOD_PNLX:
- mod->BSIM3V2pnlx = value->rValue;
- mod->BSIM3V2pnlxGiven = TRUE;
- break;
- case BSIM3V2_MOD_PW0:
- mod->BSIM3V2pw0 = value->rValue;
- mod->BSIM3V2pw0Given = TRUE;
- break;
- case BSIM3V2_MOD_PDVT0:
- mod->BSIM3V2pdvt0 = value->rValue;
- mod->BSIM3V2pdvt0Given = TRUE;
- break;
- case BSIM3V2_MOD_PDVT1:
- mod->BSIM3V2pdvt1 = value->rValue;
- mod->BSIM3V2pdvt1Given = TRUE;
- break;
- case BSIM3V2_MOD_PDVT2:
- mod->BSIM3V2pdvt2 = value->rValue;
- mod->BSIM3V2pdvt2Given = TRUE;
- break;
- case BSIM3V2_MOD_PDVT0W:
- mod->BSIM3V2pdvt0w = value->rValue;
- mod->BSIM3V2pdvt0wGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDVT1W:
- mod->BSIM3V2pdvt1w = value->rValue;
- mod->BSIM3V2pdvt1wGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDVT2W:
- mod->BSIM3V2pdvt2w = value->rValue;
- mod->BSIM3V2pdvt2wGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDROUT:
- mod->BSIM3V2pdrout = value->rValue;
- mod->BSIM3V2pdroutGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDSUB:
- mod->BSIM3V2pdsub = value->rValue;
- mod->BSIM3V2pdsubGiven = TRUE;
- break;
- case BSIM3V2_MOD_PVTH0:
- mod->BSIM3V2pvth0 = value->rValue;
- mod->BSIM3V2pvth0Given = TRUE;
- break;
- case BSIM3V2_MOD_PUA:
- mod->BSIM3V2pua = value->rValue;
- mod->BSIM3V2puaGiven = TRUE;
- break;
- case BSIM3V2_MOD_PUA1:
- mod->BSIM3V2pua1 = value->rValue;
- mod->BSIM3V2pua1Given = TRUE;
- break;
- case BSIM3V2_MOD_PUB:
- mod->BSIM3V2pub = value->rValue;
- mod->BSIM3V2pubGiven = TRUE;
- break;
- case BSIM3V2_MOD_PUB1:
- mod->BSIM3V2pub1 = value->rValue;
- mod->BSIM3V2pub1Given = TRUE;
- break;
- case BSIM3V2_MOD_PUC:
- mod->BSIM3V2puc = value->rValue;
- mod->BSIM3V2pucGiven = TRUE;
- break;
- case BSIM3V2_MOD_PUC1:
- mod->BSIM3V2puc1 = value->rValue;
- mod->BSIM3V2puc1Given = TRUE;
- break;
- case BSIM3V2_MOD_PU0 :
- mod->BSIM3V2pu0 = value->rValue;
- mod->BSIM3V2pu0Given = TRUE;
- break;
- case BSIM3V2_MOD_PUTE :
- mod->BSIM3V2pute = value->rValue;
- mod->BSIM3V2puteGiven = TRUE;
- break;
- case BSIM3V2_MOD_PVOFF:
- mod->BSIM3V2pvoff = value->rValue;
- mod->BSIM3V2pvoffGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDELTA :
- mod->BSIM3V2pdelta = value->rValue;
- mod->BSIM3V2pdeltaGiven = TRUE;
- break;
- case BSIM3V2_MOD_PRDSW:
- mod->BSIM3V2prdsw = value->rValue;
- mod->BSIM3V2prdswGiven = TRUE;
- break;
- case BSIM3V2_MOD_PPRWB:
- mod->BSIM3V2pprwb = value->rValue;
- mod->BSIM3V2pprwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_PPRWG:
- mod->BSIM3V2pprwg = value->rValue;
- mod->BSIM3V2pprwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_PPRT:
- mod->BSIM3V2pprt = value->rValue;
- mod->BSIM3V2pprtGiven = TRUE;
- break;
- case BSIM3V2_MOD_PETA0:
- mod->BSIM3V2peta0 = value->rValue;
- mod->BSIM3V2peta0Given = TRUE;
- break;
- case BSIM3V2_MOD_PETAB:
- mod->BSIM3V2petab = value->rValue;
- mod->BSIM3V2petabGiven = TRUE;
- break;
- case BSIM3V2_MOD_PPCLM:
- mod->BSIM3V2ppclm = value->rValue;
- mod->BSIM3V2ppclmGiven = TRUE;
- break;
- case BSIM3V2_MOD_PPDIBL1:
- mod->BSIM3V2ppdibl1 = value->rValue;
- mod->BSIM3V2ppdibl1Given = TRUE;
- break;
- case BSIM3V2_MOD_PPDIBL2:
- mod->BSIM3V2ppdibl2 = value->rValue;
- mod->BSIM3V2ppdibl2Given = TRUE;
- break;
- case BSIM3V2_MOD_PPDIBLB:
- mod->BSIM3V2ppdiblb = value->rValue;
- mod->BSIM3V2ppdiblbGiven = TRUE;
- break;
- case BSIM3V2_MOD_PPSCBE1:
- mod->BSIM3V2ppscbe1 = value->rValue;
- mod->BSIM3V2ppscbe1Given = TRUE;
- break;
- case BSIM3V2_MOD_PPSCBE2:
- mod->BSIM3V2ppscbe2 = value->rValue;
- mod->BSIM3V2ppscbe2Given = TRUE;
- break;
- case BSIM3V2_MOD_PPVAG:
- mod->BSIM3V2ppvag = value->rValue;
- mod->BSIM3V2ppvagGiven = TRUE;
- break;
- case BSIM3V2_MOD_PWR :
- mod->BSIM3V2pwr = value->rValue;
- mod->BSIM3V2pwrGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDWG :
- mod->BSIM3V2pdwg = value->rValue;
- mod->BSIM3V2pdwgGiven = TRUE;
- break;
- case BSIM3V2_MOD_PDWB :
- mod->BSIM3V2pdwb = value->rValue;
- mod->BSIM3V2pdwbGiven = TRUE;
- break;
- case BSIM3V2_MOD_PB0 :
- mod->BSIM3V2pb0 = value->rValue;
- mod->BSIM3V2pb0Given = TRUE;
- break;
- case BSIM3V2_MOD_PB1 :
- mod->BSIM3V2pb1 = value->rValue;
- mod->BSIM3V2pb1Given = TRUE;
- break;
- case BSIM3V2_MOD_PALPHA0 :
- mod->BSIM3V2palpha0 = value->rValue;
- mod->BSIM3V2palpha0Given = TRUE;
- break;
- case BSIM3V2_MOD_PALPHA1 :
- mod->BSIM3V2palpha1 = value->rValue;
- mod->BSIM3V2palpha1Given = TRUE;
- break;
- case BSIM3V2_MOD_PBETA0 :
- mod->BSIM3V2pbeta0 = value->rValue;
- mod->BSIM3V2pbeta0Given = TRUE;
- break;
- case BSIM3V2_MOD_PVFB :
- mod->BSIM3V2pvfb = value->rValue;
- mod->BSIM3V2pvfbGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_PELM :
- mod->BSIM3V2pelm = value->rValue;
- mod->BSIM3V2pelmGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCGSL :
- mod->BSIM3V2pcgsl = value->rValue;
- mod->BSIM3V2pcgslGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCGDL :
- mod->BSIM3V2pcgdl = value->rValue;
- mod->BSIM3V2pcgdlGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCKAPPA :
- mod->BSIM3V2pckappa = value->rValue;
- mod->BSIM3V2pckappaGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCF :
- mod->BSIM3V2pcf = value->rValue;
- mod->BSIM3V2pcfGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCLC :
- mod->BSIM3V2pclc = value->rValue;
- mod->BSIM3V2pclcGiven = TRUE;
- break;
- case BSIM3V2_MOD_PCLE :
- mod->BSIM3V2pcle = value->rValue;
- mod->BSIM3V2pcleGiven = TRUE;
- break;
- case BSIM3V2_MOD_PVFBCV :
- mod->BSIM3V2pvfbcv = value->rValue;
- mod->BSIM3V2pvfbcvGiven = TRUE;
- break;
- case BSIM3V2_MOD_PACDE :
- mod->BSIM3V2pacde = value->rValue;
- mod->BSIM3V2pacdeGiven = TRUE;
- break;
- case BSIM3V2_MOD_PMOIN :
- mod->BSIM3V2pmoin = value->rValue;
- mod->BSIM3V2pmoinGiven = TRUE;
- break;
- case BSIM3V2_MOD_PNOFF :
- mod->BSIM3V2pnoff = value->rValue;
- mod->BSIM3V2pnoffGiven = TRUE;
- break;
- case BSIM3V2_MOD_PVOFFCV :
- mod->BSIM3V2pvoffcv = value->rValue;
- mod->BSIM3V2pvoffcvGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_TNOM :
- mod->BSIM3V2tnom = value->rValue + 273.15;
- mod->BSIM3V2tnomGiven = TRUE;
- break;
- case BSIM3V2_MOD_CGSO :
- mod->BSIM3V2cgso = value->rValue;
- mod->BSIM3V2cgsoGiven = TRUE;
- break;
- case BSIM3V2_MOD_CGDO :
- mod->BSIM3V2cgdo = value->rValue;
- mod->BSIM3V2cgdoGiven = TRUE;
- break;
- case BSIM3V2_MOD_CGBO :
- mod->BSIM3V2cgbo = value->rValue;
- mod->BSIM3V2cgboGiven = TRUE;
- break;
- case BSIM3V2_MOD_XPART :
- mod->BSIM3V2xpart = value->rValue;
- mod->BSIM3V2xpartGiven = TRUE;
- break;
- case BSIM3V2_MOD_RSH :
- mod->BSIM3V2sheetResistance = value->rValue;
- mod->BSIM3V2sheetResistanceGiven = TRUE;
- break;
- case BSIM3V2_MOD_JS :
- mod->BSIM3V2jctSatCurDensity = value->rValue;
- mod->BSIM3V2jctSatCurDensityGiven = TRUE;
- break;
- case BSIM3V2_MOD_JSW :
- mod->BSIM3V2jctSidewallSatCurDensity = value->rValue;
- mod->BSIM3V2jctSidewallSatCurDensityGiven = TRUE;
- break;
- case BSIM3V2_MOD_PB :
- mod->BSIM3V2bulkJctPotential = value->rValue;
- mod->BSIM3V2bulkJctPotentialGiven = TRUE;
- break;
- case BSIM3V2_MOD_MJ :
- mod->BSIM3V2bulkJctBotGradingCoeff = value->rValue;
- mod->BSIM3V2bulkJctBotGradingCoeffGiven = TRUE;
- break;
- case BSIM3V2_MOD_PBSW :
- mod->BSIM3V2sidewallJctPotential = value->rValue;
- mod->BSIM3V2sidewallJctPotentialGiven = TRUE;
- break;
- case BSIM3V2_MOD_MJSW :
- mod->BSIM3V2bulkJctSideGradingCoeff = value->rValue;
- mod->BSIM3V2bulkJctSideGradingCoeffGiven = TRUE;
- break;
- case BSIM3V2_MOD_CJ :
- mod->BSIM3V2unitAreaJctCap = value->rValue;
- mod->BSIM3V2unitAreaJctCapGiven = TRUE;
- break;
- case BSIM3V2_MOD_CJSW :
- mod->BSIM3V2unitLengthSidewallJctCap = value->rValue;
- mod->BSIM3V2unitLengthSidewallJctCapGiven = TRUE;
- break;
- case BSIM3V2_MOD_NJ :
- mod->BSIM3V2jctEmissionCoeff = value->rValue;
- mod->BSIM3V2jctEmissionCoeffGiven = TRUE;
- break;
- case BSIM3V2_MOD_PBSWG :
- mod->BSIM3V2GatesidewallJctPotential = value->rValue;
- mod->BSIM3V2GatesidewallJctPotentialGiven = TRUE;
- break;
- case BSIM3V2_MOD_MJSWG :
- mod->BSIM3V2bulkJctGateSideGradingCoeff = value->rValue;
- mod->BSIM3V2bulkJctGateSideGradingCoeffGiven = TRUE;
- break;
- case BSIM3V2_MOD_CJSWG :
- mod->BSIM3V2unitLengthGateSidewallJctCap = value->rValue;
- mod->BSIM3V2unitLengthGateSidewallJctCapGiven = TRUE;
- break;
- case BSIM3V2_MOD_XTI :
- mod->BSIM3V2jctTempExponent = value->rValue;
- mod->BSIM3V2jctTempExponentGiven = TRUE;
- break;
- case BSIM3V2_MOD_LINT :
- mod->BSIM3V2Lint = value->rValue;
- mod->BSIM3V2LintGiven = TRUE;
- break;
- case BSIM3V2_MOD_LL :
- mod->BSIM3V2Ll = value->rValue;
- mod->BSIM3V2LlGiven = TRUE;
- break;
- case BSIM3V2_MOD_LLC :
- mod->BSIM3V2Llc = value->rValue;
- mod->BSIM3V2LlcGiven = TRUE;
- break;
- case BSIM3V2_MOD_LLN :
- mod->BSIM3V2Lln = value->rValue;
- mod->BSIM3V2LlnGiven = TRUE;
- break;
- case BSIM3V2_MOD_LW :
- mod->BSIM3V2Lw = value->rValue;
- mod->BSIM3V2LwGiven = TRUE;
- break;
- case BSIM3V2_MOD_LWC :
- mod->BSIM3V2Lwc = value->rValue;
- mod->BSIM3V2LwcGiven = TRUE;
- break;
- case BSIM3V2_MOD_LWN :
- mod->BSIM3V2Lwn = value->rValue;
- mod->BSIM3V2LwnGiven = TRUE;
- break;
- case BSIM3V2_MOD_LWL :
- mod->BSIM3V2Lwl = value->rValue;
- mod->BSIM3V2LwlGiven = TRUE;
- break;
- case BSIM3V2_MOD_LWLC :
- mod->BSIM3V2Lwlc = value->rValue;
- mod->BSIM3V2LwlcGiven = TRUE;
- break;
- case BSIM3V2_MOD_LMIN :
- mod->BSIM3V2Lmin = value->rValue;
- mod->BSIM3V2LminGiven = TRUE;
- break;
- case BSIM3V2_MOD_LMAX :
- mod->BSIM3V2Lmax = value->rValue;
- mod->BSIM3V2LmaxGiven = TRUE;
- break;
- case BSIM3V2_MOD_WINT :
- mod->BSIM3V2Wint = value->rValue;
- mod->BSIM3V2WintGiven = TRUE;
- break;
- case BSIM3V2_MOD_WL :
- mod->BSIM3V2Wl = value->rValue;
- mod->BSIM3V2WlGiven = TRUE;
- break;
- case BSIM3V2_MOD_WLC :
- mod->BSIM3V2Wlc = value->rValue;
- mod->BSIM3V2WlcGiven = TRUE;
- break;
- case BSIM3V2_MOD_WLN :
- mod->BSIM3V2Wln = value->rValue;
- mod->BSIM3V2WlnGiven = TRUE;
- break;
- case BSIM3V2_MOD_WW :
- mod->BSIM3V2Ww = value->rValue;
- mod->BSIM3V2WwGiven = TRUE;
- break;
- case BSIM3V2_MOD_WWC :
- mod->BSIM3V2Wwc = value->rValue;
- mod->BSIM3V2WwcGiven = TRUE;
- break;
- case BSIM3V2_MOD_WWN :
- mod->BSIM3V2Wwn = value->rValue;
- mod->BSIM3V2WwnGiven = TRUE;
- break;
- case BSIM3V2_MOD_WWL :
- mod->BSIM3V2Wwl = value->rValue;
- mod->BSIM3V2WwlGiven = TRUE;
- break;
- case BSIM3V2_MOD_WWLC :
- mod->BSIM3V2Wwlc = value->rValue;
- mod->BSIM3V2WwlcGiven = TRUE;
- break;
- case BSIM3V2_MOD_WMIN :
- mod->BSIM3V2Wmin = value->rValue;
- mod->BSIM3V2WminGiven = TRUE;
- break;
- case BSIM3V2_MOD_WMAX :
- mod->BSIM3V2Wmax = value->rValue;
- mod->BSIM3V2WmaxGiven = TRUE;
- break;
-
- case BSIM3V2_MOD_NOIA :
- mod->BSIM3V2oxideTrapDensityA = value->rValue;
- mod->BSIM3V2oxideTrapDensityAGiven = TRUE;
- break;
- case BSIM3V2_MOD_NOIB :
- mod->BSIM3V2oxideTrapDensityB = value->rValue;
- mod->BSIM3V2oxideTrapDensityBGiven = TRUE;
- break;
- case BSIM3V2_MOD_NOIC :
- mod->BSIM3V2oxideTrapDensityC = value->rValue;
- mod->BSIM3V2oxideTrapDensityCGiven = TRUE;
- break;
- case BSIM3V2_MOD_EM :
- mod->BSIM3V2em = value->rValue;
- mod->BSIM3V2emGiven = TRUE;
- break;
- case BSIM3V2_MOD_EF :
- mod->BSIM3V2ef = value->rValue;
- mod->BSIM3V2efGiven = TRUE;
- break;
- case BSIM3V2_MOD_AF :
- mod->BSIM3V2af = value->rValue;
- mod->BSIM3V2afGiven = TRUE;
- break;
- case BSIM3V2_MOD_KF :
- mod->BSIM3V2kf = value->rValue;
- mod->BSIM3V2kfGiven = TRUE;
- break;
- case BSIM3V2_MOD_NMOS :
- if(value->iValue) {
- mod->BSIM3V2type = 1;
- mod->BSIM3V2typeGiven = TRUE;
- }
- break;
- case BSIM3V2_MOD_PMOS :
- if(value->iValue) {
- mod->BSIM3V2type = - 1;
- mod->BSIM3V2typeGiven = TRUE;
- }
- break;
- default:
- return(E_BADPARM);
- }
- return(OK);
-}
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2noi.c b/src/spicelib/devices/bsim3v2/b3v2noi.c
deleted file mode 100644
index 654ef6508..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2noi.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Gary W. Ng and Min-Chie Jeng.
-File: b3v2noi.c
-**********/
-
-#include "ngspice.h"
-#include
-#include
-#include "bsim3v2def.h"
-#include "cktdefs.h"
-#include "iferrmsg.h"
-#include "noisedef.h"
-#include "suffix.h"
-#include "const.h" /* jwan */
-
-/*
- * BSIM3V2noise (mode, operation, firstModel, ckt, data, OnDens)
- * This routine names and evaluates all of the noise sources
- * associated with MOSFET's. It starts with the model *firstModel and
- * traverses all of its insts. It then proceeds to any other models
- * on the linked list. The total output noise density generated by
- * all of the MOSFET's is summed with the variable "OnDens".
- */
-
-/*
- Channel thermal and flicker noises are calculated based on the value
- of model->BSIM3V2noiMod.
- If model->BSIM3V2noiMod = 1,
- Channel thermal noise = SPICE2 model
- Flicker noise = SPICE2 model
- If model->BSIM3V2noiMod = 2,
- Channel thermal noise = BSIM3V2 model
- Flicker noise = BSIM3V2 model
- If model->BSIM3V2noiMod = 3,
- Channel thermal noise = SPICE2 model
- Flicker noise = BSIM3V2 model
- If model->BSIM3V2noiMod = 4,
- Channel thermal noise = BSIM3V2 model
- Flicker noise = SPICE2 model
- */
-
-extern void NevalSrc();
-extern double Nintegrate();
-
-double
-BSIM3V2StrongInversionNoiseEval(vgs, vds, model, here, freq, temp)
-double vgs, vds, freq, temp;
-BSIM3V2model *model;
-BSIM3V2instance *here;
-{
-struct BSIM3V2SizeDependParam *pParam;
-double cd, esat, DelClm, EffFreq, N0, Nl, Vgst;
-double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Ssi;
-
- pParam = here->pParam;
- cd = fabs(here->BSIM3V2cd);
- if (vds > here->BSIM3V2vdsat)
- { esat = 2.0 * pParam->BSIM3V2vsattemp / here->BSIM3V2ueff;
- T0 = ((((vds - here->BSIM3V2vdsat) / pParam->BSIM3V2litl) + model->BSIM3V2em)
- / esat);
- DelClm = pParam->BSIM3V2litl * log (MAX(T0, N_MINLOG));
- }
- else
- DelClm = 0.0;
- EffFreq = pow(freq, model->BSIM3V2ef);
- T1 = CHARGE * CHARGE * 8.62e-5 * cd * temp * here->BSIM3V2ueff;
- T2 = 1.0e8 * EffFreq * model->BSIM3V2cox
- * pParam->BSIM3V2leff * pParam->BSIM3V2leff;
- Vgst = vgs - here->BSIM3V2von;
- N0 = model->BSIM3V2cox * Vgst / CHARGE;
- if (N0 < 0.0)
- N0 = 0.0;
- Nl = model->BSIM3V2cox * (Vgst - MIN(vds, here->BSIM3V2vdsat)) / CHARGE;
- if (Nl < 0.0)
- Nl = 0.0;
-
- T3 = model->BSIM3V2oxideTrapDensityA
- * log(MAX(((N0 + 2.0e14) / (Nl + 2.0e14)), N_MINLOG));
- T4 = model->BSIM3V2oxideTrapDensityB * (N0 - Nl);
- T5 = model->BSIM3V2oxideTrapDensityC * 0.5 * (N0 * N0 - Nl * Nl);
-
- T6 = 8.62e-5 * temp * cd * cd;
- T7 = 1.0e8 * EffFreq * pParam->BSIM3V2leff
- * pParam->BSIM3V2leff * pParam->BSIM3V2weff;
- T8 = model->BSIM3V2oxideTrapDensityA + model->BSIM3V2oxideTrapDensityB * Nl
- + model->BSIM3V2oxideTrapDensityC * Nl * Nl;
- T9 = (Nl + 2.0e14) * (Nl + 2.0e14);
-
- Ssi = T1 / T2 * (T3 + T4 + T5) + T6 / T7 * DelClm * T8 / T9;
- return Ssi;
-}
-
-int
-BSIM3V2noise (mode, operation, inModel, ckt, data, OnDens)
-int mode, operation;
-GENmodel *inModel;
-CKTcircuit *ckt;
-Ndata *data;
-double *OnDens;
-{
-BSIM3V2model *model = (BSIM3V2model *)inModel;
-BSIM3V2instance *here;
-struct BSIM3V2SizeDependParam *pParam;
-char name[N_MXVLNTH];
-double tempOnoise;
-double tempInoise;
-double noizDens[BSIM3V2NSRCS];
-double lnNdens[BSIM3V2NSRCS];
-
-double vgs, vds, Slimit;
-double N0, Nl;
-double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13;
-double n, ExpArg, Ssi, Swi;
-
-int error, i;
-
- /* define the names of the noise sources */
- static char *BSIM3V2nNames[BSIM3V2NSRCS] =
- { /* Note that we have to keep the order */
- ".rd", /* noise due to rd */
- /* consistent with the index definitions */
- ".rs", /* noise due to rs */
- /* in BSIM3V2defs.h */
- ".id", /* noise due to id */
- ".1overf", /* flicker (1/f) noise */
- "" /* total transistor noise */
- };
-
- for (; model != NULL; model = model->BSIM3V2nextModel)
- { for (here = model->BSIM3V2instances; here != NULL;
- here = here->BSIM3V2nextInstance)
- { pParam = here->pParam;
- switch (operation)
- { case N_OPEN:
- /* see if we have to to produce a summary report */
- /* if so, name all the noise generators */
-
- if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0)
- { switch (mode)
- { case N_DENS:
- for (i = 0; i < BSIM3V2NSRCS; i++)
- { (void) sprintf(name, "onoise.%s%s",
- here->BSIM3V2name,
- BSIM3V2nNames[i]);
- data->namelist = (IFuid *) trealloc(
- (char *) data->namelist,
- (data->numPlots + 1)
- * sizeof(IFuid));
- if (!data->namelist)
- return(E_NOMEM);
- (*(SPfrontEnd->IFnewUid)) (ckt,
- &(data->namelist[data->numPlots++]),
- (IFuid) NULL, name, UID_OTHER,
- (void **) NULL);
- /* we've added one more plot */
- }
- break;
- case INT_NOIZ:
- for (i = 0; i < BSIM3V2NSRCS; i++)
- { (void) sprintf(name, "onoise_total.%s%s",
- here->BSIM3V2name,
- BSIM3V2nNames[i]);
- data->namelist = (IFuid *) trealloc(
- (char *) data->namelist,
- (data->numPlots + 1)
- * sizeof(IFuid));
- if (!data->namelist)
- return(E_NOMEM);
- (*(SPfrontEnd->IFnewUid)) (ckt,
- &(data->namelist[data->numPlots++]),
- (IFuid) NULL, name, UID_OTHER,
- (void **) NULL);
- /* we've added one more plot */
-
- (void) sprintf(name, "inoise_total.%s%s",
- here->BSIM3V2name,
- BSIM3V2nNames[i]);
- data->namelist = (IFuid *) trealloc(
- (char *) data->namelist,
- (data->numPlots + 1)
- * sizeof(IFuid));
- if (!data->namelist)
- return(E_NOMEM);
- (*(SPfrontEnd->IFnewUid)) (ckt,
- &(data->namelist[data->numPlots++]),
- (IFuid) NULL, name, UID_OTHER,
- (void **)NULL);
- /* we've added one more plot */
- }
- break;
- }
- }
- break;
- case N_CALC:
- switch (mode)
- { case N_DENS:
- NevalSrc(&noizDens[BSIM3V2RDNOIZ],
- &lnNdens[BSIM3V2RDNOIZ], ckt, THERMNOISE,
- here->BSIM3V2dNodePrime, here->BSIM3V2dNode,
- here->BSIM3V2drainConductance);
-
- NevalSrc(&noizDens[BSIM3V2RSNOIZ],
- &lnNdens[BSIM3V2RSNOIZ], ckt, THERMNOISE,
- here->BSIM3V2sNodePrime, here->BSIM3V2sNode,
- here->BSIM3V2sourceConductance);
-
- switch( model->BSIM3V2noiMod )
- { case 1:
- case 3:
- NevalSrc(&noizDens[BSIM3V2IDNOIZ],
- &lnNdens[BSIM3V2IDNOIZ], ckt,
- THERMNOISE, here->BSIM3V2dNodePrime,
- here->BSIM3V2sNodePrime,
- (2.0 / 3.0 * fabs(here->BSIM3V2gm
- + here->BSIM3V2gds
- + here->BSIM3V2gmbs)));
- break;
- case 2:
- case 4:
- NevalSrc(&noizDens[BSIM3V2IDNOIZ],
- &lnNdens[BSIM3V2IDNOIZ], ckt,
- THERMNOISE, here->BSIM3V2dNodePrime,
- here->BSIM3V2sNodePrime,
- (here->BSIM3V2ueff
- * fabs(here->BSIM3V2qinv
- / (pParam->BSIM3V2leff
- * pParam->BSIM3V2leff))));
- break;
- }
- NevalSrc(&noizDens[BSIM3V2FLNOIZ], (double*) NULL,
- ckt, N_GAIN, here->BSIM3V2dNodePrime,
- here->BSIM3V2sNodePrime, (double) 0.0);
-
- switch( model->BSIM3V2noiMod )
- { case 1:
- case 4:
- noizDens[BSIM3V2FLNOIZ] *= model->BSIM3V2kf
- * exp(model->BSIM3V2af
- * log(MAX(fabs(here->BSIM3V2cd),
- N_MINLOG)))
- / (pow(data->freq, model->BSIM3V2ef)
- * pParam->BSIM3V2leff
- * pParam->BSIM3V2leff
- * model->BSIM3V2cox);
- break;
- case 2:
- case 3:
- vgs = *(ckt->CKTstates[0] + here->BSIM3V2vgs);
- vds = *(ckt->CKTstates[0] + here->BSIM3V2vds);
- if (vds < 0.0)
- { vds = -vds;
- vgs = vgs + vds;
- }
- if (vgs >= here->BSIM3V2von + 0.1)
- { Ssi = BSIM3V2StrongInversionNoiseEval(vgs,
- vds, model, here, data->freq,
- ckt->CKTtemp);
- noizDens[BSIM3V2FLNOIZ] *= Ssi;
- }
- else
- { pParam = here->pParam;
- T10 = model->BSIM3V2oxideTrapDensityA
- * 8.62e-5 * ckt->CKTtemp;
- T11 = pParam->BSIM3V2weff
- * pParam->BSIM3V2leff
- * pow(data->freq, model->BSIM3V2ef)
- * 4.0e36;
- Swi = T10 / T11 * here->BSIM3V2cd
- * here->BSIM3V2cd;
- Slimit = BSIM3V2StrongInversionNoiseEval(
- here->BSIM3V2von + 0.1, vds, model,
- here, data->freq, ckt->CKTtemp);
- T1 = Swi + Slimit;
- if (T1 > 0.0)
- noizDens[BSIM3V2FLNOIZ] *= (Slimit
- * Swi) / T1;
- else
- noizDens[BSIM3V2FLNOIZ] *= 0.0;
- }
- break;
- }
-
- lnNdens[BSIM3V2FLNOIZ] =
- log(MAX(noizDens[BSIM3V2FLNOIZ], N_MINLOG));
-
- noizDens[BSIM3V2TOTNOIZ] = noizDens[BSIM3V2RDNOIZ]
- + noizDens[BSIM3V2RSNOIZ]
- + noizDens[BSIM3V2IDNOIZ]
- + noizDens[BSIM3V2FLNOIZ];
- lnNdens[BSIM3V2TOTNOIZ] =
- log(MAX(noizDens[BSIM3V2TOTNOIZ], N_MINLOG));
-
- *OnDens += noizDens[BSIM3V2TOTNOIZ];
-
- if (data->delFreq == 0.0)
- { /* if we haven't done any previous
- integration, we need to initialize our
- "history" variables.
- */
-
- for (i = 0; i < BSIM3V2NSRCS; i++)
- { here->BSIM3V2nVar[LNLSTDENS][i] =
- lnNdens[i];
- }
-
- /* clear out our integration variables
- if it's the first pass
- */
- if (data->freq ==
- ((NOISEAN*) ckt->CKTcurJob)->NstartFreq)
- { for (i = 0; i < BSIM3V2NSRCS; i++)
- { here->BSIM3V2nVar[OUTNOIZ][i] = 0.0;
- here->BSIM3V2nVar[INNOIZ][i] = 0.0;
- }
- }
- }
- else
- { /* data->delFreq != 0.0,
- we have to integrate.
- */
- for (i = 0; i < BSIM3V2NSRCS; i++)
- { if (i != BSIM3V2TOTNOIZ)
- { tempOnoise = Nintegrate(noizDens[i],
- lnNdens[i],
- here->BSIM3V2nVar[LNLSTDENS][i],
- data);
- tempInoise = Nintegrate(noizDens[i]
- * data->GainSqInv, lnNdens[i]
- + data->lnGainInv,
- here->BSIM3V2nVar[LNLSTDENS][i]
- + data->lnGainInv, data);
- here->BSIM3V2nVar[LNLSTDENS][i] =
- lnNdens[i];
- data->outNoiz += tempOnoise;
- data->inNoise += tempInoise;
- if (((NOISEAN*)
- ckt->CKTcurJob)->NStpsSm != 0)
- { here->BSIM3V2nVar[OUTNOIZ][i]
- += tempOnoise;
- here->BSIM3V2nVar[OUTNOIZ][BSIM3V2TOTNOIZ]
- += tempOnoise;
- here->BSIM3V2nVar[INNOIZ][i]
- += tempInoise;
- here->BSIM3V2nVar[INNOIZ][BSIM3V2TOTNOIZ]
- += tempInoise;
- }
- }
- }
- }
- if (data->prtSummary)
- { for (i = 0; i < BSIM3V2NSRCS; i++)
- { /* print a summary report */
- data->outpVector[data->outNumber++]
- = noizDens[i];
- }
- }
- break;
- case INT_NOIZ:
- /* already calculated, just output */
- if (((NOISEAN*)ckt->CKTcurJob)->NStpsSm != 0)
- { for (i = 0; i < BSIM3V2NSRCS; i++)
- { data->outpVector[data->outNumber++]
- = here->BSIM3V2nVar[OUTNOIZ][i];
- data->outpVector[data->outNumber++]
- = here->BSIM3V2nVar[INNOIZ][i];
- }
- }
- break;
- }
- break;
- case N_CLOSE:
- /* do nothing, the main calling routine will close */
- return (OK);
- break; /* the plots */
- } /* switch (operation) */
- } /* for here */
- } /* for model */
-
- return(OK);
-}
-
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2par.c b/src/spicelib/devices/bsim3v2/b3v2par.c
deleted file mode 100644
index 2cc48b1b2..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2par.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2par.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "ifsim.h"
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "suffix.h"
-
-int
-BSIM3V2param(param,value,inst,select)
-int param;
-IFvalue *value;
-GENinstance *inst;
-IFvalue *select;
-{
- BSIM3V2instance *here = (BSIM3V2instance*)inst;
- switch(param)
- { case BSIM3V2_W:
- here->BSIM3V2w = value->rValue;
- here->BSIM3V2wGiven = TRUE;
- break;
- case BSIM3V2_L:
- here->BSIM3V2l = value->rValue;
- here->BSIM3V2lGiven = TRUE;
- break;
- case BSIM3V2_AS:
- here->BSIM3V2sourceArea = value->rValue;
- here->BSIM3V2sourceAreaGiven = TRUE;
- break;
- case BSIM3V2_AD:
- here->BSIM3V2drainArea = value->rValue;
- here->BSIM3V2drainAreaGiven = TRUE;
- break;
- case BSIM3V2_PS:
- here->BSIM3V2sourcePerimeter = value->rValue;
- here->BSIM3V2sourcePerimeterGiven = TRUE;
- break;
- case BSIM3V2_PD:
- here->BSIM3V2drainPerimeter = value->rValue;
- here->BSIM3V2drainPerimeterGiven = TRUE;
- break;
- case BSIM3V2_NRS:
- here->BSIM3V2sourceSquares = value->rValue;
- here->BSIM3V2sourceSquaresGiven = TRUE;
- break;
- case BSIM3V2_NRD:
- here->BSIM3V2drainSquares = value->rValue;
- here->BSIM3V2drainSquaresGiven = TRUE;
- break;
- case BSIM3V2_OFF:
- here->BSIM3V2off = value->iValue;
- break;
- case BSIM3V2_IC_VBS:
- here->BSIM3V2icVBS = value->rValue;
- here->BSIM3V2icVBSGiven = TRUE;
- break;
- case BSIM3V2_IC_VDS:
- here->BSIM3V2icVDS = value->rValue;
- here->BSIM3V2icVDSGiven = TRUE;
- break;
- case BSIM3V2_IC_VGS:
- here->BSIM3V2icVGS = value->rValue;
- here->BSIM3V2icVGSGiven = TRUE;
- break;
- case BSIM3V2_NQSMOD:
- here->BSIM3V2nqsMod = value->iValue;
- here->BSIM3V2nqsModGiven = TRUE;
- break;
- case BSIM3V2_IC:
- switch(value->v.numValue){
- case 3:
- here->BSIM3V2icVBS = *(value->v.vec.rVec+2);
- here->BSIM3V2icVBSGiven = TRUE;
- case 2:
- here->BSIM3V2icVGS = *(value->v.vec.rVec+1);
- here->BSIM3V2icVGSGiven = TRUE;
- case 1:
- here->BSIM3V2icVDS = *(value->v.vec.rVec);
- here->BSIM3V2icVDSGiven = TRUE;
- break;
- default:
- return(E_BADPARM);
- }
- break;
- default:
- return(E_BADPARM);
- }
- return(OK);
-}
-
-
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2pzld.c b/src/spicelib/devices/bsim3v2/b3v2pzld.c
deleted file mode 100644
index fd4cc04c7..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2pzld.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: b3v2pzld.c
-**********/
-
-#include "ngspice.h"
-#include
-#include "cktdefs.h"
-#include "complex.h"
-#include "sperror.h"
-#include "bsim3v2def.h"
-#include "suffix.h"
-
-int
-BSIM3V2pzLoad(inModel,ckt,s)
-GENmodel *inModel;
-CKTcircuit *ckt;
-SPcomplex *s;
-{
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance *here;
-double xcggb, xcgdb, xcgsb, xcgbb, xcbgb, xcbdb, xcbsb, xcbbb;
-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, 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, Cdb, Csg, Csd, Css, Csb;
-
- for (; model != NULL; model = model->BSIM3V2nextModel)
- { for (here = model->BSIM3V2instances; here!= NULL;
- here = here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2owner != ARCHme) continue;
- if (here->BSIM3V2mode >= 0)
- { Gm = here->BSIM3V2gm;
- Gmbs = here->BSIM3V2gmbs;
- FwdSum = Gm + Gmbs;
- RevSum = 0.0;
-
- gbbdp = -here->BSIM3V2gbds;
- gbbsp = here->BSIM3V2gbds + here->BSIM3V2gbgs + here->BSIM3V2gbbs;
-
- gbdpg = here->BSIM3V2gbgs;
- gbdpdp = here->BSIM3V2gbds;
- gbdpb = here->BSIM3V2gbbs;
- gbdpsp = -(gbdpg + gbdpdp + gbdpb);
-
- gbspg = 0.0;
- gbspdp = 0.0;
- gbspb = 0.0;
- gbspsp = 0.0;
-
- if (here->BSIM3V2nqsMod == 0)
- { cggb = here->BSIM3V2cggb;
- cgsb = here->BSIM3V2cgsb;
- cgdb = here->BSIM3V2cgdb;
-
- cbgb = here->BSIM3V2cbgb;
- cbsb = here->BSIM3V2cbsb;
- cbdb = here->BSIM3V2cbdb;
-
- cdgb = here->BSIM3V2cdgb;
- cdsb = here->BSIM3V2cdsb;
- cddb = here->BSIM3V2cddb;
-
- xgtg = xgtd = xgts = xgtb = 0.0;
- sxpart = 0.6;
- dxpart = 0.4;
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb
- = ddxpart_dVs = 0.0;
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb
- = dsxpart_dVs = 0.0;
- }
- else
- { cggb = cgdb = cgsb = 0.0;
- cbgb = cbdb = cbsb = 0.0;
- cdgb = cddb = cdsb = 0.0;
-
- xgtg = here->BSIM3V2gtg;
- xgtd = here->BSIM3V2gtd;
- xgts = here->BSIM3V2gts;
- xgtb = here->BSIM3V2gtb;
-
- xcqgb = here->BSIM3V2cqgb;
- xcqdb = here->BSIM3V2cqdb;
- xcqsb = here->BSIM3V2cqsb;
- xcqbb = here->BSIM3V2cqbb;
-
- CoxWL = model->BSIM3V2cox * here->pParam->BSIM3V2weffCV
- * here->pParam->BSIM3V2leffCV;
- qcheq = -(here->BSIM3V2qgate + here->BSIM3V2qbulk);
- if (fabs(qcheq) <= 1.0e-5 * CoxWL)
- { if (model->BSIM3V2xpart < 0.5)
- { dxpart = 0.4;
- }
- else if (model->BSIM3V2xpart > 0.5)
- { dxpart = 0.0;
- }
- else
- { dxpart = 0.5;
- }
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb
- = ddxpart_dVs = 0.0;
- }
- else
- { dxpart = here->BSIM3V2qdrn / qcheq;
- Cdd = here->BSIM3V2cddb;
- Csd = -(here->BSIM3V2cgdb + here->BSIM3V2cddb
- + here->BSIM3V2cbdb);
- ddxpart_dVd = (Cdd - dxpart * (Cdd + Csd)) / qcheq;
- Cdg = here->BSIM3V2cdgb;
- Csg = -(here->BSIM3V2cggb + here->BSIM3V2cdgb
- + here->BSIM3V2cbgb);
- ddxpart_dVg = (Cdg - dxpart * (Cdg + Csg)) / qcheq;
-
- Cds = here->BSIM3V2cdsb;
- Css = -(here->BSIM3V2cgsb + here->BSIM3V2cdsb
- + here->BSIM3V2cbsb);
- ddxpart_dVs = (Cds - dxpart * (Cds + Css)) / qcheq;
-
- ddxpart_dVb = -(ddxpart_dVd + ddxpart_dVg
- + ddxpart_dVs);
- }
- sxpart = 1.0 - dxpart;
- dsxpart_dVd = -ddxpart_dVd;
- dsxpart_dVg = -ddxpart_dVg;
- dsxpart_dVs = -ddxpart_dVs;
- dsxpart_dVb = -(dsxpart_dVd + dsxpart_dVg + dsxpart_dVs);
- }
- }
- else
- { Gm = -here->BSIM3V2gm;
- Gmbs = -here->BSIM3V2gmbs;
- FwdSum = 0.0;
- RevSum = -(Gm + Gmbs);
-
- gbbsp = -here->BSIM3V2gbds;
- gbbdp = here->BSIM3V2gbds + here->BSIM3V2gbgs + here->BSIM3V2gbbs;
-
- gbdpg = 0.0;
- gbdpsp = 0.0;
- gbdpb = 0.0;
- gbdpdp = 0.0;
-
- gbspg = here->BSIM3V2gbgs;
- gbspsp = here->BSIM3V2gbds;
- gbspb = here->BSIM3V2gbbs;
- gbspdp = -(gbspg + gbspsp + gbspb);
-
- if (here->BSIM3V2nqsMod == 0)
- { cggb = here->BSIM3V2cggb;
- cgsb = here->BSIM3V2cgdb;
- cgdb = here->BSIM3V2cgsb;
-
- cbgb = here->BSIM3V2cbgb;
- cbsb = here->BSIM3V2cbdb;
- cbdb = here->BSIM3V2cbsb;
-
- cdgb = -(here->BSIM3V2cdgb + cggb + cbgb);
- cdsb = -(here->BSIM3V2cddb + cgsb + cbsb);
- cddb = -(here->BSIM3V2cdsb + cgdb + cbdb);
-
- xgtg = xgtd = xgts = xgtb = 0.0;
- sxpart = 0.4;
- dxpart = 0.6;
- ddxpart_dVd = ddxpart_dVg = ddxpart_dVb
- = ddxpart_dVs = 0.0;
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb
- = dsxpart_dVs = 0.0;
- }
- else
- { cggb = cgdb = cgsb = 0.0;
- cbgb = cbdb = cbsb = 0.0;
- cdgb = cddb = cdsb = 0.0;
-
- xgtg = here->BSIM3V2gtg;
- xgtd = here->BSIM3V2gts;
- xgts = here->BSIM3V2gtd;
- xgtb = here->BSIM3V2gtb;
-
- xcqgb = here->BSIM3V2cqgb;
- xcqdb = here->BSIM3V2cqsb;
- xcqsb = here->BSIM3V2cqdb;
- xcqbb = here->BSIM3V2cqbb;
-
- CoxWL = model->BSIM3V2cox * here->pParam->BSIM3V2weffCV
- * here->pParam->BSIM3V2leffCV;
- qcheq = -(here->BSIM3V2qgate + here->BSIM3V2qbulk);
- if (fabs(qcheq) <= 1.0e-5 * CoxWL)
- { if (model->BSIM3V2xpart < 0.5)
- { sxpart = 0.4;
- }
- else if (model->BSIM3V2xpart > 0.5)
- { sxpart = 0.0;
- }
- else
- { sxpart = 0.5;
- }
- dsxpart_dVd = dsxpart_dVg = dsxpart_dVb
- = dsxpart_dVs = 0.0;
- }
- else
- { sxpart = here->BSIM3V2qdrn / qcheq;
- Css = here->BSIM3V2cddb;
- Cds = -(here->BSIM3V2cgdb + here->BSIM3V2cddb
- + here->BSIM3V2cbdb);
- dsxpart_dVs = (Css - sxpart * (Css + Cds)) / qcheq;
- Csg = here->BSIM3V2cdgb;
- Cdg = -(here->BSIM3V2cggb + here->BSIM3V2cdgb
- + here->BSIM3V2cbgb);
- dsxpart_dVg = (Csg - sxpart * (Csg + Cdg)) / qcheq;
-
- Csd = here->BSIM3V2cdsb;
- Cdd = -(here->BSIM3V2cgsb + here->BSIM3V2cdsb
- + here->BSIM3V2cbsb);
- dsxpart_dVd = (Csd - sxpart * (Csd + Cdd)) / qcheq;
-
- dsxpart_dVb = -(dsxpart_dVd + dsxpart_dVg
- + dsxpart_dVs);
- }
- dxpart = 1.0 - sxpart;
- ddxpart_dVd = -dsxpart_dVd;
- ddxpart_dVg = -dsxpart_dVg;
- ddxpart_dVs = -dsxpart_dVs;
- ddxpart_dVb = -(ddxpart_dVd + ddxpart_dVg + ddxpart_dVs);
- }
- }
-
-
- T1 = *(ckt->CKTstate0 + here->BSIM3V2qdef) * here->BSIM3V2gtau;
- gdpr = here->BSIM3V2drainConductance;
- gspr = here->BSIM3V2sourceConductance;
- gds = here->BSIM3V2gds;
- gbd = here->BSIM3V2gbd;
- gbs = here->BSIM3V2gbs;
- capbd = here->BSIM3V2capbd;
- capbs = here->BSIM3V2capbs;
-
- GSoverlapCap = here->BSIM3V2cgso;
- GDoverlapCap = here->BSIM3V2cgdo;
- GBoverlapCap = here->pParam->BSIM3V2cgbo;
-
- xcdgb = (cdgb - GDoverlapCap);
- xcddb = (cddb + capbd + GDoverlapCap);
- xcdsb = cdsb;
- xcdbb = -(xcdgb + xcddb + xcdsb);
- xcsgb = -(cggb + cbgb + cdgb + GSoverlapCap);
- xcsdb = -(cgdb + cbdb + cddb);
- xcssb = (capbs + GSoverlapCap - (cgsb + cbsb + cdsb));
- xcsbb = -(xcsgb + xcsdb + xcssb);
- xcggb = (cggb + GDoverlapCap + GSoverlapCap + GBoverlapCap);
- xcgdb = (cgdb - GDoverlapCap);
- xcgsb = (cgsb - GSoverlapCap);
- xcgbb = -(xcggb + xcgdb + xcgsb);
- xcbgb = (cbgb - GBoverlapCap);
- xcbdb = (cbdb - capbd);
- xcbsb = (cbsb - capbs);
- xcbbb = -(xcbgb + xcbdb + xcbsb);
-
- *(here->BSIM3V2GgPtr ) += xcggb * s->real;
- *(here->BSIM3V2GgPtr +1) += xcggb * s->imag;
- *(here->BSIM3V2BbPtr ) += xcbbb * s->real;
- *(here->BSIM3V2BbPtr +1) += xcbbb * s->imag;
- *(here->BSIM3V2DPdpPtr ) += xcddb * s->real;
- *(here->BSIM3V2DPdpPtr +1) += xcddb * s->imag;
- *(here->BSIM3V2SPspPtr ) += xcssb * s->real;
- *(here->BSIM3V2SPspPtr +1) += xcssb * s->imag;
-
- *(here->BSIM3V2GbPtr ) += xcgbb * s->real;
- *(here->BSIM3V2GbPtr +1) += xcgbb * s->imag;
- *(here->BSIM3V2GdpPtr ) += xcgdb * s->real;
- *(here->BSIM3V2GdpPtr +1) += xcgdb * s->imag;
- *(here->BSIM3V2GspPtr ) += xcgsb * s->real;
- *(here->BSIM3V2GspPtr +1) += xcgsb * s->imag;
-
- *(here->BSIM3V2BgPtr ) += xcbgb * s->real;
- *(here->BSIM3V2BgPtr +1) += xcbgb * s->imag;
- *(here->BSIM3V2BdpPtr ) += xcbdb * s->real;
- *(here->BSIM3V2BdpPtr +1) += xcbdb * s->imag;
- *(here->BSIM3V2BspPtr ) += xcbsb * s->real;
- *(here->BSIM3V2BspPtr +1) += xcbsb * s->imag;
-
- *(here->BSIM3V2DPgPtr ) += xcdgb * s->real;
- *(here->BSIM3V2DPgPtr +1) += xcdgb * s->imag;
- *(here->BSIM3V2DPbPtr ) += xcdbb * s->real;
- *(here->BSIM3V2DPbPtr +1) += xcdbb * s->imag;
- *(here->BSIM3V2DPspPtr ) += xcdsb * s->real;
- *(here->BSIM3V2DPspPtr +1) += xcdsb * s->imag;
-
- *(here->BSIM3V2SPgPtr ) += xcsgb * s->real;
- *(here->BSIM3V2SPgPtr +1) += xcsgb * s->imag;
- *(here->BSIM3V2SPbPtr ) += xcsbb * s->real;
- *(here->BSIM3V2SPbPtr +1) += xcsbb * s->imag;
- *(here->BSIM3V2SPdpPtr ) += xcsdb * s->real;
- *(here->BSIM3V2SPdpPtr +1) += xcsdb * s->imag;
-
- *(here->BSIM3V2DdPtr) += gdpr;
- *(here->BSIM3V2DdpPtr) -= gdpr;
- *(here->BSIM3V2DPdPtr) -= gdpr;
-
- *(here->BSIM3V2SsPtr) += gspr;
- *(here->BSIM3V2SspPtr) -= gspr;
- *(here->BSIM3V2SPsPtr) -= gspr;
-
- *(here->BSIM3V2BgPtr) -= here->BSIM3V2gbgs;
- *(here->BSIM3V2BbPtr) += gbd + gbs - here->BSIM3V2gbbs;
- *(here->BSIM3V2BdpPtr) -= gbd - gbbdp;
- *(here->BSIM3V2BspPtr) -= gbs - gbbsp;
-
- *(here->BSIM3V2DPgPtr) += Gm + dxpart * xgtg
- + T1 * ddxpart_dVg + gbdpg;
- *(here->BSIM3V2DPdpPtr) += gdpr + gds + gbd + RevSum
- + dxpart * xgtd + T1 * ddxpart_dVd + gbdpdp;
- *(here->BSIM3V2DPspPtr) -= gds + FwdSum - dxpart * xgts
- - T1 * ddxpart_dVs - gbdpsp;
- *(here->BSIM3V2DPbPtr) -= gbd - Gmbs - dxpart * xgtb
- - T1 * ddxpart_dVb - gbdpb;
-
- *(here->BSIM3V2SPgPtr) -= Gm - sxpart * xgtg
- - T1 * dsxpart_dVg - gbspg;
- *(here->BSIM3V2SPspPtr) += gspr + gds + gbs + FwdSum
- + sxpart * xgts + T1 * dsxpart_dVs + gbspsp;
- *(here->BSIM3V2SPbPtr) -= gbs + Gmbs - sxpart * xgtb
- - T1 * dsxpart_dVb - gbspb;
- *(here->BSIM3V2SPdpPtr) -= gds + RevSum - sxpart * xgtd
- - T1 * dsxpart_dVd - gbspdp;
-
- *(here->BSIM3V2GgPtr) -= xgtg;
- *(here->BSIM3V2GbPtr) -= xgtb;
- *(here->BSIM3V2GdpPtr) -= xgtd;
- *(here->BSIM3V2GspPtr) -= xgts;
-
- if (here->BSIM3V2nqsMod)
- { *(here->BSIM3V2QqPtr ) += s->real;
- *(here->BSIM3V2QqPtr +1) += s->imag;
- *(here->BSIM3V2QgPtr ) -= xcqgb * s->real;
- *(here->BSIM3V2QgPtr +1) -= xcqgb * s->imag;
- *(here->BSIM3V2QdpPtr ) -= xcqdb * s->real;
- *(here->BSIM3V2QdpPtr +1) -= xcqdb * s->imag;
- *(here->BSIM3V2QbPtr ) -= xcqbb * s->real;
- *(here->BSIM3V2QbPtr +1) -= xcqbb * s->imag;
- *(here->BSIM3V2QspPtr ) -= xcqsb * s->real;
- *(here->BSIM3V2QspPtr +1) -= xcqsb * s->imag;
-
- *(here->BSIM3V2GqPtr) -= here->BSIM3V2gtau;
- *(here->BSIM3V2DPqPtr) += dxpart * here->BSIM3V2gtau;
- *(here->BSIM3V2SPqPtr) += sxpart * here->BSIM3V2gtau;
-
- *(here->BSIM3V2QqPtr) += here->BSIM3V2gtau;
- *(here->BSIM3V2QgPtr) += xgtg;
- *(here->BSIM3V2QdpPtr) += xgtd;
- *(here->BSIM3V2QbPtr) += xgtb;
- *(here->BSIM3V2QspPtr) += xgts;
- }
- }
- }
- return(OK);
-}
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2set.c b/src/spicelib/devices/bsim3v2/b3v2set.c
deleted file mode 100644
index d40616c9d..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2set.c
+++ /dev/null
@@ -1,995 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: b3v2set.c
-**********/
-
-#include "ngspice.h"
-#include
-#include
-#include "smpdefs.h"
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "const.h"
-#include "sperror.h"
-#include "suffix.h"
-
-#define MAX_EXP 5.834617425e14
-#define MIN_EXP 1.713908431e-15
-#define EXP_THRESHOLD 34.0
-#define SMOOTHFACTOR 0.1
-#define EPSOX 3.453133e-11
-#define EPSSI 1.03594e-10
-#define PI 3.141592654
-#define Charge_q 1.60219e-19
-#define Meter2Micron 1.0e6
-
-int
-BSIM3V2setup(matrix,inModel,ckt,states)
-SMPmatrix *matrix;
-GENmodel *inModel;
-CKTcircuit *ckt;
-int *states;
-{
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance *here;
-int error;
-CKTnode *tmp;
-
-double tmp1, tmp2;
-
- /* loop through all the BSIM3V2 device models */
- for( ; model != NULL; model = model->BSIM3V2nextModel )
- {
-/* Default value Processing for BSIM3V2 MOSFET Models */
- if (!model->BSIM3V2typeGiven)
- model->BSIM3V2type = NMOS;
- if (!model->BSIM3V2mobModGiven)
- model->BSIM3V2mobMod = 1;
- if (!model->BSIM3V2binUnitGiven)
- model->BSIM3V2binUnit = 1;
- if (!model->BSIM3V2paramChkGiven)
- model->BSIM3V2paramChk = 0;
- if (!model->BSIM3V2capModGiven)
- model->BSIM3V2capMod = 3;
- if (!model->BSIM3V2noiModGiven)
- model->BSIM3V2noiMod = 1;
- if (!model->BSIM3V2versionGiven)
- model->BSIM3V2version = 3.2;
- if (!model->BSIM3V2toxGiven)
- model->BSIM3V2tox = 150.0e-10;
- model->BSIM3V2cox = 3.453133e-11 / model->BSIM3V2tox;
- if (!model->BSIM3V2toxmGiven)
- model->BSIM3V2toxm = model->BSIM3V2tox;
-
- if (!model->BSIM3V2cdscGiven)
- model->BSIM3V2cdsc = 2.4e-4; /* unit Q/V/m^2 */
- if (!model->BSIM3V2cdscbGiven)
- model->BSIM3V2cdscb = 0.0; /* unit Q/V/m^2 */
- if (!model->BSIM3V2cdscdGiven)
- model->BSIM3V2cdscd = 0.0; /* unit Q/V/m^2 */
- if (!model->BSIM3V2citGiven)
- model->BSIM3V2cit = 0.0; /* unit Q/V/m^2 */
- if (!model->BSIM3V2nfactorGiven)
- model->BSIM3V2nfactor = 1;
- if (!model->BSIM3V2xjGiven)
- model->BSIM3V2xj = .15e-6;
- if (!model->BSIM3V2vsatGiven)
- model->BSIM3V2vsat = 8.0e4; /* unit m/s */
- if (!model->BSIM3V2atGiven)
- model->BSIM3V2at = 3.3e4; /* unit m/s */
- if (!model->BSIM3V2a0Given)
- model->BSIM3V2a0 = 1.0;
- if (!model->BSIM3V2agsGiven)
- model->BSIM3V2ags = 0.0;
- if (!model->BSIM3V2a1Given)
- model->BSIM3V2a1 = 0.0;
- if (!model->BSIM3V2a2Given)
- model->BSIM3V2a2 = 1.0;
- if (!model->BSIM3V2ketaGiven)
- model->BSIM3V2keta = -0.047; /* unit / V */
- if (!model->BSIM3V2nsubGiven)
- model->BSIM3V2nsub = 6.0e16; /* unit 1/cm3 */
- if (!model->BSIM3V2npeakGiven)
- model->BSIM3V2npeak = 1.7e17; /* unit 1/cm3 */
- if (!model->BSIM3V2ngateGiven)
- model->BSIM3V2ngate = 0; /* unit 1/cm3 */
- if (!model->BSIM3V2vbmGiven)
- model->BSIM3V2vbm = -3.0;
- if (!model->BSIM3V2xtGiven)
- model->BSIM3V2xt = 1.55e-7;
- if (!model->BSIM3V2kt1Given)
- model->BSIM3V2kt1 = -0.11; /* unit V */
- if (!model->BSIM3V2kt1lGiven)
- model->BSIM3V2kt1l = 0.0; /* unit V*m */
- if (!model->BSIM3V2kt2Given)
- model->BSIM3V2kt2 = 0.022; /* No unit */
- if (!model->BSIM3V2k3Given)
- model->BSIM3V2k3 = 80.0;
- if (!model->BSIM3V2k3bGiven)
- model->BSIM3V2k3b = 0.0;
- if (!model->BSIM3V2w0Given)
- model->BSIM3V2w0 = 2.5e-6;
- if (!model->BSIM3V2nlxGiven)
- model->BSIM3V2nlx = 1.74e-7;
- if (!model->BSIM3V2dvt0Given)
- model->BSIM3V2dvt0 = 2.2;
- if (!model->BSIM3V2dvt1Given)
- model->BSIM3V2dvt1 = 0.53;
- if (!model->BSIM3V2dvt2Given)
- model->BSIM3V2dvt2 = -0.032; /* unit 1 / V */
-
- if (!model->BSIM3V2dvt0wGiven)
- model->BSIM3V2dvt0w = 0.0;
- if (!model->BSIM3V2dvt1wGiven)
- model->BSIM3V2dvt1w = 5.3e6;
- if (!model->BSIM3V2dvt2wGiven)
- model->BSIM3V2dvt2w = -0.032;
-
- if (!model->BSIM3V2droutGiven)
- model->BSIM3V2drout = 0.56;
- if (!model->BSIM3V2dsubGiven)
- model->BSIM3V2dsub = model->BSIM3V2drout;
- if (!model->BSIM3V2vth0Given)
- model->BSIM3V2vth0 = (model->BSIM3V2type == NMOS) ? 0.7 : -0.7;
- if (!model->BSIM3V2uaGiven)
- model->BSIM3V2ua = 2.25e-9; /* unit m/V */
- if (!model->BSIM3V2ua1Given)
- model->BSIM3V2ua1 = 4.31e-9; /* unit m/V */
- if (!model->BSIM3V2ubGiven)
- model->BSIM3V2ub = 5.87e-19; /* unit (m/V)**2 */
- if (!model->BSIM3V2ub1Given)
- model->BSIM3V2ub1 = -7.61e-18; /* unit (m/V)**2 */
- if (!model->BSIM3V2ucGiven)
- model->BSIM3V2uc = (model->BSIM3V2mobMod == 3) ? -0.0465 : -0.0465e-9;
- if (!model->BSIM3V2uc1Given)
- model->BSIM3V2uc1 = (model->BSIM3V2mobMod == 3) ? -0.056 : -0.056e-9;
- if (!model->BSIM3V2u0Given)
- model->BSIM3V2u0 = (model->BSIM3V2type == NMOS) ? 0.067 : 0.025;
- if (!model->BSIM3V2uteGiven)
- model->BSIM3V2ute = -1.5;
- if (!model->BSIM3V2voffGiven)
- model->BSIM3V2voff = -0.08;
- if (!model->BSIM3V2deltaGiven)
- model->BSIM3V2delta = 0.01;
- if (!model->BSIM3V2rdswGiven)
- model->BSIM3V2rdsw = 0;
- if (!model->BSIM3V2prwgGiven)
- model->BSIM3V2prwg = 0.0; /* unit 1/V */
- if (!model->BSIM3V2prwbGiven)
- model->BSIM3V2prwb = 0.0;
- if (!model->BSIM3V2prtGiven)
- if (!model->BSIM3V2prtGiven)
- model->BSIM3V2prt = 0.0;
- if (!model->BSIM3V2eta0Given)
- model->BSIM3V2eta0 = 0.08; /* no unit */
- if (!model->BSIM3V2etabGiven)
- model->BSIM3V2etab = -0.07; /* unit 1/V */
- if (!model->BSIM3V2pclmGiven)
- model->BSIM3V2pclm = 1.3; /* no unit */
- if (!model->BSIM3V2pdibl1Given)
- model->BSIM3V2pdibl1 = .39; /* no unit */
- if (!model->BSIM3V2pdibl2Given)
- model->BSIM3V2pdibl2 = 0.0086; /* no unit */
- if (!model->BSIM3V2pdiblbGiven)
- model->BSIM3V2pdiblb = 0.0; /* 1/V */
- if (!model->BSIM3V2pscbe1Given)
- model->BSIM3V2pscbe1 = 4.24e8;
- if (!model->BSIM3V2pscbe2Given)
- model->BSIM3V2pscbe2 = 1.0e-5;
- if (!model->BSIM3V2pvagGiven)
- model->BSIM3V2pvag = 0.0;
- if (!model->BSIM3V2wrGiven)
- model->BSIM3V2wr = 1.0;
- if (!model->BSIM3V2dwgGiven)
- model->BSIM3V2dwg = 0.0;
- if (!model->BSIM3V2dwbGiven)
- model->BSIM3V2dwb = 0.0;
- if (!model->BSIM3V2b0Given)
- model->BSIM3V2b0 = 0.0;
- if (!model->BSIM3V2b1Given)
- model->BSIM3V2b1 = 0.0;
- if (!model->BSIM3V2alpha0Given)
- model->BSIM3V2alpha0 = 0.0;
- if (!model->BSIM3V2alpha1Given)
- model->BSIM3V2alpha1 = 0.0;
- if (!model->BSIM3V2beta0Given)
- model->BSIM3V2beta0 = 30.0;
- if (!model->BSIM3V2ijthGiven)
- model->BSIM3V2ijth = 0.1; /* unit A */
-
- if (!model->BSIM3V2elmGiven)
- model->BSIM3V2elm = 5.0;
- if (!model->BSIM3V2cgslGiven)
- model->BSIM3V2cgsl = 0.0;
- if (!model->BSIM3V2cgdlGiven)
- model->BSIM3V2cgdl = 0.0;
- if (!model->BSIM3V2ckappaGiven)
- model->BSIM3V2ckappa = 0.6;
- if (!model->BSIM3V2clcGiven)
- model->BSIM3V2clc = 0.1e-6;
- if (!model->BSIM3V2cleGiven)
- model->BSIM3V2cle = 0.6;
- if (!model->BSIM3V2vfbcvGiven)
- model->BSIM3V2vfbcv = -1.0;
- if (!model->BSIM3V2acdeGiven)
- model->BSIM3V2acde = 1.0;
- if (!model->BSIM3V2moinGiven)
- model->BSIM3V2moin = 15.0;
- if (!model->BSIM3V2noffGiven)
- model->BSIM3V2noff = 1.0;
- if (!model->BSIM3V2voffcvGiven)
- model->BSIM3V2voffcv = 0.0;
- if (!model->BSIM3V2tcjGiven)
- model->BSIM3V2tcj = 0.0;
- if (!model->BSIM3V2tpbGiven)
- model->BSIM3V2tpb = 0.0;
- if (!model->BSIM3V2tcjswGiven)
- model->BSIM3V2tcjsw = 0.0;
- if (!model->BSIM3V2tpbswGiven)
- model->BSIM3V2tpbsw = 0.0;
- if (!model->BSIM3V2tcjswgGiven)
- model->BSIM3V2tcjswg = 0.0;
- if (!model->BSIM3V2tpbswgGiven)
- model->BSIM3V2tpbswg = 0.0;
-
- /* Length dependence */
- if (!model->BSIM3V2lcdscGiven)
- model->BSIM3V2lcdsc = 0.0;
- if (!model->BSIM3V2lcdscbGiven)
- model->BSIM3V2lcdscb = 0.0;
- if (!model->BSIM3V2lcdscdGiven)
- model->BSIM3V2lcdscd = 0.0;
- if (!model->BSIM3V2lcitGiven)
- model->BSIM3V2lcit = 0.0;
- if (!model->BSIM3V2lnfactorGiven)
- model->BSIM3V2lnfactor = 0.0;
- if (!model->BSIM3V2lxjGiven)
- model->BSIM3V2lxj = 0.0;
- if (!model->BSIM3V2lvsatGiven)
- model->BSIM3V2lvsat = 0.0;
- if (!model->BSIM3V2latGiven)
- model->BSIM3V2lat = 0.0;
- if (!model->BSIM3V2la0Given)
- model->BSIM3V2la0 = 0.0;
- if (!model->BSIM3V2lagsGiven)
- model->BSIM3V2lags = 0.0;
- if (!model->BSIM3V2la1Given)
- model->BSIM3V2la1 = 0.0;
- if (!model->BSIM3V2la2Given)
- model->BSIM3V2la2 = 0.0;
- if (!model->BSIM3V2lketaGiven)
- model->BSIM3V2lketa = 0.0;
- if (!model->BSIM3V2lnsubGiven)
- model->BSIM3V2lnsub = 0.0;
- if (!model->BSIM3V2lnpeakGiven)
- model->BSIM3V2lnpeak = 0.0;
- if (!model->BSIM3V2lngateGiven)
- model->BSIM3V2lngate = 0.0;
- if (!model->BSIM3V2lvbmGiven)
- model->BSIM3V2lvbm = 0.0;
- if (!model->BSIM3V2lxtGiven)
- model->BSIM3V2lxt = 0.0;
- if (!model->BSIM3V2lkt1Given)
- model->BSIM3V2lkt1 = 0.0;
- if (!model->BSIM3V2lkt1lGiven)
- model->BSIM3V2lkt1l = 0.0;
- if (!model->BSIM3V2lkt2Given)
- model->BSIM3V2lkt2 = 0.0;
- if (!model->BSIM3V2lk3Given)
- model->BSIM3V2lk3 = 0.0;
- if (!model->BSIM3V2lk3bGiven)
- model->BSIM3V2lk3b = 0.0;
- if (!model->BSIM3V2lw0Given)
- model->BSIM3V2lw0 = 0.0;
- if (!model->BSIM3V2lnlxGiven)
- model->BSIM3V2lnlx = 0.0;
- if (!model->BSIM3V2ldvt0Given)
- model->BSIM3V2ldvt0 = 0.0;
- if (!model->BSIM3V2ldvt1Given)
- model->BSIM3V2ldvt1 = 0.0;
- if (!model->BSIM3V2ldvt2Given)
- model->BSIM3V2ldvt2 = 0.0;
- if (!model->BSIM3V2ldvt0wGiven)
- model->BSIM3V2ldvt0w = 0.0;
- if (!model->BSIM3V2ldvt1wGiven)
- model->BSIM3V2ldvt1w = 0.0;
- if (!model->BSIM3V2ldvt2wGiven)
- model->BSIM3V2ldvt2w = 0.0;
- if (!model->BSIM3V2ldroutGiven)
- model->BSIM3V2ldrout = 0.0;
- if (!model->BSIM3V2ldsubGiven)
- model->BSIM3V2ldsub = 0.0;
- if (!model->BSIM3V2lvth0Given)
- model->BSIM3V2lvth0 = 0.0;
- if (!model->BSIM3V2luaGiven)
- model->BSIM3V2lua = 0.0;
- if (!model->BSIM3V2lua1Given)
- model->BSIM3V2lua1 = 0.0;
- if (!model->BSIM3V2lubGiven)
- model->BSIM3V2lub = 0.0;
- if (!model->BSIM3V2lub1Given)
- model->BSIM3V2lub1 = 0.0;
- if (!model->BSIM3V2lucGiven)
- model->BSIM3V2luc = 0.0;
- if (!model->BSIM3V2luc1Given)
- model->BSIM3V2luc1 = 0.0;
- if (!model->BSIM3V2lu0Given)
- model->BSIM3V2lu0 = 0.0;
- if (!model->BSIM3V2luteGiven)
- model->BSIM3V2lute = 0.0;
- if (!model->BSIM3V2lvoffGiven)
- model->BSIM3V2lvoff = 0.0;
- if (!model->BSIM3V2ldeltaGiven)
- model->BSIM3V2ldelta = 0.0;
- if (!model->BSIM3V2lrdswGiven)
- model->BSIM3V2lrdsw = 0.0;
- if (!model->BSIM3V2lprwbGiven)
- model->BSIM3V2lprwb = 0.0;
- if (!model->BSIM3V2lprwgGiven)
- model->BSIM3V2lprwg = 0.0;
- if (!model->BSIM3V2lprtGiven)
- model->BSIM3V2lprt = 0.0;
- if (!model->BSIM3V2leta0Given)
- model->BSIM3V2leta0 = 0.0;
- if (!model->BSIM3V2letabGiven)
- model->BSIM3V2letab = -0.0;
- if (!model->BSIM3V2lpclmGiven)
- model->BSIM3V2lpclm = 0.0;
- if (!model->BSIM3V2lpdibl1Given)
- model->BSIM3V2lpdibl1 = 0.0;
- if (!model->BSIM3V2lpdibl2Given)
- model->BSIM3V2lpdibl2 = 0.0;
- if (!model->BSIM3V2lpdiblbGiven)
- model->BSIM3V2lpdiblb = 0.0;
- if (!model->BSIM3V2lpscbe1Given)
- model->BSIM3V2lpscbe1 = 0.0;
- if (!model->BSIM3V2lpscbe2Given)
- model->BSIM3V2lpscbe2 = 0.0;
- if (!model->BSIM3V2lpvagGiven)
- model->BSIM3V2lpvag = 0.0;
- if (!model->BSIM3V2lwrGiven)
- model->BSIM3V2lwr = 0.0;
- if (!model->BSIM3V2ldwgGiven)
- model->BSIM3V2ldwg = 0.0;
- if (!model->BSIM3V2ldwbGiven)
- model->BSIM3V2ldwb = 0.0;
- if (!model->BSIM3V2lb0Given)
- model->BSIM3V2lb0 = 0.0;
- if (!model->BSIM3V2lb1Given)
- model->BSIM3V2lb1 = 0.0;
- if (!model->BSIM3V2lalpha0Given)
- model->BSIM3V2lalpha0 = 0.0;
- if (!model->BSIM3V2lalpha1Given)
- model->BSIM3V2lalpha1 = 0.0;
- if (!model->BSIM3V2lbeta0Given)
- model->BSIM3V2lbeta0 = 0.0;
- if (!model->BSIM3V2lvfbGiven)
- model->BSIM3V2lvfb = 0.0;
-
- if (!model->BSIM3V2lelmGiven)
- model->BSIM3V2lelm = 0.0;
- if (!model->BSIM3V2lcgslGiven)
- model->BSIM3V2lcgsl = 0.0;
- if (!model->BSIM3V2lcgdlGiven)
- model->BSIM3V2lcgdl = 0.0;
- if (!model->BSIM3V2lckappaGiven)
- model->BSIM3V2lckappa = 0.0;
- if (!model->BSIM3V2lclcGiven)
- model->BSIM3V2lclc = 0.0;
- if (!model->BSIM3V2lcleGiven)
- model->BSIM3V2lcle = 0.0;
- if (!model->BSIM3V2lcfGiven)
- model->BSIM3V2lcf = 0.0;
- if (!model->BSIM3V2lvfbcvGiven)
- model->BSIM3V2lvfbcv = 0.0;
- if (!model->BSIM3V2lacdeGiven)
- model->BSIM3V2lacde = 0.0;
- if (!model->BSIM3V2lmoinGiven)
- model->BSIM3V2lmoin = 0.0;
- if (!model->BSIM3V2lnoffGiven)
- model->BSIM3V2lnoff = 0.0;
- if (!model->BSIM3V2lvoffcvGiven)
- model->BSIM3V2lvoffcv = 0.0;
-
- /* Width dependence */
- if (!model->BSIM3V2wcdscGiven)
- model->BSIM3V2wcdsc = 0.0;
- if (!model->BSIM3V2wcdscbGiven)
- model->BSIM3V2wcdscb = 0.0;
- if (!model->BSIM3V2wcdscdGiven)
- model->BSIM3V2wcdscd = 0.0;
- if (!model->BSIM3V2wcitGiven)
- model->BSIM3V2wcit = 0.0;
- if (!model->BSIM3V2wnfactorGiven)
- model->BSIM3V2wnfactor = 0.0;
- if (!model->BSIM3V2wxjGiven)
- model->BSIM3V2wxj = 0.0;
- if (!model->BSIM3V2wvsatGiven)
- model->BSIM3V2wvsat = 0.0;
- if (!model->BSIM3V2watGiven)
- model->BSIM3V2wat = 0.0;
- if (!model->BSIM3V2wa0Given)
- model->BSIM3V2wa0 = 0.0;
- if (!model->BSIM3V2wagsGiven)
- model->BSIM3V2wags = 0.0;
- if (!model->BSIM3V2wa1Given)
- model->BSIM3V2wa1 = 0.0;
- if (!model->BSIM3V2wa2Given)
- model->BSIM3V2wa2 = 0.0;
- if (!model->BSIM3V2wketaGiven)
- model->BSIM3V2wketa = 0.0;
- if (!model->BSIM3V2wnsubGiven)
- model->BSIM3V2wnsub = 0.0;
- if (!model->BSIM3V2wnpeakGiven)
- model->BSIM3V2wnpeak = 0.0;
- if (!model->BSIM3V2wngateGiven)
- model->BSIM3V2wngate = 0.0;
- if (!model->BSIM3V2wvbmGiven)
- model->BSIM3V2wvbm = 0.0;
- if (!model->BSIM3V2wxtGiven)
- model->BSIM3V2wxt = 0.0;
- if (!model->BSIM3V2wkt1Given)
- model->BSIM3V2wkt1 = 0.0;
- if (!model->BSIM3V2wkt1lGiven)
- model->BSIM3V2wkt1l = 0.0;
- if (!model->BSIM3V2wkt2Given)
- model->BSIM3V2wkt2 = 0.0;
- if (!model->BSIM3V2wk3Given)
- model->BSIM3V2wk3 = 0.0;
- if (!model->BSIM3V2wk3bGiven)
- model->BSIM3V2wk3b = 0.0;
- if (!model->BSIM3V2ww0Given)
- model->BSIM3V2ww0 = 0.0;
- if (!model->BSIM3V2wnlxGiven)
- model->BSIM3V2wnlx = 0.0;
- if (!model->BSIM3V2wdvt0Given)
- model->BSIM3V2wdvt0 = 0.0;
- if (!model->BSIM3V2wdvt1Given)
- model->BSIM3V2wdvt1 = 0.0;
- if (!model->BSIM3V2wdvt2Given)
- model->BSIM3V2wdvt2 = 0.0;
- if (!model->BSIM3V2wdvt0wGiven)
- model->BSIM3V2wdvt0w = 0.0;
- if (!model->BSIM3V2wdvt1wGiven)
- model->BSIM3V2wdvt1w = 0.0;
- if (!model->BSIM3V2wdvt2wGiven)
- model->BSIM3V2wdvt2w = 0.0;
- if (!model->BSIM3V2wdroutGiven)
- model->BSIM3V2wdrout = 0.0;
- if (!model->BSIM3V2wdsubGiven)
- model->BSIM3V2wdsub = 0.0;
- if (!model->BSIM3V2wvth0Given)
- model->BSIM3V2wvth0 = 0.0;
- if (!model->BSIM3V2wuaGiven)
- model->BSIM3V2wua = 0.0;
- if (!model->BSIM3V2wua1Given)
- model->BSIM3V2wua1 = 0.0;
- if (!model->BSIM3V2wubGiven)
- model->BSIM3V2wub = 0.0;
- if (!model->BSIM3V2wub1Given)
- model->BSIM3V2wub1 = 0.0;
- if (!model->BSIM3V2wucGiven)
- model->BSIM3V2wuc = 0.0;
- if (!model->BSIM3V2wuc1Given)
- model->BSIM3V2wuc1 = 0.0;
- if (!model->BSIM3V2wu0Given)
- model->BSIM3V2wu0 = 0.0;
- if (!model->BSIM3V2wuteGiven)
- model->BSIM3V2wute = 0.0;
- if (!model->BSIM3V2wvoffGiven)
- model->BSIM3V2wvoff = 0.0;
- if (!model->BSIM3V2wdeltaGiven)
- model->BSIM3V2wdelta = 0.0;
- if (!model->BSIM3V2wrdswGiven)
- model->BSIM3V2wrdsw = 0.0;
- if (!model->BSIM3V2wprwbGiven)
- model->BSIM3V2wprwb = 0.0;
- if (!model->BSIM3V2wprwgGiven)
- model->BSIM3V2wprwg = 0.0;
- if (!model->BSIM3V2wprtGiven)
- model->BSIM3V2wprt = 0.0;
- if (!model->BSIM3V2weta0Given)
- model->BSIM3V2weta0 = 0.0;
- if (!model->BSIM3V2wetabGiven)
- model->BSIM3V2wetab = 0.0;
- if (!model->BSIM3V2wpclmGiven)
- model->BSIM3V2wpclm = 0.0;
- if (!model->BSIM3V2wpdibl1Given)
- model->BSIM3V2wpdibl1 = 0.0;
- if (!model->BSIM3V2wpdibl2Given)
- model->BSIM3V2wpdibl2 = 0.0;
- if (!model->BSIM3V2wpdiblbGiven)
- model->BSIM3V2wpdiblb = 0.0;
- if (!model->BSIM3V2wpscbe1Given)
- model->BSIM3V2wpscbe1 = 0.0;
- if (!model->BSIM3V2wpscbe2Given)
- model->BSIM3V2wpscbe2 = 0.0;
- if (!model->BSIM3V2wpvagGiven)
- model->BSIM3V2wpvag = 0.0;
- if (!model->BSIM3V2wwrGiven)
- model->BSIM3V2wwr = 0.0;
- if (!model->BSIM3V2wdwgGiven)
- model->BSIM3V2wdwg = 0.0;
- if (!model->BSIM3V2wdwbGiven)
- model->BSIM3V2wdwb = 0.0;
- if (!model->BSIM3V2wb0Given)
- model->BSIM3V2wb0 = 0.0;
- if (!model->BSIM3V2wb1Given)
- model->BSIM3V2wb1 = 0.0;
- if (!model->BSIM3V2walpha0Given)
- model->BSIM3V2walpha0 = 0.0;
- if (!model->BSIM3V2walpha1Given)
- model->BSIM3V2walpha1 = 0.0;
- if (!model->BSIM3V2wbeta0Given)
- model->BSIM3V2wbeta0 = 0.0;
- if (!model->BSIM3V2wvfbGiven)
- model->BSIM3V2wvfb = 0.0;
-
- if (!model->BSIM3V2welmGiven)
- model->BSIM3V2welm = 0.0;
- if (!model->BSIM3V2wcgslGiven)
- model->BSIM3V2wcgsl = 0.0;
- if (!model->BSIM3V2wcgdlGiven)
- model->BSIM3V2wcgdl = 0.0;
- if (!model->BSIM3V2wckappaGiven)
- model->BSIM3V2wckappa = 0.0;
- if (!model->BSIM3V2wcfGiven)
- model->BSIM3V2wcf = 0.0;
- if (!model->BSIM3V2wclcGiven)
- model->BSIM3V2wclc = 0.0;
- if (!model->BSIM3V2wcleGiven)
- model->BSIM3V2wcle = 0.0;
- if (!model->BSIM3V2wvfbcvGiven)
- model->BSIM3V2wvfbcv = 0.0;
- if (!model->BSIM3V2wacdeGiven)
- model->BSIM3V2wacde = 0.0;
- if (!model->BSIM3V2wmoinGiven)
- model->BSIM3V2wmoin = 0.0;
- if (!model->BSIM3V2wnoffGiven)
- model->BSIM3V2wnoff = 0.0;
- if (!model->BSIM3V2wvoffcvGiven)
- model->BSIM3V2wvoffcv = 0.0;
-
- /* Cross-term dependence */
- if (!model->BSIM3V2pcdscGiven)
- model->BSIM3V2pcdsc = 0.0;
- if (!model->BSIM3V2pcdscbGiven)
- model->BSIM3V2pcdscb = 0.0;
- if (!model->BSIM3V2pcdscdGiven)
- model->BSIM3V2pcdscd = 0.0;
- if (!model->BSIM3V2pcitGiven)
- model->BSIM3V2pcit = 0.0;
- if (!model->BSIM3V2pnfactorGiven)
- model->BSIM3V2pnfactor = 0.0;
- if (!model->BSIM3V2pxjGiven)
- model->BSIM3V2pxj = 0.0;
- if (!model->BSIM3V2pvsatGiven)
- model->BSIM3V2pvsat = 0.0;
- if (!model->BSIM3V2patGiven)
- model->BSIM3V2pat = 0.0;
- if (!model->BSIM3V2pa0Given)
- model->BSIM3V2pa0 = 0.0;
-
- if (!model->BSIM3V2pagsGiven)
- model->BSIM3V2pags = 0.0;
- if (!model->BSIM3V2pa1Given)
- model->BSIM3V2pa1 = 0.0;
- if (!model->BSIM3V2pa2Given)
- model->BSIM3V2pa2 = 0.0;
- if (!model->BSIM3V2pketaGiven)
- model->BSIM3V2pketa = 0.0;
- if (!model->BSIM3V2pnsubGiven)
- model->BSIM3V2pnsub = 0.0;
- if (!model->BSIM3V2pnpeakGiven)
- model->BSIM3V2pnpeak = 0.0;
- if (!model->BSIM3V2pngateGiven)
- model->BSIM3V2pngate = 0.0;
- if (!model->BSIM3V2pvbmGiven)
- model->BSIM3V2pvbm = 0.0;
- if (!model->BSIM3V2pxtGiven)
- model->BSIM3V2pxt = 0.0;
- if (!model->BSIM3V2pkt1Given)
- model->BSIM3V2pkt1 = 0.0;
- if (!model->BSIM3V2pkt1lGiven)
- model->BSIM3V2pkt1l = 0.0;
- if (!model->BSIM3V2pkt2Given)
- model->BSIM3V2pkt2 = 0.0;
- if (!model->BSIM3V2pk3Given)
- model->BSIM3V2pk3 = 0.0;
- if (!model->BSIM3V2pk3bGiven)
- model->BSIM3V2pk3b = 0.0;
- if (!model->BSIM3V2pw0Given)
- model->BSIM3V2pw0 = 0.0;
- if (!model->BSIM3V2pnlxGiven)
- model->BSIM3V2pnlx = 0.0;
- if (!model->BSIM3V2pdvt0Given)
- model->BSIM3V2pdvt0 = 0.0;
- if (!model->BSIM3V2pdvt1Given)
- model->BSIM3V2pdvt1 = 0.0;
- if (!model->BSIM3V2pdvt2Given)
- model->BSIM3V2pdvt2 = 0.0;
- if (!model->BSIM3V2pdvt0wGiven)
- model->BSIM3V2pdvt0w = 0.0;
- if (!model->BSIM3V2pdvt1wGiven)
- model->BSIM3V2pdvt1w = 0.0;
- if (!model->BSIM3V2pdvt2wGiven)
- model->BSIM3V2pdvt2w = 0.0;
- if (!model->BSIM3V2pdroutGiven)
- model->BSIM3V2pdrout = 0.0;
- if (!model->BSIM3V2pdsubGiven)
- model->BSIM3V2pdsub = 0.0;
- if (!model->BSIM3V2pvth0Given)
- model->BSIM3V2pvth0 = 0.0;
- if (!model->BSIM3V2puaGiven)
- model->BSIM3V2pua = 0.0;
- if (!model->BSIM3V2pua1Given)
- model->BSIM3V2pua1 = 0.0;
- if (!model->BSIM3V2pubGiven)
- model->BSIM3V2pub = 0.0;
- if (!model->BSIM3V2pub1Given)
- model->BSIM3V2pub1 = 0.0;
- if (!model->BSIM3V2pucGiven)
- model->BSIM3V2puc = 0.0;
- if (!model->BSIM3V2puc1Given)
- model->BSIM3V2puc1 = 0.0;
- if (!model->BSIM3V2pu0Given)
- model->BSIM3V2pu0 = 0.0;
- if (!model->BSIM3V2puteGiven)
- model->BSIM3V2pute = 0.0;
- if (!model->BSIM3V2pvoffGiven)
- model->BSIM3V2pvoff = 0.0;
- if (!model->BSIM3V2pdeltaGiven)
- model->BSIM3V2pdelta = 0.0;
- if (!model->BSIM3V2prdswGiven)
- model->BSIM3V2prdsw = 0.0;
- if (!model->BSIM3V2pprwbGiven)
- model->BSIM3V2pprwb = 0.0;
- if (!model->BSIM3V2pprwgGiven)
- model->BSIM3V2pprwg = 0.0;
- if (!model->BSIM3V2pprtGiven)
- model->BSIM3V2pprt = 0.0;
- if (!model->BSIM3V2peta0Given)
- model->BSIM3V2peta0 = 0.0;
- if (!model->BSIM3V2petabGiven)
- model->BSIM3V2petab = 0.0;
- if (!model->BSIM3V2ppclmGiven)
- model->BSIM3V2ppclm = 0.0;
- if (!model->BSIM3V2ppdibl1Given)
- model->BSIM3V2ppdibl1 = 0.0;
- if (!model->BSIM3V2ppdibl2Given)
- model->BSIM3V2ppdibl2 = 0.0;
- if (!model->BSIM3V2ppdiblbGiven)
- model->BSIM3V2ppdiblb = 0.0;
- if (!model->BSIM3V2ppscbe1Given)
- model->BSIM3V2ppscbe1 = 0.0;
- if (!model->BSIM3V2ppscbe2Given)
- model->BSIM3V2ppscbe2 = 0.0;
- if (!model->BSIM3V2ppvagGiven)
- model->BSIM3V2ppvag = 0.0;
- if (!model->BSIM3V2pwrGiven)
- model->BSIM3V2pwr = 0.0;
- if (!model->BSIM3V2pdwgGiven)
- model->BSIM3V2pdwg = 0.0;
- if (!model->BSIM3V2pdwbGiven)
- model->BSIM3V2pdwb = 0.0;
- if (!model->BSIM3V2pb0Given)
- model->BSIM3V2pb0 = 0.0;
- if (!model->BSIM3V2pb1Given)
- model->BSIM3V2pb1 = 0.0;
- if (!model->BSIM3V2palpha0Given)
- model->BSIM3V2palpha0 = 0.0;
- if (!model->BSIM3V2palpha1Given)
- model->BSIM3V2palpha1 = 0.0;
- if (!model->BSIM3V2pbeta0Given)
- model->BSIM3V2pbeta0 = 0.0;
- if (!model->BSIM3V2pvfbGiven)
- model->BSIM3V2pvfb = 0.0;
-
- if (!model->BSIM3V2pelmGiven)
- model->BSIM3V2pelm = 0.0;
- if (!model->BSIM3V2pcgslGiven)
- model->BSIM3V2pcgsl = 0.0;
- if (!model->BSIM3V2pcgdlGiven)
- model->BSIM3V2pcgdl = 0.0;
- if (!model->BSIM3V2pckappaGiven)
- model->BSIM3V2pckappa = 0.0;
- if (!model->BSIM3V2pcfGiven)
- model->BSIM3V2pcf = 0.0;
- if (!model->BSIM3V2pclcGiven)
- model->BSIM3V2pclc = 0.0;
- if (!model->BSIM3V2pcleGiven)
- model->BSIM3V2pcle = 0.0;
- if (!model->BSIM3V2pvfbcvGiven)
- model->BSIM3V2pvfbcv = 0.0;
- if (!model->BSIM3V2pacdeGiven)
- model->BSIM3V2pacde = 0.0;
- if (!model->BSIM3V2pmoinGiven)
- model->BSIM3V2pmoin = 0.0;
- if (!model->BSIM3V2pnoffGiven)
- model->BSIM3V2pnoff = 0.0;
- if (!model->BSIM3V2pvoffcvGiven)
- model->BSIM3V2pvoffcv = 0.0;
-
- /* unit degree celcius */
- if (!model->BSIM3V2tnomGiven)
- model->BSIM3V2tnom = ckt->CKTnomTemp;
- /* else
- model->BSIM3V2tnom = model->BSIM3V2tnom + 273.15; */
- if (!model->BSIM3V2LintGiven)
- model->BSIM3V2Lint = 0.0;
- if (!model->BSIM3V2LlGiven)
- model->BSIM3V2Ll = 0.0;
- if (!model->BSIM3V2LlcGiven)
- model->BSIM3V2Llc = model->BSIM3V2Ll;
- if (!model->BSIM3V2LlnGiven)
- model->BSIM3V2Lln = 1.0;
- if (!model->BSIM3V2LwGiven)
- model->BSIM3V2Lw = 0.0;
- if (!model->BSIM3V2LwcGiven)
- model->BSIM3V2Lwc = model->BSIM3V2Lw;
- if (!model->BSIM3V2LwnGiven)
- model->BSIM3V2Lwn = 1.0;
- if (!model->BSIM3V2LwlGiven)
- model->BSIM3V2Lwl = 0.0;
- if (!model->BSIM3V2LwlcGiven)
- model->BSIM3V2Lwlc = model->BSIM3V2Lwl;
- if (!model->BSIM3V2LminGiven)
- model->BSIM3V2Lmin = 0.0;
- if (!model->BSIM3V2LmaxGiven)
- model->BSIM3V2Lmax = 1.0;
- if (!model->BSIM3V2WintGiven)
- model->BSIM3V2Wint = 0.0;
- if (!model->BSIM3V2WlGiven)
- model->BSIM3V2Wl = 0.0;
- if (!model->BSIM3V2WlcGiven)
- model->BSIM3V2Wlc = model->BSIM3V2Wl;
- if (!model->BSIM3V2WlnGiven)
- model->BSIM3V2Wln = 1.0;
- if (!model->BSIM3V2WwGiven)
- model->BSIM3V2Ww = 0.0;
- if (!model->BSIM3V2WwcGiven)
- model->BSIM3V2Wwc = model->BSIM3V2Ww;
- if (!model->BSIM3V2WwnGiven)
- model->BSIM3V2Wwn = 1.0;
- if (!model->BSIM3V2WwlGiven)
- model->BSIM3V2Wwl = 0.0;
- if (!model->BSIM3V2WwlcGiven)
- model->BSIM3V2Wwlc = model->BSIM3V2Wwl;
- if (!model->BSIM3V2WminGiven)
- model->BSIM3V2Wmin = 0.0;
- if (!model->BSIM3V2WmaxGiven)
- model->BSIM3V2Wmax = 1.0;
- if (!model->BSIM3V2dwcGiven)
- model->BSIM3V2dwc = model->BSIM3V2Wint;
- if (!model->BSIM3V2dlcGiven)
- model->BSIM3V2dlc = model->BSIM3V2Lint;
- if (!model->BSIM3V2cfGiven)
- model->BSIM3V2cf = 2.0 * EPSOX / PI
- * log(1.0 + 0.4e-6 / model->BSIM3V2tox);
- if (!model->BSIM3V2cgdoGiven)
- { if (model->BSIM3V2dlcGiven && (model->BSIM3V2dlc > 0.0))
- { model->BSIM3V2cgdo = model->BSIM3V2dlc * model->BSIM3V2cox
- - model->BSIM3V2cgdl ;
- }
- else
- model->BSIM3V2cgdo = 0.6 * model->BSIM3V2xj * model->BSIM3V2cox;
- }
- if (!model->BSIM3V2cgsoGiven)
- { if (model->BSIM3V2dlcGiven && (model->BSIM3V2dlc > 0.0))
- { model->BSIM3V2cgso = model->BSIM3V2dlc * model->BSIM3V2cox
- - model->BSIM3V2cgsl ;
- }
- else
- model->BSIM3V2cgso = 0.6 * model->BSIM3V2xj * model->BSIM3V2cox;
- }
-
- if (!model->BSIM3V2cgboGiven)
- { model->BSIM3V2cgbo = 2.0 * model->BSIM3V2dwc * model->BSIM3V2cox;
- }
- if (!model->BSIM3V2xpartGiven)
- model->BSIM3V2xpart = 0.0;
- if (!model->BSIM3V2sheetResistanceGiven)
- model->BSIM3V2sheetResistance = 0.0;
- if (!model->BSIM3V2unitAreaJctCapGiven)
- model->BSIM3V2unitAreaJctCap = 5.0E-4;
- if (!model->BSIM3V2unitLengthSidewallJctCapGiven)
- model->BSIM3V2unitLengthSidewallJctCap = 5.0E-10;
- if (!model->BSIM3V2unitLengthGateSidewallJctCapGiven)
- model->BSIM3V2unitLengthGateSidewallJctCap = model->BSIM3V2unitLengthSidewallJctCap ;
- if (!model->BSIM3V2jctSatCurDensityGiven)
- model->BSIM3V2jctSatCurDensity = 1.0E-4;
- if (!model->BSIM3V2jctSidewallSatCurDensityGiven)
- model->BSIM3V2jctSidewallSatCurDensity = 0.0;
- if (!model->BSIM3V2bulkJctPotentialGiven)
- model->BSIM3V2bulkJctPotential = 1.0;
- if (!model->BSIM3V2sidewallJctPotentialGiven)
- model->BSIM3V2sidewallJctPotential = 1.0;
- if (!model->BSIM3V2GatesidewallJctPotentialGiven)
- model->BSIM3V2GatesidewallJctPotential = model->BSIM3V2sidewallJctPotential;
- if (!model->BSIM3V2bulkJctBotGradingCoeffGiven)
- model->BSIM3V2bulkJctBotGradingCoeff = 0.5;
- if (!model->BSIM3V2bulkJctSideGradingCoeffGiven)
- model->BSIM3V2bulkJctSideGradingCoeff = 0.33;
- if (!model->BSIM3V2bulkJctGateSideGradingCoeffGiven)
- model->BSIM3V2bulkJctGateSideGradingCoeff = model->BSIM3V2bulkJctSideGradingCoeff;
- if (!model->BSIM3V2jctEmissionCoeffGiven)
- model->BSIM3V2jctEmissionCoeff = 1.0;
- if (!model->BSIM3V2jctTempExponentGiven)
- model->BSIM3V2jctTempExponent = 3.0;
- if (!model->BSIM3V2oxideTrapDensityAGiven)
- { if (model->BSIM3V2type == NMOS)
- model->BSIM3V2oxideTrapDensityA = 1e20;
- else
- model->BSIM3V2oxideTrapDensityA=9.9e18;
- }
- if (!model->BSIM3V2oxideTrapDensityBGiven)
- { if (model->BSIM3V2type == NMOS)
- model->BSIM3V2oxideTrapDensityB = 5e4;
- else
- model->BSIM3V2oxideTrapDensityB = 2.4e3;
- }
- if (!model->BSIM3V2oxideTrapDensityCGiven)
- { if (model->BSIM3V2type == NMOS)
- model->BSIM3V2oxideTrapDensityC = -1.4e-12;
- else
- model->BSIM3V2oxideTrapDensityC = 1.4e-12;
-
- }
- if (!model->BSIM3V2emGiven)
- model->BSIM3V2em = 4.1e7; /* V/m */
- if (!model->BSIM3V2efGiven)
- model->BSIM3V2ef = 1.0;
- if (!model->BSIM3V2afGiven)
- model->BSIM3V2af = 1.0;
- if (!model->BSIM3V2kfGiven)
- model->BSIM3V2kf = 0.0;
- /* loop through all the instances of the model */
- for (here = model->BSIM3V2instances; here != NULL ;
- here=here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2owner == ARCHme) {
- /* allocate a chunk of the state vector */
- here->BSIM3V2states = *states;
- *states += BSIM3V2numStates;
- }
- /* perform the parameter defaulting */
- if (!here->BSIM3V2drainAreaGiven)
- here->BSIM3V2drainArea = 0.0;
- if (!here->BSIM3V2drainPerimeterGiven)
- here->BSIM3V2drainPerimeter = 0.0;
- if (!here->BSIM3V2drainSquaresGiven)
- here->BSIM3V2drainSquares = 1.0;
- if (!here->BSIM3V2icVBSGiven)
- here->BSIM3V2icVBS = 0.0;
- if (!here->BSIM3V2icVDSGiven)
- here->BSIM3V2icVDS = 0.0;
- if (!here->BSIM3V2icVGSGiven)
- here->BSIM3V2icVGS = 0.0;
- if (!here->BSIM3V2lGiven)
- here->BSIM3V2l = 5.0e-6;
- if (!here->BSIM3V2sourceAreaGiven)
- here->BSIM3V2sourceArea = 0.0;
- if (!here->BSIM3V2sourcePerimeterGiven)
- here->BSIM3V2sourcePerimeter = 0.0;
- if (!here->BSIM3V2sourceSquaresGiven)
- here->BSIM3V2sourceSquares = 1.0;
- if (!here->BSIM3V2wGiven)
- here->BSIM3V2w = 5.0e-6;
- if (!here->BSIM3V2nqsModGiven)
- here->BSIM3V2nqsMod = 0;
-
- /* process drain series resistance */
- if ((model->BSIM3V2sheetResistance > 0.0) &&
- (here->BSIM3V2drainSquares > 0.0 ) &&
- (here->BSIM3V2dNodePrime == 0))
- { error = CKTmkVolt(ckt,&tmp,here->BSIM3V2name,"drain");
- if(error) return(error);
- here->BSIM3V2dNodePrime = tmp->number;
- }
- else
- { here->BSIM3V2dNodePrime = here->BSIM3V2dNode;
- }
-
- /* process source series resistance */
- if ((model->BSIM3V2sheetResistance > 0.0) &&
- (here->BSIM3V2sourceSquares > 0.0 ) &&
- (here->BSIM3V2sNodePrime == 0))
- { error = CKTmkVolt(ckt,&tmp,here->BSIM3V2name,"source");
- if(error) return(error);
- here->BSIM3V2sNodePrime = tmp->number;
- }
- else
- { here->BSIM3V2sNodePrime = here->BSIM3V2sNode;
- }
-
- /* internal charge node */
-
- if ((here->BSIM3V2nqsMod) && (here->BSIM3V2qNode == 0))
- { error = CKTmkVolt(ckt,&tmp,here->BSIM3V2name,"charge");
- if(error) return(error);
- here->BSIM3V2qNode = tmp->number;
- }
- else
- { here->BSIM3V2qNode = 0;
- }
-
- /* set Sparse Matrix Pointers */
-
-/* macro to make elements with built in test for out of memory */
-#define TSTALLOC(ptr,first,second) \
-if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NULL){\
- return(E_NOMEM);\
-}
-
- TSTALLOC(BSIM3V2DdPtr, BSIM3V2dNode, BSIM3V2dNode)
- TSTALLOC(BSIM3V2GgPtr, BSIM3V2gNode, BSIM3V2gNode)
- TSTALLOC(BSIM3V2SsPtr, BSIM3V2sNode, BSIM3V2sNode)
- TSTALLOC(BSIM3V2BbPtr, BSIM3V2bNode, BSIM3V2bNode)
- TSTALLOC(BSIM3V2DPdpPtr, BSIM3V2dNodePrime, BSIM3V2dNodePrime)
- TSTALLOC(BSIM3V2SPspPtr, BSIM3V2sNodePrime, BSIM3V2sNodePrime)
- TSTALLOC(BSIM3V2DdpPtr, BSIM3V2dNode, BSIM3V2dNodePrime)
- TSTALLOC(BSIM3V2GbPtr, BSIM3V2gNode, BSIM3V2bNode)
- TSTALLOC(BSIM3V2GdpPtr, BSIM3V2gNode, BSIM3V2dNodePrime)
- TSTALLOC(BSIM3V2GspPtr, BSIM3V2gNode, BSIM3V2sNodePrime)
- TSTALLOC(BSIM3V2SspPtr, BSIM3V2sNode, BSIM3V2sNodePrime)
- TSTALLOC(BSIM3V2BdpPtr, BSIM3V2bNode, BSIM3V2dNodePrime)
- TSTALLOC(BSIM3V2BspPtr, BSIM3V2bNode, BSIM3V2sNodePrime)
- TSTALLOC(BSIM3V2DPspPtr, BSIM3V2dNodePrime, BSIM3V2sNodePrime)
- TSTALLOC(BSIM3V2DPdPtr, BSIM3V2dNodePrime, BSIM3V2dNode)
- TSTALLOC(BSIM3V2BgPtr, BSIM3V2bNode, BSIM3V2gNode)
- TSTALLOC(BSIM3V2DPgPtr, BSIM3V2dNodePrime, BSIM3V2gNode)
- TSTALLOC(BSIM3V2SPgPtr, BSIM3V2sNodePrime, BSIM3V2gNode)
- TSTALLOC(BSIM3V2SPsPtr, BSIM3V2sNodePrime, BSIM3V2sNode)
- TSTALLOC(BSIM3V2DPbPtr, BSIM3V2dNodePrime, BSIM3V2bNode)
- TSTALLOC(BSIM3V2SPbPtr, BSIM3V2sNodePrime, BSIM3V2bNode)
- TSTALLOC(BSIM3V2SPdpPtr, BSIM3V2sNodePrime, BSIM3V2dNodePrime)
-
- TSTALLOC(BSIM3V2QqPtr, BSIM3V2qNode, BSIM3V2qNode)
-
- TSTALLOC(BSIM3V2QdpPtr, BSIM3V2qNode, BSIM3V2dNodePrime)
- TSTALLOC(BSIM3V2QspPtr, BSIM3V2qNode, BSIM3V2sNodePrime)
- TSTALLOC(BSIM3V2QgPtr, BSIM3V2qNode, BSIM3V2gNode)
- TSTALLOC(BSIM3V2QbPtr, BSIM3V2qNode, BSIM3V2bNode)
- TSTALLOC(BSIM3V2DPqPtr, BSIM3V2dNodePrime, BSIM3V2qNode)
- TSTALLOC(BSIM3V2SPqPtr, BSIM3V2sNodePrime, BSIM3V2qNode)
- TSTALLOC(BSIM3V2GqPtr, BSIM3V2gNode, BSIM3V2qNode)
- TSTALLOC(BSIM3V2BqPtr, BSIM3V2bNode, BSIM3V2qNode)
-
- }
- }
- return(OK);
-}
-
-
-int
-BSIM3V2unsetup(inModel,ckt)
- GENmodel *inModel;
- CKTcircuit *ckt;
-{
- BSIM3V2model *model;
- BSIM3V2instance *here;
-
- for (model = (BSIM3V2model *)inModel; model != NULL;
- model = model->BSIM3V2nextModel)
- {
- for (here = model->BSIM3V2instances; here != NULL;
- here=here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2dNodePrime
- && here->BSIM3V2dNodePrime != here->BSIM3V2dNode)
- {
- CKTdltNNum(ckt, here->BSIM3V2dNodePrime);
- here->BSIM3V2dNodePrime = 0;
- }
- if (here->BSIM3V2sNodePrime
- && here->BSIM3V2sNodePrime != here->BSIM3V2sNode)
- {
- CKTdltNNum(ckt, here->BSIM3V2sNodePrime);
- here->BSIM3V2sNodePrime = 0;
- }
- }
- }
- return OK;
-}
diff --git a/src/spicelib/devices/bsim3v2/b3v2temp.c b/src/spicelib/devices/bsim3v2/b3v2temp.c
deleted file mode 100644
index ea14780a3..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2temp.c
+++ /dev/null
@@ -1,846 +0,0 @@
-/***********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: b3v2temp.c
-**********/
-/* Lmin, Lmax, Wmin, Wmax */
-
-#include "ngspice.h"
-#include
-#include
-#include "smpdefs.h"
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "const.h"
-#include "sperror.h"
-#include "suffix.h"
-
-#define Kb 1.3806226e-23
-#define KboQ 8.617087e-5 /* Kb / q where q = 1.60219e-19 */
-#define EPSOX 3.453133e-11
-#define EPSSI 1.03594e-10
-#define PI 3.141592654
-#define MAX_EXP 5.834617425e14
-#define MIN_EXP 1.713908431e-15
-#define EXP_THRESHOLD 34.0
-#define Charge_q 1.60219e-19
-
-
-/* ARGSUSED */
-int
-BSIM3V2temp(inModel,ckt)
-GENmodel *inModel;
-CKTcircuit *ckt;
-{
-BSIM3V2model *model = (BSIM3V2model*) inModel;
-BSIM3V2instance *here;
-struct BSIM3V2SizeDependParam *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, Dw, Dl, Vtm0, Tnom;
-double Nvtm, SourceSatCurrent, DrainSatCurrent;
-int Size_Not_Found;
-
- /* loop through all the BSIM3V2 device models */
- for (; model != NULL; model = model->BSIM3V2nextModel)
- { Temp = ckt->CKTtemp;
- if (model->BSIM3V2bulkJctPotential < 0.1)
- { model->BSIM3V2bulkJctPotential = 0.1;
- fprintf(stderr, "Given pb is less than 0.1. Pb is set to 0.1.\n");
- }
- if (model->BSIM3V2sidewallJctPotential < 0.1)
- { model->BSIM3V2sidewallJctPotential = 0.1;
- fprintf(stderr, "Given pbsw is less than 0.1. Pbsw is set to 0.1.\n");
- }
- if (model->BSIM3V2GatesidewallJctPotential < 0.1)
- { model->BSIM3V2GatesidewallJctPotential = 0.1;
- fprintf(stderr, "Given pbswg is less than 0.1. Pbswg is set to 0.1.\n");
- }
- model->pSizeDependParamKnot = NULL;
- pLastKnot = NULL;
-
- Tnom = model->BSIM3V2tnom;
- TRatio = Temp / Tnom;
-
- model->BSIM3V2vcrit = CONSTvt0 * log(CONSTvt0 / (CONSTroot2 * 1.0e-14));
- model->BSIM3V2factor1 = sqrt(EPSSI / EPSOX * model->BSIM3V2tox);
-
- Vtm0 = KboQ * Tnom;
- Eg0 = 1.16 - 7.02e-4 * Tnom * Tnom / (Tnom + 1108.0);
- ni = 1.45e10 * (Tnom / 300.15) * sqrt(Tnom / 300.15)
- * exp(21.5565981 - Eg0 / (2.0 * Vtm0));
-
- model->BSIM3V2vtm = KboQ * Temp;
- Eg = 1.16 - 7.02e-4 * Temp * Temp / (Temp + 1108.0);
- if (Temp != Tnom)
- { T0 = Eg0 / Vtm0 - Eg / model->BSIM3V2vtm + model->BSIM3V2jctTempExponent
- * log(Temp / Tnom);
- T1 = exp(T0 / model->BSIM3V2jctEmissionCoeff);
- model->BSIM3V2jctTempSatCurDensity = model->BSIM3V2jctSatCurDensity
- * T1;
- model->BSIM3V2jctSidewallTempSatCurDensity
- = model->BSIM3V2jctSidewallSatCurDensity * T1;
- }
- else
- { model->BSIM3V2jctTempSatCurDensity = model->BSIM3V2jctSatCurDensity;
- model->BSIM3V2jctSidewallTempSatCurDensity
- = model->BSIM3V2jctSidewallSatCurDensity;
- }
-
- if (model->BSIM3V2jctTempSatCurDensity < 0.0)
- model->BSIM3V2jctTempSatCurDensity = 0.0;
- if (model->BSIM3V2jctSidewallTempSatCurDensity < 0.0)
- model->BSIM3V2jctSidewallTempSatCurDensity = 0.0;
-
- /* Temperature dependence of D/B and S/B diode capacitance begins */
- delTemp = ckt->CKTtemp - model->BSIM3V2tnom;
- T0 = model->BSIM3V2tcj * delTemp;
- if (T0 >= -1.0)
- { model->BSIM3V2unitAreaJctCap *= 1.0 + T0;
- }
- else if (model->BSIM3V2unitAreaJctCap > 0.0)
- { model->BSIM3V2unitAreaJctCap = 0.0;
- fprintf(stderr, "Temperature effect has caused cj to be negative. Cj is clamped to zero.\n");
- }
- T0 = model->BSIM3V2tcjsw * delTemp;
- if (T0 >= -1.0)
- { model->BSIM3V2unitLengthSidewallJctCap *= 1.0 + T0;
- }
- else if (model->BSIM3V2unitLengthSidewallJctCap > 0.0)
- { model->BSIM3V2unitLengthSidewallJctCap = 0.0;
- fprintf(stderr, "Temperature effect has caused cjsw to be negative. Cjsw is clamped to zero.\n");
- }
- T0 = model->BSIM3V2tcjswg * delTemp;
- if (T0 >= -1.0)
- { model->BSIM3V2unitLengthGateSidewallJctCap *= 1.0 + T0;
- }
- else if (model->BSIM3V2unitLengthGateSidewallJctCap > 0.0)
- { model->BSIM3V2unitLengthGateSidewallJctCap = 0.0;
- fprintf(stderr, "Temperature effect has caused cjswg to be negative. Cjswg is clamped to zero.\n");
- }
-
- model->BSIM3V2PhiB = model->BSIM3V2bulkJctPotential
- - model->BSIM3V2tpb * delTemp;
- if (model->BSIM3V2PhiB < 0.01)
- { model->BSIM3V2PhiB = 0.01;
- fprintf(stderr, "Temperature effect has caused pb to be less than 0.01. Pb is clamped to 0.01.\n");
- }
- model->BSIM3V2PhiBSW = model->BSIM3V2sidewallJctPotential
- - model->BSIM3V2tpbsw * delTemp;
- if (model->BSIM3V2PhiBSW <= 0.01)
- { model->BSIM3V2PhiBSW = 0.01;
- fprintf(stderr, "Temperature effect has caused pbsw to be less than 0.01. Pbsw is clamped to 0.01.\n");
- }
- model->BSIM3V2PhiBSWG = model->BSIM3V2GatesidewallJctPotential
- - model->BSIM3V2tpbswg * delTemp;
- if (model->BSIM3V2PhiBSWG <= 0.01)
- { model->BSIM3V2PhiBSWG = 0.01;
- fprintf(stderr, "Temperature effect has caused pbswg to be less than 0.01. Pbswg is clamped to 0.01.\n");
- }
- /* End of junction capacitance - Weidong & Min-Chie 5/1998 */
-
- /* loop through all the instances of the model */
- /* MCJ: Length and Width not initialized */
- for (here = model->BSIM3V2instances; here != NULL;
- here = here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2owner != ARCHme) continue;
- pSizeDependParamKnot = model->pSizeDependParamKnot;
- Size_Not_Found = 1;
- while ((pSizeDependParamKnot != NULL) && Size_Not_Found)
- { if ((here->BSIM3V2l == pSizeDependParamKnot->Length)
- && (here->BSIM3V2w == pSizeDependParamKnot->Width))
- { Size_Not_Found = 0;
- here->pParam = pSizeDependParamKnot;
- }
- else
- { pLastKnot = pSizeDependParamKnot;
- pSizeDependParamKnot = pSizeDependParamKnot->pNext;
- }
- }
-
- if (Size_Not_Found)
- { pParam = (struct BSIM3V2SizeDependParam *)tmalloc(
- sizeof(struct BSIM3V2SizeDependParam));
- if (pLastKnot == NULL)
- model->pSizeDependParamKnot = pParam;
- else
- pLastKnot->pNext = pParam;
- pParam->pNext = NULL;
- here->pParam = pParam;
-
- Ldrn = here->BSIM3V2l;
- Wdrn = here->BSIM3V2w;
- pParam->Length = Ldrn;
- pParam->Width = Wdrn;
-
- T0 = pow(Ldrn, model->BSIM3V2Lln);
- T1 = pow(Wdrn, model->BSIM3V2Lwn);
- tmp1 = model->BSIM3V2Ll / T0 + model->BSIM3V2Lw / T1
- + model->BSIM3V2Lwl / (T0 * T1);
- pParam->BSIM3V2dl = model->BSIM3V2Lint + tmp1;
- tmp2 = model->BSIM3V2Llc / T0 + model->BSIM3V2Lwc / T1
- + model->BSIM3V2Lwlc / (T0 * T1);
- pParam->BSIM3V2dlc = model->BSIM3V2dlc + tmp2;
-
- T2 = pow(Ldrn, model->BSIM3V2Wln);
- T3 = pow(Wdrn, model->BSIM3V2Wwn);
- tmp1 = model->BSIM3V2Wl / T2 + model->BSIM3V2Ww / T3
- + model->BSIM3V2Wwl / (T2 * T3);
- pParam->BSIM3V2dw = model->BSIM3V2Wint + tmp1;
- tmp2 = model->BSIM3V2Wlc / T2 + model->BSIM3V2Wwc / T3
- + model->BSIM3V2Wwlc / (T2 * T3);
- pParam->BSIM3V2dwc = model->BSIM3V2dwc + tmp2;
-
- pParam->BSIM3V2leff = here->BSIM3V2l - 2.0 * pParam->BSIM3V2dl;
- if (pParam->BSIM3V2leff <= 0.0)
- { IFuid namarray[2];
- namarray[0] = model->BSIM3V2modName;
- namarray[1] = here->BSIM3V2name;
- (*(SPfrontEnd->IFerror))(ERR_FATAL,
- "BSIM3V2: mosfet %s, model %s: Effective channel length <= 0",
- namarray);
- return(E_BADPARM);
- }
-
- pParam->BSIM3V2weff = here->BSIM3V2w - 2.0 * pParam->BSIM3V2dw;
- if (pParam->BSIM3V2weff <= 0.0)
- { IFuid namarray[2];
- namarray[0] = model->BSIM3V2modName;
- namarray[1] = here->BSIM3V2name;
- (*(SPfrontEnd->IFerror))(ERR_FATAL,
- "BSIM3V2: mosfet %s, model %s: Effective channel width <= 0",
- namarray);
- return(E_BADPARM);
- }
-
- pParam->BSIM3V2leffCV = here->BSIM3V2l - 2.0 * pParam->BSIM3V2dlc;
- if (pParam->BSIM3V2leffCV <= 0.0)
- { IFuid namarray[2];
- namarray[0] = model->BSIM3V2modName;
- namarray[1] = here->BSIM3V2name;
- (*(SPfrontEnd->IFerror))(ERR_FATAL,
- "BSIM3V2: mosfet %s, model %s: Effective channel length for C-V <= 0",
- namarray);
- return(E_BADPARM);
- }
-
- pParam->BSIM3V2weffCV = here->BSIM3V2w - 2.0 * pParam->BSIM3V2dwc;
- if (pParam->BSIM3V2weffCV <= 0.0)
- { IFuid namarray[2];
- namarray[0] = model->BSIM3V2modName;
- namarray[1] = here->BSIM3V2name;
- (*(SPfrontEnd->IFerror))(ERR_FATAL,
- "BSIM3V2: mosfet %s, model %s: Effective channel width for C-V <= 0",
- namarray);
- return(E_BADPARM);
- }
-
-
- if (model->BSIM3V2binUnit == 1)
- { Inv_L = 1.0e-6 / pParam->BSIM3V2leff;
- Inv_W = 1.0e-6 / pParam->BSIM3V2weff;
- Inv_LW = 1.0e-12 / (pParam->BSIM3V2leff
- * pParam->BSIM3V2weff);
- }
- else
- { Inv_L = 1.0 / pParam->BSIM3V2leff;
- Inv_W = 1.0 / pParam->BSIM3V2weff;
- Inv_LW = 1.0 / (pParam->BSIM3V2leff
- * pParam->BSIM3V2weff);
- }
- pParam->BSIM3V2cdsc = model->BSIM3V2cdsc
- + model->BSIM3V2lcdsc * Inv_L
- + model->BSIM3V2wcdsc * Inv_W
- + model->BSIM3V2pcdsc * Inv_LW;
- pParam->BSIM3V2cdscb = model->BSIM3V2cdscb
- + model->BSIM3V2lcdscb * Inv_L
- + model->BSIM3V2wcdscb * Inv_W
- + model->BSIM3V2pcdscb * Inv_LW;
-
- pParam->BSIM3V2cdscd = model->BSIM3V2cdscd
- + model->BSIM3V2lcdscd * Inv_L
- + model->BSIM3V2wcdscd * Inv_W
- + model->BSIM3V2pcdscd * Inv_LW;
-
- pParam->BSIM3V2cit = model->BSIM3V2cit
- + model->BSIM3V2lcit * Inv_L
- + model->BSIM3V2wcit * Inv_W
- + model->BSIM3V2pcit * Inv_LW;
- pParam->BSIM3V2nfactor = model->BSIM3V2nfactor
- + model->BSIM3V2lnfactor * Inv_L
- + model->BSIM3V2wnfactor * Inv_W
- + model->BSIM3V2pnfactor * Inv_LW;
- pParam->BSIM3V2xj = model->BSIM3V2xj
- + model->BSIM3V2lxj * Inv_L
- + model->BSIM3V2wxj * Inv_W
- + model->BSIM3V2pxj * Inv_LW;
- pParam->BSIM3V2vsat = model->BSIM3V2vsat
- + model->BSIM3V2lvsat * Inv_L
- + model->BSIM3V2wvsat * Inv_W
- + model->BSIM3V2pvsat * Inv_LW;
- pParam->BSIM3V2at = model->BSIM3V2at
- + model->BSIM3V2lat * Inv_L
- + model->BSIM3V2wat * Inv_W
- + model->BSIM3V2pat * Inv_LW;
- pParam->BSIM3V2a0 = model->BSIM3V2a0
- + model->BSIM3V2la0 * Inv_L
- + model->BSIM3V2wa0 * Inv_W
- + model->BSIM3V2pa0 * Inv_LW;
-
- pParam->BSIM3V2ags = model->BSIM3V2ags
- + model->BSIM3V2lags * Inv_L
- + model->BSIM3V2wags * Inv_W
- + model->BSIM3V2pags * Inv_LW;
-
- pParam->BSIM3V2a1 = model->BSIM3V2a1
- + model->BSIM3V2la1 * Inv_L
- + model->BSIM3V2wa1 * Inv_W
- + model->BSIM3V2pa1 * Inv_LW;
- pParam->BSIM3V2a2 = model->BSIM3V2a2
- + model->BSIM3V2la2 * Inv_L
- + model->BSIM3V2wa2 * Inv_W
- + model->BSIM3V2pa2 * Inv_LW;
- pParam->BSIM3V2keta = model->BSIM3V2keta
- + model->BSIM3V2lketa * Inv_L
- + model->BSIM3V2wketa * Inv_W
- + model->BSIM3V2pketa * Inv_LW;
- pParam->BSIM3V2nsub = model->BSIM3V2nsub
- + model->BSIM3V2lnsub * Inv_L
- + model->BSIM3V2wnsub * Inv_W
- + model->BSIM3V2pnsub * Inv_LW;
- pParam->BSIM3V2npeak = model->BSIM3V2npeak
- + model->BSIM3V2lnpeak * Inv_L
- + model->BSIM3V2wnpeak * Inv_W
- + model->BSIM3V2pnpeak * Inv_LW;
- pParam->BSIM3V2ngate = model->BSIM3V2ngate
- + model->BSIM3V2lngate * Inv_L
- + model->BSIM3V2wngate * Inv_W
- + model->BSIM3V2pngate * Inv_LW;
- pParam->BSIM3V2gamma1 = model->BSIM3V2gamma1
- + model->BSIM3V2lgamma1 * Inv_L
- + model->BSIM3V2wgamma1 * Inv_W
- + model->BSIM3V2pgamma1 * Inv_LW;
- pParam->BSIM3V2gamma2 = model->BSIM3V2gamma2
- + model->BSIM3V2lgamma2 * Inv_L
- + model->BSIM3V2wgamma2 * Inv_W
- + model->BSIM3V2pgamma2 * Inv_LW;
- pParam->BSIM3V2vbx = model->BSIM3V2vbx
- + model->BSIM3V2lvbx * Inv_L
- + model->BSIM3V2wvbx * Inv_W
- + model->BSIM3V2pvbx * Inv_LW;
- pParam->BSIM3V2vbm = model->BSIM3V2vbm
- + model->BSIM3V2lvbm * Inv_L
- + model->BSIM3V2wvbm * Inv_W
- + model->BSIM3V2pvbm * Inv_LW;
- pParam->BSIM3V2xt = model->BSIM3V2xt
- + model->BSIM3V2lxt * Inv_L
- + model->BSIM3V2wxt * Inv_W
- + model->BSIM3V2pxt * Inv_LW;
- pParam->BSIM3V2vfb = model->BSIM3V2vfb
- + model->BSIM3V2lvfb * Inv_L
- + model->BSIM3V2wvfb * Inv_W
- + model->BSIM3V2pvfb * Inv_LW;
- pParam->BSIM3V2k1 = model->BSIM3V2k1
- + model->BSIM3V2lk1 * Inv_L
- + model->BSIM3V2wk1 * Inv_W
- + model->BSIM3V2pk1 * Inv_LW;
- pParam->BSIM3V2kt1 = model->BSIM3V2kt1
- + model->BSIM3V2lkt1 * Inv_L
- + model->BSIM3V2wkt1 * Inv_W
- + model->BSIM3V2pkt1 * Inv_LW;
- pParam->BSIM3V2kt1l = model->BSIM3V2kt1l
- + model->BSIM3V2lkt1l * Inv_L
- + model->BSIM3V2wkt1l * Inv_W
- + model->BSIM3V2pkt1l * Inv_LW;
- pParam->BSIM3V2k2 = model->BSIM3V2k2
- + model->BSIM3V2lk2 * Inv_L
- + model->BSIM3V2wk2 * Inv_W
- + model->BSIM3V2pk2 * Inv_LW;
- pParam->BSIM3V2kt2 = model->BSIM3V2kt2
- + model->BSIM3V2lkt2 * Inv_L
- + model->BSIM3V2wkt2 * Inv_W
- + model->BSIM3V2pkt2 * Inv_LW;
- pParam->BSIM3V2k3 = model->BSIM3V2k3
- + model->BSIM3V2lk3 * Inv_L
- + model->BSIM3V2wk3 * Inv_W
- + model->BSIM3V2pk3 * Inv_LW;
- pParam->BSIM3V2k3b = model->BSIM3V2k3b
- + model->BSIM3V2lk3b * Inv_L
- + model->BSIM3V2wk3b * Inv_W
- + model->BSIM3V2pk3b * Inv_LW;
- pParam->BSIM3V2w0 = model->BSIM3V2w0
- + model->BSIM3V2lw0 * Inv_L
- + model->BSIM3V2ww0 * Inv_W
- + model->BSIM3V2pw0 * Inv_LW;
- pParam->BSIM3V2nlx = model->BSIM3V2nlx
- + model->BSIM3V2lnlx * Inv_L
- + model->BSIM3V2wnlx * Inv_W
- + model->BSIM3V2pnlx * Inv_LW;
- pParam->BSIM3V2dvt0 = model->BSIM3V2dvt0
- + model->BSIM3V2ldvt0 * Inv_L
- + model->BSIM3V2wdvt0 * Inv_W
- + model->BSIM3V2pdvt0 * Inv_LW;
- pParam->BSIM3V2dvt1 = model->BSIM3V2dvt1
- + model->BSIM3V2ldvt1 * Inv_L
- + model->BSIM3V2wdvt1 * Inv_W
- + model->BSIM3V2pdvt1 * Inv_LW;
- pParam->BSIM3V2dvt2 = model->BSIM3V2dvt2
- + model->BSIM3V2ldvt2 * Inv_L
- + model->BSIM3V2wdvt2 * Inv_W
- + model->BSIM3V2pdvt2 * Inv_LW;
- pParam->BSIM3V2dvt0w = model->BSIM3V2dvt0w
- + model->BSIM3V2ldvt0w * Inv_L
- + model->BSIM3V2wdvt0w * Inv_W
- + model->BSIM3V2pdvt0w * Inv_LW;
- pParam->BSIM3V2dvt1w = model->BSIM3V2dvt1w
- + model->BSIM3V2ldvt1w * Inv_L
- + model->BSIM3V2wdvt1w * Inv_W
- + model->BSIM3V2pdvt1w * Inv_LW;
- pParam->BSIM3V2dvt2w = model->BSIM3V2dvt2w
- + model->BSIM3V2ldvt2w * Inv_L
- + model->BSIM3V2wdvt2w * Inv_W
- + model->BSIM3V2pdvt2w * Inv_LW;
- pParam->BSIM3V2drout = model->BSIM3V2drout
- + model->BSIM3V2ldrout * Inv_L
- + model->BSIM3V2wdrout * Inv_W
- + model->BSIM3V2pdrout * Inv_LW;
- pParam->BSIM3V2dsub = model->BSIM3V2dsub
- + model->BSIM3V2ldsub * Inv_L
- + model->BSIM3V2wdsub * Inv_W
- + model->BSIM3V2pdsub * Inv_LW;
- pParam->BSIM3V2vth0 = model->BSIM3V2vth0
- + model->BSIM3V2lvth0 * Inv_L
- + model->BSIM3V2wvth0 * Inv_W
- + model->BSIM3V2pvth0 * Inv_LW;
- pParam->BSIM3V2ua = model->BSIM3V2ua
- + model->BSIM3V2lua * Inv_L
- + model->BSIM3V2wua * Inv_W
- + model->BSIM3V2pua * Inv_LW;
- pParam->BSIM3V2ua1 = model->BSIM3V2ua1
- + model->BSIM3V2lua1 * Inv_L
- + model->BSIM3V2wua1 * Inv_W
- + model->BSIM3V2pua1 * Inv_LW;
- pParam->BSIM3V2ub = model->BSIM3V2ub
- + model->BSIM3V2lub * Inv_L
- + model->BSIM3V2wub * Inv_W
- + model->BSIM3V2pub * Inv_LW;
- pParam->BSIM3V2ub1 = model->BSIM3V2ub1
- + model->BSIM3V2lub1 * Inv_L
- + model->BSIM3V2wub1 * Inv_W
- + model->BSIM3V2pub1 * Inv_LW;
- pParam->BSIM3V2uc = model->BSIM3V2uc
- + model->BSIM3V2luc * Inv_L
- + model->BSIM3V2wuc * Inv_W
- + model->BSIM3V2puc * Inv_LW;
- pParam->BSIM3V2uc1 = model->BSIM3V2uc1
- + model->BSIM3V2luc1 * Inv_L
- + model->BSIM3V2wuc1 * Inv_W
- + model->BSIM3V2puc1 * Inv_LW;
- pParam->BSIM3V2u0 = model->BSIM3V2u0
- + model->BSIM3V2lu0 * Inv_L
- + model->BSIM3V2wu0 * Inv_W
- + model->BSIM3V2pu0 * Inv_LW;
- pParam->BSIM3V2ute = model->BSIM3V2ute
- + model->BSIM3V2lute * Inv_L
- + model->BSIM3V2wute * Inv_W
- + model->BSIM3V2pute * Inv_LW;
- pParam->BSIM3V2voff = model->BSIM3V2voff
- + model->BSIM3V2lvoff * Inv_L
- + model->BSIM3V2wvoff * Inv_W
- + model->BSIM3V2pvoff * Inv_LW;
- pParam->BSIM3V2delta = model->BSIM3V2delta
- + model->BSIM3V2ldelta * Inv_L
- + model->BSIM3V2wdelta * Inv_W
- + model->BSIM3V2pdelta * Inv_LW;
- pParam->BSIM3V2rdsw = model->BSIM3V2rdsw
- + model->BSIM3V2lrdsw * Inv_L
- + model->BSIM3V2wrdsw * Inv_W
- + model->BSIM3V2prdsw * Inv_LW;
- pParam->BSIM3V2prwg = model->BSIM3V2prwg
- + model->BSIM3V2lprwg * Inv_L
- + model->BSIM3V2wprwg * Inv_W
- + model->BSIM3V2pprwg * Inv_LW;
- pParam->BSIM3V2prwb = model->BSIM3V2prwb
- + model->BSIM3V2lprwb * Inv_L
- + model->BSIM3V2wprwb * Inv_W
- + model->BSIM3V2pprwb * Inv_LW;
- pParam->BSIM3V2prt = model->BSIM3V2prt
- + model->BSIM3V2lprt * Inv_L
- + model->BSIM3V2wprt * Inv_W
- + model->BSIM3V2pprt * Inv_LW;
- pParam->BSIM3V2eta0 = model->BSIM3V2eta0
- + model->BSIM3V2leta0 * Inv_L
- + model->BSIM3V2weta0 * Inv_W
- + model->BSIM3V2peta0 * Inv_LW;
- pParam->BSIM3V2etab = model->BSIM3V2etab
- + model->BSIM3V2letab * Inv_L
- + model->BSIM3V2wetab * Inv_W
- + model->BSIM3V2petab * Inv_LW;
- pParam->BSIM3V2pclm = model->BSIM3V2pclm
- + model->BSIM3V2lpclm * Inv_L
- + model->BSIM3V2wpclm * Inv_W
- + model->BSIM3V2ppclm * Inv_LW;
- pParam->BSIM3V2pdibl1 = model->BSIM3V2pdibl1
- + model->BSIM3V2lpdibl1 * Inv_L
- + model->BSIM3V2wpdibl1 * Inv_W
- + model->BSIM3V2ppdibl1 * Inv_LW;
- pParam->BSIM3V2pdibl2 = model->BSIM3V2pdibl2
- + model->BSIM3V2lpdibl2 * Inv_L
- + model->BSIM3V2wpdibl2 * Inv_W
- + model->BSIM3V2ppdibl2 * Inv_LW;
- pParam->BSIM3V2pdiblb = model->BSIM3V2pdiblb
- + model->BSIM3V2lpdiblb * Inv_L
- + model->BSIM3V2wpdiblb * Inv_W
- + model->BSIM3V2ppdiblb * Inv_LW;
- pParam->BSIM3V2pscbe1 = model->BSIM3V2pscbe1
- + model->BSIM3V2lpscbe1 * Inv_L
- + model->BSIM3V2wpscbe1 * Inv_W
- + model->BSIM3V2ppscbe1 * Inv_LW;
- pParam->BSIM3V2pscbe2 = model->BSIM3V2pscbe2
- + model->BSIM3V2lpscbe2 * Inv_L
- + model->BSIM3V2wpscbe2 * Inv_W
- + model->BSIM3V2ppscbe2 * Inv_LW;
- pParam->BSIM3V2pvag = model->BSIM3V2pvag
- + model->BSIM3V2lpvag * Inv_L
- + model->BSIM3V2wpvag * Inv_W
- + model->BSIM3V2ppvag * Inv_LW;
- pParam->BSIM3V2wr = model->BSIM3V2wr
- + model->BSIM3V2lwr * Inv_L
- + model->BSIM3V2wwr * Inv_W
- + model->BSIM3V2pwr * Inv_LW;
- pParam->BSIM3V2dwg = model->BSIM3V2dwg
- + model->BSIM3V2ldwg * Inv_L
- + model->BSIM3V2wdwg * Inv_W
- + model->BSIM3V2pdwg * Inv_LW;
- pParam->BSIM3V2dwb = model->BSIM3V2dwb
- + model->BSIM3V2ldwb * Inv_L
- + model->BSIM3V2wdwb * Inv_W
- + model->BSIM3V2pdwb * Inv_LW;
- pParam->BSIM3V2b0 = model->BSIM3V2b0
- + model->BSIM3V2lb0 * Inv_L
- + model->BSIM3V2wb0 * Inv_W
- + model->BSIM3V2pb0 * Inv_LW;
- pParam->BSIM3V2b1 = model->BSIM3V2b1
- + model->BSIM3V2lb1 * Inv_L
- + model->BSIM3V2wb1 * Inv_W
- + model->BSIM3V2pb1 * Inv_LW;
- pParam->BSIM3V2alpha0 = model->BSIM3V2alpha0
- + model->BSIM3V2lalpha0 * Inv_L
- + model->BSIM3V2walpha0 * Inv_W
- + model->BSIM3V2palpha0 * Inv_LW;
- pParam->BSIM3V2alpha1 = model->BSIM3V2alpha1
- + model->BSIM3V2lalpha1 * Inv_L
- + model->BSIM3V2walpha1 * Inv_W
- + model->BSIM3V2palpha1 * Inv_LW;
- pParam->BSIM3V2beta0 = model->BSIM3V2beta0
- + model->BSIM3V2lbeta0 * Inv_L
- + model->BSIM3V2wbeta0 * Inv_W
- + model->BSIM3V2pbeta0 * Inv_LW;
- /* CV model */
- pParam->BSIM3V2elm = model->BSIM3V2elm
- + model->BSIM3V2lelm * Inv_L
- + model->BSIM3V2welm * Inv_W
- + model->BSIM3V2pelm * Inv_LW;
- pParam->BSIM3V2cgsl = model->BSIM3V2cgsl
- + model->BSIM3V2lcgsl * Inv_L
- + model->BSIM3V2wcgsl * Inv_W
- + model->BSIM3V2pcgsl * Inv_LW;
- pParam->BSIM3V2cgdl = model->BSIM3V2cgdl
- + model->BSIM3V2lcgdl * Inv_L
- + model->BSIM3V2wcgdl * Inv_W
- + model->BSIM3V2pcgdl * Inv_LW;
- pParam->BSIM3V2ckappa = model->BSIM3V2ckappa
- + model->BSIM3V2lckappa * Inv_L
- + model->BSIM3V2wckappa * Inv_W
- + model->BSIM3V2pckappa * Inv_LW;
- pParam->BSIM3V2cf = model->BSIM3V2cf
- + model->BSIM3V2lcf * Inv_L
- + model->BSIM3V2wcf * Inv_W
- + model->BSIM3V2pcf * Inv_LW;
- pParam->BSIM3V2clc = model->BSIM3V2clc
- + model->BSIM3V2lclc * Inv_L
- + model->BSIM3V2wclc * Inv_W
- + model->BSIM3V2pclc * Inv_LW;
- pParam->BSIM3V2cle = model->BSIM3V2cle
- + model->BSIM3V2lcle * Inv_L
- + model->BSIM3V2wcle * Inv_W
- + model->BSIM3V2pcle * Inv_LW;
- pParam->BSIM3V2vfbcv = model->BSIM3V2vfbcv
- + model->BSIM3V2lvfbcv * Inv_L
- + model->BSIM3V2wvfbcv * Inv_W
- + model->BSIM3V2pvfbcv * Inv_LW;
- pParam->BSIM3V2acde = model->BSIM3V2acde
- + model->BSIM3V2lacde * Inv_L
- + model->BSIM3V2wacde * Inv_W
- + model->BSIM3V2pacde * Inv_LW;
- pParam->BSIM3V2moin = model->BSIM3V2moin
- + model->BSIM3V2lmoin * Inv_L
- + model->BSIM3V2wmoin * Inv_W
- + model->BSIM3V2pmoin * Inv_LW;
- pParam->BSIM3V2noff = model->BSIM3V2noff
- + model->BSIM3V2lnoff * Inv_L
- + model->BSIM3V2wnoff * Inv_W
- + model->BSIM3V2pnoff * Inv_LW;
- pParam->BSIM3V2voffcv = model->BSIM3V2voffcv
- + model->BSIM3V2lvoffcv * Inv_L
- + model->BSIM3V2wvoffcv * Inv_W
- + model->BSIM3V2pvoffcv * Inv_LW;
-
- pParam->BSIM3V2abulkCVfactor = 1.0 + pow((pParam->BSIM3V2clc
- / pParam->BSIM3V2leffCV),
- pParam->BSIM3V2cle);
-
- T0 = (TRatio - 1.0);
- pParam->BSIM3V2ua = pParam->BSIM3V2ua + pParam->BSIM3V2ua1 * T0;
- pParam->BSIM3V2ub = pParam->BSIM3V2ub + pParam->BSIM3V2ub1 * T0;
- pParam->BSIM3V2uc = pParam->BSIM3V2uc + pParam->BSIM3V2uc1 * T0;
- if (pParam->BSIM3V2u0 > 1.0)
- pParam->BSIM3V2u0 = pParam->BSIM3V2u0 / 1.0e4;
-
- pParam->BSIM3V2u0temp = pParam->BSIM3V2u0
- * pow(TRatio, pParam->BSIM3V2ute);
- pParam->BSIM3V2vsattemp = pParam->BSIM3V2vsat - pParam->BSIM3V2at
- * T0;
- pParam->BSIM3V2rds0 = (pParam->BSIM3V2rdsw + pParam->BSIM3V2prt * T0)
- / pow(pParam->BSIM3V2weff * 1E6, pParam->BSIM3V2wr);
-
- if (BSIM3V2checkModel(model, here, ckt))
- { IFuid namarray[2];
- namarray[0] = model->BSIM3V2modName;
- namarray[1] = here->BSIM3V2name;
- (*(SPfrontEnd->IFerror)) (ERR_FATAL, "Fatal error(s) detected during BSIM3V2V3.2 parameter checking for %s in model %s", namarray);
- return(E_BADPARM);
- }
-
- pParam->BSIM3V2cgdo = (model->BSIM3V2cgdo + pParam->BSIM3V2cf)
- * pParam->BSIM3V2weffCV;
- pParam->BSIM3V2cgso = (model->BSIM3V2cgso + pParam->BSIM3V2cf)
- * pParam->BSIM3V2weffCV;
- pParam->BSIM3V2cgbo = model->BSIM3V2cgbo * pParam->BSIM3V2leffCV;
-
- T0 = pParam->BSIM3V2leffCV * pParam->BSIM3V2leffCV;
- pParam->BSIM3V2tconst = pParam->BSIM3V2u0temp * pParam->BSIM3V2elm / (model->BSIM3V2cox
- * pParam->BSIM3V2weffCV * pParam->BSIM3V2leffCV * T0);
-
- if (!model->BSIM3V2npeakGiven && model->BSIM3V2gamma1Given)
- { T0 = pParam->BSIM3V2gamma1 * model->BSIM3V2cox;
- pParam->BSIM3V2npeak = 3.021E22 * T0 * T0;
- }
-
- pParam->BSIM3V2phi = 2.0 * Vtm0
- * log(pParam->BSIM3V2npeak / ni);
-
- pParam->BSIM3V2sqrtPhi = sqrt(pParam->BSIM3V2phi);
- pParam->BSIM3V2phis3 = pParam->BSIM3V2sqrtPhi * pParam->BSIM3V2phi;
-
- pParam->BSIM3V2Xdep0 = sqrt(2.0 * EPSSI / (Charge_q
- * pParam->BSIM3V2npeak * 1.0e6))
- * pParam->BSIM3V2sqrtPhi;
- pParam->BSIM3V2sqrtXdep0 = sqrt(pParam->BSIM3V2Xdep0);
- pParam->BSIM3V2litl = sqrt(3.0 * pParam->BSIM3V2xj
- * model->BSIM3V2tox);
- pParam->BSIM3V2vbi = Vtm0 * log(1.0e20
- * pParam->BSIM3V2npeak / (ni * ni));
- pParam->BSIM3V2cdep0 = sqrt(Charge_q * EPSSI
- * pParam->BSIM3V2npeak * 1.0e6 / 2.0
- / pParam->BSIM3V2phi);
-
- pParam->BSIM3V2ldeb = sqrt(EPSSI * Vtm0 / (Charge_q
- * pParam->BSIM3V2npeak * 1.0e6)) / 3.0;
- pParam->BSIM3V2acde *= pow((pParam->BSIM3V2npeak / 2.0e16), -0.25);
-
-
- if (model->BSIM3V2k1Given || model->BSIM3V2k2Given)
- { if (!model->BSIM3V2k1Given)
- { fprintf(stdout, "Warning: k1 should be specified with k2.\n");
- pParam->BSIM3V2k1 = 0.53;
- }
- if (!model->BSIM3V2k2Given)
- { fprintf(stdout, "Warning: k2 should be specified with k1.\n");
- pParam->BSIM3V2k2 = -0.0186;
- }
- if (model->BSIM3V2nsubGiven)
- fprintf(stdout, "Warning: nsub is ignored because k1 or k2 is given.\n");
- if (model->BSIM3V2xtGiven)
- fprintf(stdout, "Warning: xt is ignored because k1 or k2 is given.\n");
- if (model->BSIM3V2vbxGiven)
- fprintf(stdout, "Warning: vbx is ignored because k1 or k2 is given.\n");
- if (model->BSIM3V2gamma1Given)
- fprintf(stdout, "Warning: gamma1 is ignored because k1 or k2 is given.\n");
- if (model->BSIM3V2gamma2Given)
- fprintf(stdout, "Warning: gamma2 is ignored because k1 or k2 is given.\n");
- }
- else
- { if (!model->BSIM3V2vbxGiven)
- pParam->BSIM3V2vbx = pParam->BSIM3V2phi - 7.7348e-4
- * pParam->BSIM3V2npeak
- * pParam->BSIM3V2xt * pParam->BSIM3V2xt;
- if (pParam->BSIM3V2vbx > 0.0)
- pParam->BSIM3V2vbx = -pParam->BSIM3V2vbx;
- if (pParam->BSIM3V2vbm > 0.0)
- pParam->BSIM3V2vbm = -pParam->BSIM3V2vbm;
-
- if (!model->BSIM3V2gamma1Given)
- pParam->BSIM3V2gamma1 = 5.753e-12
- * sqrt(pParam->BSIM3V2npeak)
- / model->BSIM3V2cox;
- if (!model->BSIM3V2gamma2Given)
- pParam->BSIM3V2gamma2 = 5.753e-12
- * sqrt(pParam->BSIM3V2nsub)
- / model->BSIM3V2cox;
-
- T0 = pParam->BSIM3V2gamma1 - pParam->BSIM3V2gamma2;
- T1 = sqrt(pParam->BSIM3V2phi - pParam->BSIM3V2vbx)
- - pParam->BSIM3V2sqrtPhi;
- T2 = sqrt(pParam->BSIM3V2phi * (pParam->BSIM3V2phi
- - pParam->BSIM3V2vbm)) - pParam->BSIM3V2phi;
- pParam->BSIM3V2k2 = T0 * T1 / (2.0 * T2 + pParam->BSIM3V2vbm);
- pParam->BSIM3V2k1 = pParam->BSIM3V2gamma2 - 2.0
- * pParam->BSIM3V2k2 * sqrt(pParam->BSIM3V2phi
- - pParam->BSIM3V2vbm);
- }
-
- if (pParam->BSIM3V2k2 < 0.0)
- { T0 = 0.5 * pParam->BSIM3V2k1 / pParam->BSIM3V2k2;
- pParam->BSIM3V2vbsc = 0.9 * (pParam->BSIM3V2phi - T0 * T0);
- if (pParam->BSIM3V2vbsc > -3.0)
- pParam->BSIM3V2vbsc = -3.0;
- else if (pParam->BSIM3V2vbsc < -30.0)
- pParam->BSIM3V2vbsc = -30.0;
- }
- else
- { pParam->BSIM3V2vbsc = -30.0;
- }
- if (pParam->BSIM3V2vbsc > pParam->BSIM3V2vbm)
- pParam->BSIM3V2vbsc = pParam->BSIM3V2vbm;
-
- if (!model->BSIM3V2vfbGiven)
- { if (model->BSIM3V2vth0Given)
- { pParam->BSIM3V2vfb = model->BSIM3V2type * pParam->BSIM3V2vth0
- - pParam->BSIM3V2phi - pParam->BSIM3V2k1
- * pParam->BSIM3V2sqrtPhi;
- }
- else
- { pParam->BSIM3V2vfb = -1.0;
- }
- }
- if (!model->BSIM3V2vth0Given)
- { pParam->BSIM3V2vth0 = model->BSIM3V2type * (pParam->BSIM3V2vfb
- + pParam->BSIM3V2phi + pParam->BSIM3V2k1
- * pParam->BSIM3V2sqrtPhi);
- }
-
- pParam->BSIM3V2k1ox = pParam->BSIM3V2k1 * model->BSIM3V2tox
- / model->BSIM3V2toxm;
- pParam->BSIM3V2k2ox = pParam->BSIM3V2k2 * model->BSIM3V2tox
- / model->BSIM3V2toxm;
-
- T1 = sqrt(EPSSI / EPSOX * model->BSIM3V2tox
- * pParam->BSIM3V2Xdep0);
- T0 = exp(-0.5 * pParam->BSIM3V2dsub * pParam->BSIM3V2leff / T1);
- pParam->BSIM3V2theta0vb0 = (T0 + 2.0 * T0 * T0);
-
- T0 = exp(-0.5 * pParam->BSIM3V2drout * pParam->BSIM3V2leff / T1);
- T2 = (T0 + 2.0 * T0 * T0);
- pParam->BSIM3V2thetaRout = pParam->BSIM3V2pdibl1 * T2
- + pParam->BSIM3V2pdibl2;
-
- /* vfbzb for capMod 1, 2 & 3 - Weidong 4/1997 */
- tmp = sqrt(pParam->BSIM3V2Xdep0);
- tmp1 = pParam->BSIM3V2vbi - pParam->BSIM3V2phi;
- tmp2 = model->BSIM3V2factor1 * tmp;
-
- T0 = -0.5 * pParam->BSIM3V2dvt1w * pParam->BSIM3V2weff
- * pParam->BSIM3V2leff / tmp2;
- if (T0 > -EXP_THRESHOLD)
- { T1 = exp(T0);
- T2 = T1 * (1.0 + 2.0 * T1);
- }
- else
- { T1 = MIN_EXP;
- T2 = T1 * (1.0 + 2.0 * T1);
- }
- T0 = pParam->BSIM3V2dvt0w * T2;
- T2 = T0 * tmp1;
-
- T0 = -0.5 * pParam->BSIM3V2dvt1 * pParam->BSIM3V2leff / tmp2;
- if (T0 > -EXP_THRESHOLD)
- { T1 = exp(T0);
- T3 = T1 * (1.0 + 2.0 * T1);
- }
- else
- { T1 = MIN_EXP;
- T3 = T1 * (1.0 + 2.0 * T1);
- }
- T3 = pParam->BSIM3V2dvt0 * T3 * tmp1;
-
- T4 = model->BSIM3V2tox * pParam->BSIM3V2phi
- / (pParam->BSIM3V2weff + pParam->BSIM3V2w0);
-
- T0 = sqrt(1.0 + pParam->BSIM3V2nlx / pParam->BSIM3V2leff);
- T5 = pParam->BSIM3V2k1ox * (T0 - 1.0) * pParam->BSIM3V2sqrtPhi
- + (pParam->BSIM3V2kt1 + pParam->BSIM3V2kt1l / pParam->BSIM3V2leff)
- * (TRatio - 1.0);
-
- tmp3 = model->BSIM3V2type * pParam->BSIM3V2vth0
- - T2 - T3 + pParam->BSIM3V2k3 * T4 + T5;
- pParam->BSIM3V2vfbzb = tmp3 - pParam->BSIM3V2phi - pParam->BSIM3V2k1
- * pParam->BSIM3V2sqrtPhi;
- /* End of vfbzb */
- }
-
- /* process source/drain series resistance */
- here->BSIM3V2drainConductance = model->BSIM3V2sheetResistance
- * here->BSIM3V2drainSquares;
- if (here->BSIM3V2drainConductance > 0.0)
- here->BSIM3V2drainConductance = 1.0
- / here->BSIM3V2drainConductance;
- else
- here->BSIM3V2drainConductance = 0.0;
-
- here->BSIM3V2sourceConductance = model->BSIM3V2sheetResistance
- * here->BSIM3V2sourceSquares;
- if (here->BSIM3V2sourceConductance > 0.0)
- here->BSIM3V2sourceConductance = 1.0
- / here->BSIM3V2sourceConductance;
- else
- here->BSIM3V2sourceConductance = 0.0;
- here->BSIM3V2cgso = pParam->BSIM3V2cgso;
- here->BSIM3V2cgdo = pParam->BSIM3V2cgdo;
-
- Nvtm = model->BSIM3V2vtm * model->BSIM3V2jctEmissionCoeff;
- if ((here->BSIM3V2sourceArea <= 0.0) &&
- (here->BSIM3V2sourcePerimeter <= 0.0))
- { SourceSatCurrent = 1.0e-14;
- }
- else
- { SourceSatCurrent = here->BSIM3V2sourceArea
- * model->BSIM3V2jctTempSatCurDensity
- + here->BSIM3V2sourcePerimeter
- * model->BSIM3V2jctSidewallTempSatCurDensity;
- }
- if ((SourceSatCurrent > 0.0) && (model->BSIM3V2ijth > 0.0))
- { here->BSIM3V2vjsm = Nvtm * log(model->BSIM3V2ijth
- / SourceSatCurrent + 1.0);
- }
-
- if ((here->BSIM3V2drainArea <= 0.0) &&
- (here->BSIM3V2drainPerimeter <= 0.0))
- { DrainSatCurrent = 1.0e-14;
- }
- else
- { DrainSatCurrent = here->BSIM3V2drainArea
- * model->BSIM3V2jctTempSatCurDensity
- + here->BSIM3V2drainPerimeter
- * model->BSIM3V2jctSidewallTempSatCurDensity;
- }
- if ((DrainSatCurrent > 0.0) && (model->BSIM3V2ijth > 0.0))
- { here->BSIM3V2vjdm = Nvtm * log(model->BSIM3V2ijth
- / DrainSatCurrent + 1.0);
- }
- }
- }
- return(OK);
-}
-
diff --git a/src/spicelib/devices/bsim3v2/b3v2trunc.c b/src/spicelib/devices/bsim3v2/b3v2trunc.c
deleted file mode 100644
index 23b9546ec..000000000
--- a/src/spicelib/devices/bsim3v2/b3v2trunc.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-File: b3v2trunc.c
-**********/
-
-#include "ngspice.h"
-#include
-#include
-#include "cktdefs.h"
-#include "bsim3v2def.h"
-#include "sperror.h"
-#include "suffix.h"
-
-
-int
-BSIM3V2trunc(inModel,ckt,timeStep)
-GENmodel *inModel;
-CKTcircuit *ckt;
-double *timeStep;
-{
-BSIM3V2model *model = (BSIM3V2model*)inModel;
-BSIM3V2instance *here;
-
-#ifdef STEPDEBUG
- double debugtemp;
-#endif /* STEPDEBUG */
-
- for (; model != NULL; model = model->BSIM3V2nextModel)
- { for (here = model->BSIM3V2instances; here != NULL;
- here = here->BSIM3V2nextInstance)
- {
- if (here->BSIM3V2owner != ARCHme) continue;
-#ifdef STEPDEBUG
- debugtemp = *timeStep;
-#endif /* STEPDEBUG */
- CKTterr(here->BSIM3V2qb,ckt,timeStep);
- CKTterr(here->BSIM3V2qg,ckt,timeStep);
- CKTterr(here->BSIM3V2qd,ckt,timeStep);
-#ifdef STEPDEBUG
- if(debugtemp != *timeStep)
- { printf("device %s reduces step from %g to %g\n",
- here->BSIM3V2name,debugtemp,*timeStep);
- }
-#endif /* STEPDEBUG */
- }
- }
- return(OK);
-}
-
-
-
diff --git a/src/spicelib/devices/bsim3v2/bsim3v2def.h b/src/spicelib/devices/bsim3v2/bsim3v2def.h
deleted file mode 100644
index 5268f2594..000000000
--- a/src/spicelib/devices/bsim3v2/bsim3v2def.h
+++ /dev/null
@@ -1,1756 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1995 Min-Chie Jeng and Mansun Chan.
-Modified by Weidong Liu (1997-1998).
-File: bsim3v2def.h
-**********/
-
-#ifndef BSIM3V2
-#define BSIM3V2
-
-#include "ifsim.h"
-#include "gendefs.h"
-#include "cktdefs.h"
-#include "complex.h"
-#include "noisedef.h"
-
-typedef struct sBSIM3V2instance
-{
- struct sBSIM3V2model *BSIM3V2modPtr;
- struct sBSIM3V2instance *BSIM3V2nextInstance;
- IFuid BSIM3V2name;
- int BSIM3V2owner; /* number of owner process */
- int BSIM3V2states; /* index into state table for this device */
-
- int BSIM3V2dNode;
- int BSIM3V2gNode;
- int BSIM3V2sNode;
- int BSIM3V2bNode;
- int BSIM3V2dNodePrime;
- int BSIM3V2sNodePrime;
- int BSIM3V2qNode; /* MCJ */
-
- /* MCJ */
- double BSIM3V2ueff;
- double BSIM3V2thetavth;
- double BSIM3V2von;
- double BSIM3V2vdsat;
- double BSIM3V2cgdo;
- double BSIM3V2cgso;
- double BSIM3V2vjsm;
- double BSIM3V2vjdm;
-
- double BSIM3V2l;
- double BSIM3V2w;
- double BSIM3V2drainArea;
- double BSIM3V2sourceArea;
- double BSIM3V2drainSquares;
- double BSIM3V2sourceSquares;
- double BSIM3V2drainPerimeter;
- double BSIM3V2sourcePerimeter;
- double BSIM3V2sourceConductance;
- double BSIM3V2drainConductance;
-
- double BSIM3V2icVBS;
- double BSIM3V2icVDS;
- double BSIM3V2icVGS;
- int BSIM3V2off;
- int BSIM3V2mode;
- int BSIM3V2nqsMod;
-
- /* OP point */
- double BSIM3V2qinv;
- double BSIM3V2cd;
- double BSIM3V2cbs;
- double BSIM3V2cbd;
- double BSIM3V2csub;
- double BSIM3V2gm;
- double BSIM3V2gds;
- double BSIM3V2gmbs;
- double BSIM3V2gbd;
- double BSIM3V2gbs;
-
- double BSIM3V2gbbs;
- double BSIM3V2gbgs;
- double BSIM3V2gbds;
-
- double BSIM3V2cggb;
- double BSIM3V2cgdb;
- double BSIM3V2cgsb;
- double BSIM3V2cbgb;
- double BSIM3V2cbdb;
- double BSIM3V2cbsb;
- double BSIM3V2cdgb;
- double BSIM3V2cddb;
- double BSIM3V2cdsb;
- double BSIM3V2capbd;
- double BSIM3V2capbs;
-
- double BSIM3V2cqgb;
- double BSIM3V2cqdb;
- double BSIM3V2cqsb;
- double BSIM3V2cqbb;
-
- double BSIM3V2qgate;
- double BSIM3V2qbulk;
- double BSIM3V2qdrn;
-
- double BSIM3V2gtau;
- double BSIM3V2gtg;
- double BSIM3V2gtd;
- double BSIM3V2gts;
- double BSIM3V2gtb;
-
- struct BSIM3V2SizeDependParam *pParam;
-
- unsigned BSIM3V2lGiven :1;
- unsigned BSIM3V2wGiven :1;
- unsigned BSIM3V2drainAreaGiven :1;
- unsigned BSIM3V2sourceAreaGiven :1;
- unsigned BSIM3V2drainSquaresGiven :1;
- unsigned BSIM3V2sourceSquaresGiven :1;
- unsigned BSIM3V2drainPerimeterGiven :1;
- unsigned BSIM3V2sourcePerimeterGiven :1;
- unsigned BSIM3V2dNodePrimeSet :1;
- unsigned BSIM3V2sNodePrimeSet :1;
- unsigned BSIM3V2icVBSGiven :1;
- unsigned BSIM3V2icVDSGiven :1;
- unsigned BSIM3V2icVGSGiven :1;
- unsigned BSIM3V2nqsModGiven :1;
-
- double *BSIM3V2DdPtr;
- double *BSIM3V2GgPtr;
- double *BSIM3V2SsPtr;
- double *BSIM3V2BbPtr;
- double *BSIM3V2DPdpPtr;
- double *BSIM3V2SPspPtr;
- double *BSIM3V2DdpPtr;
- double *BSIM3V2GbPtr;
- double *BSIM3V2GdpPtr;
- double *BSIM3V2GspPtr;
- double *BSIM3V2SspPtr;
- double *BSIM3V2BdpPtr;
- double *BSIM3V2BspPtr;
- double *BSIM3V2DPspPtr;
- double *BSIM3V2DPdPtr;
- double *BSIM3V2BgPtr;
- double *BSIM3V2DPgPtr;
- double *BSIM3V2SPgPtr;
- double *BSIM3V2SPsPtr;
- double *BSIM3V2DPbPtr;
- double *BSIM3V2SPbPtr;
- double *BSIM3V2SPdpPtr;
-
- double *BSIM3V2QqPtr;
- double *BSIM3V2QdpPtr;
- double *BSIM3V2QgPtr;
- double *BSIM3V2QspPtr;
- double *BSIM3V2QbPtr;
- double *BSIM3V2DPqPtr;
- double *BSIM3V2GqPtr;
- double *BSIM3V2SPqPtr;
- double *BSIM3V2BqPtr;
-
- /* int BSIM3V2states; */ /* index into state table for this device */
-#define BSIM3V2vbd BSIM3V2states+ 0
-#define BSIM3V2vbs BSIM3V2states+ 1
-#define BSIM3V2vgs BSIM3V2states+ 2
-#define BSIM3V2vds BSIM3V2states+ 3
-
-#define BSIM3V2qb BSIM3V2states+ 4
-#define BSIM3V2cqb BSIM3V2states+ 5
-#define BSIM3V2qg BSIM3V2states+ 6
-#define BSIM3V2cqg BSIM3V2states+ 7
-#define BSIM3V2qd BSIM3V2states+ 8
-#define BSIM3V2cqd BSIM3V2states+ 9
-
-#define BSIM3V2qbs BSIM3V2states+ 10
-#define BSIM3V2qbd BSIM3V2states+ 11
-
-#define BSIM3V2qcheq BSIM3V2states+ 12
-#define BSIM3V2cqcheq BSIM3V2states+ 13
-#define BSIM3V2qcdump BSIM3V2states+ 14
-#define BSIM3V2cqcdump BSIM3V2states+ 15
-
-#define BSIM3V2qdef BSIM3V2states+ 16
-
-#define BSIM3V2numStates 17
-
-
-/* indices to the array of BSIM3V2 NOISE SOURCES */
-
-#define BSIM3V2RDNOIZ 0
-#define BSIM3V2RSNOIZ 1
-#define BSIM3V2IDNOIZ 2
-#define BSIM3V2FLNOIZ 3
-#define BSIM3V2TOTNOIZ 4
-
-#define BSIM3V2NSRCS 5 /* the number of BSIM3V2 MOSFET noise sources */
-
-#ifndef NONOISE
- double BSIM3V2nVar[NSTATVARS][BSIM3V2NSRCS];
-#else /* NONOISE */
- double **BSIM3V2nVar;
-#endif /* NONOISE */
-
-} BSIM3V2instance ;
-
-struct BSIM3V2SizeDependParam
-{
- double Width;
- double Length;
-
- double BSIM3V2cdsc;
- double BSIM3V2cdscb;
- double BSIM3V2cdscd;
- double BSIM3V2cit;
- double BSIM3V2nfactor;
- double BSIM3V2xj;
- double BSIM3V2vsat;
- double BSIM3V2at;
- double BSIM3V2a0;
- double BSIM3V2ags;
- double BSIM3V2a1;
- double BSIM3V2a2;
- double BSIM3V2keta;
- double BSIM3V2nsub;
- double BSIM3V2npeak;
- double BSIM3V2ngate;
- double BSIM3V2gamma1;
- double BSIM3V2gamma2;
- double BSIM3V2vbx;
- double BSIM3V2vbi;
- double BSIM3V2vbm;
- double BSIM3V2vbsc;
- double BSIM3V2xt;
- double BSIM3V2phi;
- double BSIM3V2litl;
- double BSIM3V2k1;
- double BSIM3V2kt1;
- double BSIM3V2kt1l;
- double BSIM3V2kt2;
- double BSIM3V2k2;
- double BSIM3V2k3;
- double BSIM3V2k3b;
- double BSIM3V2w0;
- double BSIM3V2nlx;
- double BSIM3V2dvt0;
- double BSIM3V2dvt1;
- double BSIM3V2dvt2;
- double BSIM3V2dvt0w;
- double BSIM3V2dvt1w;
- double BSIM3V2dvt2w;
- double BSIM3V2drout;
- double BSIM3V2dsub;
- double BSIM3V2vth0;
- double BSIM3V2ua;
- double BSIM3V2ua1;
- double BSIM3V2ub;
- double BSIM3V2ub1;
- double BSIM3V2uc;
- double BSIM3V2uc1;
- double BSIM3V2u0;
- double BSIM3V2ute;
- double BSIM3V2voff;
- double BSIM3V2vfb;
- double BSIM3V2delta;
- double BSIM3V2rdsw;
- double BSIM3V2rds0;
- double BSIM3V2prwg;
- double BSIM3V2prwb;
- double BSIM3V2prt;
- double BSIM3V2eta0;
- double BSIM3V2etab;
- double BSIM3V2pclm;
- double BSIM3V2pdibl1;
- double BSIM3V2pdibl2;
- double BSIM3V2pdiblb;
- double BSIM3V2pscbe1;
- double BSIM3V2pscbe2;
- double BSIM3V2pvag;
- double BSIM3V2wr;
- double BSIM3V2dwg;
- double BSIM3V2dwb;
- double BSIM3V2b0;
- double BSIM3V2b1;
- double BSIM3V2alpha0;
- double BSIM3V2alpha1;
- double BSIM3V2beta0;
-
-
- /* CV model */
- double BSIM3V2elm;
- double BSIM3V2cgsl;
- double BSIM3V2cgdl;
- double BSIM3V2ckappa;
- double BSIM3V2cf;
- double BSIM3V2clc;
- double BSIM3V2cle;
- double BSIM3V2vfbcv;
- double BSIM3V2noff;
- double BSIM3V2voffcv;
- double BSIM3V2acde;
- double BSIM3V2moin;
-
-
-/* Pre-calculated constants */
-
- double BSIM3V2dw;
- double BSIM3V2dl;
- double BSIM3V2leff;
- double BSIM3V2weff;
-
- double BSIM3V2dwc;
- double BSIM3V2dlc;
- double BSIM3V2leffCV;
- double BSIM3V2weffCV;
- double BSIM3V2abulkCVfactor;
- double BSIM3V2cgso;
- double BSIM3V2cgdo;
- double BSIM3V2cgbo;
- double BSIM3V2tconst;
-
- double BSIM3V2u0temp;
- double BSIM3V2vsattemp;
- double BSIM3V2sqrtPhi;
- double BSIM3V2phis3;
- double BSIM3V2Xdep0;
- double BSIM3V2sqrtXdep0;
- double BSIM3V2theta0vb0;
- double BSIM3V2thetaRout;
-
- double BSIM3V2cof1;
- double BSIM3V2cof2;
- double BSIM3V2cof3;
- double BSIM3V2cof4;
- double BSIM3V2cdep0;
- double BSIM3V2vfbzb;
- double BSIM3V2ldeb;
- double BSIM3V2k1ox;
- double BSIM3V2k2ox;
-
- struct BSIM3V2SizeDependParam *pNext;
-};
-
-
-typedef struct sBSIM3V2model
-{
- int BSIM3V2modType;
- struct sBSIM3V2model *BSIM3V2nextModel;
- BSIM3V2instance *BSIM3V2instances;
- IFuid BSIM3V2modName;
- int BSIM3V2type;
-
- int BSIM3V2mobMod;
- int BSIM3V2capMod;
- int BSIM3V2noiMod;
- int BSIM3V2binUnit;
- int BSIM3V2paramChk;
- double BSIM3V2version;
- double BSIM3V2tox;
- double BSIM3V2toxm;
- double BSIM3V2cdsc;
- double BSIM3V2cdscb;
- double BSIM3V2cdscd;
- double BSIM3V2cit;
- double BSIM3V2nfactor;
- double BSIM3V2xj;
- double BSIM3V2vsat;
- double BSIM3V2at;
- double BSIM3V2a0;
- double BSIM3V2ags;
- double BSIM3V2a1;
- double BSIM3V2a2;
- double BSIM3V2keta;
- double BSIM3V2nsub;
- double BSIM3V2npeak;
- double BSIM3V2ngate;
- double BSIM3V2gamma1;
- double BSIM3V2gamma2;
- double BSIM3V2vbx;
- double BSIM3V2vbm;
- double BSIM3V2xt;
- double BSIM3V2k1;
- double BSIM3V2kt1;
- double BSIM3V2kt1l;
- double BSIM3V2kt2;
- double BSIM3V2k2;
- double BSIM3V2k3;
- double BSIM3V2k3b;
- double BSIM3V2w0;
- double BSIM3V2nlx;
- double BSIM3V2dvt0;
- double BSIM3V2dvt1;
- double BSIM3V2dvt2;
- double BSIM3V2dvt0w;
- double BSIM3V2dvt1w;
- double BSIM3V2dvt2w;
- double BSIM3V2drout;
- double BSIM3V2dsub;
- double BSIM3V2vth0;
- double BSIM3V2ua;
- double BSIM3V2ua1;
- double BSIM3V2ub;
- double BSIM3V2ub1;
- double BSIM3V2uc;
- double BSIM3V2uc1;
- double BSIM3V2u0;
- double BSIM3V2ute;
- double BSIM3V2voff;
- double BSIM3V2delta;
- double BSIM3V2rdsw;
- double BSIM3V2prwg;
- double BSIM3V2prwb;
- double BSIM3V2prt;
- double BSIM3V2eta0;
- double BSIM3V2etab;
- double BSIM3V2pclm;
- double BSIM3V2pdibl1;
- double BSIM3V2pdibl2;
- double BSIM3V2pdiblb;
- double BSIM3V2pscbe1;
- double BSIM3V2pscbe2;
- double BSIM3V2pvag;
- double BSIM3V2wr;
- double BSIM3V2dwg;
- double BSIM3V2dwb;
- double BSIM3V2b0;
- double BSIM3V2b1;
- double BSIM3V2alpha0;
- double BSIM3V2alpha1;
- double BSIM3V2beta0;
- double BSIM3V2ijth;
- double BSIM3V2vfb;
-
- /* CV model */
- double BSIM3V2elm;
- double BSIM3V2cgsl;
- double BSIM3V2cgdl;
- double BSIM3V2ckappa;
- double BSIM3V2cf;
- double BSIM3V2vfbcv;
- double BSIM3V2clc;
- double BSIM3V2cle;
- double BSIM3V2dwc;
- double BSIM3V2dlc;
- double BSIM3V2noff;
- double BSIM3V2voffcv;
- double BSIM3V2acde;
- double BSIM3V2moin;
- double BSIM3V2tcj;
- double BSIM3V2tcjsw;
- double BSIM3V2tcjswg;
- double BSIM3V2tpb;
- double BSIM3V2tpbsw;
- double BSIM3V2tpbswg;
-
- /* Length Dependence */
- double BSIM3V2lcdsc;
- double BSIM3V2lcdscb;
- double BSIM3V2lcdscd;
- double BSIM3V2lcit;
- double BSIM3V2lnfactor;
- double BSIM3V2lxj;
- double BSIM3V2lvsat;
- double BSIM3V2lat;
- double BSIM3V2la0;
- double BSIM3V2lags;
- double BSIM3V2la1;
- double BSIM3V2la2;
- double BSIM3V2lketa;
- double BSIM3V2lnsub;
- double BSIM3V2lnpeak;
- double BSIM3V2lngate;
- double BSIM3V2lgamma1;
- double BSIM3V2lgamma2;
- double BSIM3V2lvbx;
- double BSIM3V2lvbm;
- double BSIM3V2lxt;
- double BSIM3V2lk1;
- double BSIM3V2lkt1;
- double BSIM3V2lkt1l;
- double BSIM3V2lkt2;
- double BSIM3V2lk2;
- double BSIM3V2lk3;
- double BSIM3V2lk3b;
- double BSIM3V2lw0;
- double BSIM3V2lnlx;
- double BSIM3V2ldvt0;
- double BSIM3V2ldvt1;
- double BSIM3V2ldvt2;
- double BSIM3V2ldvt0w;
- double BSIM3V2ldvt1w;
- double BSIM3V2ldvt2w;
- double BSIM3V2ldrout;
- double BSIM3V2ldsub;
- double BSIM3V2lvth0;
- double BSIM3V2lua;
- double BSIM3V2lua1;
- double BSIM3V2lub;
- double BSIM3V2lub1;
- double BSIM3V2luc;
- double BSIM3V2luc1;
- double BSIM3V2lu0;
- double BSIM3V2lute;
- double BSIM3V2lvoff;
- double BSIM3V2ldelta;
- double BSIM3V2lrdsw;
- double BSIM3V2lprwg;
- double BSIM3V2lprwb;
- double BSIM3V2lprt;
- double BSIM3V2leta0;
- double BSIM3V2letab;
- double BSIM3V2lpclm;
- double BSIM3V2lpdibl1;
- double BSIM3V2lpdibl2;
- double BSIM3V2lpdiblb;
- double BSIM3V2lpscbe1;
- double BSIM3V2lpscbe2;
- double BSIM3V2lpvag;
- double BSIM3V2lwr;
- double BSIM3V2ldwg;
- double BSIM3V2ldwb;
- double BSIM3V2lb0;
- double BSIM3V2lb1;
- double BSIM3V2lalpha0;
- double BSIM3V2lalpha1;
- double BSIM3V2lbeta0;
- double BSIM3V2lvfb;
-
- /* CV model */
- double BSIM3V2lelm;
- double BSIM3V2lcgsl;
- double BSIM3V2lcgdl;
- double BSIM3V2lckappa;
- double BSIM3V2lcf;
- double BSIM3V2lclc;
- double BSIM3V2lcle;
- double BSIM3V2lvfbcv;
- double BSIM3V2lnoff;
- double BSIM3V2lvoffcv;
- double BSIM3V2lacde;
- double BSIM3V2lmoin;
-
- /* Width Dependence */
- double BSIM3V2wcdsc;
- double BSIM3V2wcdscb;
- double BSIM3V2wcdscd;
- double BSIM3V2wcit;
- double BSIM3V2wnfactor;
- double BSIM3V2wxj;
- double BSIM3V2wvsat;
- double BSIM3V2wat;
- double BSIM3V2wa0;
- double BSIM3V2wags;
- double BSIM3V2wa1;
- double BSIM3V2wa2;
- double BSIM3V2wketa;
- double BSIM3V2wnsub;
- double BSIM3V2wnpeak;
- double BSIM3V2wngate;
- double BSIM3V2wgamma1;
- double BSIM3V2wgamma2;
- double BSIM3V2wvbx;
- double BSIM3V2wvbm;
- double BSIM3V2wxt;
- double BSIM3V2wk1;
- double BSIM3V2wkt1;
- double BSIM3V2wkt1l;
- double BSIM3V2wkt2;
- double BSIM3V2wk2;
- double BSIM3V2wk3;
- double BSIM3V2wk3b;
- double BSIM3V2ww0;
- double BSIM3V2wnlx;
- double BSIM3V2wdvt0;
- double BSIM3V2wdvt1;
- double BSIM3V2wdvt2;
- double BSIM3V2wdvt0w;
- double BSIM3V2wdvt1w;
- double BSIM3V2wdvt2w;
- double BSIM3V2wdrout;
- double BSIM3V2wdsub;
- double BSIM3V2wvth0;
- double BSIM3V2wua;
- double BSIM3V2wua1;
- double BSIM3V2wub;
- double BSIM3V2wub1;
- double BSIM3V2wuc;
- double BSIM3V2wuc1;
- double BSIM3V2wu0;
- double BSIM3V2wute;
- double BSIM3V2wvoff;
- double BSIM3V2wdelta;
- double BSIM3V2wrdsw;
- double BSIM3V2wprwg;
- double BSIM3V2wprwb;
- double BSIM3V2wprt;
- double BSIM3V2weta0;
- double BSIM3V2wetab;
- double BSIM3V2wpclm;
- double BSIM3V2wpdibl1;
- double BSIM3V2wpdibl2;
- double BSIM3V2wpdiblb;
- double BSIM3V2wpscbe1;
- double BSIM3V2wpscbe2;
- double BSIM3V2wpvag;
- double BSIM3V2wwr;
- double BSIM3V2wdwg;
- double BSIM3V2wdwb;
- double BSIM3V2wb0;
- double BSIM3V2wb1;
- double BSIM3V2walpha0;
- double BSIM3V2walpha1;
- double BSIM3V2wbeta0;
- double BSIM3V2wvfb;
-
- /* CV model */
- double BSIM3V2welm;
- double BSIM3V2wcgsl;
- double BSIM3V2wcgdl;
- double BSIM3V2wckappa;
- double BSIM3V2wcf;
- double BSIM3V2wclc;
- double BSIM3V2wcle;
- double BSIM3V2wvfbcv;
- double BSIM3V2wnoff;
- double BSIM3V2wvoffcv;
- double BSIM3V2wacde;
- double BSIM3V2wmoin;
-
- /* Cross-term Dependence */
- double BSIM3V2pcdsc;
- double BSIM3V2pcdscb;
- double BSIM3V2pcdscd;
- double BSIM3V2pcit;
- double BSIM3V2pnfactor;
- double BSIM3V2pxj;
- double BSIM3V2pvsat;
- double BSIM3V2pat;
- double BSIM3V2pa0;
- double BSIM3V2pags;
- double BSIM3V2pa1;
- double BSIM3V2pa2;
- double BSIM3V2pketa;
- double BSIM3V2pnsub;
- double BSIM3V2pnpeak;
- double BSIM3V2pngate;
- double BSIM3V2pgamma1;
- double BSIM3V2pgamma2;
- double BSIM3V2pvbx;
- double BSIM3V2pvbm;
- double BSIM3V2pxt;
- double BSIM3V2pk1;
- double BSIM3V2pkt1;
- double BSIM3V2pkt1l;
- double BSIM3V2pkt2;
- double BSIM3V2pk2;
- double BSIM3V2pk3;
- double BSIM3V2pk3b;
- double BSIM3V2pw0;
- double BSIM3V2pnlx;
- double BSIM3V2pdvt0;
- double BSIM3V2pdvt1;
- double BSIM3V2pdvt2;
- double BSIM3V2pdvt0w;
- double BSIM3V2pdvt1w;
- double BSIM3V2pdvt2w;
- double BSIM3V2pdrout;
- double BSIM3V2pdsub;
- double BSIM3V2pvth0;
- double BSIM3V2pua;
- double BSIM3V2pua1;
- double BSIM3V2pub;
- double BSIM3V2pub1;
- double BSIM3V2puc;
- double BSIM3V2puc1;
- double BSIM3V2pu0;
- double BSIM3V2pute;
- double BSIM3V2pvoff;
- double BSIM3V2pdelta;
- double BSIM3V2prdsw;
- double BSIM3V2pprwg;
- double BSIM3V2pprwb;
- double BSIM3V2pprt;
- double BSIM3V2peta0;
- double BSIM3V2petab;
- double BSIM3V2ppclm;
- double BSIM3V2ppdibl1;
- double BSIM3V2ppdibl2;
- double BSIM3V2ppdiblb;
- double BSIM3V2ppscbe1;
- double BSIM3V2ppscbe2;
- double BSIM3V2ppvag;
- double BSIM3V2pwr;
- double BSIM3V2pdwg;
- double BSIM3V2pdwb;
- double BSIM3V2pb0;
- double BSIM3V2pb1;
- double BSIM3V2palpha0;
- double BSIM3V2palpha1;
- double BSIM3V2pbeta0;
- double BSIM3V2pvfb;
-
- /* CV model */
- double BSIM3V2pelm;
- double BSIM3V2pcgsl;
- double BSIM3V2pcgdl;
- double BSIM3V2pckappa;
- double BSIM3V2pcf;
- double BSIM3V2pclc;
- double BSIM3V2pcle;
- double BSIM3V2pvfbcv;
- double BSIM3V2pnoff;
- double BSIM3V2pvoffcv;
- double BSIM3V2pacde;
- double BSIM3V2pmoin;
-
- double BSIM3V2tnom;
- double BSIM3V2cgso;
- double BSIM3V2cgdo;
- double BSIM3V2cgbo;
- double BSIM3V2xpart;
- double BSIM3V2cFringOut;
- double BSIM3V2cFringMax;
-
- double BSIM3V2sheetResistance;
- double BSIM3V2jctSatCurDensity;
- double BSIM3V2jctSidewallSatCurDensity;
- double BSIM3V2bulkJctPotential;
- double BSIM3V2bulkJctBotGradingCoeff;
- double BSIM3V2bulkJctSideGradingCoeff;
- double BSIM3V2bulkJctGateSideGradingCoeff;
- double BSIM3V2sidewallJctPotential;
- double BSIM3V2GatesidewallJctPotential;
- double BSIM3V2unitAreaJctCap;
- double BSIM3V2unitLengthSidewallJctCap;
- double BSIM3V2unitLengthGateSidewallJctCap;
- double BSIM3V2jctEmissionCoeff;
- double BSIM3V2jctTempExponent;
-
- double BSIM3V2Lint;
- double BSIM3V2Ll;
- double BSIM3V2Llc;
- double BSIM3V2Lln;
- double BSIM3V2Lw;
- double BSIM3V2Lwc;
- double BSIM3V2Lwn;
- double BSIM3V2Lwl;
- double BSIM3V2Lwlc;
- double BSIM3V2Lmin;
- double BSIM3V2Lmax;
-
- double BSIM3V2Wint;
- double BSIM3V2Wl;
- double BSIM3V2Wlc;
- double BSIM3V2Wln;
- double BSIM3V2Ww;
- double BSIM3V2Wwc;
- double BSIM3V2Wwn;
- double BSIM3V2Wwl;
- double BSIM3V2Wwlc;
- double BSIM3V2Wmin;
- double BSIM3V2Wmax;
-
-
-/* Pre-calculated constants */
- /* MCJ: move to size-dependent param. */
- double BSIM3V2vtm;
- double BSIM3V2cox;
- double BSIM3V2cof1;
- double BSIM3V2cof2;
- double BSIM3V2cof3;
- double BSIM3V2cof4;
- double BSIM3V2vcrit;
- double BSIM3V2factor1;
- double BSIM3V2PhiB;
- double BSIM3V2PhiBSW;
- double BSIM3V2PhiBSWG;
- double BSIM3V2jctTempSatCurDensity;
- double BSIM3V2jctSidewallTempSatCurDensity;
-
- double BSIM3V2oxideTrapDensityA;
- double BSIM3V2oxideTrapDensityB;
- double BSIM3V2oxideTrapDensityC;
- double BSIM3V2em;
- double BSIM3V2ef;
- double BSIM3V2af;
- double BSIM3V2kf;
-
- struct BSIM3V2SizeDependParam *pSizeDependParamKnot;
-
- /* Flags */
- unsigned BSIM3V2mobModGiven :1;
- unsigned BSIM3V2binUnitGiven :1;
- unsigned BSIM3V2capModGiven :1;
- unsigned BSIM3V2paramChkGiven :1;
- unsigned BSIM3V2noiModGiven :1;
- unsigned BSIM3V2typeGiven :1;
- unsigned BSIM3V2toxGiven :1;
- unsigned BSIM3V2versionGiven :1;
- unsigned BSIM3V2toxmGiven :1;
- unsigned BSIM3V2cdscGiven :1;
- unsigned BSIM3V2cdscbGiven :1;
- unsigned BSIM3V2cdscdGiven :1;
- unsigned BSIM3V2citGiven :1;
- unsigned BSIM3V2nfactorGiven :1;
- unsigned BSIM3V2xjGiven :1;
- unsigned BSIM3V2vsatGiven :1;
- unsigned BSIM3V2atGiven :1;
- unsigned BSIM3V2a0Given :1;
- unsigned BSIM3V2agsGiven :1;
- unsigned BSIM3V2a1Given :1;
- unsigned BSIM3V2a2Given :1;
- unsigned BSIM3V2ketaGiven :1;
- unsigned BSIM3V2nsubGiven :1;
- unsigned BSIM3V2npeakGiven :1;
- unsigned BSIM3V2ngateGiven :1;
- unsigned BSIM3V2gamma1Given :1;
- unsigned BSIM3V2gamma2Given :1;
- unsigned BSIM3V2vbxGiven :1;
- unsigned BSIM3V2vbmGiven :1;
- unsigned BSIM3V2xtGiven :1;
- unsigned BSIM3V2k1Given :1;
- unsigned BSIM3V2kt1Given :1;
- unsigned BSIM3V2kt1lGiven :1;
- unsigned BSIM3V2kt2Given :1;
- unsigned BSIM3V2k2Given :1;
- unsigned BSIM3V2k3Given :1;
- unsigned BSIM3V2k3bGiven :1;
- unsigned BSIM3V2w0Given :1;
- unsigned BSIM3V2nlxGiven :1;
- unsigned BSIM3V2dvt0Given :1;
- unsigned BSIM3V2dvt1Given :1;
- unsigned BSIM3V2dvt2Given :1;
- unsigned BSIM3V2dvt0wGiven :1;
- unsigned BSIM3V2dvt1wGiven :1;
- unsigned BSIM3V2dvt2wGiven :1;
- unsigned BSIM3V2droutGiven :1;
- unsigned BSIM3V2dsubGiven :1;
- unsigned BSIM3V2vth0Given :1;
- unsigned BSIM3V2uaGiven :1;
- unsigned BSIM3V2ua1Given :1;
- unsigned BSIM3V2ubGiven :1;
- unsigned BSIM3V2ub1Given :1;
- unsigned BSIM3V2ucGiven :1;
- unsigned BSIM3V2uc1Given :1;
- unsigned BSIM3V2u0Given :1;
- unsigned BSIM3V2uteGiven :1;
- unsigned BSIM3V2voffGiven :1;
- unsigned BSIM3V2rdswGiven :1;
- unsigned BSIM3V2prwgGiven :1;
- unsigned BSIM3V2prwbGiven :1;
- unsigned BSIM3V2prtGiven :1;
- unsigned BSIM3V2eta0Given :1;
- unsigned BSIM3V2etabGiven :1;
- unsigned BSIM3V2pclmGiven :1;
- unsigned BSIM3V2pdibl1Given :1;
- unsigned BSIM3V2pdibl2Given :1;
- unsigned BSIM3V2pdiblbGiven :1;
- unsigned BSIM3V2pscbe1Given :1;
- unsigned BSIM3V2pscbe2Given :1;
- unsigned BSIM3V2pvagGiven :1;
- unsigned BSIM3V2deltaGiven :1;
- unsigned BSIM3V2wrGiven :1;
- unsigned BSIM3V2dwgGiven :1;
- unsigned BSIM3V2dwbGiven :1;
- unsigned BSIM3V2b0Given :1;
- unsigned BSIM3V2b1Given :1;
- unsigned BSIM3V2alpha0Given :1;
- unsigned BSIM3V2alpha1Given :1;
- unsigned BSIM3V2beta0Given :1;
- unsigned BSIM3V2ijthGiven :1;
- unsigned BSIM3V2vfbGiven :1;
-
- /* CV model */
- unsigned BSIM3V2elmGiven :1;
- unsigned BSIM3V2cgslGiven :1;
- unsigned BSIM3V2cgdlGiven :1;
- unsigned BSIM3V2ckappaGiven :1;
- unsigned BSIM3V2cfGiven :1;
- unsigned BSIM3V2vfbcvGiven :1;
- unsigned BSIM3V2clcGiven :1;
- unsigned BSIM3V2cleGiven :1;
- unsigned BSIM3V2dwcGiven :1;
- unsigned BSIM3V2dlcGiven :1;
- unsigned BSIM3V2noffGiven :1;
- unsigned BSIM3V2voffcvGiven :1;
- unsigned BSIM3V2acdeGiven :1;
- unsigned BSIM3V2moinGiven :1;
- unsigned BSIM3V2tcjGiven :1;
- unsigned BSIM3V2tcjswGiven :1;
- unsigned BSIM3V2tcjswgGiven :1;
- unsigned BSIM3V2tpbGiven :1;
- unsigned BSIM3V2tpbswGiven :1;
- unsigned BSIM3V2tpbswgGiven :1;
-
-
- /* Length dependence */
- unsigned BSIM3V2lcdscGiven :1;
- unsigned BSIM3V2lcdscbGiven :1;
- unsigned BSIM3V2lcdscdGiven :1;
- unsigned BSIM3V2lcitGiven :1;
- unsigned BSIM3V2lnfactorGiven :1;
- unsigned BSIM3V2lxjGiven :1;
- unsigned BSIM3V2lvsatGiven :1;
- unsigned BSIM3V2latGiven :1;
- unsigned BSIM3V2la0Given :1;
- unsigned BSIM3V2lagsGiven :1;
- unsigned BSIM3V2la1Given :1;
- unsigned BSIM3V2la2Given :1;
- unsigned BSIM3V2lketaGiven :1;
- unsigned BSIM3V2lnsubGiven :1;
- unsigned BSIM3V2lnpeakGiven :1;
- unsigned BSIM3V2lngateGiven :1;
- unsigned BSIM3V2lgamma1Given :1;
- unsigned BSIM3V2lgamma2Given :1;
- unsigned BSIM3V2lvbxGiven :1;
- unsigned BSIM3V2lvbmGiven :1;
- unsigned BSIM3V2lxtGiven :1;
- unsigned BSIM3V2lk1Given :1;
- unsigned BSIM3V2lkt1Given :1;
- unsigned BSIM3V2lkt1lGiven :1;
- unsigned BSIM3V2lkt2Given :1;
- unsigned BSIM3V2lk2Given :1;
- unsigned BSIM3V2lk3Given :1;
- unsigned BSIM3V2lk3bGiven :1;
- unsigned BSIM3V2lw0Given :1;
- unsigned BSIM3V2lnlxGiven :1;
- unsigned BSIM3V2ldvt0Given :1;
- unsigned BSIM3V2ldvt1Given :1;
- unsigned BSIM3V2ldvt2Given :1;
- unsigned BSIM3V2ldvt0wGiven :1;
- unsigned BSIM3V2ldvt1wGiven :1;
- unsigned BSIM3V2ldvt2wGiven :1;
- unsigned BSIM3V2ldroutGiven :1;
- unsigned BSIM3V2ldsubGiven :1;
- unsigned BSIM3V2lvth0Given :1;
- unsigned BSIM3V2luaGiven :1;
- unsigned BSIM3V2lua1Given :1;
- unsigned BSIM3V2lubGiven :1;
- unsigned BSIM3V2lub1Given :1;
- unsigned BSIM3V2lucGiven :1;
- unsigned BSIM3V2luc1Given :1;
- unsigned BSIM3V2lu0Given :1;
- unsigned BSIM3V2luteGiven :1;
- unsigned BSIM3V2lvoffGiven :1;
- unsigned BSIM3V2lrdswGiven :1;
- unsigned BSIM3V2lprwgGiven :1;
- unsigned BSIM3V2lprwbGiven :1;
- unsigned BSIM3V2lprtGiven :1;
- unsigned BSIM3V2leta0Given :1;
- unsigned BSIM3V2letabGiven :1;
- unsigned BSIM3V2lpclmGiven :1;
- unsigned BSIM3V2lpdibl1Given :1;
- unsigned BSIM3V2lpdibl2Given :1;
- unsigned BSIM3V2lpdiblbGiven :1;
- unsigned BSIM3V2lpscbe1Given :1;
- unsigned BSIM3V2lpscbe2Given :1;
- unsigned BSIM3V2lpvagGiven :1;
- unsigned BSIM3V2ldeltaGiven :1;
- unsigned BSIM3V2lwrGiven :1;
- unsigned BSIM3V2ldwgGiven :1;
- unsigned BSIM3V2ldwbGiven :1;
- unsigned BSIM3V2lb0Given :1;
- unsigned BSIM3V2lb1Given :1;
- unsigned BSIM3V2lalpha0Given :1;
- unsigned BSIM3V2lalpha1Given :1;
- unsigned BSIM3V2lbeta0Given :1;
- unsigned BSIM3V2lvfbGiven :1;
-
- /* CV model */
- unsigned BSIM3V2lelmGiven :1;
- unsigned BSIM3V2lcgslGiven :1;
- unsigned BSIM3V2lcgdlGiven :1;
- unsigned BSIM3V2lckappaGiven :1;
- unsigned BSIM3V2lcfGiven :1;
- unsigned BSIM3V2lclcGiven :1;
- unsigned BSIM3V2lcleGiven :1;
- unsigned BSIM3V2lvfbcvGiven :1;
- unsigned BSIM3V2lnoffGiven :1;
- unsigned BSIM3V2lvoffcvGiven :1;
- unsigned BSIM3V2lacdeGiven :1;
- unsigned BSIM3V2lmoinGiven :1;
-
- /* Width dependence */
- unsigned BSIM3V2wcdscGiven :1;
- unsigned BSIM3V2wcdscbGiven :1;
- unsigned BSIM3V2wcdscdGiven :1;
- unsigned BSIM3V2wcitGiven :1;
- unsigned BSIM3V2wnfactorGiven :1;
- unsigned BSIM3V2wxjGiven :1;
- unsigned BSIM3V2wvsatGiven :1;
- unsigned BSIM3V2watGiven :1;
- unsigned BSIM3V2wa0Given :1;
- unsigned BSIM3V2wagsGiven :1;
- unsigned BSIM3V2wa1Given :1;
- unsigned BSIM3V2wa2Given :1;
- unsigned BSIM3V2wketaGiven :1;
- unsigned BSIM3V2wnsubGiven :1;
- unsigned BSIM3V2wnpeakGiven :1;
- unsigned BSIM3V2wngateGiven :1;
- unsigned BSIM3V2wgamma1Given :1;
- unsigned BSIM3V2wgamma2Given :1;
- unsigned BSIM3V2wvbxGiven :1;
- unsigned BSIM3V2wvbmGiven :1;
- unsigned BSIM3V2wxtGiven :1;
- unsigned BSIM3V2wk1Given :1;
- unsigned BSIM3V2wkt1Given :1;
- unsigned BSIM3V2wkt1lGiven :1;
- unsigned BSIM3V2wkt2Given :1;
- unsigned BSIM3V2wk2Given :1;
- unsigned BSIM3V2wk3Given :1;
- unsigned BSIM3V2wk3bGiven :1;
- unsigned BSIM3V2ww0Given :1;
- unsigned BSIM3V2wnlxGiven :1;
- unsigned BSIM3V2wdvt0Given :1;
- unsigned BSIM3V2wdvt1Given :1;
- unsigned BSIM3V2wdvt2Given :1;
- unsigned BSIM3V2wdvt0wGiven :1;
- unsigned BSIM3V2wdvt1wGiven :1;
- unsigned BSIM3V2wdvt2wGiven :1;
- unsigned BSIM3V2wdroutGiven :1;
- unsigned BSIM3V2wdsubGiven :1;
- unsigned BSIM3V2wvth0Given :1;
- unsigned BSIM3V2wuaGiven :1;
- unsigned BSIM3V2wua1Given :1;
- unsigned BSIM3V2wubGiven :1;
- unsigned BSIM3V2wub1Given :1;
- unsigned BSIM3V2wucGiven :1;
- unsigned BSIM3V2wuc1Given :1;
- unsigned BSIM3V2wu0Given :1;
- unsigned BSIM3V2wuteGiven :1;
- unsigned BSIM3V2wvoffGiven :1;
- unsigned BSIM3V2wrdswGiven :1;
- unsigned BSIM3V2wprwgGiven :1;
- unsigned BSIM3V2wprwbGiven :1;
- unsigned BSIM3V2wprtGiven :1;
- unsigned BSIM3V2weta0Given :1;
- unsigned BSIM3V2wetabGiven :1;
- unsigned BSIM3V2wpclmGiven :1;
- unsigned BSIM3V2wpdibl1Given :1;
- unsigned BSIM3V2wpdibl2Given :1;
- unsigned BSIM3V2wpdiblbGiven :1;
- unsigned BSIM3V2wpscbe1Given :1;
- unsigned BSIM3V2wpscbe2Given :1;
- unsigned BSIM3V2wpvagGiven :1;
- unsigned BSIM3V2wdeltaGiven :1;
- unsigned BSIM3V2wwrGiven :1;
- unsigned BSIM3V2wdwgGiven :1;
- unsigned BSIM3V2wdwbGiven :1;
- unsigned BSIM3V2wb0Given :1;
- unsigned BSIM3V2wb1Given :1;
- unsigned BSIM3V2walpha0Given :1;
- unsigned BSIM3V2walpha1Given :1;
- unsigned BSIM3V2wbeta0Given :1;
- unsigned BSIM3V2wvfbGiven :1;
-
- /* CV model */
- unsigned BSIM3V2welmGiven :1;
- unsigned BSIM3V2wcgslGiven :1;
- unsigned BSIM3V2wcgdlGiven :1;
- unsigned BSIM3V2wckappaGiven :1;
- unsigned BSIM3V2wcfGiven :1;
- unsigned BSIM3V2wclcGiven :1;
- unsigned BSIM3V2wcleGiven :1;
- unsigned BSIM3V2wvfbcvGiven :1;
- unsigned BSIM3V2wnoffGiven :1;
- unsigned BSIM3V2wvoffcvGiven :1;
- unsigned BSIM3V2wacdeGiven :1;
- unsigned BSIM3V2wmoinGiven :1;
-
- /* Cross-term dependence */
- unsigned BSIM3V2pcdscGiven :1;
- unsigned BSIM3V2pcdscbGiven :1;
- unsigned BSIM3V2pcdscdGiven :1;
- unsigned BSIM3V2pcitGiven :1;
- unsigned BSIM3V2pnfactorGiven :1;
- unsigned BSIM3V2pxjGiven :1;
- unsigned BSIM3V2pvsatGiven :1;
- unsigned BSIM3V2patGiven :1;
- unsigned BSIM3V2pa0Given :1;
- unsigned BSIM3V2pagsGiven :1;
- unsigned BSIM3V2pa1Given :1;
- unsigned BSIM3V2pa2Given :1;
- unsigned BSIM3V2pketaGiven :1;
- unsigned BSIM3V2pnsubGiven :1;
- unsigned BSIM3V2pnpeakGiven :1;
- unsigned BSIM3V2pngateGiven :1;
- unsigned BSIM3V2pgamma1Given :1;
- unsigned BSIM3V2pgamma2Given :1;
- unsigned BSIM3V2pvbxGiven :1;
- unsigned BSIM3V2pvbmGiven :1;
- unsigned BSIM3V2pxtGiven :1;
- unsigned BSIM3V2pk1Given :1;
- unsigned BSIM3V2pkt1Given :1;
- unsigned BSIM3V2pkt1lGiven :1;
- unsigned BSIM3V2pkt2Given :1;
- unsigned BSIM3V2pk2Given :1;
- unsigned BSIM3V2pk3Given :1;
- unsigned BSIM3V2pk3bGiven :1;
- unsigned BSIM3V2pw0Given :1;
- unsigned BSIM3V2pnlxGiven :1;
- unsigned BSIM3V2pdvt0Given :1;
- unsigned BSIM3V2pdvt1Given :1;
- unsigned BSIM3V2pdvt2Given :1;
- unsigned BSIM3V2pdvt0wGiven :1;
- unsigned BSIM3V2pdvt1wGiven :1;
- unsigned BSIM3V2pdvt2wGiven :1;
- unsigned BSIM3V2pdroutGiven :1;
- unsigned BSIM3V2pdsubGiven :1;
- unsigned BSIM3V2pvth0Given :1;
- unsigned BSIM3V2puaGiven :1;
- unsigned BSIM3V2pua1Given :1;
- unsigned BSIM3V2pubGiven :1;
- unsigned BSIM3V2pub1Given :1;
- unsigned BSIM3V2pucGiven :1;
- unsigned BSIM3V2puc1Given :1;
- unsigned BSIM3V2pu0Given :1;
- unsigned BSIM3V2puteGiven :1;
- unsigned BSIM3V2pvoffGiven :1;
- unsigned BSIM3V2prdswGiven :1;
- unsigned BSIM3V2pprwgGiven :1;
- unsigned BSIM3V2pprwbGiven :1;
- unsigned BSIM3V2pprtGiven :1;
- unsigned BSIM3V2peta0Given :1;
- unsigned BSIM3V2petabGiven :1;
- unsigned BSIM3V2ppclmGiven :1;
- unsigned BSIM3V2ppdibl1Given :1;
- unsigned BSIM3V2ppdibl2Given :1;
- unsigned BSIM3V2ppdiblbGiven :1;
- unsigned BSIM3V2ppscbe1Given :1;
- unsigned BSIM3V2ppscbe2Given :1;
- unsigned BSIM3V2ppvagGiven :1;
- unsigned BSIM3V2pdeltaGiven :1;
- unsigned BSIM3V2pwrGiven :1;
- unsigned BSIM3V2pdwgGiven :1;
- unsigned BSIM3V2pdwbGiven :1;
- unsigned BSIM3V2pb0Given :1;
- unsigned BSIM3V2pb1Given :1;
- unsigned BSIM3V2palpha0Given :1;
- unsigned BSIM3V2palpha1Given :1;
- unsigned BSIM3V2pbeta0Given :1;
- unsigned BSIM3V2pvfbGiven :1;
-
- /* CV model */
- unsigned BSIM3V2pelmGiven :1;
- unsigned BSIM3V2pcgslGiven :1;
- unsigned BSIM3V2pcgdlGiven :1;
- unsigned BSIM3V2pckappaGiven :1;
- unsigned BSIM3V2pcfGiven :1;
- unsigned BSIM3V2pclcGiven :1;
- unsigned BSIM3V2pcleGiven :1;
- unsigned BSIM3V2pvfbcvGiven :1;
- unsigned BSIM3V2pnoffGiven :1;
- unsigned BSIM3V2pvoffcvGiven :1;
- unsigned BSIM3V2pacdeGiven :1;
- unsigned BSIM3V2pmoinGiven :1;
-
- unsigned BSIM3V2useFringeGiven :1;
-
- unsigned BSIM3V2tnomGiven :1;
- unsigned BSIM3V2cgsoGiven :1;
- unsigned BSIM3V2cgdoGiven :1;
- unsigned BSIM3V2cgboGiven :1;
- unsigned BSIM3V2xpartGiven :1;
- unsigned BSIM3V2sheetResistanceGiven :1;
- unsigned BSIM3V2jctSatCurDensityGiven :1;
- unsigned BSIM3V2jctSidewallSatCurDensityGiven :1;
- unsigned BSIM3V2bulkJctPotentialGiven :1;
- unsigned BSIM3V2bulkJctBotGradingCoeffGiven :1;
- unsigned BSIM3V2sidewallJctPotentialGiven :1;
- unsigned BSIM3V2GatesidewallJctPotentialGiven :1;
- unsigned BSIM3V2bulkJctSideGradingCoeffGiven :1;
- unsigned BSIM3V2unitAreaJctCapGiven :1;
- unsigned BSIM3V2unitLengthSidewallJctCapGiven :1;
- unsigned BSIM3V2bulkJctGateSideGradingCoeffGiven :1;
- unsigned BSIM3V2unitLengthGateSidewallJctCapGiven :1;
- unsigned BSIM3V2jctEmissionCoeffGiven :1;
- unsigned BSIM3V2jctTempExponentGiven :1;
-
- unsigned BSIM3V2oxideTrapDensityAGiven :1;
- unsigned BSIM3V2oxideTrapDensityBGiven :1;
- unsigned BSIM3V2oxideTrapDensityCGiven :1;
- unsigned BSIM3V2emGiven :1;
- unsigned BSIM3V2efGiven :1;
- unsigned BSIM3V2afGiven :1;
- unsigned BSIM3V2kfGiven :1;
-
- unsigned BSIM3V2LintGiven :1;
- unsigned BSIM3V2LlGiven :1;
- unsigned BSIM3V2LlcGiven :1;
- unsigned BSIM3V2LlnGiven :1;
- unsigned BSIM3V2LwGiven :1;
- unsigned BSIM3V2LwcGiven :1;
- unsigned BSIM3V2LwnGiven :1;
- unsigned BSIM3V2LwlGiven :1;
- unsigned BSIM3V2LwlcGiven :1;
- unsigned BSIM3V2LminGiven :1;
- unsigned BSIM3V2LmaxGiven :1;
-
- unsigned BSIM3V2WintGiven :1;
- unsigned BSIM3V2WlGiven :1;
- unsigned BSIM3V2WlcGiven :1;
- unsigned BSIM3V2WlnGiven :1;
- unsigned BSIM3V2WwGiven :1;
- unsigned BSIM3V2WwcGiven :1;
- unsigned BSIM3V2WwnGiven :1;
- unsigned BSIM3V2WwlGiven :1;
- unsigned BSIM3V2WwlcGiven :1;
- unsigned BSIM3V2WminGiven :1;
- unsigned BSIM3V2WmaxGiven :1;
-
-} BSIM3V2model;
-
-
-#ifndef NMOS
-#define NMOS 1
-#define PMOS -1
-#endif /*NMOS*/
-
-
-/* device parameters */
-#define BSIM3V2_W 1
-#define BSIM3V2_L 2
-#define BSIM3V2_AS 3
-#define BSIM3V2_AD 4
-#define BSIM3V2_PS 5
-#define BSIM3V2_PD 6
-#define BSIM3V2_NRS 7
-#define BSIM3V2_NRD 8
-#define BSIM3V2_OFF 9
-#define BSIM3V2_IC_VBS 10
-#define BSIM3V2_IC_VDS 11
-#define BSIM3V2_IC_VGS 12
-#define BSIM3V2_IC 13
-#define BSIM3V2_NQSMOD 14
-
-/* model parameters */
-#define BSIM3V2_MOD_CAPMOD 101
-#define BSIM3V2_MOD_MOBMOD 103
-#define BSIM3V2_MOD_NOIMOD 104
-
-#define BSIM3V2_MOD_TOX 105
-
-#define BSIM3V2_MOD_CDSC 106
-#define BSIM3V2_MOD_CDSCB 107
-#define BSIM3V2_MOD_CIT 108
-#define BSIM3V2_MOD_NFACTOR 109
-#define BSIM3V2_MOD_XJ 110
-#define BSIM3V2_MOD_VSAT 111
-#define BSIM3V2_MOD_AT 112
-#define BSIM3V2_MOD_A0 113
-#define BSIM3V2_MOD_A1 114
-#define BSIM3V2_MOD_A2 115
-#define BSIM3V2_MOD_KETA 116
-#define BSIM3V2_MOD_NSUB 117
-#define BSIM3V2_MOD_NPEAK 118
-#define BSIM3V2_MOD_NGATE 120
-#define BSIM3V2_MOD_GAMMA1 121
-#define BSIM3V2_MOD_GAMMA2 122
-#define BSIM3V2_MOD_VBX 123
-#define BSIM3V2_MOD_BINUNIT 124
-
-#define BSIM3V2_MOD_VBM 125
-
-#define BSIM3V2_MOD_XT 126
-#define BSIM3V2_MOD_K1 129
-#define BSIM3V2_MOD_KT1 130
-#define BSIM3V2_MOD_KT1L 131
-#define BSIM3V2_MOD_K2 132
-#define BSIM3V2_MOD_KT2 133
-#define BSIM3V2_MOD_K3 134
-#define BSIM3V2_MOD_K3B 135
-#define BSIM3V2_MOD_W0 136
-#define BSIM3V2_MOD_NLX 137
-
-#define BSIM3V2_MOD_DVT0 138
-#define BSIM3V2_MOD_DVT1 139
-#define BSIM3V2_MOD_DVT2 140
-
-#define BSIM3V2_MOD_DVT0W 141
-#define BSIM3V2_MOD_DVT1W 142
-#define BSIM3V2_MOD_DVT2W 143
-
-#define BSIM3V2_MOD_DROUT 144
-#define BSIM3V2_MOD_DSUB 145
-#define BSIM3V2_MOD_VTH0 146
-#define BSIM3V2_MOD_UA 147
-#define BSIM3V2_MOD_UA1 148
-#define BSIM3V2_MOD_UB 149
-#define BSIM3V2_MOD_UB1 150
-#define BSIM3V2_MOD_UC 151
-#define BSIM3V2_MOD_UC1 152
-#define BSIM3V2_MOD_U0 153
-#define BSIM3V2_MOD_UTE 154
-#define BSIM3V2_MOD_VOFF 155
-#define BSIM3V2_MOD_DELTA 156
-#define BSIM3V2_MOD_RDSW 157
-#define BSIM3V2_MOD_PRT 158
-#define BSIM3V2_MOD_LDD 159
-#define BSIM3V2_MOD_ETA 160
-#define BSIM3V2_MOD_ETA0 161
-#define BSIM3V2_MOD_ETAB 162
-#define BSIM3V2_MOD_PCLM 163
-#define BSIM3V2_MOD_PDIBL1 164
-#define BSIM3V2_MOD_PDIBL2 165
-#define BSIM3V2_MOD_PSCBE1 166
-#define BSIM3V2_MOD_PSCBE2 167
-#define BSIM3V2_MOD_PVAG 168
-#define BSIM3V2_MOD_WR 169
-#define BSIM3V2_MOD_DWG 170
-#define BSIM3V2_MOD_DWB 171
-#define BSIM3V2_MOD_B0 172
-#define BSIM3V2_MOD_B1 173
-#define BSIM3V2_MOD_ALPHA0 174
-#define BSIM3V2_MOD_BETA0 175
-#define BSIM3V2_MOD_PDIBLB 178
-
-#define BSIM3V2_MOD_PRWG 179
-#define BSIM3V2_MOD_PRWB 180
-
-#define BSIM3V2_MOD_CDSCD 181
-#define BSIM3V2_MOD_AGS 182
-
-#define BSIM3V2_MOD_FRINGE 184
-#define BSIM3V2_MOD_ELM 185
-#define BSIM3V2_MOD_CGSL 186
-#define BSIM3V2_MOD_CGDL 187
-#define BSIM3V2_MOD_CKAPPA 188
-#define BSIM3V2_MOD_CF 189
-#define BSIM3V2_MOD_CLC 190
-#define BSIM3V2_MOD_CLE 191
-#define BSIM3V2_MOD_PARAMCHK 192
-#define BSIM3V2_MOD_VERSION 193
-#define BSIM3V2_MOD_VFBCV 194
-#define BSIM3V2_MOD_ACDE 195
-#define BSIM3V2_MOD_MOIN 196
-#define BSIM3V2_MOD_NOFF 197
-#define BSIM3V2_MOD_IJTH 198
-#define BSIM3V2_MOD_ALPHA1 199
-#define BSIM3V2_MOD_VFB 200
-#define BSIM3V2_MOD_TOXM 201
-#define BSIM3V2_MOD_TCJ 202
-#define BSIM3V2_MOD_TCJSW 203
-#define BSIM3V2_MOD_TCJSWG 204
-#define BSIM3V2_MOD_TPB 205
-#define BSIM3V2_MOD_TPBSW 206
-#define BSIM3V2_MOD_TPBSWG 207
-#define BSIM3V2_MOD_VOFFCV 208
-
-/* Length dependence */
-#define BSIM3V2_MOD_LCDSC 251
-#define BSIM3V2_MOD_LCDSCB 252
-#define BSIM3V2_MOD_LCIT 253
-#define BSIM3V2_MOD_LNFACTOR 254
-#define BSIM3V2_MOD_LXJ 255
-#define BSIM3V2_MOD_LVSAT 256
-#define BSIM3V2_MOD_LAT 257
-#define BSIM3V2_MOD_LA0 258
-#define BSIM3V2_MOD_LA1 259
-#define BSIM3V2_MOD_LA2 260
-#define BSIM3V2_MOD_LKETA 261
-#define BSIM3V2_MOD_LNSUB 262
-#define BSIM3V2_MOD_LNPEAK 263
-#define BSIM3V2_MOD_LNGATE 265
-#define BSIM3V2_MOD_LGAMMA1 266
-#define BSIM3V2_MOD_LGAMMA2 267
-#define BSIM3V2_MOD_LVBX 268
-
-#define BSIM3V2_MOD_LVBM 270
-
-#define BSIM3V2_MOD_LXT 272
-#define BSIM3V2_MOD_LK1 275
-#define BSIM3V2_MOD_LKT1 276
-#define BSIM3V2_MOD_LKT1L 277
-#define BSIM3V2_MOD_LK2 278
-#define BSIM3V2_MOD_LKT2 279
-#define BSIM3V2_MOD_LK3 280
-#define BSIM3V2_MOD_LK3B 281
-#define BSIM3V2_MOD_LW0 282
-#define BSIM3V2_MOD_LNLX 283
-
-#define BSIM3V2_MOD_LDVT0 284
-#define BSIM3V2_MOD_LDVT1 285
-#define BSIM3V2_MOD_LDVT2 286
-
-#define BSIM3V2_MOD_LDVT0W 287
-#define BSIM3V2_MOD_LDVT1W 288
-#define BSIM3V2_MOD_LDVT2W 289
-
-#define BSIM3V2_MOD_LDROUT 290
-#define BSIM3V2_MOD_LDSUB 291
-#define BSIM3V2_MOD_LVTH0 292
-#define BSIM3V2_MOD_LUA 293
-#define BSIM3V2_MOD_LUA1 294
-#define BSIM3V2_MOD_LUB 295
-#define BSIM3V2_MOD_LUB1 296
-#define BSIM3V2_MOD_LUC 297
-#define BSIM3V2_MOD_LUC1 298
-#define BSIM3V2_MOD_LU0 299
-#define BSIM3V2_MOD_LUTE 300
-#define BSIM3V2_MOD_LVOFF 301
-#define BSIM3V2_MOD_LDELTA 302
-#define BSIM3V2_MOD_LRDSW 303
-#define BSIM3V2_MOD_LPRT 304
-#define BSIM3V2_MOD_LLDD 305
-#define BSIM3V2_MOD_LETA 306
-#define BSIM3V2_MOD_LETA0 307
-#define BSIM3V2_MOD_LETAB 308
-#define BSIM3V2_MOD_LPCLM 309
-#define BSIM3V2_MOD_LPDIBL1 310
-#define BSIM3V2_MOD_LPDIBL2 311
-#define BSIM3V2_MOD_LPSCBE1 312
-#define BSIM3V2_MOD_LPSCBE2 313
-#define BSIM3V2_MOD_LPVAG 314
-#define BSIM3V2_MOD_LWR 315
-#define BSIM3V2_MOD_LDWG 316
-#define BSIM3V2_MOD_LDWB 317
-#define BSIM3V2_MOD_LB0 318
-#define BSIM3V2_MOD_LB1 319
-#define BSIM3V2_MOD_LALPHA0 320
-#define BSIM3V2_MOD_LBETA0 321
-#define BSIM3V2_MOD_LPDIBLB 324
-
-#define BSIM3V2_MOD_LPRWG 325
-#define BSIM3V2_MOD_LPRWB 326
-
-#define BSIM3V2_MOD_LCDSCD 327
-#define BSIM3V2_MOD_LAGS 328
-
-
-#define BSIM3V2_MOD_LFRINGE 331
-#define BSIM3V2_MOD_LELM 332
-#define BSIM3V2_MOD_LCGSL 333
-#define BSIM3V2_MOD_LCGDL 334
-#define BSIM3V2_MOD_LCKAPPA 335
-#define BSIM3V2_MOD_LCF 336
-#define BSIM3V2_MOD_LCLC 337
-#define BSIM3V2_MOD_LCLE 338
-#define BSIM3V2_MOD_LVFBCV 339
-#define BSIM3V2_MOD_LACDE 340
-#define BSIM3V2_MOD_LMOIN 341
-#define BSIM3V2_MOD_LNOFF 342
-#define BSIM3V2_MOD_LALPHA1 344
-#define BSIM3V2_MOD_LVFB 345
-#define BSIM3V2_MOD_LVOFFCV 346
-
-/* Width dependence */
-#define BSIM3V2_MOD_WCDSC 381
-#define BSIM3V2_MOD_WCDSCB 382
-#define BSIM3V2_MOD_WCIT 383
-#define BSIM3V2_MOD_WNFACTOR 384
-#define BSIM3V2_MOD_WXJ 385
-#define BSIM3V2_MOD_WVSAT 386
-#define BSIM3V2_MOD_WAT 387
-#define BSIM3V2_MOD_WA0 388
-#define BSIM3V2_MOD_WA1 389
-#define BSIM3V2_MOD_WA2 390
-#define BSIM3V2_MOD_WKETA 391
-#define BSIM3V2_MOD_WNSUB 392
-#define BSIM3V2_MOD_WNPEAK 393
-#define BSIM3V2_MOD_WNGATE 395
-#define BSIM3V2_MOD_WGAMMA1 396
-#define BSIM3V2_MOD_WGAMMA2 397
-#define BSIM3V2_MOD_WVBX 398
-
-#define BSIM3V2_MOD_WVBM 400
-
-#define BSIM3V2_MOD_WXT 402
-#define BSIM3V2_MOD_WK1 405
-#define BSIM3V2_MOD_WKT1 406
-#define BSIM3V2_MOD_WKT1L 407
-#define BSIM3V2_MOD_WK2 408
-#define BSIM3V2_MOD_WKT2 409
-#define BSIM3V2_MOD_WK3 410
-#define BSIM3V2_MOD_WK3B 411
-#define BSIM3V2_MOD_WW0 412
-#define BSIM3V2_MOD_WNLX 413
-
-#define BSIM3V2_MOD_WDVT0 414
-#define BSIM3V2_MOD_WDVT1 415
-#define BSIM3V2_MOD_WDVT2 416
-
-#define BSIM3V2_MOD_WDVT0W 417
-#define BSIM3V2_MOD_WDVT1W 418
-#define BSIM3V2_MOD_WDVT2W 419
-
-#define BSIM3V2_MOD_WDROUT 420
-#define BSIM3V2_MOD_WDSUB 421
-#define BSIM3V2_MOD_WVTH0 422
-#define BSIM3V2_MOD_WUA 423
-#define BSIM3V2_MOD_WUA1 424
-#define BSIM3V2_MOD_WUB 425
-#define BSIM3V2_MOD_WUB1 426
-#define BSIM3V2_MOD_WUC 427
-#define BSIM3V2_MOD_WUC1 428
-#define BSIM3V2_MOD_WU0 429
-#define BSIM3V2_MOD_WUTE 430
-#define BSIM3V2_MOD_WVOFF 431
-#define BSIM3V2_MOD_WDELTA 432
-#define BSIM3V2_MOD_WRDSW 433
-#define BSIM3V2_MOD_WPRT 434
-#define BSIM3V2_MOD_WLDD 435
-#define BSIM3V2_MOD_WETA 436
-#define BSIM3V2_MOD_WETA0 437
-#define BSIM3V2_MOD_WETAB 438
-#define BSIM3V2_MOD_WPCLM 439
-#define BSIM3V2_MOD_WPDIBL1 440
-#define BSIM3V2_MOD_WPDIBL2 441
-#define BSIM3V2_MOD_WPSCBE1 442
-#define BSIM3V2_MOD_WPSCBE2 443
-#define BSIM3V2_MOD_WPVAG 444
-#define BSIM3V2_MOD_WWR 445
-#define BSIM3V2_MOD_WDWG 446
-#define BSIM3V2_MOD_WDWB 447
-#define BSIM3V2_MOD_WB0 448
-#define BSIM3V2_MOD_WB1 449
-#define BSIM3V2_MOD_WALPHA0 450
-#define BSIM3V2_MOD_WBETA0 451
-#define BSIM3V2_MOD_WPDIBLB 454
-
-#define BSIM3V2_MOD_WPRWG 455
-#define BSIM3V2_MOD_WPRWB 456
-
-#define BSIM3V2_MOD_WCDSCD 457
-#define BSIM3V2_MOD_WAGS 458
-
-
-#define BSIM3V2_MOD_WFRINGE 461
-#define BSIM3V2_MOD_WELM 462
-#define BSIM3V2_MOD_WCGSL 463
-#define BSIM3V2_MOD_WCGDL 464
-#define BSIM3V2_MOD_WCKAPPA 465
-#define BSIM3V2_MOD_WCF 466
-#define BSIM3V2_MOD_WCLC 467
-#define BSIM3V2_MOD_WCLE 468
-#define BSIM3V2_MOD_WVFBCV 469
-#define BSIM3V2_MOD_WACDE 470
-#define BSIM3V2_MOD_WMOIN 471
-#define BSIM3V2_MOD_WNOFF 472
-#define BSIM3V2_MOD_WALPHA1 474
-#define BSIM3V2_MOD_WVFB 475
-#define BSIM3V2_MOD_WVOFFCV 476
-
-/* Cross-term dependence */
-#define BSIM3V2_MOD_PCDSC 511
-#define BSIM3V2_MOD_PCDSCB 512
-#define BSIM3V2_MOD_PCIT 513
-#define BSIM3V2_MOD_PNFACTOR 514
-#define BSIM3V2_MOD_PXJ 515
-#define BSIM3V2_MOD_PVSAT 516
-#define BSIM3V2_MOD_PAT 517
-#define BSIM3V2_MOD_PA0 518
-#define BSIM3V2_MOD_PA1 519
-#define BSIM3V2_MOD_PA2 520
-#define BSIM3V2_MOD_PKETA 521
-#define BSIM3V2_MOD_PNSUB 522
-#define BSIM3V2_MOD_PNPEAK 523
-#define BSIM3V2_MOD_PNGATE 525
-#define BSIM3V2_MOD_PGAMMA1 526
-#define BSIM3V2_MOD_PGAMMA2 527
-#define BSIM3V2_MOD_PVBX 528
-
-#define BSIM3V2_MOD_PVBM 530
-
-#define BSIM3V2_MOD_PXT 532
-#define BSIM3V2_MOD_PK1 535
-#define BSIM3V2_MOD_PKT1 536
-#define BSIM3V2_MOD_PKT1L 537
-#define BSIM3V2_MOD_PK2 538
-#define BSIM3V2_MOD_PKT2 539
-#define BSIM3V2_MOD_PK3 540
-#define BSIM3V2_MOD_PK3B 541
-#define BSIM3V2_MOD_PW0 542
-#define BSIM3V2_MOD_PNLX 543
-
-#define BSIM3V2_MOD_PDVT0 544
-#define BSIM3V2_MOD_PDVT1 545
-#define BSIM3V2_MOD_PDVT2 546
-
-#define BSIM3V2_MOD_PDVT0W 547
-#define BSIM3V2_MOD_PDVT1W 548
-#define BSIM3V2_MOD_PDVT2W 549
-
-#define BSIM3V2_MOD_PDROUT 550
-#define BSIM3V2_MOD_PDSUB 551
-#define BSIM3V2_MOD_PVTH0 552
-#define BSIM3V2_MOD_PUA 553
-#define BSIM3V2_MOD_PUA1 554
-#define BSIM3V2_MOD_PUB 555
-#define BSIM3V2_MOD_PUB1 556
-#define BSIM3V2_MOD_PUC 557
-#define BSIM3V2_MOD_PUC1 558
-#define BSIM3V2_MOD_PU0 559
-#define BSIM3V2_MOD_PUTE 560
-#define BSIM3V2_MOD_PVOFF 561
-#define BSIM3V2_MOD_PDELTA 562
-#define BSIM3V2_MOD_PRDSW 563
-#define BSIM3V2_MOD_PPRT 564
-#define BSIM3V2_MOD_PLDD 565
-#define BSIM3V2_MOD_PETA 566
-#define BSIM3V2_MOD_PETA0 567
-#define BSIM3V2_MOD_PETAB 568
-#define BSIM3V2_MOD_PPCLM 569
-#define BSIM3V2_MOD_PPDIBL1 570
-#define BSIM3V2_MOD_PPDIBL2 571
-#define BSIM3V2_MOD_PPSCBE1 572
-#define BSIM3V2_MOD_PPSCBE2 573
-#define BSIM3V2_MOD_PPVAG 574
-#define BSIM3V2_MOD_PWR 575
-#define BSIM3V2_MOD_PDWG 576
-#define BSIM3V2_MOD_PDWB 577
-#define BSIM3V2_MOD_PB0 578
-#define BSIM3V2_MOD_PB1 579
-#define BSIM3V2_MOD_PALPHA0 580
-#define BSIM3V2_MOD_PBETA0 581
-#define BSIM3V2_MOD_PPDIBLB 584
-
-#define BSIM3V2_MOD_PPRWG 585
-#define BSIM3V2_MOD_PPRWB 586
-
-#define BSIM3V2_MOD_PCDSCD 587
-#define BSIM3V2_MOD_PAGS 588
-
-#define BSIM3V2_MOD_PFRINGE 591
-#define BSIM3V2_MOD_PELM 592
-#define BSIM3V2_MOD_PCGSL 593
-#define BSIM3V2_MOD_PCGDL 594
-#define BSIM3V2_MOD_PCKAPPA 595
-#define BSIM3V2_MOD_PCF 596
-#define BSIM3V2_MOD_PCLC 597
-#define BSIM3V2_MOD_PCLE 598
-#define BSIM3V2_MOD_PVFBCV 599
-#define BSIM3V2_MOD_PACDE 600
-#define BSIM3V2_MOD_PMOIN 601
-#define BSIM3V2_MOD_PNOFF 602
-#define BSIM3V2_MOD_PALPHA1 604
-#define BSIM3V2_MOD_PVFB 605
-#define BSIM3V2_MOD_PVOFFCV 606
-
-#define BSIM3V2_MOD_TNOM 651
-#define BSIM3V2_MOD_CGSO 652
-#define BSIM3V2_MOD_CGDO 653
-#define BSIM3V2_MOD_CGBO 654
-#define BSIM3V2_MOD_XPART 655
-
-#define BSIM3V2_MOD_RSH 656
-#define BSIM3V2_MOD_JS 657
-#define BSIM3V2_MOD_PB 658
-#define BSIM3V2_MOD_MJ 659
-#define BSIM3V2_MOD_PBSW 660
-#define BSIM3V2_MOD_MJSW 661
-#define BSIM3V2_MOD_CJ 662
-#define BSIM3V2_MOD_CJSW 663
-#define BSIM3V2_MOD_NMOS 664
-#define BSIM3V2_MOD_PMOS 665
-
-#define BSIM3V2_MOD_NOIA 666
-#define BSIM3V2_MOD_NOIB 667
-#define BSIM3V2_MOD_NOIC 668
-
-#define BSIM3V2_MOD_LINT 669
-#define BSIM3V2_MOD_LL 670
-#define BSIM3V2_MOD_LLN 671
-#define BSIM3V2_MOD_LW 672
-#define BSIM3V2_MOD_LWN 673
-#define BSIM3V2_MOD_LWL 674
-#define BSIM3V2_MOD_LMIN 675
-#define BSIM3V2_MOD_LMAX 676
-
-#define BSIM3V2_MOD_WINT 677
-#define BSIM3V2_MOD_WL 678
-#define BSIM3V2_MOD_WLN 679
-#define BSIM3V2_MOD_WW 680
-#define BSIM3V2_MOD_WWN 681
-#define BSIM3V2_MOD_WWL 682
-#define BSIM3V2_MOD_WMIN 683
-#define BSIM3V2_MOD_WMAX 684
-
-#define BSIM3V2_MOD_DWC 685
-#define BSIM3V2_MOD_DLC 686
-
-#define BSIM3V2_MOD_EM 687
-#define BSIM3V2_MOD_EF 688
-#define BSIM3V2_MOD_AF 689
-#define BSIM3V2_MOD_KF 690
-
-#define BSIM3V2_MOD_NJ 691
-#define BSIM3V2_MOD_XTI 692
-
-#define BSIM3V2_MOD_PBSWG 693
-#define BSIM3V2_MOD_MJSWG 694
-#define BSIM3V2_MOD_CJSWG 695
-#define BSIM3V2_MOD_JSW 696
-
-#define BSIM3V2_MOD_LLC 697
-#define BSIM3V2_MOD_LWC 698
-#define BSIM3V2_MOD_LWLC 699
-
-#define BSIM3V2_MOD_WLC 700
-#define BSIM3V2_MOD_WWC 701
-#define BSIM3V2_MOD_WWLC 702
-
-/* device questions */
-#define BSIM3V2_DNODE 751
-#define BSIM3V2_GNODE 752
-#define BSIM3V2_SNODE 753
-#define BSIM3V2_BNODE 754
-#define BSIM3V2_DNODEPRIME 755
-#define BSIM3V2_SNODEPRIME 756
-#define BSIM3V2_VBD 757
-#define BSIM3V2_VBS 758
-#define BSIM3V2_VGS 759
-#define BSIM3V2_VDS 760
-#define BSIM3V2_CD 761
-#define BSIM3V2_CBS 762
-#define BSIM3V2_CBD 763
-#define BSIM3V2_GM 764
-#define BSIM3V2_GDS 765
-#define BSIM3V2_GMBS 766
-#define BSIM3V2_GBD 767
-#define BSIM3V2_GBS 768
-#define BSIM3V2_QB 769
-#define BSIM3V2_CQB 770
-#define BSIM3V2_QG 771
-#define BSIM3V2_CQG 772
-#define BSIM3V2_QD 773
-#define BSIM3V2_CQD 774
-#define BSIM3V2_CGG 775
-#define BSIM3V2_CGD 776
-#define BSIM3V2_CGS 777
-#define BSIM3V2_CBG 778
-#define BSIM3V2_CAPBD 779
-#define BSIM3V2_CQBD 780
-#define BSIM3V2_CAPBS 781
-#define BSIM3V2_CQBS 782
-#define BSIM3V2_CDG 783
-#define BSIM3V2_CDD 784
-#define BSIM3V2_CDS 785
-#define BSIM3V2_VON 786
-#define BSIM3V2_VDSAT 787
-#define BSIM3V2_QBS 788
-#define BSIM3V2_QBD 789
-#define BSIM3V2_SOURCECONDUCT 790
-#define BSIM3V2_DRAINCONDUCT 791
-#define BSIM3V2_CBDB 792
-#define BSIM3V2_CBSB 793
-
-
-#include "bsim3v2ext.h"
-
-#ifdef __STDC__
-extern void BSIM3V2evaluate(double,double,double,BSIM3V2instance*,BSIM3V2model*,
- double*,double*,double*, double*, double*, double*, double*,
- double*, double*, double*, double*, double*, double*, double*,
- double*, double*, double*, double*, CKTcircuit*);
-extern int BSIM3V2debug(BSIM3V2model*, BSIM3V2instance*, CKTcircuit*, int);
-extern int BSIM3V2checkModel(BSIM3V2model*, BSIM3V2instance*, CKTcircuit*);
-#else /* stdc */
-extern void BSIM3V2evaluate();
-extern int BSIM3V2debug();
-extern int BSIM3V2checkModel();
-#endif /* stdc */
-
-#endif /*BSIM3V2*/
-
diff --git a/src/spicelib/devices/bsim3v2/bsim3v2ext.h b/src/spicelib/devices/bsim3v2/bsim3v2ext.h
deleted file mode 100644
index 65c1c5b9d..000000000
--- a/src/spicelib/devices/bsim3v2/bsim3v2ext.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1991 JianHui Huang and Min-Chie Jeng.
-File: bsim3v2ext.h
-**********/
-
-#ifdef __STDC__
-extern int BSIM3V2acLoad(GENmodel *,CKTcircuit*);
-extern int BSIM3V2ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*);
-extern int BSIM3V2convTest(GENmodel *,CKTcircuit*);
-extern int BSIM3V2delete(GENmodel*,IFuid,GENinstance**);
-extern void BSIM3V2destroy(GENmodel**);
-extern int BSIM3V2getic(GENmodel*,CKTcircuit*);
-extern int BSIM3V2load(GENmodel*,CKTcircuit*);
-extern int BSIM3V2mAsk(CKTcircuit*,GENmodel *,int, IFvalue*);
-extern int BSIM3V2mDelete(GENmodel**,IFuid,GENmodel*);
-extern int BSIM3V2mParam(int,IFvalue*,GENmodel*);
-extern void BSIM3V2mosCap(CKTcircuit*, double, double, double, double,
- double, double, double, double, double, double, double,
- double, double, double, double, double, double, double*,
- double*, double*, double*, double*, double*, double*, double*,
- double*, double*, double*, double*, double*, double*, double*,
- double*);
-extern int BSIM3V2param(int,IFvalue*,GENinstance*,IFvalue*);
-extern int BSIM3V2pzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
-extern int BSIM3V2setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
-extern int BSIM3V2unsetup(GENmodel*,CKTcircuit*);
-extern int BSIM3V2temp(GENmodel*,CKTcircuit*);
-extern int BSIM3V2trunc(GENmodel*,CKTcircuit*,double*);
-extern int BSIM3V2noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
-
-#else /* stdc */
-extern int BSIM3V2acLoad();
-extern int BSIM3V2delete();
-extern void BSIM3V2destroy();
-extern int BSIM3V2getic();
-extern int BSIM3V2load();
-extern int BSIM3V2mDelete();
-extern int BSIM3V2ask();
-extern int BSIM3V2mAsk();
-extern int BSIM3V2convTest();
-extern int BSIM3V2temp();
-extern int BSIM3V2mParam();
-extern void BSIM3V2mosCap();
-extern int BSIM3V2param();
-extern int BSIM3V2pzLoad();
-extern int BSIM3V2setup();
-extern int BSIM3V2unsetup();
-extern int BSIM3V2trunc();
-extern int BSIM3V2noise();
-
-#endif /* stdc */
-
diff --git a/src/spicelib/devices/bsim3v2/bsim3v2init.c b/src/spicelib/devices/bsim3v2/bsim3v2init.c
deleted file mode 100644
index e47c492cd..000000000
--- a/src/spicelib/devices/bsim3v2/bsim3v2init.c
+++ /dev/null
@@ -1,80 +0,0 @@
-#include
-
-#include
-
-#include "bsim3v2itf.h"
-#include "bsim3v2ext.h"
-#include "bsim3v2init.h"
-
-
-SPICEdev BSIM3V2info = {
- { "BSIM3V2",
- "Berkeley Short Channel IGFET Model Version-3 (3v3.2)",
-
- &BSIM3V2nSize,
- &BSIM3V2nSize,
- BSIM3V2names,
-
- &BSIM3V2pTSize,
- BSIM3V2pTable,
-
- &BSIM3V2mPTSize,
- BSIM3V2mPTable,
-
-#ifdef XSPICE
-/*---- Fixed by SDB 5.2.2003 to enable XSPICE/tclspice integration -----*/
- NULL, /* This is a SPICE device, it has no MIF info data */
-
- 0, /* This is a SPICE device, it has no MIF info data */
- NULL, /* This is a SPICE device, it has no MIF info data */
-
- 0, /* This is a SPICE device, it has no MIF info data */
- NULL, /* This is a SPICE device, it has no MIF info data */
-
- 0, /* This is a SPICE device, it has no MIF info data */
- NULL, /* This is a SPICE device, it has no MIF info data */
-/*--------------------------- End of SDB fix -------------------------*/
-#endif
-
- DEV_DEFAULT
- },
-
- DEVparam : BSIM3V2param,
- DEVmodParam : BSIM3V2mParam,
- DEVload : BSIM3V2load,
- DEVsetup : BSIM3V2setup,
- DEVunsetup : BSIM3V2unsetup,
- DEVpzSetup : BSIM3V2setup,
- DEVtemperature: BSIM3V2temp,
- DEVtrunc : BSIM3V2trunc,
- DEVfindBranch : NULL,
- DEVacLoad : BSIM3V2acLoad,
- DEVaccept : NULL,
- DEVdestroy : BSIM3V2destroy,
- DEVmodDelete : BSIM3V2mDelete,
- DEVdelete : BSIM3V2delete,
- DEVsetic : BSIM3V2getic,
- DEVask : BSIM3V2ask,
- DEVmodAsk : BSIM3V2mAsk,
- DEVpzLoad : BSIM3V2pzLoad,
- DEVconvTest : BSIM3V2convTest,
- DEVsenSetup : NULL,
- DEVsenLoad : NULL,
- DEVsenUpdate : NULL,
- DEVsenAcLoad : NULL,
- DEVsenPrint : NULL,
- DEVsenTrunc : NULL,
- DEVdisto : NULL,
- DEVnoise : BSIM3V2noise,
-
- DEVinstSize : &BSIM3V2iSize,
- DEVmodSize : &BSIM3V2mSize
-
-};
-
-
-SPICEdev *
-get_bsim3v2_info(void)
-{
- return &BSIM3V2info;
-}
diff --git a/src/spicelib/devices/bsim3v2/bsim3v2init.h b/src/spicelib/devices/bsim3v2/bsim3v2init.h
deleted file mode 100644
index 3ac12cfc5..000000000
--- a/src/spicelib/devices/bsim3v2/bsim3v2init.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _BSIM3V2INIT_H
-#define _BSIM3V2INIT_H
-
-extern IFparm BSIM3V2pTable[ ];
-extern IFparm BSIM3V2mPTable[ ];
-extern char *BSIM3V2names[ ];
-extern int BSIM3V2pTSize;
-extern int BSIM3V2mPTSize;
-extern int BSIM3V2nSize;
-extern int BSIM3V2iSize;
-extern int BSIM3V2mSize;
-
-#endif
diff --git a/src/spicelib/devices/bsim3v2/bsim3v2itf.h b/src/spicelib/devices/bsim3v2/bsim3v2itf.h
deleted file mode 100644
index 666329678..000000000
--- a/src/spicelib/devices/bsim3v2/bsim3v2itf.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/**********
-Copyright 1990 Regents of the University of California. All rights reserved.
-Author: 1991 JianHui Huang and Min-Chie Jeng.
-File: bsim3v2itf.h
-**********/
-#ifndef DEV_BSIM3V2
-#define DEV_BSIM3V2
-
-SPICEdev *get_bsim3v2_info(void);
-
-#endif