• ## Feeds

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

• CommentAuthorxibinke
• CommentTimeDec 27th 2016

Hello Matthias,

I can not have a good understanding of the DRC script in klayout. Can you show an example to check the following design rule?

"The width of metal must be greater than or equal to 3 microns except where poly and metal overlap by more than 1 micron, then the metal width must be greater than or equal to 4 microns."

Thanks & Regards,
xibinke
• CommentAuthorMatthias
• CommentTimeDec 28th 2016

Hi,

I just have a rough idea about the meaning of this rule, so I can just guess.

Maybe you want to try this:

``````report("DRC")

poly = input(2)
metal = input(1)

# e1 = metal edges overlapping poly by less than 1µm
e1 = metal.overlap(poly, 1.0.um, projection).edges

# e2 = metal edges inside poly
e2 = (metal.edges & (metal & poly).edges)

# e3 = metal edges overlapping poly by more than 1µm
e3 = e2 - e1

# Checks 4µm rule
metal.edges.overlap(e3, 4.0.um).output("Metal width >= 4µm where Poly overlaps metal by more than 1µm")

# Check 3µm rule
(metal.edges - e3).width(3.0.um).output("Metal width >= 3µm otherwise")
``````

Matthias

• CommentAuthorxibinke
• CommentTimeDec 28th 2016 edited

Hi Matthias,

Yes, this is the rule I want to check. Thank you.

For the overlap method, is it possible to give an option to check at the rule boundary?
For example, e1 find the edge of overlapping < 1um, but sometimes I need to find the overlapping <= 1um.
And for the 4um rule, I do need to check overlapping < 4um instead of <=4um.
• CommentAuthorxibinke
• CommentTimeDec 28th 2016

One more question, I can not find how to use the option of many methods in the link of Documentation . Are there any other documents I can refer to?
• CommentAuthorMatthias
• CommentTimeDec 29th 2016 edited

Hi,

All checks is designed to check "less" not "less or equal", so the overlap check should do what you're expecting: it will check width >= 4.0 and report an error on < 4.0 µm. Doesn't it?

If you really need to check the other way around, you an add or subtract a tiny value, preferably one database unit:

``````4.um - 1.dbu    # a "little less" than 4 µm
1.um + 1.dbu    # a "little more" than 1 µm
``````

(one database unit is the smallest distance that can be represented by the design's resolution).

The options are documented with the "width" method. There should be a link from the other methods embedded in the text. At least it's working on the HTML documentation here for example.

Matthias

• CommentAuthorxibinke
• CommentTimeDec 29th 2016

OK, thank you, Matthias.