diff --git a/src/spicelib/devices/adms/admst/ngspice.xml b/src/spicelib/devices/adms/admst/ngspice.xml
deleted file mode 100644
index 60736a8cb..000000000
--- a/src/spicelib/devices/adms/admst/ngspice.xml
+++ /dev/null
@@ -1,6272 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $e
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- int
- double
- char*
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/* math functions and appropriate derivatives */
-inline double _cos(double arg) { return cos(arg); }
-inline double _d0_cos(double arg) { return (-sin(arg)); }
-inline double _sin(double arg) { return sin(arg); }
-inline double _d0_sin(double arg) { return (cos(arg)); }
-inline double _tan(double arg) { return tan(arg); }
-inline double _d0_tan(double arg) { return (1.0/cos(arg)/cos(arg)); }
-inline double _cosh(double arg) { return cosh(arg); }
-inline double _d0_cosh(double arg) { return (sinh(arg)); }
-inline double _sinh(double arg) { return sinh(arg); }
-inline double _d0_sinh(double arg) { return (cosh(arg)); }
-inline double _tanh(double arg) { return tanh(arg); }
-inline double _d0_tanh(double arg) { return (1.0/cosh(arg)/cosh(arg)); }
-inline double _acos(double arg) { return acos(arg); }
-inline double _d0_acos(double arg) { return (-1.0/sqrt(1-arg*arg)); }
-inline double _asin(double arg) { return asin(arg); }
-inline double _d0_asin(double arg) { return (+1.0/sqrt(1-arg*arg)); }
-inline double _atan(double arg) { return atan(arg); }
-inline double _d0_atan(double arg) { return (+1.0/(1+arg*arg)); }
-inline double _logE(double arg) { return log(arg); }
-inline double _d0_logE(double arg) { return (1.0/arg); }
-inline double _log10(double arg) { return log10(arg); }
-inline double _d0_log10(double arg) { return (1.0/arg/log(10.0)); }
-inline double _exp(double arg) { return exp(arg); }
-inline double _d0_exp(double arg) { return exp(arg); }
-inline double _sqrt(double arg) { return sqrt(arg); }
-inline double _d0_sqrt(double arg) { return (1.0/sqrt(arg)/2.0); }
-inline double _abs(double arg) { return fabs(arg); }
-inline double _d0_abs(double arg) { return (((arg)>=0)?(+1.0):(-1.0)); }
-inline int _floor(double arg) { return floor(arg); }
-inline int _d0_floor(double) { return (1.0); }
-
-inline double _hypot(double x,double y) { return sqrt((x)*(x)+(y)*(y)); }
-inline double _d0_hypot(double x,double y) { return (x)/sqrt((x)*(x)+(y)*(y)); }
-inline double _d1_hypot(double x,double y) { return (y)/sqrt((x)*(x)+(y)*(y)); }
-
-inline double _max(double x,double y) { return ((x)>(y))?(x):(y); }
-inline double _d0_max(double x,double y) { return ((x)>(y))?1.0:0.0; }
-inline double _d1_max(double x,double y) { return ((x)>(y))?0.0:1.0; }
-
-inline double _min(double x,double y) { return ((x)<(y))?(x):(y); }
-inline double _d0_min(double x,double y) { return ((x)<(y))?1.0:0.0; }
-inline double _d1_min(double x,double y) { return ((x)<(y))?0.0:1.0; }
-
-inline double _pow(double x,double y) { return pow(x,y); }
-inline double _d0_pow(double x,double y) { return (x==0.0)?0.0:((y/x)*pow(x,y)); }
-inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0.0))*pow(x,y)); }
-
-inline double _limexp(double arg) { return ((arg)<(80))?(exp(arg)):(exp(80.0)*(1.0+(arg-80))); }
-inline double _d0_limexp(double arg) { return ((arg)<(80))?(exp(arg)):(exp(80.0)); }
-
-inline double _vt(double arg) { return 1.3806503e-23*arg/1.602176462e-19; }
-inline double _d0_vt(double) { return 1.3806503e-23/1.602176462e-19; }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $e
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #if defined(_DYNAMIC)\n
- int %(name);\n
- double %(name)=0.0/0.0;\n
- char* %(name);\n
-
-
-
-
-
-
-
- #endif /*_DYNAMIC*/\n
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- int %(name);\n
- double %(name);\n
- char* %(name);\n
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %(estringifynoprobe(.)/[name='ret']/value)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-//fixme!!! redundant
-#define max(x,y) (((x)>(y))?(x):(y))
-#define min(x,y) (((x)<(y))?(x):(y))
-#define logE(x) log(x)
-
-#define _STATIC
-#define _DYNAMIC
-
-int $(module)temp(GENmodel *inModel, CKTcircuit *ckt)
-{
- register $(module)model *model = ($(module)model*)inModel;
- register $(module)instance *here;
- NG_IGNOREABLE(ckt);
- for ( ; model != NULL; model = model->$(module)nextModel )
- {
-
-
- /* loop through all the instances of the model */
- for (here = model->$(module)instances; here != NULL ; here = here->$(module)nextInstance)
- {
-
-
- } /* End of MOSFET Instance */
- } /* End of Model Instance */
- return(OK);
-}
-
-
-
-
-## Process this file with automake to produce Makefile.in
-
-ADMSXMLINTERFACE=\$(srcdir)/../admst
-
-noinst_LTLIBRARIES = lib$(module).la
-
-BUILT_SOURCES = \\
- $(module).c \\
- $(module).hxx \\
- $(module)acld.c \\
- $(module)ask.c \\
- $(module)itf.h \\
- $(module)del.c \\
- $(module)dest.c \\
- $(module)init.c \\
- $(module)load.c \\
- $(module)mask.c \\
- $(module)mdel.c \\
- $(module)mpar.c \\
- $(module)par.c \\
- $(module)pzld.c \\
- $(module)setup.c \\
- $(module)temp.c \\
- $(module)trunc.c
-
-lib$(module)_la_SOURCES = \\
- \$(BUILT_SOURCES)
-
-CLEANFILES = \\
- \$(BUILT_SOURCES) \\
- .$(module).va.adms \\
- .interface.xml \\
- *.h \\
- *.xml
-
-AM_CPPFLAGS = @AM_CPPFLAGS@ -I\$(top_srcdir)/src/include
-AM_CFLAGS = \$(STATIC)
-
-MAINTAINERCLEANFILES = Makefile.in
-
-%.c %.hxx \\
- %acld.c %ask.c %itf.h %del.c %dest.c \\
- %init.c %load.c %mask.c %mdel.c %mpar.c %par.c \\
- %pzld.c %setup.c %temp.c %trunc.c \\
-: \$(srcdir)/adms3va/%.va \$(ADMSXMLINTERFACE)/prengspice.xml \$(ADMSXMLINTERFACE)/ngspice.xml
- admsXml -I\$(srcdir) -I\$(srcdir)/adms3va -f \$< -e \$(ADMSXMLINTERFACE)/prengspice.xml
- admsXml -I\$(srcdir) -f mna.va -e \$(ADMSXMLINTERFACE)/ngspice.xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-SPICEadmsdev $(module)admsinfo = {
- {
- { "$module",
- "$module created by adms",
- &$(module)nSize,
- &$(module)nSize,
- $(module)names,
- &$(module)pTSize,
- $(module)pTable,
- &$(module)mPTSize,
- $(module)mPTable,
- #ifdef XSPICE
- /*---- Fixed by SDB 5.2.2003 to enable XSPICE/tclspice integration -----*/
- NULL, /* This is a SPICE device, it has no MIF info data */
-
- 0, /* This is a SPICE device, it has no MIF info data */
- NULL, /* This is a SPICE device, it has no MIF info data */
-
- 0, /* This is a SPICE device, it has no MIF info data */
- NULL, /* This is a SPICE device, it has no MIF info data */
-
- 0, /* This is a SPICE device, it has no MIF info data */
- NULL, /* This is a SPICE device, it has no MIF info data */
- /*--------------------------- End of SDB fix -------------------------*/
- #endif
- DEV_DEFAULT
- },
- $(module)par, /* DEVparam */
- $(module)mParam, /* DEVmodParam */
- $(module)load, /* DEVload */
- $(module)setup, /* DEVsetup */
- NULL, /* DEVunsetup */
- $(module)setup, /* DEVpzSetup */
- $(module)temp, /* DEVtemperature */
- $(module)trunc, /* DEVtrunc */
- NULL, /* DEVfindBranch */
- $(module)acLoad, /* DEVacLoad */
- NULL, /* DEVaccept */
- $(module)destroy, /* DEVdestroy */
- $(module)mDelete, /* DEVmodDelete */
- $(module)delete, /* DEVdelete */
- NULL, /* DEVsetic */
- $(module)ask, /* DEVask */
- $(module)mAsk, /* DEVmodAsk */
- $(module)pzLoad, /* DEVpzLoad */
- NULL, /* DEVconvTest */
- NULL, /* DEVsenSetup */
- NULL, /* DEVsenLoad */
- NULL, /* DEVsenUpdate */
- NULL, /* DEVsenAcLoad */
- NULL, /* DEVsenPrint */
- NULL, /* DEVsenTrunc */
- NULL, /* DEVdisto */
- NULL, /* DEVnoise */
-#ifdef CIDER
- NULL, /* DEVdump */
- NULL, /* DEVacct */
-#endif
- &$(module)iSize, /* DEVinstSize */
- &$(module)mSize /* DEVmodSize */
-
- }, /*SPICEdev*/
- NULL, /*mkn*/
- NULL /*mkj*/
-};
-
-SPICEadmsdev *
-get_$(module)_info(void)
-{
- return &$(module)admsinfo;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#ifndef $(module)
-#define $(module)
-
-#include "ngspice/ngspice.h"
-#include "ngspice/devdefs.h"
-#include "ngspice/sperror.h"
-
-#ifndef DEV_$(module)
-#define DEV_$(module)
-
-extern SPICEadmsdev *get_$(module)_info(void);
-
-#endif
-
-#ifndef __$(module)EXT_H
-#define __$(module)EXT_H
-
-
-
-extern int $(module)par(int,IFvalue*,GENinstance*,IFvalue*);
-extern int $(module)mParam(int,IFvalue*,GENmodel*);
-extern int $(module)load(GENmodel*,CKTcircuit*);
-extern int $(module)setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
-extern int $(module)temp(GENmodel*,CKTcircuit*);
-extern int $(module)ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*);
-extern int $(module)mAsk(CKTcircuit*,GENmodel *,int, IFvalue*);
-extern int $(module)acLoad(GENmodel *,CKTcircuit*);
-extern int $(module)convTest(GENmodel *,CKTcircuit*);
-extern int $(module)delete(GENmodel*,IFuid,GENinstance**);
-extern int $(module)getic(GENmodel*,CKTcircuit*);
-extern int $(module)mDelete(GENmodel**,IFuid,GENmodel*);
-extern int $(module)noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
-extern int $(module)pzLoad(GENmodel*,CKTcircuit*,SPcomplex*);
-extern int $(module)trunc(GENmodel*,CKTcircuit*,double*);
-extern int $(module)unsetup(GENmodel*,CKTcircuit*);
-extern void $(module)destroy(GENmodel**);
-
-#endif
-
-#ifndef _$(module)INIT_H
-#define _$(module)INIT_H
-
-extern IFparm $(module)pTable[ ];
-extern IFparm $(module)mPTable[ ];
-extern char *$(module)names[ ];
-extern int $(module)pTSize;
-extern int $(module)mPTSize;
-extern int $(module)nSize;
-extern int $(module)iSize;
-extern int $(module)mSize;
-
-#endif
-
-
-
-#ifdef $(variable)
- #warning conflict: $(variable) is declared as a variable of module '$(module)'.
- #warning conflict: However in the API of ngspice '$(variable)' is also defined as a pragma.
- #warning conflict: Pragma '$(variable)' will be undefined.
- #warning conflict: You can solve the confict by renaming variable '$(variable)' in module '$(module)'.
- #undef $(variable)
-#endif
-
-
-
-#ifdef $(variable)
- #warning conflict: $(node) is declared as a node of module '$(module)'.
- #warning conflict: However in the API of ngspice '$(node)' is also defined as a pragma.
- #warning conflict: Pragma '$(node)' will be undefined.
- #warning conflict: You can solve the confict by renaming variable '$(node)' in module '$(module)'.
- #undef $(variable)
-#endif
-
-
-#ifdef NGSPICE_DEBUG_OK
-#define NGSPICE_DEBUG \\
-{ \\
- if(getenv("ngspice_debug")) \\
- $(module)debug(ckt,model,here); \\
- else \\
- { \\
- printf(" To get more info run your simulation after setting shell variable ngspice_debug to 1\\n"); \\
- printf(" For example in sh shell just type: export ngspice_debug=1\\n"); \\
- } \\
-}
-#else
-#define NGSPICE_DEBUG
-#endif
-
-#define myFREE(x) {if(x) { free(x); (x) = 0; }}
-
-#define EXIT_IF_ISNAN(var) \\
-if(isnan((double) var)) \\
-{ \\
- printf("%s:%i:bug:isnan:"#var"\\n",__FILE__,__LINE__); \\
- printf("Please send this message to laurent.lemaitre@freescale.com\\n"); \\
- NGSPICE_DEBUG \\
- exit(1); /*__asm__ __volatile__ ("int \$03");*/ \\
-} \\
-if(isinf((double) var)) \\
-{ \\
- printf("%s:%i:bug:isinf:"#var"\\n",__FILE__,__LINE__); \\
- printf("Please send this message to laurent.lemaitre@freescale.com\\n"); \\
- NGSPICE_DEBUG \\
- exit(1); /*__asm__ __volatile__ ("int \$03");*/ \\
-}
-
-/* ngspice \$simparam variables
- gdev (1/Ohms): Additional conductance to be added to nonlinear branches for conductance homotopy convergence algorithm.
- gmin (1/Ohms): Minimum conductance placed in parallel with nonlinear branches.
- imax (Amps) : Branch current threshold above which the constitutive relation of a nonlinear branch should be linearized.
- imelt (Amps) : Branch current threshold indicating device failure.
- iteration : Iteration number of the analog solver.
- scale : Scale factor for device instance geometry parameters.
- shrink : Optical linear shrink factor.
- simulatorSubversion : The simulator sub-version.
- simulatorVersion : The simulator version.
- sourceScaleFactor : Multiplicative factor for independent sources for source stepping homotopy convergence algorithm.
- tnom degrees (Celsius): Default value of temperature at which model parameters were extracted.
-*/
-
-#define _circuit_gdev ckt->CKTgmin
-#define _circuit_gmin ((ckt->CKTgmin)>(ckt->CKTdiagGmin))?(ckt->CKTgmin):(ckt->CKTdiagGmin)
-#define _circuit_imax 1.0
-#define _circuit_imelt 1.0
-#define _circuit_iteration 1.0
-#define _circuit_scale 1.0
-#define _circuit_shrink 1.0
-#define _circuit_simulatorSubversion 0
-#define _circuit_simulatorVersion 3.5
-#define _circuit_sourceScaleFactor 1.0
-#define _circuit_tnom ckt->CKTnomTemp
-
-#define _circuit_temp ckt->CKTtemp
-#define _scale 1.0
-
-#define _cos(val,arg) val = cos(arg);
-#define _d_cos(val,dval,arg) val = cos(arg); dval = (-sin(arg));
-#define _sin(val,arg) val = sin(arg);
-#define _d_sin(val,dval,arg) val = sin(arg); dval = (cos(arg));
-#define _tan(val,arg) val = tan(arg);
-#define _d_tan(val,dval,arg) val = tan(arg); dval = (1.0/cos(arg)/cos(arg));
-#define _hypot(xy,x,y) xy = sqrt((x)*(x)+(y)*(y));
-#define _dx_hypot(dx,xy,x,y) dx = (x)/(xy);
-#define _dy_hypot(dy,xy,x,y) dy = (y)/(xy);
-#define _max(xy,x,y) xy = ((x)>(y))?(x):(y);
-#define _dx_max(dx,xy,x,y) dx = ((x)>(y))?1.0:0.0;
-#define _dy_max(dy,xy,x,y) dy = ((x)>(y))?0.0:1.0;
-#define _min(xy,x,y) xy = ((x)<(y))?(x):(y);
-#define _dx_min(dx,xy,x,y) dx = ((x)<(y))?1.0:0.0;
-#define _dy_min(dy,xy,x,y) dy = ((x)<(y))?0.0:1.0;
-#define _cosh(val,arg) val = cosh(arg);
-#define _d_cosh(val,dval,arg) val = cosh(arg); dval = (sinh(arg));
-#define _sinh(val,arg) val = sinh(arg);
-#define _d_sinh(val,dval,arg) val = sinh(arg); dval = (cosh(arg));
-#define _tanh(val,arg) val = tanh(arg);
-#define _d_tanh(val,dval,arg) val = tanh(arg); dval = (1.0/cosh(arg)/cosh(arg));
-#define _acos(val,arg) val = acos(arg);
-#define _d_acos(val,dval,arg) val = acos(arg); dval = (-1.0/sqrt(1-arg*arg));
-#define _asin(val,arg) val = asin(arg);
-#define _d_asin(val,dval,arg) val = asin(arg); dval = (+1.0/sqrt(1-arg*arg));
-#define _atan(val,arg) val = atan(arg);
-#define _d_atan(val,dval,arg) val = atan(arg); dval = (+1.0/(1+arg*arg));
-#define _logE(val,arg) val = log(arg);
-#define _d_logE(val,dval,arg) val = log(arg); dval = (1.0/arg);
-#define _log10(val,arg) val = log10(arg);
-#define _d_log10(val,dval,arg) val = log10(arg); dval = (1.0/arg/log(10));
-#define _exp(val,arg) val = exp(arg);
-#define _d_exp(val,dval,arg) val = exp(arg); dval = val;
-#define _sqrt(val,arg) val = sqrt(arg);
-#define _d_sqrt(val,dval,arg) val = sqrt(arg); dval = (1.0/val/2.0);
-#define _pow(xy,x,y) xy = pow(x,y);
-#define _dx_pow(dx,xy,x,y) dx = (x==0.0)?0.0:((y/x)*xy);
-#define _dy_pow(dy,xy,x,y) dy = (x==0.0)?0.0:((log(x)/exp(0.0))*xy);
-
-#define _div1(x,y) ((x)/(y))
-#define _div0(xy,x,y) xy=(x)/(y);
-#define _div(xy,dx,x,y) dx=1/(y); xy=(x)*dx;
-#define _dx_div(dx,xy,x,y)
-#define _dy_div(dy,dx,xy,x,y) dy = -xy*dx;
-
-#define _limexp(val,arg) val = ((arg)<(90)) ? (exp(arg)) : (exp(90)*(1.0+(arg-90)));
-#define _d_limexp(val,dval,arg) val = ((arg)<(90)) ? (exp(arg)) : (exp(90)*(1.0+(arg-90))); dval = val;
-#define _fabs(val,arg) val = fabs(arg);
-#define _d_fabs(val,dval,arg) val = fabs(arg); dval = (((val)>=0)?(+1.0):(-1.0));
-#define _abs(val) ((val)<(0) ? (-(val)):(val))
-
-/* declarations for $(module) MOSFETs */
-
-/* information needed for each instance */
-typedef struct s$(module)instance {
- struct s$(module)model *$(module)modPtr; /* pointer to model */
- struct s$(module)instance *$(module)nextInstance; /* pointer to next instance of current model*/
- IFuid $(module)name; /* pointer to character string naming this instance */
- int $(module)state; /* index into state table for this device */
-
- /* node */
-
-
-
-
-
- /* instance parameters */
-
-
-
-
-
-
-
- // noise\n
-
-
-
-
- /* variables */
-
-
-
-
-
- /* states */
-
- /* pointer to sparse matrix (+ values)*/
-
-
-
-
-
-
-
-#define $(module)numStates 0
-
-} $(module)instance ;
-
-
-/* per model data */
-
-typedef struct s$(module)model { /* model structure */
- int $(module)modType; /* type index of this device type */
- struct s$(module)model *$(module)nextModel; /* pointer to next possible model in linked list */
- $(module)instance * $(module)instances; /* pointer to list of instances that have this model */
- IFuid $(module)modName; /* pointer to the name of this model */
-
- /* model parameters */
-
-
-
-
-
-
-
- /* variable */
-
-
-
-
-
-
-} $(module)model;
-
-
-
-
-
-
-
-
-
-
-
-
-#endif /*$(module)*/
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)ask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select)
-{
- $(module)instance *instance = ($(module)instance*)inst;
- NG_IGNOREABLE(ckt);
- NG_IGNOREABLE(value);
- NG_IGNOREABLE(select);
- NG_IGNOREABLE(instance);
- switch (which) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- default:
- return(-1);
- }
- return(-1);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)mAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value)
-{
- $(module)model *model = ($(module)model *)inst;
- NG_IGNOREABLE(ckt);
- switch (which) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- default:
- return(-1);
- }
- return(-1);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)par(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
-{
- $(module)instance *myinstance = ($(module)instance*)inst;
- NG_IGNOREABLE(value);
- NG_IGNOREABLE(select);
- NG_IGNOREABLE(myinstance);
- switch (param) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- default:
- return(-1);
- }
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)mParam(int param, IFvalue *value, GENmodel *inMod)
-{
- $(module)model *mod = ($(module)model*)inMod;
- switch (param) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- default:
- return(-1);
- }
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-#define NGSPICE_DEBUG_OK
-
-
-
-#include "$(module)itf.h"
-
-#define ccap qcap+1
-static int my$(module)NIintegrate(CKTcircuit *ckt, double *geq, double *ceq, double cap, int qcap)
-{
- static char *ordmsg = "Illegal integration order";
- static char *methodmsg = "Unknown integration method";
- char *errMsg; //fixme cest une globale dans ngspice!!!!
- #define myTMALLOC(t,n) (t*) malloc(sizeof(t) * (size_t)(n))
-
- switch(ckt->CKTintegrateMethod) {
-
- case TRAPEZOIDAL:
- switch(ckt->CKTorder) {
- case 1:
- *(ckt->CKTstate0+ccap) = ckt->CKTag[0] * (*(ckt->CKTstate0+qcap))
- + ckt->CKTag[1] * (*(ckt->CKTstate1+qcap));
- break;
- case 2:
- *(ckt->CKTstate0+ccap) = - *(ckt->CKTstate1+ccap) * ckt->CKTag[1] +
- ckt->CKTag[0] *
- ( *(ckt->CKTstate0+qcap) - *(ckt->CKTstate1+qcap) );
- break;
- default:
- errMsg = myTMALLOC(char, strlen(ordmsg) + 1);
- strcpy(errMsg,ordmsg);
- return(E_ORDER);
- }
- break;
- case GEAR:
- *(ckt->CKTstate0+ccap)=0;
- switch(ckt->CKTorder) {
-
- case 6:
- *(ckt->CKTstate0+ccap) += ckt->CKTag[6]* *(ckt->CKTstate6+qcap);
- /* fall through */
- case 5:
- *(ckt->CKTstate0+ccap) += ckt->CKTag[5]* *(ckt->CKTstate5+qcap);
- /* fall through */
- case 4:
- *(ckt->CKTstate0+ccap) += ckt->CKTag[4]* *(ckt->CKTstate4+qcap);
- /* fall through */
- case 3:
- *(ckt->CKTstate0+ccap) += ckt->CKTag[3]* *(ckt->CKTstate3+qcap);
- /* fall through */
- case 2:
- *(ckt->CKTstate0+ccap) += ckt->CKTag[2]* *(ckt->CKTstate2+qcap);
- /* fall through */
- case 1:
- *(ckt->CKTstate0+ccap) += ckt->CKTag[1]* *(ckt->CKTstate1+qcap);
- *(ckt->CKTstate0+ccap) += ckt->CKTag[0]* *(ckt->CKTstate0+qcap);
- break;
-
- default:
- return(E_ORDER);
-
- }
- break;
-
- default:
- errMsg = myTMALLOC(char, strlen(methodmsg) + 1);
- strcpy(errMsg,methodmsg);
- return(E_METHOD);
- }
- *ceq = *(ckt->CKTstate0+ccap) - ckt->CKTag[0] * *(ckt->CKTstate0+qcap);
- *geq = ckt->CKTag[0] * cap;
- return(OK);
-}
-
-/*fixme: noise not implemented in ngspice*/
-#define ngspice_flickernoise(p,n,mag,freq,info)\\
-{\\
-}
-#define ngspice_whitenoise(p,n,mag,info)\\
-{\\
-}
-
-#define voltages(p) *(ckt->CKTrhsOld+here->p ## Node)
-#define BP(p,n) (voltages(p)-voltages(n))
-#define DBGNODE(p) printf(#p "=%i - v=%e\\n",here->p ## Node,voltages(p));
-
-
-
-#define _STATIC
-#define _DYNAMIC
-#define _DERIVATE
-
-#define _load_static_residual2(p,n,v)\\
- *(ckt->CKTrhs+here->p ## Node)-=v;\\
- *(ckt->CKTrhs+here->n ## Node)+=v;
-#define _load_static_residual1(p,v)\\
- *(ckt->CKTrhs+here->p ## Node)-=v;
-
-#define _load_static_jacobian4(Sp,Sn,Pp,Pn,v)\\
- _load_static_residual2(Sp,Sn,-v*BP(Pp,Pn))\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=v;\\
- *(here->PTR_J_ ## Sn ## _ ## Pn)+=v;\\
- *(here->PTR_J_ ## Sp ## _ ## Pn)-=v;\\
- *(here->PTR_J_ ## Sn ## _ ## Pp)-=v;\\
- (here->JSVAL_ ## Sp ## _ ## Pp)+=v;\\
- (here->JSVAL_ ## Sn ## _ ## Pn)+=v;\\
- (here->JSVAL_ ## Sp ## _ ## Pn)-=v;\\
- (here->JSVAL_ ## Sn ## _ ## Pp)-=v;
-#define _load_static_jacobian2s(Sp,Sn,Pp,v)\\
- _load_static_residual2(Sp,Sn,-v*voltages(Pp))\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=v;\\
- *(here->PTR_J_ ## Sn ## _ ## Pp)-=v;\\
- (here->JSVAL_ ## Sp ## _ ## Pp)+=v;\\
- (here->JSVAL_ ## Sn ## _ ## Pp)-=v;
-#define _load_static_jacobian2p(Sp,Pp,Pn,v)\\
- _load_static_residual1(Sp,-v*BP(Pp,Pn))\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=v;\\
- *(here->PTR_J_ ## Sp ## _ ## Pn)-=v;\\
- (here->JSVAL_ ## Sp ## _ ## Pp)+=v;\\
- (here->JSVAL_ ## Sp ## _ ## Pn)-=v;
-#define _load_static_jacobian1(Sp,Pp,v)\\
- _load_static_residual1(Sp,-v*voltages(Pp))\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=v;\\
- (here->JSVAL_ ## Sp ## _ ## Pp)+=v;
-
-#define _load_dynamic_residual2(p,n,v)\\
-if(ChargeComputationNeeded)\\
-{\\
- int error;\\
- double unused;\\
- *(ckt->CKTstate0+here->state_##p##_##n)=v;\\
- if(ckt->CKTmode & MODEINITTRAN)\\
- *(ckt->CKTstate1+here->state_##p##_##n)=*(ckt->CKTstate0+here->state_##p##_##n);\\
- error = my$(module)NIintegrate(ckt,&unused,&unused,0.0,here->state_##p##_##n);\\
- if(error) return(error);\\
- if(ckt->CKTmode & MODEINITTRAN)\\
- *(ckt->CKTstate1+here->state_##p##_##n+1) = *(ckt->CKTstate0+here->state_##p##_##n+1);\\
- *(ckt->CKTrhs+here->p##Node)-=*(ckt->CKTstate0+here->state_##p##_##n+1);\\
- *(ckt->CKTrhs+here->n##Node)+=*(ckt->CKTstate0+here->state_##p##_##n+1);\\
-}
-#define _load_dynamic_residual1(p,v)\\
-if(ChargeComputationNeeded)\\
-{\\
- int error;\\
- double unused;\\
- *(ckt->CKTstate0+here->state_##p##_GND)=v;\\
- if(ckt->CKTmode & MODEINITTRAN)\\
- *(ckt->CKTstate1+here->state_##p##_GND)=*(ckt->CKTstate0+here->state_##p##_GND);\\
- error = my$(module)NIintegrate(ckt,&unused,&unused,0.0,here->state_##p##_GND);\\
- if(error) return(error);\\
- if(ckt->CKTmode & MODEINITTRAN)\\
- *(ckt->CKTstate1+here->state_##p##_GND+1) = *(ckt->CKTstate0+here->state_##p##_GND+1);\\
- *(ckt->CKTrhs+here->p##Node)-=*(ckt->CKTstate0+here->state_##p##_GND+1);\\
-}
-
-#define _load_dynamic_jacobian4(Sp,Sn,Pp,Pn,v)\\
-if(ChargeComputationNeeded)\\
-{\\
- double geq=(v)*ckt->CKTag[0];\\
- double ceq=geq*BP(Pp,Pn);\\
- *(ckt->CKTrhs+here->Sp##Node)+=ceq;\\
- *(ckt->CKTrhs+here->Sn##Node)-=ceq;\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=geq;\\
- *(here->PTR_J_ ## Sn ## _ ## Pn)+=geq;\\
- *(here->PTR_J_ ## Sp ## _ ## Pn)-=geq;\\
- *(here->PTR_J_ ## Sn ## _ ## Pp)-=geq;\\
-}\\
- (here->JDVAL_ ## Sp ## _ ## Pp)+=v;\\
- (here->JDVAL_ ## Sn ## _ ## Pn)+=v;\\
- (here->JDVAL_ ## Sp ## _ ## Pn)-=v;\\
- (here->JDVAL_ ## Sn ## _ ## Pp)-=v;
-#define _load_dynamic_jacobian2s(Sp,Sn,Pp,v)\\
-if(ChargeComputationNeeded)\\
-{\\
- double geq=(v)*ckt->CKTag[0];\\
- double ceq=geq*voltages(Pp);\\
- *(ckt->CKTrhs+here->Sp##Node)+=ceq;\\
- *(ckt->CKTrhs+here->Sn##Node)-=ceq;\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=geq;\\
- *(here->PTR_J_ ## Sn ## _ ## Pp)-=geq;\\
-}\\
- (here->JDVAL_ ## Sp ## _ ## Pp)+=v;\\
- (here->JDVAL_ ## Sn ## _ ## Pp)-=v;
-#define _load_dynamic_jacobian2p(Sp,Pp,Pn,v)\\
-if(ChargeComputationNeeded)\\
-{\\
- double geq=(v)*ckt->CKTag[0];\\
- double ceq=geq*BP(Pp,Pn);\\
- *(ckt->CKTrhs+here->Sp##Node)+=ceq;\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=geq;\\
- *(here->PTR_J_ ## Sp ## _ ## Pn)-=geq;\\
-}\\
- (here->JDVAL_ ## Sp ## _ ## Pp)+=v;\\
- (here->JDVAL_ ## Sp ## _ ## Pn)-=v;
-#define _load_dynamic_jacobian1(Sp,Pp,v)\\
-if(ChargeComputationNeeded)\\
-{\\
- double geq=(v)*ckt->CKTag[0];\\
- double ceq=geq*voltages(Pp);\\
- *(ckt->CKTrhs+here->Sp##Node)+=ceq;\\
- *(here->PTR_J_ ## Sp ## _ ## Pp)+=geq;\\
-}\\
-(here->JDVAL_ ## Sp ## _ ## Pp)+=v;
-
-int $(module)load(GENmodel *inModel, CKTcircuit *ckt)
- /* actually load the current value into the
- * sparse matrix previously provided
- */
-{
- register $(module)model *model = ($(module)model*)inModel;
- register $(module)instance *here;
- int ChargeComputationNeeded =
- ((ckt->CKTmode & (MODEAC | MODETRAN | MODEINITSMSIG)) ||
- ((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)))
- ? 1 : 0;
-
- for ( ; model != NULL; model = model->$(module)nextModel )
- {
- /* loop through all the instances of the model */
- for (here = model->$(module)instances; here != NULL ; here = here->$(module)nextInstance)
- {
-{
-
-
-}
-{
-#include "$module.hxx"
-}
- } /* End of Instance */
- } /* End of Model */
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)acLoad(GENmodel *inModel, CKTcircuit *ckt)
-{
- register $(module)model *model = ($(module)model*)inModel;
- register $(module)instance *here;
- for ( ; model != NULL; model = model->$(module)nextModel )
- {
- /* loop through all the instances of the model */
- for (here = model->$(module)instances; here != NULL ; here = here->$(module)nextInstance)
- {
-
-
- } /* End of MOSFET Instance */
- } /* End of Model Instance */
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s)
-{
- register $(module)model *model = ($(module)model*)inModel;
- register $(module)instance *here;
- NG_IGNOREABLE(ckt);
- for ( ; model != NULL; model = model->$(module)nextModel )
- {
- /* loop through all the instances of the model */
- for (here = model->$(module)instances; here != NULL ; here = here->$(module)nextInstance)
- {
-
-
-
- } /* End of MOSFET Instance */
- } /* End of Model Instance */
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-#define ccap (qcap+1)
-static void my$(module)CKTterr(int qcap, CKTcircuit *ckt, double *timeStep)
-{
- double volttol;
- double chargetol;
- double tol;
- double del;
- double diff[8];
- double deltmp[8];
- double factor=0;
- int i;
- int j;
- static double gearCoeff[] = {
- .5,
- .2222222222,
- .1363636364,
- .096,
- .07299270073,
- .05830903790
- };
- static double trapCoeff[] = {
- .5,
- .08333333333
- };
-
- volttol = ckt->CKTabstol + ckt->CKTreltol *
- MAX( fabs(*(ckt->CKTstate0+ccap)), fabs(*(ckt->CKTstate1+ccap)));
-
- chargetol = MAX(fabs(*(ckt->CKTstate0 +qcap)),fabs(*(ckt->CKTstate1+qcap)));
- chargetol = ckt->CKTreltol * MAX(chargetol,ckt->CKTchgtol)/ckt->CKTdelta;
- tol = MAX(volttol,chargetol);
- /* now divided differences */
- for(i=ckt->CKTorder+1;i>=0;i--) {
- diff[i] = *(ckt->CKTstates[i] + qcap);
- }
- for(i=0 ; i <= ckt->CKTorder ; i++) {
- deltmp[i] = ckt->CKTdeltaOld[i];
- }
- j = ckt->CKTorder;
- for (;;) {
- for(i=0;i <= j;i++) {
- diff[i] = (diff[i] - diff[i+1])/deltmp[i];
- }
- if (--j < 0) break;
- for(i=0;i <= j;i++) {
- deltmp[i] = deltmp[i+1] + ckt->CKTdeltaOld[i];
- }
- }
- switch(ckt->CKTintegrateMethod) {
- case GEAR:
- factor = gearCoeff[ckt->CKTorder-1];
- break;
-
- case TRAPEZOIDAL:
- factor = trapCoeff[ckt->CKTorder - 1] ;
- break;
- }
- del = ckt->CKTtrtol * tol/MAX(ckt->CKTabstol,factor * fabs(diff[0]));
- if(ckt->CKTorder == 2) {
- del = sqrt(del);
- } else if (ckt->CKTorder > 2) {
- del = exp(log(del)/ckt->CKTorder);
- }
- *timeStep = MIN(*timeStep,del);
- return;
-}
-
-
-int $(module)trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep)
-{
- register $(module)model *model = ($(module)model*)inModel;
- register $(module)instance *here;
-
-#ifdef STEPDEBUG
- double debugtemp;
-#endif /* STEPDEBUG */
-
- for ( ; model != NULL; model = model->$(module)nextModel )
- {
- /* loop through all the instances of the model */
- for (here = model->$(module)instances; here != NULL ; here = here->$(module)nextInstance)
- {
-#ifdef STEPDEBUG
- debugtemp = *timeStep;
-#endif /* STEPDEBUG */
-
-
- my$(module)CKTterr(here->state_%(pnode/name)_%(nnode/name), ckt, timeStep);
-
-
-
-#ifdef STEPDEBUG
- if(debugtemp != *timeStep)
- { printf("device %s reduces step from %g to %g\\n",
- here->$(module)name,debugtemp,*timeStep);
- }
-#endif /* STEPDEBUG */
-
- } /* End of Instance */
- } /* End of Model */
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-//fixme!!! redundant
-#define max(x,y) (((x)>(y))?(x):(y))
-#define min(x,y) (((x)<(y))?(x):(y))
-#define logE(x) log(x)
-
-int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
- /* load the $(module) device structure with those pointers needed later
- * for fast matrix loading
- */
-{
- register $(module)model *model = ($(module)model*)inModel;
- register $(module)instance *here;
-typedef int FP1(CKTcircuit *ckt, CKTnode **node, IFuid basename, char *suffix);
-typedef double * FP2(SMPmatrix *Matrix, int Row, int Col);
- FP1 *myCKTmkVolt = get_$(module)_info()->mkn;
- FP2 *mySMPmakeElt = get_$(module)_info()->mkj;
-
- /* loop through all the $(module) device models */
- for ( ;model != NULL ;model = model->$(module)nextModel )
- {
-
-
-
-
-
-
- if(model->%(name)_Given == FALSE) model->%(name)=%(estringifynoprobe(default)/[name='ret']/value);
-
-
- for ( here = model->$(module)instances ;here != NULL ; here = here->$(module)nextInstance )
- {
-
-
-
-
-
-
- if(here->%(name)_Given == FALSE) here->%(name)=%(estringifynoprobe(default)/[name='ret']/value);
-
-
-
- /* Internal Nodes */
- {
-
-
-
-
-
- here->%(name)Node = -1;
-
- }
-
- /* set states */
-
- here->state_%(pnode/name)_%(nnode/name) = *states; *states += 2;
-
- /* set Sparse Matrix Pointers */
-
- here->PTR_J_%(#row/name)_%(#column/name)_required=1;
-
-
- /* Internal Nodes */
- {
- int error;
- CKTnode *tmp;
-
-
-
-
-
- if(here->%(name)Node == -1)
- {
- error=myCKTmkVolt(ckt,&tmp,here->$(module)name,"$info");
- if(error) return(error);
- here->%(name)Node = tmp->number;
- }
-
- }
-
- if(here->PTR_J_%(#row/name)_%(#column/name)_required==1)
- {
- here->PTR_J_%(#row/name)_%(#column/name)=mySMPmakeElt(matrix,here->%(#row/name)Node,here->%(#column/name)Node);
- }
-
-
- }
- }
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
-
-{
- register $(module)model *model = ($(module)model*)inModel;
- register $(module)instance **fast =($(module)instance**)inInst;
-
- $(module)instance **prev = NULL;
- $(module)instance *here;
-
- for ( ; model ; model = model->$(module)nextModel ) {
- prev = &(model->$(module)instances);
- for (here = *prev; here ; here = *prev) {
- if(here->$(module)name == name || (fast && here==*fast) ) {
- *prev = here->$(module)nextInstance;
- myFREE(here);
- return(OK);
- }
-
- }
- }
- return(E_NODEV);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-int $(module)mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
-
-{
- register $(module)model **model = ($(module)model**)inModel;
- register $(module)model *modfast =($(module)model*)kill;
- $(module)instance *here;
- $(module)instance *prev = NULL;
- $(module)model **oldmod;
-
- oldmod = model;
- for ( ; *model ; model = &((*model)->$(module)nextModel)) {
- if ((*model)->$(module)modName == modname ||
- (modfast && *model == modfast))
- goto delgot;
- oldmod = model;
- }
- return(E_NOMOD);
-
- delgot:
- *oldmod = (*model)->$(module)nextModel; /* cut deleted device out of list */
- for (here = (*model)->$(module)instances; here; here = here->$(module)nextInstance)
- { if(prev) myFREE(prev);
- prev = here;
- }
- if(prev) myFREE(prev);
- myFREE(*model);
- return(OK);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-void $(module)destroy(GENmodel **inModel)
-
-{
- register $(module)model **model = ($(module)model**)inModel;
- register $(module)instance *here;
- $(module)instance *prev = NULL;
- $(module)model *mod = *model;
- $(module)model *oldmod = NULL;
-
- for ( ; mod ; mod = mod->$(module)nextModel ) {
- if (oldmod) myFREE(oldmod);
- oldmod = mod;
- prev = ($(module)instance *)NULL;
- for (here = mod->$(module)instances; here ; here = here->$(module)nextInstance) {
- if(prev) myFREE(prev);
- prev = here;
- }
- if(prev) myFREE(prev);
- }
- if(oldmod) myFREE(oldmod);
- *model = NULL;
- return;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#include "$(module)itf.h"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-char *$(module)names[] = {
-
-
-
-
-
-
-
-
-
-
-};
-
-int $(module)nSize = NUMELEMS($(module)names);
-int $(module)pTSize = NUMELEMS($(module)pTable);
-int $(module)mPTSize = NUMELEMS($(module)mPTable);
-int $(module)iSize = sizeof($(module)instance);
-int $(module)mSize = sizeof($(module)model);
-
-
-
-
-
-
-
-
-
-
-
-/* arithmetics */
-#define EXP90 1.220403294317841e+039
-#define m00_hypot(v00,x,y) v00 = sqrt((x)*(x)+(y)*(y));
-#define m10_hypot(v10,v00,x,y) v10 = (x)/(v00);
-#define m11_hypot(v11,v00,x,y) v11 = (y)/(v00);
-#define m00_max(v00,x,y) v00 = ((x)>(y))?(x):(y);
-#define m10_max(v10,v00,x,y) v10 = ((x)>(y))?1.0:0.0;
-#define m11_max(v11,v00,x,y) v11 = ((x)>(y))?0.0:1.0;
-#define m00_min(v00,x,y) v00 = ((x)<(y))?(x):(y);
-#define m10_min(v10,v00,x,y) v10 = ((x)<(y))?1.0:0.0;
-#define m11_min(v11,v00,x,y) v11 = ((x)<(y))?0.0:1.0;
-#define m00_pow(v00,x,y) v00 = pow(x,y);
-#define m10_pow(v10,v00,x,y) v10 = (x==0.0)?0.0:(v00)*(y)/(x);
-#define m11_pow(v11,v00,x,y) v11 = (x==0.0)?0.0:(log(x)*(v00));
-#define m00_div(v00,v10,x,y) double v10=1/(y); double v00=(x)*v10;
-#define m10_div(v10,v00,vv,x,y)
-#define m11_div(v11,v00,vv,x,y) double v11 = -v00*vv;
-#define m00_mult(v00,v10,v11,x,y) double v10=(x); double v11=(y); double v00=v10*v11;
-#define m00_add(v00,x,y) double v00=(x)+(y);
-#define m00_cos(v00,x) v00 = cos(x);
-#define m10_cos(v10,v00,x) v10 = (-sin(x));
-#define m00_sin(v00,x) v00 = sin(x);
-#define m10_sin(v10,v00,x) v10 = (cos(x));
-#define m00_tan(v00,x) v00 = tan(x);
-#define m10_tan(v10,v00,x) v10 = (1.0/cos(x)/cos(x));
-#define m00_cosh(v00,x) v00 = cosh(x);
-#define m10_cosh(v10,v00,x) v10 = (sinh(x));
-#define m00_sinh(v00,x) v00 = sinh(x);
-#define m10_sinh(v10,v00,x) v10 = (cosh(x));
-#define m00_tanh(v00,x) v00 = tanh(x);
-#define m10_tanh(v10,v00,x) v10 = (1.0/cosh(x)/cosh(x));
-#define m00_acos(v00,x) v00 = acos(x);
-#define m10_acos(v10,v00,x) v10 = (-1.0/sqrt(1-x*x));
-#define m00_asin(v00,x) v00 = asin(x);
-#define m10_asin(v10,v00,x) v10 = (+1.0/sqrt(1-x*x));
-#define m00_atan(v00,x) v00 = atan(x);
-#define m10_atan(v10,v00,x) v10 = (+1.0/(1+x*x));
-#define m00_logE(v00,x) v00 = log(x);
-#define m10_logE(v10,v00,x) v10 = (1.0/x);
-#define m00_log10(v00,x) v00 = log10(x);
-#define m10_log10(v10,v00,x) v10 = (1.0/x/log(10));
-#define m00_sqrt(v00,x) v00 = sqrt(x);
-#define m10_sqrt(v10,v00,x) v10 = (1.0/((v00>0)?(2.0*v00):1.0E+38));
-#define m00_fabs(v00,x) v00 = fabs(x);
-#define m10_fabs(v10,v00,x) v10 = (((x)>=0)?(+1.0):(-1.0));
-#define m00_exp(v00,x) v00 = exp(x);
-#define m10_exp(v10,v00,x) v10 = v00;
-#define m00_abs(v00) ((v00)<(0)?(-(v00)):(v00))
-#define m00_limexp(v00,x) v00 = ((x)<90.0?exp(x):EXP90*(x-89.0));
-#define m10_limexp(v10,v00,x) v10 = ((x)<90.0?(v00):EXP90);
-
-#define m20_logE(v00) (-1.0/v00/v00)
-#define m20_exp(v00) exp(v00)
-#define m20_limexp(v00) ((v00)<90.0?exp(v00):0.0)
-#define m20_sqrt(v00) (-0.25/(v00)/sqrt(v00))
-#define m20_fabs(v00) 0.0
-
-
-
-/*wrapper*/
-#define pModel model
-#define pInst here
-#define mint_get_circuit_tempK() _circuit_temp
-#define _DDT(q) q
-#define _DDX
-#define _DERIVATEFORDDX
-
-#define _DERIVATE2
-
-
-
-
-inline double _cos(double arg) { return cos(arg); }
-inline double _d0_cos(double arg) { return (-sin(arg)); }
-inline double _sin(double arg) { return sin(arg); }
-inline double _d0_sin(double arg) { return (cos(arg)); }
-inline double _tan(double arg) { return tan(arg); }
-inline double _d0_tan(double arg) { return (1.0/cos(arg)/cos(arg)); }
-inline double _cosh(double arg) { return cosh(arg); }
-inline double _d0_cosh(double arg) { return (sinh(arg)); }
-inline double _sinh(double arg) { return sinh(arg); }
-inline double _d0_sinh(double arg) { return (cosh(arg)); }
-inline double _tanh(double arg) { return tanh(arg); }
-inline double _d0_tanh(double arg) { return (1.0/cosh(arg)/cosh(arg)); }
-inline double _acos(double arg) { return acos(arg); }
-inline double _d0_acos(double arg) { return (-1.0/sqrt(1-arg*arg)); }
-inline double _asin(double arg) { return asin(arg); }
-inline double _d0_asin(double arg) { return (+1.0/sqrt(1-arg*arg)); }
-inline double _atan(double arg) { return atan(arg); }
-inline double _d0_atan(double arg) { return (+1.0/(1+arg*arg)); }
-inline double _logE(double arg) { return log(arg); }
-inline double _d0_logE(double arg) { return (1.0/arg); }
-inline double _log10(double arg) { return log10(arg); }
-inline double _d0_log10(double arg) { return (1.0/arg/log(10)); }
-inline double _exp(double arg) { return exp(arg); }
-inline double _d0_exp(double arg) { return exp(arg); }
-inline double _sqrt(double arg) { return sqrt(arg); }
-inline double _d0_sqrt(double arg) { return (1.0/sqrt(arg)/2.0); }
-inline double _abs(double arg) { return fabs(arg); }
-inline double _d0_abs(double arg) { return (((arg)>=0)?(+1.0):(-1.0)); }
-
-inline double _hypot(double x,double y) { return sqrt((x)*(x)+(y)*(y)); }
-inline double _d0_hypot(double x,double y) { return (x)/sqrt((x)*(x)+(y)*(y)); }
-inline double _d1_hypot(double x,double y) { return (y)/sqrt((x)*(x)+(y)*(y)); }
-
-inline double _max(double x,double y) { return ((x)>(y))?(x):(y); }
-inline double _d0_max(double x,double y) { return ((x)>(y))?1.0:0.0; }
-inline double _d1_max(double x,double y) { return ((x)>(y))?0.0:1.0; }
-
-inline double _min(double x,double y) { return ((x)<(y))?(x):(y); }
-inline double _d0_min(double x,double y) { return ((x)<(y))?1.0:0.0; }
-inline double _d1_min(double x,double y) { return ((x)<(y))?0.0:1.0; }
-
-inline double _pow(double x,double y) { return pow(x,y); }
-inline double _d0_pow(double x,double y) { return (x==0.0)?0.0:((y/x)*pow(x,y)); }
-inline double _d1_pow(double x,double y) { return (x==0.0)?0.0:((log(x)/exp(0.0))*pow(x,y)); }
-
-#define _limexp(arg) _exp(val,arg)
-#define _d_limexp(arg) _d_exp(val,dval,arg)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- printf(
- _warning(
- _error(
- _finish(
- _stop(
-
-
-
-
-
- %(e(.))
- "\\n"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/spicelib/devices/adms/admst/prengspice.xml b/src/spicelib/devices/adms/admst/prengspice.xml
deleted file mode 100644
index 6a6be04f2..000000000
--- a/src/spicelib/devices/adms/admst/prengspice.xml
+++ /dev/null
@@ -1,782 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %(.)\n
-
-
-
-
- %(.)\n
-
-
-
-
-
-
-
-
-
-
-
-
-`define ddt(v) 0.0\n
-`define flicker_noise(m,p,txt) 0.0\n
-`define white_noise(m,txt) 0.0\n
- (*%(.)*)
-module %(name)
- (%(name));\n
-
- (*%(.)*)
- inout %(name);\n
-
-
-
- %(pass0:tnode(modulecode/tnode))
-
-
-
-
-
-
-
-
-
-
-
- \n
- %(.)
-
-
-
-
- `define _af$name(id,$name,
- %(name)
- ) \\\n
-
- %(type|' '|name); \\\n
-
- %(pass2:tnode(value/functionpcode/tnode))
-
-
-
-
-
-
-
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////////////////////////////////////\n
-
-
-
- %(pass2:tnode(modulecode/tnode))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %(value)
- //%(value)
-
- %(([#dependency!='constant']/'//')|'if('|value/ifcondition|')'|/#eol)
- %(pass1:tnode(value/thencode/tnode))
- %([#dependency!='constant']/'//')else%(/#eol)%(pass1:tnode(value/elsecode/tnode))
-
-
-
-
-
- %(value)
- begin %(value/(lhs/name|'_'|../#id|'='|rhs)); %(value/lhs/(name|'='|name))_%(#id); end%(/#eol)
- //%(value)
-
-
-
-
- ;//aaaaaa %(value)
-
- %(value)
-
-
-
-
-
-
-
-
-
- %(pass1:tnode(down))
-
-
-
-
-
-
-
-
-
-
- `_af%(value/name)(id%(value/name)%(#id),%(value/name)%(#id),%(pass2:tnode(tnode))
- )%(/#eol)
-
-
-
-
-
-
- I(q%(#ddtnode/#id))<+ddt(%(pass2:tnode(.)));\n
- I(q%(#ddtnode/#id))<+-V(q%(#ddtnode/#id));\n
-
-
-
-
-
-
-
- (*%(value)*)
-
-
-
-
-
-
-
-
-
- %(pass2:tnode(value/ifcondition/tnode)))%(/#eol)
- %(pass2:tnode(value/thencode/tnode))
- else%(/#eol)%(pass2:tnode(value/elsecode/tnode))
-
-
-
-
-
- %(value/lhs/name)=%(value/lhs/name)_%(#id);%(/#eol)
- %(value/lhs/name)=%(pass2:tnode(value/rhs/tnode));%(/#eol)
-
-
-
-
-
-
- ff%(value/pnode/name)%(value/nnode/name)=0;f%(value/pnode/name)%(value/nnode/name)=0;p%(value/pnode/name)%(value/nnode/name)=p%(value/pnode/name)%(value/nnode/name)+
- ff%(value/pnode/name)%(value/nnode/name)=1;p%(value/pnode/name)%(value/nnode/name)=0;f%(value/pnode/name)%(value/nnode/name)=f%(value/pnode/name)%(value/nnode/name)+
-
-
- %(value/nature/access)(%(value/pnode/name))<+
- %(value/nature/access)(%((value/pnode/name|','|value/nnode/name)))<+
-
-
-
-
-
- %(value/rhs);%(/#eol)
-
-
- ddt(%(value/rhs));%(/#eol)
-
- %(value/rhs);%(/#eol)
-
-
-
-
- case (%(pass2:tnode(value/casecondition/tnode)))%(/#eol)
-
- %(value)
- default: %(/#eol)%(pass2:tnode(value/casecode/tnode))endcase%(/#eol)
-
-
-
-
-
-
-
-
-
-
-
- %(value/blockvariablep/(type|' '|name|';'|/#eol))%(pass2:tnode(down))
-
-
-
-
- %(value/name)
- %(value)
- %(value)
-
-
-
-
-
-
-
- %(value/nature/access)(%(value/pnode/name))
- %(value/nature/access)(%((value/pnode/name|','|value/nnode/name)))
-
-
-
-
- %(value/name)%(#id)
- //%(value)
-
-
-
- %(value)
-
-
-
-
diff --git a/src/spicelib/devices/adms/ekv/adms3va/ekv.va b/src/spicelib/devices/adms/ekv/adms3va/ekv.va
deleted file mode 100644
index 71ae4accb..000000000
--- a/src/spicelib/devices/adms/ekv/adms3va/ekv.va
+++ /dev/null
@@ -1,661 +0,0 @@
-// EPFL-EKV version 2.6: A Verilog-A description.
-// The intrinsic device is coded according to the official manual
-// (revision II) available at http://legwww.epfl.ch/ekv.
-// contribution of Ivan Riis Nielsen 11/2006, modified by Dietmar Warning 01/2009
-
-//Default simulator: Spectre
-
-`ifdef insideADMS
- `define P(txt) (*txt*)
- `define PGIVEN(p) $given(p)
- `define INITIAL_MODEL @(initial_model)
- `define INSTANCE @(initial_instance)
- `define NOISE @(noise)
-`else
- `define P(txt) (txt)
- `define PGIVEN(p) p
- `define INITIAL_MODEL
- `define INSTANCE
- `define NOISE
-`endif
-
-//ADS
-//`include "constants.vams"
-//`include "disciplines.vams"
-//`include "compact.vams"
-
-//Spectre
-`include "constants.h"
-`include "discipline.h"
-
-`define NMOS 1
-`define PMOS -1
-
-`define EPSSI `P_EPS0*11.7
-`define EPSOX `P_EPS0*3.9
-`define TREF 300.15
-
-`define SQR(x) ((x)*(x))
-
-`define VT(temp) (`P_K*temp/`P_Q)
-`define EG(temp) (1.16-0.000702*`SQR(temp)/(temp+1108))
-`define NI(temp) (1.45e16*(temp/`TREF)*exp(`EG(`TREF)/(2*`VT(`TREF))-`EG(temp)/(2*`VT(temp))))
-
-
-`define oneThird 3.3333333333333333e-01
-
-// Constants needed in safe exponential function (called "expl")
-`define se05 2.3025850929940458e+02
-`define ke05 1.0e-100
-`define ke05inv 1.0e100
-
-// P3 3rd order polynomial expansion of exp()
-`define P3(u) (1.0 + (u) * (1.0 + 0.5 * ((u) * (1.0 + (u) * `oneThird))))
-
-// expl exp() with 3rd order polynomial extrapolation
-// to avoid overflows and underflows and retain C-3 continuity
-`define expl(x, res) \
-if (abs(x) < `se05) begin\
- res = exp(x); \
-end else begin \
- if ((x) < -`se05) begin\
- res = `ke05 / `P3(-`se05 - (x)); \
- end else begin\
- res = `ke05inv * `P3((x) - `se05); \
- end \
-end
-
-
-module ekv (d,g,s,b);
-
- // Node definitions
-
- inout d,g,s,b;
- electrical d,g,s,b,di,si;
-
- // Model parameters
-
- parameter integer nmos=1 from [0:1] `P(info="MOS type : nmos:0");
- parameter integer pmos=1 from [0:1] `P(info="MOS type : pmos:0");
- parameter integer MTYPE=(nmos==0 ? (pmos==0 ? 0 : 1) : (pmos==0 ? -1 : 1));
- parameter real TNOM=27 from (-273.15:inf)
- `P(info="Nominal temperature [degC]");
- parameter real IMAX=1 from (0:inf)
- `P(info="Maximum forward junction current before linearization [A]");
-
- // - intrinsic model (optional, section 4.2.1)
- parameter real TOX=0 from [0:inf)
- `P(info="Oxide thickness [m]");
- parameter real NSUB=0 from [0:inf)
- `P(info="Channel doping [cm^-3]");
- parameter real VFB=1001.0 from (-inf:inf) // use 1001V as "not specified"
- `P(info="Flat-band voltage [V]");
- parameter real UO=0 from [0:inf)
- `P(info="Low-field mobility [cm^2/Vs]");
- parameter real VMAX=0 from [0:inf)
- `P(info="Saturation velocity [m/s]");
- parameter real THETA=0 from [0:inf)
- `P(info="Mobility reduction coefficient [V^-1]");
-
- // - intrinsic model (process related, section 4.1)
- parameter real COX=((TOX>0) ? (`EPSOX/TOX) : 0.7m) from [0:inf)
- `P(info="Oxide capacitance [F/m^2]");
- parameter real XJ=0.1u from [1n:inf)
- `P(info="Junction depth [m]");
- parameter real DL=0 from (-inf:inf)
- `P(info="Length correction [m]");
- parameter real DW=0 from (-inf:inf)
- `P(info="Width correction [m]");
-
- // - intrinsic model (basic, section 4.2)
- parameter real GAMMA=((NSUB>0) ? (sqrt(2*`P_Q*`EPSSI*NSUB*1e6)/COX) : 1) from [0:inf)
- `P(info="Body effect parameter [V^0.5]");
- parameter real PHI=((NSUB>0) ? (2*`VT((TNOM+273.15))*ln(max(NSUB,1)*1e6/`NI((TNOM+273.15)))) : 0.7) from [0.1:inf)
- `P(info="Bulk Fermi potential (*2) [V]");
- parameter real VTO=((VFB<1000.0) ? (VFB+MTYPE*(PHI+GAMMA*sqrt(PHI))) : 0.5) from (-inf:inf)
- `P(info="Long-channel threshold voltage [V]");
- parameter real KP=((UO>0) ? (UO*1e-4*COX) : 50u) from (0:inf)
- `P(info="Transconductance parameter [A/V^2]");
- parameter real UCRIT=(((VMAX>0) && (UO>0)) ? (VMAX/(UO*1e-4)) : 2e6 ) from [100k:inf)
- `P(info="Longitudinal critical field [V/m]");
- parameter real E0=((THETA>0) ? 0 : 1e12) from [100k:inf)
- `P(info="Mobility reduction coefficient [V/m]");
-
- // - intrinsic model (channel length modulation and charge sharing, section 4.3)
- parameter real LAMBDA=0.5 from [0:inf)
- `P(info="Depletion length coefficient (CLM)");
- parameter real WETA=0.25 from (-inf:inf)
- `P(info="Narrow-channel effect coefficient");
- parameter real LETA=0.1 from (-inf:inf)
- `P(info="Short-channel effect coefficient");
-
- // - intrinsic model (reverse short channel effect, section 4.4)
- parameter real Q0=0 from (-inf:inf)
- `P(info="RSCE peak charge density [C/m^2]");
- parameter real LK=0.29u from [10n:inf)
- `P(info="RSCE characteristic length [m]");
-
- // - intrinsic model (impact ionization, section 4.5)
- parameter real IBA=0 from (-inf:inf)
- `P(info="First impact ionization coefficient [m^-1]");
- parameter real IBB=3e8 from [1e8:inf)
- `P(info="Second impact ionization coefficient [V/m]");
- parameter real IBN=1 from [0.1:inf)
- `P(info="Saturation voltage factor for impact ionization");
-
- // - intrinsic model (temperature, section 4.6)
- parameter real TCV=1m from (-inf:inf)
- `P(info="Threshold voltage TC [V/K]");
- parameter real BEX=-1.5 from (-inf:inf)
- `P(info="Mobility temperature exponent");
- parameter real UCEX=0.8 from (-inf:inf)
- `P(info="Longitudinal critical field temperature exponent");
- parameter real IBBT=9e-4 from (-inf:inf)
- `P(info="Temperature coefficient for IBB [K^-1]");
-
- // - intrinsic model (matching, section 4.7)
- parameter real AVTO=0 from (-inf:inf)
- `P(info="Area related VTO mismatch parameter [Vm]");
- parameter real AKP=0 from (-inf:inf)
- `P(info="Area related KP mismatch parameter [m]");
- parameter real AGAMMA=0 from (-inf:inf)
- `P(info="Area related GAMMA mismatch parameter [V^0.5*m]");
-
- // - intrinsic model (flicker noise, section 4.8)
- parameter real KF=0 from [0:inf)
- `P(info="Flicker noise coefficient");
- parameter real AF=1 from (-inf:inf)
- `P(info="Flicker noise exponent");
-
- // - intrinsic model (setup, section 4.9)
- parameter real NQS=0 from [0:1]
- `P(info="Non-quasi-static operation switch");
- parameter real SATLIM=exp(4) from (0:inf)
- `P(info="Saturation limit (if/ir)");
- parameter real XQC=0.4 from [0:1]
- `P(info="Charge/capacitance model selector");
-
- // - external parasitic parameters
- parameter real HDIF=0 from [0:inf)
- `P(info="S/D diffusion length (/2) [m]");
- parameter real RSH=0 from [0:inf)
- `P(info="S/D sheet resistance [ohm]");
- parameter real JS=0 from [0:inf)
- `P(info="S/D junction saturation current density [A/m^2]");
- parameter real JSW=0 from [0:inf)
- `P(info="S/D junction sidewall saturation current density [A/m]");
- parameter real XTI=0 from [0:inf)
- `P(info="S/D diode saturation current temperature exponent");
- parameter real N=1 from [0.5:10]
- `P(info="S/D diode emission coefficient");
- parameter real CJ=0 from [0:inf)
- `P(info="S/D zero-bias junction capacitance per area [F/m^2]");
- parameter real CJSW=0 from [0:inf)
- `P(info="S/D zero-bias junction capacitance per perimeter [F/m]");
- parameter real PB=0.8 from (0:inf)
- `P(info="S/D bottom junction builtin potential [V]");
- parameter real PBSW=PB from (0:inf)
- `P(info="S/D sidewall junction builtin potential [V]");
- parameter real MJ=0.5 from (0:inf)
- `P(info="S/D bottom junction grading coefficient");
- parameter real MJSW=0.333 from (0:inf)
- `P(info="S/D sidewall junction grading coefficient");
- parameter real FC=0.5 from (0:inf)
- `P(info="S/D bottom junction forward-bias threshold");
- parameter real FCSW=FC from (0:inf)
- `P(info="S/D sidewall junction forward-bias threshold");
- parameter real CGSO=0 from [0:inf)
- `P(info="Gate-source overlap capacitance per width [F/m]");
- parameter real CGDO=0 from [0:inf)
- `P(info="Gate-drain overlap capacitance per width [F/m]");
- parameter real CGBO=0 from [0:inf)
- `P(info="Gate-bulk overlap capacitance per length [F/m]");
-
-
- // Instance parameters
-
- // - intrinsic model
- parameter real L=10u from [0:inf]
- `P(type="instance" info="Drawn length [m]" unit="m");
- parameter real W=10u from [0:inf]
- `P(type="instance" info="Drawn width [m]" unit="m");
- parameter real M=1 from [0:inf]
- `P(type="instance" info="Parallel multiplier" unit="m");
-// parameter real N=1 from [0:inf]
-// `P(type="instance" info="Series multiplier" unit="m");
-
- // - external parasitics
- parameter real AD=((HDIF>0) ? (2*HDIF*W) : 0) from [0:inf)
- `P(info="Drain area [m^2]" type="instance");
- parameter real AS=((HDIF>0) ? (2*HDIF*W) : 0) from [0:inf)
- `P(info="Source area [m^2]" type="instance");
- parameter real PD=((HDIF>0) ? (4*HDIF+2*W) : 0) from [0:inf)
- `P(info="Drain perimeter [m]" type="instance");
- parameter real PS=((HDIF>0) ? (4*HDIF+2*W) : 0) from [0:inf)
- `P(info="Source perimeter [m]" type="instance");
- parameter real NRD=((HDIF>0) ? (HDIF/W) : 0) from [0:inf)
- `P(info="Drain no. squares" type="instance");
- parameter real NRS=((HDIF>0) ? (HDIF/W) : 0) from [0:inf)
- `P(info="Source no. squares" type="instance");
- parameter real RS=((RSH>0) ? (RSH*NRS) : 0) from [0:inf)
- `P(info="Source resistance [ohms]" type="instance");
- parameter real RD=((RSH>0) ? (RSH*NRD) : 0) from [0:inf)
- `P(info="Drain resistance [ohms]" type="instance");
-
-
- // Declaration of variables
- integer mode;
- real lc,isat_s,vexp_s,gexp_s,isat_d,vexp_d,gexp_d,fact,
- weff,leff,np,ns,lmin,rd,rs,ceps,ca,xsi,dvrsce,
- tempk,vt,sqrt_A,vto_a,kp_a,gamma_a,ucrit,phi,ibb,vc,qb0,
- vg,vd,vs,tmp,vgprime,vp0,vsprime,vdprime,gamma0,gammaprime,vp,n,ifwd,
- vdss,vdssprime,dv,vds,vip,dl,lprime,leq,irprime,irev,beta0,nau,
- nq,xf,xr,qd,qs,qi,qb,qg,beta0prime,beta,vpprime,is,ids,vib,
- idb,ibdj,ibsj,coxt,qdt,qst,qgt,qbt,
- cbs0,cbs0sw,cbs,cbd0,cbd0sw,cbd,
- fv,z0,z1,y;
-
- real cgso,cgdo,cgbo;
-
-
- analog begin
-
- `INITIAL_MODEL begin // Model Initialization
-
- lc = sqrt(`EPSSI/COX*XJ);
-
- end // INITIAL_MODEL
-
- `INSTANCE begin // temperature independent device initialization
-
- weff = W+DW;
- leff = L+DL;
-
- np = M;
- ns = 1;
-
- // eq. 54
- lmin = 0.1*ns*leff;
-
- rs = ns/np*RS;
- rd = ns/np*RD;
-
- ceps = 4*22e-3*22e-3;
- ca = 0.028;
- xsi = ca*(10*leff/LK-1);
- dvrsce = 2*Q0/COX/`SQR(1+0.5*(xsi+sqrt(xsi*xsi+ceps)));
-
- coxt = np*ns*COX*weff*leff;
-
- end // temperature independent
-
- `INSTANCE begin // temperature dependent device initialization
- tempk = $temperature;
- vt = `VT(tempk);
-
- sqrt_A = sqrt(np*weff*ns*leff);
-
- vto_a = MTYPE*(VTO+TCV*(tempk-(TNOM+273.15)))+AVTO/sqrt_A;
- kp_a = KP*pow(tempk/(TNOM+273.15),BEX)*(1+AKP/sqrt_A);
- gamma_a = GAMMA+AGAMMA/sqrt_A;
- ucrit = UCRIT*pow(tempk/(TNOM+273.15),UCEX);
- phi = PHI*tempk/(TNOM+273.15)-3*vt*ln(tempk/(TNOM+273.15))-`EG(TNOM+273.15)*tempk/(TNOM+273.15)+`EG(tempk);
- ibb = IBB*(1+IBBT*(tempk-(TNOM+273.15)));
-
- vc = ucrit*ns*leff;
-
- // eq. 60
- qb0 = gamma_a*sqrt(phi);
-
- fact = (`EG(TNOM+273.15)/`VT(TNOM+273.15)-`EG(tempk)/vt) * pow(tempk/(TNOM+273.15),XTI);
- `expl(fact,tmp)
- isat_s = np*ns*(JS*AS+JSW*PS)*tmp;
- isat_d = np*ns*(JS*AD+JSW*PD)*tmp;
-
- if (isat_s>0) begin
- vexp_s = vt*ln(IMAX/isat_s+1);
- gexp_s = (IMAX+isat_s)/vt;
- end else begin
- vexp_s = -1e9;
- gexp_s = 0;
- end
-
- if (isat_d>0) begin
- vexp_d = vt*ln(IMAX/isat_d+1);
- gexp_d = (IMAX+isat_d)/vt;
- end else begin
- vexp_d = -1e9;
- gexp_d = 0;
- end
-
- cbs0 = np*ns*CJ*AS;
- cbd0 = np*ns*CJ*AD;
- cbs0sw = np*ns*CJSW*PS;
- cbd0sw = np*ns*CJSW*PD;
-
- cgso = np*ns*CGSO*weff;
- cgdo = np*ns*CGDO*weff;
- cgbo = np*ns*CGBO*leff;
-
- end // temperature dependent
-
-
- begin //Bias-dependent model evaluation
-
- vg = MTYPE*V(g,b);
- vd = MTYPE*V(di,b);
- vs = MTYPE*V(si,b);
- // $strobe("vg=%e vd=%e vs=%e",vg,vd,vs);
-
- if (vd>=vs)
- mode = 1;
- else begin
- mode = -1;
- tmp = vs;
- vs = vd;
- vd = tmp;
- end
-
- // eq. 33
- vgprime = vg-vto_a-dvrsce+phi+gamma_a*sqrt(phi);
- // eq. 35
- vsprime = 0.5*(vs+phi+sqrt(`SQR(vs+phi)+16*`SQR(vt)));
- vdprime = 0.5*(vd+phi+sqrt(`SQR(vd+phi)+16*`SQR(vt)));
- // $strobe("vgprime=%e vdprime=%e vsprime=%e",vgprime,vdprime,vsprime);
- // eq. 34
- if (vgprime>=0) begin
- vp0 = vgprime-phi-gamma_a*(sqrt(vgprime+0.25*`SQR(gamma_a))-0.5*gamma_a);
- // eq. 36
- gamma0 = gamma_a-`EPSSI/COX*(LETA/leff*(sqrt(vsprime)+sqrt(vdprime))-3*WETA/weff*sqrt(vp0+phi));
- end else begin
- vp0 = -phi;
- // eq. 36 - skipped sqrt(vp0+phi) here, it produces inf on derivative
- gamma0 = gamma_a-`EPSSI/COX*(LETA/leff*(sqrt(vsprime)+sqrt(vdprime)) );
- end
- // eq. 37
- gammaprime = 0.5*(gamma0+sqrt(`SQR(gamma0)+0.1*vt));
- // eq. 38
- if (vgprime>=0)
- vp = vgprime-phi-gammaprime*(sqrt(vgprime+0.25*`SQR(gammaprime))-0.5*gammaprime);
- else
- vp = -phi;
- // $strobe("vp0=%e vp=%e gamma0=%e gammaprime=%e",vp0,vp,gamma0,gammaprime);
- // eq. 39
- n = 1+gamma_a*0.5/sqrt(vp+phi+4*vt);
-
- // Forward current (43-44)
- fv=(vp-vs)/vt;
-
- if (fv > -0.35) begin
- z0 = 2.0/(1.3 + fv - ln(fv+1.6));
- z1 = (2.0 + z0) / (1.0 + fv + ln(z0));
- y = (1.0 + fv + ln(z1)) / (2.0 + z1);
- end
- else if (fv > -15) begin
- `expl(-fv,tmp)
- z0 = 1.55 + tmp;
- z1 = (2.0 + z0) / (1.0 + fv + ln(z0));
- y = (1.0 + fv + ln(z1)) / (2.0 + z1);
- end
- else if (fv > -23.0) begin
- `expl(-fv,tmp)
- y = 1.0 / (2.0 + tmp);
- end
- else begin
- `expl(fv,tmp)
- y = tmp + 1.0e-64;
- end
-
- ifwd = y*(1.0 + y);
- z0 = 1;
- z1 = 1;
-
- // eq. 46
- vdss = vc*(sqrt(0.25+vt/vc*sqrt(ifwd))-0.5);
- // eq. 47
- vdssprime = vc*(sqrt(0.25+vt/vc*(sqrt(ifwd)-0.75*ln(ifwd)))-0.5)+vt*(ln(0.5*vc/vt)-0.6);
- // $strobe("ifwd=%e vdss=%e vdssprime=%e",ifwd,vdss,vdssprime);
- // eq. 48
- dv = 4*vt*sqrt(LAMBDA*(sqrt(ifwd)-vdss/vt)+1.0/64);
- // eq. 49
- vds = 0.5*(vd-vs);
- // eq. 50
- vip = sqrt(`SQR(vdss)+`SQR(dv))-sqrt(`SQR(vds-vdss)+`SQR(dv));
- // eq. 52
- dl = LAMBDA*lc*ln(1+(vds-vip)/(lc*ucrit));
-
- // eq. 53
- lprime = ns*leff-dl+(vds+vip)/ucrit;
- // eq. 55
- leq = 0.5*(lprime+sqrt(`SQR(lprime)+`SQR(lmin)));
-
- // eq. 56
- fv=(vp-vds-vs-sqrt(`SQR(vdssprime)+`SQR(dv))+sqrt(`SQR(vds-vdssprime)+`SQR(dv)))/vt;
-
- if (fv > -0.35) begin
- z0 = 2.0/(1.3 + fv - ln(fv+1.6));
- z1 = (2.0 + z0) / (1.0 + fv + ln(z0));
- y = (1.0 + fv + ln(z1)) / (2.0 + z1);
- end
- else if (fv > -15) begin
- `expl(-fv,tmp)
- z0 = 1.55 + tmp;
- z1 = (2.0 + z0) / (1.0 + fv + ln(z0));
- y = (1.0 + fv + ln(z1)) / (2.0 + z1);
- end
- else if (fv > -23.0) begin
- `expl(-fv,tmp)
- y = 1.0 / (2.0 + tmp);
- end
- else begin
- `expl(fv,tmp)
- y = tmp + 1.0e-64;
- end
-
- irprime = y*(1.0 + y);
- z0 = 1;
- z1 = 1;
-
- // eq. 57
- fv=(vp-vd)/vt;
-
- if (fv > -0.35) begin
- z0 = 2.0/(1.3 + fv - ln(fv+1.6));
- z1 = (2.0 + z0) / (1.0 + fv + ln(z0));
- y = (1.0 + fv + ln(z1)) / (2.0 + z1);
- end
- else if (fv > -15) begin
- `expl(-fv,tmp)
- z0 = 1.55 + tmp;
- z1 = (2.0 + z0) / (1.0 + fv + ln(z0));
- y = (1.0 + fv + ln(z1)) / (2.0 + z1);
- end
- else if (fv > -23.0) begin
- `expl(-fv,tmp)
- y = 1.0 / (2.0 + tmp);
- end
- else begin
- `expl(fv,tmp)
- y = tmp + 1.0e-64;
- end
-
- irev = y*(1.0 + y);
-
- // eq. 58
- beta0 = kp_a*np*weff/leq;
- // eq. 59
- nau = (5+MTYPE)/12.0;
-
- // eq. 69
- nq = 1+0.5*gamma_a/sqrt(vp+phi+1e-6);
-
- // eq. 70
- xf = sqrt(0.25+ifwd);
- // eq. 71
- xr = sqrt(0.25+irev);
- // eq. 72
- qd = -nq*(4.0/15*(3*`SQR(xr)*(xr+2*xf)+2*`SQR(xf)*(xf+2*xr))/`SQR(xf+xr)-0.5);
- // eq. 73
- qs = -nq*(4.0/15*(3*`SQR(xf)*(xf+2*xr)+2*`SQR(xr)*(xr+2*xf))/`SQR(xf+xr)-0.5);
- // eq. 74
- qi = qs+qd;
- // eq. 75
- if (vgprime>=0)
- qb = (-gamma_a*sqrt(vp+phi+1e-6))/vt-(nq-1)/nq*qi;
- else
- qb = -vgprime/vt;
- // eq. 76 (qox removed since it is assumed to be zero)
- qg = -qi-qb;
-
- if (E0!=0) begin
- // eq. 61
- beta0prime = beta0*(1+COX/(E0*`EPSSI)*qb0);
- // eq. 62
- beta = beta0prime/(1+COX/(E0*`EPSSI)*vt*abs(qb+nau*qi));
- end else begin
- // eq. 63
- vpprime = 0.5*(vp+sqrt(`SQR(vp)+2*`SQR(vt)));
- // eq. 64
- beta = beta0/(1+THETA*vpprime);
- end // else: !if(e0!=0)
- // eq. 65
- is = 2*n*beta*`SQR(vt);
- // $strobe("beta0=%e beta0prime=%e beta=%e E0=%e qb0=%e qb=%e qi=%e",beta0,beta0prime,beta,E0,qb0,qb,qi);
- // eq. 66
- ids = is*(ifwd-irprime);
- // eq. 67
- vib = vd-vs-IBN*2*vdss;
- // eq. 68
- if (vib>0) begin
- `expl((-ibb*lc)/vib,tmp)
- idb = ids*IBA/ibb*vib*tmp;
- end else
- idb = 0;
- // $strobe("ids=%e idb=%e",ids,idb);
-
- if (mode>1) begin
- if (isat_s>0) begin
- if (-vs>vexp_s)
- ibsj = IMAX+gexp_s*(-vs-vexp_s);
- else begin
- `expl(-vs/(N*vt),tmp)
- ibsj = isat_s*(tmp-1);
- end
- end else
- ibsj = 0;
-
- if (isat_d>0) begin
- if (-vd>vexp_d)
- ibdj = IMAX+gexp_d*(-vd-vexp_d);
- else begin
- `expl(-vd/(N*vt),tmp)
- ibdj = isat_d*(tmp-1);
- end
- end else
- ibdj = 0;
-
- end else begin // if (mode>1)
- if (isat_s>0) begin
- if (-vd>vexp_s)
- ibsj = IMAX+gexp_s*(-vd-vexp_s);
- else begin
- `expl(-vd/(N*vt),tmp)
- ibsj = isat_s*(tmp-1);
- end
- end else
- ibsj = 0;
-
- if (isat_d>0) begin
- if (-vs>vexp_d)
- ibdj = IMAX+gexp_d*(-vs-vexp_d);
- else begin
- `expl(-vs/(N*vt),tmp)
- ibdj = isat_d*(tmp-1);
- end
- end else
- ibdj = 0;
-
- end // else: !if(mode>1)
-
- qdt = coxt*vt*qd;
- qst = coxt*vt*qs;
- qgt = coxt*vt*qg;
- qbt = coxt*vt*qb;
-
- cbs = 0;
- cbd = 0;
-
- if (cbs0>0) begin
- if (MTYPE*V(b,si)>FC*PB)
- cbs = cbs+cbs0/pow(1-FC,MJ)*(1+MJ*(MTYPE*V(b,si)-PB*FC))/(PB*(1-FC));
- else
- cbs = cbs+cbs0/pow(1-MTYPE*V(b,si),MJ);
- end
- if (cbd0>0) begin
- if (MTYPE*V(b,di)>FC*PB)
- cbd = cbd+cbd0/pow(1-FC,MJ)*(1+MJ*(MTYPE*V(b,di)-PB*FC))/(PB*(1-FC));
- else
- cbd = cbd+cbd0/pow(1-MTYPE*V(b,di),MJ);
- end
- if (cbs0sw>0) begin
- if (MTYPE*V(b,si)>FCSW*PBSW)
- cbs = cbs+cbs0sw/pow(1-FCSW,MJSW)*(1+MJSW*(MTYPE*V(b,si)-PBSW*FCSW))/(PBSW*(1-FCSW));
- else
- cbs = cbs+cbs0sw/pow(1-MTYPE*V(b,si),MJSW);
- end
- if (cbd0sw>0) begin
- if (MTYPE*V(b,di)>FCSW*PBSW)
- cbd = cbd+cbd0sw/pow(1-FCSW,MJSW)*(1+MJSW*(MTYPE*V(b,di)-PBSW*FCSW))/(PBSW*(1-FCSW));
- else
- cbd = cbd+cbd0sw/pow(1-MTYPE*V(b,di),MJSW);
- end
-
- end //Bias-dependent model evaluation
-
- begin //Define branch sources
-
- I(di,si) <+ MTYPE*mode*ids;
- if (mode>0) begin
- I(di,b) <+ MTYPE*idb;
-
- I(di,g) <+ MTYPE*ddt(qdt);
- I(si,g) <+ MTYPE*ddt(qst);
-
- end else begin
- I(si,b) <+ MTYPE*idb;
-
- I(si,g) <+ MTYPE*ddt(qdt);
- I(di,g) <+ MTYPE*ddt(qst);
-
- end // else: !if(mode>0)
-
- I(b,si) <+ MTYPE*ibsj;
- I(b,di) <+ MTYPE*ibdj;
-
- I(b,g) <+ MTYPE*ddt(qbt);
-
- I(g,si) <+ cgso*ddt(V(g,si));
- I(g,di) <+ cgdo*ddt(V(g,di));
- I(g,b) <+ cgbo*ddt(V(g,b));
-
- if (RD>0)
- I(d,di) <+ V(d,di)/rd;
- else
- V(d,di) <+ 0.0;
- if (RS>0)
- I(s,si) <+ V(s,si)/rs;
- else
- V(s,si) <+ 0.0;
-
- I(b,si) <+ cbs*ddt(V(b,si));
- I(b,di) <+ cbd*ddt(V(b,di));
-
- end // begin
-
-// `NOISE begin //Define noise sources
-//
-// end // noise
-
- end //analog
-
-endmodule
diff --git a/src/spicelib/devices/adms/hicum0/adms3va/hicum0.va b/src/spicelib/devices/adms/hicum0/adms3va/hicum0.va
deleted file mode 100644
index 90511a1a8..000000000
--- a/src/spicelib/devices/adms/hicum0/adms3va/hicum0.va
+++ /dev/null
@@ -1,851 +0,0 @@
-// HICUM Level_0 Version_1.12: A Verilog-A description
-// (A simplified version of HICUM Level2 model for BJT)
-// ## It is modified after the first version of HICUM/L0 code ##
-
-// 12/08: Modifications for ngspice and adms2.2.7 DW
-// Changed VT0 in Vt0 to prevent conflict in compiled C version.
-// Made a temporary variable cjei_i for cjei output purpose only.
-
-// Minor code related changes
-// 03/08: Quick Fix: Default value of TFH has been changed from infinity to zero and modified the default value limits to [0, inf) to include zero
-// 12/06: Upper limit of FGEO is changed to infinity
-// 06/06: Thermal node "tnode" set as external
-// Flag FLSH introduced for controlling Self-heating calculation
-// all if-else blocks marked with begin-end
-// all series resistors and RTH are allowed to have a minimum value MIN_R
-// 07/06: QCJMOD deleted, QJMODF introduced along with with HICJQ
-// ddx() operator used with QJMOD and QJMODF wherever needed
-// aj is kept at 2.4 except BE depletion charge
-// Substrate transistor transfer current added.
-// Gmin added to (bi,ei) and (bi,ci) branches.
-// hyperbolic smoothing used in rbi computation to avoid devide-by-zero.
-
-// *********************************************************************************
-// 06/06: Comment on NODE COLLAPSING:
-// Presently this verilog code permits a minimum of 1 milli-Ohm resistance for any
-// series resistance as well as for thermal resistance RTH. If any of the resistance
-// values drops below this minimum value, the corresponding nodes are shorted with
-// zero voltage contribution. We want the model compilers/simulators deal this
-// situation in such a manner that the corresponding node is COLLAPSED.
-// We expect that the simulators should permit current contribution statement
-// for any branch with resistance value more than (or equal to) 1 milli-Ohm without
-// any convergence problem. In fact, we wish NOT to have to use a voltage contribution
-// statement in our Verilog code, except as an indication for the model compiler/simulator
-// to interprete a zero branch voltage as NODE-COLLAPSING action.
-// **********************************************************************************
-
-
-//Default simulator: Spectre
-
-`ifdef insideADMS
- `define P(p) (*p*)
-`else
- `define P(p)
-`endif
-
-
-//ADS
-//`include "constants.vams"
-//`include "disciplines.vams"
-//`include "compact.vams"
-
-//Spectre
-`include "constants.h"
-`include "discipline.h"
-
-
-`define NPN +1
-`define PNP -1
-
-`define VPT_thresh 1.0e2
-`define EXPLIM 80.0
-`define INF 1.0e6
-`define TMAX 326.85
-`define TMIN -100.0
-`define MIN_R 0.001
-//`define Gmin 1.0e-12
-
-`define QCMODF(vj,cj0,vd,z,aj,cjf)\
- if(cj0 > 0.0) begin\
- vf = vd*(1.0-exp(-ln(aj)/z));\
- xvf = (vf-vj)/VT;\
- xvf2 = sqrt(xvf*xvf+1.921812);\
- v_j = vf-VT*(xvf+xvf2)*0.5;\
- dvj = 0.5*(xvf+xvf2)/xvf2;\
- cjf = cj0*exp(-z*ln(1-v_j/vd))*dvj+aj*cj0*(1-dvj);\
- end else begin\
- cjf = 0.0;\
- end
-
-// DEPLETION CHARGE CALCULATION
-// Hyperbolic smoothing used; no punch-through
-`define QJMODF(vj,cj0,vd,z,aj,qjf)\
- if(cj0 > 0.0) begin\
- vf = vd*(1.0-exp(-ln(aj)/z));\
- xvf = (vf-vj)/VT;\
- xvf2 = sqrt(xvf*xvf+1.921812);\
- v_j = vf-VT*(xvf+xvf2)*0.5;\
- x = 1.0-z;\
- y = 1.0-exp(x*ln(1.0-v_j/vd));\
- qjf = cj0*vd*y/x+aj*cj0*(vj-v_j);\
- end else begin\
- qjf = 0.0;\
- end
-
-
-// Depletion Charge : with punch through
-`define QJMOD(vj,cj0,vd,z,vpt,aj,qjf)\
- if(cj0 > 0.0) begin\
- zr = z/4.0;\
- vp = vpt-vd;\
- vf = vd*(1.0-exp(-ln(aj)/z));\
- cmax = aj*cj0;\
- cr = cj0*exp((z-zr)*ln(vd/vpt));\
- a = VT;\
- ve = (vf-vj)/a;\
- if (ve <= `EXPLIM) begin\
- ex1 = exp(ve);\
- ee1 = 1.0+ex1;\
- vj1 = vf-a*ln(ee1);\
- end else begin\
- vj1 = vj;\
- end\
- a = 0.1*vp+4.0*VT;\
- vr = (vp+vj1)/a;\
- if (vr <= `EXPLIM) begin\
- ex1 = exp(vr);\
- ee1 = 1.0+ex1;\
- vj2 = -vp+a*ln(ee1);\
- end else begin\
- vj2 = vj1;\
- end\
- vj4 = vj-vj1;\
- ez = 1.0-z;\
- ezr = 1.0-zr;\
- vdj1 = ln(1.0-vj1/vd);\
- vdj2 = ln(1.0-vj2/vd);\
- qj1 = cj0*(1.0-exp(vdj2*ez))/ez;\
- qj2 = cr*(1.0-exp(vdj1*ezr))/ezr;\
- qj3 = cr*(1.0-exp(vdj2*ezr))/ezr;\
- qjf = (qj1+qj2-qj3)*vd+cmax*vj4;\
- end else begin\
- qjf = 0.0;\
- end
-
-
-// DEPLETION CHARGE CALCULATION SELECTOR:
-// Dependent on junction punch-through voltage
-// Important for collector related junctions
-`define HICJQ(vj,cj0,vd,z,vpt,qjf)\
- if(vpt < `VPT_thresh) begin\
- `QJMOD(vj,cj0,vd,z,vpt,2.4,qjf)\
- end else begin\
- `QJMODF(vj,cj0,vd,z,2.4,qjf)\
- end
-
-//Temperature dependence of depletion capacitance parameters
-`define TMPHICJ(cj0,vd,z,vg,cj0_t,vd_t)\
- arg = 0.5*vd/Vt0;\
- vdj0 = 2*Vt0*ln(exp(arg)-exp(-arg));\
- vdjt = vdj0*qtt0+vg*(1-qtt0)-mg*VT*ln_qtt0;\
- vd_t = vdjt+2*VT*ln(0.5*(1+sqrt(1+4*exp(-vdjt/VT))));\
- cj0_t = cj0*exp(z*ln(vd/vd_t));
-
-
-//Limiting exponential
-`define LIN_EXP(le, arg)\
- if(arg > 80) begin\
- le = (1 + ((arg) - 80));\
- arg = 80;\
- end else begin\
- le=1;\
- end\
- le = le*limexp(arg);
-
-// IDEAL DIODE (WITHOUT CAPACITANCE):
-// conductance not calculated
-// INPUT:
-// IS, IST : saturation currents (model parameter related)
-// UM1 : ideality factor
-// U : branch voltage
-// IMPLICIT INPUT:
-// VT : thermal voltage
-// OUTPUT:
-// Iz : diode current
-`define HICDIO(IS,IST,UM1,U,Iz)\
- DIOY = U/(UM1*VT);\
- if (IS > 0.0) begin\
- if (DIOY > 80) begin\
- le = (1 + ((DIOY) - 80));\
- DIOY = 80;\
- end else begin\
- le = 1;\
- end\
- le = le*limexp(DIOY);\
- Iz = IST*(le-1.0);\
- if(DIOY <= -14.0) begin\
- Iz = -IST;\
- end\
- end else begin\
- Iz = 0.0;\
- end
-
-
-module hic0_full (c,b,e,s,tnode);
-
-
-//Node definitions
-
- inout c,b,e,s,tnode;
- (*info="external collector node"*)electrical c;
- (*info="external base node"*)electrical b;
- (*info="external emitter node"*)electrical e;
- (*info="external substrate node"*)electrical s;
- (*info="internal collector node"*)electrical ci;
- (*info="internal base node"*)electrical bi;
- (*info="internal emitter node"*)electrical ei;
- (*info="local temperature rise node"*)electrical tnode;
-
-
- //Branch definitions
- branch (ci,c) br_cic_i;
- branch (ci,c) br_cic_v;
- branch (ei,e) br_eie_i;
- branch (ei,e) br_eie_v;
- branch (bi,ei) br_biei;
- branch (bi,ci) br_bici;
- branch (ci,ei) br_ciei;
- branch (b,bi) br_bbi_i;
- branch (b,bi) br_bbi_v;
- branch (b,e) br_be;
- branch (b,ci) br_bci;
- branch (b,s) br_bs;
- branch (s,ci) br_sci;
- branch (tnode ) br_sht;
-
-//
-// Parameter initialization with default values
-
-// Collector current
- (*spice_name="is", info="(Modified) saturation current", m_factor="yes", unit="A"*) parameter real is = 1.0e-16 from [0:1];
- (*spice_name="mcf", info="Non-ideality coefficient of forward collector current"*) parameter real mcf = 1.00 from (0:10];
- (*spice_name="mcr", info="Non-ideality coefficient of reverse collector current"*) parameter real mcr = 1.00 from (0:10];
- (*spice_name="vef", info="forward Early voltage (normalization volt.)", unit="V", default_value="infinity"*) parameter real vef = `INF from (0:`INF];
- (*spice_name="iqf", info="forward d.c. high-injection toll-off current", unit="A", m_factor="yes", default_value="infinity"*) parameter real iqf = `INF from (0:`INF];
- (*spice_name="iqr", info="inverse d.c. high-injection roll-off current", unit="A", m_factor="yes", default_value="infinity"*) parameter real iqr = `INF from (0:`INF];
- (*spice_name="iqfh", info="high-injection correction current", unit="A", m_factor="yes"*) parameter real iqfh = `INF from (0:`INF];
- (*spice_name="tfh", info="high-injection correction factor", test_value="2e-9", m_factor="yes"*) parameter real tfh = 0.0 from [0:`INF);
-
-// Base current
- (*spice_name="ibes", info="BE saturation current", unit="A", m_factor="yes"*) parameter real ibes = 1e-18 from [0:1];
- (*spice_name="mbe", info="BE non-ideality factor"*) parameter real mbe = 1.0 from (0:10];
- (*spice_name="ires", info="BE recombination saturation current", test_value="1e-16", unit="A", m_factor="yes"*) parameter real ires = 0.0 from [0:1];
- (*spice_name="mre", info="BE recombination non-ideality factor"*) parameter real mre = 2.0 from (0:10];
- (*spice_name="ibcs", info="BC saturation current", test_value="1e-16", unit="A", m_factor="yes"*) parameter real ibcs = 0.0 from [0:1];
- (*spice_name="mbc", info="BC non-ideality factor"*) parameter real mbc = 1.0 from (0:10];
-
-// BE depletion cap
- (*spice_name="cje0", info="Zero-bias BE depletion capacitance", unit="F", test_value="2e-14", m_factor="yes"*) parameter real cje0 = 1.0e-20 from (0:`INF);
- (*spice_name="vde", info="BE built-in voltage", unit="V"*) parameter real vde = 0.9 from (0:10];
- (*spice_name="ze", info="BE exponent factor"*) parameter real ze = 0.5 from (0:1];
- (*spice_name="aje", info="Ratio of maximum to zero-bias value"*) parameter real aje = 2.5 from [1:`INF);
-
-// Transit time
- (*spice_name="t0", info="low current transit time at Vbici=0", test_value="5e-12", unit="s"*) parameter real t0 = 0.0 from [0:`INF);
- (*spice_name="dt0h", info="Base width modulation contribution", test_value="2e-12", unit="s"*) parameter real dt0h = 0.0; // from [0:`INF) ;
- (*spice_name="tbvl", info="SCR width modulation contribution", test_value="4e-12", unit="s"*) parameter real tbvl = 0.0 from [0:`INF);
- (*spice_name="tef0", info="Storage time in neutral emitter", test_value="1e-12", unit="s"*) parameter real tef0 = 0.0 from [0:`INF);
- (*spice_name="gte", info="Exponent factor for emmiter transit time"*) parameter real gte = 1.0 from (0:10];
- (*spice_name="thcs", info="Saturation time at high current densities", test_value="3e-11", unit="s"*) parameter real thcs = 0.0 from [0:`INF);
- (*spice_name="ahc", info="Smoothing facor for current dependence"*) parameter real ahc = 0.1 from (0:10];
- (*spice_name="tr", info="Storage time at inverse operation", unit="s"*) parameter real tr = 0.0 from [0:`INF);
-
-// Critical current
- (*spice_name="rci0", info="Low-field collector resistance under emitter", test_value="50", unit="Ohm", m_inverse_factor="yes"*) parameter real rci0 = 150 from (0:`INF);
- (*spice_name="vlim", info="Voltage dividing ohmic and satur.region", unit="V"*) parameter real vlim = 0.5 from (0:10];
- (*spice_name="vpt", info="Punch-through voltage", test_value="10", unit="V", default="infinity"*) parameter real vpt = 100 from (0:100];
- (*spice_name="vces", info="Saturation voltage", unit="V"*) parameter real vces = 0.1 from [0:1];
-
-// BC depletion cap intern
- (*spice_name="cjci0", info="Total zero-bias BC depletion capacitance", test_value="1e-15", unit="F", m_factor="yes"*) parameter real cjci0 = 1.0e-20 from (0:`INF);
- (*spice_name="vdci", info="BC built-in voltage", test_value="0.7", unit="V"*) parameter real vdci = 0.7 from (0:10];
- (*spice_name="zci", info="BC exponent factor", test_value="0.4"*) parameter real zci = 0.333 from (0:1];
- (*spice_name="vptci", info="Punch-through voltage of BC junction", test_value="50", unit="V"*) parameter real vptci = 100 from (0:100];
-
-// BC depletion cap extern
- (*spice_name="cjcx0", info="Zero-bias external BC depletion capacitance", unit="F", test_value="1e-15", m_factor="yes"*) parameter real cjcx0 = 1.0e-20 from [0:`INF);
- (*spice_name="vdcx", info="External BC built-in voltage", unit="V"*) parameter real vdcx = 0.7 from (0:10];
- (*spice_name="zcx", info="External BC exponent factor"*) parameter real zcx = 0.333 from (0:1];
- (*spice_name="vptcx", info="Punch-through voltage", unit="V", test_value="5.0", default="infinity"*) parameter real vptcx = 100 from (0:100];
- (*spice_name="fbc", info="Split factor = Cjci0/Cjc0", test_value="0.5"*) parameter real fbc = 1.0 from [0:1];
-
-// Base resistance
- (*spice_name="rbi0", info="Internal base resistance at zero-bias", test_value="100", unit="Ohm", m_inverse_factor="yes"*) parameter real rbi0 = 0.0 from [0:`INF);
- (*spice_name="vr0e", info="forward Early voltage (normalization volt.)", unit="V"*) parameter real vr0e = 2.5 from (0:`INF];
- (*spice_name="vr0c", info="forward Early voltage (normalization volt.)", unit="V", default="infinity", test_value="25.0"*) parameter real vr0c = `INF from (0:`INF];
- (*spice_name="fgeo", info="Geometry factor", test_value="0.73"*) parameter real fgeo = 0.656 from [0:`INF];
-
-// Series resistances
- (*spice_name="rbx", info="External base series resistance", test_value="8.8", unit="Ohm", m_inverse_factor="yes"*) parameter real rbx = 0.0 from [0:`INF);
- (*spice_name="rcx", info="Emitter series resistance", test_value="12.5", unit="Ohm", m_inverse_factor="yes"*) parameter real rcx = 0.0 from [0:`INF);
- (*spice_name="re", info="External collector series resistance", test_value="9.16", unit="Ohm", m_inverse_factor="yes"*) parameter real re = 0.0 from [0:`INF);
-
-// Substrate transfer current, diode current and cap
- (*spice_name="itss", info="Substrate transistor transfer saturation current", unit="A", test_value="1e-17", m_factor="yes"*) parameter real itss = 0.0 from [0:1.0];
- (*spice_name="msf", info="Substrate transistor transfer current non-ideality factor"*) parameter real msf = 1.0 from (0:10];
- (*spice_name="iscs", info="SC saturation current", unit="A", test_value="1e-17", m_factor="yes"*) parameter real iscs = 0.0 from [0:1.0];
- (*spice_name="msc", info="SC non-ideality factor"*) parameter real msc = 1.0 from (0:10];
- (*spice_name="cjs0", info="Zero-bias SC depletion capacitance", unit="F", test_value="1e-15", m_factor="yes"*) parameter real cjs0 = 1.0e-20 from [0:`INF);
- (*spice_name="vds", info="SC built-in voltage", unit="V"*) parameter real vds = 0.3 from (0:10];
- (*spice_name="zs", info="External SC exponent factor"*) parameter real zs = 0.3 from (0:1];
- (*spice_name="vpts", info="SC punch-through voltage", unit="V", test_value="5.0", default="infinity"*) parameter real vpts = 100 from (0:100];
-
-// Parasitic caps
- (*spice_name="cbcpar", info="Collector-base isolation (overlap) capacitance", unit="F", m_factor="yes", test_value="1e-15"*) parameter real cbcpar = 0.0 from [0:`INF);
- (*spice_name="cbepar", info="Emitter-base oxide capacitance", unit="F", m_factor="yes", test_value="2e-15"*) parameter real cbepar = 0.0 from [0:`INF);
-
-// BC avalanche current
- (*spice_name="eavl", info="Exponent factor", test_value="1e-14"*) parameter real eavl = 0.0 from [0:inf);
- (*spice_name="kavl", info="Prefactor", test_value="1.19"*) parameter real kavl = 0.0 from [0:`INF);
-
-// Flicker noise
- (*spice_name="kf", info="flicker noise coefficient", unit="M^(1-AF)"*) parameter real kf = 0.0 from [0:`INF);
- (*spice_name="af", info="flicker noise exponent factor"*) parameter real af = 2.0 from (0:10];
-
-// Temperature dependance
- (*spice_name="vgb", info="Bandgap-voltage", unit="V", test_value="1.17"*) parameter real vgb = 1.2 from (0:10];
- (*spice_name="vge", info="Effective emitter bandgap-voltage", unit="V", test_value="1.07"*) parameter real vge = 1.17 from (0:10];
- (*spice_name="vgc", info="Effective collector bandgap-voltage", unit="V", test_value="1.14"*) parameter real vgc = 1.17 from (0:10];
- (*spice_name="vgs", info="Effective substrate bandgap-voltage", unit="V", test_value="1.17"*) parameter real vgs = 1.17 from (0:10];
- (*spice_name="f1vg", info="Coefficient K1 in T-dependent bandgap equation", unit="V/K"*) parameter real f1vg =-1.02377e-4;
- (*spice_name="f2vg", info="Coefficient K2 in T-dependent bandgap equation", unit="V/K"*) parameter real f2vg = 4.3215e-4;
- (*spice_name="alt0", info="Frist-order TC of tf0", unit="1/K"*) parameter real alt0 = 0.0;
- (*spice_name="kt0", info="Second-order TC of tf0", unit="1/K^2"*) parameter real kt0 = 0.0;
- (*spice_name="zetact", info="Exponent coefficient in transfer current temperature dependence", test_value="3.5"*) parameter real zetact = 3.0;
- (*spice_name="zetabet", info="Exponent coefficient in BE junction current temperature dependence", test_value="4.0"*) parameter real zetabet = 3.5;
- (*spice_name="zetaci", info="TC of epi-collector diffusivity", test_value="1.6"*) parameter real zetaci = 0.0;
- (*spice_name="alvs", info="Relative TC of satur.drift velocity", unit="1/K", test_value="1e-3"*) parameter real alvs = 0.0;
- (*spice_name="alces", info="Relative TC of vces", unit="1/K", test_value="4e-4"*) parameter real alces = 0.0;
- (*spice_name="zetarbi", info="TC of internal base resistance", test_value="0.6"*) parameter real zetarbi = 0.0;
- (*spice_name="zetarbx", info="TC of external base resistance", test_value="0.2"*) parameter real zetarbx = 0.0;
- (*spice_name="zetarcx", info="TC of external collector resistance", test_value="0.2"*) parameter real zetarcx = 0.0;
- (*spice_name="zetare", info="TC of emitter resistances"*) parameter real zetare = 0.0;
- (*spice_name="alkav", info="TC of avalanche prefactor", unit="1/K"*) parameter real alkav = 0.0;
- (*spice_name="aleav", info="TC of avalanche exponential factor", unit="1/K"*) parameter real aleav = 0.0;
-
-// Self-heating
- (*spice_name="flsh", info="Flag for self-heating calculation", test_value="2"*) parameter integer flsh = 0 from [0:2];
- (*spice_name="rth", info="Thermal resistance", test_value="200.0", unit="K/W", m_inverse_factor="yes"*) parameter real rth = 0.0 from [0:`INF);
- (*spice_name="cth", info="Thermal capacitance", test_value="0.1", unit="Ws/K", m_factor="yes"*) parameter real cth = 0.0 from [0:`INF);
-
-// Transistor type
- (*spice_isflag="yes", info="model type flag for npn" *) parameter integer npn = 1 from [0:1];
- (*info="model type flag for pnp" *) parameter integer pnp = 0 from [0:1];
-
-//Circuit simulator specific parameters
- (*spice_name="tnom", info="Temperature for which parameters are valid", unit="C"*) parameter real tnom = 27;
- (*spice_name="dt", type="instance", info="Temperature change for particular transistor", unit="K"*) parameter real dt = 0.0;
-
-
-// Declaration of the variables: begin
-
- real _circuit_gmin;
-
- real HICUMtype ;
-
- // QCJMOD
- real cj0,vd,z,aj;
- real zr,vp;
- real cmax,cr,ve;
- real ee1,ez,ezr,vdj1,vdj2,ex1,vr,vj1,vj2,vj4;
- real qj1,qj2,qj3,qjf;
-
-
- //Cjfun *** VT, removed: BA
- real cj1,cj2,cj3,cjf;
-
-
- //cjtfun *** tnom,VT,mg,Vt0, removed: BA
- real vg;
- real vdj0,vdjt,cj0_t,vd_t,aj_t;
-
-
- // temperature and drift
- real VT,Tamb,Tdev,Tnom,dT,qtt0,ln_qtt0;
- real vde_t,vdci_t,vdcx_t,vds_t;
- real is_t,ires_t,ibes_t,ibcs_t;
- real itss_t,iscs_t,cje0_t,cjci0_t,cjcx0_t;
- real cjs0_t,rci0_t,vlim_t;
- real vces_t,thcs_t,tef0_t,rbi0_t;
- real rbx_t,rcx_t,re_t,t0_t,eavl_t,kavl_t;
- real aje_t;
-
- // bc charge and cap
- (*ask="yes", info="B-C internal junction charge", unit="C"*) real qjci ;
- real qjcx,qjcii,cjcii,qjcxi,qjciii; //cjcx
- real cjci0_t_ii,cjcx0_t_ii,cjcx0_t_i,v_j;
-
- // be junction
- (*ask="yes", info="B-E internal junction charge", unit="C"*) real qjei ;
- (*ask="yes", info="B-E internal junction capacitance", unit="F"*) real cjei_i ; // dw: adms2.2.7 problem
- real cjei,vf,vj,x,y,e1,e2;
-
- // transfer and internal base current
- real cc,qj_2,facl;
- real tf0,ickf,ickr,itfi,itri,qm;
- real qpt,itf,itr;
- (*ask="yes", info="Transfer Current", unit="A"*) real it ;
- real ibe,ire,ibi;
- real itfl,itrl,al,s3l,wl,d_qfh;
-
- // be diffusion charge
- real qf,qf0,dqfh,dqef;
- real dtef,dtfh,tf,ick;
- real vc,vceff,s3,w,a,tww;
-
- // bc diffusion charge
- real qr;
-
- // avalanche current source
- real v_bord,a_iavl,lncc;
-
- // base resistance
- real rb,eta,rbi,qje,Qz_nom,fQz;
-
- // substrate transistor, diode and cap
- real qjs,HSa,HSb,HSI_Tsu,HSUM;
-
- // self heating
- real pterm;
-
- // new for temperature dependence
- real mg,zetabci,zetasct,zetatef,avs;
- real k1,k2,vgbe,vgbc,vgsc,dvg;
- real xvf,xvf2,dvj,uvc,Vt0;
-
- // noise
- real flicker_Pwr,fourkt,twoq;
-
- // LIN_EXP
- real le,arg,le1,arg1,le2,arg2;
-
- //HICDIO
- real IS,IST,UM1,U,Iz,DIOY;
-
- // branch voltages
- real Vbci,Vbici,Vbiei,Vciei,Vsci,Veie,Vbbi,Vcic,Vbe,Vrth;
-
- //Output to be seen
- (*ask="yes", info="Base-collector diode current", unit="A"*) real ijbc ;
- (*ask="yes", info="Avalanche current", unit="A"*) real iavl ;
- (*ask="yes", info="Substrate-collector diode current", unit="A"*) real ijsc ;
- (*ask="yes", info="Current through external to internal emitter node", unit="A"*) real Ieei ;
- (*ask="yes", info="Current through external to internal collector node", unit="A"*) real Icci ;
- (*ask="yes", info="Current through external to internal base node", unit="A"*) real Ibbi ;
- (*ask="yes", info="Base-collector diode current minus the avalanche current", unit="A"*) real Ibici ;
- (*ask="yes", info="Base-emitter diode current", unit="A"*) real ijbe ;
-
- real Qbci,Qbe,Qbici,Qbiei;
-//Declaration of the variables: end
-
-
-//
-//======================== calculation of the transistor ===================
-//
-
-analog begin
-
-// assign voltages with regard to transistor type
-
- begin : initial_model
- if ($param_given(npn))
- HICUMtype = `NPN;
- else if ($param_given(pnp))
- HICUMtype = `PNP;
- else
- HICUMtype = `NPN;
- end
-
- Vbci = HICUMtype*V(br_bci);
- Vbici = HICUMtype*V(br_bici);
- Vbiei = HICUMtype*V(br_biei);
- Vciei = HICUMtype*V(br_ciei);
- Vsci = HICUMtype*V(br_sci);
- Veie = V(br_eie_v);
- Vcic = V(br_cic_v);
- Vbbi = V(br_bbi_v);
- Vbe = HICUMtype*V(br_be);
- Vrth = V(br_sht);
-
-
-
-//
-// temperature and resulting parameter drift
-//
-
- Tnom = tnom+273.15;
- Tamb = $temperature;
- Tdev = Tamb+dt+Vrth;
-
-// Limit temperature to avoid FPE's in equations
- if(Tdev < `TMIN + 273.15) begin
- Tdev = `TMIN + 273.15;
- end else begin
- if (Tdev > `TMAX + 273.15) begin
- Tdev = `TMAX + 273.15;
- end
- end
-
- Vt0 = `P_K*Tnom /`P_Q;
- VT = `P_K*Tdev /`P_Q;
- dT = Tdev-Tnom;
- qtt0 = Tdev/Tnom;
- ln_qtt0 = ln(qtt0);
- k1 = f1vg*Tnom;
- k2 = f2vg*Tnom+k1*ln(Tnom);
- avs = alvs*Tnom;
- vgbe = (vgb+vge)/2;
- vgbc = (vgb+vgc)/2;
- vgsc = (vgs+vgc)/2;
- mg = 3-`P_Q*f1vg/`P_K;
- zetabci = mg+1-zetaci;
- zetasct = mg-1.5; //+1-m_upS with m_upS=2.5
- is_t = is*exp(zetact*ln_qtt0+vgb/VT*(qtt0-1));
- ibes_t = ibes*exp(zetabet*ln_qtt0+vge/VT*(qtt0-1));
- ires_t = ires*exp(0.5*mg*ln_qtt0+0.5*vgbe/VT*(qtt0-1));
- ibcs_t = ibcs*exp(zetabci*ln_qtt0+vgc/VT*(qtt0-1));
- itss_t = itss*exp(zetasct*ln_qtt0+vgc/VT*(qtt0-1));
- iscs_t = iscs*exp(zetasct*ln_qtt0+vgs/VT*(qtt0-1));
- `TMPHICJ(cje0,vde,ze,vgbe,cje0_t,vde_t)
- aje_t = aje*vde_t/vde;
- `TMPHICJ(cjci0,vdci,zci,vgbc,cjci0_t,vdci_t)
- `TMPHICJ(cjcx0,vdcx,zcx,vgbc,cjcx0_t,vdcx_t)
- `TMPHICJ(cjs0,vds,zs,vgsc,cjs0_t,vds_t)
- rci0_t = rci0*exp(zetaci*ln_qtt0);
- vlim_t = vlim*exp((zetaci-avs)*ln_qtt0);
- vces_t = vces*(1+alces*dT);
- t0_t = t0*(1+alt0*dT+kt0*dT*dT);
- thcs_t = thcs*exp((zetaci-1)*ln_qtt0);
- zetatef = zetabet-zetact-0.5;
- dvg = vgb-vge;
- tef0_t = tef0*exp(zetatef*ln_qtt0-dvg/VT*(qtt0-1));
- rbx_t = rbx*exp(zetarbx*ln_qtt0);
- rcx_t = rcx*exp(zetarcx*ln_qtt0);
- rbi0_t = rbi0*exp(zetarbi*ln_qtt0);
- re_t = re*exp(zetare*ln_qtt0);
- eavl_t = eavl*exp(aleav*dT);
- kavl_t = kavl*exp(alkav*dT);
-
-
-//
-// Calculation of intrinsic transistor elements
-//
-
-// BC charge and cap (internal and external)
-
-// The cjcx0 value is used to switch between one (cjcx0=0) and two bc parameter sets
-// 1. For one parameter set only the internal bc set is partitioned by fbc
-// 2. For two independent sets only the external set is partitioned by fbc
-
- if (cjcx0_t==0) begin
- cjci0_t_ii = cjci0_t*fbc; // zero bias internal portion
- qjcxi = 0;
- cjcx0_t_i = cjci0_t*(1-fbc); // zero bias external portion
- `HICJQ(Vbci,cjcx0_t_i,vdci_t,zci,vptci,qjcx)
- end else begin
- cjci0_t_ii = cjci0_t; // zero bias internal portion
- cjcx0_t_ii = cjcx0_t*fbc;
- `HICJQ(Vbici,cjcx0_t_ii,vdcx_t,zcx,vptcx,qjcxi)
- cjcx0_t_i = cjcx0_t*(1-fbc); // zero bias external portion
- `HICJQ(Vbci,cjcx0_t_i,vdcx_t,zcx,vptcx,qjcx)
- end
- `HICJQ(Vbici,cjci0_t_ii,vdci_t,zci,vptci,qjci)
- qjcii = qjci+qjcxi;
-
-//Internal bc cap without punch through for cc
-
- //`HICJQ(Vbici,cjci0_t_ii,vdci_t,zci,100,qjciii)
- `QCMODF(Vbici,cjci0_t_ii,vdci_t,zci,2.4,cjcii)
- //cjcii = ddx(qjciii,V(bi));
-
-//Internal be cap and charge
-
- `QJMODF(Vbiei,cje0_t,vde_t,ze,aje_t,qjei)
- cjei = ddx(qjei,V(bi));
- cjei_i = cjei; // dw: adms2.2.7 problem
-
-// Critical current: ick
- vc = Vciei-vces_t;
- uvc = vc/VT-1;
- vceff = VT*(1+0.5*(uvc+sqrt(uvc*uvc+1.921812)));
- x = (vceff-vlim_t)/vpt;
- ick = vceff*(1+0.5*(x+sqrt(x*x+1e-3)))/rci0_t/sqrt(1+vceff*vceff/vlim_t/vlim_t);
-
-// Transfer current
-
-// Normalized BC cap and carge
- cc = cjci0_t_ii/cjcii;
- qjci = qjci/cjci0_t_ii;
- qj_2 = (1+qjci/vef)/2;
-
-// Minority charge transit time
- tf0 = t0_t+dt0h*(cc-1)+tbvl*(1/cc-1);
-
-// DC critical currents
- ickf = iqf;
- ickr = iqr;
-
-// Ideal transfer currents
- arg1 = Vbiei/(mcf*VT);
- `LIN_EXP(le1,arg1)
- itfi=is_t*le1;
-
- arg2 = Vbici/(mcr*VT);
- `LIN_EXP(le2,arg2)
- itri=is_t*le2;
-
-
-// Normalized minority charge
- qm = (itfi/ickf+itri/ickr);
-
-// Normalized total hole charge
- qpt = qj_2+sqrt((qj_2)*(qj_2)+qm);
- if (qpt<=1e-20) begin
- qpt=1e-20;
- end
-
-// Low transfer current
- itfl = itfi/qpt;
- itrl = itri/qpt;
-
-// Normalized injection width with low transfer current
-// and normalized charge component
- if (itfl<=1e-20) begin
- itfl = 1e-20;
- end
- al = 1-ick/itfl;
- s3l = sqrt(al*al+ahc);
- wl = (al+s3l)/(1+sqrt(1+ahc));
- d_qfh = (wl*wl+tfh*itfl/ick)*itfl/iqfh;
-
-// Transfer current
- facl = 1/(1+d_qfh/qpt);
- itf = itfl*facl;
- itr = itrl*facl;
- if (itf<=1e-20) begin
- itf = 1e-20;
- end
- it = itf-itr;
-
-// BE diffusion charge
-
-// Calculation of low-current portion
- qf0 = tf0*itf;
-
-// Current dependent component
- a = 1-ick/itf;
- s3 = sqrt(a*a+ahc);
- w = (a+s3)/(1+sqrt(1+ahc));
- tww = thcs_t*w*w;
- dqfh = tww*itf;
- dtfh = tww*(1+2*ick/itf/s3);
-
-// Emitter component
- dtef = tef0_t*exp(gte*ln(itf/ick));
- dqef = dtef*itf/(gte+1.0);
-
-// Total minority charge and transit time
- qf = qf0+dqef+dqfh;
- tf = tf0+dtfh+dtef;
-
-// BC diffusion charge
- qr = tr*itr;
-
-// Internal base current
-
-// BE diode
- `HICDIO(ibes,ibes_t,mbe,Vbiei,ibe)
- `HICDIO(ires,ires_t,mre,Vbiei,ire)
- ijbe = ibe+ire;
-
-// BC diode
- `HICDIO(ibcs,ibcs_t,mbc,Vbici,ijbc)
-
-// Total base current
- ibi = ijbe+ijbc;
-
-// Avalanche current
-
- if (Vbici < 0) begin : HICAVL
- v_bord = eavl_t*vdci_t;
- if (vdci_t-Vbici>v_bord) begin
- a_iavl = kavl_t/vdci_t*exp(-cc);
- iavl = itf*a_iavl*(v_bord+(1+cc)*(vdci_t-Vbici-v_bord));
- end else begin
- lncc = ln(1/cc);
- iavl = kavl_t*itf*exp(-1/zci*lncc-eavl_t*exp((1/zci-1)*lncc));
- end
- end else begin
- iavl = 0;
- end
-
-//
-// Additional elements for external transistor
-//
-
-// Base resistance
- if(rbi0_t > 0.0) begin : HICRBI
- // Conductivity modulation with hyperbolic smoothing
- qje = qjei/cje0_t;
- Qz_nom = 1+qje/vr0e+qjci/vr0c+itf/ickf+itr/ickr;
- fQz = 0.5*(Qz_nom+sqrt(Qz_nom*Qz_nom+0.01));;
- rbi = rbi0_t/fQz;
- // Emitter current crowding
- if (ibi > 0.0) begin
- eta = fgeo*rbi*ibi/VT;
- if (eta < 1e-6) begin
- rbi = rbi*(1-0.5*eta);
- end else begin
- rbi = rbi*ln(eta+1)/eta;
- end
- end
- end else begin
- rbi = 0.0;
- end
- // Total base resistance
- rb = rbi+rbx_t;
-
-// Parasitic substrate transistor transfer current
- if(itss > 0.0) begin : Sub_Transfer
- HSUM = msf*VT;
- HSa = limexp(Vbci/HSUM);
- HSb = limexp(Vsci/HSUM);
- HSI_Tsu = itss_t*(HSa-HSb);
- end else begin
- HSI_Tsu = 0.0;
- end
-
-// Substrate diode and cap and charge
-
- `HICDIO(iscs,iscs_t,msc,Vsci,ijsc)
-
- `HICJQ(Vsci,cjs0_t,vds_t,zs,vpts,qjs)
-
-// Self heating
-
- if (flsh == 1 && rth >= `MIN_R) begin
- pterm = it*Vciei+iavl*(vdci_t-Vbici);
- end else if (flsh == 2 && rth >= `MIN_R) begin
- pterm = Vciei*it + (vdci_t-Vbici)*iavl + ijbe*Vbiei + ijbc*Vbici + ijsc*Vsci;
- if (rb >= `MIN_R) begin
- pterm = pterm + Vbbi*Vbbi/rb;
- end
- if (re_t >= `MIN_R) begin
- pterm = pterm + Veie*Veie/re_t;
- end
- if (rcx_t >= `MIN_R) begin
- pterm = pterm + Vcic*Vcic/rcx_t;
- end
- end
-
-//
-// Compute branch sources
-//
-
- Ibici = ijbc - iavl;
-
- Qbci = cbcpar*Vbci;
- Qbe = cbepar*Vbe;
- Qbici = qjcii+qr;
- Qbiei = qjei+qf;
-
- ijsc = HICUMtype*ijsc;
- qjs = HICUMtype*qjs;
- qjcx = HICUMtype*qjcx;
- Qbci = HICUMtype*Qbci;
- Qbe = HICUMtype*Qbe;
-
- Ibici = HICUMtype*Ibici;
- Qbici = HICUMtype*Qbici;
- ijbe = HICUMtype*ijbe;
- Qbiei = HICUMtype*Qbiei;
- it = HICUMtype*it;
-
-//
-// Define branch sources
-//
- I(br_biei) <+ _circuit_gmin*V(br_biei);
- I(br_bici) <+ _circuit_gmin*V(br_bici);
-
- I(br_bs) <+ HSI_Tsu;
- I(br_sci) <+ ijsc + _circuit_gmin*V(br_sci); //`P(spectre_gmin="add", spectre_pwl_passive="1e10");
- I(br_sci) <+ ddt(qjs);
- I(br_bci) <+ ddt(qjcx);
- I(br_bci) <+ ddt(Qbci);
- I(br_be) <+ ddt(Qbe);
- if (re >= `MIN_R) begin
- I(br_eie_i) <+ Veie/re_t + _circuit_gmin*V(br_eie_i);//`P(spectre_gmin="add");
- end else begin
- V(br_eie_v) <+ 0.0;
- end
- if (rcx >= `MIN_R) begin
- I(br_cic_i) <+ Vcic/rcx_t + _circuit_gmin*V(br_cic_i);//`P(spectre_gmin="add");
- end else begin
- V(br_cic_v) <+ 0.0;
- end
- if (rbi0 >= `MIN_R || rbx >= `MIN_R) begin
- I(br_bbi_i) <+ Vbbi/rb + _circuit_gmin*V(br_bbi_i); //`P(spectre_gmin="add");
- end else begin
- V(br_bbi_v) <+ 0.0;
- end
- I(br_bici) <+ Ibici + _circuit_gmin*V(br_bici); //`P(spectre_gmin="add", spectre_pwl_sat_current="IMAX", spectre_pwl_sat_cond="imax/0.025", spectre_pwl_rev_current="imax", spectre_pwl_rev_cond="IMAX/0.025");
- I(br_bici) <+ ddt(Qbici);
- I(br_biei) <+ ijbe + _circuit_gmin*V(br_biei); //`P(spectre_gmin="add", spectre_pwl_fwd_current="IBEIS*exp(25.0)", spectre_pwl_fwd_node="bi", spectre_pwl_fwd_cond="IBEIS*exp(25.0)/0.025", spectre_pwl_sat_current="IMAX", spectre_pwl_sat_cond="IMAX/0.025", spectre_pwl_passive="1e10");
- I(br_biei) <+ ddt(Qbiei);
- I(br_ciei) <+ it; //`P(spectre_pwl_fwd_current="IS*exp(25.0)", spectre_pwl_fwd_node="bi", spectre_pwl_fwd_cond="IS*exp(25.0)/0.025", spectre_pwl_rev_current="IMAX", spectre_pwl_rev_cond="IMAX/0.025", spectre_pwl_passive="1e10")
-
- // Following code is an intermediate solution:
- // ******************************************
- if(flsh == 0 || rth < `MIN_R) begin
- I(br_sht) <+ Vrth/`MIN_R;
- end else begin
- I(br_sht) <+ Vrth/rth-pterm + _circuit_gmin*V(br_sht);//`P(spectre_gmin="add");
- I(br_sht) <+ ddt(cth*Vrth);
- end
- // ******************************************
- // For simulators having no problem with V(br_sht) <+ 0.0
- // with external thermal node, follwing code may be used.
- // This external thermal node should remain accessible.
- // ********************************************
- //if(flsh == 0 || rth < `MIN_R) begin
- // V(br_sht) <+ 0.0;
- //end else begin
- // I(br_sht) <+ Vrth/rth-pterm `P(spectre_gmin="add");
- // I(br_sht) <+ ddt(cth*Vrth);
- //end
- // ********************************************
-
-// Noise sources
-// Thermal noise
- fourkt = 4.0 * `P_K * Tdev;
- if(rbx >= `MIN_R || rbi0 >= `MIN_R) begin
- I(br_bbi_i) <+ white_noise(fourkt/rb);
- end
- if(rcx >= `MIN_R) begin
- I(br_cic_i) <+ white_noise(fourkt/rcx_t);
- end
- if(re >= `MIN_R) begin
- I(br_eie_i) <+ white_noise(fourkt/re_t);
- end
-
-// Shot noise
- twoq = 2.0 * `P_Q;
- I(br_biei) <+ white_noise(twoq*ijbe);
- I(br_ciei) <+ white_noise(twoq*it);
-
-// Flicker noise
- flicker_Pwr = kf*pow(ijbe,af);
- I(br_biei) <+ flicker_noise(flicker_Pwr,1.0);
-
-end // analog
-endmodule
diff --git a/src/spicelib/devices/adms/hicum2/adms3va/hicum2.va b/src/spicelib/devices/adms/hicum2/adms3va/hicum2.va
deleted file mode 100644
index f2cdebf1e..000000000
--- a/src/spicelib/devices/adms/hicum2/adms3va/hicum2.va
+++ /dev/null
@@ -1,1658 +0,0 @@
-//HICUM Level_2 Version_2.24: A Verilog-A Description
-
-//dw 09/10: Modifications for ngspice and adms:
-// backup to ddx for capacitance calculation
-// all V(...) <+ 0.0; are replaced by I(...) < V(...)/`MIN_R;
-// using GMIN from ngspice: _circuit_gmin
-// switch of section for correlated noise (see below)
-// removed obsolete variables S_avl, f_p
-// don't like internal variable declaration
-
-//**************New Implementations*****************
-
-//******************************************************************************
-//This code contains a Verilog-A implementation of Vertical Non-Quasi-Static(NQS)
-//Effects using adjunct gyrator networks. To turn on this effect please set FLNQS=1.
-//Although Vertical NQS effects have been taken into account in HICUM from the very
-//beginning (see original FTN code and built-in v2.1 HICUM model inside most of the
-//existing circuit simulators) their implementation has been based on Weil's approach.
-//However, using Verilog, it is presently not possible to implement Weil's approach,
-//since there does not exist access to previous time-steps of the simulatior.
-//The nearly available Verilog-A solution reproduces the results of previous
-//HICUM versions (cf. documentation).
-//******************************************************************************
-
-//******************************************************************************
-// Implementation of noise correlation
-// Please turn-off (by front slash “//”) the noise correlation code section for simulation with Spectre
-//******************************************************************************
-
-// ***************Bug fix and optimization*************
-// 12/09: Elimination of 'ddx' operator for internal capacitance determination
-// Capacitances will be calculated by Analytical Equations
-// 10/09: Temperature coefficient (ZETAxyz) range modified to [-10:10]
-// 09/09: VPT ranges modified from [0:inf] to (0:inf]
-// 07/09: DT0H rabge modified from no range to (-inf:inf)
-// 03/09: Simplified input NQS adjacent circuit (RC network)
-// 04/08: New range has been defined for FDQR0.
-// 11/07: Bugs have been fixed in macro HICFCI and HICQFC
-// 10/06: in @(initial_model), external if-block for HICTUN_T removed
-// 11/06: within HICQFC, minor changes made for LATB<=0.01;
-// also HICFCI and HICFCT are changed accordingly
-// to ensure correct derivatives
-// Upper limit of FGEO parameter was changed to infinity.
-// 12/06: expressions for Cdei and Cdci are corrected not to include
-// Ccdei and Cbdci respectively (used in Crbi expression).
-
-// 01/06: FCdf1_dw assigned expression (missing in v2.21)
-// FCa and FCa1 are found to have same expression: FCa is omitted in those cases
-// FCa1 written instead of FCa in the expression for FCf_ci
-// Thermal node "tnode" set as external
-// zetasct = mg+1-2.5 changed to zetasct = mg-1.5;
-// Code optimization: Temperature dependent parts are moduled in two separate blocks:
-// within @(initial_model) when self-heating is OFF
-// outside @(initial_model) when self-heating is ON
-// 03/06 : Further fix
-// vlim_t,ibcis_t,ibcxs_t,itss_t,iscs_t considered in compatibility block
-// ddt() operators are separated in contribution expressions.
-// FLCOMP parameter is given different values
-// 05/06:
-// all if-else blocks marked with begin-end
-// unused variables deleted
-// all series resistors and RTH are allowed to have a minimum value MIN_R
-// only tunelling current source contribution within if-then-else
-// 06/06: HICRBI deleted and instead the code changed (hyperbolic smoothing in
-// conductivity modulation part) and put in relevant portion of the code.
-// 07/06: ddx() operator used to find out capacitances from charges:
-// QJMODF,QJMOD,HICJQ changed accordingly
-// Lateral NQS effect modified with ddx() operator.
-// HICFCT included for downward compatibility reason.
-// Few macros are taken inside the code: HICICK, HICAVL, HICTUN (more optimized),
-// internal base resistance (Qjci included under conductivity modulation, hyperbolic smoothing used)
-// Gmin added at (bi,ei) and (bi,ci) branches.
-// 08/06: Units added in the parameter descriptions.
-
-// *********************************************************************************
-// 06/06: Comment on NODE COLLAPSING:
-// Presently this verilog code permits a minimum of 1 milli-Ohm resistance for any
-// series resistance as well as for thermal resistance RTH. If any of the resistance
-// values drops below this minimum value, the corresponding nodes are shorted with
-// zero voltage contribution. We want the model compilers/simulators deal this
-// situation in such a manner that the corresponding node is COLLAPSED.
-// We expect that the simulators should permit current contribution statement
-// for any branch with resistance value more than (or equal to) 1 milli-Ohm without
-// any convergence problem. In fact, we wish NOT to have to use a voltage contribution
-// statement in our Verilog code, except as an indication for the model compiler/simulator
-// to interprete a zero branch voltage as NODE-COLLAPSING action.
-// **********************************************************************************
-
-
-//Default simulator: Spectre
-
-`ifdef insideADMS
- `define MODEL @(initial_model)
- `define NOISE @(noise)
- `define ATTR(txt) (*txt*)
-`else
- `define MODEL
- `define NOISE
- `define ATTR(txt)
-`endif
-
-
-`define VPT_thresh 1.0e2
-`define Dexp_lim 80.0
-`define Cexp_lim 80.0
-`define DFa_fj 1.921812
-`define RTOLC 1.0e-5
-`define l_itmax 100
-`define TMAX 326.85
-`define TMIN -100.0
-`define LN_EXP_LIMIT 11.0
-`define MIN_R 0.001
-//`define Gmin 1.0e-12
-//`define Gmin $simparam("gmin",1e-12) //suggested by L.L
-
-//ADS
-//`include "constants.vams"
-//`include "disciplines.vams"
-//`include "compact.vams"
-
-//Spectre
-`include "constants.h"
-`include "discipline.h"
-
-//////////////Explicit Capacitance and Charge Expression///////////////
-
-// DEPLETION CHARGE CALCULATION
-// Hyperbolic smoothing used; no punch-through
-// INPUT:
-// c_0 : zero-bias capacitance
-// u_d : built-in voltage
-// z : exponent coefficient
-// a_j : control parameter for C peak value at high forward bias
-// U_cap : voltage across junction
-// IMPLICIT INPUT:
-// VT : thermal voltage
-// OUTPUT:
-// Qz : depletion Charge
-// C : depletion capacitance
-`define QJMODF(c_0,u_d,z,a_j,U_cap,C,Qz)\
- if(c_0 > 0.0) begin\
- DFV_f = u_d*(1.0-exp(-ln(a_j)/z));\
- DFv_e = (DFV_f-U_cap)/VT;\
- DFs_q = sqrt(DFv_e*DFv_e+`DFa_fj);\
- DFs_q2 = (DFv_e+DFs_q)*0.5;\
- DFv_j = DFV_f-VT*DFs_q2;\
- DFdvj_dv = DFs_q2/DFs_q;\
- DFb = ln(1.0-DFv_j/u_d);\
- DFC_j1 = c_0*exp(-z*DFb)*DFdvj_dv;\
- C = DFC_j1+a_j*c_0*(1.0-DFdvj_dv);\
- DFQ_j = c_0*u_d*(1.0-exp(DFb*(1.0-z)))/(1.0-z);\
- Qz = DFQ_j+a_j*c_0*(U_cap-DFv_j);\
- end else begin\
- C = 0.0;\
- Qz = 0.0;\
- end
-
-////////////////////////////////////////////////////////////////
-
-
-//////////////Explicit Capacitance and Charge Expression///////////////
-
-
-// DEPLETION CHARGE CALCULATION CONSIDERING PUNCH THROUGH
-// smoothing of reverse bias region (punch-through)
-// and limiting to a_j=Cj,max/Cj0 for forward bias.
-// Important for base-collector and collector-substrate junction
-// INPUT:
-// c_0 : zero-bias capacitance
-// u_d : built-in voltage
-// z : exponent coefficient
-// a_j : control parameter for C peak value at high forward bias
-// v_pt : punch-through voltage (defined as qNw^2/2e)
-// U_cap : voltage across junction
-// IMPLICIT INPUT:
-// VT : thermal voltage
-// OUTPUT:
-// Qz : depletion charge
-// C : depletion capacitance
-`define QJMOD(c_0,u_d,z,a_j,v_pt,U_cap,C,Qz)\
- if(c_0 > 0.0) begin\
- Dz_r = z/4.0;\
- Dv_p = v_pt-u_d;\
- DV_f = u_d*(1.0-exp(-ln(a_j)/z));\
- DC_max = a_j*c_0;\
- DC_c = c_0*exp((Dz_r-z)*ln(v_pt/u_d));\
- Dv_e = (DV_f-U_cap)/VT;\
- if(Dv_e < `Cexp_lim) begin\
- De = exp(Dv_e);\
- De_1 = De/(1.0+De);\
- Dv_j1 = DV_f-VT*ln(1.0+De);\
- end else begin\
- De_1 = 1.0;\
- Dv_j1 = U_cap;\
- end\
- Da = 0.1*Dv_p+4.0*VT;\
- Dv_r = (Dv_p+Dv_j1)/Da;\
- if(Dv_r < `Cexp_lim) begin\
- De = exp(Dv_r);\
- De_2 = De/(1.0+De);\
- Dv_j2 = -Dv_p+Da*ln(1.0+De);\
- end else begin\
- De_2 = 1.0;\
- Dv_j2 = Dv_j1;\
- end\
- Dv_j4 = U_cap-Dv_j1;\
- DCln1 = ln(1.0-Dv_j1/u_d);\
- DCln2 = ln(1.0-Dv_j2/u_d);\
- Dz1 = 1.0-z;\
- Dzr1 = 1.0-Dz_r;\
- DC_j1 = c_0*exp(DCln2*(-z))*De_1*De_2;\
- DC_j2 = DC_c*exp(DCln1*(-Dz_r))*(1.0-De_2);\
- DC_j3 = DC_max*(1.0-De_1);\
- C = DC_j1+DC_j2+DC_j3;\
- DQ_j1 = c_0*(1.0-exp(DCln2*Dz1))/Dz1;\
- DQ_j2 = DC_c*(1.0-exp(DCln1*Dzr1))/Dzr1;\
- DQ_j3 = DC_c*(1.0-exp(DCln2*Dzr1))/Dzr1;\
- Qz = (DQ_j1+DQ_j2-DQ_j3)*u_d+DC_max*Dv_j4;\
- end else begin\
- C = 0.0;\
- Qz = 0.0;\
- end
-
-
-// DEPLETION CHARGE & CAPACITANCE CALCULATION SELECTOR
-// Dependent on junction punch-through voltage
-// Important for collector related junctions
-`define HICJQ(c_0,u_d,z,v_pt,U_cap,C,Qz)\
- if(v_pt < `VPT_thresh) begin\
- `QJMOD(c_0,u_d,z,2.4,v_pt,U_cap,C,Qz)\
- end else begin\
- `QJMODF(c_0,u_d,z,2.4,U_cap,C,Qz)\
- end
-
-
-// A CALCULATION NEEDED FOR COLLECTOR MINORITY CHARGE FORMULATION
-// INPUT:
-// zb,zl : zeta_b and zeta_l (model parameters, TED 10/96)
-// w : normalized injection width
-// OUTPUT:
-// hicfcio : function of equation (2.1.17-10)
-`define HICFCI(zb,zl,w,hicfcio,dhicfcio_dw)\
- z = zb*w;\
- lnzb = ln(1+zb*w);\
- if(z > 1.0e-6) begin\
- x = 1.0+z;\
- a = x*x;\
- a2 = 0.250*(a*(2.0*lnzb-1.0)+1.0);\
- a3 = (a*x*(3.0*lnzb-1.0)+1.0)/9.0;\
- r = zl/zb;\
- hicfcio = ((1.0-r)*a2+r*a3)/zb;\
- dhicfcio_dw = ((1.0-r)*x+r*a)*lnzb;\
- end else begin\
- a = z*z;\
- a2 = 3.0+z-0.25*a+0.10*z*a;\
- a3 = 2.0*z+0.75*a-0.20*a*z;\
- hicfcio = (zb*a2+zl*a3)*w*w/6.0;\
- dhicfcio_dw = (1+zl*w)*(1+z)*lnzb;\
- end
-
-
-// NEEDED TO CALCULATE WEIGHTED ICCR COLLECTOR MINORITY CHARGE
-// INPUT:
-// z : zeta_b or zeta_l
-// w : normalized injection width
-// OUTPUT:
-// hicfcto : output
-// dhicfcto_dw : derivative of output wrt w
-`define HICFCT(z,w,hicfcto,dhicfcto_dw)\
- a = z*w;\
- lnz = ln(1+z*w);\
- if (a > 1.0e-6) begin\
- hicfcto = (a - lnz)/z;\
- dhicfcto_dw = a / (1.0 + a);\
- end else begin\
- hicfcto = 0.5 * a * w;\
- dhicfcto_dw = a;\
- end
-
-
-// COLLECTOR CURRENT SPREADING CALCULATION
-// collector minority charge incl. 2D/3D current spreading (TED 10/96)
-// INPUT:
-// Ix : forward transport current component (itf)
-// I_CK : critical current
-// FFT_pcS : dependent on fthc and thcs (parameters)
-// IMPLICIT INPUT:
-// ahc, latl, latb : model parameters
-// VT : thermal voltage
-// OUTPUT:
-// Q_fC, Q_CT: actual and ICCR (weighted) hole charge
-// T_fC, T_cT: actual and ICCR (weighted) transit time
-// Derivative dfCT_ditf not properly implemented yet
-`define HICQFC(Ix,I_CK,FFT_pcS,Q_fC,Q_CT,T_fC,T_cT)\
- Q_fC = FFT_pcS*Ix;\
- FCa = 1.0-I_CK/Ix;\
- FCrt = sqrt(FCa*FCa+ahc);\
- FCa_ck = 1.0-(FCa+FCrt)/(1.0+sqrt(1.0+ahc));\
- FCdaick_ditf = (FCa_ck-1.0)*(1-FCa)/(FCrt*Ix);\
- if(latb > latl) begin\
- FCz = latb-latl;\
- FCxl = 1.0+latl;\
- FCxb = 1.0+latb;\
- if(latb > 0.01) begin\
- FCln = ln(FCxb/FCxl);\
- FCa1 = exp((FCa_ck-1.0)*FCln);\
- FCd_a = 1.0/(latl-FCa1*latb);\
- FCw = (FCa1-1.0)*FCd_a;\
- FCdw_daick = -FCz*FCa1*FCln*FCd_a*FCd_a;\
- FCa1 = ln((1.0+latb*FCw)/(1.0+latl*FCw));\
- FCda1_dw = latb/(1.0+latb*FCw) - latl/(1.0+latl*FCw);\
- end else begin\
- FCf1 = 1.0-FCa_ck;\
- FCd_a = 1.0/(1.0+FCa_ck*latb);\
- FCw = FCf1*FCd_a;\
- FCdw_daick = -1.0*FCd_a*FCd_a*FCxb*FCd_a;\
- FCa1 = FCz*FCw;\
- FCda1_dw = FCz;\
- end\
- FCf_CT = 2.0/FCz;\
- FCw2 = FCw*FCw;\
- FCf1 = latb*latl*FCw*FCw2/3.0+(latb+latl)*FCw2/2.0+FCw;\
- FCdf1_dw = latb*latl*FCw2 + (latb+latl)*FCw + 1.0;\
- `HICFCI(latb,latl,FCw,FCf2,FCdf2_dw)\
- `HICFCI(latl,latb,FCw,FCf3,FCdf3_dw)\
- FCf_ci = FCf_CT*(FCa1*FCf1-FCf2+FCf3);\
- FCdfc_dw = FCf_CT*(FCa1*FCdf1_dw+FCda1_dw*FCf1-FCdf2_dw+FCdf3_dw);\
- FCdw_ditf = FCdw_daick*FCdaick_ditf;\
- FCdfc_ditf = FCdfc_dw*FCdw_ditf;\
- if(flcomp == 0.0 || flcomp == 2.1) begin\
- `HICFCT(latb,FCw,FCf2,FCdf2_dw)\
- `HICFCT(latl,FCw,FCf3,FCdf3_dw)\
- FCf_CT = FCf_CT*(FCf2-FCf3);\
- FCdfCT_dw = FCf_CT*(FCdf2_dw-FCdf3_dw);\
- FCdfCT_ditf = FCdfCT_dw*FCdw_ditf;\
- end else begin\
- FCf_CT = FCf_ci;\
- FCdfCT_ditf = FCdfc_ditf;\
- end\
- end else begin\
- if(latb > 0.01) begin\
- FCd_a = 1.0/(1.0+FCa_ck*latb);\
- FCw = (1.0-FCa_ck)*FCd_a;\
- FCdw_daick = -(1.0+latb)*FCd_a*FCd_a;\
- end else begin\
- FCw = 1.0-FCa_ck-FCa_ck*latb;\
- FCdw_daick = -(1.0+latb);\
- end\
- FCw2 = FCw*FCw;\
- FCz = latb*FCw;\
- FCz_1 = 1.0+FCz;\
- FCd_f = 1.0/(FCz_1);\
- FCf_ci = FCw2*(1.0+FCz/3.0)*FCd_f;\
- FCdfc_dw = 2.0*FCw*(FCz_1+FCz*FCz/3.0)*FCd_f*FCd_f;\
- FCdw_ditf = FCdw_daick*FCdaick_ditf;\
- FCdfc_ditf = FCdfc_dw*FCdw_ditf;\
- if(flcomp == 0.0 || flcomp == 2.1) begin\
- if (FCz > 0.001) begin\
- FCf_CT = 2.0*(FCz_1*ln(FCz_1)-FCz)/(latb*latb*FCz_1);\
- FCdfCT_dw = 2.0*FCw*FCd_f*FCd_f;\
- end else begin\
- FCf_CT = FCw2*(1.0-FCz/3.0)*FCd_f;\
- FCdfCT_dw = 2.0*FCw*(1.0-FCz*FCz/3.0)*FCd_f*FCd_f;\
- end\
- FCdfCT_ditf = FCdfCT_dw*FCdw_ditf;\
- end else begin\
- FCf_CT = FCf_ci;\
- FCdfCT_ditf = FCdfc_ditf;\
- end\
- end\
- Q_CT = Q_fC*FCf_CT;\
- Q_fC = Q_fC*FCf_ci;\
- T_fC = FFT_pcS*(FCf_ci+Ix*FCdfc_ditf);\
- T_cT = FFT_pcS*(FCf_CT+Ix*FCdfCT_ditf);
-
-// TRANSIT-TIME AND STORED MINORITY CHARGE
-// INPUT:
-// itf : forward transport current
-// I_CK : critical current
-// T_f : transit time \
-// Q_f : minority charge / for low current
-// IMPLICIT INPUT:
-// tef0, gtfe, fthc, thcs, ahc, latl, latb : model parameters
-// OUTPUT:
-// T_f : transit time \
-// Q_f : minority charge / transient analysis
-// T_fT : transit time \
-// Q_fT : minority charge / ICCR (transfer current)
-// Q_bf : excess base charge
-`define HICQFF(itf,I_CK,T_f,Q_f,T_fT,Q_fT,Q_bf)\
- if(itf < 1.0e-6*I_CK) begin\
- Q_fT = Q_f;\
- T_fT = T_f;\
- end else begin\
- FFa = I_CK/itf;\
- FFd_TfE = tef0_t*exp(-gtfe*ln(FFa));\
- FFd_QfE = FFd_TfE*itf/(gtfe+1.0);\
- FFT_fbS = (1.0-fthc)*thcs_t;\
- FFx = 1.0-FFa;\
- FFs = sqrt(FFx*FFx+ahc);\
- FFw = (FFx+FFs)/(1.0+sqrt(1.0+ahc));\
- FFw_2 = FFw*FFw;\
- FFd_QfB = FFT_fbS*itf*FFw_2;\
- Q_bf = FFd_QfB;\
- FFa_w = FFw_2*(1.0+2.0*FFa/FFs);\
- FFd_TfB = FFT_fbS*FFa_w;\
- FFT_pcS = fthc*thcs_t;\
- if(latb <= 0.0 && latl <= 0.0) begin\
- FFQ_fC = FFT_pcS*itf*FFw_2;\
- FFT_fC = FFT_pcS*FFa_w;\
- FFQ_cT = FFQ_fC;\
- FFT_cT = FFT_fC;\
- end else begin\
- `HICQFC(itf,I_CK,FFT_pcS,FFQ_fC,FFQ_cT,FFT_fC,FFT_cT)\
- end\
- Q_f = Q_f+FFd_QfB;\
- T_f = T_f+FFd_TfB;\
- Q_fT = Q_f+hfe*FFd_QfE+hfc*FFQ_cT;\
- T_fT = T_f+hfe*FFd_TfE+hfc*FFT_cT;\
- Q_f = Q_f+FFd_QfE+FFQ_fC;\
- T_f = T_f+FFd_TfE+FFT_fC;\
- end
-
-
-
-
-// IDEAL DIODE (WITHOUT CAPACITANCE):
-// conductance calculation not required
-// INPUT:
-// IS, IST : saturation currents (model parameter related)
-// UM1 : ideality factor
-// U : branch voltage
-// IMPLICIT INPUT:
-// VT : thermal voltage
-// OUTPUT:
-// Iz : diode current
-`define HICDIO(IS,IST,UM1,U,Iz)\
- DIOY = U/(UM1*VT);\
- if (IS > 0.0) begin\
- if (DIOY > `Dexp_lim) begin\
- le = (1 + (DIOY - `Dexp_lim));\
- DIOY = `Dexp_lim;\
- end else begin\
- le = 1;\
- end\
- le = le*limexp(DIOY);\
- Iz = IST*(le-1.0);\
- if(DIOY <= -14.0) begin\
- Iz = -IST;\
- end\
- end else begin\
- Iz = 0.0;\
- end
-
-
-
-// TEMPERATURE UPDATE OF JUNCTION CAPACITANCE RELATED PARAMETERS
-// INPUT:
-// mostly model parameters
-// x : zero bias junction capacitance
-// y : junction built-in potencial
-// z : grading co-efficient
-// w : ratio of maximum to zero-bias value of capacitance or punch-through voltage
-// is_al : condition factor to check what "w" stands for
-// vgeff : band-gap voltage
-// IMPLICIT INPUT:
-// VT : thermal voltage
-// vt0,qtt0,ln_qtt0,mg : other model variables
-// OUTPUT:
-// c_j_t : temperature update of "c_j"
-// vd_t : temperature update of "vd0"
-// w_t : temperature update of "w"
-`define TMPHICJ(c_j,vd0,z,w,is_al,vgeff,c_j_t,vd_t,w_t)\
- if (c_j > 0.0) begin\
- vdj0 = 2*vt0*ln(exp(vd0*0.5/vt0)-exp(-0.5*vd0/vt0));\
- vdjt = vdj0*qtt0+vgeff*(1-qtt0)-mg*VT*ln_qtt0;\
- vdt = vdjt+2*VT*ln(0.5*(1+sqrt(1+4*exp(-vdjt/VT))));\
- vd_t = vdt;\
- c_j_t = c_j*exp(z*ln(vd0/vd_t));\
- if (is_al == 1) begin\
- w_t = w*vd_t/vd0;\
- end else begin\
- w_t = w;\
- end\
- end else begin\
- c_j_t = c_j;\
- vd_t = vd0;\
- w_t = w;\
- end
-
-
-
-module hic2_full (c,b,e,s,tnode);
-
-//Node definitions
-
-inout c,b,e,s,tnode;
-electrical c,b,e,s,ci,ei,bp,bi,si;
-electrical xf1,xf2;
-electrical xf; //RC nw
-
-electrical tnode;
-electrical n1,n2;
-
-//Branch definitions
-branch (b,bp) br_bbp_i;
-branch (b,bp) br_bbp_v;
-branch (ci,c) br_cic_i;
-branch (ci,c) br_cic_v;
-branch (ei,e) br_eie_i;
-branch (ei,e) br_eie_v;
-branch (bp,bi) br_bpbi_i;
-branch (bp,bi) br_bpbi_v;
-branch (si,s) br_sis_i;
-branch (si,s) br_sis_v;
-branch (bi,ei) br_biei;
-branch (bi,ci) br_bici;
-branch (ci,bi) br_cibi;
-branch (ci,ei) br_ciei;
-branch (ei,ci) br_eici;
-branch (bp,e) br_bpe;
-branch (b,e) br_be;
-branch (bp,ei) br_bpei;
-branch (bp,ci) br_bpci;
-branch (b,ci) br_bci;
-branch (si,ci) br_sici;
-branch (bp,si) br_bpsi;
-branch (tnode ) br_sht;
-
-//Phase network for ITF
-branch (xf1 ) br_bxf1;
-branch (xf1 ) br_cxf1;
-branch (xf2 ) br_bxf2;
-branch (xf2 ) br_cxf2;
-
-//Phase network for QF
-
-branch (xf ) br_bxf; //for RC nw
-branch (xf ) br_cxf; //for RC nw
-
-//Noise
-
-branch (n1 ) b_n1;
-branch (n2 ) b_n2;
-
-
-
-// -- ###########################################################
-// -- ########### Parameters initialization ################
-// -- ###########################################################
-
-
-//Transfer current
-parameter real c10 = 2.0E-30 from [0:1] `ATTR(info="GICCR constant" unit="A^2s");
-parameter real qp0 = 2.0E-14 from (0:1] `ATTR(info="Zero-bias hole charge" unit="Coul");
-parameter real ich = 0.0 from [0:inf) `ATTR(info="High-current correction for 2D and 3D effects" unit="A"); //`0' signifies infinity
-parameter real hfe = 1.0 from [0:inf] `ATTR(info="Emitter minority charge weighting factor in HBTs");
-parameter real hfc = 1.0 from [0:inf] `ATTR(info="Collector minority charge weighting factor in HBTs");
-parameter real hjei = 1.0 from [0:100] `ATTR(info="B-E depletion charge weighting factor in HBTs");
-parameter real hjci = 1.0 from [0:100] `ATTR(info="B-C depletion charge weighting factor in HBTs");
-
-//Base-Emitter diode currents
-parameter real ibeis = 1.0E-18 from [0:1] `ATTR(info="Internal B-E saturation current" unit="A");
-parameter real mbei = 1.0 from (0:10] `ATTR(info="Internal B-E current ideality factor");
-parameter real ireis = 0.0 from [0:1] `ATTR(info="Internal B-E recombination saturation current" unit="A");
-parameter real mrei = 2.0 from (0:10] `ATTR(info="Internal B-E recombination current ideality factor");
-parameter real ibeps = 0.0 from [0:1] `ATTR(info="Peripheral B-E saturation current" unit="A");
-parameter real mbep = 1.0 from (0:10] `ATTR(info="Peripheral B-E current ideality factor");
-parameter real ireps = 0.0 from [0:1] `ATTR(info="Peripheral B-E recombination saturation current" unit="A");
-parameter real mrep = 2.0 from (0:10] `ATTR(info="Peripheral B-E recombination current ideality factor");
-parameter real mcf = 1.0 from (0:10] `ATTR(info="Non-ideality factor for III-V HBTs");
-
-//Transit time for excess recombination current at b-c barrier
-parameter real tbhrec = 0.0 from [0:inf) `ATTR(info="Base current recombination time constant at B-C barrier for high forward injection" unit="s");
-
-//Base-Collector diode currents
-parameter real ibcis = 1.0E-16 from [0:1.0] `ATTR(info="Internal B-C saturation current" unit="A");
-parameter real mbci = 1.0 from (0:10] `ATTR(info="Internal B-C current ideality factor");
-parameter real ibcxs = 0.0 from [0:1.0] `ATTR(info="External B-C saturation current" unit="A");
-parameter real mbcx = 1.0 from (0:10] `ATTR(info="External B-C current ideality factor");
-
-//Base-Emitter tunneling current
-parameter real ibets = 0.0 from [0:1] `ATTR(info="B-E tunneling saturation current" unit="A");
-parameter real abet = 40 from [0:inf) `ATTR(info="Exponent factor for tunneling current");
-parameter integer tunode= 1 from [0:1] `ATTR(info="Specifies the base node connection for the tunneling current"); // =1 signifies perimeter node
-
-//Base-Collector avalanche current
-parameter real favl = 0.0 from [0:inf) `ATTR(info="Avalanche current factor" unit="1/V");
-parameter real qavl = 0.0 from [0:inf) `ATTR(info="Exponent factor for avalanche current" unit="Coul");
-parameter real alfav = 0.0 `ATTR(info="Relative TC for FAVL" unit="1/K");
-parameter real alqav = 0.0 `ATTR(info="Relative TC for QAVL" unit="1/K");
-
-//Series resistances
-parameter real rbi0 = 0.0 from [0:inf) `ATTR(info="Zero bias internal base resistance" unit="Ohm");
-parameter real rbx = 0.0 from [0:inf) `ATTR(info="External base series resistance" unit="Ohm");
-parameter real fgeo = 0.6557 from [0:inf] `ATTR(info="Factor for geometry dependence of emitter current crowding");
-parameter real fdqr0 = 0.0 from [-0.5:100] `ATTR(info="Correction factor for modulation by B-E and B-C space charge layer");
-parameter real fcrbi = 0.0 from [0:1] `ATTR(info="Ratio of HF shunt to total internal capacitance (lateral NQS effect)");
-parameter real fqi = 1.0 from [0:1] `ATTR(info="Ration of internal to total minority charge");
-parameter real re = 0.0 from [0:inf) `ATTR(info="Emitter series resistance" unit="Ohm");
-parameter real rcx = 0.0 from [0:inf) `ATTR(info="External collector series resistance" unit="Ohm");
-
-//Substrate transistor
-parameter real itss = 0.0 from [0:1.0] `ATTR(info="Substrate transistor transfer saturation current" unit="A");
-parameter real msf = 1.0 from (0:10] `ATTR(info="Forward ideality factor of substrate transfer current");
-parameter real iscs = 0.0 from [0:1.0] `ATTR(info="C-S diode saturation current" unit="A");
-parameter real msc = 1.0 from (0:10] `ATTR(info="Ideality factor of C-S diode current");
-parameter real tsf = 0.0 from [0:inf) `ATTR(info="Transit time for forward operation of substrate transistor" unit="s");
-
-//Intra-device substrate coupling
-parameter real rsu = 0.0 from [0:inf) `ATTR(info="Substrate series resistance" unit="Ohm");
-parameter real csu = 0.0 from [0:inf) `ATTR(info="Substrate shunt capacitance" unit="F");
-
-//Depletion Capacitances
-parameter real cjei0 = 1.0E-20 from [0:inf) `ATTR(info="Internal B-E zero-bias depletion capacitance" unit="F");
-parameter real vdei = 0.9 from (0:10] `ATTR(info="Internal B-E built-in potential" unit="V");
-parameter real zei = 0.5 from (0:1] `ATTR(info="Internal B-E grading coefficient");
-parameter real ajei = 2.5 from [1:inf) `ATTR(info="Ratio of maximum to zero-bias value of internal B-E capacitance");
-parameter real cjep0 = 1.0E-20 from [0:inf) `ATTR(info="Peripheral B-E zero-bias depletion capacitance" unit="F");
-parameter real vdep = 0.9 from (0:10] `ATTR(info="Peripheral B-E built-in potential" unit="V");
-parameter real zep = 0.5 from (0:1] `ATTR(info="Peripheral B-E grading coefficient");
-parameter real ajep = 2.5 from [1:inf) `ATTR(info="Ratio of maximum to zero-bias value of peripheral B-E capacitance");
-parameter real cjci0 = 1.0E-20 from [0:inf) `ATTR(info="Internal B-C zero-bias depletion capacitance" unit="F");
-parameter real vdci = 0.7 from (0:10] `ATTR(info="Internal B-C built-in potential" unit="V");
-parameter real zci = 0.4 from (0:1] `ATTR(info="Internal B-C grading coefficient");
-parameter real vptci = 100 from (0:100] `ATTR(info="Internal B-C punch-through voltage" unit="V");
-parameter real cjcx0 = 1.0E-20 from [0:inf) `ATTR(info="External B-C zero-bias depletion capacitance" unit="F");
-parameter real vdcx = 0.7 from (0:10] `ATTR(info="External B-C built-in potential" unit="V");
-parameter real zcx = 0.4 from (0:1] `ATTR(info="External B-C grading coefficient");
-parameter real vptcx = 100 from (0:100] `ATTR(info="External B-C punch-through voltage" unit="V");
-parameter real fbcpar = 0.0 from [0:1] `ATTR(info="Partitioning factor of parasitic B-C cap");
-parameter real fbepar = 1.0 from [0:1] `ATTR(info="Partitioning factor of parasitic B-E cap");
-parameter real cjs0 = 0.0 from [0:inf) `ATTR(info="C-S zero-bias depletion capacitance" unit="F");
-parameter real vds = 0.6 from (0:10] `ATTR(info="C-S built-in potential" unit="V");
-parameter real zs = 0.5 from (0:1] `ATTR(info="C-S grading coefficient");
-parameter real vpts = 100 from (0:100] `ATTR(info="C-S punch-through voltage" unit="V");
-
-//Diffusion Capacitances
-parameter real t0 = 0.0 from [0:inf) `ATTR(info="Low current forward transit time at VBC=0V" unit="s");
-parameter real dt0h = 0.0 from (-inf:inf) `ATTR(info="Time constant for base and B-C space charge layer width modulation" unit="s");
-parameter real tbvl = 0.0 from [0:inf) `ATTR(info="Time constant for modelling carrier jam at low VCE" unit="s");
-parameter real tef0 = 0.0 from [0:inf) `ATTR(info="Neutral emitter storage time" unit="s");
-parameter real gtfe = 1.0 from (0:10] `ATTR(info="Exponent factor for current dependence of neutral emitter storage time");
-parameter real thcs = 0.0 from [0:inf) `ATTR(info="Saturation time constant at high current densities" unit="s");
-parameter real ahc = 0.1 from (0:10] `ATTR(info="Smoothing factor for current dependence of base and collector transit time");
-parameter real fthc = 0.0 from [0:1] `ATTR(info="Partitioning factor for base and collector portion");
-parameter real rci0 = 150 from (0:inf) `ATTR(info="Internal collector resistance at low electric field" unit="Ohm");
-parameter real vlim = 0.5 from (0:10] `ATTR(info="Voltage separating ohmic and saturation velocity regime" unit="V");
-parameter real vces = 0.1 from [0:1] `ATTR(info="Internal C-E saturation voltage" unit="V");
-parameter real vpt = 100.0 from (0:inf] `ATTR(info="Collector punch-through voltage" unit="V"); // `0' signifies infinity
-parameter real tr = 0.0 from [0:inf) `ATTR(info="Storage time for inverse operation" unit="s");
-
-//Isolation Capacitances
-parameter real cbepar = 0.0 from [0:inf) `ATTR(info="Total parasitic B-E capacitance" unit="F");
-parameter real cbcpar = 0.0 from [0:inf) `ATTR(info="Total parasitic B-C capacitance" unit="F");
-
-//Non-quasi-static Effect
-parameter real alqf = 0.0 from [0:1] `ATTR(info="Factor for additional delay time of minority charge");
-parameter real alit = 0.0 from [0:1] `ATTR(info="Factor for additional delay time of transfer current");
-parameter integer flnqs = 0 from [0:1] `ATTR(info="Flag for turning on and off of vertical NQS effect");
-
-//Noise
-parameter real kf = 0.0 from [0:inf) `ATTR(info="Flicker noise coefficient");
-parameter real af = 2.0 from (0:10] `ATTR(info="Flicker noise exponent factor");
-parameter integer cfbe = -1 from [-2:-1] `ATTR(info="Flag for determining where to tag the flicker noise source");
-
-
-//Lateral Geometry Scaling (at high current densities)
-parameter real latb = 0.0 from [0:inf) `ATTR(info="Scaling factor for collector minority charge in direction of emitter width");
-parameter real latl = 0.0 from [0:inf) `ATTR(info="Scaling factor for collector minority charge in direction of emitter length");
-
-//Temperature dependence
-parameter real vgb = 1.17 from (0:10] `ATTR(info="Bandgap voltage extrapolated to 0 K" unit="V");
-parameter real alt0 = 0.0 `ATTR(info="First order relative TC of parameter T0" unit="1/K");
-parameter real kt0 = 0.0 `ATTR(info="Second order relative TC of parameter T0");
-parameter real zetaci = 0.0 from [-10:10] `ATTR(info="Temperature exponent for RCI0");
-parameter real alvs = 0.0 `ATTR(info="Relative TC of saturation drift velocity" unit="1/K");
-parameter real alces = 0.0 `ATTR(info="Relative TC of VCES" unit="1/K");
-parameter real zetarbi = 0.0 from [-10:10] `ATTR(info="Temperature exponent of internal base resistance");
-parameter real zetarbx = 0.0 from [-10:10] `ATTR(info="Temperature exponent of external base resistance");
-parameter real zetarcx = 0.0 from [-10:10] `ATTR(info="Temperature exponent of external collector resistance");
-parameter real zetare = 0.0 from [-10:10] `ATTR(info="Temperature exponent of emitter resistance");
-parameter real zetacx = 1.0 from [-10:10] `ATTR(info="Temperature exponent of mobility in substrate transistor transit time");
-parameter real vge = 1.17 from (0:10] `ATTR(info="Effective emitter bandgap voltage" unit="V");
-parameter real vgc = 1.17 from (0:10] `ATTR(info="Effective collector bandgap voltage" unit="V");
-parameter real vgs = 1.17 from (0:10] `ATTR(info="Effective substrate bandgap voltage" unit="V");
-parameter real f1vg =-1.02377e-4 `ATTR(info="Coefficient K1 in T-dependent band-gap equation");
-parameter real f2vg = 4.3215e-4 `ATTR(info="Coefficient K2 in T-dependent band-gap equation");
-parameter real zetact = 3.0 from [-10:10] `ATTR(info="Exponent coefficient in transfer current temperature dependence");
-parameter real zetabet = 3.5 from [-10:10] `ATTR(info="Exponent coefficient in B-E junction current temperature dependence");
-parameter real alb = 0.0 `ATTR(info="Relative TC of forward current gain for V2.1 model" unit="1/K");
-
-//Self-Heating
-parameter integer flsh = 0 from [0:2] `ATTR(info="Flag for turning on and off self-heating effect");
-parameter real rth = 0.0 from [0:inf) `ATTR(info="Thermal resistance" unit="K/W");
-parameter real cth = 0.0 from [0:inf) `ATTR(info="Thermal capacitance" unit="J/W");
-
-//Compatibility with V2.1
-parameter real flcomp = 0.0 from [0:inf) `ATTR(info="Flag for compatibility with v2.1 model (0=v2.1)");
-
-//Circuit simulator specific parameters
-parameter real tnom = 27.0 `ATTR(info="Temperature at which parameters are specified" unit="C");
-parameter real dt = 0.0 `ATTR(info="Temperature change w.r.t. chip temperature for particular transistor" unit="K");
-
-
-//
-//======================== Transistor model formulation ===================
-//
-
- //Declaration of variables
-
- real _circuit_gmin;
-
- //Temperature and drift
- real VT,Tdev,qtt0,ln_qtt0,r_VgVT,V_gT,dT,k;
- real ireis_t,ibeis_t,ibcxs_t,ibcis_t,iscs_t,cjci0_t;
- real cjs0_t,rci0_t,vlim_t,vces_t,thcs_t,tef0_t,rbi0_t;
- real rbx_t,rcx_t,re_t,t0_t,vdei_t,vdci_t,vpts_t,itss_t,tsf_t;
- real c10_t,cjei0_t,qp0_t,vdcx_t,vptcx_t,cjcx01_t,cjcx02_t;
- real qjcx0_t_i,qjcx0_t_ii,cratio_t,c_dummy;
- real ibeps_t,ireps_t,cjep0_t;
- real ajei_t,qavl_t,favl_t,ibets_t,abet_t,vptci_t,vdep_t,ajep_t,zetatef;
- real k1,k2,dvg0,vge_t,vgb_t,vgbe_t,vds_t,vt0,Tnom,Tamb,a,avs;
- real zetabci,zetabcxt,zetasct,vgbe0,mg,vgb_t0,vge_t0,vgbe_t0,vgbc0,vgsc0;
- real cbcpar1,cbcpar2,cbepar2,cbepar1,Oich,Ovpt,Otbhrec;
-
- //Charges, capacitances and currents
- real Qjci,Qjei,Qjep;
- real it,ibei,irei,ibci,ibep,irep,ibh_rec;
- real Qdei,Qdci,qrbi;
- real ibet,iavl;
- real ijbcx,ijsc,Qjs,HSUM,HSI_Tsu,Qdsu;
-
- //Base resistance and self-heating power
- real rbi,pterm;
-
- //Variables for macro TMPHICJ
- real vdj0,vdjt,vdt;
-
- //Model initialization
- real k10,k20,C_1;
-
- //Model evaluation
- real Cjci,Cjcit,cc,Cjei,Cjep;
- real itf,itr,Tf,Tr,VT_f,i_0f,i_0r,a_bpt,Q_0,Q_p,Q_bpt;
- real Orci0_t,b_q,Q_fC,T_fC,T_cT,I_Tf1,T_f0,Q_fT,T_fT,Q_bf;
- real ICKa,d1;
- real A,a_h,Q_pT,d_Q,d_Q0;
- real Qf,Cdei,Qr,Cdci,Crbi;
- real ick,vc,vceff,cjcx01,cjcx02,HSa,HSb;
- integer l_it;
-
- //Variables for macros
- real DIOY,le;//HICDIO
- real FFT_fbS,FFa,FFx,FFs,FFw,FFw_2,FFd_QfB,FFd_TfB,FFT_pcS,FFQ_fC,FFT_fC,FFQ_cT,FFT_cT,FFd_TfE,FFd_QfE,FFa_w;//HICQFF
- real FCz,FCw2,FCf1,FCf2,FCf3,FCf_ci,FCz_1,FCa1,FCa_ck,FCxl,FCxb;//HICQFC
- real FCd_a,FCdaick_ditf,FCa,FCw,FCdw_daick,FCdfc_dw,FCdw_ditf,FCdfc_ditf,FCf_CT,FCdfCT_ditf,FCrt,FCln,lnz,FCda1_dw,FCdf1_dw,FCdf2_dw,FCdf3_dw,FCd_f,FCdfCT_dw;//HICQFC
- real Dz_r,Dv_p,DV_f,DC_max,DC_c,Da,Dv_e,De,De_1,Dv_j1,Dv_r,De_2,Dv_j2,Dv_j4,DQ_j1,DQ_j2,DQ_j3,DCln1,DCln2,Dz1,Dzr1,DC_j1,DC_j2,DC_j3;//QJMOD
- real DFV_f,DFv_e,DFv_j,DFb,DFQ_j,DFs_q,DFs_q2,DFdvj_dv,DFC_j1;//QJMODF
- real z,a2,a3,r,x;//HICFCI
- real zb,zl,lnzb,w,hicfcio,dhicfcio_dw; //HICFCT
-
- //Noise
- real fourkt,twoq,flicker_Pwr;
- real thermal_Rbx,thermal_Rbi,thermal_Rcx,thermal_Re,betad,betan,betadin,betadc,icn,icn1,icn2;
-
- //NQS
- real Ixf1,Ixf2,Qxf1,Qxf2,Vxf1,Vxf2,Itxf,TD1,Qdeix;
- real T, Vxf, Ixf, Qxf,fact;
-
- real pocce,czz;
- real Qz_nom,f_QR,ETA,Qz0,fQz;
- real v_bord,v_q,U0,av,avl;
- real cV_f,cv_e,cs_q,cs_q2,cv_j,cdvj_dv;
- real a_eg,ab,aa;
-
- //end of variables
-
-analog begin
-
-`MODEL begin : Model_initialization
-
- Tnom = tnom+`P_CELSIUS0;
- Tamb = $temperature;
- vt0 = `P_K*Tnom /`P_Q;
- k10 = f1vg*Tnom*ln(Tnom);
- k20 = f2vg*Tnom;
- avs = alvs*Tnom;
- vgb_t0 = vgb+k10+k20;
- vge_t0 = vge+k10+k20;
- vgbe_t0 = (vgb_t0+vge_t0)/2;
- vgbe0 = (vgb+vge)/2;
- vgbc0 = (vgb+vgc)/2;
- vgsc0 = (vgs+vgc)/2;
- mg = 3-`P_Q*f1vg/`P_K;
- zetabci = mg+1-zetaci;
- zetabcxt= mg+1-zetacx;
- zetasct = mg-1.5;
-
- //Depletion capacitance splitting at b-c junction
- //Capacitances at peripheral and external base node
- C_1 = (1.0-fbcpar)*(cjcx0+cbcpar);
- if (C_1 >= cbcpar) begin
- cbcpar1 = cbcpar;
- cbcpar2 = 0.0;
- cjcx01 = C_1-cbcpar;
- cjcx02 = cjcx0-cjcx01;
- end else begin
- cbcpar1 = C_1;
- cbcpar2 = cbcpar-cbcpar1;
- cjcx01 = 0.0;
- cjcx02 = cjcx0;
- end
-
- //Parasitic b-e capacitance partitioning: No temperature dependence
- cbepar2 = fbepar*cbepar;
- cbepar1 = cbepar-cbepar2;
-
- //Avoid devide-by-zero and define infinity other way
- //High current correction for 2D and 3D effects
- if (ich != 0.0) begin
- Oich = 1.0/ich;
- end else begin
- Oich = 0.0;
- end
-
- //Base current recombination time constant at b-c barrier
- if (tbhrec != 0.0) begin
- Otbhrec = 1.0/tbhrec;
- end else begin
- Otbhrec = 0.0;
- end
-
- // Temperature and resulting parameter drift
- if (flsh==0 || rth < `MIN_R) begin : Thermal_updat_without_self_heating
- Tdev = Tamb+dt;
- if(Tdev < `TMIN + 273.15) begin
- Tdev = `TMIN + 273.15;
- end else begin
- if (Tdev > `TMAX + 273.15) begin
- Tdev = `TMAX + 273.15;
- end
- end
- VT = `P_K*Tdev /`P_Q;
- dT = Tdev-Tnom;
- qtt0 = Tdev/Tnom;
- ln_qtt0 = ln(qtt0);
- k1 = f1vg*Tdev*ln(Tdev);
- k2 = f2vg*Tdev;
- vgb_t = vgb+k1+k2;
- vge_t = vge+k1+k2;
- vgbe_t = (vgb_t+vge_t)/2;
-
- //Internal b-e junction capacitance
- `TMPHICJ(cjei0,vdei,zei,ajei,1,vgbe0,cjei0_t,vdei_t,ajei_t)
-
- if (flcomp == 0.0 || flcomp == 2.1) begin
- V_gT = 3.0*VT*ln_qtt0 + vgb*(qtt0-1.0);
- r_VgVT = V_gT/VT;
- //Internal b-e diode saturation currents
- a = mcf*r_VgVT/mbei - alb*dT;
- ibeis_t = ibeis*exp(a);
- a = mcf*r_VgVT/mrei - alb*dT;
- ireis_t = ireis*exp(a);
- a = mcf*r_VgVT/mbep - alb*dT;
- //Peripheral b-e diode saturation currents
- ibeps_t = ibeps*exp(a);
- a = mcf*r_VgVT/mrep - alb*dT;
- ireps_t = ireps*exp(a);
- //Internal b-c diode saturation current
- a = r_VgVT/mbci;
- ibcis_t = ibcis*exp(a);
- //External b-c diode saturation currents
- a = r_VgVT/mbcx;
- ibcxs_t = ibcxs*exp(a);
- //Saturation transfer current for substrate transistor
- a = r_VgVT/msf;
- itss_t = itss*exp(a);
- //Saturation current for c-s diode
- a = r_VgVT/msc;
- iscs_t = iscs*exp(a);
- //Zero bias hole charge
- a = vdei_t/vdei;
- qp0_t = qp0*(1.0+0.5*zei*(1.0-a));
- //Voltage separating ohmic and saturation velocity regime
- a = vlim*(1.0-alvs*dT)*exp(zetaci*ln_qtt0);
- k = (a-VT)/VT;
- if (k < `LN_EXP_LIMIT) begin
- vlim_t = VT + VT*ln(1.0+exp(k));
- end else begin
- vlim_t = a;
- end
- //Neutral emitter storage time
- a = 1.0+alb*dT;
- k = 0.5*(a+sqrt(a*a+0.01));
- tef0_t = tef0*qtt0/k;
- end else begin
- //Internal b-e diode saturation currents
- ibeis_t = ibeis*exp(zetabet*ln_qtt0+vge/VT*(qtt0-1));
- ireis_t = ireis*exp(0.5*mg*ln_qtt0+0.5*vgbe0/VT*(qtt0-1));
- //Peripheral b-e diode saturation currents
- ibeps_t = ibeps*exp(zetabet*ln_qtt0+vge/VT*(qtt0-1));
- ireps_t = ireps*exp(0.5*mg*ln_qtt0+0.5*vgbe0/VT*(qtt0-1));
- //Internal b-c diode saturation currents
- ibcis_t = ibcis*exp(zetabci*ln_qtt0+vgc/VT*(qtt0-1));
- //External b-c diode saturation currents
- ibcxs_t = ibcxs*exp(zetabcxt*ln_qtt0+vgc/VT*(qtt0-1));
- //Saturation transfer current for substrate transistor
- itss_t = itss*exp(zetasct*ln_qtt0+vgc/VT*(qtt0-1));
- //Saturation current for c-s diode
- iscs_t = iscs*exp(zetasct*ln_qtt0+vgs/VT*(qtt0-1));
- //Zero bias hole charge
- a = exp(zei*ln(vdei_t/vdei));
- qp0_t = qp0*(2.0-a);
- //Voltage separating ohmic and saturation velocity regime
- vlim_t = vlim*exp((zetaci-avs)*ln_qtt0);
- //Neutral emitter storage time
- zetatef = zetabet-zetact-0.5;
- dvg0 = vgb-vge;
- tef0_t = tef0*exp(zetatef*ln_qtt0-dvg0/VT*(qtt0-1));
- end
-
- //GICCR prefactor
- c10_t = c10*exp(zetact*ln_qtt0+vgb/VT*(qtt0-1));
-
- // Low-field internal collector resistance
- rci0_t = rci0*exp(zetaci*ln_qtt0);
-
- //Voltage separating ohmic and saturation velocity regime
- //vlim_t = vlim*exp((zetaci-avs)*ln_qtt0);
-
- //Internal c-e saturation voltage
- vces_t = vces*(1+alces*dT);
-
-
- //Internal b-c diode saturation current
- //ibcis_t = ibcis*exp(zetabci*ln_qtt0+vgc/VT*(qtt0-1));
-
- //Internal b-c junction capacitance
- `TMPHICJ(cjci0,vdci,zci,vptci,0,vgbc0,cjci0_t,vdci_t,vptci_t)
-
- //Low-current forward transit time
- t0_t = t0*(1+alt0*dT+kt0*dT*dT);
-
- //Saturation time constant at high current densities
- thcs_t = thcs*exp((zetaci-1)*ln_qtt0);
-
-
- //Avalanche caurrent factors
- favl_t = favl*exp(alfav*dT);
- qavl_t = qavl*exp(alqav*dT);
-
- //Zero bias internal base resistance
- rbi0_t = rbi0*exp(zetarbi*ln_qtt0);
-
-
- //Peripheral b-e junction capacitance
- `TMPHICJ(cjep0,vdep,zep,ajep,1,vgbe0,cjep0_t,vdep_t,ajep_t)
-
- //Tunneling current factors
- begin : HICTUN_T
-// real a_eg,ab,aa;
- ab = 1.0;
- aa = 1.0;
- a_eg=vgbe_t0/vgbe_t;
- if(tunode==1 && cjep0 > 0.0 && vdep >0.0) begin
- ab = (cjep0_t/cjep0)*sqrt(a_eg)*vdep_t*vdep_t/(vdep*vdep);
- aa = (vdep/vdep_t)*(cjep0/cjep0_t)*pow(a_eg,-1.5);
- end else if (tunode==0 && cjei0 > 0.0 && vdei >0.0) begin
- ab = (cjei0_t/cjei0)*sqrt(a_eg)*vdei_t*vdei_t/(vdei*vdei);
- aa = (vdei/vdei_t)*(cjei0/cjei0_t)*pow(a_eg,-1.5);
- end
- ibets_t = ibets*ab;
- abet_t = abet*aa;
- end
-
-
- //Temperature mapping for tunneling current is done inside HICTUN
-
- `TMPHICJ(1.0,vdcx,zcx,vptcx,0,vgbc0,cratio_t,vdcx_t,vptcx_t)
- cjcx01_t=cratio_t*cjcx01;
- cjcx02_t=cratio_t*cjcx02;
-
-
- //External b-c diode saturation currents
- //ibcxs_t = ibcxs*exp(zetabcxt*ln_qtt0+vgc/VT*(qtt0-1));
-
-
- //Constant external series resistances
- rcx_t = rcx*exp(zetarcx*ln_qtt0);
- rbx_t = rbx*exp(zetarbx*ln_qtt0);
- re_t = re*exp(zetare*ln_qtt0);
-
- //Forward transit time in substrate transistor
- tsf_t = tsf*exp((zetacx-1.0)*ln_qtt0);
-
- //Capacitance for c-s junction
- `TMPHICJ(cjs0,vds,zs,vpts,0,vgsc0,cjs0_t,vds_t,vpts_t)
-
- end // of Thermal_update_without_self_heating
-
-end //of Model_initialization
-
-if (flsh!=0 && rth >= `MIN_R) begin : Thermal_update_with_self_heating
- Tdev = Tamb+dt+V(br_sht);
- // Limit temperature to avoid FPEs in equations
- if(Tdev < `TMIN + 273.15) begin
- Tdev = `TMIN + 273.15;
- end else begin
- if (Tdev > `TMAX + 273.15) begin
- Tdev = `TMAX + 273.15;
- end
- end
- VT = `P_K*Tdev /`P_Q;
- dT = Tdev-Tnom;
- qtt0 = Tdev/Tnom;
- ln_qtt0 = ln(qtt0);
- k1 = f1vg*Tdev*ln(Tdev);
- k2 = f2vg*Tdev;
- vgb_t = vgb+k1+k2;
- vge_t = vge+k1+k2;
- vgbe_t = (vgb_t+vge_t)/2;
-
- //Internal b-e junction capacitance
- `TMPHICJ(cjei0,vdei,zei,ajei,1,vgbe0,cjei0_t,vdei_t,ajei_t)
-
- if (flcomp == 0.0 || flcomp == 2.1) begin
- V_gT = 3.0*VT*ln_qtt0 + vgb*(qtt0-1.0);
- r_VgVT = V_gT/VT;
- //Internal b-e diode saturation currents
- a = mcf*r_VgVT/mbei - alb*dT;
- ibeis_t = ibeis*exp(a);
- a = mcf*r_VgVT/mrei - alb*dT;
- ireis_t = ireis*exp(a);
- a = mcf*r_VgVT/mbep - alb*dT;
- //Peripheral b-e diode saturation currents
- ibeps_t = ibeps*exp(a);
- a = mcf*r_VgVT/mrep - alb*dT;
- ireps_t = ireps*exp(a);
- //Internal b-c diode saturation current
- a = r_VgVT/mbci;
- ibcis_t = ibcis*exp(a);
- //External b-c diode saturation currents
- a = r_VgVT/mbcx;
- ibcxs_t = ibcxs*exp(a);
- //Saturation transfer current for substrate transistor
- a = r_VgVT/msf;
- itss_t = itss*exp(a);
- //Saturation current for c-s diode
- a = r_VgVT/msc;
- iscs_t = iscs*exp(a);
- //Zero bias hole charge
- a = vdei_t/vdei;
- qp0_t = qp0*(1.0+0.5*zei*(1.0-a));
- //Voltage separating ohmic and saturation velocity regime
- a = vlim*(1.0-alvs*dT)*exp(zetaci*ln_qtt0);
- k = (a-VT)/VT;
- if (k < `LN_EXP_LIMIT) begin
- vlim_t = VT + VT*ln(1.0+exp(k));
- end else begin
- vlim_t = a;
- end
- //Neutral emitter storage time
- a = 1.0+alb*dT;
- k = 0.5*(a+sqrt(a*a+0.01));
- tef0_t = tef0*qtt0/k;
- end else begin
- //Internal b-e diode saturation currents
- ibeis_t = ibeis*exp(zetabet*ln_qtt0+vge/VT*(qtt0-1));
- ireis_t = ireis*exp(0.5*mg*ln_qtt0+0.5*vgbe0/VT*(qtt0-1));
- //Peripheral b-e diode saturation currents
- ibeps_t = ibeps*exp(zetabet*ln_qtt0+vge/VT*(qtt0-1));
- ireps_t = ireps*exp(0.5*mg*ln_qtt0+0.5*vgbe0/VT*(qtt0-1));
- //Internal b-c diode saturation currents
- ibcis_t = ibcis*exp(zetabci*ln_qtt0+vgc/VT*(qtt0-1));
- //External b-c diode saturation currents
- ibcxs_t = ibcxs*exp(zetabcxt*ln_qtt0+vgc/VT*(qtt0-1));
- //Saturation transfer current for substrate transistor
- itss_t = itss*exp(zetasct*ln_qtt0+vgc/VT*(qtt0-1));
- //Saturation current for c-s diode
- iscs_t = iscs*exp(zetasct*ln_qtt0+vgs/VT*(qtt0-1));
- //Zero bias hole charge
- a = exp(zei*ln(vdei_t/vdei));
- qp0_t = qp0*(2.0-a);
- //Voltage separating ohmic and saturation velocity regime
- vlim_t = vlim*exp((zetaci-avs)*ln_qtt0);
- //Neutral emitter storage time
- zetatef = zetabet-zetact-0.5;
- dvg0 = vgb-vge;
- tef0_t = tef0*exp(zetatef*ln_qtt0-dvg0/VT*(qtt0-1));
- end
-
- //GICCR prefactor
- c10_t = c10*exp(zetact*ln_qtt0+vgb/VT*(qtt0-1));
-
- // Low-field internal collector resistance
- rci0_t = rci0*exp(zetaci*ln_qtt0);
-
- //Voltage separating ohmic and saturation velocity regime
- //vlim_t = vlim*exp((zetaci-avs)*ln_qtt0);
-
- //Internal c-e saturation voltage
- vces_t = vces*(1+alces*dT);
-
-
- //Internal b-c diode saturation current
- //ibcis_t = ibcis*exp(zetabci*ln_qtt0+vgc/VT*(qtt0-1));
-
- //Internal b-c junction capacitance
- `TMPHICJ(cjci0,vdci,zci,vptci,0,vgbc0,cjci0_t,vdci_t,vptci_t)
-
- //Low-current forward transit time
- t0_t = t0*(1+alt0*dT+kt0*dT*dT);
-
- //Saturation time constant at high current densities
- thcs_t = thcs*exp((zetaci-1)*ln_qtt0);
-
-
- //Avalanche caurrent factors
- favl_t = favl*exp(alfav*dT);
- qavl_t = qavl*exp(alqav*dT);
-
- //Zero bias internal base resistance
- rbi0_t = rbi0*exp(zetarbi*ln_qtt0);
-
-
- //Peripheral b-e junction capacitance
- `TMPHICJ(cjep0,vdep,zep,ajep,1,vgbe0,cjep0_t,vdep_t,ajep_t)
-
- //Tunneling current factors
- if (V(br_bpei) < 0.0 || V(br_biei) < 0.0) begin : HICTUN_T
-// real a_eg,ab,aa;
- ab = 1.0;
- aa = 1.0;
- a_eg=vgbe_t0/vgbe_t;
- if(tunode==1 && cjep0 > 0.0 && vdep >0.0) begin
- ab = (cjep0_t/cjep0)*sqrt(a_eg)*vdep_t*vdep_t/(vdep*vdep);
- aa = (vdep/vdep_t)*(cjep0/cjep0_t)*pow(a_eg,-1.5);
- end else if (tunode==0 && cjei0 > 0.0 && vdei >0.0) begin
- ab = (cjei0_t/cjei0)*sqrt(a_eg)*vdei_t*vdei_t/(vdei*vdei);
- aa = (vdei/vdei_t)*(cjei0/cjei0_t)*pow(a_eg,-1.5);
- end
- ibets_t = ibets*ab;
- abet_t = abet*aa;
- end
-
-
- //Temperature mapping for tunneling current is done inside HICTUN
-
- `TMPHICJ(1.0,vdcx,zcx,vptcx,0,vgbc0,cratio_t,vdcx_t,vptcx_t)
- cjcx01_t=cratio_t*cjcx01;
- cjcx02_t=cratio_t*cjcx02;
-
-
- //External b-c diode saturation currents
- //ibcxs_t = ibcxs*exp(zetabcxt*ln_qtt0+vgc/VT*(qtt0-1));
-
-
- //Constant external series resistances
- rcx_t = rcx*exp(zetarcx*ln_qtt0);
- rbx_t = rbx*exp(zetarbx*ln_qtt0);
- re_t = re*exp(zetare*ln_qtt0);
-
- //Forward transit time in substrate transistor
- tsf_t = tsf*exp((zetacx-1.0)*ln_qtt0);
-
- //Capacitance for c-s junction
- `TMPHICJ(cjs0,vds,zs,vpts,0,vgsc0,cjs0_t,vds_t,vpts_t)
-
-end //of Thermal_update_with_self_heating
-
-
-begin : Model_evaluation
-
- //Intrinsic transistor
- //Internal base currents across b-e junction
- `HICDIO(ibeis,ibeis_t,mbei,V(br_biei),ibei)
- `HICDIO(ireis,ireis_t,mrei,V(br_biei),irei)
-
- //HICCR: begin
-
- //Inverse of low-field internal collector resistance: needed in HICICK
- Orci0_t = 1.0/rci0_t;
-
- //Initialization
- //Transfer current, minority charges and transit times
-
- Tr = tr;
- VT_f = mcf*VT;
- i_0f = c10_t * limexp(V(br_biei)/VT_f);
- i_0r = c10_t * limexp(V(br_bici)/VT);
-
- //Internal b-e and b-c junction capacitances and charges
- //`QJMODF(cjei0_t,vdei_t,zei,ajei_t,V(br_biei),Qjei)
- //Cjei = ddx(Qjei,V(bi));
- `QJMODF(cjei0_t,vdei_t,zei,ajei_t,V(br_biei),Cjei,Qjei)
-
- //`HICJQ(cjci0_t,vdci_t,zci,vptci_t,V(br_bici),Qjci)
- //Cjci = ddx(Qjci,V(bi));
- `HICJQ(cjci0_t,vdci_t,zci,vptci_t,V(br_bici),Cjci,Qjci)
-
- //Hole charge at low bias
- a_bpt = 0.05;
- Q_0 = qp0_t + hjei*Qjei + hjci*Qjci;
- Q_bpt = a_bpt*qp0_t;
- b_q = Q_0/Q_bpt-1;
- Q_0 = Q_bpt*(1+(b_q +sqrt(b_q*b_q+1.921812))/2);
-
- //Transit time calculation at low current density
- if(cjci0_t > 0.0) begin : CJMODF
-// real cV_f,cv_e,cs_q,cs_q2,cv_j,cdvj_dv;
- cV_f = vdci_t*(1.0-exp(-ln(2.4)/zci));
- cv_e = (cV_f-V(br_bici))/VT;
- cs_q = sqrt(cv_e*cv_e+1.921812);
- cs_q2 = (cv_e+cs_q)*0.5;
- cv_j = cV_f-VT*cs_q2;
- cdvj_dv = cs_q2/cs_q;
- Cjcit = cjci0_t*exp(-zci*ln(1.0-cv_j/vdci_t))*cdvj_dv+2.4*cjci0_t*(1.0-cdvj_dv);
- end else begin
- Cjcit = 0.0;
- end
- if(Cjcit > 0.0) begin
- cc = cjci0_t/Cjcit;
- end else begin
- cc = 1.0;
- end
- T_f0 = t0_t+dt0h*(cc-1.0)+tbvl*(1/cc-1.0);
-
- //Effective collector voltage
- vc = V(br_ciei)-vces_t;
-
- //Critical current for onset of high-current effects
- begin : HICICK
- Ovpt = 1.0/vpt;
- a = vc/VT;
- d1 = a-1;
- vceff = (1.0+((d1+sqrt(d1*d1+1.921812))/2))*VT;
- a = vceff/vlim_t;
- ick = vceff*Orci0_t/sqrt(1.0+a*a);
- ICKa = (vceff-vlim_t)*Ovpt;
- ick = ick*(1.0+0.5*(ICKa+sqrt(ICKa*ICKa+1.0e-3)));
- end
-
- //Initial formulation of forward and reverse component of transfer current
- Q_p = Q_0;
- if (T_f0 > 0.0 || Tr > 0.0) begin
- A = 0.5*Q_0;
- Q_p = A+sqrt(A*A+T_f0*i_0f+Tr*i_0r);
- end
- I_Tf1 =i_0f/Q_p;
- a_h = Oich*I_Tf1;
- itf = I_Tf1*(1.0+a_h);
- itr = i_0r/Q_p;
-
- //Initial formulation of forward transit time, diffusion, GICCR and excess b-c charge
- Q_bf = 0.0;
- Tf = T_f0;
- Qf = T_f0*itf;
- `HICQFF(itf,ick,Tf,Qf,T_fT,Q_fT,Q_bf)
-
- //Initial formulation of reverse diffusion charge
- Qr = Tr*itr;
-
- //Preparation for iteration to get total hole charge and related variables
- l_it = 0;
- if(Qf > `RTOLC*Q_p || a_h > `RTOLC) begin
- //Iteration for Q_pT is required for improved initial solution
- Qf = sqrt(T_f0*itf*Q_fT);
- Q_pT = Q_0+Qf+Qr;
- d_Q = Q_pT;
- while (abs(d_Q) >= `RTOLC*abs(Q_pT) && l_it <= `l_itmax) begin
- d_Q0 = d_Q;
- I_Tf1 = i_0f/Q_pT;
- a_h = Oich*I_Tf1;
- itf = I_Tf1*(1.0+a_h);
- itr = i_0r/Q_pT;
- Tf = T_f0;
- Qf = T_f0*itf;
- `HICQFF(itf,ick,Tf,Qf,T_fT,Q_fT,Q_bf)
- Qr = Tr*itr;
- if(Oich == 0.0) begin
- a = 1.0+(T_fT*itf+Qr)/Q_pT;
- end else begin
- a = 1.0+(T_fT*I_Tf1*(1.0+2.0*a_h)+Qr)/Q_pT;
- end
- d_Q = -(Q_pT-(Q_0+Q_fT+Qr))/a;
- //Limit maximum change of Q_pT
- a = abs(0.3*Q_pT);
- if(abs(d_Q) > a) begin
- if (d_Q>=0) begin
- d_Q = a;
- end else begin
- d_Q = -a;
- end
- end
- Q_pT = Q_pT+d_Q;
- l_it = l_it+1;
- end //while
-
- I_Tf1 = i_0f/Q_pT;
- a_h = Oich*I_Tf1;
- itf = I_Tf1*(1.0+a_h);
- itr = i_0r/Q_pT;
-
- //Final transit times, charges and transport current components
- Tf = T_f0;
- Qf = T_f0*itf;
- `HICQFF(itf,ick,Tf,Qf,T_fT,Q_fT,Q_bf)
- Qr = Tr*itr;
-
- end //if
-
- //NQS effect implemented with LCR networks
- //Once the delay in ITF is considered, IT_NQS is calculated afterwards
-
- it = itf-itr;
-
- //Diffusion charges for further use
- Qdei = Qf;
- Qdci = Qr;
-
-
- //High-frequency emitter current crowding (lateral NQS)
- Cdei = -1*ddx(Qdei,V(ei));
- Cdci = -1*ddx(Qdci,V(ci));
- Crbi = fcrbi*(Cjei+Cjci+Cdei+Cdci);
- qrbi = Crbi*V(br_bpbi_v);
-
-// qrbi = fcrbi*(Qjei+Qjci+Qdei+Qdci);
-
- //HICCR: end
-
- //Internal base current across b-c junction
- `HICDIO(ibcis,ibcis_t,mbci,V(br_bici),ibci)
-
- //Avalanche current
- if((V(br_bici) < 0.0) && (favl_t > 0.0) && (cjci0_t > 0.0)) begin : HICAVL
-// real v_bord,v_q,U0,av,avl;
- v_bord = vdci_t-V(br_bici);
- v_q = qavl_t/Cjci;
- U0 = qavl_t/cjci0_t;
- if(v_bord > U0) begin
- av = favl_t*exp(-v_q/U0);
- avl = av*(U0+(1.0+v_q/U0)*(v_bord-U0));
- end else begin
- avl = favl_t*v_bord*exp(-v_q/v_bord);
- end
- iavl = itf*avl;
- end else begin
- iavl = 0.0;
- end
-
- //Excess base current from recombination at the b-c barrier
- ibh_rec = Q_bf*Otbhrec;
-
- //Internal base resistance
- if(rbi0_t > 0.0) begin : HICRBI
-// real Qz_nom,f_QR,ETA,Qz0,fQz;
- // Consideration of conductivity modulation
- // To avoid convergence problem hyperbolic smoothing used
- f_QR = (1+fdqr0)*qp0_t;
- Qz0 = Qjei+Qjci+Qf;
- Qz_nom = 1+Qz0/f_QR;
- fQz = 0.5*(Qz_nom+sqrt(Qz_nom*Qz_nom+0.01));
- rbi = rbi0_t/fQz;
- // Consideration of emitter current crowding
- if( ibei > 0.0) begin
- ETA = rbi*ibei*fgeo/VT;
- if(ETA < 1.0e-6) begin
- rbi = rbi*(1.0-0.5*ETA);
- end else begin
- rbi = rbi*ln(1.0+ETA)/ETA;
- end
- end
- // Consideration of peripheral charge
- if(Qf > 0.0) begin
- rbi = rbi*(Qjei+Qf*fqi)/(Qjei+Qf);
- end
- end else begin
- rbi = 0.0;
- end
-
- //Base currents across peripheral b-e junction
- `HICDIO(ibeps,ibeps_t,mbep,V(br_bpei),ibep)
- `HICDIO(ireps,ireps_t,mrep,V(br_bpei),irep)
-
- //Peripheral b-e junction capacitance and charge
- `QJMODF(cjep0_t,vdep_t,zep,ajep_t,V(br_bpei),Cjep,Qjep)
-
- //Tunelling current
- if (V(br_bpei) <0.0 || V(br_biei) < 0.0) begin : HICTUN
-// real pocce,czz;
- if(tunode==1 && cjep0_t > 0.0 && vdep_t >0.0) begin
- pocce = exp((1-1/zep)*ln(Cjep/cjep0_t));
- czz = -(V(br_bpei)/vdep_t)*ibets_t*pocce;
- ibet = czz*exp(-abet_t/pocce);
- end else if (tunode==0 && cjei0_t > 0.0 && vdei_t >0.0) begin
- pocce = exp((1-1/zei)*ln(Cjei/cjei0_t));
- czz = -(V(br_biei)/vdei_t)*ibets_t*pocce;
- ibet = czz*exp(-abet_t/pocce);
- end else begin
- ibet = 0.0;
- end
- end else begin
- ibet = 0.0;
- end
-
-
- //Depletion capacitance and charge at peripheral b-c junction (bp,ci)
- `HICJQ(cjcx02_t,vdcx_t,zcx,vptcx_t,V(br_bpci),c_dummy,qjcx0_t_ii)
-
- //Base currents across peripheral b-c junction (bp,ci)
- `HICDIO(ibcxs,ibcxs_t,mbcx,V(br_bpci),ijbcx)
-
- //Depletion capacitance and charge at external b-c junction (b,ci)
- `HICJQ(cjcx01_t,vdcx_t,zcx,vptcx_t,V(br_bci),c_dummy,qjcx0_t_i)
-
- //Depletion substrate capacitance and charge at s-c junction (si,ci)
- `HICJQ(cjs0_t,vds_t,zs,vpts_t,V(br_sici),c_dummy,Qjs)
-
- //Parasitic substrate transistor transfer current and diffusion charge
- if(itss > 0.0) begin : Sub_Transfer
- HSUM = msf*VT;
- HSa = limexp(V(br_bpci)/HSUM);
- HSb = limexp(V(br_sici)/HSUM);
- HSI_Tsu = itss_t*(HSa-HSb);
- if(tsf > 0.0) begin
- Qdsu = tsf_t*itss_t*HSa;
- end else begin
- Qdsu = 0.0;
- end
- end else begin
- HSI_Tsu = 0.0;
- Qdsu = 0.0;
- end
-
- // Current gain computation for correlated noise implementation
- betad=ibei;
- if (betad > 0.0) begin
- betadin=betad;
- betan=it;
- betadc=betan/betad;
- end else begin
- betadc=0.0;
- end
-
- //Diode current for s-c junction (si,ci)
- `HICDIO(iscs,iscs_t,msc,V(br_sici),ijsc)
-
- //Self-heating calculation
- if (flsh == 1 && rth >= `MIN_R) begin
- pterm = V(br_ciei)*it + (vdci_t-V(br_bici))*iavl;
- end else if (flsh == 2 && rth >= `MIN_R) begin
- pterm = V(br_ciei)*it + (vdci_t-V(br_bici))*iavl + ibei*V(br_biei) + ibci*V(br_bici) + ibep*V(br_bpei) + ijbcx*V(br_bpci) + ijsc*V(br_sici);
- if (rbi >= `MIN_R) begin
- pterm = pterm + V(br_bpbi_i)*V(br_bpbi_i)/rbi;
- end
- if (re_t >= `MIN_R) begin
- pterm = pterm + V(br_eie_i)*V(br_eie_i)/re_t;
- end
- if (rcx_t >= `MIN_R) begin
- pterm = pterm + V(br_cic_i)*V(br_cic_i)/rcx_t;
- end
- if (rbx_t >= `MIN_R) begin
- pterm = pterm + V(br_bbp_i)*V(br_bbp_i)/rbx_t;
- end
- end
-
- Itxf = itf;
- Qdeix = Qdei;
- // Excess Phase calculation
-
- if (flnqs != 0 && Tf != 0) begin
- Vxf1 = V(br_bxf1);
- Vxf2 = V(br_bxf2);
-
- Ixf1 = (Vxf2-itf)/Tf*t0;
- Ixf2 = (Vxf2-Vxf1)/Tf*t0;
- Qxf1 = alit*Vxf1*t0;
- Qxf2 = alit*Vxf2/3*t0;
- Itxf = Vxf2;
-
- Vxf = V(br_bxf); //for RC nw
- fact = t0/Tf; //for RC nw
- Ixf = (Vxf - Qdei)*fact; //for RC nw
- Qxf = alqf*Vxf*t0; //for RC nw
- Qdeix = Vxf; //for RC nw
- end else begin
- Ixf1 = V(br_bxf1);
- Ixf2 = V(br_bxf2);
- Qxf1 = 0;
- Qxf2 = 0;
-
- Ixf = V(br_bxf);
- Qxf = 0;
- end
-
-end //of Model_evaluation
-
-begin : Load_sources
-
- I(br_biei) <+ _circuit_gmin*V(br_biei);
- I(br_bici) <+ _circuit_gmin*V(br_bici);
-
- I(br_bci) <+ ddt(qjcx0_t_i);
- I(br_bci) <+ ddt(cbcpar1*V(br_bci));
- I(br_bpci) <+ ddt(cbcpar2*V(br_bpci));
- if (rbx >= `MIN_R) begin
- I(br_bbp_i) <+ V(br_bbp_i)/rbx_t;
- end else begin
-// V(br_bbp_v) <+ 0.0;
- I(br_bbp_i) <+ V(br_bbp_i)/`MIN_R;
- end
- if(rbi0 >= `MIN_R) begin
- I(br_bpbi_i) <+ V(br_bpbi_i)/rbi;
- I(br_bpbi_i) <+ ddt(qrbi);
- end else begin
-// V(br_bpbi_v) <+ 0.0;
- I(br_bpbi_i) <+ V(br_bpbi_i)/`MIN_R;
- end
- if (tunode==1.0) begin
- I(br_bpei) <+ -ibet;
- end else begin
- I(br_biei) <+ -ibet;
- end
- I(br_bpei) <+ ibep;
- I(br_bpei) <+ irep;
- I(br_bpei) <+ ddt(Qjep);
- I(br_biei) <+ ibei;
- I(br_biei) <+ irei;
- I(br_biei) <+ ibh_rec;
- I(br_biei) <+ ddt(Qdeix+Qjei);
- I(br_bpsi) <+ HSI_Tsu;
- I(br_bpci) <+ ijbcx;
- I(br_bpci) <+ ddt(qjcx0_t_ii+Qdsu);
- I(br_be) <+ ddt(cbepar1*V(br_be));
- I(br_bpe) <+ ddt(cbepar2*V(br_bpe));
- I(br_bici) <+ ibci-iavl;
- I(br_bici) <+ ddt(Qdci+Qjci);
- I(br_sici) <+ ijsc;
- I(br_sici) <+ ddt(Qjs);
- I(br_ciei) <+ Itxf;
- I(br_eici) <+ itr;
- if (rcx >= `MIN_R) begin
- I(br_cic_i) <+ V(br_cic_i)/rcx_t;
- end else begin
-// V(br_cic_v) <+ 0.0;
- I(br_cic_i) <+ V(br_cic_i)/`MIN_R;
- end
- if (re >= `MIN_R) begin
- I(br_eie_i) <+ V(br_eie_i)/re_t;
- end else begin
-// V(br_eie_v) <+ 0.0;
- I(br_eie_i) <+ V(br_eie_i)/`MIN_R;
- end
- if(rsu >= `MIN_R) begin
- I(br_sis_i) <+ V(br_sis_i)/rsu;
- I(br_sis_i) <+ ddt(csu*V(br_sis_i));
- end else begin
-// V(br_sis_v) <+ 0.0;
- I(br_sis_i) <+ V(br_sis_i)/`MIN_R;
- end
-
- // Following code is an intermediate solution (if branch contribution is not supported):
- // ******************************************
- if(flsh == 0 || rth < `MIN_R) begin
- I(br_sht) <+ V(br_sht)/`MIN_R;
- end else begin
- I(br_sht) <+ V(br_sht)/rth-pterm;
- I(br_sht) <+ ddt(cth*V(br_sht));
- end
-
- // ******************************************
-
- // For simulators having no problem with V(br_sht) <+ 0.0
- // with external thermal node, follwing code may be used.
- // Note that external thermal node should remain accessible
- // even without self-heating.
- // ********************************************
- //if(flsh == 0 || rth < `MIN_R) begin
- // V(br_sht) <+ 0.0;
- //end else begin
- // I(br_sht) <+ V(br_sht)/rth-pterm;
- // I(br_sht) <+ ddt(cth*V(br_sht));
- //end
- // ********************************************
-
- // NQS effect
- I(br_bxf1) <+ Ixf1;
- I(br_cxf1) <+ ddt(Qxf1);
- I(br_bxf2) <+ Ixf2;
- I(br_cxf2) <+ ddt(Qxf2);
-
- I(br_bxf) <+ Ixf; //for RC nw
- I(br_cxf) <+ ddt(Qxf); //for RC nw
-
-end //of Load_sources
-
-
-`NOISE begin : Noise_sources
-
- //Thermal noise
- fourkt = 4.0 * `P_K * Tdev;
- if(rbx >= `MIN_R) begin
- I(br_bbp_i) <+ white_noise(fourkt/rbx_t, "thermal");
- end
- if(rbi0 >= `MIN_R) begin
- I(br_bpbi_i) <+ white_noise(fourkt/rbi, "thermal");
- end
- if(rcx >= `MIN_R) begin
- I(br_cic_i) <+ white_noise(fourkt/rcx_t, "thermal");
- end
- if(re >= `MIN_R) begin
- I(br_eie_i) <+ white_noise(fourkt/re_t, "thermal");
- end
- if(rsu >= `MIN_R) begin
- I(br_sis_i) <+ white_noise(fourkt/rsu, "thermal");
- end
-
- //Flicker noise : Fully correlated between the perimeter and internal base-node
- flicker_Pwr = kf*pow((ibei+ibep),af);
- if (cfbe == -1) begin
- I(br_biei) <+ flicker_noise(flicker_Pwr,1.0);
- end else begin
- I(br_bpei) <+ flicker_noise(flicker_Pwr,1.0);
- end
-
- //Shot noise
-
- twoq = 2.0 * `P_Q;
- // I(br_ciei) <+ white_noise(twoq*it, "shot");
- I(br_cibi) <+ white_noise(twoq*iavl, "shot");
-
- // I(br_biei) <+ white_noise(twoq*ibei, "shot");
-
- I(br_bici) <+ white_noise(twoq*abs(ibci), "shot");
-
- I(br_bpei) <+ white_noise(twoq*ibep, "shot");
-
- I(br_bpci) <+ white_noise(twoq*abs(ijbcx), "shot");
-
- I(br_sici) <+ white_noise(twoq*abs(ijsc), "shot");
-
- // Code section for correlated noise
- // Please turn-off this code section by "//" in order to run the code with Spectre
-
-// I(b_n1) <+ white_noise(2 * `P_Q * ibei, "shot");
-// I(b_n1) <+ V(b_n1);
-// I(b_n2) <+ white_noise(2 * `P_Q * it, "shot");
-// I(b_n2) <+ V(b_n2);
-//
-// I(bi,ei) <+ V(b_n1);
-// I(ci,ei) <+ V(b_n2)+ddt((betadc/2)*alit*Tf*alit*Tf*ddt(V(b_n2)));
-// I(ci,ei) <+ betadc*ddt(-(Tf*alit)*V(b_n1));
-end //of Noise_sources
-
-end //analog
-endmodule
diff --git a/src/spicelib/devices/adms/mextram/adms3va/COPYRIGHT_NOTICE b/src/spicelib/devices/adms/mextram/adms3va/COPYRIGHT_NOTICE
deleted file mode 100644
index 09d01075d..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/COPYRIGHT_NOTICE
+++ /dev/null
@@ -1,40 +0,0 @@
-Verilog-A implementation of the Mextram Bipolar Transistor Model,
-including variants of the Mextram model released by Delft University.
-
-Copyright (c) 2006 Delft University of Technology
-Licensed under the Educational Community License version 1.0
-
-
-This Original Work, including software, source code, documents, or other related items,
-is being provided by the copyright holder(s) subject to the terms of the Educational
-Community License. By obtaining, using and/or copying this Original Work, you agree that
-you have read, understand, and will comply with the following terms and conditions of
-the Educational Community License:
-
-Permission to use, copy, modify, merge, publish, distribute, and sublicense this Original
-Work and its documentation, with or without modification, for any purpose, and without fee
-or royalty to the copyright holder(s) is hereby granted, provided that you include the
-following on ALL copies of the Original Work or portions thereof, including modifications
-or derivatives, that you make:
-
-The full text of the Educational Community License in a location viewable to users of the
-redistributed or derivative work.
-
-Any pre-existing intellectual property disclaimers, notices, or terms and conditions.
-
-Notice of any changes or modifications to the Original Work, including the date the
-changes were made.
-
-Any modifications of the Original Work must be distributed in such a manner as to avoid
-any confusion with the Original Work of the copyright holders.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-The name and trademarks of copyright holder(s) may NOT be used in advertising or publicity
-pertaining to the Original or Derivative Works without specific, written prior permission.
-Title to copyright in the Original Work and any associated documentation will at all times
-remain with the copyright holders.
diff --git a/src/spicelib/devices/adms/mextram/adms3va/bjt504t.va b/src/spicelib/devices/adms/mextram/adms3va/bjt504t.va
deleted file mode 100644
index 1d2920892..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/bjt504t.va
+++ /dev/null
@@ -1,40 +0,0 @@
-`include "frontdef.inc"
-`define SELFHEATING
-`define SUBSTRATE
-
-module bjt504tva (c, b, e, s, dt);
-
- // External ports
- inout c, b, e, s, dt;
-
- (*info="external collector node"*) electrical c;
- (*info="external base node"*) electrical b;
- (*info="external emitter node"*) electrical e;
- (*info="external substrate node"*) electrical s;
- (*info="external thermal node"*) electrical dt;
-
- // Internal nodes
- (*info="internal collector node 1"*) electrical c1;
- (*info="internal emitter node"*) electrical e1;
- (*info="internal base node 1"*) electrical b1;
- (*info="internal base node 2"*) electrical b2;
- (*info="internal collector node 2"*) electrical c2;
- (*info="internal collector node 3"*) electrical c3;
- (*info="internal collector node 4"*) electrical c4;
- // For correlated noise implementation
- (*info="internal noise node"*) electrical noi;
-
-`include "parameters.inc"
-`include "variables.inc"
-`include "opvars.inc"
-
-analog begin
-
-`include "initialize.inc"
-`include "tscaling.inc"
-`include "evaluate.inc"
-`include "opinfo.inc"
-
-end // analog
-endmodule
-
diff --git a/src/spicelib/devices/adms/mextram/adms3va/evaluate.inc b/src/spicelib/devices/adms/mextram/adms3va/evaluate.inc
deleted file mode 100644
index 76b9184af..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/evaluate.inc
+++ /dev/null
@@ -1,704 +0,0 @@
-// Evaluate model equations
-
-begin // Currents and sharges
-// Nodal biases
-
- Vb2c1 = TYPE * V(b2, c1);
- Vb2c2 = TYPE * V(b2, c2);
- Vb2e1 = TYPE * V(b2, e1);
- Vb1e1 = TYPE * V(b1, e1);
- Vb1b2 = TYPE * V(b1, b2);
-`ifdef SUBSTRATE
- Vsc1 = TYPE * V(s, c1);
-`endif
- Vc1c2 = TYPE * V(c1, c2);
- Vee1 = TYPE * V(e, e1);
- Vbb1 = TYPE * V(b, b1);
- Vbe = TYPE * V(b, e);
- Vbc = TYPE * V(b, c);
-
-/* RvdT, 03-12-2007, voltage differences
- associated with distributed parasitic collector.
- Evaluated taking values of resistances into account:
- in case of vanishing resistance corresponding node
- is not addressed: */
-
-if (RCBLX > 0.0)
- begin
- if (RCBLI > 0.0)
- begin
- Vc4c1 = TYPE * V(c4, c1);
- Vc3c4 = TYPE * V(c3, c4);
- end
- else
- begin
- Vc4c1 = 0 ;
- Vc3c4 = TYPE * V(c3, c1);
- end
- end
-else
- begin
- if (RCBLI > 0.0)
- begin
- Vc4c1 = TYPE * V(c4, c1);
- Vc3c4 = 0 ;
- end
- else
- begin
- Vc4c1 = 0 ;
- Vc3c4 = 0 ;
- end
- end
-
- Vb1c4 = Vb1b2 + Vb2c2 - Vc1c2 - Vc4c1 ;
- Vcc3 = - Vbc + Vbb1 + Vb1c4 - Vc3c4 ;
- Vbc3 = Vbc + Vcc3 ;
-
-`ifdef SUBSTRATE
-Vsc4 = Vsc1 - Vc4c1 ;
-Vsc3 = Vsc4 - Vc3c4 ;
-`endif
-
-
-// Exponential bias terms
-
- `expLin(eVb2c2,Vb2c2 * VtINV)
- `expLin(eVb2e1,Vb2e1 * VtINV)
- `expLin(eVb1e1,Vb1e1 * VtINV)
- `expLin(eVb1c4,Vb1c4 * VtINV)
- `expLin(eVb1b2,Vb1b2 * VtINV)
- `expLin(eVbc3,Vbc3 * VtINV)
-`ifdef SUBSTRATE
- `expLin(eVsc1,Vsc1 * VtINV)
-`endif
-
- `expLin(eVbc3VDC,(Vbc3 - VDC_T) * VtINV)
- `expLin(eVb1c4VDC,(Vb1c4 - VDC_T) * VtINV)
- `expLin(eVb2c2VDC,(Vb2c2 - VDC_T) * VtINV)
- `expLin(eVb2c1VDC,(Vb2c1 - VDC_T) * VtINV)
-
-// Governing equations
-
- // Epilayer model
-
- K0 = sqrt(1.0 + 4.0 * eVb2c2VDC);
- Kw = sqrt(1.0 + 4.0 * eVb2c1VDC);
- pW = 2.0 * eVb2c1VDC / (1.0 + Kw);
- if (pW < `TEN_M40) pW = 0;
- Ec = Vt * (K0 - Kw - ln((K0 + 1.0) / (Kw + 1.0)) );
- Ic1c2 = (Ec + Vc1c2) / RCV_TM + _circuit_gmin * Vc1c2;
-
- if (Ic1c2 > 0.0) begin
-
- `linLog(tmpV,Vb2c1,100.0);
- Vqs_th = VDC_T + 2.0 * Vt *
- ln(0.5 * Ic1c2 * RCV_TM * VtINV + 1.0) - tmpV;
- eps_VDC = 0.2 * VDC_T;
- `max_hyp0(Vqs, Vqs_th, eps_VDC);
- Iqs = Vqs * (Vqs + IHC_M * SCRCV_M) / (SCRCV_M * (Vqs + IHC_M * RCV_TM));
-
- Ic1c2_Iqs = Ic1c2 / Iqs;
- `max_logexp(alpha1, Ic1c2_Iqs, 1.0, AXI);
- alpha = alpha1 / (1.0 + AXI * ln(1.0 + exp(-1.0 / AXI)));
- vyi = Vqs / (IHC_M * SCRCV_M);
- yi = (1.0 + sqrt(1.0 + 4.0 * alpha * vyi * (1.0 + vyi))) /
- (2.0 * alpha * (1.0 + vyi));
-
- xi_w = 1.0 - yi / (1.0 + pW * yi);
- gp0 = 0.5 * Ic1c2 * RCV_TM * xi_w * VtINV;
-
- gp0_help = 2.0 * gp0 + pW * (pW + gp0 + 1.0);
- gp02 = 0.5 * (gp0 - 1.0);
- sqr_arg = gp02 * gp02 + gp0_help;
- if (gp0 >= 1.0)
- p0star = gp02 + sqrt(sqr_arg);
- else
- p0star = gp0_help / (sqrt(sqr_arg) - gp02);
- if (p0star < `TEN_M40) p0star = 0.0;
-
-
- eVb2c2star = p0star * (p0star + 1.0) * exp(VDC_T * VtINV);
- B1 = 0.5 * SCRCV_M * (Ic1c2 - IHC_M);
- B2 = SCRCV_M * RCV_TM * IHC_M * Ic1c2;
- Vxi0 = B1 + sqrt(B1 * B1 + B2);
- Vch = VDC_T * (0.1 + 2.0 * Ic1c2 / (Ic1c2 + Iqs));
- Icap = IHC_M * Ic1c2 / (IHC_M + Ic1c2);
- Icap_IHC = IHC_M / (IHC_M + Ic1c2);
-
- end else begin
-
- p0star = 2.0 * eVb2c2VDC / (1.0 + K0);
- eVb2c2star = eVb2c2;
- if ((abs(Vc1c2) < 1.0e-5 * Vt) ||
- (abs(Ec) < `TEN_M40 * Vt * (K0 + Kw)))
- begin
- pav = 0.5 * (p0star + pW);
- xi_w = pav / (pav + 1.0);
- end
-
- else
- begin
- xi_w = Ec / (Ec + Vb2c2 - Vb2c1);
- end
-
- Vxi0 = Vc1c2;
- Vch = 0.1 * VDC_T;
- Icap = Ic1c2;
- Icap_IHC = 1.0 - Icap / IHC_M;
-
- end
-
- // Effective emitter junction capacitance bias
-
- Vfe = VDE_T * (1.0 - pow(`AJE , -1.0 / PE));
- a_VDE = 0.1 * VDE_T;
- `min_logexp(Vje, Vb2e1, Vfe, a_VDE);
-
-// RvdT, November 2008, E0BE to be re-used in EB- Zener tunnel model:
- E0BE = pow(1.0 - Vje * inv_VDE_T, 1.0 - PE) ;
- Vte = VDE_T / (1.0 - PE) * (1.0 - E0BE) +
- `AJE * (Vb2e1 - Vje);
-
- // Effective collector junction capacitance bias
-
- Vjunc = Vb2c1 + Vxi0;
- bjc = (`AJC - XP_T) / (1.0 - XP_T);
- Vfc = VDC_T * (1.0 - pow(bjc, -1.0 / PC));
- `min_logexp(Vjc, Vjunc, Vfc, Vch);
- fI = pow(Icap_IHC, MC);
- Vcv = VDC_T / (1.0 - PC) * (1.0 - fI * pow(1.0 - Vjc / VDC_T, 1.0 - PC)) +
- fI * bjc * (Vjunc - Vjc);
- Vtc = (1.0 - XP_T) * Vcv + XP_T * Vb2c1;
-
- // Transfer current
-
- If0 = 4.0 * IS_TM / IK_TM;
- f1 = If0 * eVb2e1;
- n0 = f1 / (1.0 + sqrt(1.0 + f1));
- f2 = If0 * eVb2c2star;
- nB = f2 / (1.0 + sqrt(1.0 + f2));
-
- if (DEG == 0.0)
- q0I = 1.0 + Vte / VER_T + Vtc / VEF_T;
- else
- begin
- termE = (Vte / VER_T + 1.0) * DEG_T * VtINV;
- termC = -Vtc / VEF_T * DEG_T * VtINV;
- q0I = (exp(termE) - exp(termC)) /
- (exp(DEG_T * VtINV) - 1.0);
- end
-
- `max_hyp0(q1I, q0I, 0.1);
- qBI = q1I * (1.0 + 0.5 * (n0 + nB));
-
- Ir = IS_TM * eVb2c2star;
- If = IS_TM * eVb2e1;
- In = (If - Ir) / qBI;
-
- // Base and substrate current(s)
-
- Ibf0 = IS_TM / BF_T;
- if (XREC == 0.0)
- Ib1 = (1.0 - XIBI) * Ibf0 * (eVb2e1 - 1.0);
- else
- Ib1 = (1.0 - XIBI) * Ibf0 * ((1.0 - XREC) * (eVb2e1 - 1.0) +
- XREC * (eVb2e1 + eVb2c2star - 2.0) * (1.0 + Vtc / VEF_T));
-
- Ib1_s = XIBI * Ibf0 * (eVb1e1 - 1.0);
- `expLin(tmpExp,Vb2e1 * VtINV / MLF)
- Ib2 = IBF_TM * (tmpExp - 1.0) + _circuit_gmin * Vb2e1;
- `expLin(tmpExp,0.5 * Vb1c4 * VtINV)
- Ib3 = IBR_TM * (eVb1c4 - 1.0) /
- (tmpExp + exp(0.5 * VLR * VtINV)) +
- _circuit_gmin * Vb1c4;
-
-// begin RvdT, November 2008, MXT504.8_alpha
-
-// Base-emitter tunneling current
-// max E-field E0BE calculated in BE depletion charge model:
-
- if (IZEB > 0.0 && NZEB > 0.0 && Vb2e1 < 0)
- begin
-
- `expLin(eZEB, nZEB_T * (1 - (pow2_2mPE/(2.0*E0BE))))
-// Force all derivatives at Vb2e1=0 to zero by using in DZEB a
-// modified dE0BE expression for E0BE:
- x = Vb2e1 * inv_VDE_T ;
- dE0BE = pow(- x, -2.0-PE)*(PE*(1-PE*PE-3*x*(PE-1))-6*x*x*(PE-1+x)) * `one_sixth ;
- `expLin(edZEB, Vb2e1 * pow2_2mPE * nZEB_T / (VGZEB_T * dE0BE ))
- DZEB = - Vb2e1 - VGZEB_T * dE0BE * (1 - edZEB) / (pow2_2mPE * nZEB_T) ;
- Izteb = 2.0 * IZEB_TM * DZEB * E0BE * eZEB * inv_VDE_T * pow2_PEm2 ;
- end
- else
- begin
- DZEB = 0 ;
- Izteb = 0 ;
- end
-
-// end RvdT, November 2008, MXT504.8_alpha
-
- // Iex, Isub (XIex, XIsub)
-
- g1 = If0 * eVb1c4;
- g2 = 4.0 * eVb1c4VDC;
- nBex = g1 / (1.0 + sqrt(1.0 + g1));
- pWex = g2 / (1.0 + sqrt(1.0 + g2));
- Iex = (1.0 / BRI_T) * (0.5 * IK_TM * nBex - IS_TM);
-
-`ifdef SUBSTRATE
- Isub = 2.0 * ISS_TM * (eVb1c4 - 1.0) /
- (1.0 + sqrt(1.0 + 4.0 * (IS_TM / IKS_TM) * eVb1c4));
-// until504.8: Isf = ISS_TM * (eVsc1 - 1.0);
-// New 504.9:
-
-if (ICSS < 0.0)
-// this clause is to implement backwards compatibility
- begin
- Isf = ISS_TM * (eVsc1 - 1.0);
- end
- else
- begin
- Isf = ICSS_TM * (eVsc1 - 1.0);
- end
-
-// End: New 504.9.
-
-`endif
-
- XIex =0.0;
-
-`ifdef SUBSTRATE
- XIsub = 0.0;
-`endif
-
- if (EXMOD == 1)
- begin
-
- Iex = Iex * Xext1;
-
-`ifdef SUBSTRATE
- Isub = Isub * Xext1;
-`endif
-
- Xg1 = If0 * eVbc3;
- XnBex = Xg1 / (1.0 + sqrt(1.0 + Xg1));
- XIMex = XEXT * (0.5 * IK_TM * XnBex - IS_TM) / BRI_T;
-
-`ifdef SUBSTRATE
- XIMsub = XEXT * 2.0 * ISS_TM * (eVbc3 - 1.0) /
- (1.0 + sqrt(1.0 + 4.0 * IS_T / IKS_T * eVbc3));
- Vex_bias = XEXT * (IS_TM / BRI_T + ISS_TM) * RCCxx_TM;
-`else
- XIMsub = 0.0;
- Vex_bias = XEXT * (IS_TM / BRI_T) * RCCxx_TM;
-`endif
-
- Vex = Vt * (2.0 - ln( Vex_bias * VtINV));
- vdif = Vbc3 - Vex;
- `max_hyp0(VBex, vdif, 0.11);
-
- Fex = VBex /(Vex_bias + (XIMex + XIMsub) * RCCxx_TM + VBex);
- XIex = Fex * XIMex;
-
-`ifdef SUBSTRATE
- XIsub = Fex * XIMsub;
-`endif
- end
- else
- begin
- Fex = 0;
- XnBex = 0 ;
- end
-
- // Variable base resistance
-
- q0Q = 1.0 + Vte / VER_T + Vtc / VEF_T;
- `max_hyp0(q1Q, q0Q, 0.1);
- qBQ = q1Q * (1.0 + 0.5 * (n0 + nB));
-
- Rb2 = 3.0 * RBV_TM / qBQ;
- Ib1b2 = (2.0 * Vt * (eVb1b2 - 1.0) + Vb1b2) / Rb2 + _circuit_gmin * Vb1b2;
-
- // Weak-avalanche current
-
- Iavl = 0.0;
- Gem = 0.0;
- if ((Ic1c2 > 0.0) && (Vb2c1 < VDC_T)) begin
-
- dEdx0 = 2.0 * VAVL / (WAVL * WAVL);
- sqr_arg = (VDC_T - Vb2c1) / Icap_IHC;
- xd = sqrt(2.0 * sqr_arg / dEdx0);
- if (EXAVL == 0.0)
- Weff = WAVL;
- else
- begin
- xi_w1 = 1.0 - 0.5 * xi_w;
- Weff = WAVL * xi_w1 * xi_w1;
- end
- Wd = xd * Weff / sqrt(xd * xd + Weff * Weff);
- Eav = (VDC_T - Vb2c1) / Wd;
- E0 = Eav + 0.5 * Wd * dEdx0 * Icap_IHC;
-
- if (EXAVL == 0)
- Em = E0;
- else
- begin
- SHw = 1.0 + 2.0 * SFH * (1.0 + 2.0 * xi_w);
- Efi = (1.0 + SFH) / (1.0 + 2.0 * SFH);
- Ew = Eav - 0.5 * Wd * dEdx0 * (Efi - Ic1c2 / (IHC_M * SHw));
- sqr_arg = (Ew - E0) * (Ew - E0) + 0.1 * Eav * Eav * Icap / IHC_M;
- Em = 0.5 * (Ew + E0 + sqrt(sqr_arg));
- end
-
- EmEav_Em = (Em - Eav) / Em;
- if (abs(EmEav_Em) > `TEN_M07)
- begin
- lambda = 0.5 * Wd / EmEav_Em;
- Gem = An / BnT * Em * lambda *
- (exp(-BnT / Em) - exp(-BnT / Em * (1.0 + Weff / lambda)) );
- end
- else
- Gem = An * Weff * exp(-BnT / Em);
-
- Gmax = Vt / (Ic1c2 * (RBC_TM + Rb2)) + qBI / BF_T +
- RE_TM / (RBC_TM + Rb2);
- Iavl = Ic1c2 * Gem / (Gem +Gem / Gmax + 1.0);
- end
-
- if (eVb2c2star > 0.0)
- Vb2c2star = Vt * ln(eVb2c2star);
- else
- Vb2c2star = Vb2c2;
-
-`ifdef SELFHEATING
- // Power dissipation
-
-// RvdT 03-12-2007, modified power equation due to distribution collector resistance
-
- power = In * (Vb2e1 - Vb2c2star) +
- Ic1c2 * (Vb2c2star - Vb2c1) -
- Iavl * Vb2c2star +
- Vee1 * Vee1 / RE_TM +
- Vcc3 * Vcc3 * GCCxx_TM +
- Vc3c4 * Vc3c4 * GCCex_TM +
- Vc4c1 * Vc4c1 * GCCin_TM +
- Vbb1 * Vbb1 / RBC_TM +
- Ib1b2 * Vb1b2 +
-// 504.8: Nov. 2008, RvdT, TU_Delft: Zener current contribution added:
-// Izteb > 0 for Vb2e1 < 0, hence the minus sign:
- (Ib1 + Ib2 - Izteb) * Vb2e1 +
- Ib1_s * Vb1e1 +
-`ifdef SUBSTRATE
- (Iex + Ib3) * Vb1c4 + XIex * Vbc3 +
- Isub * (Vb1c4 - Vsc4) +
- XIsub * (Vbc3 - Vsc3) +
- Isf * Vsc1;
-`else
- (Iex + Ib3) * Vb1c4 + XIex * Vbc3;
-`endif
-
-`endif
-
-
- // Charges
-
- Qte = (1.0 - XCJE) * CJE_TM * Vte;
- `min_logexp(Vje_s, Vb1e1, Vfe, a_VDE);
- Qte_s = XCJE * CJE_TM * (VDE_T / (1.0 - PE) *
- (1.0 - pow(1.0 - Vje_s * inv_VDE_T, 1.0 - PE)) +
- `AJE * (Vb1e1 - Vje_s));
-
- Qtc = XCJC * CJC_TM * Vtc;
- Qb0 = TAUB_T * IK_TM;
- Qbe_qs = 0.5 * Qb0 * n0 * q1Q;
- Qbc_qs = 0.5 * Qb0 * nB * q1Q;
-
- a_VDC = 0.1 * VDC_T;
- `min_logexp(Vjcex, Vb1c4, Vfc, a_VDC);
- Vtexv = VDC_T / (1.0 - PC) * (1.0 - pow(1.0 - Vjcex / VDC_T, 1.0 - PC)) +
- bjc * (Vb1c4 - Vjcex);
- Qtex = CJC_TM * ((1.0 - XP_T) * Vtexv + XP_T * Vb1c4) *
- (1.0 - XCJC) * (1.0 - XEXT);
-
- `min_logexp(XVjcex, Vbc3, Vfc, a_VDC);
- XVtexv = VDC_T / (1.0 - PC) * (1.0 - pow(1.0 - XVjcex / VDC_T, 1.0 - PC)) +
- bjc * (Vbc3 - XVjcex);
- XQtex = CJC_TM * ((1.0 - XP_T) * XVtexv + XP_T * Vbc3) *
- (1.0 - XCJC) * XEXT;
-
-`ifdef SUBSTRATE
- a_VDS = 0.1 * VDS_T;
- Vfs = VDS_T * (1.0 - pow(`AJS , -1.0 / PS));
- `min_logexp(Vjs, Vsc1, Vfs, a_VDS);
- Qts = CJS_TM * (VDS_T / (1.0 - PS) *
- (1.0 - pow(1.0 - Vjs / VDS_T, 1.0 - PS)) + `AJS * (Vsc1 - Vjs));
-`endif
-
- Qe0 = TAUE_T * IK_TM * pow(IS_TM / IK_TM, 1.0 / MTAU);
- `expLin(tmpExp,Vb2e1 / (MTAU * Vt))
- Qe = Qe0 * (tmpExp - 1.0);
-
- Qepi0 = 4.0 * TEPI_T * Vt / RCV_TM;
- Qepi = 0.5 * Qepi0 * xi_w * (p0star + pW + 2.0);
-
- Qex = TAUR_T * 0.5 * (Qb0 * nBex + Qepi0 * pWex) / (TAUB_T + TEPI_T);
- XQex = 0.0;
-
- if (EXMOD == 1) begin
-
- Qex = Qex * (1.0 - XEXT);
- Xg2 = 4.0 * eVbc3VDC;
- XpWex = Xg2 / (1.0 + sqrt(1.0 + Xg2));
- XQex = 0.5 * Fex * XEXT * TAUR_T *
- (Qb0 * XnBex + Qepi0 * XpWex) / (TAUB_T + TEPI_T);
-
- end
-
- Qb1b2 = 0.0;
- if (EXPHI == 1)
- begin
- dVteVje = pow(1.0 - Vje * inv_VDE_T, -PE) - `AJE;
- Vb2e1Vfe = (Vb2e1 - Vfe) / a_VDE;
- if (Vb2e1Vfe < 0.0)
- dVjeVb2e1 = 1.0 / (1.0 + exp(Vb2e1Vfe));
- else
- dVjeVb2e1 = exp(- Vb2e1Vfe) / (1.0 + exp(- Vb2e1Vfe));
-
- dVteVb2e1 = dVteVje * dVjeVb2e1 + `AJE;
- dQteVb2e1 = (1.0 - XCJE) * CJE_TM * dVteVb2e1;
-
- dn0Vb2e1 = If0 * eVb2e1 * VtINV * (0.5 / sqrt(1.0 + f1));
- dQbeVb2e1 = 0.5 * Qb0 * q1Q * dn0Vb2e1;
-
- dQeVb2e1 = (Qe + Qe0) / (MTAU * Vt);
-
- Qb1b2 = 0.2 * Vb1b2 * (dQteVb2e1 + dQbeVb2e1 + dQeVb2e1);
-
- Qbc = Qbe_qs * `one_third + Qbc_qs;
- Qbe = 2.0 * Qbe_qs * `one_third ;
- end
- else
- begin
- Qbe = Qbe_qs;
- Qbc = Qbc_qs;
- end
-
-
-// Add branch current contributions
-
- // Static currents
- I(c1, c2) <+ TYPE * Ic1c2;
- I(c2, e1) <+ TYPE * In;
- I(b1, e1) <+ TYPE * Ib1_s;
-// begin RvdT, 28-10-2008, MXT504.8_alpha
-// contribution tunnel current added
- I(b2, e1) <+ TYPE * (Ib1 + Ib2 - Izteb);
-
-`ifdef SUBSTRATE
- I(b1, s) <+ TYPE * Isub;
- I(b, s) <+ TYPE * XIsub;
- I(s, c1) <+ TYPE * Isf;
-`endif
- I(b1, b2) <+ TYPE * Ib1b2;
- I(b2, c2) <+ TYPE * (-1.0 * Iavl);
- I(e, e1) <+ TYPE * Vee1 / RE_TM;
- I(b, b1) <+ TYPE * Vbb1 / RBC_TM;
-
-`ifdef SELFHEATING
- // Electrical equivalent for the thermal network
- I(dt) <+ V(dt) / RTH_Tamb_M;
- I(dt) <+ ddt(CTH_M * V(dt));
- I(dt) <+ -1.0 * power;
-`endif
-
- // Electrical equivalent for the correlated noise
- I(noi, e1) <+ V(noi, e1);
- cor_exp_1 = sqrt(1.0 + 2.0 * Gem) * V(noi,e1);
- I(b2, e1) <+ cor_exp_1;
- cor_exp_2 = (2.0 + 2.0 * Gem) / sqrt(1.0 + 2.0 * Gem) * V(noi, e1);
- I(e1, c2) <+ cor_exp_2;
-
- // Dynamic currents
- I(b2, e1) <+ ddt(TYPE * (Qte + Qbe + Qe));
- I(b1, e1) <+ ddt(TYPE * (Qte_s));
- I(b2, c2) <+ ddt(TYPE * (Qtc + Qbc + Qepi));
-`ifdef SUBSTRATE
- I(s, c1) <+ ddt(TYPE * Qts);
-`endif
- I(b1, b2) <+ ddt(TYPE * Qb1b2);
- I(b, e) <+ ddt(TYPE * CBEO_M * Vbe);
- I(b, c) <+ ddt(TYPE * CBCO_M * Vbc);
-
- end // Currents and charges
-
-
-/* RvdT, Delft Univ. Tech. 03-12-2007.
-Distribution of parasitic collector resistance.
-This construct supports the case
-RCBLI = 0.0 and or RCBLX = 0.0 .
-It is up to the compiler to adjust the circuit topology
-and perform a node-collapse in such cases. */
-if (RCBLX > 0.0)
- begin
- I(b, c3) <+ TYPE * XIex;
- I(c, c3) <+ TYPE * Vcc3 * GCCxx_TM ;
- I(b, c3) <+ ddt(TYPE * (XQtex + XQex));
- if (RCBLI > 0.0)
- begin
- I(c4, c1) <+ TYPE * Vc4c1 * GCCin_TM;
- I(b1, c4) <+ TYPE * (Ib3 + Iex);
- I(c3, c4) <+ TYPE * Vc3c4 * GCCex_TM ;
- I(b1, c4) <+ ddt(TYPE * (Qtex + Qex));
- end
- else
- begin
- V(c4, c1) <+ 0.0 ;
- I(b1, c1) <+ TYPE * (Ib3 + Iex);
- I(b1, c1) <+ ddt(TYPE * (Qtex + Qex));
- I(c3, c1) <+ TYPE * Vc3c4 * GCCex_TM ;
- end
- end
-else
- begin
- V(c3, c4) <+ 0 ;
- if (RCBLI > 0.0)
- begin
- I(b, c4) <+ TYPE * XIex;
- I(c, c4) <+ TYPE * Vcc3 * GCCxx_TM ;
- I(c4, c1) <+ TYPE * Vc4c1 * GCCin_TM;
- I(b1, c4) <+ TYPE * (Ib3 + Iex);
- I(b1, c4) <+ ddt(TYPE * (Qtex + Qex));
- I(b, c4) <+ ddt(TYPE * (XQtex + XQex));
- end
- else
- begin
- I(b, c1) <+ TYPE * XIex;
- I(c, c1) <+ TYPE * Vcc3 * GCCxx_TM ;
- V(c4, c1) <+ 0.0 ;
- I(b1, c1) <+ TYPE * (Ib3 + Iex);
- I(b1, c1) <+ ddt(TYPE * (Qtex + Qex));
- I(b, c1) <+ ddt(TYPE * (XQtex + XQex));
- I(c3, c1) <+ TYPE * Vc3c4 * GCCex_TM ;
- end
- end
-
-// Noise sources
-
-`NOISE begin
-
- // Thermal noise
- common = 4.0 * `KB * Tk;
- powerREC = common / RE_TM; // Emitter resistance
- powerRBC = common / RBC_TM; // Base resistance
- // RvdT, 03-12-2007: distributed collector resistance
- powerRCCxx = common * GCCxx_TM; // Collector resistance
- powerRCCex = common * GCCex_TM; // Collector resistance
- powerRCCin = common * GCCin_TM; // Collector resistance
- powerRBV = common / Rb2 * (4.0 * eVb1b2 + 5.0) * `one_third ; // Variable base resistance
-
- // Collector current shot noise
- powerCCS = 2.0 * `QQ * (If + Ir) / qBI;
-
- // Forward base current shot noise and 1/f noise
-// 504.8, Nov. 2008, RvdT, TU-Delft: added Zener current to shot noise
- powerFBCS = 2.0 * `QQ * (abs(Ib1) + abs(Ib2) + abs(Izteb));
- powerFBC1fB1 = (1.0 - XIBI) * pow((abs(Ib1) / (1 - XIBI)), AF) * KF_M;
- exponentFBC1fB2 = (2.0 * (MLF - 1.0)) + (AF * (2.0 - MLF));
- powerFBC1fB2 = KFN_M * pow(abs(Ib2), exponentFBC1fB2);
-
- // Emitter-base sidewall current shot and 1/f noise
- powerEBSCS = 2.0 * `QQ * abs(Ib1_s);
- if (XIBI == 0)
- powerEBSC1f = 0.0;
- else
- powerEBSC1f = KF_M * XIBI * pow((abs(Ib1_s / XIBI)), AF);
-
- // Reverse base current shot noise and 1/f noise
- powerRBCS = 2.0 * `QQ * abs(Ib3);
- powerRBC1f = KF_M * pow(abs(Ib3), AF);
-
- // Extrinsic current shot noise and 1/f noise
- powerExCS = 2.0 * `QQ * abs(Iex);
- powerExC1f = KF_M * (1 - (EXMOD * XEXT)) *
- pow((abs(Iex) / (1 - (EXMOD * XEXT))), AF);
- powerExCSMOD = 2.0 * `QQ * abs(XIex) * EXMOD;
- if (XEXT == 0.0)
- powerExC1fMOD = 0.0;
- else
- powerExC1fMOD = KF_M * EXMOD * XEXT * pow((abs(XIex) / XEXT), AF);
-
-`ifdef SUBSTRATE
- // Substrate current shot noise (between nodes B1 and S, resp. B and S)
- powerSubsCS_B1S = 2.0 * `QQ * abs(Isub);
- powerSubsCS_BS = 2.0 * `QQ * abs(XIsub);
-`endif
-
-
- // Noise due to the avalanche
- // twoqIavl = KAVL * 2.0 * `QQ * Iavl;
- twoqIavl = KAVL*Gem*powerCCS;
- powerCCS_A = powerCCS + twoqIavl * (3.0 + 2.0 * Gem
- - (2.0 + 2.0 * Gem)*(2.0 + 2.0 * Gem)/(1.0 + 2.0 * Gem) );
-
- // Add noise sources
- I(e, e1) <+ white_noise(powerREC); // "emitter resistance"
- I(b, b1) <+ white_noise(powerRBC); // "base resistance"
-
- I(b1, b2) <+ white_noise(powerRBV); // "variable baseresistance"
-
- I(noi, e1) <+ white_noise(twoqIavl); // "avalanche"
- I(c2, e1) <+ white_noise(powerCCS_A); // "col_emi_shot"
- I(b2, e1) <+ white_noise(powerFBCS); // "bas_emi_forw"
-
- I(b2, e1) <+ flicker_noise(powerFBC1fB1, 1); // "bas_emi_forw"
- I(b2, e1) <+ flicker_noise(powerFBC1fB2, 1); // "bas_emi_forw"
- I(e1, b1) <+ white_noise(powerEBSCS); // "emi_bas_side"
- I(e1, b1) <+ flicker_noise(powerEBSC1f, 1); // "emi_bas_side"
- I(b1, c4) <+ white_noise(powerRBCS); // "bas_col_reve"
- I(b1, c4) <+ flicker_noise(powerRBC1f, 1); // "bas_col_reve"
- I(b1, c4) <+ white_noise(powerExCS); // "Ext_bas_col"
- I(b1, c4) <+ flicker_noise(powerExC1f, 1); // "Ext_bas_col"
- I(b, c3) <+ white_noise(powerExCSMOD); // "Ext_bas_col"
- I(b, c3) <+ flicker_noise(powerExC1fMOD, 1); // "Ext_bas_col"
-`ifdef SUBSTRATE
- I(b1, s) <+ white_noise(powerSubsCS_B1S); // "bas_sub_current"
- I(b, s) <+ white_noise(powerSubsCS_BS); // "bas_sub_current"
-`endif
-
-/* RvdT, Delft University of Technology 03-12-2007,
-Noise voltage associated with distributed parasitic collector.
-In case of vanishing resistance corresponding node
-is not addressed: */
-
- // RvdT, 31-01-2007: distributed collector resistance
-
-if (RCBLX > 0.0)
- begin
- if (RCBLI > 0.0)
- begin /* all branches exist */
- I(c, c3) <+ white_noise(powerRCCxx); // "collector plug resistance"
- I(c3, c4) <+ white_noise(powerRCCex); // "extrinsic collector BL resistance"
- I(c4, c1) <+ white_noise(powerRCCin); // "intrinsic collector BL resistance"
- end
- else
- begin /* only Rcblx exists */
- I(c, c3) <+ white_noise(powerRCCxx); // "collector plug resistance"
- I(c3, c1) <+ white_noise(powerRCCex); // "extrinsic collector BL resistance"
- end
- end
-else
- begin
- if (RCBLI > 0.0)
- begin /* only Rcbli exists */
- I(c, c4) <+ white_noise(powerRCCxx); // "collector plug resistance"
- I(c4, c1) <+ white_noise(powerRCCin); // "intrinsic collector BL resistance"
- end
- else
- begin /* neither Rcblx nor Rcbli exists */
- I(c, c1) <+ white_noise(powerRCCxx); // "collector plug resistance"
- end
- end
-
-
-end // Noise sources
-
diff --git a/src/spicelib/devices/adms/mextram/adms3va/frontdef.inc b/src/spicelib/devices/adms/mextram/adms3va/frontdef.inc
deleted file mode 100644
index 23e418c11..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/frontdef.inc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Front definitions
-
-`include "discipline.h"
-
-// Numerical, physical and model constants
-`define TEN_M40 1.0e-40
-`define TEN_M07 1.0e-7
-`define C2K 273.15
-`define KB 1.3806226e-23
-`define QQ 1.6021918e-19
-`define KBdivQQ 8.61708691805812512584e-5
-`define one_third 0.33333333333333333333
-`define one_sixth 0.16666666666666666667
-`define VDLOW 0.05
-`define AJE 3.0
-`define AJC 2.0
-`define AJS 2.0
-`define VEXLIM 200.0
-`define PI 3.1415926
-
-// Desriptions and units
-`ifdef __VAMS_COMPACT_MODELING__
- `define OPP(nam,uni,des) (* desc="des", units="uni" *) real nam;
- `define PAR(des,uni) (* desc="des", units="uni" *) parameter real
- `define PAI(des,uni) (* desc="des", units="uni" *) parameter integer
-`else
- `define OPP(nam,uni,des)
- `define PAR(des,uni) parameter real
- `define PAI(des,uni) parameter integer
-`endif
-
-// ADMS specific definitions
-`ifdef insideADMS
- `define MODEL @(initial_model)
- `define INSTANCE @(initial_instance)
- `define NOISE @(noise)
- `define ATTR(txt) (*txt*)
-`else
- `define MODEL
- `define INSTANCE
- `define NOISE
- `define ATTR(txt)
-`endif
-
-// Smooth limitting functions
-`define max_hyp0(result, x, epsilon)\
- eps2 = epsilon * epsilon;\
- x2 = x * x;\
- if (x < 0.0)\
- result = 0.5 * eps2 / (sqrt(x2 + eps2) - x);\
- else\
- result = 0.5 * (sqrt(x2 + eps2) + x);\
- result=result
-
-`define min_logexp(result, x, x0, a)\
- dxa = (x - x0) / (a);\
- if (x < x0)\
- result = x - a * ln(1.0 + exp(dxa));\
- else\
- result = x0 - a * ln(1.0 + exp(-dxa));\
- result=result
-
-`define max_logexp(result, x, x0, a)\
- dxa = (x - x0) / (a);\
- if (x < x0)\
- result = x0 + a * ln(1.0 + exp(dxa));\
- else\
- result = x + a * ln(1.0 + exp(-dxa));\
- result=result
-
-`define expLin(result, x)\
- if (x < `VEXLIM)\
- result = exp(x);\
- else begin\
- expl = exp(`VEXLIM);\
- result = expl * (1.0 + (x - `VEXLIM));\
- end
-
-`define linLog(result, x, vlim)\
- if (x < vlim)\
- result = x;\
- else\
- result = vlim + ln(1.0 + (x - vlim));\
- result=result
diff --git a/src/spicelib/devices/adms/mextram/adms3va/initialize.inc b/src/spicelib/devices/adms/mextram/adms3va/initialize.inc
deleted file mode 100644
index 1b80c2949..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/initialize.inc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Initialze model constants
-
- // Impact ionization constants (NPN - PNP)
-
-if (TYPE == 1) begin
-
- An = 7.03e7;
- Bn = 1.23e8;
-
-end else begin
-
- An = 1.58e8;
- Bn = 2.04e8;
-
-end
-
-Xext1 = 1.0 - XEXT;
-
- // Temperature independent MULT scaling
-
-`ifdef SELFHEATING
- CTH_M = CTH * MULT;
-`endif
-
- CBEO_M = CBEO * MULT;
- CBCO_M = CBCO * MULT;
-
- invMULT = 1.0 / MULT;
- SCRCV_M = SCRCV * invMULT;
-
- KF_M = KF * pow(MULT, 1.0 - AF);
- KFN_M = KFN * pow(MULT, 1.0 - (2.0 * (MLF - 1.0) + AF * (2.0 - MLF)));
-
-// begin: RvdT, November 2008 ; Zener tunneling current model
-
- pow2_2mPE = pow(2.0, 2.0 - PE);
- pow2_PEm2 = 1.0 / pow2_2mPE;
-
-// Reference Temperature expressed in Kelvin:
- Trk = TREF + `C2K;
-
-// begin: RvdT, November 2008 ; Zener tunneling current model
-//
-// Comment added March 2009: this assumes VGZEBOK as a model parameter.
-//
-// Bandgap for Zener tunnel current model at reference temperature in eV:
-// VGZEB_Tr = VGZEBOK - AVGEB*Trk*Trk / (Trk + TVGEB) ;
-// `max_logexp(VGZEB_Tr, VGZEBOK - AVGEB*Trk*Trk / (Trk + TVGEB), 0.05, 0.1) ;
-// end: RvdT, November 2008
-
-// begin: RvdT March 2009:
-// to decrease parameter interdependency,
-// use VGZEB as a parameter, instead of VGZEBOK:
-// VGZEB : bandgap for Zener tunneling at T = Tref,
-// VGZEBOK : bandgap for Zener tunneling at T = 0 K.
-// `max_logexp(VGZEBOK, VGZEB + AVGEB*Trk*Trk / (Trk + TVGEB), 0.05, 0.1);
-//dw can't expand the macro `max_logexp here - using the code
- _x = VGZEB + AVGEB*Trk*Trk / (Trk + TVGEB);
- _x0 = 0.05;
- _a = 0.1;
- _dxa = (_x - _x0) / (_a);
- if (_x < _x0)
- VGZEBOK = _x0 + _a * ln(1.0 + exp(_dxa));
- else
- VGZEBOK = _x + _a * ln(1.0 + exp(-_dxa));
-
- VGZEB_Tr = VGZEB;
-// end: RvdT March 2009: use VGZEB as a parameter, instead of VGZEBOK:
-
- inv_VGZEB_Tr = 1.0 / VGZEB_Tr;
-
- inv_VDE = 1.0 / VDE;
-
-// end: RvdT, November 2008 ; Zener tunneling current model
diff --git a/src/spicelib/devices/adms/mextram/adms3va/opinfo.inc b/src/spicelib/devices/adms/mextram/adms3va/opinfo.inc
deleted file mode 100644
index 6b93b6b0a..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/opinfo.inc
+++ /dev/null
@@ -1,231 +0,0 @@
-// Evaluate the operating point (outout) variables
-begin
-
-`ifdef __VAMS_COMPACT_MODELING__
-
-// The external currents and the current gain
-OP_ic = I(); // External DC collector current
-OP_ib = I(); // External DC base Current
-OP_betadc = OP_ic / OP_ib; // External DC Current gain
-
-// begin added in MXT 504.9:
-OP_ie = I(); // External DC emitter current
-OP_vbe = V(b, e); // External base-emitter bias
-OP_vce = V(c, e); // External collector-emitter bias
-OP_vbc = V(b, c); // External base-collector bias
-
-`ifdef SUBSTRATE
-OP_is = I(); // External DC emitter current
-OP_vse = V(s, e); // External substrate-emitter bias
-OP_vbs = V(b, s); // External base-substrate bias
-OP_vsc = V(s, c); // External substrate-collector bias
-`endif
-
-// end added in MXT 504.9:
-
-// The internal voltage differences
-OP_vb2e1 = Vb2e1; // Internal base-emiter bias
-OP_vb2c2 = Vb2c2; // Internal base-emiter bias
-OP_vb2c1 = Vb2c1; // Internal base-collector bias including epilayer
-
-OP_vb1c1 = Vb1b2 + Vb2c1; // External base-collector bias without contact resistances
-
-OP_vc4c1 = Vc4c1; // Bias over intrinsic buried layer
-OP_vc3c4 = Vc3c4; // Bias over extrinsic buried layer
-
-OP_ve1e = - Vee1; // Bias over emiter resistance
-
-// The branch currents
-OP_in = In; // Main current
-OP_ic1c2 = Ic1c2; // Epilayer current
-OP_ib1b2 = Ib1b2; // Pinched-base current
-OP_ib1 = Ib1; // Ideal forward base current
-OP_sib1 = Ib1_s; // Ideal side-wall base current
-//
-// 504.8, RvdT, TU-Delft April. 2009:
-//
-OP_izteb = Izteb ; // Zener tunneling current
-//
-OP_ib2 = Ib2; // Non-ideal forward base current
-OP_ib3 = Ib3; // Non-ideal reverse base current
-OP_iavl = Iavl; // Avalanche current
-OP_iex = Iex; // Extrinsic reverse base current
-OP_xiex = XIex; // Extrinsic reverse base current
-`ifdef SUBSTRATE
-OP_isub = Isub; // Substrate current
-OP_xisub = XIsub; // Substrate current
-OP_isf = Isf; // Substrate-collector current
-`endif
-OP_ire = - Vee1 / RE_TM; // Current through emiter resistance
-OP_irbc = Vbb1 / RBC_TM; // Current through constant base resistance
-
-OP_ircc = Vcc3 * GCCxx_TM; // Current through collector contact resistance
-OP_ircblx = Vc3c4 * GCCex_TM; // Current through extrinsic buried layer resistance
-OP_ircbli = Vc4c1 * GCCin_TM; // Current through extrinsic buried layer resistance
-
-// The branch charges
-OP_qe = Qe; // Emitter charge or emitter neutral charge
-OP_qte = Qte; // Base-emiter depletion charge
-OP_sqte = Qte_s; // Sidewall base-emiter depletion charge
-OP_qbe = Qbe; // Base-emiter diffusion charge
-OP_qbc = Qbc; // Base-collector diffusion charge
-OP_qtc = Qtc; // Base-colector depletion charge
-OP_qepi = Qepi; // Epilayer diffusion charge
-OP_qb1b2 = Qb1b2; // AC current crowding charge
-OP_qtex = Qtex; // Extrinsic base-collector depletion charge
-OP_xqtex = XQtex; // Extrinsic base-collector depletion charge
-OP_qex = Qex; // Extrinsic base-collector diffusion charge
-OP_xqex = XQex; // Extrinsic base-collector diffusion charge
-`ifdef SUBSTRATE
-OP_qts = Qts; // Collector substrate depletion charge
-`endif
-
-// Small signal equivalent circuit conductances and resistances
-
-OP_gx = - ddx(In, V(e1)); // Forward transconductance
-OP_gy = - ddx(In, V(c2)); // Reverse transconductance
-
-OP_gz = - ddx(In, V(c1)); // Reverse transconductance
-
-OP_sgpi = - ddx(Ib1_s, V(e))
- - ddx(Ib1_s, V(e1)); // Conductance sidewal b-e junction
-OP_gpix = - ddx(Ib1+Ib2, V(e1)); // Conductance floor b-e junction
-
-OP_gpiy = - ddx(Ib1, V(c2)); // Early effect on recombination base current
-OP_gpiz = - ddx(Ib1, V(c1)); // Early effect on recombination base current
-
-OP_gmux = ddx( Iavl, V(e1)); // Early effect on avalanche current limitting
-OP_gmuy = ddx( Iavl, V(c2)); // Conductance of avalanche current
-OP_gmuz = - ddx(- Iavl, V(c1)); // Conductance of avalanche current
-
-// Conductance extrinsic b-c current :
-OP_gmuex = ddx(Iex+Ib3, V(e))
- + ddx(Iex+Ib3, V(b1))
- + ddx(Iex+Ib3, V(b2))
- + ddx(Iex+Ib3, V(e1))
- + ddx(Iex+Ib3, V(c2));
-
-OP_xgmuex = ddx(XIex, V(b)) ; // Conductance extrinsic b-c current
-
-OP_grcvy = - ddx(Ic1c2, V(c2)); // Conductance of epilayer current
-OP_grcvz = - ddx(Ic1c2, V(c1)); // Conductance of epilayer current
-
-OP_rbv = 1.0 / (- ddx(Ib1b2, V(b2)) - ddx(Ib1b2, V(c2))); // Base resistance
-
-OP_grbvx = - ddx(Ib1b2, V(e)) - ddx(Ib1b2, V(e1)); // Early effect on base resistance
-OP_grbvy = - ddx(Ib1b2, V(c2)); // Early effect on base resistance
-
-OP_grbvz = - ddx(Ib1b2, V(c1)); // Early effect on base resistance
-
-OP_re = RE_TM; // Emiter resistance
-OP_rbc = RBC_TM; // Constant base resistance
-OP_rcc = RCCxx_TM; // Collector Contact resistance
-OP_rcblx = RCCex_TM; // Extrinsic buried layer resistance
-OP_rcbli = RCCin_TM; // Extrinsic buried layer resistance
-
-
-`ifdef SUBSTRATE
-OP_gs = ddx(Isub, V(b)) + ddx(Isub, V(b1)); // Conductance parasitic PNP transitor
-OP_xgs = ddx(XIsub, V(b)) ; // Conductance parasitic PNP transistor
-OP_gsf = ddx(Isf, V(s)) ; // Conductance substrate-collector current
-`endif
-
-
-
-// Small signal equivalent circuit capacitances
-OP_scbe = - ddx(Qte_s, V(e)) - ddx(Qte_s, V(e1)); // Capacitance sidewall b-e junction
-
-OP_cbex = - ddx(Qte + Qbe + Qe, V(e1)) ; // Capacitance floor b-e junction
-
-OP_cbey = - ddx(Qbe, V(c2)); // Early effect on b-e diffusion junction
-
-OP_cbez = - ddx(Qbe, V(c1)); // Early effect on b-e diffusion junction
-
-OP_cbcx = - ddx(Qbc, V(e)) - ddx(Qbc, V(e1)); // Early effect on b-c diffusion junction
-
-
-OP_cbcy = - ddx(Qtc + Qbc + Qepi, V(c2)); // Capacitance floor b-c junction
-OP_cbcz = - ddx(Qtc + Qbc + Qepi, V(c1)); // Capacitance floor b-c junction
-
-// Capacitance extrinsic b-c junction :
-OP_cbcex = ddx(Qtex + Qex,V(e))
- + ddx(Qtex + Qex,V(b1 ))
- + ddx(Qtex + Qex,V(b2))
- + ddx(Qtex + Qex,V(e1))
- + ddx(Qtex + Qex,V(c2)) ;
-
-// Capacitance extrinsic b-c junction :
-OP_xcbcex = ddx(XQtex + XQex, V(b)) ;
-
-OP_cb1b2 = - ddx(Qb1b2, V(b2)) - ddx(Qb1b2, V(c2)); // Capacitance AC current crowding
-
-OP_cb1b2x = - ddx(Qb1b2, V(e)) - ddx(Qb1b2, V(e1)); // Cross-capacitance AC current crowding
-OP_cb1b2y = - ddx(Qb1b2, V(c2)); // Cross-capacitance AC current crowding
-OP_cb1b2z = - ddx(Qb1b2, V(c1)) ; // Cross-capacitance AC current crowding
-
-`ifdef SUBSTRATE
-OP_cts = ddx(Qts, V(s)) ; // Capacitance s-c junction
-`endif
-
-// Approximate small signal equivalent circuit
-dydx = (OP_gx - OP_gmux) / (OP_grcvy + OP_gmuy - OP_gy);
-dydz = (OP_gz - OP_grcvz - OP_gmuz) / (OP_grcvy + OP_gmuy - OP_gy);
-gpi = OP_sgpi + OP_gpix + OP_gmux + OP_gpiz + OP_gmuz +
- (OP_gpiy + OP_gmuy) * (dydx + dydz);
-OP_gm = (OP_grcvy * (OP_gx - OP_gmux + // Transconductance
- OP_gz - OP_gmuz) - OP_grcvz *
- (OP_gy - OP_gmuy)) / (OP_grcvy + OP_gmuy - OP_gy);
-OP_beta = OP_gm / gpi; // Current amplification
-OP_gout = ((OP_gy - OP_gmuy) * OP_grcvz - // Output conductance
- (OP_gz - OP_gmuz) * OP_grcvy) /
- (OP_grcvy + OP_gmuy - OP_gy);
-OP_gmu = OP_gpiz + OP_gmuz + (OP_gpiy + OP_gmuy) * dydz + // Feedback transconductance
- OP_gmuex + OP_xgmuex;
-OP_rb = RBC_TM + OP_rbv; // Base resistance
-OP_rc = OP_rcc + OP_rcblx + OP_rcbli; // Collector resistance
-OP_cbe = OP_cbex + OP_scbe + OP_cbcx + // Base-emitter capacitance
- (OP_cbey + OP_cbcy) * dydx + CBEO_M;
-OP_cbc = (OP_cbey + OP_cbcy) * dydz + OP_cbcz + // Base-collector capacitance
- OP_cbcex + OP_xcbcex + CBCO_M;
-
-
-// Quantities to describe internal state of the model
-gammax = (OP_gpix + OP_gmux - OP_grbvx) * OP_rbv;
-gammay = (OP_gpiy + OP_gmuy - OP_grbvy) * OP_rbv;
-gammaz = (OP_gpiz + OP_gmuz - OP_grbvz) * OP_rbv;
-gbfx = OP_gpix + OP_sgpi * (1.0 + gammax);
-gbfy = OP_gpiy + OP_sgpi * gammay;
-gbfz = OP_gpiz + OP_sgpi * gammaz;
-
-// RvdT March 2008:
-alpha_ft = (1.0 + (OP_grcvy * dydx * OP_rc) +
- (OP_gx + gbfx + (OP_gy + gbfy) * dydx) * RE_TM)/
- (1.0 - (OP_grcvz + OP_grcvy * dydz) * OP_rc -
- (OP_gz + gbfz + (OP_gy + gbfy) * dydz) * RE_TM);
-
-rx = pow((OP_grcvy * dydx + alpha_ft * (OP_grcvz + OP_grcvy * dydz)), -1);
-rz = alpha_ft * rx;
-ry = (1.0 - OP_grcvz * rz) / OP_grcvy;
-rb1b2 = gammax * rx + gammay * ry + gammaz * rz;
-rex = rz + rb1b2 - OP_rcbli;
-xrex = rex + RBC_TM * ((gbfx + OP_gmux) * rx + (gbfy + OP_gmuy) * ry +
- (gbfz + OP_gmuz) * rz) - OP_rcbli - OP_rcblx;
-
-taut = OP_scbe * (rx + rb1b2) + (OP_cbex + OP_cbcx) * rx + (OP_cbey + OP_cbcy) *
- ry + (OP_cbez + OP_cbcz) * rz + OP_cbcex * rex + OP_xcbcex * xrex +
- (CBEO_M + CBCO_M) * (xrex - RCCxx_TM);
-
-OP_ft = 1.0 / (2.0 * `PI * taut); // Good approximation for cut-off frequency
-OP_iqs = Iqs; // Current at onset of quasi-saturation
-OP_xiwepi = xi_w; // Thickness of injection layer
-OP_vb2c2star = Vb2c2star; // Physical value of internal base-collector bias
-
-//self-heating
-`ifdef SELFHEATING
-OP_pdiss = power; // Dissipation
-`endif
-
-OP_tk = Tk; // Actual temperature
-
-`endif
-end
diff --git a/src/spicelib/devices/adms/mextram/adms3va/opvars.inc b/src/spicelib/devices/adms/mextram/adms3va/opvars.inc
deleted file mode 100644
index f2f927a36..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/opvars.inc
+++ /dev/null
@@ -1,152 +0,0 @@
-//
-// Operation point (output) variables
-//
-
-// The external currents and current gain
-`OPP(OP_ic, A, External DC collector current)
-`OPP(OP_ib, A, External DC base current)
-`OPP(OP_betadc, , External DC current gain Ic/Ib)
-
-// begin added in MXT 504.9:
-`OPP(OP_ie, A, External DC emitter current)
-
-// The external biases
-`OPP(OP_vbe, V, External base-emitter bias)
-`OPP(OP_vce, V, External collector-emitter bias)
-`OPP(OP_vbc, V, External base-collector bias)
-
-`ifdef SUBSTRATE
-`OPP(OP_is, A, External DC substrate current)
-`OPP(OP_vse, V, External substrate-emitter bias)
-`OPP(OP_vbs, V, External base-substrate bias)
-`OPP(OP_vsc, V, External substrate-collector bias)
-`endif
-
-// end added in MXT 504.9
-// The internal biases
-`OPP(OP_vb2e1, V, Internal base-emitter bias)
-`OPP(OP_vb2c2, V, Internal base-collector bias)
-`OPP(OP_vb2c1, V, Internal base-collector bias including epilayer)
-`OPP(OP_vb1c1, V, External base-collector bias without contact resistances)
-`OPP(OP_vc4c1, V, Bias over intrinsic buried layer)
-`OPP(OP_vc3c4, V, Bias over extrinsic buried layer)
-`OPP(OP_ve1e, V, Bias over emitter resistance)
-
-// The actual currents
-`OPP(OP_in, A, Main current)
-`OPP(OP_ic1c2, A, Epilayer current)
-`OPP(OP_ib1b2, A, Pinched-base current)
-`OPP(OP_ib1, A, Ideal forward base current)
-`OPP(OP_sib1, A, Ideal side-wall base current)
-//
-// 504.8, RvdT, TU-Delft April. 2009, Zener tunneling current:
-//
-`OPP(OP_izteb, A, Zener tunneling current in the emitter base junction)
-//
-`OPP(OP_ib2, A, Non-ideal forward base current)
-`OPP(OP_ib3, A, Non-ideal reverse base current)
-`OPP(OP_iavl, A, Avalanche current)
-`OPP(OP_iex, A, Extrinsic reverse base current)
-
-`OPP(OP_xiex, A, Extrinsic reverse base current)
-`ifdef SUBSTRATE
-`OPP(OP_isub, A, Substrate current)
-`OPP(OP_xisub, A, Substrate current)
-`OPP(OP_isf, A, Substrate failure current)
-`endif
-`OPP(OP_ire, A, Current through emitter resistance)
-`OPP(OP_irbc, A, Current through constant base resistance)
-`OPP(OP_ircblx, A, Current through extrinsic buried layer resistance)
-`OPP(OP_ircbli, A, Current through intrinsic buried layer resistance)
-`OPP(OP_ircc, A, Current through collector contact resistance)
-
-//The actual charges
-`OPP(OP_qe, C, Emitter charge or emitter neutral charge)
-`OPP(OP_qte, C, Base-emitter depletion charge)
-`OPP(OP_sqte, C, Sidewall base-emitter depletion charge)
-`OPP(OP_qbe, C, Base-emitter diffusion charge)
-`OPP(OP_qbc, C, Base_collector diffusion charge)
-`OPP(OP_qtc, C, Base-collector depletion charge)
-`OPP(OP_qepi, C, Epilayer diffusion charge)
-`OPP(OP_qb1b2, C, AC current crowding charge)
-`OPP(OP_qtex, C, Extrinsic base-collector depletion charge)
-`OPP(OP_xqtex, C, Extrinsic base-collector depletion charge)
-`OPP(OP_qex, C, Extrinsic base-collector diffusion charge)
-`OPP(OP_xqex, C, Extrinsic base-collector diffusion charge)
-`ifdef SUBSTRATE
-`OPP(OP_qts, C, Collector-substrate depletion charge)
-`endif
-
-//Small signal equivalent circuit conductances and resistances
-`OPP(OP_gx, S, Forward transconductance)
-`OPP(OP_gy, S, Reverse transconductance)
-`OPP(OP_gz, S, Reverse transconductance)
-`OPP(OP_sgpi, S, Conductance sidewall b-e junction)
-`OPP(OP_gpix, S, Conductance floor b-e junction)
-`OPP(OP_gpiy, S, Early effect on recombination base current)
-`OPP(OP_gpiz, S, Early effect on recombination base current)
-`OPP(OP_gmux, S, Early effect on avalanche current limiting)
-`OPP(OP_gmuy, S, Conductance of avalanche current)
-`OPP(OP_gmuz, S, Conductance of avalanche current)
-`OPP(OP_gmuex, S, Conductance of extrinsic b-c junction)
-`OPP(OP_xgmuex, S, Conductance of extrinsic b-c junction)
-`OPP(OP_grcvy, S, Conductance of epilayer current)
-`OPP(OP_grcvz, S, Conductance of epilayer current)
-`OPP(OP_rbv, Ohm, Base resistance)
-`OPP(OP_grbvx, S, Early effect on base resistance)
-`OPP(OP_grbvy, S, Early effect on base resistance)
-`OPP(OP_grbvz, S, Early effect on base resistance)
-`OPP(OP_re, Ohm, Emitter resistance)
-`OPP(OP_rbc, Ohm, Constant base resistance)
-`OPP(OP_rcc, Ohm, Collector contact resistance)
-`OPP(OP_rcblx, Ohm, Extrinsic buried layer resistance)
-`OPP(OP_rcbli, Ohm, Intrinsic buried layer resistance)
-`ifdef SUBSTRATE
-`OPP(OP_gs, S, Conductance parasistic PNP transistor)
-`OPP(OP_xgs, S, Conductance parasistic PNP transistor)
-`OPP(OP_gsf, S, Conductance substrate failure current)
-`endif
-//Small signal equivalent circuit capacitances
-`OPP(OP_scbe, F, Capacitance sidewall b-e junction)
-`OPP(OP_cbex, F, Capacitance floor b-e junction)
-`OPP(OP_cbey, F, Early effect on b-e diffusion charge)
-`OPP(OP_cbez, F, Early effect on b-e diffusion charge)
-`OPP(OP_cbcx, F, Early effect on b-c diffusion charge)
-`OPP(OP_cbcy, F, Capacitance floor b-c junction)
-`OPP(OP_cbcz, F, Capacitance floor b-c junction)
-`OPP(OP_cbcex, F, Capacitance extrinsic b-c junction)
-`OPP(OP_xcbcex, F, Capacitance extrinsic b-c junction)
-`OPP(OP_cb1b2, F, Capacitance AC current crowding)
-`OPP(OP_cb1b2x, F, Cross-capacitance AC current crowding)
-`OPP(OP_cb1b2y, F, Cross-capacitance AC current crowding)
-`OPP(OP_cb1b2z, F, Cross-capacitance AC current crowding)
-`ifdef SUBSTRATE
-`OPP(OP_cts, F, Capacitance s-c junction)
-`endif
-//Approximate small signal equivalent circuit
-`OPP(OP_gm, S,transconductance)
-`OPP(OP_beta, , Current amplification)
-`OPP(OP_gout, S, Output conductance)
-`OPP(OP_gmu, S, Feedback transconductance)
-`OPP(OP_rb, Ohm, Base resistance)
-`OPP(OP_rc, Ohm, Collector resistance)
-`OPP(OP_cbe, C, Base-emitter capacitance)
-`OPP(OP_cbc, C, Base-collector capacitance)
-
-//quantities to describe internal state of the model
-`OPP(OP_ft, , Good approximation for cut-off frequency)
-`OPP(OP_iqs, A, Current at onset of quasi-saturation)
-`OPP(OP_xiwepi, m, Thickness of injection layer)
-`OPP(OP_vb2c2star, V, Physical value of internal base-collector bias)
-
-//self-heating
-`ifdef SELFHEATING
-`OPP(OP_pdiss, W, Dissipation)
-`endif
-`OPP(OP_tk, K, Actual temperature)
-
-//help variables
-real dydx, dydz, gpi;
-real gammax, gammay, gammaz, gbfx, gbfy, gbfz, alpha_ft;
-real rx, ry, rz, rb1b2, rex, xrex, taut;
-
diff --git a/src/spicelib/devices/adms/mextram/adms3va/parameters.inc b/src/spicelib/devices/adms/mextram/adms3va/parameters.inc
deleted file mode 100644
index 2d83a9029..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/parameters.inc
+++ /dev/null
@@ -1,209 +0,0 @@
-// Mextram parameters
-
-parameter integer LEVEL = 504 from [504:505)
- `ATTR(info="Model level");
-parameter real TREF = 25.0 from [-273.0:inf)
- `ATTR(info="Reference temperature");
-parameter real DTA = 0.0
- `ATTR(info="Difference between the local and global ambient temperatures");
-parameter integer EXMOD = 1 from [0:1]
- `ATTR(info="Flag for extended modeling of the reverse current gain");
-parameter integer EXPHI = 1 from [0:1]
- `ATTR(info="Flag for the distributed high-frequency effects in transient");
-parameter integer EXAVL = 0 from [0:1]
- `ATTR(info="Flag for extended modeling of avalanche currents");
-
-parameter real IS = 22.0a from (0.0:inf)
- `ATTR(info="Collector-emitter saturation current");
-parameter real IK = 0.1 from [1.0p:inf)
- `ATTR(info="Collector-emitter high injection knee current");
-parameter real VER = 2.5 from [0.01:inf)
- `ATTR(info="Reverse Early voltage");
-parameter real VEF = 44.0 from [0.01:inf)
- `ATTR(info="Forward Early voltage");
-parameter real BF = 215.0 from [0.1m:inf)
- `ATTR(info="Ideal forward current gain");
-parameter real IBF = 2.7f from [0.0:inf)
- `ATTR(info="Saturation current of the non-ideal forward base current");
-parameter real MLF = 2.0 from [0.1:inf)
- `ATTR(info="Non-ideality factor of the non-ideal forward base current");
-parameter real XIBI = 0.0 from [0.0:1.0]
- `ATTR(info="Part of ideal base current that belongs to the sidewall");
-// begin: RvdT, November 2008, BE tunneling current parameters:
-parameter real IZEB = 0.0 from [0.0:inf)
- `ATTR(info="Pre-factor of emitter-base Zener tunneling current");
-parameter real NZEB = 22.0 from [0.0:inf)
- `ATTR(info="Coefficient of emitter-base Zener tunneling current");
-// end: RvdT, November 2008, EB tunneling current parameters:
-parameter real BRI = 7.0 from [1.0e-4:inf)
- `ATTR(info="Ideal reverse current gain");
-parameter real IBR = 1.0f from [0.0:inf)
- `ATTR(info="Saturation current of the non-ideal reverse base current");
-parameter real VLR = 0.2
- `ATTR(info="Cross-over voltage of the non-ideal reverse base current");
-parameter real XEXT = 0.63 from [0.0:1.0]
- `ATTR(info="Part of currents and charges that belong to extrinsic region");
-
-parameter real WAVL = 1.1u from [1.0n:inf)
- `ATTR(info="Epilayer thickness used in weak-avalanche model");
-parameter real VAVL = 3.0 from [0.01:inf)
- `ATTR(info="Voltage determining curvature of avalanche current");
-parameter real SFH = 0.3 from [0.0:inf)
- `ATTR(info="Current spreading factor of avalanche model when EXAVL=1");
-// RvdT, 22-02-2008: for MXT 504.7
-// increased lower clipping values RE, RBC, RBV, RCC, RCV, SCRCV
-// from 1u to 1m:
-parameter real RE = 5.0 from [1.0m:inf)
- `ATTR(info="Emitter resistance");
-parameter real RBC = 23.0 from [1.0m:inf)
- `ATTR(info="Constant part of the base resistance");
-parameter real RBV = 18.0 from [1.0m:inf)
- `ATTR(info="Zero-bias value of the variable part of the base resistance");
-parameter real RCC = 12.0 from [1.0m:inf)
- `ATTR(info="Constant part of the collector resistance");
-parameter real RCV = 150.0 from [1.0m:inf)
- `ATTR(info="Resistance of the un-modulated epilayer");
-parameter real SCRCV = 1250.0 from [1.0m:inf)
- `ATTR(info="Space charge resistance of the epilayer");
-parameter real IHC = 4.0m from [1.0p:inf)
- `ATTR(info="Critical current for velocity saturation in the epilayer");
-parameter real AXI = 0.3 from [0.02:inf)
- `ATTR(info="Smoothness parameter for the onset of quasi-saturation");
-
-parameter real CJE = 73.0f from [0.0:inf)
- `ATTR(info="Zero-bias emitter-base depletion capacitance");
-parameter real VDE = 0.95 from [0.05:inf)
- `ATTR(info="Emitter-base diffusion voltage");
-parameter real PE = 0.4 from [0.01:0.99)
- `ATTR(info="Emitter-base grading coefficient");
-parameter real XCJE = 0.4 from [0.0:1.0]
- `ATTR(info="Sidewall fraction of the emitter-base depletion capacitance");
-parameter real CBEO = 0.0 from [0.0:inf)
- `ATTR(info="Emitter-base overlap capacitance");
-
-parameter real CJC = 78.0f from [0.0:inf)
- `ATTR(info="Zero-bias collector-base depletion capacitance");
-parameter real VDC = 0.68 from [0.05:inf)
- `ATTR(info="Collector-base diffusion voltage");
-parameter real PC = 0.5 from [0.01:0.99)
- `ATTR(info="Collector-base grading coefficient");
-parameter real XP = 0.35 from [0.0:0.99)
- `ATTR(info="Constant part of Cjc");
-parameter real MC = 0.5 from [0.0:1.0)
- `ATTR(info="Coefficient for current modulation of CB depletion capacitance");
-parameter real XCJC = 32.0m from [0.0:1.0]
- `ATTR(info="Fraction of CB depletion capacitance under the emitter");
-// RvdT, 30-11-2007: introduced RCBLX and RCBLI:
-parameter real RCBLX = 0.0 from [0.0:inf)
- `ATTR(info="Resistance Collector Buried Layer eXtrinsic");
-parameter real RCBLI = 0.0 from [0.0:inf)
- `ATTR(info="Resistance Collector Buried Layer Intrinsic");
-parameter real CBCO = 0.0 from [0.0:inf)
- `ATTR(info="Collector-base overlap capacitance");
-
-parameter real MTAU = 1.0 from [0.1:inf)
- `ATTR(info="Non-ideality factor of the emitter stored charge");
-parameter real TAUE = 2.0p from [0.0:inf)
- `ATTR(info="Minimum transit time of stored emitter charge");
-parameter real TAUB = 4.2p from (0.0:inf)
- `ATTR(info="Transit time of stored base sharge");
-parameter real TEPI = 41.0p from [0.0:inf)
- `ATTR(info="Transit time of stored epilayer charge");
-parameter real TAUR = 520.0p from [0.0:inf)
- `ATTR(info="Transit time of reverse extrinsic stored base charge");
-
-parameter real DEG = 0.0
- `ATTR(info="Bandgap difference over the base");
-parameter real XREC = 0.0 from [0.0:inf)
- `ATTR(info="Pre-factor of the recombination part of Ib1");
-
-parameter real AQBO = 0.3
- `ATTR(info="Temperature coefficient of the zero-bias base charge");
-parameter real AE = 0.0
- `ATTR(info="Temperature coefficient of the resistivity of the emitter");
-parameter real AB = 1.0
- `ATTR(info="Temperature coefficient of the resistivity of the base");
-parameter real AEPI = 2.5
- `ATTR(info="Temperature coefficient of the resistivity of the epilayer");
-parameter real AEX = 0.62
- `ATTR(info="Temperature coefficient of the resistivity of the extrinsic base");
-parameter real AC = 2.0
- `ATTR(info="Temperature coefficient of the resistivity of the collector contact");
-// RvdT, 30-01-2007: introduced ACBL
-parameter real ACBL = 2.0 from [0.0:inf)
- `ATTR(info="Temperature coefficient of the resistivity of the collector buried layer");
-parameter real DVGBF = 50.0m
- `ATTR(info="Band-gap voltage difference of the forward current gain");
-parameter real DVGBR = 45.0m
- `ATTR(info="Band-gap voltage difference of the reverse current gain");
-parameter real VGB = 1.17 from [0.1:inf)
- `ATTR(info="Band-gap voltage of the base");
-parameter real VGC = 1.18 from [0.1:inf)
- `ATTR(info="Band-gap voltage of the collector");
-parameter real VGJ = 1.15 from [0.1:inf)
- `ATTR(info="Band-gap voltage recombination emitter-base junction");
-parameter real VGZEB = 1.15 from [0.1:inf)
- `ATTR(info="Band-gap voltage at Tref of Zener effect emitter-base junction");
-parameter real AVGEB = 4.73e-4 from (-inf:inf)
- `ATTR(info="Temperature coefficient band-gap voltage for Zener effect emitter-base junction");
-parameter real TVGEB = 636.0 from [0.0:inf)
- `ATTR(info="Temperature coefficient band-gap voltage for Zener effect emitter-base junction");
-parameter real DVGTE = 0.05
- `ATTR(info="Band-gap voltage difference of emitter stored charge");
-parameter real DAIS = 0.0
- `ATTR(info="Fine tuning of temperature dependence of C-E saturation current");
-
-parameter real AF = 2.0 from [0.01:inf)
- `ATTR(info="Exponent of the Flicker-noise");
-parameter real KF = 20.0p from [0.0:inf)
- `ATTR(info="Flicker-noise coefficient of the ideal base current");
-parameter real KFN = 20.0p from [0.0:inf)
- `ATTR(info="Flicker-noise coefficient of the non-ideal base current");
-parameter integer KAVL = 0 from [0:1]
- `ATTR(info="Switch for white noise contribution due to avalanche");
-
-`ifdef SUBSTRATE
-parameter real ISS = 48.0a from [0.0:inf)
- `ATTR(info="Base-substrate saturation current");
-parameter real ICSS = -1.0 from (-inf:inf)
- `ATTR(info="Collector-substrate ideal saturation current");
-parameter real IKS = 250.0u from [1.0p:inf)
- `ATTR(info="Base-substrate high injection knee current");
-parameter real CJS = 315.0f from [0:inf)
- `ATTR(info="Zero-bias collector-substrate depletion capacitance");
-parameter real VDS = 0.62 from (0.05:inf)
- `ATTR(info="Collector-substrate diffusion voltage");
-parameter real PS = 0.34 from (0.01:0.99)
- `ATTR(info="Collector-substrate grading coefficient");
-parameter real VGS = 1.20 from [0.1:inf)
- `ATTR(info="band-gap voltage of the substrate");
-parameter real AS = 1.58
- `ATTR(info="Substrate temperature coefficient");
-parameter real ASUB = 2.0
- `ATTR(info="Temperature coefficient for mobility of minorities in the substrate");
-`endif
-
-`ifdef SELFHEATING
-parameter real RTH = 300.0 from (0.0:inf)
- `ATTR(info="Thermal resistance");
-parameter real CTH = 3.0n from [0.0:inf)
- `ATTR(info="Thermal capacitance");
-parameter real ATH = 0.0
- `ATTR(info="Temperature coefficient of the thermal resistance");
-`endif
-
-parameter real MULT = 1.0 from (0.0:inf)
- `ATTR(info="Multiplication factor");
-
-// Non-standard (additional) model parameters
-// (introduced for the users' convenience)
-
-`ifdef insideADMS
-parameter integer TYPE = 1 from [-1:1]
- `ATTR(info="Flag for NPN (1) or PNP (-1) transistor type");
-`else
-parameter integer TYPE = 1 from [-1:1] exclude 0;
-`endif
-parameter real GMIN = 1.0e-13 from (0:1e-10]
- `ATTR(info="Minimum conductance");
-
diff --git a/src/spicelib/devices/adms/mextram/adms3va/tscaling.inc b/src/spicelib/devices/adms/mextram/adms3va/tscaling.inc
deleted file mode 100644
index 345cfc32a..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/tscaling.inc
+++ /dev/null
@@ -1,242 +0,0 @@
-// Temperature scaling of parameters
-
- // The excess transistor temperature due to the self-heating
-`ifdef SELFHEATING
- Tki = V(dt);
- // *** Convergence related smoothing ***
- if (Tki < 0.0) begin
- Tki = - ln(1.0 - Tki);
- end
- `linLog(Vdt, Tki, 200.0);
-// `min_logexp(Vdt, Tki, 200.0, 10.0);
-`else
- Vdt = 0.0;
-`endif
-
- // Temperature variables
-
-
-`ifdef insideADMS
- Tk = Trk + DTA + Vdt;
- Tamb = Trk + DTA;
-`else
- Tk = $temperature + DTA + Vdt;
- Tamb = $temperature + DTA;
-`endif
-
- tN = Tk / Trk;
- Vt = `KBdivQQ * Tk;
- Vtr = `KBdivQQ * Trk;
- VtINV = 1.0 / Vt;
- VtrINV = 1.0 / Vtr;
- VdtINV = VtINV - VtrINV;
-
- lntN = ln(tN) ;
-
- // begin: RvdT, November 2008, "Zener tunneling model"
-// VGZEB_T = VGZEBOK - AVGEB*Tk*Tk / (Tk + TVGEB) ;
- `max_logexp(VGZEB_T, VGZEBOK - AVGEB*Tk*Tk / (Tk + TVGEB), 0.05, 0.1) ;
-
- // end: RvdT, November 2008, "Zener tunneling model"
-
- // Depletion capacitances
-
- UdeT = -3.0 * Vt * ln(tN) + VDE * tN + (1.0 - tN) * VGB;
- `max_logexp(VDE_T, `VDLOW, UdeT, Vt);
-
- UdcT = -3.0 * Vt * ln(tN) + VDC * tN + (1.0 - tN) * VGC;
- `max_logexp(VDC_T, `VDLOW, UdcT, Vt);
-
-`ifdef SUBSTRATE
- UdsT = -3.0 * Vt * ln(tN) + VDS * tN + (1.0 - tN) * VGS;
- `max_logexp(VDS_T, `VDLOW, UdsT, Vt);
-`endif
- inv_VDE_T = 1.0 / VDE_T ;
- CJE_T_div_CJE = pow(VDE * inv_VDE_T, PE);
- CJE_T = CJE * CJE_T_div_CJE ;
-
-`ifdef SUBSTRATE
- CJS_T = CJS * pow(VDS / VDS_T, PS);
-`endif
-
- CJCscale = ((1.0 - XP) * pow(VDC / VDC_T, PC) + XP);
- CJCscaleINV = 1.0 / CJCscale;
-
- CJC_T = CJC * CJCscale;
- XP_T = XP * CJCscaleINV;
-
- // Resistances
-
-// RvdT, November 2008:
-// Instead of the following definition
-// RE_T = RE * pow(tN, AE);
-// we use, here, and in all following powers of tN,
-// the following computationally cheaper implementation:
- RE_T = RE * exp(lntN * AE);
-// This is based on the observation that exp() is faster than pow().
-// Acknowledgement due to Geoffrey Coram.
-
- RBV_T = RBV * exp(lntN * (AB - AQBO));
- RBC_T = RBC * exp(lntN * AEX);
-
-// RvdT, 30-11-2007: new collector resistances RCCxx_T, RCCex_T, RCCin_T
- RCCxx_T = RCC * exp(lntN * AC);
- RCCex_T = RCBLX * exp(lntN * ACBL);
- RCCin_T = RCBLI * exp(lntN * ACBL);
-
- RCV_T = RCV * exp(lntN * AEPI);
-
- // Current gains
-
- BF_T = BF * exp(lntN * (AE - AB - AQBO)) * exp(-DVGBF * VdtINV);
- BRI_T = BRI * exp(-DVGBR * VdtINV);
-
- // Currents and voltages
-
- IS_T = IS * exp(lntN * (4.0 - AB - AQBO + DAIS)) * exp(-VGB * VdtINV);
- IK_T = IK * exp(lntN * (1.0 - AB));
- IBF_T = IBF * exp(lntN * (6.0 - 2.0 * MLF)) * exp(-VGJ * VdtINV / MLF);
- IBR_T = IBR * tN * tN * exp(-VGC * VdtINV / 2.0);
-
-// begin RvdT, November 2008, MXT504.8_alpha
-// T-scaling BE tunneling:
-//
- x = pow(VGZEB_T * inv_VGZEB_Tr, -0.5) ;
-// y = pow(VDE_T * inv_VDE, PE) ;
-// more efficient, because we need both y and 1.0 / y:
- y = 1.0 / CJE_T_div_CJE ;
-// definition:
-// nZEB_T = NZEB* pow(VGZEB_T/VGZEB_Tr, 1.5) * pow(VDE_T / VDE, PE-1) ;
-// more efficient implementation:
-// nZEB_T = NZEB* VGZEB_T * VGZEB_T * x * y * VDE /(VDE_T*VGZEB_Tr*VGZEB_Tr) ;
- nZEB_T = NZEB* VGZEB_T * VGZEB_T * x * y * VDE * inv_VDE_T*inv_VGZEB_Tr*inv_VGZEB_Tr ;
-
-// definition:
-// IZEB_T = IZEB* pow(VGZEB_T/VGZEB_Tr, -0.5) * pow(VDE_T / VDE, 2-PE) * exp(NZEB-nZEB_T);
-// more efficient implementation:
- IZEB_T = IZEB* x * VDE_T * VDE_T * inv_VDE * inv_VDE * CJE_T_div_CJE * exp(NZEB-nZEB_T) ;
-//
-// end RvdT, November 2008, MXT504.8_alpha
-
- x = exp(lntN * AQBO) ;
- VEF_T = VEF * x * CJCscaleINV;
-// VER_T = VER * x * pow(VDE / VDE_T, -PE);
- VER_T = VER * x * y;
-
-`ifdef SUBSTRATE
- ISS_T = ISS * exp(lntN * (4.0 - AS)) * exp(-VGS * VdtINV);
-// New 504.9:
- ICSS_T = ICSS * exp(lntN * (3.5 - 0.5 * ASUB)) * exp(-VGS * VdtINV);
-// End New 504.9.
-
- if ((ISS_T > 0.0))
- IKS_T = IKS * exp(lntN * (1.0 - AS)) * (IS_T / IS) * (ISS / ISS_T);
- else
- IKS_T = IKS * exp(lntN * (1.0 - AS));
-`endif
-
- // Transit times
-
- TAUE_T = TAUE * exp(lntN * (AB - 2.0)) * exp(-DVGTE * VdtINV);
- TAUB_T = TAUB * exp(lntN * (AQBO + AB - 1.0));
- TEPI_T = TEPI * exp(lntN * (AEPI - 1.0));
- TAUR_T = TAUR * (TAUB_T + TEPI_T) / (TAUB + TEPI);
-
- // Avalanche constant
-
- Tk300 = Tk - 300.0;
-// RvdT, 15-02-2008: prevent division by zero and overflow at high temperatures:
- if (Tk < 525.0)
- begin
- BnT = Bn * (1.0 + 7.2e-4 * Tk300 - 1.6e-6 * Tk300 * Tk300) ;
- end
- else
- begin
- BnT = Bn * 1.081 ;
- end
-
- // Heterojunction features
-
- DEG_T = DEG * exp(lntN * AQBO);
-
-`ifdef SELFHEATING
- // Tempearature scaling of the thermal resistance
-
- RTH_Tamb = RTH * pow(Tamb / Trk, ATH);
-`endif
-
-// MULT - scaling
-
- IS_TM = IS_T * MULT;
- IK_TM = IK_T * MULT;
- IBF_TM = IBF_T * MULT;
- IBR_TM = IBR_T * MULT;
-// RvdT: November 2008, Zener tunneling parameters
- IZEB_TM = IZEB_T * MULT ;
-
-// end Zener tunneling parameters
-
-
-
-
- IHC_M = IHC * MULT;
-`ifdef SUBSTRATE
- ISS_TM = ISS_T * MULT;
-// New: 504.9
- ICSS_TM = ICSS_T * MULT;
- IKS_TM = IKS_T * MULT;
-`endif
- CJE_TM = CJE_T * MULT;
- CJC_TM = CJC_T * MULT;
-
-// begin RvdT, 28-10-2008, MXT504.8_alpha
-// Base-emitter tunneling current Mult scaling:
-// BTJE_TM = BTJE_T * MULT;
-// end RvdT, 28-10-2008, MXT504.8_alpha
-
-
-`ifdef SUBSTRATE
- CJS_TM = CJS_T * MULT;
-`endif
-
- RE_TM = RE_T * invMULT;
- RBC_TM = RBC_T * invMULT;
- RBV_TM = RBV_T * invMULT;
-// RvdT, 30-01-2007: new collector resistances:
- RCCxx_TM = RCCxx_T * invMULT;
- RCCex_TM = RCCex_T * invMULT;
- RCCin_TM = RCCin_T * invMULT;
- RCV_TM = RCV_T * invMULT;
-
-
-// RvdT, 03-12-2007: new collector conductances
- if (RCC > 0.0)
- begin
- GCCxx_TM = 1.0 / RCCxx_TM ;
- end
- else
- begin
- GCCxx_TM = 0 ;
- end
-
- if (RCBLX > 0.0)
- begin
- GCCex_TM = 1.0 / RCCex_TM ;
- end
- else
- begin
- GCCex_TM = 0 ;
- end
-
- if (RCBLI > 0.0)
- begin
- GCCin_TM = 1.0 / RCCin_TM ;
- end
- else
- begin
- GCCin_TM = 0 ;
- end
-
-`ifdef SELFHEATING
- RTH_Tamb_M = RTH_Tamb * invMULT;
-`endif
diff --git a/src/spicelib/devices/adms/mextram/adms3va/variables.inc b/src/spicelib/devices/adms/mextram/adms3va/variables.inc
deleted file mode 100644
index 85c5d32da..000000000
--- a/src/spicelib/devices/adms/mextram/adms3va/variables.inc
+++ /dev/null
@@ -1,197 +0,0 @@
-// Declaration of variables
-
-real _x, _x0, _a, _dxa;
-
-real _circuit_gmin;
-
-// Model constants
-
-real An, Bn;
-
-// Temperature scaling variables
-
-real Tk, Trk, tN, Tamb;
-real Vt, Vtr, VtINV, VtrINV, VdtINV;
-real Vdt;
-
-real UdeT, VDE_T, UdcT, VDC_T;
-real CJE_T, CJC_T, XP_T;
-real CJCscale, CJCscaleINV;
-
-real RE_T, RBV_T, RBC_T, RCV_T;
-// RvdT: 30-01-2007, new collector resistances:
-real RCCxx_T, RCCex_T, RCCin_T;
-
-real BF_T, BRI_T;
-
-real IS_T, IK_T, IBF_T, IBR_T, VEF_T, VER_T;
-
-// RvdT: November 2008, Zener tunneling parameters and variables:
-real Izteb, IZEB_T, E0BE, dE0BE,nZEB_T, pow2_2mPE, pow2_PEm2, inv_VDE, inv_VDE_T;
-real eZEB, edZEB, DZEB, VGZEB_T, VGZEB_Tr, inv_VGZEB_Tr, CJE_T_div_CJE ;
-
-// RvdT: March 2009, Zener tunneling parameters and variables:
-real VGZEBOK;
-
-// end Zener tunneling parameters
-
-real TAUE_T, TAUB_T, TEPI_T, TAUR_T;
-real BnT, DEG_T, Tk300;
-
-`ifdef SELFHEATING
-real RTH_Tamb;
-`endif
-
-`ifdef SUBSTRATE
-real UdsT, VDS_T, CJS_T, ISS_T, ICSS_T, IKS_T;
-`endif
-
-// MULT - scaling variables
-
-real invMULT;
-real IS_TM, IK_TM, IBF_TM, IBR_TM, IHC_M;
-// RvdT: November 2008, Zener tunneling parameters
-real IZEB_TM ;
-
-// end Zener tunneling parameters
-
-
-
-
-real CJE_TM, CJC_TM;
-
-real RE_TM, RBC_TM, RBV_TM, RCV_TM, SCRCV_M;
-// RvdT: 30-01-2007, new collector resistances:
-real RCCxx_TM, RCCex_TM, RCCin_TM;
-// RvdT: 03-12-2007, new collector conductances:
-real GCCxx_TM, GCCex_TM, GCCin_TM;
-
-
-real KF_M, KFN_M;
-
-`ifdef SELFHEATING
-real RTH_Tamb_M, CTH_M;
-`endif
-
-`ifdef SUBSTRATE
-real ISS_TM, ICSS_TM, IKS_TM, CJS_TM;
-`endif
-
-
-// Epilayer model variables
-
-real K0, Kw, pW, Ec, Ic1c2;
-real Vqs_th, Vqs, Iqs;
-real alpha, vyi, yi, xi_w, xi_w1;
-real gp0, gp02, p0star, Vb2c2star, eVb2c2star;
-real B1, B2, Vxi0, Vch, Icap, pav;
-
-// Effective emitter and collector junction bias variables
-
-real Vfe, Vje, Vte;
-real Vjunc, bjc, Vfc, Vjc, fI, Vcv, Vtc;
-
-// Transfer current variables
-
-real If0, f1, f2, n0, nB;
-real q0I, q1I, qBI, Ir, If, In;
-
-// Base and substrate current(s) variables
-
-real Xext1;
-real Ib1, Ib1_s, Ib2, Ib3;
-real Ibf0, Iex;
-real g1, g2, pWex, nBex;
-real Xg1, XnBex, XIMex, XIMsub, Vex, VBex, Fex, XIex;
-
-`ifdef SUBSTRATE
-real Isub, XIsub, Isf;
-`endif
-
-// Distributed base effects variables
-
-real q0Q, q1Q, qBQ, Rb2, Ib1b2;
-real dVteVb2e1, dVteVje, dVjeVb2e1;
-real dQteVb2e1, dQbeVb2e1, dQeVb2e1;
-real dn0Vb2e1;
-
-// Weak-avalanche current variables
-
-real dEdx0, xd, Weff, Wd, Eav, E0, Em, SHw, Efi, Ew;
-real lambda, Gem, Gmax, Iavl;
-real Icap_IHC;
-
-`ifdef SELFHEATING
-real Tki, power;
-`endif
-
-// Charges and capacitances variables
-
-real Qte, Vje_s, Qte_s;
-real Qtc;
-real Qb0, Qbe, Qbc, Qb1b2;
-real Qbe_qs, Qbc_qs;
-real Vjcex, Vtexv, Qtex, XVjcex, XVtexv, XQtex;
-
-`ifdef SUBSTRATE
-real Vfs, Vjs, Qts;
-`endif
-
-real Qe0, Qe;
-real Qepi0, Qepi, Xg2, XpWex, XQex;
-real Qex;
-real CBEO_M, CBCO_M;
-
-// Biases and exponential terms variables
-
-real Vb2c1, Vb2c2, Vb2e1, Vb1e1, Vb1b2, Vb1c4, Vc1c2;
-// RvdT, 30-01-2007: new variables Vc3c4, Vc4c1
-real Vc3c4, Vc4c1;
-// RvdT, 25-02-2008: new variables Vsc3, Vsc4
-`ifdef SUBSTRATE
-real Vsc1, Vsc3, Vsc4, eVsc1;
-`endif
-real Vee1, Vbb1, Vbc3, Vcc3, Vbe, Vbc;
-real eVb2c2, eVb2e1, eVb1e1, eVb1b2, eVb1c4, eVbc3;
-real eVb1c4VDC, eVb2c2VDC, eVbc3VDC, eVb2c1VDC;
-
-// Help variables
-
-// RvdT, November 2008, lntN introduced to speed up T-scaling:
-// Acknowledgements due to Geoffrey Coram
-real lntN ;
-
-// RvdT, November 2008 variables for local use; may be re-used globally:
-real x, y ;
-
-real dxa, sqr_arg;
-real eps2, x2;
-real alpha1, vdif, Ic1c2_Iqs, gp0_help;
-real EmEav_Em, Vb2e1Vfe, termE, termC;
-real Vex_bias;
-real eps_VDC, a_VDE, a_VDC;
-
-real expl, tmpExp, tmpV;
-
-
-`ifdef SUBSTRATE
-real a_VDS;
-`endif
-
-// Noise variables
-
-real common;
-real powerREC, powerRBC, powerRCCxx, powerRCCex, powerRCCin, powerRBV;
-real powerCCS;
-real powerFBCS, powerFBC1fB1, exponentFBC1fB2, powerFBC1fB2;
-real powerEBSCS, powerEBSC1f;
-real powerRBCS, powerRBC1f;
-real powerExCS, powerExCSMOD, powerExC1f, powerExC1fMOD;
-
-`ifdef SUBSTRATE
-real powerSubsCS_B1S, powerSubsCS_BS;
-`endif
-
-//real twoqIavl, powerCCS_A, powerFBCS_A, powerAVL_B2C2;
-real twoqIavl, cor_exp_1, cor_exp_2, powerCCS_A;
-
diff --git a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_InitModel.include b/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_InitModel.include
deleted file mode 100644
index f4dafbd85..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_InitModel.include
+++ /dev/null
@@ -1,184 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: JUNCAP200_InitModel.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1 (PSP), 200.2 (JUNCAP), April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
- //////////////////////////////////////////////////////////////
- //
- // Calculation of internal paramters which are independent
- // on instance parameters
- //
- //////////////////////////////////////////////////////////////
-
- TRJ_i = `CLIP_LOW( TRJ , `TRJ_cliplow);
- IMAX_i = `CLIP_LOW( IMAX , `IMAX_cliplow);
- CJORBOT_i = `CLIP_LOW( CJORBOT , `CJORBOT_cliplow);
- CJORSTI_i = `CLIP_LOW( CJORSTI , `CJORSTI_cliplow);
- CJORGAT_i = `CLIP_LOW( CJORGAT , `CJORGAT_cliplow);
- VBIRBOT_i = `CLIP_LOW( VBIRBOT , `VBIR_cliplow);
- VBIRSTI_i = `CLIP_LOW( VBIRSTI , `VBIR_cliplow);
- VBIRGAT_i = `CLIP_LOW( VBIRGAT , `VBIR_cliplow);
- PBOT_i = `CLIP_BOTH(PBOT , `P_cliplow,`P_cliphigh);
- PSTI_i = `CLIP_BOTH(PSTI , `P_cliplow,`P_cliphigh);
- PGAT_i = `CLIP_BOTH(PGAT , `P_cliplow,`P_cliphigh);
- IDSATRBOT_i = `CLIP_LOW( IDSATRBOT , `IDSATR_cliplow);
- IDSATRSTI_i = `CLIP_LOW( IDSATRSTI , `IDSATR_cliplow);
- IDSATRGAT_i = `CLIP_LOW( IDSATRGAT , `IDSATR_cliplow);
- CSRHBOT_i = `CLIP_LOW( CSRHBOT , `CSRH_cliplow);
- CSRHSTI_i = `CLIP_LOW( CSRHSTI , `CSRH_cliplow);
- CSRHGAT_i = `CLIP_LOW( CSRHGAT , `CSRH_cliplow);
- XJUNSTI_i = `CLIP_LOW( XJUNSTI , `XJUN_cliplow);
- XJUNGAT_i = `CLIP_LOW( XJUNGAT , `XJUN_cliplow);
- CTATBOT_i = `CLIP_LOW( CTATBOT , `CTAT_cliplow);
- CTATSTI_i = `CLIP_LOW( CTATSTI , `CTAT_cliplow);
- CTATGAT_i = `CLIP_LOW( CTATGAT , `CTAT_cliplow);
- MEFFTATBOT_i = `CLIP_LOW( MEFFTATBOT, `MEFFTAT_cliplow);
- MEFFTATSTI_i = `CLIP_LOW( MEFFTATSTI, `MEFFTAT_cliplow);
- MEFFTATGAT_i = `CLIP_LOW( MEFFTATGAT, `MEFFTAT_cliplow);
- CBBTBOT_i = `CLIP_LOW( CBBTBOT , `CBBT_cliplow);
- CBBTSTI_i = `CLIP_LOW( CBBTSTI , `CBBT_cliplow);
- CBBTGAT_i = `CLIP_LOW( CBBTGAT , `CBBT_cliplow);
- VBRBOT_i = `CLIP_LOW( VBRBOT , `VBR_cliplow);
- VBRSTI_i = `CLIP_LOW( VBRSTI , `VBR_cliplow);
- VBRGAT_i = `CLIP_LOW( VBRGAT , `VBR_cliplow);
- PBRBOT_i = `CLIP_LOW( PBRBOT , `PBR_cliplow);
- PBRSTI_i = `CLIP_LOW( PBRSTI , `PBR_cliplow);
- PBRGAT_i = `CLIP_LOW( PBRGAT , `PBR_cliplow);
-
- tkr = `KELVINCONVERSION + TRJ_i;
- tkd = max($temperature + DTA, `KELVINCONVERSION + `MINTEMP);
- auxt = tkd / tkr;
- KBOL_over_QELE = `KBOL / `QELE;
- phitr = KBOL_over_QELE * tkr;
- phitrinv = 1.0 / phitr;
- phitd = KBOL_over_QELE * tkd;
- phitdinv = 1.0 / phitd;
-
- // bandgap voltages at reference temperature
- deltaphigr = -(7.02e-4 * tkr * tkr) / (1108.0 + tkr);
- phigrbot = PHIGBOT + deltaphigr;
- phigrsti = PHIGSTI + deltaphigr;
- phigrgat = PHIGGAT + deltaphigr;
-
- // bandgap voltages at device temperature
- deltaphigd = -(7.02e-4 * tkd * tkd) / (1108.0 + tkd);
- phigdbot = PHIGBOT + deltaphigd;
- phigdsti = PHIGSTI + deltaphigd;
- phigdgat = PHIGGAT + deltaphigd;
-
- // factors ftd for ideal-current model
- ftdbot = (pow(auxt, 1.5)) * exp(0.5 * ((phigrbot * phitrinv) - (phigdbot * phitdinv)));
- ftdsti = (pow(auxt, 1.5)) * exp(0.5 * ((phigrsti * phitrinv) - (phigdsti * phitdinv)));
- ftdgat = (pow(auxt, 1.5)) * exp(0.5 * ((phigrgat * phitrinv) - (phigdgat * phitdinv)));
-
- // temperature-scaled saturation current for ideal-current model
- idsatbot = IDSATRBOT_i * ftdbot * ftdbot;
- idsatsti = IDSATRSTI_i * ftdsti * ftdsti;
- idsatgat = IDSATRGAT_i * ftdgat * ftdgat;
-
- // built-in voltages before limiting
- ubibot = VBIRBOT_i * auxt - 2 * phitd * ln(ftdbot);
- ubisti = VBIRSTI_i * auxt - 2 * phitd * ln(ftdsti);
- ubigat = VBIRGAT_i * auxt - 2 * phitd * ln(ftdgat);
-
- // built-in voltages limited to phitd
- vbibot = ubibot + phitd * ln(1 + exp((`vbilow - ubibot) * phitdinv));
- vbisti = ubisti + phitd * ln(1 + exp((`vbilow - ubisti) * phitdinv));
- vbigat = ubigat + phitd * ln(1 + exp((`vbilow - ubigat) * phitdinv));
-
- // inverse values of built-in voltages
- vbiinvbot = 1.0 / vbibot;
- vbiinvsti = 1.0 / vbisti;
- vbiinvgat = 1.0 / vbigat;
-
- // one minus the grading coefficient
- one_minus_PBOT = 1 - PBOT_i;
- one_minus_PSTI = 1 - PSTI_i;
- one_minus_PGAT = 1 - PGAT_i;
-
- // one over "one minus the grading coefficient"
- one_over_one_minus_PBOT = 1 / one_minus_PBOT;
- one_over_one_minus_PSTI = 1 / one_minus_PSTI;
- one_over_one_minus_PGAT = 1 / one_minus_PGAT;
-
- // temperature-scaled zero-bias capacitance
- cjobot = CJORBOT_i * pow((VBIRBOT_i * vbiinvbot), PBOT_i);
- cjosti = CJORSTI_i * pow((VBIRSTI_i * vbiinvsti), PSTI_i);
- cjogat = CJORGAT_i * pow((VBIRGAT_i * vbiinvgat), PGAT_i);
-
- // prefactor in physical part of charge model
- qprefbot = cjobot * vbibot * one_over_one_minus_PBOT;
- qprefsti = cjosti * vbisti * one_over_one_minus_PSTI;
- qprefgat = cjogat * vbigat * one_over_one_minus_PGAT;
-
- // prefactor in mathematical extension of charge model
- qpref2bot = `a * cjobot;
- qpref2sti = `a * cjosti;
- qpref2gat = `a * cjogat;
-
- // zero-bias depletion widths at reference temperature, needed in SRH and TAT model
- wdepnulrbot = `EPSSI / CJORBOT_i;
- wdepnulrsti = XJUNSTI_i * `EPSSI / CJORSTI_i;
- wdepnulrgat = XJUNGAT_i * `EPSSI / CJORGAT_i;
-
- // inverse values of "wdepnulr", used in BBT model
- wdepnulrinvbot = 1 / wdepnulrbot;
- wdepnulrinvsti = 1 / wdepnulrsti;
- wdepnulrinvgat = 1 / wdepnulrgat;
-
- // inverse values of built-in voltages at reference temperature, needed in SRH and BBT model
- VBIRBOTinv = 1 / VBIRBOT_i;
- VBIRSTIinv = 1 / VBIRSTI_i;
- VBIRGATinv = 1 / VBIRGAT_i;
-
- // some constants needed in erfc-approximation, needed in TAT model
- perfc = (`SQRTPI * `aerfc);
- berfc = ((-5 * (`aerfc) + 6 - pow((perfc), -2)) / 3);
- cerfc = (1.0 - (`aerfc) - (berfc));
-
- // half the bandgap energy, limited to values > phitd, needed in TAT model
- deltaEbot = max(0.5 * phigdbot, phitd);
- deltaEsti = max(0.5 * phigdsti, phitd);
- deltaEgat = max(0.5 * phigdgat, phitd);
-
- // values of atat, needed in TAT model
- atatbot = deltaEbot * phitdinv;
- atatsti = deltaEsti * phitdinv;
- atatgat = deltaEgat * phitdinv;
-
- // values of btatpart, needed in TAT model
- btatpartbot = sqrt(32 * MEFFTATBOT_i * `MELE * `QELE * (deltaEbot * deltaEbot * deltaEbot)) / (3 * `HBAR);
- btatpartsti = sqrt(32 * MEFFTATSTI_i * `MELE * `QELE * (deltaEsti * deltaEsti * deltaEsti)) / (3 * `HBAR);
- btatpartgat = sqrt(32 * MEFFTATGAT_i * `MELE * `QELE * (deltaEgat * deltaEgat * deltaEgat)) / (3 * `HBAR);
-
- // temperature-scaled values of FBBT, needed in BBT model
- fbbtbot = FBBTRBOT * (1 + STFBBTBOT * (tkd - tkr));
- fbbtsti = FBBTRSTI * (1 + STFBBTSTI * (tkd - tkr));
- fbbtgat = FBBTRGAT * (1 + STFBBTGAT * (tkd - tkr));
-
- // values of fstop, needed in avalanche/breakdown model
- fstopbot = 1 / (1 - pow(`alphaav, PBRBOT_i));
- fstopsti = 1 / (1 - pow(`alphaav, PBRSTI_i));
- fstopgat = 1 / (1 - pow(`alphaav, PBRGAT_i));
-
- // inverse values of breakdown voltages, needed in avalanche/breakdown model
- VBRinvbot = 1 / VBRBOT_i;
- VBRinvsti = 1 / VBRSTI_i;
- VBRinvgat = 1 / VBRGAT_i;
-
- // slopes for linear extraploation close to and beyond breakdown, needed in avalanche/breakdown model
- slopebot = -(fstopbot * fstopbot * pow(`alphaav, (PBRBOT_i - 1))) * PBRBOT_i * VBRinvbot;
- slopesti = -(fstopsti * fstopsti * pow(`alphaav, (PBRSTI_i - 1))) * PBRSTI_i * VBRinvsti;
- slopegat = -(fstopgat * fstopgat * pow(`alphaav, (PBRGAT_i - 1))) * PBRGAT_i * VBRinvgat;
diff --git a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_macrodefs.include b/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_macrodefs.include
deleted file mode 100644
index 00d5deed6..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_macrodefs.include
+++ /dev/null
@@ -1,285 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: JUNCAP200_macrodefs.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1 (PSP), 200.2 (JUNCAP), April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
-///////////////////////////////////////////
-//
-// Macros and constants used in JUNCAP2
-//
-///////////////////////////////////////////
-
-// Other constants
-`define MINTEMP -250
-`define vbilow 0.050
-`define a 2
-`define epsch 0.1
-`define dvbi 0.050
-`define epsav 1E-6
-`define vbrmax 1000
-`define alphaav 0.999
-`define vmaxlarge 1E8
-`define aerfc 0.29214664
-`define twothirds 0.666666666666667
-
-
-// Clipping values
-`define levelnumber 200
-`define AB_cliplow 0
-`define LS_cliplow 0
-`define LG_cliplow 0
-`define MULT_cliplow 0
-`define TRJ_cliplow `MINTEMP
-`define IMAX_cliplow 1E-12
-`define CJORBOT_cliplow 1E-12
-`define CJORSTI_cliplow 1E-18
-`define CJORGAT_cliplow 1E-18
-`define VBIR_cliplow `vbilow
-`define P_cliplow 0.05
-`define P_cliphigh 0.95
-`define IDSATR_cliplow 0
-`define CSRH_cliplow 0
-`define XJUN_cliplow 1E-9
-`define CTAT_cliplow 0
-`define MEFFTAT_cliplow 0.01
-`define CBBT_cliplow 0
-`define VBR_cliplow 0.1
-`define PBR_cliplow 0.1
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Macro definitions.
-//
-// Note that because at present locally scoped variables
-// can only be in named blocks, the intermediate variables
-// used in the macros below must be explicitly declared
-// as variables.
-//
-/////////////////////////////////////////////////////////////////////////////
-
-// Instance parameter dependent initialization
-
-`define JuncapInitInstance(AB_i, LS_i, LG_i, VMAX, vbimin, vch, vfmin, vbbtlim) \
-if (idsatbot * AB_i > 0) begin \
- vmaxbot = phitd * ln(IMAX_i / (idsatbot * AB_i) + 1); \
-end else begin \
- vmaxbot = `vmaxlarge; \
-end \
-if (idsatsti * LS_i > 0) begin \
- vmaxsti = phitd * ln(IMAX_i / (idsatsti * LS_i) + 1); \
-end else begin \
- vmaxsti = `vmaxlarge; \
-end \
-if (idsatgat * LG_i > 0) begin \
- vmaxgat = phitd * ln(IMAX_i / (idsatgat * LG_i) + 1); \
-end else begin \
- vmaxgat = `vmaxlarge; \
-end \
-VMAX = min(min(vmaxbot, vmaxsti), vmaxgat); \
- \
-/* determination of minimum value of the relevant built-in voltages */ \
-vbibot2 = vbibot; \
-vbisti2 = vbisti; \
-vbigat2 = vbigat; \
-if (AB_i == 0) begin vbibot2 = vbisti + vbigat; end \
-if (LS_i == 0) begin vbisti2 = vbibot + vbigat; end \
-if (LG_i == 0) begin vbigat2 = vbibot + vbisti; end \
-vbimin = min(min(vbibot2, vbisti2), vbigat2); \
-vch = vbimin * `epsch; \
-if (vbimin == vbibot) begin vfmin = vbibot * (1 - (pow(`a, (-1.0 / PBOT_i)))); end \
-if (vbimin == vbisti) begin vfmin = vbisti * (1 - (pow(`a, (-1.0 / PSTI_i)))); end \
-if (vbimin == vbigat) begin vfmin = vbigat * (1 - (pow(`a, (-1.0 / PGAT_i)))); end \
- \
-/* determination of limiting value of conditioned voltage for BBT calculation */ \
-vbibot2r = VBIRBOT_i; \
-vbisti2r = VBIRSTI_i; \
-vbigat2r = VBIRGAT_i; \
-if (AB_i == 0) begin vbibot2r = VBIRSTI_i + VBIRGAT_i; end \
-if (LS_i == 0) begin vbisti2r = VBIRBOT_i + VBIRGAT_i; end \
-if (LG_i == 0) begin vbigat2r = VBIRBOT_i + VBIRSTI_i; end \
-vbbtlim = min(min(vbibot2r, vbisti2r), vbigat2r) - `dvbi; \
-
-
-// Special power-functions
-
-`define mypower(x,power,result) \
-if (power == 0.5) begin \
- result = sqrt(x); \
-end else begin \
- result = pow(x, power); \
-end
-
-`define mypower2(x,power,result) \
-if (power == -1) begin \
- result = 1 / (x); \
-end else begin \
- result = pow(x, power); \
-end
-
-`define mypower3(x,power,result) \
-if (power == 4) begin \
- result = (x) * (x) * (x) * (x); \
-end else begin \
- result = pow(x, power); \
-end
-
-
-// Smoothing functions
-
-`define hypfunction2(x,x0,eps,hyp2) \
-hyp2 = 0.5 * ((x) + (x0) - sqrt(((x) - (x0)) * ((x) - (x0)) + 4 * (eps) * (eps)));
-
-`define hypfunction5(x,x0,eps,hyp5) \
-h1 = 4.0 * (eps) * (eps); \
-h2 = (eps) / (x0); \
-h2d = (x) + (eps) * h2; \
-h3 = (x0) + h2d; \
-h4 = (x0) - h2d; \
-h5 = sqrt(h4 * h4 + h1); \
-hyp5 = 2.0 * ((x) * (x0) / (h3 + h5));
-
-
-// A special function used to calculate TAT-currents,
-// including an approximation of the erfc-function
-
-`define calcerfcexpmtat(y,m,result) \
-ysq = y * y; \
-if (y > 0) begin \
- terfc = 1 / (1 + perfc * y); \
-end else begin \
- terfc = 1 / (1 - perfc * y); \
-end \
-`expl_low(-ysq + m, tmp) \
-erfcpos = (`aerfc * terfc + berfc * (terfc * terfc) + cerfc * (terfc * terfc * terfc)) * tmp; \
-if (y > 0) begin \
- result = erfcpos; \
-end else begin\
- `expl_low(m, tmp) \
- result = 2 * tmp - erfcpos; \
-end
-
-
-// This is the main function of the JUNCAP2-model. It returns the current and charge
-// for a single diode
-
-`define juncapfunction(qpref,qpref2,vbiinv,one_minus_P,idsat,CSRH,CTAT,vbi,wdepnulr,VBIRinv,P,ftd,btatpart,atat,one_over_one_minus_P,CBBT,VBIR,wdepnulrinv,fbbt,VBR,VBRinv,PBR,fstop,slope,Ijprime,Qjprime) \
-`mypower((1 - vj * vbiinv), one_minus_P, tmp) \
-Qjprime = qpref * (1 - tmp) + qpref2 * (VAK - vj); \
-id = idsat * idmult; \
-if ((CSRH == 0) && (CTAT == 0)) begin \
- isrh = 0; \
-end else begin \
- vbi_minus_vjsrh = vbi-vjsrh; \
- wsrhstep = 1 - sqrt(1 - two_psistar / vbi_minus_vjsrh); \
- if (P == 0.5) begin \
- dwsrh = 0; \
- end else begin \
- dwsrh = ((wsrhstep * wsrhstep * ln(wsrhstep) / (1 - wsrhstep)) + wsrhstep) * (1 - 2 * P); \
- end \
- wsrh = wsrhstep + dwsrh; \
- `mypower(vbi_minus_vjsrh * VBIRinv, P, tmp) \
- wdep = wdepnulr * tmp; \
- asrh = ftd * ((zinv - 1) * wdep); \
- isrh = CSRH * (asrh * wsrh); \
-end \
-if (CTAT == 0) begin \
- itat = 0; \
-end else begin \
- btat = btatpart * ((wdep * one_minus_P) / vbi_minus_vjsrh); \
- twoatatoverthreebtat = (`twothirds * atat) / btat; \
- umaxbeforelimiting = twoatatoverthreebtat * twoatatoverthreebtat; \
- umax = sqrt(umaxbeforelimiting * umaxbeforelimiting / (umaxbeforelimiting * umaxbeforelimiting + 1)); \
- sqrtumax = sqrt(abs(umax)); \
- umaxpoweronepointfive = umax * sqrtumax; \
- `mypower2((1 + btat * umaxpoweronepointfive), (-P * one_over_one_minus_P), wgamma) \
- wtat = wsrh * wgamma / (wsrh + wgamma); \
- ktat = sqrt(0.375 * (btat / sqrtumax)); \
- ltat = 2 * (twoatatoverthreebtat * sqrtumax) - umax; \
- mtat = atat * twoatatoverthreebtat * sqrtumax - atat * umax + 0.5 * (btat * umaxpoweronepointfive); \
- xerfc = (ltat - 1) * ktat; \
- `calcerfcexpmtat(xerfc, mtat, erfctimesexpmtat) \
- gammamax = `SQRTPI * 0.5 * (atat * erfctimesexpmtat / ktat); \
- itat = CTAT * (asrh * gammamax * wtat); \
-end \
-if (CBBT == 0) begin \
- ibbt = 0; \
-end else begin \
- `mypower(((VBIR - vbbt) * VBIRinv), P, tmp) \
- Fmaxr = one_over_one_minus_P * ((VBIR - vbbt) * wdepnulrinv / tmp); \
- `expl(-fbbt / Fmaxr, tmp) \
- ibbt = CBBT * (VAK * Fmaxr * Fmaxr * tmp); \
-end \
-if (VBR > `vbrmax) begin \
- fbreakdown = 1; \
-end else begin \
- if (vav > -`alphaav * VBR) begin \
- `mypower3(abs(vav * VBRinv), PBR, tmp) \
- fbreakdown = 1 / (1 - tmp); \
- end else begin \
- fbreakdown = fstop + (vav + `alphaav * VBR) * slope; \
- end \
-end \
-Ijprime = (id + isrh + itat + ibbt) * fbreakdown;
-
-
-// The following code is written as a macro because the naming of the instance parameters is
-// different for JUNCAP2 stand-alone and JUNCAP2-in-PSP: AB, LS, LG for JUNCAP2 stand-alone,
-// ABSOURCE, LSSOURCE, LGSOURCE for source junction in PSP and ABDRAIN, LSDRAIN, LGDRAIN for
-// drain junction in PSP
-
-`define juncapcommon(AB_i,LS_i,LG_i,ijunbot,qjunbot,ijunsti,qjunsti,ijungat,qjungat) \
-vbbt = 0.0; \
-two_psistar = 0.0; \
-if ( !( ((AB_i) == 0) && ((LS_i) == 0) && ((LG_i) == 0) ) ) begin \
- `hypfunction5(VAK, vfmin, vch, vj) \
- if (VAK < VMAX) begin \
- `expl(0.5 * (VAK * phitdinv), zinv) \
- idmult = zinv * zinv; \
- end else begin \
- `expl(VMAX * phitdinv, exp_VMAX_over_phitd) \
- idmult = (1 + (VAK - VMAX) * phitdinv) * exp_VMAX_over_phitd; \
- zinv = sqrt(idmult); \
- end \
- idmult = idmult - 1.0; \
- z = 1 / zinv; \
- if (VAK > 0) begin \
- two_psistar = 2.0 * (phitd * ln(2.0 + z + sqrt((z + 1.0) * (z + 3.0)))); \
- end else begin \
- two_psistar = -VAK + 2.0 * (phitd * ln(2 * zinv + 1 + sqrt((1 + zinv) * (1 + 3 * zinv)))); \
- end \
- vjlim = vbimin - two_psistar; \
- `hypfunction2(VAK, vjlim, phitd, vjsrh) \
- `hypfunction2(VAK, vbbtlim, phitr, vbbt) \
- `hypfunction2(VAK, 0, `epsav, vav) \
-end \
-if ((AB_i) == 0) begin \
- ijunbot = 0; \
- qjunbot = 0; \
-end else begin \
- `juncapfunction(qprefbot,qpref2bot,vbiinvbot,one_minus_PBOT,idsatbot,CSRHBOT_i,CTATBOT_i,vbibot,wdepnulrbot,VBIRBOTinv,PBOT_i,ftdbot,btatpartbot,atatbot,one_over_one_minus_PBOT,CBBTBOT_i,VBIRBOT_i,wdepnulrinvbot,fbbtbot,VBRBOT_i,VBRinvbot,PBRBOT_i,fstopbot,slopebot,ijunbot, qjunbot) \
-end \
-if ((LS_i) == 0) begin \
- ijunsti = 0; \
- qjunsti = 0; \
-end else begin \
- `juncapfunction(qprefsti,qpref2sti,vbiinvsti,one_minus_PSTI,idsatsti,CSRHSTI_i,CTATSTI_i,vbisti,wdepnulrsti,VBIRSTIinv,PSTI_i,ftdsti,btatpartsti,atatsti,one_over_one_minus_PSTI,CBBTSTI_i,VBIRSTI_i,wdepnulrinvsti,fbbtsti,VBRSTI_i,VBRinvsti,PBRSTI_i,fstopsti,slopesti,ijunsti, qjunsti) \
-end \
-if ((LG_i) == 0) begin \
- ijungat = 0; \
- qjungat = 0; \
-end else begin \
- `juncapfunction(qprefgat,qpref2gat,vbiinvgat,one_minus_PGAT,idsatgat,CSRHGAT_i,CTATGAT_i,vbigat,wdepnulrgat,VBIRGATinv,PGAT_i,ftdgat,btatpartgat,atatgat,one_over_one_minus_PGAT,CBBTGAT_i,VBIRGAT_i,wdepnulrinvgat,fbbtgat,VBRGAT_i,VBRinvgat,PBRGAT_i,fstopgat,slopegat,ijungat, qjungat) \
-end
diff --git a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_parlist.include b/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_parlist.include
deleted file mode 100644
index 5974b65b4..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_parlist.include
+++ /dev/null
@@ -1,65 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: JUNCAP200_parlist.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1 (PSP), 200.2 (JUNCAP), April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
- //////////////////////////////////////////
- //
- // JUNCAP2 - Reduced parameterlist
- //
- //////////////////////////////////////////
-
- (*info="Maximum current up to which forward current behaves exponentially", unit="A" *) parameter real IMAX = 1000 `from(`IMAX_cliplow ,inf );
- (*info="Zero-bias capacitance per unit-of-area of bottom component", unit="Fm^-2" *) parameter real CJORBOT = 1E-3 `from(`CJORBOT_cliplow ,inf );
- (*info="Zero-bias capacitance per unit-of-length of STI-edge component", unit="Fm^-1" *) parameter real CJORSTI = 1E-9 `from(`CJORSTI_cliplow ,inf );
- (*info="Zero-bias capacitance per unit-of-length of gate-edge component", unit="Fm^-1" *) parameter real CJORGAT = 1E-9 `from(`CJORGAT_cliplow ,inf );
- (*info="Built-in voltage at the reference temperature of bottom component", unit="V" *) parameter real VBIRBOT = 1 `from(`VBIR_cliplow ,inf );
- (*info="Built-in voltage at the reference temperature of STI-edge component", unit="V" *) parameter real VBIRSTI = 1 `from(`VBIR_cliplow ,inf );
- (*info="Built-in voltage at the reference temperature of gate-edge component", unit="V" *) parameter real VBIRGAT = 1 `from(`VBIR_cliplow ,inf );
- (*info="Grading coefficient of bottom component", unit="" *) parameter real PBOT = 0.5 `from(`P_cliplow ,`P_cliphigh );
- (*info="Grading coefficient of STI-edge component", unit="" *) parameter real PSTI = 0.5 `from(`P_cliplow ,`P_cliphigh );
- (*info="Grading coefficient of gate-edge component", unit="" *) parameter real PGAT = 0.5 `from(`P_cliplow ,`P_cliphigh );
- (*info="Zero-temperature bandgap voltage of bottom component", unit="V" *) parameter real PHIGBOT = 1.16 ;
- (*info="Zero-temperature bandgap voltage of STI-edge component", unit="V" *) parameter real PHIGSTI = 1.16 ;
- (*info="Zero-temperature bandgap voltage of gate-edge component", unit="V" *) parameter real PHIGGAT = 1.16 ;
- (*info="Saturation current density at the reference temperature of bottom component", unit="Am^-2" *) parameter real IDSATRBOT = 1E-12 `from(`IDSATR_cliplow ,inf );
- (*info="Saturation current density at the reference temperature of STI-edge component", unit="Am^-1" *) parameter real IDSATRSTI = 1E-18 `from(`IDSATR_cliplow ,inf );
- (*info="Saturation current density at the reference temperature of gate-edge component", unit="Am^-1" *) parameter real IDSATRGAT = 1E-18 `from(`IDSATR_cliplow ,inf );
- (*info="Shockley-Read-Hall prefactor of bottom component", unit="Am^-3" *) parameter real CSRHBOT = 1E2 `from(`CSRH_cliplow ,inf );
- (*info="Shockley-Read-Hall prefactor of STI-edge component", unit="Am^-2" *) parameter real CSRHSTI = 1E-4 `from(`CSRH_cliplow ,inf );
- (*info="Shockley-Read-Hall prefactor of gate-edge component", unit="Am^-2" *) parameter real CSRHGAT = 1E-4 `from(`CSRH_cliplow ,inf );
- (*info="Junction depth of STI-edge component", unit="m" *) parameter real XJUNSTI = 100E-9 `from(`XJUN_cliplow ,inf );
- (*info="Junction depth of gate-edge component", unit="m" *) parameter real XJUNGAT = 100E-9 `from(`XJUN_cliplow ,inf );
- (*info="Trap-assisted tunneling prefactor of bottom component", unit="Am^-3" *) parameter real CTATBOT = 1E2 `from(`CTAT_cliplow ,inf );
- (*info="Trap-assisted tunneling prefactor of STI-edge component", unit="Am^-2" *) parameter real CTATSTI = 1E-4 `from(`CTAT_cliplow ,inf );
- (*info="Trap-assisted tunneling prefactor of gate-edge component", unit="Am^-2" *) parameter real CTATGAT = 1E-4 `from(`CTAT_cliplow ,inf );
- (*info="Effective mass (in units of m0) for trap-assisted tunneling of bottom component", unit="" *) parameter real MEFFTATBOT = 0.25 `from(`MEFFTAT_cliplow ,inf );
- (*info="Effective mass (in units of m0) for trap-assisted tunneling of STI-edge component", unit="" *) parameter real MEFFTATSTI = 0.25 `from(`MEFFTAT_cliplow ,inf );
- (*info="Effective mass (in units of m0) for trap-assisted tunneling of gate-edge component", unit="" *) parameter real MEFFTATGAT = 0.25 `from(`MEFFTAT_cliplow ,inf );
- (*info="Band-to-band tunneling prefactor of bottom component", unit="AV^-3" *) parameter real CBBTBOT = 1E-12 `from(`CBBT_cliplow ,inf );
- (*info="Band-to-band tunneling prefactor of STI-edge component", unit="AV^-3m" *) parameter real CBBTSTI = 1E-18 `from(`CBBT_cliplow ,inf );
- (*info="Band-to-band tunneling prefactor of gate-edge component", unit="AV^-3m" *) parameter real CBBTGAT = 1E-18 `from(`CBBT_cliplow ,inf );
- (*info="Normalization field at the reference temperature for band-to-band tunneling of bottom component", unit="Vm^-1" *) parameter real FBBTRBOT = 1E9 ;
- (*info="Normalization field at the reference temperature for band-to-band tunneling of STI-edge component", unit="Vm^-1" *) parameter real FBBTRSTI = 1E9 ;
- (*info="Normalization field at the reference temperature for band-to-band tunneling of gate-edge component", unit="Vm^-1" *) parameter real FBBTRGAT = 1E9 ;
- (*info="Temperature scaling parameter for band-to-band tunneling of bottom component", unit="K^-1" *) parameter real STFBBTBOT = -1E-3 ;
- (*info="Temperature scaling parameter for band-to-band tunneling of STI-edge component", unit="K^-1" *) parameter real STFBBTSTI = -1E-3 ;
- (*info="Temperature scaling parameter for band-to-band tunneling of gate-edge component", unit="K^-1" *) parameter real STFBBTGAT = -1E-3 ;
- (*info="Breakdown voltage of bottom component", unit="V" *) parameter real VBRBOT = 10 `from(`VBR_cliplow ,inf );
- (*info="Breakdown voltage of STI-edge component", unit="V" *) parameter real VBRSTI = 10 `from(`VBR_cliplow ,inf );
- (*info="Breakdown voltage of gate-edge component", unit="V" *) parameter real VBRGAT = 10 `from(`VBR_cliplow ,inf );
- (*info="Breakdown onset tuning parameter of bottom component", unit="V" *) parameter real PBRBOT = 4 `from(`PBR_cliplow ,inf );
- (*info="Breakdown onset tuning parameter of STI-edge component", unit="V" *) parameter real PBRSTI = 4 `from(`PBR_cliplow ,inf );
- (*info="Breakdown onset tuning parameter of gate-edge component", unit="V" *) parameter real PBRGAT = 4 `from(`PBR_cliplow ,inf );
diff --git a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_varlist.include b/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_varlist.include
deleted file mode 100644
index cb4c5a680..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/JUNCAP200_varlist.include
+++ /dev/null
@@ -1,67 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: JUNCAP200_varlist.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1 (PSP), 200.2 (JUNCAP), April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
-
- // declaration of variables needed in macro "calcerfcexpmtat"
- real ysq, terfc, erfcpos;
-
- // declaration of variables needed in hypfunction 5
- real h1, h2, h2d, h3, h4, h5;
-
- // declaration of variables used within macro "juncapfunction"
- real tmp, id;
- real isrh, vbi_minus_vjsrh, wsrhstep, dwsrh, wsrh, wdep, asrh;
- real itat, btat, twoatatoverthreebtat, umaxbeforelimiting, umax, sqrtumax, umaxpoweronepointfive;
- real wgamma, wtat, ktat, ltat, mtat, xerfc, erfctimesexpmtat, gammamax;
- real ibbt, Fmaxr;
- real fbreakdown;
-
- // declaration of clipped parameters
- real TRJ_i, IMAX_i;
- real CJORBOT_i, CJORSTI_i, CJORGAT_i, VBIRBOT_i, VBIRSTI_i, VBIRGAT_i;
- real PBOT_i, PSTI_i, PGAT_i;
- real IDSATRBOT_i, IDSATRSTI_i, IDSATRGAT_i, XJUNSTI_i, XJUNGAT_i;
- real CSRHBOT_i, CSRHSTI_i, CSRHGAT_i, CTATBOT_i, CTATSTI_i, CTATGAT_i;
- real MEFFTATBOT_i, MEFFTATSTI_i, MEFFTATGAT_i;
- real CBBTBOT_i, CBBTSTI_i, CBBTGAT_i;
- real VBRBOT_i, VBRSTI_i, VBRGAT_i, PBRBOT_i, PBRSTI_i, PBRGAT_i;
-
- // declaration of variables calculated outside macro "juncapfunction", voltage-independent part
- real tkr, tkd, auxt, KBOL_over_QELE, phitr, phitrinv, phitd, phitdinv;
- real deltaphigr, phigrbot, phigrsti, phigrgat, deltaphigd, phigdbot, phigdsti, phigdgat;
- real ftdbot, ftdsti, ftdgat, idsatbot, idsatsti, idsatgat, exp_VMAX_over_phitd;
- real ubibot, ubisti, ubigat, vbibot, vbisti, vbigat;
- real vbibot2, vbisti2, vbigat2, vbibot2r, vbisti2r, vbigat2r;
- real vbiinvbot, vbiinvsti, vbiinvgat;
- real one_minus_PBOT, one_minus_PSTI, one_minus_PGAT;
- real one_over_one_minus_PBOT, one_over_one_minus_PSTI, one_over_one_minus_PGAT;
- real cjobot, cjosti, cjogat, qprefbot, qprefsti, qprefgat;
- real vbimin, vch, vfmin, vbbtlim;
- real qpref2bot, qpref2sti, qpref2gat;
- real wdepnulrbot, wdepnulrsti, wdepnulrgat, wdepnulrinvbot, wdepnulrinvsti, wdepnulrinvgat;
- real VBIRBOTinv, VBIRSTIinv, VBIRGATinv;
- real perfc, berfc, cerfc;
- real deltaEbot, deltaEsti, deltaEgat, atatbot, atatsti, atatgat;
- real btatpartbot, btatpartsti, btatpartgat;
- real fbbtbot, fbbtsti, fbbtgat;
- real fstopbot, fstopsti, fstopgat, VBRinvbot, VBRinvsti, VBRinvgat;
- real slopebot, slopesti, slopegat;
- real vmaxbot, vmaxsti, vmaxgat, VMAX;
-
- // declaration of variables calculated outside macro "juncapfunction", voltage-dependent part
- real VAK, idmult, vj, z, zinv, two_psistar, vjlim, vjsrh, vbbt, vav;
-
diff --git a/src/spicelib/devices/adms/psp102/adms3va/PSP102_ChargesNQS.include b/src/spicelib/devices/adms/psp102/adms3va/PSP102_ChargesNQS.include
deleted file mode 100644
index 6ebe651fd..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/PSP102_ChargesNQS.include
+++ /dev/null
@@ -1,303 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: PSP102_ChargesNQS.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
-
- ///////////////////////////////////////////////
- //
- // Calculate NQS-charge contributions
- //
- ///////////////////////////////////////////////
-
- Qp1 = vnorm * V(SPLINE1);
- Qp2 = vnorm * V(SPLINE2);
- Qp3 = vnorm * V(SPLINE3);
- Qp4 = vnorm * V(SPLINE4);
- Qp5 = vnorm * V(SPLINE5);
- Qp6 = vnorm * V(SPLINE6);
- Qp7 = vnorm * V(SPLINE7);
- Qp8 = vnorm * V(SPLINE8);
- Qp9 = vnorm * V(SPLINE9);
-
- Tnorm = 0.0;
-
- if (SWNQS_i != 0) begin
- // Dimension and mobility information is included in Tnorm
- Tnorm = MUNQS_i * phit1 * BET_i / (COX_qm * Gmob_dL);
- thesat2 = thesat1 * thesat1 * phit1 * phit1;
-
- if (SWNQS_i == 1) begin
- dQy = QpN - Qp0;
- d2Qy = 6.0 * (Qp0 + QpN) - 12.0 * Qp1;
- end else if (SWNQS_i == 2) begin
- dQy = (-7.0 * Qp0 - 3.0 * Qp1 + 12.0 * Qp2 - 2.0 * QpN) / 5.0;
- d2Qy = -18.0 / 5.0 * (-4.0 * Qp0 + 9.0 * Qp1 - 6.0 * Qp2 + QpN);
- end else if (SWNQS_i == 3) begin
- dQy = (-13.0 * Qp0 - 6.0 * Qp1 + 24.0 * Qp2 - 6.0 * Qp3 + QpN) / 7.0;
- d2Qy = (180.0 * Qp0 - 408.0 * Qp1 + 288.0 * Qp2 - 72.0 * Qp3 + 12.0 * QpN) / 7.0;
- end else if (SWNQS_i == 5) begin
- dQy = (-181.0 * Qp0 - 84.0 * Qp1 + 24.0 * Qp4 - 6.0 * Qp5 - 90.0 * Qp3 + QpN
- + 336.0 * Qp2) / 65.0;
- d2Qy = (432.0 * Qp4 - 108.0 * Qp5 - 1620.0 * Qp3 + 18.0 * QpN + 3762.0 * Qp0
- - 8532.0 * Qp1 + 6048.0 * Qp2) / 65.0;
- end else if (SWNQS_i == 9) begin
- dQy = (1680.0 * Qp6 + 23400.0 * Qp4 + 5.0 * QpN - 87330.0 * Qp3 + 120.0 * Qp8
- - 450.0 * Qp7 - 81480.0 * Qp1 + 325920.0 * Qp2
- -175565.0 * Qp0 - 30.0 * Qp9) / 37829.0 - 30.0 / 181.0 * Qp5;
- d2Qy = (-13500.0 * Qp7 + 702000.0 * Qp4 - 2619900 * Qp3 - 13793100.0 * Qp1
- + 9777600.0 * Qp2 + 6081750.0 * Qp0 + 150.0 * QpN + 3600.0 * Qp8
- - 900.0 * Qp9 + 50400 * Qp6) / 37829.0 - 900.0 / 181.0 * Qp5;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp1, xg, dQy, d2Qy, fk1)
- end
-
- if (SWNQS_i >= 2) begin
- if (SWNQS_i == 2) begin
- dQy = (2.0 * Qp0 - 12.0 * Qp1 + 3.0 * Qp2 + 7.0 * QpN) / 5.0;
- d2Qy = -18.0 / 5.0 * (-4.0 * QpN + 9.0 * Qp2 - 6.0 * Qp1 + Qp0);
- end else if (SWNQS_i == 3) begin
- dQy = 0.5 * Qp0 - 3.0 * Qp1 + 3.0 * Qp3 - 0.5 * QpN;
- d2Qy = (-48.0 * Qp0 + 288.0 * Qp1 - 480.0 * Qp2 + 288.0 * Qp3 - 48.0 * QpN) / 7.0;
- end else if (SWNQS_i == 5) begin
- dQy = (-291.0 * Qp1 - 6.0 * Qp2 - 84.0 * Qp4 + 21.0 * Qp5) / 65.0
- + (630.0 * Qp3 - 7.0 * QpN + 97.0 * Qp0) / 130.0;
- d2Qy = (-1728.0 * Qp4 + 432.0 * Qp5 + 6480.0 * Qp3 - 72.0 * QpN - 1008 * Qp0
- + 6048 * Qp1 - 10152 * Qp2) / 65.0;
- end else if (SWNQS_i == 9) begin
- dQy = (-5880.0 * Qp6 - 81900.0 * Qp4 + 305655.0 * Qp3 - 420.0 * Qp8
- + 105.0 * Qp9 - 282255.0 * Qp1 + 1575.0 * Qp7 - 5850.0 * Qp2) / 37829.0
- + 105.0 / 181.0 * Qp5 + (94085.0 * Qp0 - 35.0 * QpN) / 75658.0;
- d2Qy = (9777600.0 * Qp1 + 54000.0 * Qp7 - 2808000.0 * Qp4 + 10479600.0 * Qp3
- - 16413000.0 * Qp2 - 1629600.0 * Qp0 - 600.0 * QpN - 14400.0 * Qp8
- + 3600.0 * Qp9 - 201600.0 * Qp6) / 37829.0 + 3600.0 * Qp5 / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp2, xg, dQy, d2Qy, fk2)
- end
-
- if (SWNQS_i >= 3) begin
- if (SWNQS_i == 3) begin
- dQy = (13.0 * QpN + 6.0 * Qp3 - 24.0 * Qp2 + 6.0 * Qp1 - Qp0) / 7.0;
- d2Qy = (180.0 * QpN - 408.0 * Qp3 + 288.0 * Qp2 - 72.0 * Qp1 + 12.0 * Qp0) / 7.0;
- end else if (SWNQS_i == 5) begin
- dQy = (QpN - 6.0 * Qp5 + 24.0 * Qp4 - 24.0 * Qp2 + 6.0 * Qp1 - Qp0) / 5.0;
- d2Qy = (1296.0 * (Qp4 + Qp2) - 324.0 * (Qp5 + Qp1) - 2052.0 * Qp3
- + 54.0 * (QpN + Qp0)) / 13.0;
- end else if (SWNQS_i == 9) begin
- dQy = (21840.0 * Qp6 + 304200.0 * Qp4 + 65.0 * QpN - 420.0 * Qp3 + 1560.0 * Qp8
- - 12605.0 * Qp0-390.0 * Qp9 + 75630.0 * Qp1 - 5850.0 * Qp7
- - 302520.0 * Qp2) / 37829.0 - 390.0 / 181.0 * Qp5;
- d2Qy = (-2619900.0 * Qp1 - 202500.0 * Qp7 + 10530000.0 * Qp4 - 16601100.0 * Qp3
- + 10479600.0 * Qp2 + 436650.0 * Qp0 + 2250.0 * QpN + 54000.0 * Qp8
- - 13500.0 * Qp9 + 756000.0 * Qp6) / 37829.0 - 13500.0 * Qp5 / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp3, xg, dQy, d2Qy, fk3)
- end
-
- if (SWNQS_i >= 4) begin
- if (SWNQS_i == 5) begin
- dQy = (-630.0 * Qp3 + 12.0 * Qp4 + 582.0 * Qp5 - 97.0 * QpN + 7.0 * Qp0
- - 42.0 * Qp1 + 168.0 * Qp2)/130.0;
- d2Qy = (-10152.0 * Qp4 + 6048.0 * Qp5 + 6480.0 * Qp3 - 1008.0 * QpN
- - 72.0 * Qp0 + 432.0 * Qp1 - 1728.0 * Qp2) / 65.0;
- end
- else if (SWNQS_i == 9) begin
- dQy = (-81480.0 * Qp6 - 30.0 * Qp4 - 303975.0 * Qp3 - 5820.0 * Qp8
- + 1455.0 * Qp9 - 20265.0 * Qp1 + 21825.0 * Qp7 + 81060.0 * Qp2) / 37829.0
- - 485.0 / 75658.0 * QpN + 1455.0 * Qp5 / 181.0 + 6755.0 * Qp0 / 75658.0;
- d2Qy = (702000.0 * Qp1 + 756000.0 * Qp7 - 16614600.0 * Qp4 + 10530000.0 * Qp3
- - 2808000.0 * Qp2 - 117000.0 * Qp0 - 8400.0 * QpN - 201600.0 * Qp8
- + 50400.0 * Qp9 - 2822400.0 * Qp6) / 37829.0 + 50400.0 * Qp5 / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp4, xg, dQy, d2Qy, fk4)
- end
-
- if (SWNQS_i >= 5) begin
- if (SWNQS_i == 5) begin
- dQy = (-336.0 * Qp4 + 84.0 * Qp5 + 90.0 * Qp3 + 181.0 * QpN - Qp0 + 6.0 * Qp1
- - 24.0 * Qp2) / 65.0;
- d2Qy = (18.0 * Qp0 + 3762.0 * QpN + 6048.0 * Qp4 + 432.0 * Qp2 - 1620.0 * Qp3
- - 108.0 * Qp1 - 8532.0 * Qp5) / 65.0;
- end else if (SWNQS_i == 9) begin
- dQy = (1680.0 * (Qp6 - Qp4) + 5.0 * (QpN - Qp0) + 450.0 * (Qp3 - Qp7)
- + 120.0 * (Qp8 - Qp2) - 30.0 * (Qp9 - Qp1)) / 209.0;
- d2Qy = (-900.0 * (Qp1 + Qp9) - 13500.0 * (Qp7 + Qp3) - 79500.0 * Qp5
- + 50400.0 * (Qp4 + Qp6) + 3600.0 * (Qp2 + Qp8) + 150.0 * (Qp0 + QpN)) / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp5, xg, dQy, d2Qy, fk5)
- end
-
- if (SWNQS_i >= 6) begin
- if (SWNQS_i == 9) begin
- dQy = (30.0 * Qp6 + 81480.0 * Qp4 - 21825.0 * Qp3 - 81060.0 * Qp8 + 20265.0 * Qp9
- - 1455.0 * Qp1 + 303975.0 * Qp7 + 5820.0 * Qp2) / 37829.0
- -(6755.0 * QpN - 485.0 * Qp0) / 75658.0 - 1455.0 / 181.0 * Qp5;
- d2Qy = (50400.0 * Qp1 + 10530000.0 * Qp7 - 2822400.0 * Qp4 + 756000.0 * Qp3
- - 201600.0 * Qp2 - 8400.0 * Qp0 - 117000.0 * QpN - 2808000.0 * Qp8
- + 702000.0 * Qp9 - 16614600.0 * Qp6) / 37829.0 + 50400.0 * Qp5 / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp6, xg, dQy, d2Qy, fk6)
- end
-
- if (SWNQS_i >= 7) begin
- if (SWNQS_i == 9) begin
- dQy = (-304200.0 * Qp6 - 21840.0 * Qp4 + 12605.0 * QpN + 5850.0 * Qp3
- + 302520.0 * Qp8 - 65.0 * Qp0 - 75630.0 * Qp9 + 390.0 * Qp1 + 420.0 * Qp7
- - 1560.0 * Qp2) / 37829.0 + 390.0 / 181.0 * Qp5;
- d2Qy = (-13500.0 * Qp1 - 16601100.0 * Qp7 + 756000.0 * Qp4 - 202500.0 * Qp3
- + 54000.0 * Qp2 + 2250.0 * Qp0 + 436650.0 * QpN + 10479600.0 * Qp8
- - 2619900.0 * Qp9 + 10530000.0 * Qp6) / 37829.0 - 13500.0 * Qp5 / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp7, xg, dQy, d2Qy, fk7)
- end
-
- if (SWNQS_i >= 8) begin
- if (SWNQS_i == 9) begin
- dQy = (81900.0 * Qp6 + 5880.0 * Qp4 - 1575.0 * Qp3 + 5850.0 * Qp8 + 282255.0 * Qp9
- - 105.0 * Qp1 - 305655.0 * Qp7 + 420.0 * Qp2) / 37829.0 + (35.0 * Qp0
- - 94085.0 * QpN) / 75658.0 - 105.0 / 181.0 * Qp5;
- d2Qy = (3600.0 * Qp1 + 10479600.0 * Qp7 - 201600.0 * Qp4 + 54000.0 * Qp3
- - 14400.0 * Qp2 - 600.0 * Qp0 - 1629600.0 * QpN - 16413000.0 * Qp8
- + 9777600.0 * Qp9 - 2808000.0 * Qp6) / 37829.0 + 3600.0 * Qp5 / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp8, xg, dQy, d2Qy, fk8)
- end
-
- if (SWNQS_i >= 9) begin
- if (SWNQS_i == 9) begin
- dQy = (-23400.0 * Qp6 - 1680.0 * Qp4 + 175565.0 * QpN + 450.0 * Qp3
- - 325920.0 * Qp8 - 5.0 * Qp0 + 81480.0 * Qp9 + 30.0 * Qp1
- + 87330.0 * Qp7 - 120.0 * Qp2) / 37829.0 + 30.0 * Qp5 / 181.0;
- d2Qy = (-900.0 * Qp1 - 2619900.0 * Qp7 + 50400.0 * Qp4 - 13500.0 * Qp3
- + 3600.0 * Qp2 + 150.0 * Qp0 + 6081750.0 * QpN + 9777600.0 * Qp8
- - 13793100.0 * Qp9 + 702000.0 * Qp6) / 37829.0 - 900.0 * Qp5 / 181.0;
- end else begin
- dQy = 0;
- d2Qy = 0;
- end
- `fq(Qp9, xg, dQy, d2Qy, fk9)
- end
-
- //--------------------------------------------------------------------
-
- // Terminal charges for NQS
- if (SWNQS_i != 0) begin
- if (SWNQS_i == 1) begin
- QS_NQS = (17.0 * Qp0 + 30.0 * Qp1 + QpN) / 96.0;
- QD_NQS = (Qp0 + 30.0 * Qp1 + 17.0 * QpN) / 96.0;
- `QiToPhi(Qp1,xg, temp1)
- QG_NQS = xg - (x_sp + 4.0 * temp1 + x_dp) * `oneSixth;
- end else if (SWNQS_i == 2) begin
- QS_NQS = (11.0 * Qp0 + 24.0 * Qp1 + 9.0 * Qp2 + QpN) / 90.0;
- QD_NQS = (11.0 * QpN + 24.0 * Qp2 + 9.0 * Qp1 + Qp0) / 90.0;
- `QiToPhi(Qp1, xg, temp1)
- `QiToPhi(Qp2, xg, temp2)
- QG_NQS = xg - (x_sp + 3.0 * (temp1 + temp2) + x_dp) * 0.125;
- end else if (SWNQS_i == 3) begin
- QS_NQS = (251.0 * Qp0 + 594.0 * Qp1 + 312.0 * Qp2 + 174.0 * Qp3 + 13.0 * QpN) / 2688.0;
- QD_NQS = (251.0 * QpN + 594.0 * Qp3 + 312.0 * Qp2 + 174.0 * Qp1 + 13.0 * Qp0) / 2688.0;
- `QiToPhi(Qp1, xg, temp1)
- `QiToPhi(Qp2, xg, temp2)
- `QiToPhi(Qp3, xg, temp3)
- QG_NQS = xg - (x_sp + 4.0 * temp1 + 2.0 * temp2 + 4.0 * temp3 + x_dp) / 12.0;
- end else if (SWNQS_i == 5) begin
- QS_NQS = (1187.0 * Qp0 + 43.0 * QpN) / 18720.0 + (503.0 * Qp1 + 172.0 * Qp4
- + 87.0 * Qp5 + 265.0 * Qp3 + 328.0 * Qp2) / 3120.0;
- QD_NQS = (1187.0 * QpN + 43.0 * Qp0) / 18720.0 + (503.0 * Qp5 + 172.0 * Qp2
- + 87.0 * Qp1 + 265.0 * Qp3 + 328.0 * Qp4) / 3120.0;
- `QiToPhi(Qp1, xg, temp1)
- `QiToPhi(Qp2, xg, temp2)
- `QiToPhi(Qp3, xg, temp3)
- `QiToPhi(Qp4, xg, temp4)
- `QiToPhi(Qp5, xg, temp5)
- QG_NQS = xg - (x_sp + 4.0 * (temp1 + temp3 + temp5) + 2.0 * (temp2 + temp4) + x_dp) / 18.0;
- end else if (SWNQS_i == 9) begin
- QS_NQS = (75653.0 * Qp8 + 225999.0 * Qp4) / 3782900.0 + (151321.0 * Qp9
- + 454023.0 * Qp7 + 1073767.0 * Qp3 + 1564569.0 * Qp1) / 15131600.0
- + 75623.0 * Qp6 / 1891450.0 + 145.0 * Qp5 / 2896.0 + 72263.0 * Qp2 / 945725.0
- + (3504517.0 * Qp0 + 75653.0 * QpN) / 90789600.0;
- QD_NQS = (75653.0 * Qp2 + 225999.0 * Qp6) / 3782900.0 + (151321.0 * Qp1
- + 454023.0 * Qp3 + 1073767.0 * Qp7 + 1564569.0 * Qp9) / 15131600.0
- + 75623.0 * Qp4 / 1891450.0 + 145.0 * Qp5 / 2896.0 + 72263.0 * Qp8 / 945725.0
- + (3504517.0 * QpN + 75653.0 * Qp0) / 90789600.0;
- `QiToPhi(Qp1, xg, temp1)
- `QiToPhi(Qp2, xg, temp2)
- `QiToPhi(Qp3, xg, temp3)
- `QiToPhi(Qp4, xg, temp4)
- `QiToPhi(Qp5, xg, temp5)
- `QiToPhi(Qp6, xg, temp6)
- `QiToPhi(Qp7, xg, temp7)
- `QiToPhi(Qp8, xg, temp8)
- `QiToPhi(Qp9, xg, temp9)
- QG_NQS = xg - (x_sp + 4.0 * (temp1 + temp3 + temp5 + temp7 + temp9)
- + 2.0 * (temp2 + temp4 + temp6 + temp8) + x_dp) / 30.0;
- end
- QG_NQS = pd * QG_NQS;
-
- if (sigVds > 0) begin
- Qs = COX_qm * phit1 * QS_NQS;
- Qd = COX_qm * phit1 * QD_NQS;
- end else begin
- Qs = COX_qm * phit1 * QD_NQS;
- Qd = COX_qm * phit1 * QS_NQS;
- end
- Qg = COX_qm * phit1 * QG_NQS;
- Qb = -Qg - Qs - Qd;
- end
-
- // Update internal nodes
- V(RES1) <+ vnorm_inv * I(RES1) * r_nqs;
- V(SPLINE1) <+ idt(-vnorm_inv * Tnorm * fk1, Qp1_0);
- V(RES2) <+ vnorm_inv * I(RES2) * r_nqs;
- V(SPLINE2) <+ idt(-vnorm_inv * Tnorm * fk2, Qp2_0);
- V(RES3) <+ vnorm_inv * I(RES3) * r_nqs;
- V(SPLINE3) <+ idt(-vnorm_inv * Tnorm * fk3, Qp3_0);
- V(RES4) <+ vnorm_inv * I(RES4) * r_nqs;
- V(SPLINE4) <+ idt(-vnorm_inv * Tnorm * fk4, Qp4_0);
- V(RES5) <+ vnorm_inv * I(RES5) * r_nqs;
- V(SPLINE5) <+ idt(-vnorm_inv * Tnorm * fk5, Qp5_0);
- V(RES6) <+ vnorm_inv * I(RES6) * r_nqs;
- V(SPLINE6) <+ idt(-vnorm_inv * Tnorm * fk6, Qp6_0);
- V(RES7) <+ vnorm_inv * I(RES7) * r_nqs;
- V(SPLINE7) <+ idt(-vnorm_inv * Tnorm * fk7, Qp7_0);
- V(RES8) <+ vnorm_inv * I(RES8) * r_nqs;
- V(SPLINE8) <+ idt(-vnorm_inv * Tnorm * fk8, Qp8_0);
- V(RES9) <+ vnorm_inv * I(RES9) * r_nqs;
- V(SPLINE9) <+ idt(-vnorm_inv * Tnorm * fk9, Qp9_0);
-
diff --git a/src/spicelib/devices/adms/psp102/adms3va/PSP102_InitNQS.include b/src/spicelib/devices/adms/psp102/adms3va/PSP102_InitNQS.include
deleted file mode 100644
index a42383d16..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/PSP102_InitNQS.include
+++ /dev/null
@@ -1,190 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: PSP102_InitNQS.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // Computing initial (dc) values for internal nodes.
- // This code is independent of internal-node voltages
- //
- /////////////////////////////////////////////////////////////////////////////
-
- Qp1_0 = 0.0;
- Qp2_0 = 0.0;
- Qp3_0 = 0.0;
- Qp4_0 = 0.0;
- Qp5_0 = 0.0;
- Qp6_0 = 0.0;
- Qp7_0 = 0.0;
- Qp8_0 = 0.0;
- Qp9_0 = 0.0;
- fk1 = 0.0;
- fk2 = 0.0;
- fk3 = 0.0;
- fk4 = 0.0;
- fk5 = 0.0;
- fk6 = 0.0;
- fk7 = 0.0;
- fk8 = 0.0;
- fk9 = 0.0;
- if (SWNQS_i != 0) begin
- dQis = 0.0;
- dQy = 0.0;
- dfQi = 0.0;
- fQi = 0.0;
- d2Qy = 0.0;
-
- Qp1 = 0.0;
- Qp2 = 0.0;
- Qp3 = 0.0;
- Qp4 = 0.0;
- Qp5 = 0.0;
- Qp6 = 0.0;
- Qp7 = 0.0;
- Qp8 = 0.0;
- Qp9 = 0.0;
-
- phi_p1 = 0.0;
- phi_p2 = 0.0;
- phi_p3 = 0.0;
- phi_p4 = 0.0;
- phi_p5 = 0.0;
- phi_p6 = 0.0;
- phi_p7 = 0.0;
- phi_p8 = 0.0;
- phi_p9 = 0.0;
-
- // Setting initial values for charge along the channel
- // from interpolated DC-solution
- if (xg > 0) begin
- if (SWNQS_i == 1) begin
- phi_p1 = `Phiy(0.5);
- `PhiToQb(phi_p1,Qb_tmp)
- Qp1_0 = -pd * (xg - phi_p1) - Qb_tmp;
- end else if (SWNQS_i == 2) begin
- phi_p1 = `Phiy(`oneThird);
- `PhiToQb(phi_p1,Qb_tmp)
- Qp1_0 = -pd * (xg - phi_p1) - Qb_tmp;
-
- phi_p2 = `Phiy(`twoThirds);
- `PhiToQb(phi_p2,Qb_tmp)
- Qp2_0 = -pd * (xg - phi_p2) - Qb_tmp;
- if (sigVds < 0) begin
- `swap(Qp1_0, Qp2_0)
- end
- end else if (SWNQS_i == 3) begin
- phi_p1 = `Phiy(0.25);
- `PhiToQb(phi_p1,Qb_tmp)
- Qp1_0 = -pd * (xg - phi_p1) - Qb_tmp;
-
- phi_p2 = `Phiy(0.5);
- `PhiToQb(phi_p2,Qb_tmp)
- Qp2_0 = -pd * (xg - phi_p2) - Qb_tmp;
-
- phi_p3 = `Phiy(0.75);
- `PhiToQb(phi_p3,Qb_tmp)
- Qp3_0 = -pd * (xg - phi_p3) - Qb_tmp;
- if (sigVds < 0) begin
- `swap(Qp1_0, Qp3_0)
- end
- end else if (SWNQS_i == 5) begin
- phi_p1 = `Phiy(`oneSixth);
- `PhiToQb(phi_p1,Qb_tmp)
- Qp1_0 = -pd * (xg - phi_p1) - Qb_tmp;
-
- phi_p2 = `Phiy(`oneThird);
- `PhiToQb(phi_p2,Qb_tmp)
- Qp2_0 = -pd * (xg - phi_p2) - Qb_tmp;
-
- phi_p3 = `Phiy(0.5);
- `PhiToQb(phi_p3,Qb_tmp)
- Qp3_0 = -pd * (xg - phi_p3) - Qb_tmp;
-
- phi_p4 = `Phiy(`twoThirds);
- `PhiToQb(phi_p4,Qb_tmp)
- Qp4_0 = -pd * (xg - phi_p4) - Qb_tmp;
-
- phi_p5 = `Phiy(0.8333333333333333);
- `PhiToQb(phi_p5,Qb_tmp)
- Qp5_0 = -pd * (xg - phi_p5) - Qb_tmp;
- if (sigVds < 0) begin
- `swap(Qp1_0, Qp5_0)
- `swap(Qp2_0, Qp4_0)
- end
- end else if (SWNQS_i == 9) begin
- phi_p1 = `Phiy(0.1);
- `PhiToQb(phi_p1,Qb_tmp)
- Qp1_0 = -pd * (xg - phi_p1) - Qb_tmp;
-
- phi_p2 = `Phiy(0.2);
- `PhiToQb(phi_p2,Qb_tmp)
- Qp2_0 = -pd * (xg - phi_p2) - Qb_tmp;
-
- phi_p3 = `Phiy(0.3);
- `PhiToQb(phi_p3,Qb_tmp)
- Qp3_0 = -pd * (xg - phi_p3) - Qb_tmp;
-
- phi_p4 = `Phiy(0.4);
- `PhiToQb(phi_p4,Qb_tmp)
- Qp4_0 = -pd * (xg - phi_p4) - Qb_tmp;
-
- phi_p5 = `Phiy(0.5);
- `PhiToQb(phi_p5,Qb_tmp)
- Qp5_0 = -pd * (xg - phi_p5) - Qb_tmp;
-
- phi_p6 = `Phiy(0.6);
- `PhiToQb(phi_p6,Qb_tmp)
- Qp6_0 = -pd * (xg - phi_p6) - Qb_tmp;
-
- phi_p7 = `Phiy(0.7);
- `PhiToQb(phi_p7,Qb_tmp)
- Qp7_0 = -pd * (xg - phi_p7) - Qb_tmp;
-
- phi_p8 = `Phiy(0.8);
- `PhiToQb(phi_p8,Qb_tmp)
- Qp8_0 = -pd * (xg - phi_p8) - Qb_tmp;
-
- phi_p9 = `Phiy(0.9);
- `PhiToQb(phi_p9,Qb_tmp)
- Qp9_0 = -pd * (xg - phi_p9) - Qb_tmp;
- if (sigVds < 0) begin
- `swap(Qp1_0, Qp9_0)
- `swap(Qp2_0, Qp8_0)
- `swap(Qp3_0, Qp7_0)
- `swap(Qp4_0, Qp6_0)
- end
- end
- end // (x_g >0)
- end // (SWNQS_i != 0)
-
- x_sp = 0.0;
- x_dp = 0.0;
- Qp0 = 0.0;
- QpN = 0.0;
- if (SWNQS_i != 0.0) begin
- x_sp = x_m - sigVds * 0.5 * dps * inv_phit1;
- x_dp = x_m + sigVds * 0.5 * dps * inv_phit1;
- Qp0 = 0.0;
- QpN = 0.0;
- if (x_sp > 0) begin
- `PhiToQb(x_sp, QbSIGN)
- Qp0 = -pd * (xg - x_sp) - QbSIGN;
- end
- if (x_dp > 0) begin
- `PhiToQb(x_dp, QbSIGN)
- QpN = -pd * (xg - x_dp) - QbSIGN;
- end
- end
diff --git a/src/spicelib/devices/adms/psp102/adms3va/PSP102_binning.include b/src/spicelib/devices/adms/psp102/adms3va/PSP102_binning.include
deleted file mode 100644
index 2c044e0ff..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/PSP102_binning.include
+++ /dev/null
@@ -1,127 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: PSP102_binning.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
- // auxiliary variables
- iLEWE = iLE * iWE;
- iiLE = LE / LEN;
- iiWE = WE / WEN;
- iiLEWE = iiLE * iiWE;
- iiiLEWE = iiWE / iiLE;
-
- // auxiliary variables for COX only
- iiLEcv = LEcv / LEN;
- iiWEcv = WEcv / WEN;
- iiLEWEcv = iiLEcv * iiWEcv;
-
- // auxiliary variables for CGOV only
- iLEcv = LEN / LEcv;
- iiiLEWEcv = iiWEcv / iiLEcv;
-
- // auxiliary variables for CGBOV only
- iiLcv = Lcv / LEN;
- iiWcv = Wcv / WEN;
- iiLWcv = iiLcv * iiWcv;
-
- // auxiliary variables for CFR only
- iLcv = LEN / Lcv;
- iiiLWcv = iiWcv / iiLcv;
-
- // Process parameters
- VFB = POVFB + iLE * PLVFB + iWE * PWVFB + iLEWE * PLWVFB;
- STVFB = POSTVFB + iLE * PLSTVFB + iWE * PWSTVFB + iLEWE * PLWSTVFB;
- TOX = POTOX;
- NEFF = PONEFF + iLE * PLNEFF + iWE * PWNEFF + iLEWE * PLWNEFF;
- VNSUB = POVNSUB;
- NSLP = PONSLP;
- DNSUB = PODNSUB;
- DPHIB = PODPHIB + iLE * PLDPHIB + iWE * PWDPHIB + iLEWE * PLWDPHIB;
- NP = PONP + iLE * PLNP + iWE * PWNP + iLEWE * PLWNP;
- CT = POCT + iLE * PLCT + iWE * PWCT + iLEWE * PLWCT;
- TOXOV = POTOXOV;
- NOV = PONOV + iLE * PLNOV + iWE * PWNOV + iLEWE * PLWNOV;
-
- // DIBL parameters
- CF = POCF + iLE * PLCF + iWE * PWCF + iLEWE * PLWCF;
- CFB = POCFB;
-
- // Mobility parameters
- BETN = POBETN + iLE * PLBETN + iiWE * PWBETN + iiiLEWE * PLWBETN;
- STBET = POSTBET + iLE * PLSTBET + iWE * PWSTBET + iLEWE * PLWSTBET;
- MUE = POMUE + iLE * PLMUE + iWE * PWMUE + iLEWE * PLWMUE;
- STMUE = POSTMUE;
- THEMU = POTHEMU;
- STTHEMU = POSTTHEMU;
- CS = POCS + iLE * PLCS + iWE * PWCS + iLEWE * PLWCS;
- STCS = POSTCS;
- XCOR = POXCOR + iLE * PLXCOR + iWE * PWXCOR + iLEWE * PLWXCOR;
- STXCOR = POSTXCOR;
- FETA = POFETA;
-
- // Series resistance parameters
- RS = PORS + iLE * PLRS + iWE * PWRS + iLEWE * PLWRS;
- STRS = POSTRS;
- RSB = PORSB;
- RSG = PORSG;
-
- // Velocity saturation parameters
- THESAT = POTHESAT + iLE * PLTHESAT + iWE * PWTHESAT + iLEWE * PLWTHESAT;
- STTHESAT = POSTTHESAT + iLE * PLSTTHESAT + iWE * PWSTTHESAT + iLEWE * PLWSTTHESAT;
- THESATB = POTHESATB + iLE * PLTHESATB + iWE * PWTHESATB + iLEWE * PLWTHESATB;
- THESATG = POTHESATG + iLE * PLTHESATG + iWE * PWTHESATG + iLEWE * PLWTHESATG;
-
- // Saturation voltage parameters
- AX = POAX + iLE * PLAX + iWE * PWAX + iLEWE * PLWAX;
-
- // Channel length modulation (CLM) parameters
- ALP = POALP + iLE * PLALP + iWE * PWALP + iLEWE * PLWALP;
- ALP1 = POALP1 + iLE * PLALP1 + iWE * PWALP1 + iLEWE * PLWALP1;
- ALP2 = POALP2 + iLE * PLALP2 + iWE * PWALP2 + iLEWE * PLWALP2;
- VP = POVP;
-
- // Impact ionization parameters
- A1 = POA1 + iLE * PLA1 + iWE * PWA1 + iLEWE * PLWA1;
- A2 = POA2;
- STA2 = POSTA2;
- A3 = POA3 + iLE * PLA3 + iWE * PWA3 + iLEWE * PLWA3;
- A4 = POA4 + iLE * PLA4 + iWE * PWA4 + iLEWE * PLWA4;
- GCO = POGCO;
-
- // Gate current parameters
- IGINV = POIGINV + iiLE * PLIGINV + iiWE * PWIGINV + iiLEWE * PLWIGINV;
- IGOV = POIGOV + iLE * PLIGOV + iiWE * PWIGOV + iiiLEWE * PLWIGOV;
- STIG = POSTIG;
- GC2 = POGC2;
- GC3 = POGC3;
- CHIB = POCHIB;
-
- // Gate-induced drain leakage (GIDL) parameters
- AGIDL = POAGIDL + iLE * PLAGIDL + iiWE * PWAGIDL + iiiLEWE * PLWAGIDL;
- BGIDL = POBGIDL;
- STBGIDL = POSTBGIDL;
- CGIDL = POCGIDL;
-
- // Charge model parameters
- COX = POCOX + iiLEcv * PLCOX + iiWEcv * PWCOX + iiLEWEcv * PLWCOX;
- CGOV = POCGOV + iLEcv * PLCGOV + iiWEcv * PWCGOV + iiiLEWEcv * PLWCGOV;
- CGBOV = POCGBOV + iiLcv * PLCGBOV + iiWcv * PWCGBOV + iiLWcv * PLWCGBOV;
- CFR = POCFR + iLcv * PLCFR + iiWcv * PWCFR + iiiLWcv * PLWCFR;
-
- // Noise model parameters
- FNT = POFNT;
- NFA = PONFA + iLE * PLNFA + iWE * PWNFA + iLEWE * PLWNFA;
- NFB = PONFB + iLE * PLNFB + iWE * PWNFB + iLEWE * PLWNFB;
- NFC = PONFC + iLE * PLNFC + iWE * PWNFC + iLEWE * PLWNFC;
diff --git a/src/spicelib/devices/adms/psp102/adms3va/PSP102_binpars.include b/src/spicelib/devices/adms/psp102/adms3va/PSP102_binpars.include
deleted file mode 100644
index 625bb1e1a..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/PSP102_binpars.include
+++ /dev/null
@@ -1,233 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: PSP102_binpars.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
- ///////////////////////////////////////////////////
- // PSP global model parameters (binning)
- ///////////////////////////////////////////////////
-
- parameter real LEVEL = 1021 `P(info="Model level" unit="" );
- parameter real TYPE = 1 `from( -1.0,1.0 ) `P(info="Channel type parameter, +1=NMOS -1=PMOS" unit="" );
- parameter real TR = 21 `from( -273.0,inf ) `P(info="nominal (reference) temperature" unit="C" );
-
- // Switch parameters
- parameter real SWIGATE = 0 `from( 0.0,1.0 ) `P(info="Flag for gate current, 0=turn off IG" unit="" );
- parameter real SWIMPACT = 0 `from( 0.0,1.0 ) `P(info="Flag for impact ionization current, 0=turn off II" unit="" );
- parameter real SWGIDL = 0 `from( 0.0,1.0 ) `P(info="Flag for GIDL current, 0=turn off IGIDL" unit="" );
- parameter real SWJUNCAP = 0 `from( 0.0,3.0 ) `P(info="Flag for juncap, 0=turn off juncap" unit="" );
- parameter real QMC = 1 `from( 0.0,inf ) `P(info="Quantum-mechanical correction factor" unit="" );
-
- // Process parameters
- parameter real LVARO = 0 `P(info="Geometry independent difference between actual and programmed poly-silicon gate length" unit="m" );
- parameter real LVARL = 0 `P(info="Length dependence of difference between actual and programmed poly-silicon gate length" unit="" );
- parameter real LAP = 0 `P(info="Effective channel length reduction per side due to lateral diffusion of source/drain dopant ions" unit="m" );
- parameter real WVARO = 0 `P(info="Geometry independent difference between actual and programmed field-oxide opening" unit="m" );
- parameter real WVARW = 0 `P(info="Width dependence of difference between actual and programmed field-oxide opening" unit="" );
- parameter real WOT = 0 `P(info="Effective reduction of channel width per side due to lateral diffusion of channel-stop dopant ions" unit="m" );
- parameter real DLQ = 0 `P(info="Effective channel length reduction for CV" unit="m" );
- parameter real DWQ = 0 `P(info="Effective channel width reduction for CV" unit="m" );
- parameter real POVFB = -1 `P(info="Coefficient for the geometry independent part of VFB" unit="V" );
- parameter real PLVFB = 0.0 `P(info="Coefficient for the length dependence of VFB" unit="V" );
- parameter real PWVFB = 0.0 `P(info="Coefficient for the width dependence of VFB" unit="V" );
- parameter real PLWVFB = 0.0 `P(info="Coefficient for the length times width dependence of VFB" unit="V" );
- parameter real POSTVFB = 0.0005 `P(info="Coefficient for the geometry independent part of STVFB" unit="V/K" );
- parameter real PLSTVFB = 0.0 `P(info="Coefficient for the length dependence of STVFB" unit="V/K" );
- parameter real PWSTVFB = 0.0 `P(info="Coefficient for the width dependence of STVFB" unit="V/K" );
- parameter real PLWSTVFB = 0.0 `P(info="Coefficient for the length times width dependence of STVFB" unit="V/K" );
- parameter real POTOX = 2E-09 `P(info="Coefficient for the geometry independent part of TOX" unit="m" );
- parameter real PONEFF = 5E+23 `P(info="Coefficient for the geometry independent part of NEFF" unit="m^-3" );
- parameter real PLNEFF = 0.0 `P(info="Coefficient for the length dependence of NEFF" unit="m^-3" );
- parameter real PWNEFF = 0.0 `P(info="Coefficient for the width dependence of NEFF" unit="m^-3" );
- parameter real PLWNEFF = 0.0 `P(info="Coefficient for the length times width dependence of NEFF" unit="m^-3" );
- parameter real POVNSUB = 0 `P(info="Coefficient for the geometry independent part of VNSUB" unit="V" );
- parameter real PONSLP = 0.05 `P(info="Coefficient for the geometry independent part of NSLP" unit="V" );
- parameter real PODNSUB = 0 `P(info="Coefficient for the geometry independent part of DNSUB" unit="V^-1" );
- parameter real PODPHIB = 0 `P(info="Coefficient for the geometry independent part of DPHIB" unit="V" );
- parameter real PLDPHIB = 0.0 `P(info="Coefficient for the length dependence of DPHIB" unit="V" );
- parameter real PWDPHIB = 0.0 `P(info="Coefficient for the width dependence of DPHIB" unit="V" );
- parameter real PLWDPHIB = 0.0 `P(info="Coefficient for the length times width dependence of DPHIB" unit="V" );
- parameter real PONP = 1E+26 `P(info="Coefficient for the geometry independent part of NP" unit="m^-3" );
- parameter real PLNP = 0.0 `P(info="Coefficient for the length dependence of NP" unit="m^-3" );
- parameter real PWNP = 0.0 `P(info="Coefficient for the width dependence of NP" unit="m^-3" );
- parameter real PLWNP = 0.0 `P(info="Coefficient for the length times width dependence of NP" unit="m^-3" );
- parameter real POCT = 0 `P(info="Coefficient for the geometry independent part of CT" unit="" );
- parameter real PLCT = 0.0 `P(info="Coefficient for the length dependence of CT" unit="" );
- parameter real PWCT = 0.0 `P(info="Coefficient for the width dependence of CT" unit="" );
- parameter real PLWCT = 0.0 `P(info="Coefficient for the length times width dependence of CT" unit="" );
- parameter real POTOXOV = 2E-09 `P(info="Coefficient for the geometry independent part of TOXOV" unit="m" );
- parameter real PONOV = 5E+25 `P(info="Coefficient for the geometry independent part of NOV" unit="m^-3" );
- parameter real PLNOV = 0.0 `P(info="Coefficient for the length dependence of NOV" unit="m^-3" );
- parameter real PWNOV = 0.0 `P(info="Coefficient for the width dependence of NOV" unit="m^-3" );
- parameter real PLWNOV = 0.0 `P(info="Coefficient for the length times width dependence of NOV" unit="m^-3" );
-
- // DIBL parameters
- parameter real POCF = 0 `P(info="Coefficient for the geometry independent part of CF" unit="V^-1" );
- parameter real PLCF = 0.0 `P(info="Coefficient for the length dependence of CF" unit="V^-1" );
- parameter real PWCF = 0.0 `P(info="Coefficient for the width dependence of CF" unit="V^-1" );
- parameter real PLWCF = 0.0 `P(info="Coefficient for the length times width dependence of CF" unit="V^-1" );
- parameter real POCFB = 0 `P(info="Coefficient for the geometry independent part of CFB" unit="V^-1" );
-
- // Mobility parameters
- parameter real POBETN = 0.07 `P(info="Coefficient for the geometry independent part of BETN" unit="m^2/V/s" );
- parameter real PLBETN = 0.0 `P(info="Coefficient for the length dependence of BETN" unit="m^2/V/s" );
- parameter real PWBETN = 0.0 `P(info="Coefficient for the width dependence of BETN" unit="m^2/V/s" );
- parameter real PLWBETN = 0.0 `P(info="Coefficient for the length times width dependence of BETN" unit="m^2/V/s" );
- parameter real POSTBET = 1 `P(info="Coefficient for the geometry independent part of STBET" unit="" );
- parameter real PLSTBET = 0.0 `P(info="Coefficient for the length dependence of STBET" unit="" );
- parameter real PWSTBET = 0.0 `P(info="Coefficient for the width dependence of STBET" unit="" );
- parameter real PLWSTBET = 0.0 `P(info="Coefficient for the length times width dependence of STBET" unit="" );
- parameter real POMUE = 0.5 `P(info="Coefficient for the geometry independent part of MUE" unit="m/V" );
- parameter real PLMUE = 0.0 `P(info="Coefficient for the length dependence of MUE" unit="m/V" );
- parameter real PWMUE = 0.0 `P(info="Coefficient for the width dependence of MUE" unit="m/V" );
- parameter real PLWMUE = 0.0 `P(info="Coefficient for the length times width dependence of MUE" unit="m/V" );
- parameter real POSTMUE = 0 `P(info="Coefficient for the geometry independent part of STMUE" unit="" );
- parameter real POTHEMU = 1.5 `P(info="Coefficient for the geometry independent part of THEMU" unit="" );
- parameter real POSTTHEMU = 1.5 `P(info="Coefficient for the geometry independent part of STTHEMU" unit="" );
- parameter real POCS = 0 `P(info="Coefficient for the geometry independent part of CS" unit="" );
- parameter real PLCS = 0.0 `P(info="Coefficient for the length dependence of CS" unit="" );
- parameter real PWCS = 0.0 `P(info="Coefficient for the width dependence of CS" unit="" );
- parameter real PLWCS = 0.0 `P(info="Coefficient for the length times width dependence of CS" unit="" );
- parameter real POSTCS = 0 `P(info="Coefficient for the geometry independent part of STCS" unit="" );
- parameter real POXCOR = 0 `P(info="Coefficient for the geometry independent part of XCOR" unit="V^-1" );
- parameter real PLXCOR = 0.0 `P(info="Coefficient for the length dependence of XCOR" unit="V^-1" );
- parameter real PWXCOR = 0.0 `P(info="Coefficient for the width dependence of XCOR" unit="V^-1" );
- parameter real PLWXCOR = 0.0 `P(info="Coefficient for the length times width dependence of XCOR" unit="V^-1" );
- parameter real POSTXCOR = 0 `P(info="Coefficient for the geometry independent part of STXCOR" unit="" );
- parameter real POFETA = 1 `P(info="Coefficient for the geometry independent part of FETA" unit="" );
-
- // Series resistance parameters
- parameter real PORS = 30 `P(info="Coefficient for the geometry independent part of RS" unit="Ohm" );
- parameter real PLRS = 0.0 `P(info="Coefficient for the length dependence of RS" unit="Ohm" );
- parameter real PWRS = 0.0 `P(info="Coefficient for the width dependence of RS" unit="Ohm" );
- parameter real PLWRS = 0.0 `P(info="Coefficient for the length times width dependence of RS" unit="Ohm" );
- parameter real POSTRS = 1 `P(info="Coefficient for the geometry independent part of STRS" unit="" );
- parameter real PORSB = 0 `P(info="Coefficient for the geometry independent part of RSB" unit="V^-1" );
- parameter real PORSG = 0 `P(info="Coefficient for the geometry independent part of RSG" unit="V^-1" );
-
- // Velocity saturation parameters
- parameter real POTHESAT = 1 `P(info="Coefficient for the geometry independent part of THESAT" unit="V^-1" );
- parameter real PLTHESAT = 0.0 `P(info="Coefficient for the length dependence of THESAT" unit="V^-1" );
- parameter real PWTHESAT = 0.0 `P(info="Coefficient for the width dependence of THESAT" unit="V^-1" );
- parameter real PLWTHESAT = 0.0 `P(info="Coefficient for the length times width dependence of THESAT" unit="V^-1" );
- parameter real POSTTHESAT = 1 `P(info="Coefficient for the geometry independent part of STTHESAT" unit="" );
- parameter real PLSTTHESAT = 0.0 `P(info="Coefficient for the length dependence of STTHESAT" unit="" );
- parameter real PWSTTHESAT = 0.0 `P(info="Coefficient for the width dependence of STTHESAT" unit="" );
- parameter real PLWSTTHESAT = 0.0 `P(info="Coefficient for the length times width dependence of STTHESAT" unit="" );
- parameter real POTHESATB = 0 `P(info="Coefficient for the geometry independent part of THESATB" unit="V^-1" );
- parameter real PLTHESATB = 0.0 `P(info="Coefficient for the length dependence of THESATB" unit="V^-1" );
- parameter real PWTHESATB = 0.0 `P(info="Coefficient for the width dependence of THESATB" unit="V^-1" );
- parameter real PLWTHESATB = 0.0 `P(info="Coefficient for the length times width dependence of THESATB" unit="V^-1" );
- parameter real POTHESATG = 0 `P(info="Coefficient for the geometry independent part of THESATG" unit="V^-1" );
- parameter real PLTHESATG = 0.0 `P(info="Coefficient for the length dependence of THESATG" unit="V^-1" );
- parameter real PWTHESATG = 0.0 `P(info="Coefficient for the width dependence of THESATG" unit="V^-1" );
- parameter real PLWTHESATG = 0.0 `P(info="Coefficient for the length times width dependence of THESATG" unit="V^-1" );
-
- // Saturation voltage parameters
- parameter real POAX = 3 `P(info="Coefficient for the geometry independent part of AX" unit="" );
- parameter real PLAX = 0.0 `P(info="Coefficient for the length dependence of AX" unit="" );
- parameter real PWAX = 0.0 `P(info="Coefficient for the width dependence of AX" unit="" );
- parameter real PLWAX = 0.0 `P(info="Coefficient for the length times width dependence of AX" unit="" );
-
- // Channel length modulation (CLM) parameters
- parameter real POALP = 0.01 `P(info="Coefficient for the geometry independent part of ALP" unit="" );
- parameter real PLALP = 0.0 `P(info="Coefficient for the length dependence of ALP" unit="" );
- parameter real PWALP = 0.0 `P(info="Coefficient for the width dependence of ALP" unit="" );
- parameter real PLWALP = 0.0 `P(info="Coefficient for the length times width dependence of ALP" unit="" );
- parameter real POALP1 = 0 `P(info="Coefficient for the geometry independent part of ALP1" unit="V" );
- parameter real PLALP1 = 0.0 `P(info="Coefficient for the length dependence of ALP1" unit="V" );
- parameter real PWALP1 = 0.0 `P(info="Coefficient for the width dependence of ALP1" unit="V" );
- parameter real PLWALP1 = 0.0 `P(info="Coefficient for the length times width dependence of ALP1" unit="V" );
- parameter real POALP2 = 0 `P(info="Coefficient for the geometry independent part of ALP2" unit="V^-1" );
- parameter real PLALP2 = 0.0 `P(info="Coefficient for the length dependence of ALP2" unit="V^-1" );
- parameter real PWALP2 = 0.0 `P(info="Coefficient for the width dependence of ALP2" unit="V^-1" );
- parameter real PLWALP2 = 0.0 `P(info="Coefficient for the length times width dependence of ALP2" unit="V^-1" );
- parameter real POVP = 0.05 `P(info="Coefficient for the geometry independent part of VP" unit="V" );
-
- // Impact ionization parameters
- parameter real POA1 = 1 `P(info="Coefficient for the geometry independent part of A1" unit="" );
- parameter real PLA1 = 0.0 `P(info="Coefficient for the length dependence of A1" unit="" );
- parameter real PWA1 = 0.0 `P(info="Coefficient for the width dependence of A1" unit="" );
- parameter real PLWA1 = 0.0 `P(info="Coefficient for the length times width dependence of A1" unit="" );
- parameter real POA2 = 10 `P(info="Coefficient for the geometry independent part of A2" unit="V" );
- parameter real POSTA2 = 0 `P(info="Coefficient for the geometry independent part of STA2" unit="V" );
- parameter real POA3 = 1 `P(info="Coefficient for the geometry independent part of A3" unit="" );
- parameter real PLA3 = 0.0 `P(info="Coefficient for the length dependence of A3" unit="" );
- parameter real PWA3 = 0.0 `P(info="Coefficient for the width dependence of A3" unit="" );
- parameter real PLWA3 = 0.0 `P(info="Coefficient for the length times width dependence of A3" unit="" );
- parameter real POA4 = 0 `P(info="Coefficient for the geometry independent part of A4" unit="V^-0.5" );
- parameter real PLA4 = 0.0 `P(info="Coefficient for the length dependence of A4" unit="V^-0.5" );
- parameter real PWA4 = 0.0 `P(info="Coefficient for the width dependence of A4" unit="V^-0.5" );
- parameter real PLWA4 = 0.0 `P(info="Coefficient for the length times width dependence of A4" unit="V^-0.5" );
- parameter real POGCO = 0 `P(info="Coefficient for the geometry independent part of GCO" unit="" );
-
- // Gate current parameters
- parameter real POIGINV = 0 `P(info="Coefficient for the geometry independent part of IGINV" unit="A" );
- parameter real PLIGINV = 0.0 `P(info="Coefficient for the length dependence of IGINV" unit="A" );
- parameter real PWIGINV = 0.0 `P(info="Coefficient for the width dependence of IGINV" unit="A" );
- parameter real PLWIGINV = 0.0 `P(info="Coefficient for the length times width dependence of IGINV" unit="A" );
- parameter real POIGOV = 0 `P(info="Coefficient for the geometry independent part of IGOV" unit="A" );
- parameter real PLIGOV = 0.0 `P(info="Coefficient for the length dependence of IGOV" unit="A" );
- parameter real PWIGOV = 0.0 `P(info="Coefficient for the width dependence of IGOV" unit="A" );
- parameter real PLWIGOV = 0.0 `P(info="Coefficient for the length times width dependence of IGOV" unit="A" );
- parameter real POSTIG = 2 `P(info="Coefficient for the geometry independent part of STIG" unit="" );
- parameter real POGC2 = 0.375 `P(info="Coefficient for the geometry independent part of GC2" unit="" );
- parameter real POGC3 = 0.063 `P(info="Coefficient for the geometry independent part of GC3" unit="" );
- parameter real POCHIB = 3.1 `P(info="Coefficient for the geometry independent part of CHIB" unit="V" );
-
- // Gate-induced drain leakage (GIDL) parameters
- parameter real POAGIDL = 0 `P(info="Coefficient for the geometry independent part of AGIDL" unit="A/V^3" );
- parameter real PLAGIDL = 0.0 `P(info="Coefficient for the length dependence of AGIDL" unit="A/V^3" );
- parameter real PWAGIDL = 0.0 `P(info="Coefficient for the width dependence of AGIDL" unit="A/V^3" );
- parameter real PLWAGIDL = 0.0 `P(info="Coefficient for the length times width dependence of AGIDL" unit="A/V^3" );
- parameter real POBGIDL = 41 `P(info="Coefficient for the geometry independent part of BGIDL" unit="V" );
- parameter real POSTBGIDL = 0 `P(info="Coefficient for the geometry independent part of STBGIDL" unit="V/K" );
- parameter real POCGIDL = 0 `P(info="Coefficient for the geometry independent part of CGIDL" unit="" );
-
- // Charge model parameters
- parameter real POCOX = 1E-14 `P(info="Coefficient for the geometry independent part of COX" unit="F" );
- parameter real PLCOX = 0.0 `P(info="Coefficient for the length dependence of COX" unit="F" );
- parameter real PWCOX = 0.0 `P(info="Coefficient for the width dependence of COX" unit="F" );
- parameter real PLWCOX = 0.0 `P(info="Coefficient for the length times width dependence of COX" unit="F" );
- parameter real POCGOV = 1E-15 `P(info="Coefficient for the geometry independent part of CGOV" unit="F" );
- parameter real PLCGOV = 0.0 `P(info="Coefficient for the length dependence of CGOV" unit="F" );
- parameter real PWCGOV = 0.0 `P(info="Coefficient for the width dependence of CGOV" unit="F" );
- parameter real PLWCGOV = 0.0 `P(info="Coefficient for the length times width dependence of CGOV" unit="F" );
- parameter real POCGBOV = 0 `P(info="Coefficient for the geometry independent part of CGBOV" unit="F" );
- parameter real PLCGBOV = 0.0 `P(info="Coefficient for the length dependence of CGBOV" unit="F" );
- parameter real PWCGBOV = 0.0 `P(info="Coefficient for the width dependence of CGBOV" unit="F" );
- parameter real PLWCGBOV = 0.0 `P(info="Coefficient for the length times width dependence of CGBOV" unit="F" );
- parameter real POCFR = 0 `P(info="Coefficient for the geometry independent part of CFR" unit="F" );
- parameter real PLCFR = 0.0 `P(info="Coefficient for the length dependence of CFR" unit="F" );
- parameter real PWCFR = 0.0 `P(info="Coefficient for the width dependence of CFR" unit="F" );
- parameter real PLWCFR = 0.0 `P(info="Coefficient for the length times width dependence of CFR" unit="F" );
-
- // Noise model parameters
- parameter real POFNT = 1 `P(info="Coefficient for the geometry independent part of FNT" unit="" );
- parameter real PONFA = 8E+22 `P(info="Coefficient for the geometry independent part of NFA" unit="V^-1/m^4" );
- parameter real PLNFA = 0.0 `P(info="Coefficient for the length dependence of NFA" unit="V^-1/m^4" );
- parameter real PWNFA = 0.0 `P(info="Coefficient for the width dependence of NFA" unit="V^-1/m^4" );
- parameter real PLWNFA = 0.0 `P(info="Coefficient for the length times width dependence of NFA" unit="V^-1/m^4" );
- parameter real PONFB = 3E+07 `P(info="Coefficient for the geometry independent part of NFB" unit="V^-1/m^2" );
- parameter real PLNFB = 0.0 `P(info="Coefficient for the length dependence of NFB" unit="V^-1/m^2" );
- parameter real PWNFB = 0.0 `P(info="Coefficient for the width dependence of NFB" unit="V^-1/m^2" );
- parameter real PLWNFB = 0.0 `P(info="Coefficient for the length times width dependence of NFB" unit="V^-1/m^2" );
- parameter real PONFC = 0 `P(info="Coefficient for the geometry independent part of NFC" unit="V^-1" );
- parameter real PLNFC = 0.0 `P(info="Coefficient for the length dependence of NFC" unit="V^-1" );
- parameter real PWNFC = 0.0 `P(info="Coefficient for the width dependence of NFC" unit="V^-1" );
- parameter real PLWNFC = 0.0 `P(info="Coefficient for the length times width dependence of NFC" unit="V^-1" );
-
- // Other parameters
- parameter real DTA = 0 `P(info="Temperature offset w.r.t. ambient temperature" unit="K" );
diff --git a/src/spicelib/devices/adms/psp102/adms3va/PSP102_macrodefs.include b/src/spicelib/devices/adms/psp102/adms3va/PSP102_macrodefs.include
deleted file mode 100644
index f9e443db7..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/PSP102_macrodefs.include
+++ /dev/null
@@ -1,250 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: PSP102_macrodefs.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
-
-/////////////////////////////////////////////
-//
-// Macros and constants used in PSP
-//
-/////////////////////////////////////////////
-
-// Explicit Gmin
-`define GMIN 1E-15
-
-`define PMOS -1
-`define NMOS +1
-
-// Some functions
-`define MINA(x,y,a) 0.5*((x)+(y)-sqrt(((x)-(y))*((x)-(y))+(a)))
-`define MAXA(x,y,a) 0.5*((x)+(y)+sqrt(((x)-(y))*((x)-(y))+(a)))
-
-// Physical constants
-`define EPSOX 3.453E-11
-`define QMN 5.951993
-`define QMP 7.448711
-
-// Other constants (PSP-mos)
-`define DELTA1 0.02
-`define invSqrt2 7.0710678118654746e-01
-`define oneSixth 1.6666666666666667e-01
-`define exp80 5.5406223843935098e+34
-`define exp160 3.0698496406442424e+69
-
-`ifdef NQSmodel
- `define Gint GP
- `define Bint BP
- `define Bjs BS
- `define Bjd BD
-`else // NQSmodel
- `define Gint G
- `define Bint B
- `define Bjs B
- `define Bjd B
-`endif // NQSModel
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Macro definitions.
-//
-// Note that because at present locally scoped variables
-// can only be in named blocks, the intermediate variables
-// used in the macros below must be explicitly declared
-// as variables in the main code.
-//
-/////////////////////////////////////////////////////////////////////////////
-
-
-// sigma function used in surface potential and other calculations
-// (one call uses expressions for arguments so parentheses
-// around the arguments in the expressions are necessary)
-`define sigma(a,c,tau,eta,y) \
-nu = (a) + (c); \
-mu = nu * nu / (tau) + 0.5 * ((c) * (c)) - (a); \
-y = (eta) + (a) * nu / (mu + (nu / mu) * (c) * ((c) * (c) * `oneThird - (a)));
-
-
-// modified version of sigma, which takes 4 arguments
-`define sigma2(a,b,c,tau,eta,y) \
-nu = (a) + (c); \
-if (abs(tau) < 1e-120) begin /*sometimes tau is extremely small...*/\
- y = (eta); \
-end else begin \
- mu = (nu) * (nu) / (tau) + 0.5 * ((c) * (c)) - (a) * (b); \
- y = (eta) + (a) * nu / (mu + (nu / mu) * (c) * ((c) * (c) * `oneThird - (a) * (b))); \
-end
-
-//
-// sp_s surface potential calculation
-//
-`define sp_s(sp,xg,xn,delta) \
-if (abs(xg) <= margin) begin \
- SP_S_temp1 = inv_xi * inv_xi * `oneSixth * `invSqrt2; \
- sp = xg * inv_xi * (1.0 + xg * (1.0 - (delta)) * Gf * SP_S_temp1); \
-end else begin \
- if (xg < -margin) begin \
- SP_S_yg = -xg; \
- SP_S_ysub = 1.25 * (SP_S_yg * inv_xi); \
- SP_S_eta = 0.5 * (SP_S_ysub + 10 - sqrt((SP_S_ysub - 6.0) * (SP_S_ysub - 6.0) + 64.0)); \
- SP_S_temp = SP_S_yg - SP_S_eta; \
- SP_S_a = SP_S_temp * SP_S_temp + Gf2*(SP_S_eta + 1.0);\
- SP_S_c = 2.0 * SP_S_temp - Gf2; \
- SP_S_tau = -SP_S_eta + ln(SP_S_a * inv_Gf2); \
- `sigma(SP_S_a, SP_S_c, SP_S_tau, SP_S_eta, SP_S_y0) \
- `expl_high(SP_S_y0, SP_S_delta0) \
- SP_S_delta1 = 1.0 / SP_S_delta0; \
- SP_S_temp = 1.0 / (2.0 + SP_S_y0 * SP_S_y0); \
- SP_S_xi0 = SP_S_y0 * SP_S_y0 * SP_S_temp; \
- SP_S_xi1 = 4.0 * (SP_S_y0 * SP_S_temp * SP_S_temp); \
- SP_S_xi2 = (8.0 * SP_S_temp - 12.0 * SP_S_xi0) * SP_S_temp * SP_S_temp; \
- SP_S_temp = SP_S_yg - SP_S_y0; \
- SP_S_temp1 = (delta) * SP_S_delta1; \
- SP_S_pC = 2.0 * SP_S_temp + Gf2 * (SP_S_delta0 - 1.0 - SP_S_temp1 + (delta) * (1.0 - SP_S_xi1)); \
- SP_S_qC = SP_S_temp * SP_S_temp - Gf2 * (SP_S_delta0 - SP_S_y0 - 1.0 + SP_S_temp1 + (delta) * (SP_S_y0 - 1.0 - SP_S_xi0)); \
- SP_S_temp = 2.0 - Gf2 * (SP_S_delta0 + SP_S_temp1 - (delta) * SP_S_xi2); \
- SP_S_temp = SP_S_pC * SP_S_pC - 2.0 * (SP_S_qC * SP_S_temp); \
- sp = -SP_S_y0 - 2.0 * (SP_S_qC / (SP_S_pC + sqrt(SP_S_temp))); \
- end else begin \
- SP_xg1 = 1.0 / (x1 + Gf * 7.324648775608221e-001); \
- SP_S_A_fac= (xi * x1 * SP_xg1 - 1.0) * SP_xg1; \
- SP_S_xbar = xg * inv_xi * (1.0 + SP_S_A_fac * xg); \
- `expl_low(-SP_S_xbar, SP_S_temp) \
- SP_S_w = 1.0 - SP_S_temp; \
- SP_S_x1 = xg + Gf2 * 0.5 - Gf * sqrt(xg + Gf2 * 0.25 - SP_S_w); \
- SP_S_bx = (xn) + 3.0; \
- SP_S_eta = `MINA(SP_S_x1, SP_S_bx, 5.0) - 0.5 * (SP_S_bx - sqrt(SP_S_bx * SP_S_bx + 5.0)); \
- SP_S_temp = xg - SP_S_eta; \
- SP_S_temp1= exp(-SP_S_eta); \
- SP_S_temp2= 1.0 / (2.0 + SP_S_eta * SP_S_eta); \
- SP_S_xi0 = SP_S_eta * SP_S_eta * SP_S_temp2; \
- SP_S_xi1 = 4.0 * (SP_S_eta * SP_S_temp2 * SP_S_temp2); \
- SP_S_xi2 = (8.0 * SP_S_temp2 - 12.0 * SP_S_xi0) * SP_S_temp2 * SP_S_temp2; \
- SP_S_a = max(1.0e-40, SP_S_temp * SP_S_temp - Gf2 * (SP_S_temp1 + SP_S_eta - 1.0 - (delta) * (SP_S_eta + 1.0 + SP_S_xi0))); \
- SP_S_b = 1.0 - 0.5 * (Gf2 * (SP_S_temp1 - (delta) * SP_S_xi2)); \
- SP_S_c = 2.0 * SP_S_temp + Gf2 * (1.0 - SP_S_temp1 - (delta) * (1.0 + SP_S_xi1)); \
- SP_S_tau = (xn) - SP_S_eta + ln(SP_S_a / Gf2); \
- `sigma2(SP_S_a, SP_S_b, SP_S_c, SP_S_tau, SP_S_eta, SP_S_x0) \
- if (SP_S_x0 < `se05) begin \
- SP_S_delta0 = exp(SP_S_x0); \
- SP_S_delta1 = 1.0 / SP_S_delta0; \
- SP_S_delta0 = (delta) * SP_S_delta0; \
- end else begin \
- if (SP_S_x0 > (xn) - `se05) begin \
- SP_S_delta0 = exp(SP_S_x0 - (xn)); \
- SP_S_delta1 = (delta) / SP_S_delta0; \
- end else begin \
- SP_S_delta0 = `ke05 / `P3((xn) - SP_S_x0 - `se05); \
- SP_S_delta1 = `ke05 / `P3(SP_S_x0 - `se05); \
- end \
- end \
- SP_S_temp = 1.0 / (2.0 + SP_S_x0 * SP_S_x0); \
- SP_S_xi0 = SP_S_x0 * SP_S_x0 * SP_S_temp; \
- SP_S_xi1 = 4.0 * (SP_S_x0 * SP_S_temp * SP_S_temp); \
- SP_S_xi2 = (8.0 * SP_S_temp - 12.0 * SP_S_xi0) * SP_S_temp * SP_S_temp; \
- SP_S_temp = xg - SP_S_x0; \
- SP_S_pC = 2.0 * SP_S_temp + Gf2 * (1.0 - SP_S_delta1 + SP_S_delta0 - (delta) * (1.0 + SP_S_xi1)); \
- SP_S_qC = SP_S_temp * SP_S_temp - Gf2 * (SP_S_delta1 + SP_S_x0 - 1.0 + SP_S_delta0 - (delta) * (SP_S_x0 + 1.0 + SP_S_xi0)); \
- SP_S_temp = 2.0 - Gf2 * (SP_S_delta1 + SP_S_delta0 - (delta) * SP_S_xi2); \
- SP_S_temp = SP_S_pC * SP_S_pC - 2.0 * (SP_S_qC * SP_S_temp); \
- sp = SP_S_x0 + 2.0 * (SP_S_qC / (SP_S_pC + sqrt(SP_S_temp))); \
- end \
-end
-
-//
-// sp_s_d surface potential calculation at drain (subset of function sp_s)
-//
-`define sp_s_d(sp,xg,xn,delta) \
-if (abs(xg) <= margin) begin \
- SP_S_temp1 = inv_xi * inv_xi * `oneSixth * `invSqrt2; \
- sp = xg * inv_xi * (1.0 + xg * (1.0 - (delta)) * Gf * SP_S_temp1); \
-end else begin \
- SP_S_bx = (xn) + 3; \
- SP_S_eta = `MINA(SP_S_x1, SP_S_bx, 5.0) - 0.5 * (SP_S_bx - sqrt(SP_S_bx * SP_S_bx + 5.0)); \
- SP_S_temp = xg - SP_S_eta; \
- SP_S_temp1= exp(-SP_S_eta); \
- SP_S_temp2= 1.0 / (2.0 + SP_S_eta * SP_S_eta); \
- SP_S_xi0 = SP_S_eta * SP_S_eta * SP_S_temp2; \
- SP_S_xi1 = 4.0 * (SP_S_eta * SP_S_temp2 * SP_S_temp2); \
- SP_S_xi2 = (8.0 * SP_S_temp2 - 12.0 * SP_S_xi0) * SP_S_temp2 * SP_S_temp2; \
- SP_S_a = max(1.0e-40, SP_S_temp * SP_S_temp - Gf2 * (SP_S_temp1 + SP_S_eta - 1.0 - (delta) * (SP_S_eta + 1.0 + SP_S_xi0))); \
- SP_S_b = 1.0 - 0.5 * (Gf2 * (SP_S_temp1 - (delta) * SP_S_xi2)); \
- SP_S_c = 2.0 * SP_S_temp + Gf2 * (1.0 - SP_S_temp1 - (delta) * (1.0 + SP_S_xi1)); \
- SP_S_tau = (xn) - SP_S_eta + ln(SP_S_a / Gf2); \
- `sigma2(SP_S_a, SP_S_b, SP_S_c, SP_S_tau, SP_S_eta, SP_S_x0) \
- if (SP_S_x0 < `se05) begin \
- SP_S_delta0 = exp(SP_S_x0); \
- SP_S_delta1 = 1.0 / SP_S_delta0; \
- SP_S_delta0 = (delta) * SP_S_delta0; \
- end else begin \
- if (SP_S_x0 > (xn) - `se05) begin \
- SP_S_delta0 = exp(SP_S_x0 - (xn)); \
- SP_S_delta1 = (delta) / SP_S_delta0; \
- end else begin \
- SP_S_delta0 = `ke05 / `P3((xn) - SP_S_x0 - `se05); \
- SP_S_delta1 = `ke05 / `P3(SP_S_x0 - `se05); \
- end \
- end \
- SP_S_temp = 1.0 / (2.0 + SP_S_x0 * SP_S_x0); \
- SP_S_xi0 = SP_S_x0 * SP_S_x0 * SP_S_temp; \
- SP_S_xi1 = 4.0 * (SP_S_x0 * SP_S_temp * SP_S_temp); \
- SP_S_xi2 = (8.0 * SP_S_temp-12.0 * SP_S_xi0) * SP_S_temp * SP_S_temp; \
- SP_S_temp = xg - SP_S_x0; \
- SP_S_pC = 2.0 * SP_S_temp + Gf2 * (1.0 - SP_S_delta1 + SP_S_delta0 - (delta) * (1.0 + SP_S_xi1)); \
- SP_S_qC = SP_S_temp * SP_S_temp - Gf2 * (SP_S_delta1 + SP_S_x0 - 1.0 + SP_S_delta0 - (delta) * (SP_S_x0 + 1.0 + SP_S_xi0)); \
- SP_S_temp = 2.0 - Gf2*(SP_S_delta1+SP_S_delta0-(delta)*SP_S_xi2); \
- SP_S_temp = SP_S_pC * SP_S_pC - 2.0 * (SP_S_qC * SP_S_temp); \
- sp = SP_S_x0 + 2.0 * (SP_S_qC / (SP_S_pC + sqrt(SP_S_temp)));\
-end
-
-//
-// sp_ov surface potential calculation for the overlap regions
-//
-`define sp_ov(sp,xg) \
-if (abs(xg) <= x_mrg_ov) begin \
- sp = (-(xg) * inv_xi_ov); \
-end else begin \
- if (xg < -x_mrg_ov) begin \
- SP_OV_yg = -xg; \
- SP_OV_z = x1 * SP_OV_yg * inv_xi_ov; \
- SP_OV_eta = 0.5 * (SP_OV_z + 10.0 - sqrt((SP_OV_z - 6.0) * (SP_OV_z - 6.0) + 64.0)); \
- SP_OV_a = (SP_OV_yg - SP_OV_eta) * (SP_OV_yg - SP_OV_eta) + GOV2 * (SP_OV_eta + 1.0); \
- SP_OV_c = 2.0 * (SP_OV_yg - SP_OV_eta) - GOV2; \
- SP_OV_tau = ln(SP_OV_a / GOV2) - SP_OV_eta; \
- `sigma(SP_OV_a, SP_OV_c, SP_OV_tau, SP_OV_eta, SP_OV_y0) \
- SP_OV_D0 = exp(SP_OV_y0); \
- SP_OV_temp = SP_OV_yg - SP_OV_y0; \
- SP_OV_p = 2.0 * SP_OV_temp + GOV2 * (SP_OV_D0 - 1.0); \
- SP_OV_q = SP_OV_temp * SP_OV_temp + GOV2 * (SP_OV_y0 + 1.0 - SP_OV_D0); \
- SP_OV_xi = 1.0 - GOV2 * 0.5 * SP_OV_D0; \
- SP_OV_temp = SP_OV_p * SP_OV_p - 4.0 * (SP_OV_xi * SP_OV_q); \
- SP_OV_w = 2.0 * (SP_OV_q / (SP_OV_p + sqrt(SP_OV_temp))); \
- sp = -(SP_OV_y0 + SP_OV_w); \
- end else begin \
- SP_OV_Afac = (xi_ov * x1 * inv_xg1 - 1.0) * inv_xg1; \
- SP_OV_xbar = xg * inv_xi_ov * (1.0 + SP_OV_Afac * xg); \
- `expl_low(-SP_OV_xbar, SP_OV_temp) \
- SP_OV_w = 1.0 - SP_OV_temp; \
- SP_OV_x0 = xg + GOV2 * 0.5 - GOV * sqrt(xg + GOV2 * 0.25 - SP_OV_w); \
- `expl_low(-SP_OV_x0, SP_OV_D0) \
- SP_OV_p = 2.0 * (xg - SP_OV_x0) + GOV2 * (1 - SP_OV_D0); \
- SP_OV_q = (xg - SP_OV_x0) * (xg - SP_OV_x0) - GOV2 * (SP_OV_x0 - 1.0 + SP_OV_D0); \
- SP_OV_xi = 1.0 - GOV2 * 0.5 * SP_OV_D0; \
- SP_OV_temp = SP_OV_p * SP_OV_p - 4.0 * (SP_OV_xi * SP_OV_q); \
- SP_OV_u = 2.0 * (SP_OV_q / (SP_OV_p + sqrt(SP_OV_temp))); \
- sp = SP_OV_x0 + SP_OV_u; \
- end \
- sp = -sp; \
-end
diff --git a/src/spicelib/devices/adms/psp102/adms3va/PSP102_module.include b/src/spicelib/devices/adms/psp102/adms3va/PSP102_module.include
deleted file mode 100644
index f1756a185..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/PSP102_module.include
+++ /dev/null
@@ -1,2358 +0,0 @@
-`undef P
-`define P(txt) (*txt*)
-//======================================================================================
-//======================================================================================
-// Filename: PSP102_module.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
- // Node definitions
- inout D, G, S, B;
- electrical D;
- electrical G;
- electrical S;
- electrical B;
-
- // Extra internal nodes for correlated drain and gate noise
- electrical NOI;
- electrical NOI2;
-
- // Extra branches for correlated drain and gate noise
- branch (NOI) NOII;
- branch (NOI) NOIR;
- branch (NOI) NOIC;
-
-`ifdef NQSmodel
- // Internal nodes for gate and bulk resistors
- electrical GP;
- electrical BP;
- electrical BI;
- electrical BS;
- electrical BD;
-
- // Internal nodes for spline collocation
- electrical INT1;
- electrical INT2;
- electrical INT3;
- electrical INT4;
- electrical INT5;
- electrical INT6;
- electrical INT7;
- electrical INT8;
- electrical INT9;
-
- branch(INT1) SPLINE1;
- branch(INT2) SPLINE2;
- branch(INT3) SPLINE3;
- branch(INT4) SPLINE4;
- branch(INT5) SPLINE5;
- branch(INT6) SPLINE6;
- branch(INT7) SPLINE7;
- branch(INT8) SPLINE8;
- branch(INT9) SPLINE9;
-
- branch(INT1) RES1;
- branch(INT2) RES2;
- branch(INT3) RES3;
- branch(INT4) RES4;
- branch(INT5) RES5;
- branch(INT6) RES6;
- branch(INT7) RES7;
- branch(INT8) RES8;
- branch(INT9) RES9;
-
-`endif // NQSmodel
-
- //////////////////////////
- //
- // Model parameters
- //
- //////////////////////////
-
-`ifdef LocalModel
- ///////////////////////////////////////////////////
- // PSP local model parameters
- ///////////////////////////////////////////////////
-
- // Special model parameters, some are also simulator global variables
- (*info="Model level", unit="" *) parameter real LEVEL = 102 ;
- (*info="Channel type parameter, +1=NMOS -1=PMOS", unit="" *) parameter real TYPE = 1.0 `from( -1.0,1.0 );
- (*info="nominal (reference) temperature", unit="C" *) parameter real TR = 21.0 `from( -273.0,inf );
-
- // Switch parameters that turn models or effects on or off
- (*info="Flag for gate current, 0=turn off IG", unit="" *) parameter real SWIGATE = 0.0 `from( 0.0,1.0 );
- (*info="Flag for impact ionization current, 0=turn off II", unit="" *) parameter real SWIMPACT = 0.0 `from( 0.0,1.0 );
- (*info="Flag for GIDL current, 0=turn off IGIDL", unit="" *) parameter real SWGIDL = 0.0 `from( 0.0,1.0 );
- (*info="Flag for juncap, 0=turn off juncap", unit="" *) parameter real SWJUNCAP = 0.0 `from( 0.0,3.0 );
- (*info="Quantum-mechanical correction factor", unit="" *) parameter real QMC = 1.0 `from( 0.0,inf );
-
- // Process parameters
- (*info="Flatband voltage at TR", unit="V" *) parameter real VFB = -1.0 ;
- (*info="Temperature dependence of VFB", unit="V/K" *) parameter real STVFB = 5.0e-4 ;
- (*info="Gate oxide thickness", unit="m" *) parameter real TOX = 2.0e-09 `from( 1e-10,inf );
- (*info="Effective substrate doping", unit="m^-3" *) parameter real NEFF = 5.0e+23 `from( 1e20,1e26 );
- (*info="Effective doping bias-dependence parameter", unit="V" *) parameter real VNSUB = 0.0 ;
- (*info="Effective doping bias-dependence parameter", unit="V" *) parameter real NSLP = 0.05 `from( 1e-3,inf );
- (*info="Effective doping bias-dependence parameter", unit="V^-1" *) parameter real DNSUB = 0.0 `from( 0.0,1.0 );
- (*info="Offset parameter for PHIB", unit="V" *) parameter real DPHIB = 0.0 ;
- (*info="Gate poly-silicon doping", unit="m^-3" *) parameter real NP = 1.0e+26 `from( 0.0,inf );
- (*info="Interface states factor", unit="" *) parameter real CT = 0.0 `from( 0.0,inf );
- (*info="Overlap oxide thickness", unit="m" *) parameter real TOXOV = 2.0e-09 `from( 1e-10,inf );
- (*info="Effective doping of overlap region", unit="m^-3" *) parameter real NOV = 5.0e+25 `from( 1e20,1e27 );
-
- // DIBL parameters
- (*info="DIBL-parameter", unit="V^-1" *) parameter real CF = 0.0 `from( 0.0,inf );
- (*info="Back bias dependence of CF", unit="V^-1" *) parameter real CFB = 0.0 `from( 0.0,1.0 );
-
- // Mobility parameters
- (*info="Channel aspect ratio times zero-field mobility", unit="m^2/V/s" *) parameter real BETN = 7e-2 `from( 0.0,inf );
- (*info="Temperature dependence of BETN", unit="" *) parameter real STBET = 1.0 ;
- (*info="Mobility reduction coefficient at TR", unit="m/V" *) parameter real MUE = 0.5 `from( 0.0,inf );
- (*info="Temperature dependence of MUE", unit="" *) parameter real STMUE = 0.0 ;
- (*info="Mobility reduction exponent at TR", unit="" *) parameter real THEMU = 1.5 `from( 0.0,inf );
- (*info="Temperature dependence of THEMU", unit="" *) parameter real STTHEMU = 1.5 ;
- (*info="Coulomb scattering parameter at TR", unit="" *) parameter real CS = 0.0 `from( 0.0,inf );
- (*info="Temperature dependence of CS", unit="" *) parameter real STCS = 0.0 ;
- (*info="Non-universality factor", unit="V^-1" *) parameter real XCOR = 0.0 `from( 0.0,inf );
- (*info="Temperature dependence of XCOR", unit="" *) parameter real STXCOR = 0.0 ;
- (*info="Effective field parameter", unit="" *) parameter real FETA = 1.0 `from( 0.0,inf );
-
- // Series-resistance parameters (for resistance modeling as part of intrinsic mobility reduction)
- (*info="Series resistance at TR", unit="Ohm" *) parameter real RS = 30 `from( 0.0,inf );
- (*info="Temperature dependence of RS", unit="" *) parameter real STRS = 1.0 ;
- (*info="Back-bias dependence of series resistance", unit="V^-1" *) parameter real RSB = 0.0 `from( -0.5,1.0 );
- (*info="Gate-bias dependence of series resistance", unit="V^-1" *) parameter real RSG = 0.0 `from( -0.5,inf );
-
- // Velocity saturation parameters
- (*info="Velocity saturation parameter at TR", unit="V^-1" *) parameter real THESAT = 1.0 `from( 0.0,inf );
- (*info="Temperature dependence of THESAT", unit="" *) parameter real STTHESAT = 1.0 ;
- (*info="Back-bias dependence of velocity saturation", unit="V^-1" *) parameter real THESATB = 0.0 `from( -0.5,1.0 );
- (*info="Gate-bias dependence of velocity saturation", unit="V^-1" *) parameter real THESATG = 0.0 `from( -0.5,inf );
-
- // Saturation voltage parameters
- (*info="Linear/saturation transition factor", unit="" *) parameter real AX = 3.0 `from( 2.0,inf );
-
- // Channel length modulation (CLM) parameters
- (*info="CLM pre-factor", unit="" *) parameter real ALP = 0.01 `from( 0.0,inf );
- (*info="CLM enhancement factor above threshold", unit="V" *) parameter real ALP1 = 0.00 `from( 0.0,inf );
- (*info="CLM enhancement factor below threshold", unit="V^-1" *) parameter real ALP2 = 0.00 `from( 0.0,inf );
- (*info="CLM logarithm dependence factor", unit="V" *) parameter real VP = 0.05 `from( 1e-10,inf );
-
- // Impact ionization (II) parameters
- (*info="Impact-ionization pre-factor", unit="" *) parameter real A1 = 1.0 `from( 0.0,inf );
- (*info="Impact-ionization exponent at TR", unit="V" *) parameter real A2 = 10.0 `from( 0.0,inf );
- (*info="Temperature dependence of A2", unit="V" *) parameter real STA2 = 0.0 ;
- (*info="Saturation-voltage dependence of impact-ionization", unit="" *) parameter real A3 = 1.0 `from( 0.0,inf );
- (*info="Back-bias dependence of impact-ionization", unit="V^-0.5" *) parameter real A4 = 0.0 `from( 0.0,inf );
-
- // Gate current parameters
- (*info="Gate tunnelling energy adjustment", unit="" *) parameter real GCO = 0.0 `from( -10.0,10.0 );
- (*info="Gate channel current pre-factor", unit="A" *) parameter real IGINV = 0.0 `from( 0.0,inf );
- (*info="Gate overlap current pre-factor", unit="A" *) parameter real IGOV = 0.0 `from( 0.0,inf );
- (*info="Temperature dependence of IGINV and IGOV", unit="" *) parameter real STIG = 2.0 ;
- (*info="Gate current slope factor", unit="" *) parameter real GC2 = 0.375 `from( 0.0,10.0 );
- (*info="Gate current curvature factor", unit="" *) parameter real GC3 = 0.063 `from( -2.0,2.0 );
- (*info="Tunnelling barrier height", unit="V" *) parameter real CHIB = 3.1 `from( 1.0,inf );
-
- // Gate Induced Drain/Source Leakage (GIDL) parameters
- (*info="GIDL pre-factor", unit="A/V^3" *) parameter real AGIDL = 0.0 `from( 0.0,inf );
- (*info="GIDL probability factor at TR", unit="V" *) parameter real BGIDL = 41.0 `from( 0.0,inf );
- (*info="Temperature dependence of BGIDL", unit="V/K" *) parameter real STBGIDL = 0.0 ;
- (*info="Back-bias dependence of GIDL", unit="" *) parameter real CGIDL = 0.0 ;
-
- // Charge model parameters
- (*info="Oxide capacitance for intrinsic channel", unit="F" *) parameter real COX = 1.0e-14 `from( 0.0,inf );
- (*info="Oxide capacitance for gate-drain/source overlap", unit="F" *) parameter real CGOV = 1.0e-15 `from( 0.0,inf );
- (*info="Oxide capacitance for gate-bulk overlap", unit="F" *) parameter real CGBOV = 0.0 `from( 0.0,inf );
- (*info="Outer fringe capacitance", unit="F" *) parameter real CFR = 0.0 `from( 0.0,inf );
-
- // Noise parameters
- (*info="Thermal noise coefficient", unit="" *) parameter real FNT = 1.0 `from( 0.0,inf );
- (*info="First coefficient of flicker noise", unit="V^-1/m^4" *) parameter real NFA = 8.0e+22 `from( 0.0,inf );
- (*info="Second coefficient of flicker noise", unit="V^-1/m^2" *) parameter real NFB = 3.0e+07 `from( 0.0,inf );
- (*info="Third coefficient of flicker noise", unit="V^-1" *) parameter real NFC = 0.0 `from( 0.0,inf );
-`ifdef NQSmodel
-
- // NQS parameters
- (*info="Flag for NQS, 0=off, 1, 2, 3, 5, or 9=number of collocation points", unit="" *) parameter real SWNQS = 0.0 `from( 0.0,9.0 );
- (*info="Relative mobility for NQS modelling" *) parameter real MUNQS = 1.0 `from( 0.0,inf );
- (*info="Gate resistance", unit="Ohm" *) parameter real RG = 1.0e-3 `from( 1.0e-6,inf );
- (*info="Bulk resistance between node BP and BI", unit="Ohm" *) parameter real RBULK = 1.0e-3 `from( 1.0e-6,inf );
- (*info="Well resistance between node BI and B", unit="Ohm" *) parameter real RWELL = 1.0e-3 `from( 1.0e-6,inf );
- (*info="Source-side bulk resistance between node BI and BS", unit="Ohm" *) parameter real RJUNS = 1.0e-3 `from( 1.0e-6,inf );
- (*info="Drain-side bulk resistance between node BI and BD", unit="Ohm" *) parameter real RJUND = 1.0e-3 `from( 1.0e-6,inf );
-`endif // NQSmodel
-
- // JUNCAP Parameters
- (*info="reference temperature", unit="C" *) parameter real TRJ = 21 `from(`TRJ_cliplow,inf);
- `include "JUNCAP200_parlist.include"
-
- // Other parameters
- (*info="Temperature offset w.r.t. ambient temperature", unit="K" *) parameter real DTA = 0.0 ;
-
- // Instance parameters
- (*type="instance", info="Bottom area of source junction", unit="m^2" *) parameter real ABSOURCE = 1e-12 `from(`AB_cliplow,inf);
- (*type="instance", info="STI-edge length of source junction", unit="m" *) parameter real LSSOURCE = 1e-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Gate-edge length of source junction", unit="m" *) parameter real LGSOURCE = 1e-6 `from(`LG_cliplow,inf);
- (*type="instance", info="Bottom area of drain junction", unit="m^2" *) parameter real ABDRAIN = 1e-12 `from(`AB_cliplow,inf);
- (*type="instance", info="STI-edge length of drain junction", unit="m" *) parameter real LSDRAIN = 1e-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Gate-edge length of drain junction", unit="m" *) parameter real LGDRAIN = 1e-6 `from(`LG_cliplow,inf);
- (*type="instance", info="Bottom area of source junction", unit="m^2" *) parameter real AS = 1E-12 `from(`AB_cliplow,inf);
- (*type="instance", info="Perimeter of source junction", unit="m" *) parameter real PS = 1E-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Bottom area of drain junction", unit="m^2" *) parameter real AD = 1E-12 `from(`AB_cliplow,inf);
- (*type="instance", info="Perimeter of drain junction", unit="m" *) parameter real PD = 1E-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Gate-edge length of source/drain junction", unit="m" *) parameter real JW = 1E-6 `from(`LG_cliplow,inf);
- (*type="instance", info="Number of devices in parallel", unit="" *) parameter real MULT = 1.0 `from( 0.0,inf );
-`else // LocalModel
-`ifdef Binning
-
- `include "PSP102_binpars.include"
-
-`else // Binning
- ///////////////////////////////////////////////////
- // PSP global model parameters
- ///////////////////////////////////////////////////
-
- // Special model parameters
- (*info="Model level", unit="" *) parameter real LEVEL = 1020 ;
- (*info="Channel type parameter, +1=NMOS -1=PMOS", unit="" *) parameter real TYPE = 1.0 `from( -1,1 );
-
- // Reference Temperature
- (*info="nominal (reference) temperature", unit="C" *) parameter real TR = 21.0 `from( -273.0,inf );
-
- // Switch parameters that turn models or effects on or off
- (*info="Flag for gate current, 0=turn off IG", unit="" *) parameter real SWIGATE = 0.0 `from( 0.0,1.0 );
- (*info="Flag for impact ionization current, 0=turn off II", unit="" *) parameter real SWIMPACT = 0.0 `from( 0.0,1.0 );
- (*info="Flag for GIDL current, 0=turn off IGIDL", unit="" *) parameter real SWGIDL = 0.0 `from( 0.0,1.0 );
- (*info="Flag for juncap, 0=turn off juncap", unit="" *) parameter real SWJUNCAP = 0.0 `from( 0.0,3.0 );
- (*info="Quantum-mechanical correction factor", unit="" *) parameter real QMC = 1.0 `from( 0.0,inf );
-
- // Process Parameters
- (*info="Geom. independent difference between actual and programmed gate length", unit="m" *) parameter real LVARO = 0.0 ;
- (*info="Length dependence of LVAR", unit="" *) parameter real LVARL = 0.0 ;
- (*info="Width dependence of LVAR", unit="" *) parameter real LVARW = 0.0 ;
- (*info="Effective channel length reduction per side", unit="m" *) parameter real LAP = 0.0 ;
- (*info="Geom. independent difference between actual and programmed field-oxide opening", unit="m" *) parameter real WVARO = 0.0 ;
- (*info="Length dependence of WVAR", unit="" *) parameter real WVARL = 0.0 ;
- (*info="Width dependence of WVAR", unit="" *) parameter real WVARW = 0.0 ;
- (*info="Effective channel width reduction per side", unit="m" *) parameter real WOT = 0.0 ;
- (*info="Effective channel length reduction for CV", unit="m" *) parameter real DLQ = 0.0 ;
- (*info="Effective channel width reduction for CV", unit="m" *) parameter real DWQ = 0.0 ;
- (*info="Geometry-independent flat-band voltage at TR", unit="V" *) parameter real VFBO = -1.0 ;
- (*info="Length dependence of flat-band voltage", unit="" *) parameter real VFBL = 0.0 ;
- (*info="Width dependence of flat-band voltage", unit="" *) parameter real VFBW = 0.0 ;
- (*info="Area dependence of flat-band voltage", unit="" *) parameter real VFBLW = 0.0 ;
- (*info="Geometry-independent temperature dependence of VFB", unit="V/K" *) parameter real STVFBO = 5e-4 ;
- (*info="Length dependence of temperature dependence of VFB", unit="" *) parameter real STVFBL = 0.0 ;
- (*info="Width dependence of temperature dependence of VFB", unit="" *) parameter real STVFBW = 0.0 ;
- (*info="Area dependence of temperature dependence of VFB", unit="" *) parameter real STVFBLW = 0.0 ;
- (*info="Gate oxide thickness", unit="m" *) parameter real TOXO = 2e-9 `from( 1e-10,inf );
- (*info="Geometry independent substrate doping", unit="m^-3" *) parameter real NSUBO = 3e23 `from( 1e20,inf );
- (*info="Width dependence of background doping NSUBO due to segregation", unit="" *) parameter real NSUBW = 0.0 ;
- (*info="Char. length of segregation of background doping NSUBO", unit="m" *) parameter real WSEG = 1e-8 `from( 1e-10,inf );
- (*info="Pocket doping level", unit="m^-3" *) parameter real NPCK = 1e24 `from( 0.0,inf );
- (*info="Width dependence of pocket doping NPCK due to segregation", unit="" *) parameter real NPCKW = 0.0 ;
- (*info="Char. length of segregation of pocket doping NPCK", unit="m" *) parameter real WSEGP = 1e-8 `from( 1e-10,inf );
- (*info="Char. length of lateral doping profile", unit="m" *) parameter real LPCK = 1e-8 `from( 1e-10,inf );
- (*info="Width dependence of char. length of lateral doping profile", unit="" *) parameter real LPCKW = 0.0 ;
- (*info="First length dependence coefficient for short channel body effect", unit="" *) parameter real FOL1 = 0.0 ;
- (*info="Second length dependence coefficient for short channel body effect", unit="" *) parameter real FOL2 = 0.0 ;
- (*info="Effective doping bias-dependence parameter", unit="V" *) parameter real VNSUBO = 0.0 ;
- (*info="Effective doping bias-dependence parameter", unit="V" *) parameter real NSLPO = 0.05 ;
- (*info="Effective doping bias-dependence parameter", unit="V^-1" *) parameter real DNSUBO = 0.0 ;
- (*info="Geometry independent offset of PHIB", unit="V" *) parameter real DPHIBO = 0.0 ;
- (*info="Length dependence offset of PHIB", unit="V" *) parameter real DPHIBL = 0.0 ;
- (*info="Exponent for length dependence of offset of PHIB", unit="" *) parameter real DPHIBLEXP= 1.0 ;
- (*info="Width dependence of offset of PHIB", unit="" *) parameter real DPHIBW = 0.0 ;
- (*info="Area dependence of offset of PHIB", unit="" *) parameter real DPHIBLW = 0.0 ;
- (*info="Geometry-independent gate poly-silicon doping", unit="m^-3" *) parameter real NPO = 1e26 ;
- (*info="Length dependence of gate poly-silicon doping", unit="" *) parameter real NPL = 0.0 ;
- (*info="Geometry-independent interface states factor", unit="" *) parameter real CTO = 0.0 ;
- (*info="Length dependence of interface states factor", unit="" *) parameter real CTL = 0.0 ;
- (*info="Exponent for length dependence of interface states factor", unit="" *) parameter real CTLEXP = 1.0 ;
- (*info="Width dependence of interface states factor", unit="" *) parameter real CTW = 0.0 ;
- (*info="Area dependence of interface states factor", unit="" *) parameter real CTLW = 0.0 ;
- (*info="Overlap oxide thickness", unit="m" *) parameter real TOXOVO = 2e-9 `from( 1e-10,inf );
- (*info="Overlap length for gate/drain and gate/source overlap capacitance", unit="m" *) parameter real LOV = 0 `from( 0.0,inf );
- (*info="Effective doping of overlap region", unit="m^-3" *) parameter real NOVO = 5e25 ;
-
- // DIBL Parameters
- (*info="Length dependence of DIBL-parameter", unit="V^-1" *) parameter real CFL = 0.0 ;
- (*info="Exponent for length dependence of CF", unit="" *) parameter real CFLEXP = 2.0 ;
- (*info="Width dependence of CF", unit="" *) parameter real CFW = 0.0 ;
- (*info="Back-bias dependence of CF", unit="V^-1" *) parameter real CFBO = 0.0 ;
-
- // Mobility Parameters
- (*info="Zero-field mobility at TR", unit="m^2/V/s" *) parameter real UO = 5e-2 ;
- (*info="Relative mobility decrease due to first lateral profile", unit="" *) parameter real FBET1 = 0.0 ;
- (*info="Width dependence of relative mobility decrease due to first lateral profile", unit="" *) parameter real FBET1W = 0.0 ;
- (*info="Mobility-related characteristic length of first lateral profile", unit="m" *) parameter real LP1 = 1e-8 `from( 1e-10,inf );
- (*info="Width dependence of mobility-related characteristic length of first lateral profile", unit="" *) parameter real LP1W = 0.0 ;
- (*info="Relative mobility decrease due to second lateral profile", unit="" *) parameter real FBET2 = 0.0 ;
- (*info="Mobility-related characteristic length of second lateral profile", unit="m" *) parameter real LP2 = 1e-8 `from( 1e-10,inf );
- (*info="First higher-order width scaling coefficient of BETN", unit="" *) parameter real BETW1 = 0.0 ;
- (*info="Second higher-order width scaling coefficient of BETN", unit="" *) parameter real BETW2 = 0.0 ;
- (*info="Characteristic width for width scaling of BETN", unit="m" *) parameter real WBET = 1e-9 `from( 1e-10,inf );
- (*info="Geometry independent temperature dependence of BETN", unit="" *) parameter real STBETO = 1.0 ;
- (*info="Length dependence of temperature dependence of BETN", unit="" *) parameter real STBETL = 0.0 ;
- (*info="Width dependence of temperature dependence of BETN", unit="" *) parameter real STBETW = 0.0 ;
- (*info="Area dependence of temperature dependence of BETN", unit="" *) parameter real STBETLW = 0.0 ;
- (*info="Geometry independent mobility reduction coefficient at TR", unit="m/V" *) parameter real MUEO = 0.5 ;
- (*info="Width dependence of mobility reduction coefficient at TR", unit="" *) parameter real MUEW = 0.0 ;
- (*info="Temperature dependence of MUE", unit="" *) parameter real STMUEO = 0.0 ;
- (*info="Mobility reduction exponent at TR", unit="" *) parameter real THEMUO = 1.5 ;
- (*info="Temperature dependence of THEMU", unit="" *) parameter real STTHEMUO = 1.5 ;
- (*info="Geometry independent coulomb scattering parameter at TR", unit="" *) parameter real CSO = 0.0 ;
- (*info="Length dependence of CS", unit="" *) parameter real CSL = 0.0 ;
- (*info="Exponent for length dependence of CS", unit="" *) parameter real CSLEXP = 0.0 ;
- (*info="Width dependence of CS", unit="" *) parameter real CSW = 0.0 ;
- (*info="Area dependence of CS", unit="" *) parameter real CSLW = 0.0 ;
- (*info="Temperature dependence of CS", unit="" *) parameter real STCSO = 0.0 ;
- (*info="Geometry independent non-universality parameter", unit="V^-1" *) parameter real XCORO = 0.0 ;
- (*info="Length dependence of non-universality parameter", unit="" *) parameter real XCORL = 0.0 ;
- (*info="Width dependence of non-universality parameter", unit="" *) parameter real XCORW = 0.0 ;
- (*info="Area dependence of non-universality parameter", unit="" *) parameter real XCORLW = 0.0 ;
- (*info="Temperature dependence of XCOR", unit="" *) parameter real STXCORO = 0.0 ;
- (*info="Effective field parameter", unit="" *) parameter real FETAO = 1.0 ;
-
- // Series Resistance
- (*info="Source/drain series resistance for 1 um wide channel at TR", unit="Ohm" *) parameter real RSW1 = 2.5e3 ;
- (*info="Higher-order width scaling of RS", unit="" *) parameter real RSW2 = 0.0 ;
- (*info="Temperature dependence of RS", unit="" *) parameter real STRSO = 1.0 ;
- (*info="Back-bias dependence of series resistance", unit="V^-1" *) parameter real RSBO = 0.0 ;
- (*info="Gate-bias dependence of series resistance", unit="V^-1" *) parameter real RSGO = 0.0 ;
-
- // Velocity Saturation
- (*info="Geometry independent velocity saturation parameter at TR", unit="V^-1" *) parameter real THESATO = 0.0 ;
- (*info="Length dependence of THESAT", unit="V^-1" *) parameter real THESATL = 0.05 ;
- (*info="Exponent for length dependence of THESAT", unit="" *) parameter real THESATLEXP= 1.0 ;
- (*info="Width dependence of velocity saturation parameter", unit="" *) parameter real THESATW = 0.0 ;
- (*info="Area dependence of velocity saturation parameter", unit="" *) parameter real THESATLW = 0.0 ;
- (*info="Geometry independent temperature dependence of THESAT", unit="" *) parameter real STTHESATO= 1.0 ;
- (*info="Length dependence of temperature dependence of THESAT", unit="" *) parameter real STTHESATL= 0.0 ;
- (*info="Width dependence of temperature dependence of THESAT", unit="" *) parameter real STTHESATW= 0.0 ;
- (*info="Area dependence of temperature dependence of THESAT", unit="" *) parameter real STTHESATLW= 0.0 ;
- (*info="Back-bias dependence of velocity saturation", unit="V^-1" *) parameter real THESATBO = 0.0 ;
- (*info="Gate-bias dependence of velocity saturation", unit="V^-1" *) parameter real THESATGO = 0.0 ;
-
- // Saturation Voltage
- (*info="Geometry independent linear/saturation transition factor", unit="" *) parameter real AXO = 18 ;
- (*info="Length dependence of AX", unit="" *) parameter real AXL = 0.4 `from( 0.0,inf );
-
- // Channel Length Modulation
- (*info="Length dependence of ALP", unit="" *) parameter real ALPL = 5e-4 ;
- (*info="Exponent for length dependence of ALP", unit="" *) parameter real ALPLEXP = 1.0 ;
- (*info="Width dependence of ALP", unit="" *) parameter real ALPW = 0.0 ;
- (*info="Length dependence of CLM enhancement factor above threshold", unit="V" *) parameter real ALP1L1 = 0.0 ;
- (*info="Exponent for length dependence of ALP1", unit="" *) parameter real ALP1LEXP = 0.5 ;
- (*info="Second_order length dependence of ALP1", unit="" *) parameter real ALP1L2 = 0.0 `from( 0.0,inf );
- (*info="Width dependence of ALP1", unit="" *) parameter real ALP1W = 0.0 ;
- (*info="Length dependence of CLM enhancement factor below threshold", unit="V^-1" *) parameter real ALP2L1 = 0.0 ;
- (*info="Exponent for length dependence of ALP2", unit="" *) parameter real ALP2LEXP = 0.5 ;
- (*info="Second_order length dependence of ALP2", unit="" *) parameter real ALP2L2 = 0.0 `from( 0.0,inf );
- (*info="Width dependence of ALP2", unit="" *) parameter real ALP2W = 0.0 ;
- (*info="CLM logarithmic dependence parameter", unit="V" *) parameter real VPO = 0.05 ;
-
- // Weak-avalanche parameters
- (*info="Geometry independent impact-ionization pre-factor", unit="" *) parameter real A1O = 1.0 ;
- (*info="Length dependence of A1", unit="" *) parameter real A1L = 0.0 ;
- (*info="Width dependence of A1", unit="" *) parameter real A1W = 0.0 ;
- (*info="Impact-ionization exponent at TR", unit="V" *) parameter real A2O = 10 ;
- (*info="Temperature dependence of A2", unit="V" *) parameter real STA2O = 0.0 ;
- (*info="Geometry independent saturation-voltage dependence of II", unit="" *) parameter real A3O = 1.0 ;
- (*info="Length dependence of A3", unit="" *) parameter real A3L = 0.0 ;
- (*info="Width dependence of A3", unit="" *) parameter real A3W = 0.0 ;
- (*info="Geometry independent back-bias dependence of II", unit="V^-0.5" *) parameter real A4O = 0.0 ;
- (*info="Length dependence of A4", unit="" *) parameter real A4L = 0.0 ;
- (*info="Width dependence of A4", unit="" *) parameter real A4W = 0.0 ;
-
- // Gate current parameters
- (*info="Gate tunnelling energy adjustment", unit="" *) parameter real GCOO = 0.0 ;
- (*info="Gate channel current pre-factor for 1 um^2 channel area", unit="A" *) parameter real IGINVLW = 0.0 ;
- (*info="Gate overlap current pre-factor for 1 um wide channel", unit="A" *) parameter real IGOVW = 0.0 ;
- (*info="Temperature dependence of IGINV and IGOV", unit="" *) parameter real STIGO = 2.0 ;
- (*info="Gate current slope factor", unit="" *) parameter real GC2O = 0.375 ;
- (*info="Gate current curvature factor", unit="" *) parameter real GC3O = 0.063 ;
- (*info="Tunnelling barrier height", unit="V" *) parameter real CHIBO = 3.1 ;
-
- // Gate-induced drain leakage parameters
- (*info="Width dependence of GIDL pre-factor", unit="A/V^3" *) parameter real AGIDLW = 0.0 ;
- (*info="GIDL probability factor at TR", unit="V" *) parameter real BGIDLO = 41 ;
- (*info="Temperature dependence of BGIDL", unit="V/K" *) parameter real STBGIDLO = 0.0 ;
- (*info="Back-bias dependence of GIDL", unit="" *) parameter real CGIDLO = 0.0 ;
-
- // Charge Model Parameters
- (*info="Oxide capacitance for gate-bulk overlap for 1 um^2 area", unit="F" *) parameter real CGBOVL = 0.0 ;
- (*info="Outer fringe capacitance for 1 um wide channel", unit="F" *) parameter real CFRW = 0.0 ;
-
- // Noise Model Parameters
- (*info="Thermal noise coefficient", unit="" *) parameter real FNTO = 1.0 ;
- (*info="First coefficient of flicker noise for 1 um^2 channel area", unit="V^-1/m^4" *) parameter real NFALW = 8e22 ;
- (*info="Second coefficient of flicker noise for 1 um^2 channel area", unit="V^-1/m^2" *) parameter real NFBLW = 3e7 ;
- (*info="Third coefficient of flicker noise for 1 um^2 channel area", unit="V^-1" *) parameter real NFCLW = 0.0 ;
-
- // Other Parameters
- (*info="Temperature offset w.r.t. ambient circuit temperature", unit="K" *) parameter real DTA = 0 ;
-`endif // Binning
-`ifdef NQSmodel
-
- // NQS parameters
- (*info="Flag for NQS, 0=off, 1, 2, 3, 5, or 9=number of collocation points", unit="" *) parameter real SWNQS = 0.0 `from( 0.0,9.0 );
- (*info="Relative mobility for NQS modelling" *) parameter real MUNQSO = 1.0 ;
- (*info="Gate resistance" *) parameter real RGO = 1.0e-3 ;
- (*info="Bulk resistance between node BP and BI", unit="Ohm" *) parameter real RBULKO = 1.0e-3 ;
- (*info="Well resistance between node BI and B", unit="Ohm" *) parameter real RWELLO = 1.0e-3 ;
- (*info="Source-side bulk resistance between node BI and BS", unit="Ohm" *) parameter real RJUNSO = 1.0e-3 ;
- (*info="Drain-side bulk resistance between node BI and BD", unit="Ohm" *) parameter real RJUNDO = 1.0e-3 ;
-`endif // NQSmodel
-
- // Stress Model Parameters
- (*info="Reference distance beteen OD-edge to poly from one side", unit="m" *) parameter real SAREF = 1.0e-6 `from( 1e-9,inf );
- (*info="Reference distance beteen OD-edge to poly from other side", unit="m" *) parameter real SBREF = 1.0e-6 `from( 1e-9,inf );
- (*info="Width parameter", unit="m" *) parameter real WLOD = 0 ;
- (*info="Mobility degradation/enhancement coefficient", unit="m" *) parameter real KUO = 0 ;
- (*info="Saturation velocity degradation/enhancement coefficient", unit="m" *) parameter real KVSAT = 0 `from( -1.0,1.0 );
- (*info="Temperature dependence of KUO", unit="" *) parameter real TKUO = 0 ;
- (*info="Length dependence of KUO", unit="m^LLODKUO" *) parameter real LKUO = 0 ;
- (*info="Width dependence of KUO", unit="m^WLODKUO" *) parameter real WKUO = 0 ;
- (*info="Cross-term dependence of KUO", unit="m^(LLODKUO+WLODKUO)" *) parameter real PKUO = 0 ;
- (*info="Length parameter for UO stress effect", unit="" *) parameter real LLODKUO = 0 `from( 0.0,inf );
- (*info="Width parameter for UO stress effect", unit="" *) parameter real WLODKUO = 0 `from( 0.0,inf );
- (*info="Threshold shift parameter", unit="Vm" *) parameter real KVTHO = 0 ;
- (*info="Length dependence of KVTHO", unit="m^LLODVTH" *) parameter real LKVTHO = 0 ;
- (*info="Width dependence of KVTHO", unit="m^WLODVTH" *) parameter real WKVTHO = 0 ;
- (*info="Cross-term dependence of KVTHO", unit="m^(LLODVTH+WLODVTH)" *) parameter real PKVTHO = 0 ;
- (*info="Length parameter for VTH-stress effect", unit="" *) parameter real LLODVTH = 0 `from( 0.0,inf );
- (*info="Width parameter for VTH-stress effect", unit="" *) parameter real WLODVTH = 0 `from( 0.0,inf );
- (*info="eta0 shift factor related to VTHO change", unit="m" *) parameter real STETAO = 0 ;
- (*info="eta0 shift modifaction factor for stress effect", unit="" *) parameter real LODETAO = 1.0 `from( 0.0,inf );
-
- // JUNCAP Parameters
- (*info="reference temperature", unit="C"*) parameter real TRJ = 21 `from(`TRJ_cliplow,inf);
- `include "JUNCAP200_parlist.include"
-
- // Instance parameters
- (*type="instance", info="Design length", unit="m" *) parameter real L = 10e-6 `from( 1e-9,inf );
- (*type="instance", info="Design width", unit="m" *) parameter real W = 10e-6 `from( 1e-9,inf );
- (*type="instance", info="Distance beteen OD-edge to poly from one side", unit="m" *) parameter real SA = 0.0 ;
- (*type="instance", info="Distance beteen OD-edge to poly from other side", unit="m" *) parameter real SB = 0.0 ;
- (*type="instance", info="Bottom area of source junction", unit="m^2" *) parameter real ABSOURCE = 1E-12 `from(`AB_cliplow,inf);
- (*type="instance", info="STI-edge length of source junction", unit="m" *) parameter real LSSOURCE = 1E-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Gate-edge length of source junction", unit="m" *) parameter real LGSOURCE = 1E-6 `from(`LG_cliplow,inf);
- (*type="instance", info="Bottom area of drain junction", unit="m^2" *) parameter real ABDRAIN = 1E-12 `from(`AB_cliplow,inf);
- (*type="instance", info="STI-edge length of drain junction", unit="m" *) parameter real LSDRAIN = 1E-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Gate-edge length of drain junction", unit="m" *) parameter real LGDRAIN = 1E-6 `from(`LG_cliplow,inf);
- (*type="instance", info="Bottom area of source junction", unit="m^2" *) parameter real AS = 1E-12 `from(`AB_cliplow,inf);
- (*type="instance", info="Perimeter of source junction", unit="m" *) parameter real PS = 1E-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Bottom area of drain junction", unit="m^2" *) parameter real AD = 1E-12 `from(`AB_cliplow,inf);
- (*type="instance", info="Perimeter of drain junction", unit="m" *) parameter real PD = 1E-6 `from(`LS_cliplow,inf);
- (*type="instance", info="Number of devices in parallel", unit="" *) parameter real MULT = 1.0 `from( 0.0,inf );
-
- //////////////////////////
- //
- // Variables
- //
- //////////////////////////
-
- // Variables for geometrical scaling rules
- real L_i, W_i, SA_i, SB_i;
- real LEN, WEN, iL, iW, delLPS, delWOD, LE, WE, iLE, iWE, Lcv, Wcv, LEcv, WEcv;
-
-`ifdef Binning
- // Auxiliary variables for binning-rules
- real iLEWE, iiLE, iiWE, iiLEWE, iiiLEWE;
- real iLEcv, iiLEcv, iiWEcv, iiLEWEcv, iiiLEWEcv;
- real iLcv, iiLcv, iiWcv, iiLWcv, iiiLWcv;
-`else // Binning
- // Intermediate variables used for geometry-scaling
- real NSUBO_i, WSEG_i, NPCK_i, WSEGP_i, LPCK_i, LOV_i;
- real LP1_i, LP2_i, WBET_i, AXL_i, ALP1L2_i, ALP2L2_i;
- real NSUB, AA, BB, NSUB0e, NPCKe, LPCKe;
- real FBET1e, LP1e, GPE, GWE, tmpx;
-`endif // Binning
-
- // List of local parameters
- real VFB, STVFB, TOX, NEFF, VNSUB, NSLP, DNSUB, DPHIB, NP, CT;
- real TOXOV, NOV, CF, CFB;
- real BETN, STBET, MUE, STMUE, THEMU, STTHEMU, CS, STCS, XCOR, STXCOR, FETA;
- real RS, STRS, RSB, RSG;
- real THESAT, STTHESAT, THESATB, THESATG;
- real AX;
- real ALP, ALP1, ALP2, VP;
- real A1, A2, STA2, A3, A4;
- real GCO, IGINV, IGOV, STIG, GC2, GC3, CHIB;
- real AGIDL, BGIDL, STBGIDL, CGIDL;
- real COX, CGOV, CGBOV, CFR;
- real FNT, NFA, NFB, NFC;
-`ifdef NQSmodel
- real MUNQS, RG, RBULK, RWELL, RJUNS, RJUND;
-`endif // NQSmodel
-
- // Variables for stress-model
- real SAREF_i, SBREF_i, KVSAT_i, LLODKUO_i, WLODKUO_i, LLODVTH_i, WLODVTH_i, LODETAO_i;
- real Invsa, Invsb, Invsaref, Invsbref, Kstressu0, rhobeta, rhobetaref, Kstressvth0;
- real temp0, templ, tempw, Lx, Wx;
-`endif // LocalModel
-
- // Variables used in electrical equations
- real VFB_i, STVFB_i, TOX_i, NEFF_i, VNSUB_i, NSLP_i, DNSUB_i, NP_i, QMC_i, CT_i, TOXOV_i, NOV_i;
- real CF_i, CFB_i, DPHIB_i;
- real BET_i, STBET_i, MUE_i, STMUE_i, THEMU_i, STTHEMU_i, CS_i, STCS_i, XCOR_i, STXCOR_i, FETA_i;
- real RS_i, THER_i, STRS_i, RSB_i, RSG_i;
- real THESAT_i, STTHESAT_i, THESATB_i, THESATG_i;
- real AX_i, ALP_i, ALP1_i, ALP2_i, VP_i;
- real A1_i, A2_i, STA2_i, A3_i, A4_i;
- real GCO_i, IGINV_i, IGOV_i, STIG_i, GC2_i, GC3_i, CHIB_i;
- real AGIDL_i, BGIDL_i, STBGIDL_i, CGIDL_i;
- real COX_i, CGOV_i, CGBOV_i, CFR_i;
- real FNT_i, NFA_i, NFB_i, NFC_i;
- real TR_i, MULT_i;
-
- real temp, temp1, temp2, tempM;
- real help;
-
- real TKR, TKD, TKD_sq, dT, rT, rTn;
- real phit, inv_phit, Eg, phibFac, CoxPrime, tox_sq;
- real delVg, CoxovPrime, GOV, GOV2;
- real np, kp, qq, qb0, dphibq, qlim2;
- real E_eff0, eta_mu, BCH, BOV, inv_CHIB, GCQ, Dch, Dov;
- real tf_bet, tf_mue, tf_cs, tf_xcor, tf_ther, tf_thesat, tf_ig;
- real xi_ov, inv_xi_ov, x_mrg_ov, x1, inv_xg1, Vdsat_lim;
- real nt, Cox_over_q;
-
- real phib, sqrt_phib, phix, aphi, bphi, phix1, phix2, G_0, phit1, inv_phit1, alpha_b;
- real inv_VP, inv_AX, Sfl_prefac;
-
- real Vgs, Vgd, Vds, Vsb, Vsbstar;
- real Vgb, Vgb1, Vgbstar, Vdb, Vdbstar, Vdsx, Vsbx;
-
- real Dnsub;
- real Igidl, Igisl, Vtovd, Vtovs;
- real x_s, sqm, alpha, alpha1, eta_p, phi_inf, za, xitsb, rhob;
- real thesat1, wsat, ysat, zsat, r1, r2, dL, GdL, dL1, FdL, GR, Gmob, Gmob_dL, Gvsat, Gvsatinv, QCLM;
- real xgm, Voxm, dps, qim, qim1, qim1_1, xgs_ov, xgd_ov, sigVds;
- real Ux, xg;
- real mu, nu, xn_s, delta_ns;
- real Gf, Gf2, inv_Gf2, xi, inv_xi, margin;
- real qeff, COX_qm;
-
- real SP_xg1, SP_S_temp,SP_S_temp1,SP_S_temp2;
- real SP_S_yg, SP_S_ysub, SP_S_y0, SP_S_a, SP_S_b, SP_S_c;
- real SP_S_bx, SP_S_tau, SP_S_eta, SP_S_delta0, SP_S_delta1;
- real SP_S_pC, SP_S_qC, SP_S_A_fac;
- real SP_S_x1, SP_S_w, SP_S_xbar, SP_S_x0;
- real SP_S_xi0, SP_S_xi1, SP_S_xi2;
- real SP_OV_yg, SP_OV_z, SP_OV_eta, SP_OV_a, SP_OV_c;
- real SP_OV_tau, SP_OV_D0, SP_OV_y0, SP_OV_xi, SP_OV_temp;
- real SP_OV_p, SP_OV_q, SP_OV_w, SP_OV_Afac, SP_OV_xbar;
- real SP_OV_x0, SP_OV_u;
-
- real x_d, x_m, x_ds, Rxcor, delta_1s, xi0s, xi1s, xi2s, xi0d;
- real Es, Em, Ed, Ds, Dm, Dd, Ps, xgs, qis, qbs, qbm, Eeffm, Vm;
- real Phi_0, Phi_2, asat, Phi_0_2, Phi0_Phi2;
- real Vdse, Vdsat, xn_d, k_ds, Udse;
- real Mutmp, Phi_sat, delta_nd;
- real pC, qC, Pm;
- real d0, D_bar, km, x_pm, xi_pd, p_pd, u_pd, q_pd;
- real xs_ov, xd_ov, Vovs, Vovd, psi_t;
- real zg, delVsat, TP, Dsi, Dgate, u0, u0_div_H, x, xsq, inv_x, ex, inv_ex, Ag, Bg, Sg;
- real H, Fj, Fj2;
- real N1, Nm1, Delta_N1, Sfl;
- real H0, t1, t2, sqt2, r, lc, lcinv2, g_ideal, CGeff, mid, mig, migid, c_igid, sqid, sqig;
- real shot_igs, shot_igsx, shot_igd, shot_igdx, shot_iavl;
-
- real Ids, Iimpact, mavl, Igdov, Igsov, Igc0, igc, igcd_h;
- real Igc, Igcd, Igcs, Igb, Igs, Igd;
- real Idse, Igbe, Igse, Igde, Igidle, Igisle, Iimpacte;
- real QI, QD, QB, QG, Qg, Qd, Qb, Qs, Qgs_ov, Qgd_ov;
- real Qfgs, Qfgd, Qgb_ov;
-
- real arg1, arg2max, arg2mina;
-
- integer CHNL_TYPE;
-
-`ifdef NQSmodel
- // Variables used in NQS-calculations
- real SWNQS_i, MUNQS_i, RG_i, RBULK_i, RWELL_i, RJUNS_i, RJUND_i;
- real Qp1_0, Qp2_0, Qp3_0, Qp4_0, Qp5_0, Qp6_0, Qp7_0, Qp8_0, Qp9_0;
- real fk1, fk2, fk3, fk4, fk5, fk6, fk7, fk8, fk9;
-
- real phi_p1, phi_p2, phi_p3;
- real phi_p4, phi_p5, phi_p6;
- real phi_p7, phi_p8, phi_p9;
-
- real Qp1, Qp2, Qp3;
- real Qp4, Qp5, Qp6;
- real Qp7, Qp8, Qp9;
- real Qp0, QpN;
-
- real QG_NQS, QS_NQS, QD_NQS;
- real pd, Gp, Gp2, a_factrp, marginp, x_sp, x_dp;
-
- real dfQi, fQi, dQis, dQis_1, d2Qis, dQbs, dQy, d2Qy, dpsy2;
- real ym, inorm, Tnorm, Qb_tmp, QbSIGN;
- real r_nqs, vnorm, vnorm_inv;
- real NQS_xg1, NQS_yg, NQS_z, NQS_eta, NQS_a, NQS_c, NQS_tau, NQS_D0, NQS_xi, NQS_p;
- real NQS_q, NQS_temp, NQS_A_fac, NQS_xbar, NQS_w, NQS_x0, NQS_u, NQS_y0;
- real xphi, fk0, thesat2, Fvsat;
- real Vrg, Vrbulk, Vrwell, Vrjund, Vrjuns;
- real ggate, gbulk, gwell, gjund, gjuns, nt0;
- real rgatenoise, rbulknoise, rwellnoise, rjundnoise, rjunsnoise;
- real temp3, temp4, temp5, temp6, temp7, temp8, temp9;
-`endif // NQSmodel
-
- // JUNCAP2 variables
- `include "JUNCAP200_varlist.include"
- real isjunbot, qsjunbot, isjunsti, qsjunsti, isjungat, qsjungat, isjun, qsjun, sjnoise, sjnoisex;
- real idjunbot, qdjunbot, idjunsti, qdjunsti, idjungat, qdjungat, idjun, qdjun, djnoise, djnoisex;
- real Vjuns, Vjund, VMAXS, VMAXD;
- real vbimins, vchs, vfmins, vbbtlims, vbimind, vchd, vfmind, vbbtlimd;
- real ABSOURCE_i, LSSOURCE_i, LGSOURCE_i;
- real ABDRAIN_i, LSDRAIN_i, LGDRAIN_i, juncapwidth;
-
-
-
-`ifdef insideADMS // OPinfo
- /////////////////////////////////////////////////////////////////////////////
- //
- // Variables for operating point info
- //
- /////////////////////////////////////////////////////////////////////////////
-
- real id_op, is, ig, ib, P_D, facvsb, facvsb0, sig1k;
-
- (*ask="yes", info="Flag for channel type", unit=""*) real ctype ;
- (*ask="yes", info="Flag for source-drain interchange", unit=""*) real sdint ;
-
- (*ask="yes", info="Total source current", unit="A"*) real ise ;
- (*ask="yes", info="Total gate current", unit="A"*) real ige ;
- (*ask="yes", info="Total drain current", unit="A"*) real ide ;
- (*ask="yes", info="Total bulk current", unit="A"*) real ibe ;
- (*ask="yes", info="Drain current, excl. avalanche, tunnel, GISL, GIDL, and junction currents", unit="A"*) real ids ;
- (*ask="yes", info="Drain to bulk current", unit="A"*) real idb ;
- (*ask="yes", info="Source to bulk current", unit="A"*) real isb ;
- (*ask="yes", info="Gate-source tunneling current", unit="A"*) real igs ;
- (*ask="yes", info="Gate-drain tunneling current", unit="A"*) real igd ;
- (*ask="yes", info="Gate-bulk tunneling current", unit="A"*) real igb ;
- (*ask="yes", info="Gate-channel tunneling current (source component)", unit="A"*) real igcs ;
- (*ask="yes", info="Gate-channel tunneling current (drain component)", unit="A"*) real igcd ;
- (*ask="yes", info="Substrate current due to weak avelanche", unit="A"*) real iavl ;
- (*ask="yes", info="Gate-induced source leakage current", unit="A"*) real igisl ;
- (*ask="yes", info="Gate-induced drain leakage current", unit="A"*) real igidl ;
-
- (*ask="yes", info="Total source junction current", unit="A"*) real ijs ;
- (*ask="yes", info="Source junction current (bottom component)", unit="A"*) real ijsbot ;
- (*ask="yes", info="Source junction current (gate-edge component)", unit="A"*) real ijsgat ;
- (*ask="yes", info="Source junction current (STI-edge component)", unit="A"*) real ijssti ;
- (*ask="yes", info="Total drain junction current", unit="A"*) real ijd ;
- (*ask="yes", info="Drain junction current (bottom component)", unit="A"*) real ijdbot ;
- (*ask="yes", info="Drain junction current (gate-edge component)", unit="A"*) real ijdgat ;
- (*ask="yes", info="Drain junction current (STI-edge component)", unit="A"*) real ijdsti ;
-
- (*ask="yes", info="Drain-source voltage", unit="V"*) real vds ;
- (*ask="yes", info="Gate-source voltage", unit="V"*) real vgs ;
- (*ask="yes", info="Source-bulk voltage", unit="V"*) real vsb ;
- (*ask="yes", info="Zero-bias threshold voltage", unit="V"*) real vto ;
- (*ask="yes", info="Threshold voltage including back bias effects", unit="V"*) real vts ;
- (*ask="yes", info="Threshold voltage including back bias and drain bias effects", unit="V"*) real vth ;
- (*ask="yes", info="Effective gate drive voltage including back bias and drain bias effects", unit="V"*) real vgt ;
- (*ask="yes", info="Drain saturation voltage at actual bias", unit="V"*) real vdss ;
- (*ask="yes", info="Saturation limit", unit="V"*) real vsat ;
-
- (*ask="yes", info="Transconductance", unit="1/Ohm"*) real gm ;
- (*ask="yes", info="Substrate transconductance", unit="1/Ohm"*) real gmb ;
- (*ask="yes", info="Output conductance", unit="1/Ohm"*) real gds ;
- (*ask="yes", info="Source junction conductance", unit="1/Ohm"*) real gjs ;
- (*ask="yes", info="Drain junction conductance", unit="1/Ohm"*) real gjd ;
-
- (*ask="yes", info="Drain capacitance", unit="F"*) real cdd ;
- (*ask="yes", info="Drain-gate capacitance", unit="F"*) real cdg ;
- (*ask="yes", info="Drain-source capacitance", unit="F"*) real cds ;
- (*ask="yes", info="Drain-bulk capacitance", unit="F"*) real cdb ;
- (*ask="yes", info="Gate-drain capacitance", unit="F"*) real cgd ;
- (*ask="yes", info="Gate capacitance", unit="F"*) real cgg ;
- (*ask="yes", info="Gate-source capacitance", unit="F"*) real cgs ;
- (*ask="yes", info="Gate-bulk capacitance", unit="F"*) real cgb ;
- (*ask="yes", info="Source-drain capacitance", unit="F"*) real csd ;
- (*ask="yes", info="Source-gate capacitance", unit="F"*) real csg ;
- (*ask="yes", info="Source capacitance", unit="F"*) real css ;
- (*ask="yes", info="Source-bulk capacitance", unit="F"*) real csb ;
- (*ask="yes", info="Bulk-drain capacitance", unit="F"*) real cbd ;
- (*ask="yes", info="Bulk-gate capacitance", unit="F"*) real cbg ;
- (*ask="yes", info="Bulk-source capacitance", unit="F"*) real cbs ;
- (*ask="yes", info="Bulk capacitance", unit="F"*) real cbb ;
- (*ask="yes", info="Total gate-source overlap capacitance", unit="F"*) real cgsol ;
- (*ask="yes", info="Total gate-drain overlap capacitance", unit="F"*) real cgdol ;
-
- (*ask="yes", info="Total source junction capacitance", unit="F"*) real cjs ;
- (*ask="yes", info="Source junction capacitance (bottom component)", unit="F"*) real cjsbot ;
- (*ask="yes", info="Source junction capacitance (gate-edge component)", unit="F"*) real cjsgat ;
- (*ask="yes", info="Source junction capacitance (STI-edge component)", unit="F"*) real cjssti ;
- (*ask="yes", info="Total drain junction capacitance", unit="F"*) real cjd ;
- (*ask="yes", info="Drain junction capacitance (bottom component)", unit="F"*) real cjdbot ;
- (*ask="yes", info="Drain junction capacitance (gate-edge component)", unit="F"*) real cjdgat ;
- (*ask="yes", info="Drain junction capacitance (STI-edge component)", unit="F"*) real cjdsti ;
-
- (*ask="yes", info="Effective channel width for geometrical models", unit="m"*) real weff ;
- (*ask="yes", info="Effective channel length for geometrical models", unit="m"*) real leff ;
- (*ask="yes", info="Transistor gain", unit=""*) real u ;
- (*ask="yes", info="Small-signal output resistance", unit="Ohm"*) real rout ;
- (*ask="yes", info="Equivalent Early voltage", unit="V"*) real vearly ;
- (*ask="yes", info="Gain factor", unit="A/V^2"*) real beff ;
- (*ask="yes", info="Unity gain frequency at actual bias", unit="Hz"*) real fug ;
-
- (*ask="yes", info="Flicker noise current density at 1 Hz", unit="A/Hz"*) real sfl ;
- (*ask="yes", info="Input-referred RMS white noise voltage density at 1 kHz", unit="V/sqrt(Hz)"*) real sqrtsff ;
- (*ask="yes", info="Input-referred RMS white noise voltage density", unit="V/sqrt(Hz)"*) real sqrtsfw ;
- (*ask="yes", info="White noise current density", unit="A^2/Hz"*) real sid ;
- (*ask="yes", info="Induced gate noise current density at 1 Hz", unit="A^2/Hz"*) real sig ;
- (*ask="yes", info="Imaginary part of correlation coefficient between Sig and Sid", unit=""*) real cigid ;
- (*ask="yes", info="Cross-over frequency above which white noise is dominant", unit="Hz"*) real fknee ;
- (*ask="yes", info="Gate-source current noise spectral density", unit="A^2/Hz"*) real sigs ;
- (*ask="yes", info="Gate-drain current noise spectral density", unit="A^2/Hz"*) real sigd ;
- (*ask="yes", info="Impact ionization current noise spectral density", unit="A^2/Hz"*) real siavl ;
- (*ask="yes", info="Total source junction current noise spectral density", unit="A^2/Hz"*) real ssi ;
- (*ask="yes", info="Total drain junction current noise specral density", unit="A^2/Hz"*) real sdi ;
-`endif // OPinfo
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // Analog block with all calculations and contribs
- //
- /////////////////////////////////////////////////////////////////////////////
-
- analog begin
-
- begin : initial_model
- // Code independent of bias or instance parameters
- // This block needs to be evaluated only once
-
-`ifdef LocalModel
- // Do nothing
-`else // LocalModel
-`ifdef Binning
- // There are no binning parameters that need clipping
-`else // Binning
- // Clipping of global model parameters
- TOX_i = `CLIP_LOW(TOXO, 1e-10);
- NSUBO_i = `CLIP_LOW(NSUBO, 1e20);
- WSEG_i = `CLIP_LOW(WSEG, 1e-10);
- NPCK_i = `CLIP_LOW(NPCK, 0.0);
- WSEGP_i = `CLIP_LOW(WSEGP, 1e-10);
- LPCK_i = `CLIP_LOW(LPCK, 1e-10);
- TOXOV_i = `CLIP_LOW(TOXOVO, 1e-10);
- LOV_i = `CLIP_LOW(LOV, 0.0);
- LP1_i = `CLIP_LOW(LP1, 1e-10);
- LP2_i = `CLIP_LOW(LP2, 1e-10);
- WBET_i = `CLIP_LOW(WBET, 1e-10);
- AXL_i = `CLIP_LOW(AXL, 0.0);
- ALP1L2_i = `CLIP_LOW(ALP1L2, 0.0);
- ALP2L2_i = `CLIP_LOW(ALP2L2, 0.0);
-`endif // Binning
-
- KVSAT_i = `CLIP_BOTH(KVSAT, -1.0, 1.0);
- LLODKUO_i = `CLIP_LOW(LLODKUO, 0.0);
- WLODKUO_i = `CLIP_LOW(WLODKUO, 0.0);
- LLODVTH_i = `CLIP_LOW(LLODVTH, 0.0);
- WLODVTH_i = `CLIP_LOW(WLODVTH, 0.0);
- LODETAO_i = `CLIP_LOW(LODETAO, 0.0);
-`endif // LocalModel
-
- // 4.1 Internal parameters (including temperature scaling)
- // (only internal parameters independent on instance parameters
- // are calculated in this section)
- if (TYPE >= 0) begin
- CHNL_TYPE = `NMOS;
- end else begin
- CHNL_TYPE = `PMOS;
- end
-
- // Transistor temperature
- TR_i = `CLIP_LOW(TR, -273);
- TKR = `KELVINCONVERSION + TR_i;
- TKD = $temperature + DTA;
- TKD_sq = TKD * TKD;
- dT = TKD - TKR;
- rT = TKD / TKR;
- rTn = TKR / TKD;
- phit = TKD * `KBOL / `QELE;
- inv_phit = 1.0 / phit;
-
- // Local process parameters
- Eg = 1.179 - 9.025e-5 * TKD - 3.05e-7 * TKD_sq;
- phibFac = (1.045 + 4.5e-4 * TKD) * (0.523 + 1.4e-3 * TKD - 1.48e-6 * TKD_sq) * TKD_sq / 9.0E4;
- phibFac = `MAX(phibFac, 1.0E-3);
-
-`ifdef NQSmodel
- // Round SWNQS to nearest allowed value
- if (SWNQS < 0.5) begin
- SWNQS_i = 0.0;
- end else begin
- if (SWNQS < 1.5) begin
- SWNQS_i = 1.0;
- end else begin
- if (SWNQS < 2.5) begin
- SWNQS_i = 2.0;
- end else begin
- if (SWNQS < 4.0) begin
- SWNQS_i = 3.0;
- end else begin
- if (SWNQS < 7.0) begin
- SWNQS_i = 5.0;
- end else begin
- SWNQS_i = 9.0;
- end
- end
- end
- end
- end
- inorm = 1.0e-12;
- r_nqs = 1.0e+3;
- vnorm = 10.0;
- vnorm_inv = 1.0 / vnorm;
-
- nt0 = 4 * `KBOL * TKD; // parameter for white noise of parasitic resistances
-`endif // NQSmodel
-
- // JUNCAP2
- `include "JUNCAP200_InitModel.include"
-
- end // initial_model
-
- begin : initial_instance
- // Code independent of bias, but dependent on instance parameters,
- // (including code dependent on parameters which could IN PRINCIPLE be scaled)
- // This block needs to be evaluated only once for each instance
-
-`ifdef LocalModel
- juncapwidth= JW;
-
-`else // LocalModel
- // Clipping of the instance parameters
- SAREF_i = `CLIP_LOW(SAREF, 1e-9);
- SBREF_i = `CLIP_LOW(SBREF, 1e-9);
- L_i = `CLIP_LOW(L, 1e-9);
- W_i = `CLIP_LOW(W, 1e-9);
- SA_i = SA;
- SB_i = SB;
-
- ///////////////////////////////////////////
- // GEOMETRICAL PARAMETERSCALING
- ///////////////////////////////////////////
-
- // 3.2 Transistor geometry
- LEN = 1e-6;
- WEN = 1e-6;
- iL = LEN / L_i;
- iW = WEN / W_i;
-`ifdef Binning
- delLPS = LVARO * (1.0 + LVARL * iL);
- delWOD = WVARO * (1.0 + WVARW * iW);
-`else // Binning
- delLPS = LVARO * (1.0 + LVARL * iL) * (1.0 + LVARW * iW);
- delWOD = WVARO * (1.0 + WVARL * iL) * (1.0 + WVARW * iW);
-`endif // Binning
- LE = `CLIP_LOW(L_i + delLPS - 2.0 * LAP, 1e-9);
- WE = `CLIP_LOW(W_i + delWOD - 2.0 * WOT, 1e-9);
- LEcv = `CLIP_LOW(L_i + delLPS - 2.0 * LAP + DLQ, 1e-9);
- WEcv = `CLIP_LOW(W_i + delWOD - 2.0 * WOT + DWQ, 1e-9);
- Lcv = `CLIP_LOW(L_i + delLPS + DLQ, 1e-9);
- Wcv = `CLIP_LOW(W_i + delWOD + DWQ, 1e-9);
- iLE = LEN / LE;
- iWE = WEN / WE;
- juncapwidth= WE;
-
-`ifdef Binning
- // 3.4 Geometry scaling with binning scaling rules
- `include "PSP102_binning.include"
-
-`else // Binning
- // 3.3 Geometry scaling with physical scaling rules
-
- // Process parameters
- VFB = VFBO * (1.0 + VFBL * iLE) * (1.0 + VFBW * iWE) * (1.0 + VFBLW * iLE * iWE);
- STVFB = STVFBO * (1.0 + STVFBL * iLE) * (1.0 + STVFBW * iWE) * (1.0 + STVFBLW * iLE * iWE);
- TOX = TOXO;
- NSUB0e = NSUBO_i * `MAX(( 1.0 + NSUBW * iWE * ln( 1.0 + WE / WSEG_i )), 1.0E-03);
- NPCKe = NPCK_i * `MAX(( 1.0 + NPCKW * iWE * ln( 1.0 + WE / WSEGP_i )), 1.0E-03);
- LPCKe = LPCK_i * `MAX(( 1.0 + LPCKW * iWE * ln( 1.0 + WE / WSEGP_i )), 1.0E-03);
- if (LE > (2 * LPCKe)) begin
- AA = 7.5e10;
- BB = sqrt(NSUB0e + 0.5 * NPCKe) - sqrt(NSUB0e);
- NSUB = sqrt(NSUB0e) + AA * ln(1 + 2 * LPCKe / LE * (exp(BB / AA) - 1));
- NSUB = NSUB * NSUB;
- end else begin
- if (LE >= LPCKe) begin
- NSUB = NSUB0e + NPCKe * LPCKe / LE;
- end else begin // LE < LPCK
- NSUB = NSUB0e + NPCKe * (2 - LE / LPCKe);
- end
- end
- NEFF = NSUB * (1 - FOL1 * iLE - FOL2 * iLE * iLE);
- VNSUB = VNSUBO;
- NSLP = NSLPO;
- DNSUB = DNSUBO;
- DPHIB = (DPHIBO + DPHIBL * pow(iLE, DPHIBLEXP)) * (1.0 + DPHIBW * iWE) * (1.0 + DPHIBLW * iLE * iWE);
- NP = NPO * `MAX(1e-6, (1.0 + NPL * iLE));
- CT = (CTO + CTL * pow(iLE, CTLEXP)) * (1.0 + CTW * iWE) * (1.0 + CTLW * iLE * iWE);
- TOXOV = TOXOVO;
- NOV = NOVO;
-
- // DIBL parameters
- CF = CFL * pow(iLE, CFLEXP) * (1.0 + CFW * iWE);
- CFB = CFBO;
-
- // Mobility parameters
- FBET1e = FBET1 * (1.0 + FBET1W * iWE);
- LP1e = LP1_i * `MAX(1.0 + LP1W * iWE, 1.0E-03);
- GPE = 1.0 + FBET1e * LP1e / LE * (1.0 - exp(-LE / LP1e)) + FBET2 * LP2_i / LE * (1.0 - exp(-LE / LP2_i));
- GPE = `MAX(GPE, 1e-15);
- GWE = 1.0 + BETW1 * iWE + BETW2 * iWE * ln(1.0 + WE / WBET_i);
- BETN = UO * WE / (GPE * LE) * GWE;
- STBET = STBETO * (1.0 + STBETL * iLE) * (1.0 + STBETW * iWE) * (1.0 + STBETLW * iLE * iWE);
- MUE = MUEO * (1.0 + MUEW * iWE);
- STMUE = STMUEO;
- THEMU = THEMUO;
- STTHEMU = STTHEMUO;
- CS = (CSO + CSL * pow(iLE, CSLEXP)) * (1.0 + CSW * iWE) * (1.0 + CSLW * iLE * iWE);
- STCS = STCSO;
- XCOR = XCORO * (1.0 + XCORL * iLE) * (1.0 + XCORW * iWE) * (1.0 + XCORLW * iLE * iWE);
- STXCOR = STXCORO;
- FETA = FETAO;
-
- // Series resistance
- RS = RSW1 * iWE * (1.0 + RSW2 * iWE);
- STRS = STRSO;
- RSB = RSBO;
- RSG = RSGO;
-
- // Velocity saturation
- THESAT = (THESATO + THESATL* GWE / GPE * pow(iLE, THESATLEXP)) * (1.0 + THESATW * iWE) * (1.0 + THESATLW * iLE * iWE);
- STTHESAT = STTHESATO * (1.0 + STTHESATL * iLE) * (1.0 + STTHESATW * iWE) * (1.0 + STTHESATLW * iLE * iWE);
- THESATB = THESATBO;
- THESATG = THESATGO;
-
- // Saturation voltage
- AX = AXO / (1.0 + AXL_i * iLE);
-
- // Channel length modulation
- ALP = ALPL * pow(iLE, ALPLEXP) * (1.0 + ALPW * iWE);
- tmpx = pow(iLE, ALP1LEXP);
- ALP1 = ALP1L1 * tmpx * (1.0 + ALP1W * iWE) / (1.0 + ALP1L2_i * iLE * tmpx);
- tmpx = pow(iLE, ALP2LEXP);
- ALP2 = ALP2L1 * tmpx * (1.0 + ALP2W * iWE) / (1.0 + ALP2L2_i * iLE * tmpx);
- VP = VPO;
-
- // Impact ionization
- A1 = A1O * (1.0 + A1L * iLE) * (1.0 + A1W * iWE);
- A2 = A2O;
- STA2 = STA2O;
- A3 = A3O * (1.0 + A3L * iLE) * (1.0 + A3W * iWE);
- A4 = A4O * (1.0 + A4L * iLE) * (1.0 + A4W * iWE);
-
- // Gate current
- GCO = GCOO;
- IGINV = IGINVLW / (iWE * iLE);
- IGOV = IGOVW * LOV_i / (LEN * iWE);
- STIG = STIGO;
- GC2 = GC2O;
- GC3 = GC3O;
- CHIB = CHIBO;
-
- // GIDL
- AGIDL = AGIDLW * LOV_i / (LEN * iWE);
- BGIDL = BGIDLO;
- STBGIDL = STBGIDLO;
- CGIDL = CGIDLO;
-
- // Charge model parameters
- COX = `EPSOX * WEcv * LEcv / TOX_i;
- CGOV = `EPSOX * WEcv * LOV_i / TOXOV_i;
- CGBOV = CGBOVL * Lcv / LEN;
- CFR = CFRW * Wcv / WEN;
- FNT = FNTO;
-
- // Noise model parameters
- NFA = iWE * iLE * NFALW;
- NFB = iWE * iLE * NFBLW;
- NFC = iWE * iLE * NFCLW;
-`endif // Binning
-
-`ifdef NQSmodel
- MUNQS = MUNQSO;
- RG = RGO;
- RWELL = RWELLO;
- RBULK = RBULKO;
- RJUNS = RJUNSO;
- RJUND = RJUNDO;
-`endif // NQSModel
-
- ///////////////////////////////////////////
- // STRESSMODEL
- ///////////////////////////////////////////
-
- // 3.5 Stress equations
- if ((SA_i > 0) && (SB_i > 0)) begin
- // Auxiliary variables
- Invsa = 1.0 / (SA_i + 0.5 * L_i);
- Invsb = 1.0 / (SB_i + 0.5 * L_i);
- Invsaref = 1.0 / (SAREF_i + 0.5 * L_i);
- Invsbref = 1.0 / (SBREF_i + 0.5 * L_i);
- Lx = `MAX(L_i + delLPS, 1e-9);
- Wx = `MAX(W_i + delWOD + WLOD, 1e-9);
- templ = 1.0 / pow(Lx, LLODKUO_i);
- tempw = 1.0 / pow(Wx, WLODKUO_i);
- Kstressu0 = (1.0 + LKUO * templ + WKUO * tempw + PKUO * templ * tempw) * (1.0 + TKUO * (rT - 1.0));
- rhobeta = KUO * (Invsa + Invsb) / Kstressu0;
- rhobetaref = KUO * (Invsaref + Invsbref) / Kstressu0;
- templ = 1.0 / pow(Lx, LLODVTH_i);
- tempw = 1.0 / pow(Wx, WLODVTH_i);
- Kstressvth0= 1.0 + LKVTHO * templ + WKVTHO * tempw + PKVTHO * templ * tempw;
- temp0 = Invsa + Invsb - Invsaref - Invsbref;
-
- // Parameter adaptations
- BETN = BETN * (1.0 + rhobeta) / (1.0 + rhobetaref);
- THESAT = THESAT * (1.0 + rhobeta) * (1.0 + KVSAT_i * rhobetaref) / ((1.0 + rhobetaref) * (1.0 + KVSAT_i * rhobeta));
- VFB = VFB + KVTHO * temp0 / Kstressvth0;
- CF = CF + STETAO * temp0 / pow(Kstressvth0, LODETAO_i);
- end
-
- ///////////////////////////////////////////
- // END OF SCALINGRULES AND STRESSMODEL
- ///////////////////////////////////////////
-
-`endif // LocalModel
- // 4.1 Internal parameters (including temperature scaling)
-
- // Clipping of the local model parameters
- VFB_i = VFB;
- STVFB_i = STVFB;
- TOX_i = `CLIP_LOW(TOX, 1e-10);
- NEFF_i = `CLIP_BOTH(NEFF, 1e20, 1e26);
- VNSUB_i = VNSUB;
- NSLP_i = `CLIP_LOW(NSLP, 1e-3);
- DNSUB_i = `CLIP_BOTH(DNSUB, 0.0, 1.0);
- DPHIB_i = DPHIB;
- NP_i = `CLIP_LOW(NP, 0.0);
- QMC_i = `CLIP_LOW(QMC, 0.0);
- CT_i = `CLIP_LOW(CT, 0.0);
- TOXOV_i = `CLIP_LOW(TOXOV, 1e-10);
- NOV_i = `CLIP_BOTH(NOV, 1e20, 1e27);
- CF_i = `CLIP_LOW(CF, 0.0);
- CFB_i = `CLIP_BOTH(CFB, 0.0, 1.0);
- BET_i = `CLIP_LOW(BETN, 0.0);
- STBET_i = STBET;
- MUE_i = `CLIP_LOW(MUE, 0.0);
- STMUE_i = STMUE;
- THEMU_i = `CLIP_LOW(THEMU, 0.0);
- STTHEMU_i = STTHEMU;
- CS_i = `CLIP_LOW(CS, 0.0);
- STCS_i = STCS;
- XCOR_i = `CLIP_LOW(XCOR, 0.0);
- STXCOR_i = STXCOR;
- FETA_i = `CLIP_LOW(FETA, 0.0);
- RS_i = `CLIP_LOW(RS, 0.0);
- STRS_i = STRS;
- RSB_i = `CLIP_BOTH(RSB, -0.5, 1.0);
- RSG_i = `CLIP_LOW(RSG, -0.5);
- THESAT_i = `CLIP_LOW(THESAT, 0.0);
- STTHESAT_i = STTHESAT;
- THESATB_i = `CLIP_BOTH(THESATB, -0.5, 1.0);
- THESATG_i = `CLIP_LOW(THESATG, -0.5);
- AX_i = `CLIP_LOW(AX, 2.0);
- ALP_i = `CLIP_LOW(ALP, 0.0);
- ALP1_i = `CLIP_LOW(ALP1, 0.0);
- ALP2_i = `CLIP_LOW(ALP2, 0.0);
- VP_i = `CLIP_LOW(VP, 1.0e-10);
- A1_i = `CLIP_LOW(A1, 0.0);
- A2_i = `CLIP_LOW(A2, 0.0);
- STA2_i = STA2;
- A3_i = `CLIP_LOW(A3, 0.0);
- A4_i = `CLIP_LOW(A4, 0.0);
- GCO_i = `CLIP_BOTH(GCO, -10.0, 10.0);
- IGINV_i = `CLIP_LOW(IGINV, 0.0);
- IGOV_i = `CLIP_LOW(IGOV, 0.0);
- STIG_i = STIG;
- GC2_i = `CLIP_BOTH(GC2, 0.0, 10.0);
- GC3_i = `CLIP_BOTH(GC3, -10.0, 10.0);
- CHIB_i = `CLIP_LOW(CHIB, 1.0);
- AGIDL_i = `CLIP_LOW(AGIDL, 0.0);
- BGIDL_i = `CLIP_LOW(BGIDL, 0.0);
- STBGIDL_i = STBGIDL;
- CGIDL_i = CGIDL;
- COX_i = `CLIP_LOW(COX, 0.0);
- CGOV_i = `CLIP_LOW(CGOV, 0.0);
- CGBOV_i = `CLIP_LOW(CGBOV, 0.0);
- CFR_i = `CLIP_LOW(CFR, 0.0);
- FNT_i = `CLIP_LOW(FNT, 0.0);
- NFA_i = `CLIP_LOW(NFA, 0.0);
- NFB_i = `CLIP_LOW(NFB, 0.0);
- NFC_i = `CLIP_LOW(NFC, 0.0);
- MULT_i = `CLIP_LOW(MULT, 0.0);
-
-
- // Local process parameters
- phit1 = phit * (1.0 + CT_i * rTn);
- inv_phit1 = 1.0 / phit1;
-
- VFB_i = VFB_i + STVFB_i * dT;
- phib = Eg + DPHIB_i + 2.0 * phit * ln(NEFF_i * pow(phibFac, -0.75) * 4.0e-26);
- phib = `MAX(phib, 5.0E-2);
- CoxPrime = `EPSOX / TOX_i;
- tox_sq = TOX_i * TOX_i;
- G_0 = sqrt(2.0 * `QELE * NEFF_i * `EPSSI * inv_phit) / CoxPrime;
-
- // Poly-silicon depletion
- kp = 0.0;
- if (NP_i > 0.0) begin
- arg2max = 8.0e7 / tox_sq;
- np = `MAX(NP_i, arg2max);
- np = `MAX(3.0e25, np);
- kp = 2.0 * CoxPrime * CoxPrime * phit / (`QELE * np * `EPSSI);
- end
-
- // QM corrections
- qlim2 = 100.0 * phit * phit;
- qq = 0.0;
- if (QMC_i > 0.0) begin
- qq = 0.4 * `QMN * QMC_i * pow(CoxPrime, `twoThirds);
- if (CHNL_TYPE==`PMOS) begin
- qq = `QMP / `QMN * qq;
- end
- qb0 = sqrt(phit * G_0 * G_0 * phib);
- dphibq = 0.75 * qq * pow(qb0, `twoThirds);
- phib = phib + dphibq;
- G_0 = G_0 * (1.0 + 2.0 * `twoThirds * dphibq / qb0);
- end
- sqrt_phib = sqrt(phib);
- phix = 0.95 * phib;
- aphi = 0.0025 * phib * phib;
- bphi = aphi;
- phix2 = 0.5 * sqrt(bphi);
- phix1 = `MINA(phix - phix2, 0, aphi);
-
- // Gate overlap
- CoxovPrime = `EPSOX / TOXOV_i;
- GOV = sqrt(2.0 * `QELE * NOV_i * `EPSSI * inv_phit) / CoxovPrime;
- GOV2 = GOV * GOV;
- xi_ov = 1.0 + GOV * `invSqrt2;
- inv_xi_ov = 1.0 / xi_ov;
- x_mrg_ov = 1.0e-5 * xi_ov;
-
- // Mobility parameters
- tf_bet = pow(rTn, STBET_i);
- BET_i = BET_i * CoxPrime * tf_bet;
- THEMU_i = THEMU_i * pow(rTn, STTHEMU_i);
- tf_mue = pow(rTn, STMUE_i);
- MUE_i = MUE_i * tf_mue;
- tf_cs = pow(rTn, STCS_i);
- CS_i = CS_i * tf_cs;
- tf_xcor = pow(rTn, STXCOR_i);
- XCOR_i = XCOR_i * tf_xcor;
- E_eff0 = 1.0e-8 * CoxPrime / `EPSSI;
- eta_mu = 0.5 * FETA_i;
- if (CHNL_TYPE == `PMOS) begin
- eta_mu = `oneThird * FETA_i;
- end
-
- // Series resistance
- tf_ther = pow(rTn, STRS_i);
- RS_i = RS_i * tf_ther;
- THER_i = 2 * BET_i * RS_i;
-
- // Velocity saturation
- tf_thesat = pow(rTn, STTHESAT_i);
- THESAT_i = THESAT_i * tf_thesat;
- Vdsat_lim = 3.912023005 * phit1;
-
- inv_AX = 1.0 / AX_i;
- inv_VP = 1.0 / VP_i;
-
- // Impact ionization
- A2_i = A2_i * pow(rT, STA2_i);
-
- // Gate current
- tf_ig = pow(rT, STIG_i);
- IGINV_i = IGINV_i * tf_ig;
- IGOV_i = IGOV_i * tf_ig;
- inv_CHIB = 1.0 / CHIB_i;
- tempM = 4.0 * `oneThird * sqrt(2 * `QELE * `MELE * CHIB_i) / `HBAR;
- BCH = tempM * TOX_i;
- BOV = tempM * TOXOV_i;
- GCQ = 0;
- if (GC3_i < 0) begin
- GCQ = -0.495 * GC2_i / GC3_i;
- end
- alpha_b = 0.5 * (phib + Eg);
- Dch = GCO_i * phit1;
- Dov = GCO_i * phit;
-
- // GIDL
- AGIDL_i = AGIDL_i * 4e-18 / (TOXOV_i * TOXOV_i);
- tempM = `MAX(1.0 + STBGIDL_i * dT, 0);
- BGIDL_i = BGIDL_i * tempM * TOXOV_i * 5e8;
-
- // Noise
- nt = FNT_i * 4 * `KBOL * TKD;
- Cox_over_q = CoxPrime / `QELE;
- Sfl_prefac = phit * phit * BET_i / Cox_over_q;
-
- // Additional internal parameters
- x1 = 1.25;
- inv_xg1 = 1.0 / (x1 + GOV * 7.324648775608221e-1); // = 1.0/(x1+GOV*sqrt(exp(-x1)+x1-1));
-`ifdef NQSmodel
-
- // NQS parameters and variables
- MUNQS_i = `CLIP_LOW(MUNQS, 0.0);
- RG_i = `CLIP_LOW(RG, 1.0e-6);
- RBULK_i = `CLIP_LOW(RBULK, 1.0e-6);
- RJUNS_i = `CLIP_LOW(RJUNS, 1.0e-6);
- RJUND_i = `CLIP_LOW(RJUND, 1.0e-6);
- RWELL_i = `CLIP_LOW(RWELL, 1.0e-6);
-
- // Conductance of parasitic resistance
- ggate = MULT_i / RG_i;
- gbulk = MULT_i / RBULK_i;
- gjuns = MULT_i / RJUNS_i;
- gjund = MULT_i / RJUND_i;
- gwell = MULT_i / RWELL_i;
-`endif // NQSmodel
-
- // JUNCAP2
- vbimins = 0.0;
- vfmins = 0.0;
- vchs = 0.0;
- vbbtlims = 0.0;
- vbimind = 0.0;
- vfmind = 0.0;
- vchd = 0.0;
- vbbtlimd = 0.0;
- vj = 0.0;
- idmult = 0.0;
- vjsrh = 0.0;
- zinv = 0.0;
- wdep = 0.0;
- wsrh = 0.0;
- asrh = 0.0;
- vav = 0.0;
- vbi_minus_vjsrh = 0.0;
-
- if (SWJUNCAP == 0.0) begin
- ABSOURCE_i = 0.0;
- LSSOURCE_i = 0.0;
- LGSOURCE_i = 0.0;
- ABDRAIN_i = 0.0;
- LSDRAIN_i = 0.0;
- LGDRAIN_i = 0.0;
- VMAXS = 0.0;
- VMAXD = 0.0;
- end else begin
- if (SWJUNCAP == 2.0) begin
- ABSOURCE_i = `CLIP_LOW(AS, `AB_cliplow);
- LSSOURCE_i = `CLIP_LOW(PS, `LS_cliplow);
- LGSOURCE_i = juncapwidth;
- ABDRAIN_i = `CLIP_LOW(AD, `AB_cliplow);
- LSDRAIN_i = `CLIP_LOW(PD, `LS_cliplow);
- LGDRAIN_i = juncapwidth;
- end else begin
- if (SWJUNCAP == 3.0) begin
- ABSOURCE_i = `CLIP_LOW(AS, `AB_cliplow);
- ABDRAIN_i = `CLIP_LOW(AD, `AB_cliplow);
- LSSOURCE_i = `CLIP_LOW(PS - juncapwidth, `LS_cliplow);
- LGSOURCE_i = juncapwidth;
- LSDRAIN_i = `CLIP_LOW(PD - juncapwidth, `LS_cliplow);
- LGDRAIN_i = juncapwidth;
- end else begin
- ABSOURCE_i = `CLIP_LOW(ABSOURCE, `AB_cliplow);
- LSSOURCE_i = `CLIP_LOW(LSSOURCE, `LS_cliplow);
- LGSOURCE_i = `CLIP_LOW(LGSOURCE, `LG_cliplow);
- ABDRAIN_i = `CLIP_LOW(ABDRAIN, `AB_cliplow);
- LSDRAIN_i = `CLIP_LOW(LSDRAIN, `LS_cliplow);
- LGDRAIN_i = `CLIP_LOW(LGDRAIN, `LG_cliplow);
- end
- end
- `JuncapInitInstance(ABSOURCE_i, LSSOURCE_i, LGSOURCE_i, VMAXS, vbimins, vchs, vfmins, vbbtlims)
- `JuncapInitInstance(ABDRAIN_i, LSDRAIN_i, LGDRAIN_i, VMAXD, vbimind, vchd, vfmind, vbbtlimd)
- end
-
-
- end // initial_instance
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // DC bias dependent quantities (calculations for current contribs)
- //
- /////////////////////////////////////////////////////////////////////////////
-
- begin : evaluateStatic
- // Initialisation of some variables
- SP_S_x1 = 0.0;
- x_s = 0.0;
- sqm = 0.0;
- alpha = 0.0;
- eta_p = 1.0;
- xitsb = 0.0;
- rhob = 0.0;
- GdL = 1.0;
- FdL = 1.0;
- Gmob = 1.0;
- Gmob_dL = 1.0;
- Udse = 0.0;
- QCLM = 0.0;
- thesat1 = 0.0;
- Gvsat = 1.0;
- Gvsatinv = 1.0;
- xgm = 0.0;
- dps = 0.0;
- qim = 0.0;
- qim1 = 0.0;
- H = 1.0;
- xs_ov = 0.0;
- xd_ov = 0.0;
- Vovs = 0.0;
- Vovd = 0.0;
- Iimpact = 0.0;
- mavl = 0.0;
-
-`ifdef NQSmodel
- // Initialization of variables for NQS model
- pd = 1.0;
- ym = 0.0;
-
- Vrg = V(G ,GP);
- Vrjuns = V(BS,BI);
- Vrjund = V(BD,BI);
- Vrbulk = V(BP,BI);
- Vrwell = V(B ,BI);
-`endif // NQSmodel
- if (CHNL_TYPE == `NMOS) begin
- Vgs = V(`Gint, S);
- Vds = V(D, S);
- Vsb = V(S, `Bint);
- Vjuns = -V(S, `Bjs);
- Vjund = -V(D, `Bjd);
- end else begin
- Vgs = -V(`Gint, S);
- Vds = -V(D, S);
- Vsb = -V(S, `Bint);
- Vjuns = V(S, `Bjs);
- Vjund = V(D, `Bjd);
- end
-
- // Source-drain interchange
- sigVds = 1.0;
- if (Vds < 0.0) begin
- sigVds = -1.0;
- Vgs = Vgs - Vds;
- Vsb = Vsb + Vds;
- Vds = -Vds;
- end
-
- Vgd = Vgs - Vds;
- Vdb = Vds + Vsb;
- Vgb = Vgs + Vsb;
-
- xgs_ov = -Vgs * inv_phit;
- xgd_ov = -Vgd * inv_phit;
-
- // 4.2.1 Conditioning of terminal voltages
- temp = `MINA(Vdb, Vsb, bphi) + phix;
- Vsbstar = Vsb - `MINA(temp, 0, aphi) + phix1;
- Vdbstar = Vds + Vsbstar;
- Vgbstar = Vgs + Vsbstar;
- Vgb1 = Vgbstar - VFB_i;
- Vdsx = sqrt(Vds * Vds + 0.01) - 0.1;
- Vsbx = Vsbstar + 0.5 * (Vds - Vdsx);
- delVg = CF_i * (Vdsx * (1 + CFB_i * Vsbx)); // DIBL
- Vgb1 = Vgb1 + delVg;
- xg = Vgb1 * inv_phit1;
-
- // 4.2.2 Bias dependent body factor
- if (DNSUB_i > 0.0) begin
- Dnsub = DNSUB_i * `MAXA(0, Vgs + Vsb - VNSUB_i, NSLP_i);
- Gf = G_0 * sqrt(1.0 + Dnsub);
- end else begin
- Gf = G_0;
- end
-
- // 4.2.3 Surface potential at source side
- Gf2 = Gf * Gf;
- inv_Gf2 = 1.0 / Gf2;
- xi = 1.0 + Gf * `invSqrt2;
- inv_xi = 1.0 / xi;
- Ux = Vsbstar * inv_phit1;
- xn_s = phib * inv_phit1 + Ux;
- if (xn_s < `se)
- delta_ns = exp(-xn_s);
- else
- delta_ns = `ke / `P3(xn_s - `se);
- margin = 1e-5 * xi;
-
- `sp_s(x_s, xg, xn_s, delta_ns)
- x_d = x_s;
- x_m = x_s;
- x_ds = 0.0;
-
- //
- // Core PSP current calculation
- //
- if (xg <= 0.0) begin
- qis = 0.0;
- Ids = 0.0;
- xgm = xg - x_s;
- Voxm = xgm * phit1;
- qeff = Voxm;
- Vdsat = Vdsat_lim;
- end else begin // (xg > 0)
- delta_1s = 0.0;
- temp = 1.0 / (2.0 + x_s * x_s);
- xi0s = x_s * x_s * temp;
- xi1s = 4.0 * (x_s * temp * temp);
- xi2s = (8.0 * temp - 12.0 * xi0s) * temp * temp;
- if (x_s < `se05) begin
- delta_1s = exp(x_s);
- Es = 1.0 / delta_1s;
- delta_1s = delta_ns * delta_1s;
- end else if (x_s > (xn_s - `se05)) begin
- delta_1s = exp(x_s - xn_s);
- Es = delta_ns / delta_1s;
- end else begin
- delta_1s = `ke05 / `P3(xn_s - x_s - `se05);
- Es = `ke05 / `P3(x_s - `se05);
- end
- Ds = delta_1s - delta_ns * (x_s + 1.0 + xi0s);
- if (x_s < 1.0e-5) begin
- Ps = 0.5 * (x_s * x_s * (1.0 - `oneThird * (x_s * (1.0 - 0.25 * x_s))));
- Ds = `oneSixth * (delta_ns * x_s * x_s * x_s * (1.0 + 1.75 * x_s));
- temp = sqrt(1.0 - `oneThird * (x_s * (1.0 - 0.25 * x_s)));
- sqm = `invSqrt2 * (x_s * temp);
- alpha = 1.0 + Gf * `invSqrt2 * (1.0 - 0.5 * x_s + `oneSixth * (x_s * x_s)) / temp;
- end else begin
- Ps = x_s - 1.0 + Es;
- sqm = sqrt(Ps);
- alpha = 1.0 + 0.5 * (Gf * (1.0 - Es) / sqm);
- end
- Em = Es;
- Ed = Em;
- Dm = Ds;
- Dd = Dm;
-
- // 4.2.4 Drain saturation voltage
- Rxcor = (1.0 + 0.2 * XCOR_i * Vsbx) / (1.0 + XCOR_i * Vsbx);
- if ( Ds > `ke05) begin
- xgs = Gf * sqrt(Ps + Ds);
- qis = Gf2 * Ds * phit1 / (xgs + Gf * sqm);
- qbs = sqm * Gf * phit1;
- if (RSB_i < 0) begin
- rhob = 1.0 / (1.0 - RSB_i * Vsbx);
- end else begin
- rhob = 1.0 + RSB_i * Vsbx;
- end
- if (RSG_i < 0) begin
- temp = 1.0 - RSG_i * qis;
- end else begin
- temp = 1.0 / (1.0 + RSG_i * qis);
- end
- GR = THER_i * (rhob * temp * qis);
- Eeffm = E_eff0 * (qbs + eta_mu * qis);
- Mutmp = pow(Eeffm * MUE_i, THEMU_i) + CS_i * (Ps / (Ps + Ds + 1.0e-14));
- Gmob = (1.0 + Mutmp + GR) * Rxcor;
- if (THESATB_i < 0) begin
- xitsb = 1.0 / (1.0 - THESATB_i * Vsbx);
- end else begin
- xitsb = 1.0 + THESATB_i * Vsbx;
- end
- temp2 = qis * xitsb;
- wsat = 100.0 * (temp2 / (100.0 + temp2));
- if (THESATG_i < 0) begin
- temp = 1 / (1 - THESATG_i * wsat);
- end else begin
- temp = 1 + THESATG_i * wsat;
- end
- thesat1 = THESAT_i * (temp / Gmob);
- phi_inf = qis / alpha + phit1;
- ysat = thesat1 * phi_inf * `invSqrt2;
- if (CHNL_TYPE==`PMOS) begin
- ysat = ysat / sqrt(1.0 + ysat);
- end
- za = 2.0 / (1.0 + sqrt(1.0 + 4.0 * ysat));
- temp1 = za * ysat;
- Phi_0 = phi_inf * za * (1.0 + 0.86 * (temp1 * (1.0 - temp1 * za) / (1.0 + 4.0 * (temp1 * temp1 * za))));
- asat = xgs + 0.5 * Gf2;
- Phi_2 = 0.98 * (Gf2 * Ds * phit1 / (asat + sqrt(asat * asat - Gf2 * Ds * 0.98)));
- Phi_0_2 = Phi_0 + Phi_2;
- Phi0_Phi2 = 2.0 * (Phi_0 * Phi_2);
- Phi_sat = Phi0_Phi2 / (Phi_0_2 + sqrt(Phi_0_2 * Phi_0_2 - 1.98 * Phi0_Phi2));
- Vdsat = Phi_sat - phit1 * ln(1.0 + Phi_sat * (Phi_sat - 2.0 * asat * phit1) * inv_Gf2 / (phit1 * phit1 * Ds));
- end else begin
- Vdsat = Vdsat_lim;
- end
- temp = pow(Vds / Vdsat, AX_i);
- Vdse = Vds * pow(1.0 + temp, -inv_AX);
-
- // 4.2.5 Surface potential at drain side
- Udse = Vdse * inv_phit1;
- xn_d = xn_s + Udse;
- if (Udse < `se) begin
- k_ds = exp(-Udse);
- end else begin
- k_ds = `ke / `P3(Udse - `se);
- end
- delta_nd = delta_ns * k_ds;
-
- `sp_s_d(x_d, xg, xn_d, delta_nd)
- x_ds = x_d - x_s;
-
- //
- // Approximations for extremely small x_ds: capacitance calulation
- //
- if (x_ds < 1.0E-10) begin
- pC = 2.0 * (xg - x_s) + Gf2 * (1.0 - Es + delta_1s * k_ds - delta_nd * (1.0 + xi1s));
- qC = Gf2 * (1.0 - k_ds) * Ds;
- temp = 2.0 - Gf2 * (Es + delta_1s * k_ds - delta_nd * xi2s);
- temp = pC * pC - 2.0 * (temp * qC);
- x_ds = 2.0 * (qC / (pC + sqrt(temp)));
- x_d = x_s + x_ds;
- end
- dps = x_ds * phit1; // deltaPsi
-
- xi0d = x_d * x_d / (2.0 + x_d * x_d);
- if (x_d < `se05) begin
- Ed = exp(-x_d);
- if (x_d < 1.0e-5) begin
- Dd = `oneSixth * delta_nd * x_d * x_d * x_d * (1.0 + 1.75 * x_d);
- end else begin
- Dd = delta_nd * (1.0 / Ed - x_d - 1.0 - xi0d);
- end
- end else begin
- if (x_d > (xn_d - `se05)) begin
- temp = exp(x_d - xn_d);
- Ed = delta_nd / temp;
- Dd = temp - delta_nd * (x_d + 1.0 + xi0d);
- end else begin
- Ed = `ke05 / `P3(x_d - `se05);
- temp = `ke05 / `P3(xn_d - x_d - `se05);
- Dd = temp - delta_nd * (x_d + 1.0 + xi0d);
- end
- end
-
- // 4.2.6 Mid-point surface potential
- x_m = 0.5 * (x_s + x_d);
- Em = 0.0;
- temp = Ed * Es;
- if (temp > 0.0) begin
- Em = sqrt(temp);
- end
- D_bar = 0.5 * (Ds + Dd);
- Dm = D_bar + 0.125 * (x_ds * x_ds * (Em - 2.0 * inv_Gf2));
-
- if (x_m < 1.0e-5) begin
- Pm = 0.5 * (x_m * x_m * (1.0 - `oneThird * (x_m * (1.0 - 0.25 * x_m))));
- xgm = Gf * sqrt(Dm + Pm);
-
- // 4.2.7 Polysilicon depletion
- if (kp > 0.0) begin
- eta_p = 1.0 / sqrt(1.0 + kp * xgm);
- end // (kp > 0.0)
- temp = sqrt(1.0 - `oneThird * (x_m * (1.0 - 0.25 * x_m)));
- sqm = `invSqrt2 * (x_m * temp);
- alpha = eta_p + `invSqrt2 * (Gf * (1.0 - 0.5 * x_m + `oneSixth * (x_m * x_m)) / temp);
- end else begin
- Pm = x_m - 1.0 + Em;
- xgm = Gf * sqrt(Dm + Pm);
-
- // 4.2.7 Polysilicon depletion
- if (kp > 0.0) begin
- d0 = 1.0 - Em + 2.0 * (xgm * inv_Gf2);
- eta_p = 1.0 / sqrt(1.0 + kp * xgm);
- temp = eta_p / (eta_p + 1.0);
- x_pm = kp * (temp * temp * Gf2 * Dm);
- p_pd = 2.0 * (xgm - x_pm) + Gf2 * (1.0 - Em + Dm);
- q_pd = x_pm * (x_pm - 2.0 * xgm);
- xi_pd = 1.0 - 0.5 * (Gf2 * (Em + Dm));
- u_pd = q_pd * p_pd / (p_pd * p_pd - xi_pd * q_pd);
- x_m = x_m + u_pd;
- km = exp(u_pd);
- Em = Em / km;
- Dm = Dm * km;
- Pm = x_m - 1.0 + Em;
- xgm = Gf * sqrt(Dm + Pm);
- help = 1.0 - Em + 2.0 * (xgm * eta_p * inv_Gf2);
- x_ds = x_ds * km * (d0 + D_bar) / (help + km * D_bar);
- dps = x_ds * phit1;
- end // (kp > 0.0)
- sqm = sqrt(Pm);
- alpha = eta_p + 0.5 * (Gf * (1.0 - Em) / sqm);
- end
-
- // 4.2.8 Potential midpoint inversion charge
- qim = phit1 * (Gf2 * Dm / (xgm + Gf * sqm));
-
- // 4.2.8 Potential midpoint inversion charge (continued)
- qim1 = qim + phit1 * alpha;
- qim1_1 = 1.0 / qim1;
- qbm = sqm * Gf * phit1;
- // Series resistance
- if (RSG_i < 0) begin
- temp = 1.0 - RSG_i * qim;
- end else begin
- temp = 1.0 / (1.0 + RSG_i * qim);
- end
- GR = THER_i * (rhob * temp * qim);
- // Mobility reduction
- qeff = qbm + eta_mu * qim;
- Eeffm = E_eff0 * qeff;
- Mutmp = pow(Eeffm * MUE_i, THEMU_i) + CS_i * (Pm / (Pm + Dm + 1.0e-14));
- Gmob = (1.0 + Mutmp + GR) * Rxcor;
-
- // 4.2.9 Drain-source channel current
- // Channel length modulation
- r1 = qim * qim1_1;
- r2 = phit1 * (alpha * qim1_1);
- temp = ln((1.0 + (Vds - dps) * inv_VP) / (1.0 + (Vdse - dps) * inv_VP));
- temp1 = ln(1.0 + Vdsx * inv_VP);
- dL = ALP_i * temp;
- GdL = 1.0 / (1.0 + dL + dL * dL);
- dL1 = dL + ALP1_i * (qim1_1 * r1 * temp) + ALP2_i * (qbm * r2 * r2 * temp1);
- FdL = (1.0 + dL1 + dL1 * dL1) * GdL;
- // Velocity saturation
- temp2 = qim * xitsb;
- wsat = 100.0 * (temp2 / (100.0 + temp2));
- Gmob_dL = Gmob * GdL;
- if (THESATG_i < 0) begin
- temp = 1 / (1 - THESATG_i * wsat);
- end else begin
- temp = 1 + THESATG_i * wsat;
- end
- thesat1 = THESAT_i * (temp / Gmob_dL);
- zsat = thesat1 * thesat1 * dps * dps;
- if (CHNL_TYPE == `PMOS) begin
- zsat = zsat / (1.0 + thesat1 * dps);
- end
- Gvsat = 0.5 * (Gmob_dL * (1.0 + sqrt(1.0 + 2.0 * zsat)));
- Gvsatinv = 1.0 / Gvsat;
- // Drain-source current
- Ids = BET_i * (FdL * qim1 * dps * Gvsatinv);
-
- // 4.2.10 Variables for calculation of intrinsic charges and gate current
- Voxm = xgm * phit1;
- temp = Gmob_dL * Gvsatinv;
- alpha1 = alpha * (1.0 + 0.5 * (zsat * temp * temp));
- H = temp * qim1 / alpha1;
-
- // 4.2.11 Impact-Ionization
- if (SWIMPACT != 0) begin
- delVsat = Vds - A3_i * dps;
- if (delVsat > 0) begin
- temp2 = A2_i * ((1.0 + A4_i * (sqrt(phib + Vsbstar) - sqrt_phib)) / delVsat);
- `expl_low(-temp2, temp)
- mavl = A1_i * (delVsat * temp);
- Iimpact = Ids * mavl;
- end
- end
- end // (xg > 0)
-
- // 4.2.12 Surface potential in gate overlap regions
- if (((SWIGATE != 0) && (IGOV_i > 0)) || ((SWGIDL != 0) && (AGIDL_i > 0)) || (CGOV_i > 0)) begin
- `sp_ov(xs_ov, xgs_ov)
- `sp_ov(xd_ov, xgd_ov)
- Vovs = -phit * (xgs_ov + xs_ov);
- Vovd = -phit * (xgd_ov + xd_ov);
- end
-
- // 4.2.13 Gate current
- Igsov = 0.0;
- Igdov = 0.0;
- Igc = 0.0;
- Igs = 0.0;
- Igd = 0.0;
- Igb = 0.0;
- Igcs = 0.0;
- Igcd = 0.0;
- if (SWIGATE != 0) begin
- if (IGOV_i > 0) begin
-
- // Gate-source overlap component of gate current
- arg2mina = Vovs + Dov;
- psi_t = `MINA(0.0, arg2mina, 0.01);
- zg = sqrt(Vovs * Vovs + 1.0e-6) * inv_CHIB;
- if (GC3_i < 0) begin
- zg = `MINA(zg, GCQ, 1.0e-6);
- end
- arg1 = (3.0 + xs_ov + psi_t * inv_phit);
- `expl(arg1, Dsi)
- arg1 = -Vgs * inv_phit;
- `expl(arg1, temp)
- Dgate = Dsi * temp;
- temp = BOV * (-1.5 + zg * (GC2_i + GC3_i * zg));
- if (temp > 0) begin
- TP = `P3(temp);
- end else begin
- `expl_low(temp, TP)
- end
- Igsov = IGOV_i * (TP * ln((1.0 + Dsi) / (1.0 + Dgate)));
-
- // Gate-drain overlap component of gate current
- arg2mina = Vovd + Dov;
- psi_t = `MINA(0.0, arg2mina, 0.01);
- zg = sqrt(Vovd * Vovd + 1.0e-6) * inv_CHIB;
- if (GC3_i < 0) begin
- zg = `MINA(zg, GCQ, 1.0e-6);
- end
- arg1 = (3.0 + xd_ov + psi_t * inv_phit);
- `expl(arg1, Dsi)
- arg1 = -Vgd * inv_phit;
- `expl(arg1, temp)
- Dgate = Dsi * temp;
- temp = BOV * (-1.5 + zg * (GC2_i + GC3_i * zg));
- if (temp > 0) begin
- TP = `P3(temp);
- end else begin
- `expl_low(temp, TP)
- end
- Igdov = IGOV_i * (TP * ln((1.0 + Dsi) / (1.0 + Dgate)));
- end
-
- // Gate-channel component of gate current
- if (IGINV_i > 0) begin
- if (xg <= 0.0) begin
- temp = pow(Vds / Vdsat_lim, AX_i);
- Udse = Vds * pow(1.0 + temp, -inv_AX) * inv_phit1;
- end
- `expl_low(x_ds-Udse, temp)
- Vm = Vsbstar + phit1 * (0.5 * x_ds - ln(0.5 * (1.0 + temp)));
-
- arg2mina = Voxm + Dch;
- psi_t = `MINA(0.0, arg2mina, 0.01);
- zg = sqrt(Voxm * Voxm + 1.0e-6) * inv_CHIB;
- if (GC3_i < 0) begin
- zg = `MINA(zg, GCQ, 1.0e-06);
- end
- arg1 = (x_m + (psi_t - alpha_b - Vm) * inv_phit1);
- `expl(arg1,Dsi)
- arg1 = -(Vgs + Vsbstar - Vm) * inv_phit1;
- `expl(arg1,temp)
- Dgate = Dsi * temp;
- temp = BCH * (-1.5 + zg * (GC2_i + GC3_i * zg));
- if (temp > 0) begin
- TP = `P3(temp);
- end else begin
- `expl_low(temp, TP)
- end
- Igc0 = IGINV_i * (TP * ln((1.0 + Dsi) / (1.0 + Dgate)));
-
- // Source/drain partitioning of gate-channel current
- if ((xg <= 0) || ((GC2_i == 0) && (GC3_i == 0))) begin
- igc = 1.0;
- igcd_h = 0.5;
- end else begin
- temp = GC2_i + 2.0 * GC3_i * zg;
- u0 = CHIB_i / (temp * BCH);
- x = 0.5 * (dps / u0);
- u0_div_H = u0 / H;
- Bg = u0_div_H * (1.0 - u0_div_H) * 0.5;
- Ag = 0.5 - 3.0 * Bg;
- if (x < 1.0e-3) begin
- xsq = x * x;
- igc = 1.0 + xsq * (`oneSixth + u0_div_H * `oneThird + `oneSixth * (xsq * (0.05 + 0.2 * u0_div_H)));
- igcd_h = 0.5 * igc - `oneSixth * (x * (1.0 + xsq * (0.4 * (Bg + 0.25) + 0.0285714285714 * (xsq * (0.125 + Bg)))));
- end else begin
- inv_x = 1.0 / x;
- `expl(x, ex)
- inv_ex = 1.0 / ex;
- temp = ex - inv_ex;
- temp2 = ex + inv_ex;
- igc = 0.5 * ((1.0 - u0_div_H) * temp * inv_x + u0_div_H * temp2);
- igcd_h = 0.5 * (igc - temp * (Bg - Ag * inv_x * inv_x) - Ag * temp2 * inv_x);
- end
- end
- Sg = 0.5 * (1.0 + xg / sqrt(xg * xg + 1.0e-6));
- Igc = Igc0 * igc * Sg;
- Igcd = Igc0 * igcd_h * Sg;
- Igcs = Igc - Igcd;
- Igb = Igc0 * igc * (1.0 - Sg);
- end // (IGINV >0)
- Igs = Igsov + Igcs;
- Igd = Igdov + Igcd;
- end // (SWIGATE != 0)
-
- // 4.2.14 GIDL/GISL current
- Igidl = 0.0;
- Igisl = 0.0;
- if ((SWGIDL != 0) && (AGIDL_i > 0)) begin
-
- // GIDL current computation
- if (Vovd < 0) begin
- Vtovd = sqrt(Vovd * Vovd + CGIDL_i * CGIDL_i * (Vdb * Vdb) + 1.0e-6);
- temp = -BGIDL_i / Vtovd;
- `expl_low(temp, temp2)
- Igidl = -AGIDL_i * (Vdb * Vovd * Vtovd * temp2);
- end
-
- // GISL current computation
- if (Vovs < 0) begin
- Vtovs = sqrt(Vovs * Vovs + CGIDL_i * CGIDL_i * (Vsb * Vsb) + 1.0e-6);
- temp = -BGIDL_i / Vtovs;
- `expl_low(temp, temp2)
- Igisl = -AGIDL_i * (Vsb * Vovs * Vtovs * temp2);
- end
- end // (SWGIDL != 0)
-
- end // evaluateStatic
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // AC bias dependent quantities (calculations for charge contribs)
- //
- /////////////////////////////////////////////////////////////////////////////
-
- begin : evaluateDynamic
-
- // 4.2.16 Quantum mechanical corrections
- COX_qm = COX_i;
- if (qq > 0.0) begin
- COX_qm = COX_i / (1.0 + qq * pow(qeff * qeff + qlim2, -1.0 * `oneSixth));
- end
-
- // 4.2.17 Intrinsic charge model
- if (xg <= 0.0) begin
- QG = Voxm;
- QI = 0.0;
- QD = 0.0;
- QB = QG;
- end else begin
- Fj = 0.5 * (dps / H);
- Fj2 = Fj * Fj;
- QCLM = (1.0 - GdL) * (qim - 0.5 * (alpha * dps));
- QG = Voxm + 0.5 * (eta_p * dps * (Fj * GdL * `oneThird - 1.0 + GdL));
- temp = alpha * dps * `oneSixth;
- QI = GdL * (qim + temp * Fj) + QCLM;
- QD = 0.5 * (GdL * GdL * (qim - temp * (1.0 - Fj - 0.2 * Fj2)) + QCLM * (1.0 + GdL));
- QB = QG - QI;
- end
- Qg = QG * COX_qm;
- Qd = -QD * COX_qm;
- Qb = -QB * COX_qm;
-
- // 4.2.18 Extrinsic charge model
- Qgs_ov = CGOV_i * Vovs;
- Qgd_ov = CGOV_i * Vovd;
- Qgb_ov = CGBOV_i * Vgb;
-
- // Outer fringe charge
- Qfgs = CFR_i * Vgs;
- Qfgd = CFR_i * Vgd;
-`ifdef NQSmodel
-
- // Variables for NQS model
- Gp = 0.0;
- Gp2 = 0.0;
- a_factrp = 0.0;
- marginp = 0.0;
- if (SWNQS_i != 0) begin
- if (xg <= 0.0) begin
- ym = 0.5;
- pd = 1.0;
- Gp = Gf;
- end else begin
- ym = 0.5 * ( 1.0 + 0.25 * (dps / H));
- pd = xgm / (xg - x_m);
- Gp = Gf / pd;
- end
- Gp2 = Gp * Gp;
- a_factrp = 1.0 + Gp * `invSqrt2;
- marginp = 1e-5 * a_factrp;
- end
-`endif // NQSmodel
-
- end // evaluateDynamic
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // JUNCAP2 contribs
- //
- /////////////////////////////////////////////////////////////////////////////
-
- begin : evaluateStaticDynamic
-
- // Source side
- VAK = Vjuns;
- VMAX = VMAXS;
- vbimin = vbimins;
- vfmin = vfmins;
- vch = vchs;
- vbbtlim = vbbtlims;
- `juncapcommon(ABSOURCE_i,LSSOURCE_i,LGSOURCE_i,isjunbot,qsjunbot,isjunsti,qsjunsti,isjungat,qsjungat)
-
- // Drain side
- VAK = Vjund;
- VMAX = VMAXD;
- vbimin = vbimind;
- vfmin = vfmind;
- vch = vchd;
- vbbtlim = vbbtlimd;
- `juncapcommon(ABDRAIN_i,LSDRAIN_i,LGDRAIN_i,idjunbot,qdjunbot,idjunsti,qdjunsti,idjungat,qdjungat)
-
-`ifdef NQSmodel
- // Set initial conditions for NQS model
- `include "PSP102_InitNQS.include"
-
-`endif // NQSmodel
- end // evaluateStaticDynamic
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // Current contribs
- //
- /////////////////////////////////////////////////////////////////////////////
-
- begin : loadStatic
-
- // 4.2.15 Total terminal currents
-
- // Intrinsic MOSFET current
- Idse = MULT_i * Ids;
-
- // Gate (tunneling) current components
- Igbe = MULT_i * Igb;
- Igse = MULT_i * Igs;
- Igde = MULT_i * Igd;
-
- // GIDL/GISL current
- Igidle = MULT_i * Igidl;
- Igisle = MULT_i * Igisl;
-
- // Impact ionization current
- Iimpacte = MULT_i * Iimpact;
-
- // JUNCAP2
- isjun = MULT_i * (ABSOURCE_i * isjunbot + LSSOURCE_i * isjunsti + LGSOURCE_i * isjungat);
- idjun = MULT_i * (ABDRAIN_i * idjunbot + LSDRAIN_i * idjunsti + LGDRAIN_i * idjungat);
-
- // Convert back for NMOS-PMOS and Source-Drain interchange
- if (sigVds > 0) begin
- I(D, `Bint) <+ CHNL_TYPE * (Iimpacte + Igidle);
- I(D, S) <+ CHNL_TYPE * Idse;
- I(`Gint, S) <+ CHNL_TYPE * Igse;
- I(`Gint, D) <+ CHNL_TYPE * Igde;
- I(S, `Bint) <+ CHNL_TYPE * Igisle;
- end else begin
- I(S, `Bint) <+ CHNL_TYPE * (Iimpacte + Igidle);
- I(S, D) <+ CHNL_TYPE * Idse;
- I(`Gint, D) <+ CHNL_TYPE * Igse;
- I(`Gint, S) <+ CHNL_TYPE * Igde;
- I(D, `Bint) <+ CHNL_TYPE * Igisle;
- end
- I(`Gint, `Bint) <+ CHNL_TYPE * Igbe;
- I(`Bjs, S) <+ CHNL_TYPE * isjun;
- I(`Bjd, D) <+ CHNL_TYPE * idjun;
-`ifdef NQSmodel
- I(G, GP) <+ Vrg * ggate;
- I(BP, BI) <+ Vrbulk * gbulk;
- I(BS, BI) <+ Vrjuns * gjuns;
- I(BD, BI) <+ Vrjund * gjund;
- I(B, BI) <+ Vrwell * gwell;
-`endif // NQSmodel
-
- I(D, S) <+ Vds * `GMIN;
-
- end // loadStatic
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // ddt() contribs from charges (Note: MULT is handled explicitly)
- //
- /////////////////////////////////////////////////////////////////////////////
-
- begin : loadDynamic
-`ifdef NQSmodel
-
- // Calculate NQS charge contributions
- `include "PSP102_ChargesNQS.include"
-`endif // NQSmodel
-
- // 4.2.19 Total terminal charges
-
- // Intrinsic MOSFET charges
- Qg = MULT_i * Qg;
- Qb = MULT_i * Qb;
- Qd = MULT_i * Qd;
- Qs = -(Qg + Qb + Qd);
-
- // Total outerFringe + overlap for
- // gate-source and gate-drain.
- Qfgs = MULT_i * (Qfgs + Qgs_ov);
- Qfgd = MULT_i * (Qfgd + Qgd_ov);
-
- // Gate-bulk overlap charge
- Qgb_ov = MULT_i * Qgb_ov;
-
- // JUNCAP2
- qsjun = MULT_i * (ABSOURCE_i * qsjunbot + LSSOURCE_i * qsjunsti + LGSOURCE_i * qsjungat);
- qdjun = MULT_i * (ABDRAIN_i * qdjunbot + LSDRAIN_i * qdjunsti + LGDRAIN_i * qdjungat);
-
- // Convert back (undo S-D interchange)
- if (sigVds < 0) begin
- temp = Qd; // Qd <--> Qs
- Qd = Qs;
- Qs = temp;
- temp = Qfgd; // Qfgd <--> Qfgs
- Qfgd = Qfgs;
- Qfgs = temp;
- end
-
- I(`Gint, S) <+ ddt(CHNL_TYPE * Qg);
- I(`Bint, S) <+ ddt(CHNL_TYPE * Qb);
- I(D, S) <+ ddt(CHNL_TYPE * Qd);
- I(`Gint, S) <+ ddt(CHNL_TYPE * Qfgs);
- I(`Gint, D) <+ ddt(CHNL_TYPE * Qfgd);
- I(`Gint, `Bint) <+ ddt(CHNL_TYPE * Qgb_ov);
- I(`Bjs, S) <+ ddt(CHNL_TYPE * qsjun);
- I(`Bjd, D) <+ ddt(CHNL_TYPE * qdjun);
-
- end // loadDynamic
-
-
- /////////////////////////////////////////////////////////////////////////////
- //
- // Noise
- //
- /////////////////////////////////////////////////////////////////////////////
-
- begin : noise
-
- // 4.2.20 Noise variable calculation
- Sfl = 0.0;
- mid = 0.0;
- mig = 0.0;
- migid = 0.0;
- c_igid = 0.0;
- CGeff = COX_qm * eta_p;
- sqid = 0.0;
- sqig = 0.0;
- if ((xg > 0.0) && (MULT_i > 0) && (BET_i > 0)) begin
- N1 = Cox_over_q * alpha * phit;
- Nm1 = Cox_over_q * qim1;
- Delta_N1 = Cox_over_q * (alpha * dps);
- Sfl = (NFA_i - NFB_i * N1 + NFC_i * (N1 * N1)) * ln((Nm1 + 0.5 * Delta_N1) / (Nm1 - 0.5 * Delta_N1));
- Sfl = Sfl + (NFB_i + NFC_i * (Nm1 - 2.0 * N1)) * Delta_N1;
- Sfl = Sfl_prefac * Ids * Gvsatinv * Sfl / N1;
-
- H0 = qim1 / alpha;
- t1 = qim / qim1;
- sqt2 = 0.5 * `oneSixth * (dps / H0);
- t2 = sqt2 * sqt2;
- r = H0 / H - 1.0;
- lc = `CLIP_LOW(1.0 - 12 * (r * t2), 1e-20);
- lcinv2 = 1 / (lc * lc);
- g_ideal = BET_i * (FdL * qim1 * Gvsatinv);
- CGeff = Gvsat * Gvsat * COX_qm * eta_p / (Gmob_dL * Gmob_dL);
- mid = t1 + 12 * t2 - 24 * ((1.0 + t1) * t2 * r);
- mid = `CLIP_LOW(mid, 1e-40);
- mid = g_ideal * lcinv2 * mid;
- mig = t1 / 12 - t2 * (t1 + 0.2 - 12 * t2) - 1.6 * (t2 * (t1 + 1.0 - 12 * t2) * r);
- mig = `CLIP_LOW(mig, 1e-40);
- mig = lcinv2 / g_ideal * mig;
- migid = lcinv2 * sqt2 * (1.0 - 12 * t2 - (t1 + 19.2 * t2 - 12 * (t1 * t2)) * r);
- sqid = sqrt(MULT_i * nt * mid);
- sqig = sqrt(MULT_i * nt / mig);
- c_igid = (sqid == 0) ? 0.0 : (migid * sqig / sqid); // = migid / sqrt(mig * mid);
- c_igid = `CLIP_BOTH(c_igid, 0.0, 1.0);
- end
- shot_igsx = 2.0 * `QELE * abs(Igse);
- shot_igdx = 2.0 * `QELE * abs(Igde);
- shot_iavl = 2.0 * `QELE * ((mavl + 1) * abs(Iimpacte));
- // JUNCAP2
- sjnoisex = 2.0 * `QELE * abs(isjun);
- djnoisex = 2.0 * `QELE * abs(idjun);
- if (sigVds > 0) begin
- shot_igs = shot_igsx;
- shot_igd = shot_igdx;
- sjnoise = sjnoisex;
- djnoise = djnoisex + shot_iavl;
- end else begin
- shot_igs = shot_igdx;
- shot_igd = shot_igsx;
- sjnoise = sjnoisex + shot_iavl;
- djnoise = djnoisex;
- end
-`ifdef NQSmodel
- rgatenoise = nt0 * ggate;
- rbulknoise = nt0 * gbulk;
- rjunsnoise = nt0 * gjuns;
- rjundnoise = nt0 * gjund;
- rwellnoise = nt0 * gwell;
-`endif // NQSmodel
-
- // Important note:
- // In Verilog-A, correlated noise sources can only be implemented by using two additional
- // internal nodes (NOI and NOI2). When implementing PSP in a circuit simlutor, it is
- // generally not necessary to retain these internal nodes and therefore (for execution
- // speed reasons) should be avoided.
-
- // Noise contribs
- I(NOI2) <+ V(NOI2);
- I(NOI2) <+ white_noise(c_igid);
- I(NOII) <+ white_noise(sqig * sqig * (1.0 - c_igid));
- I(NOII) <+ -sqig * V(NOI2);
- I(NOIR) <+ V(NOIR);
- I(NOIC) <+ ddt(mig * CGeff * V(NOIC));
- I(D,S) <+ flicker_noise(MULT_i * Sfl, 1.0);
- I(D,S) <+ white_noise(sqid * sqid * (1.0 - c_igid));
- I(D,S) <+ sqid * V(NOI2);
- I(`Gint,S)<+ ddt(0.5 * ((1.0 + sigVds) * mig * CGeff * V(NOIC)));
- I(`Gint,D)<+ ddt(0.5 * ((1.0 - sigVds) * mig * CGeff * V(NOIC)));
- I(`Gint,S)<+ white_noise(shot_igs);
- I(`Gint,D)<+ white_noise(shot_igd);
- // JUNCAP2
- I(`Bjs,S) <+ white_noise(sjnoise, "shot");
- I(`Bjd,D) <+ white_noise(djnoise, "shot");
-`ifdef NQSmodel
- // Parasitic resistances
- I(GP,G) <+ white_noise(rgatenoise);
- I(BP,BI) <+ white_noise(rbulknoise);
- I(BS,BI) <+ white_noise(rjunsnoise);
- I(BD,BI) <+ white_noise(rjundnoise);
- I(B ,BI) <+ white_noise(rwellnoise);
-`endif // NQSmodel
- end // noise
-
-
-`ifdef insideADMS // OPinfo
- /////////////////////////////////////////////////////////////////////////////
- //
- // Operating point info
- //
- /////////////////////////////////////////////////////////////////////////////
-
- begin : OPinfo
-
- // The output variables defined below are currently not available in
- // Verilog-A, but only in the SiMKit-C-code which was generated from
- // this source. Similar functionality will be available in Verilog-A
- // from Verilog-A version 2.2 onwards. However, a different syntax is
- // to be used (see Verilog AMS language reference manual, version 2.2,
- // november 2004, Accellera).
-
- // Auxiliary variables
- id_op = Idse + Iimpacte + Igidle - Igde;
- is = -Idse + Igisle - Igse;
- ig = Igse + Igde + Igbe;
- ib = -Iimpacte - Igbe - Igidle - Igisle;
-
- P_D = 1 + 0.25 * (Gf * kp);
- facvsb0 = phib + 2 * phit1;
- facvsb = Vsbstar + facvsb0;
- sig1k = 2 * `PI * 1000 * CGeff;
- sig1k = sig1k * sig1k * mig;
-
-
- ////////////////////////////////////////////////////////////////////////////////////
- //
- // Actual operation point output variables
- //
- ////////////////////////////////////////////////////////////////////////////////////
-
- // Note: In this section (and ONLY in this section) `drain' always refers to
- // the highest-potential end of the channel. Therefore, care has to be
- // taken for derivatives w.r.t. terminal voltages when sigVds == -1.
-
- sdint = sigVds;
- ctype = CHNL_TYPE;
-
- if (sigVds < 0) begin
- // All variables in the actual model refering to junctions are
- // not subject to SD-interchange. In the OP-output variables,
- // SD-interchange is also done for the junctions, so that's
- // what is happening here. Similar precautions have to be taken
- // for those variables that are derivatives w.r.t. voltage branches
- ise = is - idjun;
- ige = ig;
- ide = id_op - isjun;
- ibe = ib + isjun + idjun;
- ids = Idse;
- idb = Iimpacte + Igidle - isjun;
- isb = Igisle - idjun;
- igs = Igse;
- igd = Igde;
- igb = Igbe;
- igcs = MULT_i * Igcs;
- igcd = MULT_i * Igcd;
- iavl = Iimpacte;
- igisl = Igisle;
- igidl = Igidle;
-
- ijsbot = MULT_i * ABDRAIN_i * idjunbot;
- ijsgat = MULT_i * LGDRAIN_i * idjungat;
- ijssti = MULT_i * LSDRAIN_i * idjunsti;
- ijs = ijsbot + ijsgat + ijssti;
- ijdbot = MULT_i * ABSOURCE_i * isjunbot;
- ijdgat = MULT_i * LGSOURCE_i * isjungat;
- ijdsti = MULT_i * LSSOURCE_i * isjunsti;
- ijd = ijdbot + ijdgat + ijdsti;
-
- vds = Vds;
- vgs = Vgs;
- vsb = Vsb;
- vto = VFB_i + P_D * facvsb0 + Gf * sqrt(phit1 * facvsb0);
- vts = VFB_i + P_D * facvsb - Vsbstar + Gf * sqrt(phit1 * facvsb );
- vth = vts - delVg;
- vgt = vgs - vth;
- vdss = Vdsat;
- vsat = Vds - vdss;
-
- temp = Idse + Iimpacte + Igidle - Igde - isjun; // Total drain-current
- gm = CHNL_TYPE * ddx(temp, V(`Gint, S));
- gmb = -CHNL_TYPE * ddx(temp, V(S, `Bint));
- gds = -CHNL_TYPE * ddx(temp, V(D, S)) - (gm + gmb);
-
- gjs = -ddx(idjun, V(D, `Bjd));
- gjd = -ddx(isjun, V(S, `Bjs));
-
- css = CHNL_TYPE * ddx(Qd, V(D, S));
- csg = -CHNL_TYPE * ddx(Qd, V(`Gint, S));
- csb = CHNL_TYPE * ddx(Qd, V(S, `Bint));
- csd = css - csg - csb;
- cgs = -CHNL_TYPE * ddx(Qg, V(D, S));
- cgg = CHNL_TYPE * ddx(Qg, V(`Gint, S));
- cgb = CHNL_TYPE * ddx(Qg, V(S, `Bint));
- cgd = cgg - cgs - cgb;
- cds = -CHNL_TYPE * ddx(Qs, V(D, S));
- cdg = -CHNL_TYPE * ddx(Qs, V(`Gint, S));
- cdb = CHNL_TYPE * ddx(Qs, V(S, `Bint));
- cdd = cdg + cds + cdb;
- cbs = -CHNL_TYPE * ddx(Qb, V(D, S));
- cbg = -CHNL_TYPE * ddx(Qb, V(`Gint, S));
- cbb = -CHNL_TYPE * ddx(Qb, V(S, `Bint));
- cbd = cbb - cbs - cbg;
- cgsol = -CHNL_TYPE * ddx(Qfgd, V(D, S));
- cgdol = CHNL_TYPE * ddx(Qfgs, V(`Gint, S));
-
- cjsbot = -MULT_i * CHNL_TYPE * ABDRAIN_i * ddx(qdjunbot, V(D, `Bjd));
- cjsgat = -MULT_i * CHNL_TYPE * LGDRAIN_i * ddx(qdjungat, V(D, `Bjd));
- cjssti = -MULT_i * CHNL_TYPE * LSDRAIN_i * ddx(qdjunsti, V(D, `Bjd));
- cjs = cjsbot + cjsgat + cjssti;
- cjdbot = -MULT_i * CHNL_TYPE * ABSOURCE_i * ddx(qsjunbot, V(S, `Bjs));
- cjdgat = -MULT_i * CHNL_TYPE * LGSOURCE_i * ddx(qsjungat, V(S, `Bjs));
- cjdsti = -MULT_i * CHNL_TYPE * LSSOURCE_i * ddx(qsjunsti, V(S, `Bjs));
- cjd = cjdbot + cjdgat + cjdsti;
- end else begin
- ise = is - isjun;
- ige = ig;
- ide = id_op - idjun;
- ibe = ib + isjun + idjun;
- ids = Idse;
- idb = Iimpacte + Igidle - idjun;
- isb = Igisle - isjun;
- igs = Igse;
- igd = Igde;
- igb = Igbe;
- igcs = MULT_i * Igcs;
- igcd = MULT_i * Igcd;
- iavl = Iimpacte;
- igisl = Igisle;
- igidl = Igidle;
-
- ijsbot = MULT_i * ABSOURCE_i * isjunbot;
- ijsgat = MULT_i * LGSOURCE_i * isjungat;
- ijssti = MULT_i * LSSOURCE_i * isjunsti;
- ijs = ijsbot + ijsgat + ijssti;
- ijdbot = MULT_i * ABDRAIN_i * idjunbot;
- ijdgat = MULT_i * LGDRAIN_i * idjungat;
- ijdsti = MULT_i * LSDRAIN_i * idjunsti;
- ijd = ijdbot + ijdgat + ijdsti;
-
- vds = Vds;
- vgs = Vgs;
- vsb = Vsb;
- vto = VFB_i + P_D * facvsb0 + Gf * sqrt(phit1 * facvsb0);
- vts = VFB_i + P_D * facvsb - Vsbstar + Gf * sqrt(phit1 * facvsb );
- vth = vts - delVg;
- vgt = vgs - vth;
- vdss = Vdsat;
- vsat = Vds - vdss;
-
- temp = Idse + Iimpacte + Igidle - Igde - idjun;
- gm = CHNL_TYPE * ddx(temp, V(`Gint, S));
- gmb = -CHNL_TYPE * ddx(temp, V(S, `Bint));
- gds = CHNL_TYPE * ddx(temp, V(D, S));
-
- gjs = -ddx(isjun, V(S, `Bjs));
- gjd = -ddx(idjun, V(D, `Bjd));
-
- cdd = CHNL_TYPE * ddx(Qd, V(D, S));
- cdg = -CHNL_TYPE * ddx(Qd, V(`Gint, S));
- cdb = CHNL_TYPE * ddx(Qd, V(S, `Bint));
- cds = cdd - cdg - cdb;
- cgd = -CHNL_TYPE * ddx(Qg, V(D, S));
- cgg = CHNL_TYPE * ddx(Qg, V(`Gint, S));
- cgb = CHNL_TYPE * ddx(Qg, V(S, `Bint));
- cgs = cgg - cgd - cgb;
- csd = -CHNL_TYPE * ddx(Qs, V(D, S));
- csg = -CHNL_TYPE * ddx(Qs, V(`Gint, S));
- csb = CHNL_TYPE * ddx(Qs, V(S, `Bint));
- css = csg + csd + csb;
- cbd = -CHNL_TYPE * ddx(Qb, V(D, S));
- cbg = -CHNL_TYPE * ddx(Qb, V(`Gint, S));
- cbb = -CHNL_TYPE * ddx(Qb, V(S, `Bint));
- cbs = cbb - cbd - cbg;
- cgsol = CHNL_TYPE * ddx(Qfgs, V(`Gint, S));
- cgdol = -CHNL_TYPE * ddx(Qfgd, V(D, S));
-
- cjsbot = -MULT_i * CHNL_TYPE * ABSOURCE_i * ddx(qsjunbot, V(S, `Bjs));
- cjsgat = -MULT_i * CHNL_TYPE * LGSOURCE_i * ddx(qsjungat, V(S, `Bjs));
- cjssti = -MULT_i * CHNL_TYPE * LSSOURCE_i * ddx(qsjunsti, V(S, `Bjs));
- cjs = cjsbot + cjsgat + cjssti;
- cjdbot = -MULT_i * CHNL_TYPE * ABDRAIN_i * ddx(qdjunbot, V(D, `Bjd));
- cjdgat = -MULT_i * CHNL_TYPE * LGDRAIN_i * ddx(qdjungat, V(D, `Bjd));
- cjdsti = -MULT_i * CHNL_TYPE * LSDRAIN_i * ddx(qdjunsti, V(D, `Bjd));
- cjd = cjdbot + cjdgat + cjdsti;
- end
-`ifdef LocalModel
- weff = 0;
- leff = 0;
-`else
- weff = WE;
- leff = LE;
-`endif
- u = (abs(gds) < 1e-18) ? 0 : (gm / gds);
- rout = (abs(gds) < 1e-18) ? 0 : (1.0 / gds);
- vearly = (abs(gds) < 1e-18) ? 0 : (ide / gds);
- beff = (abs(vgt) < 1e-12) ? 0 : (2 * abs(ide) / (vgt * vgt));
- fug = (abs(cgg + cgsol + cgdol) < 1e-30) ? 0.0 : gm / (2 * `PI * (cgg + cgsol + cgdol));
-
- sfl = Sfl;
- sqrtsff = (abs(gm) < 1e-18) ? 0 : (sqrt(MULT_i * Sfl / 1000) / gm);
- sqrtsfw = (abs(gm) < 1e-18) ? 0 : (sqid / gm);
- sid = sqid * sqid;
- sig = MULT_i * nt * sig1k / (1 + sig1k * mig);
- cigid = c_igid;
- fknee = (sid == 0) ? 0 : Sfl / sid;
- sigs = shot_igsx;
- sigd = shot_igdx;
- siavl = shot_iavl;
- if (sigVds < 0) begin
- ssi = djnoisex;
- sdi = sjnoisex;
- end else begin
- ssi = sjnoisex;
- sdi = djnoisex;
- end
- end // OPinfo
-`endif // OPinfo
-
- end // analogBlock
diff --git a/src/spicelib/devices/adms/psp102/adms3va/PSP102_nqs_macrodefs.include b/src/spicelib/devices/adms/psp102/adms3va/PSP102_nqs_macrodefs.include
deleted file mode 100644
index e14819dfe..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/PSP102_nqs_macrodefs.include
+++ /dev/null
@@ -1,117 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: PSP102_nqs_macrodefs.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
-//////////////////////////////////////////
-//
-// Macros used in PSP-NQS
-//
-//////////////////////////////////////////
-
-// Function to calculate bulk charge from surface potential
-`define PhiToQb(phi,Qb_tmp) \
-if (abs(phi) <= margin) \
- Qb_tmp = -0.70710678 * phi * Gf * (1.0 - `oneSixth * phi * (1.0 - `oneSixth * phi)); \
-else begin \
- `expl((-phi), temp) \
- Qb_tmp = Gf * sqrt(temp + phi - 1.0); \
- if (phi > margin) \
- Qb_tmp = -Qb_tmp; \
-end
-
-
-// Function used in fq-macro
-`define PhiTod2Qis(xphi,d2Qis) \
-if (abs(xphi) <= margin) begin \
- Qb_tmp = -0.70710678 * xphi * Gf * (1.0 - `oneSixth * xphi * (1.0 - `oneSixth * xphi)); \
- dQbs = -0.70710678 * Gf * (1.0 - `oneThird * xphi * (1.0 - 0.25 * xphi)); \
- d2Qis = -0.235702 * Gf * (1.0 - 0.5 * xphi); \
-end else begin \
- `expl((-xphi),temp) \
- Qb_tmp = Gf * sqrt(temp + xphi - 1.0); \
- if (xphi > margin) \
- Qb_tmp = -Qb_tmp; \
- dQbs = 0.5 * Gf2 * (1.0 - temp) / Qb_tmp; \
- d2Qis = (dQbs * dQbs - 0.5 * Gf * Gf) / Qb_tmp + dQbs; \
-end
-
-
-
-// Function used in QiToPhi
-`define sps(sp, xg) \
-if (abs(xg) <= marginp) begin \
- sp = xg / a_factrp; \
-end else begin \
- if (xg < -marginp) begin \
- NQS_yg = -xg; \
- NQS_z = 1.25 * NQS_yg / a_factrp; \
- NQS_eta = (NQS_z + 10.0 - sqrt((NQS_z - 6.0) * (NQS_z - 6.0) + 64.0)) * 0.5; \
- NQS_a = (NQS_yg - NQS_eta) * (NQS_yg - NQS_eta) + Gp2 * (NQS_eta + 1.0); \
- NQS_c = 2.0 * (NQS_yg - NQS_eta) - Gp2; \
- NQS_tau = ln(NQS_a / Gp2) - NQS_eta; \
- `sigma(NQS_a, NQS_c, NQS_tau, NQS_eta, NQS_y0) \
- `expl(NQS_y0, NQS_D0) \
- NQS_xi = 1.0 - Gp2 * NQS_D0 * 0.5; \
- NQS_p = 2.0 * (NQS_yg - NQS_y0) + Gp2 * (NQS_D0 - 1.0); \
- NQS_q = (NQS_yg - NQS_y0) * (NQS_yg - NQS_y0) + Gp2 * (NQS_y0 + 1.0 - NQS_D0); \
- NQS_temp = NQS_p * NQS_p - 4.0 * NQS_xi * NQS_q; \
- NQS_w = 2.0 * NQS_q / (NQS_p + sqrt(NQS_temp)); \
- sp = -(NQS_y0 + NQS_w); \
- end else begin \
- NQS_xg1 = 1.0 / ( 1.25 + 7.32464877560822e-01 * Gp); \
- NQS_A_fac = (1.25 * a_factrp * NQS_xg1 - 1.0) * NQS_xg1; \
- NQS_xbar = xg / a_factrp * (1.0 + NQS_A_fac * xg); \
- `expl(-NQS_xbar, NQS_temp) \
- NQS_w = 1.0 - NQS_temp; \
- NQS_x0 = xg + Gp2 * 0.5 - Gp * sqrt(xg + Gp2 * 0.25 - NQS_w); \
- `expl((-NQS_x0), NQS_D0) \
- NQS_xi = 1.0 - Gp2 * 0.5 * NQS_D0; \
- NQS_p = 2.0 * (xg - NQS_x0) + Gp2 * (1.0 - NQS_D0); \
- NQS_q = (xg - NQS_x0) * (xg - NQS_x0) - Gp2 * (NQS_x0 - 1.0 + NQS_D0); \
- NQS_temp = NQS_p * NQS_p - 4.0 * NQS_xi * NQS_q; \
- NQS_u = 2.0 * NQS_q / (NQS_p + sqrt(NQS_temp)); \
- sp = NQS_x0 + NQS_u; \
- end \
-end
-
-
-// Function to calculate surface potential from inversion charge
-`define QiToPhi(Qi,xg,xphi) \
- temp = Qi / pd + xg; \
- `sps(xphi,temp)
-
-// Calculation of fk
-`define fq(Qi,xg,dQy,d2Qy,fk) \
- `QiToPhi(Qi, xg, xphi) \
- `PhiTod2Qis(xphi, d2Qis) \
- dQis = pd - dQbs; \
- dQis_1 = 1.0 / dQis; \
- fQi = Qi * dQis_1 - 1.0; \
- dfQi = (1.0 - Qi * d2Qis * dQis_1 * dQis_1) * dQis_1; \
- fk0 = dfQi * dQy * dQy + fQi * d2Qy; \
- dpsy2 = dQy * dQy * dQis_1 * dQis_1; \
- zsat = thesat2 * dpsy2; \
- if (CHNL_TYPE == `PMOS) \
- zsat = zsat / (1.0 + thesat1 * dps); \
- temp = sqrt(1.0 + 2.0 * zsat); \
- Fvsat = 2.0 / (1.0 + temp); \
- temp1 = d2Qy - dpsy2 * d2Qis; \
- fk = Fvsat * (fk0 - zsat * fQi * temp1 * Fvsat / temp);
-
-
-// Interpolation of surface potential along channel
-`define Phiy(y) \
- x_m + H * (1.0 - sqrt(1.0 - 2.0 * dps / H * ((y) - ym))) * inv_phit1
diff --git a/src/spicelib/devices/adms/psp102/adms3va/SIMKIT_macrodefs.include b/src/spicelib/devices/adms/psp102/adms3va/SIMKIT_macrodefs.include
deleted file mode 100644
index 190b1eead..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/SIMKIT_macrodefs.include
+++ /dev/null
@@ -1,121 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: SIMKIT_macrodefs.include
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
-//////////////////////////////////////////////////////////////
-//
-// General macros and constants for compact va-models
-//
-//////////////////////////////////////////////////////////////
-
-`define VERS "0.0"
-`define VREV "0.0"
-`define VERSreal 0.0
-`define VREVreal 0.0
-
-`define CLIP_LOW(val,min) ((val)>(min)?(val):(min))
-`define CLIP_HIGH(val,max) ((val)<(max)?(val):(max))
-`define CLIP_BOTH(val,min,max) ((val)>(min)?((val)<(max)?(val):(max)):(min))
-
- // Note 1: In this va-code, the `P-macro is defined such that its argument
- // is ignored during compilation; in this source code it acts as
- // a comment
- // Note 2: In this va-code, the "from" keyword in the parameter
- // list is not used. Silent clipping is used instead. One could enable
- // the Verilog-A range checking by redefining the `from-macro below.
- `define P(txt)
- `define AT_MODEL
- `define AT_INSTANCE
- `define AT_NOISE
- `define from(lower,upper)
-// `define from(lower,upper) from[lower:upper]
-
-// Some functions
-`define MAX(x,y) ((x)>(y)?(x):(y))
-`define MIN(x,y) ((x)<(y)?(x):(y))
-
-// Mathematical constants
-`define PI 3.1415926535897931
-`define SQRTPI 1.77245385090551603
-
-// Physical constants
-`define KELVINCONVERSION 273.15
-`define KBOL 1.3806505E-23
-`define QELE 1.6021918E-19
-`define HBAR 1.05457168E-34
-`define MELE 9.1093826E-31
-`define EPSSI 1.045E-10
-
-// Other constants
-`define oneThird 3.3333333333333333e-01
-`define twoThirds 6.6666666666666667e-01
-
-// Constants needed in safe exponential function (called "expl")
-`define se 4.6051701859880916e+02
-`define se05 2.3025850929940458e+02
-`define ke 1.0e-200
-`define ke05 1.0e-100
-`define keinv 1.0e200
-`define ke05inv 1.0e100
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Macro definitions.
-//
-// Note that because variables in macros are not locally scoped,
-// the intermediate variables used in the macros below must be
-// explicitly declared in the main code.
-//
-/////////////////////////////////////////////////////////////////////////////
-
-
-// P3 3rd order polynomial expansion of exp()
-`define P3(u) (1.0 + (u) * (1.0 + 0.5 * ((u) * (1.0 + (u) * `oneThird))))
-
-
-// expl exp() with 3rd order polynomial extrapolation
-// for very low values (exp_low), very high
-// values (exp_high), or both (expl), to avoid overflows
-// and underflows and retain C-3 continuity
-`define expl(x, res) \
-if (abs(x) < `se05) begin\
- res = exp(x); \
-end else begin \
- if ((x) < -`se05) begin\
- res = `ke05 / `P3(-`se05 - (x)); \
- end else begin\
- res = `ke05inv * `P3((x) - `se05); \
- end \
-end
-
-`define expl_low(x, res) \
-if ((x) > -`se05) begin\
- res = exp(x); \
-end else begin\
- res = `ke05 / `P3(-`se05 - (x)); \
-end
-
-`define expl_high(x, res) \
-if ((x) < `se05) begin\
- res = exp(x); \
-end else begin \
- res = `ke05inv * `P3((x) - `se05); \
-end
-
-`define swap(a, b) \
-temp = a; \
-a = b; \
-b = temp;
diff --git a/src/spicelib/devices/adms/psp102/adms3va/psp102.va b/src/spicelib/devices/adms/psp102/adms3va/psp102.va
deleted file mode 100644
index e033496a6..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/psp102.va
+++ /dev/null
@@ -1,48 +0,0 @@
-//======================================================================================
-//======================================================================================
-// Filename: psp102.va
-//======================================================================================
-//======================================================================================
-//
-// (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-//
-//
-// Version: 102.1, April 2007 (Simkit 2.5)
-//
-//======================================================================================
-//======================================================================================
-//
-// Further information can be found in the file readme.txt
-//
-
-`include "discipline.h"
-
-`include "SIMKIT_macrodefs.include"
-
-`include "JUNCAP200_macrodefs.include"
-
-`include "PSP102_macrodefs.include"
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// PSP global model code
-//
-/////////////////////////////////////////////////////////////////////////////
-
-// `undef LocalModel
-// `define Binning
-
-module PSP102VA(D, G, S, B)
-
-`P(
- info = "PSP MOSFET Model"
- version = `VERS
- revision = `VREV
- simkit:name = "psp1020"
- simkit:desc = "psp_1020"
-);
-
-`include "PSP102_module.include"
-
-endmodule
diff --git a/src/spicelib/devices/adms/psp102/adms3va/readme.ngspice b/src/spicelib/devices/adms/psp102/adms3va/readme.ngspice
deleted file mode 100644
index 3f5e3d431..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/readme.ngspice
+++ /dev/null
@@ -1,8 +0,0 @@
-ngspice customizations of package psp102.1
-------------------------------------------
-
-- Mon Apr 30 15:28:25 WEDT 2007 (Berlin)
- o renamed 'initializeModel/initializeInstance' to 'initial_model/initial_instance'.
- (this issue should go away when auto-partionning done in adms.)
- o redefined macro P(txt) in order to 'see' instance parameters
- o status: psp code created by adms compiles
diff --git a/src/spicelib/devices/adms/psp102/adms3va/readme.txt b/src/spicelib/devices/adms/psp102/adms3va/readme.txt
deleted file mode 100644
index 5df9f5b4d..000000000
--- a/src/spicelib/devices/adms/psp102/adms3va/readme.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-======================================================================================
-======================================================================================
-
- ---------------------------
- Verilog-A definition of PSP
- ---------------------------
-
-
- (c) Copyright 2007, All Rights Reserved, NXP Semiconductors
-
-
- Version: PSP 102.1 (including JUNCAP2 200.2), April 2007 (Simkit 2.5)
-
-======================================================================================
-======================================================================================
-
- Authors: G.D.J. Smit, A.J. Scholten, and D.B.M. Klaassen (NXP Semiconductors Research)
- R. van Langevelde (Philips Research)
- G. Gildenblat, X. Li, and W. Wu (The Arizona State University)
-
-
-
-The most recent version of the model code, the documentation, and contact information
-can be found on:
-
- http://PSPmodel.asu.edu/
-or
- http://www.nxp.com/Philips_Models/
-
-======================================================================================
-======================================================================================
-
-This package consists of several files:
-
- - readme.txt This file
-
- - psp102.va Main file for global ("geometrical") model
- - psp102b.va Main file for global binning model
- - psp102e.va Main file for local ("electrical") model
- - psp102_nqs.va Main file for global ("geometrical") model with NQS-effects
- - psp102b_nqs.va Main file for global binning model with NQS-effects
- - psp102e_nqs.va Main file for local ("electrical") model with NQS-effects
- - juncap200.va Main file for JUNCAP2 stand-alone model
-
- - SIMKIT_macrodefs.include Common macro definitions
- - PSP102_macrodefs.include Macro definitions for PSP
- - PSP102_module.include Actual model code for intrinsic MOS model
- - PSP102_binning.include Geometry scaling equation for binning
- - PSP102_binpars.include Parameterlist for global PSP binning model
- - PSP102_nqs_macrodefs.include Macro definitions for PSP-NQS
- - PSP102_InitNQS.include PSP-NQS initialization code
- - PSP102_ChargesNQS.include Calculation of NQS-charge contributions
- - JUNCAP200_macrodefs.include Macro definitions for JUNCAP2 model
- - JUNCAP200_parlist.include JUNCAP2 parameter list
- - JUNCAP200_varlist.include JUNCAP2 variable declarations
- - JUNCAP200_InitModel.include JUNCAP2 model initialization code
-
-======================================================================================
-======================================================================================
-
-Usage
------
-
-Depending which model one wants to use, one should compile one of the seven .va-files
-(psp102.va, psp102b.va, psp102e.va, psp102_nqs.va, psp102b_nqs.va, psp102e_nqs.va, and
-juncap200.va). The module names are "PSP102VA" and "PSPNQS102VA" for the global PSP-model
-(QS and NQS, respectively), and similarly "PSP102BVA" and "PSPNQS102BVA" for the binning
-PSP-model, "PSP102EVA" and "PSPNQS102EVA" for the local PSP-model, and "JUNCAP200" for
-the JUNCAP2-model.
-
-
-======================================================================================
-======================================================================================
-
-Release notes va-code of PSP 102.1, including JUNCAP2 200.2 (April 2007)
-------------------------------------------------------------------------
-
-Focus in this release has been on improving the simulation speed of PSP and JUNCAP2.
-The model equations in this release of PSP 102.1 are identical to those in the
-October 2006 release. This version features some minor impelementation changes
-w.r.t. the previous release.
-
-The main changes have been in the SiMKit version generated from this verilog-A
-implementation: improvements in the automatic C-code generation process
-and compilation of the C-code. The result is reflected in the SiMKit 2.5 version of
-PSP, which shows a very significant simulation speed improvement w.r.t SiMKit 2.4.
-
-The minor implementation changes in the verilog-A code will have some positive effect
-on the simulation speed of the verilog-A version as well. Note, however, that the
-simulation speed of the verilog-A version of PSP and the improvement w.r.t. the
-previous version strongly depend on the verilog-A compiler used.
-
-PSP 102.1 is backwards compatible with the previous version, PSP 102.0.
-
-
-======================================================================================
-======================================================================================
-
-The functionality of the Verilog-A code in this package is the same as that of the
-C-code, which is contained in SIMKIT version 2.5. Note that Operating Point information
-is available only in the C-code, not in Verilog-A code.
-
-
-The PSP-NQS model is provided as Verilog-A code. In SiMKit 2.5, a test version of
-the PSP-NQS model is included (identical to that in SiMKit 2.4). This implementation
-circumvents the problem of the SpectreVerilog-A-generated C-code being too large to
-compile. Moreover, it is computationally more efficient as it uses less rows in the
-simulator matrix. On the other hand, this implementation has some known limitations.
-More information is available from the authors. Further improvements are expected in
-future releases.
-
-
-This Verilog-A code of PSP is primarily intended as a source for C-code generation
-using ADMS. Most of the testing has been done on the C-code which was generated from it.
-
-
-The authors want to thank Laurent Lemaitre and Colin McAndrew (Freescale)
-for their help with ADMS and the implementation of the model code. Geoffrey
-Coram (Analog Devices) is acknowledged for useful comments on the Verilog-A
-code.