From 88caa08470b46fb9fd02f9b01e68ac72e474355b Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 16 Sep 2025 12:39:21 +0200 Subject: [PATCH] =?UTF-8?q?Add=20function=20cm=5Fget=5Fdeg=5Fparams(void)?= =?UTF-8?q?=20to=20obtain=20the=20set=20of=20gegeneration=20model=20p?= =?UTF-8?q?=C3=BCarameters=20stored=20in=20struct=20agemods.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-sort the parameters in ifspec.ifs (preliminary) Use cm_get_deg_params() to obtain the model parameters in cfunc.mod --- src/include/ngspice/cmproto.h | 1 + src/include/ngspice/dllitf.h | 2 + src/xspice/cm/cm.c | 17 ++++- src/xspice/cm/cmexport.c | 1 + src/xspice/icm/dlmain.c | 4 + src/xspice/icm/xtradev/degmonitor/cfunc.mod | 78 ++++++++++++++++---- src/xspice/icm/xtradev/degmonitor/ifspec.ifs | 54 +++++++------- 7 files changed, 117 insertions(+), 40 deletions(-) diff --git a/src/include/ngspice/cmproto.h b/src/include/ngspice/cmproto.h index d137264c5..b88abd47f 100644 --- a/src/include/ngspice/cmproto.h +++ b/src/include/ngspice/cmproto.h @@ -102,6 +102,7 @@ const char *cm_get_node_name(const char *, unsigned int); const char *cm_get_neg_node_name(const char *, unsigned int); bool cm_probe_node(unsigned int, unsigned int, void *); bool cm_schedule_output(unsigned int, unsigned int, double, void *); +void* cm_get_deg_params(void); enum cp_types; bool cm_getvar(char *, enum cp_types, void *, size_t); diff --git a/src/include/ngspice/dllitf.h b/src/include/ngspice/dllitf.h index dd79ee4fc..a6d6d5ec5 100644 --- a/src/include/ngspice/dllitf.h +++ b/src/include/ngspice/dllitf.h @@ -74,9 +74,11 @@ struct coreInfo_t { Complex_t ((*dllitf_cm_complex_divide)(Complex_t, Complex_t)); char * ((*dllitf_cm_get_path)(void)); CKTcircuit *((*dllitf_cm_get_circuit)(void)); + void * ((*dllitf_cm_get_deg_params)(void)); FILE * ((*dllitf_cm_stream_out)(void)); FILE * ((*dllitf_cm_stream_in)(void)); FILE * ((*dllitf_cm_stream_err)(void)); + /*Other stuff*/ void * ((*dllitf_malloc_pj)(size_t)); void * ((*dllitf_calloc_pj)(size_t, size_t)); diff --git a/src/xspice/cm/cm.c b/src/xspice/cm/cm.c index ce4fdcdc7..18e3bd0d1 100644 --- a/src/xspice/cm/cm.c +++ b/src/xspice/cm/cm.c @@ -43,6 +43,8 @@ INTERFACES cm_get_neg_node_name() cm_probe_node() + cm_get_deg_params() + REFERENCED FILES None. @@ -61,7 +63,7 @@ NON-STANDARD FEATURES #include "ngspice/cktdefs.h" #include "ngspice/cpextern.h" //#include "util.h" - +extern struct agemod agemods; @@ -926,3 +928,16 @@ bool cm_probe_node(unsigned int conn_index, // Connection index this->output_value[edata->output_subindex] = hold; return TRUE; } + +/* +cm_get_deg_params() + +This function returns a pointer to the degradation data structure +agemods. +*/ + + +void *cm_get_deg_params(void) +{ + return &agemods; +} diff --git a/src/xspice/cm/cmexport.c b/src/xspice/cm/cmexport.c index 56cb974eb..40fed5ebc 100644 --- a/src/xspice/cm/cmexport.c +++ b/src/xspice/cm/cmexport.c @@ -71,6 +71,7 @@ struct coreInfo_t coreInfo = cm_complex_divide, cm_get_path, cm_get_circuit, + cm_get_deg_params, no_file, no_file, no_file, diff --git a/src/xspice/icm/dlmain.c b/src/xspice/icm/dlmain.c index dae5c7993..62c7cb922 100644 --- a/src/xspice/icm/dlmain.c +++ b/src/xspice/icm/dlmain.c @@ -372,6 +372,10 @@ bool cm_getvar(char *name, enum cp_types type, void *retval, size_t rsize) return (coreitf->dllitf_cm_getvar)(name, type, retval, rsize); } +void* cm_get_deg_params(void) { + return coreitf->dllitf_cm_get_deg_params(); +} + Complex_t cm_complex_set(double real, double imag) { return (coreitf->dllitf_cm_complex_set)(real,imag); } diff --git a/src/xspice/icm/xtradev/degmonitor/cfunc.mod b/src/xspice/icm/xtradev/degmonitor/cfunc.mod index ce60958c2..3beba4385 100644 --- a/src/xspice/icm/xtradev/degmonitor/cfunc.mod +++ b/src/xspice/icm/xtradev/degmonitor/cfunc.mod @@ -21,7 +21,9 @@ MODIFICATIONS SUMMARY This file contains the model-specific routines used to - functionally describe degradation monitor code model. + functionally describe a degradation monitor code model. + The model has been provided by IIS/EAS, Dresden, Germany, + extracted for the IHP Open PDK and its MOS devoces modelled by PSP. INTERFACES @@ -47,7 +49,10 @@ NON-STANDARD FEATURES /*=== CONSTANTS ========================*/ - +/* maximum number of model parameters */ +#define DEGPARAMAX 64 +/* maximum number of models */ +#define DEGMODMAX 64 /*=== MACROS ===========================*/ @@ -55,7 +60,17 @@ NON-STANDARD FEATURES -/*=== LOCAL VARIABLES & TYPEDEFS =======*/ +/*=== LOCAL VARIABLES & TYPEDEFS =======*/ + +struct agemod { + char* devmodel; + char* simmodel; + int numparams; + char *paramnames[DEGPARAMAX]; + char *paramvalstr[DEGPARAMAX]; + double paramvals[DEGPARAMAX]; + bool paramread[DEGPARAMAX]; +} *agemodptr; static void cm_degmon_callback(ARGS, Mif_Callback_Reason_t reason) @@ -75,6 +90,7 @@ cm_degmon_callback(ARGS, Mif_Callback_Reason_t reason) } } + /*=== FUNCTION PROTOTYPE DEFINITIONS ===*/ @@ -84,7 +100,7 @@ cm_degmon_callback(ARGS, Mif_Callback_Reason_t reason) /*============================================================================== -FUNCTION void cm_seegen() +FUNCTION void cm_degmon() AUTHORS @@ -123,13 +139,6 @@ void cm_degmon(ARGS) /* structure holding parms, double vg; /* gate voltage */ double vs; /* source voltage */ double vb; /* bulk voltage */ - double A; /* degradation model parameter */ - double Ea; /* degradation model parameter */ - double b; /* degradation model parameter */ - double L1; /* degradation model parameter */ - double L2; /* degradation model parameter */ - double n; /* degradation model parameter */ - double c; /* degradation model parameter */ double L; /* channel length */ double *constfac; /* static storage of const factor in model equation */ double tfut; @@ -140,22 +149,65 @@ void cm_degmon(ARGS) /* structure holding parms, double *prevtime; double k = 1.38062259e-5; /* Boltzmann */ + char *devmod; /* PSP device model */ + char *simmod; /* degradation model */ + + double A; /* degradation model parameter */ + double Ea; /* degradation model parameter */ + double b; /* degradation model parameter */ + double L1; /* degradation model parameter */ + double L2; /* degradation model parameter */ + double n; /* degradation model parameter */ + double c; /* degradation model parameter */ + + double A2; /* degradation model parameter */ + double Ea2; /* degradation model parameter */ + double b2; /* degradation model parameter */ + double L12; /* degradation model parameter */ + double L22; /* degradation model parameter */ + double n2; /* degradation model parameter */ + double c2; /* degradation model parameter */ + + struct agemod *agemods = cm_get_deg_params(); if (ANALYSIS == MIF_AC) { return; } + if (!agemods) { + return; + } + + if(!agemods[0].devmodel) + return; /* Retrieve frequently used parameters... */ - +/* A = PARAM(A); Ea = PARAM(Ea); b = PARAM(b); L1 = PARAM(L1); L2 = PARAM(L2); n = PARAM(n); - b = PARAM(b); c = PARAM(c); + + A2 = agemods[0].paramvals[8]; + Ea2 = agemods[0].paramvals[9]; + b2 = agemods[0].paramvals[10]; + c2 = agemods[0].paramvals[11]; + n2 = agemods[0].paramvals[12]; + L12 = agemods[0].paramvals[13]; + L22 = agemods[0].paramvals[14]; +*/ + A = agemods[0].paramvals[8]; + Ea = agemods[0].paramvals[9]; + b = agemods[0].paramvals[10]; + c = agemods[0].paramvals[11]; + n = agemods[0].paramvals[12]; + L1 = agemods[0].paramvals[13]; + L2 = agemods[0].paramvals[14]; + + devmod = PARAM(devmod); tfut = PARAM(tfuture); L = PARAM(L); tsim = TSTOP; diff --git a/src/xspice/icm/xtradev/degmonitor/ifspec.ifs b/src/xspice/icm/xtradev/degmonitor/ifspec.ifs index 092d808b1..92e91f154 100644 --- a/src/xspice/icm/xtradev/degmonitor/ifspec.ifs +++ b/src/xspice/icm/xtradev/degmonitor/ifspec.ifs @@ -39,6 +39,30 @@ Vector_Bounds: [- -] - Null_Allowed: no yes +PARAMETER_TABLE: + +Parameter_Name: l devmod +Description: "channel length" "device model" +Data_Type: real string +Default_Value: 0.13e-6 " " +Limits: - - +Vector: no no +Vector_Bounds: - - +Null_Allowed: yes yes + + +PARAMETER_TABLE: + +Parameter_Name: tfuture +Description: "future time" +Data_Type: real +Default_Value: 315336e4 +Limits: - +Vector: no +Vector_Bounds: - +Null_Allowed: yes + + PARAMETER_TABLE: Parameter_Name: a ea @@ -76,32 +100,10 @@ Null_Allowed: yes yes PARAMETER_TABLE: -Parameter_Name: c tfuture -Description: "c" "future time" -Data_Type: real real -Default_Value: -1.108 315336e4 -Limits: - - -Vector: no no -Vector_Bounds: - - -Null_Allowed: yes yes - -PARAMETER_TABLE: - -Parameter_Name: l devmod -Description: "channel length" "device model" -Data_Type: real string -Default_Value: 0.13e-6 " " -Limits: - - -Vector: no no -Vector_Bounds: - - -Null_Allowed: yes yes - -PARAMETER_TABLE: - -Parameter_Name: file -Description: "file name" -Data_Type: string -Default_Value: "degradation-model.txt" +Parameter_Name: c +Description: "c" +Data_Type: real +Default_Value: -1.108 Limits: - Vector: no Vector_Bounds: -