Merge remote branch 'origin/new_kirchhoff-3' into KLU-kirchhoff
Conflicts: configure.ac src/include/ngspice/devdefs.h src/include/ngspice/smpdefs.h src/maths/sparse/spsmp.c src/spicelib/devices/asrc/asrcinit.c src/spicelib/devices/bjt/Makefile.am src/spicelib/devices/bjt/bjtinit.c src/spicelib/devices/bsim1/Makefile.am src/spicelib/devices/bsim1/bsim1ext.h src/spicelib/devices/bsim1/bsim1init.c src/spicelib/devices/bsim2/Makefile.am src/spicelib/devices/bsim2/bsim2ext.h src/spicelib/devices/bsim2/bsim2init.c src/spicelib/devices/bsim3/Makefile.am src/spicelib/devices/bsim3/bsim3ext.h src/spicelib/devices/bsim3/bsim3init.c src/spicelib/devices/bsim3soi_dd/Makefile.am src/spicelib/devices/bsim3soi_dd/b3soiddext.h src/spicelib/devices/bsim3soi_dd/b3soiddinit.c src/spicelib/devices/bsim3soi_fd/Makefile.am src/spicelib/devices/bsim3soi_fd/b3soifdext.h src/spicelib/devices/bsim3soi_fd/b3soifdinit.c src/spicelib/devices/bsim3soi_pd/Makefile.am src/spicelib/devices/bsim3soi_pd/b3soipdext.h src/spicelib/devices/bsim3soi_pd/b3soipdinit.c src/spicelib/devices/bsim3v0/Makefile.am src/spicelib/devices/bsim3v0/bsim3v0ext.h src/spicelib/devices/bsim3v0/bsim3v0init.c src/spicelib/devices/bsim3v1/Makefile.am src/spicelib/devices/bsim3v1/bsim3v1ext.h src/spicelib/devices/bsim3v1/bsim3v1init.c src/spicelib/devices/bsim3v32/Makefile.am src/spicelib/devices/bsim3v32/bsim3v32ext.h src/spicelib/devices/bsim3v32/bsim3v32init.c src/spicelib/devices/bsim4/Makefile.am src/spicelib/devices/bsim4/bsim4def.h src/spicelib/devices/bsim4/bsim4ext.h src/spicelib/devices/bsim4/bsim4init.c src/spicelib/devices/bsim4v4/Makefile.am src/spicelib/devices/bsim4v4/bsim4v4ext.h src/spicelib/devices/bsim4v4/bsim4v4init.c src/spicelib/devices/bsim4v5/Makefile.am src/spicelib/devices/bsim4v5/bsim4v5ext.h src/spicelib/devices/bsim4v5/bsim4v5init.c src/spicelib/devices/bsim4v6/Makefile.am src/spicelib/devices/bsim4v6/bsim4v6ext.h src/spicelib/devices/bsim4v6/bsim4v6init.c src/spicelib/devices/bsimsoi/Makefile.am src/spicelib/devices/bsimsoi/b4soiext.h src/spicelib/devices/bsimsoi/b4soiinit.c src/spicelib/devices/cap/Makefile.am src/spicelib/devices/cap/capdefs.h src/spicelib/devices/cap/capext.h src/spicelib/devices/cap/capinit.c src/spicelib/devices/cccs/cccsinit.c src/spicelib/devices/ccvs/ccvsinit.c src/spicelib/devices/cpl/cplinit.c src/spicelib/devices/csw/cswinit.c src/spicelib/devices/dio/Makefile.am src/spicelib/devices/dio/diodefs.h src/spicelib/devices/dio/dioext.h src/spicelib/devices/dio/dioinit.c src/spicelib/devices/hfet1/Makefile.am src/spicelib/devices/hfet1/hfetext.h src/spicelib/devices/hfet1/hfetinit.c src/spicelib/devices/hfet2/Makefile.am src/spicelib/devices/hfet2/hfet2ext.h src/spicelib/devices/hfet2/hfet2init.c src/spicelib/devices/hisim2/Makefile.am src/spicelib/devices/hisim2/hsm2ext.h src/spicelib/devices/hisim2/hsm2init.c src/spicelib/devices/hisimhv1/hsmhvext.h src/spicelib/devices/hisimhv1/hsmhvinit.c src/spicelib/devices/ind/Makefile.am src/spicelib/devices/ind/inddefs.h src/spicelib/devices/ind/indinit.c src/spicelib/devices/isrc/isrcinit.c src/spicelib/devices/jfet/Makefile.am src/spicelib/devices/jfet/jfetext.h src/spicelib/devices/jfet/jfetinit.c src/spicelib/devices/jfet2/Makefile.am src/spicelib/devices/jfet2/jfet2ext.h src/spicelib/devices/jfet2/jfet2init.c src/spicelib/devices/ltra/ltrainit.c src/spicelib/devices/mes/Makefile.am src/spicelib/devices/mes/mesext.h src/spicelib/devices/mes/mesinit.c src/spicelib/devices/mesa/Makefile.am src/spicelib/devices/mesa/mesaext.h src/spicelib/devices/mesa/mesainit.c src/spicelib/devices/mos1/Makefile.am src/spicelib/devices/mos1/mos1ext.h src/spicelib/devices/mos1/mos1init.c src/spicelib/devices/mos2/Makefile.am src/spicelib/devices/mos2/mos2ext.h src/spicelib/devices/mos2/mos2init.c src/spicelib/devices/mos3/Makefile.am src/spicelib/devices/mos3/mos3ext.h src/spicelib/devices/mos3/mos3init.c src/spicelib/devices/mos6/Makefile.am src/spicelib/devices/mos6/mos6ext.h src/spicelib/devices/mos6/mos6init.c src/spicelib/devices/mos9/Makefile.am src/spicelib/devices/mos9/mos9ext.h src/spicelib/devices/mos9/mos9init.c src/spicelib/devices/res/Makefile.am src/spicelib/devices/res/resdefs.h src/spicelib/devices/res/resext.h src/spicelib/devices/res/resinit.c src/spicelib/devices/soi3/Makefile.am src/spicelib/devices/soi3/soi3ext.h src/spicelib/devices/soi3/soi3init.c src/spicelib/devices/sw/swinit.c src/spicelib/devices/tra/trainit.c src/spicelib/devices/txl/txlinit.c src/spicelib/devices/urc/urcinit.c src/spicelib/devices/vbic/Makefile.am src/spicelib/devices/vbic/vbicinit.c src/spicelib/devices/vccs/vccsinit.c src/spicelib/devices/vcvs/vcvsinit.c src/spicelib/devices/vsrc/Makefile.am src/spicelib/devices/vsrc/vsrcdefs.h src/spicelib/devices/vsrc/vsrcext.h src/spicelib/devices/vsrc/vsrcinit.c
This commit is contained in:
commit
85e3b90d26
10
INSTALL
10
INSTALL
|
|
@ -250,6 +250,14 @@ Most of the options now following are not well maintained, are not tested or eve
|
|||
"tclspice" is compiled and installed instead of
|
||||
plain ngspice.
|
||||
|
||||
--with-ngshared
|
||||
This option let you compile ngspice as a shared
|
||||
library or dll, allowing an application controlling
|
||||
ngspice. This option excludes using --with-x or
|
||||
--with-wingui. Useful additional options are
|
||||
--enable-xspice --enable-cider --enable-openmp.
|
||||
No graphics inetrface is provided, this has to be
|
||||
handled by the controlling application.
|
||||
|
||||
1.4.3 Options Useful for Debugging Ngspice
|
||||
|
||||
|
|
@ -538,7 +546,7 @@ Most of the options now following are not well maintained, are not tested or eve
|
|||
|
||||
9.2 make ngspice with MS Visual Studio 2008
|
||||
|
||||
ngspice may be compiled with MS Visual Studio 2008.
|
||||
ngspice may be compiled with MS Visual Studio 2008 or 2010.
|
||||
|
||||
CIDER and XSPICE are included, but the code models for XSPICE
|
||||
(*.cm) are not (yet) made. You may however use the code models
|
||||
|
|
|
|||
14
README.adms
14
README.adms
|
|
@ -22,6 +22,20 @@
|
|||
* 02110-1301 USA *
|
||||
***************************************************************************
|
||||
|
||||
WARNING!
|
||||
|
||||
The text in this document has been prepared in 2006 and is outdated. It is
|
||||
provided here only for reference and may provide some (historical)
|
||||
information.
|
||||
|
||||
Please refer to the ngspice adms web page at
|
||||
http://ngspice.sourceforge.net/admshowto.html
|
||||
for actual information on how to integrate Verilog A device models into
|
||||
ngspice.
|
||||
|
||||
Holger Vogt, May 2013
|
||||
|
||||
|
||||
|
||||
INTRODUCTION
|
||||
|
||||
|
|
|
|||
16
configure.ac
16
configure.ac
|
|
@ -182,6 +182,10 @@ AC_ARG_WITH([tcl],
|
|||
AC_ARG_WITH([ngshared],
|
||||
[AS_HELP_STRING([--with-ngshared], [Compiles ngspice as shared library (dll)])])
|
||||
|
||||
# --enable-kirchhoff: enable KCL
|
||||
AC_ARG_ENABLE([kirchhoff],
|
||||
[AS_HELP_STRING([--enable-kirchhoff], [Enables the Kirchhoff Current Law Verification])])
|
||||
|
||||
# readline and editline cannot both be enabled
|
||||
if test "x$with_editline" = xyes; then
|
||||
if test "x$with_readline" = xyes; then
|
||||
|
|
@ -801,6 +805,7 @@ AC_MSG_RESULT([Settings which were chosen:])
|
|||
if test "x$enable_sense2" = xyes; then
|
||||
AC_DEFINE([WANT_SENSE2], [], [Define if we want spice2 sensitivity analysis])
|
||||
AC_MSG_RESULT([Spice2 sensitivity analysis enabled])
|
||||
AC_MSG_WARN([This feature is UNSUPPORTED])
|
||||
fi
|
||||
if test "x$enable_nobypass" = xyes; then
|
||||
AC_DEFINE([NOBYPASS], [], [Define if we want NOBYPASS])
|
||||
|
|
@ -856,7 +861,7 @@ if test "x$enable_pzdebug" = xyes; then
|
|||
fi
|
||||
if test "x$enable_pss" = xyes; then
|
||||
AC_DEFINE([WITH_PSS], [], [Define if you want PSS analysis])
|
||||
AC_MSG_RESULT(WARNING: PSS analysis enabled)
|
||||
AC_MSG_RESULT([WARNING: PSS analysis enabled])
|
||||
fi
|
||||
if test "x$enable_blktmsdebug" = xyes; then
|
||||
AC_DEFINE([D_DBG_BLOCKTIMES], [], [Define if we want debug distortion analysis (BLOCKTIMES)])
|
||||
|
|
@ -879,6 +884,12 @@ fi
|
|||
AC_SUBST([XGRAPHDIR])
|
||||
AC_SUBST([NOTXGRAPH])
|
||||
|
||||
if test "x$enable_kirchhoff" = xyes; then
|
||||
AC_DEFINE([KIRCHHOFF], [], [Define if we want to enable the Kirchhoff Current Law Verification])
|
||||
AC_MSG_RESULT([WARNING: Kirchhoff Current Law Verification Enabled (experimental)])
|
||||
fi
|
||||
AM_CONDITIONAL([KIRCHHOFF_WANTED], [test "x$enable_kirchhoff" = xyes])
|
||||
|
||||
AC_CHECK_PROGS([YACC], ['bison -y' byacc yacc])
|
||||
|
||||
################# XSPICE ##################################################
|
||||
|
|
@ -945,6 +956,8 @@ AM_CONDITIONAL([NUMDEV_WANTED], [test "x$enable_cider" = xyes])
|
|||
|
||||
AM_CONDITIONAL([PSS_WANTED], [test "x$enable_pss" = xyes])
|
||||
|
||||
AM_CONDITIONAL([SENSE2_WANTED], [test "x$enable_sense2" = xyes])
|
||||
|
||||
# adms option
|
||||
if test "x$enable_adms" = xyes ; then
|
||||
AC_MSG_RESULT([**********************************
|
||||
|
|
@ -1216,6 +1229,7 @@ AC_CONFIG_FILES([Makefile
|
|||
src/xspice/enh/Makefile
|
||||
src/xspice/ipc/Makefile
|
||||
src/xspice/idn/Makefile
|
||||
src/unsupported/Makefile
|
||||
tests/Makefile
|
||||
tests/bsim1/Makefile
|
||||
tests/bsim2/Makefile
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
DBj_gidl_n
|
||||
|
||||
.INCLUDE 45nm_MGK_car2_gidlgisl.pm
|
||||
.OPTIONS GMIN=1e-18 abstol=1e-19
|
||||
|
||||
*Definizione dei parametri
|
||||
.PARAM Lmin=45n
|
||||
.PARAM Wmin=45n
|
||||
.PARAM Ldiff=90n
|
||||
|
||||
*Descrizione della cella
|
||||
Mp drain gate source body nmos W={Wmin} L={Lmin} AS={Wmin*Ldiff} AD={Wmin*Ldiff} PS={2*(Ldiff+Wmin)} PD={2*(Ldiff+Wmin)}
|
||||
Vd drain alim 0V
|
||||
Vg gate 0 0V
|
||||
Vs source alim 0V
|
||||
Vb body 0 0V
|
||||
Vdd alim 0 0.05V
|
||||
|
||||
*Definizione del tipo di analisi
|
||||
.dc Vdd 0.0 1.2 0.1
|
||||
.print all
|
||||
.END
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
DBj_gidl_p
|
||||
|
||||
.INCLUDE 45nm_MGK_car2_gidlgisl.pm
|
||||
.OPTIONS GMIN=1e-18 abstol=1e-24 vntol=1e-24
|
||||
|
||||
*Definizione dei parametri
|
||||
.PARAM Lmin=45n
|
||||
.PARAM Wmin=45n
|
||||
.PARAM Ldiff=90n
|
||||
|
||||
*Descrizione della cella
|
||||
Mp drain gate source body pmos W={Wmin} L={Lmin} AS={Wmin*Ldiff} AD={Wmin*Ldiff} PS={2*(Ldiff+Wmin)} PD={2*(Ldiff+Wmin)}
|
||||
Vd drain 0 0V
|
||||
Vg gate alim 0V
|
||||
Vs source 0 0V
|
||||
Vb body alim 0V
|
||||
Vdd alim 0 0.05V
|
||||
|
||||
*Definizione del tipo di analisi
|
||||
.dc Vdd 0.0 1.2 0.1
|
||||
.print all
|
||||
.END
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
DBj_gidl_p
|
||||
|
||||
.INCLUDE 45nm_MGK_car2_gidlgisl.pm
|
||||
.OPTIONS GMIN=1e-18 abstol=1e-19
|
||||
|
||||
*Definizione dei parametri
|
||||
.PARAM Lmin=45n
|
||||
.PARAM Wmin=45n
|
||||
.PARAM Ldiff=90n
|
||||
|
||||
*Descrizione della cella
|
||||
Mp drain gate source body pmos W={Wmin} L={Lmin} AS={Wmin*Ldiff} AD={Wmin*Ldiff} PS={2*(Ldiff+Wmin)} PD={2*(Ldiff+Wmin)}
|
||||
Vd drain 0 -1V
|
||||
Vg gate alim 0V
|
||||
Vs source 0 -1V
|
||||
Vb body alim 0V
|
||||
Vdd alim 0 -1.05V
|
||||
|
||||
*Definizione del tipo di analisi
|
||||
.dc Vdd 0.0 1.2 0.1
|
||||
.print all
|
||||
.END
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
.model nmos nmos level=54
|
||||
+version = 4.7.0 binunit = 1 paramchk= 1 mobmod = 0
|
||||
+capmod = 2 igcmod = 0 igbmod = 0 geomod = 1
|
||||
+diomod = 1 rdsmod = 0 rbodymod= 1 rgatemod= 1
|
||||
+permod = 1 acnqsmod= 0 trnqsmod= 0
|
||||
+tnom = 27 toxe = 9e-010 toxp = 6.5e-010 toxm = 9e-010
|
||||
+dtox = 2.5e-010 epsrox = 3.9 wint = 5e-009 lint = 2.7e-009
|
||||
+ll = 0 wl = 0 lln = 1 wln = 1
|
||||
+lw = 0 ww = 0 lwn = 1 wwn = 1
|
||||
+lwl = 0 wwl = 0 xpart = 0 toxref = 9e-010 xl = -20e-9
|
||||
+dlcig = 2.7e-009
|
||||
+vth0 = 0.3423 k1 = 0.2 k2 = 0 k3 = 0
|
||||
+k3b = 0 w0 = 2.5e-006 dvt0 = 1 dvt1 = 2
|
||||
+dvt2 = 0 dvt0w = 0 dvt1w = 0 dvt2w = 0
|
||||
+dsub = 0.078 minv = 0.05 voffl = 0 dvtp0 = 1e-010
|
||||
+dvtp1 = 0.1 lpe0 = 0 lpeb = 0 xj = 1.4e-008
|
||||
+ngate = 1e+023 ndep = 6.5e+018 nsd = 2e+020 phin = 0
|
||||
+cdsc = 0 cdscb = 0 cdscd = 0 cit = 0
|
||||
+voff = -0.13 nfactor = 1.9 eta0 = 0.0055 etab = 0
|
||||
+vfb = -1.058 u0 = 0.02947 ua = -5e-010 ub = 1.7e-018
|
||||
+uc = 0 vsat = 159550 a0 = 1 ags = 0
|
||||
+a1 = 0 a2 = 1 b0 = 0 b1 = 0
|
||||
+keta = 0.04 dwg = 0 dwb = 0 pclm = 0.06
|
||||
+pdiblc1 = 0.001 pdiblc2 = 0.001 pdiblcb = -0.005 drout = 0.5
|
||||
+pvag = 1e-020 delta = 0.01 pscbe1 = 2.0e+009 pscbe2 = 1e-007
|
||||
+fprout = 0.2 pdits = 0.01 pditsd = 0.23 pditsl = 2300000
|
||||
+rsh = 5 rdsw = 105 rsw = 52.5 rdw = 52.5
|
||||
+rdswmin = 0 rdwmin = 0 rswmin = 0 prwg = 0
|
||||
+prwb = 0 wr = 1 alpha0 = 0.0 alpha1 = 0.00
|
||||
+beta0 = 30 agidl = 0.0002 bgidl = 2.1e+009 cgidl = 0.0002
|
||||
+egidl = 0.8 aigbacc = 0.012 bigbacc = 0.0028 cigbacc = 0.002
|
||||
+nigbacc = 1 aigbinv = 0.014 bigbinv = 0.004 cigbinv = 0.004
|
||||
+eigbinv = 1.1 nigbinv = 3 aigc = 0.018029 bigc = 0.0029
|
||||
+cigc = 0.002 aigsd = 0.018029 bigsd = 0.0029 cigsd = 0.002
|
||||
+nigc = 1 poxedge = 1 pigcd = 1 ntox = 1
|
||||
+xrcrg1 = 12 xrcrg2 = 5
|
||||
+cgso = 1e-010 cgdo = 1e-010 cgbo = 0 cgdl = 7.5e-013
|
||||
+cgsl = 7.5e-013 clc = 1e-007 cle = 0.6 cf = 1.1e-010
|
||||
+ckappas = 0.6 ckappad = 0.6 vfbcv = -1 acde = 1
|
||||
+moin = 15 noff = 1 voffcv = 0
|
||||
+kt1 = -0.154 kt1l = 0 kt2 = 0.022 ute = -1.1
|
||||
+ua1 = 1e-009 ub1 = -1e-018 uc1 = -5.6e-011 prt = 0
|
||||
+at = 33000
|
||||
+fnoimod = 1 tnoimod = 0 noia = 6.25e+041 noib = 3.125e+026
|
||||
+noic = 8.75e+009 em = 41000000 af = 1 ef = 1
|
||||
+kf = 0 tnoia = 1.5 tnoib = 3.5 ntnoi = 1
|
||||
+jss = 0.0 jsws = 0.0 jswgs = 0.0 njs = 1
|
||||
+ijthsfwd= 0.1 ijthsrev= 0.1 bvs = 10 xjbvs = 1
|
||||
+jsd = 0.0 jswd = 0.0 jswgd = 0.0 xjbvd = 1
|
||||
+pbs = 1 cjs = 0.0018 mjs = 0.5 pbsws = 1
|
||||
+cjsws = 1.2e-010 mjsws = 0.33 cjswgs = 2.1e-010 cjd = 0.0018
|
||||
+cjswd = 1.2e-010 mjswd = 0.33 pbswgd = 1 cjswgd = 2.1e-010
|
||||
+mjswgd = 0.33 tpb = 0 tcj = 0 tpbsw = 0
|
||||
+tcjsw = 0 tpbswg = 0 tcjswg = 0 xtis = 3
|
||||
+dmcg = 0 dmci = 0 dmdg = 0 dmcgt = 0
|
||||
+dwj = 0 xgw = 0 xgl = 0
|
||||
+rshg = 0.4 gbmin = 1e-010 rbpb = 5 rbpd = 15
|
||||
+rbps = 15 rbdb = 15 rbsb = 15 ngcon = 1
|
||||
|
||||
|
||||
|
||||
.model pmos pmos level = 54
|
||||
+version = 4.7.0 binunit = 1 paramchk= 1 mobmod = 0
|
||||
+capmod = 2 igcmod = 0 igbmod = 0 geomod = 1
|
||||
+diomod = 1 rdsmod = 0 rbodymod= 1 rgatemod= 1
|
||||
+permod = 1 acnqsmod= 0 trnqsmod= 0
|
||||
+tnom = 27 toxe = 9.2e-010 toxp = 6.5e-010 toxm = 9.2e-010
|
||||
+dtox = 2.7e-010 epsrox = 3.9 wint = 5e-009 lint = 2.7e-009
|
||||
+ll = 0 wl = 0 lln = 1 wln = 1
|
||||
+lw = 0 ww = 0 lwn = 1 wwn = 1
|
||||
+lwl = 0 wwl = 0 xpart = 0 toxref = 9.2e-010 xl = -20e-9
|
||||
+dlcig = 2.7e-009
|
||||
+vth0 = -0.23122 k1 = 0.2 k2 = -0.01 k3 = 0
|
||||
+k3b = 0 w0 = 2.5e-006 dvt0 = 1 dvt1 = 2
|
||||
+dvt2 = -0.032 dvt0w = 0 dvt1w = 0 dvt2w = 0
|
||||
+dsub = 0.1 minv = 0.05 voffl = 0 dvtp0 = 1e-011
|
||||
+dvtp1 = 0.05 lpe0 = 0 lpeb = 0 xj = 1.4e-008
|
||||
+ngate = 1e+023 ndep = 2.8e+018 nsd = 2e+020 phin = 0
|
||||
+cdsc = 0 cdscb = 0 cdscd = 0 cit = 0
|
||||
+voff = -0.13 nfactor = 1.9 eta0 = 0.0049 etab = 0
|
||||
+vfb = -1.058 u0 = 0.00391 ua = -5e-010 ub = 1.6e-018
|
||||
+uc = 0 vsat = 78000 a0 = 1 ags = 1e-020
|
||||
+a1 = 0 a2 = 1 b0 = 0 b1 = 0
|
||||
+keta = -0.047 dwg = 0 dwb = 0 pclm = 0.1
|
||||
+pdiblc1 = 0.001 pdiblc2 = 0.001 pdiblcb = 3.4e-008 drout = 0.6
|
||||
+pvag = 1e-020 delta = 0.01 pscbe1 = 2e+009 pscbe2 = 9.58e-007
|
||||
+fprout = 0.2 pdits = 0.08 pditsd = 0.23 pditsl = 2300000
|
||||
+rsh = 5 rdsw = 105 rsw = 52.5 rdw = 52.5
|
||||
+rdswmin = 0 rdwmin = 0 rswmin = 0 prwg = 0
|
||||
+prwb = 0 wr = 1 alpha0 = 0.0 alpha1 = 0.00
|
||||
+beta0 = 30 agidl = 0.0002 bgidl = 2.1e+009 cgidl = 0.0002
|
||||
+egidl = 0.8 aigbacc = 0.012 bigbacc = 0.0028 cigbacc = 0.002
|
||||
+nigbacc = 1 aigbinv = 0.014 bigbinv = 0.004 cigbinv = 0.004
|
||||
+eigbinv = 1.1 nigbinv = 3 aigc = 0.010687 bigc = 0.0012607
|
||||
+cigc = 0.0008 aigsd = 0.010687 bigsd = 0.0012607 cigsd = 0.0008
|
||||
+nigc = 1 poxedge = 1 pigcd = 1 ntox = 1
|
||||
+xrcrg1 = 12 xrcrg2 = 5
|
||||
+cgso = 1e-010 cgdo = 1e-010 cgbo = 0 cgdl = 3e-011
|
||||
+cgsl = 3e-011 clc = 1e-007 cle = 0.6 cf = 1.1e-010
|
||||
+ckappas = 0.6 ckappad = 0.6 vfbcv = -1 acde = 1
|
||||
+moin = 15 noff = 1 voffcv = 0
|
||||
+kt1 = -0.14 kt1l = 0 kt2 = 0.022 ute = -1.1
|
||||
+ua1 = 1e-009 ub1 = -1e-018 uc1 = -5.6e-011 prt = 0
|
||||
+at = 33000
|
||||
+fnoimod = 1 tnoimod = 0 noia = 6.25e+041 noib = 3.125e+026
|
||||
+noic = 8.75e+009 em = 41000000 af = 1 ef = 1
|
||||
+kf = 0 tnoia = 1.5 tnoib = 3.5 ntnoi = 1
|
||||
+jss = 0.0 jsws = 0.0 jswgs = 0.0 njs = 1
|
||||
+ijthsfwd= 0.1 ijthsrev= 0.1 bvs = 10 xjbvs = 1
|
||||
+jsd = 0.0 jswd = 0.0 jswgd = 0.0 xjbvd = 1
|
||||
+pbs = 1 cjs = 0.0015 mjs = 0.5 pbsws = 1
|
||||
+cjsws = 9.4e-011 mjsws = 0.33 cjswgs = 2e-010 cjd = 0.0015
|
||||
+cjswd = 9.4e-011 mjswd = 0.33 pbswgd = 1 cjswgd = 2e-010
|
||||
+mjswgd = 0.33 tpb = 0 tcj = 0 tpbsw = 0
|
||||
+tcjsw = 0 tpbswg = 0 tcjswg = 0 xtis = 3
|
||||
+dmcg = 0 dmdg = 0 dmcgt = 0 xgw = 0
|
||||
+xgl = 0
|
||||
+rshg = 0.1 gbmin = 1e-012 rbpb = 50 rbpd = 50
|
||||
+rbps = 50 rbdb = 50 rbsb = 50 ngcon = 1
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = misc maths frontend spicelib include/ngspice
|
||||
DIST_SUBDIRS = misc maths frontend spicelib include/ngspice xspice ciderlib
|
||||
DIST_SUBDIRS = misc maths frontend spicelib include/ngspice xspice ciderlib unsupported
|
||||
|
||||
if XSPICE_WANTED
|
||||
SUBDIRS += xspice
|
||||
|
|
@ -11,6 +11,10 @@ if CIDER_WANTED
|
|||
SUBDIRS += ciderlib
|
||||
endif
|
||||
|
||||
if SENSE2_WANTED
|
||||
SUBDIRS += unsupported
|
||||
endif
|
||||
|
||||
if !TCL_MODULE
|
||||
if !SHARED_MODULE
|
||||
bin_PROGRAMS = ngspice ngnutmeg
|
||||
|
|
@ -27,7 +31,7 @@ endif !SHARED_MODULE
|
|||
endif !TCL_MODULE
|
||||
|
||||
EXTRA_DIST = ngspice.txt setplot spectrum \
|
||||
devload devaxis ciderinit winmain.c winmain.h unsupported \
|
||||
devload devaxis ciderinit winmain.c winmain.h \
|
||||
tclspice.c tclspice.map pkgIndex.tcl.in spinit.in tclspinit.in \
|
||||
main.c sharedspice.c
|
||||
|
||||
|
|
@ -137,6 +141,10 @@ ngspice_LDADD += \
|
|||
spicelib/analysis/libckt.la \
|
||||
spicelib/devices/libdev.la
|
||||
|
||||
if SENSE2_WANTED
|
||||
ngspice_LDADD += unsupported/libunsupported.la
|
||||
endif
|
||||
|
||||
if XSPICE_WANTED
|
||||
ngspice_LDADD += \
|
||||
xspice/cm/libcmxsp.la \
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static struct line *com_options = NULL;
|
|||
static void cktislinear(CKTcircuit *ckt, struct line *deck);
|
||||
|
||||
void line_free_x(struct line *deck, bool recurse);
|
||||
|
||||
void create_circbyline(char *line);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -239,6 +239,14 @@ do_measure(
|
|||
return (measures_passed);
|
||||
}
|
||||
|
||||
/* don't allow autostop if no .meas commands are given in the input file */
|
||||
if ((cp_getvar("autostop", CP_BOOL, NULL)) && (ft_curckt->ci_meas == NULL)) {
|
||||
fprintf(cp_err, "\nWarning: No .meas commands found!\n");
|
||||
fprintf(cp_err, " Option autostop is not available, ignored!\n\n");
|
||||
cp_remvar("autostop");
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/* Evaluating the linked list of .meas cards, assembled from the input deck
|
||||
by fcn inp_spsource() in inp.c:575.
|
||||
A typical .meas card will contain:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ typedef enum {Nodekey = '#'} _nNodekey; /* Introduces node symbol */
|
|||
typedef enum {Intro = '&'} _nIntro; /* Introduces preprocessor tokens */
|
||||
typedef enum {Comment = '*'} _nComment; /* Spice Comment lines */
|
||||
typedef enum {Psp = '{'} _nPsp; /* Ps expression */
|
||||
typedef enum {Defd = 15} _nDefd; /* serial numb. of 'defined' keyword.
|
||||
typedef enum {Defd = 6} _nDefd; /* serial numb. of 'defined' keyword.
|
||||
The others are not used (yet) */
|
||||
|
||||
typedef char *auxtable; /* dummy */
|
||||
|
|
|
|||
|
|
@ -88,8 +88,7 @@ initkeys(void)
|
|||
{
|
||||
spice_dstring_init(&keyS);
|
||||
scopy_up(&keyS,
|
||||
"and or not div mod if else end while macro funct defined"
|
||||
" include for to downto is var");
|
||||
"and or not div mod defined");
|
||||
scopy_up(&fmathS,
|
||||
"sqr sqrt sin cos exp ln arctan abs pow pwr max min int log sinh cosh"
|
||||
" tanh ternary_fcn v agauss sgn gauss unif aunif limit ceil floor");
|
||||
|
|
|
|||
|
|
@ -1815,6 +1815,7 @@ devmodtranslate(struct line *deck, char *subname, wordlist * const submod)
|
|||
|
||||
case 'r':
|
||||
case 'c':
|
||||
case 'l':
|
||||
name = gettok(&t); /* get refdes */
|
||||
(void) sprintf(buffer, "%s ", name);
|
||||
tfree(name);
|
||||
|
|
|
|||
|
|
@ -56,6 +56,12 @@ struct CKTnode {
|
|||
#define PARM_IC 2
|
||||
#define PARM_NODETYPE 3
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
typedef struct sCKTmkCurKCLnode {
|
||||
double KCLcurrent ;
|
||||
struct sCKTmkCurKCLnode *next ;
|
||||
} CKTmkCurKCLnode ;
|
||||
#endif
|
||||
|
||||
struct CKTcircuit {
|
||||
|
||||
|
|
@ -110,6 +116,14 @@ struct CKTcircuit {
|
|||
double *CKTrhs; /* current rhs value - being loaded */
|
||||
double *CKTrhsOld; /* previous rhs value for convergence
|
||||
testing */
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
double *CKTfvk ; /* KCL Verification array */
|
||||
int *CKTnodeIsLinear ; /* Flag to indicate if a node is linear or non-linear */
|
||||
int *CKTvoltCurNode ; /* Flag to indicate if a node contains some direct unknown currents */
|
||||
CKTmkCurKCLnode **CKTmkCurKCLarray ; /* Array of KCL Currents */
|
||||
#endif
|
||||
|
||||
double *CKTrhsSpare; /* spare rhs value for reordering */
|
||||
double *CKTirhs; /* current rhs value - being loaded
|
||||
(imag) */
|
||||
|
|
@ -289,7 +303,11 @@ struct CKTcircuit {
|
|||
};
|
||||
|
||||
|
||||
/* Now function prottypes */
|
||||
/* Now function prototypes */
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int CKTmkCurKCL (CKTcircuit *, int, double **) ;
|
||||
#endif
|
||||
|
||||
extern int ACan(CKTcircuit *, int);
|
||||
extern int ACaskQuest(CKTcircuit *, JOB *, int , IFvalue *);
|
||||
|
|
@ -387,10 +405,14 @@ extern int PZinit(CKTcircuit *);
|
|||
extern int PZpost(CKTcircuit *);
|
||||
extern int PZaskQuest(CKTcircuit *, JOB *, int , IFvalue *);
|
||||
extern int PZsetParm(CKTcircuit *, JOB *, int , IFvalue *);
|
||||
|
||||
#ifdef WANT_SENSE2
|
||||
extern int SENaskQuest(CKTcircuit *, JOB *, int , IFvalue *);
|
||||
extern void SENdestroy(SENstruct *);
|
||||
extern int SENsetParm(CKTcircuit *, JOB *, int , IFvalue *);
|
||||
extern int SENstartup(CKTcircuit *);
|
||||
extern int SENstartup(CKTcircuit *, int);
|
||||
#endif
|
||||
|
||||
extern int SPIinit(IFfrontEnd *, IFsimulator **);
|
||||
extern int TFanal(CKTcircuit *, int);
|
||||
extern int TFaskQuest(CKTcircuit *, JOB *, int , IFvalue *);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
/* Alternate initialisation file name */
|
||||
#define ALT_INITSTR "spice.rc"
|
||||
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER) || defined (HAS_WINGUI)
|
||||
#define DIR_PATHSEP "\\"
|
||||
#define DIR_TERM '\\'
|
||||
#define DIR_PATHSEP_LINUX "/"
|
||||
|
|
|
|||
|
|
@ -29,9 +29,20 @@ double limitVbe( double, double, int * );
|
|||
double limitVce( double, double, int * );
|
||||
double limitVgb( double, double, int * );
|
||||
|
||||
|
||||
|
||||
|
||||
/* Area Calculation Method (ACM) for MOS models (devsup.c) */
|
||||
int
|
||||
ACM_SourceDrainResistances(int, double, double, double, double, double,
|
||||
double, double, int, double, double, double,
|
||||
int, double, double, double, double *, double *);
|
||||
int
|
||||
ACM_saturationCurrents(int, int, int, double, double, double, double, double,
|
||||
double, int, double, int, double, int, double, int,
|
||||
double, double *, double *);
|
||||
int
|
||||
ACM_junctionCapacitances(int, int, int, double, double, double, double, int,
|
||||
double, int, double, int, double, int, double,
|
||||
double, double, double, double *, double *,
|
||||
double *, double *, double *, double *);
|
||||
|
||||
typedef struct SPICEdev {
|
||||
IFdevice DEVpublic;
|
||||
|
|
@ -110,6 +121,12 @@ typedef struct SPICEdev {
|
|||
/* routine to convert Complex CSC array to Real CSC array */
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* Francesco Lannutti */
|
||||
int (*DEVnodeIsNonLinear)(GENmodel *, CKTcircuit *) ;
|
||||
/* Routine to declare a node as NonLinear */
|
||||
#endif
|
||||
|
||||
} SPICEdev; /* instance of structure for each possible type of device */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,9 @@ struct ngcomplex {
|
|||
typedef struct ngcomplex ngcomplex_t;
|
||||
#endif
|
||||
|
||||
/* vector info obtained from any vector in ngspice.dll */
|
||||
/* vector info obtained from any vector in ngspice.dll.
|
||||
Allows direct access to the ngspice internal vector structure,
|
||||
as defined in include/ngspice/devc.h .*/
|
||||
typedef struct vector_info {
|
||||
char *v_name; /* Same as so_vname. */
|
||||
int v_type; /* Same as so_vtype. */
|
||||
|
|
@ -123,16 +125,17 @@ typedef struct vector_info {
|
|||
} vector_info, *pvector_info;
|
||||
|
||||
typedef struct vecvalues {
|
||||
char* name;
|
||||
double creal;
|
||||
double cimag;
|
||||
bool is_scale;
|
||||
bool is_complex;
|
||||
char* name; /* name of a specific vector */
|
||||
double creal; /* actual data value */
|
||||
double cimag; /* actual data value */
|
||||
bool is_scale;/* if 'name' is the scale vector */
|
||||
bool is_complex;/* if the data are complex numbers */
|
||||
} vecvalues, *pvecvalues;
|
||||
|
||||
typedef struct vecvaluesall {
|
||||
int veccount;
|
||||
pvecvalues *vecsa;
|
||||
int veccount; /* number of vectors in plot */
|
||||
int vecindex; /* index of actual set of vectors. i.e. the number of accepted data points */
|
||||
pvecvalues *vecsa; /* values of actual set of vectors, indexed from 0 to veccount - 1 */
|
||||
} vecvaluesall, *pvecvaluesall;
|
||||
|
||||
/* info for a specific vector */
|
||||
|
|
|
|||
|
|
@ -122,8 +122,8 @@ void SMPgetError( SMPmatrix *, int *, int *);
|
|||
int SMPcProdDiag( SMPmatrix *, SPcomplex *, int *);
|
||||
int SMPcDProd(SMPmatrix *Matrix, SPcomplex *pMantissa, int *pExponent);
|
||||
SMPelement * SMPfindElt( SMPmatrix *, int , int , int );
|
||||
int SMPcZeroCol(SMPmatrix *eMatrix, int Col);
|
||||
int SMPcAddCol(SMPmatrix *eMatrix, int Accum_Col, int Addend_Col);
|
||||
int SMPzeroRow(SMPmatrix *eMatrix, int Row);
|
||||
int SMPcZeroCol(SMPmatrix *Matrix, int Col);
|
||||
int SMPcAddCol(SMPmatrix *Matrix, int Accum_Col, int Addend_Col);
|
||||
int SMPzeroRow(SMPmatrix *Matrix, int Row);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ extern int spFileMatrix( MatrixPtr, char *, char *, int, int, int );
|
|||
extern int spFileStats( MatrixPtr, char *, char * );
|
||||
extern int spFillinCount( MatrixPtr );
|
||||
extern int spGetAdmittance( MatrixPtr, int, int, struct spTemplate* );
|
||||
extern spREAL *spFindElement(MatrixPtr eMatrix, int Row, int Col );
|
||||
extern spREAL *spFindElement(MatrixPtr Matrix, int Row, int Col );
|
||||
extern spREAL *spGetElement(MatrixPtr, int, int );
|
||||
extern void *spGetInitInfo( spREAL* );
|
||||
extern int spGetOnes( MatrixPtr, int, int, int, struct spTemplate* );
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ Author: 1985 Thomas L. Quarles
|
|||
#include "ngspice/smpdefs.h"
|
||||
|
||||
|
||||
|
||||
int
|
||||
NIconvTest(CKTcircuit *ckt)
|
||||
{
|
||||
|
|
@ -25,8 +26,19 @@ NIconvTest(CKTcircuit *ckt)
|
|||
double new;
|
||||
double tol;
|
||||
|
||||
node = ckt->CKTnodes;
|
||||
#ifdef KIRCHHOFF
|
||||
#ifdef STEPDEBUG
|
||||
int j ;
|
||||
#endif
|
||||
|
||||
double maximum ;
|
||||
CKTmkCurKCLnode *ptr ;
|
||||
|
||||
#endif
|
||||
|
||||
size = SMPmatSize(ckt->CKTmatrix);
|
||||
node = ckt->CKTnodes;
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
for (i=1;i<=size;i++) {
|
||||
new = ckt->CKTrhs [i] ;
|
||||
|
|
@ -34,6 +46,7 @@ NIconvTest(CKTcircuit *ckt)
|
|||
printf("chk for convergence: %s new: %g old: %g\n",CKTnodName(ckt,i),new,old);
|
||||
}
|
||||
#endif /* STEPDEBUG */
|
||||
|
||||
for (i=1;i<=size;i++) {
|
||||
node = node->next;
|
||||
new = ckt->CKTrhs [i] ;
|
||||
|
|
@ -42,26 +55,66 @@ NIconvTest(CKTcircuit *ckt)
|
|||
tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) +
|
||||
ckt->CKTvoltTol;
|
||||
if (fabs(new-old) >tol ) {
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
printf(" non-convergence at node (type=3) %s (fabs(new-old)>tol --> fabs(%g-%g)>%g)\n",CKTnodName(ckt,i),new,old,tol);
|
||||
printf(" reltol: %g voltTol: %g (tol=reltol*(MAX(fabs(old),fabs(new))) + voltTol)\n",ckt->CKTreltol,ckt->CKTvoltTol);
|
||||
#endif /* STEPDEBUG */
|
||||
|
||||
ckt->CKTtroubleNode = i;
|
||||
ckt->CKTtroubleElt = NULL;
|
||||
return(1);
|
||||
}
|
||||
|
||||
#ifndef KIRCHHOFF
|
||||
} else {
|
||||
tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) +
|
||||
ckt->CKTabstol;
|
||||
if (fabs(new-old) >tol ) {
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
printf(" non-convergence at node (type=%d) %s (fabs(new-old)>tol --> fabs(%g-%g)>%g)\n",node->type,CKTnodName(ckt,i),new,old,tol);
|
||||
printf(" reltol: %g abstol: %g (tol=reltol*(MAX(fabs(old),fabs(new))) + abstol)\n",ckt->CKTreltol,ckt->CKTabstol);
|
||||
#endif /* STEPDEBUG */
|
||||
|
||||
ckt->CKTtroubleNode = i;
|
||||
ckt->CKTtroubleElt = NULL;
|
||||
return(1);
|
||||
}
|
||||
#else
|
||||
/* KCL Verification */
|
||||
}
|
||||
if ((node->type == SP_VOLTAGE) && (!ckt->CKTnodeIsLinear [i]) && (ckt->CKTvoltCurNode [i]))
|
||||
{
|
||||
maximum = 0 ;
|
||||
ptr = ckt->CKTmkCurKCLarray [i] ;
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
j = 0 ;
|
||||
#endif
|
||||
|
||||
while (ptr != NULL)
|
||||
{
|
||||
if (maximum < fabs (ptr->KCLcurrent))
|
||||
maximum = fabs (ptr->KCLcurrent) ;
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
fprintf (stderr, "Index KCL Array: %d\tValue: %-.9g\tMaximum: %-.9g\n", j, fabs (ptr->KCLcurrent), maximum) ;
|
||||
j++ ;
|
||||
#endif
|
||||
|
||||
ptr = ptr->next ;
|
||||
}
|
||||
|
||||
#ifdef STEPDEBUG
|
||||
fprintf (stderr, "Index: %d\tValue: %-.9g\tThreshold: %-.9g\tMaximum: %-.9g\n", i, fabs (ckt->CKTfvk [i]),
|
||||
ckt->CKTreltol * maximum + ckt->CKTabstol, maximum) ;
|
||||
#endif
|
||||
|
||||
if (fabs (ckt->CKTfvk [i]) > (ckt->CKTreltol * maximum + ckt->CKTabstol))
|
||||
return 1 ;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ int
|
|||
NIreinit( CKTcircuit *ckt)
|
||||
{
|
||||
int size;
|
||||
#ifdef PREDICTOR
|
||||
|
||||
#if defined(PREDICTOR) || defined(KIRCHHOFF)
|
||||
int i;
|
||||
#endif
|
||||
|
||||
|
|
@ -33,6 +34,20 @@ NIreinit( CKTcircuit *ckt)
|
|||
CKALLOC(CKTirhs,size+1,double);
|
||||
CKALLOC(CKTirhsOld,size+1,double);
|
||||
CKALLOC(CKTirhsSpare,size+1,double);
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
CKALLOC(CKTfvk,size+1,double);
|
||||
CKALLOC(CKTnodeIsLinear,size+1,int);
|
||||
for (i = 0 ; i <= size ; i++)
|
||||
ckt->CKTnodeIsLinear [i] = 1 ;
|
||||
CKALLOC(CKTvoltCurNode,size+1,int);
|
||||
for (i = 0 ; i <= size ; i++)
|
||||
ckt->CKTvoltCurNode [i] = 0 ;
|
||||
CKALLOC(CKTmkCurKCLarray,size+1,CKTmkCurKCLnode*);
|
||||
for (i = 0 ; i <= size ; i++)
|
||||
ckt->CKTmkCurKCLarray [i] = NULL ;
|
||||
#endif
|
||||
|
||||
#ifdef PREDICTOR
|
||||
CKALLOC(CKTpred,size+1,double);
|
||||
for( i=0;i<8;i++) {
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ spCreate(int Size, int Complex, int *pError)
|
|||
Matrix->ElementsRemaining = 0;
|
||||
Matrix->FillinsRemaining = 0;
|
||||
|
||||
RecordAllocation( Matrix, (void *)Matrix );
|
||||
RecordAllocation( Matrix, Matrix );
|
||||
if (Matrix->Error == spNO_MEMORY) goto MemoryError;
|
||||
|
||||
/* Take out the trash. */
|
||||
|
|
@ -311,7 +311,7 @@ spcGetElement(MatrixPtr Matrix)
|
|||
/* Allocate block of MatrixElements if necessary. */
|
||||
if (Matrix->ElementsRemaining == 0) {
|
||||
pElements = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
|
||||
RecordAllocation( Matrix, (void *)pElements );
|
||||
RecordAllocation( Matrix, pElements );
|
||||
if (Matrix->Error == spNO_MEMORY) return NULL;
|
||||
Matrix->ElementsRemaining = ELEMENTS_PER_ALLOCATION;
|
||||
Matrix->NextAvailElement = pElements;
|
||||
|
|
@ -331,14 +331,14 @@ spcGetElement(MatrixPtr Matrix)
|
|||
} else {
|
||||
/* Allocate block of elements. */
|
||||
pElements = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
|
||||
RecordAllocation( Matrix, (void *)pElements );
|
||||
RecordAllocation( Matrix, pElements );
|
||||
if (Matrix->Error == spNO_MEMORY) return NULL;
|
||||
Matrix->ElementsRemaining = ELEMENTS_PER_ALLOCATION;
|
||||
Matrix->NextAvailElement = pElements;
|
||||
|
||||
/* Allocate an element list structure. */
|
||||
pListNode->Next = SP_MALLOC(struct ElementListNodeStruct,1);
|
||||
RecordAllocation( Matrix, (void *)pListNode->Next );
|
||||
RecordAllocation( Matrix, pListNode->Next );
|
||||
if (Matrix->Error == spNO_MEMORY)
|
||||
return NULL;
|
||||
Matrix->LastElementListNode = pListNode = pListNode->Next;
|
||||
|
|
@ -402,14 +402,14 @@ InitializeElementBlocks(MatrixPtr Matrix, int InitialNumberOfElements,
|
|||
|
||||
/* Allocate block of MatrixElements for elements. */
|
||||
pElement = SP_MALLOC(struct MatrixElement, InitialNumberOfElements);
|
||||
RecordAllocation( Matrix, (void *)pElement );
|
||||
RecordAllocation( Matrix, pElement );
|
||||
if (Matrix->Error == spNO_MEMORY) return;
|
||||
Matrix->ElementsRemaining = InitialNumberOfElements;
|
||||
Matrix->NextAvailElement = pElement;
|
||||
|
||||
/* Allocate an element list structure. */
|
||||
Matrix->FirstElementListNode = SP_MALLOC(struct ElementListNodeStruct,1);
|
||||
RecordAllocation( Matrix, (void *)Matrix->FirstElementListNode );
|
||||
RecordAllocation( Matrix, Matrix->FirstElementListNode );
|
||||
if (Matrix->Error == spNO_MEMORY) return;
|
||||
Matrix->LastElementListNode = Matrix->FirstElementListNode;
|
||||
|
||||
|
|
@ -420,14 +420,14 @@ InitializeElementBlocks(MatrixPtr Matrix, int InitialNumberOfElements,
|
|||
|
||||
/* Allocate block of MatrixElements for fill-ins. */
|
||||
pElement = SP_MALLOC(struct MatrixElement, NumberOfFillinsExpected);
|
||||
RecordAllocation( Matrix, (void *)pElement );
|
||||
RecordAllocation( Matrix, pElement );
|
||||
if (Matrix->Error == spNO_MEMORY) return;
|
||||
Matrix->FillinsRemaining = NumberOfFillinsExpected;
|
||||
Matrix->NextAvailFillin = pElement;
|
||||
|
||||
/* Allocate a fill-in list structure. */
|
||||
Matrix->FirstFillinListNode = SP_MALLOC(struct FillinListNodeStruct,1);
|
||||
RecordAllocation( Matrix, (void *)Matrix->FirstFillinListNode );
|
||||
RecordAllocation( Matrix, Matrix->FirstFillinListNode );
|
||||
if (Matrix->Error == spNO_MEMORY) return;
|
||||
Matrix->LastFillinListNode = Matrix->FirstFillinListNode;
|
||||
|
||||
|
|
@ -487,14 +487,14 @@ spcGetFillin(MatrixPtr Matrix)
|
|||
} else {
|
||||
/* Allocate block of fill-ins. */
|
||||
pFillins = SP_MALLOC(struct MatrixElement, ELEMENTS_PER_ALLOCATION);
|
||||
RecordAllocation( Matrix, (void *)pFillins );
|
||||
RecordAllocation( Matrix, pFillins );
|
||||
if (Matrix->Error == spNO_MEMORY) return NULL;
|
||||
Matrix->FillinsRemaining = ELEMENTS_PER_ALLOCATION;
|
||||
Matrix->NextAvailFillin = pFillins;
|
||||
|
||||
/* Allocate a fill-in list structure. */
|
||||
pListNode->Next = SP_MALLOC(struct FillinListNodeStruct,1);
|
||||
RecordAllocation( Matrix, (void *)pListNode->Next );
|
||||
RecordAllocation( Matrix, pListNode->Next );
|
||||
if (Matrix->Error == spNO_MEMORY) return NULL;
|
||||
Matrix->LastFillinListNode = pListNode = pListNode->Next;
|
||||
|
||||
|
|
@ -646,9 +646,8 @@ AllocateBlockOfAllocationList(MatrixPtr Matrix)
|
|||
*/
|
||||
|
||||
void
|
||||
spDestroy(MatrixPtr eMatrix)
|
||||
spDestroy(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
AllocationListPtr ListPtr, NextListPtr;
|
||||
|
||||
|
||||
|
|
@ -701,16 +700,16 @@ spDestroy(MatrixPtr eMatrix)
|
|||
* The error status of the given matrix.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (void *)
|
||||
* Matrix <input> (void *)
|
||||
* The matrix for which the error status is desired. */
|
||||
int
|
||||
spError(MatrixPtr eMatrix )
|
||||
spError(MatrixPtr Matrix )
|
||||
{
|
||||
/* Begin `spError'. */
|
||||
|
||||
if (eMatrix != NULL) {
|
||||
assert(eMatrix->ID == SPARSE_ID);
|
||||
return eMatrix->Error;
|
||||
if (Matrix != NULL) {
|
||||
assert(Matrix->ID == SPARSE_ID);
|
||||
return Matrix->Error;
|
||||
} else {
|
||||
/* This error may actually be spPANIC, no way to tell. */
|
||||
return spNO_MEMORY;
|
||||
|
|
@ -732,7 +731,7 @@ spError(MatrixPtr eMatrix )
|
|||
* detected as singular or where a zero was detected on the diagonal.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (void *)
|
||||
* Matrix <input> (void *)
|
||||
* The matrix for which the error status is desired.
|
||||
* pRow <output> (int *)
|
||||
* The row number.
|
||||
|
|
@ -741,10 +740,8 @@ spError(MatrixPtr eMatrix )
|
|||
*/
|
||||
|
||||
void
|
||||
spWhereSingular(MatrixPtr eMatrix, int *pRow, int *pCol)
|
||||
spWhereSingular(MatrixPtr Matrix, int *pRow, int *pCol)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
|
||||
/* Begin `spWhereSingular'. */
|
||||
assert( IS_SPARSE( Matrix ) );
|
||||
|
||||
|
|
@ -769,7 +766,7 @@ spWhereSingular(MatrixPtr eMatrix, int *pRow, int *pCol)
|
|||
* the matrix is returned.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (void *)
|
||||
* Matrix <input> (void *)
|
||||
* Pointer to matrix.
|
||||
* External <input> (int)
|
||||
* If External is set TRUE, the external size , i.e., the value of the
|
||||
|
|
@ -779,10 +776,8 @@ spWhereSingular(MatrixPtr eMatrix, int *pRow, int *pCol)
|
|||
*/
|
||||
|
||||
int
|
||||
spGetSize(MatrixPtr eMatrix, int External)
|
||||
spGetSize(MatrixPtr Matrix, int External)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
|
||||
/* Begin `spGetSize'. */
|
||||
assert( IS_SPARSE( Matrix ) );
|
||||
|
||||
|
|
@ -809,28 +804,28 @@ spGetSize(MatrixPtr eMatrix, int External)
|
|||
* Forces matrix to be either real or complex.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (void *)
|
||||
* Matrix <input> (void *)
|
||||
* Pointer to matrix.
|
||||
*/
|
||||
|
||||
void
|
||||
spSetReal(MatrixPtr eMatrix)
|
||||
spSetReal(MatrixPtr Matrix)
|
||||
{
|
||||
/* Begin `spSetReal'. */
|
||||
|
||||
assert( IS_SPARSE( eMatrix ));
|
||||
eMatrix->Complex = NO;
|
||||
assert( IS_SPARSE( Matrix ));
|
||||
Matrix->Complex = NO;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
spSetComplex(MatrixPtr eMatrix)
|
||||
spSetComplex(MatrixPtr Matrix)
|
||||
{
|
||||
/* Begin `spSetComplex'. */
|
||||
|
||||
assert( IS_SPARSE( eMatrix ));
|
||||
eMatrix->Complex = YES;
|
||||
assert( IS_SPARSE( Matrix ));
|
||||
Matrix->Complex = YES;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -850,34 +845,34 @@ spSetComplex(MatrixPtr eMatrix)
|
|||
* of original elements can be returned.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (void *)
|
||||
* Matrix <input> (void *)
|
||||
* Pointer to matrix.
|
||||
*/
|
||||
|
||||
int
|
||||
spFillinCount(MatrixPtr eMatrix)
|
||||
spFillinCount(MatrixPtr Matrix)
|
||||
{
|
||||
/* Begin `spFillinCount'. */
|
||||
|
||||
assert( IS_SPARSE( eMatrix ) );
|
||||
return eMatrix->Fillins;
|
||||
assert( IS_SPARSE( Matrix ) );
|
||||
return Matrix->Fillins;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
spElementCount(MatrixPtr eMatrix)
|
||||
spElementCount(MatrixPtr Matrix)
|
||||
{
|
||||
/* Begin `spElementCount'. */
|
||||
|
||||
assert( IS_SPARSE( eMatrix ) );
|
||||
return eMatrix->Elements;
|
||||
assert( IS_SPARSE( Matrix ) );
|
||||
return Matrix->Elements;
|
||||
}
|
||||
|
||||
int
|
||||
spOriginalCount(MatrixPtr eMatrix)
|
||||
spOriginalCount(MatrixPtr Matrix)
|
||||
{
|
||||
/* Begin `spOriginalCount'. */
|
||||
|
||||
assert( IS_SPARSE( eMatrix ) );
|
||||
return eMatrix->Originals;
|
||||
assert( IS_SPARSE( Matrix ) );
|
||||
return Matrix->Originals;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,9 +93,8 @@ static void ExpandTranslationArrays( MatrixPtr, int );
|
|||
*/
|
||||
|
||||
void
|
||||
spClear(MatrixPtr eMatrix)
|
||||
spClear(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
int I;
|
||||
|
||||
|
|
@ -180,10 +179,9 @@ spClear(MatrixPtr eMatrix)
|
|||
*/
|
||||
|
||||
RealNumber *
|
||||
spFindElement(MatrixPtr eMatrix, int Row, int Col)
|
||||
spFindElement(MatrixPtr Matrix, int Row, int Col)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
RealNumber *pElement;
|
||||
ElementPtr pElement;
|
||||
|
||||
/* Begin `spFindElement'. */
|
||||
assert( IS_SPARSE( Matrix ) && Row >= 0 && Col >= 0 );
|
||||
|
|
@ -210,7 +208,7 @@ RealNumber *pElement;
|
|||
* is the first record in the MatrixElement structure.
|
||||
*/
|
||||
|
||||
if ((Row != Col) || ((pElement = (RealNumber *)Matrix->Diag[Row]) == NULL))
|
||||
if ((Row != Col) || ((pElement = Matrix->Diag[Row]) == NULL))
|
||||
{
|
||||
/*
|
||||
* Element does not exist or does not reside along diagonal. Search
|
||||
|
|
@ -218,11 +216,11 @@ RealNumber *pElement;
|
|||
* element which is returned by spcFindElementInCol is cast into a
|
||||
* pointer to Real, a RealNumber.
|
||||
*/
|
||||
pElement = (RealNumber*)spcFindElementInCol( Matrix,
|
||||
pElement = spcFindElementInCol( Matrix,
|
||||
&(Matrix->FirstInCol[Col]),
|
||||
Row, Col, NO );
|
||||
}
|
||||
return pElement;
|
||||
return & pElement->Real;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -263,10 +261,9 @@ RealNumber *pElement;
|
|||
*/
|
||||
|
||||
RealNumber *
|
||||
spGetElement(MatrixPtr eMatrix, int Row, int Col)
|
||||
spGetElement(MatrixPtr Matrix, int Row, int Col)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
RealNumber *pElement;
|
||||
ElementPtr pElement;
|
||||
|
||||
/* Begin `spGetElement'. */
|
||||
assert( IS_SPARSE( Matrix ) && Row >= 0 && Col >= 0 );
|
||||
|
|
@ -305,18 +302,18 @@ spGetElement(MatrixPtr eMatrix, int Row, int Col)
|
|||
* statement depends on the fact that Real is the first record in
|
||||
* the MatrixElement structure. */
|
||||
|
||||
if ((Row != Col) || ((pElement = (RealNumber *)Matrix->Diag[Row]) == NULL))
|
||||
if ((Row != Col) || ((pElement = Matrix->Diag[Row]) == NULL))
|
||||
{
|
||||
/* Element does not exist or does not reside along diagonal.
|
||||
* Search column for element. As in the if statement above,
|
||||
* the pointer to the element which is returned by
|
||||
* spcFindElementInCol is cast into a pointer to Real, a
|
||||
* RealNumber. */
|
||||
pElement = (RealNumber*)spcFindElementInCol( Matrix,
|
||||
pElement = spcFindElementInCol( Matrix,
|
||||
&(Matrix->FirstInCol[Col]),
|
||||
Row, Col, YES );
|
||||
}
|
||||
return pElement;
|
||||
return & pElement->Real;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -644,7 +641,7 @@ spGetQuad(MatrixPtr Matrix, int Row1, int Row2, int Col1, int Col2,
|
|||
(Template->Element4Negated == NULL))
|
||||
return spNO_MEMORY;
|
||||
|
||||
if (Template->Element1 == &((MatrixPtr)Matrix)->TrashCan.Real)
|
||||
if (Template->Element1 == & Matrix->TrashCan.Real)
|
||||
SWAP( RealNumber *, Template->Element1, Template->Element2 );
|
||||
|
||||
return spOKAY;
|
||||
|
|
@ -1145,9 +1142,8 @@ spGetInitInfo(RealNumber *pElement)
|
|||
|
||||
|
||||
int
|
||||
spInitialize(MatrixPtr eMatrix, int (*pInit)(RealNumber*, void *InitInfo, int , int Col))
|
||||
spInitialize(MatrixPtr Matrix, int (*pInit)(RealNumber*, void *InitInfo, int , int Col))
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
int J, Error, Col;
|
||||
|
||||
|
|
@ -1182,7 +1178,7 @@ spInitialize(MatrixPtr eMatrix, int (*pInit)(RealNumber*, void *InitInfo, int ,
|
|||
}
|
||||
else
|
||||
{
|
||||
Error = pInit ((RealNumber *)pElement, pElement->pInitInfo,
|
||||
Error = pInit (& pElement->Real, pElement->pInitInfo,
|
||||
Matrix->IntToExtRowMap[pElement->Row], Col);
|
||||
if (Error)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -189,10 +189,9 @@ static int ZeroPivot( MatrixPtr, int );
|
|||
*/
|
||||
|
||||
int
|
||||
spOrderAndFactor(MatrixPtr eMatrix, RealNumber RHS[], RealNumber RelThreshold,
|
||||
spOrderAndFactor(MatrixPtr Matrix, RealNumber RHS[], RealNumber RelThreshold,
|
||||
RealNumber AbsThreshold, int DiagPivoting)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pPivot;
|
||||
int Step, Size, ReorderingRequired;
|
||||
RealNumber LargestInCol;
|
||||
|
|
@ -321,9 +320,8 @@ Done:
|
|||
* Error is cleared in this function. */
|
||||
|
||||
int
|
||||
spFactor(MatrixPtr eMatrix)
|
||||
spFactor(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
ElementPtr pColumn;
|
||||
int Step, Size;
|
||||
|
|
@ -333,10 +331,10 @@ spFactor(MatrixPtr eMatrix)
|
|||
assert( IS_VALID(Matrix) && !Matrix->Factored);
|
||||
|
||||
if (Matrix->NeedsOrdering) {
|
||||
return spOrderAndFactor( eMatrix, NULL,
|
||||
return spOrderAndFactor( Matrix, NULL,
|
||||
0.0, 0.0, DIAG_PIVOTING_AS_DEFAULT );
|
||||
}
|
||||
if (!Matrix->Partitioned) spPartition( eMatrix, spDEFAULT_PARTITION );
|
||||
if (!Matrix->Partitioned) spPartition( Matrix, spDEFAULT_PARTITION );
|
||||
if (Matrix->Complex)
|
||||
return FactorComplexMatrix( Matrix );
|
||||
|
||||
|
|
@ -569,9 +567,8 @@ FactorComplexMatrix( MatrixPtr Matrix )
|
|||
* spINDIRECT_PARTITION, or spAUTO_PARTITION. */
|
||||
|
||||
void
|
||||
spPartition(MatrixPtr eMatrix, int Mode)
|
||||
spPartition(MatrixPtr Matrix, int Mode)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement, pColumn;
|
||||
int Step, Size;
|
||||
int *Nc, *No, *Nm;
|
||||
|
|
@ -603,8 +600,8 @@ spPartition(MatrixPtr eMatrix, int Mode)
|
|||
assert( Mode == spAUTO_PARTITION );
|
||||
|
||||
/* Otherwise, count all operations needed in when factoring matrix. */
|
||||
Nc = (int *)Matrix->MarkowitzRow;
|
||||
No = (int *)Matrix->MarkowitzCol;
|
||||
Nc = Matrix->MarkowitzRow;
|
||||
No = Matrix->MarkowitzCol;
|
||||
Nm = (int *)Matrix->MarkowitzProd;
|
||||
|
||||
/* Start mock-factorization. */
|
||||
|
|
|
|||
|
|
@ -133,9 +133,8 @@ int Printer_Width = PRINTER_WIDTH;
|
|||
*/
|
||||
|
||||
void
|
||||
spPrint(MatrixPtr eMatrix, int PrintReordered, int Data, int Header)
|
||||
spPrint(MatrixPtr Matrix, int PrintReordered, int Data, int Header)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int J = 0;
|
||||
int I, Row, Col, Size, Top;
|
||||
int StartCol = 1, StopCol, Columns, ElementCount = 0;
|
||||
|
|
@ -295,7 +294,7 @@ spPrint(MatrixPtr eMatrix, int PrintReordered, int Data, int Header)
|
|||
{
|
||||
/* Case where element exists */
|
||||
if (Data)
|
||||
printf(" %9.3g", (double)pElement->Real);
|
||||
printf(" %9.3g", pElement->Real);
|
||||
else
|
||||
putchar('x');
|
||||
|
||||
|
|
@ -326,7 +325,7 @@ spPrint(MatrixPtr eMatrix, int PrintReordered, int Data, int Header)
|
|||
if (pImagElements[J - StartCol] != NULL)
|
||||
{
|
||||
printf(" %8.2gj",
|
||||
(double)pImagElements[J-StartCol]->Imag);
|
||||
pImagElements[J-StartCol]->Imag);
|
||||
}
|
||||
else printf(" ");
|
||||
}
|
||||
|
|
@ -436,10 +435,9 @@ spPrint(MatrixPtr eMatrix, int PrintReordered, int Data, int Header)
|
|||
*/
|
||||
|
||||
int
|
||||
spFileMatrix(MatrixPtr eMatrix, char *File, char *Label, int Reordered,
|
||||
spFileMatrix(MatrixPtr Matrix, char *File, char *Label, int Reordered,
|
||||
int Data, int Header)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int I, Size;
|
||||
ElementPtr pElement;
|
||||
int Row, Col, Err;
|
||||
|
|
@ -518,7 +516,7 @@ spFileMatrix(MatrixPtr eMatrix, char *File, char *Label, int Reordered,
|
|||
}
|
||||
Err = fprintf
|
||||
( pMatrixFile,"%d\t%d\t%-.15g\t%-.15g\n",
|
||||
Row, Col, (double)pElement->Real, (double)pElement->Imag
|
||||
Row, Col, pElement->Real, pElement->Imag
|
||||
);
|
||||
if (Err < 0) return 0;
|
||||
pElement = pElement->NextInCol;
|
||||
|
|
@ -541,7 +539,7 @@ spFileMatrix(MatrixPtr eMatrix, char *File, char *Label, int Reordered,
|
|||
Col = Matrix->IntToExtColMap[I];
|
||||
Err = fprintf
|
||||
( pMatrixFile,"%d\t%d\t%-.15g\n",
|
||||
Row, Col, (double)pElement->Real
|
||||
Row, Col, pElement->Real
|
||||
);
|
||||
if (Err < 0) return 0;
|
||||
pElement = pElement->NextInCol;
|
||||
|
|
@ -595,9 +593,8 @@ spFileMatrix(MatrixPtr eMatrix, char *File, char *Label, int Reordered,
|
|||
*/
|
||||
|
||||
int
|
||||
spFileVector(MatrixPtr eMatrix, char *File, RealVector RHS, RealVector iRHS)
|
||||
spFileVector(MatrixPtr Matrix, char *File, RealVector RHS, RealVector iRHS)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int I, Size, Err;
|
||||
FILE *pMatrixFile;
|
||||
|
||||
|
|
@ -621,7 +618,7 @@ spFileVector(MatrixPtr eMatrix, char *File, RealVector RHS, RealVector iRHS)
|
|||
{
|
||||
Err = fprintf
|
||||
( pMatrixFile, "%-.15g\t%-.15g\n",
|
||||
(double)RHS[I], (double)iRHS[I]
|
||||
RHS[I], iRHS[I]
|
||||
);
|
||||
if (Err < 0) return 0;
|
||||
}
|
||||
|
|
@ -630,7 +627,7 @@ spFileVector(MatrixPtr eMatrix, char *File, RealVector RHS, RealVector iRHS)
|
|||
{
|
||||
for (I = 1; I <= Size; I++)
|
||||
{
|
||||
if (fprintf(pMatrixFile, "%-.15g\n", (double)RHS[I]) < 0)
|
||||
if (fprintf(pMatrixFile, "%-.15g\n", RHS[I]) < 0)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -686,9 +683,8 @@ spFileVector(MatrixPtr eMatrix, char *File, RealVector RHS, RealVector iRHS)
|
|||
*/
|
||||
|
||||
int
|
||||
spFileStats(MatrixPtr eMatrix, char *File, char *Label)
|
||||
spFileStats(MatrixPtr Matrix, char *File, char *Label)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int Size, I;
|
||||
ElementPtr pElement;
|
||||
int NumberOfElements;
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ extern double scalbn(double, int);
|
|||
extern double logb(double);
|
||||
#endif
|
||||
|
||||
static void LoadGmin(SMPmatrix *eMatrix, double Gmin);
|
||||
static void LoadGmin(SMPmatrix *Matrix, double Gmin);
|
||||
|
||||
/*
|
||||
* SMPaddElt()
|
||||
|
|
@ -183,7 +183,7 @@ SMPcReorder(SMPmatrix *Matrix, double PivTol, double PivRel,
|
|||
*NumSwaps = 1;
|
||||
spSetComplex( Matrix->SPmatrix );
|
||||
return spOrderAndFactor( Matrix->SPmatrix, NULL,
|
||||
(spREAL)PivRel, (spREAL)PivTol, YES );
|
||||
PivRel, PivTol, YES );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -195,7 +195,7 @@ SMPreorder(SMPmatrix *Matrix, double PivTol, double PivRel, double Gmin)
|
|||
spSetReal( Matrix->SPmatrix );
|
||||
LoadGmin( Matrix, Gmin );
|
||||
return spOrderAndFactor( Matrix->SPmatrix, NULL,
|
||||
(spREAL)PivRel, (spREAL)PivTol, YES );
|
||||
PivRel, PivTol, YES );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -124,10 +124,9 @@ static void SolveComplexTransposedMatrix( MatrixPtr,
|
|||
/*VARARGS3*/
|
||||
|
||||
void
|
||||
spSolve(MatrixPtr eMatrix, RealVector RHS, RealVector Solution,
|
||||
spSolve(MatrixPtr Matrix, RealVector RHS, RealVector Solution,
|
||||
RealVector iRHS, RealVector iSolution)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
RealVector Intermediate;
|
||||
RealNumber Temp;
|
||||
|
|
@ -400,10 +399,9 @@ SolveComplexMatrix( MatrixPtr Matrix, RealVector RHS, RealVector Solution , Real
|
|||
/*VARARGS3*/
|
||||
|
||||
void
|
||||
spSolveTransposed(MatrixPtr eMatrix, RealVector RHS, RealVector Solution,
|
||||
spSolveTransposed(MatrixPtr Matrix, RealVector RHS, RealVector Solution,
|
||||
RealVector iRHS, RealVector iSolution)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
RealVector Intermediate;
|
||||
int I, *pExtOrder, Size;
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ static void ComplexTransposedMatrixMultiply( MatrixPtr, RealVector, RealVector,
|
|||
* Tom Quarles.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix to be preordered.
|
||||
*
|
||||
* >>> Local variables;
|
||||
|
|
@ -174,9 +174,8 @@ static void ComplexTransposedMatrixMultiply( MatrixPtr, RealVector, RealVector,
|
|||
*/
|
||||
|
||||
void
|
||||
spMNA_Preorder(MatrixPtr eMatrix)
|
||||
spMNA_Preorder(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int J, Size;
|
||||
ElementPtr pTwin1, pTwin2;
|
||||
int Twins, StartAt = 1;
|
||||
|
|
@ -346,7 +345,7 @@ SwapCols( MatrixPtr Matrix, ElementPtr pTwin1, ElementPtr pTwin2 )
|
|||
* should not be executed before the function spMNA_Preorder.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix to be scaled.
|
||||
* SolutionScaleFactors <input> (RealVector)
|
||||
* The array of Solution scale factors. These factors scale the columns.
|
||||
|
|
@ -368,9 +367,8 @@ SwapCols( MatrixPtr Matrix, ElementPtr pTwin1, ElementPtr pTwin2 )
|
|||
*/
|
||||
|
||||
void
|
||||
spScale(MatrixPtr eMatrix, RealVector RHS_ScaleFactors, RealVector SolutionScaleFactors)
|
||||
spScale(MatrixPtr Matrix, RealVector RHS_ScaleFactors, RealVector SolutionScaleFactors)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
int I, lSize, *pExtOrder;
|
||||
RealNumber ScaleFactor;
|
||||
|
|
@ -556,7 +554,7 @@ MatrixPtr Matrix;
|
|||
* before spMNA_Preorder().
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix.
|
||||
* RHS <output> (RealVector)
|
||||
* RHS is the right hand side. This is what is being solved for.
|
||||
|
|
@ -571,14 +569,13 @@ MatrixPtr Matrix;
|
|||
*/
|
||||
|
||||
void
|
||||
spMultiply(MatrixPtr eMatrix, RealVector RHS, RealVector Solution,
|
||||
spMultiply(MatrixPtr Matrix, RealVector RHS, RealVector Solution,
|
||||
RealVector iRHS, RealVector iSolution)
|
||||
{
|
||||
ElementPtr pElement;
|
||||
RealVector Vector;
|
||||
RealNumber Sum;
|
||||
int I, *pExtOrder;
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
|
||||
/* Begin `spMultiply'. */
|
||||
assert( IS_SPARSE( Matrix ) && !Matrix->Factored );
|
||||
|
|
@ -702,7 +699,7 @@ ComplexMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector Solution , R
|
|||
* before spMNA_Preorder().
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix.
|
||||
* RHS <output> (RealVector)
|
||||
* RHS is the right hand side. This is what is being solved for.
|
||||
|
|
@ -717,14 +714,13 @@ ComplexMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector Solution , R
|
|||
*/
|
||||
|
||||
void
|
||||
spMultTransposed(MatrixPtr eMatrix, RealVector RHS, RealVector Solution,
|
||||
spMultTransposed(MatrixPtr Matrix, RealVector RHS, RealVector Solution,
|
||||
RealVector iRHS, RealVector iSolution)
|
||||
{
|
||||
ElementPtr pElement;
|
||||
RealVector Vector;
|
||||
RealNumber Sum;
|
||||
int I, *pExtOrder;
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
|
||||
/* Begin `spMultTransposed'. */
|
||||
assert( IS_SPARSE( Matrix ) && !Matrix->Factored );
|
||||
|
|
@ -854,7 +850,7 @@ ComplexTransposedMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector So
|
|||
* reasonable value and the logarithm of the scale factor is returned.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* A pointer to the matrix for which the determinant is desired.
|
||||
* pExponent <output> (int *)
|
||||
* The logarithm base 10 of the scale factor for the determinant. To find
|
||||
|
|
@ -878,10 +874,9 @@ ComplexTransposedMatrixMultiply( MatrixPtr Matrix, RealVector RHS, RealVector So
|
|||
*/
|
||||
|
||||
void
|
||||
spDeterminant(MatrixPtr eMatrix, int *pExponent, RealNumber *pDeterminant,
|
||||
spDeterminant(MatrixPtr Matrix, int *pExponent, RealNumber *pDeterminant,
|
||||
RealNumber *piDeterminant)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int I, Size;
|
||||
RealNumber Norm, nr, ni;
|
||||
ComplexNumber Pivot, cDeterminant;
|
||||
|
|
@ -1037,9 +1032,8 @@ spDeterminant(MatrixPtr eMatrix, int *pExponent, RealNumber *pDeterminant,
|
|||
*/
|
||||
|
||||
void
|
||||
spStripFills(MatrixPtr eMatrix)
|
||||
spStripFills(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
struct FillinListNodeStruct *pListNode;
|
||||
|
||||
/* Begin `spStripFills'. */
|
||||
|
|
@ -1109,10 +1103,8 @@ spStripFills(MatrixPtr eMatrix)
|
|||
* frame. This assumes that the matrix will be replaced with one of
|
||||
* the same size. */
|
||||
void
|
||||
spStripMatrix(MatrixPtr eMatrix)
|
||||
spStripMatrix(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
|
||||
/* Begin `spStripMatrix'. */
|
||||
assert( IS_SPARSE( Matrix ) );
|
||||
if (Matrix->Elements == 0) return;
|
||||
|
|
@ -1124,7 +1116,6 @@ spStripMatrix(MatrixPtr eMatrix)
|
|||
|
||||
/* Reset the element lists. */
|
||||
{
|
||||
ElementPtr pElement;
|
||||
struct ElementListNodeStruct *pListNode;
|
||||
|
||||
pListNode = Matrix->LastElementListNode = Matrix->FirstElementListNode;
|
||||
|
|
@ -1134,7 +1125,6 @@ spStripMatrix(MatrixPtr eMatrix)
|
|||
|
||||
/* Reset the fill-in lists. */
|
||||
{
|
||||
ElementPtr pFillin;
|
||||
struct FillinListNodeStruct *pListNode;
|
||||
|
||||
pListNode = Matrix->LastFillinListNode = Matrix->FirstFillinListNode;
|
||||
|
|
@ -1171,7 +1161,7 @@ spStripMatrix(MatrixPtr eMatrix)
|
|||
* doesn't exist.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix in which the row and column are to be deleted.
|
||||
* Row <input> (int)
|
||||
* Row to be deleted.
|
||||
|
|
@ -1197,9 +1187,8 @@ spStripMatrix(MatrixPtr eMatrix)
|
|||
*/
|
||||
|
||||
void
|
||||
spDeleteRowAndCol(MatrixPtr eMatrix, int Row, int Col)
|
||||
spDeleteRowAndCol(MatrixPtr Matrix, int Row, int Col)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement, *ppElement, pLastElement;
|
||||
int Size, ExtRow, ExtCol;
|
||||
ElementPtr spcFindElementInCol();
|
||||
|
|
@ -1306,13 +1295,12 @@ spDeleteRowAndCol(MatrixPtr eMatrix, int Row, int Col)
|
|||
* previous factorization. If the matrix was singular, zero is returned.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix. */
|
||||
|
||||
RealNumber
|
||||
spPseudoCondition(MatrixPtr eMatrix)
|
||||
spPseudoCondition(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int I;
|
||||
ArrayOfElementPtrs Diag;
|
||||
RealNumber MaxPivot, MinPivot, Mag;
|
||||
|
|
@ -1388,7 +1376,7 @@ spPseudoCondition(MatrixPtr eMatrix)
|
|||
* zero is returned.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix.
|
||||
* NormOfMatrix <input> (RealNumber)
|
||||
* The L-infinity norm of the unfactored matrix as computed by
|
||||
|
|
@ -1401,9 +1389,8 @@ spPseudoCondition(MatrixPtr eMatrix)
|
|||
* spNO_MEMORY */
|
||||
|
||||
RealNumber
|
||||
spCondition(MatrixPtr eMatrix, RealNumber NormOfMatrix, int *pError)
|
||||
spCondition(MatrixPtr Matrix, RealNumber NormOfMatrix, int *pError)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
RealVector T, Tm;
|
||||
int I, K, Row;
|
||||
|
|
@ -1824,14 +1811,13 @@ int *pError;
|
|||
* The largest absolute row sum of matrix.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix.
|
||||
*/
|
||||
|
||||
RealNumber
|
||||
spNorm(MatrixPtr eMatrix)
|
||||
spNorm(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
int I;
|
||||
RealNumber Max = 0.0, AbsRowSum;
|
||||
|
|
@ -1942,14 +1928,13 @@ spNorm(MatrixPtr eMatrix)
|
|||
* largest element in any of the reduced submatrices is returned.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix.
|
||||
*/
|
||||
|
||||
RealNumber
|
||||
spLargestElement(MatrixPtr eMatrix)
|
||||
spLargestElement(MatrixPtr Matrix)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
int I;
|
||||
RealNumber Mag, AbsColSum, Max = 0.0, MaxRow = 0.0, MaxCol = 0.0;
|
||||
RealNumber Pivot;
|
||||
|
|
@ -2066,7 +2051,7 @@ spLargestElement(MatrixPtr eMatrix)
|
|||
* Returns a bound on the magnitude of the largest element in E = A - LU.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Pointer to the matrix.
|
||||
* Rho <input> (RealNumber)
|
||||
* The bound on the magnitude of the largest element in any of the
|
||||
|
|
@ -2076,9 +2061,8 @@ spLargestElement(MatrixPtr eMatrix)
|
|||
*/
|
||||
|
||||
RealNumber
|
||||
spRoundoff(MatrixPtr eMatrix, RealNumber Rho)
|
||||
spRoundoff(MatrixPtr Matrix, RealNumber Rho)
|
||||
{
|
||||
MatrixPtr Matrix = eMatrix;
|
||||
ElementPtr pElement;
|
||||
int Count, I, MaxCount = 0;
|
||||
RealNumber Reid, Gear;
|
||||
|
|
@ -2087,7 +2071,7 @@ spRoundoff(MatrixPtr eMatrix, RealNumber Rho)
|
|||
assert( IS_SPARSE(Matrix) && IS_FACTORED(Matrix) );
|
||||
|
||||
/* Compute Barlow's bound if it is not given. */
|
||||
if (Rho < 0.0) Rho = spLargestElement( eMatrix );
|
||||
if (Rho < 0.0) Rho = spLargestElement( Matrix );
|
||||
|
||||
/* Find the maximum number of off-diagonals in L if not previously computed. */
|
||||
if (Matrix->MaxRowCountInLowerTri < 0)
|
||||
|
|
@ -2133,7 +2117,7 @@ spRoundoff(MatrixPtr eMatrix, RealNumber Rho)
|
|||
* error state of sparse. No message is produced if there is no error.
|
||||
*
|
||||
* >>> Arguments:
|
||||
* eMatrix <input> (char *)
|
||||
* Matrix <input> (char *)
|
||||
* Matrix for which the error message is to be printed.
|
||||
* Stream <input> (FILE *)
|
||||
* Stream to which the error message is to be printed.
|
||||
|
|
@ -2143,17 +2127,17 @@ spRoundoff(MatrixPtr eMatrix, RealNumber Rho)
|
|||
*/
|
||||
|
||||
void
|
||||
spErrorMessage(MatrixPtr eMatrix, FILE *Stream, char *Originator)
|
||||
spErrorMessage(MatrixPtr Matrix, FILE *Stream, char *Originator)
|
||||
{
|
||||
int Row, Col, Error;
|
||||
|
||||
/* Begin `spErrorMessage'. */
|
||||
if (eMatrix == NULL)
|
||||
if (Matrix == NULL)
|
||||
Error = spNO_MEMORY;
|
||||
else
|
||||
{
|
||||
assert(eMatrix->ID == SPARSE_ID);
|
||||
Error = eMatrix->Error;
|
||||
assert(Matrix->ID == SPARSE_ID);
|
||||
Error = Matrix->Error;
|
||||
}
|
||||
|
||||
if (Error == spOKAY) return;
|
||||
|
|
@ -2172,13 +2156,13 @@ spErrorMessage(MatrixPtr eMatrix, FILE *Stream, char *Originator)
|
|||
fprintf( Stream, "insufficient memory available.\n");
|
||||
else if (Error == spSINGULAR)
|
||||
{
|
||||
spWhereSingular( eMatrix, &Row, &Col );
|
||||
spWhereSingular( Matrix, &Row, &Col );
|
||||
fprintf( Stream, "singular matrix detected at row %d and column %d.\n",
|
||||
Row, Col);
|
||||
}
|
||||
else if (Error == spZERO_DIAG)
|
||||
{
|
||||
spWhereSingular( eMatrix, &Row, &Col );
|
||||
spWhereSingular( Matrix, &Row, &Col );
|
||||
fprintf( Stream, "zero diagonal detected at row %d and column %d.\n",
|
||||
Row, Col);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,12 @@
|
|||
#define STDERR_FILENO 2
|
||||
#endif
|
||||
|
||||
//#define low_latency
|
||||
|
||||
/* If a calling function has high latency times during printing,
|
||||
causing memory access errors, you may undef the following line.
|
||||
Printing messages are assembled in a wordlist, and sent to the caller
|
||||
via a new thread. Delays may occur. */
|
||||
#define low_latency
|
||||
|
||||
/**********************************************************************/
|
||||
/* Header files for C functions */
|
||||
|
|
@ -244,7 +249,6 @@ mutexType fputsMutex;
|
|||
static bool is_initialized = FALSE;
|
||||
static char* no_init = "Error: ngspice is not initialized!\n Run ngSpice_Init first";
|
||||
|
||||
static bool printstopp = FALSE;
|
||||
|
||||
/*helper function*//*
|
||||
static struct plot *
|
||||
|
|
@ -293,12 +297,16 @@ static threadId_t tid, printtid, bgtid = (threadId_t) 0;
|
|||
static bool fl_running = FALSE;
|
||||
static bool fl_exited = TRUE;
|
||||
|
||||
static bool printstopp = FALSE;
|
||||
static bool ps_exited = TRUE;
|
||||
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
#define EXPORT_FLAVOR WINAPI
|
||||
#else
|
||||
#define EXPORT_FLAVOR
|
||||
#endif
|
||||
|
||||
/* starts a background thread, e.g. from command bg_run */
|
||||
static void * EXPORT_FLAVOR
|
||||
_thread_run(void *string)
|
||||
{
|
||||
|
|
@ -324,7 +332,7 @@ _thread_run(void *string)
|
|||
}
|
||||
|
||||
|
||||
/*Stops a running thread, hopefully */
|
||||
/*Stops a running background thread, hopefully */
|
||||
static int EXPORT_FLAVOR
|
||||
_thread_stop(void)
|
||||
{
|
||||
|
|
@ -374,13 +382,16 @@ sighandler_sharedspice(int num)
|
|||
|
||||
#endif /*THREADS*/
|
||||
|
||||
|
||||
/* run a ngspice command */
|
||||
static int
|
||||
runc(char* command)
|
||||
{
|
||||
char buf[1024] = "";
|
||||
sighandler oldHandler;
|
||||
#ifdef THREADS
|
||||
#ifndef low_latency
|
||||
int timeout = 0;
|
||||
#endif
|
||||
char *string;
|
||||
bool fl_bg = FALSE;
|
||||
command_id = threadid_self();
|
||||
|
|
@ -392,12 +403,24 @@ runc(char* command)
|
|||
#ifndef low_latency
|
||||
/* stop the printf thread 'printsend()' */
|
||||
else if (cieq("bg_pstop", command)) {
|
||||
while (!ps_exited && timeout < 100) {
|
||||
printstopp = TRUE;
|
||||
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
Sleep(100); // va: windows native
|
||||
#else
|
||||
usleep(10000);
|
||||
#endif
|
||||
timeout++;
|
||||
}
|
||||
if (!ps_exited) {
|
||||
fprintf(stderr, "Error: Couldn't stop printsend thread\n");
|
||||
return EXIT_BAD;
|
||||
}
|
||||
else
|
||||
fprintf(stdout, "Printsend thread stopped with timeout = %d\n", timeout);
|
||||
|
||||
printstopp = FALSE;
|
||||
return 2;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -408,7 +431,7 @@ runc(char* command)
|
|||
#endif
|
||||
|
||||
/* Catch Ctrl-C to break simulations */
|
||||
#if !defined(_MSC_VER) /*&& !defined(__MINGW32__) */
|
||||
#if 1 //!defined(_MSC_VER) /*&& !defined(__MINGW32__) */
|
||||
oldHandler = signal(SIGINT, (SIGNAL_FUNCTION) ft_sigintr);
|
||||
if (SETJMP(jbuf, 1) != 0) {
|
||||
signal(SIGINT, oldHandler);
|
||||
|
|
@ -469,7 +492,7 @@ runc(char* command)
|
|||
|
||||
#ifdef THREADS
|
||||
|
||||
/* Checks if spice is running in the background */
|
||||
/* Checks if ngspice is running in the background */
|
||||
IMPEXP
|
||||
bool
|
||||
ngSpice_running (void)
|
||||
|
|
@ -479,7 +502,7 @@ ngSpice_running (void)
|
|||
#endif
|
||||
|
||||
|
||||
/* Initialise spice and setup native methods */
|
||||
/* Initialise ngspice and setup native methods */
|
||||
IMPEXP
|
||||
int
|
||||
ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexit,
|
||||
|
|
@ -578,12 +601,9 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi
|
|||
struct passwd *pw;
|
||||
pw = getpwuid(getuid());
|
||||
|
||||
#ifdef HAVE_ASPRINTF
|
||||
asprintf(&s, "%s%s", pw->pw_dir, INITSTR);
|
||||
#else
|
||||
s = TMALLOC(char, 1 + strlen(pw->pw_dir) + strlen(INITSTR));
|
||||
sprintf(s, "%s%s", pw->pw_dir, INITSTR);
|
||||
#endif
|
||||
|
||||
if (access(s, 0) == 0)
|
||||
inp_source(s);
|
||||
}
|
||||
|
|
@ -627,7 +647,14 @@ bot:
|
|||
}
|
||||
#endif
|
||||
|
||||
com_version(NULL);
|
||||
// com_version(NULL);
|
||||
fprintf(cp_out,
|
||||
"******\n"
|
||||
"** %s-%s shared library\n",
|
||||
ft_sim->simulator, ft_sim->version);
|
||||
if (Spice_Build_Date != NULL && *Spice_Build_Date != 0)
|
||||
fprintf(cp_out, "** Creation Date: %s\n", Spice_Build_Date);
|
||||
fprintf(cp_out, "******\n");
|
||||
|
||||
is_initialized = TRUE;
|
||||
|
||||
|
|
@ -638,7 +665,7 @@ bot:
|
|||
/* If caller has sent valid address for pfcn */
|
||||
if (!noprintfwanted)
|
||||
#ifdef HAVE_LIBPTHREAD
|
||||
pthread_create(&tid, NULL, (void * (*)(void *))printsend, (void *)NULL);
|
||||
pthread_create(&printtid, NULL, (void * (*)(void *))printsend, (void *)NULL);
|
||||
#elif defined _MSC_VER || defined __MINGW32__
|
||||
printtid = (HANDLE)_beginthreadex(NULL, 0, (unsigned int (__stdcall *)(void *))printsend,
|
||||
(void*) NULL, 0, NULL);
|
||||
|
|
@ -659,7 +686,6 @@ IMPEXP
|
|||
int ngSpice_Command(char* comexec)
|
||||
{
|
||||
if ( ! setjmp(errbufc) ) {
|
||||
// HANDLE tid2;
|
||||
|
||||
immediate = FALSE;
|
||||
intermj = 1;
|
||||
|
|
@ -668,12 +694,9 @@ int ngSpice_Command(char* comexec)
|
|||
fprintf(stderr, no_init);
|
||||
return 1;
|
||||
}
|
||||
// tid2 = (HANDLE)_beginthreadex(NULL, 0, (PTHREAD_START_ROUTINE)runc, (void*)comexec,
|
||||
// 0, NULL);
|
||||
|
||||
runc(comexec);
|
||||
/* main thread prepares immediate detaching of dll,
|
||||
in case of controlled_exit from tid2 thread, caller is asked
|
||||
to detach dll via fcn ngexit() */
|
||||
/* main thread prepares immediate detaching of dll */
|
||||
immediate = TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -722,6 +745,7 @@ int ngSpice_Circ(char** circa){
|
|||
|
||||
if ( ! setjmp(errbufm) ) {
|
||||
intermj = 0;
|
||||
immediate = FALSE;
|
||||
/* count the entries */
|
||||
while (circa[entries]) {
|
||||
entries++;
|
||||
|
|
@ -747,7 +771,7 @@ char* ngSpice_CurPlot(void)
|
|||
}
|
||||
|
||||
/* return to the caller a pointer to an array of all plots created
|
||||
by ngspice.dll */
|
||||
by ngspice. Last entry in the array is NULL. */
|
||||
IMPEXP
|
||||
char** ngSpice_AllPlots(void)
|
||||
{
|
||||
|
|
@ -771,7 +795,7 @@ char** ngSpice_AllPlots(void)
|
|||
}
|
||||
|
||||
/* return to the caller a pointer to an array of vector names in the plot
|
||||
named by plotname */
|
||||
named by plotname. Last entry in the array is NULL. */
|
||||
IMPEXP
|
||||
char** ngSpice_AllVecs(char* plotname)
|
||||
{
|
||||
|
|
@ -809,8 +833,8 @@ char** ngSpice_AllVecs(char* plotname)
|
|||
/* Redefine the vfprintf() functions for callback */
|
||||
/*------------------------------------------------------*/
|
||||
|
||||
/* handling of escape characters (extra \ added) is removed, may be added by
|
||||
un-commenting some lines */
|
||||
/* handling of escape characters (extra \ added) only, if
|
||||
'set addescape' is given in .spiceinit */
|
||||
|
||||
int
|
||||
sh_vfprintf(FILE *f, const char *fmt, va_list args)
|
||||
|
|
@ -889,7 +913,7 @@ sh_vfprintf(FILE *f, const char *fmt, va_list args)
|
|||
}
|
||||
}
|
||||
|
||||
/* use sharedspice implementation of fputs (sh_fputs)
|
||||
/* use sharedspice.c implementation of fputs (sh_fputs)
|
||||
to assess callback function derived from address printfcn received via
|
||||
Spice_Init() from caller of ngspice.dll */
|
||||
|
||||
|
|
@ -903,9 +927,10 @@ sh_vfprintf(FILE *f, const char *fmt, va_list args)
|
|||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Reimplement fprintf() as a call to callback function pfcn */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------
|
||||
Reimplement fprintf() as a call to callback function pfcn
|
||||
via sh_vfprintf, sh_fputs, and sh_fputsll
|
||||
----------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
sh_fprintf(FILE *f, const char *format, ...)
|
||||
|
|
@ -921,9 +946,10 @@ sh_fprintf(FILE *f, const char *format, ...)
|
|||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
/* Reimplement printf() as a call to callback function pfcn */
|
||||
/*----------------------------------------------------------------------*/
|
||||
/*----------------------------------------------------------------------
|
||||
Reimplement printf() as a call to callback function pfcn
|
||||
via sh_vfprintf, sh_fputs, and sh_fputsll
|
||||
----------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
sh_printf(const char *format, ...)
|
||||
|
|
@ -975,9 +1001,9 @@ sh_fputc(const char inp, FILE* f)
|
|||
static char* outstringerr = NULL;
|
||||
static char* outstringout = NULL;
|
||||
|
||||
#ifdef low_latency
|
||||
/* using the strings by the caller sent directly to the caller
|
||||
has to fast enough (low latency) */
|
||||
#if defined (low_latency) || !defined(THREADS)
|
||||
/* The strings issued by printf etc. are sent directly to the caller.
|
||||
The callback has to be fast enough (low latency). */
|
||||
int
|
||||
sh_fputsll(const char *input, FILE* outf)
|
||||
{
|
||||
|
|
@ -1065,7 +1091,8 @@ sh_fputsll(const char *input, FILE* outf)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* provide a lock around printing function */
|
||||
/* provide a lock around printing function.
|
||||
May become critical if latency of callback is too high.*/
|
||||
int
|
||||
sh_fputs(const char *input, FILE* outf)
|
||||
{
|
||||
|
|
@ -1187,6 +1214,8 @@ static char *outsend = NULL;
|
|||
static void
|
||||
printsend(void)
|
||||
{
|
||||
ps_exited = FALSE;
|
||||
printstopp = FALSE;
|
||||
for (;;) {
|
||||
#if defined(__MINGW32__) || defined(_MSC_VER)
|
||||
Sleep(50); // loop delay
|
||||
|
|
@ -1198,6 +1227,7 @@ printsend(void)
|
|||
mutex_lock(&fputsMutex);
|
||||
outsend = outstorage(NULL, FALSE);
|
||||
mutex_unlock(&fputsMutex);
|
||||
|
||||
break;
|
||||
}
|
||||
mutex_lock(&fputsMutex);
|
||||
|
|
@ -1210,6 +1240,7 @@ printsend(void)
|
|||
tfree(outsend);
|
||||
}
|
||||
}
|
||||
ps_exited = TRUE;
|
||||
}
|
||||
|
||||
/* remove the first entry of a wordlist, but keep wl->wl_word */
|
||||
|
|
@ -1251,7 +1282,7 @@ char* outstorage(char* wordin, bool write)
|
|||
|
||||
|
||||
/* New progress report to statfcn().
|
||||
Update only every DELTATIME milliseconds */
|
||||
An update occurs only every DELTATIME milliseconds. */
|
||||
#define DELTATIME 150
|
||||
void SetAnalyse(
|
||||
char * Analyse, /*in: analysis type */
|
||||
|
|
@ -1323,8 +1354,8 @@ void SetAnalyse(
|
|||
tfree(s);
|
||||
}
|
||||
|
||||
/* a dll or shared library should never exit, but ask for graceful shutdown
|
||||
(e.g. being detached) via a callback function*/
|
||||
/* a dll or shared library should never exit, if loaded dynamically,
|
||||
but ask for graceful shutdown (e.g. being detached) via a callback function*/
|
||||
void shared_exit(int status)
|
||||
{
|
||||
/* alert caller to detach dll (if we are in the main thread),
|
||||
|
|
@ -1448,7 +1479,7 @@ int sh_ExecutePerLoop(void)
|
|||
{
|
||||
struct dvec *d;
|
||||
int i, veclen;
|
||||
double testval;
|
||||
// double testval;
|
||||
struct plot *pl = plot_cur;
|
||||
/* return immediately if callback not wanted */
|
||||
if (nodatawanted)
|
||||
|
|
@ -1456,11 +1487,12 @@ int sh_ExecutePerLoop(void)
|
|||
|
||||
/* get the data of the last entry to the plot vector */
|
||||
veclen = pl->pl_dvecs->v_length - 1;
|
||||
curvecvalsall->vecindex = veclen;
|
||||
for (d = pl->pl_dvecs, i = 0; d; d = d->v_next, i++) {
|
||||
/* test if real */
|
||||
if (d->v_flags & VF_REAL) {
|
||||
curvecvalsall->vecsa[i]->is_complex = FALSE;
|
||||
testval = d->v_realdata[veclen];
|
||||
// testval = d->v_realdata[veclen];
|
||||
curvecvalsall->vecsa[i]->creal = d->v_realdata[veclen];
|
||||
curvecvalsall->vecsa[i]->cimag = 0.;
|
||||
}
|
||||
|
|
@ -1478,7 +1510,7 @@ int sh_ExecutePerLoop(void)
|
|||
|
||||
|
||||
/* called once for a new plot from beginPlot() in outitf.c,
|
||||
after the vectors in ngspice have been set.
|
||||
after the vectors in ngspice for this plot have been set.
|
||||
Transfers vector information to the caller via callback datinitfcn()
|
||||
and sets transfer structure for use in sh_ExecutePerLoop() */
|
||||
int sh_vecinit(runDesc *run)
|
||||
|
|
@ -1536,14 +1568,13 @@ int sh_vecinit(runDesc *run)
|
|||
data will be sent from sh_ExecutePerLoop() via datfcn() */
|
||||
if (!curvecvalsall) {
|
||||
curvecvalsall = TMALLOC(vecvaluesall, 1);
|
||||
curvecvalsall->veccount = veccount;
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < curvecvalsall->veccount; i++)
|
||||
tfree(curvecvalsall->vecsa[i]);
|
||||
tfree(curvecvalsall->vecsa);
|
||||
}
|
||||
|
||||
curvecvalsall->veccount = veccount;
|
||||
curvecvalsall->vecsa = TMALLOC(pvecvalues, veccount);
|
||||
|
||||
for (i = 0, d = cur_run->runPlot->pl_dvecs; i < veccount; i++, d = d->v_next) {
|
||||
|
|
|
|||
|
|
@ -107,6 +107,10 @@ libckt_la_SOURCES += \
|
|||
endif
|
||||
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libckt_la_SOURCES += cktmkcurKCL.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -I$(top_srcdir)/src/spicelib/devices
|
||||
AM_CFLAGS = $(STATIC)
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ extern SPICEanalysis SENSinfo;
|
|||
extern SPICEanalysis PSSinfo;
|
||||
#endif
|
||||
|
||||
#ifdef WANT_SENSE2
|
||||
extern SPICEanalysis SEN2info;
|
||||
#endif
|
||||
|
||||
SPICEanalysis *analInfo[] = {
|
||||
&OPTinfo,
|
||||
&ACinfo,
|
||||
|
|
@ -34,6 +38,9 @@ SPICEanalysis *analInfo[] = {
|
|||
#ifdef WITH_PSS
|
||||
&PSSinfo,
|
||||
#endif
|
||||
#ifdef WANT_SENSE2
|
||||
&SEN2info,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,11 @@ CKTload(CKTcircuit *ckt)
|
|||
size = SMPmatSize(ckt->CKTmatrix);
|
||||
for (i = 0; i <= size; i++) {
|
||||
ckt->CKTrhs[i] = 0;
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
ckt->CKTfvk[i] = 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
SMPclear(ckt->CKTmatrix);
|
||||
#ifdef STEPDEBUG
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/sperror.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
|
||||
int
|
||||
CKTmkCurKCL (CKTcircuit *ckt, int i, double **node)
|
||||
{
|
||||
CKTmkCurKCLnode *tempNode ;
|
||||
|
||||
tempNode = TMALLOC (CKTmkCurKCLnode, 1) ;
|
||||
tempNode->KCLcurrent = 0.0 ;
|
||||
tempNode->next = ckt->CKTmkCurKCLarray [i] ;
|
||||
ckt->CKTmkCurKCLarray [i] = tempNode ;
|
||||
*node = &(tempNode->KCLcurrent) ;
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -61,7 +61,9 @@ CKTsetup(CKTcircuit *ckt)
|
|||
|
||||
#ifdef WANT_SENSE2
|
||||
if(ckt->CKTsenInfo){
|
||||
if (error = CKTsenSetup(ckt)) return(error);
|
||||
error = CKTsenSetup(ckt);
|
||||
if (error)
|
||||
return(error);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -269,6 +271,22 @@ CKTsetup(CKTcircuit *ckt)
|
|||
|
||||
/* gtri - end - Setup for adding rshunt option resistors */
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/** Marking node as Non-Linear when needed
|
||||
* By default every node is Linear
|
||||
*/
|
||||
for (i = 0 ; i < DEVmaxnum ; i++)
|
||||
{
|
||||
if (DEVices[i] && DEVices[i]->DEVnodeIsNonLinear && ckt->CKThead[i])
|
||||
{
|
||||
error = DEVices[i]->DEVnodeIsNonLinear (ckt->CKThead[i], ckt) ;
|
||||
if (error)
|
||||
return (error) ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return(OK);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ Modified: 2000 AlansFixes
|
|||
int
|
||||
DCop(CKTcircuit *ckt, int notused)
|
||||
{
|
||||
#ifdef WANT_SENSE2
|
||||
int i, senmode, size;
|
||||
long save;
|
||||
#endif
|
||||
|
||||
int converged;
|
||||
int error;
|
||||
IFuid *nameList; /* va: tmalloc'ed list */
|
||||
|
|
@ -133,7 +138,10 @@ DCop(CKTcircuit *ckt, int notused)
|
|||
for(i = 1; i<=size ; i++){
|
||||
ckt->CKTrhsOp[i] = ckt->CKTrhsOld[i];
|
||||
}
|
||||
if(error = CKTsenDCtran(ckt)) return(error);
|
||||
error = CKTsenDCtran(ckt);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
ckt->CKTmode = save;
|
||||
ckt->CKTsenInfo->SENmode = senmode;
|
||||
|
||||
|
|
|
|||
|
|
@ -78,9 +78,8 @@ DCtran(CKTcircuit *ckt,
|
|||
int firsttime;
|
||||
int error;
|
||||
#ifdef WANT_SENSE2
|
||||
#ifdef SENSDEBUG
|
||||
FILE *outsen;
|
||||
#endif /* SENSDEBUG */
|
||||
int save, save2, size;
|
||||
long save1;
|
||||
#endif
|
||||
int save_order;
|
||||
long save_mode;
|
||||
|
|
@ -316,7 +315,10 @@ DCtran(CKTcircuit *ckt,
|
|||
save2 = ckt->CKTorder;
|
||||
ckt->CKTmode = save_mode;
|
||||
ckt->CKTorder = save_order;
|
||||
if(error = CKTsenDCtran(ckt)) return(error);
|
||||
error = CKTsenDCtran(ckt);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
ckt->CKTmode = save1;
|
||||
ckt->CKTorder = save2;
|
||||
}
|
||||
|
|
@ -479,9 +481,6 @@ DCtran(CKTcircuit *ckt,
|
|||
#ifdef WANT_SENSE2
|
||||
if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode & TRANSEN)){
|
||||
ckt->CKTsenInfo->SENmode = save;
|
||||
#ifdef SENSDEBUG
|
||||
fclose(outsen);
|
||||
#endif /* SENSDEBUG */
|
||||
}
|
||||
#endif
|
||||
return(OK);
|
||||
|
|
@ -508,7 +507,7 @@ resume:
|
|||
if (ckt->CKTtime == 0.)
|
||||
SetAnalyse( "tran init", 0);
|
||||
else
|
||||
SetAnalyse( "tran", (int)((ckt->CKTtime * 1000.) / ckt->CKTfinalTime) + 0.5);
|
||||
SetAnalyse( "tran", (int)((ckt->CKTtime * 1000.) / ckt->CKTfinalTime + 0.5));
|
||||
#endif
|
||||
ckt->CKTdelta =
|
||||
MIN(ckt->CKTdelta,ckt->CKTmaxStep);
|
||||
|
|
@ -546,6 +545,10 @@ resume:
|
|||
ckt->CKTbreaks[1] - ckt->CKTbreaks[0]));
|
||||
|
||||
if(firsttime) {
|
||||
/* set a breakpoint to reduce ringing of current in devices */
|
||||
if (ckt->CKTmode&MODEUIC)
|
||||
CKTsetBreak(ckt,ckt->CKTstep);
|
||||
|
||||
ckt->CKTdelta /= 10;
|
||||
#ifdef STEPDEBUG
|
||||
(void)printf("delta cut for initial timepoint\n");
|
||||
|
|
@ -792,7 +795,10 @@ resume:
|
|||
save2 = ckt->CKTorder;
|
||||
ckt->CKTmode = save_mode;
|
||||
ckt->CKTorder = save_order;
|
||||
if(error = CKTsenDCtran(ckt)) return(error);
|
||||
error = CKTsenDCtran (ckt);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
ckt->CKTmode = save1;
|
||||
ckt->CKTorder = save2;
|
||||
}
|
||||
|
|
@ -852,7 +858,10 @@ resume:
|
|||
save2 = ckt->CKTorder;
|
||||
ckt->CKTmode = save_mode;
|
||||
ckt->CKTorder = save_order;
|
||||
if(error = CKTsenDCtran(ckt)) return(error);
|
||||
error = CKTsenDCtran(ckt);
|
||||
if (error)
|
||||
return (error);
|
||||
|
||||
ckt->CKTmode = save1;
|
||||
ckt->CKTorder = save2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ DCtrCurv(CKTcircuit *ckt, int restart)
|
|||
static runDesc *plot = NULL;
|
||||
|
||||
#ifdef WANT_SENSE2
|
||||
long save;
|
||||
#ifdef SENSDEBUG
|
||||
if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode&DCSEN) ){
|
||||
printf("\nDC Sensitivity Results\n\n");
|
||||
|
|
@ -450,7 +451,7 @@ resume:
|
|||
}
|
||||
if (job->TRCVvType[i] == TEMP_CODE) { /* Temperature */
|
||||
printf("Current Circuit Temperature : %.5e C\n",
|
||||
ckt-CKTtemp - CONSTCtoK);
|
||||
ckt->CKTtemp - CONSTCtoK);
|
||||
}
|
||||
|
||||
#endif /* SENSDEBUG */
|
||||
|
|
@ -458,7 +459,10 @@ resume:
|
|||
senmode = ckt->CKTsenInfo->SENmode;
|
||||
save = ckt->CKTmode;
|
||||
ckt->CKTsenInfo->SENmode = DCSEN;
|
||||
if(error = CKTsenDCtran(ckt)) return (error);
|
||||
error = CKTsenDCtran(ckt);
|
||||
if (error)
|
||||
return(error);
|
||||
|
||||
ckt->CKTmode = save;
|
||||
ckt->CKTsenInfo->SENmode = senmode;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,23 +22,14 @@ int TRANinit(CKTcircuit *ckt, JOB *anal)
|
|||
ckt->CKTinitTime = job->TRANinitTime;
|
||||
ckt->CKTmaxStep = job->TRANmaxStep;
|
||||
|
||||
|
||||
|
||||
/* The following code has been taken from macspice 3f4 (A. Wilson)
|
||||
in the file traninit.new.c - Seems interesting */
|
||||
if(ckt->CKTmaxStep == 0)
|
||||
{
|
||||
if(ckt->CKTmaxStep == 0) {
|
||||
if (ckt->CKTstep < ( ckt->CKTfinalTime - ckt->CKTinitTime )/50.0)
|
||||
{
|
||||
ckt->CKTmaxStep = ckt->CKTstep;
|
||||
}
|
||||
else
|
||||
{
|
||||
ckt->CKTmaxStep = ( ckt->CKTfinalTime - ckt->CKTinitTime )/50.0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ckt->CKTdelmin = 1e-11*ckt->CKTmaxStep; /* XXX */
|
||||
ckt->CKTmode = job->TRANmode;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,10 @@ libasrc_la_SOURCES = \
|
|||
asrctemp.c
|
||||
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libasrc_la_SOURCES += asrcnode.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
|
|
|||
|
|
@ -16,3 +16,4 @@ extern int ASRCacLoad(GENmodel*,CKTcircuit*);
|
|||
extern int ASRCsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
|
||||
extern int ASRCunsetup(GENmodel*,CKTcircuit*);
|
||||
extern int ASRCtemp(GENmodel*,CKTcircuit*);
|
||||
extern int ASRCnodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
|
|
|
|||
|
|
@ -74,12 +74,17 @@ SPICEdev ASRCinfo = {
|
|||
#endif
|
||||
/* DEVinstSize */ &ASRCiSize,
|
||||
/* DEVmodSize */ &ASRCmSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ NULL,
|
||||
/* DEVbindCSCComplex */ NULL,
|
||||
/* DEVbindCSCComplexToReal */ NULL,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ ASRCnodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "asrcdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
ASRCnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
ASRCmodel *model = (ASRCmodel *)inModel ;
|
||||
ASRCinstance *here ;
|
||||
|
||||
/* loop through all the ASRC models */
|
||||
for ( ; model != NULL ; model = model->ASRCnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->ASRCinstances ; here != NULL ; here = here->ASRCnextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->ASRCposNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->ASRCnegNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -47,6 +47,10 @@ if UMFPACK_WANTED
|
|||
libbjt_la_SOURCES += bjtbindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbjt_la_SOURCES += bjtnode.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ extern int BJTtrunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int BJTdisto(int,GENmodel*,CKTcircuit*);
|
||||
extern int BJTnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int BJTdSetup(GENmodel*, register CKTcircuit*);
|
||||
extern int BJTnodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -73,12 +73,17 @@ SPICEdev BJTinfo = { /* description from struct IFdevice */
|
|||
#endif
|
||||
/* DEVinstSize */ &BJTiSize,
|
||||
/* DEVmodSize */ &BJTmSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ BJTbindCSC,
|
||||
/* DEVbindCSCComplex */ BJTbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BJTbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ BJTnodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bjtdefs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
BJTnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BJTmodel *model = (BJTmodel *)inModel ;
|
||||
BJTinstance *here ;
|
||||
|
||||
/* loop through all the BJT models */
|
||||
for ( ; model != NULL ; model = model->BJTnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BJTinstances ; here != NULL ; here = here->BJTnextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->BJTcolPrimeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BJTbasePrimeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BJTemitPrimeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BJTsubstNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BJTsubstConNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -540,11 +540,11 @@ load:
|
|||
,cbe,icbe,cce,icce);
|
||||
|
||||
printf("cc = %.7e + j%.7e , ce = %.7e + j%.7e,",
|
||||
,cc,icc,ce,ice);
|
||||
cc,icc,ce,ice);
|
||||
printf("ccprm = %.7e + j%.7e , ceprm = %.7e + j%.7e",
|
||||
ccprm,iccprm,ceprm,iceprm);
|
||||
printf("cb = %.7e + j%.7e , cbprm = %.7e + j%.7e , ",
|
||||
cb,icb,cbprm,icbprm)
|
||||
cb,icb,cbprm,icbprm);
|
||||
printf("cs = %.7e + j%.7e\n",
|
||||
cs,ics);
|
||||
#endif /* SENSDEBUG */
|
||||
|
|
|
|||
|
|
@ -55,9 +55,8 @@ BJTsUpdate(GENmodel *inModel, CKTcircuit *ckt)
|
|||
sxpbx = 0;
|
||||
#ifdef SENSDEBUG
|
||||
printf("senupdate Instance name: %s\n",here->BJTname);
|
||||
printf("iparmno = %d,CKTag[0] = %.2e,CKTag[1] = %.2e\n",
|
||||
iparmno,ckt->CKTag[0],ckt->CKTag[1]);
|
||||
|
||||
printf("CKTag[0] = %.2e,CKTag[1] = %.2e\n",
|
||||
ckt->CKTag[0],ckt->CKTag[1]);
|
||||
printf("capbe = %.7e\n",here->BJTcapbe);
|
||||
printf("capbc = %.7e\n",here->BJTcapbc);
|
||||
printf("capsub = %.7e\n",here->BJTcapsub);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ if UMFPACK_WANTED
|
|||
libbsim1_la_SOURCES += b1bindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim1_la_SOURCES += b1node.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim1def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
B1nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B1model *model = (B1model *)inModel ;
|
||||
B1instance *here ;
|
||||
|
||||
/* loop through all the BSIM1 models */
|
||||
for ( ; model != NULL ; model = model->B1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B1instances ; here != NULL ; here = here->B1nextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B1dNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B1sNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B1gNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B1bNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -35,3 +35,7 @@ extern int B1bindCSC (GENmodel*, CKTcircuit*) ;
|
|||
extern int B1bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B1bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int B1nodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,12 +73,17 @@ SPICEdev B1info = {
|
|||
#endif
|
||||
/* DEVinstSize */ &B1iSize,
|
||||
/* DEVmodSize */ &B1mSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ B1bindCSC,
|
||||
/* DEVbindCSCComplex */ B1bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B1bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ B1nodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ if UMFPACK_WANTED
|
|||
libbsim2_la_SOURCES += b2bindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim2_la_SOURCES += b2node.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -40,13 +40,13 @@ B2load(GENmodel *inModel, CKTcircuit *ckt)
|
|||
double cd;
|
||||
double cdrain;
|
||||
double cdhat;
|
||||
double cdreq;
|
||||
double cdreq, cdreq_fvk ;
|
||||
double ceq;
|
||||
double ceqbd;
|
||||
double ceqbs;
|
||||
double ceqqb;
|
||||
double ceqqd;
|
||||
double ceqqg;
|
||||
double ceqbd, ceqbd_fvk ;
|
||||
double ceqbs, ceqbs_fvk ;
|
||||
double ceqqb, ceqqb_fvk ;
|
||||
double ceqqd, ceqqd_fvk ;
|
||||
double ceqqg, ceqqg_fvk ;
|
||||
double czbd;
|
||||
double czbdsw;
|
||||
double czbs;
|
||||
|
|
@ -628,7 +628,7 @@ line755:
|
|||
|
||||
line850:
|
||||
/* initialize to zero charge conductance and current */
|
||||
ceqqg = ceqqb = ceqqd = 0.0;
|
||||
ceqqg = ceqqg_fvk = ceqqb = ceqqb_fvk = ceqqd = ceqqd_fvk = 0.0;
|
||||
gcdgb = gcddb = gcdsb = 0.0;
|
||||
gcsgb = gcsdb = gcssb = 0.0;
|
||||
gcggb = gcgdb = gcgsb = 0.0;
|
||||
|
|
@ -641,8 +641,11 @@ line860:
|
|||
cqbulk = *(ckt->CKTstate0 + here->B2iqb);
|
||||
cqdrn = *(ckt->CKTstate0 + here->B2iqd);
|
||||
ceqqg = cqgate - gcggb * vgb + gcgdb * vbd + gcgsb * vbs;
|
||||
ceqqg_fvk = cqgate ;
|
||||
ceqqb = cqbulk - gcbgb * vgb + gcbdb * vbd + gcbsb * vbs;
|
||||
ceqqb_fvk = cqbulk ;
|
||||
ceqqd = cqdrn - gcdgb * vgb + gcddb * vbd + gcdsb * vbs;
|
||||
ceqqd_fvk = cqdrn ;
|
||||
|
||||
if(ckt->CKTmode & MODEINITTRAN ) {
|
||||
*(ckt->CKTstate1 + here->B2iqb) =
|
||||
|
|
@ -661,19 +664,25 @@ line900:
|
|||
m = here->B2m;
|
||||
|
||||
ceqbs = model->B2type * (cbs-(gbs-ckt->CKTgmin)*vbs);
|
||||
ceqbs_fvk = model->B2type * (cbs + ckt->CKTgmin * vbs) ;
|
||||
ceqbd = model->B2type * (cbd-(gbd-ckt->CKTgmin)*vbd);
|
||||
|
||||
ceqbd_fvk = model->B2type * (cbd + ckt->CKTgmin * vbd) ;
|
||||
ceqqg = model->B2type * ceqqg;
|
||||
ceqqg_fvk = model->B2type * ceqqg_fvk ;
|
||||
ceqqb = model->B2type * ceqqb;
|
||||
ceqqb_fvk = model->B2type * ceqqb_fvk ;
|
||||
ceqqd = model->B2type * ceqqd;
|
||||
ceqqd_fvk = model->B2type * ceqqd_fvk ;
|
||||
if (here->B2mode >= 0) {
|
||||
xnrm=1;
|
||||
xrev=0;
|
||||
cdreq=model->B2type*(cdrain-gds*vds-gm*vgs-gmbs*vbs);
|
||||
cdreq_fvk = model->B2type * cdrain ;
|
||||
} else {
|
||||
xnrm=0;
|
||||
xrev=1;
|
||||
cdreq = -(model->B2type)*(cdrain+gds*vds-gm*vgd-gmbs*vbd);
|
||||
cdreq_fvk = - (model->B2type * cdrain) ;
|
||||
}
|
||||
|
||||
*(ckt->CKTrhs + here->B2gNode) -= m * (ceqqg);
|
||||
|
|
@ -712,6 +721,24 @@ line900:
|
|||
*(here->B2SPbPtr) += m * (-gbs-(xnrm-xrev)*gmbs-gcsgb-gcsdb-gcssb);
|
||||
*(here->B2SPdpPtr) += m * (-gds-xrev*(gm+gmbs)+gcsdb);
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* KCL verification - Dynamic Part */
|
||||
*(ckt->CKTfvk + here->B2gNode) += m * ceqqg_fvk ;
|
||||
*(ckt->CKTfvk + here->B2bNode) += m * (ceqbs_fvk + ceqbd_fvk + ceqqb_fvk) ;
|
||||
*(ckt->CKTfvk + here->B2dNodePrime) -= m * (ceqbd_fvk - cdreq_fvk - ceqqd_fvk) ;
|
||||
*(ckt->CKTfvk + here->B2sNodePrime) -= m * (cdreq_fvk + ceqbs_fvk + ceqqg_fvk + ceqqb_fvk + ceqqd_fvk) ;
|
||||
|
||||
|
||||
/* KCL verification - Linear and Static Part */
|
||||
*(ckt->CKTfvk + here->B2dNode) += m * (here->B2drainConductance) * *(ckt->CKTrhsOld + here->B2dNode) ;
|
||||
*(ckt->CKTfvk + here->B2sNode) += m * (here->B2sourceConductance) * *(ckt->CKTrhsOld + here->B2sNode) ;
|
||||
*(ckt->CKTfvk + here->B2dNodePrime) += m * (here->B2drainConductance) * *(ckt->CKTrhsOld + here->B2dNodePrime) ;
|
||||
*(ckt->CKTfvk + here->B2sNodePrime) += m * (here->B2sourceConductance) * *(ckt->CKTrhsOld + here->B2sNodePrime) ;
|
||||
*(ckt->CKTfvk + here->B2dNode) += m * (-here->B2drainConductance) * *(ckt->CKTrhsOld + here->B2dNodePrime) ;
|
||||
*(ckt->CKTfvk + here->B2sNode) += m * (-here->B2sourceConductance) * *(ckt->CKTrhsOld + here->B2sNodePrime) ;
|
||||
*(ckt->CKTfvk + here->B2dNodePrime) += m * (-here->B2drainConductance) * *(ckt->CKTrhsOld + here->B2dNode) ;
|
||||
*(ckt->CKTfvk + here->B2sNodePrime) += m * (-here->B2sourceConductance) * *(ckt->CKTrhsOld + here->B2sNode) ;
|
||||
#endif
|
||||
|
||||
line1000: ;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim2def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
B2nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B2model *model = (B2model *)inModel ;
|
||||
B2instance *here ;
|
||||
|
||||
/* loop through all the BSIM2 models */
|
||||
for ( ; model != NULL ; model = model->B2nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B2instances ; here != NULL ; here = here->B2nextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B2dNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B2sNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B2gNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B2bNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -31,3 +31,7 @@ extern int B2bindCSC (GENmodel*, CKTcircuit*) ;
|
|||
extern int B2bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B2bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int B2nodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -73,12 +73,17 @@ SPICEdev B2info = {
|
|||
#endif
|
||||
/* DEVinstSize */ &B2iSize,
|
||||
/* DEVmodSize */ &B2mSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ B2bindCSC,
|
||||
/* DEVbindCSCComplex */ B2bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B2bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ B2nodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ if UMFPACK_WANTED
|
|||
libbsim3_la_SOURCES += b3bindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim3_la_SOURCES += b3node.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ IOP( "nrs", BSIM3_NRS, IF_REAL , "Number of squares in source"),
|
|||
IOP( "off", BSIM3_OFF, IF_FLAG , "Device is initially off"),
|
||||
IOP( "nqsmod", BSIM3_NQSMOD, IF_INTEGER, "Non-quasi-static model selector"),
|
||||
IOP( "acnqsmod", BSIM3_ACNQSMOD, IF_INTEGER, "AC NQS model selector"),
|
||||
IOP( "geo", BSIM3_GEO, IF_INTEGER, "ACM model drain/source connection"),
|
||||
IOP( "delvto", BSIM3_DELVTO, IF_REAL, "Zero bias threshold voltage variation"),
|
||||
IOP( "mulu0", BSIM3_MULU0, IF_REAL, "Low field mobility multiplier"),
|
||||
IP( "ic", BSIM3_IC, IF_REALVEC , "Vector of DS,GS,BS initial voltages"),
|
||||
OP( "gmbs", BSIM3_GMBS, IF_REAL, "Gmb"),
|
||||
OP( "gm", BSIM3_GM, IF_REAL, "Gm"),
|
||||
|
|
@ -63,7 +66,10 @@ IFparm BSIM3mPTable[] = { /* model parameters */
|
|||
IOP( "capmod", BSIM3_MOD_CAPMOD, IF_INTEGER, "Capacitance model selector"),
|
||||
IOP( "mobmod", BSIM3_MOD_MOBMOD, IF_INTEGER, "Mobility model selector"),
|
||||
IOP( "noimod", BSIM3_MOD_NOIMOD, IF_INTEGER, "Noise model selector"),
|
||||
IOP( "nqsmod", BSIM3_MOD_NQSMOD, IF_INTEGER, "Non-quasi-static model selector"),
|
||||
IOP( "acnqsmod", BSIM3_MOD_ACNQSMOD, IF_INTEGER, "AC NQS model selector"),
|
||||
IOP( "acm", BSIM3_MOD_ACMMOD, IF_INTEGER, "Area calculation method selector"),
|
||||
IOP( "calcacm", BSIM3_MOD_CALCACM, IF_INTEGER, "Area calculation method ACM=12"),
|
||||
IOP( "paramchk", BSIM3_MOD_PARAMCHK, IF_INTEGER, "Model parameter checking selector"),
|
||||
IOP( "binunit", BSIM3_MOD_BINUNIT, IF_INTEGER, "Bin unit selector"),
|
||||
IOP( "version", BSIM3_MOD_VERSION, IF_STRING, " parameter for model version"),
|
||||
|
|
@ -180,6 +186,10 @@ IOP( "lwl", BSIM3_MOD_LWL, IF_REAL, "Length reduction parameter"),
|
|||
IOP( "lwlc", BSIM3_MOD_LWLC, IF_REAL, "Length reduction parameter for CV"),
|
||||
IOP( "lmin", BSIM3_MOD_LMIN, IF_REAL, "Minimum length for the model"),
|
||||
IOP( "lmax", BSIM3_MOD_LMAX, IF_REAL, "Maximum length for the model"),
|
||||
|
||||
IOP( "xl", BSIM3_MOD_XL, IF_REAL, "Length correction parameter"),
|
||||
IOP( "xw", BSIM3_MOD_XW, IF_REAL, "Width correction parameter"),
|
||||
|
||||
IOP( "wr", BSIM3_MOD_WR, IF_REAL, "Width dependence of rds"),
|
||||
IOP( "wint", BSIM3_MOD_WINT, IF_REAL, "Width reduction parameter"),
|
||||
IOP( "dwg", BSIM3_MOD_DWG, IF_REAL, "Width reduction parameter"),
|
||||
|
|
@ -208,6 +218,15 @@ IOP( "cle", BSIM3_MOD_CLE, IF_REAL, "Vdsat parameter for C-V model"),
|
|||
IOP( "dwc", BSIM3_MOD_DWC, IF_REAL, "Delta W for C-V model"),
|
||||
IOP( "dlc", BSIM3_MOD_DLC, IF_REAL, "Delta L for C-V model"),
|
||||
|
||||
IOP( "hdif", BSIM3_MOD_HDIF, IF_REAL, "ACM Parameter: Distance Gate - contact"),
|
||||
IOP( "ldif", BSIM3_MOD_LDIF, IF_REAL, "ACM Parameter: Length of LDD Gate-Source/Drain"),
|
||||
IOP( "ld", BSIM3_MOD_LD, IF_REAL, "ACM Parameter: Length of LDD under Gate"),
|
||||
IOP( "rd", BSIM3_MOD_RD, IF_REAL, "ACM Parameter: Resistance of LDD drain side"),
|
||||
IOP( "rs", BSIM3_MOD_RS, IF_REAL, "ACM Parameter: Resistance of LDD source side"),
|
||||
IOP( "rdc", BSIM3_MOD_RDC, IF_REAL, "ACM Parameter: Resistance contact drain side"),
|
||||
IOP( "rsc", BSIM3_MOD_RSC, IF_REAL, "ACM Parameter: Resistance contact source side"),
|
||||
IOP( "wmlt", BSIM3_MOD_WMLT, IF_REAL, "ACM Parameter: Width shrink factor"),
|
||||
|
||||
IOP( "alpha0", BSIM3_MOD_ALPHA0, IF_REAL, "substrate current model parameter"),
|
||||
IOP( "alpha1", BSIM3_MOD_ALPHA1, IF_REAL, "substrate current model parameter"),
|
||||
IOP( "beta0", BSIM3_MOD_BETA0, IF_REAL, "substrate current model parameter"),
|
||||
|
|
|
|||
|
|
@ -65,6 +65,15 @@ BSIM3instance *here = (BSIM3instance*)inst;
|
|||
case BSIM3_ACNQSMOD:
|
||||
value->iValue = here->BSIM3acnqsMod;
|
||||
return(OK);
|
||||
case BSIM3_GEO:
|
||||
value->iValue = here->BSIM3geo;
|
||||
return(OK);
|
||||
case BSIM3_DELVTO:
|
||||
value->rValue = here->BSIM3delvto;
|
||||
return(OK);
|
||||
case BSIM3_MULU0:
|
||||
value->rValue = here->BSIM3mulu0;
|
||||
return(OK);
|
||||
case BSIM3_IC_VBS:
|
||||
value->rValue = here->BSIM3icVBS;
|
||||
return(OK);
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ FILE *fplog;
|
|||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
if ((fplog = fopen("b3v3check.log", "w")) != NULL)
|
||||
if ((fplog = fopen("b3v33check.log", "w")) != NULL)
|
||||
{ pParam = here->pParam;
|
||||
fprintf(fplog, "BSIM3v3.3.0 Parameter Checking.\n");
|
||||
if ((strcmp(model->BSIM3version, "3.3.0")) && (strcmp(model->BSIM3version, "3.30")) && (strcmp(model->BSIM3version, "3.3")))
|
||||
if ((strncmp(model->BSIM3version, "3.3.0", 5)) && (strncmp(model->BSIM3version, "3.30", 4)) && (strncmp(model->BSIM3version, "3.3", 3)))
|
||||
{ fprintf(fplog, "Warning: This model is BSIM3v3.3.0; you specified a wrong version number.\n");
|
||||
printf("Warning: This model is BSIM3v3.3.0; you specified a wrong version number.\n");
|
||||
}
|
||||
|
|
@ -175,6 +175,8 @@ FILE *fplog;
|
|||
printf("Warning: Pscbe2 = %g is not positive.\n", pParam->BSIM3pscbe2);
|
||||
}
|
||||
|
||||
/* ACM model */
|
||||
if (model->BSIM3acmMod == 0) {
|
||||
if (model->BSIM3unitLengthSidewallJctCap > 0.0 ||
|
||||
model->BSIM3unitLengthGateSidewallJctCap > 0.0)
|
||||
{
|
||||
|
|
@ -191,6 +193,13 @@ FILE *fplog;
|
|||
here->BSIM3sourcePerimeter);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((model->BSIM3calcacm > 0) && (model->BSIM3acmMod != 12))
|
||||
{ fprintf(fplog, "Warning: CALCACM = %d is wrong. Set back to 0.\n",
|
||||
model->BSIM3calcacm);
|
||||
printf("Warning: CALCACM = %d is wrong. Set back to 0.\n", model->BSIM3calcacm);
|
||||
model->BSIM3calcacm = 0;
|
||||
}
|
||||
|
||||
if (pParam->BSIM3noff < 0.1)
|
||||
{ fprintf(fplog, "Warning: Noff = %g is too small.\n",
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@ BSIM3instance *here;
|
|||
#endif
|
||||
double SourceSatCurrent, DrainSatCurrent;
|
||||
double ag0, qgd, qgs, qgb, von, cbhat, VgstNVt, ExpVgst;
|
||||
double cdrain, cdhat, cdreq, ceqbd, ceqbs, ceqqb, ceqqd, ceqqg, ceq, geq;
|
||||
double cdrain, cdhat, cdreq, cdreq_fvk, ceqbd, ceqbd_fvk, ceqbs, ceqbs_fvk, ceqqb, ceqqd, ceqqg, ceq, geq;
|
||||
double ceqqb_fvk, ceqqb_SnodePrime_fvk, ceqqd_fvk, ceqqd_SnodePrime_fvk, ceqqg_fvk, ceqqg_SnodePrime_fvk ;
|
||||
double czbd, czbdsw, czbdswg, czbs, czbssw, czbsswg, evbd, evbs, arg, sarg;
|
||||
double delvbd, delvbs, delvds, delvgd, delvgs;
|
||||
double Vfbeff, dVfbeff_dVg, dVfbeff_dVb, V3, V4;
|
||||
|
|
@ -153,7 +154,7 @@ double Leff, Weff, dWeff_dVg, dWeff_dVb;
|
|||
double AbulkCV, dAbulkCV_dVb;
|
||||
double qgdo, qgso, cgdo, cgso;
|
||||
|
||||
double qcheq=0.0, qdef, gqdef=0.0, cqdef, cqcheq, gtau_diff, gtau_drift;
|
||||
double qcheq=0.0, qdef, gqdef=0.0, cqdef, cqdef_fvk, cqcheq, cqcheq_fvk, gtau_diff, gtau_drift;
|
||||
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;
|
||||
|
|
@ -212,7 +213,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
((ckt->CKTmode & (MODETRAN | MODEAC|MODEDCOP |
|
||||
MODEDCTRANCURVE)) || (!(ckt->CKTmode & MODEUIC))))
|
||||
{ vbs = 0.0;
|
||||
vgs = model->BSIM3type * pParam->BSIM3vth0 + 0.1;
|
||||
vgs = model->BSIM3type * here->BSIM3vth0 + 0.1;
|
||||
vds = 0.1;
|
||||
}
|
||||
}
|
||||
|
|
@ -378,6 +379,9 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
|
||||
/* Source/drain junction diode DC model begins */
|
||||
Nvtm = model->BSIM3vtm * model->BSIM3jctEmissionCoeff;
|
||||
/* acm model */
|
||||
if (model->BSIM3acmMod == 0)
|
||||
{
|
||||
if ((here->BSIM3sourceArea <= 0.0) && (here->BSIM3sourcePerimeter <= 0.0))
|
||||
{ SourceSatCurrent = 1.0e-14;
|
||||
}
|
||||
|
|
@ -387,6 +391,43 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
+ here->BSIM3sourcePerimeter
|
||||
* model->BSIM3jctSidewallTempSatCurDensity;
|
||||
}
|
||||
if ((here->BSIM3drainArea <= 0.0) && (here->BSIM3drainPerimeter <= 0.0))
|
||||
{ DrainSatCurrent = 1.0e-14;
|
||||
}
|
||||
else
|
||||
{ DrainSatCurrent = here->BSIM3drainArea
|
||||
* model->BSIM3jctTempSatCurDensity
|
||||
+ here->BSIM3drainPerimeter
|
||||
* model->BSIM3jctSidewallTempSatCurDensity;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error = ACM_saturationCurrents(
|
||||
model->BSIM3acmMod,
|
||||
model->BSIM3calcacm,
|
||||
here->BSIM3geo,
|
||||
model->BSIM3hdif,
|
||||
model->BSIM3wmlt,
|
||||
here->BSIM3w,
|
||||
model->BSIM3xw,
|
||||
model->BSIM3jctTempSatCurDensity,
|
||||
model->BSIM3jctSidewallTempSatCurDensity,
|
||||
here->BSIM3drainAreaGiven,
|
||||
here->BSIM3drainArea,
|
||||
here->BSIM3drainPerimeterGiven,
|
||||
here->BSIM3drainPerimeter,
|
||||
here->BSIM3sourceAreaGiven,
|
||||
here->BSIM3sourceArea,
|
||||
here->BSIM3sourcePerimeterGiven,
|
||||
here->BSIM3sourcePerimeter,
|
||||
&DrainSatCurrent,
|
||||
&SourceSatCurrent
|
||||
);
|
||||
if (error)
|
||||
return(error);
|
||||
}
|
||||
|
||||
if (SourceSatCurrent <= 0.0)
|
||||
{ here->BSIM3gbs = ckt->CKTgmin;
|
||||
here->BSIM3cbs = here->BSIM3gbs * vbs;
|
||||
|
|
@ -415,15 +456,6 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
}
|
||||
}
|
||||
|
||||
if ((here->BSIM3drainArea <= 0.0) && (here->BSIM3drainPerimeter <= 0.0))
|
||||
{ DrainSatCurrent = 1.0e-14;
|
||||
}
|
||||
else
|
||||
{ DrainSatCurrent = here->BSIM3drainArea
|
||||
* model->BSIM3jctTempSatCurDensity
|
||||
+ here->BSIM3drainPerimeter
|
||||
* model->BSIM3jctSidewallTempSatCurDensity;
|
||||
}
|
||||
if (DrainSatCurrent <= 0.0)
|
||||
{ here->BSIM3gbd = ckt->CKTgmin;
|
||||
here->BSIM3cbd = here->BSIM3gbd * vbd;
|
||||
|
|
@ -579,7 +611,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
dDIBL_Sft_dVd = T3 * pParam->BSIM3theta0vb0;
|
||||
DIBL_Sft = dDIBL_Sft_dVd * Vds;
|
||||
|
||||
Vth = model->BSIM3type * pParam->BSIM3vth0 - pParam->BSIM3k1
|
||||
Vth = model->BSIM3type * here->BSIM3vth0 - pParam->BSIM3k1
|
||||
* pParam->BSIM3sqrtPhi + pParam->BSIM3k1ox * sqrtPhis
|
||||
- pParam->BSIM3k2ox * Vbseff - Delt_vth - T2 + (pParam->BSIM3k3
|
||||
+ pParam->BSIM3k3b * Vbseff) * tmp2 + T1 - DIBL_Sft;
|
||||
|
|
@ -614,7 +646,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
}
|
||||
|
||||
/* Poly Gate Si Depletion Effect */
|
||||
T0 = pParam->BSIM3vfb + pParam->BSIM3phi;
|
||||
T0 = here->BSIM3vfb + pParam->BSIM3phi;
|
||||
if ((pParam->BSIM3ngate > 1.e18) && (pParam->BSIM3ngate < 1.e25)
|
||||
&& (Vgs > T0))
|
||||
/* added to avoid the problem caused by ngate */
|
||||
|
|
@ -816,7 +848,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
dDenomi_dVb *= T9;
|
||||
}
|
||||
|
||||
here->BSIM3ueff = ueff = pParam->BSIM3u0temp / Denomi;
|
||||
here->BSIM3ueff = ueff = here->BSIM3u0temp / Denomi;
|
||||
T9 = -ueff / Denomi;
|
||||
dueff_dVg = T9 * dDenomi_dVg;
|
||||
dueff_dVd = T9 * dDenomi_dVd;
|
||||
|
|
@ -1599,7 +1631,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
} /* End of VgsteffCV */
|
||||
|
||||
if (model->BSIM3capMod == 1)
|
||||
{ Vfb = pParam->BSIM3vfbzb;
|
||||
{ Vfb = here->BSIM3vfbzb;
|
||||
Arg1 = Vgs_eff - VbseffCV - Vfb - Vgsteff;
|
||||
|
||||
if (Arg1 <= 0.0)
|
||||
|
|
@ -1761,7 +1793,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
}
|
||||
|
||||
else if (model->BSIM3capMod == 2)
|
||||
{ Vfb = pParam->BSIM3vfbzb;
|
||||
{ Vfb = here->BSIM3vfbzb;
|
||||
V3 = Vfb - Vgs_eff + VbseffCV - DELTA_3;
|
||||
if (Vfb <= 0.0)
|
||||
{ T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * Vfb);
|
||||
|
|
@ -1925,24 +1957,24 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
|
||||
/* New Charge-Thickness capMod (CTM) begins */
|
||||
else if (model->BSIM3capMod == 3)
|
||||
{ V3 = pParam->BSIM3vfbzb - Vgs_eff + VbseffCV - DELTA_3;
|
||||
if (pParam->BSIM3vfbzb <= 0.0)
|
||||
{ T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * pParam->BSIM3vfbzb);
|
||||
{ V3 = here->BSIM3vfbzb - Vgs_eff + VbseffCV - DELTA_3;
|
||||
if (here->BSIM3vfbzb <= 0.0)
|
||||
{ T0 = sqrt(V3 * V3 - 4.0 * DELTA_3 * here->BSIM3vfbzb);
|
||||
T2 = -DELTA_3 / T0;
|
||||
}
|
||||
else
|
||||
{ T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * pParam->BSIM3vfbzb);
|
||||
{ T0 = sqrt(V3 * V3 + 4.0 * DELTA_3 * here->BSIM3vfbzb);
|
||||
T2 = DELTA_3 / T0;
|
||||
}
|
||||
|
||||
T1 = 0.5 * (1.0 + V3 / T0);
|
||||
Vfbeff = pParam->BSIM3vfbzb - 0.5 * (V3 + T0);
|
||||
Vfbeff = here->BSIM3vfbzb - 0.5 * (V3 + T0);
|
||||
dVfbeff_dVg = T1 * dVgs_eff_dVg;
|
||||
dVfbeff_dVb = -T1 * dVbseffCV_dVb;
|
||||
|
||||
Cox = model->BSIM3cox;
|
||||
Tox = 1.0e8 * model->BSIM3tox;
|
||||
T0 = (Vgs_eff - VbseffCV - pParam->BSIM3vfbzb) / Tox;
|
||||
T0 = (Vgs_eff - VbseffCV - here->BSIM3vfbzb) / Tox;
|
||||
dT0_dVg = dVgs_eff_dVg / Tox;
|
||||
dT0_dVb = -dVbseffCV_dVb / Tox;
|
||||
|
||||
|
|
@ -1979,7 +2011,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
dCoxeff_dVg *= dTcen_dVg;
|
||||
CoxWLcen = CoxWL * Coxeff / Cox;
|
||||
|
||||
Qac0 = CoxWLcen * (Vfbeff - pParam->BSIM3vfbzb);
|
||||
Qac0 = CoxWLcen * (Vfbeff - here->BSIM3vfbzb);
|
||||
QovCox = Qac0 / Coxeff;
|
||||
dQac0_dVg = CoxWLcen * dVfbeff_dVg
|
||||
+ QovCox * dCoxeff_dVg;
|
||||
|
|
@ -2032,7 +2064,7 @@ for (; model != NULL; model = model->BSIM3nextModel)
|
|||
VgDP = 0.5 * (T0 + T1);
|
||||
dVgDP_dVg = 0.5 * (dT0_dVg + (T0 * dT0_dVg + 0.002) / T1);
|
||||
|
||||
T3 = 4.0 * (Vth - pParam->BSIM3vfbzb - pParam->BSIM3phi);
|
||||
T3 = 4.0 * (Vth - here->BSIM3vfbzb - pParam->BSIM3phi);
|
||||
Tox += Tox;
|
||||
if (T3 >= 0.0)
|
||||
{ T0 = (Vgsteff + T3) / Tox;
|
||||
|
|
@ -2237,6 +2269,8 @@ finished:
|
|||
along gate side
|
||||
*/
|
||||
|
||||
if (model->BSIM3acmMod == 0)
|
||||
{
|
||||
czbd = model->BSIM3unitAreaTempJctCap * here->BSIM3drainArea; /*bug fix */
|
||||
czbs = model->BSIM3unitAreaTempJctCap * here->BSIM3sourceArea;
|
||||
if (here->BSIM3drainPerimeter < pParam->BSIM3weff)
|
||||
|
|
@ -2265,6 +2299,36 @@ finished:
|
|||
czbsswg = model->BSIM3unitLengthGateSidewallTempJctCap
|
||||
* pParam->BSIM3weff;
|
||||
}
|
||||
} else {
|
||||
error = ACM_junctionCapacitances(
|
||||
model->BSIM3acmMod,
|
||||
model->BSIM3calcacm,
|
||||
here->BSIM3geo,
|
||||
model->BSIM3hdif,
|
||||
model->BSIM3wmlt,
|
||||
here->BSIM3w,
|
||||
model->BSIM3xw,
|
||||
here->BSIM3drainAreaGiven,
|
||||
here->BSIM3drainArea,
|
||||
here->BSIM3drainPerimeterGiven,
|
||||
here->BSIM3drainPerimeter,
|
||||
here->BSIM3sourceAreaGiven,
|
||||
here->BSIM3sourceArea,
|
||||
here->BSIM3sourcePerimeterGiven,
|
||||
here->BSIM3sourcePerimeter,
|
||||
model->BSIM3unitAreaTempJctCap,
|
||||
model->BSIM3unitLengthSidewallTempJctCap,
|
||||
model->BSIM3unitLengthGateSidewallJctCap,
|
||||
&czbd,
|
||||
&czbdsw,
|
||||
&czbdswg,
|
||||
&czbs,
|
||||
&czbssw,
|
||||
&czbsswg
|
||||
);
|
||||
if (error)
|
||||
return(error);
|
||||
}
|
||||
|
||||
MJ = model->BSIM3bulkJctBotGradingCoeff;
|
||||
MJSW = model->BSIM3bulkJctSideGradingCoeff;
|
||||
|
|
@ -2424,9 +2488,9 @@ line755:
|
|||
here->BSIM3cqbb = -(here->BSIM3cqgb + here->BSIM3cqdb
|
||||
+ here->BSIM3cqsb);
|
||||
|
||||
gtau_drift = fabs(pParam->BSIM3tconst * qcheq) * ScalingFactor;
|
||||
gtau_drift = fabs(here->BSIM3tconst * qcheq) * ScalingFactor;
|
||||
T0 = pParam->BSIM3leffCV * pParam->BSIM3leffCV;
|
||||
gtau_diff = 16.0 * pParam->BSIM3u0temp * model->BSIM3vtm / T0
|
||||
gtau_diff = 16.0 * here->BSIM3u0temp * model->BSIM3vtm / T0
|
||||
* ScalingFactor;
|
||||
here->BSIM3gtau = gtau_drift + gtau_diff;
|
||||
if (here->BSIM3acnqsMod)
|
||||
|
|
@ -2535,9 +2599,9 @@ line755:
|
|||
}
|
||||
else
|
||||
{ if (qcheq > 0.0)
|
||||
T0 = pParam->BSIM3tconst * qdef * ScalingFactor;
|
||||
T0 = here->BSIM3tconst * qdef * ScalingFactor;
|
||||
else
|
||||
T0 = -pParam->BSIM3tconst * qdef * ScalingFactor;
|
||||
T0 = -here->BSIM3tconst * qdef * ScalingFactor;
|
||||
ggtg = here->BSIM3gtg = T0 * here->BSIM3cqgb;
|
||||
ggtd = here->BSIM3gtd = T0 * here->BSIM3cqdb;
|
||||
ggts = here->BSIM3gts = T0 * here->BSIM3cqsb;
|
||||
|
|
@ -2651,9 +2715,9 @@ line755:
|
|||
}
|
||||
else
|
||||
{ if (qcheq > 0.0)
|
||||
T0 = pParam->BSIM3tconst * qdef * ScalingFactor;
|
||||
T0 = here->BSIM3tconst * qdef * ScalingFactor;
|
||||
else
|
||||
T0 = -pParam->BSIM3tconst * qdef * ScalingFactor;
|
||||
T0 = -here->BSIM3tconst * qdef * ScalingFactor;
|
||||
ggtg = here->BSIM3gtg = T0 * here->BSIM3cqgb;
|
||||
ggts = here->BSIM3gtd = T0 * here->BSIM3cqdb;
|
||||
ggtd = here->BSIM3gts = T0 * here->BSIM3cqsb;
|
||||
|
|
@ -2730,7 +2794,8 @@ line755:
|
|||
}
|
||||
}
|
||||
|
||||
cqdef = cqcheq = 0.0;
|
||||
cqdef = cqdef_fvk = cqcheq = cqcheq_fvk = 0.0;
|
||||
|
||||
if (ByPass) goto line860;
|
||||
|
||||
*(ckt->CKTstate0 + here->BSIM3qg) = qgate;
|
||||
|
|
@ -2789,8 +2854,8 @@ line755:
|
|||
|
||||
line850:
|
||||
/* initialize to zero charge conductance and current */
|
||||
ceqqg = ceqqb = ceqqd = 0.0;
|
||||
cqcheq = cqdef = 0.0;
|
||||
ceqqg = ceqqg_fvk = ceqqg_SnodePrime_fvk = ceqqb = ceqqb_fvk = ceqqb_SnodePrime_fvk = ceqqd = ceqqd_fvk = ceqqd_SnodePrime_fvk = 0.0;
|
||||
cqcheq = cqcheq_fvk = cqdef = cqdef_fvk = 0.0;
|
||||
|
||||
gcdgb = gcddb = gcdsb = 0.0;
|
||||
gcsgb = gcsdb = gcssb = 0.0;
|
||||
|
|
@ -2804,7 +2869,7 @@ line850:
|
|||
dsxpart_dVd = dsxpart_dVg = dsxpart_dVb = dsxpart_dVs = 0.0;
|
||||
|
||||
if (here->BSIM3nqsMod)
|
||||
here->BSIM3gtau = 16.0 * pParam->BSIM3u0temp * model->BSIM3vtm
|
||||
here->BSIM3gtau = 16.0 * here->BSIM3u0temp * model->BSIM3vtm
|
||||
/ pParam->BSIM3leffCV / pParam->BSIM3leffCV
|
||||
* ScalingFactor;
|
||||
else
|
||||
|
|
@ -2820,8 +2885,14 @@ line860:
|
|||
cqdrn = *(ckt->CKTstate0 + here->BSIM3cqd);
|
||||
|
||||
ceqqg = cqgate - gcggb * vgb + gcgdb * vbd + gcgsb * vbs;
|
||||
ceqqg_fvk = cqgate ;
|
||||
ceqqg_SnodePrime_fvk = ceqqg ;
|
||||
ceqqb = cqbulk - gcbgb * vgb + gcbdb * vbd + gcbsb * vbs;
|
||||
ceqqb_fvk = cqbulk ;
|
||||
ceqqb_SnodePrime_fvk = ceqqb ;
|
||||
ceqqd = cqdrn - gcdgb * vgb + gcddb * vbd + gcdsb * vbs;
|
||||
ceqqd_fvk = cqdrn ;
|
||||
ceqqd_SnodePrime_fvk = ceqqd ;
|
||||
|
||||
if (here->BSIM3nqsMod)
|
||||
{ T0 = ggtg * vgb - ggtd * vbd - ggts * vbs;
|
||||
|
|
@ -2830,8 +2901,10 @@ line860:
|
|||
ceqqd -= dxpart * T0 + T1 * (ddxpart_dVg * vgb - ddxpart_dVd
|
||||
* vbd - ddxpart_dVs * vbs);
|
||||
cqdef = *(ckt->CKTstate0 + here->BSIM3cqcdump) - gqdef * qdef;
|
||||
cqdef_fvk = *(ckt->CKTstate0 + here->BSIM3cqcdump) ;
|
||||
cqcheq = *(ckt->CKTstate0 + here->BSIM3cqcheq)
|
||||
- (gcqgb * vgb - gcqdb * vbd - gcqsb * vbs) + T0;
|
||||
cqcheq_fvk = *(ckt->CKTstate0 + here->BSIM3cqcheq) ;
|
||||
}
|
||||
|
||||
if (ckt->CKTmode & MODEINITTRAN)
|
||||
|
|
@ -2862,11 +2935,12 @@ line900:
|
|||
RevSum = 0.0;
|
||||
cdreq = model->BSIM3type * (cdrain - here->BSIM3gds * vds
|
||||
- Gm * vgs - Gmbs * vbs);
|
||||
|
||||
cdreq_fvk = model->BSIM3type * cdrain ;
|
||||
ceqbd = -model->BSIM3type * (here->BSIM3csub
|
||||
- here->BSIM3gbds * vds - here->BSIM3gbgs * vgs
|
||||
- here->BSIM3gbbs * vbs);
|
||||
ceqbs = 0.0;
|
||||
ceqbd_fvk = - (model->BSIM3type * here->BSIM3csub) ;
|
||||
ceqbs = ceqbs_fvk = 0.0;
|
||||
|
||||
gbbdp = -here->BSIM3gbds;
|
||||
gbbsp = (here->BSIM3gbds + here->BSIM3gbgs + here->BSIM3gbbs);
|
||||
|
|
@ -2888,11 +2962,12 @@ line900:
|
|||
RevSum = -(Gm + Gmbs);
|
||||
cdreq = -model->BSIM3type * (cdrain + here->BSIM3gds * vds
|
||||
+ Gm * vgd + Gmbs * vbd);
|
||||
|
||||
cdreq_fvk = - (model->BSIM3type * cdrain) ;
|
||||
ceqbs = -model->BSIM3type * (here->BSIM3csub
|
||||
+ here->BSIM3gbds * vds - here->BSIM3gbgs * vgd
|
||||
- here->BSIM3gbbs * vbd);
|
||||
ceqbd = 0.0;
|
||||
ceqbs_fvk = - (model->BSIM3type * here->BSIM3csub) ;
|
||||
ceqbd = ceqbd_fvk = 0.0;
|
||||
|
||||
gbbsp = -here->BSIM3gbds;
|
||||
gbbdp = (here->BSIM3gbds + here->BSIM3gbgs + here->BSIM3gbbs);
|
||||
|
|
@ -2910,7 +2985,9 @@ line900:
|
|||
|
||||
if (model->BSIM3type > 0)
|
||||
{ ceqbs += (here->BSIM3cbs - here->BSIM3gbs * vbs);
|
||||
ceqbs_fvk += here->BSIM3cbs ;
|
||||
ceqbd += (here->BSIM3cbd - here->BSIM3gbd * vbd);
|
||||
ceqbd_fvk += here->BSIM3cbd ;
|
||||
/*
|
||||
ceqqg = ceqqg;
|
||||
ceqqb = ceqqb;
|
||||
|
|
@ -2921,12 +2998,22 @@ line900:
|
|||
}
|
||||
else
|
||||
{ ceqbs -= (here->BSIM3cbs - here->BSIM3gbs * vbs);
|
||||
ceqbs_fvk -= here->BSIM3cbs ;
|
||||
ceqbd -= (here->BSIM3cbd - here->BSIM3gbd * vbd);
|
||||
ceqbd_fvk -= here->BSIM3cbd ;
|
||||
ceqqg = -ceqqg;
|
||||
ceqqg_fvk = - ceqqg_fvk ;
|
||||
ceqqg_SnodePrime_fvk = - ceqqg_SnodePrime_fvk ;
|
||||
ceqqb = -ceqqb;
|
||||
ceqqb_fvk = - ceqqb_fvk ;
|
||||
ceqqb_SnodePrime_fvk = - ceqqb_SnodePrime_fvk ;
|
||||
ceqqd = -ceqqd;
|
||||
ceqqd_fvk = - ceqqd_fvk ;
|
||||
ceqqd_SnodePrime_fvk = - ceqqd_SnodePrime_fvk ;
|
||||
cqdef = -cqdef;
|
||||
cqdef_fvk = - cqdef_fvk ;
|
||||
cqcheq = -cqcheq;
|
||||
cqcheq_fvk = - cqcheq_fvk ;
|
||||
}
|
||||
|
||||
m = here->BSIM3m;
|
||||
|
|
@ -3054,6 +3141,93 @@ line900:
|
|||
*(here->BSIM3QspPtr) += m * (ggts - gcqsb);
|
||||
*(here->BSIM3QbPtr) += m * (ggtb - gcqbb);
|
||||
}
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
*(ckt->CKTfvk + here->BSIM3gNode) += m * ceqqg ;
|
||||
*(ckt->CKTfvk + here->BSIM3bNode) += m * (ceqbs + ceqbd + ceqqb) ;
|
||||
*(ckt->CKTfvk + here->BSIM3dNodePrime) -= m * (ceqbd - cdreq - ceqqd) ;
|
||||
*(ckt->CKTfvk + here->BSIM3sNodePrime) -= m * (cdreq + ceqbs + ceqqg + ceqqb + ceqqd) ;
|
||||
|
||||
|
||||
*(ckt->CKTfvk+here->BSIM3dNode) += m * here->BSIM3drainConductance * *(ckt->CKTrhsOld+here->BSIM3dNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) += m * (gcggb - ggtg) * *(ckt->CKTrhsOld+here->BSIM3gNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNode) += m * here->BSIM3sourceConductance * *(ckt->CKTrhsOld+here->BSIM3sNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3bNode) += m * (here->BSIM3gbd + here->BSIM3gbs
|
||||
- gcbgb - gcbdb - gcbsb - here->BSIM3gbbs) * *(ckt->CKTrhsOld+here->BSIM3bNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) += m * (here->BSIM3drainConductance + here->BSIM3gds + here->BSIM3gbd + RevSum + gcddb
|
||||
+ dxpart * ggtd + T1 * ddxpart_dVd + gbdpdp) * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) += m * (here->BSIM3sourceConductance + here->BSIM3gds + here->BSIM3gbs + FwdSum + gcssb
|
||||
+ sxpart * ggts + T1 * dsxpart_dVs + gbspsp) * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNode) -= m * here->BSIM3drainConductance * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) -= m * (gcggb + gcgdb + gcgsb + ggtb) * *(ckt->CKTrhsOld+here->BSIM3bNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) += m * (gcgdb - ggtd) * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) += m * (gcgsb - ggts) * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNode) -= m * here->BSIM3sourceConductance * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3bNode) += m * (gcbgb - here->BSIM3gbgs) * *(ckt->CKTrhsOld+here->BSIM3gNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3bNode) += m * (gcbdb - here->BSIM3gbd + gbbdp) * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3bNode) += m * (gcbsb - here->BSIM3gbs + gbbsp) * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) -= m * here->BSIM3drainConductance * *(ckt->CKTrhsOld+here->BSIM3dNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) += m * (Gm + gcdgb + dxpart * ggtg + T1 * ddxpart_dVg + gbdpg) * *(ckt->CKTrhsOld+here->BSIM3gNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) -= m * (here->BSIM3gbd - Gmbs + gcdgb + gcddb + gcdsb - dxpart * ggtb
|
||||
- T1 * ddxpart_dVb - gbdpb) * *(ckt->CKTrhsOld+here->BSIM3bNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) -= m * (here->BSIM3gds + FwdSum - gcdsb - dxpart * ggts
|
||||
- T1 * ddxpart_dVs - gbdpsp) * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) += m * (gcsgb - Gm + sxpart * ggtg + T1 * dsxpart_dVg + gbspg) * *(ckt->CKTrhsOld+here->BSIM3gNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) -= m * here->BSIM3sourceConductance * *(ckt->CKTrhsOld+here->BSIM3sNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) -= m * (here->BSIM3gbs + Gmbs + gcsgb + gcsdb + gcssb - sxpart * ggtb
|
||||
- T1 * dsxpart_dVb - gbspb) * *(ckt->CKTrhsOld+here->BSIM3bNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) -= m * (here->BSIM3gds + RevSum - gcsdb - sxpart * ggtd
|
||||
- T1 * dsxpart_dVd - gbspdp) * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*/
|
||||
|
||||
|
||||
/* KCL verification - Dynamic Part */
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) += m * ceqqg_fvk ;
|
||||
*(ckt->CKTfvk+here->BSIM3bNode) += m * (ceqbs_fvk + ceqbd_fvk + ceqqb_fvk) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) -= m * (ceqbd_fvk - cdreq_fvk - ceqqd_fvk) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) -= m * (cdreq_fvk + ceqbs_fvk + ceqqg_SnodePrime_fvk + ceqqb_SnodePrime_fvk + ceqqd_SnodePrime_fvk) ;
|
||||
if (here->BSIM3nqsMod)
|
||||
*(ckt->CKTfvk+here->BSIM3qNode) -= m * (cqcheq_fvk - cqdef_fvk) ;
|
||||
|
||||
|
||||
/* KCL verification - Linear and Static Part */
|
||||
*(ckt->CKTfvk+here->BSIM3dNode) += m * here->BSIM3drainConductance * *(ckt->CKTrhsOld+here->BSIM3dNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNode) += m * here->BSIM3sourceConductance * *(ckt->CKTrhsOld+here->BSIM3sNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) += m * here->BSIM3drainConductance * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) += m * here->BSIM3sourceConductance * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNode) -= m * here->BSIM3drainConductance * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNode) -= m * here->BSIM3sourceConductance * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) -= m * here->BSIM3drainConductance * *(ckt->CKTrhsOld+here->BSIM3dNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) -= m * here->BSIM3sourceConductance * *(ckt->CKTrhsOld+here->BSIM3sNode) ;
|
||||
|
||||
if (here->BSIM3nqsMod) //DA RIVEDERE
|
||||
{
|
||||
*(here->BSIM3QqPtr) += m * (gqdef + here->BSIM3gtau);
|
||||
*(here->BSIM3DPqPtr) += m * (dxpart * here->BSIM3gtau);
|
||||
*(here->BSIM3SPqPtr) += m * (sxpart * here->BSIM3gtau);
|
||||
*(here->BSIM3GqPtr) -= m * here->BSIM3gtau;
|
||||
}
|
||||
|
||||
|
||||
/* KCL verification - Linear and Dynamic Part ??? */
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) -= m * ggtg * *(ckt->CKTrhsOld+here->BSIM3gNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) -= m * ggtb * *(ckt->CKTrhsOld+here->BSIM3bNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) -= m * ggtd * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3gNode) -= m * ggts * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) += m * (dxpart * ggtd + T1 * ddxpart_dVd) * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) += m * (dxpart * ggtg + T1 * ddxpart_dVg) * *(ckt->CKTrhsOld+here->BSIM3gNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) -= m * (- dxpart * ggtb - T1 * ddxpart_dVb) * *(ckt->CKTrhsOld+here->BSIM3bNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3dNodePrime) -= m * (- dxpart * ggts - T1 * ddxpart_dVs) * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) += m * (gcssb + sxpart * ggts + T1 * dsxpart_dVs) * *(ckt->CKTrhsOld+here->BSIM3sNodePrime) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) += m * (gcsgb + sxpart * ggtg + T1 * dsxpart_dVg) * *(ckt->CKTrhsOld+here->BSIM3gNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) -= m * (gcsgb + gcsdb + gcssb - sxpart * ggtb - T1 * dsxpart_dVb) * *(ckt->CKTrhsOld+here->BSIM3bNode) ;
|
||||
*(ckt->CKTfvk+here->BSIM3sNodePrime) -= m * (- gcsdb - sxpart * ggtd - T1 * dsxpart_dVd) * *(ckt->CKTrhsOld+here->BSIM3dNodePrime) ;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
line1000: ;
|
||||
#ifndef USE_OMP
|
||||
|
|
|
|||
|
|
@ -43,9 +43,18 @@ IFvalue *value)
|
|||
case BSIM3_MOD_NOIMOD:
|
||||
value->iValue = model->BSIM3noiMod;
|
||||
return(OK);
|
||||
case BSIM3_MOD_NQSMOD:
|
||||
value->iValue = model->BSIM3nqsMod;
|
||||
return(OK);
|
||||
case BSIM3_MOD_ACNQSMOD:
|
||||
value->iValue = model->BSIM3acnqsMod;
|
||||
return(OK);
|
||||
case BSIM3_MOD_ACMMOD:
|
||||
value->iValue = model->BSIM3acmMod;
|
||||
return(OK);
|
||||
case BSIM3_MOD_CALCACM:
|
||||
value->iValue = model->BSIM3calcacm;
|
||||
return(OK);
|
||||
case BSIM3_MOD_VERSION :
|
||||
value->sValue = model->BSIM3version;
|
||||
return(OK);
|
||||
|
|
@ -337,6 +346,32 @@ IFvalue *value)
|
|||
value->rValue = model->BSIM3tpbswg;
|
||||
return(OK);
|
||||
|
||||
/* ACM model */
|
||||
case BSIM3_MOD_HDIF:
|
||||
value->rValue = model->BSIM3hdif;
|
||||
return(OK);
|
||||
case BSIM3_MOD_LDIF:
|
||||
value->rValue = model->BSIM3ldif;
|
||||
return(OK);
|
||||
case BSIM3_MOD_LD:
|
||||
value->rValue = model->BSIM3ld;
|
||||
return(OK);
|
||||
case BSIM3_MOD_RD:
|
||||
value->rValue = model->BSIM3rd;
|
||||
return(OK);
|
||||
case BSIM3_MOD_RS:
|
||||
value->rValue = model->BSIM3rs;
|
||||
return(OK);
|
||||
case BSIM3_MOD_RDC:
|
||||
value->rValue = model->BSIM3rdc;
|
||||
return(OK);
|
||||
case BSIM3_MOD_RSC:
|
||||
value->rValue = model->BSIM3rsc;
|
||||
return(OK);
|
||||
case BSIM3_MOD_WMLT:
|
||||
value->rValue = model->BSIM3wmlt;
|
||||
return(OK);
|
||||
|
||||
/* Length dependence */
|
||||
case BSIM3_MOD_LCDSC :
|
||||
value->rValue = model->BSIM3lcdsc;
|
||||
|
|
@ -1219,6 +1254,14 @@ IFvalue *value)
|
|||
case BSIM3_MOD_WMAX:
|
||||
value->rValue = model->BSIM3Wmax;
|
||||
return(OK);
|
||||
|
||||
case BSIM3_MOD_XL:
|
||||
value->rValue = model->BSIM3xl;
|
||||
return(OK);
|
||||
case BSIM3_MOD_XW:
|
||||
value->rValue = model->BSIM3xw;
|
||||
return(OK);
|
||||
|
||||
case BSIM3_MOD_NOIA:
|
||||
value->rValue = model->BSIM3oxideTrapDensityA;
|
||||
return(OK);
|
||||
|
|
|
|||
|
|
@ -39,10 +39,22 @@ GENmodel *inMod)
|
|||
mod->BSIM3capMod = value->iValue;
|
||||
mod->BSIM3capModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_ACMMOD:
|
||||
mod->BSIM3acmMod = value->iValue;
|
||||
mod->BSIM3acmModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_CALCACM:
|
||||
mod->BSIM3calcacm = value->iValue;
|
||||
mod->BSIM3calcacmGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_NOIMOD :
|
||||
mod->BSIM3noiMod = value->iValue;
|
||||
mod->BSIM3noiModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_NQSMOD :
|
||||
mod->BSIM3nqsMod = value->iValue;
|
||||
mod->BSIM3nqsModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_ACNQSMOD :
|
||||
mod->BSIM3acnqsMod = value->iValue;
|
||||
mod->BSIM3acnqsModGiven = TRUE;
|
||||
|
|
@ -438,6 +450,40 @@ GENmodel *inMod)
|
|||
mod->BSIM3tpbswgGiven = TRUE;
|
||||
break;
|
||||
|
||||
/* acm model */
|
||||
case BSIM3_MOD_HDIF:
|
||||
mod->BSIM3hdif = value->rValue;
|
||||
mod->BSIM3hdifGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_LDIF:
|
||||
mod->BSIM3ldif = value->rValue;
|
||||
mod->BSIM3ldifGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_LD:
|
||||
mod->BSIM3ld = value->rValue;
|
||||
mod->BSIM3ldGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_RD:
|
||||
mod->BSIM3rd = value->rValue;
|
||||
mod->BSIM3rdGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_RS:
|
||||
mod->BSIM3rs = value->rValue;
|
||||
mod->BSIM3rsGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_RDC:
|
||||
mod->BSIM3rdc = value->rValue;
|
||||
mod->BSIM3rdcGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_RSC:
|
||||
mod->BSIM3rsc = value->rValue;
|
||||
mod->BSIM3rscGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_WMLT:
|
||||
mod->BSIM3wmlt = value->rValue;
|
||||
mod->BSIM3wmltGiven = TRUE;
|
||||
break;
|
||||
|
||||
/* Length dependence */
|
||||
case BSIM3_MOD_LCDSC :
|
||||
mod->BSIM3lcdsc = value->rValue;
|
||||
|
|
@ -1636,6 +1682,15 @@ GENmodel *inMod)
|
|||
mod->BSIM3WmaxGiven = TRUE;
|
||||
break;
|
||||
|
||||
case BSIM3_MOD_XL:
|
||||
mod->BSIM3xl = value->rValue;
|
||||
mod->BSIM3xlGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MOD_XW:
|
||||
mod->BSIM3xw = value->rValue;
|
||||
mod->BSIM3xwGiven = TRUE;
|
||||
break;
|
||||
|
||||
case BSIM3_MOD_NOIA :
|
||||
mod->BSIM3oxideTrapDensityA = value->rValue;
|
||||
mod->BSIM3oxideTrapDensityAGiven = TRUE;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim3def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
BSIM3nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3model *model = (BSIM3model *)inModel ;
|
||||
BSIM3instance *here ;
|
||||
|
||||
/* loop through all the BSIM3 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3instances ; here != NULL ; here = here->BSIM3nextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->BSIM3dNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3sNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3qNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -91,6 +91,18 @@ IFvalue *select)
|
|||
here->BSIM3acnqsMod = value->iValue;
|
||||
here->BSIM3acnqsModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_GEO:
|
||||
here->BSIM3geo = value->iValue;
|
||||
here->BSIM3geoGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_DELVTO:
|
||||
here->BSIM3delvto = value->rValue;
|
||||
here->BSIM3delvtoGiven = TRUE;
|
||||
break;
|
||||
case BSIM3_MULU0:
|
||||
here->BSIM3mulu0 = value->rValue;
|
||||
here->BSIM3mulu0Given = TRUE;
|
||||
break;
|
||||
case BSIM3_IC:
|
||||
switch(value->v.numValue){
|
||||
case 3:
|
||||
|
|
|
|||
|
|
@ -61,8 +61,18 @@ BSIM3instance **InstArray;
|
|||
model->BSIM3paramChk = 0;
|
||||
if (!model->BSIM3capModGiven)
|
||||
model->BSIM3capMod = 3;
|
||||
if (!model->BSIM3acmModGiven)
|
||||
model->BSIM3acmMod = 0;
|
||||
if (!model->BSIM3calcacmGiven)
|
||||
model->BSIM3calcacm = 0;
|
||||
if (!model->BSIM3noiModGiven)
|
||||
model->BSIM3noiMod = 1;
|
||||
if (!model->BSIM3nqsModGiven)
|
||||
model->BSIM3nqsMod = 0;
|
||||
else if ((model->BSIM3nqsMod != 0) && (model->BSIM3nqsMod != 1))
|
||||
{ model->BSIM3nqsMod = 0;
|
||||
printf("Warning: nqsMod has been set to its default value: 0.\n");
|
||||
}
|
||||
if (!model->BSIM3acnqsModGiven)
|
||||
model->BSIM3acnqsMod = 0;
|
||||
else if ((model->BSIM3acnqsMod != 0) && (model->BSIM3acnqsMod != 1))
|
||||
|
|
@ -247,6 +257,24 @@ BSIM3instance **InstArray;
|
|||
if (!model->BSIM3tpbswgGiven)
|
||||
model->BSIM3tpbswg = 0.0;
|
||||
|
||||
/* ACM model */
|
||||
if (!model->BSIM3hdifGiven)
|
||||
model->BSIM3hdif = 0.0;
|
||||
if (!model->BSIM3ldifGiven)
|
||||
model->BSIM3ldif = 0.0;
|
||||
if (!model->BSIM3ldGiven)
|
||||
model->BSIM3ld = 0.0;
|
||||
if (!model->BSIM3rdGiven)
|
||||
model->BSIM3rd = 0.0;
|
||||
if (!model->BSIM3rsGiven)
|
||||
model->BSIM3rs = 0.0;
|
||||
if (!model->BSIM3rdcGiven)
|
||||
model->BSIM3rdc = 0.0;
|
||||
if (!model->BSIM3rscGiven)
|
||||
model->BSIM3rsc = 0.0;
|
||||
if (!model->BSIM3wmltGiven)
|
||||
model->BSIM3wmlt = 1.0;
|
||||
|
||||
/* Length dependence */
|
||||
if (!model->BSIM3lcdscGiven)
|
||||
model->BSIM3lcdsc = 0.0;
|
||||
|
|
@ -780,6 +808,12 @@ BSIM3instance **InstArray;
|
|||
model->BSIM3dwc = model->BSIM3Wint;
|
||||
if (!model->BSIM3dlcGiven)
|
||||
model->BSIM3dlc = model->BSIM3Lint;
|
||||
|
||||
if (!model->BSIM3xlGiven)
|
||||
model->BSIM3xl = 0.0;
|
||||
if (!model->BSIM3xwGiven)
|
||||
model->BSIM3xw = 0.0;
|
||||
|
||||
if (!model->BSIM3cfGiven)
|
||||
model->BSIM3cf = 2.0 * EPSOX / PI
|
||||
* log(1.0 + 0.4e-6 / model->BSIM3tox);
|
||||
|
|
@ -874,7 +908,16 @@ BSIM3instance **InstArray;
|
|||
if (!here->BSIM3drainPerimeterGiven)
|
||||
here->BSIM3drainPerimeter = 0.0;
|
||||
if (!here->BSIM3drainSquaresGiven)
|
||||
{
|
||||
if (model->BSIM3acmMod == 0)
|
||||
here->BSIM3drainSquares = 1.0;
|
||||
else
|
||||
here->BSIM3drainSquares = 0.0;
|
||||
}
|
||||
if (!here->BSIM3delvtoGiven)
|
||||
here->BSIM3delvto = 0.0;
|
||||
if (!here->BSIM3mulu0Given)
|
||||
here->BSIM3mulu0 = 1.0;
|
||||
if (!here->BSIM3icVBSGiven)
|
||||
here->BSIM3icVBS = 0.0;
|
||||
if (!here->BSIM3icVDSGiven)
|
||||
|
|
@ -888,11 +931,21 @@ BSIM3instance **InstArray;
|
|||
if (!here->BSIM3sourcePerimeterGiven)
|
||||
here->BSIM3sourcePerimeter = 0.0;
|
||||
if (!here->BSIM3sourceSquaresGiven)
|
||||
{
|
||||
if (model->BSIM3acmMod == 0)
|
||||
here->BSIM3sourceSquares = 1.0;
|
||||
else
|
||||
here->BSIM3sourceSquares = 0.0;
|
||||
}
|
||||
if (!here->BSIM3wGiven)
|
||||
here->BSIM3w = 5.0e-6;
|
||||
if (!here->BSIM3nqsModGiven)
|
||||
here->BSIM3nqsMod = 0;
|
||||
here->BSIM3nqsMod = model->BSIM3nqsMod;
|
||||
else if ((here->BSIM3nqsMod != 0) && (here->BSIM3nqsMod != 1))
|
||||
{ here->BSIM3nqsMod = model->BSIM3nqsMod;
|
||||
printf("Warning: nqsMod has been set to its global value %d.\n",
|
||||
model->BSIM3nqsMod);
|
||||
}
|
||||
if (!here->BSIM3acnqsModGiven)
|
||||
here->BSIM3acnqsMod = model->BSIM3acnqsMod;
|
||||
else if ((here->BSIM3acnqsMod != 0) && (here->BSIM3acnqsMod != 1))
|
||||
|
|
@ -900,14 +953,19 @@ BSIM3instance **InstArray;
|
|||
printf("Warning: acnqsMod has been set to its global value %d.\n",
|
||||
model->BSIM3acnqsMod);
|
||||
}
|
||||
|
||||
if (!here->BSIM3geoGiven)
|
||||
here->BSIM3geo = 0;
|
||||
|
||||
if (!here->BSIM3mGiven)
|
||||
here->BSIM3m = 1;
|
||||
|
||||
/* process drain series resistance */
|
||||
if ((model->BSIM3sheetResistance > 0.0) &&
|
||||
(here->BSIM3drainSquares > 0.0 ))
|
||||
if ( ((model->BSIM3sheetResistance > 0.0) && (here->BSIM3drainSquares > 0.0))
|
||||
||((model->BSIM3sheetResistance > 0.0) && (model->BSIM3hdif > 0.0))
|
||||
||((model->BSIM3rd > 0.0) && (model->BSIM3ldif > 0.0))
|
||||
||((model->BSIM3rd > 0.0) && (model->BSIM3ld > 0.0))
|
||||
||((model->BSIM3rdc > 0.0))
|
||||
)
|
||||
{
|
||||
if(here->BSIM3dNodePrime == 0) {
|
||||
error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"drain");
|
||||
|
|
@ -928,8 +986,12 @@ BSIM3instance **InstArray;
|
|||
}
|
||||
|
||||
/* process source series resistance */
|
||||
if ((model->BSIM3sheetResistance > 0.0) &&
|
||||
(here->BSIM3sourceSquares > 0.0 ))
|
||||
if ( ((model->BSIM3sheetResistance > 0.0) && (here->BSIM3sourceSquares > 0.0))
|
||||
||((model->BSIM3sheetResistance > 0.0) && (model->BSIM3hdif > 0.0))
|
||||
||((model->BSIM3rs > 0.0) && (model->BSIM3ldif > 0.0))
|
||||
||((model->BSIM3rs > 0.0) && (model->BSIM3ld > 0.0))
|
||||
||((model->BSIM3rsc > 0.0))
|
||||
)
|
||||
{
|
||||
if(here->BSIM3sNodePrime == 0) {
|
||||
error = CKTmkVolt(ckt,&tmp,here->BSIM3name,"source");
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include "bsim3def.h"
|
||||
#include "ngspice/const.h"
|
||||
#include "ngspice/sperror.h"
|
||||
#include "ngspice/devdefs.h"
|
||||
#include "ngspice/suffix.h"
|
||||
|
||||
#define Kb 1.3806226e-23
|
||||
|
|
@ -40,7 +41,7 @@ struct bsim3SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam=NULL;
|
|||
double tmp, tmp1, tmp2, tmp3, Eg, Eg0, ni, T0, T1, T2, T3, T4, T5, Ldrn, Wdrn;
|
||||
double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom;
|
||||
double Nvtm, SourceSatCurrent, DrainSatCurrent;
|
||||
int Size_Not_Found;
|
||||
int Size_Not_Found, error;
|
||||
|
||||
/* loop through all the BSIM3 device models */
|
||||
for (; model != NULL; model = model->BSIM3nextModel)
|
||||
|
|
@ -192,7 +193,7 @@ int Size_Not_Found;
|
|||
+ model->BSIM3Wwlc / (T2 * T3);
|
||||
pParam->BSIM3dwc = model->BSIM3dwc + tmp2;
|
||||
|
||||
pParam->BSIM3leff = here->BSIM3l - 2.0 * pParam->BSIM3dl;
|
||||
pParam->BSIM3leff = here->BSIM3l + model->BSIM3xl - 2.0 * pParam->BSIM3dl;
|
||||
if (pParam->BSIM3leff <= 0.0)
|
||||
{ IFuid namarray[2];
|
||||
namarray[0] = model->BSIM3modName;
|
||||
|
|
@ -203,7 +204,7 @@ int Size_Not_Found;
|
|||
return(E_BADPARM);
|
||||
}
|
||||
|
||||
pParam->BSIM3weff = here->BSIM3w - 2.0 * pParam->BSIM3dw;
|
||||
pParam->BSIM3weff = here->BSIM3w + model->BSIM3xw - 2.0 * pParam->BSIM3dw;
|
||||
if (pParam->BSIM3weff <= 0.0)
|
||||
{ IFuid namarray[2];
|
||||
namarray[0] = model->BSIM3modName;
|
||||
|
|
@ -214,7 +215,7 @@ int Size_Not_Found;
|
|||
return(E_BADPARM);
|
||||
}
|
||||
|
||||
pParam->BSIM3leffCV = here->BSIM3l - 2.0 * pParam->BSIM3dlc;
|
||||
pParam->BSIM3leffCV = here->BSIM3l + model->BSIM3xl - 2.0 * pParam->BSIM3dlc;
|
||||
if (pParam->BSIM3leffCV <= 0.0)
|
||||
{ IFuid namarray[2];
|
||||
namarray[0] = model->BSIM3modName;
|
||||
|
|
@ -225,7 +226,7 @@ int Size_Not_Found;
|
|||
return(E_BADPARM);
|
||||
}
|
||||
|
||||
pParam->BSIM3weffCV = here->BSIM3w - 2.0 * pParam->BSIM3dwc;
|
||||
pParam->BSIM3weffCV = here->BSIM3w + model->BSIM3xw - 2.0 * pParam->BSIM3dwc;
|
||||
if (pParam->BSIM3weffCV <= 0.0)
|
||||
{ IFuid namarray[2];
|
||||
namarray[0] = model->BSIM3modName;
|
||||
|
|
@ -609,7 +610,7 @@ int Size_Not_Found;
|
|||
{ IFuid namarray[2];
|
||||
namarray[0] = model->BSIM3modName;
|
||||
namarray[1] = here->BSIM3name;
|
||||
SPfrontEnd->IFerror (ERR_FATAL, "Fatal error(s) detected during BSIM3V3.2 parameter checking for %s in model %s", namarray);
|
||||
SPfrontEnd->IFerror (ERR_FATAL, "Fatal error(s) detected during BSIM3V3.3 parameter checking for %s in model %s", namarray);
|
||||
return(E_BADPARM);
|
||||
}
|
||||
|
||||
|
|
@ -795,17 +796,56 @@ int Size_Not_Found;
|
|||
/* End of vfbzb */
|
||||
}
|
||||
|
||||
/* adding delvto */
|
||||
here->BSIM3vth0 = pParam->BSIM3vth0 + here->BSIM3delvto;
|
||||
here->BSIM3vfb = pParam->BSIM3vfb + model->BSIM3type * here->BSIM3delvto;
|
||||
here->BSIM3vfbzb = pParam->BSIM3vfbzb + model->BSIM3type * here->BSIM3delvto;
|
||||
|
||||
/* low field mobility multiplier */
|
||||
here->BSIM3u0temp = pParam->BSIM3u0temp * here->BSIM3mulu0;
|
||||
here->BSIM3tconst = here->BSIM3u0temp * pParam->BSIM3elm / (model->BSIM3cox
|
||||
* pParam->BSIM3weffCV * pParam->BSIM3leffCV * T0);
|
||||
|
||||
/* process source/drain series resistance */
|
||||
/* ACM model */
|
||||
if (model->BSIM3acmMod == 0)
|
||||
{
|
||||
here->BSIM3drainConductance = model->BSIM3sheetResistance
|
||||
* here->BSIM3drainSquares;
|
||||
here->BSIM3sourceConductance = model->BSIM3sheetResistance
|
||||
* here->BSIM3sourceSquares;
|
||||
}
|
||||
else /* ACM > 0 */
|
||||
{
|
||||
error = ACM_SourceDrainResistances(
|
||||
model->BSIM3acmMod,
|
||||
model->BSIM3ld,
|
||||
model->BSIM3ldif,
|
||||
model->BSIM3hdif,
|
||||
model->BSIM3wmlt,
|
||||
here->BSIM3w,
|
||||
model->BSIM3xw,
|
||||
model->BSIM3sheetResistance,
|
||||
here->BSIM3drainSquaresGiven,
|
||||
model->BSIM3rd,
|
||||
model->BSIM3rdc,
|
||||
here->BSIM3drainSquares,
|
||||
here->BSIM3sourceSquaresGiven,
|
||||
model->BSIM3rs,
|
||||
model->BSIM3rsc,
|
||||
here->BSIM3sourceSquares,
|
||||
&(here->BSIM3drainConductance),
|
||||
&(here->BSIM3sourceConductance)
|
||||
);
|
||||
if (error)
|
||||
return(error);
|
||||
}
|
||||
if (here->BSIM3drainConductance > 0.0)
|
||||
here->BSIM3drainConductance = 1.0
|
||||
/ here->BSIM3drainConductance;
|
||||
else
|
||||
here->BSIM3drainConductance = 0.0;
|
||||
|
||||
here->BSIM3sourceConductance = model->BSIM3sheetResistance
|
||||
* here->BSIM3sourceSquares;
|
||||
if (here->BSIM3sourceConductance > 0.0)
|
||||
here->BSIM3sourceConductance = 1.0
|
||||
/ here->BSIM3sourceConductance;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,13 @@ typedef struct sBSIM3instance
|
|||
double BSIM3sourcePerimeter;
|
||||
double BSIM3sourceConductance;
|
||||
double BSIM3drainConductance;
|
||||
double BSIM3delvto;
|
||||
double BSIM3mulu0;
|
||||
double BSIM3vth0;
|
||||
double BSIM3vfb;
|
||||
double BSIM3vfbzb;
|
||||
double BSIM3u0temp;
|
||||
double BSIM3tconst;
|
||||
|
||||
double BSIM3icVBS;
|
||||
double BSIM3icVDS;
|
||||
|
|
@ -61,6 +68,7 @@ typedef struct sBSIM3instance
|
|||
int BSIM3mode;
|
||||
int BSIM3nqsMod;
|
||||
int BSIM3acnqsMod;
|
||||
int BSIM3geo;
|
||||
|
||||
/* OP point */
|
||||
double BSIM3qinv;
|
||||
|
|
@ -122,6 +130,8 @@ typedef struct sBSIM3instance
|
|||
unsigned BSIM3sourceSquaresGiven :1;
|
||||
unsigned BSIM3drainPerimeterGiven :1;
|
||||
unsigned BSIM3sourcePerimeterGiven :1;
|
||||
unsigned BSIM3delvtoGiven :1;
|
||||
unsigned BSIM3mulu0Given :1;
|
||||
unsigned BSIM3dNodePrimeSet :1;
|
||||
unsigned BSIM3sNodePrimeSet :1;
|
||||
unsigned BSIM3icVBSGiven :1;
|
||||
|
|
@ -129,6 +139,7 @@ typedef struct sBSIM3instance
|
|||
unsigned BSIM3icVGSGiven :1;
|
||||
unsigned BSIM3nqsModGiven :1;
|
||||
unsigned BSIM3acnqsModGiven :1;
|
||||
unsigned BSIM3geoGiven :1;
|
||||
|
||||
double *BSIM3DdPtr;
|
||||
double *BSIM3GgPtr;
|
||||
|
|
@ -430,7 +441,10 @@ typedef struct sBSIM3model
|
|||
|
||||
int BSIM3mobMod;
|
||||
int BSIM3capMod;
|
||||
int BSIM3acmMod;
|
||||
int BSIM3calcacm;
|
||||
int BSIM3noiMod;
|
||||
int BSIM3nqsMod;
|
||||
int BSIM3acnqsMod;
|
||||
int BSIM3binUnit;
|
||||
int BSIM3paramChk;
|
||||
|
|
@ -532,6 +546,18 @@ typedef struct sBSIM3model
|
|||
double BSIM3tpbsw;
|
||||
double BSIM3tpbswg;
|
||||
|
||||
/* ACM model */
|
||||
double BSIM3xl;
|
||||
double BSIM3xw;
|
||||
double BSIM3hdif;
|
||||
double BSIM3ldif;
|
||||
double BSIM3ld;
|
||||
double BSIM3rd;
|
||||
double BSIM3rs;
|
||||
double BSIM3rdc;
|
||||
double BSIM3rsc;
|
||||
double BSIM3wmlt;
|
||||
|
||||
/* Length Dependence */
|
||||
double BSIM3lcdsc;
|
||||
double BSIM3lcdscb;
|
||||
|
|
@ -881,8 +907,11 @@ typedef struct sBSIM3model
|
|||
unsigned BSIM3mobModGiven :1;
|
||||
unsigned BSIM3binUnitGiven :1;
|
||||
unsigned BSIM3capModGiven :1;
|
||||
unsigned BSIM3acmModGiven :1;
|
||||
unsigned BSIM3calcacmGiven :1;
|
||||
unsigned BSIM3paramChkGiven :1;
|
||||
unsigned BSIM3noiModGiven :1;
|
||||
unsigned BSIM3nqsModGiven :1;
|
||||
unsigned BSIM3acnqsModGiven :1;
|
||||
unsigned BSIM3typeGiven :1;
|
||||
unsigned BSIM3toxGiven :1;
|
||||
|
|
@ -983,6 +1012,17 @@ typedef struct sBSIM3model
|
|||
unsigned BSIM3tpbswGiven :1;
|
||||
unsigned BSIM3tpbswgGiven :1;
|
||||
|
||||
/* ACM model */
|
||||
unsigned BSIM3xlGiven :1;
|
||||
unsigned BSIM3xwGiven :1;
|
||||
unsigned BSIM3hdifGiven :1;
|
||||
unsigned BSIM3ldifGiven :1;
|
||||
unsigned BSIM3ldGiven :1;
|
||||
unsigned BSIM3rdGiven :1;
|
||||
unsigned BSIM3rsGiven :1;
|
||||
unsigned BSIM3rdcGiven :1;
|
||||
unsigned BSIM3rscGiven :1;
|
||||
unsigned BSIM3wmltGiven :1;
|
||||
|
||||
/* Length dependence */
|
||||
unsigned BSIM3lcdscGiven :1;
|
||||
|
|
@ -1312,7 +1352,6 @@ typedef struct sBSIM3model
|
|||
/* device parameters */
|
||||
#define BSIM3_W 1
|
||||
#define BSIM3_L 2
|
||||
#define BSIM3_M 16
|
||||
#define BSIM3_AS 3
|
||||
#define BSIM3_AD 4
|
||||
#define BSIM3_PS 5
|
||||
|
|
@ -1326,9 +1365,15 @@ typedef struct sBSIM3model
|
|||
#define BSIM3_IC 13
|
||||
#define BSIM3_NQSMOD 14
|
||||
#define BSIM3_ACNQSMOD 15
|
||||
#define BSIM3_M 16
|
||||
#define BSIM3_DELVTO 17
|
||||
#define BSIM3_MULU0 18
|
||||
#define BSIM3_GEO 19
|
||||
|
||||
/* model parameters */
|
||||
#define BSIM3_MOD_CAPMOD 101
|
||||
#define BSIM3_MOD_CAPMOD 100
|
||||
#define BSIM3_MOD_ACMMOD 101
|
||||
#define BSIM3_MOD_CALCACM 102
|
||||
#define BSIM3_MOD_MOBMOD 103
|
||||
#define BSIM3_MOD_NOIMOD 104
|
||||
|
||||
|
|
@ -1440,7 +1485,8 @@ typedef struct sBSIM3model
|
|||
#define BSIM3_MOD_TPBSWG 207
|
||||
#define BSIM3_MOD_VOFFCV 208
|
||||
#define BSIM3_MOD_LINTNOI 209
|
||||
#define BSIM3_MOD_ACNQSMOD 210
|
||||
#define BSIM3_MOD_NQSMOD 210
|
||||
#define BSIM3_MOD_ACNQSMOD 211
|
||||
|
||||
/* Length dependence */
|
||||
#define BSIM3_MOD_LCDSC 251
|
||||
|
|
@ -1795,6 +1841,18 @@ typedef struct sBSIM3model
|
|||
#define BSIM3_MOD_WWC 701
|
||||
#define BSIM3_MOD_WWLC 702
|
||||
|
||||
/* ACM parameters */
|
||||
#define BSIM3_MOD_XL 703
|
||||
#define BSIM3_MOD_XW 704
|
||||
#define BSIM3_MOD_HDIF 711
|
||||
#define BSIM3_MOD_LDIF 712
|
||||
#define BSIM3_MOD_LD 713
|
||||
#define BSIM3_MOD_RD 714
|
||||
#define BSIM3_MOD_RS 715
|
||||
#define BSIM3_MOD_RDC 716
|
||||
#define BSIM3_MOD_RSC 717
|
||||
#define BSIM3_MOD_WMLT 718
|
||||
|
||||
/* device questions */
|
||||
#define BSIM3_DNODE 751
|
||||
#define BSIM3_GNODE 752
|
||||
|
|
|
|||
|
|
@ -34,3 +34,7 @@ extern int BSIM3bindCSC (GENmodel*, CKTcircuit*) ;
|
|||
extern int BSIM3bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int BSIM3nodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,12 +72,17 @@ SPICEdev BSIM3info = {
|
|||
#endif
|
||||
/* DEVinstSize */ &BSIM3iSize,
|
||||
/* DEVmodSize */ &BSIM3mSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ BSIM3bindCSC,
|
||||
/* DEVbindCSCComplex */ BSIM3bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BSIM3bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ BSIM3nodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ if UMFPACK_WANTED
|
|||
libbsim3soidd_la_SOURCES += b3soiddbindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim3soidd_la_SOURCES += b3soiddnode.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -34,3 +34,7 @@ extern int B3SOIDDbindCSC (GENmodel*, CKTcircuit*) ;
|
|||
extern int B3SOIDDbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIDDbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int B3SOIDDnodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -70,12 +70,17 @@ SPICEdev B3SOIDDinfo = {
|
|||
#endif
|
||||
/* DEVinstSize */ &B3SOIDDiSize,
|
||||
/* DEVmodSize */ &B3SOIDDmSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ B3SOIDDbindCSC,
|
||||
/* DEVbindCSCComplex */ B3SOIDDbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B3SOIDDbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ B3SOIDDnodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
SPICEdev *
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "b3soidddef.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
B3SOIDDnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B3SOIDDmodel *model = (B3SOIDDmodel *)inModel ;
|
||||
B3SOIDDinstance *here ;
|
||||
|
||||
/* loop through all the B3SOIDD models */
|
||||
for ( ; model != NULL ; model = model->B3SOIDDnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B3SOIDDinstances ; here != NULL ; here = here->B3SOIDDnextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDdNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDsNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDtempNode] = 0 ;
|
||||
if ((here->B3SOIDDdebugMod > 1) || (here->B3SOIDDdebugMod == -1))
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvbsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDidsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDicNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDibsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDibdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDiiiNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDigidlNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDitunNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDibpNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDabeffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvbs0effNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvbseffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDxcNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDcbbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDcbdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDcbgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqbfNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqjsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqjdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDgmNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDgmbsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDgdsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDgmeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvbs0teffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvthNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvgsteffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDxcsatNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqaccNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqsub0Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqsubs1Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqsubs2Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDqgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvdscvNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDvcscvNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDcbeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDdum1Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDdum2Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDdum3Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDdum4Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDdum5Node] = 0 ;
|
||||
}
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIDDpNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -40,6 +40,10 @@ if UMFPACK_WANTED
|
|||
libbsim3soifd_la_SOURCES += b3soifdbindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim3soifd_la_SOURCES += b3soifdnode.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,12 @@ extern int B3SOIFDtrunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int B3SOIFDnoise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int B3SOIFDunsetup(GENmodel*,CKTcircuit*);
|
||||
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
extern int B3SOIFDbindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIFDbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIFDbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int B3SOIFDnodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,12 +71,17 @@ SPICEdev B3SOIFDinfo = {
|
|||
#endif
|
||||
/* DEVinstSize*/ &B3SOIFDiSize,
|
||||
/* DEVmodSize*/ &B3SOIFDmSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ B3SOIFDbindCSC,
|
||||
/* DEVbindCSCComplex */ B3SOIFDbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B3SOIFDbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ B3SOIFDnodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,79 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "b3soifddef.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
B3SOIFDnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B3SOIFDmodel *model = (B3SOIFDmodel *)inModel ;
|
||||
B3SOIFDinstance *here ;
|
||||
|
||||
/* loop through all the B3SOIFD models */
|
||||
for ( ; model != NULL ; model = model->B3SOIFDnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B3SOIFDinstances ; here != NULL ; here = here->B3SOIFDnextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDdNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDsNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDtempNode] = 0 ;
|
||||
if ((here->B3SOIFDdebugMod > 1) || (here->B3SOIFDdebugMod == -1))
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvbsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDidsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDicNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDibsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDibdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDiiiNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDigidlNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDitunNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDibpNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDabeffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvbs0effNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvbseffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDxcNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDcbbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDcbdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDcbgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqbfNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqjsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqjdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDgmNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDgmbsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDgdsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDgmeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvbs0teffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvthNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvgsteffNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDxcsatNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqaccNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqsub0Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqsubs1Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqsubs2Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDqgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvdscvNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDvcscvNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDcbeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDdum1Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDdum2Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDdum3Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDdum4Node] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDdum5Node] = 0 ;
|
||||
}
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIFDpNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -40,6 +40,10 @@ if UMFPACK_WANTED
|
|||
libbsim3soipd_la_SOURCES += b3soipdbindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim3soipd_la_SOURCES += b3soipdnode.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -34,3 +34,7 @@ extern int B3SOIPDbindCSC (GENmodel*, CKTcircuit*) ;
|
|||
extern int B3SOIPDbindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int B3SOIPDbindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int B3SOIPDnodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,12 +72,17 @@ SPICEdev B3SOIPDinfo = {
|
|||
#endif
|
||||
/* DEVinstSize*/ &B3SOIPDiSize,
|
||||
/* DEVmodSize*/ &B3SOIPDmSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ B3SOIPDbindCSC,
|
||||
/* DEVbindCSCComplex */ B3SOIPDbindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ B3SOIPDbindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ B3SOIPDnodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
SPICEdev *
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "b3soipddef.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
B3SOIPDnodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
B3SOIPDmodel *model = (B3SOIPDmodel *)inModel ;
|
||||
B3SOIPDinstance *here ;
|
||||
|
||||
/* loop through all the B3SOIPD models */
|
||||
for ( ; model != NULL ; model = model->B3SOIPDnextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->B3SOIPDinstances ; here != NULL ; here = here->B3SOIPDnextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDdNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDsNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDtempNode] = 0 ;
|
||||
if (here->B3SOIPDdebugMod != 0)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDvbsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDidsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDicNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDibsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDibdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDiiiNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDigNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDgiggNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDgigdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDgigbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDigidlNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDitunNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDibpNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDcbbNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDcbdNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDcbgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDqbfNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDqjsNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDqjdNode] = 0 ;
|
||||
}
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDgNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDeNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->B3SOIPDpNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -39,6 +39,10 @@ if UMFPACK_WANTED
|
|||
libbsim3v0_la_SOURCES += b3v0bindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim3v0_la_SOURCES += b3v0node.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim3v0def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
BSIM3v0nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v0model *model = (BSIM3v0model *)inModel ;
|
||||
BSIM3v0instance *here ;
|
||||
|
||||
/* loop through all the BSIM3v0 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v0nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v0instances ; here != NULL ; here = here->BSIM3v0nextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v0dNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v0sNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v0qNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v0gNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v0bNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -28,9 +28,12 @@ extern int BSIM3v0trunc(GENmodel*,CKTcircuit*,double*);
|
|||
extern int BSIM3v0noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
|
||||
extern int BSIM3v0unsetup(GENmodel *, CKTcircuit *);
|
||||
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
extern int BSIM3v0bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v0bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v0bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int BSIM3v0nodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,12 +71,17 @@ SPICEdev B3v0info = {
|
|||
#endif
|
||||
/* DEVinstSize */ &BSIM3v0iSize,
|
||||
/* DEVmodSize */ &BSIM3v0mSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ BSIM3v0bindCSC,
|
||||
/* DEVbindCSCComplex */ BSIM3v0bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BSIM3v0bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ BSIM3v0nodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ if UMFPACK_WANTED
|
|||
libbsim3v1_la_SOURCES += b3v1bindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim3v1_la_SOURCES += b3v1node.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
/**********
|
||||
Author: 2013 Francesco Lannutti
|
||||
**********/
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cktdefs.h"
|
||||
#include "bsim3v1def.h"
|
||||
#include "ngspice/sperror.h"
|
||||
|
||||
int
|
||||
BSIM3v1nodeIsNonLinear (GENmodel *inModel, CKTcircuit *ckt)
|
||||
{
|
||||
BSIM3v1model *model = (BSIM3v1model *)inModel ;
|
||||
BSIM3v1instance *here ;
|
||||
|
||||
/* loop through all the BSIM3v1 models */
|
||||
for ( ; model != NULL ; model = model->BSIM3v1nextModel)
|
||||
{
|
||||
/* loop through all the instances of the model */
|
||||
for (here = model->BSIM3v1instances ; here != NULL ; here = here->BSIM3v1nextInstance)
|
||||
{
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v1dNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v1sNodePrime] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v1qNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v1gNode] = 0 ;
|
||||
ckt->CKTnodeIsLinear [here->BSIM3v1bNode] = 0 ;
|
||||
}
|
||||
}
|
||||
|
||||
return (OK) ;
|
||||
}
|
||||
|
|
@ -29,9 +29,12 @@ extern int BSIM3v1trunc(GENmodel *, CKTcircuit *, double *);
|
|||
extern int BSIM3v1noise(int, int, GENmodel *, CKTcircuit *, Ndata *, double *);
|
||||
extern int BSIM3v1unsetup(GENmodel *, CKTcircuit *);
|
||||
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
extern int BSIM3v1bindCSC (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v1bindCSCComplex (GENmodel*, CKTcircuit*) ;
|
||||
extern int BSIM3v1bindCSCComplexToReal (GENmodel*, CKTcircuit*) ;
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
extern int BSIM3v1nodeIsNonLinear (GENmodel *, CKTcircuit *) ;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -71,12 +71,17 @@ SPICEdev BSIM3v1info = {
|
|||
#endif
|
||||
/* DEVinstSize */ &BSIM3v1iSize,
|
||||
/* DEVmodSize */ &BSIM3v1mSize,
|
||||
|
||||
#if defined(KLU) || defined(SuperLU) || defined(UMFPACK)
|
||||
/* DEVbindCSC */ BSIM3v1bindCSC,
|
||||
/* DEVbindCSCComplex */ BSIM3v1bindCSCComplex,
|
||||
/* DEVbindCSCComplexToReal */ BSIM3v1bindCSCComplexToReal,
|
||||
#endif
|
||||
|
||||
#ifdef KIRCHHOFF
|
||||
/* DEVnodeIsNonLinear */ BSIM3v1nodeIsNonLinear
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,10 @@ if UMFPACK_WANTED
|
|||
libbsim3v32_la_SOURCES += b3v32bindCSC.c
|
||||
endif
|
||||
|
||||
if KIRCHHOFF_WANTED
|
||||
libbsim3v32_la_SOURCES += b3v32node.c
|
||||
endif
|
||||
|
||||
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
|
||||
AM_CFLAGS = $(STATIC)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ IOP( "nrd", BSIM3v32_NRD, IF_REAL , "Number of squares in drain"),
|
|||
IOP( "nrs", BSIM3v32_NRS, IF_REAL , "Number of squares in source"),
|
||||
IOP( "off", BSIM3v32_OFF, IF_FLAG , "Device is initially off"),
|
||||
IOP( "nqsmod", BSIM3v32_NQSMOD, IF_INTEGER, "Non-quasi-static model selector"),
|
||||
IOP( "geo", BSIM3v32_GEO, IF_INTEGER, "ACM model drain/source connection"),
|
||||
IOP( "delvto", BSIM3v32_DELVTO, IF_REAL , "Zero bias threshold voltage variation"),
|
||||
IOP( "mulu0", BSIM3v32_MULU0, IF_REAL , "Low field mobility multiplier"),
|
||||
IP( "ic", BSIM3v32_IC, IF_REALVEC , "Vector of DS,GS,BS initial voltages"),
|
||||
|
|
@ -65,7 +66,9 @@ IFparm BSIM3v32mPTable[] = { /* model parameters */
|
|||
IOP( "capmod", BSIM3v32_MOD_CAPMOD, IF_INTEGER, "Capacitance model selector"),
|
||||
IOP( "mobmod", BSIM3v32_MOD_MOBMOD, IF_INTEGER, "Mobility model selector"),
|
||||
IOP( "noimod", BSIM3v32_MOD_NOIMOD, IF_INTEGER, "Noise model selector"),
|
||||
IOP( "nqsmod", BSIM3v32_MOD_NQSMOD, IF_INTEGER, "Non-quasi-static model selector"),
|
||||
IOP( "acm", BSIM3v32_MOD_ACMMOD, IF_INTEGER, "Area calculation method selector"),
|
||||
IOP( "calcacm", BSIM3v32_MOD_CALCACM, IF_INTEGER, "Area calculation method ACM=12"),
|
||||
IOP( "paramchk", BSIM3v32_MOD_PARAMCHK, IF_INTEGER, "Model parameter checking selector"),
|
||||
IOP( "binunit", BSIM3v32_MOD_BINUNIT, IF_INTEGER, "Bin unit selector"),
|
||||
IOP( "version", BSIM3v32_MOD_VERSION, IF_STRING, " parameter for model version"),
|
||||
|
|
@ -218,8 +221,9 @@ IOP( "ldif", BSIM3v32_MOD_LDIF, IF_REAL, "ACM Parameter: Length of LDD Gate-Sour
|
|||
IOP( "ld", BSIM3v32_MOD_LD, IF_REAL, "ACM Parameter: Length of LDD under Gate"),
|
||||
IOP( "rd", BSIM3v32_MOD_RD, IF_REAL, "ACM Parameter: Resistance of LDD drain side"),
|
||||
IOP( "rs", BSIM3v32_MOD_RS, IF_REAL, "ACM Parameter: Resistance of LDD source side"),
|
||||
IOP( "rdc", BSIM3v32_MOD_RS, IF_REAL, "ACM Parameter: Resistance contact drain side"),
|
||||
IOP( "rsc", BSIM3v32_MOD_RS, IF_REAL, "ACM Parameter: Resistance contact source side"),
|
||||
IOP( "rdc", BSIM3v32_MOD_RDC, IF_REAL, "ACM Parameter: Resistance contact drain side"),
|
||||
IOP( "rsc", BSIM3v32_MOD_RSC, IF_REAL, "ACM Parameter: Resistance contact source side"),
|
||||
IOP( "wmlt", BSIM3v32_MOD_WMLT, IF_REAL, "ACM Parameter: Width shrink factor"),
|
||||
|
||||
IOP( "alpha0", BSIM3v32_MOD_ALPHA0, IF_REAL, "substrate current model parameter"),
|
||||
IOP( "alpha1", BSIM3v32_MOD_ALPHA1, IF_REAL, "substrate current model parameter"),
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ BSIM3v32instance *here = (BSIM3v32instance*)inst;
|
|||
case BSIM3v32_NQSMOD:
|
||||
value->iValue = here->BSIM3v32nqsMod;
|
||||
return(OK);
|
||||
case BSIM3v32_GEO:
|
||||
value->iValue = here->BSIM3v32geo;
|
||||
return(OK);
|
||||
case BSIM3v32_DELVTO:
|
||||
value->rValue = here->BSIM3v32delvto;
|
||||
return(OK);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ FILE *fplog;
|
|||
|
||||
NG_IGNORE(ckt);
|
||||
|
||||
if ((fplog = fopen("b3v3check.log", "w")) != NULL)
|
||||
if ((fplog = fopen("b3v32check.log", "w")) != NULL)
|
||||
{ pParam = here->pParam;
|
||||
|
||||
fprintf (fplog,
|
||||
|
|
@ -178,7 +178,7 @@ FILE *fplog;
|
|||
printf("Warning: Pscbe2 = %g is not positive.\n", pParam->BSIM3v32pscbe2);
|
||||
}
|
||||
|
||||
/* acm model */
|
||||
/* ACM model */
|
||||
if (model->BSIM3v32acmMod == 0) {
|
||||
if (model->BSIM3v32unitLengthSidewallJctCap > 0.0 ||
|
||||
model->BSIM3v32unitLengthGateSidewallJctCap > 0.0)
|
||||
|
|
@ -197,6 +197,12 @@ FILE *fplog;
|
|||
}
|
||||
}
|
||||
}
|
||||
if ((model->BSIM3v32calcacm > 0) && (model->BSIM3v32acmMod != 12))
|
||||
{ fprintf(fplog, "Warning: CALCACM = %d is wrong. Set back to 0.\n",
|
||||
model->BSIM3v32calcacm);
|
||||
printf("Warning: CALCACM = %d is wrong. Set back to 0.\n", model->BSIM3v32calcacm);
|
||||
model->BSIM3v32calcacm = 0;
|
||||
}
|
||||
|
||||
if (pParam->BSIM3v32noff < 0.1)
|
||||
{ fprintf(fplog, "Warning: Noff = %g is too small.\n",
|
||||
|
|
@ -260,7 +266,7 @@ FILE *fplog;
|
|||
|
||||
if (model->BSIM3v32paramChk ==1)
|
||||
{
|
||||
/* Check L and W parameters */
|
||||
/* Check L and W parameters */
|
||||
if (pParam->BSIM3v32leff <= 5.0e-8)
|
||||
{ fprintf(fplog, "Warning: Leff = %g may be too small.\n",
|
||||
pParam->BSIM3v32leff);
|
||||
|
|
@ -289,7 +295,7 @@ FILE *fplog;
|
|||
pParam->BSIM3v32weffCV);
|
||||
}
|
||||
|
||||
/* Check threshold voltage parameters */
|
||||
/* Check threshold voltage parameters */
|
||||
if (pParam->BSIM3v32nlx < 0.0)
|
||||
{ fprintf(fplog, "Warning: Nlx = %g is negative.\n", pParam->BSIM3v32nlx);
|
||||
printf("Warning: Nlx = %g is negative.\n", pParam->BSIM3v32nlx);
|
||||
|
|
@ -345,7 +351,7 @@ FILE *fplog;
|
|||
printf("Warning: (W0 + Weff) may be too small.\n");
|
||||
}
|
||||
|
||||
/* Check subthreshold parameters */
|
||||
/* Check subthreshold parameters */
|
||||
if (pParam->BSIM3v32nfactor < 0.0)
|
||||
{ fprintf(fplog, "Warning: Nfactor = %g is negative.\n",
|
||||
pParam->BSIM3v32nfactor);
|
||||
|
|
@ -361,21 +367,21 @@ FILE *fplog;
|
|||
pParam->BSIM3v32cdscd);
|
||||
printf("Warning: Cdscd = %g is negative.\n", pParam->BSIM3v32cdscd);
|
||||
}
|
||||
/* Check DIBL parameters */
|
||||
/* Check DIBL parameters */
|
||||
if (pParam->BSIM3v32eta0 < 0.0)
|
||||
{ fprintf(fplog, "Warning: Eta0 = %g is negative.\n",
|
||||
pParam->BSIM3v32eta0);
|
||||
printf("Warning: Eta0 = %g is negative.\n", pParam->BSIM3v32eta0);
|
||||
}
|
||||
|
||||
/* Check Abulk parameters */
|
||||
/* Check Abulk parameters */
|
||||
if (fabs(1.0e-6 / (pParam->BSIM3v32b1 + pParam->BSIM3v32weff)) > 10.0)
|
||||
{ fprintf(fplog, "Warning: (B1 + Weff) may be too small.\n");
|
||||
printf("Warning: (B1 + Weff) may be too small.\n");
|
||||
}
|
||||
|
||||
|
||||
/* Check Saturation parameters */
|
||||
/* Check Saturation parameters */
|
||||
if (pParam->BSIM3v32a2 < 0.01)
|
||||
{ fprintf(fplog, "Warning: A2 = %g is too small. Set to 0.01.\n", pParam->BSIM3v32a2);
|
||||
printf("Warning: A2 = %g is too small. Set to 0.01.\n",
|
||||
|
|
@ -422,7 +428,7 @@ FILE *fplog;
|
|||
pParam->BSIM3v32pdibl2);
|
||||
printf("Warning: Pdibl2 = %g is negative.\n", pParam->BSIM3v32pdibl2);
|
||||
}
|
||||
/* Check overlap capacitance parameters */
|
||||
/* Check overlap capacitance parameters */
|
||||
if (model->BSIM3v32cgdo < 0.0)
|
||||
{ fprintf(fplog, "Warning: cgdo = %g is negative. Set to zero.\n", model->BSIM3v32cgdo);
|
||||
printf("Warning: cgdo = %g is negative. Set to zero.\n", model->BSIM3v32cgdo);
|
||||
|
|
|
|||
|
|
@ -351,21 +351,41 @@ for (; model != NULL; model = model->BSIM3v32nextModel)
|
|||
+ here->BSIM3v32sourcePerimeter
|
||||
* model->BSIM3v32jctSidewallTempSatCurDensity;
|
||||
}
|
||||
if ((here->BSIM3v32drainArea <= 0.0) && (here->BSIM3v32drainPerimeter <= 0.0))
|
||||
{ DrainSatCurrent = 1.0e-14;
|
||||
}
|
||||
else
|
||||
{ DrainSatCurrent = here->BSIM3v32drainArea
|
||||
* model->BSIM3v32jctTempSatCurDensity
|
||||
+ here->BSIM3v32drainPerimeter
|
||||
* model->BSIM3v32jctSidewallTempSatCurDensity;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SourceSatCurrent = 0.0;
|
||||
if (!here->BSIM3v32sourceAreaGiven)
|
||||
{
|
||||
here->BSIM3v32sourceArea = 2.0 * model->BSIM3v32hdif * pParam->BSIM3v32weff;
|
||||
}
|
||||
SourceSatCurrent = here->BSIM3v32sourceArea * model->BSIM3v32jctTempSatCurDensity;
|
||||
if (!here->BSIM3v32sourcePerimeterGiven)
|
||||
{
|
||||
here->BSIM3v32sourcePerimeter = 4.0 * model->BSIM3v32hdif + 2.0 * pParam->BSIM3v32weff;
|
||||
}
|
||||
SourceSatCurrent = SourceSatCurrent + here->BSIM3v32sourcePerimeter * model->BSIM3v32jctSidewallTempSatCurDensity;
|
||||
if (SourceSatCurrent <= 0.0) SourceSatCurrent = 1.0e-14;
|
||||
error = ACM_saturationCurrents(
|
||||
model->BSIM3v32acmMod,
|
||||
model->BSIM3v32calcacm,
|
||||
here->BSIM3v32geo,
|
||||
model->BSIM3v32hdif,
|
||||
model->BSIM3v32wmlt,
|
||||
here->BSIM3v32w,
|
||||
model->BSIM3v32xw,
|
||||
model->BSIM3v32jctTempSatCurDensity,
|
||||
model->BSIM3v32jctSidewallTempSatCurDensity,
|
||||
here->BSIM3v32drainAreaGiven,
|
||||
here->BSIM3v32drainArea,
|
||||
here->BSIM3v32drainPerimeterGiven,
|
||||
here->BSIM3v32drainPerimeter,
|
||||
here->BSIM3v32sourceAreaGiven,
|
||||
here->BSIM3v32sourceArea,
|
||||
here->BSIM3v32sourcePerimeterGiven,
|
||||
here->BSIM3v32sourcePerimeter,
|
||||
&DrainSatCurrent,
|
||||
&SourceSatCurrent
|
||||
);
|
||||
if (error)
|
||||
return(error);
|
||||
}
|
||||
if (SourceSatCurrent <= 0.0)
|
||||
{ here->BSIM3v32gbs = ckt->CKTgmin;
|
||||
|
|
@ -408,34 +428,6 @@ for (; model != NULL; model = model->BSIM3v32nextModel)
|
|||
}
|
||||
}
|
||||
|
||||
/* acm model */
|
||||
if (model->BSIM3v32acmMod == 0)
|
||||
{
|
||||
if ((here->BSIM3v32drainArea <= 0.0) && (here->BSIM3v32drainPerimeter <= 0.0))
|
||||
{ DrainSatCurrent = 1.0e-14;
|
||||
}
|
||||
else
|
||||
{ DrainSatCurrent = here->BSIM3v32drainArea
|
||||
* model->BSIM3v32jctTempSatCurDensity
|
||||
+ here->BSIM3v32drainPerimeter
|
||||
* model->BSIM3v32jctSidewallTempSatCurDensity;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DrainSatCurrent = 0.0;
|
||||
if (!here->BSIM3v32drainAreaGiven)
|
||||
{
|
||||
here->BSIM3v32drainArea = 2.0 * model->BSIM3v32hdif * pParam->BSIM3v32weff;
|
||||
}
|
||||
DrainSatCurrent = here->BSIM3v32drainArea * model->BSIM3v32jctTempSatCurDensity;
|
||||
if (!here->BSIM3v32drainPerimeterGiven)
|
||||
{
|
||||
here->BSIM3v32drainPerimeter = 4.0 * model->BSIM3v32hdif + 2.0 * pParam->BSIM3v32weff;
|
||||
}
|
||||
DrainSatCurrent = DrainSatCurrent + here->BSIM3v32drainPerimeter * model->BSIM3v32jctSidewallTempSatCurDensity;
|
||||
if (DrainSatCurrent <= 0.0) DrainSatCurrent = 1.0e-14;
|
||||
}
|
||||
if (DrainSatCurrent <= 0.0)
|
||||
{ here->BSIM3v32gbd = ckt->CKTgmin;
|
||||
here->BSIM3v32cbd = here->BSIM3v32gbd * vbd;
|
||||
|
|
@ -2460,6 +2452,8 @@ finished:
|
|||
along gate side
|
||||
*/
|
||||
|
||||
if (model->BSIM3v32acmMod == 0)
|
||||
{
|
||||
/* Added revision dependent code */
|
||||
switch (model->BSIM3v32intVersion) {
|
||||
case BSIM3v32V324:
|
||||
|
|
@ -2536,6 +2530,37 @@ finished:
|
|||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
error = ACM_junctionCapacitances(
|
||||
model->BSIM3v32acmMod,
|
||||
model->BSIM3v32calcacm,
|
||||
here->BSIM3v32geo,
|
||||
model->BSIM3v32hdif,
|
||||
model->BSIM3v32wmlt,
|
||||
here->BSIM3v32w,
|
||||
model->BSIM3v32xw,
|
||||
here->BSIM3v32drainAreaGiven,
|
||||
here->BSIM3v32drainArea,
|
||||
here->BSIM3v32drainPerimeterGiven,
|
||||
here->BSIM3v32drainPerimeter,
|
||||
here->BSIM3v32sourceAreaGiven,
|
||||
here->BSIM3v32sourceArea,
|
||||
here->BSIM3v32sourcePerimeterGiven,
|
||||
here->BSIM3v32sourcePerimeter,
|
||||
model->BSIM3v32unitAreaTempJctCap,
|
||||
model->BSIM3v32unitLengthSidewallTempJctCap,
|
||||
model->BSIM3v32unitLengthGateSidewallJctCap,
|
||||
&czbd,
|
||||
&czbdsw,
|
||||
&czbdswg,
|
||||
&czbs,
|
||||
&czbssw,
|
||||
&czbsswg
|
||||
);
|
||||
if (error)
|
||||
return(error);
|
||||
}
|
||||
|
||||
MJ = model->BSIM3v32bulkJctBotGradingCoeff;
|
||||
MJSW = model->BSIM3v32bulkJctSideGradingCoeff;
|
||||
MJSWG = model->BSIM3v32bulkJctGateSideGradingCoeff;
|
||||
|
|
|
|||
|
|
@ -40,9 +40,15 @@ BSIM3v32mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
|
|||
case BSIM3v32_MOD_NOIMOD:
|
||||
value->iValue = model->BSIM3v32noiMod;
|
||||
return(OK);
|
||||
case BSIM3v32_MOD_NQSMOD:
|
||||
value->iValue = model->BSIM3v32nqsMod;
|
||||
return(OK);
|
||||
case BSIM3v32_MOD_ACMMOD:
|
||||
value->iValue = model->BSIM3v32acmMod;
|
||||
return(OK);
|
||||
case BSIM3v32_MOD_CALCACM:
|
||||
value->iValue = model->BSIM3v32calcacm;
|
||||
return(OK);
|
||||
case BSIM3v32_MOD_VERSION :
|
||||
value->sValue = model->BSIM3v32version;
|
||||
return(OK);
|
||||
|
|
@ -334,7 +340,7 @@ BSIM3v32mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
|
|||
value->rValue = model->BSIM3v32tpbswg;
|
||||
return(OK);
|
||||
|
||||
/* acm model */
|
||||
/* ACM model */
|
||||
case BSIM3v32_MOD_HDIF:
|
||||
value->rValue = model->BSIM3v32hdif;
|
||||
return(OK);
|
||||
|
|
@ -356,6 +362,9 @@ BSIM3v32mAsk (CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
|
|||
case BSIM3v32_MOD_RSC:
|
||||
value->rValue = model->BSIM3v32rsc;
|
||||
return(OK);
|
||||
case BSIM3v32_MOD_WMLT:
|
||||
value->rValue = model->BSIM3v32wmlt;
|
||||
return(OK);
|
||||
|
||||
/* Length dependence */
|
||||
case BSIM3v32_MOD_LCDSC :
|
||||
|
|
|
|||
|
|
@ -44,4 +44,3 @@ delgot:
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,18 @@ BSIM3v32mParam(int param, IFvalue *value, GENmodel *inMod)
|
|||
mod->BSIM3v32acmMod = value->iValue;
|
||||
mod->BSIM3v32acmModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3v32_MOD_CALCACM:
|
||||
mod->BSIM3v32calcacm = value->iValue;
|
||||
mod->BSIM3v32calcacmGiven = TRUE;
|
||||
break;
|
||||
case BSIM3v32_MOD_NOIMOD :
|
||||
mod->BSIM3v32noiMod = value->iValue;
|
||||
mod->BSIM3v32noiModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3v32_MOD_NQSMOD :
|
||||
mod->BSIM3v32nqsMod = value->iValue;
|
||||
mod->BSIM3v32nqsModGiven = TRUE;
|
||||
break;
|
||||
case BSIM3v32_MOD_VERSION :
|
||||
mod->BSIM3v32version = value->sValue;
|
||||
mod->BSIM3v32versionGiven = TRUE;
|
||||
|
|
@ -465,6 +473,10 @@ BSIM3v32mParam(int param, IFvalue *value, GENmodel *inMod)
|
|||
mod->BSIM3v32rsc = value->rValue;
|
||||
mod->BSIM3v32rscGiven = TRUE;
|
||||
break;
|
||||
case BSIM3v32_MOD_WMLT:
|
||||
mod->BSIM3v32wmlt = value->rValue;
|
||||
mod->BSIM3v32wmltGiven = TRUE;
|
||||
break;
|
||||
|
||||
/* Length dependence */
|
||||
case BSIM3v32_MOD_LCDSC :
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue