From 1b81f19557c2ec12e13ff2a4f11458a2cfac3197 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 11 May 2025 09:14:02 +0200 Subject: [PATCH] Prepare BSIM4.7 for instance flag dtemp FIXME: The dtemp value is not yet linked to the model! --- src/spicelib/devices/bsim4v7/b4v7.c | 1 + src/spicelib/devices/bsim4v7/b4v7ask.c | 3 +++ src/spicelib/devices/bsim4v7/b4v7par.c | 4 ++++ src/spicelib/devices/bsim4v7/b4v7set.c | 3 ++- src/spicelib/devices/bsim4v7/bsim4v7def.h | 3 +++ 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/spicelib/devices/bsim4v7/b4v7.c b/src/spicelib/devices/bsim4v7/b4v7.c index f1d70b209..cb46a904c 100644 --- a/src/spicelib/devices/bsim4v7/b4v7.c +++ b/src/spicelib/devices/bsim4v7/b4v7.c @@ -57,6 +57,7 @@ IOP( "mulu0", BSIM4v7_MULU0, IF_REAL, "Low field mobility multiplier"), IOP( "xgw", BSIM4v7_XGW, IF_REAL, "Distance from gate contact center to device edge"), IOP( "ngcon", BSIM4v7_NGCON, IF_REAL, "Number of gate contacts"), IOP( "wnflag", BSIM4v7_WNFLAG, IF_INTEGER, "W/NF device flag for bin selection"), +IOPU( "dtemp", BSIM4v7_DTEMP, IF_REAL, "Instance temperature difference"), IOP( "trnqsmod", BSIM4v7_TRNQSMOD, IF_INTEGER, "Transient NQS model selector"), IOP( "acnqsmod", BSIM4v7_ACNQSMOD, IF_INTEGER, "AC NQS model selector"), diff --git a/src/spicelib/devices/bsim4v7/b4v7ask.c b/src/spicelib/devices/bsim4v7/b4v7ask.c index 19690eda9..f20dc692b 100644 --- a/src/spicelib/devices/bsim4v7/b4v7ask.c +++ b/src/spicelib/devices/bsim4v7/b4v7ask.c @@ -114,6 +114,9 @@ BSIM4v7instance *here = (BSIM4v7instance*)inst; case BSIM4v7_MULU0: value->rValue = here->BSIM4v7mulu0; return(OK); + case BSIM4v7_DTEMP: + value->rValue = here->BSIM4v7dtemp; + return(OK); case BSIM4v7_WNFLAG: value->iValue = here->BSIM4v7wnflag; return(OK); diff --git a/src/spicelib/devices/bsim4v7/b4v7par.c b/src/spicelib/devices/bsim4v7/b4v7par.c index d8bdd6d3d..e4c5a099a 100644 --- a/src/spicelib/devices/bsim4v7/b4v7par.c +++ b/src/spicelib/devices/bsim4v7/b4v7par.c @@ -141,6 +141,10 @@ IFvalue *select) here->BSIM4v7mulu0 = value->rValue; here->BSIM4v7mulu0Given = TRUE; break; + case BSIM4v7_DTEMP: + here->BSIM4v7dtemp = value->rValue; + here->BSIM4v7dtempGiven = TRUE; + return(OK); case BSIM4v7_WNFLAG: here->BSIM4v7wnflag = value->iValue; here->BSIM4v7wnflagGiven = TRUE; diff --git a/src/spicelib/devices/bsim4v7/b4v7set.c b/src/spicelib/devices/bsim4v7/b4v7set.c index ed2fd017f..1d3246b47 100644 --- a/src/spicelib/devices/bsim4v7/b4v7set.c +++ b/src/spicelib/devices/bsim4v7/b4v7set.c @@ -2256,8 +2256,9 @@ BSIM4v7instance **InstArray; here->BSIM4v7xgw = model->BSIM4v7xgw; if (!here->BSIM4v7ngconGiven) here->BSIM4v7ngcon = model->BSIM4v7ngcon; + if (!here->BSIM4v7dtempGiven) + here->BSIM4v7dtemp = 0; - /* Process instance model selectors, some * may override their global counterparts */ diff --git a/src/spicelib/devices/bsim4v7/bsim4v7def.h b/src/spicelib/devices/bsim4v7/bsim4v7def.h index e4c1f1adc..073bec7ff 100644 --- a/src/spicelib/devices/bsim4v7/bsim4v7def.h +++ b/src/spicelib/devices/bsim4v7/bsim4v7def.h @@ -116,6 +116,7 @@ typedef struct sBSIM4v7instance int BSIM4v7wnflag; double BSIM4v7xgw; double BSIM4v7ngcon; + double BSIM4v7dtemp; /* added here to account stress effect instance dependence */ double BSIM4v7u0temp; @@ -302,6 +303,7 @@ typedef struct sBSIM4v7instance unsigned BSIM4v7wnflagGiven :1; unsigned BSIM4v7xgwGiven :1; unsigned BSIM4v7ngconGiven :1; + unsigned BSIM4v7dtempGiven : 1; unsigned BSIM4v7icVDSGiven :1; unsigned BSIM4v7icVGSGiven :1; unsigned BSIM4v7icVBSGiven :1; @@ -2843,6 +2845,7 @@ typedef struct sBSIM4v7model #define BSIM4v7_M 38 #define BSIM4v7_MULU0 39 #define BSIM4v7_WNFLAG 40 +#define BSIM4v7_DTEMP 41 /* Global parameters */ #define BSIM4v7_MOD_TEMPEOT 65