From ecac7a07a2fa8f1f3284cce4387f334041edc526 Mon Sep 17 00:00:00 2001 From: dwarning Date: Tue, 2 Sep 2025 11:15:38 +0200 Subject: [PATCH] bsim4: reimplement mobility and binning extension --- src/spicelib/devices/bsim4/b4.c | 3 ++- src/spicelib/devices/bsim4/b4ask.c | 6 ++++++ src/spicelib/devices/bsim4/b4par.c | 8 ++++++++ src/spicelib/devices/bsim4/b4set.c | 2 ++ src/spicelib/devices/bsim4/b4temp.c | 3 +++ src/spicelib/devices/bsim4/bsim4def.h | 20 +++++++++++++------- 6 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/spicelib/devices/bsim4/b4.c b/src/spicelib/devices/bsim4/b4.c index d0fddd8b3..b39901f32 100644 --- a/src/spicelib/devices/bsim4/b4.c +++ b/src/spicelib/devices/bsim4/b4.c @@ -55,9 +55,10 @@ IOP( "rbps", BSIM4_RBPS, IF_REAL , "Body resistance"), IOP( "rbpd", BSIM4_RBPD, IF_REAL , "Body resistance"), IOP( "delvto", BSIM4_DELVTO, IF_REAL , "Zero bias threshold voltage variation"), IOPR("delvt0", BSIM4_DELVTO, IF_REAL , "Zero bias threshold voltage variation"), +IOP( "mulu0", BSIM4_MULU0, IF_REAL, "Low field mobility multiplier"), IOP( "xgw", BSIM4_XGW, IF_REAL, "Distance from gate contact center to device edge"), IOP( "ngcon", BSIM4_NGCON, IF_REAL, "Number of gate contacts"), - +IOP( "wnflag", BSIM4_WNFLAG, IF_INTEGER, "W/NF device flag for bin selection"), IOP( "trnqsmod", BSIM4_TRNQSMOD, IF_INTEGER, "Transient NQS model selector"), IOP( "acnqsmod", BSIM4_ACNQSMOD, IF_INTEGER, "AC NQS model selector"), diff --git a/src/spicelib/devices/bsim4/b4ask.c b/src/spicelib/devices/bsim4/b4ask.c index 76874bf73..c0f843e95 100644 --- a/src/spicelib/devices/bsim4/b4ask.c +++ b/src/spicelib/devices/bsim4/b4ask.c @@ -129,6 +129,12 @@ BSIM4instance *here = (BSIM4instance*)inst; case BSIM4_DELVTO: value->rValue = here->BSIM4delvto; return(OK); + case BSIM4_MULU0: + value->rValue = here->BSIM4mulu0; + return(OK); + case BSIM4_WNFLAG: + value->iValue = here->BSIM4wnflag; + return(OK); case BSIM4_XGW: value->rValue = here->BSIM4xgw; return(OK); diff --git a/src/spicelib/devices/bsim4/b4par.c b/src/spicelib/devices/bsim4/b4par.c index 1ecd4af88..ac4a274c5 100644 --- a/src/spicelib/devices/bsim4/b4par.c +++ b/src/spicelib/devices/bsim4/b4par.c @@ -157,6 +157,14 @@ IFvalue *select) here->BSIM4delvto = value->rValue; here->BSIM4delvtoGiven = TRUE; break; + case BSIM4_MULU0: + here->BSIM4mulu0 = value->rValue; + here->BSIM4mulu0Given = TRUE; + break; + case BSIM4_WNFLAG: + here->BSIM4wnflag = value->iValue; + here->BSIM4wnflagGiven = TRUE; + break; case BSIM4_XGW: here->BSIM4xgw = value->rValue; here->BSIM4xgwGiven = TRUE; diff --git a/src/spicelib/devices/bsim4/b4set.c b/src/spicelib/devices/bsim4/b4set.c index 05185af03..0637be32e 100644 --- a/src/spicelib/devices/bsim4/b4set.c +++ b/src/spicelib/devices/bsim4/b4set.c @@ -2354,6 +2354,8 @@ BSIM4instance **InstArray; here->BSIM4rbpd = model->BSIM4rbpd; if (!here->BSIM4delvtoGiven) here->BSIM4delvto = 0.0; + if (!here->BSIM4mulu0Given) + here->BSIM4mulu0 = 1.0; if (!here->BSIM4xgwGiven) here->BSIM4xgw = model->BSIM4xgw; if (!here->BSIM4ngconGiven) diff --git a/src/spicelib/devices/bsim4/b4temp.c b/src/spicelib/devices/bsim4/b4temp.c index 172bb74ad..b9a0434c7 100644 --- a/src/spicelib/devices/bsim4/b4temp.c +++ b/src/spicelib/devices/bsim4/b4temp.c @@ -1768,6 +1768,9 @@ int Fatal_Flag = 0; here->BSIM4vth0 += here->BSIM4delvto; here->BSIM4vfb = pParam->BSIM4vfb + model->BSIM4type * here->BSIM4delvto; + /* low field mobility multiplier */ + here->BSIM4u0temp = pParam->BSIM4u0temp * here->BSIM4mulu0; + /* Instance variables calculation */ T3 = model->BSIM4type * here->BSIM4vth0 - here->BSIM4vfb - pParam->BSIM4phi; diff --git a/src/spicelib/devices/bsim4/bsim4def.h b/src/spicelib/devices/bsim4/bsim4def.h index 59d82ceab..a2bff4121 100644 --- a/src/spicelib/devices/bsim4/bsim4def.h +++ b/src/spicelib/devices/bsim4/bsim4def.h @@ -117,6 +117,8 @@ typedef struct sBSIM4instance double BSIM4rbpd; double BSIM4delvto; + double BSIM4mulu0; + int BSIM4wnflag; double BSIM4xgw; double BSIM4ngcon; @@ -310,6 +312,8 @@ typedef struct sBSIM4instance unsigned BSIM4rbpdGiven :1; unsigned BSIM4rbpsGiven :1; unsigned BSIM4delvtoGiven :1; + unsigned BSIM4mulu0Given :1; + unsigned BSIM4wnflagGiven :1; unsigned BSIM4xgwGiven :1; unsigned BSIM4ngconGiven :1; unsigned BSIM4icVDSGiven :1; @@ -2864,14 +2868,16 @@ typedef struct sBSIM4model #define BSIM4_SCC 36 #define BSIM4_SC 37 #define BSIM4_M 38 +#define BSIM4_MULU0 39 +#define BSIM4_WNFLAG 40 -#define BSIM4_VGSTEFF 40 -#define BSIM4_VDSEFF 41 -#define BSIM4_CGSO 42 -#define BSIM4_CGDO 43 -#define BSIM4_CGBO 44 -#define BSIM4_WEFF 45 -#define BSIM4_LEFF 46 +#define BSIM4_VGSTEFF 41 +#define BSIM4_VDSEFF 42 +#define BSIM4_CGSO 43 +#define BSIM4_CGDO 44 +#define BSIM4_CGBO 45 +#define BSIM4_WEFF 46 +#define BSIM4_LEFF 47 /* Global parameters */ #define BSIM4_MOD_TEMPEOT 66