Etch/Simulation.pm

filter: Statementstmt 97.2% 140 / 144 Branchbran 64.1% 50 / 78 Conditioncond 54.5% 12 / 22 MC/DCmcdc 28.5% 4 / 14 Subroutinesub 73.3% 11 / 15 Podpod 33.3% 3 / 9 totaltotal 78.0% 220 / 282 CC 53 SCAR 24.7
CC
53
Cov
83%
run
21.5
report
14.0
_analyze_feature
9.1
CRAP 11.8
« Etch/Process.pm ↑ Summary Etch/Chamber.pm »
1 package Physics::Etch::Simulation;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.02';
8  
9 # ===========================================================================
10 # Ties an etch process to a chamber, a mask layout and a loading model, then
11 # simulates pattern-dependent, per-feature etch behaviour:
12 # * chamber geometry -> pressure & DC bias handed to the process
13 # * open area + wafer area -> macro loading -> reduced global rate
14 # * per-feature CD -> aspect ratio -> ARDE (RIE lag) -> local rate & taper
15 # * local pattern density -> micro loading
16 #
17 # new( process => $etch, # Physics::Etch::WetEtch or DryEtch (req.)
18 # chamber => $chamber, # Physics::Etch::Chamber (optional)
19 # layout => $layout, # Physics::Etch::Layout (optional)
20 # loading => $loading, # Physics::Etch::Loading (optional)
21 # wafer_area_cm2 => ..., # overrides chamber wafer area
22 # micro_cell_um => 20 )
23 # ===========================================================================
24 2 ▶sub new {
Subroutine new: called CC=3 SCAR=11.7
Pod undocumented
25 2 my ( $class, %a ) = @_;
26 my $self = bless {
27 process => $a{process} || croak('Simulation: process required'),
28 chamber => $a{chamber},
29 layout => $a{layout},
30 loading => $a{loading},
31 wafer_area_cm2 => $a{wafer_area_cm2},
32 2 ▶ micro_cell_um => $a{micro_cell_um} // 20,
Condition50%2/4
$a{'process'} || croak('Simulation: process required')
l!l
20
$a{"micro_cell_um"} // 20
l!l
02
MC/DC0%0/1
$a{'process'} || croak('Simulation: process required')
$a{'process'}
MC/DC0%0/1
$a{"micro_cell_um"} // 20
$a{"micro_cell_um"}
Truth table50%1/2
A
A= $a{'process'}
Aresult
11
00
Truth table50%1/2
A
A= $a{"micro_cell_um"}
Aresult
11
00
33 _ran => 0,
34 }, $class;
35 2 return $self;
36 }
37  
38 0 ▶sub process { $_[0]->{process} }
Subroutine process: not called CC=1 SCAR=6.9
Pod documented
39 0 ▶sub chamber { $_[0]->{chamber} }
Subroutine chamber: not called CC=1 SCAR=6.9
Pod undocumented
40 0 ▶sub layout { $_[0]->{layout} }
Subroutine layout: not called CC=1 SCAR=6.9
Pod documented
41 0 ▶sub loading { $_[0]->{loading} }
Subroutine loading: not called CC=1 SCAR=6.9
Pod documented
42  
43 # ---------------------------------------------------------------------------
44 2 ▶sub run {
Subroutine run: called CC=19 SCAR=30.7
Pod undocumented
45 2 my ($self) = @_;
46 2 my $p = $self->{process};
47  
48 # 1) chamber -> process conditions (only if the process accepts them)
49 2 ▶ if ( $self->{chamber} && $p->can('bias') ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"chamber"} and $p->can("bias")) 1 1 2
Condition66%2/3
$self->{"chamber"} and $p->can("bias")
!ll&&!rl&&r
101
MC/DC50%1/2
$self->{"chamber"} and $p->can("bias")
$self->{"chamber"} $p->can("bias")
Truth table66%2/3
A and B
A= $self->{"chamber"}B= $p->can("bias")
ABresult
0X0
100
111
50 1 my %c = $self->{chamber}->process_conditions;
51 1 ▶ $p->pressure( $c{pressure} ) if defined $c{pressure};
Branch: 1 branch
BranchTrueFalseTotal
if defined $c{"pressure"} 1 0 1
52 1 ▶ $p->bias( $c{bias} ) if defined $c{bias};
Branch: 1 branch
BranchTrueFalseTotal
if defined $c{"bias"} 1 0 1
53 }
54  
55 # base (unloaded) rates
56 2 ▶ $self->{base_loading} //= ( $p->can('loading') ? $p->loading : 1 );
Branch: 1 branch
BranchTrueFalseTotal
$p->can('loading') ? : 2 0 2
Condition33%1/3
$self->{"base_loading"} //= $p->can("loading") ? $p->loading : 1
l!l&&r!l&&!r
020
MC/DC0%0/2
$self->{"base_loading"} //= $p->can("loading") ? $p->loading : 1
$self->{"base_loading"} $p->can("loading") ? $p->loading : 1
Truth table33%1/3
A //= B
A= $self->{"base_loading"}B= $p->can("loading") ? $p->loading : 1
ABresult
1X1
011
000
57 2 ▶ $p->loading( $self->{base_loading} ) if $p->can('loading');
Branch: 1 branch
BranchTrueFalseTotal
if $p->can("loading") 2 0 2
58 2 my $base_rate = $p->vertical_rate;
59  
60 # 2) macro loading from open area
61 my $wafer_area = $self->{wafer_area_cm2}
62 2 ▶ // ( $self->{chamber} ? $self->{chamber}->wafer_area_cm2 : undef );
Branch: 1 branch
BranchTrueFalseTotal
$self->{'chamber'} ? : 1 1 2
Condition66%2/3
$self->{"wafer_area_cm2"} // ($self->{"chamber"} ? $self->{"chamber"}->wafer_area_cm2 : undef)
l!l&&r!l&&!r
011
MC/DC50%1/2
$self->{"wafer_area_cm2"} // ($self->{"chamber"} ? $self->{"chamber"}->wafer_area_cm2 : undef)
$self->{"wafer_area_cm2"} ($self->{"chamber"} ? $self->{"chamber"}->wafer_area_cm2 : undef)
Truth table66%2/3
A // B
A= $self->{"wafer_area_cm2"}B= ($self->{"chamber"} ? $self->{"chamber"}->wafer_area_cm2 : undef)
ABresult
1X1
011
000
63 2 my ( $open_fraction, $a_load );
64 2 ▶ if ( $self->{layout} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"layout"}) 2 0 2
65 2 $open_fraction = $self->{layout}->open_fraction;
66 $a_load = defined $wafer_area
67 ? $open_fraction * $wafer_area
68 2 ▶ : $self->{layout}->open_area_cm2;
Branch: 1 branch
BranchTrueFalseTotal
defined $wafer_area ? : 1 1 2
69 }
70 2 my $macro = 1;
71 2 ▶ if ( $self->{loading} && defined $a_load ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"loading"} and defined $a_load) 1 1 2
Condition66%2/3
$self->{"loading"} and defined $a_load
!ll&&!rl&&r
101
MC/DC50%1/2
$self->{"loading"} and defined $a_load
$self->{"loading"} defined $a_load
Truth table66%2/3
A and B
A= $self->{"loading"}B= defined $a_load
ABresult
0X0
100
111
72 1 $macro = $self->{loading}->macro_factor($a_load);
73 1 ▶ $p->loading( $self->{base_loading} * $macro ) if $p->can('loading');
Branch: 1 branch
BranchTrueFalseTotal
if $p->can("loading") 1 0 1
74 }
75  
76 # loaded global rates / timing (low aspect ratio field)
77 2 my $Rv = $p->vertical_rate;
78 2 my $Rl = $p->lateral_rate;
79 2 ▶ my $thickness = $p->thickness
Branch: 1 branch
BranchTrueFalseTotal
my $thickness = $p->thickness or croak("Simulation: process needs a film thickness") 2 0 2
80 or croak 'Simulation: process needs a film thickness';
81 2 my $t_clear = $thickness / $Rv;
82 2 my $etch_time = $p->etch_time; # respects explicit time or overetch
83  
84 # 3) micro-loading density map
85 2 my ( $den, $mean_den );
86 2 ▶ if ( $self->{layout} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"layout"}) 2 0 2
87 2 $den = $self->{layout}->density_map( cell_um => $self->{micro_cell_um} );
88 2 $mean_den = $den->{mean};
89 }
90  
91 # 4) per-feature analysis
92 2 my @feat;
93 2 ▶ if ( $self->{layout} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"layout"}) 2 0 2
94 2 for my $f ( @{ $self->{layout}->features } ) {
95 4 push @feat, $self->_analyze_feature( $f, $Rv, $Rl, $thickness,
96 $etch_time, $den, $mean_den );
97 }
98 }
99  
100 $self->{result} = {
101 2 base_rate => $base_rate,
102 macro_factor => $macro,
103 loaded_rate => $Rv,
104 lateral_rate => $Rl,
105 open_fraction => $open_fraction,
106 wafer_area => $wafer_area,
107 a_load => $a_load,
108 time_to_clear => $t_clear,
109 etch_time => $etch_time,
110 thickness => $thickness,
111 density => $den,
112 features => \@feat,
113 };
114 2 $self->{_ran} = 1;
115 2 return $self;
116 }
117  
118 4 ▶sub _analyze_feature {
Subroutine _analyze_feature: called CC=9 SCAR=22.1
119 4 my ( $self, $f, $Rv, $Rl, $thickness, $t, $den, $mean_den ) = @_;
120 4 my $cd = $f->{cd_nm};
121 4 ▶ my $ar = $cd > 0 ? $thickness / $cd : 0; # final aspect ratio
Branch: 1 branch
BranchTrueFalseTotal
$cd > 0 ? : 4 0 4
122  
123 # ARDE
124 4 my ( $av, $al ) = ( 1, 1 );
125 4 ▶ if ( $self->{loading} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"loading"}) 2 2 4
126 2 $av = $self->{loading}->arde_factor($ar);
127 2 $al = $self->{loading}->arde_lateral_factor($ar);
128 }
129  
130 # micro loading at feature center
131 4 my $micro = 1;
132 4 my $local_den;
133 4 ▶ if ( $self->{loading} && $den ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"loading"} and $den) 2 2 4
Condition66%2/3
$self->{"loading"} and $den
!ll&&!rl&&r
202
MC/DC50%1/2
$self->{"loading"} and $den
$self->{"loading"} $den
Truth table66%2/3
A and B
A= $self->{"loading"}B= $den
ABresult
0X0
100
111
134 2 $local_den = $self->_density_at( $den, $f->{center} );
135 2 $micro = $self->{loading}->micro_relative( $local_den, $mean_den );
136 }
137  
138 4 my $rv = $Rv * $av * $micro;
139 4 my $rl = $Rl * $al * $micro;
140 4 my $depth = $rv * $t;
141 4 ▶ my $film = $depth > $thickness ? $thickness : $depth;
Branch: 1 branch
BranchTrueFalseTotal
$depth > $thickness ? : 3 1 4
142 4 my $under = $rl * $t;
143 4 ▶ my $aniso = $rv > 0 ? 1 - $rl / $rv : 0;
Branch: 1 branch
BranchTrueFalseTotal
$rv > 0 ? : 4 0 4
144 4 ▶ $aniso = 0 if $aniso < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $aniso < 0 0 4 4
145 4 my $angle = _deg( atan2( $film, $under ) );
146  
147 return {
148 4 ▶ cd_nm => $cd,
Branch: 1 branch
BranchTrueFalseTotal
$depth >= $thickness ? : 3 1 4
149 aspect_ratio => $ar,
150 arde_factor => $av,
151 local_density => $local_den,
152 local_rate => $rv,
153 depth => $depth,
154 film_depth => $film,
155 cleared => ( $depth >= $thickness ? 1 : 0 ),
156 undercut => $under,
157 etch_bias => 2 * $under,
158 anisotropy => $aniso,
159 sidewall_angle => $angle,
160 };
161 }
162  
163 2 ▶sub _density_at {
Subroutine _density_at: called CC=5 SCAR=16.6
164 2 my ( $self, $den, $center ) = @_;
165 2 my ( $cx, $cy ) = @$center;
166 2 my ( $x0, $y0 ) = ( $self->{layout}->bbox )[ 0, 1 ];
167 2 my $ix = int( ( $cx - $x0 ) / $den->{cell} );
168 2 my $iy = int( ( $cy - $y0 ) / $den->{cell} );
169 2 ▶ $ix = 0 if $ix < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $ix < 0 0 2 2
170 2 ▶ $iy = 0 if $iy < 0;
Branch: 1 branch
BranchTrueFalseTotal
if $iy < 0 0 2 2
171 2 ▶ $ix = $den->{nx} - 1 if $ix > $den->{nx} - 1;
Branch: 1 branch
BranchTrueFalseTotal
if $ix > $den->{"nx"} - 1 0 2 2
172 2 ▶ $iy = $den->{ny} - 1 if $iy > $den->{ny} - 1;
Branch: 1 branch
BranchTrueFalseTotal
if $iy > $den->{"ny"} - 1 0 2 2
173 2 return $den->{grid}[$iy][$ix];
174 }
175  
176 # ---------------------------------------------------------------------------
177 # grouped-by-CD view (arrays of identical features collapse to one row)
178 # ---------------------------------------------------------------------------
179 2 ▶sub features_by_cd {
Subroutine features_by_cd: called CC=8 SCAR=20.8
Pod undocumented
180 2 my ($self) = @_;
181 2 ▶ $self->run unless $self->{_ran};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_ran"} 0 2 2
182 2 my %g;
183 2 for my $f ( @{ $self->{result}{features} } ) {
184 4 my $key = sprintf '%.0f', $f->{cd_nm};
185 4 push @{ $g{$key} }, $f;
186 }
187 2 my @rows;
188 2 for my $key ( sort { $a <=> $b } keys %g ) {
189 4 my @fs = @{ $g{$key} };
190 4 my $rep = $fs[0];
191 # worst (min) sidewall / clearance within the group
192 4 my ( $min_ang, $any_uncleared ) = ( $rep->{sidewall_angle}, 0 );
193 4 for my $f (@fs) {
194 4 ▶ $min_ang = $f->{sidewall_angle} if $f->{sidewall_angle} < $min_ang;
Branch: 1 branch
BranchTrueFalseTotal
if $f->{"sidewall_angle"} < $min_ang 0 4 4
195 4 ▶ $any_uncleared = 1 unless $f->{cleared};
Branch: 1 branch
BranchTrueFalseTotal
unless $f->{"cleared"} 2 2 4
196 }
197 4 ▶ push @rows,
Branch: 1 branch
BranchTrueFalseTotal
$any_uncleared ? : 2 2 4
198 {
199 %$rep,
200 count => scalar @fs,
201 sidewall_angle => $min_ang,
202 cleared => ( $any_uncleared ? 0 : 1 ),
203 };
204 }
205 2 return \@rows;
206 }
207  
208 2 ▶sub result { $_[0]->run unless $_[0]->{_ran}; $_[0]->{result} }
Subroutine result: called CC=2 SCAR=7.2
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
unless $_[0]{"_ran"} 0 2 2
209  
210 # ---------------------------------------------------------------------------
211 1 ▶sub report {
Subroutine report: called CC=13 SCAR=26.4
Pod undocumented
212 1 my ($self) = @_;
213 1 ▶ $self->run unless $self->{_ran};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_ran"} 0 1 1
214 1 my $r = $self->{result};
215 1 my $p = $self->{process};
216 1 my @o;
217  
218 1 push @o, '#' x 66;
219 1 push @o, sprintf( '# ETCH SIMULATION -- %s (%s)',
220 $p->target->label, $p->process_type );
221 1 push @o, '#' x 66;
222  
223 1 ▶ push @o, $self->{chamber}->report if $self->{chamber};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"chamber"} 1 0 1
224 1 ▶ push @o, $self->{loading}->describe if $self->{loading};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"loading"} 1 0 1
225 1 ▶ push @o, $self->{layout}->summary if $self->{layout};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"layout"} 1 0 1
226  
227 1 push @o, '-' x 66;
228 1 push @o, sprintf( ' Base rate : %.1f nm/min', $r->{base_rate} );
229 1 ▶ if ( $self->{loading} && defined $r->{a_load} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"loading"} and defined $r->{"a_load"}) 1 0 1
Condition33%1/3
$self->{"loading"} and defined $r->{"a_load"}
!ll&&!rl&&r
001
MC/DC0%0/2
$self->{"loading"} and defined $r->{"a_load"}
$self->{"loading"} defined $r->{"a_load"}
Truth table33%1/3
A and B
A= $self->{"loading"}B= defined $r->{"a_load"}
ABresult
0X0
100
111
230 push @o, sprintf(
231 ' Macro loading : A_load %.1f cm^2 -> x%.3f (%.1f -> %.1f nm/min)',
232 1 $r->{a_load}, $r->{macro_factor}, $r->{base_rate}, $r->{loaded_rate} );
233 }
234 push @o, sprintf( ' Global etch : clear %.2f min, run %.2f min',
235 1 $r->{time_to_clear}, $r->{etch_time} );
236  
237 1 ▶ if ( $r->{density} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($r->{"density"}) 1 0 1
238 push @o, sprintf(
239 ' Micro density : local open %.2f - %.2f (mean %.2f)',
240 1 $r->{density}{min}, $r->{density}{max}, $r->{density}{mean} );
241 }
242  
243 # per-CD feature table
244 1 my $rows = $self->features_by_cd;
245 1 ▶ if (@$rows) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$rows) 1 0 1
246 1 push @o, '-' x 66;
247 1 push @o, sprintf( ' %-9s %-4s %-6s %-7s %-8s %-7s %-6s %s',
248 'CD(nm)', 'x', 'AR', 'ARDE', 'depth', 'under', 'A', 'wall' );
249 1 for my $row (@$rows) {
250 push @o, sprintf(
251 ' %-9.0f %-4d %-6.2f %-7.2f %-8.0f %-7.1f %-6.3f %.0f%s',
252 $row->{cd_nm}, $row->{count}, $row->{aspect_ratio},
253 $row->{arde_factor}, $row->{depth}, $row->{undercut},
254 $row->{anisotropy}, $row->{sidewall_angle},
255 2 ▶ ( $row->{cleared} ? '' : ' *UNCLEARED*' ),
Branch: 1 branch
BranchTrueFalseTotal
$row->{'cleared'} ? : 1 1 2
256 );
257 }
258 1 push @o, ' (depth/under in nm; A = anisotropy; wall = sidewall deg)';
259  
260 # RIE-lag / loading depth spread (shallowest vs deepest feature)
261 1 my @by_depth = sort { $a->{depth} <=> $b->{depth} } @$rows;
262 1 my $shallow = $by_depth[0];
263 1 my $deep = $by_depth[-1];
264 1 ▶ if ( $deep->{depth} > 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($deep->{"depth"} > 0) 1 0 1
265 1 push @o, '-' x 66;
266 push @o, sprintf(
267 ' Pattern spread: shallowest (%.0f nm, AR %.2f) reaches %.0f%% '
268 . 'of the deepest (%.0f nm) etch depth',
269 $shallow->{cd_nm}, $shallow->{aspect_ratio},
270 1 100 * $shallow->{depth} / $deep->{depth}, $deep->{cd_nm} );
271 }
272 1 my @unc = grep { !$_->{cleared} } @$rows;
273 1 ▶ push @o, sprintf( ' WARNING: %d CD group(s) not cleared at run time', scalar @unc )
Branch: 1 branch
BranchTrueFalseTotal
if @unc 1 0 1
274 if @unc;
275 }
276  
277 1 push @o, '#' x 66;
278 1 return join( "\n", @o ) . "\n";
279 }
280  
281 4 ▶sub _deg { $_[0] * 180 / 3.14159265358979 }
Subroutine _deg: called CC=1 SCAR=0.0
282  
283 3 1;
284  
285 __END__
« Etch/Process.pm ↑ Summary Etch/Chamber.pm »