Added Conditional Compilation for Reliability Analysis

This commit is contained in:
Francesco Lannutti 2015-07-05 08:14:44 +02:00
parent 51e50f2c2d
commit 173278a00a
27 changed files with 104 additions and 44 deletions

View File

@ -154,6 +154,10 @@ AC_ARG_ENABLE([adms],
AC_ARG_ENABLE([pss],
[AS_HELP_STRING([--enable-pss], [Enable PSS Analysis, (experimental)])])
# --enable-relan: Enable Reliability Analysis
AC_ARG_ENABLE([relan],
[AS_HELP_STRING([--enable-relan], [Enable Reliability Analysis, (experimental)])])
# --enable-ndev: define NDEV in the code. An interface for external device i.e. numerical device
AC_ARG_ENABLE([ndev],
[AS_HELP_STRING([--enable-ndev], [Enable NDEV interface, (experimental)])])
@ -847,6 +851,10 @@ if test "x$enable_pss" = xyes; then
AC_DEFINE([WITH_PSS], [], [Define if you want PSS analysis])
AC_MSG_RESULT([WARNING: PSS analysis enabled])
fi
if test "x$enable_relan" = xyes; then
AC_DEFINE([RELAN], [], [Define if you want Reliability Analysis])
AC_MSG_RESULT([WARNING: Reliability Analysis enabled])
fi
if test "x$enable_blktmsdebug" = xyes; then
AC_DEFINE([D_DBG_BLOCKTIMES], [], [Define if we want debug distortion analysis (BLOCKTIMES)])
AC_MSG_RESULT([WARNING: Distortion analysis debug *D_DBG_BLOCKTIMES* is enabled])
@ -927,6 +935,8 @@ AM_CONDITIONAL([NUMDEV_WANTED], [test "x$enable_cider" = xyes])
AM_CONDITIONAL([PSS_WANTED], [test "x$enable_pss" = xyes])
AM_CONDITIONAL([RELAN_WANTED], [test "x$enable_relan" = xyes])
AM_CONDITIONAL([SENSE2_WANTED], [test "x$enable_sense2" = xyes])
# adms option

View File

@ -294,12 +294,12 @@ struct comm spcp_coms[] = {
/* SP */
#endif
//#ifdef RELAN
#ifdef RELAN
{ "relan", com_relan, TRUE, TRUE,
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS,
NULL,
"[.relan line args] : Do a Reliability Analysis." } ,
//#endif
#endif
{ "ac", com_ac, TRUE, TRUE,
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS,
@ -733,12 +733,12 @@ struct comm nutcp_coms[] = {
/* SP */
#endif
//#ifdef RELAN
#ifdef RELAN
{ "relan", NULL, TRUE, TRUE,
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS,
NULL,
"[.relan line args] : Do a Reliability Analysis." } ,
//#endif
#endif
{ "ac", NULL, TRUE, TRUE,
{ 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS,

View File

@ -185,13 +185,13 @@ com_pss(wordlist *wl)
#endif
//#ifdef RELAN
#ifdef RELAN
void
com_relan (wordlist *wl)
{
dosim ("relan", wl) ;
}
//#endif
#endif
static int

View File

@ -17,9 +17,9 @@ void com_tran(wordlist *wl);
void com_pss(wordlist *wl);
/* SP */
//#ifdef RELAN
#ifdef RELAN
void com_relan (wordlist *wl) ;
//#endif
#endif
void com_sens(wordlist *wl);
void com_disto(wordlist *wl);

View File

@ -314,7 +314,7 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
}
#endif
//#ifdef RELAN
#ifdef RELAN
if (strcmp (token, "relan") == 0)
{
JOB *relanJob ;
@ -376,7 +376,7 @@ if_sens_run(CKTcircuit *ckt, wordlist *args, INPtables *tab)
}
}
}
//#endif
#endif
next:
while (*line) { /* read the entire line */

View File

@ -222,9 +222,9 @@ if_run(CKTcircuit *ckt, char *what, wordlist *args, INPtables *tab)
/* SP */
#endif
//#ifdef RELAN
#ifdef RELAN
|| eq (what, "relan")
//#endif
#endif
)
{
@ -342,9 +342,9 @@ if_run(CKTcircuit *ckt, char *what, wordlist *args, INPtables *tab)
/* SP */
#endif
//#ifdef RELAN
#ifdef RELAN
(eq (what, "relan")) ||
//#endif
#endif
(eq(what, "run")))
{

View File

@ -83,9 +83,9 @@ static struct plotab plotabs[NUMPLOTTYPES] = {
{ "spect", "spect" },
{ "pss", "periodic" },
//#ifdef RELAN
{ "relan", "reliability" },
//#endif
#ifdef RELAN
{ "relan", "reliability" }
#endif
};

View File

@ -125,7 +125,13 @@ pkginclude_HEADERS = \
FastNorm3.h \
fftext.h \
wallace.h \
wstdio.h \
wstdio.h
if RELAN_WANTED
include_HEADERS += \
relandefs.h
endif
MAINTAINERCLEANFILES = Makefile.in

View File

@ -423,13 +423,13 @@ extern int DCpss(CKTcircuit *, int);
/* SP */
#endif
//#ifdef RELAN
#ifdef RELAN
extern int CKTreliability (CKTcircuit *, unsigned int) ;
extern int RELANaskQuest (CKTcircuit *, JOB *, int, IFvalue *) ;
extern int RELANsetParm (CKTcircuit *, JOB *, int, IFvalue *) ;
extern int RELANinit (CKTcircuit *, JOB *) ;
extern int RELANanalysis (CKTcircuit *, int) ;
extern int CKTreliability (CKTcircuit *, unsigned int) ;
//#endif
#endif
extern int NaskQuest(CKTcircuit *, JOB *, int, IFvalue *);
extern int NsetParm(CKTcircuit *, JOB *, int, IFvalue *);

View File

@ -114,7 +114,9 @@ typedef struct SPICEdev {
int *DEVinstSize; /* size of an instance */
int *DEVmodSize; /* size of a model */
#ifdef RELAN
int (*DEVreliability)(GENmodel *, CKTcircuit *, unsigned int) ;
#endif
} SPICEdev; /* instance of structure for each possible type of device */

View File

@ -95,12 +95,7 @@ libckt_la_SOURCES = \
tranaskq.c \
traninit.c \
transetp.c \
cluster.c \
cktreliability.c \
relananalysis.c \
relanaskq.c \
relaninit.c \
relansetp.c
cluster.c
if PSS_WANTED
@ -111,6 +106,15 @@ libckt_la_SOURCES += \
psssetp.c
endif
if RELAN_WANTED
libckt_la_SOURCES += \
cktreliability.c \
relananalysis.c \
relanaskq.c \
relaninit.c \
relansetp.c
endif
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -I$(top_srcdir)/src/spicelib/devices
AM_CFLAGS = $(STATIC)

View File

@ -6,7 +6,11 @@
#include "analysis.h"
extern SPICEanalysis OPTinfo ;
#ifdef RELAN
extern SPICEanalysis RELANinfo ;
#endif
extern SPICEanalysis ACinfo ;
extern SPICEanalysis DCTinfo ;
extern SPICEanalysis DCOinfo ;
@ -27,7 +31,11 @@ extern SPICEanalysis SEN2info ;
SPICEanalysis *analInfo [] = {
&OPTinfo,
#ifdef RELAN
&RELANinfo,
#endif
&ACinfo,
&DCTinfo,
&DCOinfo,

View File

@ -224,6 +224,7 @@ CKTdoJob(CKTcircuit *ckt, int reset, TSKtask *task)
/* txl, cpl addition */
if (error == 1111) break;
#ifdef RELAN
if (i == 1)
{
/* In case of Reliability Analysis, perform the final CKTreliability */
@ -235,6 +236,7 @@ CKTdoJob(CKTcircuit *ckt, int reset, TSKtask *task)
return (error) ;
}
}
#endif
}
if (error)

View File

@ -27,10 +27,14 @@ libbsim4_la_SOURCES = \
bsim4ext.h \
bsim4init.c \
bsim4init.h \
bsim4itf.h \
b4reliability.c
bsim4itf.h
if RELAN_WANTED
libbsim4_la_SOURCES += \
b4reliability.c
endif
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
AM_CFLAGS = $(STATIC)

View File

@ -2654,6 +2654,7 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
TSTALLOC(BSIM4SbpPtr, BSIM4sNode, BSIM4bNodePrime);
}
#ifdef RELAN
if (model->BSIM4type == -1)
{
here->BSIM4reliability = TMALLOC (BSIM4relStruct, 1) ;
@ -2662,6 +2663,8 @@ do { if((here->ptr = SMPmakeElt(matrix,here->first,here->second))==(double *)NUL
here->BSIM4reliability->t_star = 0 ;
here->BSIM4reliability->IsON = -1 ;
}
#endif
}
}

View File

@ -1714,7 +1714,9 @@ int Size_Not_Found, i;
here->BSIM4u0temp *= T3;
}
/* adding delvto */
/* adding delvto */
#ifdef RELAN
if (model->BSIM4type == -1)
{
if (here->BSIM4reliability->IsON != -1)
@ -1722,6 +1724,8 @@ int Size_Not_Found, i;
here->BSIM4delvto = here->BSIM4reliability->deltaVth ;
}
}
#endif
here->BSIM4vth0 += here->BSIM4delvto;
here->BSIM4vfb = pParam->BSIM4vfb + model->BSIM4type * here->BSIM4delvto;

