More accurate detection of zero-length segments.in AutoSegment::canReduce().

This commit is contained in:
Jean-Paul Chaput 2021-04-15 23:47:21 +02:00
parent 95713ac66b
commit 20efd75a32
2 changed files with 8 additions and 4 deletions

View File

@ -446,6 +446,7 @@ namespace Anabatic {
void AnabaticEngine::_gutAnabatic ()
{
//DebugSession::open( 159, 160 );
openSession();
_flags.reset( Flags::DestroyBaseContact|Flags::DestroyBaseSegment );
@ -469,6 +470,7 @@ namespace Anabatic {
//if (isegment.second->bloatStackedStrap()) ++bloatedStraps;
}
sort( reduceds.begin(), reduceds.end() );
// cerr << "Reduced segment queue:" << endl;
// for ( size_t i=0 ; i<reduceds.size() ; ++i ) {
// cerr << "| " << setw(3) << i
// << " " << reduceds[i].nonReduceds()
@ -510,6 +512,7 @@ namespace Anabatic {
exportExternalNets();
Session::close();
//DebugSession::close();
}

View File

@ -1754,7 +1754,6 @@ namespace Anabatic {
if (not isSpinTopOrBottom()) return false;
if ((getDepth() == 1) and isSpinBottom()) return false;
if ((flags & Flags::WithPerpands) and _reduceds) return false;
if ((flags & Flags::NullLength) and (getAnchoredLength() > 0)) return false;
AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget();
@ -1768,6 +1767,9 @@ namespace Anabatic {
// if ( source->isHTee() or source->isVTee()
// or target->isHTee() or target->isVTee() ) return false;
cdebug_log(159,0) << " length:" << DbU::getValueString(getAnchoredLength()) << endl;
if (flags & Flags::NullLength) return (getAnchoredLength() == 0);
unsigned int perpandicularDepth = getDepth();
if (isSpinBottom()) {
if (perpandicularDepth > 0) --perpandicularDepth;
@ -1776,9 +1778,8 @@ namespace Anabatic {
if (perpandicularDepth >= Session::getDepth()) return false;
} else
return false;
cdebug_log(159,0) << " length:" << DbU::getValueString(getAnchoredLength()) << endl;
if (getAnchoredLength() >= (Session::getPitch(perpandicularDepth) * 2)) return false;
if (getAnchoredLength() >= Session::getPitch(perpandicularDepth) * 2) return false;
return true;
}