* ./kite:
- Change: Big cleanup. Supress all the GCell level: GCell, GCellGrid, GCellRoutingSet. Blockages now managed inside the BuildPower. - New: In NegociateWindow, Histogram of GCell densities in Gnuplot format.
This commit is contained in:
parent
011be5487b
commit
c9e1c3101a
|
@ -1,445 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Module : "./QueryBlockages.cpp" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
|
|
||||||
#include "hurricane/DataBase.h"
|
|
||||||
#include "hurricane/Technology.h"
|
|
||||||
#include "hurricane/BasicLayer.h"
|
|
||||||
#include "hurricane/RegularLayer.h"
|
|
||||||
#include "hurricane/Query.h"
|
|
||||||
#include "kite/RoutingPlane.h"
|
|
||||||
#include "kite/TrackBlockage.h"
|
|
||||||
#include "kite/Track.h"
|
|
||||||
#include "kite/KiteEngine.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using Hurricane::tab;
|
|
||||||
using Hurricane::inltrace;
|
|
||||||
using Hurricane::DbU;
|
|
||||||
using Hurricane::Box;
|
|
||||||
using Hurricane::Interval;
|
|
||||||
using Hurricane::Query;
|
|
||||||
using Hurricane::Go;
|
|
||||||
using Hurricane::Rubber;
|
|
||||||
using Hurricane::Layer;
|
|
||||||
using Hurricane::BasicLayer;
|
|
||||||
using Hurricane::RegularLayer;
|
|
||||||
using Hurricane::Transformation;
|
|
||||||
using namespace Kite;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "::BlockagesPlanes".
|
|
||||||
|
|
||||||
|
|
||||||
class BlockagesPlanes {
|
|
||||||
private:
|
|
||||||
class Track {
|
|
||||||
public:
|
|
||||||
Track ( Kite::Track* );
|
|
||||||
void add ( Interval );
|
|
||||||
inline DbU::Unit getAxis () const;
|
|
||||||
void dump ( DbU::Unit width );
|
|
||||||
private:
|
|
||||||
Kite::Track* _ktrack;
|
|
||||||
list<Interval> _blockages;
|
|
||||||
};
|
|
||||||
private:
|
|
||||||
class Plane {
|
|
||||||
public:
|
|
||||||
Plane ( RoutingPlane* );
|
|
||||||
~Plane ();
|
|
||||||
void merge ( Box boundingBox );
|
|
||||||
inline unsigned int getDirection () const;
|
|
||||||
inline const Layer* getLayer () const;
|
|
||||||
inline DbU::Unit getHalfWireWidth () const;
|
|
||||||
inline DbU::Unit getHalfPitch () const;
|
|
||||||
void dump ();
|
|
||||||
private:
|
|
||||||
RoutingPlane* _routingPlane;
|
|
||||||
Interval _axisSpan;
|
|
||||||
vector<Track*> _tracks;
|
|
||||||
};
|
|
||||||
public:
|
|
||||||
static Track* createTrack ( Kite::Track* );
|
|
||||||
public:
|
|
||||||
BlockagesPlanes ( KiteEngine* );
|
|
||||||
~BlockagesPlanes ();
|
|
||||||
bool hasPlane ( const BasicLayer* );
|
|
||||||
bool setActivePlane ( const BasicLayer* );
|
|
||||||
inline Plane* getActivePlane () const;
|
|
||||||
void add ( Box boundingBox );
|
|
||||||
void dump ();
|
|
||||||
private:
|
|
||||||
KiteEngine* _kite;
|
|
||||||
map<const BasicLayer*,Plane*> _planes;
|
|
||||||
Plane* _activePlane;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
BlockagesPlanes::Track::Track ( Kite::Track* ktrack )
|
|
||||||
: _ktrack(ktrack)
|
|
||||||
, _blockages()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
inline DbU::Unit BlockagesPlanes::Track::getAxis () const { return _ktrack->getAxis(); }
|
|
||||||
|
|
||||||
|
|
||||||
void BlockagesPlanes::Track::add ( Interval obstacle )
|
|
||||||
{
|
|
||||||
if ( (obstacle.getVMax() <= _ktrack->getMin())
|
|
||||||
or (obstacle.getVMin() >= _ktrack->getMax()) ) return;
|
|
||||||
|
|
||||||
list<Interval>::iterator imerge = _blockages.end();
|
|
||||||
list<Interval>::iterator iblockage = _blockages.begin();
|
|
||||||
|
|
||||||
while ( iblockage != _blockages.end() ) {
|
|
||||||
if ( obstacle.getVMax() < (*iblockage).getVMin() ) break;
|
|
||||||
|
|
||||||
if ( obstacle.intersect(*iblockage) ) {
|
|
||||||
if ( imerge == _blockages.end() ) {
|
|
||||||
imerge = iblockage;
|
|
||||||
(*imerge).merge ( obstacle );
|
|
||||||
} else {
|
|
||||||
(*imerge).merge ( *iblockage );
|
|
||||||
iblockage = _blockages.erase ( iblockage );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iblockage++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( imerge == _blockages.end() ) {
|
|
||||||
_blockages.insert ( iblockage, obstacle );
|
|
||||||
ltrace(190) << "| Add on " << DbU::getValueString(_ktrack->getAxis()) << " " << obstacle << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BlockagesPlanes::Track::dump ( DbU::Unit width )
|
|
||||||
{
|
|
||||||
list<Interval>::iterator iinterval = _blockages.begin();
|
|
||||||
|
|
||||||
if ( _ktrack->getDirection() == Constant::Horizontal ) {
|
|
||||||
DbU::Unit ymin = _ktrack->getAxis() - width/2;
|
|
||||||
DbU::Unit ymax = _ktrack->getAxis() + width/2;
|
|
||||||
|
|
||||||
for ( ; iinterval != _blockages.end() ; iinterval++ ) {
|
|
||||||
Box bb ( (*iinterval).getVMin(), ymin, (*iinterval).getVMax(), ymax );
|
|
||||||
TrackBlockage::create ( _ktrack, bb );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
DbU::Unit xmin = _ktrack->getAxis() - width/2;
|
|
||||||
DbU::Unit xmax = _ktrack->getAxis() + width/2;
|
|
||||||
|
|
||||||
for ( ; iinterval != _blockages.end() ; iinterval++ ) {
|
|
||||||
Box bb ( xmin, (*iinterval).getVMin(), xmax, (*iinterval).getVMax() );
|
|
||||||
TrackBlockage::create ( _ktrack, bb );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BlockagesPlanes::Plane::Plane ( RoutingPlane* plane )
|
|
||||||
: _routingPlane(plane)
|
|
||||||
, _axisSpan (plane->getAxisMin(),plane->getAxisMax())
|
|
||||||
, _tracks ()
|
|
||||||
{
|
|
||||||
Kite::Track* ktrack = plane->getTrackByIndex(0);
|
|
||||||
|
|
||||||
for ( ; ktrack != NULL ; ktrack=ktrack->getNext() ) {
|
|
||||||
_tracks.push_back ( BlockagesPlanes::createTrack(ktrack) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BlockagesPlanes::Plane::~Plane ()
|
|
||||||
{
|
|
||||||
for ( size_t i=0 ; i<_tracks.size() ; i++ ) delete _tracks[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline unsigned int BlockagesPlanes::Plane::getDirection () const { return _routingPlane->getDirection(); }
|
|
||||||
inline const Layer* BlockagesPlanes::Plane::getLayer () const { return _routingPlane->getLayer(); }
|
|
||||||
inline DbU::Unit BlockagesPlanes::Plane::getHalfWireWidth () const { return _routingPlane->getLayerGauge()->getHalfWireWidth(); }
|
|
||||||
inline DbU::Unit BlockagesPlanes::Plane::getHalfPitch () const { return _routingPlane->getLayerGauge()->getHalfPitch(); }
|
|
||||||
|
|
||||||
|
|
||||||
void BlockagesPlanes::Plane::merge ( Box boundingBox )
|
|
||||||
{
|
|
||||||
ltrace(190) << "| Add on plane " << _routingPlane->getLayer() << " " << boundingBox << endl;
|
|
||||||
|
|
||||||
DbU::Unit delta = getHalfPitch() - getHalfWireWidth() - DbU::lambda(0.1);
|
|
||||||
|
|
||||||
if ( getDirection() == Constant::Horizontal ) {
|
|
||||||
boundingBox.inflate ( 0, delta, 0, delta );
|
|
||||||
|
|
||||||
ltrace(190) << "Track range: " << DbU::getValueString(boundingBox.getYMin())
|
|
||||||
<< ":" << DbU::getValueString(boundingBox.getYMax()) << endl;
|
|
||||||
for ( size_t i=0 ; (i<_tracks.size()) and (_tracks[i]->getAxis() < boundingBox.getYMax()) ; i++ ) {
|
|
||||||
if ( _tracks[i]->getAxis() < boundingBox.getYMin() ) continue;
|
|
||||||
|
|
||||||
_tracks[i]->add ( Interval(boundingBox.getXMin(),boundingBox.getXMax()) );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
boundingBox.inflate ( delta, 0, delta, 0 );
|
|
||||||
for ( size_t i=0 ; (i<_tracks.size()) and (_tracks[i]->getAxis() < boundingBox.getXMax()) ; i++ ) {
|
|
||||||
if ( _tracks[i]->getAxis() < boundingBox.getXMin() ) continue;
|
|
||||||
|
|
||||||
_tracks[i]->add ( Interval(boundingBox.getYMin(),boundingBox.getYMax()) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BlockagesPlanes::Plane::dump ()
|
|
||||||
{
|
|
||||||
for ( size_t i=0 ; i<_tracks.size() ; i++ ) _tracks[i]->dump(DbU::lambda(2.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BlockagesPlanes::Track* BlockagesPlanes::createTrack ( Kite::Track* ktrack )
|
|
||||||
{ return new Track ( ktrack ); }
|
|
||||||
|
|
||||||
|
|
||||||
BlockagesPlanes::BlockagesPlanes ( KiteEngine* kite )
|
|
||||||
: _kite (kite)
|
|
||||||
, _planes ()
|
|
||||||
, _activePlane(NULL)
|
|
||||||
{
|
|
||||||
RoutingGauge* rg = _kite->getConfiguration()->getRoutingGauge();
|
|
||||||
size_t gaugeDepth = rg->getDepth ();
|
|
||||||
|
|
||||||
for ( size_t depth=0 ; depth<gaugeDepth ; depth++ ) {
|
|
||||||
const RegularLayer* routingLayer = dynamic_cast<const RegularLayer*>(rg->getRoutingLayer(depth));
|
|
||||||
if ( not routingLayer ) continue;
|
|
||||||
|
|
||||||
const BasicLayer* blockageLayer = routingLayer->getBasicLayer()->getBlockageLayer();
|
|
||||||
if ( not blockageLayer ) continue;
|
|
||||||
|
|
||||||
_planes.insert ( make_pair(blockageLayer,new Plane(_kite->getRoutingPlaneByIndex(depth))) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BlockagesPlanes::~BlockagesPlanes ()
|
|
||||||
{
|
|
||||||
while ( not _planes.empty() ) {
|
|
||||||
delete _planes.begin()->second;
|
|
||||||
_planes.erase ( _planes.begin() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool BlockagesPlanes::hasPlane ( const BasicLayer* basicLayer )
|
|
||||||
{ return (_planes.find(basicLayer) != _planes.end()); }
|
|
||||||
|
|
||||||
|
|
||||||
bool BlockagesPlanes::setActivePlane ( const BasicLayer* basicLayer )
|
|
||||||
{
|
|
||||||
map<const BasicLayer*,Plane*>::iterator iplane = _planes.find(basicLayer);
|
|
||||||
if ( iplane == _planes.end() ) return false;
|
|
||||||
|
|
||||||
_activePlane = iplane->second;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline BlockagesPlanes::Plane* BlockagesPlanes::getActivePlane () const
|
|
||||||
{ return _activePlane; }
|
|
||||||
|
|
||||||
|
|
||||||
void BlockagesPlanes::add ( Box boundingBox )
|
|
||||||
{
|
|
||||||
if ( not _activePlane ) return;
|
|
||||||
_activePlane->merge ( boundingBox );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BlockagesPlanes::dump ()
|
|
||||||
{
|
|
||||||
map<const BasicLayer*,Plane*>::iterator iplane = _planes.begin();
|
|
||||||
for ( ; iplane != _planes.end() ; iplane++ ) {
|
|
||||||
iplane->second->dump();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "::QueryBlockages".
|
|
||||||
|
|
||||||
|
|
||||||
class QueryBlockages : public Query {
|
|
||||||
public:
|
|
||||||
QueryBlockages ( KiteEngine* );
|
|
||||||
virtual bool hasGoCallback () const;
|
|
||||||
virtual bool hasPlane ( const BasicLayer* );
|
|
||||||
virtual void setBasicLayer ( const BasicLayer* );
|
|
||||||
virtual void goCallback ( Go* );
|
|
||||||
virtual void rubberCallback ( Rubber* );
|
|
||||||
virtual void extensionGoCallback ( Go* );
|
|
||||||
virtual void masterCellCallback ();
|
|
||||||
void addBlockage ( const Go* go
|
|
||||||
, const BasicLayer* basicLayer
|
|
||||||
, const Box& area
|
|
||||||
, const Transformation& transformation
|
|
||||||
);
|
|
||||||
virtual void doQuery ();
|
|
||||||
inline void dump ();
|
|
||||||
inline unsigned int getBlockagesCount () const;
|
|
||||||
private:
|
|
||||||
KiteEngine* _kite;
|
|
||||||
BlockagesPlanes _blockagesPlanes;
|
|
||||||
unsigned int _blockagesCount;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
QueryBlockages::QueryBlockages ( KiteEngine* kite )
|
|
||||||
: Query ()
|
|
||||||
, _kite (kite)
|
|
||||||
, _blockagesPlanes(kite)
|
|
||||||
, _blockagesCount (0)
|
|
||||||
{
|
|
||||||
setCell ( kite->getCell() );
|
|
||||||
setArea ( kite->getCell()->getBoundingBox() );
|
|
||||||
setBasicLayer ( NULL );
|
|
||||||
setFilter ( Query::DoTerminalCells|Query::DoComponents );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline unsigned int QueryBlockages::getBlockagesCount () const
|
|
||||||
{ return _blockagesCount; }
|
|
||||||
|
|
||||||
|
|
||||||
inline void QueryBlockages::dump ()
|
|
||||||
{ return _blockagesPlanes.dump(); }
|
|
||||||
|
|
||||||
|
|
||||||
bool QueryBlockages::hasPlane ( const BasicLayer* basicLayer )
|
|
||||||
{ return _blockagesPlanes.hasPlane(basicLayer); }
|
|
||||||
|
|
||||||
|
|
||||||
void QueryBlockages::setBasicLayer ( const BasicLayer* basicLayer )
|
|
||||||
{
|
|
||||||
_blockagesPlanes.setActivePlane ( basicLayer );
|
|
||||||
Query::setBasicLayer ( basicLayer );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void QueryBlockages::doQuery ()
|
|
||||||
{
|
|
||||||
if ( not _blockagesPlanes.getActivePlane() ) return;
|
|
||||||
Query::doQuery ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void QueryBlockages::masterCellCallback ()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
bool QueryBlockages::hasGoCallback () const
|
|
||||||
{ return true; }
|
|
||||||
|
|
||||||
|
|
||||||
void QueryBlockages::goCallback ( Go* go )
|
|
||||||
{
|
|
||||||
addBlockage ( go, getBasicLayer(), getArea(), getTransformation() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void QueryBlockages::addBlockage ( const Go* go
|
|
||||||
, const BasicLayer* basicLayer
|
|
||||||
, const Box& area
|
|
||||||
, const Transformation& transformation
|
|
||||||
)
|
|
||||||
{
|
|
||||||
const Component* component = dynamic_cast<const Component*>(go);
|
|
||||||
if ( component ) {
|
|
||||||
_blockagesCount++;
|
|
||||||
Box bb ( transformation.getBox(component->getBoundingBox(basicLayer)) );
|
|
||||||
ltrace(190) << "Blockage: " << bb << " in " << basicLayer->getName() << endl;
|
|
||||||
|
|
||||||
_blockagesPlanes.add ( bb );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void QueryBlockages::rubberCallback ( Rubber* )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
void QueryBlockages::extensionGoCallback ( Go* )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
} // End of anonymous namespace.
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using Hurricane::DataBase;
|
|
||||||
using Hurricane::Technology;
|
|
||||||
using Hurricane::BasicLayer;
|
|
||||||
using Hurricane::ForEachIterator;
|
|
||||||
|
|
||||||
|
|
||||||
void KiteEngine::buildBlockages ()
|
|
||||||
{
|
|
||||||
cmess1 << " o Building blockages." << endl;
|
|
||||||
|
|
||||||
if ( not _blockageNet ) {
|
|
||||||
_blockageNet = getCell()->getNet("blockagenet");
|
|
||||||
if ( not _blockageNet )
|
|
||||||
_blockageNet = Net::create ( getCell(), "blockagenet" );
|
|
||||||
}
|
|
||||||
|
|
||||||
QueryBlockages query ( this );
|
|
||||||
Technology* technology = DataBase::getDB()->getTechnology();
|
|
||||||
|
|
||||||
forEach ( BasicLayer*, iLayer, technology->getBasicLayers() ) {
|
|
||||||
if ( iLayer->getMaterial() != BasicLayer::Material::blockage ) continue;
|
|
||||||
if ( not query.hasPlane(*iLayer) ) continue;
|
|
||||||
|
|
||||||
cmess1 << " - Blockages in " << iLayer->getName() << " ..." << endl;
|
|
||||||
|
|
||||||
query.setBasicLayer ( *iLayer );
|
|
||||||
query.doQuery ();
|
|
||||||
}
|
|
||||||
query.dump ();
|
|
||||||
cmess1 << " - " << query.getBlockagesCount() << " blockages found." << endl;
|
|
||||||
|
|
||||||
Session::revalidate ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
|
@ -12,7 +12,6 @@
|
||||||
kite/DataNegociate.h
|
kite/DataNegociate.h
|
||||||
kite/TrackElement.h kite/TrackElements.h
|
kite/TrackElement.h kite/TrackElements.h
|
||||||
kite/TrackSegment.h
|
kite/TrackSegment.h
|
||||||
kite/TrackBlockage.h
|
|
||||||
kite/TrackFixedSegment.h
|
kite/TrackFixedSegment.h
|
||||||
kite/TrackMarker.h
|
kite/TrackMarker.h
|
||||||
kite/Track.h
|
kite/Track.h
|
||||||
|
@ -23,9 +22,6 @@
|
||||||
kite/RoutingEvent.h
|
kite/RoutingEvent.h
|
||||||
kite/RoutingEventQueue.h
|
kite/RoutingEventQueue.h
|
||||||
kite/RoutingEventHistory.h
|
kite/RoutingEventHistory.h
|
||||||
kite/GCell.h
|
|
||||||
kite/GCellGrid.h
|
|
||||||
kite/GCellRoutingSet.h
|
|
||||||
kite/RoutingPlane.h
|
kite/RoutingPlane.h
|
||||||
kite/NegociateWindow.h
|
kite/NegociateWindow.h
|
||||||
kite/Configuration.h
|
kite/Configuration.h
|
||||||
|
@ -39,7 +35,6 @@
|
||||||
TrackElement.cpp
|
TrackElement.cpp
|
||||||
TrackElements.cpp
|
TrackElements.cpp
|
||||||
TrackSegment.cpp
|
TrackSegment.cpp
|
||||||
TrackBlockage.cpp
|
|
||||||
TrackFixedSegment.cpp
|
TrackFixedSegment.cpp
|
||||||
TrackMarker.cpp
|
TrackMarker.cpp
|
||||||
Track.cpp
|
Track.cpp
|
||||||
|
@ -50,11 +45,7 @@
|
||||||
RoutingEvent.cpp
|
RoutingEvent.cpp
|
||||||
RoutingEventQueue.cpp
|
RoutingEventQueue.cpp
|
||||||
RoutingEventHistory.cpp
|
RoutingEventHistory.cpp
|
||||||
GCell.cpp
|
|
||||||
GCellGrid.cpp
|
|
||||||
GCellRoutingSet.cpp
|
|
||||||
RoutingPlane.cpp
|
RoutingPlane.cpp
|
||||||
BuildBlockages.cpp
|
|
||||||
BuildPowerRails.cpp
|
BuildPowerRails.cpp
|
||||||
ProtectRoutingPads.cpp
|
ProtectRoutingPads.cpp
|
||||||
PreProcess.cpp
|
PreProcess.cpp
|
||||||
|
|
|
@ -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
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -44,12 +44,8 @@ namespace Kite {
|
||||||
: _routingEvent(NULL)
|
: _routingEvent(NULL)
|
||||||
, _trackSegment(trackSegment)
|
, _trackSegment(trackSegment)
|
||||||
, _cost (trackSegment)
|
, _cost (trackSegment)
|
||||||
, _gcellOrder ((unsigned int)-1)
|
|
||||||
, _state (RipupPerpandiculars)
|
, _state (RipupPerpandiculars)
|
||||||
, _stateCount (1)
|
, _stateCount (1)
|
||||||
, _leftBorder (false)
|
|
||||||
, _rightBorder (false)
|
|
||||||
, _ring (false)
|
|
||||||
//, _z (RoutingGauge::getLayerDepth(trackSegment->getLayer()))
|
//, _z (RoutingGauge::getLayerDepth(trackSegment->getLayer()))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -59,9 +55,7 @@ namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
void DataNegociate::update ()
|
void DataNegociate::update ()
|
||||||
{
|
{ _cost.update ( _trackSegment ); }
|
||||||
_cost.update ( _trackSegment );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string DataNegociate::_getString () const
|
string DataNegociate::_getString () const
|
||||||
|
@ -78,7 +72,6 @@ namespace Kite {
|
||||||
record->add ( getSlot ( "_routingEvent", _routingEvent ) );
|
record->add ( getSlot ( "_routingEvent", _routingEvent ) );
|
||||||
record->add ( getSlot ( "_trackSegment", _trackSegment ) );
|
record->add ( getSlot ( "_trackSegment", _trackSegment ) );
|
||||||
record->add ( getSlot ( "_cost" , &_cost ) );
|
record->add ( getSlot ( "_cost" , &_cost ) );
|
||||||
record->add ( getSlot ( "_gcellOrder" , _gcellOrder ) );
|
|
||||||
//record->add ( getSlot ( "_z" , _z ) );
|
//record->add ( getSlot ( "_z" , _z ) );
|
||||||
|
|
||||||
return record;
|
return record;
|
||||||
|
|
|
@ -1,576 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Module : "./GCell.cpp" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
#include <sstream>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "hurricane/DebugSession.h"
|
|
||||||
#include "hurricane/Bug.h"
|
|
||||||
#include "hurricane/Error.h"
|
|
||||||
#include "hurricane/Warning.h"
|
|
||||||
#include "hurricane/Component.h"
|
|
||||||
#include "hurricane/RoutingPad.h"
|
|
||||||
#include "katabatic/AutoSegment.h"
|
|
||||||
#include "katabatic/AutoContact.h"
|
|
||||||
#include "kite/DataNegociate.h"
|
|
||||||
#include "kite/TrackSegment.h"
|
|
||||||
#include "kite/RoutingPlane.h"
|
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/GCellGrid.h"
|
|
||||||
#include "kite/NegociateWindow.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
using namespace Hurricane;
|
|
||||||
using namespace Kite;
|
|
||||||
|
|
||||||
|
|
||||||
TrackElement* getCandidate ( RoutingPad* rp, Box bb )
|
|
||||||
{
|
|
||||||
size_t depth = Session::getConfiguration()->getLayerDepth ( rp->getLayer() );
|
|
||||||
if ( depth > 2 ) return NULL;
|
|
||||||
|
|
||||||
DebugSession::open ( rp->getNet(), 200 );
|
|
||||||
|
|
||||||
//if ( (depth != 0) and (depth != 2) ) return NULL;
|
|
||||||
|
|
||||||
ltrace(200) << "depth: " << depth << " " << rp->getSourcePosition() << " " << rp << endl;
|
|
||||||
|
|
||||||
if ( depth%2 == 0 ) {
|
|
||||||
// Propagate from vertical Terminals.
|
|
||||||
forEach ( Contact*, icontact, rp->getSlaveComponents().getSubSet<Contact*>() ) {
|
|
||||||
if ( not bb.contains(icontact->getCenter()) ) continue;
|
|
||||||
|
|
||||||
forEach ( Segment*, isegment, icontact->getSlaveComponents().getSubSet<Segment*>() ) {
|
|
||||||
TrackElement* autoSegment = Session::lookup(*isegment);
|
|
||||||
if ( not autoSegment or autoSegment->isFixed() ) continue;
|
|
||||||
|
|
||||||
DebugSession::close ();
|
|
||||||
return autoSegment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
#if DISABLED
|
|
||||||
// Propage from Horizontal Terminals.
|
|
||||||
bool hasM3protect = false;
|
|
||||||
AutoContact* toContact = NULL;
|
|
||||||
|
|
||||||
forEach ( Contact*, icontact, rp->getSlaveComponents().getSubSet<Contact*>() ) {
|
|
||||||
if ( not bb.contains(icontact->getCenter()) ) continue;
|
|
||||||
|
|
||||||
forEach ( Segment*, isegment, icontact->getSlaveComponents().getSubSet<Segment*>() ) {
|
|
||||||
TrackElement* autoSegment = Session::lookup(*isegment);
|
|
||||||
if ( not autoSegment ) continue;
|
|
||||||
if ( autoSegment->isFixed() ) {
|
|
||||||
if ( Session::getConfiguration()->getLayerDepth(autoSegment->getLayer()) == 2 ) {
|
|
||||||
ltrace(200) << "M3 protection found for " << rp << endl;
|
|
||||||
hasM3protect = true;
|
|
||||||
}
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
toContact = autoSegment->base()->getAutoSource();
|
|
||||||
if ( toContact->base() == *icontact )
|
|
||||||
toContact = autoSegment->base()->getAutoTarget();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find M3 associated to this terminal.
|
|
||||||
if ( hasM3protect ) {
|
|
||||||
if ( toContact ) {
|
|
||||||
ltrace(200) << "toContact: " << toContact << endl;
|
|
||||||
forEach ( Segment*, isegment, toContact->base()->getSlaveComponents().getSubSet<Segment*>() ) {
|
|
||||||
ltrace(200) << "| slave: " << *isegment << endl;
|
|
||||||
if ( Session::getConfiguration()->getLayerDepth(isegment->getLayer()) == 2 ) {
|
|
||||||
TrackElement* autoSegment = Session::lookup(*isegment);
|
|
||||||
ltrace(200) << "M3 candidate: " << autoSegment << endl;
|
|
||||||
DebugSession::close ();
|
|
||||||
return autoSegment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
DebugSession::close ();
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using std::cerr;
|
|
||||||
using std::endl;
|
|
||||||
using std::swap;
|
|
||||||
using std::numeric_limits;
|
|
||||||
using Hurricane::tab;
|
|
||||||
using Hurricane::inltrace;
|
|
||||||
using Hurricane::ltracein;
|
|
||||||
using Hurricane::ltraceout;
|
|
||||||
using Hurricane::roundfp;
|
|
||||||
using Hurricane::Bug;
|
|
||||||
using Hurricane::Error;
|
|
||||||
using Hurricane::Warning;
|
|
||||||
using Hurricane::ForEachIterator;
|
|
||||||
using Hurricane::Component;
|
|
||||||
using Hurricane::RoutingPad;
|
|
||||||
|
|
||||||
using Katabatic::AutoContact;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "Kite::GCell::CompareByDensity".
|
|
||||||
//
|
|
||||||
// lhs < rhs --> true
|
|
||||||
|
|
||||||
|
|
||||||
bool GCell::CompareByDensity::operator() ( GCell* lhs, GCell* rhs )
|
|
||||||
{
|
|
||||||
//int difference = floatCompare ( lhs->base()->getDensity(), rhs->base()->getDensity() );
|
|
||||||
//if ( abs(difference) > 1000 ) return difference > 0;
|
|
||||||
|
|
||||||
float difference = roundfp ( lhs->base()->getDensity() - rhs->base()->getDensity() );
|
|
||||||
if ( difference != 0.0 ) return (difference > 0.0);
|
|
||||||
|
|
||||||
if ( lhs->getIndex() < rhs->getIndex() ) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "Kite::GCell::CompareByStiffness".
|
|
||||||
//
|
|
||||||
// lhs < rhs --> true
|
|
||||||
|
|
||||||
|
|
||||||
bool GCell::CompareByStiffness::operator() ( GCell* lhs, GCell* rhs )
|
|
||||||
{
|
|
||||||
if ( lhs->isRouted() xor rhs->isRouted() ) return rhs->isRouted();
|
|
||||||
|
|
||||||
float difference = roundfp ( lhs->getStiffness() - rhs->getStiffness() );
|
|
||||||
if ( difference != 0.0 ) return (difference > 0.0);
|
|
||||||
|
|
||||||
return lhs->getIndex() < rhs->getIndex();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "Kite::GCell".
|
|
||||||
|
|
||||||
|
|
||||||
GCell::GCell ( GCellGrid* grid, Katabatic::GCell* gcell )
|
|
||||||
: _gcellGrid (grid)
|
|
||||||
, _base (gcell)
|
|
||||||
, _segments ()
|
|
||||||
, _order (numeric_limits<unsigned int>::max())
|
|
||||||
, _isInRoutingSet (false)
|
|
||||||
, _isRouted (false)
|
|
||||||
{
|
|
||||||
if ( !gcell )
|
|
||||||
cerr << Bug("GCell:GCell() - NULL base.") << endl;
|
|
||||||
|
|
||||||
_leftSegments [0] = NULL;
|
|
||||||
_leftSegments [1] = NULL;
|
|
||||||
_rightSegments[0] = NULL;
|
|
||||||
_rightSegments[1] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCell* GCell::create ( GCellGrid* grid, Katabatic::GCell* gcell )
|
|
||||||
{
|
|
||||||
GCell* kiteGCell = new GCell ( grid, gcell );
|
|
||||||
|
|
||||||
ltrace(90) << "Kite::GCell::create() - " << (void*)kiteGCell << " " << kiteGCell << endl;
|
|
||||||
|
|
||||||
return kiteGCell;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCell::~GCell ()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
void GCell::destroy ()
|
|
||||||
{
|
|
||||||
ltrace(90) << "Kite::GCell::destroy() - " << (void*)this << " " << this << endl;
|
|
||||||
ltracein(90);
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i < _segments.size() ; i++ ) {
|
|
||||||
if ( !_segments[i]->getTrack() )
|
|
||||||
_segments[i]->destroy ();
|
|
||||||
else {
|
|
||||||
cerr << Error("%s still bound to a track!\n"
|
|
||||||
" (not deleted: let's get the memory leak)"
|
|
||||||
,getString(_segments[i]).c_str()
|
|
||||||
) << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
delete this;
|
|
||||||
|
|
||||||
ltraceout(90);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCell* GCell::getLeft () const
|
|
||||||
{
|
|
||||||
return _gcellGrid->getGCellLeft(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCell* GCell::getRight () const
|
|
||||||
{
|
|
||||||
return _gcellGrid->getGCellRight(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCell* GCell::getUp () const
|
|
||||||
{
|
|
||||||
return _gcellGrid->getGCellUp(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCell* GCell::getDown () const
|
|
||||||
{
|
|
||||||
return _gcellGrid->getGCellDown(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool GCell::areDensityConnex ( GCell* a, GCell* b )
|
|
||||||
{ return Katabatic::GCell::areDensityConnex ( a->base(), b->base() ); }
|
|
||||||
|
|
||||||
|
|
||||||
GCell* GCell::getLowestOrder ( TrackElement* trackSegment )
|
|
||||||
{
|
|
||||||
vector<GCell*> gcells;
|
|
||||||
trackSegment->getGCells ( gcells );
|
|
||||||
|
|
||||||
if ( gcells.empty() ) return NULL;
|
|
||||||
|
|
||||||
size_t ilower = 0;
|
|
||||||
for ( size_t i=0 ; i<gcells.size() ; i++ )
|
|
||||||
if ( gcells[i]->getOrder() < gcells[ilower]->getOrder() )
|
|
||||||
ilower = i;
|
|
||||||
|
|
||||||
return gcells[ilower];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCell::loadRouting ( unsigned int order )
|
|
||||||
{
|
|
||||||
_segments.clear ();
|
|
||||||
_order = order;
|
|
||||||
|
|
||||||
ltrace(200) << "GCell::loadRouting() - " << this << " Session:" << Session::getOrder() << endl;
|
|
||||||
ltracein(200);
|
|
||||||
|
|
||||||
Segment* segment;
|
|
||||||
AutoSegment* autoSegment;
|
|
||||||
|
|
||||||
ltrace(149) << "AutoSegments from AutoContacts" << endl;
|
|
||||||
vector<AutoContact*>* contacts = getContacts();
|
|
||||||
for ( size_t i=0 ; i<contacts->size() ; i++ ) {
|
|
||||||
forEach ( Component*, component, (*contacts)[i]->getSlaveComponents() ) {
|
|
||||||
segment = dynamic_cast<Segment*>(*component);
|
|
||||||
autoSegment = Session::base()->lookup ( segment );
|
|
||||||
ltrace(149) << autoSegment << endl;
|
|
||||||
if ( autoSegment ) {
|
|
||||||
addTrackSegment ( this, autoSegment, true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// // Effective deletion of rejecteds.
|
|
||||||
// set<AutoSegment*>::iterator ireject = rejecteds.begin();
|
|
||||||
// for ( ; ireject != rejecteds.end() ; ireject++ ) {
|
|
||||||
// }
|
|
||||||
|
|
||||||
ltrace(149) << "Horizontal overcell AutoSegments" << endl;
|
|
||||||
vector<AutoSegment*>* segments = getHSegments();
|
|
||||||
for ( size_t i=0 ; i<segments->size() ; i++ ) {
|
|
||||||
addTrackSegment ( this, (*segments)[i], true );
|
|
||||||
}
|
|
||||||
|
|
||||||
ltrace(149) << "Vertical overcell AutoSegments" << endl;
|
|
||||||
segments = getVSegments();
|
|
||||||
for ( size_t i=0 ; i<segments->size() ; i++ ) {
|
|
||||||
addTrackSegment ( this, (*segments)[i], true );
|
|
||||||
}
|
|
||||||
|
|
||||||
ltrace(149) << "_segments.size():" << _segments.size() << endl;
|
|
||||||
ltraceout(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCell::computeBorder ()
|
|
||||||
{
|
|
||||||
ltrace(200) << "GCell::computeBorder() " << this << endl;
|
|
||||||
ltracein(200);
|
|
||||||
|
|
||||||
vector<AutoContact*>* contacts = _base->getContacts();
|
|
||||||
TrackElement* candidate;
|
|
||||||
DataNegociate* data;
|
|
||||||
Box bb = getBoundingBox();
|
|
||||||
size_t iLeft = 0;
|
|
||||||
size_t iRight = 0;
|
|
||||||
|
|
||||||
for ( size_t icontact=0 ; icontact < contacts->size() ; icontact++ ) {
|
|
||||||
Component* anchor = (*contacts)[icontact]->getAnchor();
|
|
||||||
RoutingPad* rp = dynamic_cast<RoutingPad*>(anchor);
|
|
||||||
|
|
||||||
if ( not rp ) continue;
|
|
||||||
|
|
||||||
// size_t depth = Session::getConfiguration()->getLayerDepth ( rp->getLayer() );
|
|
||||||
// if ( (depth != 0) and (depth != 2) ) continue;
|
|
||||||
|
|
||||||
// ltrace(200) << "depth: " << depth << " " << rp << endl;
|
|
||||||
|
|
||||||
candidate = getCandidate ( rp, bb );
|
|
||||||
if ( not candidate ) continue;
|
|
||||||
|
|
||||||
data = candidate->getDataNegociate();
|
|
||||||
if ( not data ) continue;
|
|
||||||
|
|
||||||
// Ugly: hardwired pitch usage.
|
|
||||||
if ( (rp->getX() - getX() < DbU::lambda(11.0)) and (iLeft < 2) ) {
|
|
||||||
//data->setLeftBorder(true);
|
|
||||||
ltrace(200) << "Left Segments[" << iLeft << "]: " << candidate << endl;
|
|
||||||
_leftSegments[iLeft++] = candidate;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (getXMax() - rp->getX() < DbU::lambda(11.0)) and (iRight < 2) ) {
|
|
||||||
//data->setRightBorder(true);
|
|
||||||
ltrace(200) << "Right Segment[" << iRight << "]: " << candidate << endl;
|
|
||||||
_rightSegments[iRight++] = candidate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ltraceout(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TrackElement* GCell::addTrackSegment ( GCell* gcell, AutoSegment* autoSegment, bool loading )
|
|
||||||
{
|
|
||||||
ltrace(200) << "GCell::addTrackSegment() - " << autoSegment << endl;
|
|
||||||
ltracein(159);
|
|
||||||
|
|
||||||
// Special case: fixed AutoSegments must not interfere with blockages.
|
|
||||||
// Ugly: uses of getExtensionCap().
|
|
||||||
if ( autoSegment->isFixed() ) {
|
|
||||||
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(autoSegment->getLayer());
|
|
||||||
Track* track = plane->getTrackByPosition ( autoSegment->getAxis() );
|
|
||||||
size_t begin;
|
|
||||||
size_t end;
|
|
||||||
Interval fixedSpan;
|
|
||||||
Interval blockageSpan;
|
|
||||||
|
|
||||||
autoSegment->getCanonical ( fixedSpan );
|
|
||||||
fixedSpan.inflate ( Session::getExtensionCap()-1 );
|
|
||||||
|
|
||||||
track->getOverlapBounds ( fixedSpan, begin, end );
|
|
||||||
for ( ; (begin < end) ; begin++ ) {
|
|
||||||
|
|
||||||
TrackElement* other = track->getSegment(begin);
|
|
||||||
ltrace(200) << "| overlap: " << other << endl;
|
|
||||||
|
|
||||||
if ( not other->isBlockage() ) continue;
|
|
||||||
|
|
||||||
other->getCanonical ( blockageSpan );
|
|
||||||
blockageSpan.inflate(Session::getExtensionCap());
|
|
||||||
|
|
||||||
ltrace(200) << " fixed:" << fixedSpan << " vs. blockage:" << blockageSpan << endl;
|
|
||||||
|
|
||||||
if ( not fixedSpan.intersect(blockageSpan) ) continue;
|
|
||||||
|
|
||||||
// Overlap between fixed & blockage.
|
|
||||||
ltrace(200) << "* Blockage overlap: " << autoSegment << endl;
|
|
||||||
Session::destroyRequest ( autoSegment );
|
|
||||||
|
|
||||||
cinfo << Warning("Overlap between fixed %s and blockage at %s."
|
|
||||||
,getString(autoSegment).c_str(),getString(blockageSpan).c_str()) << endl;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Interval span;
|
|
||||||
autoSegment = autoSegment->getCanonical ( span );
|
|
||||||
|
|
||||||
bool created;
|
|
||||||
TrackElement* trackSegment = TrackSegment::create ( autoSegment, NULL, created );
|
|
||||||
DataNegociate* data = trackSegment->getDataNegociate ();
|
|
||||||
GCell* previousGCell = trackSegment->getGCell();
|
|
||||||
|
|
||||||
if ( not loading )
|
|
||||||
ltrace(159) << "* lookup: " << autoSegment << endl;
|
|
||||||
|
|
||||||
if ( created )
|
|
||||||
ltrace(159) << "* " << trackSegment << endl;
|
|
||||||
|
|
||||||
if ( not created and not loading ) {
|
|
||||||
ltrace(200) << "TrackSegment already exists (and not in loading stage)." << endl;
|
|
||||||
ltrace(200) << "Previous owning GCell: " << previousGCell << endl;
|
|
||||||
if ( previousGCell != gcell ) {
|
|
||||||
previousGCell->removeTrackSegment ( trackSegment );
|
|
||||||
trackSegment->setGCell ( NULL );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
vector<GCell*> gcells;
|
|
||||||
trackSegment->getGCells ( gcells );
|
|
||||||
GCell* lowest = gcells[0];
|
|
||||||
bool validPrevious = false;
|
|
||||||
|
|
||||||
for ( size_t igcell=0 ; igcell<gcells.size() ; igcell++ ) {
|
|
||||||
ltrace(200) << "| " << igcell << ":" << gcells[igcell] << endl;
|
|
||||||
if ( gcells[igcell]->getOrder() < lowest->getOrder()) {
|
|
||||||
lowest = gcells[igcell];
|
|
||||||
}
|
|
||||||
if ( gcells[igcell] == previousGCell ) validPrevious = true;
|
|
||||||
}
|
|
||||||
if ( not validPrevious ) previousGCell = NULL;
|
|
||||||
|
|
||||||
if ( not gcell ) {
|
|
||||||
gcell = lowest;
|
|
||||||
if ( previousGCell and (gcell->getOrder() == previousGCell->getOrder()) )
|
|
||||||
gcell = previousGCell;
|
|
||||||
ltrace(200) << "New owner: " << gcell << endl;
|
|
||||||
} else if ( created ) {
|
|
||||||
if ( (lowest != gcell) && (lowest->getOrder() != gcell->getOrder() ) ) {
|
|
||||||
cerr << Bug("Not the right lowest: %s",getString(lowest).c_str()) << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (gcell->getOrder() > Session::getOrder()) and not (data->isRing() or data->isBorder()) ) {
|
|
||||||
cinfo << "[INFO] GCell::addTrackSegment() - Owning GCell is not in active set ("
|
|
||||||
<< gcell->getOrder() << " > Session:" << Session::getOrder() << ")."
|
|
||||||
<< "\n " << trackSegment
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( not trackSegment->getGCell() ) {
|
|
||||||
trackSegment->setGCell ( gcell );
|
|
||||||
gcell->addTrackSegment ( trackSegment );
|
|
||||||
|
|
||||||
if ( loading ) {
|
|
||||||
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(autoSegment->getLayer());
|
|
||||||
Track* track = plane->getTrackByPosition ( autoSegment->getAxis() );
|
|
||||||
Interval uside = gcell->getUSide ( Constant::perpandicular(autoSegment->getDirection()), false );
|
|
||||||
|
|
||||||
if ( track->getAxis() > uside.getVMax() ) track = track->getPrevious();
|
|
||||||
if ( track->getAxis() < uside.getVMin() ) track = track->getNext();
|
|
||||||
|
|
||||||
trackSegment->setAxis ( track->getAxis(), Katabatic::Realignate|Katabatic::AxisSet );
|
|
||||||
trackSegment->invalidate ();
|
|
||||||
|
|
||||||
if ( created and trackSegment->isFixed() ) {
|
|
||||||
Session::addInsertEvent ( trackSegment, track );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ltraceout(159);
|
|
||||||
|
|
||||||
return trackSegment;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCell::addTrackSegment ( TrackElement* trackSegment )
|
|
||||||
{
|
|
||||||
_segments.push_back ( trackSegment );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCell::removeTrackSegment ( TrackElement* trackSegment )
|
|
||||||
{
|
|
||||||
if ( _segments.empty() ) return;
|
|
||||||
|
|
||||||
size_t i = 0;
|
|
||||||
for ( ; i<_segments.size() ; i++ )
|
|
||||||
if ( _segments[i] == trackSegment ) {
|
|
||||||
swap ( _segments[i], _segments[_segments.size()-1] );
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( i < _segments.size() ) _segments.pop_back ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double GCell::getOwnedWireLength () const
|
|
||||||
{
|
|
||||||
double ownedWL = 0;
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<_segments.size() ; i++ ) {
|
|
||||||
ownedWL += DbU::getLambda ( _segments[i]->getLength() );
|
|
||||||
}
|
|
||||||
|
|
||||||
return ownedWL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCell::anticipateRouting ( unsigned int order )
|
|
||||||
{
|
|
||||||
if ( order < _order ) {
|
|
||||||
setRouted ( true );
|
|
||||||
loadRouting ( order );
|
|
||||||
// _order = order;
|
|
||||||
// for ( size_t isegment=0 ; isegment<_segments.size() ; ++isegment ) {
|
|
||||||
// DataNegociate* data = _segments[isegment]->getDataNegociate();
|
|
||||||
// data->setGCellOrder ( order );
|
|
||||||
// data->resetBorder ();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string GCell::_getTypeName() const
|
|
||||||
{ return "Kite::GCell"; }
|
|
||||||
|
|
||||||
|
|
||||||
string GCell::_getString () const
|
|
||||||
{
|
|
||||||
string s = _base->_getString();
|
|
||||||
s.erase ( s.size()-1 );
|
|
||||||
s += " o:";
|
|
||||||
s += ((_order == numeric_limits<unsigned int>::max()) ? "-" : getString(_order));
|
|
||||||
s += " ";
|
|
||||||
s += ((_isRouted) ? "R" : "-");
|
|
||||||
s += ">";
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Record* GCell::_getRecord () const
|
|
||||||
{ return _base->_getRecord(); }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
|
@ -1,154 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Module : "./GCellGrid.cpp" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "hurricane/Cell.h"
|
|
||||||
#include "katabatic/GCellGrid.h"
|
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/GCellGrid.h"
|
|
||||||
#include "kite/KiteEngine.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using std::cerr;
|
|
||||||
using std::endl;
|
|
||||||
|
|
||||||
using Hurricane::tab;
|
|
||||||
using Hurricane::inltrace;
|
|
||||||
using Hurricane::ltracein;
|
|
||||||
using Hurricane::ltraceout;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "GCellGrid".
|
|
||||||
|
|
||||||
|
|
||||||
GCellGrid::GCellGrid ( KiteEngine* kite )
|
|
||||||
: Katabatic::Grid<GCell>(kite->getCell()->getBoundingBox())
|
|
||||||
, _kite(kite)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
void GCellGrid::_postCreate ()
|
|
||||||
{
|
|
||||||
// Clone the grid from Katabatic Here.
|
|
||||||
Katabatic::GCellGrid* base = _kite->base()->getGCellGrid();
|
|
||||||
vector<Katabatic::GCell*>* baseGCells = base->getGCellVector();
|
|
||||||
|
|
||||||
ltrace(80) << "Kite GCell Matrix [" << baseGCells->size() << "]" << endl;
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<baseGCells->size() ; i++ )
|
|
||||||
_gcells.push_back ( GCell::create(this,(*baseGCells)[i]) );
|
|
||||||
|
|
||||||
_rows = base->getRows();
|
|
||||||
_columns = base->getColumns();
|
|
||||||
_rawSize = base->getRawSize();
|
|
||||||
_xGraduations = base->getXGrads();
|
|
||||||
_yGraduations = base->getYGrads();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCellGrid::~GCellGrid ()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
void GCellGrid::_preDestroy ()
|
|
||||||
{
|
|
||||||
ltrace(90) << "Kite::GCellGrid::_preDestroy()" << endl;
|
|
||||||
ltracein(90);
|
|
||||||
|
|
||||||
vector<GCell*>::iterator it = _gcells.begin();
|
|
||||||
vector<GCell*>::iterator end = _gcells.end ();
|
|
||||||
for ( ; it != end ; it++ ) (*it)->destroy ();
|
|
||||||
|
|
||||||
ltraceout(90);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Cell* GCellGrid::getCell () const
|
|
||||||
{
|
|
||||||
return _kite->getCell();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCellGrid* GCellGrid::create ( KiteEngine* kite )
|
|
||||||
{
|
|
||||||
GCellGrid* subFCellGrid = new Kite::GCellGrid ( kite );
|
|
||||||
|
|
||||||
subFCellGrid->_postCreate ();
|
|
||||||
|
|
||||||
return subFCellGrid;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double GCellGrid::getTotalWireLength () const
|
|
||||||
{
|
|
||||||
double totalWL = 0;
|
|
||||||
for ( size_t i=0 ; i < _gcells.size() ; i++ ) {
|
|
||||||
totalWL += _gcells[i]->getOwnedWireLength ();
|
|
||||||
}
|
|
||||||
return totalWL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCellGrid::_check () const
|
|
||||||
{
|
|
||||||
cerr << " o Checking Kite GCell Grid." << endl;
|
|
||||||
for ( size_t i=0 ; i < _gcells.size() ; i++ ) {
|
|
||||||
if ( _gcells[i]->base() == NULL ) {
|
|
||||||
cerr << "[CHECK] _gcells[" << i << "]: " << (void*)_gcells[i] << " has NULL base." << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cerr << " - Successful." << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string GCellGrid::_getTypeName () const
|
|
||||||
{
|
|
||||||
return "Kite::GCellGrid";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string GCellGrid::_getString () const
|
|
||||||
{
|
|
||||||
return "<" + _getTypeName() + " "
|
|
||||||
+ getString(getRows()) + "x" + getString(getColumns()) + ">";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Record* GCellGrid::_getRecord () const
|
|
||||||
{
|
|
||||||
Record* record = Katabatic::Grid<GCell>::_getRecord ();
|
|
||||||
record->add ( getSlot ( "_kite", _kite ) );
|
|
||||||
return record;
|
|
||||||
|
|
||||||
return record;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
|
@ -1,402 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Module : "./GCellRoutingSet.cpp" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#include <limits>
|
|
||||||
#include <queue>
|
|
||||||
#include <iostream>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <sstream>
|
|
||||||
#include <boost/bind.hpp>
|
|
||||||
|
|
||||||
#include "hurricane/Error.h"
|
|
||||||
#include "hurricane/Contact.h"
|
|
||||||
#include "hurricane/Segment.h"
|
|
||||||
#include "hurricane/RoutingPad.h"
|
|
||||||
#include "katabatic/AutoSegment.h"
|
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/GCellGrid.h"
|
|
||||||
#include "kite/GCellRoutingSet.h"
|
|
||||||
#include "kite/DataNegociate.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using std::numeric_limits;
|
|
||||||
using std::queue;
|
|
||||||
using std::cerr;
|
|
||||||
using std::endl;
|
|
||||||
using std::ostringstream;
|
|
||||||
using std::setprecision;
|
|
||||||
using Hurricane::roundfp;
|
|
||||||
using Hurricane::tab;
|
|
||||||
using Hurricane::inltrace;
|
|
||||||
using Hurricane::ltracein;
|
|
||||||
using Hurricane::ltraceout;
|
|
||||||
using Hurricane::Error;
|
|
||||||
using Katabatic::getVectorString;
|
|
||||||
|
|
||||||
|
|
||||||
const char* usedGCellSeed =
|
|
||||||
"GCellRoutingSet::create() : %s is already in a GCellRoutingSet.\n";
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "GCellRoutingSet".
|
|
||||||
|
|
||||||
|
|
||||||
GCellRoutingSet::GCellRoutingSet ( GCell* gcell, float expandStep, float minDensity )
|
|
||||||
: _order (numeric_limits<unsigned int>::max())
|
|
||||||
, _minDensity (minDensity)
|
|
||||||
, _minDensities (new float [gcell->getDepth()])
|
|
||||||
, _gcells (1,gcell)
|
|
||||||
, _borderSegments()
|
|
||||||
, _statistics ()
|
|
||||||
{
|
|
||||||
gcell->setInRoutingSet ( true );
|
|
||||||
|
|
||||||
if ( _minDensity > expandStep ) _minDensity -= expandStep;
|
|
||||||
else _minDensity = 0.0;
|
|
||||||
_minDensity = roundfp ( _minDensity );
|
|
||||||
for ( unsigned int i=0 ; i < gcell->getDepth() ; i++ ) {
|
|
||||||
_minDensities[i] = gcell->getDensity(i) * expandStep;
|
|
||||||
_minDensities[i] = roundfp ( _minDensities[i] );
|
|
||||||
}
|
|
||||||
ltrace(200) << getVectorString(_minDensities,gcell->getDepth()) << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCellRoutingSet::_postCreate ()
|
|
||||||
{
|
|
||||||
ltrace(90) << "Kite::GCellRoutingSet::_postCreate() - " << (void*)this << " " << this << endl;
|
|
||||||
ltracein(90);
|
|
||||||
|
|
||||||
ltraceout(90);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCellRoutingSet::~GCellRoutingSet ()
|
|
||||||
{
|
|
||||||
delete [] _minDensities;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCellRoutingSet::_preDestroy ()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
void GCellRoutingSet::destroy ()
|
|
||||||
{
|
|
||||||
_preDestroy ();
|
|
||||||
delete this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GCellRoutingSet* GCellRoutingSet::create ( GCell* gcell, float expandStep )
|
|
||||||
{
|
|
||||||
if ( gcell->isInRoutingSet() )
|
|
||||||
throw Error ( usedGCellSeed, getString(gcell).c_str() );
|
|
||||||
|
|
||||||
GCellRoutingSet* rs = new GCellRoutingSet ( gcell
|
|
||||||
, expandStep
|
|
||||||
, gcell->getDensity()
|
|
||||||
);
|
|
||||||
rs->_postCreate ();
|
|
||||||
|
|
||||||
return rs;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCellRoutingSet::setRouted ( bool state )
|
|
||||||
{
|
|
||||||
for ( size_t igcell=0 ; igcell<_gcells.size() ; ++igcell )
|
|
||||||
_gcells[igcell]->setRouted ( true );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
vector<TrackElement*>& GCellRoutingSet::getOwnedSegments ( vector<TrackElement*>& segments ) const
|
|
||||||
{
|
|
||||||
for ( size_t i=0 ; i<_gcells.size() ; i++ ) {
|
|
||||||
if ( _gcells[i]->isRouted() ) continue;
|
|
||||||
|
|
||||||
const vector<TrackElement*>& gcellSegments = _gcells[i]->getOwnedSegments();
|
|
||||||
for ( size_t j=0 ; j<gcellSegments.size() ; j++ ) {
|
|
||||||
if ( !gcellSegments[j]->isFixed() )
|
|
||||||
segments.push_back ( gcellSegments[j] );
|
|
||||||
}
|
|
||||||
// segments.insert ( segments.end()
|
|
||||||
// , _gcells[i]->getOwnedSegments().begin()
|
|
||||||
// , _gcells[i]->getOwnedSegments().end()
|
|
||||||
// );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<_borderSegments.size() ; i++ ) {
|
|
||||||
TrackElement* segment = _borderSegments[i]._segment;
|
|
||||||
DataNegociate* data = segment->getDataNegociate();
|
|
||||||
data->setGCellOrder ( _order );
|
|
||||||
segments.push_back ( segment );
|
|
||||||
}
|
|
||||||
|
|
||||||
return segments;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCellRoutingSet::expand ( GCellGrid* grid )
|
|
||||||
{
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: Expanding " << this << endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ltrace(200) << "Expanding: " << this << endl;
|
|
||||||
ltracein(200);
|
|
||||||
ltrace(200) << getVectorString(_minDensities,_gcells.front()->getDepth()) << endl;
|
|
||||||
|
|
||||||
queue<GCell*> densityQueue;
|
|
||||||
densityQueue.push ( _gcells.front() );
|
|
||||||
|
|
||||||
while ( !densityQueue.empty() ) {
|
|
||||||
GCell* current = densityQueue.front ();
|
|
||||||
GCell* neighbor = NULL;
|
|
||||||
densityQueue.pop ();
|
|
||||||
|
|
||||||
ltrace(200) << "Popping Density: " << current << endl;
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<4 ; i++ ) {
|
|
||||||
switch ( i ) {
|
|
||||||
case 0: neighbor = grid->getGCellLeft (current); break;
|
|
||||||
case 1: neighbor = grid->getGCellRight(current); break;
|
|
||||||
case 2: neighbor = grid->getGCellUp (current); break;
|
|
||||||
case 3: neighbor = grid->getGCellDown (current); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( neighbor ) {
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: Looking at neighbor " << neighbor << endl;
|
|
||||||
#endif
|
|
||||||
float densities[32];
|
|
||||||
neighbor->base()->getDensities ( densities );
|
|
||||||
ltrace(200) << "Neighbor: " << neighbor << " " << getVectorString(densities,5) << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( neighbor and !neighbor->isInRoutingSet() ) {
|
|
||||||
if ( not neighbor->isAboveDensity(_minDensity)
|
|
||||||
and not GCell::areDensityConnex(current,neighbor) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: Agglomerate " << neighbor << endl;
|
|
||||||
#endif
|
|
||||||
ltrace(200) << "Agglomerating: " << neighbor << endl;
|
|
||||||
|
|
||||||
neighbor->setInRoutingSet ( true );
|
|
||||||
_gcells.push_back ( neighbor );
|
|
||||||
densityQueue.push ( neighbor );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// De-notching pass.
|
|
||||||
for ( size_t i=0 ; i<_gcells.size() ; i++ ) densityQueue.push ( _gcells[i] );
|
|
||||||
|
|
||||||
while ( not densityQueue.empty() ) {
|
|
||||||
GCell* current = densityQueue.front();
|
|
||||||
GCell* neighbor = NULL;
|
|
||||||
|
|
||||||
densityQueue.pop();
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<4 ; i++ ) {
|
|
||||||
switch ( i ) {
|
|
||||||
case 0: neighbor = grid->getGCellLeft (current); break;
|
|
||||||
case 1: neighbor = grid->getGCellRight(current); break;
|
|
||||||
case 2: neighbor = grid->getGCellUp (current); break;
|
|
||||||
case 3: neighbor = grid->getGCellDown (current); break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( not neighbor ) continue;
|
|
||||||
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: Denotching, looking at neighbor " << neighbor << endl;
|
|
||||||
#endif
|
|
||||||
if ( neighbor->isInRoutingSet() ) continue;
|
|
||||||
|
|
||||||
GCell* left = grid->getGCellLeft (neighbor);
|
|
||||||
GCell* right = grid->getGCellRight(neighbor);
|
|
||||||
GCell* up = grid->getGCellUp (neighbor);
|
|
||||||
GCell* down = grid->getGCellDown (neighbor);
|
|
||||||
|
|
||||||
bool hasLeft = (left) ? left ->isInRoutingSet() : true;
|
|
||||||
bool hasRight = (right) ? right->isInRoutingSet() : true;
|
|
||||||
bool hasUp = (up) ? up ->isInRoutingSet() : true;
|
|
||||||
bool hasDown = (down) ? down ->isInRoutingSet() : true;
|
|
||||||
|
|
||||||
if ( (not (hasLeft and hasRight)) and (not (hasUp and hasDown)) ) continue;
|
|
||||||
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: Denotching, Agglomerate " << neighbor << endl;
|
|
||||||
#endif
|
|
||||||
ltrace(200) << "Denotching, Agglomerating: " << neighbor << endl;
|
|
||||||
|
|
||||||
neighbor->setInRoutingSet ( true );
|
|
||||||
_gcells.push_back ( neighbor );
|
|
||||||
densityQueue.push ( neighbor );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ltrace(200) << "GCellRoutingSet (final): " << this << endl;
|
|
||||||
for ( size_t i=0 ; i<_gcells.size() ; i++ )
|
|
||||||
ltrace(200) << "| " << _gcells[i] << endl;
|
|
||||||
|
|
||||||
_statistics.setGCellsCount ( _gcells.size() );
|
|
||||||
_statistics.setSegmentsCount ( 0 );
|
|
||||||
for ( size_t i=0 ; i<_gcells.size() ; i++ ) {
|
|
||||||
const vector<TrackElement*>& gcellSegments = _gcells[i]->getOwnedSegments();
|
|
||||||
_statistics.incSegmentsCount ( gcellSegments.size() );
|
|
||||||
}
|
|
||||||
|
|
||||||
ltraceout(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCellRoutingSet::loadBorder ( GCellGrid* grid )
|
|
||||||
{
|
|
||||||
ltrace(200) << "loadBorder() " << this << endl;
|
|
||||||
unsigned int order = _order;
|
|
||||||
TrackElement* segment = NULL;
|
|
||||||
DataNegociate* data;
|
|
||||||
|
|
||||||
for ( size_t igcell=0 ; igcell<_gcells.size() ; igcell++ ) {
|
|
||||||
if ( _gcells[igcell]->getOrder() < order ) continue;
|
|
||||||
|
|
||||||
GCell* neighbor = NULL;
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<2 ; i++ ) {
|
|
||||||
switch ( i ) {
|
|
||||||
case 0: neighbor = grid->getGCellLeft (_gcells[igcell]); break;
|
|
||||||
case 1: neighbor = grid->getGCellRight(_gcells[igcell]); break;
|
|
||||||
}
|
|
||||||
if ( not neighbor or (neighbor->getOrder() <= order) ) continue;
|
|
||||||
|
|
||||||
neighbor->computeBorder ();
|
|
||||||
|
|
||||||
for ( size_t iRight=0 ; iRight<2 ; iRight++ ) {
|
|
||||||
segment = neighbor->getRightRp(iRight);
|
|
||||||
if ( segment == NULL ) break;
|
|
||||||
|
|
||||||
data = (segment) ? segment->getDataNegociate() : NULL;
|
|
||||||
if ( data ) {
|
|
||||||
if ( (i == 0) and (data->getGCellOrder() > order) and not data->isRing() ) {
|
|
||||||
ltrace(200) << "| border: [" << data->getGCellOrder()
|
|
||||||
<< " > " << order << "] " << segment << endl;
|
|
||||||
data->setRightBorder ( true );
|
|
||||||
_borderSegments.push_back ( BorderSegment(segment,data->getGCellOrder()) );
|
|
||||||
} else
|
|
||||||
data->resetBorder();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( size_t iLeft=0 ; iLeft<2 ; iLeft++ ) {
|
|
||||||
segment = neighbor->getLeftRp(iLeft);
|
|
||||||
if ( segment == NULL ) break;
|
|
||||||
|
|
||||||
data = (segment) ? segment->getDataNegociate() : NULL;
|
|
||||||
if ( data ) {
|
|
||||||
if ( (i == 1) and (data->getGCellOrder() > order) and not data->isRing() ) {
|
|
||||||
ltrace(200) << "| border: [" << data->getGCellOrder()
|
|
||||||
<< " > " << order << "] " << segment << endl;
|
|
||||||
data->setLeftBorder ( true );
|
|
||||||
_borderSegments.push_back ( BorderSegment(segment,data->getGCellOrder()) );
|
|
||||||
} else
|
|
||||||
data->resetBorder();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GCellRoutingSet::freeBorder ()
|
|
||||||
{
|
|
||||||
for ( size_t j=0 ; j<_borderSegments.size() ; j++ ) {
|
|
||||||
DataNegociate* data = _borderSegments[j]._segment->getDataNegociate();
|
|
||||||
if ( not data->isBorder() ) continue;
|
|
||||||
|
|
||||||
data->resetBorder ();
|
|
||||||
data->setGCellOrder ( _borderSegments[j]._order );
|
|
||||||
Session::addRemoveEvent ( _borderSegments[j]._segment );
|
|
||||||
//_borderSegments[j]._segment->base()->setFixed(true);
|
|
||||||
}
|
|
||||||
Session::revalidate ();
|
|
||||||
|
|
||||||
vector<BorderSegment>().swap ( _borderSegments );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
unsigned int& GCellRoutingSet::loadRouting ( unsigned int& order )
|
|
||||||
{
|
|
||||||
_order = order;
|
|
||||||
//cerr << "RoutingSet order:" << order << endl;
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<_gcells.size() ; i++ )
|
|
||||||
_gcells[i]->loadRouting ( order );
|
|
||||||
|
|
||||||
return ++order;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string GCellRoutingSet::_getTypeName () const
|
|
||||||
{ return "GCellRoutingSet"; }
|
|
||||||
|
|
||||||
|
|
||||||
string GCellRoutingSet::_getString () const
|
|
||||||
{
|
|
||||||
ostringstream s;
|
|
||||||
|
|
||||||
s << "<o:" << ((_order!=numeric_limits<unsigned int>::max()) ? getString(_order) : "-")
|
|
||||||
<< " " << _gcells.front() << setprecision(9)
|
|
||||||
<< " [" << ":" << _minDensity
|
|
||||||
<< "] " << _gcells.size()
|
|
||||||
<< ">";
|
|
||||||
return s.str();
|
|
||||||
|
|
||||||
//return "<o:" + ((_order!=numeric_limits<unsigned int>::max()) ? getString(_order) : "-")
|
|
||||||
// + " " + getString(_gcells.front())
|
|
||||||
// + " [" + /*getString(_minDensity)*/ + ":" + getString(_minDensity)
|
|
||||||
// + "] " + getString(_gcells.size())
|
|
||||||
// + ">";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Record* GCellRoutingSet::_getRecord () const
|
|
||||||
{
|
|
||||||
Record* record = new Record ( getString(this) );
|
|
||||||
record->add ( getSlot ( "_gcells" , &_gcells ) );
|
|
||||||
record->add ( getSlot ( "_order" , _order ) );
|
|
||||||
record->add ( getSlot ( "_minDensity", _minDensity ) );
|
|
||||||
|
|
||||||
return record;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include <crlcore/Utilities.h>
|
#include <crlcore/Utilities.h>
|
||||||
#include <crlcore/AllianceFramework.h>
|
#include <crlcore/AllianceFramework.h>
|
||||||
#include <katabatic/GCell.h>
|
#include <katabatic/GCell.h>
|
||||||
|
#include <katabatic/GCellGrid.h>
|
||||||
#include <knik/Edge.h>
|
#include <knik/Edge.h>
|
||||||
#include <knik/Vertex.h>
|
#include <knik/Vertex.h>
|
||||||
#include <knik/KnikEngine.h>
|
#include <knik/KnikEngine.h>
|
||||||
|
@ -95,6 +96,11 @@ namespace Kite {
|
||||||
void GraphicKiteEngine::initKatabaticGCell ( CellWidget* widget )
|
void GraphicKiteEngine::initKatabaticGCell ( CellWidget* widget )
|
||||||
{
|
{
|
||||||
widget->getDrawingPlanes().setPen ( Qt::NoPen );
|
widget->getDrawingPlanes().setPen ( Qt::NoPen );
|
||||||
|
|
||||||
|
KiteEngine* kite = KiteEngine::get ( widget->getCell() );
|
||||||
|
if ( kite ) {
|
||||||
|
kite->getGCellGrid()->setDensityMode ( Katabatic::GCellGrid::MaxDensity );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +114,7 @@ namespace Kite {
|
||||||
const Katabatic::GCell* gcell = static_cast<const Katabatic::GCell*>(go);
|
const Katabatic::GCell* gcell = static_cast<const Katabatic::GCell*>(go);
|
||||||
|
|
||||||
QPainter& painter = widget->getPainter();
|
QPainter& painter = widget->getPainter();
|
||||||
size_t density = (size_t)( gcell->getMaxHVDensity() * 255.0 );
|
size_t density = (size_t)( gcell->getDensity() * 255.0 );
|
||||||
if ( density > 255 ) density = 255;
|
if ( density > 255 ) density = 255;
|
||||||
|
|
||||||
painter.setBrush
|
painter.setBrush
|
||||||
|
|
|
@ -41,18 +41,16 @@
|
||||||
#include "hurricane/Vertical.h"
|
#include "hurricane/Vertical.h"
|
||||||
#include "hurricane/Horizontal.h"
|
#include "hurricane/Horizontal.h"
|
||||||
#include "hurricane/UpdateSession.h"
|
#include "hurricane/UpdateSession.h"
|
||||||
|
|
||||||
#include "crlcore/Measures.h"
|
#include "crlcore/Measures.h"
|
||||||
#include "knik/Vertex.h"
|
#include "knik/Vertex.h"
|
||||||
#include "knik/Edge.h"
|
#include "knik/Edge.h"
|
||||||
#include "knik/Graph.h"
|
#include "knik/Graph.h"
|
||||||
#include "knik/KnikEngine.h"
|
#include "knik/KnikEngine.h"
|
||||||
#include "katabatic/AutoContact.h"
|
#include "katabatic/AutoContact.h"
|
||||||
|
#include "katabatic/GCellGrid.h"
|
||||||
#include "kite/DataNegociate.h"
|
#include "kite/DataNegociate.h"
|
||||||
#include "kite/GCellGrid.h"
|
|
||||||
#include "kite/RoutingPlane.h"
|
#include "kite/RoutingPlane.h"
|
||||||
#include "kite/Session.h"
|
#include "kite/Session.h"
|
||||||
#include "kite/GCellRoutingSet.h"
|
|
||||||
#include "kite/NegociateWindow.h"
|
#include "kite/NegociateWindow.h"
|
||||||
#include "kite/KiteEngine.h"
|
#include "kite/KiteEngine.h"
|
||||||
|
|
||||||
|
@ -85,6 +83,7 @@ namespace Kite {
|
||||||
using CRL::Measures;
|
using CRL::Measures;
|
||||||
using CRL::MeasuresSet;
|
using CRL::MeasuresSet;
|
||||||
using Knik::KnikEngine;
|
using Knik::KnikEngine;
|
||||||
|
using Katabatic::AutoContact;
|
||||||
using Katabatic::ChipTools;
|
using Katabatic::ChipTools;
|
||||||
|
|
||||||
|
|
||||||
|
@ -116,7 +115,6 @@ namespace Kite {
|
||||||
, _blockageNet (NULL)
|
, _blockageNet (NULL)
|
||||||
, _configuration (new Configuration(getKatabaticConfiguration()))
|
, _configuration (new Configuration(getKatabaticConfiguration()))
|
||||||
, _routingPlanes ()
|
, _routingPlanes ()
|
||||||
, _kiteGrid (NULL)
|
|
||||||
, _negociateWindow (NULL)
|
, _negociateWindow (NULL)
|
||||||
, _trackSegmentLut ()
|
, _trackSegmentLut ()
|
||||||
, _minimumWL (0.0)
|
, _minimumWL (0.0)
|
||||||
|
@ -133,8 +131,6 @@ namespace Kite {
|
||||||
#ifdef KNIK_NOT_EMBEDDED
|
#ifdef KNIK_NOT_EMBEDDED
|
||||||
size_t maxDepth = getRoutingGauge()->getDepth();
|
size_t maxDepth = getRoutingGauge()->getDepth();
|
||||||
|
|
||||||
_kiteGrid = GCellGrid::create ( this );
|
|
||||||
|
|
||||||
_routingPlanes.reserve ( maxDepth );
|
_routingPlanes.reserve ( maxDepth );
|
||||||
for ( size_t depth=0 ; depth < maxDepth ; depth++ ) {
|
for ( size_t depth=0 ; depth < maxDepth ; depth++ ) {
|
||||||
_routingPlanes.push_back ( RoutingPlane::create ( this, depth ) );
|
_routingPlanes.push_back ( RoutingPlane::create ( this, depth ) );
|
||||||
|
@ -192,17 +188,9 @@ namespace Kite {
|
||||||
{
|
{
|
||||||
if ( segment->isBlockage() ) return 0;
|
if ( segment->isBlockage() ) return 0;
|
||||||
|
|
||||||
if ( segment->getDataNegociate() ) {
|
|
||||||
if ( segment->getDataNegociate()->isBorder() )
|
|
||||||
return _configuration->getRipupLimit(Configuration::BorderRipupLimit);
|
|
||||||
|
|
||||||
if ( segment->getDataNegociate()->isRing() )
|
|
||||||
return _configuration->getRipupLimit(Configuration::GlobalRipupLimit);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( segment->isStrap () ) return _configuration->getRipupLimit(Configuration::StrapRipupLimit);
|
if ( segment->isStrap () ) return _configuration->getRipupLimit(Configuration::StrapRipupLimit);
|
||||||
if ( segment->isGlobal() ) {
|
if ( segment->isGlobal() ) {
|
||||||
vector<GCell*> gcells;
|
Katabatic::GCellVector gcells;
|
||||||
segment->getGCells(gcells);
|
segment->getGCells(gcells);
|
||||||
if ( gcells.size() > 2 )
|
if ( gcells.size() > 2 )
|
||||||
return _configuration->getRipupLimit(Configuration::LongGlobalRipupLimit);
|
return _configuration->getRipupLimit(Configuration::LongGlobalRipupLimit);
|
||||||
|
@ -276,7 +264,7 @@ namespace Kite {
|
||||||
// Decrease the edge's capacity only under the core area.
|
// Decrease the edge's capacity only under the core area.
|
||||||
const ChipTools& chipTools = getChipTools();
|
const ChipTools& chipTools = getChipTools();
|
||||||
float corePercent = getEdgeCapacityPercent();
|
float corePercent = getEdgeCapacityPercent();
|
||||||
float coronaPercent = 0.85;
|
float coronaPercent = 0.80;
|
||||||
|
|
||||||
forEach ( Knik::Vertex*, ivertex, _knik->getRoutingGraph()->getVertexes() ) {
|
forEach ( Knik::Vertex*, ivertex, _knik->getRoutingGraph()->getVertexes() ) {
|
||||||
for ( int i=0 ; i<2 ; ++i ) {
|
for ( int i=0 ; i<2 ; ++i ) {
|
||||||
|
@ -315,7 +303,6 @@ namespace Kite {
|
||||||
void KiteEngine::createDetailedGrid ()
|
void KiteEngine::createDetailedGrid ()
|
||||||
{
|
{
|
||||||
KatabaticEngine::createDetailedGrid ();
|
KatabaticEngine::createDetailedGrid ();
|
||||||
_kiteGrid = GCellGrid::create ( this );
|
|
||||||
|
|
||||||
size_t maxDepth = getRoutingGauge()->getDepth();
|
size_t maxDepth = getRoutingGauge()->getDepth();
|
||||||
|
|
||||||
|
@ -384,9 +371,9 @@ namespace Kite {
|
||||||
ltrace(300) << "Capacity from: " << (void*)element << ":" << element
|
ltrace(300) << "Capacity from: " << (void*)element << ":" << element
|
||||||
<< ":" << elementCapacity << endl;
|
<< ":" << elementCapacity << endl;
|
||||||
|
|
||||||
GCell* gcell = _kiteGrid->getGCell ( Point(element->getSourceU(),track->getAxis()) );
|
Katabatic::GCell* gcell = getGCellGrid()->getGCell ( Point(element->getSourceU(),track->getAxis()) );
|
||||||
GCell* end = _kiteGrid->getGCell ( Point(element->getTargetU(),track->getAxis()) );
|
Katabatic::GCell* end = getGCellGrid()->getGCell ( Point(element->getTargetU(),track->getAxis()) );
|
||||||
GCell* right = NULL;
|
Katabatic::GCell* right = NULL;
|
||||||
if ( not gcell ) {
|
if ( not gcell ) {
|
||||||
cerr << Warning("annotageGlobalGraph(): TrackElement outside GCell grid.") << endl;
|
cerr << Warning("annotageGlobalGraph(): TrackElement outside GCell grid.") << endl;
|
||||||
continue;
|
continue;
|
||||||
|
@ -427,9 +414,9 @@ namespace Kite {
|
||||||
ltrace(300) << "Capacity from: " << (void*)element << ":" << element
|
ltrace(300) << "Capacity from: " << (void*)element << ":" << element
|
||||||
<< ":" << elementCapacity << endl;
|
<< ":" << elementCapacity << endl;
|
||||||
|
|
||||||
GCell* gcell = _kiteGrid->getGCell ( Point(track->getAxis(),element->getSourceU()) );
|
Katabatic::GCell* gcell = getGCellGrid()->getGCell ( Point(track->getAxis(),element->getSourceU()) );
|
||||||
GCell* end = _kiteGrid->getGCell ( Point(track->getAxis(),element->getTargetU()) );
|
Katabatic::GCell* end = getGCellGrid()->getGCell ( Point(track->getAxis(),element->getTargetU()) );
|
||||||
GCell* up = NULL;
|
Katabatic::GCell* up = NULL;
|
||||||
if ( not gcell ) {
|
if ( not gcell ) {
|
||||||
cerr << Warning("annotageGlobalGraph(): TrackElement outside GCell grid.") << endl;
|
cerr << Warning("annotageGlobalGraph(): TrackElement outside GCell grid.") << endl;
|
||||||
continue;
|
continue;
|
||||||
|
@ -465,8 +452,16 @@ namespace Kite {
|
||||||
|
|
||||||
createGlobalGraph ( mode );
|
createGlobalGraph ( mode );
|
||||||
|
|
||||||
|
//DebugSession::addToTrace ( getCell(), "nb(0)" );
|
||||||
|
//DebugSession::addToTrace ( getCell(), "ram_adri(0)" );
|
||||||
|
//DebugSession::addToTrace ( getCell(), "rsdnbr_sd(9)" );
|
||||||
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_res_re(21)" );
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_res_re(21)" );
|
||||||
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_soper_se(20)" );
|
||||||
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_res_re(20)" );
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_res_re(20)" );
|
||||||
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_addsub32_carith_se_gi_1_29" );
|
||||||
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_instaddbracry_sd_gi_1_21" );
|
||||||
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_addsub32_carith_se_pi_3_29" );
|
||||||
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_1m_dp_res_se(28)" );
|
||||||
//DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.etat32_otheri_sd_2.enx" );
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.etat32_otheri_sd_2.enx" );
|
||||||
//DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.yoper_se(26)" );
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.yoper_se(26)" );
|
||||||
//DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.toper_se(5)" );
|
//DebugSession::addToTrace ( getCell(), "mips_r3000_core.mips_r3000_1m_dp.toper_se(5)" );
|
||||||
|
@ -519,17 +514,14 @@ namespace Kite {
|
||||||
{
|
{
|
||||||
if ( _negociateWindow ) return;
|
if ( _negociateWindow ) return;
|
||||||
|
|
||||||
unsigned int rows = _kiteGrid->getRows();
|
|
||||||
unsigned int columns = _kiteGrid->getColumns();
|
|
||||||
|
|
||||||
startMeasures ();
|
startMeasures ();
|
||||||
|
|
||||||
Session::open ( this );
|
Session::open ( this );
|
||||||
|
|
||||||
cmess1 << " o Running Negociate Algorithm" << endl;
|
cmess1 << " o Running Negociate Algorithm" << endl;
|
||||||
|
|
||||||
_negociateWindow = NegociateWindow::create ( this, 0, 0, columns, rows );
|
_negociateWindow = NegociateWindow::create ( this );
|
||||||
_negociateWindow->loadRouting ();
|
_negociateWindow->setGCells ( *(getGCellGrid()->getGCellVector()) );
|
||||||
preProcess ();
|
preProcess ();
|
||||||
_computeCagedConstraints ();
|
_computeCagedConstraints ();
|
||||||
_negociateWindow->run ( slowMotion );
|
_negociateWindow->run ( slowMotion );
|
||||||
|
@ -554,7 +546,7 @@ namespace Kite {
|
||||||
|
|
||||||
cmess2 << " o Post-checking Knik capacity overload " << (edgeCapacity*100.0) << "%." << endl;
|
cmess2 << " o Post-checking Knik capacity overload " << (edgeCapacity*100.0) << "%." << endl;
|
||||||
|
|
||||||
_kiteGrid->base()->checkEdgeSaturation ( edgeCapacity );
|
getGCellGrid()->checkEdgeSaturation ( edgeCapacity );
|
||||||
_check ( overlaps );
|
_check ( overlaps );
|
||||||
Session::close ();
|
Session::close ();
|
||||||
|
|
||||||
|
@ -677,13 +669,13 @@ namespace Kite {
|
||||||
forEach ( Net*, inet, getCell()->getNets() ) {
|
forEach ( Net*, inet, getCell()->getNets() ) {
|
||||||
forEach ( Segment*, isegment, inet->getComponents().getSubSet<Segment*>() ) {
|
forEach ( Segment*, isegment, inet->getComponents().getSubSet<Segment*>() ) {
|
||||||
AutoSegment* autoSegment = ktbtSession->lookup ( *isegment );
|
AutoSegment* autoSegment = ktbtSession->lookup ( *isegment );
|
||||||
if ( !autoSegment ) continue;
|
if ( not autoSegment ) continue;
|
||||||
if ( !autoSegment->isCanonical() ) continue;
|
if ( not autoSegment->isCanonical() ) continue;
|
||||||
|
|
||||||
TrackElement* trackSegment = Session::lookup ( *isegment );
|
TrackElement* trackSegment = Session::lookup ( *isegment );
|
||||||
if ( !trackSegment ) {
|
if ( not trackSegment ) {
|
||||||
coherency = false;
|
coherency = false;
|
||||||
cerr << Bug("%p %s whithout Track Segment"
|
cerr << Bug("%p %s without Track Segment"
|
||||||
,autoSegment
|
,autoSegment
|
||||||
,getString(autoSegment).c_str()
|
,getString(autoSegment).c_str()
|
||||||
) << endl;
|
) << endl;
|
||||||
|
@ -731,8 +723,6 @@ namespace Kite {
|
||||||
_routingPlanes[depth]->destroy ();
|
_routingPlanes[depth]->destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
_kiteGrid->destroy ();
|
|
||||||
_kiteGrid = NULL;
|
|
||||||
Session::close ();
|
Session::close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ int main ( int argc, char *argv[] )
|
||||||
( "edge,e" , poptions::value<float>(&edgeCapacity)->default_value(65.0)
|
( "edge,e" , poptions::value<float>(&edgeCapacity)->default_value(65.0)
|
||||||
, "The egde density ratio applied on global router's edges." )
|
, "The egde density ratio applied on global router's edges." )
|
||||||
( "cell,c" , poptions::value<string>()
|
( "cell,c" , poptions::value<string>()
|
||||||
, "The name of the cell to load, whithout extension." )
|
, "The name of the cell to load, without extension." )
|
||||||
( "save,s" , poptions::bool_switch(&saveDesign)->default_value(false)
|
( "save,s" , poptions::bool_switch(&saveDesign)->default_value(false)
|
||||||
, "Save the routed design.");
|
, "Save the routed design.");
|
||||||
|
|
||||||
|
|
|
@ -23,9 +23,15 @@
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
|
#include <boost/filesystem/operations.hpp>
|
||||||
|
#include <boost/filesystem/fstream.hpp>
|
||||||
|
namespace bfs = boost::filesystem;
|
||||||
|
|
||||||
|
#include "hurricane/Warning.h"
|
||||||
#include "hurricane/Bug.h"
|
#include "hurricane/Bug.h"
|
||||||
#include "hurricane/RoutingPad.h"
|
#include "hurricane/RoutingPad.h"
|
||||||
#include "hurricane/Net.h"
|
#include "hurricane/Net.h"
|
||||||
|
@ -33,15 +39,16 @@
|
||||||
#include "crlcore/Utilities.h"
|
#include "crlcore/Utilities.h"
|
||||||
#include "crlcore/AllianceFramework.h"
|
#include "crlcore/AllianceFramework.h"
|
||||||
#include "crlcore/Measures.h"
|
#include "crlcore/Measures.h"
|
||||||
|
#include "katabatic/AutoContact.h"
|
||||||
|
#include "katabatic/GCellGrid.h"
|
||||||
|
|
||||||
#include "kite/DataNegociate.h"
|
#include "kite/DataNegociate.h"
|
||||||
#include "kite/TrackElement.h"
|
#include "kite/TrackElement.h"
|
||||||
#include "kite/TrackMarker.h"
|
#include "kite/TrackMarker.h"
|
||||||
#include "kite/TrackCost.h"
|
#include "kite/TrackCost.h"
|
||||||
#include "kite/Track.h"
|
#include "kite/Track.h"
|
||||||
|
#include "kite/TrackSegment.h"
|
||||||
#include "kite/RoutingPlane.h"
|
#include "kite/RoutingPlane.h"
|
||||||
#include "kite/GCellGrid.h"
|
|
||||||
#include "kite/GCellRoutingSet.h"
|
|
||||||
#include "kite/RoutingEventQueue.h"
|
#include "kite/RoutingEventQueue.h"
|
||||||
#include "kite/RoutingEventHistory.h"
|
#include "kite/RoutingEventHistory.h"
|
||||||
#include "kite/NegociateWindow.h"
|
#include "kite/NegociateWindow.h"
|
||||||
|
@ -50,13 +57,115 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Hurricane;
|
using namespace Hurricane;
|
||||||
using namespace CRL;
|
using namespace CRL;
|
||||||
using namespace Kite;
|
using namespace Kite;
|
||||||
|
|
||||||
|
|
||||||
|
class Histogram {
|
||||||
|
public:
|
||||||
|
Histogram ( double range, double step, size_t nbSets );
|
||||||
|
~Histogram ();
|
||||||
|
void addSample ( double, size_t iset );
|
||||||
|
void toStream ( ostream& );
|
||||||
|
void toFile ( bfs::path& );
|
||||||
|
void toGnuplot ( string design );
|
||||||
|
void normalize ( double totalSamples, size_t iset );
|
||||||
|
private:
|
||||||
|
double _range;
|
||||||
|
double _step;
|
||||||
|
vector< vector<float> > _sets;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Histogram::Histogram ( double range, double step, size_t nbSets )
|
||||||
|
: _range (range)
|
||||||
|
, _step (step)
|
||||||
|
, _sets ()
|
||||||
|
{
|
||||||
|
size_t binSize = (size_t)rint ( _range / _step );
|
||||||
|
for ( size_t iset=0 ; iset<nbSets ; ++iset ) {
|
||||||
|
_sets.push_back ( vector<float>() );
|
||||||
|
for ( size_t i=0 ; i<binSize ; ++i ) _sets.back().push_back(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Histogram::~Histogram ()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
void Histogram::addSample ( double sample, size_t iset )
|
||||||
|
{
|
||||||
|
size_t binIndex = (size_t)rint ( sample / _step );
|
||||||
|
if ( binIndex > _sets.front().size() ) binIndex = _sets.front().size() - 1;
|
||||||
|
|
||||||
|
_sets[iset][binIndex] += 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Histogram::normalize ( double totalSamples, size_t iset )
|
||||||
|
{
|
||||||
|
for ( size_t i=0 ; i<_sets[iset].size() ; ++i ) _sets[iset][i] /= totalSamples;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Histogram::toStream ( ostream& o )
|
||||||
|
{
|
||||||
|
o << setprecision(3);
|
||||||
|
|
||||||
|
for ( size_t i=0 ; i<_sets.front().size() ; ++i ) {
|
||||||
|
for ( size_t iset=0 ; iset<_sets.size() ; ++iset ) {
|
||||||
|
o << _sets[iset][i] << " ";
|
||||||
|
}
|
||||||
|
o << "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Histogram::toFile ( bfs::path& path )
|
||||||
|
{
|
||||||
|
bfs::ofstream fd ( path );
|
||||||
|
toStream ( fd );
|
||||||
|
fd.close ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Histogram::toGnuplot ( string design )
|
||||||
|
{
|
||||||
|
bfs::path datFile = design + ".densityHist.dat";
|
||||||
|
toFile ( datFile );
|
||||||
|
|
||||||
|
bfs::path pltFile = design + ".densityHist.plt";
|
||||||
|
bfs::ofstream fd ( pltFile );
|
||||||
|
|
||||||
|
fd << "set grid\n";
|
||||||
|
fd << "set grid noxtics\n";
|
||||||
|
fd << "set xrange [-0.5:9.5]\n";
|
||||||
|
fd << "set xtics ( ";
|
||||||
|
for ( size_t i=0 ; i<10 ; ++i ) {
|
||||||
|
fd << ((i) ? " ," : "") << "\"<" << ((i+1)*10) << "%%\" " << i;
|
||||||
|
}
|
||||||
|
fd << " )\n";
|
||||||
|
|
||||||
|
fd << "set yrange [0:.4]\n";
|
||||||
|
fd << "set ytics ( ";
|
||||||
|
for ( float i=0.0 ; i<=40.0 ; i+=10.0 ) {
|
||||||
|
fd << ((i != 0.0) ? " ," : "") << "\"" << i << "%%\" " << (i/100.0);
|
||||||
|
}
|
||||||
|
fd << " )\n";
|
||||||
|
|
||||||
|
fd << "set style histogram cluster gap 1\n";
|
||||||
|
fd << "set style fill solid noborder\n";
|
||||||
|
fd << "set boxwidth 1\n";
|
||||||
|
fd << "plot \"" << design << ".densityHist.dat\" using 1 title \"Avg. density\" with histogram linecolor rgb \"green\", \\\n";
|
||||||
|
fd << " \"" << design << ".densityHist.dat\" using 2 title \"Peak. density\" with histogram linecolor rgb \"red\"\n";
|
||||||
|
|
||||||
|
fd.close ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void NegociateOverlapCost ( const TrackElement* segment, TrackCost& cost )
|
void NegociateOverlapCost ( const TrackElement* segment, TrackCost& cost )
|
||||||
{
|
{
|
||||||
Interval intersect = segment->getCanonicalInterval();
|
Interval intersect = segment->getCanonicalInterval();
|
||||||
|
@ -64,7 +173,7 @@ namespace {
|
||||||
if ( not intersect.intersect ( cost.getInterval() ) ) return;
|
if ( not intersect.intersect ( cost.getInterval() ) ) return;
|
||||||
|
|
||||||
if ( segment->isBlockage() or segment->isFixed() ) {
|
if ( segment->isBlockage() or segment->isFixed() ) {
|
||||||
//ltrace(200) << "Infinite cost from: " << segment << endl;
|
ltrace(200) << "Infinite cost from: " << segment << endl;
|
||||||
cost.setInfinite ();
|
cost.setInfinite ();
|
||||||
cost.setOverlap ();
|
cost.setOverlap ();
|
||||||
cost.setHardOverlap ();
|
cost.setHardOverlap ();
|
||||||
|
@ -81,7 +190,6 @@ namespace {
|
||||||
DataNegociate* data = segment->getDataNegociate ();
|
DataNegociate* data = segment->getDataNegociate ();
|
||||||
if ( not data ) return;
|
if ( not data ) return;
|
||||||
|
|
||||||
if ( data->getGCellOrder() >= Session::getOrder() ) {
|
|
||||||
cost.mergeRipupCount ( data->getRipupCount() );
|
cost.mergeRipupCount ( data->getRipupCount() );
|
||||||
if ( segment->isLocal() ) {
|
if ( segment->isLocal() ) {
|
||||||
cost.mergeDataState ( data->getState() );
|
cost.mergeDataState ( data->getState() );
|
||||||
|
@ -89,22 +197,15 @@ namespace {
|
||||||
ltrace(200) << "MaximumSlack/LocalVsGlobal for " << segment << endl;
|
ltrace(200) << "MaximumSlack/LocalVsGlobal for " << segment << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( /*(data->getGCellOrder() < Session::getOrder()) or*/
|
// if ( data->getRipupCount() > 3 ) {
|
||||||
((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 ();
|
// cost.setOverlap ();
|
||||||
cost.setOverlap ();
|
// cost.setHardOverlap ();
|
||||||
cost.setHardOverlap ();
|
// return;
|
||||||
return;
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
if ( ( data->getGCellOrder() < Session::getOrder() )
|
|
||||||
or ( ( data->getCost().getRightMinExtend() >= cost.getInterval().getVMin() )
|
|
||||||
and ( data->getCost().getLeftMinExtend () <= cost.getInterval().getVMax() ) ) )
|
|
||||||
cost.setHardOverlap ();
|
|
||||||
|
|
||||||
cost.setOverlap ();
|
cost.setOverlap ();
|
||||||
cost.incTerminals ( data->getCost().getTerminals()*100 );
|
cost.incTerminals ( data->getCost().getTerminals()*100 );
|
||||||
|
@ -139,13 +240,13 @@ namespace {
|
||||||
|
|
||||||
namespace Kite {
|
namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
using std::setw;
|
using std::setw;
|
||||||
using std::left;
|
using std::left;
|
||||||
using std::right;
|
using std::right;
|
||||||
using std::setprecision;
|
using std::setprecision;
|
||||||
|
using Hurricane::Warning;
|
||||||
using Hurricane::Bug;
|
using Hurricane::Bug;
|
||||||
using Hurricane::tab;
|
using Hurricane::tab;
|
||||||
using Hurricane::inltrace;
|
using Hurricane::inltrace;
|
||||||
|
@ -153,81 +254,33 @@ namespace Kite {
|
||||||
using Hurricane::ltraceout;
|
using Hurricane::ltraceout;
|
||||||
using Hurricane::ForEachIterator;
|
using Hurricane::ForEachIterator;
|
||||||
using CRL::addMeasure;
|
using CRL::addMeasure;
|
||||||
|
using Katabatic::AutoContact;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "NegociateWindow::RingSegment".
|
|
||||||
|
|
||||||
|
|
||||||
bool NegociateWindow::RingSegment::orderReached ( const NegociateWindow::RingSegment& segment )
|
|
||||||
{
|
|
||||||
return ( segment.getOrder() <= Session::getOrder() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NegociateWindow::RingSegment::RingSegment ( TrackElement* segment )
|
|
||||||
: _segment(segment), _order(0)
|
|
||||||
{
|
|
||||||
DataNegociate* data = segment->getDataNegociate ();
|
|
||||||
if ( data ) _order = data->getGCellOrder ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "NegociateWindow".
|
// Class : "NegociateWindow".
|
||||||
|
|
||||||
|
|
||||||
NegociateWindow::NegociateWindow ( KiteEngine* kite
|
NegociateWindow::NegociateWindow ( KiteEngine* kite )
|
||||||
, unsigned int columnMin
|
|
||||||
, unsigned int rowMin
|
|
||||||
, unsigned int columnMax
|
|
||||||
, unsigned int rowMax
|
|
||||||
)
|
|
||||||
: _slowMotion (0)
|
: _slowMotion (0)
|
||||||
, _interrupt (false)
|
, _interrupt (false)
|
||||||
, _kite (kite)
|
, _kite (kite)
|
||||||
, _gridBox (NULL)
|
, _gcells ()
|
||||||
, _criticalGCells ()
|
, _segments ()
|
||||||
, _gcellOrder (0)
|
|
||||||
, _gcellRoutingSets()
|
|
||||||
, _eventQueue ()
|
, _eventQueue ()
|
||||||
, _eventHistory()
|
, _eventHistory()
|
||||||
, _ring ()
|
{ }
|
||||||
{
|
|
||||||
_gridBox = GridBox<GCell>::create ( _kite->getGCellGrid()
|
|
||||||
, columnMin
|
|
||||||
, rowMin
|
|
||||||
, columnMax
|
|
||||||
, rowMax
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
NegociateWindow* NegociateWindow::create ( KiteEngine* kite
|
NegociateWindow* NegociateWindow::create ( KiteEngine* kite )
|
||||||
, unsigned int columnMin
|
|
||||||
, unsigned int rowMin
|
|
||||||
, unsigned int columnMax
|
|
||||||
, unsigned int rowMax
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
NegociateWindow* negociateWindow = new NegociateWindow ( kite
|
NegociateWindow* negociateWindow = new NegociateWindow ( kite );
|
||||||
, columnMin
|
|
||||||
, rowMin
|
|
||||||
, columnMax
|
|
||||||
, rowMax
|
|
||||||
);
|
|
||||||
return negociateWindow;
|
return negociateWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NegociateWindow::~NegociateWindow ()
|
NegociateWindow::~NegociateWindow ()
|
||||||
{
|
{ }
|
||||||
for ( size_t i=0 ; i<_gcellRoutingSets.size() ; i++ )
|
|
||||||
_gcellRoutingSets[i]->destroy ();
|
|
||||||
|
|
||||||
if ( _gridBox ) delete _gridBox;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void NegociateWindow::destroy ()
|
void NegociateWindow::destroy ()
|
||||||
|
@ -238,53 +291,10 @@ namespace Kite {
|
||||||
{ return _kite->getCell(); }
|
{ return _kite->getCell(); }
|
||||||
|
|
||||||
|
|
||||||
void NegociateWindow::addToRing ( TrackElement* segment )
|
void NegociateWindow::setGCells ( const Katabatic::GCellVector& gcells )
|
||||||
{
|
{
|
||||||
ltrace(200) << "addToRing: " << segment << endl;
|
_gcells = gcells;
|
||||||
|
//sort ( _gcells.begin(), _gcells.end(), Katabatic::GCell::CompareGCellById() );
|
||||||
_ring.push_back ( RingSegment(segment) );
|
|
||||||
|
|
||||||
DataNegociate* data = segment->getDataNegociate ();
|
|
||||||
data->setRing ( true );
|
|
||||||
data->setGCellOrder ( Session::getOrder() );
|
|
||||||
|
|
||||||
_eventQueue.add ( segment, 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void NegociateWindow::loadRouting ()
|
|
||||||
{
|
|
||||||
vector<GCell*> gcells;
|
|
||||||
GCellGrid* grid = getKiteEngine()->getGCellGrid();
|
|
||||||
|
|
||||||
forEach ( GCell*, igcell, grid->getGCells() ) {
|
|
||||||
gcells.push_back ( *igcell );
|
|
||||||
igcell->updateDensity ();
|
|
||||||
}
|
|
||||||
|
|
||||||
sort ( gcells.begin(), gcells.end(), GCell::CompareByDensity() );
|
|
||||||
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: After sort<>" << endl;
|
|
||||||
for ( size_t i=0 ; i < gcells.size() ; i++ ) {
|
|
||||||
cerr << "Order: "
|
|
||||||
<< setw(9) << left << setprecision(6) << gcells[i]->base()->getDensity()
|
|
||||||
<< setw(5) << right << gcells[i]->getIndex()
|
|
||||||
<< " " << gcells[i] << endl;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
unsigned int order = 0;
|
|
||||||
for ( size_t i=0 ; i < gcells.size() ; i++ ) {
|
|
||||||
if ( not gcells[i]->isInRoutingSet() ) {
|
|
||||||
Session::setOrder ( order );
|
|
||||||
GCellRoutingSet* rs = GCellRoutingSet::create ( gcells[i], _kite->getExpandStep() );
|
|
||||||
rs->expand ( grid );
|
|
||||||
rs->loadRouting ( order );
|
|
||||||
|
|
||||||
_gcellRoutingSets.push_back ( rs );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
loadRoutingPads ( this );
|
loadRoutingPads ( this );
|
||||||
Session::revalidate ();
|
Session::revalidate ();
|
||||||
|
@ -297,12 +307,7 @@ namespace Kite {
|
||||||
segment->getDataNegociate()->update();
|
segment->getDataNegociate()->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
getKiteEngine()->setMinimumWL ( grid->getTotalWireLength() );
|
_statistics.setGCellsCount ( _gcells.size() );
|
||||||
|
|
||||||
#if defined(CHECK_DATABASE)
|
|
||||||
unsigned int overlaps = 0;
|
|
||||||
Session::getKiteEngine()->_check(overlaps,"after LoadRouting");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -320,49 +325,159 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NegociateWindow::_unloadRing ()
|
TrackElement* NegociateWindow::addTrackSegment ( AutoSegment* autoSegment, bool loading )
|
||||||
{
|
{
|
||||||
_ring.erase ( remove_if(_ring.begin(),_ring.end(),RingSegment::orderReached), _ring.end() );
|
ltrace(200) << "NegociateWindow::addTrackSegment() - " << autoSegment << endl;
|
||||||
for ( size_t i=0 ; i<_ring.size() ; ++i ) {
|
ltracein(159);
|
||||||
if ( _ring[i].getSegment()->getTrack() != NULL )
|
|
||||||
Session::addRemoveEvent ( _ring[i].getSegment() );
|
// Special case: fixed AutoSegments must not interfere with blockages.
|
||||||
|
// Ugly: uses of getExtensionCap().
|
||||||
|
if ( autoSegment->isFixed() ) {
|
||||||
|
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(autoSegment->getLayer());
|
||||||
|
Track* track = plane->getTrackByPosition ( autoSegment->getAxis() );
|
||||||
|
size_t begin;
|
||||||
|
size_t end;
|
||||||
|
Interval fixedSpan;
|
||||||
|
Interval blockageSpan;
|
||||||
|
|
||||||
|
autoSegment->getCanonical ( fixedSpan );
|
||||||
|
fixedSpan.inflate ( Session::getExtensionCap()-1 );
|
||||||
|
|
||||||
|
track->getOverlapBounds ( fixedSpan, begin, end );
|
||||||
|
for ( ; (begin < end) ; begin++ ) {
|
||||||
|
|
||||||
|
TrackElement* other = track->getSegment(begin);
|
||||||
|
ltrace(200) << "| overlap: " << other << endl;
|
||||||
|
|
||||||
|
if ( not other->isBlockage() ) continue;
|
||||||
|
|
||||||
|
other->getCanonical ( blockageSpan );
|
||||||
|
blockageSpan.inflate(Session::getExtensionCap());
|
||||||
|
|
||||||
|
ltrace(200) << " fixed:" << fixedSpan << " vs. blockage:" << blockageSpan << endl;
|
||||||
|
|
||||||
|
if ( not fixedSpan.intersect(blockageSpan) ) continue;
|
||||||
|
|
||||||
|
// Overlap between fixed & blockage.
|
||||||
|
ltrace(200) << "* Blockage overlap: " << autoSegment << endl;
|
||||||
|
Session::destroyRequest ( autoSegment );
|
||||||
|
|
||||||
|
cerr << Warning("Overlap between fixed %s and blockage at %s."
|
||||||
|
,getString(autoSegment).c_str(),getString(blockageSpan).c_str()) << endl;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Session::revalidate ();
|
Interval span;
|
||||||
|
autoSegment = autoSegment->getCanonical ( span );
|
||||||
|
|
||||||
|
bool created;
|
||||||
|
TrackElement* trackSegment = TrackSegment::create ( autoSegment, NULL, created );
|
||||||
|
|
||||||
|
if ( not loading )
|
||||||
|
ltrace(159) << "* lookup: " << autoSegment << endl;
|
||||||
|
|
||||||
|
if ( created ) {
|
||||||
|
ltrace(159) << "* " << trackSegment << endl;
|
||||||
|
|
||||||
|
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(autoSegment->getLayer());
|
||||||
|
Track* track = plane->getTrackByPosition ( autoSegment->getAxis() );
|
||||||
|
Interval uside = autoSegment->getAutoSource()->getGCell()->getUSide ( Constant::perpandicular(autoSegment->getDirection())/*, false */);
|
||||||
|
|
||||||
|
if ( track->getAxis() > uside.getVMax() ) track = track->getPrevious();
|
||||||
|
if ( track->getAxis() < uside.getVMin() ) track = track->getNext();
|
||||||
|
|
||||||
|
trackSegment->setAxis ( track->getAxis(), Katabatic::Realignate|Katabatic::AxisSet );
|
||||||
|
trackSegment->invalidate ();
|
||||||
|
|
||||||
|
if ( trackSegment->isFixed() ) {
|
||||||
|
Session::addInsertEvent ( trackSegment, track );
|
||||||
|
} else {
|
||||||
|
_segments.push_back ( trackSegment );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( not created and not loading ) {
|
||||||
|
ltrace(200) << "TrackSegment already exists (and not in loading stage)." << endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
ltraceout(159);
|
||||||
|
|
||||||
|
return trackSegment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NegociateWindow::_loadRing ()
|
double NegociateWindow::computeWirelength ()
|
||||||
{
|
{
|
||||||
unsigned int order = Session::getOrder ();
|
set<TrackElement*> accounteds;
|
||||||
for ( size_t i=0 ; i<_ring.size() ; i++ ) {
|
double totalWL = 0.0;
|
||||||
TrackElement* segment = _ring[i].getSegment();
|
|
||||||
DataNegociate* data = segment->getDataNegociate ();
|
|
||||||
|
|
||||||
data->resetRipupCount ();
|
for ( size_t igcell=0 ; igcell<_gcells.size() ; ++igcell ) {
|
||||||
data->resetStateCount ();
|
double gcellWL = 0.0;
|
||||||
data->setGCellOrder ( order );
|
Segment* segment;
|
||||||
if ( _ring[i].getOrder() == order ) {
|
TrackElement* trackSegment;
|
||||||
ltrace(200) << "Removing from ring: " << segment << endl;
|
|
||||||
data->setRing ( false );
|
vector<AutoContact*>* contacts = _gcells[igcell]->getContacts();
|
||||||
|
for ( size_t i=0 ; i<contacts->size() ; i++ ) {
|
||||||
|
forEach ( Hook*, ihook, (*contacts)[i]->getBodyHook()->getSlaveHooks() ) {
|
||||||
|
Hook* sourceHook = dynamic_cast<Segment::SourceHook*>(*ihook);
|
||||||
|
if ( not sourceHook ) continue;
|
||||||
|
|
||||||
|
segment = dynamic_cast<Segment*>(sourceHook->getComponent());
|
||||||
|
trackSegment = Session::lookup ( segment );
|
||||||
|
if ( trackSegment ) {
|
||||||
|
if ( accounteds.find(trackSegment) != accounteds.end() ) continue;
|
||||||
|
|
||||||
|
accounteds.insert ( trackSegment );
|
||||||
|
gcellWL += DbU::getLambda ( trackSegment->getLength() );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_eventQueue.add ( segment, 0 );
|
// Partial sum to limit rounding errors.
|
||||||
|
totalWL += gcellWL;
|
||||||
}
|
}
|
||||||
_eventQueue.commit ();
|
|
||||||
|
return totalWL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t NegociateWindow::_negociate ( const vector<TrackElement*>& segments )
|
void NegociateWindow::_createRouting ( Katabatic::GCell* gcell )
|
||||||
{
|
{
|
||||||
ltrace(150) << "NegociateWindow::_negociate() - " << segments.size() << endl;
|
ltrace(200) << "NegociateWindow::_createRouting() - " << gcell << endl;
|
||||||
|
ltracein(200);
|
||||||
|
|
||||||
|
Segment* segment;
|
||||||
|
AutoSegment* autoSegment;
|
||||||
|
|
||||||
|
ltrace(149) << "AutoSegments from AutoContacts" << endl;
|
||||||
|
vector<AutoContact*>* contacts = gcell->getContacts();
|
||||||
|
for ( size_t i=0 ; i<contacts->size() ; i++ ) {
|
||||||
|
forEach ( Component*, component, (*contacts)[i]->getSlaveComponents() ) {
|
||||||
|
segment = dynamic_cast<Segment*>(*component);
|
||||||
|
autoSegment = Session::base()->lookup ( segment );
|
||||||
|
ltrace(149) << autoSegment << endl;
|
||||||
|
if ( autoSegment and autoSegment->isCanonical() ) {
|
||||||
|
addTrackSegment ( autoSegment, true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ltrace(149) << "_segments.size():" << _segments.size() << endl;
|
||||||
|
ltraceout(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
size_t NegociateWindow::_negociate ()
|
||||||
|
{
|
||||||
|
ltrace(150) << "NegociateWindow::_negociate() - " << _segments.size() << endl;
|
||||||
ltracein(149);
|
ltracein(149);
|
||||||
|
|
||||||
unsigned long limit = _kite->getEventsLimit();
|
unsigned long limit = _kite->getEventsLimit();
|
||||||
|
|
||||||
_eventHistory.clear();
|
_eventHistory.clear();
|
||||||
_eventQueue.load ( segments );
|
_eventQueue.load ( _segments );
|
||||||
_loadRing ();
|
|
||||||
|
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
while ( not _eventQueue.empty() and not isInterrupted() ) {
|
while ( not _eventQueue.empty() and not isInterrupted() ) {
|
||||||
|
@ -370,11 +485,11 @@ namespace Kite {
|
||||||
|
|
||||||
event->process ( _eventQueue, _eventHistory );
|
event->process ( _eventQueue, _eventHistory );
|
||||||
if (tty::enabled()) {
|
if (tty::enabled()) {
|
||||||
cmess1 << " <FirstPass:Negociation - event:" << tty::bold << setw(7) << setfill('0')
|
cmess1 << " <event:" << tty::bold << setw(7) << setfill('0')
|
||||||
<< RoutingEvent::getProcesseds() << setfill(' ') << tty::reset << ">" << tty::cr;
|
<< RoutingEvent::getProcesseds() << setfill(' ') << tty::reset << ">" << tty::cr;
|
||||||
cmess1.flush ();
|
cmess1.flush ();
|
||||||
} else {
|
} else {
|
||||||
cmess2 << " <FirstPass:Negociation - event:" << setw(7) << setfill('0')
|
cmess2 << " <event:" << setw(7) << setfill('0')
|
||||||
<< RoutingEvent::getProcesseds() << setfill(' ') << "> id:"
|
<< RoutingEvent::getProcesseds() << setfill(' ') << "> id:"
|
||||||
<< event->getSegment()->getId() << " "
|
<< event->getSegment()->getId() << " "
|
||||||
<< event->getSegment()->getNet()->getName()
|
<< event->getSegment()->getNet()->getName()
|
||||||
|
@ -384,23 +499,6 @@ namespace Kite {
|
||||||
|
|
||||||
if ( RoutingEvent::getProcesseds() >= limit ) setInterrupt ( true );
|
if ( RoutingEvent::getProcesseds() >= limit ) setInterrupt ( true );
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
if ( not (RoutingEvent::getProcesseds() % 1000) ) {
|
|
||||||
sort ( _criticalGCells.begin(), _criticalGCells.end(), GCell::CompareByStiffness() );
|
|
||||||
for ( size_t igcell=0 ; igcell<_criticalGCells.size() ; ++igcell ) {
|
|
||||||
if ( _criticalGCells[igcell]->getStiffness () < 0.7 ) break;
|
|
||||||
if ( _criticalGCells[igcell]->getSegmentCount() < 20 ) continue;
|
|
||||||
|
|
||||||
cerr << " - Anticipate: " << _criticalGCells[igcell]
|
|
||||||
<< ":" << _criticalGCells[igcell]->getStiffness() << endl;
|
|
||||||
|
|
||||||
_criticalGCells[igcell]->anticipateRouting ( Session::getOrder() );
|
|
||||||
_eventQueue.load ( _criticalGCells[igcell]->getOwnedSegments() );
|
|
||||||
_criticalGCells[igcell]->setRouted ( true );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if (count and tty::enabled()) cmess1 << endl;
|
if (count and tty::enabled()) cmess1 << endl;
|
||||||
count = 0;
|
count = 0;
|
||||||
|
@ -420,12 +518,12 @@ namespace Kite {
|
||||||
event->process ( _eventQueue, _eventHistory );
|
event->process ( _eventQueue, _eventHistory );
|
||||||
|
|
||||||
if (tty::enabled()) {
|
if (tty::enabled()) {
|
||||||
cmess1 << " <SecondPass:Packing - event:"
|
cmess1 << " <event:"
|
||||||
<< tty::bold << tty::fgcolor(tty::Red) << setw(7) << setfill('0')
|
<< tty::bold << tty::fgcolor(tty::Red) << setw(7) << setfill('0')
|
||||||
<< RoutingEvent::getProcesseds() << setfill(' ') << tty::reset << ">" << tty::cr;
|
<< RoutingEvent::getProcesseds() << setfill(' ') << tty::reset << ">" << tty::cr;
|
||||||
cmess1.flush ();
|
cmess1.flush ();
|
||||||
} else {
|
} else {
|
||||||
cmess1 << " <SecondPass:Packing - event:" << setw(7) << setfill('0')
|
cmess1 << " <event:" << setw(7) << setfill('0')
|
||||||
<< RoutingEvent::getProcesseds() << setfill(' ') << ">" << endl;
|
<< RoutingEvent::getProcesseds() << setfill(' ') << ">" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,7 +532,6 @@ namespace Kite {
|
||||||
|
|
||||||
size_t eventsCount = _eventHistory.size();
|
size_t eventsCount = _eventHistory.size();
|
||||||
|
|
||||||
_unloadRing ();
|
|
||||||
_eventHistory.clear();
|
_eventHistory.clear();
|
||||||
_eventQueue.clear();
|
_eventQueue.clear();
|
||||||
|
|
||||||
|
@ -448,74 +545,39 @@ namespace Kite {
|
||||||
// Session::open ( _kiteEngine );
|
// Session::open ( _kiteEngine );
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
_statistics.setEventsCount ( eventsCount );
|
||||||
ltraceout(149);
|
ltraceout(149);
|
||||||
|
|
||||||
return eventsCount;
|
return eventsCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void NegociateWindow::_runOnGCellRoutingSet ( GCellRoutingSet* rs )
|
|
||||||
{
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: Routing set: " << rs << endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ltrace(200) << "Routing " << rs << endl;
|
|
||||||
ltracein(200);
|
|
||||||
|
|
||||||
cmess1 << " - Routing " << rs << endl;
|
|
||||||
|
|
||||||
vector<GCell*> gcells = rs->getGCells ();
|
|
||||||
for ( size_t i=0 ; i<gcells.size() ; i++ ) {
|
|
||||||
ltrace(200) << gcells[i] << endl;
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: GCell: " << gcells[i] << endl;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
Session::setOrder ( rs->getOrder() );
|
|
||||||
|
|
||||||
vector<TrackElement*> segments;
|
|
||||||
rs->loadBorder ( getKiteEngine()->getGCellGrid() );
|
|
||||||
rs->getOwnedSegments ( segments );
|
|
||||||
rs->setRouted ( true );
|
|
||||||
rs->getStatistics ().setEventsCount ( _negociate(segments) );
|
|
||||||
rs->freeBorder ();
|
|
||||||
|
|
||||||
ltraceout(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void NegociateWindow::run ( int slowMotion )
|
void NegociateWindow::run ( int slowMotion )
|
||||||
{
|
{
|
||||||
ltrace(150) << "NegociateWindow::run()" << endl;
|
ltrace(150) << "NegociateWindow::run()" << endl;
|
||||||
ltracein(149);
|
ltracein(149);
|
||||||
|
|
||||||
_criticalGCells = *(getKiteEngine()->getGCellGrid()->getGCellVector());
|
|
||||||
|
|
||||||
TrackElement::setOverlapCostCB ( NegociateOverlapCost );
|
TrackElement::setOverlapCostCB ( NegociateOverlapCost );
|
||||||
RoutingEvent::resetProcesseds ();
|
RoutingEvent::resetProcesseds ();
|
||||||
|
|
||||||
// sort ( gcells.begin(), gcells.end(), GCell::CompareByStiffness() );
|
for ( size_t igcell=0 ; igcell<_gcells.size() ; ++igcell ) {
|
||||||
// for ( size_t j=0 ; j<gcells.size() ; ++j ) {
|
_createRouting ( _gcells[igcell] );
|
||||||
// cerr << " INITIAL stiff: " << gcells[j] << ":" << gcells[j]->getStiffness() << endl;
|
}
|
||||||
// }
|
Session::revalidate ();
|
||||||
|
|
||||||
|
getKiteEngine()->setMinimumWL ( computeWirelength() );
|
||||||
|
|
||||||
|
#if defined(CHECK_DATABASE)
|
||||||
|
unsigned int overlaps = 0;
|
||||||
|
Session::getKiteEngine()->_check(overlaps,"after _createRouting(GCell*)");
|
||||||
|
#endif
|
||||||
|
|
||||||
_slowMotion = slowMotion;
|
_slowMotion = slowMotion;
|
||||||
_gcellOrder = 0;
|
_negociate ();
|
||||||
for ( size_t i=0 ; (i<_gcellRoutingSets.size()) && !isInterrupted() ; i++ ) {
|
|
||||||
_runOnGCellRoutingSet ( _gcellRoutingSets[i] );
|
|
||||||
|
|
||||||
// sort ( gcells.begin(), gcells.end(), GCell::CompareByStiffness() );
|
|
||||||
// for ( size_t j=0 ; j<gcells.size() ; ++j ) {
|
|
||||||
// cerr << " stiff: " << gcells[j] << ":" << gcells[j]->getStiffness() << endl;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
Session::get()->isEmpty();
|
Session::get()->isEmpty();
|
||||||
|
|
||||||
# if defined(CHECK_DATABASE)
|
# if defined(CHECK_DATABASE)
|
||||||
unsigned int overlaps = 0;
|
|
||||||
_kite->_check ( overlaps, "after negociation" );
|
_kite->_check ( overlaps, "after negociation" );
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
@ -526,29 +588,31 @@ namespace Kite {
|
||||||
void NegociateWindow::printStatistics () const
|
void NegociateWindow::printStatistics () const
|
||||||
{
|
{
|
||||||
cmess1 << " o Computing statistics." << endl;
|
cmess1 << " o Computing statistics." << endl;
|
||||||
|
|
||||||
Statistics globalStatistics;
|
|
||||||
size_t biggestEventsCount = 0;
|
|
||||||
size_t biggestRSsize = 0;
|
|
||||||
for ( size_t i=0; i<_gcellRoutingSets.size() ; i++ ) {
|
|
||||||
Statistics& statistics = _gcellRoutingSets[i]->getStatistics();
|
|
||||||
globalStatistics += statistics;
|
|
||||||
|
|
||||||
if ( statistics.getEventsCount() > biggestEventsCount )
|
|
||||||
biggestEventsCount = statistics.getEventsCount();
|
|
||||||
|
|
||||||
if ( _gcellRoutingSets[i]->getGCells().size() > biggestRSsize )
|
|
||||||
biggestRSsize = _gcellRoutingSets[i]->getGCells().size();
|
|
||||||
}
|
|
||||||
|
|
||||||
cmess1 << Dots::asSizet(" - Processeds Events Total",RoutingEvent::getProcesseds()) << endl;
|
cmess1 << Dots::asSizet(" - Processeds Events Total",RoutingEvent::getProcesseds()) << endl;
|
||||||
cmess1 << Dots::asSizet(" - Unique Events Total"
|
cmess1 << Dots::asSizet(" - Unique Events Total"
|
||||||
,(RoutingEvent::getProcesseds() - RoutingEvent::getCloneds())) << endl;
|
,(RoutingEvent::getProcesseds() - RoutingEvent::getCloneds())) << endl;
|
||||||
cmess1 << Dots::asSizet(" - Biggest Events Chunk" ,biggestEventsCount) << endl;
|
cmess1 << Dots::asSizet(" - # of GCells",_statistics.getGCellsCount()) << endl;
|
||||||
cmess1 << Dots::asSizet(" - Biggest Routing Set" ,biggestRSsize) << endl;
|
|
||||||
|
|
||||||
addMeasure<size_t>( getCell(), "Events" , RoutingEvent::getProcesseds(), 12 );
|
addMeasure<size_t>( getCell(), "Events" , RoutingEvent::getProcesseds(), 12 );
|
||||||
addMeasure<size_t>( getCell(), "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 );
|
addMeasure<size_t>( getCell(), "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 );
|
||||||
|
|
||||||
|
Histogram densityHistogram ( 1.0, 0.1, 2 );
|
||||||
|
|
||||||
|
const Katabatic::GCellVector* gcells = getKiteEngine()->getGCellGrid()->getGCellVector();
|
||||||
|
|
||||||
|
getKiteEngine()->getGCellGrid()->setDensityMode ( Katabatic::GCellGrid::AverageHVDensity );
|
||||||
|
for ( size_t igcell=0 ; igcell<(*gcells).size() ; ++igcell ) {
|
||||||
|
densityHistogram.addSample ( (*gcells)[igcell]->getDensity(), 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
getKiteEngine()->getGCellGrid()->setDensityMode ( Katabatic::GCellGrid::MaxDensity );
|
||||||
|
for ( size_t igcell=0 ; igcell<(*gcells).size() ; ++igcell ) {
|
||||||
|
densityHistogram.addSample ( (*gcells)[igcell]->getDensity(), 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
densityHistogram.normalize ( (*gcells).size(), 0 );
|
||||||
|
densityHistogram.normalize ( (*gcells).size(), 1 );
|
||||||
|
densityHistogram.toGnuplot ( getString(getCell()->getName()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -556,7 +620,7 @@ namespace Kite {
|
||||||
{
|
{
|
||||||
ostringstream os;
|
ostringstream os;
|
||||||
|
|
||||||
os << "<" << _getTypeName() << _gridBox << ">";
|
os << "<" << _getTypeName() << ">";
|
||||||
return ( os.str() );
|
return ( os.str() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -565,7 +629,7 @@ namespace Kite {
|
||||||
{
|
{
|
||||||
Record* record = new Record ( _getString() );
|
Record* record = new Record ( _getString() );
|
||||||
|
|
||||||
record->add ( getSlot ( "_gridBox" , _gridBox ) );
|
record->add ( getSlot ( "_gcells", _gcells ) );
|
||||||
return ( record );
|
return ( record );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@
|
||||||
#include "hurricane/Name.h"
|
#include "hurricane/Name.h"
|
||||||
#include "hurricane/RoutingPad.h"
|
#include "hurricane/RoutingPad.h"
|
||||||
#include "katabatic/AutoContact.h"
|
#include "katabatic/AutoContact.h"
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/DataNegociate.h"
|
#include "kite/DataNegociate.h"
|
||||||
#include "kite/TrackElement.h"
|
#include "kite/TrackElement.h"
|
||||||
#include "kite/Track.h"
|
#include "kite/Track.h"
|
||||||
#include "kite/RoutingPlane.h"
|
#include "kite/RoutingPlane.h"
|
||||||
|
#include "kite/NegociateWindow.h"
|
||||||
#include "kite/Session.h"
|
#include "kite/Session.h"
|
||||||
#include "kite/KiteEngine.h"
|
#include "kite/KiteEngine.h"
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ namespace {
|
||||||
|
|
||||||
|
|
||||||
void getPerpandiculars ( TrackElement* segment
|
void getPerpandiculars ( TrackElement* segment
|
||||||
, AutoContact* from
|
, Katabatic::AutoContact* from
|
||||||
, unsigned int direction
|
, unsigned int direction
|
||||||
, vector<TrackElement*>& perpandiculars
|
, vector<TrackElement*>& perpandiculars
|
||||||
)
|
)
|
||||||
|
@ -94,7 +94,7 @@ namespace {
|
||||||
if ( parallel->isFixed () ) continue;
|
if ( parallel->isFixed () ) continue;
|
||||||
if ( parallel->getDirection() != direction ) continue;
|
if ( parallel->getDirection() != direction ) continue;
|
||||||
|
|
||||||
AutoContact* contact = parallel->base()->getAutoSource();
|
Katabatic::AutoContact* contact = parallel->base()->getAutoSource();
|
||||||
if ( contact->base()->getAnchor() != rp ) contact = NULL;
|
if ( contact->base()->getAnchor() != rp ) contact = NULL;
|
||||||
|
|
||||||
if ( contact == NULL ) contact = parallel->base()->getAutoTarget();
|
if ( contact == NULL ) contact = parallel->base()->getAutoTarget();
|
||||||
|
@ -114,7 +114,7 @@ namespace {
|
||||||
|
|
||||||
Track* track = segment->getTrack();
|
Track* track = segment->getTrack();
|
||||||
unsigned int direction = Session::getRoutingGauge()->getLayerDirection(segment->getLayer());
|
unsigned int direction = Session::getRoutingGauge()->getLayerDirection(segment->getLayer());
|
||||||
AutoContact* source = segment->base()->getAutoSource();
|
Katabatic::AutoContact* source = segment->base()->getAutoSource();
|
||||||
RoutingPad* rp = NULL;
|
RoutingPad* rp = NULL;
|
||||||
Interval uside = source->getGCell()->getUSide(direction);
|
Interval uside = source->getGCell()->getUSide(direction);
|
||||||
DbU::Unit minConstraint = DbU::Min;
|
DbU::Unit minConstraint = DbU::Min;
|
||||||
|
@ -222,11 +222,11 @@ namespace {
|
||||||
if ( segment->getLayer() != metal2 ) continue;
|
if ( segment->getLayer() != metal2 ) continue;
|
||||||
if ( segment->getLength() >= DbU::lambda(5.0) ) continue;
|
if ( segment->getLength() >= DbU::lambda(5.0) ) continue;
|
||||||
|
|
||||||
AutoContact* support = segment->base()->getAutoSource();
|
Katabatic::AutoContact* support = segment->base()->getAutoSource();
|
||||||
RoutingPad* rp = dynamic_cast<RoutingPad*>(support->getAnchor());
|
RoutingPad* rp = dynamic_cast<RoutingPad*>(support->getAnchor());
|
||||||
GCell* gcell = Session::lookup ( support->getGCell() );
|
|
||||||
|
|
||||||
AutoContact* source = AutoContact::fromRp ( gcell->base()
|
Katabatic::AutoContact* source
|
||||||
|
= Katabatic::AutoContact::fromRp ( support->getGCell()
|
||||||
, rp
|
, rp
|
||||||
, metal3
|
, metal3
|
||||||
, rp->getSourcePosition()
|
, rp->getSourcePosition()
|
||||||
|
@ -234,7 +234,8 @@ namespace {
|
||||||
, true
|
, true
|
||||||
);
|
);
|
||||||
|
|
||||||
AutoContact* target = AutoContact::fromRp ( gcell->base()
|
Katabatic::AutoContact* target =
|
||||||
|
Katabatic::AutoContact::fromRp ( support->getGCell()
|
||||||
, rp
|
, rp
|
||||||
, metal3
|
, metal3
|
||||||
, rp->getSourcePosition()
|
, rp->getSourcePosition()
|
||||||
|
@ -250,7 +251,7 @@ namespace {
|
||||||
, false
|
, false
|
||||||
);
|
);
|
||||||
segment->setFixed ( true );
|
segment->setFixed ( true );
|
||||||
GCell::addTrackSegment ( gcell, segment, true );
|
Session::getNegociateWindow()->addTrackSegment ( segment, true );
|
||||||
|
|
||||||
#if DISABLED
|
#if DISABLED
|
||||||
// Force slackening.
|
// Force slackening.
|
||||||
|
|
|
@ -26,20 +26,16 @@
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "hurricane/Bug.h"
|
#include "hurricane/Bug.h"
|
||||||
#include "hurricane/DebugSession.h"
|
#include "hurricane/DebugSession.h"
|
||||||
#include "hurricane/Breakpoint.h"
|
#include "hurricane/Breakpoint.h"
|
||||||
#include "hurricane/Net.h"
|
#include "hurricane/Net.h"
|
||||||
#include "hurricane/Layer.h"
|
#include "hurricane/Layer.h"
|
||||||
|
|
||||||
#include "katabatic/AutoContact.h"
|
#include "katabatic/AutoContact.h"
|
||||||
|
|
||||||
#include "kite/DataNegociate.h"
|
#include "kite/DataNegociate.h"
|
||||||
#include "kite/TrackElement.h"
|
#include "kite/TrackElement.h"
|
||||||
#include "kite/Track.h"
|
#include "kite/Track.h"
|
||||||
#include "kite/Tracks.h"
|
#include "kite/Tracks.h"
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/RoutingPlane.h"
|
#include "kite/RoutingPlane.h"
|
||||||
#include "kite/RoutingEvent.h"
|
#include "kite/RoutingEvent.h"
|
||||||
#include "kite/RoutingEventHistory.h"
|
#include "kite/RoutingEventHistory.h"
|
||||||
|
@ -229,9 +225,12 @@ namespace {
|
||||||
inline size_t getEnd () const;
|
inline size_t getEnd () const;
|
||||||
inline size_t getLength () const;
|
inline size_t getLength () const;
|
||||||
inline Interval getConflict ( size_t );
|
inline Interval getConflict ( size_t );
|
||||||
|
inline DbU::Unit getBreakPos () const;
|
||||||
|
inline DbU::Unit getConflictLength () const;
|
||||||
inline void setBegin ( size_t );
|
inline void setBegin ( size_t );
|
||||||
inline void setEnd ( size_t );
|
inline void setEnd ( size_t );
|
||||||
inline void addConflict ( const Interval& );
|
inline void addConflict ( const Interval& );
|
||||||
|
void consolidate ();
|
||||||
public:
|
public:
|
||||||
friend inline bool operator< ( const Cs1Candidate&, const Cs1Candidate& );
|
friend inline bool operator< ( const Cs1Candidate&, const Cs1Candidate& );
|
||||||
private:
|
private:
|
||||||
|
@ -239,6 +238,8 @@ namespace {
|
||||||
size_t _begin;
|
size_t _begin;
|
||||||
size_t _end;
|
size_t _end;
|
||||||
vector<Interval> _conflicts;
|
vector<Interval> _conflicts;
|
||||||
|
DbU::Unit _breakPos;
|
||||||
|
DbU::Unit _conflictLength;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -247,15 +248,23 @@ namespace {
|
||||||
, _begin (0)
|
, _begin (0)
|
||||||
, _end (0)
|
, _end (0)
|
||||||
, _conflicts ()
|
, _conflicts ()
|
||||||
|
, _breakPos (0)
|
||||||
|
, _conflictLength(0)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
inline Track* Cs1Candidate::getTrack () const { return _track; }
|
inline Track* Cs1Candidate::getTrack () const { return _track; }
|
||||||
inline size_t Cs1Candidate::getBegin () const { return _begin; }
|
inline size_t Cs1Candidate::getBegin () const { return _begin; }
|
||||||
inline size_t Cs1Candidate::getEnd () const { return _end; }
|
inline size_t Cs1Candidate::getEnd () const { return _end; }
|
||||||
inline size_t Cs1Candidate::getLength () const { return _conflicts.size(); }
|
inline size_t Cs1Candidate::getLength () const { return _conflicts.size(); }
|
||||||
|
inline DbU::Unit Cs1Candidate::getBreakPos () const { return _breakPos; }
|
||||||
inline void Cs1Candidate::setBegin ( size_t i ) { _begin=i; }
|
inline void Cs1Candidate::setBegin ( size_t i ) { _begin=i; }
|
||||||
inline void Cs1Candidate::setEnd ( size_t i ) { _end=i; }
|
inline void Cs1Candidate::setEnd ( size_t i ) { _end=i; }
|
||||||
inline void Cs1Candidate::addConflict ( const Interval& conflict ) { _conflicts.push_back(conflict); }
|
|
||||||
|
inline void Cs1Candidate::addConflict ( const Interval& conflict )
|
||||||
|
{
|
||||||
|
_conflicts.push_back(conflict);
|
||||||
|
_conflictLength += conflict.getSize();
|
||||||
|
}
|
||||||
|
|
||||||
inline Interval Cs1Candidate::getConflict ( size_t i )
|
inline Interval Cs1Candidate::getConflict ( size_t i )
|
||||||
{
|
{
|
||||||
|
@ -264,7 +273,30 @@ namespace {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool operator< ( const Cs1Candidate& lhs, const Cs1Candidate& rhs )
|
inline bool operator< ( const Cs1Candidate& lhs, const Cs1Candidate& rhs )
|
||||||
{ return lhs._conflicts.size() < rhs._conflicts.size(); }
|
{
|
||||||
|
DbU::Unit delta = lhs._conflicts.size() - rhs._conflicts.size();
|
||||||
|
if ( delta < 0 ) return true;
|
||||||
|
if ( delta > 0 ) return false;
|
||||||
|
|
||||||
|
return lhs._conflictLength < rhs._conflictLength;
|
||||||
|
}
|
||||||
|
//{ return lhs._conflictLength < rhs._conflictLength; }
|
||||||
|
|
||||||
|
void Cs1Candidate::consolidate ()
|
||||||
|
{
|
||||||
|
if ( _conflicts.size() > 0 ) {
|
||||||
|
DbU::Unit halfConflict = 0;
|
||||||
|
size_t i = 0;
|
||||||
|
for ( ; i<_conflicts.size() ; ++i ) {
|
||||||
|
halfConflict += _conflicts.size();
|
||||||
|
if ( halfConflict > _conflictLength/2 )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ugly: hard-coded pitch.
|
||||||
|
_breakPos = _conflicts[i].getVMin() - DbU::lambda(5.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
@ -758,27 +790,12 @@ namespace {
|
||||||
data->setRipupCount ( Session::getKiteEngine()->getRipupLimit(_segment) );
|
data->setRipupCount ( Session::getKiteEngine()->getRipupLimit(_segment) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( data->getGCellOrder() == Session::getOrder() ) {
|
if ( _segment->getTrack() ) Session::addRemoveEvent ( _segment );
|
||||||
// Current order, default behavior: ripup.
|
|
||||||
if ( _segment->getTrack() )
|
|
||||||
Session::addRemoveEvent ( _segment );
|
|
||||||
} else if ( data->getGCellOrder() < Session::getOrder() ) {
|
|
||||||
// Order is lower: no longer able to displace it.
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
// Order is greater, do not route now. Ripup if needed.
|
|
||||||
if ( _segment->getTrack() )
|
|
||||||
Session::addRemoveEvent ( _segment );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
RoutingEvent* event = data->getRoutingEvent();
|
RoutingEvent* event = data->getRoutingEvent();
|
||||||
if ( event == NULL ) {
|
if ( event == NULL ) {
|
||||||
if ( data->getGCellOrder() == Session::getOrder() ) {
|
|
||||||
cerr << Bug("Missing Event on %p:%s"
|
cerr << Bug("Missing Event on %p:%s"
|
||||||
,_segment->base()->base(),getString(_segment).c_str()) << endl;
|
,_segment->base()->base(),getString(_segment).c_str()) << endl;
|
||||||
}
|
|
||||||
ltrace(200) << "Not in current GCellRoutingSet, cancelled." << endl;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -890,10 +907,11 @@ namespace {
|
||||||
, PerpandicularsFirst = 0x08
|
, PerpandicularsFirst = 0x08
|
||||||
, ToMoveUp = 0x10
|
, ToMoveUp = 0x10
|
||||||
, AllowLocalMoveUp = 0x20
|
, AllowLocalMoveUp = 0x20
|
||||||
, NoDoglegReuse = 0x40
|
, AllowTerminalMoveUp = 0x40
|
||||||
|
, NoDoglegReuse = 0x80
|
||||||
};
|
};
|
||||||
enum { LeftAxisHint=1, RightAxisHint=2 };
|
enum { LeftAxisHint=1, RightAxisHint=2 };
|
||||||
enum { NoRingLimit=0x1, HasNextRipup=0x2 };
|
enum { HasNextRipup=0x2 };
|
||||||
public:
|
public:
|
||||||
Manipulator ( TrackElement*, State& );
|
Manipulator ( TrackElement*, State& );
|
||||||
~Manipulator ();
|
~Manipulator ();
|
||||||
|
@ -964,10 +982,6 @@ namespace {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CHECK_DETERMINISM)
|
|
||||||
cerr << "Order: " << _data->getGCellOrder() << " - " << _data->getCost() << endl;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_data->update ();
|
_data->update ();
|
||||||
_event->invalidate ( true ); // Optimizable.
|
_event->invalidate ( true ); // Optimizable.
|
||||||
_event->revalidate ( true );
|
_event->revalidate ( true );
|
||||||
|
@ -1018,28 +1032,6 @@ namespace {
|
||||||
}
|
}
|
||||||
ltraceout(148);
|
ltraceout(148);
|
||||||
|
|
||||||
if ( _data->isBorder() and (_costs.size() == 1) and _costs[0].isInfinite() ) {
|
|
||||||
Interval span;
|
|
||||||
if ( _data->isLeftBorder() ) {
|
|
||||||
span = Interval ( segment->getCanonicalInterval().getVMin()
|
|
||||||
, segment->getCanonicalInterval().getVMin()+DbU::lambda(5.0) );
|
|
||||||
} else {
|
|
||||||
span = Interval ( segment->getCanonicalInterval().getVMax()-DbU::lambda(5.0)
|
|
||||||
, segment->getCanonicalInterval().getVMax() );
|
|
||||||
}
|
|
||||||
|
|
||||||
Track* track = _costs[0].getTrack();
|
|
||||||
_costs[0] = track->getOverlapCost ( span, segment->getNet() );
|
|
||||||
_costs[0].setAxisWeight ( _event->getAxisWeight(track->getAxis()) );
|
|
||||||
_costs[0].incDeltaPerpand ( _data->getCost().getWiringDelta(track->getAxis()) );
|
|
||||||
|
|
||||||
if ( segment->isGlobal() and (_costs[0].getDataState() == DataNegociate::MaximumSlack) )
|
|
||||||
_costs[0].setInfinite ();
|
|
||||||
|
|
||||||
_costs[0].consolidate ();
|
|
||||||
ltrace(200) << "Replace: " << _costs[0] << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( _costs.empty() ) {
|
if ( _costs.empty() ) {
|
||||||
Track* nearest = plane->getTrackByPosition(_constraint.getCenter());
|
Track* nearest = plane->getTrackByPosition(_constraint.getCenter());
|
||||||
|
|
||||||
|
@ -1175,7 +1167,7 @@ namespace {
|
||||||
else
|
else
|
||||||
breakPoint = Point ( segment->getAxis(), (sourceDogLeg)?minConflict:maxConflict );
|
breakPoint = Point ( segment->getAxis(), (sourceDogLeg)?minConflict:maxConflict );
|
||||||
|
|
||||||
GCell* dogLegGCell = Session::getGCellUnder ( breakPoint.getX(), breakPoint.getY() );
|
Katabatic::GCell* dogLegGCell = Session::getGCellUnder ( breakPoint.getX(), breakPoint.getY() );
|
||||||
if ( dogLegGCell ) {
|
if ( dogLegGCell ) {
|
||||||
if ( segment->canDogLegAt(dogLegGCell) ) {
|
if ( segment->canDogLegAt(dogLegGCell) ) {
|
||||||
if ( segment->makeDogLeg(dogLegGCell) )
|
if ( segment->makeDogLeg(dogLegGCell) )
|
||||||
|
@ -1191,7 +1183,7 @@ namespace {
|
||||||
else
|
else
|
||||||
breakPoint = Point ( segment->getAxis(), (targetDogLeg)?maxConflict:minConflict );
|
breakPoint = Point ( segment->getAxis(), (targetDogLeg)?maxConflict:minConflict );
|
||||||
|
|
||||||
GCell* dogLegGCell = Session::getGCellUnder ( breakPoint.getX(), breakPoint.getY() );
|
Katabatic::GCell* dogLegGCell = Session::getGCellUnder ( breakPoint.getX(), breakPoint.getY() );
|
||||||
if ( dogLegGCell ) {
|
if ( dogLegGCell ) {
|
||||||
if ( segment->canDogLegAt(dogLegGCell) ) {
|
if ( segment->canDogLegAt(dogLegGCell) ) {
|
||||||
if ( segment->makeDogLeg(dogLegGCell) )
|
if ( segment->makeDogLeg(dogLegGCell) )
|
||||||
|
@ -1227,14 +1219,9 @@ namespace {
|
||||||
ltrace(200) << "State::conflictSolve1()" << endl;
|
ltrace(200) << "State::conflictSolve1()" << endl;
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
|
|
||||||
//bool success = false;
|
|
||||||
Interval constraints;
|
Interval constraints;
|
||||||
vector<Track*> candidates;
|
vector<Track*> candidates;
|
||||||
TrackElement* segment = _event->getSegment();
|
TrackElement* segment = _event->getSegment();
|
||||||
//bool canMoveUp = (segment->isLocal()) ? segment->canPivotUp(0.5) : segment->canMoveUp(1.0);
|
|
||||||
//unsigned int relaxFlags = Manipulator::NoDoglegReuse
|
|
||||||
// | ((_data and (_data->getStateCount() < 2)) ? Manipulator::AllowExpand
|
|
||||||
// : Manipulator::NoExpand);
|
|
||||||
|
|
||||||
segment->base()->getConstraints ( constraints );
|
segment->base()->getConstraints ( constraints );
|
||||||
Interval overlap = segment->getCanonicalInterval();
|
Interval overlap = segment->getCanonicalInterval();
|
||||||
|
@ -1272,9 +1259,7 @@ namespace {
|
||||||
vector<GCell*> doglegGCells;
|
vector<GCell*> doglegGCells;
|
||||||
segment->getGCells ( gcells );
|
segment->getGCells ( gcells );
|
||||||
|
|
||||||
//unsigned int depth = Session::getRoutingGauge()->getLayerDepth(segment->getLayer());
|
|
||||||
Interval uside;
|
Interval uside;
|
||||||
|
|
||||||
size_t idogleg = 0;
|
size_t idogleg = 0;
|
||||||
for ( size_t igcell=0 ; igcell<gcells.size() ; igcell++ ) {
|
for ( size_t igcell=0 ; igcell<gcells.size() ; igcell++ ) {
|
||||||
uside = gcells[igcell]->getUSide(segment->getDirection(),true);
|
uside = gcells[igcell]->getUSide(segment->getDirection(),true);
|
||||||
|
@ -1373,10 +1358,19 @@ namespace {
|
||||||
candidates.back().addConflict ( otherOverlap );
|
candidates.back().addConflict ( otherOverlap );
|
||||||
ltrace(200) << " | Other overlap: " << otherOverlap << endl;
|
ltrace(200) << " | Other overlap: " << otherOverlap << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
candidates.back().consolidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
sort ( candidates.begin(), candidates.end() );
|
sort ( candidates.begin(), candidates.end() );
|
||||||
|
|
||||||
|
// if ( not candidates.empty() ) {
|
||||||
|
// ltrace(200) << "Trying l:" << candidates[0].getLength()
|
||||||
|
// << " " << candidates[0].getTrack() << endl;
|
||||||
|
|
||||||
|
// success = Manipulator(segment,*this).makeDogLeg ( candidates[0].getBreakPos() );
|
||||||
|
// }
|
||||||
|
|
||||||
for ( size_t icandidate=0 ; icandidate<candidates.size() ; icandidate++ ) {
|
for ( size_t icandidate=0 ; icandidate<candidates.size() ; icandidate++ ) {
|
||||||
ltrace(200) << "Trying l:" << candidates[icandidate].getLength()
|
ltrace(200) << "Trying l:" << candidates[icandidate].getLength()
|
||||||
<< " " << candidates[icandidate].getTrack() << endl;
|
<< " " << candidates[icandidate].getTrack() << endl;
|
||||||
|
@ -1390,12 +1384,15 @@ namespace {
|
||||||
Track* track = candidates[icandidate].getTrack();
|
Track* track = candidates[icandidate].getTrack();
|
||||||
TrackElement* other = track->getSegment(candidates[icandidate].getBegin());
|
TrackElement* other = track->getSegment(candidates[icandidate].getBegin());
|
||||||
|
|
||||||
if ( other->isGlobal()
|
// if ( other->isGlobal() and other->canMoveUp(1.0) ) {
|
||||||
and (other->getDataNegociate()->getGCellOrder() == Session::getOrder())
|
// ltrace(200) << "conflictSolve1() - One conflict, other move up ["
|
||||||
and other->canMoveUp(1.0) ) {
|
// << candidates[icandidate].getBegin() << "]" << endl;
|
||||||
|
// if ( (success = other->moveUp()) ) break;
|
||||||
|
// }
|
||||||
|
if ( other->isGlobal() ) {
|
||||||
ltrace(200) << "conflictSolve1() - One conflict, other move up ["
|
ltrace(200) << "conflictSolve1() - One conflict, other move up ["
|
||||||
<< candidates[icandidate].getBegin() << "]" << endl;
|
<< candidates[icandidate].getBegin() << "]" << endl;
|
||||||
if ( (success = other->moveUp()) ) break;
|
if ( (success = Manipulator(other,*this).moveUp()) ) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ltrace(200) << "conflictSolve1() - One conflict, relaxing self" << endl;
|
ltrace(200) << "conflictSolve1() - One conflict, relaxing self" << endl;
|
||||||
|
@ -1595,43 +1592,7 @@ namespace {
|
||||||
if ( (not segment) or (not data) ) { ltraceout(200); DebugSession::close(); return false; }
|
if ( (not segment) or (not data) ) { ltraceout(200); DebugSession::close(); return false; }
|
||||||
if ( segment == _event->getSegment() ) _event->resetInsertState();
|
if ( segment == _event->getSegment() ) _event->resetInsertState();
|
||||||
|
|
||||||
if ( not (data->isBorder() or data->isRing()) ) {
|
|
||||||
data->resetRipupCount ();
|
data->resetRipupCount ();
|
||||||
} else {
|
|
||||||
if ( not Manipulator(segment,*this).canRipup(Manipulator::NoRingLimit) ) {
|
|
||||||
cerr << "[UNSOLVED] " << segment << " slacken topology not allowed for border/ring." << endl;
|
|
||||||
ltraceout(200);
|
|
||||||
DebugSession::close ();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ring cases.
|
|
||||||
if ( data->isBorder() ) {
|
|
||||||
ltrace(200) << "Segment is Ripup only (border), bypass to Unimplemented." << endl;
|
|
||||||
if ( not Manipulator(segment,*this).canRipup (Manipulator::NoRingLimit) ) {
|
|
||||||
ltrace(200) << "Cannot ripup, bypass to Unimplemented." << endl;
|
|
||||||
data->setState ( DataNegociate::Unimplemented );
|
|
||||||
} else {
|
|
||||||
ltrace(200) << "Refusing to slacken border segment." << endl;
|
|
||||||
ltraceout(200);
|
|
||||||
DebugSession::close ();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( data->isRing() ) {
|
|
||||||
ltrace(200) << "Segment is Ripup only (ring), back-propagate to perpandiculars." << endl;
|
|
||||||
// Do not change the state.
|
|
||||||
//data->setState ( DataNegociate::Unimplemented );
|
|
||||||
success = Manipulator(segment,*this).ripupPerpandiculars(Manipulator::ToRipupLimit
|
|
||||||
|Manipulator::PerpandicularsFirst
|
|
||||||
|Manipulator::ToMoveUp);
|
|
||||||
repush = false;
|
|
||||||
if ( not success ) {
|
|
||||||
data->setState ( DataNegociate::Unimplemented );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Normal cases.
|
// Normal cases.
|
||||||
if ( not blocked and not success ) {
|
if ( not blocked and not success ) {
|
||||||
|
@ -1753,7 +1714,8 @@ namespace {
|
||||||
success = Manipulator(segment,*this).pivotUp();
|
success = Manipulator(segment,*this).pivotUp();
|
||||||
if ( not success ) {
|
if ( not success ) {
|
||||||
cerr << "BLOCKAGE MOVE UP " << segment << endl;
|
cerr << "BLOCKAGE MOVE UP " << segment << endl;
|
||||||
success = Manipulator(segment,*this).moveUp(Manipulator::AllowLocalMoveUp);
|
success = Manipulator(segment,*this).moveUp
|
||||||
|
(Manipulator::AllowLocalMoveUp|Manipulator::AllowTerminalMoveUp);
|
||||||
}
|
}
|
||||||
if ( not success ) {
|
if ( not success ) {
|
||||||
cerr << "[ERROR] Tighly constrained segment overlapping a blockage." << endl;
|
cerr << "[ERROR] Tighly constrained segment overlapping a blockage." << endl;
|
||||||
|
@ -1792,28 +1754,30 @@ namespace {
|
||||||
case DataNegociate::Slacken:
|
case DataNegociate::Slacken:
|
||||||
ltrace(200) << "Global, State: Slacken." << endl;
|
ltrace(200) << "Global, State: Slacken." << endl;
|
||||||
if ( (success = Manipulator(segment,*this).slacken()) ) {
|
if ( (success = Manipulator(segment,*this).slacken()) ) {
|
||||||
nextState = DataNegociate::ConflictSolve1;
|
nextState = DataNegociate::MoveUp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DataNegociate::MoveUp:
|
||||||
|
ltrace(200) << "Global, State: MoveUp." << endl;
|
||||||
|
if ( (success = Manipulator(segment,*this).moveUp()) ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
nextState = DataNegociate::ConflictSolve1;
|
||||||
|
break;
|
||||||
case DataNegociate::ConflictSolve1:
|
case DataNegociate::ConflictSolve1:
|
||||||
case DataNegociate::ConflictSolve2:
|
case DataNegociate::ConflictSolve2:
|
||||||
ltrace(200) << "Global, State: ConflictSolve1 or ConflictSolve2." << endl;
|
ltrace(200) << "Global, State: ConflictSolve1 or ConflictSolve2." << endl;
|
||||||
if ( not (flags & NoRecursive) ) {
|
if ( not (flags & NoRecursive) ) {
|
||||||
if ( (success = conflictSolve1 ()) ) {
|
if ( (success = conflictSolve1 ()) ) {
|
||||||
nextState = DataNegociate::ConflictSolve1;
|
if ( segment->canMoveUp(0.0) )
|
||||||
if ( data->getStateCount() > 3 )
|
|
||||||
nextState = DataNegociate::MoveUp;
|
nextState = DataNegociate::MoveUp;
|
||||||
break;
|
else {
|
||||||
}
|
if ( data->getStateCount() > 3 )
|
||||||
}
|
|
||||||
case DataNegociate::MoveUp:
|
|
||||||
ltrace(200) << "Global, State: MoveUp." << endl;
|
|
||||||
if ( (success = Manipulator(segment,*this).moveUp()) ) {
|
|
||||||
nextState = DataNegociate::ConflictSolve1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
nextState = DataNegociate::MaximumSlack;
|
nextState = DataNegociate::MaximumSlack;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
case DataNegociate::MaximumSlack:
|
case DataNegociate::MaximumSlack:
|
||||||
case DataNegociate::Unimplemented:
|
case DataNegociate::Unimplemented:
|
||||||
ltrace(200) << "Global, State: MaximumSlack or Unimplemented." << endl;
|
ltrace(200) << "Global, State: MaximumSlack or Unimplemented." << endl;
|
||||||
|
@ -1828,13 +1792,15 @@ namespace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( not (flags&NoTransition) ) data->setState ( nextState );
|
if ( not (flags&NoTransition) ) {
|
||||||
|
ltrace(200) << "Incrementing state (before): " << nextState << " count:" << data->getStateCount() << endl;
|
||||||
|
data->setState ( nextState );
|
||||||
|
ltrace(200) << "Incrementing state (after): " << nextState << " count:" << data->getStateCount() << endl;
|
||||||
|
}
|
||||||
|
|
||||||
if ( success ) {
|
if ( success ) {
|
||||||
if ( repush ) {
|
if ( repush ) {
|
||||||
if ( not (data->isRing() or data->isBorder()) )
|
|
||||||
actionFlags |= SegmentAction::ResetRipup;
|
actionFlags |= SegmentAction::ResetRipup;
|
||||||
|
|
||||||
addAction ( segment, actionFlags );
|
addAction ( segment, actionFlags );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1891,14 +1857,8 @@ namespace {
|
||||||
unsigned int limit = Session::getKiteEngine()->getRipupLimit(_segment);
|
unsigned int limit = Session::getKiteEngine()->getRipupLimit(_segment);
|
||||||
unsigned int count = _data->getRipupCount() + ((flags & HasNextRipup) ? 1 : 0);
|
unsigned int count = _data->getRipupCount() + ((flags & HasNextRipup) ? 1 : 0);
|
||||||
|
|
||||||
if ( not ( flags & NoRingLimit )
|
|
||||||
and (_data->isRing() or _data->isBorder())
|
|
||||||
and not (count < limit) )
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return (count < limit);
|
return (count < limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1938,20 +1898,12 @@ namespace {
|
||||||
bool Manipulator::ripup ( Interval overlap , unsigned int type, DbU::Unit axisHint, unsigned int toState )
|
bool Manipulator::ripup ( Interval overlap , unsigned int type, DbU::Unit axisHint, unsigned int toState )
|
||||||
{
|
{
|
||||||
ltrace(200) << "Manipulator::ripup(Interval) " << overlap << endl;
|
ltrace(200) << "Manipulator::ripup(Interval) " << overlap << endl;
|
||||||
ltrace(200) << "TrackElement:" << _data->getGCellOrder()
|
|
||||||
<< " < Session:" << Session::getOrder() << endl;
|
|
||||||
|
|
||||||
if ( not canRipup() ) return false;
|
if ( not canRipup() ) return false;
|
||||||
|
|
||||||
if ( _segment->isFixed() ) return false;
|
if ( _segment->isFixed() ) return false;
|
||||||
if ( _data == NULL ) return true;
|
if ( _data == NULL ) return true;
|
||||||
|
|
||||||
if ( _segment->getTrack() ) {
|
|
||||||
if ( _data->getGCellOrder() < Session::getOrder() ) {
|
|
||||||
return relax(overlap);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_S.addAction ( _segment, type, axisHint, toState );
|
_S.addAction ( _segment, type, axisHint, toState );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2000,15 +1952,13 @@ namespace {
|
||||||
|
|
||||||
// Try to ripup the perpandicular itself.
|
// Try to ripup the perpandicular itself.
|
||||||
DataNegociate* data2 = perpandiculars[i]->getDataNegociate();
|
DataNegociate* data2 = perpandiculars[i]->getDataNegociate();
|
||||||
if ( data2->getGCellOrder() == Session::getOrder() ) {
|
|
||||||
ltrace(200) << "| " << perpandiculars[i] << endl;
|
ltrace(200) << "| " << perpandiculars[i] << endl;
|
||||||
|
|
||||||
if ( (flags & Manipulator::ToMoveUp)
|
if ( (flags & Manipulator::ToMoveUp) and (data2->getState() < DataNegociate::MoveUp) )
|
||||||
and (data2->getState() < DataNegociate::MoveUp) )
|
|
||||||
data2->setState ( DataNegociate::MoveUp );
|
data2->setState ( DataNegociate::MoveUp );
|
||||||
|
|
||||||
if ( Manipulator(perpandiculars[i],_S).ripup(_event->getSegment()->getAxis()
|
if ( Manipulator(perpandiculars[i],_S).ripup(_event->getSegment()->getAxis()
|
||||||
,perpandicularActionFlags) )
|
,perpandicularActionFlags) ) {
|
||||||
if ( dislodgeCaged ) {
|
if ( dislodgeCaged ) {
|
||||||
// Ugly: hard-coded uses of pitch.
|
// Ugly: hard-coded uses of pitch.
|
||||||
_event->setAxisHint ( _event->getSegment()->getAxis() + DbU::lambda(5.0) );
|
_event->setAxisHint ( _event->getSegment()->getAxis() + DbU::lambda(5.0) );
|
||||||
|
@ -2028,21 +1978,13 @@ namespace {
|
||||||
|
|
||||||
Interval otherCanonical ( other->getCanonicalInterval() );
|
Interval otherCanonical ( other->getCanonicalInterval() );
|
||||||
if ( not otherCanonical.intersect(constraints) ) continue;
|
if ( not otherCanonical.intersect(constraints) ) continue;
|
||||||
if ( other->getDataNegociate()
|
|
||||||
and (other->getDataNegociate()->getGCellOrder() < Session::getOrder()) ) {
|
|
||||||
if ( otherCanonical.getVMin() < constraints.getVMin() )
|
|
||||||
constraints.shrinkVMin ( otherCanonical.getVMax() );
|
|
||||||
else
|
|
||||||
constraints.shrinkVMax ( otherCanonical.getVMin() );
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to ripup conflicting neighbor.
|
// Try to ripup conflicting neighbor.
|
||||||
if ( Manipulator(other,_S).canRipup() ) {
|
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 {
|
} else {
|
||||||
ltrace(200) << "Aborted ripup of perpandiculars, blocked by border/ring." << endl;
|
ltrace(200) << "Aborted ripup of perpandiculars, fixed or blocked." << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2087,7 +2029,6 @@ namespace {
|
||||||
if ( _segment->isFixed() ) return false;
|
if ( _segment->isFixed() ) return false;
|
||||||
if ( not interval.intersect(_segment->getCanonicalInterval()) ) return false;
|
if ( not interval.intersect(_segment->getCanonicalInterval()) ) return false;
|
||||||
if ( not _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)) ) {
|
||||||
|
@ -2095,27 +2036,20 @@ namespace {
|
||||||
if ( interval.contains(_segment->base()->getAutoTarget()->getX()) ) return false;
|
if ( interval.contains(_segment->base()->getAutoTarget()->getX()) ) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool success = true;
|
|
||||||
unsigned int currentOrder = Session::getOrder ();
|
|
||||||
|
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
ltrace(200) << "Current o:" << currentOrder << " vs. Segment o:" << _data->getGCellOrder() << endl;
|
bool success = true;
|
||||||
|
|
||||||
//bool expand = (_data->getGCellOrder() < currentOrder);
|
|
||||||
bool expand = _segment->isGlobal() and (flags&AllowExpand);
|
bool expand = _segment->isGlobal() and (flags&AllowExpand);
|
||||||
ltrace(200) << "Expand:" << expand << endl;
|
ltrace(200) << "Expand:" << expand << endl;
|
||||||
|
|
||||||
// Temp: <= replace < equal order can be relaxeds.
|
Katabatic::GCellVector gcells;
|
||||||
if ( _data->getGCellOrder() <= currentOrder ) {
|
|
||||||
vector<GCell*> gcells;
|
|
||||||
_segment->getGCells ( gcells );
|
_segment->getGCells ( gcells );
|
||||||
|
|
||||||
if ( gcells.size() < 2 ) {
|
if ( gcells.size() < 2 ) {
|
||||||
cerr << Bug("relax() Cannot break %p:%s,\n"
|
cerr << Bug("relax() Cannot break %p:%s,\n only in %s."
|
||||||
" only in %s (current order %d)."
|
|
||||||
,_segment->base()->base()
|
,_segment->base()->base()
|
||||||
,getString(_segment).c_str()
|
,getString(_segment).c_str()
|
||||||
,getString(gcells[0]).c_str()
|
,getString(gcells[0]).c_str()
|
||||||
,currentOrder
|
|
||||||
) << endl;
|
) << endl;
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
return false;
|
return false;
|
||||||
|
@ -2130,7 +2064,7 @@ namespace {
|
||||||
|
|
||||||
// Look for closest enclosing min & max GCells indexes.
|
// Look for closest enclosing min & max GCells indexes.
|
||||||
for ( igcell=0 ; igcell<gcells.size() ; igcell++ ) {
|
for ( igcell=0 ; igcell<gcells.size() ; igcell++ ) {
|
||||||
uside = gcells[igcell]->getUSide(_segment->getDirection(),true);
|
uside = gcells[igcell]->getUSide(_segment->getDirection()/*,true*/);
|
||||||
ltrace(200) << "| " << gcells[igcell] << " uside: " << uside << endl;
|
ltrace(200) << "| " << gcells[igcell] << " uside: " << uside << endl;
|
||||||
|
|
||||||
if ( uside.contains(interval.getVMin()) ) {
|
if ( uside.contains(interval.getVMin()) ) {
|
||||||
|
@ -2148,52 +2082,38 @@ namespace {
|
||||||
bool minExpanded = false;
|
bool minExpanded = false;
|
||||||
bool maxExpanded = false;
|
bool maxExpanded = false;
|
||||||
if ( expand ) {
|
if ( expand ) {
|
||||||
size_t iexpand = iminconflict;
|
|
||||||
if ( iminconflict < gcells.size() ) {
|
if ( iminconflict < gcells.size() ) {
|
||||||
for ( igcell=iminconflict ; true ; igcell-- ) {
|
size_t imindensity = 0;
|
||||||
if ( gcells[igcell]->getOrder() >= currentOrder ) iexpand = igcell;
|
|
||||||
else break;
|
|
||||||
|
|
||||||
if ( igcell == 0 ) break;
|
for ( size_t iexpand=1 ; iexpand < iminconflict ; iexpand++ ) {
|
||||||
}
|
|
||||||
|
|
||||||
if ( iexpand > 0 ) {
|
|
||||||
size_t imindepth = iexpand;
|
|
||||||
for ( ; iexpand < iminconflict ; iexpand++ ) {
|
|
||||||
if ( not _segment->canDogLegAt(gcells[iexpand],true) ) continue;
|
if ( not _segment->canDogLegAt(gcells[iexpand],true) ) continue;
|
||||||
|
|
||||||
ltrace(200) << "Density " << Session::getRoutingGauge()->getRoutingLayer(depth)->getName()
|
ltrace(200) << "Density " << Session::getRoutingGauge()->getRoutingLayer(depth)->getName()
|
||||||
<< " " << gcells[iexpand]->getDensity(depth) << endl;
|
<< " " << gcells[iexpand]->getDensity(depth) << endl;
|
||||||
|
|
||||||
if ( gcells[imindepth]->getDensity(depth) > gcells[iexpand]->getDensity(depth) )
|
if ( gcells[imindensity]->getDensity(depth) > gcells[iexpand]->getDensity(depth) )
|
||||||
imindepth = iexpand;
|
imindensity = iexpand;
|
||||||
}
|
|
||||||
iexpand = imindepth;
|
|
||||||
}
|
|
||||||
if ( iminconflict != iexpand ) minExpanded = true;
|
|
||||||
iminconflict = (iexpand>0) ? iexpand : gcells.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
iexpand = imaxconflict;
|
if ( iminconflict != imindensity ) minExpanded = true;
|
||||||
for ( igcell=imaxconflict ; igcell < gcells.size() ; igcell++ ) {
|
iminconflict = (imindensity>0) ? imindensity : gcells.size();
|
||||||
if ( gcells[igcell]->getOrder() >= currentOrder ) iexpand = igcell;
|
|
||||||
else break;
|
|
||||||
}
|
}
|
||||||
if ( iexpand < gcells.size()-1 ) {
|
|
||||||
size_t imindepth = iexpand;
|
if ( imaxconflict < gcells.size() ) {
|
||||||
for ( ; iexpand > imaxconflict ; iexpand-- ) {
|
size_t imindensity = imaxconflict;
|
||||||
|
for ( size_t iexpand=imaxconflict+1; iexpand < gcells.size() ; iexpand++ ) {
|
||||||
if ( not _segment->canDogLegAt(gcells[iexpand],true) ) continue;
|
if ( not _segment->canDogLegAt(gcells[iexpand],true) ) continue;
|
||||||
|
|
||||||
ltrace(200) << "Density " << Session::getRoutingGauge()->getRoutingLayer(depth)->getName()
|
ltrace(200) << "Density " << Session::getRoutingGauge()->getRoutingLayer(depth)->getName()
|
||||||
<< " " << gcells[iexpand]->getDensity(depth) << endl;
|
<< " " << gcells[iexpand]->getDensity(depth) << endl;
|
||||||
|
|
||||||
if ( gcells[imindepth]->getDensity(depth) > gcells[iexpand]->getDensity(depth) )
|
if ( gcells[imindensity]->getDensity(depth) > gcells[iexpand]->getDensity(depth) )
|
||||||
imindepth = iexpand;
|
imindensity = iexpand;
|
||||||
}
|
}
|
||||||
iexpand = imindepth;
|
|
||||||
|
if ( imindensity != imaxconflict ) maxExpanded = true;
|
||||||
|
imaxconflict = (imindensity < gcells.size()) ? imindensity : gcells.size();
|
||||||
}
|
}
|
||||||
if ( imaxconflict != iexpand ) maxExpanded = true;
|
|
||||||
imaxconflict = (iexpand < gcells.size()) ? iexpand : gcells.size();
|
|
||||||
}
|
}
|
||||||
ltrace(200) << "minExpanded:" << minExpanded << " (" << iminconflict
|
ltrace(200) << "minExpanded:" << minExpanded << " (" << iminconflict
|
||||||
<< ") maxExpanded:" << maxExpanded << " (" << imaxconflict << ")" << endl;
|
<< ") maxExpanded:" << maxExpanded << " (" << imaxconflict << ")" << endl;
|
||||||
|
@ -2206,9 +2126,6 @@ namespace {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check order validity under the relaxed interval.
|
|
||||||
// Should be implicitely satisfied.
|
|
||||||
|
|
||||||
// Suppress min/max if it's the first/last.
|
// Suppress min/max if it's the first/last.
|
||||||
if ( (iminconflict < gcells.size()) and (imaxconflict == gcells.size()-1) ) imaxconflict = gcells.size();
|
if ( (iminconflict < gcells.size()) and (imaxconflict == gcells.size()-1) ) imaxconflict = gcells.size();
|
||||||
if ( (imaxconflict < gcells.size()) and (iminconflict == 0) ) iminconflict = gcells.size();
|
if ( (imaxconflict < gcells.size()) and (iminconflict == 0) ) iminconflict = gcells.size();
|
||||||
|
@ -2234,55 +2151,14 @@ namespace {
|
||||||
break;
|
break;
|
||||||
case 1: break;
|
case 1: break;
|
||||||
case 0:
|
case 0:
|
||||||
cerr << Bug("Manipulator::relax() Can't find a GCell suitable for making dogleg.\n"
|
cerr << Bug("Manipulator::relax() Can't find a GCell suitable for making dogleg."
|
||||||
" Cannot move either left or right of %s. Current order %d."
|
,getString(interval).c_str()) << endl;
|
||||||
,getString(interval).c_str()
|
|
||||||
,currentOrder
|
|
||||||
) << endl;
|
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ltrace(200) << "| Has to do " << dogLegCount << " doglegs." << endl;
|
ltrace(200) << "| Has to do " << dogLegCount << " doglegs." << endl;
|
||||||
|
|
||||||
// Check for conflict occuring outside the current RoutingSet.
|
|
||||||
// Ugly: 2 track pitch.
|
|
||||||
#ifdef DISABLE_NARROW_DOGLEG
|
|
||||||
if ( (iminconflict != gcells.size())
|
|
||||||
and ( (gcells[iminconflict]->getOrder() > currentOrder)
|
|
||||||
or (_data->getGCellOrder() < currentOrder) ) ) {
|
|
||||||
uside = gcells[iminconflict]->getUSide(_segment->getDirection(),true);
|
|
||||||
if ( interval.getVMin() - uside.getVMin() < DbU::lambda(10.0) ) {
|
|
||||||
ltrace(200) << "Min conflict dogleg space is too narrow (<2 tracks)." << endl;
|
|
||||||
ltraceout(200);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
ltrace(200) << "Min conflict has sufficent slack min:"
|
|
||||||
<< DbU::getValueString(interval.getVMin()) << " uside:"
|
|
||||||
<< DbU::getValueString(uside.getVMin())
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DISABLE_NARROW_DOGLEG
|
|
||||||
if ( (imaxconflict != gcells.size())
|
|
||||||
and ( (gcells[imaxconflict]->getOrder() > currentOrder)
|
|
||||||
or (_data->getGCellOrder() < currentOrder) ) ) {
|
|
||||||
uside = gcells[imaxconflict]->getUSide(_segment->getDirection(),true);
|
|
||||||
if ( uside.getVMax() - interval.getVMax() < DbU::lambda(10.0) ) {
|
|
||||||
ltrace(200) << "Max conflict dogleg space is too narrow (<2 tracks)." << endl;
|
|
||||||
ltraceout(200);
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
ltrace(200) << "Max conflict has sufficent slack max:"
|
|
||||||
<< DbU::getValueString(interval.getVMax()) << " uside:"
|
|
||||||
<< DbU::getValueString(uside.getVMax())
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Check of "min is less than one track close the edge" (while not expanded).
|
// Check of "min is less than one track close the edge" (while not expanded).
|
||||||
// AND we are on the first GCell AND there's one dogleg only.
|
// AND we are on the first GCell AND there's one dogleg only.
|
||||||
if ( not minExpanded and (iminconflict == 0) and (imaxconflict == gcells.size()) ) {
|
if ( not minExpanded and (iminconflict == 0) and (imaxconflict == gcells.size()) ) {
|
||||||
|
@ -2293,19 +2169,13 @@ namespace {
|
||||||
|
|
||||||
// Check of "min is less than one track close the edge" (while not expanded).
|
// Check of "min is less than one track close the edge" (while not expanded).
|
||||||
if ( /*not minExpanded and*/ (iminconflict > 0) and (iminconflict < gcells.size()) ) {
|
if ( /*not minExpanded and*/ (iminconflict > 0) and (iminconflict < gcells.size()) ) {
|
||||||
uside = gcells[iminconflict-1]->getUSide(_segment->getDirection(),true);
|
uside = gcells[iminconflict-1]->getUSide(_segment->getDirection()/*,true*/);
|
||||||
ltrace(200) << "GCell Edge Comparison (min): " << uside
|
ltrace(200) << "GCell Edge Comparison (min): " << uside
|
||||||
<< " vs. " << DbU::getValueString(interval.getVMin()) << endl;
|
<< " vs. " << DbU::getValueString(interval.getVMin()) << endl;
|
||||||
// Ugly: One lambda shrink.
|
// Ugly: One lambda shrink.
|
||||||
if ( interval.getVMin()-DbU::lambda(1.0) <= uside.getVMax() ) {
|
if ( interval.getVMin()-DbU::lambda(1.0) <= uside.getVMax() ) {
|
||||||
if ( gcells[iminconflict-1]->getOrder() >= currentOrder ) {
|
|
||||||
ltrace(200) << "Using previous GCell." << endl;
|
ltrace(200) << "Using previous GCell." << endl;
|
||||||
iminconflict--;
|
iminconflict--;
|
||||||
} else {
|
|
||||||
ltrace(200) << "Cannot break in previous GCell." << endl;
|
|
||||||
ltraceout(200);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2316,35 +2186,15 @@ namespace {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check of "max is less than one track close the edge" (while not expanded).
|
|
||||||
// AND we are on the last GCell AND there's one dogleg only.
|
|
||||||
// if ( not maxExpanded and (iminconflict == gcells.size()) and (imaxconflict == gcells.size()-1) ) {
|
|
||||||
// uside = gcells[imaxconflict]->getUSide(_segment->getDirection(),true);
|
|
||||||
// ltrace(200) << "GCell Edge Comparison (max): " << uside
|
|
||||||
// << " vs. " << DbU::getValueString(interval.getVMax()) << endl;
|
|
||||||
// // Ugly: Direct uses of routing pitch.
|
|
||||||
// if ( interval.getVMax()+DbU::lambda(10.0) >= uside.getVMax() ) {
|
|
||||||
// ltrace(200) << "Cannot break in last GCell only, less than 2 pitches." << endl;
|
|
||||||
// ltraceout(200);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Check of "max is less than one track close the edge" (while not expanded).
|
// Check of "max is less than one track close the edge" (while not expanded).
|
||||||
if ( /*not maxExpanded and*/ (imaxconflict < gcells.size()-1) ) {
|
if ( /*not maxExpanded and*/ (imaxconflict < gcells.size()-1) ) {
|
||||||
uside = gcells[imaxconflict+1]->getUSide(_segment->getDirection(),true);
|
uside = gcells[imaxconflict+1]->getUSide(_segment->getDirection()/*,true*/);
|
||||||
ltrace(200) << "GCell Edge Comparison (max): " << uside
|
ltrace(200) << "GCell Edge Comparison (max): " << uside
|
||||||
<< " vs. " << DbU::getValueString(interval.getVMax()) << endl;
|
<< " vs. " << DbU::getValueString(interval.getVMax()) << endl;
|
||||||
// Ugly: Direct uses of routing pitch.
|
// Ugly: Direct uses of routing pitch.
|
||||||
if ( interval.getVMax()+DbU::lambda(5.0) >= uside.getVMin() ) {
|
if ( interval.getVMax()+DbU::lambda(5.0) >= uside.getVMin() ) {
|
||||||
if ( gcells[imaxconflict+1]->getOrder() >= currentOrder ) {
|
|
||||||
ltrace(200) << "Using next GCell." << endl;
|
ltrace(200) << "Using next GCell." << endl;
|
||||||
imaxconflict++;
|
imaxconflict++;
|
||||||
} else {
|
|
||||||
ltrace(200) << "Cannot break in next GCell." << endl;
|
|
||||||
ltraceout(200);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2362,7 +2212,7 @@ namespace {
|
||||||
TrackElement* segment1 = NULL;
|
TrackElement* segment1 = NULL;
|
||||||
TrackElement* segment2 = NULL;
|
TrackElement* segment2 = NULL;
|
||||||
Track* track = _segment->getTrack();
|
Track* track = _segment->getTrack();
|
||||||
GCell* dogLegGCell = gcells[ifirstDogleg];
|
Katabatic::GCell* dogLegGCell = gcells[ifirstDogleg];
|
||||||
TrackElement* dogleg = NULL;
|
TrackElement* dogleg = NULL;
|
||||||
DbU::Unit doglegAxis;
|
DbU::Unit doglegAxis;
|
||||||
bool doglegReuse1 = false;
|
bool doglegReuse1 = false;
|
||||||
|
@ -2389,14 +2239,14 @@ namespace {
|
||||||
if ( firstDogLegIsMin ) {
|
if ( firstDogLegIsMin ) {
|
||||||
if ( minExpanded ) {
|
if ( minExpanded ) {
|
||||||
//doglegAxis = dogLegGCell->getUSide(_segment->getDirection(),false).getVMax() - DbU::lambda(1.0);
|
//doglegAxis = dogLegGCell->getUSide(_segment->getDirection(),false).getVMax() - DbU::lambda(1.0);
|
||||||
doglegAxis = dogLegGCell->getUSide(_segment->getDirection(),false).getCenter();
|
doglegAxis = dogLegGCell->getUSide(_segment->getDirection()/*,false*/).getCenter();
|
||||||
} else {
|
} else {
|
||||||
// Ugly: hardcoded pitch.
|
// Ugly: hardcoded pitch.
|
||||||
doglegAxis = interval.getVMin() - DbU::lambda(5.0);
|
doglegAxis = interval.getVMin() - DbU::lambda(5.0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ( maxExpanded ) {
|
if ( maxExpanded ) {
|
||||||
doglegAxis = dogLegGCell->getUSide(_segment->getDirection(),false).getVMin();
|
doglegAxis = dogLegGCell->getUSide(_segment->getDirection()/*,false*/).getVMin();
|
||||||
} else {
|
} else {
|
||||||
// Ugly: hardcoded pitch (5.0 - 1.0).
|
// Ugly: hardcoded pitch (5.0 - 1.0).
|
||||||
doglegAxis = interval.getVMax() + DbU::lambda(4.0);
|
doglegAxis = interval.getVMax() + DbU::lambda(4.0);
|
||||||
|
@ -2414,11 +2264,9 @@ namespace {
|
||||||
ltrace(200) << "Dogleg has no RoutingEvent yet." << endl;
|
ltrace(200) << "Dogleg has no RoutingEvent yet." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (dogLegCount == 2)
|
// if ( (dogLegCount == 2) and not _segment->getTrack() ) {
|
||||||
and not _segment->getTrack()
|
// Session::addInsertEvent ( _segment, track );
|
||||||
and (_segment->getGCell()->getOrder() < Session::getOrder()) ) {
|
// }
|
||||||
Session::addInsertEvent ( _segment, track );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Making second dogleg.
|
// Making second dogleg.
|
||||||
if ( dogLegCount > 1 ) {
|
if ( dogLegCount > 1 ) {
|
||||||
|
@ -2451,7 +2299,7 @@ namespace {
|
||||||
|
|
||||||
if ( maxExpanded ) {
|
if ( maxExpanded ) {
|
||||||
//doglegAxis = dogLegGCell->getUSide(segment1->getDirection(),false).getVMin();
|
//doglegAxis = dogLegGCell->getUSide(segment1->getDirection(),false).getVMin();
|
||||||
doglegAxis = dogLegGCell->getUSide(segment1->getDirection(),false).getCenter();
|
doglegAxis = dogLegGCell->getUSide(segment1->getDirection()/*,false*/).getCenter();
|
||||||
} else {
|
} else {
|
||||||
// Ugly: hardcoded pitch.
|
// Ugly: hardcoded pitch.
|
||||||
doglegAxis = interval.getVMax() + DbU::lambda(5.0);
|
doglegAxis = interval.getVMax() + DbU::lambda(5.0);
|
||||||
|
@ -2471,7 +2319,7 @@ namespace {
|
||||||
const vector<AutoSegment*>& doglegs = Session::getDogLegs();
|
const vector<AutoSegment*>& doglegs = Session::getDogLegs();
|
||||||
for ( size_t i=0 ; i<doglegs.size() ; i++ ) {
|
for ( size_t i=0 ; i<doglegs.size() ; i++ ) {
|
||||||
TrackElement* segment = Session::lookup(doglegs[i]);
|
TrackElement* segment = Session::lookup(doglegs[i]);
|
||||||
if ( ( segment->getGCell()->getOrder() < Session::getOrder() ) and not segment->getTrack() ) {
|
if ( not segment->getTrack() and track ) {
|
||||||
Session::addInsertEvent ( segment, track );
|
Session::addInsertEvent ( segment, track );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2496,16 +2344,6 @@ namespace {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( _data->getGCellOrder() > currentOrder ) {
|
|
||||||
cerr << Bug("relax() Routing order problem for %s."
|
|
||||||
,getString(_segment).c_str()) << endl;
|
|
||||||
success = false;
|
|
||||||
} else {
|
|
||||||
// The TrackElement has an order equal to the Session, it's in the
|
|
||||||
// RoutingSet.
|
|
||||||
if ( not Manipulator(_segment,_S).makeDogLeg(interval) ) success = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
@ -2551,10 +2389,6 @@ namespace {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( data2->getGCellOrder() < Session::getOrder() ) {
|
|
||||||
// Interval relax.
|
|
||||||
success = Manipulator(segment2,_S).relax ( toFree );
|
|
||||||
} else {
|
|
||||||
if ( data2->getState() == DataNegociate::MaximumSlack ) {
|
if ( data2->getState() == DataNegociate::MaximumSlack ) {
|
||||||
ltrace(200) << "At " << DataNegociate::getStateString(data2)
|
ltrace(200) << "At " << DataNegociate::getStateString(data2)
|
||||||
<< " for " << segment2 << endl;
|
<< " for " << segment2 << endl;
|
||||||
|
@ -2661,7 +2495,6 @@ namespace {
|
||||||
}
|
}
|
||||||
if ( not success ) break;
|
if ( not success ) break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( success ) {
|
if ( success ) {
|
||||||
_S.setState ( State::OtherRipup );
|
_S.setState ( State::OtherRipup );
|
||||||
|
@ -2714,10 +2547,6 @@ namespace {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( data2->getGCellOrder() < Session::getOrder() ) {
|
|
||||||
// Interval relax.
|
|
||||||
success = Manipulator(segment2,_S).relax ( toFree );
|
|
||||||
} else {
|
|
||||||
ltrace(200) << "- Forced ripup " << segment2 << endl;
|
ltrace(200) << "- Forced ripup " << segment2 << endl;
|
||||||
if ( not (success=Manipulator(segment2,_S).ripup(toFree,SegmentAction::OtherRipup)) )
|
if ( not (success=Manipulator(segment2,_S).ripup(toFree,SegmentAction::OtherRipup)) )
|
||||||
continue;
|
continue;
|
||||||
|
@ -2735,7 +2564,6 @@ namespace {
|
||||||
_S.addAction ( *isegment3, SegmentAction::OtherRipup );
|
_S.addAction ( *isegment3, SegmentAction::OtherRipup );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ( success ) {
|
if ( success ) {
|
||||||
_S.setState ( State::OtherRipup );
|
_S.setState ( State::OtherRipup );
|
||||||
|
@ -2790,8 +2618,7 @@ namespace {
|
||||||
_segment->getPerpandicularsBound ( perpandiculars );
|
_segment->getPerpandicularsBound ( perpandiculars );
|
||||||
for ( iperpand = perpandiculars.begin() ; iperpand != perpandiculars.end() ; iperpand++ ) {
|
for ( iperpand = perpandiculars.begin() ; iperpand != perpandiculars.end() ; iperpand++ ) {
|
||||||
DataNegociate* data2 = (*iperpand)->getDataNegociate();
|
DataNegociate* data2 = (*iperpand)->getDataNegociate();
|
||||||
if ( data2 && (data2->getGCellOrder() >= Session::getOrder()) ) {
|
if ( data2 ) {
|
||||||
|
|
||||||
ltrace(200) << "| perpandicular bound:" << *iperpand << endl;
|
ltrace(200) << "| perpandicular bound:" << *iperpand << endl;
|
||||||
success = Manipulator(*iperpand,_S).ripup ( track->getAxis(), SegmentAction::SelfRipupAndAxisHint );
|
success = Manipulator(*iperpand,_S).ripup ( track->getAxis(), SegmentAction::SelfRipupAndAxisHint );
|
||||||
if ( success ) {
|
if ( success ) {
|
||||||
|
@ -2898,8 +2725,7 @@ namespace {
|
||||||
if ( not _segment->isLocal() ) return false;
|
if ( not _segment->isLocal() ) return false;
|
||||||
|
|
||||||
Net* net = _segment->getNet();
|
Net* net = _segment->getNet();
|
||||||
Interval uside = _segment->getGCell()->getUSide
|
Interval uside = _segment->base()->getAutoSource()->getGCell()->getUSide ( Constant::perpandicular(_segment->getDirection())/*, false*/ );
|
||||||
( Constant::perpandicular(_segment->getDirection()), false );
|
|
||||||
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(_segment->getLayer());
|
RoutingPlane* plane = Session::getKiteEngine()->getRoutingPlaneByLayer(_segment->getLayer());
|
||||||
|
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
|
@ -2917,7 +2743,6 @@ namespace {
|
||||||
|
|
||||||
DataNegociate* otherData = other->getDataNegociate();
|
DataNegociate* otherData = other->getDataNegociate();
|
||||||
if ( not otherData ) continue;
|
if ( not otherData ) continue;
|
||||||
if ( otherData->getGCellOrder() < Session::getOrder() ) continue;
|
|
||||||
|
|
||||||
DbU::Unit shiftedAxisHint;
|
DbU::Unit shiftedAxisHint;
|
||||||
RoutingEvent* otherEvent = otherData->getRoutingEvent();
|
RoutingEvent* otherEvent = otherData->getRoutingEvent();
|
||||||
|
@ -2949,6 +2774,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 ( _segment->isStrap () ) return false;
|
||||||
if ( not _segment->canMoveUp(0.5) ) return false;
|
if ( not _segment->canMoveUp(0.5) ) return false;
|
||||||
|
|
||||||
_segment->moveUp ();
|
_segment->moveUp ();
|
||||||
|
@ -2962,11 +2788,16 @@ namespace {
|
||||||
|
|
||||||
unsigned int kflags = Katabatic::AutoSegment::Propagate;
|
unsigned int kflags = Katabatic::AutoSegment::Propagate;
|
||||||
kflags |= (flags & AllowLocalMoveUp ) ? Katabatic::AutoSegment::AllowLocal : 0;
|
kflags |= (flags & AllowLocalMoveUp ) ? Katabatic::AutoSegment::AllowLocal : 0;
|
||||||
|
kflags |= (flags & AllowTerminalMoveUp) ? Katabatic::AutoSegment::AllowTerminal : 0;
|
||||||
|
|
||||||
if ( _segment->isFixed () ) return false;
|
if ( _segment->isFixed () ) return false;
|
||||||
if ( not (flags & AllowLocalMoveUp) ) {
|
if ( not (flags & AllowLocalMoveUp) ) {
|
||||||
if ( _segment->isLocal() and not _segment->canPivotUp(0.5) ) return false;
|
if ( _segment->isLocal() ) {
|
||||||
|
if ( not _segment->canPivotUp(0.5) ) return false;
|
||||||
|
} else {
|
||||||
|
if ( _segment->getLength() < DbU::lambda(/*100.0*/50.0) ) return false;
|
||||||
if ( not _segment->canMoveUp(1.0,kflags) ) return false;
|
if ( not _segment->canMoveUp(1.0,kflags) ) return false;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
if ( not _segment->canMoveUp(1.0,kflags) ) return false;
|
if ( not _segment->canMoveUp(1.0,kflags) ) return false;
|
||||||
|
|
||||||
|
@ -2985,18 +2816,14 @@ namespace {
|
||||||
itrack->getOverlapBounds ( overlap, begin, end );
|
itrack->getOverlapBounds ( overlap, begin, end );
|
||||||
for ( ; (begin < end) ; begin++ ) {
|
for ( ; (begin < end) ; begin++ ) {
|
||||||
other = itrack->getSegment(begin);
|
other = itrack->getSegment(begin);
|
||||||
|
|
||||||
if ( other->isGlobal() ) continue;
|
if ( other->isGlobal() ) continue;
|
||||||
if ( other->getDataNegociate()
|
|
||||||
and (other->getDataNegociate()->getGCellOrder() != Session::getOrder()) ) continue;
|
|
||||||
|
|
||||||
ltrace(200) << " | Ripup for repack: " << begin << " " << other << endl;
|
ltrace(200) << " | Ripup for repack: " << begin << " " << other << endl;
|
||||||
_S.addAction ( other, SegmentAction::OtherRipup );
|
_S.addAction ( other, SegmentAction::OtherRipup );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
_segment->moveUp ( kflags );
|
return _segment->moveUp ( kflags );
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3056,7 +2883,7 @@ namespace {
|
||||||
ltrace(200) << "Manipulator::makeDogLeg(Interval) - Push dogleg to the "
|
ltrace(200) << "Manipulator::makeDogLeg(Interval) - Push dogleg to the "
|
||||||
<< ((pushLeft)?"left":"right") << endl;
|
<< ((pushLeft)?"left":"right") << endl;
|
||||||
if ( isTerminal ) {
|
if ( isTerminal ) {
|
||||||
AutoContact* contact = (pushLeft) ? _segment->base()->getAutoSource()
|
Katabatic::AutoContact* contact = (pushLeft) ? _segment->base()->getAutoSource()
|
||||||
: _segment->base()->getAutoTarget();
|
: _segment->base()->getAutoTarget();
|
||||||
DbU::Unit axisHint = (_segment->isHorizontal()) ? contact->getX() : contact->getY();
|
DbU::Unit axisHint = (_segment->isHorizontal()) ? contact->getX() : contact->getY();
|
||||||
RoutingEvent* event = dogleg->getDataNegociate()->getRoutingEvent();
|
RoutingEvent* event = dogleg->getDataNegociate()->getRoutingEvent();
|
||||||
|
@ -3080,12 +2907,12 @@ namespace {
|
||||||
|
|
||||||
if ( _segment->isFixed() ) return false;
|
if ( _segment->isFixed() ) return false;
|
||||||
|
|
||||||
vector<GCell*> gcells;
|
Katabatic::GCellVector gcells;
|
||||||
_segment->getGCells ( gcells );
|
_segment->getGCells ( gcells );
|
||||||
|
|
||||||
size_t igcell = 0;
|
size_t igcell = 0;
|
||||||
for ( ; igcell<gcells.size() ; igcell++ ) {
|
for ( ; igcell<gcells.size() ; igcell++ ) {
|
||||||
if ( gcells[igcell]->getUSide(_segment->getDirection(),true).contains(position) )
|
if ( gcells[igcell]->getUSide(_segment->getDirection()/*,true*/).contains(position) )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( igcell == gcells.size() ) return false;
|
if ( igcell == gcells.size() ) return false;
|
||||||
|
@ -3135,10 +2962,6 @@ namespace {
|
||||||
if ( !data2 ) continue;
|
if ( !data2 ) continue;
|
||||||
|
|
||||||
ltrace(200) << " | " << perpandiculars[i] << endl;
|
ltrace(200) << " | " << perpandiculars[i] << endl;
|
||||||
if ( data2->getGCellOrder() < Session::getOrder() ) {
|
|
||||||
ltrace(200) << "Reject: bad order." << endl;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
RoutingEvent* event2 = data2->getRoutingEvent();
|
RoutingEvent* event2 = data2->getRoutingEvent();
|
||||||
if ( !event2 ) continue;
|
if ( !event2 ) continue;
|
||||||
|
@ -3241,7 +3064,6 @@ namespace {
|
||||||
if ( !data2 ) continue;
|
if ( !data2 ) continue;
|
||||||
|
|
||||||
ltrace(200) << " | " << perpandiculars[i] << endl;
|
ltrace(200) << " | " << perpandiculars[i] << endl;
|
||||||
if ( data2->getGCellOrder() < Session::getOrder() ) continue;
|
|
||||||
|
|
||||||
RoutingEvent* event2 = data2->getRoutingEvent();
|
RoutingEvent* event2 = data2->getRoutingEvent();
|
||||||
if ( !event2 ) continue;
|
if ( !event2 ) continue;
|
||||||
|
@ -3263,7 +3085,7 @@ namespace {
|
||||||
||*/ _segment->isFixed()
|
||*/ _segment->isFixed()
|
||||||
|| ( _segment->getDogLegLevel() > 0 )
|
|| ( _segment->getDogLegLevel() > 0 )
|
||||||
|| ( _segment->getLength() < DbU::lambda(10.0) )
|
|| ( _segment->getLength() < DbU::lambda(10.0) )
|
||||||
|| !_segment->canDogLegAt(_segment->getGCell()) )
|
|| not _segment->canDogLegAt(_segment->base()->getAutoSource()->getGCell()) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
TrackElement* perpandicular
|
TrackElement* perpandicular
|
||||||
|
@ -3297,7 +3119,7 @@ namespace {
|
||||||
DataNegociate* data = perpandicular->getDataNegociate();
|
DataNegociate* data = perpandicular->getDataNegociate();
|
||||||
|
|
||||||
if ( perpandicular->isFixed() ) continue;
|
if ( perpandicular->isFixed() ) continue;
|
||||||
if ( not data or (data->getGCellOrder() != Session::getOrder()) ) continue;
|
if ( not data ) continue;
|
||||||
if ( not perpandicular->getTrack() ) continue;
|
if ( not perpandicular->getTrack() ) continue;
|
||||||
if ( not Manipulator(perpandicular,_S).canRipup()
|
if ( not Manipulator(perpandicular,_S).canRipup()
|
||||||
or (data->getState() >= DataNegociate::MaximumSlack) ) continue;
|
or (data->getState() >= DataNegociate::MaximumSlack) ) continue;
|
||||||
|
@ -3885,13 +3707,11 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( _perpandiculars[i]->getTrack() ) {
|
if ( _perpandiculars[i]->getTrack() ) {
|
||||||
Interval trackFree = _perpandiculars[i]->getFreeInterval( false );
|
Interval trackFree = _perpandiculars[i]->getFreeInterval();
|
||||||
ltrace(200) << "| From " << _perpandiculars[i] << endl;
|
ltrace(200) << "| From " << _perpandiculars[i] << endl;
|
||||||
ltrace(200) << "| Track Perpandicular Free: " << trackFree << endl;
|
ltrace(200) << "| Track Perpandicular Free: " << trackFree << endl;
|
||||||
|
|
||||||
_perpandicular.intersection ( trackFree );
|
_perpandicular.intersection ( trackFree );
|
||||||
if ( dataPerpandicular->getGCellOrder() < Session::getOrder() )
|
|
||||||
_constraints.intersection ( trackFree );
|
|
||||||
} else {
|
} else {
|
||||||
ltrace(200) << "| Not in any track " << _perpandiculars[i] << endl;
|
ltrace(200) << "| Not in any track " << _perpandiculars[i] << endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,6 @@ namespace Kite {
|
||||||
void RoutingEventQueue::load ( const vector<TrackElement*>& segments )
|
void RoutingEventQueue::load ( const vector<TrackElement*>& segments )
|
||||||
{
|
{
|
||||||
for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
||||||
if ( segments[i]->getDataNegociate()->getGCellOrder() >= Session::getOrder() ) {
|
|
||||||
if ( segments[i]->getDataNegociate()->getRoutingEvent() ) {
|
if ( segments[i]->getDataNegociate()->getRoutingEvent() ) {
|
||||||
cinfo << "[INFO] Already have a RoutingEvent - " << segments[i] << endl;
|
cinfo << "[INFO] Already have a RoutingEvent - " << segments[i] << endl;
|
||||||
continue;
|
continue;
|
||||||
|
@ -86,7 +85,6 @@ namespace Kite {
|
||||||
_events.insert ( event );
|
_events.insert ( event );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RoutingEventQueue::add ( TrackElement* segment, unsigned int level )
|
void RoutingEventQueue::add ( TrackElement* segment, unsigned int level )
|
||||||
|
|
|
@ -25,10 +25,10 @@
|
||||||
|
|
||||||
#include "hurricane/Bug.h"
|
#include "hurricane/Bug.h"
|
||||||
#include "hurricane/Error.h"
|
#include "hurricane/Error.h"
|
||||||
|
#include "katabatic/GCellGrid.h"
|
||||||
#include "kite/Session.h"
|
#include "kite/Session.h"
|
||||||
#include "kite/Track.h"
|
#include "kite/Track.h"
|
||||||
#include "kite/TrackElement.h"
|
#include "kite/TrackElement.h"
|
||||||
#include "kite/GCellGrid.h"
|
|
||||||
#include "kite/KiteEngine.h"
|
#include "kite/KiteEngine.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ namespace Kite {
|
||||||
|
|
||||||
Session::Session ( KiteEngine* kite )
|
Session::Session ( KiteEngine* kite )
|
||||||
: Katabatic::Session(kite)
|
: Katabatic::Session(kite)
|
||||||
, _order (0)
|
|
||||||
, _insertEvents()
|
, _insertEvents()
|
||||||
, _removeEvents()
|
, _removeEvents()
|
||||||
, _sortEvents ()
|
, _sortEvents ()
|
||||||
|
@ -137,7 +136,7 @@ namespace Kite {
|
||||||
{ return Session::get("lookup(AutoSegment*)")->_getKiteEngine()->_lookup ( segment ); }
|
{ return Session::get("lookup(AutoSegment*)")->_getKiteEngine()->_lookup ( segment ); }
|
||||||
|
|
||||||
|
|
||||||
GCell* Session::lookup ( Katabatic::GCell* gcell )
|
Katabatic::GCell* Session::lookup ( Katabatic::GCell* gcell )
|
||||||
{ return Session::get("lookup(Katabatic::GCell*)")->_getKiteEngine()->getGCellGrid()->getGCell(gcell->getIndex()); }
|
{ return Session::get("lookup(Katabatic::GCell*)")->_getKiteEngine()->getGCellGrid()->getGCell(gcell->getIndex()); }
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,18 +160,10 @@ namespace Kite {
|
||||||
{ return _getKiteEngine()->getRipupCost(); };
|
{ return _getKiteEngine()->getRipupCost(); };
|
||||||
|
|
||||||
|
|
||||||
GCell* Session::_getGCellUnder ( DbU::Unit x, DbU::Unit y )
|
Katabatic::GCell* Session::_getGCellUnder ( DbU::Unit x, DbU::Unit y )
|
||||||
{ return _getKiteEngine()->getGCellGrid()->getGCell(Point(x,y)); };
|
{ return _getKiteEngine()->getGCellGrid()->getGCell(Point(x,y)); };
|
||||||
|
|
||||||
|
|
||||||
unsigned int Session::_getOrder () const
|
|
||||||
{ return _order; }
|
|
||||||
|
|
||||||
|
|
||||||
void Session::_setOrder ( unsigned int order )
|
|
||||||
{ _order = order; }
|
|
||||||
|
|
||||||
|
|
||||||
size_t Session::_revalidate ()
|
size_t Session::_revalidate ()
|
||||||
{
|
{
|
||||||
set<Track*> packTracks;
|
set<Track*> packTracks;
|
||||||
|
@ -266,7 +257,7 @@ namespace Kite {
|
||||||
|
|
||||||
if ( not faileds.empty() ) {
|
if ( not faileds.empty() ) {
|
||||||
set<TrackElement*>::iterator ifailed = faileds.begin();
|
set<TrackElement*>::iterator ifailed = faileds.begin();
|
||||||
vector<GCell*> gcells;
|
Katabatic::GCellVector gcells;
|
||||||
for ( ; ifailed != faileds.end() ; ++ifailed ) {
|
for ( ; ifailed != faileds.end() ; ++ifailed ) {
|
||||||
(*ifailed)->getGCells ( gcells );
|
(*ifailed)->getGCells ( gcells );
|
||||||
(*ifailed)->makeDogLeg ( gcells[0] );
|
(*ifailed)->makeDogLeg ( gcells[0] );
|
||||||
|
@ -307,7 +298,8 @@ namespace Kite {
|
||||||
cerr << "Order: Insert in @" << DbU::getValueString(track->getAxis())
|
cerr << "Order: Insert in @" << DbU::getValueString(track->getAxis())
|
||||||
<< " " << segment << endl;
|
<< " " << segment << endl;
|
||||||
#endif
|
#endif
|
||||||
ltrace(200) << "addInsertEvent() " << segment << endl;
|
ltrace(200) << "addInsertEvent() " << segment
|
||||||
|
<< "\n @" << track << endl;
|
||||||
|
|
||||||
if ( segment->getTrack() != NULL ) {
|
if ( segment->getTrack() != NULL ) {
|
||||||
cerr << Bug("Session::addInsertEvent(): Segment already in Track."
|
cerr << Bug("Session::addInsertEvent(): Segment already in Track."
|
||||||
|
|
|
@ -168,14 +168,10 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TrackElement* Track::getNext ( size_t& index, Net* net, bool useOrder ) const
|
TrackElement* Track::getNext ( size_t& index, Net* net ) const
|
||||||
{
|
{
|
||||||
for ( index++ ; index < _segments.size() ; index++ ) {
|
for ( index++ ; index < _segments.size() ; index++ ) {
|
||||||
if ( _segments[index]->getNet() == net ) continue;
|
if ( _segments[index]->getNet() == net ) continue;
|
||||||
if ( useOrder
|
|
||||||
and _segments[index]->getDataNegociate()
|
|
||||||
and (_segments[index]->getDataNegociate()->getGCellOrder() >= Session::getOrder()) )
|
|
||||||
continue;
|
|
||||||
return _segments[index];
|
return _segments[index];
|
||||||
}
|
}
|
||||||
index = NPOS;
|
index = NPOS;
|
||||||
|
@ -184,7 +180,7 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TrackElement* Track::getPrevious ( size_t& index, Net* net, bool useOrder ) const
|
TrackElement* Track::getPrevious ( size_t& index, Net* net ) const
|
||||||
{
|
{
|
||||||
for ( index-- ; index != NPOS ; index-- ) {
|
for ( index-- ; index != NPOS ; index-- ) {
|
||||||
if ( inltrace(148) ) {
|
if ( inltrace(148) ) {
|
||||||
|
@ -192,10 +188,6 @@ namespace Kite {
|
||||||
cerr << _segments[index] << endl;
|
cerr << _segments[index] << endl;
|
||||||
}
|
}
|
||||||
if ( _segments[index]->getNet() == net ) continue;
|
if ( _segments[index]->getNet() == net ) continue;
|
||||||
if ( useOrder
|
|
||||||
and _segments[index]->getDataNegociate()
|
|
||||||
and (_segments[index]->getDataNegociate()->getGCellOrder() >= Session::getOrder()) )
|
|
||||||
continue;
|
|
||||||
return _segments[index];
|
return _segments[index];
|
||||||
}
|
}
|
||||||
index = NPOS;
|
index = NPOS;
|
||||||
|
@ -433,23 +425,23 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Interval Track::expandFreeInterval ( size_t& begin, size_t& end, unsigned int state, Net* net, bool useOrder ) const
|
Interval Track::expandFreeInterval ( size_t& begin, size_t& end, unsigned int state, Net* net ) const
|
||||||
{
|
{
|
||||||
DbU::Unit minFree = _min;
|
DbU::Unit minFree = _min;
|
||||||
|
|
||||||
if ( !(state & MinTrackMin) ) {
|
if ( !(state & MinTrackMin) ) {
|
||||||
if ( _segments[begin]->getNet() == net )
|
if ( _segments[begin]->getNet() == net )
|
||||||
getPrevious ( begin, net, useOrder );
|
getPrevious ( begin, net );
|
||||||
|
|
||||||
if ( begin != NPOS ) {
|
if ( begin != NPOS ) {
|
||||||
size_t usedEnd;
|
size_t usedEnd;
|
||||||
minFree = expandUsedInterval ( begin, usedEnd, useOrder ).getVMax();
|
minFree = expandUsedInterval ( begin, usedEnd ).getVMax();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !(state & MaxTrackMax) ) {
|
if ( !(state & MaxTrackMax) ) {
|
||||||
if ( _segments[end]->getNet() == net ) {
|
if ( _segments[end]->getNet() == net ) {
|
||||||
getNext ( end, net, useOrder );
|
getNext ( end, net );
|
||||||
|
|
||||||
if ( end == NPOS ) {
|
if ( end == NPOS ) {
|
||||||
end = _segments.size() - 1;
|
end = _segments.size() - 1;
|
||||||
|
@ -613,7 +605,7 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Interval Track::expandUsedInterval ( size_t& begin, size_t& end, bool useOrder ) const
|
Interval Track::expandUsedInterval ( size_t& begin, size_t& end ) const
|
||||||
{
|
{
|
||||||
if ( begin == NPOS ) return Interval();
|
if ( begin == NPOS ) return Interval();
|
||||||
|
|
||||||
|
@ -627,10 +619,6 @@ namespace Kite {
|
||||||
size_t i = seed;
|
size_t i = seed;
|
||||||
while ( --i != NPOS ) {
|
while ( --i != NPOS ) {
|
||||||
if ( _segments[i]->getNet() != owner ) break;
|
if ( _segments[i]->getNet() != owner ) break;
|
||||||
if ( useOrder
|
|
||||||
and _segments[i]->getDataNegociate()
|
|
||||||
and (_segments[i]->getDataNegociate()->getGCellOrder() >= Session::getOrder()) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
_segments[i]->getCanonical ( expandInterval );
|
_segments[i]->getCanonical ( expandInterval );
|
||||||
if ( expandInterval.getVMax() >= ownerInterval.getVMin() ) {
|
if ( expandInterval.getVMax() >= ownerInterval.getVMin() ) {
|
||||||
|
@ -642,10 +630,6 @@ namespace Kite {
|
||||||
end = i = seed;
|
end = i = seed;
|
||||||
while ( ++i < _segments.size() ) {
|
while ( ++i < _segments.size() ) {
|
||||||
if ( _segments[i]->getNet() != owner ) break;
|
if ( _segments[i]->getNet() != owner ) break;
|
||||||
if ( useOrder
|
|
||||||
and _segments[i]->getDataNegociate()
|
|
||||||
and (_segments[i]->getDataNegociate()->getGCellOrder() >= Session::getOrder()) )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
_segments[i]->getCanonical ( expandInterval );
|
_segments[i]->getCanonical ( expandInterval );
|
||||||
if ( expandInterval.getVMin() > ownerInterval.getVMax() ) break;
|
if ( expandInterval.getVMin() > ownerInterval.getVMax() ) break;
|
||||||
|
|
|
@ -1,269 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Module : "./TrackBlockage.cpp" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#include "hurricane/Bug.h"
|
|
||||||
#include "hurricane/Warning.h"
|
|
||||||
#include "hurricane/Net.h"
|
|
||||||
#include "hurricane/Name.h"
|
|
||||||
#include "hurricane/RegularLayer.h"
|
|
||||||
#include "hurricane/Technology.h"
|
|
||||||
#include "hurricane/DataBase.h"
|
|
||||||
#include "hurricane/Horizontal.h"
|
|
||||||
#include "hurricane/Vertical.h"
|
|
||||||
#include "katabatic/AutoContact.h"
|
|
||||||
#include "crlcore/RoutingGauge.h"
|
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/DataNegociate.h"
|
|
||||||
#include "kite/TrackBlockage.h"
|
|
||||||
#include "kite/TrackCost.h"
|
|
||||||
#include "kite/Track.h"
|
|
||||||
#include "kite/Session.h"
|
|
||||||
#include "kite/RoutingEvent.h"
|
|
||||||
#include "kite/NegociateWindow.h"
|
|
||||||
#include "kite/GCellGrid.h"
|
|
||||||
#include "kite/KiteEngine.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using Hurricane::inltrace;
|
|
||||||
using Hurricane::ltracein;
|
|
||||||
using Hurricane::ltraceout;
|
|
||||||
using Hurricane::tab;
|
|
||||||
using Hurricane::ForEachIterator;
|
|
||||||
using Hurricane::Bug;
|
|
||||||
using Hurricane::Error;
|
|
||||||
using Hurricane::Net;
|
|
||||||
using Hurricane::Name;
|
|
||||||
using Hurricane::RegularLayer;
|
|
||||||
using Hurricane::Technology;
|
|
||||||
using Hurricane::DataBase;
|
|
||||||
using Hurricane::Horizontal;
|
|
||||||
using Hurricane::Vertical;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "TrackBlockage".
|
|
||||||
|
|
||||||
|
|
||||||
TrackBlockage::TrackBlockage ( Track* track, Box& boundingBox )
|
|
||||||
: TrackElement (NULL)
|
|
||||||
, _segment (NULL)
|
|
||||||
{
|
|
||||||
if ( track ) {
|
|
||||||
Technology* technology = DataBase::getDB()->getTechnology();
|
|
||||||
unsigned int depth = track->getDepth();
|
|
||||||
const Layer* layer1 = track->getLayer()->getBlockageLayer();
|
|
||||||
RegularLayer* layer2 = dynamic_cast<RegularLayer*>(technology->getLayer(layer1->getMask()));
|
|
||||||
ltrace(190) << "Blockage layer: " << layer2 << endl;
|
|
||||||
if ( layer2 ) {
|
|
||||||
DbU::Unit extention = layer2->getExtentionCap();
|
|
||||||
if ( track->getDirection() == Constant::Horizontal ) {
|
|
||||||
Interval uside = track->getKiteEngine()->getGCellGrid()->getUSide ( Constant::Horizontal );
|
|
||||||
|
|
||||||
_sourceU = max ( boundingBox.getXMin()+extention, uside.getVMin());
|
|
||||||
_targetU = min ( boundingBox.getXMax()-extention, uside.getVMax());
|
|
||||||
|
|
||||||
_segment = Horizontal::create ( Session::getBlockageNet()
|
|
||||||
, layer2
|
|
||||||
, track->getAxis()
|
|
||||||
, layer2->getMinimalSize()
|
|
||||||
, _sourceU
|
|
||||||
, _targetU
|
|
||||||
);
|
|
||||||
|
|
||||||
GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_sourceU,track->getAxis()) );
|
|
||||||
GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_targetU,track->getAxis()) );
|
|
||||||
GCell* right = NULL;
|
|
||||||
Interval guside = gcell->getUSide ( Constant::Horizontal, true );
|
|
||||||
Interval segside ( boundingBox.getXMin(), boundingBox.getXMax() );
|
|
||||||
|
|
||||||
ltrace(190) << "Depth: " << depth << " " << track->getLayer() << endl;
|
|
||||||
ltrace(190) << "Begin: " << gcell << endl;
|
|
||||||
ltrace(190) << "End: " << end << endl;
|
|
||||||
|
|
||||||
if ( gcell ) {
|
|
||||||
while ( gcell and (gcell != end) ) {
|
|
||||||
right = gcell->getRight();
|
|
||||||
if ( right == NULL ) break;
|
|
||||||
|
|
||||||
guside = gcell->getUSide ( Constant::Horizontal, true );
|
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
|
||||||
|
|
||||||
gcell->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
|
||||||
gcell = right;
|
|
||||||
}
|
|
||||||
if ( end ) {
|
|
||||||
guside = gcell->getUSide ( Constant::Horizontal, true );
|
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
|
||||||
|
|
||||||
end->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Interval uside = track->getKiteEngine()->getGCellGrid()->getUSide ( Constant::Vertical );
|
|
||||||
|
|
||||||
_sourceU = max ( boundingBox.getYMin()+extention, uside.getVMin());
|
|
||||||
_targetU = min ( boundingBox.getYMax()-extention, uside.getVMax());
|
|
||||||
|
|
||||||
_segment = Vertical::create ( Session::getBlockageNet()
|
|
||||||
, layer2
|
|
||||||
, track->getAxis()
|
|
||||||
, layer2->getMinimalSize()
|
|
||||||
, _sourceU
|
|
||||||
, _targetU
|
|
||||||
);
|
|
||||||
|
|
||||||
GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_sourceU) );
|
|
||||||
GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_targetU) );
|
|
||||||
GCell* up = NULL;
|
|
||||||
Interval guside = gcell->getUSide ( Constant::Vertical, true );
|
|
||||||
Interval segside ( boundingBox.getYMin(), boundingBox.getYMax() );
|
|
||||||
|
|
||||||
ltrace(190) << "Depth: " << depth << " " << track->getLayer() << endl;
|
|
||||||
ltrace(190) << "Begin: " << gcell << endl;
|
|
||||||
ltrace(190) << "End: " << end << endl;
|
|
||||||
|
|
||||||
if ( gcell ) {
|
|
||||||
while ( gcell and (gcell != end) ) {
|
|
||||||
up = gcell->getUp();
|
|
||||||
if ( up == NULL ) break;
|
|
||||||
|
|
||||||
guside = gcell->getUSide ( Constant::Vertical, true );
|
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
|
||||||
|
|
||||||
gcell->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
|
||||||
gcell = up;
|
|
||||||
}
|
|
||||||
if ( end ) {
|
|
||||||
guside = gcell->getUSide ( Constant::Vertical, true );
|
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
|
||||||
|
|
||||||
end->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TrackBlockage::_postCreate ()
|
|
||||||
{ TrackElement::_postCreate (); }
|
|
||||||
|
|
||||||
|
|
||||||
TrackBlockage::~TrackBlockage ()
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
void TrackBlockage::_preDestroy ()
|
|
||||||
{
|
|
||||||
ltrace(90) << "TrackBlockage::_preDestroy() - " << (void*)this << endl;
|
|
||||||
TrackElement::_preDestroy ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TrackElement* TrackBlockage::create ( Track* track, Box& boundingBox )
|
|
||||||
{
|
|
||||||
TrackBlockage* trackBlockage = NULL;
|
|
||||||
if ( track ) {
|
|
||||||
trackBlockage = new TrackBlockage ( track, boundingBox );
|
|
||||||
trackBlockage->_postCreate ();
|
|
||||||
Session::addInsertEvent ( trackBlockage, track );
|
|
||||||
|
|
||||||
ltrace(190) << "Adding: " << boundingBox << " on " << track << endl;
|
|
||||||
|
|
||||||
ltrace(200) << "TrackBlockage::create(): " << trackBlockage << endl;
|
|
||||||
}
|
|
||||||
return trackBlockage;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AutoSegment* TrackBlockage::base () const { return NULL; }
|
|
||||||
bool TrackBlockage::isFixed () const { return true; }
|
|
||||||
bool TrackBlockage::isBlockage () const { return true; }
|
|
||||||
DbU::Unit TrackBlockage::getAxis () const { return getTrack()->getAxis(); }
|
|
||||||
bool TrackBlockage::isHorizontal () const { return getTrack()->isHorizontal(); }
|
|
||||||
bool TrackBlockage::isVertical () const { return getTrack()->isVertical(); }
|
|
||||||
unsigned int TrackBlockage::getDirection () const { return getTrack()->getDirection(); }
|
|
||||||
Net* TrackBlockage::getNet () const { return _segment->getNet(); }
|
|
||||||
const Layer* TrackBlockage::getLayer () const { return _segment->getLayer(); }
|
|
||||||
Interval TrackBlockage::getFreeInterval ( bool useOrder ) const { return Interval(); }
|
|
||||||
|
|
||||||
|
|
||||||
unsigned long TrackBlockage::getId () const
|
|
||||||
{
|
|
||||||
cerr << Error("::getId() called on %s.",_getString().c_str()) << endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TrackElement* TrackBlockage::getNext () const
|
|
||||||
{
|
|
||||||
size_t dummy = _index;
|
|
||||||
return _track->getNext ( dummy, getNet() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TrackElement* TrackBlockage::getPrevious () const
|
|
||||||
{
|
|
||||||
size_t dummy = _index;
|
|
||||||
return _track->getPrevious ( dummy, getNet() );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
string TrackBlockage::_getTypeName () const
|
|
||||||
{ return "TrackBlockage"; }
|
|
||||||
|
|
||||||
|
|
||||||
string TrackBlockage::_getString () const
|
|
||||||
{
|
|
||||||
string s1 = _segment->_getString();
|
|
||||||
string s2 = " [" + DbU::getValueString(_sourceU)
|
|
||||||
+ ":" + DbU::getValueString(_targetU) + "]"
|
|
||||||
+ " " + DbU::getValueString(_targetU-_sourceU)
|
|
||||||
+ " [" + ((_track) ? getString(_index) : "npos") + "]";
|
|
||||||
s1.insert ( s1.size()-1, s2 );
|
|
||||||
|
|
||||||
return s1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Record* TrackBlockage::_getRecord () const
|
|
||||||
{
|
|
||||||
Record* record = TrackElement::_getRecord ();
|
|
||||||
record->add ( getSlot ( "_segment", _segment ) );
|
|
||||||
|
|
||||||
return record;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
|
@ -33,8 +33,8 @@
|
||||||
#include "hurricane/Net.h"
|
#include "hurricane/Net.h"
|
||||||
#include "hurricane/Name.h"
|
#include "hurricane/Name.h"
|
||||||
#include "katabatic/AutoContact.h"
|
#include "katabatic/AutoContact.h"
|
||||||
|
#include "katabatic/GCell.h"
|
||||||
#include "crlcore/RoutingGauge.h"
|
#include "crlcore/RoutingGauge.h"
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/DataNegociate.h"
|
#include "kite/DataNegociate.h"
|
||||||
#include "kite/TrackElement.h"
|
#include "kite/TrackElement.h"
|
||||||
#include "kite/TrackCost.h"
|
#include "kite/TrackCost.h"
|
||||||
|
@ -74,6 +74,7 @@ namespace Kite {
|
||||||
using Hurricane::Bug;
|
using Hurricane::Bug;
|
||||||
using Hurricane::Net;
|
using Hurricane::Net;
|
||||||
using Hurricane::Name;
|
using Hurricane::Name;
|
||||||
|
using Katabatic::GCell;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
@ -156,7 +157,6 @@ namespace Kite {
|
||||||
bool TrackElement::canGoOutsideGCell () const { return false; }
|
bool TrackElement::canGoOutsideGCell () const { return false; }
|
||||||
bool TrackElement::canRipple () const { return false; }
|
bool TrackElement::canRipple () const { return false; }
|
||||||
unsigned long TrackElement::getId () const { return 0; }
|
unsigned long TrackElement::getId () const { return 0; }
|
||||||
GCell* TrackElement::getGCell () const { return NULL; }
|
|
||||||
unsigned long TrackElement::getArea () const { return 0; }
|
unsigned long TrackElement::getArea () const { return 0; }
|
||||||
unsigned int TrackElement::getDogLegLevel () const { return 0; }
|
unsigned int TrackElement::getDogLegLevel () const { return 0; }
|
||||||
unsigned int TrackElement::getDogLegOrder () const { return 0; }
|
unsigned int TrackElement::getDogLegOrder () const { return 0; }
|
||||||
|
@ -180,18 +180,16 @@ namespace Kite {
|
||||||
bool TrackElement::canMoveUp ( float, unsigned int ) const { return false; };
|
bool TrackElement::canMoveUp ( float, unsigned int ) 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 ( Katabatic::GCell*, bool allowReuse ) { return false; };
|
||||||
TrackElement* TrackElement::getSourceDogLeg () { return NULL; }
|
TrackElement* TrackElement::getSourceDogLeg () { return NULL; }
|
||||||
TrackElement* TrackElement::getTargetDogLeg () { return NULL; }
|
TrackElement* TrackElement::getTargetDogLeg () { return NULL; }
|
||||||
void TrackElement::dataInvalidate () { }
|
void TrackElement::dataInvalidate () { }
|
||||||
void TrackElement::eventInvalidate () { }
|
void TrackElement::eventInvalidate () { }
|
||||||
void TrackElement::setGCell ( GCell* ) { }
|
|
||||||
void TrackElement::setArea () { }
|
void TrackElement::setArea () { }
|
||||||
void TrackElement::setRouted ( bool ) { }
|
void TrackElement::setRouted ( bool ) { }
|
||||||
void TrackElement::setTrack ( Track* track ) { _track = track; }
|
void TrackElement::setTrack ( Track* track ) { _track = track; }
|
||||||
void TrackElement::setDogLegLevel ( unsigned int ) { }
|
void TrackElement::setDogLegLevel ( unsigned int ) { }
|
||||||
void TrackElement::setDogLegOrder ( unsigned int ) { }
|
void TrackElement::setDogLegOrder ( unsigned int ) { }
|
||||||
void TrackElement::updateGCellsStiffness ( unsigned int ) { }
|
|
||||||
void TrackElement::swapTrack ( TrackElement* ) { }
|
void TrackElement::swapTrack ( TrackElement* ) { }
|
||||||
void TrackElement::reschedule ( unsigned int ) { }
|
void TrackElement::reschedule ( unsigned int ) { }
|
||||||
void TrackElement::detach () { }
|
void TrackElement::detach () { }
|
||||||
|
@ -202,8 +200,8 @@ namespace Kite {
|
||||||
bool TrackElement::moveAside ( bool onLeft ) { return false; }
|
bool TrackElement::moveAside ( bool onLeft ) { return false; }
|
||||||
TrackElement* TrackElement::makeDogLeg () { return NULL; }
|
TrackElement* TrackElement::makeDogLeg () { return NULL; }
|
||||||
TrackElement* TrackElement::makeDogLeg ( Interval, bool& leftDogleg ) { return NULL; }
|
TrackElement* TrackElement::makeDogLeg ( Interval, bool& leftDogleg ) { return NULL; }
|
||||||
TrackElement* TrackElement::makeDogLeg ( GCell* ) { return NULL; }
|
TrackElement* TrackElement::makeDogLeg ( Katabatic::GCell* ) { return NULL; }
|
||||||
TrackElement* TrackElement::_postDogLeg ( GCell* ) { return NULL; }
|
TrackElement* TrackElement::_postDogLeg ( Katabatic::GCell* ) { return NULL; }
|
||||||
void TrackElement::_postModify () { }
|
void TrackElement::_postModify () { }
|
||||||
void TrackElement::desalignate () { }
|
void TrackElement::desalignate () { }
|
||||||
bool TrackElement::_check () const { return true; }
|
bool TrackElement::_check () const { return true; }
|
||||||
|
@ -248,13 +246,13 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Interval TrackElement::getFreeInterval ( bool useOrder ) const
|
Interval TrackElement::getFreeInterval () const
|
||||||
{
|
{
|
||||||
if ( !_track ) return Interval(false);
|
if ( !_track ) return Interval(false);
|
||||||
|
|
||||||
size_t begin = _index;
|
size_t begin = _index;
|
||||||
size_t end = _index;
|
size_t end = _index;
|
||||||
return _track->expandFreeInterval ( begin, end, Track::Inside, getNet(), useOrder );
|
return _track->expandFreeInterval ( begin, end, Track::Inside, getNet() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace Kite {
|
||||||
if ( _locator.isValid() ) {
|
if ( _locator.isValid() ) {
|
||||||
_element = Session::lookup ( _locator.getElement()->getCanonical(bounds)->base() );
|
_element = Session::lookup ( _locator.getElement()->getCanonical(bounds)->base() );
|
||||||
if ( !_element ) {
|
if ( !_element ) {
|
||||||
cerr << Bug("Canonical segment whithout TrackElement.") << endl;
|
cerr << Bug("Canonical segment without TrackElement.") << endl;
|
||||||
progress ();
|
progress ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
#include "hurricane/Vertical.h"
|
#include "hurricane/Vertical.h"
|
||||||
#include "katabatic/AutoContact.h"
|
#include "katabatic/AutoContact.h"
|
||||||
#include "crlcore/RoutingGauge.h"
|
#include "crlcore/RoutingGauge.h"
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/DataNegociate.h"
|
#include "kite/DataNegociate.h"
|
||||||
#include "kite/TrackFixedSegment.h"
|
#include "kite/TrackFixedSegment.h"
|
||||||
#include "kite/TrackCost.h"
|
#include "kite/TrackCost.h"
|
||||||
|
@ -98,10 +97,10 @@ namespace Kite {
|
||||||
_sourceU = max ( boundingBox.getXMin(), uside.getVMin());
|
_sourceU = max ( boundingBox.getXMin(), uside.getVMin());
|
||||||
_targetU = min ( boundingBox.getXMax(), uside.getVMax());
|
_targetU = min ( boundingBox.getXMax(), uside.getVMax());
|
||||||
|
|
||||||
GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_sourceU,track->getAxis()) );
|
Katabatic::GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_sourceU,track->getAxis()) );
|
||||||
GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_targetU,track->getAxis()) );
|
Katabatic::GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(_targetU,track->getAxis()) );
|
||||||
GCell* right = NULL;
|
Katabatic::GCell* right = NULL;
|
||||||
Interval guside = gcell->getUSide ( Constant::Horizontal, true );
|
Interval guside = gcell->getUSide ( Constant::Horizontal /*, true*/ );
|
||||||
Interval segside ( boundingBox.getXMin(), boundingBox.getXMax() );
|
Interval segside ( boundingBox.getXMin(), boundingBox.getXMax() );
|
||||||
|
|
||||||
if ( gcell ) {
|
if ( gcell ) {
|
||||||
|
@ -109,14 +108,14 @@ namespace Kite {
|
||||||
right = gcell->getRight();
|
right = gcell->getRight();
|
||||||
if ( right == NULL ) break;
|
if ( right == NULL ) break;
|
||||||
|
|
||||||
guside = gcell->getUSide ( Constant::Horizontal, true );
|
guside = gcell->getUSide ( Constant::Horizontal /*, true*/ );
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
Interval usedLength = guside.getIntersection ( segside );
|
||||||
|
|
||||||
gcell->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
gcell->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
||||||
gcell = right;
|
gcell = right;
|
||||||
}
|
}
|
||||||
if ( end ) {
|
if ( end ) {
|
||||||
guside = gcell->getUSide ( Constant::Horizontal, true );
|
guside = gcell->getUSide ( Constant::Horizontal /*, true*/ );
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
Interval usedLength = guside.getIntersection ( segside );
|
||||||
|
|
||||||
end->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
end->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
||||||
|
@ -129,24 +128,24 @@ namespace Kite {
|
||||||
_sourceU = max ( boundingBox.getYMin(), uside.getVMin());
|
_sourceU = max ( boundingBox.getYMin(), uside.getVMin());
|
||||||
_targetU = min ( boundingBox.getYMax(), uside.getVMax());
|
_targetU = min ( boundingBox.getYMax(), uside.getVMax());
|
||||||
|
|
||||||
GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_sourceU) );
|
Katabatic::GCell* gcell = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_sourceU) );
|
||||||
GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_targetU) );
|
Katabatic::GCell* end = track->getKiteEngine()->getGCellGrid()->getGCell ( Point(track->getAxis(),_targetU) );
|
||||||
GCell* up = NULL;
|
Katabatic::GCell* up = NULL;
|
||||||
Interval guside = gcell->getUSide ( Constant::Vertical, true );
|
Interval guside = gcell->getUSide ( Constant::Vertical /*, true*/ );
|
||||||
Interval segside ( boundingBox.getYMin(), boundingBox.getYMax() );
|
Interval segside ( boundingBox.getYMin(), boundingBox.getYMax() );
|
||||||
if ( gcell ) {
|
if ( gcell ) {
|
||||||
while ( gcell and (gcell != end) ) {
|
while ( gcell and (gcell != end) ) {
|
||||||
up = gcell->getUp();
|
up = gcell->getUp();
|
||||||
if ( up == NULL ) break;
|
if ( up == NULL ) break;
|
||||||
|
|
||||||
guside = gcell->getUSide ( Constant::Vertical, true );
|
guside = gcell->getUSide ( Constant::Vertical /*, true*/ );
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
Interval usedLength = guside.getIntersection ( segside );
|
||||||
|
|
||||||
gcell->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
gcell->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
||||||
gcell = up;
|
gcell = up;
|
||||||
}
|
}
|
||||||
if ( end ) {
|
if ( end ) {
|
||||||
guside = gcell->getUSide ( Constant::Vertical, true );
|
guside = gcell->getUSide ( Constant::Vertical /*, true*/ );
|
||||||
Interval usedLength = guside.getIntersection ( segside );
|
Interval usedLength = guside.getIntersection ( segside );
|
||||||
|
|
||||||
end->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
end->addBlockage ( depth, (float)usedLength.getSize()/(float)guside.getSize() );
|
||||||
|
|
|
@ -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
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -34,8 +34,8 @@
|
||||||
#include "hurricane/Name.h"
|
#include "hurricane/Name.h"
|
||||||
#include "hurricane/RoutingPad.h"
|
#include "hurricane/RoutingPad.h"
|
||||||
#include "katabatic/AutoContact.h"
|
#include "katabatic/AutoContact.h"
|
||||||
|
#include "katabatic/GCell.h"
|
||||||
#include "crlcore/RoutingGauge.h"
|
#include "crlcore/RoutingGauge.h"
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/DataNegociate.h"
|
#include "kite/DataNegociate.h"
|
||||||
#include "kite/TrackSegment.h"
|
#include "kite/TrackSegment.h"
|
||||||
#include "kite/TrackCost.h"
|
#include "kite/TrackCost.h"
|
||||||
|
@ -69,7 +69,6 @@ namespace Kite {
|
||||||
TrackSegment::TrackSegment ( AutoSegment* segment, Track* track )
|
TrackSegment::TrackSegment ( AutoSegment* segment, Track* track )
|
||||||
: TrackElement (track)
|
: TrackElement (track)
|
||||||
, _base (segment)
|
, _base (segment)
|
||||||
, _gcell (NULL)
|
|
||||||
, _created (true)
|
, _created (true)
|
||||||
, _lock (true)
|
, _lock (true)
|
||||||
, _revalidated (false)
|
, _revalidated (false)
|
||||||
|
@ -80,7 +79,6 @@ namespace Kite {
|
||||||
, _area (0)
|
, _area (0)
|
||||||
, _data (NULL)
|
, _data (NULL)
|
||||||
, _dogLegLevel (0)
|
, _dogLegLevel (0)
|
||||||
, _dogLegOrder (0)
|
|
||||||
{
|
{
|
||||||
if (segment) {
|
if (segment) {
|
||||||
_data = new DataNegociate ( this );
|
_data = new DataNegociate ( this );
|
||||||
|
@ -95,20 +93,11 @@ namespace Kite {
|
||||||
{
|
{
|
||||||
TrackElement::_postCreate ();
|
TrackElement::_postCreate ();
|
||||||
Session::link ( this );
|
Session::link ( this );
|
||||||
|
|
||||||
vector<GCell*> gcells;
|
|
||||||
getGCells ( gcells );
|
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TrackSegment::~TrackSegment ()
|
TrackSegment::~TrackSegment ()
|
||||||
{
|
{ if ( _data ) delete _data; }
|
||||||
if ( _data ) delete _data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::_preDestroy ()
|
void TrackSegment::_preDestroy ()
|
||||||
|
@ -128,7 +117,7 @@ namespace Kite {
|
||||||
created = false;
|
created = false;
|
||||||
|
|
||||||
TrackElement* trackElement = Session::lookup ( segment->base() );
|
TrackElement* trackElement = Session::lookup ( segment->base() );
|
||||||
if ( !trackElement ) {
|
if ( not trackElement ) {
|
||||||
TrackSegment* trackSegment = new TrackSegment ( segment, track );
|
TrackSegment* trackSegment = new TrackSegment ( segment, track );
|
||||||
trackSegment->_postCreate ();
|
trackSegment->_postCreate ();
|
||||||
created = true;
|
created = true;
|
||||||
|
@ -163,11 +152,9 @@ namespace Kite {
|
||||||
bool TrackSegment::canGoOutsideGCell () const { return _base->canGoOutsideGCell(); }
|
bool TrackSegment::canGoOutsideGCell () const { return _base->canGoOutsideGCell(); }
|
||||||
bool TrackSegment::canRipple () const { return _canRipple; }
|
bool TrackSegment::canRipple () const { return _canRipple; }
|
||||||
unsigned long TrackSegment::getId () const { return _base->getId(); }
|
unsigned long TrackSegment::getId () const { return _base->getId(); }
|
||||||
GCell* TrackSegment::getGCell () const { return _gcell; }
|
|
||||||
DbU::Unit TrackSegment::getAxis () const { return _base->getAxis(); }
|
DbU::Unit TrackSegment::getAxis () const { return _base->getAxis(); }
|
||||||
unsigned long TrackSegment::getArea () const { return _area; }
|
unsigned long TrackSegment::getArea () const { return _area; }
|
||||||
unsigned int TrackSegment::getDogLegLevel () const { return _dogLegLevel; }
|
unsigned int TrackSegment::getDogLegLevel () const { return _dogLegLevel; }
|
||||||
unsigned int TrackSegment::getDogLegOrder () const { return _dogLegOrder; }
|
|
||||||
Interval TrackSegment::getSourceConstraints () const { return _base->getSourceConstraints(); }
|
Interval TrackSegment::getSourceConstraints () const { return _base->getSourceConstraints(); }
|
||||||
Interval TrackSegment::getTargetConstraints () const { return _base->getTargetConstraints(); }
|
Interval TrackSegment::getTargetConstraints () const { return _base->getTargetConstraints(); }
|
||||||
DataNegociate* TrackSegment::getDataNegociate () const { return _data; }
|
DataNegociate* TrackSegment::getDataNegociate () const { return _data; }
|
||||||
|
@ -220,7 +207,6 @@ namespace Kite {
|
||||||
TrackElement* TrackSegment::getNext () const
|
TrackElement* TrackSegment::getNext () const
|
||||||
{
|
{
|
||||||
size_t dummy = _index;
|
size_t dummy = _index;
|
||||||
|
|
||||||
return _track->getNext ( dummy, getNet() );
|
return _track->getNext ( dummy, getNet() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,40 +214,39 @@ namespace Kite {
|
||||||
TrackElement* TrackSegment::getPrevious () const
|
TrackElement* TrackSegment::getPrevious () const
|
||||||
{
|
{
|
||||||
size_t dummy = _index;
|
size_t dummy = _index;
|
||||||
|
|
||||||
return _track->getPrevious ( dummy, getNet() );
|
return _track->getPrevious ( dummy, getNet() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Interval TrackSegment::getFreeInterval ( bool useOrder ) const
|
Interval TrackSegment::getFreeInterval () const
|
||||||
{
|
{
|
||||||
if ( !_track ) return Interval(false);
|
if ( not _track ) return Interval(false);
|
||||||
|
|
||||||
size_t begin = _index;
|
size_t begin = _index;
|
||||||
size_t end = _index;
|
size_t end = _index;
|
||||||
|
|
||||||
return _track->expandFreeInterval ( begin, end, Track::Inside, getNet(), useOrder );
|
return _track->expandFreeInterval ( begin, end, Track::Inside, getNet() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
size_t TrackSegment::getGCells ( vector<GCell*>& gcells ) const
|
size_t TrackSegment::getGCells ( vector<Katabatic::GCell*>& gcells ) const
|
||||||
{
|
{
|
||||||
vector<GCell*>().swap ( gcells );
|
vector<Katabatic::GCell*>().swap ( gcells );
|
||||||
|
|
||||||
GCell* sourceGCell = Session::lookup(base()->getAutoSource()->getGCell());
|
Katabatic::GCell* sourceGCell = base()->getAutoSource()->getGCell();
|
||||||
GCell* targetGCell = Session::lookup(base()->getAutoTarget()->getGCell());
|
Katabatic::GCell* targetGCell = base()->getAutoTarget()->getGCell();
|
||||||
|
|
||||||
ltrace(148) << "getGCells(): sourceGCell: " << sourceGCell << endl;
|
ltrace(148) << "getGCells(): sourceGCell: " << sourceGCell << endl;
|
||||||
ltrace(148) << "getGCells(): targetGCell: " << targetGCell << endl;
|
ltrace(148) << "getGCells(): targetGCell: " << targetGCell << endl;
|
||||||
|
|
||||||
forEach ( AutoSegment*, isegment, base()->getCollapseds() ) {
|
forEach ( AutoSegment*, isegment, base()->getCollapseds() ) {
|
||||||
GCell* gcell = Session::lookup(isegment->getAutoSource()->getGCell());
|
Katabatic::GCell* gcell = isegment->getAutoSource()->getGCell();
|
||||||
if ( gcell->getIndex() < sourceGCell->getIndex() ) {
|
if ( gcell->getIndex() < sourceGCell->getIndex() ) {
|
||||||
sourceGCell = gcell;
|
sourceGCell = gcell;
|
||||||
ltrace(148) << "getGCells(): new sourceGCell: " << sourceGCell << endl;
|
ltrace(148) << "getGCells(): new sourceGCell: " << sourceGCell << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcell = Session::lookup(isegment->getAutoTarget()->getGCell());
|
gcell = isegment->getAutoTarget()->getGCell();
|
||||||
if ( gcell->getIndex() > targetGCell->getIndex() ) {
|
if ( gcell->getIndex() > targetGCell->getIndex() ) {
|
||||||
targetGCell = gcell;
|
targetGCell = gcell;
|
||||||
ltrace(148) << "getGCells(): new targetGCell: " << targetGCell << endl;
|
ltrace(148) << "getGCells(): new targetGCell: " << targetGCell << endl;
|
||||||
|
@ -295,14 +280,6 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::setGCell ( GCell* gcell )
|
|
||||||
{
|
|
||||||
_gcell = gcell;
|
|
||||||
if (_data and not (_data->isBorder() or _data->isRing()))
|
|
||||||
_data->setGCellOrder( (_gcell) ? _gcell->getOrder() : (unsigned int)-1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
size_t TrackSegment::getPerpandicularsBound ( set<TrackElement*>& bounds )
|
size_t TrackSegment::getPerpandicularsBound ( set<TrackElement*>& bounds )
|
||||||
{
|
{
|
||||||
bounds.clear ();
|
bounds.clear ();
|
||||||
|
@ -321,13 +298,6 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
unsigned int TrackSegment::getOrder () const
|
|
||||||
{
|
|
||||||
if ( _data == NULL ) return numeric_limits<unsigned int>::max();
|
|
||||||
return _data->getGCellOrder ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::setDogLegLevel ( unsigned int level )
|
void TrackSegment::setDogLegLevel ( unsigned int level )
|
||||||
{
|
{
|
||||||
if ( level > 15 ) {
|
if ( level > 15 ) {
|
||||||
|
@ -340,20 +310,6 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::setDogLegOrder ( unsigned int order )
|
|
||||||
{
|
|
||||||
ltrace(200) << "setDogLegOrder(): " << order << " " << this << endl;
|
|
||||||
|
|
||||||
if ( order > 32768 ) {
|
|
||||||
cerr << Bug("%s has reached maximum dog leg order (32768)."
|
|
||||||
,_getString().c_str()) << endl;
|
|
||||||
order = 32768;
|
|
||||||
}
|
|
||||||
|
|
||||||
_dogLegOrder = order;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::dataInvalidate ()
|
void TrackSegment::dataInvalidate ()
|
||||||
{ if (_data) _data->invalidate(); }
|
{ if (_data) _data->invalidate(); }
|
||||||
|
|
||||||
|
@ -381,12 +337,7 @@ namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::setTrack ( Track* track )
|
void TrackSegment::setTrack ( Track* track )
|
||||||
{
|
{ TrackElement::setTrack ( track ); }
|
||||||
TrackElement::setTrack ( track );
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( ((track != NULL) ? TrackElement::Routed : TrackElement::UnRouted ) );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::detach ()
|
void TrackSegment::detach ()
|
||||||
|
@ -396,7 +347,6 @@ namespace Kite {
|
||||||
setTrack ( NULL );
|
setTrack ( NULL );
|
||||||
setIndex ( (size_t)-1 );
|
setIndex ( (size_t)-1 );
|
||||||
setLock ( true );
|
setLock ( true );
|
||||||
//updateGCellsStiffness ( TrackElement::UnRouted );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -411,7 +361,6 @@ namespace Kite {
|
||||||
_data->invalidate ( true, true );
|
_data->invalidate ( true, true );
|
||||||
|
|
||||||
if ( _track ) Session::addSortEvent ( _track );
|
if ( _track ) Session::addSortEvent ( _track );
|
||||||
|
|
||||||
_revalidated = true;
|
_revalidated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,48 +372,9 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::updateGCellsStiffness ( unsigned int flags )
|
|
||||||
{
|
|
||||||
if ( Session::getKiteEngine()->getState() > Katabatic::StateDriving ) return;
|
|
||||||
|
|
||||||
vector<GCell*> gcells;
|
|
||||||
getGCells ( gcells );
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
if ( flags & TrackElement::AddToGCells ) {
|
|
||||||
if ( getTrack() ) { flags |= TrackSegment::Routed; _routed = false; }
|
|
||||||
//cerr << "INC:";
|
|
||||||
count = +1;
|
|
||||||
}
|
|
||||||
if ( flags & TrackElement::RemoveFromGCells ) {
|
|
||||||
if ( getTrack() ) { flags |= TrackSegment::UnRouted; _routed = true; }
|
|
||||||
//cerr << "DEC:";
|
|
||||||
count = -1;
|
|
||||||
}
|
|
||||||
if ( count ) {
|
|
||||||
//cerr << count << " SegmentCount() for " << this << endl;
|
|
||||||
for ( size_t i=0 ; i<gcells.size() ; ++i ) {
|
|
||||||
gcells[i]->incSegmentCount ( count );
|
|
||||||
//cerr << "| " << gcells[i] << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
count = 0;
|
|
||||||
if ( not _routed and (flags & TrackElement::Routed ) ) { count = +1; _routed = true; }
|
|
||||||
if ( _routed and (flags & TrackElement::UnRouted) ) { count = -1; _routed = false; }
|
|
||||||
|
|
||||||
if ( count ) {
|
|
||||||
for ( size_t i=0 ; i<gcells.size() ; ++i ) {
|
|
||||||
gcells[i]->incRoutedCount ( count );
|
|
||||||
//cerr << "Update (" << count << ") " << gcells[i] << " for: " << this << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void TrackSegment::swapTrack ( TrackElement* other )
|
void TrackSegment::swapTrack ( TrackElement* other )
|
||||||
{
|
{
|
||||||
if ( !other ) return;
|
if ( not other ) return;
|
||||||
|
|
||||||
ltrace(200) << "TrackSegment::swapTrack()" << endl;
|
ltrace(200) << "TrackSegment::swapTrack()" << endl;
|
||||||
|
|
||||||
|
@ -484,8 +394,6 @@ namespace Kite {
|
||||||
|
|
||||||
setTrack ( NULL );
|
setTrack ( NULL );
|
||||||
other->setTrack ( NULL );
|
other->setTrack ( NULL );
|
||||||
// if ( _track ) updateGCellsStiffness ( TrackElement::UnRouted );
|
|
||||||
// if ( otherTrack ) other->updateGCellsStiffness ( TrackElement::UnRouted );
|
|
||||||
|
|
||||||
//other->setRouted ( thisRouted );
|
//other->setRouted ( thisRouted );
|
||||||
other->setTrack ( thisTrack );
|
other->setTrack ( thisTrack );
|
||||||
|
@ -519,12 +427,7 @@ namespace Kite {
|
||||||
{
|
{
|
||||||
ltrace(200) << "TrackSegment::reschedule() - " << this << endl;
|
ltrace(200) << "TrackSegment::reschedule() - " << this << endl;
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
ltrace(200) << "GCell: " << _gcell << endl;
|
|
||||||
ltrace(200) << "GCell::order:" << _gcell->getOrder()
|
|
||||||
<< " Data::order:" << getOrder()
|
|
||||||
<< " Session::order:" << Session::getOrder() << endl;
|
|
||||||
|
|
||||||
if ( getOrder() == Session::getOrder() ) {
|
|
||||||
if ( not _data or not _data->hasRoutingEvent() )
|
if ( not _data or not _data->hasRoutingEvent() )
|
||||||
Session::getNegociateWindow()->addInsertEvent ( this, level );
|
Session::getNegociateWindow()->addInsertEvent ( this, level );
|
||||||
else {
|
else {
|
||||||
|
@ -532,15 +435,7 @@ namespace Kite {
|
||||||
Session::addRemoveEvent ( this );
|
Session::addRemoveEvent ( this );
|
||||||
Session::getNegociateWindow()->rescheduleEvent ( _data->getRoutingEvent(), level );
|
Session::getNegociateWindow()->rescheduleEvent ( _data->getRoutingEvent(), level );
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if ( _data and _data->hasRoutingEvent() )
|
|
||||||
_data->getRoutingEvent()->setDisabled();
|
|
||||||
|
|
||||||
if ( getOrder() > Session::getOrder() ) {
|
|
||||||
if ( _track != NULL )
|
|
||||||
Session::addRemoveEvent ( this );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -551,59 +446,9 @@ namespace Kite {
|
||||||
ltrace(200) << "TrackSegment::slacken()" << endl;
|
ltrace(200) << "TrackSegment::slacken()" << endl;
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
|
|
||||||
// set<AutoSegment*> collapseds;
|
|
||||||
|
|
||||||
// collapseds.insert ( _base );
|
|
||||||
// forEach ( AutoSegment*, isegment, _base->getCollapseds() ) {
|
|
||||||
// collapseds.insert ( *isegment );
|
|
||||||
// }
|
|
||||||
|
|
||||||
//unsigned int direction = Constant::perpandicular ( getDirection() );
|
|
||||||
//unsigned int doglegLevel = getDogLegLevel() + 1;
|
|
||||||
|
|
||||||
//setSlackened ( true );
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::RemoveFromGCells );
|
|
||||||
#endif
|
|
||||||
base()->slacken ( true );
|
base()->slacken ( true );
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_postModify ();
|
_postModify ();
|
||||||
|
|
||||||
// const vector<AutoSegment*>& invalidateds = Session::getInvalidateds();
|
|
||||||
// if ( not invalidateds.empty() ) {
|
|
||||||
// vector<TrackElement*> segments;
|
|
||||||
// for ( size_t i=0 ; i<invalidateds.size() ; i++ ) {
|
|
||||||
// ltrace(200) << "slacken: " << invalidateds[i] << endl;
|
|
||||||
// TrackElement* segment = GCell::addTrackSegment(NULL,invalidateds[i],false);
|
|
||||||
// segments.push_back ( segment );
|
|
||||||
|
|
||||||
// //if ( segment->base()->isTerminal() or (collapseds.find(segment->base()) != collapseds.end()) )
|
|
||||||
// // segment->setSlackened ( true );
|
|
||||||
|
|
||||||
// if ( segment->isCreated() ) {
|
|
||||||
// //segment->setSlackened ( true );
|
|
||||||
// if ( segment->getDirection() == direction ) {
|
|
||||||
// ltrace(200) << "Increasing dogleg level to: " << doglegLevel << endl;
|
|
||||||
// segment->setDogLegLevel ( doglegLevel );
|
|
||||||
|
|
||||||
// if ( segment->getOrder() > Session::getOrder() ) {
|
|
||||||
// ltrace(200) << "Adding to ring: " << segment << endl;
|
|
||||||
// Session::getNegociateWindow()->addToRing ( segment );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// segment->reschedule ( 0 );
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
|
||||||
// ltrace(200) << "slacken: " << segments[i] << endl;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
} else
|
} else
|
||||||
throw Bug("TrackSegment::slacken(): NULL base or already slackened.");
|
throw Bug("TrackSegment::slacken(): NULL base or already slackened.");
|
||||||
|
@ -611,19 +456,11 @@ namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
bool TrackSegment::canPivotUp ( float reserve ) const
|
bool TrackSegment::canPivotUp ( float reserve ) const
|
||||||
{
|
{ return _base->canPivotUp(reserve); }
|
||||||
return _base->canPivotUp(reserve);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TrackSegment::canMoveUp ( float reserve, unsigned int flags ) const
|
bool TrackSegment::canMoveUp ( float reserve, unsigned int flags ) const
|
||||||
{
|
{ return _base->canMoveUp ( reserve, flags ); }
|
||||||
// if ( isLocal() /*and (hasSourceDogLeg() or hasTargetDogLeg())*/ ) {
|
|
||||||
// return _base->canPivotUp();
|
|
||||||
// }
|
|
||||||
|
|
||||||
return _base->canMoveUp ( reserve, flags );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool TrackSegment::moveUp ( unsigned int flags )
|
bool TrackSegment::moveUp ( unsigned int flags )
|
||||||
|
@ -633,19 +470,13 @@ namespace Kite {
|
||||||
ltrace(200) << "TrackSegment::moveUp() " << flags << endl;
|
ltrace(200) << "TrackSegment::moveUp() " << flags << endl;
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::RemoveFromGCells );
|
|
||||||
#endif
|
|
||||||
success = base()->moveUp ( flags );
|
success = base()->moveUp ( flags );
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const vector<AutoSegment*>& invalidateds = Session::getInvalidateds();
|
const vector<AutoSegment*>& invalidateds = Session::getInvalidateds();
|
||||||
if ( not invalidateds.empty() ) {
|
if ( not invalidateds.empty() ) {
|
||||||
vector<TrackElement*> segments;
|
vector<TrackElement*> segments;
|
||||||
for ( size_t i=0 ; i<invalidateds.size() ; i++ ) {
|
for ( size_t i=0 ; i<invalidateds.size() ; i++ ) {
|
||||||
TrackElement* segment = GCell::addTrackSegment(NULL,invalidateds[i],false);
|
TrackElement* segment = Session::getNegociateWindow()->addTrackSegment(invalidateds[i],false);
|
||||||
if ( segment != NULL ) {
|
if ( segment != NULL ) {
|
||||||
ltrace(200) << "moved: " << invalidateds[i] << endl;
|
ltrace(200) << "moved: " << invalidateds[i] << endl;
|
||||||
segments.push_back ( segment );
|
segments.push_back ( segment );
|
||||||
|
@ -654,16 +485,15 @@ namespace Kite {
|
||||||
segment->reschedule ( 0 );
|
segment->reschedule ( 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
||||||
ltrace(200) << "moved: " << segments[i] << endl;
|
ltrace(200) << "moved: " << segments[i] << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( _data ) {
|
// if ( _data and success ) {
|
||||||
_data->setState ( DataNegociate::ConflictSolve1, true );
|
// _data->setState ( DataNegociate::ConflictSolve1, true );
|
||||||
_data->resetRipupCount ();
|
// _data->resetRipupCount ();
|
||||||
}
|
// }
|
||||||
|
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
|
|
||||||
|
@ -678,32 +508,18 @@ namespace Kite {
|
||||||
ltrace(200) << "TrackSegment::moveAside() - " << (onLeft?"left":"right") << endl;
|
ltrace(200) << "TrackSegment::moveAside() - " << (onLeft?"left":"right") << endl;
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
|
|
||||||
unsigned int order = _data->getGCellOrder();
|
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::RemoveFromGCells );
|
|
||||||
#endif
|
|
||||||
if ( onLeft ) base()->moveULeft ();
|
if ( onLeft ) base()->moveULeft ();
|
||||||
else base()->moveURight ();
|
else base()->moveURight ();
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const vector<AutoSegment*>& invalidateds = Session::getInvalidateds();
|
const vector<AutoSegment*>& invalidateds = Session::getInvalidateds();
|
||||||
if ( not invalidateds.empty() ) {
|
if ( not invalidateds.empty() ) {
|
||||||
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) );
|
segments.push_back ( Session::getNegociateWindow()->addTrackSegment(invalidateds[i],false) );
|
||||||
segments.back()->reschedule ( 0 );
|
segments.back()->reschedule ( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( _data->getGCellOrder() < order ) {
|
|
||||||
cinfo << "[INFO] Putting TrackSegment of order " << order
|
|
||||||
<< " into GCell " << getGCell() << endl;
|
|
||||||
_data->setGCellOrder ( order );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
||||||
ltrace(200) << "moved: " << segments[i] << endl;
|
ltrace(200) << "moved: " << segments[i] << endl;
|
||||||
}
|
}
|
||||||
|
@ -717,7 +533,7 @@ namespace Kite {
|
||||||
|
|
||||||
TrackElement* TrackSegment::getSourceDogLeg ()
|
TrackElement* TrackSegment::getSourceDogLeg ()
|
||||||
{
|
{
|
||||||
if ( !hasSourceDogLeg() ) return NULL;
|
if ( not hasSourceDogLeg() ) return NULL;
|
||||||
|
|
||||||
unsigned int direction = Constant::perpandicular ( getDirection() );
|
unsigned int direction = Constant::perpandicular ( getDirection() );
|
||||||
TrackElement* dogleg = NULL;
|
TrackElement* dogleg = NULL;
|
||||||
|
@ -734,7 +550,7 @@ namespace Kite {
|
||||||
|
|
||||||
TrackElement* TrackSegment::getTargetDogLeg ()
|
TrackElement* TrackSegment::getTargetDogLeg ()
|
||||||
{
|
{
|
||||||
if ( !hasSourceDogLeg() ) return NULL;
|
if ( not hasSourceDogLeg() ) return NULL;
|
||||||
|
|
||||||
unsigned int direction = Constant::perpandicular ( getDirection() );
|
unsigned int direction = Constant::perpandicular ( getDirection() );
|
||||||
TrackElement* dogleg = NULL;
|
TrackElement* dogleg = NULL;
|
||||||
|
@ -763,13 +579,6 @@ namespace Kite {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( getDogLegOrder() < Session::getOrder() ) {
|
|
||||||
ltrace(200) << "No dogleg in current order " << Session::getOrder()
|
|
||||||
<< " yet, allowing (previous:" << _dogLegOrder << ")" << endl;
|
|
||||||
setDogLegOrder ( Session::getOrder() );
|
|
||||||
setSourceDogLeg ( false );
|
|
||||||
setTargetDogLeg ( false );
|
|
||||||
}
|
|
||||||
if ( hasSourceDogLeg() or hasTargetDogLeg() or isSlackened() ) {
|
if ( hasSourceDogLeg() or hasTargetDogLeg() or isSlackened() ) {
|
||||||
ltrace(200) << "Failed: already has source and/or target dogleg or slackened." << endl;
|
ltrace(200) << "Failed: already has source and/or target dogleg or slackened." << endl;
|
||||||
return false;
|
return false;
|
||||||
|
@ -785,17 +594,9 @@ namespace Kite {
|
||||||
|
|
||||||
bool upLayer = (Session::getRoutingGauge()->getLayerDepth(getLayer()) < 2);
|
bool upLayer = (Session::getRoutingGauge()->getLayerDepth(getLayer()) < 2);
|
||||||
|
|
||||||
GCell* originalGCell = getGCell ();
|
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::RemoveFromGCells );
|
|
||||||
#endif
|
|
||||||
base()->makeDogLeg ( interval, upLayer, leftDogleg );
|
base()->makeDogLeg ( interval, upLayer, leftDogleg );
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return _postDogLeg ( originalGCell );
|
return _postDogLeg ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -818,13 +619,6 @@ namespace Kite {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( getDogLegOrder() < Session::getOrder() ) {
|
|
||||||
ltrace(200) << "No dogleg in current order " << Session::getOrder()
|
|
||||||
<< " yet, allowing (previous:" << _dogLegOrder << ")" << endl;
|
|
||||||
setDogLegOrder ( Session::getOrder() );
|
|
||||||
setSourceDogLeg ( false );
|
|
||||||
setTargetDogLeg ( false );
|
|
||||||
}
|
|
||||||
if ( hasSourceDogLeg() || hasTargetDogLeg() ) return false;
|
if ( hasSourceDogLeg() || hasTargetDogLeg() ) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -833,17 +627,11 @@ namespace Kite {
|
||||||
|
|
||||||
TrackElement* TrackSegment::makeDogLeg ()
|
TrackElement* TrackSegment::makeDogLeg ()
|
||||||
{
|
{
|
||||||
AutoContact* source = _base->getAutoSource();
|
Katabatic::AutoContact* source = _base->getAutoSource();
|
||||||
AutoContact* target = _base->getAutoTarget();
|
Katabatic::AutoContact* target = _base->getAutoTarget();
|
||||||
GCell* gcell = Session::lookup ( _base->getAutoSource()->getGCell() );
|
Katabatic::GCell* gcell = _base->getAutoSource()->getGCell();
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::RemoveFromGCells );
|
|
||||||
#endif
|
|
||||||
TrackElement* dogleg = makeDogLeg ( gcell );
|
TrackElement* dogleg = makeDogLeg ( gcell );
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ( dogleg ) {
|
if ( dogleg ) {
|
||||||
if ( source->isTerminal() xor target->isTerminal() ) {
|
if ( source->isTerminal() xor target->isTerminal() ) {
|
||||||
|
@ -855,25 +643,17 @@ namespace Kite {
|
||||||
ltrace(200) << "Setting dogleg axis @" << DbU::getValueString(axis) << endl;
|
ltrace(200) << "Setting dogleg axis @" << DbU::getValueString(axis) << endl;
|
||||||
dogleg->setAxis ( axis );
|
dogleg->setAxis ( axis );
|
||||||
}
|
}
|
||||||
return _postDogLeg(gcell);
|
return _postDogLeg();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool TrackSegment::canDogLegAt ( GCell* dogLegGCell, bool allowReuse )
|
bool TrackSegment::canDogLegAt ( Katabatic::GCell* dogLegGCell, bool allowReuse )
|
||||||
{
|
{
|
||||||
ltrace(200) << "TrackSegment::canDogLegAt(GCell*) " << dogLegGCell << endl;
|
ltrace(200) << "TrackSegment::canDogLegAt(GCell*) " << dogLegGCell << endl;
|
||||||
|
|
||||||
if ( getDogLegOrder() < Session::getOrder() ) {
|
|
||||||
ltrace(200) << "No dogleg in current order " << Session::getOrder()
|
|
||||||
<< " yet, allowing (previous:" << _dogLegOrder << ")" << endl;
|
|
||||||
setDogLegOrder ( Session::getOrder() );
|
|
||||||
setSourceDogLeg ( false );
|
|
||||||
setTargetDogLeg ( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isFixed() ) {
|
if ( isFixed() ) {
|
||||||
ltrace(200) << "Cannot dogleg a fixed segment." << endl;
|
ltrace(200) << "Cannot dogleg a fixed segment." << endl;
|
||||||
return false;
|
return false;
|
||||||
|
@ -889,12 +669,8 @@ namespace Kite {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if ( Session::getRoutingGauge()->getLayerDepth(getLayer()) > 3 ) {
|
|
||||||
// ltrace(200) << "Cannot dogleg on the last top layer." << endl;
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
vector<GCell*> gcells;
|
vector<Katabatic::GCell*> gcells;
|
||||||
getGCells ( gcells );
|
getGCells ( gcells );
|
||||||
|
|
||||||
ltrace(190) << "Source: " << *gcells.begin () << endl;
|
ltrace(190) << "Source: " << *gcells.begin () << endl;
|
||||||
|
@ -921,11 +697,6 @@ namespace Kite {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if ( dogLegGCell->getUSide(getDirection(),false).intersect(getCanonicalInterval()) ) {
|
|
||||||
// ltrace(200) << "Segment is almost outside the breaking GCell." << endl;
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -938,28 +709,20 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TrackElement* TrackSegment::makeDogLeg ( GCell* dogLegGCell )
|
TrackElement* TrackSegment::makeDogLeg ( Katabatic::GCell* dogLegGCell )
|
||||||
{
|
{
|
||||||
ltrace(200) << "TrackSegment::makeDogLeg(GCell*)" << endl;
|
ltrace(200) << "TrackSegment::makeDogLeg(GCell*)" << endl;
|
||||||
ltrace(200) << "Break in: " << dogLegGCell << endl;
|
ltrace(200) << "Break in: " << dogLegGCell << endl;
|
||||||
|
|
||||||
bool upLayer = (Session::getRoutingGauge()->getLayerDepth(getLayer()) < 2);
|
bool upLayer = (Session::getRoutingGauge()->getLayerDepth(getLayer()) < 2);
|
||||||
|
|
||||||
GCell* originalGCell = getGCell ();
|
base()->makeDogLeg ( dogLegGCell, upLayer );
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
return _postDogLeg ();
|
||||||
updateGCellsStiffness ( TrackElement::RemoveFromGCells );
|
|
||||||
#endif
|
|
||||||
base()->makeDogLeg ( dogLegGCell->base(), upLayer );
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return _postDogLeg ( originalGCell );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TrackElement* TrackSegment::_postDogLeg ( GCell* originalGCell )
|
TrackElement* TrackSegment::_postDogLeg ()
|
||||||
{
|
{
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
|
|
||||||
|
@ -971,12 +734,7 @@ namespace Kite {
|
||||||
for ( size_t i=0 ; i<dogLegs.size() ; i++ ) {
|
for ( size_t i=0 ; i<dogLegs.size() ; i++ ) {
|
||||||
ltrace(200) << "Looking up: " << dogLegs[i] << endl;
|
ltrace(200) << "Looking up: " << dogLegs[i] << endl;
|
||||||
|
|
||||||
segments.push_back ( GCell::addTrackSegment(NULL,dogLegs[i]) );
|
segments.push_back ( Session::getNegociateWindow()->addTrackSegment(dogLegs[i],false) );
|
||||||
|
|
||||||
//if ( isSlackened() /*&& (segments[i]->base() == dogLegs[i])*/ )
|
|
||||||
// segments[i]->setSlackened (true);
|
|
||||||
|
|
||||||
segments[i]->setDogLegOrder ( Session::getOrder() );
|
|
||||||
|
|
||||||
switch ( i ) {
|
switch ( i ) {
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -1001,37 +759,13 @@ namespace Kite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ltrace(200) << "Before break: " << originalGCell << endl;
|
// TO CHECK
|
||||||
ltrace(200) << "After break: " << getGCell() << endl;
|
// If the original TrackElement was inserted in a Track, must check
|
||||||
if ( getGCell() != originalGCell ) swapTrack ( segments[2] );
|
// if the new bit takes it's place or not.
|
||||||
|
//if ( getGCell() != originalGCell ) swapTrack ( segments[2] );
|
||||||
|
|
||||||
for ( size_t i=0 ; i<dogLegs.size() ; i++ ) {
|
for ( size_t i=0 ; i<dogLegs.size() ; i++ ) {
|
||||||
segments[i]->reschedule ( ((i==1) ? 0 : 1) );
|
segments[i]->reschedule ( ((i==1) ? 0 : 1) );
|
||||||
if ( i == 1 ) {
|
|
||||||
ltrace(200) << "Set canDogleg: dogleg:" << segments[1]->getDataNegociate()->getGCellOrder()
|
|
||||||
<< " vs. session:" << Session::getOrder() << endl;
|
|
||||||
|
|
||||||
if ( segments[1]->getOrder() > Session::getOrder()) {
|
|
||||||
segments[i]->setCanRipple ( true );
|
|
||||||
ltrace(200) << "Adding to ring: " << segments[i] << endl;
|
|
||||||
Session::getNegociateWindow()->addToRing ( segments[i] );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ( segments[i]->getOrder() > Session::getOrder()) {
|
|
||||||
AutoContact* source = segments[i]->base()->getAutoSource();
|
|
||||||
AutoContact* target = segments[i]->base()->getAutoTarget();
|
|
||||||
if ( (source and dynamic_cast<RoutingPad*>(source->getAnchor()))
|
|
||||||
or (target and dynamic_cast<RoutingPad*>(target->getAnchor()))) {
|
|
||||||
ltrace(200) << "Adding to ring: " << segments[i] << endl;
|
|
||||||
Session::getNegociateWindow()->addToRing ( segments[i] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//if ( i == 1 ) {
|
|
||||||
// RoutingEvent* event = segments[i]->getDataNegociate()->getRoutingEvent();
|
|
||||||
// if ( event )
|
|
||||||
// event->setCanGoOutsideGCell ( true );
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ltrace(200) << "original: " << segments[0] << endl;
|
ltrace(200) << "original: " << segments[0] << endl;
|
||||||
|
@ -1050,12 +784,6 @@ namespace Kite {
|
||||||
ltrace(200) << "TrackSegment::canDesalignate()" << endl;
|
ltrace(200) << "TrackSegment::canDesalignate()" << endl;
|
||||||
|
|
||||||
return _base->canDesalignate();
|
return _base->canDesalignate();
|
||||||
|
|
||||||
// Interval baseSpan = _base->getSpanU ();
|
|
||||||
// if ( baseSpan.getVMin() - Session::getExtensionCap() > _sourceCanonical ) return _base->canDesalignate();
|
|
||||||
// if ( baseSpan.getVMax() + Session::getExtensionCap() < _targetCanonical ) return _base->canDesalignate();
|
|
||||||
|
|
||||||
// return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1064,37 +792,9 @@ namespace Kite {
|
||||||
ltrace(200) << "TrackSegment::desalignate()" << endl;
|
ltrace(200) << "TrackSegment::desalignate()" << endl;
|
||||||
ltracein(200);
|
ltracein(200);
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::RemoveFromGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_base->desalignate ();
|
_base->desalignate ();
|
||||||
|
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
updateGCellsStiffness ( TrackElement::AddToGCells );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_postModify ();
|
_postModify ();
|
||||||
|
|
||||||
// const vector<AutoSegment*>& invalidateds = Session::getInvalidateds();
|
|
||||||
// if ( not invalidateds.empty() ) {
|
|
||||||
// vector<TrackElement*> segments;
|
|
||||||
// for ( size_t i=0 ; i<invalidateds.size() ; i++ ) {
|
|
||||||
// ltrace(200) << "desaligned: " << invalidateds[i] << endl;
|
|
||||||
// segments.push_back ( GCell::addTrackSegment(NULL,invalidateds[i],false) );
|
|
||||||
// segments[i]->reschedule ( 0 );
|
|
||||||
|
|
||||||
// if ( segments[i]->getDataNegociate()->getGCellOrder() > Session::getOrder() ) {
|
|
||||||
// ltrace(200) << "Adding to ring: " << segments[i] << endl;
|
|
||||||
// Session::getNegociateWindow()->addToRing ( segments[i] );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for ( size_t i=0 ; i<segments.size() ; i++ ) {
|
|
||||||
// ltrace(200) << "desaligned: " << segments[i] << endl;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,7 +814,7 @@ namespace Kite {
|
||||||
if ( not invalidateds.empty() ) {
|
if ( not invalidateds.empty() ) {
|
||||||
for ( size_t i=0 ; i<invalidateds.size() ; i++ ) {
|
for ( size_t i=0 ; i<invalidateds.size() ; i++ ) {
|
||||||
ltrace(200) << "invalidated: " << invalidateds[i] << endl;
|
ltrace(200) << "invalidated: " << invalidateds[i] << endl;
|
||||||
TrackElement* segment = GCell::addTrackSegment(NULL,invalidateds[i],false);
|
TrackElement* segment = Session::getNegociateWindow()->addTrackSegment(invalidateds[i],false);
|
||||||
if ( segment != NULL )
|
if ( segment != NULL )
|
||||||
segments.push_back ( segment );
|
segments.push_back ( segment );
|
||||||
}
|
}
|
||||||
|
@ -1129,31 +829,13 @@ namespace Kite {
|
||||||
segment->setDogLegLevel ( doglegLevel );
|
segment->setDogLegLevel ( doglegLevel );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( segment->getDataNegociate()->getGCellOrder() == Session::getOrder() ) {
|
|
||||||
if ( segment->getDirection() == parallelDir ) {
|
if ( segment->getDirection() == parallelDir ) {
|
||||||
forEach ( TrackElement*, iperpandicular, segment->getCollapsedPerpandiculars() ) {
|
forEach ( TrackElement*, iperpandicular, segment->getCollapsedPerpandiculars() ) {
|
||||||
ltrace(200) << "| pp: " << *iperpandicular << endl;
|
ltrace(200) << "| pp: " << *iperpandicular << endl;
|
||||||
|
|
||||||
if ( iperpandicular->getDataNegociate()->getGCellOrder() == Session::getOrder() ) {
|
|
||||||
iperpandicular->reschedule ( 0 );
|
iperpandicular->reschedule ( 0 );
|
||||||
} else if ( iperpandicular->getDataNegociate()->getGCellOrder() > Session::getOrder() ) {
|
|
||||||
ltrace(200) << "Adding to ring: " << *iperpandicular << endl;
|
|
||||||
Session::getNegociateWindow()->addToRing ( *iperpandicular );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
segment->reschedule ( 0 );
|
segment->reschedule ( 0 );
|
||||||
}
|
}
|
||||||
} else if ( segment->getDataNegociate()->getGCellOrder() > Session::getOrder()) {
|
|
||||||
if ( segment->getDirection() == parallelDir ) {
|
|
||||||
AutoContact* source = segment->base()->getAutoSource();
|
|
||||||
AutoContact* target = segment->base()->getAutoTarget();
|
|
||||||
if ( (source and dynamic_cast<RoutingPad*>(source->getAnchor()))
|
|
||||||
or (target and dynamic_cast<RoutingPad*>(target->getAnchor()))) {
|
|
||||||
ltrace(200) << "Adding to ring: " << segment << endl;
|
|
||||||
Session::getNegociateWindow()->addToRing ( segment );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ltraceout(200);
|
ltraceout(200);
|
||||||
|
@ -1162,7 +844,7 @@ namespace Kite {
|
||||||
|
|
||||||
bool TrackSegment::_check () const
|
bool TrackSegment::_check () const
|
||||||
{
|
{
|
||||||
if ( !base() ) return true;
|
if ( not base() ) return true;
|
||||||
|
|
||||||
bool coherency = true;
|
bool coherency = true;
|
||||||
|
|
||||||
|
@ -1182,11 +864,6 @@ namespace Kite {
|
||||||
cerr << "[CHECK] " << this << " has bad target position " << DbU::getValueString(max) << "." << endl;
|
cerr << "[CHECK] " << this << " has bad target position " << DbU::getValueString(max) << "." << endl;
|
||||||
coherency = false;
|
coherency = false;
|
||||||
}
|
}
|
||||||
#if ENABLE_STIFFNESS
|
|
||||||
if ( _routed xor (_track != NULL) ) {
|
|
||||||
cerr << "[CHECK] " << this << " incoherency between routed/track flags." << endl;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return coherency;
|
return coherency;
|
||||||
}
|
}
|
||||||
|
@ -1203,13 +880,10 @@ namespace Kite {
|
||||||
+ ":" + DbU::getValueString(_targetU) + "]"
|
+ ":" + DbU::getValueString(_targetU) + "]"
|
||||||
+ " " + DbU::getValueString(_targetU-_sourceU)
|
+ " " + DbU::getValueString(_targetU-_sourceU)
|
||||||
+ " " + getString(_dogLegLevel)
|
+ " " + getString(_dogLegLevel)
|
||||||
+ " o:" + getString(_data->getGCellOrder())
|
|
||||||
+ " [" + ((_track) ? getString(_index) : "npos") + "] "
|
+ " [" + ((_track) ? getString(_index) : "npos") + "] "
|
||||||
+ ((isSlackened() ) ? "S" : "-")
|
+ ((isSlackened() ) ? "S" : "-")
|
||||||
+ ((_track ) ? "T" : "-")
|
+ ((_track ) ? "T" : "-")
|
||||||
+ ((_canRipple ) ? "r" : "-")
|
+ ((_canRipple ) ? "r" : "-")
|
||||||
+ ((_data->isBorder()) ? "B" : "-")
|
|
||||||
+ ((_data->isRing ()) ? "R" : "-")
|
|
||||||
+ ((_sourceDogLeg ) ? "s" : "-")
|
+ ((_sourceDogLeg ) ? "s" : "-")
|
||||||
+ ((_targetDogLeg ) ? "t" : "-");
|
+ ((_targetDogLeg ) ? "t" : "-");
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -45,7 +45,6 @@ namespace Katabatic {
|
||||||
|
|
||||||
namespace Kite {
|
namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::cerr;
|
using std::cerr;
|
||||||
using std::endl;
|
using std::endl;
|
||||||
|
@ -65,42 +64,32 @@ namespace Kite {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum SlackState { RipupPerpandiculars= 1
|
enum SlackState { RipupPerpandiculars= 1
|
||||||
, Minimize
|
, Minimize = 2
|
||||||
, DogLeg
|
, DogLeg = 3
|
||||||
, Desalignate
|
, Desalignate = 4
|
||||||
, Slacken
|
, Slacken = 5
|
||||||
, ConflictSolve1
|
, ConflictSolve1 = 6
|
||||||
, ConflictSolve2
|
, ConflictSolve2 = 7
|
||||||
, LocalVsGlobal
|
, LocalVsGlobal = 8
|
||||||
, MoveUp
|
, MoveUp = 9
|
||||||
, MaximumSlack
|
, MaximumSlack =10
|
||||||
, Unimplemented
|
, Unimplemented =11
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DataNegociate ( TrackElement* );
|
DataNegociate ( TrackElement* );
|
||||||
~DataNegociate ();
|
~DataNegociate ();
|
||||||
inline bool isRing () const;
|
|
||||||
inline bool isBorder () const;
|
|
||||||
inline bool isLeftBorder () const;
|
|
||||||
inline bool isRightBorder () const;
|
|
||||||
inline bool hasRoutingEvent () const;
|
inline bool hasRoutingEvent () const;
|
||||||
inline RoutingEvent* getRoutingEvent () const;
|
inline RoutingEvent* getRoutingEvent () const;
|
||||||
inline TrackElement* getTrackSegment () const;
|
inline TrackElement* getTrackSegment () const;
|
||||||
inline Track* getTrack () const;
|
inline Track* getTrack () const;
|
||||||
inline TrackSegmentCost& getCost ();
|
inline TrackSegmentCost& getCost ();
|
||||||
inline unsigned int getGCellOrder () const;
|
|
||||||
//inline unsigned int getZ () const;
|
//inline unsigned int getZ () const;
|
||||||
inline unsigned int getState () const;
|
inline unsigned int getState () const;
|
||||||
inline unsigned int getStateCount () const;
|
inline unsigned int getStateCount () const;
|
||||||
inline unsigned int getRipupCount () const;
|
inline unsigned int getRipupCount () const;
|
||||||
inline unsigned int getStateAndRipupCount () const;
|
inline unsigned int getStateAndRipupCount () const;
|
||||||
inline void setGCellOrder ( unsigned int );
|
|
||||||
inline void setState ( unsigned int, bool reset=false );
|
inline void setState ( unsigned int, bool reset=false );
|
||||||
inline void setRing ( bool );
|
|
||||||
inline void setLeftBorder ( bool );
|
|
||||||
inline void setRightBorder ( bool );
|
|
||||||
inline void resetBorder ();
|
|
||||||
inline void setRoutingEvent ( RoutingEvent* );
|
inline void setRoutingEvent ( RoutingEvent* );
|
||||||
inline void setRipupCount ( unsigned int );
|
inline void setRipupCount ( unsigned int );
|
||||||
inline void incRipupCount ();
|
inline void incRipupCount ();
|
||||||
|
@ -119,12 +108,8 @@ namespace Kite {
|
||||||
RoutingEvent* _routingEvent;
|
RoutingEvent* _routingEvent;
|
||||||
TrackElement* _trackSegment;
|
TrackElement* _trackSegment;
|
||||||
TrackSegmentCost _cost;
|
TrackSegmentCost _cost;
|
||||||
unsigned int _gcellOrder;
|
|
||||||
unsigned int _state :5;
|
unsigned int _state :5;
|
||||||
unsigned int _stateCount:5;
|
unsigned int _stateCount:5;
|
||||||
bool _leftBorder;
|
|
||||||
bool _rightBorder;
|
|
||||||
bool _ring;
|
|
||||||
//unsigned int _z : 5;
|
//unsigned int _z : 5;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -134,25 +119,15 @@ namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
// Inline Functions.
|
// Inline Functions.
|
||||||
inline bool DataNegociate::isRing () const { return _ring; }
|
|
||||||
inline bool DataNegociate::isBorder () const { return _leftBorder or _rightBorder; }
|
|
||||||
inline bool DataNegociate::isLeftBorder () const { return _leftBorder; }
|
|
||||||
inline bool DataNegociate::isRightBorder () const { return _rightBorder; }
|
|
||||||
inline bool DataNegociate::hasRoutingEvent () const { return _routingEvent != NULL; }
|
inline bool DataNegociate::hasRoutingEvent () const { return _routingEvent != NULL; }
|
||||||
inline RoutingEvent* DataNegociate::getRoutingEvent () const { return _routingEvent; }
|
inline RoutingEvent* DataNegociate::getRoutingEvent () const { return _routingEvent; }
|
||||||
inline TrackElement* DataNegociate::getTrackSegment () const { return _trackSegment; }
|
inline TrackElement* DataNegociate::getTrackSegment () const { return _trackSegment; }
|
||||||
inline Track* DataNegociate::getTrack () const { return _trackSegment->getTrack(); }
|
inline Track* DataNegociate::getTrack () const { return _trackSegment->getTrack(); }
|
||||||
inline TrackSegmentCost& DataNegociate::getCost () { return _cost; }
|
inline TrackSegmentCost& DataNegociate::getCost () { return _cost; }
|
||||||
inline unsigned int DataNegociate::getGCellOrder () const { return _gcellOrder; }
|
|
||||||
inline unsigned int DataNegociate::getState () const { return _state; }
|
inline unsigned int DataNegociate::getState () const { return _state; }
|
||||||
inline unsigned int DataNegociate::getStateCount () const { return _stateCount; }
|
inline unsigned int DataNegociate::getStateCount () const { return _stateCount; }
|
||||||
//inline unsigned int DataNegociate::getZ () const { return _z; }
|
//inline unsigned int DataNegociate::getZ () const { return _z; }
|
||||||
inline unsigned int DataNegociate::getRipupCount () const { return _cost.getRipupCount(); }
|
inline unsigned int DataNegociate::getRipupCount () const { return _cost.getRipupCount(); }
|
||||||
inline void DataNegociate::setGCellOrder ( unsigned int order ) { _gcellOrder = order; }
|
|
||||||
inline void DataNegociate::setRing ( bool state ) { _ring = state; }
|
|
||||||
inline void DataNegociate::setLeftBorder ( bool state ) { _leftBorder=state; }
|
|
||||||
inline void DataNegociate::setRightBorder ( bool state ) { _rightBorder=state; }
|
|
||||||
inline void DataNegociate::resetBorder () { _leftBorder=_rightBorder=false; }
|
|
||||||
inline void DataNegociate::setRoutingEvent ( RoutingEvent* event ) { _routingEvent = event; }
|
inline void DataNegociate::setRoutingEvent ( RoutingEvent* event ) { _routingEvent = event; }
|
||||||
inline void DataNegociate::setRipupCount ( unsigned int count ) { _cost.setRipupCount(count); }
|
inline void DataNegociate::setRipupCount ( unsigned int count ) { _cost.setRipupCount(count); }
|
||||||
inline void DataNegociate::incRipupCount () { _cost.incRipupCount(); }
|
inline void DataNegociate::incRipupCount () { _cost.incRipupCount(); }
|
||||||
|
@ -167,6 +142,7 @@ namespace Kite {
|
||||||
inline void DataNegociate::setState ( unsigned int state, bool reset )
|
inline void DataNegociate::setState ( unsigned int state, bool reset )
|
||||||
{
|
{
|
||||||
if ( (_state != state) or reset ) {
|
if ( (_state != state) or reset ) {
|
||||||
|
//std::cerr << "Changing state to:" << state << std::endl;
|
||||||
_state = state;
|
_state = state;
|
||||||
_stateCount = 1;
|
_stateCount = 1;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -1,220 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Header : "./GCell.h" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __KITE_GCELL__
|
|
||||||
#define __KITE_GCELL__
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <set>
|
|
||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "hurricane/Collection.h"
|
|
||||||
namespace Hurricane {
|
|
||||||
class Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "katabatic/GCell.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using std::vector;
|
|
||||||
using std::string;
|
|
||||||
using Hurricane::_TName;
|
|
||||||
using Hurricane::Record;
|
|
||||||
using Hurricane::Name;
|
|
||||||
using Hurricane::DbU;
|
|
||||||
using Hurricane::Point;
|
|
||||||
using Hurricane::Box;
|
|
||||||
using Hurricane::Interval;
|
|
||||||
using Hurricane::ExtensionGo;
|
|
||||||
using Hurricane::GenericCollection;
|
|
||||||
using Hurricane::GenericLocator;
|
|
||||||
using Hurricane::GenericFilter;
|
|
||||||
using Katabatic::AutoSegment;
|
|
||||||
using Katabatic::AutoContact;
|
|
||||||
|
|
||||||
class TrackElement;
|
|
||||||
class GCellGrid;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "GCell".
|
|
||||||
|
|
||||||
|
|
||||||
class GCell {
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Sub-Class: "CompareByDensity()".
|
|
||||||
class CompareByDensity {
|
|
||||||
public:
|
|
||||||
bool operator() ( GCell* lhs, GCell* rhs );
|
|
||||||
};
|
|
||||||
// Sub-Class: "CompareByStiffness()".
|
|
||||||
class CompareByStiffness {
|
|
||||||
public:
|
|
||||||
bool operator() ( GCell* lhs, GCell* rhs );
|
|
||||||
};
|
|
||||||
friend class Compare;
|
|
||||||
|
|
||||||
public:
|
|
||||||
static bool areDensityConnex ( GCell* a, GCell* b );
|
|
||||||
static GCell* getLowestOrder ( TrackElement* );
|
|
||||||
static TrackElement* addTrackSegment ( GCell*, AutoSegment*, bool loading=false );
|
|
||||||
static GCell* create ( GCellGrid*, Katabatic::GCell* );
|
|
||||||
public:
|
|
||||||
void destroy ();
|
|
||||||
inline Katabatic::GCell* base ();
|
|
||||||
inline bool isInRoutingSet () const;
|
|
||||||
inline unsigned int getOrder () const;
|
|
||||||
inline const vector<TrackElement*>& getOwnedSegments () const;
|
|
||||||
inline void setInRoutingSet ( bool state );
|
|
||||||
inline void setRouted ( bool state );
|
|
||||||
inline TrackElement* getLeftRp ( size_t ) const;
|
|
||||||
inline TrackElement* getRightRp ( size_t ) const;
|
|
||||||
void addTrackSegment ( TrackElement* );
|
|
||||||
void removeTrackSegment ( TrackElement* );
|
|
||||||
void loadRouting ( unsigned int order );
|
|
||||||
void computeBorder ();
|
|
||||||
double getOwnedWireLength () const;
|
|
||||||
public:
|
|
||||||
inline bool isAboveDensity ( float threshold ) const;
|
|
||||||
inline bool isRouted () const;
|
|
||||||
inline unsigned int getDepth () const;
|
|
||||||
inline unsigned int getIndex () const;
|
|
||||||
inline unsigned int getColumn () const;
|
|
||||||
inline unsigned int getRow () const;
|
|
||||||
inline Box getBoundingBox () const;
|
|
||||||
inline DbU::Unit getX () const;
|
|
||||||
inline DbU::Unit getY () const;
|
|
||||||
inline DbU::Unit getXMax () const;
|
|
||||||
inline DbU::Unit getYMax () const;
|
|
||||||
inline Interval getUSide ( unsigned int, bool noShrink ) const;
|
|
||||||
inline float getDensity ( size_t depth ) const;
|
|
||||||
inline float getCDensity () const;
|
|
||||||
inline float getDensity () const;
|
|
||||||
inline float getStiffness () const;
|
|
||||||
GCell* getLeft () const;
|
|
||||||
GCell* getRight () const;
|
|
||||||
GCell* getUp () const;
|
|
||||||
GCell* getDown () const;
|
|
||||||
inline vector<AutoSegment*>* getVSegments ();
|
|
||||||
inline vector<AutoSegment*>* getHSegments ();
|
|
||||||
inline vector<AutoContact*>* getContacts ();
|
|
||||||
inline unsigned int getSegmentCount () const;
|
|
||||||
inline unsigned int getRoutedCount () const;
|
|
||||||
inline void incSegmentCount ( int count );
|
|
||||||
inline void incRoutedCount ( int count );
|
|
||||||
inline float getBlockage ( unsigned int depth ) const;
|
|
||||||
inline void addBlockage ( unsigned int depth, float );
|
|
||||||
void anticipateRouting ( unsigned int );
|
|
||||||
inline size_t checkDensity () const;
|
|
||||||
inline size_t updateDensity ();
|
|
||||||
virtual Record* _getRecord () const;
|
|
||||||
virtual string _getString () const;
|
|
||||||
virtual string _getTypeName () const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Attributes.
|
|
||||||
GCellGrid* _gcellGrid;
|
|
||||||
Katabatic::GCell* _base;
|
|
||||||
vector<TrackElement*> _segments;
|
|
||||||
unsigned int _order;
|
|
||||||
bool _isInRoutingSet;
|
|
||||||
bool _isRouted;
|
|
||||||
TrackElement* _leftSegments [2];
|
|
||||||
TrackElement* _rightSegments[2];
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Constructors & Destructors.
|
|
||||||
GCell ( GCellGrid*, Katabatic::GCell* );
|
|
||||||
virtual ~GCell ();
|
|
||||||
private:
|
|
||||||
GCell ( const GCell& );
|
|
||||||
GCell& operator= ( const GCell& );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// GCell Inline Functions.
|
|
||||||
inline Katabatic::GCell* GCell::base () { return _base; }
|
|
||||||
inline bool GCell::isInRoutingSet () const { return _isInRoutingSet; }
|
|
||||||
inline bool GCell::isRouted () const { return _isRouted; }
|
|
||||||
inline bool GCell::isAboveDensity ( float threshold ) const { return _base->isAboveDensity(threshold); }
|
|
||||||
inline unsigned int GCell::getColumn () const { return _base->getColumn(); }
|
|
||||||
inline unsigned int GCell::getRow () const { return _base->getRow(); }
|
|
||||||
inline unsigned int GCell::getDepth () const { return _base->getDepth(); }
|
|
||||||
inline unsigned int GCell::getOrder () const { return _order; }
|
|
||||||
inline const vector<TrackElement*>& GCell::getOwnedSegments () const { return _segments; }
|
|
||||||
inline TrackElement* GCell::getLeftRp ( size_t i ) const { return _leftSegments[i]; }
|
|
||||||
inline TrackElement* GCell::getRightRp ( size_t i ) const { return _rightSegments[i]; }
|
|
||||||
inline void GCell::setInRoutingSet ( bool state ) { _isInRoutingSet = state; }
|
|
||||||
inline void GCell::setRouted ( bool state ) { _isRouted = state; }
|
|
||||||
inline unsigned int GCell::getIndex () const { return _base->getIndex(); }
|
|
||||||
inline Box GCell::getBoundingBox () const { return _base->getBoundingBox(); }
|
|
||||||
inline DbU::Unit GCell::getX () const { return _base->getX(); }
|
|
||||||
inline DbU::Unit GCell::getY () const { return _base->getY(); }
|
|
||||||
inline DbU::Unit GCell::getXMax () const { return _base->getXMax(); }
|
|
||||||
inline DbU::Unit GCell::getYMax () const { return _base->getYMax(); }
|
|
||||||
inline float GCell::getDensity ( size_t depth ) const { return _base->getDensity(depth); }
|
|
||||||
inline float GCell::getCDensity () const { return _base->getCDensity(); }
|
|
||||||
inline float GCell::getDensity () const { return _base->getDensity(); }
|
|
||||||
inline float GCell::getStiffness () const { return _base->getStiffness(); }
|
|
||||||
inline vector<AutoSegment*>* GCell::getVSegments () { return _base->getVSegments(); }
|
|
||||||
inline vector<AutoSegment*>* GCell::getHSegments () { return _base->getHSegments(); }
|
|
||||||
inline vector<AutoContact*>* GCell::getContacts () { return _base->getContacts(); }
|
|
||||||
inline unsigned int GCell::getSegmentCount () const { return _base->getSegmentCount(); }
|
|
||||||
inline unsigned int GCell::getRoutedCount () const { return _base->getRoutedCount(); }
|
|
||||||
inline void GCell::incSegmentCount ( int count ) { _base->incSegmentCount(count); }
|
|
||||||
inline void GCell::incRoutedCount ( int count ) { _base->incRoutedCount(count); }
|
|
||||||
inline float GCell::getBlockage ( unsigned int depth ) const { return _base->getBlockage(depth); }
|
|
||||||
inline void GCell::addBlockage ( unsigned int depth, float length ) { _base->addBlockage(depth,length); }
|
|
||||||
inline size_t GCell::checkDensity () const { return _base->checkDensity(); }
|
|
||||||
inline size_t GCell::updateDensity () { return _base->updateDensity(); }
|
|
||||||
|
|
||||||
inline Interval GCell::getUSide ( unsigned int dir, bool noShrink ) const
|
|
||||||
{ return _base->getUSide(dir).inflate((noShrink)?Katabatic::GCell::getTopRightShrink():0,0); }
|
|
||||||
|
|
||||||
inline bool operator< ( const GCell& lhs, const GCell& rhs ) { return lhs.getIndex() < rhs.getIndex(); }
|
|
||||||
inline bool operator> ( const GCell& lhs, const GCell& rhs ) { return lhs.getIndex() > rhs.getIndex(); }
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Collections.
|
|
||||||
|
|
||||||
|
|
||||||
typedef GenericCollection<GCell*> GCells;
|
|
||||||
typedef GenericLocator<GCell*> GCellLocator;
|
|
||||||
typedef GenericFilter<GCell*> GCellFilter;
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
||||||
|
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Kite::GCell);
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __KITE_GCELL__
|
|
|
@ -1,96 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Header : "./GCellGrid.h" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __KITE_GCELL_GRID__
|
|
||||||
#define __KITE_GCELL_GRID__
|
|
||||||
|
|
||||||
namespace Hurricane {
|
|
||||||
class Cell;
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "katabatic/GCellGrid.h"
|
|
||||||
#include "kite/GCell.h"
|
|
||||||
#include "kite/KiteEngine.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using Hurricane::Cell;
|
|
||||||
class KiteEngine;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "GCellGrid".
|
|
||||||
|
|
||||||
|
|
||||||
class GCellGrid : public Katabatic::Grid<GCell> {
|
|
||||||
|
|
||||||
public:
|
|
||||||
static GCellGrid* create ( KiteEngine* );
|
|
||||||
public:
|
|
||||||
inline Katabatic::GCellGrid* base ();
|
|
||||||
inline KiteEngine* getKite ();
|
|
||||||
Cell* getCell () const;
|
|
||||||
inline Interval getUSide ( unsigned int ) const;
|
|
||||||
inline bool checkEdgeSaturation ( float threshold ) const;
|
|
||||||
void updateContacts ( bool openSession=true );
|
|
||||||
void updateDensity ();
|
|
||||||
double getTotalWireLength () const;
|
|
||||||
void _check () const;
|
|
||||||
virtual Record* _getRecord () const;
|
|
||||||
virtual string _getString () const;
|
|
||||||
virtual string _getTypeName () const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
KiteEngine* _kite;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Constructors & Destructors.
|
|
||||||
GCellGrid ( KiteEngine* );
|
|
||||||
virtual ~GCellGrid ();
|
|
||||||
virtual void _postCreate ();
|
|
||||||
virtual void _preDestroy ();
|
|
||||||
private:
|
|
||||||
GCellGrid ( const GCellGrid& );
|
|
||||||
GCellGrid& operator= ( const GCellGrid& );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Inline Functions.
|
|
||||||
inline Katabatic::GCellGrid* GCellGrid::base () { return _kite->base()->getGCellGrid(); }
|
|
||||||
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
|
|
||||||
{ return const_cast<GCellGrid*>(this)->base()->checkEdgeSaturation(threshold); }
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __KITE_GCELL_GRID__
|
|
|
@ -1,158 +0,0 @@
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Header : "./GCellRoutingSet.h" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __KITE_GCELL_ROUTING_SET__
|
|
||||||
#define __KITE_GCELL_ROUTING_SET__
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
using std::vector;
|
|
||||||
class TrackElement;
|
|
||||||
class GCell;
|
|
||||||
class GCellGrid;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "Statistics".
|
|
||||||
|
|
||||||
|
|
||||||
class Statistics {
|
|
||||||
public:
|
|
||||||
inline Statistics ();
|
|
||||||
inline size_t getGCellsCount () const;
|
|
||||||
inline size_t getSegmentsCount () const;
|
|
||||||
inline size_t getEventsCount () const;
|
|
||||||
inline void setGCellsCount ( size_t );
|
|
||||||
inline void setSegmentsCount ( size_t );
|
|
||||||
inline void setEventsCount ( size_t );
|
|
||||||
inline void incGCellCount ( size_t );
|
|
||||||
inline void incSegmentsCount ( size_t );
|
|
||||||
inline void incEventsCount ( size_t );
|
|
||||||
inline Statistics& operator+= ( const Statistics& );
|
|
||||||
private:
|
|
||||||
size_t _gcellsCount;
|
|
||||||
size_t _segmentsCount;
|
|
||||||
size_t _eventsCount;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "GCellRoutingSet".
|
|
||||||
|
|
||||||
|
|
||||||
class GCellRoutingSet {
|
|
||||||
|
|
||||||
public:
|
|
||||||
static GCellRoutingSet* create ( GCell*, float densityExpandRatio );
|
|
||||||
virtual void destroy ();
|
|
||||||
inline unsigned int getOrder () const;
|
|
||||||
inline const vector<GCell*>& getGCells () const;
|
|
||||||
vector<TrackElement*>& getOwnedSegments ( vector<TrackElement*>& ) const;
|
|
||||||
unsigned int& loadRouting ( unsigned int& order );
|
|
||||||
void loadBorder ( GCellGrid* );
|
|
||||||
void freeBorder ();
|
|
||||||
void expand ( GCellGrid* );
|
|
||||||
void setRouted ( bool );
|
|
||||||
inline Statistics& getStatistics ();
|
|
||||||
virtual Record* _getRecord () const;
|
|
||||||
virtual string _getString () const;
|
|
||||||
virtual string _getTypeName () const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
class BorderSegment {
|
|
||||||
public:
|
|
||||||
inline BorderSegment ( TrackElement*, unsigned int );
|
|
||||||
public:
|
|
||||||
TrackElement* _segment;
|
|
||||||
unsigned int _order;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
|
||||||
// Attributes.
|
|
||||||
unsigned int _order;
|
|
||||||
float _minDensity;
|
|
||||||
float* _minDensities;
|
|
||||||
vector<GCell*> _gcells;
|
|
||||||
vector<BorderSegment> _borderSegments;
|
|
||||||
Statistics _statistics;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Constructors & Destructors.
|
|
||||||
GCellRoutingSet ( GCell*, float expandRatio, float minDensity );
|
|
||||||
virtual ~GCellRoutingSet ();
|
|
||||||
virtual void _postCreate ();
|
|
||||||
virtual void _preDestroy ();
|
|
||||||
private:
|
|
||||||
GCellRoutingSet ( const GCellRoutingSet& );
|
|
||||||
GCellRoutingSet& operator= ( const GCellRoutingSet& );
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Inline Functions.
|
|
||||||
inline unsigned int GCellRoutingSet::getOrder () const { return _order; }
|
|
||||||
inline const vector<GCell*>& GCellRoutingSet::getGCells () const { return _gcells; }
|
|
||||||
inline Statistics& GCellRoutingSet::getStatistics () { return _statistics; }
|
|
||||||
|
|
||||||
inline GCellRoutingSet::BorderSegment::BorderSegment ( TrackElement* segment, unsigned int order )
|
|
||||||
: _segment(segment)
|
|
||||||
, _order (order)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
inline Statistics::Statistics ()
|
|
||||||
: _gcellsCount (0)
|
|
||||||
, _segmentsCount (0)
|
|
||||||
, _eventsCount (0)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
inline size_t Statistics::getGCellsCount () const { return _gcellsCount; }
|
|
||||||
inline size_t Statistics::getSegmentsCount () const { return _segmentsCount; }
|
|
||||||
inline size_t Statistics::getEventsCount () const { return _eventsCount; }
|
|
||||||
inline void Statistics::setGCellsCount ( size_t count ) { _gcellsCount = count; }
|
|
||||||
inline void Statistics::setSegmentsCount ( size_t count ) { _segmentsCount = count; }
|
|
||||||
inline void Statistics::setEventsCount ( size_t count ) { _eventsCount = count; }
|
|
||||||
inline void Statistics::incGCellCount ( size_t count ) { _gcellsCount += count; }
|
|
||||||
inline void Statistics::incSegmentsCount ( size_t count ) { _segmentsCount += count; }
|
|
||||||
inline void Statistics::incEventsCount ( size_t count ) { _eventsCount += count; }
|
|
||||||
|
|
||||||
inline Statistics& Statistics::operator+= ( const Statistics& other )
|
|
||||||
{
|
|
||||||
_gcellsCount += other._gcellsCount;
|
|
||||||
_segmentsCount += other._segmentsCount;
|
|
||||||
_eventsCount += other._eventsCount;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
||||||
|
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Kite::GCellRoutingSet);
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __KITE_GCELL_ROUTING_SET__
|
|
|
@ -56,7 +56,6 @@ namespace Kite {
|
||||||
using CRL::RoutingGauge;
|
using CRL::RoutingGauge;
|
||||||
using Katabatic::KatabaticEngine;
|
using Katabatic::KatabaticEngine;
|
||||||
|
|
||||||
class GCellGrid;
|
|
||||||
class Track;
|
class Track;
|
||||||
class RoutingPlane;
|
class RoutingPlane;
|
||||||
class NegociateWindow;
|
class NegociateWindow;
|
||||||
|
@ -93,7 +92,6 @@ namespace Kite {
|
||||||
inline float getExpandStep () const;
|
inline float getExpandStep () const;
|
||||||
inline float getEdgeCapacityPercent () const;
|
inline float getEdgeCapacityPercent () const;
|
||||||
inline DbU::Unit getGlobalMinBreak ( unsigned int depth ) const;
|
inline DbU::Unit getGlobalMinBreak ( unsigned int depth ) const;
|
||||||
inline GCellGrid* getGCellGrid () const;
|
|
||||||
virtual const Name& getName () const;
|
virtual const Name& getName () const;
|
||||||
inline Configuration::PostEventCb_t&
|
inline Configuration::PostEventCb_t&
|
||||||
getPostEventCb ();
|
getPostEventCb ();
|
||||||
|
@ -149,7 +147,6 @@ namespace Kite {
|
||||||
Net* _blockageNet;
|
Net* _blockageNet;
|
||||||
Configuration* _configuration;
|
Configuration* _configuration;
|
||||||
vector<RoutingPlane*> _routingPlanes;
|
vector<RoutingPlane*> _routingPlanes;
|
||||||
GCellGrid* _kiteGrid;
|
|
||||||
NegociateWindow* _negociateWindow;
|
NegociateWindow* _negociateWindow;
|
||||||
TrackElementLut _trackSegmentLut;
|
TrackElementLut _trackSegmentLut;
|
||||||
double _minimumWL;
|
double _minimumWL;
|
||||||
|
@ -179,7 +176,6 @@ namespace Kite {
|
||||||
inline float KiteEngine::getEdgeCapacityPercent () const { return _configuration->getEdgeCapacityPercent(); }
|
inline float KiteEngine::getEdgeCapacityPercent () const { return _configuration->getEdgeCapacityPercent(); }
|
||||||
inline DbU::Unit KiteEngine::getGlobalMinBreak ( unsigned int depth ) const { return _configuration->getGlobalMinBreak(depth); }
|
inline DbU::Unit KiteEngine::getGlobalMinBreak ( unsigned int depth ) const { return _configuration->getGlobalMinBreak(depth); }
|
||||||
inline unsigned int KiteEngine::getRipupLimit ( unsigned int type ) const { return _configuration->getRipupLimit(type); }
|
inline unsigned int KiteEngine::getRipupLimit ( unsigned int type ) const { return _configuration->getRipupLimit(type); }
|
||||||
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::setEventLimit ( unsigned long limit ) { _configuration->setEventsLimit(limit); }
|
||||||
|
|
|
@ -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
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -26,6 +26,7 @@
|
||||||
#ifndef __KITE_NEGOCIATE_WINDOW__
|
#ifndef __KITE_NEGOCIATE_WINDOW__
|
||||||
#define __KITE_NEGOCIATE_WINDOW__
|
#define __KITE_NEGOCIATE_WINDOW__
|
||||||
|
|
||||||
|
#include <set>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -40,18 +41,60 @@ namespace Hurricane {
|
||||||
|
|
||||||
namespace Kite {
|
namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
using std::vector;
|
|
||||||
using std::queue;
|
|
||||||
using Hurricane::Cell;
|
|
||||||
using Katabatic::GridBox;
|
|
||||||
|
|
||||||
class GCell;
|
|
||||||
class GCellRoutingSet;
|
|
||||||
class TrackElement;
|
class TrackElement;
|
||||||
class KiteEngine;
|
class KiteEngine;
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Statistics".
|
||||||
|
|
||||||
|
|
||||||
|
class Statistics {
|
||||||
|
public:
|
||||||
|
inline Statistics ();
|
||||||
|
inline size_t getGCellsCount () const;
|
||||||
|
inline size_t getSegmentsCount () const;
|
||||||
|
inline size_t getEventsCount () const;
|
||||||
|
inline void setGCellsCount ( size_t );
|
||||||
|
inline void setSegmentsCount ( size_t );
|
||||||
|
inline void setEventsCount ( size_t );
|
||||||
|
inline void incGCellCount ( size_t );
|
||||||
|
inline void incSegmentsCount ( size_t );
|
||||||
|
inline void incEventsCount ( size_t );
|
||||||
|
inline Statistics& operator+= ( const Statistics& );
|
||||||
|
private:
|
||||||
|
size_t _gcellsCount;
|
||||||
|
size_t _segmentsCount;
|
||||||
|
size_t _eventsCount;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline Statistics::Statistics ()
|
||||||
|
: _gcellsCount (0)
|
||||||
|
, _segmentsCount (0)
|
||||||
|
, _eventsCount (0)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
inline size_t Statistics::getGCellsCount () const { return _gcellsCount; }
|
||||||
|
inline size_t Statistics::getSegmentsCount () const { return _segmentsCount; }
|
||||||
|
inline size_t Statistics::getEventsCount () const { return _eventsCount; }
|
||||||
|
inline void Statistics::setGCellsCount ( size_t count ) { _gcellsCount = count; }
|
||||||
|
inline void Statistics::setSegmentsCount ( size_t count ) { _segmentsCount = count; }
|
||||||
|
inline void Statistics::setEventsCount ( size_t count ) { _eventsCount = count; }
|
||||||
|
inline void Statistics::incGCellCount ( size_t count ) { _gcellsCount += count; }
|
||||||
|
inline void Statistics::incSegmentsCount ( size_t count ) { _segmentsCount += count; }
|
||||||
|
inline void Statistics::incEventsCount ( size_t count ) { _eventsCount += count; }
|
||||||
|
|
||||||
|
inline Statistics& Statistics::operator+= ( const Statistics& other )
|
||||||
|
{
|
||||||
|
_gcellsCount += other._gcellsCount;
|
||||||
|
_segmentsCount += other._segmentsCount;
|
||||||
|
_eventsCount += other._eventsCount;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "Kite::NegociateWindow".
|
// Class : "Kite::NegociateWindow".
|
||||||
|
|
||||||
|
@ -63,72 +106,44 @@ namespace Kite {
|
||||||
, Packing
|
, Packing
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
static NegociateWindow* create ( KiteEngine* kite
|
static NegociateWindow* create ( KiteEngine* );
|
||||||
, unsigned int columnMin
|
|
||||||
, unsigned int rowMin
|
|
||||||
, unsigned int columnMax
|
|
||||||
, unsigned int rowMax
|
|
||||||
);
|
|
||||||
void destroy ();
|
void destroy ();
|
||||||
inline bool isInterrupted () const;
|
inline bool isInterrupted () const;
|
||||||
Cell* getCell () const;
|
|
||||||
inline GridBox<GCell>* getGridBox () const;
|
|
||||||
inline KiteEngine* getKiteEngine () const;
|
inline KiteEngine* getKiteEngine () const;
|
||||||
|
Hurricane::Cell* getCell () const;
|
||||||
|
inline const Katabatic::GCellVector& getGCells () const;
|
||||||
inline RoutingEventQueue& getEventQueue ();
|
inline RoutingEventQueue& getEventQueue ();
|
||||||
inline RoutingEventHistory& getEventHistory ();
|
inline RoutingEventHistory& getEventHistory ();
|
||||||
inline const vector<GCellRoutingSet*>&
|
|
||||||
getGCellRoutingSets () const;
|
|
||||||
inline Stage getStage () const;
|
inline Stage getStage () const;
|
||||||
|
void setGCells ( const Katabatic::GCellVector& );
|
||||||
inline void setInterrupt ( bool );
|
inline void setInterrupt ( bool );
|
||||||
inline void setStage ( Stage );
|
inline void setStage ( Stage );
|
||||||
void loadRouting ();
|
double computeWirelength ();
|
||||||
|
TrackElement* addTrackSegment ( AutoSegment*, bool loading );
|
||||||
void addInsertEvent ( TrackElement*, unsigned int level );
|
void addInsertEvent ( TrackElement*, unsigned int level );
|
||||||
inline void rescheduleEvent ( RoutingEvent*, unsigned int level );
|
inline void rescheduleEvent ( RoutingEvent*, unsigned int level );
|
||||||
void run ( int slowMotion=0 );
|
void run ( int slowMotion=0 );
|
||||||
void addToRing ( TrackElement* );
|
|
||||||
void printStatistics () const;
|
void printStatistics () const;
|
||||||
size_t _negociate ( const vector<TrackElement*>& );
|
void _createRouting ( Katabatic::GCell* );
|
||||||
void _runOnGCellRoutingSet ( GCellRoutingSet* );
|
size_t _negociate ();
|
||||||
void _loadRing ();
|
Hurricane::Record* _getRecord () const;
|
||||||
void _unloadRing ();
|
std::string _getString () const;
|
||||||
Record* _getRecord () const;
|
inline std::string _getTypeName () const;
|
||||||
string _getString () const;
|
|
||||||
inline string _getTypeName () const;
|
|
||||||
|
|
||||||
private:
|
|
||||||
class RingSegment {
|
|
||||||
public:
|
|
||||||
static bool orderReached ( const RingSegment& );
|
|
||||||
public:
|
|
||||||
RingSegment ( TrackElement* segment=NULL );
|
|
||||||
inline TrackElement* getSegment () const;
|
|
||||||
inline unsigned int getOrder () const;
|
|
||||||
private:
|
|
||||||
TrackElement* _segment;
|
|
||||||
unsigned int _order;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Attributes.
|
// Attributes.
|
||||||
unsigned int _slowMotion;
|
unsigned int _slowMotion;
|
||||||
bool _interrupt;
|
bool _interrupt;
|
||||||
KiteEngine* _kite;
|
KiteEngine* _kite;
|
||||||
GridBox<GCell>* _gridBox;
|
Katabatic::GCellVector _gcells;
|
||||||
vector<GCell*> _criticalGCells;
|
std::vector<TrackElement*> _segments;
|
||||||
unsigned int _gcellOrder;
|
|
||||||
vector<GCellRoutingSet*> _gcellRoutingSets;
|
|
||||||
RoutingEventQueue _eventQueue;
|
RoutingEventQueue _eventQueue;
|
||||||
RoutingEventHistory _eventHistory;
|
RoutingEventHistory _eventHistory;
|
||||||
vector<RingSegment> _ring;
|
Statistics _statistics;
|
||||||
|
|
||||||
// Constructors.
|
// Constructors.
|
||||||
protected:
|
protected:
|
||||||
NegociateWindow ( KiteEngine* kite
|
NegociateWindow ( KiteEngine* );
|
||||||
, unsigned int columnMin
|
|
||||||
, unsigned int rowMin
|
|
||||||
, unsigned int columnMax
|
|
||||||
, unsigned int rowMax
|
|
||||||
);
|
|
||||||
~NegociateWindow ();
|
~NegociateWindow ();
|
||||||
private:
|
private:
|
||||||
NegociateWindow ( const NegociateWindow& );
|
NegociateWindow ( const NegociateWindow& );
|
||||||
|
@ -138,18 +153,13 @@ namespace Kite {
|
||||||
|
|
||||||
// Inline Functions.
|
// Inline Functions.
|
||||||
inline bool NegociateWindow::isInterrupted () const { return _interrupt; }
|
inline bool NegociateWindow::isInterrupted () const { return _interrupt; }
|
||||||
inline string NegociateWindow::_getTypeName () const { return "NegociateWindow"; }
|
|
||||||
inline GridBox<GCell>* NegociateWindow::getGridBox () const { return _gridBox; }
|
|
||||||
inline KiteEngine* NegociateWindow::getKiteEngine () const { return _kite; }
|
inline KiteEngine* NegociateWindow::getKiteEngine () const { return _kite; }
|
||||||
|
inline const Katabatic::GCellVector& NegociateWindow::getGCells () const { return _gcells; }
|
||||||
inline RoutingEventQueue& NegociateWindow::getEventQueue () { return _eventQueue; }
|
inline RoutingEventQueue& NegociateWindow::getEventQueue () { return _eventQueue; }
|
||||||
inline RoutingEventHistory& NegociateWindow::getEventHistory () { return _eventHistory; }
|
inline RoutingEventHistory& NegociateWindow::getEventHistory () { return _eventHistory; }
|
||||||
inline void NegociateWindow::setInterrupt ( bool state ) { _interrupt = state; }
|
inline void NegociateWindow::setInterrupt ( bool state ) { _interrupt = state; }
|
||||||
inline void NegociateWindow::rescheduleEvent ( RoutingEvent* event, unsigned int level ) { event->reschedule(_eventQueue,level); }
|
inline void NegociateWindow::rescheduleEvent ( RoutingEvent* event, unsigned int level ) { event->reschedule(_eventQueue,level); }
|
||||||
inline const vector<GCellRoutingSet*>&
|
inline std::string NegociateWindow::_getTypeName () const { return "NegociateWindow"; }
|
||||||
NegociateWindow::getGCellRoutingSets () const { return _gcellRoutingSets; }
|
|
||||||
|
|
||||||
inline TrackElement* NegociateWindow::RingSegment::getSegment () const { return _segment; }
|
|
||||||
inline unsigned int NegociateWindow::RingSegment::getOrder () const { return _order; }
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
} // End of Kite namespace.
|
||||||
|
|
|
@ -40,13 +40,10 @@ namespace Hurricane {
|
||||||
|
|
||||||
namespace Kite {
|
namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
using Hurricane::DbU;
|
using Hurricane::DbU;
|
||||||
using Hurricane::Interval;
|
using Hurricane::Interval;
|
||||||
using Hurricane::Net;
|
using Hurricane::Net;
|
||||||
|
|
||||||
class TrackElement;
|
class TrackElement;
|
||||||
class Track;
|
class Track;
|
||||||
class RoutingEventHistory;
|
class RoutingEventHistory;
|
||||||
|
@ -122,7 +119,7 @@ namespace Kite {
|
||||||
inline const Interval& getConstraints () const;
|
inline const Interval& getConstraints () const;
|
||||||
inline const Interval& getOptimal () const;
|
inline const Interval& getOptimal () const;
|
||||||
inline const Interval& getPerpandicular () const;
|
inline const Interval& getPerpandicular () const;
|
||||||
inline GCell* getShearGCell () const;
|
inline Katabatic::GCell* getShearGCell () const;
|
||||||
inline float getPriority () const;
|
inline float getPriority () const;
|
||||||
inline unsigned int getTracksNb () const;
|
inline unsigned int getTracksNb () const;
|
||||||
inline unsigned int getTracksFree () const;
|
inline unsigned int getTracksFree () const;
|
||||||
|
@ -176,7 +173,7 @@ namespace Kite {
|
||||||
Interval _constraints;
|
Interval _constraints;
|
||||||
Interval _optimal;
|
Interval _optimal;
|
||||||
Interval _perpandicular;
|
Interval _perpandicular;
|
||||||
GCell* _shearGCell;
|
Katabatic::GCell* _shearGCell;
|
||||||
unsigned int _tracksNb : 6;
|
unsigned int _tracksNb : 6;
|
||||||
unsigned int _tracksFree : 4;
|
unsigned int _tracksFree : 4;
|
||||||
unsigned int _insertState : 6;
|
unsigned int _insertState : 6;
|
||||||
|
@ -212,7 +209,7 @@ namespace Kite {
|
||||||
inline unsigned int RoutingEvent::getTracksNb () const { return _tracksNb; }
|
inline unsigned int RoutingEvent::getTracksNb () const { return _tracksNb; }
|
||||||
inline unsigned int RoutingEvent::getTracksFree () const { return _tracksFree; }
|
inline unsigned int RoutingEvent::getTracksFree () const { return _tracksFree; }
|
||||||
inline unsigned int RoutingEvent::getInsertState () const { return _insertState; }
|
inline unsigned int RoutingEvent::getInsertState () const { return _insertState; }
|
||||||
inline GCell* RoutingEvent::getShearGCell () const { return _shearGCell; }
|
inline Katabatic::GCell* RoutingEvent::getShearGCell () const { return _shearGCell; }
|
||||||
inline void RoutingEvent::setMode ( unsigned int mode ) { _mode = mode; }
|
inline void RoutingEvent::setMode ( unsigned int mode ) { _mode = mode; }
|
||||||
inline void RoutingEvent::setProcessed ( bool state ) { _processed = state; }
|
inline void RoutingEvent::setProcessed ( bool state ) { _processed = state; }
|
||||||
inline void RoutingEvent::setDisabled ( bool state ) { _disabled = state; }
|
inline void RoutingEvent::setDisabled ( bool state ) { _disabled = state; }
|
||||||
|
|
|
@ -45,7 +45,6 @@ namespace Katabatic {
|
||||||
|
|
||||||
namespace Kite {
|
namespace Kite {
|
||||||
|
|
||||||
|
|
||||||
using std::set;
|
using std::set;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::string;
|
using std::string;
|
||||||
|
@ -58,7 +57,6 @@ namespace Kite {
|
||||||
class Track;
|
class Track;
|
||||||
class TrackElement;
|
class TrackElement;
|
||||||
class TrackMarker;
|
class TrackMarker;
|
||||||
class GCell;
|
|
||||||
class NegociateWindow;
|
class NegociateWindow;
|
||||||
class Configuration;
|
class Configuration;
|
||||||
class KiteEngine;
|
class KiteEngine;
|
||||||
|
@ -79,9 +77,7 @@ namespace Kite {
|
||||||
inline static Net* getBlockageNet ();
|
inline static Net* getBlockageNet ();
|
||||||
inline static NegociateWindow* getNegociateWindow ();
|
inline static NegociateWindow* getNegociateWindow ();
|
||||||
inline static unsigned int getRipupCost ();
|
inline static unsigned int getRipupCost ();
|
||||||
inline static GCell* getGCellUnder ( DbU::Unit, DbU::Unit );
|
inline static Katabatic::GCell* getGCellUnder ( DbU::Unit, DbU::Unit );
|
||||||
inline static unsigned int getOrder ();
|
|
||||||
inline static void setOrder ( unsigned int );
|
|
||||||
inline static void addInsertEvent ( TrackMarker* , Track* );
|
inline static void addInsertEvent ( TrackMarker* , Track* );
|
||||||
inline static void addInsertEvent ( TrackElement* , Track* );
|
inline static void addInsertEvent ( TrackElement* , Track* );
|
||||||
inline static void addRemoveEvent ( TrackElement* );
|
inline static void addRemoveEvent ( TrackElement* );
|
||||||
|
@ -94,16 +90,14 @@ namespace Kite {
|
||||||
static void unlink ( TrackElement* );
|
static void unlink ( TrackElement* );
|
||||||
static TrackElement* lookup ( Segment* );
|
static TrackElement* lookup ( Segment* );
|
||||||
static TrackElement* lookup ( AutoSegment* );
|
static TrackElement* lookup ( AutoSegment* );
|
||||||
static GCell* lookup ( Katabatic::GCell* );
|
static Katabatic::GCell* lookup ( Katabatic::GCell* );
|
||||||
private:
|
private:
|
||||||
KiteEngine* _getKiteEngine ();
|
KiteEngine* _getKiteEngine ();
|
||||||
Net* _getBlockageNet ();
|
Net* _getBlockageNet ();
|
||||||
NegociateWindow* _getNegociateWindow ();
|
NegociateWindow* _getNegociateWindow ();
|
||||||
unsigned int _getRipupCost ();
|
unsigned int _getRipupCost ();
|
||||||
GCell* _getGCellUnder ( DbU::Unit, DbU::Unit );
|
Katabatic::GCell* _getGCellUnder ( DbU::Unit, DbU::Unit );
|
||||||
unsigned int _getOrder () const;
|
Katabatic::GCell* _lookup ( Katabatic::GCell* );
|
||||||
void _setOrder ( unsigned int );
|
|
||||||
GCell* _lookup ( Katabatic::GCell* );
|
|
||||||
void _addInsertEvent ( TrackMarker* , Track* );
|
void _addInsertEvent ( TrackMarker* , Track* );
|
||||||
void _addInsertEvent ( TrackElement* , Track* );
|
void _addInsertEvent ( TrackElement* , Track* );
|
||||||
void _addRemoveEvent ( TrackElement* );
|
void _addRemoveEvent ( TrackElement* );
|
||||||
|
@ -128,7 +122,6 @@ namespace Kite {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Attributes.
|
// Attributes.
|
||||||
unsigned int _order;
|
|
||||||
vector<Event> _insertEvents;
|
vector<Event> _insertEvents;
|
||||||
vector<Event> _removeEvents;
|
vector<Event> _removeEvents;
|
||||||
set<Track*> _sortEvents;
|
set<Track*> _sortEvents;
|
||||||
|
@ -175,15 +168,9 @@ namespace Kite {
|
||||||
inline unsigned int Session::getRipupCost ()
|
inline unsigned int Session::getRipupCost ()
|
||||||
{ return get("getRipupCost()")->_getRipupCost(); }
|
{ return get("getRipupCost()")->_getRipupCost(); }
|
||||||
|
|
||||||
inline GCell* Session::getGCellUnder ( DbU::Unit x, DbU::Unit y )
|
inline Katabatic::GCell* Session::getGCellUnder ( DbU::Unit x, DbU::Unit y )
|
||||||
{ return get("getGCellUnder()")->_getGCellUnder(x,y); }
|
{ return get("getGCellUnder()")->_getGCellUnder(x,y); }
|
||||||
|
|
||||||
inline unsigned int Session::getOrder ()
|
|
||||||
{ return get("getOrder()")->_getOrder(); }
|
|
||||||
|
|
||||||
inline void Session::setOrder ( unsigned int order )
|
|
||||||
{ get("setOrder()")->_setOrder(order); }
|
|
||||||
|
|
||||||
inline void Session::addInsertEvent ( TrackMarker* marker, Track* track )
|
inline void Session::addInsertEvent ( TrackMarker* marker, Track* track )
|
||||||
{ get("addInsertEvent(TrackMarker*)")->_addInsertEvent(marker,track); }
|
{ get("addInsertEvent(TrackMarker*)")->_addInsertEvent(marker,track); }
|
||||||
|
|
||||||
|
|
|
@ -97,8 +97,8 @@ namespace Kite {
|
||||||
Track* getNext () const;
|
Track* getNext () const;
|
||||||
Track* getPrevious () const;
|
Track* getPrevious () const;
|
||||||
inline size_t getSize () const;
|
inline size_t getSize () const;
|
||||||
TrackElement* getNext ( size_t& index, Net*, bool useOrder=false ) const;
|
TrackElement* getNext ( size_t& index, Net* ) const;
|
||||||
TrackElement* getPrevious ( size_t& index, Net*, bool useOrder=false ) const;
|
TrackElement* getPrevious ( size_t& index, Net* ) const;
|
||||||
TrackElement* getNextFixed ( size_t& index ) const;
|
TrackElement* getNextFixed ( size_t& index ) const;
|
||||||
TrackElement* getSegment ( size_t index ) const;
|
TrackElement* getSegment ( size_t index ) const;
|
||||||
TrackElement* getSegment ( DbU::Unit position ) const;
|
TrackElement* getSegment ( DbU::Unit position ) const;
|
||||||
|
@ -115,8 +115,8 @@ namespace Kite {
|
||||||
virtual Point getPosition ( DbU::Unit coordinate ) const = 0;
|
virtual Point getPosition ( DbU::Unit coordinate ) const = 0;
|
||||||
size_t find ( const TrackElement* ) const;
|
size_t find ( const TrackElement* ) const;
|
||||||
Interval getFreeInterval ( DbU::Unit position, Net* net=NULL ) const;
|
Interval getFreeInterval ( DbU::Unit position, Net* net=NULL ) const;
|
||||||
Interval expandUsedInterval ( size_t& begin, size_t& end, bool useOrder=false ) const;
|
Interval expandUsedInterval ( size_t& begin, size_t& end ) const;
|
||||||
Interval expandFreeInterval ( size_t& begin, size_t& end, unsigned int state, Net*, bool useOrder=false ) const;
|
Interval expandFreeInterval ( size_t& begin, size_t& end, unsigned int state, Net* ) const;
|
||||||
unsigned int checkOverlap ( unsigned int& overlaps ) const;
|
unsigned int checkOverlap ( unsigned int& overlaps ) const;
|
||||||
void forceSort ();
|
void forceSort ();
|
||||||
void insert ( TrackElement* );
|
void insert ( TrackElement* );
|
||||||
|
|
|
@ -1,98 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
// -*- C++ -*-
|
|
||||||
//
|
|
||||||
// This file is part of the Coriolis Software.
|
|
||||||
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
|
|
||||||
//
|
|
||||||
// ===================================================================
|
|
||||||
//
|
|
||||||
// $Id$
|
|
||||||
//
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
// | |
|
|
||||||
// | C O R I O L I S |
|
|
||||||
// | K i t e - D e t a i l e d R o u t e r |
|
|
||||||
// | |
|
|
||||||
// | Author : Jean-Paul CHAPUT |
|
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
||||||
// | =============================================================== |
|
|
||||||
// | C++ Header : "./TrackBlockage.h" |
|
|
||||||
// | *************************************************************** |
|
|
||||||
// | U p d a t e s |
|
|
||||||
// | |
|
|
||||||
// x-----------------------------------------------------------------x
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __KITE_TRACK_OBSTACLE__
|
|
||||||
#define __KITE_TRACK_OBSTACLE__
|
|
||||||
|
|
||||||
|
|
||||||
#include "kite/TrackElement.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Kite {
|
|
||||||
|
|
||||||
|
|
||||||
using std::string;
|
|
||||||
using std::map;
|
|
||||||
using Hurricane::Record;
|
|
||||||
using Hurricane::Interval;
|
|
||||||
using Hurricane::DbU;
|
|
||||||
using Hurricane::Net;
|
|
||||||
using Hurricane::Layer;
|
|
||||||
|
|
||||||
class Track;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Class : "TrackBlockage".
|
|
||||||
|
|
||||||
|
|
||||||
class TrackBlockage : public TrackElement {
|
|
||||||
public:
|
|
||||||
static TrackElement* create ( Track*, Box& );
|
|
||||||
public:
|
|
||||||
virtual AutoSegment* base () const;
|
|
||||||
virtual bool isFixed () const;
|
|
||||||
virtual bool isBlockage () const;
|
|
||||||
virtual bool isHorizontal () const;
|
|
||||||
virtual bool isVertical () const;
|
|
||||||
virtual unsigned long getId () const;
|
|
||||||
virtual unsigned int 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 ( bool useOrder=false ) const;
|
|
||||||
virtual Record* _getRecord () const;
|
|
||||||
virtual string _getString () const;
|
|
||||||
virtual string _getTypeName () const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Attributes.
|
|
||||||
Segment* _segment;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Constructors & Destructors.
|
|
||||||
TrackBlockage ( Track*, Box& ) ;
|
|
||||||
virtual ~TrackBlockage ();
|
|
||||||
virtual void _postCreate ();
|
|
||||||
virtual void _preDestroy ();
|
|
||||||
private:
|
|
||||||
TrackBlockage ( const TrackBlockage& );
|
|
||||||
TrackBlockage& operator= ( const TrackBlockage& );
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Kite namespace.
|
|
||||||
|
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Kite::TrackBlockage);
|
|
||||||
|
|
||||||
|
|
||||||
# endif
|
|
|
@ -61,7 +61,6 @@ namespace Kite {
|
||||||
class DataNegociate;
|
class DataNegociate;
|
||||||
class Track;
|
class Track;
|
||||||
class TrackCost;
|
class TrackCost;
|
||||||
class GCell;
|
|
||||||
|
|
||||||
|
|
||||||
typedef map<Segment*,TrackElement*> TrackElementLut;
|
typedef map<Segment*,TrackElement*> TrackElementLut;
|
||||||
|
@ -123,7 +122,7 @@ namespace Kite {
|
||||||
virtual bool hasTargetDogLeg () const;
|
virtual bool hasTargetDogLeg () const;
|
||||||
virtual bool canDogLeg ();
|
virtual bool canDogLeg ();
|
||||||
virtual bool canDogLeg ( Interval );
|
virtual bool canDogLeg ( Interval );
|
||||||
virtual bool canDogLegAt ( GCell*, bool allowReuse=false );
|
virtual bool canDogLegAt ( Katabatic::GCell*, bool allowReuse=false );
|
||||||
virtual unsigned long getId () const;
|
virtual unsigned long getId () const;
|
||||||
virtual unsigned int getDirection () const = 0;
|
virtual unsigned int getDirection () const = 0;
|
||||||
virtual Net* getNet () const = 0;
|
virtual Net* getNet () const = 0;
|
||||||
|
@ -140,14 +139,13 @@ namespace Kite {
|
||||||
inline DbU::Unit getSourceU () const;
|
inline DbU::Unit getSourceU () const;
|
||||||
inline DbU::Unit getTargetU () const;
|
inline DbU::Unit getTargetU () const;
|
||||||
inline DbU::Unit getLength () const;
|
inline DbU::Unit getLength () const;
|
||||||
virtual Interval getFreeInterval ( bool useOrder=false ) const;
|
virtual Interval getFreeInterval () const;
|
||||||
inline Interval getCanonicalInterval () const;
|
inline Interval getCanonicalInterval () const;
|
||||||
virtual Interval getSourceConstraints () const;
|
virtual Interval getSourceConstraints () const;
|
||||||
virtual Interval getTargetConstraints () const;
|
virtual Interval getTargetConstraints () const;
|
||||||
virtual DataNegociate* getDataNegociate () const;
|
virtual DataNegociate* getDataNegociate () const;
|
||||||
virtual TrackElement* getCanonical ( Interval& );
|
virtual TrackElement* getCanonical ( Interval& );
|
||||||
virtual GCell* getGCell () const;
|
virtual size_t getGCells ( Katabatic::GCellVector& ) const;
|
||||||
virtual size_t getGCells ( vector<GCell*>& ) const;
|
|
||||||
virtual TrackElement* getSourceDogLeg ();
|
virtual TrackElement* getSourceDogLeg ();
|
||||||
virtual TrackElement* getTargetDogLeg ();
|
virtual TrackElement* getTargetDogLeg ();
|
||||||
virtual TrackElements getCollapsedPerpandiculars ();
|
virtual TrackElements getCollapsedPerpandiculars ();
|
||||||
|
@ -166,11 +164,9 @@ namespace Kite {
|
||||||
virtual void setRouted ( bool );
|
virtual void setRouted ( bool );
|
||||||
virtual void setTrack ( Track* );
|
virtual void setTrack ( Track* );
|
||||||
inline void setIndex ( size_t );
|
inline void setIndex ( size_t );
|
||||||
virtual void setGCell ( GCell* );
|
|
||||||
virtual void setArea ();
|
virtual void setArea ();
|
||||||
virtual void setDogLegLevel ( unsigned int );
|
virtual void setDogLegLevel ( unsigned int );
|
||||||
virtual void setDogLegOrder ( unsigned int );
|
virtual void setDogLegOrder ( unsigned int );
|
||||||
virtual void updateGCellsStiffness ( unsigned int );
|
|
||||||
virtual void swapTrack ( TrackElement* );
|
virtual void swapTrack ( TrackElement* );
|
||||||
virtual void reschedule ( unsigned int level );
|
virtual void reschedule ( unsigned int level );
|
||||||
virtual void detach ();
|
virtual void detach ();
|
||||||
|
@ -182,8 +178,8 @@ namespace Kite {
|
||||||
virtual bool moveAside ( bool onLeft );
|
virtual bool moveAside ( bool onLeft );
|
||||||
virtual TrackElement* makeDogLeg ();
|
virtual TrackElement* makeDogLeg ();
|
||||||
virtual TrackElement* makeDogLeg ( Interval, bool& leftDogleg );
|
virtual TrackElement* makeDogLeg ( Interval, bool& leftDogleg );
|
||||||
virtual TrackElement* makeDogLeg ( GCell* );
|
virtual TrackElement* makeDogLeg ( Katabatic::GCell* );
|
||||||
virtual TrackElement* _postDogLeg ( GCell* );
|
virtual TrackElement* _postDogLeg ( Katabatic::GCell* );
|
||||||
virtual void _postModify ();
|
virtual void _postModify ();
|
||||||
virtual void desalignate ();
|
virtual void desalignate ();
|
||||||
virtual bool _check () const;
|
virtual bool _check () const;
|
||||||
|
|
|
@ -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
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -48,7 +48,6 @@ namespace Kite {
|
||||||
class DataNegociate;
|
class DataNegociate;
|
||||||
class Track;
|
class Track;
|
||||||
class TrackCost;
|
class TrackCost;
|
||||||
class GCell;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
@ -85,30 +84,26 @@ namespace Kite {
|
||||||
virtual bool hasTargetDogLeg () const;
|
virtual bool hasTargetDogLeg () const;
|
||||||
virtual bool canDogLeg ();
|
virtual bool canDogLeg ();
|
||||||
virtual bool canDogLeg ( Interval );
|
virtual bool canDogLeg ( Interval );
|
||||||
virtual bool canDogLegAt ( GCell*, bool allowReuse=false );
|
virtual bool canDogLegAt ( Katabatic::GCell*, bool allowReuse=false );
|
||||||
virtual unsigned long getId () const;
|
virtual unsigned long getId () const;
|
||||||
virtual unsigned int getDirection () const;
|
virtual unsigned int getDirection () const;
|
||||||
virtual Net* getNet () const;
|
virtual Net* getNet () const;
|
||||||
virtual const Layer* getLayer () const;
|
virtual const Layer* getLayer () const;
|
||||||
virtual unsigned long getArea () const;
|
virtual unsigned long getArea () const;
|
||||||
virtual unsigned int getDogLegLevel () const;
|
virtual unsigned int getDogLegLevel () const;
|
||||||
virtual unsigned int getDogLegOrder () const;
|
|
||||||
virtual TrackElement* getNext () const;
|
virtual TrackElement* getNext () const;
|
||||||
virtual TrackElement* getPrevious () const;
|
virtual TrackElement* getPrevious () const;
|
||||||
virtual DbU::Unit getAxis () const;
|
virtual DbU::Unit getAxis () const;
|
||||||
virtual Interval getFreeInterval ( bool useOrder=false ) const;
|
virtual Interval getFreeInterval () const;
|
||||||
virtual Interval getSourceConstraints () const;
|
virtual Interval getSourceConstraints () const;
|
||||||
virtual Interval getTargetConstraints () const;
|
virtual Interval getTargetConstraints () const;
|
||||||
virtual DataNegociate* getDataNegociate () const;
|
virtual DataNegociate* getDataNegociate () const;
|
||||||
virtual TrackElement* getCanonical ( Interval& );
|
virtual TrackElement* getCanonical ( Interval& );
|
||||||
virtual GCell* getGCell () const;
|
virtual size_t getGCells ( vector<Katabatic::GCell*>& ) const;
|
||||||
virtual size_t getGCells ( vector<GCell*>& ) const;
|
|
||||||
virtual TrackElement* getSourceDogLeg ();
|
virtual TrackElement* getSourceDogLeg ();
|
||||||
virtual TrackElement* getTargetDogLeg ();
|
virtual TrackElement* getTargetDogLeg ();
|
||||||
virtual TrackElements getCollapsedPerpandiculars ();
|
virtual TrackElements getCollapsedPerpandiculars ();
|
||||||
virtual size_t getPerpandicularsBound ( set<TrackElement*>& );
|
virtual size_t getPerpandicularsBound ( set<TrackElement*>& );
|
||||||
virtual unsigned int getOrder () const;
|
|
||||||
virtual void updateGCellsStiffness ( unsigned int );
|
|
||||||
virtual void dataInvalidate ();
|
virtual void dataInvalidate ();
|
||||||
virtual void eventInvalidate ();
|
virtual void eventInvalidate ();
|
||||||
virtual void setAllowOutsideGCell ( bool );
|
virtual void setAllowOutsideGCell ( bool );
|
||||||
|
@ -119,10 +114,8 @@ namespace Kite {
|
||||||
virtual void setLock ( bool );
|
virtual void setLock ( bool );
|
||||||
virtual void setRouted ( bool );
|
virtual void setRouted ( bool );
|
||||||
virtual void setTrack ( Track* );
|
virtual void setTrack ( Track* );
|
||||||
virtual void setGCell ( GCell* );
|
|
||||||
virtual void setArea ();
|
virtual void setArea ();
|
||||||
virtual void setDogLegLevel ( unsigned int );
|
virtual void setDogLegLevel ( unsigned int );
|
||||||
virtual void setDogLegOrder ( unsigned int );
|
|
||||||
virtual void swapTrack ( TrackElement* );
|
virtual void swapTrack ( TrackElement* );
|
||||||
virtual void reschedule ( unsigned int level );
|
virtual void reschedule ( unsigned int level );
|
||||||
virtual void detach ();
|
virtual void detach ();
|
||||||
|
@ -134,8 +127,8 @@ namespace Kite {
|
||||||
virtual bool moveAside ( bool onLeft );
|
virtual bool moveAside ( bool onLeft );
|
||||||
virtual TrackElement* makeDogLeg ();
|
virtual TrackElement* makeDogLeg ();
|
||||||
virtual TrackElement* makeDogLeg ( Interval, bool& leftDogleg );
|
virtual TrackElement* makeDogLeg ( Interval, bool& leftDogleg );
|
||||||
virtual TrackElement* makeDogLeg ( GCell* );
|
virtual TrackElement* makeDogLeg ( Katabatic::GCell* );
|
||||||
virtual TrackElement* _postDogLeg ( GCell* );
|
virtual TrackElement* _postDogLeg ();
|
||||||
virtual void _postModify ();
|
virtual void _postModify ();
|
||||||
virtual void desalignate ();
|
virtual void desalignate ();
|
||||||
virtual bool _check () const;
|
virtual bool _check () const;
|
||||||
|
@ -146,7 +139,6 @@ namespace Kite {
|
||||||
protected:
|
protected:
|
||||||
// Attributes.
|
// Attributes.
|
||||||
AutoSegment* _base;
|
AutoSegment* _base;
|
||||||
GCell* _gcell;
|
|
||||||
bool _created;
|
bool _created;
|
||||||
bool _lock;
|
bool _lock;
|
||||||
bool _revalidated;
|
bool _revalidated;
|
||||||
|
@ -157,7 +149,6 @@ namespace Kite {
|
||||||
unsigned long _area;
|
unsigned long _area;
|
||||||
DataNegociate* _data;
|
DataNegociate* _data;
|
||||||
unsigned int _dogLegLevel:4;
|
unsigned int _dogLegLevel:4;
|
||||||
unsigned int _dogLegOrder:16;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Constructors & Destructors.
|
// Constructors & Destructors.
|
||||||
|
|
Loading…
Reference in New Issue