Setup and file

Setup and file

Statements that belong at the top of the file, before the first layer line. One statement per line. An unknown word is a parse error.

← Language overview

Comments #

Available · yields comment

units 1e-6    # metres per user unit

# starts a comment outside "…". The rest of the line is ignored. Strings may contain #.

Input Result layer m1 = input(68) # … layer m1 = input(68)

Notes

  • layer x = input(1) # via is valid.
  • check "A#1" "t" : …# inside quotes is not a comment.
  • There are no block comments and no line-continuation \.
  • A line that is only whitespace and a comment is empty.

layer name = expr

Available · yields binding

layer m1 = input(68, 20)
layer nar = width(m1) < 0.14 um

Binds a name to exactly one layer expression. The same check expression may stand here — then the markers are a layer, not a report entry.

Input Result m1

Notes

  • A later assignment to the same name replaces the earlier one.
  • The right-hand side may only use names already defined — a forward reference is an error.
  • No if, no loop, no unpacking (no a, b = split_…).

check

Available · yields named expression

check "M1.W" "min width" : width(m1) < 0.14 um
check "M1.W" "min width" severity warn : width(m1) < 0.14 um -> 200, 0

A check is the expression after :. The strings are the ID and the report text. Without check, the same expression is an anonymous layer. Markers are the result of the expression (typically edge pairs).

Input Result

Notes

  • An empty result is a pass — except empty / count when they produce their dummy marker.
  • The ID is for the report and for select_checks.
  • severity and -> layer,dt are optional.
  • Comparisons: < <= > >= == !=. Area uses um2.

units

Available · yields setup

units 1e-6

Sets the user unit in metres. Bare numbers in limits and in sized then use that unit (typically µm). The GDS database unit comes from the layout, not from this line.

Number in the file Physical 1 uu 1e-6 m User unit, not the GDS database unit

Notes

  • If units is omitted, 1e-6 is used (1 user unit = 1 µm).
  • 0.18 um and 180 nm are converted through this base into dbu; 180 dbu bypasses user units.
  • If several units lines exist, the last one before the checks is used.
  • It does not rewrite GDS coordinates that were already read.

grid

Available · yields setup

grid 0.005 um

Manufacturing grid. Default for ongrid(layer) when no number is given. snap and checks with their own limit ignore grid, unless they call ongrid without an argument.

Input Result g off Grid points vs. an off-grid vertex

Notes

  • grid 0 or a negative grid: ongrid without a number finds no off-grid hits.
  • Only X = Y. There is no grid gx, gy in setup (anisotropic snap is snap(a, gx, gy)).
  • include can insert another file that sets grid — the last effective line after expansion wins.

mode flat

Available · yields setup

mode flat

Flatten every instance into the start cell. This is the current default, even without the line.

Input Result inst Hierarchy becomes one layer

Notes

  • mode deep and mode tiles exclude each other.
  • Arrays and nested instance orientations are transformed while flattening.
  • An empty cell: every input layer is empty; checks without geometry produce no markers (except empty).

mode deep

Available · yields setup

mode deep

Evaluate each unique cell locally (without child instances), then transform markers to every instance. A flatten pass follows; a marker that is already present locally (IoU ≥ 0.8, same rule) is not duplicated. Space across cells comes from the flatten pass.

Input Result 1× master 2× replay

Notes

  • Intra-cell width in a leaf: one marker per instance, same box as flatten at those origins.
  • A cell with no local shapes: no markers from that cell; children are evaluated separately.
  • Space between two placed instances: flatten pass, one marker as in flat.

mode tiles

Available · yields setup

mode tiles 200 um, 150 um, border 20 um, threads 8

Tiles with a halo. border and threads belong on this line. If border is omitted, the largest distance-check limit in the file is used. Shapes that cross the halo stay whole; a marker counts when its box centre lies in the core tile (the last tile includes the outer edge).

Input Result 1× marker Orange = halo; the marker is counted once (core tile)

Notes

  • One length: square tiles. Two lengths: width and height.
  • Space/width across a tile seam: a halo ≥ the limit finds the same marker as flat.
  • threads N on the tiles line parallelises the statement DAG inside each tile. Tiles themselves stay sequential (shared input clip). DRCENGINE_TILE_THREADS overrides N.
  • The setup line threads N drives the flat pass; mode deep stays serial.

threads

Available · yields setup

threads 8

Worker count for the flat scheduler. If the line is omitted or 0, the engine uses QThread::idealThreadCount(). threads 1 is the serial path. DRCENGINE_THREADS overrides the value.

Input Result Independent chains at the same time

Notes

  • threads 1: same order and markers as before parallelisation.
  • Independent layer chains and checks run concurrently; markers are merged in statement order.
  • mode deep stays serial. mode tiles … threads N parallelises only the DAG inside each tile; DRCENGINE_TILE_THREADS overrides N.

source

Available · yields setup

source TOP

Start cell. Flatten and bounds() refer to this cell.

Input Result TOP

Notes

  • An unknown name: empty design, every layer empty.
  • If source is omitted, the top cell of the layout is used.
  • cells then keeps only matching cell names (glob) from the flattened tree.

cells

Available · yields setup

cells "INV*"

Only shapes from cells whose name matches the glob. Flatten stays on: the source cell is still descended, but own shapes of non-matching cells are dropped.

Input Result

Notes

  • No match: empty set, not silently all cells.
  • Combined with clip: cells first, then a hard clip window.

clip

Available · yields setup

clip 0, 0, 100 um, 100 um

Hard clip window in user units. Polygons are cut to the frame (AND with the rectangle); edges/pairs are kept only if their bbox hits the window.

Input Result Blue = layout, orange = clip

Notes

  • A shape that crosses the frame: the part outside is dropped.
  • An empty window or min > max: empty.

gds

Available · yields setup

gds other = "chip_b.gds"

Bind a second layout. Layers from it: input(n, d, from=other). Relative paths are resolved against the deck baseDir.

Input Result A.gds B.gds

Notes

  • A missing file or unknown alias is a runtime error, not a silent empty layer.
  • Without from=, input stays on the primary design. The main layout clip does not apply to the second GDS.

include

Available · yields setup

include "common.ledrc"

Insert another file before parse (relative to the directory of the main file). Relative paths, UTF-8.

Input Result common main one file

Notes

  • A missing file is a parse error.
  • Cycles are not detected — do not include files in a loop.
  • The inserted file may contain units / grid / layer; names overwrite in expansion order.
  • No if, no macros.

select_checks

Available · yields setup

select_checks "M1.*"

Run only checks whose ID matches the glob. unselect_checks is the counterpart: first the select union, then unselect.

Input Result

Notes

  • No match: no checks, not all of them.
  • Unselect without a prior select: all minus the glob.

unselect_checks

Available · yields setup

unselect_checks "M1.DEBUG*"

Removes check IDs from the run set. Together with select_checks: first the select union, then unselect.

Input Result

Notes

  • Unselect without a prior select: all minus the glob.
  • No match: no change.

max_results

Available · yields setup

max_results 1000

Global marker cap after all checks (all = unlimited). Extra markers are truncated at the end.

Input Result

Notes

  • 0: no markers.
  • Order is the check/marker order in the deck, not sorted by distance.

chip

Available · yields setup

chip yes

With mode deep: only the source cell, with no extra flatten pass and no child cells. Child geometry does not appear in input().

Input Result IP

Notes

  • chip no or omitted: deep checks every reachable cell and merges the flatten pass.