blob: 237c5a72d30037c6b94459f4e5d2a74b67b10deb [file] [log] [blame]
#=============================================================================================================================================================
#------------------------------------------------------------ GF 0.18um MCU DRC RULE DECK (EFUSE) ------------------------------------------------------------
#=============================================================================================================================================================
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 )
sab = polygons(49 , 0 )
esd = polygons(24 , 0 )
contact = polygons(33 , 0 )
metal1 = polygons(34 , 0 )
metal2 = polygons(36 , 0 )
resistor = polygons(62 , 0 )
lvs_source = polygons(100, 8 )
plfuse = polygons(125, 5 )
efuse_mk = polygons(80 , 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])
#================================================
#---------------------EFUSE----------------------
#================================================
# Rule EF.01: Min. (Poly2 butt PLFUSE) within EFUSE_MK and Pplus.
logger.info("Executing rule EF.01")
ef01_l1 = poly2.or(plfuse).interacting(efuse_mk).not_inside(efuse_mk.and(pplus))
ef01_l1.output("EF.01", "EF.01 : Min. (Poly2 butt PLFUSE) within EFUSE_MK and Pplus.")
ef01_l1.forget
# Rule EF.02: Min. Max. PLFUSE width. is 0.18µm
logger.info("Executing rule EF.02")
ef02_l1 = plfuse.drc(width != 0.18.um).extended(0, 0, 0.001, 0.001)
ef02_l1.output("EF.02", "EF.02 : Min. Max. PLFUSE width. : 0.18µm")
ef02_l1.forget
# Rule EF.03: Min. Max. PLFUSE length. is 1.26µm
logger.info("Executing rule EF.03")
ef03_l1 = plfuse.edges.interacting(poly2.edges.and(plfuse.edges).centers(0, 0.95)).without_length(1.26.um).extended(0, 0, 0.001, 0.001)
ef03_l1.output("EF.03", "EF.03 : Min. Max. PLFUSE length. : 1.26µm")
ef03_l1.forget
# Rule EF.04a: Min. Max. PLFUSE overlap Poly2 (coinciding permitted) and touch cathode and anode.
logger.info("Executing rule EF.04a")
ef04a_l1 = plfuse.not_in(plfuse.interacting(poly2.not(plfuse), 2, 2)).inside(efuse_mk).or(plfuse.not(poly2).inside(efuse_mk))
ef04a_l1.output("EF.04a", "EF.04a : Min. Max. PLFUSE overlap Poly2 (coinciding permitted) and touch cathode and anode.")
ef04a_l1.forget
# Rule EF.04b: PLFUSE must be rectangular. is -µm
logger.info("Executing rule EF.04b")
ef04b_l1 = plfuse.non_rectangles
ef04b_l1.output("EF.04b", "EF.04b : PLFUSE must be rectangular. : -µm")
ef04b_l1.forget
cathode = poly2.inside(efuse_mk).not(lvs_source.or(plfuse))
# Rule EF.04c: Cathode Poly2 must be rectangular. is -µm
logger.info("Executing rule EF.04c")
ef04c_l1 = cathode.non_rectangles
ef04c_l1.output("EF.04c", "EF.04c : Cathode Poly2 must be rectangular. : -µm")
ef04c_l1.forget
anode = poly2.and(lvs_source).inside(efuse_mk)
# Rule EF.04d: Anode Poly2 must be rectangular. is -µm
logger.info("Executing rule EF.04d")
ef04d_l1 = anode.non_rectangles
ef04d_l1.output("EF.04d", "EF.04d : Anode Poly2 must be rectangular. : -µm")
ef04d_l1.forget
# Rule EF.05: Min./Max. LVS_Source overlap Poly2 (at Anode).
logger.info("Executing rule EF.05")
ef05_l1 = poly2.not(plfuse).interacting(lvs_source).not(lvs_source).inside(efuse_mk).or(lvs_source.not(poly2).inside(efuse_mk))
ef05_l1.output("EF.05", "EF.05 : Min./Max. LVS_Source overlap Poly2 (at Anode).")
ef05_l1.forget
cathode_width = cathode.edges.not_interacting(cathode.edges.interacting(plfuse)).or(cathode.edges.interacting(plfuse))
# Rule EF.06: Min./Max. Cathode Poly2 width. is 2.26µm
logger.info("Executing rule EF.06")
ef06_l1 = cathode_width.without_length(2.26.um).extended(0, 0, 0.001, 0.001)
ef06_l1.output("EF.06", "EF.06 : Min./Max. Cathode Poly2 width. : 2.26µm")
ef06_l1.forget
# Rule EF.07: Min./Max. Cathode Poly2 length. is 1.84µm
logger.info("Executing rule EF.07")
ef07_l1 = cathode.edges.not(cathode_width).without_length(1.84.um).extended(0, 0, 0.001, 0.001)
ef07_l1.output("EF.07", "EF.07 : Min./Max. Cathode Poly2 length. : 1.84µm")
ef07_l1.forget
anode_width = anode.edges.not_interacting(anode.edges.interacting(plfuse)).or(anode.edges.interacting(plfuse))
# Rule EF.08: Min./Max. Anode Poly2 width. is 1.06µm
logger.info("Executing rule EF.08")
ef08_l1 = anode_width.without_length(1.06.um).extended(0, 0, 0.001, 0.001)
ef08_l1.output("EF.08", "EF.08 : Min./Max. Anode Poly2 width. : 1.06µm")
ef08_l1.forget
# Rule EF.09: Min./Max. Anode Poly2 length. is 2.43µm
logger.info("Executing rule EF.09")
ef09_l1 = anode.edges.not(anode_width).without_length(2.43.um).extended(0, 0, 0.001, 0.001)
ef09_l1.output("EF.09", "EF.09 : Min./Max. Anode Poly2 length. : 2.43µm")
ef09_l1.forget
# Rule EF.10: Min. Cathode Poly2 to Poly2 space. is 0.26µm
logger.info("Executing rule EF.10")
ef10_l1 = cathode.space(0.26.um, euclidian).polygons(0.001)
ef10_l1.output("EF.10", "EF.10 : Min. Cathode Poly2 to Poly2 space. : 0.26µm")
ef10_l1.forget
# Rule EF.11: Min. Anode Poly2 to Poly2 space. is 0.26µm
logger.info("Executing rule EF.11")
ef11_l1 = anode.space(0.26.um, euclidian).polygons(0.001)
ef11_l1.output("EF.11", "EF.11 : Min. Anode Poly2 to Poly2 space. : 0.26µm")
ef11_l1.forget
cont_ef = contact.and(plfuse.inside(efuse_mk))
# Rule EF.12: Min. Space of Cathode Contact to PLFUSE end.
logger.info("Executing rule EF.12")
ef12_l1 = plfuse.inside(efuse_mk).separation(contact.inside(cathode), 0.155.um).polygons(0.001).or(cont_ef)
ef12_l1.output("EF.12", "EF.12 : Min. Space of Cathode Contact to PLFUSE end.")
ef12_l1.forget
# Rule EF.13: Min. Space of Anode Contact to PLFUSE end.
logger.info("Executing rule EF.13")
ef13_l1 = plfuse.inside(efuse_mk).separation(contact.inside(anode), 0.14.um).polygons(0.001).or(cont_ef)
ef13_l1.output("EF.13", "EF.13 : Min. Space of Anode Contact to PLFUSE end.")
ef13_l1.forget
cont_ef.forget
# Rule EF.14: Min. EFUSE_MK enclose LVS_Source.
logger.info("Executing rule EF.14")
ef14_l1 = lvs_source.not_outside(efuse_mk).not(efuse_mk)
ef14_l1.output("EF.14", "EF.14 : Min. EFUSE_MK enclose LVS_Source.")
ef14_l1.forget
# Rule EF.15: NO Contact is allowed to touch PLFUSE.
logger.info("Executing rule EF.15")
ef15_l1 = plfuse.interacting(contact)
ef15_l1.output("EF.15", "EF.15 : NO Contact is allowed to touch PLFUSE.")
ef15_l1.forget
# Rule EF.16a: Cathode must contain exact number of Contacts at each ends. is 4µm
logger.info("Executing rule EF.16a")
ef16a_l1 = cathode.not_covering(contact, 4, 4)
ef16a_l1.output("EF.16a", "EF.16a : Cathode must contain exact number of Contacts at each ends. : 4µm")
ef16a_l1.forget
# Rule EF.16b: Anode must contain exact number of Contacts at each ends. is 4µm
logger.info("Executing rule EF.16b")
ef16b_l1 = anode.not_covering(contact, 4, 4)
ef16b_l1.output("EF.16b", "EF.16b : Anode must contain exact number of Contacts at each ends. : 4µm")
ef16b_l1.forget
# Rule EF.17: Min. Space of EFUSE_MK to EFUSE_MK. is 0.26µm
logger.info("Executing rule EF.17")
ef17_l1 = efuse_mk.space(0.26.um, euclidian).polygons(0.001)
ef17_l1.output("EF.17", "EF.17 : Min. Space of EFUSE_MK to EFUSE_MK. : 0.26µm")
ef17_l1.forget
# Rule EF.18: PLFUSE must sit on field oxide (NOT COMP), no cross with any COMP, Nplus, Pplus, ESD, SAB, Resistor, Metal1, Metal2.
logger.info("Executing rule EF.18")
ef18_l1 = plfuse.not_outside(comp.or(nplus).or(esd).or(sab).or(resistor).or(metal1).or(metal2))
ef18_l1.output("EF.18", "EF.18 : PLFUSE must sit on field oxide (NOT COMP), no cross with any COMP, Nplus, Pplus, ESD, SAB, Resistor, Metal1, Metal2.")
ef18_l1.forget
# Rule EF.19: Min. PLFUSE space to Metal1, Metal2.
logger.info("Executing rule EF.19")
ef19_l1 = plfuse.not_outside(metal1.or(metal2))
ef19_l1.output("EF.19", "EF.19 : Min. PLFUSE space to Metal1, Metal2.")
ef19_l1.forget
# Rule EF.20: Min. PLFUSE space to COMP, Nplus, Pplus, Resistor, ESD, SAB. is 2.73µm
logger.info("Executing rule EF.20")
ef20_l1 = plfuse.separation(comp.or(nplus).or(esd).or(sab).or(resistor), 2.73.um, euclidian).polygons(0.001)
ef20_l1.output("EF.20", "EF.20 : Min. PLFUSE space to COMP, Nplus, Pplus, Resistor, ESD, SAB. : 2.73µm")
ef20_l1.forget
ef_21_fuse = poly2.interacting(plfuse).inside(efuse_mk.and(pplus)).extents.edges
ef_21_anode = anode.edges.not_interacting(anode.edges.interacting(plfuse))
ef_21_cathode = cathode.edges.not_interacting(cathode.edges.interacting(plfuse))
# Rule EF.21: Min./Max. eFUSE Poly2 length. is 5.53µm
logger.info("Executing rule EF.21")
ef21_l1 = ef_21_fuse.not_interacting(ef_21_anode.or(ef_21_cathode).centers(0, 0.95)).without_length(5.53.um).extended(0, 0, 0.001, 0.001)
ef21_l1.output("EF.21", "EF.21 : Min./Max. eFUSE Poly2 length. : 5.53µm")
ef21_l1.forget
ef_21_fuse.forget
ef_21_anode.forget
ef_21_cathode.forget
# Rule EF.22a: Min./Max. Cathode Poly2 overlap with PLFUSE in width direction. is 1.04µm
logger.info("Executing rule EF.22a")
ef22a_l1 = cathode.edges.interacting(plfuse).not(plfuse.edges).without_length(1.04.um).extended(0, 0, 0.001, 0.001)
ef22a_l1.output("EF.22a", "EF.22a : Min./Max. Cathode Poly2 overlap with PLFUSE in width direction. : 1.04µm")
ef22a_l1.forget
# Rule EF.22b: Min./Max. Anode Poly2 overlap with PLFUSE in width direction. is 0.44µm
logger.info("Executing rule EF.22b")
ef22b_l1 = anode.edges.interacting(plfuse).not(plfuse.edges).without_length(0.44.um).extended(0, 0, 0.001, 0.001)
ef22b_l1.output("EF.22b", "EF.22b : Min./Max. Anode Poly2 overlap with PLFUSE in width direction. : 0.44µm")
ef22b_l1.forget
exec_end_time = Time.now
run_time = exec_end_time - exec_start_time
logger.info("DRC Run time %f seconds" % [run_time])