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:
Jean-Paul Chaput 2021-12-11 19:48:57 +01:00
parent 2f0bf5456d
commit ba2a74e35d
2 changed files with 23 additions and 9 deletions

View File

@ -491,16 +491,18 @@ namespace {
if (not cell->getNet(_groundName)) {
Net* vss = Net::create ( _cell, _groundName );
vss->setExternal( true );
vss->setGlobal ( true );
vss->setType ( Net::Type::GROUND );
vss->setExternal ( true );
vss->setGlobal ( true );
vss->setType ( Net::Type::GROUND );
vss->setDirection( Net::Direction::IN );
}
if (not cell->getNet(_powerName)) {
Net* vdd = Net::create ( _cell, _powerName );
vdd->setExternal( true );
vdd->setGlobal ( true );
vdd->setType ( Net::Type::POWER );
vdd->setExternal ( true );
vdd->setGlobal ( true );
vdd->setType ( Net::Type::POWER );
vdd->setDirection( Net::Direction::IN );
}
}
}

View File

@ -89,6 +89,7 @@ namespace {
DefParser ( string file, AllianceLibrary*, unsigned int flags );
~DefParser ();
inline bool hasErrors ();
inline bool isSky130 () const;
inline unsigned int getFlags () const;
inline AllianceLibrary* getLibrary ();
inline Cell* getCell ();
@ -194,6 +195,7 @@ namespace {
AllianceFramework* DefParser::getFramework () { return _framework; }
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 bool DefParser::isSky130 () const { return _flags & Sky130; }
inline bool DefParser::hasErrors () { return not _errors.empty(); }
inline unsigned int DefParser::getFlags () const { return _flags; }
inline string DefParser::getBusBits () const { return _busBits; }
@ -538,6 +540,8 @@ namespace {
string pinName = pin->pinName();
parser->toHurricaneName( netName );
parser->toHurricaneName( pinName );
if (parser->isSky130() and (pinName.substr(0,3) == "io_" ))
netName = pinName;
NetDatas* netDatas = parser->lookupNet( netName );
Net* hnet = NULL;
@ -914,8 +918,14 @@ namespace {
_framework = AllianceFramework::get();
_technology = DataBase::getDB()->getTechnology();
size_t islash = file.rfind ( '/' );
string designName = file.substr( ((islash == string::npos) ? 0 : islash), file.size()-4 );
size_t istart = 0;
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 );
unique_ptr<DefParser> parser ( new DefParser(file,library,flags) );
@ -951,7 +961,9 @@ namespace CRL {
Cell* cell = NULL;
#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
cerr << "[ERROR] CRL::DefImport::load(): \n"
<< " Coriolis2 hasn't been compiled with LEF/DEF support. To enable LEF/DEF\n"