* ./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).
This commit is contained in:
Jean-Paul Chaput 2010-08-18 20:27:18 +00:00
parent 4dadeb3f63
commit 66f8960c4f
7 changed files with 74 additions and 19 deletions

View File

@ -4,8 +4,10 @@
include ( ${QT_USE_FILE} ) include ( ${QT_USE_FILE} )
include_directories ( ${HURRICANE_INCLUDE_DIR} include_directories ( ${HURRICANE_INCLUDE_DIR}
${CORIOLIS_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR}
${BOOKSHELF_INCLUDE_DIR}
${CONFIGURATION_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
${LEFDEF_INCLUDE_DIR}
${PYTHON_INCLUDE_PATH} ${PYTHON_INCLUDE_PATH}
) )
add_definitions ( -DSYS_CONF_DIR=\\"${SYS_CONF_DIR}\\" ) add_definitions ( -DSYS_CONF_DIR=\\"${SYS_CONF_DIR}\\" )
@ -45,6 +47,7 @@
${HURRICANE_PYTHON_LIBRARIES} ${HURRICANE_PYTHON_LIBRARIES}
${HURRICANE_GRAPHICAL_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES}
${HURRICANE_LIBRARIES} ${HURRICANE_LIBRARIES}
${BOOKSHELF_LIBRARY}
${AGDS_LIBRARY} ${AGDS_LIBRARY}
${CIF_LIBRARY} ${CIF_LIBRARY}
${CONFIGURATION_LIBRARY} ${CONFIGURATION_LIBRARY}
@ -58,8 +61,7 @@
) )
add_executable ( cgt ${cgtcpp} ) add_executable ( cgt ${cgtcpp} )
target_link_libraries ( cgt unicorn ) target_link_libraries ( cgt unicorn )
install ( TARGETS unicorn DESTINATION lib${LIB_SUFFIX} ) install ( TARGETS unicorn DESTINATION lib${LIB_SUFFIX} )
install ( TARGETS cgt DESTINATION bin ) install ( TARGETS cgt DESTINATION bin )
install ( FILES ${includes} install ( FILES ${mocIncludes} DESTINATION include/coriolis2/unicorn )
${mocIncludes} DESTINATION include/coriolis2/unicorn )

View File

