Skip to content

LIB-3 MOSFET pins not named G/D/S

Severity Status Implementation
warning runs in better_erc easy, depends on netlist

Data it needs: graph, part classes.

Looks at. Part class (MOSFET), pin names.

What it catches. A transistor recognised as a MOSFET (by reference prefix Q, library part or value) whose pins are not named G, D and S (or the obvious long forms), for example pins named 1, 2, 3.

Why it matters. Many checks need to know which pin is which: gate drive and gate pull-down checks (IO-3), reverse-polarity and load-switch checks, the body diode direction, Vds rating (RATE-4). With numbered pins the code cannot tell gate from drain, so those checks either skip the part or guess. A numbered symbol also hides a wrong pin mapping between symbol and footprint (LIB-11), since SOT-23 MOSFETs do not all share one pinout.

Example. A generic Q_NMOS symbol whose pins are 1, 2, 3, used for a 2N7002 (SOT-23: 1 gate, 2 source, 3 drain). The gate pull-down check of the load switch next to it cannot find the gate and reports nothing.

How to check. Parts classed as MOSFETs (by library or description) whose pins are not named G/GATE, D/DRAIN and S/SOURCE (erc_checks/src/lib/lib_3.rs, test schematic lib-3_mosfet_pin_names).

Fix. Use a symbol with named pins whose order matches the package, or rename the pins in the library symbol.

References. KLC S4.1 (general pin requirements); KLC S2.3 (a separate symbol per footprint pin order where packages differ).

Test schematics

Each schematic below is in test_schematics/sources. The block under it is what berc check --only LIB-3 reports on it.

lib-3_mosfet_pin_names

The test schematic lib-3_mosfet_pin_names The test schematic lib-3_mosfet_pin_names

  warning    LIB-3 #80a     MOSFET Q1 (Fixture:NMOS): pins not named G, D and S (1 unnamed, 2 unnamed, 3 unnamed)
                            part Q1
                            class = MOSFET (derived class from the symbol's description and keywords)
                            fix: use a symbol with named pins in the package's order, or name them in the library