Fix segment AutoSegment::reduce() multiple-call (must run once).

* Bug: In Anabatic::AutoSegment::reduce(), no longer reduce *again*
    an already reduced segment.
      This bug was seen through a side effect, it was causing the
    "reduced perpandicular" counter to be incremented too much and
    so it cannot get back to zero, blocking the layer reduction
    (AutoSegment::reduceDoglegLayer()) and some bad VIAs where left
    over.
      More debug information in reduce & raise functions.
* Change: In Katana::Session::_revalidate(), process to be raised
    segments *before* segments that can be reduceds.
This commit is contained in:
Jean-Paul Chaput 2020-11-17 15:02:50 +01:00
parent 0d372365e1
commit ba43b02e87
4 changed files with 14 additions and 13 deletions

View File

@ -1589,7 +1589,9 @@ namespace Anabatic {
bool AutoSegment::reduce ()
{
if (isReduced()) return false;
if (not canReduce()) return false;
cdebug_log(159,0) << "AutoSegment::reduce():" << this << endl;
AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget();
@ -1604,9 +1606,6 @@ namespace Anabatic {
perpandicular->incReduceds();
}
// if (not source->isTerminal()) source->getPerpandicular( this )->incReduceds();
// if (not target->isTerminal()) target->getPerpandicular( this )->incReduceds();
return true;
}
@ -1627,19 +1626,20 @@ namespace Anabatic {
bool AutoSegment::raise ()
{
if (not (_flags & SegIsReduced)) return false;
cdebug_log(159,0) << "AutoSegment::raise():" << this << endl;
AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget();
_flags &= ~SegIsReduced;
//if (not source->isTerminal()) source->getPerpandicular( this )->decReduceds();
//if (not target->isTerminal()) target->getPerpandicular( this )->decReduceds();
for ( AutoSegment* perpandicular : source->getAutoSegments() ) {
if (perpandicular == this) continue;
cdebug_log(159,0) << "dec PP:" << perpandicular << endl;
perpandicular->decReduceds();
}
for ( AutoSegment* perpandicular : target->getAutoSegments() ) {
if (perpandicular == this) continue;
cdebug_log(159,0) << "dec PP:" << perpandicular << endl;
perpandicular->decReduceds();
}

View File

@ -155,7 +155,7 @@ namespace Katana {
multiset<RoutingEvent*,RoutingEvent::Compare>::iterator ievent = _events.find(event);
size_t count = _events.count(event);
if (count > 1) {
cerr << Bug("RoutingEventQueue::repush(): %d events matches key %p.",count,event) << endl;
cerr << Bug( "RoutingEventQueue::repush(): %d events matches key %p.", count, event ) << endl;
#if defined(CHECK_ROUTINGEVENT_QUEUE)
_keyCheck ();
#endif

View File

@ -375,7 +375,8 @@ namespace Katana {
cdebug_log(159,1) << "* Riping // " << _segment << endl;
}
if (_segment->isFixed()) { DebugSession::close(); return true; }
if (_segment->isFixed ()) { DebugSession::close(); return true; }
//if (_segment->isReduced()) { DebugSession::close(); return true; }
DataNegociate* data = _segment->getDataNegociate();
if (data == NULL) {

View File

@ -318,18 +318,18 @@ namespace Katana {
// Looking for reduced/raised segments.
for ( size_t i=0 ; i<revalidateds.size() ; ++i ) {
if (revalidateds[i]->canReduce()) {
revalidateds[i]->reduce();
TrackElement* trackSegment = lookup( revalidateds[i] );
if (trackSegment and trackSegment->getTrack()) _addRemoveEvent( trackSegment );
cdebug_log(159,0) << "Session: reduce:" << revalidateds[i] << endl;
}
if (revalidateds[i]->mustRaise()) {
cdebug_log(159,0) << "Session: raise:" << revalidateds[i] << endl;
revalidateds[i]->raise();
TrackElement* trackSegment = lookup( revalidateds[i] );
if (trackSegment) trackSegment->reschedule( 0 );
}
if (revalidateds[i]->canReduce()) {
revalidateds[i]->reduce();
TrackElement* trackSegment = lookup( revalidateds[i] );
if (trackSegment and trackSegment->getTrack()) _addRemoveEvent( trackSegment );
cdebug_log(159,0) << "Session: reduce:" << revalidateds[i] << endl;
}
}
// for ( TrackElement* trackSegment : _indirectInvalids ) {