From a0bb42580c78e68cac93c6ee8770dc9d774cdd93 Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Sun, 2 Aug 2015 13:07:11 +0200 Subject: [PATCH] Implemented also the fitting at 10 years when there is only stress. Filtered the case when there is only recovery --- src/spicelib/devices/bsim4/b4reliability.c | 57 ++++--------------- .../devices/relmodel/relmodelcalcaging.c | 56 +++++++++--------- src/spicelib/devices/relmodel/relmodelext.h | 2 +- 3 files changed, 40 insertions(+), 75 deletions(-) diff --git a/src/spicelib/devices/bsim4/b4reliability.c b/src/spicelib/devices/bsim4/b4reliability.c index 36fd63c19..5005249ba 100644 --- a/src/spicelib/devices/bsim4/b4reliability.c +++ b/src/spicelib/devices/bsim4/b4reliability.c @@ -126,7 +126,7 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo here->relStruct->IsON = 1 ; // Calculate Aging - Giogio Liatis' Model - ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 0) ; + ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 1e-12, 0) ; if (ret == 1) { return (E_INTERN) ; @@ -148,7 +148,7 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo here->relStruct->IsON = 0 ; // Calculate Aging - Giorgio Liatis' Model - ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 1) ; + ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 1e-12, 1) ; if (ret == 1) { return (E_INTERN) ; @@ -175,7 +175,7 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo here->relStruct->IsON = 1 ; // Calculate Aging - Giorgio Liatis' Model - ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 1) ; + ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 1e-12, 1) ; if (ret == 1) { return (E_INTERN) ; @@ -192,7 +192,7 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo here->relStruct->IsON = 0 ; // Calculate Aging - Giorgio Liatis' Model - ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 0) ; + ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, delta, 1e-12, 0) ; if (ret == 1) { return (E_INTERN) ; @@ -239,8 +239,6 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo current = current->next ; } -// printf ("Number of Semi Periods: %u\n", here->relStruct->semiPeriods) ; - if (here->relStruct->semiPeriods > 1) { /* The model behavior is periodic - Use Fourier basis fitting */ @@ -251,24 +249,14 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo number_of_periods = here->relStruct->semiPeriods / 2 ; number_of_modes = 10 * (number_of_periods + 1) ; -// printf ("Number of Periods: %u\n", number_of_periods) ; -// printf ("Number of Modes: %u\n", number_of_modes) ; rows = i ; columns = 2 * number_of_modes + 1 ; size = rows * columns ; fitting_matrix = TMALLOC (double, size) ; -// printf ("Rows: %u\n", rows) ; -// printf ("Columns: %u\n", columns) ; factor_for_2pi = 2 * 3.14159265359 / (timeFit [rows - 1] - timeFit [0]) ; -/* for (i = 0 ; i < rows ; i++) - { - printf ("Time: %-.9g\n", timeFit [i]) ; - } - printf ("Max Time: %-.9g\n", timeFit [rows - 1]) ; - printf ("Min Time: %-.9g\n", timeFit [0]) ; -*/ + for (i = 0 ; i < rows ; i++) { /* The first element of every row is equal to 1 */ @@ -297,11 +285,6 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo gsl_linalg_QR_decomp (&m.matrix, tau) ; gsl_linalg_QR_lssolve (&m.matrix, tau, &b.vector, x, residual) ; -// printf ("fitting_matrix = \n") ; -// gsl_matrix_fprintf (stdout, &m.matrix, "%g") ; -// printf ("x = \n") ; -// gsl_vector_fprintf (stdout, x, "%g") ; - target = 315360000.0 ; f = gsl_vector_get (x, 0) ; @@ -326,32 +309,16 @@ BSIM4reliability_internal (BSIM4instance *here, CKTcircuit *ckt, unsigned int mo gsl_vector_free (x) ; gsl_vector_free (residual) ; } else { - /* Execute Fitting */ - double c0, c1, cov00, cov01, cov11, chisq, *deltaVthFitExp ; - unsigned int j ; - - deltaVthFitExp = TMALLOC (double, i) ; - for (j = 0 ; j < i ; j++) + if (here->relStruct->deltaVth > 0) { - deltaVthFitExp [j] = exp (deltaVthFit [j]) ; + ret = RELMODELcalculateAging ((GENinstance *)here, here->BSIM4modPtr->BSIM4modType, 315360000.0, 0, 1) ; + if (ret == 1) + { + return (E_INTERN) ; + } } - gsl_fit_linear (timeFit, 1, deltaVthFitExp, 1, i, &c0, &c1, &cov00, &cov01, &cov11, &chisq) ; - printf ("\n\n") ; - printf ("c0: %-.9g\n", c0) ; - printf ("c1: %-.9g\n", c1) ; - printf ("cov00: %-.9g\n", cov00) ; - printf ("cov01: %-.9g\n", cov01) ; - printf ("cov11: %-.9g\n", cov11) ; - printf ("chisq: %-.9g\n", chisq) ; - printf ("\n\n") ; - - /* Perform Extrapolation */ - double yFit, yFitErr ; - gsl_fit_linear_est (315360000.0, c0, c1, cov00, cov01, cov11, &yFit, &yFitErr) ; - - printf ("\n\tFitting -> %-.9gs\t%-.9gmV\n\n", 315360000.0, log (yFit) * 1000) ; - printf ("\n\tFitting -> %-.9gs\t%-.9gmV\n\n", 315360000.0, log (c0 + c1 * 315360000.0) * 1000) ; + printf ("\n\nExtrapolation at 10 years:\n\t\t\t\tDeltaVth: %-.9gmV\n\n\n\n", here->relStruct->deltaVth * 1000) ; } } else { fprintf (stderr, "Reliability Analysis Error\n") ; diff --git a/src/spicelib/devices/relmodel/relmodelcalcaging.c b/src/spicelib/devices/relmodel/relmodelcalcaging.c index e349ab885..9a89af0b6 100644 --- a/src/spicelib/devices/relmodel/relmodelcalcaging.c +++ b/src/spicelib/devices/relmodel/relmodelcalcaging.c @@ -47,9 +47,9 @@ listInsert (RELMODELrelList **list, double time, double deltaVth) } int -RELMODELcalculateAging (GENinstance *inInstance, int modType, double t_aging, unsigned int stress_or_recovery) +RELMODELcalculateAging (GENinstance *inInstance, int modType, double t_aging, double t_step, unsigned int stress_or_recovery) { - double A, i, Nt, step ; + double A, i, Nt ; BSIM4instance *here ; RELMODELmodel *relmodel ; @@ -71,44 +71,42 @@ RELMODELcalculateAging (GENinstance *inInstance, int modType, double t_aging, un Nt = pow ((sqrt (relmodel->RELMODELnts)), 3) * 1e-21 ; A = (CHARGE / (4 * CONSTepsZero * 1e-9 * relmodel->RELMODELeps_hk)) * pow ((relmodel->RELMODELh_cut / (2 * sqrt (2 * relmodel->RELMODELm_star * relmodel->RELMODELw)) * 1e9), 2) ; -// printf ("\n\nStart Aging...\n") ; -// printf ("\tEnd step: %-.9g\n\n", here->relStruct->t_star + t_aging) ; - step = 1e-12 ; - for (i = 0 ; i < t_aging ; i += step) + if (t_step == 0) { - if (stress_or_recovery) + /* Extrapolation for 10 years when there is only stress */ + here->relStruct->t_star = 0 ; + if (relmodel->RELMODELh_cut / (2 * sqrt (2 * relmodel->RELMODELm_star * relmodel->RELMODELw)) * log (1 + pow (((t_aging + here->relStruct->t_star) / relmodel->RELMODELtau_0), relmodel->RELMODELbeta)) * 1e9 <= 2) { - if (relmodel->RELMODELh_cut / (2 * sqrt (2 * relmodel->RELMODELm_star * relmodel->RELMODELw)) * log (1 + pow (((i + here->relStruct->t_star) / relmodel->RELMODELtau_0), relmodel->RELMODELbeta)) * 1e9 <= 2) - { - here->relStruct->deltaVth = Nt * A * pow (log (1 + pow (((i + here->relStruct->t_star) / relmodel->RELMODELtau_0), relmodel->RELMODELbeta)), 2) ; - } else { - here->relStruct->deltaVth = pow ((CHARGE / (4 * CONSTepsZero * 1e-9 * relmodel->RELMODELeps_hk)) * Nt * here->BSIM4modPtr->BSIM4toxe * 1e9, 2) ; - } - here->relStruct->deltaVthMax = here->relStruct->deltaVth ; + here->relStruct->deltaVth = Nt * A * pow (log (1 + pow (((t_aging + here->relStruct->t_star) / relmodel->RELMODELtau_0), relmodel->RELMODELbeta)), 2) ; } else { -// printf ("\n\nDeltaVth Prior Recovery: %-.9gmV\n\n", here->relStruct->deltaVth * 1000) ; - here->relStruct->deltaVth = here->relStruct->deltaVthMax * log (1 + (1.718 / (1 + pow ((i / relmodel->RELMODELtau_e), relmodel->RELMODELbeta1)))) ; + here->relStruct->deltaVth = (CHARGE / (4 * CONSTepsZero * 1e-9 * relmodel->RELMODELeps_hk)) * Nt * pow (here->BSIM4modPtr->BSIM4toxe * 1e9, 2) ; } + } else { + for (i = 0 ; i < t_aging ; i += t_step) + { + if (stress_or_recovery) + { + if (relmodel->RELMODELh_cut / (2 * sqrt (2 * relmodel->RELMODELm_star * relmodel->RELMODELw)) * log (1 + pow (((i + here->relStruct->t_star) / relmodel->RELMODELtau_0), relmodel->RELMODELbeta)) * 1e9 <= 2) + { + here->relStruct->deltaVth = Nt * A * pow (log (1 + pow (((i + here->relStruct->t_star) / relmodel->RELMODELtau_0), relmodel->RELMODELbeta)), 2) ; + } else { + here->relStruct->deltaVth = (CHARGE / (4 * CONSTepsZero * 1e-9 * relmodel->RELMODELeps_hk)) * Nt * pow (here->BSIM4modPtr->BSIM4toxe * 1e9, 2) ; + } + here->relStruct->deltaVthMax = here->relStruct->deltaVth ; + } else { + here->relStruct->deltaVth = here->relStruct->deltaVthMax * log (1 + (1.718 / (1 + pow ((i / relmodel->RELMODELtau_e), relmodel->RELMODELbeta1)))) ; + } - /* Insert 'here->relStruct->deltaVth' into the list for the later fitting */ - listInsert (&(here->relStruct->deltaVthList), here->relStruct->offsetTime + i, here->relStruct->deltaVth) ; -// printf ("\nStep: %-.9g\tDeltaVth: %-.9gmV\n\n", i, here->relStruct->deltaVth * 1000) ; -// RELMODELrelList *temp ; -// temp = TMALLOC (RELMODELrelList, 1) ; -// temp->time = i + here->relStruct->t_star ; -// temp->deltaVth = here->relStruct->deltaVth ; -// temp->next = here->relStruct->deltaVthList ; -// here->relStruct->deltaVthList = temp ; -// printf ("QUI\n\n") ; + /* Insert 'here->relStruct->deltaVth' into the list for the later fitting */ + listInsert (&(here->relStruct->deltaVthList), here->relStruct->offsetTime + i, here->relStruct->deltaVth) ; + } + here->relStruct->offsetTime += i ; } -// printf ("Stop Aging...\n\n") ; if (!stress_or_recovery) { here->relStruct->t_star = pow ((exp (sqrt (here->relStruct->deltaVth / (Nt * A))) - 1), (1 / relmodel->RELMODELbeta)) * relmodel->RELMODELtau_0 ; } - here->relStruct->offsetTime += i ; - return 0 ; } diff --git a/src/spicelib/devices/relmodel/relmodelext.h b/src/spicelib/devices/relmodel/relmodelext.h index 827a8f74e..c30e6e3ef 100644 --- a/src/spicelib/devices/relmodel/relmodelext.h +++ b/src/spicelib/devices/relmodel/relmodelext.h @@ -2,7 +2,7 @@ Author: Francesco Lannutti - July 2015 **********/ -extern int RELMODELcalculateAging (GENinstance *, int, double, unsigned int) ; +extern int RELMODELcalculateAging (GENinstance *, int, double, double, unsigned int) ; extern int RELMODELmAsk (CKTcircuit *, GENmodel *, int, IFvalue *) ; extern int RELMODELmDelete (GENmodel **, IFuid, GENmodel *) ; extern int RELMODELmParam (int, IFvalue *, GENmodel *) ;