Browse Source

* AUTHORS TODO: Small updates.


			
			
				pre-master-46
			
			
		
arno 26 years ago
parent
commit
d7ad0ee10c
  1. 1
      AUTHORS
  2. 20
      TODO
  3. 1
      configure.in
  4. 3
      src/Makefile.am
  5. 3
      src/analysis/Makefile.am
  6. 47
      src/analysis/cktcrte.c
  7. 62
      src/analysis/cktinit.c
  8. 14
      src/analysis/dctran.c
  9. 18
      src/main.c
  10. 8
      src/spicelib/devices/Makefile.am
  11. 3
      src/spicelib/devices/README
  12. 32
      src/spicelib/devices/cktaccept.c
  13. 6
      src/spicelib/devices/cktaccept.h
  14. 53
      src/spicelib/devices/cktcrte.c
  15. 64
      src/spicelib/devices/cktinit.c
  16. 10
      src/spicelib/devices/dev.c
  17. 3
      src/spicelib/devices/dev.h
  18. 0
      src/spicelib/devices/devsup.c
  19. 6
      src/spicelib/devices/devsup/.cvsignore
  20. 10
      src/spicelib/devices/devsup/Makefile.am

1
AUTHORS

@ -17,6 +17,7 @@ Min-Chie Jeng
Kenneth H. Keller
Mathew Lew
Weidong Liu
Richard D. McRoberts
Gary W. Ng
Hong June Park
Thomas L. Quarles

20
TODO

