check the .lib processing

This commit is contained in:
rlar
2013-12-31 12:53:40 +01:00
parent 6c74513120
commit cee318c68b
17 changed files with 254 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = lib-processing
MAINTAINERCLEANFILES = Makefile.in
@@ -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
+9
View File
@@ -0,0 +1,9 @@
* -*- spice -*-
.LIB RES
.subckt sub_in_lib n1 n2
R3 n1 n2 2k
.ends
.ENDL RES
+29
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
+9
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
+33
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
+9
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
+28
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
+33
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
+10
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
+18
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
+33
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
+10
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
@@ -0,0 +1,9 @@
* -*- spice -*-
.LIB RES
.subckt sub3_in_lib n1 n2
R3 n1 n2 4k
.ends
.ENDL RES