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:
parent
9a872b10af
commit
0b605000ed
|
@ -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 ) ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -608,23 +608,33 @@ namespace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Diagonal* diagonal = dynamic_cast<Diagonal*>(component);
|
Rectilinear* rectilinear = dynamic_cast<Rectilinear*>(component);
|
||||||
if (diagonal) {
|
if (rectilinear) {
|
||||||
for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) {
|
for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) {
|
||||||
(*this) << BOUNDARY;
|
(*this) << BOUNDARY;
|
||||||
(*this) << layer;
|
(*this) << layer;
|
||||||
(*this) << diagonal->getContour();
|
(*this) << rectilinear->getPoints();
|
||||||
(*this) << ENDEL;
|
(*this) << ENDEL;
|
||||||
}
|
}
|
||||||
} else if ( dynamic_cast<Horizontal*>(component)
|
} else {
|
||||||
or dynamic_cast<Vertical *>(component)
|
Diagonal* diagonal = dynamic_cast<Diagonal*>(component);
|
||||||
or dynamic_cast<Contact *>(component)
|
if (diagonal) {
|
||||||
or dynamic_cast<Pad *>(component)) {
|
for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) {
|
||||||
for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) {
|
(*this) << BOUNDARY;
|
||||||
(*this) << BOUNDARY;
|
(*this) << layer;
|
||||||
(*this) << layer;
|
(*this) << diagonal->getContour();
|
||||||
(*this) << component->getBoundingBox(layer);
|
(*this) << ENDEL;
|
||||||
(*this) << ENDEL;
|
}
|
||||||
|
} else if ( dynamic_cast<Horizontal*>(component)
|
||||||
|
or dynamic_cast<Vertical *>(component)
|
||||||
|
or dynamic_cast<Contact *>(component)
|
||||||
|
or dynamic_cast<Pad *>(component)) {
|
||||||
|
for ( const BasicLayer* layer : component->getLayer()->getBasicLayers() ) {
|
||||||
|
(*this) << BOUNDARY;
|
||||||
|
(*this) << layer;
|
||||||
|
(*this) << component->getBoundingBox(layer);
|
||||||
|
(*this) << ENDEL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,10 +87,13 @@ extern "C" {
|
||||||
Cell* cell = NULL;
|
Cell* cell = NULL;
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -48,35 +48,40 @@ namespace Hurricane {
|
||||||
typedef Component Super;
|
typedef Component Super;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static Rectilinear* create ( Net*, const Layer*, const vector<Point>& );
|
static Rectilinear* create ( Net*, const Layer*, const vector<Point>& );
|
||||||
// Accessors.
|
// Accessors.
|
||||||
virtual bool isNonRectangle () const;
|
virtual bool isNonRectangle () const;
|
||||||
virtual DbU::Unit getX () const;
|
virtual DbU::Unit getX () const;
|
||||||
virtual DbU::Unit getY () const;
|
virtual DbU::Unit getY () const;
|
||||||
virtual Box getBoundingBox () const;
|
virtual Box getBoundingBox () const;
|
||||||
virtual Box getBoundingBox ( const BasicLayer* ) const;
|
virtual Box getBoundingBox ( const BasicLayer* ) const;
|
||||||
virtual size_t getPointsSize () const;
|
virtual size_t getPointsSize () const;
|
||||||
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 );
|
||||||
void setPoints ( const vector<Point>& );
|
void setPoints ( const vector<Point>& );
|
||||||
// Hurricane management.
|
// Hurricane management.
|
||||||
virtual void _toJson ( JsonWriter* ) const;
|
virtual void _toJson ( JsonWriter* ) const;
|
||||||
static JsonObject* getJsonObject ( unsigned long flags );
|
static JsonObject* getJsonObject ( unsigned long flags );
|
||||||
virtual string _getTypeName () const;
|
virtual string _getTypeName () const;
|
||||||
virtual string _getString () const;
|
virtual string _getString () const;
|
||||||
virtual Record* _getRecord () const;
|
virtual Record* _getRecord () const;
|
||||||
protected:
|
protected:
|
||||||
Rectilinear ( Net*, const Layer*, const vector<Point>& );
|
Rectilinear ( Net*, const Layer*, const vector<Point>& );
|
||||||
private:
|
private:
|
||||||
const Layer* _layer;
|
const Layer* _layer;
|
||||||
vector<Point> _points;
|
vector<Point> _points;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline Points Rectilinear::getContour () const { return new VectorCollection<Point>(_points); }
|
||||||
|
inline const vector<Point>& Rectilinear::getPoints () const { return _points; }
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "JsonRoutingRectilinear".
|
// Class : "JsonRoutingRectilinear".
|
||||||
|
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
|
@ -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 ) );
|
||||||
|
|
Loading…
Reference in New Issue