Browse Source

BSIM4.6.3 update

pre-master-46
dwarning 18 years ago
parent
commit
0d00387575
  1. 6
      ChangeLog
  2. 20
      src/spicelib/devices/bsim4/b4.c
  3. 6
      src/spicelib/devices/bsim4/b4acld.c
  4. 6
      src/spicelib/devices/bsim4/b4ask.c
  5. 26
      src/spicelib/devices/bsim4/b4check.c
  6. 4
      src/spicelib/devices/bsim4/b4cvtest.c
  7. 4
      src/spicelib/devices/bsim4/b4del.c
  8. 4
      src/spicelib/devices/bsim4/b4dest.c
  9. 10
      src/spicelib/devices/bsim4/b4geo.c
  10. 8
      src/spicelib/devices/bsim4/b4getic.c
  11. 241
      src/spicelib/devices/bsim4/b4ld.c
  12. 42
      src/spicelib/devices/bsim4/b4mask.c
  13. 4
      src/spicelib/devices/bsim4/b4mdel.c
  14. 53
      src/spicelib/devices/bsim4/b4mpar.c
  15. 13
      src/spicelib/devices/bsim4/b4noi.c
  16. 6
      src/spicelib/devices/bsim4/b4par.c
  17. 6
      src/spicelib/devices/bsim4/b4pzld.c
  18. 67
      src/spicelib/devices/bsim4/b4set.c
  19. 248
      src/spicelib/devices/bsim4/b4temp.c
  20. 4
      src/spicelib/devices/bsim4/b4trunc.c
  21. 47
      src/spicelib/devices/bsim4/bsim4def.h
  22. 24
      src/spicelib/devices/bsim4/bsim4ext.h
  23. 78
      src/spicelib/devices/bsim4/bsim4itf.h
  24. 4
      src/spicelib/parser/inpdomod.c

6
ChangeLog

@ -1,3 +1,9 @@
2008-11-09 Dietmar Warning
* src/spicelib/devices/bsim4/*.c,*.h src/spicelib/parser/inpdomod.c:
This is the new and actual BSIM4 version 4.6.3 from UCB. All files are 4.6.2 except
b4temp.c which is the only bugfix for 4.6.3 (see bsim website). Tested so far with simple
testcases - but should be proved further with more practical examples.
2008-11-09 Holger Vogt
* visualc/:
Directory with project files to compile ngspice with MS Visual

20
src/spicelib/devices/bsim4/b4.c

@ -1,12 +1,13 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4.c of BSIM4.6.1.
* File: b4.c of BSIM4.6.2.
* 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
* Authors: 2008- 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.
@ -16,6 +17,7 @@
* 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.
* Modified by Wenwei Yang, 07/31/2008.
**********/
#include "ngspice.h"
@ -34,7 +36,7 @@ IOP( "sd", BSIM4_SD, IF_REAL , "distance between neighbour fingers"),
IOP( "sca", BSIM4_SCA, IF_REAL , "Integral of the first distribution function for scattered well dopant"),
IOP( "scb", BSIM4_SCB, IF_REAL , "Integral of the second distribution function for scattered well dopant"),
IOP( "scc", BSIM4_SCC, IF_REAL , "Integral of the third distribution function for scattered well dopant"),
IOP( "sc", BSIM4_SCA, IF_REAL , "Distance to a single well edge "),
IOP( "sc", BSIM4_SC, IF_REAL , "Distance to a single well edge "),
IOP( "min", BSIM4_MIN, IF_INTEGER , "Minimize either D or S"),
IOP( "ad", BSIM4_AD, IF_REAL , "Drain area"),
IOP( "as", BSIM4_AS, IF_REAL , "Source area"),
@ -132,6 +134,9 @@ 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( "tempeot", BSIM4_MOD_TEMPEOT, IF_REAL, " Temperature for extraction of EOT"),
IOP( "leffeot", BSIM4_MOD_LEFFEOT, IF_REAL, " Effective length for extraction of EOT"),
IOP( "weffeot", BSIM4_MOD_WEFFEOT, IF_REAL, "Effective width for extraction of EOT"),
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"),
@ -206,7 +211,9 @@ IOP( "up", BSIM4_MOD_UP, IF_REAL, "Channel length linear factor of mobility"),
IOP( "lp", BSIM4_MOD_LP, IF_REAL, "Channel length exponential factor of mobility"),
IOP( "u0", BSIM4_MOD_U0, IF_REAL, "Low-field mobility at Tnom"),
IOP( "eu", BSIM4_MOD_EU, IF_REAL, "Mobility exponent"),
IOP( "ucs", BSIM4_MOD_UCS, IF_REAL, "Colombic scattering exponent"),
IOP( "ute", BSIM4_MOD_UTE, IF_REAL, "Temperature coefficient of mobility"),
IOP( "ucste", BSIM4_MOD_UCSTE, IF_REAL,"Temperature coefficient of colombic mobility"),
IOP( "voff", BSIM4_MOD_VOFF, IF_REAL, "Threshold voltage offset"),
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"),
@ -404,6 +411,7 @@ IOP( "jtssws", BSIM4_MOD_JTSSWS, IF_REAL, "Source STI sidewall trap-assisted sat
IOP( "jtsswd", BSIM4_MOD_JTSSWD, IF_REAL, "Drain STI sidewall trap-assisted saturation current density"),
IOP( "jtsswgs", BSIM4_MOD_JTSSWGS, IF_REAL, "Source gate-edge sidewall trap-assisted saturation current density"),
IOP( "jtsswgd", BSIM4_MOD_JTSSWGD, IF_REAL, "Drain gate-edge sidewall trap-assisted saturation current density"),
IOP( "jtweff", BSIM4_MOD_JTWEFF, IF_REAL, "TAT current width dependance"),
IOP( "njts", BSIM4_MOD_NJTS, IF_REAL, "Non-ideality factor for bottom junction"),
IOP( "njtssw", BSIM4_MOD_NJTSSW, IF_REAL, "Non-ideality factor for STI sidewall junction"),
IOP( "njtsswg", BSIM4_MOD_NJTSSWG, IF_REAL, "Non-ideality factor for gate-edge sidewall junction"),
@ -524,6 +532,7 @@ IOP( "lup", BSIM4_MOD_LUP, IF_REAL, "Length dependence of up"),
IOP( "llp", BSIM4_MOD_LLP, IF_REAL, "Length dependence of lp"),
IOP( "lu0", BSIM4_MOD_LU0, IF_REAL, "Length dependence of u0"),
IOP( "lute", BSIM4_MOD_LUTE, IF_REAL, "Length dependence of ute"),
IOP( "lucste", BSIM4_MOD_LUCSTE, IF_REAL, "Length dependence of ucste"),
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"),
@ -610,6 +619,7 @@ IOP( "llambda", BSIM4_MOD_LLAMBDA, IF_REAL, "Length dependence of lambda"),
IOP( "lvtl", BSIM4_MOD_LVTL, IF_REAL, " Length dependence of vtl"),
IOP( "lxn", BSIM4_MOD_LXN, IF_REAL, " Length dependence of xn"),
IOP( "leu", BSIM4_MOD_LEU, IF_REAL, " Length dependence of eu"),
IOP( "lucs", BSIM4_MOD_LUCS, IF_REAL, "Length dependence of lucs"),
IOP( "lvfbsdoff", BSIM4_MOD_LVFBSDOFF, IF_REAL, "Length dependence of vfbsdoff"),
IOP( "ltvfbsdoff", BSIM4_MOD_LTVFBSDOFF, IF_REAL, "Length dependence of tvfbsdoff"),
IOP( "ltvoff", BSIM4_MOD_LTVOFF, IF_REAL, "Length dependence of tvoff"),
@ -671,6 +681,7 @@ IOP( "wup", BSIM4_MOD_WUP, IF_REAL, "Width dependence of up"),
IOP( "wlp", BSIM4_MOD_WLP, IF_REAL, "Width dependence of lp"),
IOP( "wu0", BSIM4_MOD_WU0, IF_REAL, "Width dependence of u0"),
IOP( "wute", BSIM4_MOD_WUTE, IF_REAL, "Width dependence of ute"),
IOP( "wucste", BSIM4_MOD_WUCSTE, IF_REAL, "Width dependence of ucste"),
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"),
@ -756,6 +767,7 @@ IOP( "wlambda", BSIM4_MOD_WLAMBDA, IF_REAL, "Width dependence of lambda"),
IOP( "wvtl", BSIM4_MOD_WVTL, IF_REAL, "Width dependence of vtl"),
IOP( "wxn", BSIM4_MOD_WXN, IF_REAL, "Width dependence of xn"),
IOP( "weu", BSIM4_MOD_WEU, IF_REAL, "Width dependence of eu"),
IOP( "wucs", BSIM4_MOD_WUCS, IF_REAL, "Width dependence of ucs"),
IOP( "wvfbsdoff", BSIM4_MOD_WVFBSDOFF, IF_REAL, "Width dependence of vfbsdoff"),
IOP( "wtvfbsdoff", BSIM4_MOD_WTVFBSDOFF, IF_REAL, "Width dependence of tvfbsdoff"),
IOP( "wtvoff", BSIM4_MOD_WTVOFF, IF_REAL, "Width dependence of tvoff"),
@ -817,6 +829,7 @@ IOP( "pup", BSIM4_MOD_PUP, IF_REAL, "Cross-term dependence of up"),
IOP( "plp", BSIM4_MOD_PLP, IF_REAL, "Cross-term dependence of lp"),
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( "pucste", BSIM4_MOD_PUCSTE, IF_REAL, "Cross-term dependence of ucste"),
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"),
@ -902,6 +915,7 @@ IOP( "plambda", BSIM4_MOD_PLAMBDA, IF_REAL, "Cross-term dependence of lambda"),
IOP( "pvtl", BSIM4_MOD_PVTL, IF_REAL, "Cross-term dependence of vtl"),
IOP( "pxn", BSIM4_MOD_PXN, IF_REAL, "Cross-term dependence of xn"),
IOP( "peu", BSIM4_MOD_PEU, IF_REAL, "Cross-term dependence of eu"),
IOP( "pucs", BSIM4_MOD_PUCS, IF_REAL, "Cross-term dependence of ucs"),
IOP( "pvfbsdoff", BSIM4_MOD_PVFBSDOFF, IF_REAL, "Cross-term dependence of vfbsdoff"),
IOP( "ptvfbsdoff", BSIM4_MOD_PTVFBSDOFF, IF_REAL, "Cross-term dependence of tvfbsdoff"),
IOP( "ptvoff", BSIM4_MOD_PTVOFF, IF_REAL, "Cross-term dependence of tvoff"),

6
src/spicelib/devices/bsim4/b4acld.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4acld.c of BSIM4.6.1.
* File: b4acld.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
@ -60,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;

6
src/spicelib/devices/bsim4/b4ask.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4ask.c of BSIM4.6.1.
* File: b4ask.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
@ -42,7 +42,7 @@ BSIM4instance *here = (BSIM4instance*)inst;
case BSIM4_M:
value->rValue = here->BSIM4m;
return(OK);
case BSIM4_NF:
case BSIM4_NF:
value->rValue = here->BSIM4nf;
return(OK);
case BSIM4_MIN:

26
src/spicelib/devices/bsim4/b4check.c

@ -1,4 +1,4 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
@ -16,6 +16,7 @@
* Modified by Xuemei Xi, 07/29/2005.
* Modified by Mohan Dunga, 12/13/2006
* Modified by Mohan Dunga, Wenwei Yang, 05/18/2007.
* Modified by Wenwei Yang, 07/31/2008 .
**********/
#include "ngspice.h"
@ -244,12 +245,12 @@ FILE *fplog;
printf("Fatal: Drout = %g is negative.\n", pParam->BSIM4drout);
Fatal_Flag = 1;
}
/*if (here->BSIM4m < 1.0)
if (here->BSIM4m < 1.0)
{ fprintf(fplog, "Fatal: Number of multiplier = %g is smaller than one.\n", here->BSIM4m);
printf("Fatal: Number of multiplier = %g is smaller than one.\n", here->BSIM4m);
Fatal_Flag = 1;
}*/
}
if (here->BSIM4nf < 1.0)
{ fprintf(fplog, "Fatal: Number of finger = %g is smaller than one.\n", here->BSIM4nf);
@ -668,6 +669,17 @@ 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);
@ -827,7 +839,9 @@ FILE *fplog;
printf("Warning: SCREF = %g is not positive. Set to 1e-6.\n", model->BSIM4scref);
model->BSIM4scref = 1e-6;
}
if (here->BSIM4sca < 0.0)
/*Move these checks to temp.c for sceff calculation*/
/*
if (here->BSIM4sca < 0.0)
{ fprintf(fplog, "Warning: SCA = %g is negative. Set to 0.0.\n", here->BSIM4sca);
printf("Warning: SCA = %g is negative. Set to 0.0.\n", here->BSIM4sca);
here->BSIM4sca = 0.0;
@ -847,6 +861,8 @@ FILE *fplog;
printf("Warning: SC = %g is negative. Set to 0.0.\n", here->BSIM4sc);
here->BSIM4sc = 0.0;
}
*/
}
}/* loop for the parameter check for warning messages */
fclose(fplog);

