Tweaked DEF support to load the Caravel harness.
* Bug: In CRL::BlifParser::Model CTOR, forgot to set the direction on auto-generated power supply global nets. So they were put in "linkage" in the VST files. * New: In CRL::DefImport, add specific support for the Sky130/Caravel harness "user_project_wrapper".Mainly: - Do not fuse together "io_in" and "io_out" as a single net as they should (according to the DEF). So we can connect separately on each of them. We only allow one port for each net, as in VHDL.
This commit is contained in:
parent
2f0bf5456d
commit
ba2a74e35d
|
@ -491,16 +491,18 @@ namespace {
|
||||||
|
|
||||||
if (not cell->getNet(_groundName)) {
|
if (not cell->getNet(_groundName)) {
|
||||||
Net* vss = Net::create ( _cell, _groundName );
|
Net* vss = Net::create ( _cell, _groundName );
|
||||||
vss->setExternal( true );
|
vss->setExternal ( true );
|
||||||
vss->setGlobal ( true );
|
vss->setGlobal ( true );
|
||||||
vss->setType ( Net::Type::GROUND );
|
vss->setType ( Net::Type::GROUND );
|
||||||
|
vss->setDirection( Net::Direction::IN );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (not cell->getNet(_powerName)) {
|
if (not cell->getNet(_powerName)) {
|
||||||
Net* vdd = Net::create ( _cell, _powerName );
|
Net* vdd = Net::create ( _cell, _powerName );
|
||||||
vdd->setExternal( true );
|
vdd->setExternal ( true );
|
||||||
vdd->setGlobal ( true );
|
vdd->setGlobal ( true );
|
||||||
vdd->setType ( Net::Type::POWER );
|
vdd->setType ( Net::Type::POWER );
|
||||||
|
vdd->setDirection( Net::Direction::IN );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,6 +89,7 @@ namespace {
|
||||||
DefParser ( string file, AllianceLibrary*, unsigned int flags );
|
DefParser ( string file, AllianceLibrary*, unsigned int flags );
|
||||||
~DefParser ();
|
~DefParser ();
|
||||||
inline bool hasErrors ();
|
inline bool hasErrors ();
|
||||||
|
inline bool isSky130 () const;
|
||||||
inline unsigned int getFlags () const;
|
inline unsigned int getFlags () const;
|
||||||
inline AllianceLibrary* getLibrary ();
|
inline AllianceLibrary* getLibrary ();
|
||||||
inline Cell* getCell ();
|
inline Cell* getCell ();
|
||||||
|
@ -194,6 +195,7 @@ namespace {
|
||||||
AllianceFramework* DefParser::getFramework () { return _framework; }
|
AllianceFramework* DefParser::getFramework () { return _framework; }
|
||||||
inline void DefParser::setUnits ( double units ) { _defUnits = 1/units; }
|
inline void DefParser::setUnits ( double units ) { _defUnits = 1/units; }
|
||||||
inline DbU::Unit DefParser::fromDefUnits ( int u ) { return DbU::fromPhysical(_defUnits*(double)u,DbU::UnitPower::Micro); }
|
inline DbU::Unit DefParser::fromDefUnits ( int u ) { return DbU::fromPhysical(_defUnits*(double)u,DbU::UnitPower::Micro); }
|
||||||
|
inline bool DefParser::isSky130 () const { return _flags & Sky130; }
|
||||||
inline bool DefParser::hasErrors () { return not _errors.empty(); }
|
inline bool DefParser::hasErrors () { return not _errors.empty(); }
|
||||||
inline unsigned int DefParser::getFlags () const { return _flags; }
|
inline unsigned int DefParser::getFlags () const { return _flags; }
|
||||||
inline string DefParser::getBusBits () const { return _busBits; }
|
inline string DefParser::getBusBits () const { return _busBits; }
|
||||||
|
@ -538,6 +540,8 @@ namespace {
|
||||||
string pinName = pin->pinName();
|
string pinName = pin->pinName();
|
||||||
parser->toHurricaneName( netName );
|
parser->toHurricaneName( netName );
|
||||||
parser->toHurricaneName( pinName );
|
parser->toHurricaneName( pinName );
|
||||||
|
if (parser->isSky130() and (pinName.substr(0,3) == "io_" ))
|
||||||
|
netName = pinName;
|
||||||
|
|
||||||
NetDatas* netDatas = parser->lookupNet( netName );
|
NetDatas* netDatas = parser->lookupNet( netName );
|
||||||
Net* hnet = NULL;
|
Net* hnet = NULL;
|
||||||
|
@ -914,8 +918,14 @@ namespace {
|
||||||
_framework = AllianceFramework::get();
|
_framework = AllianceFramework::get();
|
||||||
_technology = DataBase::getDB()->getTechnology();
|
_technology = DataBase::getDB()->getTechnology();
|
||||||
|
|
||||||
size_t islash = file.rfind ( '/' );
|
size_t istart = 0;
|
||||||
string designName = file.substr( ((islash == string::npos) ? 0 : islash), file.size()-4 );
|
size_t length = file.size() - 4;
|
||||||
|
size_t islash = file.rfind ( '/' );
|
||||||
|
if (islash != string::npos) {
|
||||||
|
istart = islash + 1;
|
||||||
|
length = file.size() - istart - 4;
|
||||||
|
}
|
||||||
|
string designName = file.substr( istart, length );
|
||||||
AllianceLibrary* library = _framework->getAllianceLibrary( (unsigned int)0 );
|
AllianceLibrary* library = _framework->getAllianceLibrary( (unsigned int)0 );
|
||||||
unique_ptr<DefParser> parser ( new DefParser(file,library,flags) );
|
unique_ptr<DefParser> parser ( new DefParser(file,library,flags) );
|
||||||
|
|
||||||
|
@ -951,7 +961,9 @@ namespace CRL {
|
||||||
|
|
||||||
Cell* cell = NULL;
|
Cell* cell = NULL;
|
||||||
#if defined(HAVE_LEFDEF)
|
#if defined(HAVE_LEFDEF)
|
||||||
cell = DefParser::parse ( design+".def", flags );
|
if ((design.size() > 4) and (design.substr(design.size()-4) != ".def"))
|
||||||
|
design += ".def";
|
||||||
|
cell = DefParser::parse ( design, flags );
|
||||||
#else
|
#else
|
||||||
cerr << "[ERROR] CRL::DefImport::load(): \n"
|
cerr << "[ERROR] CRL::DefImport::load(): \n"
|
||||||
<< " Coriolis2 hasn't been compiled with LEF/DEF support. To enable LEF/DEF\n"
|
<< " Coriolis2 hasn't been compiled with LEF/DEF support. To enable LEF/DEF\n"
|
||||||
|
|
Loading…
Reference in New Issue