check the .lib processing

This commit is contained in:
rlar 2013-01-19 18:10:30 +01:00
parent 6c74513120
commit cee318c68b
17 changed files with 254 additions and 2 deletions

View File

@ -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

View File

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

View File

@ -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`

View File

@ -0,0 +1,5 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = lib-processing
MAINTAINERCLEANFILES = Makefile.in

View File

@ -0,0 +1,13 @@
## 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 = \
ex1.lib ex2.lib ex3.lib extra3.lib \
$(TESTS) \
$(TESTS:.cir=.out)
MAINTAINERCLEANFILES = Makefile.in

View File

@ -0,0 +1,9 @@
* -*- spice -*-
.LIB RES
.subckt sub_in_lib n1 n2
R3 n1 n2 2k
.ends
.ENDL RES

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,33 @@
ex2a, check lib processing
I1 7 0 -1mA
X1 7 0 sub1_in_lib
Vcheck1 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

View File

@ -0,0 +1,10 @@
Circuit: ex2a lib problem
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

View File

@ -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

View File

@ -0,0 +1,33 @@
ex3a, check lib processing
I1 7 0 -1mA
X1 7 0 sub1_in_lib
Vcheck1 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

View File

@ -0,0 +1,10 @@
Circuit: ex3a lib problem
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

View File

@ -0,0 +1,9 @@
* -*- spice -*-
.LIB RES
.subckt sub3_in_lib n1 n2
R3 n1 n2 4k
.ends
.ENDL RES