From bded70971ee3fd70c6eef8daf3fb162ecc83c1a4 Mon Sep 17 00:00:00 2001 From: Gabriel Gouvine Date: Thu, 23 Apr 2015 16:14:06 +0200 Subject: [PATCH] Taking into account the configuration flag + wipeout routing function --- etesian/src/Configuration.cpp | 4 +- etesian/src/EtesianEngine.cpp | 61 +++++++++++------------------ etesian/src/etesian/Configuration.h | 3 ++ etesian/src/etesian/EtesianEngine.h | 2 + kite/src/KiteEngine.cpp | 37 ++++++++++++++++- kite/src/kite/KiteEngine.h | 1 + 6 files changed, 67 insertions(+), 41 deletions(-) diff --git a/etesian/src/Configuration.cpp b/etesian/src/Configuration.cpp index 95f0bb2e..bf992b46 100644 --- a/etesian/src/Configuration.cpp +++ b/etesian/src/Configuration.cpp @@ -56,7 +56,8 @@ namespace Etesian { : _cg ( NULL ) , _placeEffort ( static_cast (Cfg::getParamEnumerate ("etesian.effort" , Standard )->asInt()) ) , _updateConf ( static_cast (Cfg::getParamEnumerate ("etesian.graphics" , LowerBound )->asInt()) ) - , _spreadingConf( Cfg::getParamBool ("etesian.uniformDensity", false )->asBool()?ForceUniform:MaxDensity ) + , _spreadingConf( Cfg::getParamBool ("etesian.uniformDensity", false )->asBool()? ForceUniform : MaxDensity ) + , _routingDriven( Cfg::getParamBool ("etesian.routingDriven", false )->asBool()) , _spaceMargin ( Cfg::getParamPercentage("etesian.spaceMargin" , 5.0)->asDouble() ) , _aspectRatio ( Cfg::getParamPercentage("etesian.aspectRatio" ,100.0)->asDouble() ) { @@ -95,6 +96,7 @@ namespace Etesian { cout << Dots::asInt (" - Place Effort" ,_placeEffort ) << endl; cout << Dots::asInt (" - Update Conf" ,_updateConf ) << endl; cout << Dots::asInt (" - Spreading Conf",_spreadingConf) << endl; + cout << Dots::asBool (" - Routing driven",_routingDriven) << endl; cout << Dots::asPercentage(" - Space Margin" ,_spaceMargin ) << endl; cout << Dots::asPercentage(" - Aspect Ratio" ,_aspectRatio ) << endl; } diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 9ce21b34..b6d64da6 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -811,6 +811,7 @@ namespace Etesian { Effort placementEffort = getPlaceEffort(); GraphicUpdate placementUpdate = getUpdateConf(); Density densityConf = getSpreadingConf(); + bool routingDriven = getRoutingDriven(); startMeasures(); double sliceHeight = getSliceHeight() / getPitch(); @@ -872,47 +873,29 @@ namespace Etesian { cmess1 << " o Detailed Placement." << endl; detailedPlace(detailedIterations, detailedEffort, detailedOptions); - using namespace Kite; - KiteEngine* kiteE = KiteEngine::create(_cell); - kiteE->runGlobalRouter(0); - kiteE->loadGlobalRouting(Katabatic::EngineLoadGrByNet); - kiteE->balanceGlobalDensity(); - kiteE->layerAssign(Katabatic::EngineNoNetLayerAssign); - kiteE->runNegociate(); - feedRoutingBack(); - kiteE->destroy(); - - UpdateSession::open(); - forEach(Net*, inet, _cell->getNets()){ - if(NetRoutingExtension::isManualGlobalRoute(*inet)) - continue; - // First pass: destroy the contacts - std::vector contactPointers; - forEach(Component*, icom, (*inet)->getComponents()){ - Contact * contact = dynamic_cast(*icom); - if(contact){ - contactPointers.push_back(contact); + if(routingDriven){ + bool success = false; + int routingDrivenIteration = 0; + using namespace Kite; + while(true){ + cmess2 << "Routing-driven placement iteration " << routingDrivenIteration << endl; + KiteEngine* kiteE = KiteEngine::create(_cell); + kiteE->runGlobalRouter(0); + kiteE->loadGlobalRouting(Katabatic::EngineLoadGrByNet); + kiteE->balanceGlobalDensity(); + kiteE->layerAssign(Katabatic::EngineNoNetLayerAssign); + kiteE->runNegociate(); + success = kiteE->getToolSuccess(); + feedRoutingBack(); + kiteE->destroy(); + KiteEngine::wipeOutRouting(_cell); + if(success){ + cmess2 << "The design is routable; exiting" << endl; + break; + } + detailedPlace(detailedIterations, detailedEffort, detailedOptions); } - } - for(Contact* contact : contactPointers) - contact->destroy(); - // Second pass: destroy unconnected segments added by Knik as blockages - std::vector compPointers; - forEach(Component*, icom, (*inet)->getComponents()){ - Horizontal * h = dynamic_cast(*icom); - if(h){ - compPointers.push_back(h); - } - Vertical * v = dynamic_cast(*icom); - if(v){ - compPointers.push_back(v); - } - } - for(Component* comp : compPointers) - comp->destroy(); } - UpdateSession::close(); - detailedPlace(detailedIterations, detailedEffort, detailedOptions); cmess2 << " o Adding feed cells." << endl; addFeeds(); diff --git a/etesian/src/etesian/Configuration.h b/etesian/src/etesian/Configuration.h index 28f4200d..eda4d8d7 100644 --- a/etesian/src/etesian/Configuration.h +++ b/etesian/src/etesian/Configuration.h @@ -66,6 +66,7 @@ namespace Etesian { inline Effort getPlaceEffort () const; inline GraphicUpdate getUpdateConf () const; inline Density getSpreadingConf () const; + inline bool getRoutingDriven () const; inline double getSpaceMargin () const; inline double getAspectRatio () const; void print ( Cell* ) const; @@ -78,6 +79,7 @@ namespace Etesian { Effort _placeEffort; GraphicUpdate _updateConf; Density _spreadingConf; + bool _routingDriven; double _spaceMargin; double _aspectRatio; private: @@ -90,6 +92,7 @@ namespace Etesian { inline Effort Configuration::getPlaceEffort () const { return _placeEffort; } inline GraphicUpdate Configuration::getUpdateConf () const { return _updateConf; } inline Density Configuration::getSpreadingConf () const { return _spreadingConf; } + inline bool Configuration::getRoutingDriven () const { return _routingDriven; } inline double Configuration::getSpaceMargin () const { return _spaceMargin; } inline double Configuration::getAspectRatio () const { return _aspectRatio; } diff --git a/etesian/src/etesian/EtesianEngine.h b/etesian/src/etesian/EtesianEngine.h index 1382f858..a277c570 100644 --- a/etesian/src/etesian/EtesianEngine.h +++ b/etesian/src/etesian/EtesianEngine.h @@ -65,6 +65,7 @@ namespace Etesian { inline Effort getPlaceEffort () const; inline GraphicUpdate getUpdateConf () const; inline Density getSpreadingConf () const; + inline bool getRoutingDriven () const; inline double getSpaceMargin () const; inline double getAspectRatio () const; inline const FeedCells& getFeedCells () const; @@ -137,6 +138,7 @@ namespace Etesian { inline Effort EtesianEngine::getPlaceEffort () const { return getConfiguration()->getPlaceEffort(); } inline GraphicUpdate EtesianEngine::getUpdateConf () const { return getConfiguration()->getUpdateConf(); } inline Density EtesianEngine::getSpreadingConf () const { return getConfiguration()->getSpreadingConf(); } + inline bool EtesianEngine::getRoutingDriven () const { return getConfiguration()->getRoutingDriven(); } inline double EtesianEngine::getSpaceMargin () const { return getConfiguration()->getSpaceMargin(); } inline double EtesianEngine::getAspectRatio () const { return getConfiguration()->getAspectRatio(); } inline void EtesianEngine::useFeed ( Cell* cell ) { _feedCells.useFeed(cell); } diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 95360368..f898e5d2 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -20,6 +20,7 @@ #include #include "vlsisapd/utilities/Path.h" #include "hurricane/DebugSession.h" +#include "hurricane/UpdateSession.h" #include "hurricane/Bug.h" #include "hurricane/Error.h" #include "hurricane/Warning.h" @@ -175,7 +176,6 @@ namespace Kite { return kite; } - void KiteEngine::_preDestroy () { ltrace(90) << "KiteEngine::_preDestroy()" << endl; @@ -207,6 +207,41 @@ namespace Kite { ltraceout(90); } + void KiteEngine::wipeOutRouting( Cell * cell ){ + if(KiteEngine::get(cell) != NULL or KatabaticEngine::get(cell) != NULL) + throw Error("Trying to wipe out a routing with a routing engine\n"); + using namespace Hurricane; + UpdateSession::open(); + forEach(Net*, inet, cell->getNets()){ + if(NetRoutingExtension::isManualGlobalRoute(*inet)) + continue; + // First pass: destroy the contacts + std::vector contactPointers; + forEach(Component*, icom, (*inet)->getComponents()){ + Contact * contact = dynamic_cast(*icom); + if(contact){ + contactPointers.push_back(contact); + } + } + for(Contact* contact : contactPointers) + contact->destroy(); + // Second pass: destroy unconnected segments added by Knik as blockages + std::vector compPointers; + forEach(Component*, icom, (*inet)->getComponents()){ + Horizontal * h = dynamic_cast(*icom); + if(h){ + compPointers.push_back(h); + } + Vertical * v = dynamic_cast(*icom); + if(v){ + compPointers.push_back(v); + } + } + for(Component* comp : compPointers) + comp->destroy(); + } + UpdateSession::close(); + } KiteEngine::~KiteEngine () { delete _configuration; } diff --git a/kite/src/kite/KiteEngine.h b/kite/src/kite/KiteEngine.h index be462bc5..24ab5992 100644 --- a/kite/src/kite/KiteEngine.h +++ b/kite/src/kite/KiteEngine.h @@ -63,6 +63,7 @@ namespace Kite { static const Name& staticGetName (); static KiteEngine* create ( Cell* ); static KiteEngine* get ( const Cell* ); + static void wipeOutRouting ( Cell* ); public: inline bool useClockTree () const; inline CellViewer* getViewer () const;