blob: 8142221f5db548ca3e4a0c0e4caf4d4767771679 [file] [log] [blame]
#=============================================================================================================================================================
#----------------------------------------------------------- GF 0.18um MCU DRC RULE DECK (CONTACT) -----------------------------------------------------------
#=============================================================================================================================================================
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 gf180mcu.drc -rd input=design.gds -rd report=gf180mcu_main.lyrdb
logger.info("Starting running GF180MCU Klayout DRC runset on %s" % [$input])
if $input
if $topcell
source($input, $topcell)
else
source($input)
end
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").path])
report("DRC Run Report at", File.join(File.dirname(RBA::CellView::active.filename), "gf180_drc.lyrdb"))
end
if $thr
logger.info("Number of threads to use %s" % [$thr])
threads($thr)
else
logger.info("Number of threads to use 16")
threads(16)
end
# === TILING MODE ===
if $run_mode == "tiling"
# use a tile size of 1mm - not used in deep mode-
# tiles(500.um)
# use a tile border of 10 micron:
# tile_borders(10.um)
tiles(1000)
logger.info("Tiling mode is enabled.")
elsif $run_mode == "deep"
#=== HIER MODE ===
deep
logger.info("deep mode is enabled.")
elsif $run_mode == "flat"
#=== FLAT MODE ===
flat
logger.info("flat mode is enabled.")
else
#=== FLAT MODE ===
flat
logger.info("flat mode is enabled.")
end # run_mode
#================================================
#------------- LAYERS DEFINITIONS ---------------
#================================================
v5_xtor = polygons(112, 1 )
dualgate = polygons(55 , 0 )
poly2 = polygons(30 , 0 )
nplus = polygons(32 , 0 )
pplus = polygons(31 , 0 )
comp = polygons(22 , 0 )
contact = polygons(33 , 0 )
metal1 = polygons(34 , 0 )
mvsd = polygons(210, 0 )
mvpsd = polygons(11 , 39)
otp_mk = polygons(173, 5 )
sramcore = polygons(108, 5 )
logger.info("Starting deriving base layers.")
#================================================
#------------- LAYERS DERIVATIONS ---------------
#================================================
ncomp = comp & nplus
pcomp = comp & pplus
tgate = poly2 & comp
ngate = nplus & tgate
pgate = pplus & tgate
#================================================
#------------------ SWITCHES --------------------
#================================================
logger.info("Evaluate switches.")
# 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
# 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
# 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 = "6LM"
end # METAL_LEVEL
logger.info("METAL_STACK Selected is %s" % [METAL_LEVEL])
# 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 = "Nan"
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])
#================================================
#--------------------CONTACT---------------------
#================================================
if FEOL
logger.info("FEOL section")
# Rule CO.1: Min/max contact size. is 0.22µm
logger.info("Executing rule CO.1")
co1_l1 = contact.edges.without_length(0.22.um).extended(0, 0, 0.001, 0.001)
co1_l1.output("CO.1", "CO.1 : Min/max contact size. : 0.22µm")
co1_l1.forget
# Rule CO.2a: min. contact spacing is 0.25µm
logger.info("Executing rule CO.2a")
co2a_l1 = contact.space(0.25.um, euclidian).polygons(0.001)
co2a_l1.output("CO.2a", "CO.2a : min. contact spacing : 0.25µm")
co2a_l1.forget
merged_co1 = contact.sized(0.18.um).sized(-0.18.um).with_bbox_min(1.63.um , nil).extents.inside(metal1)
contact_mask = merged_co1.size(1).not(contact).with_holes(16, nil)
selected_co1 = contact.interacting(contact_mask)
# Rule CO.2b: Space in 4x4 or larger contact array. is 0.28µm
logger.info("Executing rule CO.2b")
co2b_l1 = selected_co1.space(0.28.um, euclidian).polygons(0.001)
co2b_l1.output("CO.2b", "CO.2b : Space in 4x4 or larger contact array. : 0.28µm")
co2b_l1.forget
merged_co1.forget
contact_mask.forget
selected_co1.forget
# Rule CO.3: Poly2 overlap of contact. is 0.07µm
logger.info("Executing rule CO.3")
co3_l1 = poly2.enclosing(contact.outside(sramcore), 0.07.um, euclidian).polygons(0.001)
co3_l2 = contact.outside(sramcore).not_outside(poly2).not(poly2)
co3_l = co3_l1.or(co3_l2)
co3_l.output("CO.3", "CO.3 : Poly2 overlap of contact. : 0.07µm")
co3_l1.forget
co3_l2.forget
co3_l.forget
# Rule CO.4: COMP overlap of contact. is 0.07µm
logger.info("Executing rule CO.4")
co4_l1 = comp.not(mvsd).not(mvpsd).enclosing(contact.outside(sramcore), 0.07.um, euclidian).polygons(0.001)
co4_l2 = contact.outside(sramcore).not_outside(comp.not(mvsd).not(mvpsd)).not(comp.not(mvsd).not(mvpsd))
co4_l = co4_l1.or(co4_l2)
co4_l.output("CO.4", "CO.4 : COMP overlap of contact. : 0.07µm")
co4_l1.forget
co4_l2.forget
co4_l.forget
co_5a_ncomp_butted = ncomp.not(pplus).interacting(pcomp.not(nplus)).not_overlapping(pcomp.not(nplus))
# Rule CO.5a: Nplus overlap of contact on COMP (Only for contacts to butted Nplus and Pplus COMP areas). is 0.1µm
logger.info("Executing rule CO.5a")
co5a_l1 = co_5a_ncomp_butted.enclosing(contact, 0.1.um, euclidian).polygons(0.001)
co5a_l2 = contact.not_outside(co_5a_ncomp_butted).not(co_5a_ncomp_butted)
co5a_l = co5a_l1.or(co5a_l2)
co5a_l.output("CO.5a", "CO.5a : Nplus overlap of contact on COMP (Only for contacts to butted Nplus and Pplus COMP areas). : 0.1µm")
co5a_l1.forget
co5a_l2.forget
co5a_l.forget
co_5a_ncomp_butted.forget
co_5b_pcomp_butted = pcomp.not(nplus).interacting(ncomp.not(pplus)).not_overlapping(ncomp.not(pplus))
# Rule CO.5b: Pplus overlap of contact on COMP (Only for contacts to butted Nplus and Pplus COMP areas). is 0.1µm
logger.info("Executing rule CO.5b")
co5b_l1 = co_5b_pcomp_butted.enclosing(contact, 0.1.um, euclidian).polygons(0.001)
co5b_l2 = contact.not_outside(co_5b_pcomp_butted).not(co_5b_pcomp_butted)
co5b_l = co5b_l1.or(co5b_l2)
co5b_l.output("CO.5b", "CO.5b : Pplus overlap of contact on COMP (Only for contacts to butted Nplus and Pplus COMP areas). : 0.1µm")
co5b_l1.forget
co5b_l2.forget
co5b_l.forget
co_5b_pcomp_butted.forget
# Rule CO.6: Metal1 overlap of contact.
logger.info("Executing rule CO.6")
co6_l1 = metal1.enclosing(contact, 0.005.um, euclidian).polygons(0.001).or(contact.not(metal1))
co6_l1.output("CO.6", "CO.6 : Metal1 overlap of contact.")
co6_l1.forget
cop6a_cond = metal1.drc( width <= 0.34.um).with_length(0.24.um,nil,both)
cop6a_eol = metal1.edges.with_length(nil, 0.34.um).interacting(cop6a_cond.first_edges).interacting(cop6a_cond.second_edges).not(cop6a_cond.first_edges).not(cop6a_cond.second_edges)
# Rule CO.6a: (i) Metal1 (< 0.34um) end-of-line overlap. is 0.06µm
logger.info("Executing rule CO.6a")
co6a_l1 = cop6a_eol.enclosing(contact.edges,0.06.um, projection).polygons(0.001)
co6a_l1.output("CO.6a", "CO.6a : (i) Metal1 (< 0.34um) end-of-line overlap. : 0.06µm")
co6a_l1.forget
cop6a_cond.forget
cop6a_eol.forget
co_6b_1 = contact.edges.interacting(contact.drc(enclosed(metal1, projection) < 0.04.um).edges.centers(0, 0.5))
co_6b_2 = contact.edges.interacting(contact.drc(0.04.um <= enclosed(metal1, projection) < 0.06.um).centers(0, 0.5))
co_6b_3 = co_6b_1.extended(0, 0, 0, 0.001, joined).corners(90)
# Rule CO.6b: (ii) If Metal1 overlaps contact by < 0.04um on one side, adjacent metal1 edges overlap is 0.06µm
logger.info("Executing rule CO.6b")
co6b_l1 = co_6b_2.not_in(co_6b_1).interacting(co_6b_1).or(co_6b_1.interacting(co_6b_3)).not(sramcore).enclosed(metal1.outside(sramcore).edges, 0.06.um).polygons(0.001)
co6b_l1.output("CO.6b", "CO.6b : (ii) If Metal1 overlaps contact by < 0.04um on one side, adjacent metal1 edges overlap : 0.06µm")
co6b_l1.forget
co_6b_1.forget
co_6b_2.forget
co_6b_3.forget
# rule CO.6c is not a DRC check
# Rule CO.7: Space from COMP contact to Poly2 on COMP. is 0.15µm
logger.info("Executing rule CO.7")
co7_l1 = contact.not_outside(comp).not(otp_mk).separation(tgate.not(otp_mk), 0.15.um, euclidian).polygons(0.001)
co7_l1.output("CO.7", "CO.7 : Space from COMP contact to Poly2 on COMP. : 0.15µm")
co7_l1.forget
# Rule CO.8: Space from Poly2 contact to COMP. is 0.17µm
logger.info("Executing rule CO.8")
co8_l1 = contact.not_outside(poly2).separation(comp, 0.17.um, euclidian).polygons(0.001)
co8_l1.output("CO.8", "CO.8 : Space from Poly2 contact to COMP. : 0.17µm")
co8_l1.forget
# Rule CO.9: Contact on NCOMP to PCOMP butting edge is forbidden (contact must not straddle butting edge).
logger.info("Executing rule CO.9")
co9_l1 = contact.interacting(ncomp.edges.and(pcomp.edges))
co9_l1.output("CO.9", "CO.9 : Contact on NCOMP to PCOMP butting edge is forbidden (contact must not straddle butting edge).")
co9_l1.forget
# Rule CO.10: Contact on Poly2 gate over COMP is forbidden.
logger.info("Executing rule CO.10")
co10_l1 = contact.not_outside(tgate)
co10_l1.output("CO.10", "CO.10 : Contact on Poly2 gate over COMP is forbidden.")
co10_l1.forget
# Rule CO.11: Contact on field oxide is forbidden.
logger.info("Executing rule CO.11")
co11_l1 = contact.not(comp.or(poly2))
co11_l1.output("CO.11", "CO.11 : Contact on field oxide is forbidden.")
co11_l1.forget
end #FEOL
if BEOL
logger.info("BEOL section")
end #FEOL
exec_end_time = Time.now
run_time = exec_end_time - exec_start_time
logger.info("DRC Run time %f seconds" % [run_time])