4
src/spicelib/devices/bsim4/b4cvtest.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 04/05/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4cvtest.c of BSIM4.6.0.
* File: b4cvtest.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu

4
src/spicelib/devices/bsim4/b4del.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4del.c of BSIM4.6.1.
* File: b4del.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu

4
src/spicelib/devices/bsim4/b4dest.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4dest.c of BSIM4.6.1.
* File: b4dest.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu

10
src/spicelib/devices/bsim4/b4geo.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4geo.c of BSIM4.6.1.
* File: b4geo.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
@ -159,7 +159,7 @@ int geo, rgeo, minSD, Type;
double nf, Weffcj, Rsh, DMCG, DMCI, DMDG;
double *Rtot;
{
double Rint=0.0, Rend = 0.0;
double Rint = 0.0, Rend = 0.0;
double nuIntD = 0.0, nuEndD = 0.0, nuIntS = 0.0, nuEndS = 0.0;
if (geo < 9) /* since geo = 9 and 10 only happen when nf = even */
@ -292,7 +292,7 @@ double nuEnd, *Rend;
case 6:
if ((DMCG + DMCI) == 0.0)
printf("(DMCG + DMCI) can not be equal to zero\n");
if (nuEnd == 0.0)
if ((nuEnd == 0.0)||((DMCG+DMCI)==0.0))
*Rend = 0.0;
else
*Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI));
@ -316,7 +316,7 @@ double nuEnd, *Rend;
case 8:
if ((DMCG + DMCI) == 0.0)
printf("(DMCG + DMCI) can not be equal to zero\n");
if (nuEnd == 0.0)
if ((nuEnd == 0.0)||((DMCG + DMCI)==0.0))
*Rend = 0.0;
else
*Rend = Rsh * Weffcj / (3.0 * nuEnd * (DMCG + DMCI));

