Synchronize priority of TrackSegments connecteds through doglegs.

* Bug: In Anabatic::Dijsktra, correct the indentation in cdebug calls
    (lots of them causing a big shift right).
* New: In Anabatic::TrackSegment, new helper structure SideStack to
    manage a set of aligned GCells and their various sides sizes.
* Change: In Anabatic::TrackSegment::computeOptimal(), more accurate
    computation of attractors from global segments and variable size
    GCells using SideStack.
* Change: In Katana::DataSymmetric::checkPairing(), increase the tolerance
    for misaligned symmetrics from 2 to 5 tracks (should be enough for our
    narrow channel routing).
* New: In Katana::TrackSegment, add a first flag to enable locking of
    priority. If it is set, calls to either "computePriority()" or
    "forcePriority()" will have no effect. Added the uint32_t flags
    paraphernalia.
* New: In ::computeNetPriority(), overall function to control the call
    of TrackSegment::computeAlignedPriority(). The call is done from
    NegociateWindow::run().
* New: Katana::TrackSegment::computeAlignedPriority(), order the
    TrackSegments aligneds through doglegs to the one with the highest
    priority is routed first and others progressively from him. Done by
    forcing an ever decreasing priority on the aligneds ones.
      The amount of decrease is small so the aligned segments got routed
    (ordered) in close, if not contiguous, sequence. Priority is locked
    for the order to remain.
* Bug: In Katana::TrackSegment::computePriority(), correct computation
    of the priority when there is more than 10 free tracks
    (a DbU::toLambda() call was missing, leading to very big priorities).
* Change: In katana::TrackCost CTOR, do not compute a distance to fixed
    in the case of analog segments, this is backfiring.
      Slight change of the compare function when delta differs. Seems
    to improve a little.
This commit is contained in:
Jean-Paul Chaput 2017-05-30 22:33:06 +02:00
parent 1e49da1976
commit 8a73b03fd8
18 changed files with 453 additions and 226 deletions

View File

