Skip to content

Commit

Permalink
- Fixing all via issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
atorkmabrains committed Dec 11, 2022
1 parent 4d3e036 commit 55b9e8e
Show file tree
Hide file tree
Showing 5 changed files with 462 additions and 391 deletions.
56 changes: 36 additions & 20 deletions rules/klayout/drc/rule_decks/via1.drc
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,33 @@ if BEOL
logger.info("Executing rule V1.3c")
v1p3c_cond = metal1.width(0.34.um + 1.dbu).with_length(0.28.um,nil,both)
v1p3c_eol = metal1.edges.with_length(nil, 0.34.um).interacting(v1p3c_cond.first_edges).interacting(v1p3c_cond.second_edges).not(v1p3c_cond.first_edges).not(v1p3c_cond.second_edges)
v1p3c_eol_extended_in = v1p3c_eol.extended_in(0.06.um - 5.dbu)
v1p3c_eol_extended_in = v1p3c_eol.extended_in(0.06.um - 2.dbu)
v1p3c_l1 = via1.interacting(v1p3c_eol_extended_in)
v1p3c_l1.output("V1.3c", "V1.3c : metal1 (< 0.34um) end-of-line overlap. : 0.06µm")
v1p3c_l1.forget
v1p3c_cond.forget
v1p3c_eol.forget
v1p3c_eol_extended_in.forget

# Rule V1.3d: If metal1 overlap via1 by < 0.04um on one side, adjacent metal1 edges overlap. is 0.06µm

logger.info("Executing rule V1.3d")
via1_3d_cond_metal = metal1.enclosing(via1, 0.04.um, euclidian).polygons(0.005)
via1_3d_cont = via1.interacting(via1_3d_cond_metal)
via1_3d_l1_poss = metal1.enclosing(via1_3d_cont, 0.06.um, projection).polygons(0.005)
via1_3d_l1 = via1_3d_l1_poss.interacting(via1_3d_cond_metal)
via1_3d_l1.output("V1.3d", "V1.3d : If metal1 overlap via1 by < 0.04um on one side, adjacent metal1 edges overlap. : 0.06µm")
via1_3d_cond_metal = metal1.enclosing(via1, 0.04.um, projection).edges.interacting(via1)
via1_3d_check_space = via1.interacting(via1_3d_cond_metal).edges
via1_3d_check_corner = via1_3d_cond_metal.extended_in(0.002.um)
via1_3d_check = via1_3d_check_space.interacting(via1_3d_check_corner).not(via1_3d_cond_metal)
via1_cond_corner = via1_3d_cond_metal.width(0.002.um, angle_limit(135)).polygons
via1_3d_check_ext = via1_3d_check.extended_out(0.06.um - 1.dbu)
bad_ext = via1_3d_check_ext.interacting(via1_3d_check_ext.not(metal1))
via1_3d_l1 = via1.interacting(bad_ext)
via1_3d_l2 = via1.interacting(via1_cond_corner)
via1_3d_l = via1_3d_l1.or(via1_3d_l2)
via1_3d_l.output("V1.3d", "V1.3d : If metal1 overlap via1 by < 0.04um on one side, adjacent metal1 edges overlap. : 0.06µm")
via1_3d_l.forget
via1_3d_l2.forget
via1_3d_l1.forget
via1_3d_l1_poss.forget
via1_3d_cont.forget
bad_ext.forget
via1_cond_corner.forget
via1_3d_check_ext.forget
via1_3d_check.forget
via1_3d_cond_metal.forget

