Etch.pm

filter: Statementstmt 84.9% 79 / 93 Branchbran 73.3% 22 / 30 Conditioncond 88.2% 15 / 17 MC/DCmcdc 71.4% 5 / 7 Subroutinesub 74.0% 20 / 27 Podpod 100% 13 / 13 totaltotal 82.3% 154 / 187 CC 25 SCAR 17.0
CC
25
Cov
83%
_build
13.4
recipes
6.0
_coerce_layer
5.3
CRAP 5.5
« Etch/DryEtch.pm ↑ Summary Etch/Loading.pm »
1 package Physics::Etch;
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 ▶use Physics::Etch::Material;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Physics::Etch::Etchant;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use Physics::Etch::WetEtch;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use Physics::Etch::DryEtch;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use Physics::Etch::GDSII;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 3 ▶use Physics::Etch::Layout;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use Physics::Etch::Chamber;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶use Physics::Etch::Loading;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 3 ▶use Physics::Etch::Simulation;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 3 our $VERSION = '0.02';
18  
19 # ===========================================================================
20 # Material database (density in g/cm^3; illustrative)
21 # ===========================================================================
22 3 my %MATERIAL = (
23 copper => { formula => 'Cu', pretty => 'Copper', density => 8.96 },
24 photoresist => { formula => '', pretty => 'Photoresist', density => 1.20 },
25 aluminum_silicide => { formula => 'Al-Si', pretty => 'Aluminum Silicide', density => 2.70 },
26 tantalum => { formula => 'Ta', pretty => 'Tantalum', density => 16.65 },
27 titanium => { formula => 'Ti', pretty => 'Titanium', density => 4.51 },
28 silicon_nitride => { formula => 'Si3N4', pretty => 'Silicon Nitride', density => 3.17 },
29 polyimide => { formula => 'PI', pretty => 'Polyimide', density => 1.42 },
30 silicon => { formula => 'Si', pretty => 'Silicon', density => 2.33 },
31 silicon_dioxide => { formula => 'SiO2', pretty => 'Silicon Dioxide', density => 2.20 },
32 titanium_nitride => { formula => 'TiN', pretty => 'Titanium Nitride', density => 5.22 },
33 );
34  
35 # ===========================================================================
36 # Recipe database. Numbers are illustrative, order-of-magnitude values from
37 # typical semiconductor practice; every value is overridable at call time.
38 # Wet : rate @ ref_temp (degC), Ea (eV), isotropy (lateral/vertical)
39 # Dry : nominal rate, anisotropy, and nominal power/pressure/bias
40 # ===========================================================================
41 3 my @RECIPE = (
42 # -------------------------------- Copper --------------------------------
43 { material => 'copper', process => 'wet', etchant => 'FeCl3',
44 composition => 'Ferric chloride, ~40 Baume', mechanism => 'chemical',
45 rate => 800, ref_temp => 25, Ea => 0.43, isotropy => 1.0,
46 sel_mask => 80, sel_substrate => 300,
47 default_mask => 'photoresist', default_substrate => 'silicon_dioxide',
48 notes => 'Fast, fully isotropic -> strong undercut on patterned Cu.',
49 },
50 { material => 'copper', process => 'wet', etchant => 'APS',
51 composition => 'Ammonium persulfate (NH4)2S2O8', mechanism => 'chemical',
52 rate => 250, ref_temp => 25, Ea => 0.50, isotropy => 1.0,
53 sel_mask => 120, sel_substrate => 400,
54 default_mask => 'photoresist',
55 notes => 'Cleaner alternative to FeCl3, slower.',
56 },
57 { material => 'copper', process => 'dry', etchant => 'Ar-IBE',
58 composition => 'Ar+ ion-beam milling', mechanism => 'physical',
59 rate => 30, anisotropy => 0.70, power_nom => 300, pressure_nom => 1,
60 bias_nom => 500, sel_mask => 1.5, sel_substrate => 1.2,
61 default_mask => 'photoresist', default_substrate => 'silicon_dioxide',
62 notes => 'Cu has no volatile halides near RT; physical milling used.',
63 },
64 # ----------------------------- Photoresist ------------------------------
65 { material => 'photoresist', process => 'wet', etchant => 'acetone',
66 composition => 'Acetone / solvent strip', mechanism => 'chemical',
67 rate => 5000, ref_temp => 25, Ea => 0.20, isotropy => 1.0,
68 notes => 'Blanket solvent strip; effectively dissolves resist.',
69 },
70 { material => 'photoresist', process => 'wet', etchant => 'piranha',
71 composition => 'H2SO4 : H2O2 (3:1) piranha', mechanism => 'chemical',
72 rate => 2000, ref_temp => 90, Ea => 0.30, isotropy => 1.0,
73 notes => 'Aggressive organic strip / clean.',
74 },
75 { material => 'photoresist', process => 'dry', etchant => 'O2',
76 composition => 'O2 plasma ash', mechanism => 'chemical',
77 rate => 300, anisotropy => 0.40, power_nom => 200, pressure_nom => 100,
78 bias_nom => 100,
79 notes => 'O2 ashing; low-bias barrel asher is nearly isotropic.',
80 },
81 # -------------------------- Aluminum silicide ---------------------------
82 { material => 'aluminum_silicide', process => 'wet', etchant => 'PAN',
83 composition => 'H3PO4:HNO3:CH3COOH:H2O (16:1:1:2)', mechanism => 'chemical',
84 rate => 400, ref_temp => 50, Ea => 0.53, isotropy => 1.0,
85 sel_mask => 60, sel_substrate => 100,
86 default_mask => 'photoresist', default_substrate => 'silicon_dioxide',
87 notes => 'Standard Al etch; Si-rich residue possible from the Si phase.',
88 },
89 { material => 'aluminum_silicide', process => 'dry', etchant => 'Cl2/BCl3',
90 composition => 'Cl2 / BCl3 / (Ar)', mechanism => 'ion-assisted',
91 rate => 250, anisotropy => 0.92, power_nom => 250, pressure_nom => 10,
92 bias_nom => 200, sel_mask => 3, sel_substrate => 5,
93 default_mask => 'photoresist', default_substrate => 'silicon_dioxide',
94 notes => 'BCl3 scavenges native oxide; requires post-etch corrosion control.',
95 },
96 # ------------------------------- Tantalum -------------------------------
97 { material => 'tantalum', process => 'wet', etchant => 'HF/HNO3',
98 composition => 'HF : HNO3 : H2O', mechanism => 'chemical',
99 rate => 300, ref_temp => 25, Ea => 0.40, isotropy => 1.0,
100 sel_mask => 40, sel_substrate => 20,
101 default_mask => 'photoresist',
102 notes => 'Attacks many underlayers; use with care.',
103 },
104 { material => 'tantalum', process => 'dry', etchant => 'SF6',
105 composition => 'SF6 (/ O2)', mechanism => 'ion-assisted',
106 rate => 120, anisotropy => 0.85, power_nom => 200, pressure_nom => 20,
107 bias_nom => 150, sel_mask => 5, sel_substrate => 8,
108 default_mask => 'photoresist', default_substrate => 'silicon_dioxide',
109 notes => 'Volatile TaF5 product; good for Ta/TaN metal.',
110 },
111 # ------------------------------- Titanium -------------------------------
112 { material => 'titanium', process => 'wet', etchant => 'DHF',
113 composition => 'Dilute HF (1:20) or HF:H2O2', mechanism => 'chemical',
114 rate => 120, ref_temp => 25, Ea => 0.35, isotropy => 1.0,
115 sel_mask => 50, sel_substrate => 30,
116 default_mask => 'photoresist', default_substrate => 'silicon_dioxide',
117 notes => 'Ti etches readily in HF; SiO2 under-layer also attacked.',
118 },
119 { material => 'titanium', process => 'dry', etchant => 'Cl2',
120 composition => 'Cl2 / BCl3', mechanism => 'ion-assisted',
121 rate => 150, anisotropy => 0.88, power_nom => 200, pressure_nom => 15,
122 bias_nom => 180, sel_mask => 4, sel_substrate => 6,
123 default_mask => 'photoresist', default_substrate => 'silicon_dioxide',
124 notes => 'Volatile TiCl4; SF6 also works (TiF4).',
125 },
126 # ---------------------------- Silicon nitride ---------------------------
127 { material => 'silicon_nitride', process => 'wet', etchant => 'H3PO4',
128 composition => 'Hot phosphoric acid, 180 degC', mechanism => 'chemical',
129 rate => 5, ref_temp => 180, Ea => 1.90, isotropy => 1.0,
130 sel_mask => 3, sel_substrate => 30,
131 default_mask => 'silicon_dioxide', default_substrate => 'silicon_dioxide',
132 notes => 'Classic selective nitride strip; very slow, high Ea, SiO2-selective.',
133 },
134 { material => 'silicon_nitride', process => 'dry', etchant => 'CF4/O2',
135 composition => 'CF4 / O2 (or CHF3)', mechanism => 'ion-assisted',
136 rate => 120, anisotropy => 0.90, power_nom => 200, pressure_nom => 30,
137 bias_nom => 250, sel_mask => 4, sel_substrate => 3,
138 default_mask => 'photoresist', default_substrate => 'silicon',
139 notes => 'Fluorocarbon RIE; O2 tunes polymerization / selectivity.',
140 },
141 # ------------------------------- Polyimide ------------------------------
142 { material => 'polyimide', process => 'wet', etchant => 'TMAH',
143 composition => 'Hot alkaline (TMAH / hydrazine)', mechanism => 'chemical',
144 rate => 150, ref_temp => 60, Ea => 0.70, isotropy => 1.0,
145 sel_mask => 20,
146 default_mask => 'photoresist',
147 notes => 'For non-photodefinable PI; strongly temperature dependent.',
148 },
149 { material => 'polyimide', process => 'dry', etchant => 'O2',
150 composition => 'O2 (/ CF4) RIE', mechanism => 'ion-assisted',
151 rate => 500, anisotropy => 0.85, power_nom => 250, pressure_nom => 50,
152 bias_nom => 200, sel_mask => 15, sel_substrate => 50,
153 default_mask => 'aluminum_silicide', default_substrate => 'silicon',
154 notes => 'O2 RIE gives fast, anisotropic polymer etch; needs a hard mask.',
155 },
156 );
157  
158 # ===========================================================================
159 # Introspection
160 # ===========================================================================
161 1 ▶sub material_names { return sort keys %MATERIAL }
Subroutine material_names: called CC=1 SCAR=0.0
Pod documented
162  
163 15 ▶sub recipes {
Subroutine recipes: called CC=6 SCAR=17.9
Pod documented
164 15 my ( $class, %f ) = @_;
165 return grep {
166 15 ( !defined $f{material} || $_->{material} eq $f{material} )
167 && ( !defined $f{process} || $_->{process} eq $f{process} )
168 && ( !defined $f{etchant} || $_->{etchant} eq $f{etchant} )
169 240 ▶ } @RECIPE;
Condition93%14/15
(!defined($f{'material'}) || $_->{'material'} eq $f{'material'}) && (!defined($f{'process'}) || $_->{'process'} eq $f{'process'}) && (!defined($f{'etchant'}) || $_->{'etchant'} eq $f{'etchant'})
!ll&&!rl&&r
213126
!defined($f{"material"}) || $_->{"material"} eq $f{"material"} and !defined($f{"process"}) || $_->{"process"} eq $f{"process"}
!ll&&!rl&&r
206727
not defined $f{"material"} or $_->{"material"} eq $f{"material"}
l!l&&r!l&&!r
034206
not defined $f{"process"} or $_->{"process"} eq $f{"process"}
l!l&&r!l&&!r
16117
not defined $f{"etchant"} or $_->{"etchant"} eq $f{"etchant"}
l!l&&r!l&&!r
2511
MC/DC83%5/6
(!defined($f{'material'}) || $_->{'material'} eq $f{'material'}) && (!defined($f{'process'}) || $_->{'process'} eq $f{'process'}) && (!defined($f{'etchant'}) || $_->{'etchant'} eq $f{'etchant'})
not defined $f{"material"} $_->{"material"} eq $f{"material"} not defined $f{"process"} $_->{"process"} eq $f{"process"} not defined $f{"etchant"} $_->{"etchant"} eq $f{"etchant"}
Truth table40%6/15
not(A) or B and not(C) or D && not(E) or F
A= not defined $f{"material"}B= $_->{"material"} eq $f{"material"}C= not defined $f{"process"}D= $_->{"process"} eq $f{"process"}E= not defined $f{"etchant"}F= $_->{"etchant"} eq $f{"etchant"}
ABCDEFresult
00XXXX0
1X00XX0
0100XX0
1X1X000
1X01000
011X000
0101000
1X1X1X1
1X1X011
1X011X1
1X01011
011X1X1
011X011
01011X1
0101011
170 }
171  
172 8 ▶sub find_recipe {
Subroutine find_recipe: called CC=2 SCAR=6.9
Pod documented
173 8 my ( $class, $material, $process, $etchant ) = @_;
174 8 ▶ my @m = $class->recipes(
Branch: 1 branch
BranchTrueFalseTotal
defined $etchant ? : 1 7 8
175 material => $material, process => $process,
176 ( defined $etchant ? ( etchant => $etchant ) : () ),
177 );
178 8 return $m[0];
179 }
180  
181 # ===========================================================================
182 # Material factory
183 # ===========================================================================
184 20 ▶sub material {
Subroutine material: called CC=3 SCAR=11.0
Pod documented
185 20 my ( $class, $name, %opt ) = @_;
186 20 my $spec = $MATERIAL{$name};
187 20 ▶ croak "Physics::Etch: unknown material '$name'" unless $spec;
Branch: 1 branch
BranchTrueFalseTotal
unless $spec 0 20 20
188 return Physics::Etch::Material->new(
189 name => $name,
190 formula => $spec->{formula},
191 pretty => $spec->{pretty},
192 density => $spec->{density},
193 20 ▶ ( defined $opt{thickness} ? ( thickness => $opt{thickness} ) : () ),
Branch: 1 branch
BranchTrueFalseTotal
defined $opt{'thickness'} ? : 7 13 20
194 );
195 }
196  
197 # ===========================================================================
198 # Process factories: build a Wet/DryEtch from a recipe + user overrides
199 # ===========================================================================
200 5 ▶sub wet_etch { my $c = shift; $c->_build( 'wet', @_ ) }
Subroutine wet_etch: called CC=1 SCAR=0.0
Pod documented
201 3 ▶sub dry_etch { my $c = shift; $c->_build( 'dry', @_ ) }
Subroutine dry_etch: called CC=1 SCAR=0.0
Pod documented
202  
203 8 ▶sub _build {
Subroutine _build: called CC=13 SCAR=26.0
204 8 my ( $class, $process, $material, %o ) = @_;
205  
206 my $r = $class->find_recipe( $material, $process, $o{etchant} )
207 or croak "Physics::Etch: no $process recipe for '$material'"
208 8 ▶ . ( defined $o{etchant} ? " with etchant '$o{etchant}'" : '' );
Branch: 2 branches
BranchTrueFalseTotal
my $r = $class->find_recipe($material, $process, $o{"etchant"}) or croak("Physics::Etch: no $process recipe for '${material}'" . (defined $o{"etchant"} ? qq[ with etchant '$o{"etchant"}'] : "")) 7 1 8
defined $o{'etchant'} ? : 0 1 1
209  
210 7 my $target = $class->material( $material, thickness => $o{thickness} );
211 my $etchant = Physics::Etch::Etchant->new(
212 name => $r->{etchant},
213 type => $process,
214 composition => $r->{composition},
215 mechanism => $r->{mechanism},
216 7 ▶ notes => $r->{notes} // '',
Condition50%1/2
$r->{"notes"} // ""
l!l
70
MC/DC0%0/1
$r->{"notes"} // ""
$r->{"notes"}
Truth table50%1/2
A
A= $r->{"notes"}
Aresult
11
00
217 );
218  
219 # mask / substrate: accept a name (looked up), an object, or default
220 my $mask = $class->_coerce_layer(
221 exists $o{mask} ? $o{mask} : $r->{default_mask},
222 $o{mask_thickness},
223 7 ▶ );
Branch: 1 branch
BranchTrueFalseTotal
exists $o{'mask'} ? : 0 7 7
224 my $substrate = $class->_coerce_layer(
225 exists $o{substrate} ? $o{substrate} : $r->{default_substrate},
226 undef,
227 7 ▶ );
Branch: 1 branch
BranchTrueFalseTotal
exists $o{'substrate'} ? : 0 7 7
228  
229 my %params = (
230 target => $target,
231 etchant => $etchant,
232 mask => $mask,
233 substrate => $substrate,
234 sel_mask => $r->{sel_mask},
235 sel_substrate => $r->{sel_substrate},
236 7 );
237  
238 7 ▶ if ( $process eq 'wet' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($process eq 'wet') { } 4 3 7
239 $params{$_} = $r->{$_}
240 4 for grep { defined $r->{$_} } qw( rate ref_temp Ea isotropy );
241 }
242 else {
243 $params{$_} = $r->{$_}
244 3 for grep { defined $r->{$_} }
245 qw( rate anisotropy power_nom pressure_nom bias_nom Ea ref_temp );
246 }
247  
248 # user overrides win over recipe defaults (skip already-handled keys)
249 7 my %handled = map { $_ => 1 }
250 qw( thickness mask substrate mask_thickness etchant );
251 7 for my $k ( keys %o ) {
252 12 ▶ next if $handled{$k};
Branch: 1 branch
BranchTrueFalseTotal
if $handled{$k} 8 4 12
253 4 $params{$k} = $o{$k};
254 }
255 7 ▶ $params{mask_thickness} = $o{mask_thickness} if defined $o{mask_thickness};
Branch: 1 branch
BranchTrueFalseTotal
if defined $o{"mask_thickness"} 0 7 7
256  
257 7 ▶ return $process eq 'wet'
Branch: 1 branch
BranchTrueFalseTotal
$process eq 'wet' ? : 4 3 7
258 ? Physics::Etch::WetEtch->new(%params)
259 : Physics::Etch::DryEtch->new(%params);
260 }
261  
262 14 ▶sub _coerce_layer {
Subroutine _coerce_layer: called CC=5 SCAR=16.7
263 14 my ( $class, $spec, $thickness ) = @_;
264 14 ▶ return undef unless defined $spec;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $spec 1 13 14
265 my $mat =
266 ref $spec ? $spec
267 13 ▶ : exists $MATERIAL{$spec} ? $class->material($spec)
Branch: 2 branches
BranchTrueFalseTotal
ref $spec ? : 0 13 13
exists $MATERIAL{$spec} ? : 13 0 13
268 : Physics::Etch::Material->new( name => $spec );
269 13 ▶ $mat->thickness($thickness) if defined $thickness;
Branch: 1 branch
BranchTrueFalseTotal
if defined $thickness 0 13 13
270 13 return $mat;
271 }
272  
273 # ===========================================================================
274 # Convenience constructors for the pattern / chamber / loading / simulation
275 # tools (so a single `use Physics::Etch` exposes the whole toolkit).
276 # ===========================================================================
277 0 ▶sub chamber { shift; Physics::Etch::Chamber->new(@_) }
Subroutine chamber: not called CC=1 SCAR=6.9
Pod documented
278 0 ▶sub loading { shift; Physics::Etch::Loading->new(@_) }
Subroutine loading: not called CC=1 SCAR=6.9
Pod documented
279 0 ▶sub layout { shift; Physics::Etch::Layout->new(@_) }
Subroutine layout: not called CC=1 SCAR=6.9
Pod documented
280 0 ▶sub read_gdsii { shift; Physics::Etch::GDSII->read(@_) }
Subroutine read_gdsii: not called CC=1 SCAR=6.9
Pod documented
281 0 ▶sub new_gdsii { shift; Physics::Etch::GDSII->new(@_) }
Subroutine new_gdsii: not called CC=1 SCAR=6.9
Pod documented
282  
283 0 ▶sub layout_from_gds {
Subroutine layout_from_gds: not called CC=1 SCAR=6.9
Pod documented
284 0 my ( $class, $file, %a ) = @_;
285 0 return Physics::Etch::Layout->from_gdsii_file( $file, %a );
286 }
287  
288 0 ▶sub simulate {
Subroutine simulate: not called CC=1 SCAR=6.9
Pod documented
289 0 my ( $class, %a ) = @_;
290 0 return Physics::Etch::Simulation->new(%a);
291 }
292  
293 3 1;
294  
295 __END__
« Etch/DryEtch.pm ↑ Summary Etch/Loading.pm »