From 42802f73a1e88160ce08de29d1ef7b3ea4a5d3cd Mon Sep 17 00:00:00 2001 From: dwarning Date: Thu, 9 May 2013 21:50:55 +0200 Subject: [PATCH] Alternative geometry correction for semiconductor capacitors --- src/spicelib/devices/cap/cap.c | 1 + src/spicelib/devices/cap/capdefs.h | 17 +++++----- src/spicelib/devices/cap/capmask.c | 3 ++ src/spicelib/devices/cap/capmpar.c | 4 +++ src/spicelib/devices/cap/capsetup.c | 49 +++++++++++++++++------------ 5 files changed, 47 insertions(+), 27 deletions(-) diff --git a/src/spicelib/devices/cap/cap.c b/src/spicelib/devices/cap/cap.c index f4c73e2d1..370ae170d 100644 --- a/src/spicelib/devices/cap/cap.c +++ b/src/spicelib/devices/cap/cap.c @@ -47,6 +47,7 @@ IFparm CAPmPTable[] = { /* names of model parameters */ IOPR( "l", CAP_MOD_DEFLENGTH,IF_REAL, "Default length"), IOPA( "narrow", CAP_MOD_NARROW, IF_REAL, "width correction factor"), IOPA( "short", CAP_MOD_SHORT, IF_REAL, "length correction factor"), + IOPA( "del", CAP_MOD_DEL, IF_REAL, "length and width correction factor"), IOPA( "tc1", CAP_MOD_TC1, IF_REAL, "First order temp. coefficient"), IOPA( "tc2", CAP_MOD_TC2, IF_REAL, "Second order temp. coefficient"), IOPXU("tnom", CAP_MOD_TNOM, IF_REAL, "Parameter measurement temperature"), diff --git a/src/spicelib/devices/cap/capdefs.h b/src/spicelib/devices/cap/capdefs.h index c195f2910..09ebf9fa9 100644 --- a/src/spicelib/devices/cap/capdefs.h +++ b/src/spicelib/devices/cap/capdefs.h @@ -88,6 +88,7 @@ typedef struct sCAPmodel { /* model structure for a capacitor */ double CAPdefLength; /* the default length of a capacitor */ double CAPnarrow; /* amount by which width are less than drawn */ double CAPshort; /* amount by which length are less than drawn */ + double CAPdel; /* amount by which length and width are less than drawn */ double CAPdi; /* Relative dielectric constant */ double CAPthick; /* Insulator thickness */ unsigned CAPmCapGiven : 1; /* flag indicates default capacitance given */ @@ -97,6 +98,7 @@ typedef struct sCAPmodel { /* model structure for a capacitor */ unsigned CAPdefLengthGiven : 1; /* flag indicates deafult lenght given */ unsigned CAPnarrowGiven : 1; /* flag indicates narrowing factor given */ unsigned CAPshortGiven : 1; /* flag indicates shortening factor given */ + unsigned CAPdelGiven : 1; /* flag indicates del factor given */ unsigned CAPtnomGiven : 1; /* flag indicates nominal temp. given */ unsigned CAPtc1Given : 1; /* flag indicates tc1 was specified */ unsigned CAPtc2Given : 1; /* flag indicates tc2 was specified */ @@ -127,13 +129,14 @@ typedef struct sCAPmodel { /* model structure for a capacitor */ #define CAP_MOD_C 104 #define CAP_MOD_NARROW 105 #define CAP_MOD_SHORT 106 -#define CAP_MOD_TC1 107 -#define CAP_MOD_TC2 108 -#define CAP_MOD_TNOM 109 -#define CAP_MOD_DI 110 -#define CAP_MOD_THICK 111 -#define CAP_MOD_CAP 112 -#define CAP_MOD_DEFLENGTH 113 +#define CAP_MOD_DEL 107 +#define CAP_MOD_TC1 108 +#define CAP_MOD_TC2 109 +#define CAP_MOD_TNOM 110 +#define CAP_MOD_DI 111 +#define CAP_MOD_THICK 112 +#define CAP_MOD_CAP 113 +#define CAP_MOD_DEFLENGTH 114 /* device questions */ #define CAP_QUEST_SENS_REAL 201 diff --git a/src/spicelib/devices/cap/capmask.c b/src/spicelib/devices/cap/capmask.c index efd216426..8f8c5ebe4 100644 --- a/src/spicelib/devices/cap/capmask.c +++ b/src/spicelib/devices/cap/capmask.c @@ -54,6 +54,9 @@ CAPmAsk(CKTcircuit *ckt, GENmodel *inst, int which, IFvalue *value) case CAP_MOD_SHORT: value->rValue = here->CAPshort; return(OK); + case CAP_MOD_DEL: + value->rValue = here->CAPdel; + return(OK); case CAP_MOD_DI: value->rValue = here->CAPdi; return(OK); diff --git a/src/spicelib/devices/cap/capmpar.c b/src/spicelib/devices/cap/capmpar.c index f81da7eee..f7fefd1d9 100644 --- a/src/spicelib/devices/cap/capmpar.c +++ b/src/spicelib/devices/cap/capmpar.c @@ -58,6 +58,10 @@ CAPmParam(int param, IFvalue *value, GENmodel *inModel) mod->CAPshort = value->rValue; mod->CAPshortGiven = TRUE; break; + case CAP_MOD_DEL: + mod->CAPdel = value->rValue; + mod->CAPdelGiven = TRUE; + break; case CAP_MOD_DI: mod->CAPdi = value->rValue; mod->CAPdiGiven = TRUE; diff --git a/src/spicelib/devices/cap/capsetup.c b/src/spicelib/devices/cap/capsetup.c index dea2a6e3a..e37e4136d 100644 --- a/src/spicelib/devices/cap/capsetup.c +++ b/src/spicelib/devices/cap/capsetup.c @@ -16,8 +16,8 @@ Modified: September 2003 Paolo Nenzi /*ARGSUSED*/ int CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) - /* load the capacitor structure with those pointers needed later - * for fast matrix loading + /* load the capacitor structure with those pointers needed later + * for fast matrix loading */ { @@ -28,7 +28,7 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) for( ; model != NULL; model = model->CAPnextModel ) { /*Default Value Processing for Model Parameters */ - if (!model->CAPmCapGiven) { + if (!model->CAPmCapGiven) { model->CAPmCap = 0.0; } if (!model->CAPcjswGiven){ @@ -37,7 +37,7 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if (!model->CAPdefWidthGiven) { model->CAPdefWidth = 10.e-6; } - if (!model->CAPdefLengthGiven) { + if (!model->CAPdefLengthGiven) { model->CAPdefLength = 0.0; } if (!model->CAPnarrowGiven) { @@ -46,35 +46,44 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) if (!model->CAPshortGiven) { model->CAPshort = 0.0; } + if (!model->CAPdelGiven) { + model->CAPdel = 0.0; + } if (!model->CAPtc1Given) { model->CAPtempCoeff1 = 0.0; } if (!model->CAPtc2Given) { model->CAPtempCoeff2 = 0.0; } - if (!model->CAPtnomGiven) { + if (!model->CAPtnomGiven) { model->CAPtnom = ckt->CKTnomTemp; } - if (!model->CAPdiGiven) { + if (!model->CAPdiGiven) { model->CAPdi = 0.0; } - if (!model->CAPthickGiven) { + if (!model->CAPthickGiven) { model->CAPthick = 0.0; } - - if (!model->CAPcjGiven) { - if((model->CAPthickGiven) - && (model->CAPthick > 0.0)) { - - if (model->CAPdiGiven) - model->CAPcj = (model->CAPdi * CONSTepsZero) / model->CAPthick; - else - model->CAPcj = CONSTepsSiO2 / model->CAPthick; - } else { - model->CAPcj = 0.0; - } + + if (!model->CAPcjGiven) { + if((model->CAPthickGiven) + && (model->CAPthick > 0.0)) { + if (model->CAPdiGiven) + model->CAPcj = (model->CAPdi * CONSTepsZero) / model->CAPthick; + else + model->CAPcj = CONSTepsSiO2 / model->CAPthick; + } else { + model->CAPcj = 0.0; + } } - + + if (model->CAPdelGiven) { + if (!model->CAPnarrowGiven) + model->CAPnarrow = 2 * model->CAPdel; + if (!model->CAPshortGiven) + model->CAPshort = 2 * model->CAPdel; + } + /* loop through all the instances of the model */ for (here = model->CAPinstances; here != NULL ; here=here->CAPnextInstance) {