Merge branch 'devel_anabatic' of ssh://bop.soc.lip6.fr/users/largo2/git/coriolis into devel_anabatic

This commit is contained in:
EricLaoGitHub 2016-09-20 11:34:09 +02:00
commit 6e4bfc4952
23 changed files with 200 additions and 162 deletions

View File

@ -183,35 +183,21 @@ namespace Anabatic {
{ return NULL; }
unsigned int AutoContact::getMinDepth () const
void AutoContact::getDepthSpan ( size_t& minDepth, size_t& maxDepth ) const
{
size_t minDepth = (size_t)-1;
minDepth = (size_t)-1;
maxDepth = 0;
Component* anchor = getAnchor ();
if (anchor) {
minDepth = std::min( minDepth, Session::getRoutingGauge()->getLayerDepth(anchor->getLayer()) );
}
for ( AutoSegment* segment : const_cast<AutoContact*>(this)->getAutoSegments() ) {
minDepth = std::min( minDepth, Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) );
}
return (unsigned int)minDepth;
}
unsigned int AutoContact::getMaxDepth () const
{
size_t maxDepth = 0;
Component* anchor = getAnchor ();
if ( anchor ) {
maxDepth = std::max( maxDepth, Session::getRoutingGauge()->getLayerDepth(anchor->getLayer()) );
}
for ( AutoSegment* segment : const_cast<AutoContact*>(this)->getAutoSegments() ) {
minDepth = std::min( minDepth, Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) );
maxDepth = std::max( maxDepth, Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) );
}
return (unsigned int)maxDepth;
}

View File

