Skip to main content

Electrical Rules Check (ERC)

These rules help ensure that the schematic is correctly designed and minimize potential issues. Each rule has a default state of Error, Warning, Info or Off:

  • Error — reported and must be resolved
  • Warning — reported but does not block output
  • Info — the check runs but results are not shown in CLI output
  • Off — the check is completely disabled; no results are produced

Running ERC checks​

To perform ERC checks, pass the -e parameter to the Circuitscript CLI tool. ERC errors will be printed out.


Connection Rules​

RuleDefault StateDescription
UNCONNECTED-PINWarningA component pin has no wire or net connected to it
UNCONNECTED-WIREWarningA wire end is not connected to a pin or another wire
NO-CONNECT-ON-CONNECTED-PINErrorA no_connect() symbol is placed on a pin that is also connected to a wire or net

Power Net Rules​

RuleDefault StateDescription
POWER-REFERENCE-ON-UNNAMED-NETErrorA power reference symbol is placed on a net with no name
POWER-NET-NAME-CONFLICTErrorTwo or more nets share the same name but are not connected
POWER-REFERENCE-AMBIGUOUS-NETErrorA power reference symbol connects to more than one net, making the target ambiguous
POWER-REFERENCE-UNCONNECTEDErrorA power reference symbol is not connected to any net
POWER-INPUT-UNCONNECTEDErrorA power input pin is not connected to a net
POWER-NET-NO-SOURCEWarningA named power net has no driving source
POWER-NET-UNUSEDWarningA named power net is defined but never used
POWER-NET-MULTIPLE-OUTPUTSWarningMultiple power output pins drive the same net (ignores same-named pins on a single component and unplaced components)
POWER-OUTPUT-UNCONNECTEDWarningA power output pin is not connected to any net
POWER-SYMBOL-UNCONNECTEDWarningA power symbol is placed but not connected to any net
NO-POWER-REFERENCE-IN-SCHEMATICWarningThe schematic contains no power reference symbols at all
POWER-NET-WITHOUT-DRIVERInfoA power net has no driver (legacy rule, deprecated)
POWER-INPUT-ON-UNNAMED-NETInfoA power input pin is on a net with no name
POWER-OUTPUT-ON-UNNAMED-NETInfoA power output pin is on a net with no name

Pin Type Compatibility Rules​

RuleDefault StateDescription
PIN-TYPE-OUTPUT-MULTIPLEWarningNet has multiple output pins — possible signal conflict
PIN-TYPE-INPUT-UNDRIVENWarningNet has input pin(s) but no driving output
PIN-TYPE-BIDIRECTIONAL-POWERWarningBidirectional pin on a power net
PIN-TYPE-OUTPUT-POWER-INPUTWarningSignal output pin driving a power net directly — missing power symbol
PIN-TYPE-PASSIVE-ONLYOffNet has only passive pins — no driver or typed receiver

Example​

from "std" import *

vcc = supply("VCC")
gnd = dgnd()

tmp = create component:
pins: 5

at tmp pin 5
wire right 100 down 100
to gnd

at tmp pin 1
add no_connect()

at tmp pin 3
add no_connect()
wire right 100
add res(10k)
wire right 100 down 200 to gnd

at tmp pin 4
wire left 200
Component J1: line 6:11133552244J1line 11:4GNDline 14:1line 17:1Component R1: line 19:1R110kline 20:28GND

The ERC output is:

ERC found 1 error(s), 5 warning(s):
1. [Warning] line 6, column: 0: UNCONNECTED-PIN - Unconnected pin: J1 pin 2
2. [Warning] line 11, column: 3: POWER-NET-UNUSED - Power net '/GND' is declared but has no physical connections
3. [Error] line 17, column: 0: NO-CONNECT-ON-CONNECTED-PIN - No connect on connected pin: J1 pin 3
4. [Warning] line 18, column: 4: POWER-NET-UNUSED - Power net '/VCC' is declared but has no physical connections
5. [Warning] line 23, column: 0: UNCONNECTED-WIRE - Unconnected wire end
6. [Warning] NO-POWER-REFERENCE-IN-SCHEMATIC - No power_reference pin found in schematic — no ground reference defined

Configuring Rule Severity​

You can override the default severity for any rule using the erc_set() built-in function. Overrides apply globally to the document.

erc_set(rule_name, severity)​

Sets the severity for the given rule.

  • rule_name — a string matching a valid rule identifier (e.g. "UNCONNECTED-PIN")
  • severity — one of "error", "warning", "info", or "off"

Throws a runtime error if either argument is invalid.

erc_get(rule_name)​

Returns the severity override previously set by erc_set() for the given rule, or "unknown" if no override has been set. Throws a runtime error if rule_name is not a valid rule identifier.


Examples for changing severity​

Raise a rule from warning to error:

erc_set("UNCONNECTED-PIN", "error")

Suppress a rule entirely:

erc_set("UNCONNECTED-PIN", "off")

Query the current severity:

severity = erc_get("UNCONNECTED-PIN")

Bridging nets for ERC​

Pin type rules like PIN-TYPE-INPUT-UNDRIVEN treat each net independently, so a 2-pin passive part placed as an electrical pass-through (e.g. a 0Ω resistor, jumper, or ferrite bead) splits a single logical connection into two nets. If the driver sits on one side and an input pin sits on the other, ERC sees an undriven input even though the part passes the signal straight through.

Setting the erc_net_bridge component property to true tells ERC to treat that component's two pins as electrically joined for connectivity checks only, so a driver on either side satisfies rules on both nets. It does not affect the actual net/wire data used by layout, rendering, BOM, KiCad export, ngspice export, or nodal analysis — only the ERC diagnostics use the bridge.

from "std" import *

driver = create component:
pins:
1: "OUT", "output"

sink = create component:
pins:
1: "IN", "input"

bridge = create component:
pins:
1: "1", "passive"
2: "2", "passive"
erc_net_bridge: true

at driver pin 1
wire right 100
add bridge
wire right 100
to sink pin 1
Component J1: line 3:1OUT1J1Component J3: line 11:11122J3Component J2: line 7:1IN1J2

Without erc_net_bridge: true on bridge's definition, this reports PIN-TYPE-INPUT-UNDRIVEN on the net between bridge and sink, since the driver is on the other side of bridge. With it set, the two nets are treated as one for that check.

There is no automatic default based on component value — it must be set explicitly, and it's only valid on components with exactly 2 pins. Like params, it may be changed after creation (e.g. bridge.erc_net_bridge = false).