View File

@ -29,12 +29,14 @@ Modified by Pankaj Kumar Thakur, 07/23/2012
#include "ngspice/complex.h"
#include "ngspice/noisedef.h"
#ifdef RELAN
typedef struct sBSIM4relStruct {
double time ;
double deltaVth ;
double t_star ;
int IsON ;
} BSIM4relStruct ;
#endif
typedef struct sBSIM4instance
{
@ -581,7 +583,9 @@ typedef struct sBSIM4instance
double **BSIM4nVar;
#endif /* NONOISE */
#ifdef RELAN
BSIM4relStruct *BSIM4reliability ;
#endif
} BSIM4instance ;

View File

@ -32,4 +32,6 @@ extern int BSIM4noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
extern int BSIM4unsetup(GENmodel*,CKTcircuit*);
extern int BSIM4soaCheck(CKTcircuit *, GENmodel *);
#ifdef RELAN
extern int BSIM4reliability (GENmodel *, CKTcircuit *, unsigned int) ;
#endif

View File

@ -75,7 +75,9 @@ SPICEdev BSIM4info = {
&BSIM4iSize, /* DEVinstSize */
&BSIM4mSize, /* DEVmodSize */
#ifdef RELAN
BSIM4reliability
#endif
};

View File

@ -72,10 +72,7 @@ SPICEdev CAPinfo = {
/* DEVacct */ NULL,
#endif
/* DEVinstSize */ &CAPiSize,
/* DEVmodSize */ &CAPmSize,
NULL
/* DEVmodSize */ &CAPmSize
};