@ -606,7 +606,6 @@ namespace Anabatic {
void AnabaticEngine::ripup ( Segment* seed, Flags flags )
{
Net* net = seed->getNet();
DebugSession::open( net, 112, 120 );

View File

@ -233,6 +233,77 @@ namespace {
}
// ---------------------------------------------------------------
// Class : "SideStack".
class SideStack {
public:
SideStack ( Flags direction, DbU::Unit pitch );
const Interval& getSideAt ( DbU::Unit ) const;
inline const Interval& getGSide () const;
inline DbU::Unit getGSideMin () const;
inline DbU::Unit getGSideMax () const;
void addGCell ( const GCell* );
inline void restrictGSide ( const Interval& );
void show () const;
private:
Flags _direction;
DbU::Unit _pitch;
Interval _full;
Interval _gside;
map<DbU::Unit,Interval> _sides;
};
SideStack::SideStack ( Flags direction, DbU::Unit pitch )
: _direction( (direction & Flags::Horizontal) ? Flags::Vertical : Flags::Horizontal )
, _pitch (pitch)
, _full (false)
, _gside (false)
, _sides ()
{ }
inline const Interval& SideStack::getGSide () const { return _gside; }
inline DbU::Unit SideStack::getGSideMin () const { return _gside.getVMin(); }
inline DbU::Unit SideStack::getGSideMax () const { return _gside.getVMax(); }
inline void SideStack::restrictGSide ( const Interval& restrict ) { _gside.intersection( restrict ); }
const Interval& SideStack::getSideAt ( DbU::Unit position ) const
{
if (_sides.empty()) return _full;
if (_sides.size() == 1) return _sides.begin()->second;
if (_sides.begin()->first > position) return _sides.begin()->second;
for ( auto iside = ++_sides.begin() ; iside != _sides.end() ; ++iside ) {
if (iside->first >= position) return (--iside)->second;
}
return _sides.rbegin()->second;
}
void SideStack::addGCell ( const GCell* gcell )
{
Interval side = gcell->getSide( _direction, _pitch );
DbU::Unit position = (_direction & Flags::Vertical) ? gcell->getBoundingBox().getXMin()
: gcell->getBoundingBox().getYMin();
_gside.intersection( side );
_sides.insert( make_pair(position,side) );
}
void SideStack::show () const
{
cdebug_log(145,0) << "SideStack::show()" << endl;
for ( auto pside : _sides ) {
cdebug_log(145,0) << "@ " << DbU::getValueString(pside.first)
<< " " << pside.second << endl;
}
}
} // End of local namespace.
@ -828,7 +899,7 @@ namespace Anabatic {
cdebug_tabw(149,-1);
return true;
}
if (getAxis() > optimalMax) {
setAxis( optimalMax, flags );
cdebug_tabw(149,-1);
@ -922,6 +993,7 @@ namespace Anabatic {
DbU::Unit constraintMin;
DbU::Unit constraintMax;
vector<AutoSegment*> aligneds;
SideStack sideStack ( (isHorizontal() ? Flags::Horizontal : Flags::Vertical), getPitch() );
getConstraints( constraintMin, constraintMax );
cdebug_log(145,0) << "Constraints: [" << DbU::getValueString(constraintMin)
@ -931,43 +1003,37 @@ namespace Anabatic {
optimalMin = optimalMax = getAxis();
aligneds.push_back( this );
} else {
DbU::Unit minGCell = getOrigin();
DbU::Unit maxGCell = getExtremity();
DbU::Unit terminalMin;
DbU::Unit terminalMax;
AttractorsMap attractors;
Flags flags = (isAnalog() ? Flags::WithDoglegs : Flags::NoFlags);
Flags f2 = flags | Flags::WithSelf;
getAligneds( Flags::WithSelf|flags ).fill( aligneds );
if (not getGCell()->isMatrix()) {
Flags direction = (isHorizontal()) ? Flags::Vertical : Flags::Horizontal;
Interval gcellSide ( false );
if (getGCell()->isMatrix()) {
sideStack.addGCell( getGCell() );
} else {
vector<GCell*> gcells;
DbU::Unit pitch = getPitch();
cdebug_log(145,0) << "Using pitch for L/T shrink:" << DbU::getValueString(pitch) << endl;
cdebug_log(145,0) << "Using pitch for L/T shrink:" << DbU::getValueString(getPitch()) << endl;
for ( AutoSegment* aligned : aligneds ) {
aligned->getGCells( gcells );
for ( GCell* gcell : gcells ) {
gcellSide.intersection( gcell->getSide(direction,pitch) );
cdebug_log(145,0) << "| gcellSide:" << gcellSide << " (from " << gcell << ")" << endl;
sideStack.addGCell( gcell );
cdebug_log(145,0) << "| gcellSide:" << sideStack.getGSide() << " (from " << gcell << ")" << endl;
}
if (aligned->isStrongTerminal()) {
Interval terminalConstraints;
aligned->getConstraints( terminalConstraints );
gcellSide.intersection( terminalConstraints );
cdebug_log(145,0) << "| gcellSide:" << gcellSide << " (from " << aligned << ")" << endl;
sideStack.restrictGSide( terminalConstraints );
cdebug_log(145,0) << "| gcellSide:" << sideStack.getGSide() << " (from " << aligned << ")" << endl;
}
}
minGCell = gcellSide.getVMin();
maxGCell = gcellSide.getVMax();
}
sideStack.show();
cdebug_log(145,0) << "GCell interval [" << DbU::getValueString(minGCell)
<< ":" << DbU::getValueString(maxGCell) << "]" << endl;
cdebug_log(145,0) << "GCell interval " << sideStack.getGSide() << endl;
AutoContact* anchor = getAutoSource();
if (anchor->isTerminal()) {
@ -1006,12 +1072,19 @@ namespace Anabatic {
if (autoSegment->isGlobal()) {
cdebug_log(145,0) << "Used as global." << endl;
// Sloppy implentation.
DbU::Unit perpandMin = autoSegment->getSourceU();
DbU::Unit perpandMax = autoSegment->getTargetU();
const Interval& side = sideStack.getSideAt( autoSegment->getAxis() );
cdebug_log(145,0) << "Side @" << DbU::getValueString(autoSegment->getAxis())
<< " " << side << endl;
if (perpandMin < minGCell) attractors.addAttractor( minGCell );
if (perpandMax > maxGCell) attractors.addAttractor( maxGCell );
if (autoSegment->getSourceU() < side.getVMin()) attractors.addAttractor( sideStack.getGSideMin() );
if (autoSegment->getTargetU() > side.getVMax()) attractors.addAttractor( sideStack.getGSideMax() );
// // Sloppy implentation.
// DbU::Unit perpandMin = autoSegment->getSourceU();
// DbU::Unit perpandMax = autoSegment->getTargetU();
// if (perpandMin < minGCell) attractors.addAttractor( minGCell );
// if (perpandMax > maxGCell) attractors.addAttractor( maxGCell );
} else if (autoSegment->isLocal()) {
if (autoSegment->isStrongTerminal()) {
cdebug_log(145,0) << "Used as strong terminal." << endl;
@ -1054,8 +1127,8 @@ namespace Anabatic {
: _gcell->getBoundingBox().getXMax();
}
setInBound( minGCell, maxGCell, optimalMin );
setInBound( minGCell, maxGCell, optimalMax );
setInBound( sideStack.getGSideMin(), sideStack.getGSideMax(), optimalMin );
setInBound( sideStack.getGSideMin(), sideStack.getGSideMax(), optimalMax );
cdebug_log(145,0) << "optimalMin: " << DbU::getValueString(optimalMin) << endl;
cdebug_log(145,0) << "optimalMax: " << DbU::getValueString(optimalMax) << endl;

View File

@ -394,7 +394,8 @@ namespace Anabatic {
IntervalC intervfrom = IntervalC();
if (_adata == NULL){
cdebug_log(112,1) << "Point Vertex::getStartPathPoint( const Vertex* next ) const: GRAData unset." << endl;
cdebug_log(112,0) << "Point Vertex::getStartPathPoint( const Vertex* next ) const: GRAData unset." << endl;
cdebug_tabw(112,-1);
return Point(0,0);
}
@ -754,6 +755,7 @@ namespace Anabatic {
} else {
cdebug_log(112,0) << "[ERROR](void Vertex::setIntervals(...)): Something is wrong." << endl;
cdebug_tabw(112,-1);
return;
}
cdebug_log(112,0) << "IntervFrom => min: " << DbU::getValueString(min) << ", max: " << DbU::getValueString(max) << ", axis:" << DbU::getValueString(axis) << endl;
@ -792,7 +794,7 @@ namespace Anabatic {
if (_adata){
return _adata->isiSet();
} else {
cdebug_log(112,1) << "bool Vertex::isiSet() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "bool Vertex::isiSet() const: Inappropriate usage of GRAData. " << endl;
return false;
}
}
@ -803,7 +805,7 @@ namespace Anabatic {
if (_adata){
return _adata->getIAxis();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getIAxis() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getIAxis() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -814,7 +816,7 @@ namespace Anabatic {
if (_adata){
return _adata->getIMax();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getIMax() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getIMax() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -825,7 +827,7 @@ namespace Anabatic {
if (_adata){
return _adata->getIMin();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getIMin() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getIMin() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -836,7 +838,7 @@ namespace Anabatic {
if (_adata){
return _adata->getPIAxis();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getPIAxis() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getPIAxis() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -847,7 +849,7 @@ namespace Anabatic {
if (_adata){
return _adata->getPIMax();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMax() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getPIMax() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -858,7 +860,7 @@ namespace Anabatic {
if (_adata){
return _adata->getPIMin();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMin() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getPIMin() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -869,7 +871,7 @@ namespace Anabatic {
if (_adata){
_adata->setInterv(min, max, axis);
} else {
cdebug_log(112,1) << "void Vertex::setInterv( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::setInterv( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
}
}
@ -879,7 +881,7 @@ namespace Anabatic {
if (_adata){
_adata->setIntervfrom(min, max, axis);
} else {
cdebug_log(112,1) << "void Vertex::setIntervfrom( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::setIntervfrom( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
}
}
@ -889,7 +891,7 @@ namespace Anabatic {
if (_adata){
_adata->setIntervfrom2(min, max, axis);
} else {
cdebug_log(112,1) << "void Vertex::setIntervfrom2( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::setIntervfrom2( DbU::Unit min, DbU::Unit max, DbU::Unit axis ): Inappropriate usage of GRAData. " << endl;
}
}
@ -899,7 +901,7 @@ namespace Anabatic {
if (_adata){
_adata->resetIntervals();
} else {
cdebug_log(112,1) << "void Vertex::resetIntervals(): Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::resetIntervals(): Inappropriate usage of GRAData. " << endl;
}
}
@ -909,7 +911,7 @@ namespace Anabatic {
if (_adata){
_adata->clearFrom2();
} else {
cdebug_log(112,1) << "void Vertex::clearfrom2(): Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::clearfrom2(): Inappropriate usage of GRAData. " << endl;
}
}
@ -919,7 +921,7 @@ namespace Anabatic {
if (_adata){
return _adata->getFrom2();
} else {
cdebug_log(112,1) << "Edge* Vertex::getFrom2() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "Edge* Vertex::getFrom2() const: Inappropriate usage of GRAData. " << endl;
return NULL;
}
}
@ -930,7 +932,7 @@ namespace Anabatic {
if (_adata){
_adata->setFrom2(from);
} else {
cdebug_log(112,1) << "void Vertex::setFrom2( Edge* from ): Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::setFrom2( Edge* from ): Inappropriate usage of GRAData. " << endl;
}
}
@ -940,7 +942,7 @@ namespace Anabatic {
if (_adata){
//_adata->createIntervFrom2();
} else {
cdebug_log(112,1) << "void Vertex::createIntervFrom2(): Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::createIntervFrom2(): Inappropriate usage of GRAData. " << endl;
}
}
@ -950,7 +952,7 @@ namespace Anabatic {
if (_adata){
return _adata->getPIMax2();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMax2() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getPIMax2() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -961,7 +963,7 @@ namespace Anabatic {
if (_adata){
return _adata->getPIMin2();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getPIMin2() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getPIMin2() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -972,7 +974,7 @@ namespace Anabatic {
if (_adata){
return _adata->getPIAxis2();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getPIAxis2() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getPIAxis2() const: Inappropriate usage of GRAData. " << endl;
return 0;
}
}
@ -983,7 +985,7 @@ namespace Anabatic {
if (_adata){
return _adata->getIntervFrom2();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getIntervFrom2() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getIntervFrom2() const: Inappropriate usage of GRAData. " << endl;
return IntervalC();
}
}
@ -1017,7 +1019,7 @@ namespace Anabatic {
return _adata->getIntervFrom();
}
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getIntervFrom(Flags criteria) const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getIntervFrom(Flags criteria) const: Inappropriate usage of GRAData. " << endl;
return IntervalC();
}
}
@ -1066,7 +1068,7 @@ namespace Anabatic {
if (_adata){
return _adata->getInterv();
} else {
cdebug_log(112,1) << "DbU::Unit Vertex::getInterv() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "DbU::Unit Vertex::getInterv() const: Inappropriate usage of GRAData. " << endl;
return IntervalC();
}
}
@ -1077,7 +1079,7 @@ namespace Anabatic {
if (_adata){
_adata->printInterv();
} else {
cdebug_log(112,1) << "void Vertex::printInterv() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::printInterv() const: Inappropriate usage of GRAData. " << endl;
}
}
@ -1087,7 +1089,7 @@ namespace Anabatic {
if (_adata){
_adata->printIntervfrom();
} else {
cdebug_log(112,1) << "void Vertex::printIntervfrom() const: Inappropriate usage of GRAData. " << endl;
cdebug_log(112,0) << "void Vertex::printIntervfrom() const: Inappropriate usage of GRAData. " << endl;
}
}

View File

@ -167,12 +167,13 @@ namespace Katana {
_valid = false;
}
if (std::abs( 2*getSymAxis() - paired[0]->getAxis() - paired[1]->getAxis() ) > 2*vPitch ) {
if (std::abs( 2*getSymAxis() - paired[0]->getAxis() - paired[1]->getAxis() ) > 5*vPitch ) {
errors.newline() << "Mirror axis mismatch @ [" << index << "] "
<< DbU::getValueString(paired[1]->getAxis()) << " (should be: "
<< DbU::getValueString(2*getSymAxis() - paired[0]->getAxis()) << ")";
errors.newline() << "| " << paired[0];
errors.newline() << "| " << paired[1];
errors.newline() << "| Tolerance (5*vPitch): " << DbU::getValueString(5*vPitch);
_valid = false;
}
} else {
@ -184,32 +185,35 @@ namespace Katana {
_valid = false;
}
if ( std::abs( paired[0]->getAxis() - paired[1]->getAxis() ) > 2*hPitch ) {
if ( std::abs( paired[0]->getAxis() - paired[1]->getAxis() ) > 5*hPitch ) {
errors.newline() << "Axis mismatch index " << index << " "
<< DbU::getValueString(paired[1]->getAxis()) << " (should be:"
<< DbU::getValueString(paired[0]->getAxis()) << ")";
errors.newline() << "| " << paired[0];
errors.newline() << "| " << paired[1];
errors.newline() << "| Tolerance (5*hPitch): " << DbU::getValueString(5*hPitch);
_valid = false;
}
}
} else {
if (paired[0]->isHorizontal()) {
if ( std::abs( 2*getSymAxis() - paired[0]->getAxis() - paired[1]->getAxis() ) > 2*hPitch ) {
if ( std::abs( 2*getSymAxis() - paired[0]->getAxis() - paired[1]->getAxis() ) > 5*hPitch ) {
errors.newline() << "Mirror axis mismatch index " << index << " "
<< DbU::getValueString(paired[1]->getAxis()) << " (should be:"
<< DbU::getValueString(2*getSymAxis() - paired[0]->getAxis()) << ")";
errors.newline() << "| " << paired[0];
errors.newline() << "| " << paired[1];
errors.newline() << "| Tolerance (5*hPitch): " << DbU::getValueString(5*hPitch);
_valid = false;
}
} else {
if ( std::abs( paired[0]->getAxis() != paired[1]->getAxis() ) > 2*vPitch ) {
if ( std::abs( paired[0]->getAxis() != paired[1]->getAxis() ) > 5*vPitch ) {
errors.newline() << "Axis mismatch index " << index << " "
<< DbU::getValueString(paired[1]->getAxis()) << " (should be:"
<< DbU::getValueString(paired[0]->getAxis()) << ")";
errors.newline() << "| " << paired[0];
errors.newline() << "| " << paired[1];
errors.newline() << "| Tolerance (5*vPitch): " << DbU::getValueString(5*vPitch);
_valid = false;
}
}

View File

@ -54,6 +54,9 @@ namespace {
using Hurricane::NetRoutingExtension;
using Hurricane::Net;
using Hurricane::Cell;
using Hurricane::Segment;
using Katana::Session;
using Katana::TrackSegment;
void setSymmetricSelf ( Cell* cell, string name )
@ -562,7 +565,7 @@ namespace Katana {
addMeasure<unsigned long long>( getCell(), "DWL(l)" , totalWireLength , 12 );
addMeasure<unsigned long long>( getCell(), "fWL(l)" , totalWireLength-routedWireLength , 12 );
addMeasure<double> ( getCell(), "WLER(%)", (expandRatio-1.0)*100.0 );
}
}
void KatanaEngine::dumpMeasures ( ostream& out ) const

View File

@ -18,6 +18,7 @@
#include <algorithm>
#include <fstream>
#include <iomanip>
#include "hurricane/DebugSession.h"
#include "hurricane/Warning.h"
#include "hurricane/Bug.h"
#include "hurricane/RoutingPad.h"
@ -133,6 +134,38 @@ namespace {
}
class CompareByPriority {
public:
inline bool operator() ( const TrackSegment* lhs, const TrackSegment* rhs )
{ return lhs->getPriority() > rhs->getPriority(); }
};
void computeNetPriority ( Net* net )
{
DebugSession::open( net, 159, 160 );
cdebug_log(159,1) << "::computeNetPriority() " << net << endl;
vector<TrackSegment*> segments;
for ( Segment* segment : net->getSegments() ) {
TrackSegment* canonical = dynamic_cast<TrackSegment*>( Session::lookup( segment ) );
if (canonical) segments.push_back( canonical );
}
for ( TrackSegment* segment : segments ) segment->computePriority();
sort( segments.begin(), segments.end(), CompareByPriority() );
for ( TrackSegment* segment : segments ) {
segment->computeAlignedPriority();
}
cdebug_tabw(159,-1);
DebugSession::close();
}
} // Anonymous namespace.
@ -149,6 +182,7 @@ namespace Katana {
using Hurricane::Bug;
using Hurricane::tab;
using Hurricane::ForEachIterator;
using Hurricane::DebugSession;
using CRL::Histogram;
using CRL::addMeasure;
using Anabatic::AutoContact;
@ -343,6 +377,14 @@ namespace Katana {
}
void NegociateWindow::_computePriorities ()
{
for ( Net* net : getCell()->getNets() ) {
if (NetRoutingExtension::isAnalog(net)) computeNetPriority( net );
}
}
void NegociateWindow::_createRouting ( Anabatic::GCell* gcell )
{
cdebug_log(159,1) << "NegociateWindow::_createRouting() - " << gcell << endl;
@ -561,6 +603,7 @@ namespace Katana {
_createRouting( _gcells[igcell] );
}
Session::revalidate();
_computePriorities();
if (not (flags & Flags::PreRoutedStage)) {
_katana->preProcess();

View File

@ -655,7 +655,7 @@ namespace Katana {
and _segment->base()->getAutoTarget()->isTerminal();
}
_segment->updatePriority();
_segment->computePriority();
cdebug_log(159,0) << _segment << " has " << (int)_tracksNb << " choices " << perpandicular << endl;
cdebug_tabw(159,-1);

View File

@ -570,6 +570,7 @@ namespace Katana {
for ( Track* track1 : Tracks_Range::get(plane,_constraint) ) {
uint32_t costflags = 0;
costflags |= (segment1->isLocal() and (depth >= 3)) ? TrackCost::LocalAndTopDepth : 0;
costflags |= (segment1->isAnalog()) ? TrackCost::Analog : 0;
Track* track2 = NULL;
if (_event2) {

View File

@ -226,9 +226,10 @@ namespace Katana {
cdebug_log(159,0) << "Session: reduce:" << revalidateds[i] << endl;
}
if (revalidateds[i]->mustRaise()) {
revalidateds[i]->raise();
lookup( revalidateds[i] )->reschedule( 0 );
cdebug_log(159,0) << "Session: raise:" << revalidateds[i] << endl;
revalidateds[i]->raise();
TrackElement* trackSegment = lookup( revalidateds[i] );
if (trackSegment) trackSegment->reschedule( 0 );
}
}

View File

@ -91,34 +91,36 @@ namespace Katana {
, _dataState (0)
, _ripupCount (0)
{
// This is the GCell side (it is *one* cell height from the gauge).
DbU::Unit cellHeight = Session::getSliceHeight();
if (not (_flags & Analog)) {
// This is the GCell side (it is *one* cell height from the gauge).
DbU::Unit cellHeight = Session::getSliceHeight();
TrackElement* neighbor;
if ( _begin != Track::npos ) {
neighbor = _track->getSegment(_begin);
if ( neighbor and (neighbor->getNet() != net) ) {
DbU::Unit distance = interval.getVMin() - neighbor->getTargetU();
if ( distance < cellHeight )
_distanceToFixed = distance;
}
TrackElement* neighbor;
if ( _begin != Track::npos ) {
neighbor = _track->getSegment(_begin);
if ( neighbor and (neighbor->getNet() != net) ) {
DbU::Unit distance = interval.getVMin() - neighbor->getTargetU();
if ( distance < cellHeight )
_distanceToFixed = distance;
}
// if ( neighbor and neighbor->isFixed() ) {
// if ( _distanceToFixed == DbU::Max ) _distanceToFixed = 0;
// _distanceToFixed += interval.getVMin() - neighbor->getTargetU();
// }
}
if ( _end != Track::npos ) {
neighbor = _track->getSegment(_end);
if ( neighbor and (neighbor->getNet() != net) ) {
DbU::Unit distance = neighbor->getSourceU() - interval.getVMax();
if ( _distanceToFixed == 2*cellHeight ) _distanceToFixed = 0;
if ( distance < cellHeight )
_distanceToFixed += distance;
}
if ( _end != Track::npos ) {
neighbor = _track->getSegment(_end);
if ( neighbor and (neighbor->getNet() != net) ) {
DbU::Unit distance = neighbor->getSourceU() - interval.getVMax();
if ( _distanceToFixed == 2*cellHeight ) _distanceToFixed = 0;
if ( distance < cellHeight )
_distanceToFixed += distance;
}
// if ( neighbor and neighbor->isFixed() ) {
// if ( _distanceToFixed == DbU::Max ) _distanceToFixed = 0;
// _distanceToFixed += neighbor->getSourceU() - interval.getVMax();
// }
}
}
}
@ -162,12 +164,14 @@ namespace Katana {
if (lhs._delta != rhs._delta) {
//cdebug_log(155,0) << "TrackCost::Compare() lhs._delta:" << lhs._delta << " rhs._delta:" << rhs._delta << endl;
if ( not (_flags & TrackCost::IgnoreSharedLength) or (lhs._delta > 0) or (rhs._delta > 0) ) {
//if ( not (_flags & TrackCost::IgnoreSharedLength) or (lhs._delta > 0) or (rhs._delta > 0) ) {
//if ( (lhs._delta > 0) or (rhs._delta > 0) ) {
if (lhs._delta < rhs._delta) return true;
if (lhs._delta > rhs._delta) return false;
}
//}
// Both delta should be negative, chose the least one.
//return lhs._delta > rhs._delta;
return lhs._delta < rhs._delta;
}
@ -210,8 +214,9 @@ namespace Katana {
if ( not _infinite and not _hardOverlap ) {
cdebug_log(159,0) << "TrackCost::consolidate() " << _delta << " - " << _deltaShared << endl;
//_deltaPerpand += - (_deltaShared << 1);
_delta += - _deltaShared;
//_delta += _deltaShared;
_delta -= _deltaShared;
//if (_delta > 0) _delta -= _deltaShared;
//else _delta += _deltaShared;
}
}
@ -249,7 +254,7 @@ namespace Katana {
s += "-" + /*DbU::getValueString(_deltaShared)*/ getString(_deltaShared);
s += "/" + DbU::getValueString(_axisWeight);
s += "/" + DbU::getValueString(_deltaPerpand);
s += "/" + DbU::getValueString(_distanceToFixed);
s += "/f:" + DbU::getValueString(_distanceToFixed);
s += "/" + DbU::getValueString(_longuestOverlap);
s += " " + getString(_dataState);
s += ">";

View File

@ -144,6 +144,7 @@ namespace Katana {
bool TrackElement::isReduced () const { return false; }
bool TrackElement::isUTurn () const { return false; }
bool TrackElement::isUserDefined () const { return false; }
bool TrackElement::isAnalog () const { return false; }
// Predicates.
bool TrackElement::hasSymmetric () const { return false; }
bool TrackElement::canSlacken () const { return false; }

View File

@ -130,15 +130,16 @@ namespace Katana {
}
AutoSegment* TrackFixedSegment::base () const { return NULL; }
Segment* TrackFixedSegment::getSegment () const { return _segment; }
DbU::Unit TrackFixedSegment::getAxis () const { return getTrack()->getAxis(); }
bool TrackFixedSegment::isHorizontal () const { return getTrack()->isHorizontal(); }
bool TrackFixedSegment::isVertical () const { return getTrack()->isVertical(); }
bool TrackFixedSegment::isFixed () const { return true; }
Flags TrackFixedSegment::getDirection () const { return getTrack()->getDirection(); }
const Layer* TrackFixedSegment::getLayer () const { return _segment->getLayer(); }
Interval TrackFixedSegment::getFreeInterval () const { return Interval(); }
AutoSegment* TrackFixedSegment::base () const { return NULL; }
Segment* TrackFixedSegment::getSegment () const { return _segment; }
DbU::Unit TrackFixedSegment::getAxis () const { return getTrack()->getAxis(); }
bool TrackFixedSegment::isHorizontal () const { return getTrack()->isHorizontal(); }
bool TrackFixedSegment::isVertical () const { return getTrack()->isVertical(); }
bool TrackFixedSegment::isFixed () const { return true; }
bool TrackFixedSegment::isPriorityLocked () const { return false; }
Flags TrackFixedSegment::getDirection () const { return getTrack()->getDirection(); }
const Layer* TrackFixedSegment::getLayer () const { return _segment->getLayer(); }
Interval TrackFixedSegment::getFreeInterval () const { return Interval(); }
unsigned long TrackFixedSegment::getId () const
@ -175,7 +176,19 @@ namespace Katana {
{ return 0.0; }
void TrackFixedSegment::updatePriority ( float )
void TrackFixedSegment::setPriorityLock ( bool )
{ }
void TrackFixedSegment::forcePriority ( float )
{ }
void TrackFixedSegment::computePriority ()
{ }
void TrackFixedSegment::computeAlignedPriority ()
{ }

View File

@ -67,6 +67,7 @@ namespace Katana {
, _data (NULL)
, _priority (0.0)
, _dogLegLevel (0)
, _flags (NoFlags)
{
cdebug_log(155,0) << "CTOR TrackSegment " << (void*)this << ":" << this << endl;
cdebug_log(155,0) << " over " << (void*)segment << ":" << segment << endl;
@ -162,6 +163,8 @@ namespace Katana {
bool TrackSegment::isReduced () const { return _base->isReduced(); }
bool TrackSegment::isUserDefined () const { return _base->isUserDefined(); }
bool TrackSegment::isUTurn () const { return _base->isUTurn(); }
bool TrackSegment::isAnalog () const { return _base->isAnalog(); }
bool TrackSegment::isPriorityLocked () const { return _flags & PriorityLocked; }
// Predicates.
bool TrackSegment::hasSymmetric () const { return _symmetric != NULL; }
// Accessors.
@ -305,22 +308,38 @@ namespace Katana {
}
void TrackSegment::setPriorityLock ( bool state )
{
if (state) _flags |= PriorityLocked;
else _flags &= ~PriorityLocked;
}
void TrackSegment::updateFreedomDegree ()
{ _freedomDegree = _base->getSlack(); }
void TrackSegment::updatePriority ( float forced )
void TrackSegment::forcePriority ( float forced )
{ if (not isPriorityLocked()) _priority = forced; }
void TrackSegment::computePriority ()
{
if (forced != 0.0) { _priority = forced; return; }
if (isPriorityLocked()) return;
if (isAnalog() and isTerminal()) { _priority = 0.0; return; }
double length = DbU::toLambda(getLength());
double slack = DbU::toLambda(base()->getSlack());
double pitch = DbU::toLambda(getPitch());
//if (length > 200.0) length = 200.0 - std::log(length)*20.0;
//if (length < 0.0) length = 0.0;
//if (slack / DbU::toLambda(_segment->getPitch()) < 2.0 ) slack = 999.0;
if (slack / DbU::toLambda(getPitch()) > 10.0) slack = 10.0*getPitch();
if (slack / pitch > 10.0) slack = 10.0*pitch;
//cerr << "TrackSegment::computePriority() length:" << length << " slack:" << slack
// << " pri:" << (length + 1.0) * (slack + 1.0) << " pitch:" << DbU::toLambda(getPitch()) << endl;
_priority = (length + 1.0) * (slack + 1.0);
//if (_priority > 10000.0) cerr << "_priority:" << _priority
@ -431,6 +450,48 @@ namespace Katana {
}
void TrackSegment::computeAlignedPriority ()
{
if (isPriorityLocked() or isTerminal()) return;
computePriority();
AutoSegment* canonical = base();
vector<TrackElement*> sourceAligneds;
vector<TrackElement*> targetAligneds;
for ( AutoSegment* segment : canonical->getAligneds(Flags::Source|Flags::WithDoglegs) ) {
if (not segment->isCanonical()) continue;
sourceAligneds.push_back( Session::lookup(segment) );
}
for ( AutoSegment* segment : canonical->getAligneds(Flags::Target|Flags::WithDoglegs) ) {
if (not segment->isCanonical()) continue;
sourceAligneds.push_back( Session::lookup(segment) );
}
if (sourceAligneds.empty() and targetAligneds.empty()) return;
setPriorityLock( true );
cdebug_log(159,0) << "TrackSegment::computeAlignedPriority() " << this << endl;
cdebug_log(159,0) << "Aligneds on:" << getPriority() << ":" << this << endl;
for ( size_t i=0 ; i<sourceAligneds.size() ; ++i ) {
sourceAligneds[i]->forcePriority( getPriority() - 2.0*(i+1) + 1.0 );
sourceAligneds[i]->setPriorityLock( true );
cdebug_log(159,0) << "| S:" << i << " " << sourceAligneds[i]->getPriority()
<< ":" << sourceAligneds[i] << endl;
}
for ( size_t i=0 ; i<targetAligneds.size() ; ++i ) {
targetAligneds[i]->forcePriority( getPriority() - 2.0*(i+1) );
targetAligneds[i]->setPriorityLock( true );
cdebug_log(159,0) << "| T:" << i << " " << targetAligneds[i]->getPriority()
<< ":" << targetAligneds[i] << endl;
}
}
float TrackSegment::getMaxUnderDensity ( Flags flags ) const
{ return _base->getMaxUnderDensity( flags ); }
@ -911,6 +972,7 @@ namespace Katana {
Record* record = TrackElement::_getRecord();
record->add( getSlot( "_base" , _base ) );
record->add( getSlot( "_symmetric", _symmetric ) );
record->add( getSlot( "_flags" , _flags ) );
return record;
}

View File

@ -115,6 +115,7 @@ namespace Katana {
void run ( Flags flags );
void printStatistics () const;
void _createRouting ( Anabatic::GCell* );
void _computePriorities ();
void _associateSymmetrics ();
void _pack ( size_t& count, bool last );
size_t _negociate ();

View File

@ -39,11 +39,12 @@ namespace Katana {
class TrackCost {
public:
enum Flags { IgnoreAxisWeight = 0x0001
, DiscardGlobals = 0x0002
, IgnoreSharedLength = 0x0004
, LocalAndTopDepth = 0x0008
, ZeroCost = 0x0010
enum Flags { IgnoreAxisWeight = (1 << 0)
, DiscardGlobals = (1 << 1)
, IgnoreSharedLength = (1 << 2)
, LocalAndTopDepth = (1 << 3)
, ZeroCost = (1 << 4)
, Analog = (1 << 5)
};
public:

View File

@ -84,112 +84,116 @@ namespace Katana {
class TrackElement {
public:
static SegmentOverlapCostCB* setOverlapCostCB ( SegmentOverlapCostCB* );
static void notify ( TrackElement*, unsigned int flags );
public:
void destroy ();
virtual AutoSegment* base () const;
virtual Segment* getSegment () const = 0;
// Wrapped AutoSegment Functions (when applicable).
virtual bool isFixed () const;
virtual bool isHorizontal () const = 0;
virtual bool isVertical () const = 0;
virtual bool isLocal () const;
virtual bool isGlobal () const;
virtual bool isBipoint () const;
virtual bool isTerminal () const;
virtual bool isStrongTerminal ( Flags flags=Flags::NoFlags ) const;
virtual bool isStrap () const;
virtual bool isSlackened () const;
virtual bool isDogleg () const;
virtual bool isReduced () const;
virtual bool isUTurn () const;
virtual bool isUserDefined () const;
// Predicates.
inline bool isCreated () const;
inline bool isInvalidated () const;
inline bool isBlockage () const;
inline bool isLocked () const;
inline bool isRouted () const;
virtual bool hasSymmetric () const;
inline bool hasSourceDogleg () const;
inline bool hasTargetDogleg () const;
inline bool canRipple () const;
virtual bool canSlacken () const;
virtual bool canPivotUp ( float reserve, Flags flags ) const;
virtual bool canPivotDown ( float reserve, Flags flags ) const;
virtual bool canMoveUp ( float reserve, Flags flags=Flags::WithPerpands ) const;
virtual bool canDogleg ();
virtual bool canDogleg ( Interval );
virtual bool canDogleg ( Anabatic::GCell*, Flags flags=0 );
// Accessors
inline Observer<TrackElement>* getObserver ();
virtual unsigned long getId () const;
virtual Flags getDirection () const = 0;
virtual Net* getNet () const = 0;
virtual const Layer* getLayer () const = 0;
virtual DbU::Unit getPitch () const;
virtual DbU::Unit getPPitch () const;
inline Track* getTrack () const;
inline size_t getIndex () const;
virtual float getPriority () const = 0;
virtual unsigned long getFreedomDegree () const;
virtual float getMaxUnderDensity ( Flags flags=Flags::NoFlags ) const;
inline Box getBoundingBox () const;
virtual TrackElement* getNext () const;
virtual TrackElement* getPrevious () const;
virtual DbU::Unit getAxis () const = 0;
inline DbU::Unit getSourceU () const;
inline DbU::Unit getTargetU () const;
inline DbU::Unit getLength () const;
inline Interval getCanonicalInterval () const;
virtual Interval getFreeInterval () const;
virtual Interval getSourceConstraints () const;
virtual Interval getTargetConstraints () const;
virtual DataNegociate* getDataNegociate ( Flags flags=Flags::DataSelf ) const;
virtual TrackElement* getCanonical ( Interval& );
virtual size_t getGCells ( vector<GCell*>& ) const;
virtual TrackElement* getParent () const;
virtual uint32_t getDoglegLevel () const;
virtual TrackElement* getSourceDogleg ();
virtual TrackElement* getTargetDogleg ();
virtual TrackElement* getSymmetric ();
virtual TrackElements getPerpandiculars ();
// Mutators.
inline void setFlags ( uint32_t );
inline void unsetFlags ( uint32_t );
inline void setRouted ();
virtual void setTrack ( Track* );
inline void setIndex ( size_t );
virtual void setSymmetric ( TrackElement* );
inline void updatePriority ();
virtual void updatePriority ( float priority ) = 0;
virtual void updateFreedomDegree ();
virtual void setDoglegLevel ( uint32_t );
virtual void swapTrack ( TrackElement* );
virtual void reschedule ( uint32_t level );
virtual void detach ();
virtual void invalidate ();
virtual void revalidate ();
virtual void updatePPitch ();
virtual void incOverlapCost ( Net*, TrackCost& ) const;
virtual void setAxis ( DbU::Unit, uint32_t flags=Anabatic::SegAxisSet );
virtual TrackElement* makeDogleg ();
inline bool makeDogleg ( Anabatic::GCell* );
virtual TrackElement* makeDogleg ( Anabatic::GCell*, TrackElement*& perpandicular, TrackElement*& parallel );
virtual TrackElement* makeDogleg ( Interval, Flags& flags );
virtual void _postDoglegs ( TrackElement*& perpandicular, TrackElement*& parallel );
virtual bool moveAside ( Flags flags );
virtual bool slacken ( Flags flags=Flags::NoFlags );
virtual bool moveUp ( Flags flags );
virtual bool moveDown ( Flags flags );
#if THIS_IS_DISABLED
virtual void desalignate ();
#endif
virtual bool _check () const;
virtual Record* _getRecord () const;
virtual string _getString () const;
virtual string _getTypeName () const;
static SegmentOverlapCostCB* setOverlapCostCB ( SegmentOverlapCostCB* );
static void notify ( TrackElement*, unsigned int flags );
public:
void destroy ();
virtual AutoSegment* base () const;
virtual Segment* getSegment () const = 0;
// Wrapped AutoSegment Functions (when applicable).
virtual bool isFixed () const;
virtual bool isHorizontal () const = 0;
virtual bool isVertical () const = 0;
virtual bool isLocal () const;
virtual bool isGlobal () const;
virtual bool isBipoint () const;
virtual bool isTerminal () const;
virtual bool isStrongTerminal ( Flags flags=Flags::NoFlags ) const;
virtual bool isStrap () const;
virtual bool isSlackened () const;
virtual bool isDogleg () const;
virtual bool isReduced () const;
virtual bool isUTurn () const;
virtual bool isUserDefined () const;
virtual bool isAnalog () const;
virtual bool isPriorityLocked () const = 0;
// Predicates.
inline bool isCreated () const;
inline bool isInvalidated () const;
inline bool isBlockage () const;
inline bool isLocked () const;
inline bool isRouted () const;
virtual bool hasSymmetric () const;
inline bool hasSourceDogleg () const;
inline bool hasTargetDogleg () const;
inline bool canRipple () const;
virtual bool canSlacken () const;
virtual bool canPivotUp ( float reserve, Flags flags ) const;
virtual bool canPivotDown ( float reserve, Flags flags ) const;
virtual bool canMoveUp ( float reserve, Flags flags=Flags::WithPerpands ) const;
virtual bool canDogleg ();
virtual bool canDogleg ( Interval );
virtual bool canDogleg ( Anabatic::GCell*, Flags flags=0 );
// Accessors
inline Observer<TrackElement>* getObserver ();
virtual unsigned long getId () const;
virtual Flags getDirection () const = 0;
virtual Net* getNet () const = 0;
virtual const Layer* getLayer () const = 0;
virtual DbU::Unit getPitch () const;
virtual DbU::Unit getPPitch () const;
inline Track* getTrack () const;
inline size_t getIndex () const;
virtual float getPriority () const = 0;
virtual unsigned long getFreedomDegree () const;
virtual float getMaxUnderDensity ( Flags flags=Flags::NoFlags ) const;
inline Box getBoundingBox () const;
virtual TrackElement* getNext () const;
virtual TrackElement* getPrevious () const;
virtual DbU::Unit getAxis () const = 0;
inline DbU::Unit getSourceU () const;
inline DbU::Unit getTargetU () const;
inline DbU::Unit getLength () const;
inline Interval getCanonicalInterval () const;
virtual Interval getFreeInterval () const;
virtual Interval getSourceConstraints () const;
virtual Interval getTargetConstraints () const;
virtual DataNegociate* getDataNegociate ( Flags flags=Flags::DataSelf ) const;
virtual TrackElement* getCanonical ( Interval& );
virtual size_t getGCells ( vector<GCell*>& ) const;
virtual TrackElement* getParent () const;
virtual uint32_t getDoglegLevel () const;
virtual TrackElement* getSourceDogleg ();
virtual TrackElement* getTargetDogleg ();
virtual TrackElement* getSymmetric ();
virtual TrackElements getPerpandiculars ();
// Mutators.
inline void setFlags ( uint32_t );
inline void unsetFlags ( uint32_t );
inline void setRouted ();
virtual void setTrack ( Track* );
inline void setIndex ( size_t );
virtual void setSymmetric ( TrackElement* );
virtual void setPriorityLock ( bool state ) = 0;
virtual void forcePriority ( float priority ) = 0;
virtual void computePriority () = 0;
virtual void computeAlignedPriority () = 0;
virtual void updateFreedomDegree ();
virtual void setDoglegLevel ( uint32_t );
virtual void swapTrack ( TrackElement* );
virtual void reschedule ( uint32_t level );
virtual void detach ();
virtual void invalidate ();
virtual void revalidate ();
virtual void updatePPitch ();
virtual void incOverlapCost ( Net*, TrackCost& ) const;
virtual void setAxis ( DbU::Unit, uint32_t flags=Anabatic::SegAxisSet );
virtual TrackElement* makeDogleg ();
inline bool makeDogleg ( Anabatic::GCell* );
virtual TrackElement* makeDogleg ( Anabatic::GCell*, TrackElement*& perpandicular, TrackElement*& parallel );
virtual TrackElement* makeDogleg ( Interval, Flags& flags );
virtual void _postDoglegs ( TrackElement*& perpandicular, TrackElement*& parallel );
virtual bool moveAside ( Flags flags );
virtual bool slacken ( Flags flags=Flags::NoFlags );
virtual bool moveUp ( Flags flags );
virtual bool moveDown ( Flags flags );
#if THIS_IS_DISABLED
virtual void desalignate ();
#endif
virtual bool _check () const;
virtual Record* _getRecord () const;
virtual string _getString () const;
virtual string _getTypeName () const;
protected:
// Static Attributes.
@ -234,7 +238,6 @@ namespace Katana {
inline DbU::Unit TrackElement::getTargetU () const { return _targetU; }
inline Interval TrackElement::getCanonicalInterval () const { return Interval(getSourceU(),getTargetU()); }
inline void TrackElement::setIndex ( size_t index ) { _index=index; }
inline void TrackElement::updatePriority () { updatePriority( 0.0 ); }
inline void TrackElement::setRouted()
{

View File

@ -38,26 +38,30 @@ namespace Katana {
class TrackFixedSegment : public TrackElement {
public:
static TrackElement* create ( Katana::Track* track , Segment* segment );
public:
virtual AutoSegment* base () const;
virtual Segment* getSegment () const;
virtual bool isHorizontal () const;
virtual bool isVertical () const;
virtual bool isFixed () const;
virtual unsigned long getId () const;
virtual Flags getDirection () const;
virtual Net* getNet () const;
virtual const Layer* getLayer () const;
virtual TrackElement* getNext () const;
virtual TrackElement* getPrevious () const;
virtual DbU::Unit getAxis () const;
virtual Interval getFreeInterval () const;
virtual float getPriority () const;
virtual void updatePriority ( float );
virtual Record* _getRecord () const;
virtual string _getString () const;
virtual string _getTypeName () const;
static TrackElement* create ( Katana::Track* track , Segment* segment );
public:
virtual AutoSegment* base () const;
virtual Segment* getSegment () const;
virtual bool isHorizontal () const;
virtual bool isVertical () const;
virtual bool isFixed () const;
virtual bool isPriorityLocked () const;
virtual unsigned long getId () const;
virtual Flags getDirection () const;
virtual Net* getNet () const;
virtual const Layer* getLayer () const;
virtual TrackElement* getNext () const;
virtual TrackElement* getPrevious () const;
virtual DbU::Unit getAxis () const;
virtual Interval getFreeInterval () const;
virtual float getPriority () const;
virtual void setPriorityLock ( bool );
virtual void forcePriority ( float );
virtual void computePriority ();
virtual void computeAlignedPriority ();
virtual Record* _getRecord () const;
virtual string _getString () const;
virtual string _getTypeName () const;
protected:
// Attributes.
static Net* _blockageNet;

View File

@ -43,6 +43,11 @@ namespace Katana {
// -------------------------------------------------------------------
// Class : "TrackSegment".
enum TrackSegmentFlag { NoFlags = 0
, PriorityLocked = (1 << 0)
};
class TrackSegment : public TrackElement {
public:
class CompareById : public binary_function<const TrackSegment*,const TrackSegment*,bool> {
@ -71,6 +76,8 @@ namespace Katana {
virtual bool isReduced () const;
virtual bool isUTurn () const;
virtual bool isUserDefined () const;
virtual bool isAnalog () const;
virtual bool isPriorityLocked () const;
// Predicates.
virtual bool hasSymmetric () const;
virtual bool canDogleg ();
@ -108,7 +115,10 @@ namespace Katana {
// Mutators.
virtual void setTrack ( Track* );
virtual void setSymmetric ( TrackElement* );
virtual void updatePriority ( float );
virtual void setPriorityLock ( bool state );
virtual void forcePriority ( float );
virtual void computePriority ();
virtual void computeAlignedPriority ();
virtual void updateFreedomDegree ();
virtual void setDoglegLevel ( uint32_t );
virtual void swapTrack ( TrackElement* );
@ -144,6 +154,7 @@ namespace Katana {
DataNegociate* _data;
float _priority;
unsigned int _dogLegLevel:4;
uint32_t _flags;
protected:
// Constructors & Destructors.