# rule V1.3e is not a DRC check
Expand All @@ -91,24 +100,31 @@ if BEOL
logger.info("Executing rule V1.4b")
v1p4b_cond = metal2.width(0.34.um + 1.dbu).with_length(0.28.um,nil,both)
v1p4b_eol = metal2.edges.with_length(nil, 0.34.um).interacting(v1p4b_cond.first_edges).interacting(v1p4b_cond.second_edges).not(v1p4b_cond.first_edges).not(v1p4b_cond.second_edges)
v1p4b_eol_extended_in = v1p4b_eol.extended_in(0.06.um - 5.dbu)
v1p4b_eol_extended_in = v1p4b_eol.extended_in(0.06.um - 2.dbu)
v1p4b_l1 = via1.interacting(v1p4b_eol_extended_in)
v1p4b_l1.output("V1.4b", "V1.4b : metal2 (< 0.34um) end-of-line overlap. : 0.06µm")
v1p4b_l1.forget
v1p4b_cond.forget
v1p4b_eol.forget
v1p4b_eol_extended_in.forget

# Rule V1.4c: If metal2 overlap via1 by < 0.04um on one side, adjacent metal2 edges overlap. is 0.06µm

logger.info("Executing rule V1.4c")
via1_4c_cond_metal = metal2.enclosing(via1, 0.04.um, euclidian).polygons(0.005)
via1_4c_cont = via1.interacting(via1_4c_cond_metal)
via1_4c_l1_poss = metal2.enclosing(via1_4c_cont, 0.06.um, projection).polygons(0.005)
via1_4c_l1 = via1_4c_l1_poss.interacting(via1_4c_cond_metal)
via1_4c_l1.output("V1.4c", "V1.4c : If metal2 overlap via1 by < 0.04um on one side, adjacent metal2 edges overlap. : 0.06µm")
via1_4c_cond_metal = metal2.enclosing(via1, 0.04.um, projection).edges.interacting(via1)
via1_4c_check = via1.interacting(via1_4c_cond_metal).edges.not(via1_4c_cond_metal)
via1_cond_corner = via1_4c_cond_metal.width(0.002.um, angle_limit(135)).polygons
via1_4c_check_ext = via1_4c_check.extended_out(0.06.um - 1.dbu)
bad_ext = via1_4c_check_ext.interacting(via1_4c_check_ext.not(metal2))
via1_4c_l1 = via1.interacting(bad_ext)
via1_4c_l2 = via1.interacting(via1_cond_corner)
via1_4c_l = via1_4c_l1.or(via1_4c_l2)
via1_4c_l.output("V1.4c", "V1.4c : If metal2 overlap via1 by < 0.04um on one side, adjacent metal2 edges overlap. : 0.06µm")
via1_4c_l.forget
via1_4c_l2.forget
via1_4c_l1.forget
via1_4c_l1_poss.forget
via1_4c_cont.forget
bad_ext.forget
via1_cond_corner.forget
via1_4c_check_ext.forget
via1_4c_check.forget
via1_4c_cond_metal.forget

end #BEOL
197 changes: 105 additions & 92 deletions rules/klayout/drc/rule_decks/via2.drc
Original file line number Diff line number Diff line change
Expand Up @@ -14,106 +14,119 @@
# limitations under the License.
################################################################################################


if BEOL
if METAL_LEVEL == "3LM" || METAL_LEVEL == "4LM" || METAL_LEVEL == "5LM" || METAL_LEVEL == "6LM"
#================================================
#----------------------via2----------------------
#================================================

# Rule V2.1: Min/max via2 size . is 0.26µm
logger.info("Executing rule V2.1")
v21_l1 = via2.edges.without_length(0.26.um).extended(0, 0, 0.001, 0.001)
v21_l1.output("V2.1", "V2.1 : Min/max via2 size . : 0.26µm")
v21_l1.forget
#================================================
#----------------------via2----------------------
#================================================

# Rule V2.2a: min. via2 spacing is 0.26µm
logger.info("Executing rule V2.2a")
v22a_l1 = via2.space(0.26.um, euclidian)
v22a_l1.output("V2.2a", "V2.2a : min. via2 spacing : 0.26µm")
v22a_l1.forget
# Rule V2.1: Min/max Via1 size . is 0.26µm
logger.info("Executing rule V2.1")
v21_l1 = via2.edges.without_length(0.26.um).extended(0, 0, 0.001, 0.001)
v21_l1.output("V2.1", "V2.1 : Min/max Via1 size . : 0.26µm")
v21_l1.forget


