From bd6d0b6cb69be41deb00f5384ba3cbaf71eb4fe7 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 12 Jan 2023 17:01:09 -0800 Subject: [PATCH] Ensure that all subgraphs are processed Don't skip subgraphs just because they do not have off-sheet connections on their hierarchical ports --- eeschema/connection_graph.cpp | 16 +++++++++++++--- eeschema/connection_graph.h | 5 ++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index dc426eced6..2dcd19644e 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -1534,7 +1534,17 @@ void CONNECTION_GRAPH::buildConnectionGraph( std::function* a } // This call will handle descending the hierarchy and updating child subgraphs - propagateToNeighbors( subgraph ); + propagateToNeighbors( subgraph, false ); + } + + // After processing and allowing some to be skipped if they have hierarchical + // pins connecting both up and down the hierarchy, we check to see if any of them + // have not been processed. This would indicate that they do not have off-sheet connections + // but we still need to handle the subgraph + for( CONNECTION_SUBGRAPH* subgraph : m_driver_subgraphs ) + { + if( subgraph->m_dirty ) + propagateToNeighbors( subgraph, true ); } // Handle buses that have been linked together somewhere by member (net) connections. @@ -1798,7 +1808,7 @@ void CONNECTION_GRAPH::assignNetCodesToBus( SCH_CONNECTION* aConnection ) } -void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph ) +void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, bool aForce ) { SCH_CONNECTION* conn = aSubgraph->m_driver_connection; std::vector search_list; @@ -1970,7 +1980,7 @@ void CONNECTION_GRAPH::propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph ) // Recurse onto this neighbor in case it needs to re-propagate neighbor->m_dirty = true; - propagateToNeighbors( neighbor ); + propagateToNeighbors( neighbor, aForce ); } } } diff --git a/eeschema/connection_graph.h b/eeschema/connection_graph.h index 6c9c6d86d6..a2dc9c8e27 100644 --- a/eeschema/connection_graph.h +++ b/eeschema/connection_graph.h @@ -446,8 +446,11 @@ private: * * If this subgraph contains hierarchical links, this method will descent the * hierarchy and propagate the connectivity across all linked sheets. + * + * @param aSubgraph is the subgraph being processed + * @param aForce prevents this routine from skipping subgraphs */ - void propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph ); + void propagateToNeighbors( CONNECTION_SUBGRAPH* aSubgraph, bool aForce ); /** * Search for a matching bus member inside a bus connection