|
KiCad PCB EDA Suite
|
Runs the electrical rules checks and adds a SCH_MARKER for each violation. More...
#include <erc.h>
Public Member Functions | |
| ERC_TESTER (SCHEMATIC *aSchematic, bool aShowAllErrors=false) | |
| int | TestDuplicateSheetNames (bool aCreateMarker) |
| Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated). | |
| int | TestPinMap (KIFACE *aCvPcb, PROJECT *aProject) |
| Check pin-to-pad maps (issue #2282): stale pin references, duplicate pad targets, bad pads and unmapped connected pins. | |
| void | TestTextVars (DS_PROXY_VIEW_ITEM *aDrawingSheet) |
| Check for any unresolved text variable references. | |
| int | TestFieldNameWhitespace () |
| Check for field names with leading or trailing whitespace. | |
| int | TestEmptyLabelNames () |
| Check for labels with empty or whitespace-only names. | |
| int | TestMultiunitFootprints () |
| Test if all units of each multiunit symbol have the same footprint assigned. | |
| int | TestNoConnectPins () |
| In KiCad 5 and earlier, you could connect stuff up to pins with NC electrical type. | |
| int | TestPinToPin () |
| Checks the full netlist against the pin-to-pin connectivity requirements. | |
| int | TestMultUnitPinConflicts () |
| Checks if shared pins on multi-unit symbols have been connected to different nets. | |
| int | TestDuplicatePinNets () |
| Checks if duplicate pin numbers within a symbol are connected to different nets. | |
| int | TestGroundPins () |
| Checks for ground-labeled pins not on a ground net while another pin is. | |
| int | TestStackedPinNotation () |
| Checks for pin numbers that resemble stacked pin notation but are invalid. | |
| int | TestSameLocalGlobalLabel () |
| Checks for global and local labels with the same name. | |
| int | TestSimilarLabels () |
| Checks for labels that differ only in capitalization. | |
| int | TestFourWayJunction () |
| Test to see if there are potentially confusing 4-way junctions in the schematic. | |
| int | TestLabelMultipleWires () |
| Test to see if there are labels that are connected to more than one wire. | |
| int | TestLibSymbolIssues () |
| Test symbols for changed library symbols and broken symbol library links. | |
| int | TestFootprintLinkIssues (KIFACE *aCvPcb, PROJECT *aProject) |
| Test footprint links against the current footprint libraries. | |
| int | TestFootprintFilters () |
| Test symbols to ensure that assigned footprint passes any given footprint filters. | |
| int | TestOffGridEndpoints () |
| Test pins and wire ends for being off grid. | |
| int | TestSimModelIssues () |
| Test SPICE models for various issues. | |
| int | TestMissingUnits () |
| Test for uninstantiated units of multi unit symbols. | |
| int | TestMissingNetclasses () |
| Tests for netclasses that are referenced but not defined. | |
| int | TestVariantSymbols () |
| Test all variant symbol overrides for resolution and pin compatibility. | |
| void | RunTests (DS_PROXY_VIEW_ITEM *aDrawingSheet, SCH_EDIT_FRAME *aEditFrame, KIFACE *aCvPcb, PROJECT *aProject, PROGRESS_REPORTER *aProgressReporter) |
Static Public Member Functions | |
| static int | TestConnectivity (SCHEMATIC &aSchematic) |
Private Member Functions | |
| std::vector< SCH_CONNECTIVITY::MULTI_UNIT_GROUP > | multiUnitSources () const |
Private Attributes | |
| SCHEMATIC * | m_schematic |
| ERC_SETTINGS & | m_settings |
| SCH_SHEET_LIST | m_sheetList |
| SCH_SCREENS | m_screens |
| SCH_MULTI_UNIT_REFERENCE_MAP | m_refMap |
| const NET_MAP & | m_nets |
| bool | m_showAllErrors |
Runs the electrical rules checks and adds a SCH_MARKER for each violation.
With ADVANCED_CFG::m_ConnectivityEngine on, most checks read the published connectivity through SCHEMATIC::Connectivity() and the SCH_CONNECTIVITY::ENGINE diagnostic accessors, and some still read the live model. Otherwise the checks read CONNECTION_GRAPH and the live model.
| ERC_TESTER::ERC_TESTER | ( | SCHEMATIC * | aSchematic, |
| bool | aShowAllErrors = false ) |
Definition at line 337 of file erc.cpp.
References ADVANCED_CFG::GetCfg(), m_nets, m_refMap, m_schematic, m_screens, m_settings, m_sheetList, m_showAllErrors, and SYMBOL_FILTER_ALL.
|
private |
Definition at line 889 of file erc.cpp.
References SCH_CONNECTIVITY::ExtractUnitFacts(), ADVANCED_CFG::GetCfg(), SCH_REFERENCE::GetFootprint(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetRef(), SCH_REFERENCE::GetSheetPath(), SCH_REFERENCE::GetSymbol(), SCH_REFERENCE::GetUnit(), group, m_refMap, m_schematic, EDA_ITEM::m_Uuid, SCH_SHEET_PATH::PathRef(), and result.
Referenced by TestMissingUnits(), and TestMultiunitFootprints().
| void ERC_TESTER::RunTests | ( | DS_PROXY_VIEW_ITEM * | aDrawingSheet, |
| SCH_EDIT_FRAME * | aEditFrame, | ||
| KIFACE * | aCvPcb, | ||
| PROJECT * | aProject, | ||
| PROGRESS_REPORTER * | aProgressReporter ) |
Definition at line 3338 of file erc.cpp.
References _, PROGRESS_REPORTER::AdvancePhase(), ERCE_DIFFERENT_UNIT_FP, ERCE_DIFFERENT_UNIT_NET, ERCE_DUPLICATE_PIN_ERROR, ERCE_DUPLICATE_SHEET_NAME, ERCE_EMPTY_LABEL_NAME, ERCE_ENDPOINT_OFF_GRID, ERCE_FIELD_NAME_WHITESPACE, ERCE_FOOTPRINT_FILTERS, ERCE_FOOTPRINT_LINK_ISSUES, ERCE_FOUR_WAY_JUNCTION, ERCE_GROUND_PIN_NOT_GROUND, ERCE_LABEL_MULTIPLE_WIRES, ERCE_LIB_SYMBOL_ISSUES, ERCE_LIB_SYMBOL_MISMATCH, ERCE_MISSING_BIDI_PIN, ERCE_MISSING_INPUT_PIN, ERCE_MISSING_POWER_INPUT_PIN, ERCE_MISSING_UNIT, ERCE_NOCONNECT_CONNECTED, ERCE_PIN_MAP_BAD_PAD, ERCE_PIN_MAP_DUPLICATE_PAD, ERCE_PIN_MAP_STALE_PIN, ERCE_PIN_MAP_UNMAPPED_PIN, ERCE_PIN_NOT_DRIVEN, ERCE_PIN_TO_PIN_ERROR, ERCE_PIN_TO_PIN_WARNING, ERCE_POWERPIN_NOT_DRIVEN, ERCE_SAME_LOCAL_GLOBAL_LABEL, ERCE_SAME_LOCAL_GLOBAL_POWER, ERCE_SIMILAR_LABEL_AND_POWER, ERCE_SIMILAR_LABELS, ERCE_SIMILAR_POWER, ERCE_SIMULATION_MODEL, ERCE_STACKED_PIN_SYNTAX, ERCE_UNDEFINED_NETCLASS, ERCE_UNRESOLVED_VARIABLE, ERCE_VARIANT_SYMBOL_INCOMPATIBLE, ERCE_VARIANT_SYMBOL_INVALID, ADVANCED_CFG::GetCfg(), GLOBAL_CLEANUP, m_schematic, m_screens, m_settings, MARKER_BASE::MARKER_ERC, NO_CLEANUP, SCH_EDIT_FRAME::RecalculateConnections(), TestConnectivity(), TestDuplicatePinNets(), TestDuplicateSheetNames(), TestEmptyLabelNames(), TestFieldNameWhitespace(), TestFootprintFilters(), TestFootprintLinkIssues(), TestFourWayJunction(), TestGroundPins(), TestLabelMultipleWires(), TestLibSymbolIssues(), TestMissingNetclasses(), TestMissingUnits(), TestMultiunitFootprints(), TestMultUnitPinConflicts(), TestNoConnectPins(), TestOffGridEndpoints(), TestPinMap(), TestPinToPin(), TestSameLocalGlobalLabel(), TestSimilarLabels(), TestSimModelIssues(), TestStackedPinNotation(), TestTextVars(), and TestVariantSymbols().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), EESCHEMA_JOBS_HANDLER::JobSchErc(), and DIALOG_ERC::testErc().
|
static |
Definition at line 2260 of file erc.cpp.
References _, SCHEMATIC::Connectivity(), ERC_ITEM::Create(), SCH_CONNECTIVITY::FACADE::Engine(), ERCE_BUS_ENTRY_CONFLICT, ERCE_BUS_TO_BUS_CONFLICT, ERCE_BUS_TO_NET_CONFLICT, ERCE_DRIVER_CONFLICT, ERCE_HIERACHICAL_LABEL, ERCE_LABEL_NOT_CONNECTED, ERCE_LABEL_SINGLE_PIN, ERCE_NOCONNECT_CONNECTED, ERCE_NOCONNECT_NOT_CONNECTED, ERCE_PIN_NOT_CONNECTED, ERCE_SINGLE_GLOBAL_LABEL, ERCE_UNCONNECTED_WIRE_ENDPOINT, ERCE_WIRE_DANGLING, ERCE_WIRED_IMPLICIT_POWER, SCHEMATIC::ErcSettings(), group, ERC_SETTINGS::IsTestEnabled(), name, niluuid, pin, and UnescapeString().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), CONNECTION_GRAPH::RunERC(), and RunTests().
| int ERC_TESTER::TestDuplicatePinNets | ( | ) |
Checks if duplicate pin numbers within a symbol are connected to different nets.
Symbols may have multiple pins with the same number if they are all connected to the same net. If duplicate pins are on different nets, an error is reported.
Definition at line 2446 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_DUPLICATE_PIN_ERROR, ADVANCED_CFG::GetCfg(), LIB_SYMBOL::GetDuplicatePinNumbersAreJumpers(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), ADVANCED_CFG::m_ConnectivityEngine, m_sheetList, EE_RTREE::OfType(), pin, and SCH_SYMBOL_T.
Referenced by BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestDuplicateSheetNames | ( | bool | aCreateMarker | ) |
Inside a given sheet, one cannot have sheets with duplicate names (file names can be duplicated).
| aCreateMarker | True creates markers from captured connectivity when the new engine is enabled; call after rebuilding. False checks fresh model state without rebuilding, for export and highlight preflight. The legacy engine always reads live state. |
Definition at line 350 of file erc.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_DUPLICATE_SHEET_NAME, ADVANCED_CFG::GetCfg(), SCH_SHEET::GetField(), SCH_SHEET::GetPosition(), SCH_FIELD::GetShownText(), SCH_SCREEN::Items(), m_schematic, name, EE_RTREE::OfType(), path, RESOLVED, SCH_SHEET_T, and SHEET_NAME.
Referenced by BOOST_AUTO_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestEmptyLabelNames | ( | ) |
Check for labels with empty or whitespace-only names.
Definition at line 759 of file erc.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_EMPTY_LABEL_NAME, ADVANCED_CFG::GetCfg(), SCH_TEXT::GetPosition(), EDA_TEXT::GetText(), SCH_SCREEN::Items(), labelTypes, SCH_SHEET_PATH::LastScreen(), m_schematic, m_sheetList, EE_RTREE::OfType(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, and text.
Referenced by EMPTY_LABEL_ERC_FIXTURE::RunCheck(), and RunTests().
| int ERC_TESTER::TestFieldNameWhitespace | ( | ) |
Check for field names with leading or trailing whitespace.
Definition at line 804 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_FIELD_NAME_WHITESPACE, ADVANCED_CFG::GetCfg(), SCH_SHEET::GetFields(), SCH_SYMBOL::GetFields(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), m_schematic, m_sheetList, EE_RTREE::OfType(), SCH_SHEET_T, and SCH_SYMBOL_T.
Referenced by BOOST_AUTO_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestFootprintFilters | ( | ) |
Test symbols to ensure that assigned footprint passes any given footprint filters.
Definition at line 3011 of file erc.cpp.
References _, collectFootprints(), ERCE_FOOTPRINT_FILTERS, filter, LIB_ID::GetUniStringLibItemName(), m_schematic, LIB_ID::Parse(), and source.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
Test footprint links against the current footprint libraries.
Definition at line 2950 of file erc.cpp.
References _, collectFootprints(), ERCE_FOOTPRINT_LINK_ISSUES, FOOTPRINT, LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), KIFACE::IfaceOrAddress(), KIFACE_TEST_FOOTPRINT_LINK, KIFACE_TEST_FOOTPRINT_LINK_LIBRARY_NOT_ENABLED, KIFACE_TEST_FOOTPRINT_LINK_NO_FOOTPRINT, KIFACE_TEST_FOOTPRINT_LINK_NO_LIBRARY, m_schematic, LIB_ID::Parse(), Pgm(), and source.
Referenced by BOOST_AUTO_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestFourWayJunction | ( | ) |
Test to see if there are potentially confusing 4-way junctions in the schematic.
Definition at line 1195 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_FOUR_WAY_JUNCTION, ADVANCED_CFG::GetCfg(), SCH_LINE::GetConnectionPoints(), SCH_SYMBOL::GetPins(), SCH_LINE::IsGraphicLine(), SCH_PIN::IsVisible(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), m_schematic, m_sheetList, EE_RTREE::OfType(), pin, SCH_LINE_T, SCH_PIN_T, and SCH_SYMBOL_T.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestGroundPins | ( | ) |
Checks for ground-labeled pins not on a ground net while another pin is.
Definition at line 2529 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_GROUND_PIN_NOT_GROUND, ADVANCED_CFG::GetCfg(), SCH_SYMBOL::GetPins(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), m_schematic, m_sheetList, SCH_CONNECTION::Name(), EE_RTREE::OfType(), pin, PT_POWER_IN, PT_POWER_OUT, and SCH_SYMBOL_T.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestLabelMultipleWires | ( | ) |
Test to see if there are labels that are connected to more than one wire.
Definition at line 1124 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_LABEL_MULTIPLE_WIRES, ADVANCED_CFG::GetCfg(), SCH_LABEL_BASE::GetConnectionPoints(), SCH_LINE::IsEndPoint(), SCH_LINE::IsGraphicLine(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), m_schematic, m_sheetList, EE_RTREE::OfType(), EE_RTREE::Overlapping(), SCH_LABEL_T, and SCH_LINE_T.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestLibSymbolIssues | ( | ) |
Test symbols for changed library symbols and broken symbol library links.
Definition at line 2768 of file erc.cpp.
References _, SCH_SCREEN::Append(), SCH_CONNECTIVITY::LIBRARY_SYMBOL_FACT::attributes, CheckDuplicatePins(), ERC_ITEM::Create(), LIB_SYMBOL_ATTRIBUTES::duplicatePinNumbersAreJumpers, ERCE_LIB_SYMBOL_ISSUES, ERCE_LIB_SYMBOL_MISMATCH, SCH_CONNECTIVITY::ExtractLibrarySymbolFact(), LIB_SYMBOL::Flatten(), ADVANCED_CFG::GetCfg(), LIB_SYMBOL::GetDuplicatePinNumbersAreJumpers(), LIBRARY_MANAGER::GetFullURI(), SCH_SYMBOL::GetLibId(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), PGM_BASE::GetLibraryManager(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPosition(), LIBRARY_MANAGER::GetRow(), SCH_CONNECTIVITY::LIBRARY_SYMBOL_FACT::HasDuplicatePins(), LIBRARY_MANAGER_ADAPTER::IsLibraryLoaded(), SCH_SCREEN::Items(), SCH_CONNECTIVITY::LIBRARY_SYMBOL_FACT::library, SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), ADVANCED_CFG::m_ConnectivityEngine, m_schematic, m_settings, EDA_ITEM::m_Uuid, SCH_CONNECTIVITY::LIBRARY_SYMBOL_FACT::Matches(), message, MILS, EE_RTREE::OfType(), path, Pgm(), result, SCH_SYMBOL_T, schIUScale, source, SYMBOL, PROJECT_SCH::SymbolLibAdapter(), and UnescapeString().
Referenced by BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestMissingNetclasses | ( | ) |
Tests for netclasses that are referenced but not defined.
Definition at line 1051 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_UNDEFINED_NETCLASS, FOR_NETNAME, ADVANCED_CFG::GetCfg(), SCH_FIELD::GetShownText(), SCH_FIELD::GetUntranslatedName(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), m_schematic, m_sheetList, NO_RECURSE, SCH_FIELD_T, and EDA_ITEM::Type().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestMissingUnits | ( | ) |
Test for uninstantiated units of multi unit symbols.
Definition at line 970 of file erc.cpp.
References _, ERCE_MISSING_BIDI_PIN, ERCE_MISSING_INPUT_PIN, ERCE_MISSING_POWER_INPUT_PIN, ERCE_MISSING_UNIT, group, m_schematic, m_settings, message, and multiUnitSources().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestMultiunitFootprints | ( | ) |
Test if all units of each multiunit symbol have the same footprint assigned.
Definition at line 923 of file erc.cpp.
References _, ERC_ITEM::Create(), ERCE_DIFFERENT_UNIT_FP, SCH_CONNECTIVITY::MULTI_UNIT_INSTANCE::footprint, group, SCH_CONNECTIVITY::MULTI_UNIT_INSTANCE::item, m_schematic, multiUnitSources(), SCH_CONNECTIVITY::MULTI_UNIT_INSTANCE::name, and SCH_CONNECTIVITY::MULTI_UNIT_INSTANCE::sheet.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestMultUnitPinConflicts | ( | ) |
Checks if shared pins on multi-unit symbols have been connected to different nets.
Definition at line 2145 of file erc.cpp.
References _, ERC_ITEM::Create(), ERCE_DIFFERENT_UNIT_NET, ADVANCED_CFG::GetCfg(), CONNECTION_SUBGRAPH::GetItems(), CONNECTION_SUBGRAPH::GetSheet(), m_nets, m_schematic, name, pin, and SCH_PIN_T.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| 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
Definition at line 1288 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_NOCONNECT_CONNECTED, ADVANCED_CFG::GetCfg(), SCH_SYMBOL::GetPins(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), m_schematic, m_settings, m_sheetList, EE_RTREE::OfType(), pin, PT_NC, SCH_NO_CONNECT_T, SCH_PIN_T, SCH_SYMBOL_T, and EDA_ITEM::Type().
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestOffGridEndpoints | ( | ) |
Test pins and wire ends for being off grid.
Definition at line 3049 of file erc.cpp.
References ERC_ITEM::Create(), ERCE_ENDPOINT_OFF_GRID, ADVANCED_CFG::GetCfg(), SCH_BUS_ENTRY_BASE::GetConnectionPoints(), SCH_LINE::GetEndPoint(), SCH_SYMBOL::GetPins(), SCH_LINE::GetStartPoint(), grid, m_schematic, m_screens, pin, PT_NC, SCH_BUS_WIRE_ENTRY_T, SCH_LINE_T, SCH_SYMBOL_T, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
Check pin-to-pad maps (issue #2282): stale pin references, duplicate pad targets, bad pads and unmapped connected pins.
Footprint pad numbers come from the cvpcb kiface (aCvPcb), so the footprint-dependent checks (bad-pad, unmapped-connected-pin) run here when it is available. Drops a SCH_MARKER at the symbol body per violation.
Definition at line 417 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_PIN_MAP_BAD_PAD, ERCE_PIN_MAP_DUPLICATE_PAD, ERCE_PIN_MAP_STALE_PIN, ERCE_PIN_MAP_UNMAPPED_PIN, ExpandStackedPinNotation(), SCH_CONNECTIVITY::ExtractPinMapFacts(), PIN_MAP_SET::FindByName(), PIN_MAP_SET::GetAll(), ADVANCED_CFG::GetCfg(), LIB_SYMBOL::GetEffectiveAssociatedFootprints(), PIN_MAP::GetEntries(), SCH_SYMBOL::GetFootprintFieldText(), SCH_SYMBOL::GetLibSymbolRef(), PIN_MAP::GetName(), SCH_SYMBOL::GetPins(), LIB_ID::GetUniStringLibId(), group, SCH_PIN::HasIdentityPad(), KIFACE::IfaceOrAddress(), SCH_SCREEN::Items(), KIFACE_FOOTPRINT_PAD_NUMBERS, SCH_SHEET_PATH::LastScreen(), ASSOCIATED_FOOTPRINT::m_FootprintLibId, ASSOCIATED_FOOTPRINT::m_MapName, m_schematic, m_screens, m_settings, m_sheetList, EE_RTREE::OfType(), pad, LIB_ID::Parse(), pin, RESOLVED, SCH_SYMBOL_T, and source.
Referenced by BOOST_AUTO_TEST_CASE(), PIN_MAP_ERC_FIXTURE::runPinMapErc(), and RunTests().
| int ERC_TESTER::TestPinToPin | ( | ) |
Checks the full netlist against the pin-to-pin connectivity requirements.
Definition at line 1709 of file erc.cpp.
References _, ERC_ITEM::Create(), VECTOR2< T >::Distance(), distance(), DrivenPinTypes, DrivingPinTypes, DrivingPowerPinTypes, ElectricalPinTypeGetText(), ERCE_PIN_NOT_DRIVEN, ERCE_POWERPIN_NOT_DRIVEN, ADVANCED_CFG::GetCfg(), CONNECTION_SUBGRAPH::GetItems(), CONNECTION_SUBGRAPH::GetNoConnect(), SCH_PIN::GetPosition(), CONNECTION_SUBGRAPH::GetSheet(), SCH_PIN::GetType(), SCH_PIN::IsPower(), SCH_PIN::IsStacked(), SCH_PIN::IsVisible(), SCH_SHEET_PATH::LastScreen(), left, m_nets, m_schematic, m_settings, m_showAllErrors, OK, ERC_SCH_PIN_CONTEXT::Pin(), pin, PT_POWER_IN, PT_UNSPECIFIED, right, SCH_PIN_T, ERC_SCH_PIN_CONTEXT::Sheet(), SM_HEURISTICS, TO_UTF8, and traceSchNetChain.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestSameLocalGlobalLabel | ( | ) |
Checks for global and local labels with the same name.
Definition at line 2655 of file erc.cpp.
References ERCE_SAME_LOCAL_GLOBAL_LABEL, ERCE_SAME_LOCAL_GLOBAL_POWER, m_schematic, m_settings, name, SCH_HIER_LABEL_T, and SCH_PIN_T.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestSimilarLabels | ( | ) |
Checks for labels that differ only in capitalization.
Although the two 'μ's look the same, they are U+03BC and U+00B5
Definition at line 2696 of file erc.cpp.
References ERCE_SIMILAR_LABEL_AND_POWER, ERCE_SIMILAR_LABELS, ERCE_SIMILAR_POWER, m_schematic, m_settings, name, SCH_CONNECTIVITY::NAMED_ITEM::name, SCH_LABEL_T, SCH_PIN_T, SCH_CONNECTIVITY::NAMED_ITEM::sheet, SplitString(), and SCH_CONNECTIVITY::NAMED_ITEM::type.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestSimModelIssues | ( | ) |
Test SPICE models for various issues.
Definition at line 3138 of file erc.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), SIM_LIB_MGR::CreateModel(), ERCE_SIMULATION_MODEL, SCH_CONNECTIVITY::ExtractSimulationModelFacts(), ADVANCED_CFG::GetCfg(), SCH_SHEET_PATH::LastScreen(), ADVANCED_CFG::m_ConnectivityEngine, m_schematic, m_sheetList, SCH_SHEET_PATH::PathRef(), reporter, and source.
Referenced by BOOST_AUTO_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestStackedPinNotation | ( | ) |
Checks for pin numbers that resemble stacked pin notation but are invalid.
Definition at line 2613 of file erc.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_STACKED_PIN_SYNTAX, ADVANCED_CFG::GetCfg(), SCH_SYMBOL::GetPins(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), m_schematic, m_sheetList, EE_RTREE::OfType(), pin, and SCH_SYMBOL_T.
Referenced by BOOST_AUTO_TEST_CASE(), and RunTests().
| void ERC_TESTER::TestTextVars | ( | DS_PROXY_VIEW_ITEM * | aDrawingSheet | ) |
Check for any unresolved text variable references.
With the connectivity engine, aDrawingSheet enables drawing checks; page/title data comes from captured instances.
Definition at line 648 of file erc.cpp.
References _, SCH_SCREEN::Append(), DS_DRAW_ITEM_LIST::BuildDrawItemsList(), ERC_ITEM::Create(), ERCE_GENERIC_ERROR, ERCE_GENERIC_WARNING, ERCE_UNRESOLVED_VARIABLE, SCH_CONNECTIVITY::ExtractTextAssertions(), SCH_CONNECTIVITY::ExtractTextChecks(), FOR_ERC_DRC, ADVANCED_CFG::GetCfg(), DS_DRAW_ITEM_LIST::GetFirst(), DS_DRAW_ITEM_LIST::GetNext(), DS_PROXY_VIEW_ITEM::GetPageInfo(), DS_PROXY_VIEW_ITEM::GetTitleBlock(), ADVANCED_CFG::m_ConnectivityEngine, m_schematic, m_sheetList, message, niluuid, schIUScale, DS_DRAW_ITEM_LIST::SetFileName(), DS_DRAW_ITEM_LIST::SetPageNumber(), DS_DRAW_ITEM_LIST::SetProject(), DS_DRAW_ITEM_LIST::SetSheetCount(), DS_DRAW_ITEM_LIST::SetSheetLayer(), DS_DRAW_ITEM_LIST::SetSheetName(), source, and text.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and RunTests().
| int ERC_TESTER::TestVariantSymbols | ( | ) |
Test all variant symbol overrides for resolution and pin compatibility.
Creates ERCE_VARIANT_SYMBOL_INVALID markers when a variant's symbol override LIB_ID cannot be resolved, and ERCE_VARIANT_SYMBOL_INCOMPATIBLE markers when the alternate symbol fails pin compatibility validation against the base symbol.
Definition at line 3185 of file erc.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_VARIANT_SYMBOL_INCOMPATIBLE, ERCE_VARIANT_SYMBOL_INVALID, SCH_CONNECTIVITY::ExtractLibrarySymbolFact(), SCH_CONNECTIVITY::ExtractVariantSymbolFact(), ADVANCED_CFG::GetCfg(), SCH_SYMBOL::GetLibId(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPosition(), SCH_SCREEN::Items(), SCH_SHEET_PATH::LastScreen(), SYMBOL_LIBRARY_ADAPTER::LoadSymbol(), m_schematic, m_settings, m_sheetList, EDA_ITEM::m_Uuid, EE_RTREE::OfType(), SCH_SHEET_PATH::PathRef(), SCH_SYMBOL_T, source, PROJECT_SCH::SymbolLibAdapter(), and ValidateVariantSymbolCompatibility().
Referenced by BOOST_FIXTURE_TEST_CASE(), and RunTests().
|
private |
Definition at line 234 of file erc.h.
Referenced by ERC_TESTER(), TestMultUnitPinConflicts(), and TestPinToPin().
|
private |
Definition at line 233 of file erc.h.
Referenced by ERC_TESTER(), and multiUnitSources().
|
private |
Definition at line 229 of file erc.h.
Referenced by ERC_TESTER(), multiUnitSources(), RunTests(), TestDuplicateSheetNames(), TestEmptyLabelNames(), TestFieldNameWhitespace(), TestFootprintFilters(), TestFootprintLinkIssues(), TestFourWayJunction(), TestGroundPins(), TestLabelMultipleWires(), TestLibSymbolIssues(), TestMissingNetclasses(), TestMissingUnits(), TestMultiunitFootprints(), TestMultUnitPinConflicts(), TestNoConnectPins(), TestOffGridEndpoints(), TestPinMap(), TestPinToPin(), TestSameLocalGlobalLabel(), TestSimilarLabels(), TestSimModelIssues(), TestStackedPinNotation(), TestTextVars(), and TestVariantSymbols().
|
private |
Definition at line 232 of file erc.h.
Referenced by ERC_TESTER(), RunTests(), TestOffGridEndpoints(), and TestPinMap().
|
private |
Definition at line 230 of file erc.h.
Referenced by ERC_TESTER(), RunTests(), TestLibSymbolIssues(), TestMissingUnits(), TestNoConnectPins(), TestPinMap(), TestPinToPin(), TestSameLocalGlobalLabel(), TestSimilarLabels(), and TestVariantSymbols().
|
private |
Definition at line 231 of file erc.h.
Referenced by ERC_TESTER(), TestDuplicatePinNets(), TestEmptyLabelNames(), TestFieldNameWhitespace(), TestFourWayJunction(), TestGroundPins(), TestLabelMultipleWires(), TestMissingNetclasses(), TestNoConnectPins(), TestPinMap(), TestSimModelIssues(), TestStackedPinNotation(), TestTextVars(), and TestVariantSymbols().
|
private |
Definition at line 235 of file erc.h.
Referenced by ERC_TESTER(), and TestPinToPin().