@ -33,6 +33,7 @@ namespace boptions = boost::program_options;
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
namespace bfs = boost::filesystem; namespace bfs = boost::filesystem;
#include "vlsisapd/bookshelf/Exception.h"
#include "vlsisapd/configuration/Configuration.h" #include "vlsisapd/configuration/Configuration.h"
#include "hurricane/DebugSession.h" #include "hurricane/DebugSession.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
@ -54,6 +55,10 @@ using namespace Hurricane;
#include "crlcore/AllianceFramework.h" #include "crlcore/AllianceFramework.h"
#include "crlcore/Hierarchy.h" #include "crlcore/Hierarchy.h"
#include "crlcore/ToolBox.h" #include "crlcore/ToolBox.h"
#include "crlcore/Ispd04Bookshelf.h"
#include "crlcore/Iccad04Lefdef.h"
#include "crlcore/DefImport.h"
#include "crlcore/DefExport.h"
using namespace CRL; using namespace CRL;
#include "nimbus/NimbusEngine.h" #include "nimbus/NimbusEngine.h"
@ -110,6 +115,8 @@ int main ( int argc, char *argv[] )
bool detailedRoute; bool detailedRoute;
bool loadGlobal; bool loadGlobal;
bool saveGlobal; bool saveGlobal;
bool exportDef;
bool saveImport;
boptions::options_description options ("Command line arguments & options"); boptions::options_description options ("Command line arguments & options");
options.add_options() options.add_options()
@ -159,7 +166,17 @@ int main ( int argc, char *argv[] )
( "cell,c" , boptions::value<string>() ( "cell,c" , boptions::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" , boptions::value<string>()
, "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<string>()
, "Import the design in DEF format.")
( "importk-ispd04-bk" , boptions::value<string>()
, "The name of the ISPD04 benchmark to import (Bookshelf .aux), whithout extension." )
( "import-iccad04-def" , boptions::value<string>()
, "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::variables_map arguments;
boptions::store ( boptions::parse_command_line(argc,argv,options), arguments ); boptions::store ( boptions::parse_command_line(argc,argv,options), arguments );
@ -212,6 +229,31 @@ int main ( int argc, char *argv[] )
detailedRoute = false; detailedRoute = false;
} }
if ( (cell == NULL) and arguments.count("import-def") ) {
cell = DefImport::load ( arguments["import-def"].as<string>().c_str()
, DefImport::FitAbOnCells
);
}
if ( (cell == NULL) and arguments.count("import-iccad04-def") ) {
cell = Iccad04Lefdef::load ( arguments["import-iccad04-def"].as<string>().c_str()
, 0
);
}
if ( (cell == NULL) and arguments.count("import-ispd04-bk") ) {
cell = Ispd04::load ( arguments["import-ispd04-bk"].as<string>().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") ) if ( arguments.count("margin") )
Cfg::getParamPercentage("nimbus.spaceMargin")->setPercentage ( margin ); Cfg::getParamPercentage("nimbus.spaceMargin")->setPercentage ( margin );
@ -337,6 +379,12 @@ int main ( int argc, char *argv[] )
// eFPGA/16x16. // eFPGA/16x16.
//DebugSession::addToTrace ( cell, "group_15_6_clb_topside_in1_mux_q01" ); //DebugSession::addToTrace ( cell, "group_15_6_clb_topside_in1_mux_q01" );
//DebugSession::addToTrace ( cell, "g_7_14_top_2" ); //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. // Python Script test.
@ -467,6 +515,10 @@ int main ( int argc, char *argv[] )
cerr << "[ERROR] " << e.what() << endl; cerr << "[ERROR] " << e.what() << endl;
exit ( 1 ); exit ( 1 );
} }
catch ( Bookshelf::Exception& e ) {
cerr << e.what() << endl;
exit ( 1 );
}
catch ( exception& e ) { catch ( exception& e ) {
cerr << "[ERROR] " << e.what() << endl; cerr << "[ERROR] " << e.what() << endl;
exit ( 1 ); exit ( 1 );

View File

@ -87,6 +87,7 @@ namespace Unicorn {
hLayout1->addWidget ( cancelButton ); hLayout1->addWidget ( cancelButton );
hLayout1->addStretch (); hLayout1->addStretch ();
#if DEPRECATED
QFrame* separator = new QFrame (); QFrame* separator = new QFrame ();
separator->setFrameShape ( QFrame::HLine ); separator->setFrameShape ( QFrame::HLine );
separator->setFrameShadow ( QFrame::Sunken ); separator->setFrameShadow ( QFrame::Sunken );
@ -107,6 +108,7 @@ namespace Unicorn {
formatGroup->setId ( formatButton, 1 ); formatGroup->setId ( formatButton, 1 );
formatGroup->addButton ( formatButton ); formatGroup->addButton ( formatButton );
hLayout2->addWidget ( formatButton ); hLayout2->addWidget ( formatButton );
#endif // DEPRECATED
QVBoxLayout* vLayout = new QVBoxLayout (); QVBoxLayout* vLayout = new QVBoxLayout ();
vLayout->setSizeConstraint ( QLayout::SetFixedSize ); vLayout->setSizeConstraint ( QLayout::SetFixedSize );
@ -114,15 +116,15 @@ namespace Unicorn {
vLayout->addWidget ( _lineEdit ); vLayout->addWidget ( _lineEdit );
vLayout->addWidget ( _viewerCheckBox ); vLayout->addWidget ( _viewerCheckBox );
vLayout->addLayout ( hLayout1 ); vLayout->addLayout ( hLayout1 );
vLayout->addWidget ( separator ); //vLayout->addWidget ( separator );
vLayout->addLayout ( hLayout2 ); //vLayout->addLayout ( hLayout2 );
setLayout ( vLayout ); setLayout ( vLayout );
//setModal ( true ); //setModal ( true );
connect ( okButton, SIGNAL(clicked()) , this, SLOT(accept()) ); connect ( okButton, SIGNAL(clicked()) , this, SLOT(accept()) );
connect ( cancelButton, SIGNAL(clicked()) , this, SLOT(reject()) ); 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 ) void OpenCellDialog::formatChanged ( int index )
{ {
Environment* environment = AllianceFramework::get()->getEnvironment(); Environment* environment = AllianceFramework::get()->getEnvironment();
@ -168,6 +171,7 @@ namespace Unicorn {
cerr << Warning("Unknown input format: %d.",index) << endl; cerr << Warning("Unknown input format: %d.",index) << endl;
} }
} }
#endif
} // End of Unicorn namespace. } // End of Unicorn namespace.

View File

@ -87,9 +87,9 @@ namespace Unicorn {
separator->setFrameShape ( QFrame::HLine ); separator->setFrameShape ( QFrame::HLine );
separator->setFrameShadow ( QFrame::Sunken ); separator->setFrameShadow ( QFrame::Sunken );
#if DEPRECATED
QHBoxLayout* hLayout2 = new QHBoxLayout (); QHBoxLayout* hLayout2 = new QHBoxLayout ();
QButtonGroup* formatGroup = new QButtonGroup (); QButtonGroup* formatGroup = new QButtonGroup ();
QRadioButton* formatButton = new QRadioButton (); QRadioButton* formatButton = new QRadioButton ();
formatButton->setText ( tr("vst/ap") ); formatButton->setText ( tr("vst/ap") );
formatButton->setChecked ( true ); formatButton->setChecked ( true );
@ -103,21 +103,22 @@ namespace Unicorn {
formatGroup->setId ( formatButton, 1 ); formatGroup->setId ( formatButton, 1 );
formatGroup->addButton ( formatButton ); formatGroup->addButton ( formatButton );
hLayout2->addWidget ( formatButton ); hLayout2->addWidget ( formatButton );
#endif
QVBoxLayout* vLayout = new QVBoxLayout (); QVBoxLayout* vLayout = new QVBoxLayout ();
vLayout->setSizeConstraint ( QLayout::SetFixedSize ); vLayout->setSizeConstraint ( QLayout::SetFixedSize );
vLayout->addWidget ( label ); vLayout->addWidget ( label );
vLayout->addWidget ( _lineEdit ); vLayout->addWidget ( _lineEdit );
vLayout->addLayout ( hLayout1 ); vLayout->addLayout ( hLayout1 );
vLayout->addWidget ( separator ); //vLayout->addWidget ( separator );
vLayout->addLayout ( hLayout2 ); //vLayout->addLayout ( hLayout2 );
setLayout ( vLayout ); setLayout ( vLayout );
//setModal ( true ); //setModal ( true );
connect ( okButton, SIGNAL(clicked()) , this, SLOT(accept()) ); connect ( okButton, SIGNAL(clicked()) , this, SLOT(accept()) );
connect ( cancelButton, SIGNAL(clicked()) , this, SLOT(reject()) ); 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 ) void SaveCellDialog::formatChanged ( int index )
{ {
Environment* environment = AllianceFramework::get()->getEnvironment(); Environment* environment = AllianceFramework::get()->getEnvironment();
@ -161,6 +163,7 @@ namespace Unicorn {
cerr << Warning("Unknown output format: %d.",index) << endl; cerr << Warning("Unknown output format: %d.",index) << endl;
} }
} }
#endif
} // End of Unicorn namespace. } // End of Unicorn namespace.

View File

@ -172,7 +172,7 @@ namespace Unicorn {
if ( SaveCellDialog::runDialog ( this, cellName ) ) { if ( SaveCellDialog::runDialog ( this, cellName ) ) {
renameCell ( cellName.toStdString().c_str() ); renameCell ( cellName.toStdString().c_str() );
AllianceFramework::get()->saveCell ( cell, Catalog::State::Physical ); AllianceFramework::get()->saveCell ( cell, Catalog::State::Views );
} }
} }

View File

@ -44,9 +44,6 @@ namespace Unicorn {
bool newViewerRequest () const; bool newViewerRequest () const;
protected: protected:
OpenCellDialog ( QWidget* parent=NULL ); OpenCellDialog ( QWidget* parent=NULL );
protected slots:
void formatChanged ( int );
protected: protected:
QLineEdit* _lineEdit; QLineEdit* _lineEdit;
QCheckBox* _viewerCheckBox; QCheckBox* _viewerCheckBox;

View File

@ -45,9 +45,6 @@ namespace Unicorn {
void setCellName ( const QString& ); void setCellName ( const QString& );
protected: protected:
SaveCellDialog ( QWidget* parent=NULL ); SaveCellDialog ( QWidget* parent=NULL );
protected slots:
void formatChanged ( int );
protected: protected:
QLineEdit* _lineEdit; QLineEdit* _lineEdit;
}; };