# Rule V2.2b: via2 Space in 4x4 or larger via2 array is 0.36µm
logger.info("Executing rule V2.2b")
poss_4_4_via2 = via2.sized(0.18, "square_limit").merged.sized(-0.18, "square_limit")
via2_4x4_loc = poss_4_4_via2.not_interacting(poss_4_4_via2.edges.with_length(nil, 2.115))
selected_via2 = via2.interacting(via2_4x4_loc)
via2b_l1 = selected_via2.space(0.36.um, euclidian)
via2b_l1.output("V2.2b", "V2.2b : via2 Space in 4x4 or larger via2 array : 0.36µm")
via2b_l1.forget
poss_4_4_via2.forget
via2_4x4_loc.forget
selected_via2.forget
# Rule V2.2a: min. via2 spacing is 0.26µm
logger.info("Executing rule V2.2a")
v22a_l1 = via2.space(0.26.um, euclidian)
v22a_l1.output("V2.2a", "V2.2a : min. via2 spacing : 0.26µm")
v22a_l1.forget

# Rule V2.3a: metal2 overlap of via2.
logger.info("Executing rule V2.3a")
v23a_l1 = via2.not(metal2)
v23a_l2 = metal2.enclosing(via2, 0.01.um, euclidian).polygons(0.001)
v23a_l = v23a_l1.or(v23a_l2)
v23a_l1.output("V2.3a", "V2.3a : metal2 overlap of via2 >= 0.01")
v23a_l1.forget
v23a_l2.forget
v23a_l.forget

# Rule V2.2b: Via1 Space in 4x4 or larger via2 array is 0.36µm
logger.info("Executing rule V2.2b")
poss_4_4_via2 = via2.sized(0.18, "square_limit").merged.sized(-0.18, "square_limit")
via2_4x4_loc = poss_4_4_via2.not_interacting(poss_4_4_via2.edges.with_length(nil, 2.115))
selected_via2 = via2.interacting(via2_4x4_loc)
via2b_l1 = selected_via2.space(0.36.um, euclidian)
via2b_l1.output("V2.2b", "V2.2b : Via1 Space in 4x4 or larger via2 array : 0.36µm")
via2b_l1.forget
poss_4_4_via2.forget
via2_4x4_loc.forget
selected_via2.forget

# rule V2.3b is not a DRC check
# Rule V2.3c: metal2 (< 0.34um) end-of-line overlap. is 0.06µm
logger.info("Executing rule V2.3c")
v2p3c_cond = metal2.width(0.34.um + 1.dbu).with_length(0.28.um,nil,both)
v2p3c_eol = metal2.edges.with_length(nil, 0.34.um).interacting(v2p3c_cond.first_edges).interacting(v2p3c_cond.second_edges).not(v2p3c_cond.first_edges).not(v2p3c_cond.second_edges)
v2p3c_eol_extended_in = v2p3c_eol.extended_in(0.06.um - 5.dbu)
v2p3c_l1 = via2.interacting(v2p3c_eol_extended_in)
v2p3c_l1.output("V2.3c", "V2.3c : metal2 (< 0.34um) end-of-line overlap. : 0.06µm")
v2p3c_l1.forget
v2p3c_cond.forget
v2p3c_eol.forget
v2p3c_eol_extended_in.forget
# Rule V2.3a: metal2 overlap of via4.
logger.info("Executing rule V2.3a")
v23a_l1 = via2.not(metal2)
v23a_l2 = metal2.enclosing(via2, 0.01.um, euclidian).polygons(0.001)
v23a_l = v23a_l1.or(v23a_l2)
v23a_l1.output("V2.3a", "V2.3a : metal2 overlap of via2 >= 0.01")
v23a_l1.forget
v23a_l2.forget
v23a_l.forget

