4 # Template File for BJT Structures
6 puts "Generate GSS input file..."
8 #COMMENT Only consider X-base implants if XBPEAK >= 1.
16 set XYCH
[expr ($XBJUNC)/sqrt
(log
($XBPEAK/$NEPI))]
17 set XXCH
[expr $LATD*$XYCH]
18 set XDIF
[expr $XXCH*sqrt
(log
($XBPEAK/$NEPI))]
20 #COMMENT Derived Quantities and Definitions
21 # EPS = roundoff error
22 # WD = collector-base depletion width (microns)
23 # BYCH = base diffusion vertical
24 # characteristic length (microns)
25 # BXCH = base diffusion horizontal
26 # characteristic length (microns)
27 # BDIF = base lateral diffusion distance (microns)
28 # XDIF = lateral diffusion distance beyond BXOVER (microns)
29 # DLBDE = distance from left device edge
30 # to base diffusion edge
31 # DRBDE = distance from right device edge
32 # to base diffusion edge
33 # WBASE = width of base
34 # WMAX = width of device (microns)
35 # LEDE = location of emitter diffusion edge
36 # LECONT = location of emitter contact
37 # LBCONT = location of base contact
39 set YBPPE
[expr $YBPEAK+$EPS]
40 set WD
[expr 3.6E7
*sqrt
((.8+abs
($VCBMAX))/$NEPI)]
41 set WBASE
[expr $BEOVER+$WEMIT+$WEXB+$WXBASE+$BXOVER]
42 set BYCH
[expr ($BCJUNC-$YBPEAK)/sqrt
(log
($BPEAK/$NEPI))]
43 set BXCH
[expr $LATD*$BYCH]
44 set TMP
[expr $BPEAK*exp
(- pow
($YBPPE/$BYCH,2))]
45 set BDIF
[expr $BXCH*sqrt
(log
($TMP/$NEPI))]
46 set NSRF
[expr $TMP-$NEPI]
47 set DLBDE
[expr int
(2*($BDIF+$WD+1.0))/2]
48 set LEDE
[expr $DLBDE+$BEOVER]
49 set LECONT
[expr $LEDE+($WEMIT-$WECONT)/2]
50 set LBCONT
[expr $LEDE+$WEMIT+$WEXB+($WXBASE-$WBCONT)/2]
51 set TMP
[expr $BPEAK*exp
(- pow
(($YBPPE-$EBJUNC)/$BYCH,2))]
52 set NE
[expr $TMP-$NEPI]
53 set EYCH
[expr ($EBJUNC)/sqrt
(log
($EPEAK/$NE))]
54 set EXCH
[expr $LATD*$EYCH]
55 set EDIF
[expr $EXCH*sqrt
(log
($EPEAK/$NSRF))]
57 #COMMENT See if XDIF < BDIF+BXOVER+BCSP
59 set TMP
[expr int
($XDIF/($BDIF+$BXOVER+$BCSP))]
60 if { [expr int
((2+$TMP)/(1+$TMP))%2] == 1} {
69 if {$X1} { set XDIF
[expr $BDIF]}
70 if {$X2} { set XDIF
[expr $XDIF-$BXOVER]}
71 set DRBDE
[expr int
(2*($XDIF+$WD+1.0))/2]
72 set WMAX
[expr $DLBDE+$WBASE+$DRBDE]
74 #COMMENT Transistor type.
75 if {$TRANTYPE == "PNP"} {
83 set FileID
[open $FileName w
]
84 puts "Write GSS input statements to $FileName"
86 #-----------------------
88 #-----------------------
89 puts $FileID "MESH Type=GSS ModelFile=$TRANTYPE.cgns Triangle=pzAY"
90 puts $FileID "#---------------------------------------------------"
92 #-----------------------
94 #-----------------------
95 puts $FileID "XMESH WIDTH=$DLBDE-$BDIF H2=$BCSP RATIO=$RATIO"
96 set TMP
[expr 0.5*($BCSP-$EBSP)/($RATIO-1)]
97 set LX1
[expr ($BDIF+$BEOVER-$EDIF)/2+$TMP]
98 set LX2
[expr ($BDIF+$BEOVER-$EDIF)/2-$TMP]
99 puts $FileID "XMESH WIDTH=$LX2 H1=$BCSP RATIO=$RATIO"
100 puts $FileID "XMESH WIDTH=$LX1 H2=$EBSP RATIO=$RATIO"
102 set W1
[expr $EDIF+($WEMIT-$WECONT)/2]
103 set SPC1
[expr $W1-($W1-$EBSP)/$RATIO]
104 puts $FileID "XMESH WIDTH=$W1 H1=$EBSP RATIO=$RATIO"
105 puts $FileID "XMESH WIDTH=$WECONT/2 H1=$SPC1 RATIO=$RATIO"
106 puts $FileID "XMESH WIDTH=$WECONT/2 H2=$SPC1 RATIO=$RATIO"
107 puts $FileID "XMESH WIDTH=$W1 H2=$EBSP RATIO=$RATIO"
109 set W1
[expr $WEXB-$EDIF+($WXBASE-$WBCONT)/2]
110 set SPC1
[expr $W1-($W1-$EBSP)/$RATIO]
111 set W2
[expr $XDIF+$BXOVER+($WXBASE-$WBCONT)/2]
112 set SPC2
[expr $W2-($W2-$BCSP)/$RATIO]
114 #COMMENT See if SPC1+SPC2 < WBCONT
115 set TMP
[expr int
(($SPC1+$SPC2)/$WBCONT)]
116 if { [expr int
((2+$TMP)/(1+$TMP))%2] == 1} {
125 puts $FileID "XMESH WIDTH=$W1 H1=$EBSP RATIO=$RATIO"
126 if {$X1} { puts $FileID "XMESH WIDTH=$WBCONT H1=$SPC1 H2=$SPC2 RATIO=$RATIO"}
127 if {$X2} { puts $FileID "XMESH WIDTH=$WBCONT N.SPACES=2"}
128 puts $FileID "XMESH WIDTH=$W2 H2=$BCSP RATIO=$RATIO"
129 puts $FileID "XMESH X.MAX=$WMAX H1=$BCSP RATIO=$RATIO"
130 puts $FileID "#---------------------------------------------------"
132 #-----------------------
134 #-----------------------
135 puts $FileID "YMESH Y.BOTTOM=0 Y.TOP=0.1 N.SPACES=1"
136 puts $FileID "YMESH Y.BOTTOM=-$EBJUNC H2=$EBSP RATIO=$RATIO"
137 set TMP
[expr 0.5*($BCSP-$EBSP)/($RATIO-1)]
138 set LY1
[expr ($BCJUNC-$EBJUNC)/2+$TMP]
139 set LY2
[expr ($BCJUNC-$EBJUNC)/2-$TMP]
140 puts $FileID "YMESH DEPTH=$LY1 H1=$EBSP RATIO=$RATIO"
141 puts $FileID "YMESH Y.BOTTOM=-$BCJUNC H2=$BCSP RATIO=$RATIO"
142 puts $FileID "YMESH Y.BOTTOM=-$TEPI H1=$BCSP RATIO=$RATIO"
143 puts $FileID "YMESH Y.BOTTOM=-$TEPI-0.1 N.SPACES=1"
144 puts $FileID "#---------------------------------------------------"
147 #-----------------------
149 #-----------------------
150 set W12
[expr $EBSP*(2*$RATIO-1)/($RATIO-1)]
151 set W14
[expr $EBSP*(4*$RATIO-1)/($RATIO-1)]
152 set W22
[expr $BCSP*(2*$RATIO-1)/($RATIO-1)]
153 set W24
[expr $BCSP*(4*$RATIO-1)/($RATIO-1)]
154 set WEJBC
[expr $WEXB-$EDIF+($WXBASE-$WBCONT)/2]
155 set WXJBC
[expr $XDIF+$BXOVER+($WXBASE-$WBCONT)/2]
157 #-----------------------------------------------------------------------
160 for {set STEPS
0} {$STEPS < 2 } { incr STEPS
} {
166 set TMP
[expr int
($W1/$EBJUNC)]
171 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
175 if {$X1} { set YMN
[expr $EBJUNC-$W1]}
176 if {$X2} { set YMN
[expr $EPS]}
178 set TMP
[expr int
($W1/$LY1)]
183 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
187 if {$X1} { set YMX
[expr $EBJUNC+$W1]}
188 if {$X2} { set YMX
[expr $EBJUNC+$LY1-$EPS]}
190 set TMP
[expr int
($W1/$LX1)]
194 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
198 set TMP
[expr int
($W1/$WEJBC)]
202 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
206 if {$X1} { set XMX
[expr $LEDE-$EDIF-$SFAC*$W1] }
207 if {$X1} { puts $FileID "ELIMINATE Direction=ROWS X.MAX=$XMX Y.TOP=-$YMN Y.BOTTOM=-$YMX" }
208 if {$X2} { set XMN
[expr $LEDE+$WEMIT+$EDIF+$SFAC*$W1] }
209 if {$X2} { puts $FileID "ELIMINATE Direction=ROWS X.MIN=$XMN Y.TOP=-$YMN Y.BOTTOM=-$YMX" }
212 #-----------------------------------------------------------------------
213 for {set STEPS
0} {$STEPS < 2 } { incr STEPS
} {
219 set TMP
[expr int
($W1/$LY2)]
224 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
228 if {$X1} { set YMN
[expr $BCJUNC-$W1]}
229 if {$X2} { set YMN
[expr $EPS]}
231 set YMX
[expr $BCJUNC+$W1]
233 set XMX
[expr $DLBDE-$BDIF-$SFAC*$W1]
234 puts $FileID "ELIMINATE Direction=ROWS X.MAX=$XMX Y.TOP=-$YMN Y.BOTTOM=-$YMX"
235 set XMN
[expr $WMAX-$DRBDE+$XDIF+$SFAC*$W1]
236 puts $FileID "ELIMINATE Direction=ROWS X.MIN=$XMN Y.TOP=-$YMN Y.BOTTOM=-$YMX"
239 #-----------------------
241 #-----------------------
242 for {set STEPS
0} {$STEPS < 2 } { incr STEPS
} {
248 set YMN
[expr $EBJUNC+$SFAC*$W1]
250 set TMP
[expr int
($W1/$LX1)]
255 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
259 if {$X1} { set XMN
[expr $LEDE-$EDIF-$W1]}
260 if {$X2} { set XMN
[expr $DLBDE+$LX2+$EPS]}
262 set TMP
[expr int
($W1/($EDIF+$WEMIT/2)) ]
266 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
270 if {$X1} { set XMX
[expr $LEDE-$EDIF+$W1]}
271 if {$X1} { puts $FileID "ELIMINATE Direction=COLUMNS X.MIN=$XMN X.MAX=$XMX Y.TOP=-$YMN"}
272 if {$X1} { set XMN
[expr $LEDE+$WEMIT+$EDIF-$W1]}
274 set TMP
[expr int
($W1/$WEJBC)]
279 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
283 if {$X1} { set XMX
[expr $LEDE+$WEMIT+$EDIF+$W1]}
284 if {$X2} { set XMX
[expr $LBCONT-$EPS]}
285 puts $FileID "ELIMINATE Direction=COLUMNS X.MIN=$XMN X.MAX=$XMX Y.TOP=-$YMN"
288 #-----------------------------------------------------------------------
289 for {set STEPS
0} {$STEPS < 2 } { incr STEPS
} {
295 set YMN
[expr $BCJUNC+$SFAC*$W1]
296 set XMN
[expr $DLBDE-$BDIF-$W1]
297 set TMP
[expr int
($W1/$LX2)]
302 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
307 if {$X1} { set XMX
[expr $DLBDE-$BDIF+$W1]}
308 if {$X2} { set XMX
[expr $DLBDE-$BDIF+$LX2-$EPS]}
309 puts $FileID "ELIMINATE Direction=COLUMNS X.MIN=$XMN X.MAX=$XMX Y.TOP=-$YMN"
311 set TMP
[expr int
($W1/$WXJBC)]
316 for {set loop
0} { $loop < [expr int
((2+$TMP)/(1+$TMP))]} {incr loop
} {
320 if {$X1} { set XMN
[expr $WMAX-$DRBDE+$XDIF-$W1]}
321 if {$X2} { set XMN
[expr $WMAX-$DRBDE+$XDIF-$WXJBC+$EPS]}
322 set XMX
[expr $WMAX-$DRBDE+$XDIF+$W1]
323 puts $FileID "ELIMINATE Direction=COLUMNS X.MIN=$XMN X.MAX=$XMX Y.TOP=-$YMN"
326 #-----------------------
328 #-----------------------
329 puts $FileID "#---------------------------------------------------"
330 puts $FileID "REGION Label=Silicon Material=Si"
331 puts $FileID "REGION Label=Oxide1 Material=Ox IY.MIN=0 IY.MAX=1 X.MIN=0 X.MAX=$LBCONT"
333 #-----------------------
335 #-----------------------
336 puts $FileID "REGION Label=Collector Material=Elec Y.TOP=-$TEPI+0.0001"
337 puts $FileID "REGION Label=Emitter Material=Elec IY.MAX=1 X.MIN=$LECONT X.MAX=$LECONT+$WECONT"
338 puts $FileID "REGION Label=Oxide2 Material=Ox IY.MAX=1 X.MIN=$LECONT+$WECONT X.MAX=$LBCONT"
339 puts $FileID "REGION Label=Base Material=Elec IY.MAX=1 X.MIN=$LBCONT X.MAX=$LBCONT+$WBCONT"
340 puts $FileID "REGION Label=Oxide3 Material=Ox IY.MAX=1 X.MIN=$LBCONT+$WBCONT X.MAX=$WMAX"
341 #-----------------------
343 #-----------------------
344 set BLCHAR
[expr $BLDEPTH/sqrt
(log
($BLPEAK/$NEPI))]
355 #-----------------------
357 #-----------------------
358 puts $FileID "#---------------------------------------------------"
359 puts $FileID "PROFILE Ion=$ECTYP N.PEAK=$NEPI Type=Uniform X.MIN=0 X.MAX=$WMAX Y.TOP=0.1 Y.BOTTOM=-$TEPI-0.1"
362 puts $FileID "PROFILE Type=Gauss Ion=$ECTYP N.PEAK=$BLPEAK Y.TOP=-$TEPI Y.CHAR=$BLCHAR X.MIN=0 X.MAX=$WMAX"
365 puts $FileID "PROFILE Type=Gauss Ion=$BTYP N.PEAK=$BPEAK Y.TOP=-$YBPEAK Y.Junction=-$BCJUNC XY.RATIO=$LATD \
366 X.MIN=$DLBDE X.MAX=[expr $DLBDE+$WBASE]"
369 puts $FileID "PROFILE Type=Gauss Ion=$BTYP N.PEAK=$XBPEAK Y.CHAR=$XYCH X.CHAR=[expr $LATD*$XYCH] \
370 X.MIN=[expr $LEDE+$WEMIT+$WEXB] X.MAX=[expr $LEDE+$WEMIT+$WEXB+$WXBASE]"
373 puts $FileID "PROFILE Type=Gauss Ion=$ECTYP N.PEAK=$EPEAK Y.Junction=-$EBJUNC XY.RATIO=$LATD \
374 X.MIN=$LEDE X.MAX=[expr $LEDE+$WEMIT]"
376 #-----------------------
377 # Boundary Conditions
378 #-----------------------
379 puts $FileID "#---------------------------------------------------"
380 puts $FileID "CONTACT Type = OhmicContact ID = Emitter"
381 puts $FileID "CONTACT Type = OhmicContact ID = Base"
382 puts $FileID "CONTACT Type = OhmicContact ID = Collector"
384 #-----------------------
386 #-----------------------
387 puts $FileID "#---------------------------------------------------"
388 puts $FileID "PLOT Variable=DeviceMesh"
390 #-----------------------
391 # Solve Equilibrium State
392 #-----------------------
393 puts $FileID "METHOD Type = DDML1 Scheme = Newton NS=LineSearch LS=GMRES"
394 puts $FileID "SOLVE Type = TRANSIENT TStart = 0 TStep=1e-12 TStop = 3e-11"
395 puts $FileID "SOLVE Type = EQUILIBRIUM"
396 puts $FileID "PLOT Variable=Na Resolution=RES.High AzAngle=120 ElAngle=60"
397 puts $FileID "PLOT Variable=Nd Resolution=RES.High AzAngle=120 ElAngle=60"
398 puts $FileID "PLOT Variable=Potential Resolution=RES.High AzAngle=240 ElAngle=20"
399 puts $FileID "PLOT Variable=ElecDensity Resolution=RES.High AzAngle=240 ElAngle=20"
400 puts $FileID "PLOT Variable=HoleDensity Resolution=RES.High AzAngle=240 ElAngle=20"
402 puts $FileID "EXPORT CoreFile = $TRANTYPE.init.cgns"