LOGIC-8 Polarity mismatch by name¶
| Severity | Status | Implementation |
|---|---|---|
| warning | runs in better_erc | easy, depends on IMP-1 |
Data it needs: graph, fitted parts.
Looks at. Pin and net names.
What it catches. An active-low output (_N, #, ~, n prefix) wired to an active-high input or the reverse, with no inverter between: PGOOD into ~EN, ~INT into a pin configured for rising-edge interrupts, RESET into ~RST.
Why it matters. Names are the only polarity information in a netlist, and a mismatch is either a bug (the regulator is enabled exactly when the other is not good) or a deliberate inversion that deserves a comment. Both are cheap to list.
Example. A sequencer wires rail A's PGOOD (active high, "good") to rail B's ~EN (active low, "enable"): B runs while A is not good and shuts down when A is good. The same PG into B's ~SHDN (active low, "shut down") is right: the markers differ, and so do the words' senses.
How to check. Parse active-low markers in pin names (and net names) on both ends of each net (IMP-1); report pairs whose markers differ when no inverting part (logic inverter, transistor stage) sits between. better_erc (erc_checks/src/logic/logic_8.rs, erc_analysis::names::polarity) reads the marker (~{X}, ~X, X_N, nX, NRST, X#, Xn) and the function word of the output pins (output, open collector or emitter, tri-state) and input pins of the fitted parts on each net; when no output names a polarity (a GPIO), the net's name stands for the driver. Words have a sense: EN, CS, PG, READY let something run, SHDN, RESET, PD, FAULT stop it, INT, IRQ, ALERT are events. Markers that differ between words of the same sense (or of an event) are a finding; between a run word and a stop word, markers that agree are (PG into SHDN). A driver and an input on one net have no inverter between them; a pin with an alternate-function list (PA4/SPI1_NSS) or a lone _N (a pair's negative half as likely) states no polarity.
Fix. Fix the wiring, add an inverter, or rename so the polarity is visible.
References. AoE3 chapter 10 (active-low signals); the catalogue's NAME category (naming and conventions).
Test schematics¶
Each schematic below is in test_schematics/sources. The block under it is what berc check --only LOGIC-8 reports on it.
logic-8_polarity¶
warning LOGIC-8 #cdg /HUB_RESET_N: net name /HUB_RESET_N (active low) into U6.3 RESET (active high)
net /HUB_RESET_N, part U6
fix: fix the wiring, add an inverter, or rename so the polarity is visible
warning LOGIC-8 #rch /PG_A: U1.3 PGOOD (active high) into U2.3 ~{EN} (active low)
net /PG_A, part U1, part U2
fix: fix the wiring, add an inverter, or rename so the polarity is visible
warning LOGIC-8 #n00 /RST_B: U4.3 ~{RESET} (active low) into U5.3 RESET (active high)
net /RST_B, part U4, part U5
fix: fix the wiring, add an inverter, or rename so the polarity is visible
LOGIC-8 also fires on the test schematics of other checks: clk-14_push_pull_reset, clk-15_shared_reset, clk-7_reset_capacitors, name-10_active_low_unmarked.