* ./unicorn:

- Change: In CgtMain, rename the namespace boost::program_options from boptions
        to bopts (to be identical to KiteMain).
    - Change: In CMakeLists.txt, the C++ binary is renamed from 'cgt-cpp' toward
        cgt.bin, again to follow the same naming scheme as Kite.
This commit is contained in:
Jean-Paul Chaput 2012-12-14 15:36:18 +00:00
parent 793a198a55
commit aa153a04b2
2 changed files with 39 additions and 53 deletions

View File

@ -77,13 +77,12 @@
OUTPUT_NAME "Unicorn" OUTPUT_NAME "Unicorn"
) )
add_executable ( cgt ${cgtcpp} ) add_executable ( cgt.bin ${cgtcpp} )
target_link_libraries ( cgt unicorn ) target_link_libraries ( cgt.bin unicorn )
set_target_properties ( cgt PROPERTIES OUTPUT_NAME "cgt-cpp" )
install ( TARGETS unicorn DESTINATION lib${LIB_SUFFIX} ) install ( TARGETS unicorn DESTINATION lib${LIB_SUFFIX} )
install ( TARGETS pyUnicorn DESTINATION ${PYTHON_SITE_PACKAGES} ) install ( TARGETS pyUnicorn DESTINATION ${PYTHON_SITE_PACKAGES} )
install ( TARGETS cgt DESTINATION bin ) install ( TARGETS cgt.bin DESTINATION bin )
install ( PROGRAMS cgt.py DESTINATION bin RENAME cgt ) install ( PROGRAMS cgt.py DESTINATION bin RENAME cgt )
install ( FILES ${mocincludes} install ( FILES ${mocincludes}
${pyIncludes} DESTINATION include/coriolis2/unicorn ) ${pyIncludes} DESTINATION include/coriolis2/unicorn )

View File

@ -2,14 +2,9 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2011, All Rights Reserved // Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved
//
// ===================================================================
//
// $Id$
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | |
// | C O R I O L I S | // | C O R I O L I S |
// | U n i c o r n - M a i n G U I | // | U n i c o r n - M a i n G U I |
// | | // | |
@ -17,9 +12,6 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./CgtMain.cpp" | // | C++ Module : "./CgtMain.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
@ -29,7 +21,7 @@
using namespace std; using namespace std;
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
namespace boptions = boost::program_options; namespace bopts = boost::program_options;
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
namespace bfs = boost::filesystem; namespace bfs = boost::filesystem;
@ -89,11 +81,6 @@ using namespace Solstice;
using namespace Unicorn; using namespace Unicorn;
// x-----------------------------------------------------------------x
// | Fonctions Definitions |
// x-----------------------------------------------------------------x
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Function : "main()". // Function : "main()".
@ -122,73 +109,73 @@ int main ( int argc, char *argv[] )
bool exportDef; bool exportDef;
bool saveImport; bool saveImport;
boptions::options_description options ("Command line arguments & options"); bopts::options_description options ("Command line arguments & options");
options.add_options() options.add_options()
( "help,h" , "Print this help." ) ( "help,h" , "Print this help." )
( "destroy-db" , boptions::bool_switch(&destroyDatabase)->default_value(false) ( "destroy-db" , bopts::bool_switch(&destroyDatabase)->default_value(false)
, "Perform a complete deletion of the database (may be buggy).") , "Perform a complete deletion of the database (may be buggy).")
( "trace-level,l" , boptions::value<unsigned int>(&traceLevel) ( "trace-level,l" , bopts::value<unsigned int>(&traceLevel)
, "Set the level of trace, trace messages with a level superior to " , "Set the level of trace, trace messages with a level superior to "
"<arg> will be printed on <stderr>." ) "<arg> will be printed on <stderr>." )
( "verbose,v" , boptions::bool_switch() ( "verbose,v" , bopts::bool_switch()
, "First level of verbosity.") , "First level of verbosity.")
( "very-verbose,V" , boptions::bool_switch() ( "very-verbose,V" , bopts::bool_switch()
, "Second level of verbosity.") , "Second level of verbosity.")
( "info,i" , boptions::bool_switch() ( "info,i" , bopts::bool_switch()
, "Lots of informational messages.") , "Lots of informational messages.")
( "show-conf" , boptions::bool_switch() ( "show-conf" , bopts::bool_switch()
, "Print Kite configuration settings.") , "Print Kite configuration settings.")
( "conf" , boptions::value<string>() ( "conf" , bopts::value<string>()
, "An XML configuration file." ) , "An XML configuration file." )
( "core-dump,D" , boptions::bool_switch() ( "core-dump,D" , bopts::bool_switch()
, "Enable core dumping.") , "Enable core dumping.")
( "log-mode,L" , boptions::bool_switch() ( "log-mode,L" , bopts::bool_switch()
, "Disable ANSI escape sequences displaying.") , "Disable ANSI escape sequences displaying.")
( "text,t" , boptions::bool_switch(&textMode)->default_value(false) ( "text,t" , bopts::bool_switch(&textMode)->default_value(false)
, "Run in pure text mode.") , "Run in pure text mode.")
( "stratus-script" , boptions::value<string>() ( "stratus-script" , bopts::value<string>()
, "Status script to run." ) , "Status script to run." )
( "margin,m" , boptions::value<double>(&margin) ( "margin,m" , bopts::value<double>(&margin)
, "Percentage of free area to add to the minimal placement area.") , "Percentage of free area to add to the minimal placement area.")
( "quadri-place,p" , boptions::bool_switch(&quadriPlace)->default_value(false) ( "quadri-place,p" , bopts::bool_switch(&quadriPlace)->default_value(false)
, "Place using quadripartitions then placement legalisation.") , "Place using quadripartitions then placement legalisation.")
( "annealing-place,P" , boptions::bool_switch(&annealingPlace)->default_value(false) ( "annealing-place,P" , bopts::bool_switch(&annealingPlace)->default_value(false)
, "Place using simulated annealing (slow).") , "Place using simulated annealing (slow).")
( "partition-size-stop", boptions::value<unsigned int>(&partitionSizeStop) ( "partition-size-stop", bopts::value<unsigned int>(&partitionSizeStop)
, "Sets the size of a leaf partition (quadripartition stage).") , "Sets the size of a leaf partition (quadripartition stage).")
( "global-route,G" , boptions::bool_switch(&globalRoute)->default_value(false) ( "global-route,G" , bopts::bool_switch(&globalRoute)->default_value(false)
, "Run the global router (Knik).") , "Run the global router (Knik).")
( "load-global,g" , boptions::bool_switch(&loadGlobal)->default_value(false) ( "load-global,g" , bopts::bool_switch(&loadGlobal)->default_value(false)
, "Reload the global routing from disk.") , "Reload the global routing from disk.")
( "save-global" , boptions::bool_switch(&saveGlobal)->default_value(false) ( "save-global" , bopts::bool_switch(&saveGlobal)->default_value(false)
, "Save the global routing solution.") , "Save the global routing solution.")
( "edge,e" , boptions::value<float>(&edgeCapacity) ( "edge,e" , bopts::value<float>(&edgeCapacity)
, "The egde density ratio applied on global router's edges." ) , "The egde density ratio applied on global router's edges." )
( "events-limit" , boptions::value<unsigned long>(&eventsLimit) ( "events-limit" , bopts::value<unsigned long>(&eventsLimit)
, "The maximum number of iterations (events) that the router is" , "The maximum number of iterations (events) that the router is"
"allowed to perform." ) "allowed to perform." )
( "detailed-route,R" , boptions::bool_switch(&detailedRoute)->default_value(false) ( "detailed-route,R" , bopts::bool_switch(&detailedRoute)->default_value(false)
, "Run the detailed router (Kite).") , "Run the detailed router (Kite).")
( "dump-measures,M" , boptions::bool_switch(&dumpMeasures)->default_value(false) ( "dump-measures,M" , bopts::bool_switch(&dumpMeasures)->default_value(false)
, "Dump statistical measurements on the disk.") , "Dump statistical measurements on the disk.")
( "cell,c" , boptions::value<string>() ( "cell,c" , bopts::value<string>()
, "The name of the cell to load, whithout extension." ) , "The name of the cell to load, whithout extension." )
( "save-design,s" , boptions::value<string>() ( "save-design,s" , bopts::value<string>()
, "Save the routed design.") , "Save the routed design.")
( "export-def" , boptions::bool_switch(&exportDef)->default_value(false) ( "export-def" , bopts::bool_switch(&exportDef)->default_value(false)
, "Export the design in DEF format.") , "Export the design in DEF format.")
( "import-def" , boptions::value<string>() ( "import-def" , bopts::value<string>()
, "Import the design in DEF format.") , "Import the design in DEF format.")
( "importk-ispd04-bk" , boptions::value<string>() ( "importk-ispd04-bk" , bopts::value<string>()
, "The name of the ISPD04 benchmark to import (Bookshelf .aux), whithout extension." ) , "The name of the ISPD04 benchmark to import (Bookshelf .aux), whithout extension." )
( "import-iccad04-def" , boptions::value<string>() ( "import-iccad04-def" , bopts::value<string>()
, "The name of the ICCAD04 benchmark to import (LEF/DEF), whithout extension." ) , "The name of the ICCAD04 benchmark to import (LEF/DEF), whithout extension." )
( "save-import" , boptions::bool_switch(&saveImport)->default_value(false) ( "save-import" , bopts::bool_switch(&saveImport)->default_value(false)
, "Save of the imported design immediatly after loading."); , "Save of the imported design immediatly after loading.");
boptions::variables_map arguments; bopts::variables_map arguments;
boptions::store ( boptions::parse_command_line(argc,argv,options), arguments ); bopts::store ( bopts::parse_command_line(argc,argv,options), arguments );
boptions::notify ( arguments ); bopts::notify ( arguments );
if ( arguments.count("help") ) { if ( arguments.count("help") ) {
cout << options << endl; cout << options << endl;
@ -444,7 +431,7 @@ int main ( int argc, char *argv[] )
cerr << "\nProgram stack:\n" << e.where() << endl; cerr << "\nProgram stack:\n" << e.where() << endl;
exit ( 1 ); exit ( 1 );
} }
catch ( boptions::error& e ) { catch ( bopts::error& e ) {
cerr << "[ERROR] " << e.what() << endl; cerr << "[ERROR] " << e.what() << endl;
exit ( 1 ); exit ( 1 );
} }