Don't promote globals from locals on a different sheet

Fixes #4004
This commit is contained in:
Jon Evans 2020-03-05 19:08:55 -05:00
parent 058fb3afa1
commit 1e104d5bd4
1 changed files with 6 additions and 0 deletions

View File

@ -1280,11 +1280,17 @@ void CONNECTION_GRAPH::buildConnectionGraph()
if( secondary_name == subgraph->m_driver_connection->Name() )
continue;
bool secondary_is_global = CONNECTION_SUBGRAPH::GetDriverPriority( driver )
>= CONNECTION_SUBGRAPH::PRIORITY::POWER_PIN;
for( CONNECTION_SUBGRAPH* candidate : global_subgraphs )
{
if( candidate == subgraph )
continue;
if( !secondary_is_global && candidate->m_sheet != subgraph->m_sheet )
continue;
SCH_CONNECTION* conn = candidate->m_driver_connection;
if( conn->Name() == secondary_name )