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 | None

Name of the rule that was violated, or None if the rule was not named.

attributemessagestr

Human-readable description of the violation.

attributeseveritystr

Severity level: "error" or "warning".

attributerule_typestr

Type 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] | None

The (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)).

On this page