Conventional DRC
A deck contains named rules with stable IDs, explicit units and severity. Existing rule constructors retain their syntax and produce the same version-1 deck JSON. They describe rules; constructing a deck does not execute or qualify them.
import lumicron_pdk as lpdk
import lumicron_validate as lv
CORE = lpdk.Layer(1, 0)
DRC = lv.drc.Deck(name="Example process", rules=[
lv.drc.min_width(CORE, 0.2, id="core.width", name="Core minimum width"),
lv.drc.min_spacing(CORE, 0.3, id="core.spacing", name="Core isolation"),
])
DRC.write("example.lumdrc")Export this object as DRC in a PDK package to embed it during lpdk.pack_pdk. An existing drc.json remains readable; conflicting Python and JSON declarations are rejected. Layer definition and stippling belong to lumicron_pdk.
min_width uses projection metrics in micrometres. min_spacing describes Euclidean isolation between disconnected masks. min_area uses square micrometres. enclosure takes inner and outer layers. Supported grids, geometry and engine limits are checked when the native DRC engine executes the deck. See the generated reference for signatures.
The existing polygon worker and authored LVS comparator are now owned by this package. Their native request/result contracts and evidence scopes remain unchanged. Optional external DRC/LVS integrations are not bundled engines and their absence is not a successful check.
Named DRC checks in Python
Export DRC from the PDK’s package root. The packer generates the existing schema-v1 drc.json; the native checker reads that data and does not execute Python rules.
from lumicron_validate import drc
DRC = drc.Deck(name="Example development rules", rules=[
drc.min_width(LAYER.CORE, threshold_um=0.45,
id="CORE.W.1", name="Core minimum width", metrics="projection"),
drc.min_spacing(LAYER.CORE, threshold_um=0.5,
id="CORE.S.1", name="Core isolation spacing"),
drc.min_area(LAYER.CORE, threshold_um2=0.2,
id="CORE.A.1", name="Core minimum area", severity="warning"),
drc.enclosure(LAYER.CORE, outer_layer=LAYER.CLAD, threshold_um=0.1,
id="CLAD.E.1", name="Cladding enclosure",
description="Illustrative threshold; replace with process requirements."),
])Linear thresholds are micrometers; area thresholds are square micrometers. Each rule needs a unique stable id and a human-readable name. All constructors accept severity="error", "warning", or "info", plus an optional description. Identifiers use ASCII letters, digits, underscore, dot, colon, or hyphen. Decks support 1–4096 rules and a maximum encoded size of 4 MiB. Thresholds must be positive and finite, at most 1,000,000 µm or 1,000,000,000,000 µm².
drc.min_width currently supports projection metrics only. Spacing checks isolation between disconnected masks; area checks merged filled regions; enclosure checks containment and clearance. The constructors do not expand the native engine’s supported geometry or qualification. Grid representability and supported geometry are still checked when DRC runs. There is no radius rule in this deck version.
DRC.write("rules.lumdrc") atomically writes a standalone deck; DRC.to_dict() returns an independent JSON-compatible projection. A package may retain its existing handwritten drc.json. If it also exports DRC, both decoded decks must be equal; otherwise packaging fails. Python deck layers must exist in the exported LAYER.
Explicit region decks (schema 2)
Standalone schema-2 .lumdrc decks express additional region operations without changing the meaning of schema-1 min_width, min_spacing, min_area or enclosure. The Python constructors above continue to author schema 1. Schema 2 currently requires every rule to use check: "region"; mixed-schema execution is rejected. This is an engineering preview, not fabrication signoff.
{
"drc_version": 2,
"deck_name": "Explicit edge checks",
"rules": [{
"id": "CORE.W.1", "name": "Core width", "severity": "error",
"check": "region", "layer": [3, 0],
"region": {
"operation": "edge_width", "threshold_um": "0.199",
"angle": 45, "discardZeroArea": false
}
}]
}Distances and areas in region specifications are positive decimal strings in µm and µm², converted exactly to the input DBU. Threshold representability is checked before execution. Margins must be stated in the deck’s actual threshold; no implicit global fabrication margin is applied.
| Operation | Required region fields (besides operation) |
|---|---|
edge_width, edge_space |
threshold_um, angle (45 or 90), discardZeroArea |
edge_pair_filter |
threshold_um, angle, space, area_um2, perimeter_um, combine (and or or) |
area_not_equal |
area_um2 |
off_grid |
grid_um |
inside_sized_raw |
otherLayer ("layer/datatype"), size_um |
overlapping |
otherLayer ("layer/datatype") |
edge_space includes connected notches. Edge checks use Euclidean clipping and transparent shielding. Compound conditions select and combine edge-pair polygons. inside_sized_raw selects entire inside shapes against individually expanded raw outer polygons; relevant oblique outer sizing is unsupported. overlapping selects whole shapes with positive-area overlap, excluding boundary-only touch. area_not_equal tests each merged polygon; an absent outline is not invented as a finding. off_grid examines all input layer/datatype pairs (its rule layer field is a placeholder) and reports off-grid vertices.
The current native path retains bounded hierarchy expansion and materialization limits. Unsupported geometry or exhausted limits fails the whole run; it is not a clean result. Package rule declarations are not automatically upgraded to this deck schema. Select the intended standalone deck explicitly.