File: ex1b.cir

package info (click to toggle)
ngspice 45.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 75,776 kB
  • sloc: ansic: 559,348; cpp: 17,869; xml: 9,372; makefile: 4,086; sh: 2,595; perl: 2,442; yacc: 1,549; tcl: 1,040; lex: 320; pascal: 241; python: 179; vhdl: 177
file content (34 lines) | stat: -rw-r--r-- 397 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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

echo "Note: v(check0) = $&v(check0)"

if abs(v(check0)) <= 1e-9
    echo "INFO: ok"
    quit 0
end

echo ERROR: Test failure
quit 1

.endc

.end