From 9d2cbb06b7fdc49751686ef6716a019b49ffb415 Mon Sep 17 00:00:00 2001 From: arno Date: Sun, 11 Jun 2000 10:32:50 +0000 Subject: [PATCH] * src/ngspice.c src/devices/dev.c: Moved AN_* defines to dev.c. * src/analysis/cktpzset.c: Removed unused code. * tests/polezero/.cvsignore tests/polezero/Makefile.am tests/polezero/filt_multistage.cir tests/polezero/filt_multistage.out tests/polezero/filt_rc.cir tests/polezero/filt_rc.out: New files to test pole zero operations. * configure.in tests/Makefile.am: Updated for new files. --- configure.in | 3 ++- src/analysis/cktpzset.c | 5 ----- src/ngspice.c | 15 --------------- src/spicelib/devices/dev.c | 16 ++++++++++++++++ tests/Makefile.am | 2 +- tests/polezero/.cvsignore | 2 ++ tests/polezero/Makefile.am | 13 +++++++++++++ tests/polezero/filt_multistage.cir | 13 +++++++++++++ tests/polezero/filt_multistage.out | 0 tests/polezero/filt_rc.cir | 7 +++++++ tests/polezero/filt_rc.out | 0 11 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 tests/polezero/.cvsignore create mode 100644 tests/polezero/Makefile.am create mode 100644 tests/polezero/filt_multistage.cir create mode 100644 tests/polezero/filt_multistage.out create mode 100644 tests/polezero/filt_rc.cir create mode 100644 tests/polezero/filt_rc.out diff --git a/configure.in b/configure.in index b2dfd6d89..17540ba73 100644 --- a/configure.in +++ b/configure.in @@ -244,6 +244,7 @@ src/maths/sparse/Makefile \ src/misc/Makefile \ src/parser/Makefile \ tests/Makefile \ -tests/resistance/Makefile \ tests/filters/Makefile \ +tests/polezero/Makefile \ +tests/resistance/Makefile \ ) diff --git a/src/analysis/cktpzset.c b/src/analysis/cktpzset.c index 095c35e29..d464f8e09 100644 --- a/src/analysis/cktpzset.c +++ b/src/analysis/cktpzset.c @@ -16,11 +16,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. #include "sperror.h" -#define CKALLOC(var,size,type) \ - if(size && (!(var =(type *)MALLOC((size)*sizeof(type))))){\ - return(E_NOMEM);\ -} - int CKTpzSetup(register CKTcircuit *ckt, int type) { diff --git a/src/ngspice.c b/src/ngspice.c index 51e4a78c2..74ad7753f 100644 --- a/src/ngspice.c +++ b/src/ngspice.c @@ -3,21 +3,6 @@ #include "conf.h" -/* - * Analyses - */ -#define AN_op -#define AN_dc -#define AN_tf -#define AN_ac -#define AN_tran -#define AN_pz -#define AN_disto -#define AN_noise -#define AN_sense - -#define ANALYSES_USED "op dc tf ac tran pz disto noise sense" - /********** Copyright 1990 Regents of the University of California. All rights reserved. **********/ diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index b6707a836..ed23930ad 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -66,6 +66,22 @@ #define DEVICES_USED "asrc bjt bsim1 bsim2 bsim3 bsim3v2 bsim3v1 cap cccs ccvs csw dio ind isrc jfet ltra mes mos1 mos2 mos3 mos6 res sw tra urc vccs vcvs vsrc" +/* + * Analyses + */ +#define AN_op +#define AN_dc +#define AN_tf +#define AN_ac +#define AN_tran +#define AN_pz +#define AN_disto +#define AN_noise +#define AN_sense + +#define ANALYSES_USED "op dc tf ac tran pz disto noise sense" + + #include "asrc/asrcitf.h" #include "bjt/bjtitf.h" #include "cap/capitf.h" diff --git a/tests/Makefile.am b/tests/Makefile.am index d68856014..04a623bbe 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = resistance filters +SUBDIRS = resistance filters polezero TESTS = \ diffpair.cir \ diff --git a/tests/polezero/.cvsignore b/tests/polezero/.cvsignore new file mode 100644 index 000000000..3dda72986 --- /dev/null +++ b/tests/polezero/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/tests/polezero/Makefile.am b/tests/polezero/Makefile.am new file mode 100644 index 000000000..73d30949c --- /dev/null +++ b/tests/polezero/Makefile.am @@ -0,0 +1,13 @@ +## Process this file with automake to produce Makefile.in + +TESTS = \ + filt_multistage.cir \ + filt_rc.cir + +TESTS_ENVIRONMENT = $(SHELL) $(srcdir)/../check.sh $(top_builddir)/src/ngspice + +EXTRA_DIST = \ + $(TESTS) \ + $(TESTS:.cir=.out) + +MAINTAINERCLEANFILES = Makefile.in diff --git a/tests/polezero/filt_multistage.cir b/tests/polezero/filt_multistage.cir new file mode 100644 index 000000000..3f262fe5e --- /dev/null +++ b/tests/polezero/filt_multistage.cir @@ -0,0 +1,13 @@ +Multistage filter +v1 1 0 0 ac 1.0 +r1 1 2 1k +c1 2 0 10p +e2 3 0 2 0 10 +r2 3 4 1k +c2 4 0 1.25p +e3 5 0 4 0 10 +r3 5 6 1k +c3 6 0 .02p +.pz 1 0 6 0 vol pz +.print pz all +.end diff --git a/tests/polezero/filt_multistage.out b/tests/polezero/filt_multistage.out new file mode 100644 index 000000000..e69de29bb diff --git a/tests/polezero/filt_rc.cir b/tests/polezero/filt_rc.cir new file mode 100644 index 000000000..c59ac16b4 --- /dev/null +++ b/tests/polezero/filt_rc.cir @@ -0,0 +1,7 @@ +RC filter +v1 1 0 0 ac 1.0 +r1 1 2 1k +c1 2 0 10p +.pz 1 0 2 0 vol pz +.print pz all +.end diff --git a/tests/polezero/filt_rc.out b/tests/polezero/filt_rc.out new file mode 100644 index 000000000..e69de29bb