sycan.check

Schematic / netlist electrical-rule checks.

The check_circuit() helper walks a Circuit and surfaces structural problems that are easy to mis-spot in a hand-written netlist:

  • duplicate component names (ambiguous I() / aux references),

  • nodes connected to only one component pin (dangling wires),

  • circuits that never touch ground node "0",

  • “islands” — node graphs disconnected from ground,

  • components whose port nodes overlap (short between two pins of the same device).

It returns a ERCReport so callers can either print the report or assert ERCReport.ok. The function is read-only: it never mutates the input circuit.

Functions

check_circuit(circuit)

Run structural checks and return a ERCReport.

Classes

ERCFinding(severity, code, message)

One ERC issue.

ERCReport([findings])

Aggregated ERC findings for a circuit.

class sycan.check.ERCFinding(severity, code, message)[source]

Bases: object

One ERC issue.

severity is "error" (definitely wrong) or "warning" (suspicious, may be intentional). message is a one-line human-readable description.

Parameters:
  • severity (str)

  • code (str)

  • message (str)

severity: str
code: str
message: str
class sycan.check.ERCReport(findings=<factory>)[source]

Bases: object

Aggregated ERC findings for a circuit.

Parameters:

findings (list[ERCFinding])

findings: list[ERCFinding]
property errors: list[ERCFinding]
property warnings: list[ERCFinding]
property ok: bool

True when no error-level findings were recorded.

add(severity, code, message)[source]
Parameters:
  • severity (str)

  • code (str)

  • message (str)

Return type:

None

sycan.check.check_circuit(circuit)[source]

Run structural checks and return a ERCReport.

The checks are intentionally cheap and netlist-only — no MNA assembly, no symbolic work — so check_circuit() is suitable for editor-side linting.

Parameters:

circuit (Circuit)

Return type:

ERCReport