Drc#

class pyedb.workflows.drc.drc.Drc(edb: pyedb.Edb)#

Lightweight, high-accuracy DRC engine that runs inside an open PyEDB session.

The engine is thread-safe and uses an R-tree spatial index for scalable geometry queries. All rule checks are parallelised with concurrent.futures.ThreadPoolExecutor.

Parameters:
edbpyedb.Edb

Active EDB session (must already be open).

Examples

>>> edb = pyedb.Edb("my_board.aedb")
>>> rules = Rules.load("rules.json")
>>> drc = Drc(edb)
>>> violations = drc.check(rules)
>>> drc.to_ipc356a("review.ipc")

Overview#

check

Run all rules and return a list of violations.

to_ipc356a

Write a complete IPC-D-356A netlist plus DRC comments for fab review.

Import detail#

from pyedb.workflows.drc.drc import Drc

Attribute detail#

Drc.edb#
Drc.violations: List[Dict[str, Any]] = []#

Method detail#

Drc.check(rules: Rules) List[Dict[str, Any]]#

Run all rules and return a list of violations.

Rules are dispatched to the appropriate internal handler (_rule_*) automatically. The method is thread-safe and re-entrant; successive calls overwrite previous results.

Parameters:
rulesRules

Validated rule container.

Returns:
list[dict]

Each dictionary describes a single violation and contains at minimum the keys:

  • rule – rule type (minLineWidth, minClearance, …)

  • limit_um – limit value in micrometres

  • Additional keys are rule-specific (layer, net1, primitive, …)

Drc.to_ipc356a(file_path: str) None#

Write a complete IPC-D-356A netlist plus DRC comments for fab review.

The file can be imported by any CAM tool that supports IPC-D-356A (Valor, Genesis, etc.). Violations are appended as comment lines starting with C.

Parameters:
file_pathstr | os.PathLike

Output path. Overwrites existing files without warning.