* Most of tools:

- Bug: In top CMakeLists.txt the SETUP_PROJECT_PATHS was not inserting
        X_USER_TOP *before* X_TOP, thus potentially allowing an obsolete
        system-wide configuration to shadow an up-to-date local one.

  * ./kite:
    - Change: In Configuration/KiteEngine, propagate changes in Configuration
        in Kite. Note that a *second* singleton is created at Kite level.
    - New: KiteEngine::printConfiguration() method to allow quick checks of
        the router's main parameters.
    - New: ConfigurationWidget to display/sets all the revelant Katabatic/
        Kite configuration parameters. To be used with the TabSettings from
        the ControllerWidget.
          The ConfigurationWidget is bound to the default (static) Kite
        configuration, as once it has been run you obviously cannot change the
        router's settings.
This commit is contained in:
Jean-Paul Chaput 2010-04-28 15:44:07 +00:00
parent 388b8b3ce0
commit 6a3440f4e6
12 changed files with 174 additions and 89 deletions

View File

@ -21,15 +21,6 @@ ENDIF(COMMAND CMAKE_POLICY)
# This macro has to be included in all the tools CMakeLists.txt as it's # This macro has to be included in all the tools CMakeLists.txt as it's
# the sole means of localizing other tools/projects. # the sole means of localizing other tools/projects.
MACRO(SETUP_PROJECT_PATHS project) MACRO(SETUP_PROJECT_PATHS project)
IF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
MESSAGE("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}")
SET(PROJECT_MODULE_PATH "$ENV{${project}_USER_TOP}/share/cmake_modules/")
LIST(FIND CMAKE_MODULE_PATH "${PROJECT_MODULE_PATH}" DIR_INDEX)
IF( DIR_INDEX LESS 0)
LIST(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_MODULE_PATH}")
ENDIF( DIR_INDEX LESS 0)
ENDIF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
IF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) IF( NOT("$ENV{${project}_TOP}" STREQUAL "") )
MESSAGE("-- ${project}_TOP is set to $ENV{${project}_TOP}") MESSAGE("-- ${project}_TOP is set to $ENV{${project}_TOP}")
SET(PROJECT_MODULE_PATH "$ENV{${project}_TOP}/share/cmake_modules/") SET(PROJECT_MODULE_PATH "$ENV{${project}_TOP}/share/cmake_modules/")
@ -38,6 +29,15 @@ MACRO(SETUP_PROJECT_PATHS project)
LIST(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_MODULE_PATH}") LIST(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_MODULE_PATH}")
ENDIF( DIR_INDEX LESS 0) ENDIF( DIR_INDEX LESS 0)
ENDIF( NOT("$ENV{${project}_TOP}" STREQUAL "") ) ENDIF( NOT("$ENV{${project}_TOP}" STREQUAL "") )
IF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
MESSAGE("-- ${project}_USER_TOP is set to $ENV{${project}_USER_TOP}")
SET(PROJECT_MODULE_PATH "$ENV{${project}_USER_TOP}/share/cmake_modules/")
LIST(FIND CMAKE_MODULE_PATH "${PROJECT_MODULE_PATH}" DIR_INDEX)
IF( DIR_INDEX LESS 0)
LIST(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_MODULE_PATH}")
ENDIF( DIR_INDEX LESS 0)
ENDIF( NOT("$ENV{${project}_USER_TOP}" STREQUAL "") )
ENDMACRO(SETUP_PROJECT_PATHS project) ENDMACRO(SETUP_PROJECT_PATHS project)
SETUP_PROJECT_PATHS(IO) SETUP_PROJECT_PATHS(IO)

View File

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

View File

