Add variables deg_tfuture deg_limits to allow users setting
lower limits of deg parameters and the extrapolation time in .spiceinit.
This commit is contained in:
parent
d85b0a07cd
commit
35bb2960b0
|
|
@ -153,7 +153,13 @@ int readdegparams (struct card *deck) {
|
||||||
Return number of degradation monitors, or 0 in case of error. */
|
Return number of degradation monitors, or 0 in case of error. */
|
||||||
int adddegmonitors(struct card* deck) {
|
int adddegmonitors(struct card* deck) {
|
||||||
static int degmonno;
|
static int degmonno;
|
||||||
double tfuture = 315336e3; /* 10 years */
|
double tfuture, dlimits;
|
||||||
|
if (!cp_getvar("deg_tfuture", CP_REAL, &tfuture, 0))
|
||||||
|
tfuture = 315360e3; /* 10 years */
|
||||||
|
fprintf(stdout, "Note: deg data extrapolated to %e seconds (%.1f years)\n", tfuture, tfuture / 31536e3);
|
||||||
|
if (!cp_getvar("deg_limits", CP_REAL, &dlimits, 0))
|
||||||
|
dlimits = 1e-3;
|
||||||
|
fprintf(stdout, "Note: deg data lower limit is %e\n", dlimits);
|
||||||
int nodes = 4;
|
int nodes = 4;
|
||||||
if (agemods[0].paramhash == NULL)
|
if (agemods[0].paramhash == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -214,8 +220,8 @@ int adddegmonitors(struct card* deck) {
|
||||||
*/
|
*/
|
||||||
char* aline = tprintf("adegmon%d_%s %%v([%s]) mon%d degmon%d\n",
|
char* aline = tprintf("adegmon%d_%s %%v([%s]) mon%d degmon%d\n",
|
||||||
degmonno, instname, fournodes, degmonno, degmonno);
|
degmonno, instname, fournodes, degmonno, degmonno);
|
||||||
char* mline = tprintf(".model degmon%d degmon (tfuture=%e %s devmod=\"%s\" instname=\"%s\"\n",
|
char* mline = tprintf(".model degmon%d degmon (tfuture=%e dlimits=%e %s devmod=\"%s\" instname=\"%s\"\n",
|
||||||
degmonno, tfuture, clength, modname, instname);
|
degmonno, tfuture, dlimits, clength, modname, instname);
|
||||||
tfree(clength);
|
tfree(clength);
|
||||||
insert_new_line(deck, aline, 0, deck->linenum_orig, deck->linesource);
|
insert_new_line(deck, aline, 0, deck->linenum_orig, deck->linesource);
|
||||||
insert_new_line(deck, mline, 0, deck->linenum_orig, deck->linesource);
|
insert_new_line(deck, mline, 0, deck->linenum_orig, deck->linesource);
|
||||||
|
|
|
||||||
|
|
@ -288,6 +288,7 @@ void cm_degmon(ARGS) /* structure holding parms,
|
||||||
double constfac; /* static storage of const factor in model equation */
|
double constfac; /* static storage of const factor in model equation */
|
||||||
double tfut;
|
double tfut;
|
||||||
double tsim;
|
double tsim;
|
||||||
|
double dlimits;
|
||||||
double deg; /* monitor output */
|
double deg; /* monitor output */
|
||||||
double sintegrand = 0;
|
double sintegrand = 0;
|
||||||
double sintegral;
|
double sintegral;
|
||||||
|
|
@ -322,6 +323,7 @@ void cm_degmon(ARGS) /* structure holding parms,
|
||||||
devmod = PARAM(devmod);
|
devmod = PARAM(devmod);
|
||||||
tfut = PARAM(tfuture);
|
tfut = PARAM(tfuture);
|
||||||
devtype = PARAM(type);
|
devtype = PARAM(type);
|
||||||
|
dlimits = PARAM(dlimits);
|
||||||
L = PARAM(L);
|
L = PARAM(L);
|
||||||
tsim = TSTOP;
|
tsim = TSTOP;
|
||||||
|
|
||||||
|
|
@ -469,7 +471,7 @@ void cm_degmon(ARGS) /* structure holding parms,
|
||||||
/***************************/
|
/***************************/
|
||||||
sintegral = 1e99; // flag final time step
|
sintegral = 1e99; // flag final time step
|
||||||
/* only significant degradation */
|
/* only significant degradation */
|
||||||
if (fabs(deg) < 1e-6)
|
if (fabs(deg) < dlimits)
|
||||||
deg = 0.;
|
deg = 0.;
|
||||||
loc->result[ii] = deg;
|
loc->result[ii] = deg;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -65,14 +65,14 @@ Null_Allowed: yes no
|
||||||
|
|
||||||
PARAMETER_TABLE:
|
PARAMETER_TABLE:
|
||||||
|
|
||||||
Parameter_Name: type
|
Parameter_Name: type dlimits
|
||||||
Description: "model type PMOS, NMOS"
|
Description: "model type PMOS, NMOS" "degradation limits"
|
||||||
Data_Type: int
|
Data_Type: int real
|
||||||
Default_Value: 1
|
Default_Value: 1 1e-3
|
||||||
Limits: -
|
Limits: - -
|
||||||
Vector: no
|
Vector: no no
|
||||||
Vector_Bounds: -
|
Vector_Bounds: - -
|
||||||
Null_Allowed: yes
|
Null_Allowed: yes yes
|
||||||
|
|
||||||
STATIC_VAR_TABLE:
|
STATIC_VAR_TABLE:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue