KLayout DRC on large layouts

Hello! I have a question regarding DRC.

When running DRC on large & complex layouts, I often run into an issue of hanging/crashing. This seems to be particularly present when there are many instances of waveguide structures and rules such as separation, space, or width are attempting to be checked.
My local machine has 65GB ram & an 8 core processor.

I have these DRC commands (where layer and o_l are defined as layer inputs, value is a number, and rule & description are strings):
o_l.sep(layer, value).output(rule, description)
layer.width(value, angle_limit(45.degree)).output(rule, description)
layer.space(value) .output(rule, description)

And the behavior is that it slows my computer down, consuming all the memory, until KLayout becomes unresponsive for quite a while until eventually crashing. This behavior is also present when I implement tiling.

I am wondering what you suggest doing to be able to successfully run these kinds of DRC rules on layouts such as this with many structures present.

Thanks!

Comments

  • Hi spark_aeon,
    To find out what's going on in a DRC script you can use the profile DRC function. That will provide you with the time spent and memory used for each function call.
    verbose(true) is also useful in general debugging.
    It seems you are running out of memory. The forget method of the layer object could help.
    Regards,

    S

  • Hi @spark_aeon,

    There are too many reasons, so I am not able to give advice without a test case and the full DRC script.

    As @srooks10 mentioned, "profile" can help you identifying the resource hogs.

    Some hints:

    • Try tiled mode
    • Try deep mode if your layout has significant hierarchical repetition
    • Do you see many violations in the output (like millions)? If you do, sending the data to a report database is not a good idea. A report database takes much more memory than layout and is not good for keeping millions of violations. Sending the output to a separate layout is an option in that case (use "target" instead of "report").
    • Large space/width values can create issues as they may produce a plethora of overlapping markers. See for example here: https://github.com/KLayout/klayout/issues/2092
    • I have no idea how your layout looks like, but if it has complex polygons which merge to even more complex ones, memory may become an issue

    I hardly see the need for using so much memory. Even millions of polygon vertexes should not be an issue, provided the problem is broken down properly.

    Matthias

Sign In or Register to comment.