Browse Source

fix sense2, which is unsupported code

pre-master-46
Francesco Lannutti 13 years ago
committed by rlar
parent
commit
581e0a6d11
  1. 4
      configure.ac
  2. 12
      src/Makefile.am
  3. 6
      src/include/ngspice/cktdefs.h
  4. 7
      src/spicelib/analysis/analysis.c
  5. 4
      src/spicelib/analysis/cktsetup.c
  6. 10
      src/spicelib/analysis/dcop.c
  7. 17
      src/spicelib/analysis/dctran.c
  8. 6
      src/spicelib/analysis/dctrcurv.c
  9. 2
      src/spicelib/parser/inp2dot.c
  10. 22
      src/unsupported/Makefile.am
  11. 13
      src/unsupported/cktsenac.c
  12. 7
      src/unsupported/cktsenup.c
  13. 7
      src/unsupported/cktsncom.c
  14. 5
      src/unsupported/cktsndct.c
  15. 7
      src/unsupported/cktsnld.c
  16. 7
      src/unsupported/cktsnprt.c
  17. 10
      src/unsupported/cktsnset.c
  18. 8
      src/unsupported/sen2dest.c
  19. 12
      src/unsupported/sen2setp.c
  20. 12
      src/unsupported/snaskq.c
  21. 13
      src/unsupported/snstart.c

4
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

12
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 \

6
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 *);

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

4
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

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

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

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

2
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++) {

22
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

13
src/unsupported/cktsenac.c

@ -5,7 +5,7 @@ Author: 1985 Thomas L. Quarles
/*
*/
#include "spice.h"
#include "ngspice/ngspice.h"
#include <stdio.h>
#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");

7
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 <stdio.h>
#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;

7
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 <stdio.h>
#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;

5
src/unsupported/cktsndct.c

@ -10,7 +10,7 @@ Author: 1985 Thomas L. Quarles
* calculations
*/
#include "spice.h"
#include "ngspice/ngspice.h"
#include <stdio.h>
#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;

7
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 <stdio.h>
#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;

7
src/unsupported/cktsnprt.c

@ -5,7 +5,7 @@ Author: 1985 Thomas L. Quarles
/*
*/
#include "spice.h"
#include "ngspice/ngspice.h"
#include <stdio.h>
#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;i<DEVmaxnum;i++) {
if ( DEVices[i]->DEVsenPrint && ckt->CKThead[i] ) {

10
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 <stdio.h>
#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 */

8
src/unsupported/sen2dest.c

@ -9,20 +9,18 @@ Author: 1985 Thomas L. Quarles
* given circuit
*/
#include "spice.h"
#include "ngspice/ngspice.h"
#include <stdio.h>
#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;

12
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 <stdio.h>
#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:

12
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 <stdio.h>
#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:

13
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 <stdio.h>
#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;i<ckt->CKTsenInfo->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);

Loading…
Cancel
Save