Correct the SPICE driver in case a Net is missing Spice::BitExtension.

* Change: In Spice::Entity::toEntity(), add an error message if the
    Spice::Bit extension is missing.
This commit is contained in:
Jean-Paul Chaput 2021-06-23 00:06:51 +02:00
parent 51ca8ab4af
commit 0d7e0fa88b
2 changed files with 34 additions and 7 deletions

View File

@ -1658,6 +1658,7 @@ namespace {
<< "\" in " << layer
<< " @" << ref._position
<< endl;
cdebug_log(101,0) << "| In " << net->getCell() << endl;
if (not layer) continue;
vector<Component*> toDestroy;
@ -1675,6 +1676,7 @@ namespace {
);
NetExternalComponents::setExternal( h );
toDestroy.push_back( component );
cdebug_log(101,0) << "> external duplicate " << h << endl;
} else {
Vertical* vref = dynamic_cast<Vertical*>( component );
if (vref) {
@ -1687,6 +1689,7 @@ namespace {
);
NetExternalComponents::setExternal( v );
toDestroy.push_back( component );
cdebug_log(101,0) << "> external duplicate " << v << endl;
} else {
Pad* pref = dynamic_cast<Pad*>( component );
if (pref) {
@ -1696,6 +1699,7 @@ namespace {
);
NetExternalComponents::setExternal( p );
toDestroy.push_back( component );
cdebug_log(101,0) << "> external duplicate " << p << endl;
}
}
}

View File

@ -35,6 +35,7 @@ namespace {
namespace Spice {
using namespace std;
using Hurricane::Error;
using Hurricane::Warning;
using Hurricane::Property;
using Hurricane::_TName;
@ -167,15 +168,37 @@ namespace Spice {
for ( Plug* plug : sortedPlugs ) {
Net* plugNet = plug->getNet();
if (plugNet) {
out << " " << BitExtension::getName(plugNet);
Bit* bit = BitExtension::get( plugNet );
if (bit)
out << " " << bit->getName();
else {
cerr << Error( "SpiceEntity::toEntity(): In %s, Net \"%s\" is missing a Spice::Bit extension.\n"
, getString(getCell()).c_str()
, getString(plugNet).c_str()
) << endl;
}
} else {
if (plug->getMasterNet()->isPower()) {
out << " " << _powerNode;
} else {
if (plug->getMasterNet()->isGround()) {
out << " " << _groundNode;
} else
Net* masterNet = plug->getMasterNet();
if (masterNet->isGlobal()) {
plugNet = getCell()->getNet( masterNet->getName() );
if (plugNet) {
Bit* bit = BitExtension::get( plugNet );
if (bit)
out << " " << bit->getName();
else {
cerr << Error( "SpiceEntity::toEntity(): In %s, Net \"%s\" is missing a Spice::Bit extension.\n"
, getString(getCell()).c_str()
, getString(plugNet).c_str()
) << endl;
}
} else {
cerr << Error( "SpiceEntity::toEntity(): In %s, unconnected Plug,\n"
" %s"
, getString(getCell()).c_str()
, getString(plug).c_str()
) << endl;
out << " ?";
}
}
}
}