@ -323,17 +323,18 @@ namespace Anabatic {
, _parent (NULL)
, _observers ()
{
AutoContact* source = Session::lookup(dynamic_cast<Contact*>(segment->getSource()));
AutoContact* target = Session::lookup(dynamic_cast<Contact*>(segment->getTarget()));
_allocateds++;
if (dynamic_cast<Horizontal*>(segment)) setFlags( SegHorizontal );
if (source->isTerminal()) setFlags( SegSourceTerminal );
if (target->isTerminal()) setFlags( SegTargetTerminal );
_globalsCount += isGlobal() ? 1 : 0;
AutoContact* source = Session::lookup(dynamic_cast<Contact*>(segment->getSource()));
AutoContact* target = Session::lookup(dynamic_cast<Contact*>(segment->getTarget()));
if (source->isTerminal()) setFlags( SegSourceTerminal );
if (target->isTerminal()) setFlags( SegTargetTerminal );
source->invalidate( Flags::Topology );
}
@ -862,18 +863,16 @@ namespace Anabatic {
AutoContact* source = getAutoSource();
AutoContact* target = getAutoTarget();
cdebug_log(145,0) << "computeTerminal() S:" << source->isTerminal()
<< " T:" << target->isTerminal()
<< " " << this << endl;
if (source->isTerminal()) {
unsetFlags( SegWeakTerminal );
setFlags ( SegSourceTerminal );
if (not target->isTerminal())
target->setFlags( CntWeakTerminal );
} else if (target->isTerminal()) {
unsetFlags( SegWeakTerminal );
setFlags ( SegTargetTerminal );
if (not source->isTerminal())
source->setFlags( CntWeakTerminal );
} else {
@ -896,6 +895,10 @@ namespace Anabatic {
unsetFlags( SegWeakTerminal );
setFlags ( terminalFlag );
}
cdebug_log(145,0) << "computeTerminal() S:" << source->isTerminal()
<< " T:" << target->isTerminal()
<< " " << this << endl;
}
@ -1400,7 +1403,8 @@ namespace Anabatic {
<< " (reserve:" << reserve << ")" << endl;
if ( isLayerChange() or isFixed() ) return false;
if ( isStrongTerminal() or isLocal() ) return false;
if ( isStrongTerminal() and (not (flags & Flags::AllowTerminal)) ) return false;
if ( isLocal() and (not (flags & Flags::AllowLocal )) ) return false;
size_t depth = Session::getRoutingGauge()->getLayerDepth( getLayer() );
if (depth+2 >= Session::getRoutingGauge()->getDepth()) return false;
@ -1491,12 +1495,11 @@ namespace Anabatic {
bool AutoSegment::canMoveUp ( float reserve, unsigned int flags ) const
{
cdebug_log(149,0) << "AutoSegment::canMoveUp() " << flags
<< " (reserve:" << reserve << ")" << endl;
cdebug_log(159,0) << "AutoSegment::canMoveUp() " << flags
<< " (reserve:" << reserve << ") " << this << endl;
bool lowDensity = true;
GCell* begin = NULL;
GCell* end = NULL;
bool nLowDensity = true;
bool nLowUpDensity = true;
if ( isLayerChange() or isFixed() ) return false;
if ( isStrongTerminal() and (not (flags & Flags::AllowTerminal)) ) return false;
@ -1507,63 +1510,77 @@ namespace Anabatic {
vector<GCell*> gcells;
getGCells( gcells );
begin = *gcells.begin ();
end = *gcells.rbegin();
for ( size_t i=0 ; i<gcells.size() ; i++ ) {
if ( lowDensity and (gcells[i]->getWDensity(depth-2) > 0.5) ) lowDensity = false;
if ( nLowDensity and (gcells[i]->getWDensity(depth-2) > 0.5) ) nLowDensity = false;
if ( nLowUpDensity and (gcells[i]->getWDensity(depth) > 0.2) ) nLowUpDensity = false;
if (not gcells[i]->hasFreeTrack(depth,reserve)) {
cdebug_log(149,0) << "Not enough free track in " << gcells[i] << endl;
cdebug_log(159,0) << "Not enough free track in " << gcells[i] << endl;
return false;
}
}
cdebug_log(149,0) << "Enough free track under canonical segment." << endl;
cdebug_log(159,0) << "Enough free track under canonical segment." << endl;
if (not (flags & Flags::IgnoreContacts)) {
if (getAutoSource()->getMinDepth() < depth-2) return false;
if (getAutoTarget()->getMinDepth() < depth-2) return false;
}
if ( isLocal() and not (flags & Flags::Propagate) ) {
if (not getAutoSource()->canMoveUp(this)) return false;
if (not getAutoTarget()->canMoveUp(this)) return false;
return true;
}
cdebug_log(159,0) << "Both source & target Contacts can move up." << endl;
//bool hasGlobalSegment = false;
if ((flags & Flags::Propagate) and not isNotAligned()) {
forEach ( AutoSegment*, isegment, const_cast<AutoSegment*>(this)->getAligneds(flags) ) {
if (isegment->isFixed ()) return false;
//if (isegment->isGlobal()) hasGlobalSegment = true;
for ( AutoSegment* segment : const_cast<AutoSegment*>(this)->getAligneds(flags) ) {
if (segment->isFixed ()) return false;
//if (segment->isGlobal()) hasGlobalSegment = true;
isegment->getGCells( gcells );
//if ( (*gcells.begin ())->getIndex() < begin->getIndex() ) begin = *gcells.begin ();
//if ( (*gcells.rbegin())->getIndex() > end ->getIndex() ) end = *gcells.rbegin();
if (not (flags & Flags::IgnoreContacts)) {
if (segment->getAutoSource()->getMinDepth() < depth-2) return false;
if (segment->getAutoTarget()->getMinDepth() < depth-2) return false;
}
segment->getGCells( gcells );
for ( size_t i=0 ; i<gcells.size() ; i++ ) {
if ( lowDensity and (gcells[i]->getWDensity(depth-2) > 0.6) ) lowDensity = false;
if ( nLowDensity and (gcells[i]->getWDensity(depth-2) > 0.6) ) nLowDensity = false;
if ( nLowUpDensity and (gcells[i]->getWDensity(depth) > 0.2) ) {
cdebug_log(159,0) << "lowUpDensity false in " << gcells[i]
<< "d:" << gcells[i]->getWDensity(depth) << endl;
nLowUpDensity = false;
}
if (not gcells[i]->hasFreeTrack(depth,reserve)) {
cdebug_log(149,0) << "Not enough free track in " << gcells[i] << endl;
cdebug_log(159,0) << "Not enough free track in " << gcells[i] << endl;
return false;
}
}
}
}
if (lowDensity and (flags & Flags::CheckLowDensity)) return false;
if ( nLowDensity and (flags & Flags::CheckLowDensity )) return false;
if (not nLowUpDensity and (flags & Flags::CheckLowUpDensity)) return false;
if ( (depth >= 4) and (flags & Flags::WithPerpands) ) {
float fragmentation = begin->getFragmentation( depth-1 );
cdebug_log(149,0) << "Check begin GCell perpandicular fragmentation: " << fragmentation << endl;
float fragmentation = (*gcells.begin())->getFragmentation( depth-1 );
cdebug_log(159,0) << "Check begin GCell perpandicular fragmentation: " << fragmentation << endl;
if (fragmentation < 0.5) {
cdebug_log(149,0) << "Not enough free track for perpandicular in begin GCell "
cdebug_log(159,0) << "Not enough free track for perpandicular in begin GCell "
<< "(frag:" << fragmentation << ")."
<< endl;
return false;
}
fragmentation = end->getFragmentation( depth-1 );
cdebug_log(149,0) << "Check end GCell perpandicular fragmentation: " << fragmentation << endl;
fragmentation = (*gcells.rbegin())->getFragmentation( depth-1 );
cdebug_log(159,0) << "Check end GCell perpandicular fragmentation: " << fragmentation << endl;
if (fragmentation < 0.5) {
cdebug_log(149,0) << "Not enough free track for perpandicular in end GCell "
cdebug_log(159,0) << "Not enough free track for perpandicular in end GCell "
<< "(frag:" << fragmentation << ")."
<< endl;
return false;

View File

@ -82,7 +82,8 @@ namespace Anabatic {
const unsigned int Flags::NoGCellShrink = (1 << 27);
const unsigned int Flags::CParanoid = (1 << 28);
const unsigned int Flags::CheckLowDensity = (1 << 29);
const unsigned int Flags::NoUpdate = (1 << 30);
const unsigned int Flags::CheckLowUpDensity = (1 << 30);
const unsigned int Flags::NoUpdate = (1 << 31);
Flags::~Flags ()

View File

@ -125,8 +125,9 @@ namespace Anabatic {
virtual AutoSegment* getOpposite ( const AutoSegment* ) const = 0;
virtual AutoSegment* getPerpandicular ( const AutoSegment* ) const = 0;
virtual AutoSegment* getSegment ( unsigned int ) const = 0;
unsigned int getMinDepth () const;
unsigned int getMaxDepth () const;
void getDepthSpan ( size_t& minDepth, size_t& maxDepth ) const;
inline unsigned int getMinDepth () const;
inline unsigned int getMaxDepth () const;
void getLengths ( DbU::Unit* lengths, AutoSegment::DepthLengthSet& );
virtual Box getNativeConstraintBox () const;
Interval getNativeUConstraints ( unsigned int direction ) const;
@ -266,6 +267,12 @@ namespace Anabatic {
inline DbU::Unit AutoContact::getCBYMax () const
{ return isFixed() ? _contact->getY() : DbU::fromLambda(_dyMax) + _gcell->getYMin(); }
inline unsigned int AutoContact::getMinDepth () const
{ size_t minDepth, maxDepth; getDepthSpan(minDepth,maxDepth); return minDepth; }
inline unsigned int AutoContact::getMaxDepth () const
{ size_t minDepth, maxDepth; getDepthSpan(minDepth,maxDepth); return maxDepth; }
// -------------------------------------------------------------------
// Class : "Anabatic::LocatorHelper".

View File

@ -84,6 +84,7 @@ namespace Anabatic {
static const unsigned int NoGCellShrink ;
static const unsigned int CParanoid ;
static const unsigned int CheckLowDensity ;
static const unsigned int CheckLowUpDensity ;
static const unsigned int NoUpdate ;
public:
inline Flags ( unsigned int flags = NoFlags );

View File

@ -64,7 +64,7 @@ namespace Anabatic {
//inline Vertex ( size_t id );
inline ~Vertex ();
inline bool hasDoneAllRps () const;
inline Contact* hasGContact ( Net* );
inline Contact* hasGContact ( Net* ) const;
inline unsigned int getId () const;
inline GCell* getGCell () const;
inline AnabaticEngine* getAnabatic () const;
@ -149,7 +149,7 @@ namespace Anabatic {
inline Vertex::~Vertex () { _gcell->setObserver( GCell::Observable::Vertex, NULL ); }
inline Contact* Vertex::hasGContact ( Net* net ) { return _gcell->hasGContact(net); }
inline Contact* Vertex::hasGContact ( Net* net ) const { return _gcell->hasGContact(net); }
inline unsigned int Vertex::getId () const { return _id; }
inline GCell* Vertex::getGCell () const { return _gcell; }
inline AnabaticEngine* Vertex::getAnabatic () const { return _gcell->getAnabatic(); }

View File

@ -1317,7 +1317,7 @@ namespace Katabatic {
ostringstream s;
const Layer* layer = rg->getRoutingLayer(depth)->getBlockageLayer();
s << "_blockages[" << depth << ":" << ((layer) ? layer->getName() : "None") << "]";
record->add ( getSlot ( s.str(), &_blockages[depth] ) );
record->add ( DbU::getValueSlot ( s.str(), &_blockages[depth] ) );
}
for ( size_t depth=0 ; depth<_depth ; ++depth ) {

View File

@ -28,6 +28,7 @@ namespace {
using std::left;
using std::right;
using Hurricane::DbU;
using Hurricane::Net;
using Anabatic::Edge;
using Anabatic::Vertex;
@ -35,16 +36,19 @@ namespace {
class DigitalDistance {
public:
inline DigitalDistance ( float h, float k );
inline void setNet ( Net* );
DbU::Unit operator() ( const Vertex* source ,const Vertex* target,const Edge* edge ) const;
private:
// For an explanation of h & k parameters, see:
// "KNIK, routeur global pour la plateforme Coriolis", p. 52.
float _h;
float _k;
Net* _net;
};
inline DigitalDistance::DigitalDistance ( float h, float k ) : _h(h), _k(k) { }
inline DigitalDistance::DigitalDistance ( float h, float k ) : _h(h), _k(k), _net(NULL) { }
inline void DigitalDistance::setNet ( Net* net ) { _net = net; }
DbU::Unit DigitalDistance::operator() ( const Vertex* source ,const Vertex* target,const Edge* edge ) const
@ -54,8 +58,15 @@ namespace {
float congestion = (float)edge->getRealOccupancy() / (float)edge->getCapacity();
float congestionCost = 1.0 + _h / (1.0 + std::exp(_k * (congestion - 1.0)));
float viaCost = 0.0;
if ( source->getFrom()
and (source->getFrom()->isHorizontal() xor edge->isHorizontal())
and not source->hasGContact(_net) ) {
viaCost += 2.5;
}
float distance = (float)source->getDistance()
+ congestionCost * (float)edge->getDistance();
+ (congestionCost + viaCost) * (float)edge->getDistance()
+ edge->getHistoricCost();
// Edge* sourceFrom = source->getFrom();
@ -156,8 +167,9 @@ namespace Katana {
openSession();
Dijkstra* dijkstra = new Dijkstra ( this );
dijkstra->setDistance( DigitalDistance( getConfiguration()->getEdgeCostH()
, getConfiguration()->getEdgeCostK() ) );
DigitalDistance distance ( getConfiguration()->getEdgeCostH()
, getConfiguration()->getEdgeCostK() );
dijkstra->setDistance( distance );
size_t iteration = 0;
size_t netCount = 0;
@ -168,6 +180,7 @@ namespace Katana {
for ( NetData* netData : getNetOrdering() ) {
if (netData->isGlobalRouted()) continue;
distance.setNet( netData->getNet() );
dijkstra->load( netData->getNet() );
dijkstra->run();
++netCount;

View File

@ -95,7 +95,7 @@ namespace Katana {
if (not _segment)
throw Error( "Manipulator::Manipulator(): cannot build upon a NULL TrackElement." );
DebugSession::open( _segment->getNet(), 150, 160 );
DebugSession::open( _segment->getNet(), 149, 160 );
_data = _segment->getDataNegociate();
if (_data) _event = _data->getRoutingEvent();
@ -1069,7 +1069,7 @@ namespace Katana {
if ( _segment->isFixed () ) return false;
if ( _segment->isStrap () ) return false;
if (not _segment->canPivotDown(2.0)) return false;
if (not _segment->canPivotDown(2.0,Flags::NoFlags)) return false;
return _segment->moveDown( Flags::NoFlags );
}
@ -1082,15 +1082,16 @@ namespace Katana {
unsigned int kflags = Flags::WithNeighbors;
//kflags |= (flags & AllowLocalMoveUp ) ? Flags::AutoSegment::AllowLocal : 0;
kflags |= (flags & AllowTerminalMoveUp) ? Flags::AllowTerminal : 0;
kflags |= (flags & IgnoreContacts ) ? Flags::IgnoreContacts : 0;
if (_segment->isFixed()) return false;
if (not (flags & AllowLocalMoveUp)) {
if (_segment->isLocal()) {
if (not _segment->canPivotUp(0.5)) return false;
if (not _segment->canPivotUp(0.5,kflags)) return false;
} else {
if (_segment->getLength() < 20*getPitch()) {
if (not (flags & AllowShortPivotUp)) return false;
if (not _segment->canPivotUp(1.0)) return false;
if (not _segment->canPivotUp(1.0,kflags)) return false;
}
if (not _segment->canMoveUp(0.5,kflags)) return false;
}

View File

@ -244,6 +244,7 @@ namespace {
if (segment and segment->isFixed() and segment->isTerminal()) {
Interval freeInterval = track->getFreeInterval( segment->getSourceU(), segment->getNet() );
DbU::Unit ppitch = segment->getPPitch();
//DbU::Unit pitch = segment->getPitch();
//if (freeInterval.getSize() < ppitch*6) {
if ( (segment->getSourceU() - freeInterval.getVMin() < ppitch*3)

View File

@ -393,7 +393,7 @@ namespace Katana {
#endif
}
DebugSession::open( _segment->getNet(), 150, 160 );
DebugSession::open( _segment->getNet(), 149, 160 );
cdebug_log(9000,0) << "Deter| Event "
<< getProcesseds()

View File

@ -720,7 +720,7 @@ namespace Katana {
Interval constraints;
vector<Cs1Candidate> candidates;
TrackElement* segment = _event->getSegment();
bool canMoveUp = (segment->isLocal()) ? segment->canPivotUp(0.5) : segment->canMoveUp(1.0,Flags::CheckLowDensity); // MARK 1
bool canMoveUp = (segment->isLocal()) ? segment->canPivotUp(0.5,Flags::NoFlags) : segment->canMoveUp(1.0,Flags::CheckLowDensity); // MARK 1
unsigned int relaxFlags = Manipulator::NoDoglegReuse
| ((_data and (_data->getStateCount() < 2)) ? Manipulator::AllowExpand
: Manipulator::NoExpand);
@ -1003,17 +1003,18 @@ namespace Katana {
bool success = false;
unsigned int nextState = data->getState();
Manipulator manipulator ( segment, *this );
switch ( data->getState() ) {
case DataNegociate::RipupPerpandiculars:
nextState = DataNegociate::Minimize;
success = Manipulator(segment,*this).ripupPerpandiculars();
success = manipulator.ripupPerpandiculars();
if (success) break;
case DataNegociate::Minimize:
if (data->getStateCount() >= 2) {
nextState = DataNegociate::MaximumSlack;
}
success = Manipulator(segment,*this).minimize();
success = manipulator.minimize();
if (success) break;
case DataNegociate::Dogleg:
case DataNegociate::Slacken:
@ -1027,7 +1028,7 @@ namespace Katana {
}
if (not success and (nextState != DataNegociate::Unimplemented))
success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit);
success = manipulator.ripupPerpandiculars(Manipulator::ToRipupLimit);
if (not (flags&NoTransition)) {
data->setState( nextState );
@ -1044,11 +1045,12 @@ namespace Katana {
bool success = false;
unsigned int nextState = data->getState();
Manipulator manipulator ( segment, *this );
switch (data->getState()) {
case DataNegociate::RipupPerpandiculars:
nextState = DataNegociate::Minimize;
success = Manipulator(segment,*this).ripupPerpandiculars();
success = manipulator.ripupPerpandiculars();
if (success) break;
case DataNegociate::Minimize:
if (isFullBlocked() and not segment->isTerminal()) {
@ -1057,15 +1059,15 @@ namespace Katana {
break;
}
nextState = DataNegociate::Dogleg;
success = Manipulator(segment,*this).minimize();
success = manipulator.minimize();
if (success) break;
case DataNegociate::Dogleg:
nextState = DataNegociate::Slacken;
success = Manipulator(segment,*this).makeDogleg();
success = manipulator.makeDogleg();
if (success) break;
case DataNegociate::Slacken:
nextState = DataNegociate::ConflictSolveByPlaceds;
success = Manipulator(segment,*this).slacken();
success = manipulator.slacken();
if (success) break;
case DataNegociate::ConflictSolveByHistory:
case DataNegociate::ConflictSolveByPlaceds:
@ -1079,7 +1081,7 @@ namespace Katana {
break;
case DataNegociate::MoveUp:
nextState = DataNegociate::MaximumSlack;
success = Manipulator(segment,*this).moveUp();
success = manipulator.moveUp();
if (success) break;
case DataNegociate::MaximumSlack:
if (segment->isStrap()) {
@ -1096,7 +1098,7 @@ namespace Katana {
if (not success and (nextState != DataNegociate::Unimplemented)) {
if (data->getStateCount() < 6)
success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit);
success = manipulator.ripupPerpandiculars(Manipulator::ToRipupLimit);
}
if (not success
@ -1119,6 +1121,8 @@ namespace Katana {
{
bool success = false;
unsigned int nextState = data->getState();
Manipulator manipulator ( segment, *this );
unsigned int moveUpFlags = Manipulator::AllowShortPivotUp|Manipulator::IgnoreContacts;
switch ( data->getState() ) {
case DataNegociate::RipupPerpandiculars:
@ -1128,14 +1132,22 @@ namespace Katana {
nextState = DataNegociate::Slacken;
break;
case DataNegociate::Slacken:
cdebug_log(159,0) << "Global, SegmentFsm: Slacken." << endl;
if ((success = Manipulator(segment,*this).slacken(Flags::HalfSlacken))) {
cdebug_log(159,0) << "Global, SegmentFsm: Slacken "
<< ((manipulator.getEvent())
? manipulator.getEvent()->getConstraints() : "(not event yet)") << endl;
if ( manipulator.getEvent()
and manipulator.getEvent()->getConstraints().isPonctual()
and segment->canMoveUp(1.0,Flags::CheckLowUpDensity|Flags::AllowTerminal) ) {
moveUpFlags |= Manipulator::AllowTerminalMoveUp;
} else {
if ((success = manipulator.slacken(Flags::HalfSlacken))) {
nextState = DataNegociate::RipupPerpandiculars;
break;
}
}
case DataNegociate::MoveUp:
cdebug_log(159,0) << "Global, SegmentFsm: MoveUp." << endl;
if ((success = Manipulator(segment,*this).moveUp(Manipulator::AllowShortPivotUp))) {
if ((success = manipulator.moveUp(moveUpFlags))) {
break;
}
nextState = DataNegociate::ConflictSolveByHistory;
@ -1155,7 +1167,7 @@ namespace Katana {
break;
}
case DataNegociate::MaximumSlack:
if ((success=Manipulator(segment,*this).forceOverLocals())) {
if ((success=manipulator.forceOverLocals())) {
break;
}
case DataNegociate::Unimplemented:
@ -1166,7 +1178,7 @@ namespace Katana {
if (not success and (nextState != DataNegociate::Unimplemented)) {
if (data->getStateCount() < 6)
success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit);
success = manipulator.ripupPerpandiculars(Manipulator::ToRipupLimit);
}
// Special case: all tracks are overlaping a blockage.

View File

@ -21,6 +21,7 @@
#include "katana/Track.h"
#include "katana/TrackElement.h"
#include "katana/KatanaEngine.h"
#include "katana/RoutingPlane.h"
namespace {
@ -207,25 +208,10 @@ namespace Katana {
for ( size_t i=0 ; i<revalidateds.size() ; ++i ) {
revalidateds[i]->check();
}
//_getKatanaEngine()->_showOverlap ();
# endif
_sortEvents.clear();
#if THIS_IS_DISABLED
if (not faileds.empty()) {
set<TrackElement*>::iterator ifailed = faileds.begin();
Anabatic::GCellVector gcells;
for ( ; ifailed != faileds.end() ; ++ifailed ) {
(*ifailed)->getGCells ( gcells );
(*ifailed)->makeDogLeg( gcells[0] );
}
count += _revalidate();
}
#endif
// Looking for reduced/raised segments.
for ( size_t i=0 ; i<revalidateds.size() ; ++i ) {
if (revalidateds[i]->canReduce()) {
@ -242,6 +228,8 @@ namespace Katana {
}
_doRemovalEvents();
for ( Track* track : _sortEvents ) track->doReorder();
_sortEvents.clear();
cdebug_tabw(159,-1);
return count;

View File

@ -275,7 +275,7 @@ namespace Katana {
if (_segments[end]->getSourceU() >= interval.getVMax()) break;
}
cdebug_log(159,0) << "Track::getOverlapBounds(): begin:" << begin << " end:" << end << endl;
cdebug_log(155,0) << "Track::getOverlapBounds(): begin:" << begin << " end:" << end << endl;
}
@ -287,7 +287,7 @@ namespace Katana {
{
TrackCost cost ( const_cast<Track*>(this), interval, begin, end, net, flags );
cdebug_log(159,1) << "getOverlapCost() @" << DbU::getValueString(_axis)
cdebug_log(155,1) << "getOverlapCost() @" << DbU::getValueString(_axis)
<< " [" << DbU::getValueString(interval.getVMin())
<< ":" << DbU::getValueString(interval.getVMax())
<< "] <-> [" << begin << ":" << end << "]"
@ -299,16 +299,16 @@ namespace Katana {
for ( ; (mbegin < _markers.size())
and (_markers[mbegin]->getSourceU() <= interval.getVMax()) ; mbegin++ ) {
cdebug_log(159,0) << "| @" << DbU::getValueString(_axis) << _markers[mbegin] << endl;
cdebug_log(155,0) << "| @" << DbU::getValueString(_axis) << _markers[mbegin] << endl;
if ( _markers[mbegin]->getNet() != net ) {
cdebug_log(159,0) << "* Mark: @" << DbU::getValueString(_axis) << " " << _markers[mbegin] << endl;
cdebug_log(155,0) << "* Mark: @" << DbU::getValueString(_axis) << " " << _markers[mbegin] << endl;
cost.incTerminals( _markers[mbegin]->getWeight(this) );
}
}
if (begin == npos) {
cdebug_log(159,0) << " begin == npos (after last TrackElement)." << endl;
cdebug_tabw(159,-1);
cdebug_log(155,0) << " begin == npos (after last TrackElement)." << endl;
cdebug_tabw(155,-1);
return cost;
}
@ -317,12 +317,12 @@ namespace Katana {
if ( _segments[begin]->getNet() == net ) {
cost.incDeltaShared ( overlap.getSize() );
}
cdebug_log(159,0) << "| overlap: " << _segments[begin] << endl;
cdebug_log(155,0) << "| overlap: " << _segments[begin] << endl;
_segments[begin]->incOverlapCost( net, cost );
if (cost.isInfinite()) break;
}
cdebug_tabw(159,-1);
cdebug_tabw(155,-1);
return cost;
}
@ -345,7 +345,7 @@ namespace Katana {
void Track::getTerminalWeight ( Interval interval, Net* net, size_t& count, unsigned int& weight ) const
{
cdebug_log(159,1) << "getTerminalWeight() @" << DbU::getValueString(_axis)
cdebug_log(155,1) << "getTerminalWeight() @" << DbU::getValueString(_axis)
<< " [" << interval.getVMin() << " " << interval.getVMax() << "]" << endl;
//count = 0;
@ -357,14 +357,14 @@ namespace Katana {
for ( ; (mbegin < _markers.size())
&& (_markers[mbegin]->getSourceU() <= interval.getVMax()) ; mbegin++ ) {
cdebug_log(159,0) << "| @" << DbU::getValueString(_axis) << _markers[mbegin] << endl;
cdebug_log(155,0) << "| @" << DbU::getValueString(_axis) << _markers[mbegin] << endl;
if ( _markers[mbegin]->getNet() == net ) {
cdebug_log(159,0) << "* Mark: @" << DbU::getValueString(_axis) << " " << _markers[mbegin] << endl;
cdebug_log(155,0) << "* Mark: @" << DbU::getValueString(_axis) << " " << _markers[mbegin] << endl;
weight += _markers[mbegin]->getWeight(this);
++count;
}
}
cdebug_tabw(159,-1);
cdebug_tabw(155,-1);
}
@ -409,7 +409,11 @@ namespace Katana {
Interval Track::expandFreeInterval ( size_t& begin, size_t& end, unsigned int state, Net* net ) const
{
cdebug_log(155,1) << "Track::expandFreeInterval() begin:" << begin << " end:" << end << " " << net << endl;
cdebug_log(155,0) << _segments[begin] << endl;
DbU::Unit minFree = _min;
cdebug_log(155,0) << "minFree:" << DbU::getValueString(minFree) << " (track min)" << endl;
if (not (state & BeginIsTrackMin) ) {
if (_segments[begin]->getNet() == net)
@ -417,6 +421,7 @@ namespace Katana {
if (begin != npos) {
minFree = getOccupiedInterval(begin).getVMax();
cdebug_log(155,0) << "minFree:" << DbU::getValueString(minFree) << " begin:" << begin << endl;
}
}
@ -432,6 +437,7 @@ namespace Katana {
}
}
}
cdebug_tabw(155,-1);
return Interval( minFree, getMaximalPosition(end,state) );
}
@ -452,7 +458,7 @@ namespace Katana {
{
// cdebug_log(9000,0) << "Deter| Track::insert() " << getLayer()->getName()
// << " @" << DbU::getValueString(getAxis()) << " " << segment << endl;
cdebug_log(159,0) << "Track::insert() " << getLayer()->getName()
cdebug_log(155,0) << "Track::insert() " << getLayer()->getName()
<< " @" << DbU::getValueString(getAxis()) << " " << segment << endl;
if ( (getLayer()->getMask() != segment->getLayer()->getMask())
@ -596,10 +602,14 @@ namespace Katana {
Interval mergedInterval;
_segments[seed]->getCanonical( mergedInterval );
cdebug_log(155,0) << "| seed:" << _segments[seed] << endl;
size_t i = seed;
while ( --i != npos ) {
if (_segments[i]->getNet() != owner) break;
cdebug_log(155,0) << "| merge:" << _segments[i] << endl;
_segments[i]->getCanonical ( segmentInterval );
if (segmentInterval.getVMax() >= mergedInterval.getVMin()) {
mergedInterval.merge( segmentInterval );
@ -623,7 +633,7 @@ namespace Katana {
size_t Track::doRemoval ()
{
cdebug_log(159,1) << "Track::doRemoval() - " << this << endl;
cdebug_log(155,1) << "Track::doRemoval() - " << this << endl;
size_t size = _segments.size();
@ -632,8 +642,8 @@ namespace Katana {
_segments.erase( beginRemove, _segments.end() );
cdebug_log(159,0) << "After doRemoval " << this << endl;
cdebug_tabw(159,-1);
cdebug_log(155,0) << "After doRemoval " << this << endl;
cdebug_tabw(155,-1);
return size - _segments.size();
}
@ -641,7 +651,7 @@ namespace Katana {
void Track::doReorder ()
{
cdebug_log(159,0) << "Track::doReorder() " << this << endl;
cdebug_log(155,0) << "Track::doReorder() " << this << endl;
if (not _segmentsValid) {
std::sort( _segments.begin(), _segments.end(), SegmentCompare() );

View File

@ -146,8 +146,8 @@ namespace Katana {
bool TrackElement::isUserDefined () const { return false; }
// Predicates.
bool TrackElement::canSlacken () const { return false; }
bool TrackElement::canPivotUp ( float ) const { return false; };
bool TrackElement::canPivotDown ( float ) const { return false; };
bool TrackElement::canPivotUp ( float, unsigned int ) const { return false; };
bool TrackElement::canPivotDown ( float, unsigned int ) const { return false; };
bool TrackElement::canMoveUp ( float, unsigned int ) const { return false; };
bool TrackElement::canDogleg () { return false; };
bool TrackElement::canDogleg ( Interval ) { return false; };

View File

@ -406,12 +406,12 @@ namespace Katana {
{ return _base->getMaxUnderDensity( flags ); }
bool TrackSegment::canPivotUp ( float reserve ) const
{ return _base->canPivotUp(reserve); }
bool TrackSegment::canPivotUp ( float reserve, unsigned int flags ) const
{ return _base->canPivotUp( reserve, flags ); }
bool TrackSegment::canPivotDown ( float reserve ) const
{ return _base->canPivotDown( reserve ); }
bool TrackSegment::canPivotDown ( float reserve, unsigned int flags ) const
{ return _base->canPivotDown( reserve, flags ); }
bool TrackSegment::canMoveUp ( float reserve, unsigned int flags ) const

View File

@ -48,6 +48,7 @@ namespace Katana {
, LeftAxisHint = 0x0200
, RightAxisHint = 0x0400
, NotOnLastRipup = 0x0800
, IgnoreContacts = 0x1000
};
public:
Manipulator ( TrackElement*, SegmentFsm& );

View File

@ -115,8 +115,8 @@ namespace Katana {
inline bool hasTargetDogleg () const;
inline bool canRipple () const;
virtual bool canSlacken () const;
virtual bool canPivotUp ( float reserve ) const;
virtual bool canPivotDown ( float reserve ) const;
virtual bool canPivotUp ( float reserve, unsigned int flags ) const;
virtual bool canPivotDown ( float reserve, unsigned int flags ) const;
virtual bool canMoveUp ( float reserve, unsigned int flags=Flags::WithPerpands ) const;
virtual bool canDogleg ();
virtual bool canDogleg ( Interval );

View File

@ -75,8 +75,8 @@ namespace Katana {
virtual bool canDogleg ();
virtual bool canDogleg ( Interval );
virtual bool canDogleg ( Anabatic::GCell*, unsigned int flags=0 );
virtual bool canPivotUp ( float reserve ) const;
virtual bool canPivotDown ( float reserve ) const;
virtual bool canPivotUp ( float reserve, unsigned int flags ) const;
virtual bool canPivotDown ( float reserve, unsigned int flags ) const;
virtual bool canMoveUp ( float reserve, unsigned int flags ) const;
virtual bool canSlacken () const;
virtual float getMaxUnderDensity ( unsigned int flags ) const;