diff --git a/configure.ac b/configure.ac index 6f043c113..388e29169 100644 --- a/configure.ac +++ b/configure.ac @@ -800,6 +800,7 @@ AC_MSG_RESULT([Settings which were chosen:]) if test "x$enable_sense2" = xyes; then AC_DEFINE([WANT_SENSE2], [], [Define if we want spice2 sensitivity analysis]) AC_MSG_RESULT([Spice2 sensitivity analysis enabled]) + AC_MSG_WARN([This feature is UNSUPPORTED]) fi if test "x$enable_nobypass" = xyes; then AC_DEFINE([NOBYPASS], [], [Define if we want NOBYPASS]) @@ -943,6 +944,8 @@ AM_CONDITIONAL([NUMDEV_WANTED], [test "x$enable_cider" = xyes]) AM_CONDITIONAL([PSS_WANTED], [test "x$enable_pss" = xyes]) +AM_CONDITIONAL([SENSE2_WANTED], [test "x$enable_sense2" = xyes]) + # adms option if test "x$enable_adms" = xyes ; then AC_MSG_RESULT([********************************** @@ -1167,6 +1170,7 @@ AC_CONFIG_FILES([Makefile src/xspice/enh/Makefile src/xspice/ipc/Makefile src/xspice/idn/Makefile + src/unsupported/Makefile tests/Makefile tests/bsim1/Makefile tests/bsim2/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 7deac3cfe..8e88ab681 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ ## Process this file with automake to produce Makefile.in SUBDIRS = misc maths frontend spicelib include/ngspice -DIST_SUBDIRS = misc maths frontend spicelib include/ngspice xspice ciderlib +DIST_SUBDIRS = misc maths frontend spicelib include/ngspice xspice ciderlib unsupported if XSPICE_WANTED SUBDIRS += xspice @@ -11,6 +11,10 @@ if CIDER_WANTED SUBDIRS += ciderlib endif +if SENSE2_WANTED +SUBDIRS += unsupported +endif + if !TCL_MODULE if !SHARED_MODULE bin_PROGRAMS = ngspice ngnutmeg @@ -27,7 +31,7 @@ endif !SHARED_MODULE endif !TCL_MODULE EXTRA_DIST = ngspice.txt setplot spectrum \ - devload devaxis ciderinit winmain.c winmain.h unsupported \ + devload devaxis ciderinit winmain.c winmain.h \ tclspice.c tclspice.map pkgIndex.tcl.in spinit.in tclspinit.in \ main.c sharedspice.c @@ -137,6 +141,10 @@ ngspice_LDADD += \ spicelib/analysis/libckt.la \ spicelib/devices/libdev.la +if SENSE2_WANTED +ngspice_LDADD += unsupported/libunsupported.la +endif + if XSPICE_WANTED ngspice_LDADD += \ xspice/cm/libcmxsp.la \ diff --git a/src/include/ngspice/cktdefs.h b/src/include/ngspice/cktdefs.h index f4b2aba47..80ac6259e 100644 --- a/src/include/ngspice/cktdefs.h +++ b/src/include/ngspice/cktdefs.h @@ -382,10 +382,14 @@ extern int PZinit(CKTcircuit *); extern int PZpost(CKTcircuit *); extern int PZaskQuest(CKTcircuit *, JOB *, int , IFvalue *); extern int PZsetParm(CKTcircuit *, JOB *, int , IFvalue *); + +#ifdef WANT_SENSE2 extern int SENaskQuest(CKTcircuit *, JOB *, int , IFvalue *); extern void SENdestroy(SENstruct *); extern int SENsetParm(CKTcircuit *, JOB *, int , IFvalue *); -extern int SENstartup(CKTcircuit *); +extern int SENstartup(CKTcircuit *, int); +#endif + extern int SPIinit(IFfrontEnd *, IFsimulator **); extern int TFanal(CKTcircuit *, int); extern int TFaskQuest(CKTcircuit *, JOB *, int , IFvalue *); diff --git a/src/spicelib/analysis/analysis.c b/src/spicelib/analysis/analysis.c index cbb3bd4ec..ecb9279a6 100644 --- a/src/spicelib/analysis/analysis.c +++ b/src/spicelib/analysis/analysis.c @@ -20,6 +20,10 @@ extern SPICEanalysis SENSinfo; extern SPICEanalysis PSSinfo; #endif +#ifdef WANT_SENSE2 +extern SPICEanalysis SEN2info; +#endif + SPICEanalysis *analInfo[] = { &OPTinfo, &ACinfo, @@ -34,6 +38,9 @@ SPICEanalysis *analInfo[] = { #ifdef WITH_PSS &PSSinfo, #endif +#ifdef WANT_SENSE2 + &SEN2info, +#endif }; diff --git a/src/spicelib/analysis/cktsetup.c b/src/spicelib/analysis/cktsetup.c index 49a99d80d..446749094 100644 --- a/src/spicelib/analysis/cktsetup.c +++ b/src/spicelib/analysis/cktsetup.c @@ -43,7 +43,9 @@ CKTsetup(CKTcircuit *ckt) #ifdef WANT_SENSE2 if(ckt->CKTsenInfo){ - if (error = CKTsenSetup(ckt)) return(error); + error = CKTsenSetup(ckt); + if (error) + return(error); } #endif diff --git a/src/spicelib/analysis/dcop.c b/src/spicelib/analysis/dcop.c index 64d5d85d2..55c79d90e 100644 --- a/src/spicelib/analysis/dcop.c +++ b/src/spicelib/analysis/dcop.c @@ -21,6 +21,11 @@ Modified: 2000 AlansFixes int DCop(CKTcircuit *ckt, int notused) { +#ifdef WANT_SENSE2 + int i, senmode, size; + long save; +#endif + int converged; int error; IFuid *nameList; /* va: tmalloc'ed list */ @@ -133,7 +138,10 @@ DCop(CKTcircuit *ckt, int notused) for(i = 1; i<=size ; i++){ ckt->CKTrhsOp[i] = ckt->CKTrhsOld[i]; } - if(error = CKTsenDCtran(ckt)) return(error); + error = CKTsenDCtran(ckt); + if (error) + return(error); + ckt->CKTmode = save; ckt->CKTsenInfo->SENmode = senmode; diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index 708af9130..ff9dee3e7 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -78,6 +78,8 @@ DCtran(CKTcircuit *ckt, int firsttime; int error; #ifdef WANT_SENSE2 + int save, save2, size; + long save1; #ifdef SENSDEBUG FILE *outsen; #endif /* SENSDEBUG */ @@ -316,7 +318,10 @@ DCtran(CKTcircuit *ckt, save2 = ckt->CKTorder; ckt->CKTmode = save_mode; ckt->CKTorder = save_order; - if(error = CKTsenDCtran(ckt)) return(error); + error = CKTsenDCtran(ckt); + if (error) + return(error); + ckt->CKTmode = save1; ckt->CKTorder = save2; } @@ -792,7 +797,10 @@ resume: save2 = ckt->CKTorder; ckt->CKTmode = save_mode; ckt->CKTorder = save_order; - if(error = CKTsenDCtran(ckt)) return(error); + error = CKTsenDCtran (ckt); + if (error) + return(error); + ckt->CKTmode = save1; ckt->CKTorder = save2; } @@ -852,7 +860,10 @@ resume: save2 = ckt->CKTorder; ckt->CKTmode = save_mode; ckt->CKTorder = save_order; - if(error = CKTsenDCtran(ckt)) return(error); + error = CKTsenDCtran(ckt); + if (error) + return (error); + ckt->CKTmode = save1; ckt->CKTorder = save2; } diff --git a/src/spicelib/analysis/dctrcurv.c b/src/spicelib/analysis/dctrcurv.c index 49e4742b9..f4d4f82c9 100644 --- a/src/spicelib/analysis/dctrcurv.c +++ b/src/spicelib/analysis/dctrcurv.c @@ -50,6 +50,7 @@ DCtrCurv(CKTcircuit *ckt, int restart) static runDesc *plot = NULL; #ifdef WANT_SENSE2 + long save; #ifdef SENSDEBUG if(ckt->CKTsenInfo && (ckt->CKTsenInfo->SENmode&DCSEN) ){ printf("\nDC Sensitivity Results\n\n"); @@ -458,7 +459,10 @@ resume: senmode = ckt->CKTsenInfo->SENmode; save = ckt->CKTmode; ckt->CKTsenInfo->SENmode = DCSEN; - if(error = CKTsenDCtran(ckt)) return (error); + error = CKTsenDCtran(ckt); + if (error) + return(error); + ckt->CKTmode = save; ckt->CKTsenInfo->SENmode = senmode; diff --git a/src/spicelib/parser/inp2dot.c b/src/spicelib/parser/inp2dot.c index 206c534ba..37fbe0297 100644 --- a/src/spicelib/parser/inp2dot.c +++ b/src/spicelib/parser/inp2dot.c @@ -567,6 +567,8 @@ dot_sens2(char *line, CKTcircuit *ckt, INPtables *tab, card *current, int i; /* generic loop variable */ char *token; /* a token from the line */ + NG_IGNORE(gnode); + /* .sens {AC} {DC} {TRAN} [dev=nnn parm=nnn]* */ which = -1; for (i = 0; i < ft_sim->numAnalyses; i++) { diff --git a/src/unsupported/Makefile.am b/src/unsupported/Makefile.am new file mode 100644 index 000000000..d54234be8 --- /dev/null +++ b/src/unsupported/Makefile.am @@ -0,0 +1,22 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = readme spiced.c + +noinst_LTLIBRARIES = libunsupported.la + +libunsupported_la_SOURCES = \ + cktsenac.c \ + cktsenup.c \ + cktsncom.c \ + cktsndct.c \ + cktsnset.c \ + cktsnld.c \ + sen2dest.c \ + sen2setp.c \ + snaskq.c \ + snstart.c + + +AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include +AM_CFLAGS = $(STATIC) +MAINTAINERCLEANFILES = Makefile.in diff --git a/src/unsupported/cktsenac.c b/src/unsupported/cktsenac.c index 07b18e71a..609956d7d 100644 --- a/src/unsupported/cktsenac.c +++ b/src/unsupported/cktsenac.c @@ -5,7 +5,7 @@ Author: 1985 Thomas L. Quarles /* */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/smpdefs.h" #include "ngspice/cktdefs.h" @@ -20,8 +20,7 @@ Author: 1985 Thomas L. Quarles */ int -CKTsenAC(ckt) -register CKTcircuit *ckt; +CKTsenAC(CKTcircuit *ckt) { int error; @@ -30,13 +29,17 @@ register CKTcircuit *ckt; #endif /* SENSDEBUG */ - if(error = CKTsenLoad(ckt)) return(error); + error = CKTsenLoad(ckt); + if (error) + return(error); #ifdef SENSDEBUG printf("after CKTsenLoad\n"); #endif /* SENSDEBUG */ - if(error = CKTsenComp(ckt)) return(error); + error = CKTsenComp(ckt); + if (error) + return(error); #ifdef SENSDEBUG printf("after CKTsenComp\n"); diff --git a/src/unsupported/cktsenup.c b/src/unsupported/cktsenup.c index 830370f4c..32c17430e 100644 --- a/src/unsupported/cktsenup.c +++ b/src/unsupported/cktsenup.c @@ -11,7 +11,7 @@ Author: 1985 Thomas L. Quarles * in the given circuit */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/smpdefs.h" #include "ngspice/cktdefs.h" @@ -22,10 +22,9 @@ Author: 1985 Thomas L. Quarles int -CKTsenUpdate(ckt) -register CKTcircuit *ckt; +CKTsenUpdate(CKTcircuit *ckt) { - register int i; + int i; int error; diff --git a/src/unsupported/cktsncom.c b/src/unsupported/cktsncom.c index 619b31f40..9b90f6eb2 100644 --- a/src/unsupported/cktsncom.c +++ b/src/unsupported/cktsncom.c @@ -10,7 +10,7 @@ Author: 1985 Thomas L. Quarles * of the given circuit */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/smpdefs.h" #include "ngspice/cktdefs.h" @@ -21,10 +21,9 @@ Author: 1985 Thomas L. Quarles int -CKTsenComp(ckt) -register CKTcircuit *ckt; +CKTsenComp(CKTcircuit *ckt) { - register int size; + int size; int row; int col; SENstruct *info; diff --git a/src/unsupported/cktsndct.c b/src/unsupported/cktsndct.c index 195c0e7be..4cd70ba96 100644 --- a/src/unsupported/cktsndct.c +++ b/src/unsupported/cktsndct.c @@ -10,7 +10,7 @@ Author: 1985 Thomas L. Quarles * calculations */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/smpdefs.h" #include "ngspice/cktdefs.h" @@ -21,8 +21,7 @@ Author: 1985 Thomas L. Quarles int -CKTsenDCtran(ckt) -register CKTcircuit *ckt; +CKTsenDCtran(CKTcircuit *ckt) { int error; diff --git a/src/unsupported/cktsnld.c b/src/unsupported/cktsnld.c index 57e7ce436..051d5dc71 100644 --- a/src/unsupported/cktsnld.c +++ b/src/unsupported/cktsnld.c @@ -12,7 +12,7 @@ Author: 1985 Thomas L. Quarles * in the given circuit */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/smpdefs.h" #include "ngspice/cktdefs.h" @@ -23,10 +23,9 @@ Author: 1985 Thomas L. Quarles int -CKTsenLoad(ckt) -register CKTcircuit *ckt; +CKTsenLoad(CKTcircuit *ckt) { - register int i; + int i; int size,row,col; int error; diff --git a/src/unsupported/cktsnprt.c b/src/unsupported/cktsnprt.c index fb6b1b3c6..35c7d91dd 100644 --- a/src/unsupported/cktsnprt.c +++ b/src/unsupported/cktsnprt.c @@ -5,7 +5,7 @@ Author: 1985 Thomas L. Quarles /* */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/smpdefs.h" #include "ngspice/cktdefs.h" @@ -22,10 +22,9 @@ Author: 1985 Thomas L. Quarles */ void -CKTsenPrint(ckt) -register CKTcircuit *ckt; +CKTsenPrint(CKTcircuit *ckt) { - register int i; + int i; for (i=0;iDEVsenPrint && ckt->CKThead[i] ) { diff --git a/src/unsupported/cktsnset.c b/src/unsupported/cktsnset.c index 2cb344b60..5faeeb03a 100644 --- a/src/unsupported/cktsnset.c +++ b/src/unsupported/cktsnset.c @@ -13,7 +13,7 @@ Author: 1985 Thomas L. Quarles * in the given circuit */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/smpdefs.h" #include "ngspice/cktdefs.h" @@ -24,13 +24,11 @@ Author: 1985 Thomas L. Quarles int -CKTsenSetup(ckt) -register CKTcircuit *ckt; - +CKTsenSetup(CKTcircuit *ckt) { - register int i; + int i; int error; - register SENstruct *info; + SENstruct *info; #ifdef SENSDEBUG printf("CKTsenSetup\n"); #endif /* SENSDEBUG */ diff --git a/src/unsupported/sen2dest.c b/src/unsupported/sen2dest.c index 583871016..141019b00 100644 --- a/src/unsupported/sen2dest.c +++ b/src/unsupported/sen2dest.c @@ -9,20 +9,18 @@ Author: 1985 Thomas L. Quarles * given circuit */ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/cktdefs.h" #include "ngspice/devdefs.h" -#include "util.h" #include "ngspice/ifsim.h" #include "ngspice/sperror.h" #include "ngspice/suffix.h" void -SENdestroy(info) - SENstruct *info; +SENdestroy(SENstruct *info) { - register int i; + int i; int size; diff --git a/src/unsupported/sen2setp.c b/src/unsupported/sen2setp.c index b407e3b4d..eac9e2ed6 100644 --- a/src/unsupported/sen2setp.c +++ b/src/unsupported/sen2setp.c @@ -3,23 +3,21 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/ifsim.h" #include "ngspice/iferrmsg.h" #include "ngspice/sen2defs.h" #include "ngspice/cktdefs.h" -#include "util.h" #include "ngspice/suffix.h" +#include "../spicelib/analysis/analysis.h" /* ARGSUSED */ int -SENsetParm(ckt,anal,which,value) - CKTcircuit *ckt; - JOB *anal; - int which; - IFvalue *value; +SENsetParm(CKTcircuit *ckt, JOB *anal, int which, IFvalue *value) { + NG_IGNORE(ckt); + switch(which) { case SEN_DC: diff --git a/src/unsupported/snaskq.c b/src/unsupported/snaskq.c index ddaf0d75c..e253e5b4f 100644 --- a/src/unsupported/snaskq.c +++ b/src/unsupported/snaskq.c @@ -3,7 +3,7 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/ifsim.h" #include "ngspice/iferrmsg.h" @@ -13,12 +13,12 @@ Author: 1985 Thomas L. Quarles /* ARGSUSED */ int -SENaskQuest(ckt,anal,which,value) - CKTcircuit *ckt; - JOB *anal; - int which; - IFvalue *value; +SENaskQuest(CKTcircuit *ckt, JOB *anal, int which, IFvalue *value) { + NG_IGNORE(ckt); + NG_IGNORE(anal); + NG_IGNORE(value); + switch(which) { default: diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index 79449259c..3092e78d9 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -3,11 +3,10 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -#include "spice.h" +#include "ngspice/ngspice.h" #include #include "ngspice/ifsim.h" #include "ngspice/cktdefs.h" -#include "util.h" #include "ngspice/const.h" #include "ngspice/sperror.h" #include "ngspice/suffix.h" @@ -17,8 +16,7 @@ Author: 1985 Thomas L. Quarles */ int -SENstartup(ckt) - CKTcircuit *ckt; +SENstartup(CKTcircuit *ckt, int restart) { int i; int err; @@ -26,6 +24,11 @@ SENstartup(ckt) int type; GENinstance *fast; + if (restart) { + fprintf(stderr, "unsupported code, (SENstartup), doesn't support restart\n"); + exit(1); + } + #ifdef SENSDEBUG printf("SENstartup\n"); #endif /* SENSDEBUG */ @@ -38,7 +41,7 @@ SENstartup(ckt) for(i=0;iCKTsenInfo->SENnumVal;i++) { type = -1; fast = NULL; - err = CKTfndDev((GENERIC*)ckt,&type,(GENERIC**)&fast, + err = CKTfndDev(ckt, &type, &fast, ((ckt->CKTsenInfo->SENdevices)[i]), NULL, NULL); if(err != OK) return(err);