blob: 2db971534f9567399bfb9b511fa370c2825bc04b [file] [log] [blame]
Tim Edwards55f4d0e2020-07-05 15:41:02 -04001###
2### Source file sky130_setup.tcl
3### Process this file with the preproc.py processor
4###
5#---------------------------------------------------------------
6# Setup file for netgen LVS
7# SkyWater TECHNAME
8#---------------------------------------------------------------
9permute default
10property default
11property parallel none
12
Tim Edwards828a78d2021-01-11 09:42:49 -050013# Allow override of default #columns in the output format.
14catch {format $env(NETGEN_COLUMNS)}
15
Tim Edwards55f4d0e2020-07-05 15:41:02 -040016#---------------------------------------------------------------
17# For the following, get the cell lists from
18# circuit1 and circuit2.
19#---------------------------------------------------------------
20
21set cells1 [cells list -all -circuit1]
22set cells2 [cells list -all -circuit2]
23
Tim Edwards55f4d0e2020-07-05 15:41:02 -040024#-------------------------------------------
25# Resistors (except metal)
26#-------------------------------------------
27
Tim Edwardsd7289eb2020-09-10 21:48:31 -040028set devices {}
29lappend devices sky130_fd_pr__res_iso_pw
Tim Edwardsd7289eb2020-09-10 21:48:31 -040030lappend devices sky130_fd_pr__res_high_po_0p35
31lappend devices sky130_fd_pr__res_high_po_0p69
32lappend devices sky130_fd_pr__res_high_po_1p41
33lappend devices sky130_fd_pr__res_high_po_2p85
34lappend devices sky130_fd_pr__res_high_po_5p73
35lappend devices sky130_fd_pr__res_high_po
36lappend devices sky130_fd_pr__res_xhigh_po_0p35
37lappend devices sky130_fd_pr__res_xhigh_po_0p69
38lappend devices sky130_fd_pr__res_xhigh_po_1p41
39lappend devices sky130_fd_pr__res_xhigh_po_2p85
40lappend devices sky130_fd_pr__res_xhigh_po_5p73
41lappend devices sky130_fd_pr__res_xhigh_po
42lappend devices sky130_fd_pr__res_generic_nd
43lappend devices sky130_fd_pr__res_generic_pd
Tim Edwards6ead3cf2020-12-20 12:07:20 -050044lappend devices sky130_fd_pr__res_generic_nd__hv
45lappend devices sky130_fd_pr__res_generic_pd__hv
Tim Edwardsd7289eb2020-09-10 21:48:31 -040046lappend devices mrdn_hv mrdp_hv
Tim Edwards55f4d0e2020-07-05 15:41:02 -040047
48foreach dev $devices {
49 if {[lsearch $cells1 $dev] >= 0} {
50 permute "-circuit1 $dev" 1 2
51 property "-circuit1 $dev" series enable
52 property "-circuit1 $dev" series {w critical}
53 property "-circuit1 $dev" series {l add}
54 property "-circuit1 $dev" parallel enable
55 property "-circuit1 $dev" parallel {l critical}
56 property "-circuit1 $dev" parallel {w add}
57 property "-circuit1 $dev" parallel {value par}
58 property "-circuit1 $dev" tolerance {l 0.01} {w 0.01}
59 # Ignore these properties
Tim Edwards2d613602020-10-02 09:03:27 -040060 property "-circuit1 $dev" delete mult
Tim Edwards55f4d0e2020-07-05 15:41:02 -040061 }
62 if {[lsearch $cells2 $dev] >= 0} {
63 permute "-circuit2 $dev" 1 2
Tim Edwards2d613602020-10-02 09:03:27 -040064 property "-circuit2 $dev" series enable
65 property "-circuit2 $dev" series {w critical}
66 property "-circuit2 $dev" series {l add}
67 property "-circuit2 $dev" parallel enable
68 property "-circuit2 $dev" parallel {l critical}
69 property "-circuit2 $dev" parallel {w add}
70 property "-circuit2 $dev" parallel {value par}
71 property "-circuit2 $dev" tolerance {l 0.01} {w 0.01}
Tim Edwards55f4d0e2020-07-05 15:41:02 -040072 # Ignore these properties
Tim Edwards23c97662020-08-09 11:57:32 -040073 property "-circuit2 $dev" delete mult
Tim Edwards55f4d0e2020-07-05 15:41:02 -040074 }
75}
76
Tim Edwards13a8c5d2024-05-24 21:34:28 -040077#----------------------------------------------
78# poly resistor (changed from R type to X type)
79#----------------------------------------------
Tim Edwards55f4d0e2020-07-05 15:41:02 -040080
Tim Edwardsd7289eb2020-09-10 21:48:31 -040081set devices {}
Tim Edwardsc686c102021-02-19 12:16:05 -050082lappend devices sky130_fd_pr__res_generic_po
Tim Edwards55f4d0e2020-07-05 15:41:02 -040083
84foreach dev $devices {
85 if {[lsearch $cells1 $dev] >= 0} {
Tim Edwards13a8c5d2024-05-24 21:34:28 -040086 permute "-circuit1 $dev" 1 2
Tim Edwards55f4d0e2020-07-05 15:41:02 -040087 property "-circuit1 $dev" series enable
88 property "-circuit1 $dev" series {w critical}
89 property "-circuit1 $dev" series {l add}
90 property "-circuit1 $dev" parallel enable
91 property "-circuit1 $dev" parallel {l critical}
92 property "-circuit1 $dev" parallel {w add}
93 property "-circuit1 $dev" parallel {value par}
94 property "-circuit1 $dev" tolerance {l 0.01} {w 0.01}
95 # Ignore these properties
Tim Edwards2d613602020-10-02 09:03:27 -040096 property "-circuit1 $dev" delete mult
Tim Edwards55f4d0e2020-07-05 15:41:02 -040097 }
98 if {[lsearch $cells2 $dev] >= 0} {
Tim Edwards13a8c5d2024-05-24 21:34:28 -040099 permute "-circuit2 $dev" 1 2
Tim Edwards2d613602020-10-02 09:03:27 -0400100 property "-circuit2 $dev" series enable
101 property "-circuit2 $dev" series {w critical}
102 property "-circuit2 $dev" series {l add}
103 property "-circuit2 $dev" parallel enable
104 property "-circuit2 $dev" parallel {l critical}
105 property "-circuit2 $dev" parallel {w add}
106 property "-circuit2 $dev" parallel {value par}
107 property "-circuit2 $dev" tolerance {l 0.01} {w 0.01}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400108 # Ignore these properties
Tim Edwards23c97662020-08-09 11:57:32 -0400109 property "-circuit2 $dev" delete mult
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400110 }
111}
112
113#-------------------------------------------
Tim Edwards11af1922022-10-27 14:58:52 -0400114# MRM (metal) resistors
115#-------------------------------------------
116
117set devices {}
118lappend devices sky130_fd_pr__res_generic_l1
119lappend devices sky130_fd_pr__res_generic_m1
120lappend devices sky130_fd_pr__res_generic_m2
121lappend devices sky130_fd_pr__res_generic_m3
122#ifdef METAL5
123lappend devices sky130_fd_pr__res_generic_m4
124lappend devices sky130_fd_pr__res_generic_m5
125#endif (METAL5)
126
127foreach dev $devices {
128 if {[lsearch $cells1 $dev] >= 0} {
129 permute "-circuit1 $dev" end_a end_b
130 property "-circuit1 $dev" series enable
131 property "-circuit1 $dev" series {w critical}
132 property "-circuit1 $dev" series {l add}
133 property "-circuit1 $dev" parallel enable
134 property "-circuit1 $dev" parallel {l critical}
135 property "-circuit1 $dev" parallel {w add}
136 property "-circuit1 $dev" parallel {value par}
137 property "-circuit1 $dev" tolerance {l 10.0} {w 10.0}
138 # Ignore these properties
139 property "-circuit1 $dev" delete mult
140 }
141 if {[lsearch $cells2 $dev] >= 0} {
142 permute "-circuit2 $dev" end_a end_b
143 property "-circuit2 $dev" series enable
144 property "-circuit2 $dev" series {w critical}
145 property "-circuit2 $dev" series {l add}
146 property "-circuit2 $dev" parallel enable
147 property "-circuit2 $dev" parallel {l critical}
148 property "-circuit2 $dev" parallel {w add}
149 property "-circuit2 $dev" parallel {value par}
150 property "-circuit2 $dev" tolerance {l 10.0} {w 10.0}
151 # Ignore these properties
152 property "-circuit2 $dev" delete mult
153 }
154}
155
156#-------------------------------------------
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400157# (MOS) transistors
158#-------------------------------------------
159
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400160set devices {}
161lappend devices sky130_fd_pr__nfet_01v8
162lappend devices sky130_fd_pr__nfet_01v8_lvt
163lappend devices sky130_fd_bs_flash__special_sonosfet_star
Tim Edwardsd53c8002020-11-22 15:07:06 -0500164lappend devices sky130_fd_pr__nfet_g5v0d10v5
Tim Edwards5ed94ff2022-06-16 15:07:53 -0400165lappend devices sky130_fd_pr__nfet_03v3_nvt
Tim Edwards5dca4782020-12-21 22:51:04 -0500166lappend devices sky130_fd_pr__nfet_05v0_nvt
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400167lappend devices sky130_fd_pr__pfet_01v8
168lappend devices sky130_fd_pr__pfet_01v8_lvt
169lappend devices sky130_fd_pr__pfet_01v8_mvt
170lappend devices sky130_fd_pr__pfet_01v8_hvt
Tim Edwardsd53c8002020-11-22 15:07:06 -0500171lappend devices sky130_fd_pr__pfet_g5v0d10v5
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400172lappend devices sky130_fd_pr__special_nfet_latch
Tim Edwardse53f6412023-07-19 17:18:56 -0400173lappend devices sky130_fd_pr__special_nfet_pass
174lappend devices sky130_fd_pr__special_pfet_latch
Tim Edwards9a211592024-04-02 13:23:22 -0400175# special_pfet_pass retained for backwards compatibility.
176lappend devices sky130_fd_pr__special_pfet_pass
Tim Edwards5cb6c432024-02-11 13:10:06 -0500177lappend devices sky130_fd_pr__special_nfet_01v8
178lappend devices sky130_fd_pr__special_pfet_01v8_hvt
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400179lappend devices sky130_fd_pr__cap_var_lvt
180lappend devices sky130_fd_pr__cap_var_hvt
181lappend devices sky130_fd_pr__cap_var
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400182
183foreach dev $devices {
184 if {[lsearch $cells1 $dev] >= 0} {
185 permute "-circuit1 $dev" 1 3
186 property "-circuit1 $dev" parallel enable
187 property "-circuit1 $dev" parallel {l critical}
188 property "-circuit1 $dev" parallel {w add}
189 property "-circuit1 $dev" tolerance {w 0.01} {l 0.01}
190 # Ignore these properties
Tim Edwardsb6909b82021-12-30 11:07:48 -0500191 property "-circuit1 $dev" delete as ad ps pd mult sa sb sd nf nrd nrs area perim topography
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400192 }
193 if {[lsearch $cells2 $dev] >= 0} {
194 permute "-circuit2 $dev" 1 3
Tim Edwards2d613602020-10-02 09:03:27 -0400195 property "-circuit2 $dev" parallel enable
196 property "-circuit2 $dev" parallel {l critical}
197 property "-circuit2 $dev" parallel {w add}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400198 property "-circuit2 $dev" tolerance {w 0.01} {l 0.01}
199 # Ignore these properties
Tim Edwardsb6909b82021-12-30 11:07:48 -0500200 property "-circuit2 $dev" delete as ad ps pd mult sa sb sd nf nrd nrs area perim topography
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400201 }
202}
203
Tim Edwardse4b45352022-01-01 11:53:31 -0500204#---------------------------------------------------------------------
Tim Edwards335882b2022-07-28 19:54:43 -0400205# Extended drain MOSFET devices. These have asymmetric source and
206# drain, and so the source and drain are not permutable.
207#---------------------------------------------------------------------
208
209set devices {}
210lappend devices sky130_fd_pr__nfet_20v0_zvt
211lappend devices sky130_fd_pr__nfet_20v0_nvt
212lappend devices sky130_fd_pr__nfet_20v0_iso
213lappend devices sky130_fd_pr__nfet_20v0
214lappend devices sky130_fd_pr__pfet_20v0
215lappend devices sky130_fd_pr__nfet_g5v0d16v0
216lappend devices sky130_fd_pr__pfet_g5v0d16v0
217
218foreach dev $devices {
219 if {[lsearch $cells1 $dev] >= 0} {
220 property "-circuit1 $dev" parallel enable
221 property "-circuit1 $dev" parallel {l critical}
222 property "-circuit1 $dev" parallel {w add}
Tim Edwardsfb6f3742022-07-29 09:55:29 -0400223 property "-circuit1 $dev" tolerance {w 0.01} {l 0.01}
Tim Edwards335882b2022-07-28 19:54:43 -0400224 # Ignore these properties
225 property "-circuit1 $dev" delete as ad ps pd mult sa sb sd nf nrd nrs area perim topography
226 }
227 if {[lsearch $cells2 $dev] >= 0} {
228 property "-circuit2 $dev" parallel enable
229 property "-circuit2 $dev" parallel {l critical}
230 property "-circuit2 $dev" parallel {w add}
Tim Edwardsfb6f3742022-07-29 09:55:29 -0400231 property "-circuit2 $dev" tolerance {w 0.01} {l 0.01}
Tim Edwards335882b2022-07-28 19:54:43 -0400232 # Ignore these properties
233 property "-circuit2 $dev" delete as ad ps pd mult sa sb sd nf nrd nrs area perim topography
234 }
235}
236
237#---------------------------------------------------------------------
Tim Edwardse4b45352022-01-01 11:53:31 -0500238# (MOS) ESD transistors. Note that the ESD transistors have a flanged
239# gate. Magic disagrees slightly on how to interpret the width of the
240# devices, so the tolerance is increased to 7% to cover the difference
241#---------------------------------------------------------------------
242
Tim Edwards088cb732022-07-25 10:07:27 -0400243set devices {}
Tim Edwardse4b45352022-01-01 11:53:31 -0500244lappend devices sky130_fd_pr__esd_nfet_g5v0d10v5
245lappend devices sky130_fd_pr__esd_pfet_g5v0d10v5
246
247foreach dev $devices {
248 if {[lsearch $cells1 $dev] >= 0} {
249 permute "-circuit1 $dev" 1 3
250 property "-circuit1 $dev" parallel enable
251 property "-circuit1 $dev" parallel {l critical}
252 property "-circuit1 $dev" parallel {w add}
253 property "-circuit1 $dev" tolerance {w 0.07} {l 0.01}
254 # Ignore these properties
255 property "-circuit1 $dev" delete as ad ps pd mult sa sb sd nf nrd nrs area perim topography
256 }
257 if {[lsearch $cells2 $dev] >= 0} {
258 permute "-circuit2 $dev" 1 3
259 property "-circuit2 $dev" parallel enable
260 property "-circuit2 $dev" parallel {l critical}
261 property "-circuit2 $dev" parallel {w add}
262 property "-circuit2 $dev" tolerance {w 0.07} {l 0.01}
263 # Ignore these properties
264 property "-circuit2 $dev" delete as ad ps pd mult sa sb sd nf nrd nrs area perim topography
265 }
266}
267
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400268#-------------------------------------------
269# diodes
270#-------------------------------------------
271
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400272set devices {}
273lappend devices sky130_fd_pr__diode_pw2nd_05v5
274lappend devices sky130_fd_pr__diode_pw2nd_05v5_lvt
275lappend devices sky130_fd_pr__diode_pw2nd_05v5_nvt
276lappend devices sky130_fd_pr__diode_pd2nw_05v5
277lappend devices sky130_fd_pr__diode_pd2nw_05v5_lvt
278lappend devices sky130_fd_pr__diode_pd2nw_05v5_hvt
279lappend devices sky130_fd_pr__diode_pw2nd_11v0
280lappend devices sky130_fd_pr__diode_pd2nw_11v0
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400281
282foreach dev $devices {
283 if {[lsearch $cells1 $dev] >= 0} {
284 property "-circuit1 $dev" parallel enable
285 property "-circuit1 $dev" parallel {area add}
Tim Edwards3cd60822024-05-07 09:06:15 -0400286 property "-circuit1 $dev" parallel {perim add}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400287 property "-circuit1 $dev" parallel {value add}
Tim Edwards3cd60822024-05-07 09:06:15 -0400288 property "-circuit1 $dev" tolerance {area 0.02} {perim 0.02}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400289 # Ignore these properties
Tim Edwards2d613602020-10-02 09:03:27 -0400290 property "-circuit1 $dev" delete mult perim
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400291 }
292 if {[lsearch $cells2 $dev] >= 0} {
293 property "-circuit2 $dev" parallel enable
Tim Edwards2d613602020-10-02 09:03:27 -0400294 property "-circuit2 $dev" parallel {area add}
Tim Edwards3cd60822024-05-07 09:06:15 -0400295 property "-circuit2 $dev" parallel {perim add}
Tim Edwards2d613602020-10-02 09:03:27 -0400296 property "-circuit2 $dev" parallel {value add}
Tim Edwards3cd60822024-05-07 09:06:15 -0400297 property "-circuit2 $dev" tolerance {area 0.02} {perim 0.02}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400298 # Ignore these properties
Tim Edwards23c97662020-08-09 11:57:32 -0400299 property "-circuit2 $dev" delete mult perim
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400300 }
301}
302
303#-------------------------------------------
304# capacitors
305# MiM capacitors
306#-------------------------------------------
307
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400308set devices {}
309lappend devices sky130_fd_pr__cap_mim_m3_1
310lappend devices sky130_fd_pr__cap_mim_m3_2
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400311
312foreach dev $devices {
313 if {[lsearch $cells1 $dev] >= 0} {
314 property "-circuit1 $dev" parallel enable
315 property "-circuit1 $dev" parallel {area add}
316 property "-circuit1 $dev" parallel {value add}
317 property "-circuit1 $dev" tolerance {l 0.01} {w 0.01}
318 # Ignore these properties
Tim Edwards2d613602020-10-02 09:03:27 -0400319 property "-circuit1 $dev" delete mult perim mf
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400320 }
321 if {[lsearch $cells2 $dev] >= 0} {
Tim Edwards2d613602020-10-02 09:03:27 -0400322 property "-circuit2 $dev" parallel enable
323 property "-circuit2 $dev" parallel {area add}
324 property "-circuit2 $dev" parallel {value add}
325 property "-circuit2 $dev" tolerance {l 0.01} {w 0.01}
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400326 # Ignore these properties
Tim Edwards2d613602020-10-02 09:03:27 -0400327 property "-circuit2 $dev" delete mult perim mf
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400328 }
329}
330
331#-------------------------------------------
332# Fixed-layout devices
333# bipolar transistors,
334# VPP capacitors
335#-------------------------------------------
336
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400337set devices {}
338lappend devices sky130_fd_pr__npn_05v5_W1p00L1p00
339lappend devices sky130_fd_pr__npn_05v5_W1p00L2p00
Tim Edwards6547ee32020-11-25 17:17:01 -0500340lappend devices sky130_fd_pr__pnp_05v5_W0p68L0p68
341lappend devices sky130_fd_pr__pnp_05v5_W3p40L3p40
Tim Edwards3af13372022-11-08 15:59:23 -0500342lappend devices sky130_fd_pr__rf_npn_05v5_W1p00L1p00
343lappend devices sky130_fd_pr__rf_npn_05v5_W1p00L2p00
344lappend devices sky130_fd_pr__rf_pnp_05v5_W0p68L0p68
345lappend devices sky130_fd_pr__rf_pnp_05v5_W3p40L3p40
Tim Edwards6ead3cf2020-12-20 12:07:20 -0500346lappend devices sky130_fd_pr__npn_05v5
347lappend devices sky130_fd_pr__pnp_05v5
348lappend devices sky130_fd_pr__npn_11v0
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400349
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400350#ifdef METAL5
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400351lappend devices sky130_fd_pr__cap_vpp_11p5x11p7_lim5_shield
352lappend devices sky130_fd_pr__cap_vpp_11p5x11p7_m3_lim5_shield
353lappend devices sky130_fd_pr__cap_vpp_11p5x11p7_m4_shield
354lappend devices sky130_fd_pr__cap_vpp_11p5x11p7_pom4_shield
355lappend devices sky130_fd_pr__cap_vpp_4p4x4p6_m3_lim5_shield
356lappend devices sky130_fd_pr__cap_vpp_6p8x6p1_lim4_shield
357lappend devices sky130_fd_pr__cap_vpp_6p8x6p1_polym4_shield
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400358#endif (METAL5)
Tim Edwardsd7289eb2020-09-10 21:48:31 -0400359lappend devices sky130_fd_pr__cap_vpp_8p6x7p9_m3_lim5_shield
360lappend devices sky130_fd_pr__cap_vpp_11p5x11p7_m3_li_shield
361lappend devices sky130_fd_pr__cap_vpp_11p5x11p7_m3_shield
362lappend devices sky130_fd_pr__cap_vpp_1p8x1p8_li_shield
363lappend devices sky130_fd_pr__cap_vpp_1p8x1p8_m3_shield
364lappend devices sky130_fd_pr__cap_vpp_4p4x4p6_m3_li_shield
365lappend devices sky130_fd_pr__cap_vpp_4p4x4p6_m3_shield
366lappend devices sky130_fd_pr__cap_vpp_8p6x7p9_m3_li_shield
367lappend devices sky130_fd_pr__cap_vpp_8p6x7p9_m3_shield
368#ifdef REDISTRIBUTION
369lappend devices sky130_fd_pr__ind_04_01
370lappend devices sky130_fd_pr__ind_04_02
371#endif (REDISTRIBUTION)
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400372
373foreach dev $devices {
374 if {[lsearch $cells1 $dev] >= 0} {
375 property "-circuit1 $dev" parallel enable
376 # Ignore these properties
Tim Edwards2d613602020-10-02 09:03:27 -0400377 property "-circuit1 $dev" delete mult
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400378 }
379 if {[lsearch $cells2 $dev] >= 0} {
380 property "-circuit2 $dev" parallel enable
381 # Ignore these properties
Tim Edwards23c97662020-08-09 11:57:32 -0400382 property "-circuit2 $dev" delete mult
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400383 }
384}
385
Tim Edwards326f6402023-10-25 15:19:47 -0400386#ifdef RERAM
387#---------------------------------------------------------------
388# ReRAM
389#---------------------------------------------------------------
390
391set devices {sky130_fd_pr_reram__reram_cell}
392
393foreach dev $devices {
394 if {[lsearch $cells1 $dev] >= 0} {
395 property "-circuit1 $dev" delete Tfilament_0
396 }
397 if {[lsearch $cells2 $dev] >= 0} {
398 property "-circuit2 $dev" delete Tfilament_0
399 }
400}
401#endif (RERAM)
402
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400403#---------------------------------------------------------------
Tim Edwards5dca4782020-12-21 22:51:04 -0500404# Schematic cells which are not extractable
405#---------------------------------------------------------------
406
Tim Edwards25482942020-12-24 11:01:14 -0500407set devices {sky130_fd_io__condiode sky130_fd_io__tap_1}
Tim Edwards5dca4782020-12-21 22:51:04 -0500408
409foreach dev $devices {
410 if {[lsearch $cells1 $dev] >= 0} {
411 ignore class "-circuit1 $dev"
412 }
413 if {[lsearch $cells2 $dev] >= 0} {
414 ignore class "-circuit2 $dev"
415 }
416}
417
418#---------------------------------------------------------------
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400419# Digital cells (ignore decap, fill, and tap cells)
420# Make a separate list for each supported library
421#---------------------------------------------------------------
Tim Edwards320242b2020-10-21 10:11:37 -0400422# e.g., ignore class "-circuit2 sky130_fc_sc_hd__decap_3"
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400423#---------------------------------------------------------------
424
Mitch Bailey44b715a2020-12-19 21:48:18 +0900425if { [info exist ::env(MAGIC_EXT_USE_GDS)] && $::env(MAGIC_EXT_USE_GDS) } {
426 foreach cell $cells1 {
427# if {[regexp {sky130_fd_sc_[^_]+__decap_[[:digit:]]+} $cell match]} {
428# ignore class "-circuit1 $cell"
429# }
430 if {[regexp {sky130_fd_sc_[^_]+__fill_[[:digit:]]+} $cell match]} {
431 ignore class "-circuit1 $cell"
432 }
433 if {[regexp {sky130_fd_sc_[^_]+__tapvpwrvgnd_[[:digit:]]+} $cell match]} {
434 ignore class "-circuit1 $cell"
435 }
Tim Edwardsa6180a92021-06-14 12:07:33 -0400436 if {[regexp {sky130_ef_sc_[^_]+__fakediode_[[:digit:]]+} $cell match]} {
437 ignore class "-circuit1 $cell"
438 }
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400439 }
Mitch Bailey44b715a2020-12-19 21:48:18 +0900440 foreach cell $cells2 {
441# if {[regexp {sky130_fd_sc_[^_]+__decap_[[:digit:]]+} $cell match]} {
442# ignore class "-circuit2 $cell"
443# }
444 if {[regexp {sky130_fd_sc_[^_]+__fill_[[:digit:]]+} $cell match]} {
445 ignore class "-circuit2 $cell"
446 }
447 if {[regexp {sky130_fd_sc_[^_]+__tapvpwrvgnd_[[:digit:]]+} $cell match]} {
448 ignore class "-circuit2 $cell"
449 }
Tim Edwardsa6180a92021-06-14 12:07:33 -0400450 if {[regexp {sky130_ef_sc_[^_]+__fakediode_[[:digit:]]+} $cell match]} {
451 ignore class "-circuit2 $cell"
452 }
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400453 }
454}
455
456#---------------------------------------------------------------
Tim Edwards2e6d6292021-03-01 16:03:39 -0500457# Allow the fill, decap, etc., cells to be parallelized
458#---------------------------------------------------------------
459
460foreach cell $cells1 {
Anton Blanchard52c2f5d2022-03-22 04:59:11 +1100461 if {[regexp {sky130_ef_sc_[^_]+__decap_[[:digit:]]+} $cell match]} {
462 property "-circuit1 $cell" parallel enable
463 }
Tim Edwards2e6d6292021-03-01 16:03:39 -0500464 if {[regexp {sky130_fd_sc_[^_]+__decap_[[:digit:]]+} $cell match]} {
465 property "-circuit1 $cell" parallel enable
466 }
467 if {[regexp {sky130_fd_sc_[^_]+__fill_[[:digit:]]+} $cell match]} {
468 property "-circuit1 $cell" parallel enable
469 }
470 if {[regexp {sky130_fd_sc_[^_]+__tapvpwrvgnd_[[:digit:]]+} $cell match]} {
471 property "-circuit1 $cell" parallel enable
472 }
473 if {[regexp {sky130_fd_sc_[^_]+__diode_[[:digit:]]+} $cell match]} {
474 property "-circuit1 $cell" parallel enable
475 }
476 if {[regexp {sky130_fd_sc_[^_]+__fill_diode_[[:digit:]]+} $cell match]} {
477 property "-circuit1 $cell" parallel enable
478 }
Ahmed Ghazycfd58442021-03-02 11:05:11 +0200479 if {[regexp {sky130_ef_sc_[^_]+__fakediode_[[:digit:]]+} $cell match]} {
480 property "-circuit1 $cell" parallel enable
481 }
Tim Edwards2e6d6292021-03-01 16:03:39 -0500482}
483foreach cell $cells2 {
Anton Blanchard52c2f5d2022-03-22 04:59:11 +1100484 if {[regexp {sky130_ef_sc_[^_]+__decap_[[:digit:]]+} $cell match]} {
485 property "-circuit2 $cell" parallel enable
486 }
Tim Edwards2e6d6292021-03-01 16:03:39 -0500487 if {[regexp {sky130_fd_sc_[^_]+__decap_[[:digit:]]+} $cell match]} {
488 property "-circuit2 $cell" parallel enable
489 }
490 if {[regexp {sky130_fd_sc_[^_]+__fill_[[:digit:]]+} $cell match]} {
491 property "-circuit2 $cell" parallel enable
492 }
493 if {[regexp {sky130_fd_sc_[^_]+__tapvpwrvgnd_[[:digit:]]+} $cell match]} {
494 property "-circuit2 $cell" parallel enable
495 }
496 if {[regexp {sky130_fd_sc_[^_]+__diode_[[:digit:]]+} $cell match]} {
497 property "-circuit2 $cell" parallel enable
498 }
499 if {[regexp {sky130_fd_sc_[^_]+__fill_diode_[[:digit:]]+} $cell match]} {
500 property "-circuit2 $cell" parallel enable
501 }
Ahmed Ghazycfd58442021-03-02 11:05:11 +0200502 if {[regexp {sky130_ef_sc_[^_]+__fakediode_[[:digit:]]+} $cell match]} {
503 property "-circuit2 $cell" parallel enable
504 }
Tim Edwards2e6d6292021-03-01 16:03:39 -0500505}
506
507#---------------------------------------------------------------
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400508# Handle cells captured from Electric
509#
510# Find cells of the form "<library>__<cellname>" in the netlist
511# from Electric where the extracted layout netlist has only
512# "<cellname>". Cross-check by ensuring that the full name
513# "<library>__<cellname>" does not exist in both cells, and that
514# the truncated name "<cellname>" does not exist in both cells.
515#---------------------------------------------------------------
516# e.g., hydra_spi_controller__hydra_spi_controller
517#---------------------------------------------------------------
Ahmed Ghazy32982b72020-07-27 14:46:07 +0200518
Tim Edwards55f4d0e2020-07-05 15:41:02 -0400519foreach cell $cells1 {
520 if {[regexp "(.+)__(.+)" $cell match library cellname]} {
521 if {([lsearch $cells2 $cell] < 0) && \
522 ([lsearch $cells2 $cellname] >= 0) && \
523 ([lsearch $cells1 $cellname] < 0)} {
524 equate classes "-circuit1 $cell" "-circuit2 $cellname"
525 puts stdout "Matching pins of $cell in circuit 1 and $cellname in circuit 2"
526 equate pins "-circuit1 $cell" "-circuit2 $cellname"
527 }
528 }
529}
530
531foreach cell $cells2 {
532 if {[regexp "(.+)__(.+)" $cell match library cellname]} {
533 if {([lsearch $cells1 $cell] < 0) && \
534 ([lsearch $cells1 $cellname] >= 0) && \
535 ([lsearch $cells2 $cellname] < 0)} {
536 equate classes "-circuit1 $cellname" "-circuit2 $cell"
537 puts stdout "Matching pins of $cellname in circuit 1 and $cell in circuit 2"
538 equate pins "-circuit1 $cellname" "-circuit2 $cell"
539 }
540 }
541}
542
543# Match pins on black-box cells if LVS is called with "-blackbox"
544if {[model blackbox]} {
545 foreach cell $cells1 {
546 if {[model "-circuit1 $cell"] == "blackbox"} {
547 if {[lsearch $cells2 $cell] >= 0} {
548 puts stdout "Matching pins of $cell in circuits 1 and 2"
549 equate pins "-circuit1 $cell" "-circuit2 $cell"
550 }
551 }
552 }
553}
554
555#---------------------------------------------------------------