From 936998cff25863f50ae6fc42326e25e1c16879b9 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 28 Apr 2010 15:46:31 +0000 Subject: [PATCH] * 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. * ./unicorn: - New: "--show-conf" options to dump the current configuration. --- unicorn/CMakeLists.txt | 18 +++++++++--------- unicorn/src/CgtMain.cpp | 22 ++++++++++++++++++---- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt index ca927540..f383d452 100644 --- a/unicorn/CMakeLists.txt +++ b/unicorn/CMakeLists.txt @@ -32,15 +32,6 @@ ENDIF(COMMAND CMAKE_POLICY) # This macro has to be included in all the tools CMakeLists.txt as it's # the sole means of localizing other tools/projects. 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 "") ) MESSAGE("-- ${project}_TOP is set to $ENV{${project}_TOP}") SET(PROJECT_MODULE_PATH "$ENV{${project}_TOP}/share/cmake_modules/") @@ -49,6 +40,15 @@ MACRO(SETUP_PROJECT_PATHS project) LIST(INSERT CMAKE_MODULE_PATH 0 "${PROJECT_MODULE_PATH}") ENDIF( DIR_INDEX LESS 0) 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) SETUP_PROJECT_PATHS(IO) diff --git a/unicorn/src/CgtMain.cpp b/unicorn/src/CgtMain.cpp index aeaa07ac..402a2e49 100644 --- a/unicorn/src/CgtMain.cpp +++ b/unicorn/src/CgtMain.cpp @@ -2,7 +2,7 @@ // -*- C++ -*- // // 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 // // =================================================================== // @@ -23,6 +23,7 @@ // x-----------------------------------------------------------------x +#include #include using namespace std; @@ -110,11 +111,13 @@ int main ( int argc, char *argv[] ) try { float edgeCapacity; + float expandStep; unsigned long eventsLimit; unsigned int traceLevel; bool verbose1; bool verbose2; bool info; + bool showConf; bool coreDump; bool logMode; bool textMode; @@ -131,6 +134,8 @@ int main ( int argc, char *argv[] ) , "Second level of verbosity.") ( "info,i" , poptions::bool_switch(&info)->default_value(false) , "Lots of informational messages.") + ( "show-conf" , poptions::bool_switch(&showConf)->default_value(false) + , "Print Kite configuration settings.") ( "core-dump,D" , poptions::bool_switch(&coreDump)->default_value(false) , "Enable core dumping.") ( "log-mode,L" , poptions::bool_switch(&logMode)->default_value(false) @@ -146,6 +151,8 @@ int main ( int argc, char *argv[] ) , "The tool to be run, in text mode." ) ( "edge,e" , poptions::value(&edgeCapacity)->default_value(0.65) , "The egde density ratio applied on global router's edges." ) + ( "expand-step" , poptions::value(&expandStep)->default_value(0.40) + , "The density delta above which GCells are aggregateds." ) ( "events-limit" , poptions::value(&eventsLimit) , "The maximum number of iterations (events) that the router is" "allowed to perform." ) @@ -187,8 +194,13 @@ int main ( int argc, char *argv[] ) } } - Kite::Configuration::setDefaultEdgeCapacity ( edgeCapacity ); - //KnikEngine::setEdgeCapacityPercent ( edgeCapacity ); + Kite::Configuration::getDefault()->setEdgeCapacityPercent ( edgeCapacity ); + + if ( arguments.count("events-limit") ) + Kite::Configuration::getDefault()->setEventsLimit ( eventsLimit ); + + if ( arguments.count("expand-step") ) + Kite::Configuration::getDefault()->setExpandStep ( expandStep ); if ( cell ) { // addaccu. @@ -302,7 +314,9 @@ int main ( int argc, char *argv[] ) : Kite::BuildGlobalSolution; static vector routingNets; - KiteEngine* kite = KiteEngine::create ( af->getRoutingGauge(), cell ); + KiteEngine* kite = KiteEngine::create ( cell ); + kite->getConfiguration()->setExpandStep ( expandStep ); + if ( showConf ) kite->printConfiguration (); kite->runGlobalRouter ( globalFlags ); if ( saveGlobal ) kite->saveGlobalSolution ();