Bug fixes in Blif parser (no VHDL enforcement) & GDS driver.

* Bug: In Hurricane::DrawingQuery::drawGo(), forgot to apply translation
    on Polygon and Rectilinear.
* Bug: In Hurricane::Rectilinear, forgot implementation of getContour().
    Add a new accessor getPoints().
* Bug: In CRL::Blif::load(), do not always enforce translation towards
    VHDL names. When loading LEF+gds it may change the Cell names between
    the two stages so the gds layout do not get added to the LEF Cell
    phantom.
      Now add a boolean enforceVhdl argument (may be a flag in the future).
* Bug: In ::GdsStream::operator<<(Cell*), forgot to drive the Rectilinear.
This commit is contained in:
Jean-Paul Chaput 2019-03-07 20:14:08 +01:00
parent 9a872b10af
commit 0b605000ed
9 changed files with 62 additions and 44 deletions

View File

@ -103,7 +103,7 @@ namespace CRL {
, "BLIF (Yosys/ABC)" , "BLIF (Yosys/ABC)"
, CellLoader::Importer|CellLoader::MultiCell , CellLoader::Importer|CellLoader::MultiCell
, Catalog::State::Logical , Catalog::State::Logical
, std::bind( &Blif::load, placeholders::_1 ) ) ); , std::bind( &Blif::load, placeholders::_1, true ) ) );
} }
} }

View File

@ -667,7 +667,7 @@ namespace CRL {
{ if (library) _libraries.push_back( library ); } { if (library) _libraries.push_back( library ); }
Cell* Blif::load ( string cellPath ) Cell* Blif::load ( string cellPath, bool enforceVhdl )
{ {
using namespace std; using namespace std;
@ -824,7 +824,7 @@ namespace CRL {
Model::orderModels(); Model::orderModels();
Model::connectModels(); Model::connectModels();
Model::toVhdlModels(); if (enforceVhdl) Model::toVhdlModels();
Model::clearStatic(); Model::clearStatic();
UpdateSession::close(); UpdateSession::close();

View File

@ -56,7 +56,7 @@ namespace CRL {
class Blif { class Blif {
public: public:
static Cell* load ( std::string netlist ); static Cell* load ( std::string netlist, bool enforceVhdl=true );
static void add ( Library* ); static void add ( Library* );
static inline const std::vector<Library*>& getLibraries (); static inline const std::vector<Library*>& getLibraries ();
private: private:

View File

@ -607,6 +607,15 @@ namespace {
(*this) << ENDEL; (*this) << ENDEL;
} }
} }
} else {
Rectilinear* rectilinear = dynamic_cast<Rectilinear*>(component);
if (rectilinear) {
for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) {
(*this) << BOUNDARY;
(*this) << layer;
(*this) << rectilinear->getPoints();
(*this) << ENDEL;
}
} else { } else {
Diagonal* diagonal = dynamic_cast<Diagonal*>(component); Diagonal* diagonal = dynamic_cast<Diagonal*>(component);
if (diagonal) { if (diagonal) {
@ -630,6 +639,7 @@ namespace {
} }
} }
} }
}
(*this) << ENDSTR; (*this) << ENDSTR;

View File

