how to use script to run DRC?

Hi All,

I only know how to use GUI to run DRC, then save as the DRC report.
May I know how to use script to run DRC in terminal? for example, use for loop to check DRC for 10 GDS files and save the separate reports.
Then when finish, I can check one by one?
Another question is how to use script to check DRC for different CELL in one GDS, for example, one GDS contains 5 CELLs and I want to check them separately, and generate different report?

Thanks.

Shawn

Comments

  • Hi Shawn,

    the way I do it is to use KLayout in batch mode and configure DRC with variables taken from the command line.

    For example, in your DRC deck (e.g. "run.drc") you specify a source and report this way:

    source($input)
    report("DRC report", $output)
    ...
    

    Then you run KLayout with this deck in batch mode and pass "input" and "output" by defining script variables:

    klayout -b -r run.drc -rd input=input_file.gds -rd output=drc_for_input_file.lyrdb
    

    If you want to pick a specific cell from the input layout, you can use one more variable - i.e. "cellname":

    source($input, $cellname)
    report("DRC report", $output)
    ...
    

    Matthias

  • This looks like it should be paragraph 1, chapter 1 of the Klayout DRC Developer's Cookbook.

    If we had one.

  • Hi @Matthias ,

    Thank you very much!

    One more question.
    In the GUI, I can use

        cv = RBA::CellView::active
        cv.name
        cv.cell_name
    

    to get GDS file name without path, and the cell name in the GDS.

    When I
    source($input)
    How can I get the GDS file name without path, and the cell name in the GDS?

    Thank you very much!

    Shawn

  • Hi Shawn

    For the file without path use the Ruby toolbox:

    filename_without_path = File.basename($input)
    

    For the cell name use

    source.cell_name
    

    Matthias

  • Hi @Matthias ,

    Thank you very much!

    Shawn

Sign In or Register to comment.