Fix NAN error in numd2 area report and crashes when a doping file is missing. Update examples/cider so that the test circuits all run; add case sensitivity tests for rootfile and ic.file parameter strings enclosed in a single pair of double quotes.

This commit is contained in:
Brian Taylor
2021-09-29 20:22:56 +02:00
committed by Holger Vogt
parent 68c5eb2d6b
commit 663a79dea8
23 changed files with 296 additions and 24 deletions
+11
View File
@@ -0,0 +1,11 @@
Run:
ngspice -b pz1.cir
and the operating point file 'PEBJT1--OP.0.q1' is generated.
The .model in the included library 'pebjt1.lib' has an output rootfile
parameter which determines the PEBJT1-- prefix. The mixed case in the name
of the generated OP file is retained. Without any rootfile or output statement
in the .model, the file created will be named 'OP.0.q1'.
+2 -2
View File
@@ -10,8 +10,6 @@ IEE 13 2 0.1mA
Q1 11 12 13 M_NPN AREA=8
Q2 21 22 13 M_NPN AREA=8
.DC VBBP 2.75v 3.25001v 10mv
.PRINT V(21) V(11)
.MODEL M_NPN nbjt level=2
+ title TWO-DIMENSIONAL NUMERICAL POLYSILICON EMITTER BIPOLAR TRANSISTOR
@@ -54,4 +52,6 @@ Q2 21 22 13 M_NPN AREA=8
+ models bgn srh auger conctau concmob fieldmob
.OPTIONS ACCT BYPASS=1
.DC VBBP 2.75v 3.25001v 10mv
.PRINT DC V(21) V(11)
.END
+72
View File
@@ -0,0 +1,72 @@
**
* Numerical models for a
* polysilicon emitter complementary bipolar process.
* The default device size is 1um by 10um (LxW)
**
.model M_NPN nbjt level=1
+ title One-Dimensional Numerical Bipolar
+ options base.depth=0.15 base.area=0.1 base.length=1.0 defa=10p
+ x.mesh loc=-0.2 n=1
+ x.mesh loc=0.0 n=51
+ x.mesh wid=0.15 h.e=0.0001 h.m=.004 r=1.2
+ x.mesh wid=1.15 h.s=0.0001 h.m=.004 r=1.2
+ domain num=1 material=1 x.l=0.0
+ domain num=2 material=2 x.h=0.0
+ material num=1 silicon
+ mobility mat=1 concmod=ct fieldmod=ct
+ material num=2 polysilicon
+ mobility mat=2 concmod=ct fieldmod=ct
+ doping gauss n.type conc=3e20 x.l=-0.2 x.h=0.0 char.len=0.047
+ doping gauss p.type conc=5e18 x.l=-0.2 x.h=0.0 char.len=0.100
+ doping unif n.type conc=1e16 x.l=0.0 x.h=1.3
+ doping gauss n.type conc=5e19 x.l=1.3 x.h=1.3 char.len=0.100
+ models bgn srh auger conctau concmob fieldmob ^aval
+ method devtol=1e-12 ac=direct itlim=15
+ output rootfile="PEBJT1--" Psi N.CONC P.conc
.model M_NPSUB numd level=1
+ title One-Dimensional Numerical Collector-Substrate Diode
+ options defa=10p
+ x.mesh loc=1.3 n=1
+ x.mesh loc=2.0 n=101
+ domain num=1 material=1
+ material num=1 silicon
+ mobility mat=1 concmod=ct fieldmod=ct
+ doping gauss n.type conc=5e19 x.l=1.3 x.h=1.3 char.len=0.100
+ doping unif p.type conc=1e15 x.l=0.0 x.h=2.0
+ models bgn srh auger conctau concmob fieldmob ^aval
+ method devtol=1e-12 itlim=10
.model M_PNP nbjt level=1
+ title One-Dimensional Numerical Bipolar
+ options base.depth=0.2 base.area=0.1 base.length=1.0 defa=10p
+ x.mesh loc=-0.2 n=1
+ x.mesh loc=0.0 n=51
+ x.mesh wid=0.20 h.e=0.0001 h.m=.004 r=1.2
+ x.mesh wid=1.10 h.s=0.0001 h.m=.004 r=1.2
+ domain num=1 material=1 x.l=0.0
+ domain num=2 material=2 x.h=0.0
+ material num=1 silicon
+ mobility mat=1 concmod=ct fieldmod=ct
+ material num=2 polysilicon
+ mobility mat=2 concmod=ct fieldmod=ct
+ doping gauss p.type conc=3e20 x.l=-0.2 x.h=0.0 char.len=0.047
+ doping gauss n.type conc=5e17 x.l=-0.2 x.h=0.0 char.len=0.200
+ doping unif p.type conc=1e16 x.l=0.0 x.h=1.3
+ doping gauss p.type conc=5e19 x.l=1.3 x.h=1.3 char.len=0.100
+ models bgn srh auger conctau concmob fieldmob ^aval
+ method devtol=1e-12 ac=direct itlim=15
.model M_PNSUB numd level=1
+ title One-Dimensional Numerical Collector-Substrate Diode
+ options defa=10p
+ x.mesh loc=1.3 n=1
+ x.mesh loc=2.0 n=101
+ domain num=1 material=1
+ material num=1 silicon
+ mobility mat=1 concmod=ct fieldmod=ct
+ doping gauss p.type conc=5e19 x.l=1.3 x.h=1.3 char.len=0.100
+ doping unif n.type conc=1e15 x.l=0.0 x.h=2.0
+ models bgn srh auger conctau concmob fieldmob ^aval
+ method devtol=1e-12 itlim=10
+1
View File
@@ -13,4 +13,5 @@ CL 5 0 0.1pF
.PZ 3 0 5 0 vol pz
.PRINT PZ ALL
.END
+18
View File
@@ -0,0 +1,18 @@
PZ Analysis of a Common Emitter Amplifier
Vcc 1 0 5v
Vee 2 0 0v
Vin 3 0 0.7838 AC 1
RS 3 4 1K
Q1 5 4 2 M_NPN AREA=4 SAVE
RL 1 5 2.5k
CL 5 0 0.1pF
.INCLUDE pebjt1.lib
.PZ 3 0 5 0 vol pz
.PRINT PZ ALL
.OP
.END
+18
View File
@@ -0,0 +1,18 @@
Run:
ngspice -b pd1.cir
This will generate the operating point file 'Pre-Pin-Diode-OP.0.d1', which
is read as the ic.file (initial condition file) for 'pindiode.cir'.
Note that if there is no output line in the .model section of 'pd1.cir',
the generated file will be named 'OP.0.d1'. In this case the ic.file value
in 'pindiode.cir' would need to be chenged to match it.
Then:
ngspice -b pindiode.cir
can be run which will input 'Pre-Pin-Diode-OP.0.d1'. If you do not run
'pd1.cir' first, the 'pindiode.cir' simulation will run OK but tell you it
cannot find the iinitial condition file.
+2 -1
View File
@@ -29,7 +29,8 @@ D1 1 2 M_PN AREA=100
.option acct bypass=0 abstol=1e-18 itl2=100
.op
.ac dec 10 100kHz 10gHz
.print ac i(Vpp)
.dc Vpp -3.0v 2.0001v 50mv
.print i(Vpp)
.print dc i(Vpp)
.END
+1 -1
View File
@@ -26,6 +26,6 @@ D1 3 2 M_PN area=100
.option acct bypass=1 abstol=1e-15 itl2=100
.tran 0.001ns 1.0ns
.print i(Vpp)
.print tran i(Vpp)
.END
+44
View File
@@ -0,0 +1,44 @@
PRE-PIN-DIODE TWO-DIMENSIONAL PIN-DIODE CIRCUIT
VIN 1 0 0.0v (PWL 0ns 0.8v 1ns -50.0v)
L1 1 2 0.5uH
VD 2 3 0.0v
D1 3 0 M_PIN AREA=200 save
VRC 2 4 0.0v
R1 4 5 100
C1 5 0 1.0nF
.MODEL M_PIN NUMD LEVEL=2
+ options defw=1000u
+ x.mesh n=1 l=0.0
+ x.mesh n=2 l=0.2
+ x.mesh n=4 l=0.4
+ x.mesh n=8 l=0.6
+ x.mesh n=13 l=1.0
+
+ y.mesh n=1 l=0.0
+ y.mesh n=9 l=4.0
+ y.mesh n=24 l=10.0
+ y.mesh n=29 l=15.0
+ y.mesh n=34 l=20.0
+
+ domain num=1 material=1
+ material num=1 silicon tn=20ns tp=20ns
+
+ electrode num=1 x.l=0.6 x.h=1.0 y.h=0.0
+ electrode num=2 y.l=20.0
+
+ doping gauss p.type conc=1.0e20 char.len=1.076 x.l=0.75 x.h=1.1 y.h=0.0
+ + lat.rotate ratio=0.1
+ doping unif n.type conc=1.0e14
+ doping gauss n.type conc=1.0e20 char.len=1.614 x.l=-0.1 x.h=1.1 y.l=20.0
+
+ models bgn srh auger conctau concmob fieldmob
+ output rootfile="Pre-Pin-Diode-"
.OPTION ACCT BYPASS=1
* .TRAN 1NS 100NS
* .PRINT TRAN v(3) I(VIN)
.op
.END
+2 -1
View File
@@ -3,7 +3,7 @@ TWO-DIMENSIONAL PIN-DIODE CIRCUIT
VIN 1 0 0.0v (PWL 0ns 0.8v 1ns -50.0v)
L1 1 2 0.5uH
VD 2 3 0.0v
D1 3 0 M_PIN AREA=200 IC.FILE="OP.0.d1"
D1 3 0 M_PIN AREA=200 IC.FILE="Pre-Pin-Diode-OP.0.d1"
VRC 2 4 0.0v
R1 4 5 100
C1 5 0 1.0nF
@@ -38,5 +38,6 @@ C1 5 0 1.0nF
.OPTION ACCT BYPASS=1
.TRAN 1NS 100NS
.PRINT TRAN v(3) I(VIN)
.PLOT TRAN v(3) I(VIN)
.END
+1 -1
View File
@@ -54,6 +54,6 @@ CB 3 4 0.1pf
+ method ac=direct onec
.tran 0.2ns 40ns
.print v(4)
.print tran v(4)
.options acct bypass=1 method=gear
.end
+1
View File
@@ -31,4 +31,5 @@ IREF 7 0 50UA
.TRAN 0.1NS 50NS
.OPTIONS ACCT BYPASS=1 METHOD=GEAR
.PRINT TRAN I(VB)
.END
+1
View File
@@ -26,4 +26,5 @@ M8 8 9 1 1 M_PMOS_1 W=15U L=1U
.DC VPL -5MV 5MV 0.1MV
.OPTIONS ACCT BYPASS=1 METHOD=GEAR
.print DC V(3) V(4) V(8)
.END
+1 -1
View File
@@ -109,6 +109,6 @@ VBN 2 26 0.0V
+ OUTPUT ^ALL.DEBUG
.TRAN 0.1NS 5.0NS
.PRINT V(4)
.PRINT TRAN V(4)
.OPTIONS ACCT BYPASS=1 METHOD=GEAR
.END
+1 -1
View File
@@ -24,7 +24,7 @@ D1 1 2 M_RES AREA=1
*.OP
*.DC VPP 0.0v 10.01v 0.1v
.TRAN 1s 10.001s 0s 0.1s
.PRINT I(VPP)
.PRINT TRAN I(VPP)
.OPTION ACCT BYPASS=1
.END
+1 -1
View File
@@ -20,7 +20,7 @@ D1 1 2 M_RES AREA=1
*.OP
.DC VPP 0.0v 10.01v 0.1v
*.TRAN 1s 100.001s 0s 0.2s
.PRINT I(VPP)
.PRINT DC I(VPP)
.OPTION ACCT BYPASS=1 RELTOL=1e-12
.END
+1 -1
View File
@@ -26,5 +26,5 @@ RL 1 2 1.0K
.OPTION ACCT BYPASS=1 METHOD=GEAR
.TRAN 0.5MS 50MS
.PRINT I(VLINE)
.PRINT TRAN I(VLINE)
.END
+1 -1
View File
@@ -35,6 +35,6 @@ DT 4 2 M_PIN AREA=1
.OPTION ACCT BYPASS=1
.TRAN 0.1NS 10NS
.PRINT TRAN V(3) I(VIN)
.PRINT TRAN V(3) I(VNN)
.END