From fee45ef1175477bb3de1aa42e51d58fff5379800 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 26 Mar 2014 14:47:17 +0100 Subject: [PATCH] Qt5 porting, cleanup & Tidy. Cleanup: * Cleanup: In , remove unused file Bookshelf.cpp (may have been a parser once upon a time). * Cleanup: In , in Cell::flattenNets() use flags instead of booleans to be more readable. Allow occurrence placement checking. * New: In add Python wrapper for the Ispd05 loader. * New: In add option for direct loading of ISPD05 designs. * Bug: In , RecordModel must emit layoutAboutToBeChanged() before changing the record contents (and layoutChanged() afterwards). --- crlcore/src/pyCRL/CMakeLists.txt | 2 + crlcore/src/pyCRL/PyAcmSigda.cpp | 3 +- crlcore/src/pyCRL/PyCRL.cpp | 8 +- crlcore/src/pyCRL/PyIspd05.cpp | 108 ++++++++++++ crlcore/src/pyCRL/crlcore/PyIspd05.h | 53 ++++++ hurricane/src/hurricane/Cell.cpp | 13 +- hurricane/src/hurricane/DeepNet.cpp | 164 ++++++------------ hurricane/src/hurricane/hurricane/Cell.h | 3 +- hurricane/src/hurricane/hurricane/DeepNet.h | 35 +--- .../src/hurricane/hurricane/RoutingPad.h | 2 +- hurricane/src/viewer/InspectorWidget.cpp | 24 +-- hurricane/src/viewer/RecordModel.cpp | 20 +-- kite/src/KiteEngine.cpp | 4 +- knik/src/GraphicKnikEngine.cpp | 4 +- unicorn/src/CMakeLists.txt | 8 +- unicorn/src/ImportCell.cpp | 71 ++++++++ unicorn/src/ImportCellDialog.cpp | 35 ++-- unicorn/src/UnicornGui.cpp | 76 +++----- unicorn/src/cgt.py | 3 + unicorn/src/unicorn/ImportCell.h | 39 +++++ unicorn/src/unicorn/ImportCellDialog.h | 2 - unicorn/src/unicorn/UnicornGui.h | 7 +- vlsisapd/src/bookshelf/src/Bookshelf.cpp | 40 ----- 23 files changed, 430 insertions(+), 294 deletions(-) create mode 100644 crlcore/src/pyCRL/PyIspd05.cpp create mode 100644 crlcore/src/pyCRL/crlcore/PyIspd05.h create mode 100644 unicorn/src/ImportCell.cpp create mode 100644 unicorn/src/unicorn/ImportCell.h delete mode 100644 vlsisapd/src/bookshelf/src/Bookshelf.cpp diff --git a/crlcore/src/pyCRL/CMakeLists.txt b/crlcore/src/pyCRL/CMakeLists.txt index 1e282647..42de6500 100644 --- a/crlcore/src/pyCRL/CMakeLists.txt +++ b/crlcore/src/pyCRL/CMakeLists.txt @@ -40,6 +40,7 @@ PyToolEngineCollection.cpp PyGraphicToolEngine.cpp PyAcmSigda.cpp + PyIspd05.cpp ) set ( includes crlcore/PyBanner.h crlcore/PyCatalog.h @@ -54,6 +55,7 @@ crlcore/PyToolEngineCollection.h crlcore/PyGraphicToolEngine.h crlcore/PyAcmSigda.h + crlcore/PyIspd05.h ) diff --git a/crlcore/src/pyCRL/PyAcmSigda.cpp b/crlcore/src/pyCRL/PyAcmSigda.cpp index cdf16c65..b5e11a72 100644 --- a/crlcore/src/pyCRL/PyAcmSigda.cpp +++ b/crlcore/src/pyCRL/PyAcmSigda.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2012-2012, All Rights Reserved +// Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | diff --git a/crlcore/src/pyCRL/PyCRL.cpp b/crlcore/src/pyCRL/PyCRL.cpp index 3e721e88..d868bba3 100644 --- a/crlcore/src/pyCRL/PyCRL.cpp +++ b/crlcore/src/pyCRL/PyCRL.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2010-2012, All Rights Reserved +// Copyright (c) UPMC/LIP6 2010-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -30,6 +29,7 @@ #include "crlcore/PyToolEngine.h" #include "crlcore/PyToolEngineCollection.h" #include "crlcore/PyAcmSigda.h" +#include "crlcore/PyIspd05.h" namespace CRL { @@ -91,6 +91,7 @@ extern "C" { PyToolEngine_LinkPyType (); PyToolEngineCollection_LinkPyType (); PyAcmSigda_LinkPyType (); + PyIspd05_LinkPyType (); PYTYPE_READY ( Banner ); PYTYPE_READY ( CatalogState ); @@ -106,6 +107,7 @@ extern "C" { PYTYPE_READY ( ToolEngineCollection ); PYTYPE_READY ( ToolEngineCollectionLocator ); PYTYPE_READY ( AcmSigda ); + PYTYPE_READY ( Ispd05 ); // Identifier string can take up to 10 characters. __cs.addType ( "alcEnv" , &PyTypeEnvironment , "" , false ); @@ -149,6 +151,8 @@ extern "C" { PyModule_AddObject ( module, "ToolEngineCollectionLocator", (PyObject*)&PyTypeToolEngineCollectionLocator ); Py_INCREF ( &PyTypeAcmSigda ); PyModule_AddObject ( module, "AcmSigda", (PyObject*)&PyTypeAcmSigda ); + Py_INCREF ( &PyTypeIspd05 ); + PyModule_AddObject ( module, "Ispd05", (PyObject*)&PyTypeIspd05 ); PyCatalog_postModuleInit (); PyEnvironment_postModuleInit (); diff --git a/crlcore/src/pyCRL/PyIspd05.cpp b/crlcore/src/pyCRL/PyIspd05.cpp new file mode 100644 index 00000000..d8fc41ac --- /dev/null +++ b/crlcore/src/pyCRL/PyIspd05.cpp @@ -0,0 +1,108 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | C O R I O L I S | +// | Alliance / Hurricane Interface | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | =============================================================== | +// | C++ Module : "./PyIspd05.cpp" | +// +-----------------------------------------------------------------+ + + +#include "crlcore/Ispd05Bookshelf.h" +#include "crlcore/PyIspd05.h" +#include "hurricane/isobar/PyCell.h" +#include +#include + + +namespace CRL { + + using std::cerr; + using std::endl; + using std::hex; + using std::string; + using std::ostringstream; + using Hurricane::tab; + using Hurricane::in_trace; + using Hurricane::Error; + using Hurricane::Warning; + using Isobar::ProxyProperty; + using Isobar::ProxyError; + using Isobar::ConstructorError; + using Isobar::HurricaneError; + using Isobar::HurricaneWarning; + using Isobar::ParseOneArg; + using Isobar::ParseTwoArg; + using Isobar::__cs; + using Isobar::PyCell_Link; + + +extern "C" { + + +#if defined(__PYTHON_MODULE__) + +// +=================================================================+ +// | "PyIspd05" Python Module Code Part | +// +=================================================================+ + + + static PyObject* PyIspd05_load ( PyObject*, PyObject* args ) + { + trace << "PyIspd05_load()" << endl; + + Cell* cell = NULL; + + HTRY + char* benchName = NULL; + + if (PyArg_ParseTuple( args, "s:Ispd05.load", &benchName )) { + cell = Ispd05::load( benchName ); + } else { + PyErr_SetString ( ConstructorError, "Ispd05.load(): Bad type or bad number of parameters." ); + return NULL; + } + HCATCH + + return (PyObject*)PyCell_Link(cell); + } + + + // Standart Destroy (Attribute). + + + PyMethodDef PyIspd05_Methods[] = + { { "load" , (PyCFunction)PyIspd05_load , METH_VARARGS|METH_STATIC + , "Create a new Ispd05." } + //, { "destroy" , (PyCFunction)PyIspd05_destroy , METH_VARARGS + // , "Destroy the associated hurricane object. The python object remains." } + , {NULL, NULL, 0, NULL} /* sentinel */ + }; + + + NoObjectDeleteMethod(Ispd05) + PyTypeObjectLinkPyTypeWithoutObject(Ispd05,Ispd05) + + +#else // End of Python Module Code Part. + + +// +=================================================================+ +// | "PyIspd05" Shared Library Code Part | +// +=================================================================+ + + // Type Definition. + PyTypeObjectDefinitionsOfModule(CRL,Ispd05) + + +#endif // End of Shared Library Code Part. + +} // extern "C". + +} // CRL namespace. diff --git a/crlcore/src/pyCRL/crlcore/PyIspd05.h b/crlcore/src/pyCRL/crlcore/PyIspd05.h new file mode 100644 index 00000000..3f95d6fc --- /dev/null +++ b/crlcore/src/pyCRL/crlcore/PyIspd05.h @@ -0,0 +1,53 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | C O R I O L I S | +// | Alliance / Hurricane Interface | +// | | +// | Author : Jean-Paul CHAPUT | +// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | +// | =============================================================== | +// | C++ Header : "./crlcore/PyIspd05.h" | +// +-----------------------------------------------------------------+ + + +#ifndef CRL_PY_ACMSIGDA_H +#define CRL_PY_ACMSIGDA_H + +#include "hurricane/isobar/PyHurricane.h" + + +namespace CRL { + +extern "C" { + + +// ------------------------------------------------------------------- +// Python Object : "PyIspd05". + + typedef struct { + PyObject_HEAD + } PyIspd05; + + +// ------------------------------------------------------------------- +// Functions & Types exported to "PyCRL.ccp". + + extern PyTypeObject PyTypeIspd05; + extern PyMethodDef PyIspd05_Methods[]; + + extern void PyIspd05_LinkPyType(); + + +#define IsPyIspd05(v) ( (v)->ob_type == &PyTypeIspd05 ) +#define PY_ISPD05(v) ( (PyIspd05*)(v) ) + + +} // extern "C". + +} // Hurricane namespace. + +#endif // CRL_PY_ACMSIGDA_H diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index ba45e746..12ad3d18 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -187,10 +187,11 @@ void Cell::setAbutmentBox(const Box& abutmentBox) } } -void Cell::flattenNets(bool buildRings) -// ************************************ +void Cell::flattenNets(unsigned int flags) +// *************************************** { UpdateSession::open(); + bool buildRings = flags & BuildRings; forEach ( Occurrence, ioccurrence, getHyperNetRootNetOccurrences() ) { Net* net = static_cast((*ioccurrence).getEntity()); @@ -198,7 +199,7 @@ void Cell::flattenNets(bool buildRings) HyperNet hyperNet ( *ioccurrence ); if ( not (*ioccurrence).getPath().isEmpty() ) { DeepNet* deepNet = DeepNet::create ( hyperNet ); - if (deepNet) deepNet->_createRoutingPads ( buildRings ); + if (deepNet) deepNet->_createRoutingPads ( flags ); } else { RoutingPad* previousRP = NULL; RoutingPad* currentRP = NULL; @@ -216,9 +217,11 @@ void Cell::flattenNets(bool buildRings) } forEach ( Occurrence, iplugOccurrence, hyperNet.getLeafPlugOccurrences() ) { - currentRP = RoutingPad::create ( net, *iplugOccurrence, RoutingPad::BiggestArea/*|RoutingPad::ShowWarning*/ ); + currentRP = RoutingPad::create ( net, *iplugOccurrence, RoutingPad::BiggestArea ); currentRP->materialize (); - if ( buildRings ) { + if ( flags & WarnOnUnplacedInstances ) + currentRP->isPlacedOccurrence ( RoutingPad::ShowWarning ); + if ( flags & BuildRings ) { if ( previousRP ) { currentRP->getBodyHook()->attach ( previousRP->getBodyHook() ); } diff --git a/hurricane/src/hurricane/DeepNet.cpp b/hurricane/src/hurricane/DeepNet.cpp index 8e70242a..293793ec 100644 --- a/hurricane/src/hurricane/DeepNet.cpp +++ b/hurricane/src/hurricane/DeepNet.cpp @@ -1,7 +1,6 @@ - // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,12 +18,7 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,10 +26,7 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./DeepNet.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include "hurricane/DeepNet.h" @@ -54,126 +45,81 @@ namespace Hurricane { -namespace { - - - using namespace std; - using namespace Hurricane; - - - - -# if !defined(__DOXYGEN_PROCESSOR__) - - -# endif - - -} // End of local namespace. - - -// x-----------------------------------------------------------------x -// | "::DeepNet" Class Definitions | -// x-----------------------------------------------------------------x - - -# if !defined(__DOXYGEN_PROCESSOR__) - // ------------------------------------------------------------------- -// Constructor : "DeepNet::DeepNet ()". - -DeepNet::DeepNet ( Occurrence& netOccurrence ) - : Net(netOccurrence.getOwnerCell() - ,netOccurrence.getName() - ) - , _netOccurrence(netOccurrence) -{ -} +// Class : "DeepNet". + DeepNet::DeepNet ( Occurrence& netOccurrence ) + : Net(netOccurrence.getOwnerCell() + ,netOccurrence.getName() + ) + , _netOccurrence(netOccurrence) + { } -// ------------------------------------------------------------------- -// Inspector Management : "DeepNet::_getRecord ()". + DeepNet* DeepNet::create ( HyperNet& hyperNet ) + { + if (not hyperNet.isValid()) + throw Error ( "Can't create " + _TName("DeepNet") + ": occurence is invalid." ); -Record* DeepNet::_getRecord () const -{ - Record* record = Net::_getRecord(); - if (record) { - record->add(getSlot("_netOccurrence", &_netOccurrence)); + Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence( hyperNet.getNetOccurrence() ); + + if (rootNetOccurrence.getMasterCell()->isFlattenLeaf()) return NULL; + if (rootNetOccurrence.getPath().isEmpty()) return NULL; + + DeepNet* deepNet = new DeepNet( rootNetOccurrence ); + deepNet->_postCreate(); + + return deepNet; } - return record; -} -# endif + size_t DeepNet::_createRoutingPads ( unsigned int flags ) + { + size_t nbRoutingPads = 0; + HyperNet hyperNet ( _netOccurrence ); + RoutingPad* previousRP = NULL; + RoutingPad* currentRP = NULL; + forEach ( Occurrence, ioccurrence, hyperNet.getLeafPlugOccurrences() ) { + nbRoutingPads++; -// ------------------------------------------------------------------- -// Constructor : "DeepNet::create ()". + currentRP = RoutingPad::create( this, *ioccurrence, RoutingPad::BiggestArea ); + if (flags & Cell::WarnOnUnplacedInstances) + currentRP->isPlacedOccurrence ( RoutingPad::ShowWarning ); -DeepNet* DeepNet::create ( HyperNet& hyperNet ) -{ - if ( !hyperNet.isValid() ) - throw Error ( "Can't create " + _TName("DeepNet") + ": occurence is invalid." ); - - Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence ( hyperNet.getNetOccurrence() ); - - if ( rootNetOccurrence.getMasterCell()->isFlattenLeaf() ) return NULL; - if ( rootNetOccurrence.getPath().isEmpty() ) return NULL; - - DeepNet* deepNet = new DeepNet ( rootNetOccurrence ); - deepNet->_postCreate (); - - return deepNet; -} - - - - -// ------------------------------------------------------------------- -// Internal Modifier : "DeepNet::_createRoutingPads ()". - -size_t DeepNet::_createRoutingPads ( bool buildRings ) -{ - size_t nbRoutingPads = 0; - HyperNet hyperNet ( _netOccurrence ); - - RoutingPad* previousRP = NULL; - RoutingPad* currentRP = NULL; - for_each_occurrence ( plugOccurrence, hyperNet.getLeafPlugOccurrences() ) { - nbRoutingPads++; - - currentRP = RoutingPad::create ( this, plugOccurrence, RoutingPad::BiggestArea ); - if ( buildRings ) { - if ( previousRP ) { - currentRP->getBodyHook()->attach ( previousRP->getBodyHook() ); + if (flags & Cell::BuildRings) { + if (previousRP) { + currentRP->getBodyHook()->attach( previousRP->getBodyHook() ); + } + previousRP = currentRP; } - previousRP = currentRP; } - end_for + return nbRoutingPads; } - return nbRoutingPads; -} - -// ------------------------------------------------------------------- -// - -Net* getDeepNet(HyperNet& hypernet) -// ******************************** +Net* getDeepNet ( HyperNet& hypernet ) { - Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence ( hypernet.getNetOccurrence() ); + Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence( hypernet.getNetOccurrence() ); - //if ( rootNetOccurrence.getMasterCell()->IsFlattenLeaf() ) return NULL; - //if ( rootNetOccurrence.getPath().isEmpty() ) return NULL; - - return rootNetOccurrence.getOwnerCell()->getNet(rootNetOccurrence.getName()); +//if ( rootNetOccurrence.getMasterCell()->IsFlattenLeaf() ) return NULL; +//if ( rootNetOccurrence.getPath().isEmpty() ) return NULL; + return rootNetOccurrence.getOwnerCell()->getNet(rootNetOccurrence.getName()); } + Record* DeepNet::_getRecord () const + { + Record* record = Net::_getRecord(); + if (record) { + record->add( getSlot("_netOccurrence", &_netOccurrence) ); + } + return record; + } + + } // End of Hurricane namespace. diff --git a/hurricane/src/hurricane/hurricane/Cell.h b/hurricane/src/hurricane/hurricane/Cell.h index 9e6bd0d3..95b34e7c 100644 --- a/hurricane/src/hurricane/hurricane/Cell.h +++ b/hurricane/src/hurricane/hurricane/Cell.h @@ -64,6 +64,7 @@ class Cell : public Entity { // Types // ***** + public: enum Flag { BuildRings=0x0001, WarnOnUnplacedInstances=0x0002 }; public: typedef Entity Inherit; public: typedef map ExtensionSliceMap; @@ -302,7 +303,7 @@ class Cell : public Entity { public: void setTerminal(bool isTerminal) {_isTerminal = isTerminal;}; public: void setFlattenLeaf(bool isFlattenLeaf) {_isFlattenLeaf = isFlattenLeaf;}; public: void setPad(bool isPad) {_isPad = isPad;}; - public: void flattenNets(bool buildRings=true); + public: void flattenNets(unsigned int flags=BuildRings); public: void materialize(); public: void unmaterialize(); diff --git a/hurricane/src/hurricane/hurricane/DeepNet.h b/hurricane/src/hurricane/hurricane/DeepNet.h index 582e1012..872bd5ce 100644 --- a/hurricane/src/hurricane/hurricane/DeepNet.h +++ b/hurricane/src/hurricane/hurricane/DeepNet.h @@ -1,7 +1,6 @@ - // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,12 +18,7 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -32,29 +26,21 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Header : "./hurricane/DeepNet.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -# ifndef __HURRICANE_DEEPNET__ -# define __HURRICANE_DEEPNET__ +#ifndef HURRICANE_DEEPNET_H +#define HURRICANE_DEEPNET_H #include "hurricane/Net.h" #include "hurricane/HyperNet.h" #include "hurricane/Occurrence.h" - - namespace Hurricane { - class DeepNet : public Net { -# if !defined(__DOXYGEN_PROCESSOR__) - // Attributes. protected: Occurrence _netOccurrence; @@ -68,8 +54,6 @@ namespace Hurricane { virtual Record* _getRecord () const; virtual string _getTypeName() const { return "DeepNet"; }; -# endif - // Constructors. public: static DeepNet* create ( HyperNet& hyperNet ); @@ -83,16 +67,13 @@ namespace Hurricane { // Internal Modifiers. public: - size_t _createRoutingPads ( bool buildRings=false ); + size_t _createRoutingPads ( unsigned int flags=0 ); }; Net* getDeepNet(HyperNet& hyperNet); -} // End of Hurricane namespace. +} // Hurricane namespace. - - - -# endif +#endif diff --git a/hurricane/src/hurricane/hurricane/RoutingPad.h b/hurricane/src/hurricane/hurricane/RoutingPad.h index ad1967c1..9c54bc32 100644 --- a/hurricane/src/hurricane/hurricane/RoutingPad.h +++ b/hurricane/src/hurricane/hurricane/RoutingPad.h @@ -53,7 +53,7 @@ namespace Hurricane { enum Flags { BiggestArea = 0x0001 , HighestLayer = 0x0002 , LowestLayer = 0x0004 - , ComponentSelection=BiggestArea|HighestLayer|LowestLayer + , ComponentSelection= BiggestArea|HighestLayer|LowestLayer , ShowWarning = 0x0008 }; public: diff --git a/hurricane/src/viewer/InspectorWidget.cpp b/hurricane/src/viewer/InspectorWidget.cpp index fc970b34..9d01312a 100644 --- a/hurricane/src/viewer/InspectorWidget.cpp +++ b/hurricane/src/viewer/InspectorWidget.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | H U R R I C A N E | @@ -262,8 +261,13 @@ namespace Hurricane { if ( (_history.getSlot() != NULL) and (record == NULL) ) record = _history.getSlot()->getDataRecord(); - //cerr << " Effective setSlot() ." << endl; - change = _baseModel->setSlot ( _history.getSlot(), record, _history.getDepth() ); + // if (_history.getSlot()) + // cerr << " Effective setSlot() " << _history.getSlot()->getName() << endl; + // else + // cerr << " Effective setSlot() NULL" << endl; + + change = _baseModel->setSlot( _history.getSlot(), record, _history.getDepth() ); + //cerr << " setSlot() succeeded." << endl; return change; } @@ -273,14 +277,14 @@ namespace Hurricane { { //cerr << "InspectorWidget::pushSlot()" << endl; - if ( slot == NULL ) return; - if ( record == NULL ) { - record = slot->getDataRecord (); - if ( record == NULL ) return; + if (slot == NULL) return; + if (record == NULL) { + record = slot->getDataRecord(); + if (record == NULL) return; } - _history.push ( slot, record ); - setSlot ( record ); + _history.push( slot, record ); + setSlot( record ); } diff --git a/hurricane/src/viewer/RecordModel.cpp b/hurricane/src/viewer/RecordModel.cpp index 61a8e5f4..5dddcdf0 100644 --- a/hurricane/src/viewer/RecordModel.cpp +++ b/hurricane/src/viewer/RecordModel.cpp @@ -1,15 +1,9 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -17,10 +11,7 @@ // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | // | C++ Module : "./RecordModel.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include @@ -54,6 +45,8 @@ namespace Hurricane { { //cerr << " Slot change" << endl; + emit layoutAboutToBeChanged (); + vector< pair >().swap ( _cache ); if ( _slot ) { @@ -77,9 +70,10 @@ namespace Hurricane { record = slot->getDataRecord (); //cerr << " New record build" << endl; if ( record == NULL ) { - // cerr << " Slot " << slot->getDataString() << " has NULL Record" << endl; + //cerr << " Slot " << slot->getDataString() << " has NULL Record" << endl; delete slot; + emit layoutChanged (); return false; } } diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 387fede1..5a07c6b3 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -235,7 +235,9 @@ namespace Kite { Cell* cell = getCell(); //Box cellBb = cell->getBoundingBox(); if (not _knik) { - cell->flattenNets( mode & KtBuildGlobalRouting ); + unsigned int flags = Cell::WarnOnUnplacedInstances; + flags |= (mode & KtBuildGlobalRouting) ? Cell::BuildRings : 0; + cell->flattenNets( flags ); KatabaticEngine::chipPrep(); diff --git a/knik/src/GraphicKnikEngine.cpp b/knik/src/GraphicKnikEngine.cpp index 4cf8a5f2..1735336a 100644 --- a/knik/src/GraphicKnikEngine.cpp +++ b/knik/src/GraphicKnikEngine.cpp @@ -162,7 +162,7 @@ namespace Knik { KnikEngine* knik = KnikEngine::get ( cell ); if ( !knik ) { if ( cell->getRubbers().getFirst() == NULL ) - cell->flattenNets ( (mode==BuildSolution) ); + cell->flattenNets ( ((mode==BuildSolution)?Cell::BuildRings:0) ); knik = KnikEngine::create ( cell , _congestion , _preCongestion @@ -186,7 +186,7 @@ namespace Knik { emit cellPreModificated(); - cell->flattenNets ( (true) ); + cell->flattenNets ( Cell::BuildRings ); emit cellPostModificated(); } diff --git a/unicorn/src/CMakeLists.txt b/unicorn/src/CMakeLists.txt index d8db0188..16a398b5 100644 --- a/unicorn/src/CMakeLists.txt +++ b/unicorn/src/CMakeLists.txt @@ -13,6 +13,7 @@ ) add_definitions ( -DSYS_CONF_DIR="${SYS_CONF_DIR}" ) + set ( includes unicorn/ImportCell.h ) set ( mocincludes unicorn/UnicornGui.h unicorn/OpenCellDialog.h unicorn/SaveCellDialog.h @@ -21,7 +22,8 @@ ) set ( pyIncludes unicorn/PyUnicornGui.h ) - set ( cpps OpenCellDialog.cpp + set ( cpps ImportCell.cpp + OpenCellDialog.cpp SaveCellDialog.cpp ImportCellDialog.cpp ExportCellDialog.cpp @@ -88,7 +90,7 @@ install ( TARGETS pyUnicorn DESTINATION ${PYTHON_SITE_PACKAGES} ) install ( TARGETS cgt.bin DESTINATION bin ) install ( PROGRAMS cgt.py DESTINATION bin RENAME cgt ) - #install ( PROGRAMS cgt3.py DESTINATION bin RENAME cgt3 ) - install ( FILES ${mocincludes} + install ( FILES ${includes} + ${mocincludes} ${pyIncludes} DESTINATION include/coriolis2/unicorn ) diff --git a/unicorn/src/ImportCell.cpp b/unicorn/src/ImportCell.cpp new file mode 100644 index 00000000..2198c447 --- /dev/null +++ b/unicorn/src/ImportCell.cpp @@ -0,0 +1,71 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2014-2014, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | 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 : "./ImportCell.cpp" | +// +-----------------------------------------------------------------+ + + +#include +#include "hurricane/Error.h" +#include "crlcore/AcmSigda.h" +#include "crlcore/Ispd04Bookshelf.h" +#include "crlcore/Ispd05Bookshelf.h" +#include "crlcore/Iccad04Lefdef.h" +#include "crlcore/DefImport.h" +#include "unicorn/ImportCell.h" + + +namespace Unicorn { + + using std::cerr; + using std::endl; + using std::string; + using Hurricane::Error; + using Hurricane::Cell; + using CRL::AcmSigda; + using CRL::Ispd04; + using CRL::Ispd05; + using CRL::Iccad04Lefdef; + using CRL::DefImport; + + + Cell* ImportCell::load ( const string& cellName, int format ) + { + Cell* cell = NULL; + + switch ( format ) { + case AcmSigda: + cell = AcmSigda::load( cellName ); + break; + case Ispd04: + cell = Ispd04::load( cellName ); + break; + case Ispd05: + cell = Ispd05::load( cellName ); + break; + case Iccad04: + cell = Iccad04Lefdef::load( cellName, 0 ); + break; + case AllianceDef: + cell = DefImport::load( cellName.c_str() , DefImport::FitAbOnCells ); + break; + } + + if (not cell) { + cerr << Error( "Cell not found: %s", cellName.c_str() ) << endl; + } + + return cell; + } + + +} // Unicorn namespace. diff --git a/unicorn/src/ImportCellDialog.cpp b/unicorn/src/ImportCellDialog.cpp index 0063f848..e3172c57 100644 --- a/unicorn/src/ImportCellDialog.cpp +++ b/unicorn/src/ImportCellDialog.cpp @@ -14,21 +14,20 @@ // +-----------------------------------------------------------------+ -#include +#include using namespace std; -#include -#include -#include -#include -#include -#include -#include - -#include "hurricane/Warning.h" -#include "hurricane/viewer/Graphics.h" - -#include "unicorn/ImportCellDialog.h" +#include +#include +#include +#include +#include +#include +#include +#include "hurricane/Warning.h" +#include "hurricane/viewer/Graphics.h" +#include "unicorn/ImportCell.h" +#include "unicorn/ImportCellDialog.h" namespace Unicorn { @@ -82,11 +81,11 @@ namespace Unicorn { formatLabel->setFont ( Graphics::getNormalFont(true) ); hLayout2->addWidget ( formatLabel ); - _formatComboBox->addItem ( tr("ACM/SIGDA (aka MCNC, .bench)"), AcmSigda ); - _formatComboBox->addItem ( tr("ISPD'04 (Bookshelf)") , Ispd04 ); - _formatComboBox->addItem ( tr("ISPD'05 (Bookshelf)") , Ispd05 ); - _formatComboBox->addItem ( tr("ICCAD'04 (LEF/DEF)") , Iccad04 ); - _formatComboBox->addItem ( tr("Alliance compliant DEF") , AllianceDef ); + _formatComboBox->addItem ( tr("ACM/SIGDA (aka MCNC, .bench)"), ImportCell::AcmSigda ); + _formatComboBox->addItem ( tr("ISPD'04 (Bookshelf)") , ImportCell::Ispd04 ); + _formatComboBox->addItem ( tr("ISPD'05 (Bookshelf)") , ImportCell::Ispd05 ); + _formatComboBox->addItem ( tr("ICCAD'04 (LEF/DEF)") , ImportCell::Iccad04 ); + _formatComboBox->addItem ( tr("Alliance compliant DEF") , ImportCell::AllianceDef ); hLayout2->addWidget ( _formatComboBox ); QVBoxLayout* vLayout = new QVBoxLayout (); diff --git a/unicorn/src/UnicornGui.cpp b/unicorn/src/UnicornGui.cpp index c0815875..4d051db4 100644 --- a/unicorn/src/UnicornGui.cpp +++ b/unicorn/src/UnicornGui.cpp @@ -14,40 +14,27 @@ // +-----------------------------------------------------------------+ -#include -#include - -#include "hurricane/Warning.h" -#include "hurricane/viewer/CellWidget.h" - -#include "crlcore/Catalog.h" -#include "crlcore/AllianceFramework.h" -#include "crlcore/GraphicToolEngine.h" -#include "crlcore/AcmSigda.h" -#include "crlcore/Ispd04Bookshelf.h" -#include "crlcore/Ispd05Bookshelf.h" -#include "crlcore/Iccad04Lefdef.h" -#include "crlcore/DefImport.h" -#include "crlcore/DefExport.h" - -#include "unicorn/OpenCellDialog.h" -#include "unicorn/SaveCellDialog.h" -#include "unicorn/ImportCellDialog.h" -#include "unicorn/ExportCellDialog.h" -#include "unicorn/UnicornGui.h" +#include +#include +#include "hurricane/Warning.h" +#include "hurricane/viewer/CellWidget.h" +#include "crlcore/Catalog.h" +#include "crlcore/AllianceFramework.h" +#include "crlcore/GraphicToolEngine.h" +#include "crlcore/DefExport.h" +#include "unicorn/ImportCell.h" +#include "unicorn/OpenCellDialog.h" +#include "unicorn/SaveCellDialog.h" +#include "unicorn/ImportCellDialog.h" +#include "unicorn/ExportCellDialog.h" +#include "unicorn/UnicornGui.h" namespace Unicorn { - using Hurricane::Warning; using CRL::Catalog; using CRL::AllianceFramework; - using CRL::AcmSigda; - using CRL::Ispd04; - using CRL::Ispd05; - using CRL::Iccad04Lefdef; - using CRL::DefImport; using CRL::DefExport; @@ -186,36 +173,17 @@ namespace Unicorn { bool newViewer; int format; - if ( _importDialog->runDialog ( cellName, format, newViewer ) ) { - Cell* cell = NULL; + if ( _importDialog->runDialog( cellName, format, newViewer ) ) { + Cell* cell = ImportCell::load( cellName.toStdString(), format ); - switch ( format ) { - case ImportCellDialog::AcmSigda: - cell = AcmSigda::load ( cellName.toStdString() ); - break; - case ImportCellDialog::Ispd04: - cell = Ispd04::load ( cellName.toStdString() ); - break; - case ImportCellDialog::Ispd05: - cell = Ispd05::load ( cellName.toStdString() ); - break; - case ImportCellDialog::Iccad04: - cell = Iccad04Lefdef::load ( cellName.toStdString() , 0 ); - break; - case ImportCellDialog::AllianceDef: - cell = DefImport::load ( cellName.toStdString().c_str() , DefImport::FitAbOnCells ); - break; - } - - if ( cell ) { + if (cell) { UnicornGui* viewer = this; - if ( newViewer ) { - viewer = UnicornGui::create (); - viewer->show (); + if (newViewer) { + viewer = UnicornGui::create(); + viewer->show(); } - viewer->setCell ( cell ); - } else - cerr << "[ERROR] Cell not found: " << cellName.toStdString() << endl; + viewer->setCell( cell ); + } } } diff --git a/unicorn/src/cgt.py b/unicorn/src/cgt.py index 73b9fe47..37f27f99 100755 --- a/unicorn/src/cgt.py +++ b/unicorn/src/cgt.py @@ -86,6 +86,7 @@ if __name__ == '__main__': parser = optparse.OptionParser(usage) parser.add_option( '-c', '--cell' , type='string' , dest='cell' , help='The name of the cell to load, whithout extension.') parser.add_option( '--acm-sigda-89' , type='string' , dest='acmSigdaName' , help='An ACM/SIGDA 89 bench name to load, whithout extension.') + parser.add_option( '--ispd-05' , type='string' , dest='ispd05name' , help='An ISPD 05 bench (placement) name to load, whithout extension.') parser.add_option( '--script' , type='string' , dest='script' , help='Run a Python or Stratus script.') parser.add_option( '-v', '--verbose' , action='store_true', dest='verbose' , help='First level of verbosity.') parser.add_option( '-V', '--very-verbose' , action='store_true', dest='veryVerbose' , help='Second level of verbosity.') @@ -141,6 +142,8 @@ if __name__ == '__main__': cell = None if options.acmSigdaName: cell = CRL.AcmSigda.load(options.acmSigdaName) + if options.ispd05name: + cell = CRL.Ispd05.load(options.ispd05name) elif options.cell: cell = af.getCell(options.cell, CRL.Catalog.State.Views) else: diff --git a/unicorn/src/unicorn/ImportCell.h b/unicorn/src/unicorn/ImportCell.h new file mode 100644 index 00000000..6df3b1bc --- /dev/null +++ b/unicorn/src/unicorn/ImportCell.h @@ -0,0 +1,39 @@ +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2014-2014, All Rights Reserved +// +// +-----------------------------------------------------------------+ +// | 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 : "./ImportCell.h" | +// +-----------------------------------------------------------------+ + + +#ifndef UNICORN_IMPORT_CELL_H +#define UNICORN_IMPORT_CELL_H + +#include + +namespace Hurricane { + class Cell; +} + +namespace Unicorn { + + + class ImportCell { + public: + enum Formats { AcmSigda=1, Ispd04, Ispd05, Iccad04, AllianceDef }; + public: + static Hurricane::Cell* load ( const std::string&, int format ); + }; + + +} // Unicorn namespace. + +#endif diff --git a/unicorn/src/unicorn/ImportCellDialog.h b/unicorn/src/unicorn/ImportCellDialog.h index 0a673980..ade4eb65 100644 --- a/unicorn/src/unicorn/ImportCellDialog.h +++ b/unicorn/src/unicorn/ImportCellDialog.h @@ -30,8 +30,6 @@ namespace Unicorn { class ImportCellDialog : public QDialog { Q_OBJECT; - public: - enum Formats { AcmSigda=1, Ispd04, Ispd05, Iccad04, AllianceDef }; public: ImportCellDialog ( QWidget* parent=NULL ); bool runDialog ( QString& name, int& format, bool& newViewerRequest ); diff --git a/unicorn/src/unicorn/UnicornGui.h b/unicorn/src/unicorn/UnicornGui.h index 041dfb89..e0c5807b 100644 --- a/unicorn/src/unicorn/UnicornGui.h +++ b/unicorn/src/unicorn/UnicornGui.h @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -17,8 +16,8 @@ -#ifndef __UNICORN_UNICORN__ -#define __UNICORN_UNICORN__ +#ifndef UNICORN_UNICORN_H +#define UNICORN_UNICORN_H #include #include diff --git a/vlsisapd/src/bookshelf/src/Bookshelf.cpp b/vlsisapd/src/bookshelf/src/Bookshelf.cpp deleted file mode 100644 index 503f42a4..00000000 --- a/vlsisapd/src/bookshelf/src/Bookshelf.cpp +++ /dev/null @@ -1,40 +0,0 @@ - -// -*- C++ -*- -// -// This file is part of the VSLSI Stand-Alone Software. -// Copyright (c) UPMC 2008-2014, All Rights Reserved -// -// +-----------------------------------------------------------------+ -// | V L S I Stand - Alone Parsers / Drivers | -// | B o o k s h e l f P a r s e r | -// | | -// | Author : Jean-Paul CHAPUT | -// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | -// | =============================================================== | -// | C++ Module : "./Bookshelf.cpp" | -// +-----------------------------------------------------------------+ - - -#include "vlsisapd/bookshelf/Bookshelf.h" -#include "vlsisapd/bookshelf/BookshelfException.h" - - -namespace Bookshelf { - - - BookshelfParser::BookshelfParser () - { } - - - void BookshelfParser::readFromFile ( std::string auxFile ) - { - Utilities::Path auxPath ( auxFile ); - if ( not auxPath.exists() ) { - throw BookshelfException ( "%s .aux file not found.", auxPath.string().c_str() ); - } - - std::cout << " o Reading Bookshelf .aux: <" << auxPath.string() << ">." << std::endl; - } - - -} // End of Bookself namespace.