@ -88,9 +88,12 @@ extern "C" {
HTRY HTRY
char* benchName = NULL; char* benchName = NULL;
PyObject* pyEnforceVhdl = NULL;
if (PyArg_ParseTuple( args, "s:Blif.load", &benchName )) { if (PyArg_ParseTuple( args, "s|O:Blif.load", &benchName, &pyEnforceVhdl )) {
cell = Blif::load( benchName ); bool enforceVhdl = true;
if (pyEnforceVhdl and (PyObject_IsTrue(pyEnforceVhdl) == 0)) enforceVhdl = false;
cell = Blif::load( benchName, enforceVhdl );
} else { } else {
PyErr_SetString ( ConstructorError, "Blif.load(): Bad type or bad number of parameters." ); PyErr_SetString ( ConstructorError, "Blif.load(): Bad type or bad number of parameters." );
return NULL; return NULL;

View File

@ -89,7 +89,7 @@ extern "C" {
HTRY HTRY
PyObject* arg0; 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); Cell* cell = PYCELL_O(arg0);
etesian = EtesianEngine::get(cell); etesian = EtesianEngine::get(cell);

View File

@ -59,6 +59,7 @@ namespace Hurricane {
virtual Point getPoint ( size_t i ) const; virtual Point getPoint ( size_t i ) const;
virtual const Layer* getLayer () const; virtual const Layer* getLayer () const;
inline Points getContour () const; inline Points getContour () const;
inline const vector<Point>& getPoints () const;
// Mutators. // Mutators.
void setLayer ( const Layer* ); void setLayer ( const Layer* );
virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy ); virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
@ -77,6 +78,10 @@ namespace Hurricane {
}; };
inline Points Rectilinear::getContour () const { return new VectorCollection<Point>(_points); }
inline const vector<Point>& Rectilinear::getPoints () const { return _points; }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// Class : "JsonRoutingRectilinear". // Class : "JsonRoutingRectilinear".

View File

@ -677,13 +677,13 @@ namespace Hurricane {
if ( (rectangle.width() > 4) and (rectangle.height() > 4) ) { if ( (rectangle.width() > 4) and (rectangle.height() > 4) ) {
QPolygon contour; QPolygon contour;
for ( Point point : component->getContour() ) for ( Point point : component->getContour() )
contour << _cellWidget->dbuToScreenPoint( point ); contour << _cellWidget->dbuToScreenPoint( transformation.getPoint(point) );
_cellWidget->drawScreenPolygon( contour ); _cellWidget->drawScreenPolygon( contour );
if ( component->isManhattanized() if ( component->isManhattanized()
and (_cellWidget->dbuToScreenLength(DbU::getPolygonStep()) > 4) ) { and (_cellWidget->dbuToScreenLength(DbU::getPolygonStep()) > 4) ) {
for ( Point point : component->getMContour() ) for ( Point point : component->getMContour() )
contour << _cellWidget->dbuToScreenPoint( point ); contour << _cellWidget->dbuToScreenPoint( transformation.getPoint(point) );
_cellWidget->drawScreenPolygon( contour ); _cellWidget->drawScreenPolygon( contour );
// const Polygon* polygon = dynamic_cast<const Polygon*>( component ); // const Polygon* polygon = dynamic_cast<const Polygon*>( component );

View File

@ -98,7 +98,7 @@ namespace Unicorn {
_importCell.setDialog( _importDialog ); _importCell.setDialog( _importDialog );
_importCell.addImporter<Cell*> ( "JSON (experimental)" , std::bind( &Cell::fromJson , placeholders::_1 ) ); _importCell.addImporter<Cell*> ( "JSON (experimental)" , std::bind( &Cell::fromJson , placeholders::_1 ) );
_importCell.addImporter<Cell*> ( "BLIF (Yosys/ABC)" , std::bind( &Blif::load , placeholders::_1 ) ); _importCell.addImporter<Cell*> ( "BLIF (Yosys/ABC)" , std::bind( &Blif::load , placeholders::_1, true ) );
_importCell.addImporter<Cell*> ( "ACM/SIGDA (aka MCNC, .bench)", std::bind( &AcmSigda::load , placeholders::_1 ) ); _importCell.addImporter<Cell*> ( "ACM/SIGDA (aka MCNC, .bench)", std::bind( &AcmSigda::load , placeholders::_1 ) );
_importCell.addImporter<Cell*> ( "ISPD'04 (Bookshelf)" , std::bind( &Ispd04::load , placeholders::_1 ) ); _importCell.addImporter<Cell*> ( "ISPD'04 (Bookshelf)" , std::bind( &Ispd04::load , placeholders::_1 ) );
_importCell.addImporter<Cell*> ( "ISPD'05 (Bookshelf)" , std::bind( &Ispd05::load , placeholders::_1 ) ); _importCell.addImporter<Cell*> ( "ISPD'05 (Bookshelf)" , std::bind( &Ispd05::load , placeholders::_1 ) );