# Rule V2.3d: If metal2 overlap via2 by < 0.04um on one side, adjacent metal2 edges overlap. is 0.06µm
logger.info("Executing rule V2.3d")
via2_3d_cond_metal = metal2.enclosing(via2, 0.04.um, euclidian).polygons(0.005)
via2_3d_cont = via2.interacting(via2_3d_cond_metal)
via2_3d_l1_poss = metal2.enclosing(via2_3d_cont, 0.06.um, projection).polygons(0.005)
via2_3d_l1 = via2_3d_l1_poss.interacting(via2_3d_cond_metal)
via2_3d_l1.output("V2.3d", "V2.3d : If metal2 overlap via2 by < 0.04um on one side, adjacent metal2 edges overlap. : 0.06µm")
via2_3d_l1.forget
via2_3d_l1_poss.forget
via2_3d_cont.forget
via2_3d_cond_metal.forget
# rule V2.3b is not a DRC check
# Rule V2.3c: metal2 (< 0.34um) end-of-line overlap. is 0.06µm
logger.info("Executing rule V2.3c")
v2p3c_cond = metal2.width(0.34.um + 1.dbu).with_length(0.28.um,nil,both)
v2p3c_eol = metal2.edges.with_length(nil, 0.34.um).interacting(v2p3c_cond.first_edges).interacting(v2p3c_cond.second_edges).not(v2p3c_cond.first_edges).not(v2p3c_cond.second_edges)
v2p3c_eol_extended_in = v2p3c_eol.extended_in(0.06.um - 2.dbu)
v2p3c_l1 = via2.interacting(v2p3c_eol_extended_in)
v2p3c_l1.output("V2.3c", "V2.3c : metal2 (< 0.34um) end-of-line overlap. : 0.06µm")
v2p3c_l1.forget
v2p3c_cond.forget
v2p3c_eol.forget
v2p3c_eol_extended_in.forget

logger.info("Executing rule V2.3d")
via2_3d_cond_metal = metal2.enclosing(via2, 0.04.um, projection).edges.interacting(via2)
via2_3d_check = via2.interacting(via2_3d_cond_metal).edges.not(via2_3d_cond_metal)
via2_cond_corner = via2_3d_cond_metal.width(0.002.um, angle_limit(135)).polygons
via2_3d_check_ext = via2_3d_check.extended_out(0.06.um - 1.dbu)
bad_ext = via2_3d_check_ext.interacting(via2_3d_check_ext.not(metal2))
via2_3d_l1 = via2.interacting(bad_ext)
via2_3d_l2 = via2.interacting(via2_cond_corner)
via2_3d_l = via2_3d_l1.or(via2_3d_l2)
via2_3d_l.output("V2.3d", "V2.3d : If metal2 overlap via2 by < 0.04um on one side, adjacent metal2 edges overlap. : 0.06µm")
via2_3d_l.forget
via2_3d_l2.forget
via2_3d_l1.forget
bad_ext.forget
via2_cond_corner.forget
via2_3d_check_ext.forget
via2_3d_check.forget
via2_3d_cond_metal.forget

# Rule V2.4a: metal3 overlap of via2.
logger.info("Executing rule V2.4a")
via2_4a_l1 = metal3.enclosing(via2, 0.01.um, euclidian).polygons(0.001)
via2_4a_l2 = via2.not(metal3)
via2_4a_l = via2_4a_l1.or(via2_4a_l2)
via2_4a_l.output("V2.4a", "V2.4a : metal3 overlap of via2 >= 0.01 um")
via2_4a_l1.forget
via2_4a_l2.forget
via2_4a_l.forget
# rule V2.3e is not a DRC check

