run_drc_klayout

ipkiss3.all.run_drc_klayout(gds_path, drc_script, marker_db=None, open_in_klayout=False, klayout_path=None)

Run a DRC check on a GDS file through the KLayout DRC engine.

This requires KLayout 0.29.1 or more recent to be installed.

For more information on writing DRC decks in KLayout, check out: https://www.klayout.de/doc/manual/drc_basic.html. Decks created for use with this method should be written in a way they can run in batch mode. This means these decks won’t run standalone in KLayout. To write a DRC deck that runs in batch mode, it needs to define a source + report.

Here is an example of a minimal DRC deck that works with the run_drc_klayout function (with $input being the layout GDS file and $output being the output report database):

source($input)
report("Check for sufficient space between waveguides", $output)
waveguide = input(1, 0)
waveguide.drc(space < 400.nm).output("Waveguide spacing")
Parameters:
gds_path: str | Path

The path to the GDS file on which you want to perform the DRC check.

drc_script: str | Path

The path to the DRC script.

marker_db: str | Path | None

Path to where the error markers are stored (usually has a .lyrdb extension) If None, use the GDS path to derive the report name. The file will be called ‘{gds_basename}_report.lyrdb’

open_in_klayout: bool

When True, launch KLayout and open the markers directly.

klayout_path: str | Path | None

When None, auto-discover KLayout. Otherwise, path to the executable.