From ba0529cef0a3a0f258fbb6ba4196d73dce8b66b3 Mon Sep 17 00:00:00 2001 From: dwarning Date: Wed, 1 May 2013 23:35:12 +0200 Subject: [PATCH] devices/cap, devices/res: some parameter aliases for compatibility --- src/spicelib/devices/cap/cap.c | 4 ++++ src/spicelib/devices/res/res.c | 3 +++ src/spicelib/devices/res/resdefs.h | 15 +++++++++------ src/spicelib/devices/res/resmask.c | 3 +++ src/spicelib/devices/res/resmpar.c | 4 ++++ src/spicelib/devices/res/restemp.c | 3 ++- 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/spicelib/devices/cap/cap.c b/src/spicelib/devices/cap/cap.c index 2da2e549c..88841cae4 100644 --- a/src/spicelib/devices/cap/cap.c +++ b/src/spicelib/devices/cap/cap.c @@ -36,9 +36,13 @@ IFparm CAPpTable[] = { /* parameters */ IFparm CAPmPTable[] = { /* names of model parameters */ IOPA( "cap", CAP_MOD_CAP, IF_REAL, "Model capacitance"), IOPA( "cj", CAP_MOD_CJ, IF_REAL, "Bottom Capacitance per area"), + IOPR( "cox", CAP_MOD_CJ, IF_REAL, "Bottom Capacitance per area"), IOPA( "cjsw", CAP_MOD_CJSW, IF_REAL, "Sidewall capacitance per meter"), + IOPR( "capsw", CAP_MOD_CJSW, IF_REAL, "Sidewall capacitance per meter"), IOPX( "defw", CAP_MOD_DEFWIDTH, IF_REAL, "Default width"), + IOPR( "w", CAP_MOD_DEFWIDTH, IF_REAL, "Default width"), IOPX( "defl", CAP_MOD_DEFLENGTH,IF_REAL, "Default length"), + 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( "tc1", CAP_MOD_TC1, IF_REAL, "First order temp. coefficient"), diff --git a/src/spicelib/devices/res/res.c b/src/spicelib/devices/res/res.c index 228c8b8f0..f1aa474a6 100644 --- a/src/spicelib/devices/res/res.c +++ b/src/spicelib/devices/res/res.c @@ -45,9 +45,12 @@ IFparm RESmPTable[] = { /* model parameters */ IOPZ( "short", RES_MOD_SHORT, IF_REAL,"Shortening of resistor"), IOPR( "dlr", RES_MOD_SHORT, IF_REAL,"Shortening of resistor"), IOPQ( "tc1", RES_MOD_TC1, IF_REAL,"First order temp. coefficient"), + IOPR( "tc1r", RES_MOD_TC1, IF_REAL,"First order temp. coefficient"), IOPQO( "tc2", RES_MOD_TC2, IF_REAL,"Second order temp. coefficient"), + IOPR( "tc2r", RES_MOD_TC2, IF_REAL,"Second order temp. coefficient"), IOPX( "defw", RES_MOD_DEFWIDTH, IF_REAL,"Default device width"), IOPR( "w", RES_MOD_DEFWIDTH, IF_REAL,"Default device width"), + IOPX( "l", RES_MOD_DEFLENGTH,IF_REAL,"Default device length"), IOPQ( "kf", RES_MOD_KF, IF_REAL,"Flicker noise coefficient"), IOPQ( "af", RES_MOD_AF, IF_REAL,"Flicker noise exponent"), IOPXU( "tnom", RES_MOD_TNOM, IF_REAL,"Parameter measurement temperature"), diff --git a/src/spicelib/devices/res/resdefs.h b/src/spicelib/devices/res/resdefs.h index 18c701e76..eebda4793 100644 --- a/src/spicelib/devices/res/resdefs.h +++ b/src/spicelib/devices/res/resdefs.h @@ -99,6 +99,7 @@ typedef struct sRESmodel { /* model structure for a resistor */ double REStempCoeff2; /* second temperature coefficient of resistors */ double RESsheetRes; /* sheet resistance of devices in ohms/square */ double RESdefWidth; /* default width of a resistor */ + double RESdefLength; /* default length of a resistor */ double RESnarrow; /* amount by which device is narrower than drawn */ double RESshort; /* amount by which device is shorter than drawn */ double RESfNcoef; /* Flicker noise coefficient */ @@ -108,6 +109,7 @@ typedef struct sRESmodel { /* model structure for a resistor */ unsigned REStc2Given :1; /* flag to indicate tc2 was specified */ unsigned RESsheetResGiven :1; /* flag to indicate sheet resistance given*/ unsigned RESdefWidthGiven :1; /* flag to indicate default width given */ + unsigned RESdefLengthGiven :1; /* flag to indicate default length given */ unsigned RESnarrowGiven :1; /* flag to indicate narrow effect given */ unsigned RESshortGiven :1; /* flag to indicate short effect given */ unsigned RESfNcoefGiven :1; /* flag to indicate kf given */ @@ -139,12 +141,13 @@ typedef struct sRESmodel { /* model structure for a resistor */ #define RES_MOD_TC2 102 #define RES_MOD_RSH 103 #define RES_MOD_DEFWIDTH 104 -#define RES_MOD_NARROW 105 -#define RES_MOD_R 106 -#define RES_MOD_TNOM 107 -#define RES_MOD_SHORT 108 -#define RES_MOD_KF 109 -#define RES_MOD_AF 110 +#define RES_MOD_DEFLENGTH 105 +#define RES_MOD_NARROW 106 +#define RES_MOD_R 107 +#define RES_MOD_TNOM 108 +#define RES_MOD_SHORT 109 +#define RES_MOD_KF 110 +#define RES_MOD_AF 111 /* device questions */ #define RES_QUEST_SENS_REAL 201 diff --git a/src/spicelib/devices/res/resmask.c b/src/spicelib/devices/res/resmask.c index 4b541f737..437e0e504 100644 --- a/src/spicelib/devices/res/resmask.c +++ b/src/spicelib/devices/res/resmask.c @@ -39,6 +39,9 @@ RESmodAsk(CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value) case RES_MOD_DEFWIDTH: value->rValue = model->RESdefWidth; return(OK); + case RES_MOD_DEFLENGTH: + value->rValue = model->RESdefLength; + return(OK); case RES_MOD_NARROW: value->rValue = model->RESnarrow; return(OK); diff --git a/src/spicelib/devices/res/resmpar.c b/src/spicelib/devices/res/resmpar.c index a08efceeb..172d01247 100644 --- a/src/spicelib/devices/res/resmpar.c +++ b/src/spicelib/devices/res/resmpar.c @@ -38,6 +38,10 @@ RESmParam(int param, IFvalue *value, GENmodel *inModel) model->RESdefWidth = value->rValue; model->RESdefWidthGiven = TRUE; break; + case RES_MOD_DEFLENGTH: + model->RESdefLength = value->rValue; + model->RESdefLengthGiven = TRUE; + break; case RES_MOD_NARROW: model->RESnarrow = value->rValue; model->RESnarrowGiven = TRUE; diff --git a/src/spicelib/devices/res/restemp.c b/src/spicelib/devices/res/restemp.c index df227a7d7..a72ba9cf3 100644 --- a/src/spicelib/devices/res/restemp.c +++ b/src/spicelib/devices/res/restemp.c @@ -32,6 +32,7 @@ REStemp(GENmodel *inModel, CKTcircuit *ckt) if(!model->REStnomGiven) model->REStnom = ckt->CKTnomTemp; if(!model->RESsheetResGiven) model->RESsheetRes = 0.0; if(!model->RESdefWidthGiven) model->RESdefWidth = 10.e-6; /*M*/ + if(!model->RESdefLengthGiven) model->RESdefLength = 10e-6; if(!model->REStc1Given) model->REStempCoeff1 = 0.0; if(!model->REStc2Given) model->REStempCoeff2 = 0.0; if(!model->RESnarrowGiven) model->RESnarrow = 0.0; @@ -55,7 +56,7 @@ REStemp(GENmodel *inModel, CKTcircuit *ckt) } if(!here->RESwidthGiven) here->RESwidth = model->RESdefWidth; - if(!here->RESlengthGiven) here->RESlength = 0.0; + if(!here->RESlengthGiven) here->RESlength = model->RESdefLength; if(!here->RESscaleGiven) here->RESscale = 1.0; if(!here->RESmGiven) here->RESm = 1.0; if(!here->RESnoisyGiven) here->RESnoisy = 1;