# Rule V2.4b: metal3 (< 0.34um) end-of-line overlap. is 0.06µm
logger.info("Executing rule V2.4b")
v2p4b_cond = metal3.width(0.34.um + 1.dbu).with_length(0.28.um,nil,both)
v2p4b_eol = metal3.edges.with_length(nil, 0.34.um).interacting(v2p4b_cond.first_edges).interacting(v2p4b_cond.second_edges).not(v2p4b_cond.first_edges).not(v2p4b_cond.second_edges)
v2p4b_eol_extended_in = v2p4b_eol.extended_in(0.06.um - 5.dbu)
v2p4b_l1 = via2.interacting(v2p4b_eol_extended_in)
v2p4b_l1.output("V2.4b", "V2.4b : metal3 (< 0.34um) end-of-line overlap. : 0.06µm")
v2p4b_l1.forget
v2p4b_cond.forget
v2p4b_eol.forget
v2p4b_eol_extended_in.forget
# Rule V2.4a: metal3 overlap of via2.
logger.info("Executing rule V2.4a")
via2_4a_l1 = metal3.enclosing(via2, 0.01.um, euclidian).polygons(0.001)
via2_4a_l2 = via2.not(metal3)
via2_4a_l = via2_4a_l1.or(via2_4a_l2)
via2_4a_l.output("V2.4a", "V2.4a : metal3 overlap of via2 >= 0.01 um")
via2_4a_l1.forget
via2_4a_l2.forget
via2_4a_l.forget

# Rule V2.4c: If metal3 overlap via2 by < 0.04um on one side, adjacent metal3 edges overlap. is 0.06µm
logger.info("Executing rule V2.4c")
via2_4c_cond_metal = metal3.enclosing(via2, 0.04.um, euclidian).polygons(0.005)
via2_4c_cont = via2.interacting(via2_4c_cond_metal)
via2_4c_l1_poss = metal3.enclosing(via2_4c_cont, 0.06.um, projection).polygons(0.005)
via2_4c_l1 = via2_4c_l1_poss.interacting(via2_4c_cond_metal)
via2_4c_l1.output("V2.4c", "V2.4c : If metal3 overlap via2 by < 0.04um on one side, adjacent metal3 edges overlap. : 0.06µm")
via2_4c_l1.forget
via2_4c_l1_poss.forget
via2_4c_cont.forget
via2_4c_cond_metal.forget
# Rule V2.4b: metal3 (< 0.34um) end-of-line overlap. is 0.06µm
logger.info("Executing rule V2.4b")
v2p4b_cond = metal3.width(0.34.um + 1.dbu).with_length(0.28.um,nil,both)
v2p4b_eol = metal3.edges.with_length(nil, 0.34.um).interacting(v2p4b_cond.first_edges).interacting(v2p4b_cond.second_edges).not(v2p4b_cond.first_edges).not(v2p4b_cond.second_edges)
v2p4b_eol_extended_in = v2p4b_eol.extended_in(0.06.um - 2.dbu)
v2p4b_l1 = via2.interacting(v2p4b_eol_extended_in)
v2p4b_l1.output("V2.4b", "V2.4b : metal3 (< 0.34um) end-of-line overlap. : 0.06µm")
v2p4b_l1.forget
v2p4b_cond.forget
v2p4b_eol.forget
v2p4b_eol_extended_in.forget

logger.info("Executing rule V2.4c")
via2_4c_cond_metal = metal3.enclosing(via2, 0.04.um, projection).edges.interacting(via2)
via2_4c_check = via2.interacting(via2_4c_cond_metal).edges.not(via2_4c_cond_metal)
via2_cond_corner = via2_4c_cond_metal.width(0.002.um, angle_limit(135)).polygons
via2_4c_check_ext = via2_4c_check.extended_out(0.06.um - 1.dbu)
bad_ext = via2_4c_check_ext.interacting(via2_4c_check_ext.not(metal3))
via2_4c_l1 = via2.interacting(bad_ext)
via2_4c_l2 = via2.interacting(via2_cond_corner)
via2_4c_l = via2_4c_l1.or(via2_4c_l2)
via2_4c_l.output("V2.4c", "V2.4c : If metal3 overlap via2 by < 0.04um on one side, adjacent metal3 edges overlap. : 0.06µm")
via2_4c_l.forget
via2_4c_l2.forget
via2_4c_l1.forget
bad_ext.forget
via2_cond_corner.forget
via2_4c_check_ext.forget
via2_4c_check.forget
via2_4c_cond_metal.forget

end
end #BEOL
Loading

0 comments on commit 55b9e8e

Please sign in to comment.