From 598238f46a0a996790c9e810e1be532bca07fb19 Mon Sep 17 00:00:00 2001 From: rlar Date: Mon, 2 Jan 2012 12:31:22 +0000 Subject: [PATCH] conditionally compile PSS analysis --- configure.ac | 20 ++++++++++++++------ src/frontend/commands.c | 4 ++++ src/frontend/runcoms.c | 2 ++ src/frontend/shyu.c | 2 ++ src/frontend/spiceif.c | 7 ++++++- src/include/ngspice/cktdefs.h | 2 ++ src/include/ngspice/pssdefs.h | 7 ++++--- src/spicelib/analysis/Makefile.am | 13 +++++++++---- src/spicelib/analysis/analysis.c | 5 +++++ src/spicelib/parser/inp2dot.c | 4 ++++ visualc/vngspice.vcproj | 16 ---------------- 11 files changed, 52 insertions(+), 30 deletions(-) diff --git a/configure.ac b/configure.ac index 3c194ac8c..37bf9af27 100644 --- a/configure.ac +++ b/configure.ac @@ -132,27 +132,31 @@ AC_ARG_ENABLE(expdevices, dnl --enable-xspice: define XSPICE in the code. This is for xspice support AC_ARG_ENABLE(xspice, - AS_HELP_STRING([--enable-xspice],[Enable XSpice enhancements, (experimental) ])) + AS_HELP_STRING([--enable-xspice],[Enable XSpice enhancements, (experimental)])) dnl --enable-cider: define CIDER in the code. This is for CIDER support AC_ARG_ENABLE(cider, - AS_HELP_STRING([--enable-cider],[Enable CIDER enhancements, (experimental) ])) + AS_HELP_STRING([--enable-cider],[Enable CIDER enhancements, (experimental)])) dnl --enable-adms: define ADMS in the code. This is for the adms Verilog-A compiler support AC_ARG_ENABLE(adms, - AS_HELP_STRING([--enable-adms],[Enable ADMS code models, (experimental) ])) + AS_HELP_STRING([--enable-adms],[Enable ADMS code models, (experimental)])) dnl --enable-adms3: define ADMS in the code. This is for the adms Verilog-A compiler support AC_ARG_ENABLE(adms3, - AS_HELP_STRING([--enable-adms3],[Enable ADMS code models, (experimental) (adms3) ])) + AS_HELP_STRING([--enable-adms3],[Enable ADMS code models, (experimental) (adms3)])) + +dnl --enable-xspice: define XSPICE in the code. This is for xspice support +AC_ARG_ENABLE(pss, + AS_HELP_STRING([--enable-pss],[Enable PSS analysis, (very experimental)])) dnl --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) ])) + AS_HELP_STRING([--enable-ndev],[Enable NDEV interface, (experimental)])) dnl --enable-cluster: define CLUSTER in the code. This is for cluster support AC_ARG_ENABLE(cluster, - AS_HELP_STRING([--enable-cluster],[Enable cluster support, (experimental) ])) + AS_HELP_STRING([--enable-cluster],[Enable cluster support, (experimental)])) dnl --enable-help: try to force --ansi option to the compiler AC_ARG_ENABLE(help, @@ -782,6 +786,9 @@ if test "$enable_pzdebug" = "yes"; then AC_DEFINE(PZDEBUG,[],[Define if you want to debug pole-zero analysis]) AC_MSG_RESULT(WARNING: Pole/Zero analysis debug is enabled) fi +if test "$enable_pss" = "yes"; then + AC_DEFINE(WITH_PSS,[],[Define if you want PSS analysis]) +fi if test "$enable_blktmsdebug" = "yes"; 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) @@ -862,6 +869,7 @@ AM_CONDITIONAL([CIDER_WANTED], [test "$enable_cider" = "yes"]) AM_CONDITIONAL([NUMDEV_WANTED], [test "$enable_cider" = "yes"]) +AM_CONDITIONAL([PSS_WANTED], [test "$enable_pss" = "yes"]) dnl adms option if test "$enable_adms" = "yes" -o "$enable_adms3" = "yes" ; then diff --git a/src/frontend/commands.c b/src/frontend/commands.c index 88c9a3ad0..2f61d28d9 100644 --- a/src/frontend/commands.c +++ b/src/frontend/commands.c @@ -276,12 +276,14 @@ struct comm spcp_coms[] = { { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.tran line args] : Do a transient analysis." } , +#ifdef WITH_PSS /* SP: Steady State Analysis */ { "pss", com_pss, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.pss line args] : Do a periodic state analysis." } , /* SP */ +#endif { "ac", com_ac, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, @@ -697,12 +699,14 @@ struct comm nutcp_coms[] = { { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.tran line args] : Do a transient analysis." } , +#ifdef WITH_PSS /* SP: Steady State Analysis */ { "pss", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, "[.pss line args] : Do a periodic steady state analysis." } , /* SP */ +#endif { "ac", NULL, TRUE, TRUE, { 0, 0, 0, 0 }, E_DEFHMASK, 0, LOTS, NULL, diff --git a/src/frontend/runcoms.c b/src/frontend/runcoms.c index 75d8d92ef..56c3d995e 100644 --- a/src/frontend/runcoms.c +++ b/src/frontend/runcoms.c @@ -178,6 +178,7 @@ com_noise(wordlist *wl) return; } +#ifdef WITH_PSS /* SP: Steady State Analysis */ void com_pss(wordlist *wl) @@ -187,6 +188,7 @@ com_pss(wordlist *wl) return; } /* SP */ +#endif static int dosim( diff --git a/src/frontend/shyu.c b/src/frontend/shyu.c index 723b41d79..3b5696808 100644 --- a/src/frontend/shyu.c +++ b/src/frontend/shyu.c @@ -283,6 +283,7 @@ uic: } } +#ifdef WITH_PSS /* *********************** */ /* PSS - Spertica - 100910 */ /* *********************** */ @@ -327,6 +328,7 @@ uic: if(error) current->error = INPerrCat(current->error, INPerror(error)); } +#endif next: while(*line) { /* read the entire line */ diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index b1e2ec2d0..194ce0a5c 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -215,9 +215,12 @@ if_run(CKTcircuit *ckt, char *what, wordlist *args, INPtables *tab) || eq(what, "sens") || eq(what,"tf") || eq(what, "noise") +#ifdef WITH_PSS /* SP: Steady State Analysis */ - || eq(what, "pss")) + || eq(what, "pss") /* SP */ +#endif + ) { s = wl_flatten(args); /* va: tfree char's tmalloc'ed in wl_flatten */ (void) sprintf(buf, ".%s", s); @@ -331,9 +334,11 @@ if_run(CKTcircuit *ckt, char *what, wordlist *args, INPtables *tab) ||(eq(what, "adjsen")) ||(eq(what, "sens")) ||(eq(what,"tf")) +#ifdef WITH_PSS /* SP: Steady State Analysis */ ||(eq(what, "pss")) /* SP */ +#endif ||(eq(what, "run")) ) { /*CDHW Run the analysis pointed to by ci_curTask CDHW*/ diff --git a/src/include/ngspice/cktdefs.h b/src/include/ngspice/cktdefs.h index ce2e78aba..d6f478849 100644 --- a/src/include/ngspice/cktdefs.h +++ b/src/include/ngspice/cktdefs.h @@ -264,6 +264,7 @@ struct CKTcircuit { Enh_Ckt_Data_t *enh; /* data used by general enhancements */ #endif /* gtri - evt - wbk - 5/20/91 - add event-driven and enhancements data */ +#ifdef WITH_PSS /* SP: Steady State Analysis - 100609 */ double CKTstabTime; /* PSS stab time */ double CKTguessedFreq; /* PSS guessed frequency */ @@ -273,6 +274,7 @@ struct CKTcircuit { double CKTsteady_coeff; int CKTsc_iter; /* SP: 100609 */ +#endif }; diff --git a/src/include/ngspice/pssdefs.h b/src/include/ngspice/pssdefs.h index 6b5371761..e684bbd7b 100644 --- a/src/include/ngspice/pssdefs.h +++ b/src/include/ngspice/pssdefs.h @@ -2,8 +2,8 @@ Author: 2010-05 Stefano Perticaroli ``spertica'' **********/ -#ifndef PSS -#define PSS +#ifndef PSS_H +#define PSS_H #include "ngspice/jobdefs.h" #include "ngspice/tskdefs.h" @@ -35,4 +35,5 @@ typedef struct { #define PSS_UIC 6 #define SC_ITER 7 #define STEADY_COEFF 8 -#endif /*PSS*/ + +#endif diff --git a/src/spicelib/analysis/Makefile.am b/src/spicelib/analysis/Makefile.am index 63bb6b6ab..de3ea3002 100644 --- a/src/spicelib/analysis/Makefile.am +++ b/src/spicelib/analysis/Makefile.am @@ -72,7 +72,6 @@ libckt_la_SOURCES = \ dcoaskq.c \ dcop.c \ dcosetp.c \ - dcpss.c \ dctaskq.c \ dctran.c \ dctrcurv.c \ @@ -86,9 +85,6 @@ libckt_la_SOURCES = \ ninteg.c \ noisean.c \ nsetparm.c \ - pssaskq.c \ - pssinit.c \ - psssetp.c \ pzan.c \ pzaskq.c \ pzsetp.c \ @@ -103,5 +99,14 @@ libckt_la_SOURCES = \ cluster.c +if PSS_WANTED +libckt_la_SOURCES += \ + dcpss.c \ + pssaskq.c \ + pssinit.c \ + psssetp.c +endif + + AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -I$(top_srcdir)/src/spicelib/devices MAINTAINERCLEANFILES = Makefile.in diff --git a/src/spicelib/analysis/analysis.c b/src/spicelib/analysis/analysis.c index 7964edf23..7ce4e810f 100644 --- a/src/spicelib/analysis/analysis.c +++ b/src/spicelib/analysis/analysis.c @@ -17,9 +17,12 @@ extern SPICEanalysis TFinfo; extern SPICEanalysis DISTOinfo; extern SPICEanalysis NOISEinfo; extern SPICEanalysis SENSinfo; + +#ifdef WITH_PSS /* SP: Periodic Steady State*/ extern SPICEanalysis PSSinfo; /* SP */ +#endif SPICEanalysis *analInfo[] = { &OPTinfo, @@ -32,7 +35,9 @@ SPICEanalysis *analInfo[] = { &DISTOinfo, &NOISEinfo, &SENSinfo, +#ifdef WITH_PSS &PSSinfo, +#endif }; diff --git a/src/spicelib/parser/inp2dot.c b/src/spicelib/parser/inp2dot.c index 5aa420a82..d1fb530d3 100644 --- a/src/spicelib/parser/inp2dot.c +++ b/src/spicelib/parser/inp2dot.c @@ -627,6 +627,7 @@ dot_sens2(char *line, CKTcircuit *ckt, INPtables *tab, card *current, } #endif +#ifdef WITH_PSS /*SP: Steady State Analyis */ static int dot_pss(char *line, void *ckt, INPtables *tab, card *current, @@ -692,6 +693,7 @@ dot_pss(char *line, void *ckt, INPtables *tab, card *current, return (0); } /* SP */ +#endif static int dot_options(char *line, CKTcircuit *ckt, INPtables *tab, card *current, @@ -772,11 +774,13 @@ INP2dot(CKTcircuit *ckt, INPtables *tab, card *current, TSKtask *task, CKTnode * } else if ((strcmp(token, ".tran") == 0)) { rtn = dot_tran(line, ckt, tab, current, task, gnode, foo); goto quit; +#ifdef WITH_PSS /* SP: Steady State Analysis */ } else if ((strcmp(token, ".pss") == 0)) { rtn = dot_pss(line, ckt, tab, current, task, gnode, foo); goto quit; /* SP */ +#endif } else if ((strcmp(token, ".subckt") == 0) || (strcmp(token, ".ends") == 0)) { /* not yet implemented - warn & ignore */ diff --git a/visualc/vngspice.vcproj b/visualc/vngspice.vcproj index 87d7cdcd8..a606a93b5 100644 --- a/visualc/vngspice.vcproj +++ b/visualc/vngspice.vcproj @@ -5301,10 +5301,6 @@ RelativePath="..\src\spicelib\analysis\dcosetp.c" > - - @@ -7913,18 +7909,6 @@ RelativePath="..\src\spicelib\devices\jfet2\psmodel.c" > - - - - - -