Skip to content

Feature/issue 2300#2307

Open
klayoutmatthias wants to merge 6 commits intomasterfrom
feature/issue-2300
Open

Feature/issue 2300#2307
klayoutmatthias wants to merge 6 commits intomasterfrom
feature/issue-2300

Conversation

@klayoutmatthias
Copy link
Copy Markdown
Collaborator

The solution consists of a number of features:

Two environment variables to specify a list of formats for LEF and DEF:

  KLAYOUT_LEF_FORMAT         A space-separated list of formats to be recognized as LEF files.
                             By default this format list is '*.lef *.LEF *.lef.gz *.LEF.gz'.
  KLAYOUT_DEF_FORMAT         A space-separated list of formats to be recognized as DEF files.
                             By default this format list is '*.def *.DEF *.def.gz *.DEF.gz'.

In addition, you can add the desired format in form of a "virtual suffix" in square brackets to the input and output files on strmxor, strmclip and klayout:

strm2oas file.defok[def] out.oas

reads a DEF file called "file.defok", and

strmxor a.gds b.gds ab.xor[oas]

will produce a file called "ab.xor" in OASIS format.

Matthias Koefferlein added 5 commits March 20, 2026 15:48
Most tools and functions now allow to explicitly
specify a format for input and output. On input,
the format is usually detected, but for some
cases, this is not possible (e.g. DEF). So you can
specify the format attached to the file name in
square brackets:

e.g. file.defok[def]

"def" is the intended suffix, "defok" is the given one.

On output, the same is possible, specifically in strmxor
and strmclip:

strmxor a.gds b.gds out.xor[oas]
The way to specify them is through the following
environment variables:

$KLAYOUT_LEF_FORMAT - LEF suffixes (default: "*.lef *.LEF *.lef.gz *.LEF.gz")
$KLAYOUT_DEF_FORMAT - DEF suffixes (default: "*.def *.DEF *.def.gz *.DEF.gz")

The string is a space-separated list of simple
match pattern. Only "*.xyz"-style pattern are allowed
currently.
@stefanottili
Copy link
Copy Markdown

Whats the reasoning to use an environment variable and not an internal klayout variable that gets saved in klayoutrc ?

@klayoutmatthias
Copy link
Copy Markdown
Collaborator Author

That's because it should apply to strm* tools as well, right? They don't have klayoutrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

klayout fails to detect format of defok file written by OpenRoad

2 participants