| ################################################################################################ |
| # Copyright 2022 GlobalFoundries PDK Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| ################################################################################################ |
| |
| #=========================================================================================================================== |
| #------------------------------------------- GF 0.18um MCU DRC RULE DECK -------------------------------------------------- |
| #=========================================================================================================================== |
| require 'time' |
| require "logger" |
| |
| exec_start_time = Time.now |
| |
| logger = Logger.new(STDOUT) |
| |
| logger.formatter = proc do |severity, datetime, progname, msg| |
| "#{datetime}: Memory Usage (" + `pmap #{Process.pid} | tail -1`[10,40].strip + ") : #{msg} |
| " |
| end |
| |
| #================================================ |
| #----------------- FILE SETUP ------------------- |
| #================================================ |
| |
| # optional for a batch launch : klayout -b -r gf_018mcu.drc -rd input=design.gds -rd report=gp180_drc.lyrdb |
| |
| logger.info("Starting running GF180MCU Klayout DRC runset on %s" % [$input]) |
| logger.info("Ruby Version for klayout: %s" % [RUBY_VERSION]) |
| |
| if $input |
| if $topcell |
| source($input, $topcell) |
| else |
| source($input) |
| end |
| end |
| |
| if $table_name |
| table_name = $table_name |
| else |
| table_name = "main" |
| end |
| |
| |
| logger.info("Loading database to memory is complete.") |
| |
| if $report |
| logger.info("GF180MCU Klayout DRC runset output at: %s" % [$report]) |
| report("DRC Run Report at", $report) |
| else |
| logger.info("GF180MCU Klayout DRC runset output at default location." % [File.join(File.dirname(RBA::CellView::active.filename), "gf180_drc.lyrdb")]) |
| report("DRC Run Report at", File.join(File.dirname(RBA::CellView::active.filename), "gf180_drc.lyrdb")) |
| end |
| |
| #================================================ |
| #------------------ SWITCHES -------------------- |
| #================================================ |
| logger.info("Evaluate switches.") |
| |
| # connectivity rules |
| if $conn_drc == "true" |
| CONNECTIVITY_RULES = $conn_drc |
| logger.info("connectivity rules are enabled.") |
| else |
| CONNECTIVITY_RULES = false |
| logger.info("connectivity rules are disabled.") |
| end # connectivity rules |
| |
| # WEDGE |
| if $wedge == "false" |
| WEDGE = $wedge |
| else |
| WEDGE = "true" |
| end # WEDGE |
| |
| logger.info("Wedge enabled %s" % [WEDGE]) |
| |
| # BALL |
| if $ball == "false" |
| BALL = $ball |
| else |
| BALL = "true" |
| end # BALL |
| |
| logger.info("Ball enabled %s" % [BALL]) |
| |
| # GOLD |
| if $gold == "false" |
| GOLD = $gold |
| else |
| GOLD = "true" |
| end # GOLD |
| |
| logger.info("Gold enabled %s" % [GOLD]) |
| |
| if $mim_option |
| MIM_OPTION = $mim_option |
| else |
| MIM_OPTION = "B" |
| end |
| |
| logger.info("MIM Option selected %s" % [MIM_OPTION]) |
| |
| # OFFGRID |
| if $offgrid == "false" |
| OFFGRID = false |
| else |
| OFFGRID = true |
| end # OFFGRID |
| |
| logger.info("Offgrid enabled %s" % [OFFGRID]) |
| |
| if $thr |
| threads($thr) |
| logger.info("Number of threads to use %s" % [$thr]) |
| else |
| threads(%x("nproc")) |
| logger.info("Number of threads to use #{%x("nproc")}") |
| end |
| |
| #=== PRINT DETAILS === |
| if $verbose == "true" |
| logger.info("Verbose mode: #{$verbose}") |
| verbose(true) |
| else |
| verbose(false) |
| logger.info("Verbose mode: false") |
| end |
| |
| # === TILING MODE === |
| if $run_mode == "tiling" |
| tiles(500.um) |
| tile_borders(10.um) |
| logger.info("Tiling mode is enabled.") |
| |
| elsif $run_mode == "deep" |
| #=== HIER MODE === |
| deep |
| logger.info("deep mode is enabled.") |
| else |
| #=== FLAT MODE === |
| flat |
| logger.info("flat mode is enabled.") |
| end # run_mode |
| |
| # METAL_TOP |
| if $metal_top |
| METAL_TOP = $metal_top |
| else |
| METAL_TOP = "9K" |
| end # METAL_TOP |
| |
| logger.info("METAL_TOP Selected is %s" % [METAL_TOP]) |
| |
| # METAL_LEVEL |
| if $metal_level |
| METAL_LEVEL = $metal_level |
| else |
| METAL_LEVEL = "5LM" |
| end # METAL_LEVEL |
| |
| logger.info("METAL_STACK Selected is %s" % [METAL_LEVEL]) |
| |
| # FEOL |
| if $feol == "false" |
| FEOL = $feol |
| logger.info("FEOL is disabled.") |
| else |
| FEOL = "true" |
| logger.info("FEOL is enabled.") |
| end # FEOL |
| |
| # BEOL |
| if $beol == "false" |
| BEOL = $beol |
| logger.info("BEOL is disabled.") |
| else |
| BEOL = "true" |
| logger.info("BEOL is enabled.") |
| end # BEOL |
| |
| #================================================ |
| #------------- LAYERS DEFINITIONS --------------- |
| #================================================ |
| polygons_count = 0 |
| logger.info("Read in polygons from layers.") |
| |
| def get_polygons(l, d) |
| if $run_mode == "deep" |
| polygons(l, d) |
| else |
| polygons(l, d).merged |
| end |
| end |
| |
| comp = get_polygons(22 , 0 ) |
| count = comp.count() |
| logger.info("comp has %d polygons" % [count]) |
| polygons_count += count |
| |
| dnwell = get_polygons(12 , 0 ) |
| count = dnwell.count() |
| logger.info("dnwell has %d polygons" % [count]) |
| polygons_count += count |
| |
| nwell = get_polygons(21 , 0 ) |
| count = nwell.count() |
| logger.info("nwell has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvpwell = get_polygons(204, 0 ) |
| count = lvpwell.count() |
| logger.info("lvpwell has %d polygons" % [count]) |
| polygons_count += count |
| |
| dualgate = get_polygons(55 , 0 ) |
| count = dualgate.count() |
| logger.info("dualgate has %d polygons" % [count]) |
| polygons_count += count |
| |
| poly2 = get_polygons(30 , 0 ) |
| count = poly2.count() |
| logger.info("poly2 has %d polygons" % [count]) |
| polygons_count += count |
| |
| nplus = get_polygons(32 , 0 ) |
| count = nplus.count() |
| logger.info("nplus has %d polygons" % [count]) |
| polygons_count += count |
| |
| pplus = get_polygons(31 , 0 ) |
| count = pplus.count() |
| logger.info("pplus has %d polygons" % [count]) |
| polygons_count += count |
| |
| sab = get_polygons(49 , 0 ) |
| count = sab.count() |
| logger.info("sab has %d polygons" % [count]) |
| polygons_count += count |
| |
| esd = get_polygons(24 , 0 ) |
| count = esd.count() |
| logger.info("esd has %d polygons" % [count]) |
| polygons_count += count |
| |
| resistor = get_polygons(62 , 0 ) |
| count = resistor.count() |
| logger.info("resistor has %d polygons" % [count]) |
| polygons_count += count |
| |
| fhres = get_polygons(227, 0 ) |
| count = fhres.count() |
| logger.info("fhres has %d polygons" % [count]) |
| polygons_count += count |
| |
| fusetop = get_polygons(75 , 0 ) |
| count = fusetop.count() |
| logger.info("fusetop has %d polygons" % [count]) |
| polygons_count += count |
| |
| fusewindow_d = get_polygons(96 , 1 ) |
| count = fusewindow_d.count() |
| logger.info("fusewindow_d has %d polygons" % [count]) |
| polygons_count += count |
| |
| polyfuse = get_polygons(220, 0 ) |
| count = polyfuse.count() |
| logger.info("polyfuse has %d polygons" % [count]) |
| polygons_count += count |
| |
| mvsd = get_polygons(210, 0 ) |
| count = mvsd.count() |
| logger.info("mvsd has %d polygons" % [count]) |
| polygons_count += count |
| |
| mvpsd = get_polygons(11 , 39) |
| count = mvpsd.count() |
| logger.info("mvpsd has %d polygons" % [count]) |
| polygons_count += count |
| |
| nat = get_polygons(5 , 0 ) |
| count = nat.count() |
| logger.info("nat has %d polygons" % [count]) |
| polygons_count += count |
| |
| comp_dummy = get_polygons(22 , 4 ) |
| count = comp_dummy.count() |
| logger.info("comp_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| poly2_dummy = get_polygons(30 , 4 ) |
| count = poly2_dummy.count() |
| logger.info("poly2_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| schottky_diode = get_polygons(241, 0 ) |
| count = schottky_diode.count() |
| logger.info("schottky_diode has %d polygons" % [count]) |
| polygons_count += count |
| |
| zener = get_polygons(178, 0 ) |
| count = zener.count() |
| logger.info("zener has %d polygons" % [count]) |
| polygons_count += count |
| |
| res_mk = get_polygons(110, 5 ) |
| count = res_mk.count() |
| logger.info("res_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| opc_drc = get_polygons(124, 5 ) |
| count = opc_drc.count() |
| logger.info("opc_drc has %d polygons" % [count]) |
| polygons_count += count |
| |
| ndmy = get_polygons(111, 5 ) |
| count = ndmy.count() |
| logger.info("ndmy has %d polygons" % [count]) |
| polygons_count += count |
| |
| pmndmy = get_polygons(152, 5 ) |
| count = pmndmy.count() |
| logger.info("pmndmy has %d polygons" % [count]) |
| polygons_count += count |
| |
| v5_xtor = get_polygons(112, 1 ) |
| count = v5_xtor.count() |
| logger.info("v5_xtor has %d polygons" % [count]) |
| polygons_count += count |
| |
| cap_mk = get_polygons(117, 5 ) |
| count = cap_mk.count() |
| logger.info("cap_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mos_cap_mk = get_polygons(166, 5 ) |
| count = mos_cap_mk.count() |
| logger.info("mos_cap_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| ind_mk = get_polygons(151, 5 ) |
| count = ind_mk.count() |
| logger.info("ind_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| diode_mk = get_polygons(115, 5 ) |
| count = diode_mk.count() |
| logger.info("diode_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| drc_bjt = get_polygons(127, 5 ) |
| count = drc_bjt.count() |
| logger.info("drc_bjt has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_bjt = get_polygons(118, 5 ) |
| count = lvs_bjt.count() |
| logger.info("lvs_bjt has %d polygons" % [count]) |
| polygons_count += count |
| |
| mim_l_mk = get_polygons(117, 10) |
| count = mim_l_mk.count() |
| logger.info("mim_l_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| latchup_mk = get_polygons(137, 5 ) |
| count = latchup_mk.count() |
| logger.info("latchup_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| guard_ring_mk = get_polygons(167, 5 ) |
| count = guard_ring_mk.count() |
| logger.info("guard_ring_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| otp_mk = get_polygons(173, 5 ) |
| count = otp_mk.count() |
| logger.info("otp_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mtpmark = get_polygons(122, 5 ) |
| count = mtpmark.count() |
| logger.info("mtpmark has %d polygons" % [count]) |
| polygons_count += count |
| |
| neo_ee_mk = get_polygons(88 , 17) |
| count = neo_ee_mk.count() |
| logger.info("neo_ee_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| sramcore = get_polygons(108, 5 ) |
| count = sramcore.count() |
| logger.info("sramcore has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_rf = get_polygons(100, 5 ) |
| count = lvs_rf.count() |
| logger.info("lvs_rf has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_drain = get_polygons(100, 7 ) |
| count = lvs_drain.count() |
| logger.info("lvs_drain has %d polygons" % [count]) |
| polygons_count += count |
| |
| ind_mk = get_polygons(151, 5 ) |
| count = ind_mk.count() |
| logger.info("ind_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| hvpolyrs = get_polygons(123, 5 ) |
| count = hvpolyrs.count() |
| logger.info("hvpolyrs has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_io = get_polygons(119, 5 ) |
| count = lvs_io.count() |
| logger.info("lvs_io has %d polygons" % [count]) |
| polygons_count += count |
| |
| probe_mk = get_polygons(13 , 17) |
| count = probe_mk.count() |
| logger.info("probe_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| esd_mk = get_polygons(24 , 5 ) |
| count = esd_mk.count() |
| logger.info("esd_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_source = get_polygons(100, 8 ) |
| count = lvs_source.count() |
| logger.info("lvs_source has %d polygons" % [count]) |
| polygons_count += count |
| |
| well_diode_mk = get_polygons(153, 51) |
| count = well_diode_mk.count() |
| logger.info("well_diode_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| ldmos_xtor = get_polygons(226, 0 ) |
| count = ldmos_xtor.count() |
| logger.info("ldmos_xtor has %d polygons" % [count]) |
| polygons_count += count |
| |
| plfuse = get_polygons(125, 5 ) |
| count = plfuse.count() |
| logger.info("plfuse has %d polygons" % [count]) |
| polygons_count += count |
| |
| efuse_mk = get_polygons(80 , 5 ) |
| count = efuse_mk.count() |
| logger.info("efuse_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mcell_feol_mk = get_polygons(11 , 17) |
| count = mcell_feol_mk.count() |
| logger.info("mcell_feol_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| ymtp_mk = get_polygons(86 , 17) |
| count = ymtp_mk.count() |
| logger.info("ymtp_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| dev_wf_mk = get_polygons(128, 17) |
| count = dev_wf_mk.count() |
| logger.info("dev_wf_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| comp_label = get_polygons(22 , 10) |
| count = comp_label.count() |
| logger.info("comp_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| poly2_label = get_polygons(30 , 10) |
| count = poly2_label.count() |
| logger.info("poly2_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| mdiode = get_polygons(116, 5 ) |
| count = mdiode.count() |
| logger.info("mdiode has %d polygons" % [count]) |
| polygons_count += count |
| |
| contact = get_polygons(33 , 0 ) |
| count = contact.count() |
| logger.info("contact has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal1_drawn = get_polygons(34 , 0 ) |
| count = metal1_drawn.count() |
| logger.info("metal1_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal1_dummy = get_polygons(34 , 4 ) |
| count = metal1_dummy.count() |
| logger.info("metal1_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal1 = metal1_drawn + metal1_dummy |
| |
| metal1_label = get_polygons(34 , 10) |
| count = metal1_label.count() |
| logger.info("metal1_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal1_slot = get_polygons(34 , 3 ) |
| count = metal1_slot.count() |
| logger.info("metal1_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal1_blk = get_polygons(34 , 5 ) |
| count = metal1_blk.count() |
| logger.info("metal1_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| via1 = get_polygons(35 , 0 ) |
| count = via1.count() |
| logger.info("via1 has %d polygons" % [count]) |
| polygons_count += count |
| |
| |
| if METAL_LEVEL == "2LM" |
| metal2_drawn = get_polygons(36 , 0 ) |
| count = metal2_drawn.count() |
| logger.info("metal2_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2_dummy = get_polygons(36 , 4 ) |
| count = metal2_dummy.count() |
| logger.info("metal2_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2 = metal2_drawn + metal2_drawn |
| |
| metal2_label = get_polygons(36 , 10) |
| count = metal2_label.count() |
| logger.info("metal2_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2_slot = get_polygons(36 , 3 ) |
| count = metal2_slot.count() |
| logger.info("metal2_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2_blk = get_polygons(36 , 5 ) |
| count = metal2_blk.count() |
| logger.info("metal2_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| top_via = via1 |
| topmin1_via = contact |
| top_metal = metal2 |
| topmin1_metal = metal1 |
| |
| else |
| metal2_drawn = get_polygons(36 , 0 ) |
| count = metal2_drawn.count() |
| logger.info("metal2_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2_dummy = get_polygons(36 , 4 ) |
| count = metal2_dummy.count() |
| logger.info("metal2_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2 = metal2_drawn + metal2_dummy |
| |
| metal2_label = get_polygons(36 , 10) |
| count = metal2_label.count() |
| logger.info("metal2_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2_slot = get_polygons(36 , 3 ) |
| count = metal2_slot.count() |
| logger.info("metal2_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2_blk = get_polygons(36 , 5 ) |
| count = metal2_blk.count() |
| logger.info("metal2_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| via2 = get_polygons(38 , 0 ) |
| count = via2.count() |
| logger.info("via2 has %d polygons" % [count]) |
| polygons_count += count |
| |
| if METAL_LEVEL == "3LM" |
| metal3_drawn = get_polygons(42 , 0 ) |
| count = metal3_drawn.count() |
| logger.info("metal3_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3_dummy = get_polygons(42 , 4 ) |
| count = metal3_dummy.count() |
| logger.info("metal3_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3 = metal3_drawn + metal3_dummy |
| |
| metal3_label = get_polygons(42 , 10) |
| count = metal3_label.count() |
| logger.info("metal3_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3_slot = get_polygons(42 , 3 ) |
| count = metal3_slot.count() |
| logger.info("metal3_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3_blk = get_polygons(42 , 5 ) |
| count = metal3_blk.count() |
| logger.info("metal3_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| top_via = via2 |
| topmin1_via = via1 |
| top_metal = metal3 |
| topmin1_metal = metal2 |
| else |
| metal3_drawn = get_polygons(42 , 0 ) |
| count = metal3_drawn.count() |
| logger.info("metal3_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3_dummy = get_polygons(42 , 4 ) |
| count = metal3_dummy.count() |
| logger.info("metal3_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3 = metal3_drawn + metal3_dummy |
| |
| metal3_label = get_polygons(42 , 10) |
| count = metal3_label.count() |
| logger.info("metal3_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3_slot = get_polygons(42 , 3 ) |
| count = metal3_slot.count() |
| logger.info("metal3_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3_blk = get_polygons(42 , 5 ) |
| count = metal3_blk.count() |
| logger.info("metal3_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| via3 = get_polygons(40 , 0 ) |
| |
| if METAL_LEVEL == "4LM" |
| metal4_drawn = get_polygons(46 , 0 ) |
| count = metal4_drawn.count() |
| logger.info("metal4_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4_dummy = get_polygons(46 , 4 ) |
| count = metal4_dummy.count() |
| logger.info("metal4_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4 = metal4_drawn + metal4_dummy |
| |
| metal4_label = get_polygons(46 , 10) |
| count = metal4_label.count() |
| logger.info("metal4_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4_slot = get_polygons(46 , 3 ) |
| count = metal4_slot.count() |
| logger.info("metal4_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4_blk = get_polygons(46 , 5 ) |
| count = metal4_blk.count() |
| logger.info("metal4_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| top_via = via3 |
| topmin1_via = via2 |
| top_metal = metal4 |
| topmin1_metal = metal3 |
| else |
| metal4_drawn = get_polygons(46 , 0 ) |
| count = metal4_drawn.count() |
| logger.info("metal4_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4_dummy = get_polygons(46 , 4 ) |
| count = metal4_dummy.count() |
| logger.info("metal4_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4 = metal4_drawn + metal4_dummy |
| |
| metal4_label = get_polygons(46 , 10) |
| count = metal4_label.count() |
| logger.info("metal4_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4_slot = get_polygons(46 , 3 ) |
| count = metal4_slot.count() |
| logger.info("metal4_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4_blk = get_polygons(46 , 5 ) |
| count = metal4_blk.count() |
| logger.info("metal4_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| via4 = get_polygons(41 , 0 ) |
| count = via4.count() |
| logger.info("via4 has %d polygons" % [count]) |
| polygons_count += count |
| |
| if METAL_LEVEL == "5LM" |
| metal5_drawn = get_polygons(81 , 0 ) |
| count = metal5_drawn.count() |
| logger.info("metal5_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5_dummy = get_polygons(81 , 4 ) |
| count = metal5_dummy.count() |
| logger.info("metal5_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5 = metal5_drawn + metal5_dummy |
| |
| metal5_label = get_polygons(81 , 10) |
| count = metal5_label.count() |
| logger.info("metal5_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5_slot = get_polygons(81 , 3 ) |
| count = metal5_slot.count() |
| logger.info("metal5_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5_blk = get_polygons(81 , 5 ) |
| count = metal5_blk.count() |
| logger.info("metal5_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| top_via = via4 |
| topmin1_via = via3 |
| top_metal = metal5 |
| topmin1_metal = metal4 |
| else |
| ## 6LM |
| metal5_drawn = get_polygons(81 , 0 ) |
| count = metal5_drawn.count() |
| logger.info("metal5_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5_dummy = get_polygons(81 , 4 ) |
| count = metal5_dummy.count() |
| logger.info("metal5_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5 = metal5_drawn + metal5_dummy |
| |
| metal5_label = get_polygons(81 , 10) |
| count = metal5_label.count() |
| logger.info("metal5_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5_slot = get_polygons(81 , 3 ) |
| count = metal5_slot.count() |
| logger.info("metal5_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5_blk = get_polygons(81 , 5 ) |
| count = metal5_blk.count() |
| logger.info("metal5_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| via5 = get_polygons(82 , 0 ) |
| count = via5.count() |
| logger.info("via5 has %d polygons" % [count]) |
| polygons_count += count |
| |
| |
| metaltop_drawn = get_polygons(53 , 0 ) |
| count = metaltop_drawn.count() |
| logger.info("metaltop_drawn has %d polygons" % [count]) |
| polygons_count += count |
| |
| metaltop_dummy = get_polygons(53 , 4 ) |
| count = metaltop_dummy.count() |
| logger.info("metaltop_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metaltop = metaltop_drawn + metaltop_dummy |
| |
| metaltop_label = get_polygons(53 , 10) |
| count = metaltop_label.count() |
| logger.info("metaltop_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metaltop_slot = get_polygons(53 , 3 ) |
| count = metaltop_slot.count() |
| logger.info("metaltop_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metalt_blk = get_polygons(53 , 5 ) |
| count = metalt_blk.count() |
| logger.info("metalt_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| top_via = via5 |
| topmin1_via = via4 |
| top_metal = metaltop |
| topmin1_metal = metal5 |
| end |
| end |
| end |
| end |
| |
| pad = get_polygons(37 , 0 ) |
| count = pad.count() |
| logger.info("pad has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmpperi = get_polygons(183, 0 ) |
| count = ubmpperi.count() |
| logger.info("ubmpperi has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmparray = get_polygons(184, 0 ) |
| count = ubmparray.count() |
| logger.info("ubmparray has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmeplate = get_polygons(185, 0 ) |
| count = ubmeplate.count() |
| logger.info("ubmeplate has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal1_res = get_polygons(110, 11) |
| count = metal1_res.count() |
| logger.info("metal1_res has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal2_res = get_polygons(110, 12) |
| count = metal2_res.count() |
| logger.info("metal2_res has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal3_res = get_polygons(110, 13) |
| count = metal3_res.count() |
| logger.info("metal3_res has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal4_res = get_polygons(110, 14) |
| count = metal4_res.count() |
| logger.info("metal4_res has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal5_res = get_polygons(110, 15) |
| count = metal5_res.count() |
| logger.info("metal5_res has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal6_res = get_polygons(110, 16) |
| count = metal6_res.count() |
| logger.info("metal6_res has %d polygons" % [count]) |
| polygons_count += count |
| |
| pr_bndry = get_polygons(0 , 0 ) |
| count = pr_bndry.count() |
| logger.info("pr_bndry has %d polygons" % [count]) |
| polygons_count += count |
| |
| border = get_polygons(63 , 0 ) |
| count = border.count() |
| logger.info("border has %d polygons" % [count]) |
| polygons_count += count |
| logger.info("Total no. of polygons in the design is #{polygons_count}") |
| |
| logger.info("Starting deriving base layers.") |
| #===================================================== |
| #------------- BASE LAYERS DERIVATIONS --------------- |
| #===================================================== |
| |
| ncomp = comp & nplus |
| pcomp = comp & pplus |
| tgate = poly2 & comp |
| ngate = nplus & tgate |
| pgate = pplus & tgate |
| natcompsd = (nat & comp.interacting(poly2)) - tgate |
| |
| nom_gate = tgate.not(dualgate) |
| thick_gate = tgate.and(dualgate) |
| |
| ngate_56V = ngate.and(dualgate) |
| pgate_56V = pgate.and(dualgate) |
| |
| ngate_5V = ngate_56V.and(v5_xtor) |
| pgate_5V = pgate_56V.and(v5_xtor) |
| |
| ngate_6V = ngate_56V.not(v5_xtor) |
| pgate_6V = pgate_56V.not(v5_xtor) |
| |
| lvpwell_dn = lvpwell.interacting(dnwell) |
| lvpwell_out = lvpwell.not_interacting(dnwell) |
| |
| |
| #================================================ |
| #------------- LAYERS CONNECTIONS --------------- |
| #================================================ |
| |
| if CONNECTIVITY_RULES |
| |
| logger.info("Construct connectivity for the design.") |
| |
| connect(dnwell, ncomp) |
| connect(ncomp, contact) |
| connect(pcomp, contact) |
| |
| connect(lvpwell_out, pcomp) |
| connect(lvpwell_dn, pcomp) |
| |
| connect(nwell, ncomp) |
| connect(natcompsd, contact) |
| connect(mvsd, ncomp) |
| connect(mvpsd, pcomp) |
| connect(contact, metal1) |
| connect(metal1, via1) |
| connect(via1, metal2) |
| if METAL_LEVEL != "2LM" |
| connect(metal2, via2) |
| connect(via2, metal3) |
| |
| if METAL_LEVEL != "3LM" |
| connect(metal3, via3) |
| connect(via3, metal4) |
| |
| if METAL_LEVEL != "4LM" |
| connect(metal4, via4) |
| connect(via4, metal5) |
| |
| if METAL_LEVEL != "5LM" |
| connect(metal5, via5) |
| connect(via5, metaltop) |
| end |
| end |
| end |
| end |
| |
| end #CONNECTIVITY_RULES |
| |
| #================================================ |
| #------------ PRE-DEFINED FUNCTIONS ------------- |
| #================================================ |
| |
| def conn_space(layer,conn_val,not_conn_val, mode) |
| if conn_val > not_conn_val |
| raise "ERROR : Wrong connectivity implementation" |
| end |
| connected_output = layer.space(conn_val.um, mode).polygons(0.001) |
| unconnected_errors_unfiltered = layer.space(not_conn_val.um, mode) |
| singularity_errors = layer.space(0.001.um) |
| # Filter out the errors arising from the same net |
| unconnected_errors = DRC::DRCLayer::new(self, RBA::EdgePairs::new) |
| unconnected_errors_unfiltered.data.each do |ep| |
| net1 = l2n_data.probe_net(layer.data, ep.first.p1) |
| net2 = l2n_data.probe_net(layer.data, ep.second.p1) |
| if !net1 || !net2 |
| puts "Should not happen ..." |
| elsif net1.circuit != net2.circuit || net1.cluster_id != net2.cluster_id |
| # unconnected |
| unconnected_errors.data.insert(ep) |
| end |
| end |
| unconnected_output = unconnected_errors.polygons.or(singularity_errors.polygons(0.001)) |
| return connected_output, unconnected_output |
| end |
| |
| def conn_separation(layer1, layer2, conn_val,not_conn_val, mode) |
| if conn_val > not_conn_val |
| raise "ERROR : Wrong connectivity implementation" |
| end |
| connected_output = layer1.separation(layer2, conn_val.um, mode).polygons(0.001) |
| unconnected_errors_unfiltered = layer1.separation(layer2, not_conn_val.um, mode) |
| # Filter out the errors arising from the same net |
| unconnected_errors = DRC::DRCLayer::new(self, RBA::EdgePairs::new) |
| unconnected_errors_unfiltered.data.each do |ep| |
| net1 = l2n_data.probe_net(layer1.data, ep.first.p1) |
| net2 = l2n_data.probe_net(layer2.data, ep.second.p1) |
| if !net1 || !net2 |
| puts "Should not happen ..." |
| elsif net1.circuit != net2.circuit || net1.cluster_id != net2.cluster_id |
| # unconnected |
| unconnected_errors.data.insert(ep) |
| end |
| end |
| unconnected_output = unconnected_errors.polygons(0.001) |
| return connected_output, unconnected_output |
| end |
| |
| # === IMPLICIT EXTRACTION === |
| if CONNECTIVITY_RULES |
| logger.info("Connectivity rules enabled, Netlist object will be generated.") |
| netlist |
| end #CONNECTIVITY_RULES |
| |
| # === LAYOUT EXTENT === |
| CHIP = extent.sized(0.0) |
| logger.info("Total area of the design is #{CHIP.area()} um^2.") |
| |
| #================================================ |
| #----------------- MAIN RUNSET ------------------ |
| #================================================ |
| |
| logger.info("Starting GF180MCU DRC rules.") |
| if FEOL |
| logger.info("Running all FEOL rules") |
| end #FEOL |
| |
| if BEOL |
| logger.info("Running all BEOL rules") |
| end #BEOL |
| |
| |
| ################################################################################################ |
| # Copyright 2022 GlobalFoundries PDK Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| ################################################################################################ |
| |
| |
| if FEOL |
| #================================================ |
| #----------------------COMP---------------------- |
| #================================================ |
| |
| # Rule DF.1a_3.3V: Min. COMP Width. is 0.22µm |
| logger.info("Executing rule DF.1a_3.3V") |
| df1a_l1 = comp.width(0.22.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df1a_l1.output("DF.1a_3.3V", "DF.1a_3.3V : Min. COMP Width. : 0.22µm") |
| df1a_l1.forget |
| |
| # Rule DF.1a_5V: Min. COMP Width. is 0.3µm |
| logger.info("Executing rule DF.1a_5V") |
| df1a_l1 = comp.not_inside(mvsd).not_inside(mvpsd).width(0.3.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df1a_l1.output("DF.1a_5V", "DF.1a_5V : Min. COMP Width. : 0.3µm") |
| df1a_l1.forget |
| |
| # rule DF.1b_3.3V is not a DRC check |
| |
| # rule DF.1b_5V is not a DRC check |
| |
| # Rule DF.1c_3.3V: Min. COMP Width for MOSCAP. is 1µm |
| logger.info("Executing rule DF.1c_3.3V") |
| df1c_l1 = comp.and(mos_cap_mk).width(1.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df1c_l1.output("DF.1c_3.3V", "DF.1c_3.3V : Min. COMP Width for MOSCAP. : 1µm") |
| df1c_l1.forget |
| |
| # Rule DF.1c_5V: Min. COMP Width for MOSCAP. is 1µm |
| logger.info("Executing rule DF.1c_5V") |
| df1c_l1 = comp.and(mos_cap_mk).width(1.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df1c_l1.output("DF.1c_5V", "DF.1c_5V : Min. COMP Width for MOSCAP. : 1µm") |
| df1c_l1.forget |
| |
| df_2a = comp.not(poly2).edges.and(tgate.edges) |
| # Rule DF.2a_3.3V: Min Channel Width. is nil,0.22µm |
| logger.info("Executing rule DF.2a_3.3V") |
| df2a_l1 = df_2a.with_length(nil,0.22.um).extended(0, 0, 0.001, 0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df2a_l1.output("DF.2a_3.3V", "DF.2a_3.3V : Min Channel Width. : nil,0.22µm") |
| df2a_l1.forget |
| |
| # Rule DF.2a_5V: Min Channel Width. is nil,0.3µm |
| logger.info("Executing rule DF.2a_5V") |
| df2a_l1 = df_2a.with_length(nil,0.3.um).extended(0, 0, 0.001, 0.001).overlapping(dualgate) |
| df2a_l1.output("DF.2a_5V", "DF.2a_5V : Min Channel Width. : nil,0.3µm") |
| df2a_l1.forget |
| |
| df_2a.forget |
| |
| df_2b = comp.width(100.um + 1.dbu).polygons(0.001).not_inside(mos_cap_mk) |
| # Rule DF.2b_3.3V: Max. COMP width for all cases except those used for capacitors, marked by ‘MOS_CAP_MK’ layer. |
| logger.info("Executing rule DF.2b_3.3V") |
| df2b_l1 = comp.not_inside(mos_cap_mk).not_interacting(df_2b).not_interacting(v5_xtor).not_interacting(dualgate) |
| df2b_l1.output("DF.2b_3.3V", "DF.2b_3.3V : Max. COMP width for all cases except those used for capacitors, marked by ‘MOS_CAP_MK’ layer.") |
| df2b_l1.forget |
| |
| # Rule DF.2b_5V: Max. COMP width for all cases except those used for capacitors, marked by ‘MOS_CAP_MK’ layer. |
| logger.info("Executing rule DF.2b_5V") |
| df2b_l1 = comp.not_inside(mos_cap_mk).not_interacting(df_2b).overlapping(dualgate) |
| df2b_l1.output("DF.2b_5V", "DF.2b_5V : Max. COMP width for all cases except those used for capacitors, marked by ‘MOS_CAP_MK’ layer.") |
| df2b_l1.forget |
| |
| df_2b.forget |
| |
| # Rule DF.3a_3.3V: Min. COMP Space P-substrate tap (PCOMP outside NWELL and DNWELL) can be butted for different voltage devices as the potential is same. is 0.28µm |
| logger.info("Executing rule DF.3a_3.3V") |
| df3a_l1 = comp.not(otp_mk).space(0.28.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df3a_l1.output("DF.3a_3.3V", "DF.3a_3.3V : Min. COMP Space P-substrate tap (PCOMP outside NWELL and DNWELL) can be butted for different voltage devices as the potential is same. : 0.28µm") |
| df3a_l1.forget |
| |
| # Rule DF.3a_5V: Min. COMP Space P-substrate tap (PCOMP outside NWELL and DNWELL) can be butted for different voltage devices as the potential is same. is 0.36µm |
| logger.info("Executing rule DF.3a_5V") |
| df3a_l1 = comp.not(otp_mk).space(0.36.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df3a_l1.output("DF.3a_5V", "DF.3a_5V : Min. COMP Space P-substrate tap (PCOMP outside NWELL and DNWELL) can be butted for different voltage devices as the potential is same. : 0.36µm") |
| df3a_l1.forget |
| |
| df_3b_same_well = ncomp.inside(nwell).not_outside(pcomp.inside(nwell)).or(ncomp.inside(lvpwell).not_outside(pcomp.inside(lvpwell))) |
| df_3b_moscap = ncomp.inside(nwell).interacting(pcomp.inside(nwell)).or(ncomp.inside(lvpwell).interacting(pcomp.inside(lvpwell))).inside(mos_cap_mk) |
| # Rule DF.3b_3.3V: Min./Max. NCOMP Space to PCOMP in the same well for butted COMP (MOSCAP butting is not allowed). |
| logger.info("Executing rule DF.3b_3.3V") |
| df3b_l1 = df_3b_same_well.or(df_3b_moscap).not_interacting(v5_xtor).not_interacting(dualgate) |
| df3b_l1.output("DF.3b_3.3V", "DF.3b_3.3V : Min./Max. NCOMP Space to PCOMP in the same well for butted COMP (MOSCAP butting is not allowed).") |
| df3b_l1.forget |
| |
| # Rule DF.3b_5V: Min./Max. NCOMP Space to PCOMP in the same well for butted COMP(MOSCAP butting is not allowed). |
| logger.info("Executing rule DF.3b_5V") |
| df3b_l1 = df_3b_same_well.or(df_3b_moscap).overlapping(dualgate) |
| df3b_l1.output("DF.3b_5V", "DF.3b_5V : Min./Max. NCOMP Space to PCOMP in the same well for butted COMP(MOSCAP butting is not allowed).") |
| df3b_l1.forget |
| |
| df_3b_same_well.forget |
| |
| df_3b_moscap.forget |
| |
| # Rule DF.3c_3.3V: Min. COMP Space in BJT area (area marked by DRC_BJT layer). is 0.32µm |
| logger.info("Executing rule DF.3c_3.3V") |
| df3c_l1 = comp.inside(drc_bjt).space(0.32.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df3c_l1.output("DF.3c_3.3V", "DF.3c_3.3V : Min. COMP Space in BJT area (area marked by DRC_BJT layer). : 0.32µm") |
| df3c_l1.forget |
| |
| # Rule DF.3c_5V: Min. COMP Space in BJT area (area marked by DRC_BJT layer) hasn’t been assessed. |
| logger.info("Executing rule DF.3c_5V") |
| df3c_l1 = comp.interacting(comp.inside(drc_bjt).and(dualgate).space(10.um, euclidian).polygons(0.001)) |
| df3c_l1.output("DF.3c_5V", "DF.3c_5V : Min. COMP Space in BJT area (area marked by DRC_BJT layer) hasn’t been assessed.") |
| df3c_l1.forget |
| |
| ntap_dnwell = ncomp.not_interacting(tgate).inside(dnwell) |
| # Rule DF.4a_3.3V: Min. (LVPWELL Space to NCOMP well tap) inside DNWELL. is 0.12µm |
| logger.info("Executing rule DF.4a_3.3V") |
| df4a_l1 = ntap_dnwell.separation(lvpwell.inside(dnwell), 0.12.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df4a_l1.output("DF.4a_3.3V", "DF.4a_3.3V : Min. (LVPWELL Space to NCOMP well tap) inside DNWELL. : 0.12µm") |
| df4a_l1.forget |
| |
| # Rule DF.4a_5V: Min. (LVPWELL Space to NCOMP well tap) inside DNWELL. is 0.16µm |
| logger.info("Executing rule DF.4a_5V") |
| df4a_l1 = ntap_dnwell.separation(lvpwell.inside(dnwell), 0.16.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df4a_l1.output("DF.4a_5V", "DF.4a_5V : Min. (LVPWELL Space to NCOMP well tap) inside DNWELL. : 0.16µm") |
| df4a_l1.forget |
| |
| # Rule DF.4b_3.3V: Min. DNWELL overlap of NCOMP well tap. is 0.62µm |
| logger.info("Executing rule DF.4b_3.3V") |
| df4b_l1 = dnwell.enclosing(ncomp.not_interacting(tgate), 0.62.um, euclidian).polygons(0.001) |
| df4b_l2 = ncomp.not_interacting(tgate).not_outside(dnwell).not(dnwell) |
| df4b_l = df4b_l1.or(df4b_l2).not_interacting(v5_xtor).not_interacting(dualgate) |
| df4b_l.output("DF.4b_3.3V", "DF.4b_3.3V : Min. DNWELL overlap of NCOMP well tap. : 0.62µm") |
| df4b_l1.forget |
| df4b_l2.forget |
| df4b_l.forget |
| |
| # Rule DF.4b_5V: Min. DNWELL overlap of NCOMP well tap. is 0.66µm |
| logger.info("Executing rule DF.4b_5V") |
| df4b_l1 = dnwell.enclosing(ncomp.not_interacting(tgate), 0.66.um, euclidian).polygons(0.001) |
| df4b_l2 = ncomp.not_interacting(tgate).not_outside(dnwell).not(dnwell) |
| df4b_l = df4b_l1.or(df4b_l2).overlapping(dualgate) |
| df4b_l.output("DF.4b_5V", "DF.4b_5V : Min. DNWELL overlap of NCOMP well tap. : 0.66µm") |
| df4b_l1.forget |
| df4b_l2.forget |
| df4b_l.forget |
| |
| ntap_dnwell.forget |
| |
| nwell_n_dnwell = nwell.outside(dnwell) |
| # Rule DF.4c_3.3V: Min. (Nwell overlap of PCOMP) outside DNWELL. is 0.43µm |
| logger.info("Executing rule DF.4c_3.3V") |
| df4c_l1 = nwell_n_dnwell.outside(sramcore).enclosing(pcomp.outside(dnwell), 0.43.um, euclidian).polygons(0.001) |
| df4c_l2 = pcomp.outside(dnwell).not_outside(nwell_n_dnwell.outside(sramcore)).not(nwell_n_dnwell.outside(sramcore)) |
| df4c_l = df4c_l1.or(df4c_l2).not_interacting(v5_xtor).not_interacting(dualgate) |
| df4c_l.output("DF.4c_3.3V", "DF.4c_3.3V : Min. (Nwell overlap of PCOMP) outside DNWELL. : 0.43µm") |
| df4c_l1.forget |
| df4c_l2.forget |
| df4c_l.forget |
| |
| # Rule DF.4c_5V: Min. (Nwell overlap of PCOMP) outside DNWELL. is 0.6µm |
| logger.info("Executing rule DF.4c_5V") |
| df4c_l1 = nwell_n_dnwell.outside(sramcore).enclosing(pcomp.outside(dnwell), 0.6.um, euclidian).polygons(0.001) |
| df4c_l2 = pcomp.outside(dnwell).not_outside(nwell_n_dnwell.outside(sramcore)).not(nwell_n_dnwell.outside(sramcore)) |
| df4c_l = df4c_l1.or(df4c_l2).overlapping(dualgate) |
| df4c_l.output("DF.4c_5V", "DF.4c_5V : Min. (Nwell overlap of PCOMP) outside DNWELL. : 0.6µm") |
| df4c_l1.forget |
| df4c_l2.forget |
| df4c_l.forget |
| |
| # Rule DF.4d_3.3V: Min. (Nwell overlap of NCOMP) outside DNWELL. is 0.12µm |
| logger.info("Executing rule DF.4d_3.3V") |
| df4d_l1 = nwell_n_dnwell.not_inside(ymtp_mk).not_inside(neo_ee_mk).enclosing(ncomp.outside(dnwell).not_inside(ymtp_mk), 0.12.um, euclidian).polygons(0.001) |
| df4d_l2 = ncomp.outside(dnwell).not_inside(ymtp_mk).not_outside(nwell_n_dnwell.not_inside(ymtp_mk).not_inside(neo_ee_mk)).not(nwell_n_dnwell.not_inside(ymtp_mk).not_inside(neo_ee_mk)) |
| df4d_l = df4d_l1.or(df4d_l2).not_interacting(v5_xtor).not_interacting(dualgate) |
| df4d_l.output("DF.4d_3.3V", "DF.4d_3.3V : Min. (Nwell overlap of NCOMP) outside DNWELL. : 0.12µm") |
| df4d_l1.forget |
| df4d_l2.forget |
| df4d_l.forget |
| |
| # Rule DF.4d_5V: Min. (Nwell overlap of NCOMP) outside DNWELL. is 0.16µm |
| logger.info("Executing rule DF.4d_5V") |
| df4d_l1 = nwell_n_dnwell.not_inside(ymtp_mk).enclosing(ncomp.outside(dnwell).not_inside(ymtp_mk), 0.16.um, euclidian).polygons(0.001) |
| df4d_l2 = ncomp.outside(dnwell).not_inside(ymtp_mk).not_outside(nwell_n_dnwell.not_inside(ymtp_mk)).not(nwell_n_dnwell.not_inside(ymtp_mk)) |
| df4d_l = df4d_l1.or(df4d_l2).overlapping(dualgate) |
| df4d_l.output("DF.4d_5V", "DF.4d_5V : Min. (Nwell overlap of NCOMP) outside DNWELL. : 0.16µm") |
| df4d_l1.forget |
| df4d_l2.forget |
| df4d_l.forget |
| |
| nwell_n_dnwell.forget |
| |
| # Rule DF.4e_3.3V: Min. DNWELL overlap of PCOMP. is 0.93µm |
| logger.info("Executing rule DF.4e_3.3V") |
| df4e_l1 = dnwell.enclosing(pcomp, 0.93.um, euclidian).polygons(0.001) |
| df4e_l2 = pcomp.not_outside(dnwell).not(dnwell) |
| df4e_l = df4e_l1.or(df4e_l2).not_interacting(v5_xtor).not_interacting(dualgate) |
| df4e_l.output("DF.4e_3.3V", "DF.4e_3.3V : Min. DNWELL overlap of PCOMP. : 0.93µm") |
| df4e_l1.forget |
| df4e_l2.forget |
| df4e_l.forget |
| |
| # Rule DF.4e_5V: Min. DNWELL overlap of PCOMP. is 1.1µm |
| logger.info("Executing rule DF.4e_5V") |
| df4e_l1 = dnwell.enclosing(pcomp, 1.1.um, euclidian).polygons(0.001) |
| df4e_l2 = pcomp.not_outside(dnwell).not(dnwell) |
| df4e_l = df4e_l1.or(df4e_l2).overlapping(dualgate) |
| df4e_l.output("DF.4e_5V", "DF.4e_5V : Min. DNWELL overlap of PCOMP. : 1.1µm") |
| df4e_l1.forget |
| df4e_l2.forget |
| df4e_l.forget |
| |
| pwell_dnwell = lvpwell.inside(dnwell) |
| # Rule DF.5_3.3V: Min. (LVPWELL overlap of PCOMP well tap) inside DNWELL. is 0.12µm |
| logger.info("Executing rule DF.5_3.3V") |
| df5_l1 = pwell_dnwell.enclosing(pcomp.outside(nwell), 0.12.um, euclidian).polygons(0.001) |
| df5_l2 = pcomp.outside(nwell).not_outside(pwell_dnwell).not(pwell_dnwell) |
| df5_l = df5_l1.or(df5_l2).not_interacting(v5_xtor).not_interacting(dualgate) |
| df5_l.output("DF.5_3.3V", "DF.5_3.3V : Min. (LVPWELL overlap of PCOMP well tap) inside DNWELL. : 0.12µm") |
| df5_l1.forget |
| df5_l2.forget |
| df5_l.forget |
| |
| # Rule DF.5_5V: Min. (LVPWELL overlap of PCOMP well tap) inside DNWELL. is 0.16µm |
| logger.info("Executing rule DF.5_5V") |
| df5_l1 = pwell_dnwell.enclosing(pcomp.outside(nwell), 0.16.um, euclidian).polygons(0.001) |
| df5_l2 = pcomp.outside(nwell).not_outside(pwell_dnwell).not(pwell_dnwell) |
| df5_l = df5_l1.or(df5_l2).overlapping(dualgate) |
| df5_l.output("DF.5_5V", "DF.5_5V : Min. (LVPWELL overlap of PCOMP well tap) inside DNWELL. : 0.16µm") |
| df5_l1.forget |
| df5_l2.forget |
| df5_l.forget |
| |
| # Rule DF.6_3.3V: Min. COMP extend beyond gate (it also means source/drain overhang). is 0.24µm |
| logger.info("Executing rule DF.6_3.3V") |
| df6_l1 = comp.not(otp_mk).not_inside(ymtp_mk).enclosing(poly2.not_inside(ymtp_mk), 0.24.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df6_l1.output("DF.6_3.3V", "DF.6_3.3V : Min. COMP extend beyond gate (it also means source/drain overhang). : 0.24µm") |
| df6_l1.forget |
| |
| # Rule DF.6_5V: Min. COMP extend beyond gate (it also means source/drain overhang). is 0.4µm |
| logger.info("Executing rule DF.6_5V") |
| df6_l1 = comp.not(otp_mk).not_inside(mvpsd).not_inside(mvsd).not_inside(ymtp_mk).outside(sramcore).enclosing(poly2.not_inside(ymtp_mk), 0.4.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df6_l1.output("DF.6_5V", "DF.6_5V : Min. COMP extend beyond gate (it also means source/drain overhang). : 0.4µm") |
| df6_l1.forget |
| |
| # Rule DF.7_3.3V: Min. (LVPWELL Spacer to PCOMP) inside DNWELL. is 0.43µm |
| logger.info("Executing rule DF.7_3.3V") |
| df7_l1 = pcomp.inside(dnwell).separation(pwell_dnwell, 0.43.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df7_l1.output("DF.7_3.3V", "DF.7_3.3V : Min. (LVPWELL Spacer to PCOMP) inside DNWELL. : 0.43µm") |
| df7_l1.forget |
| |
| # Rule DF.7_5V: Min. (LVPWELL Spacer to PCOMP) inside DNWELL. is 0.6µm |
| logger.info("Executing rule DF.7_5V") |
| df7_l1 = pcomp.inside(dnwell).outside(sramcore).separation(pwell_dnwell, 0.6.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df7_l1.output("DF.7_5V", "DF.7_5V : Min. (LVPWELL Spacer to PCOMP) inside DNWELL. : 0.6µm") |
| df7_l1.forget |
| |
| # Rule DF.8_3.3V: Min. (LVPWELL overlap of NCOMP) Inside DNWELL. is 0.43µm |
| logger.info("Executing rule DF.8_3.3V") |
| df8_l1 = pwell_dnwell.enclosing(ncomp.inside(dnwell), 0.43.um, euclidian).polygons(0.001) |
| df8_l2 = ncomp.inside(dnwell).not_outside(pwell_dnwell).not(pwell_dnwell) |
| df8_l = df8_l1.or(df8_l2).not_interacting(v5_xtor).not_interacting(dualgate) |
| df8_l.output("DF.8_3.3V", "DF.8_3.3V : Min. (LVPWELL overlap of NCOMP) Inside DNWELL. : 0.43µm") |
| df8_l1.forget |
| df8_l2.forget |
| df8_l.forget |
| |
| # Rule DF.8_5V: Min. (LVPWELL overlap of NCOMP) Inside DNWELL. is 0.6µm |
| logger.info("Executing rule DF.8_5V") |
| df8_l1 = pwell_dnwell.outside(sramcore).enclosing(ncomp.inside(dnwell), 0.6.um, euclidian).polygons(0.001) |
| df8_l2 = ncomp.inside(dnwell).not_outside(pwell_dnwell.outside(sramcore)).not(pwell_dnwell.outside(sramcore)) |
| df8_l = df8_l1.or(df8_l2).overlapping(dualgate) |
| df8_l.output("DF.8_5V", "DF.8_5V : Min. (LVPWELL overlap of NCOMP) Inside DNWELL. : 0.6µm") |
| df8_l1.forget |
| df8_l2.forget |
| df8_l.forget |
| |
| pwell_dnwell.forget |
| |
| # Rule DF.9_3.3V: Min. COMP area (um2). is 0.2025µm² |
| logger.info("Executing rule DF.9_3.3V") |
| df9_l1 = comp.not(otp_mk).with_area(nil, 0.2025.um).not_interacting(v5_xtor).not_interacting(dualgate) |
| df9_l1.output("DF.9_3.3V", "DF.9_3.3V : Min. COMP area (um2). : 0.2025µm²") |
| df9_l1.forget |
| |
| # Rule DF.9_5V: Min. COMP area (um2). is 0.2025µm² |
| logger.info("Executing rule DF.9_5V") |
| df9_l1 = comp.not(otp_mk).with_area(nil, 0.2025.um).overlapping(dualgate) |
| df9_l1.output("DF.9_5V", "DF.9_5V : Min. COMP area (um2). : 0.2025µm²") |
| df9_l1.forget |
| |
| # Rule DF.10_3.3V: Min. field area (um2). is 0.26µm² |
| logger.info("Executing rule DF.10_3.3V") |
| df10_l1 = comp.holes.not(comp).with_area(nil, 0.26.um).not_interacting(v5_xtor).not_interacting(dualgate) |
| df10_l1.output("DF.10_3.3V", "DF.10_3.3V : Min. field area (um2). : 0.26µm²") |
| df10_l1.forget |
| |
| # Rule DF.10_5V: Min. field area (um2). is 0.26µm² |
| logger.info("Executing rule DF.10_5V") |
| df10_l1 = comp.holes.not(comp).with_area(nil, 0.26.um).overlapping(dualgate) |
| df10_l1.output("DF.10_5V", "DF.10_5V : Min. field area (um2). : 0.26µm²") |
| df10_l1.forget |
| |
| comp_butt = comp.interacting(ncomp.interacting(pcomp).outside(pcomp)) |
| # Rule DF.11_3.3V: Min. Length of butting COMP edge. is 0.3µm |
| logger.info("Executing rule DF.11_3.3V") |
| df11_l1 = comp_butt.width(0.3.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df11_l1.output("DF.11_3.3V", "DF.11_3.3V : Min. Length of butting COMP edge. : 0.3µm") |
| df11_l1.forget |
| |
| # Rule DF.11_5V: Min. Length of butting COMP edge. is 0.3µm |
| logger.info("Executing rule DF.11_5V") |
| df11_l1 = comp_butt.width(0.3.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df11_l1.output("DF.11_5V", "DF.11_5V : Min. Length of butting COMP edge. : 0.3µm") |
| df11_l1.forget |
| |
| comp_butt.forget |
| |
| # Rule DF.12_3.3V: COMP not covered by Nplus or Pplus is forbidden (except those COMP under marking). |
| logger.info("Executing rule DF.12_3.3V") |
| df12_l1 = comp.not_interacting(schottky_diode).not_inside(nplus.or(pplus)).not_interacting(v5_xtor).not_interacting(dualgate) |
| df12_l1.output("DF.12_3.3V", "DF.12_3.3V : COMP not covered by Nplus or Pplus is forbidden (except those COMP under marking).") |
| df12_l1.forget |
| |
| # Rule DF.12_5V: COMP not covered by Nplus or Pplus is forbidden (except those COMP under marking). |
| logger.info("Executing rule DF.12_5V") |
| df12_l1 = comp.not_interacting(schottky_diode).not_inside(nplus.or(pplus)).overlapping(dualgate) |
| df12_l1.output("DF.12_5V", "DF.12_5V : COMP not covered by Nplus or Pplus is forbidden (except those COMP under marking).") |
| df12_l1.forget |
| |
| df13_ncomp = ncomp.inside(nwell.covering(ncomp).covering(pcomp)) |
| df13_pcomp = pcomp.inside(nwell.covering(ncomp).covering(pcomp)) |
| # Rule DF.13_3.3V: Max distance of Nwell tap (NCOMP inside Nwell) from (PCOMP inside Nwell). |
| logger.info("Executing rule DF.13_3.3V") |
| df13_l1 = df13_ncomp.not_interacting(df13_pcomp.sized(20.um)).not_interacting(v5_xtor).not_interacting(dualgate) |
| df13_l1.output("DF.13_3.3V", "DF.13_3.3V : Max distance of Nwell tap (NCOMP inside Nwell) from (PCOMP inside Nwell).") |
| df13_l1.forget |
| |
| # Rule DF.13_5V: Max distance of Nwell tap (NCOMP inside Nwell) from (PCOMP inside Nwell). |
| logger.info("Executing rule DF.13_5V") |
| df13_l1 = df13_ncomp.not_interacting(df13_pcomp.sized(15.um)).overlapping(dualgate) |
| df13_l1.output("DF.13_5V", "DF.13_5V : Max distance of Nwell tap (NCOMP inside Nwell) from (PCOMP inside Nwell).") |
| df13_l1.forget |
| |
| df13_ncomp.forget |
| |
| df13_pcomp.forget |
| |
| # Rule DF.14_3.3V: Max distance of substrate tap (PCOMP outside Nwell) from (NCOMP outside Nwell). |
| logger.info("Executing rule DF.14_3.3V") |
| df14_l1 = pcomp.outside(nwell).not_interacting(ncomp.outside(nwell).sized(20.um)).not_interacting(v5_xtor).not_interacting(dualgate) |
| df14_l1.output("DF.14_3.3V", "DF.14_3.3V : Max distance of substrate tap (PCOMP outside Nwell) from (NCOMP outside Nwell).") |
| df14_l1.forget |
| |
| # Rule DF.14_5V: Max distance of substrate tap (PCOMP outside Nwell) from (NCOMP outside Nwell). |
| logger.info("Executing rule DF.14_5V") |
| df14_l1 = pcomp.outside(nwell).not_interacting(ncomp.outside(nwell).sized(15.um)).overlapping(dualgate) |
| df14_l1.output("DF.14_5V", "DF.14_5V : Max distance of substrate tap (PCOMP outside Nwell) from (NCOMP outside Nwell).") |
| df14_l1.forget |
| |
| # rule DF.15a_3.3V is not a DRC check |
| |
| # rule DF.15a_5V is not a DRC check |
| |
| # rule DF.15b_3.3V is not a DRC check |
| |
| # rule DF.15b_5V is not a DRC check |
| |
| ncomp_df16 = ncomp.outside(nwell).outside(dnwell) |
| # Rule DF.16_3.3V: Min. space from (Nwell outside DNWELL) to (NCOMP outside Nwell and DNWELL). is 0.43µm |
| logger.info("Executing rule DF.16_3.3V") |
| df16_l1 = ncomp_df16.not_inside(ymtp_mk).outside(sramcore).separation(nwell.outside(dnwell).not_inside(ymtp_mk), 0.43.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df16_l1.output("DF.16_3.3V", "DF.16_3.3V : Min. space from (Nwell outside DNWELL) to (NCOMP outside Nwell and DNWELL). : 0.43µm") |
| df16_l1.forget |
| |
| # Rule DF.16_5V: Min. space from (Nwell outside DNWELL) to (NCOMP outside Nwell and DNWELL). is 0.6µm |
| logger.info("Executing rule DF.16_5V") |
| df16_l1 = ncomp_df16.not_inside(ymtp_mk).outside(sramcore).separation(nwell.outside(dnwell).not_inside(ymtp_mk), 0.6.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df16_l1.output("DF.16_5V", "DF.16_5V : Min. space from (Nwell outside DNWELL) to (NCOMP outside Nwell and DNWELL). : 0.6µm") |
| df16_l1.forget |
| |
| pcomp_df17 = pcomp.outside(nwell).outside(dnwell) |
| # Rule DF.17_3.3V: Min. space from (Nwell Outside DNWELL) to (PCOMP outside Nwell and DNWELL). is 0.12µm |
| logger.info("Executing rule DF.17_3.3V") |
| df17_l1 = pcomp_df17.separation(nwell.outside(dnwell), 0.12.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df17_l1.output("DF.17_3.3V", "DF.17_3.3V : Min. space from (Nwell Outside DNWELL) to (PCOMP outside Nwell and DNWELL). : 0.12µm") |
| df17_l1.forget |
| |
| # Rule DF.17_5V: Min. space from (Nwell Outside DNWELL) to (PCOMP outside Nwell and DNWELL). is 0.16µm |
| logger.info("Executing rule DF.17_5V") |
| df17_l1 = pcomp_df17.separation(nwell.outside(dnwell), 0.16.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df17_l1.output("DF.17_5V", "DF.17_5V : Min. space from (Nwell Outside DNWELL) to (PCOMP outside Nwell and DNWELL). : 0.16µm") |
| df17_l1.forget |
| |
| # Rule DF.18_3.3V: Min. DNWELL space to (PCOMP outside Nwell and DNWELL). is 2.5µm |
| logger.info("Executing rule DF.18_3.3V") |
| df18_l1 = pcomp_df17.separation(dnwell, 2.5.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df18_l1.output("DF.18_3.3V", "DF.18_3.3V : Min. DNWELL space to (PCOMP outside Nwell and DNWELL). : 2.5µm") |
| df18_l1.forget |
| |
| # Rule DF.18_5V: Min. DNWELL space to (PCOMP outside Nwell and DNWELL). is 2.5µm |
| logger.info("Executing rule DF.18_5V") |
| df18_l1 = pcomp_df17.separation(dnwell, 2.5.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df18_l1.output("DF.18_5V", "DF.18_5V : Min. DNWELL space to (PCOMP outside Nwell and DNWELL). : 2.5µm") |
| df18_l1.forget |
| |
| pcomp_df17.forget |
| |
| # Rule DF.19_3.3V: Min. DNWELL space to (NCOMP outside Nwell and DNWELL). is 3.2µm |
| logger.info("Executing rule DF.19_3.3V") |
| df19_l1 = ncomp_df16.separation(dnwell, 3.2.um, euclidian).polygons(0.001).not_interacting(v5_xtor).not_interacting(dualgate) |
| df19_l1.output("DF.19_3.3V", "DF.19_3.3V : Min. DNWELL space to (NCOMP outside Nwell and DNWELL). : 3.2µm") |
| df19_l1.forget |
| |
| # Rule DF.19_5V: Min. DNWELL space to (NCOMP outside Nwell and DNWELL). is 3.28µm |
| logger.info("Executing rule DF.19_5V") |
| df19_l1 = ncomp_df16.separation(dnwell, 3.28.um, euclidian).polygons(0.001).overlapping(dualgate) |
| df19_l1.output("DF.19_5V", "DF.19_5V : Min. DNWELL space to (NCOMP outside Nwell and DNWELL). : 3.28µm") |
| df19_l1.forget |
| |
| ncomp_df16.forget |
| end #FEOL |
| |
| ################################################################################################ |
| # Copyright 2022 GlobalFoundries PDK Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| ################################################################################################ |
| |
| |
| |
| exec_end_time = Time.now |
| run_time = exec_end_time - exec_start_time |
| logger.info("%s DRC Total Run time %f seconds" % [table_name, run_time]) |
| |
| |