Build the klt erc layer-by-layer connectivity model (issue #859, Phase 1a) and
the per-gate antenna-ratio verdict (issue #860, Phase 1b) of the antenna + ERC
signoff epic #713. For every net whose geometry includes the declared gate-
role layer, accumulate that net's connected conductor area at each fabrication
step (the spec's stackup order), and, when --pdk is given, compare each
level's cumulative-area/gate-area ratio against that PDK's real antenna-ratio
limit. Also reports the ERC finding list (issue #861, Phase 1c) and, for every
antenna violation, a diode-insertion/layer-jumping remedy naming the specific
net and layer (issue #908, Phase 3). See docs/cli/erc.md for the spec-file
schema and the JSON contract.

positional arguments:
  file path to a routed GDSII or OASIS layout file. Required unless --check is given (the input paths are then read from the committed report instead)
  spec path to a JSON spec file: a 'stackup' array (>= 2 entries) mapping GDS layer/datatype pairs to fabrication-order conductor roles -- stackup[0] sets "role": "gate" -- and an optional 'vias' array -- see docs/cli/erc.md's 'Spec file' section. Required unless --check is given

options:
  -h, --help show this help message and exit
  --top TOP top cell to analyse when the stream has more than one (required in that case -- klt erc operates on exactly one top cell, unlike klt layers' default of summing across all)
  --pdk PDK PDK antenna-ratio limit table to check each level's antenna_ratio against (currently: sky130, ihp-sg13g2, gf180mcu). Optional -- omit to still report every level's antenna_ratio, just with verdict 'unchecked' everywhere. Not validated by argparse -- an unknown name exits 1 with a clean error, per docs/cli/erc.md's exit-code contract, rather than argparse's usage-error exit 2.
  --deck DECK curated extraction deck (currently: asap7, gf180mcu, sg13cmos5l, sg13g2, sky130) whose own device-body marker declarations (poly resistors, MiM/MOM caps) are auto-detected and carved out of the matching 'stackup'/'vias' role wherever a marker's conducting- body layer equals that role's own layer exactly -- the deck-driven alternative to hand-transcribing a 'devices[]' entry (issue #2183). Independent of --pdk (which selects only the antenna-ratio limit table) -- needs no PDK install, the same curated registry 'klt extract --deck'/'klt lvs --deck' resolve. An explicit 'devices[]' entry for a role still wins over this deck's own detection for that role. Optional -- omitted, no auto-detection is attempted and every output is byte-identical to a run before this flag existed. Not validated by argparse -- an unknown name exits 1 with a clean error, per docs/cli/erc.md's exit-code contract, rather than argparse's usage-error exit 2.
  --findings-only report the erc_findings half only, skipping the per- gate per-level antenna accumulation that dominates runtime on a dense layout (issue #2219). Every ERC finding is identical to a full run -- including erc.floating_gate, whose predicate is evaluated directly off the connectivity graph -- while gates[].levels[]'s accumulated areas/ratios come back null, every antenna verdict 'unchecked', and status 'not_checked' (exit 4), with every level in coverage.skipped for reason 'findings_only'. Gate on erc_status, as any --pdk-less run already must. Mutually exclusive with --pdk (a limit table with nothing to grade) -- passing both exits 1.
  --omit-antenna-tables drop the all-ungraded gates[] array (gate_count keeps the real count) and collapse the antenna coverage's per-gate skipped/gate_reference_level entries to one aggregate entry each, so a dense layout's report is small enough to commit verbatim (issue #3011). Sets antenna_tables_omitted: true; every verdict, erc_findings and the exit code are identical to the same run without it. Valid with --findings-only, or without --pdk when no antenna level is graded (issue #4385); with --pdk (no --findings-only) or spec antenna_limits that grade a level it exits 1, so a real verdict is never dropped.
  --compact with --findings-only, replace the per-gate gates[] rows, the per-(gate, level) coverage.skipped 'findings_only' records and the per-gate erc.floating_gate checked ids with one aggregate record each plus a top-level 'compact' counts block (issue #2965). gates stays a list (empty); nets, erc_findings, erc_status and the tie entries of erc_coverage are unchanged. Requires --findings-only -- passing it alone exits 1. Omitted, output is byte- identical.
  --check REPORT verify a previously committed 'klt erc --format json' report (REPORT) instead of running a fresh check: mutually exclusive with the positional 'file'/'spec' arguments, since inputs are read from REPORT itself (issue #3060). Cheap mode (default): re-hash REPORT's layout and spec (and --deck source, when one was used) and compare against the recorded provenance.input/spec/deck content_hash values, no ERC re-run. Combine with --rerun for full mode. Exits 0 if still consistent, 3 if drifted -- see docs/cli/erc.md, '--check / --rerun'
  --validate-spec SPEC validate the JSON spec file SPEC (schema, unknown keys, and cross-references such as ties[].connect_to, vias[].between, nets[].same_net_as and devices[].on) without reading any layout and without producing a verdict (issue #4034). Exits 0 with status 'valid', or 1 with the usual field-path error. Mutually exclusive with 'file' and --check; the layout-only flags (--top, --pdk, --deck, --findings-only, --omit-antenna-tables, --compact, --rerun) are rejected
  --rerun full mode for --check (issue #3060): re-run ERC from REPORT's echoed file/spec/pdk/findings_only (and provenance.deck) and diff verdict-bearing fields against the committed report, excluding provenance.klt_version/klayout_version/pdk.version. --top is not echoed in the report, so it is not replayed. Requires --check; a clean error (exit 1) otherwise
  --format {text,json} output format (default: text)