@ -30,8 +30,11 @@
kite/Configuration.h kite/Configuration.h
kite/KiteEngine.h kite/KiteEngine.h
kite/GraphicKiteEngine.h kite/GraphicKiteEngine.h
kite/ConfigurationWidget.h
)
set ( mocIncludes kite/GraphicKiteEngine.h
kite/ConfigurationWidget.h
) )
set ( mocIncludes kite/GraphicKiteEngine.h )
set ( cpps TrackSegmentCost.cpp set ( cpps TrackSegmentCost.cpp
TrackCost.cpp TrackCost.cpp
DataNegociate.cpp DataNegociate.cpp
@ -60,6 +63,7 @@
Configuration.cpp Configuration.cpp
KiteEngine.cpp KiteEngine.cpp
GraphicKiteEngine.cpp GraphicKiteEngine.cpp
ConfigurationWidget.cpp
) )
set ( kitecpps KiteMain.cpp ) set ( kitecpps KiteMain.cpp )
qt4_wrap_cpp ( mocCpps ${mocIncludes} ) qt4_wrap_cpp ( mocCpps ${mocIncludes} )

View File

@ -23,6 +23,10 @@
// x-----------------------------------------------------------------x // x-----------------------------------------------------------------x
#include <string>
#include "hurricane/Cell.h"
#include "crlcore/Utilities.h"
#include "kite/Configuration.h" #include "kite/Configuration.h"
#include "kite/KiteEngine.h" #include "kite/KiteEngine.h"
@ -31,29 +35,29 @@
namespace Kite { namespace Kite {
using std::cerr; using std::cout;
using std::endl; using std::cerr;
using std::ostringstream; using std::endl;
using Hurricane::tab; using std::ostringstream;
using Hurricane::inltrace; using Hurricane::tab;
using Hurricane::Error; using Hurricane::inltrace;
using Hurricane::Technology; using Hurricane::Error;
using Hurricane::Technology;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "Kite::Configuration". // Class : "Kite::Configuration".
float Configuration::_defaultEdgeCapacity = 0.80; Configuration* Configuration::_default = NULL;
void Configuration::setDefaultEdgeCapacity ( float percent ) Configuration* Configuration::getDefault ()
{ {
if ( percent > 1.0 ) if ( _default == NULL ) {
throw Error("Configuration::setDefaultEdgeCapacity(): edge capacity ratio greater than 1.0 (%.1f)." _default = new Configuration ( Katabatic::Configuration::getDefault() );
,percent); }
return _default;
_defaultEdgeCapacity = percent;
} }
@ -61,8 +65,8 @@ namespace Kite {
: Katabatic::Configuration() : Katabatic::Configuration()
, _base (base) , _base (base)
, _postEventCb () , _postEventCb ()
, _edgeCapacityPercent(_defaultEdgeCapacity) , _edgeCapacityPercent(0.80)
, _expandStep (0.40) , _expandStep (0.60)
, _ripupLimits () , _ripupLimits ()
, _ripupCost (3) , _ripupCost (3)
, _eventsLimit (4000000) , _eventsLimit (4000000)
@ -75,10 +79,38 @@ namespace Kite {
} }
Configuration::Configuration ( const Configuration& other, Katabatic::Configuration* base )
: Katabatic::Configuration()
, _base (base)
, _postEventCb (other._postEventCb)
, _edgeCapacityPercent(other._edgeCapacityPercent)
, _expandStep (other._expandStep)
, _ripupLimits ()
, _ripupCost (other._ripupCost)
, _eventsLimit (other._eventsLimit)
{
if ( _base == NULL ) _base = other._base->clone();
_ripupLimits[BorderRipupLimit] = other._ripupLimits[BorderRipupLimit];
_ripupLimits[StrapRipupLimit] = other._ripupLimits[StrapRipupLimit];
_ripupLimits[LocalRipupLimit] = other._ripupLimits[LocalRipupLimit];
_ripupLimits[GlobalRipupLimit] = other._ripupLimits[GlobalRipupLimit];
_ripupLimits[LongGlobalRipupLimit] = other._ripupLimits[LongGlobalRipupLimit];
}
Configuration::~Configuration () Configuration::~Configuration ()
{ } { }
Configuration* Configuration::clone () const
{ return new Configuration(*this); }
Configuration* Configuration::clone ( KiteEngine* kite ) const
{ return new Configuration(*this,kite->base()->getKatabaticConfiguration()); }
bool Configuration::isGMetal ( const Layer* layer ) const bool Configuration::isGMetal ( const Layer* layer ) const
{ return _base->isGMetal(layer); } { return _base->isGMetal(layer); }
@ -139,6 +171,16 @@ namespace Kite {
} }
void Configuration::setEdgeCapacityPercent ( float percent )
{
if ( percent > 1.0 )
throw Error("Configuration::setEdgeCapacityPercent(): edge capacity ratio greater than 1.0 (%.1f)."
,percent);
_edgeCapacityPercent = percent;
}
unsigned int Configuration::getRipupLimit ( unsigned int type ) const unsigned int Configuration::getRipupLimit ( unsigned int type ) const
{ {
if ( type >= RipupLimitsTableSize ) { if ( type >= RipupLimitsTableSize ) {
@ -150,6 +192,22 @@ namespace Kite {
} }
void Configuration::print ( Cell* cell ) const
{
cout << " o Configuration of ToolEngine<Kite> for Cell <" << cell->getName() << ">" << endl;
cout << Dots::asPercentage(" - Global router edge capacity" ,_edgeCapacityPercent) << endl;
cout << Dots::asPercentage(" - GCell aggregation threshold (delta)",_expandStep) << endl;
cout << Dots::asULong (" - Events limit (iterations)" ,_eventsLimit) << endl;
cout << Dots::asUInt (" - Ripup limit, borders" ,_ripupLimits[BorderRipupLimit]) << endl;
cout << Dots::asUInt (" - Ripup limit, straps" ,_ripupLimits[StrapRipupLimit]) << endl;
cout << Dots::asUInt (" - Ripup limit, locals" ,_ripupLimits[LocalRipupLimit]) << endl;
cout << Dots::asUInt (" - Ripup limit, globals" ,_ripupLimits[GlobalRipupLimit]) << endl;
cout << Dots::asUInt (" - Ripup limit, long globals" ,_ripupLimits[LongGlobalRipupLimit]) << endl;
_base->print ( cell );
}
string Configuration::_getTypeName () const string Configuration::_getTypeName () const
{ {
return "Configuration"; return "Configuration";

View File

@ -41,10 +41,13 @@
#include <hurricane/viewer/Graphics.h> #include <hurricane/viewer/Graphics.h>
#include <hurricane/viewer/CellWidget.h> #include <hurricane/viewer/CellWidget.h>
#include <hurricane/viewer/CellViewer.h> #include <hurricane/viewer/CellViewer.h>
#include <hurricane/viewer/ControllerWidget.h>
#include <crlcore/Utilities.h>
#include <crlcore/AllianceFramework.h> #include <crlcore/AllianceFramework.h>
#include <katabatic/GCell.h> #include <katabatic/GCell.h>
#include <knik/KnikEngine.h> #include <knik/KnikEngine.h>
#include <kite/GraphicKiteEngine.h> #include <kite/GraphicKiteEngine.h>
#include <kite/ConfigurationWidget.h>
namespace Kite { namespace Kite {
@ -59,6 +62,7 @@ namespace Kite {
using Hurricane::Net; using Hurricane::Net;
using Hurricane::Graphics; using Hurricane::Graphics;
using Hurricane::ColorScale; using Hurricane::ColorScale;
using Hurricane::ControllerWidget;
using CRL::Catalog; using CRL::Catalog;
using CRL::AllianceFramework; using CRL::AllianceFramework;
using Knik::KnikEngine; using Knik::KnikEngine;
@ -112,13 +116,13 @@ namespace Kite {
} }
KiteEngine* GraphicKiteEngine::createEngine ( const RoutingGauge* rg ) KiteEngine* GraphicKiteEngine::createEngine ()
{ {
Cell* cell = getCell (); Cell* cell = getCell ();
KiteEngine* kite = KiteEngine::get ( cell ); KiteEngine* kite = KiteEngine::get ( cell );
if ( not kite ) { if ( not kite ) {
kite = KiteEngine::create ( rg, cell ); kite = KiteEngine::create ( cell );
kite->setPostEventCb ( boost::bind(&GraphicKiteEngine::postEvent,this) ); kite->setPostEventCb ( boost::bind(&GraphicKiteEngine::postEvent,this) );
} else } else
cerr << Warning("%s already has a Kite engine.",getString(cell).c_str()) << endl; cerr << Warning("%s already has a Kite engine.",getString(cell).c_str()) << endl;
@ -134,8 +138,7 @@ namespace Kite {
KiteEngine* kite = KiteEngine::get ( getCell() ); KiteEngine* kite = KiteEngine::get ( getCell() );
if ( kite ) return kite; if ( kite ) return kite;
AllianceFramework* af = AllianceFramework::get (); kite = createEngine ();
kite = createEngine ( af->getRoutingGauge() );
if ( not kite ) if ( not kite )
throw Error("Failed to create Kite engine on %s.",getString(getCell()).c_str()); throw Error("Failed to create Kite engine on %s.",getString(getCell()).c_str());
@ -181,6 +184,8 @@ namespace Kite {
if ( not kite ) { if ( not kite ) {
throw Error("KiteEngine not created yet, run the global router first."); throw Error("KiteEngine not created yet, run the global router first.");
} }
if ( cmess1.enabled() )
kite->printConfiguration ();
emit cellPreModificated (); emit cellPreModificated ();
@ -333,6 +338,17 @@ namespace Kite {
connect ( this, SIGNAL(cellPreModificated ()), _viewer->getCellWidget(), SLOT(cellPreModificate ()) ); connect ( this, SIGNAL(cellPreModificated ()), _viewer->getCellWidget(), SLOT(cellPreModificate ()) );
connect ( this, SIGNAL(cellPostModificated()), _viewer->getCellWidget(), SLOT(cellPostModificate()) ); connect ( this, SIGNAL(cellPostModificated()), _viewer->getCellWidget(), SLOT(cellPostModificate()) );
ControllerWidget* controller = _viewer->getControllerWidget();
ConfigurationWidget* setting = controller->getSettings()
->findChild<ConfigurationWidget*>("controller.tabSettings.setting.kite");
if ( setting == NULL ) {
setting = new ConfigurationWidget ();
setting->setObjectName ( "controller.tabSettings.setting.kite" );
setting->setConfiguration ( Configuration::getDefault() );
controller->addSetting ( setting, "Kite" );
}
} }

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved // Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
// //
// =================================================================== // ===================================================================
// //
@ -101,11 +101,11 @@ namespace Kite {
} }
KiteEngine::KiteEngine ( const RoutingGauge* gauge, Cell* cell ) KiteEngine::KiteEngine ( Cell* cell )
: KatabaticEngine (gauge,cell) : KatabaticEngine (cell)
, _knik (NULL) , _knik (NULL)
, _obstacleNet (NULL) , _obstacleNet (NULL)
, _configuration (getKatabaticConfiguration()) , _configuration (Configuration::getDefault()->clone(this))
, _routingPlanes () , _routingPlanes ()
, _kiteGrid (NULL) , _kiteGrid (NULL)
, _negociateWindow (NULL) , _negociateWindow (NULL)
@ -133,9 +133,9 @@ namespace Kite {
} }
KiteEngine* KiteEngine::create ( const RoutingGauge* gauge, Cell* cell ) KiteEngine* KiteEngine::create ( Cell* cell )
{ {
KiteEngine* kite = new KiteEngine ( gauge, cell ); KiteEngine* kite = new KiteEngine ( cell );
kite->_postCreate (); kite->_postCreate ();
return kite; return kite;
@ -165,7 +165,9 @@ namespace Kite {
KiteEngine::~KiteEngine () KiteEngine::~KiteEngine ()
{ } {
delete _configuration;
}
const Name& KiteEngine::getName () const const Name& KiteEngine::getName () const
@ -173,7 +175,7 @@ namespace Kite {
Configuration* KiteEngine::getConfiguration () Configuration* KiteEngine::getConfiguration ()
{ return &_configuration; } { return _configuration; }
unsigned int KiteEngine::getRipupLimit ( const TrackElement* segment ) const unsigned int KiteEngine::getRipupLimit ( const TrackElement* segment ) const
@ -182,21 +184,21 @@ namespace Kite {
if ( segment->getDataNegociate() ) { if ( segment->getDataNegociate() ) {
if ( segment->getDataNegociate()->isBorder() ) if ( segment->getDataNegociate()->isBorder() )
return _configuration.getRipupLimit(Configuration::BorderRipupLimit); return _configuration->getRipupLimit(Configuration::BorderRipupLimit);
if ( segment->getDataNegociate()->isRing() ) if ( segment->getDataNegociate()->isRing() )
return _configuration.getRipupLimit(Configuration::GlobalRipupLimit); 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; vector<GCell*> 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);
return _configuration.getRipupLimit(Configuration::GlobalRipupLimit); return _configuration->getRipupLimit(Configuration::GlobalRipupLimit);
} }
return _configuration.getRipupLimit(Configuration::LocalRipupLimit); return _configuration->getRipupLimit(Configuration::LocalRipupLimit);
} }

View File

@ -161,8 +161,7 @@ int main ( int argc, char *argv[] )
} }
} }
//KnikEngine::setEdgeCapacityPercent ( edgeCapacity ); Kite::Configuration::getDefault()->setEdgeCapacityPercent ( edgeCapacity );
Kite::Configuration::setDefaultEdgeCapacity ( edgeCapacity );
cell->flattenNets ( not arguments.count("global") ); cell->flattenNets ( not arguments.count("global") );
@ -175,7 +174,7 @@ int main ( int argc, char *argv[] )
} }
static vector<Net*> routingNets; static vector<Net*> routingNets;
KiteEngine* kite = KiteEngine::create ( af->getRoutingGauge(), cell ); KiteEngine* kite = KiteEngine::create ( cell );
// kite->setSaturateRatio ( 0.85 ); // kite->setSaturateRatio ( 0.85 );
// kite->setExpandStep ( 0.20 ); // kite->setExpandStep ( 0.20 );
// kite->setRipupCost ( 3 ); // kite->setRipupCost ( 3 );

View File

@ -30,6 +30,7 @@
#include "hurricane/RoutingPad.h" #include "hurricane/RoutingPad.h"
#include "hurricane/Net.h" #include "hurricane/Net.h"
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "crlcore/Utilities.h"
#include "crlcore/AllianceFramework.h" #include "crlcore/AllianceFramework.h"
#include "kite/DataNegociate.h" #include "kite/DataNegociate.h"
@ -538,10 +539,11 @@ namespace Kite {
biggestRSsize = _gcellRoutingSets[i]->getGCells().size(); biggestRSsize = _gcellRoutingSets[i]->getGCells().size();
} }
cout << " - Processeds Events Total := " << RoutingEvent::getProcesseds() << endl; cout << Dots::asSizet(" - Processeds Events Total",RoutingEvent::getProcesseds()) << endl;
cout << " - Unique Events Total := " << (RoutingEvent::getProcesseds() - RoutingEvent::getCloneds()) << endl; cout << Dots::asSizet(" - Unique Events Total"
cout << " - Biggest Events Chunk := " << biggestEventsCount << endl; ,(RoutingEvent::getProcesseds() - RoutingEvent::getCloneds())) << endl;
cout << " - Biggest Routing Set := " << biggestRSsize << endl; cout << Dots::asSizet(" - Biggest Events Chunk" ,biggestEventsCount) << endl;
cout << Dots::asSizet(" - Biggest Routing Set" ,biggestRSsize) << endl;
} }

View File

@ -1132,7 +1132,7 @@ namespace {
Interval constraints; Interval constraints;
vector<Cs1Candidate> candidates; vector<Cs1Candidate> candidates;
TrackElement* segment = _event->getSegment(); TrackElement* segment = _event->getSegment();
bool canMoveUp = (segment->isLocal()) ? segment->canPivotUp(1.0) : segment->canMoveUp(1.0); bool canMoveUp = (segment->isLocal()) ? segment->canPivotUp(0.5) : segment->canMoveUp(0.5);
unsigned int relaxFlags unsigned int relaxFlags
= (_data and (_data->getStateCount() < 2)) ? Manipulator::AllowExpand : Manipulator::NoExpand; = (_data and (_data->getStateCount() < 2)) ? Manipulator::AllowExpand : Manipulator::NoExpand;
@ -1194,7 +1194,7 @@ namespace {
if ( other->isGlobal() if ( other->isGlobal()
and (other->getDataNegociate()->getGCellOrder() == Session::getOrder()) and (other->getDataNegociate()->getGCellOrder() == Session::getOrder())
and other->canMoveUp(1.0) ) { and other->canMoveUp(0.5) ) {
ltrace(200) << "conflictSolve1() - One conflict, other move up" << endl; ltrace(200) << "conflictSolve1() - One conflict, other move up" << endl;
if ( (success = other->moveUp()) ) break; if ( (success = other->moveUp()) ) break;
} }

View File

@ -33,12 +33,15 @@
namespace Kite { namespace Kite {
using std::string; using std::string;
using Hurricane::Record; using Hurricane::Record;
using Hurricane::Layer; using Hurricane::Layer;
using Hurricane::DbU; using Hurricane::DbU;
using CRL::RoutingGauge; using Hurricane::Cell;
using CRL::RoutingLayerGauge; using CRL::RoutingGauge;
using CRL::RoutingLayerGauge;
class KiteEngine;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -57,10 +60,11 @@ namespace Kite {
, RipupLimitsTableSize=5 , RipupLimitsTableSize=5
}; };
public: public:
static void setDefaultEdgeCapacity ( float ); static Configuration* getDefault ();
public: public:
// Constructor & Destructor. // Constructor & Destructor.
Configuration ( Katabatic::Configuration* ); virtual Configuration* clone () const;
virtual Configuration* clone ( KiteEngine* kite ) const;
~Configuration (); ~Configuration ();
// Decorateds. // Decorateds.
virtual bool isGMetal ( const Layer* ) const; virtual bool isGMetal ( const Layer* ) const;
@ -75,6 +79,7 @@ namespace Kite {
virtual DbU::Unit getGlobalThreshold () const; virtual DbU::Unit getGlobalThreshold () const;
virtual void setSaturateRatio ( float ); virtual void setSaturateRatio ( float );
virtual void setGlobalThreshold ( DbU::Unit ); virtual void setGlobalThreshold ( DbU::Unit );
virtual void print ( Cell* ) const;
// Methods. // Methods.
inline Katabatic::Configuration* base (); inline Katabatic::Configuration* base ();
inline PostEventCb_t& getPostEventCb (); inline PostEventCb_t& getPostEventCb ();
@ -88,14 +93,16 @@ namespace Kite {
inline void setRipupCost ( unsigned int ); inline void setRipupCost ( unsigned int );
void setRipupLimit ( unsigned int type, unsigned int limit ); void setRipupLimit ( unsigned int type, unsigned int limit );
inline void setPostEventCb ( PostEventCb_t ); inline void setPostEventCb ( PostEventCb_t );
inline void setEdgeCapacityPercent ( float ); void setEdgeCapacityPercent ( float );
virtual Record* _getRecord () const; virtual Record* _getRecord () const;
virtual string _getString () const; virtual string _getString () const;
virtual string _getTypeName () const; virtual string _getTypeName () const;
protected:
Configuration ( Katabatic::Configuration* );
private: private:
// Static Attributes. // Static Attributes.
static float _defaultEdgeCapacity; static Configuration* _default;
// Attributes. // Attributes.
Katabatic::Configuration* _base; Katabatic::Configuration* _base;
PostEventCb_t _postEventCb; PostEventCb_t _postEventCb;
@ -105,7 +112,7 @@ namespace Kite {
unsigned int _ripupCost; unsigned int _ripupCost;
unsigned long _eventsLimit; unsigned long _eventsLimit;
private: private:
Configuration ( const Configuration& ); Configuration ( const Configuration& other, Katabatic::Configuration* base=NULL );
Configuration& operator= ( const Configuration& ); Configuration& operator= ( const Configuration& );
}; };
@ -121,7 +128,6 @@ namespace Kite {
inline void Configuration::setExpandStep ( float step ) { _expandStep = step; } inline void Configuration::setExpandStep ( float step ) { _expandStep = step; }
inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; } inline void Configuration::setPostEventCb ( PostEventCb_t cb ) { _postEventCb = cb; }
inline void Configuration::setEventsLimit ( unsigned long limit ) { _eventsLimit = limit; } inline void Configuration::setEventsLimit ( unsigned long limit ) { _eventsLimit = limit; }
inline void Configuration::setEdgeCapacityPercent ( float percent ) { _edgeCapacityPercent = percent; }
} // End of Kite namespace. } // End of Kite namespace.

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved // Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
// //
// =================================================================== // ===================================================================
// //
@ -38,9 +38,6 @@ namespace Hurricane {
} }
#include "crlcore/GraphicToolEngine.h" #include "crlcore/GraphicToolEngine.h"
namespace CRL {
class RoutingGauge;
}
#include "kite/KiteEngine.h" #include "kite/KiteEngine.h"
@ -53,19 +50,18 @@ namespace Kite {
using Hurricane::Transformation; using Hurricane::Transformation;
using Hurricane::CellWidget; using Hurricane::CellWidget;
using Hurricane::CellViewer; using Hurricane::CellViewer;
using CRL::RoutingGauge;
using CRL::GraphicTool; using CRL::GraphicTool;
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "CRL::GraphicKiteEngine". // Class : "Kite::GraphicKiteEngine".
class GraphicKiteEngine : public GraphicTool { class GraphicKiteEngine : public GraphicTool {
Q_OBJECT; Q_OBJECT;
public: public:
KiteEngine* createEngine ( const RoutingGauge* ); KiteEngine* createEngine ();
KiteEngine* getForFramework (); KiteEngine* getForFramework ();
static void initKatabaticAc ( CellWidget* ); static void initKatabaticAc ( CellWidget* );
static void drawKatabaticAc ( CellWidget* static void drawKatabaticAc ( CellWidget*

View File

@ -78,7 +78,7 @@ namespace Kite {
public: public:
static const Name& staticGetName (); static const Name& staticGetName ();
static KiteEngine* create ( const RoutingGauge*, Cell* ); static KiteEngine* create ( Cell* );
static KiteEngine* get ( const Cell* ); static KiteEngine* get ( const Cell* );
public: public:
inline KatabaticEngine* base (); inline KatabaticEngine* base ();
@ -101,6 +101,7 @@ namespace Kite {
RoutingPlane* getRoutingPlaneByIndex ( size_t index ) const; RoutingPlane* getRoutingPlaneByIndex ( size_t index ) const;
RoutingPlane* getRoutingPlaneByLayer ( const Layer* ) const; RoutingPlane* getRoutingPlaneByLayer ( const Layer* ) const;
Track* getTrackByPosition ( const Layer*, DbU::Unit axis, unsigned int mode=Constant::Nearest ) const; Track* getTrackByPosition ( const Layer*, DbU::Unit axis, unsigned int mode=Constant::Nearest ) const;
inline void printConfiguration () const;
void printCompletion () const; void printCompletion () const;
void dumpMeasures ( std::ostream& ) const; void dumpMeasures ( std::ostream& ) const;
void dumpMeasures () const; void dumpMeasures () const;
@ -143,7 +144,7 @@ namespace Kite {
protected: protected:
Knik::KnikEngine* _knik; Knik::KnikEngine* _knik;
Net* _obstacleNet; Net* _obstacleNet;
Configuration _configuration; Configuration* _configuration;
vector<RoutingPlane*> _routingPlanes; vector<RoutingPlane*> _routingPlanes;
GCellGrid* _kiteGrid; GCellGrid* _kiteGrid;
NegociateWindow* _negociateWindow; NegociateWindow* _negociateWindow;
@ -153,7 +154,7 @@ namespace Kite {
protected: protected:
// Constructors & Destructors. // Constructors & Destructors.
KiteEngine ( const RoutingGauge*, Cell* ); KiteEngine ( Cell* );
virtual ~KiteEngine (); virtual ~KiteEngine ();
virtual void _postCreate (); virtual void _postCreate ();
virtual void _preDestroy (); virtual void _preDestroy ();
@ -165,25 +166,26 @@ namespace Kite {
// Inline Functions. // Inline Functions.
inline KatabaticEngine* KiteEngine::base () { return static_cast<KatabaticEngine*>(this); } inline KatabaticEngine* KiteEngine::base () { return static_cast<KatabaticEngine*>(this); }
inline Configuration* KiteEngine::getKiteConfiguration () { return &_configuration; } inline Configuration* KiteEngine::getKiteConfiguration () { return _configuration; }
inline Net* KiteEngine::getBlockageNet () { return _obstacleNet; } inline Net* KiteEngine::getBlockageNet () { return _obstacleNet; }
inline Configuration::PostEventCb_t& KiteEngine::getPostEventCb () { return _configuration.getPostEventCb(); } inline Configuration::PostEventCb_t& KiteEngine::getPostEventCb () { return _configuration->getPostEventCb(); }
inline bool KiteEngine::getToolSuccess () const { return _toolSuccess; } inline bool KiteEngine::getToolSuccess () const { return _toolSuccess; }
inline unsigned long KiteEngine::getEventsLimit () const { return _configuration.getEventsLimit(); } inline unsigned long KiteEngine::getEventsLimit () const { return _configuration->getEventsLimit(); }
inline unsigned int KiteEngine::getRipupCost () const { return _configuration.getRipupCost(); } inline unsigned int KiteEngine::getRipupCost () const { return _configuration->getRipupCost(); }
inline float KiteEngine::getExpandStep () const { return _configuration.getExpandStep(); } inline float KiteEngine::getExpandStep () const { return _configuration->getExpandStep(); }
inline float KiteEngine::getEdgeCapacityPercent () const { return _configuration.getEdgeCapacityPercent(); } inline float KiteEngine::getEdgeCapacityPercent () const { return _configuration->getEdgeCapacityPercent(); }
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 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); }
inline void KiteEngine::setRipupLimit ( unsigned int limit, unsigned int type ) { _configuration.setRipupLimit(limit,type); } inline void KiteEngine::setRipupLimit ( unsigned int limit, unsigned int type ) { _configuration->setRipupLimit(limit,type); }
inline void KiteEngine::setRipupCost ( unsigned int cost ) { _configuration.setRipupCost(cost); } inline void KiteEngine::setRipupCost ( unsigned int cost ) { _configuration->setRipupCost(cost); }
inline void KiteEngine::setExpandStep ( float step ) { _configuration.setExpandStep(step); } inline void KiteEngine::setExpandStep ( float step ) { _configuration->setExpandStep(step); }
inline void KiteEngine::setEdgeCapacityPercent ( float percent ) { _configuration.setEdgeCapacityPercent(percent); } inline void KiteEngine::setEdgeCapacityPercent ( float percent ) { _configuration->setEdgeCapacityPercent(percent); }
inline void KiteEngine::setMinimumWL ( double minimum ) { _minimumWL = minimum; } inline void KiteEngine::setMinimumWL ( double minimum ) { _minimumWL = minimum; }
inline void KiteEngine::setPostEventCb ( Configuration::PostEventCb_t cb ) { _configuration.setPostEventCb(cb); } inline void KiteEngine::setPostEventCb ( Configuration::PostEventCb_t cb ) { _configuration->setPostEventCb(cb); }
inline void KiteEngine::printConfiguration () const { _configuration->print(getCell()); }
inline TrackElementLut& KiteEngine::_getTrackElementLut () { return _trackSegmentLut; } inline TrackElementLut& KiteEngine::_getTrackElementLut () { return _trackSegmentLut; }
inline TrackElement* KiteEngine::_lookup ( AutoSegment* as ) const { return _lookup(as->base()); } inline TrackElement* KiteEngine::_lookup ( AutoSegment* as ) const { return _lookup(as->base()); }