From 66f8960c4fa9d7023186926d081c306926c4bfe0 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 18 Aug 2010 20:27:18 +0000 Subject: [PATCH] * ./unicorn: - New: Integrate Ispd04, Iccad04 and LEF/DEF import/export capabilites. - Change: Remove LEF/DEF options from open/save cells (now managet though import/export). --- unicorn/src/CMakeLists.txt | 10 +++--- unicorn/src/CgtMain.cpp | 54 +++++++++++++++++++++++++++- unicorn/src/OpenCellDialog.cpp | 10 ++++-- unicorn/src/SaveCellDialog.cpp | 11 +++--- unicorn/src/UnicornGui.cpp | 2 +- unicorn/src/unicorn/OpenCellDialog.h | 3 -- unicorn/src/unicorn/SaveCellDialog.h | 3 -- 7 files changed, 74 insertions(+), 19 deletions(-) diff --git a/unicorn/src/CMakeLists.txt b/unicorn/src/CMakeLists.txt index 69a51263..aba1c07c 100644 --- a/unicorn/src/CMakeLists.txt +++ b/unicorn/src/CMakeLists.txt @@ -4,8 +4,10 @@ include ( ${QT_USE_FILE} ) include_directories ( ${HURRICANE_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR} + ${BOOKSHELF_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} + ${LEFDEF_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH} ) add_definitions ( -DSYS_CONF_DIR=\\"${SYS_CONF_DIR}\\" ) @@ -45,6 +47,7 @@ ${HURRICANE_PYTHON_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${HURRICANE_LIBRARIES} + ${BOOKSHELF_LIBRARY} ${AGDS_LIBRARY} ${CIF_LIBRARY} ${CONFIGURATION_LIBRARY} @@ -58,8 +61,7 @@ ) add_executable ( cgt ${cgtcpp} ) target_link_libraries ( cgt unicorn ) - install ( TARGETS unicorn DESTINATION lib${LIB_SUFFIX} ) - install ( TARGETS cgt DESTINATION bin ) - install ( FILES ${includes} - ${mocIncludes} DESTINATION include/coriolis2/unicorn ) + install ( TARGETS unicorn DESTINATION lib${LIB_SUFFIX} ) + install ( TARGETS cgt DESTINATION bin ) + install ( FILES ${mocIncludes} DESTINATION include/coriolis2/unicorn ) diff --git a/unicorn/src/CgtMain.cpp b/unicorn/src/CgtMain.cpp index 30dcfa05..a2cfcee5 100644 --- a/unicorn/src/CgtMain.cpp +++ b/unicorn/src/CgtMain.cpp @@ -33,6 +33,7 @@ namespace boptions = boost::program_options; #include namespace bfs = boost::filesystem; +#include "vlsisapd/bookshelf/Exception.h" #include "vlsisapd/configuration/Configuration.h" #include "hurricane/DebugSession.h" #include "hurricane/DataBase.h" @@ -54,6 +55,10 @@ using namespace Hurricane; #include "crlcore/AllianceFramework.h" #include "crlcore/Hierarchy.h" #include "crlcore/ToolBox.h" +#include "crlcore/Ispd04Bookshelf.h" +#include "crlcore/Iccad04Lefdef.h" +#include "crlcore/DefImport.h" +#include "crlcore/DefExport.h" using namespace CRL; #include "nimbus/NimbusEngine.h" @@ -110,6 +115,8 @@ int main ( int argc, char *argv[] ) bool detailedRoute; bool loadGlobal; bool saveGlobal; + bool exportDef; + bool saveImport; boptions::options_description options ("Command line arguments & options"); options.add_options() @@ -159,7 +166,17 @@ int main ( int argc, char *argv[] ) ( "cell,c" , boptions::value() , "The name of the cell to load, whithout extension." ) ( "save-design,s" , boptions::value() - , "Save the routed design."); + , "Save the routed design.") + ( "export-def" , boptions::bool_switch(&exportDef)->default_value(false) + , "Export the design in DEF format.") + ( "import-def" , boptions::value() + , "Import the design in DEF format.") + ( "importk-ispd04-bk" , boptions::value() + , "The name of the ISPD04 benchmark to import (Bookshelf .aux), whithout extension." ) + ( "import-iccad04-def" , boptions::value() + , "The name of the ICCAD04 benchmark to import (LEF/DEF), whithout extension." ) + ( "save-import" , boptions::bool_switch(&saveImport)->default_value(false) + , "Save of the imported design immediatly after loading."); boptions::variables_map arguments; boptions::store ( boptions::parse_command_line(argc,argv,options), arguments ); @@ -212,6 +229,31 @@ int main ( int argc, char *argv[] ) detailedRoute = false; } + if ( (cell == NULL) and arguments.count("import-def") ) { + cell = DefImport::load ( arguments["import-def"].as().c_str() + , DefImport::FitAbOnCells + ); + } + + if ( (cell == NULL) and arguments.count("import-iccad04-def") ) { + cell = Iccad04Lefdef::load ( arguments["import-iccad04-def"].as().c_str() + , 0 + ); + } + + if ( (cell == NULL) and arguments.count("import-ispd04-bk") ) { + cell = Ispd04::load ( arguments["import-ispd04-bk"].as().c_str() ); + } + + if ( saveImport and (cell != NULL) ) { + cmess1 << " o Immediate write back of <" << cell->getName() << ">" << endl; + af->saveCell ( cell, Catalog::State::Views ); + } + + if ( (cell != NULL) and exportDef ) { + DefExport::drive ( cell, DefExport::WithLEF ); + } + if ( arguments.count("margin") ) Cfg::getParamPercentage("nimbus.spaceMargin")->setPercentage ( margin ); @@ -337,6 +379,12 @@ int main ( int argc, char *argv[] ) // eFPGA/16x16. //DebugSession::addToTrace ( cell, "group_15_6_clb_topside_in1_mux_q01" ); //DebugSession::addToTrace ( cell, "g_7_14_top_2" ); + // ibm01. + //DebugSession::addToTrace ( cell, "NET2648" ); + //DebugSession::addToTrace ( cell, "NET2881" ); + //DebugSession::addToTrace ( cell, "NET2530" ); + //DebugSession::addToTrace ( cell, "NET8464" ); + //DebugSession::addToTrace ( cell, "NET8242" ); // Python Script test. @@ -467,6 +515,10 @@ int main ( int argc, char *argv[] ) cerr << "[ERROR] " << e.what() << endl; exit ( 1 ); } + catch ( Bookshelf::Exception& e ) { + cerr << e.what() << endl; + exit ( 1 ); + } catch ( exception& e ) { cerr << "[ERROR] " << e.what() << endl; exit ( 1 ); diff --git a/unicorn/src/OpenCellDialog.cpp b/unicorn/src/OpenCellDialog.cpp index 6f858cc8..30f1029d 100644 --- a/unicorn/src/OpenCellDialog.cpp +++ b/unicorn/src/OpenCellDialog.cpp @@ -87,6 +87,7 @@ namespace Unicorn { hLayout1->addWidget ( cancelButton ); hLayout1->addStretch (); +#if DEPRECATED QFrame* separator = new QFrame (); separator->setFrameShape ( QFrame::HLine ); separator->setFrameShadow ( QFrame::Sunken ); @@ -107,6 +108,7 @@ namespace Unicorn { formatGroup->setId ( formatButton, 1 ); formatGroup->addButton ( formatButton ); hLayout2->addWidget ( formatButton ); +#endif // DEPRECATED QVBoxLayout* vLayout = new QVBoxLayout (); vLayout->setSizeConstraint ( QLayout::SetFixedSize ); @@ -114,15 +116,15 @@ namespace Unicorn { vLayout->addWidget ( _lineEdit ); vLayout->addWidget ( _viewerCheckBox ); vLayout->addLayout ( hLayout1 ); - vLayout->addWidget ( separator ); - vLayout->addLayout ( hLayout2 ); + //vLayout->addWidget ( separator ); + //vLayout->addLayout ( hLayout2 ); setLayout ( vLayout ); //setModal ( true ); connect ( okButton, SIGNAL(clicked()) , this, SLOT(accept()) ); connect ( cancelButton, SIGNAL(clicked()) , this, SLOT(reject()) ); - connect ( formatGroup , SIGNAL(buttonClicked(int)), this, SLOT(formatChanged(int)) ); + //connect ( formatGroup , SIGNAL(buttonClicked(int)), this, SLOT(formatChanged(int)) ); } @@ -152,6 +154,7 @@ namespace Unicorn { } +#if DEPRECATED void OpenCellDialog::formatChanged ( int index ) { Environment* environment = AllianceFramework::get()->getEnvironment(); @@ -168,6 +171,7 @@ namespace Unicorn { cerr << Warning("Unknown input format: %d.",index) << endl; } } +#endif } // End of Unicorn namespace. diff --git a/unicorn/src/SaveCellDialog.cpp b/unicorn/src/SaveCellDialog.cpp index e14f4db4..2aa606bf 100644 --- a/unicorn/src/SaveCellDialog.cpp +++ b/unicorn/src/SaveCellDialog.cpp @@ -87,9 +87,9 @@ namespace Unicorn { separator->setFrameShape ( QFrame::HLine ); separator->setFrameShadow ( QFrame::Sunken ); +#if DEPRECATED QHBoxLayout* hLayout2 = new QHBoxLayout (); QButtonGroup* formatGroup = new QButtonGroup (); - QRadioButton* formatButton = new QRadioButton (); formatButton->setText ( tr("vst/ap") ); formatButton->setChecked ( true ); @@ -103,21 +103,22 @@ namespace Unicorn { formatGroup->setId ( formatButton, 1 ); formatGroup->addButton ( formatButton ); hLayout2->addWidget ( formatButton ); +#endif QVBoxLayout* vLayout = new QVBoxLayout (); vLayout->setSizeConstraint ( QLayout::SetFixedSize ); vLayout->addWidget ( label ); vLayout->addWidget ( _lineEdit ); vLayout->addLayout ( hLayout1 ); - vLayout->addWidget ( separator ); - vLayout->addLayout ( hLayout2 ); + //vLayout->addWidget ( separator ); + //vLayout->addLayout ( hLayout2 ); setLayout ( vLayout ); //setModal ( true ); connect ( okButton, SIGNAL(clicked()) , this, SLOT(accept()) ); connect ( cancelButton, SIGNAL(clicked()) , this, SLOT(reject()) ); - connect ( formatGroup , SIGNAL(buttonClicked(int)), this, SLOT(formatChanged(int)) ); + //connect ( formatGroup , SIGNAL(buttonClicked(int)), this, SLOT(formatChanged(int)) ); } @@ -145,6 +146,7 @@ namespace Unicorn { } +#if DEPRECATED void SaveCellDialog::formatChanged ( int index ) { Environment* environment = AllianceFramework::get()->getEnvironment(); @@ -161,6 +163,7 @@ namespace Unicorn { cerr << Warning("Unknown output format: %d.",index) << endl; } } +#endif } // End of Unicorn namespace. diff --git a/unicorn/src/UnicornGui.cpp b/unicorn/src/UnicornGui.cpp index d49370ab..e5b87f65 100644 --- a/unicorn/src/UnicornGui.cpp +++ b/unicorn/src/UnicornGui.cpp @@ -172,7 +172,7 @@ namespace Unicorn { if ( SaveCellDialog::runDialog ( this, cellName ) ) { renameCell ( cellName.toStdString().c_str() ); - AllianceFramework::get()->saveCell ( cell, Catalog::State::Physical ); + AllianceFramework::get()->saveCell ( cell, Catalog::State::Views ); } } diff --git a/unicorn/src/unicorn/OpenCellDialog.h b/unicorn/src/unicorn/OpenCellDialog.h index a95c44de..fd6b4f19 100644 --- a/unicorn/src/unicorn/OpenCellDialog.h +++ b/unicorn/src/unicorn/OpenCellDialog.h @@ -44,9 +44,6 @@ namespace Unicorn { bool newViewerRequest () const; protected: OpenCellDialog ( QWidget* parent=NULL ); - protected slots: - void formatChanged ( int ); - protected: QLineEdit* _lineEdit; QCheckBox* _viewerCheckBox; diff --git a/unicorn/src/unicorn/SaveCellDialog.h b/unicorn/src/unicorn/SaveCellDialog.h index 079c23d2..9ae087f1 100644 --- a/unicorn/src/unicorn/SaveCellDialog.h +++ b/unicorn/src/unicorn/SaveCellDialog.h @@ -45,9 +45,6 @@ namespace Unicorn { void setCellName ( const QString& ); protected: SaveCellDialog ( QWidget* parent=NULL ); - protected slots: - void formatChanged ( int ); - protected: QLineEdit* _lineEdit; };