From 08df80cebebe1ba12d071bfc9e7e584ecf00cecd Mon Sep 17 00:00:00 2001 From: dwarning Date: Thu, 9 May 2013 21:50:55 +0200 Subject: [PATCH] alternative geometry correction `del' 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 | 10 ++++++++++ 5 files changed, 28 insertions(+), 7 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 b5f2b545b..e37e4136d 100644 --- a/src/spicelib/devices/cap/capsetup.c +++ b/src/spicelib/devices/cap/capsetup.c @@ -46,6 +46,9 @@ 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; } @@ -74,6 +77,13 @@ CAPsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) } } + 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) {