Some questions about writing DRC rules

Hi all, I am a postgraduate student, I am trying to write some rules, and I have some questions.

First, I wanna check the width, but I also wanna ensure the width is not affected by some polygons with the wrong angle, What should I do?

This is what I done , What should I add to achieve a more complete width check?

min_aa_w = 500.nm
r_aa_w = aa.width(min_aa_w )
r_aa_w.output("AA_W: AAwidth < 0.5 µm")

I used calibre for DRC inspection before. I also want to know what is the biggest difference between Klayout and Calibre for DRC?

Second,How to write a DRC script when checking the distance between different nets?
The specific requirement is Space between DNW and NW at different nets
I just write like this, but I do not know how to write "different net"

min_DNW__NW_s = 300.nm

r__DNW__NW_s = dnw.separation(nw, min_DNW__NW_s )
r__DNW__NW_s.output("DNW__NW_s: space to nw distance < #{'%.12g' % min_DNW__NW_s } µm")

Thanks in advance!

Best wishes!


  • Ok , i know how to write the rules to check the angle now, but I still confused on different nets problem..

  • @Shida I'm sorry, but KLayout currently can't check distances between different nets. Thats a development branch which is not yet addressed.

    Please don't expect you can easily substitute Calibre by KLayout. Mentor doesn't take the money for no reason.


  • @Matthias
    Thank for you reply!
    Ok, That makes sense..
    Where can I know the difference between Klayout and Calibre? I am very curious.
    Maybe the GDS design I made is not so complicated. I compared the two software myself, and I began to think that there was no difference between Klayout and Calibre.
    I really respect you very much. I think klayout really helps a lot of people who can't afford calibre to learn!
    Best wishes!


  • By the way,
    I am trying to check some polygons with 45-degree edge.

    min_edge_aa_fourfive = 0.45um
    edge_aa_fourfive = aa.with_angle(
    r_aa_width_fourfive = edge_aa_fourfive.width(min_edge_aa_fourfive )
    r_aa_width_fourfive .output("AA_W with 45 degree : AAwidth 45 degree < 0.45 µm")

    But it does not work

    Thanks in advance!

  • You can find many DRC examples here :

    For your 45 degree DRC :

    edge_aa_fourfive = aa.with_angle(0 .. 45)
    edge_aa_fourfive.output("AA_W with 45 degree : AAwidth 45 degree < 0.45 µm")

    or more simple :

    aa.with_angle(0 .. 45).output("AA_W with 45 degree : AAwidth 45 degree < 0.45 µm")


  • Thanks, @laurent_c , I still confused...
    In your code, it selects the 45 degrees, but what I wanna do is to check the width of 45 degrees of aa
    how can I do that?

  • Sorry, here is the way to check it :

    min_edge_aa_fourfive = 0.45um
    ((aa.edges.with_angle("AA_W with 45 degree : AAwidth 45 degree < 0.45 µm")


  • Thanks! @laurent_c
    You are so nice! It helps me a lot.

    I have already read all the code you upload in github, it is very Conciseness but useful, and I learn a lot!
    Wish you have a good day.

Sign In or Register to comment.