contact/via DRC : min enclosure on 2 opposite sides


How to write a DRC check for contact/via with a minimum enclosure on at least 2 opposite side ?
For instance, a via has to be enclosed by metal by 0.01µm on 2 opposite sides and can be 0 or whatever positive value on the2 other sides.

Best regards,


  • edited March 2019

    Hi Laurent,

    there is no out-of-the-box function yet, but there are several solutions based on the available features.

    I hope this code explains two of them:

    report("Via enclosure demo")
    via = input(5)
    metal = input(1)
    # this ensures there is no "negative" enclosure
    (via - metal).output("Via needs metal")
    # select those via edges (or parts) with less enclosure
    via_edges_with_less_enclosure = metal.enclosing(via, 10.nm, projection).second_edges
    # Option 1:
    # we know that via's are of a dimension so we can use "width"+"projection" to select
    # opposite edges (here: via size =
    good_via_edges = via.edges - via_edges_with_less_enclosure
    opposite = good_via_edges.width( + 1.dbu, projection).polygons
    solution1 = via.not_interacting(opposite)
    solution1.output("Min enclosure 10nm on at least two opposite edges - solution 1")
    # Option 2:
    # (does not need a value for the via size):
    # There is a problem if two edges with different orientation 
    # touch. There is no "interact" on the same edge set yet, but
    # you can use "width" with an "ignore_angle" of more than 90
    # degree to detect such touching corners:
    error_corners = via_edges_with_less_enclosure.width(angle_limit(100.0), 1.dbu)
    solution2 = via.interacting(error_corners.polygons(1.dbu))
    solution2.output("Min enclosure 10nm on at least two opposite edges - solution 2")

    Best regards,


Sign In or Register to comment.