|
KiCad PCB EDA Suite
|
Calculate the connectivity of a schematic and generates netlists. More...
#include <connection_graph.h>
Classes | |
| struct | BRIDGE_EDGE |
| struct | BRIDGE_GRAPH |
| struct | BRIDGE_NEIGHBOR |
| struct | CHAIN_TERMINAL_REF |
Public Types | |
| using | CHAIN_TERMINAL_REFS = std::pair<CHAIN_TERMINAL_REF, CHAIN_TERMINAL_REF> |
Public Member Functions | |
| CONNECTION_GRAPH (SCHEMATIC *aSchematic=nullptr) | |
| ~CONNECTION_GRAPH () | |
| CONNECTION_GRAPH (const CONNECTION_GRAPH &)=delete | |
| CONNECTION_GRAPH & | operator= (const CONNECTION_GRAPH &)=delete |
| void | Reset () |
| void | SetSchematic (SCHEMATIC *aSchematic) |
| void | SetLastCodes (const CONNECTION_GRAPH *aOther) |
| void | Recalculate (const SCH_SHEET_LIST &aSheetList, bool aUnconditional=false, std::function< void(SCH_ITEM *)> *aChangedItemHandler=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) |
| Update the connection graph for the given list of sheets. | |
| std::shared_ptr< BUS_ALIAS > | GetBusAlias (const wxString &aName) |
| Return a bus alias pointer for the given name if it exists (from cache) | |
| std::vector< const CONNECTION_SUBGRAPH * > | GetBusesNeedingMigration () |
| Determine which subgraphs have more than one conflicting bus label. | |
| int | RunERC () |
| Run electrical rule checks on the connectivity graph. | |
| const NET_MAP & | GetNetMap () const |
| SCH_NETCHAIN * | GetNetChainForNet (const wxString &aNet) |
| SCH_NETCHAIN * | GetNetChainByName (const wxString &aName) |
| void | ReplaceNetChainTerminalPin (const wxString &aNetChain, const KIID &aPrev, const KIID &aNew) |
| void | SetNetChainTerminalOverrides (const std::map< wxString, std::pair< KIID, KIID > > &aOverrides) |
| void | SetNetChainNetClassOverrides (const std::map< wxString, wxString > &aOverrides) |
| Stash per-net-chain netclass overrides read from the schematic file. | |
| const std::map< wxString, wxString > & | GetNetChainNetClassOverrides () const |
| void | SetNetChainTerminalRefOverrides (const std::map< wxString, CHAIN_TERMINAL_REFS > &aRefs) |
| const std::map< wxString, CHAIN_TERMINAL_REFS > & | GetNetChainTerminalRefOverrides () const |
| const std::map< wxString, std::pair< KIID, KIID > > & | GetNetChainTerminalOverrides () const |
| void | SetNetChainColorOverrides (const std::map< wxString, COLOR4D > &aOverrides) |
| const std::map< wxString, COLOR4D > & | GetNetChainColorOverrides () const |
| void | SetNetChainMemberNetOverrides (const std::map< wxString, std::set< wxString > > &aOverrides) |
| Stash per-chain member-net lists read from the schematic file. | |
| const std::map< wxString, std::set< wxString > > & | GetNetChainMemberNetOverrides () const |
| CONNECTION_SUBGRAPH * | FindSubgraphByName (const wxString &aNetName, const SCH_SHEET_PATH &aPath) |
| Return the subgraph for a given net name on a given sheet. | |
| CONNECTION_SUBGRAPH * | FindFirstSubgraphByName (const wxString &aNetName) |
| Retrieve a subgraph for the given net name, if one exists. | |
| CONNECTION_SUBGRAPH * | GetSubgraphForItem (SCH_ITEM *aItem) const |
| const std::vector< CONNECTION_SUBGRAPH * > & | GetAllSubgraphs (const wxString &aNetName) const |
| wxString | GetResolvedSubgraphName (const CONNECTION_SUBGRAPH *aSubGraph) const |
| Return the fully-resolved netname for a given subgraph. | |
| std::set< std::pair< SCH_SHEET_PATH, SCH_ITEM * > > | ExtractAffectedItems (const std::set< SCH_ITEM * > &aItems) |
| For a set of items, this will remove the connected items and their associated data including subgraphs and generated codes from the connection graph. | |
| void | Merge (CONNECTION_GRAPH &aGraph) |
| Combine the input graph contents into the current graph. | |
| void | RemoveItem (SCH_ITEM *aItem) |
| void | ExchangeItem (SCH_ITEM *aOldItem, SCH_ITEM *aNewItem) |
| Replace all references to #aOldItem with #aNewItem in the graph. | |
| bool | IsMinor () const |
| We modify how we handle the connectivity graph for small graphs vs large graphs. | |
| const std::vector< std::unique_ptr< SCH_NETCHAIN > > & | GetPotentialNetChains () const |
| Potential net chains are inferred groupings produced by RebuildNetChains() but not yet user-committed. | |
| SCH_NETCHAIN * | FindPotentialNetChainBetweenPins (SCH_PIN *aPinA, SCH_PIN *aPinB) |
| Locate a potential net chain that contains both pins (by subgraph net membership). | |
| SCH_NETCHAIN * | CreateNetChainFromPotential (SCH_NETCHAIN *aPotential, const wxString &aName) |
| Promote a potential net chain to an actual user net chain with the provided name. | |
| SCH_NETCHAIN * | CreateManualNetChain (const wxString &aName, const std::set< class SCH_SYMBOL * > &aSymbols, const std::set< wxString > &aNets, const KIID &aTerminalPinA, const KIID &aTerminalPinB, const wxString &aRefA, const wxString &aPinNumA, const wxString &aRefB, const wxString &aPinNumB) |
| Commit a manually-defined net chain that the inferred-potential pass did not produce. | |
| const std::vector< std::unique_ptr< SCH_NETCHAIN > > & | GetCommittedNetChains () const |
| Return user-created (committed) net chains (legacy accessor retained under net-chain API). | |
| bool | NetChainsBuilt () const |
| Returns true once RebuildNetChains() has completed at least once on this graph. | |
| bool | DeleteCommittedNetChain (const wxString &aName) |
| Delete a committed net chain by name. | |
| bool | RenameCommittedNetChain (const wxString &aOld, const wxString &aNew) |
| Rename a committed net chain. | |
Static Public Member Functions | |
| static std::function< void(CONNECTION_GRAPH &)> & | RebuildNetChainsTestHook () |
| Test-only hook fired inside RebuildNetChains() after the restore passes have finished but before the success flag is flipped. | |
Private Member Functions | |
| void | updateSymbolConnectivity (const SCH_SHEET_PATH &aSheet, SCH_SYMBOL *aSymbol, std::map< VECTOR2I, std::vector< SCH_ITEM * > > &aConnectionMap) |
| Update the connectivity of a symbol and its pins. | |
| void | updatePinConnectivity (const SCH_SHEET_PATH &aSheet, SCH_PIN *aPin, SCH_CONNECTION *aConnection) |
| Update the connectivity of a pin and its connections. | |
| void | updateGenericItemConnectivity (const SCH_SHEET_PATH &aSheet, SCH_ITEM *aItem, std::map< VECTOR2I, std::vector< SCH_ITEM * > > &aConnectionMap) |
| Update the connectivity of items that are not pins or symbols. | |
| void | updateItemConnectivity (const SCH_SHEET_PATH &aSheet, const std::vector< SCH_ITEM * > &aItemList) |
| Update the graphical connectivity between items (i.e. | |
| void | buildConnectionGraph (std::function< void(SCH_ITEM *)> *aChangedItemHandler, bool aUnconditional) |
| Generate the connection graph (after all item connectivity has been updated). | |
| void | buildItemSubGraphs () |
| Generate individual item subgraphs on a per-sheet basis. | |
| void | resolveAllDrivers () |
| Find all subgraphs in the connection graph and calls ResolveDrivers() in parallel. | |
| void | collectAllDriverValues () |
| Map the driver values for each subgraph. | |
| void | generateGlobalPowerPinSubGraphs () |
| Iterate through the global power pins to collect the global labels as drivers. | |
| void | generateBusAliasMembers () |
| Iterate through labels to create placeholders for bus elements. | |
| void | processSubGraphs () |
| Process all subgraphs to assign netcodes and merge subgraphs based on labels. | |
| int | assignNewNetCode (SCH_CONNECTION &aConnection) |
| Helper to assign a new net code to a connection. | |
| int | getOrCreateNetCode (const wxString &aNetName) |
| void | assignNetCodesToBus (SCH_CONNECTION *aConnection) |
| Ensure all members of the bus connection have a valid net code assigned. | |
| void | propagateToNeighbors (CONNECTION_SUBGRAPH *aSubgraph, bool aForce) |
| Update all neighbors of a subgraph with this one's connectivity info. | |
| void | removeSubgraphs (std::set< CONNECTION_SUBGRAPH * > &aSubgraphs) |
| Remove references to the given subgraphs from all structures in the connection graph. | |
| std::shared_ptr< SCH_CONNECTION > | getDefaultConnection (SCH_ITEM *aItem, CONNECTION_SUBGRAPH *aSubgraph) |
| Build a new default connection for the given item based on its properties. | |
| void | recacheSubgraphName (CONNECTION_SUBGRAPH *aSubgraph, const wxString &aOldName) |
| bool | ercCheckMultipleDrivers (const CONNECTION_SUBGRAPH *aSubgraph) |
| If the subgraph has multiple drivers of equal priority that are graphically connected, ResolveDrivers() will have stored the second driver for use by this function, which actually creates the markers. | |
| bool | ercCheckBusToNetConflicts (const CONNECTION_SUBGRAPH *aSubgraph) |
| Check one subgraph for conflicting connections between net and bus labels. | |
| bool | ercCheckBusToBusConflicts (const CONNECTION_SUBGRAPH *aSubgraph) |
| Check one subgraph for conflicting connections between two bus items. | |
| bool | ercCheckBusToBusEntryConflicts (const CONNECTION_SUBGRAPH *aSubgraph) |
| Check one subgraph for conflicting bus entry to bus connections. | |
| bool | ercCheckNoConnects (const CONNECTION_SUBGRAPH *aSubgraph) |
| Check one subgraph for proper presence or absence of no-connect symbols. | |
| bool | ercCheckFloatingWires (const CONNECTION_SUBGRAPH *aSubgraph) |
| Check one subgraph for floating wires. | |
| bool | ercCheckDanglingWireEndpoints (const CONNECTION_SUBGRAPH *aSubgraph) |
| Check one subgraph for dangling wire endpoints. | |
| bool | ercCheckLabels (const CONNECTION_SUBGRAPH *aSubgraph) |
| Check one subgraph for proper connection of labels. | |
| int | ercCheckDirectiveLabels () |
| Check directive labels should be connected to something. | |
| int | ercCheckHierSheets () |
| Check that a hierarchical sheet has at least one matching label inside the sheet for each port on the parent sheet object. | |
| int | ercCheckSingleGlobalLabel () |
| Check that a global label is instantiated more that once across the schematic hierarchy. | |
| size_t | hasPins (const CONNECTION_SUBGRAPH *aLocSubgraph) |
| Get the number of pins in a given subgraph. | |
| void | RebuildNetChains () |
| void | rekeyOverrideMaps (const wxString &aOld, const wxString &aNew) |
Move every net-chain override map entry keyed by aOld to aNew. | |
| void | refreshCommittedChainPayload (SCH_NETCHAIN *aTarget, const std::set< wxString > &aNets, const std::set< class SCH_SYMBOL * > &aSymbols, const KIID &aTerminalPinA, const KIID &aTerminalPinB, const wxString &aRefA, const wxString &aPinNumA, const wxString &aRefB, const wxString &aPinNumB) |
Replace the derived-view payload on aTarget with explicitly supplied member nets, symbols, terminal pins, and terminal refs. | |
| void | refreshCommittedChainFromPotential (SCH_NETCHAIN *aTarget, const SCH_NETCHAIN &aSource) |
| Thin forwarder over refreshCommittedChainPayload that pulls payload fields from an inferred potential chain. | |
| BRIDGE_GRAPH | buildBridgeAdjacency () |
| Build the bridge graph used for net-chain discovery. | |
Static Private Member Functions | |
| static SCH_CONNECTION * | matchBusMember (SCH_CONNECTION *aBusConnection, SCH_CONNECTION *aSearch) |
| Search for a matching bus member inside a bus connection. | |
| static SCH_NETCHAIN * | resolvePotentialChainByTerminals (const CHAIN_TERMINAL_REFS &aTermRefs, const std::map< std::pair< wxString, wxString >, wxString > &aRefPinToNet, const std::vector< std::unique_ptr< SCH_NETCHAIN > > &aPotentials, const wxString &aChainName) |
| Disambiguate the saved (refA.pinA, refB.pinB) terminal pair against the current set of potential net chains. | |
Private Attributes | |
| SCH_SHEET_LIST | m_sheetList |
| All the sheets in the schematic (as long as we don't have partial updates). | |
| std::vector< SCH_ITEM * > | m_items |
| All connectable items in the schematic. | |
| std::vector< CONNECTION_SUBGRAPH * > | m_subgraphs |
| The owner of all CONNECTION_SUBGRAPH objects. | |
| std::vector< CONNECTION_SUBGRAPH * > | m_driver_subgraphs |
| Cache of a subset of m_subgraphs. | |
| std::unordered_map< SCH_SHEET_PATH, std::vector< CONNECTION_SUBGRAPH * > > | m_sheet_to_subgraphs_map |
| Cache to lookup subgraphs in m_driver_subgraphs by sheet path. | |
| std::vector< std::pair< SCH_SHEET_PATH, SCH_PIN * > > | m_global_power_pins |
| std::unordered_map< wxString, std::shared_ptr< BUS_ALIAS > > | m_bus_alias_cache |
| std::unordered_map< wxString, int > | m_net_name_to_code_map |
| std::unordered_map< wxString, int > | m_bus_name_to_code_map |
| std::unordered_map< wxString, std::vector< const CONNECTION_SUBGRAPH * > > | m_global_label_cache |
| std::map< std::pair< SCH_SHEET_PATH, wxString >, std::vector< const CONNECTION_SUBGRAPH * > > | m_local_label_cache |
| std::unordered_map< wxString, std::vector< CONNECTION_SUBGRAPH * > > | m_net_name_to_subgraphs_map |
| std::unordered_map< SCH_ITEM *, CONNECTION_SUBGRAPH * > | m_item_to_subgraph_map |
| NET_MAP | m_net_code_to_subgraphs_map |
| std::vector< std::unique_ptr< SCH_NETCHAIN > > | m_committedNetChains |
| std::vector< std::unique_ptr< SCH_NETCHAIN > > | m_potentialNetChains |
| last built potential (uncommitted) net chains | |
| bool | m_netChainsBuilt = false |
| std::map< wxString, std::pair< KIID, KIID > > | m_netChainTerminalOverrides |
| std::map< wxString, wxString > | m_netChainNetClassOverrides |
| std::map< wxString, COLOR4D > | m_netChainColorOverrides |
| std::map< wxString, CHAIN_TERMINAL_REFS > | m_netChainTerminalRefOverrides |
| std::map< wxString, std::set< wxString > > | m_netChainMemberNetOverrides |
| int | m_last_net_code |
| int | m_last_bus_code |
| int | m_last_subgraph_code |
| SCHEMATIC * | m_schematic |
| The schematic this graph represents. | |
Friends | |
| void | boost_test_update_symbol_connectivity () |
| void | boost_test_update_generic_connectivity () |
| void | boost_test_inject_committed_net_chain (CONNECTION_GRAPH &aGraph, std::unique_ptr< SCH_NETCHAIN > aChain) |
| SCH_NETCHAIN * | boost_test_resolve_potential_chain_by_terminals (const std::pair< std::pair< wxString, wxString >, std::pair< wxString, wxString > > &aTerms, const std::map< std::pair< wxString, wxString >, wxString > &aRefPinToNet, const std::vector< std::unique_ptr< SCH_NETCHAIN > > &aPotentials, const wxString &aChainName) |
Calculate the connectivity of a schematic and generates netlists.
Definition at line 374 of file connection_graph.h.
| using CONNECTION_GRAPH::CHAIN_TERMINAL_REFS = std::pair<CHAIN_TERMINAL_REF, CHAIN_TERMINAL_REF> |
Definition at line 483 of file connection_graph.h.
|
inline |
Definition at line 377 of file connection_graph.h.
References m_last_bus_code, m_last_net_code, m_last_subgraph_code, and m_schematic.
Referenced by boost_test_inject_committed_net_chain, boost_test_update_generic_connectivity, boost_test_update_symbol_connectivity, CONNECTION_GRAPH(), Merge(), operator=(), RebuildNetChainsTestHook(), and SetLastCodes().
| CONNECTION_GRAPH::~CONNECTION_GRAPH | ( | ) |
Definition at line 95 of file connection_graph.cpp.
References Reset().
|
delete |
References CONNECTION_GRAPH().
|
private |
Ensure all members of the bus connection have a valid net code assigned.
| aConnection | is a bus connection. |
Definition at line 4186 of file connection_graph.cpp.
References assignNewNetCode(), and SCH_CONNECTION::Members().
Referenced by processSubGraphs().
|
private |
Helper to assign a new net code to a connection.
Definition at line 4176 of file connection_graph.cpp.
References getOrCreateNetCode(), SCH_CONNECTION::Name(), and SCH_CONNECTION::SetNetCode().
Referenced by assignNetCodesToBus(), generateBusAliasMembers(), generateGlobalPowerPinSubGraphs(), and processSubGraphs().
|
private |
Build the bridge graph used for net-chain discovery.
Walks every 2-pin passthrough symbol on every sheet and records the raw bridge edge list in edges; the returned adjacency is built from those edges after dropping any that touch a power subgraph and after iteratively pruning power-adjacent leaf nets. edges itself stays raw because RebuildNetChains() still iterates the full list to attach bridging symbols to their owning component. Does NOT apply the legacy >4-net stub trim — that fossil lives only in RebuildNetChains() so the path-enumeration API can see the unpruned adjacency.
Definition at line 2917 of file connection_graph.cpp.
References CONNECTION_GRAPH::BRIDGE_EDGE::a, CONNECTION_GRAPH::BRIDGE_EDGE::b, SCH_SYMBOL::BLOCK, SCH_SYMBOL::FORCE, SCH_LINE::GetEndPoint(), SCH_ITEM::GetLayer(), CONNECTION_SUBGRAPH::GetNetName(), SCH_SYMBOL::GetPassthroughMode(), SCH_SYMBOL::GetPins(), SCH_PIN::GetPosition(), SCH_LINE::GetStartPoint(), GetSubgraphForItem(), SCH_SCREEN::Items(), kv, LAYER_WIRE, CONNECTION_SUBGRAPH::m_code, m_sheetList, netChainKeyFor(), EE_RTREE::OfType(), CONNECTION_GRAPH::BRIDGE_NEIGHBOR::other, EE_RTREE::Overlapping(), result, SCH_LINE_T, SCH_SYMBOL_T, CONNECTION_GRAPH::BRIDGE_EDGE::sym, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by RebuildNetChains().
|
private |
Generate the connection graph (after all item connectivity has been updated).
In the first phase, the algorithm iterates over all items, and then over all items that are connected (graphically) to each item, placing them into CONNECTION_SUBGRAPHs. Items that can potentially drive connectivity (i.e. labels, pins, etc.) are added to the m_drivers vector of the subgraph.
In the second phase, each subgraph is resolved. To resolve a subgraph, the driver is first selected by CONNECTION_SUBGRAPH::ResolveDrivers(), and then the connection for the chosen driver is propagated to all the other items in the subgraph.
If the unconitional flag is set, all existing net classes will be removed and re-created. Otherwise, we will preserve existing net classes that do not conflict with the new net classes.
TODO(JE): Net codes are non-deterministic. Fortunately, they are also not really used for anything. We should consider removing them entirely and just using net names everywhere.
Definition at line 2363 of file connection_graph.cpp.
References buildItemSubGraphs(), BUS, SCH_CONNECTION::Clone(), collectAllDriverValues(), compareDrivers(), SCH_ITEM::Connection(), ConnTrace, DanglingProfileMask, generateBusAliasMembers(), generateGlobalPowerPinSubGraphs(), CONNECTION_SUBGRAPH::GetDriverPriority(), CONNECTION_SUBGRAPH::GetDriverPriority(), GetKiCadThreadPool(), CONNECTION_SUBGRAPH::GetNameForDriver(), SCH_SHEET::GetScreen(), SCH_LABEL_BASE::GetShownText(), CONNECTION_SUBGRAPH::GLOBAL_POWER_PIN, SCH_CONNECTION::IsBus(), SCH_CONNECTION::IsNet(), SCH_SCREEN::Items(), CONNECTION_SUBGRAPH::m_absorbed, CONNECTION_SUBGRAPH::m_absorbed_by, m_bus_alias_cache, CONNECTION_SUBGRAPH::m_code, CONNECTION_SUBGRAPH::m_dirty, CONNECTION_SUBGRAPH::m_driver, CONNECTION_SUBGRAPH::m_driver_connection, m_driver_subgraphs, CONNECTION_SUBGRAPH::m_drivers, m_net_code_to_subgraphs_map, m_net_name_to_subgraphs_map, m_schematic, CONNECTION_SUBGRAPH::m_sheet, m_sheet_to_subgraphs_map, matchBusMember(), SCH_CONNECTION::Name(), name, EE_RTREE::OfType(), path, pin, processSubGraphs(), propagateToNeighbors(), RebuildNetChains(), recacheSubgraphName(), resolveAllDrivers(), SCH_HIER_LABEL_T, SCH_PIN_T, SCH_SHEET_PIN_T, SCH_CONNECTION::SetType(), PROF_TIMER::Show(), and tp.
Referenced by Recalculate().
|
private |
Generate individual item subgraphs on a per-sheet basis.
Definition at line 1603 of file connection_graph.cpp.
References CONNECTION_SUBGRAPH::AddItem(), CONNECTIVITY_CANDIDATE, m_bus_alias_cache, CONNECTION_SUBGRAPH::m_code, CONNECTION_SUBGRAPH::m_dirty, m_item_to_subgraph_map, m_items, m_last_subgraph_code, CONNECTION_SUBGRAPH::m_no_connect, m_schematic, CONNECTION_SUBGRAPH::m_sheet, m_subgraphs, SCH_NO_CONNECT_T, SCH_CONNECTION::SetSubgraphCode(), and SCH_CONNECTION::SubgraphCode().
Referenced by buildConnectionGraph().
|
private |
Map the driver values for each subgraph.
Definition at line 1763 of file connection_graph.cpp.
References BUS, ConnTrace, EDA_ITEM::GetItemDescription(), m_driver_subgraphs, m_global_label_cache, m_local_label_cache, m_net_name_to_subgraphs_map, MM, name, pin, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, schIUScale, and EDA_ITEM::Type().
Referenced by buildConnectionGraph().
| SCH_NETCHAIN * CONNECTION_GRAPH::CreateManualNetChain | ( | const wxString & | aName, |
| const std::set< class SCH_SYMBOL * > & | aSymbols, | ||
| const std::set< wxString > & | aNets, | ||
| const KIID & | aTerminalPinA, | ||
| const KIID & | aTerminalPinB, | ||
| const wxString & | aRefA, | ||
| const wxString & | aPinNumA, | ||
| const wxString & | aRefB, | ||
| const wxString & | aPinNumB ) |
Commit a manually-defined net chain that the inferred-potential pass did not produce.
| aName | Name of the new chain. Must satisfy SCH_NETCHAIN::IsValidName(). |
| aSymbols | Symbols that participate in the chain. |
| aNets | Member nets of the chain. |
| aTerminalPinA | First terminal pin KIID. |
| aTerminalPinB | Second terminal pin KIID. |
| aRefA | Reference designator for the first terminal symbol. |
| aPinNumA | Pin number for the first terminal pin. |
| aRefB | Reference designator for the second terminal symbol. |
| aPinNumB | Pin number for the second terminal pin. |
Definition at line 4024 of file connection_graph.cpp.
References GetNetChainByName(), GetNetChainForNet(), SCH_NETCHAIN::IsValidName(), m_committedNetChains, m_netChainColorOverrides, m_netChainMemberNetOverrides, m_netChainNetClassOverrides, and m_netChainTerminalRefOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), RebuildNetChains(), and DIALOG_CREATE_NET_CHAIN::validateAndCreate().
| SCH_NETCHAIN * CONNECTION_GRAPH::CreateNetChainFromPotential | ( | SCH_NETCHAIN * | aPotential, |
| const wxString & | aName ) |
Promote a potential net chain to an actual user net chain with the provided name.
Definition at line 3957 of file connection_graph.cpp.
References SCH_NETCHAIN::GetNets(), SCH_NETCHAIN::GetSymbols(), SCH_NETCHAIN::GetTerminalPinA(), SCH_NETCHAIN::GetTerminalPinB(), SCH_NETCHAIN::GetTerminalPinNum(), SCH_NETCHAIN::GetTerminalRef(), m_committedNetChains, m_netChainColorOverrides, m_netChainMemberNetOverrides, m_netChainNetClassOverrides, m_netChainTerminalRefOverrides, and SCH_NETCHAIN::SYNTHETIC_NET_PREFIX.
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(), SCH_EDITOR_CONTROL::CreateNetChainBetweenPins(), RebuildNetChains(), and DIALOG_CREATE_NET_CHAIN::validateAndCreate().
| bool CONNECTION_GRAPH::DeleteCommittedNetChain | ( | const wxString & | aName | ) |
Delete a committed net chain by name.
Clears every net-chain override map entry (netclass, colour, terminal refs, terminal pin overrides) and resets the SetNetChainName marker on every member symbol so the chain is not reapplied on the next RebuildNetChains() pass.
Definition at line 3802 of file connection_graph.cpp.
References m_committedNetChains, m_netChainColorOverrides, m_netChainMemberNetOverrides, m_netChainNetClassOverrides, m_netChainTerminalOverrides, and m_netChainTerminalRefOverrides.
Referenced by PANEL_SETUP_NET_CHAINS::ApplyEdits(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
|
private |
Check one subgraph for conflicting connections between two bus items.
For example, a labeled bus wire connected to a hierarchical sheet pin where the labeled bus doesn't contain any of the same bus members as the sheet pin.
| aSubgraph | is the subgraph to examine. |
Definition at line 5095 of file connection_graph.cpp.
References SCH_SCREEN::Append(), SCH_ITEM::Connection(), ERC_ITEM::Create(), ERCE_BUS_TO_BUS_CONFLICT, EDA_ITEM::GetPosition(), SCH_CONNECTION::IsBus(), SCH_SHEET_PATH::LastScreen(), CONNECTION_SUBGRAPH::m_items, CONNECTION_SUBGRAPH::m_sheet, SCH_CONNECTION::Members(), SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_SHEET_PIN_T, SCH_TEXT_T, and EDA_ITEM::Type().
Referenced by RunERC().
|
private |
Check one subgraph for conflicting bus entry to bus connections.
For example, a wire with label "A0" is connected to a bus labeled "D[8..0]"
Will also check for mistakes related to bus group names, for example: A bus group named "USB{DP DM}" should have bus entry connections like "USB.DP" but someone might accidentally just enter "DP".
| aSubgraph | is the subgraph to examine. |
Definition at line 5160 of file connection_graph.cpp.
References _, SCH_SCREEN::Append(), BUS, SCH_ITEM::Connection(), ERC_ITEM::Create(), ERCE_BUS_ENTRY_CONFLICT, SCH_CONNECTION::FullLocalName(), CONNECTION_SUBGRAPH::GetDriverPriority(), CONNECTION_SUBGRAPH::GetNameForDriver(), SCH_BUS_ENTRY_BASE::GetPosition(), CONNECTION_SUBGRAPH::GLOBAL_POWER_PIN, SCH_SHEET_PATH::LastScreen(), SCH_BUS_WIRE_ENTRY::m_connected_bus_item, CONNECTION_SUBGRAPH::m_driver, CONNECTION_SUBGRAPH::m_driver_connection, CONNECTION_SUBGRAPH::m_drivers, CONNECTION_SUBGRAPH::m_items, CONNECTION_SUBGRAPH::m_sheet, SCH_CONNECTION::Members(), SCH_CONNECTION::Name(), SCH_SHEET_PATH::PathHumanReadable(), SCH_BUS_WIRE_ENTRY_T, SCH_LINE_T, EDA_ITEM::Type(), and UnescapeString().
Referenced by RunERC().
|
private |
Check one subgraph for conflicting connections between net and bus labels.
For example, a net wire connected to a bus port/pin, or vice versa
| aSubgraph | is the subgraph to examine. |
Definition at line 5035 of file connection_graph.cpp.
References SCH_SCREEN::Append(), SCH_CONNECTION::ConfigureFromLabel(), ERC_ITEM::Create(), CTX_NETNAME, ERCE_BUS_TO_NET_CONFLICT, EscapeString(), SCH_ITEM::GetLayer(), EDA_ITEM::GetPosition(), SCH_CONNECTION::IsBus(), SCH_SHEET_PATH::LastScreen(), LAYER_BUS, CONNECTION_SUBGRAPH::m_items, CONNECTION_SUBGRAPH::m_sheet, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_LINE_T, SCH_SHEET_PIN_T, text, and EDA_ITEM::Type().
Referenced by RunERC().
|
private |
Check one subgraph for dangling wire endpoints.
Will throw an error for any subgraph that has wires with only one endpoing
| aSubgraph | is the subgraph to examine. |
Definition at line 5560 of file connection_graph.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_UNCONNECTED_WIRE_ENDPOINT, SCH_BUS_ENTRY_BASE::GetConnectionPoints(), SCH_LINE::GetConnectionPoints(), SCH_ITEM::GetLayer(), SCH_BUS_ENTRY_BASE::IsEndDangling(), SCH_LINE::IsEndDangling(), SCH_LINE::IsGraphicLine(), SCH_BUS_ENTRY_BASE::IsStartDangling(), SCH_LINE::IsStartDangling(), SCH_SHEET_PATH::LastScreen(), LAYER_WIRE, location, CONNECTION_SUBGRAPH::m_items, CONNECTION_SUBGRAPH::m_sheet, SCH_BUS_WIRE_ENTRY_T, SCH_LINE_T, and EDA_ITEM::Type().
Referenced by RunERC().
|
private |
Check directive labels should be connected to something.
Definition at line 5931 of file connection_graph.cpp.
References ERC_ITEM::Create(), ERCE_LABEL_NOT_CONNECTED, SCH_LABEL_BASE::IsDangling(), m_sheetList, SCH_DIRECTIVE_LABEL_T, and text.
Referenced by RunERC().
|
private |
Check one subgraph for floating wires.
Will throw an error for any subgraph that consists of just wires with no driver.
| aSubgraph | is the subgraph to examine. |
Definition at line 5628 of file connection_graph.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_WIRE_DANGLING, SCH_ITEM::GetLayer(), SCH_SHEET_PATH::LastScreen(), LAYER_WIRE, CONNECTION_SUBGRAPH::m_driver, CONNECTION_SUBGRAPH::m_items, CONNECTION_SUBGRAPH::m_sheet, SCH_BUS_WIRE_ENTRY_T, SCH_LINE_T, and EDA_ITEM::Type().
Referenced by RunERC().
|
private |
Check that a hierarchical sheet has at least one matching label inside the sheet for each port on the parent sheet object.
| aSubgraph | is the subgraph to examine. |
Definition at line 5959 of file connection_graph.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_HIERACHICAL_LABEL, ERCE_PIN_NOT_CONNECTED, SCH_SHEET::GetPins(), SCH_SHEET::GetScreen(), SCH_LABEL_BASE::GetShownText(), ERC_SETTINGS::IsTestEnabled(), SCH_SCREEN::Items(), m_schematic, m_sheetList, name, pin, SCH_SHEET_PATH::push_back(), SCH_HIER_LABEL_T, SCH_SHEET_T, and UnescapeString().
Referenced by RunERC().
|
private |
Check one subgraph for proper connection of labels.
Labels should be connected to something.
| aSubgraph | is the subgraph to examine. |
| aCheckGlobalLabels | is true if global labels should be checked for loneliness. |
Definition at line 5667 of file connection_graph.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_LABEL_NOT_CONNECTED, ERCE_LABEL_SINGLE_PIN, CONNECTION_SUBGRAPH::GetNameForDriver(), SCH_TEXT::GetPosition(), GetResolvedSubgraphName(), hasPins(), SCH_CONNECTION::IsBus(), ERC_SETTINGS::IsTestEnabled(), SCH_SHEET_PATH::LastScreen(), CONNECTION_SUBGRAPH::m_bus_parents, CONNECTION_SUBGRAPH::m_driver_connection, CONNECTION_SUBGRAPH::m_hier_parent, CONNECTION_SUBGRAPH::m_hier_pins, CONNECTION_SUBGRAPH::m_hier_ports, CONNECTION_SUBGRAPH::m_items, m_net_name_to_subgraphs_map, CONNECTION_SUBGRAPH::m_no_connect, m_schematic, CONNECTION_SUBGRAPH::m_sheet, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, text, and EDA_ITEM::Type().
Referenced by RunERC().
|
private |
If the subgraph has multiple drivers of equal priority that are graphically connected, ResolveDrivers() will have stored the second driver for use by this function, which actually creates the markers.
| aSubgraph | is the subgraph to examine |
Definition at line 4991 of file connection_graph.cpp.
References _, SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_DRIVER_CONFLICT, CONNECTION_SUBGRAPH::GetNameForDriver(), EDA_ITEM::GetPosition(), CONNECTION_SUBGRAPH::GetSheet(), SCH_PIN::IsPower(), SCH_SHEET_PATH::LastScreen(), CONNECTION_SUBGRAPH::m_driver, CONNECTION_SUBGRAPH::m_drivers, CONNECTION_SUBGRAPH::m_multiple_drivers, CONNECTION_SUBGRAPH::m_sheet, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, and EDA_ITEM::Type().
Referenced by RunERC().
|
private |
Check one subgraph for proper presence or absence of no-connect symbols.
A pin with a no-connect symbol should not have any connections. A pin without a no-connect symbol should have at least one connection.
| aSubgraph | is the subgraph to examine. |
Definition at line 5264 of file connection_graph.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), ERCE_NOCONNECT_CONNECTED, ERCE_NOCONNECT_NOT_CONNECTED, ERCE_PIN_NOT_CONNECTED, CONNECTION_SUBGRAPH::GetDriverPriority(), SCH_ITEM::GetParentSymbol(), SCH_SYMBOL::GetPin(), EDA_ITEM::GetPosition(), SCH_TEXT::GetPosition(), GetResolvedSubgraphName(), SCH_PIN::GetType(), SYMBOL::IsPower(), SCH_PIN::IsStacked(), ERC_SETTINGS::IsTestEnabled(), SCH_SCREEN::Items(), KI_FALLTHROUGH, SCH_SHEET_PATH::LastScreen(), m_global_label_cache, CONNECTION_SUBGRAPH::m_hier_pins, CONNECTION_SUBGRAPH::m_hier_ports, CONNECTION_SUBGRAPH::m_items, m_local_label_cache, m_net_name_to_subgraphs_map, CONNECTION_SUBGRAPH::m_no_connect, m_schematic, CONNECTION_SUBGRAPH::m_sheet, name, CONNECTION_SUBGRAPH::NONE, EE_RTREE::Overlapping(), pin, PT_NC, PT_NIC, PT_POWER_IN, SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, SCH_SYMBOL_T, and EDA_ITEM::Type().
Referenced by RunERC().
|
private |
Check that a global label is instantiated more that once across the schematic hierarchy.
Definition at line 5881 of file connection_graph.cpp.
References SCH_SCREEN::Append(), ERC_ITEM::Create(), CTX_NETNAME, ERCE_SINGLE_GLOBAL_LABEL, EscapeString(), EDA_ITEM::GetPosition(), SCH_TEXT::GetShownText(), SCH_SHEET_PATH::LastScreen(), m_sheetList, and SCH_GLOBAL_LABEL_T.
Referenced by RunERC().
Replace all references to #aOldItem with #aNewItem in the graph.
Definition at line 770 of file connection_graph.cpp.
References exchange, CONNECTION_SUBGRAPH::ExchangeItem(), SCH_SYMBOL::GetPins(), m_item_to_subgraph_map, m_items, m_schematic, SCH_SYMBOL_T, and EDA_ITEM::Type().
| std::set< std::pair< SCH_SHEET_PATH, SCH_ITEM * > > CONNECTION_GRAPH::ExtractAffectedItems | ( | const std::set< SCH_ITEM * > & | aItems | ) |
For a set of items, this will remove the connected items and their associated data including subgraphs and generated codes from the connection graph.
| aItems | A vector of items whose presence should be removed from the graph. |
Definition at line 1009 of file connection_graph.cpp.
References ConnTrace, GetAllSubgraphs(), CONNECTION_SUBGRAPH::GetNetName(), SCH_SHEET::GetPins(), SCH_SYMBOL::GetPins(), GetSubgraphForItem(), CONNECTION_SUBGRAPH::m_code, m_items, m_schematic, path, pin, removeSubgraphs(), CONNECTION_SUBGRAPH::ResolveDrivers(), SCH_SHEET_T, and SCH_SYMBOL_T.
Referenced by SCHEMATIC::RecalculateConnections().
| CONNECTION_SUBGRAPH * CONNECTION_GRAPH::FindFirstSubgraphByName | ( | const wxString & | aNetName | ) |
Retrieve a subgraph for the given net name, if one exists.
Search every sheet.
| aNetName | is the full net name to search for. |
Definition at line 4836 of file connection_graph.cpp.
References m_net_name_to_subgraphs_map.
| SCH_NETCHAIN * CONNECTION_GRAPH::FindPotentialNetChainBetweenPins | ( | SCH_PIN * | aPinA, |
| SCH_PIN * | aPinB ) |
Locate a potential net chain that contains both pins (by subgraph net membership).
Definition at line 3776 of file connection_graph.cpp.
References GetSubgraphForItem(), m_potentialNetChains, and netChainKeyFor().
Referenced by addCreateNetChainBetweenPinsIfApplicable(), SCH_EDITOR_CONTROL::CreateNetChainBetweenPins(), and DIALOG_CREATE_NET_CHAIN::OnFindPathClicked().
| CONNECTION_SUBGRAPH * CONNECTION_GRAPH::FindSubgraphByName | ( | const wxString & | aNetName, |
| const SCH_SHEET_PATH & | aPath ) |
Return the subgraph for a given net name on a given sheet.
| aNetName | is the local net name to look for. |
| aPath | is a sheet path to look on. |
Definition at line 4814 of file connection_graph.cpp.
References CONNECTION_SUBGRAPH::m_absorbed, CONNECTION_SUBGRAPH::m_driver_connection, m_net_name_to_subgraphs_map, CONNECTION_SUBGRAPH::m_sheet, and SCH_CONNECTION::Name().
Referenced by NETLIST_EXPORTER_BASE::CreatePinList(), NETLIST_EXPORTER_BASE::findAllUnitsOfSymbol(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().
|
private |
Iterate through labels to create placeholders for bus elements.
Need to figure out why these sgs are not getting connected to their bus parents
Definition at line 1839 of file connection_graph.cpp.
References assignNewNetCode(), ConnTrace, dummy, CONNECTION_SUBGRAPH::GetNetName(), SCH_SHEET_PATH::GetSheet(), SCH_LABEL_BASE::GetShownText(), CONNECTION_SUBGRAPH::m_code, CONNECTION_SUBGRAPH::m_driver_connection, m_driver_subgraphs, CONNECTION_SUBGRAPH::m_is_bus_member, m_last_subgraph_code, m_net_code_to_subgraphs_map, m_net_name_to_subgraphs_map, CONNECTION_SUBGRAPH::m_sheet, CONNECTION_SUBGRAPH::m_strong_driver, m_subgraphs, name, and NET.
Referenced by buildConnectionGraph().
|
private |
Iterate through the global power pins to collect the global labels as drivers.
Definition at line 1903 of file connection_graph.cpp.
References CONNECTION_SUBGRAPH::AddItem(), assignNewNetCode(), CONNECTION_SUBGRAPH::GetNetName(), SYMBOL::IsGlobalPower(), CONNECTION_SUBGRAPH::m_code, m_driver_subgraphs, m_global_power_pins, m_last_subgraph_code, m_net_code_to_subgraphs_map, CONNECTION_SUBGRAPH::m_sheet, m_subgraphs, pin, CONNECTION_SUBGRAPH::ResolveDrivers(), SCH_CONNECTION::SetName(), SCH_CONNECTION::SetNetCode(), SCH_CONNECTION::SetSubgraphCode(), and SCH_CONNECTION::SubgraphCode().
Referenced by buildConnectionGraph().
| const std::vector< CONNECTION_SUBGRAPH * > & CONNECTION_GRAPH::GetAllSubgraphs | ( | const wxString & | aNetName | ) | const |
Definition at line 4863 of file connection_graph.cpp.
References m_net_name_to_subgraphs_map.
Referenced by ExtractAffectedItems(), SCH_EDIT_FRAME::MakeNetNavigatorNode(), HIERARCHY_PANE::UpdateNetHighlight(), and SCH_EDITOR_CONTROL::UpdateNetHighlighting().
| std::shared_ptr< BUS_ALIAS > CONNECTION_GRAPH::GetBusAlias | ( | const wxString & | aName | ) |
Return a bus alias pointer for the given name if it exists (from cache)
CONNECTION_GRAPH caches these, they are owned by the SCH_SCREEN that the alias was defined on. The cache is only used to update the graph.
Definition at line 4731 of file connection_graph.cpp.
References m_bus_alias_cache.
| std::vector< const CONNECTION_SUBGRAPH * > CONNECTION_GRAPH::GetBusesNeedingMigration | ( | ) |
Determine which subgraphs have more than one conflicting bus label.
Definition at line 4739 of file connection_graph.cpp.
References SCH_ITEM::Connection(), ConnTrace, SCH_TEXT::GetShownText(), SCH_CONNECTION::IsBus(), SCH_CONNECTION::m_driver, m_subgraphs, and SCH_CONNECTION::Name().
|
inline |
Return user-created (committed) net chains (legacy accessor retained under net-chain API).
Definition at line 928 of file connection_graph.h.
References m_committedNetChains.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), PANEL_SETUP_NET_CHAINS::loadFromModel(), DIALOG_CREATE_NET_CHAIN::loadPotentials(), and DIALOG_CREATE_NET_CHAIN::OnFindPathClicked().
|
private |
Build a new default connection for the given item based on its properties.
Handles strong drivers (power pins and labels) only.
| aItem | is an item that can generate a connection name. |
| aSubgraph | is used to determine the sheet to use and retrieve the cached name. |
Definition at line 4593 of file connection_graph.cpp.
References CONNECTION_SUBGRAPH::GetNameForDriver(), CONNECTION_SUBGRAPH::m_sheet, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, and EDA_ITEM::Type().
Referenced by processSubGraphs(), and propagateToNeighbors().
| SCH_NETCHAIN * CONNECTION_GRAPH::GetNetChainByName | ( | const wxString & | aName | ) |
Definition at line 4114 of file connection_graph.cpp.
References m_committedNetChains, 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(), CreateManualNetChain(), SCH_EDITOR_CONTROL::HighlightNetChain(), ReplaceNetChainTerminalPin(), SCH_EDITOR_CONTROL::UpdateNetHighlighting(), and DIALOG_CREATE_NET_CHAIN::validateAndCreate().
|
inline |
Definition at line 505 of file connection_graph.h.
References m_netChainColorOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE().
| SCH_NETCHAIN * CONNECTION_GRAPH::GetNetChainForNet | ( | const wxString & | aNet | ) |
Definition at line 4094 of file connection_graph.cpp.
References m_committedNetChains, and traceSchNetChain.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), CreateManualNetChain(), highlightNet(), SCH_EDITOR_CONTROL::HighlightNetChain(), DIALOG_CREATE_NET_CHAIN::loadPotentials(), SCH_EDITOR_CONTROL::NameNetChain(), DIALOG_CREATE_NET_CHAIN::OnFindPathClicked(), NET_CHAIN_MENU::update(), and REPLACE_TERMINAL_PIN_MENU::update().
|
inline |
Definition at line 520 of file connection_graph.h.
References m_netChainMemberNetOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
|
inline |
Definition at line 473 of file connection_graph.h.
References m_netChainNetClassOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
inline |
Definition at line 495 of file connection_graph.h.
References m_netChainTerminalOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
inline |
Definition at line 490 of file connection_graph.h.
References m_netChainTerminalRefOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
inline |
Definition at line 454 of file connection_graph.h.
References m_net_code_to_subgraphs_map.
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(), and API_HANDLER_SCH::handleGetSchematicNetlist().
|
private |
| aNetName | string with the netname for coding |
Definition at line 4156 of file connection_graph.cpp.
References m_last_net_code, and m_net_name_to_code_map.
Referenced by assignNewNetCode().
|
inline |
Potential net chains are inferred groupings produced by RebuildNetChains() but not yet user-committed.
Existing m_committedNetChains now represents only user-created connectivity groups.
Definition at line 896 of file connection_graph.h.
References m_potentialNetChains.
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(), DIALOG_CREATE_NET_CHAIN::loadPotentials(), and SCH_EDITOR_CONTROL::ShowCreateNetChain().
| wxString CONNECTION_GRAPH::GetResolvedSubgraphName | ( | const CONNECTION_SUBGRAPH * | aSubGraph | ) | const |
Return the fully-resolved netname for a given subgraph.
| aSubGraph | Reference to the subgraph. |
Definition at line 4788 of file connection_graph.cpp.
References CONNECTION_SUBGRAPH::GetNetName(), and m_net_name_to_subgraphs_map.
Referenced by ercCheckLabels(), and ercCheckNoConnects().
| CONNECTION_SUBGRAPH * CONNECTION_GRAPH::GetSubgraphForItem | ( | SCH_ITEM * | aItem | ) | const |
Definition at line 4850 of file connection_graph.cpp.
References CONNECTION_SUBGRAPH::m_absorbed, CONNECTION_SUBGRAPH::m_absorbed_by, and m_item_to_subgraph_map.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), buildBridgeAdjacency(), ExtractAffectedItems(), FindPotentialNetChainBetweenPins(), findSingleNetLabelForPin(), BACK_ANNOTATE::processNetNameChange(), and RebuildNetChains().
|
private |
Get the number of pins in a given subgraph.
| aLocSubgraph | Subgraph to search |
Referenced by ercCheckLabels().
|
inline |
We modify how we handle the connectivity graph for small graphs vs large graphs.
Partially this is to avoid unneeded complexity for small graphs, where the performance of the graph is not a concern. This is considered a temporary solution until the connectivity graph is refactored with an eye toward partial updates
Definition at line 590 of file connection_graph.h.
References ADVANCED_CFG::GetCfg(), m_items, and ADVANCED_CFG::m_MinorSchematicGraphSize.
|
staticprivate |
Search for a matching bus member inside a bus connection.
For bus groups, this returns a bus member that matches aSearch by name. For bus vectors, this returns a bus member that matches by vector index.
| aBusConnection | is the bus connection to search. |
| aSearch | is the net connection to search for. |
Definition at line 4626 of file connection_graph.cpp.
References BUS, SCH_CONNECTION::IsBus(), SCH_CONNECTION::LocalName(), SCH_CONNECTION::Members(), SCH_CONNECTION::Type(), and SCH_CONNECTION::VectorIndex().
Referenced by buildConnectionGraph(), and propagateToNeighbors().
| void CONNECTION_GRAPH::Merge | ( | CONNECTION_GRAPH & | aGraph | ) |
Combine the input graph contents into the current graph.
| aGraph | Input graph reference to add to the current graph. |
Definition at line 679 of file connection_graph.cpp.
References chain, CONNECTION_GRAPH(), m_bus_name_to_code_map, m_committedNetChains, CONNECTION_SUBGRAPH::m_driver_connection, m_driver_subgraphs, m_global_label_cache, m_global_power_pins, CONNECTION_SUBGRAPH::m_graph, m_item_to_subgraph_map, m_items, m_last_bus_code, m_last_net_code, m_last_subgraph_code, m_local_label_cache, m_net_code_to_subgraphs_map, m_net_name_to_code_map, m_net_name_to_subgraphs_map, m_netChainColorOverrides, m_netChainMemberNetOverrides, m_netChainNetClassOverrides, m_netChainsBuilt, m_netChainTerminalOverrides, m_netChainTerminalRefOverrides, m_potentialNetChains, m_sheet_to_subgraphs_map, m_subgraphs, SCH_ITEM::SetConnectionGraph(), and SCH_CONNECTION::SetGraph().
Referenced by SCHEMATIC::RecalculateConnections().
|
inline |
Returns true once RebuildNetChains() has completed at least once on this graph.
Definition at line 931 of file connection_graph.h.
References m_netChainsBuilt.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), highlightNet(), and SCH_EDITOR_CONTROL::HighlightNetChain().
|
delete |
References CONNECTION_GRAPH().
|
private |
Process all subgraphs to assign netcodes and merge subgraphs based on labels.
Definition at line 1998 of file connection_graph.cpp.
References assignNetCodesToBus(), assignNewNetCode(), BUS, BUS_GROUP, ConnTrace, getDefaultConnection(), SCH_CONNECTION::IsBus(), SCH_CONNECTION::IsNet(), CONNECTION_SUBGRAPH::m_absorbed, m_bus_name_to_code_map, CONNECTION_SUBGRAPH::m_bus_parents, CONNECTION_SUBGRAPH::m_code, CONNECTION_SUBGRAPH::m_driver, CONNECTION_SUBGRAPH::m_driver_connection, m_driver_subgraphs, CONNECTION_SUBGRAPH::m_drivers, m_last_bus_code, CONNECTION_SUBGRAPH::m_multiple_drivers, m_net_name_to_subgraphs_map, m_sheet_to_subgraphs_map, MM, SCH_CONNECTION::Name(), name, pin, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, SCH_PIN_T, SCH_SHEET_PIN_T, schIUScale, SCH_CONNECTION::SetBusCode(), EDA_ITEM::Type(), and SCH_CONNECTION::Type().
Referenced by buildConnectionGraph().
|
private |
Update all neighbors of a subgraph with this one's connectivity info.
If this subgraph contains hierarchical links, this method will descent the hierarchy and propagate the connectivity across all linked sheets.
| aSubgraph | is the subgraph being processed. |
| aForce | prevents this routine from skipping subgraphs. |
Definition at line 4207 of file connection_graph.cpp.
References SCH_CONNECTION::Clone(), ConnTrace, getDefaultConnection(), CONNECTION_SUBGRAPH::GetDriverPriority(), CONNECTION_SUBGRAPH::GetDriverPriority(), CONNECTION_SUBGRAPH::GetNameForDriver(), CONNECTION_SUBGRAPH::GLOBAL_POWER_PIN, CONNECTION_SUBGRAPH::HIER_LABEL, SCH_CONNECTION::IsBus(), SCH_CONNECTION::IsNet(), kv, SCH_CONNECTION::LocalName(), CONNECTION_SUBGRAPH::m_absorbed, CONNECTION_SUBGRAPH::m_absorbed_by, CONNECTION_SUBGRAPH::m_code, CONNECTION_SUBGRAPH::m_dirty, CONNECTION_SUBGRAPH::m_driver, CONNECTION_SUBGRAPH::m_driver_connection, CONNECTION_SUBGRAPH::m_drivers, CONNECTION_SUBGRAPH::m_graph, CONNECTION_SUBGRAPH::m_hier_children, CONNECTION_SUBGRAPH::m_hier_parent, CONNECTION_SUBGRAPH::m_hier_pins, CONNECTION_SUBGRAPH::m_hier_ports, CONNECTION_SUBGRAPH::m_multiple_drivers, CONNECTION_SUBGRAPH::m_sheet, m_sheet_to_subgraphs_map, CONNECTION_SUBGRAPH::m_strong_driver, matchBusMember(), SCH_CONNECTION::Members(), SCH_CONNECTION::Name(), path, SCH_SHEET_PATH::PathHumanReadable(), pin, propagateToNeighbors(), SCH_SHEET_PATH::push_back(), recacheSubgraphName(), SCH_CONNECTION::Sheet(), SCH_SHEET_PATH::size(), and SCH_CONNECTION::Type().
Referenced by buildConnectionGraph(), and propagateToNeighbors().
|
private |
Definition at line 3192 of file connection_graph.cpp.
References _, CONNECTION_GRAPH::BRIDGE_GRAPH::adjacency, buildBridgeAdjacency(), chain, comp, CreateManualNetChain(), CreateNetChainFromPotential(), CONNECTION_GRAPH::BRIDGE_GRAPH::edges, SCH_NETCHAIN::GetName(), CONNECTION_SUBGRAPH::GetNetName(), SCH_NETCHAIN::GetNets(), SCH_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), GetSubgraphForItem(), SCH_NETCHAIN::GetSymbols(), EDA_TEXT::GetText(), SCH_SCREEN::Items(), kv, CONNECTION_SUBGRAPH::m_code, m_committedNetChains, m_items, m_netChainMemberNetOverrides, m_netChainsBuilt, m_netChainTerminalOverrides, m_netChainTerminalRefOverrides, m_potentialNetChains, m_schematic, m_sheetList, EDA_ITEM::m_Uuid, name, netChainKeyFor(), EE_RTREE::OfType(), CONNECTION_GRAPH::BRIDGE_NEIGHBOR::other, pin, RebuildNetChainsTestHook(), refreshCommittedChainFromPotential(), refreshCommittedChainPayload(), resolvePotentialChainByTerminals(), SCH_LABEL_T, SCH_SYMBOL_T, traceSchNetChain, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by buildConnectionGraph().
|
static |
Test-only hook fired inside RebuildNetChains() after the restore passes have finished but before the success flag is flipped.
QA fixtures install a callback to inject a throw and validate that the catch-block rollback truncates m_committedNetChains and restores m_netChainsBuilt. Production code never sets this; the default value is empty and the hook call site is a no-op.
Definition at line 2910 of file connection_graph.cpp.
References CONNECTION_GRAPH().
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), RebuildNetChains(), and NETCHAIN_ROLLBACK_FIXTURE::~NETCHAIN_ROLLBACK_FIXTURE().
|
private |
Definition at line 4714 of file connection_graph.cpp.
References ConnTrace, CONNECTION_SUBGRAPH::m_driver_connection, m_net_name_to_subgraphs_map, and SCH_CONNECTION::Name().
Referenced by buildConnectionGraph(), and propagateToNeighbors().
| void CONNECTION_GRAPH::Recalculate | ( | const SCH_SHEET_LIST & | aSheetList, |
| bool | aUnconditional = false, | ||
| std::function< void(SCH_ITEM *)> * | aChangedItemHandler = nullptr, | ||
| PROGRESS_REPORTER * | aProgressReporter = nullptr ) |
Update the connection graph for the given list of sheets.
| aSheetList | is the list of possibly modified sheets |
| aUnconditional | is true if an unconditional full recalculation should be done |
| aChangedItemHandler | an optional handler to receive any changed items |
Definition at line 857 of file connection_graph.cpp.
References buildConnectionGraph(), ConnTrace, DanglingProfileMask, APP_MONITOR::TRANSACTION::Finish(), APP_MONITOR::TRANSACTION::FinishSpan(), SCH_SHEET::GetPins(), SCH_SYMBOL::GetPins(), SCH_ITEM::GetUnit(), SCH_SYMBOL::GetUnitSelection(), PROGRESS_REPORTER::KeepRefreshing(), m_items, m_schematic, m_sheetList, pin, Reset(), SCH_SHEET_T, SCH_SYMBOL_T, PROGRESS_REPORTER::SetCurrentProgress(), SCH_ITEM::SetUnit(), PROF_TIMER::Show(), APP_MONITOR::TRANSACTION::Start(), APP_MONITOR::TRANSACTION::StartSpan(), PROF_TIMER::Stop(), SCH_SCREEN::TestDanglingEnds(), and updateItemConnectivity().
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(), 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(), highlightNet(), SCH_EDITOR_CONTROL::HighlightNetChain(), SCHEMATIC::RecalculateConnections(), SCH_EDITOR_CONTROL::RemoveFromNetChain(), SCH_EDITOR_CONTROL::ShowCreateNetChain(), and SCH_SCREENS::UpdateSymbolLinks().
|
private |
Thin forwarder over refreshCommittedChainPayload that pulls payload fields from an inferred potential chain.
Definition at line 3947 of file connection_graph.cpp.
References SCH_NETCHAIN::GetNets(), SCH_NETCHAIN::GetSymbols(), SCH_NETCHAIN::GetTerminalPinA(), SCH_NETCHAIN::GetTerminalPinB(), SCH_NETCHAIN::GetTerminalPinNum(), SCH_NETCHAIN::GetTerminalRef(), and refreshCommittedChainPayload().
Referenced by RebuildNetChains().
|
private |
Replace the derived-view payload on aTarget with explicitly supplied member nets, symbols, terminal pins, and terminal refs.
Preserves the chain's name and any user-set netclass/color overrides stored on the chain itself. Empty net names are filtered. Used by RebuildNetChains to refresh committed chains in place after Reset() has cleared their stale schematic-item pointers.
Definition at line 3902 of file connection_graph.cpp.
References SCH_NETCHAIN::AddSymbol(), SCH_NETCHAIN::ClearSymbols(), SCH_NETCHAIN::GetName(), SCH_NETCHAIN::GetSymbols(), m_netChainTerminalOverrides, SCH_NETCHAIN::ReplaceNets(), SCH_NETCHAIN::SetTerminalPins(), and SCH_NETCHAIN::SetTerminalRefs().
Referenced by RebuildNetChains(), and refreshCommittedChainFromPotential().
|
private |
Move every net-chain override map entry keyed by aOld to aNew.
Maps that do not contain aOld are left untouched, so this is safe to call from any rename path regardless of which overrides exist.
Definition at line 3877 of file connection_graph.cpp.
References m_netChainColorOverrides, m_netChainMemberNetOverrides, m_netChainNetClassOverrides, m_netChainTerminalOverrides, and m_netChainTerminalRefOverrides.
Referenced by RenameCommittedNetChain().
| void CONNECTION_GRAPH::RemoveItem | ( | SCH_ITEM * | aItem | ) |
Definition at line 1120 of file connection_graph.cpp.
References CONNECTION_SUBGRAPH::m_absorbed_by, m_item_to_subgraph_map, m_items, and CONNECTION_SUBGRAPH::RemoveItem().
Referenced by SCH_COMMIT::Revert(), and SCH_ITEM::~SCH_ITEM().
|
private |
Remove references to the given subgraphs from all structures in the connection graph.
| aSubgraphs | set of unique subgraphs to find/remove. |
Definition at line 1138 of file connection_graph.cpp.
References ConnTrace, m_bus_name_to_code_map, CONNECTION_SUBGRAPH::m_bus_neighbors, CONNECTION_SUBGRAPH::m_bus_parents, m_driver_subgraphs, m_global_label_cache, m_item_to_subgraph_map, m_local_label_cache, m_net_code_to_subgraphs_map, m_net_name_to_code_map, m_net_name_to_subgraphs_map, m_sheet_to_subgraphs_map, and m_subgraphs.
Referenced by ExtractAffectedItems().
| bool CONNECTION_GRAPH::RenameCommittedNetChain | ( | const wxString & | aOld, |
| const wxString & | aNew ) |
Rename a committed net chain.
Re-keys override map entries from the old name to the new one, and updates every member symbol's net-chain name marker. Returns false when the new name is empty, the old chain does not exist, or another chain already uses the new name.
Definition at line 3837 of file connection_graph.cpp.
References chain, SCH_NETCHAIN::GetSymbols(), m_committedNetChains, rekeyOverrideMaps(), and SCH_NETCHAIN::SetName().
Referenced by PANEL_SETUP_NET_CHAINS::ApplyEdits(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
| void CONNECTION_GRAPH::ReplaceNetChainTerminalPin | ( | const wxString & | aNetChain, |
| const KIID & | aPrev, | ||
| const KIID & | aNew ) |
Definition at line 4131 of file connection_graph.cpp.
References KIID::AsString(), GetNetChainByName(), m_netChainTerminalOverrides, and traceSchNetChain.
Referenced by BOOST_FIXTURE_TEST_CASE(), and SCH_EDITOR_CONTROL::ReplaceTerminalPin().
| void CONNECTION_GRAPH::Reset | ( | ) |
Only delete subgraphs of which we are the owner
Definition at line 817 of file connection_graph.cpp.
References chain, m_bus_alias_cache, m_bus_name_to_code_map, m_committedNetChains, m_driver_subgraphs, m_global_label_cache, m_global_power_pins, m_item_to_subgraph_map, m_items, m_last_bus_code, m_last_net_code, m_last_subgraph_code, m_local_label_cache, m_net_code_to_subgraphs_map, m_net_name_to_code_map, m_net_name_to_subgraphs_map, m_netChainsBuilt, m_potentialNetChains, m_sheet_to_subgraphs_map, and m_subgraphs.
Referenced by SCH_EDIT_FRAME::OpenProjectFiles(), Recalculate(), and ~CONNECTION_GRAPH().
|
private |
Find all subgraphs in the connection graph and calls ResolveDrivers() in parallel.
Definition at line 1689 of file connection_graph.cpp.
References ConnTrace, GetKiCadThreadPool(), m_driver_subgraphs, m_subgraphs, pin, PT_NC, SCH_BUS_WIRE_ENTRY_T, SCH_NO_CONNECT_T, SCH_PIN_T, tp, and EDA_ITEM::Type().
Referenced by buildConnectionGraph().
|
staticprivate |
Disambiguate the saved (refA.pinA, refB.pinB) terminal pair against the current set of potential net chains.
Returns the potential chain whose net set contains BOTH endpoint nets. Returning the first match that contains only one net would silently pick the wrong chain when two potentials share an endpoint but differ at the other terminal. Tested via the boost_test_resolve_potential_chain_by_terminals friend shim.
Definition at line 3745 of file connection_graph.cpp.
References traceSchNetChain.
Referenced by boost_test_resolve_potential_chain_by_terminals, and RebuildNetChains().
| int CONNECTION_GRAPH::RunERC | ( | ) |
Run electrical rule checks on the connectivity graph.
Precondition: graph is up-to-date
NOTE:
We could check that labels attached to bus subgraphs follow the proper format (i.e. actually define a bus).
This check doesn't need to be here right now because labels won't actually be connected to bus wires if they aren't in the right format due to their TestDanglingEnds() implementation.
Definition at line 4876 of file connection_graph.cpp.
References ercCheckBusToBusConflicts(), ercCheckBusToBusEntryConflicts(), ercCheckBusToNetConflicts(), ercCheckDanglingWireEndpoints(), ercCheckDirectiveLabels(), ercCheckFloatingWires(), ercCheckHierSheets(), ercCheckLabels(), ercCheckMultipleDrivers(), ercCheckNoConnects(), ercCheckSingleGlobalLabel(), 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, ERC_SETTINGS::IsTestEnabled(), m_schematic, and m_subgraphs.
|
inline |
Definition at line 410 of file connection_graph.h.
References CONNECTION_GRAPH(), m_last_bus_code, m_last_net_code, and m_last_subgraph_code.
Referenced by BOOST_FIXTURE_TEST_CASE(), and SCHEMATIC::RecalculateConnections().
|
inline |
Definition at line 500 of file connection_graph.h.
References m_netChainColorOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
|
inline |
Stash per-chain member-net lists read from the schematic file.
Used by RebuildNetChains to reconstruct manual force-created chains, which have no underlying inferred potential to match against.
Definition at line 515 of file connection_graph.h.
References m_netChainMemberNetOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
inline |
Stash per-net-chain netclass overrides read from the schematic file.
These are consumed by RebuildNetChains when committed chains are named: if a chain matches one of the keys, its netclass override is set from the value.
Definition at line 468 of file connection_graph.h.
References m_netChainNetClassOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and BOOST_FIXTURE_TEST_CASE().
| void CONNECTION_GRAPH::SetNetChainTerminalOverrides | ( | const std::map< wxString, std::pair< KIID, KIID > > & | aOverrides | ) |
Definition at line 4147 of file connection_graph.cpp.
References m_netChainTerminalOverrides, and traceSchNetChain.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
inline |
Definition at line 485 of file connection_graph.h.
References m_netChainTerminalRefOverrides.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
inline |
Definition at line 405 of file connection_graph.h.
References m_schematic.
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
private |
Update the connectivity of items that are not pins or symbols.
This is called by updateItemConnectivity() for each item in the schematic that is not a symbol or pin.
Definition at line 1379 of file connection_graph.cpp.
References BUS, SCH_ITEM::ClearConnectedItems(), SCH_ITEM::GetConnectionPoints(), SCH_ITEM::GetLayer(), SCH_ITEM::InitializeConnection(), LAYER_BUS, m_items, NET, SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_LINE_T, SCH_PIN_T, SCH_CONNECTION::SetType(), EDA_ITEM::Type(), and updatePinConnectivity().
Referenced by boost_test_update_generic_connectivity, and updateItemConnectivity().
|
private |
Update the graphical connectivity between items (i.e.
where they touch) The items passed in must be on the same sheet.
In the first phase, all items in aItemList have their connections initialized for the given sheet (since they may have connections on more than one sheet, and each needs to be calculated individually). The graphical connection points for the item are added to a map that stores (x, y) -> [list of items].
Any item that is stored in the list of items that have a connection point at a given (x, y) location will eventually be electrically connected. This means that we can't store SCH_SYMBOLs in this map – we must store a structure that links a specific pin on a symbol back to that symbol: a SCH_PIN_CONNECTION. This wrapper class is a convenience for linking a pin and symbol to a specific (x, y) point.
In the second phase, we iterate over each value in the map, which is a vector of items that have overlapping connection points. After some checks to ensure that the items should actually connect, the items are linked together using ConnectedItems().
As a side effect, items are loaded into m_items for BuildConnectionGraph().
| aSheet | is the path to the sheet of all items in the list. |
| aItemList | is a list of items to consider. |
Special case for labels that overlap wires While this is an ERC error as there is not an explicit junction, we want to enforce connectivity for all items under the label position.
Definition at line 1420 of file connection_graph.cpp.
References SCH_ITEM::AddConnectionTo(), SCH_SCREEN::GetBus(), SCH_SCREEN::GetBusesAndWires(), SCH_SHEET::GetFileName(), SCH_ITEM::GetLayer(), SCH_SCREEN::Items(), SCH_SHEET_PATH::Last(), SCH_SHEET_PATH::LastScreen(), LAYER_BUS, LAYER_BUS_JUNCTION, LAYER_JUNCTION, SCH_BUS_WIRE_ENTRY::m_connected_bus_item, SCH_BUS_BUS_ENTRY::m_connected_bus_items, m_items, EE_RTREE::Overlapping(), pin, alg::remove_duplicates(), SCH_BUS_BUS_ENTRY_T, SCH_BUS_WIRE_ENTRY_T, SCH_JUNCTION_T, SCH_SHEET_T, SCH_SYMBOL_T, updateGenericItemConnectivity(), and updateSymbolConnectivity().
Referenced by Recalculate().
|
private |
Update the connectivity of a pin and its connections.
This is called by updateItemConnectivity() for each pin in the schematic.
Definition at line 1363 of file connection_graph.cpp.
References SCH_ITEM::ClearConnectedItems(), SCH_PIN::GetDefaultNetName(), SCH_PIN::IsGlobalPower(), m_global_power_pins, name, NET, SCH_CONNECTION::SetName(), and SCH_CONNECTION::SetType().
Referenced by updateGenericItemConnectivity().
|
private |
Update the connectivity of a symbol and its pins.
This is called by updateItemConnectivity() for each symbol in the schematic.
Definition at line 1298 of file connection_graph.cpp.
References SCH_ITEM::ClearConnectedItems(), SCH_PIN::GetDefaultNetName(), LIB_SYMBOL::GetDuplicatePinNumbersAreJumpers(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetPin(), SCH_SYMBOL::GetPins(), group, SCH_PIN::IsGlobalPower(), LIB_SYMBOL::JumperPinGroups(), m_global_power_pins, m_items, name, NET, and pin.
Referenced by boost_test_update_symbol_connectivity, and updateItemConnectivity().
|
friend |
Definition at line 40 of file test_net_chain_save_root_only.cpp.
References CONNECTION_GRAPH(), and m_committedNetChains.
|
friend |
Definition at line 36 of file test_net_chain_resolve_terminals.cpp.
References resolvePotentialChainByTerminals().
|
friend |
Definition at line 144 of file test_update_items_connectivity.cpp.
References LIB_SYMBOL::AddDrawItem(), BOOST_REQUIRE(), BUS, SCH_ITEM::Connection(), CONNECTION_GRAPH(), SCH_BUS_ENTRY_BASE::GetConnectionPoints(), SCH_LINE::GetEndPoint(), LIB_SYMBOL::GetLibId(), SCH_SYMBOL::GetPins(), SCH_LINE::GetStartPoint(), LAYER_BUS, LAYER_WIRE, SCH_BUS_WIRE_ENTRY::m_connected_bus_item, SCH_BUS_BUS_ENTRY::m_connected_bus_items, m_global_power_pins, NET, pin, PT_POWER_IN, SCH_SHEET_PATH::push_back(), SCH_LINE::SetEndPoint(), LIB_SYMBOL::SetGlobalPower(), SCH_PIN::SetName(), SCH_PIN::SetNumber(), EDA_ITEM::SetParent(), SCH_PIN::SetPosition(), SCH_SYMBOL::SetRef(), SCH_SHEET::SetScreen(), SCH_PIN::SetType(), SCH_CONNECTION::Type(), updateGenericItemConnectivity(), and SCH_SYMBOL::UpdatePins().
|
friend |
Definition at line 39 of file test_update_items_connectivity.cpp.
References LIB_SYMBOL::AddDrawItem(), BOOST_CHECK_EQUAL(), SCH_ITEM::ConnectedItems(), SCH_ITEM::Connection(), CONNECTION_GRAPH(), LIB_SYMBOL::GetLibId(), SCH_SYMBOL::GetPins(), LIB_SYMBOL::JumperPinGroups(), m_global_power_pins, m_items, SCH_CONNECTION::Name(), name, pin, PT_INPUT, PT_POWER_IN, SCH_SHEET_PATH::push_back(), LIB_SYMBOL::SetDuplicatePinNumbersAreJumpers(), LIB_SYMBOL::SetGlobalPower(), EDA_ITEM::SetParent(), SCH_SHEET::SetScreen(), SCH_SYMBOL::SetValueFieldText(), SCH_SYMBOL::UpdatePins(), and updateSymbolConnectivity().
|
private |
Definition at line 1053 of file connection_graph.h.
Referenced by buildConnectionGraph(), buildItemSubGraphs(), GetBusAlias(), and Reset().
|
private |
Definition at line 1057 of file connection_graph.h.
Referenced by Merge(), processSubGraphs(), removeSubgraphs(), and Reset().
|
private |
Definition at line 1070 of file connection_graph.h.
Referenced by boost_test_inject_committed_net_chain, CreateManualNetChain(), CreateNetChainFromPotential(), DeleteCommittedNetChain(), GetCommittedNetChains(), GetNetChainByName(), GetNetChainForNet(), Merge(), RebuildNetChains(), RenameCommittedNetChain(), and Reset().
|
private |
Cache of a subset of m_subgraphs.
Definition at line 1046 of file connection_graph.h.
Referenced by buildConnectionGraph(), collectAllDriverValues(), generateBusAliasMembers(), generateGlobalPowerPinSubGraphs(), Merge(), processSubGraphs(), removeSubgraphs(), Reset(), and resolveAllDrivers().
|
private |
Definition at line 1059 of file connection_graph.h.
Referenced by collectAllDriverValues(), ercCheckNoConnects(), Merge(), removeSubgraphs(), and Reset().
|
private |
Definition at line 1051 of file connection_graph.h.
Referenced by boost_test_update_generic_connectivity, boost_test_update_symbol_connectivity, generateGlobalPowerPinSubGraphs(), Merge(), Reset(), updatePinConnectivity(), and updateSymbolConnectivity().
|
private |
Definition at line 1066 of file connection_graph.h.
Referenced by buildItemSubGraphs(), ExchangeItem(), GetSubgraphForItem(), Merge(), RemoveItem(), removeSubgraphs(), and Reset().
|
private |
All connectable items in the schematic.
Definition at line 1040 of file connection_graph.h.
Referenced by boost_test_update_symbol_connectivity, buildItemSubGraphs(), ExchangeItem(), ExtractAffectedItems(), IsMinor(), Merge(), RebuildNetChains(), Recalculate(), RemoveItem(), Reset(), updateGenericItemConnectivity(), updateItemConnectivity(), and updateSymbolConnectivity().
|
private |
Definition at line 1081 of file connection_graph.h.
Referenced by CONNECTION_GRAPH(), Merge(), processSubGraphs(), Reset(), and SetLastCodes().
|
private |
Definition at line 1079 of file connection_graph.h.
Referenced by CONNECTION_GRAPH(), getOrCreateNetCode(), Merge(), Reset(), and SetLastCodes().
|
private |
Definition at line 1083 of file connection_graph.h.
Referenced by buildItemSubGraphs(), CONNECTION_GRAPH(), generateBusAliasMembers(), generateGlobalPowerPinSubGraphs(), Merge(), Reset(), and SetLastCodes().
|
private |
Definition at line 1062 of file connection_graph.h.
Referenced by collectAllDriverValues(), ercCheckNoConnects(), Merge(), removeSubgraphs(), and Reset().
|
private |
Definition at line 1068 of file connection_graph.h.
Referenced by buildConnectionGraph(), generateBusAliasMembers(), generateGlobalPowerPinSubGraphs(), GetNetMap(), Merge(), removeSubgraphs(), and Reset().
|
private |
Definition at line 1055 of file connection_graph.h.
Referenced by getOrCreateNetCode(), Merge(), removeSubgraphs(), and Reset().
|
private |
Definition at line 1064 of file connection_graph.h.
Referenced by buildConnectionGraph(), collectAllDriverValues(), ercCheckLabels(), ercCheckNoConnects(), FindFirstSubgraphByName(), FindSubgraphByName(), generateBusAliasMembers(), GetAllSubgraphs(), GetResolvedSubgraphName(), Merge(), processSubGraphs(), recacheSubgraphName(), removeSubgraphs(), and Reset().
|
private |
Definition at line 1075 of file connection_graph.h.
Referenced by CreateManualNetChain(), CreateNetChainFromPotential(), DeleteCommittedNetChain(), GetNetChainColorOverrides(), Merge(), rekeyOverrideMaps(), and SetNetChainColorOverrides().
|
private |
Definition at line 1077 of file connection_graph.h.
Referenced by CreateManualNetChain(), CreateNetChainFromPotential(), DeleteCommittedNetChain(), GetNetChainMemberNetOverrides(), Merge(), RebuildNetChains(), rekeyOverrideMaps(), and SetNetChainMemberNetOverrides().
|
private |
Definition at line 1074 of file connection_graph.h.
Referenced by CreateManualNetChain(), CreateNetChainFromPotential(), DeleteCommittedNetChain(), GetNetChainNetClassOverrides(), Merge(), rekeyOverrideMaps(), and SetNetChainNetClassOverrides().
|
private |
Definition at line 1072 of file connection_graph.h.
Referenced by Merge(), NetChainsBuilt(), RebuildNetChains(), and Reset().
Definition at line 1073 of file connection_graph.h.
Referenced by DeleteCommittedNetChain(), GetNetChainTerminalOverrides(), Merge(), RebuildNetChains(), refreshCommittedChainPayload(), rekeyOverrideMaps(), ReplaceNetChainTerminalPin(), and SetNetChainTerminalOverrides().
|
private |
Definition at line 1076 of file connection_graph.h.
Referenced by CreateManualNetChain(), CreateNetChainFromPotential(), DeleteCommittedNetChain(), GetNetChainTerminalRefOverrides(), Merge(), RebuildNetChains(), rekeyOverrideMaps(), and SetNetChainTerminalRefOverrides().
|
private |
last built potential (uncommitted) net chains
Definition at line 1071 of file connection_graph.h.
Referenced by FindPotentialNetChainBetweenPins(), GetPotentialNetChains(), Merge(), RebuildNetChains(), and Reset().
|
private |
The schematic this graph represents.
Definition at line 1085 of file connection_graph.h.
Referenced by buildConnectionGraph(), buildItemSubGraphs(), CONNECTION_GRAPH(), ercCheckHierSheets(), ercCheckLabels(), ercCheckNoConnects(), ExchangeItem(), ExtractAffectedItems(), RebuildNetChains(), Recalculate(), RunERC(), and SetSchematic().
|
private |
Cache to lookup subgraphs in m_driver_subgraphs by sheet path.
Definition at line 1049 of file connection_graph.h.
Referenced by buildConnectionGraph(), Merge(), processSubGraphs(), propagateToNeighbors(), removeSubgraphs(), and Reset().
|
private |
All the sheets in the schematic (as long as we don't have partial updates).
Definition at line 1037 of file connection_graph.h.
Referenced by buildBridgeAdjacency(), ercCheckDirectiveLabels(), ercCheckHierSheets(), ercCheckSingleGlobalLabel(), RebuildNetChains(), and Recalculate().
|
private |
The owner of all CONNECTION_SUBGRAPH objects.
Definition at line 1043 of file connection_graph.h.
Referenced by buildItemSubGraphs(), generateBusAliasMembers(), generateGlobalPowerPinSubGraphs(), GetBusesNeedingMigration(), Merge(), removeSubgraphs(), Reset(), resolveAllDrivers(), and RunERC().