diff --git a/kite/src/Configuration.cpp b/kite/src/Configuration.cpp index 7b2c8f09..9804f05a 100644 --- a/kite/src/Configuration.cpp +++ b/kite/src/Configuration.cpp @@ -66,7 +66,7 @@ namespace Kite { , _base (base) , _postEventCb () , _edgeCapacityPercent(0.80) - , _expandStep (0.60) + , _expandStep (0.99) , _ripupLimits () , _ripupCost (3) , _eventsLimit (4000000) diff --git a/kite/src/GraphicKiteEngine.cpp b/kite/src/GraphicKiteEngine.cpp index fa3f5a18..1e53e678 100644 --- a/kite/src/GraphicKiteEngine.cpp +++ b/kite/src/GraphicKiteEngine.cpp @@ -178,7 +178,7 @@ namespace Kite { void GraphicKiteEngine::runDetailed () { - static vector routingNets; + static KatabaticEngine::NetSet routingNets; KiteEngine* kite = KiteEngine::get ( getCell() ); if ( not kite ) { @@ -191,14 +191,6 @@ namespace Kite { _viewer->clearToolInterrupt (); - // kite->setSaturateRatio ( 0.85 ); - // kite->setExpandStep ( 0.20 ); - // kite->setRipupLimit ( 25, Configuration::BorderRipupLimit ); - // kite->setRipupLimit ( 15, Configuration::StrapRipupLimit ); - // kite->setRipupLimit ( 5, Configuration::LocalRipupLimit ); - // kite->setRipupLimit ( 5, Configuration::GlobalRipupLimit ); - // kite->setRipupLimit ( 5, Configuration::LongGlobalRipupLimit ); - // kite->setRipupCost ( 3 ); kite->loadGlobalRouting ( Katabatic::LoadGrByNet, routingNets ); emit cellPostModificated (); diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 148d382c..875013c9 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -377,7 +377,7 @@ namespace Kite { } - void KiteEngine::loadGlobalRouting ( unsigned int method, vector& nets ) + void KiteEngine::loadGlobalRouting ( unsigned int method, KatabaticEngine::NetSet& nets ) { KatabaticEngine::loadGlobalRouting ( method, nets ); diff --git a/kite/src/KiteMain.cpp b/kite/src/KiteMain.cpp index 8f58e907..7da9c082 100644 --- a/kite/src/KiteMain.cpp +++ b/kite/src/KiteMain.cpp @@ -173,7 +173,7 @@ int main ( int argc, char *argv[] ) knik->loadSolution (); } - static vector routingNets; + static KatabaticEngine::NetSet routingNets; KiteEngine* kite = KiteEngine::create ( cell ); // kite->setSaturateRatio ( 0.85 ); // kite->setExpandStep ( 0.20 ); diff --git a/kite/src/PreProcess.cpp b/kite/src/PreProcess.cpp index 23ac36c6..a8ab8d40 100644 --- a/kite/src/PreProcess.cpp +++ b/kite/src/PreProcess.cpp @@ -2,7 +2,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved // // =================================================================== // @@ -82,7 +82,31 @@ namespace { } - void propagateCagedConstraints ( TrackElement* segment ) + void findFailedPerpandiculars ( RoutingPad* rp, unsigned int direction, set& faileds ) + { + ltrace(200) << "Find failed caging: " << rp << endl; + + TrackElement* parallel; + forEach ( Segment*, isegment, rp->getSlaveComponents().getSubSet() ) { + parallel = Session::lookup ( *isegment ); + ltrace(200) << "* " << parallel << endl; + + if ( parallel->isFixed () ) continue; + if ( parallel->getDirection() != direction ) continue; + + AutoContact* contact = parallel->base()->getAutoSource(); + if ( contact->base()->getAnchor() != rp ) contact = NULL; + + if ( contact == NULL ) contact = parallel->base()->getAutoTarget(); + if ( contact->base()->getAnchor() != rp ) continue; + + //parallel->makeDogLeg ( contact->getGCell() ); + faileds.insert ( parallel ); + } + } + + + void propagateCagedConstraints ( TrackElement* segment, set& faileds ) { if ( not segment->isFixed() ) return; @@ -91,6 +115,7 @@ namespace { Track* track = segment->getTrack(); unsigned int direction = Session::getRoutingGauge()->getLayerDirection(segment->getLayer()); AutoContact* source = segment->base()->getAutoSource(); + RoutingPad* rp = NULL; Interval uside = source->getGCell()->getUSide(direction); DbU::Unit minConstraint = DbU::Min; DbU::Unit maxConstraint = DbU::Max; @@ -140,7 +165,7 @@ namespace { // Finding perpandiculars, by way of the source & target RoutingPad. if ( source->getAnchor() ) { - RoutingPad* rp = dynamic_cast(source->getAnchor()); + rp = dynamic_cast(source->getAnchor()); if ( rp ) { TrackElement* parallel; forEach ( Segment*, isegment, rp->getSlaveComponents().getSubSet() ) { @@ -163,18 +188,25 @@ namespace { ltracein(200); if ( perpandiculars.size() == 0 ) { ltrace(200) << "No perpandiculars to " << segment << endl; + ltraceout(200); + return; } Interval constraints ( minConstraint, maxConstraint ); for ( size_t iperpand=0 ; iperpandbase()->mergeUserConstraints ( constraints ); + if ( perpandiculars[iperpand]->base()->getUserConstraints().isEmpty() ) { + ltrace(200) << "Cumulative caged constraints are too tight on " << perpandiculars[iperpand] << endl; + findFailedPerpandiculars ( rp, direction, faileds ); + } } + ltraceout(200); } - void freeCagedTerminals ( Track* track ) + void protectCagedTerminals ( Track* track ) { Configuration* configuration = Session::getConfiguration (); const Layer* metal2 = configuration->getRoutingLayer ( 1 ); @@ -194,15 +226,6 @@ namespace { RoutingPad* rp = dynamic_cast(support->getAnchor()); GCell* gcell = Session::lookup ( support->getGCell() ); -#if 0 - Point point ( segment->base()->getSourceU(), track->getAxis() ); - GCell* gcell = Session::lookup ( segment->base()->getAutoSource()->getGCell() ); - AutoContact* source = AutoContact::create ( gcell->base(), segment->getNet(), metal3 ); - AutoContact* target = AutoContact::create ( gcell->base(), segment->getNet(), metal3 ); - source->setPosition ( point ); - target->setPosition ( point ); -#endif - AutoContact* source = AutoContact::fromRp ( gcell->base() , rp , metal3 @@ -278,7 +301,7 @@ namespace Kite { Track* track = plane->getTrackByIndex ( 0 ); while ( track ) { - freeCagedTerminals ( track ); + protectCagedTerminals ( track ); track = track->getNext (); } } @@ -288,15 +311,17 @@ namespace Kite { void KiteEngine::_computeCagedConstraints () { + set faileds; + TrackElementLut::iterator isegment = _trackSegmentLut.begin(); for ( ; isegment != _trackSegmentLut.end() ; isegment++ ) { if ( not isegment->second->isFixed() ) continue; - propagateCagedConstraints ( isegment->second ); + propagateCagedConstraints ( isegment->second, faileds ); } } - void KiteEngine::_computeCagedConstraints ( Net* net ) + void KiteEngine::_computeCagedConstraints ( Net* net, set& faileds ) { TrackElement* segment = NULL; @@ -311,7 +336,7 @@ namespace Kite { segment = Session::lookup ( *isegment ); if ( not segment ) continue; - propagateCagedConstraints ( segment ); + propagateCagedConstraints ( segment, faileds ); } } diff --git a/kite/src/RoutingEvent.cpp b/kite/src/RoutingEvent.cpp index 34e34358..a00d2ee7 100644 --- a/kite/src/RoutingEvent.cpp +++ b/kite/src/RoutingEvent.cpp @@ -3614,7 +3614,7 @@ namespace Kite { { if ( _valid and not force ) return; - DebugSession::open ( _segment->getNet(), 200 ); + DebugSession::open ( _segment->getNet(), 148 ); ltrace(200) << "RoutingEvent::revalidate() - " << (void*)this << ":" << this << endl; ltracein(200); diff --git a/kite/src/Session.cpp b/kite/src/Session.cpp index 65c5cc63..1e2cb17d 100644 --- a/kite/src/Session.cpp +++ b/kite/src/Session.cpp @@ -69,7 +69,9 @@ namespace Kite { , _insertEvents() , _removeEvents() , _sortEvents () - { } + { + //_addCanonizeCb ( _computeCagedConstraints ); + } void Session::_postCreate () @@ -248,8 +250,9 @@ namespace Kite { # endif } + set faileds; for ( set::iterator inet=netsModificateds.begin() ; inet != netsModificateds.end() ; inet++ ) { - _getKiteEngine()->_computeCagedConstraints ( *inet ); + _getKiteEngine()->_computeCagedConstraints ( *inet, faileds ); } # if defined(CHECK_DATABASE) @@ -261,6 +264,17 @@ namespace Kite { _sortEvents.clear (); + if ( not faileds.empty() ) { + set::iterator ifailed = faileds.begin(); + vector gcells; + for ( ; ifailed != faileds.end() ; ++ifailed ) { + (*ifailed)->getGCells ( gcells ); + (*ifailed)->makeDogLeg ( gcells[0] ); + } + + count += _revalidate (); + } + return count; } diff --git a/kite/src/kite/KiteEngine.h b/kite/src/kite/KiteEngine.h index bef9bde8..1057794b 100644 --- a/kite/src/kite/KiteEngine.h +++ b/kite/src/kite/KiteEngine.h @@ -120,7 +120,7 @@ namespace Kite { void saveGlobalSolution (); void annotateGlobalGraph (); void runGlobalRouter ( unsigned int mode ); - virtual void loadGlobalRouting ( unsigned int method, vector& ); + virtual void loadGlobalRouting ( unsigned int method, KatabaticEngine::NetSet& ); void runNegociate ( unsigned int slowMotion=0 ); void setInterrupt ( bool ); virtual void finalizeLayout (); @@ -133,7 +133,7 @@ namespace Kite { bool _check ( unsigned int& overlap, const char* message=NULL ) const; void _check ( Net* ) const; void _computeCagedConstraints (); - void _computeCagedConstraints ( Net* ); + void _computeCagedConstraints ( Net*, set& ); virtual Record* _getRecord () const; virtual string _getString () const; virtual string _getTypeName () const;