* ./kite:

- Change: In TrackFixedSegment, when the source/target coordinates of the
        fixed segment are outside the grid (i.e. the Cell Abutment Box) truncate
        them.
    - Change: In GCell::addTrackSegment, when looking for overlap between the
        to be inserted TrackSegment and Blockage segment, shrink the Blockage
        span by one DbU to avoid false overlap when they are just edges connexes.
    - Bug: In RoutingEvent::slackenTopology, in the local segment FSM, looping
        on the MaximumSlack state. Now also checks the state count.
    - Change: In TrackSegment::canMoveUp() & canPivotUp() adds the "reserve"
        parameter and uses it in RoutingEvent to prevent over saturated GCells.
    - Change: In Configuration, parameters adjustements: expandStep increased to
        0.40. Makes RoutingSets biggers but no noticeable slow down.
This commit is contained in:
Jean-Paul Chaput 2010-04-23 13:14:17 +00:00
parent e7b1a5de6e
commit b2c3c68601
17 changed files with 167 additions and 103 deletions

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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
// //
// =================================================================== // ===================================================================
// //

View File

@ -579,6 +579,7 @@ namespace Kite {
forEach ( BasicLayer*, iLayer, technology->getBasicLayers() ) { forEach ( BasicLayer*, iLayer, technology->getBasicLayers() ) {
if ( iLayer->getMaterial() != BasicLayer::Material::metal ) continue; if ( iLayer->getMaterial() != BasicLayer::Material::metal ) continue;
if ( _configuration.isGMetal(*iLayer) ) continue;
cmess1 << " - PowerRails in " << iLayer->getName() << " ..." << endl; cmess1 << " - PowerRails in " << iLayer->getName() << " ..." << endl;

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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
// //
// =================================================================== // ===================================================================
// //
@ -16,7 +16,7 @@
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./Configuartion.cpp" | // | C++ Module : "./Configuration.cpp" |
// | *************************************************************** | // | *************************************************************** |
// | U p d a t e s | // | U p d a t e s |
// | | // | |
@ -62,15 +62,16 @@ namespace Kite {
, _base (base) , _base (base)
, _postEventCb () , _postEventCb ()
, _edgeCapacityPercent(_defaultEdgeCapacity) , _edgeCapacityPercent(_defaultEdgeCapacity)
, _expandStep (0.30) , _expandStep (0.40)
, _ripupLimits () , _ripupLimits ()
, _ripupCost (3) , _ripupCost (3)
, _eventsLimit (4000000)
{ {
_ripupLimits[BorderRipupLimit] = 26; _ripupLimits[BorderRipupLimit] = 26;
_ripupLimits[StrapRipupLimit] = 16; _ripupLimits[StrapRipupLimit] = 16;
_ripupLimits[LocalRipupLimit] = 7; _ripupLimits[LocalRipupLimit] = 7;
_ripupLimits[GlobalRipupLimit] = 7; _ripupLimits[GlobalRipupLimit] = 5;
_ripupLimits[LongGlobalRipupLimit] = 7; _ripupLimits[LongGlobalRipupLimit] = 5;
} }

View File

@ -393,7 +393,7 @@ namespace Kite {
Interval blockageSpan; Interval blockageSpan;
autoSegment->getCanonical ( fixedSpan ); autoSegment->getCanonical ( fixedSpan );
fixedSpan.inflate ( Session::getExtensionCap() ); fixedSpan.inflate ( Session::getExtensionCap()-1 );
track->getOverlapBounds ( fixedSpan, begin, end ); track->getOverlapBounds ( fixedSpan, begin, end );
for ( ; (begin < end) ; begin++ ) { for ( ; (begin < end) ; begin++ ) {

View File

@ -49,7 +49,7 @@ namespace Kite {
GCellGrid::GCellGrid ( KiteEngine* kite ) GCellGrid::GCellGrid ( KiteEngine* kite )
: Katabatic::Grid<GCell>() : Katabatic::Grid<GCell>(kite->getCell()->getBoundingBox())
, _kite(kite) , _kite(kite)
{ } { }

View File

@ -490,8 +490,12 @@ namespace Kite {
vector<Name> measuresLabels; vector<Name> measuresLabels;
measuresLabels.push_back ( "Gates" ); measuresLabels.push_back ( "Gates" );
measuresLabels.push_back ( "GCells" ); measuresLabels.push_back ( "GCells" );
measuresLabels.push_back ( "knikT" );
measuresLabels.push_back ( "knikS" );
measuresLabels.push_back ( "loadT" ); measuresLabels.push_back ( "loadT" );
measuresLabels.push_back ( "loadS" ); measuresLabels.push_back ( "loadS" );
measuresLabels.push_back ( "Globals" );
measuresLabels.push_back ( "Edges" );
measuresLabels.push_back ( "assignT" ); measuresLabels.push_back ( "assignT" );
measuresLabels.push_back ( "algoT" ); measuresLabels.push_back ( "algoT" );
measuresLabels.push_back ( "algoS" ); measuresLabels.push_back ( "algoS" );

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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
// //
// =================================================================== // ===================================================================
// //
@ -89,7 +89,8 @@ namespace {
} }
} }
if ( /*(data->getGCellOrder() < Session::getOrder()) ||*/ segment->isFixed() ) { if ( /*(data->getGCellOrder() < Session::getOrder()) ||*/ segment->isFixed()
or ((data->isRing() or data->isBorder()) and (data->getRipupCount() > 3)) ) {
ltrace(200) << "Infinite cost from: " << segment << endl; ltrace(200) << "Infinite cost from: " << segment << endl;
cost.setFixed (); cost.setFixed ();
cost.setInfinite (); cost.setInfinite ();
@ -272,7 +273,7 @@ namespace Kite {
unsigned int order = 0; unsigned int order = 0;
for ( size_t i=0 ; i < gcells.size() ; i++ ) { for ( size_t i=0 ; i < gcells.size() ; i++ ) {
if ( !gcells[i]->isInRoutingSet() ) { if ( not gcells[i]->isInRoutingSet() ) {
Session::setOrder ( order ); Session::setOrder ( order );
GCellRoutingSet* rs = GCellRoutingSet::create ( gcells[i], _kite->getExpandStep() ); GCellRoutingSet* rs = GCellRoutingSet::create ( gcells[i], _kite->getExpandStep() );
rs->expand ( grid ); rs->expand ( grid );
@ -336,6 +337,7 @@ namespace Kite {
DataNegociate* data = segment->getDataNegociate (); DataNegociate* data = segment->getDataNegociate ();
data->resetRipupCount (); data->resetRipupCount ();
data->resetStateCount ();
data->setGCellOrder ( order ); data->setGCellOrder ( order );
if ( _ring[i].getOrder() == order ) { if ( _ring[i].getOrder() == order ) {
ltrace(200) << "Removing from ring: " << segment << endl; ltrace(200) << "Removing from ring: " << segment << endl;
@ -353,6 +355,8 @@ namespace Kite {
ltrace(150) << "NegociateWindow::_negociate() - " << segments.size() << endl; ltrace(150) << "NegociateWindow::_negociate() - " << segments.size() << endl;
ltracein(149); ltracein(149);
unsigned long limit = _kite->getEventsLimit();
_eventHistory.clear(); _eventHistory.clear();
_eventQueue.load ( segments ); _eventQueue.load ( segments );
_loadRing (); _loadRing ();
@ -375,7 +379,7 @@ namespace Kite {
cmess2.flush(); cmess2.flush();
} }
if ( RoutingEvent::getProcesseds() >= /*10471*/ 4000000 ) setInterrupt ( true ); if ( RoutingEvent::getProcesseds() >= limit ) setInterrupt ( true );
count++; count++;
#if ENABLE_STIFFNESS #if ENABLE_STIFFNESS

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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
// //
// =================================================================== // ===================================================================
// //
@ -800,13 +800,14 @@ namespace {
public: public:
enum { ToRipupLimit=1, AllowExpand =2, NoExpand=4, PerpandicularsFirst=8, ToMoveUp=16 }; enum { ToRipupLimit=1, AllowExpand =2, NoExpand=4, PerpandicularsFirst=8, ToMoveUp=16 };
enum { LeftAxisHint=1, RightAxisHint=2 }; enum { LeftAxisHint=1, RightAxisHint=2 };
enum { NoRingLimit=1 };
public: public:
Manipulator ( TrackElement*, State& ); Manipulator ( TrackElement*, State& );
~Manipulator (); ~Manipulator ();
inline TrackElement* getSegment () const; inline TrackElement* getSegment () const;
inline DataNegociate* getData () const; inline DataNegociate* getData () const;
inline RoutingEvent* getEvent () const; inline RoutingEvent* getEvent () const;
bool canRipup () const; bool canRipup ( unsigned int flags=0 ) const;
bool isCaged ( DbU::Unit ) const; bool isCaged ( DbU::Unit ) const;
bool ripup ( Interval overlap bool ripup ( Interval overlap
, unsigned int type , unsigned int type
@ -1131,7 +1132,7 @@ namespace {
Interval constraints; Interval constraints;
vector<Cs1Candidate> candidates; vector<Cs1Candidate> candidates;
TrackElement* segment = _event->getSegment(); TrackElement* segment = _event->getSegment();
bool canMoveUp = (segment->isLocal()) ? segment->canPivotUp() : segment->canMoveUp(); bool canMoveUp = (segment->isLocal()) ? segment->canPivotUp(1.0) : segment->canMoveUp(1.0);
unsigned int relaxFlags unsigned int relaxFlags
= (_data and (_data->getStateCount() < 2)) ? Manipulator::AllowExpand : Manipulator::NoExpand; = (_data and (_data->getStateCount() < 2)) ? Manipulator::AllowExpand : Manipulator::NoExpand;
@ -1193,7 +1194,7 @@ namespace {
if ( other->isGlobal() if ( other->isGlobal()
and (other->getDataNegociate()->getGCellOrder() == Session::getOrder()) and (other->getDataNegociate()->getGCellOrder() == Session::getOrder())
and other->canMoveUp() ) { and other->canMoveUp(1.0) ) {
ltrace(200) << "conflictSolve1() - One conflict, other move up" << endl; ltrace(200) << "conflictSolve1() - One conflict, other move up" << endl;
if ( (success = other->moveUp()) ) break; if ( (success = other->moveUp()) ) break;
} }
@ -1371,7 +1372,8 @@ namespace {
bool blocked = false; bool blocked = false;
bool repush = true; bool repush = true;
DataNegociate* data = segment->getDataNegociate (); DataNegociate* data = segment->getDataNegociate ();
unsigned int nextState = 0; unsigned int nextState = data->getState();
unsigned int actionFlags = SegmentAction::SelfInsert|SegmentAction::EventLevel5;
ltrace(200) << "Slacken Topology for " << segment->getNet() ltrace(200) << "Slacken Topology for " << segment->getNet()
<< " " << segment << endl; << " " << segment << endl;
@ -1383,7 +1385,7 @@ namespace {
if ( not (data->isBorder() or data->isRing()) ) { if ( not (data->isBorder() or data->isRing()) ) {
data->resetRipupCount (); data->resetRipupCount ();
} else { } else {
if ( not Manipulator(segment,*this).canRipup() ) { if ( not Manipulator(segment,*this).canRipup(Manipulator::NoRingLimit) ) {
cerr << "[UNSOLVED] " << segment << " slacken topology not allowed for border/ring." << endl; cerr << "[UNSOLVED] " << segment << " slacken topology not allowed for border/ring." << endl;
ltraceout(200); ltraceout(200);
DebugSession::close (); DebugSession::close ();
@ -1394,7 +1396,7 @@ namespace {
// Ring cases. // Ring cases.
if ( data->isBorder() ) { if ( data->isBorder() ) {
ltrace(200) << "Segment is Ripup only (border), bypass to Unimplemented." << endl; ltrace(200) << "Segment is Ripup only (border), bypass to Unimplemented." << endl;
if ( not Manipulator(segment,*this).canRipup () ) { if ( not Manipulator(segment,*this).canRipup (Manipulator::NoRingLimit) ) {
ltrace(200) << "Cannot ripup, bypass to Unimplemented." << endl; ltrace(200) << "Cannot ripup, bypass to Unimplemented." << endl;
data->setState ( DataNegociate::Unimplemented ); data->setState ( DataNegociate::Unimplemented );
} else { } else {
@ -1421,6 +1423,7 @@ namespace {
// Normal cases. // Normal cases.
if ( not blocked and not success ) { if ( not blocked and not success ) {
if ( segment->isStrap() ) { if ( segment->isStrap() ) {
ltrace(200) << "Strap segment FSM." << endl;
switch ( data->getState() ) { switch ( data->getState() ) {
case DataNegociate::RipupPerpandiculars: case DataNegociate::RipupPerpandiculars:
nextState = DataNegociate::Desalignate; nextState = DataNegociate::Desalignate;
@ -1452,13 +1455,11 @@ namespace {
} }
if ( not success and (nextState != DataNegociate::Unimplemented) ) { if ( not success and (nextState != DataNegociate::Unimplemented) ) {
// if ( segment->canRipple() )
// success = Manipulator(segment,*this).ripple();
// else
success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit); success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit);
} }
} else if ( segment->isLocal() ) { } else if ( segment->isLocal() ) {
// Local TrackElement State Machine. // Local TrackElement State Machine.
ltrace(200) << "Local segment FSM." << endl;
switch ( data->getState() ) { switch ( data->getState() ) {
case DataNegociate::RipupPerpandiculars: case DataNegociate::RipupPerpandiculars:
nextState = DataNegociate::Desalignate; nextState = DataNegociate::Desalignate;
@ -1502,7 +1503,7 @@ namespace {
} }
case DataNegociate::MaximumSlack: case DataNegociate::MaximumSlack:
if ( segment->isSlackenStrap() ) { if ( segment->isSlackenStrap() ) {
if ( nextState < DataNegociate::MaximumSlack ) { if ( (nextState < DataNegociate::MaximumSlack) or (data->getStateCount() < 2) ) {
nextState = DataNegociate::MaximumSlack; nextState = DataNegociate::MaximumSlack;
success = conflictSolve1 (); success = conflictSolve1 ();
if ( success ) break; if ( success ) break;
@ -1514,9 +1515,7 @@ namespace {
} }
if ( not success and (nextState != DataNegociate::Unimplemented) ) { if ( not success and (nextState != DataNegociate::Unimplemented) ) {
// if ( segment->canRipple() ) if ( data->getStateCount() < 6 )
// success = Manipulator(segment,*this).ripple();
// else
success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit); success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit);
} }
@ -1560,6 +1559,7 @@ namespace {
} else { } else {
// Global TrackElement State Machine. // Global TrackElement State Machine.
switch ( data->getState() ) { switch ( data->getState() ) {
ltrace(200) << "Global segment FSM." << endl;
case DataNegociate::RipupPerpandiculars: case DataNegociate::RipupPerpandiculars:
ltrace(200) << "Global, State: RipupPerpandiculars." << endl; ltrace(200) << "Global, State: RipupPerpandiculars." << endl;
nextState = DataNegociate::Desalignate; nextState = DataNegociate::Desalignate;
@ -1603,6 +1603,7 @@ namespace {
} }
if ( not success and (nextState != DataNegociate::Unimplemented) ) { if ( not success and (nextState != DataNegociate::Unimplemented) ) {
if ( data->getStateCount() < 6 )
success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit); success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit);
} }
} }
@ -1612,11 +1613,10 @@ namespace {
if ( success ) { if ( success ) {
if ( repush ) { if ( repush ) {
unsigned int flags = SegmentAction::SelfInsert|SegmentAction::EventLevel5;
if ( not (data->isRing() or data->isBorder()) ) if ( not (data->isRing() or data->isBorder()) )
flags |= SegmentAction::ResetRipup; actionFlags |= SegmentAction::ResetRipup;
addAction ( segment, flags ); addAction ( segment, actionFlags );
} }
} else { } else {
clearActions (); clearActions ();
@ -1664,11 +1664,19 @@ namespace {
} }
bool Manipulator::canRipup () const bool Manipulator::canRipup ( unsigned int flags ) const
{ {
if ( _data ) { if ( _data ) {
if ( not _event or _event->isUnimplemented() ) return false;
unsigned int limit = Session::getKiteEngine()->getRipupLimit(_segment); unsigned int limit = Session::getKiteEngine()->getRipupLimit(_segment);
return (_data->getRipupCount() < limit) and _event and not _event->isUnimplemented();
if ( not ( flags & NoRingLimit )
and (_data->isRing() or _data->isBorder())
and not (_data->getRipupCount() < limit) )
return false;
return (_data->getRipupCount() < limit);
} }
return false; return false;
@ -1713,8 +1721,10 @@ namespace {
ltrace(200) << "TrackElement:" << _data->getGCellOrder() ltrace(200) << "TrackElement:" << _data->getGCellOrder()
<< " < Session:" << Session::getOrder() << endl; << " < Session:" << Session::getOrder() << endl;
if ( not canRipup() ) return false;
if ( _segment->isFixed() ) return false; if ( _segment->isFixed() ) return false;
if ( !_data ) return true; if ( _data == NULL ) return true;
if ( _segment->getTrack() ) { if ( _segment->getTrack() ) {
if ( _data->getGCellOrder() < Session::getOrder() ) { if ( _data->getGCellOrder() < Session::getOrder() ) {
@ -1764,6 +1774,8 @@ namespace {
} }
placedPerpandiculars++; placedPerpandiculars++;
// Try to ripup the perpandicular itself.
DataNegociate* data2 = perpandiculars[i]->getDataNegociate(); DataNegociate* data2 = perpandiculars[i]->getDataNegociate();
if ( data2->getGCellOrder() == Session::getOrder() ) { if ( data2->getGCellOrder() == Session::getOrder() ) {
ltrace(200) << "| " << perpandiculars[i] << endl; ltrace(200) << "| " << perpandiculars[i] << endl;
@ -1772,10 +1784,12 @@ namespace {
and (data2->getState() < DataNegociate::MoveUp) ) and (data2->getState() < DataNegociate::MoveUp) )
data2->setState ( DataNegociate::MoveUp ); data2->setState ( DataNegociate::MoveUp );
Manipulator(perpandiculars[i],_S).ripup ( _event->getSegment()->getAxis(), perpandicularActionFlags ); if ( Manipulator(perpandiculars[i],_S).ripup(_event->getSegment()->getAxis()
,perpandicularActionFlags) )
continue; continue;
} }
// Cannot ripup the perpandicular, try to ripup it's neigbors.
size_t begin; size_t begin;
size_t end; size_t end;
track->getOverlapBounds ( constraints, begin, end ); track->getOverlapBounds ( constraints, begin, end );
@ -1796,8 +1810,14 @@ namespace {
continue; continue;
} }
// Try to ripup conflicting neighbor.
if ( Manipulator(other,_S).canRipup() ) {
ltrace(200) << " | Ripup: " << begin << " " << other << endl; ltrace(200) << " | Ripup: " << begin << " " << other << endl;
_S.addAction ( other, SegmentAction::OtherRipup ); _S.addAction ( other, SegmentAction::OtherRipup );
} else {
ltrace(200) << "Aborted ripup of perpandiculars, blocked by border/ring." << endl;
return false;
}
} }
} }
@ -1808,7 +1828,7 @@ namespace {
} }
if ( _segment->isLocal() and not placedPerpandiculars ) { if ( _segment->isLocal() and not placedPerpandiculars ) {
ltrace(200) << "No placed perpandiculars, tight native constraints." << endl; ltrace(200) << "No placed perpandiculars, tight native constraints, place perpandiculars FIRST." << endl;
for ( size_t i=0 ; i < perpandiculars.size() ; i++ ) { for ( size_t i=0 ; i < perpandiculars.size() ; i++ ) {
_S.addAction ( perpandiculars[i], perpandicularActionFlags|SegmentAction::EventLevel4 ); _S.addAction ( perpandiculars[i], perpandicularActionFlags|SegmentAction::EventLevel4 );
} }
@ -1838,8 +1858,9 @@ namespace {
ltrace(200) << "Manipulator::relax() of: " << _segment << " " << interval << endl; ltrace(200) << "Manipulator::relax() of: " << _segment << " " << interval << endl;
if ( _segment->isFixed() ) return false; if ( _segment->isFixed() ) return false;
if ( !interval.intersect(_segment->getCanonicalInterval()) ) return false; if ( not interval.intersect(_segment->getCanonicalInterval()) ) return false;
if ( !_data ) return false; if ( not _data ) return false;
//if ( _data->isBorder() or _data->isRing() ) return false;
if ( _segment->isTerminal() if ( _segment->isTerminal()
and (_segment->getLayer() == Session::getRoutingGauge()->getRoutingLayer(1)) ) { and (_segment->getLayer() == Session::getRoutingGauge()->getRoutingLayer(1)) ) {
@ -2323,7 +2344,8 @@ namespace {
if ( not (shrinkLeft xor shrinkRight) ) { if ( not (shrinkLeft xor shrinkRight) ) {
ltrace(200) << "- Hard overlap/enclosure/shrink " << segment2 << endl; ltrace(200) << "- Hard overlap/enclosure/shrink " << segment2 << endl;
Manipulator(segment2,_S).ripup ( toFree, SegmentAction::OtherRipup ); if ( not (success = Manipulator(segment2,_S).ripup(toFree,SegmentAction::OtherRipup)) )
continue;
} }
canonicals.clear (); canonicals.clear ();
@ -2344,11 +2366,13 @@ namespace {
if ( shrinkRight xor shrinkLeft ) { if ( shrinkRight xor shrinkLeft ) {
if ( shrinkRight ) { if ( shrinkRight ) {
Manipulator(*isegment3,_S).ripup ( track->getAxis() if ( not (success=Manipulator(*isegment3,_S).ripup ( track->getAxis()
, SegmentAction::OtherPushAside , SegmentAction::OtherPushAside
| SegmentAction::AxisHint | SegmentAction::AxisHint
, toFree.getVMin() - DbU::lambda(1.0) , toFree.getVMin() - DbU::lambda(1.0)
); )) )
break;
if ( event3->getTracksFree() == 1 ) { if ( event3->getTracksFree() == 1 ) {
ltrace(200) << "Potential left intrication with other perpandicular." << endl; ltrace(200) << "Potential left intrication with other perpandicular." << endl;
if ( isegment3->getAxis() == segment2->getTargetU() - Session::getExtensionCap() ) { if ( isegment3->getAxis() == segment2->getTargetU() - Session::getExtensionCap() ) {
@ -2358,11 +2382,12 @@ namespace {
} }
} }
if ( shrinkLeft ) { if ( shrinkLeft ) {
Manipulator(*isegment3,_S).ripup ( track->getAxis() if ( not (success=Manipulator(*isegment3,_S).ripup ( track->getAxis()
, SegmentAction::OtherPushAside , SegmentAction::OtherPushAside
| SegmentAction::AxisHint | SegmentAction::AxisHint
, toFree.getVMax() + DbU::lambda(1.0) , toFree.getVMax() + DbU::lambda(1.0)
); )) )
break;
if ( event3->getTracksFree() == 1 ) { if ( event3->getTracksFree() == 1 ) {
ltrace(200) << "Potential right intrication with other perpandicular." << endl; ltrace(200) << "Potential right intrication with other perpandicular." << endl;
if ( isegment3->getAxis() == segment2->getSourceU() + Session::getExtensionCap() ) { if ( isegment3->getAxis() == segment2->getSourceU() + Session::getExtensionCap() ) {
@ -2375,14 +2400,15 @@ namespace {
// DbU::Unit axisHint // DbU::Unit axisHint
// = (event3->getAxisHint() - toFree.getVMin() < toFree.getVMax() - event3->getAxisHint()) // = (event3->getAxisHint() - toFree.getVMin() < toFree.getVMax() - event3->getAxisHint())
// ? (toFree.getVMin() - DbU::lambda(1.0)) : (toFree.getVMax() + DbU::lambda(1.0)); // ? (toFree.getVMin() - DbU::lambda(1.0)) : (toFree.getVMax() + DbU::lambda(1.0));
Manipulator(*isegment3,_S).ripup if ( not (success=Manipulator(*isegment3,_S).ripup ( track->getAxis()
( track->getAxis()
, SegmentAction::OtherRipup , SegmentAction::OtherRipup
| SegmentAction::EventLevel3 | SegmentAction::EventLevel3
//| SegmentAction::AxisHint, axisHint //| SegmentAction::AxisHint, axisHint
); )) )
break;
} }
} }
if ( not success ) break;
} }
} }
@ -2442,7 +2468,8 @@ namespace {
success = Manipulator(segment2,_S).relax ( toFree ); success = Manipulator(segment2,_S).relax ( toFree );
} else { } else {
ltrace(200) << "- Forced ripup " << segment2 << endl; ltrace(200) << "- Forced ripup " << segment2 << endl;
Manipulator(segment2,_S).ripup ( toFree, SegmentAction::OtherRipup ); if ( not (success=Manipulator(segment2,_S).ripup(toFree,SegmentAction::OtherRipup)) )
continue;
canonicals.clear (); canonicals.clear ();
forEach ( TrackElement*, isegment3 forEach ( TrackElement*, isegment3
@ -2453,6 +2480,7 @@ namespace {
RoutingEvent* event3 = data3->getRoutingEvent(); RoutingEvent* event3 = data3->getRoutingEvent();
if ( !event3 ) continue; if ( !event3 ) continue;
if ( Manipulator(*isegment3,_S).canRipup() )
_S.addAction ( *isegment3, SegmentAction::OtherRipup ); _S.addAction ( *isegment3, SegmentAction::OtherRipup );
} }
} }
@ -2670,7 +2698,7 @@ namespace {
ltrace(200) << "Manipulator::pivotUp() " << _segment << endl; ltrace(200) << "Manipulator::pivotUp() " << _segment << endl;
if ( _segment->isFixed () ) return false; if ( _segment->isFixed () ) return false;
if ( not _segment->canMoveUp() ) return false; if ( not _segment->canMoveUp(0.0) ) return false;
_segment->moveUp (); _segment->moveUp ();
return true; return true;
@ -2682,8 +2710,8 @@ namespace {
ltrace(200) << "Manipulator::moveUp() " << _segment << endl; ltrace(200) << "Manipulator::moveUp() " << _segment << endl;
if ( _segment->isFixed () ) return false; if ( _segment->isFixed () ) return false;
if ( _segment->isLocal() and not _segment->canPivotUp() ) return false; if ( _segment->isLocal() and not _segment->canPivotUp(0.0) ) return false;
if ( not _segment->canMoveUp() ) return false; if ( not _segment->canMoveUp(0.5) ) return false;
#if DISABLED #if DISABLED
ltrace(200) << "| Repack Tracks: " << endl; ltrace(200) << "| Repack Tracks: " << endl;
@ -3306,7 +3334,8 @@ namespace Kite {
if ( not isProcessed() ) { if ( not isProcessed() ) {
fork = this; fork = this;
ltrace(200) << "Reschedule/Self: " ltrace(200) << "Reschedule/Self: "
<< (void*)this << " -> " << (void*)fork << ":" << fork << endl; << (void*)this << " -> "
<< (void*)fork << ":" << eventLevel << ":" << fork << endl;
} else { } else {
fork = clone(); fork = clone();
fork->_processed = false; fork->_processed = false;

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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
// //
// =================================================================== // ===================================================================
// //
@ -176,8 +176,8 @@ namespace Kite {
bool TrackElement::canDesalignate () const { return false; } bool TrackElement::canDesalignate () const { return false; }
bool TrackElement::canPivotUp () const { return false; }; bool TrackElement::canPivotUp ( float ) const { return false; };
bool TrackElement::canMoveUp () const { return false; }; bool TrackElement::canMoveUp ( float ) const { return false; };
bool TrackElement::canDogLeg () { return false; }; bool TrackElement::canDogLeg () { return false; };
bool TrackElement::canDogLeg ( Interval ) { return false; }; bool TrackElement::canDogLeg ( Interval ) { return false; };
bool TrackElement::canDogLegAt ( GCell*, bool allowReuse ) { return false; }; bool TrackElement::canDogLegAt ( GCell*, bool allowReuse ) { return false; };

View File

@ -89,12 +89,15 @@ namespace Kite {
if ( layer2 ) { if ( layer2 ) {
DbU::Unit extention = layer2->getExtentionCap(); DbU::Unit extention = layer2->getExtentionCap();
if ( track->getDirection() == Constant::Horizontal ) { if ( track->getDirection() == Constant::Horizontal ) {
_sourceU = boundingBox.getXMin()-extention; Interval uside = track->getKiteEngine()->getGCellGrid()->getUSide ( Constant::Horizontal );
_targetU = boundingBox.getXMax()+extention;
_sourceU = max ( boundingBox.getXMin()-extention, uside.getVMin());
_targetU = min ( boundingBox.getXMax()+extention, uside.getVMax());
GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_sourceU,track->getAxis()) ); GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_sourceU,track->getAxis()) );
GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_targetU,track->getAxis()) ); GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_targetU,track->getAxis()) );
GCell* right = NULL; GCell* right = NULL;
if ( gcell ) { if ( gcell ) {
while ( gcell and (gcell != end) ) { while ( gcell and (gcell != end) ) {
right = gcell->getRight(); right = gcell->getRight();
@ -106,8 +109,10 @@ namespace Kite {
} else } else
cerr << Warning("TrackFixedSegment(): TrackFixedElement outside GCell grid.") << endl; cerr << Warning("TrackFixedSegment(): TrackFixedElement outside GCell grid.") << endl;
} else { } else {
_sourceU = boundingBox.getYMin()-extention; Interval uside = track->getKiteEngine()->getGCellGrid()->getUSide ( Constant::Vertical );
_targetU = boundingBox.getYMax()+extention;
_sourceU = max ( boundingBox.getYMin()-extention, uside.getVMin());
_targetU = min ( boundingBox.getYMax()+extention, uside.getVMax());
GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_sourceU) ); GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_sourceU) );
GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_targetU) ); GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_targetU) );

View File

@ -609,19 +609,19 @@ namespace Kite {
} }
bool TrackSegment::canPivotUp () const bool TrackSegment::canPivotUp ( float reserve ) const
{ {
return _base->canPivotUp(); return _base->canPivotUp(reserve);
} }
bool TrackSegment::canMoveUp () const bool TrackSegment::canMoveUp ( float reserve ) const
{ {
// if ( isLocal() /*and (hasSourceDogLeg() or hasTargetDogLeg())*/ ) { // if ( isLocal() /*and (hasSourceDogLeg() or hasTargetDogLeg())*/ ) {
// return _base->canPivotUp(); // return _base->canPivotUp();
// } // }
return _base->canMoveUp ( true ); return _base->canMoveUp ( true, reserve );
} }
@ -645,8 +645,11 @@ namespace Kite {
vector<TrackElement*> segments; vector<TrackElement*> segments;
for ( size_t i=0 ; i<invalidateds.size() ; i++ ) { for ( size_t i=0 ; i<invalidateds.size() ; i++ ) {
ltrace(200) << "moved: " << invalidateds[i] << endl; ltrace(200) << "moved: " << invalidateds[i] << endl;
segments.push_back ( GCell::addTrackSegment(NULL,invalidateds[i],false) ); TrackElement* segment = GCell::addTrackSegment(NULL,invalidateds[i],false);
segments.back()->reschedule ( 0 ); segments.push_back ( segment );
// if ( (segment->getTrack() == NULL)
// or (segment->getLayer() != segment->getTrack()->getLayer()) )
segment->reschedule ( 0 );
} }
for ( size_t i=0 ; i<segments.size() ; i++ ) { for ( size_t i=0 ; i<segments.size() ; i++ ) {
@ -1198,11 +1201,13 @@ namespace Kite {
+ " " + getString(_dogLegLevel) + " " + getString(_dogLegLevel)
+ " o:" + getString(_data->getGCellOrder()) + " o:" + getString(_data->getGCellOrder())
+ " [" + ((_track) ? getString(_index) : "npos") + "] " + " [" + ((_track) ? getString(_index) : "npos") + "] "
+ ((isSlackened()) ? "S" : "-") + ((isSlackened() ) ? "S" : "-")
+ ((_track ) ? "T" : "-") + ((_track ) ? "T" : "-")
+ ((_canRipple ) ? "r" : "-") + ((_canRipple ) ? "r" : "-")
+ ((_sourceDogLeg) ? "s" : "-") + ((_data->isBorder()) ? "B" : "-")
+ ((_targetDogLeg) ? "t" : "-"); + ((_data->isRing ()) ? "R" : "-")
+ ((_sourceDogLeg ) ? "s" : "-")
+ ((_targetDogLeg ) ? "t" : "-");
s1.insert ( s1.size()-1, s2 ); s1.insert ( s1.size()-1, s2 );

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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
// //
// =================================================================== // ===================================================================
// //
@ -78,10 +78,12 @@ namespace Kite {
// Methods. // Methods.
inline Katabatic::Configuration* base (); inline Katabatic::Configuration* base ();
inline PostEventCb_t& getPostEventCb (); inline PostEventCb_t& getPostEventCb ();
inline unsigned long getEventsLimit () const;
inline float getExpandStep () const; inline float getExpandStep () const;
inline unsigned int getRipupCost () const; inline unsigned int getRipupCost () const;
unsigned int getRipupLimit ( unsigned int type ) const; unsigned int getRipupLimit ( unsigned int type ) const;
inline float getEdgeCapacityPercent () const; inline float getEdgeCapacityPercent () const;
inline void setEventsLimit ( unsigned long );
inline void setExpandStep ( float ); inline void setExpandStep ( float );
inline void setRipupCost ( unsigned int ); inline void setRipupCost ( unsigned int );
void setRipupLimit ( unsigned int type, unsigned int limit ); void setRipupLimit ( unsigned int type, unsigned int limit );
@ -101,6 +103,7 @@ namespace Kite {
float _expandStep; float _expandStep;
unsigned int _ripupLimits[RipupLimitsTableSize]; unsigned int _ripupLimits[RipupLimitsTableSize];
unsigned int _ripupCost; unsigned int _ripupCost;
unsigned long _eventsLimit;
private: private:
Configuration ( const Configuration& ); Configuration ( const Configuration& );
Configuration& operator= ( const Configuration& ); Configuration& operator= ( const Configuration& );
@ -110,12 +113,14 @@ namespace Kite {
// Inline Functions. // Inline Functions.
inline Katabatic::Configuration* Configuration::base () { return _base; } inline Katabatic::Configuration* Configuration::base () { return _base; }
inline Configuration::PostEventCb_t& Configuration::getPostEventCb () { return _postEventCb; } inline Configuration::PostEventCb_t& Configuration::getPostEventCb () { return _postEventCb; }
inline unsigned long Configuration::getEventsLimit () const { return _eventsLimit; }
inline unsigned int Configuration::getRipupCost () const { return _ripupCost; } inline unsigned int Configuration::getRipupCost () const { return _ripupCost; }
inline float Configuration::getExpandStep () const { return _expandStep; } inline float Configuration::getExpandStep () const { return _expandStep; }
inline float Configuration::getEdgeCapacityPercent () const { return _edgeCapacityPercent; } inline float Configuration::getEdgeCapacityPercent () const { return _edgeCapacityPercent; }
inline void Configuration::setRipupCost ( unsigned int cost ) { _ripupCost = cost; } inline void Configuration::setRipupCost ( unsigned int cost ) { _ripupCost = cost; }
inline void Configuration::setExpandStep ( float step ) { _expandStep = step; } inline void Configuration::setExpandStep ( float step ) { _expandStep = step; }
inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; } inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; }
inline void Configuration::setEventsLimit ( unsigned long limit ) { _eventsLimit = limit; }
inline void Configuration::setEdgeCapacityPercent ( float percent ) { _edgeCapacityPercent = percent; } inline void Configuration::setEdgeCapacityPercent ( float percent ) { _edgeCapacityPercent = percent; }

View File

@ -105,6 +105,7 @@ namespace Kite {
inline void incRipupCount (); inline void incRipupCount ();
inline void decRipupCount (); inline void decRipupCount ();
inline void resetRipupCount (); inline void resetRipupCount ();
inline void resetStateCount ();
inline void invalidate ( bool withPerpandiculars=false, bool withConstraints=false ); inline void invalidate ( bool withPerpandiculars=false, bool withConstraints=false );
void update (); void update ();
static string getStateString ( DataNegociate* ); static string getStateString ( DataNegociate* );
@ -156,6 +157,7 @@ namespace Kite {
inline void DataNegociate::incRipupCount () { _cost.incRipupCount(); } inline void DataNegociate::incRipupCount () { _cost.incRipupCount(); }
inline void DataNegociate::decRipupCount () { _cost.decRipupCount(); } inline void DataNegociate::decRipupCount () { _cost.decRipupCount(); }
inline void DataNegociate::resetRipupCount () { _cost.resetRipupCount(); } inline void DataNegociate::resetRipupCount () { _cost.resetRipupCount(); }
inline void DataNegociate::resetStateCount () { _stateCount=0; }
inline string DataNegociate::_getTypeName () const { return "DataNegociate"; } inline string DataNegociate::_getTypeName () const { return "DataNegociate"; }
inline void DataNegociate::invalidate ( bool withPerpandiculars, bool withConstraints ) inline void DataNegociate::invalidate ( bool withPerpandiculars, bool withConstraints )

View File

@ -54,6 +54,7 @@ namespace Kite {
inline Katabatic::GCellGrid* base (); inline Katabatic::GCellGrid* base ();
inline KiteEngine* getKite (); inline KiteEngine* getKite ();
Cell* getCell () const; Cell* getCell () const;
inline Interval getUSide ( unsigned int ) const;
inline bool checkEdgeSaturation ( float threshold ) const; inline bool checkEdgeSaturation ( float threshold ) const;
void updateContacts ( bool openSession=true ); void updateContacts ( bool openSession=true );
void updateDensity (); void updateDensity ();
@ -82,6 +83,9 @@ namespace Kite {
inline Katabatic::GCellGrid* GCellGrid::base () { return _kite->base()->getGCellGrid(); } inline Katabatic::GCellGrid* GCellGrid::base () { return _kite->base()->getGCellGrid(); }
inline KiteEngine* GCellGrid::getKite () { return _kite; }; inline KiteEngine* GCellGrid::getKite () { return _kite; };
inline Interval GCellGrid::getUSide ( unsigned int dir ) const
{ return const_cast<GCellGrid*>(this)->base()->getUSide(dir); }
inline bool GCellGrid::checkEdgeSaturation ( float threshold ) const inline bool GCellGrid::checkEdgeSaturation ( float threshold ) const
{ return const_cast<GCellGrid*>(this)->base()->checkEdgeSaturation(threshold); } { return const_cast<GCellGrid*>(this)->base()->checkEdgeSaturation(threshold); }

View File

@ -86,6 +86,7 @@ namespace Kite {
inline Net* getBlockageNet (); inline Net* getBlockageNet ();
virtual Configuration* getConfiguration (); virtual Configuration* getConfiguration ();
inline bool getToolSuccess () const; inline bool getToolSuccess () const;
inline unsigned long getEventsLimit () const;
inline unsigned int getRipupLimit ( unsigned int type ) const; inline unsigned int getRipupLimit ( unsigned int type ) const;
unsigned int getRipupLimit ( const TrackElement* ) const; unsigned int getRipupLimit ( const TrackElement* ) const;
inline unsigned int getRipupCost () const; inline unsigned int getRipupCost () const;
@ -104,6 +105,7 @@ namespace Kite {
void dumpMeasures ( std::ostream& ) const; void dumpMeasures ( std::ostream& ) const;
void dumpMeasures () const; void dumpMeasures () const;
inline void setPostEventCb ( Configuration::PostEventCb_t ); inline void setPostEventCb ( Configuration::PostEventCb_t );
inline void setEventLimit ( unsigned long );
inline void setMinimumWL ( double ); inline void setMinimumWL ( double );
inline void setRipupLimit ( unsigned int, unsigned int type ); inline void setRipupLimit ( unsigned int, unsigned int type );
inline void setRipupCost ( unsigned int ); inline void setRipupCost ( unsigned int );
@ -167,6 +169,7 @@ namespace Kite {
inline Net* KiteEngine::getBlockageNet () { return _obstacleNet; } inline Net* KiteEngine::getBlockageNet () { return _obstacleNet; }
inline Configuration::PostEventCb_t& KiteEngine::getPostEventCb () { return _configuration.getPostEventCb(); } inline Configuration::PostEventCb_t& KiteEngine::getPostEventCb () { return _configuration.getPostEventCb(); }
inline bool KiteEngine::getToolSuccess () const { return _toolSuccess; } inline bool KiteEngine::getToolSuccess () const { return _toolSuccess; }
inline unsigned long KiteEngine::getEventsLimit () const { return _configuration.getEventsLimit(); }
inline unsigned int KiteEngine::getRipupCost () const { return _configuration.getRipupCost(); } inline unsigned int KiteEngine::getRipupCost () const { return _configuration.getRipupCost(); }
inline float KiteEngine::getExpandStep () const { return _configuration.getExpandStep(); } inline float KiteEngine::getExpandStep () const { return _configuration.getExpandStep(); }
inline float KiteEngine::getEdgeCapacityPercent () const { return _configuration.getEdgeCapacityPercent(); } inline float KiteEngine::getEdgeCapacityPercent () const { return _configuration.getEdgeCapacityPercent(); }
@ -174,6 +177,7 @@ namespace Kite {
inline GCellGrid* KiteEngine::getGCellGrid () const { return _kiteGrid; } inline GCellGrid* KiteEngine::getGCellGrid () const { return _kiteGrid; }
inline NegociateWindow* KiteEngine::getNegociateWindow () { return _negociateWindow; } inline NegociateWindow* KiteEngine::getNegociateWindow () { return _negociateWindow; }
inline size_t KiteEngine::getRoutingPlanesSize () const { return _routingPlanes.size(); } inline size_t KiteEngine::getRoutingPlanesSize () const { return _routingPlanes.size(); }
inline void KiteEngine::setEventLimit ( unsigned long limit ) { _configuration.setEventsLimit(limit); }
inline void KiteEngine::setRipupLimit ( unsigned int limit, unsigned int type ) { _configuration.setRipupLimit(limit,type); } inline void KiteEngine::setRipupLimit ( unsigned int limit, unsigned int type ) { _configuration.setRipupLimit(limit,type); }
inline void KiteEngine::setRipupCost ( unsigned int cost ) { _configuration.setRipupCost(cost); } inline void KiteEngine::setRipupCost ( unsigned int cost ) { _configuration.setRipupCost(cost); }
inline void KiteEngine::setExpandStep ( float step ) { _configuration.setExpandStep(step); } inline void KiteEngine::setExpandStep ( float step ) { _configuration.setExpandStep(step); }

View File

@ -3,7 +3,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // 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
// //
// =================================================================== // ===================================================================
// //
@ -115,8 +115,8 @@ namespace Kite {
virtual bool canDesalignate () const; virtual bool canDesalignate () const;
virtual bool canGoOutsideGCell () const; virtual bool canGoOutsideGCell () const;
virtual bool canSlacken () const; virtual bool canSlacken () const;
virtual bool canPivotUp () const; virtual bool canPivotUp ( float reserve ) const;
virtual bool canMoveUp () const; virtual bool canMoveUp ( float reserve ) const;
virtual bool canRipple () const; virtual bool canRipple () const;
virtual bool hasSourceDogLeg () const; virtual bool hasSourceDogLeg () const;
virtual bool hasTargetDogLeg () const; virtual bool hasTargetDogLeg () const;

View File

@ -78,8 +78,8 @@ namespace Kite {
virtual bool canDesalignate () const; virtual bool canDesalignate () const;
virtual bool canGoOutsideGCell () const; virtual bool canGoOutsideGCell () const;
virtual bool canSlacken () const; virtual bool canSlacken () const;
virtual bool canPivotUp () const; virtual bool canPivotUp ( float reserve ) const;
virtual bool canMoveUp () const; virtual bool canMoveUp ( float reserve ) const;
virtual bool canRipple () const; virtual bool canRipple () const;
virtual bool hasSourceDogLeg () const; virtual bool hasSourceDogLeg () const;
virtual bool hasTargetDogLeg () const; virtual bool hasTargetDogLeg () const;