| ################################################################################################ |
| # 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 BCDLite 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_018BCDLite.drc -rd input=design.gds -rd report=gp180_drc.lyrdb |
| |
| logger.info("Starting running GF180BCDLite 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 |
| |
| logger.info("Loading database to memory is complete.") |
| |
| if $report |
| logger.info("GF180BCDLite Klayout DRC runset output at: %s" % [$report]) |
| report("DRC Run Report at", $report) |
| else |
| logger.info("GF180BCDLite 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]) |
| |
| if $tanres_option |
| TANRES_OPTION = $tanres_option |
| else |
| TANRES_OPTION = "B" |
| end |
| |
| logger.info("TANRES Option selected %s" % [TANRES_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.") |
| |
| comp = polygons(22 , 0 ).merged |
| count = comp.count() |
| logger.info("comp has %d polygons" % [count]) |
| polygons_count += count |
| |
| dnwell = polygons(12 , 0 ).merged |
| count = dnwell.count() |
| logger.info("dnwell has %d polygons" % [count]) |
| polygons_count += count |
| |
| nwell = polygons(21 , 0 ).merged |
| count = nwell.count() |
| logger.info("nwell has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvpwell = polygons(204, 0 ).merged |
| count = lvpwell.count() |
| logger.info("lvpwell has %d polygons" % [count]) |
| polygons_count += count |
| |
| hvnddd = polygons(202, 0 ).merged |
| count = hvnddd.count() |
| logger.info("hvnddd has %d polygons" % [count]) |
| polygons_count += count |
| |
| hvpddd = polygons(197, 0 ).merged |
| count = hvpddd.count() |
| logger.info("hvpddd has %d polygons" % [count]) |
| polygons_count += count |
| |
| dualgate2_d = polygons(144 , 1 ).merged |
| count = dualgate2_d.count() |
| logger.info("dualgate2_d has %d polygons" % [count]) |
| polygons_count += count |
| |
| poly2 = polygons(30 , 0 ).merged |
| count = poly2.count() |
| logger.info("poly2 has %d polygons" % [count]) |
| polygons_count += count |
| |
| nplus = polygons(32 , 0 ).merged |
| count = nplus.count() |
| logger.info("nplus has %d polygons" % [count]) |
| polygons_count += count |
| |
| pplus = polygons(31 , 0 ).merged |
| count = pplus.count() |
| logger.info("pplus has %d polygons" % [count]) |
| polygons_count += count |
| |
| sab = polygons(49 , 0 ).merged |
| count = sab.count() |
| logger.info("sab has %d polygons" % [count]) |
| polygons_count += count |
| |
| esd = polygons(24 , 0 ).merged |
| count = esd.count() |
| logger.info("esd has %d polygons" % [count]) |
| polygons_count += count |
| |
| resistor = polygons(62 , 0 ).merged |
| count = resistor.count() |
| logger.info("resistor has %d polygons" % [count]) |
| polygons_count += count |
| |
| fhres = polygons(227, 0 ).merged |
| count = fhres.count() |
| logger.info("fhres has %d polygons" % [count]) |
| polygons_count += count |
| |
| fusetop = polygons(75 , 0 ).merged |
| count = fusetop.count() |
| logger.info("fusetop has %d polygons" % [count]) |
| polygons_count += count |
| |
| fusewindow_d = polygons(96 , 1 ).merged |
| count = fusewindow_d.count() |
| logger.info("fusewindow_d has %d polygons" % [count]) |
| polygons_count += count |
| |
| polyfuse = polygons(220, 0 ).merged |
| count = polyfuse.count() |
| logger.info("polyfuse has %d polygons" % [count]) |
| polygons_count += count |
| |
| mvsd = polygons(210, 0 ).merged |
| count = mvsd.count() |
| logger.info("mvsd has %d polygons" % [count]) |
| polygons_count += count |
| |
| mvpsd = polygons(11 , 39).merged |
| count = mvpsd.count() |
| logger.info("mvpsd has %d polygons" % [count]) |
| polygons_count += count |
| |
| nat = polygons(5 , 0 ).merged |
| count = nat.count() |
| logger.info("nat has %d polygons" % [count]) |
| polygons_count += count |
| |
| comp_dummy = polygons(22 , 4 ).merged |
| count = comp_dummy.count() |
| logger.info("comp_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| poly2_dummy = polygons(30 , 4 ).merged |
| count = poly2_dummy.count() |
| logger.info("poly2_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| schottky_diode = polygons(241, 0 ).merged |
| count = schottky_diode.count() |
| logger.info("schottky_diode has %d polygons" % [count]) |
| polygons_count += count |
| |
| zener = polygons(178, 0 ).merged |
| count = zener.count() |
| logger.info("zener has %d polygons" % [count]) |
| polygons_count += count |
| |
| res_mk = polygons(110, 5 ).merged |
| count = res_mk.count() |
| logger.info("res_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| opc_drc = polygons(124, 5 ).merged |
| count = opc_drc.count() |
| logger.info("opc_drc has %d polygons" % [count]) |
| polygons_count += count |
| |
| ndmy = polygons(111, 5 ).merged |
| count = ndmy.count() |
| logger.info("ndmy has %d polygons" % [count]) |
| polygons_count += count |
| |
| pmndmy = polygons(152, 5 ).merged |
| count = pmndmy.count() |
| logger.info("pmndmy has %d polygons" % [count]) |
| polygons_count += count |
| |
| v5_xtor = polygons(112, 1 ).merged |
| count = v5_xtor.count() |
| logger.info("v5_xtor has %d polygons" % [count]) |
| polygons_count += count |
| |
| cap_mk = polygons(117, 5 ).merged |
| count = cap_mk.count() |
| logger.info("cap_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mos_cap_mk = polygons(166, 5 ).merged |
| count = mos_cap_mk.count() |
| logger.info("mos_cap_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| ind_mk = polygons(151, 5 ).merged |
| count = ind_mk.count() |
| logger.info("ind_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| diode_mk = polygons(115, 5 ).merged |
| count = diode_mk.count() |
| logger.info("diode_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| drc_bjt = polygons(127, 5 ).merged |
| count = drc_bjt.count() |
| logger.info("drc_bjt has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_bjt = polygons(118, 5 ).merged |
| count = lvs_bjt.count() |
| logger.info("lvs_bjt has %d polygons" % [count]) |
| polygons_count += count |
| |
| mim_l_mk = polygons(117, 10).merged |
| count = mim_l_mk.count() |
| logger.info("mim_l_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| latchup_mk = polygons(137, 5 ).merged |
| count = latchup_mk.count() |
| logger.info("latchup_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| guard_ring_mk = polygons(167, 5 ).merged |
| count = guard_ring_mk.count() |
| logger.info("guard_ring_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| otp_mk = polygons(173, 5 ).merged |
| count = otp_mk.count() |
| logger.info("otp_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mtpmark = polygons(122, 5 ).merged |
| count = mtpmark.count() |
| logger.info("mtpmark has %d polygons" % [count]) |
| polygons_count += count |
| |
| sramcore = polygons(108, 5 ).merged |
| count = sramcore.count() |
| logger.info("sramcore has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_rf = polygons(100, 5 ).merged |
| count = lvs_rf.count() |
| logger.info("lvs_rf has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_drain = polygons(100, 7 ).merged |
| count = lvs_drain.count() |
| logger.info("lvs_drain has %d polygons" % [count]) |
| polygons_count += count |
| |
| hvpolyrs = polygons(123, 5 ).merged |
| count = hvpolyrs.count() |
| logger.info("hvpolyrs has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_io = polygons(119, 5 ).merged |
| count = lvs_io.count() |
| logger.info("lvs_io has %d polygons" % [count]) |
| polygons_count += count |
| |
| probe_mk = polygons(13 , 17).merged |
| count = probe_mk.count() |
| logger.info("probe_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| esd_mk = polygons(24 , 5 ).merged |
| count = esd_mk.count() |
| logger.info("esd_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_source = polygons(100, 8 ).merged |
| count = lvs_source.count() |
| logger.info("lvs_source has %d polygons" % [count]) |
| polygons_count += count |
| |
| well_diode_mk = polygons(153, 51).merged |
| count = well_diode_mk.count() |
| logger.info("well_diode_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| ldmos_xtor = polygons(226, 0 ).merged |
| count = ldmos_xtor.count() |
| logger.info("ldmos_xtor has %d polygons" % [count]) |
| polygons_count += count |
| |
| plfuse = polygons(125, 5 ).merged |
| count = plfuse.count() |
| logger.info("plfuse has %d polygons" % [count]) |
| polygons_count += count |
| |
| efuse_mk = polygons(80 , 5 ).merged |
| count = efuse_mk.count() |
| logger.info("efuse_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| comp_label = polygons(22 , 10).merged |
| count = comp_label.count() |
| logger.info("comp_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| poly2_label = polygons(30 , 10).merged |
| count = poly2_label.count() |
| logger.info("poly2_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| mdiode = polygons(116, 5 ).merged |
| count = mdiode.count() |
| logger.info("mdiode has %d polygons" % [count]) |
| polygons_count += count |
| |
| contact = polygons(33 , 0 ).merged |
| count = contact.count() |
| logger.info("contact has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal1_drawn = polygons(34, 0).merged |
| count = metal1_drawn.count |
| logger.info("metal1_drawn has #{count} polygons") |
| polygons_count += count |
| |
| metal1_dummy = polygons(34, 4).merged |
| count = metal1_dummy.count |
| logger.info("metal1_dummy has #{count} polygons") |
| polygons_count += count |
| |
| metal1 = metal1_drawn + metal1_dummy |
| |
| metal1_label = polygons(34, 10).merged |
| count = metal1_label.count |
| logger.info("metal1_label has #{count} polygons") |
| polygons_count += count |
| |
| metal1_slot = polygons(34, 3).merged |
| count = metal1_slot.count |
| logger.info("metal1_slot has #{count} polygons") |
| polygons_count += count |
| |
| metal1_blk = polygons(34, 5).merged |
| count = metal1_blk.count |
| logger.info("metal1_blk has #{count} polygons") |
| polygons_count += count |
| |
| via1 = polygons(35, 0).merged |
| count = via1.count |
| logger.info("via1 has #{count} polygons") |
| polygons_count += count |
| |
| metal2_drawn = polygons(36, 0).merged |
| count = metal2_drawn.count |
| logger.info("metal2_drawn has #{count} polygons") |
| polygons_count += count |
| |
| metal2_dummy = polygons(36, 4).merged |
| count = metal2_dummy.count |
| logger.info("metal2_dummy has #{count} polygons") |
| polygons_count += count |
| |
| metal2 = metal2_drawn + metal2_dummy |
| |
| metal2_label = polygons(36, 10).merged |
| count = metal2_label.count |
| logger.info("metal2_label has #{count} polygons") |
| polygons_count += count |
| |
| metal2_slot = polygons(36, 3).merged |
| count = metal2_slot.count |
| logger.info("metal2_slot has #{count} polygons") |
| polygons_count += count |
| |
| metal2_blk = polygons(36, 5).merged |
| count = metal2_blk.count |
| logger.info("metal2_blk has #{count} polygons") |
| polygons_count += count |
| |
| if METAL_LEVEL == '2LM' |
| |
| top_via = via1 |
| topmin1_via = contact |
| top_metal = metal2 |
| topmin1_metal = metal1 |
| top_metal_slot = metal2_slot |
| topmin1_metal_slot = metal1_slot |
| |
| else |
| |
| via2 = polygons(38, 0) |
| count = via2.count |
| logger.info("via2 has #{count} polygons") |
| polygons_count += count |
| |
| metal3_drawn = polygons(42, 0) |
| count = metal3_drawn.count |
| logger.info("metal3_drawn has #{count} polygons") |
| polygons_count += count |
| |
| metal3_dummy = polygons(42, 4) |
| count = metal3_dummy.count |
| logger.info("metal3_dummy has #{count} polygons") |
| polygons_count += count |
| |
| metal3 = metal3_drawn + metal3_dummy |
| |
| metal3_label = polygons(42, 10) |
| count = metal3_label.count |
| logger.info("metal3_label has #{count} polygons") |
| polygons_count += count |
| |
| metal3_slot = polygons(42, 3) |
| count = metal3_slot.count |
| logger.info("metal3_slot has #{count} polygons") |
| polygons_count += count |
| |
| metal3_blk = polygons(42, 5) |
| count = metal3_blk.count |
| logger.info("metal3_blk has #{count} polygons") |
| polygons_count += count |
| |
| if METAL_LEVEL == '3LM' |
| |
| top_via = via2 |
| topmin1_via = via1 |
| top_metal = metal3 |
| topmin1_metal = metal2 |
| top_metal_slot = metal3_slot |
| topmin1_metal_slot = metal2_slot |
| else |
| |
| via3 = polygons(40, 0) |
| count = via3.count |
| logger.info("via3 has #{count} polygons") |
| polygons_count += count |
| |
| metal4_drawn = polygons(46, 0) |
| count = metal4_drawn.count |
| logger.info("metal4_drawn has #{count} polygons") |
| polygons_count += count |
| |
| metal4_dummy = polygons(46, 4) |
| count = metal4_dummy.count |
| logger.info("metal4_dummy has #{count} polygons") |
| polygons_count += count |
| |
| metal4 = metal4_drawn + metal4_dummy |
| |
| metal4_label = polygons(46, 10) |
| count = metal4_label.count |
| logger.info("metal4_label has #{count} polygons") |
| polygons_count += count |
| |
| metal4_slot = polygons(46, 3) |
| count = metal4_slot.count |
| logger.info("metal4_slot has #{count} polygons") |
| polygons_count += count |
| |
| metal4_blk = polygons(46, 5) |
| count = metal4_blk.count |
| logger.info("metal4_blk has #{count} polygons") |
| polygons_count += count |
| |
| if METAL_LEVEL == '4LM' |
| |
| top_via = via3 |
| topmin1_via = via2 |
| top_metal = metal4 |
| topmin1_metal = metal3 |
| top_metal_slot = metal4_slot |
| topmin1_metal_slot = metal3_slot |
| else |
| |
| via4 = polygons(41, 0) |
| count = via4.count |
| logger.info("via4 has #{count} polygons") |
| polygons_count += count |
| |
| case METAL_LEVEL |
| when '5LM' |
| metal5_drawn = polygons(81, 0) |
| count = metal5_drawn.count |
| logger.info("metal5_drawn has #{count} polygons") |
| polygons_count += count |
| |
| metal5_dummy = polygons(81, 4) |
| count = metal5_dummy.count |
| logger.info("metal5_dummy has #{count} polygons") |
| polygons_count += count |
| |
| metal5 = metal5_drawn + metal5_dummy |
| |
| metal5_label = polygons(81, 10) |
| count = metal5_label.count |
| logger.info("metal5_label has #{count} polygons") |
| polygons_count += count |
| |
| metal5_slot = polygons(81, 3) |
| count = metal5_slot.count |
| logger.info("metal5_slot has #{count} polygons") |
| polygons_count += count |
| |
| metal5_blk = polygons(81, 5) |
| count = metal5_blk.count |
| logger.info("metal5_blk has #{count} polygons") |
| polygons_count += count |
| |
| top_via = via4 |
| topmin1_via = via3 |
| top_metal = metal5 |
| topmin1_metal = metal4 |
| top_metal_slot = metal5_slot |
| topmin1_metal_slot = metal4_slot |
| when '6LM' |
| metal5_drawn = polygons(81, 0) |
| count = metal5_drawn.count |
| logger.info("metal5_drawn has #{count} polygons") |
| polygons_count += count |
| |
| metal5_dummy = polygons(81, 4) |
| count = metal5_dummy.count |
| logger.info("metal5_dummy has #{count} polygons") |
| polygons_count += count |
| |
| metal5 = metal5_drawn + metal5_dummy |
| |
| metal5_label = polygons(81, 10) |
| count = metal5_label.count |
| logger.info("metal5_label has #{count} polygons") |
| polygons_count += count |
| |
| metal5_slot = polygons(81, 3) |
| count = metal5_slot.count |
| logger.info("metal5_slot has #{count} polygons") |
| polygons_count += count |
| |
| metal5_blk = polygons(81, 5) |
| count = metal5_blk.count |
| logger.info("metal5_blk has #{count} polygons") |
| polygons_count += count |
| |
| via5 = polygons(82, 0) |
| count = via5.count |
| logger.info("via5 has #{count} polygons") |
| polygons_count += count |
| |
| metaltop_drawn = polygons(53, 0) |
| count = metaltop_drawn.count |
| logger.info("metaltop_drawn has #{count} polygons") |
| polygons_count += count |
| |
| metaltop_dummy = polygons(53, 4) |
| count = metaltop_dummy.count |
| logger.info("metaltop_dummy has #{count} polygons") |
| polygons_count += count |
| |
| metaltop = metaltop_drawn + metaltop_dummy |
| |
| metaltop_label = polygons(53, 10) |
| count = metaltop_label.count |
| logger.info("metaltop_label has #{count} polygons") |
| polygons_count += count |
| |
| metaltop_slot = polygons(53, 3) |
| count = metaltop_slot.count |
| logger.info("metaltop_slot has #{count} polygons") |
| polygons_count += count |
| |
| metaltop_blk = polygons(53, 5) |
| count = metaltop_blk.count |
| logger.info("metaltop_blk has #{count} polygons") |
| polygons_count += count |
| |
| top_via = via5 |
| topmin1_via = via4 |
| top_metal = metaltop |
| topmin1_metal = metal5 |
| top_metal_slot = metaltop_slot |
| topmin1_metal_slot = metal5_slot |
| else |
| logger.error("Unknown metal stack #{METAL_LEVEL}") |
| raise |
| end |
| end |
| end |
| end |
| |
| |
| piscap = polygons(120 , 0 ).merged |
| count = piscap.count() |
| logger.info("piscap has %d polygons" % [count]) |
| polygons_count += count |
| |
| pad = polygons(37 , 0 ).merged |
| count = pad.count() |
| logger.info("pad has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmpperi = polygons(183, 0 ).merged |
| count = ubmpperi.count() |
| logger.info("ubmpperi has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmpperi_label = polygons(29, 39 ).merged |
| count = ubmpperi_label.count() |
| logger.info("ubmpperi_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmparray = polygons(184, 0 ).merged |
| count = ubmparray.count() |
| logger.info("ubmparray has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmparray_label = polygons(33, 39 ).merged |
| count = ubmparray_label.count() |
| logger.info("ubmparray_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmeplate = polygons(185, 0 ).merged |
| count = ubmeplate.count() |
| logger.info("ubmeplate has %d polygons" % [count]) |
| polygons_count += count |
| |
| ubmeplate_label = polygons(28, 39 ).merged |
| count = ubmeplate_label.count() |
| logger.info("ubmeplate_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| cu_ppi = polygons(25 , 39).merged |
| count = cu_ppi.count() |
| logger.info("cu_ppi has %d polygons" % [count]) |
| polygons_count += count |
| |
| cu_ppi_blk = polygons(30 , 39).merged |
| count = cu_ppi_blk.count() |
| logger.info("cu_ppi_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| cu_ppi_dummy = polygons(31 , 39).merged |
| count = cu_ppi_dummy.count() |
| logger.info("cu_ppi_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| cu_ppi_label = polygons(32 , 39).merged |
| count = cu_ppi_label.count() |
| logger.info("cu_ppi_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| pm1_ppi = polygons(26 , 39).merged |
| count = pm1_ppi.count() |
| logger.info("pm1_ppi has %d polygons" % [count]) |
| polygons_count += count |
| |
| pm2_ppi = polygons(27 , 39).merged |
| count = pm2_ppi.count() |
| logger.info("pm2_ppi has %d polygons" % [count]) |
| polygons_count += count |
| |
| pm1_bop = polygons(35 , 39).merged |
| count = pm1_bop.count() |
| logger.info("pm1_bop has %d polygons" % [count]) |
| polygons_count += count |
| |
| dni = polygons(78 , 0 ).merged |
| count = dni.count() |
| logger.info("dni has %d polygons" % [count]) |
| polygons_count += count |
| |
| pwhv = polygons(44 , 0 ).merged |
| count = pwhv.count() |
| logger.info("pwhv has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal_shield = polygons(35 , 28).merged |
| count = metal_shield.count() |
| logger.info("metal_shield has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal_shield_slot = polygons(78 , 39).merged |
| count = metal_shield_slot.count() |
| logger.info("metal_shield_slot has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal_shield_dummy = polygons(79 , 39).merged |
| count = metal_shield_dummy.count() |
| logger.info("metal_shield_dummy has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal_shield_label = polygons(68 , 39).merged |
| count = metal_shield_label.count() |
| logger.info("metal_shield_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal_shield_via = polygons(36 , 28).merged |
| count = metal_shield_via.count() |
| logger.info("metal_shield_via has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal_shield_via_label = polygons(69 , 39).merged |
| count = metal_shield_via_label.count() |
| logger.info("metal_shield_via_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| metal_shield_blk = polygons(69 , 39).merged |
| count = metal_shield_blk.count() |
| logger.info("metal_shield_blk has %d polygons" % [count]) |
| polygons_count += count |
| |
| tanres = polygons(222, 0 ).merged |
| count = tanres.count() |
| logger.info("tanres has %d polygons" % [count]) |
| polygons_count += count |
| |
| tanres_mk = polygons(56, 17 ).merged |
| count = tanres_mk.count() |
| logger.info("tanres_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| tanres_label = polygons(222, 10).merged |
| count = tanres_label.count() |
| logger.info("tanres_label has %d polygons" % [count]) |
| polygons_count += count |
| |
| tanres_l_mk = polygons(72, 17 ).merged |
| count = tanres_l_mk.count() |
| logger.info("tanres_l_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| pres_layer = polygons(12, 201).merged |
| count = pres_layer.count() |
| logger.info("pres_layer has %d polygons" % [count]) |
| polygons_count += count |
| |
| cap_mk_type1 = polygons(62, 17 ).merged |
| count = cap_mk_type1.count() |
| logger.info("cap_mk_type1 has %d polygons" % [count]) |
| polygons_count += count |
| |
| cap_mk_type2 = polygons(75, 17 ).merged |
| count = cap_mk_type2.count() |
| logger.info("cap_mk_type2 has %d polygons" % [count]) |
| polygons_count += count |
| |
| mos_mk_type4 = polygons(73, 17 ).merged |
| count = mos_mk_type4.count() |
| logger.info("mos_mk_type4 has %d polygons" % [count]) |
| polygons_count += count |
| |
| mos_source_type1 = polygons(154,51 ).merged |
| count = mos_source_type1.count() |
| logger.info("mos_source_type1 has %d polygons" % [count]) |
| polygons_count += count |
| |
| mk_35v = polygons(25 , 17).merged |
| count = mk_35v.count() |
| logger.info("mk_35v has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_35v = polygons(27 , 17).merged |
| count = lvs_35v.count() |
| logger.info("lvs_35v has %d polygons" % [count]) |
| polygons_count += count |
| |
| elmd_mk = polygons(18 , 17).merged |
| count = elmd_mk.count() |
| logger.info("elmd_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| elmd2_mk = polygons(19 , 17).merged |
| count = elmd2_mk.count() |
| logger.info("elmd2_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mos_mk_type1 = polygons(151, 51).merged |
| count = mos_mk_type1.count() |
| logger.info("mos_mk_type1 has %d polygons" % [count]) |
| polygons_count += count |
| |
| esd_hbm_mk = polygons(37 , 17).merged |
| count = esd_hbm_mk.count() |
| logger.info("esd_hbm_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_psub2 = polygons(23 , 5 ).merged |
| count = lvs_psub2.count() |
| logger.info("lvs_psub2 has %d polygons" % [count]) |
| |
| mv_well_mk = polygons(57 , 17).merged |
| count = mv_well_mk.count() |
| logger.info("mv_well_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mhv_well_mk = polygons(58 , 17).merged |
| count = mhv_well_mk.count() |
| logger.info("mhv_well_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| hv_well_mk = polygons(59 , 17).merged |
| count = hv_well_mk.count() |
| logger.info("hv_well_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mhv_well_mk_type1 = polygons(96 , 17).merged |
| count = mhv_well_mk_type1.count() |
| logger.info("mhv_well_mk_type1 has %d polygons" % [count]) |
| polygons_count += count |
| |
| lvs_donut = polygons(55 , 17).merged |
| count = lvs_donut.count() |
| logger.info("lvs_donut has %d polygons" % [count]) |
| polygons_count += count |
| |
| res_mk_type1 = polygons(26 , 17).merged |
| count = res_mk_type1.count() |
| logger.info("res_mk_type1 has %d polygons" % [count]) |
| polygons_count += count |
| |
| swfet_mk = polygons(69 , 17).merged |
| count = swfet_mk.count() |
| logger.info("swfet_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mom_mk = polygons(51 , 17).merged |
| count = mom_mk.count() |
| logger.info("mom_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mom_m1_mk = polygons(40 , 17).merged |
| count = mom_m1_mk.count() |
| logger.info("mom_m1_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mom_m2_mk = polygons(41 , 17).merged |
| count = mom_m2_mk.count() |
| logger.info("mom_m2_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mom_m3_mk = polygons(42 , 17).merged |
| count = mom_m3_mk.count() |
| logger.info("mom_m3_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mom_m4_mk = polygons(43 , 17).merged |
| count = mom_m4_mk.count() |
| logger.info("mom_m4_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| mom_m5_mk = polygons(44 , 17).merged |
| count = mom_m5_mk.count() |
| logger.info("mom_m5_mk has %d polygons" % [count]) |
| polygons_count += count |
| |
| pr_bndry = polygons(0 , 0 ).merged |
| count = pr_bndry.count() |
| logger.info("pr_bndry has %d polygons" % [count]) |
| polygons_count += count |
| |
| border = polygons(63 , 0 ).merged |
| 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 --------------- |
| #===================================================== |
| |
| dnwell_n = dnwell.not(lvpwell) |
| dnwell_p = dnwell.and(lvpwell) |
| |
| ncomp = comp & nplus |
| pcomp = comp & pplus |
| tgate = poly2 & comp |
| ngate = nplus & tgate |
| pgate = pplus & tgate |
| natcompsd = (nat & comp.interacting(poly2)) - tgate |
| |
| all_nwell = dnwell_n.join(nwell) |
| ntap = ncomp.and(all_nwell).not(res_mk) |
| ptap = pcomp.not(all_nwell).not(res_mk) |
| |
| nom_gate = tgate.not(dualgate2_d) |
| thick_gate = tgate.and(dualgate2_d) |
| |
| ngate_56V = ngate.and(dualgate2_d) |
| pgate_56V = pgate.and(dualgate2_d) |
| |
| 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 GF180BCDLite DRC rules.") |
| if FEOL |
| logger.info("Running all FEOL rules") |
| end #FEOL |
| |
| if BEOL |
| logger.info("Running all BEOL rules") |
| end #BEOL |
| |
| |