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 — reported for information only
- 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 results are printed sorted by severity: errors first, then warnings, then info items.
Connection Rules
| Rule | Default State | Description |
|---|---|---|
UNCONNECTED-PIN | Warning | A component pin is the only physical pin on its net |
UNCONNECTED-WIRE | Warning | A wire end is not connected to a pin or another wire |
NO-CONNECT-ON-CONNECTED-PIN | Error | A no_connect() symbol is placed on a net that has more than one physical pin (reported once per net) |
Power Net Rules
| Rule | Default State | Description |
|---|---|---|
POWER-REFERENCE-ON-UNNAMED-NET | Error | A power reference symbol is placed on a net with no name |
POWER-NET-NAME-CONFLICT | Error | Two or more nets share the same name but are not connected |
POWER-REFERENCE-AMBIGUOUS-NET | Error | A power reference symbol connects to more than one net, making the target ambiguous |
POWER-REFERENCE-UNCONNECTED | Error | A power reference symbol is not connected to any net |
POWER-INPUT-UNCONNECTED | Error | A power input pin is not connected to a net |
POWER-NET-NO-SOURCE | Warning | A named power net has no driving source |
POWER-NET-UNUSED | Warning | A named power net is defined but never used |
POWER-NET-MULTIPLE-OUTPUTS | Warning | Multiple power output pins drive the same net (ignores same-named pins on a single component and unplaced components) |
POWER-OUTPUT-UNCONNECTED | Warning | A power output pin is not connected to any net |
POWER-SYMBOL-UNCONNECTED | Warning | A power symbol is placed but not connected to any net |
NO-POWER-REFERENCE-IN-SCHEMATIC | Warning | The schematic contains no power reference symbols at all |
POWER-NET-WITHOUT-DRIVER | Info | A power net has no driver (legacy rule, deprecated) |
POWER-INPUT-ON-UNNAMED-NET | Info | A power input pin is on a net with no name |
POWER-OUTPUT-ON-UNNAMED-NET | Info | A power output pin is on a net with no name |
Pin Type Compatibility Rules
| Rule | Default State | Description |
|---|---|---|
PIN-TYPE-OUTPUT-MULTIPLE | Warning | Net has multiple output pins — possible signal conflict |
PIN-TYPE-INPUT-UNDRIVEN | Warning | Net has input pin(s) but no driving output |
PIN-TYPE-BIDIRECTIONAL-POWER | Warning | Bidirectional pin on a power net |
PIN-TYPE-OUTPUT-POWER-INPUT | Warning | Signal output pin driving a power net directly — missing power symbol |
PIN-TYPE-PASSIVE-ONLY | Off | Net has only passive pins — no driver or typed receiver |
No-connect markers
A pin marked with no_connect() (or its alias dnc(), a "do not connect" marker) is intentionally unused. When a single pin sits alone on its net together with a no-connect marker, the pin type compatibility rules above (for example PIN-TYPE-INPUT-UNDRIVEN) are not reported for that net. Nets shared by more than one pin are still checked.
NO-CONNECT-ON-CONNECTED-PIN counts only physical pins on the net: net markers (supply, label), buses, ports, modules and graphics are ignored. A no-connect is therefore flagged only when its net contains more than one physical pin, and at most once per net.
Unconnected pins
UNCONNECTED-PIN looks at the net a pin belongs to rather than at the wires drawn to it. A pin is reported unless its net contains at least one other physical pin. This means:
- A pin tied only to a
supply,labelor other net symbol, or to a dangling wire, is reported as unconnected. - Two physical pins joined only through a shared net name (for example two
label("SDA")symbols) count as connected. - A
no_connect()marker on the net clears the warning. - Graphic components (text, markers, frames) are not checked.
dnc(size=20) is an alias of no_connect(size=20) from the standard library.
Imported files
When a violation originates in an imported file, the ERC report item includes the path of the source file in the CLI output.
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
The ERC output is:
ERC found 1 error(s), 6 warning(s), 0 info:
1. [Error] input.cst: line 17, column: 0: NO-CONNECT-ON-CONNECTED-PIN - No connect on connected pin: J1 pin 3
2. [Warning] .../circuitscript/dist/libs/std.cst: line 22, column: 4: POWER-NET-UNUSED - Power net '/VCC' is declared but has no physical connections
3. [Warning] input.cst: line 6, column: 0: UNCONNECTED-PIN - Unconnected pin: J1 pin 2
4. [Warning] input.cst: line 6, column: 0: UNCONNECTED-PIN - Unconnected pin: J1 pin 4
5. [Warning] input.cst: line 11, column: 3: POWER-NET-UNUSED - Power net '/GND' is declared but has no physical connections
6. [Warning] input.cst: line 23, column: 0: UNCONNECTED-WIRE - Unconnected wire end
7. [Warning] NO-POWER-REFERENCE-IN-SCHEMATIC - No power_reference pin found in schematic — no ground reference defined
J1 pin 4 is reported because the wire drawn from it does not reach another physical pin. The VCC item points at the standard library file, because the supply() symbol is created there (see Imported files).
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. This includes POWER-NET-NO-SOURCE: a power net sourced through a bridge (including chained bridges) is not reported as having no source. 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
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).