router: take track width changes into account when calculating trace length for tuning

This commit is contained in:
Tomasz Wlostowski 2015-11-05 19:20:08 +10:00 committed by Maciej Suminski
parent a23cbe052d
commit 08178104bb
2 changed files with 21 additions and 3 deletions

View File

@ -102,6 +102,20 @@ public:
return ( m_linkedItems.Size() == 3 && vias == 1 && segs == 2 ); return ( m_linkedItems.Size() == 3 && vias == 1 && segs == 2 );
} }
bool IsTraceWidthChange() const
{
if( m_linkedItems.Size() != 2 )
return false;
if( m_linkedItems.Count( SEGMENT ) != 2)
return false;
PNS_SEGMENT* seg1 = static_cast<PNS_SEGMENT*>( m_linkedItems[0] );
PNS_SEGMENT* seg2 = static_cast<PNS_SEGMENT*>( m_linkedItems[1] );
return seg1->Width() != seg2->Width();
}
///> Links the joint to a given board item (when it's added to the PNS_NODE) ///> Links the joint to a given board item (when it's added to the PNS_NODE)
void Link( PNS_ITEM* aItem ) void Link( PNS_ITEM* aItem )
{ {

View File

@ -183,7 +183,7 @@ bool PNS_TOPOLOGY::followTrivialPath( PNS_LINE* aLine, bool aLeft, PNS_ITEMSET&
aVisited.insert( last ); aVisited.insert( last );
if( jt->IsNonFanoutVia() ) if( jt->IsNonFanoutVia() || jt->IsTraceWidthChange() )
{ {
PNS_ITEM* via = NULL; PNS_ITEM* via = NULL;
PNS_SEGMENT* next_seg = NULL; PNS_SEGMENT* next_seg = NULL;
@ -210,12 +210,16 @@ bool PNS_TOPOLOGY::followTrivialPath( PNS_LINE* aLine, bool aLeft, PNS_ITEMSET&
if( aLeft ) if( aLeft )
{ {
if( via )
aSet.Prepend( via ); aSet.Prepend( via );
aSet.Prepend( l ); aSet.Prepend( l );
} }
else else
{ {
if( via )
aSet.Add( via ); aSet.Add( via );
aSet.Add( l ); aSet.Add( l );
} }