diff --git a/crlcore/src/LibraryManager/CellsModel.cpp b/crlcore/src/LibraryManager/CellsModel.cpp index d7d2fb2b..96ae2693 100644 --- a/crlcore/src/LibraryManager/CellsModel.cpp +++ b/crlcore/src/LibraryManager/CellsModel.cpp @@ -103,7 +103,7 @@ namespace CRL { , "BLIF (Yosys/ABC)" , CellLoader::Importer|CellLoader::MultiCell , Catalog::State::Logical - , std::bind( &Blif::load, placeholders::_1 ) ) ); + , std::bind( &Blif::load, placeholders::_1, true ) ) ); } } diff --git a/crlcore/src/ccore/blif/BlifParser.cpp b/crlcore/src/ccore/blif/BlifParser.cpp index efa7a696..8e0531a9 100644 --- a/crlcore/src/ccore/blif/BlifParser.cpp +++ b/crlcore/src/ccore/blif/BlifParser.cpp @@ -667,7 +667,7 @@ namespace CRL { { if (library) _libraries.push_back( library ); } - Cell* Blif::load ( string cellPath ) + Cell* Blif::load ( string cellPath, bool enforceVhdl ) { using namespace std; @@ -824,7 +824,7 @@ namespace CRL { Model::orderModels(); Model::connectModels(); - Model::toVhdlModels(); + if (enforceVhdl) Model::toVhdlModels(); Model::clearStatic(); UpdateSession::close(); diff --git a/crlcore/src/ccore/crlcore/Blif.h b/crlcore/src/ccore/crlcore/Blif.h index ef644e77..a23f553d 100644 --- a/crlcore/src/ccore/crlcore/Blif.h +++ b/crlcore/src/ccore/crlcore/Blif.h @@ -56,7 +56,7 @@ namespace CRL { class Blif { public: - static Cell* load ( std::string netlist ); + static Cell* load ( std::string netlist, bool enforceVhdl=true ); static void add ( Library* ); static inline const std::vector& getLibraries (); private: diff --git a/crlcore/src/ccore/gds/GdsDriver.cpp b/crlcore/src/ccore/gds/GdsDriver.cpp index d4ac19a0..74c492e9 100644 --- a/crlcore/src/ccore/gds/GdsDriver.cpp +++ b/crlcore/src/ccore/gds/GdsDriver.cpp @@ -608,23 +608,33 @@ namespace { } } } else { - Diagonal* diagonal = dynamic_cast(component); - if (diagonal) { + Rectilinear* rectilinear = dynamic_cast(component); + if (rectilinear) { for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) { (*this) << BOUNDARY; (*this) << layer; - (*this) << diagonal->getContour(); + (*this) << rectilinear->getPoints(); (*this) << ENDEL; } - } else if ( dynamic_cast(component) - or dynamic_cast(component) - or dynamic_cast(component) - or dynamic_cast(component)) { - for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) { - (*this) << BOUNDARY; - (*this) << layer; - (*this) << component->getBoundingBox(layer); - (*this) << ENDEL; + } else { + Diagonal* diagonal = dynamic_cast(component); + if (diagonal) { + for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) { + (*this) << BOUNDARY; + (*this) << layer; + (*this) << diagonal->getContour(); + (*this) << ENDEL; + } + } else if ( dynamic_cast(component) + or dynamic_cast(component) + or dynamic_cast(component) + or dynamic_cast(component)) { + for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) { + (*this) << BOUNDARY; + (*this) << layer; + (*this) << component->getBoundingBox(layer); + (*this) << ENDEL; + } } } } diff --git a/crlcore/src/pyCRL/PyBlif.cpp b/crlcore/src/pyCRL/PyBlif.cpp index 45f67954..945f87b5 100644 --- a/crlcore/src/pyCRL/PyBlif.cpp +++ b/crlcore/src/pyCRL/PyBlif.cpp @@ -87,10 +87,13 @@ extern "C" { Cell* cell = NULL; HTRY - char* benchName = NULL; + char* benchName = NULL; + PyObject* pyEnforceVhdl = NULL; - if (PyArg_ParseTuple( args, "s:Blif.load", &benchName )) { - cell = Blif::load( benchName ); + if (PyArg_ParseTuple( args, "s|O:Blif.load", &benchName, &pyEnforceVhdl )) { + bool enforceVhdl = true; + if (pyEnforceVhdl and (PyObject_IsTrue(pyEnforceVhdl) == 0)) enforceVhdl = false; + cell = Blif::load( benchName, enforceVhdl ); } else { PyErr_SetString ( ConstructorError, "Blif.load(): Bad type or bad number of parameters." ); return NULL; diff --git a/etesian/src/PyEtesianEngine.cpp b/etesian/src/PyEtesianEngine.cpp index aa981c32..5378772d 100644 --- a/etesian/src/PyEtesianEngine.cpp +++ b/etesian/src/PyEtesianEngine.cpp @@ -89,7 +89,7 @@ extern "C" { HTRY PyObject* arg0; - if (not ParseOneArg("Etesian.get", args, CELL_ARG, &arg0)) return NULL; + if (not ParseOneArg("Etesian.create", args, CELL_ARG, &arg0)) return NULL; Cell* cell = PYCELL_O(arg0); etesian = EtesianEngine::get(cell); diff --git a/hurricane/src/hurricane/hurricane/Rectilinear.h b/hurricane/src/hurricane/hurricane/Rectilinear.h index 670e4a85..1df05c38 100644 --- a/hurricane/src/hurricane/hurricane/Rectilinear.h +++ b/hurricane/src/hurricane/hurricane/Rectilinear.h @@ -48,34 +48,39 @@ namespace Hurricane { typedef Component Super; public: - static Rectilinear* create ( Net*, const Layer*, const vector& ); - // Accessors. - virtual bool isNonRectangle () const; - virtual DbU::Unit getX () const; - virtual DbU::Unit getY () const; - virtual Box getBoundingBox () const; - virtual Box getBoundingBox ( const BasicLayer* ) const; - virtual size_t getPointsSize () const; - virtual Point getPoint ( size_t i ) const; - virtual const Layer* getLayer () const; - inline Points getContour () const; + static Rectilinear* create ( Net*, const Layer*, const vector& ); + // Accessors. + virtual bool isNonRectangle () const; + virtual DbU::Unit getX () const; + virtual DbU::Unit getY () const; + virtual Box getBoundingBox () const; + virtual Box getBoundingBox ( const BasicLayer* ) const; + virtual size_t getPointsSize () const; + virtual Point getPoint ( size_t i ) const; + virtual const Layer* getLayer () const; + inline Points getContour () const; + inline const vector& getPoints () const; // Mutators. - void setLayer ( const Layer* ); - virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy ); - void setPoints ( const vector& ); - // Hurricane management. - virtual void _toJson ( JsonWriter* ) const; - static JsonObject* getJsonObject ( unsigned long flags ); - virtual string _getTypeName () const; - virtual string _getString () const; - virtual Record* _getRecord () const; + void setLayer ( const Layer* ); + virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy ); + void setPoints ( const vector& ); + // Hurricane management. + virtual void _toJson ( JsonWriter* ) const; + static JsonObject* getJsonObject ( unsigned long flags ); + virtual string _getTypeName () const; + virtual string _getString () const; + virtual Record* _getRecord () const; protected: - Rectilinear ( Net*, const Layer*, const vector& ); + Rectilinear ( Net*, const Layer*, const vector& ); private: const Layer* _layer; vector _points; }; + + inline Points Rectilinear::getContour () const { return new VectorCollection(_points); } + inline const vector& Rectilinear::getPoints () const { return _points; } + // ------------------------------------------------------------------- // Class : "JsonRoutingRectilinear". diff --git a/hurricane/src/viewer/CellWidget.cpp b/hurricane/src/viewer/CellWidget.cpp index e73c1812..6b334fc4 100644 --- a/hurricane/src/viewer/CellWidget.cpp +++ b/hurricane/src/viewer/CellWidget.cpp @@ -677,13 +677,13 @@ namespace Hurricane { if ( (rectangle.width() > 4) and (rectangle.height() > 4) ) { QPolygon contour; for ( Point point : component->getContour() ) - contour << _cellWidget->dbuToScreenPoint( point ); + contour << _cellWidget->dbuToScreenPoint( transformation.getPoint(point) ); _cellWidget->drawScreenPolygon( contour ); if ( component->isManhattanized() and (_cellWidget->dbuToScreenLength(DbU::getPolygonStep()) > 4) ) { for ( Point point : component->getMContour() ) - contour << _cellWidget->dbuToScreenPoint( point ); + contour << _cellWidget->dbuToScreenPoint( transformation.getPoint(point) ); _cellWidget->drawScreenPolygon( contour ); // const Polygon* polygon = dynamic_cast( component ); diff --git a/unicorn/src/UnicornGui.cpp b/unicorn/src/UnicornGui.cpp index c99ed087..a7f19462 100644 --- a/unicorn/src/UnicornGui.cpp +++ b/unicorn/src/UnicornGui.cpp @@ -98,7 +98,7 @@ namespace Unicorn { _importCell.setDialog( _importDialog ); _importCell.addImporter ( "JSON (experimental)" , std::bind( &Cell::fromJson , placeholders::_1 ) ); - _importCell.addImporter ( "BLIF (Yosys/ABC)" , std::bind( &Blif::load , placeholders::_1 ) ); + _importCell.addImporter ( "BLIF (Yosys/ABC)" , std::bind( &Blif::load , placeholders::_1, true ) ); _importCell.addImporter ( "ACM/SIGDA (aka MCNC, .bench)", std::bind( &AcmSigda::load , placeholders::_1 ) ); _importCell.addImporter ( "ISPD'04 (Bookshelf)" , std::bind( &Ispd04::load , placeholders::_1 ) ); _importCell.addImporter ( "ISPD'05 (Bookshelf)" , std::bind( &Ispd05::load , placeholders::_1 ) );