Can I run DRC in batch mode?

Can I run DRC in batch mode in linux? What is the command? Where can I find the related info.?

Thanks

Comments

  • Maybe you have an answer from that discussion :
    https://www.klayout.de/forum/discussion/comment/4953

    Laurent

  • Because this question is asked quite often ... Here is the idea:

    You can basically run a DRC script in batch mode this way:

    klayout -b -r your.drc
    

    In the script you need to tell KLayout where to read the layout from and where to write the report:

    # your.drc:
    source("my_layout.gds")
    report("Description", "my_report.lyrdb")
    ...
    

    As you probably don't want to write a special script for every file, you can pass the input layout's name and the report file name by defining variables with the "-rd name=value" option:

    klayout -b -rd input=my_layout.gds -rd report=my_report.lyrdb -r your.drc
    

    In the script you refer to these variables with "$input" and "$report":

    # your.drc:
    source($input)
    report("Description", $report)
    ...
    

    Finally, if you want you script to be useful in GUI and batch mode you can put in an "if" which takes these variables only if set on the command line:

    # your.drc:
    if $input
      source($input)
    end
    if $report
      report("Description", $report)
    else
      report("Description")
    end
    ...
    

    Matthias

  • Thanks Matthias, Very clear and useful comment.

  • After ran the batch mode with the command : klayout -b -r test.lydrc
    I've got the ERROR message, while test.lydrc run in GUI perfectly. Does anyone know what happen. Thanks.

  • You shouldn't call the file ".lydrc". This suffix is reserved for XML-style scripts.

    ".drc" is the right suffix for plain text files.

    Matthias

  • Got it. Just try to rename and run. It's work now. Many Thanks Matthias

Sign In or Register to comment.