View File

@ -31,10 +31,14 @@ libmos1_la_SOURCES = \
mos1sset.c \
mos1supd.c \
mos1temp.c \
mos1trun.c \
mos1reliability.c
mos1trun.c
if RELAN_WANTED
libmos1_la_SOURCES += \
mos1reliability.c
endif
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include
AM_CFLAGS = $(STATIC)

View File

@ -13,12 +13,14 @@ Modified: 2000 AlansFixes
#include "ngspice/complex.h"
#include "ngspice/noisedef.h"
#ifdef RELAN
typedef struct sMOS1relStruct {
double time ;
double deltaVth ;
double t_star ;
int IsON ;
} MOS1relStruct ;
#endif
/* declarations for level 1 MOSFETs */
@ -271,7 +273,9 @@ typedef struct sMOS1instance {
#define MOS1dphibs_dw MOS1sens + 68
#define MOS1dphibd_dw MOS1sens + 69
#ifdef RELAN
MOS1relStruct *MOS1reliability ;
#endif
} MOS1instance ;

View File

@ -29,4 +29,6 @@ extern int MOS1disto(int,GENmodel*,CKTcircuit*);
extern int MOS1noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*);
extern int MOS1dSetup(GENmodel*,CKTcircuit*);
#ifdef RELAN
extern int MOS1reliability (GENmodel *, CKTcircuit *, unsigned int) ;
#endif

View File

@ -75,7 +75,9 @@ SPICEdev MOS1info = {
/* DEVinstSize */ &MOS1iSize,
/* DEVmodSize */ &MOS1mSize,
#ifdef RELAN
MOS1reliability
#endif
};

View File

@ -206,6 +206,7 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
TSTALLOC(MOS1SPbPtr,MOS1sNodePrime,MOS1bNode);
TSTALLOC(MOS1SPdpPtr,MOS1sNodePrime,MOS1dNodePrime);
#ifdef RELAN
if (model->MOS1type == -1)
{
here->MOS1reliability = TMALLOC (MOS1relStruct, 1) ;
@ -214,6 +215,8 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
here->MOS1reliability->t_star = 0 ;
here->MOS1reliability->IsON = -1 ;
}
#endif
}
}
return(OK);

View File

@ -73,10 +73,7 @@ SPICEdev VSRCinfo = {
/* DEVacct */ NULL,
#endif
/* DEVinstSize */ &VSRCiSize,
/* DEVmodSize */ &VSRCmSize,
NULL
/* DEVmodSize */ &VSRCmSize
};

View File

@ -612,7 +612,7 @@ dot_pss(char *line, void *ckt, INPtables *tab, card *current,
/* SP */
#endif
//#ifdef RELAN
#ifdef RELAN
static int
dot_relan (char *line, void *ckt, INPtables *tab, card *current, void *task, void *gnode, JOB *foo)
{
@ -670,7 +670,7 @@ dot_relan (char *line, void *ckt, INPtables *tab, card *current, void *task, voi
return (0) ;
}
//#endif
#endif
static int
dot_options(char *line, CKTcircuit *ckt, INPtables *tab, card *current,
@ -759,11 +759,11 @@ INP2dot(CKTcircuit *ckt, INPtables *tab, card *current, TSKtask *task, CKTnode *
/* SP */
#endif
//#ifdef RELAN
#ifdef RELAN
} else if ((strcmp (token, ".relan") == 0)) {
rtn = dot_relan (line, ckt, tab, current, task, gnode, foo) ;
goto quit ;
//#endif
#endif
} else if ((strcmp(token, ".subckt") == 0) ||
(strcmp(token, ".ends") == 0)) {