From 991e024c915bebd4992c740ba2ae2887ea902c2a Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 18 Jun 2010 14:14:33 +0000 Subject: [PATCH] * ./nimbus, ./metis, ./mauka, ./katabatic, ./kite : - Change: switch toward the XML configuration system. Suppress the need of a default static configuration (now built on demand from the XML database). In Mauka and Kite, suppress the ConfigurationWidget, wich are obsoleted by the generic XML configuration widget. --- metis/CMakeLists.txt | 1 + metis/src/CMakeLists.txt | 3 ++- metis/src/Configuration.cpp | 42 +++++++++++---------------------- metis/src/MetisEngine.cpp | 7 +++--- metis/src/metis/Configuration.h | 4 ---- 5 files changed, 21 insertions(+), 36 deletions(-) diff --git a/metis/CMakeLists.txt b/metis/CMakeLists.txt index 683b5ebb..1cdb4812 100644 --- a/metis/CMakeLists.txt +++ b/metis/CMakeLists.txt @@ -42,6 +42,7 @@ ENDFOREACH(PATH) SET(QT_USE_QTXML "true") FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project +FIND_PACKAGE(VLSISAPD REQUIRED) FIND_PACKAGE(HURRICANE REQUIRED) FIND_PACKAGE(CORIOLIS REQUIRED) FIND_PACKAGE(NIMBUS REQUIRED) diff --git a/metis/src/CMakeLists.txt b/metis/src/CMakeLists.txt index 5393e6da..4ded1b0e 100644 --- a/metis/src/CMakeLists.txt +++ b/metis/src/CMakeLists.txt @@ -6,8 +6,9 @@ endif ( HMETIS_FOUND ) include ( ${QT_USE_FILE} ) include_directories ( ${METIS_SOURCE_DIR}/src - ${HURRICANE_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR} + ${HURRICANE_INCLUDE_DIR} + ${CONFIGURATION_INCLUDE_DIR} ) set ( includes metis/hmetis.h metis/MetisGraph.h diff --git a/metis/src/Configuration.cpp b/metis/src/Configuration.cpp index b44aea90..362d6606 100644 --- a/metis/src/Configuration.cpp +++ b/metis/src/Configuration.cpp @@ -26,6 +26,7 @@ #include #include +#include "vlsisapd/configuration/Configuration.h" #include "hurricane/Cell.h" #include "crlcore/Utilities.h" #include "metis/Configuration.h" @@ -40,6 +41,7 @@ namespace Metis { using std::setprecision; using std::ostringstream; using std::string; + using Cfg::Parameter; using Hurricane::tab; using Hurricane::inltrace; using Hurricane::Cell; @@ -49,35 +51,23 @@ namespace Metis { // Class : "Metis::Configuration". - Configuration* Configuration::_default = NULL; - - - Configuration* Configuration::getDefault () - { - if ( _default == NULL ) { - _default = new Configuration (); - } - return _default; - } - - Configuration::Configuration () : _refreshCb () - , _partOrKWayHMetis (true) - , _numberOfInstancesStopCriterion(45) - , _globalConnectionsWeightRatio (1) - , _ubFactor (0) + , _partOrKWayHMetis (Cfg::getParamBool("metis.partOrKWayHMetis" ,true)->asBool ()) + , _numberOfInstancesStopCriterion(Cfg::getParamInt ("metis.numberOfInstancesStopCriterion",45 )->asInt ()) + , _globalConnectionsWeightRatio (Cfg::getParamInt ("metis.globalConnectionsWeightRatio" ,1 )->asInt ()) + , _ubFactor (Cfg::getParamInt ("metis.ubFactor" ,0 )->asInt ()) , _hmetisOptions () { - _hmetisOptions[CustomOptions ] = 1; - _hmetisOptions[HMetisNRuns ] = 10; - _hmetisOptions[HMetisCType ] = CTypeHFC; - _hmetisOptions[HMetisRType ] = RTypeFM; - _hmetisOptions[HMetisVCycle ] = VCycleDisable; - _hmetisOptions[HMetisReconst ] = ReconstRemoveCutHE; - _hmetisOptions[HMetisPreAssign ] = 1; + _hmetisOptions[CustomOptions ] = Cfg::getParamBool ("metis.tuneHMetisParameters" ,true )->asBool() ? 1 : 0; + _hmetisOptions[HMetisNRuns ] = Cfg::getParamInt ("metis.numberOfTriedBisections",10 )->asInt(); + _hmetisOptions[HMetisCType ] = Cfg::getParamEnumerate("metis.CType" ,CTypeHFC )->asInt(); + _hmetisOptions[HMetisRType ] = Cfg::getParamEnumerate("metis.RType" ,RTypeFM )->asInt(); + _hmetisOptions[HMetisVCycle ] = Cfg::getParamEnumerate("metis.VCycle" ,VCycleDisable )->asInt(); + _hmetisOptions[HMetisReconst ] = Cfg::getParamEnumerate("metis.Reconst",ReconstRemoveCutHE)->asInt(); + _hmetisOptions[HMetisPreAssign ] = 1; _hmetisOptions[HMetisRandom ] = -1; - _hmetisOptions[HMetisDebugLevel] = DebugDisable; + _hmetisOptions[HMetisDebugLevel] = Cfg::getParamEnumerate("metis.debug" ,DebugDisable )->asInt(); } @@ -98,10 +88,6 @@ namespace Metis { { } - Configuration* Configuration::clone () const - { return new Configuration(*this); } - - void Configuration::print ( Cell* cell ) const { cout << " o Configuration of ToolEngine for Cell <" << cell->getName() << ">" << endl; diff --git a/metis/src/MetisEngine.cpp b/metis/src/MetisEngine.cpp index 395e084d..415c0fc6 100644 --- a/metis/src/MetisEngine.cpp +++ b/metis/src/MetisEngine.cpp @@ -35,6 +35,7 @@ #include using namespace std; +#include "vlsisapd/configuration/Configuration.h" #include "hurricane/Warning.h" #include "hurricane/Net.h" #include "hurricane/Instance.h" @@ -61,7 +62,7 @@ namespace Metis { MetisEngine::MetisEngine ( Cell* cell ) : Inherit (cell) - , _configuration(Configuration::getDefault()->clone()) + , _configuration(new Configuration()) , _step (0) , _actualGraphs () , _newGraphs () @@ -273,8 +274,8 @@ namespace Metis { { size_t gates = getInstancesCount ( cell ); - double partitions = log((double)gates / (double)Configuration::getDefault() - ->getNumberOfInstancesStopCriterion() ) / log(4.0) + 1.0; + int partitionSizeStop = Cfg::getParamInt("metis.numberOfInstancesStopCriterion",45)->asInt(); + double partitions = log((double)gates / (double)partitionSizeStop) / log(4.0) + 1.0; return (unsigned int)(partitions); } diff --git a/metis/src/metis/Configuration.h b/metis/src/metis/Configuration.h index 48fec4cf..09617a3b 100644 --- a/metis/src/metis/Configuration.h +++ b/metis/src/metis/Configuration.h @@ -85,13 +85,10 @@ namespace Metis { , DebugMultRuns =8 // Debug multiple runs stage. , DebugMoreMultRuns =16 // More debug of the multiple runs stage. }; - public: - static Configuration* getDefault (); public: // Constructor & Destructor. Configuration (); ~Configuration (); - Configuration* clone () const; // Methods. void print ( Cell* ) const; inline RefreshCb_t& getRefreshCb (); @@ -112,7 +109,6 @@ namespace Metis { std::string _getTypeName () const; private: // Attributes. - static Configuration* _default; RefreshCb_t _refreshCb; bool _partOrKWayHMetis; // True for Recursive 2-part, false for KWay. unsigned int _numberOfInstancesStopCriterion; // Minimal number of instances to partition.