DrcViolation
A single DRC violation.
Returned as part of a DrcResult after running run_drc(). Each violation
describes a specific rule failure, including the rule name, affected layer(s),
severity, and a bounding box around the offending geometry.
result = run_drc(cell, rules)
for v in result.violations:
print(f"[{v.severity}] {v.rule_type} on {v.layer}: {v.message}")Attributes
attributerule_namestr | NoneName of the rule that was violated, or None if the rule was not named.
attributemessagestrHuman-readable description of the violation.
attributeseveritystrSeverity level: "error" or "warning".
attributerule_typestrType of the DRC rule that was violated (e.g., "min_width", "min_spacing").
attributelayertuple[int, int]The (number, datatype) of the primary layer involved in the violation.
attributelayer2tuple[int, int] | NoneThe (number, datatype) of the second layer, for inter-layer rules (e.g.,
spacing, enclosure). None for single-layer rules.
attributebboxtuple[tuple[float, float], tuple[float, float]]Bounding box of the violation as ((min_x, min_y), (max_x, max_y)).
Coordinate frame: top-level (flattened, global) coordinates, the same frame as the final GDS output. Violations raised inside a nested cell are reported at the cell's placed position, not in its local coordinate system. This contract holds for every rule type.
attributecell_namestr | NoneName of the cell containing the polygon that triggered the violation.
Populated for every attributable violation: all per-polygon rules
(min_width, min_area, allowed_angles, min_edge_length,
self_intersection, max_width, acute_angle, snap_to_grid), all
same-layer and cross-layer pairwise rules, and not_inside (set to the
inner-layer cell). The only rule type that leaves cell_name as None by
design is density, which is a window-level check with no single source
polygon.
attributecell_name2str | NoneName of the cell containing the second polygon involved in the violation.
For intra-cell same-layer pairwise violations (both polygons inside the
same cell definition), this equals cell_name. For inter-instance or
cross-layer pairwise rules, it identifies the other cell. None for
per-polygon rules and for cases where the second side is undefined. Examples:
an enclosure violation with no outer polygon on the layer, a
require_overlap miss (no matching polygon), or a not_inside violation
(which unions all outer polygons before testing).