Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

DRC for misalignment

Hello everyone.
I have a very basic query on DRC.
I am trying to write some DRC commands for my layout but couldn't find a way to this issue. I want to see where are this kind of misalignments in my whole design.

I am sorry to bother if this is a very basic problem. Thanks a lot in advance.



  • Hi Bishal,

    Maybe you can detect such cases with edge-length checks:

    # assumes that 10nm is a good indicator for misalignment
    short_edges = layer.edges.with_length(0, 10.nm)


  • @Matthias thank you for the answer. It worked for me.
    Additionally, I would like to ask one more query related to same issue.
    Now I used:
    short_edges =LayerSiN.edges.with_length(1, 100.nm)
    output(short_edges, "Alignment","Devices misaligned")
    This gives me DRC result in a new window. What should I do if I want a polygon in different layer plotted at the misalignment area. Not just this misalignment case, maybe in case of space too.


  • You probably need to read about the functions layer.polygons() and layer.output() in the documentation:
    Note: Your second graphical example is very different from your first graphical example, which brings confusion about what you want.

  • @ocasta , Sorry for the confusion.
    Actually what I want is, I can run the DRC and see the results. But it would be much better if I could make some polygon showing a specific type of errors like misalignment, space etc.
    For the misalignment, it should look something like this:

    So I want to make those white polygons at misalignments so anyone else can understand that there is misalignment just be checking that specific layer.
    I believe this clarifies my intention. If there is still something more, I will be more than happy to share.
    Thank you for the guidance. :smile:

  • Hi photonicsbishal,

    you mean you want to generate as new layers?

    Basically DRC can output to a marker DB (into the marker window) or to new layers.

    For creating a marker DB use:

    report("My DRC")
    drawn = input(1, 0)
    drawn.width(200.nm).output("width <200nm")

    For creating markers on a new layer (here: 1000), use:

    drawn = input(1, 0)
    drawn.width(200.nm).output(1000, 0)

    or give it a name (will not save to GDS):

    drawn = input(1, 0)
    drawn.width(200.nm).output(1000, 0, "width_errors")

    For the error marker generation here are some suggestions:

    drawn = input(1, 0)
    all_edges = drawn.edges
    short_edges = all_edges.with_length(0, 200.nm)
    # NOTE: angle_limit(180) means that all edges will be checked against
    # other edges. Hence the separation produces a marker to any other layer
    short_edges.separation(all_edges, angle_limit(180),"misalignment")
    # OR: use "extended" to make a bigger marker
    short_edges.extended(:out =>"misalignment extended")


  • Thank you @Matthias ,
    This is exactly what I was looking for.
    Thanks a lot. :smile:

  • edited June 5

    Hello @Matthias,
    I am running the script you provided and faced with this issue.
    When I try to execute DRC to marker DB, it is working fine. But whenever I try to write it to layer, this error is popping up. I hope to get some guidance from you regarding this issue.
    My script:
    This script works and shows result in marker DB

    report("DRC_report") Layer1=input(1,0)"Si_space","Si minimum space violation; min 300 nm")

    But if I use, the below script, some error occurs as in the image attached which I am unable to decode.

    report("DRC_report") Layer1=input(1,0), 0)


  • @photonicsbishal

    When you want to output to a different layer (here: 200, 0), you need to drop the "report" line.

    You can however switch dynamically:

    l1 = input(1, 0)
    # l1 goes to the browser
    report("My report")
    l1.output("Goes to browser")
    # l1 goes to the first layout loaded, layer 200/0
    l1.output(200, 0)


Sign In or Register to comment.