ELECTRICAL RULES CHECK

Introduction

Proteus can check for simple errors in a design by examining the various pin types connected to each net. Obvious examples of errors are outputs connected together or several input pins connected together without a driving source. Terminals are also regarded as having an electrical type: an input terminal connected to an input pin provides a driving source for it.

Generating the Report

You can generate the ERC report by invoking the Electrical Rules Check command on the Tools menu. The same command is on the Design toolbar. The check compiles a flattened, logical netlist first, so parts on sub-sheets are checked alongside parts on the root sheets. That netlist covers the current board, so on a multi-board project you should run the check once for each board.

The results are displayed in the Text Viewer from where they can be saved or printed as required. The save name offered is the design name with an ERC extension, and the file selector filters on ERC files/*.ERC. The last report can be brought back at any time with the Text Viewer command on the System menu.

Do bear in mind that not all entries that appear in the report may actually be mistakes (e.g. some input pins might deliberately be left NC) and that more subtle mistakes such as wrong part values will not be detected. Nevertheless, many silly mistakes can be detected at an early stage.

ERC Error Messages

The first part of the ERC process involves compiling the netlist, and this in itself can result in warning or error messages.

The ERC process itself then detects three categories of finding:

  • Contentions, that is nets so wired as to be likely to result in two outputs trying to drive in different directions and a large flow of current. Which combinations of pin and terminal type contend is decided by the contention matrix below.
  • Undriven nets, that is nets so wired that there is no driving source.
  • Singular labels, that is a net name or terminal name that occurs only once on its net.

Undriven Nets

Three electrical types are treated as things that need driving: input pins, output terminals and power pins. If a net contains at least one of those three and nothing else at all, then it has no driving source and every one of them is listed on an UNDRIVEN line.

The rule is wider than it first appears. A net made up of nothing but power pins is undriven, which is why an unconnected VCC or GND pin is reported, and so is a net made up of nothing but output terminals. Input terminals are deliberately excluded, because an input terminal is itself a source of drive for the net it names.

Singular Labels

A net label or a named terminal that appears exactly once on its net has nothing of its own kind to connect to, and is reported on a SINGULAR LABEL line. The usual cause is a mistyped net name: two wires you intended to join by name each carry a name that occurs nowhere else, so instead of one net with two labels you have two nets with one label apiece.

Reading the Report

Each finding is one line. A contention names both ends of the offending pair, with the electrical type of each in brackets:

ERROR:    U1,Q (Output) connected to U2,Q (Output)

WARNING:  U3,VDD (Power Pin) connected to U4,D0 (I/O)

An undriven net lists every pin on it that needed driving, separated by semi-colons, and a singular label gives the offending name:

UNDRIVEN: U5,MCLR (Input); U5,VDD (Power Pin)

SINGULAR LABEL: CLK_IN (Input)

A terminal is reported with the literal pin name <TERM>, so a line reading DATA_OUT,<TERM> (Output) is an output terminal rather than a component pin.

Every report closes with two summary lines. The first is Netlist generated OK. or Netlist errors found., and reports on the netlist compilation rather than on the rules check. The second is No ERC errors found. or ERC errors found.

The closing summary counts warnings as well as errors, and it counts singular labels and undriven pins too. A design whose only findings are warnings still closes with ERC errors found., so read the body of the report rather than the last line.

Mapping a Report Line to the Matrix

The report prints the full name of each electrical type, while the contention matrix is indexed by two letter codes. Three of the printed names, Input, Output and I/O, are used for both a pin and its terminal counterpart, and the two rows of the matrix are not the same, so the table below gives the code to look up for each name the report can print.

Name in the report Matrix code How to tell
Passive PS Always a pin.
Input IP or IT IT if the pin name is <TERM>, otherwise IP.
Output OP or OT OT if the pin name is <TERM>, otherwise OP.
I/O IO or BT BT if the pin name is <TERM>, otherwise IO.
Tri-state TS Always a pin.
Open Collector PU A pull up pin. See the note below.
Open Emitter PD A pull down pin. See the note below.
Power Pin PP Always a pin.
Generic GT Always a terminal.
Power Terminal PT Always a terminal.
Power Rail PR Always a power rail, never a placed object.

Where a name is shared, the pin name in the report tells the two apart: a terminal is always reported with the pin name <TERM>, and anything else is a component pin.

The names printed for the two pull types are currently the wrong way round. A pull up pin is reported as Open Collector and a pull down pin is reported as Open Emitter, when a pull up is an open emitter or open source output and a pull down is an open collector or open drain output. The pin types themselves, and the matrix below, are correct as documented here; it is the two printed names that are being corrected.

The Contention Matrix

Contentions are detected by taking every pair of pins and terminals on a net in turn and looking the pair up in the following table. Each cell holds one of three codes: ok means no warning or error, wn means a warning is issued and er means an error is issued. The table is symmetric, so it does not matter which of the pair you read as the row.

 

PS

IP

OP

IO

TS

PU

PD

PP

GT

IT

OT

BT

PT

PR

PS

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

IP

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

OP

ok

ok

er

wn

er

er

er

ok

ok

er

ok

wn

er

er

IO

ok

ok

wn

ok

ok

ok

ok

wn

ok

wn

ok

ok

wn

wn

TS

ok

ok

er

ok

ok

ok

ok

er

ok

er

ok

ok

er

er

PU

ok

ok

er

ok

ok

ok

ok

wn

ok

er

ok

ok

er

er

PD

ok

ok

er

ok

ok

ok

ok

wn

ok

er

ok

ok

er

er

PP

ok

ok

ok

wn

er

wn

wn

ok

ok

ok

ok

wn

ok

ok

GT

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

IT

ok

ok

er

wn

er

er

er

ok

ok

er

ok

wn

er

er

OT

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

ok

BT

ok

ok

wn

ok

ok

ok

ok

wn

ok

wn

ok

ok

wn

wn

PT

ok

ok

er

wn

er

er

er

ok

ok

er

ok

wn

wn

ok

PR

ok

ok

er

wn

er

er

er

ok

ok

er

ok

wn

ok

er

KEY:

Code Electrical type Name printed in the report
PS Passive pin Passive
IP Input pin Input
OP Output pin Output
IO I/O pin I/O
TS Tri-state pin Tri-state
PU Pull up pin, that is an open emitter or open source output Open Collector
PD Pull down pin, that is an open collector or open drain output Open Emitter
PP Power pin Power Pin
GT Generic terminal, the PASSIVE terminal type Generic
IT Input terminal, the INPUT terminal type Input
OT Output terminal, the OUTPUT terminal type Output
BT Bi-directional terminal, the BIDIR terminal type I/O
PT Power terminal, the POWER terminal type Power Terminal
PR Power rail terminal, added to a net by the Power Rail Configuration dialogue Power Rail

The electrical type of a pin is set in the part's library entry and the electrical type of a terminal is set from its TYPE property, so a contention you disagree with is usually fixed by correcting a type rather than by rewiring.

The rules check looks at the electrical types on each net and at nothing else. Two further checks pick up faults it is not designed to find, and both are run from the layout module against the same netlist: the Single Pin Net Report lists every net with only one connection on it, which is the usual signature of a wire you meant to join and did not, and the Pre-Production Check runs the full set of manufacturing checks before you release a board.

See Also:

Pin Objects

Terminals

Device Libraries

Generating a Netlist

Single Pin Net Report

Pre-Production Check