From 8ba0188821d157b3e36e1449a1718ac4a4087a1d Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 9 Mar 2010 15:26:22 +0000 Subject: [PATCH] * ./hurricane/src/hviewer, ./coriolis/src/crlcore, ./coriolis/src/knik, ./coriolis/src/katabatic, ./coriolis/src/kite, ./coriolis/src/equinox, ./coriolis/src/solstice, ./coriolis/src/ispd: - SVN MOVE: Source tree simplification & uniformisation. Now all tools are at the same level, directly under the root of the repository. No more "coriolis/src". --- unicorn/CMakeLists.txt | 49 ++++ unicorn/cmake_modules/CMakeLists.txt | 1 + unicorn/cmake_modules/FindUNICORN.cmake | 47 ++++ unicorn/src/CMakeLists.txt | 62 +++++ unicorn/src/COpenCellDialog.cpp | 173 +++++++++++++ unicorn/src/CgtMain.cpp | 323 ++++++++++++++++++++++++ unicorn/src/Unicorn.qrc | 6 + unicorn/src/UnicornGui.cpp | 157 ++++++++++++ unicorn/src/images/diet-coke.png | Bin 0 -> 5352 bytes unicorn/src/unicorn/COpenCellDialog.h | 61 +++++ unicorn/src/unicorn/UnicornGui.h | 82 ++++++ 11 files changed, 961 insertions(+) create mode 100644 unicorn/CMakeLists.txt create mode 100644 unicorn/cmake_modules/CMakeLists.txt create mode 100644 unicorn/cmake_modules/FindUNICORN.cmake create mode 100644 unicorn/src/CMakeLists.txt create mode 100644 unicorn/src/COpenCellDialog.cpp create mode 100644 unicorn/src/CgtMain.cpp create mode 100644 unicorn/src/Unicorn.qrc create mode 100644 unicorn/src/UnicornGui.cpp create mode 100644 unicorn/src/images/diet-coke.png create mode 100644 unicorn/src/unicorn/COpenCellDialog.h create mode 100644 unicorn/src/unicorn/UnicornGui.h diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt new file mode 100644 index 00000000..1de5ca46 --- /dev/null +++ b/unicorn/CMakeLists.txt @@ -0,0 +1,49 @@ +PROJECT(UNICORN) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0) +IF(COMMAND CMAKE_POLICY) + CMAKE_POLICY(SET CMP0003 NEW) +ENDIF(COMMAND CMAKE_POLICY) + +IF(APPLE) + EXECUTE_PROCESS( + COMMAND sw_vers -productVersion + OUTPUT_VARIABLE OSX_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + MESSAGE(STATUS "OSX_VERSION='${OSX_VERSION}'") + IF(${OSX_VERSION} MATCHES "^10\\.[012345]\\.?") + MESSAGE(STATUS "OSX < 10.6") + ELSE(${OSX_VERSION} MATCHES "^10\\.[012345]\\.?") + SET(CMAKE_OSX_ARCHITECTURES "i386;ppc") # for QT4.5 32bits on snow leopard + ENDIF(${OSX_VERSION} MATCHES "^10\\.[012345]\\.?") +ENDIF(APPLE) + +SET(CMAKE_C_FLAGS_DEBUG "-g -Wall" CACHE STRING "Debug options." FORCE) +SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall" CACHE STRING "Debug options." FORCE) +#SET(CMAKE_LINKER_FLAGS_DEBUG "-pg" CACHE STRING "Debug options." FORCE) +#SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "-pg" CACHE STRING "Debug options." FORCE) +#SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "-pg" CACHE STRING "Debug options." FORCE) +#SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-pg" CACHE STRING "Debug options." FORCE) + +IF(COMMAND CMAKE_POLICY) + CMAKE_POLICY(SET CMP0003 NEW) +ENDIF(COMMAND CMAKE_POLICY) + +SET(CMAKE_MODULE_PATH "$ENV{HURRICANE_TOP}/share/cmake_modules/") + +SET(QT_USE_QTXML "true") + +FIND_PACKAGE(Boost 1.33.1 COMPONENTS program_options REQUIRED) +FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project +FIND_PACKAGE(LEFDEF REQUIRED) +FIND_PACKAGE(HURRICANE REQUIRED) +FIND_PACKAGE(CORIOLIS REQUIRED) +FIND_PACKAGE(KNIK REQUIRED) +FIND_PACKAGE(KATABATIC REQUIRED) +FIND_PACKAGE(KITE REQUIRED) +FIND_PACKAGE(EQUINOX REQUIRED) +FIND_PACKAGE(SOLSTICE REQUIRED) + +SET_LIB_LINK_MODE() + +ADD_SUBDIRECTORY(src) diff --git a/unicorn/cmake_modules/CMakeLists.txt b/unicorn/cmake_modules/CMakeLists.txt new file mode 100644 index 00000000..738728ca --- /dev/null +++ b/unicorn/cmake_modules/CMakeLists.txt @@ -0,0 +1 @@ +install ( FILES FindUNICORN.cmake DESTINATION /share/cmake_modules ) diff --git a/unicorn/cmake_modules/FindUNICORN.cmake b/unicorn/cmake_modules/FindUNICORN.cmake new file mode 100644 index 00000000..6716e8d7 --- /dev/null +++ b/unicorn/cmake_modules/FindUNICORN.cmake @@ -0,0 +1,47 @@ +# - Find the Unicorn includes and libraries. +# The following variables are set if Coriolis is found. If UNICORN is not +# found, UNICORN_FOUND is set to false. +# UNICORN_FOUND - True when the Coriolis include directory is found. +# UNICORN_INCLUDE_DIR - the path to where the Coriolis include files are. +# UNICORN_LIBRARIES - The path to where the Coriolis library files are. + + +SET(UNICORN_INCLUDE_PATH_DESCRIPTION "directory containing the Unicorn include files. E.g /usr/local/include/coriolis or /asim/coriolis/include/coriolis") + +SET(UNICORN_DIR_MESSAGE "Set the UNICORN_INCLUDE_DIR cmake cache entry to the ${UNICORN_INCLUDE_PATH_DESCRIPTION}") + +# don't even bother under WIN32 +IF(UNIX) + + SET(UNICORN_DIR_SEARCH $ENV{CORIOLIS_TOP} $ENV{HURRICANE_TOP}) + # + # Look for an installation. + # + FIND_PATH(UNICORN_INCLUDE_PATH NAMES unicorn/UnicornEngine.h PATHS + # Look in other places. + ${UNICORN_DIR_SEARCH} + PATH_SUFFIXES include/coriolis + # Help the user find it if we cannot. + DOC "The ${UNICORN_INCLUDE_PATH_DESCRIPTION}" + ) + + FIND_LIBRARY(UNICORN_LIBRARY_PATH + NAMES unicorn + PATHS ${UNICORN_DIR_SEARCH} + PATH_SUFFIXES lib + # Help the user find it if we cannot. + DOC "The ${UNICORN_INCLUDE_PATH_DESCRIPTION}" + ) + + FIND_LIBRARY(UNICORN_STATIC_LIBRARY_PATH + NAMES unicorn-static + PATHS ${UNICORN_DIR_SEARCH} + PATH_SUFFIXES lib + # Help the user find it if we cannot. + DOC "The ${UNICORN_INCLUDE_PATH_DESCRIPTION}" + ) + + SET_LIBRARIES_PATH(UNICORN UNICORN) + HURRICANE_CHECK_LIBRARIES(UNICORN) + +ENDIF(UNIX) diff --git a/unicorn/src/CMakeLists.txt b/unicorn/src/CMakeLists.txt new file mode 100644 index 00000000..af1ad50b --- /dev/null +++ b/unicorn/src/CMakeLists.txt @@ -0,0 +1,62 @@ + + include ( ${QT_USE_FILE} ) + include_directories ( ${Boost_INCLUDE_DIRS} + ${HURRICANE_INCLUDE_DIR} + ${CORIOLIS_INCLUDE_DIR} + ) + link_directories ( . ) + + set ( mocincludes unicorn/UnicornGui.h + unicorn/COpenCellDialog.h + ) + set ( cpps COpenCellDialog.cpp + UnicornGui.cpp + ) + set ( cgtcpp CgtMain.cpp ) + + qt4_wrap_cpp ( MOCcpps ${mocincludes} ) + qt4_add_resources ( RCC_SRCS Unicorn.qrc ) + + add_library ( unicorn ${cpps} ${MOCcpps} ) + target_link_libraries ( unicorn ${SOLSTICE_GRAPHICAL_LIBRARIES} + ${SOLSTICE_LIBRARIES} + ${EQUINOX_GRAPHICAL_LIBRARIES} + ${EQUINOX_LIBRARIES} + ${KITE_GRAPHICAL_LIBRARIES} + ${KITE_LIBRARIES} + ${KATABATIC_GRAPHICAL_LIBRARIES} + ${KATABATIC_LIBRARIES} + ${KNIK_GRAPHICAL_LIBRARIES} + ${KNIK_LIBRARIES} + ${CORIOLIS_LIBRARIES} + ${HURRICANE_GRAPHICAL_LIBRARIES} + ${HURRICANE_LIBRARIES} + ${LEFDEF_LIBRARIES} + ${OA_LIBRARIES} + ${QT_LIBRARIES} + ${Boost_LIBRARIES} + ) + add_executable ( cgt ${cgtcpp} ) + target_link_libraries ( cgt unicorn + ${SOLSTICE_GRAPHICAL_LIBRARIES} + ${SOLSTICE_LIBRARIES} + ${EQUINOX_GRAPHICAL_LIBRARIES} + ${EQUINOX_LIBRARIES} + ${KITE_GRAPHICAL_LIBRARIES} + ${KITE_LIBRARIES} + ${KATABATIC_GRAPHICAL_LIBRARIES} + ${KATABATIC_LIBRARIES} + ${KNIK_GRAPHICAL_LIBRARIES} + ${KNIK_LIBRARIES} + ${CORIOLIS_LIBRARIES} + ${HURRICANE_LIBRARIES} + ${HURRICANE_GRAPHICAL_LIBRARIES} + ${OA_LIBRARIES} + ${QT_LIBRARIES} + ${Boost_LIBRARIES} + ) + install ( TARGETS unicorn DESTINATION /lib) + install ( TARGETS cgt DESTINATION /bin ) + install ( FILES ${includes} + ${mocIncludes} DESTINATION /include/coriolis/unicorn ) + diff --git a/unicorn/src/COpenCellDialog.cpp b/unicorn/src/COpenCellDialog.cpp new file mode 100644 index 00000000..33ec917f --- /dev/null +++ b/unicorn/src/COpenCellDialog.cpp @@ -0,0 +1,173 @@ + +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | U n i c o r n - M a i n G U I | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | =============================================================== | +// | C++ Module : "./COpenCellDialog.cpp" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + +#include +using namespace std; + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hurricane/Warning.h" +#include "hurricane/viewer/Graphics.h" + +#include "crlcore/Environment.h" +#include "crlcore/AllianceFramework.h" +#include "unicorn/COpenCellDialog.h" + + +namespace Unicorn { + + + using Hurricane::Warning; + using Hurricane::Graphics; + using CRL::Environment; + using CRL::AllianceFramework; + + +// ------------------------------------------------------------------- +// Class : "COpenCellDialog". + + + COpenCellDialog::COpenCellDialog ( QWidget* parent ) + : QDialog(parent) + , _lineEdit(NULL) + , _viewerCheckBox(NULL) + { + setWindowTitle ( tr("Open Cell") ); + + QLabel* label = new QLabel (); + label->setText ( tr("Enter Cell name (without extention)") ); + label->setFont ( Graphics::getNormalFont(true) ); + + _lineEdit = new QLineEdit (); + _lineEdit->setMinimumWidth ( 400 ); + + _viewerCheckBox = new QCheckBox (); + _viewerCheckBox->setText ( tr("Open in new Viewer") ); + + QPushButton* okButton = new QPushButton (); + okButton->setText ( "OK" ); + okButton->setDefault ( true ); + + QPushButton* cancelButton = new QPushButton (); + cancelButton->setText ( "Cancel" ); + + QHBoxLayout* hLayout1 = new QHBoxLayout (); + hLayout1->addStretch (); + hLayout1->addWidget ( okButton ); + hLayout1->addStretch (); + hLayout1->addWidget ( cancelButton ); + hLayout1->addStretch (); + + QFrame* separator = new QFrame (); + separator->setFrameShape ( QFrame::HLine ); + separator->setFrameShadow ( QFrame::Sunken ); + + QHBoxLayout* hLayout2 = new QHBoxLayout (); + QButtonGroup* formatGroup = new QButtonGroup (); + + QRadioButton* formatButton = new QRadioButton (); + formatButton->setText ( tr("vst/ap") ); + formatButton->setChecked ( true ); + formatGroup->setId ( formatButton, 0 ); + formatGroup->addButton ( formatButton ); + hLayout2->addWidget ( formatButton ); + + formatButton = new QRadioButton (); + formatButton->setText ( tr("DEF") ); + formatButton->setChecked ( false ); + formatGroup->setId ( formatButton, 1 ); + formatGroup->addButton ( formatButton ); + hLayout2->addWidget ( formatButton ); + + QVBoxLayout* vLayout = new QVBoxLayout (); + vLayout->setSizeConstraint ( QLayout::SetFixedSize ); + vLayout->addWidget ( label ); + vLayout->addWidget ( _lineEdit ); + vLayout->addWidget ( _viewerCheckBox ); + vLayout->addLayout ( hLayout1 ); + 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)) ); + } + + + const QString COpenCellDialog::getCellName () const + { + return _lineEdit->text(); + } + + + bool COpenCellDialog::newViewerRequest () const + { + return _viewerCheckBox->isChecked(); + } + + + bool COpenCellDialog::runDialog ( QWidget* parent, QString& name, bool& newViewerRequest ) + { + COpenCellDialog* dialog = new COpenCellDialog ( parent ); + bool dialogResult = (dialog->exec() == Accepted); + + name = dialog->getCellName (); + newViewerRequest = dialog->newViewerRequest (); + + delete dialog; + + return dialogResult; + } + + + void COpenCellDialog::formatChanged ( int index ) + { + Environment* environment = AllianceFramework::get()->getEnvironment(); + switch ( index ) { + case 0: + environment->setIN_LO ( "vst" ); + environment->setIN_PH ( "ap" ); + break; + case 1: + environment->setIN_LO ( "def" ); + environment->setIN_PH ( "def" ); + break; + default: + cerr << Warning("Unknown input format: %d.",index) << endl; + } + } + + +} // End of Unicorn namespace. diff --git a/unicorn/src/CgtMain.cpp b/unicorn/src/CgtMain.cpp new file mode 100644 index 00000000..3dd45cab --- /dev/null +++ b/unicorn/src/CgtMain.cpp @@ -0,0 +1,323 @@ + +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | U n i c o r n - M a i n G U I | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | =============================================================== | +// | C++ Module : "./CgtMain.cpp" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + +#include +using namespace std; + +#include +namespace poptions = boost::program_options; + +#include +#if (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) and not defined (__APPLE__) +# include +#endif + +#include "hurricane/DebugSession.h" +#include "hurricane/DataBase.h" +#include "hurricane/Cell.h" +#include "hurricane/Warning.h" +#include "hurricane/UpdateSession.h" +#include "hurricane/viewer/HApplication.h" +#include "hurricane/viewer/Graphics.h" +using namespace Hurricane; + +#include "crlcore/Utilities.h" +#include "crlcore/AllianceFramework.h" +#include "crlcore/Hierarchy.h" +#include "crlcore/ToolBox.h" +using namespace CRL; + +#include "knik/GraphicKnikEngine.h" +using namespace Knik; + +#include "kite/GraphicKiteEngine.h" +using namespace Kite; + +#include "equinox/GraphicEquinoxEngine.h" +using namespace Equinox; + +#include "solstice/GraphicSolsticeEngine.h" +using namespace Solstice; + +#include "unicorn/UnicornGui.h" +using namespace Unicorn; + + +namespace { + + +// ------------------------------------------------------------------- +// Function : "printHelp()". + + void printHelp () + { + cout << endl; + cout << "Usage: cgt [-v|--verbose] [-V|--very-verbose] [-D|--core-dump] \\\n" + << " [-l|--trace-level ] [-c|--cell ] \\\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 ] :\n" + << " Sets the level of trace, trace messages with a level superior to\n" + << " will be printed on .\n" + << " o [-c|--cell ] :\n" + << " The name of the Cell to load, without extention.\n" + << endl; + } + + +} // End of anonymous namespace. + + + + +// x-----------------------------------------------------------------x +// | Fonctions Definitions | +// x-----------------------------------------------------------------x + + +// ------------------------------------------------------------------- +// Function : "main()". + +int main ( int argc, char *argv[] ) +{ + int returnCode = 0; + bool kiteSuccess = false; + + try { + float edgeCapacity; + unsigned int traceLevel; + bool verbose1; + bool verbose2; + bool info; + bool coreDump; + bool logMode; + bool textMode; + bool loadGlobal; + bool saveGlobal; + bool saveDesign; + + poptions::options_description options ("Command line arguments & options"); + options.add_options() + ( "help,h" , "Print this help." ) + ( "verbose,v" , poptions::bool_switch(&verbose1)->default_value(false) + , "First level of verbosity.") + ( "very-verbose,V", poptions::bool_switch(&verbose2)->default_value(false) + , "Second level of verbosity.") + ( "info,i" , poptions::bool_switch(&info)->default_value(false) + , "Lots of informational messages.") + ( "core-dump,D" , poptions::bool_switch(&coreDump)->default_value(false) + , "Enable core dumping.") + ( "log-mode,L" , poptions::bool_switch(&logMode)->default_value(false) + , "Disable ANSI escape sequences displaying.") + ( "text,t" , poptions::bool_switch(&textMode)->default_value(false) + , "Run in pure text mode.") + ( "global,g" , poptions::bool_switch(&loadGlobal)->default_value(false) + , "Reload the global routing from disk.") + ( "trace-level,l" , poptions::value(&traceLevel)->default_value(1000) + , "Set the level of trace, trace messages with a level superior to " + " will be printed on ." ) + ( "tool,T" , poptions::value() + , "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." ) + ( "cell,c" , poptions::value() + , "The name of the cell to load, whithout extension." ) + ( "save,s" , poptions::bool_switch(&saveDesign)->default_value(false) + , "Save the routed design.") + ( "save-global" , poptions::bool_switch(&saveGlobal)->default_value(false) + , "Save the global routing solution."); + + poptions::variables_map arguments; + poptions::store ( poptions::parse_command_line(argc,argv,options), arguments ); + poptions::notify ( arguments ); + + if ( arguments.count("help") ) { + cout << options << endl; + exit ( 0 ); + } + + System::getSystem()->setCatchCore ( not coreDump ); + + if ( verbose1 ) mstream::enable ( mstream::VerboseLevel1 ); + if ( verbose2 ) mstream::enable ( mstream::VerboseLevel2 ); + if ( info ) mstream::enable ( mstream::Info ); + if ( logMode ) tty::disable (); + + ltracelevel ( traceLevel ); + + dbo_ptr db ( DataBase::create() ); + dbo_ptr af ( AllianceFramework::create() ); + Cell* cell = NULL; + + if ( arguments.count("cell") ) { + cell = af->getCell (arguments["cell"].as().c_str(), Catalog::State::Views ); + if (!cell) { + cerr << af->getPrint() << endl; + cerr << "[ERROR] Cell not found: " << arguments["cell"].as() << endl; + exit ( 2 ); + } + } + + Kite::Configuration::setDefaultEdgeCapacity ( edgeCapacity ); + //KnikEngine::setEdgeCapacityPercent ( edgeCapacity ); + + if ( cell ) { + // addaccu. + //DebugSession::addToTrace ( cell, "sel" ); + //DebugSession::addToTrace ( cell, "auxreg3" ); + //DebugSession::addToTrace ( cell, "auxsc21" ); + //DebugSession::addToTrace ( cell, "ram_nwen" ); + //DebugSession::addToTrace ( cell, "acc_o_down" ); + // model_shift. + //DebugSession::addToTrace ( cell, "c1_2" ); + //DebugSession::addToTrace ( cell, "muxoutput_96" ); + //DebugSession::addToTrace ( cell, "msb" ); + //DebugSession::addToTrace ( cell, "op(0)" ); + //DebugSession::addToTrace ( cell, "i(1)" ); + // rf2r0_32x32. + //DebugSession::addToTrace ( cell, "busa(0)" ); + // amd2901. + //DebugSession::addToTrace ( cell, "acc_q(1)" ); + //DebugSession::addToTrace ( cell, "ram_adra(11)" ); + //DebugSession::addToTrace ( cell, "ram_adri(5)" ); + //DebugSession::addToTrace ( cell, "ram_q2(0)" ); + //DebugSession::addToTrace ( cell, "ram_reg5_nckx" ); + //DebugSession::addToTrace ( cell, "acc_reg_nscanx" ); + //DebugSession::addToTrace ( cell, "acc_o_down" ); + //DebugSession::addToTrace ( cell, "nb(3)" ); + // MIPS microprogrammed. + //DebugSession::addToTrace ( cell, "crsrout_0" ); + //DebugSession::addToTrace ( cell, "dpt_dt_s_30" ); + //DebugSession::addToTrace ( cell, "dpt_wm_rf_dinx_0" ); + //DebugSession::addToTrace ( cell, "dpt_adder_sub_pi_0_10" ); + //DebugSession::addToTrace ( cell, "dpt_ishifter_c0_3" ); + //DebugSession::addToTrace ( cell, "dpt_adder_sub_r_16" ); + //DebugSession::addToTrace ( cell, "dpt_adder_sub_gi_0_24" ); + //DebugSession::addToTrace ( cell, "dpt_ishifter_muxoutput_117" ); + // MIPS pipeline. + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_shift32_rshift_se_muxoutput(98)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_shift32_rshift_se_msb" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_rarith_se(31)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_ct_nxr2_x1_7_sig" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_banc_busa(17)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_instaddbracry_sd_pi_1_17" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_yoper_se(16)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_toper_se(22)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_soper_se(22)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_jadr_sd(14)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_effto_sd(1)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_ioper_rd(30)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_nextpc_rd(1)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_ct_not_kill_se" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_ct_not_opcod_sd_2" ); + //DebugSession::addToTrace ( cell, "rsdnbr_sd(14)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_otheri_sd(20)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_braadr_sd(3)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_seqadr_sd(30)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_data_rm(30)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_ct_not_i_ri(11)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_ct_noa22_x1_61_sig" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_ct_not_opcod_rd(6)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_ct_not_aux190" ); + //DebugSession::addToTrace ( cell, "s_eq_t_sd" ); + //DebugSession::addToTrace ( cell, "i(22)" ); + //DebugSession::addToTrace ( cell, "mips_r3000_1m_dp_mux32_data_o_sm_sel0" ); + // eFPGA/04x04. + //DebugSession::addToTrace ( cell, "group_2_4_nq_mem_45" ); + //DebugSession::addToTrace ( cell, "g_2_1_rig_7" ); + } + + if ( not textMode ) { + auto_ptr qa ( new HApplication(argc,argv) ); +#if (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) and not defined (__APPLE__) + qa->setStyle ( new QGtkStyle() ); +#endif + Graphics::enable (); + + dbo_ptr unicorn ( UnicornGui::create() ); + unicorn->setApplicationName ( QObject::tr("cgt") ); + unicorn->getBanner().setName ( "cgt" ); + unicorn->getBanner().setPurpose ( "Coriolis Graphical Tool" ); + + cmess1 << unicorn->getBanner() << endl; + cmess2 << af->getPrint() << endl; + //unicorn->registerTool ( Knik::GraphicKnikEngine::grab() ); + unicorn->registerTool ( Kite::GraphicKiteEngine::grab() ); + unicorn->setEnableRedrawInterrupt ( true ); + //unicorn->registerTool ( Equinox::GraphicEquinoxEngine::grab() ); + //unicorn->registerTool ( Solstice::GraphicSolsticeEngine::grab() ); + + unicorn->getCellWidget()->setLayerVisible ( "grid", false ); + unicorn->setCell ( cell ); + unicorn->show (); + + returnCode = qa->exec(); + } else { + if ( arguments.count("tool") and (arguments["tool"].as() == "kite") ) { + //cell->flattenNets ( not arguments.count("global") ); + + unsigned int globalFlags = (arguments["global"].as()) ? Kite::LoadGlobalSolution + : Kite::BuildGlobalSolution; + + static vector routingNets; + KiteEngine* kite = KiteEngine::create ( af->getRoutingGauge(), cell ); + kite->runGlobalRouter ( globalFlags ); + if ( saveGlobal ) kite->saveGlobalSolution (); + + kite->loadGlobalRouting ( Katabatic::LoadGrByNet, routingNets ); + kite->layerAssign ( Katabatic::NoNetLayerAssign ); + kite->runNegociate (); + kiteSuccess = kite->getToolSuccess (); + kite->finalizeLayout (); + kite->destroy (); + + if ( saveDesign ) { + string name = getString(cell->getName()) + "_kite"; + cell->setName ( name ); + af->saveCell ( cell, Catalog::State::Physical ); + } + + returnCode = (kiteSuccess) ? 0 : 1; + } + } + } + catch ( poptions::error& e ) { + cerr << "[ERROR] " << e.what() << endl; + exit ( 1 ); + } + catch ( Error& e ) { + cerr << e.what() << endl; + exit ( 1 ); + } + catch ( ... ) { + cout << "[ERROR] Abnormal termination: unmanaged exception.\n" << endl; + exit ( 2 ); + } + + return returnCode; +} diff --git a/unicorn/src/Unicorn.qrc b/unicorn/src/Unicorn.qrc new file mode 100644 index 00000000..4ad78d30 --- /dev/null +++ b/unicorn/src/Unicorn.qrc @@ -0,0 +1,6 @@ + + + images/diet-coke.png + + + diff --git a/unicorn/src/UnicornGui.cpp b/unicorn/src/UnicornGui.cpp new file mode 100644 index 00000000..e655c692 --- /dev/null +++ b/unicorn/src/UnicornGui.cpp @@ -0,0 +1,157 @@ + +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | U n i c o r n - M a i n G U I | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | =============================================================== | +// | C++ Module : "./UnicornGui.cpp" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + +#include +#include + +#include "hurricane/Warning.h" +#include "hurricane/viewer/CellWidget.h" + +#include "crlcore/Catalog.h" +#include "crlcore/AllianceFramework.h" +#include "crlcore/GraphicToolEngine.h" + +#include "unicorn/COpenCellDialog.h" +#include "unicorn/UnicornGui.h" + + +namespace Unicorn { + + + using Hurricane::Warning; + using CRL::Catalog; + using CRL::AllianceFramework; + + +// ------------------------------------------------------------------- +// Class : "UnicornGui". + + + UnicornGui::UnicornGui ( QWidget* parent ) + : CellViewer(parent) + , _banner ( "Unicorn" + , "1.0b" + , "Coriolis Main GUI" + , "2008" + , "Jean-Paul Chaput" + , "" + ) + , _tools() + { } + + + UnicornGui::~UnicornGui () + { } + + + UnicornGui* UnicornGui::create ( QWidget* parent ) + { + UnicornGui* unicorn = new UnicornGui ( parent ); + + unicorn->_postCreate (); + + return unicorn; + } + + + void UnicornGui::destroy () + { + _preDestroy (); + delete this; + } + + + void UnicornGui::_postCreate () + { + setApplicationName ( tr("unicorn") ); + setWindowIcon ( QIcon(":/images/diet-coke.png") ); + + QAction* openAction = findChild("viewer.menuBar.file.openCell"); + if ( openAction ) { + connect ( openAction, SIGNAL(triggered()), this, SLOT(openCell()) ); + } + } + + + void UnicornGui::_preDestroy () + { + set::iterator itool = _tools.begin(); + for ( ; itool != _tools.end() ; itool++ ) + (*itool)->release (); + } + + + Cell* UnicornGui::getCellFromDb ( const char* name ) + { + return AllianceFramework::get()->getCell ( name, Catalog::State::Views ); + } + + + void UnicornGui::registerTool ( GraphicTool* tool ) + { + assert ( tool != NULL ); + + if ( _tools.find(tool) != _tools.end() ) { + cerr << Warning ( "Tool %s already registered in Unicorn (ignored)." + , getString(tool->getName()).c_str() ) << endl; + return; + } + + _tools.insert ( tool ); + + const GraphicTool::DrawGoMap& drawGos = tool->getDrawGos (); + GraphicTool::DrawGoMap::const_iterator idrawGo = drawGos.begin(); + + for ( ; idrawGo != drawGos.end() ; idrawGo++ ) + getCellWidget()->addDrawExtensionGo ( idrawGo->first + , idrawGo->second.getInit() + , idrawGo->second.getDraw() + ); + + tool->addToMenu ( this ); + } + + + void UnicornGui::openCell () + { + UnicornGui* viewer = this; + QString cellName; + bool newViewer; + + if ( COpenCellDialog::runDialog ( this, cellName, newViewer ) ) { + Cell* cell = getCellFromDb ( cellName.toStdString().c_str() ); + if ( cell ) { + if ( newViewer ) { + viewer = UnicornGui::create (); + viewer->show (); + } + viewer->setCell ( cell ); + } else + cerr << "[ERROR] Cell not found: " << cellName.toStdString() << endl; + } + } + + +} // End of Unicorn namespace. diff --git a/unicorn/src/images/diet-coke.png b/unicorn/src/images/diet-coke.png new file mode 100644 index 0000000000000000000000000000000000000000..88783d03790e7b4c807657a7a8bf4161bec35e4a GIT binary patch literal 5352 zcmVP)#X`Lm^WUEuN0_w!wz^_=INd+)h>@99qW z?JZ4~PUr->LSitYEGh^%BUM%@r6o1S8b+#gCQ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dve8{iAoEeBqhrfAUCi`63CYq@mJ_4;?;o{oZ}u zEL-t!}Xx$|5ivyO4(#9CcnynK0fda5zg2HxDri?mST-1bqH zub#g&oJ^AGnMR{gYpJy~+Rij%RTi_&Mll>DZH}gJattm5CmE^@;w_@9-&s24}xU`hC8XM!GRhnX0`Ay*dpc-Nnv_n6RV~4;w4|y;e4V2Uf(Cv1Y zZ&-3_Xv?83x^alsmJG~*5pXsnYHV%O)>sv#wGay0Tkp?KwNcDC3fKDA8qL7gJTGKk zl?lUfnfaU+lZ+q~Rn?lB>UKAhc2ZSUT~*iZUg?d}`LJ$=233zpLY+oXL!yRU^|;!I zAf1kkPpa6XMViJ@M64T)MvX?p^Y~yi8fTNdEaP_48}>_Cyms=nC<-Vgola*mnas`4 zXOo`ZBpN3eRrP^CMC7SsF|M3PMN{`Hj#s&Jhuh@(HnqbE>tLQdLT8t<&KER4&XQ zA;X;=vu)b$-P-Wo(8mdLl7a!S%s2o7)K%1^o+IrraNZ1SO`UsgjdA3GZ>^}xVmO>s zqmeXrqTIMFh;w1&BccN!ggIwB^9wfb(W+Ps;{7{<MmNW?^G=Z*l+tc-k|nFw!xsFw`-uFa!V*g97PuulGX$0000 + +class QCheckBox; +class QLineEdit; + + +namespace Unicorn { + + + class COpenCellDialog : public QDialog { + Q_OBJECT; + + public: + static bool runDialog ( QWidget* parent, QString& name, bool& newViewerRequest ); + const QString getCellName () const; + bool newViewerRequest () const; + protected: + COpenCellDialog ( QWidget* parent=NULL ); + protected slots: + void formatChanged ( int ); + + protected: + QLineEdit* _lineEdit; + QCheckBox* _viewerCheckBox; + }; + + + + +} // End of Unicorn namespace. + + +#endif diff --git a/unicorn/src/unicorn/UnicornGui.h b/unicorn/src/unicorn/UnicornGui.h new file mode 100644 index 00000000..d609d306 --- /dev/null +++ b/unicorn/src/unicorn/UnicornGui.h @@ -0,0 +1,82 @@ + +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | U n i c o r n - M a i n G U I | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | =============================================================== | +// | C++ Header : "./UnicornGui.h" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + + + +#ifndef __UNICORN_UNICORN__ +#define __UNICORN_UNICORN__ + +#include +#include +using namespace std; + +#include "hurricane/viewer/CellViewer.h" + +#include "crlcore/Banner.h" +namespace CRL { + class GraphicTool; +} + + +namespace Unicorn { + + + using std::set; + using Hurricane::CellViewer; + using Hurricane::Cell; + using CRL::Banner; + using CRL::GraphicTool; + + + class UnicornGui : public CellViewer { + Q_OBJECT; + + public: + static UnicornGui* create ( QWidget* parent=NULL ); + void destroy (); + inline Banner& getBanner (); + virtual Cell* getCellFromDb ( const char* name ); + void registerTool ( GraphicTool* ); + public slots: + void openCell (); + protected: + UnicornGui ( QWidget* parent ); + virtual ~UnicornGui (); + virtual void _postCreate (); + virtual void _preDestroy (); + protected: + Banner _banner; + set _tools; + }; + + + inline Banner& UnicornGui::getBanner () { return _banner; } + + +} // End of Unicorn namespace. + + +#endif // __UNICORN_UNICORN__ +