diff --git a/configure.ac b/configure.ac index 612c1b5c1..7efbe4dab 100644 --- a/configure.ac +++ b/configure.ac @@ -1122,6 +1122,8 @@ AC_CONFIG_FILES([Makefile tests/mesa/Makefile tests/mos6/Makefile tests/polezero/Makefile + tests/regression/Makefile + tests/regression/lib-processing/Makefile tests/sensitivity/Makefile tests/transient/Makefile tests/transmission/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index 543ccaf05..8b8963045 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -5,7 +5,8 @@ SUBDIRS = \ bsim4 \ bsimsoi \ hisim \ - hisimhv1 + hisimhv1 \ + regression if XSPICE_WANTED SUBDIRS += xspice @@ -31,6 +32,7 @@ DIST_SUBDIRS = \ mesa \ mos6 \ polezero \ + regression \ resistance \ sensitivity \ transient \ diff --git a/tests/bin/check.sh b/tests/bin/check.sh index 1e70c20c9..8e1813df0 100644 --- a/tests/bin/check.sh +++ b/tests/bin/check.sh @@ -17,7 +17,7 @@ fi SPICE=$1 TEST=$2 -FILTER="CPU|Dynamic|Note|Circuit|Trying|Reference|Date|Doing|---|v-sweep|time|est|Error|Warning|Data|Index|trans|acan|oise|nalysis|ole|Total|memory|urrent|Got|Added|BSIM|bsim|B4SOI|b4soi|codemodel|^binary raw file" +FILTER="CPU|Dynamic|Note|Circuit|Trying|Reference|Date|Doing|---|v-sweep|time|est|Error|Warning|Data|Index|trans|acan|oise|nalysis|ole|Total|memory|urrent|Got|Added|BSIM|bsim|B4SOI|b4soi|codemodel|^binary raw file|^ngspice.*done" testname=`basename $TEST .cir` testdir=`dirname $TEST` diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am new file mode 100644 index 000000000..9eb72dc99 --- /dev/null +++ b/tests/regression/Makefile.am @@ -0,0 +1,5 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = lib-processing + +MAINTAINERCLEANFILES = Makefile.in diff --git a/tests/regression/lib-processing/Makefile.am b/tests/regression/lib-processing/Makefile.am new file mode 100644 index 000000000..8546c57c2 --- /dev/null +++ b/tests/regression/lib-processing/Makefile.am @@ -0,0 +1,12 @@ +## Process this file with automake to produce Makefile.in + + +TESTS = ex1a.cir ex1b.cir ex2a.cir ex3a.cir + +TESTS_ENVIRONMENT = ngspice_vpath=$(srcdir) $(SHELL) $(top_srcdir)/tests/bin/check.sh $(top_builddir)/src/ngspice + +EXTRA_DIST = \ + $(TESTS) \ + $(TESTS:.cir=.out) + +MAINTAINERCLEANFILES = Makefile.in diff --git a/tests/regression/lib-processing/ex1.lib b/tests/regression/lib-processing/ex1.lib new file mode 100644 index 000000000..cf64f0107 --- /dev/null +++ b/tests/regression/lib-processing/ex1.lib @@ -0,0 +1,9 @@ +* -*- spice -*- + +.LIB RES + +.subckt sub_in_lib n1 n2 +R3 n1 n2 2k +.ends + +.ENDL RES diff --git a/tests/regression/lib-processing/ex1a.cir b/tests/regression/lib-processing/ex1a.cir new file mode 100644 index 000000000..d3bfb5fe3 --- /dev/null +++ b/tests/regression/lib-processing/ex1a.cir @@ -0,0 +1,29 @@ +ex1a, check lib processing + +I1 9 0 -1mA +X1 9 0 sub1 + +Vcheck 9 check0 1.0V + +.lib 'ex1.lib' RES + +.subckt sub1 n1 n2 +X2 n1 n2 sub_in_lib +R2 n1 n2 2k +.ends + +.control +op + +print v(check0) + +if abs(v(check0)) > 1e-9 + quit 1 +end + +echo "INFO: ok" +quit 0 + +.endc + +.end diff --git a/tests/regression/lib-processing/ex1a.out b/tests/regression/lib-processing/ex1a.out new file mode 100644 index 000000000..c8a4d7d07 --- /dev/null +++ b/tests/regression/lib-processing/ex1a.out @@ -0,0 +1,9 @@ + +Circuit: ex1a lib problem + +Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 + + +No. of Data Rows : 1 +v(check0) = 0.000000e+00 +info: ok diff --git a/tests/regression/lib-processing/ex1b.cir b/tests/regression/lib-processing/ex1b.cir new file mode 100644 index 000000000..203fc373b --- /dev/null +++ b/tests/regression/lib-processing/ex1b.cir @@ -0,0 +1,33 @@ +ex1b, check lib processing + +I1 9 0 -1mA +X1 9 0 sub1 +R2 9 0 4k +X3 9 0 sub_in_lib + +Vcheck 9 check0 1.0V + +.subckt sub1 n1 n2 +.lib 'ex1.lib' RES +X1 n1 n2 sub_in_lib +.ends + +.subckt sub_in_lib n1 n2 +R4 n1 n2 4k +.ends + +.control +op + +print v(check0) + +if abs(v(check0)) > 1e-9 + quit 1 +end + +echo "INFO: ok" +quit 0 + +.endc + +.end diff --git a/tests/regression/lib-processing/ex1b.out b/tests/regression/lib-processing/ex1b.out new file mode 100644 index 000000000..02cd02641 --- /dev/null +++ b/tests/regression/lib-processing/ex1b.out @@ -0,0 +1,9 @@ + +Circuit: ex1b lib problem + +Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 + + +No. of Data Rows : 1 +v(check0) = 0.000000e+00 +info: ok diff --git a/tests/regression/lib-processing/ex2.lib b/tests/regression/lib-processing/ex2.lib new file mode 100644 index 000000000..a04614e22 --- /dev/null +++ b/tests/regression/lib-processing/ex2.lib @@ -0,0 +1,28 @@ +* -*- spice -*- + +.LIB MOS + +.subckt sub1_in_lib n1 n2 +.LIB 'ex2.lib' RES +Xsub1 n1 n2 sub3_in_lib +R1a n1 n2 4k +R1b n1 n2 2k +.ends + +.subckt sub2_in_lib n1 n2 +.LIB 'ex2.lib' RES +Xsub2 n1 n2 sub3_in_lib +R2 n1 n2 4k +.ends + +.ENDL MOS + + + +.LIB RES + +.subckt sub3_in_lib n1 n2 +R3 n1 n2 4k +.ends + +.ENDL RES diff --git a/tests/regression/lib-processing/ex2a.cir b/tests/regression/lib-processing/ex2a.cir new file mode 100644 index 000000000..78de92bbb --- /dev/null +++ b/tests/regression/lib-processing/ex2a.cir @@ -0,0 +1,33 @@ +ex2a, check lib processing + +I1 7 0 -1mA +X1 7 0 sub1_in_lib + +Vcheck2 7 check1 1.0V + +I2 9 0 -1mA +X2 9 0 sub2_in_lib + +Vcheck2 9 check2 2.0V + +.lib 'ex2.lib' MOS + +.control +op + +print v(check1) v(check2) + +if abs(v(check1)) > 1e-9 + quit 1 +end + +if abs(v(check2)) > 1e-9 + quit 1 +end + +echo "INFO: ok" +quit 0 + +.endc + +.end diff --git a/tests/regression/lib-processing/ex2a.out b/tests/regression/lib-processing/ex2a.out new file mode 100644 index 000000000..d052bbe3a --- /dev/null +++ b/tests/regression/lib-processing/ex2a.out @@ -0,0 +1,12 @@ + +Circuit: ex2a lib problem + +Error on line 12 : vcheck2 9 check2 2.0v +device already exists, existing one being used +Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 + + +No. of Data Rows : 1 +v(check1) = 0.000000e+00 +v(check2) = 0.000000e+00 +info: ok diff --git a/tests/regression/lib-processing/ex3.lib b/tests/regression/lib-processing/ex3.lib new file mode 100644 index 000000000..6f7a26d82 --- /dev/null +++ b/tests/regression/lib-processing/ex3.lib @@ -0,0 +1,18 @@ +* -*- spice -*- + +.LIB MOS + +.subckt sub1_in_lib n1 n2 +.LIB 'extra3.lib' RES +Xsub1 n1 n2 sub3_in_lib +R1a n1 n2 4k +R1b n1 n2 2k +.ends + +.subckt sub2_in_lib n1 n2 +.LIB 'extra3.lib' RES +Xsub2 n1 n2 sub3_in_lib +R2 n1 n2 4k +.ends + +.ENDL MOS diff --git a/tests/regression/lib-processing/ex3a.cir b/tests/regression/lib-processing/ex3a.cir new file mode 100644 index 000000000..a0088aa88 --- /dev/null +++ b/tests/regression/lib-processing/ex3a.cir @@ -0,0 +1,33 @@ +ex3a, check lib processing + +I1 7 0 -1mA +X1 7 0 sub1_in_lib + +Vcheck2 7 check1 1.0V + +I2 9 0 -1mA +X2 9 0 sub2_in_lib + +Vcheck2 9 check2 2.0V + +.lib 'ex3.lib' MOS + +.control +op + +print v(check1) v(check2) + +if abs(v(check1)) > 1e-9 + quit 1 +end + +if abs(v(check2)) > 1e-9 + quit 1 +end + +echo "INFO: ok" +quit 0 + +.endc + +.end diff --git a/tests/regression/lib-processing/ex3a.out b/tests/regression/lib-processing/ex3a.out new file mode 100644 index 000000000..4404cc611 --- /dev/null +++ b/tests/regression/lib-processing/ex3a.out @@ -0,0 +1,12 @@ + +Circuit: pch_mac2 lib problem + +Error on line 12 : vcheck2 9 check2 2.0v +device already exists, existing one being used +Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 + + +No. of Data Rows : 1 +v(check1) = 0.000000e+00 +v(check2) = 0.000000e+00 +info: ok diff --git a/tests/regression/lib-processing/extra3.lib b/tests/regression/lib-processing/extra3.lib new file mode 100644 index 000000000..24e9498cd --- /dev/null +++ b/tests/regression/lib-processing/extra3.lib @@ -0,0 +1,9 @@ +* -*- spice -*- + +.LIB RES + +.subckt sub3_in_lib n1 n2 +R3 n1 n2 4k +.ends + +.ENDL RES