DRC basics issue

Hello there!

I am sorry for posting a very basic issue. I am using K-Layout for almost 7 months for designing several batches of chips in my lab. Generally, the foundry did the DRC work before, but now we are looking to work with a small local fab lab so I need to do the DRC myself.
I have never used any form of scripting in K layout. So, I was learning it by looking at https://www.klayout.de/staging/0.23/doc/manual/drc_basic.html#h2-172

And I just copied these lines of code and saved my simple gds as "input.gds" which has just two rectangular boxes for learning purpose.
The script goes like this:

input(1, 0).sized(200.nm).output(10, 0)

But, I got this error,
Unable to open file: input.gds (errno=2) in Layout::read in MacroInterpreter::execute
C:/Users/bishal/KLayout/drc/testing.lydrc:4:in execute_drc' :/built-in-macros/drc_interpreters.lym:16:ininstance_eval'
:/built-in-macros/drc_interpreters.lym:16:in execute_drc' :/built-in-macros/drc_interpreters.lym:67:inexecute'

I tried to resolve it by looking at the website but couldn't succeed. I believe its a very simple thing which I am unable to do right now. So, if anyone could help me out with the appropriate format with example line of codes including headers (maybe). I think I haven't used the required headers and maybe proper cell definition is also not made.
Your little guidance will be very helpful for me to learn and perform basics DRC.

My objective of DRC is to check three things,
1. appropriate width of waveguides
2. to see if two segments are properly connected (ensure no gap is present)
3. check if two waveguides are too close to each other

Thanks in advance.
And sorry for bothering for this basic stuff.

Always thankful,


  • edited August 2018


    Did you save the script as "testing.lydrc"? I think it should be "testing.drc".

    However, for your objective, I think it is more straight forward to use "Basic scripts" in macro development (first section in the link you send).

    You can get a quick start by:
    Open Klayout, open your design, press F5 to open the macro development, choose DRC (next to Ruby and Python), create a new file and try this:
    report("Check waveguides width") # to show the report afterward
    input(1).width(100.um, projection).output("Violation","Waveguide width should be at least 100µm.") # I assume input 1 is your waveguide layer and the minimum width is 100µm

    Run the DRC by F5.
    "Marker Database Browser" will be opened and you can see the DRC report there.

    For other check like "spacing", "enclosing",.. detail instruction can be found here:


  • Thank you Hai. I could see some results from this code. I will learn more by editing the same file. Thanks a lot.. :)


Sign In or Register to comment.