From a646a5f78fd547568351a1c36a70388184525579 Mon Sep 17 00:00:00 2001 From: dwarning Date: Mon, 19 May 2014 23:23:55 +0200 Subject: [PATCH] devices/bsim4, update to version 4.8 --- src/spicelib/devices/bsim4/b4.c | 6 +- src/spicelib/devices/bsim4/b4acld.c | 4 +- src/spicelib/devices/bsim4/b4ask.c | 4 +- src/spicelib/devices/bsim4/b4check.c | 74 +++++++-- src/spicelib/devices/bsim4/b4cvtest.c | 4 +- src/spicelib/devices/bsim4/b4del.c | 4 +- src/spicelib/devices/bsim4/b4dest.c | 4 +- src/spicelib/devices/bsim4/b4geo.c | 4 +- src/spicelib/devices/bsim4/b4getic.c | 2 +- src/spicelib/devices/bsim4/b4ld.c | 79 ++++++++-- src/spicelib/devices/bsim4/b4mask.c | 4 +- src/spicelib/devices/bsim4/b4mdel.c | 4 +- src/spicelib/devices/bsim4/b4mpar.c | 6 +- src/spicelib/devices/bsim4/b4noi.c | 10 +- src/spicelib/devices/bsim4/b4par.c | 4 +- src/spicelib/devices/bsim4/b4pzld.c | 4 +- src/spicelib/devices/bsim4/b4set.c | 160 ++++++++++++++----- src/spicelib/devices/bsim4/b4temp.c | 219 +++++++++++++++----------- src/spicelib/devices/bsim4/b4trunc.c | 4 +- src/spicelib/devices/bsim4/bsim4def.h | 10 +- src/spicelib/devices/bsim4/bsim4ext.h | 2 + src/spicelib/devices/bsim4/bsim4itf.h | 2 + tests/bsim4/nmos/qaSpec | 4 +- tests/bsim4/pmos/qaSpec | 4 +- 24 files changed, 434 insertions(+), 188 deletions(-) diff --git a/src/spicelib/devices/bsim4/b4.c b/src/spicelib/devices/bsim4/b4.c index ce7e479e5..1842af5f4 100644 --- a/src/spicelib/devices/bsim4/b4.c +++ b/src/spicelib/devices/bsim4/b4.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4.c of BSIM4.7.0. + * File: b4.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu @@ -19,6 +19,8 @@ * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. * Modified by Wenwei Yang, 07/31/2008. * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 + * Modified by Pankaj Kumar Thakur, 07/23/2012 + * Modified by Navid Paydavosi, 08/21/2013 **********/ #include "ngspice/ngspice.h" diff --git a/src/spicelib/devices/bsim4/b4acld.c b/src/spicelib/devices/bsim4/b4acld.c index ca363e394..9846a5c03 100644 --- a/src/spicelib/devices/bsim4/b4acld.c +++ b/src/spicelib/devices/bsim4/b4acld.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4acld.c of BSIM4.7.0. + * File: b4acld.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4ask.c b/src/spicelib/devices/bsim4/b4ask.c index e00155a37..21266d2fc 100644 --- a/src/spicelib/devices/bsim4/b4ask.c +++ b/src/spicelib/devices/bsim4/b4ask.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4ask.c of BSIM4.7.0. + * File: b4ask.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4check.c b/src/spicelib/devices/bsim4/b4check.c index dc5c8ec8e..343055f32 100644 --- a/src/spicelib/devices/bsim4/b4check.c +++ b/src/spicelib/devices/bsim4/b4check.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4check.c of BSIM4.7.0. + * File: b4check.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu @@ -18,6 +18,8 @@ * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. * Modified by Wenwei Yang, 07/31/2008 . * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 + * Modified by Pankaj Kumar Thakur, 07/23/2012 + * Modified by Navid Paydavosi, 08/21/2013 **********/ #include "ngspice/ngspice.h" @@ -46,9 +48,9 @@ FILE *fplog; fprintf(fplog, "\n"); fprintf(fplog, "++++++++++ BSIM4 PARAMETER CHECKING BELOW ++++++++++\n"); - if ((strcmp(model->BSIM4version, "4.7.0")) && (strcmp(model->BSIM4version, "4.70")) && (strcmp(model->BSIM4version, "4.7"))) - { fprintf(fplog, "Warning: This model is BSIM4.7.0; you specified a wrong version number.\n"); - printf("Warning: This model is BSIM4.7.0; you specified a wrong version number.\n"); + if ((strcmp(model->BSIM4version, "4.8.0")) && (strcmp(model->BSIM4version, "4.80")) && (strcmp(model->BSIM4version, "4.8"))) + { fprintf(fplog, "Warning: This model is BSIM4.8.0; you specified a wrong version number.\n"); + printf("Warning: This model is BSIM4.8.0; you specified a wrong version number.\n"); } fprintf(fplog, "Model = %s\n", model->BSIM4modName); @@ -66,10 +68,10 @@ FILE *fplog; printf("Fatal: Toxe = %g is not positive.\n", model->BSIM4toxe); Fatal_Flag = 1; } - if (model->BSIM4toxp <= 0.0) + if (here->BSIM4toxp <= 0.0) { fprintf(fplog, "Fatal: Toxp = %g is not positive.\n", - model->BSIM4toxp); - printf("Fatal: Toxp = %g is not positive.\n", model->BSIM4toxp); + here->BSIM4toxp); + printf("Fatal: Toxp = %g is not positive.\n", here->BSIM4toxp); Fatal_Flag = 1; } if (model->BSIM4eot <= 0.0) @@ -453,10 +455,10 @@ FILE *fplog; model->BSIM4toxe); printf("Warning: Toxe = %g is less than 1A. Recommended Toxe >= 5A\n", model->BSIM4toxe); } - if (model->BSIM4toxp < 1.0e-10) + if (here->BSIM4toxp < 1.0e-10) { fprintf(fplog, "Warning: Toxp = %g is less than 1A. Recommended Toxp >= 5A\n", - model->BSIM4toxp); - printf("Warning: Toxp = %g is less than 1A. Recommended Toxp >= 5A\n", model->BSIM4toxp); + here->BSIM4toxp); + printf("Warning: Toxp = %g is less than 1A. Recommended Toxp >= 5A\n", here->BSIM4toxp); } if (model->BSIM4toxm < 1.0e-10) { fprintf(fplog, "Warning: Toxm = %g is less than 1A. Recommended Toxm >= 5A\n", @@ -669,6 +671,56 @@ FILE *fplog; printf("Warning: xrcrg1 should be positive for rgateMod = 3.\n"); } + /* Check body resistance parameters */ + if (model->BSIM4rbps0 <= 0.0) + { fprintf(fplog, "Fatal: RBPS0 = %g is not positive.\n", + model->BSIM4rbps0 ); + printf("Fatal: RBPS0 = %g is not positive.\n", model->BSIM4rbps0); + Fatal_Flag = 1; + } + if (model->BSIM4rbpd0 <= 0.0) + { fprintf(fplog, "Fatal: RBPD0 = %g is not positive.\n", + model->BSIM4rbpd0 ); + printf("Fatal: RBPD0 = %g is not positive.\n", model->BSIM4rbpd0); + Fatal_Flag = 1; + } + if (model->BSIM4rbpbx0 <= 0.0) + { fprintf(fplog, "Fatal: RBPBX0 = %g is not positive.\n", + model->BSIM4rbpbx0); + printf("Fatal: RBPBX0 = %g is not positive.\n", model->BSIM4rbpbx0); + Fatal_Flag = 1; + } + if (model->BSIM4rbpby0 <= 0.0) + { fprintf(fplog, "Fatal: RBPBY0 = %g is not positive.\n", + model->BSIM4rbpby0); + printf("Fatal: RBPBY0 = %g is not positive.\n", model->BSIM4rbpby0); + Fatal_Flag = 1; + } + if (model->BSIM4rbdbx0 <= 0.0) + { fprintf(fplog, "Fatal: RBDBX0 = %g is not positive.\n", + model->BSIM4rbdbx0); + printf("Fatal: RBDBX0 = %g is not positive.\n", model->BSIM4rbdbx0); + Fatal_Flag = 1; + } + if (model->BSIM4rbdby0 <= 0.0) + { fprintf(fplog, "Fatal: RBDBY0 = %g is not positive.\n", + model->BSIM4rbdby0); + printf("Fatal: RBDBY0 = %g is not positive.\n", model->BSIM4rbdby0); + Fatal_Flag = 1; + } + if (model->BSIM4rbsbx0 <= 0.0) + { fprintf(fplog, "Fatal: RBSBX0 = %g is not positive.\n", + model->BSIM4rbsbx0); + printf("Fatal: RBSBX0 = %g is not positive.\n", model->BSIM4rbsbx0); + Fatal_Flag = 1; + } + if (model->BSIM4rbsby0 <= 0.0) + { fprintf(fplog, "Fatal: RBSBY0 = %g is not positive.\n", + model->BSIM4rbsby0); + printf("Fatal: RBSBY0 = %g is not positive.\n", model->BSIM4rbsby0); + Fatal_Flag = 1; + } + /* Check capacitance parameters */ if (pParam->BSIM4noff < 0.1) { fprintf(fplog, "Warning: Noff = %g is too small.\n", diff --git a/src/spicelib/devices/bsim4/b4cvtest.c b/src/spicelib/devices/bsim4/b4cvtest.c index 4a21c43f8..b621f4ead 100644 --- a/src/spicelib/devices/bsim4/b4cvtest.c +++ b/src/spicelib/devices/bsim4/b4cvtest.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4cvtest.c of BSIM4.7.0. + * File: b4cvtest.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4del.c b/src/spicelib/devices/bsim4/b4del.c index b20a7e522..e0fc57bb4 100644 --- a/src/spicelib/devices/bsim4/b4del.c +++ b/src/spicelib/devices/bsim4/b4del.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4del.c of BSIM4.7.0. + * File: b4del.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4dest.c b/src/spicelib/devices/bsim4/b4dest.c index 00e1f2163..09badaf2c 100644 --- a/src/spicelib/devices/bsim4/b4dest.c +++ b/src/spicelib/devices/bsim4/b4dest.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4dest.c of BSIM4.7.0. + * File: b4dest.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4geo.c b/src/spicelib/devices/bsim4/b4geo.c index 4ef573c18..ec1833f87 100644 --- a/src/spicelib/devices/bsim4/b4geo.c +++ b/src/spicelib/devices/bsim4/b4geo.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4geo.c of BSIM4.7.0. + * File: b4geo.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4getic.c b/src/spicelib/devices/bsim4/b4getic.c index 437a0de13..96854f2a9 100644 --- a/src/spicelib/devices/bsim4/b4getic.c +++ b/src/spicelib/devices/bsim4/b4getic.c @@ -1,4 +1,4 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. diff --git a/src/spicelib/devices/bsim4/b4ld.c b/src/spicelib/devices/bsim4/b4ld.c index 73b1a6909..c5b48b897 100644 --- a/src/spicelib/devices/bsim4/b4ld.c +++ b/src/spicelib/devices/bsim4/b4ld.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /**** OpenMP support ngspice 06/28/2010 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4ld.c of BSIM4.7.0. + * File: b4ld.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu @@ -19,6 +19,8 @@ * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. * Modified by Wenwei Yang, 07/31/2008. * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 + * Modified by Pankaj Kumar Thakur, 07/23/2012 + * Modified by Navid Paydavosi, 08/21/2013 **********/ @@ -1476,7 +1478,6 @@ for (; model != NULL; model = model->BSIM4nextModel) T1 = exp(pParam->BSIM4eu * log(T0)); dT1_dVg = T1 * pParam->BSIM4eu / T0 / toxe; T2 = pParam->BSIM4ua + pParam->BSIM4uc * Vbseff; - T3 = T0 / toxe; /*Do we need it?*/ T12 = sqrt(Vth * Vth + 0.0001); T9 = 1.0/(Vgsteff + 2*T12); @@ -1491,6 +1492,60 @@ for (; model != NULL; model = model->BSIM4nextModel) dDenomi_dVd = T13 * dVth_dVd; dDenomi_dVb = T13 * dVth_dVb + T1 * pParam->BSIM4uc; } + else if (model->BSIM4mobMod == 4) /* Synopsys 08/30/2013 add */ + { + T0 = Vgsteff + here->BSIM4vtfbphi1 - T14; + T2 = pParam->BSIM4ua + pParam->BSIM4uc * Vbseff; + T3 = T0 / toxe; + T12 = sqrt(here->BSIM4vtfbphi1*here->BSIM4vtfbphi1 + 0.0001); + T9 = 1.0/(Vgsteff + 2*T12); + T10 = T9*toxe; + T8 = pParam->BSIM4ud * T10 * T10 * here->BSIM4vtfbphi1; + T6 = T8 * here->BSIM4vtfbphi1; + T5 = T3 * (T2 + pParam->BSIM4ub * T3) + T6; + T7 = - 2.0 * T6 * T9; + dDenomi_dVg = (T2 + 2.0 * pParam->BSIM4ub * T3) / toxe; + dDenomi_dVd = 0.0; + dDenomi_dVb = pParam->BSIM4uc * T3; + dDenomi_dVg+= T7; + } + else if (model->BSIM4mobMod == 5) /* Synopsys 08/30/2013 add */ + { + T0 = Vgsteff + here->BSIM4vtfbphi1 - T14; + T2 = 1.0 + pParam->BSIM4uc * Vbseff; + T3 = T0 / toxe; + T4 = T3 * (pParam->BSIM4ua + pParam->BSIM4ub * T3); + T12 = sqrt(here->BSIM4vtfbphi1 * here->BSIM4vtfbphi1 + 0.0001); + T9 = 1.0/(Vgsteff + 2*T12); + T10 = T9*toxe; + T8 = pParam->BSIM4ud * T10 * T10 * here->BSIM4vtfbphi1; + T6 = T8 * here->BSIM4vtfbphi1; + T5 = T4 * T2 + T6; + T7 = - 2.0 * T6 * T9; + dDenomi_dVg = (pParam->BSIM4ua + 2.0 * pParam->BSIM4ub * T3) * T2 + / toxe; + dDenomi_dVd = 0.0; + dDenomi_dVb = pParam->BSIM4uc * T4; + dDenomi_dVg+= T7; + } + else if (model->BSIM4mobMod == 6) /* Synopsys 08/30/2013 modify */ + { T0 = (Vgsteff + here->BSIM4vtfbphi1) / toxe; + T1 = exp(pParam->BSIM4eu * log(T0)); + dT1_dVg = T1 * pParam->BSIM4eu / T0 / toxe; + T2 = pParam->BSIM4ua + pParam->BSIM4uc * Vbseff; + + T12 = sqrt(here->BSIM4vtfbphi1 * here->BSIM4vtfbphi1 + 0.0001); + T9 = 1.0/(Vgsteff + 2*T12); + T10 = T9*toxe; + T8 = pParam->BSIM4ud * T10 * T10 * here->BSIM4vtfbphi1; + T6 = T8 * here->BSIM4vtfbphi1; + T5 = T1 * T2 + T6; + T7 = - 2.0 * T6 * T9; + dDenomi_dVg = T2 * dT1_dVg + T7; + dDenomi_dVd = 0; + dDenomi_dVb = T1 * pParam->BSIM4uc; + } + /*high K mobility*/ else { @@ -1752,7 +1807,7 @@ for (; model != NULL; model = model->BSIM4nextModel) /* Calculate Idl first */ tmp1 = here->BSIM4vtfbphi2; - tmp2 = 2.0e8 * model->BSIM4toxp; + tmp2 = 2.0e8 * here->BSIM4toxp; dT0_dVg = 1.0 / tmp2; T0 = (Vgsteff + tmp1) * dT0_dVg; @@ -1762,8 +1817,8 @@ for (; model != NULL; model = model->BSIM4nextModel) Tcen = model->BSIM4ados * 1.9e-9 / T1; dTcen_dVg = -Tcen * T2 * dT0_dVg / T1; - Coxeff = epssub * model->BSIM4coxp - / (epssub + model->BSIM4coxp * Tcen); + Coxeff = epssub * here->BSIM4coxp + / (epssub + here->BSIM4coxp * Tcen); here->BSIM4Coxeff = Coxeff; dCoxeff_dVg = -Coxeff * Coxeff * dTcen_dVg / epssub; @@ -2528,8 +2583,8 @@ for (; model != NULL; model = model->BSIM4nextModel) dVaux_dVd = 0.0; dVaux_dVb = 0.0; } else if (model->BSIM4igcMod == 2) { - dVaux_dVd = -dVgs_eff_dVg * dVth_dVd; - dVaux_dVb = -dVgs_eff_dVg * dVth_dVb; + dVaux_dVd = -dVaux_dVg* dVth_dVd; /* Synopsys 08/30/2013 modify */ + dVaux_dVb = -dVaux_dVg* dVth_dVb; /* Synopsys 08/30/2013 modify */ } dVaux_dVg *= dVgs_eff_dVg; } @@ -2590,7 +2645,7 @@ for (; model != NULL; model = model->BSIM4nextModel) dT7_dVd = -Vdseff * dPigcd_dVd - Pigcd * dVdseff_dVd + dT7_dVg * dVgsteff_dVd; dT7_dVb = -Vdseff * dPigcd_dVb - Pigcd * dVdseff_dVb + dT7_dVg * dVgsteff_dVb; dT7_dVg *= dVgsteff_dVg; - dT7_dVb *= dVbseff_dVb; + /*dT7_dVb *= dVbseff_dVb;*/ /* Synopsys, 2013/08/30 */ T8 = T7 * T7 + 2.0e-4; dT8_dVg = 2.0 * T7; dT8_dVd = dT8_dVg * dT7_dVd; @@ -3563,8 +3618,8 @@ for (; model != NULL; model = model->BSIM4nextModel) dVfbeff_dVg = T1 * dVgs_eff_dVg; dVfbeff_dVb = -T1 * dVbseffCV_dVb; - Cox = model->BSIM4coxp; - Tox = 1.0e8 * model->BSIM4toxp; + Cox = here->BSIM4coxp; + Tox = 1.0e8 * here->BSIM4toxp; T0 = (Vgs_eff - VbseffCV - here->BSIM4vfbzb) / Tox; dT0_dVg = dVgs_eff_dVg / Tox; dT0_dVb = -dVbseffCV_dVb / Tox; @@ -3585,7 +3640,7 @@ for (; model != NULL; model = model->BSIM4nextModel) dTcen_dVg = dTcen_dVb = 0.0; } - LINK = 1.0e-3 * model->BSIM4toxp; + LINK = 1.0e-3 * here->BSIM4toxp; V3 = pParam->BSIM4ldeb - Tcen - LINK; V4 = sqrt(V3 * V3 + 4.0 * LINK * pParam->BSIM4ldeb); Tcen = pParam->BSIM4ldeb - 0.5 * (V3 + V4); diff --git a/src/spicelib/devices/bsim4/b4mask.c b/src/spicelib/devices/bsim4/b4mask.c index 5c5b3f7e6..6cd7e8816 100644 --- a/src/spicelib/devices/bsim4/b4mask.c +++ b/src/spicelib/devices/bsim4/b4mask.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4mask.c of BSIM4.7.0. + * File: b4mask.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4mdel.c b/src/spicelib/devices/bsim4/b4mdel.c index 71f23ed00..7dc2918ec 100644 --- a/src/spicelib/devices/bsim4/b4mdel.c +++ b/src/spicelib/devices/bsim4/b4mdel.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4mdel.c of BSIM4.7.0. + * File: b4mdel.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4mpar.c b/src/spicelib/devices/bsim4/b4mpar.c index 7fc0e25ce..2f91afdcf 100644 --- a/src/spicelib/devices/bsim4/b4mpar.c +++ b/src/spicelib/devices/bsim4/b4mpar.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4mpar.c of BSIM4.7.0. + * File: b4mpar.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu @@ -19,6 +19,8 @@ * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. * Modified by Wenwei Yang, 07/31/2008. * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 + * Modified by Pankaj Kumar Thakur, 07/23/2012 + * Modified by Navid Paydavosi, 08/21/2013 **********/ #include "ngspice/ngspice.h" diff --git a/src/spicelib/devices/bsim4/b4noi.c b/src/spicelib/devices/bsim4/b4noi.c index 57f8c043d..40a044efc 100644 --- a/src/spicelib/devices/bsim4/b4noi.c +++ b/src/spicelib/devices/bsim4/b4noi.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4noi.c of BSIM4.7.0. + * File: b4noi.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu @@ -17,6 +17,7 @@ * Modified by Mohan Dunga, 12/13/2006 * Modified by Wenwei Yang, 07/31/2008. * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 + * Modified by Pankaj Kumar Thakur, 07/23/2012 **********/ #include "ngspice/ngspice.h" @@ -392,9 +393,10 @@ double m; Leff = pParam->BSIM4leff; Lvsat = Leff * (1.0 + here->BSIM4Vdseff / here->BSIM4EsatL); T6 = Leff / Lvsat; - - T5 = here->BSIM4Vgsteff / here->BSIM4EsatL; + /*Unwanted code for T5 commented*/ + /*T5 = here->BSIM4Vgsteff / here->BSIM4EsatL; T5 = T5 * T5; + */ gamma = T6 * (0.5 * T1 + T0 * T0 / (6.0 * T2)); T3 = T2 * T2; T4 = T0 * T0; diff --git a/src/spicelib/devices/bsim4/b4par.c b/src/spicelib/devices/bsim4/b4par.c index 4812242f6..6a2fa7ca4 100644 --- a/src/spicelib/devices/bsim4/b4par.c +++ b/src/spicelib/devices/bsim4/b4par.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4par.c of BSIM4.7.0. + * File: b4par.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4pzld.c b/src/spicelib/devices/bsim4/b4pzld.c index 7307bf081..3da2a9ebf 100644 --- a/src/spicelib/devices/bsim4/b4pzld.c +++ b/src/spicelib/devices/bsim4/b4pzld.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4pzld.c of BSIM4.7.0. + * File: b4pzld.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index 96790106e..9dbfb389c 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4set.c of BSIM4.7.0. + * File: b4set.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu @@ -19,6 +19,8 @@ * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. * Modified by Wenwei Yang, 07/31/2008. * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 + * Modified by Pankaj Kumar Thakur, 07//2012 + * Modified by Navid Paydavosi, 06/12/2013 **********/ #include "ngspice/ngspice.h" @@ -79,8 +81,8 @@ BSIM4instance **InstArray; if (!model->BSIM4mobModGiven) model->BSIM4mobMod = 0; - else if ((model->BSIM4mobMod != 0) && (model->BSIM4mobMod != 1) - && (model->BSIM4mobMod != 2)&& (model->BSIM4mobMod != 3)) + else if ((model->BSIM4mobMod != 0) && (model->BSIM4mobMod != 1)&& (model->BSIM4mobMod != 2)&& (model->BSIM4mobMod != 3) + && (model->BSIM4mobMod != 4) && (model->BSIM4mobMod != 5) && (model->BSIM4mobMod != 6)) /* Synopsys 08/30/2013 modify */ { model->BSIM4mobMod = 0; printf("Warning: mobMod has been set to its default value: 0.\n"); } @@ -208,7 +210,7 @@ BSIM4instance **InstArray; } if (!model->BSIM4versionGiven) - model->BSIM4version = copy("4.7.0"); + model->BSIM4version = copy("4.8.0"); if (!model->BSIM4toxrefGiven) model->BSIM4toxref = 30.0e-10; if (!model->BSIM4eotGiven) @@ -408,7 +410,6 @@ BSIM4instance **InstArray; 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) @@ -460,35 +461,57 @@ BSIM4instance **InstArray; if (!model->BSIM4kgidlGiven) /* v4.7 New GIDL/GISL */ model->BSIM4kgidl = 0.0; if (!model->BSIM4fgidlGiven) /* v4.7 New GIDL/GISL */ - model->BSIM4fgidl = 0.0; - if (!model->BSIM4agislGiven) + /*model->BSIM4fgidl = 0.0;*/ + /* Default value of fgdil set to 1 in BSIM4.8.0*/ + model->BSIM4fgidl = 1.0; + + /*if (!model->BSIM4agislGiven) { if (model->BSIM4agidlGiven) model->BSIM4agisl = model->BSIM4agidl; else model->BSIM4agisl = 0.0; - } - if (!model->BSIM4bgislGiven) + }*/ + + /*Default value of agidl being 0, agisl set as follows */ + + /*if (!model->BSIM4bgislGiven) { if (model->BSIM4bgidlGiven) model->BSIM4bgisl = model->BSIM4bgidl; else - model->BSIM4bgisl = 2.3e9; /* V/m */ - } - if (!model->BSIM4cgislGiven) + model->BSIM4bgisl = 2.3e9; + }*/ + + /*Default value of bgidl being 2.3e9, bgisl set as follows */ + + /*if (!model->BSIM4cgislGiven) { if (model->BSIM4cgidlGiven) model->BSIM4cgisl = model->BSIM4cgidl; else - model->BSIM4cgisl = 0.5; /* V^3 */ - } - if (!model->BSIM4egislGiven) + model->BSIM4cgisl = 0.5; + }*/ + + /*Default value of cgidl being 0.5, cgisl set as follows */ + + /*if (!model->BSIM4egislGiven) { if (model->BSIM4egidlGiven) model->BSIM4egisl = model->BSIM4egidl; else - model->BSIM4egisl = 0.8; /* V */ - } + model->BSIM4egisl = 0.8; + }*/ + + /*Default value of agisl, bgisl, cgisl, egisl, rgisl, kgisl, and fgisl are set as follows */ + if (!model->BSIM4agislGiven) + model->BSIM4agisl = model->BSIM4agidl; + if (!model->BSIM4bgislGiven) + model->BSIM4bgisl = model->BSIM4bgidl; + if (!model->BSIM4cgislGiven) + model->BSIM4cgisl = model->BSIM4cgidl; + if (!model->BSIM4egislGiven) + model->BSIM4egisl = model->BSIM4egidl; if (!model->BSIM4rgislGiven) /* v4.7 New GIDL/GISL */ model->BSIM4rgisl = model->BSIM4rgidl; if (!model->BSIM4kgislGiven) /* v4.7 New GIDL/GISL */ @@ -786,12 +809,16 @@ BSIM4instance **InstArray; model->BSIM4lvbm = 0.0; if (!model->BSIM4lxtGiven) model->BSIM4lxt = 0.0; + if (!model->BSIM4lk1Given) + model->BSIM4lk1 = 0.0; if (!model->BSIM4lkt1Given) model->BSIM4lkt1 = 0.0; if (!model->BSIM4lkt1lGiven) model->BSIM4lkt1l = 0.0; if (!model->BSIM4lkt2Given) model->BSIM4lkt2 = 0.0; + if (!model->BSIM4lk2Given) + model->BSIM4lk2 = 0.0; if (!model->BSIM4lk3Given) model->BSIM4lk3 = 0.0; if (!model->BSIM4lk3bGiven) @@ -932,8 +959,7 @@ BSIM4instance **InstArray; model->BSIM4lkgidl = 0.0; if (!model->BSIM4lfgidlGiven) /* v4.7 New GIDL/GISL */ model->BSIM4lfgidl = 0.0; - - if (!model->BSIM4lagislGiven) + /*if (!model->BSIM4lagislGiven) { if (model->BSIM4lagidlGiven) model->BSIM4lagisl = model->BSIM4lagidl; @@ -960,22 +986,39 @@ BSIM4instance **InstArray; model->BSIM4legisl = model->BSIM4legidl; else model->BSIM4legisl = 0.0; - } - if (!model->BSIM4lrgislGiven) /* v4.7 New GIDL/GISL */ + }*/ + /*if (!model->BSIM4lrgislGiven) { if (model->BSIM4lrgidlGiven) model->BSIM4lrgisl = model->BSIM4lrgidl; } - if (!model->BSIM4lkgislGiven) /* v4.7 New GIDL/GISL */ + if (!model->BSIM4lkgislGiven) { if (model->BSIM4lkgidlGiven) model->BSIM4lkgisl = model->BSIM4lkgidl; } - if (!model->BSIM4lfgislGiven) /* v4.7 New GIDL/GISL */ + if (!model->BSIM4lfgislGiven) { if (model->BSIM4lfgidlGiven) model->BSIM4lfgisl = model->BSIM4lfgidl; - } + }*/ + + /*Default value of lagisl, lbgisl, lcgisl, legisl, lrgisl, lkgisl, and lfgisl are set as follows */ + if (!model->BSIM4lagislGiven) + model->BSIM4lagisl = model->BSIM4lagidl; + if (!model->BSIM4lbgislGiven) + model->BSIM4lbgisl = model->BSIM4lbgidl; + if (!model->BSIM4lcgislGiven) + model->BSIM4lcgisl = model->BSIM4lcgidl; + if (!model->BSIM4legislGiven) + model->BSIM4legisl = model->BSIM4legidl; + if (!model->BSIM4lrgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4lrgisl = model->BSIM4lrgidl; + if (!model->BSIM4lkgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4lkgisl = model->BSIM4lkgidl; + if (!model->BSIM4lfgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4lfgisl = model->BSIM4lfgidl; + if (!model->BSIM4laigcGiven) model->BSIM4laigc = 0.0; if (!model->BSIM4lbigcGiven) @@ -1143,12 +1186,16 @@ BSIM4instance **InstArray; model->BSIM4wvbm = 0.0; if (!model->BSIM4wxtGiven) model->BSIM4wxt = 0.0; + if (!model->BSIM4wk1Given) + model->BSIM4wk1 = 0.0; if (!model->BSIM4wkt1Given) model->BSIM4wkt1 = 0.0; if (!model->BSIM4wkt1lGiven) model->BSIM4wkt1l = 0.0; if (!model->BSIM4wkt2Given) model->BSIM4wkt2 = 0.0; + if (!model->BSIM4wk2Given) + model->BSIM4wk2 = 0.0; if (!model->BSIM4wk3Given) model->BSIM4wk3 = 0.0; if (!model->BSIM4wk3bGiven) @@ -1290,7 +1337,7 @@ BSIM4instance **InstArray; if (!model->BSIM4wfgidlGiven) /* v4.7 New GIDL/GISL */ model->BSIM4wfgidl = 0.0; - if (!model->BSIM4wagislGiven) + /*if (!model->BSIM4wagislGiven) { if (model->BSIM4wagidlGiven) model->BSIM4wagisl = model->BSIM4wagidl; @@ -1317,22 +1364,39 @@ BSIM4instance **InstArray; model->BSIM4wegisl = model->BSIM4wegidl; else model->BSIM4wegisl = 0.0; - } - if (!model->BSIM4wrgislGiven) /* v4.7 New GIDL/GISL */ + }*/ + /*if (!model->BSIM4wrgislGiven) { if (model->BSIM4wrgidlGiven) model->BSIM4wrgisl = model->BSIM4wrgidl; } - if (!model->BSIM4wkgislGiven) /* v4.7 New GIDL/GISL */ + if (!model->BSIM4wkgislGiven) { if (model->BSIM4wkgidlGiven) model->BSIM4wkgisl = model->BSIM4wkgidl; } - if (!model->BSIM4wfgislGiven) /* v4.7 New GIDL/GISL */ + if (!model->BSIM4wfgislGiven) { if (model->BSIM4wfgidlGiven) model->BSIM4wfgisl = model->BSIM4wfgidl; - } + }*/ + + /*Default value of wagisl, wbgisl, wcgisl, wegisl, wrgisl, wkgisl, and wfgisl are set as follows */ + if (!model->BSIM4wagislGiven) + model->BSIM4wagisl = model->BSIM4wagidl; + if (!model->BSIM4wbgislGiven) + model->BSIM4wbgisl = model->BSIM4wbgidl; + if (!model->BSIM4wcgislGiven) + model->BSIM4wcgisl = model->BSIM4wcgidl; + if (!model->BSIM4wegislGiven) + model->BSIM4wegisl = model->BSIM4wegidl; + if (!model->BSIM4wrgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4wrgisl = model->BSIM4wrgidl; + if (!model->BSIM4wkgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4wkgisl = model->BSIM4wkgidl; + if (!model->BSIM4wfgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4wfgisl = model->BSIM4wfgidl; + if (!model->BSIM4waigcGiven) model->BSIM4waigc = 0.0; if (!model->BSIM4wbigcGiven) @@ -1500,10 +1564,14 @@ BSIM4instance **InstArray; model->BSIM4pvbm = 0.0; if (!model->BSIM4pxtGiven) model->BSIM4pxt = 0.0; + if (!model->BSIM4pk1Given) + model->BSIM4pk1 = 0.0; if (!model->BSIM4pkt1Given) model->BSIM4pkt1 = 0.0; if (!model->BSIM4pkt1lGiven) model->BSIM4pkt1l = 0.0; + if (!model->BSIM4pk2Given) + model->BSIM4pk2 = 0.0; if (!model->BSIM4pkt2Given) model->BSIM4pkt2 = 0.0; if (!model->BSIM4pk3Given) @@ -1647,7 +1715,7 @@ BSIM4instance **InstArray; if (!model->BSIM4pfgidlGiven) /* v4.7 New GIDL/GISL */ model->BSIM4pfgidl = 0.0; - if (!model->BSIM4pagislGiven) + /*if (!model->BSIM4pagislGiven) { if (model->BSIM4pagidlGiven) model->BSIM4pagisl = model->BSIM4pagidl; @@ -1674,22 +1742,39 @@ BSIM4instance **InstArray; model->BSIM4pegisl = model->BSIM4pegidl; else model->BSIM4pegisl = 0.0; - } - if (!model->BSIM4prgislGiven) /* v4.7 New GIDL/GISL */ + }*/ + + /*if (!model->BSIM4prgislGiven) { if (model->BSIM4prgidlGiven) model->BSIM4prgisl = model->BSIM4prgidl; } - if (!model->BSIM4pkgislGiven) /* v4.7 New GIDL/GISL */ + if (!model->BSIM4pkgislGiven) { if (model->BSIM4pkgidlGiven) model->BSIM4pkgisl = model->BSIM4pkgidl; } - if (!model->BSIM4pfgislGiven) /* v4.7 New GIDL/GISL */ + if (!model->BSIM4pfgislGiven) { if (model->BSIM4pfgidlGiven) model->BSIM4pfgisl = model->BSIM4pfgidl; - } + }*/ + + /*Default value of pagisl, pbgisl, pcgisl, pegisl, prgisl, pkgisl, and pfgisl are set as follows */ + if (!model->BSIM4pagislGiven) + model->BSIM4pagisl = model->BSIM4pagidl; + if (!model->BSIM4pbgislGiven) + model->BSIM4pbgisl = model->BSIM4pbgidl; + if (!model->BSIM4pcgislGiven) + model->BSIM4pcgisl = model->BSIM4pcgidl; + if (!model->BSIM4pegislGiven) + model->BSIM4pegisl = model->BSIM4pegidl; + if (!model->BSIM4prgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4prgisl = model->BSIM4prgidl; + if (!model->BSIM4pkgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4pkgisl = model->BSIM4pkgidl; + if (!model->BSIM4pfgislGiven) /* v4.7 New GIDL/GISL */ + model->BSIM4pfgisl = model->BSIM4pfgidl; if (!model->BSIM4paigcGiven) model->BSIM4paigc = 0.0; if (!model->BSIM4pbigcGiven) @@ -2521,7 +2606,6 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL TSTALLOC(BSIM4GEdpPtr, BSIM4gNodeExt, BSIM4dNodePrime); TSTALLOC(BSIM4GEspPtr, BSIM4gNodeExt, BSIM4sNodePrime); TSTALLOC(BSIM4GEbpPtr, BSIM4gNodeExt, BSIM4bNodePrime); - TSTALLOC(BSIM4GMdpPtr, BSIM4gNodeMid, BSIM4dNodePrime); TSTALLOC(BSIM4GMgpPtr, BSIM4gNodeMid, BSIM4gNodePrime); TSTALLOC(BSIM4GMgmPtr, BSIM4gNodeMid, BSIM4gNodeMid); diff --git a/src/spicelib/devices/bsim4/b4temp.c b/src/spicelib/devices/bsim4/b4temp.c index ba0c840f8..eb1367a7e 100644 --- a/src/spicelib/devices/bsim4/b4temp.c +++ b/src/spicelib/devices/bsim4/b4temp.c @@ -1,4 +1,4 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. @@ -19,6 +19,7 @@ * Modified by Mohan Dunga, Wenwei Yang, 05/18/2007. * Modified by Wenwei Yang, 07/31/2008. * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 + * Modified by Pankaj Kumar Thakur, 07/23/2012 **********/ @@ -851,6 +852,10 @@ int Size_Not_Found, i; + model->BSIM4lteta0 * Inv_L + model->BSIM4wteta0 * Inv_W + model->BSIM4pteta0 * Inv_LW; + pParam->BSIM4tvoffcv = model->BSIM4tvoffcv /* v4.8.0 */ + + model->BSIM4ltvoffcv * Inv_L + + model->BSIM4wtvoffcv * Inv_W + + model->BSIM4ptvoffcv * Inv_LW; pParam->BSIM4etab = model->BSIM4etab + model->BSIM4letab * Inv_L + model->BSIM4wetab * Inv_W @@ -983,6 +988,18 @@ int Size_Not_Found, i; + model->BSIM4lcigc * Inv_L + model->BSIM4wcigc * Inv_W + model->BSIM4pcigc * Inv_LW; + pParam->BSIM4aigsd = model->BSIM4aigsd + + model->BSIM4laigsd * Inv_L + + model->BSIM4waigsd * Inv_W + + model->BSIM4paigsd * Inv_LW; + pParam->BSIM4bigsd = model->BSIM4bigsd + + model->BSIM4lbigsd * Inv_L + + model->BSIM4wbigsd * Inv_W + + model->BSIM4pbigsd * Inv_LW; + pParam->BSIM4cigsd = model->BSIM4cigsd + + model->BSIM4lcigsd * Inv_L + + model->BSIM4wcigsd * Inv_W + + model->BSIM4pcigsd * Inv_LW; pParam->BSIM4aigs = model->BSIM4aigs + model->BSIM4laigs * Inv_L + model->BSIM4waigs * Inv_W @@ -1542,6 +1559,57 @@ int Size_Not_Found, i; pParam->BSIM4inv_od_ref = Inv_saref + Inv_sbref; pParam->BSIM4rho_ref = model->BSIM4ku0 / pParam->BSIM4ku0temp * pParam->BSIM4inv_od_ref; + /*high k*/ + /*Calculate VgsteffVth for mobMod=3*/ + if(model->BSIM4mobMod==3) + { /*Calculate n @ Vbs=Vds=0*/ + lt1 = model->BSIM4factor1* pParam->BSIM4sqrtXdep0; + 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; + 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 * model->BSIM4vtm; + 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; + } + + /* New DITS term added in 4.7 */ + T0 = -pParam->BSIM4dvtp3 * log(pParam->BSIM4leff); + DEXP(T0, T1); + pParam->BSIM4dvtp2factor = pParam->BSIM4dvtp5 + pParam->BSIM4dvtp2 * T1; + } /* End of SizeNotFound */ /* stress effect */ @@ -1699,37 +1767,60 @@ int Size_Not_Found, i; if(here->BSIM4rbodyMod == 2) { - if (bodymode == 5) - { - rbsbx = exp( log(model->BSIM4rbsbx0) + model->BSIM4rbsdbxl * lnl + - model->BSIM4rbsdbxw * lnw + model->BSIM4rbsdbxnf * lnnf ); - rbsby = exp( log(model->BSIM4rbsby0) + model->BSIM4rbsdbyl * lnl + - model->BSIM4rbsdbyw * lnw + model->BSIM4rbsdbynf * lnnf ); - here->BSIM4rbsb = rbsbx * rbsby / (rbsbx + rbsby); - - - rbdbx = exp( log(model->BSIM4rbdbx0) + model->BSIM4rbsdbxl * lnl + - model->BSIM4rbsdbxw * lnw + model->BSIM4rbsdbxnf * lnnf ); - rbdby = exp( log(model->BSIM4rbdby0) + model->BSIM4rbsdbyl * lnl + - model->BSIM4rbsdbyw * lnw + model->BSIM4rbsdbynf * lnnf ); - here->BSIM4rbdb = rbdbx * rbdby / (rbdbx + rbdby); - } + if (bodymode == 5) + { + /*rbsbx = exp( log(model->BSIM4rbsbx0) + model->BSIM4rbsdbxl * lnl + + model->BSIM4rbsdbxw * lnw + model->BSIM4rbsdbxnf * lnnf ); + rbsby = exp( log(model->BSIM4rbsby0) + model->BSIM4rbsdbyl * lnl + + model->BSIM4rbsdbyw * lnw + model->BSIM4rbsdbynf * lnnf ); + */ + rbsbx = model->BSIM4rbsbx0 * exp( model->BSIM4rbsdbxl * lnl + + model->BSIM4rbsdbxw * lnw + model->BSIM4rbsdbxnf * lnnf ); + rbsby = model->BSIM4rbsby0 * exp( model->BSIM4rbsdbyl * lnl + + model->BSIM4rbsdbyw * lnw + model->BSIM4rbsdbynf * lnnf ); + here->BSIM4rbsb = rbsbx * rbsby / (rbsbx + rbsby); + + + /*rbdbx = exp( log(model->BSIM4rbdbx0) + model->BSIM4rbsdbxl * lnl + + model->BSIM4rbsdbxw * lnw + model->BSIM4rbsdbxnf * lnnf ); + rbdby = exp( log(model->BSIM4rbdby0) + model->BSIM4rbsdbyl * lnl + + model->BSIM4rbsdbyw * lnw + model->BSIM4rbsdbynf * lnnf ); + */ + + rbdbx = model->BSIM4rbdbx0 * exp( model->BSIM4rbsdbxl * lnl + + model->BSIM4rbsdbxw * lnw + model->BSIM4rbsdbxnf * lnnf ); + rbdby = model->BSIM4rbdby0 * exp( model->BSIM4rbsdbyl * lnl + + model->BSIM4rbsdbyw * lnw + model->BSIM4rbsdbynf * lnnf ); + + here->BSIM4rbdb = rbdbx * rbdby / (rbdbx + rbdby); + } - if ((bodymode == 3)|| (bodymode == 5)) - { - here->BSIM4rbps = exp( log(model->BSIM4rbps0) + model->BSIM4rbpsl * lnl + - model->BSIM4rbpsw * lnw + model->BSIM4rbpsnf * lnnf ); - here->BSIM4rbpd = exp( log(model->BSIM4rbpd0) + model->BSIM4rbpdl * lnl + - model->BSIM4rbpdw * lnw + model->BSIM4rbpdnf * lnnf ); - } + if ((bodymode == 3)|| (bodymode == 5)) + { + /*here->BSIM4rbps = exp( log(model->BSIM4rbps0) + model->BSIM4rbpsl * lnl + + model->BSIM4rbpsw * lnw + model->BSIM4rbpsnf * lnnf ); + here->BSIM4rbpd = exp( log(model->BSIM4rbpd0) + model->BSIM4rbpdl * lnl + + model->BSIM4rbpdw * lnw + model->BSIM4rbpdnf * lnnf ); + */ + here->BSIM4rbps = model->BSIM4rbps0 * exp( model->BSIM4rbpsl * lnl + + model->BSIM4rbpsw * lnw + model->BSIM4rbpsnf * lnnf ); + here->BSIM4rbpd = model->BSIM4rbpd0 * exp( model->BSIM4rbpdl * lnl + + model->BSIM4rbpdw * lnw + model->BSIM4rbpdnf * lnnf ); - rbpbx = exp( log(model->BSIM4rbpbx0) + model->BSIM4rbpbxl * lnl + - model->BSIM4rbpbxw * lnw + model->BSIM4rbpbxnf * lnnf ); - rbpby = exp( log(model->BSIM4rbpby0) + model->BSIM4rbpbyl * lnl + - model->BSIM4rbpbyw * lnw + model->BSIM4rbpbynf * lnnf ); - here->BSIM4rbpb = rbpbx*rbpby/(rbpbx + rbpby); - } + } + /*rbpbx = exp( log(model->BSIM4rbpbx0) + model->BSIM4rbpbxl * lnl + + model->BSIM4rbpbxw * lnw + model->BSIM4rbpbxnf * lnnf ); + rbpby = exp( log(model->BSIM4rbpby0) + model->BSIM4rbpbyl * lnl + + model->BSIM4rbpbyw * lnw + model->BSIM4rbpbynf * lnnf ); + */ + rbpbx = model->BSIM4rbpbx0 * exp( model->BSIM4rbpbxl * lnl + + model->BSIM4rbpbxw * lnw + model->BSIM4rbpbxnf * lnnf ); + rbpby = model->BSIM4rbpby0 * exp( model->BSIM4rbpbyl * lnl + + model->BSIM4rbpbyw * lnw + model->BSIM4rbpbynf * lnnf ); + + here->BSIM4rbpb = rbpbx*rbpby/(rbpbx + rbpby); + } if ((here->BSIM4rbodyMod == 1 ) || ((here->BSIM4rbodyMod == 2 ) && (bodymode == 5)) ) { if (here->BSIM4rbdb < 1.0e-3) @@ -2124,65 +2215,9 @@ int Size_Not_Found, i; 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 * model->BSIM4vtm; - 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; - - } - - /* New DITS term added in 4.7 */ - T0 = -pParam->BSIM4dvtp3 * log(pParam->BSIM4leff); - DEXP(T0, T1); - pParam->BSIM4dvtp2factor = pParam->BSIM4dvtp5 + pParam->BSIM4dvtp2 * T1; - if(model->BSIM4mtrlMod != 0 && model->BSIM4mtrlCompatMod == 0) - { - /* Calculate TOXP from EOT */ + { + /* Calculate TOXP from EOT */ /* Calculate Vgs_eff @ Vgs = VDD with Poly Depletion Effect */ Vtm0eot = KboQ * model->BSIM4tempeot; Vtmeot = Vtm0eot; @@ -2263,6 +2298,7 @@ int Size_Not_Found, i; n = (1.0 + 3.0 * tmp3) * T0; } + /* Vth correction for Pocket implant */ if (pParam->BSIM4dvtp0 > 0.0) { @@ -2297,9 +2333,12 @@ int Size_Not_Found, i; toxpf = toxe - epsrox/model->BSIM4epsrsub * Tcen; niter++; } while ((niter<=4)&&(ABS(toxpf-toxpi)>1e-12)); - model->BSIM4toxp = toxpf; - model->BSIM4coxp = epsrox * EPS0 / model->BSIM4toxp; - } + here->BSIM4toxp = toxpf; + here->BSIM4coxp = epsrox * EPS0 / model->BSIM4toxp; + } else { + here->BSIM4toxp = model->BSIM4toxp; + here->BSIM4coxp = model->BSIM4coxp; + } if (BSIM4checkModel(model, here, ckt)) { diff --git a/src/spicelib/devices/bsim4/b4trunc.c b/src/spicelib/devices/bsim4/b4trunc.c index aa107ca0b..06e68a0ea 100644 --- a/src/spicelib/devices/bsim4/b4trunc.c +++ b/src/spicelib/devices/bsim4/b4trunc.c @@ -1,8 +1,8 @@ -/**** BSIM4.7.0 Released by Darsen Lu 04/08/2011 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** * Copyright 2006 Regents of the University of California. All rights reserved. - * File: b4trunc.c of BSIM4.7.0. + * File: b4trunc.c of BSIM4.8.0. * Author: 2000 Weidong Liu * Authors: 2001- Xuemei Xi, Mohan Dunga, Ali Niknejad, Chenming Hu. * Authors: 2006- Mohan Dunga, Ali Niknejad, Chenming Hu diff --git a/src/spicelib/devices/bsim4/bsim4def.h b/src/spicelib/devices/bsim4/bsim4def.h index 87f041fd6..b3206d16e 100644 --- a/src/spicelib/devices/bsim4/bsim4def.h +++ b/src/spicelib/devices/bsim4/bsim4def.h @@ -1,4 +1,4 @@ -/**** BSIM4.6.2 Released by Wenwei Yang 07/31/2008 ****/ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ /********** Copyright 2006 Regents of the University of California. All rights reserved. @@ -16,7 +16,8 @@ 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. - * Modified by Tanvir Morshed, Darsen Lu 03/27/2011 +Modified by Tanvir Morshed, Darsen Lu 03/27/2011 +Modified by Pankaj Kumar Thakur, 07/23/2012 **********/ #ifndef BSIM4 @@ -123,6 +124,8 @@ typedef struct sBSIM4instance double BSIM4vbsc; double BSIM4k2ox; double BSIM4eta0; + double BSIM4toxp; + double BSIM4coxp; double BSIM4icVDS; double BSIM4icVGS; @@ -698,6 +701,9 @@ struct bsim4SizeDependParam double BSIM4aigc; double BSIM4bigc; double BSIM4cigc; + double BSIM4aigsd; + double BSIM4bigsd; + double BSIM4cigsd; double BSIM4aigs; double BSIM4bigs; double BSIM4cigs; diff --git a/src/spicelib/devices/bsim4/bsim4ext.h b/src/spicelib/devices/bsim4/bsim4ext.h index 4d3a93f0e..9618c6328 100644 --- a/src/spicelib/devices/bsim4/bsim4ext.h +++ b/src/spicelib/devices/bsim4/bsim4ext.h @@ -1,3 +1,5 @@ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ + /********** Copyright 2004 Regents of the University of California. All rights reserved. Author: 2000 Weidong Liu diff --git a/src/spicelib/devices/bsim4/bsim4itf.h b/src/spicelib/devices/bsim4/bsim4itf.h index b4dc51e7e..433ff01eb 100644 --- a/src/spicelib/devices/bsim4/bsim4itf.h +++ b/src/spicelib/devices/bsim4/bsim4itf.h @@ -1,3 +1,5 @@ +/**** BSIM4.8.0 Released by Navid Paydavosi 11/01/2013 ****/ + /********** Copyright 2004 Regents of the University of California. All rights reserved. Author: 2000 Weidong Liu. diff --git a/tests/bsim4/nmos/qaSpec b/tests/bsim4/nmos/qaSpec index 053642141..88ac522da 100644 --- a/tests/bsim4/nmos/qaSpec +++ b/tests/bsim4/nmos/qaSpec @@ -19,8 +19,8 @@ nTypeSelectionArguments nmos level=14 version=4.7.0 pTypeSelectionArguments pmos level=14 version=4.7.0 `endif `ifdef ngspice -nTypeSelectionArguments nmos level=14 version=4.7.0 -pTypeSelectionArguments pmos level=14 version=4.7.0 +nTypeSelectionArguments nmos level=14 version=4.8.0 +pTypeSelectionArguments pmos level=14 version=4.8.0 `endif // diff --git a/tests/bsim4/pmos/qaSpec b/tests/bsim4/pmos/qaSpec index faa6503f2..4c5a4bc7e 100644 --- a/tests/bsim4/pmos/qaSpec +++ b/tests/bsim4/pmos/qaSpec @@ -19,8 +19,8 @@ nTypeSelectionArguments pmos level=14 version=4.7.0 pTypeSelectionArguments pmos level=14 version=4.7.0 `endif `ifdef ngspice -nTypeSelectionArguments pmos level=14 version=4.7.0 -pTypeSelectionArguments pmos level=14 version=4.7.0 +nTypeSelectionArguments pmos level=14 version=4.8.0 +pTypeSelectionArguments pmos level=14 version=4.8.0 `endif //