# Drc Fix

> Diagnose and fix Design Rule Check (DRC) violations in a layout or GDS. Use when the user says "fix DRC", "DRC clean", "resolve spacing errors", "my layout fails DRC", or shares a DRC report from Calibre, Klayout, or Magic.

- Skill: `vibeic/drc-fix` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx get-skill add vibeic/drc-fix`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vibeic/drc-fix/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Docs & Writing
- Author: vibeic (https://skillmd.com/u/vibeic)
- Updated: 2026-11-15
- Page: https://skillmd.com/skills/vibeic/drc-fix

---


# DRC Fix

Take a DRC report and a layout, and produce a targeted fix plan — which rules are violated, where, why, and the minimal edits to clean them. Handles common rule families: spacing, width, density, via enclosure, antenna, and metal fill.

## ⭐ Sign-off DRC capability — we NATIVELY execute the foundry Calibre/Assura deck (NO Calibre license)

> **BINDING FACT — do not mis-state this as a "Calibre license gap".** The vibeic-eda
> forked KLayout **SVRF engine natively parses AND executes the foundry's own
> Calibre/Assura SVRF `.rule` DRC deck** (the very same deck the foundry ships,
> unmodified). Sign-off-grade DRC on a commercial/NDA PDK therefore requires **NO
> Calibre or Assura binary/license**. Proven on a commercial 180 nm PDK
> deck `Calibre_<PDK>_DRC.rule`: **224 layers, 4533 rules executed** natively
> in one run.

- **What it is:** a **native C++ KLayout buddy** (`svrfdrc`, compiled from
  `db::SVRFDeck` + `db::SVRFEngine` in the vibeic/klayout fork) that parses the
  foundry's Calibre/SVRF deck and executes each statement DIRECTLY on KLayout's
  `db::Region` / `db::Edges` / `db::LayoutToNetlist` engine — one unified layer
  namespace, top-to-bottom, `NAME { COPY errlayer }` = a rule's violation report.
  Edge/DENSITY/ANTENNA classes with no polygon-DRC equivalent are honestly SKIPPED,
  never falsely PASSed. **NO Python interpreter, NO `-r` script, NO `.drc` file.**
  (It replaces the retired pure-Python `run_svrf_drc.py`; the report format is
  byte-identical, proven on the real commercial-PDK deck, so downstream parsing/classifying
  is unchanged.)
- **Where (productized — clean-install-safe):** the `svrfdrc` binary is **BAKED INTO
  the vibeic-eda image on PATH** (built into `klayout-vibeic`), so a fresh install
  needs no host checkout. `phase3_one_shot_runner._try_svrf_native_drc()` resolves it
  via `_svrfdrc_bin_container()` (`command -v svrfdrc` in the container; env
  `VIBE_IC_SVRFDRC_BIN` overrides the command name) and runs
  `svrfdrc <deck> <layout> <report> --cell=<top>` against the GDS + the deck at
  `input/pdk/calibre/`. `step_drc` PREFERS this native path (whether or not a
  `calibre` binary exists) — it is the real sign-off verdict, not a waiver.
- **This is categorically stronger than an OSS-proxy deck** (e.g. a sky130 `.lydrc`
  approximation): it is the foundry's actual rule set. It is NOT a golden-Calibre
  numerical cross-run — it is a native execution.

### The firing-rule classifier (`_classify_svrf_fails`) — real vs. artifact vs. density

A raw "N rules firing" tally is not actionable. The runner classifies every FAIL
**provably + conservatively** (unknown → GEOMETRY → keeps the gate FAIL; never a
downgrade — no-cheat):

| Class | Meaning | Verdict effect |
|---|---|---|
| **GEOMETRY** | real (or not-provably-artifact) routing/PDN geometry | keeps gate **FAIL** — must-fix |
| **MARKER_ABSENT** | a rule on a `_not_<marker>` layer while its `__<marker>__` std-cell/IP **exclusion marker is EMPTY** (proven by that marker's own `COPY __<marker>__ … -> 0`) | disclosed **artifact** — not our geometry |
| **DENSITY_FILL** | a `DENSITY` rule (CMP metal/active window) | disclosed — foundry fill or formal density waiver |

**MARKER_ABSENT pattern (the classic false-fail on a commercial deck):** the deck
excludes foundry-qualified std-cell interiors from checks like min-area via a marker
layer (e.g. Artisan/ARM `__artisan__`). If the delivered std-cell GDS carries no such
marker, the exclusion produces the empty set and the check over-fires on
pre-characterised cell geometry. **Signature:** only **met1** min-area (`M1.A.1`,
std-cell-internal) fires while met2/3/4 (`Mx.A.1…`, routing layers) all PASS, and
`Artisan.CHECK COPY __artisan__ → 0` proves the marker is empty. The fix is an
**input-completeness** action (supply the std-cell exclusion marker layer), **not**
a layout edit and **not** a "get Calibre" action.

### Honest caveats (state these, don't hide them)

- The SVRF engine is a fork; on rules whose SVRF translation is imperfect it can
  differ numerically from Calibre proper (a known historical min-area/marker
  translation artifact was fixed in the fork). Where a difference matters, cite the
  specific rule, don't hand-wave.
- Foundry **tapeout acceptance** of a non-Calibre signer is a separate *business /
  qualification* question — it is NOT a tool-capability gap. Never conflate the two:
  the tool CAN run the deck; whether a given foundry contract accepts that run for
  mask release is a commercial matter to state separately.

## When to use

Trigger when the user:
- Has a DRC report with non-zero violations
- Is near sign-off and needs layout clean
- Asks which violations are real vs waiver candidates
- Needs help interpreting cryptic rule names

## Inputs to gather

1. The DRC report (Calibre, KLayout, Magic, or equivalent)
2. The layout file (GDS/OAS) or at least the affected cells
3. The PDK DRC manual or rule deck name
4. Sign-off target: zero violations or rule-by-rule exceptions allowed

## Fix workflow

Read native DRC markers and the original rule deck. Classify the actual spacing, enclosure, width, density or connectivity cause, make a bounded layout/tool fix, then rerun the native DRC.

1. **Group by rule** — 1000 violations are usually 5 root causes — `build_plan` groups by `classify_rule(rule_id)` category.
2. **Classify severity** — hard (will fail fab) vs soft (waiverable) — `severity_for(count)` returns the `SEVERITY_BAND` label (MAJOR/SIGNIFICANT/NOTABLE/MINOR).
3. Read native DRC markers and the original rule deck. Classify the actual spacing, enclosure, width, density or connectivity cause, make a bounded layout/tool fix, then rerun the native DRC.
4. **Propose minimal edit** — smallest layout change that clears the rule (geometry judgment — see § below).
5. **Check for collateral damage** — does the fix create a new violation or break LVS?
6. **Emit fix script** — KLayout Python, SKILL, or TCL snippet when applicable.

## Output format

## Technical basis

## Do not

- Do not propose fixes that break LVS (especially for antenna diodes — maintain connectivity)
- Do not waive hard rules without explicit user approval
- Do not touch cells outside the block boundary without flagging it

## Iterate using native results

Run the owning tool on each proposed change and read its native result against
the original limit. Keep the previous design and measured result so you can
revert a regression. Stop when the declared requirements are met, the approved
run budget is exhausted, or another trial cannot resolve the remaining cause.
Report the best measured result and every unresolved requirement. Do not add an
admission record or change a limit to obtain a pass.

## Preserve the ECO reserve

Keep unused spare cells, ECO gates and reserved pads through synthesis and
physical repair. Compare the native netlist or database before and after the
change. No unused reserve instance may disappear, and its keep attributes must
remain intact. A consumed spare must be named in the intended ECO. Restore any
unintentionally removed spare before rerunning the native tools. See
`design-for-eco` for the design intent.

## Detailed-route ABORT triage (TritonRoute DRT-0305 / DRT-0085 + the silent-unrouted trap)

A DRC report assumes the design routed. A more dangerous class is when
`detailed_route` itself **aborts** and the runner swallows it — producing a GDS,
a "clean" DRC, and a PASS on a design with **zero signal-routed nets**. These
patterns (captured v0.2.14; now AUTOMATED by `phase3_one_shot_runner.py`, but the
*judgment* is here for any non-sky130 PDK or fresh triage):

- **`[ERROR DRT-0305] Net <n> of signal type GROUND/POWER is not routable …
  Move to special nets.`** A non-special POWER/GROUND-typed net sitting in the
  regular `NETS` section — typically a dangling `zero_`/`one_` constant-tie stub
  left by Yosys `setundef`/`hilomap` — makes TritonRoute abort **all** detailed
  routing. Triage **structurally** (never by net-name literal): delete the net if
  it is dangling (0 iterm/0 bterm — no electrical role), else reclassify it to
  `SIGNAL` so it routes. Real PG nets are `SPECIAL` (in `SPECIALNETS`) and are
  left alone. Automated by `_pg_net_cleanup_tcl` before `global_route`.

- **`[ERROR DRT-0085] Valid access pattern combination not found for <inst>`**
  on a probe / `lpflow_*` / DRC-failed cell. Provenance heuristic: if that cell
  master appears **only in the PnR netlist** (`grep` the original RTL and the
  post-synth netlist — 0 there, N>0 in `*_pnr.v`), then an **optimizer step
  inserted it** (e.g. `repair_design` picked a probe cell as a slew-fix buffer,
  named `load_slew*`), not the designer. Fix: restrict the resizer/CTS/repair
  cell pool with `set_dont_use` fed from the **PDK's OWN** `drc_exclude.cells`
  (the `PNR_EXCLUDED_CELL_FILE` the reference flow uses). **Read the PDK file —
  do NOT hand-curate a list**: a hand list easily over-reaches (globbing
  `clkbuf_*` would wrongly kill the CTS clock buffers; `buf_16`/`mux4_4` are
  PDK-marked DRC-failed and legitimately excluded). Apply it after `link_design`,
  before any opt. Automated by `_dont_use_tcl` + `PdkConfig.pnr_exclude_cell_file`.

- **The silent-unrouted trap (doctrine, applies to ANY best-effort route step).**
  A `catch {detailed_route}` that only logs a NONFATAL warning will let a
  fully-unrouted design flow downstream and pass. **Always pair a NONFATAL route
  guard with a routing-completeness check**: a genuinely routed DEF has `+ ROUTED`
  geometry on its signal `NETS` (not just on `SPECIALNETS` PDN), and the session
  log carries no detailed-route abort marker (`DETAILED_ROUTE_NONFATAL`,
  `[ERROR DRT-0305/0085]`, `[ERROR ANT-0008]`). On incompleteness report **FAIL**,
  never a clean pass — a sign-off check that can only flip PASS→FAIL is honest;
  one that can inflate FAIL→PASS is the silicon-DOA hazard. Automated as the
  `routing_incomplete` flag in `_emit_antenna_report`.

- **Antenna repair is a routing operation, not a post-hoc edit.** OpenROAD
  `repair_antennas <diode_cell>` (plural; the diode is a **positional** arg, not a
  `-diode_cell` flag) fixes antennas chiefly by **jumper insertion** (layer
  hopping), which needs a **fresh global-route graph** — run it as
  `global_route → repair_antennas → detailed_route`; placed *after* the main
  detailed_route it degrades to diode-only (~no effect). And `check_antennas`
  cannot read routing from a re-`read_def` (`[ERROR ANT-0008]`): a separate
  measurement pass that re-`global_route`s **discards the jumpers** and mis-reports
  the repaired design — so the antenna result must be captured **in-session**, on
  the realized routing. Automated by `_antenna_repair_tcl` + the in-session read in
  `_emit_antenna_report`. **Cost note:** the repair's `detailed_route` is a full
  second route pass — gate it behind a cheap read-only `check_antennas` on the main
  route first (it reads detailed routing directly, no `global_route` needed) and
  skip the repair entirely when the design is already antenna-clean (0 net
  violations ⇒ 0 pin violations); the skip path must run no `global_route` so it
  cannot disturb the realized route.

## Captured rule

Repeated contact, implant and well markers at zero-gap GPIO interfaces can
come from physical geometry extending beyond a pad's LEF boundary. For the
`sky130A` PDK with the `sky130_ef_io__` family, `_floorplan` in
`programs/flow_chip_inputs.py` allocates at least 10 um between pads. Keep a larger
documented distance and preserve an explicitly declared die. An insufficient
declared die must not be silently enlarged.

Use the PDK bus fillers to preserve rail continuity. The smallest filler is
not necessarily enough. A native two-GPIO qualification measured 1,599 DRC
markers at zero gap. A 1 um spacer reduced that to 34 but introduced or worsened
well violations, so it was rejected. The supplied 10 um spacer cleared every
category to zero with the original deck and rule groups enabled. The PDK's
6.3 um deep-nwell rule and the native result remain unchanged.

Run `KLayout.DRC` and `Checker.KLayoutDRC` at their original zero-violation
limit. Do not filter cell interiors or check only the contact categories.
This pad-pair result does not establish full-chip DRC, PDN or timing closure.
Verify the changed chip through synthesis and the affected physical steps;
retain every remaining native failure.

## Captured rule — Preserve holes through deep geometry reduction

When hierarchical DRC flags a contact as active overlap but the raw active
layers are empty there, check the native Boolean pipeline before changing
the PDK. A merged polygon can be correct until a later operation splits it.
A cut through a concave hole can create an island bounded entirely by hole
edges. Classify reconstructed contours by their winding before assigning
holes, so holes inside that island remain empty.

KLayout [PR #10](https://github.com/vibeic/klayout/pull/10) repairs that native
cut operation. On the retained polygon, added area falls from 379740400 to
0 database square units, lost area stays 0, and all 615751350 original units
remain. The reduced deep Boolean consumer also keeps its 28900-unit hole
empty with the original reduction settings. All 89 official Python QA tests
pass, including a regression across rotations, reflections and hole order.
This is tool-component evidence; whole-chip DRC still needs the adopted image
and its original checker. Do not disable reduction or waive the marker.

## Captured rule

When a density check fails after the PDK's own fill, read which layer and which
direction is left. A maximum-density error that is already present before fill
comes from the placed cells, not from the fill script: measure the layer's
coverage of each filler master on the PDK GDS before touching the floorplan or
the fill recipe. Measured on SKY130: the foundry decap cells cover 87 to 97 %
of their own area with li1, so rows packed with them read 66 to 70 % against
the 60 % li1 maximum in every window of a pad-limited die, and the PDK fill
cannot lower it. The same library ships a decap with 52 % li1 for this purpose;
the per-PDK decap master belongs in `programs/pdk_registry.json`
(`decap_cells`). With it the row passed (608 errors, 105 after fill, to 0) on
the same die, rows and fill script, and the limit is unchanged. A die with few
standard cells is filled almost entirely by this choice, so check it first.

## Captured rule — after failed fill, identify the layout the next row reads

When density top-up fails, read its native error and the GDS paths in that
step's input, successful output if any, and the downstream verification input.
A step that raises before returning a new GDS leaves the earlier layout in
LibreLane State. A later DRC count or XOR result on that retained layout does
not verify the attempted fill. Preserve both results with their actual scope;
do not describe the failed candidate as density-clean or DRC-clean.

On the Subservient pad-keepout attempt, `VibeIC.DensityTopUp` reported
`Native Magic density violations: 98 > 0` and raised before publishing its
GDS. The row retained the pre-fill density metric, 695. Its output State and
the final physical-check input still named the seal-stage, pre-fill GDS.
Consequently the later XOR 0 and Magic DRC 9,480 described that retained
layout under pad abstraction. They did not validate the attempted top-up or
its interactions with the pads. The fill repair remains open against the
original density and physical-verification limits.

## Captured rule — repeated via DRC can come from the platform's cut pitch

When native DRC repeats cut-size, overlap and off-grid findings at supply
stacks, compare the generated via boxes and their placement pitch with the
selected platform's PDN commands before changing import or cell geometry.
Distinct legal cuts can merge into an illegal polygon when the placement
pitch is smaller than a cut. Match the native markers to those stacks;
the number of repeated hierarchical markers is not a count of independent
design mistakes.

The GF180 native-platform output measured in image 0.4.76 used
`-split_cuts {Metal3 0.128}` with 0.26 by 0.26 um Via2/Via3 cuts. Adjacent
cuts overlapped by 0.132 um, and the pitch did not follow the 0.005 um grid.
Actual GDS and ODB geometry identified the source of the repeated V2.1/V3.1,
off-grid and Magic subcell-overlap findings. Cell geometry and the metal-stack
mapping had already been checked. The platform repair belongs in its owning
tool fork; this diagnosis supplies no clean-layout after result and permits
no change to the PDK's rules or marker filtering.

## Captured rule — present taps can still violate the required distance

For native well/substrate tap-distance violations, read the declared deck's
distance and the platform's actual tapcell command, then inspect tap locations
in the layout. Counting nonzero tap instances does not establish coverage.
Core-wide markers should not be attributed to a die-margin change without
locating them.

The same GF180 native-platform outputs contained 82, 82 and 83 welltap cells,
yet the platform used `tapcell -distance 100` um against 15 um DF.13_MV and
DF.14_MV requirements. The three layouts retained hundreds of each marker
family inside the core. A separate SPM native baseline retained 661 such
findings despite having taps. These are diagnosed platform failures, not
evidence of absent cell geometry or a passing baseline. Fix and measure the
responsible platform; retain the original distance and failed results.

## Captured rule — equal pad-control values do not authorize shorting terminals

Before sharing a tie driver across pad controls, inspect the selected PDK
transistor view. A Liberty input can also touch a MOS source or drain. Shorting
that terminal to a second control on the same device's gate changes the circuit
even when both controls request the same Boolean value. Keep that gate on a
separate tie and protect only genuinely shared nets from native tie fanout
repair. Preserve individual drivers when the device view cannot resolve the
connection; equal constants alone do not establish electrical independence.

In the GF180 pad CVC case, 36 pads had aliased gate and diffusion controls.
With the same native models, power and rule limits, the reference, common-tie
and isolated-PD diagnostic returned respectively 0, 146 and 0 PMOS Gate vs
Source errors. All three native checks completed; the other error classes
were zero. Restoring only the independent PD drivers removed the finding.
This establishes the topology cause, not a silicon voltage measurement or
whole-chip ESD/latch-up closure. Keep the actual generated and routed chip's
native results when deciding whether to adopt a tie-sharing optimization;
the diagnostic alone does not qualify that implementation.

