From f4f0949d84d858610ca615a16387369e0f7140da Mon Sep 17 00:00:00 2001 From: dwarning Date: Sun, 4 Nov 2007 19:34:56 +0000 Subject: [PATCH] update to version 4.6.1 --- src/spicelib/devices/bsim4/Makefile.am | 2 +- src/spicelib/devices/bsim4/b4.c | 29 ++- src/spicelib/devices/bsim4/b4acld.c | 9 +- src/spicelib/devices/bsim4/b4ask.c | 6 +- src/spicelib/devices/bsim4/b4check.c | 54 +++-- src/spicelib/devices/bsim4/b4cvtest.c | 3 +- src/spicelib/devices/bsim4/b4del.c | 5 +- src/spicelib/devices/bsim4/b4dest.c | 5 +- src/spicelib/devices/bsim4/b4geo.c | 5 +- src/spicelib/devices/bsim4/b4getic.c | 5 +- src/spicelib/devices/bsim4/b4ld.c | 268 +++++++++++++++++-------- src/spicelib/devices/bsim4/b4mask.c | 64 +++++- src/spicelib/devices/bsim4/b4mdel.c | 5 +- src/spicelib/devices/bsim4/b4mpar.c | 84 +++++++- src/spicelib/devices/bsim4/b4noi.c | 5 +- src/spicelib/devices/bsim4/b4par.c | 6 +- src/spicelib/devices/bsim4/b4pzld.c | 7 +- src/spicelib/devices/bsim4/b4set.c | 52 ++++- src/spicelib/devices/bsim4/b4temp.c | 265 ++++++++++++++++++++---- src/spicelib/devices/bsim4/b4trunc.c | 5 +- src/spicelib/devices/bsim4/bsim4def.h | 145 +++++++++---- 21 files changed, 811 insertions(+), 218 deletions(-) diff --git a/src/spicelib/devices/bsim4/Makefile.am b/src/spicelib/devices/bsim4/Makefile.am index a9e115d37..c9bf85550 100644 --- a/src/spicelib/devices/bsim4/Makefile.am +++ b/src/spicelib/devices/bsim4/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -pkglib_LIBRARIES = libbsim4.a +noinst_LIBRARIES = libbsim4.a libbsim4_a_SOURCES = \ b4.c \ diff --git a/src/spicelib/devices/bsim4/b4.c b/src/spicelib/devices/bsim4/b4.c index 3e5cf90b2..a02634c10 100644 --- a/src/spicelib/devices/bsim4/b4.c +++ b/src/spicelib/devices/bsim4/b4.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4.c of BSIM4.6.0. + * File: b4.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. @@ -13,7 +14,8 @@ * Modified by Xuemei Xi, 05/09/2003. * Modified by Xuemei Xi, 03/04/2004. * Modified by Xuemei Xi, Mohan Dunga, 07/29/2005. - * Modified by Mohan Dunga, 12/13/2006 + * Modified by Mohan Dunga, 12/13/2006. + * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. **********/ #include "ngspice.h" @@ -108,6 +110,7 @@ OP( "gtau", BSIM4_GTAU, IF_REAL, "Gtau"), }; IFparm BSIM4mPTable[] = { /* model parameters */ +IOP( "cvchargemod", BSIM4_MOD_CVCHARGEMOD, IF_INTEGER, "Capacitance Charge model selector"), IOP( "capmod", BSIM4_MOD_CAPMOD, IF_INTEGER, "Capacitance model selector"), IOP( "diomod", BSIM4_MOD_DIOMOD, IF_INTEGER, "Diode IV model selector"), IOP( "rdsmod", BSIM4_MOD_RDSMOD, IF_INTEGER, "Bias-dependent S/D resistance model selector"), @@ -120,12 +123,17 @@ IOP( "permod", BSIM4_MOD_PERMOD, IF_INTEGER, "Pd and Ps model selector"), IOP( "geomod", BSIM4_MOD_GEOMOD, IF_INTEGER, "Geometry dependent parasitics model selector"), IOP( "fnoimod", BSIM4_MOD_FNOIMOD, IF_INTEGER, "Flicker noise model selector"), IOP( "tnoimod", BSIM4_MOD_TNOIMOD, IF_INTEGER, "Thermal noise model selector"), +IOP( "mtrlmod", BSIM4_MOD_MTRLMOD, IF_INTEGER, "parameter for non-silicon substrate or metal gate selector"), IOP( "igcmod", BSIM4_MOD_IGCMOD, IF_INTEGER, "Gate-to-channel Ig model selector"), IOP( "igbmod", BSIM4_MOD_IGBMOD, IF_INTEGER, "Gate-to-body Ig model selector"), IOP( "tempmod", BSIM4_MOD_TEMPMOD, IF_INTEGER, "Temperature model selector"), IOP( "paramchk", BSIM4_MOD_PARAMCHK, IF_INTEGER, "Model parameter checking selector"), IOP( "binunit", BSIM4_MOD_BINUNIT, IF_INTEGER, "Bin unit selector"), IOP( "version", BSIM4_MOD_VERSION, IF_STRING, "parameter for model version"), +IOP( "eot", BSIM4_MOD_EOT, IF_REAL, "Equivalent gate oxide thickness in meters"), +IOP( "vddeot", BSIM4_MOD_VDDEOT, IF_REAL, "Voltage for extraction of Equivalent gate oxide thickness"), +IOP( "ados", BSIM4_MOD_ADOS, IF_REAL, "Charge centroid parameter"), +IOP( "bdos", BSIM4_MOD_BDOS, IF_REAL, "Charge centroid parameter"), IOP( "toxe", BSIM4_MOD_TOXE, IF_REAL, "Electrical gate oxide thickness in meters"), IOP( "toxp", BSIM4_MOD_TOXP, IF_REAL, "Physical gate oxide thickness in meters"), IOP( "toxm", BSIM4_MOD_TOXM, IF_REAL, "Gate oxide thickness at which parameters are extracted"), @@ -145,6 +153,14 @@ IOP( "ags", BSIM4_MOD_AGS, IF_REAL, "Gate bias coefficient of Abulk."), IOP( "a1", BSIM4_MOD_A1, IF_REAL, "Non-saturation effect coefficient"), IOP( "a2", BSIM4_MOD_A2, IF_REAL, "Non-saturation effect coefficient"), IOP( "keta", BSIM4_MOD_KETA, IF_REAL, "Body-bias coefficient of non-uniform depletion width effect."), +IOP( "phig", BSIM4_MOD_PHIG, IF_REAL, "Work function of gate"), +IOP( "epsrgate", BSIM4_MOD_EPSRGATE, IF_REAL, "Dielectric constant of gate relative to vacuum"), +IOP( "easub",BSIM4_MOD_EASUB, IF_REAL, "Electron affinity of substrate"), +IOP( "epsrsub", BSIM4_MOD_EPSRSUB, IF_REAL, "Dielectric constant of substrate relative to vacuum"), +IOP( "ni0sub", BSIM4_MOD_NI0SUB, IF_REAL, "Intrinsic carrier concentration of substrate at 300.15K"), +IOP( "bg0sub", BSIM4_MOD_BG0SUB, IF_REAL, "Band-gap of substrate at T=0K"), +IOP( "tbgasub", BSIM4_MOD_TBGASUB, IF_REAL, "First parameter of band-gap change due to temperature"), +IOP( "tbgbsub", BSIM4_MOD_TBGBSUB, IF_REAL, "Second parameter of band-gap change due to temperature"), IOP( "nsub", BSIM4_MOD_NSUB, IF_REAL, "Substrate doping concentration"), IOP( "ndep", BSIM4_MOD_NDEP, IF_REAL, "Channel doping concentration at the depletion edge"), IOP( "nsd", BSIM4_MOD_NSD, IF_REAL, "S/D doping concentration"), @@ -192,8 +208,10 @@ IOP( "u0", BSIM4_MOD_U0, IF_REAL, "Low-field mobility at Tnom"), IOP( "eu", BSIM4_MOD_EU, IF_REAL, "Mobility exponent"), IOP( "ute", BSIM4_MOD_UTE, IF_REAL, "Temperature coefficient of mobility"), IOP( "voff", BSIM4_MOD_VOFF, IF_REAL, "Threshold voltage offset"), -IOP( "minv", BSIM4_MOD_MINV, IF_REAL, "Fitting parameter for moderate invversion in Vgsteff"), +IOP( "minv", BSIM4_MOD_MINV, IF_REAL, "Fitting parameter for moderate inversion in Vgsteff"), +IOP( "minvcv", BSIM4_MOD_MINVCV, IF_REAL, "Fitting parameter for moderate inversion in Vgsteffcv"), IOP( "voffl", BSIM4_MOD_VOFFL, IF_REAL, "Length dependence parameter for Vth offset"), +IOP( "voffcvl", BSIM4_MOD_VOFFCVL, IF_REAL, "Length dependence parameter for Vth offset in CV"), IOP( "tnom", BSIM4_MOD_TNOM, IF_REAL, "Parameter measurement temperature"), IOP( "cgso", BSIM4_MOD_CGSO, IF_REAL, "Gate-source overlap capacitance per width"), IOP( "cgdo", BSIM4_MOD_CGDO, IF_REAL, "Gate-drain overlap capacitance per width"), @@ -508,6 +526,7 @@ IOP( "lu0", BSIM4_MOD_LU0, IF_REAL, "Length dependence of u0"), IOP( "lute", BSIM4_MOD_LUTE, IF_REAL, "Length dependence of ute"), IOP( "lvoff", BSIM4_MOD_LVOFF, IF_REAL, "Length dependence of voff"), IOP( "lminv", BSIM4_MOD_LMINV, IF_REAL, "Length dependence of minv"), +IOP( "lminvcv", BSIM4_MOD_LMINVCV, IF_REAL, "Length dependence of minvcv"), IOP( "ldelta", BSIM4_MOD_LDELTA, IF_REAL, "Length dependence of delta"), IOP( "lrdsw", BSIM4_MOD_LRDSW, IF_REAL, "Length dependence of rdsw "), IOP( "lrsw", BSIM4_MOD_LRSW, IF_REAL, "Length dependence of rsw"), @@ -654,6 +673,7 @@ IOP( "wu0", BSIM4_MOD_WU0, IF_REAL, "Width dependence of u0"), IOP( "wute", BSIM4_MOD_WUTE, IF_REAL, "Width dependence of ute"), IOP( "wvoff", BSIM4_MOD_WVOFF, IF_REAL, "Width dependence of voff"), IOP( "wminv", BSIM4_MOD_WMINV, IF_REAL, "Width dependence of minv"), +IOP( "wminvcv", BSIM4_MOD_WMINVCV, IF_REAL, "Width dependence of minvcv"), IOP( "wdelta", BSIM4_MOD_WDELTA, IF_REAL, "Width dependence of delta"), IOP( "wrdsw", BSIM4_MOD_WRDSW, IF_REAL, "Width dependence of rdsw "), IOP( "wrsw", BSIM4_MOD_WRSW, IF_REAL, "Width dependence of rsw"), @@ -799,6 +819,7 @@ IOP( "pu0", BSIM4_MOD_PU0, IF_REAL, "Cross-term dependence of u0"), IOP( "pute", BSIM4_MOD_PUTE, IF_REAL, "Cross-term dependence of ute"), IOP( "pvoff", BSIM4_MOD_PVOFF, IF_REAL, "Cross-term dependence of voff"), IOP( "pminv", BSIM4_MOD_PMINV, IF_REAL, "Cross-term dependence of minv"), +IOP( "pminvcv", BSIM4_MOD_PMINVCV, IF_REAL, "Cross-term dependence of minvcv"), IOP( "pdelta", BSIM4_MOD_PDELTA, IF_REAL, "Cross-term dependence of delta"), IOP( "prdsw", BSIM4_MOD_PRDSW, IF_REAL, "Cross-term dependence of rdsw "), IOP( "prsw", BSIM4_MOD_PRSW, IF_REAL, "Cross-term dependence of rsw"), diff --git a/src/spicelib/devices/bsim4/b4acld.c b/src/spicelib/devices/bsim4/b4acld.c index 7b5354c83..3492a8519 100644 --- a/src/spicelib/devices/bsim4/b4acld.c +++ b/src/spicelib/devices/bsim4/b4acld.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4acld.c of BSIM4.6.0. + * File: b4acld.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 10/05/2001. **********/ @@ -59,7 +60,7 @@ double m; for (; model != NULL; model = model->BSIM4nextModel) { for (here = model->BSIM4instances; here!= NULL; here = here->BSIM4nextInstance) - { if (here->BSIM4owner != ARCHme) continue; + { if (here->BSIM4owner != ARCHme) continue; pParam = here->pParam; capbd = here->BSIM4capbd; capbs = here->BSIM4capbs; @@ -451,7 +452,7 @@ double m; /* * Loading AC matrix */ - m = here->BSIM4m; + m = here->BSIM4m; if (!model->BSIM4rdsMod) { gdpr = here->BSIM4drainConductance; diff --git a/src/spicelib/devices/bsim4/b4ask.c b/src/spicelib/devices/bsim4/b4ask.c index 9223f1ade..9ef0d7ced 100644 --- a/src/spicelib/devices/bsim4/b4ask.c +++ b/src/spicelib/devices/bsim4/b4ask.c @@ -1,10 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4ask.c of BSIM4.6.0. + * File: b4ask.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. + * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. diff --git a/src/spicelib/devices/bsim4/b4check.c b/src/spicelib/devices/bsim4/b4check.c index 7e50d75d8..72495a58f 100644 --- a/src/spicelib/devices/bsim4/b4check.c +++ b/src/spicelib/devices/bsim4/b4check.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4check.c of BSIM4.6.0. + * File: b4check.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. @@ -14,6 +15,7 @@ * Modified by Xuemei Xi, 03/04/2004. * Modified by Xuemei Xi, 07/29/2005. * Modified by Mohan Dunga, 12/13/2006 + * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. **********/ #include "ngspice.h" @@ -42,9 +44,9 @@ FILE *fplog; fprintf(fplog, "\n"); fprintf(fplog, "++++++++++ BSIM4 PARAMETER CHECKING BELOW ++++++++++\n"); - if (strcmp(model->BSIM4version, "4.6.0") != 0) - { fprintf(fplog, "Warning: This model is BSIM4.6.0; you specified a wrong version number.\n"); - printf("Warning: This model is BSIM4.6.0; you specified a wrong version number.\n"); + if (strcmp(model->BSIM4version, "4.6.1") != 0) + { fprintf(fplog, "Warning: This model is BSIM4.6.1; you specified a wrong version number.\n"); + printf("Warning: This model is BSIM4.6.1; you specified a wrong version number.\n"); } fprintf(fplog, "Model = %s\n", model->BSIM4modName); @@ -68,6 +70,36 @@ FILE *fplog; printf("Fatal: Toxp = %g is not positive.\n", model->BSIM4toxp); Fatal_Flag = 1; } + if (model->BSIM4eot <= 0.0) + { fprintf(fplog, "Fatal: EOT = %g is not positive.\n", + model->BSIM4eot); + printf("Fatal: EOT = %g is not positive.\n", model->BSIM4eot); + Fatal_Flag = 1; + } + if (model->BSIM4epsrgate < 0.0) + { fprintf(fplog, "Fatal: Epsrgate = %g is not positive.\n", + model->BSIM4epsrgate); + printf("Fatal: Epsrgate = %g is not positive.\n", model->BSIM4epsrgate); + Fatal_Flag = 1; + } + if (model->BSIM4epsrsub < 0.0) + { fprintf(fplog, "Fatal: Epsrsub = %g is not positive.\n", + model->BSIM4epsrsub); + printf("Fatal: Epsrsub = %g is not positive.\n", model->BSIM4epsrsub); + Fatal_Flag = 1; + } + if (model->BSIM4easub < 0.0) + { fprintf(fplog, "Fatal: Easub = %g is not positive.\n", + model->BSIM4easub); + printf("Fatal: Easub = %g is not positive.\n", model->BSIM4easub); + Fatal_Flag = 1; + } + if (model->BSIM4ni0sub <= 0.0) + { fprintf(fplog, "Fatal: Ni0sub = %g is not positive.\n", + model->BSIM4ni0sub); + printf("Fatal: Easub = %g is not positive.\n", model->BSIM4ni0sub); + Fatal_Flag = 1; + } if (model->BSIM4toxm <= 0.0) { fprintf(fplog, "Fatal: Toxm = %g is not positive.\n", @@ -636,18 +668,6 @@ FILE *fplog; } /* Check capacitance parameters */ - if (pParam->BSIM4noff < 0.1) - { fprintf(fplog, "Warning: Noff = %g is too small.\n", - pParam->BSIM4noff); - printf("Warning: Noff = %g is too small.\n", pParam->BSIM4noff); - } - - if (pParam->BSIM4voffcv < -0.5) - { fprintf(fplog, "Warning: Voffcv = %g is too small.\n", - pParam->BSIM4voffcv); - printf("Warning: Voffcv = %g is too small.\n", pParam->BSIM4voffcv); - } - if (pParam->BSIM4moin < 5.0) { fprintf(fplog, "Warning: Moin = %g is too small.\n", pParam->BSIM4moin); diff --git a/src/spicelib/devices/bsim4/b4cvtest.c b/src/spicelib/devices/bsim4/b4cvtest.c index 3f7df34cc..085bde14c 100644 --- a/src/spicelib/devices/bsim4/b4cvtest.c +++ b/src/spicelib/devices/bsim4/b4cvtest.c @@ -1,4 +1,4 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. @@ -6,6 +6,7 @@ * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. diff --git a/src/spicelib/devices/bsim4/b4del.c b/src/spicelib/devices/bsim4/b4del.c index fb054362d..2d553a725 100644 --- a/src/spicelib/devices/bsim4/b4del.c +++ b/src/spicelib/devices/bsim4/b4del.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4del.c of BSIM4.6.0. + * File: b4del.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. **********/ diff --git a/src/spicelib/devices/bsim4/b4dest.c b/src/spicelib/devices/bsim4/b4dest.c index 545962e3f..d6728006a 100644 --- a/src/spicelib/devices/bsim4/b4dest.c +++ b/src/spicelib/devices/bsim4/b4dest.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4dest.c of BSIM4.6.0. + * File: b4dest.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. **********/ diff --git a/src/spicelib/devices/bsim4/b4geo.c b/src/spicelib/devices/bsim4/b4geo.c index cc0259d72..40c03dc22 100644 --- a/src/spicelib/devices/bsim4/b4geo.c +++ b/src/spicelib/devices/bsim4/b4geo.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 11/17//2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4geo.c of BSIM4.6.0. + * File: b4geo.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. **********/ diff --git a/src/spicelib/devices/bsim4/b4getic.c b/src/spicelib/devices/bsim4/b4getic.c index 892b66247..8572ce56d 100644 --- a/src/spicelib/devices/bsim4/b4getic.c +++ b/src/spicelib/devices/bsim4/b4getic.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4getic.c of BSIM4.6.0. + * File: b4getic.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. **********/ diff --git a/src/spicelib/devices/bsim4/b4ld.c b/src/spicelib/devices/bsim4/b4ld.c index 7b69affb5..e00e08feb 100644 --- a/src/spicelib/devices/bsim4/b4ld.c +++ b/src/spicelib/devices/bsim4/b4ld.c @@ -1,19 +1,21 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4ld.c of BSIM4.6.0. + * File: b4ld.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. - * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. * Modified by Xuemei Xi, 11/15/2002. * Modified by Xuemei Xi, 05/09/2003. - * Modified by Xuemei Xi, 02/06/2004. + * Modified by Xuemei Xi, 03/04/2004. * Modified by Xuemei Xi, Mohan Dunga, 07/29/2005. * Modified by Mohan Dunga, 12/13/2006. + * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. **********/ #include "ngspice.h" @@ -32,6 +34,7 @@ #define MAX_EXP 5.834617425e14 #define MIN_EXP 1.713908431e-15 #define EXP_THRESHOLD 34.0 +#define EPS0 8.85418e-12 #define EPSSI 1.03594e-10 #define Charge_q 1.60219e-19 #define DELTA_1 0.02 @@ -52,7 +55,7 @@ } \ } -int BSIM4polyDepletion(double phi, double ngate,double coxe, double Vgs, double *Vgs_eff, double *dVgs_eff_dVg); +int BSIM4polyDepletion(double phi, double ngate,double epsgate, double coxe, double Vgs, double *Vgs_eff, double *dVgs_eff_dVg); int BSIM4load(inModel,ckt) @@ -191,7 +194,7 @@ double Nvtmrss, Nvtmrssws, Nvtmrsswgs; double Nvtmrsd, Nvtmrsswd, Nvtmrsswgd; double vs, Fsevl, dvs_dVg, dvs_dVd, dvs_dVb, dFsevl_dVg, dFsevl_dVd, dFsevl_dVb; -double vgdx, vgsx; +double vgdx, vgsx, epssub, toxe, epsrox; struct bsim4SizeDependParam *pParam; int ByPass, ChargeComputationNeeded, error, Check, Check1, Check2; @@ -964,6 +967,22 @@ for (; model != NULL; model = model->BSIM4nextModel) Vdb = -vbs; } + + /* dunga */ + if(model->BSIM4mtrlMod) + { + epsrox = 3.9; + toxe = model->BSIM4eot; + epssub = EPS0 * model->BSIM4epsrsub; + } + else + { + epsrox = model->BSIM4epsrox; + toxe = model->BSIM4toxe; + epssub = EPSSI; + } + + T0 = Vbs - here->BSIM4vbsc - 0.001; T1 = sqrt(T0 * T0 - 0.004 * here->BSIM4vbsc); if (T0 >= 0.0) @@ -982,7 +1001,6 @@ for (; model != NULL; model = model->BSIM4nextModel) T1 = sqrt(T0 * T0 + 0.004 * T9); Vbseff = T9 - 0.5 * (T0 + T1); dVbseff_dVb *= 0.5 * (1.0 + T0 / T1); - Phis = pParam->BSIM4phi - Vbseff; dPhis_dVb = -1.0; sqrtPhis = sqrt(Phis); @@ -1067,7 +1085,7 @@ for (; model != NULL; model = model->BSIM4nextModel) T1 = pParam->BSIM4k1ox * (T0 - 1.0) * pParam->BSIM4sqrtPhi + (pParam->BSIM4kt1 + pParam->BSIM4kt1l / Leff + pParam->BSIM4kt2 * Vbseff) * TempRatio; - Vth_NarrowW = model->BSIM4toxe * pParam->BSIM4phi + Vth_NarrowW = toxe * pParam->BSIM4phi / (pParam->BSIM4weff + pParam->BSIM4w0); T3 = here->BSIM4eta0 + pParam->BSIM4etab * Vbseff; @@ -1097,7 +1115,7 @@ for (; model != NULL; model = model->BSIM4nextModel) /* Calculate n */ - tmp1 = EPSSI / Xdep; + tmp1 = epssub / Xdep; here->BSIM4nstar = model->BSIM4vtm / Charge_q * (model->BSIM4coxe + tmp1 + pParam->BSIM4cit); tmp2 = pParam->BSIM4nfactor * tmp1; @@ -1156,10 +1174,15 @@ for (; model != NULL; model = model->BSIM4nextModel) /* Poly Gate Si Depletion Effect */ T0 = here->BSIM4vfb + pParam->BSIM4phi; + if(model->BSIM4mtrlMod == 0) + T1 = EPSSI; + else + T1 = model->BSIM4epsrgate * EPS0; - BSIM4polyDepletion(T0, pParam->BSIM4ngate, model->BSIM4coxe, vgs, &vgs_eff, &dvgs_eff_dvg); - BSIM4polyDepletion(T0, pParam->BSIM4ngate, model->BSIM4coxe, vgd, &vgd_eff, &dvgd_eff_dvg); + BSIM4polyDepletion(T0, pParam->BSIM4ngate, T1, model->BSIM4coxe, vgs, &vgs_eff, &dvgs_eff_dvg); + + BSIM4polyDepletion(T0, pParam->BSIM4ngate, T1, model->BSIM4coxe, vgd, &vgd_eff, &dvgd_eff_dvg); if(here->BSIM4mode>0) { Vgs_eff = vgs_eff; @@ -1334,53 +1357,57 @@ for (; model != NULL; model = model->BSIM4nextModel) Abulk0 *= T0; /* Mobility calculation */ + if (model->BSIM4mtrlMod) + T14 = 2.0 * model->BSIM4type *(model->BSIM4phig - model->BSIM4easub - 0.5*model->BSIM4Eg0 + 0.45); + else + T14 = 0.0; + if (model->BSIM4mobMod == 0) - { T0 = Vgsteff + Vth + Vth; + { T0 = Vgsteff + Vth + Vth - T14; T2 = pParam->BSIM4ua + pParam->BSIM4uc * Vbseff; - T3 = T0 / model->BSIM4toxe; + T3 = T0 / toxe; T12 = sqrt(Vth * Vth + 0.0001); T9 = 1.0/(Vgsteff + 2*T12); - T10 = T9*model->BSIM4toxe; + T10 = T9*toxe; T8 = pParam->BSIM4ud * T10 * T10 * Vth; T6 = T8 * Vth; T5 = T3 * (T2 + pParam->BSIM4ub * T3) + T6; T7 = - 2.0 * T6 * T9; T11 = T7 * Vth/T12; - dDenomi_dVg = (T2 + 2.0 * pParam->BSIM4ub * T3) / model->BSIM4toxe; + dDenomi_dVg = (T2 + 2.0 * pParam->BSIM4ub * T3) / toxe; T13 = 2.0 * (dDenomi_dVg + T11 + T8); dDenomi_dVd = T13 * dVth_dVd; dDenomi_dVb = T13 * dVth_dVb + pParam->BSIM4uc * T3; dDenomi_dVg+= T7; } else if (model->BSIM4mobMod == 1) - { T0 = Vgsteff + Vth + Vth; + { T0 = Vgsteff + Vth + Vth - T14; T2 = 1.0 + pParam->BSIM4uc * Vbseff; - T3 = T0 / model->BSIM4toxe; + T3 = T0 / toxe; T4 = T3 * (pParam->BSIM4ua + pParam->BSIM4ub * T3); T12 = sqrt(Vth * Vth + 0.0001); T9 = 1.0/(Vgsteff + 2*T12); - T10 = T9*model->BSIM4toxe; + T10 = T9*toxe; T8 = pParam->BSIM4ud * T10 * T10 * Vth; T6 = T8 * Vth; T5 = T4 * T2 + T6; T7 = - 2.0 * T6 * T9; T11 = T7 * Vth/T12; - dDenomi_dVg = (pParam->BSIM4ua + 2.0 * pParam->BSIM4ub * T3) * T2 - / model->BSIM4toxe; + dDenomi_dVg = (pParam->BSIM4ua + 2.0 * pParam->BSIM4ub * T3) * T2 / toxe; T13 = 2.0 * (dDenomi_dVg + T11 + T8); dDenomi_dVd = T13 * dVth_dVd; dDenomi_dVb = T13 * dVth_dVb + pParam->BSIM4uc * T4; dDenomi_dVg+= T7; } else - { T0 = (Vgsteff + here->BSIM4vtfbphi1) / model->BSIM4toxe; + { T0 = (Vgsteff + here->BSIM4vtfbphi1) / toxe; T1 = exp(pParam->BSIM4eu * log(T0)); - dT1_dVg = T1 * pParam->BSIM4eu / T0 / model->BSIM4toxe; + dT1_dVg = T1 * pParam->BSIM4eu / T0 / toxe; T2 = pParam->BSIM4ua + pParam->BSIM4uc * Vbseff; - T3 = T0 / model->BSIM4toxe; + T3 = T0 / toxe; T12 = sqrt(Vth * Vth + 0.0001); T9 = 1.0/(Vgsteff + 2*T12); - T10 = T9*model->BSIM4toxe; + T10 = T9*toxe; T8 = pParam->BSIM4ud * T10 * T10 * Vth; T6 = T8 * Vth; T5 = T1 * T2 + T6; @@ -1625,15 +1652,15 @@ for (; model != NULL; model = model->BSIM4nextModel) dT0_dVg = 1.0 / tmp2; T0 = (Vgsteff + tmp1) * dT0_dVg; - tmp3 = exp(0.7 * log(T0)); + tmp3 = exp(model->BSIM4bdos * 0.7 * log(T0)); T1 = 1.0 + tmp3; - T2 = 0.7 * tmp3 / T0; - Tcen = 1.9e-9 / T1; + T2 = model->BSIM4bdos * 0.7 * tmp3 / T0; + Tcen = model->BSIM4ados * 1.9e-9 / T1; dTcen_dVg = -Tcen * T2 * dT0_dVg / T1; - Coxeff = EPSSI * model->BSIM4coxp - / (EPSSI + model->BSIM4coxp * Tcen); - dCoxeff_dVg = -Coxeff * Coxeff * dTcen_dVg / EPSSI; + Coxeff = epssub * model->BSIM4coxp + / (epssub + model->BSIM4coxp * Tcen); + dCoxeff_dVg = -Coxeff * Coxeff * dTcen_dVg / epssub; CoxeffWovL = Coxeff * Weff / Leff; beta = ueff * CoxeffWovL; @@ -2104,9 +2131,15 @@ for (; model != NULL; model = model->BSIM4nextModel) /* Calculate GIDL current */ vgs_eff = here->BSIM4vgs_eff; dvgs_eff_dvg = here->BSIM4dvgs_eff_dvg; - T0 = 3.0 * model->BSIM4toxe; + if(model->BSIM4mtrlMod == 0) + T0 = 3.0 * toxe; + else + T0 = model->BSIM4epsrsub * toxe / epsrox; - T1 = (vds - vgs_eff - pParam->BSIM4egidl ) / T0; + if(model->BSIM4mtrlMod ==0) + T1 = (vds - vgs_eff - pParam->BSIM4egidl ) / T0; + else + T1 = (vds - vgs_eff - pParam->BSIM4egidl + pParam->BSIM4vfbsd) / T0; if ((pParam->BSIM4agidl <= 0.0) || (pParam->BSIM4bgidl <= 0.0) || (T1 <= 0.0) || (pParam->BSIM4cgidl <= 0.0) || (vbd > 0.0)) Igidl = Ggidld = Ggidlg = Ggidlb = 0.0; @@ -2146,7 +2179,10 @@ for (; model != NULL; model = model->BSIM4nextModel) vgd_eff = here->BSIM4vgd_eff; dvgd_eff_dvg = here->BSIM4dvgd_eff_dvg; + if(model->BSIM4mtrlMod ==0) T1 = (-vds - vgd_eff - pParam->BSIM4egisl ) / T0; + else + T1 = (-vds - vgd_eff - pParam->BSIM4egisl + pParam->BSIM4vfbsd ) / T0; if ((pParam->BSIM4agisl <= 0.0) || (pParam->BSIM4bgisl <= 0.0) || (T1 <= 0.0) || (pParam->BSIM4cgisl <= 0.0) || (vbs > 0.0)) @@ -2311,7 +2347,7 @@ for (; model != NULL; model = model->BSIM4nextModel) dPigcd_dVg = dPigcd_dVd = dPigcd_dVb = 0.0; } else - { T11 = pParam->BSIM4Bechvb * model->BSIM4toxe; + { T11 = pParam->BSIM4Bechvb * toxe; T12 = Vgsteff + 1.0e-20; T13 = T11 / T12 / T12; T14 = -T13 / T12; @@ -2485,7 +2521,7 @@ for (; model != NULL; model = model->BSIM4nextModel) T11 = 4.97232e-7 * pParam->BSIM4weff * pParam->BSIM4leff * pParam->BSIM4ToxRatio; - T12 = -7.45669e11 * model->BSIM4toxe; + T12 = -7.45669e11 * toxe; T3 = pParam->BSIM4aigbacc * pParam->BSIM4cigbacc - pParam->BSIM4bigbacc; T4 = pParam->BSIM4bigbacc * pParam->BSIM4cigbacc; @@ -3000,37 +3036,113 @@ for (; model != NULL; model = model->BSIM4nextModel) CoxWL = model->BSIM4coxe * pParam->BSIM4weffCV * pParam->BSIM4leffCV * here->BSIM4nf; - /* Seperate VgsteffCV with noff and voffcv */ - noff = n * pParam->BSIM4noff; - dnoff_dVd = pParam->BSIM4noff * dn_dVd; - dnoff_dVb = pParam->BSIM4noff * dn_dVb; - T0 = Vtm * noff; - voffcv = pParam->BSIM4voffcv; - VgstNVt = (Vgst - voffcv) / T0; - - if (VgstNVt > EXP_THRESHOLD) - { Vgsteff = Vgst - voffcv; - dVgsteff_dVg = dVgs_eff_dVg; - dVgsteff_dVd = -dVth_dVd; - dVgsteff_dVb = -dVth_dVb; - } - else if (VgstNVt < -EXP_THRESHOLD) - { Vgsteff = T0 * log(1.0 + MIN_EXP); - dVgsteff_dVg = 0.0; - dVgsteff_dVd = Vgsteff / noff; - dVgsteff_dVb = dVgsteff_dVd * dnoff_dVb; - dVgsteff_dVd *= dnoff_dVd; - } - else - { ExpVgst = exp(VgstNVt); - Vgsteff = T0 * log(1.0 + ExpVgst); - dVgsteff_dVg = ExpVgst / (1.0 + ExpVgst); - dVgsteff_dVd = -dVgsteff_dVg * (dVth_dVd + (Vgst - voffcv) - / noff * dnoff_dVd) + Vgsteff / noff * dnoff_dVd; - dVgsteff_dVb = -dVgsteff_dVg * (dVth_dVb + (Vgst - voffcv) - / noff * dnoff_dVb) + Vgsteff / noff * dnoff_dVb; - dVgsteff_dVg *= dVgs_eff_dVg; - } /* End of VgsteffCV */ + if(model->BSIM4cvchargeMod == 0) + { + /* Seperate VgsteffCV with noff and voffcv */ + noff = n * pParam->BSIM4noff; + dnoff_dVd = pParam->BSIM4noff * dn_dVd; + dnoff_dVb = pParam->BSIM4noff * dn_dVb; + T0 = Vtm * noff; + voffcv = pParam->BSIM4voffcv; + VgstNVt = (Vgst - voffcv) / T0; + + if (VgstNVt > EXP_THRESHOLD) + { + Vgsteff = Vgst - voffcv; + dVgsteff_dVg = dVgs_eff_dVg; + dVgsteff_dVd = -dVth_dVd; + dVgsteff_dVb = -dVth_dVb; + } + else if (VgstNVt < -EXP_THRESHOLD) + { + Vgsteff = T0 * log(1.0 + MIN_EXP); + dVgsteff_dVg = 0.0; + dVgsteff_dVd = Vgsteff / noff; + dVgsteff_dVb = dVgsteff_dVd * dnoff_dVb; + dVgsteff_dVd *= dnoff_dVd; + } + else + { + ExpVgst = exp(VgstNVt); + Vgsteff = T0 * log(1.0 + ExpVgst); + dVgsteff_dVg = ExpVgst / (1.0 + ExpVgst); + dVgsteff_dVd = -dVgsteff_dVg * (dVth_dVd + (Vgst - voffcv) + / noff * dnoff_dVd) + Vgsteff / noff * dnoff_dVd; + dVgsteff_dVb = -dVgsteff_dVg * (dVth_dVb + (Vgst - voffcv) + / noff * dnoff_dVb) + Vgsteff / noff * dnoff_dVb; + dVgsteff_dVg *= dVgs_eff_dVg; + } + /* End of VgsteffCV for cvchargeMod = 0 */ + } + else + { + T0 = n * Vtm; + T1 = pParam->BSIM4mstarcv * Vgst; + T2 = T1 / T0; + if (T2 > EXP_THRESHOLD) + { + T10 = T1; + dT10_dVg = pParam->BSIM4mstarcv * dVgs_eff_dVg; + dT10_dVd = -dVth_dVd * pParam->BSIM4mstarcv; + dT10_dVb = -dVth_dVb * pParam->BSIM4mstarcv; + } + else if (T2 < -EXP_THRESHOLD) + { + T10 = Vtm * log(1.0 + MIN_EXP); + dT10_dVg = 0.0; + dT10_dVd = T10 * dn_dVd; + dT10_dVb = T10 * dn_dVb; + T10 *= n; + } + else + { + ExpVgst = exp(T2); + T3 = Vtm * log(1.0 + ExpVgst); + T10 = n * T3; + dT10_dVg = pParam->BSIM4mstarcv * ExpVgst / (1.0 + ExpVgst); + dT10_dVb = T3 * dn_dVb - dT10_dVg * (dVth_dVb + Vgst * dn_dVb / n); + dT10_dVd = T3 * dn_dVd - dT10_dVg * (dVth_dVd + Vgst * dn_dVd / n); + dT10_dVg *= dVgs_eff_dVg; + } + + T1 = pParam->BSIM4voffcbncv - (1.0 - pParam->BSIM4mstarcv) * Vgst; + T2 = T1 / T0; + if (T2 < -EXP_THRESHOLD) + { + T3 = model->BSIM4coxe * MIN_EXP / pParam->BSIM4cdep0; + T9 = pParam->BSIM4mstarcv + T3 * n; + dT9_dVg = 0.0; + dT9_dVd = dn_dVd * T3; + dT9_dVb = dn_dVb * T3; + } + else if (T2 > EXP_THRESHOLD) + { + T3 = model->BSIM4coxe * MAX_EXP / pParam->BSIM4cdep0; + T9 = pParam->BSIM4mstarcv + T3 * n; + dT9_dVg = 0.0; + dT9_dVd = dn_dVd * T3; + dT9_dVb = dn_dVb * T3; + } + else + { + ExpVgst = exp(T2); + T3 = model->BSIM4coxe / pParam->BSIM4cdep0; + T4 = T3 * ExpVgst; + T5 = T1 * T4 / T0; + T9 = pParam->BSIM4mstarcv + n * T4; + dT9_dVg = T3 * (pParam->BSIM4mstarcv - 1.0) * ExpVgst / Vtm; + dT9_dVb = T4 * dn_dVb - dT9_dVg * dVth_dVb - T5 * dn_dVb; + dT9_dVd = T4 * dn_dVd - dT9_dVg * dVth_dVd - T5 * dn_dVd; + dT9_dVg *= dVgs_eff_dVg; + } + + Vgsteff = T10 / T9; + T11 = T9 * T9; + dVgsteff_dVg = (T9 * dT10_dVg - T10 * dT9_dVg) / T11; + dVgsteff_dVd = (T9 * dT10_dVd - T10 * dT9_dVd) / T11; + dVgsteff_dVb = (T9 * dT10_dVb - T10 * dT9_dVb) / T11; + /* End of VgsteffCV for cvchargeMod = 1 */ + } if (model->BSIM4capMod == 1) @@ -3096,7 +3208,7 @@ for (; model != NULL; model = model->BSIM4nextModel) VdseffCV = VdsatCV * T4; dVdseffCV_dVg = dT0_dVg * T4 + T5 * (dT1_dVg - dT0_dVg); dVdseffCV_dVd = T5 * (dT1_dVd + 1.0); - dVdseffCV_dVb = dT0_dVb * (1.0 - T5) + T5 * dT1_dVb; + dVdseffCV_dVb = dT0_dVb * (T4 - T5) + T5 * dT1_dVb; } if (Vds == 0.0) @@ -3247,7 +3359,7 @@ for (; model != NULL; model = model->BSIM4nextModel) dTcen_dVg *= T1; dTcen_dVb *= T1; - Ccen = EPSSI / Tcen; + Ccen = epssub / Tcen; T2 = Cox / (Cox + Ccen); Coxeff = T2 * Ccen; T3 = -Ccen / Tcen; @@ -3311,16 +3423,16 @@ for (; model != NULL; model = model->BSIM4nextModel) Tox += Tox; /* WDLiu: Tcen reevaluated below due to different Vgsteff */ T0 = (Vgsteff + here->BSIM4vtfbphi2) / Tox; - tmp = exp(0.7 * log(T0)); + tmp = exp(model->BSIM4bdos * 0.7 * log(T0)); T1 = 1.0 + tmp; - T2 = 0.7 * tmp / (T0 * Tox); - Tcen = 1.9e-9 / T1; + T2 = model->BSIM4bdos * 0.7 * tmp / (T0 * Tox); + Tcen = model->BSIM4ados * 1.9e-9 / T1; dTcen_dVg = -Tcen * T2 / T1; dTcen_dVd = dTcen_dVg * dVgsteff_dVd; dTcen_dVb = dTcen_dVg * dVgsteff_dVb; dTcen_dVg *= dVgsteff_dVg; - Ccen = EPSSI / Tcen; + Ccen = epssub / Tcen; T0 = Cox / (Cox + Ccen); Coxeff = T0 * Ccen; T1 = -Ccen / Tcen; @@ -3355,7 +3467,7 @@ for (; model != NULL; model = model->BSIM4nextModel) VdseffCV = VdsatCV * T4; dVdseffCV_dVg = dT0_dVg * T4 + T5 * (dT1_dVg - dT0_dVg); dVdseffCV_dVd = T5 * (dT1_dVd + 1.0); - dVdseffCV_dVb = dT0_dVb * (1.0 - T5) + T5 * dT1_dVb; + dVdseffCV_dVb = dT0_dVb * (T4 - T5) + T5 * dT1_dVb; } if (Vds == 0.0) @@ -3646,10 +3758,6 @@ finished: if ((here->BSIM4off == 0) || (!(ckt->CKTmode & MODEINITFIX))) { if (Check == 1) { ckt->CKTnoncon++; - -/* "Following #ifndef NEWCONV" to "#endif" is commented out in the former version. - However, since it was satisfactory when I checked, it has left as it is. - Please comment out, supposing you get a problem. */ #ifndef NEWCONV } else @@ -4560,7 +4668,7 @@ line900: * Loading RHS */ - m = here->BSIM4m; + m = here->BSIM4m; (*(ckt->CKTrhs + here->BSIM4dNodePrime) += m * (ceqjd - ceqbd + ceqgdtot - ceqdrn - ceqqd + Idtoteq)); @@ -4788,6 +4896,7 @@ return(OK); int BSIM4polyDepletion( double phi, double ngate, + double epsgate, double coxe, double Vgs, double *Vgs_eff, @@ -4797,8 +4906,9 @@ int BSIM4polyDepletion( /* Poly Gate Si Depletion Effect */ if ((ngate > 1.0e18) && - (ngate < 1.0e25) && (Vgs > phi)) { - T1 = 1.0e6 * CHARGE * EPSSI * ngate / (coxe * coxe); + (ngate < 1.0e25) && (Vgs > phi) && (epsgate!=0) + ){ + T1 = 1.0e6 * CHARGE * epsgate * ngate / (coxe * coxe); T8 = Vgs - phi; T4 = sqrt(1.0 + 2.0 * T8 / T1); T2 = 2.0 * T8 / (T4 + 1.0); diff --git a/src/spicelib/devices/bsim4/b4mask.c b/src/spicelib/devices/bsim4/b4mask.c index 1f8a2f08e..ef6798325 100644 --- a/src/spicelib/devices/bsim4/b4mask.c +++ b/src/spicelib/devices/bsim4/b4mask.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4mask.c of BSIM4.6.0. + * File: b4mask.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. @@ -13,6 +14,7 @@ * Modified by Xuemei Xi, 05/09/2003. * Modified by Xuemei Xi, Mohan Dunga, 07/29/2005. * Modified by Mohan Dunga, 12/13/2006 + * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. **********/ @@ -42,6 +44,9 @@ IFvalue *value; case BSIM4_MOD_BINUNIT : value->iValue = model->BSIM4binUnit; return(OK); + case BSIM4_MOD_CVCHARGEMOD : + value->iValue = model->BSIM4cvchargeMod; + return(OK); case BSIM4_MOD_CAPMOD : value->iValue = model->BSIM4capMod; return(OK); @@ -75,6 +80,10 @@ IFvalue *value; case BSIM4_MOD_GEOMOD : value->iValue = model->BSIM4geoMod; return(OK); + case BSIM4_MOD_MTRLMOD : + value->iValue = model->BSIM4mtrlMod; + return(OK); + case BSIM4_MOD_IGCMOD : value->iValue = model->BSIM4igcMod; return(OK); @@ -91,6 +100,18 @@ IFvalue *value; case BSIM4_MOD_TOXREF : value->rValue = model->BSIM4toxref; return(OK); + case BSIM4_MOD_EOT : + value->rValue = model->BSIM4eot; + return(OK); + case BSIM4_MOD_VDDEOT : + value->rValue = model->BSIM4vddeot; + return(OK); + case BSIM4_MOD_ADOS : + value->rValue = model->BSIM4ados; + return(OK); + case BSIM4_MOD_BDOS : + value->rValue = model->BSIM4bdos; + return(OK); case BSIM4_MOD_TOXE : value->rValue = model->BSIM4toxe; return(OK); @@ -164,6 +185,30 @@ IFvalue *value; case BSIM4_MOD_NSUB: value->rValue = model->BSIM4nsub; return(OK); + case BSIM4_MOD_PHIG: + value->rValue = model->BSIM4phig; + return(OK); + case BSIM4_MOD_EPSRGATE: + value->rValue = model->BSIM4epsrgate; + return(OK); + case BSIM4_MOD_EASUB: + value->rValue = model->BSIM4easub; + return(OK); + case BSIM4_MOD_EPSRSUB: + value->rValue = model->BSIM4epsrsub; + return(OK); + case BSIM4_MOD_NI0SUB: + value->rValue = model->BSIM4ni0sub; + return(OK); + case BSIM4_MOD_BG0SUB: + value->rValue = model->BSIM4bg0sub; + return(OK); + case BSIM4_MOD_TBGASUB: + value->rValue = model->BSIM4tbgasub; + return(OK); + case BSIM4_MOD_TBGBSUB: + value->rValue = model->BSIM4tbgbsub; + return(OK); case BSIM4_MOD_NDEP: value->rValue = model->BSIM4ndep; return(OK); @@ -305,9 +350,15 @@ IFvalue *value; case BSIM4_MOD_VOFFL: value->rValue = model->BSIM4voffl; return(OK); + case BSIM4_MOD_VOFFCVL: + value->rValue = model->BSIM4voffcvl; + return(OK); case BSIM4_MOD_MINV: value->rValue = model->BSIM4minv; return(OK); + case BSIM4_MOD_MINVCV: + value->rValue = model->BSIM4minvcv; + return(OK); case BSIM4_MOD_FPROUT: value->rValue = model->BSIM4fprout; return(OK); @@ -1015,6 +1066,9 @@ IFvalue *value; case BSIM4_MOD_LMINV: value->rValue = model->BSIM4lminv; return(OK); + case BSIM4_MOD_LMINVCV: + value->rValue = model->BSIM4lminvcv; + return(OK); case BSIM4_MOD_LFPROUT: value->rValue = model->BSIM4lfprout; return(OK); @@ -1429,6 +1483,9 @@ IFvalue *value; case BSIM4_MOD_WMINV: value->rValue = model->BSIM4wminv; return(OK); + case BSIM4_MOD_WMINVCV: + value->rValue = model->BSIM4wminvcv; + return(OK); case BSIM4_MOD_WFPROUT: value->rValue = model->BSIM4wfprout; return(OK); @@ -1843,6 +1900,9 @@ IFvalue *value; case BSIM4_MOD_PMINV: value->rValue = model->BSIM4pminv; return(OK); + case BSIM4_MOD_PMINVCV: + value->rValue = model->BSIM4pminvcv; + return(OK); case BSIM4_MOD_PFPROUT: value->rValue = model->BSIM4pfprout; return(OK); diff --git a/src/spicelib/devices/bsim4/b4mdel.c b/src/spicelib/devices/bsim4/b4mdel.c index eb1e9d468..31ee7d357 100644 --- a/src/spicelib/devices/bsim4/b4mdel.c +++ b/src/spicelib/devices/bsim4/b4mdel.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4mdel.c of BSIM4.6.0. + * File: b4mdel.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. **********/ diff --git a/src/spicelib/devices/bsim4/b4mpar.c b/src/spicelib/devices/bsim4/b4mpar.c index 3c9ff24ff..cb8e71d22 100644 --- a/src/spicelib/devices/bsim4/b4mpar.c +++ b/src/spicelib/devices/bsim4/b4mpar.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4mpar.c of BSIM4.6.0. + * File: b4mpar.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. @@ -14,6 +15,7 @@ * Modified by Xuemei Xi, 03/04/2004. * Modified by Xuemei Xi, Mohan Dunga, 07/29/2005. * Modified by Mohan Dunga, 12/13/2006 + * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. **********/ #include "ngspice.h" @@ -42,6 +44,10 @@ GENmodel *inMod; mod->BSIM4paramChk = value->iValue; mod->BSIM4paramChkGiven = TRUE; break; + case BSIM4_MOD_CVCHARGEMOD : + mod->BSIM4cvchargeMod = value->iValue; + mod->BSIM4cvchargeModGiven = TRUE; + break; case BSIM4_MOD_CAPMOD : mod->BSIM4capMod = value->iValue; mod->BSIM4capModGiven = TRUE; @@ -86,6 +92,10 @@ GENmodel *inMod; mod->BSIM4tnoiMod = value->iValue; mod->BSIM4tnoiModGiven = TRUE; break; + case BSIM4_MOD_MTRLMOD : + mod->BSIM4mtrlMod = value->iValue; + mod->BSIM4mtrlModGiven = TRUE; + break; case BSIM4_MOD_IGCMOD : mod->BSIM4igcMod = value->iValue; mod->BSIM4igcModGiven = TRUE; @@ -107,7 +117,23 @@ GENmodel *inMod; mod->BSIM4toxref = value->rValue; mod->BSIM4toxrefGiven = TRUE; break; - case BSIM4_MOD_TOXE : + case BSIM4_MOD_EOT : + mod->BSIM4eot = value->rValue; + mod->BSIM4eotGiven = TRUE; + break; + case BSIM4_MOD_VDDEOT : + mod->BSIM4vddeot = value->rValue; + mod->BSIM4vddeotGiven = TRUE; + break; + case BSIM4_MOD_ADOS : + mod->BSIM4ados = value->rValue; + mod->BSIM4adosGiven = TRUE; + break; + case BSIM4_MOD_BDOS : + mod->BSIM4bdos = value->rValue; + mod->BSIM4bdosGiven = TRUE; + break; + case BSIM4_MOD_TOXE : mod->BSIM4toxe = value->rValue; mod->BSIM4toxeGiven = TRUE; break; @@ -188,6 +214,38 @@ GENmodel *inMod; mod->BSIM4nsub = value->rValue; mod->BSIM4nsubGiven = TRUE; break; + case BSIM4_MOD_PHIG: + mod->BSIM4phig = value->rValue; + mod->BSIM4phigGiven = TRUE; + break; + case BSIM4_MOD_EPSRGATE: + mod->BSIM4epsrgate = value->rValue; + mod->BSIM4epsrgateGiven = TRUE; + break; + case BSIM4_MOD_EASUB: + mod->BSIM4easub = value->rValue; + mod->BSIM4easubGiven = TRUE; + break; + case BSIM4_MOD_EPSRSUB: + mod->BSIM4epsrsub = value->rValue; + mod->BSIM4epsrsubGiven = TRUE; + break; + case BSIM4_MOD_NI0SUB: + mod->BSIM4ni0sub = value->rValue; + mod->BSIM4ni0subGiven = TRUE; + break; + case BSIM4_MOD_BG0SUB: + mod->BSIM4bg0sub = value->rValue; + mod->BSIM4bg0subGiven = TRUE; + break; + case BSIM4_MOD_TBGASUB: + mod->BSIM4tbgasub = value->rValue; + mod->BSIM4tbgasubGiven = TRUE; + break; + case BSIM4_MOD_TBGBSUB: + mod->BSIM4tbgbsub = value->rValue; + mod->BSIM4tbgbsubGiven = TRUE; + break; case BSIM4_MOD_NDEP: mod->BSIM4ndep = value->rValue; mod->BSIM4ndepGiven = TRUE; @@ -425,10 +483,18 @@ GENmodel *inMod; mod->BSIM4voffl = value->rValue; mod->BSIM4vofflGiven = TRUE; break; + case BSIM4_MOD_VOFFCVL: + mod->BSIM4voffcvl = value->rValue; + mod->BSIM4voffcvlGiven = TRUE; + break; case BSIM4_MOD_MINV: mod->BSIM4minv = value->rValue; mod->BSIM4minvGiven = TRUE; break; + case BSIM4_MOD_MINVCV: + mod->BSIM4minvcv = value->rValue; + mod->BSIM4minvcvGiven = TRUE; + break; case BSIM4_MOD_FPROUT: mod->BSIM4fprout = value->rValue; mod->BSIM4fproutGiven = TRUE; @@ -1551,6 +1617,10 @@ GENmodel *inMod; mod->BSIM4lminv = value->rValue; mod->BSIM4lminvGiven = TRUE; break; + case BSIM4_MOD_LMINVCV: + mod->BSIM4lminvcv = value->rValue; + mod->BSIM4lminvcvGiven = TRUE; + break; case BSIM4_MOD_LFPROUT: mod->BSIM4lfprout = value->rValue; mod->BSIM4lfproutGiven = TRUE; @@ -2107,6 +2177,10 @@ GENmodel *inMod; mod->BSIM4wminv = value->rValue; mod->BSIM4wminvGiven = TRUE; break; + case BSIM4_MOD_WMINVCV: + mod->BSIM4wminvcv = value->rValue; + mod->BSIM4wminvcvGiven = TRUE; + break; case BSIM4_MOD_WFPROUT: mod->BSIM4wfprout = value->rValue; mod->BSIM4wfproutGiven = TRUE; @@ -2663,6 +2737,10 @@ GENmodel *inMod; mod->BSIM4pminv = value->rValue; mod->BSIM4pminvGiven = TRUE; break; + case BSIM4_MOD_PMINVCV: + mod->BSIM4pminvcv = value->rValue; + mod->BSIM4pminvcvGiven = TRUE; + break; case BSIM4_MOD_PFPROUT: mod->BSIM4pfprout = value->rValue; mod->BSIM4pfproutGiven = TRUE; diff --git a/src/spicelib/devices/bsim4/b4noi.c b/src/spicelib/devices/bsim4/b4noi.c index 2e1d1e521..745afee0d 100644 --- a/src/spicelib/devices/bsim4/b4noi.c +++ b/src/spicelib/devices/bsim4/b4noi.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4noi.c of BSIM4.6.0. + * File: b4noi.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. diff --git a/src/spicelib/devices/bsim4/b4par.c b/src/spicelib/devices/bsim4/b4par.c index c5c1020f4..19f07b543 100644 --- a/src/spicelib/devices/bsim4/b4par.c +++ b/src/spicelib/devices/bsim4/b4par.c @@ -1,10 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4par.c of BSIM4.6.0. + * File: b4par.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. + * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 11/15/2002. diff --git a/src/spicelib/devices/bsim4/b4pzld.c b/src/spicelib/devices/bsim4/b4pzld.c index a53a8811d..3e481cad5 100644 --- a/src/spicelib/devices/bsim4/b4pzld.c +++ b/src/spicelib/devices/bsim4/b4pzld.c @@ -1,4 +1,4 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. @@ -6,6 +6,7 @@ * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 10/05/2001. **********/ @@ -55,7 +56,7 @@ double m; { for (here = model->BSIM4instances; here!= NULL; here = here->BSIM4nextInstance) { if (here->BSIM4owner != ARCHme) continue; - pParam = here->pParam; + pParam = here->pParam; capbd = here->BSIM4capbd; capbs = here->BSIM4capbs; cgso = here->BSIM4cgso; @@ -484,7 +485,7 @@ double m; /* * Loading PZ matrix */ - m = here->BSIM4m; + m = here->BSIM4m; if (!model->BSIM4rdsMod) { gdpr = here->BSIM4drainConductance; diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index bb800bfd3..3be2f2bdd 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -1,10 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4set.c of BSIM4.6.0. + * File: b4set.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. + * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. @@ -13,6 +15,7 @@ * Modified by Xuemei Xi, 03/04/2004. * Modified by Xuemei Xi, Mohan Dunga, 07/29/2005. * Modified by Mohan Dunga, 12/13/2006 + * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. **********/ #include "ngspice.h" @@ -88,6 +91,8 @@ JOB *job; printf("Warning: dioMod has been set to its default value: 1.\n"); } + if (!model->BSIM4cvchargeModGiven) + model->BSIM4cvchargeMod = 0; if (!model->BSIM4capModGiven) model->BSIM4capMod = 2; else if ((model->BSIM4capMod != 0) && (model->BSIM4capMod != 1) @@ -153,6 +158,9 @@ JOB *job; printf("Warning: acnqsMod has been set to its default value: 0.\n"); } + if (!model->BSIM4mtrlModGiven) + model->BSIM4mtrlMod = 0; + if (!model->BSIM4igcModGiven) model->BSIM4igcMod = 0; else if ((model->BSIM4igcMod != 0) && (model->BSIM4igcMod != 1) @@ -178,6 +186,14 @@ JOB *job; model->BSIM4version = "4.6.0"; if (!model->BSIM4toxrefGiven) model->BSIM4toxref = 30.0e-10; + if (!model->BSIM4eotGiven) + model->BSIM4eot = 15.0e-10; + if (!model->BSIM4vddeotGiven) + model->BSIM4vddeot = (model->BSIM4type == NMOS) ? 1.5 : -1.5; + if (!model->BSIM4adosGiven) + model->BSIM4ados = 1.0; + if (!model->BSIM4bdosGiven) + model->BSIM4bdos = 1.0; if (!model->BSIM4toxeGiven) model->BSIM4toxe = 30.0e-10; if (!model->BSIM4toxpGiven) @@ -217,6 +233,22 @@ JOB *job; model->BSIM4keta = -0.047; /* unit / V */ if (!model->BSIM4nsubGiven) model->BSIM4nsub = 6.0e16; /* unit 1/cm3 */ + if (!model->BSIM4phigGiven) + model->BSIM4phig = 4.05; + if (!model->BSIM4epsrgateGiven) + model->BSIM4epsrgate = 11.7; + if (!model->BSIM4easubGiven) + model->BSIM4easub = 4.05; + if (!model->BSIM4epsrsubGiven) + model->BSIM4epsrsub = 11.7; + if (!model->BSIM4ni0subGiven) + model->BSIM4ni0sub = 1.45e10; /* unit 1/cm3 */ + if (!model->BSIM4bg0subGiven) + model->BSIM4bg0sub = 1.16; /* unit eV */ + if (!model->BSIM4tbgasubGiven) + model->BSIM4tbgasub = 7.02e-4; + if (!model->BSIM4tbgbsubGiven) + model->BSIM4tbgbsub = 1108.0; if (!model->BSIM4ndepGiven) model->BSIM4ndep = 1.7e17; /* unit 1/cm3 */ if (!model->BSIM4nsdGiven) @@ -301,8 +333,12 @@ JOB *job; model->BSIM4voff = -0.08; if (!model->BSIM4vofflGiven) model->BSIM4voffl = 0.0; + if (!model->BSIM4voffcvlGiven) + model->BSIM4voffcvl = 0.0; if (!model->BSIM4minvGiven) model->BSIM4minv = 0.0; + if (!model->BSIM4minvcvGiven) + model->BSIM4minvcv = 0.0; if (!model->BSIM4fproutGiven) model->BSIM4fprout = 0.0; if (!model->BSIM4pditsGiven) @@ -748,6 +784,8 @@ JOB *job; model->BSIM4lvoff = 0.0; if (!model->BSIM4lminvGiven) model->BSIM4lminv = 0.0; + if (!model->BSIM4lminvcvGiven) + model->BSIM4lminvcv = 0.0; if (!model->BSIM4lfproutGiven) model->BSIM4lfprout = 0.0; if (!model->BSIM4lpditsGiven) @@ -961,7 +999,7 @@ JOB *job; model->BSIM4wcdsc = 0.0; if (!model->BSIM4wcdscbGiven) model->BSIM4wcdscb = 0.0; - if (!model->BSIM4wcdscdGiven) + if (!model->BSIM4wcdscdGiven) model->BSIM4wcdscd = 0.0; if (!model->BSIM4wcitGiven) model->BSIM4wcit = 0.0; @@ -1063,6 +1101,8 @@ JOB *job; model->BSIM4wvoff = 0.0; if (!model->BSIM4wminvGiven) model->BSIM4wminv = 0.0; + if (!model->BSIM4wminvcvGiven) + model->BSIM4wminvcv = 0.0; if (!model->BSIM4wfproutGiven) model->BSIM4wfprout = 0.0; if (!model->BSIM4wpditsGiven) @@ -1378,6 +1418,8 @@ JOB *job; model->BSIM4pvoff = 0.0; if (!model->BSIM4pminvGiven) model->BSIM4pminv = 0.0; + if (!model->BSIM4pminvcvGiven) + model->BSIM4pminvcv = 0.0; if (!model->BSIM4pfproutGiven) model->BSIM4pfprout = 0.0; if (!model->BSIM4ppditsGiven) @@ -1950,8 +1992,8 @@ JOB *job; for (here = model->BSIM4instances; here != NULL ; here=here->BSIM4nextInstance) { - if (here->BSIM4owner == ARCHme) { - /* allocate a chunk of the state vector */ + if (here->BSIM4owner == ARCHme) { + /* allocate a chunk of the state vector */ here->BSIM4states = *states; *states += BSIM4numStates; } diff --git a/src/spicelib/devices/bsim4/b4temp.c b/src/spicelib/devices/bsim4/b4temp.c index b050a9de2..9239bd31a 100644 --- a/src/spicelib/devices/bsim4/b4temp.c +++ b/src/spicelib/devices/bsim4/b4temp.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4temp.c of BSIM4.6.0. + * File: b4temp.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. * Modified by Xuemei Xi, 04/06/2001. * Modified by Xuemei Xi, 10/05/2001. @@ -13,7 +14,8 @@ * Modified by Xuemei Xi, 05/09/2003. * Modified by Xuemei Xi, 03/04/2004. * Modified by Xuemei Xi, Mohan Dunga, 07/29/2005. - * Modified by Mohan Dunga, 12/13/2006 + * Modified by Mohan Dunga, 12/13/2006. + * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. **********/ #include "ngspice.h" @@ -73,9 +75,9 @@ CKTcircuit *ckt; { BSIM4model *model = (BSIM4model*) inModel; BSIM4instance *here; -struct bsim4SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam=NULL; -double tmp, tmp1, tmp2, Eg, Eg0, ni; -double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Lnew=0.0, Wnew; +struct bsim4SizeDependParam *pSizeDependParamKnot, *pLastKnot, *pParam; +double tmp, tmp1, tmp2, tmp3, Eg, Eg0, ni, epssub; +double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Lnew, Wnew; double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom; double dumPs, dumPd, dumAs, dumAd, PowWeffWr; double DMCGeff, DMCIeff, DMDGeff; @@ -85,6 +87,8 @@ double Inv_saref, Inv_sbref, Inv_sa, Inv_sb, rho, Ldrn, dvth0_lod; double W_tmp, Inv_ODeff, OD_offset, dk2_lod, deta0_lod; double lnl, lnw, lnnf, rbpbx, rbpby, rbsbx, rbsby, rbdbx, rbdby,bodymode; double kvsat, wlod, sceff, Wdrn; +double V0, lt1, ltw, Theta0, Delt_vth, TempRatio, Vth_NarrowW, Lpe_Vb, Vth; +double n, Vgsteff, Vgs_eff, niter, toxpf, toxpi, Tcen, toxe, epsrox, vddeot; int Size_Not_Found, i; @@ -117,15 +121,33 @@ int Size_Not_Found, i; fprintf(stderr, "Given pbswgd is less than 0.1. Pbswgd is set to 0.1.\n"); } - if ((model->BSIM4toxeGiven) && (model->BSIM4toxpGiven) && (model->BSIM4dtoxGiven) - && (model->BSIM4toxe != (model->BSIM4toxp + model->BSIM4dtox))) - printf("Warning: toxe, toxp and dtox all given and toxe != toxp + dtox; dtox ignored.\n"); - else if ((model->BSIM4toxeGiven) && (!model->BSIM4toxpGiven)) - model->BSIM4toxp = model->BSIM4toxe - model->BSIM4dtox; - else if ((!model->BSIM4toxeGiven) && (model->BSIM4toxpGiven)) - model->BSIM4toxe = model->BSIM4toxp + model->BSIM4dtox; + if(model->BSIM4mtrlMod == 0) + { + if ((model->BSIM4toxeGiven) && (model->BSIM4toxpGiven) && (model->BSIM4dtoxGiven) + && (model->BSIM4toxe != (model->BSIM4toxp + model->BSIM4dtox))) + printf("Warning: toxe, toxp and dtox all given and toxe != toxp + dtox; dtox ignored.\n"); + else if ((model->BSIM4toxeGiven) && (!model->BSIM4toxpGiven)) + model->BSIM4toxp = model->BSIM4toxe - model->BSIM4dtox; + else if ((!model->BSIM4toxeGiven) && (model->BSIM4toxpGiven)) + model->BSIM4toxe = model->BSIM4toxp + model->BSIM4dtox; + } - model->BSIM4coxe = model->BSIM4epsrox * EPS0 / model->BSIM4toxe; + if(model->BSIM4mtrlMod) + { + epsrox = 3.9; + toxe = model->BSIM4eot; + epssub = EPS0 * model->BSIM4epsrsub; + } + else + { + epsrox = model->BSIM4epsrox; + toxe = model->BSIM4toxe; + epssub = EPSSI; + } + + + model->BSIM4coxe = epsrox * EPS0 / toxe; + if(model->BSIM4mtrlMod == 0) model->BSIM4coxp = model->BSIM4epsrox * EPS0 / model->BSIM4toxp; if (!model->BSIM4cgdoGiven) @@ -153,16 +175,33 @@ int Size_Not_Found, i; TRatio = Temp / Tnom; model->BSIM4vcrit = CONSTvt0 * log(CONSTvt0 / (CONSTroot2 * 1.0e-14)); - model->BSIM4factor1 = sqrt(EPSSI / (model->BSIM4epsrox * EPS0) - * model->BSIM4toxe); + model->BSIM4factor1 = sqrt(epssub / (epsrox * EPS0)* toxe); Vtm0 = model->BSIM4vtm0 = KboQ * Tnom; - Eg0 = 1.16 - 7.02e-4 * Tnom * Tnom / (Tnom + 1108.0); - ni = 1.45e10 * (Tnom / 300.15) * sqrt(Tnom / 300.15) - * exp(21.5565981 - Eg0 / (2.0 * Vtm0)); + + if(model->BSIM4mtrlMod==0) + { + Eg0 = 1.16 - 7.02e-4 * Tnom * Tnom / (Tnom + 1108.0); + ni = 1.45e10 * (Tnom / 300.15) * sqrt(Tnom / 300.15) + * exp(21.5565981 - Eg0 / (2.0 * Vtm0)); + } + else + { + Eg0 = model->BSIM4bg0sub - model->BSIM4tbgasub * Tnom * Tnom + / (Tnom + model->BSIM4tbgbsub); + T0 = model->BSIM4bg0sub - model->BSIM4tbgasub * 90090.0225 + / (300.15 + model->BSIM4tbgbsub); + ni = model->BSIM4ni0sub * (Tnom / 300.15) * sqrt(Tnom / 300.15) + * exp((T0 - Eg0) / (2.0 * Vtm0)); + } + model->BSIM4Eg0 = Eg0; model->BSIM4vtm = KboQ * Temp; - Eg = 1.16 - 7.02e-4 * Temp * Temp / (Temp + 1108.0); + if(model->BSIM4mtrlMod == 0) + Eg = 1.16 - 7.02e-4 * Temp * Temp / (Temp + 1108.0); + else + Eg = model->BSIM4bg0sub - model->BSIM4tbgasub * Temp * Temp + / (Temp + model->BSIM4tbgbsub); if (Temp != Tnom) { T0 = Eg0 / Vtm0 - Eg / model->BSIM4vtm; T1 = log(Temp / Tnom); @@ -719,6 +758,10 @@ int Size_Not_Found, i; + model->BSIM4lminv * Inv_L + model->BSIM4wminv * Inv_W + model->BSIM4pminv * Inv_LW; + pParam->BSIM4minvcv = model->BSIM4minvcv + + model->BSIM4lminvcv * Inv_L + + model->BSIM4wminvcv * Inv_W + + model->BSIM4pminvcv * Inv_LW; pParam->BSIM4fprout = model->BSIM4fprout + model->BSIM4lfprout * Inv_L + model->BSIM4wfprout * Inv_W @@ -1147,33 +1190,49 @@ int Size_Not_Found, i; pParam->BSIM4sqrtPhi = sqrt(pParam->BSIM4phi); pParam->BSIM4phis3 = pParam->BSIM4sqrtPhi * pParam->BSIM4phi; - pParam->BSIM4Xdep0 = sqrt(2.0 * EPSSI / (Charge_q + pParam->BSIM4Xdep0 = sqrt(2.0 * epssub / (Charge_q * pParam->BSIM4ndep * 1.0e6)) * pParam->BSIM4sqrtPhi; pParam->BSIM4sqrtXdep0 = sqrt(pParam->BSIM4Xdep0); - pParam->BSIM4litl = sqrt(3.0 * pParam->BSIM4xj - * model->BSIM4toxe); + + if(model->BSIM4mtrlMod == 0) + pParam->BSIM4litl = sqrt(3.0 * pParam->BSIM4xj * toxe); + else + pParam->BSIM4litl = sqrt(model->BSIM4epsrsub/epsrox * pParam->BSIM4xj * toxe); + pParam->BSIM4vbi = Vtm0 * log(pParam->BSIM4nsd * pParam->BSIM4ndep / (ni * ni)); - if (pParam->BSIM4ngate > 0.0) - { pParam->BSIM4vfbsd = Vtm0 * log(pParam->BSIM4ngate + if (model->BSIM4mtrlMod == 0) + { + if (pParam->BSIM4ngate > 0.0) + { pParam->BSIM4vfbsd = Vtm0 * log(pParam->BSIM4ngate / pParam->BSIM4nsd); + } + else + pParam->BSIM4vfbsd = 0.0; } else - pParam->BSIM4vfbsd = 0.0; + { + T0 = Vtm0 * log(pParam->BSIM4nsd/ni); + T1 = 0.5 * Eg0; + if(T0 > T1) + T0 = T1; + T2 = model->BSIM4easub + T1 - model->BSIM4type * T0; + pParam->BSIM4vfbsd = model->BSIM4phig - T2; + } - pParam->BSIM4cdep0 = sqrt(Charge_q * EPSSI + pParam->BSIM4cdep0 = sqrt(Charge_q * epssub * pParam->BSIM4ndep * 1.0e6 / 2.0 / pParam->BSIM4phi); pParam->BSIM4ToxRatio = exp(pParam->BSIM4ntox - * log(model->BSIM4toxref / model->BSIM4toxe)) - / model->BSIM4toxe / model->BSIM4toxe; + * log(model->BSIM4toxref / toxe)) + / toxe / toxe; pParam->BSIM4ToxRatioEdge = exp(pParam->BSIM4ntox * log(model->BSIM4toxref - / (model->BSIM4toxe * pParam->BSIM4poxedge))) - / model->BSIM4toxe / model->BSIM4toxe + / (toxe * pParam->BSIM4poxedge))) + / toxe / toxe / pParam->BSIM4poxedge / pParam->BSIM4poxedge; pParam->BSIM4Aechvb = (model->BSIM4type == NMOS) ? 4.97232e-7 : 3.42537e-7; pParam->BSIM4Bechvb = (model->BSIM4type == NMOS) ? 7.45669e11 : 1.16645e12; @@ -1182,16 +1241,18 @@ int Size_Not_Found, i; pParam->BSIM4AechvbEdgeD = pParam->BSIM4Aechvb * pParam->BSIM4weff * model->BSIM4dlcigd * pParam->BSIM4ToxRatioEdge; pParam->BSIM4BechvbEdge = -pParam->BSIM4Bechvb - * model->BSIM4toxe * pParam->BSIM4poxedge; + * toxe * pParam->BSIM4poxedge; pParam->BSIM4Aechvb *= pParam->BSIM4weff * pParam->BSIM4leff * pParam->BSIM4ToxRatio; - pParam->BSIM4Bechvb *= -model->BSIM4toxe; + pParam->BSIM4Bechvb *= -toxe; pParam->BSIM4mstar = 0.5 + atan(pParam->BSIM4minv) / PI; + pParam->BSIM4mstarcv = 0.5 + atan(pParam->BSIM4minvcv) / PI; pParam->BSIM4voffcbn = pParam->BSIM4voff + model->BSIM4voffl / pParam->BSIM4leff; + pParam->BSIM4voffcbncv = pParam->BSIM4voffcv + model->BSIM4voffcvl / pParam->BSIM4leff; - pParam->BSIM4ldeb = sqrt(EPSSI * Vtm0 / (Charge_q + pParam->BSIM4ldeb = sqrt(epssub * Vtm0 / (Charge_q * pParam->BSIM4ndep * 1.0e6)) / 3.0; pParam->BSIM4acde *= pow((pParam->BSIM4ndep / 2.0e16), -0.25); @@ -1247,14 +1308,29 @@ int Size_Not_Found, i; } if (!model->BSIM4vfbGiven) - { if (model->BSIM4vth0Given) + { + if (model->BSIM4vth0Given) { pParam->BSIM4vfb = model->BSIM4type * pParam->BSIM4vth0 - pParam->BSIM4phi - pParam->BSIM4k1 * pParam->BSIM4sqrtPhi; } else - { pParam->BSIM4vfb = -1.0; - } + { + if ((model->BSIM4mtrlMod) && (model->BSIM4phigGiven) && + (model->BSIM4nsubGiven)) + { + T0 = Vtm0 * log(pParam->BSIM4nsub/ni); + T1 = 0.5 * Eg0; + if(T0 > T1) + T0 = T1; + T2 = model->BSIM4easub + T1 + model->BSIM4type * T0; + pParam->BSIM4vfb = model->BSIM4phig - T2; + } + else + { + pParam->BSIM4vfb = -1.0; + } + } } if (!model->BSIM4vth0Given) { pParam->BSIM4vth0 = model->BSIM4type * (pParam->BSIM4vfb @@ -1262,11 +1338,10 @@ int Size_Not_Found, i; * pParam->BSIM4sqrtPhi); } - pParam->BSIM4k1ox = pParam->BSIM4k1 * model->BSIM4toxe + pParam->BSIM4k1ox = pParam->BSIM4k1 * toxe / model->BSIM4toxm; - tmp = sqrt(EPSSI / (model->BSIM4epsrox * EPS0) - * model->BSIM4toxe * pParam->BSIM4Xdep0); + tmp = sqrt(epssub / (epsrox * EPS0) * toxe * pParam->BSIM4Xdep0); T0 = pParam->BSIM4dsub * pParam->BSIM4leff / tmp; if (T0 < EXP_THRESHOLD) { T1 = exp(T0); @@ -1321,7 +1396,7 @@ int Size_Not_Found, i; T9 = 1.0 / (MAX_EXP - 2.0); T9 = pParam->BSIM4dvt0 * T9 * tmp1; - T4 = model->BSIM4toxe * pParam->BSIM4phi + T4 = toxe * pParam->BSIM4phi / (pParam->BSIM4weff + pParam->BSIM4w0); T0 = sqrt(1.0 + pParam->BSIM4lpe0 / pParam->BSIM4leff); @@ -1476,7 +1551,7 @@ int Size_Not_Found, i; here->BSIM4vbsc = -30.0; if (here->BSIM4vbsc > pParam->BSIM4vbm) here->BSIM4vbsc = pParam->BSIM4vbm; - here->BSIM4k2ox = here->BSIM4k2 * model->BSIM4toxe + here->BSIM4k2ox = here->BSIM4k2 * toxe / model->BSIM4toxm; here->BSIM4vfbzb = pParam->BSIM4vfbzbfactor @@ -1856,12 +1931,116 @@ int Size_Not_Found, i; here->BSIM4SswgTempRevSatCur = T5 * T10 * model->BSIM4jtsswgs; here->BSIM4DswgTempRevSatCur = T6 * T10 * model->BSIM4jtsswgd; + if(model->BSIM4mtrlMod) + { + /* Calculate TOXP from EOT */ + + /* Calculate Vgs_eff @ Vgs = VDD with Poly Depletion Effect */ + tmp2 = here->BSIM4vfb + pParam->BSIM4phi; + vddeot = model->BSIM4type * model->BSIM4vddeot; + T0 = model->BSIM4epsrgate * EPS0; + if ((pParam->BSIM4ngate > 1.0e18) && (pParam->BSIM4ngate < 1.0e25) + && (vddeot > tmp2) && (T0!=0)) + { + T1 = 1.0e6 * CHARGE * T0 * pParam->BSIM4ngate / + (model->BSIM4coxe * model->BSIM4coxe); + T8 = vddeot - tmp2; + T4 = sqrt(1.0 + 2.0 * T8 / T1); + T2 = 2.0 * T8 / (T4 + 1.0); + T3 = 0.5 * T2 * T2 / T1; + T7 = 1.12 - T3 - 0.05; + T6 = sqrt(T7 * T7 + 0.224); + T5 = 1.12 - 0.5 * (T7 + T6); + Vgs_eff = vddeot - T5; + } + else + Vgs_eff = vddeot; + + /* Calculate Vth @ Vds=Vbs=0 */ + V0 = pParam->BSIM4vbi - pParam->BSIM4phi; + lt1 = model->BSIM4factor1* pParam->BSIM4sqrtXdep0; + ltw = lt1; + T0 = pParam->BSIM4dvt1 * pParam->BSIM4leff / lt1; + if (T0 < EXP_THRESHOLD) + { + T1 = exp(T0); + T2 = T1 - 1.0; + T3 = T2 * T2; + T4 = T3 + 2.0 * T1 * MIN_EXP; + Theta0 = T1 / T4; + } + else + Theta0 = 1.0 / (MAX_EXP - 2.0); + Delt_vth = pParam->BSIM4dvt0 * Theta0 * V0; + T0 = pParam->BSIM4dvt1w * pParam->BSIM4weff * pParam->BSIM4leff / ltw; + if (T0 < EXP_THRESHOLD) + { T1 = exp(T0); + T2 = T1 - 1.0; + T3 = T2 * T2; + T4 = T3 + 2.0 * T1 * MIN_EXP; + T5 = T1 / T4; + } + else + T5 = 1.0 / (MAX_EXP - 2.0); /* 3.0 * MIN_EXP omitted */ + T2 = pParam->BSIM4dvt0w * T5 * V0; + TempRatio = ckt->CKTtemp / model->BSIM4tnom - 1.0; + T0 = sqrt(1.0 + pParam->BSIM4lpe0 / pParam->BSIM4leff); + T1 = pParam->BSIM4k1ox * (T0 - 1.0) * pParam->BSIM4sqrtPhi + + (pParam->BSIM4kt1 + pParam->BSIM4kt1l / pParam->BSIM4leff) * TempRatio; + Vth_NarrowW = toxe * pParam->BSIM4phi + / (pParam->BSIM4weff + pParam->BSIM4w0); + Lpe_Vb = sqrt(1.0 + pParam->BSIM4lpeb / pParam->BSIM4leff); + Vth = model->BSIM4type * here->BSIM4vth0 + + (pParam->BSIM4k1ox - pParam->BSIM4k1)*pParam->BSIM4sqrtPhi*Lpe_Vb + - Delt_vth - T2 + pParam->BSIM4k3 * Vth_NarrowW + T1; + + /* Calculate n */ + tmp1 = epssub / pParam->BSIM4Xdep0; + here->BSIM4nstar = model->BSIM4vtm / Charge_q * + (model->BSIM4coxe + tmp1 + pParam->BSIM4cit); + tmp2 = pParam->BSIM4nfactor * tmp1; + tmp3 = (tmp2 + pParam->BSIM4cdsc * Theta0 + pParam->BSIM4cit) / model->BSIM4coxe; + if (tmp3 >= -0.5) + n = 1.0 + tmp3; + else + { + T0 = 1.0 / (3.0 + 8.0 * tmp3); + n = (1.0 + 3.0 * tmp3) * T0; + } + + /* Vth correction for Pocket implant */ + if (pParam->BSIM4dvtp0 > 0.0) + { + T3 = pParam->BSIM4leff + pParam->BSIM4dvtp0 * 2.0; + if (model->BSIM4tempMod < 2) + T4 = model->BSIM4vtm * log(pParam->BSIM4leff / T3); + else + T4 = model->BSIM4vtm0 * log(pParam->BSIM4leff / T3); + Vth -= n * T4; + } + Vgsteff = Vgs_eff-Vth; + /* calculating Toxp */ + niter = 0; + toxpf = toxe; + do + { + toxpi = toxpf; + tmp2 = 2.0e8 * toxpf; + T0 = (Vgsteff + here->BSIM4vtfbphi2) / tmp2; + T1 = 1.0 + exp(model->BSIM4bdos * 0.7 * log(T0)); + Tcen = model->BSIM4ados * 1.9e-9 / T1; + toxpf = toxe - epsrox/model->BSIM4epsrsub * Tcen; + niter++; + } while ((niter<=4)&&(ABS(toxpf-toxpi)>1e-12)); + model->BSIM4toxp = toxpf; + model->BSIM4coxp = epsrox * EPS0 / model->BSIM4toxp; + } if (BSIM4checkModel(model, here, ckt)) { IFuid namarray[2]; namarray[0] = model->BSIM4modName; namarray[1] = here->BSIM4name; - (*(SPfrontEnd->IFerror)) (ERR_FATAL, "Fatal error(s) detected during BSIM4.6.0 parameter checking for %s in model %s", namarray); + (*(SPfrontEnd->IFerror)) (ERR_FATAL, "Fatal error(s) detected during BSIM4.6.1 parameter checking for %s in model %s", namarray); return(E_BADPARM); } } /* End instance */ diff --git a/src/spicelib/devices/bsim4/b4trunc.c b/src/spicelib/devices/bsim4/b4trunc.c index 7c84a2398..9697fb0c3 100644 --- a/src/spicelib/devices/bsim4/b4trunc.c +++ b/src/spicelib/devices/bsim4/b4trunc.c @@ -1,11 +1,12 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4trunc.c of BSIM4.6.0. + * File: b4trunc.c of BSIM4.6.1. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu + * Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu * Project Director: Prof. Chenming Hu. **********/ diff --git a/src/spicelib/devices/bsim4/bsim4def.h b/src/spicelib/devices/bsim4/bsim4def.h index 64a79696a..4927550b7 100644 --- a/src/spicelib/devices/bsim4/bsim4def.h +++ b/src/spicelib/devices/bsim4/bsim4def.h @@ -1,16 +1,18 @@ -/**** BSIM4.6.0 Released by Mohan Dunga 12/13/2006 ****/ +/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/ /********** Copyright 2006 Regents of the University of California. All rights reserved. Author: 2000 Weidong Liu. Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu +Authors: 2007- Mohan Dunga, Wenwei Yang, Ali Niknejad, Chenming Hu Modified by Xuemei Xi, 11/15/2002. Modified by Xuemei Xi, 05/09/2003. Modified by Xuemei Xi, 03/04/2004. Modified by Xuemei Xi, Mohan Dunga, 09/24/2004. Modified by Xuemei Xi, 07/29/2005. Modified by Mohan Dunga, 12/13/2006 +Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. File: bsim4def.h **********/ @@ -21,7 +23,7 @@ File: bsim4def.h #include "gendefs.h" #include "cktdefs.h" #include "complex.h" -#include "noisedef.h" +#include "noisedef.h" typedef struct sBSIM4instance { @@ -515,6 +517,7 @@ struct bsim4SizeDependParam double BSIM4voff; double BSIM4tvoff; double BSIM4minv; + double BSIM4minvcv; double BSIM4vfb; double BSIM4delta; double BSIM4rdsw; @@ -638,7 +641,9 @@ struct bsim4SizeDependParam double BSIM4theta0vb0; double BSIM4thetaRout; double BSIM4mstar; + double BSIM4mstarcv; double BSIM4voffcbn; + double BSIM4voffcbncv; double BSIM4rdswmin; double BSIM4rdwmin; double BSIM4rswmin; @@ -674,6 +679,7 @@ typedef struct sBSIM4model int BSIM4type; int BSIM4mobMod; + int BSIM4cvchargeMod; int BSIM4capMod; int BSIM4dioMod; int BSIM4trnqsMod; @@ -685,12 +691,17 @@ typedef struct sBSIM4model int BSIM4rgateMod; int BSIM4perMod; int BSIM4geoMod; + int BSIM4mtrlMod; int BSIM4igcMod; int BSIM4igbMod; int BSIM4tempMod; int BSIM4binUnit; int BSIM4paramChk; - char *BSIM4version; + char *BSIM4version; + double BSIM4eot; + double BSIM4vddeot; + double BSIM4ados; + double BSIM4bdos; double BSIM4toxe; double BSIM4toxp; double BSIM4toxm; @@ -710,6 +721,14 @@ typedef struct sBSIM4model double BSIM4a2; double BSIM4keta; double BSIM4nsub; + double BSIM4phig; + double BSIM4epsrgate; + double BSIM4easub; + double BSIM4epsrsub; + double BSIM4ni0sub; + double BSIM4bg0sub; + double BSIM4tbgasub; + double BSIM4tbgbsub; double BSIM4ndep; double BSIM4nsd; double BSIM4phin; @@ -756,7 +775,9 @@ typedef struct sBSIM4model double BSIM4voff; double BSIM4tvoff; double BSIM4minv; + double BSIM4minvcv; double BSIM4voffl; + double BSIM4voffcvl; double BSIM4delta; double BSIM4rdsw; double BSIM4rdswmin; @@ -1013,6 +1034,7 @@ typedef struct sBSIM4model double BSIM4lvoff; double BSIM4ltvoff; double BSIM4lminv; + double BSIM4lminvcv; double BSIM4ldelta; double BSIM4lrdsw; double BSIM4lrsw; @@ -1157,6 +1179,7 @@ typedef struct sBSIM4model double BSIM4wvoff; double BSIM4wtvoff; double BSIM4wminv; + double BSIM4wminvcv; double BSIM4wdelta; double BSIM4wrdsw; double BSIM4wrsw; @@ -1301,6 +1324,7 @@ typedef struct sBSIM4model double BSIM4pvoff; double BSIM4ptvoff; double BSIM4pminv; + double BSIM4pminvcv; double BSIM4pdelta; double BSIM4prdsw; double BSIM4prsw; @@ -1494,6 +1518,7 @@ typedef struct sBSIM4model /* Pre-calculated constants * move to size-dependent param */ + double BSIM4Eg0; double BSIM4vtm; double BSIM4vtm0; double BSIM4coxe; @@ -1536,6 +1561,7 @@ typedef struct sBSIM4model /* Flags */ unsigned BSIM4mobModGiven :1; unsigned BSIM4binUnitGiven :1; + unsigned BSIM4cvchargeModGiven :1; unsigned BSIM4capModGiven :1; unsigned BSIM4dioModGiven :1; unsigned BSIM4rdsModGiven :1; @@ -1548,11 +1574,16 @@ typedef struct sBSIM4model unsigned BSIM4acnqsModGiven :1; unsigned BSIM4fnoiModGiven :1; unsigned BSIM4tnoiModGiven :1; + unsigned BSIM4mtrlModGiven :1; unsigned BSIM4igcModGiven :1; unsigned BSIM4igbModGiven :1; unsigned BSIM4tempModGiven :1; unsigned BSIM4typeGiven :1; unsigned BSIM4toxrefGiven :1; + unsigned BSIM4eotGiven :1; + unsigned BSIM4vddeotGiven :1; + unsigned BSIM4adosGiven :1; + unsigned BSIM4bdosGiven :1; unsigned BSIM4toxeGiven :1; unsigned BSIM4toxpGiven :1; unsigned BSIM4toxmGiven :1; @@ -1573,6 +1604,14 @@ typedef struct sBSIM4model unsigned BSIM4a2Given :1; unsigned BSIM4ketaGiven :1; unsigned BSIM4nsubGiven :1; + unsigned BSIM4phigGiven :1; + unsigned BSIM4epsrgateGiven :1; + unsigned BSIM4easubGiven :1; + unsigned BSIM4epsrsubGiven :1; + unsigned BSIM4ni0subGiven :1; + unsigned BSIM4bg0subGiven :1; + unsigned BSIM4tbgasubGiven :1; + unsigned BSIM4tbgbsubGiven :1; unsigned BSIM4ndepGiven :1; unsigned BSIM4nsdGiven :1; unsigned BSIM4phinGiven :1; @@ -1619,7 +1658,9 @@ typedef struct sBSIM4model unsigned BSIM4voffGiven :1; unsigned BSIM4tvoffGiven :1; unsigned BSIM4vofflGiven :1; + unsigned BSIM4voffcvlGiven :1; unsigned BSIM4minvGiven :1; + unsigned BSIM4minvcvGiven :1; unsigned BSIM4rdswGiven :1; unsigned BSIM4rdswminGiven :1; unsigned BSIM4rdwminGiven :1; @@ -1876,6 +1917,7 @@ typedef struct sBSIM4model unsigned BSIM4lvoffGiven :1; unsigned BSIM4ltvoffGiven :1; unsigned BSIM4lminvGiven :1; + unsigned BSIM4lminvcvGiven :1; unsigned BSIM4lrdswGiven :1; unsigned BSIM4lrswGiven :1; unsigned BSIM4lrdwGiven :1; @@ -2020,6 +2062,7 @@ typedef struct sBSIM4model unsigned BSIM4wvoffGiven :1; unsigned BSIM4wtvoffGiven :1; unsigned BSIM4wminvGiven :1; + unsigned BSIM4wminvcvGiven :1; unsigned BSIM4wrdswGiven :1; unsigned BSIM4wrswGiven :1; unsigned BSIM4wrdwGiven :1; @@ -2164,6 +2207,7 @@ typedef struct sBSIM4model unsigned BSIM4pvoffGiven :1; unsigned BSIM4ptvoffGiven :1; unsigned BSIM4pminvGiven :1; + unsigned BSIM4pminvcvGiven :1; unsigned BSIM4prdswGiven :1; unsigned BSIM4prswGiven :1; unsigned BSIM4prdwGiven :1; @@ -2408,35 +2452,49 @@ typedef struct sBSIM4model #define BSIM4_M 38 /* Global parameters */ -#define BSIM4_MOD_TEMPMOD 89 -#define BSIM4_MOD_IGCMOD 90 -#define BSIM4_MOD_IGBMOD 91 -#define BSIM4_MOD_ACNQSMOD 92 -#define BSIM4_MOD_FNOIMOD 93 -#define BSIM4_MOD_RDSMOD 94 -#define BSIM4_MOD_DIOMOD 96 -#define BSIM4_MOD_PERMOD 97 -#define BSIM4_MOD_GEOMOD 98 -#define BSIM4_MOD_RGATEMOD 99 -#define BSIM4_MOD_RBODYMOD 100 -#define BSIM4_MOD_CAPMOD 101 -#define BSIM4_MOD_TRNQSMOD 102 -#define BSIM4_MOD_MOBMOD 103 -#define BSIM4_MOD_TNOIMOD 104 -#define BSIM4_MOD_TOXE 105 -#define BSIM4_MOD_CDSC 106 -#define BSIM4_MOD_CDSCB 107 -#define BSIM4_MOD_CIT 108 -#define BSIM4_MOD_NFACTOR 109 -#define BSIM4_MOD_XJ 110 -#define BSIM4_MOD_VSAT 111 -#define BSIM4_MOD_AT 112 -#define BSIM4_MOD_A0 113 -#define BSIM4_MOD_A1 114 -#define BSIM4_MOD_A2 115 -#define BSIM4_MOD_KETA 116 -#define BSIM4_MOD_NSUB 117 -#define BSIM4_MOD_NDEP 118 +#define BSIM4_MOD_CVCHARGEMOD 77 +#define BSIM4_MOD_ADOS 78 +#define BSIM4_MOD_BDOS 79 +#define BSIM4_MOD_TEMPMOD 80 +#define BSIM4_MOD_MTRLMOD 81 +#define BSIM4_MOD_IGCMOD 82 +#define BSIM4_MOD_IGBMOD 83 +#define BSIM4_MOD_ACNQSMOD 84 +#define BSIM4_MOD_FNOIMOD 85 +#define BSIM4_MOD_RDSMOD 86 +#define BSIM4_MOD_DIOMOD 87 +#define BSIM4_MOD_PERMOD 88 +#define BSIM4_MOD_GEOMOD 89 +#define BSIM4_MOD_RGATEMOD 90 +#define BSIM4_MOD_RBODYMOD 91 +#define BSIM4_MOD_CAPMOD 92 +#define BSIM4_MOD_TRNQSMOD 93 +#define BSIM4_MOD_MOBMOD 94 +#define BSIM4_MOD_TNOIMOD 95 +#define BSIM4_MOD_EOT 96 +#define BSIM4_MOD_VDDEOT 97 +#define BSIM4_MOD_TOXE 98 +#define BSIM4_MOD_CDSC 99 +#define BSIM4_MOD_CDSCB 100 +#define BSIM4_MOD_CIT 101 +#define BSIM4_MOD_NFACTOR 102 +#define BSIM4_MOD_XJ 103 +#define BSIM4_MOD_VSAT 104 +#define BSIM4_MOD_AT 105 +#define BSIM4_MOD_A0 106 +#define BSIM4_MOD_A1 107 +#define BSIM4_MOD_A2 108 +#define BSIM4_MOD_KETA 109 +#define BSIM4_MOD_NSUB 110 +#define BSIM4_MOD_PHIG 111 +#define BSIM4_MOD_EPSRGATE 112 +#define BSIM4_MOD_EASUB 113 +#define BSIM4_MOD_EPSRSUB 114 +#define BSIM4_MOD_NI0SUB 115 +#define BSIM4_MOD_BG0SUB 116 +#define BSIM4_MOD_TBGASUB 117 +#define BSIM4_MOD_TBGBSUB 118 +#define BSIM4_MOD_NDEP 119 #define BSIM4_MOD_NGATE 120 #define BSIM4_MOD_GAMMA1 121 #define BSIM4_MOD_GAMMA2 122 @@ -2607,6 +2665,8 @@ typedef struct sBSIM4model #define BSIM4_MOD_LP 293 #define BSIM4_MOD_TVOFF 294 #define BSIM4_MOD_TVFBSDOFF 295 +#define BSIM4_MOD_MINVCV 296 +#define BSIM4_MOD_VOFFCVL 297 /* Length dependence */ #define BSIM4_MOD_LCDSC 301 @@ -2742,6 +2802,7 @@ typedef struct sBSIM4model #define BSIM4_MOD_LUD1 440 #define BSIM4_MOD_LUP 441 #define BSIM4_MOD_LLP 442 +#define BSIM4_MOD_LMINVCV 443 /* Width dependence */ #define BSIM4_MOD_WCDSC 481 @@ -2876,6 +2937,7 @@ typedef struct sBSIM4model #define BSIM4_MOD_WUD1 620 #define BSIM4_MOD_WUP 621 #define BSIM4_MOD_WLP 622 +#define BSIM4_MOD_WMINVCV 623 /* Cross-term dependence */ #define BSIM4_MOD_PCDSC 661 @@ -3032,13 +3094,14 @@ typedef struct sBSIM4model #define BSIM4_MOD_STETA0 814 #define BSIM4_MOD_LODETA0 815 -#define BSIM4_MOD_WEB 816 -#define BSIM4_MOD_WEC 817 +#define BSIM4_MOD_WEB 816 +#define BSIM4_MOD_WEC 817 #define BSIM4_MOD_KVTH0WE 818 -#define BSIM4_MOD_K2WE 819 -#define BSIM4_MOD_KU0WE 820 -#define BSIM4_MOD_SCREF 821 -#define BSIM4_MOD_WPEMOD 822 +#define BSIM4_MOD_K2WE 819 +#define BSIM4_MOD_KU0WE 820 +#define BSIM4_MOD_SCREF 821 +#define BSIM4_MOD_WPEMOD 822 +#define BSIM4_MOD_PMINVCV 823 #define BSIM4_MOD_PLAMBDA 825 #define BSIM4_MOD_PVTL 826 @@ -3317,11 +3380,17 @@ typedef struct sBSIM4model #include "bsim4ext.h" +#ifdef __STDC__ extern void BSIM4evaluate(double,double,double,BSIM4instance*,BSIM4model*, double*,double*,double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, double*, CKTcircuit*); extern int BSIM4debug(BSIM4model*, BSIM4instance*, CKTcircuit*, int); extern int BSIM4checkModel(BSIM4model*, BSIM4instance*, CKTcircuit*); +#else /* stdc */ +extern void BSIM4evaluate(); +extern int BSIM4debug(); +extern int BSIM4checkModel(); +#endif /* stdc */ #endif /*BSIM4*/