-
Notifications
You must be signed in to change notification settings - Fork 24
/
sky130A_mr.drc
1629 lines (1506 loc) · 51.9 KB
/
sky130A_mr.drc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# DRC for SKY130 according to :
# https://skywater-pdk.readthedocs.io/en/latest/rules/periphery.html
# https://skywater-pdk.readthedocs.io/en/latest/rules/layers.html
#
# Distributed under GNU GPLv3: https://www.gnu.org/licenses/
#
# History :
# 2022-6-22 : 2022.6.30_01.07 release
#
# 2023-6-14 : 2023.6.14_01.08 release
#
# 2024-2-11 : 2024.2.11_01.09 release
#
# 2024-5-26 : Update rectMCON_peri to use outside instead of not
# 2024-8-15 :
# * Avoid assigning to constant variables
# * Fix defaults for arguments when they are not passed in the CLI
#
# 2024-8-18 :
# * Add new rules:
# * `MR_lvtn.OVL.2`
# * `MR_tunm.CON.1`
# * `rdl.1`
# * `rdl.2`
# * `MR_thkox.CON.1`
# * `MR_rdl.CON.1`
# * `MR_li.WID.4`
# * `moduleCut.1`
# * Modify `licon` checks to account for ("non-bar" | exempt prec_resistor)
# * Rename `licon` checks
# 2024-9-1 :
# * Change the default of sram_exclude to false
##########################################################################################
release = "2024.2.11_01.09"
require "time"
require "logger"
exec_start_time = Time.now
logger = Logger.new(STDOUT)
logger.formatter =
proc do |severity, datetime, progname, msg|
"#{msg}
"
end
# optionnal for a batch launch : klayout -b -rd input=my_layout.gds -rd report=sky130_drc.txt -r drc_sky130.drc
source($input, $top_cell) if $input
if $report
report("SKY130 DRC runset", $report)
else
report(
"SKY130 DRC runset",
File.join(File.dirname(RBA::CellView.active.filename), "sky130_drc.txt")
)
end
if not defined? $feol
$feol = "false"
end
if not defined? $beol
$beol = "false"
end
if not defined? $offgrid
$offgrid = "false"
end
if not defined? $floating_met
$floating_met = "false"
end
if not defined? $sram_exclude
$sram_exclude = "false"
end
AL = true # do not change
CU = false # do not change
# choose betwen only one of AL or CU back-end flow here :
backend_flow = AL
# enable / disable rule groups
if $feol == "0" || $feol == "false"
FEOL = false
else
FEOL = true # front-end-of-line checks
end
if $beol == "0" || $beol == "false"
BEOL = false
else
BEOL = true # back-end-of-line checks
end
if $offgrid == "0" || $offgrid == "false"
OFFGRID = false
else
OFFGRID = true # manufacturing grid/angle checks
end
if $seal == "0" || $seal == "false"
SEAL = false
else
SEAL = true # SEAL RING checks
end
if $floating_met == "0" || $floating_met == "false"
FLOATING_MET = false
else
FLOATING_MET = true # back-end-of-line checks
end
if $sram_exclude == "0" || $sram_exclude == "false"
SRAM_EXCLUDE = false # back-end-of-line checks
else
SRAM_EXCLUDE = true
end
logger.info("Args:")
logger.info("\tsram_exclude: #{$sram_exclude}")
logger.info("\tfeol: #{$feol}")
logger.info("\tbeol: #{$beol}")
logger.info("\tfloating_met: #{$floating_met}")
logger.info("\toffgrid: #{$offgrid}")
logger.info("\tseal: #{$seal}")
# klayout setup
########################
# use a tile size of 1mm - not used in deep mode-
# tiles(1000.um)
# use a tile border of 10 micron:
# tile_borders(1.um)
#no_borders
# hierachical
deep
$thr ? threads($thr) : threads(4)
# if more inof is needed, set true
# verbose(true)
verbose(true)
# layers definitions
########################
# all except purpose (datatype) 5 -- label and 44 -- via
li_wildcard = "67/20"
li_res_wildcard = "67/13"
mcon_wildcard = "67/44"
m1_wildcard = "68/20"
via_wildcard = "68/44"
m2_wildcard = "69/20"
via2_wildcard = "69/44"
m3_wildcard = "70/20"
via3_wildcard = "70/44"
m4_wildcard = "71/20"
via4_wildcard = "71/44"
m5_wildcard = "72/20"
nsdm_wildcard = "93/44"
psdm_wildcard = "94/20"
nwell_wildcard = "64/20"
diff = input(65, 20)
tap = polygons(65, 44)
nwell = polygons(nwell_wildcard)
dnwell = polygons(64, 18)
pwbm = polygons(19, 44)
pwde = polygons(124, 20)
natfet = polygons(124, 21)
hvtr = polygons(18, 20)
hvtp = polygons(78, 44)
ldntm = polygons(11, 44)
hvi = polygons(75, 20)
tunm = polygons(80, 20)
lvtn = polygons(125, 44)
poly = polygons(66, 20)
hvntm = polygons(125, 20)
nsdm = polygons(nsdm_wildcard)
psdm = polygons(psdm_wildcard)
rpm = polygons(86, 20)
urpm = polygons(79, 20)
npc = polygons(95, 20)
licon = polygons(66, 44)
li = polygons(li_wildcard)
li_res = polygons(li_res_wildcard)
mcon = polygons(mcon_wildcard)
m1 = polygons(m1_wildcard)
via = polygons(via_wildcard)
m2 = polygons(m2_wildcard)
via2 = polygons(via2_wildcard)
m3 = polygons(m3_wildcard)
via3 = polygons(via3_wildcard)
m4 = polygons(m4_wildcard)
via4 = polygons(via4_wildcard)
m5 = polygons(m5_wildcard)
pad = polygons(76, 20)
nsm = polygons(61, 20)
capm = polygons(89, 44)
cap2m = polygons(97, 44)
rdl = polygons(74, 20)
vhvi = polygons(74, 21)
uhvi = polygons(74, 22)
npn = polygons(82, 20)
inductor = polygons(82, 24)
vpp = polygons(82, 64)
pnp = polygons(82, 44)
lvs_prune = polygons(84, 44)
ncm = polygons(92, 44)
padcenter = polygons(81, 20)
mf = polygons(76, 44)
areaid_sl = polygons(81, 1)
areaid_ce = polygons(81, 2)
areaid_fe = polygons(81, 3)
areaid_sc = polygons(81, 4)
areaid_sf = polygons(81, 6)
areaid_sw = polygons(81, 7)
areaid_sr = polygons(81, 8)
areaid_mt = polygons(81, 10)
areaid_dt = polygons(81, 11)
areaid_ft = polygons(81, 12)
areaid_ww = polygons(81, 13)
areaid_ld = polygons(81, 14)
areaid_ns = polygons(81, 15)
areaid_ij = polygons(81, 17)
areaid_zr = polygons(81, 18)
areaid_ed = polygons(81, 19)
areaid_de = polygons(81, 23)
areaid_rd = polygons(81, 24)
areaid_dn = polygons(81, 50)
areaid_cr = polygons(81, 51)
areaid_cd = polygons(81, 52)
areaid_st = polygons(81, 53)
areaid_op = polygons(81, 54)
areaid_en = polygons(81, 57)
areaid_en20 = polygons(81, 58)
areaid_le = polygons(81, 60)
areaid_hl = polygons(81, 63)
areaid_sd = polygons(81, 70)
areaid_po = polygons(81, 81)
areaid_it = polygons(81, 84)
areaid_et = polygons(81, 101)
areaid_lvt = polygons(81, 108)
areaid_re = polygons(81, 125)
areaid_ag = polygons(81, 79)
poly_rs = polygons(66, 13)
poly_fill = polygons(66, 99)
diff_rs = polygons(65, 13)
pwell_rs = polygons(64, 13)
li_rs = polygons(67, 13)
cfom = polygons(22, 20)
thkox = polygons(75, 21)
areaid_ce_merged = areaid_ce.merged
# Define a new custom function that selects polygons by their number of holes:
# It will return a new layer containing those polygons with min to max holes.
# max can be nil to omit the upper limit.
class DRC::DRCLayer
def with_holes(min, max)
new_data = RBA::Region.new
self.data.each do |p|
new_data.insert(p) if p.holes >= (min || 0) && (!max || p.holes <= max)
end
DRC::DRCLayer.new(@engine, new_data)
end
end
# DRC section
########################
log("DRC section")
if FEOL
log("FEOL section")
# dnwell
log("START: 64/18 (dnwell)")
dnwell.width(3.0, euclidian).output(
"dnwell.1",
"dnwell.1: min. dnwell width : 3.0um"
)
dnwell
.not(uhvi.or(vhvi))
.space(6.3, euclidian)
.output("dnwell.2", "dnwell.2 : min. dnwell spacing : 6.3um")
log("END: 64/18 (dnwell)")
not_sram = layout(source.cell_obj).select("-*sky130_sram_*kbyte_*")
not_sram_nsdm = not_sram.input(nsdm_wildcard)
not_sram_psdm = not_sram.input(psdm_wildcard)
not_sram_nwell = not_sram.input(nwell_wildcard)
# This is a hack, should be reverted
not_io =
layout(source.cell_obj).select(
"-*sky130_fd_io__gpiov2_amux",
"-*sky130_fd_io__simple_pad_and_busses"
)
not_io_nwell = not_io.input(nwell_wildcard)
# nwell
log("START: 64/20 (nwell)")
nwell.width(0.84, euclidian).output(
"nwell.1",
"nwell.1 : min. nwell width : 0.84um"
)
nwell.space(1.27, euclidian).output(
"nwell.2a",
"nwell.2a : min. nwell spacing (merged if less) : 1.27um"
)
nwell_interact = not_sram_nwell.and(not_io_nwell).merge
dnwell.enclosing(nwell_interact.holes, 1.03, euclidian).output(
"nwell.6",
"nwell.6 : min enclosure of nwellHole by dnwell : 1.03um"
)
hvmarker = hvi.or(rdl).or(uhvi).or(vhvi)
nwell
.interacting(nwell.and(hvmarker))
.not(hvmarker)
.output("nwell.9", "nwell.9 : HVnwell must be enclosed by hv marker")
log("END: 64/20 (nwell)")
# hvtp
log("START: 78/44 (hvtp)")
hvtp.width(0.38, euclidian).output(
"hvtp.1",
"hvtp.1 : min. hvtp width : 0.38um"
)
hvtp.space(0.38, euclidian).output(
"hvtp.2",
"hvtp.2 : min. hvtp spacing : 0.38um"
)
log("END: 78/44 (hvtp)")
# pwde
log("START: 124/20 (pwde)")
pwde.width(0.84, euclidian).output(
"pwde.1",
"pwde.1 : min. pwde width : 0.84um"
)
pwde
.and(uhvi.or(vhvi))
.space(1.27, euclidian)
.output("pwde.2", "pwde.2 : min. pwde inside v20 spacing : 1.27um")
log("END: 124/20 (pwde)")
# hvtr
log("START: 18/20 (htvr)")
hvtr.width(0.38, euclidian).output(
"hvtr.1",
"hvtr.1 : min. hvtr width : 0.38um"
)
hvtr.separation(hvtp, 0.38, euclidian).output(
"hvtr.2",
"hvtr.2 : min. hvtr spacing : 0.38um"
)
hvtr.and(hvtp).output("hvtr.2_a", "hvtr.2_a : hvtr must not overlap hvtp")
log("END: 18/20 (htvr)")
# lvtn
log("START: 25/44 (lvtn)")
lvtn.width(0.38, euclidian).output(
"lvtn.1a",
"lvtn.1a : min. lvtn width : 0.38um"
)
lvtn.space(0.38, euclidian).output(
"lvtn.2",
"lvtn.2 : min. lvtn spacing : 0.38um"
)
lvtn
.interacting(nwell)
.not_inside(nwell)
.edges
.and(nwell)
.output("MR_lvtn.OVL.2", "MR_lvtn.OVL.2 : lvtn must not straddle nwell")
log("END: 25/44 (lvtn)")
# ncm
log("START: 92/44 (ncm)")
ncm.width(0.38, euclidian).output("ncm.1", "ncm.1 : min. ncm width : 0.38um")
ncm.space(0.38, euclidian).output(
"ncm.2a",
"ncm.2a : min. ncm spacing : 0.38um"
)
log("END: 92/44 (ncm)")
# diff-tap
log("START: 65/20 (diff)")
difftap = diff.or(tap)
diff_width = diff.rectangles.width(0.15, euclidian).polygons
diff_cross_areaid_ce =
diff_width
.edges
.outside_part(areaid_ce)
.not(diff_width.outside(areaid_ce).edges)
diff_cross_areaid_ce.output(
"difftap.1",
"difftap.1 : min. diff width across areaid:ce : 0.15um"
)
diff
.outside(areaid_ce)
.width(0.15, euclidian)
.output(
"difftap.1_a",
"difftap.1_a : min. diff width in periphery : 0.15um"
)
diff
.inside(areaid_ce)
.width(0.14, euclidian)
.output(
"difftap.2",
"difftap.2 : min. diff width inside areadid:ce : 0.14um"
)
log("END: 65/20 (diff)")
log("START: 65/44 (tap)")
tap_width = tap.rectangles.width(0.15, euclidian).polygons
tap_cross_areaid_ce =
tap_width
.edges
.outside_part(areaid_ce)
.not(tap_width.outside(areaid_ce).edges)
tap_cross_areaid_ce.output(
"difftap.1_b",
"difftap.1_b : min. tap width across areaid:ce : 0.15um"
)
tap
.not(areaid_ce)
.width(0.15, euclidian)
.output("difftap.1_c", "difftap.1_c : min. tap width in periphery : 0.15um")
log("END: 65/44 (tap)")
difftap.space(0.27, euclidian).output(
"difftap.3",
"difftap.3 : min. difftap spacing : 0.27um"
)
# tunm
log("START: 80/20 (tunm)")
tunm.width(0.41, euclidian).output(
"tunm.1",
"tunm.1 : min. tunm width : 0.41um"
)
tunm.space(0.5, euclidian).output(
"tunm.2",
"tunm.2 : min. tunm spacing : 0.5um"
)
tunm.output(
"MR_tunm.CON.1",
"MR_tunm.CON.1 : use of layer tunm is prohibited"
)
log("END: 80/20 (tunm)")
# thkox
log("START: 80/20 (thkox)")
thkox_peri = thkox.not(areaid_ce)
thkox_peri.width(0.6, euclidian).output(
"thkox.1",
"thkox.1 : min. thkox width inside periphery : 0.6um"
)
thkox_peri.space(0.7, euclidian).output(
"thkox.2",
"thkox.2 : min. thkox spacing inside periphery : 0.7um"
)
thkox
.interacting(diff)
.not_inside(diff)
.edges
.and(diff)
.output("MR_thkox.CON.1", "MR_thkox.CON.1 : thkox must not straddle diff")
log("END: 80/20 (thkox)")
# poly
log("START: 66/20 (poly)")
poly.width(0.15, euclidian).output(
"poly.1a",
"poly.1a : min. poly width : 0.15um"
)
poly
.not(areaid_ce)
.space(0.21, euclidian)
.output("poly.2", "poly.2 : min. poly spacing : 0.21um")
core_poly_gap = poly.inside(areaid_ce).drc(width(projection) <= 0.15).polygons
poly
.interacting(core_poly_gap)
.isolated(0.16, projection)
.output("poly.3", "poly.3 : min. poly spacing inside areaid:core : 0.16um")
log("END: 66/20 (poly)")
# ldntm
log("START: 80/20 (ldntm)")
ldntm_core = ldntm.and(areaid_ce)
ldntm_core.width(0.7, euclidian).output(
"ldntm.1",
"ldntm.1 : min. ldntm width inside areaid:core : 0.7um"
)
ldntm_core.space(0.7, euclidian).output(
"ldntm.2",
"ldntm.2 : min. ldntm spacing inside areaid:core : 0.7um"
)
log("END: 80/20 (ldntm)")
# rpm
log("START: 86/20 (rpm)")
rpm.width(1.27, euclidian).output(
"rpm.1a",
"rpm.1a : min. rpm width : 1.27um"
)
rpm.space(0.84, euclidian).output(
"rpm.2",
"rpm.2 : min. rpm spacing : 0.84um"
)
log("END: 86/20 (rpm)")
# rdl
log("START: 74/20 (rdl)")
rdl.width(10.um, euclidian).output("rdl.1", "rdl.1 : min. rdl width : 10um")
rdl.space(10.um, euclidian).output("rdl.2", "rdl.2 : min. rdl spacing : 10um")
rdl.output("MR_rdl.CON.1", "MR_rdl.CON.1 : use of rdl layer is prohibited")
log("END: 74/20 (rdl)")
# urpm
log("START: 79/20 (urpm)")
urpm.width(1.27, euclidian).output(
"urpm.1a",
"urpm.1a : min. rpm width : 1.27um"
)
urpm.space(0.84, euclidian).output(
"urpm.2",
"urpm.2 : min. rpm spacing : 0.84um"
)
log("END: 79/20 (urpm)")
# npc
log("START: 95/20 (npc)")
npc.width(0.27, euclidian).output("npc.1", "npc.1 : min. npc width : 0.27um")
npc.space(0.27, euclidian).output(
"npc.2",
"npc.2 : min. npc spacing, should be manually merged if less than : 0.27um"
)
log("END: 95/20 (npc)")
# nsdm
log("START: 93/44 (nsdm)")
if SRAM_EXCLUDE
not_sram_nsdm
.not(areaid_ce)
.space(0.38, euclidian)
.output("nsdm.1", "nsdm.1 : min. nsdm spacing in periphery : 0.38um")
not_sram_nsdm
.outside(areaid_ce)
.width(0.38, euclidian)
.output("nsdm.2", "nsdm.2 : min. nsdm width in periphery : 0.38um")
not_sram_nsdm_width =
not_sram_nsdm
.width(0.38, euclidian)
.polygons
.interacting(areaid_ce_merged)
not_sram_nsdm_width.interacting(
not_sram_nsdm_width.edges.outside_part(areaid_ce_merged)
).output("nsdm.3", "nsdm.3 : min. diff width across areaid:ce : 0.38um")
nsdm_space =
not_sram_nsdm
.space(0.38, euclidian)
.polygons
.interacting(areaid_ce_merged)
nsdm_space.interacting(
nsdm_space.edges.outside_part(areaid_ce_merged)
).output("nsdm.4", "nsdm.4 : min. spacing across areaid:ce : 0.38um")
not_sram_nsdm
.inside(areaid_ce)
.width(0.29, euclidian)
.output("nsdm.5", "nsdm.5 : min. nsdm width in areaid:ce : 0.29um")
not_sram_nsdm
.inside(areaid_ce)
.space(0.29, euclidian)
.output("nsdm.6", "nsdm.6 : min. nsdm spacing in areaid:ce : 0.29um")
not_sram_nsdm
.inside(areaid_ce)
.space(0.38, projection)
.with_internal_angle(0)
.output(
"nsdm.6a",
"nsdm.6a : min. nsdm spacing on parallel edges in areaid:ce : 0.38um"
)
else
nsdm
.not(areaid_ce)
.space(0.38, euclidian)
.output("nsdm.1", "nsdm.1 : min. nsdm spacing in periphery : 0.38um")
nsdm
.outside(areaid_ce)
.width(0.38, euclidian)
.output("nsdm.2", "nsdm.2 : min. nsdm width in periphery : 0.38um")
nsdm_width =
nsdm.width(0.38, euclidian).polygons.interacting(areaid_ce_merged)
nsdm_width.interacting(
nsdm_width.edges.outside_part(areaid_ce_merged)
).output("nsdm.3", "nsdm.3 : min. diff width across areaid:ce : 0.38um")
nsdm_space =
nsdm.space(0.38, euclidian).polygons.interacting(areaid_ce_merged)
nsdm_space.interacting(
nsdm_space.edges.outside_part(areaid_ce_merged)
).output("nsdm.4", "nsdm.4 : min. spacing across areaid:ce : 0.38um")
nsdm
.inside(areaid_ce)
.width(0.29, euclidian)
.output("nsdm.5", "nsdm.5 : min. nsdm width in areaid:ce : 0.29um")
nsdm
.inside(areaid_ce)
.space(0.29, euclidian)
.output("nsdm.6", "nsdm.6 : min. nsdm spacing in areaid:ce : 0.29um")
nsdm
.inside(areaid_ce)
.space(0.38, projection)
.with_internal_angle(0)
.output(
"nsdm.6a",
"nsdm.6a : min. nsdm spacing on parallel edges in areaid:ce : 0.38um"
)
end # SRAM_EXCLUDE
log("END: 93/44 (nsdm)")
# psdm
log("START: 94/20 (psdm)")
if SRAM_EXCLUDE
not_sram_psdm
.not(areaid_ce)
.space(0.38, euclidian)
.output("psdm.1", "psdm.1 : min. psdm spacing in periphery : 0.38um")
not_sram_psdm
.outside(areaid_ce)
.width(0.38, euclidian)
.output("psdm.2", "psdm.2 : min. psdm width in periphery : 0.38um")
not_sram_psdm_width =
not_sram_psdm
.width(0.38, euclidian)
.polygons
.interacting(areaid_ce_merged)
not_sram_psdm_width.interacting(
not_sram_psdm_width.edges.outside_part(areaid_ce_merged)
).output("psdm.3", "psdm.3 : min. diff width across areaid:ce : 0.38um")
psdm_space =
not_sram_psdm
.space(0.38, euclidian)
.polygons
.interacting(areaid_ce_merged)
psdm_space.interacting(
psdm_space.edges.outside_part(areaid_ce_merged)
).output("psdm.4", "psdm.4 : min. spacing across areaid:ce : 0.38um")
not_sram_psdm
.inside(areaid_ce)
.width(0.29, euclidian)
.output("psdm.5", "psdm.5 : min. psdm width in areaid:ce : 0.29um")
not_sram_psdm
.inside(areaid_ce)
.space(0.29, euclidian)
.output("psdm.6", "psdm.6 : min. psdm spacing in areaid:ce : 0.29um")
not_sram_psdm
.inside(areaid_ce)
.space(0.38, projection)
.with_internal_angle(0)
.output(
"psdm.6a",
"psdm.6a : min. psdm spacing on parallel edges in areaid:ce : 0.38um"
)
not_sram_psdm
.and(not_sram_nsdm)
.and(diff)
.output(
"nsdm_psdm_overlap",
"nsdm_psdm_overlap : nsdm overlaps psdm over active"
)
else
psdm
.not(areaid_ce)
.space(0.38, euclidian)
.output("psdm.1", "psdm.1 : min. psdm spacing in periphery : 0.38um")
psdm
.outside(areaid_ce)
.width(0.38, euclidian)
.output("psdm.2", "psdm.2 : min. psdm width in periphery : 0.38um")
psdm_width =
psdm.width(0.38, euclidian).polygons.interacting(areaid_ce_merged)
psdm_width.interacting(
psdm_width.edges.outside_part(areaid_ce_merged)
).output("psdm.3", "psdm.3 : min. diff width across areaid:ce : 0.38um")
psdm_space =
psdm.space(0.38, euclidian).polygons.interacting(areaid_ce_merged)
psdm_space.interacting(
psdm_space.edges.outside_part(areaid_ce_merged)
).output("psdm.4", "psdm.4 : min. spacing across areaid:ce : 0.38um")
psdm
.inside(areaid_ce)
.width(0.29, euclidian)
.output("psdm.5", "psdm.5 : min. psdm width in areaid:ce : 0.29um")
psdm
.inside(areaid_ce)
.space(0.29, euclidian)
.output("psdm.6", "psdm.6 : min. psdm spacing in areaid:ce : 0.29um")
psdm
.inside(areaid_ce)
.space(0.38, projection)
.with_internal_angle(0)
.output(
"psdm.6a",
"psdm.6a : min. psdm spacing on parallel edges in areaid:ce : 0.38um"
)
psdm
.and(nsdm)
.and(diff)
.output(
"nsdm_psdm_overlap",
"nsdm_psdm_overlap : nsdm overlaps psdm over active"
)
end # SRAM_EXCLUDE
log("END: 94/20 (psdm)")
# licon
log("START: 66/44 (licon)")
polyi = poly_fill.and(poly)
poly_licon = (polyi.and(licon)).and(areaid_ce)
licon_peri = licon.outside(areaid_ce)
if SEAL
ringLICON = licon.drc(with_holes > 0)
rectLICON = licon.not(ringLICON)
else
rectLICON = licon
end
rectLICON.non_rectangles.output(
"licon.1_c",
"licon.1_c : licon should be rectangle"
)
prec_resistor = (rpm | urpm) & psdm & (poly.interacting(poly_rs))
licon_peri.not(prec_resistor).space(0.17, euclidian).output(
"MR_licon.SP.1",
"MR_licon.SP.1: min. licon spacing in periphery : 0.17um"
)
licon_not_prec_resistor = licon.not(prec_resistor)
licon_not_prec_resistor.drc(length != 0.17).output(
"licon.1",
"licon.1: min/max. licon length : 0.17um"
)
licon_peri
.and(difftap)
.separation(npc, 0.09, euclidian)
.output(
"licon.13",
"licon.13: min. licon on diff spacing to npc in periphery : 0.09um"
)
licon_peri
.and(difftap)
.and(npc)
.output(
"licon.13_a",
"licon.13_a: licon on diff in periphery can't overlap npc"
)
licon
.and(poly)
.and(difftap)
.output(
"licon.17",
"licon.17 : Licons may not overlap both poly and (diff or tap)"
)
xfom = difftap.not(poly)
licon1ToXfom = licon.interacting(licon.and(xfom))
polyLicon1 =
(licon.not(licon1ToXfom)).interacting((licon.not(licon1ToXfom)).and(poly))
polyLicon1_CORE = polyLicon1.and(areaid_ce)
npc.enclosing(polyLicon1_CORE, 0.045, euclidian).output(
"licon.6",
"licon.6 : npc min enclosure of poly_licon inside areaid:core : 0.045um"
)
polyLicon1_CORE.not(npc).output(
"licon.6",
"licon.6 : npc min enclosure of poly_licon inside areaid:core : 0.045um"
)
log("END: 66/44 (licon)")
#nsm
log("START: 61/20 (nsm)")
nsm.space(4.0, euclidian).output("nsm.1", "nsm.1 : nsm min. spacing : 4.0um")
nsm.width(3.0, euclidian).output("nsm.2", "nsm.2 : nsm min. width : 3.0um")
log("END: 61/20 (nsm)")
# CAPM
log("START: 89/44 (capm)")
capm.width(1.0, euclidian).output(
"capm.1",
"capm.1 : min. capm width : 1.0um"
)
capm.space(0.84, euclidian).output(
"capm.2a",
"capm.2a : min. capm spacing : 0.84um"
)
m3_bot_plate = ((capm.and(m3)).sized(0.14))
m3_bot_plate
.isolated(1.2, euclidian)
.polygons
.not(m3)
.output("capm.2b", "capm.2b : min. spacing between met3_bot_plate : 1.2um")
(m3.not_interacting(m3_bot_plate)).separation(
m3_bot_plate,
1.2,
euclidian
).output(
"capm.2b_a",
"capm.2b_a : min. spacing between met3_bot_plate and met3 : 1.2um"
)
# capm.and(m3).enclosing(m3, 0.14, euclidian).output("capm.3", "capm.3 : min. capm and m3 enclosure of m3 : 0.14um")
m3.enclosing(capm, 0.14, euclidian).output(
"capm.3",
"capm.3 : min. m3 enclosure of capm : 0.14um"
)
capm.enclosing(via3, 0.14, euclidian).output(
"capm.4",
"capm.4 : min. capm enclosure of via3 : 0.14um"
)
capm.separation(via3, 0.14, euclidian).output(
"capm.5",
"capm.5 : min. capm spacing to via3 : 0.14um"
)
(m3.not_interacting(capm)).separation(capm, 0.5, euclidian).output(
"capm.11",
"capm.11 : Min spacing of capm and met3 not overlapping capm : 0.5um"
)
log("END: 89/44 (capm)")
# CAP2M
log("START: 97/44 (cap2m)")
cap2m.width(1.0, euclidian).output(
"cap2m.1",
"cap2m.1 : min. cap2m width : 1.0um"
)
cap2m.space(0.84, euclidian).output(
"cap2m.2a",
"cap2m.2a : min. cap2m spacing : 0.84um"
)
m4
.interacting(cap2m)
.isolated(1.2, euclidian)
.output("cap2m.2b", "cap2m.2b : min. cap2m spacing : 1.2um")
(m4.interacting(cap2m)).isolated(1.2, euclidian).output(
"cap2m.2b_a",
"cap2m.2b_a : min. spacing of m4_bot_plate : 1.2um"
)
cap2m
.and(m4)
.enclosing(m4, 0.14, euclidian)
.output("cap2m.3", "cap2m.3 : min. m4 enclosure of cap2m : 0.14um")
m4.enclosing(cap2m, 0.14, euclidian).output(
"cap2m.3_a",
"cap2m.3_a : min. m4 enclosure of cap2m : 0.14um"
)
cap2m.enclosing(via4, 0.2, euclidian).output(
"cap2m.4",
"cap2m.4 : min. cap2m enclosure of via4 : 0.2um"
)
cap2m.separation(via4, 0.2, euclidian).output(
"cap2m.5",
"cap2m.5 : min. cap2m spacing to via4 : 0.2um"
)
(m4.not_interacting(cap2m)).separation(cap2m, 0.5, euclidian).output(
"cap2m.11",
"cap2m.11 : Min spacing of cap2m and met4 not overlapping cap2m : 0.5um"
)
log("END: 97/44 (cap2m)")
end #FEOL
if BEOL
log("BEOL section")
# li
log("START: 67/20 (li)")
li_outside_or_touching_areaidce =
(li.outside(areaid_ce)).or(
li.interacting(areaid_ce).not(li.inside(areaid_ce))
)
li_outside_or_touching_areaidce.width(0.17, euclidian).output(
"li.1",
"li.1 : min. li width outside or crossing areaid:ce : 0.17um"
)
li_outside_or_touching_areaidce.space(0.17, euclidian).output(
"li.3",
"li.3 : min. li spacing outside or crossing areaid:ce : 0.17um"
)
licon_peri = licon.not(areaid_ce)
li_edges_with_less_enclosure =
li.enclosing(licon_peri, 0.08, projection).second_edges
error_corners = li_edges_with_less_enclosure.width(angle_limit(100.0), 1.dbu)
li_interact = licon_peri.interacting(error_corners.polygons(1.dbu))
li_interact.output(
"li.5",
"li.5 : min. li enclosure of licon of 2 adjacent edges : 0.08um"
)
linotace = li.not(li.interacting(areaid_ce))
linotace.with_area(nil, 0.0561).output(
"li.6",
"li.6 : min. li area : 0.0561um²"
)
li_core = li.and(areaid_ce)
li_core.space(0.14, euclidian).output(
"li.7",
"li.7 : min. li core spacing : 0.14um"
)
li_core.width(0.14, euclidian).output(
"li.8",
"li.8 : min. li core width : 0.14um"
)
log("END: 67/20 (li)")
# li res
log("START: 67/13 (li_res)")
li_res.width(0.29, euclidian).output(
"MR_li.WID.4",
"MR_li.WID.4 : li:res minimum width : 0.29um"
)
log("END: 67/13 (li_res)")
# ct
log("START: 67/44 (mcon)")
mconnotace = mcon.not(areaid_ce)
if SEAL
ringMCON = mcon.drc(with_holes > 0)
rectMCON = mcon.not(ringMCON)
else
rectMCON = mcon
end
rectMCON_peri = rectMCON.outside(areaid_ce)
rectMCON.non_rectangles.output(
"ct.1",
"ct.1: non-ring mcon should be rectangular"
)
# rectMCON_peri.edges.without_length(0.17).output("ct.1_a/b", "ct.1_a/b : minimum/maximum width of mcon : 0.17um")
rectMCON_peri.drc(width < 0.17).output(
"ct.1_a",
"ct.1_a : minimum width of mcon : 0.17um"
)
rectMCON_peri.drc(length > 0.17).output(
"ct.1_b",
"ct.1_b : maximum length of mcon : 0.17um"
)
mcon.space(0.19, euclidian).output(
"ct.2",
"ct.2 : min. mcon spacing : 0.19um"
)
if SEAL
ringMCON.width(0.17, euclidian).output(
"ct.3",
"ct.3 : min. width of ring-shaped mcon : 0.17um"
)
ringMCON.drc(width >= 0.175).output(
"ct.3_a",
"ct.3_a : max. width of ring-shaped mcon : 0.175um"
)
ringMCON.not(areaid_sl).output(
"ct.3_b",
"ct.3_b: ring-shaped mcon must be enclosed by areaid_sl"
)
end
mconnotace.not(li).output("ct.4", "ct.4 : mcon should covered by li")
log("END: 67/44 (mcon)")
# m1
log("START: 68/20 (m1)")
m1.width(0.14, euclidian).output("m1.1", "m1.1 : min. m1 width : 0.14um")
huge_m1 = m1.sized(-1.5).sized(1.5).snap(0.005) & m1
non_huge_m1 = m1.edges - huge_m1
huge_m1 = huge_m1.edges.outside_part(m1.merged)
non_huge_m1.space(0.14, euclidian).output(
"m1.2",
"m1.2 : min. m1 spacing : 0.14um"
)
(
huge_m1.separation(non_huge_m1, 0.28, euclidian) +
huge_m1.space(0.28, euclidian)
).output("m1.3ab", "m1.3ab : min. 3um.m1 spacing m1 : 0.28um")
#not_in_cell6 = layout(source.cell_obj).select("-s8cell_ee_plus_sseln_a", "-s8cell_ee_plus_sseln_b", "-s8cell_ee_plus_sselp_a", "-s8cell_ee_plus_sselp_b", "-s8fpls_pl8", "-s8fs_cmux4_fm")
not_in_cell6 =
layout(source.cell_obj).select(
"-s8cell_ee_plus_sseln_a",
"-s8cell_ee_plus_sseln_b",
"-s8cell_ee_plus_sselp_a",