Design-rule check (DRC)
Verify → Design rules… opens a per-layer table of limits: min width, min spacing, min notch (all three in µm), min area (µm²), grid (nm), and resist height (µm). Leave a cell blank to skip that check. One-click writer presets set the min-width floor on every layer at once — laser (1.5 µm), e-beam (200 nm), BEAM (500 nm), or soft litho / PDMS (20 µm, the low-cost soft-lithography foundry floor for microfluidic masters).
Resist height is a soft-lithography (SU-8 mold) aspect-ratio guard: GDS geometry has no height axis, so if you tell the check how tall your resist layer is, it derives a minimum-width floor of height ÷ 5 (a conservative 5:1 max aspect ratio — SU-8 can be pushed further under careful process control, but 5:1 is a safe design default) and checks it exactly like min width. Set only a resist height to check aspect ratio alone; set both a min width and a resist height and the stricter of the two wins — the check never lets a taller resist loosen an explicit min-width floor you already set. Like min width, it also widens and checks paths.
Min spacing splits into notch and isolated findings. Every spacing violation is a gap that's narrower than allowed — but a gap can arise two ways: a self-touching concavity carved into a single polygon (a notch, e.g. a comb tooth or a slot), or a real gap between two separate polygons (isolated spacing). Each finding says which it is, and the report counts them separately. By default min spacing governs both, unchanged from before this distinction existed — set min notch as well to judge notches against their own, different threshold instead. Each class is checked, and can fail, independently of the other's threshold no matter which of the two numbers is larger: a genuine min-spacing violation is never hidden by a looser or stricter min notch, and vice versa. Leave min notch blank (or set it equal to min spacing) and nothing changes. Setting min notch to a value that actually differs from min spacing runs the spacing check twice — once per threshold — roughly doubling that layer's check time; this is useful when a process tolerates a tighter self-touching notch than it does true inter-feature spacing (or the reverse), but costs accordingly.
Layer-pair rules check two DIFFERENT layers against each other, below the per-layer table. Add one with + Add rule, pick which check, and the two layers it applies to:
- Enclosure (A encloses B) — every part of layer B must sit at least the given distance inside layer A (e.g. a via required to land inside its metal pad). Geometry drawn at exactly that distance passes.
- Min pair spacing (A to B) — layer A and layer B must clear each other by at least the given distance wherever they don't already overlap; an overlap is not a spacing violation.
- No overlap (A and B) — layer A and layer B must share no area at all (KLayout's
overlapcheck). A shared edge or corner with no actual overlapping area is not flagged — only a genuine, measurable overlap is. - Must intersect (every A touches B) — every separate shape (connected region) on layer A must touch layer B somewhere, e.g. every via must land on some metal. A via with no metal anywhere underneath is flagged as an orphan.
No overlap and Must intersect have no distance to set — the Value column doesn't apply to them and is disabled. All four flatten SRef/ARef first, like every other rule here, and check boundaries/boxes only (not paths). Like the per-layer rules, pair rules are remembered in your browser, not written into the .gds.
Press F7 (or Verify → Run design-rule check) to run. Then:
- Every SRef / ARef in the active cell is expanded first, so a spacing error between two instances of the same cell is caught — it only exists in the parent, and checking the un-expanded cell would report clean.
- The check runs in a background worker with a Cancel button, and is strictly read-only: it never touches your drawing or the undo stack.
- Violations appear as numbered markers on the canvas. Press
F2/Shift+F2to step through them; the view zooms to each one with enough surrounding geometry to see what went wrong.Verify → Clear violationsremoves them. - When violations cluster tightly, overlapping labels are automatically hidden so the rest stay legible — the marker you've stepped to with
F2always keeps its label, even in a dense cluster. - Grid flags every boundary, box, and path vertex that isn't a multiple of the entered grid (nm) — the classic "on-grid" manufacturing check. Because instances are expanded first, a rotated or magnified instance is caught even when its cell is itself on-grid, and a grid-only rule set skips the heavy geometry merging entirely, so it stays fast on any layer.
Rules are remembered in your browser and apply to whatever document you open — they describe the process you intend to fabricate with, not the drawing. They are not written into the .gds.
What is checked: boundaries and boxes; width/spacing also widen and check paths (stroked to their outline, honouring width, joints and end caps); and, by the grid rule alone, every path vertex too. Layer-pair rules — enclosure, pair spacing, overlap, and must-intersect (see above) — check boundaries and boxes across two layers. What is not: a zero-width (centreline) path under width/spacing — it has no width to widen, and Glyph tells you when a checked layer contained one rather than implying a clean result — and any path under the area rule or a layer-pair rule (a path's area is width × length, which is ambiguous, so both stay boundaries/boxes only). Electrical connectivity (does a net actually route through, as opposed to merely touching) is not checked — see Connect ports (§7) for the port-graph feature that comes closest. Very dense layers are slow — the check is exact, not sampled.