Add function cm_get_deg_params(void) to obtain the set

of gegeneration model püarameters stored in struct agemods.

Re-sort the parameters in ifspec.ifs (preliminary)

Use cm_get_deg_params() to obtain the model parameters in cfunc.mod
This commit is contained in:
Holger Vogt 2025-09-16 12:39:21 +02:00
parent 30ce3bb365
commit 88caa08470
7 changed files with 117 additions and 40 deletions

View File

@ -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);

View File

@ -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));

View File

@ -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;
}

View File

@ -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,

View File

@ -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);
}

View File

@ -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;

View File

@ -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: -