8
src/spicelib/devices/bsim4/b4getic.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4getic.c of BSIM4.6.1.
* File: b4getic.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
@ -27,8 +27,8 @@ BSIM4instance *here;
for (; model ; model = model->BSIM4nextModel)
{ for (here = model->BSIM4instances; here; here = here->BSIM4nextInstance)
{ if (here->BSIM4owner != ARCHme) continue;
if (!here->BSIM4icVDSGiven)
{ if (here->BSIM4owner != ARCHme) continue;
if (!here->BSIM4icVDSGiven)
{ here->BSIM4icVDS = *(ckt->CKTrhs + here->BSIM4dNode)
- *(ckt->CKTrhs + here->BSIM4sNode);
}

241
src/spicelib/devices/bsim4/b4ld.c

@ -1,12 +1,13 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4ld.c of BSIM4.6.1.
* File: b4ld.c of BSIM4.6.2.
* 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
* Authors: 2008- 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.
@ -16,8 +17,10 @@
* 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.
* Modified by Wenwei Yang, 07/31/2008.
**********/
#include "ngspice.h"
#include "cktdefs.h"
#include "bsim4def.h"
@ -134,6 +137,7 @@ double EsatL, dEsatL_dVg, dEsatL_dVd, dEsatL_dVb;
double dVdsat_dVg, dVdsat_dVb, dVdsat_dVd, Vasat, dAlphaz_dVg, dAlphaz_dVb;
double dVasat_dVg, dVasat_dVb, dVasat_dVd, Va, dVa_dVd, dVa_dVg, dVa_dVb;
double Vbseff, dVbseff_dVb, VbseffCV, dVbseffCV_dVb;
double VgsteffVth, dT11_dVg;
double Arg1, One_Third_CoxWL, Two_Third_CoxWL, Alphaz, CoxWL;
double T0=0.0, dT0_dVg, dT0_dVd, dT0_dVb;
double T1, dT1_dVg, dT1_dVd, dT1_dVb;
@ -207,7 +211,6 @@ ChargeComputationNeeded =
((ckt->CKTmode & (MODEAC | MODETRAN | MODEINITSMSIG)) ||
((ckt->CKTmode & MODETRANOP) && (ckt->CKTmode & MODEUIC)))
? 1 : 0;
/* ChargeComputationNeeded = 1; Wrong ??PN */
for (; model != NULL; model = model->BSIM4nextModel)
{ for (here = model->BSIM4instances; here != NULL;
@ -970,19 +973,19 @@ for (; model != NULL; model = model->BSIM4nextModel)
}
/* dunga */
if(model->BSIM4mtrlMod)
{
epsrox = 3.9;
toxe = model->BSIM4eot;
epssub = EPS0 * model->BSIM4epsrsub;
}
else
{
epsrox = model->BSIM4epsrox;
toxe = model->BSIM4toxe;
epssub = EPSSI;
}
/* 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;
@ -1173,7 +1176,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
}
here->BSIM4von = Vth;
/* Poly Gate Si Depletion Effect */
T0 = here->BSIM4vfb + pParam->BSIM4phi;
if(model->BSIM4mtrlMod == 0)
@ -1297,7 +1300,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
dRds_dVb = T4 * dT3_dVb;
if (Rds > 0.0)
here->BSIM4grdsw = 1.0 / Rds;
here->BSIM4grdsw = 1.0 / Rds* here->BSIM4nf; /*4.6.2*/
else
here->BSIM4grdsw = 0.0;
}
@ -1401,12 +1404,13 @@ for (; model != NULL; model = model->BSIM4nextModel)
dDenomi_dVb = T13 * dVth_dVb + pParam->BSIM4uc * T4;
dDenomi_dVg+= T7;
}
else
else if (model->BSIM4mobMod == 2)
{ T0 = (Vgsteff + here->BSIM4vtfbphi1) / toxe;
T1 = exp(pParam->BSIM4eu * log(T0));
dT1_dVg = T1 * pParam->BSIM4eu / T0 / toxe;
T2 = pParam->BSIM4ua + pParam->BSIM4uc * Vbseff;
T3 = T0 / toxe;
T3 = T0 / toxe; /*Do we need it?*/
T12 = sqrt(Vth * Vth + 0.0001);
T9 = 1.0/(Vgsteff + 2*T12);
T10 = T9*toxe;
@ -1420,7 +1424,35 @@ for (; model != NULL; model = model->BSIM4nextModel)
dDenomi_dVd = T13 * dVth_dVd;
dDenomi_dVb = T13 * dVth_dVb + T1 * pParam->BSIM4uc;
}
/*high K mobility*/
else
{
/*univsersal mobility*/
T0 = (Vgsteff + here->BSIM4vtfbphi1)* 1.0e-8 / toxe/6.0;
T1 = exp(pParam->BSIM4eu * log(T0));
dT1_dVg = T1 * pParam->BSIM4eu * 1.0e-8/ T0 / toxe/6.0;
T2 = pParam->BSIM4ua + pParam->BSIM4uc * Vbseff;
/*Coulombic*/
VgsteffVth = pParam->BSIM4VgsteffVth;
T10 = exp(pParam->BSIM4ucs * log(0.5 + 0.5 * Vgsteff/VgsteffVth));
T11 = pParam->BSIM4ud/T10;
dT11_dVg = - 0.5 * pParam->BSIM4ucs * T11 /(0.5 + 0.5*Vgsteff/VgsteffVth)/VgsteffVth;
dDenomi_dVg = T2 * dT1_dVg + dT11_dVg;
dDenomi_dVd = 0.0;
dDenomi_dVb = T1 * pParam->BSIM4uc;
T5 = T1 * T2 + T11;
}
if (T5 >= -0.8)
{ Denomi = 1.0 + T5;
}
@ -1432,7 +1464,8 @@ for (; model != NULL; model = model->BSIM4nextModel)
dDenomi_dVd *= T9;
dDenomi_dVb *= T9;
}
here->BSIM4ueff = ueff = here->BSIM4u0temp / Denomi;
T9 = -ueff / Denomi;
dueff_dVg = T9 * dDenomi_dVg;
@ -1649,6 +1682,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
dVasat_dVd = dT0_dVd / T1;
/* Calculate Idl first */
tmp1 = here->BSIM4vtfbphi2;
tmp2 = 2.0e8 * model->BSIM4toxp;
dT0_dVg = 1.0 / tmp2;
@ -1849,7 +1883,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
}
/* Calculate VASCBE */
if (pParam->BSIM4pscbe2 > 0.0)
if ((pParam->BSIM4pscbe2 > 0.0)&&(pParam->BSIM4pscbe1>=0.0)) /*4.6.2*/
{ if (diffVds > pParam->BSIM4pscbe1 * pParam->BSIM4litl
/ EXP_THRESHOLD)
{ T0 = pParam->BSIM4pscbe1 * pParam->BSIM4litl / diffVds;
@ -1968,7 +2002,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
+ Vdseff * tmp2) * dVbseff_dVb;
cdrain = Ids * Vdseff;
/* Source End Velocity Limit */
if((model->BSIM4vtlGiven) && (model->BSIM4vtl > 0.0) ) {
T12 = 1.0 / Leff / CoxeffWovL;
@ -2271,7 +2305,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
if(model->BSIM4tempMod < 2)
tmp = Vtm;
else /* model->BSIM4tempMod = 2 */
else /* model->BSIM4tempMod = 2 , 3*/
tmp = Vtm0;
if (model->BSIM4igcMod)
{ T0 = tmp * pParam->BSIM4nigc;
@ -2717,24 +2751,24 @@ for (; model != NULL; model = model->BSIM4nextModel)
else if (model->BSIM4capMod == 0)
{
if (Vbseff < 0.0)
{ Vbseff = Vbs;
dVbseff_dVb = 1.0;
{ VbseffCV = Vbs; /*4.6.2*/
dVbseffCV_dVb = 1.0;
}
else
{ Vbseff = pParam->BSIM4phi - Phis;
dVbseff_dVb = -dPhis_dVb;
{ VbseffCV = pParam->BSIM4phi - Phis;
dVbseffCV_dVb = -dPhis_dVb * dVbseff_dVb; /*4.6.2*/
}
Vfb = pParam->BSIM4vfbcv;
Vth = Vfb + pParam->BSIM4phi + pParam->BSIM4k1ox * sqrtPhis;
Vgst = Vgs_eff - Vth;
dVth_dVb = pParam->BSIM4k1ox * dsqrtPhis_dVb;
dVth_dVb = pParam->BSIM4k1ox * dsqrtPhis_dVb *dVbseff_dVb; /*4.6.2*/
dVgst_dVb = -dVth_dVb;
dVgst_dVg = dVgs_eff_dVg;
CoxWL = model->BSIM4coxe * pParam->BSIM4weffCV
* pParam->BSIM4leffCV * here->BSIM4nf;
Arg1 = Vgs_eff - Vbseff - Vfb;
Arg1 = Vgs_eff - VbseffCV - Vfb;
if (Arg1 <= 0.0)
{ qgate = CoxWL * Arg1;
@ -2743,7 +2777,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
here->BSIM4cggb = CoxWL * dVgs_eff_dVg;
here->BSIM4cgdb = 0.0;
here->BSIM4cgsb = CoxWL * (dVbseff_dVb - dVgs_eff_dVg);
here->BSIM4cgsb = CoxWL * (dVbseffCV_dVb - dVgs_eff_dVg);
here->BSIM4cdgb = 0.0;
here->BSIM4cddb = 0.0;
@ -2763,7 +2797,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
T0 = CoxWL * T1 / T2;
here->BSIM4cggb = T0 * dVgs_eff_dVg;
here->BSIM4cgdb = 0.0;
here->BSIM4cgsb = T0 * (dVbseff_dVb - dVgs_eff_dVg);
here->BSIM4cgsb = T0 * (dVbseffCV_dVb - dVgs_eff_dVg);
here->BSIM4cdgb = 0.0;
here->BSIM4cddb = 0.0;
@ -2778,10 +2812,11 @@ for (; model != NULL; model = model->BSIM4nextModel)
Two_Third_CoxWL = 2.0 * One_Third_CoxWL;
AbulkCV = Abulk0 * pParam->BSIM4abulkCVfactor;
dAbulkCV_dVb = pParam->BSIM4abulkCVfactor * dAbulk0_dVb;
Vdsat = Vgst / AbulkCV;
dVdsat_dVg = dVgs_eff_dVg / AbulkCV;
dVdsat_dVb = - (Vdsat * dAbulkCV_dVb + dVth_dVb)/ AbulkCV;
dAbulkCV_dVb = pParam->BSIM4abulkCVfactor * dAbulk0_dVb*dVbseff_dVb;
dVdsat_dVg = 1.0 / AbulkCV; /*4.6.2*/
Vdsat = Vgst * dVdsat_dVg;
dVdsat_dVb = - (Vdsat * dAbulkCV_dVb + dVth_dVb)* dVdsat_dVg;
if (model->BSIM4xpart > 0.5)
{ /* 0/100 Charge partition model */
@ -2936,8 +2971,8 @@ for (; model != NULL; model = model->BSIM4nextModel)
qbulk = -(qgate - T4 * T7);
T7 *= T9;
T0 = 4.0 * T4 * (1.0 - T5);
T12 = (-T7 * dAlphaz_dVg - here->BSIM4cdgb
- T0 * dVdsat_dVg) * dVgs_eff_dVg;
T12 = (-T7 * dAlphaz_dVg - T0 * dVdsat_dVg) * dVgs_eff_dVg
- here->BSIM4cdgb; /*4.6.2*/
T11 = -T7 * dAlphaz_dVb - T10 - T0 * dVdsat_dVb;
T10 = -4.0 * T4 * (T2 - 0.5 + 0.5 * T5)
- here->BSIM4cddb;
@ -3145,7 +3180,7 @@ for (; model != NULL; model = model->BSIM4nextModel)
dVgsteff_dVb = (T9 * dT10_dVb - T10 * dT9_dVb) / T11;
/* End of VgsteffCV for cvchargeMod = 1 */
}
if (model->BSIM4capMod == 1)
{ Vfb = here->BSIM4vfbzb;
@ -3219,105 +3254,105 @@ for (; model != NULL; model = model->BSIM4nextModel)
dVdseffCV_dVb = 0.0;
}
T0 = AbulkCV * VdseffCV;
T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-20);
T0 = AbulkCV * VdseffCV;
T1 = 12.0 * (Vgsteff - 0.5 * T0 + 1.0e-20);
T2 = VdseffCV / T1;
T3 = T0 * T2;
T4 = (1.0 - 12.0 * T2 * T2 * AbulkCV);
T5 = (6.0 * T0 * (4.0 * Vgsteff - T0) / (T1 * T1) - 0.5);
T6 = 12.0 * T2 * T2 * Vgsteff;
qgate = CoxWL * (Vgsteff - 0.5 * VdseffCV + T3);
Cgg1 = CoxWL * (T4 + T5 * dVdseffCV_dVg);
Cgd1 = CoxWL * T5 * dVdseffCV_dVd + Cgg1 * dVgsteff_dVd;
Cgb1 = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Cgg1 * dVgsteff_dVb;
T4 = (1.0 - 12.0 * T2 * T2 * AbulkCV);
T5 = (6.0 * T0 * (4.0 * Vgsteff - T0) / (T1 * T1) - 0.5);
T6 = 12.0 * T2 * T2 * Vgsteff;
qgate = CoxWL * (Vgsteff - 0.5 * VdseffCV + T3);
Cgg1 = CoxWL * (T4 + T5 * dVdseffCV_dVg);
Cgd1 = CoxWL * T5 * dVdseffCV_dVd + Cgg1 * dVgsteff_dVd;
Cgb1 = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Cgg1 * dVgsteff_dVb;
Cgg1 *= dVgsteff_dVg;
T7 = 1.0 - AbulkCV;
qbulk = CoxWL * T7 * (0.5 * VdseffCV - T3);
qbulk = CoxWL * T7 * (0.5 * VdseffCV - T3);
T4 = -T7 * (T4 - 1.0);
T5 = -T7 * T5;
T6 = -(T7 * T6 + (0.5 * VdseffCV - T3));
Cbg1 = CoxWL * (T4 + T5 * dVdseffCV_dVg);
Cbd1 = CoxWL * T5 * dVdseffCV_dVd + Cbg1 * dVgsteff_dVd;
Cbb1 = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Cbg1 * dVgsteff_dVb;
Cbg1 = CoxWL * (T4 + T5 * dVdseffCV_dVg);
Cbd1 = CoxWL * T5 * dVdseffCV_dVd + Cbg1 * dVgsteff_dVd;
Cbb1 = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Cbg1 * dVgsteff_dVb;
Cbg1 *= dVgsteff_dVg;
if (model->BSIM4xpart > 0.5)
{ /* 0/100 Charge petition model */
if (model->BSIM4xpart > 0.5)
{ /* 0/100 Charge petition model */
T1 = T1 + T1;
qsrc = -CoxWL * (0.5 * Vgsteff + 0.25 * T0
- T0 * T0 / T1);
qsrc = -CoxWL * (0.5 * Vgsteff + 0.25 * T0
- T0 * T0 / T1);
T7 = (4.0 * Vgsteff - T0) / (T1 * T1);
T4 = -(0.5 + 24.0 * T0 * T0 / (T1 * T1));
T5 = -(0.25 * AbulkCV - 12.0 * AbulkCV * T0 * T7);
T6 = -(0.25 * VdseffCV - 12.0 * T0 * VdseffCV * T7);
Csg = CoxWL * (T4 + T5 * dVdseffCV_dVg);
Csd = CoxWL * T5 * dVdseffCV_dVd + Csg * dVgsteff_dVd;
Csb = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Csg * dVgsteff_dVb;
T6 = -(0.25 * VdseffCV - 12.0 * T0 * VdseffCV * T7);
Csg = CoxWL * (T4 + T5 * dVdseffCV_dVg);
Csd = CoxWL * T5 * dVdseffCV_dVd + Csg * dVgsteff_dVd;
Csb = CoxWL * (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Csg * dVgsteff_dVb;
Csg *= dVgsteff_dVg;
}
}
else if (model->BSIM4xpart < 0.5)
{ /* 40/60 Charge petition model */
{ /* 40/60 Charge petition model */
T1 = T1 / 12.0;
T2 = 0.5 * CoxWL / (T1 * T1);
T3 = Vgsteff * (2.0 * T0 * T0 / 3.0 + Vgsteff
* (Vgsteff - 4.0 * T0 / 3.0))
- 2.0 * T0 * T0 * T0 / 15.0;
* (Vgsteff - 4.0 * T0 / 3.0))
- 2.0 * T0 * T0 * T0 / 15.0;
qsrc = -T2 * T3;
T7 = 4.0 / 3.0 * Vgsteff * (Vgsteff - T0)
+ 0.4 * T0 * T0;
+ 0.4 * T0 * T0;
T4 = -2.0 * qsrc / T1 - T2 * (Vgsteff * (3.0
* Vgsteff - 8.0 * T0 / 3.0)
+ 2.0 * T0 * T0 / 3.0);
* Vgsteff - 8.0 * T0 / 3.0)
+ 2.0 * T0 * T0 / 3.0);
T5 = (qsrc / T1 + T2 * T7) * AbulkCV;
T6 = (qsrc / T1 * VdseffCV + T2 * T7 * VdseffCV);
Csg = (T4 + T5 * dVdseffCV_dVg);
Csd = T5 * dVdseffCV_dVd + Csg * dVgsteff_dVd;
Csb = (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Csg * dVgsteff_dVb;
Csg = (T4 + T5 * dVdseffCV_dVg);
Csd = T5 * dVdseffCV_dVd + Csg * dVgsteff_dVd;
Csb = (T5 * dVdseffCV_dVb + T6 * dAbulkCV_dVb)
+ Csg * dVgsteff_dVb;
Csg *= dVgsteff_dVg;
}
}
else
{ /* 50/50 Charge petition model */
qsrc = -0.5 * (qgate + qbulk);
Csg = -0.5 * (Cgg1 + Cbg1);
Csb = -0.5 * (Cgb1 + Cbb1);
Csd = -0.5 * (Cgd1 + Cbd1);
}
{ /* 50/50 Charge petition model */
qsrc = -0.5 * (qgate + qbulk);
Csg = -0.5 * (Cgg1 + Cbg1);
Csb = -0.5 * (Cgb1 + Cbb1);
Csd = -0.5 * (Cgd1 + Cbd1);
}
qgate += Qac0 + Qsub0;
qbulk -= (Qac0 + Qsub0);
qdrn = -(qgate + qbulk + qsrc);
qdrn = -(qgate + qbulk + qsrc);
Cgg = dQac0_dVg + dQsub0_dVg + Cgg1;
Cgd = dQsub0_dVd + Cgd1;
Cgb = dQac0_dVb + dQsub0_dVb + Cgb1;
Cbg = Cbg1 - dQac0_dVg - dQsub0_dVg;
Cbd = Cbd1 - dQsub0_dVd;
Cbb = Cbb1 - dQac0_dVb - dQsub0_dVb;
Cgb *= dVbseff_dVb;
Cbb *= dVbseff_dVb;
Csb *= dVbseff_dVb;
here->BSIM4cggb = Cgg;
here->BSIM4cgsb = -(Cgg + Cgd + Cgb);
here->BSIM4cgdb = Cgd;
here->BSIM4cdgb = -(Cgg + Cbg + Csg);
here->BSIM4cdsb = (Cgg + Cgd + Cgb + Cbg + Cbd + Cbb
+ Csg + Csd + Csb);
here->BSIM4cddb = -(Cgd + Cbd + Csd);
here->BSIM4cbgb = Cbg;
here->BSIM4cbsb = -(Cbg + Cbd + Cbb);
here->BSIM4cbdb = Cbd;
}
here->BSIM4cggb = Cgg;
here->BSIM4cgsb = -(Cgg + Cgd + Cgb);
here->BSIM4cgdb = Cgd;
here->BSIM4cdgb = -(Cgg + Cbg + Csg);
here->BSIM4cdsb = (Cgg + Cgd + Cgb + Cbg + Cbd + Cbb
+ Csg + Csd + Csb);
here->BSIM4cddb = -(Cgd + Cbd + Csd);
here->BSIM4cbgb = Cbg;
here->BSIM4cbsb = -(Cbg + Cbd + Cbb);
here->BSIM4cbdb = Cbd;
}
/* Charge-Thickness capMod (CTM) begins */
else if (model->BSIM4capMod == 2)
{ V3 = here->BSIM4vfbzb - Vgs_eff + VbseffCV - DELTA_3;

42
src/spicelib/devices/bsim4/b4mask.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4mask.c of BSIM4.6.1.
* File: b4mask.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
@ -14,7 +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.
* Modified by Mohan Dunga, Wenwei Yang, 07/31/2008.
**********/
@ -106,6 +106,15 @@ IFvalue *value;
case BSIM4_MOD_VDDEOT :
value->rValue = model->BSIM4vddeot;
return(OK);
case BSIM4_MOD_TEMPEOT :
value->rValue = model->BSIM4tempeot;
return(OK);
case BSIM4_MOD_LEFFEOT :
value->rValue = model->BSIM4leffeot;
return(OK);
case BSIM4_MOD_WEFFEOT :
value->rValue = model->BSIM4weffeot;
return(OK);
case BSIM4_MOD_ADOS :
value->rValue = model->BSIM4ados;
return(OK);
@ -299,6 +308,9 @@ IFvalue *value;
case BSIM4_MOD_EU:
value->rValue = model->BSIM4eu;
return(OK);
case BSIM4_MOD_UCS:
value->rValue = model->BSIM4ucs;
return(OK);
case BSIM4_MOD_UA:
value->rValue = model->BSIM4ua;
return(OK);
@ -335,6 +347,9 @@ IFvalue *value;
case BSIM4_MOD_UTE:
value->rValue = model->BSIM4ute;
return(OK);
case BSIM4_MOD_UCSTE:
value->rValue = model->BSIM4ucste;
return(OK);
case BSIM4_MOD_VOFF:
value->rValue = model->BSIM4voff;
return(OK);
@ -621,6 +636,9 @@ IFvalue *value;
case BSIM4_MOD_JTSSWGD:
value->rValue = model->BSIM4jtsswgd;
return(OK);
case BSIM4_MOD_JTWEFF:
value->rValue = model->BSIM4jtweff;
return(OK);
case BSIM4_MOD_NJTS:
value->rValue = model->BSIM4njts;
return(OK);
@ -1057,6 +1075,9 @@ IFvalue *value;
case BSIM4_MOD_LUTE:
value->rValue = model->BSIM4lute;
return(OK);
case BSIM4_MOD_LUCSTE:
value->rValue = model->BSIM4lucste;
return(OK);
case BSIM4_MOD_LVOFF:
value->rValue = model->BSIM4lvoff;
return(OK);
@ -1261,6 +1282,9 @@ IFvalue *value;
case BSIM4_MOD_LEU:
value->rValue = model->BSIM4leu;
return(OK);
case BSIM4_MOD_LUCS:
value->rValue = model->BSIM4lucs;
return(OK);
case BSIM4_MOD_LVFB:
value->rValue = model->BSIM4lvfb;
return(OK);
@ -1474,6 +1498,9 @@ IFvalue *value;
case BSIM4_MOD_WUTE:
value->rValue = model->BSIM4wute;
return(OK);
case BSIM4_MOD_WUCSTE:
value->rValue = model->BSIM4wucste;
return(OK);
case BSIM4_MOD_WVOFF:
value->rValue = model->BSIM4wvoff;
return(OK);
@ -1678,6 +1705,9 @@ IFvalue *value;
case BSIM4_MOD_WEU:
value->rValue = model->BSIM4weu;
return(OK);
case BSIM4_MOD_WUCS:
value->rValue = model->BSIM4wucs;
return(OK);
case BSIM4_MOD_WVFB:
value->rValue = model->BSIM4wvfb;
return(OK);
@ -1891,6 +1921,9 @@ IFvalue *value;
case BSIM4_MOD_PUTE:
value->rValue = model->BSIM4pute;
return(OK);
case BSIM4_MOD_PUCSTE:
value->rValue = model->BSIM4pucste;
return(OK);
case BSIM4_MOD_PVOFF:
value->rValue = model->BSIM4pvoff;
return(OK);
@ -2095,6 +2128,9 @@ IFvalue *value;
case BSIM4_MOD_PEU:
value->rValue = model->BSIM4peu;
return(OK);
case BSIM4_MOD_PUCS:
value->rValue = model->BSIM4pucs;
return(OK);
case BSIM4_MOD_PVFB:
value->rValue = model->BSIM4pvfb;
return(OK);

4
src/spicelib/devices/bsim4/b4mdel.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4mdel.c of BSIM4.6.1.
* File: b4mdel.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu

53
src/spicelib/devices/bsim4/b4mpar.c

@ -1,4 +1,4 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
@ -7,6 +7,7 @@
* 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
* Authors: 2008- 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.
@ -16,6 +17,7 @@
* 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.
* Modified by Wenwei Yang, 07/31/2008.
**********/
#include "ngspice.h"
@ -23,6 +25,7 @@
#include "ifsim.h"
#include "sperror.h"
#include "suffix.h"
#include "const.h"
int
BSIM4mParam(param,value,inMod)
@ -124,6 +127,18 @@ GENmodel *inMod;
case BSIM4_MOD_VDDEOT :
mod->BSIM4vddeot = value->rValue;
mod->BSIM4vddeotGiven = TRUE;
break;
case BSIM4_MOD_TEMPEOT :
mod->BSIM4tempeot = value->rValue;
mod->BSIM4tempeotGiven = TRUE;
break;
case BSIM4_MOD_LEFFEOT :
mod->BSIM4leffeot = value->rValue;
mod->BSIM4leffeotGiven = TRUE;
break;
case BSIM4_MOD_WEFFEOT :
mod->BSIM4weffeot = value->rValue;
mod->BSIM4weffeotGiven = TRUE;
break;
case BSIM4_MOD_ADOS :
mod->BSIM4ados = value->rValue;
@ -371,6 +386,10 @@ GENmodel *inMod;
case BSIM4_MOD_EU:
mod->BSIM4eu = value->rValue;
mod->BSIM4euGiven = TRUE;
break;
case BSIM4_MOD_UCS:
mod->BSIM4ucs = value->rValue;
mod->BSIM4ucsGiven = TRUE;
break;
case BSIM4_MOD_UA:
mod->BSIM4ua = value->rValue;
@ -404,7 +423,10 @@ GENmodel *inMod;
mod->BSIM4ute = value->rValue;
mod->BSIM4uteGiven = TRUE;
break;
case BSIM4_MOD_UCSTE :
mod->BSIM4ucste = value->rValue;
mod->BSIM4ucsteGiven = TRUE;
break;
case BSIM4_MOD_UD:
mod->BSIM4ud = value->rValue;
mod->BSIM4udGiven = TRUE;
@ -1021,6 +1043,9 @@ GENmodel *inMod;
mod->BSIM4jtsswgd = value->rValue;
mod->BSIM4jtsswgdGiven = TRUE;
break;
case BSIM4_MOD_JTWEFF :
mod->BSIM4jtweff = value->rValue;
mod->BSIM4jtweffGiven = TRUE;
case BSIM4_MOD_NJTS :
mod->BSIM4njts = value->rValue;
mod->BSIM4njtsGiven = TRUE;
@ -1604,6 +1629,10 @@ GENmodel *inMod;
case BSIM4_MOD_LUTE :
mod->BSIM4lute = value->rValue;
mod->BSIM4luteGiven = TRUE;
break;
case BSIM4_MOD_LUCSTE :
mod->BSIM4lucste = value->rValue;
mod->BSIM4lucsteGiven = TRUE;
break;
case BSIM4_MOD_LVOFF:
mod->BSIM4lvoff = value->rValue;
@ -1896,6 +1925,10 @@ GENmodel *inMod;
case BSIM4_MOD_LEU :
mod->BSIM4leu = value->rValue;
mod->BSIM4leuGiven = TRUE;
break;
case BSIM4_MOD_LUCS :
mod->BSIM4lucs = value->rValue;
mod->BSIM4lucsGiven = TRUE;
break;
case BSIM4_MOD_LVFB :
mod->BSIM4lvfb = value->rValue;
@ -2164,6 +2197,10 @@ GENmodel *inMod;
case BSIM4_MOD_WUTE :
mod->BSIM4wute = value->rValue;
mod->BSIM4wuteGiven = TRUE;
break;
case BSIM4_MOD_WUCSTE :
mod->BSIM4wucste = value->rValue;
mod->BSIM4wucsteGiven = TRUE;
break;
case BSIM4_MOD_WVOFF:
mod->BSIM4wvoff = value->rValue;
@ -2456,6 +2493,10 @@ GENmodel *inMod;
case BSIM4_MOD_WEU :
mod->BSIM4weu = value->rValue;
mod->BSIM4weuGiven = TRUE;
break;
case BSIM4_MOD_WUCS :
mod->BSIM4wucs = value->rValue;
mod->BSIM4wucsGiven = TRUE;
break;
case BSIM4_MOD_WVFB :
mod->BSIM4wvfb = value->rValue;
@ -2724,6 +2765,10 @@ GENmodel *inMod;
case BSIM4_MOD_PUTE :
mod->BSIM4pute = value->rValue;
mod->BSIM4puteGiven = TRUE;
break;
case BSIM4_MOD_PUCSTE :
mod->BSIM4pucste = value->rValue;
mod->BSIM4pucsteGiven = TRUE;
break;
case BSIM4_MOD_PVOFF:
mod->BSIM4pvoff = value->rValue;
@ -3016,6 +3061,10 @@ GENmodel *inMod;
case BSIM4_MOD_PEU :
mod->BSIM4peu = value->rValue;
mod->BSIM4peuGiven = TRUE;
break;
case BSIM4_MOD_PUCS :
mod->BSIM4pucs = value->rValue;
mod->BSIM4pucsGiven = TRUE;
break;
case BSIM4_MOD_PVFB :
mod->BSIM4pvfb = value->rValue;

13
src/spicelib/devices/bsim4/b4noi.c

@ -1,20 +1,21 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4noi.c of BSIM4.6.1.
* File: b4noi.c of BSIM4.6.2.
* 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
* Authors: 2008- 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, 03/04/2004.
* Modified by Xuemei Xi, 07/29/2005.
* Modified by Mohan Dunga, 12/13/2006
* Modified by Wenwei Yang, 07/31/2008.
**********/
#include "ngspice.h"
@ -96,7 +97,7 @@ double tempInoise;
double noizDens[BSIM4NSRCS];
double lnNdens[BSIM4NSRCS];
double T0, T1, T2, T5, T10, T11;
double T0, T1, T2, T5, T10, T11;
double Vds, Ssi, Swi;
double tmp=0.0, gdpr, gspr, npart_theta=0.0, npart_beta=0.0, igsquare, bodymode;
@ -214,6 +215,10 @@ int i;
* model->BSIM4tnoia * pParam->BSIM4leff);
npart_theta = model->BSIM4rnoib * (1.0 + T5
* model->BSIM4tnoib * pParam->BSIM4leff);
if(npart_theta > 0.9)
npart_theta = 0.9;
if(npart_theta > 0.9 * npart_beta)
npart_theta = 0.9 * npart_beta; //4.6.2
if (model->BSIM4rdsMod == 0)
{ gspr = here->BSIM4sourceConductance;

6
src/spicelib/devices/bsim4/b4par.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4par.c of BSIM4.6.1.
* File: b4par.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
@ -47,7 +47,7 @@ IFvalue *select;
here->BSIM4m = value->rValue;
here->BSIM4mGiven = TRUE;
break;
case BSIM4_NF:
case BSIM4_NF:
here->BSIM4nf = value->rValue;
here->BSIM4nfGiven = TRUE;
break;

6
src/spicelib/devices/bsim4/b4pzld.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4pzld.c of BSIM4.6.0.
* File: b4pzld.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu
@ -55,7 +55,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;

67
src/spicelib/devices/bsim4/b4set.c

@ -1,12 +1,13 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4set.c of BSIM4.6.1.
* File: b4set.c of BSIM4.6.2.
* 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
* Authors: 2008- 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.
@ -16,11 +17,12 @@
* 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.
* Modified by Wenwei Yang, 07/31/2008.
**********/
#include "ngspice.h"
#include "jobdefs.h" /* Needed because the model searches for noise Analysis */
#include "ftedefs.h" /* " " */
#include "jobdefs.h"
#include "ftedefs.h"
#include "smpdefs.h"
#include "cktdefs.h"
#include "bsim4def.h"
@ -73,7 +75,7 @@ JOB *job;
if (!model->BSIM4mobModGiven)
model->BSIM4mobMod = 0;
else if ((model->BSIM4mobMod != 0) && (model->BSIM4mobMod != 1)
&& (model->BSIM4mobMod != 2))
&& (model->BSIM4mobMod != 2) && (model->BSIM4mobMod != 3))
{ model->BSIM4mobMod = 0;
printf("Warning: mobMod has been set to its default value: 0.\n");
}
@ -183,13 +185,19 @@ JOB *job;
}
if (!model->BSIM4versionGiven)
model->BSIM4version = "4.6.1";
model->BSIM4version = "4.6.3";
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->BSIM4tempeotGiven)
model->BSIM4tempeot = 300.15;
if (!model->BSIM4leffeotGiven)
model->BSIM4leffeot = 1;
if (!model->BSIM4weffeotGiven)
model->BSIM4weffeot = 10;
if (!model->BSIM4adosGiven)
model->BSIM4ados = 1.0;
if (!model->BSIM4bdosGiven)
@ -304,9 +312,11 @@ JOB *job;
if (!model->BSIM4vfbGiven)
model->BSIM4vfb = -1.0;
if (!model->BSIM4euGiven)
model->BSIM4eu = (model->BSIM4type == NMOS) ? 1.67 : 1.0;;
model->BSIM4eu = (model->BSIM4type == NMOS) ? 1.67 : 1.0;
if (!model->BSIM4ucsGiven)
model->BSIM4ucs = (model->BSIM4type == NMOS) ? 1.67 : 1.0;
if (!model->BSIM4uaGiven)
model->BSIM4ua = (model->BSIM4mobMod == 2) ? 1.0e-15 : 1.0e-9; /* unit m/V */
model->BSIM4ua = ((model->BSIM4mobMod == 2)) ? 1.0e-15 : 1.0e-9; /* unit m/V */
if (!model->BSIM4ua1Given)
model->BSIM4ua1 = 1.0e-9; /* unit m/V */
if (!model->BSIM4ubGiven)
@ -328,7 +338,9 @@ JOB *job;
if (!model->BSIM4u0Given)
model->BSIM4u0 = (model->BSIM4type == NMOS) ? 0.067 : 0.025;
if (!model->BSIM4uteGiven)
model->BSIM4ute = -1.5;
model->BSIM4ute = -1.5;
if (!model->BSIM4ucsteGiven)
model->BSIM4ucste = -4.775e-3;
if (!model->BSIM4voffGiven)
model->BSIM4voff = -0.08;
if (!model->BSIM4vofflGiven)
@ -365,6 +377,7 @@ JOB *job;
model->BSIM4prwg = 1.0; /* in 1/V */
if (!model->BSIM4prwbGiven)
model->BSIM4prwb = 0.0;
if (!model->BSIM4prtGiven)
if (!model->BSIM4prtGiven)
model->BSIM4prt = 0.0;
if (!model->BSIM4eta0Given)
@ -779,7 +792,9 @@ JOB *job;
if (!model->BSIM4lu0Given)
model->BSIM4lu0 = 0.0;
if (!model->BSIM4luteGiven)
model->BSIM4lute = 0.0;
model->BSIM4lute = 0.0;
if (!model->BSIM4lucsteGiven)
model->BSIM4lucste = 0.0;
if (!model->BSIM4lvoffGiven)
model->BSIM4lvoff = 0.0;
if (!model->BSIM4lminvGiven)
@ -953,6 +968,8 @@ JOB *job;
model->BSIM4lxrcrg2 = 0.0;
if (!model->BSIM4leuGiven)
model->BSIM4leu = 0.0;
if (!model->BSIM4lucsGiven)
model->BSIM4lucs = 0.0;
if (!model->BSIM4lvfbGiven)
model->BSIM4lvfb = 0.0;
if (!model->BSIM4llambdaGiven)
@ -999,7 +1016,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;
@ -1096,9 +1113,11 @@ JOB *job;
if (!model->BSIM4wu0Given)
model->BSIM4wu0 = 0.0;
if (!model->BSIM4wuteGiven)
model->BSIM4wute = 0.0;
model->BSIM4wute = 0.0;
if (!model->BSIM4wucsteGiven)
model->BSIM4wucste = 0.0;
if (!model->BSIM4wvoffGiven)
model->BSIM4wvoff = 0.0;
model->BSIM4wvoff = 0.0;
if (!model->BSIM4wminvGiven)
model->BSIM4wminv = 0.0;
if (!model->BSIM4wminvcvGiven)
@ -1270,6 +1289,8 @@ JOB *job;
model->BSIM4wxrcrg2 = 0.0;
if (!model->BSIM4weuGiven)
model->BSIM4weu = 0.0;
if (!model->BSIM4wucsGiven)
model->BSIM4wucs = 0.0;
if (!model->BSIM4wvfbGiven)
model->BSIM4wvfb = 0.0;
if (!model->BSIM4wlambdaGiven)
@ -1413,7 +1434,9 @@ JOB *job;
if (!model->BSIM4pu0Given)
model->BSIM4pu0 = 0.0;
if (!model->BSIM4puteGiven)
model->BSIM4pute = 0.0;
model->BSIM4pute = 0.0;
if (!model->BSIM4pucsteGiven)
model->BSIM4pucste = 0.0;
if (!model->BSIM4pvoffGiven)
model->BSIM4pvoff = 0.0;
if (!model->BSIM4pminvGiven)
@ -1587,6 +1610,8 @@ JOB *job;
model->BSIM4pxrcrg2 = 0.0;
if (!model->BSIM4peuGiven)
model->BSIM4peu = 0.0;
if (!model->BSIM4pucsGiven)
model->BSIM4pucs = 0.0;
if (!model->BSIM4pvfbGiven)
model->BSIM4pvfb = 0.0;
if (!model->BSIM4plambdaGiven)
@ -1796,6 +1821,8 @@ JOB *job;
model->BSIM4jtsswgs = 0.0;
if (!model->BSIM4jtsswgdGiven)
model->BSIM4jtsswgd = model->BSIM4jtsswgs;
if (!model->BSIM4jtweffGiven)
model->BSIM4jtweff = 0.0;
if (!model->BSIM4njtsGiven)
model->BSIM4njts = 20.0;
if (!model->BSIM4njtsswGiven)
@ -1991,11 +2018,11 @@ JOB *job;
for (here = model->BSIM4instances; here != NULL ;
here=here->BSIM4nextInstance)
{
if (here->BSIM4owner == ARCHme) {
/* allocate a chunk of the state vector */
here->BSIM4states = *states;
*states += BSIM4numStates;
{
if (here->BSIM4owner == ARCHme) {
/* allocate a chunk of the state vector */
here->BSIM4states = *states;
*states += BSIM4numStates;
}
/* perform the parameter defaulting */
if (!here->BSIM4lGiven)
@ -2068,7 +2095,7 @@ JOB *job;
if (!here->BSIM4geoModGiven)
here->BSIM4geoMod = model->BSIM4geoMod;
if (!here->BSIM4rgeoModGiven)
here->BSIM4rgeoMod = 0.0;
here->BSIM4rgeoMod = 0;
if (!here->BSIM4trnqsModGiven)
here->BSIM4trnqsMod = model->BSIM4trnqsMod;
else if ((here->BSIM4trnqsMod != 0) && (here->BSIM4trnqsMod != 1))

248
src/spicelib/devices/bsim4/b4temp.c

@ -1,12 +1,13 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.3 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4temp.c of BSIM4.6.1.
* File: b4temp.c of BSIM4.6.3.
* 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
* Authors: 2008- 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.
@ -16,8 +17,10 @@
* 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.
* Modified by Wenwei Yang, 07/31/2008.
**********/
#include "ngspice.h"
#include "smpdefs.h"
#include "cktdefs.h"
@ -77,7 +80,7 @@ BSIM4model *model = (BSIM4model*) inModel;
BSIM4instance *here;
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=0.0, Wnew;
double T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T11, Lnew=0.0, Wnew;
double delTemp, Temp, TRatio, Inv_L, Inv_W, Inv_LW, Vtm0, Tnom;
double dumPs, dumPd, dumAs, dumAd, PowWeffWr;
double DMCGeff, DMCIeff, DMDGeff;
@ -87,8 +90,9 @@ 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;
double V0, lt1, ltw, Theta0, Delt_vth, Vth_NarrowW, Lpe_Vb, Vth;
double n, n0, Vtm=0.0, Vgsteff, Vgs_eff, niter, toxpf, toxpi, Tcen, toxe, epsrox, vddeot;
double vtfbphi2eot, phieot, TempRatioeot, Vtm0eot, Vtmeot,vbieot;
int Size_Not_Found, i;
@ -148,9 +152,9 @@ int Size_Not_Found, i;
model->BSIM4coxe = epsrox * EPS0 / toxe;
if(model->BSIM4mtrlMod == 0)
model->BSIM4coxp = model->BSIM4epsrox * EPS0 / model->BSIM4toxp;
model->BSIM4coxp = model->BSIM4epsrox * EPS0 / model->BSIM4toxp;
if (!model->BSIM4cgdoGiven)
if (!model->BSIM4cgdoGiven)
{ if (model->BSIM4dlcGiven && (model->BSIM4dlc > 0.0))
model->BSIM4cgdo = model->BSIM4dlc * model->BSIM4coxe
- model->BSIM4cgdl ;
@ -267,6 +271,12 @@ int Size_Not_Found, i;
}
}
T0 = model->BSIM4tcjsw * delTemp;
if (model->BSIM4SunitLengthSidewallJctCap < 0.0)/*4.6.2*/
{model->BSIM4SunitLengthSidewallJctCap = 0.0;
fprintf(stderr, "CJSWS is negative. Cjsws is clamped to zero.\n");}
if (model->BSIM4DunitLengthSidewallJctCap < 0.0)
{model->BSIM4DunitLengthSidewallJctCap = 0.0;
fprintf(stderr, "CJSWD is negative. Cjswd is clamped to zero.\n");}
if (T0 >= -1.0)
{ model->BSIM4SunitLengthSidewallTempJctCap = model->BSIM4SunitLengthSidewallJctCap *(1.0 + T0);
model->BSIM4DunitLengthSidewallTempJctCap = model->BSIM4DunitLengthSidewallJctCap *(1.0 + T0);
@ -338,47 +348,47 @@ int Size_Not_Found, i;
if (model->BSIM4ijthdfwd <= 0.0)
{ model->BSIM4ijthdfwd = 0.1;
{ model->BSIM4ijthdfwd = 0.0;
fprintf(stderr, "Ijthdfwd reset to %g.\n", model->BSIM4ijthdfwd);
}
if (model->BSIM4ijthsfwd <= 0.0)
{ model->BSIM4ijthsfwd = 0.1;
{ model->BSIM4ijthsfwd = 0.0;
fprintf(stderr, "Ijthsfwd reset to %g.\n", model->BSIM4ijthsfwd);
}
if (model->BSIM4ijthdrev <= 0.0)
{ model->BSIM4ijthdrev = 0.1;
{ model->BSIM4ijthdrev = 0.0;
fprintf(stderr, "Ijthdrev reset to %g.\n", model->BSIM4ijthdrev);
}
if (model->BSIM4ijthsrev <= 0.0)
{ model->BSIM4ijthsrev = 0.1;
{ model->BSIM4ijthsrev = 0.0;
fprintf(stderr, "Ijthsrev reset to %g.\n", model->BSIM4ijthsrev);
}
if ((model->BSIM4xjbvd <= 0.0) && (model->BSIM4dioMod == 2))
{ model->BSIM4xjbvd = 1.0;
{ model->BSIM4xjbvd = 0.0;
fprintf(stderr, "Xjbvd reset to %g.\n", model->BSIM4xjbvd);
}
else if ((model->BSIM4xjbvd < 0.0) && (model->BSIM4dioMod == 0))
{ model->BSIM4xjbvd = 1.0;
{ model->BSIM4xjbvd = 0.0;
fprintf(stderr, "Xjbvd reset to %g.\n", model->BSIM4xjbvd);
}
if (model->BSIM4bvd <= 0.0)
{ model->BSIM4bvd = 10.0;
if (model->BSIM4bvd <= 0.0) /*4.6.2*/
{ model->BSIM4bvd = 0.0;
fprintf(stderr, "BVD reset to %g.\n", model->BSIM4bvd);
}
if ((model->BSIM4xjbvs <= 0.0) && (model->BSIM4dioMod == 2))
{ model->BSIM4xjbvs = 1.0;
{ model->BSIM4xjbvs = 0.0;
fprintf(stderr, "Xjbvs reset to %g.\n", model->BSIM4xjbvs);
}
else if ((model->BSIM4xjbvs < 0.0) && (model->BSIM4dioMod == 0))
{ model->BSIM4xjbvs = 1.0;
{ model->BSIM4xjbvs = 0.0;
fprintf(stderr, "Xjbvs reset to %g.\n", model->BSIM4xjbvs);
}
if (model->BSIM4bvs <= 0.0)
{ model->BSIM4bvs = 10.0;
{ model->BSIM4bvs = 0.0;
fprintf(stderr, "BVS reset to %g.\n", model->BSIM4bvs);
}
@ -718,6 +728,16 @@ int Size_Not_Found, i;
+ model->BSIM4luc1 * Inv_L
+ model->BSIM4wuc1 * Inv_W
+ model->BSIM4puc1 * Inv_LW;
/*high k mobility*/
pParam->BSIM4ucs = model->BSIM4ucs
+ model->BSIM4lucs * Inv_L
+ model->BSIM4wucs * Inv_W
+ model->BSIM4pucs * Inv_LW;
pParam->BSIM4ud = model->BSIM4ud
+ model->BSIM4lud * Inv_L
+ model->BSIM4wud * Inv_W
@ -746,6 +766,16 @@ int Size_Not_Found, i;
+ model->BSIM4lute * Inv_L
+ model->BSIM4wute * Inv_W
+ model->BSIM4pute * Inv_LW;
/*high k mobility*/
pParam->BSIM4ucs = model->BSIM4ucs
+ model->BSIM4lucs * Inv_L
+ model->BSIM4wucs * Inv_W
+ model->BSIM4pucs * Inv_LW;
pParam->BSIM4ucste = model->BSIM4ucste
+ model->BSIM4lucste * Inv_L
+ model->BSIM4wucste * Inv_W
+ model->BSIM4pucste * Inv_LW;
pParam->BSIM4voff = model->BSIM4voff
+ model->BSIM4lvoff * Inv_L
+ model->BSIM4wvoff * Inv_W
@ -762,7 +792,7 @@ int Size_Not_Found, i;
+ model->BSIM4lminvcv * Inv_L
+ model->BSIM4wminvcv * Inv_W
+ model->BSIM4pminvcv * Inv_LW;
pParam->BSIM4fprout = model->BSIM4fprout
pParam->BSIM4fprout = model->BSIM4fprout
+ model->BSIM4lfprout * Inv_L
+ model->BSIM4wfprout * Inv_W
+ model->BSIM4pfprout * Inv_LW;
@ -1089,6 +1119,7 @@ int Size_Not_Found, i;
PowWeffWr = pow(pParam->BSIM4weffCJ * 1.0e6, pParam->BSIM4wr) * here->BSIM4nf;
T1 = T2 = T3 = T4 = 0.0;
pParam->BSIM4ucs = pParam->BSIM4ucs * pow(TRatio, pParam->BSIM4ucste);
if(model->BSIM4tempMod == 0) {
pParam->BSIM4ua = pParam->BSIM4ua + pParam->BSIM4ua1 * T0;
pParam->BSIM4ub = pParam->BSIM4ub + pParam->BSIM4ub1 * T0;
@ -1109,11 +1140,19 @@ int Size_Not_Found, i;
* here->BSIM4nf / PowWeffWr;
pParam->BSIM4rdswmin = (model->BSIM4rdswmin + T10)
* here->BSIM4nf / PowWeffWr;
} else { /* tempMod = 1, 2 */
} else {
if (model->BSIM4tempMod == 3)
{pParam->BSIM4ua = pParam->BSIM4ua * pow(TRatio, pParam->BSIM4ua1) ;
pParam->BSIM4ub = pParam->BSIM4ub * pow(TRatio, pParam->BSIM4ub1);
pParam->BSIM4uc = pParam->BSIM4uc * pow(TRatio, pParam->BSIM4uc1);
pParam->BSIM4ud = pParam->BSIM4ud * pow(TRatio, pParam->BSIM4ud1);
}
else{ /* tempMod = 1, 2 */
pParam->BSIM4ua = pParam->BSIM4ua * (1.0 + pParam->BSIM4ua1 * delTemp) ;
pParam->BSIM4ub = pParam->BSIM4ub * (1.0 + pParam->BSIM4ub1 * delTemp);
pParam->BSIM4uc = pParam->BSIM4uc * (1.0 + pParam->BSIM4uc1 * delTemp);
pParam->BSIM4ud = pParam->BSIM4ud * (1.0 + pParam->BSIM4ud1 * delTemp);
}
pParam->BSIM4vsattemp = pParam->BSIM4vsat * (1.0 - pParam->BSIM4at * delTemp);
T10 = 1.0 + pParam->BSIM4prt * delTemp;
if(model->BSIM4rdsMod) {
@ -1128,6 +1167,13 @@ int Size_Not_Found, i;
pParam->BSIM4rds0 = pParam->BSIM4rdsw * T10 * here->BSIM4nf / PowWeffWr;
pParam->BSIM4rdswmin = model->BSIM4rdswmin * T10 * here->BSIM4nf / PowWeffWr;
}
/*high k mobility*/
if (model->BSIM4mobMod == 3)
{
pParam->BSIM4ua = pParam->BSIM4ua * pow(TRatio, pParam->BSIM4ua1) ;
pParam->BSIM4uc = pParam->BSIM4uc * pow(TRatio, pParam->BSIM4uc1) ;
pParam->BSIM4ud = pParam->BSIM4ud * pow(TRatio, pParam->BSIM4ud1) ;
}
if (T1 < 0.0)
{ T1 = 0.0;
printf("Warning: Rdw at current temperature is negative; set to 0.\n");
@ -1160,6 +1206,10 @@ int Size_Not_Found, i;
{ pParam->BSIM4eu = 0.0;
printf("Warning: eu has been negative; reset to 0.0.\n");
}
if (pParam->BSIM4ucs < 0.0)
{ pParam->BSIM4ucs = 0.0;
printf("Warning: ucs has been negative; reset to 0.0.\n");
}
pParam->BSIM4vfbsdoff = pParam->BSIM4vfbsdoff * (1.0 + pParam->BSIM4tvfbsdoff * delTemp);
pParam->BSIM4voff = pParam->BSIM4voff * (1.0 + pParam->BSIM4tvoff * delTemp);
@ -1189,14 +1239,14 @@ int Size_Not_Found, i;
pParam->BSIM4sqrtPhi = sqrt(pParam->BSIM4phi);
pParam->BSIM4phis3 = pParam->BSIM4sqrtPhi * pParam->BSIM4phi;
pParam->BSIM4Xdep0 = sqrt(2.0 * epssub / (Charge_q
* pParam->BSIM4ndep * 1.0e6))
* pParam->BSIM4sqrtPhi;
pParam->BSIM4sqrtXdep0 = sqrt(pParam->BSIM4Xdep0);
if(model->BSIM4mtrlMod == 0)
pParam->BSIM4litl = sqrt(3.0 * pParam->BSIM4xj * toxe);
pParam->BSIM4litl = sqrt(3.0 * 3.9/epsrox * pParam->BSIM4xj * toxe);
else
pParam->BSIM4litl = sqrt(model->BSIM4epsrsub/epsrox * pParam->BSIM4xj * toxe);
@ -1403,7 +1453,7 @@ int Size_Not_Found, i;
if((model->BSIM4tempMod == 1) || (model->BSIM4tempMod == 0))
T3 = (pParam->BSIM4kt1 + pParam->BSIM4kt1l / pParam->BSIM4leff)
* (TRatio - 1.0);
if(model->BSIM4tempMod == 2)
if((model->BSIM4tempMod == 2)||(model->BSIM4tempMod == 3))
T3 = - pParam->BSIM4kt1 * (TRatio - 1.0);
T5 = pParam->BSIM4k1ox * (T0 - 1.0) * pParam->BSIM4sqrtPhi
@ -1510,6 +1560,28 @@ int Size_Not_Found, i;
fprintf(stderr, "Warning: No WPE as none of SCA, SCB, SCC, SC is given and/or SC not positive.\n");
}
}
if (here->BSIM4sca < 0.0)
{
printf("Warning: SCA = %g is negative. Set to 0.0.\n", here->BSIM4sca);
here->BSIM4sca = 0.0;
}
if (here->BSIM4scb < 0.0)
{
printf("Warning: SCB = %g is negative. Set to 0.0.\n", here->BSIM4scb);
here->BSIM4scb = 0.0;
}
if (here->BSIM4scc < 0.0)
{
printf("Warning: SCC = %g is negative. Set to 0.0.\n", here->BSIM4scc);
here->BSIM4scc = 0.0;
}
if (here->BSIM4sc < 0.0)
{
printf("Warning: SC = %g is negative. Set to 0.0.\n", here->BSIM4sc);
here->BSIM4sc = 0.0;
}
/*4.6.2*/
sceff = here->BSIM4sca + model->BSIM4web * here->BSIM4scb
+ model->BSIM4wec * here->BSIM4scc;
here->BSIM4vth0 += pParam->BSIM4kvth0we * sceff;
@ -1690,7 +1762,11 @@ int Size_Not_Found, i;
BSIM4PAeffGeo(here->BSIM4nf, here->BSIM4geoMod, here->BSIM4min,
pParam->BSIM4weffCJ, DMCGeff, DMCIeff, DMDGeff,
&(here->BSIM4Pseff), &dumPd, &dumAs, &dumAd);
if (here->BSIM4Pseff < 0.0) /*4.6.2*/
here->BSIM4Pseff = 0.0;
if (here->BSIM4drainPerimeterGiven)
{ if (model->BSIM4perMod == 0)
here->BSIM4Pdeff = here->BSIM4drainPerimeter;
@ -1702,7 +1778,9 @@ int Size_Not_Found, i;
BSIM4PAeffGeo(here->BSIM4nf, here->BSIM4geoMod, here->BSIM4min,
pParam->BSIM4weffCJ, DMCGeff, DMCIeff, DMDGeff,
&dumPs, &(here->BSIM4Pdeff), &dumAs, &dumAd);
if (here->BSIM4Pdeff < 0.0) /*4.6.2*/
here->BSIM4Pdeff = 0.0;
if (here->BSIM4sourceAreaGiven)
here->BSIM4Aseff = here->BSIM4sourceArea;
else
@ -1922,21 +2000,84 @@ int Size_Not_Found, i;
DEXP(T9, T5);
T9 = model->BSIM4xtsswgd * T7;
DEXP(T9, T6);
/*IBM TAT*/
if(model->BSIM4jtweff < 0.0)
{ model->BSIM4jtweff = 0.0;
fprintf(stderr, "TAT width dependence effect is negative. Jtweff is clamped to zero.\n");
}
T11 = sqrt(model->BSIM4jtweff / pParam->BSIM4weffCJ) + 1.0;
T10 = pParam->BSIM4weffCJ * here->BSIM4nf;
here->BSIM4SjctTempRevSatCur = T1 * here->BSIM4Aseff * model->BSIM4jtss;
here->BSIM4DjctTempRevSatCur = T2 * here->BSIM4Adeff * model->BSIM4jtsd;
here->BSIM4SswTempRevSatCur = T3 * here->BSIM4Pseff * model->BSIM4jtssws;
here->BSIM4DswTempRevSatCur = T4 * here->BSIM4Pdeff * model->BSIM4jtsswd;
here->BSIM4SswgTempRevSatCur = T5 * T10 * model->BSIM4jtsswgs;
here->BSIM4DswgTempRevSatCur = T6 * T10 * model->BSIM4jtsswgd;
here->BSIM4SswgTempRevSatCur = T5 * T10 * T11 * model->BSIM4jtsswgs;
here->BSIM4DswgTempRevSatCur = T6 * T10 * T11 * model->BSIM4jtsswgd;
/*high k*/
/*Calculate VgsteffVth for mobMod=3*/
if(model->BSIM4mobMod==3)
{ /*Calculate n @ Vbs=Vds=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);
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)
n0 = 1.0 + tmp3;
else
{
T0 = 1.0 / (3.0 + 8.0 * tmp3);
n0 = (1.0 + 3.0 * tmp3) * T0;
}
T0 = n0 * Vtm;
T1 = pParam->BSIM4voffcbn;
T2 = T1/T0;
if (T2 < -EXP_THRESHOLD)
{ T3 = model->BSIM4coxe * MIN_EXP / pParam->BSIM4cdep0;
T4 = pParam->BSIM4mstar + T3 * n0;
}
else if (T2 > EXP_THRESHOLD)
{ T3 = model->BSIM4coxe * MAX_EXP / pParam->BSIM4cdep0;
T4 = pParam->BSIM4mstar + T3 * n0;
}
else
{ T3 = exp(T2)* model->BSIM4coxe / pParam->BSIM4cdep0;
T4 = pParam->BSIM4mstar + T3 * n0;
}
pParam->BSIM4VgsteffVth = T0 * log(2.0)/T4;
}
if(model->BSIM4mtrlMod)
{
/* Calculate TOXP from EOT */
/* Calculate Vgs_eff @ Vgs = VDD with Poly Depletion Effect */
tmp2 = here->BSIM4vfb + pParam->BSIM4phi;
/* Calculate Vgs_eff @ Vgs = VDD with Poly Depletion Effect */
Vtm0eot = KboQ * model->BSIM4tempeot;
Vtmeot = Vtm0eot;
vbieot = Vtm0eot * log(pParam->BSIM4nsd
* pParam->BSIM4ndep / (ni * ni));
phieot = Vtm0eot * log(pParam->BSIM4ndep / ni)
+ pParam->BSIM4phin + 0.4;
tmp2 = here->BSIM4vfb + phieot;
vddeot = model->BSIM4type * model->BSIM4vddeot;
T0 = model->BSIM4epsrgate * EPS0;
if ((pParam->BSIM4ngate > 1.0e18) && (pParam->BSIM4ngate < 1.0e25)
@ -1957,10 +2098,11 @@ int Size_Not_Found, i;
Vgs_eff = vddeot;
/* Calculate Vth @ Vds=Vbs=0 */
V0 = pParam->BSIM4vbi - pParam->BSIM4phi;
V0 = vbieot - phieot;
lt1 = model->BSIM4factor1* pParam->BSIM4sqrtXdep0;
ltw = lt1;
T0 = pParam->BSIM4dvt1 * pParam->BSIM4leff / lt1;
T0 = pParam->BSIM4dvt1 * model->BSIM4leffeot / lt1;
if (T0 < EXP_THRESHOLD)
{
T1 = exp(T0);
@ -1972,7 +2114,7 @@ int Size_Not_Found, i;
else
Theta0 = 1.0 / (MAX_EXP - 2.0);
Delt_vth = pParam->BSIM4dvt0 * Theta0 * V0;
T0 = pParam->BSIM4dvt1w * pParam->BSIM4weff * pParam->BSIM4leff / ltw;
T0 = pParam->BSIM4dvt1w * model->BSIM4weffeot * model->BSIM4leffeot / ltw;
if (T0 < EXP_THRESHOLD)
{ T1 = exp(T0);
T2 = T1 - 1.0;
@ -1983,20 +2125,20 @@ int Size_Not_Found, i;
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);
TempRatioeot = model->BSIM4tempeot / model->BSIM4tnom - 1.0;
T0 = sqrt(1.0 + pParam->BSIM4lpe0 / model->BSIM4leffeot);
T1 = pParam->BSIM4k1ox * (T0 - 1.0) * sqrt(phieot)
+ (pParam->BSIM4kt1 + pParam->BSIM4kt1l / model->BSIM4leffeot) * TempRatioeot;
Vth_NarrowW = toxe * phieot
/ (model->BSIM4weffeot + pParam->BSIM4w0);
Lpe_Vb = sqrt(1.0 + pParam->BSIM4lpeb / model->BSIM4leffeot);
Vth = model->BSIM4type * here->BSIM4vth0 +
(pParam->BSIM4k1ox - pParam->BSIM4k1)*pParam->BSIM4sqrtPhi*Lpe_Vb
(pParam->BSIM4k1ox - pParam->BSIM4k1)*sqrt(phieot)*Lpe_Vb
- Delt_vth - T2 + pParam->BSIM4k3 * Vth_NarrowW + T1;
/* Calculate n */
tmp1 = epssub / pParam->BSIM4Xdep0;
here->BSIM4nstar = model->BSIM4vtm / Charge_q *
here->BSIM4nstar = Vtmeot / Charge_q *
(model->BSIM4coxe + tmp1 + pParam->BSIM4cit);
tmp2 = pParam->BSIM4nfactor * tmp1;
tmp3 = (tmp2 + pParam->BSIM4cdsc * Theta0 + pParam->BSIM4cit) / model->BSIM4coxe;
@ -2011,22 +2153,32 @@ int Size_Not_Found, i;
/* Vth correction for Pocket implant */
if (pParam->BSIM4dvtp0 > 0.0)
{
T3 = pParam->BSIM4leff + pParam->BSIM4dvtp0 * 2.0;
T3 = model->BSIM4leffeot + pParam->BSIM4dvtp0 * 2.0;
if (model->BSIM4tempMod < 2)
T4 = model->BSIM4vtm * log(pParam->BSIM4leff / T3);
T4 = Vtmeot * log(model->BSIM4leffeot / T3);
else
T4 = model->BSIM4vtm0 * log(pParam->BSIM4leff / T3);
T4 = Vtm0eot * log(model->BSIM4leffeot / T3);
Vth -= n * T4;
}
Vgsteff = Vgs_eff-Vth;
/* calculating Toxp */
T3 = model->BSIM4type * here->BSIM4vth0
- here->BSIM4vfb - phieot;
T4 = T3 + T3;
T5 = 2.5 * T3;
vtfbphi2eot = 4.0 * T3;
if (vtfbphi2eot < 0.0)
vtfbphi2eot = 0.0;
niter = 0;
toxpf = toxe;
do
{
toxpi = toxpf;
tmp2 = 2.0e8 * toxpf;
T0 = (Vgsteff + here->BSIM4vtfbphi2) / tmp2;
T0 = (Vgsteff + vtfbphi2eot) / tmp2;
T1 = 1.0 + exp(model->BSIM4bdos * 0.7 * log(T0));
Tcen = model->BSIM4ados * 1.9e-9 / T1;
toxpf = toxe - epsrox/model->BSIM4epsrsub * Tcen;
@ -2040,7 +2192,7 @@ int Size_Not_Found, i;
{ IFuid namarray[2];
namarray[0] = model->BSIM4modName;
namarray[1] = here->BSIM4name;
(*(SPfrontEnd->IFerror)) (ERR_FATAL, "Fatal error(s) detected during BSIM4.6.1 parameter checking for %s in model %s", namarray);
(*(SPfrontEnd->IFerror)) (ERR_FATAL, "Fatal error(s) detected during BSIM4.6.3 parameter checking for %s in model %s", namarray);
return(E_BADPARM);
}
} /* End instance */

4
src/spicelib/devices/bsim4/b4trunc.c

@ -1,8 +1,8 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
* Copyright 2006 Regents of the University of California. All rights reserved.
* File: b4trunc.c of BSIM4.6.1.
* File: b4trunc.c of BSIM4.6.2.
* Author: 2000 Weidong Liu
* Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu.
* Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu

47
src/spicelib/devices/bsim4/bsim4def.h

@ -1,11 +1,13 @@
/**** BSIM4.6.1 Released by Mohan Dunga, Wenwei Yang 05/18/2007 ****/
/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/
/**********
Copyright 2006 Regents of the University of California. All rights reserved.
File: bsim4def.h
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
Authors: 2008- 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.
@ -13,7 +15,7 @@ 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
Modified by Wenwei Yang, 07/31/2008.
**********/
#ifndef BSIM4
@ -513,7 +515,9 @@ struct bsim4SizeDependParam
double BSIM4lp;
double BSIM4u0;
double BSIM4eu;
double BSIM4ucs;
double BSIM4ute;
double BSIM4ucste;
double BSIM4voff;
double BSIM4tvoff;
double BSIM4minv;
@ -641,6 +645,7 @@ struct bsim4SizeDependParam
double BSIM4theta0vb0;
double BSIM4thetaRout;
double BSIM4mstar;
double BSIM4VgsteffVth;
double BSIM4mstarcv;
double BSIM4voffcbn;
double BSIM4voffcbncv;
@ -700,6 +705,9 @@ typedef struct sBSIM4model
char *BSIM4version;
double BSIM4eot;
double BSIM4vddeot;
double BSIM4tempeot;
double BSIM4leffeot;
double BSIM4weffeot;
double BSIM4ados;
double BSIM4bdos;
double BSIM4toxe;
@ -760,6 +768,7 @@ typedef struct sBSIM4model
double BSIM4dsub;
double BSIM4vth0;
double BSIM4eu;
double BSIM4ucs;
double BSIM4ua;
double BSIM4ua1;
double BSIM4ub;
@ -772,6 +781,7 @@ typedef struct sBSIM4model
double BSIM4lp;
double BSIM4u0;
double BSIM4ute;
double BSIM4ucste;
double BSIM4voff;
double BSIM4tvoff;
double BSIM4minv;
@ -858,6 +868,7 @@ typedef struct sBSIM4model
double BSIM4jtsswd;
double BSIM4jtsswgs;
double BSIM4jtsswgd;
double BSIM4jtweff;
double BSIM4njts;
double BSIM4njtssw;
double BSIM4njtsswg;
@ -1030,7 +1041,9 @@ typedef struct sBSIM4model
double BSIM4llp;
double BSIM4lu0;
double BSIM4leu;
double BSIM4lucs;
double BSIM4lute;
double BSIM4lucste;
double BSIM4lvoff;
double BSIM4ltvoff;
double BSIM4lminv;
@ -1175,7 +1188,9 @@ typedef struct sBSIM4model
double BSIM4wlp;
double BSIM4wu0;
double BSIM4weu;
double BSIM4wucs;
double BSIM4wute;
double BSIM4wucste;
double BSIM4wvoff;
double BSIM4wtvoff;
double BSIM4wminv;
@ -1320,7 +1335,9 @@ typedef struct sBSIM4model
double BSIM4plp;
double BSIM4pu0;
double BSIM4peu;
double BSIM4pucs;
double BSIM4pute;
double BSIM4pucste;
double BSIM4pvoff;
double BSIM4ptvoff;
double BSIM4pminv;
@ -1582,6 +1599,9 @@ typedef struct sBSIM4model
unsigned BSIM4toxrefGiven :1;
unsigned BSIM4eotGiven :1;
unsigned BSIM4vddeotGiven :1;
unsigned BSIM4tempeotGiven :1;
unsigned BSIM4leffeotGiven :1;
unsigned BSIM4weffeotGiven :1;
unsigned BSIM4adosGiven :1;
unsigned BSIM4bdosGiven :1;
unsigned BSIM4toxeGiven :1;
@ -1640,9 +1660,10 @@ typedef struct sBSIM4model
unsigned BSIM4dvt1wGiven :1;
unsigned BSIM4dvt2wGiven :1;
unsigned BSIM4droutGiven :1;
unsigned BSIM4dsubGiven :1;
unsigned BSIM4dsubGiven :1;
unsigned BSIM4vth0Given :1;
unsigned BSIM4euGiven :1;
unsigned BSIM4ucsGiven :1;
unsigned BSIM4uaGiven :1;
unsigned BSIM4ua1Given :1;
unsigned BSIM4ubGiven :1;
@ -1655,6 +1676,7 @@ typedef struct sBSIM4model
unsigned BSIM4lpGiven :1;
unsigned BSIM4u0Given :1;
unsigned BSIM4uteGiven :1;
unsigned BSIM4ucsteGiven :1;
unsigned BSIM4voffGiven :1;
unsigned BSIM4tvoffGiven :1;
unsigned BSIM4vofflGiven :1;
@ -1740,6 +1762,7 @@ typedef struct sBSIM4model
unsigned BSIM4jtsswdGiven :1;
unsigned BSIM4jtsswgsGiven :1;
unsigned BSIM4jtsswgdGiven :1;
unsigned BSIM4jtweffGiven :1;
unsigned BSIM4njtsGiven :1;
unsigned BSIM4njtsswGiven :1;
unsigned BSIM4njtsswgGiven :1;
@ -1913,7 +1936,9 @@ typedef struct sBSIM4model
unsigned BSIM4llpGiven :1;
unsigned BSIM4lu0Given :1;
unsigned BSIM4leuGiven :1;
unsigned BSIM4lucsGiven :1;
unsigned BSIM4luteGiven :1;
unsigned BSIM4lucsteGiven :1;
unsigned BSIM4lvoffGiven :1;
unsigned BSIM4ltvoffGiven :1;
unsigned BSIM4lminvGiven :1;
@ -2058,7 +2083,9 @@ typedef struct sBSIM4model
unsigned BSIM4wlpGiven :1;
unsigned BSIM4wu0Given :1;
unsigned BSIM4weuGiven :1;
unsigned BSIM4wucsGiven :1;
unsigned BSIM4wuteGiven :1;
unsigned BSIM4wucsteGiven :1;
unsigned BSIM4wvoffGiven :1;
unsigned BSIM4wtvoffGiven :1;
unsigned BSIM4wminvGiven :1;
@ -2203,7 +2230,9 @@ typedef struct sBSIM4model
unsigned BSIM4plpGiven :1;
unsigned BSIM4pu0Given :1;
unsigned BSIM4peuGiven :1;
unsigned BSIM4pucsGiven :1;
unsigned BSIM4puteGiven :1;
unsigned BSIM4pucsteGiven :1;
unsigned BSIM4pvoffGiven :1;
unsigned BSIM4ptvoffGiven :1;
unsigned BSIM4pminvGiven :1;
@ -2452,6 +2481,17 @@ typedef struct sBSIM4model
#define BSIM4_M 38
/* Global parameters */
#define BSIM4_MOD_TEMPEOT 66
#define BSIM4_MOD_LEFFEOT 67
#define BSIM4_MOD_WEFFEOT 68
#define BSIM4_MOD_UCSTE 69
#define BSIM4_MOD_LUCSTE 70
#define BSIM4_MOD_WUCSTE 71
#define BSIM4_MOD_PUCSTE 72
#define BSIM4_MOD_UCS 73
#define BSIM4_MOD_LUCS 74
#define BSIM4_MOD_WUCS 75
#define BSIM4_MOD_PUCS 76
#define BSIM4_MOD_CVCHARGEMOD 77
#define BSIM4_MOD_ADOS 78
#define BSIM4_MOD_BDOS 79
@ -3208,6 +3248,7 @@ typedef struct sBSIM4model
#define BSIM4_MOD_PUD1 925
#define BSIM4_MOD_PUP 926
#define BSIM4_MOD_PLP 927
#define BSIM4_MOD_JTWEFF 928
/* device questions */
#define BSIM4_DNODE 945

24
src/spicelib/devices/bsim4/bsim4ext.h

@ -5,6 +5,7 @@ Author: 2001- Xuemei Xi
File: bsim4ext.h
**********/
#ifdef __STDC__
extern int BSIM4acLoad(GENmodel *,CKTcircuit*);
extern int BSIM4ask(CKTcircuit *,GENinstance*,int,IFvalue*,IFvalue*);
extern int BSIM4convTest(GENmodel *,CKTcircuit*);
@ -28,3 +29,26 @@ extern int BSIM4temp(GENmodel*,CKTcircuit*);
extern int BSIM4trunc(GENmodel*,CKTcircuit*,double*);
extern int BSIM4noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
extern int BSIM4unsetup(GENmodel*,CKTcircuit*);
#else /* stdc */
extern int BSIM4acLoad();
extern int BSIM4delete();
extern void BSIM4destroy();
extern int BSIM4getic();
extern int BSIM4load();
extern int BSIM4mDelete();
extern int BSIM4ask();
extern int BSIM4mAsk();
extern int BSIM4convTest();
extern int BSIM4temp();
extern int BSIM4mParam();
extern void BSIM4mosCap();
extern int BSIM4param();
extern int BSIM4pzLoad();
extern int BSIM4setup();
extern int BSIM4trunc();
extern int BSIM4noise();
extern int BSIM4unsetup();
#endif /* stdc */

78
src/spicelib/devices/bsim4/bsim4itf.h

@ -4,10 +4,86 @@ Author: 2000 Weidong Liu.
Author: 2001- Xuemei Xi
File: bsim4itf.h
**********/
#ifdef DEV_bsim4
#ifndef DEV_BSIM4
#define DEV_BSIM4
SPICEdev *get_bsim4_info(void);
#include "bsim4ext.h"
extern IFparm BSIM4pTable[ ];
extern IFparm BSIM4mPTable[ ];
extern char *BSIM4names[ ];
extern int BSIM4pTSize;
extern int BSIM4mPTSize;
extern int BSIM4nSize;
extern int BSIM4iSize;
extern int BSIM4mSize;
SPICEdev B4info = {
{ "BSIM4",
"Berkeley Short Channel IGFET Model-4",
&BSIM4nSize,
&BSIM4nSize,
BSIM4names,
&BSIM4pTSize,
BSIM4pTable,
&BSIM4mPTSize,
BSIM4mPTable,
DEV_DEFAULT
},
BSIM4param,
BSIM4mParam,
BSIM4load,
BSIM4setup,
BSIM4unsetup,
BSIM4setup,
BSIM4temp,
BSIM4trunc,
NULL,
BSIM4acLoad,
NULL,
BSIM4destroy,
#ifdef DELETES
BSIM4mDelete,
BSIM4delete,
#else /* DELETES */
NULL,
NULL,
#endif /* DELETES */
BSIM4getic,
BSIM4ask,
BSIM4mAsk,
#ifdef AN_pz
BSIM4pzLoad,
#else /* AN_pz */
NULL,
#endif /* AN_pz */
#ifdef NEWCONV
BSIM4convTest,
#else /* NEWCONV */
NULL,
#endif /* NEWCONV */
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
#ifdef AN_noise
BSIM4noise,
#else /* AN_noise */
NULL,
#endif /* AN_noise */
&BSIM4iSize,
&BSIM4mSize
};
#endif
#endif

4
src/spicelib/parser/inpdomod.c

@ -324,7 +324,9 @@ char *INPdomodel(void *ckt, card * image, INPtables * tab)
}
if ( (strstr(ver, "default"))
|| (strstr(ver, "4.6")) || (strstr(ver, "4.6.0")) || (strstr(ver, "4.60"))
|| (strstr(ver, "4.6.1")) || (strstr(ver, "4.61")) ) {
|| (strstr(ver, "4.6.1")) || (strstr(ver, "4.61"))
|| (strstr(ver, "4.6.2")) || (strstr(ver, "4.62"))
|| (strstr(ver, "4.6.3")) || (strstr(ver, "4.63")) ) {
type = INPtypelook("BSIM4");
}
if (type < 0) {

Loading…
Cancel
Save