diff --git a/configure.ac b/configure.ac index 2d8e2f5bb..344e72cba 100644 --- a/configure.ac +++ b/configure.ac @@ -1078,7 +1078,6 @@ AC_CONFIG_FILES([Makefile src/spicelib/devices/bsim3v1/Makefile src/spicelib/devices/bsim3v32/Makefile src/spicelib/devices/bsim4/Makefile - src/spicelib/devices/bsim4v4/Makefile src/spicelib/devices/bsim4v5/Makefile src/spicelib/devices/bsim4v6/Makefile src/spicelib/devices/bsim3soi_pd/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 8e88ab681..67f429c75 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -53,7 +53,6 @@ DYNAMIC_DEVICELIBS = \ spicelib/devices/bsim3v1/libbsim3v1.la \ spicelib/devices/bsim3v32/libbsim3v32.la \ spicelib/devices/bsim4/libbsim4.la \ - spicelib/devices/bsim4v4/libbsim4v4.la \ spicelib/devices/bsim4v5/libbsim4v5.la \ spicelib/devices/bsim4v6/libbsim4v6.la \ spicelib/devices/cap/libcap.la \ diff --git a/src/spicelib/devices/Makefile.am b/src/spicelib/devices/Makefile.am index e5a9a5afe..027ee8a2d 100644 --- a/src/spicelib/devices/Makefile.am +++ b/src/spicelib/devices/Makefile.am @@ -8,7 +8,6 @@ SUBDIRS = \ bsim3 \ bsimsoi \ bsim4 \ - bsim4v4 \ bsim4v5 \ bsim4v6 \ bsim3v0 \ @@ -68,7 +67,6 @@ DIST_SUBDIRS = \ bsim3 \ bsimsoi \ bsim4 \ - bsim4v4 \ bsim4v5 \ bsim4v6 \ bsim3v0 \ diff --git a/src/spicelib/devices/bsim4v4/B4TERMS_OF_USE b/src/spicelib/devices/bsim4v4/B4TERMS_OF_USE deleted file mode 100644 index 42d4bfe4e..000000000 --- a/src/spicelib/devices/bsim4v4/B4TERMS_OF_USE +++ /dev/null @@ -1,33 +0,0 @@ - -The terms under which the software is provided are as the following. - -Software is distributed as is, completely without warranty or service -support. The University of California and its employees are not liable -for the condition or performance of the software. - -The University owns the copyright but shall not be liable for any -infringement of copyright or other proprietary rights brought by third -parties against the users of the software. - -The University of California hereby disclaims all implied warranties. - -The University of California grants the users the right to modify, copy, -and redistribute the software and documentation, both within the user's -organization and externally, subject to the following restrictions: - -1. The users agree not to charge for the University of California code - itself but may charge for additions, extensions, or support. - -2. In any product based on the software, the users agree to acknowledge - the UC Berkeley BSIM Research Group that developed the software. This - acknowledgment shall appear in the product documentation. - -3. The users agree to obey all U.S. Government restrictions governing - redistribution or export of the software. - -4. The users agree to reproduce any copyright notice which appears on - the software on any copy or modification of such made available - to others. - -Chenming Hu, and Jane Xuemei Xi -April. 2003 diff --git a/src/spicelib/devices/bsim4v4/Makefile.am b/src/spicelib/devices/bsim4v4/Makefile.am deleted file mode 100644 index a4f55eb42..000000000 --- a/src/spicelib/devices/bsim4v4/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## Process this file with automake to produce Makefile.in - -noinst_LTLIBRARIES = libbsim4v4.la - -libbsim4v4_la_SOURCES = \ - b4v4.c \ - b4v4acld.c \ - b4v4ask.c \ - b4v4check.c \ - b4v4cvtest.c \ - b4v4del.c \ - b4v4dest.c \ - b4v4geo.c \ - b4v4getic.c \ - b4v4ld.c \ - b4v4mask.c \ - b4v4mdel.c \ - b4v4mpar.c \ - b4v4noi.c \ - b4v4par.c \ - b4v4pzld.c \ - b4v4set.c \ - b4v4temp.c \ - b4v4trunc.c \ - bsim4v4def.h \ - bsim4v4ext.h \ - bsim4v4init.c \ - bsim4v4init.h \ - bsim4v4itf.h - - - -AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -AM_CFLAGS = $(STATIC) - -MAINTAINERCLEANFILES = Makefile.in - -EXTRA_DIST = B4TERMS_OF_USE diff --git a/src/spicelib/devices/bsim4v4/b4v4.c b/src/spicelib/devices/bsim4v4/b4v4.c deleted file mode 100644 index c6db03fe6..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4.c +++ /dev/null @@ -1,819 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 03/04/2004. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/devdefs.h" -#include "bsim4v4def.h" -#include "ngspice/suffix.h" - -IFparm BSIM4v4pTable[] = { /* parameters */ -IOP( "l", BSIM4v4_L, IF_REAL , "Length"), -IOP( "w", BSIM4v4_W, IF_REAL , "Width"), -IOP( "m", BSIM4v4_M, IF_REAL , "Separate Parallel multiplier"), -IOP( "nf", BSIM4v4_NF, IF_REAL , "Number of fingers"), -IOP( "sa", BSIM4v4_SA, IF_REAL , "distance between OD edge to poly of one side "), -IOP( "sb", BSIM4v4_SB, IF_REAL , "distance between OD edge to poly of the other side"), -IOP( "sd", BSIM4v4_SD, IF_REAL , "distance between neighbour fingers"), -IOP( "min", BSIM4v4_MIN, IF_INTEGER , "Minimize either D or S"), -IOP( "ad", BSIM4v4_AD, IF_REAL , "Drain area"), -IOP( "as", BSIM4v4_AS, IF_REAL , "Source area"), -IOP( "pd", BSIM4v4_PD, IF_REAL , "Drain perimeter"), -IOP( "ps", BSIM4v4_PS, IF_REAL , "Source perimeter"), -IOP( "nrd", BSIM4v4_NRD, IF_REAL , "Number of squares in drain"), -IOP( "nrs", BSIM4v4_NRS, IF_REAL , "Number of squares in source"), -IOP( "off", BSIM4v4_OFF, IF_FLAG , "Device is initially off"), -IOP( "rbdb", BSIM4v4_RBDB, IF_REAL , "Body resistance"), -IOP( "rbsb", BSIM4v4_RBSB, IF_REAL , "Body resistance"), -IOP( "rbpb", BSIM4v4_RBPB, IF_REAL , "Body resistance"), -IOP( "rbps", BSIM4v4_RBPS, IF_REAL , "Body resistance"), -IOP( "rbpd", BSIM4v4_RBPD, IF_REAL , "Body resistance"), -IOP( "trnqsmod", BSIM4v4_TRNQSMOD, IF_INTEGER, "Transient NQS model selector"), -IOP( "acnqsmod", BSIM4v4_ACNQSMOD, IF_INTEGER, "AC NQS model selector"), -IOP( "rbodymod", BSIM4v4_RBODYMOD, IF_INTEGER, "Distributed body R model selector"), -IOP( "rgatemod", BSIM4v4_RGATEMOD, IF_INTEGER, "Gate resistance model selector"), -IOP( "geomod", BSIM4v4_GEOMOD, IF_INTEGER, "Geometry dependent parasitics model selector"), -IOP( "rgeomod", BSIM4v4_RGEOMOD, IF_INTEGER, "S/D resistance and contact model selector"), -IP( "ic", BSIM4v4_IC, IF_REALVEC , "Vector of DS,GS,BS initial voltages"), -OP( "gmbs", BSIM4v4_GMBS, IF_REAL, "Gmb"), -OP( "gm", BSIM4v4_GM, IF_REAL, "Gm"), -OP( "gds", BSIM4v4_GDS, IF_REAL, "Gds"), -OP( "vdsat", BSIM4v4_VDSAT, IF_REAL, "Vdsat"), -OP( "vth", BSIM4v4_VON, IF_REAL, "Vth"), -OP( "id", BSIM4v4_CD, IF_REAL, "Ids"), -OP( "ibd", BSIM4v4_CBD, IF_REAL, "Ibd"), -OP( "ibs", BSIM4v4_CBS, IF_REAL, "Ibs"), -OP( "gbd", BSIM4v4_GBD, IF_REAL, "gbd"), -OP( "gbs", BSIM4v4_GBS, IF_REAL, "gbs"), -OP( "isub", BSIM4v4_CSUB, IF_REAL, "Isub"), -OP( "igidl", BSIM4v4_IGIDL, IF_REAL, "Igidl"), -OP( "igisl", BSIM4v4_IGISL, IF_REAL, "Igisl"), -OP( "igs", BSIM4v4_IGS, IF_REAL, "Igs"), -OP( "igd", BSIM4v4_IGD, IF_REAL, "Igd"), -OP( "igb", BSIM4v4_IGB, IF_REAL, "Igb"), -OP( "igcs", BSIM4v4_IGCS, IF_REAL, "Igcs"), -OP( "igcd", BSIM4v4_IGCD, IF_REAL, "Igcd"), -OP( "vbs", BSIM4v4_VBS, IF_REAL, "Vbs"), -OP( "vgs", BSIM4v4_VGS, IF_REAL, "Vgs"), -OP( "vds", BSIM4v4_VDS, IF_REAL, "Vds"), -OP( "cgg", BSIM4v4_CGGB, IF_REAL, "Cggb"), -OP( "cgs", BSIM4v4_CGSB, IF_REAL, "Cgsb"), -OP( "cgd", BSIM4v4_CGDB, IF_REAL, "Cgdb"), -OP( "cbg", BSIM4v4_CBGB, IF_REAL, "Cbgb"), -OP( "cbd", BSIM4v4_CBDB, IF_REAL, "Cbdb"), -OP( "cbs", BSIM4v4_CBSB, IF_REAL, "Cbsb"), -OP( "cdg", BSIM4v4_CDGB, IF_REAL, "Cdgb"), -OP( "cdd", BSIM4v4_CDDB, IF_REAL, "Cddb"), -OP( "cds", BSIM4v4_CDSB, IF_REAL, "Cdsb"), -OP( "csg", BSIM4v4_CSGB, IF_REAL, "Csgb"), -OP( "csd", BSIM4v4_CSDB, IF_REAL, "Csdb"), -OP( "css", BSIM4v4_CSSB, IF_REAL, "Cssb"), -OP( "cgb", BSIM4v4_CGBB, IF_REAL, "Cgbb"), -OP( "cdb", BSIM4v4_CDBB, IF_REAL, "Cdbb"), -OP( "csb", BSIM4v4_CSBB, IF_REAL, "Csbb"), -OP( "cbb", BSIM4v4_CBBB, IF_REAL, "Cbbb"), -OP( "capbd", BSIM4v4_CAPBD, IF_REAL, "Capbd"), -OP( "capbs", BSIM4v4_CAPBS, IF_REAL, "Capbs"), -OP( "qg", BSIM4v4_QG, IF_REAL, "Qgate"), -OP( "qb", BSIM4v4_QB, IF_REAL, "Qbulk"), -OP( "qd", BSIM4v4_QD, IF_REAL, "Qdrain"), -OP( "qs", BSIM4v4_QS, IF_REAL, "Qsource"), -OP( "qinv", BSIM4v4_QINV, IF_REAL, "Qinversion"), -}; - -IFparm BSIM4v4mPTable[] = { /* model parameters */ -IOP( "capmod", BSIM4v4_MOD_CAPMOD, IF_INTEGER, "Capacitance model selector"), -IOP( "diomod", BSIM4v4_MOD_DIOMOD, IF_INTEGER, "Diode IV model selector"), -IOP( "rdsmod", BSIM4v4_MOD_RDSMOD, IF_INTEGER, "Bias-dependent S/D resistance model selector"), -IOP( "trnqsmod", BSIM4v4_MOD_TRNQSMOD, IF_INTEGER, "Transient NQS model selector"), -IOP( "acnqsmod", BSIM4v4_MOD_ACNQSMOD, IF_INTEGER, "AC NQS model selector"), -IOP( "mobmod", BSIM4v4_MOD_MOBMOD, IF_INTEGER, "Mobility model selector"), -IOP( "rbodymod", BSIM4v4_MOD_RBODYMOD, IF_INTEGER, "Distributed body R model selector"), -IOP( "rgatemod", BSIM4v4_MOD_RGATEMOD, IF_INTEGER, "Gate R model selector"), -IOP( "permod", BSIM4v4_MOD_PERMOD, IF_INTEGER, "Pd and Ps model selector"), -IOP( "geomod", BSIM4v4_MOD_GEOMOD, IF_INTEGER, "Geometry dependent parasitics model selector"), -IOP( "fnoimod", BSIM4v4_MOD_FNOIMOD, IF_INTEGER, "Flicker noise model selector"), -IOP( "tnoimod", BSIM4v4_MOD_TNOIMOD, IF_INTEGER, "Thermal noise model selector"), -IOP( "igcmod", BSIM4v4_MOD_IGCMOD, IF_INTEGER, "Gate-to-channel Ig model selector"), -IOP( "igbmod", BSIM4v4_MOD_IGBMOD, IF_INTEGER, "Gate-to-body Ig model selector"), -IOP( "tempmod", BSIM4v4_MOD_TEMPMOD, IF_INTEGER, "Temperature model selector"), -IOP( "paramchk", BSIM4v4_MOD_PARAMCHK, IF_INTEGER, "Model parameter checking selector"), -IOP( "binunit", BSIM4v4_MOD_BINUNIT, IF_INTEGER, "Bin unit selector"), -IOP( "version", BSIM4v4_MOD_VERSION, IF_STRING, "parameter for model version"), -IOP( "toxe", BSIM4v4_MOD_TOXE, IF_REAL, "Electrical gate oxide thickness in meters"), -IOP( "toxp", BSIM4v4_MOD_TOXP, IF_REAL, "Physical gate oxide thickness in meters"), -IOP( "toxm", BSIM4v4_MOD_TOXM, IF_REAL, "Gate oxide thickness at which parameters are extracted"), -IOP( "toxref", BSIM4v4_MOD_TOXREF, IF_REAL, "Target tox value"), -IOP( "dtox", BSIM4v4_MOD_DTOX, IF_REAL, "Defined as (toxe - toxp) "), -IOP( "epsrox", BSIM4v4_MOD_EPSROX, IF_REAL, "Dielectric constant of the gate oxide relative to vacuum"), -IOP( "cdsc", BSIM4v4_MOD_CDSC, IF_REAL, "Drain/Source and channel coupling capacitance"), -IOP( "cdscb", BSIM4v4_MOD_CDSCB, IF_REAL, "Body-bias dependence of cdsc"), -IOP( "cdscd", BSIM4v4_MOD_CDSCD, IF_REAL, "Drain-bias dependence of cdsc"), -IOP( "cit", BSIM4v4_MOD_CIT, IF_REAL, "Interface state capacitance"), -IOP( "nfactor", BSIM4v4_MOD_NFACTOR, IF_REAL, "Subthreshold swing Coefficient"), -IOP( "xj", BSIM4v4_MOD_XJ, IF_REAL, "Junction depth in meters"), -IOP( "vsat", BSIM4v4_MOD_VSAT, IF_REAL, "Saturation velocity at tnom"), -IOP( "at", BSIM4v4_MOD_AT, IF_REAL, "Temperature coefficient of vsat"), -IOP( "a0", BSIM4v4_MOD_A0, IF_REAL, "Non-uniform depletion width effect coefficient."), -IOP( "ags", BSIM4v4_MOD_AGS, IF_REAL, "Gate bias coefficient of Abulk."), -IOP( "a1", BSIM4v4_MOD_A1, IF_REAL, "Non-saturation effect coefficient"), -IOP( "a2", BSIM4v4_MOD_A2, IF_REAL, "Non-saturation effect coefficient"), -IOP( "keta", BSIM4v4_MOD_KETA, IF_REAL, "Body-bias coefficient of non-uniform depletion width effect."), -IOP( "nsub", BSIM4v4_MOD_NSUB, IF_REAL, "Substrate doping concentration"), -IOP( "ndep", BSIM4v4_MOD_NDEP, IF_REAL, "Channel doping concentration at the depletion edge"), -IOP( "nsd", BSIM4v4_MOD_NSD, IF_REAL, "S/D doping concentration"), -IOP( "phin", BSIM4v4_MOD_PHIN, IF_REAL, "Adjusting parameter for surface potential due to non-uniform vertical doping"), -IOP( "ngate", BSIM4v4_MOD_NGATE, IF_REAL, "Poly-gate doping concentration"), -IOP( "gamma1", BSIM4v4_MOD_GAMMA1, IF_REAL, "Vth body coefficient"), -IOP( "gamma2", BSIM4v4_MOD_GAMMA2, IF_REAL, "Vth body coefficient"), -IOP( "vbx", BSIM4v4_MOD_VBX, IF_REAL, "Vth transition body Voltage"), -IOP( "vbm", BSIM4v4_MOD_VBM, IF_REAL, "Maximum body voltage"), - -IOP( "xt", BSIM4v4_MOD_XT, IF_REAL, "Doping depth"), -IOP( "k1", BSIM4v4_MOD_K1, IF_REAL, "Bulk effect coefficient 1"), -IOP( "kt1", BSIM4v4_MOD_KT1, IF_REAL, "Temperature coefficient of Vth"), -IOP( "kt1l", BSIM4v4_MOD_KT1L, IF_REAL, "Temperature coefficient of Vth"), -IOP( "kt2", BSIM4v4_MOD_KT2, IF_REAL, "Body-coefficient of kt1"), -IOP( "k2", BSIM4v4_MOD_K2, IF_REAL, "Bulk effect coefficient 2"), -IOP( "k3", BSIM4v4_MOD_K3, IF_REAL, "Narrow width effect coefficient"), -IOP( "k3b", BSIM4v4_MOD_K3B, IF_REAL, "Body effect coefficient of k3"), -IOP( "w0", BSIM4v4_MOD_W0, IF_REAL, "Narrow width effect parameter"), -IOP( "dvtp0", BSIM4v4_MOD_DVTP0, IF_REAL, "First parameter for Vth shift due to pocket"), -IOP( "dvtp1", BSIM4v4_MOD_DVTP1, IF_REAL, "Second parameter for Vth shift due to pocket"), -IOP( "lpe0", BSIM4v4_MOD_LPE0, IF_REAL, "Equivalent length of pocket region at zero bias"), -IOP( "lpeb", BSIM4v4_MOD_LPEB, IF_REAL, "Equivalent length of pocket region accounting for body bias"), -IOP( "dvt0", BSIM4v4_MOD_DVT0, IF_REAL, "Short channel effect coeff. 0"), -IOP( "dvt1", BSIM4v4_MOD_DVT1, IF_REAL, "Short channel effect coeff. 1"), -IOP( "dvt2", BSIM4v4_MOD_DVT2, IF_REAL, "Short channel effect coeff. 2"), -IOP( "dvt0w", BSIM4v4_MOD_DVT0W, IF_REAL, "Narrow Width coeff. 0"), -IOP( "dvt1w", BSIM4v4_MOD_DVT1W, IF_REAL, "Narrow Width effect coeff. 1"), -IOP( "dvt2w", BSIM4v4_MOD_DVT2W, IF_REAL, "Narrow Width effect coeff. 2"), -IOP( "drout", BSIM4v4_MOD_DROUT, IF_REAL, "DIBL coefficient of output resistance"), -IOP( "dsub", BSIM4v4_MOD_DSUB, IF_REAL, "DIBL coefficient in the subthreshold region"), -IOP( "vth0", BSIM4v4_MOD_VTH0, IF_REAL,"Threshold voltage"), -IOP( "vtho", BSIM4v4_MOD_VTH0, IF_REAL,"Threshold voltage"), -IOP( "ua", BSIM4v4_MOD_UA, IF_REAL, "Linear gate dependence of mobility"), -IOP( "ua1", BSIM4v4_MOD_UA1, IF_REAL, "Temperature coefficient of ua"), -IOP( "ub", BSIM4v4_MOD_UB, IF_REAL, "Quadratic gate dependence of mobility"), -IOP( "ub1", BSIM4v4_MOD_UB1, IF_REAL, "Temperature coefficient of ub"), -IOP( "uc", BSIM4v4_MOD_UC, IF_REAL, "Body-bias dependence of mobility"), -IOP( "uc1", BSIM4v4_MOD_UC1, IF_REAL, "Temperature coefficient of uc"), -IOP( "u0", BSIM4v4_MOD_U0, IF_REAL, "Low-field mobility at Tnom"), -IOP( "eu", BSIM4v4_MOD_EU, IF_REAL, "Mobility exponent"), -IOP( "ute", BSIM4v4_MOD_UTE, IF_REAL, "Temperature coefficient of mobility"), -IOP( "voff", BSIM4v4_MOD_VOFF, IF_REAL, "Threshold voltage offset"), -IOP( "minv", BSIM4v4_MOD_MINV, IF_REAL, "Fitting parameter for moderate invversion in Vgsteff"), -IOP( "voffl", BSIM4v4_MOD_VOFFL, IF_REAL, "Length dependence parameter for Vth offset"), -IOP( "tnom", BSIM4v4_MOD_TNOM, IF_REAL, "Parameter measurement temperature"), -IOP( "cgso", BSIM4v4_MOD_CGSO, IF_REAL, "Gate-source overlap capacitance per width"), -IOP( "cgdo", BSIM4v4_MOD_CGDO, IF_REAL, "Gate-drain overlap capacitance per width"), -IOP( "cgbo", BSIM4v4_MOD_CGBO, IF_REAL, "Gate-bulk overlap capacitance per length"), -IOP( "xpart", BSIM4v4_MOD_XPART, IF_REAL, "Channel charge partitioning"), -IOP( "delta", BSIM4v4_MOD_DELTA, IF_REAL, "Effective Vds parameter"), -IOP( "rsh", BSIM4v4_MOD_RSH, IF_REAL, "Source-drain sheet resistance"), -IOP( "rdsw", BSIM4v4_MOD_RDSW, IF_REAL, "Source-drain resistance per width"), -IOP( "rdswmin", BSIM4v4_MOD_RDSWMIN, IF_REAL, "Source-drain resistance per width at high Vg"), -IOP( "rsw", BSIM4v4_MOD_RSW, IF_REAL, "Source resistance per width"), -IOP( "rdw", BSIM4v4_MOD_RDW, IF_REAL, "Drain resistance per width"), -IOP( "rdwmin", BSIM4v4_MOD_RDWMIN, IF_REAL, "Drain resistance per width at high Vg"), -IOP( "rswmin", BSIM4v4_MOD_RSWMIN, IF_REAL, "Source resistance per width at high Vg"), - -IOP( "prwg", BSIM4v4_MOD_PRWG, IF_REAL, "Gate-bias effect on parasitic resistance "), -IOP( "prwb", BSIM4v4_MOD_PRWB, IF_REAL, "Body-effect on parasitic resistance "), - -IOP( "prt", BSIM4v4_MOD_PRT, IF_REAL, "Temperature coefficient of parasitic resistance "), -IOP( "eta0", BSIM4v4_MOD_ETA0, IF_REAL, "Subthreshold region DIBL coefficient"), -IOP( "etab", BSIM4v4_MOD_ETAB, IF_REAL, "Subthreshold region DIBL coefficient"), -IOP( "pclm", BSIM4v4_MOD_PCLM, IF_REAL, "Channel length modulation Coefficient"), -IOP( "pdiblc1", BSIM4v4_MOD_PDIBL1, IF_REAL, "Drain-induced barrier lowering coefficient"), -IOP( "pdiblc2", BSIM4v4_MOD_PDIBL2, IF_REAL, "Drain-induced barrier lowering coefficient"), -IOP( "pdiblcb", BSIM4v4_MOD_PDIBLB, IF_REAL, "Body-effect on drain-induced barrier lowering"), -IOP( "fprout", BSIM4v4_MOD_FPROUT, IF_REAL, "Rout degradation coefficient for pocket devices"), -IOP( "pdits", BSIM4v4_MOD_PDITS, IF_REAL, "Coefficient for drain-induced Vth shifts"), -IOP( "pditsl", BSIM4v4_MOD_PDITSL, IF_REAL, "Length dependence of drain-induced Vth shifts"), -IOP( "pditsd", BSIM4v4_MOD_PDITSD, IF_REAL, "Vds dependence of drain-induced Vth shifts"), -IOP( "pscbe1", BSIM4v4_MOD_PSCBE1, IF_REAL, "Substrate current body-effect coefficient"), -IOP( "pscbe2", BSIM4v4_MOD_PSCBE2, IF_REAL, "Substrate current body-effect coefficient"), -IOP( "pvag", BSIM4v4_MOD_PVAG, IF_REAL, "Gate dependence of output resistance parameter"), - -IOP( "jss", BSIM4v4_MOD_JSS, IF_REAL, "Bottom source junction reverse saturation current density"), -IOP( "jsws", BSIM4v4_MOD_JSWS, IF_REAL, "Isolation edge sidewall source junction reverse saturation current density"), -IOP( "jswgs", BSIM4v4_MOD_JSWGS, IF_REAL, "Gate edge source junction reverse saturation current density"), -IOP( "pbs", BSIM4v4_MOD_PBS, IF_REAL, "Source junction built-in potential"), -IOP( "njs", BSIM4v4_MOD_NJS, IF_REAL, "Source junction emission coefficient"), -IOP( "xtis", BSIM4v4_MOD_XTIS, IF_REAL, "Source junction current temperature exponent"), -IOP( "mjs", BSIM4v4_MOD_MJS, IF_REAL, "Source bottom junction capacitance grading coefficient"), -IOP( "pbsws", BSIM4v4_MOD_PBSWS, IF_REAL, "Source sidewall junction capacitance built in potential"), -IOP( "mjsws", BSIM4v4_MOD_MJSWS, IF_REAL, "Source sidewall junction capacitance grading coefficient"), -IOP( "pbswgs", BSIM4v4_MOD_PBSWGS, IF_REAL, "Source (gate side) sidewall junction capacitance built in potential"), -IOP( "mjswgs", BSIM4v4_MOD_MJSWGS, IF_REAL, "Source (gate side) sidewall junction capacitance grading coefficient"), -IOP( "cjs", BSIM4v4_MOD_CJS, IF_REAL, "Source bottom junction capacitance per unit area"), -IOP( "cjsws", BSIM4v4_MOD_CJSWS, IF_REAL, "Source sidewall junction capacitance per unit periphery"), -IOP( "cjswgs", BSIM4v4_MOD_CJSWGS, IF_REAL, "Source (gate side) sidewall junction capacitance per unit width"), - -IOP( "jsd", BSIM4v4_MOD_JSD, IF_REAL, "Bottom drain junction reverse saturation current density"), -IOP( "jswd", BSIM4v4_MOD_JSWD, IF_REAL, "Isolation edge sidewall drain junction reverse saturation current density"), -IOP( "jswgd", BSIM4v4_MOD_JSWGD, IF_REAL, "Gate edge drain junction reverse saturation current density"), -IOP( "pbd", BSIM4v4_MOD_PBD, IF_REAL, "Drain junction built-in potential"), -IOP( "njd", BSIM4v4_MOD_NJD, IF_REAL, "Drain junction emission coefficient"), -IOP( "xtid", BSIM4v4_MOD_XTID, IF_REAL, "Drainjunction current temperature exponent"), -IOP( "mjd", BSIM4v4_MOD_MJD, IF_REAL, "Drain bottom junction capacitance grading coefficient"), -IOP( "pbswd", BSIM4v4_MOD_PBSWD, IF_REAL, "Drain sidewall junction capacitance built in potential"), -IOP( "mjswd", BSIM4v4_MOD_MJSWD, IF_REAL, "Drain sidewall junction capacitance grading coefficient"), -IOP( "pbswgd", BSIM4v4_MOD_PBSWGD, IF_REAL, "Drain (gate side) sidewall junction capacitance built in potential"), -IOP( "mjswgd", BSIM4v4_MOD_MJSWGD, IF_REAL, "Drain (gate side) sidewall junction capacitance grading coefficient"), -IOP( "cjd", BSIM4v4_MOD_CJD, IF_REAL, "Drain bottom junction capacitance per unit area"), -IOP( "cjswd", BSIM4v4_MOD_CJSWD, IF_REAL, "Drain sidewall junction capacitance per unit periphery"), -IOP( "cjswgd", BSIM4v4_MOD_CJSWGD, IF_REAL, "Drain (gate side) sidewall junction capacitance per unit width"), - -IOP( "vfbcv", BSIM4v4_MOD_VFBCV, IF_REAL, "Flat Band Voltage parameter for capmod=0 only"), -IOP( "vfb", BSIM4v4_MOD_VFB, IF_REAL, "Flat Band Voltage"), -IOP( "tpb", BSIM4v4_MOD_TPB, IF_REAL, "Temperature coefficient of pb"), -IOP( "tcj", BSIM4v4_MOD_TCJ, IF_REAL, "Temperature coefficient of cj"), -IOP( "tpbsw", BSIM4v4_MOD_TPBSW, IF_REAL, "Temperature coefficient of pbsw"), -IOP( "tcjsw", BSIM4v4_MOD_TCJSW, IF_REAL, "Temperature coefficient of cjsw"), -IOP( "tpbswg", BSIM4v4_MOD_TPBSWG, IF_REAL, "Temperature coefficient of pbswg"), -IOP( "tcjswg", BSIM4v4_MOD_TCJSWG, IF_REAL, "Temperature coefficient of cjswg"), -IOP( "acde", BSIM4v4_MOD_ACDE, IF_REAL, "Exponential coefficient for finite charge thickness"), -IOP( "moin", BSIM4v4_MOD_MOIN, IF_REAL, "Coefficient for gate-bias dependent surface potential"), -IOP( "noff", BSIM4v4_MOD_NOFF, IF_REAL, "C-V turn-on/off parameter"), -IOP( "voffcv", BSIM4v4_MOD_VOFFCV, IF_REAL, "C-V lateral-shift parameter"), -IOP( "dmcg", BSIM4v4_MOD_DMCG, IF_REAL, "Distance of Mid-Contact to Gate edge"), -IOP( "dmci", BSIM4v4_MOD_DMCI, IF_REAL, "Distance of Mid-Contact to Isolation"), -IOP( "dmdg", BSIM4v4_MOD_DMDG, IF_REAL, "Distance of Mid-Diffusion to Gate edge"), -IOP( "dmcgt", BSIM4v4_MOD_DMCGT, IF_REAL, "Distance of Mid-Contact to Gate edge in Test structures"), -IOP( "xgw", BSIM4v4_MOD_XGW, IF_REAL, "Distance from gate contact center to device edge"), -IOP( "xgl", BSIM4v4_MOD_XGL, IF_REAL, "Variation in Ldrawn"), -IOP( "rshg", BSIM4v4_MOD_RSHG, IF_REAL, "Gate sheet resistance"), -IOP( "ngcon", BSIM4v4_MOD_NGCON, IF_REAL, "Number of gate contacts"), -IOP( "xrcrg1", BSIM4v4_MOD_XRCRG1, IF_REAL, "First fitting parameter the bias-dependent Rg"), -IOP( "xrcrg2", BSIM4v4_MOD_XRCRG2, IF_REAL, "Second fitting parameter the bias-dependent Rg"), -IOP( "lambda", BSIM4v4_MOD_LAMBDA, IF_REAL, " Velocity overshoot parameter"), -IOP( "vtl", BSIM4v4_MOD_VTL, IF_REAL, " thermal velocity"), -IOP( "lc", BSIM4v4_MOD_LC, IF_REAL, " back scattering parameter"), -IOP( "xn", BSIM4v4_MOD_XN, IF_REAL, " back scattering parameter"), -IOP( "vfbsdoff", BSIM4v4_MOD_VFBSDOFF, IF_REAL, "S/D flatband voltage offset"), -IOP( "lintnoi", BSIM4v4_MOD_LINTNOI, IF_REAL, "lint offset for noise calculation"), -IOP( "lint", BSIM4v4_MOD_LINT, IF_REAL, "Length reduction parameter"), -IOP( "ll", BSIM4v4_MOD_LL, IF_REAL, "Length reduction parameter"), -IOP( "llc", BSIM4v4_MOD_LLC, IF_REAL, "Length reduction parameter for CV"), -IOP( "lln", BSIM4v4_MOD_LLN, IF_REAL, "Length reduction parameter"), -IOP( "lw", BSIM4v4_MOD_LW, IF_REAL, "Length reduction parameter"), -IOP( "lwc", BSIM4v4_MOD_LWC, IF_REAL, "Length reduction parameter for CV"), -IOP( "lwn", BSIM4v4_MOD_LWN, IF_REAL, "Length reduction parameter"), -IOP( "lwl", BSIM4v4_MOD_LWL, IF_REAL, "Length reduction parameter"), -IOP( "lwlc", BSIM4v4_MOD_LWLC, IF_REAL, "Length reduction parameter for CV"), -IOP( "lmin", BSIM4v4_MOD_LMIN, IF_REAL, "Minimum length for the model"), -IOP( "lmax", BSIM4v4_MOD_LMAX, IF_REAL, "Maximum length for the model"), - -IOP( "wr", BSIM4v4_MOD_WR, IF_REAL, "Width dependence of rds"), -IOP( "wint", BSIM4v4_MOD_WINT, IF_REAL, "Width reduction parameter"), -IOP( "dwg", BSIM4v4_MOD_DWG, IF_REAL, "Width reduction parameter"), -IOP( "dwb", BSIM4v4_MOD_DWB, IF_REAL, "Width reduction parameter"), - -IOP( "wl", BSIM4v4_MOD_WL, IF_REAL, "Width reduction parameter"), -IOP( "wlc", BSIM4v4_MOD_WLC, IF_REAL, "Width reduction parameter for CV"), -IOP( "wln", BSIM4v4_MOD_WLN, IF_REAL, "Width reduction parameter"), -IOP( "ww", BSIM4v4_MOD_WW, IF_REAL, "Width reduction parameter"), -IOP( "wwc", BSIM4v4_MOD_WWC, IF_REAL, "Width reduction parameter for CV"), -IOP( "wwn", BSIM4v4_MOD_WWN, IF_REAL, "Width reduction parameter"), -IOP( "wwl", BSIM4v4_MOD_WWL, IF_REAL, "Width reduction parameter"), -IOP( "wwlc", BSIM4v4_MOD_WWLC, IF_REAL, "Width reduction parameter for CV"), -IOP( "wmin", BSIM4v4_MOD_WMIN, IF_REAL, "Minimum width for the model"), -IOP( "wmax", BSIM4v4_MOD_WMAX, IF_REAL, "Maximum width for the model"), - -IOP( "b0", BSIM4v4_MOD_B0, IF_REAL, "Abulk narrow width parameter"), -IOP( "b1", BSIM4v4_MOD_B1, IF_REAL, "Abulk narrow width parameter"), - -IOP( "cgsl", BSIM4v4_MOD_CGSL, IF_REAL, "New C-V model parameter"), -IOP( "cgdl", BSIM4v4_MOD_CGDL, IF_REAL, "New C-V model parameter"), -IOP( "ckappas", BSIM4v4_MOD_CKAPPAS, IF_REAL, "S/G overlap C-V parameter "), -IOP( "ckappad", BSIM4v4_MOD_CKAPPAD, IF_REAL, "D/G overlap C-V parameter"), -IOP( "cf", BSIM4v4_MOD_CF, IF_REAL, "Fringe capacitance parameter"), -IOP( "clc", BSIM4v4_MOD_CLC, IF_REAL, "Vdsat parameter for C-V model"), -IOP( "cle", BSIM4v4_MOD_CLE, IF_REAL, "Vdsat parameter for C-V model"), -IOP( "dwc", BSIM4v4_MOD_DWC, IF_REAL, "Delta W for C-V model"), -IOP( "dlc", BSIM4v4_MOD_DLC, IF_REAL, "Delta L for C-V model"), -IOP( "xw", BSIM4v4_MOD_XW, IF_REAL, "W offset for channel width due to mask/etch effect"), -IOP( "xl", BSIM4v4_MOD_XL, IF_REAL, "L offset for channel length due to mask/etch effect"), -IOP( "dlcig", BSIM4v4_MOD_DLCIG, IF_REAL, "Delta L for Ig model"), -IOP( "dwj", BSIM4v4_MOD_DWJ, IF_REAL, "Delta W for S/D junctions"), - -IOP( "alpha0", BSIM4v4_MOD_ALPHA0, IF_REAL, "substrate current model parameter"), -IOP( "alpha1", BSIM4v4_MOD_ALPHA1, IF_REAL, "substrate current model parameter"), -IOP( "beta0", BSIM4v4_MOD_BETA0, IF_REAL, "substrate current model parameter"), -IOP( "agidl", BSIM4v4_MOD_AGIDL, IF_REAL, "Pre-exponential constant for GIDL"), -IOP( "bgidl", BSIM4v4_MOD_BGIDL, IF_REAL, "Exponential constant for GIDL"), -IOP( "cgidl", BSIM4v4_MOD_CGIDL, IF_REAL, "Parameter for body-bias dependence of GIDL"), -IOP( "egidl", BSIM4v4_MOD_EGIDL, IF_REAL, "Fitting parameter for Bandbending"), -IOP( "aigc", BSIM4v4_MOD_AIGC, IF_REAL, "Parameter for Igc"), -IOP( "bigc", BSIM4v4_MOD_BIGC, IF_REAL, "Parameter for Igc"), -IOP( "cigc", BSIM4v4_MOD_CIGC, IF_REAL, "Parameter for Igc"), -IOP( "aigsd", BSIM4v4_MOD_AIGSD, IF_REAL, "Parameter for Igs,d"), -IOP( "bigsd", BSIM4v4_MOD_BIGSD, IF_REAL, "Parameter for Igs,d"), -IOP( "cigsd", BSIM4v4_MOD_CIGSD, IF_REAL, "Parameter for Igs,d"), -IOP( "aigbacc", BSIM4v4_MOD_AIGBACC, IF_REAL, "Parameter for Igb"), -IOP( "bigbacc", BSIM4v4_MOD_BIGBACC, IF_REAL, "Parameter for Igb"), -IOP( "cigbacc", BSIM4v4_MOD_CIGBACC, IF_REAL, "Parameter for Igb"), -IOP( "aigbinv", BSIM4v4_MOD_AIGBINV, IF_REAL, "Parameter for Igb"), -IOP( "bigbinv", BSIM4v4_MOD_BIGBINV, IF_REAL, "Parameter for Igb"), -IOP( "cigbinv", BSIM4v4_MOD_CIGBINV, IF_REAL, "Parameter for Igb"), -IOP( "nigc", BSIM4v4_MOD_NIGC, IF_REAL, "Parameter for Igc slope"), -IOP( "nigbinv", BSIM4v4_MOD_NIGBINV, IF_REAL, "Parameter for Igbinv slope"), -IOP( "nigbacc", BSIM4v4_MOD_NIGBACC, IF_REAL, "Parameter for Igbacc slope"), -IOP( "ntox", BSIM4v4_MOD_NTOX, IF_REAL, "Exponent for Tox ratio"), -IOP( "eigbinv", BSIM4v4_MOD_EIGBINV, IF_REAL, "Parameter for the Si bandgap for Igbinv"), -IOP( "pigcd", BSIM4v4_MOD_PIGCD, IF_REAL, "Parameter for Igc partition"), -IOP( "poxedge", BSIM4v4_MOD_POXEDGE, IF_REAL, "Factor for the gate edge Tox"), - -IOP( "ijthdfwd", BSIM4v4_MOD_IJTHDFWD, IF_REAL, "Forward drain diode forward limiting current"), -IOP( "ijthsfwd", BSIM4v4_MOD_IJTHSFWD, IF_REAL, "Forward source diode forward limiting current"), -IOP( "ijthdrev", BSIM4v4_MOD_IJTHDREV, IF_REAL, "Reverse drain diode forward limiting current"), -IOP( "ijthsrev", BSIM4v4_MOD_IJTHSREV, IF_REAL, "Reverse source diode forward limiting current"), -IOP( "xjbvd", BSIM4v4_MOD_XJBVD, IF_REAL, "Fitting parameter for drain diode breakdown current"), -IOP( "xjbvs", BSIM4v4_MOD_XJBVS, IF_REAL, "Fitting parameter for source diode breakdown current"), -IOP( "bvd", BSIM4v4_MOD_BVD, IF_REAL, "Drain diode breakdown voltage"), -IOP( "bvs", BSIM4v4_MOD_BVS, IF_REAL, "Source diode breakdown voltage"), - -IOP( "jtss", BSIM4v4_MOD_JTSS, IF_REAL, "Source bottom trap-assisted saturation current density"), -IOP( "jtsd", BSIM4v4_MOD_JTSD, IF_REAL, "Drain bottom trap-assisted saturation current density"), -IOP( "jtssws", BSIM4v4_MOD_JTSSWS, IF_REAL, "Source STI sidewall trap-assisted saturation current density"), -IOP( "jtsswd", BSIM4v4_MOD_JTSSWD, IF_REAL, "Drain STI sidewall trap-assisted saturation current density"), -IOP( "jtsswgs", BSIM4v4_MOD_JTSSWGS, IF_REAL, "Source gate-edge sidewall trap-assisted saturation current density"), -IOP( "jtsswgd", BSIM4v4_MOD_JTSSWGD, IF_REAL, "Drain gate-edge sidewall trap-assisted saturation current density"), -IOP( "njts", BSIM4v4_MOD_NJTS, IF_REAL, "Non-ideality factor for bottom junction"), -IOP( "njtssw", BSIM4v4_MOD_NJTSSW, IF_REAL, "Non-ideality factor for STI sidewall junction"), -IOP( "njtsswg", BSIM4v4_MOD_NJTSSWG, IF_REAL, "Non-ideality factor for gate-edge sidewall junction"), -IOP( "xtss", BSIM4v4_MOD_XTSS, IF_REAL, "Power dependence of JTSS on temperature"), -IOP( "xtsd", BSIM4v4_MOD_XTSD, IF_REAL, "Power dependence of JTSD on temperature"), -IOP( "xtssws", BSIM4v4_MOD_XTSSWS, IF_REAL, "Power dependence of JTSSWS on temperature"), -IOP( "xtsswd", BSIM4v4_MOD_XTSSWD, IF_REAL, "Power dependence of JTSSWD on temperature"), -IOP( "xtsswgs", BSIM4v4_MOD_XTSSWGS, IF_REAL, "Power dependence of JTSSWGS on temperature"), -IOP( "xtsswgd", BSIM4v4_MOD_XTSSWGD, IF_REAL, "Power dependence of JTSSWGD on temperature"), -IOP( "tnjts", BSIM4v4_MOD_TNJTS, IF_REAL, "Temperature coefficient for NJTS"), -IOP( "tnjtssw", BSIM4v4_MOD_TNJTSSW, IF_REAL, "Temperature coefficient for NJTSSW"), -IOP( "tnjtsswg", BSIM4v4_MOD_TNJTSSWG, IF_REAL, "Temperature coefficient for NJTSSWG"), -IOP( "vtss", BSIM4v4_MOD_VTSS, IF_REAL, "Source bottom trap-assisted voltage dependent parameter"), -IOP( "vtsd", BSIM4v4_MOD_VTSD, IF_REAL, "Drain bottom trap-assisted voltage dependent parameter"), -IOP( "vtssws", BSIM4v4_MOD_VTSSWS, IF_REAL, "Source STI sidewall trap-assisted voltage dependent parameter"), -IOP( "vtsswd", BSIM4v4_MOD_VTSSWD, IF_REAL, "Drain STI sidewall trap-assisted voltage dependent parameter"), -IOP( "vtsswgs", BSIM4v4_MOD_VTSSWGS, IF_REAL, "Source gate-edge sidewall trap-assisted voltage dependent parameter"), -IOP( "vtsswgd", BSIM4v4_MOD_VTSSWGD, IF_REAL, "Drain gate-edge sidewall trap-assisted voltage dependent parameter"), - -IOP( "gbmin", BSIM4v4_MOD_GBMIN, IF_REAL, "Minimum body conductance"), -IOP( "rbdb", BSIM4v4_MOD_RBDB, IF_REAL, "Resistance between bNode and dbNode"), -IOP( "rbpb", BSIM4v4_MOD_RBPB, IF_REAL, "Resistance between bNodePrime and bNode"), -IOP( "rbsb", BSIM4v4_MOD_RBSB, IF_REAL, "Resistance between bNode and sbNode"), -IOP( "rbps", BSIM4v4_MOD_RBPS, IF_REAL, "Resistance between bNodePrime and sbNode"), -IOP( "rbpd", BSIM4v4_MOD_RBPD, IF_REAL, "Resistance between bNodePrime and bNode"), - -IOP( "lcdsc", BSIM4v4_MOD_LCDSC, IF_REAL, "Length dependence of cdsc"), -IOP( "lcdscb", BSIM4v4_MOD_LCDSCB, IF_REAL, "Length dependence of cdscb"), -IOP( "lcdscd", BSIM4v4_MOD_LCDSCD, IF_REAL, "Length dependence of cdscd"), -IOP( "lcit", BSIM4v4_MOD_LCIT, IF_REAL, "Length dependence of cit"), -IOP( "lnfactor", BSIM4v4_MOD_LNFACTOR, IF_REAL, "Length dependence of nfactor"), -IOP( "lxj", BSIM4v4_MOD_LXJ, IF_REAL, "Length dependence of xj"), -IOP( "lvsat", BSIM4v4_MOD_LVSAT, IF_REAL, "Length dependence of vsat"), -IOP( "lat", BSIM4v4_MOD_LAT, IF_REAL, "Length dependence of at"), -IOP( "la0", BSIM4v4_MOD_LA0, IF_REAL, "Length dependence of a0"), -IOP( "lags", BSIM4v4_MOD_LAGS, IF_REAL, "Length dependence of ags"), -IOP( "la1", BSIM4v4_MOD_LA1, IF_REAL, "Length dependence of a1"), -IOP( "la2", BSIM4v4_MOD_LA2, IF_REAL, "Length dependence of a2"), -IOP( "lketa", BSIM4v4_MOD_LKETA, IF_REAL, "Length dependence of keta"), -IOP( "lnsub", BSIM4v4_MOD_LNSUB, IF_REAL, "Length dependence of nsub"), -IOP( "lndep", BSIM4v4_MOD_LNDEP, IF_REAL, "Length dependence of ndep"), -IOP( "lnsd", BSIM4v4_MOD_LNSD, IF_REAL, "Length dependence of nsd"), -IOP( "lphin", BSIM4v4_MOD_LPHIN, IF_REAL, "Length dependence of phin"), -IOP( "lngate", BSIM4v4_MOD_LNGATE, IF_REAL, "Length dependence of ngate"), -IOP( "lgamma1", BSIM4v4_MOD_LGAMMA1, IF_REAL, "Length dependence of gamma1"), -IOP( "lgamma2", BSIM4v4_MOD_LGAMMA2, IF_REAL, "Length dependence of gamma2"), -IOP( "lvbx", BSIM4v4_MOD_LVBX, IF_REAL, "Length dependence of vbx"), -IOP( "lvbm", BSIM4v4_MOD_LVBM, IF_REAL, "Length dependence of vbm"), -IOP( "lxt", BSIM4v4_MOD_LXT, IF_REAL, "Length dependence of xt"), -IOP( "lk1", BSIM4v4_MOD_LK1, IF_REAL, "Length dependence of k1"), -IOP( "lkt1", BSIM4v4_MOD_LKT1, IF_REAL, "Length dependence of kt1"), -IOP( "lkt1l", BSIM4v4_MOD_LKT1L, IF_REAL, "Length dependence of kt1l"), -IOP( "lkt2", BSIM4v4_MOD_LKT2, IF_REAL, "Length dependence of kt2"), -IOP( "lk2", BSIM4v4_MOD_LK2, IF_REAL, "Length dependence of k2"), -IOP( "lk3", BSIM4v4_MOD_LK3, IF_REAL, "Length dependence of k3"), -IOP( "lk3b", BSIM4v4_MOD_LK3B, IF_REAL, "Length dependence of k3b"), -IOP( "lw0", BSIM4v4_MOD_LW0, IF_REAL, "Length dependence of w0"), -IOP( "ldvtp0", BSIM4v4_MOD_LDVTP0, IF_REAL, "Length dependence of dvtp0"), -IOP( "ldvtp1", BSIM4v4_MOD_LDVTP1, IF_REAL, "Length dependence of dvtp1"), -IOP( "llpe0", BSIM4v4_MOD_LLPE0, IF_REAL, "Length dependence of lpe0"), -IOP( "llpeb", BSIM4v4_MOD_LLPEB, IF_REAL, "Length dependence of lpeb"), -IOP( "ldvt0", BSIM4v4_MOD_LDVT0, IF_REAL, "Length dependence of dvt0"), -IOP( "ldvt1", BSIM4v4_MOD_LDVT1, IF_REAL, "Length dependence of dvt1"), -IOP( "ldvt2", BSIM4v4_MOD_LDVT2, IF_REAL, "Length dependence of dvt2"), -IOP( "ldvt0w", BSIM4v4_MOD_LDVT0W, IF_REAL, "Length dependence of dvt0w"), -IOP( "ldvt1w", BSIM4v4_MOD_LDVT1W, IF_REAL, "Length dependence of dvt1w"), -IOP( "ldvt2w", BSIM4v4_MOD_LDVT2W, IF_REAL, "Length dependence of dvt2w"), -IOP( "ldrout", BSIM4v4_MOD_LDROUT, IF_REAL, "Length dependence of drout"), -IOP( "ldsub", BSIM4v4_MOD_LDSUB, IF_REAL, "Length dependence of dsub"), -IOP( "lvth0", BSIM4v4_MOD_LVTH0, IF_REAL,"Length dependence of vto"), -IOP( "lvtho", BSIM4v4_MOD_LVTH0, IF_REAL,"Length dependence of vto"), -IOP( "lua", BSIM4v4_MOD_LUA, IF_REAL, "Length dependence of ua"), -IOP( "lua1", BSIM4v4_MOD_LUA1, IF_REAL, "Length dependence of ua1"), -IOP( "lub", BSIM4v4_MOD_LUB, IF_REAL, "Length dependence of ub"), -IOP( "lub1", BSIM4v4_MOD_LUB1, IF_REAL, "Length dependence of ub1"), -IOP( "luc", BSIM4v4_MOD_LUC, IF_REAL, "Length dependence of uc"), -IOP( "luc1", BSIM4v4_MOD_LUC1, IF_REAL, "Length dependence of uc1"), -IOP( "lu0", BSIM4v4_MOD_LU0, IF_REAL, "Length dependence of u0"), -IOP( "lute", BSIM4v4_MOD_LUTE, IF_REAL, "Length dependence of ute"), -IOP( "lvoff", BSIM4v4_MOD_LVOFF, IF_REAL, "Length dependence of voff"), -IOP( "lminv", BSIM4v4_MOD_LMINV, IF_REAL, "Length dependence of minv"), -IOP( "ldelta", BSIM4v4_MOD_LDELTA, IF_REAL, "Length dependence of delta"), -IOP( "lrdsw", BSIM4v4_MOD_LRDSW, IF_REAL, "Length dependence of rdsw "), -IOP( "lrsw", BSIM4v4_MOD_LRSW, IF_REAL, "Length dependence of rsw"), -IOP( "lrdw", BSIM4v4_MOD_LRDW, IF_REAL, "Length dependence of rdw"), - -IOP( "lprwg", BSIM4v4_MOD_LPRWG, IF_REAL, "Length dependence of prwg "), -IOP( "lprwb", BSIM4v4_MOD_LPRWB, IF_REAL, "Length dependence of prwb "), - -IOP( "lprt", BSIM4v4_MOD_LPRT, IF_REAL, "Length dependence of prt "), -IOP( "leta0", BSIM4v4_MOD_LETA0, IF_REAL, "Length dependence of eta0"), -IOP( "letab", BSIM4v4_MOD_LETAB, IF_REAL, "Length dependence of etab"), -IOP( "lpclm", BSIM4v4_MOD_LPCLM, IF_REAL, "Length dependence of pclm"), -IOP( "lpdiblc1", BSIM4v4_MOD_LPDIBL1, IF_REAL, "Length dependence of pdiblc1"), -IOP( "lpdiblc2", BSIM4v4_MOD_LPDIBL2, IF_REAL, "Length dependence of pdiblc2"), -IOP( "lpdiblcb", BSIM4v4_MOD_LPDIBLB, IF_REAL, "Length dependence of pdiblcb"), -IOP( "lfprout", BSIM4v4_MOD_LFPROUT, IF_REAL, "Length dependence of pdiblcb"), -IOP( "lpdits", BSIM4v4_MOD_LPDITS, IF_REAL, "Length dependence of pdits"), -IOP( "lpditsd", BSIM4v4_MOD_LPDITSD, IF_REAL, "Length dependence of pditsd"), -IOP( "lpscbe1", BSIM4v4_MOD_LPSCBE1, IF_REAL, "Length dependence of pscbe1"), -IOP( "lpscbe2", BSIM4v4_MOD_LPSCBE2, IF_REAL, "Length dependence of pscbe2"), -IOP( "lpvag", BSIM4v4_MOD_LPVAG, IF_REAL, "Length dependence of pvag"), -IOP( "lwr", BSIM4v4_MOD_LWR, IF_REAL, "Length dependence of wr"), -IOP( "ldwg", BSIM4v4_MOD_LDWG, IF_REAL, "Length dependence of dwg"), -IOP( "ldwb", BSIM4v4_MOD_LDWB, IF_REAL, "Length dependence of dwb"), -IOP( "lb0", BSIM4v4_MOD_LB0, IF_REAL, "Length dependence of b0"), -IOP( "lb1", BSIM4v4_MOD_LB1, IF_REAL, "Length dependence of b1"), -IOP( "lcgsl", BSIM4v4_MOD_LCGSL, IF_REAL, "Length dependence of cgsl"), -IOP( "lcgdl", BSIM4v4_MOD_LCGDL, IF_REAL, "Length dependence of cgdl"), -IOP( "lckappas", BSIM4v4_MOD_LCKAPPAS, IF_REAL, "Length dependence of ckappas"), -IOP( "lckappad", BSIM4v4_MOD_LCKAPPAD, IF_REAL, "Length dependence of ckappad"), -IOP( "lcf", BSIM4v4_MOD_LCF, IF_REAL, "Length dependence of cf"), -IOP( "lclc", BSIM4v4_MOD_LCLC, IF_REAL, "Length dependence of clc"), -IOP( "lcle", BSIM4v4_MOD_LCLE, IF_REAL, "Length dependence of cle"), -IOP( "lalpha0", BSIM4v4_MOD_LALPHA0, IF_REAL, "Length dependence of alpha0"), -IOP( "lalpha1", BSIM4v4_MOD_LALPHA1, IF_REAL, "Length dependence of alpha1"), -IOP( "lbeta0", BSIM4v4_MOD_LBETA0, IF_REAL, "Length dependence of beta0"), -IOP( "lagidl", BSIM4v4_MOD_LAGIDL, IF_REAL, "Length dependence of agidl"), -IOP( "lbgidl", BSIM4v4_MOD_LBGIDL, IF_REAL, "Length dependence of bgidl"), -IOP( "lcgidl", BSIM4v4_MOD_LCGIDL, IF_REAL, "Length dependence of cgidl"), -IOP( "legidl", BSIM4v4_MOD_LEGIDL, IF_REAL, "Length dependence of egidl"), -IOP( "laigc", BSIM4v4_MOD_LAIGC, IF_REAL, "Length dependence of aigc"), -IOP( "lbigc", BSIM4v4_MOD_LBIGC, IF_REAL, "Length dependence of bigc"), -IOP( "lcigc", BSIM4v4_MOD_LCIGC, IF_REAL, "Length dependence of cigc"), -IOP( "laigsd", BSIM4v4_MOD_LAIGSD, IF_REAL, "Length dependence of aigsd"), -IOP( "lbigsd", BSIM4v4_MOD_LBIGSD, IF_REAL, "Length dependence of bigsd"), -IOP( "lcigsd", BSIM4v4_MOD_LCIGSD, IF_REAL, "Length dependence of cigsd"), -IOP( "laigbacc", BSIM4v4_MOD_LAIGBACC, IF_REAL, "Length dependence of aigbacc"), -IOP( "lbigbacc", BSIM4v4_MOD_LBIGBACC, IF_REAL, "Length dependence of bigbacc"), -IOP( "lcigbacc", BSIM4v4_MOD_LCIGBACC, IF_REAL, "Length dependence of cigbacc"), -IOP( "laigbinv", BSIM4v4_MOD_LAIGBINV, IF_REAL, "Length dependence of aigbinv"), -IOP( "lbigbinv", BSIM4v4_MOD_LBIGBINV, IF_REAL, "Length dependence of bigbinv"), -IOP( "lcigbinv", BSIM4v4_MOD_LCIGBINV, IF_REAL, "Length dependence of cigbinv"), -IOP( "lnigc", BSIM4v4_MOD_LNIGC, IF_REAL, "Length dependence of nigc"), -IOP( "lnigbinv", BSIM4v4_MOD_LNIGBINV, IF_REAL, "Length dependence of nigbinv"), -IOP( "lnigbacc", BSIM4v4_MOD_LNIGBACC, IF_REAL, "Length dependence of nigbacc"), -IOP( "lntox", BSIM4v4_MOD_LNTOX, IF_REAL, "Length dependence of ntox"), -IOP( "leigbinv", BSIM4v4_MOD_LEIGBINV, IF_REAL, "Length dependence for eigbinv"), -IOP( "lpigcd", BSIM4v4_MOD_LPIGCD, IF_REAL, "Length dependence for pigcd"), -IOP( "lpoxedge", BSIM4v4_MOD_LPOXEDGE, IF_REAL, "Length dependence for poxedge"), - -IOP( "lvfbcv", BSIM4v4_MOD_LVFBCV, IF_REAL, "Length dependence of vfbcv"), -IOP( "lvfb", BSIM4v4_MOD_LVFB, IF_REAL, "Length dependence of vfb"), -IOP( "lacde", BSIM4v4_MOD_LACDE, IF_REAL, "Length dependence of acde"), -IOP( "lmoin", BSIM4v4_MOD_LMOIN, IF_REAL, "Length dependence of moin"), -IOP( "lnoff", BSIM4v4_MOD_LNOFF, IF_REAL, "Length dependence of noff"), -IOP( "lvoffcv", BSIM4v4_MOD_LVOFFCV, IF_REAL, "Length dependence of voffcv"), -IOP( "lxrcrg1", BSIM4v4_MOD_LXRCRG1, IF_REAL, "Length dependence of xrcrg1"), -IOP( "lxrcrg2", BSIM4v4_MOD_LXRCRG2, IF_REAL, "Length dependence of xrcrg2"), -IOP( "llambda", BSIM4v4_MOD_LLAMBDA, IF_REAL, "Length dependence of lambda"), -IOP( "lvtl", BSIM4v4_MOD_LVTL, IF_REAL, " Length dependence of vtl"), -IOP( "lxn", BSIM4v4_MOD_LXN, IF_REAL, " Length dependence of xn"), -IOP( "leu", BSIM4v4_MOD_LEU, IF_REAL, " Length dependence of eu"), -IOP( "lvfbsdoff", BSIM4v4_MOD_LVFBSDOFF, IF_REAL, "Length dependence of vfbsdoff"), - -IOP( "wcdsc", BSIM4v4_MOD_WCDSC, IF_REAL, "Width dependence of cdsc"), -IOP( "wcdscb", BSIM4v4_MOD_WCDSCB, IF_REAL, "Width dependence of cdscb"), -IOP( "wcdscd", BSIM4v4_MOD_WCDSCD, IF_REAL, "Width dependence of cdscd"), -IOP( "wcit", BSIM4v4_MOD_WCIT, IF_REAL, "Width dependence of cit"), -IOP( "wnfactor", BSIM4v4_MOD_WNFACTOR, IF_REAL, "Width dependence of nfactor"), -IOP( "wxj", BSIM4v4_MOD_WXJ, IF_REAL, "Width dependence of xj"), -IOP( "wvsat", BSIM4v4_MOD_WVSAT, IF_REAL, "Width dependence of vsat"), -IOP( "wat", BSIM4v4_MOD_WAT, IF_REAL, "Width dependence of at"), -IOP( "wa0", BSIM4v4_MOD_WA0, IF_REAL, "Width dependence of a0"), -IOP( "wags", BSIM4v4_MOD_WAGS, IF_REAL, "Width dependence of ags"), -IOP( "wa1", BSIM4v4_MOD_WA1, IF_REAL, "Width dependence of a1"), -IOP( "wa2", BSIM4v4_MOD_WA2, IF_REAL, "Width dependence of a2"), -IOP( "wketa", BSIM4v4_MOD_WKETA, IF_REAL, "Width dependence of keta"), -IOP( "wnsub", BSIM4v4_MOD_WNSUB, IF_REAL, "Width dependence of nsub"), -IOP( "wndep", BSIM4v4_MOD_WNDEP, IF_REAL, "Width dependence of ndep"), -IOP( "wnsd", BSIM4v4_MOD_WNSD, IF_REAL, "Width dependence of nsd"), -IOP( "wphin", BSIM4v4_MOD_WPHIN, IF_REAL, "Width dependence of phin"), -IOP( "wngate", BSIM4v4_MOD_WNGATE, IF_REAL, "Width dependence of ngate"), -IOP( "wgamma1", BSIM4v4_MOD_WGAMMA1, IF_REAL, "Width dependence of gamma1"), -IOP( "wgamma2", BSIM4v4_MOD_WGAMMA2, IF_REAL, "Width dependence of gamma2"), -IOP( "wvbx", BSIM4v4_MOD_WVBX, IF_REAL, "Width dependence of vbx"), -IOP( "wvbm", BSIM4v4_MOD_WVBM, IF_REAL, "Width dependence of vbm"), -IOP( "wxt", BSIM4v4_MOD_WXT, IF_REAL, "Width dependence of xt"), -IOP( "wk1", BSIM4v4_MOD_WK1, IF_REAL, "Width dependence of k1"), -IOP( "wkt1", BSIM4v4_MOD_WKT1, IF_REAL, "Width dependence of kt1"), -IOP( "wkt1l", BSIM4v4_MOD_WKT1L, IF_REAL, "Width dependence of kt1l"), -IOP( "wkt2", BSIM4v4_MOD_WKT2, IF_REAL, "Width dependence of kt2"), -IOP( "wk2", BSIM4v4_MOD_WK2, IF_REAL, "Width dependence of k2"), -IOP( "wk3", BSIM4v4_MOD_WK3, IF_REAL, "Width dependence of k3"), -IOP( "wk3b", BSIM4v4_MOD_WK3B, IF_REAL, "Width dependence of k3b"), -IOP( "ww0", BSIM4v4_MOD_WW0, IF_REAL, "Width dependence of w0"), -IOP( "wdvtp0", BSIM4v4_MOD_WDVTP0, IF_REAL, "Width dependence of dvtp0"), -IOP( "wdvtp1", BSIM4v4_MOD_WDVTP1, IF_REAL, "Width dependence of dvtp1"), -IOP( "wlpe0", BSIM4v4_MOD_WLPE0, IF_REAL, "Width dependence of lpe0"), -IOP( "wlpeb", BSIM4v4_MOD_WLPEB, IF_REAL, "Width dependence of lpeb"), -IOP( "wdvt0", BSIM4v4_MOD_WDVT0, IF_REAL, "Width dependence of dvt0"), -IOP( "wdvt1", BSIM4v4_MOD_WDVT1, IF_REAL, "Width dependence of dvt1"), -IOP( "wdvt2", BSIM4v4_MOD_WDVT2, IF_REAL, "Width dependence of dvt2"), -IOP( "wdvt0w", BSIM4v4_MOD_WDVT0W, IF_REAL, "Width dependence of dvt0w"), -IOP( "wdvt1w", BSIM4v4_MOD_WDVT1W, IF_REAL, "Width dependence of dvt1w"), -IOP( "wdvt2w", BSIM4v4_MOD_WDVT2W, IF_REAL, "Width dependence of dvt2w"), -IOP( "wdrout", BSIM4v4_MOD_WDROUT, IF_REAL, "Width dependence of drout"), -IOP( "wdsub", BSIM4v4_MOD_WDSUB, IF_REAL, "Width dependence of dsub"), -IOP( "wvth0", BSIM4v4_MOD_WVTH0, IF_REAL,"Width dependence of vto"), -IOP( "wvtho", BSIM4v4_MOD_WVTH0, IF_REAL,"Width dependence of vto"), -IOP( "wua", BSIM4v4_MOD_WUA, IF_REAL, "Width dependence of ua"), -IOP( "wua1", BSIM4v4_MOD_WUA1, IF_REAL, "Width dependence of ua1"), -IOP( "wub", BSIM4v4_MOD_WUB, IF_REAL, "Width dependence of ub"), -IOP( "wub1", BSIM4v4_MOD_WUB1, IF_REAL, "Width dependence of ub1"), -IOP( "wuc", BSIM4v4_MOD_WUC, IF_REAL, "Width dependence of uc"), -IOP( "wuc1", BSIM4v4_MOD_WUC1, IF_REAL, "Width dependence of uc1"), -IOP( "wu0", BSIM4v4_MOD_WU0, IF_REAL, "Width dependence of u0"), -IOP( "wute", BSIM4v4_MOD_WUTE, IF_REAL, "Width dependence of ute"), -IOP( "wvoff", BSIM4v4_MOD_WVOFF, IF_REAL, "Width dependence of voff"), -IOP( "wminv", BSIM4v4_MOD_WMINV, IF_REAL, "Width dependence of minv"), -IOP( "wdelta", BSIM4v4_MOD_WDELTA, IF_REAL, "Width dependence of delta"), -IOP( "wrdsw", BSIM4v4_MOD_WRDSW, IF_REAL, "Width dependence of rdsw "), -IOP( "wrsw", BSIM4v4_MOD_WRSW, IF_REAL, "Width dependence of rsw"), -IOP( "wrdw", BSIM4v4_MOD_WRDW, IF_REAL, "Width dependence of rdw"), - -IOP( "wprwg", BSIM4v4_MOD_WPRWG, IF_REAL, "Width dependence of prwg "), -IOP( "wprwb", BSIM4v4_MOD_WPRWB, IF_REAL, "Width dependence of prwb "), - -IOP( "wprt", BSIM4v4_MOD_WPRT, IF_REAL, "Width dependence of prt"), -IOP( "weta0", BSIM4v4_MOD_WETA0, IF_REAL, "Width dependence of eta0"), -IOP( "wetab", BSIM4v4_MOD_WETAB, IF_REAL, "Width dependence of etab"), -IOP( "wpclm", BSIM4v4_MOD_WPCLM, IF_REAL, "Width dependence of pclm"), -IOP( "wpdiblc1", BSIM4v4_MOD_WPDIBL1, IF_REAL, "Width dependence of pdiblc1"), -IOP( "wpdiblc2", BSIM4v4_MOD_WPDIBL2, IF_REAL, "Width dependence of pdiblc2"), -IOP( "wpdiblcb", BSIM4v4_MOD_WPDIBLB, IF_REAL, "Width dependence of pdiblcb"), -IOP( "wfprout", BSIM4v4_MOD_WFPROUT, IF_REAL, "Width dependence of pdiblcb"), -IOP( "wpdits", BSIM4v4_MOD_WPDITS, IF_REAL, "Width dependence of pdits"), -IOP( "wpditsd", BSIM4v4_MOD_WPDITSD, IF_REAL, "Width dependence of pditsd"), -IOP( "wpscbe1", BSIM4v4_MOD_WPSCBE1, IF_REAL, "Width dependence of pscbe1"), -IOP( "wpscbe2", BSIM4v4_MOD_WPSCBE2, IF_REAL, "Width dependence of pscbe2"), -IOP( "wpvag", BSIM4v4_MOD_WPVAG, IF_REAL, "Width dependence of pvag"), -IOP( "wwr", BSIM4v4_MOD_WWR, IF_REAL, "Width dependence of wr"), -IOP( "wdwg", BSIM4v4_MOD_WDWG, IF_REAL, "Width dependence of dwg"), -IOP( "wdwb", BSIM4v4_MOD_WDWB, IF_REAL, "Width dependence of dwb"), -IOP( "wb0", BSIM4v4_MOD_WB0, IF_REAL, "Width dependence of b0"), -IOP( "wb1", BSIM4v4_MOD_WB1, IF_REAL, "Width dependence of b1"), -IOP( "wcgsl", BSIM4v4_MOD_WCGSL, IF_REAL, "Width dependence of cgsl"), -IOP( "wcgdl", BSIM4v4_MOD_WCGDL, IF_REAL, "Width dependence of cgdl"), -IOP( "wckappas", BSIM4v4_MOD_WCKAPPAS, IF_REAL, "Width dependence of ckappas"), -IOP( "wckappad", BSIM4v4_MOD_WCKAPPAD, IF_REAL, "Width dependence of ckappad"), -IOP( "wcf", BSIM4v4_MOD_WCF, IF_REAL, "Width dependence of cf"), -IOP( "wclc", BSIM4v4_MOD_WCLC, IF_REAL, "Width dependence of clc"), -IOP( "wcle", BSIM4v4_MOD_WCLE, IF_REAL, "Width dependence of cle"), -IOP( "walpha0", BSIM4v4_MOD_WALPHA0, IF_REAL, "Width dependence of alpha0"), -IOP( "walpha1", BSIM4v4_MOD_WALPHA1, IF_REAL, "Width dependence of alpha1"), -IOP( "wbeta0", BSIM4v4_MOD_WBETA0, IF_REAL, "Width dependence of beta0"), -IOP( "wagidl", BSIM4v4_MOD_WAGIDL, IF_REAL, "Width dependence of agidl"), -IOP( "wbgidl", BSIM4v4_MOD_WBGIDL, IF_REAL, "Width dependence of bgidl"), -IOP( "wcgidl", BSIM4v4_MOD_WCGIDL, IF_REAL, "Width dependence of cgidl"), -IOP( "wegidl", BSIM4v4_MOD_WEGIDL, IF_REAL, "Width dependence of egidl"), -IOP( "waigc", BSIM4v4_MOD_WAIGC, IF_REAL, "Width dependence of aigc"), -IOP( "wbigc", BSIM4v4_MOD_WBIGC, IF_REAL, "Width dependence of bigc"), -IOP( "wcigc", BSIM4v4_MOD_WCIGC, IF_REAL, "Width dependence of cigc"), -IOP( "waigsd", BSIM4v4_MOD_WAIGSD, IF_REAL, "Width dependence of aigsd"), -IOP( "wbigsd", BSIM4v4_MOD_WBIGSD, IF_REAL, "Width dependence of bigsd"), -IOP( "wcigsd", BSIM4v4_MOD_WCIGSD, IF_REAL, "Width dependence of cigsd"), -IOP( "waigbacc", BSIM4v4_MOD_WAIGBACC, IF_REAL, "Width dependence of aigbacc"), -IOP( "wbigbacc", BSIM4v4_MOD_WBIGBACC, IF_REAL, "Width dependence of bigbacc"), -IOP( "wcigbacc", BSIM4v4_MOD_WCIGBACC, IF_REAL, "Width dependence of cigbacc"), -IOP( "waigbinv", BSIM4v4_MOD_WAIGBINV, IF_REAL, "Width dependence of aigbinv"), -IOP( "wbigbinv", BSIM4v4_MOD_WBIGBINV, IF_REAL, "Width dependence of bigbinv"), -IOP( "wcigbinv", BSIM4v4_MOD_WCIGBINV, IF_REAL, "Width dependence of cigbinv"), -IOP( "wnigc", BSIM4v4_MOD_WNIGC, IF_REAL, "Width dependence of nigc"), -IOP( "wnigbinv", BSIM4v4_MOD_WNIGBINV, IF_REAL, "Width dependence of nigbinv"), -IOP( "wnigbacc", BSIM4v4_MOD_WNIGBACC, IF_REAL, "Width dependence of nigbacc"), -IOP( "wntox", BSIM4v4_MOD_WNTOX, IF_REAL, "Width dependence of ntox"), -IOP( "weigbinv", BSIM4v4_MOD_WEIGBINV, IF_REAL, "Width dependence for eigbinv"), -IOP( "wpigcd", BSIM4v4_MOD_WPIGCD, IF_REAL, "Width dependence for pigcd"), -IOP( "wpoxedge", BSIM4v4_MOD_WPOXEDGE, IF_REAL, "Width dependence for poxedge"), -IOP( "wvfbcv", BSIM4v4_MOD_WVFBCV, IF_REAL, "Width dependence of vfbcv"), -IOP( "wvfb", BSIM4v4_MOD_WVFB, IF_REAL, "Width dependence of vfb"), -IOP( "wacde", BSIM4v4_MOD_WACDE, IF_REAL, "Width dependence of acde"), -IOP( "wmoin", BSIM4v4_MOD_WMOIN, IF_REAL, "Width dependence of moin"), -IOP( "wnoff", BSIM4v4_MOD_WNOFF, IF_REAL, "Width dependence of noff"), -IOP( "wvoffcv", BSIM4v4_MOD_WVOFFCV, IF_REAL, "Width dependence of voffcv"), -IOP( "wxrcrg1", BSIM4v4_MOD_WXRCRG1, IF_REAL, "Width dependence of xrcrg1"), -IOP( "wxrcrg2", BSIM4v4_MOD_WXRCRG2, IF_REAL, "Width dependence of xrcrg2"), -IOP( "wlambda", BSIM4v4_MOD_WLAMBDA, IF_REAL, "Width dependence of lambda"), -IOP( "wvtl", BSIM4v4_MOD_WVTL, IF_REAL, "Width dependence of vtl"), -IOP( "wxn", BSIM4v4_MOD_WXN, IF_REAL, "Width dependence of xn"), -IOP( "weu", BSIM4v4_MOD_WEU, IF_REAL, "Width dependence of eu"), -IOP( "wvfbsdoff", BSIM4v4_MOD_WVFBSDOFF, IF_REAL, "Width dependence of vfbsdoff"), - -IOP( "pcdsc", BSIM4v4_MOD_PCDSC, IF_REAL, "Cross-term dependence of cdsc"), -IOP( "pcdscb", BSIM4v4_MOD_PCDSCB, IF_REAL, "Cross-term dependence of cdscb"), -IOP( "pcdscd", BSIM4v4_MOD_PCDSCD, IF_REAL, "Cross-term dependence of cdscd"), -IOP( "pcit", BSIM4v4_MOD_PCIT, IF_REAL, "Cross-term dependence of cit"), -IOP( "pnfactor", BSIM4v4_MOD_PNFACTOR, IF_REAL, "Cross-term dependence of nfactor"), -IOP( "pxj", BSIM4v4_MOD_PXJ, IF_REAL, "Cross-term dependence of xj"), -IOP( "pvsat", BSIM4v4_MOD_PVSAT, IF_REAL, "Cross-term dependence of vsat"), -IOP( "pat", BSIM4v4_MOD_PAT, IF_REAL, "Cross-term dependence of at"), -IOP( "pa0", BSIM4v4_MOD_PA0, IF_REAL, "Cross-term dependence of a0"), -IOP( "pags", BSIM4v4_MOD_PAGS, IF_REAL, "Cross-term dependence of ags"), -IOP( "pa1", BSIM4v4_MOD_PA1, IF_REAL, "Cross-term dependence of a1"), -IOP( "pa2", BSIM4v4_MOD_PA2, IF_REAL, "Cross-term dependence of a2"), -IOP( "pketa", BSIM4v4_MOD_PKETA, IF_REAL, "Cross-term dependence of keta"), -IOP( "pnsub", BSIM4v4_MOD_PNSUB, IF_REAL, "Cross-term dependence of nsub"), -IOP( "pndep", BSIM4v4_MOD_PNDEP, IF_REAL, "Cross-term dependence of ndep"), -IOP( "pnsd", BSIM4v4_MOD_PNSD, IF_REAL, "Cross-term dependence of nsd"), -IOP( "pphin", BSIM4v4_MOD_PPHIN, IF_REAL, "Cross-term dependence of phin"), -IOP( "pngate", BSIM4v4_MOD_PNGATE, IF_REAL, "Cross-term dependence of ngate"), -IOP( "pgamma1", BSIM4v4_MOD_PGAMMA1, IF_REAL, "Cross-term dependence of gamma1"), -IOP( "pgamma2", BSIM4v4_MOD_PGAMMA2, IF_REAL, "Cross-term dependence of gamma2"), -IOP( "pvbx", BSIM4v4_MOD_PVBX, IF_REAL, "Cross-term dependence of vbx"), -IOP( "pvbm", BSIM4v4_MOD_PVBM, IF_REAL, "Cross-term dependence of vbm"), -IOP( "pxt", BSIM4v4_MOD_PXT, IF_REAL, "Cross-term dependence of xt"), -IOP( "pk1", BSIM4v4_MOD_PK1, IF_REAL, "Cross-term dependence of k1"), -IOP( "pkt1", BSIM4v4_MOD_PKT1, IF_REAL, "Cross-term dependence of kt1"), -IOP( "pkt1l", BSIM4v4_MOD_PKT1L, IF_REAL, "Cross-term dependence of kt1l"), -IOP( "pkt2", BSIM4v4_MOD_PKT2, IF_REAL, "Cross-term dependence of kt2"), -IOP( "pk2", BSIM4v4_MOD_PK2, IF_REAL, "Cross-term dependence of k2"), -IOP( "pk3", BSIM4v4_MOD_PK3, IF_REAL, "Cross-term dependence of k3"), -IOP( "pk3b", BSIM4v4_MOD_PK3B, IF_REAL, "Cross-term dependence of k3b"), -IOP( "pw0", BSIM4v4_MOD_PW0, IF_REAL, "Cross-term dependence of w0"), -IOP( "pdvtp0", BSIM4v4_MOD_PDVTP0, IF_REAL, "Cross-term dependence of dvtp0"), -IOP( "pdvtp1", BSIM4v4_MOD_PDVTP1, IF_REAL, "Cross-term dependence of dvtp1"), -IOP( "plpe0", BSIM4v4_MOD_PLPE0, IF_REAL, "Cross-term dependence of lpe0"), -IOP( "plpeb", BSIM4v4_MOD_PLPEB, IF_REAL, "Cross-term dependence of lpeb"), -IOP( "pdvt0", BSIM4v4_MOD_PDVT0, IF_REAL, "Cross-term dependence of dvt0"), -IOP( "pdvt1", BSIM4v4_MOD_PDVT1, IF_REAL, "Cross-term dependence of dvt1"), -IOP( "pdvt2", BSIM4v4_MOD_PDVT2, IF_REAL, "Cross-term dependence of dvt2"), -IOP( "pdvt0w", BSIM4v4_MOD_PDVT0W, IF_REAL, "Cross-term dependence of dvt0w"), -IOP( "pdvt1w", BSIM4v4_MOD_PDVT1W, IF_REAL, "Cross-term dependence of dvt1w"), -IOP( "pdvt2w", BSIM4v4_MOD_PDVT2W, IF_REAL, "Cross-term dependence of dvt2w"), -IOP( "pdrout", BSIM4v4_MOD_PDROUT, IF_REAL, "Cross-term dependence of drout"), -IOP( "pdsub", BSIM4v4_MOD_PDSUB, IF_REAL, "Cross-term dependence of dsub"), -IOP( "pvth0", BSIM4v4_MOD_PVTH0, IF_REAL,"Cross-term dependence of vto"), -IOP( "pvtho", BSIM4v4_MOD_PVTH0, IF_REAL,"Cross-term dependence of vto"), -IOP( "pua", BSIM4v4_MOD_PUA, IF_REAL, "Cross-term dependence of ua"), -IOP( "pua1", BSIM4v4_MOD_PUA1, IF_REAL, "Cross-term dependence of ua1"), -IOP( "pub", BSIM4v4_MOD_PUB, IF_REAL, "Cross-term dependence of ub"), -IOP( "pub1", BSIM4v4_MOD_PUB1, IF_REAL, "Cross-term dependence of ub1"), -IOP( "puc", BSIM4v4_MOD_PUC, IF_REAL, "Cross-term dependence of uc"), -IOP( "puc1", BSIM4v4_MOD_PUC1, IF_REAL, "Cross-term dependence of uc1"), -IOP( "pu0", BSIM4v4_MOD_PU0, IF_REAL, "Cross-term dependence of u0"), -IOP( "pute", BSIM4v4_MOD_PUTE, IF_REAL, "Cross-term dependence of ute"), -IOP( "pvoff", BSIM4v4_MOD_PVOFF, IF_REAL, "Cross-term dependence of voff"), -IOP( "pminv", BSIM4v4_MOD_PMINV, IF_REAL, "Cross-term dependence of minv"), -IOP( "pdelta", BSIM4v4_MOD_PDELTA, IF_REAL, "Cross-term dependence of delta"), -IOP( "prdsw", BSIM4v4_MOD_PRDSW, IF_REAL, "Cross-term dependence of rdsw "), -IOP( "prsw", BSIM4v4_MOD_PRSW, IF_REAL, "Cross-term dependence of rsw"), -IOP( "prdw", BSIM4v4_MOD_PRDW, IF_REAL, "Cross-term dependence of rdw"), - -IOP( "pprwg", BSIM4v4_MOD_PPRWG, IF_REAL, "Cross-term dependence of prwg "), -IOP( "pprwb", BSIM4v4_MOD_PPRWB, IF_REAL, "Cross-term dependence of prwb "), - -IOP( "pprt", BSIM4v4_MOD_PPRT, IF_REAL, "Cross-term dependence of prt "), -IOP( "peta0", BSIM4v4_MOD_PETA0, IF_REAL, "Cross-term dependence of eta0"), -IOP( "petab", BSIM4v4_MOD_PETAB, IF_REAL, "Cross-term dependence of etab"), -IOP( "ppclm", BSIM4v4_MOD_PPCLM, IF_REAL, "Cross-term dependence of pclm"), -IOP( "ppdiblc1", BSIM4v4_MOD_PPDIBL1, IF_REAL, "Cross-term dependence of pdiblc1"), -IOP( "ppdiblc2", BSIM4v4_MOD_PPDIBL2, IF_REAL, "Cross-term dependence of pdiblc2"), -IOP( "ppdiblcb", BSIM4v4_MOD_PPDIBLB, IF_REAL, "Cross-term dependence of pdiblcb"), -IOP( "pfprout", BSIM4v4_MOD_PFPROUT, IF_REAL, "Cross-term dependence of pdiblcb"), -IOP( "ppdits", BSIM4v4_MOD_PPDITS, IF_REAL, "Cross-term dependence of pdits"), -IOP( "ppditsd", BSIM4v4_MOD_PPDITSD, IF_REAL, "Cross-term dependence of pditsd"), -IOP( "ppscbe1", BSIM4v4_MOD_PPSCBE1, IF_REAL, "Cross-term dependence of pscbe1"), -IOP( "ppscbe2", BSIM4v4_MOD_PPSCBE2, IF_REAL, "Cross-term dependence of pscbe2"), -IOP( "ppvag", BSIM4v4_MOD_PPVAG, IF_REAL, "Cross-term dependence of pvag"), -IOP( "pwr", BSIM4v4_MOD_PWR, IF_REAL, "Cross-term dependence of wr"), -IOP( "pdwg", BSIM4v4_MOD_PDWG, IF_REAL, "Cross-term dependence of dwg"), -IOP( "pdwb", BSIM4v4_MOD_PDWB, IF_REAL, "Cross-term dependence of dwb"), -IOP( "pb0", BSIM4v4_MOD_PB0, IF_REAL, "Cross-term dependence of b0"), -IOP( "pb1", BSIM4v4_MOD_PB1, IF_REAL, "Cross-term dependence of b1"), -IOP( "pcgsl", BSIM4v4_MOD_PCGSL, IF_REAL, "Cross-term dependence of cgsl"), -IOP( "pcgdl", BSIM4v4_MOD_PCGDL, IF_REAL, "Cross-term dependence of cgdl"), -IOP( "pckappas", BSIM4v4_MOD_PCKAPPAS, IF_REAL, "Cross-term dependence of ckappas"), -IOP( "pckappad", BSIM4v4_MOD_PCKAPPAD, IF_REAL, "Cross-term dependence of ckappad"), -IOP( "pcf", BSIM4v4_MOD_PCF, IF_REAL, "Cross-term dependence of cf"), -IOP( "pclc", BSIM4v4_MOD_PCLC, IF_REAL, "Cross-term dependence of clc"), -IOP( "pcle", BSIM4v4_MOD_PCLE, IF_REAL, "Cross-term dependence of cle"), -IOP( "palpha0", BSIM4v4_MOD_PALPHA0, IF_REAL, "Cross-term dependence of alpha0"), -IOP( "palpha1", BSIM4v4_MOD_PALPHA1, IF_REAL, "Cross-term dependence of alpha1"), -IOP( "pbeta0", BSIM4v4_MOD_PBETA0, IF_REAL, "Cross-term dependence of beta0"), -IOP( "pagidl", BSIM4v4_MOD_PAGIDL, IF_REAL, "Cross-term dependence of agidl"), -IOP( "pbgidl", BSIM4v4_MOD_PBGIDL, IF_REAL, "Cross-term dependence of bgidl"), -IOP( "pcgidl", BSIM4v4_MOD_PCGIDL, IF_REAL, "Cross-term dependence of cgidl"), -IOP( "pegidl", BSIM4v4_MOD_PEGIDL, IF_REAL, "Cross-term dependence of egidl"), -IOP( "paigc", BSIM4v4_MOD_PAIGC, IF_REAL, "Cross-term dependence of aigc"), -IOP( "pbigc", BSIM4v4_MOD_PBIGC, IF_REAL, "Cross-term dependence of bigc"), -IOP( "pcigc", BSIM4v4_MOD_PCIGC, IF_REAL, "Cross-term dependence of cigc"), -IOP( "paigsd", BSIM4v4_MOD_PAIGSD, IF_REAL, "Cross-term dependence of aigsd"), -IOP( "pbigsd", BSIM4v4_MOD_PBIGSD, IF_REAL, "Cross-term dependence of bigsd"), -IOP( "pcigsd", BSIM4v4_MOD_PCIGSD, IF_REAL, "Cross-term dependence of cigsd"), -IOP( "paigbacc", BSIM4v4_MOD_PAIGBACC, IF_REAL, "Cross-term dependence of aigbacc"), -IOP( "pbigbacc", BSIM4v4_MOD_PBIGBACC, IF_REAL, "Cross-term dependence of bigbacc"), -IOP( "pcigbacc", BSIM4v4_MOD_PCIGBACC, IF_REAL, "Cross-term dependence of cigbacc"), -IOP( "paigbinv", BSIM4v4_MOD_PAIGBINV, IF_REAL, "Cross-term dependence of aigbinv"), -IOP( "pbigbinv", BSIM4v4_MOD_PBIGBINV, IF_REAL, "Cross-term dependence of bigbinv"), -IOP( "pcigbinv", BSIM4v4_MOD_PCIGBINV, IF_REAL, "Cross-term dependence of cigbinv"), -IOP( "pnigc", BSIM4v4_MOD_PNIGC, IF_REAL, "Cross-term dependence of nigc"), -IOP( "pnigbinv", BSIM4v4_MOD_PNIGBINV, IF_REAL, "Cross-term dependence of nigbinv"), -IOP( "pnigbacc", BSIM4v4_MOD_PNIGBACC, IF_REAL, "Cross-term dependence of nigbacc"), -IOP( "pntox", BSIM4v4_MOD_PNTOX, IF_REAL, "Cross-term dependence of ntox"), -IOP( "peigbinv", BSIM4v4_MOD_PEIGBINV, IF_REAL, "Cross-term dependence for eigbinv"), -IOP( "ppigcd", BSIM4v4_MOD_PPIGCD, IF_REAL, "Cross-term dependence for pigcd"), -IOP( "ppoxedge", BSIM4v4_MOD_PPOXEDGE, IF_REAL, "Cross-term dependence for poxedge"), -IOP( "pvfbcv", BSIM4v4_MOD_PVFBCV, IF_REAL, "Cross-term dependence of vfbcv"), -IOP( "pvfb", BSIM4v4_MOD_PVFB, IF_REAL, "Cross-term dependence of vfb"), -IOP( "pacde", BSIM4v4_MOD_PACDE, IF_REAL, "Cross-term dependence of acde"), -IOP( "pmoin", BSIM4v4_MOD_PMOIN, IF_REAL, "Cross-term dependence of moin"), -IOP( "pnoff", BSIM4v4_MOD_PNOFF, IF_REAL, "Cross-term dependence of noff"), -IOP( "pvoffcv", BSIM4v4_MOD_PVOFFCV, IF_REAL, "Cross-term dependence of voffcv"), -IOP( "pxrcrg1", BSIM4v4_MOD_PXRCRG1, IF_REAL, "Cross-term dependence of xrcrg1"), -IOP( "pxrcrg2", BSIM4v4_MOD_PXRCRG2, IF_REAL, "Cross-term dependence of xrcrg2"), -IOP( "plambda", BSIM4v4_MOD_PLAMBDA, IF_REAL, "Cross-term dependence of lambda"), -IOP( "pvtl", BSIM4v4_MOD_PVTL, IF_REAL, "Cross-term dependence of vtl"), -IOP( "pxn", BSIM4v4_MOD_PXN, IF_REAL, "Cross-term dependence of xn"), -IOP( "peu", BSIM4v4_MOD_PEU, IF_REAL, "Cross-term dependence of eu"), -IOP( "pvfbsdoff", BSIM4v4_MOD_PVFBSDOFF, IF_REAL, "Cross-term dependence of vfbsdoff"), - -/* stress effect*/ -IOP( "saref", BSIM4v4_MOD_SAREF, IF_REAL, "Reference distance between OD edge to poly of one side"), -IOP( "sbref", BSIM4v4_MOD_SBREF, IF_REAL, "Reference distance between OD edge to poly of the other side"), -IOP( "wlod", BSIM4v4_MOD_WLOD, IF_REAL, "Width parameter for stress effect"), -IOP( "ku0", BSIM4v4_MOD_KU0, IF_REAL, "Mobility degradation/enhancement coefficient for LOD"), -IOP( "kvsat", BSIM4v4_MOD_KVSAT, IF_REAL, "Saturation velocity degradation/enhancement parameter for LOD"), -IOP( "kvth0", BSIM4v4_MOD_KVTH0, IF_REAL, "Threshold degradation/enhancement parameter for LOD"), -IOP( "tku0", BSIM4v4_MOD_TKU0, IF_REAL, "Temperature coefficient of KU0"), -IOP( "llodku0", BSIM4v4_MOD_LLODKU0, IF_REAL, "Length parameter for u0 LOD effect"), -IOP( "wlodku0", BSIM4v4_MOD_WLODKU0, IF_REAL, "Width parameter for u0 LOD effect"), -IOP( "llodvth", BSIM4v4_MOD_LLODVTH, IF_REAL, "Length parameter for vth LOD effect"), -IOP( "wlodvth", BSIM4v4_MOD_WLODVTH, IF_REAL, "Width parameter for vth LOD effect"), -IOP( "lku0", BSIM4v4_MOD_LKU0, IF_REAL, "Length dependence of ku0"), -IOP( "wku0", BSIM4v4_MOD_WKU0, IF_REAL, "Width dependence of ku0"), -IOP( "pku0", BSIM4v4_MOD_PKU0, IF_REAL, "Cross-term dependence of ku0"), -IOP( "lkvth0", BSIM4v4_MOD_LKVTH0, IF_REAL, "Length dependence of kvth0"), -IOP( "wkvth0", BSIM4v4_MOD_WKVTH0, IF_REAL, "Width dependence of kvth0"), -IOP( "pkvth0", BSIM4v4_MOD_PKVTH0, IF_REAL, "Cross-term dependence of kvth0"), -IOP( "stk2", BSIM4v4_MOD_STK2, IF_REAL, "K2 shift factor related to stress effect on vth"), -IOP( "lodk2", BSIM4v4_MOD_LODK2, IF_REAL, "K2 shift modification factor for stress effect"), -IOP( "steta0", BSIM4v4_MOD_STETA0, IF_REAL, "eta0 shift factor related to stress effect on vth"), -IOP( "lodeta0", BSIM4v4_MOD_LODETA0, IF_REAL, "eta0 shift modification factor for stress effect"), - - -IOP( "noia", BSIM4v4_MOD_NOIA, IF_REAL, "Flicker noise parameter"), -IOP( "noib", BSIM4v4_MOD_NOIB, IF_REAL, "Flicker noise parameter"), -IOP( "noic", BSIM4v4_MOD_NOIC, IF_REAL, "Flicker noise parameter"), -IOP( "tnoia", BSIM4v4_MOD_TNOIA, IF_REAL, "Thermal noise parameter"), -IOP( "tnoib", BSIM4v4_MOD_TNOIB, IF_REAL, "Thermal noise parameter"), -IOP( "rnoia", BSIM4v4_MOD_RNOIA, IF_REAL, "Thermal noise coefficient"), -IOP( "rnoib", BSIM4v4_MOD_RNOIB, IF_REAL, "Thermal noise coefficient"), -IOP( "ntnoi", BSIM4v4_MOD_NTNOI, IF_REAL, "Thermal noise parameter"), -IOP( "em", BSIM4v4_MOD_EM, IF_REAL, "Flicker noise parameter"), -IOP( "ef", BSIM4v4_MOD_EF, IF_REAL, "Flicker noise frequency exponent"), -IOP( "af", BSIM4v4_MOD_AF, IF_REAL, "Flicker noise exponent"), -IOP( "kf", BSIM4v4_MOD_KF, IF_REAL, "Flicker noise coefficient"), - -IP( "nmos", BSIM4v4_MOD_NMOS, IF_FLAG, "Flag to indicate NMOS"), -IP( "pmos", BSIM4v4_MOD_PMOS, IF_FLAG, "Flag to indicate PMOS"), -}; - -char *BSIM4v4names[] = { - "Drain", - "Gate", - "Source", - "Bulk", - "Charge" -}; - -int BSIM4v4nSize = NUMELEMS(BSIM4v4names); -int BSIM4v4pTSize = NUMELEMS(BSIM4v4pTable); -int BSIM4v4mPTSize = NUMELEMS(BSIM4v4mPTable); -int BSIM4v4iSize = sizeof(BSIM4v4instance); -int BSIM4v4mSize = sizeof(BSIM4v4model); diff --git a/src/spicelib/devices/bsim4v4/b4v4acld.c b/src/spicelib/devices/bsim4v4/b4v4acld.c deleted file mode 100644 index 2d528511b..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4acld.c +++ /dev/null @@ -1,672 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4acld.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 10/05/2001. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -BSIM4v4acLoad( -GENmodel *inModel, -CKTcircuit *ckt) -{ -BSIM4v4model *model = (BSIM4v4model*)inModel; -BSIM4v4instance *here; - -double gjbd, gjbs, geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb; -double xcbgb, xcbdb, xcbsb, xcbbb; -double xcggbr, xcgdbr, xcgsbr, xcgbbr, xcggbi, xcgdbi, xcgsbi, xcgbbi; -double Cggr, Cgdr, Cgsr, Cgbr, Cggi, Cgdi, Cgsi, Cgbi; -double xcddbr, xcdgbr, xcdsbr, xcdbbr, xcsdbr, xcsgbr, xcssbr, xcsbbr; -double xcddbi, xcdgbi, xcdsbi, xcdbbi, xcsdbi, xcsgbi, xcssbi, xcsbbi; -double xcdbdb, xcsbsb=0.0, xcgmgmb=0.0, xcgmdb=0.0, xcgmsb=0.0, xcdgmb, xcsgmb; -double xcgmbb=0.0, xcbgmb; -double capbd, capbs, omega; -double gstot, gstotd, gstotg, gstots, gstotb, gspr; -double gdtot, gdtotd, gdtotg, gdtots, gdtotb, gdpr; -double gIstotg, gIstotd, gIstots, gIstotb; -double gIdtotg, gIdtotd, gIdtots, gIdtotb; -double gIbtotg, gIbtotd, gIbtots, gIbtotb; -double gIgtotg, gIgtotd, gIgtots, gIgtotb; -double cgso, cgdo, cgbo; -double gbspsp, gbbdp, gbbsp, gbspg, gbspb; -double gbspdp, gbdpdp, gbdpg, gbdpb, gbdpsp; -double T0=0.0, T1, T2, T3; -double Csg, Csd, Css; -double Cdgr, Cddr, Cdsr, Cdbr, Csgr, Csdr, Cssr, Csbr; -double Cdgi, Cddi, Cdsi, Cdbi, Csgi, Csdi, Cssi, Csbi; -double gmr, gmi, gmbsr, gmbsi, gdsr, gdsi; -double FwdSumr, RevSumr, Gmr, Gmbsr; -double FwdSumi, RevSumi, Gmi, Gmbsi; -struct bsim4SizeDependParam *pParam; -double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; - -double m; - - omega = ckt->CKTomega; - for (; model != NULL; model = model->BSIM4v4nextModel) - { for (here = model->BSIM4v4instances; here!= NULL; - here = here->BSIM4v4nextInstance) - { - pParam = here->pParam; - capbd = here->BSIM4v4capbd; - capbs = here->BSIM4v4capbs; - cgso = here->BSIM4v4cgso; - cgdo = here->BSIM4v4cgdo; - cgbo = pParam->BSIM4v4cgbo; - - Csd = -(here->BSIM4v4cddb + here->BSIM4v4cgdb + here->BSIM4v4cbdb); - Csg = -(here->BSIM4v4cdgb + here->BSIM4v4cggb + here->BSIM4v4cbgb); - Css = -(here->BSIM4v4cdsb + here->BSIM4v4cgsb + here->BSIM4v4cbsb); - - if (here->BSIM4v4acnqsMod) - { T0 = omega * here->BSIM4v4taunet; - T1 = T0 * T0; - T2 = 1.0 / (1.0 + T1); - T3 = T0 * T2; - - gmr = here->BSIM4v4gm * T2; - gmbsr = here->BSIM4v4gmbs * T2; - gdsr = here->BSIM4v4gds * T2; - - gmi = -here->BSIM4v4gm * T3; - gmbsi = -here->BSIM4v4gmbs * T3; - gdsi = -here->BSIM4v4gds * T3; - - Cddr = here->BSIM4v4cddb * T2; - Cdgr = here->BSIM4v4cdgb * T2; - Cdsr = here->BSIM4v4cdsb * T2; - Cdbr = -(Cddr + Cdgr + Cdsr); - - /* WDLiu: Cxyi mulitplied by jomega below, and actually to be of conductance */ - Cddi = here->BSIM4v4cddb * T3 * omega; - Cdgi = here->BSIM4v4cdgb * T3 * omega; - Cdsi = here->BSIM4v4cdsb * T3 * omega; - Cdbi = -(Cddi + Cdgi + Cdsi); - - Csdr = Csd * T2; - Csgr = Csg * T2; - Cssr = Css * T2; - Csbr = -(Csdr + Csgr + Cssr); - - Csdi = Csd * T3 * omega; - Csgi = Csg * T3 * omega; - Cssi = Css * T3 * omega; - Csbi = -(Csdi + Csgi + Cssi); - - Cgdr = -(Cddr + Csdr + here->BSIM4v4cbdb); - Cggr = -(Cdgr + Csgr + here->BSIM4v4cbgb); - Cgsr = -(Cdsr + Cssr + here->BSIM4v4cbsb); - Cgbr = -(Cgdr + Cggr + Cgsr); - - Cgdi = -(Cddi + Csdi); - Cggi = -(Cdgi + Csgi); - Cgsi = -(Cdsi + Cssi); - Cgbi = -(Cgdi + Cggi + Cgsi); - } - else /* QS */ - { gmr = here->BSIM4v4gm; - gmbsr = here->BSIM4v4gmbs; - gdsr = here->BSIM4v4gds; - gmi = gmbsi = gdsi = 0.0; - - Cddr = here->BSIM4v4cddb; - Cdgr = here->BSIM4v4cdgb; - Cdsr = here->BSIM4v4cdsb; - Cdbr = -(Cddr + Cdgr + Cdsr); - Cddi = Cdgi = Cdsi = Cdbi = 0.0; - - Csdr = Csd; - Csgr = Csg; - Cssr = Css; - Csbr = -(Csdr + Csgr + Cssr); - Csdi = Csgi = Cssi = Csbi = 0.0; - - Cgdr = here->BSIM4v4cgdb; - Cggr = here->BSIM4v4cggb; - Cgsr = here->BSIM4v4cgsb; - Cgbr = -(Cgdr + Cggr + Cgsr); - Cgdi = Cggi = Cgsi = Cgbi = 0.0; - } - - - if (here->BSIM4v4mode >= 0) - { Gmr = gmr; - Gmbsr = gmbsr; - FwdSumr = Gmr + Gmbsr; - RevSumr = 0.0; - Gmi = gmi; - Gmbsi = gmbsi; - FwdSumi = Gmi + Gmbsi; - RevSumi = 0.0; - - gbbdp = -(here->BSIM4v4gbds); - gbbsp = here->BSIM4v4gbds + here->BSIM4v4gbgs + here->BSIM4v4gbbs; - gbdpg = here->BSIM4v4gbgs; - gbdpdp = here->BSIM4v4gbds; - gbdpb = here->BSIM4v4gbbs; - gbdpsp = -(gbdpg + gbdpdp + gbdpb); - - gbspdp = 0.0; - gbspg = 0.0; - gbspb = 0.0; - gbspsp = 0.0; - - if (model->BSIM4v4igcMod) - { gIstotg = here->BSIM4v4gIgsg + here->BSIM4v4gIgcsg; - gIstotd = here->BSIM4v4gIgcsd; - gIstots = here->BSIM4v4gIgss + here->BSIM4v4gIgcss; - gIstotb = here->BSIM4v4gIgcsb; - - gIdtotg = here->BSIM4v4gIgdg + here->BSIM4v4gIgcdg; - gIdtotd = here->BSIM4v4gIgdd + here->BSIM4v4gIgcdd; - gIdtots = here->BSIM4v4gIgcds; - gIdtotb = here->BSIM4v4gIgcdb; - } - else - { gIstotg = gIstotd = gIstots = gIstotb = 0.0; - gIdtotg = gIdtotd = gIdtots = gIdtotb = 0.0; - } - - if (model->BSIM4v4igbMod) - { gIbtotg = here->BSIM4v4gIgbg; - gIbtotd = here->BSIM4v4gIgbd; - gIbtots = here->BSIM4v4gIgbs; - gIbtotb = here->BSIM4v4gIgbb; - } - else - gIbtotg = gIbtotd = gIbtots = gIbtotb = 0.0; - - if ((model->BSIM4v4igcMod != 0) || (model->BSIM4v4igbMod != 0)) - { gIgtotg = gIstotg + gIdtotg + gIbtotg; - gIgtotd = gIstotd + gIdtotd + gIbtotd ; - gIgtots = gIstots + gIdtots + gIbtots; - gIgtotb = gIstotb + gIdtotb + gIbtotb; - } - else - gIgtotg = gIgtotd = gIgtots = gIgtotb = 0.0; - - if (here->BSIM4v4rgateMod == 2) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vges) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - else if (here->BSIM4v4rgateMod == 3) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vgms) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - if (here->BSIM4v4rgateMod > 1) - { gcrgd = here->BSIM4v4gcrgd * T0; - gcrgg = here->BSIM4v4gcrgg * T0; - gcrgs = here->BSIM4v4gcrgs * T0; - gcrgb = here->BSIM4v4gcrgb * T0; - gcrgg -= here->BSIM4v4gcrg; - gcrg = here->BSIM4v4gcrg; - } - else - gcrg = gcrgd = gcrgg = gcrgs = gcrgb = 0.0; - - if (here->BSIM4v4rgateMod == 3) - { xcgmgmb = (cgdo + cgso + pParam->BSIM4v4cgbo) * omega; - xcgmdb = -cgdo * omega; - xcgmsb = -cgso * omega; - xcgmbb = -pParam->BSIM4v4cgbo * omega; - - xcdgmb = xcgmdb; - xcsgmb = xcgmsb; - xcbgmb = xcgmbb; - - xcggbr = Cggr * omega; - xcgdbr = Cgdr * omega; - xcgsbr = Cgsr * omega; - xcgbbr = -(xcggbr + xcgdbr + xcgsbr); - - xcdgbr = Cdgr * omega; - xcsgbr = Csgr * omega; - xcbgb = here->BSIM4v4cbgb * omega; - } - else - { xcggbr = (Cggr + cgdo + cgso + pParam->BSIM4v4cgbo ) * omega; - xcgdbr = (Cgdr - cgdo) * omega; - xcgsbr = (Cgsr - cgso) * omega; - xcgbbr = -(xcggbr + xcgdbr + xcgsbr); - - xcdgbr = (Cdgr - cgdo) * omega; - xcsgbr = (Csgr - cgso) * omega; - xcbgb = (here->BSIM4v4cbgb - pParam->BSIM4v4cgbo) * omega; - - xcdgmb = xcsgmb = xcbgmb = 0.0; - } - xcddbr = (Cddr + here->BSIM4v4capbd + cgdo) * omega; - xcdsbr = Cdsr * omega; - xcsdbr = Csdr * omega; - xcssbr = (here->BSIM4v4capbs + cgso + Cssr) * omega; - - if (!here->BSIM4v4rbodyMod) - { xcdbbr = -(xcdgbr + xcddbr + xcdsbr + xcdgmb); - xcsbbr = -(xcsgbr + xcsdbr + xcssbr + xcsgmb); - - xcbdb = (here->BSIM4v4cbdb - here->BSIM4v4capbd) * omega; - xcbsb = (here->BSIM4v4cbsb - here->BSIM4v4capbs) * omega; - xcdbdb = 0.0; - } - else - { xcdbbr = Cdbr * omega; - xcsbbr = -(xcsgbr + xcsdbr + xcssbr + xcsgmb) - + here->BSIM4v4capbs * omega; - - xcbdb = here->BSIM4v4cbdb * omega; - xcbsb = here->BSIM4v4cbsb * omega; - - xcdbdb = -here->BSIM4v4capbd * omega; - xcsbsb = -here->BSIM4v4capbs * omega; - } - xcbbb = -(xcbdb + xcbgb + xcbsb + xcbgmb); - - xcdgbi = Cdgi; - xcsgbi = Csgi; - xcddbi = Cddi; - xcdsbi = Cdsi; - xcsdbi = Csdi; - xcssbi = Cssi; - xcdbbi = Cdbi; - xcsbbi = Csbi; - xcggbi = Cggi; - xcgdbi = Cgdi; - xcgsbi = Cgsi; - xcgbbi = Cgbi; - } - else /* Reverse mode */ - { Gmr = -gmr; - Gmbsr = -gmbsr; - FwdSumr = 0.0; - RevSumr = -(Gmr + Gmbsr); - Gmi = -gmi; - Gmbsi = -gmbsi; - FwdSumi = 0.0; - RevSumi = -(Gmi + Gmbsi); - - gbbsp = -(here->BSIM4v4gbds); - gbbdp = here->BSIM4v4gbds + here->BSIM4v4gbgs + here->BSIM4v4gbbs; - - gbdpg = 0.0; - gbdpsp = 0.0; - gbdpb = 0.0; - gbdpdp = 0.0; - - gbspg = here->BSIM4v4gbgs; - gbspsp = here->BSIM4v4gbds; - gbspb = here->BSIM4v4gbbs; - gbspdp = -(gbspg + gbspsp + gbspb); - - if (model->BSIM4v4igcMod) - { gIstotg = here->BSIM4v4gIgsg + here->BSIM4v4gIgcdg; - gIstotd = here->BSIM4v4gIgcds; - gIstots = here->BSIM4v4gIgss + here->BSIM4v4gIgcdd; - gIstotb = here->BSIM4v4gIgcdb; - - gIdtotg = here->BSIM4v4gIgdg + here->BSIM4v4gIgcsg; - gIdtotd = here->BSIM4v4gIgdd + here->BSIM4v4gIgcss; - gIdtots = here->BSIM4v4gIgcsd; - gIdtotb = here->BSIM4v4gIgcsb; - } - else - { gIstotg = gIstotd = gIstots = gIstotb = 0.0; - gIdtotg = gIdtotd = gIdtots = gIdtotb = 0.0; - } - - if (model->BSIM4v4igbMod) - { gIbtotg = here->BSIM4v4gIgbg; - gIbtotd = here->BSIM4v4gIgbs; - gIbtots = here->BSIM4v4gIgbd; - gIbtotb = here->BSIM4v4gIgbb; - } - else - gIbtotg = gIbtotd = gIbtots = gIbtotb = 0.0; - - if ((model->BSIM4v4igcMod != 0) || (model->BSIM4v4igbMod != 0)) - { gIgtotg = gIstotg + gIdtotg + gIbtotg; - gIgtotd = gIstotd + gIdtotd + gIbtotd ; - gIgtots = gIstots + gIdtots + gIbtots; - gIgtotb = gIstotb + gIdtotb + gIbtotb; - } - else - gIgtotg = gIgtotd = gIgtots = gIgtotb = 0.0; - - if (here->BSIM4v4rgateMod == 2) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vges) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - else if (here->BSIM4v4rgateMod == 3) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vgms) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - if (here->BSIM4v4rgateMod > 1) - { gcrgd = here->BSIM4v4gcrgs * T0; - gcrgg = here->BSIM4v4gcrgg * T0; - gcrgs = here->BSIM4v4gcrgd * T0; - gcrgb = here->BSIM4v4gcrgb * T0; - gcrgg -= here->BSIM4v4gcrg; - gcrg = here->BSIM4v4gcrg; - } - else - gcrg = gcrgd = gcrgg = gcrgs = gcrgb = 0.0; - - if (here->BSIM4v4rgateMod == 3) - { xcgmgmb = (cgdo + cgso + pParam->BSIM4v4cgbo) * omega; - xcgmdb = -cgdo * omega; - xcgmsb = -cgso * omega; - xcgmbb = -pParam->BSIM4v4cgbo * omega; - - xcdgmb = xcgmdb; - xcsgmb = xcgmsb; - xcbgmb = xcgmbb; - - xcggbr = Cggr * omega; - xcgdbr = Cgsr * omega; - xcgsbr = Cgdr * omega; - xcgbbr = -(xcggbr + xcgdbr + xcgsbr); - - xcdgbr = Csgr * omega; - xcsgbr = Cdgr * omega; - xcbgb = here->BSIM4v4cbgb * omega; - } - else - { xcggbr = (Cggr + cgdo + cgso + pParam->BSIM4v4cgbo ) * omega; - xcgdbr = (Cgsr - cgdo) * omega; - xcgsbr = (Cgdr - cgso) * omega; - xcgbbr = -(xcggbr + xcgdbr + xcgsbr); - - xcdgbr = (Csgr - cgdo) * omega; - xcsgbr = (Cdgr - cgso) * omega; - xcbgb = (here->BSIM4v4cbgb - pParam->BSIM4v4cgbo) * omega; - - xcdgmb = xcsgmb = xcbgmb = 0.0; - } - xcddbr = (here->BSIM4v4capbd + cgdo + Cssr) * omega; - xcdsbr = Csdr * omega; - xcsdbr = Cdsr * omega; - xcssbr = (Cddr + here->BSIM4v4capbs + cgso) * omega; - - if (!here->BSIM4v4rbodyMod) - { xcdbbr = -(xcdgbr + xcddbr + xcdsbr + xcdgmb); - xcsbbr = -(xcsgbr + xcsdbr + xcssbr + xcsgmb); - - xcbdb = (here->BSIM4v4cbsb - here->BSIM4v4capbd) * omega; - xcbsb = (here->BSIM4v4cbdb - here->BSIM4v4capbs) * omega; - xcdbdb = 0.0; - } - else - { xcdbbr = -(xcdgbr + xcddbr + xcdsbr + xcdgmb) - + here->BSIM4v4capbd * omega; - xcsbbr = Cdbr * omega; - - xcbdb = here->BSIM4v4cbsb * omega; - xcbsb = here->BSIM4v4cbdb * omega; - xcdbdb = -here->BSIM4v4capbd * omega; - xcsbsb = -here->BSIM4v4capbs * omega; - } - xcbbb = -(xcbgb + xcbdb + xcbsb + xcbgmb); - - xcdgbi = Csgi; - xcsgbi = Cdgi; - xcddbi = Cssi; - xcdsbi = Csdi; - xcsdbi = Cdsi; - xcssbi = Cddi; - xcdbbi = Csbi; - xcsbbi = Cdbi; - xcggbi = Cggi; - xcgdbi = Cgsi; - xcgsbi = Cgdi; - xcgbbi = Cgbi; - } - - if (model->BSIM4v4rdsMod == 1) - { gstot = here->BSIM4v4gstot; - gstotd = here->BSIM4v4gstotd; - gstotg = here->BSIM4v4gstotg; - gstots = here->BSIM4v4gstots - gstot; - gstotb = here->BSIM4v4gstotb; - - gdtot = here->BSIM4v4gdtot; - gdtotd = here->BSIM4v4gdtotd - gdtot; - gdtotg = here->BSIM4v4gdtotg; - gdtots = here->BSIM4v4gdtots; - gdtotb = here->BSIM4v4gdtotb; - } - else - { gstot = gstotd = gstotg = gstots = gstotb = 0.0; - gdtot = gdtotd = gdtotg = gdtots = gdtotb = 0.0; - } - - - /* - * Loading AC matrix - */ - - m = here->BSIM4v4m; - - if (!model->BSIM4v4rdsMod) - { gdpr = here->BSIM4v4drainConductance; - gspr = here->BSIM4v4sourceConductance; - } - else - gdpr = gspr = 0.0; - - if (!here->BSIM4v4rbodyMod) - { gjbd = here->BSIM4v4gbd; - gjbs = here->BSIM4v4gbs; - } - else - gjbd = gjbs = 0.0; - - geltd = here->BSIM4v4grgeltd; - - if (here->BSIM4v4rgateMod == 1) - { *(here->BSIM4v4GEgePtr) += m * geltd; - *(here->BSIM4v4GPgePtr) -= m * geltd; - *(here->BSIM4v4GEgpPtr) -= m * geltd; - - *(here->BSIM4v4GPgpPtr +1) += m * xcggbr; - *(here->BSIM4v4GPgpPtr) += m * (geltd + xcggbi + gIgtotg); - *(here->BSIM4v4GPdpPtr +1) += m * xcgdbr; - *(here->BSIM4v4GPdpPtr) += m * (xcgdbi + gIgtotd); - *(here->BSIM4v4GPspPtr +1) += m * xcgsbr; - *(here->BSIM4v4GPspPtr) += m * (xcgsbi + gIgtots); - *(here->BSIM4v4GPbpPtr +1) += m * xcgbbr; - *(here->BSIM4v4GPbpPtr) += m * (xcgbbi + gIgtotb); - } /* WDLiu: gcrg already subtracted from all gcrgg below */ - else if (here->BSIM4v4rgateMod == 2) - { *(here->BSIM4v4GEgePtr) += m * gcrg; - *(here->BSIM4v4GEgpPtr) += m * gcrgg; - *(here->BSIM4v4GEdpPtr) += m * gcrgd; - *(here->BSIM4v4GEspPtr) += m * gcrgs; - *(here->BSIM4v4GEbpPtr) += m * gcrgb; - - *(here->BSIM4v4GPgePtr) -= m * gcrg; - *(here->BSIM4v4GPgpPtr +1) += m * xcggbr; - *(here->BSIM4v4GPgpPtr) -= m * (gcrgg - xcggbi - gIgtotg); - *(here->BSIM4v4GPdpPtr +1) += m * xcgdbr; - *(here->BSIM4v4GPdpPtr) -= m * (gcrgd - xcgdbi - gIgtotd); - *(here->BSIM4v4GPspPtr +1) += m * xcgsbr; - *(here->BSIM4v4GPspPtr) -= m * (gcrgs - xcgsbi - gIgtots); - *(here->BSIM4v4GPbpPtr +1) += m * xcgbbr; - *(here->BSIM4v4GPbpPtr) -= m * (gcrgb - xcgbbi - gIgtotb); - } - else if (here->BSIM4v4rgateMod == 3) - { *(here->BSIM4v4GEgePtr) += m * geltd; - *(here->BSIM4v4GEgmPtr) -= m * geltd; - *(here->BSIM4v4GMgePtr) -= m * geltd; - *(here->BSIM4v4GMgmPtr) += m * (geltd + gcrg); - *(here->BSIM4v4GMgmPtr +1) += m * xcgmgmb; - - *(here->BSIM4v4GMdpPtr) += m * gcrgd; - *(here->BSIM4v4GMdpPtr +1) += m * xcgmdb; - *(here->BSIM4v4GMgpPtr) += m * gcrgg; - *(here->BSIM4v4GMspPtr) += m * gcrgs; - *(here->BSIM4v4GMspPtr +1) += m * xcgmsb; - *(here->BSIM4v4GMbpPtr) += m * gcrgb; - *(here->BSIM4v4GMbpPtr +1) += m * xcgmbb; - - *(here->BSIM4v4DPgmPtr +1) += m * xcdgmb; - *(here->BSIM4v4GPgmPtr) -= m * gcrg; - *(here->BSIM4v4SPgmPtr +1) += m * xcsgmb; - *(here->BSIM4v4BPgmPtr +1) += m * xcbgmb; - - *(here->BSIM4v4GPgpPtr) -= m * (gcrgg - xcggbi - gIgtotg); - *(here->BSIM4v4GPgpPtr +1) += m * xcggbr; - *(here->BSIM4v4GPdpPtr) -= m * (gcrgd - xcgdbi - gIgtotd); - *(here->BSIM4v4GPdpPtr +1) += m * xcgdbr; - *(here->BSIM4v4GPspPtr) -= m * (gcrgs - xcgsbi - gIgtots); - *(here->BSIM4v4GPspPtr +1) += m * xcgsbr; - *(here->BSIM4v4GPbpPtr) -= m * (gcrgb - xcgbbi - gIgtotb); - *(here->BSIM4v4GPbpPtr +1) += m * xcgbbr; - } - else - { *(here->BSIM4v4GPgpPtr +1) += m * xcggbr; - *(here->BSIM4v4GPgpPtr) += m * (xcggbi + gIgtotg); - *(here->BSIM4v4GPdpPtr +1) += m * xcgdbr; - *(here->BSIM4v4GPdpPtr) += m * (xcgdbi + gIgtotd); - *(here->BSIM4v4GPspPtr +1) += m * xcgsbr; - *(here->BSIM4v4GPspPtr) += m * (xcgsbi + gIgtots); - *(here->BSIM4v4GPbpPtr +1) += m * xcgbbr; - *(here->BSIM4v4GPbpPtr) += m * (xcgbbi + gIgtotb); - } - - if (model->BSIM4v4rdsMod) - { (*(here->BSIM4v4DgpPtr) += m * gdtotg); - (*(here->BSIM4v4DspPtr) += m * gdtots); - (*(here->BSIM4v4DbpPtr) += m * gdtotb); - (*(here->BSIM4v4SdpPtr) += m * gstotd); - (*(here->BSIM4v4SgpPtr) += m * gstotg); - (*(here->BSIM4v4SbpPtr) += m * gstotb); - } - - *(here->BSIM4v4DPdpPtr +1) += m * (xcddbr + gdsi + RevSumi); - *(here->BSIM4v4DPdpPtr) += m * (gdpr + xcddbi + gdsr + here->BSIM4v4gbd - - gdtotd + RevSumr + gbdpdp - gIdtotd); - *(here->BSIM4v4DPdPtr) -= m * (gdpr + gdtot); - *(here->BSIM4v4DPgpPtr +1) += m * (xcdgbr + Gmi); - *(here->BSIM4v4DPgpPtr) += m * (Gmr + xcdgbi - gdtotg + gbdpg - gIdtotg); - *(here->BSIM4v4DPspPtr +1) += m * (xcdsbr - gdsi - FwdSumi); - *(here->BSIM4v4DPspPtr) -= m * (gdsr - xcdsbi + FwdSumr + gdtots - gbdpsp + gIdtots); - *(here->BSIM4v4DPbpPtr +1) += m * (xcdbbr + Gmbsi); - *(here->BSIM4v4DPbpPtr) -= m * (gjbd + gdtotb - xcdbbi - Gmbsr - gbdpb + gIdtotb); - - *(here->BSIM4v4DdpPtr) -= m * (gdpr - gdtotd); - *(here->BSIM4v4DdPtr) += m * (gdpr + gdtot); - - *(here->BSIM4v4SPdpPtr +1) += m * (xcsdbr - gdsi - RevSumi); - *(here->BSIM4v4SPdpPtr) -= m * (gdsr - xcsdbi + gstotd + RevSumr - gbspdp + gIstotd); - *(here->BSIM4v4SPgpPtr +1) += m * (xcsgbr - Gmi); - *(here->BSIM4v4SPgpPtr) -= m * (Gmr - xcsgbi + gstotg - gbspg + gIstotg); - *(here->BSIM4v4SPspPtr +1) += m * (xcssbr + gdsi + FwdSumi); - *(here->BSIM4v4SPspPtr) += m * (gspr + xcssbi + gdsr + here->BSIM4v4gbs - - gstots + FwdSumr + gbspsp - gIstots); - *(here->BSIM4v4SPsPtr) -= m * (gspr + gstot); - *(here->BSIM4v4SPbpPtr +1) += m * (xcsbbr - Gmbsi); - *(here->BSIM4v4SPbpPtr) -= m * (gjbs + gstotb - xcsbbi + Gmbsr - gbspb + gIstotb); - - *(here->BSIM4v4SspPtr) -= m * (gspr - gstots); - *(here->BSIM4v4SsPtr) += m * (gspr + gstot); - - *(here->BSIM4v4BPdpPtr +1) += m * xcbdb; - *(here->BSIM4v4BPdpPtr) -= m * (gjbd - gbbdp + gIbtotd); - *(here->BSIM4v4BPgpPtr +1) += m * xcbgb; - *(here->BSIM4v4BPgpPtr) -= m * (here->BSIM4v4gbgs + gIbtotg); - *(here->BSIM4v4BPspPtr +1) += m * xcbsb; - *(here->BSIM4v4BPspPtr) -= m * (gjbs - gbbsp + gIbtots); - *(here->BSIM4v4BPbpPtr +1) += m * xcbbb; - *(here->BSIM4v4BPbpPtr) += m * (gjbd + gjbs - here->BSIM4v4gbbs - - gIbtotb); - ggidld = here->BSIM4v4ggidld; - ggidlg = here->BSIM4v4ggidlg; - ggidlb = here->BSIM4v4ggidlb; - ggislg = here->BSIM4v4ggislg; - ggisls = here->BSIM4v4ggisls; - ggislb = here->BSIM4v4ggislb; - - /* stamp gidl */ - (*(here->BSIM4v4DPdpPtr) += m * ggidld); - (*(here->BSIM4v4DPgpPtr) += m * ggidlg); - (*(here->BSIM4v4DPspPtr) -= m * ((ggidlg + ggidld) + ggidlb)); - (*(here->BSIM4v4DPbpPtr) += m * ggidlb); - (*(here->BSIM4v4BPdpPtr) -= m * ggidld); - (*(here->BSIM4v4BPgpPtr) -= m * ggidlg); - (*(here->BSIM4v4BPspPtr) += m * ((ggidlg + ggidld) + ggidlb)); - (*(here->BSIM4v4BPbpPtr) -= m * ggidlb); - /* stamp gisl */ - (*(here->BSIM4v4SPdpPtr) -= m * ((ggisls + ggislg) + ggislb)); - (*(here->BSIM4v4SPgpPtr) += m * ggislg); - (*(here->BSIM4v4SPspPtr) += m * ggisls); - (*(here->BSIM4v4SPbpPtr) += m * ggislb); - (*(here->BSIM4v4BPdpPtr) += m * ((ggislg + ggisls) + ggislb)); - (*(here->BSIM4v4BPgpPtr) -= m * ggislg); - (*(here->BSIM4v4BPspPtr) -= m * ggisls); - (*(here->BSIM4v4BPbpPtr) -= m * ggislb); - - if (here->BSIM4v4rbodyMod) - { (*(here->BSIM4v4DPdbPtr +1) += m * xcdbdb); - (*(here->BSIM4v4DPdbPtr) -= m * here->BSIM4v4gbd); - (*(here->BSIM4v4SPsbPtr +1) += m * xcsbsb); - (*(here->BSIM4v4SPsbPtr) -= m * here->BSIM4v4gbs); - - (*(here->BSIM4v4DBdpPtr +1) += m * xcdbdb); - (*(here->BSIM4v4DBdpPtr) -= m * here->BSIM4v4gbd); - (*(here->BSIM4v4DBdbPtr +1) -= m * xcdbdb); - (*(here->BSIM4v4DBdbPtr) += m * (here->BSIM4v4gbd + here->BSIM4v4grbpd - + here->BSIM4v4grbdb)); - (*(here->BSIM4v4DBbpPtr) -= m * here->BSIM4v4grbpd); - (*(here->BSIM4v4DBbPtr) -= m * here->BSIM4v4grbdb); - - (*(here->BSIM4v4BPdbPtr) -= m * here->BSIM4v4grbpd); - (*(here->BSIM4v4BPbPtr) -= m * here->BSIM4v4grbpb); - (*(here->BSIM4v4BPsbPtr) -= m * here->BSIM4v4grbps); - (*(here->BSIM4v4BPbpPtr) += m * (here->BSIM4v4grbpd + here->BSIM4v4grbps - + here->BSIM4v4grbpb)); - /* WDLiu: (-here->BSIM4v4gbbs) already added to BPbpPtr */ - - (*(here->BSIM4v4SBspPtr +1) += m * xcsbsb); - (*(here->BSIM4v4SBspPtr) -= m * here->BSIM4v4gbs); - (*(here->BSIM4v4SBbpPtr) -= m * here->BSIM4v4grbps); - (*(here->BSIM4v4SBbPtr) -= m * here->BSIM4v4grbsb); - (*(here->BSIM4v4SBsbPtr +1) -= m * xcsbsb); - (*(here->BSIM4v4SBsbPtr) += m * (here->BSIM4v4gbs - + here->BSIM4v4grbps + here->BSIM4v4grbsb)); - - (*(here->BSIM4v4BdbPtr) -= m * here->BSIM4v4grbdb); - (*(here->BSIM4v4BbpPtr) -= m * here->BSIM4v4grbpb); - (*(here->BSIM4v4BsbPtr) -= m * here->BSIM4v4grbsb); - (*(here->BSIM4v4BbPtr) += m * (here->BSIM4v4grbsb + here->BSIM4v4grbdb - + here->BSIM4v4grbpb)); - } - - - /* - * WDLiu: The internal charge node generated for transient NQS is not needed for - * AC NQS. The following is not doing a real job, but we have to keep it; - * otherwise a singular AC NQS matrix may occur if the transient NQS is on. - * The charge node is isolated from the instance. - */ - if (here->BSIM4v4trnqsMod) - { (*(here->BSIM4v4QqPtr) += m * 1.0); - (*(here->BSIM4v4QgpPtr) += 0.0); - (*(here->BSIM4v4QdpPtr) += 0.0); - (*(here->BSIM4v4QspPtr) += 0.0); - (*(here->BSIM4v4QbpPtr) += 0.0); - - (*(here->BSIM4v4DPqPtr) += 0.0); - (*(here->BSIM4v4SPqPtr) += 0.0); - (*(here->BSIM4v4GPqPtr) += 0.0); - } - } - } - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4ask.c b/src/spicelib/devices/bsim4v4/b4v4ask.c deleted file mode 100644 index 0376b9b39..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4ask.c +++ /dev/null @@ -1,369 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4ask.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 05/09/2003. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/ifsim.h" -#include "ngspice/cktdefs.h" -#include "ngspice/devdefs.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - -int -BSIM4v4ask( -CKTcircuit *ckt, -GENinstance *inst, -int which, -IFvalue *value, -IFvalue *select) -{ -BSIM4v4instance *here = (BSIM4v4instance*)inst; - - NG_IGNORE(select); - - switch(which) - { case BSIM4v4_L: - value->rValue = here->BSIM4v4l; - return(OK); - case BSIM4v4_W: - value->rValue = here->BSIM4v4w; - return(OK); - case BSIM4v4_M: - value->rValue = here->BSIM4v4m; - return(OK); - case BSIM4v4_NF: - value->rValue = here->BSIM4v4nf; - return(OK); - case BSIM4v4_MIN: - value->iValue = here->BSIM4v4min; - return(OK); - case BSIM4v4_AS: - value->rValue = here->BSIM4v4sourceArea; - return(OK); - case BSIM4v4_AD: - value->rValue = here->BSIM4v4drainArea; - return(OK); - case BSIM4v4_PS: - value->rValue = here->BSIM4v4sourcePerimeter; - return(OK); - case BSIM4v4_PD: - value->rValue = here->BSIM4v4drainPerimeter; - return(OK); - case BSIM4v4_NRS: - value->rValue = here->BSIM4v4sourceSquares; - return(OK); - case BSIM4v4_NRD: - value->rValue = here->BSIM4v4drainSquares; - return(OK); - case BSIM4v4_OFF: - value->rValue = here->BSIM4v4off; - return(OK); - case BSIM4v4_SA: - value->rValue = here->BSIM4v4sa ; - return(OK); - case BSIM4v4_SB: - value->rValue = here->BSIM4v4sb ; - return(OK); - case BSIM4v4_SD: - value->rValue = here->BSIM4v4sd ; - return(OK); - case BSIM4v4_RBSB: - value->rValue = here->BSIM4v4rbsb; - return(OK); - case BSIM4v4_RBDB: - value->rValue = here->BSIM4v4rbdb; - return(OK); - case BSIM4v4_RBPB: - value->rValue = here->BSIM4v4rbpb; - return(OK); - case BSIM4v4_RBPS: - value->rValue = here->BSIM4v4rbps; - return(OK); - case BSIM4v4_RBPD: - value->rValue = here->BSIM4v4rbpd; - return(OK); - case BSIM4v4_TRNQSMOD: - value->iValue = here->BSIM4v4trnqsMod; - return(OK); - case BSIM4v4_ACNQSMOD: - value->iValue = here->BSIM4v4acnqsMod; - return(OK); - case BSIM4v4_RBODYMOD: - value->iValue = here->BSIM4v4rbodyMod; - return(OK); - case BSIM4v4_RGATEMOD: - value->iValue = here->BSIM4v4rgateMod; - return(OK); - case BSIM4v4_GEOMOD: - value->iValue = here->BSIM4v4geoMod; - return(OK); - case BSIM4v4_RGEOMOD: - value->iValue = here->BSIM4v4rgeoMod; - return(OK); - case BSIM4v4_IC_VDS: - value->rValue = here->BSIM4v4icVDS; - return(OK); - case BSIM4v4_IC_VGS: - value->rValue = here->BSIM4v4icVGS; - return(OK); - case BSIM4v4_IC_VBS: - value->rValue = here->BSIM4v4icVBS; - return(OK); - case BSIM4v4_DNODE: - value->iValue = here->BSIM4v4dNode; - return(OK); - case BSIM4v4_GNODEEXT: - value->iValue = here->BSIM4v4gNodeExt; - return(OK); - case BSIM4v4_SNODE: - value->iValue = here->BSIM4v4sNode; - return(OK); - case BSIM4v4_BNODE: - value->iValue = here->BSIM4v4bNode; - return(OK); - case BSIM4v4_DNODEPRIME: - value->iValue = here->BSIM4v4dNodePrime; - return(OK); - case BSIM4v4_GNODEPRIME: - value->iValue = here->BSIM4v4gNodePrime; - return(OK); - case BSIM4v4_GNODEMID: - value->iValue = here->BSIM4v4gNodeMid; - return(OK); - case BSIM4v4_SNODEPRIME: - value->iValue = here->BSIM4v4sNodePrime; - return(OK); - case BSIM4v4_DBNODE: - value->iValue = here->BSIM4v4dbNode; - return(OK); - case BSIM4v4_BNODEPRIME: - value->iValue = here->BSIM4v4bNodePrime; - return(OK); - case BSIM4v4_SBNODE: - value->iValue = here->BSIM4v4sbNode; - return(OK); - case BSIM4v4_SOURCECONDUCT: - value->rValue = here->BSIM4v4sourceConductance; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_DRAINCONDUCT: - value->rValue = here->BSIM4v4drainConductance; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_VBD: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4vbd); - return(OK); - case BSIM4v4_VBS: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4vbs); - return(OK); - case BSIM4v4_VGS: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4vgs); - return(OK); - case BSIM4v4_VDS: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4vds); - return(OK); - case BSIM4v4_CD: - value->rValue = here->BSIM4v4cd; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CBS: - value->rValue = here->BSIM4v4cbs; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CBD: - value->rValue = here->BSIM4v4cbd; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CSUB: - value->rValue = here->BSIM4v4csub; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_QINV: - value->rValue = here-> BSIM4v4qinv; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_IGIDL: - value->rValue = here->BSIM4v4Igidl; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_IGISL: - value->rValue = here->BSIM4v4Igisl; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_IGS: - value->rValue = here->BSIM4v4Igs; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_IGD: - value->rValue = here->BSIM4v4Igd; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_IGB: - value->rValue = here->BSIM4v4Igb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_IGCS: - value->rValue = here->BSIM4v4Igcs; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_IGCD: - value->rValue = here->BSIM4v4Igcd; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_GM: - value->rValue = here->BSIM4v4gm; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_GDS: - value->rValue = here->BSIM4v4gds; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_GMBS: - value->rValue = here->BSIM4v4gmbs; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_GBD: - value->rValue = here->BSIM4v4gbd; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_GBS: - value->rValue = here->BSIM4v4gbs; - value->rValue *= here->BSIM4v4m; - return(OK); -/* case BSIM4v4_QB: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4qb); - return(OK); */ - case BSIM4v4_CQB: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4cqb); - return(OK); -/* case BSIM4v4_QG: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4qg); - return(OK); */ - case BSIM4v4_CQG: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4cqg); - return(OK); -/* case BSIM4v4_QD: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4qd); - return(OK); */ - case BSIM4v4_CQD: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4cqd); - return(OK); -/* case BSIM4v4_QS: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4qs); - return(OK); */ - case BSIM4v4_QB: - value->rValue = here->BSIM4v4qbulk; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_QG: - value->rValue = here->BSIM4v4qgate; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_QS: - value->rValue = here->BSIM4v4qsrc; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_QD: - value->rValue = here->BSIM4v4qdrn; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CGGB: - value->rValue = here->BSIM4v4cggb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CGDB: - value->rValue = here->BSIM4v4cgdb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CGSB: - value->rValue = here->BSIM4v4cgsb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CDGB: - value->rValue = here->BSIM4v4cdgb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CDDB: - value->rValue = here->BSIM4v4cddb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CDSB: - value->rValue = here->BSIM4v4cdsb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CBGB: - value->rValue = here->BSIM4v4cbgb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CBDB: - value->rValue = here->BSIM4v4cbdb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CBSB: - value->rValue = here->BSIM4v4cbsb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CSGB: - value->rValue = here->BSIM4v4csgb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CSDB: - value->rValue = here->BSIM4v4csdb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CSSB: - value->rValue = here->BSIM4v4cssb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CGBB: - value->rValue = here->BSIM4v4cgbb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CDBB: - value->rValue = here->BSIM4v4cdbb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CSBB: - value->rValue = here->BSIM4v4csbb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CBBB: - value->rValue = here->BSIM4v4cbbb; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CAPBD: - value->rValue = here->BSIM4v4capbd; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_CAPBS: - value->rValue = here->BSIM4v4capbs; - value->rValue *= here->BSIM4v4m; - return(OK); - case BSIM4v4_VON: - value->rValue = here->BSIM4v4von; - return(OK); - case BSIM4v4_VDSAT: - value->rValue = here->BSIM4v4vdsat; - return(OK); - case BSIM4v4_QBS: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4qbs); - return(OK); - case BSIM4v4_QBD: - value->rValue = *(ckt->CKTstate0 + here->BSIM4v4qbd); - return(OK); - default: - return(E_BADPARM); - } - /* NOTREACHED */ -} - diff --git a/src/spicelib/devices/bsim4v4/b4v4check.c b/src/spicelib/devices/bsim4v4/b4v4check.c deleted file mode 100644 index f600721b5..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4check.c +++ /dev/null @@ -1,1037 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ -/* ngspice multirevision code extension covering 4.2.1 & 4.3.0 & 4.4.0 */ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4check.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 03/04/2004. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/trandefs.h" -#include "ngspice/const.h" -#include "ngspice/sperror.h" -#include "ngspice/devdefs.h" - -int -BSIM4v4checkModel( -BSIM4v4model *model, -BSIM4v4instance *here, -CKTcircuit *ckt) -{ -struct bsim4SizeDependParam *pParam; -int Fatal_Flag = 0; -FILE *fplog; - - NG_IGNORE(ckt); - - if ((fplog = fopen("bsim4v4.out", "w")) != NULL) - { pParam = here->pParam; - fprintf(fplog, "BSIM4: Berkeley Short Channel IGFET Model-4\n"); - fprintf(fplog, "Developed by Xuemei (Jane) Xi, Jin He, Mohan Dunga, Prof. Ali Niknejad and Prof. Chenming Hu in 2003.\n"); - fprintf(fplog, "\n"); - fprintf(fplog, "++++++++++ BSIM4v4 PARAMETER CHECKING BELOW ++++++++++\n"); - - if ((strcmp(model->BSIM4v4version, "4.4.0")) && (strcmp(model->BSIM4v4version, "4.40")) && (strcmp(model->BSIM4v4version, "4.4")) - && (strcmp(model->BSIM4v4version, "4.3.0")) && (strcmp(model->BSIM4v4version, "4.30")) && (strcmp(model->BSIM4v4version, "4.3")) - && (strcmp(model->BSIM4v4version, "4.2.1")) && (strcmp(model->BSIM4v4version, "4.21"))) - { fprintf(fplog, "Warning: This model supports BSIM4.2.1, 4.3.0 and 4.4.0; you specified a wrong version number.\n"); - printf("Warning: This model supports BSIM4.2.1, 4.3.0 and 4.4.0; you specified a wrong version number.\n"); - } - fprintf(fplog, "Model = %s\n", model->BSIM4v4modName); - - - if ((here->BSIM4v4rgateMod == 2) || (here->BSIM4v4rgateMod == 3)) - { if ((here->BSIM4v4trnqsMod == 1) || (here->BSIM4v4acnqsMod == 1)) - { fprintf(fplog, "Warning: You've selected both Rg and charge deficit NQS; select one only.\n"); - printf("Warning: You've selected both Rg and charge deficit NQS; select one only.\n"); - } - } - - - if (model->BSIM4v4toxe <= 0.0) - { fprintf(fplog, "Fatal: Toxe = %g is not positive.\n", - model->BSIM4v4toxe); - printf("Fatal: Toxe = %g is not positive.\n", model->BSIM4v4toxe); - Fatal_Flag = 1; - } - if (model->BSIM4v4toxp <= 0.0) - { fprintf(fplog, "Fatal: Toxp = %g is not positive.\n", - model->BSIM4v4toxp); - printf("Fatal: Toxp = %g is not positive.\n", model->BSIM4v4toxp); - Fatal_Flag = 1; - } - - if (model->BSIM4v4toxm <= 0.0) - { fprintf(fplog, "Fatal: Toxm = %g is not positive.\n", - model->BSIM4v4toxm); - printf("Fatal: Toxm = %g is not positive.\n", model->BSIM4v4toxm); - Fatal_Flag = 1; - } - - if (model->BSIM4v4toxref <= 0.0) - { fprintf(fplog, "Fatal: Toxref = %g is not positive.\n", - model->BSIM4v4toxref); - printf("Fatal: Toxref = %g is not positive.\n", model->BSIM4v4toxref); - Fatal_Flag = 1; - } - - if (pParam->BSIM4v4lpe0 < -pParam->BSIM4v4leff) - { fprintf(fplog, "Fatal: Lpe0 = %g is less than -Leff.\n", - pParam->BSIM4v4lpe0); - printf("Fatal: Lpe0 = %g is less than -Leff.\n", - pParam->BSIM4v4lpe0); - Fatal_Flag = 1; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (pParam->BSIM4v4phin < -0.4) - { fprintf(fplog, "Fatal: Phin = %g is less than -0.4.\n", - pParam->BSIM4v4phin); - printf("Fatal: Phin = %g is less than -0.4.\n", - pParam->BSIM4v4phin); - Fatal_Flag = 1; - } - break; - case BSIM4v40: - if (model->BSIM4v4lintnoi > pParam->BSIM4v4leff/2) - { fprintf(fplog, "Fatal: Lintnoi = %g is too large - Leff for noise is negative.\n", - model->BSIM4v4lintnoi); - printf("Fatal: Lintnoi = %g is too large - Leff for noise is negative.\n", - model->BSIM4v4lintnoi); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4phi <= 0.0) - { fprintf(fplog, "Fatal: Phi = %g is not positive. Please check Phin and Ndep\n", - pParam->BSIM4v4phi); - fprintf(fplog, " Phin = %g Ndep = %g \n", - pParam->BSIM4v4phin, pParam->BSIM4v4ndep); - printf("Fatal: Phi = %g is not positive. Please check Phin and Ndep\n", - pParam->BSIM4v4phi); - printf(" Phin = %g Ndep = %g \n", - pParam->BSIM4v4phin, pParam->BSIM4v4ndep); - Fatal_Flag = 1; - } - break; - default: break; - } - - - if (pParam->BSIM4v4lpeb < -pParam->BSIM4v4leff) - { fprintf(fplog, "Fatal: Lpeb = %g is less than -Leff.\n", - pParam->BSIM4v4lpeb); - printf("Fatal: Lpeb = %g is less than -Leff.\n", - pParam->BSIM4v4lpeb); - Fatal_Flag = 1; - } - - if (pParam->BSIM4v4ndep <= 0.0) - { fprintf(fplog, "Fatal: Ndep = %g is not positive.\n", - pParam->BSIM4v4ndep); - printf("Fatal: Ndep = %g is not positive.\n", - pParam->BSIM4v4ndep); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4nsub <= 0.0) - { fprintf(fplog, "Fatal: Nsub = %g is not positive.\n", - pParam->BSIM4v4nsub); - printf("Fatal: Nsub = %g is not positive.\n", - pParam->BSIM4v4nsub); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4ngate < 0.0) - { fprintf(fplog, "Fatal: Ngate = %g is not positive.\n", - pParam->BSIM4v4ngate); - printf("Fatal: Ngate = %g Ngate is not positive.\n", - pParam->BSIM4v4ngate); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4ngate > 1.e25) - { fprintf(fplog, "Fatal: Ngate = %g is too high.\n", - pParam->BSIM4v4ngate); - printf("Fatal: Ngate = %g Ngate is too high\n", - pParam->BSIM4v4ngate); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4xj <= 0.0) - { fprintf(fplog, "Fatal: Xj = %g is not positive.\n", - pParam->BSIM4v4xj); - printf("Fatal: Xj = %g is not positive.\n", pParam->BSIM4v4xj); - Fatal_Flag = 1; - } - - if (pParam->BSIM4v4dvt1 < 0.0) - { fprintf(fplog, "Fatal: Dvt1 = %g is negative.\n", - pParam->BSIM4v4dvt1); - printf("Fatal: Dvt1 = %g is negative.\n", pParam->BSIM4v4dvt1); - Fatal_Flag = 1; - } - - if (pParam->BSIM4v4dvt1w < 0.0) - { fprintf(fplog, "Fatal: Dvt1w = %g is negative.\n", - pParam->BSIM4v4dvt1w); - printf("Fatal: Dvt1w = %g is negative.\n", pParam->BSIM4v4dvt1w); - Fatal_Flag = 1; - } - - if (pParam->BSIM4v4w0 == -pParam->BSIM4v4weff) - { 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->BSIM4v4dsub < 0.0) - { fprintf(fplog, "Fatal: Dsub = %g is negative.\n", pParam->BSIM4v4dsub); - printf("Fatal: Dsub = %g is negative.\n", pParam->BSIM4v4dsub); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4b1 == -pParam->BSIM4v4weff) - { fprintf(fplog, "Fatal: (B1 + Weff) = 0 causing divided-by-zero.\n"); - printf("Fatal: (B1 + Weff) = 0 causing divided-by-zero.\n"); - Fatal_Flag = 1; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - if (pParam->BSIM4v4u0temp <= 0.0) - { fprintf(fplog, "Fatal: u0 at current temperature = %g is not positive.\n", pParam->BSIM4v4u0temp); - printf("Fatal: u0 at current temperature = %g is not positive.\n", - pParam->BSIM4v4u0temp); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4vsattemp <= 0.0) - { fprintf(fplog, "Fatal: Vsat at current temperature = %g is not positive.\n", pParam->BSIM4v4vsattemp); - printf("Fatal: Vsat at current temperature = %g is not positive.\n", - pParam->BSIM4v4vsattemp); - Fatal_Flag = 1; - } - break; - case BSIM4v30: case BSIM4v40: - if (here->BSIM4v4u0temp <= 0.0) - { fprintf(fplog, "Fatal: u0 at current temperature = %g is not positive.\n", here->BSIM4v4u0temp); - printf("Fatal: u0 at current temperature = %g is not positive.\n", - here->BSIM4v4u0temp); - Fatal_Flag = 1; - } - if (here->BSIM4v4vsattemp <= 0.0) - { fprintf(fplog, "Fatal: Vsat at current temperature = %g is not positive.\n", here->BSIM4v4vsattemp); - printf("Fatal: Vsat at current temperature = %g is not positive.\n", - here->BSIM4v4vsattemp); - Fatal_Flag = 1; - } - break; - default: break; - } - - if (pParam->BSIM4v4delta < 0.0) - { fprintf(fplog, "Fatal: Delta = %g is less than zero.\n", - pParam->BSIM4v4delta); - printf("Fatal: Delta = %g is less than zero.\n", pParam->BSIM4v4delta); - Fatal_Flag = 1; - } - - if (pParam->BSIM4v4pclm <= 0.0) - { fprintf(fplog, "Fatal: Pclm = %g is not positive.\n", pParam->BSIM4v4pclm); - printf("Fatal: Pclm = %g is not positive.\n", pParam->BSIM4v4pclm); - Fatal_Flag = 1; - } - - if (pParam->BSIM4v4drout < 0.0) - { fprintf(fplog, "Fatal: Drout = %g is negative.\n", pParam->BSIM4v4drout); - printf("Fatal: Drout = %g is negative.\n", pParam->BSIM4v4drout); - Fatal_Flag = 1; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (pParam->BSIM4v4pscbe2 <= 0.0) - { fprintf(fplog, "Warning: Pscbe2 = %g is not positive.\n", - pParam->BSIM4v4pscbe2); - printf("Warning: Pscbe2 = %g is not positive.\n", pParam->BSIM4v4pscbe2); - } - break; - case BSIM4v40: - break; - default: break; - } - - if (here->BSIM4v4nf < 1.0) - { fprintf(fplog, "Fatal: Number of finger = %g is smaller than one.\n", here->BSIM4v4nf); - printf("Fatal: Number of finger = %g is smaller than one.\n", here->BSIM4v4nf); - Fatal_Flag = 1; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: - case BSIM4v21: - break; - case BSIM4v40: - if((here->BSIM4v4sa > 0.0) && (here->BSIM4v4sb > 0.0) && - ((here->BSIM4v4nf == 1.0) || ((here->BSIM4v4nf > 1.0) && (here->BSIM4v4sd > 0.0))) ) - { if (model->BSIM4v4saref <= 0.0) - { fprintf(fplog, "Fatal: SAref = %g is not positive.\n",model->BSIM4v4saref); - printf("Fatal: SAref = %g is not positive.\n",model->BSIM4v4saref); - Fatal_Flag = 1; - } - if (model->BSIM4v4sbref <= 0.0) - { fprintf(fplog, "Fatal: SBref = %g is not positive.\n",model->BSIM4v4sbref); - printf("Fatal: SBref = %g is not positive.\n",model->BSIM4v4sbref); - Fatal_Flag = 1; - } - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (model->BSIM4v4wlod < 0.0) - { fprintf(fplog, "Warning: WLOD = %g is less than 0. Set to 0.0\n",model->BSIM4v4wlod); - printf("Warning: WLOD = %g is less than 0.\n",model->BSIM4v4wlod); - model->BSIM4v4wlod = 0.0; - } - if (model->BSIM4v4kvsat < -1.0 ) - { fprintf(fplog, "Warning: KVSAT = %g is too small; Reset to -1.0.\n",model->BSIM4v4kvsat); - printf("Warning: KVSAT = %g is is too small; Reset to -1.0.\n",model->BSIM4v4kvsat); - model->BSIM4v4kvsat = -1.0; - } - if (model->BSIM4v4kvsat > 1.0) - { fprintf(fplog, "Warning: KVSAT = %g is too big; Reset to 1.0.\n",model->BSIM4v4kvsat); - printf("Warning: KVSAT = %g is too big; Reset to 1.0.\n",model->BSIM4v4kvsat); - model->BSIM4v4kvsat = 1.0; - } - if (model->BSIM4v4lodk2 <= 0.0) - { fprintf(fplog, "Warning: LODK2 = %g is not positive.\n",model->BSIM4v4lodk2); - printf("Warning: LODK2 = %g is not positive.\n",model->BSIM4v4lodk2); - } - if (model->BSIM4v4lodeta0 <= 0.0) - { fprintf(fplog, "Warning: LODETA0 = %g is not positive.\n",model->BSIM4v4lodeta0); - printf("Warning: LODETA0 = %g is not positive.\n",model->BSIM4v4lodeta0); - } - break; - case BSIM4v40: - break; - default: break; - } - } - break; - default: break; - } - - if ((here->BSIM4v4l + model->BSIM4v4xl) <= model->BSIM4v4xgl) - { fprintf(fplog, "Fatal: The parameter xgl must be smaller than Ldrawn+XL.\n"); - printf("Fatal: The parameter xgl must be smaller than Ldrawn+XL.\n"); - Fatal_Flag = 1; - } - if (model->BSIM4v4ngcon < 1.0) - { fprintf(fplog, "Fatal: The parameter ngcon cannot be smaller than one.\n"); - printf("Fatal: The parameter ngcon cannot be smaller than one.\n"); - Fatal_Flag = 1; - } - if ((model->BSIM4v4ngcon != 1.0) && (model->BSIM4v4ngcon != 2.0)) - { model->BSIM4v4ngcon = 1.0; - fprintf(fplog, "Warning: Ngcon must be equal to one or two; reset to 1.0.\n"); - printf("Warning: Ngcon must be equal to one or two; reset to 1.0.\n"); - } - - if (model->BSIM4v4gbmin < 1.0e-20) - { fprintf(fplog, "Warning: Gbmin = %g is too small.\n", - model->BSIM4v4gbmin); - printf("Warning: Gbmin = %g is too small.\n", model->BSIM4v4gbmin); - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (pParam->BSIM4v4noff < 0.1) - { fprintf(fplog, "Warning: Noff = %g is too small.\n", - pParam->BSIM4v4noff); - printf("Warning: Noff = %g is too small.\n", pParam->BSIM4v4noff); - } - - if (pParam->BSIM4v4voffcv < -0.5) - { fprintf(fplog, "Warning: Voffcv = %g is too small.\n", - pParam->BSIM4v4voffcv); - printf("Warning: Voffcv = %g is too small.\n", pParam->BSIM4v4voffcv); - } - break; - case BSIM4v40: - /* Check saturation parameters */ - if (pParam->BSIM4v4fprout < 0.0) - { fprintf(fplog, "Fatal: fprout = %g is negative.\n", - pParam->BSIM4v4fprout); - printf("Fatal: fprout = %g is negative.\n", pParam->BSIM4v4fprout); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4pdits < 0.0) - { fprintf(fplog, "Fatal: pdits = %g is negative.\n", - pParam->BSIM4v4pdits); - printf("Fatal: pdits = %g is negative.\n", pParam->BSIM4v4pdits); - Fatal_Flag = 1; - } - if (model->BSIM4v4pditsl < 0.0) - { fprintf(fplog, "Fatal: pditsl = %g is negative.\n", - model->BSIM4v4pditsl); - printf("Fatal: pditsl = %g is negative.\n", model->BSIM4v4pditsl); - Fatal_Flag = 1; - } - - /* Check gate current parameters */ - if (model->BSIM4v4igbMod) { - if (pParam->BSIM4v4nigbinv <= 0.0) - { fprintf(fplog, "Fatal: nigbinv = %g is non-positive.\n", - pParam->BSIM4v4nigbinv); - printf("Fatal: nigbinv = %g is non-positive.\n", pParam->BSIM4v4nigbinv); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4nigbacc <= 0.0) - { fprintf(fplog, "Fatal: nigbacc = %g is non-positive.\n", - pParam->BSIM4v4nigbacc); - printf("Fatal: nigbacc = %g is non-positive.\n", pParam->BSIM4v4nigbacc); - Fatal_Flag = 1; - } - } - if (model->BSIM4v4igcMod) { - if (pParam->BSIM4v4nigc <= 0.0) - { fprintf(fplog, "Fatal: nigc = %g is non-positive.\n", - pParam->BSIM4v4nigc); - printf("Fatal: nigc = %g is non-positive.\n", pParam->BSIM4v4nigc); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4poxedge <= 0.0) - { fprintf(fplog, "Fatal: poxedge = %g is non-positive.\n", - pParam->BSIM4v4poxedge); - printf("Fatal: poxedge = %g is non-positive.\n", pParam->BSIM4v4poxedge); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4pigcd <= 0.0) - { fprintf(fplog, "Fatal: pigcd = %g is non-positive.\n", - pParam->BSIM4v4pigcd); - printf("Fatal: pigcd = %g is non-positive.\n", pParam->BSIM4v4pigcd); - Fatal_Flag = 1; - } - } - break; - default: break; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: - case BSIM4v21: - if (pParam->BSIM4v4noff > 4.0) - { fprintf(fplog, "Warning: Noff = %g is too large.\n", - pParam->BSIM4v4noff); - printf("Warning: Noff = %g is too large.\n", pParam->BSIM4v4noff); - } - if (pParam->BSIM4v4voffcv > 0.5) - { fprintf(fplog, "Warning: Voffcv = %g is too large.\n", - pParam->BSIM4v4voffcv); - printf("Warning: Voffcv = %g is too large.\n", pParam->BSIM4v4voffcv); - } - break; - case BSIM4v40: - break; - default: break; - } - - /* Check capacitance parameters */ - if (pParam->BSIM4v4clc < 0.0) - { fprintf(fplog, "Fatal: Clc = %g is negative.\n", pParam->BSIM4v4clc); - printf("Fatal: Clc = %g is negative.\n", pParam->BSIM4v4clc); - Fatal_Flag = 1; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (pParam->BSIM4v4moin < 5.0) - { fprintf(fplog, "Warning: Moin = %g is too small.\n", - pParam->BSIM4v4moin); - printf("Warning: Moin = %g is too small.\n", pParam->BSIM4v4moin); - } - if (pParam->BSIM4v4moin > 25.0) - { fprintf(fplog, "Warning: Moin = %g is too large.\n", - pParam->BSIM4v4moin); - printf("Warning: Moin = %g is too large.\n", pParam->BSIM4v4moin); - } - if(model->BSIM4v4capMod ==2) { - if (pParam->BSIM4v4acde < 0.1) - { fprintf(fplog, "Warning: Acde = %g is too small.\n", - pParam->BSIM4v4acde); - printf("Warning: Acde = %g is too small.\n", pParam->BSIM4v4acde); - } - if (pParam->BSIM4v4acde > 1.6) - { fprintf(fplog, "Warning: Acde = %g is too large.\n", - pParam->BSIM4v4acde); - printf("Warning: Acde = %g is too large.\n", pParam->BSIM4v4acde); - } - } - break; - case BSIM4v40: - break; - default: break; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: - case BSIM4v21: - break; - case BSIM4v40: - /* Check overlap capacitance parameters */ - if (pParam->BSIM4v4ckappas < 0.02) - { fprintf(fplog, "Warning: ckappas = %g is too small. Set to 0.02\n", - pParam->BSIM4v4ckappas); - printf("Warning: ckappas = %g is too small.\n", pParam->BSIM4v4ckappas); - pParam->BSIM4v4ckappas = 0.02; - } - if (pParam->BSIM4v4ckappad < 0.02) - { fprintf(fplog, "Warning: ckappad = %g is too small. Set to 0.02\n", - pParam->BSIM4v4ckappad); - printf("Warning: ckappad = %g is too small.\n", pParam->BSIM4v4ckappad); - pParam->BSIM4v4ckappad = 0.02; - } - break; - default: break; - } - - if (model->BSIM4v4paramChk ==1) - { -/* Check L and W parameters */ - if (pParam->BSIM4v4leff <= 1.0e-9) - { fprintf(fplog, "Warning: Leff = %g <= 1.0e-9. Recommended Leff >= 1e-8 \n", - pParam->BSIM4v4leff); - printf("Warning: Leff = %g <= 1.0e-9. Recommended Leff >= 1e-8 \n", - pParam->BSIM4v4leff); - } - - if (pParam->BSIM4v4leffCV <= 1.0e-9) - { fprintf(fplog, "Warning: Leff for CV = %g <= 1.0e-9. Recommended LeffCV >=1e-8 \n", - pParam->BSIM4v4leffCV); - printf("Warning: Leff for CV = %g <= 1.0e-9. Recommended LeffCV >=1e-8 \n", - pParam->BSIM4v4leffCV); - } - - if (pParam->BSIM4v4weff <= 1.0e-9) - { fprintf(fplog, "Warning: Weff = %g <= 1.0e-9. Recommended Weff >=1e-7 \n", - pParam->BSIM4v4weff); - printf("Warning: Weff = %g <= 1.0e-9. Recommended Weff >=1e-7 \n", - pParam->BSIM4v4weff); - } - - if (pParam->BSIM4v4weffCV <= 1.0e-9) - { fprintf(fplog, "Warning: Weff for CV = %g <= 1.0e-9. Recommended WeffCV >= 1e-7 \n", - pParam->BSIM4v4weffCV); - printf("Warning: Weff for CV = %g <= 1.0e-9. Recommended WeffCV >= 1e-7 \n", - pParam->BSIM4v4weffCV); - } - - /* Check threshold voltage parameters */ - if (model->BSIM4v4toxe < 1.0e-10) - { fprintf(fplog, "Warning: Toxe = %g is less than 1A. Recommended Toxe >= 5A\n", - model->BSIM4v4toxe); - printf("Warning: Toxe = %g is less than 1A. Recommended Toxe >= 5A\n", model->BSIM4v4toxe); - } - if (model->BSIM4v4toxp < 1.0e-10) - { fprintf(fplog, "Warning: Toxp = %g is less than 1A. Recommended Toxp >= 5A\n", - model->BSIM4v4toxp); - printf("Warning: Toxp = %g is less than 1A. Recommended Toxp >= 5A\n", model->BSIM4v4toxp); - } - if (model->BSIM4v4toxm < 1.0e-10) - { fprintf(fplog, "Warning: Toxm = %g is less than 1A. Recommended Toxm >= 5A\n", - model->BSIM4v4toxm); - printf("Warning: Toxm = %g is less than 1A. Recommended Toxm >= 5A\n", model->BSIM4v4toxm); - } - - if (pParam->BSIM4v4ndep <= 1.0e12) - { fprintf(fplog, "Warning: Ndep = %g may be too small.\n", - pParam->BSIM4v4ndep); - printf("Warning: Ndep = %g may be too small.\n", - pParam->BSIM4v4ndep); - } - else if (pParam->BSIM4v4ndep >= 1.0e21) - { fprintf(fplog, "Warning: Ndep = %g may be too large.\n", - pParam->BSIM4v4ndep); - printf("Warning: Ndep = %g may be too large.\n", - pParam->BSIM4v4ndep); - } - - if (pParam->BSIM4v4nsub <= 1.0e14) - { fprintf(fplog, "Warning: Nsub = %g may be too small.\n", - pParam->BSIM4v4nsub); - printf("Warning: Nsub = %g may be too small.\n", - pParam->BSIM4v4nsub); - } - else if (pParam->BSIM4v4nsub >= 1.0e21) - { fprintf(fplog, "Warning: Nsub = %g may be too large.\n", - pParam->BSIM4v4nsub); - printf("Warning: Nsub = %g may be too large.\n", - pParam->BSIM4v4nsub); - } - - if ((pParam->BSIM4v4ngate > 0.0) && - (pParam->BSIM4v4ngate <= 1.e18)) - { fprintf(fplog, "Warning: Ngate = %g is less than 1.E18cm^-3.\n", - pParam->BSIM4v4ngate); - printf("Warning: Ngate = %g is less than 1.E18cm^-3.\n", - pParam->BSIM4v4ngate); - } - - if (pParam->BSIM4v4dvt0 < 0.0) - { fprintf(fplog, "Warning: Dvt0 = %g is negative.\n", - pParam->BSIM4v4dvt0); - printf("Warning: Dvt0 = %g is negative.\n", pParam->BSIM4v4dvt0); - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (fabs(1.0e-6 / (pParam->BSIM4v4w0 + pParam->BSIM4v4weff)) > 10.0) - { fprintf(fplog, "Warning: (W0 + Weff) may be too small.\n"); - printf("Warning: (W0 + Weff) may be too small.\n"); - } - break; - case BSIM4v40: - if (fabs(1.0e-8 / (pParam->BSIM4v4w0 + pParam->BSIM4v4weff)) > 10.0) - { fprintf(fplog, "Warning: (W0 + Weff) may be too small.\n"); - printf("Warning: (W0 + Weff) may be too small.\n"); - } - break; - default: break; - } - -/* Check subthreshold parameters */ - if (pParam->BSIM4v4nfactor < 0.0) - { fprintf(fplog, "Warning: Nfactor = %g is negative.\n", - pParam->BSIM4v4nfactor); - printf("Warning: Nfactor = %g is negative.\n", pParam->BSIM4v4nfactor); - } - if (pParam->BSIM4v4cdsc < 0.0) - { fprintf(fplog, "Warning: Cdsc = %g is negative.\n", - pParam->BSIM4v4cdsc); - printf("Warning: Cdsc = %g is negative.\n", pParam->BSIM4v4cdsc); - } - if (pParam->BSIM4v4cdscd < 0.0) - { fprintf(fplog, "Warning: Cdscd = %g is negative.\n", - pParam->BSIM4v4cdscd); - printf("Warning: Cdscd = %g is negative.\n", pParam->BSIM4v4cdscd); - } -/* Check DIBL parameters */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: - case BSIM4v21: - if (pParam->BSIM4v4eta0 < 0.0) - { fprintf(fplog, "Warning: Eta0 = %g is negative.\n", - pParam->BSIM4v4eta0); - printf("Warning: Eta0 = %g is negative.\n", pParam->BSIM4v4eta0); - } - break; - case BSIM4v40: - if (here->BSIM4v4eta0 < 0.0) - { fprintf(fplog, "Warning: Eta0 = %g is negative.\n", - here->BSIM4v4eta0); - printf("Warning: Eta0 = %g is negative.\n", here->BSIM4v4eta0); - } - break; - default: break; - } - -/* Check Abulk parameters */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (fabs(1.0e-6 / (pParam->BSIM4v4b1 + pParam->BSIM4v4weff)) > 10.0) - { fprintf(fplog, "Warning: (B1 + Weff) may be too small.\n"); - printf("Warning: (B1 + Weff) may be too small.\n"); - } - break; - case BSIM4v40: - if (fabs(1.0e-8 / (pParam->BSIM4v4b1 + pParam->BSIM4v4weff)) > 10.0) - { fprintf(fplog, "Warning: (B1 + Weff) may be too small.\n"); - printf("Warning: (B1 + Weff) may be too small.\n"); - } - break; - default: break; - } - - -/* Check Saturation parameters */ - if (pParam->BSIM4v4a2 < 0.01) - { fprintf(fplog, "Warning: A2 = %g is too small. Set to 0.01.\n", pParam->BSIM4v4a2); - printf("Warning: A2 = %g is too small. Set to 0.01.\n", - pParam->BSIM4v4a2); - pParam->BSIM4v4a2 = 0.01; - } - else if (pParam->BSIM4v4a2 > 1.0) - { fprintf(fplog, "Warning: A2 = %g is larger than 1. A2 is set to 1 and A1 is set to 0.\n", - pParam->BSIM4v4a2); - printf("Warning: A2 = %g is larger than 1. A2 is set to 1 and A1 is set to 0.\n", - pParam->BSIM4v4a2); - pParam->BSIM4v4a2 = 1.0; - pParam->BSIM4v4a1 = 0.0; - - } - - if (pParam->BSIM4v4prwg < 0.0) - { fprintf(fplog, "Warning: Prwg = %g is negative. Set to zero.\n", - pParam->BSIM4v4prwg); - printf("Warning: Prwg = %g is negative. Set to zero.\n", - pParam->BSIM4v4prwg); - pParam->BSIM4v4prwg = 0.0; - } - if (pParam->BSIM4v4rdsw < 0.0) - { fprintf(fplog, "Warning: Rdsw = %g is negative. Set to zero.\n", - pParam->BSIM4v4rdsw); - printf("Warning: Rdsw = %g is negative. Set to zero.\n", - pParam->BSIM4v4rdsw); - pParam->BSIM4v4rdsw = 0.0; - pParam->BSIM4v4rds0 = 0.0; - } - if (pParam->BSIM4v4rds0 < 0.0) - { fprintf(fplog, "Warning: Rds at current temperature = %g is negative. Set to zero.\n", - pParam->BSIM4v4rds0); - printf("Warning: Rds at current temperature = %g is negative. Set to zero.\n", - pParam->BSIM4v4rds0); - pParam->BSIM4v4rds0 = 0.0; - } - - if (pParam->BSIM4v4rdswmin < 0.0) - { fprintf(fplog, "Warning: Rdswmin at current temperature = %g is negative. Set to zero.\n", - pParam->BSIM4v4rdswmin); - printf("Warning: Rdswmin at current temperature = %g is negative. Set to zero.\n", - pParam->BSIM4v4rdswmin); - pParam->BSIM4v4rdswmin = 0.0; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if (pParam->BSIM4v4pscbe2 <= 0.0) - { fprintf(fplog, "Warning: Pscbe2 = %g is not positive.\n", - pParam->BSIM4v4pscbe2); - printf("Warning: Pscbe2 = %g is not positive.\n", pParam->BSIM4v4pscbe2); - } - break; - default: break; - } - - if (pParam->BSIM4v4vsattemp < 1.0e3) - { fprintf(fplog, "Warning: Vsat at current temperature = %g may be too small.\n", pParam->BSIM4v4vsattemp); - printf("Warning: Vsat at current temperature = %g may be too small.\n", pParam->BSIM4v4vsattemp); - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if((model->BSIM4v4lambdaGiven) && (pParam->BSIM4v4lambda > 0.0) ) - { - if (pParam->BSIM4v4lambda > 1.0e-9) - { fprintf(fplog, "Warning: Lambda = %g may be too large.\n", pParam->BSIM4v4lambda); - printf("Warning: Lambda = %g may be too large.\n", pParam->BSIM4v4lambda); - } - } - - if((model->BSIM4v4vtlGiven) && (pParam->BSIM4v4vtl > 0.0) ) - { - if (pParam->BSIM4v4vtl < 6.0e4) - { fprintf(fplog, "Warning: Thermal velocity vtl = %g may be too small.\n", pParam->BSIM4v4vtl); - printf("Warning: Thermal velocity vtl = %g may be too small.\n", pParam->BSIM4v4vtl); - } - - if (pParam->BSIM4v4xn < 3.0) - { fprintf(fplog, "Warning: back scattering coeff xn = %g is too small.\n", pParam->BSIM4v4xn); - printf("Warning: back scattering coeff xn = %g is too small. Reset to 3.0 \n", pParam->BSIM4v4xn); - pParam->BSIM4v4xn = 3.0; - - } - if (model->BSIM4v4lc < 0.0) - { fprintf(fplog, "Warning: back scattering coeff lc = %g is too small.\n", model->BSIM4v4lc); - printf("Warning: back scattering coeff lc = %g is too small. Reset to 0.0\n", model->BSIM4v4lc); - pParam->BSIM4v4lc = 0.0; - } - } - break; - default: break; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (pParam->BSIM4v4fprout < 0.0) - { fprintf(fplog, "Fatal: fprout = %g is negative.\n", - pParam->BSIM4v4fprout); - printf("Fatal: fprout = %g is negative.\n", pParam->BSIM4v4fprout); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4pdits < 0.0) - { fprintf(fplog, "Fatal: pdits = %g is negative.\n", - pParam->BSIM4v4pdits); - printf("Fatal: pdits = %g is negative.\n", pParam->BSIM4v4pdits); - Fatal_Flag = 1; - } - if (model->BSIM4v4pditsl < 0.0) - { fprintf(fplog, "Fatal: pditsl = %g is negative.\n", - model->BSIM4v4pditsl); - printf("Fatal: pditsl = %g is negative.\n", model->BSIM4v4pditsl); - Fatal_Flag = 1; - } - break; - case BSIM4v40: - break; - default: break; - } - - if (pParam->BSIM4v4pdibl1 < 0.0) - { fprintf(fplog, "Warning: Pdibl1 = %g is negative.\n", - pParam->BSIM4v4pdibl1); - printf("Warning: Pdibl1 = %g is negative.\n", pParam->BSIM4v4pdibl1); - } - if (pParam->BSIM4v4pdibl2 < 0.0) - { fprintf(fplog, "Warning: Pdibl2 = %g is negative.\n", - pParam->BSIM4v4pdibl2); - printf("Warning: Pdibl2 = %g is negative.\n", pParam->BSIM4v4pdibl2); - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (pParam->BSIM4v4nigbinv <= 0.0) - { fprintf(fplog, "Fatal: nigbinv = %g is non-positive.\n", - pParam->BSIM4v4nigbinv); - printf("Fatal: nigbinv = %g is non-positive.\n", pParam->BSIM4v4nigbinv); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4nigbacc <= 0.0) - { fprintf(fplog, "Fatal: nigbacc = %g is non-positive.\n", - pParam->BSIM4v4nigbacc); - printf("Fatal: nigbacc = %g is non-positive.\n", pParam->BSIM4v4nigbacc); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4nigc <= 0.0) - { fprintf(fplog, "Fatal: nigc = %g is non-positive.\n", - pParam->BSIM4v4nigc); - printf("Fatal: nigc = %g is non-positive.\n", pParam->BSIM4v4nigc); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4poxedge <= 0.0) - { fprintf(fplog, "Fatal: poxedge = %g is non-positive.\n", - pParam->BSIM4v4poxedge); - printf("Fatal: poxedge = %g is non-positive.\n", pParam->BSIM4v4poxedge); - Fatal_Flag = 1; - } - if (pParam->BSIM4v4pigcd <= 0.0) - { fprintf(fplog, "Fatal: pigcd = %g is non-positive.\n", - pParam->BSIM4v4pigcd); - printf("Fatal: pigcd = %g is non-positive.\n", pParam->BSIM4v4pigcd); - Fatal_Flag = 1; - } - break; - case BSIM4v40: -/* Check stress effect parameters */ - if((here->BSIM4v4sa > 0.0) && (here->BSIM4v4sb > 0.0) && - ((here->BSIM4v4nf == 1.0) || ((here->BSIM4v4nf > 1.0) && (here->BSIM4v4sd > 0.0))) ) - { if (model->BSIM4v4lodk2 <= 0.0) - { fprintf(fplog, "Warning: LODK2 = %g is not positive.\n",model->BSIM4v4lodk2); - printf("Warning: LODK2 = %g is not positive.\n",model->BSIM4v4lodk2); - } - if (model->BSIM4v4lodeta0 <= 0.0) - { fprintf(fplog, "Warning: LODETA0 = %g is not positive.\n",model->BSIM4v4lodeta0); - printf("Warning: LODETA0 = %g is not positive.\n",model->BSIM4v4lodeta0); - } - } - break; - default: break; - } - -/* Check gate resistance parameters */ - if (here->BSIM4v4rgateMod == 1) - { if (model->BSIM4v4rshg <= 0.0) - printf("Warning: rshg should be positive for rgateMod = 1.\n"); - } - else if (here->BSIM4v4rgateMod == 2) - { if (model->BSIM4v4rshg <= 0.0) - printf("Warning: rshg <= 0.0 for rgateMod = 2.\n"); - else if (pParam->BSIM4v4xrcrg1 <= 0.0) - printf("Warning: xrcrg1 <= 0.0 for rgateMod = 2.\n"); - } - if (here->BSIM4v4rgateMod == 3) - { if (model->BSIM4v4rshg <= 0.0) - printf("Warning: rshg should be positive for rgateMod = 3.\n"); - else if (pParam->BSIM4v4xrcrg1 <= 0.0) - printf("Warning: xrcrg1 should be positive for rgateMod = 3.\n"); - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - /* Check capacitance parameters */ - if (pParam->BSIM4v4noff < 0.1) - { fprintf(fplog, "Warning: Noff = %g is too small.\n", - pParam->BSIM4v4noff); - printf("Warning: Noff = %g is too small.\n", pParam->BSIM4v4noff); - } - - if (pParam->BSIM4v4voffcv < -0.5) - { fprintf(fplog, "Warning: Voffcv = %g is too small.\n", - pParam->BSIM4v4voffcv); - printf("Warning: Voffcv = %g is too small.\n", pParam->BSIM4v4voffcv); - } - - if (pParam->BSIM4v4moin < 5.0) - { fprintf(fplog, "Warning: Moin = %g is too small.\n", - pParam->BSIM4v4moin); - printf("Warning: Moin = %g is too small.\n", pParam->BSIM4v4moin); - } - if (pParam->BSIM4v4moin > 25.0) - { fprintf(fplog, "Warning: Moin = %g is too large.\n", - pParam->BSIM4v4moin); - printf("Warning: Moin = %g is too large.\n", pParam->BSIM4v4moin); - } - if(model->BSIM4v4capMod ==2) { - if (pParam->BSIM4v4acde < 0.1) - { fprintf(fplog, "Warning: Acde = %g is too small.\n", - pParam->BSIM4v4acde); - printf("Warning: Acde = %g is too small.\n", pParam->BSIM4v4acde); - } - if (pParam->BSIM4v4acde > 1.6) - { fprintf(fplog, "Warning: Acde = %g is too large.\n", - pParam->BSIM4v4acde); - printf("Warning: Acde = %g is too large.\n", pParam->BSIM4v4acde); - } - } - break; - default: break; - } -/* Check overlap capacitance parameters */ - if (model->BSIM4v4cgdo < 0.0) - { fprintf(fplog, "Warning: cgdo = %g is negative. Set to zero.\n", model->BSIM4v4cgdo); - printf("Warning: cgdo = %g is negative. Set to zero.\n", model->BSIM4v4cgdo); - model->BSIM4v4cgdo = 0.0; - } - if (model->BSIM4v4cgso < 0.0) - { fprintf(fplog, "Warning: cgso = %g is negative. Set to zero.\n", model->BSIM4v4cgso); - printf("Warning: cgso = %g is negative. Set to zero.\n", model->BSIM4v4cgso); - model->BSIM4v4cgso = 0.0; - } - - if (model->BSIM4v4tnoiMod == 1) { - if (model->BSIM4v4tnoia < 0.0) - { fprintf(fplog, "Warning: tnoia = %g is negative. Set to zero.\n", model->BSIM4v4tnoia); - printf("Warning: tnoia = %g is negative. Set to zero.\n", model->BSIM4v4tnoia); - model->BSIM4v4tnoia = 0.0; - } - if (model->BSIM4v4tnoib < 0.0) - { fprintf(fplog, "Warning: tnoib = %g is negative. Set to zero.\n", model->BSIM4v4tnoib); - printf("Warning: tnoib = %g is negative. Set to zero.\n", model->BSIM4v4tnoib); - model->BSIM4v4tnoib = 0.0; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if (model->BSIM4v4rnoia < 0.0) - { fprintf(fplog, "Warning: rnoia = %g is negative. Set to zero.\n", model->BSIM4v4rnoia); - printf("Warning: rnoia = %g is negative. Set to zero.\n", model->BSIM4v4rnoia); - model->BSIM4v4rnoia = 0.0; - } - if (model->BSIM4v4rnoib < 0.0) - { fprintf(fplog, "Warning: rnoib = %g is negative. Set to zero.\n", model->BSIM4v4rnoib); - printf("Warning: rnoib = %g is negative. Set to zero.\n", model->BSIM4v4rnoib); - model->BSIM4v4rnoib = 0.0; - } - break; - default: break; - } - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if (model->BSIM4v4SjctEmissionCoeff < 0.0) - { fprintf(fplog, "Warning: Njs = %g is negative.\n", - model->BSIM4v4SjctEmissionCoeff); - printf("Warning: Njs = %g is negative.\n", - model->BSIM4v4SjctEmissionCoeff); - } - if (model->BSIM4v4DjctEmissionCoeff < 0.0) - { fprintf(fplog, "Warning: Njd = %g is negative.\n", - model->BSIM4v4DjctEmissionCoeff); - printf("Warning: Njd = %g is negative.\n", - model->BSIM4v4DjctEmissionCoeff); - } - if (model->BSIM4v4njtstemp < 0.0) - { fprintf(fplog, "Warning: Njts = %g is negative at temperature = %g.\n", - model->BSIM4v4njtstemp, ckt->CKTtemp); - printf("Warning: Njts = %g is negative at temperature = %g.\n", - model->BSIM4v4njtstemp, ckt->CKTtemp); - } - if (model->BSIM4v4njtsswtemp < 0.0) - { fprintf(fplog, "Warning: Njtssw = %g is negative at temperature = %g.\n", - model->BSIM4v4njtsswtemp, ckt->CKTtemp); - printf("Warning: Njtssw = %g is negative at temperature = %g.\n", - model->BSIM4v4njtsswtemp, ckt->CKTtemp); - } - if (model->BSIM4v4njtsswgtemp < 0.0) - { fprintf(fplog, "Warning: Njtsswg = %g is negative at temperature = %g.\n", - model->BSIM4v4njtsswgtemp, ckt->CKTtemp); - printf("Warning: Njtsswg = %g is negative at temperature = %g.\n", - model->BSIM4v4njtsswgtemp, ckt->CKTtemp); - } - if (model->BSIM4v4vtss < 0.0) - { fprintf(fplog, "Warning: Vtss = %g is negative.\n", - model->BSIM4v4vtss); - printf("Warning: Vtss = %g is negative.\n", - model->BSIM4v4vtss); - } - if (model->BSIM4v4vtsd < 0.0) - { fprintf(fplog, "Warning: Vtsd = %g is negative.\n", - model->BSIM4v4vtsd); - printf("Warning: Vtsd = %g is negative.\n", - model->BSIM4v4vtsd); - } - if (model->BSIM4v4vtssws < 0.0) - { fprintf(fplog, "Warning: Vtssws = %g is negative.\n", - model->BSIM4v4vtssws); - printf("Warning: Vtssws = %g is negative.\n", - model->BSIM4v4vtssws); - } - if (model->BSIM4v4vtsswd < 0.0) - { fprintf(fplog, "Warning: Vtsswd = %g is negative.\n", - model->BSIM4v4vtsswd); - printf("Warning: Vtsswd = %g is negative.\n", - model->BSIM4v4vtsswd); - } - if (model->BSIM4v4vtsswgs < 0.0) - { fprintf(fplog, "Warning: Vtsswgs = %g is negative.\n", - model->BSIM4v4vtsswgs); - printf("Warning: Vtsswgs = %g is negative.\n", - model->BSIM4v4vtsswgs); - } - if (model->BSIM4v4vtsswgd < 0.0) - { fprintf(fplog, "Warning: Vtsswgd = %g is negative.\n", - model->BSIM4v4vtsswgd); - printf("Warning: Vtsswgd = %g is negative.\n", - model->BSIM4v4vtsswgd); - } - break; - default: break; - } - if (model->BSIM4v4ntnoi < 0.0) - { fprintf(fplog, "Warning: ntnoi = %g is negative. Set to zero.\n", model->BSIM4v4ntnoi); - printf("Warning: ntnoi = %g is negative. Set to zero.\n", model->BSIM4v4ntnoi); - model->BSIM4v4ntnoi = 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/bsim4v4/b4v4cvtest.c b/src/spicelib/devices/bsim4v4/b4v4cvtest.c deleted file mode 100644 index 411f9760a..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4cvtest.c +++ /dev/null @@ -1,198 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4cvtest.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 05/09/2003. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/trandefs.h" -#include "ngspice/const.h" -#include "ngspice/devdefs.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -BSIM4v4convTest( -GENmodel *inModel, -CKTcircuit *ckt) -{ -BSIM4v4model *model = (BSIM4v4model*)inModel; -BSIM4v4instance *here; -double delvbd, delvbs, delvds, delvgd, delvgs; -double delvdbd, delvsbs; -double delvbd_jct, delvbs_jct; -double vds, vgs, vgd, vgdo, vbs, vbd; -double vdbd, vdbs, vsbs; -double cbhat, cdhat, Idtot, Ibtot; -double vses, vdes, vdedo, delvses, delvded, delvdes; -double Isestot, cseshat, Idedtot, cdedhat; -double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; -double tol0, tol1, tol2, tol3, tol4, tol5, tol6; - - for (; model != NULL; model = model->BSIM4v4nextModel) - { for (here = model->BSIM4v4instances; here != NULL ; - here=here->BSIM4v4nextInstance) - { - vds = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4dNodePrime) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vgs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4gNodePrime) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vbs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4bNodePrime) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vdbs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4dbNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vsbs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4sbNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vses = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4sNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vdes = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4dNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - - vgdo = *(ckt->CKTstate0 + here->BSIM4v4vgs) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - vbd = vbs - vds; - vdbd = vdbs - vds; - vgd = vgs - vds; - - delvbd = vbd - *(ckt->CKTstate0 + here->BSIM4v4vbd); - delvdbd = vdbd - *(ckt->CKTstate0 + here->BSIM4v4vdbd); - delvgd = vgd - vgdo; - - delvds = vds - *(ckt->CKTstate0 + here->BSIM4v4vds); - delvgs = vgs - *(ckt->CKTstate0 + here->BSIM4v4vgs); - delvbs = vbs - *(ckt->CKTstate0 + here->BSIM4v4vbs); - delvsbs = vsbs - *(ckt->CKTstate0 + here->BSIM4v4vsbs); - - delvses = vses - (*(ckt->CKTstate0 + here->BSIM4v4vses)); - vdedo = *(ckt->CKTstate0 + here->BSIM4v4vdes) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - delvdes = vdes - *(ckt->CKTstate0 + here->BSIM4v4vdes); - delvded = vdes - vds - vdedo; - - delvbd_jct = (!here->BSIM4v4rbodyMod) ? delvbd : delvdbd; - delvbs_jct = (!here->BSIM4v4rbodyMod) ? delvbs : delvsbs; - - if (here->BSIM4v4mode >= 0) - { Idtot = here->BSIM4v4cd + here->BSIM4v4csub - here->BSIM4v4cbd - + here->BSIM4v4Igidl; - cdhat = Idtot - here->BSIM4v4gbd * delvbd_jct - + (here->BSIM4v4gmbs + here->BSIM4v4gbbs + here->BSIM4v4ggidlb) * delvbs - + (here->BSIM4v4gm + here->BSIM4v4gbgs + here->BSIM4v4ggidlg) * delvgs - + (here->BSIM4v4gds + here->BSIM4v4gbds + here->BSIM4v4ggidld) * delvds; - - Igstot = here->BSIM4v4Igs + here->BSIM4v4Igcs; - cgshat = Igstot + (here->BSIM4v4gIgsg + here->BSIM4v4gIgcsg) * delvgs - + here->BSIM4v4gIgcsd * delvds + here->BSIM4v4gIgcsb * delvbs; - - Igdtot = here->BSIM4v4Igd + here->BSIM4v4Igcd; - cgdhat = Igdtot + here->BSIM4v4gIgdg * delvgd + here->BSIM4v4gIgcdg * delvgs - + here->BSIM4v4gIgcdd * delvds + here->BSIM4v4gIgcdb * delvbs; - - Igbtot = here->BSIM4v4Igb; - cgbhat = here->BSIM4v4Igb + here->BSIM4v4gIgbg * delvgs + here->BSIM4v4gIgbd - * delvds + here->BSIM4v4gIgbb * delvbs; - } - else - { Idtot = here->BSIM4v4cd + here->BSIM4v4cbd - here->BSIM4v4Igidl; /* bugfix */ - cdhat = Idtot + here->BSIM4v4gbd * delvbd_jct + here->BSIM4v4gmbs - * delvbd + here->BSIM4v4gm * delvgd - - (here->BSIM4v4gds + here->BSIM4v4ggidls) * delvds - - here->BSIM4v4ggidlg * delvgs - here->BSIM4v4ggidlb * delvbs; - - Igstot = here->BSIM4v4Igs + here->BSIM4v4Igcd; - cgshat = Igstot + here->BSIM4v4gIgsg * delvgs + here->BSIM4v4gIgcdg * delvgd - - here->BSIM4v4gIgcdd * delvds + here->BSIM4v4gIgcdb * delvbd; - - Igdtot = here->BSIM4v4Igd + here->BSIM4v4Igcs; - cgdhat = Igdtot + (here->BSIM4v4gIgdg + here->BSIM4v4gIgcsg) * delvgd - - here->BSIM4v4gIgcsd * delvds + here->BSIM4v4gIgcsb * delvbd; - - Igbtot = here->BSIM4v4Igb; - cgbhat = here->BSIM4v4Igb + here->BSIM4v4gIgbg * delvgd - here->BSIM4v4gIgbd - * delvds + here->BSIM4v4gIgbb * delvbd; - } - - Isestot = here->BSIM4v4gstot * (*(ckt->CKTstate0 + here->BSIM4v4vses)); - cseshat = Isestot + here->BSIM4v4gstot * delvses - + here->BSIM4v4gstotd * delvds + here->BSIM4v4gstotg * delvgs - + here->BSIM4v4gstotb * delvbs; - - Idedtot = here->BSIM4v4gdtot * vdedo; - cdedhat = Idedtot + here->BSIM4v4gdtot * delvded - + here->BSIM4v4gdtotd * delvds + here->BSIM4v4gdtotg * delvgs - + here->BSIM4v4gdtotb * delvbs; - - /* - * Check convergence - */ - - if ((here->BSIM4v4off == 0) || (!(ckt->CKTmode & MODEINITFIX))) - { tol0 = ckt->CKTreltol * MAX(fabs(cdhat), fabs(Idtot)) - + ckt->CKTabstol; - tol1 = ckt->CKTreltol * MAX(fabs(cseshat), fabs(Isestot)) - + ckt->CKTabstol; - tol2 = ckt->CKTreltol * MAX(fabs(cdedhat), fabs(Idedtot)) - + ckt->CKTabstol; - tol3 = ckt->CKTreltol * MAX(fabs(cgshat), fabs(Igstot)) - + ckt->CKTabstol; - tol4 = ckt->CKTreltol * MAX(fabs(cgdhat), fabs(Igdtot)) - + ckt->CKTabstol; - tol5 = ckt->CKTreltol * MAX(fabs(cgbhat), fabs(Igbtot)) - + ckt->CKTabstol; - - if ((fabs(cdhat - Idtot) >= tol0) || (fabs(cseshat - Isestot) >= tol1) - || (fabs(cdedhat - Idedtot) >= tol2)) - { ckt->CKTnoncon++; - return(OK); - } - - if ((fabs(cgshat - Igstot) >= tol3) || (fabs(cgdhat - Igdtot) >= tol4) - || (fabs(cgbhat - Igbtot) >= tol5)) - { ckt->CKTnoncon++; - return(OK); - } - - Ibtot = here->BSIM4v4cbs + here->BSIM4v4cbd - - here->BSIM4v4Igidl - here->BSIM4v4Igisl - here->BSIM4v4csub; - if (here->BSIM4v4mode >= 0) - { cbhat = Ibtot + here->BSIM4v4gbd * delvbd_jct - + here->BSIM4v4gbs * delvbs_jct - (here->BSIM4v4gbbs + here->BSIM4v4ggidlb) - * delvbs - (here->BSIM4v4gbgs + here->BSIM4v4ggidlg) * delvgs - - (here->BSIM4v4gbds + here->BSIM4v4ggidld) * delvds - - here->BSIM4v4ggislg * delvgd - here->BSIM4v4ggislb* delvbd + here->BSIM4v4ggisls * delvds ; - } - else - { cbhat = Ibtot + here->BSIM4v4gbs * delvbs_jct + here->BSIM4v4gbd - * delvbd_jct - (here->BSIM4v4gbbs + here->BSIM4v4ggislb) * delvbd - - (here->BSIM4v4gbgs + here->BSIM4v4ggislg) * delvgd - + (here->BSIM4v4gbds + here->BSIM4v4ggisld - here->BSIM4v4ggidls) * delvds - - here->BSIM4v4ggidlg * delvgs - here->BSIM4v4ggidlb * delvbs; - } - tol6 = ckt->CKTreltol * MAX(fabs(cbhat), - fabs(Ibtot)) + ckt->CKTabstol; - if (fabs(cbhat - Ibtot) > tol6) - { ckt->CKTnoncon++; - return(OK); - } - } - } - } - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4del.c b/src/spicelib/devices/bsim4v4/b4v4del.c deleted file mode 100644 index 615ecdf1c..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4del.c +++ /dev/null @@ -1,41 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4del.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/gendefs.h" -#include "ngspice/suffix.h" - - -int -BSIM4v4delete( -GENmodel *inModel, -IFuid name, -GENinstance **inInst) -{ -BSIM4v4instance **fast = (BSIM4v4instance**)inInst; -BSIM4v4model *model = (BSIM4v4model*)inModel; -BSIM4v4instance **prev = NULL; -BSIM4v4instance *here; - - for (; model ; model = model->BSIM4v4nextModel) - { prev = &(model->BSIM4v4instances); - for (here = *prev; here ; here = *prev) - { if (here->BSIM4v4name == name || (fast && here==*fast)) - { *prev= here->BSIM4v4nextInstance; - FREE(here); - return(OK); - } - prev = &(here->BSIM4v4nextInstance); - } - } - return(E_NODEV); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4dest.c b/src/spicelib/devices/bsim4v4/b4v4dest.c deleted file mode 100644 index becb4870f..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4dest.c +++ /dev/null @@ -1,38 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4dest.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v4def.h" -#include "ngspice/suffix.h" - -void -BSIM4v4destroy( -GENmodel **inModel) -{ -BSIM4v4model **model = (BSIM4v4model**)inModel; -BSIM4v4instance *here; -BSIM4v4instance *prev = NULL; -BSIM4v4model *mod = *model; -BSIM4v4model *oldmod = NULL; - - for (; mod ; mod = mod->BSIM4v4nextModel) - { if(oldmod) FREE(oldmod); - oldmod = mod; - prev = NULL; - for (here = mod->BSIM4v4instances; here; here = here->BSIM4v4nextInstance) - { if(prev) FREE(prev); - prev = here; - } - if(prev) FREE(prev); - } - if(oldmod) FREE(oldmod); - *model = NULL; - return; -} diff --git a/src/spicelib/devices/bsim4v4/b4v4geo.c b/src/spicelib/devices/bsim4v4/b4v4geo.c deleted file mode 100644 index ad8d7a3c3..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4geo.c +++ /dev/null @@ -1,397 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei(Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2003 Regents of the University of California. All rights reserved. - * File: b4geo.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v4def.h" - -/* - * WDLiu: - * This subrutine is a special module to process the geometry dependent - * parasitics for BSIM4v4, which calculates Ps, Pd, As, Ad, and Rs and Rd - * for multi-fingers and varous GEO and RGEO options. - */ - -int -BSIM4v4RdsEndIso(double, double, double, double, double, double, int, int, double *); -int -BSIM4v4RdsEndSha(double, double, double, double, double, double, int, int, double *); - -static int -BSIM4v4NumFingerDiff( -double nf, -int minSD, -double *nuIntD, double *nuEndD, double *nuIntS, double *nuEndS) -{ -int NF; - NF = (int)nf; - if ((NF%2) != 0) - { *nuEndD = *nuEndS = 1.0; - *nuIntD = *nuIntS = 2.0 * MAX((nf - 1.0) / 2.0, 0.0); - } - else - { if (minSD == 1) /* minimize # of source */ - { *nuEndD = 2.0; - *nuIntD = 2.0 * MAX((nf / 2.0 - 1.0), 0.0); - *nuEndS = 0.0; - *nuIntS = nf; - } - else - { *nuEndD = 0.0; - *nuIntD = nf; - *nuEndS = 2.0; - *nuIntS = 2.0 * MAX((nf / 2.0 - 1.0), 0.0); - } - } -return 0; -} - - -int -BSIM4v4PAeffGeo( -double nf, -int geo, int minSD, -double Weffcj, double DMCG, double DMCI, double DMDG, -double *Ps, double *Pd, double *As, double *Ad) -{ -double T0, T1, T2; -double ADiso, ADsha, ADmer, ASiso, ASsha, ASmer; -double PDiso, PDsha, PDmer, PSiso, PSsha, PSmer; -double nuIntD = 0.0, nuEndD = 0.0, nuIntS = 0.0, nuEndS = 0.0; - - if (geo < 9) /* For geo = 9 and 10, the numbers of S/D diffusions already known */ - BSIM4v4NumFingerDiff(nf, minSD, &nuIntD, &nuEndD, &nuIntS, &nuEndS); - - T0 = DMCG + DMCI; - T1 = DMCG + DMCG; - T2 = DMDG + DMDG; - - PSiso = PDiso = T0 + T0 + Weffcj; - PSsha = PDsha = T1; - PSmer = PDmer = T2; - - ASiso = ADiso = T0 * Weffcj; - ASsha = ADsha = DMCG * Weffcj; - ASmer = ADmer = DMDG * Weffcj; - - switch(geo) - { case 0: - *Ps = nuEndS * PSiso + nuIntS * PSsha; - *Pd = nuEndD * PDiso + nuIntD * PDsha; - *As = nuEndS * ASiso + nuIntS * ASsha; - *Ad = nuEndD * ADiso + nuIntD * ADsha; - break; - case 1: - *Ps = nuEndS * PSiso + nuIntS * PSsha; - *Pd = (nuEndD + nuIntD) * PDsha; - *As = nuEndS * ASiso + nuIntS * ASsha; - *Ad = (nuEndD + nuIntD) * ADsha; - break; - case 2: - *Ps = (nuEndS + nuIntS) * PSsha; - *Pd = nuEndD * PDiso + nuIntD * PDsha; - *As = (nuEndS + nuIntS) * ASsha; - *Ad = nuEndD * ADiso + nuIntD * ADsha; - break; - case 3: - *Ps = (nuEndS + nuIntS) * PSsha; - *Pd = (nuEndD + nuIntD) * PDsha; - *As = (nuEndS + nuIntS) * ASsha; - *Ad = (nuEndD + nuIntD) * ADsha; - break; - case 4: - *Ps = nuEndS * PSiso + nuIntS * PSsha; - *Pd = nuEndD * PDmer + nuIntD * PDsha; - *As = nuEndS * ASiso + nuIntS * ASsha; - *Ad = nuEndD * ADmer + nuIntD * ADsha; - break; - case 5: - *Ps = (nuEndS + nuIntS) * PSsha; - *Pd = nuEndD * PDmer + nuIntD * PDsha; - *As = (nuEndS + nuIntS) * ASsha; - *Ad = nuEndD * ADmer + nuIntD * ADsha; - break; - case 6: - *Ps = nuEndS * PSmer + nuIntS * PSsha; - *Pd = nuEndD * PDiso + nuIntD * PDsha; - *As = nuEndS * ASmer + nuIntS * ASsha; - *Ad = nuEndD * ADiso + nuIntD * ADsha; - break; - case 7: - *Ps = nuEndS * PSmer + nuIntS * PSsha; - *Pd = (nuEndD + nuIntD) * PDsha; - *As = nuEndS * ASmer + nuIntS * ASsha; - *Ad = (nuEndD + nuIntD) * ADsha; - break; - case 8: - *Ps = nuEndS * PSmer + nuIntS * PSsha; - *Pd = nuEndD * PDmer + nuIntD * PDsha; - *As = nuEndS * ASmer + nuIntS * ASsha; - *Ad = nuEndD * ADmer + nuIntD * ADsha; - break; - case 9: /* geo = 9 and 10 happen only when nf = even */ - *Ps = PSiso + (nf - 1.0) * PSsha; - *Pd = nf * PDsha; - *As = ASiso + (nf - 1.0) * ASsha; - *Ad = nf * ADsha; - break; - case 10: - *Ps = nf * PSsha; - *Pd = PDiso + (nf - 1.0) * PDsha; - *As = nf * ASsha; - *Ad = ADiso + (nf - 1.0) * ADsha; - break; - default: - printf("Warning: Specified GEO = %d not matched\n", geo); - } -return 0; -} - - -int -BSIM4v4RdseffGeo( -double nf, -int geo, int rgeo, int minSD, -double Weffcj, double Rsh, double DMCG, double DMCI, double DMDG, -int Type, -double *Rtot) -{ -double Rint=0.0, Rend = 0.0; -double nuIntD = 0.0, nuEndD = 0.0, nuIntS = 0.0, nuEndS = 0.0; - - if (geo < 9) /* since geo = 9 and 10 only happen when nf = even */ - { BSIM4v4NumFingerDiff(nf, minSD, &nuIntD, &nuEndD, &nuIntS, &nuEndS); - - /* Internal S/D resistance -- assume shared S or D and all wide contacts */ - if (Type == 1) - { if (nuIntS == 0.0) - Rint = 0.0; - else - Rint = Rsh * DMCG / ( Weffcj * nuIntS); - } - else - { if (nuIntD == 0.0) - Rint = 0.0; - else - Rint = Rsh * DMCG / ( Weffcj * nuIntD); - } - } - - /* End S/D resistance -- geo dependent */ - switch(geo) - { case 0: - if (Type == 1) BSIM4v4RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndS, rgeo, 1, &Rend); - else BSIM4v4RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndD, rgeo, 0, &Rend); - break; - case 1: - if (Type == 1) BSIM4v4RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndS, rgeo, 1, &Rend); - else BSIM4v4RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndD, rgeo, 0, &Rend); - break; - case 2: - if (Type == 1) BSIM4v4RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndS, rgeo, 1, &Rend); - else BSIM4v4RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndD, rgeo, 0, &Rend); - break; - case 3: - if (Type == 1) BSIM4v4RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndS, rgeo, 1, &Rend); - else BSIM4v4RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndD, rgeo, 0, &Rend); - break; - case 4: - if (Type == 1) BSIM4v4RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndS, rgeo, 1, &Rend); - else Rend = Rsh * DMDG / Weffcj; - break; - case 5: - if (Type == 1) BSIM4v4RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndS, rgeo, 1, &Rend); - else Rend = Rsh * DMDG / (Weffcj * nuEndD); - break; - case 6: - if (Type == 1) Rend = Rsh * DMDG / Weffcj; - else BSIM4v4RdsEndIso(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndD, rgeo, 0, &Rend); - break; - case 7: - if (Type == 1) Rend = Rsh * DMDG / (Weffcj * nuEndS); - else BSIM4v4RdsEndSha(Weffcj, Rsh, DMCG, DMCI, DMDG, - nuEndD, rgeo, 0, &Rend); - break; - case 8: - Rend = Rsh * DMDG / Weffcj; - break; - case 9: /* all wide contacts assumed for geo = 9 and 10 */ - if (Type == 1) - { Rend = 0.5 * Rsh * DMCG / Weffcj; - if (nf == 2.0) - Rint = 0.0; - else - Rint = Rsh * DMCG / (Weffcj * (nf - 2.0)); - } - else - { Rend = 0.0; - Rint = Rsh * DMCG / (Weffcj * nf); - } - break; - case 10: - if (Type == 1) - { Rend = 0.0; - Rint = Rsh * DMCG / (Weffcj * nf); - } - else - { Rend = 0.5 * Rsh * DMCG / Weffcj;; - if (nf == 2.0) - Rint = 0.0; - else - Rint = Rsh * DMCG / (Weffcj * (nf - 2.0)); - } - break; - default: - printf("Warning: Specified GEO = %d not matched\n", geo); - } - - if (Rint <= 0.0) - *Rtot = Rend; - else if (Rend <= 0.0) - *Rtot = Rint; - else - *Rtot = Rint * Rend / (Rint + Rend); -if(*Rtot==0.0) - printf("Warning: Zero resistance returned from RdseffGeo\n"); -return 0; -} - - -int -BSIM4v4RdsEndIso( -double Weffcj, double Rsh, double DMCG, double DMCI, double DMDG, -double nuEnd, -int rgeo, int Type, -double *Rend) -{ - NG_IGNORE(DMDG); - - if (Type == 1) - { switch(rgeo) - { case 1: - case 2: - case 5: - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * DMCG / (Weffcj * nuEnd); - break; - case 3: - case 4: - case 6: - if ((DMCG + DMCI) == 0.0) - printf("(DMCG + DMCI) can not be equal to zero\n"); - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI)); - break; - default: - printf("Warning: Specified RGEO = %d not matched\n", rgeo); - } - } - else - { switch(rgeo) - { case 1: - case 3: - case 7: - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * DMCG / (Weffcj * nuEnd); - break; - case 2: - case 4: - case 8: - if ((DMCG + DMCI) == 0.0) - printf("(DMCG + DMCI) can not be equal to zero\n"); - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI)); - break; - default: - printf("Warning: Specified RGEO = %d not matched\n", rgeo); - } - } -return 0; -} - - -int -BSIM4v4RdsEndSha( -double Weffcj, double Rsh, double DMCG, double DMCI, double DMDG, -double nuEnd, -int rgeo, int Type, -double *Rend) -{ - NG_IGNORE(DMCI); - NG_IGNORE(DMDG); - - if (Type == 1) - { switch(rgeo) - { case 1: - case 2: - case 5: - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * DMCG / (Weffcj * nuEnd); - break; - case 3: - case 4: - case 6: - if (DMCG == 0.0) - printf("DMCG can not be equal to zero\n"); - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * Weffcj / (6.0 * nuEnd * DMCG); - break; - default: - printf("Warning: Specified RGEO = %d not matched\n", rgeo); - } - } - else - { switch(rgeo) - { case 1: - case 3: - case 7: - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * DMCG / (Weffcj * nuEnd); - break; - case 2: - case 4: - case 8: - if (DMCG == 0.0) - printf("DMCG can not be equal to zero\n"); - if (nuEnd == 0.0) - *Rend = 0.0; - else - *Rend = Rsh * Weffcj / (6.0 * nuEnd * DMCG); - break; - default: - printf("Warning: Specified RGEO = %d not matched\n", rgeo); - } - } -return 0; -} diff --git a/src/spicelib/devices/bsim4v4/b4v4getic.c b/src/spicelib/devices/bsim4v4/b4v4getic.c deleted file mode 100644 index 808368e8a..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4getic.c +++ /dev/null @@ -1,43 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4getic.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - - -int -BSIM4v4getic( - GENmodel *inModel, - CKTcircuit *ckt) -{ - BSIM4v4model *model = (BSIM4v4model*)inModel; - BSIM4v4instance *here; - - for (; model ; model = model->BSIM4v4nextModel) { - for (here = model->BSIM4v4instances; here; here = here->BSIM4v4nextInstance) { - if (!here->BSIM4v4icVDSGiven) { - here->BSIM4v4icVDS = *(ckt->CKTrhs + here->BSIM4v4dNode) - - *(ckt->CKTrhs + here->BSIM4v4sNode); - } - if (!here->BSIM4v4icVGSGiven) { - here->BSIM4v4icVGS = *(ckt->CKTrhs + here->BSIM4v4gNodeExt) - - *(ckt->CKTrhs + here->BSIM4v4sNode); - } - if(!here->BSIM4v4icVBSGiven) { - here->BSIM4v4icVBS = *(ckt->CKTrhs + here->BSIM4v4bNode) - - *(ckt->CKTrhs + here->BSIM4v4sNode); - } - } - } - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4ld.c b/src/spicelib/devices/bsim4v4/b4v4ld.c deleted file mode 100644 index 3759bc9a3..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4ld.c +++ /dev/null @@ -1,5214 +0,0 @@ -/**** - BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 -****/ -/* ngspice multirevision code extension covering 4.2.1 & 4.3.0 & 4.4.0 */ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4ld.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 03/04/2004. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/trandefs.h" -#include "ngspice/const.h" -#include "ngspice/sperror.h" -#include "ngspice/devdefs.h" - -#define MAX_EXP 5.834617425e14 -#define MIN_EXP 1.713908431e-15 -#define EXP_THRESHOLD 34.0 -#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 -#define MM 3 /* smooth coeff */ -#define DEXP(A,B,C) { \ - if (A > EXP_THRESHOLD) { \ - B = MAX_EXP*(1.0+(A)-EXP_THRESHOLD); \ - C = MAX_EXP; \ - } else if (A < -EXP_THRESHOLD) { \ - B = MIN_EXP; \ - C = 0; \ - } else { \ - B = exp(A); \ - C = B; \ - } \ - } - -int BSIM4v4polyDepletion(double phi, double ngate,double coxe, double Vgs, double *Vgs_eff, double *dVgs_eff_dVg); - -int -BSIM4v4load( -GENmodel *inModel, -CKTcircuit *ckt) -{ -BSIM4v4model *model = (BSIM4v4model*)inModel; -BSIM4v4instance *here; - -double ceqgstot, dgstot_dvd, dgstot_dvg, dgstot_dvs, dgstot_dvb; -double ceqgdtot, dgdtot_dvd, dgdtot_dvg, dgdtot_dvs, dgdtot_dvb; -double gstot, gstotd, gstotg, gstots, gstotb, gspr, Rs, Rd; -double gdtot, gdtotd, gdtotg, gdtots, gdtotb, gdpr; -double vgs_eff, vgd_eff, dvgs_eff_dvg, dvgd_eff_dvg; -double dRs_dvg, dRd_dvg, dRs_dvb, dRd_dvb; -double dT0_dvg, dT1_dvb, dT3_dvg, dT3_dvb; -double vses, vdes, vdedo, delvses, delvded, delvdes; -double Isestot, cseshat, Idedtot, cdedhat; -#ifndef NEWCONV -double tol0, tol1, tol2, tol3, tol4, tol5, tol6; -#endif - -double geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb, ceqgcrg; -double vges, vgms, vgedo, vgmdo, vged, vgmd, delvged, delvgmd; -double delvges, delvgms, vgmb; -double gcgmgmb=0.0, gcgmdb=0.0, gcgmsb=0.0, gcdgmb, gcsgmb; -double gcgmbb=0.0, gcbgmb, qgmb, qgmid=0.0, ceqqgmid; - -double vbd, vbs, vds, vgb, vgd, vgs, vgdo; -#ifndef PREDICTOR -double xfact; -#endif -double vdbs, vdbd, vsbs, vsbdo, vsbd; -double delvdbs, delvdbd, delvsbs; -double delvbd_jct, delvbs_jct, vbs_jct, vbd_jct; - -double SourceSatCurrent, DrainSatCurrent; -double ag0, qgb, von, cbhat=0.0, VgstNVt, ExpVgst; -double ceqqb, ceqqd, ceqqg, ceqqjd=0.0, ceqqjs=0.0, ceq, geq; -double cdrain, cdhat=0.0, ceqdrn, ceqbd, ceqbs, ceqjd, ceqjs, gjbd, gjbs; -double czbd, czbdsw, czbdswg, czbs, czbssw, czbsswg, evbd, evbs, arg, sarg; -double delvbd, delvbs, delvds, delvgd, delvgs; -double Vfbeff=0.0, dVfbeff_dVg=0.0, dVfbeff_dVb=0.0, V3, V4; -double gcbdb, gcbgb, gcbsb, gcddb, gcdgb, gcdsb, gcgdb, gcggb, gcgsb, gcsdb; -double gcgbb, gcdbb, gcsbb, gcbbb; -double gcdbdb=0.0, gcsbsb=0.0; -double gcsgb, gcssb, MJD, MJSWD, MJSWGD, MJS, MJSWS, MJSWGS; -double qgate=0.0, qbulk=0.0, qdrn=0.0, qsrc, cqgate, cqbody, cqdrn; -double Vdb, Vds, Vgs, Vbs, Gmbs, FwdSum, RevSum; -double Igidl, Ggidld, Ggidlg, Ggidlb; -double Voxacc=0.0, dVoxacc_dVg=0.0, dVoxacc_dVb=0.0; -double Voxdepinv=0.0, dVoxdepinv_dVg=0.0, dVoxdepinv_dVd=0.0, dVoxdepinv_dVb=0.0; -double VxNVt=0.0, ExpVxNVt, Vaux=0.0, dVaux_dVg, dVaux_dVd, dVaux_dVb; -double Igc, dIgc_dVg, dIgc_dVd, dIgc_dVb; -double Igcs, dIgcs_dVg, dIgcs_dVd, dIgcs_dVb; -double Igcd, dIgcd_dVg, dIgcd_dVd, dIgcd_dVb; -double Igs, dIgs_dVg, dIgs_dVs, Igd, dIgd_dVg, dIgd_dVd; -double Igbacc, dIgbacc_dVg, dIgbacc_dVb; -double Igbinv, dIgbinv_dVg, dIgbinv_dVd, dIgbinv_dVb; - -double Pigcd, dPigcd_dVg, dPigcd_dVd, dPigcd_dVb; -double Istoteq, gIstotg, gIstotd, gIstots, gIstotb; -double Idtoteq, gIdtotg, gIdtotd, gIdtots, gIdtotb; -double Ibtoteq, gIbtotg, gIbtotd, gIbtots, gIbtotb; -double Igtoteq, gIgtotg, gIgtotd, gIgtots, gIgtotb; -double Igstot, cgshat, Igdtot, cgdhat, Igbtot, cgbhat; -double Vgs_eff, Vfb=0.0, Vth_NarrowW; -double Phis=0.0, dPhis_dVb=0.0, sqrtPhis=0.0, dsqrtPhis_dVb=0.0, Vth=0.0, dVth_dVb=0.0, dVth_dVd=0.0; -double Vgst, dVgst_dVg, dVgst_dVb, dVgs_eff_dVg, Nvtms, Nvtmd; -double Vtm; -double n, dn_dVb, dn_dVd, voffcv, noff, dnoff_dVd, dnoff_dVb; -double V0, CoxWLcen, QovCox, LINK; -double DeltaPhi, dDeltaPhi_dVg; -double Cox=0.0, Tox=100e-09, Tcen, dTcen_dVg, dTcen_dVd, dTcen_dVb; -double Ccen, Coxeff, dCoxeff_dVd, dCoxeff_dVg, dCoxeff_dVb; -double Denomi, dDenomi_dVg, dDenomi_dVd, dDenomi_dVb; -double ueff=0.0, dueff_dVg, dueff_dVd, dueff_dVb; -double Esat=0.0, Vdsat; -double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb; - -double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat, dAlphaz_dVg, dAlphaz_dVb; -double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, dVa_dVd, dVa_dVg, dVa_dVb; -double Vbseff=0.0, dVbseff_dVb=0.0, VbseffCV, dVbseffCV_dVb; -double Arg1, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL; -double T0=0.0, 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_dVd, dT4_dVb; -double T5, dT5_dVg, dT5_dVd, dT5_dVb; -double T6=0.0, dT6_dVg, dT6_dVd, dT6_dVb; -double T7, dT7_dVg=0.0, dT7_dVd=0.0, dT7_dVb=0.0; -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, T13, T14; -double tmp, Abulk, dAbulk_dVb, Abulk0, dAbulk0_dVb; -double Cclm, dCclm_dVg, dCclm_dVd, dCclm_dVb; -double FP, dFP_dVg, PvagTerm, dPvagTerm_dVg, dPvagTerm_dVd, dPvagTerm_dVb; -double VADITS, dVADITS_dVg, dVADITS_dVd; -double Lpe_Vb, dDITS_Sft_dVb, dDITS_Sft_dVd; -double VACLM, dVACLM_dVg, dVACLM_dVd, dVACLM_dVb; -double VADIBL, dVADIBL_dVg, dVADIBL_dVd, dVADIBL_dVb; -double Xdep, dXdep_dVb, lt1, dlt1_dVb, ltw, dltw_dVb, Delt_vth, dDelt_vth_dVb; -double Theta0, dTheta0_dVb; -double TempRatio, tmp1, tmp2, tmp3, tmp4; -double DIBL_Sft, dDIBL_Sft_dVd, Lambda, dLambda_dVg; -double Idtot=0.0, Ibtot=0.0, 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, 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, devbs_dvb, devbd_dvb; -double Isub, Gbd, Gbg, Gbb; -double VASCBE, dVASCBE_dVg, dVASCBE_dVd, dVASCBE_dVb; -double CoxeffWovL; -double Rds, dRds_dVg, dRds_dVb, WVCox=0.0, WVCoxRds; -double Vgst2Vtm, VdsatCV; -double Leff, Weff, dWeff_dVg, dWeff_dVb; -double AbulkCV, dAbulkCV_dVb; -double qcheq, qdef, gqdef=0.0, cqdef=0.0, cqcheq=0.0; -double gcqdb=0.0, gcqsb=0.0, gcqgb=0.0, gcqbb=0.0; -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 qgdo=0.0, qgso=0.0, cgdo=0.0, cgso=0.0; -double Cgg, Cgd, Cgb, Cdg, Cdd, Cds; -double Csg, Csd, Css, Csb, Cbg, Cbd, Cbb; -double Cgg1, Cgb1, Cgd1, Cbg1, Cbb1, Cbd1, Qac0=0.0, Qsub0; -double dQac0_dVg, dQac0_dVb, dQsub0_dVg, dQsub0_dVd, dQsub0_dVb; -double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; -double Igisl, Ggislg, Ggislb, Ggisls; -double Nvtmrs, Nvtmrssw, Nvtmrsswg; - - -double vs, Fsevl, dvs_dVg, dvs_dVd, dvs_dVb, dFsevl_dVg, dFsevl_dVd, dFsevl_dVb; -double vgdx, vgsx; -struct bsim4SizeDependParam *pParam; -int ByPass, ChargeComputationNeeded, error, Check, Check1, Check2; - -double m, min_exp_tmp=0.0; - -ScalingFactor = 1.0e-9; -ChargeComputationNeeded = - ((ckt->CKTmode & (MODEAC | MODETRAN | MODEINITSMSIG)) || - ((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC))) - ? 1 : 0; - -for (; model != NULL; model = model->BSIM4v4nextModel) -{ for (here = model->BSIM4v4instances; here != NULL; - here = here->BSIM4v4nextInstance) - { - Check = Check1 = Check2 = 1; - ByPass = 0; - pParam = here->pParam; - - if ((ckt->CKTmode & MODEINITSMSIG)) - { vds = *(ckt->CKTstate0 + here->BSIM4v4vds); - vgs = *(ckt->CKTstate0 + here->BSIM4v4vgs); - vbs = *(ckt->CKTstate0 + here->BSIM4v4vbs); - vges = *(ckt->CKTstate0 + here->BSIM4v4vges); - vgms = *(ckt->CKTstate0 + here->BSIM4v4vgms); - vdbs = *(ckt->CKTstate0 + here->BSIM4v4vdbs); - vsbs = *(ckt->CKTstate0 + here->BSIM4v4vsbs); - vses = *(ckt->CKTstate0 + here->BSIM4v4vses); - vdes = *(ckt->CKTstate0 + here->BSIM4v4vdes); - - qdef = *(ckt->CKTstate0 + here->BSIM4v4qdef); - } - else if ((ckt->CKTmode & MODEINITTRAN)) - { vds = *(ckt->CKTstate1 + here->BSIM4v4vds); - vgs = *(ckt->CKTstate1 + here->BSIM4v4vgs); - vbs = *(ckt->CKTstate1 + here->BSIM4v4vbs); - vges = *(ckt->CKTstate1 + here->BSIM4v4vges); - vgms = *(ckt->CKTstate1 + here->BSIM4v4vgms); - vdbs = *(ckt->CKTstate1 + here->BSIM4v4vdbs); - vsbs = *(ckt->CKTstate1 + here->BSIM4v4vsbs); - vses = *(ckt->CKTstate1 + here->BSIM4v4vses); - vdes = *(ckt->CKTstate1 + here->BSIM4v4vdes); - - qdef = *(ckt->CKTstate1 + here->BSIM4v4qdef); - } - else if ((ckt->CKTmode & MODEINITJCT) && !here->BSIM4v4off) - { vds = model->BSIM4v4type * here->BSIM4v4icVDS; - vgs = vges = vgms = model->BSIM4v4type * here->BSIM4v4icVGS; - vbs = vdbs = vsbs = model->BSIM4v4type * here->BSIM4v4icVBS; - if (vds > 0.0) - { vdes = vds + 0.01; - vses = -0.01; - } - else if (vds < 0.0) - { vdes = vds - 0.01; - vses = 0.01; - } - else - vdes = vses = 0.0; - - qdef = 0.0; - - if ((vds == 0.0) && (vgs == 0.0) && (vbs == 0.0) && - ((ckt->CKTmode & (MODETRAN | MODEAC|MODEDCOP | - MODEDCTRANCURVE)) || (!(ckt->CKTmode & MODEUIC)))) - { vds = 0.1; - vdes = 0.11; - vses = -0.01; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - vgs = vges = vgms = model->BSIM4v4type - * pParam->BSIM4v4vth0 + 0.1; - break; - case BSIM4v30: case BSIM4v40: - vgs = vges = vgms = model->BSIM4v4type - * here->BSIM4v4vth0 + 0.1; - break; - default: break; - } - vbs = vdbs = vsbs = 0.0; - } - } - else if ((ckt->CKTmode & (MODEINITJCT | MODEINITFIX)) && - (here->BSIM4v4off)) - { vds = vgs = vbs = vges = vgms = 0.0; - vdbs = vsbs = vdes = vses = qdef = 0.0; - } - else - { -#ifndef PREDICTOR - if ((ckt->CKTmode & MODEINITPRED)) - { xfact = ckt->CKTdelta / ckt->CKTdeltaOld[1]; - *(ckt->CKTstate0 + here->BSIM4v4vds) = - *(ckt->CKTstate1 + here->BSIM4v4vds); - vds = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vds)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vds))); - *(ckt->CKTstate0 + here->BSIM4v4vgs) = - *(ckt->CKTstate1 + here->BSIM4v4vgs); - vgs = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vgs)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vgs))); - *(ckt->CKTstate0 + here->BSIM4v4vges) = - *(ckt->CKTstate1 + here->BSIM4v4vges); - vges = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vges)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vges))); - *(ckt->CKTstate0 + here->BSIM4v4vgms) = - *(ckt->CKTstate1 + here->BSIM4v4vgms); - vgms = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vgms)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vgms))); - *(ckt->CKTstate0 + here->BSIM4v4vbs) = - *(ckt->CKTstate1 + here->BSIM4v4vbs); - vbs = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vbs)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vbs))); - *(ckt->CKTstate0 + here->BSIM4v4vbd) = - *(ckt->CKTstate0 + here->BSIM4v4vbs) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - *(ckt->CKTstate0 + here->BSIM4v4vdbs) = - *(ckt->CKTstate1 + here->BSIM4v4vdbs); - vdbs = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vdbs)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vdbs))); - *(ckt->CKTstate0 + here->BSIM4v4vdbd) = - *(ckt->CKTstate0 + here->BSIM4v4vdbs) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - *(ckt->CKTstate0 + here->BSIM4v4vsbs) = - *(ckt->CKTstate1 + here->BSIM4v4vsbs); - vsbs = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vsbs)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vsbs))); - *(ckt->CKTstate0 + here->BSIM4v4vses) = - *(ckt->CKTstate1 + here->BSIM4v4vses); - vses = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vses)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vses))); - *(ckt->CKTstate0 + here->BSIM4v4vdes) = - *(ckt->CKTstate1 + here->BSIM4v4vdes); - vdes = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4vdes)) - - (xfact * (*(ckt->CKTstate2 + here->BSIM4v4vdes))); - - *(ckt->CKTstate0 + here->BSIM4v4qdef) = - *(ckt->CKTstate1 + here->BSIM4v4qdef); - qdef = (1.0 + xfact)* (*(ckt->CKTstate1 + here->BSIM4v4qdef)) - -(xfact * (*(ckt->CKTstate2 + here->BSIM4v4qdef))); - } - else - { -#endif /* PREDICTOR */ - vds = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4dNodePrime) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vgs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4gNodePrime) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vbs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4bNodePrime) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vges = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4gNodeExt) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vgms = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4gNodeMid) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vdbs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4dbNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vsbs = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4sbNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vses = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4sNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - vdes = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4dNode) - - *(ckt->CKTrhsOld + here->BSIM4v4sNodePrime)); - qdef = model->BSIM4v4type - * (*(ckt->CKTrhsOld + here->BSIM4v4qNode)); -#ifndef PREDICTOR - } -#endif /* PREDICTOR */ - - vgdo = *(ckt->CKTstate0 + here->BSIM4v4vgs) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - vgedo = *(ckt->CKTstate0 + here->BSIM4v4vges) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - vgmdo = *(ckt->CKTstate0 + here->BSIM4v4vgms) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - - vbd = vbs - vds; - vdbd = vdbs - vds; - vgd = vgs - vds; - vged = vges - vds; - vgmd = vgms - vds; - - delvbd = vbd - *(ckt->CKTstate0 + here->BSIM4v4vbd); - delvdbd = vdbd - *(ckt->CKTstate0 + here->BSIM4v4vdbd); - delvgd = vgd - vgdo; - delvged = vged - vgedo; - delvgmd = vgmd - vgmdo; - - delvds = vds - *(ckt->CKTstate0 + here->BSIM4v4vds); - delvgs = vgs - *(ckt->CKTstate0 + here->BSIM4v4vgs); - delvges = vges - *(ckt->CKTstate0 + here->BSIM4v4vges); - delvgms = vgms - *(ckt->CKTstate0 + here->BSIM4v4vgms); - delvbs = vbs - *(ckt->CKTstate0 + here->BSIM4v4vbs); - delvdbs = vdbs - *(ckt->CKTstate0 + here->BSIM4v4vdbs); - delvsbs = vsbs - *(ckt->CKTstate0 + here->BSIM4v4vsbs); - - delvses = vses - (*(ckt->CKTstate0 + here->BSIM4v4vses)); - vdedo = *(ckt->CKTstate0 + here->BSIM4v4vdes) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - delvdes = vdes - *(ckt->CKTstate0 + here->BSIM4v4vdes); - delvded = vdes - vds - vdedo; - - delvbd_jct = (!here->BSIM4v4rbodyMod) ? delvbd : delvdbd; - delvbs_jct = (!here->BSIM4v4rbodyMod) ? delvbs : delvsbs; - if (here->BSIM4v4mode >= 0) - { Idtot = here->BSIM4v4cd + here->BSIM4v4csub - here->BSIM4v4cbd - + here->BSIM4v4Igidl; - cdhat = Idtot - here->BSIM4v4gbd * delvbd_jct - + (here->BSIM4v4gmbs + here->BSIM4v4gbbs + here->BSIM4v4ggidlb) * delvbs - + (here->BSIM4v4gm + here->BSIM4v4gbgs + here->BSIM4v4ggidlg) * delvgs - + (here->BSIM4v4gds + here->BSIM4v4gbds + here->BSIM4v4ggidld) * delvds; - Ibtot = here->BSIM4v4cbs + here->BSIM4v4cbd - - here->BSIM4v4Igidl - here->BSIM4v4Igisl - here->BSIM4v4csub; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - cbhat = Ibtot + here->BSIM4v4gbd * delvbd_jct - + here->BSIM4v4gbs * delvbs_jct - (here->BSIM4v4gbbs + here->BSIM4v4ggidlb) - * delvbs - (here->BSIM4v4gbgs + here->BSIM4v4ggidlg) * delvgs - - (here->BSIM4v4gbds + here->BSIM4v4ggidld) * delvds - - here->BSIM4v4ggislg * delvgd - here->BSIM4v4ggislb* delvbd + here->BSIM4v4ggisls * delvds ; - break; - case BSIM4v30: case BSIM4v40: - cbhat = Ibtot + here->BSIM4v4gbd * delvbd_jct - + here->BSIM4v4gbs * delvbs_jct - (here->BSIM4v4gbbs + here->BSIM4v4ggidlb) - * delvbs - (here->BSIM4v4gbgs + here->BSIM4v4ggidlg) * delvgs - - (here->BSIM4v4gbds + here->BSIM4v4ggidld - here->BSIM4v4ggisls) * delvds - - here->BSIM4v4ggislg * delvgd - here->BSIM4v4ggislb* delvbd; - break; - default: break; - } - Igstot = here->BSIM4v4Igs + here->BSIM4v4Igcs; - cgshat = Igstot + (here->BSIM4v4gIgsg + here->BSIM4v4gIgcsg) * delvgs - + here->BSIM4v4gIgcsd * delvds + here->BSIM4v4gIgcsb * delvbs; - - Igdtot = here->BSIM4v4Igd + here->BSIM4v4Igcd; - cgdhat = Igdtot + here->BSIM4v4gIgdg * delvgd + here->BSIM4v4gIgcdg * delvgs - + here->BSIM4v4gIgcdd * delvds + here->BSIM4v4gIgcdb * delvbs; - - Igbtot = here->BSIM4v4Igb; - cgbhat = here->BSIM4v4Igb + here->BSIM4v4gIgbg * delvgs + here->BSIM4v4gIgbd - * delvds + here->BSIM4v4gIgbb * delvbs; - } - else - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Idtot = here->BSIM4v4cd + here->BSIM4v4cbd - here->BSIM4v4Igisl; - cdhat = Idtot + here->BSIM4v4gbd * delvbd_jct + here->BSIM4v4gmbs - * delvbd + here->BSIM4v4gm * delvgd - - here->BSIM4v4gds * delvds - here->BSIM4v4ggislg * vgd - - here->BSIM4v4ggislb * vbd + here->BSIM4v4ggisls * vds; - Ibtot = here->BSIM4v4cbs + here->BSIM4v4cbd - - here->BSIM4v4Igidl - here->BSIM4v4Igisl - here->BSIM4v4csub; - cbhat = Ibtot + here->BSIM4v4gbs * delvbs_jct + here->BSIM4v4gbd - * delvbd_jct - (here->BSIM4v4gbbs + here->BSIM4v4ggidlb) * delvbd - - (here->BSIM4v4gbgs + here->BSIM4v4ggidlg) * delvgd - + (here->BSIM4v4gbds + here->BSIM4v4ggidld) * delvds - - here->BSIM4v4ggislg * delvgs - here->BSIM4v4ggislb * delvbs + here->BSIM4v4ggisls * delvds; - break; - case BSIM4v30: case BSIM4v40: - Idtot = here->BSIM4v4cd + here->BSIM4v4cbd - here->BSIM4v4Igidl; /* bugfix */ - cdhat = Idtot + here->BSIM4v4gbd * delvbd_jct + here->BSIM4v4gmbs - * delvbd + here->BSIM4v4gm * delvgd - - (here->BSIM4v4gds + here->BSIM4v4ggidls) * delvds - - here->BSIM4v4ggidlg * delvgs - here->BSIM4v4ggidlb * delvbs; - Ibtot = here->BSIM4v4cbs + here->BSIM4v4cbd - - here->BSIM4v4Igidl - here->BSIM4v4Igisl - here->BSIM4v4csub; - cbhat = Ibtot + here->BSIM4v4gbs * delvbs_jct + here->BSIM4v4gbd - * delvbd_jct - (here->BSIM4v4gbbs + here->BSIM4v4ggislb) * delvbd - - (here->BSIM4v4gbgs + here->BSIM4v4ggislg) * delvgd - + (here->BSIM4v4gbds + here->BSIM4v4ggisld - here->BSIM4v4ggidls) * delvds - - here->BSIM4v4ggidlg * delvgs - here->BSIM4v4ggidlb * delvbs; - break; - default: break; - } - - Igstot = here->BSIM4v4Igs + here->BSIM4v4Igcd; - cgshat = Igstot + here->BSIM4v4gIgsg * delvgs + here->BSIM4v4gIgcdg * delvgd - - here->BSIM4v4gIgcdd * delvds + here->BSIM4v4gIgcdb * delvbd; - - Igdtot = here->BSIM4v4Igd + here->BSIM4v4Igcs; - cgdhat = Igdtot + (here->BSIM4v4gIgdg + here->BSIM4v4gIgcsg) * delvgd - - here->BSIM4v4gIgcsd * delvds + here->BSIM4v4gIgcsb * delvbd; - - Igbtot = here->BSIM4v4Igb; - cgbhat = here->BSIM4v4Igb + here->BSIM4v4gIgbg * delvgd - here->BSIM4v4gIgbd - * delvds + here->BSIM4v4gIgbb * delvbd; - } - - Isestot = here->BSIM4v4gstot * (*(ckt->CKTstate0 + here->BSIM4v4vses)); - cseshat = Isestot + here->BSIM4v4gstot * delvses - + here->BSIM4v4gstotd * delvds + here->BSIM4v4gstotg * delvgs - + here->BSIM4v4gstotb * delvbs; - - Idedtot = here->BSIM4v4gdtot * vdedo; - cdedhat = Idedtot + here->BSIM4v4gdtot * delvded - + here->BSIM4v4gdtotd * delvds + here->BSIM4v4gdtotg * delvgs - + here->BSIM4v4gdtotb * delvbs; - - -#ifndef NOBYPASS - /* Following should be one IF statement, but some C compilers - * can't handle that all at once, so we split it into several - * successive IF's */ - - if ((!(ckt->CKTmode & MODEINITPRED)) && (ckt->CKTbypass)) - if ((fabs(delvds) < (ckt->CKTreltol * MAX(fabs(vds), - fabs(*(ckt->CKTstate0 + here->BSIM4v4vds))) + ckt->CKTvoltTol))) - if ((fabs(delvgs) < (ckt->CKTreltol * MAX(fabs(vgs), - fabs(*(ckt->CKTstate0 + here->BSIM4v4vgs))) + ckt->CKTvoltTol))) - if ((fabs(delvbs) < (ckt->CKTreltol * MAX(fabs(vbs), - fabs(*(ckt->CKTstate0 + here->BSIM4v4vbs))) + ckt->CKTvoltTol))) - if ((fabs(delvbd) < (ckt->CKTreltol * MAX(fabs(vbd), - fabs(*(ckt->CKTstate0 + here->BSIM4v4vbd))) + ckt->CKTvoltTol))) - if ((here->BSIM4v4rgateMod == 0) || (here->BSIM4v4rgateMod == 1) - || (fabs(delvges) < (ckt->CKTreltol * MAX(fabs(vges), - fabs(*(ckt->CKTstate0 + here->BSIM4v4vges))) + ckt->CKTvoltTol))) - if ((here->BSIM4v4rgateMod != 3) || (fabs(delvgms) < (ckt->CKTreltol - * MAX(fabs(vgms), fabs(*(ckt->CKTstate0 + here->BSIM4v4vgms))) - + ckt->CKTvoltTol))) - if ((!here->BSIM4v4rbodyMod) || (fabs(delvdbs) < (ckt->CKTreltol - * MAX(fabs(vdbs), fabs(*(ckt->CKTstate0 + here->BSIM4v4vdbs))) - + ckt->CKTvoltTol))) - if ((!here->BSIM4v4rbodyMod) || (fabs(delvdbd) < (ckt->CKTreltol - * MAX(fabs(vdbd), fabs(*(ckt->CKTstate0 + here->BSIM4v4vdbd))) - + ckt->CKTvoltTol))) - if ((!here->BSIM4v4rbodyMod) || (fabs(delvsbs) < (ckt->CKTreltol - * MAX(fabs(vsbs), fabs(*(ckt->CKTstate0 + here->BSIM4v4vsbs))) - + ckt->CKTvoltTol))) - if ((!model->BSIM4v4rdsMod) || (fabs(delvses) < (ckt->CKTreltol - * MAX(fabs(vses), fabs(*(ckt->CKTstate0 + here->BSIM4v4vses))) - + ckt->CKTvoltTol))) - if ((!model->BSIM4v4rdsMod) || (fabs(delvdes) < (ckt->CKTreltol - * MAX(fabs(vdes), fabs(*(ckt->CKTstate0 + here->BSIM4v4vdes))) - + ckt->CKTvoltTol))) - if ((fabs(cdhat - Idtot) < ckt->CKTreltol - * MAX(fabs(cdhat), fabs(Idtot)) + ckt->CKTabstol)) - if ((fabs(cbhat - Ibtot) < ckt->CKTreltol - * MAX(fabs(cbhat), fabs(Ibtot)) + ckt->CKTabstol)) - if ((!model->BSIM4v4igcMod) || ((fabs(cgshat - Igstot) < ckt->CKTreltol - * MAX(fabs(cgshat), fabs(Igstot)) + ckt->CKTabstol))) - if ((!model->BSIM4v4igcMod) || ((fabs(cgdhat - Igdtot) < ckt->CKTreltol - * MAX(fabs(cgdhat), fabs(Igdtot)) + ckt->CKTabstol))) - if ((!model->BSIM4v4igbMod) || ((fabs(cgbhat - Igbtot) < ckt->CKTreltol - * MAX(fabs(cgbhat), fabs(Igbtot)) + ckt->CKTabstol))) - if ((!model->BSIM4v4rdsMod) || ((fabs(cseshat - Isestot) < ckt->CKTreltol - * MAX(fabs(cseshat), fabs(Isestot)) + ckt->CKTabstol))) - if ((!model->BSIM4v4rdsMod) || ((fabs(cdedhat - Idedtot) < ckt->CKTreltol - * MAX(fabs(cdedhat), fabs(Idedtot)) + ckt->CKTabstol))) - { vds = *(ckt->CKTstate0 + here->BSIM4v4vds); - vgs = *(ckt->CKTstate0 + here->BSIM4v4vgs); - vbs = *(ckt->CKTstate0 + here->BSIM4v4vbs); - vges = *(ckt->CKTstate0 + here->BSIM4v4vges); - vgms = *(ckt->CKTstate0 + here->BSIM4v4vgms); - - vbd = *(ckt->CKTstate0 + here->BSIM4v4vbd); - vdbs = *(ckt->CKTstate0 + here->BSIM4v4vdbs); - vdbd = *(ckt->CKTstate0 + here->BSIM4v4vdbd); - vsbs = *(ckt->CKTstate0 + here->BSIM4v4vsbs); - vses = *(ckt->CKTstate0 + here->BSIM4v4vses); - vdes = *(ckt->CKTstate0 + here->BSIM4v4vdes); - - vgd = vgs - vds; - vgb = vgs - vbs; - vged = vges - vds; - vgmd = vgms - vds; - vgmb = vgms - vbs; - - vbs_jct = (!here->BSIM4v4rbodyMod) ? vbs : vsbs; - vbd_jct = (!here->BSIM4v4rbodyMod) ? vbd : vdbd; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - qdef = *(ckt->CKTstate0 + here->BSIM4v4qdef); - break; - case BSIM4v30: case BSIM4v40: -/*** qdef should not be kept fixed even if vgs, vds & vbs has converged -**** qdef = *(ckt->CKTstate0 + here->BSIM4v4qdef); -***/ - break; - default: break; - } - cdrain = here->BSIM4v4cd; - - if ((ckt->CKTmode & (MODETRAN | MODEAC)) || - ((ckt->CKTmode & MODETRANOP) && - (ckt->CKTmode & MODEUIC))) - { ByPass = 1; - - qgate = here->BSIM4v4qgate; - qbulk = here->BSIM4v4qbulk; - qdrn = here->BSIM4v4qdrn; - cgdo = here->BSIM4v4cgdo; - qgdo = here->BSIM4v4qgdo; - cgso = here->BSIM4v4cgso; - qgso = here->BSIM4v4qgso; - - goto line755; - } - else - goto line850; - } -#endif /*NOBYPASS*/ - - von = here->BSIM4v4von; - if (*(ckt->CKTstate0 + here->BSIM4v4vds) >= 0.0) - { vgs = DEVfetlim(vgs, *(ckt->CKTstate0 + here->BSIM4v4vgs), von); - vds = vgs - vgd; - vds = DEVlimvds(vds, *(ckt->CKTstate0 + here->BSIM4v4vds)); - vgd = vgs - vds; - if (here->BSIM4v4rgateMod == 3) - { vges = DEVfetlim(vges, *(ckt->CKTstate0 + here->BSIM4v4vges), von); - vgms = DEVfetlim(vgms, *(ckt->CKTstate0 + here->BSIM4v4vgms), von); - vged = vges - vds; - vgmd = vgms - vds; - } - else if ((here->BSIM4v4rgateMod == 1) || (here->BSIM4v4rgateMod == 2)) - { vges = DEVfetlim(vges, *(ckt->CKTstate0 + here->BSIM4v4vges), von); - vged = vges - vds; - } - - if (model->BSIM4v4rdsMod) - { vdes = DEVlimvds(vdes, *(ckt->CKTstate0 + here->BSIM4v4vdes)); - vses = -DEVlimvds(-vses, -(*(ckt->CKTstate0 + here->BSIM4v4vses))); - } - - } - else - { vgd = DEVfetlim(vgd, vgdo, von); - vds = vgs - vgd; - vds = -DEVlimvds(-vds, -(*(ckt->CKTstate0 + here->BSIM4v4vds))); - vgs = vgd + vds; - - if (here->BSIM4v4rgateMod == 3) - { vged = DEVfetlim(vged, vgedo, von); - vges = vged + vds; - vgmd = DEVfetlim(vgmd, vgmdo, von); - vgms = vgmd + vds; - } - if ((here->BSIM4v4rgateMod == 1) || (here->BSIM4v4rgateMod == 2)) - { vged = DEVfetlim(vged, vgedo, von); - vges = vged + vds; - } - - if (model->BSIM4v4rdsMod) - { vdes = -DEVlimvds(-vdes, -(*(ckt->CKTstate0 + here->BSIM4v4vdes))); - vses = DEVlimvds(vses, *(ckt->CKTstate0 + here->BSIM4v4vses)); - } - } - - if (vds >= 0.0) - { vbs = DEVpnjlim(vbs, *(ckt->CKTstate0 + here->BSIM4v4vbs), - CONSTvt0, model->BSIM4v4vcrit, &Check); - vbd = vbs - vds; - if (here->BSIM4v4rbodyMod) - { vdbs = DEVpnjlim(vdbs, *(ckt->CKTstate0 + here->BSIM4v4vdbs), - CONSTvt0, model->BSIM4v4vcrit, &Check1); - vdbd = vdbs - vds; - vsbs = DEVpnjlim(vsbs, *(ckt->CKTstate0 + here->BSIM4v4vsbs), - CONSTvt0, model->BSIM4v4vcrit, &Check2); - if ((Check1 == 0) && (Check2 == 0)) - Check = 0; - else - Check = 1; - } - } - else - { vbd = DEVpnjlim(vbd, *(ckt->CKTstate0 + here->BSIM4v4vbd), - CONSTvt0, model->BSIM4v4vcrit, &Check); - vbs = vbd + vds; - if (here->BSIM4v4rbodyMod) - { vdbd = DEVpnjlim(vdbd, *(ckt->CKTstate0 + here->BSIM4v4vdbd), - CONSTvt0, model->BSIM4v4vcrit, &Check1); - vdbs = vdbd + vds; - vsbdo = *(ckt->CKTstate0 + here->BSIM4v4vsbs) - - *(ckt->CKTstate0 + here->BSIM4v4vds); - vsbd = vsbs - vds; - vsbd = DEVpnjlim(vsbd, vsbdo, CONSTvt0, model->BSIM4v4vcrit, &Check2); - vsbs = vsbd + vds; - if ((Check1 == 0) && (Check2 == 0)) - Check = 0; - else - Check = 1; - } - } - } - - /* Calculate DC currents and their derivatives */ - vbd = vbs - vds; - vgd = vgs - vds; - vgb = vgs - vbs; - vged = vges - vds; - vgmd = vgms - vds; - vgmb = vgms - vbs; - vdbd = vdbs - vds; - - vbs_jct = (!here->BSIM4v4rbodyMod) ? vbs : vsbs; - vbd_jct = (!here->BSIM4v4rbodyMod) ? vbd : vdbd; - - /* Source/drain junction diode DC model begins */ - Nvtms = model->BSIM4v4vtm * model->BSIM4v4SjctEmissionCoeff; - if ((here->BSIM4v4Aseff <= 0.0) && (here->BSIM4v4Pseff <= 0.0)) - { SourceSatCurrent = 1.0e-14; - } - else - { SourceSatCurrent = here->BSIM4v4Aseff * model->BSIM4v4SjctTempSatCurDensity - + here->BSIM4v4Pseff * model->BSIM4v4SjctSidewallTempSatCurDensity - + pParam->BSIM4v4weffCJ * here->BSIM4v4nf - * model->BSIM4v4SjctGateSidewallTempSatCurDensity; - } - - if (SourceSatCurrent <= 0.0) - { here->BSIM4v4gbs = ckt->CKTgmin; - here->BSIM4v4cbs = here->BSIM4v4gbs * vbs_jct; - } - else - { switch(model->BSIM4v4dioMod) - { case 0: - evbs = exp(vbs_jct / Nvtms); - T1 = model->BSIM4v4xjbvs * exp(-(model->BSIM4v4bvs + vbs_jct) / Nvtms); - /* WDLiu: Magic T1 in this form; different from BSIM4v4 beta. */ - here->BSIM4v4gbs = SourceSatCurrent * (evbs + T1) / Nvtms + ckt->CKTgmin; - here->BSIM4v4cbs = SourceSatCurrent * (evbs + here->BSIM4v4XExpBVS - - T1 - 1.0) + ckt->CKTgmin * vbs_jct; - break; - case 1: - T2 = vbs_jct / Nvtms; - if (T2 < -EXP_THRESHOLD) - { here->BSIM4v4gbs = ckt->CKTgmin; - here->BSIM4v4cbs = SourceSatCurrent * (MIN_EXP - 1.0) - + ckt->CKTgmin * vbs_jct; - } - else if (vbs_jct <= here->BSIM4v4vjsmFwd) - { evbs = exp(T2); - here->BSIM4v4gbs = SourceSatCurrent * evbs / Nvtms + ckt->CKTgmin; - here->BSIM4v4cbs = SourceSatCurrent * (evbs - 1.0) - + ckt->CKTgmin * vbs_jct; - } - else - { T0 = here->BSIM4v4IVjsmFwd / Nvtms; - here->BSIM4v4gbs = T0 + ckt->CKTgmin; - here->BSIM4v4cbs = here->BSIM4v4IVjsmFwd - SourceSatCurrent + T0 - * (vbs_jct - here->BSIM4v4vjsmFwd) + ckt->CKTgmin * vbs_jct; - } - break; - case 2: - if (vbs_jct < here->BSIM4v4vjsmRev) - { T0 = vbs_jct / Nvtms; - if (T0 < -EXP_THRESHOLD) - { evbs = MIN_EXP; - devbs_dvb = 0.0; - } - else - { evbs = exp(T0); - devbs_dvb = evbs / Nvtms; - } - - T1 = evbs - 1.0; - T2 = here->BSIM4v4IVjsmRev + here->BSIM4v4SslpRev - * (vbs_jct - here->BSIM4v4vjsmRev); - here->BSIM4v4gbs = devbs_dvb * T2 + T1 * here->BSIM4v4SslpRev + ckt->CKTgmin; - here->BSIM4v4cbs = T1 * T2 + ckt->CKTgmin * vbs_jct; - } - else if (vbs_jct <= here->BSIM4v4vjsmFwd) - { T0 = vbs_jct / Nvtms; - if (T0 < -EXP_THRESHOLD) - { evbs = MIN_EXP; - devbs_dvb = 0.0; - } - else - { evbs = exp(T0); - devbs_dvb = evbs / Nvtms; - } - - T1 = (model->BSIM4v4bvs + vbs_jct) / Nvtms; - if (T1 > EXP_THRESHOLD) - { T2 = MIN_EXP; - T3 = 0.0; - } - else - { T2 = exp(-T1); - T3 = -T2 /Nvtms; - } - here->BSIM4v4gbs = SourceSatCurrent * (devbs_dvb - model->BSIM4v4xjbvs * T3) - + ckt->CKTgmin; - here->BSIM4v4cbs = SourceSatCurrent * (evbs + here->BSIM4v4XExpBVS - 1.0 - - model->BSIM4v4xjbvs * T2) + ckt->CKTgmin * vbs_jct; - } - else - { here->BSIM4v4gbs = here->BSIM4v4SslpFwd + ckt->CKTgmin; - here->BSIM4v4cbs = here->BSIM4v4IVjsmFwd + here->BSIM4v4SslpFwd * (vbs_jct - - here->BSIM4v4vjsmFwd) + ckt->CKTgmin * vbs_jct; - } - break; - default: break; - } - } - - Nvtmd = model->BSIM4v4vtm * model->BSIM4v4DjctEmissionCoeff; - if ((here->BSIM4v4Adeff <= 0.0) && (here->BSIM4v4Pdeff <= 0.0)) - { DrainSatCurrent = 1.0e-14; - } - else - { DrainSatCurrent = here->BSIM4v4Adeff * model->BSIM4v4DjctTempSatCurDensity - + here->BSIM4v4Pdeff * model->BSIM4v4DjctSidewallTempSatCurDensity - + pParam->BSIM4v4weffCJ * here->BSIM4v4nf - * model->BSIM4v4DjctGateSidewallTempSatCurDensity; - } - - if (DrainSatCurrent <= 0.0) - { here->BSIM4v4gbd = ckt->CKTgmin; - here->BSIM4v4cbd = here->BSIM4v4gbd * vbd_jct; - } - else - { switch(model->BSIM4v4dioMod) - { case 0: - evbd = exp(vbd_jct / Nvtmd); - T1 = model->BSIM4v4xjbvd * exp(-(model->BSIM4v4bvd + vbd_jct) / Nvtmd); - /* WDLiu: Magic T1 in this form; different from BSIM4v4 beta. */ - here->BSIM4v4gbd = DrainSatCurrent * (evbd + T1) / Nvtmd + ckt->CKTgmin; - here->BSIM4v4cbd = DrainSatCurrent * (evbd + here->BSIM4v4XExpBVD - - T1 - 1.0) + ckt->CKTgmin * vbd_jct; - break; - case 1: - T2 = vbd_jct / Nvtmd; - if (T2 < -EXP_THRESHOLD) - { here->BSIM4v4gbd = ckt->CKTgmin; - here->BSIM4v4cbd = DrainSatCurrent * (MIN_EXP - 1.0) - + ckt->CKTgmin * vbd_jct; - } - else if (vbd_jct <= here->BSIM4v4vjdmFwd) - { evbd = exp(T2); - here->BSIM4v4gbd = DrainSatCurrent * evbd / Nvtmd + ckt->CKTgmin; - here->BSIM4v4cbd = DrainSatCurrent * (evbd - 1.0) - + ckt->CKTgmin * vbd_jct; - } - else - { T0 = here->BSIM4v4IVjdmFwd / Nvtmd; - here->BSIM4v4gbd = T0 + ckt->CKTgmin; - here->BSIM4v4cbd = here->BSIM4v4IVjdmFwd - DrainSatCurrent + T0 - * (vbd_jct - here->BSIM4v4vjdmFwd) + ckt->CKTgmin * vbd_jct; - } - break; - case 2: - if (vbd_jct < here->BSIM4v4vjdmRev) - { T0 = vbd_jct / Nvtmd; - if (T0 < -EXP_THRESHOLD) - { evbd = MIN_EXP; - devbd_dvb = 0.0; - } - else - { evbd = exp(T0); - devbd_dvb = evbd / Nvtmd; - } - - T1 = evbd - 1.0; - T2 = here->BSIM4v4IVjdmRev + here->BSIM4v4DslpRev - * (vbd_jct - here->BSIM4v4vjdmRev); - here->BSIM4v4gbd = devbd_dvb * T2 + T1 * here->BSIM4v4DslpRev + ckt->CKTgmin; - here->BSIM4v4cbd = T1 * T2 + ckt->CKTgmin * vbd_jct; - } - else if (vbd_jct <= here->BSIM4v4vjdmFwd) - { T0 = vbd_jct / Nvtmd; - if (T0 < -EXP_THRESHOLD) - { evbd = MIN_EXP; - devbd_dvb = 0.0; - } - else - { evbd = exp(T0); - devbd_dvb = evbd / Nvtmd; - } - - T1 = (model->BSIM4v4bvd + vbd_jct) / Nvtmd; - if (T1 > EXP_THRESHOLD) - { T2 = MIN_EXP; - T3 = 0.0; - } - else - { T2 = exp(-T1); - T3 = -T2 /Nvtmd; - } - here->BSIM4v4gbd = DrainSatCurrent * (devbd_dvb - model->BSIM4v4xjbvd * T3) - + ckt->CKTgmin; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - here->BSIM4v4cbd = DrainSatCurrent * (evbd + here->BSIM4v4XExpBVS - 1.0 - - model->BSIM4v4xjbvd * T2) + ckt->CKTgmin * vbd_jct; - break; - case BSIM4v40: - here->BSIM4v4cbd = DrainSatCurrent * (evbd + here->BSIM4v4XExpBVD - 1.0 - - model->BSIM4v4xjbvd * T2) + ckt->CKTgmin * vbd_jct; - break; - default: break; - } - } - else - { here->BSIM4v4gbd = here->BSIM4v4DslpFwd + ckt->CKTgmin; - here->BSIM4v4cbd = here->BSIM4v4IVjdmFwd + here->BSIM4v4DslpFwd * (vbd_jct - - here->BSIM4v4vjdmFwd) + ckt->CKTgmin * vbd_jct; - } - break; - default: break; - } - } /* End of diode DC model */ - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - /* trap-assisted tunneling and recombination current for reverse bias */ - Nvtmrssw = model->BSIM4v4vtm0 * model->BSIM4v4njtsswtemp; - Nvtmrsswg = model->BSIM4v4vtm0 * model->BSIM4v4njtsswgtemp; - Nvtmrs = model->BSIM4v4vtm0 * model->BSIM4v4njtstemp; - - if ((model->BSIM4v4vtss - vbs) < 1e-3) - { T9 = 1.0e3; - T0 = - vbs / Nvtmrs * T9; - DEXP(T0, T1, T10); - dT1_dVb = T10 / Nvtmrs * T9; - } else { - T9 = 1.0 / (model->BSIM4v4vtss - vbs); - T0 = -vbs / Nvtmrs * model->BSIM4v4vtss * T9; - dT0_dVb = model->BSIM4v4vtss / Nvtmrs * (T9 + vbs * T9 * T9) ; - DEXP(T0, T1, T10); - dT1_dVb = T10 * dT0_dVb; - } - - if ((model->BSIM4v4vtsd - vbd) < 1e-3) - { T9 = 1.0e3; - T0 = -vbd / Nvtmrs * T9; - DEXP(T0, T2, T10); - dT2_dVb = T10 / Nvtmrs * T9; - } else { - T9 = 1.0 / (model->BSIM4v4vtsd - vbd); - T0 = -vbd / Nvtmrs * model->BSIM4v4vtsd * T9; - dT0_dVb = model->BSIM4v4vtsd / Nvtmrs * (T9 + vbd * T9 * T9) ; - DEXP(T0, T2, T10); - dT2_dVb = T10 * dT0_dVb; - } - - if ((model->BSIM4v4vtssws - vbs) < 1e-3) - { T9 = 1.0e3; - T0 = -vbs / Nvtmrssw * T9; - DEXP(T0, T3, T10); - dT3_dVb = T10 / Nvtmrssw * T9; - } else { - T9 = 1.0 / (model->BSIM4v4vtssws - vbs); - T0 = -vbs / Nvtmrssw * model->BSIM4v4vtssws * T9; - dT0_dVb = model->BSIM4v4vtssws / Nvtmrssw * (T9 + vbs * T9 * T9) ; - DEXP(T0, T3, T10); - dT3_dVb = T10 * dT0_dVb; - } - if ((model->BSIM4v4vtsswd - vbd) < 1e-3) - { T9 = 1.0e3; - T0 = -vbd / Nvtmrssw * T9; - DEXP(T0, T4, T10); - dT4_dVb = T10 / Nvtmrssw * T9; - } else { - T9 = 1.0 / (model->BSIM4v4vtsswd - vbd); - T0 = -vbd / Nvtmrssw * model->BSIM4v4vtsswd * T9; - dT0_dVb = model->BSIM4v4vtsswd / Nvtmrssw * (T9 + vbd * T9 * T9) ; - DEXP(T0, T4, T10); - dT4_dVb = T10 * dT0_dVb; - } - - if ((model->BSIM4v4vtsswgs - vbs) < 1e-3) - { T9 = 1.0e3; - T0 = -vbs / Nvtmrsswg * T9; - DEXP(T0, T5, T10); - dT5_dVb = T10 / Nvtmrsswg * T9; - } else { - T9 = 1.0 / (model->BSIM4v4vtsswgs - vbs); - T0 = -vbs / Nvtmrsswg * model->BSIM4v4vtsswgs * T9; - dT0_dVb = model->BSIM4v4vtsswgs / Nvtmrsswg * (T9 + vbs * T9 * T9) ; - DEXP(T0, T5, T10); - dT5_dVb = T10 * dT0_dVb; - } - if ((model->BSIM4v4vtsswgd - vbd) < 1e-3) - { T9 = 1.0e3; - T0 = -vbd / Nvtmrsswg * T9; - DEXP(T0, T4, T10); - dT6_dVb = T10 / Nvtmrsswg * T9; - } else { - T9 = 1.0 / (model->BSIM4v4vtsswgd - vbd); - T0 = -vbd / Nvtmrsswg * model->BSIM4v4vtsswgd * T9; - dT0_dVb = model->BSIM4v4vtsswgd / Nvtmrsswg * (T9 + vbd * T9 * T9) ; - DEXP(T0, T6, T10); - dT6_dVb = T10 * dT0_dVb; - } - - here->BSIM4v4gbs += here->BSIM4v4SjctTempRevSatCur * dT1_dVb - + here->BSIM4v4SswTempRevSatCur * dT3_dVb - + here->BSIM4v4SswgTempRevSatCur * dT5_dVb; - here->BSIM4v4cbs -= here->BSIM4v4SjctTempRevSatCur * (T1 - 1.0) - + here->BSIM4v4SswTempRevSatCur * (T3 - 1.0) - + here->BSIM4v4SswgTempRevSatCur * (T5 - 1.0); - here->BSIM4v4gbd += here->BSIM4v4DjctTempRevSatCur * dT2_dVb - + here->BSIM4v4DswTempRevSatCur * dT4_dVb - + here->BSIM4v4DswgTempRevSatCur * dT6_dVb; - here->BSIM4v4cbd -= here->BSIM4v4DjctTempRevSatCur * (T2 - 1.0) - + here->BSIM4v4DswTempRevSatCur * (T4 - 1.0) - + here->BSIM4v4DswgTempRevSatCur * (T6 - 1.0); - - /* End of diode DC model */ - break; - default: break; - } - - if (vds >= 0.0) - { here->BSIM4v4mode = 1; - Vds = vds; - Vgs = vgs; - Vbs = vbs; - Vdb = vds - vbs; /* WDLiu: for GIDL */ - } - else - { here->BSIM4v4mode = -1; - Vds = -vds; - Vgs = vgd; - Vbs = vbd; - Vdb = -vbs; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T0 = Vbs - pParam->BSIM4v4vbsc - 0.001; - T1 = sqrt(T0 * T0 - 0.004 * pParam->BSIM4v4vbsc); - if (T0 >= 0.0) - { Vbseff = pParam->BSIM4v4vbsc + 0.5 * (T0 + T1); - dVbseff_dVb = 0.5 * (1.0 + T0 / T1); - } - else - { T2 = -0.002 / (T1 - T0); - Vbseff = pParam->BSIM4v4vbsc * (1.0 + T2); - dVbseff_dVb = T2 * pParam->BSIM4v4vbsc / T1; - } - - if (Vbseff < Vbs) - { Vbseff = Vbs; - } - - if (Vbseff > 0.0) - { T0 = pParam->BSIM4v4phi / (pParam->BSIM4v4phi + Vbseff); - Phis = pParam->BSIM4v4phi * T0; - dPhis_dVb = -T0 * T0; - sqrtPhis = pParam->BSIM4v4phis3 / (pParam->BSIM4v4phi + 0.5 * Vbseff); - dsqrtPhis_dVb = -0.5 * sqrtPhis * sqrtPhis / pParam->BSIM4v4phis3; - } - else - { Phis = pParam->BSIM4v4phi - Vbseff; - dPhis_dVb = -1.0; - sqrtPhis = sqrt(Phis); - dsqrtPhis_dVb = -0.5 / sqrtPhis; - } - break; - case BSIM4v30: case BSIM4v40: - T0 = Vbs - here->BSIM4v4vbsc - 0.001; - T1 = sqrt(T0 * T0 - 0.004 * here->BSIM4v4vbsc); - if (T0 >= 0.0) - { Vbseff = here->BSIM4v4vbsc + 0.5 * (T0 + T1); - dVbseff_dVb = 0.5 * (1.0 + T0 / T1); - } - else - { T2 = -0.002 / (T1 - T0); - Vbseff = here->BSIM4v4vbsc * (1.0 + T2); - dVbseff_dVb = T2 * here->BSIM4v4vbsc / T1; - } - - /* JX: Correction to forward body bias */ - T9 = 0.95 * pParam->BSIM4v4phi; - T0 = T9 - Vbseff - 0.001; - T1 = sqrt(T0 * T0 + 0.004 * T9); - Vbseff = T9 - 0.5 * (T0 + T1); - dVbseff_dVb *= 0.5 * (1.0 + T0 / T1); - - Phis = pParam->BSIM4v4phi - Vbseff; - dPhis_dVb = -1.0; - sqrtPhis = sqrt(Phis); - dsqrtPhis_dVb = -0.5 / sqrtPhis; - break; - default: break; - } - - Xdep = pParam->BSIM4v4Xdep0 * sqrtPhis / pParam->BSIM4v4sqrtPhi; - dXdep_dVb = (pParam->BSIM4v4Xdep0 / pParam->BSIM4v4sqrtPhi) - * dsqrtPhis_dVb; - - Leff = pParam->BSIM4v4leff; - Vtm = model->BSIM4v4vtm; - - /* Vth Calculation */ - T3 = sqrt(Xdep); - V0 = pParam->BSIM4v4vbi - pParam->BSIM4v4phi; - - T0 = pParam->BSIM4v4dvt2 * Vbseff; - if (T0 >= - 0.5) - { T1 = 1.0 + T0; - T2 = pParam->BSIM4v4dvt2; - } - else - { T4 = 1.0 / (3.0 + 8.0 * T0); - T1 = (1.0 + 3.0 * T0) * T4; - T2 = pParam->BSIM4v4dvt2 * T4 * T4; - } - lt1 = model->BSIM4v4factor1 * T3 * T1; - dlt1_dVb = model->BSIM4v4factor1 * (0.5 / T3 * T1 * dXdep_dVb + T3 * T2); - - T0 = pParam->BSIM4v4dvt2w * Vbseff; - if (T0 >= - 0.5) - { T1 = 1.0 + T0; - T2 = pParam->BSIM4v4dvt2w; - } - else - { T4 = 1.0 / (3.0 + 8.0 * T0); - T1 = (1.0 + 3.0 * T0) * T4; - T2 = pParam->BSIM4v4dvt2w * T4 * T4; - } - ltw = model->BSIM4v4factor1 * T3 * T1; - dltw_dVb = model->BSIM4v4factor1 * (0.5 / T3 * T1 * dXdep_dVb + T3 * T2); - - T0 = pParam->BSIM4v4dvt1 * Leff / lt1; - if (T0 < EXP_THRESHOLD) - { T1 = exp(T0); - T2 = T1 - 1.0; - T3 = T2 * T2; - T4 = T3 + 2.0 * T1 * MIN_EXP; - Theta0 = T1 / T4; - dT1_dVb = -T0 * T1 * dlt1_dVb / lt1; - dTheta0_dVb = dT1_dVb * (T4 - 2.0 * T1 * (T2 + MIN_EXP)) / T4 / T4; - } - else - { Theta0 = 1.0 / (MAX_EXP - 2.0); /* 3.0 * MIN_EXP omitted */ - dTheta0_dVb = 0.0; - } - here->BSIM4v4thetavth = pParam->BSIM4v4dvt0 * Theta0; - Delt_vth = here->BSIM4v4thetavth * V0; - dDelt_vth_dVb = pParam->BSIM4v4dvt0 * dTheta0_dVb * V0; - - T0 = pParam->BSIM4v4dvt1w * pParam->BSIM4v4weff * Leff / ltw; - if (T0 < EXP_THRESHOLD) - { T1 = exp(T0); - T2 = T1 - 1.0; - T3 = T2 * T2; - T4 = T3 + 2.0 * T1 * MIN_EXP; - T5 = T1 / T4; - dT1_dVb = -T0 * T1 * dltw_dVb / ltw; - dT5_dVb = dT1_dVb * (T4 - 2.0 * T1 * (T2 + MIN_EXP)) / T4 / T4; - } - else - { T5 = 1.0 / (MAX_EXP - 2.0); /* 3.0 * MIN_EXP omitted */ - dT5_dVb = 0.0; - } - T0 = pParam->BSIM4v4dvt0w * T5; - T2 = T0 * V0; - dT2_dVb = pParam->BSIM4v4dvt0w * dT5_dVb * V0; - - TempRatio = ckt->CKTtemp / model->BSIM4v4tnom - 1.0; - T0 = sqrt(1.0 + pParam->BSIM4v4lpe0 / Leff); - T1 = pParam->BSIM4v4k1ox * (T0 - 1.0) * pParam->BSIM4v4sqrtPhi - + (pParam->BSIM4v4kt1 + pParam->BSIM4v4kt1l / Leff - + pParam->BSIM4v4kt2 * Vbseff) * TempRatio; - Vth_NarrowW = model->BSIM4v4toxe * pParam->BSIM4v4phi - / (pParam->BSIM4v4weff + pParam->BSIM4v4w0); - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T3 = pParam->BSIM4v4eta0 + pParam->BSIM4v4etab * Vbseff; - break; - case BSIM4v30: case BSIM4v40: - T3 = here->BSIM4v4eta0 + pParam->BSIM4v4etab * Vbseff; - break; - default: break; - } - if (T3 < 1.0e-4) - { 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->BSIM4v4theta0vb0; - DIBL_Sft = dDIBL_Sft_dVd * Vds; - - Lpe_Vb = sqrt(1.0 + pParam->BSIM4v4lpeb / Leff); - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Vth = model->BSIM4v4type * pParam->BSIM4v4vth0 + (pParam->BSIM4v4k1ox * sqrtPhis - - pParam->BSIM4v4k1 * pParam->BSIM4v4sqrtPhi) * Lpe_Vb - - pParam->BSIM4v4k2ox * Vbseff - Delt_vth - T2 + (pParam->BSIM4v4k3 - + pParam->BSIM4v4k3b * Vbseff) * Vth_NarrowW + T1 - DIBL_Sft; - - dVth_dVb = Lpe_Vb * pParam->BSIM4v4k1ox * dsqrtPhis_dVb - pParam->BSIM4v4k2ox - - dDelt_vth_dVb - dT2_dVb + pParam->BSIM4v4k3b * Vth_NarrowW - - pParam->BSIM4v4etab * Vds * pParam->BSIM4v4theta0vb0 * T4 - + pParam->BSIM4v4kt2 * TempRatio; - dVth_dVd = -dDIBL_Sft_dVd; - break; - case BSIM4v30: case BSIM4v40: - Vth = model->BSIM4v4type * here->BSIM4v4vth0 + (pParam->BSIM4v4k1ox * sqrtPhis - - pParam->BSIM4v4k1 * pParam->BSIM4v4sqrtPhi) * Lpe_Vb - - here->BSIM4v4k2ox * Vbseff - Delt_vth - T2 + (pParam->BSIM4v4k3 - + pParam->BSIM4v4k3b * Vbseff) * Vth_NarrowW + T1 - DIBL_Sft; - - dVth_dVb = Lpe_Vb * pParam->BSIM4v4k1ox * dsqrtPhis_dVb - here->BSIM4v4k2ox - - dDelt_vth_dVb - dT2_dVb + pParam->BSIM4v4k3b * Vth_NarrowW - - pParam->BSIM4v4etab * Vds * pParam->BSIM4v4theta0vb0 * T4 - + pParam->BSIM4v4kt2 * TempRatio; - dVth_dVd = -dDIBL_Sft_dVd; - break; - default: break; - } - - - /* Calculate n */ - tmp1 = EPSSI / Xdep; - here->BSIM4v4nstar = model->BSIM4v4vtm / Charge_q * (model->BSIM4v4coxe - + tmp1 + pParam->BSIM4v4cit); - tmp2 = pParam->BSIM4v4nfactor * tmp1; - tmp3 = pParam->BSIM4v4cdsc + pParam->BSIM4v4cdscb * Vbseff - + pParam->BSIM4v4cdscd * Vds; - tmp4 = (tmp2 + tmp3 * Theta0 + pParam->BSIM4v4cit) / model->BSIM4v4coxe; - if (tmp4 >= -0.5) - { n = 1.0 + tmp4; - dn_dVb = (-tmp2 / Xdep * dXdep_dVb + tmp3 * dTheta0_dVb - + pParam->BSIM4v4cdscb * Theta0) / model->BSIM4v4coxe; - dn_dVd = pParam->BSIM4v4cdscd * Theta0 / model->BSIM4v4coxe; - } - else - { 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->BSIM4v4cdscb * Theta0) / model->BSIM4v4coxe * T0; - dn_dVd = pParam->BSIM4v4cdscd * Theta0 / model->BSIM4v4coxe * T0; - } - - - /* Vth correction for Pocket implant */ - if (pParam->BSIM4v4dvtp0 > 0.0) - { T0 = -pParam->BSIM4v4dvtp1 * Vds; - if (T0 < -EXP_THRESHOLD) - { T2 = MIN_EXP; - dT2_dVd = 0.0; - } - else - { T2 = exp(T0); - dT2_dVd = -pParam->BSIM4v4dvtp1 * T2; - } - - T3 = Leff + pParam->BSIM4v4dvtp0 * (1.0 + T2); - dT3_dVd = pParam->BSIM4v4dvtp0 * dT2_dVd; - T4 = Vtm * log(Leff / T3); - dT4_dVd = -Vtm * dT3_dVd / T3; - dDITS_Sft_dVd = dn_dVd * T4 + n * dT4_dVd; - dDITS_Sft_dVb = T4 * dn_dVb; - - Vth -= n * T4; - dVth_dVd -= dDITS_Sft_dVd; - dVth_dVb -= dDITS_Sft_dVb; - } - here->BSIM4v4von = Vth; - - /* Poly Gate Si Depletion Effect */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T0 = pParam->BSIM4v4vfb + pParam->BSIM4v4phi; - break; - case BSIM4v30: case BSIM4v40: - T0 = here->BSIM4v4vfb + pParam->BSIM4v4phi; - break; - default: break; - } - - BSIM4v4polyDepletion(T0, pParam->BSIM4v4ngate, model->BSIM4v4coxe, vgs, &vgs_eff, &dvgs_eff_dvg); - - BSIM4v4polyDepletion(T0, pParam->BSIM4v4ngate, model->BSIM4v4coxe, vgd, &vgd_eff, &dvgd_eff_dvg); - - if(here->BSIM4v4mode>0) { - Vgs_eff = vgs_eff; - dVgs_eff_dVg = dvgs_eff_dvg; - } else { - Vgs_eff = vgd_eff; - dVgs_eff_dVg = dvgd_eff_dvg; - } - here->BSIM4v4vgs_eff = vgs_eff; - here->BSIM4v4vgd_eff = vgd_eff; - here->BSIM4v4dvgs_eff_dvg = dvgs_eff_dvg; - here->BSIM4v4dvgd_eff_dvg = dvgd_eff_dvg; - - - Vgst = Vgs_eff - Vth; - - /* Calculate Vgsteff */ - T0 = n * Vtm; - T1 = pParam->BSIM4v4mstar * Vgst; - T2 = T1 / T0; - if (T2 > EXP_THRESHOLD) - { T10 = T1; - dT10_dVg = pParam->BSIM4v4mstar * dVgs_eff_dVg; - dT10_dVd = -dVth_dVd * pParam->BSIM4v4mstar; - dT10_dVb = -dVth_dVb * pParam->BSIM4v4mstar; - } - else if (T2 < -EXP_THRESHOLD) - { T10 = Vtm * log(1.0 + MIN_EXP); - dT10_dVg = 0.0; - dT10_dVd = T10 * dn_dVd; - dT10_dVb = T10 * dn_dVb; - T10 *= n; - } - else - { ExpVgst = exp(T2); - T3 = Vtm * log(1.0 + ExpVgst); - T10 = n * T3; - dT10_dVg = pParam->BSIM4v4mstar * ExpVgst / (1.0 + ExpVgst); - dT10_dVb = T3 * dn_dVb - dT10_dVg * (dVth_dVb + Vgst * dn_dVb / n); - dT10_dVd = T3 * dn_dVd - dT10_dVg * (dVth_dVd + Vgst * dn_dVd / n); - dT10_dVg *= dVgs_eff_dVg; - } - - T1 = pParam->BSIM4v4voffcbn - (1.0 - pParam->BSIM4v4mstar) * Vgst; - T2 = T1 / T0; - if (T2 < -EXP_THRESHOLD) - { T3 = model->BSIM4v4coxe * MIN_EXP / pParam->BSIM4v4cdep0; - T9 = pParam->BSIM4v4mstar + T3 * n; - dT9_dVg = 0.0; - dT9_dVd = dn_dVd * T3; - dT9_dVb = dn_dVb * T3; - } - else if (T2 > EXP_THRESHOLD) - { T3 = model->BSIM4v4coxe * MAX_EXP / pParam->BSIM4v4cdep0; - T9 = pParam->BSIM4v4mstar + T3 * n; - dT9_dVg = 0.0; - dT9_dVd = dn_dVd * T3; - dT9_dVb = dn_dVb * T3; - } - else - { ExpVgst = exp(T2); - T3 = model->BSIM4v4coxe / pParam->BSIM4v4cdep0; - T4 = T3 * ExpVgst; - T5 = T1 * T4 / T0; - T9 = pParam->BSIM4v4mstar + n * T4; - dT9_dVg = T3 * (pParam->BSIM4v4mstar - 1.0) * ExpVgst / Vtm; - dT9_dVb = T4 * dn_dVb - dT9_dVg * dVth_dVb - T5 * dn_dVb; - dT9_dVd = T4 * dn_dVd - dT9_dVg * dVth_dVd - T5 * dn_dVd; - dT9_dVg *= dVgs_eff_dVg; - } - - here->BSIM4v4Vgsteff = Vgsteff = T10 / T9; - T11 = T9 * T9; - dVgsteff_dVg = (T9 * dT10_dVg - T10 * dT9_dVg) / T11; - dVgsteff_dVd = (T9 * dT10_dVd - T10 * dT9_dVd) / T11; - dVgsteff_dVb = (T9 * dT10_dVb - T10 * dT9_dVb) / T11; - - /* Calculate Effective Channel Geometry */ - T9 = sqrtPhis - pParam->BSIM4v4sqrtPhi; - Weff = pParam->BSIM4v4weff - 2.0 * (pParam->BSIM4v4dwg * Vgsteff - + pParam->BSIM4v4dwb * T9); - dWeff_dVg = -2.0 * pParam->BSIM4v4dwg; - dWeff_dVb = -2.0 * pParam->BSIM4v4dwb * 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; - } - - if (model->BSIM4v4rdsMod == 1) - Rds = dRds_dVg = dRds_dVb = 0.0; - else - { T0 = 1.0 + pParam->BSIM4v4prwg * Vgsteff; - dT0_dVg = -pParam->BSIM4v4prwg / T0 / T0; - T1 = pParam->BSIM4v4prwb * T9; - dT1_dVb = pParam->BSIM4v4prwb * dsqrtPhis_dVb; - - T2 = 1.0 / T0 + T1; - T3 = T2 + sqrt(T2 * T2 + 0.01); /* 0.01 = 4.0 * 0.05 * 0.05 */ - dT3_dVg = 1.0 + T2 / (T3 - T2); - dT3_dVb = dT3_dVg * dT1_dVb; - dT3_dVg *= dT0_dVg; - - T4 = pParam->BSIM4v4rds0 * 0.5; - Rds = pParam->BSIM4v4rdswmin + T3 * T4; - dRds_dVg = T4 * dT3_dVg; - dRds_dVb = T4 * dT3_dVb; - - if (Rds > 0.0) - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v40: - here->BSIM4v4grdsw = 1.0 / Rds; - break; - case BSIM4v30: - here->BSIM4v4grdsw = 1.0 / Rds * here->BSIM4v4nf; /* bugfix */ - break; - default: break; - } - else - here->BSIM4v4grdsw = 0.0; - } - - /* Calculate Abulk */ - T9 = 0.5 * pParam->BSIM4v4k1ox * Lpe_Vb / sqrtPhis; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T1 = T9 + pParam->BSIM4v4k2ox - pParam->BSIM4v4k3b * Vth_NarrowW; - break; - case BSIM4v30: case BSIM4v40: - T1 = T9 + here->BSIM4v4k2ox - pParam->BSIM4v4k3b * Vth_NarrowW; - break; - default: break; - } - dT1_dVb = -T9 / sqrtPhis * dsqrtPhis_dVb; - - T9 = sqrt(pParam->BSIM4v4xj * Xdep); - tmp1 = Leff + 2.0 * T9; - T5 = Leff / tmp1; - tmp2 = pParam->BSIM4v4a0 * T5; - tmp3 = pParam->BSIM4v4weff + pParam->BSIM4v4b1; - tmp4 = pParam->BSIM4v4b0 / 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->BSIM4v4ags * pParam->BSIM4v4a0 * 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) - { T9 = 1.0 / (3.0 - 20.0 * Abulk); - Abulk = (0.2 - Abulk) * T9; - T10 = T9 * T9; - dAbulk_dVb *= T10; - dAbulk_dVg *= T10; - } - here->BSIM4v4Abulk = Abulk; - - T2 = pParam->BSIM4v4keta * Vbseff; - if (T2 >= -0.9) - { T0 = 1.0 / (1.0 + T2); - dT0_dVb = -pParam->BSIM4v4keta * T0 * T0; - } - else - { T1 = 1.0 / (0.8 + T2); - T0 = (17.0 + 20.0 * T2) * T1; - dT0_dVb = -pParam->BSIM4v4keta * 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->BSIM4v4mobMod == 0) - { T0 = Vgsteff + Vth + Vth; - T2 = pParam->BSIM4v4ua + pParam->BSIM4v4uc * Vbseff; - T3 = T0 / model->BSIM4v4toxe; - T5 = T3 * (T2 + pParam->BSIM4v4ub * T3); - dDenomi_dVg = (T2 + 2.0 * pParam->BSIM4v4ub * T3) / model->BSIM4v4toxe; - dDenomi_dVd = dDenomi_dVg * 2.0 * dVth_dVd; - dDenomi_dVb = dDenomi_dVg * 2.0 * dVth_dVb + pParam->BSIM4v4uc * T3; - } - else if (model->BSIM4v4mobMod == 1) - { T0 = Vgsteff + Vth + Vth; - T2 = 1.0 + pParam->BSIM4v4uc * Vbseff; - T3 = T0 / model->BSIM4v4toxe; - T4 = T3 * (pParam->BSIM4v4ua + pParam->BSIM4v4ub * T3); - T5 = T4 * T2; - dDenomi_dVg = (pParam->BSIM4v4ua + 2.0 * pParam->BSIM4v4ub * T3) * T2 - / model->BSIM4v4toxe; - dDenomi_dVd = dDenomi_dVg * 2.0 * dVth_dVd; - dDenomi_dVb = dDenomi_dVg * 2.0 * dVth_dVb + pParam->BSIM4v4uc * T4; - } - else - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T0 = (Vgsteff + pParam->BSIM4v4vtfbphi1) / model->BSIM4v4toxe; - break; - case BSIM4v30: case BSIM4v40: - T0 = (Vgsteff + here->BSIM4v4vtfbphi1) / model->BSIM4v4toxe; - break; - default: break; - } - T1 = exp(pParam->BSIM4v4eu * log(T0)); - dT1_dVg = T1 * pParam->BSIM4v4eu / T0 / model->BSIM4v4toxe; - T2 = pParam->BSIM4v4ua + pParam->BSIM4v4uc * Vbseff; - T5 = T1 * T2; - dDenomi_dVg = T2 * dT1_dVg; - dDenomi_dVd = 0.0; - dDenomi_dVb = T1 * pParam->BSIM4v4uc; - } - - if (T5 >= -0.8) - { Denomi = 1.0 + T5; - } - else - { T9 = 1.0 / (7.0 + 10.0 * T5); - Denomi = (0.6 + T5) * T9; - T9 *= T9; - dDenomi_dVg *= T9; - dDenomi_dVd *= T9; - dDenomi_dVb *= T9; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - here->BSIM4v4ueff = ueff = pParam->BSIM4v4u0temp / Denomi; - break; - case BSIM4v30: case BSIM4v40: - here->BSIM4v4ueff = ueff = here->BSIM4v4u0temp / Denomi; - break; - default: break; - } - T9 = -ueff / Denomi; - dueff_dVg = T9 * dDenomi_dVg; - dueff_dVd = T9 * dDenomi_dVd; - dueff_dVb = T9 * dDenomi_dVb; - - /* Saturation Drain Voltage Vdsat */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - WVCox = Weff * pParam->BSIM4v4vsattemp * model->BSIM4v4coxe; - break; - case BSIM4v30: case BSIM4v40: - WVCox = Weff * here->BSIM4v4vsattemp * model->BSIM4v4coxe; - break; - default: break; - } - WVCoxRds = WVCox * Rds; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Esat = 2.0 * pParam->BSIM4v4vsattemp / ueff; - break; - case BSIM4v30: case BSIM4v40: - Esat = 2.0 * here->BSIM4v4vsattemp / ueff; - break; - default: break; - } - here->BSIM4v4EsatL = EsatL = Esat * Leff; - T0 = -EsatL /ueff; - dEsatL_dVg = T0 * dueff_dVg; - dEsatL_dVd = T0 * dueff_dVd; - dEsatL_dVb = T0 * dueff_dVb; - - /* Sqrt() */ - a1 = pParam->BSIM4v4a1; - if (a1 == 0.0) - { Lambda = pParam->BSIM4v4a2; - dLambda_dVg = 0.0; - } - else if (a1 > 0.0) - { T0 = 1.0 - pParam->BSIM4v4a2; - T1 = T0 - pParam->BSIM4v4a1 * Vgsteff - 0.0001; - T2 = sqrt(T1 * T1 + 0.0004 * T0); - Lambda = pParam->BSIM4v4a2 + T0 - 0.5 * (T1 + T2); - dLambda_dVg = 0.5 * pParam->BSIM4v4a1 * (1.0 + T1 / T2); - } - else - { T1 = pParam->BSIM4v4a2 + pParam->BSIM4v4a1 * Vgsteff - 0.0001; - T2 = sqrt(T1 * T1 + 0.0004 * pParam->BSIM4v4a2); - Lambda = 0.5 * (T1 + T2); - dLambda_dVg = 0.5 * pParam->BSIM4v4a1 * (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->BSIM4v4vdsat = Vdsat; - - /* Calculate Vdseff */ - T1 = Vdsat - Vds - pParam->BSIM4v4delta; - dT1_dVg = dVdsat_dVg; - dT1_dVd = dVdsat_dVd - 1.0; - dT1_dVb = dVdsat_dVb; - - T2 = sqrt(T1 * T1 + 4.0 * pParam->BSIM4v4delta * Vdsat); - T0 = T1 / T2; - T9 = 2.0 * pParam->BSIM4v4delta; - T3 = T9 / 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; - - if (T1 >= 0.0) - { 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); - } - else - { T4 = T9 / (T2 - T1); - T5 = 1.0 - T4; - T6 = Vdsat * T4 / (T2 - T1); - Vdseff = Vdsat * T5; - dVdseff_dVg = dVdsat_dVg * T5 + T6 * (dT2_dVg - dT1_dVg); - dVdseff_dVd = dVdsat_dVd * T5 + T6 * (dT2_dVd - dT1_dVd); - dVdseff_dVb = dVdsat_dVb * T5 + T6 * (dT2_dVb - dT1_dVb); - } - - if (Vds == 0.0) - { Vdseff = 0.0; - dVdseff_dVg = 0.0; - dVdseff_dVb = 0.0; - } - - if (Vdseff > Vds) - Vdseff = Vds; - diffVds = Vds - Vdseff; - here->BSIM4v4Vdseff = Vdseff; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - /* Velocity Overshoot */ - if((model->BSIM4v4lambdaGiven) && (model->BSIM4v4lambda > 0.0) ) - { - T1 = Leff * ueff; - T2 = pParam->BSIM4v4lambda / T1; - T3 = -T2 / T1 * Leff; - dT2_dVd = T3 * dueff_dVd; - dT2_dVg = T3 * dueff_dVg; - dT2_dVb = T3 * dueff_dVb; - T5 = 1.0 / (Esat * pParam->BSIM4v4litl); - T4 = -T5 / EsatL; - dT5_dVg = dEsatL_dVg * T4; - dT5_dVd = dEsatL_dVd * T4; - dT5_dVb = dEsatL_dVb * T4; - T6 = 1.0 + diffVds * T5; - dT6_dVg = dT5_dVg * diffVds - dVdseff_dVg * T5; - dT6_dVd = dT5_dVd * diffVds + (1.0 - dVdseff_dVd) * T5; - dT6_dVb = dT5_dVb * diffVds - dVdseff_dVb * T5; - T7 = 2.0 / (T6 * T6 + 1.0); - T8 = 1.0 - T7; - T9 = T6 * T7 * T7; - dT8_dVg = T9 * dT6_dVg; - dT8_dVd = T9 * dT6_dVd; - dT8_dVb = T9 * dT6_dVb; - T10 = 1.0 + T2 * T8; - dT10_dVg = dT2_dVg * T8 + T2 * dT8_dVg; - dT10_dVd = dT2_dVd * T8 + T2 * dT8_dVd; - dT10_dVb = dT2_dVb * T8 + T2 * dT8_dVb; - if(T10 == 1.0) - dT10_dVg = dT10_dVd = dT10_dVb = 0.0; - - dEsatL_dVg *= T10; - dEsatL_dVg += EsatL * dT10_dVg; - dEsatL_dVd *= T10; - dEsatL_dVd += EsatL * dT10_dVd; - dEsatL_dVb *= T10; - dEsatL_dVb += EsatL * dT10_dVb; - EsatL *= T10; - here->BSIM4v4EsatL = EsatL; - } - break; - default: break; - } - /* 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; - - /* Calculate Idl first */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - tmp1 = pParam->BSIM4v4vtfbphi2; - break; - case BSIM4v30: case BSIM4v40: - tmp1 = here->BSIM4v4vtfbphi2; - break; - default: break; - } - tmp2 = 2.0e8 * model->BSIM4v4toxp; - dT0_dVg = 1.0 / tmp2; - T0 = (Vgsteff + tmp1) * dT0_dVg; - - tmp3 = exp(0.7 * log(T0)); - T1 = 1.0 + tmp3; - T2 = 0.7 * tmp3 / T0; - Tcen = 1.9e-9 / T1; - dTcen_dVg = -Tcen * T2 * dT0_dVg / T1; - - Coxeff = EPSSI * model->BSIM4v4coxp - / (EPSSI + model->BSIM4v4coxp * Tcen); - dCoxeff_dVg = -Coxeff * Coxeff * dTcen_dVg / EPSSI; - - CoxeffWovL = Coxeff * Weff / Leff; - beta = ueff * CoxeffWovL; - T3 = ueff / Leff; - dbeta_dVg = CoxeffWovL * dueff_dVg + T3 - * (Weff * dCoxeff_dVg + Coxeff * dWeff_dVg); - dbeta_dVd = CoxeffWovL * dueff_dVd; - dbeta_dVb = CoxeffWovL * dueff_dVb + T3 * Coxeff * dWeff_dVb; - - here->BSIM4v4AbovVgst2Vtm = Abulk / Vgst2Vtm; - T0 = 1.0 - 0.5 * Vdseff * here->BSIM4v4AbovVgst2Vtm; - 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; - Idl = gche / T0; - T1 = (1.0 - Idl * Rds) / T0; - T2 = Idl * Idl; - dIdl_dVg = T1 * dgche_dVg - T2 * dRds_dVg; - dIdl_dVd = T1 * dgche_dVd; - dIdl_dVb = T1 * dgche_dVb - T2 * dRds_dVb; - - /* Calculate degradation factor due to pocket implant */ - - if (pParam->BSIM4v4fprout <= 0.0) - { FP = 1.0; - dFP_dVg = 0.0; - } - else - { T9 = pParam->BSIM4v4fprout * sqrt(Leff) / Vgst2Vtm; - FP = 1.0 / (1.0 + T9); - dFP_dVg = FP * FP * T9 / Vgst2Vtm; - } - - /* Calculate VACLM */ - T8 = pParam->BSIM4v4pvag / EsatL; - T9 = T8 * Vgsteff; - if (T9 > -0.9) - { PvagTerm = 1.0 + T9; - dPvagTerm_dVg = T8 * (1.0 - Vgsteff * dEsatL_dVg / EsatL); - dPvagTerm_dVb = -T9 * dEsatL_dVb / EsatL; - dPvagTerm_dVd = -T9 * dEsatL_dVd / EsatL; - } - else - { T4 = 1.0 / (17.0 + 20.0 * T9); - PvagTerm = (0.8 + T9) * T4; - T4 *= T4; - dPvagTerm_dVg = T8 * (1.0 - Vgsteff * dEsatL_dVg / EsatL) * T4; - T9 *= T4 / EsatL; - dPvagTerm_dVb = -T9 * dEsatL_dVb; - dPvagTerm_dVd = -T9 * dEsatL_dVd; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - min_exp_tmp = 0.0; - break; - case BSIM4v30: case BSIM4v40: - min_exp_tmp = MIN_EXP; - break; - default: break; - } - - if ((pParam->BSIM4v4pclm > min_exp_tmp) && (diffVds > 1.0e-10)) - { T0 = 1.0 + Rds * Idl; - dT0_dVg = dRds_dVg * Idl + Rds * dIdl_dVg; - dT0_dVd = Rds * dIdl_dVd; - dT0_dVb = dRds_dVb * Idl + Rds * dIdl_dVb; - - T2 = Vdsat / Esat; - T1 = Leff + T2; - dT1_dVg = (dVdsat_dVg - T2 * dEsatL_dVg / Leff) / Esat; - dT1_dVd = (dVdsat_dVd - T2 * dEsatL_dVd / Leff) / Esat; - dT1_dVb = (dVdsat_dVb - T2 * dEsatL_dVb / Leff) / Esat; - - Cclm = FP * PvagTerm * T0 * T1 / (pParam->BSIM4v4pclm * pParam->BSIM4v4litl); - dCclm_dVg = Cclm * (dFP_dVg / FP + dPvagTerm_dVg / PvagTerm - + dT0_dVg / T0 + dT1_dVg / T1); - dCclm_dVb = Cclm * (dPvagTerm_dVb / PvagTerm + dT0_dVb / T0 - + dT1_dVb / T1); - dCclm_dVd = Cclm * (dPvagTerm_dVd / PvagTerm + dT0_dVd / T0 - + dT1_dVd / T1); - VACLM = Cclm * diffVds; - - dVACLM_dVg = dCclm_dVg * diffVds - dVdseff_dVg * Cclm; - dVACLM_dVb = dCclm_dVb * diffVds - dVdseff_dVb * Cclm; - dVACLM_dVd = dCclm_dVd * diffVds + (1.0 - dVdseff_dVd) * Cclm; - } - else - { VACLM = Cclm = MAX_EXP; - dVACLM_dVd = dVACLM_dVg = dVACLM_dVb = 0.0; - dCclm_dVd = dCclm_dVg = dCclm_dVb = 0.0; - } - - /* Calculate VADIBL */ - if (pParam->BSIM4v4thetaRout > min_exp_tmp) - { 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->BSIM4v4thetaRout; - 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->BSIM4v4pdiblb * Vbseff; - if (T7 >= -0.9) - { T3 = 1.0 / (1.0 + T7); - VADIBL *= T3; - dVADIBL_dVg *= T3; - dVADIBL_dVb = (dVADIBL_dVb - VADIBL * pParam->BSIM4v4pdiblb) - * T3; - dVADIBL_dVd *= T3; - } - else - { T4 = 1.0 / (0.8 + T7); - T3 = (17.0 + 20.0 * T7) * T4; - dVADIBL_dVg *= T3; - dVADIBL_dVb = dVADIBL_dVb * T3 - - VADIBL * pParam->BSIM4v4pdiblb * T4 * T4; - dVADIBL_dVd *= T3; - VADIBL *= T3; - } - - dVADIBL_dVg = dVADIBL_dVg * PvagTerm + VADIBL * dPvagTerm_dVg; - dVADIBL_dVb = dVADIBL_dVb * PvagTerm + VADIBL * dPvagTerm_dVb; - dVADIBL_dVd = dVADIBL_dVd * PvagTerm + VADIBL * dPvagTerm_dVd; - VADIBL *= PvagTerm; - } - else - { VADIBL = MAX_EXP; - dVADIBL_dVd = dVADIBL_dVg = dVADIBL_dVb = 0.0; - } - - /* Calculate Va */ - Va = Vasat + VACLM; - dVa_dVg = dVasat_dVg + dVACLM_dVg; - dVa_dVb = dVasat_dVb + dVACLM_dVb; - dVa_dVd = dVasat_dVd + dVACLM_dVd; - - /* Calculate VADITS */ - T0 = pParam->BSIM4v4pditsd * Vds; - if (T0 > EXP_THRESHOLD) - { T1 = MAX_EXP; - dT1_dVd = 0; - } - else - { T1 = exp(T0); - dT1_dVd = T1 * pParam->BSIM4v4pditsd; - } - - if (pParam->BSIM4v4pdits > min_exp_tmp) - { T2 = 1.0 + model->BSIM4v4pditsl * Leff; - VADITS = (1.0 + T2 * T1) / pParam->BSIM4v4pdits; - dVADITS_dVg = VADITS * dFP_dVg; - dVADITS_dVd = FP * T2 * dT1_dVd / pParam->BSIM4v4pdits; - VADITS *= FP; - } - else - { VADITS = MAX_EXP; - dVADITS_dVg = dVADITS_dVd = 0; - } - - /* Calculate VASCBE */ - if (pParam->BSIM4v4pscbe2 > 0.0) - { if (diffVds > pParam->BSIM4v4pscbe1 * pParam->BSIM4v4litl - / EXP_THRESHOLD) - { T0 = pParam->BSIM4v4pscbe1 * pParam->BSIM4v4litl / diffVds; - VASCBE = Leff * exp(T0) / pParam->BSIM4v4pscbe2; - 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->BSIM4v4pscbe2; - dVASCBE_dVg = dVASCBE_dVd = dVASCBE_dVb = 0.0; - } - } - else - { VASCBE = MAX_EXP; - dVASCBE_dVg = dVASCBE_dVd = dVASCBE_dVb = 0.0; - } - - /* Add DIBL to Ids */ - T9 = diffVds / VADIBL; - T0 = 1.0 + T9; - Idsa = Idl * T0; - dIdsa_dVg = T0 * dIdl_dVg - Idl * (dVdseff_dVg + T9 * dVADIBL_dVg) / VADIBL; - dIdsa_dVd = T0 * dIdl_dVd + Idl - * (1.0 - dVdseff_dVd - T9 * dVADIBL_dVd) / VADIBL; - dIdsa_dVb = T0 * dIdl_dVb - Idl * (dVdseff_dVb + T9 * dVADIBL_dVb) / VADIBL; - - /* Add DITS to Ids */ - T9 = diffVds / VADITS; - T0 = 1.0 + T9; - dIdsa_dVg = T0 * dIdsa_dVg - Idsa * (dVdseff_dVg + T9 * dVADITS_dVg) / VADITS; - dIdsa_dVd = T0 * dIdsa_dVd + Idsa - * (1.0 - dVdseff_dVd - T9 * dVADITS_dVd) / VADITS; - dIdsa_dVb = T0 * dIdsa_dVb - Idsa * dVdseff_dVb / VADITS; - Idsa *= T0; - - /* Add CLM to Ids */ - T0 = log(Va / Vasat); - dT0_dVg = dVa_dVg / Va - dVasat_dVg / Vasat; - dT0_dVb = dVa_dVb / Va - dVasat_dVb / Vasat; - dT0_dVd = dVa_dVd / Va - dVasat_dVd / Vasat; - T1 = T0 / Cclm; - T9 = 1.0 + T1; - dT9_dVg = (dT0_dVg - T1 * dCclm_dVg) / Cclm; - dT9_dVb = (dT0_dVb - T1 * dCclm_dVb) / Cclm; - dT9_dVd = (dT0_dVd - T1 * dCclm_dVd) / Cclm; - - dIdsa_dVg = dIdsa_dVg * T9 + Idsa * dT9_dVg; - dIdsa_dVb = dIdsa_dVb * T9 + Idsa * dT9_dVb; - dIdsa_dVd = dIdsa_dVd * T9 + Idsa * dT9_dVd; - Idsa *= T9; - - /* Substrate current begins */ - tmp = pParam->BSIM4v4alpha0 + pParam->BSIM4v4alpha1 * Leff; - if ((tmp <= 0.0) || (pParam->BSIM4v4beta0 <= 0.0)) - { Isub = Gbd = Gbb = Gbg = 0.0; - } - else - { T2 = tmp / Leff; - if (diffVds > pParam->BSIM4v4beta0 / EXP_THRESHOLD) - { T0 = -pParam->BSIM4v4beta0 / 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; - } - T4 = Idsa * Vdseff; - Isub = T1 * T4; - Gbg = T1 * (dIdsa_dVg * Vdseff + Idsa * dVdseff_dVg) - + T4 * dT1_dVg; - Gbd = T1 * (dIdsa_dVd * Vdseff + Idsa * dVdseff_dVd) - + T4 * dT1_dVd; - Gbb = T1 * (dIdsa_dVb * Vdseff + Idsa * dVdseff_dVb) - + T4 * dT1_dVb; - - Gbd += Gbg * dVgsteff_dVd; - Gbb += Gbg * dVgsteff_dVb; - Gbg *= dVgsteff_dVg; - Gbb *= dVbseff_dVb; - } - here->BSIM4v4csub = Isub; - here->BSIM4v4gbbs = Gbb; - here->BSIM4v4gbgs = Gbg; - here->BSIM4v4gbds = Gbd; - - /* Add SCBE to Ids */ - 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; - - - tmp1 = Gds + Gm * dVgsteff_dVd; - tmp2 = Gmb + Gm * dVgsteff_dVb; - tmp3 = Gm; - - Gm = (Ids * dVdseff_dVg + Vdseff * tmp3) * dVgsteff_dVg; - Gds = Ids * (dVdseff_dVd + dVdseff_dVg * dVgsteff_dVd) - + Vdseff * tmp1; - Gmb = (Ids * (dVdseff_dVb + dVdseff_dVg * dVgsteff_dVb) - + Vdseff * tmp2) * dVbseff_dVb; - - cdrain = Ids * Vdseff; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: - /* Source End Velocity Limit */ - if((model->BSIM4v4vtlGiven) && (model->BSIM4v4vtl > 0.0) ) { - T12 = 1.0 / Leff / CoxeffWovL; - T11 = T12 / Vgsteff; - T10 = -T11 / Vgsteff; - vs = cdrain * T11; /* vs */ - dvs_dVg = Gm * T11 + cdrain * T10 * dVgsteff_dVg; - dvs_dVd = Gds * T11 + cdrain * T10 * dVgsteff_dVd; - dvs_dVb = Gmb * T11 + cdrain * T10 * dVgsteff_dVb; - T0 = 2 * MM; - T1 = vs / (pParam->BSIM4v4vtl * pParam->BSIM4v4tfactor); - T2 = 1.0 + exp(T0 * log(T1)); - if(vs == 0.0) T3 = 0.0; - else T3 = (T2 - 1.0) * T0 / vs; - dT2_dVg = T3 * dvs_dVg; - dT2_dVd = T3 * dvs_dVd; - dT2_dVb = T3 * dvs_dVb; - Fsevl = 1.0 / exp(log(T2)/ T0); - T4 = -1.0 / T0 * Fsevl / T2; - dFsevl_dVg = T4 * dT2_dVg; - dFsevl_dVd = T4 * dT2_dVd; - dFsevl_dVb = T4 * dT2_dVb; - Gm *=Fsevl; - Gm += cdrain * dFsevl_dVg; - Gmb *=Fsevl; - Gmb += cdrain * dFsevl_dVb; - Gds *=Fsevl; - Gds += cdrain * dFsevl_dVd; - - cdrain *= Fsevl; - } - break; - case BSIM4v40: - /* Source End Velocity Limit */ - if((model->BSIM4v4vtlGiven) && (model->BSIM4v4vtl > 0.0) ) { - T12 = 1.0 / Leff / CoxeffWovL; - T11 = T12 / Vgsteff; - T10 = -T11 / Vgsteff; - vs = cdrain * T11; /* vs */ - dvs_dVg = Gm * T11 + cdrain * T10 * dVgsteff_dVg; - dvs_dVd = Gds * T11 + cdrain * T10 * dVgsteff_dVd; - dvs_dVb = Gmb * T11 + cdrain * T10 * dVgsteff_dVb; - T0 = 2 * MM; - T1 = vs / (pParam->BSIM4v4vtl * pParam->BSIM4v4tfactor); - if(T1 > 0.0) - { T2 = 1.0 + exp(T0 * log(T1)); - T3 = (T2 - 1.0) * T0 / vs; - Fsevl = 1.0 / exp(log(T2)/ T0); - dT2_dVg = T3 * dvs_dVg; - dT2_dVd = T3 * dvs_dVd; - dT2_dVb = T3 * dvs_dVb; - T4 = -1.0 / T0 * Fsevl / T2; - dFsevl_dVg = T4 * dT2_dVg; - dFsevl_dVd = T4 * dT2_dVd; - dFsevl_dVb = T4 * dT2_dVb; - } else { - Fsevl = 1.0; - dFsevl_dVg = 0.0; - dFsevl_dVd = 0.0; - dFsevl_dVb = 0.0; - } - Gm *=Fsevl; - Gm += cdrain * dFsevl_dVg; - Gmb *=Fsevl; - Gmb += cdrain * dFsevl_dVb; - Gds *=Fsevl; - Gds += cdrain * dFsevl_dVd; - - cdrain *= Fsevl; - } - break; - default: break; - } - here->BSIM4v4gds = Gds; - here->BSIM4v4gm = Gm; - here->BSIM4v4gmbs = Gmb; - here->BSIM4v4IdovVds = Ids; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if( here->BSIM4v4IdovVds <= 1.0e-9) here->BSIM4v4IdovVds = 1.0e-9; - break; - default: break; - } - - /* Calculate Rg */ - if ((here->BSIM4v4rgateMod > 1) || - (here->BSIM4v4trnqsMod != 0) || (here->BSIM4v4acnqsMod != 0)) - { T9 = pParam->BSIM4v4xrcrg2 * model->BSIM4v4vtm; - T0 = T9 * beta; - dT0_dVd = (dbeta_dVd + dbeta_dVg * dVgsteff_dVd) * T9; - dT0_dVb = (dbeta_dVb + dbeta_dVg * dVgsteff_dVb) * T9; - dT0_dVg = dbeta_dVg * T9; - - here->BSIM4v4gcrg = pParam->BSIM4v4xrcrg1 * ( T0 + Ids); - here->BSIM4v4gcrgd = pParam->BSIM4v4xrcrg1 * (dT0_dVd + tmp1); - here->BSIM4v4gcrgb = pParam->BSIM4v4xrcrg1 * (dT0_dVb + tmp2) - * dVbseff_dVb; - here->BSIM4v4gcrgg = pParam->BSIM4v4xrcrg1 * (dT0_dVg + tmp3) - * dVgsteff_dVg; - - if (here->BSIM4v4nf != 1.0) - { here->BSIM4v4gcrg *= here->BSIM4v4nf; - here->BSIM4v4gcrgg *= here->BSIM4v4nf; - here->BSIM4v4gcrgd *= here->BSIM4v4nf; - here->BSIM4v4gcrgb *= here->BSIM4v4nf; - } - - if (here->BSIM4v4rgateMod == 2) - { T10 = here->BSIM4v4grgeltd * here->BSIM4v4grgeltd; - T11 = here->BSIM4v4grgeltd + here->BSIM4v4gcrg; - here->BSIM4v4gcrg = here->BSIM4v4grgeltd * here->BSIM4v4gcrg / T11; - T12 = T10 / T11 / T11; - here->BSIM4v4gcrgg *= T12; - here->BSIM4v4gcrgd *= T12; - here->BSIM4v4gcrgb *= T12; - } - here->BSIM4v4gcrgs = -(here->BSIM4v4gcrgg + here->BSIM4v4gcrgd - + here->BSIM4v4gcrgb); - } - - - /* Calculate bias-dependent external S/D resistance */ - if (model->BSIM4v4rdsMod) - { /* Rs(V) */ - T0 = vgs - pParam->BSIM4v4vfbsd; - T1 = sqrt(T0 * T0 + 1.0e-4); - vgs_eff = 0.5 * (T0 + T1); - dvgs_eff_dvg = vgs_eff / T1; - - T0 = 1.0 + pParam->BSIM4v4prwg * vgs_eff; - dT0_dvg = -pParam->BSIM4v4prwg / T0 / T0 * dvgs_eff_dvg; - T1 = -pParam->BSIM4v4prwb * vbs; - dT1_dvb = -pParam->BSIM4v4prwb; - - T2 = 1.0 / T0 + T1; - T3 = T2 + sqrt(T2 * T2 + 0.01); - dT3_dvg = T3 / (T3 - T2); - dT3_dvb = dT3_dvg * dT1_dvb; - dT3_dvg *= dT0_dvg; - - T4 = pParam->BSIM4v4rs0 * 0.5; - Rs = pParam->BSIM4v4rswmin + T3 * T4; - dRs_dvg = T4 * dT3_dvg; - dRs_dvb = T4 * dT3_dvb; - - T0 = 1.0 + here->BSIM4v4sourceConductance * Rs; - here->BSIM4v4gstot = here->BSIM4v4sourceConductance / T0; - T0 = -here->BSIM4v4gstot * here->BSIM4v4gstot; - dgstot_dvd = 0.0; /* place holder */ - dgstot_dvg = T0 * dRs_dvg; - dgstot_dvb = T0 * dRs_dvb; - dgstot_dvs = -(dgstot_dvg + dgstot_dvb + dgstot_dvd); - - /* Rd(V) */ - T0 = vgd - pParam->BSIM4v4vfbsd; - T1 = sqrt(T0 * T0 + 1.0e-4); - vgd_eff = 0.5 * (T0 + T1); - dvgd_eff_dvg = vgd_eff / T1; - - T0 = 1.0 + pParam->BSIM4v4prwg * vgd_eff; - dT0_dvg = -pParam->BSIM4v4prwg / T0 / T0 * dvgd_eff_dvg; - T1 = -pParam->BSIM4v4prwb * vbd; - dT1_dvb = -pParam->BSIM4v4prwb; - - T2 = 1.0 / T0 + T1; - T3 = T2 + sqrt(T2 * T2 + 0.01); - dT3_dvg = T3 / (T3 - T2); - dT3_dvb = dT3_dvg * dT1_dvb; - dT3_dvg *= dT0_dvg; - - T4 = pParam->BSIM4v4rd0 * 0.5; - Rd = pParam->BSIM4v4rdwmin + T3 * T4; - dRd_dvg = T4 * dT3_dvg; - dRd_dvb = T4 * dT3_dvb; - - T0 = 1.0 + here->BSIM4v4drainConductance * Rd; - here->BSIM4v4gdtot = here->BSIM4v4drainConductance / T0; - T0 = -here->BSIM4v4gdtot * here->BSIM4v4gdtot; - dgdtot_dvs = 0.0; - dgdtot_dvg = T0 * dRd_dvg; - dgdtot_dvb = T0 * dRd_dvb; - dgdtot_dvd = -(dgdtot_dvg + dgdtot_dvb + dgdtot_dvs); - - here->BSIM4v4gstotd = vses * dgstot_dvd; - here->BSIM4v4gstotg = vses * dgstot_dvg; - here->BSIM4v4gstots = vses * dgstot_dvs; - here->BSIM4v4gstotb = vses * dgstot_dvb; - - T2 = vdes - vds; - here->BSIM4v4gdtotd = T2 * dgdtot_dvd; - here->BSIM4v4gdtotg = T2 * dgdtot_dvg; - here->BSIM4v4gdtots = T2 * dgdtot_dvs; - here->BSIM4v4gdtotb = T2 * dgdtot_dvb; - } - else /* WDLiu: for bypass */ - { here->BSIM4v4gstot = here->BSIM4v4gstotd = here->BSIM4v4gstotg = 0.0; - here->BSIM4v4gstots = here->BSIM4v4gstotb = 0.0; - here->BSIM4v4gdtot = here->BSIM4v4gdtotd = here->BSIM4v4gdtotg = 0.0; - here->BSIM4v4gdtots = here->BSIM4v4gdtotb = 0.0; - } - - /* Calculate GIDL current */ - vgs_eff = here->BSIM4v4vgs_eff; - dvgs_eff_dvg = here->BSIM4v4dvgs_eff_dvg; - T0 = 3.0 * model->BSIM4v4toxe; - - T1 = (vds - vgs_eff - pParam->BSIM4v4egidl ) / T0; - if ((pParam->BSIM4v4agidl <= 0.0) || (pParam->BSIM4v4bgidl <= 0.0) - || (T1 <= 0.0) || (pParam->BSIM4v4cgidl <= 0.0) || (vbd > 0.0)) - Igidl = Ggidld = Ggidlg = Ggidlb = 0.0; - else { - dT1_dVd = 1.0 / T0; - dT1_dVg = -dvgs_eff_dvg * dT1_dVd; - T2 = pParam->BSIM4v4bgidl / T1; - if (T2 < 100.0) - { Igidl = pParam->BSIM4v4agidl * pParam->BSIM4v4weffCJ * T1 * exp(-T2); - T3 = Igidl * (1.0 + T2) / T1; - Ggidld = T3 * dT1_dVd; - Ggidlg = T3 * dT1_dVg; - } - else - { Igidl = pParam->BSIM4v4agidl * pParam->BSIM4v4weffCJ * 3.720075976e-44; - Ggidld = Igidl * dT1_dVd; - Ggidlg = Igidl * dT1_dVg; - Igidl *= T1; - } - - T4 = vbd * vbd; - T5 = -vbd * T4; - T6 = pParam->BSIM4v4cgidl + T5; - T7 = T5 / T6; - T8 = 3.0 * pParam->BSIM4v4cgidl * T4 / T6 / T6; - Ggidld = Ggidld * T7 + Igidl * T8; - Ggidlg = Ggidlg * T7; - Ggidlb = -Igidl * T8; - Igidl *= T7; - } - here->BSIM4v4Igidl = Igidl; - here->BSIM4v4ggidld = Ggidld; - here->BSIM4v4ggidlg = Ggidlg; - here->BSIM4v4ggidlb = Ggidlb; - - /* Calculate GISL current */ - vgd_eff = here->BSIM4v4vgd_eff; - dvgd_eff_dvg = here->BSIM4v4dvgd_eff_dvg; - - T1 = (-vds - vgd_eff - pParam->BSIM4v4egidl ) / T0; - - if ((pParam->BSIM4v4agidl <= 0.0) || (pParam->BSIM4v4bgidl <= 0.0) - || (T1 <= 0.0) || (pParam->BSIM4v4cgidl <= 0.0) || (vbs > 0.0)) - Igisl = Ggisls = Ggislg = Ggislb = 0.0; - else { - dT1_dVd = 1.0 / T0; - dT1_dVg = -dvgd_eff_dvg * dT1_dVd; - T2 = pParam->BSIM4v4bgidl / T1; - if (T2 < 100.0) - { Igisl = pParam->BSIM4v4agidl * pParam->BSIM4v4weffCJ * T1 * exp(-T2); - T3 = Igisl * (1.0 + T2) / T1; - Ggisls = T3 * dT1_dVd; - Ggislg = T3 * dT1_dVg; - } - else - { Igisl = pParam->BSIM4v4agidl * pParam->BSIM4v4weffCJ * 3.720075976e-44; - Ggisls = Igisl * dT1_dVd; - Ggislg = Igisl * dT1_dVg; - Igisl *= T1; - } - - T4 = vbs * vbs; - T5 = -vbs * T4; - T6 = pParam->BSIM4v4cgidl + T5; - T7 = T5 / T6; - T8 = 3.0 * pParam->BSIM4v4cgidl * T4 / T6 / T6; - Ggisls = Ggisls * T7 + Igisl * T8; - Ggislg = Ggislg * T7; - Ggislb = -Igisl * T8; - Igisl *= T7; - } - here->BSIM4v4Igisl = Igisl; - here->BSIM4v4ggisls = Ggisls; - here->BSIM4v4ggislg = Ggislg; - here->BSIM4v4ggislb = Ggislb; - - - /* Calculate gate tunneling current */ - if ((model->BSIM4v4igcMod != 0) || (model->BSIM4v4igbMod != 0)) - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: - case BSIM4v21: - Vfb = pParam->BSIM4v4vfbzb; - break; - case BSIM4v40: - Vfb = here->BSIM4v4vfbzb; - break; - default: break; - } - V3 = Vfb - Vgs_eff + Vbseff - DELTA_3; - if (Vfb <= 0.0) - T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * Vfb); - else - T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * Vfb); - T1 = 0.5 * (1.0 + V3 / T0); - Vfbeff = Vfb - 0.5 * (V3 + T0); - dVfbeff_dVg = T1 * dVgs_eff_dVg; - dVfbeff_dVb = -T1; /* WDLiu: -No surprise? No. -Good! */ - - Voxacc = Vfb - Vfbeff; - dVoxacc_dVg = -dVfbeff_dVg; - dVoxacc_dVb = -dVfbeff_dVb; - if (Voxacc < 0.0) /* WDLiu: Avoiding numerical instability. */ - Voxacc = dVoxacc_dVg = dVoxacc_dVb = 0.0; - - T0 = 0.5 * pParam->BSIM4v4k1ox; - T3 = Vgs_eff - Vfbeff - Vbseff - Vgsteff; - if (pParam->BSIM4v4k1ox == 0.0) - Voxdepinv = dVoxdepinv_dVg = dVoxdepinv_dVd - = dVoxdepinv_dVb = 0.0; - else if (T3 < 0.0) - { Voxdepinv = -T3; - dVoxdepinv_dVg = -dVgs_eff_dVg + dVfbeff_dVg - + dVgsteff_dVg; - dVoxdepinv_dVd = dVgsteff_dVd; - dVoxdepinv_dVb = dVfbeff_dVb + 1.0 + dVgsteff_dVb; - } - else - { T1 = sqrt(T0 * T0 + T3); - T2 = T0 / T1; - Voxdepinv = pParam->BSIM4v4k1ox * (T1 - T0); - dVoxdepinv_dVg = T2 * (dVgs_eff_dVg - dVfbeff_dVg - - dVgsteff_dVg); - dVoxdepinv_dVd = -T2 * dVgsteff_dVd; - dVoxdepinv_dVb = -T2 * (dVfbeff_dVb + 1.0 + dVgsteff_dVb); - } - - Voxdepinv += Vgsteff; - dVoxdepinv_dVg += dVgsteff_dVg; - dVoxdepinv_dVd += dVgsteff_dVd; - dVoxdepinv_dVb += dVgsteff_dVb; - } - - if (model->BSIM4v4igcMod) - { - T0 = Vtm * pParam->BSIM4v4nigc; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - VxNVt = (Vgs_eff - model->BSIM4v4type * pParam->BSIM4v4vth0) / T0; - break; - case BSIM4v30: case BSIM4v40: - VxNVt = (Vgs_eff - model->BSIM4v4type * here->BSIM4v4vth0) / T0; - break; - default: break; - } - if (VxNVt > EXP_THRESHOLD) - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Vaux = Vgs_eff - model->BSIM4v4type * pParam->BSIM4v4vth0; - break; - case BSIM4v30: case BSIM4v40: - Vaux = Vgs_eff - model->BSIM4v4type * here->BSIM4v4vth0; - break; - default: break; - } - dVaux_dVg = dVgs_eff_dVg; - dVaux_dVd = 0.0; - dVaux_dVb = 0.0; - } - else if (VxNVt < -EXP_THRESHOLD) - { Vaux = T0 * log(1.0 + MIN_EXP); - dVaux_dVg = dVaux_dVd = dVaux_dVb = 0.0; - } - else - { ExpVxNVt = exp(VxNVt); - Vaux = T0 * log(1.0 + ExpVxNVt); - dVaux_dVg = ExpVxNVt / (1.0 + ExpVxNVt); - dVaux_dVd = 0.0; - dVaux_dVb = 0.0; - dVaux_dVg *= dVgs_eff_dVg; - } - - T2 = Vgs_eff * Vaux; - dT2_dVg = dVgs_eff_dVg * Vaux + Vgs_eff * dVaux_dVg; - dT2_dVd = Vgs_eff * dVaux_dVd; - dT2_dVb = Vgs_eff * dVaux_dVb; - - T11 = pParam->BSIM4v4Aechvb; - T12 = pParam->BSIM4v4Bechvb; - T3 = pParam->BSIM4v4aigc * pParam->BSIM4v4cigc - - pParam->BSIM4v4bigc; - T4 = pParam->BSIM4v4bigc * pParam->BSIM4v4cigc; - T5 = T12 * (pParam->BSIM4v4aigc + T3 * Voxdepinv - - T4 * Voxdepinv * Voxdepinv); - - if (T5 > EXP_THRESHOLD) - { T6 = MAX_EXP; - dT6_dVg = dT6_dVd = dT6_dVb = 0.0; - } - else if (T5 < -EXP_THRESHOLD) - { T6 = MIN_EXP; - dT6_dVg = dT6_dVd = dT6_dVb = 0.0; - } - else - { T6 = exp(T5); - dT6_dVg = T6 * T12 * (T3 - 2.0 * T4 * Voxdepinv); - dT6_dVd = dT6_dVg * dVoxdepinv_dVd; - dT6_dVb = dT6_dVg * dVoxdepinv_dVb; - dT6_dVg *= dVoxdepinv_dVg; - } - - Igc = T11 * T2 * T6; - dIgc_dVg = T11 * (T2 * dT6_dVg + T6 * dT2_dVg); - dIgc_dVd = T11 * (T2 * dT6_dVd + T6 * dT2_dVd); - dIgc_dVb = T11 * (T2 * dT6_dVb + T6 * dT2_dVb); - - if (model->BSIM4v4pigcdGiven) - { Pigcd = pParam->BSIM4v4pigcd; - dPigcd_dVg = dPigcd_dVd = dPigcd_dVb = 0.0; - } - else - { T11 = pParam->BSIM4v4Bechvb * model->BSIM4v4toxe; - T12 = Vgsteff + 1.0e-20; - T13 = T11 / T12 / T12; - T14 = -T13 / T12; - Pigcd = T13 * (1.0 - 0.5 * Vdseff / T12); - dPigcd_dVg = T14 * (2.0 + 0.5 * (dVdseff_dVg - * Vgsteff - 3.0 * Vdseff) / T12); - dPigcd_dVd = 0.5 * T14 * dVdseff_dVd - + dPigcd_dVg * dVgsteff_dVd; - dPigcd_dVb = 0.5 * T14 * dVdseff_dVb - + dPigcd_dVg * dVgsteff_dVb; - dPigcd_dVg *= dVgsteff_dVg; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T7 = -Pigcd * Vds; - dT7_dVg = -Vds * dPigcd_dVg; - dT7_dVd = -Pigcd - Vds * dPigcd_dVd; - dT7_dVb = -Vds * dPigcd_dVb; - break; - case BSIM4v30: case BSIM4v40: - T7 = -Pigcd * Vdseff; /* bugfix */ - dT7_dVg = -Vdseff * dPigcd_dVg - Pigcd * dVdseff_dVg; - dT7_dVd = -Vdseff * dPigcd_dVd - Pigcd * dVdseff_dVd + dT7_dVg * dVgsteff_dVd; - dT7_dVb = -Vdseff * dPigcd_dVb - Pigcd * dVdseff_dVb + dT7_dVg * dVgsteff_dVb; - dT7_dVg *= dVgsteff_dVg; - dT7_dVb *= dVbseff_dVb; - break; - default: break; - } - T8 = T7 * T7 + 2.0e-4; - dT8_dVg = 2.0 * T7; - dT8_dVd = dT8_dVg * dT7_dVd; - dT8_dVb = dT8_dVg * dT7_dVb; - dT8_dVg *= dT7_dVg; - - if (T7 > EXP_THRESHOLD) - { T9 = MAX_EXP; - dT9_dVg = dT9_dVd = dT9_dVb = 0.0; - } - else if (T7 < -EXP_THRESHOLD) - { T9 = MIN_EXP; - dT9_dVg = dT9_dVd = dT9_dVb = 0.0; - } - else - { T9 = exp(T7); - dT9_dVg = T9 * dT7_dVg; - dT9_dVd = T9 * dT7_dVd; - dT9_dVb = T9 * dT7_dVb; - } - - T0 = T8 * T8; - T1 = T9 - 1.0 + 1.0e-4; - T10 = (T1 - T7) / T8; - dT10_dVg = (dT9_dVg - dT7_dVg - T10 * dT8_dVg) / T8; - dT10_dVd = (dT9_dVd - dT7_dVd - T10 * dT8_dVd) / T8; - dT10_dVb = (dT9_dVb - dT7_dVb - T10 * dT8_dVb) / T8; - - Igcs = Igc * T10; - dIgcs_dVg = dIgc_dVg * T10 + Igc * dT10_dVg; - dIgcs_dVd = dIgc_dVd * T10 + Igc * dT10_dVd; - dIgcs_dVb = dIgc_dVb * T10 + Igc * dT10_dVb; - - T1 = T9 - 1.0 - 1.0e-4; - T10 = (T7 * T9 - T1) / T8; - dT10_dVg = (dT7_dVg * T9 + (T7 - 1.0) * dT9_dVg - - T10 * dT8_dVg) / T8; - dT10_dVd = (dT7_dVd * T9 + (T7 - 1.0) * dT9_dVd - - T10 * dT8_dVd) / T8; - dT10_dVb = (dT7_dVb * T9 + (T7 - 1.0) * dT9_dVb - - T10 * dT8_dVb) / T8; - Igcd = Igc * T10; - dIgcd_dVg = dIgc_dVg * T10 + Igc * dT10_dVg; - dIgcd_dVd = dIgc_dVd * T10 + Igc * dT10_dVd; - dIgcd_dVb = dIgc_dVb * T10 + Igc * dT10_dVb; - - here->BSIM4v4Igcs = Igcs; - here->BSIM4v4gIgcsg = dIgcs_dVg; - here->BSIM4v4gIgcsd = dIgcs_dVd; - here->BSIM4v4gIgcsb = dIgcs_dVb * dVbseff_dVb; - here->BSIM4v4Igcd = Igcd; - here->BSIM4v4gIgcdg = dIgcd_dVg; - here->BSIM4v4gIgcdd = dIgcd_dVd; - here->BSIM4v4gIgcdb = dIgcd_dVb * dVbseff_dVb; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - T0 = vgs - pParam->BSIM4v4vfbsd; - break; - case BSIM4v40: - T0 = vgs - (pParam->BSIM4v4vfbsd + pParam->BSIM4v4vfbsdoff); - break; - default: break; - } - vgs_eff = sqrt(T0 * T0 + 1.0e-4); - dvgs_eff_dvg = T0 / vgs_eff; - - T2 = vgs * vgs_eff; - dT2_dVg = vgs * dvgs_eff_dvg + vgs_eff; - T11 = pParam->BSIM4v4AechvbEdge; - T12 = pParam->BSIM4v4BechvbEdge; - T3 = pParam->BSIM4v4aigsd * pParam->BSIM4v4cigsd - - pParam->BSIM4v4bigsd; - T4 = pParam->BSIM4v4bigsd * pParam->BSIM4v4cigsd; - T5 = T12 * (pParam->BSIM4v4aigsd + T3 * vgs_eff - - T4 * vgs_eff * vgs_eff); - if (T5 > EXP_THRESHOLD) - { T6 = MAX_EXP; - dT6_dVg = 0.0; - } - else if (T5 < -EXP_THRESHOLD) - { T6 = MIN_EXP; - dT6_dVg = 0.0; - } - else - { T6 = exp(T5); - dT6_dVg = T6 * T12 * (T3 - 2.0 * T4 * vgs_eff) - * dvgs_eff_dvg; - } - Igs = T11 * T2 * T6; - dIgs_dVg = T11 * (T2 * dT6_dVg + T6 * dT2_dVg); - dIgs_dVs = -dIgs_dVg; - - - T0 = vgd - pParam->BSIM4v4vfbsd; - vgd_eff = sqrt(T0 * T0 + 1.0e-4); - dvgd_eff_dvg = T0 / vgd_eff; - - T2 = vgd * vgd_eff; - dT2_dVg = vgd * dvgd_eff_dvg + vgd_eff; - T5 = T12 * (pParam->BSIM4v4aigsd + T3 * vgd_eff - - T4 * vgd_eff * vgd_eff); - if (T5 > EXP_THRESHOLD) - { T6 = MAX_EXP; - dT6_dVg = 0.0; - } - else if (T5 < -EXP_THRESHOLD) - { T6 = MIN_EXP; - dT6_dVg = 0.0; - } - else - { T6 = exp(T5); - dT6_dVg = T6 * T12 * (T3 - 2.0 * T4 * vgd_eff) - * dvgd_eff_dvg; - } - Igd = T11 * T2 * T6; - dIgd_dVg = T11 * (T2 * dT6_dVg + T6 * dT2_dVg); - dIgd_dVd = -dIgd_dVg; - - here->BSIM4v4Igs = Igs; - here->BSIM4v4gIgsg = dIgs_dVg; - here->BSIM4v4gIgss = dIgs_dVs; - here->BSIM4v4Igd = Igd; - here->BSIM4v4gIgdg = dIgd_dVg; - here->BSIM4v4gIgdd = dIgd_dVd; - } - else - { here->BSIM4v4Igcs = here->BSIM4v4gIgcsg = here->BSIM4v4gIgcsd - = here->BSIM4v4gIgcsb = 0.0; - here->BSIM4v4Igcd = here->BSIM4v4gIgcdg = here->BSIM4v4gIgcdd - = here->BSIM4v4gIgcdb = 0.0; - here->BSIM4v4Igs = here->BSIM4v4gIgsg = here->BSIM4v4gIgss = 0.0; - here->BSIM4v4Igd = here->BSIM4v4gIgdg = here->BSIM4v4gIgdd = 0.0; - } - - if (model->BSIM4v4igbMod) - { T0 = Vtm * pParam->BSIM4v4nigbacc; - T1 = -Vgs_eff + Vbseff + Vfb; - VxNVt = T1 / T0; - if (VxNVt > EXP_THRESHOLD) - { Vaux = T1; - dVaux_dVg = -dVgs_eff_dVg; - dVaux_dVb = 1.0; - } - else if (VxNVt < -EXP_THRESHOLD) - { Vaux = T0 * log(1.0 + MIN_EXP); - dVaux_dVg = dVaux_dVb = 0.0; - } - else - { ExpVxNVt = exp(VxNVt); - Vaux = T0 * log(1.0 + ExpVxNVt); - dVaux_dVb = ExpVxNVt / (1.0 + ExpVxNVt); - dVaux_dVg = -dVaux_dVb * dVgs_eff_dVg; - } - - T2 = (Vgs_eff - Vbseff) * Vaux; - dT2_dVg = dVgs_eff_dVg * Vaux + (Vgs_eff - Vbseff) * dVaux_dVg; - dT2_dVb = -Vaux + (Vgs_eff - Vbseff) * dVaux_dVb; - - T11 = 4.97232e-7 * pParam->BSIM4v4weff - * pParam->BSIM4v4leff * pParam->BSIM4v4ToxRatio; - T12 = -7.45669e11 * model->BSIM4v4toxe; - T3 = pParam->BSIM4v4aigbacc * pParam->BSIM4v4cigbacc - - pParam->BSIM4v4bigbacc; - T4 = pParam->BSIM4v4bigbacc * pParam->BSIM4v4cigbacc; - T5 = T12 * (pParam->BSIM4v4aigbacc + T3 * Voxacc - - T4 * Voxacc * Voxacc); - - if (T5 > EXP_THRESHOLD) - { T6 = MAX_EXP; - dT6_dVg = dT6_dVb = 0.0; - } - else if (T5 < -EXP_THRESHOLD) - { T6 = MIN_EXP; - dT6_dVg = dT6_dVb = 0.0; - } - else - { T6 = exp(T5); - dT6_dVg = T6 * T12 * (T3 - 2.0 * T4 * Voxacc); - dT6_dVb = dT6_dVg * dVoxacc_dVb; - dT6_dVg *= dVoxacc_dVg; - } - - Igbacc = T11 * T2 * T6; - dIgbacc_dVg = T11 * (T2 * dT6_dVg + T6 * dT2_dVg); - dIgbacc_dVb = T11 * (T2 * dT6_dVb + T6 * dT2_dVb); - - - T0 = Vtm * pParam->BSIM4v4nigbinv; - T1 = Voxdepinv - pParam->BSIM4v4eigbinv; - VxNVt = T1 / T0; - if (VxNVt > EXP_THRESHOLD) - { Vaux = T1; - dVaux_dVg = dVoxdepinv_dVg; - dVaux_dVd = dVoxdepinv_dVd; - dVaux_dVb = dVoxdepinv_dVb; - } - else if (VxNVt < -EXP_THRESHOLD) - { Vaux = T0 * log(1.0 + MIN_EXP); - dVaux_dVg = dVaux_dVd = dVaux_dVb = 0.0; - } - else - { ExpVxNVt = exp(VxNVt); - Vaux = T0 * log(1.0 + ExpVxNVt); - dVaux_dVg = ExpVxNVt / (1.0 + ExpVxNVt); - dVaux_dVd = dVaux_dVg * dVoxdepinv_dVd; - dVaux_dVb = dVaux_dVg * dVoxdepinv_dVb; - dVaux_dVg *= dVoxdepinv_dVg; - } - - T2 = (Vgs_eff - Vbseff) * Vaux; - dT2_dVg = dVgs_eff_dVg * Vaux + (Vgs_eff - Vbseff) * dVaux_dVg; - dT2_dVd = (Vgs_eff - Vbseff) * dVaux_dVd; - dT2_dVb = -Vaux + (Vgs_eff - Vbseff) * dVaux_dVb; - - T11 *= 0.75610; - T12 *= 1.31724; - T3 = pParam->BSIM4v4aigbinv * pParam->BSIM4v4cigbinv - - pParam->BSIM4v4bigbinv; - T4 = pParam->BSIM4v4bigbinv * pParam->BSIM4v4cigbinv; - T5 = T12 * (pParam->BSIM4v4aigbinv + T3 * Voxdepinv - - T4 * Voxdepinv * Voxdepinv); - - if (T5 > EXP_THRESHOLD) - { T6 = MAX_EXP; - dT6_dVg = dT6_dVd = dT6_dVb = 0.0; - } - else if (T5 < -EXP_THRESHOLD) - { T6 = MIN_EXP; - dT6_dVg = dT6_dVd = dT6_dVb = 0.0; - } - else - { T6 = exp(T5); - dT6_dVg = T6 * T12 * (T3 - 2.0 * T4 * Voxdepinv); - dT6_dVd = dT6_dVg * dVoxdepinv_dVd; - dT6_dVb = dT6_dVg * dVoxdepinv_dVb; - dT6_dVg *= dVoxdepinv_dVg; - } - - Igbinv = T11 * T2 * T6; - dIgbinv_dVg = T11 * (T2 * dT6_dVg + T6 * dT2_dVg); - dIgbinv_dVd = T11 * (T2 * dT6_dVd + T6 * dT2_dVd); - dIgbinv_dVb = T11 * (T2 * dT6_dVb + T6 * dT2_dVb); - - here->BSIM4v4Igb = Igbinv + Igbacc; - here->BSIM4v4gIgbg = dIgbinv_dVg + dIgbacc_dVg; - here->BSIM4v4gIgbd = dIgbinv_dVd; - here->BSIM4v4gIgbb = (dIgbinv_dVb + dIgbacc_dVb) * dVbseff_dVb; - } - else - { here->BSIM4v4Igb = here->BSIM4v4gIgbg = here->BSIM4v4gIgbd - = here->BSIM4v4gIgbs = here->BSIM4v4gIgbb = 0.0; - } /* End of Gate current */ - - if (here->BSIM4v4nf != 1.0) - { cdrain *= here->BSIM4v4nf; - here->BSIM4v4gds *= here->BSIM4v4nf; - here->BSIM4v4gm *= here->BSIM4v4nf; - here->BSIM4v4gmbs *= here->BSIM4v4nf; - here->BSIM4v4IdovVds *= here->BSIM4v4nf; - - here->BSIM4v4gbbs *= here->BSIM4v4nf; - here->BSIM4v4gbgs *= here->BSIM4v4nf; - here->BSIM4v4gbds *= here->BSIM4v4nf; - here->BSIM4v4csub *= here->BSIM4v4nf; - - here->BSIM4v4Igidl *= here->BSIM4v4nf; - here->BSIM4v4ggidld *= here->BSIM4v4nf; - here->BSIM4v4ggidlg *= here->BSIM4v4nf; - here->BSIM4v4ggidlb *= here->BSIM4v4nf; - - here->BSIM4v4Igisl *= here->BSIM4v4nf; - here->BSIM4v4ggisls *= here->BSIM4v4nf; - here->BSIM4v4ggislg *= here->BSIM4v4nf; - here->BSIM4v4ggislb *= here->BSIM4v4nf; - - here->BSIM4v4Igcs *= here->BSIM4v4nf; - here->BSIM4v4gIgcsg *= here->BSIM4v4nf; - here->BSIM4v4gIgcsd *= here->BSIM4v4nf; - here->BSIM4v4gIgcsb *= here->BSIM4v4nf; - here->BSIM4v4Igcd *= here->BSIM4v4nf; - here->BSIM4v4gIgcdg *= here->BSIM4v4nf; - here->BSIM4v4gIgcdd *= here->BSIM4v4nf; - here->BSIM4v4gIgcdb *= here->BSIM4v4nf; - - here->BSIM4v4Igs *= here->BSIM4v4nf; - here->BSIM4v4gIgsg *= here->BSIM4v4nf; - here->BSIM4v4gIgss *= here->BSIM4v4nf; - here->BSIM4v4Igd *= here->BSIM4v4nf; - here->BSIM4v4gIgdg *= here->BSIM4v4nf; - here->BSIM4v4gIgdd *= here->BSIM4v4nf; - - here->BSIM4v4Igb *= here->BSIM4v4nf; - here->BSIM4v4gIgbg *= here->BSIM4v4nf; - here->BSIM4v4gIgbd *= here->BSIM4v4nf; - here->BSIM4v4gIgbb *= here->BSIM4v4nf; - } - - here->BSIM4v4ggidls = -(here->BSIM4v4ggidld + here->BSIM4v4ggidlg - + here->BSIM4v4ggidlb); - here->BSIM4v4ggisld = -(here->BSIM4v4ggisls + here->BSIM4v4ggislg - + here->BSIM4v4ggislb); - here->BSIM4v4gIgbs = -(here->BSIM4v4gIgbg + here->BSIM4v4gIgbd - + here->BSIM4v4gIgbb); - here->BSIM4v4gIgcss = -(here->BSIM4v4gIgcsg + here->BSIM4v4gIgcsd - + here->BSIM4v4gIgcsb); - here->BSIM4v4gIgcds = -(here->BSIM4v4gIgcdg + here->BSIM4v4gIgcdd - + here->BSIM4v4gIgcdb); - here->BSIM4v4cd = cdrain; - - - if (model->BSIM4v4tnoiMod == 0) - { Abulk = Abulk0 * pParam->BSIM4v4abulkCVfactor; - Vdsat = Vgsteff / Abulk; - T0 = Vdsat - Vds - DELTA_4; - T1 = sqrt(T0 * T0 + 4.0 * DELTA_4 * Vdsat); - if (T0 >= 0.0) - Vdseff = Vdsat - 0.5 * (T0 + T1); - else - { T3 = (DELTA_4 + DELTA_4) / (T1 - T0); - T4 = 1.0 - T3; - T5 = Vdsat * T3 / (T1 - T0); - Vdseff = Vdsat * T4; - } - if (Vds == 0.0) - Vdseff = 0.0; - - T0 = Abulk * Vdseff; - T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-20); - T2 = Vdseff / T1; - T3 = T0 * T2; - here->BSIM4v4qinv = Coxeff * pParam->BSIM4v4weffCV * here->BSIM4v4nf - * pParam->BSIM4v4leffCV - * (Vgsteff - 0.5 * T0 + Abulk * T3); - } - - /* - * BSIM4v4 C-V begins - */ - - if ((model->BSIM4v4xpart < 0) || (!ChargeComputationNeeded)) - { qgate = qdrn = qsrc = qbulk = 0.0; - here->BSIM4v4cggb = here->BSIM4v4cgsb = here->BSIM4v4cgdb = 0.0; - here->BSIM4v4cdgb = here->BSIM4v4cdsb = here->BSIM4v4cddb = 0.0; - here->BSIM4v4cbgb = here->BSIM4v4cbsb = here->BSIM4v4cbdb = 0.0; - here->BSIM4v4csgb = here->BSIM4v4cssb = here->BSIM4v4csdb = 0.0; - here->BSIM4v4cgbb = here->BSIM4v4csbb = here->BSIM4v4cdbb = here->BSIM4v4cbbb = 0.0; - here->BSIM4v4cqdb = here->BSIM4v4cqsb = here->BSIM4v4cqgb - = here->BSIM4v4cqbb = 0.0; - here->BSIM4v4gtau = 0.0; - goto finished; - } - else if (model->BSIM4v4capMod == 0) - { - if (Vbseff < 0.0) - { Vbseff = Vbs; - dVbseff_dVb = 1.0; - } - else - { Vbseff = pParam->BSIM4v4phi - Phis; - dVbseff_dVb = -dPhis_dVb; - } - - Vfb = pParam->BSIM4v4vfbcv; - Vth = Vfb + pParam->BSIM4v4phi + pParam->BSIM4v4k1ox * sqrtPhis; - Vgst = Vgs_eff - Vth; - dVth_dVb = pParam->BSIM4v4k1ox * dsqrtPhis_dVb; - dVgst_dVb = -dVth_dVb; - dVgst_dVg = dVgs_eff_dVg; - - CoxWL = model->BSIM4v4coxe * pParam->BSIM4v4weffCV - * pParam->BSIM4v4leffCV * here->BSIM4v4nf; - Arg1 = Vgs_eff - Vbseff - Vfb; - - if (Arg1 <= 0.0) - { qgate = CoxWL * Arg1; - qbulk = -qgate; - qdrn = 0.0; - - here->BSIM4v4cggb = CoxWL * dVgs_eff_dVg; - here->BSIM4v4cgdb = 0.0; - here->BSIM4v4cgsb = CoxWL * (dVbseff_dVb - dVgs_eff_dVg); - - here->BSIM4v4cdgb = 0.0; - here->BSIM4v4cddb = 0.0; - here->BSIM4v4cdsb = 0.0; - - here->BSIM4v4cbgb = -CoxWL * dVgs_eff_dVg; - here->BSIM4v4cbdb = 0.0; - here->BSIM4v4cbsb = -here->BSIM4v4cgsb; - } /* Arg1 <= 0.0, end of accumulation */ - else if (Vgst <= 0.0) - { T1 = 0.5 * pParam->BSIM4v4k1ox; - T2 = sqrt(T1 * T1 + Arg1); - qgate = CoxWL * pParam->BSIM4v4k1ox * (T2 - T1); - qbulk = -qgate; - qdrn = 0.0; - - T0 = CoxWL * T1 / T2; - here->BSIM4v4cggb = T0 * dVgs_eff_dVg; - here->BSIM4v4cgdb = 0.0; - here->BSIM4v4cgsb = T0 * (dVbseff_dVb - dVgs_eff_dVg); - - here->BSIM4v4cdgb = 0.0; - here->BSIM4v4cddb = 0.0; - here->BSIM4v4cdsb = 0.0; - - here->BSIM4v4cbgb = -here->BSIM4v4cggb; - here->BSIM4v4cbdb = 0.0; - here->BSIM4v4cbsb = -here->BSIM4v4cgsb; - } /* Vgst <= 0.0, end of depletion */ - else - { One_Third_CoxWL = CoxWL / 3.0; - Two_Third_CoxWL = 2.0 * One_Third_CoxWL; - - AbulkCV = Abulk0 * pParam->BSIM4v4abulkCVfactor; - dAbulkCV_dVb = pParam->BSIM4v4abulkCVfactor * dAbulk0_dVb; - Vdsat = Vgst / AbulkCV; - dVdsat_dVg = dVgs_eff_dVg / AbulkCV; - dVdsat_dVb = - (Vdsat * dAbulkCV_dVb + dVth_dVb)/ AbulkCV; - - if (model->BSIM4v4xpart > 0.5) - { /* 0/100 Charge partition model */ - if (Vdsat <= Vds) - { /* saturation region */ - T1 = Vdsat / 3.0; - qgate = CoxWL * (Vgs_eff - Vfb - - pParam->BSIM4v4phi - T1); - T2 = -Two_Third_CoxWL * Vgst; - qbulk = -(qgate + T2); - qdrn = 0.0; - - here->BSIM4v4cggb = One_Third_CoxWL * (3.0 - - dVdsat_dVg) * dVgs_eff_dVg; - T2 = -One_Third_CoxWL * dVdsat_dVb; - here->BSIM4v4cgsb = -(here->BSIM4v4cggb + T2); - here->BSIM4v4cgdb = 0.0; - - here->BSIM4v4cdgb = 0.0; - here->BSIM4v4cddb = 0.0; - here->BSIM4v4cdsb = 0.0; - - here->BSIM4v4cbgb = -(here->BSIM4v4cggb - - Two_Third_CoxWL * dVgs_eff_dVg); - T3 = -(T2 + Two_Third_CoxWL * dVth_dVb); - here->BSIM4v4cbsb = -(here->BSIM4v4cbgb + T3); - here->BSIM4v4cbdb = 0.0; - } - 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->BSIM4v4phi - 0.5 * (Vds - T3)); - T10 = T4 * T8; - qdrn = T4 * T7; - qbulk = -(qgate + qdrn + T10); - - T5 = T3 / T1; - here->BSIM4v4cggb = CoxWL * (1.0 - T5 * dVdsat_dVg) - * dVgs_eff_dVg; - T11 = -CoxWL * T5 * dVdsat_dVb; - here->BSIM4v4cgdb = CoxWL * (T2 - 0.5 + 0.5 * T5); - here->BSIM4v4cgsb = -(here->BSIM4v4cggb + T11 - + here->BSIM4v4cgdb); - 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->BSIM4v4cdgb = (T7 * dAlphaz_dVg - T9 - * dVdsat_dVg) * dVgs_eff_dVg; - T12 = T7 * dAlphaz_dVb - T9 * dVdsat_dVb; - here->BSIM4v4cddb = T4 * (3.0 - 6.0 * T2 - 3.0 * T5); - here->BSIM4v4cdsb = -(here->BSIM4v4cdgb + T12 - + here->BSIM4v4cddb); - - 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->BSIM4v4cbgb = -(here->BSIM4v4cggb - + here->BSIM4v4cdgb + T10); - here->BSIM4v4cbdb = -(here->BSIM4v4cgdb - + here->BSIM4v4cddb + T12); - here->BSIM4v4cbsb = -(here->BSIM4v4cgsb - + here->BSIM4v4cdsb + T0); - } - } - else if (model->BSIM4v4xpart < 0.5) - { /* 40/60 Charge partition model */ - if (Vds >= Vdsat) - { /* saturation region */ - T1 = Vdsat / 3.0; - qgate = CoxWL * (Vgs_eff - Vfb - - pParam->BSIM4v4phi - T1); - T2 = -Two_Third_CoxWL * Vgst; - qbulk = -(qgate + T2); - qdrn = 0.4 * T2; - - here->BSIM4v4cggb = One_Third_CoxWL * (3.0 - - dVdsat_dVg) * dVgs_eff_dVg; - T2 = -One_Third_CoxWL * dVdsat_dVb; - here->BSIM4v4cgsb = -(here->BSIM4v4cggb + T2); - here->BSIM4v4cgdb = 0.0; - - T3 = 0.4 * Two_Third_CoxWL; - here->BSIM4v4cdgb = -T3 * dVgs_eff_dVg; - here->BSIM4v4cddb = 0.0; - T4 = T3 * dVth_dVb; - here->BSIM4v4cdsb = -(T4 + here->BSIM4v4cdgb); - - here->BSIM4v4cbgb = -(here->BSIM4v4cggb - - Two_Third_CoxWL * dVgs_eff_dVg); - T3 = -(T2 + Two_Third_CoxWL * dVth_dVb); - here->BSIM4v4cbsb = -(here->BSIM4v4cbgb + T3); - here->BSIM4v4cbdb = 0.0; - } - 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->BSIM4v4phi - - 0.5 * (Vds - T3)); - - T5 = T3 / T1; - here->BSIM4v4cggb = CoxWL * (1.0 - T5 * dVdsat_dVg) - * dVgs_eff_dVg; - tmp = -CoxWL * T5 * dVdsat_dVb; - here->BSIM4v4cgdb = CoxWL * (T2 - 0.5 + 0.5 * T5); - here->BSIM4v4cgsb = -(here->BSIM4v4cggb - + here->BSIM4v4cgdb + 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->BSIM4v4cdgb = (T7 * dAlphaz_dVg - tmp1 - * dVdsat_dVg) * dVgs_eff_dVg; - T10 = T7 * dAlphaz_dVb - tmp1 * dVdsat_dVb; - here->BSIM4v4cddb = T4 * (2.0 - (1.0 / (3.0 * T1 - * T1) + 2.0 * tmp) * T6 + T8 - * (6.0 * Vdsat - 2.4 * Vds)); - here->BSIM4v4cdsb = -(here->BSIM4v4cdgb - + T10 + here->BSIM4v4cddb); - - T7 = 2.0 * (T1 + T3); - qbulk = -(qgate - T4 * T7); - T7 *= T9; - T0 = 4.0 * T4 * (1.0 - T5); - T12 = (-T7 * dAlphaz_dVg - here->BSIM4v4cdgb - - 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->BSIM4v4cddb; - tmp = -(T10 + T11 + T12); - - here->BSIM4v4cbgb = -(here->BSIM4v4cggb - + here->BSIM4v4cdgb + T12); - here->BSIM4v4cbdb = -(here->BSIM4v4cgdb - + here->BSIM4v4cddb + T10); - here->BSIM4v4cbsb = -(here->BSIM4v4cgsb - + here->BSIM4v4cdsb + tmp); - } - } - else - { /* 50/50 partitioning */ - if (Vds >= Vdsat) - { /* saturation region */ - T1 = Vdsat / 3.0; - qgate = CoxWL * (Vgs_eff - Vfb - - pParam->BSIM4v4phi - T1); - T2 = -Two_Third_CoxWL * Vgst; - qbulk = -(qgate + T2); - qdrn = 0.5 * T2; - - here->BSIM4v4cggb = One_Third_CoxWL * (3.0 - - dVdsat_dVg) * dVgs_eff_dVg; - T2 = -One_Third_CoxWL * dVdsat_dVb; - here->BSIM4v4cgsb = -(here->BSIM4v4cggb + T2); - here->BSIM4v4cgdb = 0.0; - - here->BSIM4v4cdgb = -One_Third_CoxWL * dVgs_eff_dVg; - here->BSIM4v4cddb = 0.0; - T4 = One_Third_CoxWL * dVth_dVb; - here->BSIM4v4cdsb = -(T4 + here->BSIM4v4cdgb); - - here->BSIM4v4cbgb = -(here->BSIM4v4cggb - - Two_Third_CoxWL * dVgs_eff_dVg); - T3 = -(T2 + Two_Third_CoxWL * dVth_dVb); - here->BSIM4v4cbsb = -(here->BSIM4v4cbgb + T3); - here->BSIM4v4cbdb = 0.0; - } - 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->BSIM4v4phi - - 0.5 * (Vds - T3)); - - T5 = T3 / T1; - here->BSIM4v4cggb = CoxWL * (1.0 - T5 * dVdsat_dVg) - * dVgs_eff_dVg; - tmp = -CoxWL * T5 * dVdsat_dVb; - here->BSIM4v4cgdb = CoxWL * (T2 - 0.5 + 0.5 * T5); - here->BSIM4v4cgsb = -(here->BSIM4v4cggb - + here->BSIM4v4cgdb + 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->BSIM4v4cdgb = (T0 * dVdsat_dVg - T7 - * dAlphaz_dVg) * dVgs_eff_dVg; - T12 = T0 * dVdsat_dVb - T7 * dAlphaz_dVb; - here->BSIM4v4cddb = T4 * (1.0 - 2.0 * T2 - T5); - here->BSIM4v4cdsb = -(here->BSIM4v4cdgb + T12 - + here->BSIM4v4cddb); - - here->BSIM4v4cbgb = -(here->BSIM4v4cggb - + 2.0 * here->BSIM4v4cdgb); - here->BSIM4v4cbdb = -(here->BSIM4v4cgdb - + 2.0 * here->BSIM4v4cddb); - here->BSIM4v4cbsb = -(here->BSIM4v4cgsb - + 2.0 * here->BSIM4v4cdsb); - } /* end of linear region */ - } /* end of 50/50 partition */ - } /* end of inversion */ - } /* end of capMod=0 */ - else - { if (Vbseff < 0.0) - { VbseffCV = Vbseff; - dVbseffCV_dVb = 1.0; - } - else - { VbseffCV = pParam->BSIM4v4phi - Phis; - dVbseffCV_dVb = -dPhis_dVb; - } - - CoxWL = model->BSIM4v4coxe * pParam->BSIM4v4weffCV - * pParam->BSIM4v4leffCV * here->BSIM4v4nf; - - /* Seperate VgsteffCV with noff and voffcv */ - noff = n * pParam->BSIM4v4noff; - dnoff_dVd = pParam->BSIM4v4noff * dn_dVd; - dnoff_dVb = pParam->BSIM4v4noff * dn_dVb; - T0 = Vtm * noff; - voffcv = pParam->BSIM4v4voffcv; - 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 */ - - - if (model->BSIM4v4capMod == 1) - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Vfb = pParam->BSIM4v4vfbzb; - break; - case BSIM4v30: case BSIM4v40: - Vfb = here->BSIM4v4vfbzb; - break; - default: break; - } - V3 = Vfb - Vgs_eff + VbseffCV - DELTA_3; - if (Vfb <= 0.0) - T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * Vfb); - else - T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * Vfb); - - T1 = 0.5 * (1.0 + V3 / T0); - Vfbeff = Vfb - 0.5 * (V3 + T0); - dVfbeff_dVg = T1 * dVgs_eff_dVg; - dVfbeff_dVb = -T1 * dVbseffCV_dVb; - Qac0 = CoxWL * (Vfbeff - Vfb); - dQac0_dVg = CoxWL * dVfbeff_dVg; - dQac0_dVb = CoxWL * dVfbeff_dVb; - - T0 = 0.5 * pParam->BSIM4v4k1ox; - T3 = Vgs_eff - Vfbeff - VbseffCV - Vgsteff; - if (pParam->BSIM4v4k1ox == 0.0) - { T1 = 0.0; - T2 = 0.0; - } - else if (T3 < 0.0) - { T1 = T0 + T3 / pParam->BSIM4v4k1ox; - T2 = CoxWL; - } - else - { T1 = sqrt(T0 * T0 + T3); - T2 = CoxWL * T0 / T1; - } - - Qsub0 = CoxWL * pParam->BSIM4v4k1ox * (T1 - T0); - - dQsub0_dVg = T2 * (dVgs_eff_dVg - dVfbeff_dVg - dVgsteff_dVg); - dQsub0_dVd = -T2 * dVgsteff_dVd; - dQsub0_dVb = -T2 * (dVfbeff_dVb + dVbseffCV_dVb - + dVgsteff_dVb); - - AbulkCV = Abulk0 * pParam->BSIM4v4abulkCVfactor; - dAbulkCV_dVb = pParam->BSIM4v4abulkCVfactor * dAbulk0_dVb; - VdsatCV = Vgsteff / AbulkCV; - - T0 = VdsatCV - Vds - DELTA_4; - dT0_dVg = 1.0 / AbulkCV; - dT0_dVb = -VdsatCV * dAbulkCV_dVb / AbulkCV; - T1 = sqrt(T0 * T0 + 4.0 * DELTA_4 * VdsatCV); - dT1_dVg = (T0 + DELTA_4 + DELTA_4) / T1; - dT1_dVd = -T0 / T1; - dT1_dVb = dT1_dVg * dT0_dVb; - dT1_dVg *= dT0_dVg; - if (T0 >= 0.0) - { VdseffCV = VdsatCV - 0.5 * (T0 + T1); - dVdseffCV_dVg = 0.5 * (dT0_dVg - dT1_dVg); - dVdseffCV_dVd = 0.5 * (1.0 - dT1_dVd); - dVdseffCV_dVb = 0.5 * (dT0_dVb - dT1_dVb); - } - else - { T3 = (DELTA_4 + DELTA_4) / (T1 - T0); - T4 = 1.0 - T3; - T5 = VdsatCV * T3 / (T1 - T0); - VdseffCV = VdsatCV * T4; - dVdseffCV_dVg = dT0_dVg * T4 + T5 * (dT1_dVg - dT0_dVg); - dVdseffCV_dVd = T5 * (dT1_dVd + 1.0); - dVdseffCV_dVb = dT0_dVb * (1.0 - T5) + T5 * dT1_dVb; - } - - if (Vds == 0.0) - { VdseffCV = 0.0; - dVdseffCV_dVg = 0.0; - dVdseffCV_dVb = 0.0; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T0 = AbulkCV * VdseffCV; - T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-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; - - qgate = CoxWL * (Vgsteff - 0.5 * VdseffCV + T3); - break; - case BSIM4v30: - T0 = AbulkCV * VdseffCV; /* bugfix */ - T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-20); - T2 = T0 / T1; - T3 = T0 * T2; - - T4 = (1.0 - 12.0 * T2 * T2); - T7 = T2 * (2.0 + 6.0 * T2) - 0.5; - T5 = T7 * AbulkCV; - T6 = T7 * VdseffCV; - - qgate = CoxWL * (Vgsteff - 0.5 * T0 + T3); - break; - case BSIM4v40: - T0 = AbulkCV * VdseffCV; - T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-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; - - qgate = CoxWL * (Vgsteff - 0.5 * VdseffCV + T3); - break; - default: break; - } - 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->BSIM4v4xpart > 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->BSIM4v4xpart < 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 = dQsub0_dVd + Cgd1; - Cgb = dQac0_dVb + dQsub0_dVb + Cgb1; - - Cbg = Cbg1 - dQac0_dVg - dQsub0_dVg; - Cbd = Cbd1 - dQsub0_dVd; - Cbb = Cbb1 - dQac0_dVb - dQsub0_dVb; - - Cgb *= dVbseff_dVb; - Cbb *= dVbseff_dVb; - Csb *= dVbseff_dVb; - - here->BSIM4v4cggb = Cgg; - here->BSIM4v4cgsb = -(Cgg + Cgd + Cgb); - here->BSIM4v4cgdb = Cgd; - here->BSIM4v4cdgb = -(Cgg + Cbg + Csg); - here->BSIM4v4cdsb = (Cgg + Cgd + Cgb + Cbg + Cbd + Cbb - + Csg + Csd + Csb); - here->BSIM4v4cddb = -(Cgd + Cbd + Csd); - here->BSIM4v4cbgb = Cbg; - here->BSIM4v4cbsb = -(Cbg + Cbd + Cbb); - here->BSIM4v4cbdb = Cbd; - } - - /* Charge-Thickness capMod (CTM) begins */ - else if (model->BSIM4v4capMod == 2) - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - V3 = pParam->BSIM4v4vfbzb - Vgs_eff + VbseffCV - DELTA_3; - if (pParam->BSIM4v4vfbzb <= 0.0) - T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * pParam->BSIM4v4vfbzb); - else - T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * pParam->BSIM4v4vfbzb); - - T1 = 0.5 * (1.0 + V3 / T0); - Vfbeff = pParam->BSIM4v4vfbzb - 0.5 * (V3 + T0); - dVfbeff_dVg = T1 * dVgs_eff_dVg; - dVfbeff_dVb = -T1 * dVbseffCV_dVb; - - Cox = model->BSIM4v4coxp; - Tox = 1.0e8 * model->BSIM4v4toxp; - T0 = (Vgs_eff - VbseffCV - pParam->BSIM4v4vfbzb) / Tox; - dT0_dVg = dVgs_eff_dVg / Tox; - dT0_dVb = -dVbseffCV_dVb / Tox; - break; - case BSIM4v30: case BSIM4v40: - V3 = here->BSIM4v4vfbzb - Vgs_eff + VbseffCV - DELTA_3; - if (here->BSIM4v4vfbzb <= 0.0) - T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * here->BSIM4v4vfbzb); - else - T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * here->BSIM4v4vfbzb); - - T1 = 0.5 * (1.0 + V3 / T0); - Vfbeff = here->BSIM4v4vfbzb - 0.5 * (V3 + T0); - dVfbeff_dVg = T1 * dVgs_eff_dVg; - dVfbeff_dVb = -T1 * dVbseffCV_dVb; - - Cox = model->BSIM4v4coxp; - Tox = 1.0e8 * model->BSIM4v4toxp; - T0 = (Vgs_eff - VbseffCV - here->BSIM4v4vfbzb) / Tox; - dT0_dVg = dVgs_eff_dVg / Tox; - dT0_dVb = -dVbseffCV_dVb / Tox; - break; - default: break; - } - - tmp = T0 * pParam->BSIM4v4acde; - if ((-EXP_THRESHOLD < tmp) && (tmp < EXP_THRESHOLD)) - { Tcen = pParam->BSIM4v4ldeb * exp(tmp); - dTcen_dVg = pParam->BSIM4v4acde * Tcen; - dTcen_dVb = dTcen_dVg * dT0_dVb; - dTcen_dVg *= dT0_dVg; - } - else if (tmp <= -EXP_THRESHOLD) - { Tcen = pParam->BSIM4v4ldeb * MIN_EXP; - dTcen_dVg = dTcen_dVb = 0.0; - } - else - { Tcen = pParam->BSIM4v4ldeb * MAX_EXP; - dTcen_dVg = dTcen_dVb = 0.0; - } - - LINK = 1.0e-3 * model->BSIM4v4toxp; - V3 = pParam->BSIM4v4ldeb - Tcen - LINK; - V4 = sqrt(V3 * V3 + 4.0 * LINK * pParam->BSIM4v4ldeb); - Tcen = pParam->BSIM4v4ldeb - 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 / model->BSIM4v4coxe; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Qac0 = CoxWLcen * (Vfbeff - pParam->BSIM4v4vfbzb); - break; - case BSIM4v30: case BSIM4v40: - Qac0 = CoxWLcen * (Vfbeff - here->BSIM4v4vfbzb); - break; - default: break; - } - QovCox = Qac0 / Coxeff; - dQac0_dVg = CoxWLcen * dVfbeff_dVg - + QovCox * dCoxeff_dVg; - dQac0_dVb = CoxWLcen * dVfbeff_dVb - + QovCox * dCoxeff_dVb; - - T0 = 0.5 * pParam->BSIM4v4k1ox; - T3 = Vgs_eff - Vfbeff - VbseffCV - Vgsteff; - if (pParam->BSIM4v4k1ox == 0.0) - { T1 = 0.0; - T2 = 0.0; - } - else if (T3 < 0.0) - { T1 = T0 + T3 / pParam->BSIM4v4k1ox; - T2 = CoxWLcen; - } - else - { T1 = sqrt(T0 * T0 + T3); - T2 = CoxWLcen * T0 / T1; - } - - Qsub0 = CoxWLcen * pParam->BSIM4v4k1ox * (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->BSIM4v4k1ox <= 0.0) - { Denomi = 0.25 * pParam->BSIM4v4moin * Vtm; - T0 = 0.5 * pParam->BSIM4v4sqrtPhi; - } - else - { Denomi = pParam->BSIM4v4moin * Vtm - * pParam->BSIM4v4k1ox * pParam->BSIM4v4k1ox; - T0 = pParam->BSIM4v4k1ox * pParam->BSIM4v4sqrtPhi; - } - T1 = 2.0 * T0 + Vgsteff; - - DeltaPhi = Vtm * log(1.0 + T1 * Vgsteff / Denomi); - dDeltaPhi_dVg = 2.0 * Vtm * (T1 -T0) / (Denomi + T1 * Vgsteff); - /* End of delta Phis */ - - Tox += Tox; /* WDLiu: Tcen reevaluated below due to different Vgsteff */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - T0 = (Vgsteff + pParam->BSIM4v4vtfbphi2) / Tox; - break; - case BSIM4v30: case BSIM4v40: - T0 = (Vgsteff + here->BSIM4v4vtfbphi2) / Tox; - break; - default: break; - } - tmp = exp(0.7 * log(T0)); - T1 = 1.0 + tmp; - T2 = 0.7 * tmp / (T0 * Tox); - Tcen = 1.9e-9 / T1; - dTcen_dVg = -Tcen * T2 / T1; - dTcen_dVd = dTcen_dVg * dVgsteff_dVd; - dTcen_dVb = dTcen_dVg * 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 / model->BSIM4v4coxe; - - AbulkCV = Abulk0 * pParam->BSIM4v4abulkCVfactor; - dAbulkCV_dVb = pParam->BSIM4v4abulkCVfactor * dAbulk0_dVb; - VdsatCV = (Vgsteff - DeltaPhi) / AbulkCV; - - T0 = VdsatCV - Vds - DELTA_4; - dT0_dVg = (1.0 - dDeltaPhi_dVg) / AbulkCV; - dT0_dVb = -VdsatCV * dAbulkCV_dVb / AbulkCV; - T1 = sqrt(T0 * T0 + 4.0 * DELTA_4 * VdsatCV); - dT1_dVg = (T0 + DELTA_4 + DELTA_4) / T1; - dT1_dVd = -T0 / T1; - dT1_dVb = dT1_dVg * dT0_dVb; - dT1_dVg *= dT0_dVg; - if (T0 >= 0.0) - { VdseffCV = VdsatCV - 0.5 * (T0 + T1); - dVdseffCV_dVg = 0.5 * (dT0_dVg - dT1_dVg); - dVdseffCV_dVd = 0.5 * (1.0 - dT1_dVd); - dVdseffCV_dVb = 0.5 * (dT0_dVb - dT1_dVb); - } - else - { T3 = (DELTA_4 + DELTA_4) / (T1 - T0); - T4 = 1.0 - T3; - T5 = VdsatCV * T3 / (T1 - T0); - VdseffCV = VdsatCV * T4; - dVdseffCV_dVg = dT0_dVg * T4 + T5 * (dT1_dVg - dT0_dVg); - dVdseffCV_dVd = T5 * (dT1_dVd + 1.0); - dVdseffCV_dVb = dT0_dVb * (1.0 - T5) + T5 * dT1_dVb; - } - - if (Vds == 0.0) - { VdseffCV = 0.0; - dVdseffCV_dVg = 0.0; - dVdseffCV_dVb = 0.0; - } - - 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 = 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->BSIM4v4xpart > 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->BSIM4v4xpart < 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->BSIM4v4cggb = Cgg; - here->BSIM4v4cgsb = -(Cgg + Cgd + Cgb); - here->BSIM4v4cgdb = Cgd; - here->BSIM4v4cdgb = -(Cgg + Cbg + Csg); - here->BSIM4v4cdsb = (Cgg + Cgd + Cgb + Cbg + Cbd + Cbb - + Csg + Csd + Csb); - here->BSIM4v4cddb = -(Cgd + Cbd + Csd); - here->BSIM4v4cbgb = Cbg; - here->BSIM4v4cbsb = -(Cbg + Cbd + Cbb); - here->BSIM4v4cbdb = Cbd; - } /* End of CTM */ - } - - here->BSIM4v4csgb = - here->BSIM4v4cggb - here->BSIM4v4cdgb - here->BSIM4v4cbgb; - here->BSIM4v4csdb = - here->BSIM4v4cgdb - here->BSIM4v4cddb - here->BSIM4v4cbdb; - here->BSIM4v4cssb = - here->BSIM4v4cgsb - here->BSIM4v4cdsb - here->BSIM4v4cbsb; - here->BSIM4v4cgbb = - here->BSIM4v4cgdb - here->BSIM4v4cggb - here->BSIM4v4cgsb; - here->BSIM4v4cdbb = - here->BSIM4v4cddb - here->BSIM4v4cdgb - here->BSIM4v4cdsb; - here->BSIM4v4cbbb = - here->BSIM4v4cbgb - here->BSIM4v4cbdb - here->BSIM4v4cbsb; - here->BSIM4v4csbb = - here->BSIM4v4cgbb - here->BSIM4v4cdbb - here->BSIM4v4cbbb; - here->BSIM4v4qgate = qgate; - here->BSIM4v4qbulk = qbulk; - here->BSIM4v4qdrn = qdrn; - here->BSIM4v4qsrc = -(qgate + qbulk + qdrn); - - /* NQS begins */ - if ((here->BSIM4v4trnqsMod) || (here->BSIM4v4acnqsMod)) - { here->BSIM4v4qchqs = qcheq = -(qbulk + qgate); - here->BSIM4v4cqgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb); - here->BSIM4v4cqdb = -(here->BSIM4v4cgdb + here->BSIM4v4cbdb); - here->BSIM4v4cqsb = -(here->BSIM4v4cgsb + here->BSIM4v4cbsb); - here->BSIM4v4cqbb = -(here->BSIM4v4cqgb + here->BSIM4v4cqdb - + here->BSIM4v4cqsb); - - CoxWL = model->BSIM4v4coxe * pParam->BSIM4v4weffCV * here->BSIM4v4nf - * pParam->BSIM4v4leffCV; - T1 = here->BSIM4v4gcrg / CoxWL; /* 1 / tau */ - here->BSIM4v4gtau = T1 * ScalingFactor; - - if (here->BSIM4v4acnqsMod) - here->BSIM4v4taunet = 1.0 / T1; - - *(ckt->CKTstate0 + here->BSIM4v4qcheq) = qcheq; - if (ckt->CKTmode & MODEINITTRAN) - *(ckt->CKTstate1 + here->BSIM4v4qcheq) = - *(ckt->CKTstate0 + here->BSIM4v4qcheq); - if (here->BSIM4v4trnqsMod) - { error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qcheq); - if (error) - return(error); - } - } - - -finished: - - /* Calculate junction C-V */ - if (ChargeComputationNeeded) - { czbd = model->BSIM4v4DunitAreaTempJctCap * here->BSIM4v4Adeff; /* bug fix */ - czbs = model->BSIM4v4SunitAreaTempJctCap * here->BSIM4v4Aseff; - czbdsw = model->BSIM4v4DunitLengthSidewallTempJctCap * here->BSIM4v4Pdeff; - czbdswg = model->BSIM4v4DunitLengthGateSidewallTempJctCap - * pParam->BSIM4v4weffCJ * here->BSIM4v4nf; - czbssw = model->BSIM4v4SunitLengthSidewallTempJctCap * here->BSIM4v4Pseff; - czbsswg = model->BSIM4v4SunitLengthGateSidewallTempJctCap - * pParam->BSIM4v4weffCJ * here->BSIM4v4nf; - - MJS = model->BSIM4v4SbulkJctBotGradingCoeff; - MJSWS = model->BSIM4v4SbulkJctSideGradingCoeff; - MJSWGS = model->BSIM4v4SbulkJctGateSideGradingCoeff; - - MJD = model->BSIM4v4DbulkJctBotGradingCoeff; - MJSWD = model->BSIM4v4DbulkJctSideGradingCoeff; - MJSWGD = model->BSIM4v4DbulkJctGateSideGradingCoeff; - - /* Source Bulk Junction */ - if (vbs_jct == 0.0) - { *(ckt->CKTstate0 + here->BSIM4v4qbs) = 0.0; - here->BSIM4v4capbs = czbs + czbssw + czbsswg; - } - else if (vbs_jct < 0.0) - { if (czbs > 0.0) - { arg = 1.0 - vbs_jct / model->BSIM4v4PhiBS; - if (MJS == 0.5) - sarg = 1.0 / sqrt(arg); - else - sarg = exp(-MJS * log(arg)); - *(ckt->CKTstate0 + here->BSIM4v4qbs) = model->BSIM4v4PhiBS * czbs - * (1.0 - arg * sarg) / (1.0 - MJS); - here->BSIM4v4capbs = czbs * sarg; - } - else - { *(ckt->CKTstate0 + here->BSIM4v4qbs) = 0.0; - here->BSIM4v4capbs = 0.0; - } - if (czbssw > 0.0) - { arg = 1.0 - vbs_jct / model->BSIM4v4PhiBSWS; - if (MJSWS == 0.5) - sarg = 1.0 / sqrt(arg); - else - sarg = exp(-MJSWS * log(arg)); - *(ckt->CKTstate0 + here->BSIM4v4qbs) += model->BSIM4v4PhiBSWS * czbssw - * (1.0 - arg * sarg) / (1.0 - MJSWS); - here->BSIM4v4capbs += czbssw * sarg; - } - if (czbsswg > 0.0) - { arg = 1.0 - vbs_jct / model->BSIM4v4PhiBSWGS; - if (MJSWGS == 0.5) - sarg = 1.0 / sqrt(arg); - else - sarg = exp(-MJSWGS * log(arg)); - *(ckt->CKTstate0 + here->BSIM4v4qbs) += model->BSIM4v4PhiBSWGS * czbsswg - * (1.0 - arg * sarg) / (1.0 - MJSWGS); - here->BSIM4v4capbs += czbsswg * sarg; - } - - } - else - { T0 = czbs + czbssw + czbsswg; - T1 = vbs_jct * (czbs * MJS / model->BSIM4v4PhiBS + czbssw * MJSWS - / model->BSIM4v4PhiBSWS + czbsswg * MJSWGS / model->BSIM4v4PhiBSWGS); - *(ckt->CKTstate0 + here->BSIM4v4qbs) = vbs_jct * (T0 + 0.5 * T1); - here->BSIM4v4capbs = T0 + T1; - } - - /* Drain Bulk Junction */ - if (vbd_jct == 0.0) - { *(ckt->CKTstate0 + here->BSIM4v4qbd) = 0.0; - here->BSIM4v4capbd = czbd + czbdsw + czbdswg; - } - else if (vbd_jct < 0.0) - { if (czbd > 0.0) - { arg = 1.0 - vbd_jct / model->BSIM4v4PhiBD; - if (MJD == 0.5) - sarg = 1.0 / sqrt(arg); - else - sarg = exp(-MJD * log(arg)); - *(ckt->CKTstate0 + here->BSIM4v4qbd) = model->BSIM4v4PhiBD* czbd - * (1.0 - arg * sarg) / (1.0 - MJD); - here->BSIM4v4capbd = czbd * sarg; - } - else - { *(ckt->CKTstate0 + here->BSIM4v4qbd) = 0.0; - here->BSIM4v4capbd = 0.0; - } - if (czbdsw > 0.0) - { arg = 1.0 - vbd_jct / model->BSIM4v4PhiBSWD; - if (MJSWD == 0.5) - sarg = 1.0 / sqrt(arg); - else - sarg = exp(-MJSWD * log(arg)); - *(ckt->CKTstate0 + here->BSIM4v4qbd) += model->BSIM4v4PhiBSWD * czbdsw - * (1.0 - arg * sarg) / (1.0 - MJSWD); - here->BSIM4v4capbd += czbdsw * sarg; - } - if (czbdswg > 0.0) - { arg = 1.0 - vbd_jct / model->BSIM4v4PhiBSWGD; - if (MJSWGD == 0.5) - sarg = 1.0 / sqrt(arg); - else - sarg = exp(-MJSWGD * log(arg)); - *(ckt->CKTstate0 + here->BSIM4v4qbd) += model->BSIM4v4PhiBSWGD * czbdswg - * (1.0 - arg * sarg) / (1.0 - MJSWGD); - here->BSIM4v4capbd += czbdswg * sarg; - } - } - else - { T0 = czbd + czbdsw + czbdswg; - T1 = vbd_jct * (czbd * MJD / model->BSIM4v4PhiBD + czbdsw * MJSWD - / model->BSIM4v4PhiBSWD + czbdswg * MJSWGD / model->BSIM4v4PhiBSWGD); - *(ckt->CKTstate0 + here->BSIM4v4qbd) = vbd_jct * (T0 + 0.5 * T1); - here->BSIM4v4capbd = T0 + T1; - } - } - - - /* - * check convergence - */ - - if ((here->BSIM4v4off == 0) || (!(ckt->CKTmode & MODEINITFIX))) - { if (Check == 1) - { ckt->CKTnoncon++; -#ifndef NEWCONV - } - else - { if (here->BSIM4v4mode >= 0) - { Idtot = here->BSIM4v4cd + here->BSIM4v4csub - + here->BSIM4v4Igidl - here->BSIM4v4cbd; - } - else - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Idtot = here->BSIM4v4cd + here->BSIM4v4cbd; - break; - case BSIM4v30: case BSIM4v40: - Idtot = here->BSIM4v4cd + here->BSIM4v4cbd - here->BSIM4v4Igidl; /* bugfix */ - break; - default: break; - } - } - tol0 = ckt->CKTreltol * MAX(fabs(cdhat), fabs(Idtot)) - + ckt->CKTabstol; - tol1 = ckt->CKTreltol * MAX(fabs(cseshat), fabs(Isestot)) - + ckt->CKTabstol; - tol2 = ckt->CKTreltol * MAX(fabs(cdedhat), fabs(Idedtot)) - + ckt->CKTabstol; - tol3 = ckt->CKTreltol * MAX(fabs(cgshat), fabs(Igstot)) - + ckt->CKTabstol; - tol4 = ckt->CKTreltol * MAX(fabs(cgdhat), fabs(Igdtot)) - + ckt->CKTabstol; - tol5 = ckt->CKTreltol * MAX(fabs(cgbhat), fabs(Igbtot)) - + ckt->CKTabstol; - if ((fabs(cdhat - Idtot) >= tol0) || (fabs(cseshat - Isestot) >= tol1) - || (fabs(cdedhat - Idedtot) >= tol2)) - { ckt->CKTnoncon++; - } - else if ((fabs(cgshat - Igstot) >= tol3) || (fabs(cgdhat - Igdtot) >= tol4) - || (fabs(cgbhat - Igbtot) >= tol5)) - { ckt->CKTnoncon++; - } - else - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - Ibtot = here->BSIM4v4cbs + here->BSIM4v4cbd - - here->BSIM4v4Igidl - here->BSIM4v4csub; - break; - case BSIM4v30: case BSIM4v40: - Ibtot = here->BSIM4v4cbs + here->BSIM4v4cbd - - here->BSIM4v4Igidl - here->BSIM4v4Igisl - here->BSIM4v4csub; - break; - default: break; - } - tol6 = ckt->CKTreltol * MAX(fabs(cbhat), fabs(Ibtot)) - + ckt->CKTabstol; - if (fabs(cbhat - Ibtot) > tol6) - { ckt->CKTnoncon++; - } - } -#endif /* NEWCONV */ - } - } - *(ckt->CKTstate0 + here->BSIM4v4vds) = vds; - *(ckt->CKTstate0 + here->BSIM4v4vgs) = vgs; - *(ckt->CKTstate0 + here->BSIM4v4vbs) = vbs; - *(ckt->CKTstate0 + here->BSIM4v4vbd) = vbd; - *(ckt->CKTstate0 + here->BSIM4v4vges) = vges; - *(ckt->CKTstate0 + here->BSIM4v4vgms) = vgms; - *(ckt->CKTstate0 + here->BSIM4v4vdbs) = vdbs; - *(ckt->CKTstate0 + here->BSIM4v4vdbd) = vdbd; - *(ckt->CKTstate0 + here->BSIM4v4vsbs) = vsbs; - *(ckt->CKTstate0 + here->BSIM4v4vses) = vses; - *(ckt->CKTstate0 + here->BSIM4v4vdes) = vdes; - *(ckt->CKTstate0 + here->BSIM4v4qdef) = qdef; - - - if (!ChargeComputationNeeded) - goto line850; - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (model->BSIM4v4capMod == 0) /* code merge -JX */ - { - cgdo = pParam->BSIM4v4cgdo; - qgdo = pParam->BSIM4v4cgdo * vgd; - cgso = pParam->BSIM4v4cgso; - qgso = pParam->BSIM4v4cgso * vgs; - } - else /* For both capMod == 1 and 2 */ - { T0 = vgd + DELTA_1; - T1 = sqrt(T0 * T0 + 4.0 * DELTA_1); - T2 = 0.5 * (T0 - T1); - - T3 = pParam->BSIM4v4weffCV * pParam->BSIM4v4cgdl; - T4 = sqrt(1.0 - 4.0 * T2 / pParam->BSIM4v4ckappad); - cgdo = pParam->BSIM4v4cgdo + T3 - T3 * (1.0 - 1.0 / T4) - * (0.5 - 0.5 * T0 / T1); - qgdo = (pParam->BSIM4v4cgdo + T3) * vgd - T3 * (T2 - + 0.5 * pParam->BSIM4v4ckappad * (T4 - 1.0)); - - T0 = vgs + DELTA_1; - T1 = sqrt(T0 * T0 + 4.0 * DELTA_1); - T2 = 0.5 * (T0 - T1); - T3 = pParam->BSIM4v4weffCV * pParam->BSIM4v4cgsl; - T4 = sqrt(1.0 - 4.0 * T2 / pParam->BSIM4v4ckappas); - cgso = pParam->BSIM4v4cgso + T3 - T3 * (1.0 - 1.0 / T4) - * (0.5 - 0.5 * T0 / T1); - qgso = (pParam->BSIM4v4cgso + T3) * vgs - T3 * (T2 - + 0.5 * pParam->BSIM4v4ckappas * (T4 - 1.0)); - } - break; - case BSIM4v40: - if (here->BSIM4v4rgateMod == 3) - { - vgdx = vgmd; - vgsx = vgms; - } - else /* For rgateMod == 0, 1 and 2 */ - { - vgdx = vgd; - vgsx = vgs; - } - if (model->BSIM4v4capMod == 0) - { - cgdo = pParam->BSIM4v4cgdo; - qgdo = pParam->BSIM4v4cgdo * vgdx; - cgso = pParam->BSIM4v4cgso; - qgso = pParam->BSIM4v4cgso * vgsx; - } - else /* For both capMod == 1 and 2 */ - { T0 = vgdx + DELTA_1; - T1 = sqrt(T0 * T0 + 4.0 * DELTA_1); - T2 = 0.5 * (T0 - T1); - - - T3 = pParam->BSIM4v4weffCV * pParam->BSIM4v4cgdl; - T4 = sqrt(1.0 - 4.0 * T2 / pParam->BSIM4v4ckappad); - cgdo = pParam->BSIM4v4cgdo + T3 - T3 * (1.0 - 1.0 / T4) - * (0.5 - 0.5 * T0 / T1); - qgdo = (pParam->BSIM4v4cgdo + T3) * vgdx - T3 * (T2 - + 0.5 * pParam->BSIM4v4ckappad * (T4 - 1.0)); - - - T0 = vgsx + DELTA_1; - T1 = sqrt(T0 * T0 + 4.0 * DELTA_1); - T2 = 0.5 * (T0 - T1); - T3 = pParam->BSIM4v4weffCV * pParam->BSIM4v4cgsl; - T4 = sqrt(1.0 - 4.0 * T2 / pParam->BSIM4v4ckappas); - cgso = pParam->BSIM4v4cgso + T3 - T3 * (1.0 - 1.0 / T4) - * (0.5 - 0.5 * T0 / T1); - qgso = (pParam->BSIM4v4cgso + T3) * vgsx - T3 * (T2 - + 0.5 * pParam->BSIM4v4ckappas * (T4 - 1.0)); - } - break; - default: break; - } - - if (here->BSIM4v4nf != 1.0) - { cgdo *= here->BSIM4v4nf; - cgso *= here->BSIM4v4nf; - qgdo *= here->BSIM4v4nf; - qgso *= here->BSIM4v4nf; - } - here->BSIM4v4cgdo = cgdo; - here->BSIM4v4qgdo = qgdo; - here->BSIM4v4cgso = cgso; - here->BSIM4v4qgso = qgso; - -#ifndef NOBYPASS -line755: -#endif - ag0 = ckt->CKTag[0]; - if (here->BSIM4v4mode > 0) - { if (here->BSIM4v4trnqsMod == 0) - { qdrn -= qgdo; - if (here->BSIM4v4rgateMod == 3) - { gcgmgmb = (cgdo + cgso + pParam->BSIM4v4cgbo) * ag0; - gcgmdb = -cgdo * ag0; - gcgmsb = -cgso * ag0; - gcgmbb = -pParam->BSIM4v4cgbo * ag0; - - gcdgmb = gcgmdb; - gcsgmb = gcgmsb; - gcbgmb = gcgmbb; - - gcggb = here->BSIM4v4cggb * ag0; - gcgdb = here->BSIM4v4cgdb * ag0; - gcgsb = here->BSIM4v4cgsb * ag0; - gcgbb = -(gcggb + gcgdb + gcgsb); - - gcdgb = here->BSIM4v4cdgb * ag0; - gcsgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb) * ag0; - gcbgb = here->BSIM4v4cbgb * ag0; - - qgmb = pParam->BSIM4v4cgbo * vgmb; - qgmid = qgdo + qgso + qgmb; - qbulk -= qgmb; - qsrc = -(qgate + qgmid + qbulk + qdrn); - } - else - { gcggb = (here->BSIM4v4cggb + cgdo + cgso - + pParam->BSIM4v4cgbo ) * ag0; - gcgdb = (here->BSIM4v4cgdb - cgdo) * ag0; - gcgsb = (here->BSIM4v4cgsb - cgso) * ag0; - gcgbb = -(gcggb + gcgdb + gcgsb); - - gcdgb = (here->BSIM4v4cdgb - cgdo) * ag0; - gcsgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb + cgso) * ag0; - gcbgb = (here->BSIM4v4cbgb - pParam->BSIM4v4cgbo) * ag0; - - gcdgmb = gcsgmb = gcbgmb = 0.0; - - qgb = pParam->BSIM4v4cgbo * vgb; - qgate += qgdo + qgso + qgb; - qbulk -= qgb; - qsrc = -(qgate + qbulk + qdrn); - } - gcddb = (here->BSIM4v4cddb + here->BSIM4v4capbd + cgdo) * ag0; - gcdsb = here->BSIM4v4cdsb * ag0; - - gcsdb = -(here->BSIM4v4cgdb + here->BSIM4v4cbdb - + here->BSIM4v4cddb) * ag0; - gcssb = (here->BSIM4v4capbs + cgso - (here->BSIM4v4cgsb - + here->BSIM4v4cbsb + here->BSIM4v4cdsb)) * ag0; - - if (!here->BSIM4v4rbodyMod) - { gcdbb = -(gcdgb + gcddb + gcdsb + gcdgmb); - gcsbb = -(gcsgb + gcsdb + gcssb + gcsgmb); - gcbdb = (here->BSIM4v4cbdb - here->BSIM4v4capbd) * ag0; - gcbsb = (here->BSIM4v4cbsb - here->BSIM4v4capbs) * ag0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - gcdbdb = 0.0; - break; - case BSIM4v40: - gcdbdb = 0.0; gcsbsb = 0.0; - break; - default: break; - } - } - else - { gcdbb = -(here->BSIM4v4cddb + here->BSIM4v4cdgb - + here->BSIM4v4cdsb) * ag0; - gcsbb = -(gcsgb + gcsdb + gcssb + gcsgmb) - + here->BSIM4v4capbs * ag0; - gcbdb = here->BSIM4v4cbdb * ag0; - gcbsb = here->BSIM4v4cbsb * ag0; - - gcdbdb = -here->BSIM4v4capbd * ag0; - gcsbsb = -here->BSIM4v4capbs * ag0; - } - gcbbb = -(gcbdb + gcbgb + gcbsb + gcbgmb); - - 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 - { qcheq = here->BSIM4v4qchqs; - CoxWL = model->BSIM4v4coxe * pParam->BSIM4v4weffCV * here->BSIM4v4nf - * pParam->BSIM4v4leffCV; - T0 = qdef * ScalingFactor / CoxWL; - - ggtg = here->BSIM4v4gtg = T0 * here->BSIM4v4gcrgg; - ggtd = here->BSIM4v4gtd = T0 * here->BSIM4v4gcrgd; - ggts = here->BSIM4v4gts = T0 * here->BSIM4v4gcrgs; - ggtb = here->BSIM4v4gtb = T0 * here->BSIM4v4gcrgb; - gqdef = ScalingFactor * ag0; - - gcqgb = here->BSIM4v4cqgb * ag0; - gcqdb = here->BSIM4v4cqdb * ag0; - gcqsb = here->BSIM4v4cqsb * ag0; - gcqbb = here->BSIM4v4cqbb * ag0; - - if (fabs(qcheq) <= 1.0e-5 * CoxWL) - { if (model->BSIM4v4xpart < 0.5) - { dxpart = 0.4; - } - else if (model->BSIM4v4xpart > 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->BSIM4v4cddb; - Csd = -(here->BSIM4v4cgdb + here->BSIM4v4cddb - + here->BSIM4v4cbdb); - ddxpart_dVd = (Cdd - dxpart * (Cdd + Csd)) / qcheq; - Cdg = here->BSIM4v4cdgb; - Csg = -(here->BSIM4v4cggb + here->BSIM4v4cdgb - + here->BSIM4v4cbgb); - ddxpart_dVg = (Cdg - dxpart * (Cdg + Csg)) / qcheq; - - Cds = here->BSIM4v4cdsb; - Css = -(here->BSIM4v4cgsb + here->BSIM4v4cdsb - + here->BSIM4v4cbsb); - 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); - - if (here->BSIM4v4rgateMod == 3) - { gcgmgmb = (cgdo + cgso + pParam->BSIM4v4cgbo) * ag0; - gcgmdb = -cgdo * ag0; - gcgmsb = -cgso * ag0; - gcgmbb = -pParam->BSIM4v4cgbo * ag0; - - gcdgmb = gcgmdb; - gcsgmb = gcgmsb; - gcbgmb = gcgmbb; - - gcdgb = gcsgb = gcbgb = 0.0; - gcggb = gcgdb = gcgsb = gcgbb = 0.0; - - qgmb = pParam->BSIM4v4cgbo * vgmb; - qgmid = qgdo + qgso + qgmb; - qgate = 0.0; - qbulk = -qgmb; - qdrn = -qgdo; - qsrc = -(qgmid + qbulk + qdrn); - } - else - { gcggb = (cgdo + cgso + pParam->BSIM4v4cgbo ) * ag0; - gcgdb = -cgdo * ag0; - gcgsb = -cgso * ag0; - gcgbb = -pParam->BSIM4v4cgbo * ag0; - - gcdgb = gcgdb; - gcsgb = gcgsb; - gcbgb = gcgbb; - gcdgmb = gcsgmb = gcbgmb = 0.0; - - qgb = pParam->BSIM4v4cgbo * vgb; - qgate = qgdo + qgso + qgb; - qbulk = -qgb; - qdrn = -qgdo; - qsrc = -(qgate + qbulk + qdrn); - } - - gcddb = (here->BSIM4v4capbd + cgdo) * ag0; - gcdsb = gcsdb = 0.0; - gcssb = (here->BSIM4v4capbs + cgso) * ag0; - - if (!here->BSIM4v4rbodyMod) - { gcdbb = -(gcdgb + gcddb + gcdgmb); - gcsbb = -(gcsgb + gcssb + gcsgmb); - gcbdb = -here->BSIM4v4capbd * ag0; - gcbsb = -here->BSIM4v4capbs * ag0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - gcdbdb = 0.0; - break; - case BSIM4v40: - gcdbdb = 0.0; gcsbsb = 0.0; - break; - default: break; - } - } - else - { gcdbb = gcsbb = gcbdb = gcbsb = 0.0; - gcdbdb = -here->BSIM4v4capbd * ag0; - gcsbsb = -here->BSIM4v4capbs * ag0; - } - gcbbb = -(gcbdb + gcbgb + gcbsb + gcbgmb); - } - } - else - { if (here->BSIM4v4trnqsMod == 0) - { qsrc = qdrn - qgso; - if (here->BSIM4v4rgateMod == 3) - { gcgmgmb = (cgdo + cgso + pParam->BSIM4v4cgbo) * ag0; - gcgmdb = -cgdo * ag0; - gcgmsb = -cgso * ag0; - gcgmbb = -pParam->BSIM4v4cgbo * ag0; - - gcdgmb = gcgmdb; - gcsgmb = gcgmsb; - gcbgmb = gcgmbb; - - gcggb = here->BSIM4v4cggb * ag0; - gcgdb = here->BSIM4v4cgsb * ag0; - gcgsb = here->BSIM4v4cgdb * ag0; - gcgbb = -(gcggb + gcgdb + gcgsb); - - gcdgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb) * ag0; - gcsgb = here->BSIM4v4cdgb * ag0; - gcbgb = here->BSIM4v4cbgb * ag0; - - qgmb = pParam->BSIM4v4cgbo * vgmb; - qgmid = qgdo + qgso + qgmb; - qbulk -= qgmb; - qdrn = -(qgate + qgmid + qbulk + qsrc); - } - else - { gcggb = (here->BSIM4v4cggb + cgdo + cgso - + pParam->BSIM4v4cgbo ) * ag0; - gcgdb = (here->BSIM4v4cgsb - cgdo) * ag0; - gcgsb = (here->BSIM4v4cgdb - cgso) * ag0; - gcgbb = -(gcggb + gcgdb + gcgsb); - - gcdgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb + cgdo) * ag0; - gcsgb = (here->BSIM4v4cdgb - cgso) * ag0; - gcbgb = (here->BSIM4v4cbgb - pParam->BSIM4v4cgbo) * ag0; - - gcdgmb = gcsgmb = gcbgmb = 0.0; - - qgb = pParam->BSIM4v4cgbo * vgb; - qgate += qgdo + qgso + qgb; - qbulk -= qgb; - qdrn = -(qgate + qbulk + qsrc); - } - gcddb = (here->BSIM4v4capbd + cgdo - (here->BSIM4v4cgsb - + here->BSIM4v4cbsb + here->BSIM4v4cdsb)) * ag0; - gcdsb = -(here->BSIM4v4cgdb + here->BSIM4v4cbdb - + here->BSIM4v4cddb) * ag0; - - gcsdb = here->BSIM4v4cdsb * ag0; - gcssb = (here->BSIM4v4cddb + here->BSIM4v4capbs + cgso) * ag0; - - if (!here->BSIM4v4rbodyMod) - { gcdbb = -(gcdgb + gcddb + gcdsb + gcdgmb); - gcsbb = -(gcsgb + gcsdb + gcssb + gcsgmb); - gcbdb = (here->BSIM4v4cbsb - here->BSIM4v4capbd) * ag0; - gcbsb = (here->BSIM4v4cbdb - here->BSIM4v4capbs) * ag0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - gcdbdb = 0.0; - break; - case BSIM4v40: - gcdbdb = 0.0; gcsbsb = 0.0; - break; - default: break; - } - } - else - { gcdbb = -(gcdgb + gcddb + gcdsb + gcdgmb) - + here->BSIM4v4capbd * ag0; - gcsbb = -(here->BSIM4v4cddb + here->BSIM4v4cdgb - + here->BSIM4v4cdsb) * ag0; - gcbdb = here->BSIM4v4cbsb * ag0; - gcbsb = here->BSIM4v4cbdb * ag0; - gcdbdb = -here->BSIM4v4capbd * ag0; - gcsbsb = -here->BSIM4v4capbs * ag0; - } - gcbbb = -(gcbgb + gcbdb + gcbsb + gcbgmb); - - 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 - { qcheq = here->BSIM4v4qchqs; - CoxWL = model->BSIM4v4coxe * pParam->BSIM4v4weffCV * here->BSIM4v4nf - * pParam->BSIM4v4leffCV; - T0 = qdef * ScalingFactor / CoxWL; - ggtg = here->BSIM4v4gtg = T0 * here->BSIM4v4gcrgg; - ggts = here->BSIM4v4gtd = T0 * here->BSIM4v4gcrgs; - ggtd = here->BSIM4v4gts = T0 * here->BSIM4v4gcrgd; - ggtb = here->BSIM4v4gtb = T0 * here->BSIM4v4gcrgb; - gqdef = ScalingFactor * ag0; - - gcqgb = here->BSIM4v4cqgb * ag0; - gcqdb = here->BSIM4v4cqsb * ag0; - gcqsb = here->BSIM4v4cqdb * ag0; - gcqbb = here->BSIM4v4cqbb * ag0; - - if (fabs(qcheq) <= 1.0e-5 * CoxWL) - { if (model->BSIM4v4xpart < 0.5) - { sxpart = 0.4; - } - else if (model->BSIM4v4xpart > 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->BSIM4v4cddb; - Cds = -(here->BSIM4v4cgdb + here->BSIM4v4cddb - + here->BSIM4v4cbdb); - dsxpart_dVs = (Css - sxpart * (Css + Cds)) / qcheq; - Csg = here->BSIM4v4cdgb; - Cdg = -(here->BSIM4v4cggb + here->BSIM4v4cdgb - + here->BSIM4v4cbgb); - dsxpart_dVg = (Csg - sxpart * (Csg + Cdg)) / qcheq; - - Csd = here->BSIM4v4cdsb; - Cdd = -(here->BSIM4v4cgsb + here->BSIM4v4cdsb - + here->BSIM4v4cbsb); - 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); - - if (here->BSIM4v4rgateMod == 3) - { gcgmgmb = (cgdo + cgso + pParam->BSIM4v4cgbo) * ag0; - gcgmdb = -cgdo * ag0; - gcgmsb = -cgso * ag0; - gcgmbb = -pParam->BSIM4v4cgbo * ag0; - - gcdgmb = gcgmdb; - gcsgmb = gcgmsb; - gcbgmb = gcgmbb; - - gcdgb = gcsgb = gcbgb = 0.0; - gcggb = gcgdb = gcgsb = gcgbb = 0.0; - - qgmb = pParam->BSIM4v4cgbo * vgmb; - qgmid = qgdo + qgso + qgmb; - qgate = 0.0; - qbulk = -qgmb; - qdrn = -qgdo; - qsrc = -qgso; - } - else - { gcggb = (cgdo + cgso + pParam->BSIM4v4cgbo ) * ag0; - gcgdb = -cgdo * ag0; - gcgsb = -cgso * ag0; - gcgbb = -pParam->BSIM4v4cgbo * ag0; - - gcdgb = gcgdb; - gcsgb = gcgsb; - gcbgb = gcgbb; - gcdgmb = gcsgmb = gcbgmb = 0.0; - - qgb = pParam->BSIM4v4cgbo * vgb; - qgate = qgdo + qgso + qgb; - qbulk = -qgb; - qdrn = -qgdo; - qsrc = -qgso; - } - - gcddb = (here->BSIM4v4capbd + cgdo) * ag0; - gcdsb = gcsdb = 0.0; - gcssb = (here->BSIM4v4capbs + cgso) * ag0; - if (!here->BSIM4v4rbodyMod) - { gcdbb = -(gcdgb + gcddb + gcdgmb); - gcsbb = -(gcsgb + gcssb + gcsgmb); - gcbdb = -here->BSIM4v4capbd * ag0; - gcbsb = -here->BSIM4v4capbs * ag0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - gcdbdb = 0.0; - break; - case BSIM4v40: - gcdbdb = 0.0; gcsbsb = 0.0; - break; - default: break; - } - } - else - { gcdbb = gcsbb = gcbdb = gcbsb = 0.0; - gcdbdb = -here->BSIM4v4capbd * ag0; - gcsbsb = -here->BSIM4v4capbs * ag0; - } - gcbbb = -(gcbdb + gcbgb + gcbsb + gcbgmb); - } - } - - - if (here->BSIM4v4trnqsMod) - { *(ckt->CKTstate0 + here->BSIM4v4qcdump) = qdef * ScalingFactor; - if (ckt->CKTmode & MODEINITTRAN) - *(ckt->CKTstate1 + here->BSIM4v4qcdump) = - *(ckt->CKTstate0 + here->BSIM4v4qcdump); - error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qcdump); - if (error) - return(error); - } - - if (ByPass) goto line860; - - *(ckt->CKTstate0 + here->BSIM4v4qg) = qgate; - *(ckt->CKTstate0 + here->BSIM4v4qd) = qdrn - - *(ckt->CKTstate0 + here->BSIM4v4qbd); - *(ckt->CKTstate0 + here->BSIM4v4qs) = qsrc - - *(ckt->CKTstate0 + here->BSIM4v4qbs); - if (here->BSIM4v4rgateMod == 3) - *(ckt->CKTstate0 + here->BSIM4v4qgmid) = qgmid; - - if (!here->BSIM4v4rbodyMod) - { *(ckt->CKTstate0 + here->BSIM4v4qb) = qbulk - + *(ckt->CKTstate0 + here->BSIM4v4qbd) - + *(ckt->CKTstate0 + here->BSIM4v4qbs); - } - else - *(ckt->CKTstate0 + here->BSIM4v4qb) = qbulk; - - - /* Store small signal parameters */ - if (ckt->CKTmode & MODEINITSMSIG) - { goto line1000; - } - - if (!ChargeComputationNeeded) - goto line850; - - if (ckt->CKTmode & MODEINITTRAN) - { *(ckt->CKTstate1 + here->BSIM4v4qb) = - *(ckt->CKTstate0 + here->BSIM4v4qb); - *(ckt->CKTstate1 + here->BSIM4v4qg) = - *(ckt->CKTstate0 + here->BSIM4v4qg); - *(ckt->CKTstate1 + here->BSIM4v4qd) = - *(ckt->CKTstate0 + here->BSIM4v4qd); - if (here->BSIM4v4rgateMod == 3) - *(ckt->CKTstate1 + here->BSIM4v4qgmid) = - *(ckt->CKTstate0 + here->BSIM4v4qgmid); - if (here->BSIM4v4rbodyMod) - { *(ckt->CKTstate1 + here->BSIM4v4qbs) = - *(ckt->CKTstate0 + here->BSIM4v4qbs); - *(ckt->CKTstate1 + here->BSIM4v4qbd) = - *(ckt->CKTstate0 + here->BSIM4v4qbd); - } - } - - error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qb); - if (error) - return(error); - error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qg); - if (error) - return(error); - error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qd); - if (error) - return(error); - - if (here->BSIM4v4rgateMod == 3) - { error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qgmid); - if (error) return(error); - } - - if (here->BSIM4v4rbodyMod) - { error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qbs); - if (error) - return(error); - error = NIintegrate(ckt, &geq, &ceq, 0.0, here->BSIM4v4qbd); - if (error) - return(error); - } - - goto line860; - - -line850: - /* Zero gcap and ceqcap if (!ChargeComputationNeeded) */ - ceqqg = ceqqb = ceqqd = 0.0; - ceqqjd = ceqqjs = 0.0; - cqcheq = cqdef = 0.0; - - gcdgb = gcddb = gcdsb = gcdbb = 0.0; - gcsgb = gcsdb = gcssb = gcsbb = 0.0; - gcggb = gcgdb = gcgsb = gcgbb = 0.0; - gcbdb = gcbgb = gcbsb = gcbbb = 0.0; - - gcgmgmb = gcgmdb = gcgmsb = gcgmbb = 0.0; - gcdgmb = gcsgmb = gcbgmb = ceqqgmid = 0.0; - gcdbdb = gcsbsb = 0.0; - - gqdef = gcqgb = gcqdb = gcqsb = gcqbb = 0.0; - ggtg = ggtd = ggtb = ggts = 0.0; - sxpart = (1.0 - (dxpart = (here->BSIM4v4mode > 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->BSIM4v4trnqsMod) - { CoxWL = model->BSIM4v4coxe * pParam->BSIM4v4weffCV * here->BSIM4v4nf - * pParam->BSIM4v4leffCV; - T1 = here->BSIM4v4gcrg / CoxWL; - here->BSIM4v4gtau = T1 * ScalingFactor; - } - else - here->BSIM4v4gtau = 0.0; - - goto line900; - - -line860: - /* Calculate equivalent charge current */ - - cqgate = *(ckt->CKTstate0 + here->BSIM4v4cqg); - cqbody = *(ckt->CKTstate0 + here->BSIM4v4cqb); - cqdrn = *(ckt->CKTstate0 + here->BSIM4v4cqd); - - ceqqg = cqgate - gcggb * vgb + gcgdb * vbd + gcgsb * vbs; - ceqqd = cqdrn - gcdgb * vgb - gcdgmb * vgmb + (gcddb + gcdbdb) - * vbd - gcdbdb * vbd_jct + gcdsb * vbs; - ceqqb = cqbody - gcbgb * vgb - gcbgmb * vgmb - + gcbdb * vbd + gcbsb * vbs; - - - if (here->BSIM4v4rgateMod == 3) - ceqqgmid = *(ckt->CKTstate0 + here->BSIM4v4cqgmid) - + gcgmdb * vbd + gcgmsb * vbs - gcgmgmb * vgmb; - else - ceqqgmid = 0.0; - - if (here->BSIM4v4rbodyMod) - { ceqqjs = *(ckt->CKTstate0 + here->BSIM4v4cqbs) + gcsbsb * vbs_jct; - ceqqjd = *(ckt->CKTstate0 + here->BSIM4v4cqbd) + gcdbdb * vbd_jct; - } - - if (here->BSIM4v4trnqsMod) - { T0 = ggtg * vgb - ggtd * vbd - ggts * vbs; - ceqqg += T0; - T1 = qdef * here->BSIM4v4gtau; - ceqqd -= dxpart * T0 + T1 * (ddxpart_dVg * vgb - ddxpart_dVd - * vbd - ddxpart_dVs * vbs); - cqdef = *(ckt->CKTstate0 + here->BSIM4v4cqcdump) - gqdef * qdef; - cqcheq = *(ckt->CKTstate0 + here->BSIM4v4cqcheq) - - (gcqgb * vgb - gcqdb * vbd - gcqsb * vbs) + T0; - } - - if (ckt->CKTmode & MODEINITTRAN) - { *(ckt->CKTstate1 + here->BSIM4v4cqb) = - *(ckt->CKTstate0 + here->BSIM4v4cqb); - *(ckt->CKTstate1 + here->BSIM4v4cqg) = - *(ckt->CKTstate0 + here->BSIM4v4cqg); - *(ckt->CKTstate1 + here->BSIM4v4cqd) = - *(ckt->CKTstate0 + here->BSIM4v4cqd); - - if (here->BSIM4v4rgateMod == 3) - *(ckt->CKTstate1 + here->BSIM4v4cqgmid) = - *(ckt->CKTstate0 + here->BSIM4v4cqgmid); - - if (here->BSIM4v4rbodyMod) - { *(ckt->CKTstate1 + here->BSIM4v4cqbs) = - *(ckt->CKTstate0 + here->BSIM4v4cqbs); - *(ckt->CKTstate1 + here->BSIM4v4cqbd) = - *(ckt->CKTstate0 + here->BSIM4v4cqbd); - } - } - - - /* - * Load current vector - */ - -line900: - if (here->BSIM4v4mode >= 0) - { Gm = here->BSIM4v4gm; - Gmbs = here->BSIM4v4gmbs; - FwdSum = Gm + Gmbs; - RevSum = 0.0; - - ceqdrn = model->BSIM4v4type * (cdrain - here->BSIM4v4gds * vds - - Gm * vgs - Gmbs * vbs); - ceqbd = model->BSIM4v4type * (here->BSIM4v4csub + here->BSIM4v4Igidl - - (here->BSIM4v4gbds + here->BSIM4v4ggidld) * vds - - (here->BSIM4v4gbgs + here->BSIM4v4ggidlg) * vgs - - (here->BSIM4v4gbbs + here->BSIM4v4ggidlb) * vbs); - ceqbs = model->BSIM4v4type * (here->BSIM4v4Igisl + here->BSIM4v4ggisls * vds - - here->BSIM4v4ggislg * vgd - here->BSIM4v4ggislb * vbd); - - gbbdp = -(here->BSIM4v4gbds); - gbbsp = here->BSIM4v4gbds + here->BSIM4v4gbgs + here->BSIM4v4gbbs; - - gbdpg = here->BSIM4v4gbgs; - gbdpdp = here->BSIM4v4gbds; - gbdpb = here->BSIM4v4gbbs; - gbdpsp = -(gbdpg + gbdpdp + gbdpb); - - gbspg = 0.0; - gbspdp = 0.0; - gbspb = 0.0; - gbspsp = 0.0; - - if (model->BSIM4v4igcMod) - { gIstotg = here->BSIM4v4gIgsg + here->BSIM4v4gIgcsg; - gIstotd = here->BSIM4v4gIgcsd; - gIstots = here->BSIM4v4gIgss + here->BSIM4v4gIgcss; - gIstotb = here->BSIM4v4gIgcsb; - Istoteq = model->BSIM4v4type * (here->BSIM4v4Igs + here->BSIM4v4Igcs - - gIstotg * vgs - here->BSIM4v4gIgcsd * vds - - here->BSIM4v4gIgcsb * vbs); - - gIdtotg = here->BSIM4v4gIgdg + here->BSIM4v4gIgcdg; - gIdtotd = here->BSIM4v4gIgdd + here->BSIM4v4gIgcdd; - gIdtots = here->BSIM4v4gIgcds; - gIdtotb = here->BSIM4v4gIgcdb; - Idtoteq = model->BSIM4v4type * (here->BSIM4v4Igd + here->BSIM4v4Igcd - - here->BSIM4v4gIgdg * vgd - here->BSIM4v4gIgcdg * vgs - - here->BSIM4v4gIgcdd * vds - here->BSIM4v4gIgcdb * vbs); - } - else - { gIstotg = gIstotd = gIstots = gIstotb = Istoteq = 0.0; - gIdtotg = gIdtotd = gIdtots = gIdtotb = Idtoteq = 0.0; - } - - if (model->BSIM4v4igbMod) - { gIbtotg = here->BSIM4v4gIgbg; - gIbtotd = here->BSIM4v4gIgbd; - gIbtots = here->BSIM4v4gIgbs; - gIbtotb = here->BSIM4v4gIgbb; - Ibtoteq = model->BSIM4v4type * (here->BSIM4v4Igb - - here->BSIM4v4gIgbg * vgs - here->BSIM4v4gIgbd * vds - - here->BSIM4v4gIgbb * vbs); - } - else - gIbtotg = gIbtotd = gIbtots = gIbtotb = Ibtoteq = 0.0; - - if ((model->BSIM4v4igcMod != 0) || (model->BSIM4v4igbMod != 0)) - { gIgtotg = gIstotg + gIdtotg + gIbtotg; - gIgtotd = gIstotd + gIdtotd + gIbtotd ; - gIgtots = gIstots + gIdtots + gIbtots; - gIgtotb = gIstotb + gIdtotb + gIbtotb; - Igtoteq = Istoteq + Idtoteq + Ibtoteq; - } - else - gIgtotg = gIgtotd = gIgtots = gIgtotb = Igtoteq = 0.0; - - - if (here->BSIM4v4rgateMod == 2) - T0 = vges - vgs; - else if (here->BSIM4v4rgateMod == 3) - T0 = vgms - vgs; - if (here->BSIM4v4rgateMod > 1) - { gcrgd = here->BSIM4v4gcrgd * T0; - gcrgg = here->BSIM4v4gcrgg * T0; - gcrgs = here->BSIM4v4gcrgs * T0; - gcrgb = here->BSIM4v4gcrgb * T0; - ceqgcrg = -(gcrgd * vds + gcrgg * vgs - + gcrgb * vbs); - gcrgg -= here->BSIM4v4gcrg; - gcrg = here->BSIM4v4gcrg; - } - else - ceqgcrg = gcrg = gcrgd = gcrgg = gcrgs = gcrgb = 0.0; - } - else - { Gm = -here->BSIM4v4gm; - Gmbs = -here->BSIM4v4gmbs; - FwdSum = 0.0; - RevSum = -(Gm + Gmbs); - - ceqdrn = -model->BSIM4v4type * (cdrain + here->BSIM4v4gds * vds - + Gm * vgd + Gmbs * vbd); - - ceqbs = model->BSIM4v4type * (here->BSIM4v4csub + here->BSIM4v4Igisl - + (here->BSIM4v4gbds + here->BSIM4v4ggisls) * vds - - (here->BSIM4v4gbgs + here->BSIM4v4ggislg) * vgd - - (here->BSIM4v4gbbs + here->BSIM4v4ggislb) * vbd); - ceqbd = model->BSIM4v4type * (here->BSIM4v4Igidl - here->BSIM4v4ggidld * vds - - here->BSIM4v4ggidlg * vgs - here->BSIM4v4ggidlb * vbs); - - gbbsp = -(here->BSIM4v4gbds); - gbbdp = here->BSIM4v4gbds + here->BSIM4v4gbgs + here->BSIM4v4gbbs; - - gbdpg = 0.0; - gbdpsp = 0.0; - gbdpb = 0.0; - gbdpdp = 0.0; - - gbspg = here->BSIM4v4gbgs; - gbspsp = here->BSIM4v4gbds; - gbspb = here->BSIM4v4gbbs; - gbspdp = -(gbspg + gbspsp + gbspb); - - if (model->BSIM4v4igcMod) - { gIstotg = here->BSIM4v4gIgsg + here->BSIM4v4gIgcdg; - gIstotd = here->BSIM4v4gIgcds; - gIstots = here->BSIM4v4gIgss + here->BSIM4v4gIgcdd; - gIstotb = here->BSIM4v4gIgcdb; - Istoteq = model->BSIM4v4type * (here->BSIM4v4Igs + here->BSIM4v4Igcd - - here->BSIM4v4gIgsg * vgs - here->BSIM4v4gIgcdg * vgd - + here->BSIM4v4gIgcdd * vds - here->BSIM4v4gIgcdb * vbd); - - gIdtotg = here->BSIM4v4gIgdg + here->BSIM4v4gIgcsg; - gIdtotd = here->BSIM4v4gIgdd + here->BSIM4v4gIgcss; - gIdtots = here->BSIM4v4gIgcsd; - gIdtotb = here->BSIM4v4gIgcsb; - Idtoteq = model->BSIM4v4type * (here->BSIM4v4Igd + here->BSIM4v4Igcs - - (here->BSIM4v4gIgdg + here->BSIM4v4gIgcsg) * vgd - + here->BSIM4v4gIgcsd * vds - here->BSIM4v4gIgcsb * vbd); - } - else - { gIstotg = gIstotd = gIstots = gIstotb = Istoteq = 0.0; - gIdtotg = gIdtotd = gIdtots = gIdtotb = Idtoteq = 0.0; - } - - if (model->BSIM4v4igbMod) - { gIbtotg = here->BSIM4v4gIgbg; - gIbtotd = here->BSIM4v4gIgbs; - gIbtots = here->BSIM4v4gIgbd; - gIbtotb = here->BSIM4v4gIgbb; - Ibtoteq = model->BSIM4v4type * (here->BSIM4v4Igb - - here->BSIM4v4gIgbg * vgd + here->BSIM4v4gIgbd * vds - - here->BSIM4v4gIgbb * vbd); - } - else - gIbtotg = gIbtotd = gIbtots = gIbtotb = Ibtoteq = 0.0; - - if ((model->BSIM4v4igcMod != 0) || (model->BSIM4v4igbMod != 0)) - { gIgtotg = gIstotg + gIdtotg + gIbtotg; - gIgtotd = gIstotd + gIdtotd + gIbtotd ; - gIgtots = gIstots + gIdtots + gIbtots; - gIgtotb = gIstotb + gIdtotb + gIbtotb; - Igtoteq = Istoteq + Idtoteq + Ibtoteq; - } - else - gIgtotg = gIgtotd = gIgtots = gIgtotb = Igtoteq = 0.0; - - - if (here->BSIM4v4rgateMod == 2) - T0 = vges - vgs; - else if (here->BSIM4v4rgateMod == 3) - T0 = vgms - vgs; - if (here->BSIM4v4rgateMod > 1) - { gcrgd = here->BSIM4v4gcrgs * T0; - gcrgg = here->BSIM4v4gcrgg * T0; - gcrgs = here->BSIM4v4gcrgd * T0; - gcrgb = here->BSIM4v4gcrgb * T0; - ceqgcrg = -(gcrgg * vgd - gcrgs * vds - + gcrgb * vbd); - gcrgg -= here->BSIM4v4gcrg; - gcrg = here->BSIM4v4gcrg; - } - else - ceqgcrg = gcrg = gcrgd = gcrgg = gcrgs = gcrgb = 0.0; - } - - if (model->BSIM4v4rdsMod == 1) - { ceqgstot = model->BSIM4v4type * (here->BSIM4v4gstotd * vds - + here->BSIM4v4gstotg * vgs + here->BSIM4v4gstotb * vbs); - /* WDLiu: ceqgstot flowing away from sNodePrime */ - gstot = here->BSIM4v4gstot; - gstotd = here->BSIM4v4gstotd; - gstotg = here->BSIM4v4gstotg; - gstots = here->BSIM4v4gstots - gstot; - gstotb = here->BSIM4v4gstotb; - - ceqgdtot = -model->BSIM4v4type * (here->BSIM4v4gdtotd * vds - + here->BSIM4v4gdtotg * vgs + here->BSIM4v4gdtotb * vbs); - /* WDLiu: ceqgdtot defined as flowing into dNodePrime */ - gdtot = here->BSIM4v4gdtot; - gdtotd = here->BSIM4v4gdtotd - gdtot; - gdtotg = here->BSIM4v4gdtotg; - gdtots = here->BSIM4v4gdtots; - gdtotb = here->BSIM4v4gdtotb; - } - else - { gstot = gstotd = gstotg = gstots = gstotb = ceqgstot = 0.0; - gdtot = gdtotd = gdtotg = gdtots = gdtotb = ceqgdtot = 0.0; - } - - if (model->BSIM4v4type > 0) - { ceqjs = (here->BSIM4v4cbs - here->BSIM4v4gbs * vbs_jct); - ceqjd = (here->BSIM4v4cbd - here->BSIM4v4gbd * vbd_jct); - } - else - { ceqjs = -(here->BSIM4v4cbs - here->BSIM4v4gbs * vbs_jct); - ceqjd = -(here->BSIM4v4cbd - here->BSIM4v4gbd * vbd_jct); - ceqqg = -ceqqg; - ceqqd = -ceqqd; - ceqqb = -ceqqb; - ceqgcrg = -ceqgcrg; - - if (here->BSIM4v4trnqsMod) - { cqdef = -cqdef; - cqcheq = -cqcheq; - } - - if (here->BSIM4v4rbodyMod) - { ceqqjs = -ceqqjs; - ceqqjd = -ceqqjd; - } - - if (here->BSIM4v4rgateMod == 3) - ceqqgmid = -ceqqgmid; - } - - - /* - * Loading RHS - */ - - m = here->BSIM4v4m; - - (*(ckt->CKTrhs + here->BSIM4v4dNodePrime) += m * (ceqjd - ceqbd + ceqgdtot - - ceqdrn - ceqqd + Idtoteq)); - (*(ckt->CKTrhs + here->BSIM4v4gNodePrime) -= m * (ceqqg - ceqgcrg + Igtoteq)); - - if (here->BSIM4v4rgateMod == 2) - (*(ckt->CKTrhs + here->BSIM4v4gNodeExt) -= m * ceqgcrg); - else if (here->BSIM4v4rgateMod == 3) - (*(ckt->CKTrhs + here->BSIM4v4gNodeMid) -= m * (ceqqgmid + ceqgcrg)); - - if (!here->BSIM4v4rbodyMod) - { (*(ckt->CKTrhs + here->BSIM4v4bNodePrime) += m * (ceqbd + ceqbs - ceqjd - - ceqjs - ceqqb + Ibtoteq)); - (*(ckt->CKTrhs + here->BSIM4v4sNodePrime) += m * (ceqdrn - ceqbs + ceqjs - + ceqqg + ceqqb + ceqqd + ceqqgmid - ceqgstot + Istoteq)); - } - else - { (*(ckt->CKTrhs + here->BSIM4v4dbNode) -= m * (ceqjd + ceqqjd)); - (*(ckt->CKTrhs + here->BSIM4v4bNodePrime) += m * (ceqbd + ceqbs - ceqqb + Ibtoteq)); - (*(ckt->CKTrhs + here->BSIM4v4sbNode) -= m * (ceqjs + ceqqjs)); - (*(ckt->CKTrhs + here->BSIM4v4sNodePrime) += m * (ceqdrn - ceqbs + ceqjs + ceqqd - + ceqqg + ceqqb + ceqqjd + ceqqjs + ceqqgmid - ceqgstot + Istoteq)); - } - - if (model->BSIM4v4rdsMod) - { (*(ckt->CKTrhs + here->BSIM4v4dNode) -= m * ceqgdtot); - (*(ckt->CKTrhs + here->BSIM4v4sNode) += m * ceqgstot); - } - - if (here->BSIM4v4trnqsMod) - *(ckt->CKTrhs + here->BSIM4v4qNode) += m * (cqcheq - cqdef); - - - /* - * Loading matrix - */ - - if (!here->BSIM4v4rbodyMod) - { gjbd = here->BSIM4v4gbd; - gjbs = here->BSIM4v4gbs; - } - else - gjbd = gjbs = 0.0; - - if (!model->BSIM4v4rdsMod) - { gdpr = here->BSIM4v4drainConductance; - gspr = here->BSIM4v4sourceConductance; - } - else - gdpr = gspr = 0.0; - - geltd = here->BSIM4v4grgeltd; - - T1 = qdef * here->BSIM4v4gtau; - - if (here->BSIM4v4rgateMod == 1) - { (*(here->BSIM4v4GEgePtr) += m * geltd); - (*(here->BSIM4v4GPgePtr) -= m * geltd); - (*(here->BSIM4v4GEgpPtr) -= m * geltd); - (*(here->BSIM4v4GPgpPtr) += m * (gcggb + geltd - ggtg + gIgtotg)); - (*(here->BSIM4v4GPdpPtr) += m * (gcgdb - ggtd + gIgtotd)); - (*(here->BSIM4v4GPspPtr) += m * (gcgsb - ggts + gIgtots)); - (*(here->BSIM4v4GPbpPtr) += m * (gcgbb - ggtb + gIgtotb)); - } /* WDLiu: gcrg already subtracted from all gcrgg below */ - else if (here->BSIM4v4rgateMod == 2) - { (*(here->BSIM4v4GEgePtr) += m * gcrg); - (*(here->BSIM4v4GEgpPtr) += m * gcrgg); - (*(here->BSIM4v4GEdpPtr) += m * gcrgd); - (*(here->BSIM4v4GEspPtr) += m * gcrgs); - (*(here->BSIM4v4GEbpPtr) += m * gcrgb); - - (*(here->BSIM4v4GPgePtr) -= m * gcrg); - (*(here->BSIM4v4GPgpPtr) += m * (gcggb - gcrgg - ggtg + gIgtotg)); - (*(here->BSIM4v4GPdpPtr) += m * (gcgdb - gcrgd - ggtd + gIgtotd)); - (*(here->BSIM4v4GPspPtr) += m * (gcgsb - gcrgs - ggts + gIgtots)); - (*(here->BSIM4v4GPbpPtr) += m * (gcgbb - gcrgb - ggtb + gIgtotb)); - } - else if (here->BSIM4v4rgateMod == 3) - { (*(here->BSIM4v4GEgePtr) += m * geltd); - (*(here->BSIM4v4GEgmPtr) -= m * geltd); - (*(here->BSIM4v4GMgePtr) -= m * geltd); - (*(here->BSIM4v4GMgmPtr) += m * (geltd + gcrg + gcgmgmb)); - - (*(here->BSIM4v4GMdpPtr) += m * (gcrgd + gcgmdb)); - (*(here->BSIM4v4GMgpPtr) += m * gcrgg); - (*(here->BSIM4v4GMspPtr) += m * (gcrgs + gcgmsb)); - (*(here->BSIM4v4GMbpPtr) += m * (gcrgb + gcgmbb)); - - (*(here->BSIM4v4DPgmPtr) += m * gcdgmb); - (*(here->BSIM4v4GPgmPtr) -= m * gcrg); - (*(here->BSIM4v4SPgmPtr) += m * gcsgmb); - (*(here->BSIM4v4BPgmPtr) += m * gcbgmb); - - (*(here->BSIM4v4GPgpPtr) += m * (gcggb - gcrgg - ggtg + gIgtotg)); - (*(here->BSIM4v4GPdpPtr) += m * (gcgdb - gcrgd - ggtd + gIgtotd)); - (*(here->BSIM4v4GPspPtr) += m * (gcgsb - gcrgs - ggts + gIgtots)); - (*(here->BSIM4v4GPbpPtr) += m * (gcgbb - gcrgb - ggtb + gIgtotb)); - } - else - { (*(here->BSIM4v4GPgpPtr) += m * (gcggb - ggtg + gIgtotg)); - (*(here->BSIM4v4GPdpPtr) += m * (gcgdb - ggtd + gIgtotd)); - (*(here->BSIM4v4GPspPtr) += m * (gcgsb - ggts + gIgtots)); - (*(here->BSIM4v4GPbpPtr) += m * (gcgbb - ggtb + gIgtotb)); - } - - if (model->BSIM4v4rdsMod) - { (*(here->BSIM4v4DgpPtr) += m * gdtotg); - (*(here->BSIM4v4DspPtr) += m * gdtots); - (*(here->BSIM4v4DbpPtr) += m * gdtotb); - (*(here->BSIM4v4SdpPtr) += m * gstotd); - (*(here->BSIM4v4SgpPtr) += m * gstotg); - (*(here->BSIM4v4SbpPtr) += m * gstotb); - } - - (*(here->BSIM4v4DPdpPtr) += m * (gdpr + here->BSIM4v4gds + here->BSIM4v4gbd + T1 * ddxpart_dVd - - gdtotd + RevSum + gcddb + gbdpdp + dxpart * ggtd - gIdtotd)); - (*(here->BSIM4v4DPdPtr) -= m * (gdpr + gdtot)); - (*(here->BSIM4v4DPgpPtr) += m * (Gm + gcdgb - gdtotg + gbdpg - gIdtotg - + dxpart * ggtg + T1 * ddxpart_dVg)); - (*(here->BSIM4v4DPspPtr) -= m * (here->BSIM4v4gds + gdtots - dxpart * ggts + gIdtots - - T1 * ddxpart_dVs + FwdSum - gcdsb - gbdpsp)); - (*(here->BSIM4v4DPbpPtr) -= m * (gjbd + gdtotb - Gmbs - gcdbb - gbdpb + gIdtotb - - T1 * ddxpart_dVb - dxpart * ggtb)); - - (*(here->BSIM4v4DdpPtr) -= m * (gdpr - gdtotd)); - (*(here->BSIM4v4DdPtr) += m * (gdpr + gdtot)); - - (*(here->BSIM4v4SPdpPtr) -= m * (here->BSIM4v4gds + gstotd + RevSum - gcsdb - gbspdp - - T1 * dsxpart_dVd - sxpart * ggtd + gIstotd)); - (*(here->BSIM4v4SPgpPtr) += m * (gcsgb - Gm - gstotg + gbspg + sxpart * ggtg - + T1 * dsxpart_dVg - gIstotg)); - (*(here->BSIM4v4SPspPtr) += m * (gspr + here->BSIM4v4gds + here->BSIM4v4gbs + T1 * dsxpart_dVs - - gstots + FwdSum + gcssb + gbspsp + sxpart * ggts - gIstots)); - (*(here->BSIM4v4SPsPtr) -= m * (gspr + gstot)); - (*(here->BSIM4v4SPbpPtr) -= m * (gjbs + gstotb + Gmbs - gcsbb - gbspb - sxpart * ggtb - - T1 * dsxpart_dVb + gIstotb)); - - (*(here->BSIM4v4SspPtr) -= m * (gspr - gstots)); - (*(here->BSIM4v4SsPtr) += m * (gspr + gstot)); - - (*(here->BSIM4v4BPdpPtr) += m * (gcbdb - gjbd + gbbdp - gIbtotd)); - (*(here->BSIM4v4BPgpPtr) += m * (gcbgb - here->BSIM4v4gbgs - gIbtotg)); - (*(here->BSIM4v4BPspPtr) += m * (gcbsb - gjbs + gbbsp - gIbtots)); - (*(here->BSIM4v4BPbpPtr) += m * (gjbd + gjbs + gcbbb - here->BSIM4v4gbbs - - gIbtotb)); - - ggidld = here->BSIM4v4ggidld; - ggidlg = here->BSIM4v4ggidlg; - ggidlb = here->BSIM4v4ggidlb; - ggislg = here->BSIM4v4ggislg; - ggisls = here->BSIM4v4ggisls; - ggislb = here->BSIM4v4ggislb; - - /* stamp gidl */ - (*(here->BSIM4v4DPdpPtr) += m * ggidld); - (*(here->BSIM4v4DPgpPtr) += m * ggidlg); - (*(here->BSIM4v4DPspPtr) -= m * (ggidlg + ggidld + ggidlb)); - (*(here->BSIM4v4DPbpPtr) += m * ggidlb); - (*(here->BSIM4v4BPdpPtr) -= m * ggidld); - (*(here->BSIM4v4BPgpPtr) -= m * ggidlg); - (*(here->BSIM4v4BPspPtr) += m * (ggidlg + ggidld + ggidlb)); - (*(here->BSIM4v4BPbpPtr) -= m * ggidlb); - /* stamp gisl */ - (*(here->BSIM4v4SPdpPtr) -= m * (ggisls + ggislg + ggislb)); - (*(here->BSIM4v4SPgpPtr) += m * ggislg); - (*(here->BSIM4v4SPspPtr) += m * ggisls); - (*(here->BSIM4v4SPbpPtr) += m * ggislb); - (*(here->BSIM4v4BPdpPtr) += m * (ggislg + ggisls + ggislb)); - (*(here->BSIM4v4BPgpPtr) -= m * ggislg); - (*(here->BSIM4v4BPspPtr) -= m * ggisls); - (*(here->BSIM4v4BPbpPtr) -= m * ggislb); - - - if (here->BSIM4v4rbodyMod) - { (*(here->BSIM4v4DPdbPtr) += m * (gcdbdb - here->BSIM4v4gbd)); - (*(here->BSIM4v4SPsbPtr) -= m * (here->BSIM4v4gbs - gcsbsb)); - - (*(here->BSIM4v4DBdpPtr) += m * (gcdbdb - here->BSIM4v4gbd)); - (*(here->BSIM4v4DBdbPtr) += m * (here->BSIM4v4gbd - gcdbdb - + here->BSIM4v4grbpd + here->BSIM4v4grbdb)); - (*(here->BSIM4v4DBbpPtr) -= m * here->BSIM4v4grbpd); - (*(here->BSIM4v4DBbPtr) -= m * here->BSIM4v4grbdb); - - (*(here->BSIM4v4BPdbPtr) -= m * here->BSIM4v4grbpd); - (*(here->BSIM4v4BPbPtr) -= m * here->BSIM4v4grbpb); - (*(here->BSIM4v4BPsbPtr) -= m * here->BSIM4v4grbps); - (*(here->BSIM4v4BPbpPtr) += m * (here->BSIM4v4grbpd + here->BSIM4v4grbps - + here->BSIM4v4grbpb)); - /* WDLiu: (gcbbb - here->BSIM4v4gbbs) already added to BPbpPtr */ - - (*(here->BSIM4v4SBspPtr) += m * (gcsbsb - here->BSIM4v4gbs)); - (*(here->BSIM4v4SBbpPtr) -= m * here->BSIM4v4grbps); - (*(here->BSIM4v4SBbPtr) -= m * here->BSIM4v4grbsb); - (*(here->BSIM4v4SBsbPtr) += m * (here->BSIM4v4gbs - gcsbsb - + here->BSIM4v4grbps + here->BSIM4v4grbsb)); - - (*(here->BSIM4v4BdbPtr) -= m * here->BSIM4v4grbdb); - (*(here->BSIM4v4BbpPtr) -= m * here->BSIM4v4grbpb); - (*(here->BSIM4v4BsbPtr) -= m * here->BSIM4v4grbsb); - (*(here->BSIM4v4BbPtr) += m * (here->BSIM4v4grbsb + here->BSIM4v4grbdb - + here->BSIM4v4grbpb)); - } - - if (here->BSIM4v4trnqsMod) - { (*(here->BSIM4v4QqPtr) += m * (gqdef + here->BSIM4v4gtau)); - (*(here->BSIM4v4QgpPtr) += m * (ggtg - gcqgb)); - (*(here->BSIM4v4QdpPtr) += m * (ggtd - gcqdb)); - (*(here->BSIM4v4QspPtr) += m * (ggts - gcqsb)); - (*(here->BSIM4v4QbpPtr) += m * (ggtb - gcqbb)); - - (*(here->BSIM4v4DPqPtr) += m * dxpart * here->BSIM4v4gtau); - (*(here->BSIM4v4SPqPtr) += m * sxpart * here->BSIM4v4gtau); - (*(here->BSIM4v4GPqPtr) -= m * here->BSIM4v4gtau); - } - -line1000: ; - - } /* End of MOSFET Instance */ -} /* End of Model Instance */ - -return(OK); -} - -/* function to compute poly depletion effect */ -int BSIM4v4polyDepletion( - double phi, - double ngate, - double coxe, - double Vgs, - double *Vgs_eff, - double *dVgs_eff_dVg) -{ - double T1, T2, T3, T4, T5, T6, T7, T8; - - /* Poly Gate Si Depletion Effect */ - if ((ngate > 1.0e18) && - (ngate < 1.0e25) && (Vgs > phi)) { - T1 = 1.0e6 * CHARGE * EPSSI * ngate / (coxe * coxe); - T8 = Vgs - phi; - T4 = sqrt(1.0 + 2.0 * T8 / T1); - T2 = 2.0 * T8 / (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; - } - return(0); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4mask.c b/src/spicelib/devices/bsim4v4/b4v4mask.c deleted file mode 100644 index 352d88e82..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4mask.c +++ /dev/null @@ -1,1970 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4mask.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - **********/ - - -#include "ngspice/ngspice.h" -#include "ngspice/ifsim.h" -#include "ngspice/cktdefs.h" -#include "ngspice/devdefs.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - -int -BSIM4v4mAsk( -CKTcircuit *ckt, -GENmodel *inst, -int which, -IFvalue *value) -{ - BSIM4v4model *model = (BSIM4v4model *)inst; - - NG_IGNORE(ckt); - - switch(which) - { case BSIM4v4_MOD_MOBMOD : - value->iValue = model->BSIM4v4mobMod; - return(OK); - case BSIM4v4_MOD_PARAMCHK : - value->iValue = model->BSIM4v4paramChk; - return(OK); - case BSIM4v4_MOD_BINUNIT : - value->iValue = model->BSIM4v4binUnit; - return(OK); - case BSIM4v4_MOD_CAPMOD : - value->iValue = model->BSIM4v4capMod; - return(OK); - case BSIM4v4_MOD_DIOMOD : - value->iValue = model->BSIM4v4dioMod; - return(OK); - case BSIM4v4_MOD_TRNQSMOD : - value->iValue = model->BSIM4v4trnqsMod; - return(OK); - case BSIM4v4_MOD_ACNQSMOD : - value->iValue = model->BSIM4v4acnqsMod; - return(OK); - case BSIM4v4_MOD_FNOIMOD : - value->iValue = model->BSIM4v4fnoiMod; - return(OK); - case BSIM4v4_MOD_TNOIMOD : - value->iValue = model->BSIM4v4tnoiMod; - return(OK); - case BSIM4v4_MOD_RDSMOD : - value->iValue = model->BSIM4v4rdsMod; - return(OK); - case BSIM4v4_MOD_RBODYMOD : - value->iValue = model->BSIM4v4rbodyMod; - return(OK); - case BSIM4v4_MOD_RGATEMOD : - value->iValue = model->BSIM4v4rgateMod; - return(OK); - case BSIM4v4_MOD_PERMOD : - value->iValue = model->BSIM4v4perMod; - return(OK); - case BSIM4v4_MOD_GEOMOD : - value->iValue = model->BSIM4v4geoMod; - return(OK); - case BSIM4v4_MOD_IGCMOD : - value->iValue = model->BSIM4v4igcMod; - return(OK); - case BSIM4v4_MOD_IGBMOD : - value->iValue = model->BSIM4v4igbMod; - return(OK); - case BSIM4v4_MOD_TEMPMOD : - value->iValue = model->BSIM4v4tempMod; - return(OK); - case BSIM4v4_MOD_VERSION : - value->sValue = model->BSIM4v4version; - return(OK); - case BSIM4v4_MOD_TOXREF : - value->rValue = model->BSIM4v4toxref; - return(OK); - case BSIM4v4_MOD_TOXE : - value->rValue = model->BSIM4v4toxe; - return(OK); - case BSIM4v4_MOD_TOXP : - value->rValue = model->BSIM4v4toxp; - return(OK); - case BSIM4v4_MOD_TOXM : - value->rValue = model->BSIM4v4toxm; - return(OK); - case BSIM4v4_MOD_DTOX : - value->rValue = model->BSIM4v4dtox; - return(OK); - case BSIM4v4_MOD_EPSROX : - value->rValue = model->BSIM4v4epsrox; - return(OK); - case BSIM4v4_MOD_CDSC : - value->rValue = model->BSIM4v4cdsc; - return(OK); - case BSIM4v4_MOD_CDSCB : - value->rValue = model->BSIM4v4cdscb; - return(OK); - - case BSIM4v4_MOD_CDSCD : - value->rValue = model->BSIM4v4cdscd; - return(OK); - - case BSIM4v4_MOD_CIT : - value->rValue = model->BSIM4v4cit; - return(OK); - case BSIM4v4_MOD_NFACTOR : - value->rValue = model->BSIM4v4nfactor; - return(OK); - case BSIM4v4_MOD_XJ: - value->rValue = model->BSIM4v4xj; - return(OK); - case BSIM4v4_MOD_VSAT: - value->rValue = model->BSIM4v4vsat; - return(OK); - case BSIM4v4_MOD_VTL: - value->rValue = model->BSIM4v4vtl; - return(OK); - case BSIM4v4_MOD_XN: - value->rValue = model->BSIM4v4xn; - return(OK); - case BSIM4v4_MOD_LC: - value->rValue = model->BSIM4v4lc; - return(OK); - case BSIM4v4_MOD_LAMBDA: - value->rValue = model->BSIM4v4lambda; - return(OK); - case BSIM4v4_MOD_AT: - value->rValue = model->BSIM4v4at; - return(OK); - case BSIM4v4_MOD_A0: - value->rValue = model->BSIM4v4a0; - return(OK); - - case BSIM4v4_MOD_AGS: - value->rValue = model->BSIM4v4ags; - return(OK); - - case BSIM4v4_MOD_A1: - value->rValue = model->BSIM4v4a1; - return(OK); - case BSIM4v4_MOD_A2: - value->rValue = model->BSIM4v4a2; - return(OK); - case BSIM4v4_MOD_KETA: - value->rValue = model->BSIM4v4keta; - return(OK); - case BSIM4v4_MOD_NSUB: - value->rValue = model->BSIM4v4nsub; - return(OK); - case BSIM4v4_MOD_NDEP: - value->rValue = model->BSIM4v4ndep; - return(OK); - case BSIM4v4_MOD_NSD: - value->rValue = model->BSIM4v4nsd; - return(OK); - case BSIM4v4_MOD_NGATE: - value->rValue = model->BSIM4v4ngate; - return(OK); - case BSIM4v4_MOD_GAMMA1: - value->rValue = model->BSIM4v4gamma1; - return(OK); - case BSIM4v4_MOD_GAMMA2: - value->rValue = model->BSIM4v4gamma2; - return(OK); - case BSIM4v4_MOD_VBX: - value->rValue = model->BSIM4v4vbx; - return(OK); - case BSIM4v4_MOD_VBM: - value->rValue = model->BSIM4v4vbm; - return(OK); - case BSIM4v4_MOD_XT: - value->rValue = model->BSIM4v4xt; - return(OK); - case BSIM4v4_MOD_K1: - value->rValue = model->BSIM4v4k1; - return(OK); - case BSIM4v4_MOD_KT1: - value->rValue = model->BSIM4v4kt1; - return(OK); - case BSIM4v4_MOD_KT1L: - value->rValue = model->BSIM4v4kt1l; - return(OK); - case BSIM4v4_MOD_KT2 : - value->rValue = model->BSIM4v4kt2; - return(OK); - case BSIM4v4_MOD_K2 : - value->rValue = model->BSIM4v4k2; - return(OK); - case BSIM4v4_MOD_K3: - value->rValue = model->BSIM4v4k3; - return(OK); - case BSIM4v4_MOD_K3B: - value->rValue = model->BSIM4v4k3b; - return(OK); - case BSIM4v4_MOD_W0: - value->rValue = model->BSIM4v4w0; - return(OK); - case BSIM4v4_MOD_LPE0: - value->rValue = model->BSIM4v4lpe0; - return(OK); - case BSIM4v4_MOD_LPEB: - value->rValue = model->BSIM4v4lpeb; - return(OK); - case BSIM4v4_MOD_DVTP0: - value->rValue = model->BSIM4v4dvtp0; - return(OK); - case BSIM4v4_MOD_DVTP1: - value->rValue = model->BSIM4v4dvtp1; - return(OK); - case BSIM4v4_MOD_DVT0 : - value->rValue = model->BSIM4v4dvt0; - return(OK); - case BSIM4v4_MOD_DVT1 : - value->rValue = model->BSIM4v4dvt1; - return(OK); - case BSIM4v4_MOD_DVT2 : - value->rValue = model->BSIM4v4dvt2; - return(OK); - case BSIM4v4_MOD_DVT0W : - value->rValue = model->BSIM4v4dvt0w; - return(OK); - case BSIM4v4_MOD_DVT1W : - value->rValue = model->BSIM4v4dvt1w; - return(OK); - case BSIM4v4_MOD_DVT2W : - value->rValue = model->BSIM4v4dvt2w; - return(OK); - case BSIM4v4_MOD_DROUT : - value->rValue = model->BSIM4v4drout; - return(OK); - case BSIM4v4_MOD_DSUB : - value->rValue = model->BSIM4v4dsub; - return(OK); - case BSIM4v4_MOD_VTH0: - value->rValue = model->BSIM4v4vth0; - return(OK); - case BSIM4v4_MOD_EU: - value->rValue = model->BSIM4v4eu; - return(OK); - case BSIM4v4_MOD_UA: - value->rValue = model->BSIM4v4ua; - return(OK); - case BSIM4v4_MOD_UA1: - value->rValue = model->BSIM4v4ua1; - return(OK); - case BSIM4v4_MOD_UB: - value->rValue = model->BSIM4v4ub; - return(OK); - case BSIM4v4_MOD_UB1: - value->rValue = model->BSIM4v4ub1; - return(OK); - case BSIM4v4_MOD_UC: - value->rValue = model->BSIM4v4uc; - return(OK); - case BSIM4v4_MOD_UC1: - value->rValue = model->BSIM4v4uc1; - return(OK); - case BSIM4v4_MOD_U0: - value->rValue = model->BSIM4v4u0; - return(OK); - case BSIM4v4_MOD_UTE: - value->rValue = model->BSIM4v4ute; - return(OK); - case BSIM4v4_MOD_VOFF: - value->rValue = model->BSIM4v4voff; - return(OK); - case BSIM4v4_MOD_VOFFL: - value->rValue = model->BSIM4v4voffl; - return(OK); - case BSIM4v4_MOD_MINV: - value->rValue = model->BSIM4v4minv; - return(OK); - case BSIM4v4_MOD_FPROUT: - value->rValue = model->BSIM4v4fprout; - return(OK); - case BSIM4v4_MOD_PDITS: - value->rValue = model->BSIM4v4pdits; - return(OK); - case BSIM4v4_MOD_PDITSD: - value->rValue = model->BSIM4v4pditsd; - return(OK); - case BSIM4v4_MOD_PDITSL: - value->rValue = model->BSIM4v4pditsl; - return(OK); - case BSIM4v4_MOD_DELTA: - value->rValue = model->BSIM4v4delta; - return(OK); - case BSIM4v4_MOD_RDSW: - value->rValue = model->BSIM4v4rdsw; - return(OK); - case BSIM4v4_MOD_RDSWMIN: - value->rValue = model->BSIM4v4rdswmin; - return(OK); - case BSIM4v4_MOD_RDWMIN: - value->rValue = model->BSIM4v4rdwmin; - return(OK); - case BSIM4v4_MOD_RSWMIN: - value->rValue = model->BSIM4v4rswmin; - return(OK); - case BSIM4v4_MOD_RDW: - value->rValue = model->BSIM4v4rdw; - return(OK); - case BSIM4v4_MOD_RSW: - value->rValue = model->BSIM4v4rsw; - return(OK); - case BSIM4v4_MOD_PRWG: - value->rValue = model->BSIM4v4prwg; - return(OK); - case BSIM4v4_MOD_PRWB: - value->rValue = model->BSIM4v4prwb; - return(OK); - case BSIM4v4_MOD_PRT: - value->rValue = model->BSIM4v4prt; - return(OK); - case BSIM4v4_MOD_ETA0: - value->rValue = model->BSIM4v4eta0; - return(OK); - case BSIM4v4_MOD_ETAB: - value->rValue = model->BSIM4v4etab; - return(OK); - case BSIM4v4_MOD_PCLM: - value->rValue = model->BSIM4v4pclm; - return(OK); - case BSIM4v4_MOD_PDIBL1: - value->rValue = model->BSIM4v4pdibl1; - return(OK); - case BSIM4v4_MOD_PDIBL2: - value->rValue = model->BSIM4v4pdibl2; - return(OK); - case BSIM4v4_MOD_PDIBLB: - value->rValue = model->BSIM4v4pdiblb; - return(OK); - case BSIM4v4_MOD_PSCBE1: - value->rValue = model->BSIM4v4pscbe1; - return(OK); - case BSIM4v4_MOD_PSCBE2: - value->rValue = model->BSIM4v4pscbe2; - return(OK); - case BSIM4v4_MOD_PVAG: - value->rValue = model->BSIM4v4pvag; - return(OK); - case BSIM4v4_MOD_WR: - value->rValue = model->BSIM4v4wr; - return(OK); - case BSIM4v4_MOD_DWG: - value->rValue = model->BSIM4v4dwg; - return(OK); - case BSIM4v4_MOD_DWB: - value->rValue = model->BSIM4v4dwb; - return(OK); - case BSIM4v4_MOD_B0: - value->rValue = model->BSIM4v4b0; - return(OK); - case BSIM4v4_MOD_B1: - value->rValue = model->BSIM4v4b1; - return(OK); - case BSIM4v4_MOD_ALPHA0: - value->rValue = model->BSIM4v4alpha0; - return(OK); - case BSIM4v4_MOD_ALPHA1: - value->rValue = model->BSIM4v4alpha1; - return(OK); - case BSIM4v4_MOD_BETA0: - value->rValue = model->BSIM4v4beta0; - return(OK); - case BSIM4v4_MOD_AGIDL: - value->rValue = model->BSIM4v4agidl; - return(OK); - case BSIM4v4_MOD_BGIDL: - value->rValue = model->BSIM4v4bgidl; - return(OK); - case BSIM4v4_MOD_CGIDL: - value->rValue = model->BSIM4v4cgidl; - return(OK); - case BSIM4v4_MOD_EGIDL: - value->rValue = model->BSIM4v4egidl; - return(OK); - case BSIM4v4_MOD_AIGC: - value->rValue = model->BSIM4v4aigc; - return(OK); - case BSIM4v4_MOD_BIGC: - value->rValue = model->BSIM4v4bigc; - return(OK); - case BSIM4v4_MOD_CIGC: - value->rValue = model->BSIM4v4cigc; - return(OK); - case BSIM4v4_MOD_AIGSD: - value->rValue = model->BSIM4v4aigsd; - return(OK); - case BSIM4v4_MOD_BIGSD: - value->rValue = model->BSIM4v4bigsd; - return(OK); - case BSIM4v4_MOD_CIGSD: - value->rValue = model->BSIM4v4cigsd; - return(OK); - case BSIM4v4_MOD_AIGBACC: - value->rValue = model->BSIM4v4aigbacc; - return(OK); - case BSIM4v4_MOD_BIGBACC: - value->rValue = model->BSIM4v4bigbacc; - return(OK); - case BSIM4v4_MOD_CIGBACC: - value->rValue = model->BSIM4v4cigbacc; - return(OK); - case BSIM4v4_MOD_AIGBINV: - value->rValue = model->BSIM4v4aigbinv; - return(OK); - case BSIM4v4_MOD_BIGBINV: - value->rValue = model->BSIM4v4bigbinv; - return(OK); - case BSIM4v4_MOD_CIGBINV: - value->rValue = model->BSIM4v4cigbinv; - return(OK); - case BSIM4v4_MOD_NIGC: - value->rValue = model->BSIM4v4nigc; - return(OK); - case BSIM4v4_MOD_NIGBACC: - value->rValue = model->BSIM4v4nigbacc; - return(OK); - case BSIM4v4_MOD_NIGBINV: - value->rValue = model->BSIM4v4nigbinv; - return(OK); - case BSIM4v4_MOD_NTOX: - value->rValue = model->BSIM4v4ntox; - return(OK); - case BSIM4v4_MOD_EIGBINV: - value->rValue = model->BSIM4v4eigbinv; - return(OK); - case BSIM4v4_MOD_PIGCD: - value->rValue = model->BSIM4v4pigcd; - return(OK); - case BSIM4v4_MOD_POXEDGE: - value->rValue = model->BSIM4v4poxedge; - return(OK); - case BSIM4v4_MOD_PHIN: - value->rValue = model->BSIM4v4phin; - return(OK); - case BSIM4v4_MOD_XRCRG1: - value->rValue = model->BSIM4v4xrcrg1; - return(OK); - case BSIM4v4_MOD_XRCRG2: - value->rValue = model->BSIM4v4xrcrg2; - return(OK); - case BSIM4v4_MOD_TNOIA: - value->rValue = model->BSIM4v4tnoia; - return(OK); - case BSIM4v4_MOD_TNOIB: - value->rValue = model->BSIM4v4tnoib; - return(OK); - case BSIM4v4_MOD_RNOIA: - value->rValue = model->BSIM4v4rnoia; - return(OK); - case BSIM4v4_MOD_RNOIB: - value->rValue = model->BSIM4v4rnoib; - return(OK); - case BSIM4v4_MOD_NTNOI: - value->rValue = model->BSIM4v4ntnoi; - return(OK); - case BSIM4v4_MOD_IJTHDFWD: - value->rValue = model->BSIM4v4ijthdfwd; - return(OK); - case BSIM4v4_MOD_IJTHSFWD: - value->rValue = model->BSIM4v4ijthsfwd; - return(OK); - case BSIM4v4_MOD_IJTHDREV: - value->rValue = model->BSIM4v4ijthdrev; - return(OK); - case BSIM4v4_MOD_IJTHSREV: - value->rValue = model->BSIM4v4ijthsrev; - return(OK); - case BSIM4v4_MOD_XJBVD: - value->rValue = model->BSIM4v4xjbvd; - return(OK); - case BSIM4v4_MOD_XJBVS: - value->rValue = model->BSIM4v4xjbvs; - return(OK); - case BSIM4v4_MOD_BVD: - value->rValue = model->BSIM4v4bvd; - return(OK); - case BSIM4v4_MOD_BVS: - value->rValue = model->BSIM4v4bvs; - return(OK); - case BSIM4v4_MOD_VFB: - value->rValue = model->BSIM4v4vfb; - return(OK); - - case BSIM4v4_MOD_GBMIN: - value->rValue = model->BSIM4v4gbmin; - return(OK); - case BSIM4v4_MOD_RBDB: - value->rValue = model->BSIM4v4rbdb; - return(OK); - case BSIM4v4_MOD_RBPB: - value->rValue = model->BSIM4v4rbpb; - return(OK); - case BSIM4v4_MOD_RBSB: - value->rValue = model->BSIM4v4rbsb; - return(OK); - case BSIM4v4_MOD_RBPS: - value->rValue = model->BSIM4v4rbps; - return(OK); - case BSIM4v4_MOD_RBPD: - value->rValue = model->BSIM4v4rbpd; - return(OK); - - case BSIM4v4_MOD_CGSL: - value->rValue = model->BSIM4v4cgsl; - return(OK); - case BSIM4v4_MOD_CGDL: - value->rValue = model->BSIM4v4cgdl; - return(OK); - case BSIM4v4_MOD_CKAPPAS: - value->rValue = model->BSIM4v4ckappas; - return(OK); - case BSIM4v4_MOD_CKAPPAD: - value->rValue = model->BSIM4v4ckappad; - return(OK); - case BSIM4v4_MOD_CF: - value->rValue = model->BSIM4v4cf; - return(OK); - case BSIM4v4_MOD_CLC: - value->rValue = model->BSIM4v4clc; - return(OK); - case BSIM4v4_MOD_CLE: - value->rValue = model->BSIM4v4cle; - return(OK); - case BSIM4v4_MOD_DWC: - value->rValue = model->BSIM4v4dwc; - return(OK); - case BSIM4v4_MOD_DLC: - value->rValue = model->BSIM4v4dlc; - return(OK); - case BSIM4v4_MOD_XW: - value->rValue = model->BSIM4v4xw; - return(OK); - case BSIM4v4_MOD_XL: - value->rValue = model->BSIM4v4xl; - return(OK); - case BSIM4v4_MOD_DLCIG: - value->rValue = model->BSIM4v4dlcig; - return(OK); - case BSIM4v4_MOD_DWJ: - value->rValue = model->BSIM4v4dwj; - return(OK); - case BSIM4v4_MOD_VFBCV: - value->rValue = model->BSIM4v4vfbcv; - return(OK); - case BSIM4v4_MOD_ACDE: - value->rValue = model->BSIM4v4acde; - return(OK); - case BSIM4v4_MOD_MOIN: - value->rValue = model->BSIM4v4moin; - return(OK); - case BSIM4v4_MOD_NOFF: - value->rValue = model->BSIM4v4noff; - return(OK); - case BSIM4v4_MOD_VOFFCV: - value->rValue = model->BSIM4v4voffcv; - return(OK); - case BSIM4v4_MOD_DMCG: - value->rValue = model->BSIM4v4dmcg; - return(OK); - case BSIM4v4_MOD_DMCI: - value->rValue = model->BSIM4v4dmci; - return(OK); - case BSIM4v4_MOD_DMDG: - value->rValue = model->BSIM4v4dmdg; - return(OK); - case BSIM4v4_MOD_DMCGT: - value->rValue = model->BSIM4v4dmcgt; - return(OK); - case BSIM4v4_MOD_XGW: - value->rValue = model->BSIM4v4xgw; - return(OK); - case BSIM4v4_MOD_XGL: - value->rValue = model->BSIM4v4xgl; - return(OK); - case BSIM4v4_MOD_RSHG: - value->rValue = model->BSIM4v4rshg; - return(OK); - case BSIM4v4_MOD_NGCON: - value->rValue = model->BSIM4v4ngcon; - return(OK); - case BSIM4v4_MOD_TCJ: - value->rValue = model->BSIM4v4tcj; - return(OK); - case BSIM4v4_MOD_TPB: - value->rValue = model->BSIM4v4tpb; - return(OK); - case BSIM4v4_MOD_TCJSW: - value->rValue = model->BSIM4v4tcjsw; - return(OK); - case BSIM4v4_MOD_TPBSW: - value->rValue = model->BSIM4v4tpbsw; - return(OK); - case BSIM4v4_MOD_TCJSWG: - value->rValue = model->BSIM4v4tcjswg; - return(OK); - case BSIM4v4_MOD_TPBSWG: - value->rValue = model->BSIM4v4tpbswg; - return(OK); - - /* Length dependence */ - case BSIM4v4_MOD_LCDSC : - value->rValue = model->BSIM4v4lcdsc; - return(OK); - case BSIM4v4_MOD_LCDSCB : - value->rValue = model->BSIM4v4lcdscb; - return(OK); - case BSIM4v4_MOD_LCDSCD : - value->rValue = model->BSIM4v4lcdscd; - return(OK); - case BSIM4v4_MOD_LCIT : - value->rValue = model->BSIM4v4lcit; - return(OK); - case BSIM4v4_MOD_LNFACTOR : - value->rValue = model->BSIM4v4lnfactor; - return(OK); - case BSIM4v4_MOD_LXJ: - value->rValue = model->BSIM4v4lxj; - return(OK); - case BSIM4v4_MOD_LVSAT: - value->rValue = model->BSIM4v4lvsat; - return(OK); - case BSIM4v4_MOD_LAT: - value->rValue = model->BSIM4v4lat; - return(OK); - case BSIM4v4_MOD_LA0: - value->rValue = model->BSIM4v4la0; - return(OK); - case BSIM4v4_MOD_LAGS: - value->rValue = model->BSIM4v4lags; - return(OK); - case BSIM4v4_MOD_LA1: - value->rValue = model->BSIM4v4la1; - return(OK); - case BSIM4v4_MOD_LA2: - value->rValue = model->BSIM4v4la2; - return(OK); - case BSIM4v4_MOD_LKETA: - value->rValue = model->BSIM4v4lketa; - return(OK); - case BSIM4v4_MOD_LNSUB: - value->rValue = model->BSIM4v4lnsub; - return(OK); - case BSIM4v4_MOD_LNDEP: - value->rValue = model->BSIM4v4lndep; - return(OK); - case BSIM4v4_MOD_LNSD: - value->rValue = model->BSIM4v4lnsd; - return(OK); - case BSIM4v4_MOD_LNGATE: - value->rValue = model->BSIM4v4lngate; - return(OK); - case BSIM4v4_MOD_LGAMMA1: - value->rValue = model->BSIM4v4lgamma1; - return(OK); - case BSIM4v4_MOD_LGAMMA2: - value->rValue = model->BSIM4v4lgamma2; - return(OK); - case BSIM4v4_MOD_LVBX: - value->rValue = model->BSIM4v4lvbx; - return(OK); - case BSIM4v4_MOD_LVBM: - value->rValue = model->BSIM4v4lvbm; - return(OK); - case BSIM4v4_MOD_LXT: - value->rValue = model->BSIM4v4lxt; - return(OK); - case BSIM4v4_MOD_LK1: - value->rValue = model->BSIM4v4lk1; - return(OK); - case BSIM4v4_MOD_LKT1: - value->rValue = model->BSIM4v4lkt1; - return(OK); - case BSIM4v4_MOD_LKT1L: - value->rValue = model->BSIM4v4lkt1l; - return(OK); - case BSIM4v4_MOD_LKT2 : - value->rValue = model->BSIM4v4lkt2; - return(OK); - case BSIM4v4_MOD_LK2 : - value->rValue = model->BSIM4v4lk2; - return(OK); - case BSIM4v4_MOD_LK3: - value->rValue = model->BSIM4v4lk3; - return(OK); - case BSIM4v4_MOD_LK3B: - value->rValue = model->BSIM4v4lk3b; - return(OK); - case BSIM4v4_MOD_LW0: - value->rValue = model->BSIM4v4lw0; - return(OK); - case BSIM4v4_MOD_LLPE0: - value->rValue = model->BSIM4v4llpe0; - return(OK); - case BSIM4v4_MOD_LLPEB: - value->rValue = model->BSIM4v4llpeb; - return(OK); - case BSIM4v4_MOD_LDVTP0: - value->rValue = model->BSIM4v4ldvtp0; - return(OK); - case BSIM4v4_MOD_LDVTP1: - value->rValue = model->BSIM4v4ldvtp1; - return(OK); - case BSIM4v4_MOD_LDVT0: - value->rValue = model->BSIM4v4ldvt0; - return(OK); - case BSIM4v4_MOD_LDVT1 : - value->rValue = model->BSIM4v4ldvt1; - return(OK); - case BSIM4v4_MOD_LDVT2 : - value->rValue = model->BSIM4v4ldvt2; - return(OK); - case BSIM4v4_MOD_LDVT0W : - value->rValue = model->BSIM4v4ldvt0w; - return(OK); - case BSIM4v4_MOD_LDVT1W : - value->rValue = model->BSIM4v4ldvt1w; - return(OK); - case BSIM4v4_MOD_LDVT2W : - value->rValue = model->BSIM4v4ldvt2w; - return(OK); - case BSIM4v4_MOD_LDROUT : - value->rValue = model->BSIM4v4ldrout; - return(OK); - case BSIM4v4_MOD_LDSUB : - value->rValue = model->BSIM4v4ldsub; - return(OK); - case BSIM4v4_MOD_LVTH0: - value->rValue = model->BSIM4v4lvth0; - return(OK); - case BSIM4v4_MOD_LUA: - value->rValue = model->BSIM4v4lua; - return(OK); - case BSIM4v4_MOD_LUA1: - value->rValue = model->BSIM4v4lua1; - return(OK); - case BSIM4v4_MOD_LUB: - value->rValue = model->BSIM4v4lub; - return(OK); - case BSIM4v4_MOD_LUB1: - value->rValue = model->BSIM4v4lub1; - return(OK); - case BSIM4v4_MOD_LUC: - value->rValue = model->BSIM4v4luc; - return(OK); - case BSIM4v4_MOD_LUC1: - value->rValue = model->BSIM4v4luc1; - return(OK); - case BSIM4v4_MOD_LU0: - value->rValue = model->BSIM4v4lu0; - return(OK); - case BSIM4v4_MOD_LUTE: - value->rValue = model->BSIM4v4lute; - return(OK); - case BSIM4v4_MOD_LVOFF: - value->rValue = model->BSIM4v4lvoff; - return(OK); - case BSIM4v4_MOD_LMINV: - value->rValue = model->BSIM4v4lminv; - return(OK); - case BSIM4v4_MOD_LFPROUT: - value->rValue = model->BSIM4v4lfprout; - return(OK); - case BSIM4v4_MOD_LPDITS: - value->rValue = model->BSIM4v4lpdits; - return(OK); - case BSIM4v4_MOD_LPDITSD: - value->rValue = model->BSIM4v4lpditsd; - return(OK); - case BSIM4v4_MOD_LDELTA: - value->rValue = model->BSIM4v4ldelta; - return(OK); - case BSIM4v4_MOD_LRDSW: - value->rValue = model->BSIM4v4lrdsw; - return(OK); - case BSIM4v4_MOD_LRDW: - value->rValue = model->BSIM4v4lrdw; - return(OK); - case BSIM4v4_MOD_LRSW: - value->rValue = model->BSIM4v4lrsw; - return(OK); - case BSIM4v4_MOD_LPRWB: - value->rValue = model->BSIM4v4lprwb; - return(OK); - case BSIM4v4_MOD_LPRWG: - value->rValue = model->BSIM4v4lprwg; - return(OK); - case BSIM4v4_MOD_LPRT: - value->rValue = model->BSIM4v4lprt; - return(OK); - case BSIM4v4_MOD_LETA0: - value->rValue = model->BSIM4v4leta0; - return(OK); - case BSIM4v4_MOD_LETAB: - value->rValue = model->BSIM4v4letab; - return(OK); - case BSIM4v4_MOD_LPCLM: - value->rValue = model->BSIM4v4lpclm; - return(OK); - case BSIM4v4_MOD_LPDIBL1: - value->rValue = model->BSIM4v4lpdibl1; - return(OK); - case BSIM4v4_MOD_LPDIBL2: - value->rValue = model->BSIM4v4lpdibl2; - return(OK); - case BSIM4v4_MOD_LPDIBLB: - value->rValue = model->BSIM4v4lpdiblb; - return(OK); - case BSIM4v4_MOD_LPSCBE1: - value->rValue = model->BSIM4v4lpscbe1; - return(OK); - case BSIM4v4_MOD_LPSCBE2: - value->rValue = model->BSIM4v4lpscbe2; - return(OK); - case BSIM4v4_MOD_LPVAG: - value->rValue = model->BSIM4v4lpvag; - return(OK); - case BSIM4v4_MOD_LWR: - value->rValue = model->BSIM4v4lwr; - return(OK); - case BSIM4v4_MOD_LDWG: - value->rValue = model->BSIM4v4ldwg; - return(OK); - case BSIM4v4_MOD_LDWB: - value->rValue = model->BSIM4v4ldwb; - return(OK); - case BSIM4v4_MOD_LB0: - value->rValue = model->BSIM4v4lb0; - return(OK); - case BSIM4v4_MOD_LB1: - value->rValue = model->BSIM4v4lb1; - return(OK); - case BSIM4v4_MOD_LALPHA0: - value->rValue = model->BSIM4v4lalpha0; - return(OK); - case BSIM4v4_MOD_LALPHA1: - value->rValue = model->BSIM4v4lalpha1; - return(OK); - case BSIM4v4_MOD_LBETA0: - value->rValue = model->BSIM4v4lbeta0; - return(OK); - case BSIM4v4_MOD_LAGIDL: - value->rValue = model->BSIM4v4lagidl; - return(OK); - case BSIM4v4_MOD_LBGIDL: - value->rValue = model->BSIM4v4lbgidl; - return(OK); - case BSIM4v4_MOD_LCGIDL: - value->rValue = model->BSIM4v4lcgidl; - return(OK); - case BSIM4v4_MOD_LEGIDL: - value->rValue = model->BSIM4v4legidl; - return(OK); - case BSIM4v4_MOD_LAIGC: - value->rValue = model->BSIM4v4laigc; - return(OK); - case BSIM4v4_MOD_LBIGC: - value->rValue = model->BSIM4v4lbigc; - return(OK); - case BSIM4v4_MOD_LCIGC: - value->rValue = model->BSIM4v4lcigc; - return(OK); - case BSIM4v4_MOD_LAIGSD: - value->rValue = model->BSIM4v4laigsd; - return(OK); - case BSIM4v4_MOD_LBIGSD: - value->rValue = model->BSIM4v4lbigsd; - return(OK); - case BSIM4v4_MOD_LCIGSD: - value->rValue = model->BSIM4v4lcigsd; - return(OK); - case BSIM4v4_MOD_LAIGBACC: - value->rValue = model->BSIM4v4laigbacc; - return(OK); - case BSIM4v4_MOD_LBIGBACC: - value->rValue = model->BSIM4v4lbigbacc; - return(OK); - case BSIM4v4_MOD_LCIGBACC: - value->rValue = model->BSIM4v4lcigbacc; - return(OK); - case BSIM4v4_MOD_LAIGBINV: - value->rValue = model->BSIM4v4laigbinv; - return(OK); - case BSIM4v4_MOD_LBIGBINV: - value->rValue = model->BSIM4v4lbigbinv; - return(OK); - case BSIM4v4_MOD_LCIGBINV: - value->rValue = model->BSIM4v4lcigbinv; - return(OK); - case BSIM4v4_MOD_LNIGC: - value->rValue = model->BSIM4v4lnigc; - return(OK); - case BSIM4v4_MOD_LNIGBACC: - value->rValue = model->BSIM4v4lnigbacc; - return(OK); - case BSIM4v4_MOD_LNIGBINV: - value->rValue = model->BSIM4v4lnigbinv; - return(OK); - case BSIM4v4_MOD_LNTOX: - value->rValue = model->BSIM4v4lntox; - return(OK); - case BSIM4v4_MOD_LEIGBINV: - value->rValue = model->BSIM4v4leigbinv; - return(OK); - case BSIM4v4_MOD_LPIGCD: - value->rValue = model->BSIM4v4lpigcd; - return(OK); - case BSIM4v4_MOD_LPOXEDGE: - value->rValue = model->BSIM4v4lpoxedge; - return(OK); - case BSIM4v4_MOD_LPHIN: - value->rValue = model->BSIM4v4lphin; - return(OK); - case BSIM4v4_MOD_LXRCRG1: - value->rValue = model->BSIM4v4lxrcrg1; - return(OK); - case BSIM4v4_MOD_LXRCRG2: - value->rValue = model->BSIM4v4lxrcrg2; - return(OK); - case BSIM4v4_MOD_LEU: - value->rValue = model->BSIM4v4leu; - return(OK); - case BSIM4v4_MOD_LVFB: - value->rValue = model->BSIM4v4lvfb; - return(OK); - - case BSIM4v4_MOD_LCGSL: - value->rValue = model->BSIM4v4lcgsl; - return(OK); - case BSIM4v4_MOD_LCGDL: - value->rValue = model->BSIM4v4lcgdl; - return(OK); - case BSIM4v4_MOD_LCKAPPAS: - value->rValue = model->BSIM4v4lckappas; - return(OK); - case BSIM4v4_MOD_LCKAPPAD: - value->rValue = model->BSIM4v4lckappad; - return(OK); - case BSIM4v4_MOD_LCF: - value->rValue = model->BSIM4v4lcf; - return(OK); - case BSIM4v4_MOD_LCLC: - value->rValue = model->BSIM4v4lclc; - return(OK); - case BSIM4v4_MOD_LCLE: - value->rValue = model->BSIM4v4lcle; - return(OK); - case BSIM4v4_MOD_LVFBCV: - value->rValue = model->BSIM4v4lvfbcv; - return(OK); - case BSIM4v4_MOD_LACDE: - value->rValue = model->BSIM4v4lacde; - return(OK); - case BSIM4v4_MOD_LMOIN: - value->rValue = model->BSIM4v4lmoin; - return(OK); - case BSIM4v4_MOD_LNOFF: - value->rValue = model->BSIM4v4lnoff; - return(OK); - case BSIM4v4_MOD_LVOFFCV: - value->rValue = model->BSIM4v4lvoffcv; - return(OK); - - /* Width dependence */ - case BSIM4v4_MOD_WCDSC : - value->rValue = model->BSIM4v4wcdsc; - return(OK); - case BSIM4v4_MOD_WCDSCB : - value->rValue = model->BSIM4v4wcdscb; - return(OK); - case BSIM4v4_MOD_WCDSCD : - value->rValue = model->BSIM4v4wcdscd; - return(OK); - case BSIM4v4_MOD_WCIT : - value->rValue = model->BSIM4v4wcit; - return(OK); - case BSIM4v4_MOD_WNFACTOR : - value->rValue = model->BSIM4v4wnfactor; - return(OK); - case BSIM4v4_MOD_WXJ: - value->rValue = model->BSIM4v4wxj; - return(OK); - case BSIM4v4_MOD_WVSAT: - value->rValue = model->BSIM4v4wvsat; - return(OK); - case BSIM4v4_MOD_WAT: - value->rValue = model->BSIM4v4wat; - return(OK); - case BSIM4v4_MOD_WA0: - value->rValue = model->BSIM4v4wa0; - return(OK); - case BSIM4v4_MOD_WAGS: - value->rValue = model->BSIM4v4wags; - return(OK); - case BSIM4v4_MOD_WA1: - value->rValue = model->BSIM4v4wa1; - return(OK); - case BSIM4v4_MOD_WA2: - value->rValue = model->BSIM4v4wa2; - return(OK); - case BSIM4v4_MOD_WKETA: - value->rValue = model->BSIM4v4wketa; - return(OK); - case BSIM4v4_MOD_WNSUB: - value->rValue = model->BSIM4v4wnsub; - return(OK); - case BSIM4v4_MOD_WNDEP: - value->rValue = model->BSIM4v4wndep; - return(OK); - case BSIM4v4_MOD_WNSD: - value->rValue = model->BSIM4v4wnsd; - return(OK); - case BSIM4v4_MOD_WNGATE: - value->rValue = model->BSIM4v4wngate; - return(OK); - case BSIM4v4_MOD_WGAMMA1: - value->rValue = model->BSIM4v4wgamma1; - return(OK); - case BSIM4v4_MOD_WGAMMA2: - value->rValue = model->BSIM4v4wgamma2; - return(OK); - case BSIM4v4_MOD_WVBX: - value->rValue = model->BSIM4v4wvbx; - return(OK); - case BSIM4v4_MOD_WVBM: - value->rValue = model->BSIM4v4wvbm; - return(OK); - case BSIM4v4_MOD_WXT: - value->rValue = model->BSIM4v4wxt; - return(OK); - case BSIM4v4_MOD_WK1: - value->rValue = model->BSIM4v4wk1; - return(OK); - case BSIM4v4_MOD_WKT1: - value->rValue = model->BSIM4v4wkt1; - return(OK); - case BSIM4v4_MOD_WKT1L: - value->rValue = model->BSIM4v4wkt1l; - return(OK); - case BSIM4v4_MOD_WKT2 : - value->rValue = model->BSIM4v4wkt2; - return(OK); - case BSIM4v4_MOD_WK2 : - value->rValue = model->BSIM4v4wk2; - return(OK); - case BSIM4v4_MOD_WK3: - value->rValue = model->BSIM4v4wk3; - return(OK); - case BSIM4v4_MOD_WK3B: - value->rValue = model->BSIM4v4wk3b; - return(OK); - case BSIM4v4_MOD_WW0: - value->rValue = model->BSIM4v4ww0; - return(OK); - case BSIM4v4_MOD_WLPE0: - value->rValue = model->BSIM4v4wlpe0; - return(OK); - case BSIM4v4_MOD_WDVTP0: - value->rValue = model->BSIM4v4wdvtp0; - return(OK); - case BSIM4v4_MOD_WDVTP1: - value->rValue = model->BSIM4v4wdvtp1; - return(OK); - case BSIM4v4_MOD_WLPEB: - value->rValue = model->BSIM4v4wlpeb; - return(OK); - case BSIM4v4_MOD_WDVT0: - value->rValue = model->BSIM4v4wdvt0; - return(OK); - case BSIM4v4_MOD_WDVT1 : - value->rValue = model->BSIM4v4wdvt1; - return(OK); - case BSIM4v4_MOD_WDVT2 : - value->rValue = model->BSIM4v4wdvt2; - return(OK); - case BSIM4v4_MOD_WDVT0W : - value->rValue = model->BSIM4v4wdvt0w; - return(OK); - case BSIM4v4_MOD_WDVT1W : - value->rValue = model->BSIM4v4wdvt1w; - return(OK); - case BSIM4v4_MOD_WDVT2W : - value->rValue = model->BSIM4v4wdvt2w; - return(OK); - case BSIM4v4_MOD_WDROUT : - value->rValue = model->BSIM4v4wdrout; - return(OK); - case BSIM4v4_MOD_WDSUB : - value->rValue = model->BSIM4v4wdsub; - return(OK); - case BSIM4v4_MOD_WVTH0: - value->rValue = model->BSIM4v4wvth0; - return(OK); - case BSIM4v4_MOD_WUA: - value->rValue = model->BSIM4v4wua; - return(OK); - case BSIM4v4_MOD_WUA1: - value->rValue = model->BSIM4v4wua1; - return(OK); - case BSIM4v4_MOD_WUB: - value->rValue = model->BSIM4v4wub; - return(OK); - case BSIM4v4_MOD_WUB1: - value->rValue = model->BSIM4v4wub1; - return(OK); - case BSIM4v4_MOD_WUC: - value->rValue = model->BSIM4v4wuc; - return(OK); - case BSIM4v4_MOD_WUC1: - value->rValue = model->BSIM4v4wuc1; - return(OK); - case BSIM4v4_MOD_WU0: - value->rValue = model->BSIM4v4wu0; - return(OK); - case BSIM4v4_MOD_WUTE: - value->rValue = model->BSIM4v4wute; - return(OK); - case BSIM4v4_MOD_WVOFF: - value->rValue = model->BSIM4v4wvoff; - return(OK); - case BSIM4v4_MOD_WMINV: - value->rValue = model->BSIM4v4wminv; - return(OK); - case BSIM4v4_MOD_WFPROUT: - value->rValue = model->BSIM4v4wfprout; - return(OK); - case BSIM4v4_MOD_WPDITS: - value->rValue = model->BSIM4v4wpdits; - return(OK); - case BSIM4v4_MOD_WPDITSD: - value->rValue = model->BSIM4v4wpditsd; - return(OK); - case BSIM4v4_MOD_WDELTA: - value->rValue = model->BSIM4v4wdelta; - return(OK); - case BSIM4v4_MOD_WRDSW: - value->rValue = model->BSIM4v4wrdsw; - return(OK); - case BSIM4v4_MOD_WRDW: - value->rValue = model->BSIM4v4wrdw; - return(OK); - case BSIM4v4_MOD_WRSW: - value->rValue = model->BSIM4v4wrsw; - return(OK); - case BSIM4v4_MOD_WPRWB: - value->rValue = model->BSIM4v4wprwb; - return(OK); - case BSIM4v4_MOD_WPRWG: - value->rValue = model->BSIM4v4wprwg; - return(OK); - case BSIM4v4_MOD_WPRT: - value->rValue = model->BSIM4v4wprt; - return(OK); - case BSIM4v4_MOD_WETA0: - value->rValue = model->BSIM4v4weta0; - return(OK); - case BSIM4v4_MOD_WETAB: - value->rValue = model->BSIM4v4wetab; - return(OK); - case BSIM4v4_MOD_WPCLM: - value->rValue = model->BSIM4v4wpclm; - return(OK); - case BSIM4v4_MOD_WPDIBL1: - value->rValue = model->BSIM4v4wpdibl1; - return(OK); - case BSIM4v4_MOD_WPDIBL2: - value->rValue = model->BSIM4v4wpdibl2; - return(OK); - case BSIM4v4_MOD_WPDIBLB: - value->rValue = model->BSIM4v4wpdiblb; - return(OK); - case BSIM4v4_MOD_WPSCBE1: - value->rValue = model->BSIM4v4wpscbe1; - return(OK); - case BSIM4v4_MOD_WPSCBE2: - value->rValue = model->BSIM4v4wpscbe2; - return(OK); - case BSIM4v4_MOD_WPVAG: - value->rValue = model->BSIM4v4wpvag; - return(OK); - case BSIM4v4_MOD_WWR: - value->rValue = model->BSIM4v4wwr; - return(OK); - case BSIM4v4_MOD_WDWG: - value->rValue = model->BSIM4v4wdwg; - return(OK); - case BSIM4v4_MOD_WDWB: - value->rValue = model->BSIM4v4wdwb; - return(OK); - case BSIM4v4_MOD_WB0: - value->rValue = model->BSIM4v4wb0; - return(OK); - case BSIM4v4_MOD_WB1: - value->rValue = model->BSIM4v4wb1; - return(OK); - case BSIM4v4_MOD_WALPHA0: - value->rValue = model->BSIM4v4walpha0; - return(OK); - case BSIM4v4_MOD_WALPHA1: - value->rValue = model->BSIM4v4walpha1; - return(OK); - case BSIM4v4_MOD_WBETA0: - value->rValue = model->BSIM4v4wbeta0; - return(OK); - case BSIM4v4_MOD_WAGIDL: - value->rValue = model->BSIM4v4wagidl; - return(OK); - case BSIM4v4_MOD_WBGIDL: - value->rValue = model->BSIM4v4wbgidl; - return(OK); - case BSIM4v4_MOD_WCGIDL: - value->rValue = model->BSIM4v4wcgidl; - return(OK); - case BSIM4v4_MOD_WEGIDL: - value->rValue = model->BSIM4v4wegidl; - return(OK); - case BSIM4v4_MOD_WAIGC: - value->rValue = model->BSIM4v4waigc; - return(OK); - case BSIM4v4_MOD_WBIGC: - value->rValue = model->BSIM4v4wbigc; - return(OK); - case BSIM4v4_MOD_WCIGC: - value->rValue = model->BSIM4v4wcigc; - return(OK); - case BSIM4v4_MOD_WAIGSD: - value->rValue = model->BSIM4v4waigsd; - return(OK); - case BSIM4v4_MOD_WBIGSD: - value->rValue = model->BSIM4v4wbigsd; - return(OK); - case BSIM4v4_MOD_WCIGSD: - value->rValue = model->BSIM4v4wcigsd; - return(OK); - case BSIM4v4_MOD_WAIGBACC: - value->rValue = model->BSIM4v4waigbacc; - return(OK); - case BSIM4v4_MOD_WBIGBACC: - value->rValue = model->BSIM4v4wbigbacc; - return(OK); - case BSIM4v4_MOD_WCIGBACC: - value->rValue = model->BSIM4v4wcigbacc; - return(OK); - case BSIM4v4_MOD_WAIGBINV: - value->rValue = model->BSIM4v4waigbinv; - return(OK); - case BSIM4v4_MOD_WBIGBINV: - value->rValue = model->BSIM4v4wbigbinv; - return(OK); - case BSIM4v4_MOD_WCIGBINV: - value->rValue = model->BSIM4v4wcigbinv; - return(OK); - case BSIM4v4_MOD_WNIGC: - value->rValue = model->BSIM4v4wnigc; - return(OK); - case BSIM4v4_MOD_WNIGBACC: - value->rValue = model->BSIM4v4wnigbacc; - return(OK); - case BSIM4v4_MOD_WNIGBINV: - value->rValue = model->BSIM4v4wnigbinv; - return(OK); - case BSIM4v4_MOD_WNTOX: - value->rValue = model->BSIM4v4wntox; - return(OK); - case BSIM4v4_MOD_WEIGBINV: - value->rValue = model->BSIM4v4weigbinv; - return(OK); - case BSIM4v4_MOD_WPIGCD: - value->rValue = model->BSIM4v4wpigcd; - return(OK); - case BSIM4v4_MOD_WPOXEDGE: - value->rValue = model->BSIM4v4wpoxedge; - return(OK); - case BSIM4v4_MOD_WPHIN: - value->rValue = model->BSIM4v4wphin; - return(OK); - case BSIM4v4_MOD_WXRCRG1: - value->rValue = model->BSIM4v4wxrcrg1; - return(OK); - case BSIM4v4_MOD_WXRCRG2: - value->rValue = model->BSIM4v4wxrcrg2; - return(OK); - case BSIM4v4_MOD_WEU: - value->rValue = model->BSIM4v4weu; - return(OK); - case BSIM4v4_MOD_WVFB: - value->rValue = model->BSIM4v4wvfb; - return(OK); - - case BSIM4v4_MOD_WCGSL: - value->rValue = model->BSIM4v4wcgsl; - return(OK); - case BSIM4v4_MOD_WCGDL: - value->rValue = model->BSIM4v4wcgdl; - return(OK); - case BSIM4v4_MOD_WCKAPPAS: - value->rValue = model->BSIM4v4wckappas; - return(OK); - case BSIM4v4_MOD_WCKAPPAD: - value->rValue = model->BSIM4v4wckappad; - return(OK); - case BSIM4v4_MOD_WCF: - value->rValue = model->BSIM4v4wcf; - return(OK); - case BSIM4v4_MOD_WCLC: - value->rValue = model->BSIM4v4wclc; - return(OK); - case BSIM4v4_MOD_WCLE: - value->rValue = model->BSIM4v4wcle; - return(OK); - case BSIM4v4_MOD_WVFBCV: - value->rValue = model->BSIM4v4wvfbcv; - return(OK); - case BSIM4v4_MOD_WACDE: - value->rValue = model->BSIM4v4wacde; - return(OK); - case BSIM4v4_MOD_WMOIN: - value->rValue = model->BSIM4v4wmoin; - return(OK); - case BSIM4v4_MOD_WNOFF: - value->rValue = model->BSIM4v4wnoff; - return(OK); - case BSIM4v4_MOD_WVOFFCV: - value->rValue = model->BSIM4v4wvoffcv; - return(OK); - - /* Cross-term dependence */ - case BSIM4v4_MOD_PCDSC : - value->rValue = model->BSIM4v4pcdsc; - return(OK); - case BSIM4v4_MOD_PCDSCB : - value->rValue = model->BSIM4v4pcdscb; - return(OK); - case BSIM4v4_MOD_PCDSCD : - value->rValue = model->BSIM4v4pcdscd; - return(OK); - case BSIM4v4_MOD_PCIT : - value->rValue = model->BSIM4v4pcit; - return(OK); - case BSIM4v4_MOD_PNFACTOR : - value->rValue = model->BSIM4v4pnfactor; - return(OK); - case BSIM4v4_MOD_PXJ: - value->rValue = model->BSIM4v4pxj; - return(OK); - case BSIM4v4_MOD_PVSAT: - value->rValue = model->BSIM4v4pvsat; - return(OK); - case BSIM4v4_MOD_PAT: - value->rValue = model->BSIM4v4pat; - return(OK); - case BSIM4v4_MOD_PA0: - value->rValue = model->BSIM4v4pa0; - return(OK); - case BSIM4v4_MOD_PAGS: - value->rValue = model->BSIM4v4pags; - return(OK); - case BSIM4v4_MOD_PA1: - value->rValue = model->BSIM4v4pa1; - return(OK); - case BSIM4v4_MOD_PA2: - value->rValue = model->BSIM4v4pa2; - return(OK); - case BSIM4v4_MOD_PKETA: - value->rValue = model->BSIM4v4pketa; - return(OK); - case BSIM4v4_MOD_PNSUB: - value->rValue = model->BSIM4v4pnsub; - return(OK); - case BSIM4v4_MOD_PNDEP: - value->rValue = model->BSIM4v4pndep; - return(OK); - case BSIM4v4_MOD_PNSD: - value->rValue = model->BSIM4v4pnsd; - return(OK); - case BSIM4v4_MOD_PNGATE: - value->rValue = model->BSIM4v4pngate; - return(OK); - case BSIM4v4_MOD_PGAMMA1: - value->rValue = model->BSIM4v4pgamma1; - return(OK); - case BSIM4v4_MOD_PGAMMA2: - value->rValue = model->BSIM4v4pgamma2; - return(OK); - case BSIM4v4_MOD_PVBX: - value->rValue = model->BSIM4v4pvbx; - return(OK); - case BSIM4v4_MOD_PVBM: - value->rValue = model->BSIM4v4pvbm; - return(OK); - case BSIM4v4_MOD_PXT: - value->rValue = model->BSIM4v4pxt; - return(OK); - case BSIM4v4_MOD_PK1: - value->rValue = model->BSIM4v4pk1; - return(OK); - case BSIM4v4_MOD_PKT1: - value->rValue = model->BSIM4v4pkt1; - return(OK); - case BSIM4v4_MOD_PKT1L: - value->rValue = model->BSIM4v4pkt1l; - return(OK); - case BSIM4v4_MOD_PKT2 : - value->rValue = model->BSIM4v4pkt2; - return(OK); - case BSIM4v4_MOD_PK2 : - value->rValue = model->BSIM4v4pk2; - return(OK); - case BSIM4v4_MOD_PK3: - value->rValue = model->BSIM4v4pk3; - return(OK); - case BSIM4v4_MOD_PK3B: - value->rValue = model->BSIM4v4pk3b; - return(OK); - case BSIM4v4_MOD_PW0: - value->rValue = model->BSIM4v4pw0; - return(OK); - case BSIM4v4_MOD_PLPE0: - value->rValue = model->BSIM4v4plpe0; - return(OK); - case BSIM4v4_MOD_PLPEB: - value->rValue = model->BSIM4v4plpeb; - return(OK); - case BSIM4v4_MOD_PDVTP0: - value->rValue = model->BSIM4v4pdvtp0; - return(OK); - case BSIM4v4_MOD_PDVTP1: - value->rValue = model->BSIM4v4pdvtp1; - return(OK); - case BSIM4v4_MOD_PDVT0 : - value->rValue = model->BSIM4v4pdvt0; - return(OK); - case BSIM4v4_MOD_PDVT1 : - value->rValue = model->BSIM4v4pdvt1; - return(OK); - case BSIM4v4_MOD_PDVT2 : - value->rValue = model->BSIM4v4pdvt2; - return(OK); - case BSIM4v4_MOD_PDVT0W : - value->rValue = model->BSIM4v4pdvt0w; - return(OK); - case BSIM4v4_MOD_PDVT1W : - value->rValue = model->BSIM4v4pdvt1w; - return(OK); - case BSIM4v4_MOD_PDVT2W : - value->rValue = model->BSIM4v4pdvt2w; - return(OK); - case BSIM4v4_MOD_PDROUT : - value->rValue = model->BSIM4v4pdrout; - return(OK); - case BSIM4v4_MOD_PDSUB : - value->rValue = model->BSIM4v4pdsub; - return(OK); - case BSIM4v4_MOD_PVTH0: - value->rValue = model->BSIM4v4pvth0; - return(OK); - case BSIM4v4_MOD_PUA: - value->rValue = model->BSIM4v4pua; - return(OK); - case BSIM4v4_MOD_PUA1: - value->rValue = model->BSIM4v4pua1; - return(OK); - case BSIM4v4_MOD_PUB: - value->rValue = model->BSIM4v4pub; - return(OK); - case BSIM4v4_MOD_PUB1: - value->rValue = model->BSIM4v4pub1; - return(OK); - case BSIM4v4_MOD_PUC: - value->rValue = model->BSIM4v4puc; - return(OK); - case BSIM4v4_MOD_PUC1: - value->rValue = model->BSIM4v4puc1; - return(OK); - case BSIM4v4_MOD_PU0: - value->rValue = model->BSIM4v4pu0; - return(OK); - case BSIM4v4_MOD_PUTE: - value->rValue = model->BSIM4v4pute; - return(OK); - case BSIM4v4_MOD_PVOFF: - value->rValue = model->BSIM4v4pvoff; - return(OK); - case BSIM4v4_MOD_PMINV: - value->rValue = model->BSIM4v4pminv; - return(OK); - case BSIM4v4_MOD_PFPROUT: - value->rValue = model->BSIM4v4pfprout; - return(OK); - case BSIM4v4_MOD_PPDITS: - value->rValue = model->BSIM4v4ppdits; - return(OK); - case BSIM4v4_MOD_PPDITSD: - value->rValue = model->BSIM4v4ppditsd; - return(OK); - case BSIM4v4_MOD_PDELTA: - value->rValue = model->BSIM4v4pdelta; - return(OK); - case BSIM4v4_MOD_PRDSW: - value->rValue = model->BSIM4v4prdsw; - return(OK); - case BSIM4v4_MOD_PRDW: - value->rValue = model->BSIM4v4prdw; - return(OK); - case BSIM4v4_MOD_PRSW: - value->rValue = model->BSIM4v4prsw; - return(OK); - case BSIM4v4_MOD_PPRWB: - value->rValue = model->BSIM4v4pprwb; - return(OK); - case BSIM4v4_MOD_PPRWG: - value->rValue = model->BSIM4v4pprwg; - return(OK); - case BSIM4v4_MOD_PPRT: - value->rValue = model->BSIM4v4pprt; - return(OK); - case BSIM4v4_MOD_PETA0: - value->rValue = model->BSIM4v4peta0; - return(OK); - case BSIM4v4_MOD_PETAB: - value->rValue = model->BSIM4v4petab; - return(OK); - case BSIM4v4_MOD_PPCLM: - value->rValue = model->BSIM4v4ppclm; - return(OK); - case BSIM4v4_MOD_PPDIBL1: - value->rValue = model->BSIM4v4ppdibl1; - return(OK); - case BSIM4v4_MOD_PPDIBL2: - value->rValue = model->BSIM4v4ppdibl2; - return(OK); - case BSIM4v4_MOD_PPDIBLB: - value->rValue = model->BSIM4v4ppdiblb; - return(OK); - case BSIM4v4_MOD_PPSCBE1: - value->rValue = model->BSIM4v4ppscbe1; - return(OK); - case BSIM4v4_MOD_PPSCBE2: - value->rValue = model->BSIM4v4ppscbe2; - return(OK); - case BSIM4v4_MOD_PPVAG: - value->rValue = model->BSIM4v4ppvag; - return(OK); - case BSIM4v4_MOD_PWR: - value->rValue = model->BSIM4v4pwr; - return(OK); - case BSIM4v4_MOD_PDWG: - value->rValue = model->BSIM4v4pdwg; - return(OK); - case BSIM4v4_MOD_PDWB: - value->rValue = model->BSIM4v4pdwb; - return(OK); - case BSIM4v4_MOD_PB0: - value->rValue = model->BSIM4v4pb0; - return(OK); - case BSIM4v4_MOD_PB1: - value->rValue = model->BSIM4v4pb1; - return(OK); - case BSIM4v4_MOD_PALPHA0: - value->rValue = model->BSIM4v4palpha0; - return(OK); - case BSIM4v4_MOD_PALPHA1: - value->rValue = model->BSIM4v4palpha1; - return(OK); - case BSIM4v4_MOD_PBETA0: - value->rValue = model->BSIM4v4pbeta0; - return(OK); - case BSIM4v4_MOD_PAGIDL: - value->rValue = model->BSIM4v4pagidl; - return(OK); - case BSIM4v4_MOD_PBGIDL: - value->rValue = model->BSIM4v4pbgidl; - return(OK); - case BSIM4v4_MOD_PCGIDL: - value->rValue = model->BSIM4v4pcgidl; - return(OK); - case BSIM4v4_MOD_PEGIDL: - value->rValue = model->BSIM4v4pegidl; - return(OK); - case BSIM4v4_MOD_PAIGC: - value->rValue = model->BSIM4v4paigc; - return(OK); - case BSIM4v4_MOD_PBIGC: - value->rValue = model->BSIM4v4pbigc; - return(OK); - case BSIM4v4_MOD_PCIGC: - value->rValue = model->BSIM4v4pcigc; - return(OK); - case BSIM4v4_MOD_PAIGSD: - value->rValue = model->BSIM4v4paigsd; - return(OK); - case BSIM4v4_MOD_PBIGSD: - value->rValue = model->BSIM4v4pbigsd; - return(OK); - case BSIM4v4_MOD_PCIGSD: - value->rValue = model->BSIM4v4pcigsd; - return(OK); - case BSIM4v4_MOD_PAIGBACC: - value->rValue = model->BSIM4v4paigbacc; - return(OK); - case BSIM4v4_MOD_PBIGBACC: - value->rValue = model->BSIM4v4pbigbacc; - return(OK); - case BSIM4v4_MOD_PCIGBACC: - value->rValue = model->BSIM4v4pcigbacc; - return(OK); - case BSIM4v4_MOD_PAIGBINV: - value->rValue = model->BSIM4v4paigbinv; - return(OK); - case BSIM4v4_MOD_PBIGBINV: - value->rValue = model->BSIM4v4pbigbinv; - return(OK); - case BSIM4v4_MOD_PCIGBINV: - value->rValue = model->BSIM4v4pcigbinv; - return(OK); - case BSIM4v4_MOD_PNIGC: - value->rValue = model->BSIM4v4pnigc; - return(OK); - case BSIM4v4_MOD_PNIGBACC: - value->rValue = model->BSIM4v4pnigbacc; - return(OK); - case BSIM4v4_MOD_PNIGBINV: - value->rValue = model->BSIM4v4pnigbinv; - return(OK); - case BSIM4v4_MOD_PNTOX: - value->rValue = model->BSIM4v4pntox; - return(OK); - case BSIM4v4_MOD_PEIGBINV: - value->rValue = model->BSIM4v4peigbinv; - return(OK); - case BSIM4v4_MOD_PPIGCD: - value->rValue = model->BSIM4v4ppigcd; - return(OK); - case BSIM4v4_MOD_PPOXEDGE: - value->rValue = model->BSIM4v4ppoxedge; - return(OK); - case BSIM4v4_MOD_PPHIN: - value->rValue = model->BSIM4v4pphin; - return(OK); - case BSIM4v4_MOD_PXRCRG1: - value->rValue = model->BSIM4v4pxrcrg1; - return(OK); - case BSIM4v4_MOD_PXRCRG2: - value->rValue = model->BSIM4v4pxrcrg2; - return(OK); - case BSIM4v4_MOD_PEU: - value->rValue = model->BSIM4v4peu; - return(OK); - case BSIM4v4_MOD_PVFB: - value->rValue = model->BSIM4v4pvfb; - return(OK); - - case BSIM4v4_MOD_PCGSL: - value->rValue = model->BSIM4v4pcgsl; - return(OK); - case BSIM4v4_MOD_PCGDL: - value->rValue = model->BSIM4v4pcgdl; - return(OK); - case BSIM4v4_MOD_PCKAPPAS: - value->rValue = model->BSIM4v4pckappas; - return(OK); - case BSIM4v4_MOD_PCKAPPAD: - value->rValue = model->BSIM4v4pckappad; - return(OK); - case BSIM4v4_MOD_PCF: - value->rValue = model->BSIM4v4pcf; - return(OK); - case BSIM4v4_MOD_PCLC: - value->rValue = model->BSIM4v4pclc; - return(OK); - case BSIM4v4_MOD_PCLE: - value->rValue = model->BSIM4v4pcle; - return(OK); - case BSIM4v4_MOD_PVFBCV: - value->rValue = model->BSIM4v4pvfbcv; - return(OK); - case BSIM4v4_MOD_PACDE: - value->rValue = model->BSIM4v4pacde; - return(OK); - case BSIM4v4_MOD_PMOIN: - value->rValue = model->BSIM4v4pmoin; - return(OK); - case BSIM4v4_MOD_PNOFF: - value->rValue = model->BSIM4v4pnoff; - return(OK); - case BSIM4v4_MOD_PVOFFCV: - value->rValue = model->BSIM4v4pvoffcv; - return(OK); - - case BSIM4v4_MOD_TNOM : - value->rValue = model->BSIM4v4tnom; - return(OK); - case BSIM4v4_MOD_CGSO: - value->rValue = model->BSIM4v4cgso; - return(OK); - case BSIM4v4_MOD_CGDO: - value->rValue = model->BSIM4v4cgdo; - return(OK); - case BSIM4v4_MOD_CGBO: - value->rValue = model->BSIM4v4cgbo; - return(OK); - case BSIM4v4_MOD_XPART: - value->rValue = model->BSIM4v4xpart; - return(OK); - case BSIM4v4_MOD_RSH: - value->rValue = model->BSIM4v4sheetResistance; - return(OK); - case BSIM4v4_MOD_JSS: - value->rValue = model->BSIM4v4SjctSatCurDensity; - return(OK); - case BSIM4v4_MOD_JSWS: - value->rValue = model->BSIM4v4SjctSidewallSatCurDensity; - return(OK); - case BSIM4v4_MOD_JSWGS: - value->rValue = model->BSIM4v4SjctGateSidewallSatCurDensity; - return(OK); - case BSIM4v4_MOD_PBS: - value->rValue = model->BSIM4v4SbulkJctPotential; - return(OK); - case BSIM4v4_MOD_MJS: - value->rValue = model->BSIM4v4SbulkJctBotGradingCoeff; - return(OK); - case BSIM4v4_MOD_PBSWS: - value->rValue = model->BSIM4v4SsidewallJctPotential; - return(OK); - case BSIM4v4_MOD_MJSWS: - value->rValue = model->BSIM4v4SbulkJctSideGradingCoeff; - return(OK); - case BSIM4v4_MOD_CJS: - value->rValue = model->BSIM4v4SunitAreaJctCap; - return(OK); - case BSIM4v4_MOD_CJSWS: - value->rValue = model->BSIM4v4SunitLengthSidewallJctCap; - return(OK); - case BSIM4v4_MOD_PBSWGS: - value->rValue = model->BSIM4v4SGatesidewallJctPotential; - return(OK); - case BSIM4v4_MOD_MJSWGS: - value->rValue = model->BSIM4v4SbulkJctGateSideGradingCoeff; - return(OK); - case BSIM4v4_MOD_CJSWGS: - value->rValue = model->BSIM4v4SunitLengthGateSidewallJctCap; - return(OK); - case BSIM4v4_MOD_NJS: - value->rValue = model->BSIM4v4SjctEmissionCoeff; - return(OK); - case BSIM4v4_MOD_XTIS: - value->rValue = model->BSIM4v4SjctTempExponent; - return(OK); - case BSIM4v4_MOD_JSD: - value->rValue = model->BSIM4v4DjctSatCurDensity; - return(OK); - case BSIM4v4_MOD_JSWD: - value->rValue = model->BSIM4v4DjctSidewallSatCurDensity; - return(OK); - case BSIM4v4_MOD_JSWGD: - value->rValue = model->BSIM4v4DjctGateSidewallSatCurDensity; - return(OK); - case BSIM4v4_MOD_PBD: - value->rValue = model->BSIM4v4DbulkJctPotential; - return(OK); - case BSIM4v4_MOD_MJD: - value->rValue = model->BSIM4v4DbulkJctBotGradingCoeff; - return(OK); - case BSIM4v4_MOD_PBSWD: - value->rValue = model->BSIM4v4DsidewallJctPotential; - return(OK); - case BSIM4v4_MOD_MJSWD: - value->rValue = model->BSIM4v4DbulkJctSideGradingCoeff; - return(OK); - case BSIM4v4_MOD_CJD: - value->rValue = model->BSIM4v4DunitAreaJctCap; - return(OK); - case BSIM4v4_MOD_CJSWD: - value->rValue = model->BSIM4v4DunitLengthSidewallJctCap; - return(OK); - case BSIM4v4_MOD_PBSWGD: - value->rValue = model->BSIM4v4DGatesidewallJctPotential; - return(OK); - case BSIM4v4_MOD_MJSWGD: - value->rValue = model->BSIM4v4DbulkJctGateSideGradingCoeff; - return(OK); - case BSIM4v4_MOD_CJSWGD: - value->rValue = model->BSIM4v4DunitLengthGateSidewallJctCap; - return(OK); - case BSIM4v4_MOD_NJD: - value->rValue = model->BSIM4v4DjctEmissionCoeff; - return(OK); - case BSIM4v4_MOD_XTID: - value->rValue = model->BSIM4v4DjctTempExponent; - return(OK); - case BSIM4v4_MOD_LINT: - value->rValue = model->BSIM4v4Lint; - return(OK); - case BSIM4v4_MOD_LL: - value->rValue = model->BSIM4v4Ll; - return(OK); - case BSIM4v4_MOD_LLC: - value->rValue = model->BSIM4v4Llc; - return(OK); - case BSIM4v4_MOD_LLN: - value->rValue = model->BSIM4v4Lln; - return(OK); - case BSIM4v4_MOD_LW: - value->rValue = model->BSIM4v4Lw; - return(OK); - case BSIM4v4_MOD_LWC: - value->rValue = model->BSIM4v4Lwc; - return(OK); - case BSIM4v4_MOD_LWN: - value->rValue = model->BSIM4v4Lwn; - return(OK); - case BSIM4v4_MOD_LWL: - value->rValue = model->BSIM4v4Lwl; - return(OK); - case BSIM4v4_MOD_LWLC: - value->rValue = model->BSIM4v4Lwlc; - return(OK); - case BSIM4v4_MOD_LMIN: - value->rValue = model->BSIM4v4Lmin; - return(OK); - case BSIM4v4_MOD_LMAX: - value->rValue = model->BSIM4v4Lmax; - return(OK); - case BSIM4v4_MOD_WINT: - value->rValue = model->BSIM4v4Wint; - return(OK); - case BSIM4v4_MOD_WL: - value->rValue = model->BSIM4v4Wl; - return(OK); - case BSIM4v4_MOD_WLC: - value->rValue = model->BSIM4v4Wlc; - return(OK); - case BSIM4v4_MOD_WLN: - value->rValue = model->BSIM4v4Wln; - return(OK); - case BSIM4v4_MOD_WW: - value->rValue = model->BSIM4v4Ww; - return(OK); - case BSIM4v4_MOD_WWC: - value->rValue = model->BSIM4v4Wwc; - return(OK); - case BSIM4v4_MOD_WWN: - value->rValue = model->BSIM4v4Wwn; - return(OK); - case BSIM4v4_MOD_WWL: - value->rValue = model->BSIM4v4Wwl; - return(OK); - case BSIM4v4_MOD_WWLC: - value->rValue = model->BSIM4v4Wwlc; - return(OK); - case BSIM4v4_MOD_WMIN: - value->rValue = model->BSIM4v4Wmin; - return(OK); - case BSIM4v4_MOD_WMAX: - value->rValue = model->BSIM4v4Wmax; - return(OK); - - /* stress effect */ - case BSIM4v4_MOD_SAREF: - value->rValue = model->BSIM4v4saref; - return(OK); - case BSIM4v4_MOD_SBREF: - value->rValue = model->BSIM4v4sbref; - return(OK); - case BSIM4v4_MOD_WLOD: - value->rValue = model->BSIM4v4wlod; - return(OK); - case BSIM4v4_MOD_KU0: - value->rValue = model->BSIM4v4ku0; - return(OK); - case BSIM4v4_MOD_KVSAT: - value->rValue = model->BSIM4v4kvsat; - return(OK); - case BSIM4v4_MOD_KVTH0: - value->rValue = model->BSIM4v4kvth0; - return(OK); - case BSIM4v4_MOD_TKU0: - value->rValue = model->BSIM4v4tku0; - return(OK); - case BSIM4v4_MOD_LLODKU0: - value->rValue = model->BSIM4v4llodku0; - return(OK); - case BSIM4v4_MOD_WLODKU0: - value->rValue = model->BSIM4v4wlodku0; - return(OK); - case BSIM4v4_MOD_LLODVTH: - value->rValue = model->BSIM4v4llodvth; - return(OK); - case BSIM4v4_MOD_WLODVTH: - value->rValue = model->BSIM4v4wlodvth; - return(OK); - case BSIM4v4_MOD_LKU0: - value->rValue = model->BSIM4v4lku0; - return(OK); - case BSIM4v4_MOD_WKU0: - value->rValue = model->BSIM4v4wku0; - return(OK); - case BSIM4v4_MOD_PKU0: - value->rValue = model->BSIM4v4pku0; - return(OK); - case BSIM4v4_MOD_LKVTH0: - value->rValue = model->BSIM4v4lkvth0; - return(OK); - case BSIM4v4_MOD_WKVTH0: - value->rValue = model->BSIM4v4wkvth0; - return(OK); - case BSIM4v4_MOD_PKVTH0: - value->rValue = model->BSIM4v4pkvth0; - return(OK); - case BSIM4v4_MOD_STK2: - value->rValue = model->BSIM4v4stk2; - return(OK); - case BSIM4v4_MOD_LODK2: - value->rValue = model->BSIM4v4lodk2; - return(OK); - case BSIM4v4_MOD_STETA0: - value->rValue = model->BSIM4v4steta0; - return(OK); - case BSIM4v4_MOD_LODETA0: - value->rValue = model->BSIM4v4lodeta0; - return(OK); - - case BSIM4v4_MOD_NOIA: - value->rValue = model->BSIM4v4oxideTrapDensityA; - return(OK); - case BSIM4v4_MOD_NOIB: - value->rValue = model->BSIM4v4oxideTrapDensityB; - return(OK); - case BSIM4v4_MOD_NOIC: - value->rValue = model->BSIM4v4oxideTrapDensityC; - return(OK); - case BSIM4v4_MOD_EM: - value->rValue = model->BSIM4v4em; - return(OK); - case BSIM4v4_MOD_EF: - value->rValue = model->BSIM4v4ef; - return(OK); - case BSIM4v4_MOD_AF: - value->rValue = model->BSIM4v4af; - return(OK); - case BSIM4v4_MOD_KF: - value->rValue = model->BSIM4v4kf; - return(OK); - default: - return(E_BADPARM); - } - /* NOTREACHED */ -} - - - diff --git a/src/spicelib/devices/bsim4v4/b4v4mdel.c b/src/spicelib/devices/bsim4v4/b4v4mdel.c deleted file mode 100644 index 58bb7ba79..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4mdel.c +++ /dev/null @@ -1,46 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4mdel.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - -int -BSIM4v4mDelete( -GENmodel **inModel, -IFuid modname, -GENmodel *kill) -{ -BSIM4v4model **model = (BSIM4v4model**)inModel; -BSIM4v4model *modfast = (BSIM4v4model*)kill; -BSIM4v4instance *here; -BSIM4v4instance *prev = NULL; -BSIM4v4model **oldmod; - - oldmod = model; - for (; *model ; model = &((*model)->BSIM4v4nextModel)) - { if ((*model)->BSIM4v4modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - return(E_NOMOD); - -delgot: - *oldmod = (*model)->BSIM4v4nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM4v4instances; here; here = here->BSIM4v4nextInstance) - { if(prev) FREE(prev); - prev = here; - } - if(prev) FREE(prev); - FREE(*model); - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4mpar.c b/src/spicelib/devices/bsim4v4/b4v4mpar.c deleted file mode 100644 index f508d180c..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4mpar.c +++ /dev/null @@ -1,2802 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ -/* ngspice multirevision code extension covering 4.2.1 & 4.3.0 & 4.4.0 */ -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4mpar.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 03/04/2004. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v4def.h" -#include "ngspice/ifsim.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" -#include "ngspice/const.h" - -int -BSIM4v4mParam( -int param, -IFvalue *value, -GENmodel *inMod) -{ - BSIM4v4model *mod = (BSIM4v4model*)inMod; - switch(param) - { case BSIM4v4_MOD_MOBMOD : - mod->BSIM4v4mobMod = value->iValue; - mod->BSIM4v4mobModGiven = TRUE; - break; - case BSIM4v4_MOD_BINUNIT : - mod->BSIM4v4binUnit = value->iValue; - mod->BSIM4v4binUnitGiven = TRUE; - break; - case BSIM4v4_MOD_PARAMCHK : - mod->BSIM4v4paramChk = value->iValue; - mod->BSIM4v4paramChkGiven = TRUE; - break; - case BSIM4v4_MOD_CAPMOD : - mod->BSIM4v4capMod = value->iValue; - mod->BSIM4v4capModGiven = TRUE; - break; - case BSIM4v4_MOD_DIOMOD : - mod->BSIM4v4dioMod = value->iValue; - mod->BSIM4v4dioModGiven = TRUE; - break; - case BSIM4v4_MOD_RDSMOD : - mod->BSIM4v4rdsMod = value->iValue; - mod->BSIM4v4rdsModGiven = TRUE; - break; - case BSIM4v4_MOD_TRNQSMOD : - mod->BSIM4v4trnqsMod = value->iValue; - mod->BSIM4v4trnqsModGiven = TRUE; - break; - case BSIM4v4_MOD_ACNQSMOD : - mod->BSIM4v4acnqsMod = value->iValue; - mod->BSIM4v4acnqsModGiven = TRUE; - break; - case BSIM4v4_MOD_RBODYMOD : - mod->BSIM4v4rbodyMod = value->iValue; - mod->BSIM4v4rbodyModGiven = TRUE; - break; - case BSIM4v4_MOD_RGATEMOD : - mod->BSIM4v4rgateMod = value->iValue; - mod->BSIM4v4rgateModGiven = TRUE; - break; - case BSIM4v4_MOD_PERMOD : - mod->BSIM4v4perMod = value->iValue; - mod->BSIM4v4perModGiven = TRUE; - break; - case BSIM4v4_MOD_GEOMOD : - mod->BSIM4v4geoMod = value->iValue; - mod->BSIM4v4geoModGiven = TRUE; - break; - case BSIM4v4_MOD_FNOIMOD : - mod->BSIM4v4fnoiMod = value->iValue; - mod->BSIM4v4fnoiModGiven = TRUE; - break; - case BSIM4v4_MOD_TNOIMOD : - mod->BSIM4v4tnoiMod = value->iValue; - mod->BSIM4v4tnoiModGiven = TRUE; - break; - case BSIM4v4_MOD_IGCMOD : - mod->BSIM4v4igcMod = value->iValue; - mod->BSIM4v4igcModGiven = TRUE; - break; - case BSIM4v4_MOD_IGBMOD : - mod->BSIM4v4igbMod = value->iValue; - mod->BSIM4v4igbModGiven = TRUE; - break; - case BSIM4v4_MOD_TEMPMOD : - mod->BSIM4v4tempMod = value->iValue; - mod->BSIM4v4tempModGiven = TRUE; - break; - case BSIM4v4_MOD_VERSION : - mod->BSIM4v4version = value->sValue; - mod->BSIM4v4versionGiven = TRUE; - break; - case BSIM4v4_MOD_TOXREF : - mod->BSIM4v4toxref = value->rValue; - mod->BSIM4v4toxrefGiven = TRUE; - break; - case BSIM4v4_MOD_TOXE : - mod->BSIM4v4toxe = value->rValue; - mod->BSIM4v4toxeGiven = TRUE; - break; - case BSIM4v4_MOD_TOXP : - mod->BSIM4v4toxp = value->rValue; - mod->BSIM4v4toxpGiven = TRUE; - break; - case BSIM4v4_MOD_TOXM : - mod->BSIM4v4toxm = value->rValue; - mod->BSIM4v4toxmGiven = TRUE; - break; - case BSIM4v4_MOD_DTOX : - mod->BSIM4v4dtox = value->rValue; - mod->BSIM4v4dtoxGiven = TRUE; - break; - case BSIM4v4_MOD_EPSROX : - mod->BSIM4v4epsrox = value->rValue; - mod->BSIM4v4epsroxGiven = TRUE; - break; - - case BSIM4v4_MOD_CDSC : - mod->BSIM4v4cdsc = value->rValue; - mod->BSIM4v4cdscGiven = TRUE; - break; - case BSIM4v4_MOD_CDSCB : - mod->BSIM4v4cdscb = value->rValue; - mod->BSIM4v4cdscbGiven = TRUE; - break; - - case BSIM4v4_MOD_CDSCD : - mod->BSIM4v4cdscd = value->rValue; - mod->BSIM4v4cdscdGiven = TRUE; - break; - - case BSIM4v4_MOD_CIT : - mod->BSIM4v4cit = value->rValue; - mod->BSIM4v4citGiven = TRUE; - break; - case BSIM4v4_MOD_NFACTOR : - mod->BSIM4v4nfactor = value->rValue; - mod->BSIM4v4nfactorGiven = TRUE; - break; - case BSIM4v4_MOD_XJ: - mod->BSIM4v4xj = value->rValue; - mod->BSIM4v4xjGiven = TRUE; - break; - case BSIM4v4_MOD_VSAT: - mod->BSIM4v4vsat = value->rValue; - mod->BSIM4v4vsatGiven = TRUE; - break; - case BSIM4v4_MOD_A0: - mod->BSIM4v4a0 = value->rValue; - mod->BSIM4v4a0Given = TRUE; - break; - - case BSIM4v4_MOD_AGS: - mod->BSIM4v4ags= value->rValue; - mod->BSIM4v4agsGiven = TRUE; - break; - - case BSIM4v4_MOD_A1: - mod->BSIM4v4a1 = value->rValue; - mod->BSIM4v4a1Given = TRUE; - break; - case BSIM4v4_MOD_A2: - mod->BSIM4v4a2 = value->rValue; - mod->BSIM4v4a2Given = TRUE; - break; - case BSIM4v4_MOD_AT: - mod->BSIM4v4at = value->rValue; - mod->BSIM4v4atGiven = TRUE; - break; - case BSIM4v4_MOD_KETA: - mod->BSIM4v4keta = value->rValue; - mod->BSIM4v4ketaGiven = TRUE; - break; - case BSIM4v4_MOD_NSUB: - mod->BSIM4v4nsub = value->rValue; - mod->BSIM4v4nsubGiven = TRUE; - break; - case BSIM4v4_MOD_NDEP: - mod->BSIM4v4ndep = value->rValue; - mod->BSIM4v4ndepGiven = TRUE; - if (mod->BSIM4v4ndep > 1.0e20) - mod->BSIM4v4ndep *= 1.0e-6; - break; - case BSIM4v4_MOD_NSD: - mod->BSIM4v4nsd = value->rValue; - mod->BSIM4v4nsdGiven = TRUE; - if (mod->BSIM4v4nsd > 1.0e23) - mod->BSIM4v4nsd *= 1.0e-6; - break; - case BSIM4v4_MOD_NGATE: - mod->BSIM4v4ngate = value->rValue; - mod->BSIM4v4ngateGiven = TRUE; - if (mod->BSIM4v4ngate > 1.0e23) - mod->BSIM4v4ngate *= 1.0e-6; - break; - case BSIM4v4_MOD_GAMMA1: - mod->BSIM4v4gamma1 = value->rValue; - mod->BSIM4v4gamma1Given = TRUE; - break; - case BSIM4v4_MOD_GAMMA2: - mod->BSIM4v4gamma2 = value->rValue; - mod->BSIM4v4gamma2Given = TRUE; - break; - case BSIM4v4_MOD_VBX: - mod->BSIM4v4vbx = value->rValue; - mod->BSIM4v4vbxGiven = TRUE; - break; - case BSIM4v4_MOD_VBM: - mod->BSIM4v4vbm = value->rValue; - mod->BSIM4v4vbmGiven = TRUE; - break; - case BSIM4v4_MOD_XT: - mod->BSIM4v4xt = value->rValue; - mod->BSIM4v4xtGiven = TRUE; - break; - case BSIM4v4_MOD_K1: - mod->BSIM4v4k1 = value->rValue; - mod->BSIM4v4k1Given = TRUE; - break; - case BSIM4v4_MOD_KT1: - mod->BSIM4v4kt1 = value->rValue; - mod->BSIM4v4kt1Given = TRUE; - break; - case BSIM4v4_MOD_KT1L: - mod->BSIM4v4kt1l = value->rValue; - mod->BSIM4v4kt1lGiven = TRUE; - break; - case BSIM4v4_MOD_KT2: - mod->BSIM4v4kt2 = value->rValue; - mod->BSIM4v4kt2Given = TRUE; - break; - case BSIM4v4_MOD_K2: - mod->BSIM4v4k2 = value->rValue; - mod->BSIM4v4k2Given = TRUE; - break; - case BSIM4v4_MOD_K3: - mod->BSIM4v4k3 = value->rValue; - mod->BSIM4v4k3Given = TRUE; - break; - case BSIM4v4_MOD_K3B: - mod->BSIM4v4k3b = value->rValue; - mod->BSIM4v4k3bGiven = TRUE; - break; - case BSIM4v4_MOD_LPE0: - mod->BSIM4v4lpe0 = value->rValue; - mod->BSIM4v4lpe0Given = TRUE; - break; - case BSIM4v4_MOD_LPEB: - mod->BSIM4v4lpeb = value->rValue; - mod->BSIM4v4lpebGiven = TRUE; - break; - case BSIM4v4_MOD_DVTP0: - mod->BSIM4v4dvtp0 = value->rValue; - mod->BSIM4v4dvtp0Given = TRUE; - break; - case BSIM4v4_MOD_DVTP1: - mod->BSIM4v4dvtp1 = value->rValue; - mod->BSIM4v4dvtp1Given = TRUE; - break; - case BSIM4v4_MOD_W0: - mod->BSIM4v4w0 = value->rValue; - mod->BSIM4v4w0Given = TRUE; - break; - case BSIM4v4_MOD_DVT0: - mod->BSIM4v4dvt0 = value->rValue; - mod->BSIM4v4dvt0Given = TRUE; - break; - case BSIM4v4_MOD_DVT1: - mod->BSIM4v4dvt1 = value->rValue; - mod->BSIM4v4dvt1Given = TRUE; - break; - case BSIM4v4_MOD_DVT2: - mod->BSIM4v4dvt2 = value->rValue; - mod->BSIM4v4dvt2Given = TRUE; - break; - case BSIM4v4_MOD_DVT0W: - mod->BSIM4v4dvt0w = value->rValue; - mod->BSIM4v4dvt0wGiven = TRUE; - break; - case BSIM4v4_MOD_DVT1W: - mod->BSIM4v4dvt1w = value->rValue; - mod->BSIM4v4dvt1wGiven = TRUE; - break; - case BSIM4v4_MOD_DVT2W: - mod->BSIM4v4dvt2w = value->rValue; - mod->BSIM4v4dvt2wGiven = TRUE; - break; - case BSIM4v4_MOD_DROUT: - mod->BSIM4v4drout = value->rValue; - mod->BSIM4v4droutGiven = TRUE; - break; - case BSIM4v4_MOD_DSUB: - mod->BSIM4v4dsub = value->rValue; - mod->BSIM4v4dsubGiven = TRUE; - break; - case BSIM4v4_MOD_VTH0: - mod->BSIM4v4vth0 = value->rValue; - mod->BSIM4v4vth0Given = TRUE; - break; - case BSIM4v4_MOD_EU: - mod->BSIM4v4eu = value->rValue; - mod->BSIM4v4euGiven = TRUE; - break; - case BSIM4v4_MOD_UA: - mod->BSIM4v4ua = value->rValue; - mod->BSIM4v4uaGiven = TRUE; - break; - case BSIM4v4_MOD_UA1: - mod->BSIM4v4ua1 = value->rValue; - mod->BSIM4v4ua1Given = TRUE; - break; - case BSIM4v4_MOD_UB: - mod->BSIM4v4ub = value->rValue; - mod->BSIM4v4ubGiven = TRUE; - break; - case BSIM4v4_MOD_UB1: - mod->BSIM4v4ub1 = value->rValue; - mod->BSIM4v4ub1Given = TRUE; - break; - case BSIM4v4_MOD_UC: - mod->BSIM4v4uc = value->rValue; - mod->BSIM4v4ucGiven = TRUE; - break; - case BSIM4v4_MOD_UC1: - mod->BSIM4v4uc1 = value->rValue; - mod->BSIM4v4uc1Given = TRUE; - break; - case BSIM4v4_MOD_U0 : - mod->BSIM4v4u0 = value->rValue; - mod->BSIM4v4u0Given = TRUE; - break; - case BSIM4v4_MOD_UTE : - mod->BSIM4v4ute = value->rValue; - mod->BSIM4v4uteGiven = TRUE; - break; - case BSIM4v4_MOD_VOFF: - mod->BSIM4v4voff = value->rValue; - mod->BSIM4v4voffGiven = TRUE; - break; - case BSIM4v4_MOD_VOFFL: - mod->BSIM4v4voffl = value->rValue; - mod->BSIM4v4vofflGiven = TRUE; - break; - case BSIM4v4_MOD_MINV: - mod->BSIM4v4minv = value->rValue; - mod->BSIM4v4minvGiven = TRUE; - break; - case BSIM4v4_MOD_FPROUT: - mod->BSIM4v4fprout = value->rValue; - mod->BSIM4v4fproutGiven = TRUE; - break; - case BSIM4v4_MOD_PDITS: - mod->BSIM4v4pdits = value->rValue; - mod->BSIM4v4pditsGiven = TRUE; - break; - case BSIM4v4_MOD_PDITSD: - mod->BSIM4v4pditsd = value->rValue; - mod->BSIM4v4pditsdGiven = TRUE; - break; - case BSIM4v4_MOD_PDITSL: - mod->BSIM4v4pditsl = value->rValue; - mod->BSIM4v4pditslGiven = TRUE; - break; - case BSIM4v4_MOD_DELTA : - mod->BSIM4v4delta = value->rValue; - mod->BSIM4v4deltaGiven = TRUE; - break; - case BSIM4v4_MOD_RDSW: - mod->BSIM4v4rdsw = value->rValue; - mod->BSIM4v4rdswGiven = TRUE; - break; - case BSIM4v4_MOD_RDSWMIN: - mod->BSIM4v4rdswmin = value->rValue; - mod->BSIM4v4rdswminGiven = TRUE; - break; - case BSIM4v4_MOD_RDWMIN: - mod->BSIM4v4rdwmin = value->rValue; - mod->BSIM4v4rdwminGiven = TRUE; - break; - case BSIM4v4_MOD_RSWMIN: - mod->BSIM4v4rswmin = value->rValue; - mod->BSIM4v4rswminGiven = TRUE; - break; - case BSIM4v4_MOD_RDW: - mod->BSIM4v4rdw = value->rValue; - mod->BSIM4v4rdwGiven = TRUE; - break; - case BSIM4v4_MOD_RSW: - mod->BSIM4v4rsw = value->rValue; - mod->BSIM4v4rswGiven = TRUE; - break; - case BSIM4v4_MOD_PRWG: - mod->BSIM4v4prwg = value->rValue; - mod->BSIM4v4prwgGiven = TRUE; - break; - case BSIM4v4_MOD_PRWB: - mod->BSIM4v4prwb = value->rValue; - mod->BSIM4v4prwbGiven = TRUE; - break; - case BSIM4v4_MOD_PRT: - mod->BSIM4v4prt = value->rValue; - mod->BSIM4v4prtGiven = TRUE; - break; - case BSIM4v4_MOD_ETA0: - mod->BSIM4v4eta0 = value->rValue; - mod->BSIM4v4eta0Given = TRUE; - break; - case BSIM4v4_MOD_ETAB: - mod->BSIM4v4etab = value->rValue; - mod->BSIM4v4etabGiven = TRUE; - break; - case BSIM4v4_MOD_PCLM: - mod->BSIM4v4pclm = value->rValue; - mod->BSIM4v4pclmGiven = TRUE; - break; - case BSIM4v4_MOD_PDIBL1: - mod->BSIM4v4pdibl1 = value->rValue; - mod->BSIM4v4pdibl1Given = TRUE; - break; - case BSIM4v4_MOD_PDIBL2: - mod->BSIM4v4pdibl2 = value->rValue; - mod->BSIM4v4pdibl2Given = TRUE; - break; - case BSIM4v4_MOD_PDIBLB: - mod->BSIM4v4pdiblb = value->rValue; - mod->BSIM4v4pdiblbGiven = TRUE; - break; - case BSIM4v4_MOD_PSCBE1: - mod->BSIM4v4pscbe1 = value->rValue; - mod->BSIM4v4pscbe1Given = TRUE; - break; - case BSIM4v4_MOD_PSCBE2: - mod->BSIM4v4pscbe2 = value->rValue; - mod->BSIM4v4pscbe2Given = TRUE; - break; - case BSIM4v4_MOD_PVAG: - mod->BSIM4v4pvag = value->rValue; - mod->BSIM4v4pvagGiven = TRUE; - break; - case BSIM4v4_MOD_WR : - mod->BSIM4v4wr = value->rValue; - mod->BSIM4v4wrGiven = TRUE; - break; - case BSIM4v4_MOD_DWG : - mod->BSIM4v4dwg = value->rValue; - mod->BSIM4v4dwgGiven = TRUE; - break; - case BSIM4v4_MOD_DWB : - mod->BSIM4v4dwb = value->rValue; - mod->BSIM4v4dwbGiven = TRUE; - break; - case BSIM4v4_MOD_B0 : - mod->BSIM4v4b0 = value->rValue; - mod->BSIM4v4b0Given = TRUE; - break; - case BSIM4v4_MOD_B1 : - mod->BSIM4v4b1 = value->rValue; - mod->BSIM4v4b1Given = TRUE; - break; - case BSIM4v4_MOD_ALPHA0 : - mod->BSIM4v4alpha0 = value->rValue; - mod->BSIM4v4alpha0Given = TRUE; - break; - case BSIM4v4_MOD_ALPHA1 : - mod->BSIM4v4alpha1 = value->rValue; - mod->BSIM4v4alpha1Given = TRUE; - break; - case BSIM4v4_MOD_AGIDL : - mod->BSIM4v4agidl = value->rValue; - mod->BSIM4v4agidlGiven = TRUE; - break; - case BSIM4v4_MOD_BGIDL : - mod->BSIM4v4bgidl = value->rValue; - mod->BSIM4v4bgidlGiven = TRUE; - break; - case BSIM4v4_MOD_CGIDL : - mod->BSIM4v4cgidl = value->rValue; - mod->BSIM4v4cgidlGiven = TRUE; - break; - case BSIM4v4_MOD_PHIN : - mod->BSIM4v4phin = value->rValue; - mod->BSIM4v4phinGiven = TRUE; - break; - case BSIM4v4_MOD_EGIDL : - mod->BSIM4v4egidl = value->rValue; - mod->BSIM4v4egidlGiven = TRUE; - break; - case BSIM4v4_MOD_AIGC : - mod->BSIM4v4aigc = value->rValue; - mod->BSIM4v4aigcGiven = TRUE; - break; - case BSIM4v4_MOD_BIGC : - mod->BSIM4v4bigc = value->rValue; - mod->BSIM4v4bigcGiven = TRUE; - break; - case BSIM4v4_MOD_CIGC : - mod->BSIM4v4cigc = value->rValue; - mod->BSIM4v4cigcGiven = TRUE; - break; - case BSIM4v4_MOD_AIGSD : - mod->BSIM4v4aigsd = value->rValue; - mod->BSIM4v4aigsdGiven = TRUE; - break; - case BSIM4v4_MOD_BIGSD : - mod->BSIM4v4bigsd = value->rValue; - mod->BSIM4v4bigsdGiven = TRUE; - break; - case BSIM4v4_MOD_CIGSD : - mod->BSIM4v4cigsd = value->rValue; - mod->BSIM4v4cigsdGiven = TRUE; - break; - case BSIM4v4_MOD_AIGBACC : - mod->BSIM4v4aigbacc = value->rValue; - mod->BSIM4v4aigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_BIGBACC : - mod->BSIM4v4bigbacc = value->rValue; - mod->BSIM4v4bigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_CIGBACC : - mod->BSIM4v4cigbacc = value->rValue; - mod->BSIM4v4cigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_AIGBINV : - mod->BSIM4v4aigbinv = value->rValue; - mod->BSIM4v4aigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_BIGBINV : - mod->BSIM4v4bigbinv = value->rValue; - mod->BSIM4v4bigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_CIGBINV : - mod->BSIM4v4cigbinv = value->rValue; - mod->BSIM4v4cigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_NIGC : - mod->BSIM4v4nigc = value->rValue; - mod->BSIM4v4nigcGiven = TRUE; - break; - case BSIM4v4_MOD_NIGBINV : - mod->BSIM4v4nigbinv = value->rValue; - mod->BSIM4v4nigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_NIGBACC : - mod->BSIM4v4nigbacc = value->rValue; - mod->BSIM4v4nigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_NTOX : - mod->BSIM4v4ntox = value->rValue; - mod->BSIM4v4ntoxGiven = TRUE; - break; - case BSIM4v4_MOD_EIGBINV : - mod->BSIM4v4eigbinv = value->rValue; - mod->BSIM4v4eigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_PIGCD : - mod->BSIM4v4pigcd = value->rValue; - mod->BSIM4v4pigcdGiven = TRUE; - break; - case BSIM4v4_MOD_POXEDGE : - mod->BSIM4v4poxedge = value->rValue; - mod->BSIM4v4poxedgeGiven = TRUE; - break; - case BSIM4v4_MOD_XRCRG1 : - mod->BSIM4v4xrcrg1 = value->rValue; - mod->BSIM4v4xrcrg1Given = TRUE; - break; - case BSIM4v4_MOD_XRCRG2 : - mod->BSIM4v4xrcrg2 = value->rValue; - mod->BSIM4v4xrcrg2Given = TRUE; - break; - case BSIM4v4_MOD_LAMBDA : - mod->BSIM4v4lambda = value->rValue; - mod->BSIM4v4lambdaGiven = TRUE; - break; - case BSIM4v4_MOD_VTL : - mod->BSIM4v4vtl = value->rValue; - mod->BSIM4v4vtlGiven = TRUE; - break; - case BSIM4v4_MOD_XN: - mod->BSIM4v4xn = value->rValue; - mod->BSIM4v4xnGiven = TRUE; - break; - case BSIM4v4_MOD_LC: - mod->BSIM4v4lc = value->rValue; - mod->BSIM4v4lcGiven = TRUE; - break; - case BSIM4v4_MOD_TNOIA : - mod->BSIM4v4tnoia = value->rValue; - mod->BSIM4v4tnoiaGiven = TRUE; - break; - case BSIM4v4_MOD_TNOIB : - mod->BSIM4v4tnoib = value->rValue; - mod->BSIM4v4tnoibGiven = TRUE; - break; - case BSIM4v4_MOD_RNOIA : - mod->BSIM4v4rnoia = value->rValue; - mod->BSIM4v4rnoiaGiven = TRUE; - break; - case BSIM4v4_MOD_RNOIB : - mod->BSIM4v4rnoib = value->rValue; - mod->BSIM4v4rnoibGiven = TRUE; - break; - case BSIM4v4_MOD_NTNOI : - mod->BSIM4v4ntnoi = value->rValue; - mod->BSIM4v4ntnoiGiven = TRUE; - break; - case BSIM4v4_MOD_VFBSDOFF: - mod->BSIM4v4vfbsdoff = value->rValue; - mod->BSIM4v4vfbsdoffGiven = TRUE; - break; - case BSIM4v4_MOD_LINTNOI: - mod->BSIM4v4lintnoi = value->rValue; - mod->BSIM4v4lintnoiGiven = TRUE; - break; - - /* stress effect */ - case BSIM4v4_MOD_SAREF : - mod->BSIM4v4saref = value->rValue; - mod->BSIM4v4sarefGiven = TRUE; - break; - case BSIM4v4_MOD_SBREF : - mod->BSIM4v4sbref = value->rValue; - mod->BSIM4v4sbrefGiven = TRUE; - break; - case BSIM4v4_MOD_WLOD : - mod->BSIM4v4wlod = value->rValue; - mod->BSIM4v4wlodGiven = TRUE; - break; - case BSIM4v4_MOD_KU0 : - mod->BSIM4v4ku0 = value->rValue; - mod->BSIM4v4ku0Given = TRUE; - break; - case BSIM4v4_MOD_KVSAT : - mod->BSIM4v4kvsat = value->rValue; - mod->BSIM4v4kvsatGiven = TRUE; - break; - case BSIM4v4_MOD_KVTH0 : - mod->BSIM4v4kvth0 = value->rValue; - mod->BSIM4v4kvth0Given = TRUE; - break; - case BSIM4v4_MOD_TKU0 : - mod->BSIM4v4tku0 = value->rValue; - mod->BSIM4v4tku0Given = TRUE; - break; - case BSIM4v4_MOD_LLODKU0 : - mod->BSIM4v4llodku0 = value->rValue; - mod->BSIM4v4llodku0Given = TRUE; - break; - case BSIM4v4_MOD_WLODKU0 : - mod->BSIM4v4wlodku0 = value->rValue; - mod->BSIM4v4wlodku0Given = TRUE; - break; - case BSIM4v4_MOD_LLODVTH : - mod->BSIM4v4llodvth = value->rValue; - mod->BSIM4v4llodvthGiven = TRUE; - break; - case BSIM4v4_MOD_WLODVTH : - mod->BSIM4v4wlodvth = value->rValue; - mod->BSIM4v4wlodvthGiven = TRUE; - break; - case BSIM4v4_MOD_LKU0 : - mod->BSIM4v4lku0 = value->rValue; - mod->BSIM4v4lku0Given = TRUE; - break; - case BSIM4v4_MOD_WKU0 : - mod->BSIM4v4wku0 = value->rValue; - mod->BSIM4v4wku0Given = TRUE; - break; - case BSIM4v4_MOD_PKU0 : - mod->BSIM4v4pku0 = value->rValue; - mod->BSIM4v4pku0Given = TRUE; - break; - case BSIM4v4_MOD_LKVTH0 : - mod->BSIM4v4lkvth0 = value->rValue; - mod->BSIM4v4lkvth0Given = TRUE; - break; - case BSIM4v4_MOD_WKVTH0 : - mod->BSIM4v4wkvth0 = value->rValue; - mod->BSIM4v4wkvth0Given = TRUE; - break; - case BSIM4v4_MOD_PKVTH0 : - mod->BSIM4v4pkvth0 = value->rValue; - mod->BSIM4v4pkvth0Given = TRUE; - break; - case BSIM4v4_MOD_STK2 : - mod->BSIM4v4stk2 = value->rValue; - mod->BSIM4v4stk2Given = TRUE; - break; - case BSIM4v4_MOD_LODK2 : - mod->BSIM4v4lodk2 = value->rValue; - mod->BSIM4v4lodk2Given = TRUE; - break; - case BSIM4v4_MOD_STETA0 : - mod->BSIM4v4steta0 = value->rValue; - mod->BSIM4v4steta0Given = TRUE; - break; - case BSIM4v4_MOD_LODETA0 : - mod->BSIM4v4lodeta0 = value->rValue; - mod->BSIM4v4lodeta0Given = TRUE; - break; - - case BSIM4v4_MOD_BETA0 : - mod->BSIM4v4beta0 = value->rValue; - mod->BSIM4v4beta0Given = TRUE; - break; - case BSIM4v4_MOD_IJTHDFWD : - mod->BSIM4v4ijthdfwd = value->rValue; - mod->BSIM4v4ijthdfwdGiven = TRUE; - break; - case BSIM4v4_MOD_IJTHSFWD : - mod->BSIM4v4ijthsfwd = value->rValue; - mod->BSIM4v4ijthsfwdGiven = TRUE; - break; - case BSIM4v4_MOD_IJTHDREV : - mod->BSIM4v4ijthdrev = value->rValue; - mod->BSIM4v4ijthdrevGiven = TRUE; - break; - case BSIM4v4_MOD_IJTHSREV : - mod->BSIM4v4ijthsrev = value->rValue; - mod->BSIM4v4ijthsrevGiven = TRUE; - break; - case BSIM4v4_MOD_XJBVD : - mod->BSIM4v4xjbvd = value->rValue; - mod->BSIM4v4xjbvdGiven = TRUE; - break; - case BSIM4v4_MOD_XJBVS : - mod->BSIM4v4xjbvs = value->rValue; - mod->BSIM4v4xjbvsGiven = TRUE; - break; - case BSIM4v4_MOD_BVD : - mod->BSIM4v4bvd = value->rValue; - mod->BSIM4v4bvdGiven = TRUE; - break; - case BSIM4v4_MOD_BVS : - mod->BSIM4v4bvs = value->rValue; - mod->BSIM4v4bvsGiven = TRUE; - break; - - /* reverse diode */ - case BSIM4v4_MOD_JTSS : - mod->BSIM4v4jtss = value->rValue; - mod->BSIM4v4jtssGiven = TRUE; - break; - case BSIM4v4_MOD_JTSD : - mod->BSIM4v4jtsd = value->rValue; - mod->BSIM4v4jtsdGiven = TRUE; - break; - case BSIM4v4_MOD_JTSSWS : - mod->BSIM4v4jtssws = value->rValue; - mod->BSIM4v4jtsswsGiven = TRUE; - break; - case BSIM4v4_MOD_JTSSWD : - mod->BSIM4v4jtsswd = value->rValue; - mod->BSIM4v4jtsswdGiven = TRUE; - break; - case BSIM4v4_MOD_JTSSWGS : - mod->BSIM4v4jtsswgs = value->rValue; - mod->BSIM4v4jtsswgsGiven = TRUE; - break; - case BSIM4v4_MOD_JTSSWGD : - mod->BSIM4v4jtsswgd = value->rValue; - mod->BSIM4v4jtsswgdGiven = TRUE; - break; - case BSIM4v4_MOD_NJTS : - mod->BSIM4v4njts = value->rValue; - mod->BSIM4v4njtsGiven = TRUE; - break; - case BSIM4v4_MOD_NJTSSW : - mod->BSIM4v4njtssw = value->rValue; - mod->BSIM4v4njtsswGiven = TRUE; - break; - case BSIM4v4_MOD_NJTSSWG : - mod->BSIM4v4njtsswg = value->rValue; - mod->BSIM4v4njtsswgGiven = TRUE; - break; - case BSIM4v4_MOD_XTSS : - mod->BSIM4v4xtss = value->rValue; - mod->BSIM4v4xtssGiven = TRUE; - break; - case BSIM4v4_MOD_XTSD : - mod->BSIM4v4xtsd = value->rValue; - mod->BSIM4v4xtsdGiven = TRUE; - break; - case BSIM4v4_MOD_XTSSWS : - mod->BSIM4v4xtssws = value->rValue; - mod->BSIM4v4xtsswsGiven = TRUE; - break; - case BSIM4v4_MOD_XTSSWD : - mod->BSIM4v4xtsswd = value->rValue; - mod->BSIM4v4xtsswdGiven = TRUE; - break; - case BSIM4v4_MOD_XTSSWGS : - mod->BSIM4v4xtsswgs = value->rValue; - mod->BSIM4v4xtsswgsGiven = TRUE; - break; - case BSIM4v4_MOD_XTSSWGD : - mod->BSIM4v4xtsswgd = value->rValue; - mod->BSIM4v4xtsswgdGiven = TRUE; - break; - case BSIM4v4_MOD_TNJTS : - mod->BSIM4v4tnjts = value->rValue; - mod->BSIM4v4tnjtsGiven = TRUE; - break; - case BSIM4v4_MOD_TNJTSSW : - mod->BSIM4v4tnjtssw = value->rValue; - mod->BSIM4v4tnjtsswGiven = TRUE; - break; - case BSIM4v4_MOD_TNJTSSWG : - mod->BSIM4v4tnjtsswg = value->rValue; - mod->BSIM4v4tnjtsswgGiven = TRUE; - break; - case BSIM4v4_MOD_VTSS : - mod->BSIM4v4vtss = value->rValue; - mod->BSIM4v4vtssGiven = TRUE; - break; - case BSIM4v4_MOD_VTSD : - mod->BSIM4v4vtsd = value->rValue; - mod->BSIM4v4vtsdGiven = TRUE; - break; - case BSIM4v4_MOD_VTSSWS : - mod->BSIM4v4vtssws = value->rValue; - mod->BSIM4v4vtsswsGiven = TRUE; - break; - case BSIM4v4_MOD_VTSSWD : - mod->BSIM4v4vtsswd = value->rValue; - mod->BSIM4v4vtsswdGiven = TRUE; - break; - case BSIM4v4_MOD_VTSSWGS : - mod->BSIM4v4vtsswgs = value->rValue; - mod->BSIM4v4vtsswgsGiven = TRUE; - break; - case BSIM4v4_MOD_VTSSWGD : - mod->BSIM4v4vtsswgd = value->rValue; - mod->BSIM4v4vtsswgdGiven = TRUE; - break; - - case BSIM4v4_MOD_VFB : - mod->BSIM4v4vfb = value->rValue; - mod->BSIM4v4vfbGiven = TRUE; - break; - - case BSIM4v4_MOD_GBMIN : - mod->BSIM4v4gbmin = value->rValue; - mod->BSIM4v4gbminGiven = TRUE; - break; - case BSIM4v4_MOD_RBDB : - mod->BSIM4v4rbdb = value->rValue; - mod->BSIM4v4rbdbGiven = TRUE; - break; - case BSIM4v4_MOD_RBPB : - mod->BSIM4v4rbpb = value->rValue; - mod->BSIM4v4rbpbGiven = TRUE; - break; - case BSIM4v4_MOD_RBSB : - mod->BSIM4v4rbsb = value->rValue; - mod->BSIM4v4rbsbGiven = TRUE; - break; - case BSIM4v4_MOD_RBPS : - mod->BSIM4v4rbps = value->rValue; - mod->BSIM4v4rbpsGiven = TRUE; - break; - case BSIM4v4_MOD_RBPD : - mod->BSIM4v4rbpd = value->rValue; - mod->BSIM4v4rbpdGiven = TRUE; - break; - - case BSIM4v4_MOD_CGSL : - mod->BSIM4v4cgsl = value->rValue; - mod->BSIM4v4cgslGiven = TRUE; - break; - case BSIM4v4_MOD_CGDL : - mod->BSIM4v4cgdl = value->rValue; - mod->BSIM4v4cgdlGiven = TRUE; - break; - case BSIM4v4_MOD_CKAPPAS : - mod->BSIM4v4ckappas = value->rValue; - mod->BSIM4v4ckappasGiven = TRUE; - break; - case BSIM4v4_MOD_CKAPPAD : - mod->BSIM4v4ckappad = value->rValue; - mod->BSIM4v4ckappadGiven = TRUE; - break; - case BSIM4v4_MOD_CF : - mod->BSIM4v4cf = value->rValue; - mod->BSIM4v4cfGiven = TRUE; - break; - case BSIM4v4_MOD_CLC : - mod->BSIM4v4clc = value->rValue; - mod->BSIM4v4clcGiven = TRUE; - break; - case BSIM4v4_MOD_CLE : - mod->BSIM4v4cle = value->rValue; - mod->BSIM4v4cleGiven = TRUE; - break; - case BSIM4v4_MOD_DWC : - mod->BSIM4v4dwc = value->rValue; - mod->BSIM4v4dwcGiven = TRUE; - break; - case BSIM4v4_MOD_DLC : - mod->BSIM4v4dlc = value->rValue; - mod->BSIM4v4dlcGiven = TRUE; - break; - case BSIM4v4_MOD_XW : - mod->BSIM4v4xw = value->rValue; - mod->BSIM4v4xwGiven = TRUE; - break; - case BSIM4v4_MOD_XL : - mod->BSIM4v4xl = value->rValue; - mod->BSIM4v4xlGiven = TRUE; - break; - case BSIM4v4_MOD_DLCIG : - mod->BSIM4v4dlcig = value->rValue; - mod->BSIM4v4dlcigGiven = TRUE; - break; - case BSIM4v4_MOD_DWJ : - mod->BSIM4v4dwj = value->rValue; - mod->BSIM4v4dwjGiven = TRUE; - break; - case BSIM4v4_MOD_VFBCV : - mod->BSIM4v4vfbcv = value->rValue; - mod->BSIM4v4vfbcvGiven = TRUE; - break; - case BSIM4v4_MOD_ACDE : - mod->BSIM4v4acde = value->rValue; - mod->BSIM4v4acdeGiven = TRUE; - break; - case BSIM4v4_MOD_MOIN : - mod->BSIM4v4moin = value->rValue; - mod->BSIM4v4moinGiven = TRUE; - break; - case BSIM4v4_MOD_NOFF : - mod->BSIM4v4noff = value->rValue; - mod->BSIM4v4noffGiven = TRUE; - break; - case BSIM4v4_MOD_VOFFCV : - mod->BSIM4v4voffcv = value->rValue; - mod->BSIM4v4voffcvGiven = TRUE; - break; - case BSIM4v4_MOD_DMCG : - mod->BSIM4v4dmcg = value->rValue; - mod->BSIM4v4dmcgGiven = TRUE; - break; - case BSIM4v4_MOD_DMCI : - mod->BSIM4v4dmci = value->rValue; - mod->BSIM4v4dmciGiven = TRUE; - break; - case BSIM4v4_MOD_DMDG : - mod->BSIM4v4dmdg = value->rValue; - mod->BSIM4v4dmdgGiven = TRUE; - break; - case BSIM4v4_MOD_DMCGT : - mod->BSIM4v4dmcgt = value->rValue; - mod->BSIM4v4dmcgtGiven = TRUE; - break; - case BSIM4v4_MOD_XGW : - mod->BSIM4v4xgw = value->rValue; - mod->BSIM4v4xgwGiven = TRUE; - break; - case BSIM4v4_MOD_XGL : - mod->BSIM4v4xgl = value->rValue; - mod->BSIM4v4xglGiven = TRUE; - break; - case BSIM4v4_MOD_RSHG : - mod->BSIM4v4rshg = value->rValue; - mod->BSIM4v4rshgGiven = TRUE; - break; - case BSIM4v4_MOD_NGCON : - mod->BSIM4v4ngcon = value->rValue; - mod->BSIM4v4ngconGiven = TRUE; - break; - case BSIM4v4_MOD_TCJ : - mod->BSIM4v4tcj = value->rValue; - mod->BSIM4v4tcjGiven = TRUE; - break; - case BSIM4v4_MOD_TPB : - mod->BSIM4v4tpb = value->rValue; - mod->BSIM4v4tpbGiven = TRUE; - break; - case BSIM4v4_MOD_TCJSW : - mod->BSIM4v4tcjsw = value->rValue; - mod->BSIM4v4tcjswGiven = TRUE; - break; - case BSIM4v4_MOD_TPBSW : - mod->BSIM4v4tpbsw = value->rValue; - mod->BSIM4v4tpbswGiven = TRUE; - break; - case BSIM4v4_MOD_TCJSWG : - mod->BSIM4v4tcjswg = value->rValue; - mod->BSIM4v4tcjswgGiven = TRUE; - break; - case BSIM4v4_MOD_TPBSWG : - mod->BSIM4v4tpbswg = value->rValue; - mod->BSIM4v4tpbswgGiven = TRUE; - break; - - /* Length dependence */ - case BSIM4v4_MOD_LCDSC : - mod->BSIM4v4lcdsc = value->rValue; - mod->BSIM4v4lcdscGiven = TRUE; - break; - - - case BSIM4v4_MOD_LCDSCB : - mod->BSIM4v4lcdscb = value->rValue; - mod->BSIM4v4lcdscbGiven = TRUE; - break; - case BSIM4v4_MOD_LCDSCD : - mod->BSIM4v4lcdscd = value->rValue; - mod->BSIM4v4lcdscdGiven = TRUE; - break; - case BSIM4v4_MOD_LCIT : - mod->BSIM4v4lcit = value->rValue; - mod->BSIM4v4lcitGiven = TRUE; - break; - case BSIM4v4_MOD_LNFACTOR : - mod->BSIM4v4lnfactor = value->rValue; - mod->BSIM4v4lnfactorGiven = TRUE; - break; - case BSIM4v4_MOD_LXJ: - mod->BSIM4v4lxj = value->rValue; - mod->BSIM4v4lxjGiven = TRUE; - break; - case BSIM4v4_MOD_LVSAT: - mod->BSIM4v4lvsat = value->rValue; - mod->BSIM4v4lvsatGiven = TRUE; - break; - - - case BSIM4v4_MOD_LA0: - mod->BSIM4v4la0 = value->rValue; - mod->BSIM4v4la0Given = TRUE; - break; - case BSIM4v4_MOD_LAGS: - mod->BSIM4v4lags = value->rValue; - mod->BSIM4v4lagsGiven = TRUE; - break; - case BSIM4v4_MOD_LA1: - mod->BSIM4v4la1 = value->rValue; - mod->BSIM4v4la1Given = TRUE; - break; - case BSIM4v4_MOD_LA2: - mod->BSIM4v4la2 = value->rValue; - mod->BSIM4v4la2Given = TRUE; - break; - case BSIM4v4_MOD_LAT: - mod->BSIM4v4lat = value->rValue; - mod->BSIM4v4latGiven = TRUE; - break; - case BSIM4v4_MOD_LKETA: - mod->BSIM4v4lketa = value->rValue; - mod->BSIM4v4lketaGiven = TRUE; - break; - case BSIM4v4_MOD_LNSUB: - mod->BSIM4v4lnsub = value->rValue; - mod->BSIM4v4lnsubGiven = TRUE; - break; - case BSIM4v4_MOD_LNDEP: - mod->BSIM4v4lndep = value->rValue; - mod->BSIM4v4lndepGiven = TRUE; - if (mod->BSIM4v4lndep > 1.0e20) - mod->BSIM4v4lndep *= 1.0e-6; - break; - case BSIM4v4_MOD_LNSD: - mod->BSIM4v4lnsd = value->rValue; - mod->BSIM4v4lnsdGiven = TRUE; - if (mod->BSIM4v4lnsd > 1.0e23) - mod->BSIM4v4lnsd *= 1.0e-6; - break; - case BSIM4v4_MOD_LNGATE: - mod->BSIM4v4lngate = value->rValue; - mod->BSIM4v4lngateGiven = TRUE; - if (mod->BSIM4v4lngate > 1.0e23) - mod->BSIM4v4lngate *= 1.0e-6; - break; - case BSIM4v4_MOD_LGAMMA1: - mod->BSIM4v4lgamma1 = value->rValue; - mod->BSIM4v4lgamma1Given = TRUE; - break; - case BSIM4v4_MOD_LGAMMA2: - mod->BSIM4v4lgamma2 = value->rValue; - mod->BSIM4v4lgamma2Given = TRUE; - break; - case BSIM4v4_MOD_LVBX: - mod->BSIM4v4lvbx = value->rValue; - mod->BSIM4v4lvbxGiven = TRUE; - break; - case BSIM4v4_MOD_LVBM: - mod->BSIM4v4lvbm = value->rValue; - mod->BSIM4v4lvbmGiven = TRUE; - break; - case BSIM4v4_MOD_LXT: - mod->BSIM4v4lxt = value->rValue; - mod->BSIM4v4lxtGiven = TRUE; - break; - case BSIM4v4_MOD_LK1: - mod->BSIM4v4lk1 = value->rValue; - mod->BSIM4v4lk1Given = TRUE; - break; - case BSIM4v4_MOD_LKT1: - mod->BSIM4v4lkt1 = value->rValue; - mod->BSIM4v4lkt1Given = TRUE; - break; - case BSIM4v4_MOD_LKT1L: - mod->BSIM4v4lkt1l = value->rValue; - mod->BSIM4v4lkt1lGiven = TRUE; - break; - case BSIM4v4_MOD_LKT2: - mod->BSIM4v4lkt2 = value->rValue; - mod->BSIM4v4lkt2Given = TRUE; - break; - case BSIM4v4_MOD_LK2: - mod->BSIM4v4lk2 = value->rValue; - mod->BSIM4v4lk2Given = TRUE; - break; - case BSIM4v4_MOD_LK3: - mod->BSIM4v4lk3 = value->rValue; - mod->BSIM4v4lk3Given = TRUE; - break; - case BSIM4v4_MOD_LK3B: - mod->BSIM4v4lk3b = value->rValue; - mod->BSIM4v4lk3bGiven = TRUE; - break; - case BSIM4v4_MOD_LLPE0: - mod->BSIM4v4llpe0 = value->rValue; - mod->BSIM4v4llpe0Given = TRUE; - break; - case BSIM4v4_MOD_LLPEB: - mod->BSIM4v4llpeb = value->rValue; - mod->BSIM4v4llpebGiven = TRUE; - break; - case BSIM4v4_MOD_LDVTP0: - mod->BSIM4v4ldvtp0 = value->rValue; - mod->BSIM4v4ldvtp0Given = TRUE; - break; - case BSIM4v4_MOD_LDVTP1: - mod->BSIM4v4ldvtp1 = value->rValue; - mod->BSIM4v4ldvtp1Given = TRUE; - break; - case BSIM4v4_MOD_LW0: - mod->BSIM4v4lw0 = value->rValue; - mod->BSIM4v4lw0Given = TRUE; - break; - case BSIM4v4_MOD_LDVT0: - mod->BSIM4v4ldvt0 = value->rValue; - mod->BSIM4v4ldvt0Given = TRUE; - break; - case BSIM4v4_MOD_LDVT1: - mod->BSIM4v4ldvt1 = value->rValue; - mod->BSIM4v4ldvt1Given = TRUE; - break; - case BSIM4v4_MOD_LDVT2: - mod->BSIM4v4ldvt2 = value->rValue; - mod->BSIM4v4ldvt2Given = TRUE; - break; - case BSIM4v4_MOD_LDVT0W: - mod->BSIM4v4ldvt0w = value->rValue; - mod->BSIM4v4ldvt0wGiven = TRUE; - break; - case BSIM4v4_MOD_LDVT1W: - mod->BSIM4v4ldvt1w = value->rValue; - mod->BSIM4v4ldvt1wGiven = TRUE; - break; - case BSIM4v4_MOD_LDVT2W: - mod->BSIM4v4ldvt2w = value->rValue; - mod->BSIM4v4ldvt2wGiven = TRUE; - break; - case BSIM4v4_MOD_LDROUT: - mod->BSIM4v4ldrout = value->rValue; - mod->BSIM4v4ldroutGiven = TRUE; - break; - case BSIM4v4_MOD_LDSUB: - mod->BSIM4v4ldsub = value->rValue; - mod->BSIM4v4ldsubGiven = TRUE; - break; - case BSIM4v4_MOD_LVTH0: - mod->BSIM4v4lvth0 = value->rValue; - mod->BSIM4v4lvth0Given = TRUE; - break; - case BSIM4v4_MOD_LUA: - mod->BSIM4v4lua = value->rValue; - mod->BSIM4v4luaGiven = TRUE; - break; - case BSIM4v4_MOD_LUA1: - mod->BSIM4v4lua1 = value->rValue; - mod->BSIM4v4lua1Given = TRUE; - break; - case BSIM4v4_MOD_LUB: - mod->BSIM4v4lub = value->rValue; - mod->BSIM4v4lubGiven = TRUE; - break; - case BSIM4v4_MOD_LUB1: - mod->BSIM4v4lub1 = value->rValue; - mod->BSIM4v4lub1Given = TRUE; - break; - case BSIM4v4_MOD_LUC: - mod->BSIM4v4luc = value->rValue; - mod->BSIM4v4lucGiven = TRUE; - break; - case BSIM4v4_MOD_LUC1: - mod->BSIM4v4luc1 = value->rValue; - mod->BSIM4v4luc1Given = TRUE; - break; - case BSIM4v4_MOD_LU0 : - mod->BSIM4v4lu0 = value->rValue; - mod->BSIM4v4lu0Given = TRUE; - break; - case BSIM4v4_MOD_LUTE : - mod->BSIM4v4lute = value->rValue; - mod->BSIM4v4luteGiven = TRUE; - break; - case BSIM4v4_MOD_LVOFF: - mod->BSIM4v4lvoff = value->rValue; - mod->BSIM4v4lvoffGiven = TRUE; - break; - case BSIM4v4_MOD_LMINV: - mod->BSIM4v4lminv = value->rValue; - mod->BSIM4v4lminvGiven = TRUE; - break; - case BSIM4v4_MOD_LFPROUT: - mod->BSIM4v4lfprout = value->rValue; - mod->BSIM4v4lfproutGiven = TRUE; - break; - case BSIM4v4_MOD_LPDITS: - mod->BSIM4v4lpdits = value->rValue; - mod->BSIM4v4lpditsGiven = TRUE; - break; - case BSIM4v4_MOD_LPDITSD: - mod->BSIM4v4lpditsd = value->rValue; - mod->BSIM4v4lpditsdGiven = TRUE; - break; - case BSIM4v4_MOD_LDELTA : - mod->BSIM4v4ldelta = value->rValue; - mod->BSIM4v4ldeltaGiven = TRUE; - break; - case BSIM4v4_MOD_LRDSW: - mod->BSIM4v4lrdsw = value->rValue; - mod->BSIM4v4lrdswGiven = TRUE; - break; - case BSIM4v4_MOD_LRDW: - mod->BSIM4v4lrdw = value->rValue; - mod->BSIM4v4lrdwGiven = TRUE; - break; - case BSIM4v4_MOD_LRSW: - mod->BSIM4v4lrsw = value->rValue; - mod->BSIM4v4lrswGiven = TRUE; - break; - case BSIM4v4_MOD_LPRWB: - mod->BSIM4v4lprwb = value->rValue; - mod->BSIM4v4lprwbGiven = TRUE; - break; - case BSIM4v4_MOD_LPRWG: - mod->BSIM4v4lprwg = value->rValue; - mod->BSIM4v4lprwgGiven = TRUE; - break; - case BSIM4v4_MOD_LPRT: - mod->BSIM4v4lprt = value->rValue; - mod->BSIM4v4lprtGiven = TRUE; - break; - case BSIM4v4_MOD_LETA0: - mod->BSIM4v4leta0 = value->rValue; - mod->BSIM4v4leta0Given = TRUE; - break; - case BSIM4v4_MOD_LETAB: - mod->BSIM4v4letab = value->rValue; - mod->BSIM4v4letabGiven = TRUE; - break; - case BSIM4v4_MOD_LPCLM: - mod->BSIM4v4lpclm = value->rValue; - mod->BSIM4v4lpclmGiven = TRUE; - break; - case BSIM4v4_MOD_LPDIBL1: - mod->BSIM4v4lpdibl1 = value->rValue; - mod->BSIM4v4lpdibl1Given = TRUE; - break; - case BSIM4v4_MOD_LPDIBL2: - mod->BSIM4v4lpdibl2 = value->rValue; - mod->BSIM4v4lpdibl2Given = TRUE; - break; - case BSIM4v4_MOD_LPDIBLB: - mod->BSIM4v4lpdiblb = value->rValue; - mod->BSIM4v4lpdiblbGiven = TRUE; - break; - case BSIM4v4_MOD_LPSCBE1: - mod->BSIM4v4lpscbe1 = value->rValue; - mod->BSIM4v4lpscbe1Given = TRUE; - break; - case BSIM4v4_MOD_LPSCBE2: - mod->BSIM4v4lpscbe2 = value->rValue; - mod->BSIM4v4lpscbe2Given = TRUE; - break; - case BSIM4v4_MOD_LPVAG: - mod->BSIM4v4lpvag = value->rValue; - mod->BSIM4v4lpvagGiven = TRUE; - break; - case BSIM4v4_MOD_LWR : - mod->BSIM4v4lwr = value->rValue; - mod->BSIM4v4lwrGiven = TRUE; - break; - case BSIM4v4_MOD_LDWG : - mod->BSIM4v4ldwg = value->rValue; - mod->BSIM4v4ldwgGiven = TRUE; - break; - case BSIM4v4_MOD_LDWB : - mod->BSIM4v4ldwb = value->rValue; - mod->BSIM4v4ldwbGiven = TRUE; - break; - case BSIM4v4_MOD_LB0 : - mod->BSIM4v4lb0 = value->rValue; - mod->BSIM4v4lb0Given = TRUE; - break; - case BSIM4v4_MOD_LB1 : - mod->BSIM4v4lb1 = value->rValue; - mod->BSIM4v4lb1Given = TRUE; - break; - case BSIM4v4_MOD_LALPHA0 : - mod->BSIM4v4lalpha0 = value->rValue; - mod->BSIM4v4lalpha0Given = TRUE; - break; - case BSIM4v4_MOD_LALPHA1 : - mod->BSIM4v4lalpha1 = value->rValue; - mod->BSIM4v4lalpha1Given = TRUE; - break; - case BSIM4v4_MOD_LBETA0 : - mod->BSIM4v4lbeta0 = value->rValue; - mod->BSIM4v4lbeta0Given = TRUE; - break; - case BSIM4v4_MOD_LAGIDL : - mod->BSIM4v4lagidl = value->rValue; - mod->BSIM4v4lagidlGiven = TRUE; - break; - case BSIM4v4_MOD_LBGIDL : - mod->BSIM4v4lbgidl = value->rValue; - mod->BSIM4v4lbgidlGiven = TRUE; - break; - case BSIM4v4_MOD_LCGIDL : - mod->BSIM4v4lcgidl = value->rValue; - mod->BSIM4v4lcgidlGiven = TRUE; - break; - case BSIM4v4_MOD_LPHIN : - mod->BSIM4v4lphin = value->rValue; - mod->BSIM4v4lphinGiven = TRUE; - break; - case BSIM4v4_MOD_LEGIDL : - mod->BSIM4v4legidl = value->rValue; - mod->BSIM4v4legidlGiven = TRUE; - break; - case BSIM4v4_MOD_LAIGC : - mod->BSIM4v4laigc = value->rValue; - mod->BSIM4v4laigcGiven = TRUE; - break; - case BSIM4v4_MOD_LBIGC : - mod->BSIM4v4lbigc = value->rValue; - mod->BSIM4v4lbigcGiven = TRUE; - break; - case BSIM4v4_MOD_LCIGC : - mod->BSIM4v4lcigc = value->rValue; - mod->BSIM4v4lcigcGiven = TRUE; - break; - case BSIM4v4_MOD_LAIGSD : - mod->BSIM4v4laigsd = value->rValue; - mod->BSIM4v4laigsdGiven = TRUE; - break; - case BSIM4v4_MOD_LBIGSD : - mod->BSIM4v4lbigsd = value->rValue; - mod->BSIM4v4lbigsdGiven = TRUE; - break; - case BSIM4v4_MOD_LCIGSD : - mod->BSIM4v4lcigsd = value->rValue; - mod->BSIM4v4lcigsdGiven = TRUE; - break; - case BSIM4v4_MOD_LAIGBACC : - mod->BSIM4v4laigbacc = value->rValue; - mod->BSIM4v4laigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_LBIGBACC : - mod->BSIM4v4lbigbacc = value->rValue; - mod->BSIM4v4lbigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_LCIGBACC : - mod->BSIM4v4lcigbacc = value->rValue; - mod->BSIM4v4lcigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_LAIGBINV : - mod->BSIM4v4laigbinv = value->rValue; - mod->BSIM4v4laigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_LBIGBINV : - mod->BSIM4v4lbigbinv = value->rValue; - mod->BSIM4v4lbigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_LCIGBINV : - mod->BSIM4v4lcigbinv = value->rValue; - mod->BSIM4v4lcigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_LNIGC : - mod->BSIM4v4lnigc = value->rValue; - mod->BSIM4v4lnigcGiven = TRUE; - break; - case BSIM4v4_MOD_LNIGBINV : - mod->BSIM4v4lnigbinv = value->rValue; - mod->BSIM4v4lnigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_LNIGBACC : - mod->BSIM4v4lnigbacc = value->rValue; - mod->BSIM4v4lnigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_LNTOX : - mod->BSIM4v4lntox = value->rValue; - mod->BSIM4v4lntoxGiven = TRUE; - break; - case BSIM4v4_MOD_LEIGBINV : - mod->BSIM4v4leigbinv = value->rValue; - mod->BSIM4v4leigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_LPIGCD : - mod->BSIM4v4lpigcd = value->rValue; - mod->BSIM4v4lpigcdGiven = TRUE; - break; - case BSIM4v4_MOD_LPOXEDGE : - mod->BSIM4v4lpoxedge = value->rValue; - mod->BSIM4v4lpoxedgeGiven = TRUE; - break; - case BSIM4v4_MOD_LXRCRG1 : - mod->BSIM4v4lxrcrg1 = value->rValue; - mod->BSIM4v4lxrcrg1Given = TRUE; - break; - case BSIM4v4_MOD_LXRCRG2 : - mod->BSIM4v4lxrcrg2 = value->rValue; - mod->BSIM4v4lxrcrg2Given = TRUE; - break; - case BSIM4v4_MOD_LLAMBDA : - mod->BSIM4v4llambda = value->rValue; - mod->BSIM4v4llambdaGiven = TRUE; - break; - case BSIM4v4_MOD_LVTL : - mod->BSIM4v4lvtl = value->rValue; - mod->BSIM4v4lvtlGiven = TRUE; - break; - case BSIM4v4_MOD_LXN: - mod->BSIM4v4lxn = value->rValue; - mod->BSIM4v4lxnGiven = TRUE; - break; - case BSIM4v4_MOD_LVFBSDOFF: - mod->BSIM4v4lvfbsdoff = value->rValue; - mod->BSIM4v4lvfbsdoffGiven = TRUE; - break; - case BSIM4v4_MOD_LEU : - mod->BSIM4v4leu = value->rValue; - mod->BSIM4v4leuGiven = TRUE; - break; - case BSIM4v4_MOD_LVFB : - mod->BSIM4v4lvfb = value->rValue; - mod->BSIM4v4lvfbGiven = TRUE; - break; - case BSIM4v4_MOD_LCGSL : - mod->BSIM4v4lcgsl = value->rValue; - mod->BSIM4v4lcgslGiven = TRUE; - break; - case BSIM4v4_MOD_LCGDL : - mod->BSIM4v4lcgdl = value->rValue; - mod->BSIM4v4lcgdlGiven = TRUE; - break; - case BSIM4v4_MOD_LCKAPPAS : - mod->BSIM4v4lckappas = value->rValue; - mod->BSIM4v4lckappasGiven = TRUE; - break; - case BSIM4v4_MOD_LCKAPPAD : - mod->BSIM4v4lckappad = value->rValue; - mod->BSIM4v4lckappadGiven = TRUE; - break; - case BSIM4v4_MOD_LCF : - mod->BSIM4v4lcf = value->rValue; - mod->BSIM4v4lcfGiven = TRUE; - break; - case BSIM4v4_MOD_LCLC : - mod->BSIM4v4lclc = value->rValue; - mod->BSIM4v4lclcGiven = TRUE; - break; - case BSIM4v4_MOD_LCLE : - mod->BSIM4v4lcle = value->rValue; - mod->BSIM4v4lcleGiven = TRUE; - break; - case BSIM4v4_MOD_LVFBCV : - mod->BSIM4v4lvfbcv = value->rValue; - mod->BSIM4v4lvfbcvGiven = TRUE; - break; - case BSIM4v4_MOD_LACDE : - mod->BSIM4v4lacde = value->rValue; - mod->BSIM4v4lacdeGiven = TRUE; - break; - case BSIM4v4_MOD_LMOIN : - mod->BSIM4v4lmoin = value->rValue; - mod->BSIM4v4lmoinGiven = TRUE; - break; - case BSIM4v4_MOD_LNOFF : - mod->BSIM4v4lnoff = value->rValue; - mod->BSIM4v4lnoffGiven = TRUE; - break; - case BSIM4v4_MOD_LVOFFCV : - mod->BSIM4v4lvoffcv = value->rValue; - mod->BSIM4v4lvoffcvGiven = TRUE; - break; - - /* Width dependence */ - case BSIM4v4_MOD_WCDSC : - mod->BSIM4v4wcdsc = value->rValue; - mod->BSIM4v4wcdscGiven = TRUE; - break; - - - case BSIM4v4_MOD_WCDSCB : - mod->BSIM4v4wcdscb = value->rValue; - mod->BSIM4v4wcdscbGiven = TRUE; - break; - case BSIM4v4_MOD_WCDSCD : - mod->BSIM4v4wcdscd = value->rValue; - mod->BSIM4v4wcdscdGiven = TRUE; - break; - case BSIM4v4_MOD_WCIT : - mod->BSIM4v4wcit = value->rValue; - mod->BSIM4v4wcitGiven = TRUE; - break; - case BSIM4v4_MOD_WNFACTOR : - mod->BSIM4v4wnfactor = value->rValue; - mod->BSIM4v4wnfactorGiven = TRUE; - break; - case BSIM4v4_MOD_WXJ: - mod->BSIM4v4wxj = value->rValue; - mod->BSIM4v4wxjGiven = TRUE; - break; - case BSIM4v4_MOD_WVSAT: - mod->BSIM4v4wvsat = value->rValue; - mod->BSIM4v4wvsatGiven = TRUE; - break; - - - case BSIM4v4_MOD_WA0: - mod->BSIM4v4wa0 = value->rValue; - mod->BSIM4v4wa0Given = TRUE; - break; - case BSIM4v4_MOD_WAGS: - mod->BSIM4v4wags = value->rValue; - mod->BSIM4v4wagsGiven = TRUE; - break; - case BSIM4v4_MOD_WA1: - mod->BSIM4v4wa1 = value->rValue; - mod->BSIM4v4wa1Given = TRUE; - break; - case BSIM4v4_MOD_WA2: - mod->BSIM4v4wa2 = value->rValue; - mod->BSIM4v4wa2Given = TRUE; - break; - case BSIM4v4_MOD_WAT: - mod->BSIM4v4wat = value->rValue; - mod->BSIM4v4watGiven = TRUE; - break; - case BSIM4v4_MOD_WKETA: - mod->BSIM4v4wketa = value->rValue; - mod->BSIM4v4wketaGiven = TRUE; - break; - case BSIM4v4_MOD_WNSUB: - mod->BSIM4v4wnsub = value->rValue; - mod->BSIM4v4wnsubGiven = TRUE; - break; - case BSIM4v4_MOD_WNDEP: - mod->BSIM4v4wndep = value->rValue; - mod->BSIM4v4wndepGiven = TRUE; - if (mod->BSIM4v4wndep > 1.0e20) - mod->BSIM4v4wndep *= 1.0e-6; - break; - case BSIM4v4_MOD_WNSD: - mod->BSIM4v4wnsd = value->rValue; - mod->BSIM4v4wnsdGiven = TRUE; - if (mod->BSIM4v4wnsd > 1.0e23) - mod->BSIM4v4wnsd *= 1.0e-6; - break; - case BSIM4v4_MOD_WNGATE: - mod->BSIM4v4wngate = value->rValue; - mod->BSIM4v4wngateGiven = TRUE; - if (mod->BSIM4v4wngate > 1.0e23) - mod->BSIM4v4wngate *= 1.0e-6; - break; - case BSIM4v4_MOD_WGAMMA1: - mod->BSIM4v4wgamma1 = value->rValue; - mod->BSIM4v4wgamma1Given = TRUE; - break; - case BSIM4v4_MOD_WGAMMA2: - mod->BSIM4v4wgamma2 = value->rValue; - mod->BSIM4v4wgamma2Given = TRUE; - break; - case BSIM4v4_MOD_WVBX: - mod->BSIM4v4wvbx = value->rValue; - mod->BSIM4v4wvbxGiven = TRUE; - break; - case BSIM4v4_MOD_WVBM: - mod->BSIM4v4wvbm = value->rValue; - mod->BSIM4v4wvbmGiven = TRUE; - break; - case BSIM4v4_MOD_WXT: - mod->BSIM4v4wxt = value->rValue; - mod->BSIM4v4wxtGiven = TRUE; - break; - case BSIM4v4_MOD_WK1: - mod->BSIM4v4wk1 = value->rValue; - mod->BSIM4v4wk1Given = TRUE; - break; - case BSIM4v4_MOD_WKT1: - mod->BSIM4v4wkt1 = value->rValue; - mod->BSIM4v4wkt1Given = TRUE; - break; - case BSIM4v4_MOD_WKT1L: - mod->BSIM4v4wkt1l = value->rValue; - mod->BSIM4v4wkt1lGiven = TRUE; - break; - case BSIM4v4_MOD_WKT2: - mod->BSIM4v4wkt2 = value->rValue; - mod->BSIM4v4wkt2Given = TRUE; - break; - case BSIM4v4_MOD_WK2: - mod->BSIM4v4wk2 = value->rValue; - mod->BSIM4v4wk2Given = TRUE; - break; - case BSIM4v4_MOD_WK3: - mod->BSIM4v4wk3 = value->rValue; - mod->BSIM4v4wk3Given = TRUE; - break; - case BSIM4v4_MOD_WK3B: - mod->BSIM4v4wk3b = value->rValue; - mod->BSIM4v4wk3bGiven = TRUE; - break; - case BSIM4v4_MOD_WLPE0: - mod->BSIM4v4wlpe0 = value->rValue; - mod->BSIM4v4wlpe0Given = TRUE; - break; - case BSIM4v4_MOD_WLPEB: - mod->BSIM4v4wlpeb = value->rValue; - mod->BSIM4v4wlpebGiven = TRUE; - break; - case BSIM4v4_MOD_WDVTP0: - mod->BSIM4v4wdvtp0 = value->rValue; - mod->BSIM4v4wdvtp0Given = TRUE; - break; - case BSIM4v4_MOD_WDVTP1: - mod->BSIM4v4wdvtp1 = value->rValue; - mod->BSIM4v4wdvtp1Given = TRUE; - break; - case BSIM4v4_MOD_WW0: - mod->BSIM4v4ww0 = value->rValue; - mod->BSIM4v4ww0Given = TRUE; - break; - case BSIM4v4_MOD_WDVT0: - mod->BSIM4v4wdvt0 = value->rValue; - mod->BSIM4v4wdvt0Given = TRUE; - break; - case BSIM4v4_MOD_WDVT1: - mod->BSIM4v4wdvt1 = value->rValue; - mod->BSIM4v4wdvt1Given = TRUE; - break; - case BSIM4v4_MOD_WDVT2: - mod->BSIM4v4wdvt2 = value->rValue; - mod->BSIM4v4wdvt2Given = TRUE; - break; - case BSIM4v4_MOD_WDVT0W: - mod->BSIM4v4wdvt0w = value->rValue; - mod->BSIM4v4wdvt0wGiven = TRUE; - break; - case BSIM4v4_MOD_WDVT1W: - mod->BSIM4v4wdvt1w = value->rValue; - mod->BSIM4v4wdvt1wGiven = TRUE; - break; - case BSIM4v4_MOD_WDVT2W: - mod->BSIM4v4wdvt2w = value->rValue; - mod->BSIM4v4wdvt2wGiven = TRUE; - break; - case BSIM4v4_MOD_WDROUT: - mod->BSIM4v4wdrout = value->rValue; - mod->BSIM4v4wdroutGiven = TRUE; - break; - case BSIM4v4_MOD_WDSUB: - mod->BSIM4v4wdsub = value->rValue; - mod->BSIM4v4wdsubGiven = TRUE; - break; - case BSIM4v4_MOD_WVTH0: - mod->BSIM4v4wvth0 = value->rValue; - mod->BSIM4v4wvth0Given = TRUE; - break; - case BSIM4v4_MOD_WUA: - mod->BSIM4v4wua = value->rValue; - mod->BSIM4v4wuaGiven = TRUE; - break; - case BSIM4v4_MOD_WUA1: - mod->BSIM4v4wua1 = value->rValue; - mod->BSIM4v4wua1Given = TRUE; - break; - case BSIM4v4_MOD_WUB: - mod->BSIM4v4wub = value->rValue; - mod->BSIM4v4wubGiven = TRUE; - break; - case BSIM4v4_MOD_WUB1: - mod->BSIM4v4wub1 = value->rValue; - mod->BSIM4v4wub1Given = TRUE; - break; - case BSIM4v4_MOD_WUC: - mod->BSIM4v4wuc = value->rValue; - mod->BSIM4v4wucGiven = TRUE; - break; - case BSIM4v4_MOD_WUC1: - mod->BSIM4v4wuc1 = value->rValue; - mod->BSIM4v4wuc1Given = TRUE; - break; - case BSIM4v4_MOD_WU0 : - mod->BSIM4v4wu0 = value->rValue; - mod->BSIM4v4wu0Given = TRUE; - break; - case BSIM4v4_MOD_WUTE : - mod->BSIM4v4wute = value->rValue; - mod->BSIM4v4wuteGiven = TRUE; - break; - case BSIM4v4_MOD_WVOFF: - mod->BSIM4v4wvoff = value->rValue; - mod->BSIM4v4wvoffGiven = TRUE; - break; - case BSIM4v4_MOD_WMINV: - mod->BSIM4v4wminv = value->rValue; - mod->BSIM4v4wminvGiven = TRUE; - break; - case BSIM4v4_MOD_WFPROUT: - mod->BSIM4v4wfprout = value->rValue; - mod->BSIM4v4wfproutGiven = TRUE; - break; - case BSIM4v4_MOD_WPDITS: - mod->BSIM4v4wpdits = value->rValue; - mod->BSIM4v4wpditsGiven = TRUE; - break; - case BSIM4v4_MOD_WPDITSD: - mod->BSIM4v4wpditsd = value->rValue; - mod->BSIM4v4wpditsdGiven = TRUE; - break; - case BSIM4v4_MOD_WDELTA : - mod->BSIM4v4wdelta = value->rValue; - mod->BSIM4v4wdeltaGiven = TRUE; - break; - case BSIM4v4_MOD_WRDSW: - mod->BSIM4v4wrdsw = value->rValue; - mod->BSIM4v4wrdswGiven = TRUE; - break; - case BSIM4v4_MOD_WRDW: - mod->BSIM4v4wrdw = value->rValue; - mod->BSIM4v4wrdwGiven = TRUE; - break; - case BSIM4v4_MOD_WRSW: - mod->BSIM4v4wrsw = value->rValue; - mod->BSIM4v4wrswGiven = TRUE; - break; - case BSIM4v4_MOD_WPRWB: - mod->BSIM4v4wprwb = value->rValue; - mod->BSIM4v4wprwbGiven = TRUE; - break; - case BSIM4v4_MOD_WPRWG: - mod->BSIM4v4wprwg = value->rValue; - mod->BSIM4v4wprwgGiven = TRUE; - break; - case BSIM4v4_MOD_WPRT: - mod->BSIM4v4wprt = value->rValue; - mod->BSIM4v4wprtGiven = TRUE; - break; - case BSIM4v4_MOD_WETA0: - mod->BSIM4v4weta0 = value->rValue; - mod->BSIM4v4weta0Given = TRUE; - break; - case BSIM4v4_MOD_WETAB: - mod->BSIM4v4wetab = value->rValue; - mod->BSIM4v4wetabGiven = TRUE; - break; - case BSIM4v4_MOD_WPCLM: - mod->BSIM4v4wpclm = value->rValue; - mod->BSIM4v4wpclmGiven = TRUE; - break; - case BSIM4v4_MOD_WPDIBL1: - mod->BSIM4v4wpdibl1 = value->rValue; - mod->BSIM4v4wpdibl1Given = TRUE; - break; - case BSIM4v4_MOD_WPDIBL2: - mod->BSIM4v4wpdibl2 = value->rValue; - mod->BSIM4v4wpdibl2Given = TRUE; - break; - case BSIM4v4_MOD_WPDIBLB: - mod->BSIM4v4wpdiblb = value->rValue; - mod->BSIM4v4wpdiblbGiven = TRUE; - break; - case BSIM4v4_MOD_WPSCBE1: - mod->BSIM4v4wpscbe1 = value->rValue; - mod->BSIM4v4wpscbe1Given = TRUE; - break; - case BSIM4v4_MOD_WPSCBE2: - mod->BSIM4v4wpscbe2 = value->rValue; - mod->BSIM4v4wpscbe2Given = TRUE; - break; - case BSIM4v4_MOD_WPVAG: - mod->BSIM4v4wpvag = value->rValue; - mod->BSIM4v4wpvagGiven = TRUE; - break; - case BSIM4v4_MOD_WWR : - mod->BSIM4v4wwr = value->rValue; - mod->BSIM4v4wwrGiven = TRUE; - break; - case BSIM4v4_MOD_WDWG : - mod->BSIM4v4wdwg = value->rValue; - mod->BSIM4v4wdwgGiven = TRUE; - break; - case BSIM4v4_MOD_WDWB : - mod->BSIM4v4wdwb = value->rValue; - mod->BSIM4v4wdwbGiven = TRUE; - break; - case BSIM4v4_MOD_WB0 : - mod->BSIM4v4wb0 = value->rValue; - mod->BSIM4v4wb0Given = TRUE; - break; - case BSIM4v4_MOD_WB1 : - mod->BSIM4v4wb1 = value->rValue; - mod->BSIM4v4wb1Given = TRUE; - break; - case BSIM4v4_MOD_WALPHA0 : - mod->BSIM4v4walpha0 = value->rValue; - mod->BSIM4v4walpha0Given = TRUE; - break; - case BSIM4v4_MOD_WALPHA1 : - mod->BSIM4v4walpha1 = value->rValue; - mod->BSIM4v4walpha1Given = TRUE; - break; - case BSIM4v4_MOD_WBETA0 : - mod->BSIM4v4wbeta0 = value->rValue; - mod->BSIM4v4wbeta0Given = TRUE; - break; - case BSIM4v4_MOD_WAGIDL : - mod->BSIM4v4wagidl = value->rValue; - mod->BSIM4v4wagidlGiven = TRUE; - break; - case BSIM4v4_MOD_WBGIDL : - mod->BSIM4v4wbgidl = value->rValue; - mod->BSIM4v4wbgidlGiven = TRUE; - break; - case BSIM4v4_MOD_WCGIDL : - mod->BSIM4v4wcgidl = value->rValue; - mod->BSIM4v4wcgidlGiven = TRUE; - break; - case BSIM4v4_MOD_WPHIN : - mod->BSIM4v4wphin = value->rValue; - mod->BSIM4v4wphinGiven = TRUE; - break; - case BSIM4v4_MOD_WEGIDL : - mod->BSIM4v4wegidl = value->rValue; - mod->BSIM4v4wegidlGiven = TRUE; - break; - case BSIM4v4_MOD_WAIGC : - mod->BSIM4v4waigc = value->rValue; - mod->BSIM4v4waigcGiven = TRUE; - break; - case BSIM4v4_MOD_WBIGC : - mod->BSIM4v4wbigc = value->rValue; - mod->BSIM4v4wbigcGiven = TRUE; - break; - case BSIM4v4_MOD_WCIGC : - mod->BSIM4v4wcigc = value->rValue; - mod->BSIM4v4wcigcGiven = TRUE; - break; - case BSIM4v4_MOD_WAIGSD : - mod->BSIM4v4waigsd = value->rValue; - mod->BSIM4v4waigsdGiven = TRUE; - break; - case BSIM4v4_MOD_WBIGSD : - mod->BSIM4v4wbigsd = value->rValue; - mod->BSIM4v4wbigsdGiven = TRUE; - break; - case BSIM4v4_MOD_WCIGSD : - mod->BSIM4v4wcigsd = value->rValue; - mod->BSIM4v4wcigsdGiven = TRUE; - break; - case BSIM4v4_MOD_WAIGBACC : - mod->BSIM4v4waigbacc = value->rValue; - mod->BSIM4v4waigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_WBIGBACC : - mod->BSIM4v4wbigbacc = value->rValue; - mod->BSIM4v4wbigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_WCIGBACC : - mod->BSIM4v4wcigbacc = value->rValue; - mod->BSIM4v4wcigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_WAIGBINV : - mod->BSIM4v4waigbinv = value->rValue; - mod->BSIM4v4waigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_WBIGBINV : - mod->BSIM4v4wbigbinv = value->rValue; - mod->BSIM4v4wbigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_WCIGBINV : - mod->BSIM4v4wcigbinv = value->rValue; - mod->BSIM4v4wcigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_WNIGC : - mod->BSIM4v4wnigc = value->rValue; - mod->BSIM4v4wnigcGiven = TRUE; - break; - case BSIM4v4_MOD_WNIGBINV : - mod->BSIM4v4wnigbinv = value->rValue; - mod->BSIM4v4wnigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_WNIGBACC : - mod->BSIM4v4wnigbacc = value->rValue; - mod->BSIM4v4wnigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_WNTOX : - mod->BSIM4v4wntox = value->rValue; - mod->BSIM4v4wntoxGiven = TRUE; - break; - case BSIM4v4_MOD_WEIGBINV : - mod->BSIM4v4weigbinv = value->rValue; - mod->BSIM4v4weigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_WPIGCD : - mod->BSIM4v4wpigcd = value->rValue; - mod->BSIM4v4wpigcdGiven = TRUE; - break; - case BSIM4v4_MOD_WPOXEDGE : - mod->BSIM4v4wpoxedge = value->rValue; - mod->BSIM4v4wpoxedgeGiven = TRUE; - break; - case BSIM4v4_MOD_WXRCRG1 : - mod->BSIM4v4wxrcrg1 = value->rValue; - mod->BSIM4v4wxrcrg1Given = TRUE; - break; - case BSIM4v4_MOD_WXRCRG2 : - mod->BSIM4v4wxrcrg2 = value->rValue; - mod->BSIM4v4wxrcrg2Given = TRUE; - break; - case BSIM4v4_MOD_WLAMBDA : - mod->BSIM4v4wlambda = value->rValue; - mod->BSIM4v4wlambdaGiven = TRUE; - break; - case BSIM4v4_MOD_WVTL : - mod->BSIM4v4wvtl = value->rValue; - mod->BSIM4v4wvtlGiven = TRUE; - break; - case BSIM4v4_MOD_WXN: - mod->BSIM4v4wxn = value->rValue; - mod->BSIM4v4wxnGiven = TRUE; - break; - case BSIM4v4_MOD_WVFBSDOFF: - mod->BSIM4v4wvfbsdoff = value->rValue; - mod->BSIM4v4wvfbsdoffGiven = TRUE; - break; - case BSIM4v4_MOD_WEU : - mod->BSIM4v4weu = value->rValue; - mod->BSIM4v4weuGiven = TRUE; - break; - case BSIM4v4_MOD_WVFB : - mod->BSIM4v4wvfb = value->rValue; - mod->BSIM4v4wvfbGiven = TRUE; - break; - case BSIM4v4_MOD_WCGSL : - mod->BSIM4v4wcgsl = value->rValue; - mod->BSIM4v4wcgslGiven = TRUE; - break; - case BSIM4v4_MOD_WCGDL : - mod->BSIM4v4wcgdl = value->rValue; - mod->BSIM4v4wcgdlGiven = TRUE; - break; - case BSIM4v4_MOD_WCKAPPAS : - mod->BSIM4v4wckappas = value->rValue; - mod->BSIM4v4wckappasGiven = TRUE; - break; - case BSIM4v4_MOD_WCKAPPAD : - mod->BSIM4v4wckappad = value->rValue; - mod->BSIM4v4wckappadGiven = TRUE; - break; - case BSIM4v4_MOD_WCF : - mod->BSIM4v4wcf = value->rValue; - mod->BSIM4v4wcfGiven = TRUE; - break; - case BSIM4v4_MOD_WCLC : - mod->BSIM4v4wclc = value->rValue; - mod->BSIM4v4wclcGiven = TRUE; - break; - case BSIM4v4_MOD_WCLE : - mod->BSIM4v4wcle = value->rValue; - mod->BSIM4v4wcleGiven = TRUE; - break; - case BSIM4v4_MOD_WVFBCV : - mod->BSIM4v4wvfbcv = value->rValue; - mod->BSIM4v4wvfbcvGiven = TRUE; - break; - case BSIM4v4_MOD_WACDE : - mod->BSIM4v4wacde = value->rValue; - mod->BSIM4v4wacdeGiven = TRUE; - break; - case BSIM4v4_MOD_WMOIN : - mod->BSIM4v4wmoin = value->rValue; - mod->BSIM4v4wmoinGiven = TRUE; - break; - case BSIM4v4_MOD_WNOFF : - mod->BSIM4v4wnoff = value->rValue; - mod->BSIM4v4wnoffGiven = TRUE; - break; - case BSIM4v4_MOD_WVOFFCV : - mod->BSIM4v4wvoffcv = value->rValue; - mod->BSIM4v4wvoffcvGiven = TRUE; - break; - - /* Cross-term dependence */ - case BSIM4v4_MOD_PCDSC : - mod->BSIM4v4pcdsc = value->rValue; - mod->BSIM4v4pcdscGiven = TRUE; - break; - - - case BSIM4v4_MOD_PCDSCB : - mod->BSIM4v4pcdscb = value->rValue; - mod->BSIM4v4pcdscbGiven = TRUE; - break; - case BSIM4v4_MOD_PCDSCD : - mod->BSIM4v4pcdscd = value->rValue; - mod->BSIM4v4pcdscdGiven = TRUE; - break; - case BSIM4v4_MOD_PCIT : - mod->BSIM4v4pcit = value->rValue; - mod->BSIM4v4pcitGiven = TRUE; - break; - case BSIM4v4_MOD_PNFACTOR : - mod->BSIM4v4pnfactor = value->rValue; - mod->BSIM4v4pnfactorGiven = TRUE; - break; - case BSIM4v4_MOD_PXJ: - mod->BSIM4v4pxj = value->rValue; - mod->BSIM4v4pxjGiven = TRUE; - break; - case BSIM4v4_MOD_PVSAT: - mod->BSIM4v4pvsat = value->rValue; - mod->BSIM4v4pvsatGiven = TRUE; - break; - - - case BSIM4v4_MOD_PA0: - mod->BSIM4v4pa0 = value->rValue; - mod->BSIM4v4pa0Given = TRUE; - break; - case BSIM4v4_MOD_PAGS: - mod->BSIM4v4pags = value->rValue; - mod->BSIM4v4pagsGiven = TRUE; - break; - case BSIM4v4_MOD_PA1: - mod->BSIM4v4pa1 = value->rValue; - mod->BSIM4v4pa1Given = TRUE; - break; - case BSIM4v4_MOD_PA2: - mod->BSIM4v4pa2 = value->rValue; - mod->BSIM4v4pa2Given = TRUE; - break; - case BSIM4v4_MOD_PAT: - mod->BSIM4v4pat = value->rValue; - mod->BSIM4v4patGiven = TRUE; - break; - case BSIM4v4_MOD_PKETA: - mod->BSIM4v4pketa = value->rValue; - mod->BSIM4v4pketaGiven = TRUE; - break; - case BSIM4v4_MOD_PNSUB: - mod->BSIM4v4pnsub = value->rValue; - mod->BSIM4v4pnsubGiven = TRUE; - break; - case BSIM4v4_MOD_PNDEP: - mod->BSIM4v4pndep = value->rValue; - mod->BSIM4v4pndepGiven = TRUE; - if (mod->BSIM4v4pndep > 1.0e20) - mod->BSIM4v4pndep *= 1.0e-6; - break; - case BSIM4v4_MOD_PNSD: - mod->BSIM4v4pnsd = value->rValue; - mod->BSIM4v4pnsdGiven = TRUE; - if (mod->BSIM4v4pnsd > 1.0e23) - mod->BSIM4v4pnsd *= 1.0e-6; - break; - case BSIM4v4_MOD_PNGATE: - mod->BSIM4v4pngate = value->rValue; - mod->BSIM4v4pngateGiven = TRUE; - if (mod->BSIM4v4pngate > 1.0e23) - mod->BSIM4v4pngate *= 1.0e-6; - break; - case BSIM4v4_MOD_PGAMMA1: - mod->BSIM4v4pgamma1 = value->rValue; - mod->BSIM4v4pgamma1Given = TRUE; - break; - case BSIM4v4_MOD_PGAMMA2: - mod->BSIM4v4pgamma2 = value->rValue; - mod->BSIM4v4pgamma2Given = TRUE; - break; - case BSIM4v4_MOD_PVBX: - mod->BSIM4v4pvbx = value->rValue; - mod->BSIM4v4pvbxGiven = TRUE; - break; - case BSIM4v4_MOD_PVBM: - mod->BSIM4v4pvbm = value->rValue; - mod->BSIM4v4pvbmGiven = TRUE; - break; - case BSIM4v4_MOD_PXT: - mod->BSIM4v4pxt = value->rValue; - mod->BSIM4v4pxtGiven = TRUE; - break; - case BSIM4v4_MOD_PK1: - mod->BSIM4v4pk1 = value->rValue; - mod->BSIM4v4pk1Given = TRUE; - break; - case BSIM4v4_MOD_PKT1: - mod->BSIM4v4pkt1 = value->rValue; - mod->BSIM4v4pkt1Given = TRUE; - break; - case BSIM4v4_MOD_PKT1L: - mod->BSIM4v4pkt1l = value->rValue; - mod->BSIM4v4pkt1lGiven = TRUE; - break; - case BSIM4v4_MOD_PKT2: - mod->BSIM4v4pkt2 = value->rValue; - mod->BSIM4v4pkt2Given = TRUE; - break; - case BSIM4v4_MOD_PK2: - mod->BSIM4v4pk2 = value->rValue; - mod->BSIM4v4pk2Given = TRUE; - break; - case BSIM4v4_MOD_PK3: - mod->BSIM4v4pk3 = value->rValue; - mod->BSIM4v4pk3Given = TRUE; - break; - case BSIM4v4_MOD_PK3B: - mod->BSIM4v4pk3b = value->rValue; - mod->BSIM4v4pk3bGiven = TRUE; - break; - case BSIM4v4_MOD_PLPE0: - mod->BSIM4v4plpe0 = value->rValue; - mod->BSIM4v4plpe0Given = TRUE; - break; - case BSIM4v4_MOD_PLPEB: - mod->BSIM4v4plpeb = value->rValue; - mod->BSIM4v4plpebGiven = TRUE; - break; - case BSIM4v4_MOD_PDVTP0: - mod->BSIM4v4pdvtp0 = value->rValue; - mod->BSIM4v4pdvtp0Given = TRUE; - break; - case BSIM4v4_MOD_PDVTP1: - mod->BSIM4v4pdvtp1 = value->rValue; - mod->BSIM4v4pdvtp1Given = TRUE; - break; - case BSIM4v4_MOD_PW0: - mod->BSIM4v4pw0 = value->rValue; - mod->BSIM4v4pw0Given = TRUE; - break; - case BSIM4v4_MOD_PDVT0: - mod->BSIM4v4pdvt0 = value->rValue; - mod->BSIM4v4pdvt0Given = TRUE; - break; - case BSIM4v4_MOD_PDVT1: - mod->BSIM4v4pdvt1 = value->rValue; - mod->BSIM4v4pdvt1Given = TRUE; - break; - case BSIM4v4_MOD_PDVT2: - mod->BSIM4v4pdvt2 = value->rValue; - mod->BSIM4v4pdvt2Given = TRUE; - break; - case BSIM4v4_MOD_PDVT0W: - mod->BSIM4v4pdvt0w = value->rValue; - mod->BSIM4v4pdvt0wGiven = TRUE; - break; - case BSIM4v4_MOD_PDVT1W: - mod->BSIM4v4pdvt1w = value->rValue; - mod->BSIM4v4pdvt1wGiven = TRUE; - break; - case BSIM4v4_MOD_PDVT2W: - mod->BSIM4v4pdvt2w = value->rValue; - mod->BSIM4v4pdvt2wGiven = TRUE; - break; - case BSIM4v4_MOD_PDROUT: - mod->BSIM4v4pdrout = value->rValue; - mod->BSIM4v4pdroutGiven = TRUE; - break; - case BSIM4v4_MOD_PDSUB: - mod->BSIM4v4pdsub = value->rValue; - mod->BSIM4v4pdsubGiven = TRUE; - break; - case BSIM4v4_MOD_PVTH0: - mod->BSIM4v4pvth0 = value->rValue; - mod->BSIM4v4pvth0Given = TRUE; - break; - case BSIM4v4_MOD_PUA: - mod->BSIM4v4pua = value->rValue; - mod->BSIM4v4puaGiven = TRUE; - break; - case BSIM4v4_MOD_PUA1: - mod->BSIM4v4pua1 = value->rValue; - mod->BSIM4v4pua1Given = TRUE; - break; - case BSIM4v4_MOD_PUB: - mod->BSIM4v4pub = value->rValue; - mod->BSIM4v4pubGiven = TRUE; - break; - case BSIM4v4_MOD_PUB1: - mod->BSIM4v4pub1 = value->rValue; - mod->BSIM4v4pub1Given = TRUE; - break; - case BSIM4v4_MOD_PUC: - mod->BSIM4v4puc = value->rValue; - mod->BSIM4v4pucGiven = TRUE; - break; - case BSIM4v4_MOD_PUC1: - mod->BSIM4v4puc1 = value->rValue; - mod->BSIM4v4puc1Given = TRUE; - break; - case BSIM4v4_MOD_PU0 : - mod->BSIM4v4pu0 = value->rValue; - mod->BSIM4v4pu0Given = TRUE; - break; - case BSIM4v4_MOD_PUTE : - mod->BSIM4v4pute = value->rValue; - mod->BSIM4v4puteGiven = TRUE; - break; - case BSIM4v4_MOD_PVOFF: - mod->BSIM4v4pvoff = value->rValue; - mod->BSIM4v4pvoffGiven = TRUE; - break; - case BSIM4v4_MOD_PMINV: - mod->BSIM4v4pminv = value->rValue; - mod->BSIM4v4pminvGiven = TRUE; - break; - case BSIM4v4_MOD_PFPROUT: - mod->BSIM4v4pfprout = value->rValue; - mod->BSIM4v4pfproutGiven = TRUE; - break; - case BSIM4v4_MOD_PPDITS: - mod->BSIM4v4ppdits = value->rValue; - mod->BSIM4v4ppditsGiven = TRUE; - break; - case BSIM4v4_MOD_PPDITSD: - mod->BSIM4v4ppditsd = value->rValue; - mod->BSIM4v4ppditsdGiven = TRUE; - break; - case BSIM4v4_MOD_PDELTA : - mod->BSIM4v4pdelta = value->rValue; - mod->BSIM4v4pdeltaGiven = TRUE; - break; - case BSIM4v4_MOD_PRDSW: - mod->BSIM4v4prdsw = value->rValue; - mod->BSIM4v4prdswGiven = TRUE; - break; - case BSIM4v4_MOD_PRDW: - mod->BSIM4v4prdw = value->rValue; - mod->BSIM4v4prdwGiven = TRUE; - break; - case BSIM4v4_MOD_PRSW: - mod->BSIM4v4prsw = value->rValue; - mod->BSIM4v4prswGiven = TRUE; - break; - case BSIM4v4_MOD_PPRWB: - mod->BSIM4v4pprwb = value->rValue; - mod->BSIM4v4pprwbGiven = TRUE; - break; - case BSIM4v4_MOD_PPRWG: - mod->BSIM4v4pprwg = value->rValue; - mod->BSIM4v4pprwgGiven = TRUE; - break; - case BSIM4v4_MOD_PPRT: - mod->BSIM4v4pprt = value->rValue; - mod->BSIM4v4pprtGiven = TRUE; - break; - case BSIM4v4_MOD_PETA0: - mod->BSIM4v4peta0 = value->rValue; - mod->BSIM4v4peta0Given = TRUE; - break; - case BSIM4v4_MOD_PETAB: - mod->BSIM4v4petab = value->rValue; - mod->BSIM4v4petabGiven = TRUE; - break; - case BSIM4v4_MOD_PPCLM: - mod->BSIM4v4ppclm = value->rValue; - mod->BSIM4v4ppclmGiven = TRUE; - break; - case BSIM4v4_MOD_PPDIBL1: - mod->BSIM4v4ppdibl1 = value->rValue; - mod->BSIM4v4ppdibl1Given = TRUE; - break; - case BSIM4v4_MOD_PPDIBL2: - mod->BSIM4v4ppdibl2 = value->rValue; - mod->BSIM4v4ppdibl2Given = TRUE; - break; - case BSIM4v4_MOD_PPDIBLB: - mod->BSIM4v4ppdiblb = value->rValue; - mod->BSIM4v4ppdiblbGiven = TRUE; - break; - case BSIM4v4_MOD_PPSCBE1: - mod->BSIM4v4ppscbe1 = value->rValue; - mod->BSIM4v4ppscbe1Given = TRUE; - break; - case BSIM4v4_MOD_PPSCBE2: - mod->BSIM4v4ppscbe2 = value->rValue; - mod->BSIM4v4ppscbe2Given = TRUE; - break; - case BSIM4v4_MOD_PPVAG: - mod->BSIM4v4ppvag = value->rValue; - mod->BSIM4v4ppvagGiven = TRUE; - break; - case BSIM4v4_MOD_PWR : - mod->BSIM4v4pwr = value->rValue; - mod->BSIM4v4pwrGiven = TRUE; - break; - case BSIM4v4_MOD_PDWG : - mod->BSIM4v4pdwg = value->rValue; - mod->BSIM4v4pdwgGiven = TRUE; - break; - case BSIM4v4_MOD_PDWB : - mod->BSIM4v4pdwb = value->rValue; - mod->BSIM4v4pdwbGiven = TRUE; - break; - case BSIM4v4_MOD_PB0 : - mod->BSIM4v4pb0 = value->rValue; - mod->BSIM4v4pb0Given = TRUE; - break; - case BSIM4v4_MOD_PB1 : - mod->BSIM4v4pb1 = value->rValue; - mod->BSIM4v4pb1Given = TRUE; - break; - case BSIM4v4_MOD_PALPHA0 : - mod->BSIM4v4palpha0 = value->rValue; - mod->BSIM4v4palpha0Given = TRUE; - break; - case BSIM4v4_MOD_PALPHA1 : - mod->BSIM4v4palpha1 = value->rValue; - mod->BSIM4v4palpha1Given = TRUE; - break; - case BSIM4v4_MOD_PBETA0 : - mod->BSIM4v4pbeta0 = value->rValue; - mod->BSIM4v4pbeta0Given = TRUE; - break; - case BSIM4v4_MOD_PAGIDL : - mod->BSIM4v4pagidl = value->rValue; - mod->BSIM4v4pagidlGiven = TRUE; - break; - case BSIM4v4_MOD_PBGIDL : - mod->BSIM4v4pbgidl = value->rValue; - mod->BSIM4v4pbgidlGiven = TRUE; - break; - case BSIM4v4_MOD_PCGIDL : - mod->BSIM4v4pcgidl = value->rValue; - mod->BSIM4v4pcgidlGiven = TRUE; - break; - case BSIM4v4_MOD_PPHIN : - mod->BSIM4v4pphin = value->rValue; - mod->BSIM4v4pphinGiven = TRUE; - break; - case BSIM4v4_MOD_PEGIDL : - mod->BSIM4v4pegidl = value->rValue; - mod->BSIM4v4pegidlGiven = TRUE; - break; - case BSIM4v4_MOD_PAIGC : - mod->BSIM4v4paigc = value->rValue; - mod->BSIM4v4paigcGiven = TRUE; - break; - case BSIM4v4_MOD_PBIGC : - mod->BSIM4v4pbigc = value->rValue; - mod->BSIM4v4pbigcGiven = TRUE; - break; - case BSIM4v4_MOD_PCIGC : - mod->BSIM4v4pcigc = value->rValue; - mod->BSIM4v4pcigcGiven = TRUE; - break; - case BSIM4v4_MOD_PAIGSD : - mod->BSIM4v4paigsd = value->rValue; - mod->BSIM4v4paigsdGiven = TRUE; - break; - case BSIM4v4_MOD_PBIGSD : - mod->BSIM4v4pbigsd = value->rValue; - mod->BSIM4v4pbigsdGiven = TRUE; - break; - case BSIM4v4_MOD_PCIGSD : - mod->BSIM4v4pcigsd = value->rValue; - mod->BSIM4v4pcigsdGiven = TRUE; - break; - case BSIM4v4_MOD_PAIGBACC : - mod->BSIM4v4paigbacc = value->rValue; - mod->BSIM4v4paigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_PBIGBACC : - mod->BSIM4v4pbigbacc = value->rValue; - mod->BSIM4v4pbigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_PCIGBACC : - mod->BSIM4v4pcigbacc = value->rValue; - mod->BSIM4v4pcigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_PAIGBINV : - mod->BSIM4v4paigbinv = value->rValue; - mod->BSIM4v4paigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_PBIGBINV : - mod->BSIM4v4pbigbinv = value->rValue; - mod->BSIM4v4pbigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_PCIGBINV : - mod->BSIM4v4pcigbinv = value->rValue; - mod->BSIM4v4pcigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_PNIGC : - mod->BSIM4v4pnigc = value->rValue; - mod->BSIM4v4pnigcGiven = TRUE; - break; - case BSIM4v4_MOD_PNIGBINV : - mod->BSIM4v4pnigbinv = value->rValue; - mod->BSIM4v4pnigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_PNIGBACC : - mod->BSIM4v4pnigbacc = value->rValue; - mod->BSIM4v4pnigbaccGiven = TRUE; - break; - case BSIM4v4_MOD_PNTOX : - mod->BSIM4v4pntox = value->rValue; - mod->BSIM4v4pntoxGiven = TRUE; - break; - case BSIM4v4_MOD_PEIGBINV : - mod->BSIM4v4peigbinv = value->rValue; - mod->BSIM4v4peigbinvGiven = TRUE; - break; - case BSIM4v4_MOD_PPIGCD : - mod->BSIM4v4ppigcd = value->rValue; - mod->BSIM4v4ppigcdGiven = TRUE; - break; - case BSIM4v4_MOD_PPOXEDGE : - mod->BSIM4v4ppoxedge = value->rValue; - mod->BSIM4v4ppoxedgeGiven = TRUE; - break; - case BSIM4v4_MOD_PXRCRG1 : - mod->BSIM4v4pxrcrg1 = value->rValue; - mod->BSIM4v4pxrcrg1Given = TRUE; - break; - case BSIM4v4_MOD_PXRCRG2 : - mod->BSIM4v4pxrcrg2 = value->rValue; - mod->BSIM4v4pxrcrg2Given = TRUE; - break; - case BSIM4v4_MOD_PLAMBDA : - mod->BSIM4v4plambda = value->rValue; - mod->BSIM4v4plambdaGiven = TRUE; - break; - case BSIM4v4_MOD_PVTL : - mod->BSIM4v4pvtl = value->rValue; - mod->BSIM4v4pvtlGiven = TRUE; - break; - case BSIM4v4_MOD_PXN: - mod->BSIM4v4pxn = value->rValue; - mod->BSIM4v4pxnGiven = TRUE; - break; - case BSIM4v4_MOD_PVFBSDOFF: - mod->BSIM4v4pvfbsdoff = value->rValue; - mod->BSIM4v4pvfbsdoffGiven = TRUE; - break; - case BSIM4v4_MOD_PEU : - mod->BSIM4v4peu = value->rValue; - mod->BSIM4v4peuGiven = TRUE; - break; - case BSIM4v4_MOD_PVFB : - mod->BSIM4v4pvfb = value->rValue; - mod->BSIM4v4pvfbGiven = TRUE; - break; - case BSIM4v4_MOD_PCGSL : - mod->BSIM4v4pcgsl = value->rValue; - mod->BSIM4v4pcgslGiven = TRUE; - break; - case BSIM4v4_MOD_PCGDL : - mod->BSIM4v4pcgdl = value->rValue; - mod->BSIM4v4pcgdlGiven = TRUE; - break; - case BSIM4v4_MOD_PCKAPPAS : - mod->BSIM4v4pckappas = value->rValue; - mod->BSIM4v4pckappasGiven = TRUE; - break; - case BSIM4v4_MOD_PCKAPPAD : - mod->BSIM4v4pckappad = value->rValue; - mod->BSIM4v4pckappadGiven = TRUE; - break; - case BSIM4v4_MOD_PCF : - mod->BSIM4v4pcf = value->rValue; - mod->BSIM4v4pcfGiven = TRUE; - break; - case BSIM4v4_MOD_PCLC : - mod->BSIM4v4pclc = value->rValue; - mod->BSIM4v4pclcGiven = TRUE; - break; - case BSIM4v4_MOD_PCLE : - mod->BSIM4v4pcle = value->rValue; - mod->BSIM4v4pcleGiven = TRUE; - break; - case BSIM4v4_MOD_PVFBCV : - mod->BSIM4v4pvfbcv = value->rValue; - mod->BSIM4v4pvfbcvGiven = TRUE; - break; - case BSIM4v4_MOD_PACDE : - mod->BSIM4v4pacde = value->rValue; - mod->BSIM4v4pacdeGiven = TRUE; - break; - case BSIM4v4_MOD_PMOIN : - mod->BSIM4v4pmoin = value->rValue; - mod->BSIM4v4pmoinGiven = TRUE; - break; - case BSIM4v4_MOD_PNOFF : - mod->BSIM4v4pnoff = value->rValue; - mod->BSIM4v4pnoffGiven = TRUE; - break; - case BSIM4v4_MOD_PVOFFCV : - mod->BSIM4v4pvoffcv = value->rValue; - mod->BSIM4v4pvoffcvGiven = TRUE; - break; - - case BSIM4v4_MOD_TNOM : - mod->BSIM4v4tnom = value->rValue + CONSTCtoK; - mod->BSIM4v4tnomGiven = TRUE; - break; - case BSIM4v4_MOD_CGSO : - mod->BSIM4v4cgso = value->rValue; - mod->BSIM4v4cgsoGiven = TRUE; - break; - case BSIM4v4_MOD_CGDO : - mod->BSIM4v4cgdo = value->rValue; - mod->BSIM4v4cgdoGiven = TRUE; - break; - case BSIM4v4_MOD_CGBO : - mod->BSIM4v4cgbo = value->rValue; - mod->BSIM4v4cgboGiven = TRUE; - break; - case BSIM4v4_MOD_XPART : - mod->BSIM4v4xpart = value->rValue; - mod->BSIM4v4xpartGiven = TRUE; - break; - case BSIM4v4_MOD_RSH : - mod->BSIM4v4sheetResistance = value->rValue; - mod->BSIM4v4sheetResistanceGiven = TRUE; - break; - case BSIM4v4_MOD_JSS : - mod->BSIM4v4SjctSatCurDensity = value->rValue; - mod->BSIM4v4SjctSatCurDensityGiven = TRUE; - break; - case BSIM4v4_MOD_JSWS : - mod->BSIM4v4SjctSidewallSatCurDensity = value->rValue; - mod->BSIM4v4SjctSidewallSatCurDensityGiven = TRUE; - break; - case BSIM4v4_MOD_JSWGS : - mod->BSIM4v4SjctGateSidewallSatCurDensity = value->rValue; - mod->BSIM4v4SjctGateSidewallSatCurDensityGiven = TRUE; - break; - case BSIM4v4_MOD_PBS : - mod->BSIM4v4SbulkJctPotential = value->rValue; - mod->BSIM4v4SbulkJctPotentialGiven = TRUE; - break; - case BSIM4v4_MOD_MJS : - mod->BSIM4v4SbulkJctBotGradingCoeff = value->rValue; - mod->BSIM4v4SbulkJctBotGradingCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_PBSWS : - mod->BSIM4v4SsidewallJctPotential = value->rValue; - mod->BSIM4v4SsidewallJctPotentialGiven = TRUE; - break; - case BSIM4v4_MOD_MJSWS : - mod->BSIM4v4SbulkJctSideGradingCoeff = value->rValue; - mod->BSIM4v4SbulkJctSideGradingCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_CJS : - mod->BSIM4v4SunitAreaJctCap = value->rValue; - mod->BSIM4v4SunitAreaJctCapGiven = TRUE; - break; - case BSIM4v4_MOD_CJSWS : - mod->BSIM4v4SunitLengthSidewallJctCap = value->rValue; - mod->BSIM4v4SunitLengthSidewallJctCapGiven = TRUE; - break; - case BSIM4v4_MOD_NJS : - mod->BSIM4v4SjctEmissionCoeff = value->rValue; - mod->BSIM4v4SjctEmissionCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_PBSWGS : - mod->BSIM4v4SGatesidewallJctPotential = value->rValue; - mod->BSIM4v4SGatesidewallJctPotentialGiven = TRUE; - break; - case BSIM4v4_MOD_MJSWGS : - mod->BSIM4v4SbulkJctGateSideGradingCoeff = value->rValue; - mod->BSIM4v4SbulkJctGateSideGradingCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_CJSWGS : - mod->BSIM4v4SunitLengthGateSidewallJctCap = value->rValue; - mod->BSIM4v4SunitLengthGateSidewallJctCapGiven = TRUE; - break; - case BSIM4v4_MOD_XTIS : - mod->BSIM4v4SjctTempExponent = value->rValue; - mod->BSIM4v4SjctTempExponentGiven = TRUE; - break; - case BSIM4v4_MOD_JSD : - mod->BSIM4v4DjctSatCurDensity = value->rValue; - mod->BSIM4v4DjctSatCurDensityGiven = TRUE; - break; - case BSIM4v4_MOD_JSWD : - mod->BSIM4v4DjctSidewallSatCurDensity = value->rValue; - mod->BSIM4v4DjctSidewallSatCurDensityGiven = TRUE; - break; - case BSIM4v4_MOD_JSWGD : - mod->BSIM4v4DjctGateSidewallSatCurDensity = value->rValue; - mod->BSIM4v4DjctGateSidewallSatCurDensityGiven = TRUE; - break; - case BSIM4v4_MOD_PBD : - mod->BSIM4v4DbulkJctPotential = value->rValue; - mod->BSIM4v4DbulkJctPotentialGiven = TRUE; - break; - case BSIM4v4_MOD_MJD : - mod->BSIM4v4DbulkJctBotGradingCoeff = value->rValue; - mod->BSIM4v4DbulkJctBotGradingCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_PBSWD : - mod->BSIM4v4DsidewallJctPotential = value->rValue; - mod->BSIM4v4DsidewallJctPotentialGiven = TRUE; - break; - case BSIM4v4_MOD_MJSWD : - mod->BSIM4v4DbulkJctSideGradingCoeff = value->rValue; - mod->BSIM4v4DbulkJctSideGradingCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_CJD : - mod->BSIM4v4DunitAreaJctCap = value->rValue; - mod->BSIM4v4DunitAreaJctCapGiven = TRUE; - break; - case BSIM4v4_MOD_CJSWD : - mod->BSIM4v4DunitLengthSidewallJctCap = value->rValue; - mod->BSIM4v4DunitLengthSidewallJctCapGiven = TRUE; - break; - case BSIM4v4_MOD_NJD : - mod->BSIM4v4DjctEmissionCoeff = value->rValue; - mod->BSIM4v4DjctEmissionCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_PBSWGD : - mod->BSIM4v4DGatesidewallJctPotential = value->rValue; - mod->BSIM4v4DGatesidewallJctPotentialGiven = TRUE; - break; - case BSIM4v4_MOD_MJSWGD : - mod->BSIM4v4DbulkJctGateSideGradingCoeff = value->rValue; - mod->BSIM4v4DbulkJctGateSideGradingCoeffGiven = TRUE; - break; - case BSIM4v4_MOD_CJSWGD : - mod->BSIM4v4DunitLengthGateSidewallJctCap = value->rValue; - mod->BSIM4v4DunitLengthGateSidewallJctCapGiven = TRUE; - break; - case BSIM4v4_MOD_XTID : - mod->BSIM4v4DjctTempExponent = value->rValue; - mod->BSIM4v4DjctTempExponentGiven = TRUE; - break; - case BSIM4v4_MOD_LINT : - mod->BSIM4v4Lint = value->rValue; - mod->BSIM4v4LintGiven = TRUE; - break; - case BSIM4v4_MOD_LL : - mod->BSIM4v4Ll = value->rValue; - mod->BSIM4v4LlGiven = TRUE; - break; - case BSIM4v4_MOD_LLC : - mod->BSIM4v4Llc = value->rValue; - mod->BSIM4v4LlcGiven = TRUE; - break; - case BSIM4v4_MOD_LLN : - mod->BSIM4v4Lln = value->rValue; - mod->BSIM4v4LlnGiven = TRUE; - break; - case BSIM4v4_MOD_LW : - mod->BSIM4v4Lw = value->rValue; - mod->BSIM4v4LwGiven = TRUE; - break; - case BSIM4v4_MOD_LWC : - mod->BSIM4v4Lwc = value->rValue; - mod->BSIM4v4LwcGiven = TRUE; - break; - case BSIM4v4_MOD_LWN : - mod->BSIM4v4Lwn = value->rValue; - mod->BSIM4v4LwnGiven = TRUE; - break; - case BSIM4v4_MOD_LWL : - mod->BSIM4v4Lwl = value->rValue; - mod->BSIM4v4LwlGiven = TRUE; - break; - case BSIM4v4_MOD_LWLC : - mod->BSIM4v4Lwlc = value->rValue; - mod->BSIM4v4LwlcGiven = TRUE; - break; - case BSIM4v4_MOD_LMIN : - mod->BSIM4v4Lmin = value->rValue; - mod->BSIM4v4LminGiven = TRUE; - break; - case BSIM4v4_MOD_LMAX : - mod->BSIM4v4Lmax = value->rValue; - mod->BSIM4v4LmaxGiven = TRUE; - break; - case BSIM4v4_MOD_WINT : - mod->BSIM4v4Wint = value->rValue; - mod->BSIM4v4WintGiven = TRUE; - break; - case BSIM4v4_MOD_WL : - mod->BSIM4v4Wl = value->rValue; - mod->BSIM4v4WlGiven = TRUE; - break; - case BSIM4v4_MOD_WLC : - mod->BSIM4v4Wlc = value->rValue; - mod->BSIM4v4WlcGiven = TRUE; - break; - case BSIM4v4_MOD_WLN : - mod->BSIM4v4Wln = value->rValue; - mod->BSIM4v4WlnGiven = TRUE; - break; - case BSIM4v4_MOD_WW : - mod->BSIM4v4Ww = value->rValue; - mod->BSIM4v4WwGiven = TRUE; - break; - case BSIM4v4_MOD_WWC : - mod->BSIM4v4Wwc = value->rValue; - mod->BSIM4v4WwcGiven = TRUE; - break; - case BSIM4v4_MOD_WWN : - mod->BSIM4v4Wwn = value->rValue; - mod->BSIM4v4WwnGiven = TRUE; - break; - case BSIM4v4_MOD_WWL : - mod->BSIM4v4Wwl = value->rValue; - mod->BSIM4v4WwlGiven = TRUE; - break; - case BSIM4v4_MOD_WWLC : - mod->BSIM4v4Wwlc = value->rValue; - mod->BSIM4v4WwlcGiven = TRUE; - break; - case BSIM4v4_MOD_WMIN : - mod->BSIM4v4Wmin = value->rValue; - mod->BSIM4v4WminGiven = TRUE; - break; - case BSIM4v4_MOD_WMAX : - mod->BSIM4v4Wmax = value->rValue; - mod->BSIM4v4WmaxGiven = TRUE; - break; - - case BSIM4v4_MOD_NOIA : - mod->BSIM4v4oxideTrapDensityA = value->rValue; - mod->BSIM4v4oxideTrapDensityAGiven = TRUE; - break; - case BSIM4v4_MOD_NOIB : - mod->BSIM4v4oxideTrapDensityB = value->rValue; - mod->BSIM4v4oxideTrapDensityBGiven = TRUE; - break; - case BSIM4v4_MOD_NOIC : - mod->BSIM4v4oxideTrapDensityC = value->rValue; - mod->BSIM4v4oxideTrapDensityCGiven = TRUE; - break; - case BSIM4v4_MOD_EM : - mod->BSIM4v4em = value->rValue; - mod->BSIM4v4emGiven = TRUE; - break; - case BSIM4v4_MOD_EF : - mod->BSIM4v4ef = value->rValue; - mod->BSIM4v4efGiven = TRUE; - break; - case BSIM4v4_MOD_AF : - mod->BSIM4v4af = value->rValue; - mod->BSIM4v4afGiven = TRUE; - break; - case BSIM4v4_MOD_KF : - mod->BSIM4v4kf = value->rValue; - mod->BSIM4v4kfGiven = TRUE; - break; - case BSIM4v4_MOD_NMOS : - if(value->iValue) { - mod->BSIM4v4type = 1; - mod->BSIM4v4typeGiven = TRUE; - } - break; - case BSIM4v4_MOD_PMOS : - if(value->iValue) { - mod->BSIM4v4type = - 1; - mod->BSIM4v4typeGiven = TRUE; - } - break; - default: - return(E_BADPARM); - } - return(OK); -} - - diff --git a/src/spicelib/devices/bsim4v4/b4v4noi.c b/src/spicelib/devices/bsim4v4/b4v4noi.c deleted file mode 100644 index 10d844dae..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4noi.c +++ /dev/null @@ -1,550 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ -/* ngspice multirevision code extension covering 4.2.1 & 4.3.0 & 4.4.0 */ -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4noi.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 03/04/2004. - **********/ - -#include "ngspice/ngspice.h" -#include "bsim4v4def.h" -#include "ngspice/cktdefs.h" -#include "ngspice/iferrmsg.h" -#include "ngspice/noisedef.h" -#include "ngspice/const.h" - - -/* - * WDL: 1/f noise model has been smoothed out and enhanced with - * bulk charge effect as well as physical N* equ. and necessary - * conversion into the SI unit system. - */ - -static double -BSIM4v4Eval1ovFNoise( -double Vds, -BSIM4v4model *model, -BSIM4v4instance *here, -double freq, double temp) -{ -struct bsim4SizeDependParam *pParam; -double cd, esat=0.0, DelClm, EffFreq, N0, Nl, Leff, Leffsq=0.0; -double T0, T1, T2=0.0, T3, T4, T5, T6, T7=0.0, T8, T9, Ssi; - - pParam = here->pParam; - cd = fabs(here->BSIM4v4cd); - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - Leff = pParam->BSIM4v4leff - 2.0 * model->BSIM4v4lintnoi; - Leffsq = Leff * Leff; - break; - default: break; - } - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - esat = 2.0 * pParam->BSIM4v4vsattemp / here->BSIM4v4ueff; - break; - case BSIM4v30: case BSIM4v40: - esat = 2.0 * here->BSIM4v4vsattemp / here->BSIM4v4ueff; - break; - default: break; - } - if(model->BSIM4v4em<=0.0) DelClm = 0.0; /* flicker noise modified -JX */ - else { - T0 = ((((Vds - here->BSIM4v4Vdseff) / pParam->BSIM4v4litl) - + model->BSIM4v4em) / esat); - DelClm = pParam->BSIM4v4litl * log (MAX(T0, N_MINLOG)); - } - EffFreq = pow(freq, model->BSIM4v4ef); - T1 = CHARGE * CHARGE * CONSTboltz * cd * temp * here->BSIM4v4ueff; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - T2 = 1.0e10 * EffFreq * here->BSIM4v4Abulk * model->BSIM4v4coxe - * pParam->BSIM4v4leff * pParam->BSIM4v4leff; - break; - case BSIM4v40: - T2 = 1.0e10 * EffFreq * here->BSIM4v4Abulk * model->BSIM4v4coxe * Leffsq; - break; - default: break; - } - N0 = model->BSIM4v4coxe * here->BSIM4v4Vgsteff / CHARGE; - Nl = model->BSIM4v4coxe * here->BSIM4v4Vgsteff - * (1.0 - here->BSIM4v4AbovVgst2Vtm * here->BSIM4v4Vdseff) / CHARGE; - - T3 = model->BSIM4v4oxideTrapDensityA - * log(MAX(((N0 + here->BSIM4v4nstar) / (Nl + here->BSIM4v4nstar)), N_MINLOG)); - T4 = model->BSIM4v4oxideTrapDensityB * (N0 - Nl); - T5 = model->BSIM4v4oxideTrapDensityC * 0.5 * (N0 * N0 - Nl * Nl); - - T6 = CONSTboltz * temp * cd * cd; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - T7 = 1.0e10 * EffFreq * pParam->BSIM4v4leff - * pParam->BSIM4v4leff * pParam->BSIM4v4weff; - break; - case BSIM4v40: - T7 = 1.0e10 * EffFreq * Leffsq * pParam->BSIM4v4weff; - break; - default: break; - } - T8 = model->BSIM4v4oxideTrapDensityA + model->BSIM4v4oxideTrapDensityB * Nl - + model->BSIM4v4oxideTrapDensityC * Nl * Nl; - T9 = (Nl + here->BSIM4v4nstar) * (Nl + here->BSIM4v4nstar); - Ssi = T1 / T2 * (T3 + T4 + T5) + T6 / T7 * DelClm * T8 / T9; - return Ssi; -} - - -int -BSIM4v4noise ( -int mode, int operation, -GENmodel *inModel, -CKTcircuit *ckt, -Ndata *data, -double *OnDens) -{ -NOISEAN *job = (NOISEAN *) ckt->CKTcurJob; - -BSIM4v4model *model = (BSIM4v4model *)inModel; -BSIM4v4instance *here; -struct bsim4SizeDependParam *pParam; -char name[N_MXVLNTH]; -double tempOnoise; -double tempInoise; -double noizDens[BSIM4v4NSRCS]; -double lnNdens[BSIM4v4NSRCS]; - - -double T0, T1, T2, T5, T10, T11; -double Vds, Ssi, Swi; -double tmp=0.0, gdpr, gspr, npart_theta=0.0, npart_beta=0.0, igsquare; - -double m; - -int i; - - /* define the names of the noise sources */ - static char *BSIM4v4nNames[BSIM4v4NSRCS] = - { /* Note that we have to keep the order */ - ".rd", /* noise due to rd */ - ".rs", /* noise due to rs */ - ".rg", /* noise due to rgeltd */ - ".rbps", /* noise due to rbps */ - ".rbpd", /* noise due to rbpd */ - ".rbpb", /* noise due to rbpb */ - ".rbsb", /* noise due to rbsb */ - ".rbdb", /* noise due to rbdb */ - ".id", /* noise due to id */ - ".1overf", /* flicker (1/f) noise */ - ".igs", /* shot noise due to IGS */ - ".igd", /* shot noise due to IGD */ - ".igb", /* shot noise due to IGB */ - "" /* total transistor noise */ - }; - - for (; model != NULL; model = model->BSIM4v4nextModel) - { for (here = model->BSIM4v4instances; here != NULL; - here = here->BSIM4v4nextInstance) - { 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 (job->NStpsSm != 0) - { switch (mode) - { case N_DENS: - for (i = 0; i < BSIM4v4NSRCS; i++) - { (void) sprintf(name, "onoise.%s%s", - here->BSIM4v4name, - BSIM4v4nNames[i]); - data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); - if (!data->namelist) - return(E_NOMEM); - SPfrontEnd->IFnewUid (ckt, - &(data->namelist[data->numPlots++]), - NULL, name, UID_OTHER, - NULL); - /* we've added one more plot */ - } - break; - case INT_NOIZ: - for (i = 0; i < BSIM4v4NSRCS; i++) - { (void) sprintf(name, "onoise_total.%s%s", - here->BSIM4v4name, - BSIM4v4nNames[i]); - data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); - if (!data->namelist) - return(E_NOMEM); - SPfrontEnd->IFnewUid (ckt, - &(data->namelist[data->numPlots++]), - NULL, name, UID_OTHER, - NULL); - /* we've added one more plot */ - - (void) sprintf(name, "inoise_total.%s%s", - here->BSIM4v4name, - BSIM4v4nNames[i]); - data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); - if (!data->namelist) - return(E_NOMEM); - SPfrontEnd->IFnewUid (ckt, - &(data->namelist[data->numPlots++]), - NULL, name, UID_OTHER, - NULL); - /* we've added one more plot */ - } - break; - } - } - break; - case N_CALC: - m = here->BSIM4v4m; - switch (mode) - { case N_DENS: - if (model->BSIM4v4tnoiMod == 0) - { if (model->BSIM4v4rdsMod == 0) - { gspr = here->BSIM4v4sourceConductance; - gdpr = here->BSIM4v4drainConductance; - if (here->BSIM4v4grdsw > 0.0) - tmp = 1.0 / here->BSIM4v4grdsw; /* tmp used below */ - else - tmp = 0.0; - } - else - { gspr = here->BSIM4v4gstot; - gdpr = here->BSIM4v4gdtot; - tmp = 0.0; - } - } - else - { T5 = here->BSIM4v4Vgsteff / here->BSIM4v4EsatL; - T5 *= T5; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - npart_beta = 0.577 * (1.0 + T5 - * model->BSIM4v4tnoia * pParam->BSIM4v4leff); - npart_theta = 0.37 * (1.0 + T5 - * model->BSIM4v4tnoib * pParam->BSIM4v4leff); - break; - case BSIM4v30: case BSIM4v40: - npart_beta = model->BSIM4v4rnoia * (1.0 + T5 - * model->BSIM4v4tnoia * pParam->BSIM4v4leff); - npart_theta = model->BSIM4v4rnoib * (1.0 + T5 - * model->BSIM4v4tnoib * pParam->BSIM4v4leff); - break; - default: break; - } - - if (model->BSIM4v4rdsMod == 0) - { gspr = here->BSIM4v4sourceConductance; - gdpr = here->BSIM4v4drainConductance; - } - else - { gspr = here->BSIM4v4gstot; - gdpr = here->BSIM4v4gdtot; - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - if ((*(ckt->CKTstates[0] + here->BSIM4v4vds)) >= 0.0) - gspr = gspr * (1.0 + npart_theta * npart_theta * gspr - / here->BSIM4v4IdovVds); - else - gdpr = gdpr * (1.0 + npart_theta * npart_theta * gdpr - / here->BSIM4v4IdovVds); - break; - case BSIM4v30: case BSIM4v40: - if ((*(ckt->CKTstates[0] + here->BSIM4v4vds)) >= 0.0) - gspr = gspr / (1.0 + npart_theta * npart_theta * gspr - / here->BSIM4v4IdovVds); /* bugfix */ - else - gdpr = gdpr / (1.0 + npart_theta * npart_theta * gdpr - / here->BSIM4v4IdovVds); - break; - default: break; - } - } - - NevalSrc(&noizDens[BSIM4v4RDNOIZ], - &lnNdens[BSIM4v4RDNOIZ], ckt, THERMNOISE, - here->BSIM4v4dNodePrime, here->BSIM4v4dNode, - gdpr * m); - - NevalSrc(&noizDens[BSIM4v4RSNOIZ], - &lnNdens[BSIM4v4RSNOIZ], ckt, THERMNOISE, - here->BSIM4v4sNodePrime, here->BSIM4v4sNode, - gspr * m); - - - if ((here->BSIM4v4rgateMod == 1) || (here->BSIM4v4rgateMod == 2)) - { NevalSrc(&noizDens[BSIM4v4RGNOIZ], - &lnNdens[BSIM4v4RGNOIZ], ckt, THERMNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4gNodeExt, - here->BSIM4v4grgeltd * m); - } - else if (here->BSIM4v4rgateMod == 3) - { NevalSrc(&noizDens[BSIM4v4RGNOIZ], - &lnNdens[BSIM4v4RGNOIZ], ckt, THERMNOISE, - here->BSIM4v4gNodeMid, here->BSIM4v4gNodeExt, - here->BSIM4v4grgeltd * m); - } - else - { noizDens[BSIM4v4RGNOIZ] = 0.0; - lnNdens[BSIM4v4RGNOIZ] = - log(MAX(noizDens[BSIM4v4RGNOIZ], N_MINLOG)); - } - - - if (here->BSIM4v4rbodyMod) - { NevalSrc(&noizDens[BSIM4v4RBPSNOIZ], - &lnNdens[BSIM4v4RBPSNOIZ], ckt, THERMNOISE, - here->BSIM4v4bNodePrime, here->BSIM4v4sbNode, - here->BSIM4v4grbps * m); - NevalSrc(&noizDens[BSIM4v4RBPDNOIZ], - &lnNdens[BSIM4v4RBPDNOIZ], ckt, THERMNOISE, - here->BSIM4v4bNodePrime, here->BSIM4v4dbNode, - here->BSIM4v4grbpd * m); - NevalSrc(&noizDens[BSIM4v4RBPBNOIZ], - &lnNdens[BSIM4v4RBPBNOIZ], ckt, THERMNOISE, - here->BSIM4v4bNodePrime, here->BSIM4v4bNode, - here->BSIM4v4grbpb * m); - NevalSrc(&noizDens[BSIM4v4RBSBNOIZ], - &lnNdens[BSIM4v4RBSBNOIZ], ckt, THERMNOISE, - here->BSIM4v4bNode, here->BSIM4v4sbNode, - here->BSIM4v4grbsb * m); - NevalSrc(&noizDens[BSIM4v4RBDBNOIZ], - &lnNdens[BSIM4v4RBDBNOIZ], ckt, THERMNOISE, - here->BSIM4v4bNode, here->BSIM4v4dbNode, - here->BSIM4v4grbdb * m); - } - else - { noizDens[BSIM4v4RBPSNOIZ] = noizDens[BSIM4v4RBPDNOIZ] = 0.0; - noizDens[BSIM4v4RBPBNOIZ] = 0.0; - noizDens[BSIM4v4RBSBNOIZ] = noizDens[BSIM4v4RBDBNOIZ] = 0.0; - lnNdens[BSIM4v4RBPSNOIZ] = - log(MAX(noizDens[BSIM4v4RBPSNOIZ], N_MINLOG)); - lnNdens[BSIM4v4RBPDNOIZ] = - log(MAX(noizDens[BSIM4v4RBPDNOIZ], N_MINLOG)); - lnNdens[BSIM4v4RBPBNOIZ] = - log(MAX(noizDens[BSIM4v4RBPBNOIZ], N_MINLOG)); - lnNdens[BSIM4v4RBSBNOIZ] = - log(MAX(noizDens[BSIM4v4RBSBNOIZ], N_MINLOG)); - lnNdens[BSIM4v4RBDBNOIZ] = - log(MAX(noizDens[BSIM4v4RBDBNOIZ], N_MINLOG)); - } - - - switch(model->BSIM4v4tnoiMod) - { case 0: - T0 = here->BSIM4v4ueff * fabs(here->BSIM4v4qinv); - T1 = T0 * tmp + pParam->BSIM4v4leff - * pParam->BSIM4v4leff; - NevalSrc(&noizDens[BSIM4v4IDNOIZ], - &lnNdens[BSIM4v4IDNOIZ], ckt, - THERMNOISE, here->BSIM4v4dNodePrime, - here->BSIM4v4sNodePrime, - m * (T0 / T1) * model->BSIM4v4ntnoi); - break; - case 1: - T0 = here->BSIM4v4gm + here->BSIM4v4gmbs + here->BSIM4v4gds; - T0 *= T0; - igsquare = npart_theta * npart_theta * T0 / here->BSIM4v4IdovVds; - T1 = npart_beta * (here->BSIM4v4gm - + here->BSIM4v4gmbs) + here->BSIM4v4gds; - T2 = T1 * T1 / here->BSIM4v4IdovVds; - NevalSrc(&noizDens[BSIM4v4IDNOIZ], - &lnNdens[BSIM4v4IDNOIZ], ckt, - THERMNOISE, here->BSIM4v4dNodePrime, - here->BSIM4v4sNodePrime, m * (T2 - igsquare)); - break; - } - - NevalSrc(&noizDens[BSIM4v4FLNOIZ], NULL, - ckt, N_GAIN, here->BSIM4v4dNodePrime, - here->BSIM4v4sNodePrime, (double) 0.0); - - switch(model->BSIM4v4fnoiMod) - { case 0: - noizDens[BSIM4v4FLNOIZ] *= m * model->BSIM4v4kf - * exp(model->BSIM4v4af - * log(MAX(fabs(here->BSIM4v4cd), - N_MINLOG))) - / (pow(data->freq, model->BSIM4v4ef) - * pParam->BSIM4v4leff - * pParam->BSIM4v4leff - * model->BSIM4v4coxe); - break; - case 1: - Vds = *(ckt->CKTstates[0] + here->BSIM4v4vds); - if (Vds < 0.0) - Vds = -Vds; - - Ssi = BSIM4v4Eval1ovFNoise(Vds, model, here, - data->freq, ckt->CKTtemp); - T10 = model->BSIM4v4oxideTrapDensityA - * CONSTboltz * ckt->CKTtemp; - T11 = pParam->BSIM4v4weff * pParam->BSIM4v4leff - * pow(data->freq, model->BSIM4v4ef) * 1.0e10 - * here->BSIM4v4nstar * here->BSIM4v4nstar; - Swi = T10 / T11 * here->BSIM4v4cd - * here->BSIM4v4cd; - T1 = Swi + Ssi; - if (T1 > 0.0) - noizDens[BSIM4v4FLNOIZ] *= m * (Ssi * Swi) / T1; - else - noizDens[BSIM4v4FLNOIZ] *= 0.0; - break; - } - - lnNdens[BSIM4v4FLNOIZ] = - log(MAX(noizDens[BSIM4v4FLNOIZ], N_MINLOG)); - - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - NevalSrc(&noizDens[BSIM4v4IGSNOIZ], - &lnNdens[BSIM4v4IGSNOIZ], ckt, SHOTNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4sNodePrime, - m * (here->BSIM4v4Igs + here->BSIM4v4Igcs)); - NevalSrc(&noizDens[BSIM4v4IGDNOIZ], - &lnNdens[BSIM4v4IGDNOIZ], ckt, SHOTNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4dNodePrime, - m * (here->BSIM4v4Igd + here->BSIM4v4Igcd)); - break; - case BSIM4v30: case BSIM4v40: - if(here->BSIM4v4mode >= 0) { /* bugfix */ - NevalSrc(&noizDens[BSIM4v4IGSNOIZ], - &lnNdens[BSIM4v4IGSNOIZ], ckt, SHOTNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4sNodePrime, - m * (here->BSIM4v4Igs + here->BSIM4v4Igcs)); - NevalSrc(&noizDens[BSIM4v4IGDNOIZ], - &lnNdens[BSIM4v4IGDNOIZ], ckt, SHOTNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4dNodePrime, - m * (here->BSIM4v4Igd + here->BSIM4v4Igcd)); - } else { - NevalSrc(&noizDens[BSIM4v4IGSNOIZ], - &lnNdens[BSIM4v4IGSNOIZ], ckt, SHOTNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4sNodePrime, - m * (here->BSIM4v4Igs + here->BSIM4v4Igcd)); - NevalSrc(&noizDens[BSIM4v4IGDNOIZ], - &lnNdens[BSIM4v4IGDNOIZ], ckt, SHOTNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4dNodePrime, - m * (here->BSIM4v4Igd + here->BSIM4v4Igcs)); - } - break; - default: break; - } - NevalSrc(&noizDens[BSIM4v4IGBNOIZ], - &lnNdens[BSIM4v4IGBNOIZ], ckt, SHOTNOISE, - here->BSIM4v4gNodePrime, here->BSIM4v4bNodePrime, - m * here->BSIM4v4Igb); - - - noizDens[BSIM4v4TOTNOIZ] = noizDens[BSIM4v4RDNOIZ] - + noizDens[BSIM4v4RSNOIZ] + noizDens[BSIM4v4RGNOIZ] - + noizDens[BSIM4v4RBPSNOIZ] + noizDens[BSIM4v4RBPDNOIZ] - + noizDens[BSIM4v4RBPBNOIZ] - + noizDens[BSIM4v4RBSBNOIZ] + noizDens[BSIM4v4RBDBNOIZ] - + noizDens[BSIM4v4IDNOIZ] + noizDens[BSIM4v4FLNOIZ] - + noizDens[BSIM4v4IGSNOIZ] + noizDens[BSIM4v4IGDNOIZ] - + noizDens[BSIM4v4IGBNOIZ]; - lnNdens[BSIM4v4TOTNOIZ] = - log(MAX(noizDens[BSIM4v4TOTNOIZ], N_MINLOG)); - - *OnDens += noizDens[BSIM4v4TOTNOIZ]; - - if (data->delFreq == 0.0) - { /* if we haven't done any previous - integration, we need to initialize our - "history" variables. - */ - - for (i = 0; i < BSIM4v4NSRCS; i++) - { here->BSIM4v4nVar[LNLSTDENS][i] = - lnNdens[i]; - } - - /* clear out our integration variables - if it's the first pass - */ - if (data->freq == - job->NstartFreq) - { for (i = 0; i < BSIM4v4NSRCS; i++) - { here->BSIM4v4nVar[OUTNOIZ][i] = 0.0; - here->BSIM4v4nVar[INNOIZ][i] = 0.0; - } - } - } - else - { /* data->delFreq != 0.0, - we have to integrate. - */ - for (i = 0; i < BSIM4v4NSRCS; i++) - { if (i != BSIM4v4TOTNOIZ) - { tempOnoise = Nintegrate(noizDens[i], - lnNdens[i], - here->BSIM4v4nVar[LNLSTDENS][i], - data); - tempInoise = Nintegrate(noizDens[i] - * data->GainSqInv, lnNdens[i] - + data->lnGainInv, - here->BSIM4v4nVar[LNLSTDENS][i] - + data->lnGainInv, data); - here->BSIM4v4nVar[LNLSTDENS][i] = - lnNdens[i]; - data->outNoiz += tempOnoise; - data->inNoise += tempInoise; - if (job->NStpsSm != 0) - { here->BSIM4v4nVar[OUTNOIZ][i] - += tempOnoise; - here->BSIM4v4nVar[OUTNOIZ][BSIM4v4TOTNOIZ] - += tempOnoise; - here->BSIM4v4nVar[INNOIZ][i] - += tempInoise; - here->BSIM4v4nVar[INNOIZ][BSIM4v4TOTNOIZ] - += tempInoise; - } - } - } - } - if (data->prtSummary) - { for (i = 0; i < BSIM4v4NSRCS; i++) - { /* print a summary report */ - data->outpVector[data->outNumber++] - = noizDens[i]; - } - } - break; - case INT_NOIZ: - /* already calculated, just output */ - if (job->NStpsSm != 0) - { for (i = 0; i < BSIM4v4NSRCS; i++) - { data->outpVector[data->outNumber++] - = here->BSIM4v4nVar[OUTNOIZ][i]; - data->outpVector[data->outNumber++] - = here->BSIM4v4nVar[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/bsim4v4/b4v4par.c b/src/spicelib/devices/bsim4v4/b4v4par.c deleted file mode 100644 index 84c2a9d60..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4par.c +++ /dev/null @@ -1,173 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4par.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/ifsim.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" -#include "ngspice/fteext.h" - -int -BSIM4v4param( -int param, -IFvalue *value, -GENinstance *inst, -IFvalue *select) -{ - double scale; - - BSIM4v4instance *here = (BSIM4v4instance*)inst; - - NG_IGNORE(select); - - if (!cp_getvar("scale", CP_REAL, &scale)) - scale = 1; - - switch(param) - { case BSIM4v4_W: - here->BSIM4v4w = value->rValue*scale; - here->BSIM4v4wGiven = TRUE; - break; - case BSIM4v4_L: - here->BSIM4v4l = value->rValue*scale; - here->BSIM4v4lGiven = TRUE; - break; - case BSIM4v4_M: - here->BSIM4v4m = value->rValue; - here->BSIM4v4mGiven = TRUE; - break; - case BSIM4v4_NF: - here->BSIM4v4nf = value->rValue; - here->BSIM4v4nfGiven = TRUE; - break; - case BSIM4v4_MIN: - here->BSIM4v4min = value->iValue; - here->BSIM4v4minGiven = TRUE; - break; - case BSIM4v4_AS: - here->BSIM4v4sourceArea = value->rValue*scale*scale; - here->BSIM4v4sourceAreaGiven = TRUE; - break; - case BSIM4v4_AD: - here->BSIM4v4drainArea = value->rValue*scale*scale; - here->BSIM4v4drainAreaGiven = TRUE; - break; - case BSIM4v4_PS: - here->BSIM4v4sourcePerimeter = value->rValue*scale; - here->BSIM4v4sourcePerimeterGiven = TRUE; - break; - case BSIM4v4_PD: - here->BSIM4v4drainPerimeter = value->rValue*scale; - here->BSIM4v4drainPerimeterGiven = TRUE; - break; - case BSIM4v4_NRS: - here->BSIM4v4sourceSquares = value->rValue; - here->BSIM4v4sourceSquaresGiven = TRUE; - break; - case BSIM4v4_NRD: - here->BSIM4v4drainSquares = value->rValue; - here->BSIM4v4drainSquaresGiven = TRUE; - break; - case BSIM4v4_OFF: - here->BSIM4v4off = value->iValue; - break; - case BSIM4v4_SA: - here->BSIM4v4sa = value->rValue*scale; - here->BSIM4v4saGiven = TRUE; - break; - case BSIM4v4_SB: - here->BSIM4v4sb = value->rValue*scale; - here->BSIM4v4sbGiven = TRUE; - break; - case BSIM4v4_SD: - here->BSIM4v4sd = value->rValue*scale; - here->BSIM4v4sdGiven = TRUE; - break; - case BSIM4v4_RBSB: - here->BSIM4v4rbsb = value->rValue; - here->BSIM4v4rbsbGiven = TRUE; - break; - case BSIM4v4_RBDB: - here->BSIM4v4rbdb = value->rValue; - here->BSIM4v4rbdbGiven = TRUE; - break; - case BSIM4v4_RBPB: - here->BSIM4v4rbpb = value->rValue; - here->BSIM4v4rbpbGiven = TRUE; - break; - case BSIM4v4_RBPS: - here->BSIM4v4rbps = value->rValue; - here->BSIM4v4rbpsGiven = TRUE; - break; - case BSIM4v4_RBPD: - here->BSIM4v4rbpd = value->rValue; - here->BSIM4v4rbpdGiven = TRUE; - break; - case BSIM4v4_TRNQSMOD: - here->BSIM4v4trnqsMod = value->iValue; - here->BSIM4v4trnqsModGiven = TRUE; - break; - case BSIM4v4_ACNQSMOD: - here->BSIM4v4acnqsMod = value->iValue; - here->BSIM4v4acnqsModGiven = TRUE; - break; - case BSIM4v4_RBODYMOD: - here->BSIM4v4rbodyMod = value->iValue; - here->BSIM4v4rbodyModGiven = TRUE; - break; - case BSIM4v4_RGATEMOD: - here->BSIM4v4rgateMod = value->iValue; - here->BSIM4v4rgateModGiven = TRUE; - break; - case BSIM4v4_GEOMOD: - here->BSIM4v4geoMod = value->iValue; - here->BSIM4v4geoModGiven = TRUE; - break; - case BSIM4v4_RGEOMOD: - here->BSIM4v4rgeoMod = value->iValue; - here->BSIM4v4rgeoModGiven = TRUE; - break; - case BSIM4v4_IC_VDS: - here->BSIM4v4icVDS = value->rValue; - here->BSIM4v4icVDSGiven = TRUE; - break; - case BSIM4v4_IC_VGS: - here->BSIM4v4icVGS = value->rValue; - here->BSIM4v4icVGSGiven = TRUE; - break; - case BSIM4v4_IC_VBS: - here->BSIM4v4icVBS = value->rValue; - here->BSIM4v4icVBSGiven = TRUE; - break; - case BSIM4v4_IC: - switch(value->v.numValue) - { case 3: - here->BSIM4v4icVBS = *(value->v.vec.rVec+2); - here->BSIM4v4icVBSGiven = TRUE; - case 2: - here->BSIM4v4icVGS = *(value->v.vec.rVec+1); - here->BSIM4v4icVGSGiven = TRUE; - case 1: - here->BSIM4v4icVDS = *(value->v.vec.rVec); - here->BSIM4v4icVDSGiven = TRUE; - break; - default: - return(E_BADPARM); - } - break; - default: - return(E_BADPARM); - } - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4pzld.c b/src/spicelib/devices/bsim4v4/b4v4pzld.c deleted file mode 100644 index 47bb363d4..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4pzld.c +++ /dev/null @@ -1,758 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4pzld.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 10/05/2001. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/cktdefs.h" -#include "ngspice/complex.h" -#include "ngspice/sperror.h" -#include "bsim4v4def.h" -#include "ngspice/suffix.h" - -int -BSIM4v4pzLoad( -GENmodel *inModel, -CKTcircuit *ckt, -SPcomplex *s) -{ -BSIM4v4model *model = (BSIM4v4model*)inModel; -BSIM4v4instance *here; - -double gjbd, gjbs, geltd, gcrg, gcrgg, gcrgd, gcrgs, gcrgb; -double xcggb, xcgdb, xcgsb, xcgbb, xcbgb, xcbdb, xcbsb, xcbbb; -double xcdgb, xcddb, xcdsb, xcdbb, xcsgb, xcsdb, xcssb, xcsbb; -double gds, capbd, capbs, FwdSum, RevSum, Gm, Gmbs; -double gstot, gstotd, gstotg, gstots, gstotb, gspr; -double gdtot, gdtotd, gdtotg, gdtots, gdtotb, gdpr; -double gIstotg, gIstotd, gIstots, gIstotb; -double gIdtotg, gIdtotd, gIdtots, gIdtotb; -double gIbtotg, gIbtotd, gIbtots, gIbtotb; -double gIgtotg, gIgtotd, gIgtots, gIgtotb; -double cgso, cgdo, cgbo; -double xcdbdb=0.0, xcsbsb=0.0, xcgmgmb=0.0, xcgmdb=0.0, xcgmsb=0.0, xcdgmb=0.0, xcsgmb=0.0; -double xcgmbb=0.0, xcbgmb=0.0; -double dxpart, sxpart, xgtg, xgtd, xgts, xgtb, xcqgb=0.0, xcqdb=0.0, xcqsb=0.0, xcqbb=0.0; -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 T0=0.0, T1, CoxWL, qcheq, Cdg, Cdd, Cds, Csg, Csd, Css; -double ScalingFactor = 1.0e-9; -struct bsim4SizeDependParam *pParam; -double ggidld, ggidlg, ggidlb, ggislg, ggislb, ggisls; - -double m; - - for (; model != NULL; model = model->BSIM4v4nextModel) - { for (here = model->BSIM4v4instances; here!= NULL; - here = here->BSIM4v4nextInstance) - { - pParam = here->pParam; - capbd = here->BSIM4v4capbd; - capbs = here->BSIM4v4capbs; - cgso = here->BSIM4v4cgso; - cgdo = here->BSIM4v4cgdo; - cgbo = pParam->BSIM4v4cgbo; - - if (here->BSIM4v4mode >= 0) - { Gm = here->BSIM4v4gm; - Gmbs = here->BSIM4v4gmbs; - FwdSum = Gm + Gmbs; - RevSum = 0.0; - - gbbdp = -(here->BSIM4v4gbds); - gbbsp = here->BSIM4v4gbds + here->BSIM4v4gbgs + here->BSIM4v4gbbs; - gbdpg = here->BSIM4v4gbgs; - gbdpdp = here->BSIM4v4gbds; - gbdpb = here->BSIM4v4gbbs; - gbdpsp = -(gbdpg + gbdpdp + gbdpb); - - gbspdp = 0.0; - gbspg = 0.0; - gbspb = 0.0; - gbspsp = 0.0; - - if (model->BSIM4v4igcMod) - { gIstotg = here->BSIM4v4gIgsg + here->BSIM4v4gIgcsg; - gIstotd = here->BSIM4v4gIgcsd; - gIstots = here->BSIM4v4gIgss + here->BSIM4v4gIgcss; - gIstotb = here->BSIM4v4gIgcsb; - - gIdtotg = here->BSIM4v4gIgdg + here->BSIM4v4gIgcdg; - gIdtotd = here->BSIM4v4gIgdd + here->BSIM4v4gIgcdd; - gIdtots = here->BSIM4v4gIgcds; - gIdtotb = here->BSIM4v4gIgcdb; - } - else - { gIstotg = gIstotd = gIstots = gIstotb = 0.0; - gIdtotg = gIdtotd = gIdtots = gIdtotb = 0.0; - } - - if (model->BSIM4v4igbMod) - { gIbtotg = here->BSIM4v4gIgbg; - gIbtotd = here->BSIM4v4gIgbd; - gIbtots = here->BSIM4v4gIgbs; - gIbtotb = here->BSIM4v4gIgbb; - } - else - gIbtotg = gIbtotd = gIbtots = gIbtotb = 0.0; - - if ((model->BSIM4v4igcMod != 0) || (model->BSIM4v4igbMod != 0)) - { gIgtotg = gIstotg + gIdtotg + gIbtotg; - gIgtotd = gIstotd + gIdtotd + gIbtotd ; - gIgtots = gIstots + gIdtots + gIbtots; - gIgtotb = gIstotb + gIdtotb + gIbtotb; - } - else - gIgtotg = gIgtotd = gIgtots = gIgtotb = 0.0; - - if (here->BSIM4v4rgateMod == 2) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vges) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - else if (here->BSIM4v4rgateMod == 3) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vgms) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - if (here->BSIM4v4rgateMod > 1) - { gcrgd = here->BSIM4v4gcrgd * T0; - gcrgg = here->BSIM4v4gcrgg * T0; - gcrgs = here->BSIM4v4gcrgs * T0; - gcrgb = here->BSIM4v4gcrgb * T0; - gcrgg -= here->BSIM4v4gcrg; - gcrg = here->BSIM4v4gcrg; - } - else - gcrg = gcrgd = gcrgg = gcrgs = gcrgb = 0.0; - - if (here->BSIM4v4acnqsMod == 0) - { if (here->BSIM4v4rgateMod == 3) - { xcgmgmb = cgdo + cgso + pParam->BSIM4v4cgbo; - xcgmdb = -cgdo; - xcgmsb = -cgso; - xcgmbb = -pParam->BSIM4v4cgbo; - - xcdgmb = xcgmdb; - xcsgmb = xcgmsb; - xcbgmb = xcgmbb; - - xcggb = here->BSIM4v4cggb; - xcgdb = here->BSIM4v4cgdb; - xcgsb = here->BSIM4v4cgsb; - xcgbb = -(xcggb + xcgdb + xcgsb); - - xcdgb = here->BSIM4v4cdgb; - xcsgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb); - xcbgb = here->BSIM4v4cbgb; - } - else - { xcggb = here->BSIM4v4cggb + cgdo + cgso - + pParam->BSIM4v4cgbo; - xcgdb = here->BSIM4v4cgdb - cgdo; - xcgsb = here->BSIM4v4cgsb - cgso; - xcgbb = -(xcggb + xcgdb + xcgsb); - - xcdgb = here->BSIM4v4cdgb - cgdo; - xcsgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb + cgso); - xcbgb = here->BSIM4v4cbgb - pParam->BSIM4v4cgbo; - - xcdgmb = xcsgmb = xcbgmb = 0.0; - } - xcddb = here->BSIM4v4cddb + here->BSIM4v4capbd + cgdo; - xcdsb = here->BSIM4v4cdsb; - - xcsdb = -(here->BSIM4v4cgdb + here->BSIM4v4cbdb - + here->BSIM4v4cddb); - xcssb = here->BSIM4v4capbs + cgso - (here->BSIM4v4cgsb - + here->BSIM4v4cbsb + here->BSIM4v4cdsb); - - if (!here->BSIM4v4rbodyMod) - { xcdbb = -(xcdgb + xcddb + xcdsb + xcdgmb); - xcsbb = -(xcsgb + xcsdb + xcssb + xcsgmb); - xcbdb = here->BSIM4v4cbdb - here->BSIM4v4capbd; - xcbsb = here->BSIM4v4cbsb - here->BSIM4v4capbs; - xcdbdb = 0.0; - } - else - { xcdbb = -(here->BSIM4v4cddb + here->BSIM4v4cdgb - + here->BSIM4v4cdsb); - xcsbb = -(xcsgb + xcsdb + xcssb + xcsgmb) - + here->BSIM4v4capbs; - xcbdb = here->BSIM4v4cbdb; - xcbsb = here->BSIM4v4cbsb; - - xcdbdb = -here->BSIM4v4capbd; - xcsbsb = -here->BSIM4v4capbs; - } - xcbbb = -(xcbdb + xcbgb + xcbsb + xcbgmb); - - 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 - { xcggb = xcgdb = xcgsb = xcgbb = 0.0; - xcbgb = xcbdb = xcbsb = xcbbb = 0.0; - xcdgb = xcddb = xcdsb = xcdbb = 0.0; - xcsgb = xcsdb = xcssb = xcsbb = 0.0; - - xgtg = here->BSIM4v4gtg; - xgtd = here->BSIM4v4gtd; - xgts = here->BSIM4v4gts; - xgtb = here->BSIM4v4gtb; - - xcqgb = here->BSIM4v4cqgb; - xcqdb = here->BSIM4v4cqdb; - xcqsb = here->BSIM4v4cqsb; - xcqbb = here->BSIM4v4cqbb; - - CoxWL = model->BSIM4v4coxe * here->pParam->BSIM4v4weffCV - * here->BSIM4v4nf * here->pParam->BSIM4v4leffCV; - qcheq = -(here->BSIM4v4qgate + here->BSIM4v4qbulk); - if (fabs(qcheq) <= 1.0e-5 * CoxWL) - { if (model->BSIM4v4xpart < 0.5) - { dxpart = 0.4; - } - else if (model->BSIM4v4xpart > 0.5) - { dxpart = 0.0; - } - else - { dxpart = 0.5; - } - ddxpart_dVd = ddxpart_dVg = ddxpart_dVb - = ddxpart_dVs = 0.0; - } - else - { dxpart = here->BSIM4v4qdrn / qcheq; - Cdd = here->BSIM4v4cddb; - Csd = -(here->BSIM4v4cgdb + here->BSIM4v4cddb - + here->BSIM4v4cbdb); - ddxpart_dVd = (Cdd - dxpart * (Cdd + Csd)) / qcheq; - Cdg = here->BSIM4v4cdgb; - Csg = -(here->BSIM4v4cggb + here->BSIM4v4cdgb - + here->BSIM4v4cbgb); - ddxpart_dVg = (Cdg - dxpart * (Cdg + Csg)) / qcheq; - - Cds = here->BSIM4v4cdsb; - Css = -(here->BSIM4v4cgsb + here->BSIM4v4cdsb - + here->BSIM4v4cbsb); - 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->BSIM4v4gm; - Gmbs = -here->BSIM4v4gmbs; - FwdSum = 0.0; - RevSum = -(Gm + Gmbs); - - gbbsp = -(here->BSIM4v4gbds); - gbbdp = here->BSIM4v4gbds + here->BSIM4v4gbgs + here->BSIM4v4gbbs; - - gbdpg = 0.0; - gbdpsp = 0.0; - gbdpb = 0.0; - gbdpdp = 0.0; - - gbspg = here->BSIM4v4gbgs; - gbspsp = here->BSIM4v4gbds; - gbspb = here->BSIM4v4gbbs; - gbspdp = -(gbspg + gbspsp + gbspb); - - if (model->BSIM4v4igcMod) - { gIstotg = here->BSIM4v4gIgsg + here->BSIM4v4gIgcdg; - gIstotd = here->BSIM4v4gIgcds; - gIstots = here->BSIM4v4gIgss + here->BSIM4v4gIgcdd; - gIstotb = here->BSIM4v4gIgcdb; - - gIdtotg = here->BSIM4v4gIgdg + here->BSIM4v4gIgcsg; - gIdtotd = here->BSIM4v4gIgdd + here->BSIM4v4gIgcss; - gIdtots = here->BSIM4v4gIgcsd; - gIdtotb = here->BSIM4v4gIgcsb; - } - else - { gIstotg = gIstotd = gIstots = gIstotb = 0.0; - gIdtotg = gIdtotd = gIdtots = gIdtotb = 0.0; - } - - if (model->BSIM4v4igbMod) - { gIbtotg = here->BSIM4v4gIgbg; - gIbtotd = here->BSIM4v4gIgbs; - gIbtots = here->BSIM4v4gIgbd; - gIbtotb = here->BSIM4v4gIgbb; - } - else - gIbtotg = gIbtotd = gIbtots = gIbtotb = 0.0; - - if ((model->BSIM4v4igcMod != 0) || (model->BSIM4v4igbMod != 0)) - { gIgtotg = gIstotg + gIdtotg + gIbtotg; - gIgtotd = gIstotd + gIdtotd + gIbtotd ; - gIgtots = gIstots + gIdtots + gIbtots; - gIgtotb = gIstotb + gIdtotb + gIbtotb; - } - else - gIgtotg = gIgtotd = gIgtots = gIgtotb = 0.0; - - if (here->BSIM4v4rgateMod == 2) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vges) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - else if (here->BSIM4v4rgateMod == 3) - T0 = *(ckt->CKTstates[0] + here->BSIM4v4vgms) - - *(ckt->CKTstates[0] + here->BSIM4v4vgs); - if (here->BSIM4v4rgateMod > 1) - { gcrgd = here->BSIM4v4gcrgs * T0; - gcrgg = here->BSIM4v4gcrgg * T0; - gcrgs = here->BSIM4v4gcrgd * T0; - gcrgb = here->BSIM4v4gcrgb * T0; - gcrgg -= here->BSIM4v4gcrg; - gcrg = here->BSIM4v4gcrg; - } - else - gcrg = gcrgd = gcrgg = gcrgs = gcrgb = 0.0; - - if (here->BSIM4v4acnqsMod == 0) - { if (here->BSIM4v4rgateMod == 3) - { xcgmgmb = cgdo + cgso + pParam->BSIM4v4cgbo; - xcgmdb = -cgdo; - xcgmsb = -cgso; - xcgmbb = -pParam->BSIM4v4cgbo; - - xcdgmb = xcgmdb; - xcsgmb = xcgmsb; - xcbgmb = xcgmbb; - - xcggb = here->BSIM4v4cggb; - xcgdb = here->BSIM4v4cgsb; - xcgsb = here->BSIM4v4cgdb; - xcgbb = -(xcggb + xcgdb + xcgsb); - - xcdgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb); - xcsgb = here->BSIM4v4cdgb; - xcbgb = here->BSIM4v4cbgb; - } - else - { xcggb = here->BSIM4v4cggb + cgdo + cgso - + pParam->BSIM4v4cgbo; - xcgdb = here->BSIM4v4cgsb - cgdo; - xcgsb = here->BSIM4v4cgdb - cgso; - xcgbb = -(xcggb + xcgdb + xcgsb); - - xcdgb = -(here->BSIM4v4cggb + here->BSIM4v4cbgb - + here->BSIM4v4cdgb + cgdo); - xcsgb = here->BSIM4v4cdgb - cgso; - xcbgb = here->BSIM4v4cbgb - pParam->BSIM4v4cgbo; - - xcdgmb = xcsgmb = xcbgmb = 0.0; - } - xcddb = here->BSIM4v4capbd + cgdo - (here->BSIM4v4cgsb - + here->BSIM4v4cbsb + here->BSIM4v4cdsb); - xcdsb = -(here->BSIM4v4cgdb + here->BSIM4v4cbdb - + here->BSIM4v4cddb); - - xcsdb = here->BSIM4v4cdsb; - xcssb = here->BSIM4v4cddb + here->BSIM4v4capbs + cgso; - - if (!here->BSIM4v4rbodyMod) - { xcdbb = -(xcdgb + xcddb + xcdsb + xcdgmb); - xcsbb = -(xcsgb + xcsdb + xcssb + xcsgmb); - xcbdb = here->BSIM4v4cbsb - here->BSIM4v4capbd; - xcbsb = here->BSIM4v4cbdb - here->BSIM4v4capbs; - xcdbdb = 0.0; - } - else - { xcdbb = -(xcdgb + xcddb + xcdsb + xcdgmb) - + here->BSIM4v4capbd; - xcsbb = -(here->BSIM4v4cddb + here->BSIM4v4cdgb - + here->BSIM4v4cdsb); - xcbdb = here->BSIM4v4cbsb; - xcbsb = here->BSIM4v4cbdb; - xcdbdb = -here->BSIM4v4capbd; - xcsbsb = -here->BSIM4v4capbs; - } - xcbbb = -(xcbgb + xcbdb + xcbsb + xcbgmb); - - 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 - { xcggb = xcgdb = xcgsb = xcgbb = 0.0; - xcbgb = xcbdb = xcbsb = xcbbb = 0.0; - xcdgb = xcddb = xcdsb = xcdbb = 0.0; - xcsgb = xcsdb = xcssb = xcsbb = 0.0; - - xgtg = here->BSIM4v4gtg; - xgtd = here->BSIM4v4gts; - xgts = here->BSIM4v4gtd; - xgtb = here->BSIM4v4gtb; - - xcqgb = here->BSIM4v4cqgb; - xcqdb = here->BSIM4v4cqsb; - xcqsb = here->BSIM4v4cqdb; - xcqbb = here->BSIM4v4cqbb; - - CoxWL = model->BSIM4v4coxe * here->pParam->BSIM4v4weffCV - * here->BSIM4v4nf * here->pParam->BSIM4v4leffCV; - qcheq = -(here->BSIM4v4qgate + here->BSIM4v4qbulk); - if (fabs(qcheq) <= 1.0e-5 * CoxWL) - { if (model->BSIM4v4xpart < 0.5) - { sxpart = 0.4; - } - else if (model->BSIM4v4xpart > 0.5) - { sxpart = 0.0; - } - else - { sxpart = 0.5; - } - dsxpart_dVd = dsxpart_dVg = dsxpart_dVb - = dsxpart_dVs = 0.0; - } - else - { sxpart = here->BSIM4v4qdrn / qcheq; - Css = here->BSIM4v4cddb; - Cds = -(here->BSIM4v4cgdb + here->BSIM4v4cddb - + here->BSIM4v4cbdb); - dsxpart_dVs = (Css - sxpart * (Css + Cds)) / qcheq; - Csg = here->BSIM4v4cdgb; - Cdg = -(here->BSIM4v4cggb + here->BSIM4v4cdgb - + here->BSIM4v4cbgb); - dsxpart_dVg = (Csg - sxpart * (Csg + Cdg)) / qcheq; - - Csd = here->BSIM4v4cdsb; - Cdd = -(here->BSIM4v4cgsb + here->BSIM4v4cdsb - + here->BSIM4v4cbsb); - 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); - } - } - - if (model->BSIM4v4rdsMod == 1) - { gstot = here->BSIM4v4gstot; - gstotd = here->BSIM4v4gstotd; - gstotg = here->BSIM4v4gstotg; - gstots = here->BSIM4v4gstots - gstot; - gstotb = here->BSIM4v4gstotb; - - gdtot = here->BSIM4v4gdtot; - gdtotd = here->BSIM4v4gdtotd - gdtot; - gdtotg = here->BSIM4v4gdtotg; - gdtots = here->BSIM4v4gdtots; - gdtotb = here->BSIM4v4gdtotb; - } - else - { gstot = gstotd = gstotg = gstots = gstotb = 0.0; - gdtot = gdtotd = gdtotg = gdtots = gdtotb = 0.0; - } - - - T1 = *(ckt->CKTstate0 + here->BSIM4v4qdef) * here->BSIM4v4gtau; - gds = here->BSIM4v4gds; - - /* - * Loading PZ matrix - */ - - m = here->BSIM4v4m; - - if (!model->BSIM4v4rdsMod) - { gdpr = here->BSIM4v4drainConductance; - gspr = here->BSIM4v4sourceConductance; - } - else - gdpr = gspr = 0.0; - - if (!here->BSIM4v4rbodyMod) - { gjbd = here->BSIM4v4gbd; - gjbs = here->BSIM4v4gbs; - } - else - gjbd = gjbs = 0.0; - - geltd = here->BSIM4v4grgeltd; - - if (here->BSIM4v4rgateMod == 1) - { *(here->BSIM4v4GEgePtr) += m * geltd; - *(here->BSIM4v4GPgePtr) -= m * geltd; - *(here->BSIM4v4GEgpPtr) -= m * geltd; - - *(here->BSIM4v4GPgpPtr ) += m * xcggb * s->real; - *(here->BSIM4v4GPgpPtr +1) += m * xcggb * s->imag; - *(here->BSIM4v4GPgpPtr) += m * (geltd - xgtg + gIgtotg); - *(here->BSIM4v4GPdpPtr ) += m * xcgdb * s->real; - *(here->BSIM4v4GPdpPtr +1) += m * xcgdb * s->imag; - *(here->BSIM4v4GPdpPtr) -= m * (xgtd - gIgtotd); - *(here->BSIM4v4GPspPtr ) += m * xcgsb * s->real; - *(here->BSIM4v4GPspPtr +1) += m * xcgsb * s->imag; - *(here->BSIM4v4GPspPtr) -= m * (xgts - gIgtots); - *(here->BSIM4v4GPbpPtr ) += m * xcgbb * s->real; - *(here->BSIM4v4GPbpPtr +1) += m * xcgbb * s->imag; - *(here->BSIM4v4GPbpPtr) -= m * (xgtb - gIgtotb); - } - else if (here->BSIM4v4rgateMod == 2) - { *(here->BSIM4v4GEgePtr) += m * gcrg; - *(here->BSIM4v4GEgpPtr) += m * gcrgg; - *(here->BSIM4v4GEdpPtr) += m * gcrgd; - *(here->BSIM4v4GEspPtr) += m * gcrgs; - *(here->BSIM4v4GEbpPtr) += m * gcrgb; - - *(here->BSIM4v4GPgePtr) -= m * gcrg; - *(here->BSIM4v4GPgpPtr ) += m * xcggb * s->real; - *(here->BSIM4v4GPgpPtr +1) += m * xcggb * s->imag; - *(here->BSIM4v4GPgpPtr) -= m * (gcrgg + xgtg - gIgtotg); - *(here->BSIM4v4GPdpPtr ) += m * xcgdb * s->real; - *(here->BSIM4v4GPdpPtr +1) += m * xcgdb * s->imag; - *(here->BSIM4v4GPdpPtr) -= m * (gcrgd + xgtd - gIgtotd); - *(here->BSIM4v4GPspPtr ) += m * xcgsb * s->real; - *(here->BSIM4v4GPspPtr +1) += m * xcgsb * s->imag; - *(here->BSIM4v4GPspPtr) -= m * (gcrgs + xgts - gIgtots); - *(here->BSIM4v4GPbpPtr ) += m * xcgbb * s->real; - *(here->BSIM4v4GPbpPtr +1) += m * xcgbb * s->imag; - *(here->BSIM4v4GPbpPtr) -= m * (gcrgb + xgtb - gIgtotb); - } - else if (here->BSIM4v4rgateMod == 3) - { *(here->BSIM4v4GEgePtr) += m * geltd; - *(here->BSIM4v4GEgmPtr) -= m * geltd; - *(here->BSIM4v4GMgePtr) -= m * geltd; - *(here->BSIM4v4GMgmPtr) += m * (geltd + gcrg); - *(here->BSIM4v4GMgmPtr ) += m * xcgmgmb * s->real; - *(here->BSIM4v4GMgmPtr +1) += m * xcgmgmb * s->imag; - - *(here->BSIM4v4GMdpPtr) += m * gcrgd; - *(here->BSIM4v4GMdpPtr ) += m * xcgmdb * s->real; - *(here->BSIM4v4GMdpPtr +1) += m * xcgmdb * s->imag; - *(here->BSIM4v4GMgpPtr) += m * gcrgg; - *(here->BSIM4v4GMspPtr) += m * gcrgs; - *(here->BSIM4v4GMspPtr ) += m * xcgmsb * s->real; - *(here->BSIM4v4GMspPtr +1) += m * xcgmsb * s->imag; - *(here->BSIM4v4GMbpPtr) += m * gcrgb; - *(here->BSIM4v4GMbpPtr ) += m * xcgmbb * s->real; - *(here->BSIM4v4GMbpPtr +1) += m * xcgmbb * s->imag; - - *(here->BSIM4v4DPgmPtr ) += m * xcdgmb * s->real; - *(here->BSIM4v4DPgmPtr +1) += m * xcdgmb * s->imag; - *(here->BSIM4v4GPgmPtr) -= m * gcrg; - *(here->BSIM4v4SPgmPtr ) += m * xcsgmb * s->real; - *(here->BSIM4v4SPgmPtr +1) += m * xcsgmb * s->imag; - *(here->BSIM4v4BPgmPtr ) += m * xcbgmb * s->real; - *(here->BSIM4v4BPgmPtr +1) += m * xcbgmb * s->imag; - - *(here->BSIM4v4GPgpPtr) -= m * (gcrgg + xgtg - gIgtotg); - *(here->BSIM4v4GPgpPtr ) += m * xcggb * s->real; - *(here->BSIM4v4GPgpPtr +1) += m * xcggb * s->imag; - *(here->BSIM4v4GPdpPtr) -= m * (gcrgd + xgtd - gIgtotd); - *(here->BSIM4v4GPdpPtr ) += m * xcgdb * s->real; - *(here->BSIM4v4GPdpPtr +1) += m * xcgdb * s->imag; - *(here->BSIM4v4GPspPtr) -= m * (gcrgs + xgts - gIgtots); - *(here->BSIM4v4GPspPtr ) += m * xcgsb * s->real; - *(here->BSIM4v4GPspPtr +1) += m * xcgsb * s->imag; - *(here->BSIM4v4GPbpPtr) -= m * (gcrgb + xgtb - gIgtotb); - *(here->BSIM4v4GPbpPtr ) += m * xcgbb * s->real; - *(here->BSIM4v4GPbpPtr +1) += m * xcgbb * s->imag; - } - else - { *(here->BSIM4v4GPdpPtr ) += m * xcgdb * s->real; - *(here->BSIM4v4GPdpPtr +1) += m * xcgdb * s->imag; - *(here->BSIM4v4GPdpPtr) -= m * (xgtd - gIgtotd); - *(here->BSIM4v4GPgpPtr ) += m * xcggb * s->real; - *(here->BSIM4v4GPgpPtr +1) += m * xcggb * s->imag; - *(here->BSIM4v4GPgpPtr) -= m * (xgtg - gIgtotg); - *(here->BSIM4v4GPspPtr ) += m * xcgsb * s->real; - *(here->BSIM4v4GPspPtr +1) += m * xcgsb * s->imag; - *(here->BSIM4v4GPspPtr) -= m * (xgts - gIgtots); - *(here->BSIM4v4GPbpPtr ) += m * xcgbb * s->real; - *(here->BSIM4v4GPbpPtr +1) += m * xcgbb * s->imag; - *(here->BSIM4v4GPbpPtr) -= m * (xgtb - gIgtotb); - } - - if (model->BSIM4v4rdsMod) - { (*(here->BSIM4v4DgpPtr) += m * gdtotg); - (*(here->BSIM4v4DspPtr) += m * gdtots); - (*(here->BSIM4v4DbpPtr) += m * gdtotb); - (*(here->BSIM4v4SdpPtr) += m * gstotd); - (*(here->BSIM4v4SgpPtr) += m * gstotg); - (*(here->BSIM4v4SbpPtr) += m * gstotb); - } - - *(here->BSIM4v4DPdpPtr ) += m * xcddb * s->real; - *(here->BSIM4v4DPdpPtr +1) += m * xcddb * s->imag; - *(here->BSIM4v4DPdpPtr) += m * (gdpr + gds + here->BSIM4v4gbd - - gdtotd + RevSum + gbdpdp - gIdtotd - + dxpart * xgtd + T1 * ddxpart_dVd); - *(here->BSIM4v4DPdPtr) -= m * (gdpr + gdtot); - *(here->BSIM4v4DPgpPtr ) += m * xcdgb * s->real; - *(here->BSIM4v4DPgpPtr +1) += m * xcdgb * s->imag; - *(here->BSIM4v4DPgpPtr) += m * (Gm - gdtotg + gbdpg - gIdtotg - + T1 * ddxpart_dVg + dxpart * xgtg); - *(here->BSIM4v4DPspPtr ) += m * xcdsb * s->real; - *(here->BSIM4v4DPspPtr +1) += m * xcdsb * s->imag; - *(here->BSIM4v4DPspPtr) -= m * (gds + FwdSum + gdtots - gbdpsp + gIdtots - - T1 * ddxpart_dVs - dxpart * xgts); - *(here->BSIM4v4DPbpPtr ) += m * xcdbb * s->real; - *(here->BSIM4v4DPbpPtr +1) += m * xcdbb * s->imag; - *(here->BSIM4v4DPbpPtr) -= m * (gjbd + gdtotb - Gmbs - gbdpb + gIdtotb - - T1 * ddxpart_dVb - dxpart * xgtb); - - *(here->BSIM4v4DdpPtr) -= m * (gdpr - gdtotd); - *(here->BSIM4v4DdPtr) += m * (gdpr + gdtot); - - *(here->BSIM4v4SPdpPtr ) += m * xcsdb * s->real; - *(here->BSIM4v4SPdpPtr +1) += m * xcsdb * s->imag; - *(here->BSIM4v4SPdpPtr) -= m * (gds + gstotd + RevSum - gbspdp + gIstotd - - T1 * dsxpart_dVd - sxpart * xgtd); - *(here->BSIM4v4SPgpPtr ) += m * xcsgb * s->real; - *(here->BSIM4v4SPgpPtr +1) += m * xcsgb * s->imag; - *(here->BSIM4v4SPgpPtr) -= m * (Gm + gstotg - gbspg + gIstotg - - T1 * dsxpart_dVg - sxpart * xgtg); - *(here->BSIM4v4SPspPtr ) += m * xcssb * s->real; - *(here->BSIM4v4SPspPtr +1) += m * xcssb * s->imag; - *(here->BSIM4v4SPspPtr) += m * (gspr + gds + here->BSIM4v4gbs - gIstots - - gstots + FwdSum + gbspsp - + sxpart * xgts + T1 * dsxpart_dVs); - *(here->BSIM4v4SPsPtr) -= m * (gspr + gstot); - *(here->BSIM4v4SPbpPtr ) += m * xcsbb * s->real; - *(here->BSIM4v4SPbpPtr +1) += m * xcsbb * s->imag; - *(here->BSIM4v4SPbpPtr) -= m * (gjbs + gstotb + Gmbs - gbspb + gIstotb - - T1 * dsxpart_dVb - sxpart * xgtb); - - *(here->BSIM4v4SspPtr) -= m * (gspr - gstots); - *(here->BSIM4v4SsPtr) += m * (gspr + gstot); - - *(here->BSIM4v4BPdpPtr ) += m * xcbdb * s->real; - *(here->BSIM4v4BPdpPtr +1) += m * xcbdb * s->imag; - *(here->BSIM4v4BPdpPtr) -= m * (gjbd - gbbdp + gIbtotd); - *(here->BSIM4v4BPgpPtr ) += m * xcbgb * s->real; - *(here->BSIM4v4BPgpPtr +1) += m * xcbgb * s->imag; - *(here->BSIM4v4BPgpPtr) -= m * (here->BSIM4v4gbgs + gIbtotg); - *(here->BSIM4v4BPspPtr ) += m * xcbsb * s->real; - *(here->BSIM4v4BPspPtr +1) += m * xcbsb * s->imag; - *(here->BSIM4v4BPspPtr) -= m * (gjbs - gbbsp + gIbtots); - *(here->BSIM4v4BPbpPtr ) += m * xcbbb * s->real; - *(here->BSIM4v4BPbpPtr +1) += m * xcbbb * s->imag; - *(here->BSIM4v4BPbpPtr) += m * (gjbd + gjbs - here->BSIM4v4gbbs - - gIbtotb); - ggidld = here->BSIM4v4ggidld; - ggidlg = here->BSIM4v4ggidlg; - ggidlb = here->BSIM4v4ggidlb; - ggislg = here->BSIM4v4ggislg; - ggisls = here->BSIM4v4ggisls; - ggislb = here->BSIM4v4ggislb; - - /* stamp gidl */ - (*(here->BSIM4v4DPdpPtr) += m * ggidld); - (*(here->BSIM4v4DPgpPtr) += m * ggidlg); - (*(here->BSIM4v4DPspPtr) -= m * ((ggidlg + ggidld) + ggidlb)); - (*(here->BSIM4v4DPbpPtr) += m * ggidlb); - (*(here->BSIM4v4BPdpPtr) -= m * ggidld); - (*(here->BSIM4v4BPgpPtr) -= m * ggidlg); - (*(here->BSIM4v4BPspPtr) += m * ((ggidlg + ggidld) + ggidlb)); - (*(here->BSIM4v4BPbpPtr) -= m * ggidlb); - /* stamp gisl */ - (*(here->BSIM4v4SPdpPtr) -= m * ((ggisls + ggislg) + ggislb)); - (*(here->BSIM4v4SPgpPtr) += m * ggislg); - (*(here->BSIM4v4SPspPtr) += m * ggisls); - (*(here->BSIM4v4SPbpPtr) += m * ggislb); - (*(here->BSIM4v4BPdpPtr) += m * ((ggislg + ggisls) + ggislb)); - (*(here->BSIM4v4BPgpPtr) -= m * ggislg); - (*(here->BSIM4v4BPspPtr) -= m * ggisls); - (*(here->BSIM4v4BPbpPtr) -= m * ggislb); - - if (here->BSIM4v4rbodyMod) - { (*(here->BSIM4v4DPdbPtr ) += m * xcdbdb * s->real); - (*(here->BSIM4v4DPdbPtr +1) += m * xcdbdb * s->imag); - (*(here->BSIM4v4DPdbPtr) -= m * here->BSIM4v4gbd); - (*(here->BSIM4v4SPsbPtr ) += m * xcsbsb * s->real); - (*(here->BSIM4v4SPsbPtr +1) += m * xcsbsb * s->imag); - (*(here->BSIM4v4SPsbPtr) -= m * here->BSIM4v4gbs); - - (*(here->BSIM4v4DBdpPtr ) += m * xcdbdb * s->real); - (*(here->BSIM4v4DBdpPtr +1) += m * xcdbdb * s->imag); - (*(here->BSIM4v4DBdpPtr) -= m * here->BSIM4v4gbd); - (*(here->BSIM4v4DBdbPtr ) -= m * xcdbdb * s->real); - (*(here->BSIM4v4DBdbPtr +1) -= m * xcdbdb * s->imag); - (*(here->BSIM4v4DBdbPtr) += m * (here->BSIM4v4gbd + here->BSIM4v4grbpd - + here->BSIM4v4grbdb)); - (*(here->BSIM4v4DBbpPtr) -= m * here->BSIM4v4grbpd); - (*(here->BSIM4v4DBbPtr) -= m * here->BSIM4v4grbdb); - - (*(here->BSIM4v4BPdbPtr) -= m * here->BSIM4v4grbpd); - (*(here->BSIM4v4BPbPtr) -= m * here->BSIM4v4grbpb); - (*(here->BSIM4v4BPsbPtr) -= m * here->BSIM4v4grbps); - (*(here->BSIM4v4BPbpPtr) += m * (here->BSIM4v4grbpd + here->BSIM4v4grbps - + here->BSIM4v4grbpb)); - /* WDL: (-here->BSIM4v4gbbs) already added to BPbpPtr */ - - (*(here->BSIM4v4SBspPtr ) += m * xcsbsb * s->real); - (*(here->BSIM4v4SBspPtr +1) += m * xcsbsb * s->imag); - (*(here->BSIM4v4SBspPtr) -= m * here->BSIM4v4gbs); - (*(here->BSIM4v4SBbpPtr) -= m * here->BSIM4v4grbps); - (*(here->BSIM4v4SBbPtr) -= m * here->BSIM4v4grbsb); - (*(here->BSIM4v4SBsbPtr ) -= m * xcsbsb * s->real); - (*(here->BSIM4v4SBsbPtr +1) -= m * xcsbsb * s->imag); - (*(here->BSIM4v4SBsbPtr) += m * (here->BSIM4v4gbs - + here->BSIM4v4grbps + here->BSIM4v4grbsb)); - - (*(here->BSIM4v4BdbPtr) -= m * here->BSIM4v4grbdb); - (*(here->BSIM4v4BbpPtr) -= m * here->BSIM4v4grbpb); - (*(here->BSIM4v4BsbPtr) -= m * here->BSIM4v4grbsb); - (*(here->BSIM4v4BbPtr) += m * (here->BSIM4v4grbsb + here->BSIM4v4grbdb - + here->BSIM4v4grbpb)); - } - - if (here->BSIM4v4acnqsMod) - { *(here->BSIM4v4QqPtr ) += m * s->real * ScalingFactor; - *(here->BSIM4v4QqPtr +1) += m * s->imag * ScalingFactor; - *(here->BSIM4v4QgpPtr ) -= m * xcqgb * s->real; - *(here->BSIM4v4QgpPtr +1) -= m * xcqgb * s->imag; - *(here->BSIM4v4QdpPtr ) -= m * xcqdb * s->real; - *(here->BSIM4v4QdpPtr +1) -= m * xcqdb * s->imag; - *(here->BSIM4v4QbpPtr ) -= m * xcqbb * s->real; - *(here->BSIM4v4QbpPtr +1) -= m * xcqbb * s->imag; - *(here->BSIM4v4QspPtr ) -= m * xcqsb * s->real; - *(here->BSIM4v4QspPtr +1) -= m * xcqsb * s->imag; - - *(here->BSIM4v4GPqPtr) -= m * here->BSIM4v4gtau; - *(here->BSIM4v4DPqPtr) += m * dxpart * here->BSIM4v4gtau; - *(here->BSIM4v4SPqPtr) += m * sxpart * here->BSIM4v4gtau; - - *(here->BSIM4v4QqPtr) += m * here->BSIM4v4gtau; - *(here->BSIM4v4QgpPtr) += m * xgtg; - *(here->BSIM4v4QdpPtr) += m * xgtd; - *(here->BSIM4v4QbpPtr) += m * xgtb; - *(here->BSIM4v4QspPtr) += m * xgts; - } - } - } - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4set.c b/src/spicelib/devices/bsim4v4/b4v4set.c deleted file mode 100644 index cf01a4a80..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4set.c +++ /dev/null @@ -1,1979 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ -/* ngspice multirevision code extension covering 4.2.1 & 4.3.0 & 4.4.0 */ -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4set.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 03/04/2004. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/jobdefs.h" -#include "ngspice/ftedefs.h" -#include "ngspice/smpdefs.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/const.h" -#include "ngspice/sperror.h" - -#define MAX_EXP 5.834617425e14 -#define MIN_EXP 1.713908431e-15 -#define EXP_THRESHOLD 34.0 -#define EPS0 8.85418e-12 -#define EPSSI 1.03594e-10 -#define PI 3.141592654 -#define Charge_q 1.60219e-19 - - -int -BSIM4v4setup( -SMPmatrix *matrix, -GENmodel *inModel, -CKTcircuit *ckt, -int *states) -{ -BSIM4v4model *model = (BSIM4v4model*)inModel; -BSIM4v4instance *here; -int error; -CKTnode *tmp; -int noiseAnalGiven = 0, createNode; /* Criteria for new node creation */ -double Rtot, DMCGeff, DMCIeff, DMDGeff; -JOB *job; - - /* Search for a noise analysis request */ - for (job = ft_curckt->ci_curTask->jobs; job; job = job->JOBnextJob) { - if(strcmp(job->JOBname,"Noise Analysis")==0) { - noiseAnalGiven = 1; - break; - } - } - - /* loop through all the BSIM4v4 device models */ - for( ; model != NULL; model = model->BSIM4v4nextModel ) - { /* process defaults of model parameters */ - if (!model->BSIM4v4typeGiven) - model->BSIM4v4type = NMOS; - - if (!model->BSIM4v4mobModGiven) - model->BSIM4v4mobMod = 0; - else if ((model->BSIM4v4mobMod != 0) && (model->BSIM4v4mobMod != 1) - && (model->BSIM4v4mobMod != 2)) - { model->BSIM4v4mobMod = 0; - printf("Warning: mobMod has been set to its default value: 0.\n"); - } - - if (!model->BSIM4v4binUnitGiven) - model->BSIM4v4binUnit = 1; - if (!model->BSIM4v4paramChkGiven) - model->BSIM4v4paramChk = 1; - - if (!model->BSIM4v4dioModGiven) - model->BSIM4v4dioMod = 1; - else if ((model->BSIM4v4dioMod != 0) && (model->BSIM4v4dioMod != 1) - && (model->BSIM4v4dioMod != 2)) - { model->BSIM4v4dioMod = 1; - printf("Warning: dioMod has been set to its default value: 1.\n"); - } - - if (!model->BSIM4v4capModGiven) - model->BSIM4v4capMod = 2; - else if ((model->BSIM4v4capMod != 0) && (model->BSIM4v4capMod != 1) - && (model->BSIM4v4capMod != 2)) - { model->BSIM4v4capMod = 2; - printf("Warning: capMod has been set to its default value: 2.\n"); - } - - if (!model->BSIM4v4rdsModGiven) - model->BSIM4v4rdsMod = 0; - else if ((model->BSIM4v4rdsMod != 0) && (model->BSIM4v4rdsMod != 1)) - { model->BSIM4v4rdsMod = 0; - printf("Warning: rdsMod has been set to its default value: 0.\n"); - } - if (!model->BSIM4v4rbodyModGiven) - model->BSIM4v4rbodyMod = 0; - else if ((model->BSIM4v4rbodyMod != 0) && (model->BSIM4v4rbodyMod != 1)) - { model->BSIM4v4rbodyMod = 0; - printf("Warning: rbodyMod has been set to its default value: 0.\n"); - } - - if (!model->BSIM4v4rgateModGiven) - model->BSIM4v4rgateMod = 0; - else if ((model->BSIM4v4rgateMod != 0) && (model->BSIM4v4rgateMod != 1) - && (model->BSIM4v4rgateMod != 2) && (model->BSIM4v4rgateMod != 3)) - { model->BSIM4v4rgateMod = 0; - printf("Warning: rgateMod has been set to its default value: 0.\n"); - } - - if (!model->BSIM4v4perModGiven) - model->BSIM4v4perMod = 1; - else if ((model->BSIM4v4perMod != 0) && (model->BSIM4v4perMod != 1)) - { model->BSIM4v4perMod = 1; - printf("Warning: perMod has been set to its default value: 1.\n"); - } - - if (!model->BSIM4v4geoModGiven) - model->BSIM4v4geoMod = 0; - - if (!model->BSIM4v4fnoiModGiven) - model->BSIM4v4fnoiMod = 1; - else if ((model->BSIM4v4fnoiMod != 0) && (model->BSIM4v4fnoiMod != 1)) - { model->BSIM4v4fnoiMod = 1; - printf("Warning: fnoiMod has been set to its default value: 1.\n"); - } - if (!model->BSIM4v4tnoiModGiven) - model->BSIM4v4tnoiMod = 0; /* WDLiu: tnoiMod=1 needs to set internal S/D nodes */ - else if ((model->BSIM4v4tnoiMod != 0) && (model->BSIM4v4tnoiMod != 1)) - { model->BSIM4v4tnoiMod = 0; - printf("Warning: tnoiMod has been set to its default value: 0.\n"); - } - - if (!model->BSIM4v4trnqsModGiven) - model->BSIM4v4trnqsMod = 0; - else if ((model->BSIM4v4trnqsMod != 0) && (model->BSIM4v4trnqsMod != 1)) - { model->BSIM4v4trnqsMod = 0; - printf("Warning: trnqsMod has been set to its default value: 0.\n"); - } - if (!model->BSIM4v4acnqsModGiven) - model->BSIM4v4acnqsMod = 0; - else if ((model->BSIM4v4acnqsMod != 0) && (model->BSIM4v4acnqsMod != 1)) - { model->BSIM4v4acnqsMod = 0; - printf("Warning: acnqsMod has been set to its default value: 0.\n"); - } - - if (!model->BSIM4v4igcModGiven) - model->BSIM4v4igcMod = 0; - else if ((model->BSIM4v4igcMod != 0) && (model->BSIM4v4igcMod != 1)) - { model->BSIM4v4igcMod = 0; - printf("Warning: igcMod has been set to its default value: 0.\n"); - } - if (!model->BSIM4v4igbModGiven) - model->BSIM4v4igbMod = 0; - else if ((model->BSIM4v4igbMod != 0) && (model->BSIM4v4igbMod != 1)) - { model->BSIM4v4igbMod = 0; - printf("Warning: igbMod has been set to its default value: 0.\n"); - } - - /* If the user does not provide the model revision, - * we always choose the most recent for this code. - */ - if (!model->BSIM4v4versionGiven) - model->BSIM4v4version = "4.4.0"; - - if ((!strcmp(model->BSIM4v4version, "4.2.1"))||(!strcmp(model->BSIM4v4version, "4.21"))) - model->BSIM4v4intVersion = BSIM4v21; - else if ((!strcmp(model->BSIM4v4version, "4.3.0"))||(!strcmp(model->BSIM4v4version, "4.30"))||(!strcmp(model->BSIM4v4version, "4.3"))) - model->BSIM4v4intVersion = BSIM4v30; - else if ((!strcmp(model->BSIM4v4version, "4.4.0"))||(!strcmp(model->BSIM4v4version, "4.40"))||(!strcmp(model->BSIM4v4version, "4.4"))) - model->BSIM4v4intVersion = BSIM4v40; - else - model->BSIM4v4intVersion = BSIM4vOLD; - /* BSIM4vOLD is a placeholder for pre 2.1 revision - * This model should not be used for pre 2.1 models. - */ - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if (!model->BSIM4v4tempModGiven) - model->BSIM4v4tempMod = 0; - else if ((model->BSIM4v4tempMod != 0) && (model->BSIM4v4tempMod != 1)) - { model->BSIM4v4tempMod = 0; - printf("Warning: tempMod has been set to its default value: 0.\n"); - } - break; - default: break; - } - - if (!model->BSIM4v4toxrefGiven) - model->BSIM4v4toxref = 30.0e-10; - if (!model->BSIM4v4toxeGiven) - model->BSIM4v4toxe = 30.0e-10; - if (!model->BSIM4v4toxpGiven) - model->BSIM4v4toxp = model->BSIM4v4toxe; - if (!model->BSIM4v4toxmGiven) - model->BSIM4v4toxm = model->BSIM4v4toxe; - if (!model->BSIM4v4dtoxGiven) - model->BSIM4v4dtox = 0.0; - if (!model->BSIM4v4epsroxGiven) - model->BSIM4v4epsrox = 3.9; - - if (!model->BSIM4v4cdscGiven) - model->BSIM4v4cdsc = 2.4e-4; /* unit Q/V/m^2 */ - if (!model->BSIM4v4cdscbGiven) - model->BSIM4v4cdscb = 0.0; /* unit Q/V/m^2 */ - if (!model->BSIM4v4cdscdGiven) - model->BSIM4v4cdscd = 0.0; /* unit Q/V/m^2 */ - if (!model->BSIM4v4citGiven) - model->BSIM4v4cit = 0.0; /* unit Q/V/m^2 */ - if (!model->BSIM4v4nfactorGiven) - model->BSIM4v4nfactor = 1.0; - if (!model->BSIM4v4xjGiven) - model->BSIM4v4xj = .15e-6; - if (!model->BSIM4v4vsatGiven) - model->BSIM4v4vsat = 8.0e4; /* unit m/s */ - if (!model->BSIM4v4atGiven) - model->BSIM4v4at = 3.3e4; /* unit m/s */ - if (!model->BSIM4v4a0Given) - model->BSIM4v4a0 = 1.0; - if (!model->BSIM4v4agsGiven) - model->BSIM4v4ags = 0.0; - if (!model->BSIM4v4a1Given) - model->BSIM4v4a1 = 0.0; - if (!model->BSIM4v4a2Given) - model->BSIM4v4a2 = 1.0; - if (!model->BSIM4v4ketaGiven) - model->BSIM4v4keta = -0.047; /* unit / V */ - if (!model->BSIM4v4nsubGiven) - model->BSIM4v4nsub = 6.0e16; /* unit 1/cm3 */ - if (!model->BSIM4v4ndepGiven) - model->BSIM4v4ndep = 1.7e17; /* unit 1/cm3 */ - if (!model->BSIM4v4nsdGiven) - model->BSIM4v4nsd = 1.0e20; /* unit 1/cm3 */ - if (!model->BSIM4v4phinGiven) - model->BSIM4v4phin = 0.0; /* unit V */ - if (!model->BSIM4v4ngateGiven) - model->BSIM4v4ngate = 0; /* unit 1/cm3 */ - if (!model->BSIM4v4vbmGiven) - model->BSIM4v4vbm = -3.0; - if (!model->BSIM4v4xtGiven) - model->BSIM4v4xt = 1.55e-7; - if (!model->BSIM4v4kt1Given) - model->BSIM4v4kt1 = -0.11; /* unit V */ - if (!model->BSIM4v4kt1lGiven) - model->BSIM4v4kt1l = 0.0; /* unit V*m */ - if (!model->BSIM4v4kt2Given) - model->BSIM4v4kt2 = 0.022; /* No unit */ - if (!model->BSIM4v4k3Given) - model->BSIM4v4k3 = 80.0; - if (!model->BSIM4v4k3bGiven) - model->BSIM4v4k3b = 0.0; - if (!model->BSIM4v4w0Given) - model->BSIM4v4w0 = 2.5e-6; - if (!model->BSIM4v4lpe0Given) - model->BSIM4v4lpe0 = 1.74e-7; - if (!model->BSIM4v4lpebGiven) - model->BSIM4v4lpeb = 0.0; - if (!model->BSIM4v4dvtp0Given) - model->BSIM4v4dvtp0 = 0.0; - if (!model->BSIM4v4dvtp1Given) - model->BSIM4v4dvtp1 = 0.0; - if (!model->BSIM4v4dvt0Given) - model->BSIM4v4dvt0 = 2.2; - if (!model->BSIM4v4dvt1Given) - model->BSIM4v4dvt1 = 0.53; - if (!model->BSIM4v4dvt2Given) - model->BSIM4v4dvt2 = -0.032; /* unit 1 / V */ - - if (!model->BSIM4v4dvt0wGiven) - model->BSIM4v4dvt0w = 0.0; - if (!model->BSIM4v4dvt1wGiven) - model->BSIM4v4dvt1w = 5.3e6; - if (!model->BSIM4v4dvt2wGiven) - model->BSIM4v4dvt2w = -0.032; - - if (!model->BSIM4v4droutGiven) - model->BSIM4v4drout = 0.56; - if (!model->BSIM4v4dsubGiven) - model->BSIM4v4dsub = model->BSIM4v4drout; - if (!model->BSIM4v4vth0Given) - model->BSIM4v4vth0 = (model->BSIM4v4type == NMOS) ? 0.7 : -0.7; - if (!model->BSIM4v4euGiven) - model->BSIM4v4eu = (model->BSIM4v4type == NMOS) ? 1.67 : 1.0;; - if (!model->BSIM4v4uaGiven) - model->BSIM4v4ua = (model->BSIM4v4mobMod == 2) ? 1.0e-15 : 1.0e-9; /* unit m/V */ - if (!model->BSIM4v4ua1Given) - model->BSIM4v4ua1 = 1.0e-9; /* unit m/V */ - if (!model->BSIM4v4ubGiven) - model->BSIM4v4ub = 1.0e-19; /* unit (m/V)**2 */ - if (!model->BSIM4v4ub1Given) - model->BSIM4v4ub1 = -1.0e-18; /* unit (m/V)**2 */ - if (!model->BSIM4v4ucGiven) - model->BSIM4v4uc = (model->BSIM4v4mobMod == 1) ? -0.0465 : -0.0465e-9; - if (!model->BSIM4v4uc1Given) - model->BSIM4v4uc1 = (model->BSIM4v4mobMod == 1) ? -0.056 : -0.056e-9; - if (!model->BSIM4v4u0Given) - model->BSIM4v4u0 = (model->BSIM4v4type == NMOS) ? 0.067 : 0.025; - if (!model->BSIM4v4uteGiven) - model->BSIM4v4ute = -1.5; - if (!model->BSIM4v4voffGiven) - model->BSIM4v4voff = -0.08; - if (!model->BSIM4v4vofflGiven) - model->BSIM4v4voffl = 0.0; - if (!model->BSIM4v4minvGiven) - model->BSIM4v4minv = 0.0; - if (!model->BSIM4v4fproutGiven) - model->BSIM4v4fprout = 0.0; - if (!model->BSIM4v4pditsGiven) - model->BSIM4v4pdits = 0.0; - if (!model->BSIM4v4pditsdGiven) - model->BSIM4v4pditsd = 0.0; - if (!model->BSIM4v4pditslGiven) - model->BSIM4v4pditsl = 0.0; - if (!model->BSIM4v4deltaGiven) - model->BSIM4v4delta = 0.01; - if (!model->BSIM4v4rdswminGiven) - model->BSIM4v4rdswmin = 0.0; - if (!model->BSIM4v4rdwminGiven) - model->BSIM4v4rdwmin = 0.0; - if (!model->BSIM4v4rswminGiven) - model->BSIM4v4rswmin = 0.0; - if (!model->BSIM4v4rdswGiven) - model->BSIM4v4rdsw = 200.0; /* in ohm*um */ - if (!model->BSIM4v4rdwGiven) - model->BSIM4v4rdw = 100.0; - if (!model->BSIM4v4rswGiven) - model->BSIM4v4rsw = 100.0; - if (!model->BSIM4v4prwgGiven) - model->BSIM4v4prwg = 1.0; /* in 1/V */ - if (!model->BSIM4v4prwbGiven) - model->BSIM4v4prwb = 0.0; - if (!model->BSIM4v4prtGiven) - if (!model->BSIM4v4prtGiven) - model->BSIM4v4prt = 0.0; - if (!model->BSIM4v4eta0Given) - model->BSIM4v4eta0 = 0.08; /* no unit */ - if (!model->BSIM4v4etabGiven) - model->BSIM4v4etab = -0.07; /* unit 1/V */ - if (!model->BSIM4v4pclmGiven) - model->BSIM4v4pclm = 1.3; /* no unit */ - if (!model->BSIM4v4pdibl1Given) - model->BSIM4v4pdibl1 = 0.39; /* no unit */ - if (!model->BSIM4v4pdibl2Given) - model->BSIM4v4pdibl2 = 0.0086; /* no unit */ - if (!model->BSIM4v4pdiblbGiven) - model->BSIM4v4pdiblb = 0.0; /* 1/V */ - if (!model->BSIM4v4pscbe1Given) - model->BSIM4v4pscbe1 = 4.24e8; - if (!model->BSIM4v4pscbe2Given) - model->BSIM4v4pscbe2 = 1.0e-5; - if (!model->BSIM4v4pvagGiven) - model->BSIM4v4pvag = 0.0; - if (!model->BSIM4v4wrGiven) - model->BSIM4v4wr = 1.0; - if (!model->BSIM4v4dwgGiven) - model->BSIM4v4dwg = 0.0; - if (!model->BSIM4v4dwbGiven) - model->BSIM4v4dwb = 0.0; - if (!model->BSIM4v4b0Given) - model->BSIM4v4b0 = 0.0; - if (!model->BSIM4v4b1Given) - model->BSIM4v4b1 = 0.0; - if (!model->BSIM4v4alpha0Given) - model->BSIM4v4alpha0 = 0.0; - if (!model->BSIM4v4alpha1Given) - model->BSIM4v4alpha1 = 0.0; - if (!model->BSIM4v4beta0Given) - model->BSIM4v4beta0 = 30.0; - if (!model->BSIM4v4agidlGiven) - model->BSIM4v4agidl = 0.0; - if (!model->BSIM4v4bgidlGiven) - model->BSIM4v4bgidl = 2.3e9; /* V/m */ - if (!model->BSIM4v4cgidlGiven) - model->BSIM4v4cgidl = 0.5; /* V^3 */ - if (!model->BSIM4v4egidlGiven) - model->BSIM4v4egidl = 0.8; /* V */ - if (!model->BSIM4v4aigcGiven) - model->BSIM4v4aigc = (model->BSIM4v4type == NMOS) ? 0.43 : 0.31; - if (!model->BSIM4v4bigcGiven) - model->BSIM4v4bigc = (model->BSIM4v4type == NMOS) ? 0.054 : 0.024; - if (!model->BSIM4v4cigcGiven) - model->BSIM4v4cigc = (model->BSIM4v4type == NMOS) ? 0.075 : 0.03; - if (!model->BSIM4v4aigsdGiven) - model->BSIM4v4aigsd = (model->BSIM4v4type == NMOS) ? 0.43 : 0.31; - if (!model->BSIM4v4bigsdGiven) - model->BSIM4v4bigsd = (model->BSIM4v4type == NMOS) ? 0.054 : 0.024; - if (!model->BSIM4v4cigsdGiven) - model->BSIM4v4cigsd = (model->BSIM4v4type == NMOS) ? 0.075 : 0.03; - if (!model->BSIM4v4aigbaccGiven) - model->BSIM4v4aigbacc = 0.43; - if (!model->BSIM4v4bigbaccGiven) - model->BSIM4v4bigbacc = 0.054; - if (!model->BSIM4v4cigbaccGiven) - model->BSIM4v4cigbacc = 0.075; - if (!model->BSIM4v4aigbinvGiven) - model->BSIM4v4aigbinv = 0.35; - if (!model->BSIM4v4bigbinvGiven) - model->BSIM4v4bigbinv = 0.03; - if (!model->BSIM4v4cigbinvGiven) - model->BSIM4v4cigbinv = 0.006; - if (!model->BSIM4v4nigcGiven) - model->BSIM4v4nigc = 1.0; - if (!model->BSIM4v4nigbinvGiven) - model->BSIM4v4nigbinv = 3.0; - if (!model->BSIM4v4nigbaccGiven) - model->BSIM4v4nigbacc = 1.0; - if (!model->BSIM4v4ntoxGiven) - model->BSIM4v4ntox = 1.0; - if (!model->BSIM4v4eigbinvGiven) - model->BSIM4v4eigbinv = 1.1; - if (!model->BSIM4v4pigcdGiven) - model->BSIM4v4pigcd = 1.0; - if (!model->BSIM4v4poxedgeGiven) - model->BSIM4v4poxedge = 1.0; - if (!model->BSIM4v4xrcrg1Given) - model->BSIM4v4xrcrg1 = 12.0; - if (!model->BSIM4v4xrcrg2Given) - model->BSIM4v4xrcrg2 = 1.0; - if (!model->BSIM4v4ijthsfwdGiven) - model->BSIM4v4ijthsfwd = 0.1; /* unit A */ - if (!model->BSIM4v4ijthdfwdGiven) - model->BSIM4v4ijthdfwd = model->BSIM4v4ijthsfwd; - if (!model->BSIM4v4ijthsrevGiven) - model->BSIM4v4ijthsrev = 0.1; /* unit A */ - if (!model->BSIM4v4ijthdrevGiven) - model->BSIM4v4ijthdrev = model->BSIM4v4ijthsrev; - if (!model->BSIM4v4tnoiaGiven) - model->BSIM4v4tnoia = 1.5; - if (!model->BSIM4v4tnoibGiven) - model->BSIM4v4tnoib = 3.5; - if (!model->BSIM4v4ntnoiGiven) - model->BSIM4v4ntnoi = 1.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: - if (!model->BSIM4v4rnoibGiven) - model->BSIM4v4rnoib = 0.37; - break; - case BSIM4v40: - if (!model->BSIM4v4rnoibGiven) - model->BSIM4v4rnoib = 0.5164; - break; - default: break; - } - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if (!model->BSIM4v4rnoiaGiven) - model->BSIM4v4rnoia = 0.577; - if (!model->BSIM4v4lambdaGiven) - model->BSIM4v4lambda = 0.0; - if (!model->BSIM4v4vtlGiven) - model->BSIM4v4vtl = 2.0e5; /* unit m/s */ - if (!model->BSIM4v4xnGiven) - model->BSIM4v4xn = 3.0; - if (!model->BSIM4v4lcGiven) - model->BSIM4v4lc = 5.0e-9; - break; - default: break; - } - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if (!model->BSIM4v4vfbsdoffGiven) - model->BSIM4v4vfbsdoff = 0.0; /* unit v */ - if (!model->BSIM4v4lintnoiGiven) - model->BSIM4v4lintnoi = 0.0; /* unit m */ - break; - default: break; - } - if (!model->BSIM4v4xjbvsGiven) - model->BSIM4v4xjbvs = 1.0; /* no unit */ - if (!model->BSIM4v4xjbvdGiven) - model->BSIM4v4xjbvd = model->BSIM4v4xjbvs; - if (!model->BSIM4v4bvsGiven) - model->BSIM4v4bvs = 10.0; /* V */ - if (!model->BSIM4v4bvdGiven) - model->BSIM4v4bvd = model->BSIM4v4bvs; - if (!model->BSIM4v4gbminGiven) - model->BSIM4v4gbmin = 1.0e-12; /* in mho */ - if (!model->BSIM4v4rbdbGiven) - model->BSIM4v4rbdb = 50.0; /* in ohm */ - if (!model->BSIM4v4rbpbGiven) - model->BSIM4v4rbpb = 50.0; - if (!model->BSIM4v4rbsbGiven) - model->BSIM4v4rbsb = 50.0; - if (!model->BSIM4v4rbpsGiven) - model->BSIM4v4rbps = 50.0; - if (!model->BSIM4v4rbpdGiven) - model->BSIM4v4rbpd = 50.0; - - if (!model->BSIM4v4cgslGiven) - model->BSIM4v4cgsl = 0.0; - if (!model->BSIM4v4cgdlGiven) - model->BSIM4v4cgdl = 0.0; - if (!model->BSIM4v4ckappasGiven) - model->BSIM4v4ckappas = 0.6; - if (!model->BSIM4v4ckappadGiven) - model->BSIM4v4ckappad = model->BSIM4v4ckappas; - if (!model->BSIM4v4clcGiven) - model->BSIM4v4clc = 0.1e-6; - if (!model->BSIM4v4cleGiven) - model->BSIM4v4cle = 0.6; - if (!model->BSIM4v4vfbcvGiven) - model->BSIM4v4vfbcv = -1.0; - if (!model->BSIM4v4acdeGiven) - model->BSIM4v4acde = 1.0; - if (!model->BSIM4v4moinGiven) - model->BSIM4v4moin = 15.0; - if (!model->BSIM4v4noffGiven) - model->BSIM4v4noff = 1.0; - if (!model->BSIM4v4voffcvGiven) - model->BSIM4v4voffcv = 0.0; - if (!model->BSIM4v4dmcgGiven) - model->BSIM4v4dmcg = 0.0; - if (!model->BSIM4v4dmciGiven) - model->BSIM4v4dmci = model->BSIM4v4dmcg; - if (!model->BSIM4v4dmdgGiven) - model->BSIM4v4dmdg = 0.0; - if (!model->BSIM4v4dmcgtGiven) - model->BSIM4v4dmcgt = 0.0; - if (!model->BSIM4v4xgwGiven) - model->BSIM4v4xgw = 0.0; - if (!model->BSIM4v4xglGiven) - model->BSIM4v4xgl = 0.0; - if (!model->BSIM4v4rshgGiven) - model->BSIM4v4rshg = 0.1; - if (!model->BSIM4v4ngconGiven) - model->BSIM4v4ngcon = 1.0; - if (!model->BSIM4v4tcjGiven) - model->BSIM4v4tcj = 0.0; - if (!model->BSIM4v4tpbGiven) - model->BSIM4v4tpb = 0.0; - if (!model->BSIM4v4tcjswGiven) - model->BSIM4v4tcjsw = 0.0; - if (!model->BSIM4v4tpbswGiven) - model->BSIM4v4tpbsw = 0.0; - if (!model->BSIM4v4tcjswgGiven) - model->BSIM4v4tcjswg = 0.0; - if (!model->BSIM4v4tpbswgGiven) - model->BSIM4v4tpbswg = 0.0; - - /* Length dependence */ - if (!model->BSIM4v4lcdscGiven) - model->BSIM4v4lcdsc = 0.0; - if (!model->BSIM4v4lcdscbGiven) - model->BSIM4v4lcdscb = 0.0; - if (!model->BSIM4v4lcdscdGiven) - model->BSIM4v4lcdscd = 0.0; - if (!model->BSIM4v4lcitGiven) - model->BSIM4v4lcit = 0.0; - if (!model->BSIM4v4lnfactorGiven) - model->BSIM4v4lnfactor = 0.0; - if (!model->BSIM4v4lxjGiven) - model->BSIM4v4lxj = 0.0; - if (!model->BSIM4v4lvsatGiven) - model->BSIM4v4lvsat = 0.0; - if (!model->BSIM4v4latGiven) - model->BSIM4v4lat = 0.0; - if (!model->BSIM4v4la0Given) - model->BSIM4v4la0 = 0.0; - if (!model->BSIM4v4lagsGiven) - model->BSIM4v4lags = 0.0; - if (!model->BSIM4v4la1Given) - model->BSIM4v4la1 = 0.0; - if (!model->BSIM4v4la2Given) - model->BSIM4v4la2 = 0.0; - if (!model->BSIM4v4lketaGiven) - model->BSIM4v4lketa = 0.0; - if (!model->BSIM4v4lnsubGiven) - model->BSIM4v4lnsub = 0.0; - if (!model->BSIM4v4lndepGiven) - model->BSIM4v4lndep = 0.0; - if (!model->BSIM4v4lnsdGiven) - model->BSIM4v4lnsd = 0.0; - if (!model->BSIM4v4lphinGiven) - model->BSIM4v4lphin = 0.0; - if (!model->BSIM4v4lngateGiven) - model->BSIM4v4lngate = 0.0; - if (!model->BSIM4v4lvbmGiven) - model->BSIM4v4lvbm = 0.0; - if (!model->BSIM4v4lxtGiven) - model->BSIM4v4lxt = 0.0; - if (!model->BSIM4v4lkt1Given) - model->BSIM4v4lkt1 = 0.0; - if (!model->BSIM4v4lkt1lGiven) - model->BSIM4v4lkt1l = 0.0; - if (!model->BSIM4v4lkt2Given) - model->BSIM4v4lkt2 = 0.0; - if (!model->BSIM4v4lk3Given) - model->BSIM4v4lk3 = 0.0; - if (!model->BSIM4v4lk3bGiven) - model->BSIM4v4lk3b = 0.0; - if (!model->BSIM4v4lw0Given) - model->BSIM4v4lw0 = 0.0; - if (!model->BSIM4v4llpe0Given) - model->BSIM4v4llpe0 = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (!model->BSIM4v4llpebGiven) - model->BSIM4v4llpeb = model->BSIM4v4llpe0; - break; - case BSIM4v40: - if (!model->BSIM4v4llpebGiven) - model->BSIM4v4llpeb = 0.0; - break; - default: break; - } - if (!model->BSIM4v4ldvtp0Given) - model->BSIM4v4ldvtp0 = 0.0; - if (!model->BSIM4v4ldvtp1Given) - model->BSIM4v4ldvtp1 = 0.0; - if (!model->BSIM4v4ldvt0Given) - model->BSIM4v4ldvt0 = 0.0; - if (!model->BSIM4v4ldvt1Given) - model->BSIM4v4ldvt1 = 0.0; - if (!model->BSIM4v4ldvt2Given) - model->BSIM4v4ldvt2 = 0.0; - if (!model->BSIM4v4ldvt0wGiven) - model->BSIM4v4ldvt0w = 0.0; - if (!model->BSIM4v4ldvt1wGiven) - model->BSIM4v4ldvt1w = 0.0; - if (!model->BSIM4v4ldvt2wGiven) - model->BSIM4v4ldvt2w = 0.0; - if (!model->BSIM4v4ldroutGiven) - model->BSIM4v4ldrout = 0.0; - if (!model->BSIM4v4ldsubGiven) - model->BSIM4v4ldsub = 0.0; - if (!model->BSIM4v4lvth0Given) - model->BSIM4v4lvth0 = 0.0; - if (!model->BSIM4v4luaGiven) - model->BSIM4v4lua = 0.0; - if (!model->BSIM4v4lua1Given) - model->BSIM4v4lua1 = 0.0; - if (!model->BSIM4v4lubGiven) - model->BSIM4v4lub = 0.0; - if (!model->BSIM4v4lub1Given) - model->BSIM4v4lub1 = 0.0; - if (!model->BSIM4v4lucGiven) - model->BSIM4v4luc = 0.0; - if (!model->BSIM4v4luc1Given) - model->BSIM4v4luc1 = 0.0; - if (!model->BSIM4v4lu0Given) - model->BSIM4v4lu0 = 0.0; - if (!model->BSIM4v4luteGiven) - model->BSIM4v4lute = 0.0; - if (!model->BSIM4v4lvoffGiven) - model->BSIM4v4lvoff = 0.0; - if (!model->BSIM4v4lminvGiven) - model->BSIM4v4lminv = 0.0; - if (!model->BSIM4v4lfproutGiven) - model->BSIM4v4lfprout = 0.0; - if (!model->BSIM4v4lpditsGiven) - model->BSIM4v4lpdits = 0.0; - if (!model->BSIM4v4lpditsdGiven) - model->BSIM4v4lpditsd = 0.0; - if (!model->BSIM4v4ldeltaGiven) - model->BSIM4v4ldelta = 0.0; - if (!model->BSIM4v4lrdswGiven) - model->BSIM4v4lrdsw = 0.0; - if (!model->BSIM4v4lrdwGiven) - model->BSIM4v4lrdw = 0.0; - if (!model->BSIM4v4lrswGiven) - model->BSIM4v4lrsw = 0.0; - if (!model->BSIM4v4lprwbGiven) - model->BSIM4v4lprwb = 0.0; - if (!model->BSIM4v4lprwgGiven) - model->BSIM4v4lprwg = 0.0; - if (!model->BSIM4v4lprtGiven) - model->BSIM4v4lprt = 0.0; - if (!model->BSIM4v4leta0Given) - model->BSIM4v4leta0 = 0.0; - if (!model->BSIM4v4letabGiven) - model->BSIM4v4letab = -0.0; - if (!model->BSIM4v4lpclmGiven) - model->BSIM4v4lpclm = 0.0; - if (!model->BSIM4v4lpdibl1Given) - model->BSIM4v4lpdibl1 = 0.0; - if (!model->BSIM4v4lpdibl2Given) - model->BSIM4v4lpdibl2 = 0.0; - if (!model->BSIM4v4lpdiblbGiven) - model->BSIM4v4lpdiblb = 0.0; - if (!model->BSIM4v4lpscbe1Given) - model->BSIM4v4lpscbe1 = 0.0; - if (!model->BSIM4v4lpscbe2Given) - model->BSIM4v4lpscbe2 = 0.0; - if (!model->BSIM4v4lpvagGiven) - model->BSIM4v4lpvag = 0.0; - if (!model->BSIM4v4lwrGiven) - model->BSIM4v4lwr = 0.0; - if (!model->BSIM4v4ldwgGiven) - model->BSIM4v4ldwg = 0.0; - if (!model->BSIM4v4ldwbGiven) - model->BSIM4v4ldwb = 0.0; - if (!model->BSIM4v4lb0Given) - model->BSIM4v4lb0 = 0.0; - if (!model->BSIM4v4lb1Given) - model->BSIM4v4lb1 = 0.0; - if (!model->BSIM4v4lalpha0Given) - model->BSIM4v4lalpha0 = 0.0; - if (!model->BSIM4v4lalpha1Given) - model->BSIM4v4lalpha1 = 0.0; - if (!model->BSIM4v4lbeta0Given) - model->BSIM4v4lbeta0 = 0.0; - if (!model->BSIM4v4lagidlGiven) - model->BSIM4v4lagidl = 0.0; - if (!model->BSIM4v4lbgidlGiven) - model->BSIM4v4lbgidl = 0.0; - if (!model->BSIM4v4lcgidlGiven) - model->BSIM4v4lcgidl = 0.0; - if (!model->BSIM4v4legidlGiven) - model->BSIM4v4legidl = 0.0; - if (!model->BSIM4v4laigcGiven) - model->BSIM4v4laigc = 0.0; - if (!model->BSIM4v4lbigcGiven) - model->BSIM4v4lbigc = 0.0; - if (!model->BSIM4v4lcigcGiven) - model->BSIM4v4lcigc = 0.0; - if (!model->BSIM4v4laigsdGiven) - model->BSIM4v4laigsd = 0.0; - if (!model->BSIM4v4lbigsdGiven) - model->BSIM4v4lbigsd = 0.0; - if (!model->BSIM4v4lcigsdGiven) - model->BSIM4v4lcigsd = 0.0; - if (!model->BSIM4v4laigbaccGiven) - model->BSIM4v4laigbacc = 0.0; - if (!model->BSIM4v4lbigbaccGiven) - model->BSIM4v4lbigbacc = 0.0; - if (!model->BSIM4v4lcigbaccGiven) - model->BSIM4v4lcigbacc = 0.0; - if (!model->BSIM4v4laigbinvGiven) - model->BSIM4v4laigbinv = 0.0; - if (!model->BSIM4v4lbigbinvGiven) - model->BSIM4v4lbigbinv = 0.0; - if (!model->BSIM4v4lcigbinvGiven) - model->BSIM4v4lcigbinv = 0.0; - if (!model->BSIM4v4lnigcGiven) - model->BSIM4v4lnigc = 0.0; - if (!model->BSIM4v4lnigbinvGiven) - model->BSIM4v4lnigbinv = 0.0; - if (!model->BSIM4v4lnigbaccGiven) - model->BSIM4v4lnigbacc = 0.0; - if (!model->BSIM4v4lntoxGiven) - model->BSIM4v4lntox = 0.0; - if (!model->BSIM4v4leigbinvGiven) - model->BSIM4v4leigbinv = 0.0; - if (!model->BSIM4v4lpigcdGiven) - model->BSIM4v4lpigcd = 0.0; - if (!model->BSIM4v4lpoxedgeGiven) - model->BSIM4v4lpoxedge = 0.0; - if (!model->BSIM4v4lxrcrg1Given) - model->BSIM4v4lxrcrg1 = 0.0; - if (!model->BSIM4v4lxrcrg2Given) - model->BSIM4v4lxrcrg2 = 0.0; - if (!model->BSIM4v4leuGiven) - model->BSIM4v4leu = 0.0; - if (!model->BSIM4v4lvfbGiven) - model->BSIM4v4lvfb = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if (!model->BSIM4v4llambdaGiven) - model->BSIM4v4llambda = 0.0; - if (!model->BSIM4v4lvtlGiven) - model->BSIM4v4lvtl = 0.0; - if (!model->BSIM4v4lxnGiven) - model->BSIM4v4lxn = 0.0; - break; - default: break; - } - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if (!model->BSIM4v4lvfbsdoffGiven) - model->BSIM4v4lvfbsdoff = 0.0; - break; - default: break; - } - if (!model->BSIM4v4lcgslGiven) - model->BSIM4v4lcgsl = 0.0; - if (!model->BSIM4v4lcgdlGiven) - model->BSIM4v4lcgdl = 0.0; - if (!model->BSIM4v4lckappasGiven) - model->BSIM4v4lckappas = 0.0; - if (!model->BSIM4v4lckappadGiven) - model->BSIM4v4lckappad = 0.0; - if (!model->BSIM4v4lclcGiven) - model->BSIM4v4lclc = 0.0; - if (!model->BSIM4v4lcleGiven) - model->BSIM4v4lcle = 0.0; - if (!model->BSIM4v4lcfGiven) - model->BSIM4v4lcf = 0.0; - if (!model->BSIM4v4lvfbcvGiven) - model->BSIM4v4lvfbcv = 0.0; - if (!model->BSIM4v4lacdeGiven) - model->BSIM4v4lacde = 0.0; - if (!model->BSIM4v4lmoinGiven) - model->BSIM4v4lmoin = 0.0; - if (!model->BSIM4v4lnoffGiven) - model->BSIM4v4lnoff = 0.0; - if (!model->BSIM4v4lvoffcvGiven) - model->BSIM4v4lvoffcv = 0.0; - - /* Width dependence */ - if (!model->BSIM4v4wcdscGiven) - model->BSIM4v4wcdsc = 0.0; - if (!model->BSIM4v4wcdscbGiven) - model->BSIM4v4wcdscb = 0.0; - if (!model->BSIM4v4wcdscdGiven) - model->BSIM4v4wcdscd = 0.0; - if (!model->BSIM4v4wcitGiven) - model->BSIM4v4wcit = 0.0; - if (!model->BSIM4v4wnfactorGiven) - model->BSIM4v4wnfactor = 0.0; - if (!model->BSIM4v4wxjGiven) - model->BSIM4v4wxj = 0.0; - if (!model->BSIM4v4wvsatGiven) - model->BSIM4v4wvsat = 0.0; - if (!model->BSIM4v4watGiven) - model->BSIM4v4wat = 0.0; - if (!model->BSIM4v4wa0Given) - model->BSIM4v4wa0 = 0.0; - if (!model->BSIM4v4wagsGiven) - model->BSIM4v4wags = 0.0; - if (!model->BSIM4v4wa1Given) - model->BSIM4v4wa1 = 0.0; - if (!model->BSIM4v4wa2Given) - model->BSIM4v4wa2 = 0.0; - if (!model->BSIM4v4wketaGiven) - model->BSIM4v4wketa = 0.0; - if (!model->BSIM4v4wnsubGiven) - model->BSIM4v4wnsub = 0.0; - if (!model->BSIM4v4wndepGiven) - model->BSIM4v4wndep = 0.0; - if (!model->BSIM4v4wnsdGiven) - model->BSIM4v4wnsd = 0.0; - if (!model->BSIM4v4wphinGiven) - model->BSIM4v4wphin = 0.0; - if (!model->BSIM4v4wngateGiven) - model->BSIM4v4wngate = 0.0; - if (!model->BSIM4v4wvbmGiven) - model->BSIM4v4wvbm = 0.0; - if (!model->BSIM4v4wxtGiven) - model->BSIM4v4wxt = 0.0; - if (!model->BSIM4v4wkt1Given) - model->BSIM4v4wkt1 = 0.0; - if (!model->BSIM4v4wkt1lGiven) - model->BSIM4v4wkt1l = 0.0; - if (!model->BSIM4v4wkt2Given) - model->BSIM4v4wkt2 = 0.0; - if (!model->BSIM4v4wk3Given) - model->BSIM4v4wk3 = 0.0; - if (!model->BSIM4v4wk3bGiven) - model->BSIM4v4wk3b = 0.0; - if (!model->BSIM4v4ww0Given) - model->BSIM4v4ww0 = 0.0; - if (!model->BSIM4v4wlpe0Given) - model->BSIM4v4wlpe0 = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (!model->BSIM4v4wlpebGiven) - model->BSIM4v4wlpeb = model->BSIM4v4wlpe0; - break; - case BSIM4v40: - if (!model->BSIM4v4wlpebGiven) - model->BSIM4v4wlpeb = 0.0; - break; - default: break; - } - if (!model->BSIM4v4wdvtp0Given) - model->BSIM4v4wdvtp0 = 0.0; - if (!model->BSIM4v4wdvtp1Given) - model->BSIM4v4wdvtp1 = 0.0; - if (!model->BSIM4v4wdvt0Given) - model->BSIM4v4wdvt0 = 0.0; - if (!model->BSIM4v4wdvt1Given) - model->BSIM4v4wdvt1 = 0.0; - if (!model->BSIM4v4wdvt2Given) - model->BSIM4v4wdvt2 = 0.0; - if (!model->BSIM4v4wdvt0wGiven) - model->BSIM4v4wdvt0w = 0.0; - if (!model->BSIM4v4wdvt1wGiven) - model->BSIM4v4wdvt1w = 0.0; - if (!model->BSIM4v4wdvt2wGiven) - model->BSIM4v4wdvt2w = 0.0; - if (!model->BSIM4v4wdroutGiven) - model->BSIM4v4wdrout = 0.0; - if (!model->BSIM4v4wdsubGiven) - model->BSIM4v4wdsub = 0.0; - if (!model->BSIM4v4wvth0Given) - model->BSIM4v4wvth0 = 0.0; - if (!model->BSIM4v4wuaGiven) - model->BSIM4v4wua = 0.0; - if (!model->BSIM4v4wua1Given) - model->BSIM4v4wua1 = 0.0; - if (!model->BSIM4v4wubGiven) - model->BSIM4v4wub = 0.0; - if (!model->BSIM4v4wub1Given) - model->BSIM4v4wub1 = 0.0; - if (!model->BSIM4v4wucGiven) - model->BSIM4v4wuc = 0.0; - if (!model->BSIM4v4wuc1Given) - model->BSIM4v4wuc1 = 0.0; - if (!model->BSIM4v4wu0Given) - model->BSIM4v4wu0 = 0.0; - if (!model->BSIM4v4wuteGiven) - model->BSIM4v4wute = 0.0; - if (!model->BSIM4v4wvoffGiven) - model->BSIM4v4wvoff = 0.0; - if (!model->BSIM4v4wminvGiven) - model->BSIM4v4wminv = 0.0; - if (!model->BSIM4v4wfproutGiven) - model->BSIM4v4wfprout = 0.0; - if (!model->BSIM4v4wpditsGiven) - model->BSIM4v4wpdits = 0.0; - if (!model->BSIM4v4wpditsdGiven) - model->BSIM4v4wpditsd = 0.0; - if (!model->BSIM4v4wdeltaGiven) - model->BSIM4v4wdelta = 0.0; - if (!model->BSIM4v4wrdswGiven) - model->BSIM4v4wrdsw = 0.0; - if (!model->BSIM4v4wrdwGiven) - model->BSIM4v4wrdw = 0.0; - if (!model->BSIM4v4wrswGiven) - model->BSIM4v4wrsw = 0.0; - if (!model->BSIM4v4wprwbGiven) - model->BSIM4v4wprwb = 0.0; - if (!model->BSIM4v4wprwgGiven) - model->BSIM4v4wprwg = 0.0; - if (!model->BSIM4v4wprtGiven) - model->BSIM4v4wprt = 0.0; - if (!model->BSIM4v4weta0Given) - model->BSIM4v4weta0 = 0.0; - if (!model->BSIM4v4wetabGiven) - model->BSIM4v4wetab = 0.0; - if (!model->BSIM4v4wpclmGiven) - model->BSIM4v4wpclm = 0.0; - if (!model->BSIM4v4wpdibl1Given) - model->BSIM4v4wpdibl1 = 0.0; - if (!model->BSIM4v4wpdibl2Given) - model->BSIM4v4wpdibl2 = 0.0; - if (!model->BSIM4v4wpdiblbGiven) - model->BSIM4v4wpdiblb = 0.0; - if (!model->BSIM4v4wpscbe1Given) - model->BSIM4v4wpscbe1 = 0.0; - if (!model->BSIM4v4wpscbe2Given) - model->BSIM4v4wpscbe2 = 0.0; - if (!model->BSIM4v4wpvagGiven) - model->BSIM4v4wpvag = 0.0; - if (!model->BSIM4v4wwrGiven) - model->BSIM4v4wwr = 0.0; - if (!model->BSIM4v4wdwgGiven) - model->BSIM4v4wdwg = 0.0; - if (!model->BSIM4v4wdwbGiven) - model->BSIM4v4wdwb = 0.0; - if (!model->BSIM4v4wb0Given) - model->BSIM4v4wb0 = 0.0; - if (!model->BSIM4v4wb1Given) - model->BSIM4v4wb1 = 0.0; - if (!model->BSIM4v4walpha0Given) - model->BSIM4v4walpha0 = 0.0; - if (!model->BSIM4v4walpha1Given) - model->BSIM4v4walpha1 = 0.0; - if (!model->BSIM4v4wbeta0Given) - model->BSIM4v4wbeta0 = 0.0; - if (!model->BSIM4v4wagidlGiven) - model->BSIM4v4wagidl = 0.0; - if (!model->BSIM4v4wbgidlGiven) - model->BSIM4v4wbgidl = 0.0; - if (!model->BSIM4v4wcgidlGiven) - model->BSIM4v4wcgidl = 0.0; - if (!model->BSIM4v4wegidlGiven) - model->BSIM4v4wegidl = 0.0; - if (!model->BSIM4v4waigcGiven) - model->BSIM4v4waigc = 0.0; - if (!model->BSIM4v4wbigcGiven) - model->BSIM4v4wbigc = 0.0; - if (!model->BSIM4v4wcigcGiven) - model->BSIM4v4wcigc = 0.0; - if (!model->BSIM4v4waigsdGiven) - model->BSIM4v4waigsd = 0.0; - if (!model->BSIM4v4wbigsdGiven) - model->BSIM4v4wbigsd = 0.0; - if (!model->BSIM4v4wcigsdGiven) - model->BSIM4v4wcigsd = 0.0; - if (!model->BSIM4v4waigbaccGiven) - model->BSIM4v4waigbacc = 0.0; - if (!model->BSIM4v4wbigbaccGiven) - model->BSIM4v4wbigbacc = 0.0; - if (!model->BSIM4v4wcigbaccGiven) - model->BSIM4v4wcigbacc = 0.0; - if (!model->BSIM4v4waigbinvGiven) - model->BSIM4v4waigbinv = 0.0; - if (!model->BSIM4v4wbigbinvGiven) - model->BSIM4v4wbigbinv = 0.0; - if (!model->BSIM4v4wcigbinvGiven) - model->BSIM4v4wcigbinv = 0.0; - if (!model->BSIM4v4wnigcGiven) - model->BSIM4v4wnigc = 0.0; - if (!model->BSIM4v4wnigbinvGiven) - model->BSIM4v4wnigbinv = 0.0; - if (!model->BSIM4v4wnigbaccGiven) - model->BSIM4v4wnigbacc = 0.0; - if (!model->BSIM4v4wntoxGiven) - model->BSIM4v4wntox = 0.0; - if (!model->BSIM4v4weigbinvGiven) - model->BSIM4v4weigbinv = 0.0; - if (!model->BSIM4v4wpigcdGiven) - model->BSIM4v4wpigcd = 0.0; - if (!model->BSIM4v4wpoxedgeGiven) - model->BSIM4v4wpoxedge = 0.0; - if (!model->BSIM4v4wxrcrg1Given) - model->BSIM4v4wxrcrg1 = 0.0; - if (!model->BSIM4v4wxrcrg2Given) - model->BSIM4v4wxrcrg2 = 0.0; - if (!model->BSIM4v4weuGiven) - model->BSIM4v4weu = 0.0; - if (!model->BSIM4v4wvfbGiven) - model->BSIM4v4wvfb = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: - case BSIM4v21: - break; - case BSIM4v40: - if (!model->BSIM4v4wlambdaGiven) - model->BSIM4v4wlambda = 0.0; - if (!model->BSIM4v4wvtlGiven) - model->BSIM4v4wvtl = 0.0; - if (!model->BSIM4v4wxnGiven) - model->BSIM4v4wxn = 0.0; - if (!model->BSIM4v4wvfbsdoffGiven) - model->BSIM4v4wvfbsdoff = 0.0; - break; - default: break; - } - if (!model->BSIM4v4wcgslGiven) - model->BSIM4v4wcgsl = 0.0; - if (!model->BSIM4v4wcgdlGiven) - model->BSIM4v4wcgdl = 0.0; - if (!model->BSIM4v4wckappasGiven) - model->BSIM4v4wckappas = 0.0; - if (!model->BSIM4v4wckappadGiven) - model->BSIM4v4wckappad = 0.0; - if (!model->BSIM4v4wcfGiven) - model->BSIM4v4wcf = 0.0; - if (!model->BSIM4v4wclcGiven) - model->BSIM4v4wclc = 0.0; - if (!model->BSIM4v4wcleGiven) - model->BSIM4v4wcle = 0.0; - if (!model->BSIM4v4wvfbcvGiven) - model->BSIM4v4wvfbcv = 0.0; - if (!model->BSIM4v4wacdeGiven) - model->BSIM4v4wacde = 0.0; - if (!model->BSIM4v4wmoinGiven) - model->BSIM4v4wmoin = 0.0; - if (!model->BSIM4v4wnoffGiven) - model->BSIM4v4wnoff = 0.0; - if (!model->BSIM4v4wvoffcvGiven) - model->BSIM4v4wvoffcv = 0.0; - - /* Cross-term dependence */ - if (!model->BSIM4v4pcdscGiven) - model->BSIM4v4pcdsc = 0.0; - if (!model->BSIM4v4pcdscbGiven) - model->BSIM4v4pcdscb = 0.0; - if (!model->BSIM4v4pcdscdGiven) - model->BSIM4v4pcdscd = 0.0; - if (!model->BSIM4v4pcitGiven) - model->BSIM4v4pcit = 0.0; - if (!model->BSIM4v4pnfactorGiven) - model->BSIM4v4pnfactor = 0.0; - if (!model->BSIM4v4pxjGiven) - model->BSIM4v4pxj = 0.0; - if (!model->BSIM4v4pvsatGiven) - model->BSIM4v4pvsat = 0.0; - if (!model->BSIM4v4patGiven) - model->BSIM4v4pat = 0.0; - if (!model->BSIM4v4pa0Given) - model->BSIM4v4pa0 = 0.0; - - if (!model->BSIM4v4pagsGiven) - model->BSIM4v4pags = 0.0; - if (!model->BSIM4v4pa1Given) - model->BSIM4v4pa1 = 0.0; - if (!model->BSIM4v4pa2Given) - model->BSIM4v4pa2 = 0.0; - if (!model->BSIM4v4pketaGiven) - model->BSIM4v4pketa = 0.0; - if (!model->BSIM4v4pnsubGiven) - model->BSIM4v4pnsub = 0.0; - if (!model->BSIM4v4pndepGiven) - model->BSIM4v4pndep = 0.0; - if (!model->BSIM4v4pnsdGiven) - model->BSIM4v4pnsd = 0.0; - if (!model->BSIM4v4pphinGiven) - model->BSIM4v4pphin = 0.0; - if (!model->BSIM4v4pngateGiven) - model->BSIM4v4pngate = 0.0; - if (!model->BSIM4v4pvbmGiven) - model->BSIM4v4pvbm = 0.0; - if (!model->BSIM4v4pxtGiven) - model->BSIM4v4pxt = 0.0; - if (!model->BSIM4v4pkt1Given) - model->BSIM4v4pkt1 = 0.0; - if (!model->BSIM4v4pkt1lGiven) - model->BSIM4v4pkt1l = 0.0; - if (!model->BSIM4v4pkt2Given) - model->BSIM4v4pkt2 = 0.0; - if (!model->BSIM4v4pk3Given) - model->BSIM4v4pk3 = 0.0; - if (!model->BSIM4v4pk3bGiven) - model->BSIM4v4pk3b = 0.0; - if (!model->BSIM4v4pw0Given) - model->BSIM4v4pw0 = 0.0; - if (!model->BSIM4v4plpe0Given) - model->BSIM4v4plpe0 = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - if (!model->BSIM4v4plpebGiven) - model->BSIM4v4plpeb = model->BSIM4v4plpe0; - break; - case BSIM4v40: - if (!model->BSIM4v4llpebGiven) - model->BSIM4v4plpeb = 0.0; - break; - default: break; - } - if (!model->BSIM4v4pdvtp0Given) - model->BSIM4v4pdvtp0 = 0.0; - if (!model->BSIM4v4pdvtp1Given) - model->BSIM4v4pdvtp1 = 0.0; - if (!model->BSIM4v4pdvt0Given) - model->BSIM4v4pdvt0 = 0.0; - if (!model->BSIM4v4pdvt1Given) - model->BSIM4v4pdvt1 = 0.0; - if (!model->BSIM4v4pdvt2Given) - model->BSIM4v4pdvt2 = 0.0; - if (!model->BSIM4v4pdvt0wGiven) - model->BSIM4v4pdvt0w = 0.0; - if (!model->BSIM4v4pdvt1wGiven) - model->BSIM4v4pdvt1w = 0.0; - if (!model->BSIM4v4pdvt2wGiven) - model->BSIM4v4pdvt2w = 0.0; - if (!model->BSIM4v4pdroutGiven) - model->BSIM4v4pdrout = 0.0; - if (!model->BSIM4v4pdsubGiven) - model->BSIM4v4pdsub = 0.0; - if (!model->BSIM4v4pvth0Given) - model->BSIM4v4pvth0 = 0.0; - if (!model->BSIM4v4puaGiven) - model->BSIM4v4pua = 0.0; - if (!model->BSIM4v4pua1Given) - model->BSIM4v4pua1 = 0.0; - if (!model->BSIM4v4pubGiven) - model->BSIM4v4pub = 0.0; - if (!model->BSIM4v4pub1Given) - model->BSIM4v4pub1 = 0.0; - if (!model->BSIM4v4pucGiven) - model->BSIM4v4puc = 0.0; - if (!model->BSIM4v4puc1Given) - model->BSIM4v4puc1 = 0.0; - if (!model->BSIM4v4pu0Given) - model->BSIM4v4pu0 = 0.0; - if (!model->BSIM4v4puteGiven) - model->BSIM4v4pute = 0.0; - if (!model->BSIM4v4pvoffGiven) - model->BSIM4v4pvoff = 0.0; - if (!model->BSIM4v4pminvGiven) - model->BSIM4v4pminv = 0.0; - if (!model->BSIM4v4pfproutGiven) - model->BSIM4v4pfprout = 0.0; - if (!model->BSIM4v4ppditsGiven) - model->BSIM4v4ppdits = 0.0; - if (!model->BSIM4v4ppditsdGiven) - model->BSIM4v4ppditsd = 0.0; - if (!model->BSIM4v4pdeltaGiven) - model->BSIM4v4pdelta = 0.0; - if (!model->BSIM4v4prdswGiven) - model->BSIM4v4prdsw = 0.0; - if (!model->BSIM4v4prdwGiven) - model->BSIM4v4prdw = 0.0; - if (!model->BSIM4v4prswGiven) - model->BSIM4v4prsw = 0.0; - if (!model->BSIM4v4pprwbGiven) - model->BSIM4v4pprwb = 0.0; - if (!model->BSIM4v4pprwgGiven) - model->BSIM4v4pprwg = 0.0; - if (!model->BSIM4v4pprtGiven) - model->BSIM4v4pprt = 0.0; - if (!model->BSIM4v4peta0Given) - model->BSIM4v4peta0 = 0.0; - if (!model->BSIM4v4petabGiven) - model->BSIM4v4petab = 0.0; - if (!model->BSIM4v4ppclmGiven) - model->BSIM4v4ppclm = 0.0; - if (!model->BSIM4v4ppdibl1Given) - model->BSIM4v4ppdibl1 = 0.0; - if (!model->BSIM4v4ppdibl2Given) - model->BSIM4v4ppdibl2 = 0.0; - if (!model->BSIM4v4ppdiblbGiven) - model->BSIM4v4ppdiblb = 0.0; - if (!model->BSIM4v4ppscbe1Given) - model->BSIM4v4ppscbe1 = 0.0; - if (!model->BSIM4v4ppscbe2Given) - model->BSIM4v4ppscbe2 = 0.0; - if (!model->BSIM4v4ppvagGiven) - model->BSIM4v4ppvag = 0.0; - if (!model->BSIM4v4pwrGiven) - model->BSIM4v4pwr = 0.0; - if (!model->BSIM4v4pdwgGiven) - model->BSIM4v4pdwg = 0.0; - if (!model->BSIM4v4pdwbGiven) - model->BSIM4v4pdwb = 0.0; - if (!model->BSIM4v4pb0Given) - model->BSIM4v4pb0 = 0.0; - if (!model->BSIM4v4pb1Given) - model->BSIM4v4pb1 = 0.0; - if (!model->BSIM4v4palpha0Given) - model->BSIM4v4palpha0 = 0.0; - if (!model->BSIM4v4palpha1Given) - model->BSIM4v4palpha1 = 0.0; - if (!model->BSIM4v4pbeta0Given) - model->BSIM4v4pbeta0 = 0.0; - if (!model->BSIM4v4pagidlGiven) - model->BSIM4v4pagidl = 0.0; - if (!model->BSIM4v4pbgidlGiven) - model->BSIM4v4pbgidl = 0.0; - if (!model->BSIM4v4pcgidlGiven) - model->BSIM4v4pcgidl = 0.0; - if (!model->BSIM4v4pegidlGiven) - model->BSIM4v4pegidl = 0.0; - if (!model->BSIM4v4paigcGiven) - model->BSIM4v4paigc = 0.0; - if (!model->BSIM4v4pbigcGiven) - model->BSIM4v4pbigc = 0.0; - if (!model->BSIM4v4pcigcGiven) - model->BSIM4v4pcigc = 0.0; - if (!model->BSIM4v4paigsdGiven) - model->BSIM4v4paigsd = 0.0; - if (!model->BSIM4v4pbigsdGiven) - model->BSIM4v4pbigsd = 0.0; - if (!model->BSIM4v4pcigsdGiven) - model->BSIM4v4pcigsd = 0.0; - if (!model->BSIM4v4paigbaccGiven) - model->BSIM4v4paigbacc = 0.0; - if (!model->BSIM4v4pbigbaccGiven) - model->BSIM4v4pbigbacc = 0.0; - if (!model->BSIM4v4pcigbaccGiven) - model->BSIM4v4pcigbacc = 0.0; - if (!model->BSIM4v4paigbinvGiven) - model->BSIM4v4paigbinv = 0.0; - if (!model->BSIM4v4pbigbinvGiven) - model->BSIM4v4pbigbinv = 0.0; - if (!model->BSIM4v4pcigbinvGiven) - model->BSIM4v4pcigbinv = 0.0; - if (!model->BSIM4v4pnigcGiven) - model->BSIM4v4pnigc = 0.0; - if (!model->BSIM4v4pnigbinvGiven) - model->BSIM4v4pnigbinv = 0.0; - if (!model->BSIM4v4pnigbaccGiven) - model->BSIM4v4pnigbacc = 0.0; - if (!model->BSIM4v4pntoxGiven) - model->BSIM4v4pntox = 0.0; - if (!model->BSIM4v4peigbinvGiven) - model->BSIM4v4peigbinv = 0.0; - if (!model->BSIM4v4ppigcdGiven) - model->BSIM4v4ppigcd = 0.0; - if (!model->BSIM4v4ppoxedgeGiven) - model->BSIM4v4ppoxedge = 0.0; - if (!model->BSIM4v4pxrcrg1Given) - model->BSIM4v4pxrcrg1 = 0.0; - if (!model->BSIM4v4pxrcrg2Given) - model->BSIM4v4pxrcrg2 = 0.0; - if (!model->BSIM4v4peuGiven) - model->BSIM4v4peu = 0.0; - if (!model->BSIM4v4pvfbGiven) - model->BSIM4v4pvfb = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if (!model->BSIM4v4plambdaGiven) - model->BSIM4v4plambda = 0.0; - if (!model->BSIM4v4pvtlGiven) - model->BSIM4v4pvtl = 0.0; - if (!model->BSIM4v4pxnGiven) - model->BSIM4v4pxn = 0.0; - break; - default: break; - } - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if (!model->BSIM4v4pvfbsdoffGiven) - model->BSIM4v4pvfbsdoff = 0.0; - break; - default: break; - } - - if (!model->BSIM4v4pcgslGiven) - model->BSIM4v4pcgsl = 0.0; - if (!model->BSIM4v4pcgdlGiven) - model->BSIM4v4pcgdl = 0.0; - if (!model->BSIM4v4pckappasGiven) - model->BSIM4v4pckappas = 0.0; - if (!model->BSIM4v4pckappadGiven) - model->BSIM4v4pckappad = 0.0; - if (!model->BSIM4v4pcfGiven) - model->BSIM4v4pcf = 0.0; - if (!model->BSIM4v4pclcGiven) - model->BSIM4v4pclc = 0.0; - if (!model->BSIM4v4pcleGiven) - model->BSIM4v4pcle = 0.0; - if (!model->BSIM4v4pvfbcvGiven) - model->BSIM4v4pvfbcv = 0.0; - if (!model->BSIM4v4pacdeGiven) - model->BSIM4v4pacde = 0.0; - if (!model->BSIM4v4pmoinGiven) - model->BSIM4v4pmoin = 0.0; - if (!model->BSIM4v4pnoffGiven) - model->BSIM4v4pnoff = 0.0; - if (!model->BSIM4v4pvoffcvGiven) - model->BSIM4v4pvoffcv = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if (!model->BSIM4v4gamma1Given) - model->BSIM4v4gamma1 = 0.0; - if (!model->BSIM4v4lgamma1Given) - model->BSIM4v4lgamma1 = 0.0; - if (!model->BSIM4v4wgamma1Given) - model->BSIM4v4wgamma1 = 0.0; - if (!model->BSIM4v4pgamma1Given) - model->BSIM4v4pgamma1 = 0.0; - if (!model->BSIM4v4gamma2Given) - model->BSIM4v4gamma2 = 0.0; - if (!model->BSIM4v4lgamma2Given) - model->BSIM4v4lgamma2 = 0.0; - if (!model->BSIM4v4wgamma2Given) - model->BSIM4v4wgamma2 = 0.0; - if (!model->BSIM4v4pgamma2Given) - model->BSIM4v4pgamma2 = 0.0; - if (!model->BSIM4v4vbxGiven) - model->BSIM4v4vbx = 0.0; - if (!model->BSIM4v4lvbxGiven) - model->BSIM4v4lvbx = 0.0; - if (!model->BSIM4v4wvbxGiven) - model->BSIM4v4wvbx = 0.0; - if (!model->BSIM4v4pvbxGiven) - model->BSIM4v4pvbx = 0.0; - break; - default: break; - } - - /* unit degree celcius */ - if (!model->BSIM4v4tnomGiven) - model->BSIM4v4tnom = ckt->CKTnomTemp; - if (!model->BSIM4v4LintGiven) - model->BSIM4v4Lint = 0.0; - if (!model->BSIM4v4LlGiven) - model->BSIM4v4Ll = 0.0; - if (!model->BSIM4v4LlcGiven) - model->BSIM4v4Llc = model->BSIM4v4Ll; - if (!model->BSIM4v4LlnGiven) - model->BSIM4v4Lln = 1.0; - if (!model->BSIM4v4LwGiven) - model->BSIM4v4Lw = 0.0; - if (!model->BSIM4v4LwcGiven) - model->BSIM4v4Lwc = model->BSIM4v4Lw; - if (!model->BSIM4v4LwnGiven) - model->BSIM4v4Lwn = 1.0; - if (!model->BSIM4v4LwlGiven) - model->BSIM4v4Lwl = 0.0; - if (!model->BSIM4v4LwlcGiven) - model->BSIM4v4Lwlc = model->BSIM4v4Lwl; - if (!model->BSIM4v4LminGiven) - model->BSIM4v4Lmin = 0.0; - if (!model->BSIM4v4LmaxGiven) - model->BSIM4v4Lmax = 1.0; - if (!model->BSIM4v4WintGiven) - model->BSIM4v4Wint = 0.0; - if (!model->BSIM4v4WlGiven) - model->BSIM4v4Wl = 0.0; - if (!model->BSIM4v4WlcGiven) - model->BSIM4v4Wlc = model->BSIM4v4Wl; - if (!model->BSIM4v4WlnGiven) - model->BSIM4v4Wln = 1.0; - if (!model->BSIM4v4WwGiven) - model->BSIM4v4Ww = 0.0; - if (!model->BSIM4v4WwcGiven) - model->BSIM4v4Wwc = model->BSIM4v4Ww; - if (!model->BSIM4v4WwnGiven) - model->BSIM4v4Wwn = 1.0; - if (!model->BSIM4v4WwlGiven) - model->BSIM4v4Wwl = 0.0; - if (!model->BSIM4v4WwlcGiven) - model->BSIM4v4Wwlc = model->BSIM4v4Wwl; - if (!model->BSIM4v4WminGiven) - model->BSIM4v4Wmin = 0.0; - if (!model->BSIM4v4WmaxGiven) - model->BSIM4v4Wmax = 1.0; - if (!model->BSIM4v4dwcGiven) - model->BSIM4v4dwc = model->BSIM4v4Wint; - if (!model->BSIM4v4dlcGiven) - model->BSIM4v4dlc = model->BSIM4v4Lint; - if (!model->BSIM4v4xlGiven) - model->BSIM4v4xl = 0.0; - if (!model->BSIM4v4xwGiven) - model->BSIM4v4xw = 0.0; - if (!model->BSIM4v4dlcigGiven) - model->BSIM4v4dlcig = model->BSIM4v4Lint; - if (!model->BSIM4v4dwjGiven) - model->BSIM4v4dwj = model->BSIM4v4dwc; - if (!model->BSIM4v4cfGiven) - model->BSIM4v4cf = 2.0 * model->BSIM4v4epsrox * EPS0 / PI - * log(1.0 + 0.4e-6 / model->BSIM4v4toxe); - - if (!model->BSIM4v4xpartGiven) - model->BSIM4v4xpart = 0.0; - if (!model->BSIM4v4sheetResistanceGiven) - model->BSIM4v4sheetResistance = 0.0; - - if (!model->BSIM4v4SunitAreaJctCapGiven) - model->BSIM4v4SunitAreaJctCap = 5.0E-4; - if (!model->BSIM4v4DunitAreaJctCapGiven) - model->BSIM4v4DunitAreaJctCap = model->BSIM4v4SunitAreaJctCap; - if (!model->BSIM4v4SunitLengthSidewallJctCapGiven) - model->BSIM4v4SunitLengthSidewallJctCap = 5.0E-10; - if (!model->BSIM4v4DunitLengthSidewallJctCapGiven) - model->BSIM4v4DunitLengthSidewallJctCap = model->BSIM4v4SunitLengthSidewallJctCap; - if (!model->BSIM4v4SunitLengthGateSidewallJctCapGiven) - model->BSIM4v4SunitLengthGateSidewallJctCap = model->BSIM4v4SunitLengthSidewallJctCap ; - if (!model->BSIM4v4DunitLengthGateSidewallJctCapGiven) - model->BSIM4v4DunitLengthGateSidewallJctCap = model->BSIM4v4SunitLengthGateSidewallJctCap; - if (!model->BSIM4v4SjctSatCurDensityGiven) - model->BSIM4v4SjctSatCurDensity = 1.0E-4; - if (!model->BSIM4v4DjctSatCurDensityGiven) - model->BSIM4v4DjctSatCurDensity = model->BSIM4v4SjctSatCurDensity; - if (!model->BSIM4v4SjctSidewallSatCurDensityGiven) - model->BSIM4v4SjctSidewallSatCurDensity = 0.0; - if (!model->BSIM4v4DjctSidewallSatCurDensityGiven) - model->BSIM4v4DjctSidewallSatCurDensity = model->BSIM4v4SjctSidewallSatCurDensity; - if (!model->BSIM4v4SjctGateSidewallSatCurDensityGiven) - model->BSIM4v4SjctGateSidewallSatCurDensity = 0.0; - if (!model->BSIM4v4DjctGateSidewallSatCurDensityGiven) - model->BSIM4v4DjctGateSidewallSatCurDensity = model->BSIM4v4SjctGateSidewallSatCurDensity; - if (!model->BSIM4v4SbulkJctPotentialGiven) - model->BSIM4v4SbulkJctPotential = 1.0; - if (!model->BSIM4v4DbulkJctPotentialGiven) - model->BSIM4v4DbulkJctPotential = model->BSIM4v4SbulkJctPotential; - if (!model->BSIM4v4SsidewallJctPotentialGiven) - model->BSIM4v4SsidewallJctPotential = 1.0; - if (!model->BSIM4v4DsidewallJctPotentialGiven) - model->BSIM4v4DsidewallJctPotential = model->BSIM4v4SsidewallJctPotential; - if (!model->BSIM4v4SGatesidewallJctPotentialGiven) - model->BSIM4v4SGatesidewallJctPotential = model->BSIM4v4SsidewallJctPotential; - if (!model->BSIM4v4DGatesidewallJctPotentialGiven) - model->BSIM4v4DGatesidewallJctPotential = model->BSIM4v4SGatesidewallJctPotential; - if (!model->BSIM4v4SbulkJctBotGradingCoeffGiven) - model->BSIM4v4SbulkJctBotGradingCoeff = 0.5; - if (!model->BSIM4v4DbulkJctBotGradingCoeffGiven) - model->BSIM4v4DbulkJctBotGradingCoeff = model->BSIM4v4SbulkJctBotGradingCoeff; - if (!model->BSIM4v4SbulkJctSideGradingCoeffGiven) - model->BSIM4v4SbulkJctSideGradingCoeff = 0.33; - if (!model->BSIM4v4DbulkJctSideGradingCoeffGiven) - model->BSIM4v4DbulkJctSideGradingCoeff = model->BSIM4v4SbulkJctSideGradingCoeff; - if (!model->BSIM4v4SbulkJctGateSideGradingCoeffGiven) - model->BSIM4v4SbulkJctGateSideGradingCoeff = model->BSIM4v4SbulkJctSideGradingCoeff; - if (!model->BSIM4v4DbulkJctGateSideGradingCoeffGiven) - model->BSIM4v4DbulkJctGateSideGradingCoeff = model->BSIM4v4SbulkJctGateSideGradingCoeff; - if (!model->BSIM4v4SjctEmissionCoeffGiven) - model->BSIM4v4SjctEmissionCoeff = 1.0; - if (!model->BSIM4v4DjctEmissionCoeffGiven) - model->BSIM4v4DjctEmissionCoeff = model->BSIM4v4SjctEmissionCoeff; - if (!model->BSIM4v4SjctTempExponentGiven) - model->BSIM4v4SjctTempExponent = 3.0; - if (!model->BSIM4v4DjctTempExponentGiven) - model->BSIM4v4DjctTempExponent = model->BSIM4v4SjctTempExponent; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - if (!model->BSIM4v4jtssGiven) - model->BSIM4v4jtss = 0.0; - if (!model->BSIM4v4jtsdGiven) - model->BSIM4v4jtsd = model->BSIM4v4jtss; - if (!model->BSIM4v4jtsswsGiven) - model->BSIM4v4jtssws = 0.0; - if (!model->BSIM4v4jtsswdGiven) - model->BSIM4v4jtsswd = model->BSIM4v4jtssws; - if (!model->BSIM4v4jtsswgsGiven) - model->BSIM4v4jtsswgs = 0.0; - if (!model->BSIM4v4jtsswgdGiven) - model->BSIM4v4jtsswgd = model->BSIM4v4jtsswgs; - if (!model->BSIM4v4njtsGiven) - model->BSIM4v4njts = 20.0; - if (!model->BSIM4v4njtsswGiven) - model->BSIM4v4njtssw = 20.0; - if (!model->BSIM4v4njtsswgGiven) - model->BSIM4v4njtsswg = 20.0; - if (!model->BSIM4v4xtssGiven) - model->BSIM4v4xtss = 0.02; - if (!model->BSIM4v4xtsdGiven) - model->BSIM4v4xtsd = model->BSIM4v4xtss; - if (!model->BSIM4v4xtsswsGiven) - model->BSIM4v4xtssws = 0.02; - if (!model->BSIM4v4jtsswdGiven) - model->BSIM4v4xtsswd = model->BSIM4v4xtssws; - if (!model->BSIM4v4xtsswgsGiven) - model->BSIM4v4xtsswgs = 0.02; - if (!model->BSIM4v4xtsswgdGiven) - model->BSIM4v4xtsswgd = model->BSIM4v4xtsswgs; - if (!model->BSIM4v4tnjtsGiven) - model->BSIM4v4tnjts = 0.0; - if (!model->BSIM4v4tnjtsswGiven) - model->BSIM4v4tnjtssw = 0.0; - if (!model->BSIM4v4tnjtsswgGiven) - model->BSIM4v4tnjtsswg = 0.0; - if (!model->BSIM4v4vtssGiven) - model->BSIM4v4vtss = 10.0; - if (!model->BSIM4v4vtsdGiven) - model->BSIM4v4vtsd = model->BSIM4v4vtss; - if (!model->BSIM4v4vtsswsGiven) - model->BSIM4v4vtssws = 10.0; - if (!model->BSIM4v4vtsswdGiven) - model->BSIM4v4vtsswd = model->BSIM4v4vtssws; - if (!model->BSIM4v4vtsswgsGiven) - model->BSIM4v4vtsswgs = 10.0; - if (!model->BSIM4v4vtsswgdGiven) - model->BSIM4v4vtsswgd = model->BSIM4v4vtsswgs; - break; - default: break; - } - if (!model->BSIM4v4oxideTrapDensityAGiven) - { if (model->BSIM4v4type == NMOS) - model->BSIM4v4oxideTrapDensityA = 6.25e41; - else - model->BSIM4v4oxideTrapDensityA= 6.188e40; - } - if (!model->BSIM4v4oxideTrapDensityBGiven) - { if (model->BSIM4v4type == NMOS) - model->BSIM4v4oxideTrapDensityB = 3.125e26; - else - model->BSIM4v4oxideTrapDensityB = 1.5e25; - } - if (!model->BSIM4v4oxideTrapDensityCGiven) - model->BSIM4v4oxideTrapDensityC = 8.75e9; - if (!model->BSIM4v4emGiven) - model->BSIM4v4em = 4.1e7; /* V/m */ - if (!model->BSIM4v4efGiven) - model->BSIM4v4ef = 1.0; - if (!model->BSIM4v4afGiven) - model->BSIM4v4af = 1.0; - if (!model->BSIM4v4kfGiven) - model->BSIM4v4kf = 0.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - /* stress effect */ - if (!model->BSIM4v4sarefGiven) - model->BSIM4v4saref = 1e-6; /* m */ - if (!model->BSIM4v4sbrefGiven) - model->BSIM4v4sbref = 1e-6; /* m */ - if (!model->BSIM4v4wlodGiven) - model->BSIM4v4wlod = 0; /* m */ - if (!model->BSIM4v4ku0Given) - model->BSIM4v4ku0 = 0; /* 1/m */ - if (!model->BSIM4v4kvsatGiven) - model->BSIM4v4kvsat = 0; - if (!model->BSIM4v4kvth0Given) /* m */ - model->BSIM4v4kvth0 = 0; - if (!model->BSIM4v4tku0Given) - model->BSIM4v4tku0 = 0; - if (!model->BSIM4v4llodku0Given) - model->BSIM4v4llodku0 = 0; - if (!model->BSIM4v4wlodku0Given) - model->BSIM4v4wlodku0 = 0; - if (!model->BSIM4v4llodvthGiven) - model->BSIM4v4llodvth = 0; - if (!model->BSIM4v4wlodvthGiven) - model->BSIM4v4wlodvth = 0; - if (!model->BSIM4v4lku0Given) - model->BSIM4v4lku0 = 0; - if (!model->BSIM4v4wku0Given) - model->BSIM4v4wku0 = 0; - if (!model->BSIM4v4pku0Given) - model->BSIM4v4pku0 = 0; - if (!model->BSIM4v4lkvth0Given) - model->BSIM4v4lkvth0 = 0; - if (!model->BSIM4v4wkvth0Given) - model->BSIM4v4wkvth0 = 0; - if (!model->BSIM4v4pkvth0Given) - model->BSIM4v4pkvth0 = 0; - if (!model->BSIM4v4stk2Given) - model->BSIM4v4stk2 = 0; - if (!model->BSIM4v4lodk2Given) - model->BSIM4v4lodk2 = 1.0; - if (!model->BSIM4v4steta0Given) - model->BSIM4v4steta0 = 0; - if (!model->BSIM4v4lodeta0Given) - model->BSIM4v4lodeta0 = 1.0; - break; - default: break; - } - DMCGeff = model->BSIM4v4dmcg - model->BSIM4v4dmcgt; - DMCIeff = model->BSIM4v4dmci; - DMDGeff = model->BSIM4v4dmdg - model->BSIM4v4dmcgt; - - /* - * End processing models and begin to loop - * through all the instances of the model - */ - - for (here = model->BSIM4v4instances; here != NULL ; - here=here->BSIM4v4nextInstance) - { - /* allocate a chunk of the state vector */ - here->BSIM4v4states = *states; - *states += BSIM4v4numStates; - - /* perform the parameter defaulting */ - if (!here->BSIM4v4lGiven) - here->BSIM4v4l = 5.0e-6; - if (!here->BSIM4v4wGiven) - here->BSIM4v4w = 5.0e-6; - if (!here->BSIM4v4mGiven) - here->BSIM4v4m = 1.0; - if (!here->BSIM4v4nfGiven) - here->BSIM4v4nf = 1.0; - if (!here->BSIM4v4minGiven) - here->BSIM4v4min = 0; /* integer */ - if (!here->BSIM4v4icVDSGiven) - here->BSIM4v4icVDS = 0.0; - if (!here->BSIM4v4icVGSGiven) - here->BSIM4v4icVGS = 0.0; - if (!here->BSIM4v4icVBSGiven) - here->BSIM4v4icVBS = 0.0; - if (!here->BSIM4v4drainAreaGiven) - here->BSIM4v4drainArea = 0.0; - if (!here->BSIM4v4drainPerimeterGiven) - here->BSIM4v4drainPerimeter = 0.0; - if (!here->BSIM4v4drainSquaresGiven) - here->BSIM4v4drainSquares = 1.0; - if (!here->BSIM4v4sourceAreaGiven) - here->BSIM4v4sourceArea = 0.0; - if (!here->BSIM4v4sourcePerimeterGiven) - here->BSIM4v4sourcePerimeter = 0.0; - if (!here->BSIM4v4sourceSquaresGiven) - here->BSIM4v4sourceSquares = 1.0; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if (!here->BSIM4v4saGiven) - here->BSIM4v4sa = 0.0; - if (!here->BSIM4v4sbGiven) - here->BSIM4v4sb = 0.0; - if (!here->BSIM4v4sdGiven) - here->BSIM4v4sd = 0.0; - break; - default: break; - } - if (!here->BSIM4v4rbdbGiven) - here->BSIM4v4rbdb = model->BSIM4v4rbdb; /* in ohm */ - if (!here->BSIM4v4rbsbGiven) - here->BSIM4v4rbsb = model->BSIM4v4rbsb; - if (!here->BSIM4v4rbpbGiven) - here->BSIM4v4rbpb = model->BSIM4v4rbpb; - if (!here->BSIM4v4rbpsGiven) - here->BSIM4v4rbps = model->BSIM4v4rbps; - if (!here->BSIM4v4rbpdGiven) - here->BSIM4v4rbpd = model->BSIM4v4rbpd; - - - /* Process instance model selectors, some - * may override their global counterparts - */ - if (!here->BSIM4v4rbodyModGiven) - here->BSIM4v4rbodyMod = model->BSIM4v4rbodyMod; - else if ((here->BSIM4v4rbodyMod != 0) && (here->BSIM4v4rbodyMod != 1)) - { here->BSIM4v4rbodyMod = model->BSIM4v4rbodyMod; - printf("Warning: rbodyMod has been set to its global value %d.\n", - model->BSIM4v4rbodyMod); - } - - if (!here->BSIM4v4rgateModGiven) - here->BSIM4v4rgateMod = model->BSIM4v4rgateMod; - else if ((here->BSIM4v4rgateMod != 0) && (here->BSIM4v4rgateMod != 1) - && (here->BSIM4v4rgateMod != 2) && (here->BSIM4v4rgateMod != 3)) - { here->BSIM4v4rgateMod = model->BSIM4v4rgateMod; - printf("Warning: rgateMod has been set to its global value %d.\n", - model->BSIM4v4rgateMod); - } - - if (!here->BSIM4v4geoModGiven) - here->BSIM4v4geoMod = model->BSIM4v4geoMod; - if (!here->BSIM4v4rgeoModGiven) - here->BSIM4v4rgeoMod = 0; - if (!here->BSIM4v4trnqsModGiven) - here->BSIM4v4trnqsMod = model->BSIM4v4trnqsMod; - else if ((here->BSIM4v4trnqsMod != 0) && (here->BSIM4v4trnqsMod != 1)) - { here->BSIM4v4trnqsMod = model->BSIM4v4trnqsMod; - printf("Warning: trnqsMod has been set to its global value %d.\n", - model->BSIM4v4trnqsMod); - } - - if (!here->BSIM4v4acnqsModGiven) - here->BSIM4v4acnqsMod = model->BSIM4v4acnqsMod; - else if ((here->BSIM4v4acnqsMod != 0) && (here->BSIM4v4acnqsMod != 1)) - { here->BSIM4v4acnqsMod = model->BSIM4v4acnqsMod; - printf("Warning: acnqsMod has been set to its global value %d.\n", - model->BSIM4v4acnqsMod); - } - - /* process drain series resistance */ - createNode = 0; - if ( (model->BSIM4v4rdsMod != 0) - || (model->BSIM4v4tnoiMod != 0 && noiseAnalGiven)) - { - createNode = 1; - } else if (model->BSIM4v4sheetResistance > 0) - { - if (here->BSIM4v4drainSquaresGiven - && here->BSIM4v4drainSquares > 0) - { - createNode = 1; - } else if (!here->BSIM4v4drainSquaresGiven - && (here->BSIM4v4rgeoMod != 0)) - { - BSIM4v4RdseffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, - here->BSIM4v4rgeoMod, here->BSIM4v4min, - here->BSIM4v4w, model->BSIM4v4sheetResistance, - DMCGeff, DMCIeff, DMDGeff, 0, &Rtot); - if(Rtot > 0) - createNode = 1; - } - } - if ( createNode != 0 ) - { if (here->BSIM4v4dNodePrime == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"drain"); - if(error) return(error); - here->BSIM4v4dNodePrime = tmp->number; - } - } - else - { here->BSIM4v4dNodePrime = here->BSIM4v4dNode; - } - - /* process source series resistance */ - createNode = 0; - if ( (model->BSIM4v4rdsMod != 0) - || (model->BSIM4v4tnoiMod != 0 && noiseAnalGiven)) - { - createNode = 1; - } else if (model->BSIM4v4sheetResistance > 0) - { - if (here->BSIM4v4sourceSquaresGiven - && here->BSIM4v4sourceSquares > 0) - { - createNode = 1; - } else if (!here->BSIM4v4sourceSquaresGiven - && (here->BSIM4v4rgeoMod != 0)) - { - BSIM4v4RdseffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, - here->BSIM4v4rgeoMod, here->BSIM4v4min, - here->BSIM4v4w, model->BSIM4v4sheetResistance, - DMCGeff, DMCIeff, DMDGeff, 1, &Rtot); - if(Rtot > 0) - createNode = 1; - } - } - if ( createNode != 0 ) - { if (here->BSIM4v4sNodePrime == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"source"); - if(error) return(error); - here->BSIM4v4sNodePrime = tmp->number; - } - } - else - here->BSIM4v4sNodePrime = here->BSIM4v4sNode; - - if (here->BSIM4v4rgateMod > 0) - { if (here->BSIM4v4gNodePrime == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"gate"); - if(error) return(error); - here->BSIM4v4gNodePrime = tmp->number; - } - } - else - here->BSIM4v4gNodePrime = here->BSIM4v4gNodeExt; - - if (here->BSIM4v4rgateMod == 3) - { if (here->BSIM4v4gNodeMid == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"midgate"); - if(error) return(error); - here->BSIM4v4gNodeMid = tmp->number; - } - } - else - here->BSIM4v4gNodeMid = here->BSIM4v4gNodeExt; - - - /* internal body nodes for body resistance model */ - if (here->BSIM4v4rbodyMod) - { if (here->BSIM4v4dbNode == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"dbody"); - if(error) return(error); - here->BSIM4v4dbNode = tmp->number; - } - if (here->BSIM4v4bNodePrime == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"body"); - if(error) return(error); - here->BSIM4v4bNodePrime = tmp->number; - } - if (here->BSIM4v4sbNode == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"sbody"); - if(error) return(error); - here->BSIM4v4sbNode = tmp->number; - } - } - else - here->BSIM4v4dbNode = here->BSIM4v4bNodePrime = here->BSIM4v4sbNode - = here->BSIM4v4bNode; - - /* NQS node */ - if (here->BSIM4v4trnqsMod) - { if (here->BSIM4v4qNode == 0) - { error = CKTmkVolt(ckt,&tmp,here->BSIM4v4name,"charge"); - if(error) return(error); - here->BSIM4v4qNode = tmp->number; - } - } - else - here->BSIM4v4qNode = 0; - -/* set Sparse Matrix Pointers - * macro to make elements with built-in out-of-memory test */ -#define TSTALLOC(ptr,first,second) \ -do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ - return(E_NOMEM);\ -} } while(0) - - TSTALLOC(BSIM4v4DPbpPtr, BSIM4v4dNodePrime, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4GPbpPtr, BSIM4v4gNodePrime, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4SPbpPtr, BSIM4v4sNodePrime, BSIM4v4bNodePrime); - - TSTALLOC(BSIM4v4BPdpPtr, BSIM4v4bNodePrime, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4BPgpPtr, BSIM4v4bNodePrime, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4BPspPtr, BSIM4v4bNodePrime, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4BPbpPtr, BSIM4v4bNodePrime, BSIM4v4bNodePrime); - - TSTALLOC(BSIM4v4DdPtr, BSIM4v4dNode, BSIM4v4dNode); - TSTALLOC(BSIM4v4GPgpPtr, BSIM4v4gNodePrime, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4SsPtr, BSIM4v4sNode, BSIM4v4sNode); - TSTALLOC(BSIM4v4DPdpPtr, BSIM4v4dNodePrime, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4SPspPtr, BSIM4v4sNodePrime, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4DdpPtr, BSIM4v4dNode, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4GPdpPtr, BSIM4v4gNodePrime, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4GPspPtr, BSIM4v4gNodePrime, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4SspPtr, BSIM4v4sNode, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4DPspPtr, BSIM4v4dNodePrime, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4DPdPtr, BSIM4v4dNodePrime, BSIM4v4dNode); - TSTALLOC(BSIM4v4DPgpPtr, BSIM4v4dNodePrime, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4SPgpPtr, BSIM4v4sNodePrime, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4SPsPtr, BSIM4v4sNodePrime, BSIM4v4sNode); - TSTALLOC(BSIM4v4SPdpPtr, BSIM4v4sNodePrime, BSIM4v4dNodePrime); - - TSTALLOC(BSIM4v4QqPtr, BSIM4v4qNode, BSIM4v4qNode); - TSTALLOC(BSIM4v4QbpPtr, BSIM4v4qNode, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4QdpPtr, BSIM4v4qNode, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4QspPtr, BSIM4v4qNode, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4QgpPtr, BSIM4v4qNode, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4DPqPtr, BSIM4v4dNodePrime, BSIM4v4qNode); - TSTALLOC(BSIM4v4SPqPtr, BSIM4v4sNodePrime, BSIM4v4qNode); - TSTALLOC(BSIM4v4GPqPtr, BSIM4v4gNodePrime, BSIM4v4qNode); - - if (here->BSIM4v4rgateMod != 0) - { TSTALLOC(BSIM4v4GEgePtr, BSIM4v4gNodeExt, BSIM4v4gNodeExt); - TSTALLOC(BSIM4v4GEgpPtr, BSIM4v4gNodeExt, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4GPgePtr, BSIM4v4gNodePrime, BSIM4v4gNodeExt); - TSTALLOC(BSIM4v4GEdpPtr, BSIM4v4gNodeExt, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4GEspPtr, BSIM4v4gNodeExt, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4GEbpPtr, BSIM4v4gNodeExt, BSIM4v4bNodePrime); - - TSTALLOC(BSIM4v4GMdpPtr, BSIM4v4gNodeMid, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4GMgpPtr, BSIM4v4gNodeMid, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4GMgmPtr, BSIM4v4gNodeMid, BSIM4v4gNodeMid); - TSTALLOC(BSIM4v4GMgePtr, BSIM4v4gNodeMid, BSIM4v4gNodeExt); - TSTALLOC(BSIM4v4GMspPtr, BSIM4v4gNodeMid, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4GMbpPtr, BSIM4v4gNodeMid, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4DPgmPtr, BSIM4v4dNodePrime, BSIM4v4gNodeMid); - TSTALLOC(BSIM4v4GPgmPtr, BSIM4v4gNodePrime, BSIM4v4gNodeMid); - TSTALLOC(BSIM4v4GEgmPtr, BSIM4v4gNodeExt, BSIM4v4gNodeMid); - TSTALLOC(BSIM4v4SPgmPtr, BSIM4v4sNodePrime, BSIM4v4gNodeMid); - TSTALLOC(BSIM4v4BPgmPtr, BSIM4v4bNodePrime, BSIM4v4gNodeMid); - } - - if (here->BSIM4v4rbodyMod) - { TSTALLOC(BSIM4v4DPdbPtr, BSIM4v4dNodePrime, BSIM4v4dbNode); - TSTALLOC(BSIM4v4SPsbPtr, BSIM4v4sNodePrime, BSIM4v4sbNode); - - TSTALLOC(BSIM4v4DBdpPtr, BSIM4v4dbNode, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4DBdbPtr, BSIM4v4dbNode, BSIM4v4dbNode); - TSTALLOC(BSIM4v4DBbpPtr, BSIM4v4dbNode, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4DBbPtr, BSIM4v4dbNode, BSIM4v4bNode); - - TSTALLOC(BSIM4v4BPdbPtr, BSIM4v4bNodePrime, BSIM4v4dbNode); - TSTALLOC(BSIM4v4BPbPtr, BSIM4v4bNodePrime, BSIM4v4bNode); - TSTALLOC(BSIM4v4BPsbPtr, BSIM4v4bNodePrime, BSIM4v4sbNode); - - TSTALLOC(BSIM4v4SBspPtr, BSIM4v4sbNode, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4SBbpPtr, BSIM4v4sbNode, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4SBbPtr, BSIM4v4sbNode, BSIM4v4bNode); - TSTALLOC(BSIM4v4SBsbPtr, BSIM4v4sbNode, BSIM4v4sbNode); - - TSTALLOC(BSIM4v4BdbPtr, BSIM4v4bNode, BSIM4v4dbNode); - TSTALLOC(BSIM4v4BbpPtr, BSIM4v4bNode, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4BsbPtr, BSIM4v4bNode, BSIM4v4sbNode); - TSTALLOC(BSIM4v4BbPtr, BSIM4v4bNode, BSIM4v4bNode); - } - - if (model->BSIM4v4rdsMod) - { TSTALLOC(BSIM4v4DgpPtr, BSIM4v4dNode, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4DspPtr, BSIM4v4dNode, BSIM4v4sNodePrime); - TSTALLOC(BSIM4v4DbpPtr, BSIM4v4dNode, BSIM4v4bNodePrime); - TSTALLOC(BSIM4v4SdpPtr, BSIM4v4sNode, BSIM4v4dNodePrime); - TSTALLOC(BSIM4v4SgpPtr, BSIM4v4sNode, BSIM4v4gNodePrime); - TSTALLOC(BSIM4v4SbpPtr, BSIM4v4sNode, BSIM4v4bNodePrime); - } - } - } - return(OK); -} - -int -BSIM4v4unsetup( - GENmodel *inModel, - CKTcircuit *ckt) -{ -#ifndef HAS_BATCHSIM - BSIM4v4model *model; - BSIM4v4instance *here; - - for (model = (BSIM4v4model *)inModel; model != NULL; - model = model->BSIM4v4nextModel) - { - for (here = model->BSIM4v4instances; here != NULL; - here=here->BSIM4v4nextInstance) - { - if (here->BSIM4v4dNodePrime - && here->BSIM4v4dNodePrime != here->BSIM4v4dNode) - { - CKTdltNNum(ckt, here->BSIM4v4dNodePrime); - here->BSIM4v4dNodePrime = 0; - } - if (here->BSIM4v4sNodePrime - && here->BSIM4v4sNodePrime != here->BSIM4v4sNode) - { - CKTdltNNum(ckt, here->BSIM4v4sNodePrime); - here->BSIM4v4sNodePrime = 0; - } - } - } -#endif - return OK; -} diff --git a/src/spicelib/devices/bsim4v4/b4v4temp.c b/src/spicelib/devices/bsim4v4/b4v4temp.c deleted file mode 100644 index cf671c553..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4temp.c +++ /dev/null @@ -1,1826 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ -/* ngspice multirevision code extension covering 4.2.1 & 4.3.0 & 4.4.0 */ -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4temp.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - * Modified by Xuemei Xi, 04/06/2001. - * Modified by Xuemei Xi, 10/05/2001. - * Modified by Xuemei Xi, 11/15/2002. - * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 03/04/2004. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/smpdefs.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/const.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - -#define Kb 1.3806226e-23 -#define KboQ 8.617087e-5 -#define EPS0 8.85418e-12 -#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 -#define DELTA 1.0E-9 -#define DEXP(A,B) { \ - if (A > EXP_THRESHOLD) { \ - B = MAX_EXP*(1.0+(A)-EXP_THRESHOLD); \ - } else if (A < -EXP_THRESHOLD) { \ - B = MIN_EXP; \ - } else { \ - B = exp(A); \ - } \ - } - - -static int -BSIM4v4DioIjthVjmEval( -double Nvtm, double Ijth, double Isb, double XExpBV, -double *Vjm) -{ -double Tb, Tc, EVjmovNv; - - Tc = XExpBV; - Tb = 1.0 + Ijth / Isb - Tc; - EVjmovNv = 0.5 * (Tb + sqrt(Tb * Tb + 4.0 * Tc)); - *Vjm = Nvtm * log(EVjmovNv); - -return 0; -} - - -int -BSIM4v4temp( -GENmodel *inModel, -CKTcircuit *ckt) -{ -BSIM4v4model *model = (BSIM4v4model*) inModel; -BSIM4v4instance *here; -struct bsim4SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam=NULL; -double tmp, tmp1, tmp2, tmp3, Eg, Eg0, ni; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Lnew=0.0, Wnew; -double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0=0.0, Tnom; -double dumPs, dumPd, dumAs, dumAd, PowWeffWr; -double DMCGeff, DMCIeff, DMDGeff; -double Nvtms, Nvtmd, SourceSatCurrent, DrainSatCurrent; -double T10; -double Inv_saref, Inv_sbref, Inv_sa, Inv_sb, rho, Ldrn, dvth0_lod; -double W_tmp, Inv_ODeff, OD_offset, dk2_lod, deta0_lod; - -int Size_Not_Found, i; - - /* loop through all the BSIM4v4 device models */ - for (; model != NULL; model = model->BSIM4v4nextModel) - { Temp = ckt->CKTtemp; - if (model->BSIM4v4SbulkJctPotential < 0.1) - { model->BSIM4v4SbulkJctPotential = 0.1; - fprintf(stderr, "Given pbs is less than 0.1. Pbs is set to 0.1.\n"); - } - if (model->BSIM4v4SsidewallJctPotential < 0.1) - { model->BSIM4v4SsidewallJctPotential = 0.1; - fprintf(stderr, "Given pbsws is less than 0.1. Pbsws is set to 0.1.\n"); - } - if (model->BSIM4v4SGatesidewallJctPotential < 0.1) - { model->BSIM4v4SGatesidewallJctPotential = 0.1; - fprintf(stderr, "Given pbswgs is less than 0.1. Pbswgs is set to 0.1.\n"); - } - - if (model->BSIM4v4DbulkJctPotential < 0.1) - { model->BSIM4v4DbulkJctPotential = 0.1; - fprintf(stderr, "Given pbd is less than 0.1. Pbd is set to 0.1.\n"); - } - if (model->BSIM4v4DsidewallJctPotential < 0.1) - { model->BSIM4v4DsidewallJctPotential = 0.1; - fprintf(stderr, "Given pbswd is less than 0.1. Pbswd is set to 0.1.\n"); - } - if (model->BSIM4v4DGatesidewallJctPotential < 0.1) - { model->BSIM4v4DGatesidewallJctPotential = 0.1; - fprintf(stderr, "Given pbswgd is less than 0.1. Pbswgd is set to 0.1.\n"); - } - - if ((model->BSIM4v4toxeGiven) && (model->BSIM4v4toxpGiven) && (model->BSIM4v4dtoxGiven) - && (model->BSIM4v4toxe != (model->BSIM4v4toxp + model->BSIM4v4dtox))) - printf("Warning: toxe, toxp and dtox all given and toxe != toxp + dtox; dtox ignored.\n"); - else if ((model->BSIM4v4toxeGiven) && (!model->BSIM4v4toxpGiven)) - model->BSIM4v4toxp = model->BSIM4v4toxe - model->BSIM4v4dtox; - else if ((!model->BSIM4v4toxeGiven) && (model->BSIM4v4toxpGiven)) - model->BSIM4v4toxe = model->BSIM4v4toxp + model->BSIM4v4dtox; - - model->BSIM4v4coxe = model->BSIM4v4epsrox * EPS0 / model->BSIM4v4toxe; - model->BSIM4v4coxp = model->BSIM4v4epsrox * EPS0 / model->BSIM4v4toxp; - - if (!model->BSIM4v4cgdoGiven) - { if (model->BSIM4v4dlcGiven && (model->BSIM4v4dlc > 0.0)) - model->BSIM4v4cgdo = model->BSIM4v4dlc * model->BSIM4v4coxe - - model->BSIM4v4cgdl ; - else - model->BSIM4v4cgdo = 0.6 * model->BSIM4v4xj * model->BSIM4v4coxe; - } - if (!model->BSIM4v4cgsoGiven) - { if (model->BSIM4v4dlcGiven && (model->BSIM4v4dlc > 0.0)) - model->BSIM4v4cgso = model->BSIM4v4dlc * model->BSIM4v4coxe - - model->BSIM4v4cgsl ; - else - model->BSIM4v4cgso = 0.6 * model->BSIM4v4xj * model->BSIM4v4coxe; - } - if (!model->BSIM4v4cgboGiven) - model->BSIM4v4cgbo = 2.0 * model->BSIM4v4dwc * model->BSIM4v4coxe; - model->pSizeDependParamKnot = NULL; - pLastKnot = NULL; - - Tnom = model->BSIM4v4tnom; - TRatio = Temp / Tnom; - - model->BSIM4v4vcrit = CONSTvt0 * log(CONSTvt0 / (CONSTroot2 * 1.0e-14)); - model->BSIM4v4factor1 = sqrt(EPSSI / (model->BSIM4v4epsrox * EPS0) - * model->BSIM4v4toxe); - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - Vtm0 = KboQ * Tnom; - break; - case BSIM4v40: - Vtm0 = model->BSIM4v4vtm0 = KboQ * Tnom; - break; - default: break; - } - 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->BSIM4v4vtm = KboQ * Temp; - Eg = 1.16 - 7.02e-4 * Temp * Temp / (Temp + 1108.0); - if (Temp != Tnom) - { T0 = Eg0 / Vtm0 - Eg / model->BSIM4v4vtm; - T1 = log(Temp / Tnom); - T2 = T0 + model->BSIM4v4SjctTempExponent * T1; - T3 = exp(T2 / model->BSIM4v4SjctEmissionCoeff); - model->BSIM4v4SjctTempSatCurDensity = model->BSIM4v4SjctSatCurDensity - * T3; - model->BSIM4v4SjctSidewallTempSatCurDensity - = model->BSIM4v4SjctSidewallSatCurDensity * T3; - model->BSIM4v4SjctGateSidewallTempSatCurDensity - = model->BSIM4v4SjctGateSidewallSatCurDensity * T3; - - T2 = T0 + model->BSIM4v4DjctTempExponent * T1; - T3 = exp(T2 / model->BSIM4v4DjctEmissionCoeff); - model->BSIM4v4DjctTempSatCurDensity = model->BSIM4v4DjctSatCurDensity - * T3; - model->BSIM4v4DjctSidewallTempSatCurDensity - = model->BSIM4v4DjctSidewallSatCurDensity * T3; - model->BSIM4v4DjctGateSidewallTempSatCurDensity - = model->BSIM4v4DjctGateSidewallSatCurDensity * T3; - } - else - { model->BSIM4v4SjctTempSatCurDensity = model->BSIM4v4SjctSatCurDensity; - model->BSIM4v4SjctSidewallTempSatCurDensity - = model->BSIM4v4SjctSidewallSatCurDensity; - model->BSIM4v4SjctGateSidewallTempSatCurDensity - = model->BSIM4v4SjctGateSidewallSatCurDensity; - model->BSIM4v4DjctTempSatCurDensity = model->BSIM4v4DjctSatCurDensity; - model->BSIM4v4DjctSidewallTempSatCurDensity - = model->BSIM4v4DjctSidewallSatCurDensity; - model->BSIM4v4DjctGateSidewallTempSatCurDensity - = model->BSIM4v4DjctGateSidewallSatCurDensity; - } - - if (model->BSIM4v4SjctTempSatCurDensity < 0.0) - model->BSIM4v4SjctTempSatCurDensity = 0.0; - if (model->BSIM4v4SjctSidewallTempSatCurDensity < 0.0) - model->BSIM4v4SjctSidewallTempSatCurDensity = 0.0; - if (model->BSIM4v4SjctGateSidewallTempSatCurDensity < 0.0) - model->BSIM4v4SjctGateSidewallTempSatCurDensity = 0.0; - if (model->BSIM4v4DjctTempSatCurDensity < 0.0) - model->BSIM4v4DjctTempSatCurDensity = 0.0; - if (model->BSIM4v4DjctSidewallTempSatCurDensity < 0.0) - model->BSIM4v4DjctSidewallTempSatCurDensity = 0.0; - if (model->BSIM4v4DjctGateSidewallTempSatCurDensity < 0.0) - model->BSIM4v4DjctGateSidewallTempSatCurDensity = 0.0; - - /* Temperature dependence of D/B and S/B diode capacitance begins */ - delTemp = ckt->CKTtemp - model->BSIM4v4tnom; - T0 = model->BSIM4v4tcj * delTemp; - if (T0 >= -1.0) - { model->BSIM4v4SunitAreaTempJctCap = model->BSIM4v4SunitAreaJctCap *(1.0 + T0); /*bug_fix -JX */ - model->BSIM4v4DunitAreaTempJctCap = model->BSIM4v4DunitAreaJctCap *(1.0 + T0); - } - else - { if (model->BSIM4v4SunitAreaJctCap > 0.0) - { model->BSIM4v4SunitAreaTempJctCap = 0.0; - fprintf(stderr, "Temperature effect has caused cjs to be negative. Cjs is clamped to zero.\n"); - } - if (model->BSIM4v4DunitAreaJctCap > 0.0) - { model->BSIM4v4DunitAreaTempJctCap = 0.0; - fprintf(stderr, "Temperature effect has caused cjd to be negative. Cjd is clamped to zero.\n"); - } - } - T0 = model->BSIM4v4tcjsw * delTemp; - if (T0 >= -1.0) - { model->BSIM4v4SunitLengthSidewallTempJctCap = model->BSIM4v4SunitLengthSidewallJctCap *(1.0 + T0); - model->BSIM4v4DunitLengthSidewallTempJctCap = model->BSIM4v4DunitLengthSidewallJctCap *(1.0 + T0); - } - else - { if (model->BSIM4v4SunitLengthSidewallJctCap > 0.0) - { model->BSIM4v4SunitLengthSidewallTempJctCap = 0.0; - fprintf(stderr, "Temperature effect has caused cjsws to be negative. Cjsws is clamped to zero.\n"); - } - if (model->BSIM4v4DunitLengthSidewallJctCap > 0.0) - { model->BSIM4v4DunitLengthSidewallTempJctCap = 0.0; - fprintf(stderr, "Temperature effect has caused cjswd to be negative. Cjswd is clamped to zero.\n"); - } - } - T0 = model->BSIM4v4tcjswg * delTemp; - if (T0 >= -1.0) - { model->BSIM4v4SunitLengthGateSidewallTempJctCap = model->BSIM4v4SunitLengthGateSidewallJctCap *(1.0 + T0); - model->BSIM4v4DunitLengthGateSidewallTempJctCap = model->BSIM4v4DunitLengthGateSidewallJctCap *(1.0 + T0); - } - else - { if (model->BSIM4v4SunitLengthGateSidewallJctCap > 0.0) - { model->BSIM4v4SunitLengthGateSidewallTempJctCap = 0.0; - fprintf(stderr, "Temperature effect has caused cjswgs to be negative. Cjswgs is clamped to zero.\n"); - } - if (model->BSIM4v4DunitLengthGateSidewallJctCap > 0.0) - { model->BSIM4v4DunitLengthGateSidewallTempJctCap = 0.0; - fprintf(stderr, "Temperature effect has caused cjswgd to be negative. Cjswgd is clamped to zero.\n"); - } - } - - model->BSIM4v4PhiBS = model->BSIM4v4SbulkJctPotential - - model->BSIM4v4tpb * delTemp; - if (model->BSIM4v4PhiBS < 0.01) - { model->BSIM4v4PhiBS = 0.01; - fprintf(stderr, "Temperature effect has caused pbs to be less than 0.01. Pbs is clamped to 0.01.\n"); - } - model->BSIM4v4PhiBD = model->BSIM4v4DbulkJctPotential - - model->BSIM4v4tpb * delTemp; - if (model->BSIM4v4PhiBD < 0.01) - { model->BSIM4v4PhiBD = 0.01; - fprintf(stderr, "Temperature effect has caused pbd to be less than 0.01. Pbd is clamped to 0.01.\n"); - } - - model->BSIM4v4PhiBSWS = model->BSIM4v4SsidewallJctPotential - - model->BSIM4v4tpbsw * delTemp; - if (model->BSIM4v4PhiBSWS <= 0.01) - { model->BSIM4v4PhiBSWS = 0.01; - fprintf(stderr, "Temperature effect has caused pbsws to be less than 0.01. Pbsws is clamped to 0.01.\n"); - } - model->BSIM4v4PhiBSWD = model->BSIM4v4DsidewallJctPotential - - model->BSIM4v4tpbsw * delTemp; - if (model->BSIM4v4PhiBSWD <= 0.01) - { model->BSIM4v4PhiBSWD = 0.01; - fprintf(stderr, "Temperature effect has caused pbswd to be less than 0.01. Pbswd is clamped to 0.01.\n"); - } - - model->BSIM4v4PhiBSWGS = model->BSIM4v4SGatesidewallJctPotential - - model->BSIM4v4tpbswg * delTemp; - if (model->BSIM4v4PhiBSWGS <= 0.01) - { model->BSIM4v4PhiBSWGS = 0.01; - fprintf(stderr, "Temperature effect has caused pbswgs to be less than 0.01. Pbswgs is clamped to 0.01.\n"); - } - model->BSIM4v4PhiBSWGD = model->BSIM4v4DGatesidewallJctPotential - - model->BSIM4v4tpbswg * delTemp; - if (model->BSIM4v4PhiBSWGD <= 0.01) - { model->BSIM4v4PhiBSWGD = 0.01; - fprintf(stderr, "Temperature effect has caused pbswgd to be less than 0.01. Pbswgd is clamped to 0.01.\n"); - } /* End of junction capacitance */ - - - if (model->BSIM4v4ijthdfwd <= 0.0) - { model->BSIM4v4ijthdfwd = 0.1; - fprintf(stderr, "Ijthdfwd reset to %g.\n", model->BSIM4v4ijthdfwd); - } - if (model->BSIM4v4ijthsfwd <= 0.0) - { model->BSIM4v4ijthsfwd = 0.1; - fprintf(stderr, "Ijthsfwd reset to %g.\n", model->BSIM4v4ijthsfwd); - } - if (model->BSIM4v4ijthdrev <= 0.0) - { model->BSIM4v4ijthdrev = 0.1; - fprintf(stderr, "Ijthdrev reset to %g.\n", model->BSIM4v4ijthdrev); - } - if (model->BSIM4v4ijthsrev <= 0.0) - { model->BSIM4v4ijthsrev = 0.1; - fprintf(stderr, "Ijthsrev reset to %g.\n", model->BSIM4v4ijthsrev); - } - - if ((model->BSIM4v4xjbvd <= 0.0) && (model->BSIM4v4dioMod == 2)) - { model->BSIM4v4xjbvd = 1.0; - fprintf(stderr, "Xjbvd reset to %g.\n", model->BSIM4v4xjbvd); - } - else if ((model->BSIM4v4xjbvd < 0.0) && (model->BSIM4v4dioMod == 0)) - { model->BSIM4v4xjbvd = 1.0; - fprintf(stderr, "Xjbvd reset to %g.\n", model->BSIM4v4xjbvd); - } - - if (model->BSIM4v4bvd <= 0.0) - { model->BSIM4v4bvd = 10.0; - fprintf(stderr, "BVD reset to %g.\n", model->BSIM4v4bvd); - } - - if ((model->BSIM4v4xjbvs <= 0.0) && (model->BSIM4v4dioMod == 2)) - { model->BSIM4v4xjbvs = 1.0; - fprintf(stderr, "Xjbvs reset to %g.\n", model->BSIM4v4xjbvs); - } - else if ((model->BSIM4v4xjbvs < 0.0) && (model->BSIM4v4dioMod == 0)) - { model->BSIM4v4xjbvs = 1.0; - fprintf(stderr, "Xjbvs reset to %g.\n", model->BSIM4v4xjbvs); - } - - if (model->BSIM4v4bvs <= 0.0) - { model->BSIM4v4bvs = 10.0; - fprintf(stderr, "BVS reset to %g.\n", model->BSIM4v4bvs); - } - - - /* loop through all the instances of the model */ - for (here = model->BSIM4v4instances; here != NULL; - here = here->BSIM4v4nextInstance) - { - pSizeDependParamKnot = model->pSizeDependParamKnot; - Size_Not_Found = 1; - while ((pSizeDependParamKnot != NULL) && Size_Not_Found) - { if ((here->BSIM4v4l == pSizeDependParamKnot->Length) - && (here->BSIM4v4w == pSizeDependParamKnot->Width) - && (here->BSIM4v4nf == pSizeDependParamKnot->NFinger)) - { Size_Not_Found = 0; - here->pParam = pSizeDependParamKnot; - pParam = here->pParam; /*bug-fix */ - } - else - { pLastKnot = pSizeDependParamKnot; - pSizeDependParamKnot = pSizeDependParamKnot->pNext; - } - } - - /* stress effect */ - Ldrn = here->BSIM4v4l; - - if (Size_Not_Found) - { pParam = TMALLOC(struct bsim4SizeDependParam, 1); - if (pLastKnot == NULL) - model->pSizeDependParamKnot = pParam; - else - pLastKnot->pNext = pParam; - pParam->pNext = NULL; - here->pParam = pParam; - - pParam->Length = here->BSIM4v4l; - pParam->Width = here->BSIM4v4w; - pParam->NFinger = here->BSIM4v4nf; - Lnew = here->BSIM4v4l + model->BSIM4v4xl ; - Wnew = here->BSIM4v4w / here->BSIM4v4nf + model->BSIM4v4xw; - - T0 = pow(Lnew, model->BSIM4v4Lln); - T1 = pow(Wnew, model->BSIM4v4Lwn); - tmp1 = model->BSIM4v4Ll / T0 + model->BSIM4v4Lw / T1 - + model->BSIM4v4Lwl / (T0 * T1); - pParam->BSIM4v4dl = model->BSIM4v4Lint + tmp1; - tmp2 = model->BSIM4v4Llc / T0 + model->BSIM4v4Lwc / T1 - + model->BSIM4v4Lwlc / (T0 * T1); - pParam->BSIM4v4dlc = model->BSIM4v4dlc + tmp2; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - pParam->BSIM4v4dlcig = model->BSIM4v4dlcig + tmp2; - break; - case BSIM4v40: - pParam->BSIM4v4dlcig = model->BSIM4v4dlcig; - break; - default: break; - } - - T2 = pow(Lnew, model->BSIM4v4Wln); - T3 = pow(Wnew, model->BSIM4v4Wwn); - tmp1 = model->BSIM4v4Wl / T2 + model->BSIM4v4Ww / T3 - + model->BSIM4v4Wwl / (T2 * T3); - pParam->BSIM4v4dw = model->BSIM4v4Wint + tmp1; - tmp2 = model->BSIM4v4Wlc / T2 + model->BSIM4v4Wwc / T3 - + model->BSIM4v4Wwlc / (T2 * T3); - pParam->BSIM4v4dwc = model->BSIM4v4dwc + tmp2; - pParam->BSIM4v4dwj = model->BSIM4v4dwj + tmp2; - - pParam->BSIM4v4leff = Lnew - 2.0 * pParam->BSIM4v4dl; - if (pParam->BSIM4v4leff <= 0.0) - { - SPfrontEnd->IFerrorf (ERR_FATAL, - "BSIM4v4: mosfet %s, model %s: Effective channel length <= 0", - model->BSIM4v4modName, here->BSIM4v4name); - return(E_BADPARM); - } - - pParam->BSIM4v4weff = Wnew - 2.0 * pParam->BSIM4v4dw; - if (pParam->BSIM4v4weff <= 0.0) - { - SPfrontEnd->IFerrorf (ERR_FATAL, - "BSIM4v4: mosfet %s, model %s: Effective channel width <= 0", - model->BSIM4v4modName, here->BSIM4v4name); - return(E_BADPARM); - } - - pParam->BSIM4v4leffCV = Lnew - 2.0 * pParam->BSIM4v4dlc; - if (pParam->BSIM4v4leffCV <= 0.0) - { - SPfrontEnd->IFerrorf (ERR_FATAL, - "BSIM4v4: mosfet %s, model %s: Effective channel length for C-V <= 0", - model->BSIM4v4modName, here->BSIM4v4name); - return(E_BADPARM); - } - - pParam->BSIM4v4weffCV = Wnew - 2.0 * pParam->BSIM4v4dwc; - if (pParam->BSIM4v4weffCV <= 0.0) - { - SPfrontEnd->IFerrorf (ERR_FATAL, - "BSIM4v4: mosfet %s, model %s: Effective channel width for C-V <= 0", - model->BSIM4v4modName, here->BSIM4v4name); - return(E_BADPARM); - } - - pParam->BSIM4v4weffCJ = Wnew - 2.0 * pParam->BSIM4v4dwj; - if (pParam->BSIM4v4weffCJ <= 0.0) - { - SPfrontEnd->IFerrorf (ERR_FATAL, - "BSIM4v4: mosfet %s, model %s: Effective channel width for S/D junctions <= 0", - model->BSIM4v4modName, here->BSIM4v4name); - return(E_BADPARM); - } - - - if (model->BSIM4v4binUnit == 1) - { Inv_L = 1.0e-6 / pParam->BSIM4v4leff; - Inv_W = 1.0e-6 / pParam->BSIM4v4weff; - Inv_LW = 1.0e-12 / (pParam->BSIM4v4leff - * pParam->BSIM4v4weff); - } - else - { Inv_L = 1.0 / pParam->BSIM4v4leff; - Inv_W = 1.0 / pParam->BSIM4v4weff; - Inv_LW = 1.0 / (pParam->BSIM4v4leff - * pParam->BSIM4v4weff); - } - pParam->BSIM4v4cdsc = model->BSIM4v4cdsc - + model->BSIM4v4lcdsc * Inv_L - + model->BSIM4v4wcdsc * Inv_W - + model->BSIM4v4pcdsc * Inv_LW; - pParam->BSIM4v4cdscb = model->BSIM4v4cdscb - + model->BSIM4v4lcdscb * Inv_L - + model->BSIM4v4wcdscb * Inv_W - + model->BSIM4v4pcdscb * Inv_LW; - - pParam->BSIM4v4cdscd = model->BSIM4v4cdscd - + model->BSIM4v4lcdscd * Inv_L - + model->BSIM4v4wcdscd * Inv_W - + model->BSIM4v4pcdscd * Inv_LW; - - pParam->BSIM4v4cit = model->BSIM4v4cit - + model->BSIM4v4lcit * Inv_L - + model->BSIM4v4wcit * Inv_W - + model->BSIM4v4pcit * Inv_LW; - pParam->BSIM4v4nfactor = model->BSIM4v4nfactor - + model->BSIM4v4lnfactor * Inv_L - + model->BSIM4v4wnfactor * Inv_W - + model->BSIM4v4pnfactor * Inv_LW; - pParam->BSIM4v4xj = model->BSIM4v4xj - + model->BSIM4v4lxj * Inv_L - + model->BSIM4v4wxj * Inv_W - + model->BSIM4v4pxj * Inv_LW; - pParam->BSIM4v4vsat = model->BSIM4v4vsat - + model->BSIM4v4lvsat * Inv_L - + model->BSIM4v4wvsat * Inv_W - + model->BSIM4v4pvsat * Inv_LW; - pParam->BSIM4v4at = model->BSIM4v4at - + model->BSIM4v4lat * Inv_L - + model->BSIM4v4wat * Inv_W - + model->BSIM4v4pat * Inv_LW; - pParam->BSIM4v4a0 = model->BSIM4v4a0 - + model->BSIM4v4la0 * Inv_L - + model->BSIM4v4wa0 * Inv_W - + model->BSIM4v4pa0 * Inv_LW; - - pParam->BSIM4v4ags = model->BSIM4v4ags - + model->BSIM4v4lags * Inv_L - + model->BSIM4v4wags * Inv_W - + model->BSIM4v4pags * Inv_LW; - - pParam->BSIM4v4a1 = model->BSIM4v4a1 - + model->BSIM4v4la1 * Inv_L - + model->BSIM4v4wa1 * Inv_W - + model->BSIM4v4pa1 * Inv_LW; - pParam->BSIM4v4a2 = model->BSIM4v4a2 - + model->BSIM4v4la2 * Inv_L - + model->BSIM4v4wa2 * Inv_W - + model->BSIM4v4pa2 * Inv_LW; - pParam->BSIM4v4keta = model->BSIM4v4keta - + model->BSIM4v4lketa * Inv_L - + model->BSIM4v4wketa * Inv_W - + model->BSIM4v4pketa * Inv_LW; - pParam->BSIM4v4nsub = model->BSIM4v4nsub - + model->BSIM4v4lnsub * Inv_L - + model->BSIM4v4wnsub * Inv_W - + model->BSIM4v4pnsub * Inv_LW; - pParam->BSIM4v4ndep = model->BSIM4v4ndep - + model->BSIM4v4lndep * Inv_L - + model->BSIM4v4wndep * Inv_W - + model->BSIM4v4pndep * Inv_LW; - pParam->BSIM4v4nsd = model->BSIM4v4nsd - + model->BSIM4v4lnsd * Inv_L - + model->BSIM4v4wnsd * Inv_W - + model->BSIM4v4pnsd * Inv_LW; - pParam->BSIM4v4phin = model->BSIM4v4phin - + model->BSIM4v4lphin * Inv_L - + model->BSIM4v4wphin * Inv_W - + model->BSIM4v4pphin * Inv_LW; - pParam->BSIM4v4ngate = model->BSIM4v4ngate - + model->BSIM4v4lngate * Inv_L - + model->BSIM4v4wngate * Inv_W - + model->BSIM4v4pngate * Inv_LW; - pParam->BSIM4v4gamma1 = model->BSIM4v4gamma1 - + model->BSIM4v4lgamma1 * Inv_L - + model->BSIM4v4wgamma1 * Inv_W - + model->BSIM4v4pgamma1 * Inv_LW; - pParam->BSIM4v4gamma2 = model->BSIM4v4gamma2 - + model->BSIM4v4lgamma2 * Inv_L - + model->BSIM4v4wgamma2 * Inv_W - + model->BSIM4v4pgamma2 * Inv_LW; - pParam->BSIM4v4vbx = model->BSIM4v4vbx - + model->BSIM4v4lvbx * Inv_L - + model->BSIM4v4wvbx * Inv_W - + model->BSIM4v4pvbx * Inv_LW; - pParam->BSIM4v4vbm = model->BSIM4v4vbm - + model->BSIM4v4lvbm * Inv_L - + model->BSIM4v4wvbm * Inv_W - + model->BSIM4v4pvbm * Inv_LW; - pParam->BSIM4v4xt = model->BSIM4v4xt - + model->BSIM4v4lxt * Inv_L - + model->BSIM4v4wxt * Inv_W - + model->BSIM4v4pxt * Inv_LW; - pParam->BSIM4v4vfb = model->BSIM4v4vfb - + model->BSIM4v4lvfb * Inv_L - + model->BSIM4v4wvfb * Inv_W - + model->BSIM4v4pvfb * Inv_LW; - pParam->BSIM4v4k1 = model->BSIM4v4k1 - + model->BSIM4v4lk1 * Inv_L - + model->BSIM4v4wk1 * Inv_W - + model->BSIM4v4pk1 * Inv_LW; - pParam->BSIM4v4kt1 = model->BSIM4v4kt1 - + model->BSIM4v4lkt1 * Inv_L - + model->BSIM4v4wkt1 * Inv_W - + model->BSIM4v4pkt1 * Inv_LW; - pParam->BSIM4v4kt1l = model->BSIM4v4kt1l - + model->BSIM4v4lkt1l * Inv_L - + model->BSIM4v4wkt1l * Inv_W - + model->BSIM4v4pkt1l * Inv_LW; - pParam->BSIM4v4k2 = model->BSIM4v4k2 - + model->BSIM4v4lk2 * Inv_L - + model->BSIM4v4wk2 * Inv_W - + model->BSIM4v4pk2 * Inv_LW; - pParam->BSIM4v4kt2 = model->BSIM4v4kt2 - + model->BSIM4v4lkt2 * Inv_L - + model->BSIM4v4wkt2 * Inv_W - + model->BSIM4v4pkt2 * Inv_LW; - pParam->BSIM4v4k3 = model->BSIM4v4k3 - + model->BSIM4v4lk3 * Inv_L - + model->BSIM4v4wk3 * Inv_W - + model->BSIM4v4pk3 * Inv_LW; - pParam->BSIM4v4k3b = model->BSIM4v4k3b - + model->BSIM4v4lk3b * Inv_L - + model->BSIM4v4wk3b * Inv_W - + model->BSIM4v4pk3b * Inv_LW; - pParam->BSIM4v4w0 = model->BSIM4v4w0 - + model->BSIM4v4lw0 * Inv_L - + model->BSIM4v4ww0 * Inv_W - + model->BSIM4v4pw0 * Inv_LW; - pParam->BSIM4v4lpe0 = model->BSIM4v4lpe0 - + model->BSIM4v4llpe0 * Inv_L - + model->BSIM4v4wlpe0 * Inv_W - + model->BSIM4v4plpe0 * Inv_LW; - pParam->BSIM4v4lpeb = model->BSIM4v4lpeb - + model->BSIM4v4llpeb * Inv_L - + model->BSIM4v4wlpeb * Inv_W - + model->BSIM4v4plpeb * Inv_LW; - pParam->BSIM4v4dvtp0 = model->BSIM4v4dvtp0 - + model->BSIM4v4ldvtp0 * Inv_L - + model->BSIM4v4wdvtp0 * Inv_W - + model->BSIM4v4pdvtp0 * Inv_LW; - pParam->BSIM4v4dvtp1 = model->BSIM4v4dvtp1 - + model->BSIM4v4ldvtp1 * Inv_L - + model->BSIM4v4wdvtp1 * Inv_W - + model->BSIM4v4pdvtp1 * Inv_LW; - pParam->BSIM4v4dvt0 = model->BSIM4v4dvt0 - + model->BSIM4v4ldvt0 * Inv_L - + model->BSIM4v4wdvt0 * Inv_W - + model->BSIM4v4pdvt0 * Inv_LW; - pParam->BSIM4v4dvt1 = model->BSIM4v4dvt1 - + model->BSIM4v4ldvt1 * Inv_L - + model->BSIM4v4wdvt1 * Inv_W - + model->BSIM4v4pdvt1 * Inv_LW; - pParam->BSIM4v4dvt2 = model->BSIM4v4dvt2 - + model->BSIM4v4ldvt2 * Inv_L - + model->BSIM4v4wdvt2 * Inv_W - + model->BSIM4v4pdvt2 * Inv_LW; - pParam->BSIM4v4dvt0w = model->BSIM4v4dvt0w - + model->BSIM4v4ldvt0w * Inv_L - + model->BSIM4v4wdvt0w * Inv_W - + model->BSIM4v4pdvt0w * Inv_LW; - pParam->BSIM4v4dvt1w = model->BSIM4v4dvt1w - + model->BSIM4v4ldvt1w * Inv_L - + model->BSIM4v4wdvt1w * Inv_W - + model->BSIM4v4pdvt1w * Inv_LW; - pParam->BSIM4v4dvt2w = model->BSIM4v4dvt2w - + model->BSIM4v4ldvt2w * Inv_L - + model->BSIM4v4wdvt2w * Inv_W - + model->BSIM4v4pdvt2w * Inv_LW; - pParam->BSIM4v4drout = model->BSIM4v4drout - + model->BSIM4v4ldrout * Inv_L - + model->BSIM4v4wdrout * Inv_W - + model->BSIM4v4pdrout * Inv_LW; - pParam->BSIM4v4dsub = model->BSIM4v4dsub - + model->BSIM4v4ldsub * Inv_L - + model->BSIM4v4wdsub * Inv_W - + model->BSIM4v4pdsub * Inv_LW; - pParam->BSIM4v4vth0 = model->BSIM4v4vth0 - + model->BSIM4v4lvth0 * Inv_L - + model->BSIM4v4wvth0 * Inv_W - + model->BSIM4v4pvth0 * Inv_LW; - pParam->BSIM4v4ua = model->BSIM4v4ua - + model->BSIM4v4lua * Inv_L - + model->BSIM4v4wua * Inv_W - + model->BSIM4v4pua * Inv_LW; - pParam->BSIM4v4ua1 = model->BSIM4v4ua1 - + model->BSIM4v4lua1 * Inv_L - + model->BSIM4v4wua1 * Inv_W - + model->BSIM4v4pua1 * Inv_LW; - pParam->BSIM4v4ub = model->BSIM4v4ub - + model->BSIM4v4lub * Inv_L - + model->BSIM4v4wub * Inv_W - + model->BSIM4v4pub * Inv_LW; - pParam->BSIM4v4ub1 = model->BSIM4v4ub1 - + model->BSIM4v4lub1 * Inv_L - + model->BSIM4v4wub1 * Inv_W - + model->BSIM4v4pub1 * Inv_LW; - pParam->BSIM4v4uc = model->BSIM4v4uc - + model->BSIM4v4luc * Inv_L - + model->BSIM4v4wuc * Inv_W - + model->BSIM4v4puc * Inv_LW; - pParam->BSIM4v4uc1 = model->BSIM4v4uc1 - + model->BSIM4v4luc1 * Inv_L - + model->BSIM4v4wuc1 * Inv_W - + model->BSIM4v4puc1 * Inv_LW; - pParam->BSIM4v4eu = model->BSIM4v4eu - + model->BSIM4v4leu * Inv_L - + model->BSIM4v4weu * Inv_W - + model->BSIM4v4peu * Inv_LW; - pParam->BSIM4v4u0 = model->BSIM4v4u0 - + model->BSIM4v4lu0 * Inv_L - + model->BSIM4v4wu0 * Inv_W - + model->BSIM4v4pu0 * Inv_LW; - pParam->BSIM4v4ute = model->BSIM4v4ute - + model->BSIM4v4lute * Inv_L - + model->BSIM4v4wute * Inv_W - + model->BSIM4v4pute * Inv_LW; - pParam->BSIM4v4voff = model->BSIM4v4voff - + model->BSIM4v4lvoff * Inv_L - + model->BSIM4v4wvoff * Inv_W - + model->BSIM4v4pvoff * Inv_LW; - pParam->BSIM4v4minv = model->BSIM4v4minv - + model->BSIM4v4lminv * Inv_L - + model->BSIM4v4wminv * Inv_W - + model->BSIM4v4pminv * Inv_LW; - pParam->BSIM4v4fprout = model->BSIM4v4fprout - + model->BSIM4v4lfprout * Inv_L - + model->BSIM4v4wfprout * Inv_W - + model->BSIM4v4pfprout * Inv_LW; - pParam->BSIM4v4pdits = model->BSIM4v4pdits - + model->BSIM4v4lpdits * Inv_L - + model->BSIM4v4wpdits * Inv_W - + model->BSIM4v4ppdits * Inv_LW; - pParam->BSIM4v4pditsd = model->BSIM4v4pditsd - + model->BSIM4v4lpditsd * Inv_L - + model->BSIM4v4wpditsd * Inv_W - + model->BSIM4v4ppditsd * Inv_LW; - pParam->BSIM4v4delta = model->BSIM4v4delta - + model->BSIM4v4ldelta * Inv_L - + model->BSIM4v4wdelta * Inv_W - + model->BSIM4v4pdelta * Inv_LW; - pParam->BSIM4v4rdsw = model->BSIM4v4rdsw - + model->BSIM4v4lrdsw * Inv_L - + model->BSIM4v4wrdsw * Inv_W - + model->BSIM4v4prdsw * Inv_LW; - pParam->BSIM4v4rdw = model->BSIM4v4rdw - + model->BSIM4v4lrdw * Inv_L - + model->BSIM4v4wrdw * Inv_W - + model->BSIM4v4prdw * Inv_LW; - pParam->BSIM4v4rsw = model->BSIM4v4rsw - + model->BSIM4v4lrsw * Inv_L - + model->BSIM4v4wrsw * Inv_W - + model->BSIM4v4prsw * Inv_LW; - pParam->BSIM4v4prwg = model->BSIM4v4prwg - + model->BSIM4v4lprwg * Inv_L - + model->BSIM4v4wprwg * Inv_W - + model->BSIM4v4pprwg * Inv_LW; - pParam->BSIM4v4prwb = model->BSIM4v4prwb - + model->BSIM4v4lprwb * Inv_L - + model->BSIM4v4wprwb * Inv_W - + model->BSIM4v4pprwb * Inv_LW; - pParam->BSIM4v4prt = model->BSIM4v4prt - + model->BSIM4v4lprt * Inv_L - + model->BSIM4v4wprt * Inv_W - + model->BSIM4v4pprt * Inv_LW; - pParam->BSIM4v4eta0 = model->BSIM4v4eta0 - + model->BSIM4v4leta0 * Inv_L - + model->BSIM4v4weta0 * Inv_W - + model->BSIM4v4peta0 * Inv_LW; - pParam->BSIM4v4etab = model->BSIM4v4etab - + model->BSIM4v4letab * Inv_L - + model->BSIM4v4wetab * Inv_W - + model->BSIM4v4petab * Inv_LW; - pParam->BSIM4v4pclm = model->BSIM4v4pclm - + model->BSIM4v4lpclm * Inv_L - + model->BSIM4v4wpclm * Inv_W - + model->BSIM4v4ppclm * Inv_LW; - pParam->BSIM4v4pdibl1 = model->BSIM4v4pdibl1 - + model->BSIM4v4lpdibl1 * Inv_L - + model->BSIM4v4wpdibl1 * Inv_W - + model->BSIM4v4ppdibl1 * Inv_LW; - pParam->BSIM4v4pdibl2 = model->BSIM4v4pdibl2 - + model->BSIM4v4lpdibl2 * Inv_L - + model->BSIM4v4wpdibl2 * Inv_W - + model->BSIM4v4ppdibl2 * Inv_LW; - pParam->BSIM4v4pdiblb = model->BSIM4v4pdiblb - + model->BSIM4v4lpdiblb * Inv_L - + model->BSIM4v4wpdiblb * Inv_W - + model->BSIM4v4ppdiblb * Inv_LW; - pParam->BSIM4v4pscbe1 = model->BSIM4v4pscbe1 - + model->BSIM4v4lpscbe1 * Inv_L - + model->BSIM4v4wpscbe1 * Inv_W - + model->BSIM4v4ppscbe1 * Inv_LW; - pParam->BSIM4v4pscbe2 = model->BSIM4v4pscbe2 - + model->BSIM4v4lpscbe2 * Inv_L - + model->BSIM4v4wpscbe2 * Inv_W - + model->BSIM4v4ppscbe2 * Inv_LW; - pParam->BSIM4v4pvag = model->BSIM4v4pvag - + model->BSIM4v4lpvag * Inv_L - + model->BSIM4v4wpvag * Inv_W - + model->BSIM4v4ppvag * Inv_LW; - pParam->BSIM4v4wr = model->BSIM4v4wr - + model->BSIM4v4lwr * Inv_L - + model->BSIM4v4wwr * Inv_W - + model->BSIM4v4pwr * Inv_LW; - pParam->BSIM4v4dwg = model->BSIM4v4dwg - + model->BSIM4v4ldwg * Inv_L - + model->BSIM4v4wdwg * Inv_W - + model->BSIM4v4pdwg * Inv_LW; - pParam->BSIM4v4dwb = model->BSIM4v4dwb - + model->BSIM4v4ldwb * Inv_L - + model->BSIM4v4wdwb * Inv_W - + model->BSIM4v4pdwb * Inv_LW; - pParam->BSIM4v4b0 = model->BSIM4v4b0 - + model->BSIM4v4lb0 * Inv_L - + model->BSIM4v4wb0 * Inv_W - + model->BSIM4v4pb0 * Inv_LW; - pParam->BSIM4v4b1 = model->BSIM4v4b1 - + model->BSIM4v4lb1 * Inv_L - + model->BSIM4v4wb1 * Inv_W - + model->BSIM4v4pb1 * Inv_LW; - pParam->BSIM4v4alpha0 = model->BSIM4v4alpha0 - + model->BSIM4v4lalpha0 * Inv_L - + model->BSIM4v4walpha0 * Inv_W - + model->BSIM4v4palpha0 * Inv_LW; - pParam->BSIM4v4alpha1 = model->BSIM4v4alpha1 - + model->BSIM4v4lalpha1 * Inv_L - + model->BSIM4v4walpha1 * Inv_W - + model->BSIM4v4palpha1 * Inv_LW; - pParam->BSIM4v4beta0 = model->BSIM4v4beta0 - + model->BSIM4v4lbeta0 * Inv_L - + model->BSIM4v4wbeta0 * Inv_W - + model->BSIM4v4pbeta0 * Inv_LW; - pParam->BSIM4v4agidl = model->BSIM4v4agidl - + model->BSIM4v4lagidl * Inv_L - + model->BSIM4v4wagidl * Inv_W - + model->BSIM4v4pagidl * Inv_LW; - pParam->BSIM4v4bgidl = model->BSIM4v4bgidl - + model->BSIM4v4lbgidl * Inv_L - + model->BSIM4v4wbgidl * Inv_W - + model->BSIM4v4pbgidl * Inv_LW; - pParam->BSIM4v4cgidl = model->BSIM4v4cgidl - + model->BSIM4v4lcgidl * Inv_L - + model->BSIM4v4wcgidl * Inv_W - + model->BSIM4v4pcgidl * Inv_LW; - pParam->BSIM4v4egidl = model->BSIM4v4egidl - + model->BSIM4v4legidl * Inv_L - + model->BSIM4v4wegidl * Inv_W - + model->BSIM4v4pegidl * Inv_LW; - pParam->BSIM4v4aigc = model->BSIM4v4aigc - + model->BSIM4v4laigc * Inv_L - + model->BSIM4v4waigc * Inv_W - + model->BSIM4v4paigc * Inv_LW; - pParam->BSIM4v4bigc = model->BSIM4v4bigc - + model->BSIM4v4lbigc * Inv_L - + model->BSIM4v4wbigc * Inv_W - + model->BSIM4v4pbigc * Inv_LW; - pParam->BSIM4v4cigc = model->BSIM4v4cigc - + model->BSIM4v4lcigc * Inv_L - + model->BSIM4v4wcigc * Inv_W - + model->BSIM4v4pcigc * Inv_LW; - pParam->BSIM4v4aigsd = model->BSIM4v4aigsd - + model->BSIM4v4laigsd * Inv_L - + model->BSIM4v4waigsd * Inv_W - + model->BSIM4v4paigsd * Inv_LW; - pParam->BSIM4v4bigsd = model->BSIM4v4bigsd - + model->BSIM4v4lbigsd * Inv_L - + model->BSIM4v4wbigsd * Inv_W - + model->BSIM4v4pbigsd * Inv_LW; - pParam->BSIM4v4cigsd = model->BSIM4v4cigsd - + model->BSIM4v4lcigsd * Inv_L - + model->BSIM4v4wcigsd * Inv_W - + model->BSIM4v4pcigsd * Inv_LW; - pParam->BSIM4v4aigbacc = model->BSIM4v4aigbacc - + model->BSIM4v4laigbacc * Inv_L - + model->BSIM4v4waigbacc * Inv_W - + model->BSIM4v4paigbacc * Inv_LW; - pParam->BSIM4v4bigbacc = model->BSIM4v4bigbacc - + model->BSIM4v4lbigbacc * Inv_L - + model->BSIM4v4wbigbacc * Inv_W - + model->BSIM4v4pbigbacc * Inv_LW; - pParam->BSIM4v4cigbacc = model->BSIM4v4cigbacc - + model->BSIM4v4lcigbacc * Inv_L - + model->BSIM4v4wcigbacc * Inv_W - + model->BSIM4v4pcigbacc * Inv_LW; - pParam->BSIM4v4aigbinv = model->BSIM4v4aigbinv - + model->BSIM4v4laigbinv * Inv_L - + model->BSIM4v4waigbinv * Inv_W - + model->BSIM4v4paigbinv * Inv_LW; - pParam->BSIM4v4bigbinv = model->BSIM4v4bigbinv - + model->BSIM4v4lbigbinv * Inv_L - + model->BSIM4v4wbigbinv * Inv_W - + model->BSIM4v4pbigbinv * Inv_LW; - pParam->BSIM4v4cigbinv = model->BSIM4v4cigbinv - + model->BSIM4v4lcigbinv * Inv_L - + model->BSIM4v4wcigbinv * Inv_W - + model->BSIM4v4pcigbinv * Inv_LW; - pParam->BSIM4v4nigc = model->BSIM4v4nigc - + model->BSIM4v4lnigc * Inv_L - + model->BSIM4v4wnigc * Inv_W - + model->BSIM4v4pnigc * Inv_LW; - pParam->BSIM4v4nigbacc = model->BSIM4v4nigbacc - + model->BSIM4v4lnigbacc * Inv_L - + model->BSIM4v4wnigbacc * Inv_W - + model->BSIM4v4pnigbacc * Inv_LW; - pParam->BSIM4v4nigbinv = model->BSIM4v4nigbinv - + model->BSIM4v4lnigbinv * Inv_L - + model->BSIM4v4wnigbinv * Inv_W - + model->BSIM4v4pnigbinv * Inv_LW; - pParam->BSIM4v4ntox = model->BSIM4v4ntox - + model->BSIM4v4lntox * Inv_L - + model->BSIM4v4wntox * Inv_W - + model->BSIM4v4pntox * Inv_LW; - pParam->BSIM4v4eigbinv = model->BSIM4v4eigbinv - + model->BSIM4v4leigbinv * Inv_L - + model->BSIM4v4weigbinv * Inv_W - + model->BSIM4v4peigbinv * Inv_LW; - pParam->BSIM4v4pigcd = model->BSIM4v4pigcd - + model->BSIM4v4lpigcd * Inv_L - + model->BSIM4v4wpigcd * Inv_W - + model->BSIM4v4ppigcd * Inv_LW; - pParam->BSIM4v4poxedge = model->BSIM4v4poxedge - + model->BSIM4v4lpoxedge * Inv_L - + model->BSIM4v4wpoxedge * Inv_W - + model->BSIM4v4ppoxedge * Inv_LW; - pParam->BSIM4v4xrcrg1 = model->BSIM4v4xrcrg1 - + model->BSIM4v4lxrcrg1 * Inv_L - + model->BSIM4v4wxrcrg1 * Inv_W - + model->BSIM4v4pxrcrg1 * Inv_LW; - pParam->BSIM4v4xrcrg2 = model->BSIM4v4xrcrg2 - + model->BSIM4v4lxrcrg2 * Inv_L - + model->BSIM4v4wxrcrg2 * Inv_W - + model->BSIM4v4pxrcrg2 * Inv_LW; - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: - pParam->BSIM4v4lambda = model->BSIM4v4lambda - + model->BSIM4v4llambda * Inv_L - + model->BSIM4v4wlambda * Inv_W - + model->BSIM4v4plambda * Inv_LW; - pParam->BSIM4v4vtl = model->BSIM4v4vtl - + model->BSIM4v4lvtl * Inv_L - + model->BSIM4v4wvtl * Inv_W - + model->BSIM4v4pvtl * Inv_LW; - pParam->BSIM4v4xn = model->BSIM4v4xn - + model->BSIM4v4lxn * Inv_L - + model->BSIM4v4wxn * Inv_W - + model->BSIM4v4pxn * Inv_LW; - break; - case BSIM4v40: - pParam->BSIM4v4lambda = model->BSIM4v4lambda - + model->BSIM4v4llambda * Inv_L - + model->BSIM4v4wlambda * Inv_W - + model->BSIM4v4plambda * Inv_LW; - pParam->BSIM4v4vtl = model->BSIM4v4vtl - + model->BSIM4v4lvtl * Inv_L - + model->BSIM4v4wvtl * Inv_W - + model->BSIM4v4pvtl * Inv_LW; - pParam->BSIM4v4xn = model->BSIM4v4xn - + model->BSIM4v4lxn * Inv_L - + model->BSIM4v4wxn * Inv_W - + model->BSIM4v4pxn * Inv_LW; - pParam->BSIM4v4vfbsdoff = model->BSIM4v4vfbsdoff - + model->BSIM4v4lvfbsdoff * Inv_L - + model->BSIM4v4wvfbsdoff * Inv_W - + model->BSIM4v4pvfbsdoff * Inv_LW; - break; - default: break; - } - - pParam->BSIM4v4cgsl = model->BSIM4v4cgsl - + model->BSIM4v4lcgsl * Inv_L - + model->BSIM4v4wcgsl * Inv_W - + model->BSIM4v4pcgsl * Inv_LW; - pParam->BSIM4v4cgdl = model->BSIM4v4cgdl - + model->BSIM4v4lcgdl * Inv_L - + model->BSIM4v4wcgdl * Inv_W - + model->BSIM4v4pcgdl * Inv_LW; - pParam->BSIM4v4ckappas = model->BSIM4v4ckappas - + model->BSIM4v4lckappas * Inv_L - + model->BSIM4v4wckappas * Inv_W - + model->BSIM4v4pckappas * Inv_LW; - pParam->BSIM4v4ckappad = model->BSIM4v4ckappad - + model->BSIM4v4lckappad * Inv_L - + model->BSIM4v4wckappad * Inv_W - + model->BSIM4v4pckappad * Inv_LW; - pParam->BSIM4v4cf = model->BSIM4v4cf - + model->BSIM4v4lcf * Inv_L - + model->BSIM4v4wcf * Inv_W - + model->BSIM4v4pcf * Inv_LW; - pParam->BSIM4v4clc = model->BSIM4v4clc - + model->BSIM4v4lclc * Inv_L - + model->BSIM4v4wclc * Inv_W - + model->BSIM4v4pclc * Inv_LW; - pParam->BSIM4v4cle = model->BSIM4v4cle - + model->BSIM4v4lcle * Inv_L - + model->BSIM4v4wcle * Inv_W - + model->BSIM4v4pcle * Inv_LW; - pParam->BSIM4v4vfbcv = model->BSIM4v4vfbcv - + model->BSIM4v4lvfbcv * Inv_L - + model->BSIM4v4wvfbcv * Inv_W - + model->BSIM4v4pvfbcv * Inv_LW; - pParam->BSIM4v4acde = model->BSIM4v4acde - + model->BSIM4v4lacde * Inv_L - + model->BSIM4v4wacde * Inv_W - + model->BSIM4v4pacde * Inv_LW; - pParam->BSIM4v4moin = model->BSIM4v4moin - + model->BSIM4v4lmoin * Inv_L - + model->BSIM4v4wmoin * Inv_W - + model->BSIM4v4pmoin * Inv_LW; - pParam->BSIM4v4noff = model->BSIM4v4noff - + model->BSIM4v4lnoff * Inv_L - + model->BSIM4v4wnoff * Inv_W - + model->BSIM4v4pnoff * Inv_LW; - pParam->BSIM4v4voffcv = model->BSIM4v4voffcv - + model->BSIM4v4lvoffcv * Inv_L - + model->BSIM4v4wvoffcv * Inv_W - + model->BSIM4v4pvoffcv * Inv_LW; - - pParam->BSIM4v4abulkCVfactor = 1.0 + pow((pParam->BSIM4v4clc - / pParam->BSIM4v4leffCV), - pParam->BSIM4v4cle); - - T0 = (TRatio - 1.0); - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - pParam->BSIM4v4ua = pParam->BSIM4v4ua + pParam->BSIM4v4ua1 * T0; - pParam->BSIM4v4ub = pParam->BSIM4v4ub + pParam->BSIM4v4ub1 * T0; - pParam->BSIM4v4uc = pParam->BSIM4v4uc + pParam->BSIM4v4uc1 * T0; - if (pParam->BSIM4v4u0 > 1.0) - pParam->BSIM4v4u0 = pParam->BSIM4v4u0 / 1.0e4; - - - pParam->BSIM4v4u0temp = pParam->BSIM4v4u0 - * pow(TRatio, pParam->BSIM4v4ute); - pParam->BSIM4v4vsattemp = pParam->BSIM4v4vsat - pParam->BSIM4v4at - * T0; - if (pParam->BSIM4v4eu < 0.0) - { pParam->BSIM4v4eu = 0.0; - printf("Warning: eu has been negative; reset to 0.0.\n"); - } - - - PowWeffWr = pow(pParam->BSIM4v4weffCJ * 1.0e6, pParam->BSIM4v4wr) * here->BSIM4v4nf; - /* External Rd(V) */ - T1 = pParam->BSIM4v4rdw + pParam->BSIM4v4prt * T0; - if (T1 < 0.0) - { T1 = 0.0; - printf("Warning: Rdw at current temperature is negative; set to 0.\n"); - } - T2 = model->BSIM4v4rdwmin + pParam->BSIM4v4prt * T0; - if (T2 < 0.0) - { T2 = 0.0; - printf("Warning: Rdwmin at current temperature is negative; set to 0.\n"); - } - pParam->BSIM4v4rd0 = T1 / PowWeffWr; - pParam->BSIM4v4rdwmin = T2 / PowWeffWr; - - - /* External Rs(V) */ - T1 = pParam->BSIM4v4rsw + pParam->BSIM4v4prt * T0; - if (T1 < 0.0) - { T1 = 0.0; - printf("Warning: Rsw at current temperature is negative; set to 0.\n"); - } - T2 = model->BSIM4v4rswmin + pParam->BSIM4v4prt * T0; - if (T2 < 0.0) - { T2 = 0.0; - printf("Warning: Rswmin at current temperature is negative; set to 0.\n"); - } - pParam->BSIM4v4rs0 = T1 / PowWeffWr; - pParam->BSIM4v4rswmin = T2 / PowWeffWr; - - - /* Internal Rds(V) in IV */ - pParam->BSIM4v4rds0 = (pParam->BSIM4v4rdsw + pParam->BSIM4v4prt * T0) - * here->BSIM4v4nf / PowWeffWr; - pParam->BSIM4v4rdswmin = (model->BSIM4v4rdswmin + pParam->BSIM4v4prt * T0) - * here->BSIM4v4nf / PowWeffWr; - break; - case BSIM4v30: case BSIM4v40: - PowWeffWr = pow(pParam->BSIM4v4weffCJ * 1.0e6, pParam->BSIM4v4wr) * here->BSIM4v4nf; - - T1 = T2 = T3 = T4 = 0.0; - if(model->BSIM4v4tempMod == 0) { - pParam->BSIM4v4ua = pParam->BSIM4v4ua + pParam->BSIM4v4ua1 * T0; - pParam->BSIM4v4ub = pParam->BSIM4v4ub + pParam->BSIM4v4ub1 * T0; - pParam->BSIM4v4uc = pParam->BSIM4v4uc + pParam->BSIM4v4uc1 * T0; - pParam->BSIM4v4vsattemp = pParam->BSIM4v4vsat - pParam->BSIM4v4at * T0; - T10 = pParam->BSIM4v4prt * T0; - if(model->BSIM4v4rdsMod) { - /* External Rd(V) */ - T1 = pParam->BSIM4v4rdw + T10; - T2 = model->BSIM4v4rdwmin + T10; - /* External Rs(V) */ - T3 = pParam->BSIM4v4rsw + T10; - T4 = model->BSIM4v4rswmin + T10; - } - /* Internal Rds(V) in IV */ - pParam->BSIM4v4rds0 = (pParam->BSIM4v4rdsw + T10) - * here->BSIM4v4nf / PowWeffWr; - pParam->BSIM4v4rdswmin = (model->BSIM4v4rdswmin + T10) - * here->BSIM4v4nf / PowWeffWr; - } else { /* tempMod = 1 */ - pParam->BSIM4v4ua = pParam->BSIM4v4ua * (1.0 + pParam->BSIM4v4ua1 * delTemp) ; - pParam->BSIM4v4ub = pParam->BSIM4v4ub * (1.0 + pParam->BSIM4v4ub1 * delTemp); - pParam->BSIM4v4uc = pParam->BSIM4v4uc * (1.0 + pParam->BSIM4v4uc1 * delTemp); - pParam->BSIM4v4vsattemp = pParam->BSIM4v4vsat * (1.0 - pParam->BSIM4v4at * delTemp); - T10 = 1.0 + pParam->BSIM4v4prt * delTemp; - if(model->BSIM4v4rdsMod) { - /* External Rd(V) */ - T1 = pParam->BSIM4v4rdw * T10; - T2 = model->BSIM4v4rdwmin * T10; - /* External Rs(V) */ - T3 = pParam->BSIM4v4rsw * T10; - T4 = model->BSIM4v4rswmin * T10; - } - /* Internal Rds(V) in IV */ - pParam->BSIM4v4rds0 = pParam->BSIM4v4rdsw * T10 * here->BSIM4v4nf / PowWeffWr; - pParam->BSIM4v4rdswmin = model->BSIM4v4rdswmin * T10 * here->BSIM4v4nf / PowWeffWr; - } - if (T1 < 0.0) - { T1 = 0.0; - printf("Warning: Rdw at current temperature is negative; set to 0.\n"); - } - if (T2 < 0.0) - { T2 = 0.0; - printf("Warning: Rdwmin at current temperature is negative; set to 0.\n"); - } - pParam->BSIM4v4rd0 = T1 / PowWeffWr; - pParam->BSIM4v4rdwmin = T2 / PowWeffWr; - if (T3 < 0.0) - { T3 = 0.0; - printf("Warning: Rsw at current temperature is negative; set to 0.\n"); - } - if (T4 < 0.0) - { T4 = 0.0; - printf("Warning: Rswmin at current temperature is negative; set to 0.\n"); - } - pParam->BSIM4v4rs0 = T3 / PowWeffWr; - pParam->BSIM4v4rswmin = T4 / PowWeffWr; - - if (pParam->BSIM4v4u0 > 1.0) - pParam->BSIM4v4u0 = pParam->BSIM4v4u0 / 1.0e4; - - pParam->BSIM4v4u0temp = pParam->BSIM4v4u0 - * pow(TRatio, pParam->BSIM4v4ute); - if (pParam->BSIM4v4eu < 0.0) - { pParam->BSIM4v4eu = 0.0; - printf("Warning: eu has been negative; reset to 0.0.\n"); - } - - /* Source End Velocity Limit */ - if((model->BSIM4v4vtlGiven) && (model->BSIM4v4vtl > 0.0) ) - { - if(model->BSIM4v4lc < 0.0) pParam->BSIM4v4lc = 0.0; - else pParam->BSIM4v4lc = model->BSIM4v4lc ; - T0 = pParam->BSIM4v4leff / (pParam->BSIM4v4xn * pParam->BSIM4v4leff + pParam->BSIM4v4lc); - pParam->BSIM4v4tfactor = (1.0 - T0) / (1.0 + T0 ); - } - break; - default: break; - } - - pParam->BSIM4v4cgdo = (model->BSIM4v4cgdo + pParam->BSIM4v4cf) - * pParam->BSIM4v4weffCV; - pParam->BSIM4v4cgso = (model->BSIM4v4cgso + pParam->BSIM4v4cf) - * pParam->BSIM4v4weffCV; - pParam->BSIM4v4cgbo = model->BSIM4v4cgbo * pParam->BSIM4v4leffCV * here->BSIM4v4nf; - - if (!model->BSIM4v4ndepGiven && model->BSIM4v4gamma1Given) - { T0 = pParam->BSIM4v4gamma1 * model->BSIM4v4coxe; - pParam->BSIM4v4ndep = 3.01248e22 * T0 * T0; - } - - pParam->BSIM4v4phi = Vtm0 * log(pParam->BSIM4v4ndep / ni) - + pParam->BSIM4v4phin + 0.4; - - pParam->BSIM4v4sqrtPhi = sqrt(pParam->BSIM4v4phi); - pParam->BSIM4v4phis3 = pParam->BSIM4v4sqrtPhi * pParam->BSIM4v4phi; - - pParam->BSIM4v4Xdep0 = sqrt(2.0 * EPSSI / (Charge_q - * pParam->BSIM4v4ndep * 1.0e6)) - * pParam->BSIM4v4sqrtPhi; - pParam->BSIM4v4sqrtXdep0 = sqrt(pParam->BSIM4v4Xdep0); - pParam->BSIM4v4litl = sqrt(3.0 * pParam->BSIM4v4xj - * model->BSIM4v4toxe); - pParam->BSIM4v4vbi = Vtm0 * log(pParam->BSIM4v4nsd - * pParam->BSIM4v4ndep / (ni * ni)); - - if (pParam->BSIM4v4ngate > 0.0) - { pParam->BSIM4v4vfbsd = Vtm0 * log(pParam->BSIM4v4ngate - / pParam->BSIM4v4nsd); - } - else - pParam->BSIM4v4vfbsd = 0.0; - - pParam->BSIM4v4cdep0 = sqrt(Charge_q * EPSSI - * pParam->BSIM4v4ndep * 1.0e6 / 2.0 - / pParam->BSIM4v4phi); - - pParam->BSIM4v4ToxRatio = exp(pParam->BSIM4v4ntox - * log(model->BSIM4v4toxref / model->BSIM4v4toxe)) - / model->BSIM4v4toxe / model->BSIM4v4toxe; - pParam->BSIM4v4ToxRatioEdge = exp(pParam->BSIM4v4ntox - * log(model->BSIM4v4toxref - / (model->BSIM4v4toxe * pParam->BSIM4v4poxedge))) - / model->BSIM4v4toxe / model->BSIM4v4toxe - / pParam->BSIM4v4poxedge / pParam->BSIM4v4poxedge; - pParam->BSIM4v4Aechvb = (model->BSIM4v4type == NMOS) ? 4.97232e-7 : 3.42537e-7; - pParam->BSIM4v4Bechvb = (model->BSIM4v4type == NMOS) ? 7.45669e11 : 1.16645e12; - pParam->BSIM4v4AechvbEdge = pParam->BSIM4v4Aechvb * pParam->BSIM4v4weff - * pParam->BSIM4v4dlcig * pParam->BSIM4v4ToxRatioEdge; - pParam->BSIM4v4BechvbEdge = -pParam->BSIM4v4Bechvb - * model->BSIM4v4toxe * pParam->BSIM4v4poxedge; - pParam->BSIM4v4Aechvb *= pParam->BSIM4v4weff * pParam->BSIM4v4leff - * pParam->BSIM4v4ToxRatio; - pParam->BSIM4v4Bechvb *= -model->BSIM4v4toxe; - - - pParam->BSIM4v4mstar = 0.5 + atan(pParam->BSIM4v4minv) / PI; - pParam->BSIM4v4voffcbn = pParam->BSIM4v4voff + model->BSIM4v4voffl / pParam->BSIM4v4leff; - - pParam->BSIM4v4ldeb = sqrt(EPSSI * Vtm0 / (Charge_q - * pParam->BSIM4v4ndep * 1.0e6)) / 3.0; - pParam->BSIM4v4acde *= pow((pParam->BSIM4v4ndep / 2.0e16), -0.25); - - - if (model->BSIM4v4k1Given || model->BSIM4v4k2Given) - { if (!model->BSIM4v4k1Given) - { fprintf(stdout, "Warning: k1 should be specified with k2.\n"); - pParam->BSIM4v4k1 = 0.53; - } - if (!model->BSIM4v4k2Given) - { fprintf(stdout, "Warning: k2 should be specified with k1.\n"); - pParam->BSIM4v4k2 = -0.0186; - } - if (model->BSIM4v4nsubGiven) - fprintf(stdout, "Warning: nsub is ignored because k1 or k2 is given.\n"); - if (model->BSIM4v4xtGiven) - fprintf(stdout, "Warning: xt is ignored because k1 or k2 is given.\n"); - if (model->BSIM4v4vbxGiven) - fprintf(stdout, "Warning: vbx is ignored because k1 or k2 is given.\n"); - if (model->BSIM4v4gamma1Given) - fprintf(stdout, "Warning: gamma1 is ignored because k1 or k2 is given.\n"); - if (model->BSIM4v4gamma2Given) - fprintf(stdout, "Warning: gamma2 is ignored because k1 or k2 is given.\n"); - } - else - { if (!model->BSIM4v4vbxGiven) - pParam->BSIM4v4vbx = pParam->BSIM4v4phi - 7.7348e-4 - * pParam->BSIM4v4ndep - * pParam->BSIM4v4xt * pParam->BSIM4v4xt; - if (pParam->BSIM4v4vbx > 0.0) - pParam->BSIM4v4vbx = -pParam->BSIM4v4vbx; - if (pParam->BSIM4v4vbm > 0.0) - pParam->BSIM4v4vbm = -pParam->BSIM4v4vbm; - - if (!model->BSIM4v4gamma1Given) - pParam->BSIM4v4gamma1 = 5.753e-12 - * sqrt(pParam->BSIM4v4ndep) - / model->BSIM4v4coxe; - if (!model->BSIM4v4gamma2Given) - pParam->BSIM4v4gamma2 = 5.753e-12 - * sqrt(pParam->BSIM4v4nsub) - / model->BSIM4v4coxe; - - T0 = pParam->BSIM4v4gamma1 - pParam->BSIM4v4gamma2; - T1 = sqrt(pParam->BSIM4v4phi - pParam->BSIM4v4vbx) - - pParam->BSIM4v4sqrtPhi; - T2 = sqrt(pParam->BSIM4v4phi * (pParam->BSIM4v4phi - - pParam->BSIM4v4vbm)) - pParam->BSIM4v4phi; - pParam->BSIM4v4k2 = T0 * T1 / (2.0 * T2 + pParam->BSIM4v4vbm); - pParam->BSIM4v4k1 = pParam->BSIM4v4gamma2 - 2.0 - * pParam->BSIM4v4k2 * sqrt(pParam->BSIM4v4phi - - pParam->BSIM4v4vbm); - } - - if (pParam->BSIM4v4k2 < 0.0) - { T0 = 0.5 * pParam->BSIM4v4k1 / pParam->BSIM4v4k2; - pParam->BSIM4v4vbsc = 0.9 * (pParam->BSIM4v4phi - T0 * T0); - if (pParam->BSIM4v4vbsc > -3.0) - pParam->BSIM4v4vbsc = -3.0; - else if (pParam->BSIM4v4vbsc < -30.0) - pParam->BSIM4v4vbsc = -30.0; - } - else - { pParam->BSIM4v4vbsc = -30.0; - } - if (pParam->BSIM4v4vbsc > pParam->BSIM4v4vbm) - pParam->BSIM4v4vbsc = pParam->BSIM4v4vbm; - - if (!model->BSIM4v4vfbGiven) - { if (model->BSIM4v4vth0Given) - { pParam->BSIM4v4vfb = model->BSIM4v4type * pParam->BSIM4v4vth0 - - pParam->BSIM4v4phi - pParam->BSIM4v4k1 - * pParam->BSIM4v4sqrtPhi; - } - else - { pParam->BSIM4v4vfb = -1.0; - } - } - if (!model->BSIM4v4vth0Given) - { pParam->BSIM4v4vth0 = model->BSIM4v4type * (pParam->BSIM4v4vfb - + pParam->BSIM4v4phi + pParam->BSIM4v4k1 - * pParam->BSIM4v4sqrtPhi); - } - - pParam->BSIM4v4k1ox = pParam->BSIM4v4k1 * model->BSIM4v4toxe - / model->BSIM4v4toxm; - pParam->BSIM4v4k2ox = pParam->BSIM4v4k2 * model->BSIM4v4toxe - / model->BSIM4v4toxm; - - T3 = model->BSIM4v4type * pParam->BSIM4v4vth0 - - pParam->BSIM4v4vfb - pParam->BSIM4v4phi; - T4 = T3 + T3; - T5 = 2.5 * T3; - pParam->BSIM4v4vtfbphi1 = (model->BSIM4v4type == NMOS) ? T4 : T5; - if (pParam->BSIM4v4vtfbphi1 < 0.0) - pParam->BSIM4v4vtfbphi1 = 0.0; - - pParam->BSIM4v4vtfbphi2 = 4.0 * T3; - if (pParam->BSIM4v4vtfbphi2 < 0.0) - pParam->BSIM4v4vtfbphi2 = 0.0; - - tmp = sqrt(EPSSI / (model->BSIM4v4epsrox * EPS0) - * model->BSIM4v4toxe * pParam->BSIM4v4Xdep0); - T0 = pParam->BSIM4v4dsub * pParam->BSIM4v4leff / tmp; - if (T0 < EXP_THRESHOLD) - { T1 = exp(T0); - T2 = T1 - 1.0; - T3 = T2 * T2; - T4 = T3 + 2.0 * T1 * MIN_EXP; - pParam->BSIM4v4theta0vb0 = T1 / T4; - } - else - pParam->BSIM4v4theta0vb0 = 1.0 / (MAX_EXP - 2.0); - - T0 = pParam->BSIM4v4drout * pParam->BSIM4v4leff / tmp; - if (T0 < EXP_THRESHOLD) - { T1 = exp(T0); - T2 = T1 - 1.0; - T3 = T2 * T2; - T4 = T3 + 2.0 * T1 * MIN_EXP; - T5 = T1 / T4; - } - else - T5 = 1.0 / (MAX_EXP - 2.0); /* 3.0 * MIN_EXP omitted */ - pParam->BSIM4v4thetaRout = pParam->BSIM4v4pdibl1 * T5 - + pParam->BSIM4v4pdibl2; - - tmp = sqrt(pParam->BSIM4v4Xdep0); - tmp1 = pParam->BSIM4v4vbi - pParam->BSIM4v4phi; - tmp2 = model->BSIM4v4factor1 * tmp; - - T0 = pParam->BSIM4v4dvt1w * pParam->BSIM4v4weff - * pParam->BSIM4v4leff / tmp2; - if (T0 < EXP_THRESHOLD) - { T1 = exp(T0); - T2 = T1 - 1.0; - T3 = T2 * T2; - T4 = T3 + 2.0 * T1 * MIN_EXP; - T8 = T1 / T4; - } - else - T8 = 1.0 / (MAX_EXP - 2.0); - T0 = pParam->BSIM4v4dvt0w * T8; - T8 = T0 * tmp1; - - T0 = pParam->BSIM4v4dvt1 * pParam->BSIM4v4leff / tmp2; - if (T0 < EXP_THRESHOLD) - { T1 = exp(T0); - T2 = T1 - 1.0; - T3 = T2 * T2; - T4 = T3 + 2.0 * T1 * MIN_EXP; - T9 = T1 / T4; - } - else - T9 = 1.0 / (MAX_EXP - 2.0); - T9 = pParam->BSIM4v4dvt0 * T9 * tmp1; - - T4 = model->BSIM4v4toxe * pParam->BSIM4v4phi - / (pParam->BSIM4v4weff + pParam->BSIM4v4w0); - - T0 = sqrt(1.0 + pParam->BSIM4v4lpe0 / pParam->BSIM4v4leff); - T5 = pParam->BSIM4v4k1ox * (T0 - 1.0) * pParam->BSIM4v4sqrtPhi - + (pParam->BSIM4v4kt1 + pParam->BSIM4v4kt1l / pParam->BSIM4v4leff) - * (TRatio - 1.0); - - tmp3 = model->BSIM4v4type * pParam->BSIM4v4vth0 - - T8 - T9 + pParam->BSIM4v4k3 * T4 + T5; - pParam->BSIM4v4vfbzb = tmp3 - pParam->BSIM4v4phi - pParam->BSIM4v4k1 - * pParam->BSIM4v4sqrtPhi; /* End of vfbzb */ - - /* stress effect */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - T0 = pow(Lnew, model->BSIM4v4llodku0); - W_tmp = Wnew + model->BSIM4v4wlod; - T1 = pow(W_tmp, model->BSIM4v4wlodku0); - tmp1 = model->BSIM4v4lku0 / T0 + model->BSIM4v4wku0 / T1 - + model->BSIM4v4pku0 / (T0 * T1); - pParam->BSIM4v4ku0 = 1.0 + tmp1; - - T0 = pow(Lnew, model->BSIM4v4llodvth); - T1 = pow(W_tmp, model->BSIM4v4wlodvth); - tmp1 = model->BSIM4v4lkvth0 / T0 + model->BSIM4v4wkvth0 / T1 - + model->BSIM4v4pkvth0 / (T0 * T1); - pParam->BSIM4v4kvth0 = 1.0 + tmp1; - pParam->BSIM4v4kvth0 = sqrt(pParam->BSIM4v4kvth0*pParam->BSIM4v4kvth0 + DELTA); - - T0 = (TRatio - 1.0); - pParam->BSIM4v4ku0temp = pParam->BSIM4v4ku0 * (1.0 + model->BSIM4v4tku0 *T0) + DELTA; - - Inv_saref = 1.0/(model->BSIM4v4saref + 0.5*Ldrn); - Inv_sbref = 1.0/(model->BSIM4v4sbref + 0.5*Ldrn); - pParam->BSIM4v4inv_od_ref = Inv_saref + Inv_sbref; - pParam->BSIM4v4rho_ref = model->BSIM4v4ku0 / pParam->BSIM4v4ku0temp * pParam->BSIM4v4inv_od_ref; - break; - default: break; - } - - } /* End of SizeNotFound */ - - /* stress effect */ - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - break; - case BSIM4v30: case BSIM4v40: - if( (here->BSIM4v4sa > 0.0) && (here->BSIM4v4sb > 0.0) && - ((here->BSIM4v4nf == 1.0) || ((here->BSIM4v4nf > 1.0) && (here->BSIM4v4sd > 0.0))) ) - { Inv_sa = 0; - Inv_sb = 0; - - if (model->BSIM4v4wlod < 0.0) - { fprintf(stderr, "Warning: WLOD = %g is less than 0. Set to 0.0\n",model->BSIM4v4wlod); - model->BSIM4v4wlod = 0.0; - } - if (model->BSIM4v4kvsat < -1.0 ) - { fprintf(stderr, "Warning: KVSAT = %g is too small; Reset to -1.0.\n",model->BSIM4v4kvsat); - model->BSIM4v4kvsat = -1.0; - } - if (model->BSIM4v4kvsat > 1.0) - { fprintf(stderr, "Warning: KVSAT = %g is too big; Reset to 1.0.\n",model->BSIM4v4kvsat); - model->BSIM4v4kvsat = 1.0; - } - - for(i = 0; i < here->BSIM4v4nf; i++){ - T0 = 1.0 / here->BSIM4v4nf / (here->BSIM4v4sa + 0.5*Ldrn + i * (here->BSIM4v4sd +Ldrn)); - T1 = 1.0 / here->BSIM4v4nf / (here->BSIM4v4sb + 0.5*Ldrn + i * (here->BSIM4v4sd +Ldrn)); - Inv_sa += T0; - Inv_sb += T1; - } - Inv_ODeff = Inv_sa + Inv_sb; - rho = model->BSIM4v4ku0 / pParam->BSIM4v4ku0temp * Inv_ODeff; - T0 = (1.0 + rho)/(1.0 + pParam->BSIM4v4rho_ref); - here->BSIM4v4u0temp = pParam->BSIM4v4u0temp * T0; - - T1 = (1.0 + model->BSIM4v4kvsat * rho)/(1.0 + model->BSIM4v4kvsat * pParam->BSIM4v4rho_ref); - here->BSIM4v4vsattemp = pParam->BSIM4v4vsattemp * T1; - - OD_offset = Inv_ODeff - pParam->BSIM4v4inv_od_ref; - dvth0_lod = model->BSIM4v4kvth0 / pParam->BSIM4v4kvth0 * OD_offset; - dk2_lod = model->BSIM4v4stk2 / pow(pParam->BSIM4v4kvth0, model->BSIM4v4lodk2) * - OD_offset; - deta0_lod = model->BSIM4v4steta0 / pow(pParam->BSIM4v4kvth0, model->BSIM4v4lodeta0) * - OD_offset; - here->BSIM4v4vth0 = pParam->BSIM4v4vth0 + dvth0_lod; - - if (!model->BSIM4v4vfbGiven && !model->BSIM4v4vth0Given) - here->BSIM4v4vfb = -1.0; - else - here->BSIM4v4vfb = pParam->BSIM4v4vfb + model->BSIM4v4type * dvth0_lod; - here->BSIM4v4vfbzb = pParam->BSIM4v4vfbzb + model->BSIM4v4type * dvth0_lod; - - T3 = model->BSIM4v4type * here->BSIM4v4vth0 - - here->BSIM4v4vfb - pParam->BSIM4v4phi; - T4 = T3 + T3; - T5 = 2.5 * T3; - here->BSIM4v4vtfbphi1 = (model->BSIM4v4type == NMOS) ? T4 : T5; - if (here->BSIM4v4vtfbphi1 < 0.0) - here->BSIM4v4vtfbphi1 = 0.0; - - here->BSIM4v4vtfbphi2 = 4.0 * T3; - if (here->BSIM4v4vtfbphi2 < 0.0) - here->BSIM4v4vtfbphi2 = 0.0; - - here->BSIM4v4k2 = pParam->BSIM4v4k2 + dk2_lod; - if (here->BSIM4v4k2 < 0.0) - { T0 = 0.5 * pParam->BSIM4v4k1 / here->BSIM4v4k2; - here->BSIM4v4vbsc = 0.9 * (pParam->BSIM4v4phi - T0 * T0); - if (here->BSIM4v4vbsc > -3.0) - here->BSIM4v4vbsc = -3.0; - else if (here->BSIM4v4vbsc < -30.0) - here->BSIM4v4vbsc = -30.0; - } - else - here->BSIM4v4vbsc = -30.0; - if (here->BSIM4v4vbsc > pParam->BSIM4v4vbm) - here->BSIM4v4vbsc = pParam->BSIM4v4vbm; - here->BSIM4v4k2ox = here->BSIM4v4k2 * model->BSIM4v4toxe - / model->BSIM4v4toxm; - - here->BSIM4v4eta0 = pParam->BSIM4v4eta0 + deta0_lod; - } else { - here->BSIM4v4u0temp = pParam->BSIM4v4u0temp; - here->BSIM4v4vth0 = pParam->BSIM4v4vth0; - here->BSIM4v4vsattemp = pParam->BSIM4v4vsattemp; - here->BSIM4v4vfb = pParam->BSIM4v4vfb; - here->BSIM4v4vfbzb = pParam->BSIM4v4vfbzb; - here->BSIM4v4vtfbphi1 = pParam->BSIM4v4vtfbphi1; - here->BSIM4v4vtfbphi2 = pParam->BSIM4v4vtfbphi2; - here->BSIM4v4k2 = pParam->BSIM4v4k2; - here->BSIM4v4vbsc = pParam->BSIM4v4vbsc; - here->BSIM4v4k2ox = pParam->BSIM4v4k2ox; - here->BSIM4v4eta0 = pParam->BSIM4v4eta0; - } - break; - default: break; - } - - here->BSIM4v4cgso = pParam->BSIM4v4cgso; - here->BSIM4v4cgdo = pParam->BSIM4v4cgdo; - - if (here->BSIM4v4rbodyMod) - { if (here->BSIM4v4rbdb < 1.0e-3) - here->BSIM4v4grbdb = 1.0e3; /* in mho */ - else - here->BSIM4v4grbdb = model->BSIM4v4gbmin + 1.0 / here->BSIM4v4rbdb; - if (here->BSIM4v4rbpb < 1.0e-3) - here->BSIM4v4grbpb = 1.0e3; - else - here->BSIM4v4grbpb = model->BSIM4v4gbmin + 1.0 / here->BSIM4v4rbpb; - if (here->BSIM4v4rbps < 1.0e-3) - here->BSIM4v4grbps = 1.0e3; - else - here->BSIM4v4grbps = model->BSIM4v4gbmin + 1.0 / here->BSIM4v4rbps; - if (here->BSIM4v4rbsb < 1.0e-3) - here->BSIM4v4grbsb = 1.0e3; - else - here->BSIM4v4grbsb = model->BSIM4v4gbmin + 1.0 / here->BSIM4v4rbsb; - if (here->BSIM4v4rbpd < 1.0e-3) - here->BSIM4v4grbpd = 1.0e3; - else - here->BSIM4v4grbpd = model->BSIM4v4gbmin + 1.0 / here->BSIM4v4rbpd; - } - - - /* - * Process geomertry dependent parasitics - */ - - here->BSIM4v4grgeltd = model->BSIM4v4rshg * (model->BSIM4v4xgw - + pParam->BSIM4v4weffCJ / 3.0 / model->BSIM4v4ngcon) / - (model->BSIM4v4ngcon * here->BSIM4v4nf * - (Lnew - model->BSIM4v4xgl)); - if (here->BSIM4v4grgeltd > 0.0) - here->BSIM4v4grgeltd = 1.0 / here->BSIM4v4grgeltd; - else - { here->BSIM4v4grgeltd = 1.0e3; /* mho */ - if (here->BSIM4v4rgateMod != 0) - printf("Warning: The gate conductance reset to 1.0e3 mho.\n"); - } - - DMCGeff = model->BSIM4v4dmcg - model->BSIM4v4dmcgt; - DMCIeff = model->BSIM4v4dmci; - DMDGeff = model->BSIM4v4dmdg - model->BSIM4v4dmcgt; - - if (here->BSIM4v4sourcePerimeterGiven) - { if (model->BSIM4v4perMod == 0) - here->BSIM4v4Pseff = here->BSIM4v4sourcePerimeter; - else - here->BSIM4v4Pseff = here->BSIM4v4sourcePerimeter - - pParam->BSIM4v4weffCJ * here->BSIM4v4nf; - } - else - BSIM4v4PAeffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, here->BSIM4v4min, - pParam->BSIM4v4weffCJ, DMCGeff, DMCIeff, DMDGeff, - &(here->BSIM4v4Pseff), &dumPd, &dumAs, &dumAd); - - if (here->BSIM4v4drainPerimeterGiven) - { if (model->BSIM4v4perMod == 0) - here->BSIM4v4Pdeff = here->BSIM4v4drainPerimeter; - else - here->BSIM4v4Pdeff = here->BSIM4v4drainPerimeter - - pParam->BSIM4v4weffCJ * here->BSIM4v4nf; - } - else - BSIM4v4PAeffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, here->BSIM4v4min, - pParam->BSIM4v4weffCJ, DMCGeff, DMCIeff, DMDGeff, - &dumPs, &(here->BSIM4v4Pdeff), &dumAs, &dumAd); - - if (here->BSIM4v4sourceAreaGiven) - here->BSIM4v4Aseff = here->BSIM4v4sourceArea; - else - BSIM4v4PAeffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, here->BSIM4v4min, - pParam->BSIM4v4weffCJ, DMCGeff, DMCIeff, DMDGeff, - &dumPs, &dumPd, &(here->BSIM4v4Aseff), &dumAd); - - if (here->BSIM4v4drainAreaGiven) - here->BSIM4v4Adeff = here->BSIM4v4drainArea; - else - BSIM4v4PAeffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, here->BSIM4v4min, - pParam->BSIM4v4weffCJ, DMCGeff, DMCIeff, DMDGeff, - &dumPs, &dumPd, &dumAs, &(here->BSIM4v4Adeff)); - - /* Processing S/D resistance and conductance below */ - if(here->BSIM4v4sNodePrime != here->BSIM4v4sNode) - { - here->BSIM4v4sourceConductance = 0.0; - if(here->BSIM4v4sourceSquaresGiven) - { - here->BSIM4v4sourceConductance = model->BSIM4v4sheetResistance - * here->BSIM4v4sourceSquares; - } else if (here->BSIM4v4rgeoMod > 0) - { - BSIM4v4RdseffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, - here->BSIM4v4rgeoMod, here->BSIM4v4min, - pParam->BSIM4v4weffCJ, model->BSIM4v4sheetResistance, - DMCGeff, DMCIeff, DMDGeff, 1, &(here->BSIM4v4sourceConductance)); - } else - { - here->BSIM4v4sourceConductance = 0.0; - } - - if (here->BSIM4v4sourceConductance > 0.0) - here->BSIM4v4sourceConductance = 1.0 - / here->BSIM4v4sourceConductance; - else - { - here->BSIM4v4sourceConductance = 1.0e3; /* mho */ - printf ("Warning: Source conductance reset to 1.0e3 mho.\n"); - } - } else - { - here->BSIM4v4sourceConductance = 0.0; - } - - if(here->BSIM4v4dNodePrime != here->BSIM4v4dNode) - { - here->BSIM4v4drainConductance = 0.0; - if(here->BSIM4v4drainSquaresGiven) - { - here->BSIM4v4drainConductance = model->BSIM4v4sheetResistance - * here->BSIM4v4drainSquares; - } else if (here->BSIM4v4rgeoMod > 0) - { - BSIM4v4RdseffGeo(here->BSIM4v4nf, here->BSIM4v4geoMod, - here->BSIM4v4rgeoMod, here->BSIM4v4min, - pParam->BSIM4v4weffCJ, model->BSIM4v4sheetResistance, - DMCGeff, DMCIeff, DMDGeff, 0, &(here->BSIM4v4drainConductance)); - } else - { - here->BSIM4v4drainConductance = 0.0; - } - - if (here->BSIM4v4drainConductance > 0.0) - here->BSIM4v4drainConductance = 1.0 - / here->BSIM4v4drainConductance; - else - { - here->BSIM4v4drainConductance = 1.0e3; /* mho */ - printf ("Warning: Drain conductance reset to 1.0e3 mho.\n"); - } - } else - { - here->BSIM4v4drainConductance = 0.0; - } - - /* End of Rsd processing */ - - - Nvtms = model->BSIM4v4vtm * model->BSIM4v4SjctEmissionCoeff; - if ((here->BSIM4v4Aseff <= 0.0) && (here->BSIM4v4Pseff <= 0.0)) - { SourceSatCurrent = 1.0e-14; - } - else - { SourceSatCurrent = here->BSIM4v4Aseff * model->BSIM4v4SjctTempSatCurDensity - + here->BSIM4v4Pseff * model->BSIM4v4SjctSidewallTempSatCurDensity - + pParam->BSIM4v4weffCJ * here->BSIM4v4nf - * model->BSIM4v4SjctGateSidewallTempSatCurDensity; - } - if (SourceSatCurrent > 0.0) - { switch(model->BSIM4v4dioMod) - { case 0: - if ((model->BSIM4v4bvs / Nvtms) > EXP_THRESHOLD) - here->BSIM4v4XExpBVS = model->BSIM4v4xjbvs * MIN_EXP; - else - here->BSIM4v4XExpBVS = model->BSIM4v4xjbvs * exp(-model->BSIM4v4bvs / Nvtms); - break; - case 1: - BSIM4v4DioIjthVjmEval(Nvtms, model->BSIM4v4ijthsfwd, SourceSatCurrent, - 0.0, &(here->BSIM4v4vjsmFwd)); - here->BSIM4v4IVjsmFwd = SourceSatCurrent * exp(here->BSIM4v4vjsmFwd / Nvtms); - break; - case 2: - if ((model->BSIM4v4bvs / Nvtms) > EXP_THRESHOLD) - { here->BSIM4v4XExpBVS = model->BSIM4v4xjbvs * MIN_EXP; - tmp = MIN_EXP; - } - else - { here->BSIM4v4XExpBVS = exp(-model->BSIM4v4bvs / Nvtms); - tmp = here->BSIM4v4XExpBVS; - here->BSIM4v4XExpBVS *= model->BSIM4v4xjbvs; - } - - BSIM4v4DioIjthVjmEval(Nvtms, model->BSIM4v4ijthsfwd, SourceSatCurrent, - here->BSIM4v4XExpBVS, &(here->BSIM4v4vjsmFwd)); - T0 = exp(here->BSIM4v4vjsmFwd / Nvtms); - here->BSIM4v4IVjsmFwd = SourceSatCurrent * (T0 - here->BSIM4v4XExpBVS / T0 - + here->BSIM4v4XExpBVS - 1.0); - here->BSIM4v4SslpFwd = SourceSatCurrent - * (T0 + here->BSIM4v4XExpBVS / T0) / Nvtms; - - T2 = model->BSIM4v4ijthsrev / SourceSatCurrent; - if (T2 < 1.0) - { T2 = 10.0; - fprintf(stderr, "Warning: ijthsrev too small and set to 10 times IsbSat.\n"); - } - here->BSIM4v4vjsmRev = -model->BSIM4v4bvs - - Nvtms * log((T2 - 1.0) / model->BSIM4v4xjbvs); - T1 = model->BSIM4v4xjbvs * exp(-(model->BSIM4v4bvs - + here->BSIM4v4vjsmRev) / Nvtms); - here->BSIM4v4IVjsmRev = SourceSatCurrent * (1.0 + T1); - here->BSIM4v4SslpRev = -SourceSatCurrent * T1 / Nvtms; - break; - default: - printf("Specified dioMod = %d not matched\n", model->BSIM4v4dioMod); - } - } - - Nvtmd = model->BSIM4v4vtm * model->BSIM4v4DjctEmissionCoeff; - if ((here->BSIM4v4Adeff <= 0.0) && (here->BSIM4v4Pdeff <= 0.0)) - { DrainSatCurrent = 1.0e-14; - } - else - { DrainSatCurrent = here->BSIM4v4Adeff * model->BSIM4v4DjctTempSatCurDensity - + here->BSIM4v4Pdeff * model->BSIM4v4DjctSidewallTempSatCurDensity - + pParam->BSIM4v4weffCJ * here->BSIM4v4nf - * model->BSIM4v4DjctGateSidewallTempSatCurDensity; - } - if (DrainSatCurrent > 0.0) - { switch(model->BSIM4v4dioMod) - { case 0: - if ((model->BSIM4v4bvd / Nvtmd) > EXP_THRESHOLD) - here->BSIM4v4XExpBVD = model->BSIM4v4xjbvd * MIN_EXP; - else - here->BSIM4v4XExpBVD = model->BSIM4v4xjbvd * exp(-model->BSIM4v4bvd / Nvtmd); - break; - case 1: - BSIM4v4DioIjthVjmEval(Nvtmd, model->BSIM4v4ijthdfwd, DrainSatCurrent, - 0.0, &(here->BSIM4v4vjdmFwd)); - here->BSIM4v4IVjdmFwd = DrainSatCurrent * exp(here->BSIM4v4vjdmFwd / Nvtmd); - break; - case 2: - if ((model->BSIM4v4bvd / Nvtmd) > EXP_THRESHOLD) - { here->BSIM4v4XExpBVD = model->BSIM4v4xjbvd * MIN_EXP; - tmp = MIN_EXP; - } - else - { here->BSIM4v4XExpBVD = exp(-model->BSIM4v4bvd / Nvtmd); - tmp = here->BSIM4v4XExpBVD; - here->BSIM4v4XExpBVD *= model->BSIM4v4xjbvd; - } - - BSIM4v4DioIjthVjmEval(Nvtmd, model->BSIM4v4ijthdfwd, DrainSatCurrent, - here->BSIM4v4XExpBVD, &(here->BSIM4v4vjdmFwd)); - T0 = exp(here->BSIM4v4vjdmFwd / Nvtmd); - here->BSIM4v4IVjdmFwd = DrainSatCurrent * (T0 - here->BSIM4v4XExpBVD / T0 - + here->BSIM4v4XExpBVD - 1.0); - here->BSIM4v4DslpFwd = DrainSatCurrent - * (T0 + here->BSIM4v4XExpBVD / T0) / Nvtmd; - - T2 = model->BSIM4v4ijthdrev / DrainSatCurrent; - if (T2 < 1.0) - { T2 = 10.0; - fprintf(stderr, "Warning: ijthdrev too small and set to 10 times IdbSat.\n"); - } - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - here->BSIM4v4vjdmRev = -model->BSIM4v4bvd - - Nvtms * log((T2 - 1.0) / model->BSIM4v4xjbvd); - break; - case BSIM4v30: case BSIM4v40: - here->BSIM4v4vjdmRev = -model->BSIM4v4bvd - - Nvtmd * log((T2 - 1.0) / model->BSIM4v4xjbvd); /* bugfix */ - break; - default: break; - } - T1 = model->BSIM4v4xjbvd * exp(-(model->BSIM4v4bvd - + here->BSIM4v4vjdmRev) / Nvtmd); - here->BSIM4v4IVjdmRev = DrainSatCurrent * (1.0 + T1); - here->BSIM4v4DslpRev = -DrainSatCurrent * T1 / Nvtmd; - break; - default: - printf("Specified dioMod = %d not matched\n", model->BSIM4v4dioMod); - } - } - - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: case BSIM4v30: - break; - case BSIM4v40: - /* GEDL current reverse bias */ - T0 = (TRatio - 1.0); - model->BSIM4v4njtstemp = model->BSIM4v4njts * (1.0 + model->BSIM4v4tnjts * T0); - model->BSIM4v4njtsswtemp = model->BSIM4v4njtssw * (1.0 + model->BSIM4v4tnjtssw * T0); - model->BSIM4v4njtsswgtemp = model->BSIM4v4njtsswg * (1.0 + model->BSIM4v4tnjtsswg * T0); - T7 = Eg0 / model->BSIM4v4vtm * T0; - T9 = model->BSIM4v4xtss * T7; - DEXP(T9, T1); - T9 = model->BSIM4v4xtsd * T7; - DEXP(T9, T2); - T9 = model->BSIM4v4xtssws * T7; - DEXP(T9, T3); - T9 = model->BSIM4v4xtsswd * T7; - DEXP(T9, T4); - T9 = model->BSIM4v4xtsswgs * T7; - DEXP(T9, T5); - T9 = model->BSIM4v4xtsswgd * T7; - DEXP(T9, T6); - - T10 = pParam->BSIM4v4weffCJ * here->BSIM4v4nf; - here->BSIM4v4SjctTempRevSatCur = T1 * here->BSIM4v4Aseff * model->BSIM4v4jtss; - here->BSIM4v4DjctTempRevSatCur = T2 * here->BSIM4v4Adeff * model->BSIM4v4jtsd; - here->BSIM4v4SswTempRevSatCur = T3 * here->BSIM4v4Pseff * model->BSIM4v4jtssws; - here->BSIM4v4DswTempRevSatCur = T4 * here->BSIM4v4Pdeff * model->BSIM4v4jtsswd; - here->BSIM4v4SswgTempRevSatCur = T5 * T10 * model->BSIM4v4jtsswgs; - here->BSIM4v4DswgTempRevSatCur = T6 * T10 * model->BSIM4v4jtsswgd; - break; - default: break; - } - - if (BSIM4v4checkModel(model, here, ckt)) - { - switch (model->BSIM4v4intVersion) { - case BSIM4vOLD: case BSIM4v21: - SPfrontEnd->IFerrorf (ERR_FATAL, "Fatal error(s) detected during BSIM4v4.2.1 parameter checking for %s in model %s", model->BSIM4v4modName, here->BSIM4v4name); - break; - case BSIM4v30: - SPfrontEnd->IFerrorf (ERR_FATAL, "Fatal error(s) detected during BSIM4v4.3.0 parameter checking for %s in model %s", model->BSIM4v4modName, here->BSIM4v4name); - break; - case BSIM4v40: - SPfrontEnd->IFerrorf (ERR_FATAL, "Fatal error(s) detected during BSIM4v4.4.0 parameter checking for %s in model %s", model->BSIM4v4modName, here->BSIM4v4name); - break; - default: break; - } - return(E_BADPARM); - } - } /* End instance */ - } - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/b4v4trunc.c b/src/spicelib/devices/bsim4v4/b4v4trunc.c deleted file mode 100644 index 77acc3c35..000000000 --- a/src/spicelib/devices/bsim4v4/b4v4trunc.c +++ /dev/null @@ -1,57 +0,0 @@ -/**** BSIM4.4.0 Released by Xuemei (Jane) Xi 03/04/2004 ****/ - -/********** - * Copyright 2004 Regents of the University of California. All rights reserved. - * File: b4trunc.c of BSIM4.4.0. - * Author: 2000 Weidong Liu - * Authors: 2001- Xuemei Xi, Jin He, Kanyu Cao, Mohan Dunga, Mansun Chan, Ali Niknejad, Chenming Hu. - * Project Director: Prof. Chenming Hu. - **********/ - -#include "ngspice/ngspice.h" -#include "ngspice/cktdefs.h" -#include "bsim4v4def.h" -#include "ngspice/sperror.h" -#include "ngspice/suffix.h" - -int -BSIM4v4trunc( -GENmodel *inModel, -CKTcircuit *ckt, -double *timeStep) -{ -BSIM4v4model *model = (BSIM4v4model*)inModel; -BSIM4v4instance *here; - -#ifdef STEPDEBUG - double debugtemp; -#endif /* STEPDEBUG */ - - for (; model != NULL; model = model->BSIM4v4nextModel) - { for (here = model->BSIM4v4instances; here != NULL; - here = here->BSIM4v4nextInstance) - { -#ifdef STEPDEBUG - debugtemp = *timeStep; -#endif /* STEPDEBUG */ - CKTterr(here->BSIM4v4qb,ckt,timeStep); - CKTterr(here->BSIM4v4qg,ckt,timeStep); - CKTterr(here->BSIM4v4qd,ckt,timeStep); - if (here->BSIM4v4trnqsMod) - CKTterr(here->BSIM4v4qcdump,ckt,timeStep); - if (here->BSIM4v4rbodyMod) - { CKTterr(here->BSIM4v4qbs,ckt,timeStep); - CKTterr(here->BSIM4v4qbd,ckt,timeStep); - } - if (here->BSIM4v4rgateMod == 3) - CKTterr(here->BSIM4v4qgmid,ckt,timeStep); -#ifdef STEPDEBUG - if(debugtemp != *timeStep) - { printf("device %s reduces step from %g to %g\n", - here->BSIM4v4name,debugtemp,*timeStep); - } -#endif /* STEPDEBUG */ - } - } - return(OK); -} diff --git a/src/spicelib/devices/bsim4v4/bsim4v4def.h b/src/spicelib/devices/bsim4v4/bsim4v4def.h deleted file mode 100644 index 829562f93..000000000 --- a/src/spicelib/devices/bsim4v4/bsim4v4def.h +++ /dev/null @@ -1,2929 +0,0 @@ -/* ngspice multirevision code extension covering 4.2.1 & 4.3.0 & 4.4.0 */ -/********** -Copyright 2004 Regents of the University of California. All rights reserved. -Author: 2000 Weidong Liu. -Modified by Xuemei Xi, 11/15/2002. -Modified by Xuemei Xi, 05/09/2003. -Modified by Xuemei Xi, 03/04/2004. -File: bsim4v4def.h -**********/ - -#ifndef BSIM4V4 -#define BSIM4V4 - -#include "ngspice/ifsim.h" -#include "ngspice/gendefs.h" -#include "ngspice/cktdefs.h" -#include "ngspice/complex.h" -#include "ngspice/noisedef.h" - -typedef struct sBSIM4v4instance -{ - struct sBSIM4v4model *BSIM4v4modPtr; - struct sBSIM4v4instance *BSIM4v4nextInstance; - IFuid BSIM4v4name; - int BSIM4v4states; /* index into state table for this device */ - int BSIM4v4dNode; - int BSIM4v4gNodeExt; - int BSIM4v4sNode; - int BSIM4v4bNode; - int BSIM4v4dNodePrime; - int BSIM4v4gNodePrime; - int BSIM4v4gNodeMid; - int BSIM4v4sNodePrime; - int BSIM4v4bNodePrime; - int BSIM4v4dbNode; - int BSIM4v4sbNode; - int BSIM4v4qNode; - - double BSIM4v4ueff; - double BSIM4v4thetavth; - double BSIM4v4von; - double BSIM4v4vdsat; - double BSIM4v4cgdo; - double BSIM4v4qgdo; - double BSIM4v4cgso; - double BSIM4v4qgso; - double BSIM4v4grbsb; - double BSIM4v4grbdb; - double BSIM4v4grbpb; - double BSIM4v4grbps; - double BSIM4v4grbpd; - - double BSIM4v4vjsmFwd; - double BSIM4v4vjsmRev; - double BSIM4v4vjdmFwd; - double BSIM4v4vjdmRev; - double BSIM4v4XExpBVS; - double BSIM4v4XExpBVD; - double BSIM4v4SslpFwd; - double BSIM4v4SslpRev; - double BSIM4v4DslpFwd; - double BSIM4v4DslpRev; - double BSIM4v4IVjsmFwd; - double BSIM4v4IVjsmRev; - double BSIM4v4IVjdmFwd; - double BSIM4v4IVjdmRev; - - double BSIM4v4grgeltd; - double BSIM4v4Pseff; - double BSIM4v4Pdeff; - double BSIM4v4Aseff; - double BSIM4v4Adeff; - - double BSIM4v4l; - double BSIM4v4w; - double BSIM4v4drainArea; - double BSIM4v4sourceArea; - double BSIM4v4drainSquares; - double BSIM4v4sourceSquares; - double BSIM4v4drainPerimeter; - double BSIM4v4sourcePerimeter; - double BSIM4v4sourceConductance; - double BSIM4v4drainConductance; - /* stress effect instance param */ - double BSIM4v4sa; - double BSIM4v4sb; - double BSIM4v4sd; - - double BSIM4v4rbdb; - double BSIM4v4rbsb; - double BSIM4v4rbpb; - double BSIM4v4rbps; - double BSIM4v4rbpd; - - /* added here to account stress effect instance dependence */ - double BSIM4v4u0temp; - double BSIM4v4vsattemp; - double BSIM4v4vth0; - double BSIM4v4vfb; - double BSIM4v4vfbzb; - double BSIM4v4vtfbphi1; - double BSIM4v4vtfbphi2; - double BSIM4v4k2; - double BSIM4v4vbsc; - double BSIM4v4k2ox; - double BSIM4v4eta0; - - double BSIM4v4icVDS; - double BSIM4v4icVGS; - double BSIM4v4icVBS; - double BSIM4v4nf; - double BSIM4v4m; - int BSIM4v4off; - int BSIM4v4mode; - int BSIM4v4trnqsMod; - int BSIM4v4acnqsMod; - int BSIM4v4rbodyMod; - int BSIM4v4rgateMod; - int BSIM4v4geoMod; - int BSIM4v4rgeoMod; - int BSIM4v4min; - - - /* OP point */ - double BSIM4v4Vgsteff; - double BSIM4v4vgs_eff; - double BSIM4v4vgd_eff; - double BSIM4v4dvgs_eff_dvg; - double BSIM4v4dvgd_eff_dvg; - double BSIM4v4Vdseff; - double BSIM4v4nstar; - double BSIM4v4Abulk; - double BSIM4v4EsatL; - double BSIM4v4AbovVgst2Vtm; - double BSIM4v4qinv; - double BSIM4v4cd; - double BSIM4v4cbs; - double BSIM4v4cbd; - double BSIM4v4csub; - double BSIM4v4Igidl; - double BSIM4v4Igisl; - double BSIM4v4gm; - double BSIM4v4gds; - double BSIM4v4gmbs; - double BSIM4v4gbd; - double BSIM4v4gbs; - - double BSIM4v4gbbs; - double BSIM4v4gbgs; - double BSIM4v4gbds; - double BSIM4v4ggidld; - double BSIM4v4ggidlg; - double BSIM4v4ggidls; - double BSIM4v4ggidlb; - double BSIM4v4ggisld; - double BSIM4v4ggislg; - double BSIM4v4ggisls; - double BSIM4v4ggislb; - - double BSIM4v4Igcs; - double BSIM4v4gIgcsg; - double BSIM4v4gIgcsd; - double BSIM4v4gIgcss; - double BSIM4v4gIgcsb; - double BSIM4v4Igcd; - double BSIM4v4gIgcdg; - double BSIM4v4gIgcdd; - double BSIM4v4gIgcds; - double BSIM4v4gIgcdb; - - double BSIM4v4Igs; - double BSIM4v4gIgsg; - double BSIM4v4gIgss; - double BSIM4v4Igd; - double BSIM4v4gIgdg; - double BSIM4v4gIgdd; - - double BSIM4v4Igb; - double BSIM4v4gIgbg; - double BSIM4v4gIgbd; - double BSIM4v4gIgbs; - double BSIM4v4gIgbb; - - double BSIM4v4grdsw; - double BSIM4v4IdovVds; - double BSIM4v4gcrg; - double BSIM4v4gcrgd; - double BSIM4v4gcrgg; - double BSIM4v4gcrgs; - double BSIM4v4gcrgb; - - double BSIM4v4gstot; - double BSIM4v4gstotd; - double BSIM4v4gstotg; - double BSIM4v4gstots; - double BSIM4v4gstotb; - - double BSIM4v4gdtot; - double BSIM4v4gdtotd; - double BSIM4v4gdtotg; - double BSIM4v4gdtots; - double BSIM4v4gdtotb; - - double BSIM4v4cggb; - double BSIM4v4cgdb; - double BSIM4v4cgsb; - double BSIM4v4cbgb; - double BSIM4v4cbdb; - double BSIM4v4cbsb; - double BSIM4v4cdgb; - double BSIM4v4cddb; - double BSIM4v4cdsb; - double BSIM4v4csgb; - double BSIM4v4csdb; - double BSIM4v4cssb; - double BSIM4v4cgbb; - double BSIM4v4cdbb; - double BSIM4v4csbb; - double BSIM4v4cbbb; - double BSIM4v4capbd; - double BSIM4v4capbs; - - double BSIM4v4cqgb; - double BSIM4v4cqdb; - double BSIM4v4cqsb; - double BSIM4v4cqbb; - - double BSIM4v4qgate; - double BSIM4v4qbulk; - double BSIM4v4qdrn; - double BSIM4v4qsrc; - - double BSIM4v4qchqs; - double BSIM4v4taunet; - double BSIM4v4gtau; - double BSIM4v4gtg; - double BSIM4v4gtd; - double BSIM4v4gts; - double BSIM4v4gtb; - double BSIM4v4SjctTempRevSatCur; - double BSIM4v4DjctTempRevSatCur; - double BSIM4v4SswTempRevSatCur; - double BSIM4v4DswTempRevSatCur; - double BSIM4v4SswgTempRevSatCur; - double BSIM4v4DswgTempRevSatCur; - - struct bsim4SizeDependParam *pParam; - - unsigned BSIM4v4lGiven :1; - unsigned BSIM4v4wGiven :1; - unsigned BSIM4v4mGiven :1; - unsigned BSIM4v4nfGiven :1; - unsigned BSIM4v4minGiven :1; - unsigned BSIM4v4drainAreaGiven :1; - unsigned BSIM4v4sourceAreaGiven :1; - unsigned BSIM4v4drainSquaresGiven :1; - unsigned BSIM4v4sourceSquaresGiven :1; - unsigned BSIM4v4drainPerimeterGiven :1; - unsigned BSIM4v4sourcePerimeterGiven :1; - unsigned BSIM4v4saGiven :1; - unsigned BSIM4v4sbGiven :1; - unsigned BSIM4v4sdGiven :1; - unsigned BSIM4v4rbdbGiven :1; - unsigned BSIM4v4rbsbGiven :1; - unsigned BSIM4v4rbpbGiven :1; - unsigned BSIM4v4rbpdGiven :1; - unsigned BSIM4v4rbpsGiven :1; - unsigned BSIM4v4icVDSGiven :1; - unsigned BSIM4v4icVGSGiven :1; - unsigned BSIM4v4icVBSGiven :1; - unsigned BSIM4v4trnqsModGiven :1; - unsigned BSIM4v4acnqsModGiven :1; - unsigned BSIM4v4rbodyModGiven :1; - unsigned BSIM4v4rgateModGiven :1; - unsigned BSIM4v4geoModGiven :1; - unsigned BSIM4v4rgeoModGiven :1; - - - double *BSIM4v4DPdPtr; - double *BSIM4v4DPdpPtr; - double *BSIM4v4DPgpPtr; - double *BSIM4v4DPgmPtr; - double *BSIM4v4DPspPtr; - double *BSIM4v4DPbpPtr; - double *BSIM4v4DPdbPtr; - - double *BSIM4v4DdPtr; - double *BSIM4v4DdpPtr; - - double *BSIM4v4GPdpPtr; - double *BSIM4v4GPgpPtr; - double *BSIM4v4GPgmPtr; - double *BSIM4v4GPgePtr; - double *BSIM4v4GPspPtr; - double *BSIM4v4GPbpPtr; - - double *BSIM4v4GMdpPtr; - double *BSIM4v4GMgpPtr; - double *BSIM4v4GMgmPtr; - double *BSIM4v4GMgePtr; - double *BSIM4v4GMspPtr; - double *BSIM4v4GMbpPtr; - - double *BSIM4v4GEdpPtr; - double *BSIM4v4GEgpPtr; - double *BSIM4v4GEgmPtr; - double *BSIM4v4GEgePtr; - double *BSIM4v4GEspPtr; - double *BSIM4v4GEbpPtr; - - double *BSIM4v4SPdpPtr; - double *BSIM4v4SPgpPtr; - double *BSIM4v4SPgmPtr; - double *BSIM4v4SPsPtr; - double *BSIM4v4SPspPtr; - double *BSIM4v4SPbpPtr; - double *BSIM4v4SPsbPtr; - - double *BSIM4v4SspPtr; - double *BSIM4v4SsPtr; - - double *BSIM4v4BPdpPtr; - double *BSIM4v4BPgpPtr; - double *BSIM4v4BPgmPtr; - double *BSIM4v4BPspPtr; - double *BSIM4v4BPdbPtr; - double *BSIM4v4BPbPtr; - double *BSIM4v4BPsbPtr; - double *BSIM4v4BPbpPtr; - - double *BSIM4v4DBdpPtr; - double *BSIM4v4DBdbPtr; - double *BSIM4v4DBbpPtr; - double *BSIM4v4DBbPtr; - - double *BSIM4v4SBspPtr; - double *BSIM4v4SBbpPtr; - double *BSIM4v4SBbPtr; - double *BSIM4v4SBsbPtr; - - double *BSIM4v4BdbPtr; - double *BSIM4v4BbpPtr; - double *BSIM4v4BsbPtr; - double *BSIM4v4BbPtr; - - double *BSIM4v4DgpPtr; - double *BSIM4v4DspPtr; - double *BSIM4v4DbpPtr; - double *BSIM4v4SdpPtr; - double *BSIM4v4SgpPtr; - double *BSIM4v4SbpPtr; - - double *BSIM4v4QdpPtr; - double *BSIM4v4QgpPtr; - double *BSIM4v4QspPtr; - double *BSIM4v4QbpPtr; - double *BSIM4v4QqPtr; - double *BSIM4v4DPqPtr; - double *BSIM4v4GPqPtr; - double *BSIM4v4SPqPtr; - - -#define BSIM4v4vbd BSIM4v4states+ 0 -#define BSIM4v4vbs BSIM4v4states+ 1 -#define BSIM4v4vgs BSIM4v4states+ 2 -#define BSIM4v4vds BSIM4v4states+ 3 -#define BSIM4v4vdbs BSIM4v4states+ 4 -#define BSIM4v4vdbd BSIM4v4states+ 5 -#define BSIM4v4vsbs BSIM4v4states+ 6 -#define BSIM4v4vges BSIM4v4states+ 7 -#define BSIM4v4vgms BSIM4v4states+ 8 -#define BSIM4v4vses BSIM4v4states+ 9 -#define BSIM4v4vdes BSIM4v4states+ 10 - -#define BSIM4v4qb BSIM4v4states+ 11 -#define BSIM4v4cqb BSIM4v4states+ 12 -#define BSIM4v4qg BSIM4v4states+ 13 -#define BSIM4v4cqg BSIM4v4states+ 14 -#define BSIM4v4qd BSIM4v4states+ 15 -#define BSIM4v4cqd BSIM4v4states+ 16 -#define BSIM4v4qgmid BSIM4v4states+ 17 -#define BSIM4v4cqgmid BSIM4v4states+ 18 - -#define BSIM4v4qbs BSIM4v4states+ 19 -#define BSIM4v4cqbs BSIM4v4states+ 20 -#define BSIM4v4qbd BSIM4v4states+ 21 -#define BSIM4v4cqbd BSIM4v4states+ 22 - -#define BSIM4v4qcheq BSIM4v4states+ 23 -#define BSIM4v4cqcheq BSIM4v4states+ 24 -#define BSIM4v4qcdump BSIM4v4states+ 25 -#define BSIM4v4cqcdump BSIM4v4states+ 26 -#define BSIM4v4qdef BSIM4v4states+ 27 -#define BSIM4v4qs BSIM4v4states+ 28 - -#define BSIM4v4numStates 29 - - -/* indices to the array of BSIM4v4 NOISE SOURCES */ - -#define BSIM4v4RDNOIZ 0 -#define BSIM4v4RSNOIZ 1 -#define BSIM4v4RGNOIZ 2 -#define BSIM4v4RBPSNOIZ 3 -#define BSIM4v4RBPDNOIZ 4 -#define BSIM4v4RBPBNOIZ 5 -#define BSIM4v4RBSBNOIZ 6 -#define BSIM4v4RBDBNOIZ 7 -#define BSIM4v4IDNOIZ 8 -#define BSIM4v4FLNOIZ 9 -#define BSIM4v4IGSNOIZ 10 -#define BSIM4v4IGDNOIZ 11 -#define BSIM4v4IGBNOIZ 12 -#define BSIM4v4TOTNOIZ 13 - -#define BSIM4v4NSRCS 14 /* Number of BSIM4v4 noise sources */ - -#ifndef NONOISE - double BSIM4v4nVar[NSTATVARS][BSIM4v4NSRCS]; -#else /* NONOISE */ - double **BSIM4v4nVar; -#endif /* NONOISE */ - -} BSIM4v4instance ; - -struct bsim4SizeDependParam -{ - double Width; - double Length; - double NFinger; - - double BSIM4v4cdsc; - double BSIM4v4cdscb; - double BSIM4v4cdscd; - double BSIM4v4cit; - double BSIM4v4nfactor; - double BSIM4v4xj; - double BSIM4v4vsat; - double BSIM4v4at; - double BSIM4v4a0; - double BSIM4v4ags; - double BSIM4v4a1; - double BSIM4v4a2; - double BSIM4v4keta; - double BSIM4v4nsub; - double BSIM4v4ndep; - double BSIM4v4nsd; - double BSIM4v4phin; - double BSIM4v4ngate; - double BSIM4v4gamma1; - double BSIM4v4gamma2; - double BSIM4v4vbx; - double BSIM4v4vbi; - double BSIM4v4vbm; - double BSIM4v4vbsc; - double BSIM4v4xt; - double BSIM4v4phi; - double BSIM4v4litl; - double BSIM4v4k1; - double BSIM4v4kt1; - double BSIM4v4kt1l; - double BSIM4v4kt2; - double BSIM4v4k2; - double BSIM4v4k3; - double BSIM4v4k3b; - double BSIM4v4w0; - double BSIM4v4dvtp0; - double BSIM4v4dvtp1; - double BSIM4v4lpe0; - double BSIM4v4lpeb; - double BSIM4v4dvt0; - double BSIM4v4dvt1; - double BSIM4v4dvt2; - double BSIM4v4dvt0w; - double BSIM4v4dvt1w; - double BSIM4v4dvt2w; - double BSIM4v4drout; - double BSIM4v4dsub; - double BSIM4v4vth0; - double BSIM4v4ua; - double BSIM4v4ua1; - double BSIM4v4ub; - double BSIM4v4ub1; - double BSIM4v4uc; - double BSIM4v4uc1; - double BSIM4v4u0; - double BSIM4v4eu; - double BSIM4v4ute; - double BSIM4v4voff; - double BSIM4v4minv; - double BSIM4v4vfb; - double BSIM4v4delta; - double BSIM4v4rdsw; - double BSIM4v4rds0; - double BSIM4v4rs0; - double BSIM4v4rd0; - double BSIM4v4rsw; - double BSIM4v4rdw; - double BSIM4v4prwg; - double BSIM4v4prwb; - double BSIM4v4prt; - double BSIM4v4eta0; - double BSIM4v4etab; - double BSIM4v4pclm; - double BSIM4v4pdibl1; - double BSIM4v4pdibl2; - double BSIM4v4pdiblb; - double BSIM4v4fprout; - double BSIM4v4pdits; - double BSIM4v4pditsd; - double BSIM4v4pscbe1; - double BSIM4v4pscbe2; - double BSIM4v4pvag; - double BSIM4v4wr; - double BSIM4v4dwg; - double BSIM4v4dwb; - double BSIM4v4b0; - double BSIM4v4b1; - double BSIM4v4alpha0; - double BSIM4v4alpha1; - double BSIM4v4beta0; - double BSIM4v4agidl; - double BSIM4v4bgidl; - double BSIM4v4cgidl; - double BSIM4v4egidl; - double BSIM4v4aigc; - double BSIM4v4bigc; - double BSIM4v4cigc; - double BSIM4v4aigsd; - double BSIM4v4bigsd; - double BSIM4v4cigsd; - double BSIM4v4aigbacc; - double BSIM4v4bigbacc; - double BSIM4v4cigbacc; - double BSIM4v4aigbinv; - double BSIM4v4bigbinv; - double BSIM4v4cigbinv; - double BSIM4v4nigc; - double BSIM4v4nigbacc; - double BSIM4v4nigbinv; - double BSIM4v4ntox; - double BSIM4v4eigbinv; - double BSIM4v4pigcd; - double BSIM4v4poxedge; - double BSIM4v4xrcrg1; - double BSIM4v4xrcrg2; - double BSIM4v4lambda; /* overshoot */ - double BSIM4v4vtl; /* thermal velocity limit */ - double BSIM4v4xn; /* back scattering parameter */ - double BSIM4v4lc; /* back scattering parameter */ - double BSIM4v4tfactor; /* ballistic transportation factor */ - double BSIM4v4vfbsdoff; /* S/D flatband offset voltage */ - -/* added for stress effect */ - double BSIM4v4ku0; - double BSIM4v4kvth0; - double BSIM4v4ku0temp; - double BSIM4v4rho_ref; - double BSIM4v4inv_od_ref; - - /* CV model */ - double BSIM4v4cgsl; - double BSIM4v4cgdl; - double BSIM4v4ckappas; - double BSIM4v4ckappad; - double BSIM4v4cf; - double BSIM4v4clc; - double BSIM4v4cle; - double BSIM4v4vfbcv; - double BSIM4v4noff; - double BSIM4v4voffcv; - double BSIM4v4acde; - double BSIM4v4moin; - -/* Pre-calculated constants */ - - double BSIM4v4dw; - double BSIM4v4dl; - double BSIM4v4leff; - double BSIM4v4weff; - - double BSIM4v4dwc; - double BSIM4v4dlc; - double BSIM4v4dlcig; - double BSIM4v4dwj; - double BSIM4v4leffCV; - double BSIM4v4weffCV; - double BSIM4v4weffCJ; - double BSIM4v4abulkCVfactor; - double BSIM4v4cgso; - double BSIM4v4cgdo; - double BSIM4v4cgbo; - - double BSIM4v4u0temp; - double BSIM4v4vsattemp; - double BSIM4v4sqrtPhi; - double BSIM4v4phis3; - double BSIM4v4Xdep0; - double BSIM4v4sqrtXdep0; - double BSIM4v4theta0vb0; - double BSIM4v4thetaRout; - double BSIM4v4mstar; - double BSIM4v4voffcbn; - double BSIM4v4rdswmin; - double BSIM4v4rdwmin; - double BSIM4v4rswmin; - double BSIM4v4vfbsd; - - double BSIM4v4cof1; - double BSIM4v4cof2; - double BSIM4v4cof3; - double BSIM4v4cof4; - double BSIM4v4cdep0; - double BSIM4v4vfbzb; - double BSIM4v4vtfbphi1; - double BSIM4v4vtfbphi2; - double BSIM4v4ToxRatio; - double BSIM4v4Aechvb; - double BSIM4v4Bechvb; - double BSIM4v4ToxRatioEdge; - double BSIM4v4AechvbEdge; - double BSIM4v4BechvbEdge; - double BSIM4v4ldeb; - double BSIM4v4k1ox; - double BSIM4v4k2ox; - - struct bsim4SizeDependParam *pNext; -}; - - -typedef struct sBSIM4v4model -{ - int BSIM4v4modType; - struct sBSIM4v4model *BSIM4v4nextModel; - BSIM4v4instance *BSIM4v4instances; - IFuid BSIM4v4modName; - - /* --- end of generic struct GENmodel --- */ - - int BSIM4v4type; - - int BSIM4v4mobMod; - int BSIM4v4capMod; - int BSIM4v4dioMod; - int BSIM4v4trnqsMod; - int BSIM4v4acnqsMod; - int BSIM4v4fnoiMod; - int BSIM4v4tnoiMod; - int BSIM4v4rdsMod; - int BSIM4v4rbodyMod; - int BSIM4v4rgateMod; - int BSIM4v4perMod; - int BSIM4v4geoMod; - int BSIM4v4igcMod; - int BSIM4v4igbMod; - int BSIM4v4tempMod; - int BSIM4v4binUnit; - int BSIM4v4paramChk; - char *BSIM4v4version; - /* The following field is an integer coding - * of BSIM4 Versions. - */ - int BSIM4v4intVersion; -#define BSIM4v40 440 /* BSIM4.4.0 */ -#define BSIM4v30 430 /* BSIM4.3.0 */ -#define BSIM4v21 421 /* BSIM4.2.1 */ -#define BSIM4vOLD 420 /* < BSIM4.2.1 */ - double BSIM4v4toxe; - double BSIM4v4toxp; - double BSIM4v4toxm; - double BSIM4v4dtox; - double BSIM4v4epsrox; - double BSIM4v4cdsc; - double BSIM4v4cdscb; - double BSIM4v4cdscd; - double BSIM4v4cit; - double BSIM4v4nfactor; - double BSIM4v4xj; - double BSIM4v4vsat; - double BSIM4v4at; - double BSIM4v4a0; - double BSIM4v4ags; - double BSIM4v4a1; - double BSIM4v4a2; - double BSIM4v4keta; - double BSIM4v4nsub; - double BSIM4v4ndep; - double BSIM4v4nsd; - double BSIM4v4phin; - double BSIM4v4ngate; - double BSIM4v4gamma1; - double BSIM4v4gamma2; - double BSIM4v4vbx; - double BSIM4v4vbm; - double BSIM4v4xt; - double BSIM4v4k1; - double BSIM4v4kt1; - double BSIM4v4kt1l; - double BSIM4v4kt2; - double BSIM4v4k2; - double BSIM4v4k3; - double BSIM4v4k3b; - double BSIM4v4w0; - double BSIM4v4dvtp0; - double BSIM4v4dvtp1; - double BSIM4v4lpe0; - double BSIM4v4lpeb; - double BSIM4v4dvt0; - double BSIM4v4dvt1; - double BSIM4v4dvt2; - double BSIM4v4dvt0w; - double BSIM4v4dvt1w; - double BSIM4v4dvt2w; - double BSIM4v4drout; - double BSIM4v4dsub; - double BSIM4v4vth0; - double BSIM4v4eu; - double BSIM4v4ua; - double BSIM4v4ua1; - double BSIM4v4ub; - double BSIM4v4ub1; - double BSIM4v4uc; - double BSIM4v4uc1; - double BSIM4v4u0; - double BSIM4v4ute; - double BSIM4v4voff; - double BSIM4v4minv; - double BSIM4v4voffl; - double BSIM4v4delta; - double BSIM4v4rdsw; - double BSIM4v4rdswmin; - double BSIM4v4rdwmin; - double BSIM4v4rswmin; - double BSIM4v4rsw; - double BSIM4v4rdw; - double BSIM4v4prwg; - double BSIM4v4prwb; - double BSIM4v4prt; - double BSIM4v4eta0; - double BSIM4v4etab; - double BSIM4v4pclm; - double BSIM4v4pdibl1; - double BSIM4v4pdibl2; - double BSIM4v4pdiblb; - double BSIM4v4fprout; - double BSIM4v4pdits; - double BSIM4v4pditsd; - double BSIM4v4pditsl; - double BSIM4v4pscbe1; - double BSIM4v4pscbe2; - double BSIM4v4pvag; - double BSIM4v4wr; - double BSIM4v4dwg; - double BSIM4v4dwb; - double BSIM4v4b0; - double BSIM4v4b1; - double BSIM4v4alpha0; - double BSIM4v4alpha1; - double BSIM4v4beta0; - double BSIM4v4agidl; - double BSIM4v4bgidl; - double BSIM4v4cgidl; - double BSIM4v4egidl; - double BSIM4v4aigc; - double BSIM4v4bigc; - double BSIM4v4cigc; - double BSIM4v4aigsd; - double BSIM4v4bigsd; - double BSIM4v4cigsd; - double BSIM4v4aigbacc; - double BSIM4v4bigbacc; - double BSIM4v4cigbacc; - double BSIM4v4aigbinv; - double BSIM4v4bigbinv; - double BSIM4v4cigbinv; - double BSIM4v4nigc; - double BSIM4v4nigbacc; - double BSIM4v4nigbinv; - double BSIM4v4ntox; - double BSIM4v4eigbinv; - double BSIM4v4pigcd; - double BSIM4v4poxedge; - double BSIM4v4toxref; - double BSIM4v4ijthdfwd; - double BSIM4v4ijthsfwd; - double BSIM4v4ijthdrev; - double BSIM4v4ijthsrev; - double BSIM4v4xjbvd; - double BSIM4v4xjbvs; - double BSIM4v4bvd; - double BSIM4v4bvs; - - double BSIM4v4jtss; - double BSIM4v4jtsd; - double BSIM4v4jtssws; - double BSIM4v4jtsswd; - double BSIM4v4jtsswgs; - double BSIM4v4jtsswgd; - double BSIM4v4njts; - double BSIM4v4njtssw; - double BSIM4v4njtsswg; - double BSIM4v4xtss; - double BSIM4v4xtsd; - double BSIM4v4xtssws; - double BSIM4v4xtsswd; - double BSIM4v4xtsswgs; - double BSIM4v4xtsswgd; - double BSIM4v4tnjts; - double BSIM4v4tnjtssw; - double BSIM4v4tnjtsswg; - double BSIM4v4vtss; - double BSIM4v4vtsd; - double BSIM4v4vtssws; - double BSIM4v4vtsswd; - double BSIM4v4vtsswgs; - double BSIM4v4vtsswgd; - - double BSIM4v4xrcrg1; - double BSIM4v4xrcrg2; - double BSIM4v4lambda; - double BSIM4v4vtl; - double BSIM4v4lc; - double BSIM4v4xn; - double BSIM4v4vfbsdoff; /* S/D flatband offset voltage */ - double BSIM4v4lintnoi; /* lint offset for noise calculation */ - - double BSIM4v4vfb; - double BSIM4v4gbmin; - double BSIM4v4rbdb; - double BSIM4v4rbsb; - double BSIM4v4rbpb; - double BSIM4v4rbps; - double BSIM4v4rbpd; - double BSIM4v4tnoia; - double BSIM4v4tnoib; - double BSIM4v4rnoia; - double BSIM4v4rnoib; - double BSIM4v4ntnoi; - - /* CV model and Parasitics */ - double BSIM4v4cgsl; - double BSIM4v4cgdl; - double BSIM4v4ckappas; - double BSIM4v4ckappad; - double BSIM4v4cf; - double BSIM4v4vfbcv; - double BSIM4v4clc; - double BSIM4v4cle; - double BSIM4v4dwc; - double BSIM4v4dlc; - double BSIM4v4xw; - double BSIM4v4xl; - double BSIM4v4dlcig; - double BSIM4v4dwj; - double BSIM4v4noff; - double BSIM4v4voffcv; - double BSIM4v4acde; - double BSIM4v4moin; - double BSIM4v4tcj; - double BSIM4v4tcjsw; - double BSIM4v4tcjswg; - double BSIM4v4tpb; - double BSIM4v4tpbsw; - double BSIM4v4tpbswg; - double BSIM4v4dmcg; - double BSIM4v4dmci; - double BSIM4v4dmdg; - double BSIM4v4dmcgt; - double BSIM4v4xgw; - double BSIM4v4xgl; - double BSIM4v4rshg; - double BSIM4v4ngcon; - - /* Length Dependence */ - double BSIM4v4lcdsc; - double BSIM4v4lcdscb; - double BSIM4v4lcdscd; - double BSIM4v4lcit; - double BSIM4v4lnfactor; - double BSIM4v4lxj; - double BSIM4v4lvsat; - double BSIM4v4lat; - double BSIM4v4la0; - double BSIM4v4lags; - double BSIM4v4la1; - double BSIM4v4la2; - double BSIM4v4lketa; - double BSIM4v4lnsub; - double BSIM4v4lndep; - double BSIM4v4lnsd; - double BSIM4v4lphin; - double BSIM4v4lngate; - double BSIM4v4lgamma1; - double BSIM4v4lgamma2; - double BSIM4v4lvbx; - double BSIM4v4lvbm; - double BSIM4v4lxt; - double BSIM4v4lk1; - double BSIM4v4lkt1; - double BSIM4v4lkt1l; - double BSIM4v4lkt2; - double BSIM4v4lk2; - double BSIM4v4lk3; - double BSIM4v4lk3b; - double BSIM4v4lw0; - double BSIM4v4ldvtp0; - double BSIM4v4ldvtp1; - double BSIM4v4llpe0; - double BSIM4v4llpeb; - double BSIM4v4ldvt0; - double BSIM4v4ldvt1; - double BSIM4v4ldvt2; - double BSIM4v4ldvt0w; - double BSIM4v4ldvt1w; - double BSIM4v4ldvt2w; - double BSIM4v4ldrout; - double BSIM4v4ldsub; - double BSIM4v4lvth0; - double BSIM4v4lua; - double BSIM4v4lua1; - double BSIM4v4lub; - double BSIM4v4lub1; - double BSIM4v4luc; - double BSIM4v4luc1; - double BSIM4v4lu0; - double BSIM4v4leu; - double BSIM4v4lute; - double BSIM4v4lvoff; - double BSIM4v4lminv; - double BSIM4v4ldelta; - double BSIM4v4lrdsw; - double BSIM4v4lrsw; - double BSIM4v4lrdw; - double BSIM4v4lprwg; - double BSIM4v4lprwb; - double BSIM4v4lprt; - double BSIM4v4leta0; - double BSIM4v4letab; - double BSIM4v4lpclm; - double BSIM4v4lpdibl1; - double BSIM4v4lpdibl2; - double BSIM4v4lpdiblb; - double BSIM4v4lfprout; - double BSIM4v4lpdits; - double BSIM4v4lpditsd; - double BSIM4v4lpscbe1; - double BSIM4v4lpscbe2; - double BSIM4v4lpvag; - double BSIM4v4lwr; - double BSIM4v4ldwg; - double BSIM4v4ldwb; - double BSIM4v4lb0; - double BSIM4v4lb1; - double BSIM4v4lalpha0; - double BSIM4v4lalpha1; - double BSIM4v4lbeta0; - double BSIM4v4lvfb; - double BSIM4v4lagidl; - double BSIM4v4lbgidl; - double BSIM4v4lcgidl; - double BSIM4v4legidl; - double BSIM4v4laigc; - double BSIM4v4lbigc; - double BSIM4v4lcigc; - double BSIM4v4laigsd; - double BSIM4v4lbigsd; - double BSIM4v4lcigsd; - double BSIM4v4laigbacc; - double BSIM4v4lbigbacc; - double BSIM4v4lcigbacc; - double BSIM4v4laigbinv; - double BSIM4v4lbigbinv; - double BSIM4v4lcigbinv; - double BSIM4v4lnigc; - double BSIM4v4lnigbacc; - double BSIM4v4lnigbinv; - double BSIM4v4lntox; - double BSIM4v4leigbinv; - double BSIM4v4lpigcd; - double BSIM4v4lpoxedge; - double BSIM4v4lxrcrg1; - double BSIM4v4lxrcrg2; - double BSIM4v4llambda; - double BSIM4v4lvtl; - double BSIM4v4lxn; - double BSIM4v4lvfbsdoff; - - /* CV model */ - double BSIM4v4lcgsl; - double BSIM4v4lcgdl; - double BSIM4v4lckappas; - double BSIM4v4lckappad; - double BSIM4v4lcf; - double BSIM4v4lclc; - double BSIM4v4lcle; - double BSIM4v4lvfbcv; - double BSIM4v4lnoff; - double BSIM4v4lvoffcv; - double BSIM4v4lacde; - double BSIM4v4lmoin; - - /* Width Dependence */ - double BSIM4v4wcdsc; - double BSIM4v4wcdscb; - double BSIM4v4wcdscd; - double BSIM4v4wcit; - double BSIM4v4wnfactor; - double BSIM4v4wxj; - double BSIM4v4wvsat; - double BSIM4v4wat; - double BSIM4v4wa0; - double BSIM4v4wags; - double BSIM4v4wa1; - double BSIM4v4wa2; - double BSIM4v4wketa; - double BSIM4v4wnsub; - double BSIM4v4wndep; - double BSIM4v4wnsd; - double BSIM4v4wphin; - double BSIM4v4wngate; - double BSIM4v4wgamma1; - double BSIM4v4wgamma2; - double BSIM4v4wvbx; - double BSIM4v4wvbm; - double BSIM4v4wxt; - double BSIM4v4wk1; - double BSIM4v4wkt1; - double BSIM4v4wkt1l; - double BSIM4v4wkt2; - double BSIM4v4wk2; - double BSIM4v4wk3; - double BSIM4v4wk3b; - double BSIM4v4ww0; - double BSIM4v4wdvtp0; - double BSIM4v4wdvtp1; - double BSIM4v4wlpe0; - double BSIM4v4wlpeb; - double BSIM4v4wdvt0; - double BSIM4v4wdvt1; - double BSIM4v4wdvt2; - double BSIM4v4wdvt0w; - double BSIM4v4wdvt1w; - double BSIM4v4wdvt2w; - double BSIM4v4wdrout; - double BSIM4v4wdsub; - double BSIM4v4wvth0; - double BSIM4v4wua; - double BSIM4v4wua1; - double BSIM4v4wub; - double BSIM4v4wub1; - double BSIM4v4wuc; - double BSIM4v4wuc1; - double BSIM4v4wu0; - double BSIM4v4weu; - double BSIM4v4wute; - double BSIM4v4wvoff; - double BSIM4v4wminv; - double BSIM4v4wdelta; - double BSIM4v4wrdsw; - double BSIM4v4wrsw; - double BSIM4v4wrdw; - double BSIM4v4wprwg; - double BSIM4v4wprwb; - double BSIM4v4wprt; - double BSIM4v4weta0; - double BSIM4v4wetab; - double BSIM4v4wpclm; - double BSIM4v4wpdibl1; - double BSIM4v4wpdibl2; - double BSIM4v4wpdiblb; - double BSIM4v4wfprout; - double BSIM4v4wpdits; - double BSIM4v4wpditsd; - double BSIM4v4wpscbe1; - double BSIM4v4wpscbe2; - double BSIM4v4wpvag; - double BSIM4v4wwr; - double BSIM4v4wdwg; - double BSIM4v4wdwb; - double BSIM4v4wb0; - double BSIM4v4wb1; - double BSIM4v4walpha0; - double BSIM4v4walpha1; - double BSIM4v4wbeta0; - double BSIM4v4wvfb; - double BSIM4v4wagidl; - double BSIM4v4wbgidl; - double BSIM4v4wcgidl; - double BSIM4v4wegidl; - double BSIM4v4waigc; - double BSIM4v4wbigc; - double BSIM4v4wcigc; - double BSIM4v4waigsd; - double BSIM4v4wbigsd; - double BSIM4v4wcigsd; - double BSIM4v4waigbacc; - double BSIM4v4wbigbacc; - double BSIM4v4wcigbacc; - double BSIM4v4waigbinv; - double BSIM4v4wbigbinv; - double BSIM4v4wcigbinv; - double BSIM4v4wnigc; - double BSIM4v4wnigbacc; - double BSIM4v4wnigbinv; - double BSIM4v4wntox; - double BSIM4v4weigbinv; - double BSIM4v4wpigcd; - double BSIM4v4wpoxedge; - double BSIM4v4wxrcrg1; - double BSIM4v4wxrcrg2; - double BSIM4v4wlambda; - double BSIM4v4wvtl; - double BSIM4v4wxn; - double BSIM4v4wvfbsdoff; - - /* CV model */ - double BSIM4v4wcgsl; - double BSIM4v4wcgdl; - double BSIM4v4wckappas; - double BSIM4v4wckappad; - double BSIM4v4wcf; - double BSIM4v4wclc; - double BSIM4v4wcle; - double BSIM4v4wvfbcv; - double BSIM4v4wnoff; - double BSIM4v4wvoffcv; - double BSIM4v4wacde; - double BSIM4v4wmoin; - - /* Cross-term Dependence */ - double BSIM4v4pcdsc; - double BSIM4v4pcdscb; - double BSIM4v4pcdscd; - double BSIM4v4pcit; - double BSIM4v4pnfactor; - double BSIM4v4pxj; - double BSIM4v4pvsat; - double BSIM4v4pat; - double BSIM4v4pa0; - double BSIM4v4pags; - double BSIM4v4pa1; - double BSIM4v4pa2; - double BSIM4v4pketa; - double BSIM4v4pnsub; - double BSIM4v4pndep; - double BSIM4v4pnsd; - double BSIM4v4pphin; - double BSIM4v4pngate; - double BSIM4v4pgamma1; - double BSIM4v4pgamma2; - double BSIM4v4pvbx; - double BSIM4v4pvbm; - double BSIM4v4pxt; - double BSIM4v4pk1; - double BSIM4v4pkt1; - double BSIM4v4pkt1l; - double BSIM4v4pkt2; - double BSIM4v4pk2; - double BSIM4v4pk3; - double BSIM4v4pk3b; - double BSIM4v4pw0; - double BSIM4v4pdvtp0; - double BSIM4v4pdvtp1; - double BSIM4v4plpe0; - double BSIM4v4plpeb; - double BSIM4v4pdvt0; - double BSIM4v4pdvt1; - double BSIM4v4pdvt2; - double BSIM4v4pdvt0w; - double BSIM4v4pdvt1w; - double BSIM4v4pdvt2w; - double BSIM4v4pdrout; - double BSIM4v4pdsub; - double BSIM4v4pvth0; - double BSIM4v4pua; - double BSIM4v4pua1; - double BSIM4v4pub; - double BSIM4v4pub1; - double BSIM4v4puc; - double BSIM4v4puc1; - double BSIM4v4pu0; - double BSIM4v4peu; - double BSIM4v4pute; - double BSIM4v4pvoff; - double BSIM4v4pminv; - double BSIM4v4pdelta; - double BSIM4v4prdsw; - double BSIM4v4prsw; - double BSIM4v4prdw; - double BSIM4v4pprwg; - double BSIM4v4pprwb; - double BSIM4v4pprt; - double BSIM4v4peta0; - double BSIM4v4petab; - double BSIM4v4ppclm; - double BSIM4v4ppdibl1; - double BSIM4v4ppdibl2; - double BSIM4v4ppdiblb; - double BSIM4v4pfprout; - double BSIM4v4ppdits; - double BSIM4v4ppditsd; - double BSIM4v4ppscbe1; - double BSIM4v4ppscbe2; - double BSIM4v4ppvag; - double BSIM4v4pwr; - double BSIM4v4pdwg; - double BSIM4v4pdwb; - double BSIM4v4pb0; - double BSIM4v4pb1; - double BSIM4v4palpha0; - double BSIM4v4palpha1; - double BSIM4v4pbeta0; - double BSIM4v4pvfb; - double BSIM4v4pagidl; - double BSIM4v4pbgidl; - double BSIM4v4pcgidl; - double BSIM4v4pegidl; - double BSIM4v4paigc; - double BSIM4v4pbigc; - double BSIM4v4pcigc; - double BSIM4v4paigsd; - double BSIM4v4pbigsd; - double BSIM4v4pcigsd; - double BSIM4v4paigbacc; - double BSIM4v4pbigbacc; - double BSIM4v4pcigbacc; - double BSIM4v4paigbinv; - double BSIM4v4pbigbinv; - double BSIM4v4pcigbinv; - double BSIM4v4pnigc; - double BSIM4v4pnigbacc; - double BSIM4v4pnigbinv; - double BSIM4v4pntox; - double BSIM4v4peigbinv; - double BSIM4v4ppigcd; - double BSIM4v4ppoxedge; - double BSIM4v4pxrcrg1; - double BSIM4v4pxrcrg2; - double BSIM4v4plambda; - double BSIM4v4pvtl; - double BSIM4v4pxn; - double BSIM4v4pvfbsdoff; - - /* CV model */ - double BSIM4v4pcgsl; - double BSIM4v4pcgdl; - double BSIM4v4pckappas; - double BSIM4v4pckappad; - double BSIM4v4pcf; - double BSIM4v4pclc; - double BSIM4v4pcle; - double BSIM4v4pvfbcv; - double BSIM4v4pnoff; - double BSIM4v4pvoffcv; - double BSIM4v4pacde; - double BSIM4v4pmoin; - - double BSIM4v4tnom; - double BSIM4v4cgso; - double BSIM4v4cgdo; - double BSIM4v4cgbo; - double BSIM4v4xpart; - double BSIM4v4cFringOut; - double BSIM4v4cFringMax; - - double BSIM4v4sheetResistance; - double BSIM4v4SjctSatCurDensity; - double BSIM4v4DjctSatCurDensity; - double BSIM4v4SjctSidewallSatCurDensity; - double BSIM4v4DjctSidewallSatCurDensity; - double BSIM4v4SjctGateSidewallSatCurDensity; - double BSIM4v4DjctGateSidewallSatCurDensity; - double BSIM4v4SbulkJctPotential; - double BSIM4v4DbulkJctPotential; - double BSIM4v4SbulkJctBotGradingCoeff; - double BSIM4v4DbulkJctBotGradingCoeff; - double BSIM4v4SbulkJctSideGradingCoeff; - double BSIM4v4DbulkJctSideGradingCoeff; - double BSIM4v4SbulkJctGateSideGradingCoeff; - double BSIM4v4DbulkJctGateSideGradingCoeff; - double BSIM4v4SsidewallJctPotential; - double BSIM4v4DsidewallJctPotential; - double BSIM4v4SGatesidewallJctPotential; - double BSIM4v4DGatesidewallJctPotential; - double BSIM4v4SunitAreaJctCap; - double BSIM4v4DunitAreaJctCap; - double BSIM4v4SunitLengthSidewallJctCap; - double BSIM4v4DunitLengthSidewallJctCap; - double BSIM4v4SunitLengthGateSidewallJctCap; - double BSIM4v4DunitLengthGateSidewallJctCap; - double BSIM4v4SjctEmissionCoeff; - double BSIM4v4DjctEmissionCoeff; - double BSIM4v4SjctTempExponent; - double BSIM4v4DjctTempExponent; - double BSIM4v4njtstemp; - double BSIM4v4njtsswtemp; - double BSIM4v4njtsswgtemp; - - double BSIM4v4Lint; - double BSIM4v4Ll; - double BSIM4v4Llc; - double BSIM4v4Lln; - double BSIM4v4Lw; - double BSIM4v4Lwc; - double BSIM4v4Lwn; - double BSIM4v4Lwl; - double BSIM4v4Lwlc; - double BSIM4v4Lmin; - double BSIM4v4Lmax; - - double BSIM4v4Wint; - double BSIM4v4Wl; - double BSIM4v4Wlc; - double BSIM4v4Wln; - double BSIM4v4Ww; - double BSIM4v4Wwc; - double BSIM4v4Wwn; - double BSIM4v4Wwl; - double BSIM4v4Wwlc; - double BSIM4v4Wmin; - double BSIM4v4Wmax; - - /* added for stress effect */ - double BSIM4v4saref; - double BSIM4v4sbref; - double BSIM4v4wlod; - double BSIM4v4ku0; - double BSIM4v4kvsat; - double BSIM4v4kvth0; - double BSIM4v4tku0; - double BSIM4v4llodku0; - double BSIM4v4wlodku0; - double BSIM4v4llodvth; - double BSIM4v4wlodvth; - double BSIM4v4lku0; - double BSIM4v4wku0; - double BSIM4v4pku0; - double BSIM4v4lkvth0; - double BSIM4v4wkvth0; - double BSIM4v4pkvth0; - double BSIM4v4stk2; - double BSIM4v4lodk2; - double BSIM4v4steta0; - double BSIM4v4lodeta0; - - - -/* Pre-calculated constants - * move to size-dependent param */ - double BSIM4v4vtm; - double BSIM4v4vtm0; - double BSIM4v4coxe; - double BSIM4v4coxp; - double BSIM4v4cof1; - double BSIM4v4cof2; - double BSIM4v4cof3; - double BSIM4v4cof4; - double BSIM4v4vcrit; - double BSIM4v4factor1; - double BSIM4v4PhiBS; - double BSIM4v4PhiBSWS; - double BSIM4v4PhiBSWGS; - double BSIM4v4SjctTempSatCurDensity; - double BSIM4v4SjctSidewallTempSatCurDensity; - double BSIM4v4SjctGateSidewallTempSatCurDensity; - double BSIM4v4PhiBD; - double BSIM4v4PhiBSWD; - double BSIM4v4PhiBSWGD; - double BSIM4v4DjctTempSatCurDensity; - double BSIM4v4DjctSidewallTempSatCurDensity; - double BSIM4v4DjctGateSidewallTempSatCurDensity; - double BSIM4v4SunitAreaTempJctCap; - double BSIM4v4DunitAreaTempJctCap; - double BSIM4v4SunitLengthSidewallTempJctCap; - double BSIM4v4DunitLengthSidewallTempJctCap; - double BSIM4v4SunitLengthGateSidewallTempJctCap; - double BSIM4v4DunitLengthGateSidewallTempJctCap; - - double BSIM4v4oxideTrapDensityA; - double BSIM4v4oxideTrapDensityB; - double BSIM4v4oxideTrapDensityC; - double BSIM4v4em; - double BSIM4v4ef; - double BSIM4v4af; - double BSIM4v4kf; - - struct bsim4SizeDependParam *pSizeDependParamKnot; - - /* Flags */ - unsigned BSIM4v4mobModGiven :1; - unsigned BSIM4v4binUnitGiven :1; - unsigned BSIM4v4capModGiven :1; - unsigned BSIM4v4dioModGiven :1; - unsigned BSIM4v4rdsModGiven :1; - unsigned BSIM4v4rbodyModGiven :1; - unsigned BSIM4v4rgateModGiven :1; - unsigned BSIM4v4perModGiven :1; - unsigned BSIM4v4geoModGiven :1; - unsigned BSIM4v4paramChkGiven :1; - unsigned BSIM4v4trnqsModGiven :1; - unsigned BSIM4v4acnqsModGiven :1; - unsigned BSIM4v4fnoiModGiven :1; - unsigned BSIM4v4tnoiModGiven :1; - unsigned BSIM4v4igcModGiven :1; - unsigned BSIM4v4igbModGiven :1; - unsigned BSIM4v4tempModGiven :1; - unsigned BSIM4v4typeGiven :1; - unsigned BSIM4v4toxrefGiven :1; - unsigned BSIM4v4toxeGiven :1; - unsigned BSIM4v4toxpGiven :1; - unsigned BSIM4v4toxmGiven :1; - unsigned BSIM4v4dtoxGiven :1; - unsigned BSIM4v4epsroxGiven :1; - unsigned BSIM4v4versionGiven :1; - unsigned BSIM4v4cdscGiven :1; - unsigned BSIM4v4cdscbGiven :1; - unsigned BSIM4v4cdscdGiven :1; - unsigned BSIM4v4citGiven :1; - unsigned BSIM4v4nfactorGiven :1; - unsigned BSIM4v4xjGiven :1; - unsigned BSIM4v4vsatGiven :1; - unsigned BSIM4v4atGiven :1; - unsigned BSIM4v4a0Given :1; - unsigned BSIM4v4agsGiven :1; - unsigned BSIM4v4a1Given :1; - unsigned BSIM4v4a2Given :1; - unsigned BSIM4v4ketaGiven :1; - unsigned BSIM4v4nsubGiven :1; - unsigned BSIM4v4ndepGiven :1; - unsigned BSIM4v4nsdGiven :1; - unsigned BSIM4v4phinGiven :1; - unsigned BSIM4v4ngateGiven :1; - unsigned BSIM4v4gamma1Given :1; - unsigned BSIM4v4gamma2Given :1; - unsigned BSIM4v4vbxGiven :1; - unsigned BSIM4v4vbmGiven :1; - unsigned BSIM4v4xtGiven :1; - unsigned BSIM4v4k1Given :1; - unsigned BSIM4v4kt1Given :1; - unsigned BSIM4v4kt1lGiven :1; - unsigned BSIM4v4kt2Given :1; - unsigned BSIM4v4k2Given :1; - unsigned BSIM4v4k3Given :1; - unsigned BSIM4v4k3bGiven :1; - unsigned BSIM4v4w0Given :1; - unsigned BSIM4v4dvtp0Given :1; - unsigned BSIM4v4dvtp1Given :1; - unsigned BSIM4v4lpe0Given :1; - unsigned BSIM4v4lpebGiven :1; - unsigned BSIM4v4dvt0Given :1; - unsigned BSIM4v4dvt1Given :1; - unsigned BSIM4v4dvt2Given :1; - unsigned BSIM4v4dvt0wGiven :1; - unsigned BSIM4v4dvt1wGiven :1; - unsigned BSIM4v4dvt2wGiven :1; - unsigned BSIM4v4droutGiven :1; - unsigned BSIM4v4dsubGiven :1; - unsigned BSIM4v4vth0Given :1; - unsigned BSIM4v4euGiven :1; - unsigned BSIM4v4uaGiven :1; - unsigned BSIM4v4ua1Given :1; - unsigned BSIM4v4ubGiven :1; - unsigned BSIM4v4ub1Given :1; - unsigned BSIM4v4ucGiven :1; - unsigned BSIM4v4uc1Given :1; - unsigned BSIM4v4u0Given :1; - unsigned BSIM4v4uteGiven :1; - unsigned BSIM4v4voffGiven :1; - unsigned BSIM4v4vofflGiven :1; - unsigned BSIM4v4minvGiven :1; - unsigned BSIM4v4rdswGiven :1; - unsigned BSIM4v4rdswminGiven :1; - unsigned BSIM4v4rdwminGiven :1; - unsigned BSIM4v4rswminGiven :1; - unsigned BSIM4v4rswGiven :1; - unsigned BSIM4v4rdwGiven :1; - unsigned BSIM4v4prwgGiven :1; - unsigned BSIM4v4prwbGiven :1; - unsigned BSIM4v4prtGiven :1; - unsigned BSIM4v4eta0Given :1; - unsigned BSIM4v4etabGiven :1; - unsigned BSIM4v4pclmGiven :1; - unsigned BSIM4v4pdibl1Given :1; - unsigned BSIM4v4pdibl2Given :1; - unsigned BSIM4v4pdiblbGiven :1; - unsigned BSIM4v4fproutGiven :1; - unsigned BSIM4v4pditsGiven :1; - unsigned BSIM4v4pditsdGiven :1; - unsigned BSIM4v4pditslGiven :1; - unsigned BSIM4v4pscbe1Given :1; - unsigned BSIM4v4pscbe2Given :1; - unsigned BSIM4v4pvagGiven :1; - unsigned BSIM4v4deltaGiven :1; - unsigned BSIM4v4wrGiven :1; - unsigned BSIM4v4dwgGiven :1; - unsigned BSIM4v4dwbGiven :1; - unsigned BSIM4v4b0Given :1; - unsigned BSIM4v4b1Given :1; - unsigned BSIM4v4alpha0Given :1; - unsigned BSIM4v4alpha1Given :1; - unsigned BSIM4v4beta0Given :1; - unsigned BSIM4v4agidlGiven :1; - unsigned BSIM4v4bgidlGiven :1; - unsigned BSIM4v4cgidlGiven :1; - unsigned BSIM4v4egidlGiven :1; - unsigned BSIM4v4aigcGiven :1; - unsigned BSIM4v4bigcGiven :1; - unsigned BSIM4v4cigcGiven :1; - unsigned BSIM4v4aigsdGiven :1; - unsigned BSIM4v4bigsdGiven :1; - unsigned BSIM4v4cigsdGiven :1; - unsigned BSIM4v4aigbaccGiven :1; - unsigned BSIM4v4bigbaccGiven :1; - unsigned BSIM4v4cigbaccGiven :1; - unsigned BSIM4v4aigbinvGiven :1; - unsigned BSIM4v4bigbinvGiven :1; - unsigned BSIM4v4cigbinvGiven :1; - unsigned BSIM4v4nigcGiven :1; - unsigned BSIM4v4nigbinvGiven :1; - unsigned BSIM4v4nigbaccGiven :1; - unsigned BSIM4v4ntoxGiven :1; - unsigned BSIM4v4eigbinvGiven :1; - unsigned BSIM4v4pigcdGiven :1; - unsigned BSIM4v4poxedgeGiven :1; - unsigned BSIM4v4ijthdfwdGiven :1; - unsigned BSIM4v4ijthsfwdGiven :1; - unsigned BSIM4v4ijthdrevGiven :1; - unsigned BSIM4v4ijthsrevGiven :1; - unsigned BSIM4v4xjbvdGiven :1; - unsigned BSIM4v4xjbvsGiven :1; - unsigned BSIM4v4bvdGiven :1; - unsigned BSIM4v4bvsGiven :1; - - unsigned BSIM4v4jtssGiven :1; - unsigned BSIM4v4jtsdGiven :1; - unsigned BSIM4v4jtsswsGiven :1; - unsigned BSIM4v4jtsswdGiven :1; - unsigned BSIM4v4jtsswgsGiven :1; - unsigned BSIM4v4jtsswgdGiven :1; - unsigned BSIM4v4njtsGiven :1; - unsigned BSIM4v4njtsswGiven :1; - unsigned BSIM4v4njtsswgGiven :1; - unsigned BSIM4v4xtssGiven :1; - unsigned BSIM4v4xtsdGiven :1; - unsigned BSIM4v4xtsswsGiven :1; - unsigned BSIM4v4xtsswdGiven :1; - unsigned BSIM4v4xtsswgsGiven :1; - unsigned BSIM4v4xtsswgdGiven :1; - unsigned BSIM4v4tnjtsGiven :1; - unsigned BSIM4v4tnjtsswGiven :1; - unsigned BSIM4v4tnjtsswgGiven :1; - unsigned BSIM4v4vtssGiven :1; - unsigned BSIM4v4vtsdGiven :1; - unsigned BSIM4v4vtsswsGiven :1; - unsigned BSIM4v4vtsswdGiven :1; - unsigned BSIM4v4vtsswgsGiven :1; - unsigned BSIM4v4vtsswgdGiven :1; - - unsigned BSIM4v4vfbGiven :1; - unsigned BSIM4v4gbminGiven :1; - unsigned BSIM4v4rbdbGiven :1; - unsigned BSIM4v4rbsbGiven :1; - unsigned BSIM4v4rbpsGiven :1; - unsigned BSIM4v4rbpdGiven :1; - unsigned BSIM4v4rbpbGiven :1; - unsigned BSIM4v4xrcrg1Given :1; - unsigned BSIM4v4xrcrg2Given :1; - unsigned BSIM4v4tnoiaGiven :1; - unsigned BSIM4v4tnoibGiven :1; - unsigned BSIM4v4rnoiaGiven :1; - unsigned BSIM4v4rnoibGiven :1; - unsigned BSIM4v4ntnoiGiven :1; - - unsigned BSIM4v4lambdaGiven :1; - unsigned BSIM4v4vtlGiven :1; - unsigned BSIM4v4lcGiven :1; - unsigned BSIM4v4xnGiven :1; - unsigned BSIM4v4vfbsdoffGiven :1; - unsigned BSIM4v4lintnoiGiven :1; - - /* CV model and parasitics */ - unsigned BSIM4v4cgslGiven :1; - unsigned BSIM4v4cgdlGiven :1; - unsigned BSIM4v4ckappasGiven :1; - unsigned BSIM4v4ckappadGiven :1; - unsigned BSIM4v4cfGiven :1; - unsigned BSIM4v4vfbcvGiven :1; - unsigned BSIM4v4clcGiven :1; - unsigned BSIM4v4cleGiven :1; - unsigned BSIM4v4dwcGiven :1; - unsigned BSIM4v4dlcGiven :1; - unsigned BSIM4v4xwGiven :1; - unsigned BSIM4v4xlGiven :1; - unsigned BSIM4v4dlcigGiven :1; - unsigned BSIM4v4dwjGiven :1; - unsigned BSIM4v4noffGiven :1; - unsigned BSIM4v4voffcvGiven :1; - unsigned BSIM4v4acdeGiven :1; - unsigned BSIM4v4moinGiven :1; - unsigned BSIM4v4tcjGiven :1; - unsigned BSIM4v4tcjswGiven :1; - unsigned BSIM4v4tcjswgGiven :1; - unsigned BSIM4v4tpbGiven :1; - unsigned BSIM4v4tpbswGiven :1; - unsigned BSIM4v4tpbswgGiven :1; - unsigned BSIM4v4dmcgGiven :1; - unsigned BSIM4v4dmciGiven :1; - unsigned BSIM4v4dmdgGiven :1; - unsigned BSIM4v4dmcgtGiven :1; - unsigned BSIM4v4xgwGiven :1; - unsigned BSIM4v4xglGiven :1; - unsigned BSIM4v4rshgGiven :1; - unsigned BSIM4v4ngconGiven :1; - - - /* Length dependence */ - unsigned BSIM4v4lcdscGiven :1; - unsigned BSIM4v4lcdscbGiven :1; - unsigned BSIM4v4lcdscdGiven :1; - unsigned BSIM4v4lcitGiven :1; - unsigned BSIM4v4lnfactorGiven :1; - unsigned BSIM4v4lxjGiven :1; - unsigned BSIM4v4lvsatGiven :1; - unsigned BSIM4v4latGiven :1; - unsigned BSIM4v4la0Given :1; - unsigned BSIM4v4lagsGiven :1; - unsigned BSIM4v4la1Given :1; - unsigned BSIM4v4la2Given :1; - unsigned BSIM4v4lketaGiven :1; - unsigned BSIM4v4lnsubGiven :1; - unsigned BSIM4v4lndepGiven :1; - unsigned BSIM4v4lnsdGiven :1; - unsigned BSIM4v4lphinGiven :1; - unsigned BSIM4v4lngateGiven :1; - unsigned BSIM4v4lgamma1Given :1; - unsigned BSIM4v4lgamma2Given :1; - unsigned BSIM4v4lvbxGiven :1; - unsigned BSIM4v4lvbmGiven :1; - unsigned BSIM4v4lxtGiven :1; - unsigned BSIM4v4lk1Given :1; - unsigned BSIM4v4lkt1Given :1; - unsigned BSIM4v4lkt1lGiven :1; - unsigned BSIM4v4lkt2Given :1; - unsigned BSIM4v4lk2Given :1; - unsigned BSIM4v4lk3Given :1; - unsigned BSIM4v4lk3bGiven :1; - unsigned BSIM4v4lw0Given :1; - unsigned BSIM4v4ldvtp0Given :1; - unsigned BSIM4v4ldvtp1Given :1; - unsigned BSIM4v4llpe0Given :1; - unsigned BSIM4v4llpebGiven :1; - unsigned BSIM4v4ldvt0Given :1; - unsigned BSIM4v4ldvt1Given :1; - unsigned BSIM4v4ldvt2Given :1; - unsigned BSIM4v4ldvt0wGiven :1; - unsigned BSIM4v4ldvt1wGiven :1; - unsigned BSIM4v4ldvt2wGiven :1; - unsigned BSIM4v4ldroutGiven :1; - unsigned BSIM4v4ldsubGiven :1; - unsigned BSIM4v4lvth0Given :1; - unsigned BSIM4v4luaGiven :1; - unsigned BSIM4v4lua1Given :1; - unsigned BSIM4v4lubGiven :1; - unsigned BSIM4v4lub1Given :1; - unsigned BSIM4v4lucGiven :1; - unsigned BSIM4v4luc1Given :1; - unsigned BSIM4v4lu0Given :1; - unsigned BSIM4v4leuGiven :1; - unsigned BSIM4v4luteGiven :1; - unsigned BSIM4v4lvoffGiven :1; - unsigned BSIM4v4lminvGiven :1; - unsigned BSIM4v4lrdswGiven :1; - unsigned BSIM4v4lrswGiven :1; - unsigned BSIM4v4lrdwGiven :1; - unsigned BSIM4v4lprwgGiven :1; - unsigned BSIM4v4lprwbGiven :1; - unsigned BSIM4v4lprtGiven :1; - unsigned BSIM4v4leta0Given :1; - unsigned BSIM4v4letabGiven :1; - unsigned BSIM4v4lpclmGiven :1; - unsigned BSIM4v4lpdibl1Given :1; - unsigned BSIM4v4lpdibl2Given :1; - unsigned BSIM4v4lpdiblbGiven :1; - unsigned BSIM4v4lfproutGiven :1; - unsigned BSIM4v4lpditsGiven :1; - unsigned BSIM4v4lpditsdGiven :1; - unsigned BSIM4v4lpscbe1Given :1; - unsigned BSIM4v4lpscbe2Given :1; - unsigned BSIM4v4lpvagGiven :1; - unsigned BSIM4v4ldeltaGiven :1; - unsigned BSIM4v4lwrGiven :1; - unsigned BSIM4v4ldwgGiven :1; - unsigned BSIM4v4ldwbGiven :1; - unsigned BSIM4v4lb0Given :1; - unsigned BSIM4v4lb1Given :1; - unsigned BSIM4v4lalpha0Given :1; - unsigned BSIM4v4lalpha1Given :1; - unsigned BSIM4v4lbeta0Given :1; - unsigned BSIM4v4lvfbGiven :1; - unsigned BSIM4v4lagidlGiven :1; - unsigned BSIM4v4lbgidlGiven :1; - unsigned BSIM4v4lcgidlGiven :1; - unsigned BSIM4v4legidlGiven :1; - unsigned BSIM4v4laigcGiven :1; - unsigned BSIM4v4lbigcGiven :1; - unsigned BSIM4v4lcigcGiven :1; - unsigned BSIM4v4laigsdGiven :1; - unsigned BSIM4v4lbigsdGiven :1; - unsigned BSIM4v4lcigsdGiven :1; - unsigned BSIM4v4laigbaccGiven :1; - unsigned BSIM4v4lbigbaccGiven :1; - unsigned BSIM4v4lcigbaccGiven :1; - unsigned BSIM4v4laigbinvGiven :1; - unsigned BSIM4v4lbigbinvGiven :1; - unsigned BSIM4v4lcigbinvGiven :1; - unsigned BSIM4v4lnigcGiven :1; - unsigned BSIM4v4lnigbinvGiven :1; - unsigned BSIM4v4lnigbaccGiven :1; - unsigned BSIM4v4lntoxGiven :1; - unsigned BSIM4v4leigbinvGiven :1; - unsigned BSIM4v4lpigcdGiven :1; - unsigned BSIM4v4lpoxedgeGiven :1; - unsigned BSIM4v4lxrcrg1Given :1; - unsigned BSIM4v4lxrcrg2Given :1; - unsigned BSIM4v4llambdaGiven :1; - unsigned BSIM4v4lvtlGiven :1; - unsigned BSIM4v4lxnGiven :1; - unsigned BSIM4v4lvfbsdoffGiven :1; - - /* CV model */ - unsigned BSIM4v4lcgslGiven :1; - unsigned BSIM4v4lcgdlGiven :1; - unsigned BSIM4v4lckappasGiven :1; - unsigned BSIM4v4lckappadGiven :1; - unsigned BSIM4v4lcfGiven :1; - unsigned BSIM4v4lclcGiven :1; - unsigned BSIM4v4lcleGiven :1; - unsigned BSIM4v4lvfbcvGiven :1; - unsigned BSIM4v4lnoffGiven :1; - unsigned BSIM4v4lvoffcvGiven :1; - unsigned BSIM4v4lacdeGiven :1; - unsigned BSIM4v4lmoinGiven :1; - - /* Width dependence */ - unsigned BSIM4v4wcdscGiven :1; - unsigned BSIM4v4wcdscbGiven :1; - unsigned BSIM4v4wcdscdGiven :1; - unsigned BSIM4v4wcitGiven :1; - unsigned BSIM4v4wnfactorGiven :1; - unsigned BSIM4v4wxjGiven :1; - unsigned BSIM4v4wvsatGiven :1; - unsigned BSIM4v4watGiven :1; - unsigned BSIM4v4wa0Given :1; - unsigned BSIM4v4wagsGiven :1; - unsigned BSIM4v4wa1Given :1; - unsigned BSIM4v4wa2Given :1; - unsigned BSIM4v4wketaGiven :1; - unsigned BSIM4v4wnsubGiven :1; - unsigned BSIM4v4wndepGiven :1; - unsigned BSIM4v4wnsdGiven :1; - unsigned BSIM4v4wphinGiven :1; - unsigned BSIM4v4wngateGiven :1; - unsigned BSIM4v4wgamma1Given :1; - unsigned BSIM4v4wgamma2Given :1; - unsigned BSIM4v4wvbxGiven :1; - unsigned BSIM4v4wvbmGiven :1; - unsigned BSIM4v4wxtGiven :1; - unsigned BSIM4v4wk1Given :1; - unsigned BSIM4v4wkt1Given :1; - unsigned BSIM4v4wkt1lGiven :1; - unsigned BSIM4v4wkt2Given :1; - unsigned BSIM4v4wk2Given :1; - unsigned BSIM4v4wk3Given :1; - unsigned BSIM4v4wk3bGiven :1; - unsigned BSIM4v4ww0Given :1; - unsigned BSIM4v4wdvtp0Given :1; - unsigned BSIM4v4wdvtp1Given :1; - unsigned BSIM4v4wlpe0Given :1; - unsigned BSIM4v4wlpebGiven :1; - unsigned BSIM4v4wdvt0Given :1; - unsigned BSIM4v4wdvt1Given :1; - unsigned BSIM4v4wdvt2Given :1; - unsigned BSIM4v4wdvt0wGiven :1; - unsigned BSIM4v4wdvt1wGiven :1; - unsigned BSIM4v4wdvt2wGiven :1; - unsigned BSIM4v4wdroutGiven :1; - unsigned BSIM4v4wdsubGiven :1; - unsigned BSIM4v4wvth0Given :1; - unsigned BSIM4v4wuaGiven :1; - unsigned BSIM4v4wua1Given :1; - unsigned BSIM4v4wubGiven :1; - unsigned BSIM4v4wub1Given :1; - unsigned BSIM4v4wucGiven :1; - unsigned BSIM4v4wuc1Given :1; - unsigned BSIM4v4wu0Given :1; - unsigned BSIM4v4weuGiven :1; - unsigned BSIM4v4wuteGiven :1; - unsigned BSIM4v4wvoffGiven :1; - unsigned BSIM4v4wminvGiven :1; - unsigned BSIM4v4wrdswGiven :1; - unsigned BSIM4v4wrswGiven :1; - unsigned BSIM4v4wrdwGiven :1; - unsigned BSIM4v4wprwgGiven :1; - unsigned BSIM4v4wprwbGiven :1; - unsigned BSIM4v4wprtGiven :1; - unsigned BSIM4v4weta0Given :1; - unsigned BSIM4v4wetabGiven :1; - unsigned BSIM4v4wpclmGiven :1; - unsigned BSIM4v4wpdibl1Given :1; - unsigned BSIM4v4wpdibl2Given :1; - unsigned BSIM4v4wpdiblbGiven :1; - unsigned BSIM4v4wfproutGiven :1; - unsigned BSIM4v4wpditsGiven :1; - unsigned BSIM4v4wpditsdGiven :1; - unsigned BSIM4v4wpscbe1Given :1; - unsigned BSIM4v4wpscbe2Given :1; - unsigned BSIM4v4wpvagGiven :1; - unsigned BSIM4v4wdeltaGiven :1; - unsigned BSIM4v4wwrGiven :1; - unsigned BSIM4v4wdwgGiven :1; - unsigned BSIM4v4wdwbGiven :1; - unsigned BSIM4v4wb0Given :1; - unsigned BSIM4v4wb1Given :1; - unsigned BSIM4v4walpha0Given :1; - unsigned BSIM4v4walpha1Given :1; - unsigned BSIM4v4wbeta0Given :1; - unsigned BSIM4v4wvfbGiven :1; - unsigned BSIM4v4wagidlGiven :1; - unsigned BSIM4v4wbgidlGiven :1; - unsigned BSIM4v4wcgidlGiven :1; - unsigned BSIM4v4wegidlGiven :1; - unsigned BSIM4v4waigcGiven :1; - unsigned BSIM4v4wbigcGiven :1; - unsigned BSIM4v4wcigcGiven :1; - unsigned BSIM4v4waigsdGiven :1; - unsigned BSIM4v4wbigsdGiven :1; - unsigned BSIM4v4wcigsdGiven :1; - unsigned BSIM4v4waigbaccGiven :1; - unsigned BSIM4v4wbigbaccGiven :1; - unsigned BSIM4v4wcigbaccGiven :1; - unsigned BSIM4v4waigbinvGiven :1; - unsigned BSIM4v4wbigbinvGiven :1; - unsigned BSIM4v4wcigbinvGiven :1; - unsigned BSIM4v4wnigcGiven :1; - unsigned BSIM4v4wnigbinvGiven :1; - unsigned BSIM4v4wnigbaccGiven :1; - unsigned BSIM4v4wntoxGiven :1; - unsigned BSIM4v4weigbinvGiven :1; - unsigned BSIM4v4wpigcdGiven :1; - unsigned BSIM4v4wpoxedgeGiven :1; - unsigned BSIM4v4wxrcrg1Given :1; - unsigned BSIM4v4wxrcrg2Given :1; - unsigned BSIM4v4wlambdaGiven :1; - unsigned BSIM4v4wvtlGiven :1; - unsigned BSIM4v4wxnGiven :1; - unsigned BSIM4v4wvfbsdoffGiven :1; - - /* CV model */ - unsigned BSIM4v4wcgslGiven :1; - unsigned BSIM4v4wcgdlGiven :1; - unsigned BSIM4v4wckappasGiven :1; - unsigned BSIM4v4wckappadGiven :1; - unsigned BSIM4v4wcfGiven :1; - unsigned BSIM4v4wclcGiven :1; - unsigned BSIM4v4wcleGiven :1; - unsigned BSIM4v4wvfbcvGiven :1; - unsigned BSIM4v4wnoffGiven :1; - unsigned BSIM4v4wvoffcvGiven :1; - unsigned BSIM4v4wacdeGiven :1; - unsigned BSIM4v4wmoinGiven :1; - - /* Cross-term dependence */ - unsigned BSIM4v4pcdscGiven :1; - unsigned BSIM4v4pcdscbGiven :1; - unsigned BSIM4v4pcdscdGiven :1; - unsigned BSIM4v4pcitGiven :1; - unsigned BSIM4v4pnfactorGiven :1; - unsigned BSIM4v4pxjGiven :1; - unsigned BSIM4v4pvsatGiven :1; - unsigned BSIM4v4patGiven :1; - unsigned BSIM4v4pa0Given :1; - unsigned BSIM4v4pagsGiven :1; - unsigned BSIM4v4pa1Given :1; - unsigned BSIM4v4pa2Given :1; - unsigned BSIM4v4pketaGiven :1; - unsigned BSIM4v4pnsubGiven :1; - unsigned BSIM4v4pndepGiven :1; - unsigned BSIM4v4pnsdGiven :1; - unsigned BSIM4v4pphinGiven :1; - unsigned BSIM4v4pngateGiven :1; - unsigned BSIM4v4pgamma1Given :1; - unsigned BSIM4v4pgamma2Given :1; - unsigned BSIM4v4pvbxGiven :1; - unsigned BSIM4v4pvbmGiven :1; - unsigned BSIM4v4pxtGiven :1; - unsigned BSIM4v4pk1Given :1; - unsigned BSIM4v4pkt1Given :1; - unsigned BSIM4v4pkt1lGiven :1; - unsigned BSIM4v4pkt2Given :1; - unsigned BSIM4v4pk2Given :1; - unsigned BSIM4v4pk3Given :1; - unsigned BSIM4v4pk3bGiven :1; - unsigned BSIM4v4pw0Given :1; - unsigned BSIM4v4pdvtp0Given :1; - unsigned BSIM4v4pdvtp1Given :1; - unsigned BSIM4v4plpe0Given :1; - unsigned BSIM4v4plpebGiven :1; - unsigned BSIM4v4pdvt0Given :1; - unsigned BSIM4v4pdvt1Given :1; - unsigned BSIM4v4pdvt2Given :1; - unsigned BSIM4v4pdvt0wGiven :1; - unsigned BSIM4v4pdvt1wGiven :1; - unsigned BSIM4v4pdvt2wGiven :1; - unsigned BSIM4v4pdroutGiven :1; - unsigned BSIM4v4pdsubGiven :1; - unsigned BSIM4v4pvth0Given :1; - unsigned BSIM4v4puaGiven :1; - unsigned BSIM4v4pua1Given :1; - unsigned BSIM4v4pubGiven :1; - unsigned BSIM4v4pub1Given :1; - unsigned BSIM4v4pucGiven :1; - unsigned BSIM4v4puc1Given :1; - unsigned BSIM4v4pu0Given :1; - unsigned BSIM4v4peuGiven :1; - unsigned BSIM4v4puteGiven :1; - unsigned BSIM4v4pvoffGiven :1; - unsigned BSIM4v4pminvGiven :1; - unsigned BSIM4v4prdswGiven :1; - unsigned BSIM4v4prswGiven :1; - unsigned BSIM4v4prdwGiven :1; - unsigned BSIM4v4pprwgGiven :1; - unsigned BSIM4v4pprwbGiven :1; - unsigned BSIM4v4pprtGiven :1; - unsigned BSIM4v4peta0Given :1; - unsigned BSIM4v4petabGiven :1; - unsigned BSIM4v4ppclmGiven :1; - unsigned BSIM4v4ppdibl1Given :1; - unsigned BSIM4v4ppdibl2Given :1; - unsigned BSIM4v4ppdiblbGiven :1; - unsigned BSIM4v4pfproutGiven :1; - unsigned BSIM4v4ppditsGiven :1; - unsigned BSIM4v4ppditsdGiven :1; - unsigned BSIM4v4ppscbe1Given :1; - unsigned BSIM4v4ppscbe2Given :1; - unsigned BSIM4v4ppvagGiven :1; - unsigned BSIM4v4pdeltaGiven :1; - unsigned BSIM4v4pwrGiven :1; - unsigned BSIM4v4pdwgGiven :1; - unsigned BSIM4v4pdwbGiven :1; - unsigned BSIM4v4pb0Given :1; - unsigned BSIM4v4pb1Given :1; - unsigned BSIM4v4palpha0Given :1; - unsigned BSIM4v4palpha1Given :1; - unsigned BSIM4v4pbeta0Given :1; - unsigned BSIM4v4pvfbGiven :1; - unsigned BSIM4v4pagidlGiven :1; - unsigned BSIM4v4pbgidlGiven :1; - unsigned BSIM4v4pcgidlGiven :1; - unsigned BSIM4v4pegidlGiven :1; - unsigned BSIM4v4paigcGiven :1; - unsigned BSIM4v4pbigcGiven :1; - unsigned BSIM4v4pcigcGiven :1; - unsigned BSIM4v4paigsdGiven :1; - unsigned BSIM4v4pbigsdGiven :1; - unsigned BSIM4v4pcigsdGiven :1; - unsigned BSIM4v4paigbaccGiven :1; - unsigned BSIM4v4pbigbaccGiven :1; - unsigned BSIM4v4pcigbaccGiven :1; - unsigned BSIM4v4paigbinvGiven :1; - unsigned BSIM4v4pbigbinvGiven :1; - unsigned BSIM4v4pcigbinvGiven :1; - unsigned BSIM4v4pnigcGiven :1; - unsigned BSIM4v4pnigbinvGiven :1; - unsigned BSIM4v4pnigbaccGiven :1; - unsigned BSIM4v4pntoxGiven :1; - unsigned BSIM4v4peigbinvGiven :1; - unsigned BSIM4v4ppigcdGiven :1; - unsigned BSIM4v4ppoxedgeGiven :1; - unsigned BSIM4v4pxrcrg1Given :1; - unsigned BSIM4v4pxrcrg2Given :1; - unsigned BSIM4v4plambdaGiven :1; - unsigned BSIM4v4pvtlGiven :1; - unsigned BSIM4v4pxnGiven :1; - unsigned BSIM4v4pvfbsdoffGiven :1; - - /* CV model */ - unsigned BSIM4v4pcgslGiven :1; - unsigned BSIM4v4pcgdlGiven :1; - unsigned BSIM4v4pckappasGiven :1; - unsigned BSIM4v4pckappadGiven :1; - unsigned BSIM4v4pcfGiven :1; - unsigned BSIM4v4pclcGiven :1; - unsigned BSIM4v4pcleGiven :1; - unsigned BSIM4v4pvfbcvGiven :1; - unsigned BSIM4v4pnoffGiven :1; - unsigned BSIM4v4pvoffcvGiven :1; - unsigned BSIM4v4pacdeGiven :1; - unsigned BSIM4v4pmoinGiven :1; - - unsigned BSIM4v4useFringeGiven :1; - - unsigned BSIM4v4tnomGiven :1; - unsigned BSIM4v4cgsoGiven :1; - unsigned BSIM4v4cgdoGiven :1; - unsigned BSIM4v4cgboGiven :1; - unsigned BSIM4v4xpartGiven :1; - unsigned BSIM4v4sheetResistanceGiven :1; - - unsigned BSIM4v4SjctSatCurDensityGiven :1; - unsigned BSIM4v4SjctSidewallSatCurDensityGiven :1; - unsigned BSIM4v4SjctGateSidewallSatCurDensityGiven :1; - unsigned BSIM4v4SbulkJctPotentialGiven :1; - unsigned BSIM4v4SbulkJctBotGradingCoeffGiven :1; - unsigned BSIM4v4SsidewallJctPotentialGiven :1; - unsigned BSIM4v4SGatesidewallJctPotentialGiven :1; - unsigned BSIM4v4SbulkJctSideGradingCoeffGiven :1; - unsigned BSIM4v4SunitAreaJctCapGiven :1; - unsigned BSIM4v4SunitLengthSidewallJctCapGiven :1; - unsigned BSIM4v4SbulkJctGateSideGradingCoeffGiven :1; - unsigned BSIM4v4SunitLengthGateSidewallJctCapGiven :1; - unsigned BSIM4v4SjctEmissionCoeffGiven :1; - unsigned BSIM4v4SjctTempExponentGiven :1; - - unsigned BSIM4v4DjctSatCurDensityGiven :1; - unsigned BSIM4v4DjctSidewallSatCurDensityGiven :1; - unsigned BSIM4v4DjctGateSidewallSatCurDensityGiven :1; - unsigned BSIM4v4DbulkJctPotentialGiven :1; - unsigned BSIM4v4DbulkJctBotGradingCoeffGiven :1; - unsigned BSIM4v4DsidewallJctPotentialGiven :1; - unsigned BSIM4v4DGatesidewallJctPotentialGiven :1; - unsigned BSIM4v4DbulkJctSideGradingCoeffGiven :1; - unsigned BSIM4v4DunitAreaJctCapGiven :1; - unsigned BSIM4v4DunitLengthSidewallJctCapGiven :1; - unsigned BSIM4v4DbulkJctGateSideGradingCoeffGiven :1; - unsigned BSIM4v4DunitLengthGateSidewallJctCapGiven :1; - unsigned BSIM4v4DjctEmissionCoeffGiven :1; - unsigned BSIM4v4DjctTempExponentGiven :1; - - unsigned BSIM4v4oxideTrapDensityAGiven :1; - unsigned BSIM4v4oxideTrapDensityBGiven :1; - unsigned BSIM4v4oxideTrapDensityCGiven :1; - unsigned BSIM4v4emGiven :1; - unsigned BSIM4v4efGiven :1; - unsigned BSIM4v4afGiven :1; - unsigned BSIM4v4kfGiven :1; - - unsigned BSIM4v4LintGiven :1; - unsigned BSIM4v4LlGiven :1; - unsigned BSIM4v4LlcGiven :1; - unsigned BSIM4v4LlnGiven :1; - unsigned BSIM4v4LwGiven :1; - unsigned BSIM4v4LwcGiven :1; - unsigned BSIM4v4LwnGiven :1; - unsigned BSIM4v4LwlGiven :1; - unsigned BSIM4v4LwlcGiven :1; - unsigned BSIM4v4LminGiven :1; - unsigned BSIM4v4LmaxGiven :1; - - unsigned BSIM4v4WintGiven :1; - unsigned BSIM4v4WlGiven :1; - unsigned BSIM4v4WlcGiven :1; - unsigned BSIM4v4WlnGiven :1; - unsigned BSIM4v4WwGiven :1; - unsigned BSIM4v4WwcGiven :1; - unsigned BSIM4v4WwnGiven :1; - unsigned BSIM4v4WwlGiven :1; - unsigned BSIM4v4WwlcGiven :1; - unsigned BSIM4v4WminGiven :1; - unsigned BSIM4v4WmaxGiven :1; - - /* added for stress effect */ - unsigned BSIM4v4sarefGiven :1; - unsigned BSIM4v4sbrefGiven :1; - unsigned BSIM4v4wlodGiven :1; - unsigned BSIM4v4ku0Given :1; - unsigned BSIM4v4kvsatGiven :1; - unsigned BSIM4v4kvth0Given :1; - unsigned BSIM4v4tku0Given :1; - unsigned BSIM4v4llodku0Given :1; - unsigned BSIM4v4wlodku0Given :1; - unsigned BSIM4v4llodvthGiven :1; - unsigned BSIM4v4wlodvthGiven :1; - unsigned BSIM4v4lku0Given :1; - unsigned BSIM4v4wku0Given :1; - unsigned BSIM4v4pku0Given :1; - unsigned BSIM4v4lkvth0Given :1; - unsigned BSIM4v4wkvth0Given :1; - unsigned BSIM4v4pkvth0Given :1; - unsigned BSIM4v4stk2Given :1; - unsigned BSIM4v4lodk2Given :1; - unsigned BSIM4v4steta0Given :1; - unsigned BSIM4v4lodeta0Given :1; - - -} BSIM4v4model; - - -#ifndef NMOS -#define NMOS 1 -#define PMOS -1 -#endif /*NMOS*/ - - -/* Instance parameters */ -#define BSIM4v4_W 1 -#define BSIM4v4_L 2 -#define BSIM4v4_AS 3 -#define BSIM4v4_AD 4 -#define BSIM4v4_PS 5 -#define BSIM4v4_PD 6 -#define BSIM4v4_NRS 7 -#define BSIM4v4_NRD 8 -#define BSIM4v4_OFF 9 -#define BSIM4v4_IC 10 -#define BSIM4v4_IC_VDS 11 -#define BSIM4v4_IC_VGS 12 -#define BSIM4v4_IC_VBS 13 -#define BSIM4v4_TRNQSMOD 14 -#define BSIM4v4_RBODYMOD 15 -#define BSIM4v4_RGATEMOD 16 -#define BSIM4v4_GEOMOD 17 -#define BSIM4v4_RGEOMOD 18 -#define BSIM4v4_NF 19 -#define BSIM4v4_MIN 20 -#define BSIM4v4_ACNQSMOD 22 -#define BSIM4v4_RBDB 23 -#define BSIM4v4_RBSB 24 -#define BSIM4v4_RBPB 25 -#define BSIM4v4_RBPS 26 -#define BSIM4v4_RBPD 27 -#define BSIM4v4_SA 28 -#define BSIM4v4_SB 29 -#define BSIM4v4_SD 30 -#define BSIM4v4_M 31 - -/* Global parameters */ -#define BSIM4v4_MOD_TEMPMOD 89 -#define BSIM4v4_MOD_IGCMOD 90 -#define BSIM4v4_MOD_IGBMOD 91 -#define BSIM4v4_MOD_ACNQSMOD 92 -#define BSIM4v4_MOD_FNOIMOD 93 -#define BSIM4v4_MOD_RDSMOD 94 -#define BSIM4v4_MOD_DIOMOD 96 -#define BSIM4v4_MOD_PERMOD 97 -#define BSIM4v4_MOD_GEOMOD 98 -#define BSIM4v4_MOD_RGATEMOD 99 -#define BSIM4v4_MOD_RBODYMOD 100 -#define BSIM4v4_MOD_CAPMOD 101 -#define BSIM4v4_MOD_TRNQSMOD 102 -#define BSIM4v4_MOD_MOBMOD 103 -#define BSIM4v4_MOD_TNOIMOD 104 -#define BSIM4v4_MOD_TOXE 105 -#define BSIM4v4_MOD_CDSC 106 -#define BSIM4v4_MOD_CDSCB 107 -#define BSIM4v4_MOD_CIT 108 -#define BSIM4v4_MOD_NFACTOR 109 -#define BSIM4v4_MOD_XJ 110 -#define BSIM4v4_MOD_VSAT 111 -#define BSIM4v4_MOD_AT 112 -#define BSIM4v4_MOD_A0 113 -#define BSIM4v4_MOD_A1 114 -#define BSIM4v4_MOD_A2 115 -#define BSIM4v4_MOD_KETA 116 -#define BSIM4v4_MOD_NSUB 117 -#define BSIM4v4_MOD_NDEP 118 -#define BSIM4v4_MOD_NGATE 120 -#define BSIM4v4_MOD_GAMMA1 121 -#define BSIM4v4_MOD_GAMMA2 122 -#define BSIM4v4_MOD_VBX 123 -#define BSIM4v4_MOD_BINUNIT 124 -#define BSIM4v4_MOD_VBM 125 -#define BSIM4v4_MOD_XT 126 -#define BSIM4v4_MOD_K1 129 -#define BSIM4v4_MOD_KT1 130 -#define BSIM4v4_MOD_KT1L 131 -#define BSIM4v4_MOD_K2 132 -#define BSIM4v4_MOD_KT2 133 -#define BSIM4v4_MOD_K3 134 -#define BSIM4v4_MOD_K3B 135 -#define BSIM4v4_MOD_W0 136 -#define BSIM4v4_MOD_LPE0 137 -#define BSIM4v4_MOD_DVT0 138 -#define BSIM4v4_MOD_DVT1 139 -#define BSIM4v4_MOD_DVT2 140 -#define BSIM4v4_MOD_DVT0W 141 -#define BSIM4v4_MOD_DVT1W 142 -#define BSIM4v4_MOD_DVT2W 143 -#define BSIM4v4_MOD_DROUT 144 -#define BSIM4v4_MOD_DSUB 145 -#define BSIM4v4_MOD_VTH0 146 -#define BSIM4v4_MOD_UA 147 -#define BSIM4v4_MOD_UA1 148 -#define BSIM4v4_MOD_UB 149 -#define BSIM4v4_MOD_UB1 150 -#define BSIM4v4_MOD_UC 151 -#define BSIM4v4_MOD_UC1 152 -#define BSIM4v4_MOD_U0 153 -#define BSIM4v4_MOD_UTE 154 -#define BSIM4v4_MOD_VOFF 155 -#define BSIM4v4_MOD_DELTA 156 -#define BSIM4v4_MOD_RDSW 157 -#define BSIM4v4_MOD_PRT 158 -#define BSIM4v4_MOD_LDD 159 -#define BSIM4v4_MOD_ETA 160 -#define BSIM4v4_MOD_ETA0 161 -#define BSIM4v4_MOD_ETAB 162 -#define BSIM4v4_MOD_PCLM 163 -#define BSIM4v4_MOD_PDIBL1 164 -#define BSIM4v4_MOD_PDIBL2 165 -#define BSIM4v4_MOD_PSCBE1 166 -#define BSIM4v4_MOD_PSCBE2 167 -#define BSIM4v4_MOD_PVAG 168 -#define BSIM4v4_MOD_WR 169 -#define BSIM4v4_MOD_DWG 170 -#define BSIM4v4_MOD_DWB 171 -#define BSIM4v4_MOD_B0 172 -#define BSIM4v4_MOD_B1 173 -#define BSIM4v4_MOD_ALPHA0 174 -#define BSIM4v4_MOD_BETA0 175 -#define BSIM4v4_MOD_PDIBLB 178 -#define BSIM4v4_MOD_PRWG 179 -#define BSIM4v4_MOD_PRWB 180 -#define BSIM4v4_MOD_CDSCD 181 -#define BSIM4v4_MOD_AGS 182 -#define BSIM4v4_MOD_FRINGE 184 -#define BSIM4v4_MOD_CGSL 186 -#define BSIM4v4_MOD_CGDL 187 -#define BSIM4v4_MOD_CKAPPAS 188 -#define BSIM4v4_MOD_CF 189 -#define BSIM4v4_MOD_CLC 190 -#define BSIM4v4_MOD_CLE 191 -#define BSIM4v4_MOD_PARAMCHK 192 -#define BSIM4v4_MOD_VERSION 193 -#define BSIM4v4_MOD_VFBCV 194 -#define BSIM4v4_MOD_ACDE 195 -#define BSIM4v4_MOD_MOIN 196 -#define BSIM4v4_MOD_NOFF 197 -#define BSIM4v4_MOD_IJTHDFWD 198 -#define BSIM4v4_MOD_ALPHA1 199 -#define BSIM4v4_MOD_VFB 200 -#define BSIM4v4_MOD_TOXM 201 -#define BSIM4v4_MOD_TCJ 202 -#define BSIM4v4_MOD_TCJSW 203 -#define BSIM4v4_MOD_TCJSWG 204 -#define BSIM4v4_MOD_TPB 205 -#define BSIM4v4_MOD_TPBSW 206 -#define BSIM4v4_MOD_TPBSWG 207 -#define BSIM4v4_MOD_VOFFCV 208 -#define BSIM4v4_MOD_GBMIN 209 -#define BSIM4v4_MOD_RBDB 210 -#define BSIM4v4_MOD_RBSB 211 -#define BSIM4v4_MOD_RBPB 212 -#define BSIM4v4_MOD_RBPS 213 -#define BSIM4v4_MOD_RBPD 214 -#define BSIM4v4_MOD_DMCG 215 -#define BSIM4v4_MOD_DMCI 216 -#define BSIM4v4_MOD_DMDG 217 -#define BSIM4v4_MOD_XGW 218 -#define BSIM4v4_MOD_XGL 219 -#define BSIM4v4_MOD_RSHG 220 -#define BSIM4v4_MOD_NGCON 221 -#define BSIM4v4_MOD_AGIDL 222 -#define BSIM4v4_MOD_BGIDL 223 -#define BSIM4v4_MOD_EGIDL 224 -#define BSIM4v4_MOD_IJTHSFWD 225 -#define BSIM4v4_MOD_XJBVD 226 -#define BSIM4v4_MOD_XJBVS 227 -#define BSIM4v4_MOD_BVD 228 -#define BSIM4v4_MOD_BVS 229 -#define BSIM4v4_MOD_TOXP 230 -#define BSIM4v4_MOD_DTOX 231 -#define BSIM4v4_MOD_XRCRG1 232 -#define BSIM4v4_MOD_XRCRG2 233 -#define BSIM4v4_MOD_EU 234 -#define BSIM4v4_MOD_IJTHSREV 235 -#define BSIM4v4_MOD_IJTHDREV 236 -#define BSIM4v4_MOD_MINV 237 -#define BSIM4v4_MOD_VOFFL 238 -#define BSIM4v4_MOD_PDITS 239 -#define BSIM4v4_MOD_PDITSD 240 -#define BSIM4v4_MOD_PDITSL 241 -#define BSIM4v4_MOD_TNOIA 242 -#define BSIM4v4_MOD_TNOIB 243 -#define BSIM4v4_MOD_NTNOI 244 -#define BSIM4v4_MOD_FPROUT 245 -#define BSIM4v4_MOD_LPEB 246 -#define BSIM4v4_MOD_DVTP0 247 -#define BSIM4v4_MOD_DVTP1 248 -#define BSIM4v4_MOD_CGIDL 249 -#define BSIM4v4_MOD_PHIN 250 -#define BSIM4v4_MOD_RDSWMIN 251 -#define BSIM4v4_MOD_RSW 252 -#define BSIM4v4_MOD_RDW 253 -#define BSIM4v4_MOD_RDWMIN 254 -#define BSIM4v4_MOD_RSWMIN 255 -#define BSIM4v4_MOD_NSD 256 -#define BSIM4v4_MOD_CKAPPAD 257 -#define BSIM4v4_MOD_DMCGT 258 -#define BSIM4v4_MOD_AIGC 259 -#define BSIM4v4_MOD_BIGC 260 -#define BSIM4v4_MOD_CIGC 261 -#define BSIM4v4_MOD_AIGBACC 262 -#define BSIM4v4_MOD_BIGBACC 263 -#define BSIM4v4_MOD_CIGBACC 264 -#define BSIM4v4_MOD_AIGBINV 265 -#define BSIM4v4_MOD_BIGBINV 266 -#define BSIM4v4_MOD_CIGBINV 267 -#define BSIM4v4_MOD_NIGC 268 -#define BSIM4v4_MOD_NIGBACC 269 -#define BSIM4v4_MOD_NIGBINV 270 -#define BSIM4v4_MOD_NTOX 271 -#define BSIM4v4_MOD_TOXREF 272 -#define BSIM4v4_MOD_EIGBINV 273 -#define BSIM4v4_MOD_PIGCD 274 -#define BSIM4v4_MOD_POXEDGE 275 -#define BSIM4v4_MOD_EPSROX 276 -#define BSIM4v4_MOD_AIGSD 277 -#define BSIM4v4_MOD_BIGSD 278 -#define BSIM4v4_MOD_CIGSD 279 -#define BSIM4v4_MOD_JSWGS 280 -#define BSIM4v4_MOD_JSWGD 281 -#define BSIM4v4_MOD_LAMBDA 282 -#define BSIM4v4_MOD_VTL 283 -#define BSIM4v4_MOD_LC 284 -#define BSIM4v4_MOD_XN 285 -#define BSIM4v4_MOD_RNOIA 286 -#define BSIM4v4_MOD_RNOIB 287 -#define BSIM4v4_MOD_VFBSDOFF 288 -#define BSIM4v4_MOD_LINTNOI 289 - -/* Length dependence */ -#define BSIM4v4_MOD_LCDSC 301 -#define BSIM4v4_MOD_LCDSCB 302 -#define BSIM4v4_MOD_LCIT 303 -#define BSIM4v4_MOD_LNFACTOR 304 -#define BSIM4v4_MOD_LXJ 305 -#define BSIM4v4_MOD_LVSAT 306 -#define BSIM4v4_MOD_LAT 307 -#define BSIM4v4_MOD_LA0 308 -#define BSIM4v4_MOD_LA1 309 -#define BSIM4v4_MOD_LA2 310 -#define BSIM4v4_MOD_LKETA 311 -#define BSIM4v4_MOD_LNSUB 312 -#define BSIM4v4_MOD_LNDEP 313 -#define BSIM4v4_MOD_LNGATE 315 -#define BSIM4v4_MOD_LGAMMA1 316 -#define BSIM4v4_MOD_LGAMMA2 317 -#define BSIM4v4_MOD_LVBX 318 -#define BSIM4v4_MOD_LVBM 320 -#define BSIM4v4_MOD_LXT 322 -#define BSIM4v4_MOD_LK1 325 -#define BSIM4v4_MOD_LKT1 326 -#define BSIM4v4_MOD_LKT1L 327 -#define BSIM4v4_MOD_LK2 328 -#define BSIM4v4_MOD_LKT2 329 -#define BSIM4v4_MOD_LK3 330 -#define BSIM4v4_MOD_LK3B 331 -#define BSIM4v4_MOD_LW0 332 -#define BSIM4v4_MOD_LLPE0 333 -#define BSIM4v4_MOD_LDVT0 334 -#define BSIM4v4_MOD_LDVT1 335 -#define BSIM4v4_MOD_LDVT2 336 -#define BSIM4v4_MOD_LDVT0W 337 -#define BSIM4v4_MOD_LDVT1W 338 -#define BSIM4v4_MOD_LDVT2W 339 -#define BSIM4v4_MOD_LDROUT 340 -#define BSIM4v4_MOD_LDSUB 341 -#define BSIM4v4_MOD_LVTH0 342 -#define BSIM4v4_MOD_LUA 343 -#define BSIM4v4_MOD_LUA1 344 -#define BSIM4v4_MOD_LUB 345 -#define BSIM4v4_MOD_LUB1 346 -#define BSIM4v4_MOD_LUC 347 -#define BSIM4v4_MOD_LUC1 348 -#define BSIM4v4_MOD_LU0 349 -#define BSIM4v4_MOD_LUTE 350 -#define BSIM4v4_MOD_LVOFF 351 -#define BSIM4v4_MOD_LDELTA 352 -#define BSIM4v4_MOD_LRDSW 353 -#define BSIM4v4_MOD_LPRT 354 -#define BSIM4v4_MOD_LLDD 355 -#define BSIM4v4_MOD_LETA 356 -#define BSIM4v4_MOD_LETA0 357 -#define BSIM4v4_MOD_LETAB 358 -#define BSIM4v4_MOD_LPCLM 359 -#define BSIM4v4_MOD_LPDIBL1 360 -#define BSIM4v4_MOD_LPDIBL2 361 -#define BSIM4v4_MOD_LPSCBE1 362 -#define BSIM4v4_MOD_LPSCBE2 363 -#define BSIM4v4_MOD_LPVAG 364 -#define BSIM4v4_MOD_LWR 365 -#define BSIM4v4_MOD_LDWG 366 -#define BSIM4v4_MOD_LDWB 367 -#define BSIM4v4_MOD_LB0 368 -#define BSIM4v4_MOD_LB1 369 -#define BSIM4v4_MOD_LALPHA0 370 -#define BSIM4v4_MOD_LBETA0 371 -#define BSIM4v4_MOD_LPDIBLB 374 -#define BSIM4v4_MOD_LPRWG 375 -#define BSIM4v4_MOD_LPRWB 376 -#define BSIM4v4_MOD_LCDSCD 377 -#define BSIM4v4_MOD_LAGS 378 - -#define BSIM4v4_MOD_LFRINGE 381 -#define BSIM4v4_MOD_LCGSL 383 -#define BSIM4v4_MOD_LCGDL 384 -#define BSIM4v4_MOD_LCKAPPAS 385 -#define BSIM4v4_MOD_LCF 386 -#define BSIM4v4_MOD_LCLC 387 -#define BSIM4v4_MOD_LCLE 388 -#define BSIM4v4_MOD_LVFBCV 389 -#define BSIM4v4_MOD_LACDE 390 -#define BSIM4v4_MOD_LMOIN 391 -#define BSIM4v4_MOD_LNOFF 392 -#define BSIM4v4_MOD_LALPHA1 394 -#define BSIM4v4_MOD_LVFB 395 -#define BSIM4v4_MOD_LVOFFCV 396 -#define BSIM4v4_MOD_LAGIDL 397 -#define BSIM4v4_MOD_LBGIDL 398 -#define BSIM4v4_MOD_LEGIDL 399 -#define BSIM4v4_MOD_LXRCRG1 400 -#define BSIM4v4_MOD_LXRCRG2 401 -#define BSIM4v4_MOD_LEU 402 -#define BSIM4v4_MOD_LMINV 403 -#define BSIM4v4_MOD_LPDITS 404 -#define BSIM4v4_MOD_LPDITSD 405 -#define BSIM4v4_MOD_LFPROUT 406 -#define BSIM4v4_MOD_LLPEB 407 -#define BSIM4v4_MOD_LDVTP0 408 -#define BSIM4v4_MOD_LDVTP1 409 -#define BSIM4v4_MOD_LCGIDL 410 -#define BSIM4v4_MOD_LPHIN 411 -#define BSIM4v4_MOD_LRSW 412 -#define BSIM4v4_MOD_LRDW 413 -#define BSIM4v4_MOD_LNSD 414 -#define BSIM4v4_MOD_LCKAPPAD 415 -#define BSIM4v4_MOD_LAIGC 416 -#define BSIM4v4_MOD_LBIGC 417 -#define BSIM4v4_MOD_LCIGC 418 -#define BSIM4v4_MOD_LAIGBACC 419 -#define BSIM4v4_MOD_LBIGBACC 420 -#define BSIM4v4_MOD_LCIGBACC 421 -#define BSIM4v4_MOD_LAIGBINV 422 -#define BSIM4v4_MOD_LBIGBINV 423 -#define BSIM4v4_MOD_LCIGBINV 424 -#define BSIM4v4_MOD_LNIGC 425 -#define BSIM4v4_MOD_LNIGBACC 426 -#define BSIM4v4_MOD_LNIGBINV 427 -#define BSIM4v4_MOD_LNTOX 428 -#define BSIM4v4_MOD_LEIGBINV 429 -#define BSIM4v4_MOD_LPIGCD 430 -#define BSIM4v4_MOD_LPOXEDGE 431 -#define BSIM4v4_MOD_LAIGSD 432 -#define BSIM4v4_MOD_LBIGSD 433 -#define BSIM4v4_MOD_LCIGSD 434 - -#define BSIM4v4_MOD_LLAMBDA 435 -#define BSIM4v4_MOD_LVTL 436 -#define BSIM4v4_MOD_LXN 437 -#define BSIM4v4_MOD_LVFBSDOFF 438 - -/* Width dependence */ -#define BSIM4v4_MOD_WCDSC 481 -#define BSIM4v4_MOD_WCDSCB 482 -#define BSIM4v4_MOD_WCIT 483 -#define BSIM4v4_MOD_WNFACTOR 484 -#define BSIM4v4_MOD_WXJ 485 -#define BSIM4v4_MOD_WVSAT 486 -#define BSIM4v4_MOD_WAT 487 -#define BSIM4v4_MOD_WA0 488 -#define BSIM4v4_MOD_WA1 489 -#define BSIM4v4_MOD_WA2 490 -#define BSIM4v4_MOD_WKETA 491 -#define BSIM4v4_MOD_WNSUB 492 -#define BSIM4v4_MOD_WNDEP 493 -#define BSIM4v4_MOD_WNGATE 495 -#define BSIM4v4_MOD_WGAMMA1 496 -#define BSIM4v4_MOD_WGAMMA2 497 -#define BSIM4v4_MOD_WVBX 498 -#define BSIM4v4_MOD_WVBM 500 -#define BSIM4v4_MOD_WXT 502 -#define BSIM4v4_MOD_WK1 505 -#define BSIM4v4_MOD_WKT1 506 -#define BSIM4v4_MOD_WKT1L 507 -#define BSIM4v4_MOD_WK2 508 -#define BSIM4v4_MOD_WKT2 509 -#define BSIM4v4_MOD_WK3 510 -#define BSIM4v4_MOD_WK3B 511 -#define BSIM4v4_MOD_WW0 512 -#define BSIM4v4_MOD_WLPE0 513 -#define BSIM4v4_MOD_WDVT0 514 -#define BSIM4v4_MOD_WDVT1 515 -#define BSIM4v4_MOD_WDVT2 516 -#define BSIM4v4_MOD_WDVT0W 517 -#define BSIM4v4_MOD_WDVT1W 518 -#define BSIM4v4_MOD_WDVT2W 519 -#define BSIM4v4_MOD_WDROUT 520 -#define BSIM4v4_MOD_WDSUB 521 -#define BSIM4v4_MOD_WVTH0 522 -#define BSIM4v4_MOD_WUA 523 -#define BSIM4v4_MOD_WUA1 524 -#define BSIM4v4_MOD_WUB 525 -#define BSIM4v4_MOD_WUB1 526 -#define BSIM4v4_MOD_WUC 527 -#define BSIM4v4_MOD_WUC1 528 -#define BSIM4v4_MOD_WU0 529 -#define BSIM4v4_MOD_WUTE 530 -#define BSIM4v4_MOD_WVOFF 531 -#define BSIM4v4_MOD_WDELTA 532 -#define BSIM4v4_MOD_WRDSW 533 -#define BSIM4v4_MOD_WPRT 534 -#define BSIM4v4_MOD_WLDD 535 -#define BSIM4v4_MOD_WETA 536 -#define BSIM4v4_MOD_WETA0 537 -#define BSIM4v4_MOD_WETAB 538 -#define BSIM4v4_MOD_WPCLM 539 -#define BSIM4v4_MOD_WPDIBL1 540 -#define BSIM4v4_MOD_WPDIBL2 541 -#define BSIM4v4_MOD_WPSCBE1 542 -#define BSIM4v4_MOD_WPSCBE2 543 -#define BSIM4v4_MOD_WPVAG 544 -#define BSIM4v4_MOD_WWR 545 -#define BSIM4v4_MOD_WDWG 546 -#define BSIM4v4_MOD_WDWB 547 -#define BSIM4v4_MOD_WB0 548 -#define BSIM4v4_MOD_WB1 549 -#define BSIM4v4_MOD_WALPHA0 550 -#define BSIM4v4_MOD_WBETA0 551 -#define BSIM4v4_MOD_WPDIBLB 554 -#define BSIM4v4_MOD_WPRWG 555 -#define BSIM4v4_MOD_WPRWB 556 -#define BSIM4v4_MOD_WCDSCD 557 -#define BSIM4v4_MOD_WAGS 558 - -#define BSIM4v4_MOD_WFRINGE 561 -#define BSIM4v4_MOD_WCGSL 563 -#define BSIM4v4_MOD_WCGDL 564 -#define BSIM4v4_MOD_WCKAPPAS 565 -#define BSIM4v4_MOD_WCF 566 -#define BSIM4v4_MOD_WCLC 567 -#define BSIM4v4_MOD_WCLE 568 -#define BSIM4v4_MOD_WVFBCV 569 -#define BSIM4v4_MOD_WACDE 570 -#define BSIM4v4_MOD_WMOIN 571 -#define BSIM4v4_MOD_WNOFF 572 -#define BSIM4v4_MOD_WALPHA1 574 -#define BSIM4v4_MOD_WVFB 575 -#define BSIM4v4_MOD_WVOFFCV 576 -#define BSIM4v4_MOD_WAGIDL 577 -#define BSIM4v4_MOD_WBGIDL 578 -#define BSIM4v4_MOD_WEGIDL 579 -#define BSIM4v4_MOD_WXRCRG1 580 -#define BSIM4v4_MOD_WXRCRG2 581 -#define BSIM4v4_MOD_WEU 582 -#define BSIM4v4_MOD_WMINV 583 -#define BSIM4v4_MOD_WPDITS 584 -#define BSIM4v4_MOD_WPDITSD 585 -#define BSIM4v4_MOD_WFPROUT 586 -#define BSIM4v4_MOD_WLPEB 587 -#define BSIM4v4_MOD_WDVTP0 588 -#define BSIM4v4_MOD_WDVTP1 589 -#define BSIM4v4_MOD_WCGIDL 590 -#define BSIM4v4_MOD_WPHIN 591 -#define BSIM4v4_MOD_WRSW 592 -#define BSIM4v4_MOD_WRDW 593 -#define BSIM4v4_MOD_WNSD 594 -#define BSIM4v4_MOD_WCKAPPAD 595 -#define BSIM4v4_MOD_WAIGC 596 -#define BSIM4v4_MOD_WBIGC 597 -#define BSIM4v4_MOD_WCIGC 598 -#define BSIM4v4_MOD_WAIGBACC 599 -#define BSIM4v4_MOD_WBIGBACC 600 -#define BSIM4v4_MOD_WCIGBACC 601 -#define BSIM4v4_MOD_WAIGBINV 602 -#define BSIM4v4_MOD_WBIGBINV 603 -#define BSIM4v4_MOD_WCIGBINV 604 -#define BSIM4v4_MOD_WNIGC 605 -#define BSIM4v4_MOD_WNIGBACC 606 -#define BSIM4v4_MOD_WNIGBINV 607 -#define BSIM4v4_MOD_WNTOX 608 -#define BSIM4v4_MOD_WEIGBINV 609 -#define BSIM4v4_MOD_WPIGCD 610 -#define BSIM4v4_MOD_WPOXEDGE 611 -#define BSIM4v4_MOD_WAIGSD 612 -#define BSIM4v4_MOD_WBIGSD 613 -#define BSIM4v4_MOD_WCIGSD 614 -#define BSIM4v4_MOD_WLAMBDA 615 -#define BSIM4v4_MOD_WVTL 616 -#define BSIM4v4_MOD_WXN 617 -#define BSIM4v4_MOD_WVFBSDOFF 618 - -/* Cross-term dependence */ -#define BSIM4v4_MOD_PCDSC 661 -#define BSIM4v4_MOD_PCDSCB 662 -#define BSIM4v4_MOD_PCIT 663 -#define BSIM4v4_MOD_PNFACTOR 664 -#define BSIM4v4_MOD_PXJ 665 -#define BSIM4v4_MOD_PVSAT 666 -#define BSIM4v4_MOD_PAT 667 -#define BSIM4v4_MOD_PA0 668 -#define BSIM4v4_MOD_PA1 669 -#define BSIM4v4_MOD_PA2 670 -#define BSIM4v4_MOD_PKETA 671 -#define BSIM4v4_MOD_PNSUB 672 -#define BSIM4v4_MOD_PNDEP 673 -#define BSIM4v4_MOD_PNGATE 675 -#define BSIM4v4_MOD_PGAMMA1 676 -#define BSIM4v4_MOD_PGAMMA2 677 -#define BSIM4v4_MOD_PVBX 678 - -#define BSIM4v4_MOD_PVBM 680 - -#define BSIM4v4_MOD_PXT 682 -#define BSIM4v4_MOD_PK1 685 -#define BSIM4v4_MOD_PKT1 686 -#define BSIM4v4_MOD_PKT1L 687 -#define BSIM4v4_MOD_PK2 688 -#define BSIM4v4_MOD_PKT2 689 -#define BSIM4v4_MOD_PK3 690 -#define BSIM4v4_MOD_PK3B 691 -#define BSIM4v4_MOD_PW0 692 -#define BSIM4v4_MOD_PLPE0 693 - -#define BSIM4v4_MOD_PDVT0 694 -#define BSIM4v4_MOD_PDVT1 695 -#define BSIM4v4_MOD_PDVT2 696 - -#define BSIM4v4_MOD_PDVT0W 697 -#define BSIM4v4_MOD_PDVT1W 698 -#define BSIM4v4_MOD_PDVT2W 699 - -#define BSIM4v4_MOD_PDROUT 700 -#define BSIM4v4_MOD_PDSUB 701 -#define BSIM4v4_MOD_PVTH0 702 -#define BSIM4v4_MOD_PUA 703 -#define BSIM4v4_MOD_PUA1 704 -#define BSIM4v4_MOD_PUB 705 -#define BSIM4v4_MOD_PUB1 706 -#define BSIM4v4_MOD_PUC 707 -#define BSIM4v4_MOD_PUC1 708 -#define BSIM4v4_MOD_PU0 709 -#define BSIM4v4_MOD_PUTE 710 -#define BSIM4v4_MOD_PVOFF 711 -#define BSIM4v4_MOD_PDELTA 712 -#define BSIM4v4_MOD_PRDSW 713 -#define BSIM4v4_MOD_PPRT 714 -#define BSIM4v4_MOD_PLDD 715 -#define BSIM4v4_MOD_PETA 716 -#define BSIM4v4_MOD_PETA0 717 -#define BSIM4v4_MOD_PETAB 718 -#define BSIM4v4_MOD_PPCLM 719 -#define BSIM4v4_MOD_PPDIBL1 720 -#define BSIM4v4_MOD_PPDIBL2 721 -#define BSIM4v4_MOD_PPSCBE1 722 -#define BSIM4v4_MOD_PPSCBE2 723 -#define BSIM4v4_MOD_PPVAG 724 -#define BSIM4v4_MOD_PWR 725 -#define BSIM4v4_MOD_PDWG 726 -#define BSIM4v4_MOD_PDWB 727 -#define BSIM4v4_MOD_PB0 728 -#define BSIM4v4_MOD_PB1 729 -#define BSIM4v4_MOD_PALPHA0 730 -#define BSIM4v4_MOD_PBETA0 731 -#define BSIM4v4_MOD_PPDIBLB 734 - -#define BSIM4v4_MOD_PPRWG 735 -#define BSIM4v4_MOD_PPRWB 736 - -#define BSIM4v4_MOD_PCDSCD 737 -#define BSIM4v4_MOD_PAGS 738 - -#define BSIM4v4_MOD_PFRINGE 741 -#define BSIM4v4_MOD_PCGSL 743 -#define BSIM4v4_MOD_PCGDL 744 -#define BSIM4v4_MOD_PCKAPPAS 745 -#define BSIM4v4_MOD_PCF 746 -#define BSIM4v4_MOD_PCLC 747 -#define BSIM4v4_MOD_PCLE 748 -#define BSIM4v4_MOD_PVFBCV 749 -#define BSIM4v4_MOD_PACDE 750 -#define BSIM4v4_MOD_PMOIN 751 -#define BSIM4v4_MOD_PNOFF 752 -#define BSIM4v4_MOD_PALPHA1 754 -#define BSIM4v4_MOD_PVFB 755 -#define BSIM4v4_MOD_PVOFFCV 756 -#define BSIM4v4_MOD_PAGIDL 757 -#define BSIM4v4_MOD_PBGIDL 758 -#define BSIM4v4_MOD_PEGIDL 759 -#define BSIM4v4_MOD_PXRCRG1 760 -#define BSIM4v4_MOD_PXRCRG2 761 -#define BSIM4v4_MOD_PEU 762 -#define BSIM4v4_MOD_PMINV 763 -#define BSIM4v4_MOD_PPDITS 764 -#define BSIM4v4_MOD_PPDITSD 765 -#define BSIM4v4_MOD_PFPROUT 766 -#define BSIM4v4_MOD_PLPEB 767 -#define BSIM4v4_MOD_PDVTP0 768 -#define BSIM4v4_MOD_PDVTP1 769 -#define BSIM4v4_MOD_PCGIDL 770 -#define BSIM4v4_MOD_PPHIN 771 -#define BSIM4v4_MOD_PRSW 772 -#define BSIM4v4_MOD_PRDW 773 -#define BSIM4v4_MOD_PNSD 774 -#define BSIM4v4_MOD_PCKAPPAD 775 -#define BSIM4v4_MOD_PAIGC 776 -#define BSIM4v4_MOD_PBIGC 777 -#define BSIM4v4_MOD_PCIGC 778 -#define BSIM4v4_MOD_PAIGBACC 779 -#define BSIM4v4_MOD_PBIGBACC 780 -#define BSIM4v4_MOD_PCIGBACC 781 -#define BSIM4v4_MOD_PAIGBINV 782 -#define BSIM4v4_MOD_PBIGBINV 783 -#define BSIM4v4_MOD_PCIGBINV 784 -#define BSIM4v4_MOD_PNIGC 785 -#define BSIM4v4_MOD_PNIGBACC 786 -#define BSIM4v4_MOD_PNIGBINV 787 -#define BSIM4v4_MOD_PNTOX 788 -#define BSIM4v4_MOD_PEIGBINV 789 -#define BSIM4v4_MOD_PPIGCD 790 -#define BSIM4v4_MOD_PPOXEDGE 791 -#define BSIM4v4_MOD_PAIGSD 792 -#define BSIM4v4_MOD_PBIGSD 793 -#define BSIM4v4_MOD_PCIGSD 794 - -#define BSIM4v4_MOD_SAREF 795 -#define BSIM4v4_MOD_SBREF 796 -#define BSIM4v4_MOD_KU0 797 -#define BSIM4v4_MOD_KVSAT 798 -#define BSIM4v4_MOD_TKU0 799 -#define BSIM4v4_MOD_LLODKU0 800 -#define BSIM4v4_MOD_WLODKU0 801 -#define BSIM4v4_MOD_LLODVTH 802 -#define BSIM4v4_MOD_WLODVTH 803 -#define BSIM4v4_MOD_LKU0 804 -#define BSIM4v4_MOD_WKU0 805 -#define BSIM4v4_MOD_PKU0 806 -#define BSIM4v4_MOD_KVTH0 807 -#define BSIM4v4_MOD_LKVTH0 808 -#define BSIM4v4_MOD_WKVTH0 809 -#define BSIM4v4_MOD_PKVTH0 810 -#define BSIM4v4_MOD_WLOD 811 -#define BSIM4v4_MOD_STK2 812 -#define BSIM4v4_MOD_LODK2 813 -#define BSIM4v4_MOD_STETA0 814 -#define BSIM4v4_MOD_LODETA0 815 - -#define BSIM4v4_MOD_PLAMBDA 825 -#define BSIM4v4_MOD_PVTL 826 -#define BSIM4v4_MOD_PXN 827 -#define BSIM4v4_MOD_PVFBSDOFF 828 - -#define BSIM4v4_MOD_TNOM 831 -#define BSIM4v4_MOD_CGSO 832 -#define BSIM4v4_MOD_CGDO 833 -#define BSIM4v4_MOD_CGBO 834 -#define BSIM4v4_MOD_XPART 835 -#define BSIM4v4_MOD_RSH 836 -#define BSIM4v4_MOD_JSS 837 -#define BSIM4v4_MOD_PBS 838 -#define BSIM4v4_MOD_MJS 839 -#define BSIM4v4_MOD_PBSWS 840 -#define BSIM4v4_MOD_MJSWS 841 -#define BSIM4v4_MOD_CJS 842 -#define BSIM4v4_MOD_CJSWS 843 -#define BSIM4v4_MOD_NMOS 844 -#define BSIM4v4_MOD_PMOS 845 -#define BSIM4v4_MOD_NOIA 846 -#define BSIM4v4_MOD_NOIB 847 -#define BSIM4v4_MOD_NOIC 848 -#define BSIM4v4_MOD_LINT 849 -#define BSIM4v4_MOD_LL 850 -#define BSIM4v4_MOD_LLN 851 -#define BSIM4v4_MOD_LW 852 -#define BSIM4v4_MOD_LWN 853 -#define BSIM4v4_MOD_LWL 854 -#define BSIM4v4_MOD_LMIN 855 -#define BSIM4v4_MOD_LMAX 856 -#define BSIM4v4_MOD_WINT 857 -#define BSIM4v4_MOD_WL 858 -#define BSIM4v4_MOD_WLN 859 -#define BSIM4v4_MOD_WW 860 -#define BSIM4v4_MOD_WWN 861 -#define BSIM4v4_MOD_WWL 862 -#define BSIM4v4_MOD_WMIN 863 -#define BSIM4v4_MOD_WMAX 864 -#define BSIM4v4_MOD_DWC 865 -#define BSIM4v4_MOD_DLC 866 -#define BSIM4v4_MOD_XL 867 -#define BSIM4v4_MOD_XW 868 -#define BSIM4v4_MOD_EM 869 -#define BSIM4v4_MOD_EF 870 -#define BSIM4v4_MOD_AF 871 -#define BSIM4v4_MOD_KF 872 -#define BSIM4v4_MOD_NJS 873 -#define BSIM4v4_MOD_XTIS 874 -#define BSIM4v4_MOD_PBSWGS 875 -#define BSIM4v4_MOD_MJSWGS 876 -#define BSIM4v4_MOD_CJSWGS 877 -#define BSIM4v4_MOD_JSWS 878 -#define BSIM4v4_MOD_LLC 879 -#define BSIM4v4_MOD_LWC 880 -#define BSIM4v4_MOD_LWLC 881 -#define BSIM4v4_MOD_WLC 882 -#define BSIM4v4_MOD_WWC 883 -#define BSIM4v4_MOD_WWLC 884 -#define BSIM4v4_MOD_DWJ 885 -#define BSIM4v4_MOD_JSD 886 -#define BSIM4v4_MOD_PBD 887 -#define BSIM4v4_MOD_MJD 888 -#define BSIM4v4_MOD_PBSWD 889 -#define BSIM4v4_MOD_MJSWD 890 -#define BSIM4v4_MOD_CJD 891 -#define BSIM4v4_MOD_CJSWD 892 -#define BSIM4v4_MOD_NJD 893 -#define BSIM4v4_MOD_XTID 894 -#define BSIM4v4_MOD_PBSWGD 895 -#define BSIM4v4_MOD_MJSWGD 896 -#define BSIM4v4_MOD_CJSWGD 897 -#define BSIM4v4_MOD_JSWD 898 -#define BSIM4v4_MOD_DLCIG 899 - -/* trap-assisted tunneling */ - -#define BSIM4v4_MOD_JTSS 900 -#define BSIM4v4_MOD_JTSD 901 -#define BSIM4v4_MOD_JTSSWS 902 -#define BSIM4v4_MOD_JTSSWD 903 -#define BSIM4v4_MOD_JTSSWGS 904 -#define BSIM4v4_MOD_JTSSWGD 905 -#define BSIM4v4_MOD_NJTS 906 -#define BSIM4v4_MOD_NJTSSW 907 -#define BSIM4v4_MOD_NJTSSWG 908 -#define BSIM4v4_MOD_XTSS 909 -#define BSIM4v4_MOD_XTSD 910 -#define BSIM4v4_MOD_XTSSWS 911 -#define BSIM4v4_MOD_XTSSWD 912 -#define BSIM4v4_MOD_XTSSWGS 913 -#define BSIM4v4_MOD_XTSSWGD 914 -#define BSIM4v4_MOD_TNJTS 915 -#define BSIM4v4_MOD_TNJTSSW 916 -#define BSIM4v4_MOD_TNJTSSWG 917 -#define BSIM4v4_MOD_VTSS 918 -#define BSIM4v4_MOD_VTSD 919 -#define BSIM4v4_MOD_VTSSWS 920 -#define BSIM4v4_MOD_VTSSWD 921 -#define BSIM4v4_MOD_VTSSWGS 922 -#define BSIM4v4_MOD_VTSSWGD 923 - -/* device questions */ -#define BSIM4v4_DNODE 945 -#define BSIM4v4_GNODEEXT 946 -#define BSIM4v4_SNODE 947 -#define BSIM4v4_BNODE 948 -#define BSIM4v4_DNODEPRIME 949 -#define BSIM4v4_GNODEPRIME 950 -#define BSIM4v4_GNODEMIDE 951 -#define BSIM4v4_GNODEMID 952 -#define BSIM4v4_SNODEPRIME 953 -#define BSIM4v4_BNODEPRIME 954 -#define BSIM4v4_DBNODE 955 -#define BSIM4v4_SBNODE 956 -#define BSIM4v4_VBD 957 -#define BSIM4v4_VBS 958 -#define BSIM4v4_VGS 959 -#define BSIM4v4_VDS 960 -#define BSIM4v4_CD 961 -#define BSIM4v4_CBS 962 -#define BSIM4v4_CBD 963 -#define BSIM4v4_GM 964 -#define BSIM4v4_GDS 965 -#define BSIM4v4_GMBS 966 -#define BSIM4v4_GBD 967 -#define BSIM4v4_GBS 968 -#define BSIM4v4_QB 969 -#define BSIM4v4_CQB 970 -#define BSIM4v4_QG 971 -#define BSIM4v4_CQG 972 -#define BSIM4v4_QD 973 -#define BSIM4v4_CQD 974 -#define BSIM4v4_CGGB 975 -#define BSIM4v4_CGDB 976 -#define BSIM4v4_CGSB 977 -#define BSIM4v4_CBGB 978 -#define BSIM4v4_CAPBD 979 -#define BSIM4v4_CQBD 980 -#define BSIM4v4_CAPBS 981 -#define BSIM4v4_CQBS 982 -#define BSIM4v4_CDGB 983 -#define BSIM4v4_CDDB 984 -#define BSIM4v4_CDSB 985 -#define BSIM4v4_VON 986 -#define BSIM4v4_VDSAT 987 -#define BSIM4v4_QBS 988 -#define BSIM4v4_QBD 989 -#define BSIM4v4_SOURCECONDUCT 990 -#define BSIM4v4_DRAINCONDUCT 991 -#define BSIM4v4_CBDB 992 -#define BSIM4v4_CBSB 993 -#define BSIM4v4_CSUB 994 -#define BSIM4v4_QINV 995 -#define BSIM4v4_IGIDL 996 -#define BSIM4v4_CSGB 997 -#define BSIM4v4_CSDB 998 -#define BSIM4v4_CSSB 999 -#define BSIM4v4_CGBB 1000 -#define BSIM4v4_CDBB 1001 -#define BSIM4v4_CSBB 1002 -#define BSIM4v4_CBBB 1003 -#define BSIM4v4_QS 1004 -#define BSIM4v4_IGISL 1005 -#define BSIM4v4_IGS 1006 -#define BSIM4v4_IGD 1007 -#define BSIM4v4_IGB 1008 -#define BSIM4v4_IGCS 1009 -#define BSIM4v4_IGCD 1010 - -#include "bsim4v4ext.h" - - -extern void BSIM4v4evaluate(double,double,double,BSIM4v4instance*,BSIM4v4model*, - double*,double*,double*, double*, double*, double*, double*, - double*, double*, double*, double*, double*, double*, double*, - double*, double*, double*, double*, CKTcircuit*); -extern int BSIM4v4debug(BSIM4v4model*, BSIM4v4instance*, CKTcircuit*, int); -extern int BSIM4v4checkModel(BSIM4v4model*, BSIM4v4instance*, CKTcircuit*); -extern int BSIM4v4PAeffGeo(double, int, int, double, double, double, double, double *, double *, double *, double *); -extern int BSIM4v4RdseffGeo(double, int, int, int, double, double, double, double, double, int, double *); - -#endif /*BSIM4v4*/ diff --git a/src/spicelib/devices/bsim4v4/bsim4v4ext.h b/src/spicelib/devices/bsim4v4/bsim4v4ext.h deleted file mode 100644 index fd5fce099..000000000 --- a/src/spicelib/devices/bsim4v4/bsim4v4ext.h +++ /dev/null @@ -1,33 +0,0 @@ -/********** -Copyright 2004 Regents of the University of California. All rights reserved. -Author: 2000 Weidong Liu -Author: 2001- Xuemei Xi -File: bsim4ext.h -**********/ - - -extern int BSIM4v4acLoad(GENmodel *,CKTcircuit*); -extern int BSIM4v4ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*); -extern int BSIM4v4convTest(GENmodel *,CKTcircuit*); -extern int BSIM4v4delete(GENmodel*,IFuid,GENinstance**); -extern void BSIM4v4destroy(GENmodel**); -extern int BSIM4v4getic(GENmodel*,CKTcircuit*); -extern int BSIM4v4load(GENmodel*,CKTcircuit*); -extern int BSIM4v4mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM4v4mDelete(GENmodel**,IFuid,GENmodel*); -extern int BSIM4v4mParam(int,IFvalue*,GENmodel*); -extern void BSIM4v4mosCap(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 BSIM4v4param(int,IFvalue*,GENinstance*,IFvalue*); -extern int BSIM4v4pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); -extern int BSIM4v4setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); -extern int BSIM4v4temp(GENmodel*,CKTcircuit*); -extern int BSIM4v4trunc(GENmodel*,CKTcircuit*,double*); -extern int BSIM4v4noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); -extern int BSIM4v4unsetup(GENmodel*,CKTcircuit*); - - diff --git a/src/spicelib/devices/bsim4v4/bsim4v4init.c b/src/spicelib/devices/bsim4v4/bsim4v4init.c deleted file mode 100644 index bf152c439..000000000 --- a/src/spicelib/devices/bsim4v4/bsim4v4init.c +++ /dev/null @@ -1,84 +0,0 @@ -#include "ngspice/config.h" - -#include "ngspice/devdefs.h" - -#include "bsim4v4itf.h" -#include "bsim4v4ext.h" -#include "bsim4v4init.h" - - -SPICEdev BSIM4v4info = { - { - "BSIM4v4", - "Berkeley Short Channel IGFET Model-4", - - &BSIM4v4nSize, - &BSIM4v4nSize, - BSIM4v4names, - - &BSIM4v4pTSize, - BSIM4v4pTable, - - &BSIM4v4mPTSize, - BSIM4v4mPTable, - -#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 - }, - - BSIM4v4param, /* DEVparam */ - BSIM4v4mParam, /* DEVmodParam */ - BSIM4v4load, /* DEVload */ - BSIM4v4setup, /* DEVsetup */ - BSIM4v4unsetup, /* DEVunsetup */ - BSIM4v4setup, /* DEVpzSetup */ - BSIM4v4temp, /* DEVtemperature */ - BSIM4v4trunc, /* DEVtrunc */ - NULL, /* DEVfindBranch */ - BSIM4v4acLoad, /* DEVacLoad */ - NULL, /* DEVaccept */ - BSIM4v4destroy, /* DEVdestroy */ - BSIM4v4mDelete, /* DEVmodDelete */ - BSIM4v4delete, /* DEVdelete */ - BSIM4v4getic, /* DEVsetic */ - BSIM4v4ask, /* DEVask */ - BSIM4v4mAsk, /* DEVmodAsk */ - BSIM4v4pzLoad, /* DEVpzLoad */ - BSIM4v4convTest, /* DEVconvTest */ - NULL, /* DEVsenSetup */ - NULL, /* DEVsenLoad */ - NULL, /* DEVsenUpdate */ - NULL, /* DEVsenAcLoad */ - NULL, /* DEVsenPrint */ - NULL, /* DEVsenTrunc */ - NULL, /* DEVdisto */ - BSIM4v4noise, /* DEVnoise */ - NULL, /* DEVsoaCheck */ -#ifdef CIDER - NULL, /* DEVdump */ - NULL, /* DEVacct */ -#endif - &BSIM4v4iSize, /* DEVinstSize */ - &BSIM4v4mSize /* DEVmodSize */ -}; - - -SPICEdev * -get_bsim4v4_info(void) -{ - return &BSIM4v4info; -} diff --git a/src/spicelib/devices/bsim4v4/bsim4v4init.h b/src/spicelib/devices/bsim4v4/bsim4v4init.h deleted file mode 100644 index 33cc59cf2..000000000 --- a/src/spicelib/devices/bsim4v4/bsim4v4init.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _BSIM4V4INIT_H -#define _BSIM4V4INIT_H - -extern IFparm BSIM4v4pTable[ ]; -extern IFparm BSIM4v4mPTable[ ]; -extern char *BSIM4v4names[ ]; -extern int BSIM4v4pTSize; -extern int BSIM4v4mPTSize; -extern int BSIM4v4nSize; -extern int BSIM4v4iSize; -extern int BSIM4v4mSize; - -#endif diff --git a/src/spicelib/devices/bsim4v4/bsim4v4itf.h b/src/spicelib/devices/bsim4v4/bsim4v4itf.h deleted file mode 100644 index 3191da0d9..000000000 --- a/src/spicelib/devices/bsim4v4/bsim4v4itf.h +++ /dev/null @@ -1,13 +0,0 @@ -/********** -Copyright 2004 Regents of the University of California. All rights reserved. -Author: 2000 Weidong Liu. -Author: 2001- Xuemei Xi -File: bsim4itf.h -**********/ - -#ifndef DEV_BSIM4V4 -#define DEV_BSIM4V4 - -SPICEdev *get_bsim4v4_info(void); - -#endif diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index 4cc619276..0fed660b0 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -79,7 +79,6 @@ int add_udn(int,Evt_Udn_Info_t **); #include "bsim3v1/bsim3v1itf.h" #include "bsim3v32/bsim3v32itf.h" #include "bsim4/bsim4itf.h" -#include "bsim4v4/bsim4v4itf.h" #include "bsim4v5/bsim4v5itf.h" #include "bsim4v6/bsim4v6itf.h" #include "bsim3soi_pd/b3soipditf.h" @@ -150,7 +149,6 @@ static SPICEdev *(*static_devices[])(void) = { get_bsim3v32_info, get_b4soi_info, get_bsim4_info, - get_bsim4v4_info, get_bsim4v5_info, get_bsim4v6_info, get_b3soipd_info, @@ -284,12 +282,12 @@ SPICEdev ** devices(void) /*not yet usable*/ #ifdef ADMS -#define DEVICES_USED {"asrc", "bjt", "vbic", "bsim1", "bsim2", "bsim3", "bsim3v32", "bsim3v2", "bsim3v1", "bsim4", "bsim4v4", "bsim4v5", "bsim4v6", \ +#define DEVICES_USED {"asrc", "bjt", "vbic", "bsim1", "bsim2", "bsim3", "bsim3v32", "bsim3v2", "bsim3v1", "bsim4", "bsim4v5", "bsim4v6", \ "bsim4soi", "bsim3soipd", "bsim3soifd", "bsim3soidd", "hisim2", "hisimhv1", \ "cap", "cccs", "ccvs", "csw", "dio", "hfet", "hfet2", "ind", "isrc", "jfet", "ltra", "mes", "mesa" ,"mos1", "mos2", "mos3", \ "mos6", "mos9", "res", "soi3", "sw", "tra", "urc", "vccs", "vcvs", "vsrc", "hicum0", "hicum2", "bjt504t", "ekv", "psp102"} #else -#define DEVICES_USED {"asrc", "bjt", "vbic", "bsim1", "bsim2", "bsim3", "bsim3v32", "bsim3v2", "bsim3v1", "bsim4", "bsim4v4", "bsim4v5", "bsim4v6", \ +#define DEVICES_USED {"asrc", "bjt", "vbic", "bsim1", "bsim2", "bsim3", "bsim3v32", "bsim3v2", "bsim3v1", "bsim4", "bsim4v5", "bsim4v6", \ "bsim4soi", "bsim3soipd", "bsim3soifd", "bsim3soidd", "hisim2", "hisimhv1", \ "cap", "cccs", "ccvs", "csw", "dio", "hfet", "hfet2", "ind", "isrc", "jfet", "ltra", "mes", "mesa" ,"mos1", "mos2", "mos3", \ "mos6", "mos9", "res", "soi3", "sw", "tra", "urc", "vccs", "vcvs", "vsrc"} diff --git a/src/spicelib/parser/inp2m.c b/src/spicelib/parser/inp2m.c index 056366f62..85505077e 100644 --- a/src/spicelib/parser/inp2m.c +++ b/src/spicelib/parser/inp2m.c @@ -223,7 +223,6 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current) && thismodel->INPmodType != INPtypelook ("B3SOIFD") && thismodel->INPmodType != INPtypelook ("B3SOIDD") && thismodel->INPmodType != INPtypelook ("BSIM4") - && thismodel->INPmodType != INPtypelook ("BSIM4v4") && thismodel->INPmodType != INPtypelook ("BSIM4v5") && thismodel->INPmodType != INPtypelook ("BSIM4v6") && thismodel->INPmodType != INPtypelook ("BSIM3v0") diff --git a/src/spicelib/parser/inpdomod.c b/src/spicelib/parser/inpdomod.c index 67e24bb60..6e96416eb 100644 --- a/src/spicelib/parser/inpdomod.c +++ b/src/spicelib/parser/inpdomod.c @@ -304,10 +304,7 @@ char *INPdomodel(CKTcircuit *ckt, card * image, INPtables * tab) break; case 14: case 54: err = INPfindVer(line, ver); /* mapping of minor versions >= 4.2.1 are included */ - if ((prefix("4.0", ver)) || (prefix("4.1", ver)) || (prefix("4.2", ver)) || (prefix("4.3", ver)) || (prefix("4.4", ver))) { - type = INPtypelook("BSIM4v4"); - } - if (prefix("4.5", ver)) { + if ((prefix("4.0", ver)) || (prefix("4.1", ver)) || (prefix("4.2", ver)) || (prefix("4.3", ver)) || (prefix("4.4", ver)) || (prefix("4.5", ver))) { type = INPtypelook("BSIM4v5"); } if (prefix("4.6", ver)) { diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 6511cf86c..7d8eb69c3 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -218,7 +218,6 @@ INPgetModBin( CKTcircuit* ckt, char* name, INPmodel** model, INPtables* tab, cha && modtmp->INPmodType != INPtypelook ("BSIM3v0") && modtmp->INPmodType != INPtypelook ("BSIM3v1") && modtmp->INPmodType != INPtypelook ("BSIM4") - && modtmp->INPmodType != INPtypelook ("BSIM4v4") && modtmp->INPmodType != INPtypelook ("BSIM4v5") && modtmp->INPmodType != INPtypelook ("BSIM4v6") && modtmp->INPmodType != INPtypelook ("HiSIM2") diff --git a/visualc-shared/sharedspice.vcproj b/visualc-shared/sharedspice.vcproj index 44cb02259..892e8252f 100644 --- a/visualc-shared/sharedspice.vcproj +++ b/visualc-shared/sharedspice.vcproj @@ -564,22 +564,6 @@ RelativePath="..\src\spicelib\devices\bsim4\bsim4itf.h" > - - - - - - - - @@ -3240,82 +3224,6 @@ RelativePath="..\src\spicelib\devices\bsim4\b4trunc.c" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -3632,10 +3540,6 @@ RelativePath="..\src\spicelib\devices\bsim4\bsim4init.c" > - - diff --git a/visualc/vngspice.vcproj b/visualc/vngspice.vcproj index d38555b67..0157213c2 100644 --- a/visualc/vngspice.vcproj +++ b/visualc/vngspice.vcproj @@ -1360,22 +1360,6 @@ RelativePath="..\src\spicelib\devices\bsim4\bsim4itf.h" > - - - - - - - - @@ -4020,82 +4004,6 @@ RelativePath="..\src\spicelib\devices\bsim4\b4trunc.c" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4412,10 +4320,6 @@ RelativePath="..\src\spicelib\devices\bsim4\bsim4init.c" > - - diff --git a/visualc/vngspice.vcxproj b/visualc/vngspice.vcxproj index ce46af199..716f1c984 100644 --- a/visualc/vngspice.vcxproj +++ b/visualc/vngspice.vcxproj @@ -884,10 +884,6 @@ - - - - @@ -1550,25 +1546,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1648,7 +1625,6 @@ - diff --git a/visualc/vngspice_fftw.vcproj b/visualc/vngspice_fftw.vcproj index e16ed0f3c..8b6c20405 100644 --- a/visualc/vngspice_fftw.vcproj +++ b/visualc/vngspice_fftw.vcproj @@ -1391,22 +1391,6 @@ RelativePath="..\src\spicelib\devices\bsim4\bsim4itf.h" > - - - - - - - - @@ -4051,82 +4035,6 @@ RelativePath="..\src\spicelib\devices\bsim4\b4trunc.c" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4443,10 +4351,6 @@ RelativePath="..\src\spicelib\devices\bsim4\bsim4init.c" > - - diff --git a/visualc/vngspice_fftw_vc10.vcxproj b/visualc/vngspice_fftw_vc10.vcxproj index fc6029563..f599e24e8 100644 --- a/visualc/vngspice_fftw_vc10.vcxproj +++ b/visualc/vngspice_fftw_vc10.vcxproj @@ -867,10 +867,6 @@ - - - - @@ -1533,25 +1529,6 @@ - - - - - - - - - - - - - - - - - - - @@ -1631,7 +1608,6 @@ -