KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ERC_TESTER Class Reference

#include <erc.h>

Public Member Functions

 ERC_TESTER (SCHEMATIC *aSchematic)
 
void TestOthersItems (NETLIST_OBJECT_LIST *aList, unsigned aNetItemRef, unsigned aNetStart, int *aMinConnexion)
 Perform ERC testing for electrical conflicts between NetItemRef and other items (mainly pin) on the same net. More...
 
int TestDuplicateSheetNames (bool aCreateMarker)
 Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated). More...
 
void TestTextVars (DS_PROXY_VIEW_ITEM *aDrawingSheet)
 Check for any unresolved text variable references. More...
 
int TestConflictingBusAliases ()
 Check that there are no conflicting bus alias definitions in the schematic. More...
 
int TestMultiunitFootprints ()
 Test if all units of each multiunit symbol have the same footprint assigned. More...
 
int TestNoConnectPins ()
 In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type. More...
 
int TestPinToPin ()
 Checks the full netlist against the pin-to-pin connectivity requirements. More...
 
int TestMultUnitPinConflicts ()
 Checks if shared pins on multi-unit symbols have been connected to different nets. More...
 
int TestSimilarLabels ()
 Checks for labels that differ only in capitalization. More...
 
int TestLibSymbolIssues ()
 Test symbols for changed library symbols and broken symbol library links. More...
 
int TestOffGridEndpoints (int aGridSize)
 Test pins and wire ends for being off grid. More...
 
int TestSimModelIssues ()
 Test SPICE models for various issues. More...
 
int TestMissingUnits ()
 Test for uninstantiated units of multi unit symbols. More...
 
void RunTests (DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, PROGRESS_REPORTER *aProgressReporter)
 

Private Attributes

SCHEMATICm_schematic
 

Detailed Description

Definition at line 49 of file erc.h.

Constructor & Destructor Documentation

◆ ERC_TESTER()

ERC_TESTER::ERC_TESTER ( SCHEMATIC aSchematic)
inline

Definition at line 53 of file erc.h.

Member Function Documentation

◆ RunTests()

◆ TestConflictingBusAliases()

int ERC_TESTER::TestConflictingBusAliases ( )

Check that there are no conflicting bus alias definitions in the schematic.

(for example, two hierarchical sub-sheets contain different definitions for the same bus alias)

Returns
the error count

Definition at line 299 of file erc.cpp.

References _, ERC_ITEM::Create(), ERCE_BUS_ALIAS_CONFLICT, SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), m_schematic, and SCHEMATIC::Root().

Referenced by BOOST_FIXTURE_TEST_CASE(), and RunTests().

◆ TestDuplicateSheetNames()

int ERC_TESTER::TestDuplicateSheetNames ( bool  aCreateMarker)

Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).

Returns
the error count
Parameters
aCreateMarkertrue = create error markers in schematic, false = calculate error count only

Definition at line 129 of file erc.cpp.

References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_DUPLICATE_SHEET_NAME, SCH_SCREENS::GetFirst(), SCH_SCREENS::GetNext(), SCH_SHEET::GetPosition(), SCH_SHEET::GetShownName(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), SCHEMATIC::Root(), and SCH_SHEET_T.

Referenced by RunTests().

◆ TestLibSymbolIssues()

◆ TestMissingUnits()

◆ TestMultiunitFootprints()

◆ TestMultUnitPinConflicts()

int ERC_TESTER::TestMultUnitPinConflicts ( )

Checks if shared pins on multi-unit symbols have been connected to different nets.

Returns
the error count

Definition at line 769 of file erc.cpp.

References _, SCH_SCREEN::Append(), SCHEMATIC::ConnectionGraph(), ERC_ITEM::Create(), ERCE_DIFFERENT_UNIT_NET, CONNECTION_SUBGRAPH::GetItems(), CONNECTION_GRAPH::GetNetMap(), CONNECTION_SUBGRAPH::GetSheet(), SCH_SHEET_PATH::LastScreen(), m_schematic, name, pin, and SCH_PIN_T.

Referenced by BOOST_FIXTURE_TEST_CASE(), and RunTests().

◆ TestNoConnectPins()

int ERC_TESTER::TestNoConnectPins ( )

In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type.

In KiCad 6, this no longer results in those pins joining the net, so we need to warn about it

Returns
the error count

Definition at line 551 of file erc.cpp.

References _, ERC_ITEM::Create(), ERCE_NOCONNECT_CONNECTED, SCH_SYMBOL::GetPins(), SCHEMATIC::GetSheets(), m_schematic, pin, and SCH_SYMBOL_T.

Referenced by BOOST_FIXTURE_TEST_CASE(), and RunTests().

◆ TestOffGridEndpoints()

int ERC_TESTER::TestOffGridEndpoints ( int  aGridSize)

◆ TestOthersItems()

void ERC_TESTER::TestOthersItems ( NETLIST_OBJECT_LIST *  aList,
unsigned  aNetItemRef,
unsigned  aNetStart,
int *  aMinConnexion 
)

Perform ERC testing for electrical conflicts between NetItemRef and other items (mainly pin) on the same net.

Parameters
aList= a reference to the list of connected objects
aNetItemRef= index in list of the current object
aNetStart= index in list of net objects of the first item
aMinConnexion= a pointer to a variable to store the minimal connection found( NOD, DRV, NPI, NET_NC)

◆ TestPinToPin()

◆ TestSimilarLabels()

◆ TestSimModelIssues()

int ERC_TESTER::TestSimModelIssues ( )

◆ TestTextVars()

Member Data Documentation

◆ m_schematic


The documentation for this class was generated from the following files: