* ./kite:

- Bug: In Cs1Candidate::consolidate(), the loop on the conflicting segment was
        going one step to far. "i" must be bound to _conflicts.size()-1. 
    - Change: kite-text is renamed into kite.bin. It features the router only
        with a subset of options consistent with cgt (python). Mainly used for
        debugging purposes (gdb, valgrind, ...).
This commit is contained in:
Jean-Paul Chaput 2012-12-09 11:18:38 +00:00
parent 08b7e3971f
commit 73b2ba6105
3 changed files with 98 additions and 119 deletions

View File

@ -96,13 +96,13 @@
OUTPUT_NAME "Kite" OUTPUT_NAME "Kite"
) )
add_executable ( kite-text ${kitecpps} ) add_executable ( kite.bin ${kitecpps} )
target_link_libraries ( kite-text kite ) target_link_libraries ( kite.bin kite )
target_link_libraries ( pyKite kite target_link_libraries ( pyKite kite
${CORIOLIS_PYTHON_LIBRARIES} ${CORIOLIS_PYTHON_LIBRARIES}
) )
install ( TARGETS kite DESTINATION lib${LIB_SUFFIX} ) install ( TARGETS kite DESTINATION lib${LIB_SUFFIX} )
install ( TARGETS kite-text DESTINATION bin ) install ( TARGETS kite.bin DESTINATION bin )
install ( TARGETS pyKite DESTINATION ${PYTHON_SITE_PACKAGES} ) install ( TARGETS pyKite DESTINATION ${PYTHON_SITE_PACKAGES} )
install ( FILES ${includes} install ( FILES ${includes}

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-2009, All Rights Reserved // Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved
// //
// =================================================================== // +-----------------------------------------------------------------+
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | C O R I O L I S | // | C O R I O L I S |
// | K i t e - D e t a i l e d R o u t e r | // | K i t e - D e t a i l e d R o u t e r |
// | | // | |
@ -17,28 +12,25 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./KiteMain.cpp" | // | C++ Module : "./KiteMain.cpp" |
// | *************************************************************** | // +-----------------------------------------------------------------+
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include <memory> #include <memory>
using namespace std; using namespace std;
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
namespace poptions = boost::program_options; namespace bopts = boost::program_options;
#include "vlsisapd/configuration/Configuration.h"
#include "hurricane/DebugSession.h" #include "hurricane/DebugSession.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/UpdateSession.h" #include "hurricane/UpdateSession.h"
#include "hurricane/viewer/HApplication.h"
#include "hurricane/viewer/Graphics.h"
using namespace Hurricane; using namespace Hurricane;
#include "crlcore/Utilities.h" #include "crlcore/Utilities.h"
#include "crlcore/Banner.h"
#include "crlcore/AllianceFramework.h" #include "crlcore/AllianceFramework.h"
#include "crlcore/Hierarchy.h" #include "crlcore/Hierarchy.h"
#include "crlcore/ToolBox.h" #include "crlcore/ToolBox.h"
@ -51,41 +43,6 @@ using namespace Knik;
using namespace Kite; using namespace Kite;
namespace {
// -------------------------------------------------------------------
// Function : "printHelp()".
void printHelp ()
{
cout << endl;
cout << "Usage: kite [-v|--verbose] [-V|--very-verbose] [-D|--core-dump] \\\n"
<< " [-l|--trace-level <traceLevel>] [-c|--cell <cellName>] \\\n"
<< endl;
cout << "Options:\n"
<< " o [-v|--verbose] : First level of verbosity.\n"
<< " o [-V|--very-verbose] : Second level of verbosity (very talkative).\n"
<< " o [-D|--core-dump] : Enable core dumping.\n"
<< " o [-l|--trace-level <traceLevel>] :\n"
<< " Sets the level of trace, trace messages with a level superior to\n"
<< " <traceLevel> will be printed on <stderr>.\n"
<< " o [-c|--cell <cellName>] :\n"
<< " The name of the Cell to load, without extention.\n"
<< endl;
}
} // End of anonymous namespace.
// x-----------------------------------------------------------------x
// | Fonctions Definitions |
// x-----------------------------------------------------------------x
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Function : "main()". // Function : "main()".
@ -95,58 +52,84 @@ int main ( int argc, char *argv[] )
bool kiteSuccess = false; bool kiteSuccess = false;
try { try {
float edgeCapacity; Banner banner( "Kite"
, "1.0b"
, "Coriolis Router"
, "2008"
, "Jean-Paul Chaput"
, ""
);
unsigned int traceLevel; unsigned int traceLevel;
bool verbose1; bool verbose1;
bool verbose2; bool verbose2;
bool showConf;
bool info; bool info;
bool bug;
bool coreDump; bool coreDump;
bool logMode; bool logMode;
bool loadGlobal; bool loadGlobal;
bool saveDesign; bool dumpMeasures;
bool saveGlobal;
bool destroyDatabase;
poptions::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." )
( "verbose,v" , poptions::bool_switch(&verbose1)->default_value(false) ( "verbose,v" , bopts::bool_switch(&verbose1)->default_value(false)
, "First level of verbosity.") , "First level of verbosity.")
( "very-verbose,V", poptions::bool_switch(&verbose2)->default_value(false) ( "very-verbose,V" , bopts::bool_switch(&verbose2)->default_value(false)
, "Second level of verbosity.") , "Second level of verbosity.")
( "info,i" , poptions::bool_switch(&info)->default_value(false) ( "show-conf" , bopts::bool_switch(&showConf)->default_value(false)
, "Print Kite configuration settings.")
( "info,i" , bopts::bool_switch(&info)->default_value(false)
, "Lots of informational messages.") , "Lots of informational messages.")
( "core-dump,D" , poptions::bool_switch(&coreDump)->default_value(false) ( "bug,b" , bopts::bool_switch(&bug)->default_value(false)
, "Enable core dumping.") , "Display bug related messages.")
( "log-mode,L" , poptions::bool_switch(&logMode)->default_value(false) ( "log-mode,L" , bopts::bool_switch(&logMode)->default_value(false)
, "Disable ANSI escape sequences displaying.") , "Disable ANSI escape sequences displaying.")
( "global,g" , poptions::bool_switch(&loadGlobal)->default_value(false) ( "trace-level,l" , bopts::value<unsigned int>(&traceLevel)->default_value(1000)
, "Reload the global routing from disk.")
( "trace-level,l" , poptions::value<unsigned int>(&traceLevel)->default_value(1000)
, "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>." )
( "edge,e" , poptions::value<float>(&edgeCapacity)->default_value(65.0) ( "core-dump,D" , bopts::bool_switch(&coreDump)->default_value(false)
, "The egde density ratio applied on global router's edges." ) , "Enable core dumping.")
( "cell,c" , poptions::value<string>() ( "load-global,g" , bopts::bool_switch(&loadGlobal)->default_value(false)
, "Do *not* run the global router (Knik), reuse previous routing (.kgr).")
( "save-global" , bopts::bool_switch(&saveGlobal)->default_value(false)
, "Save the global routing solution.")
( "dump-measures,M", bopts::bool_switch(&dumpMeasures)->default_value(false)
, "Dump statistical measurements on the disk.")
( "cell,c" , bopts::value<string>()
, "The name of the cell to load, without extension." ) , "The name of the cell to load, without extension." )
( "save,s" , poptions::bool_switch(&saveDesign)->default_value(false) ( "save-design,s" , bopts::value<string>()
, "Save the routed design."); , "Save the routed design under the given name.")
( "destroy-db" , bopts::bool_switch(&destroyDatabase)->default_value(false)
, "Perform a complete deletion of the database (may be buggy).");
poptions::variables_map arguments; bopts::variables_map arguments;
poptions::store ( poptions::parse_command_line(argc,argv,options), arguments ); bopts::store ( bopts::parse_command_line(argc,argv,options), arguments );
poptions::notify ( arguments ); bopts::notify ( arguments );
if ( arguments.count("help") or not arguments.count("cell") ) { if ( arguments.count("help") or not arguments.count("cell") ) {
cout << banner << endl;
cout << options << endl; cout << options << endl;
exit ( 0 ); exit ( 0 );
} }
System::get()->setCatchCore ( not coreDump ); Cfg::Configuration::pushDefaultPriority( Cfg::Parameter::CommandLine );
if (arguments["core-dump" ].as<bool>()) Cfg::getParamBool("misc.catchCore" )->setBool( false );
if (arguments["verbose" ].as<bool>()) Cfg::getParamBool("misc.verboseLevel1")->setBool( true );
if (arguments["very-verbose"].as<bool>()) Cfg::getParamBool("misc.verboseLevel2")->setBool( true );
if (arguments["info" ].as<bool>()) Cfg::getParamBool("misc.info" )->setBool( true );
if (arguments["bug" ].as<bool>()) Cfg::getParamBool("misc.bug" )->setBool( true );
if (arguments["log-mode" ].as<bool>()) Cfg::getParamBool("misc.logMode" )->setBool( true );
if (arguments["show-conf" ].as<bool>()) Cfg::getParamBool("misc.showConf" )->setBool( true );
if ( verbose1 ) mstream::enable ( mstream::VerboseLevel1 ); if (arguments.count("trace-level" )) Cfg::getParamInt("misc.traceLevel")->setInt( traceLevel );
if ( verbose2 ) mstream::enable ( mstream::VerboseLevel2 ); Cfg::Configuration::popDefaultPriority();
if ( info ) mstream::enable ( mstream::Info );
if ( logMode ) tty::disable ();
ltracelevel ( traceLevel ); cmess1 << banner << endl;
showConf = Cfg::getParamBool("misc.showConf")->asBool();
dbo_ptr<DataBase> db ( DataBase::create() ); dbo_ptr<DataBase> db ( DataBase::create() );
dbo_ptr<AllianceFramework> af ( AllianceFramework::create() ); dbo_ptr<AllianceFramework> af ( AllianceFramework::create() );
@ -154,53 +137,44 @@ int main ( int argc, char *argv[] )
if ( arguments.count("cell") ) { if ( arguments.count("cell") ) {
cell = af->getCell( arguments["cell"].as<string>().c_str(), Catalog::State::Views ); cell = af->getCell( arguments["cell"].as<string>().c_str(), Catalog::State::Views );
if (!cell) { if (not cell) {
cerr << af->getPrint() << endl; cerr << af->getPrint() << endl;
cerr << "[ERROR] Cell not found: " << arguments["cell"].as<string>() << endl; cerr << "[ERROR] Cell not found: " << arguments["cell"].as<string>() << endl;
exit ( 2 ); exit ( 2 );
} }
} }
//Kite::Configuration::getDefault()->setEdgeCapacityPercent ( edgeCapacity ); KatabaticEngine::NetSet routingNets;
unsigned int globalFlags = (loadGlobal) ? Kite::LoadGlobalSolution
: Kite::BuildGlobalSolution;
cell->flattenNets ( not arguments.count("global") );
KnikEngine* knik = KnikEngine::create ( cell );
if ( not loadGlobal ) {
knik->run ();
} else {
knik->createRoutingGraph ();
knik->loadSolution ();
}
static KatabaticEngine::NetSet routingNets;
KiteEngine* kite = KiteEngine::create( cell ); KiteEngine* kite = KiteEngine::create( cell );
// kite->setSaturateRatio ( 0.85 ); if (showConf) kite->printConfiguration();
// kite->setExpandStep ( 0.20 );
// kite->setRipupCost ( 3 ); kite->runGlobalRouter( globalFlags );
// kite->setRipupLimit ( Configuration::BorderRipupLimit, 25 ); if (saveGlobal) kite->saveGlobalSolution ();
// kite->setRipupLimit ( Configuration::StrapRipupLimit , 15 );
// kite->setRipupLimit ( Configuration::LocalRipupLimit , 5 );
// kite->setRipupLimit ( Configuration::GlobalRipupLimit, 5 );
// kite->setRipupLimit ( Configuration::LongGlobalRipupLimit, 5 );
kite->runGlobalRouter ( Kite::LoadGlobalSolution );
kite->loadGlobalRouting( Katabatic::LoadGrByNet, routingNets ); kite->loadGlobalRouting( Katabatic::LoadGrByNet, routingNets );
kite->layerAssign ( Katabatic::NoNetLayerAssign ); kite->layerAssign ( Katabatic::NoNetLayerAssign );
kite->runNegociate (); kite->runNegociate ();
kiteSuccess = kite->getToolSuccess(); kiteSuccess = kite->getToolSuccess();
kite->finalizeLayout (); kite->finalizeLayout ();
kite->destroy ();
knik->destroy ();
if ( saveDesign ) { if (dumpMeasures) kite->dumpMeasures();
string name = getString(cell->getName()) + "_kite"; kite->destroy();
if (arguments.count("save-design")) {
string name = arguments["save-design"].as<string>();
cell->setName ( name ); cell->setName ( name );
af->saveCell ( cell, Catalog::State::Physical ); af->saveCell ( cell, Catalog::State::Physical );
} }
returnCode = (kiteSuccess) ? 0 : 1; returnCode = (kiteSuccess) ? 0 : 1;
if (not destroyDatabase) exit( returnCode );
cmess1 << " o Full database deletion (may be buggy)." << endl;
} }
catch ( poptions::error& e ) { catch ( bopts::error& e ) {
cerr << "[ERROR] " << e.what() << endl; cerr << "[ERROR] " << e.what() << endl;
exit ( 1 ); exit ( 1 );
} }
@ -208,6 +182,10 @@ int main ( int argc, char *argv[] )
cerr << e.what() << endl; cerr << e.what() << endl;
exit ( 1 ); exit ( 1 );
} }
catch ( exception& e ) {
cerr << "[ERROR] " << e.what() << endl;
exit ( 1 );
}
catch ( ... ) { catch ( ... ) {
cout << "[ERROR] Abnormal termination: unmanaged exception.\n" << endl; cout << "[ERROR] Abnormal termination: unmanaged exception.\n" << endl;
exit ( 2 ); exit ( 2 );

View File

@ -290,13 +290,14 @@ namespace {
if ( _conflicts.size() > 0 ) { if ( _conflicts.size() > 0 ) {
DbU::Unit halfConflict = 0; DbU::Unit halfConflict = 0;
size_t i = 0; size_t i = 0;
for ( ; i<_conflicts.size() ; ++i ) { for ( ; i<_conflicts.size()-1 ; ++i ) {
halfConflict += _conflicts.size(); halfConflict += _conflicts.size();
if ( halfConflict > _conflictLength/2 ) if ( halfConflict > _conflictLength/2 )
break; break;
} }
// Ugly: hard-coded pitch. // Ugly: hard-coded pitch.
cerr << "_conflicts.size():" << _conflicts.size() << " " << i << endl;
_breakPos = _conflicts[i].getVMin() - DbU::lambda(5.0); _breakPos = _conflicts[i].getVMin() - DbU::lambda(5.0);
} }
} }