@ -6,9 +6,9 @@ Standards conformance
---------------------
Add proper copyright headers to every source, header, documentation
and other files
and other files.
Fix all compiler warnings
Fix all compiler warnings.
Remove smktemp() in favor of tmpfile() or other ANSI C equivalent;
Note: different symantics!
@ -20,8 +20,8 @@ available.
Usability issues
------------------
Plug all memory leaks (use debauch from
http://quorum.tamu.edu/jon/gnu/ to find them)
Plug all memory leaks; use debauch (http://quorum.tamu.edu/jon/gnu/)
or another memory checker to find them.
Either get help program functioning again; OR interface to webbrowser,
info reader and get rid of all help-related code. Option 2 is the
@ -31,15 +31,17 @@ most appealing.
Refactorings
------------
Make devices dynamically loadable (perhaps use framework from glib)
Make devices dynamically loadable (perhaps use framework from glib).
Separate out circuit builder from the analysis code and put it in a
separate src/builder directory
Separate out circuit builder from the analysis code and put it in the
devices directory (rename devices directory to simbuilder at some
point). [PARTIAL]
Separate ngspice and nutmeg; i.e., no more SIMULATOR define
Separate ngspice and nutmeg; i.e., no more SIMULATOR define. Dispose
of nutmeg all together once the devices are plugins.
Integrate bsim3, bsim3v1, bsim3v2 to use a single codebase instead of
three only slighty differing implementations
three only slighty differing implementations.
Separate frontend commands from supporting code. Command files
start with com_*. [PARTIAL]

1
configure.in

@ -212,7 +212,6 @@ src/devices/cap/Makefile \
src/devices/cccs/Makefile \
src/devices/ccvs/Makefile \
src/devices/csw/Makefile \
src/devices/devsup/Makefile \
src/devices/dio/Makefile \
src/devices/ind/Makefile \
src/devices/isrc/Makefile \

3
src/Makefile.am

@ -26,7 +26,6 @@ DYNAMIC_DEVICELIBS = \
devices/ccvs/libccvs.la \
devices/ccvs/libccvs.la \
devices/csw/libcsw.la \
devices/devsup/libdevsup.la \
devices/dio/libdio.la \
devices/ind/libind.la \
devices/isrc/libisrc.la \
@ -57,9 +56,9 @@ ngspice_LDADD = \
spice.o \
frontend/libfte.a \
frontend/plotting/libplotting.a \
devices/libdev.a \
$(DYNAMIC_DEVICELIBS) \
analysis/libckt.a \
devices/libdev.a \
parser/libparser.a \
hlp/libhlp.a \
circuit/libinp.a \

3
src/analysis/Makefile.am

@ -6,7 +6,6 @@ libckt_a_SOURCES = \
acan.c \
acaskq.c \
acsetp.c \
cktaccpt.c \
cktacct.c \
cktacdum.c \
cktask.c \
@ -15,7 +14,6 @@ libckt_a_SOURCES = \
cktbindn.c \
cktbkdum.c \
cktclrbk.c \
cktcrte.c \
cktdelt.c \
cktdest.c \
cktdisto.c \
@ -33,7 +31,6 @@ libckt_a_SOURCES = \
cktgrnd.c \
ckti2nod.c \
cktic.c \
cktinit.c \
cktlnkeq.c \
cktload.c \
cktmapn.c \

47
src/analysis/cktcrte.c

@ -1,47 +0,0 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
/*
*/
/* CKTcrtElement(ckt,type,inModPtr,inInstPtr,name,subname)
* Create a device of the specified type, with the given name, using
* the specified model in the named circuit.
*/
#include "ngspice.h"
#include <stdio.h>
#include "ifsim.h"
#include "cktdefs.h"
#include "devdefs.h"
#include "sperror.h"
/*ARGSUSED*/
int
CKTcrtElt(void *ckt, void *inModPtr, void **inInstPtr, IFuid name)
{
GENinstance *instPtr = NULL;
GENmodel *modPtr=(GENmodel*)inModPtr;
extern SPICEdev *DEVices[];
int error;
int type;
if((GENmodel *)modPtr==(GENmodel*)NULL) return(E_NOMOD);
type = ((GENmodel*)modPtr)->GENmodType;
error =CKTfndDev(ckt,&type,(void**)&instPtr,name,inModPtr,(char *)NULL );
if (error== OK) {
if(inInstPtr) *inInstPtr=(void *)instPtr;
return(E_EXISTS);
} else if (error != E_NODEV) return(error);
instPtr = (GENinstance *)MALLOC(*DEVices[type]->DEVinstSize);
if(instPtr == (GENinstance *)NULL) return(E_NOMEM);
instPtr->GENname = name;
instPtr->GENmodPtr = modPtr;
instPtr->GENnextInstance = modPtr->GENinstances;
modPtr->GENinstances = instPtr;
if(inInstPtr != NULL) *inInstPtr = (void *)instPtr;
return(OK);
}

62
src/analysis/cktinit.c

@ -1,62 +0,0 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
#include "ngspice.h"
#include <stdio.h>
#include "ifsim.h"
#include "cktdefs.h"
#include "const.h"
#include "sperror.h"
int
CKTinit(void **ckt)
/* new circuit to create */
{
int i;
CKTcircuit *sckt;
sckt = (CKTcircuit *)( *ckt = (char *)MALLOC(sizeof(CKTcircuit)) );
if(sckt == NULL) return(E_NOMEM);
for (i=0;i<DEVmaxnum;i++) {
(sckt)->CKThead[i] = (GENmodel *) NULL;
}
(sckt)->CKTmaxEqNum = 1;
(sckt)->CKTnodes = (CKTnode *)NULL;
(sckt)->CKTlastNode = (CKTnode *)NULL;
sckt->CKTmatrix = NULL;
(sckt)->CKTgmin = 1e-12;
(sckt)->CKTabstol = 1e-12;
(sckt)->CKTreltol = 1e-3;
(sckt)->CKTchgtol = 1e-14;
(sckt)->CKTvoltTol = 1e-6;
(sckt)->CKTtrtol = 7;
(sckt)->CKTbypass = 1;
(sckt)->CKTisSetup = 0;
(sckt)->CKTtranMaxIter = 10;
(sckt)->CKTdcMaxIter = 100;
(sckt)->CKTdcTrcvMaxIter = 50;
(sckt)->CKTintegrateMethod = TRAPEZOIDAL;
(sckt)->CKTorder = 1;
(sckt)->CKTmaxOrder = 2;
(sckt)->CKTpivotAbsTol = 1e-13;
(sckt)->CKTpivotRelTol = 1e-3;
(sckt)->CKTtemp = 300.15;
(sckt)->CKTnomTemp = 300.15;
(sckt)->CKTdefaultMosL = 1e-4;
(sckt)->CKTdefaultMosW = 1e-4;
(sckt)->CKTdefaultMosAD = 0;
(sckt)->CKTdefaultMosAS = 0;
(sckt)->CKTsrcFact=1;
(sckt)->CKTdiagGmin=0;
(sckt)->CKTstat = (STATistics *)MALLOC(sizeof(STATistics));
(sckt)->CKTtroubleNode = 0;
(sckt)->CKTtroubleElt = NULL;
(sckt)->CKTtimePoints = NULL;
if( (sckt)->CKTstat == (STATistics *)NULL) return(E_NOMEM);
return(OK);
}

14
src/analysis/dctran.c

@ -6,15 +6,15 @@ Author: 1985 Thomas L. Quarles
/* subroutine to do DC TRANSIENT analysis
--- ONLY, unlike spice2 routine with the same name! */
#include "ngspice.h"
#include <stdio.h>
#include "trandefs.h"
#include "cktdefs.h"
#include "sperror.h"
#include <config.h>
#include <cktdefs.h>
#include <cktaccept.h>
#include <trandefs.h>
#include <sperror.h>
int
DCtran(CKTcircuit *ckt, int restart)
/* restart: forced restart flag */
DCtran(CKTcircuit *ckt,
int restart) /* forced restart flag */
{
int i;
double olddelta;

18
src/main.c

@ -5,6 +5,8 @@
Author: 1985 Wayne A. Christopher
The main routine for ngspice */
#include <ngspice.h>
#include <stdio.h>
#include <setjmp.h>
#include <signal.h>
@ -14,16 +16,12 @@
#define _GNU_SOURCE
#include <getopt.h>
#include "ngspice.h"
#include "ifsim.h"
#include "inpdefs.h"
#include "iferrmsg.h"
#include "cpdefs.h"
#include "ftedefs.h"
#include "ftedev.h"
#include "ftedebug.h"
#include "const.h"
#include "devices/dev.h"
#include <iferrmsg.h>
#include <ftedefs.h>
#include <devdefs.h>
#include <devices/dev.h>
#include <misc/ivars.h>
#include <frontend/resource.h>
#ifdef HAVE_PWD_H
#include <pwd.h>

8
src/spicelib/devices/Makefile.am

@ -13,7 +13,6 @@ SUBDIRS = \
cccs \
ccvs \
csw \
devsup \
dio \
ind \
isrc \
@ -37,7 +36,12 @@ lib_LIBRARIES = libdev.a
libdev_a_SOURCES = \
dev.c \
dev.h
dev.h \
devsup.c \
cktaccept.c \
cktaccept.h \
cktcrte.c \
cktinit.c
INCLUDES = -I$(top_srcdir)/src/include

3
src/spicelib/devices/README

@ -0,0 +1,3 @@
The circuit builder.
It takes a circuit description and builds a simulator from it.

32
src/analysis/cktaccpt.c → src/spicelib/devices/cktaccept.c

@ -4,31 +4,31 @@ Author: 1985 Thomas L. Quarles
**********/
/* CKTaccept(ckt)
* this is a driver program to iterate through all the various
* accept functions provided for the circuit elements in the
* given circuit
*/
*
* this is a driver program to iterate through all the various accept
* functions provided for the circuit elements in the given circuit */
#include "ngspice.h"
#include <stdio.h>
#include "smpdefs.h"
#include "cktdefs.h"
#include "devdefs.h"
#include "sperror.h"
#include <config.h>
#include <devdefs.h>
#include <sperror.h>
#include <ifsim.h>
#include <devdefs.h>
#include "dev.h"
int
CKTaccept(CKTcircuit *ckt)
{
extern SPICEdev *DEVices[];
int i;
int error;
SPICEdev **devs;
for (i=0;i<DEVmaxnum;i++) {
if ( ((*DEVices[i]).DEVaccept != NULL) && (ckt->CKThead[i] != NULL) ){
error = (*((*DEVices[i]).DEVaccept))(ckt,ckt->CKThead[i]);
if(error) return(error);
devs = devices();
for (i = 0; i < DEVmaxnum; i++) {
if ( ((*devs[i]).DEVaccept != NULL) && (ckt->CKThead[i] != NULL) ){
error = (*((*devs[i]).DEVaccept))(ckt,ckt->CKThead[i]);
if (error)
return(error);
}
}
#ifdef PREDICTOR

6
src/spicelib/devices/cktaccept.h

@ -0,0 +1,6 @@
#ifndef _CKTACCEPT_H
#define _CKTACCEPT_H
int CKTaccept(CKTcircuit *ckt);
#endif

53
src/spicelib/devices/cktcrte.c

@ -0,0 +1,53 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
/* CKTcrtElement(ckt,type,inModPtr,inInstPtr,name,subname)
*
* Create a device of the specified type, with the given name, using
* the specified model in the named circuit. */
#include <config.h>
#include <devdefs.h>
#include <sperror.h>
#include "dev.h"
int
CKTcrtElt(void *ckt, void *inModPtr, void **inInstPtr, IFuid name)
{
GENinstance *instPtr = NULL;
GENmodel *modPtr=(GENmodel*)inModPtr;
SPICEdev **DEVices;
int error;
int type;
DEVices = devices();
if((GENmodel *)modPtr==(GENmodel*)NULL)
return E_NOMOD;
type = ((GENmodel*)modPtr)->GENmodType;
error = CKTfndDev(ckt, &type, (void**)&instPtr, name, inModPtr,
(char *)NULL );
if (error == OK) {
if (inInstPtr)
*inInstPtr=(void *)instPtr;
return E_EXISTS;
} else if (error != E_NODEV)
return error;
instPtr = (GENinstance *) tmalloc(*DEVices[type]->DEVinstSize);
if (instPtr == (GENinstance *)NULL)
return E_NOMEM;
instPtr->GENname = name;
instPtr->GENmodPtr = modPtr;
instPtr->GENnextInstance = modPtr->GENinstances;
modPtr->GENinstances = instPtr;
if(inInstPtr != NULL)
*inInstPtr = (void *)instPtr;
return OK;
}

64
src/spicelib/devices/cktinit.c

@ -0,0 +1,64 @@
/**********
Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles
**********/
#include <config.h>
#include <stdio.h>
#include <cktdefs.h>
#include <sperror.h>
int
CKTinit(void **ckt) /* new circuit to create */
{
int i;
CKTcircuit *sckt;
*ckt = (void *) tmalloc(sizeof(CKTcircuit));
sckt = (CKTcircuit *)(*ckt);
if (sckt == NULL)
return(E_NOMEM);
for (i = 0; i < DEVmaxnum; i++)
sckt->CKThead[i] = (GENmodel *) NULL;
sckt->CKTmaxEqNum = 1;
sckt->CKTnodes = (CKTnode *) NULL;
sckt->CKTlastNode = (CKTnode *) NULL;
sckt->CKTmatrix = NULL;
sckt->CKTgmin = 1e-12;
sckt->CKTabstol = 1e-12;
sckt->CKTreltol = 1e-3;
sckt->CKTchgtol = 1e-14;
sckt->CKTvoltTol = 1e-6;
sckt->CKTtrtol = 7;
sckt->CKTbypass = 1;
sckt->CKTisSetup = 0;
sckt->CKTtranMaxIter = 10;
sckt->CKTdcMaxIter = 100;
sckt->CKTdcTrcvMaxIter = 50;
sckt->CKTintegrateMethod = TRAPEZOIDAL;
sckt->CKTorder = 1;
sckt->CKTmaxOrder = 2;
sckt->CKTpivotAbsTol = 1e-13;
sckt->CKTpivotRelTol = 1e-3;
sckt->CKTtemp = 300.15;
sckt->CKTnomTemp = 300.15;
sckt->CKTdefaultMosL = 1e-4;
sckt->CKTdefaultMosW = 1e-4;
sckt->CKTdefaultMosAD = 0;
sckt->CKTdefaultMosAS = 0;
sckt->CKTsrcFact=1;
sckt->CKTdiagGmin=0;
sckt->CKTstat = (STATistics *) tmalloc(sizeof(STATistics));
sckt->CKTtroubleNode = 0;
sckt->CKTtroubleElt = NULL;
sckt->CKTtimePoints = NULL;
if (sckt->CKTstat == (STATistics *)NULL)
return E_NOMEM;
return OK;
}

10
src/spicelib/devices/dev.c

@ -29,8 +29,10 @@
#include <config.h>
#include <devdefs.h>
#include <ifsim.h>
#include "dev.h"
#include "devdefs.h"
/* Enable the following devices */
#define DEV_asrc
@ -161,3 +163,9 @@ devices_ptr(void)
{
return (IFdevice **) DEVices;
}
SPICEdev **
devices(void)
{
return DEVices;
}

3
src/spicelib/devices/dev.h

@ -1,10 +1,9 @@
#ifndef _DEV_H
#define _DEV_H
#include <ifsim.h>
int num_devices(void);
IFdevice **devices_ptr(void);
SPICEdev **devices(void);
#endif

0
src/spicelib/devices/devsup/devsup.c → src/spicelib/devices/devsup.c

6
src/spicelib/devices/devsup/.cvsignore

@ -1,6 +0,0 @@
Makefile.in
Makefile
.deps
.libs
*.lo
*.la

10
src/spicelib/devices/devsup/Makefile.am

@ -1,10 +0,0 @@
## Process this file with automake to produce Makefile.in
pkglib_LTLIBRARIES = libdevsup.la
libdevsup_la_SOURCES = devsup.c
INCLUDES = -I$(top_srcdir)/src/include
MAINTAINERCLEANFILES = Makefile.in
Loading…
Cancel
Save