Big bug in HyperNet_ComponentOccurrences::Locator::progress().

* Bug: In HyperNet_ComponentOccurrences::Locator::progress(), (Collection
    locator), the _netOccurrenceLocator (which progess along the various
    Net occurrences of the HyperNet) was not in synch with the
    _componentOccurrence locator of the current net. It was pointing
    to the *next* net occurrence.
      The result was the generation of a path for the net commponents
    that was incorrect (it was the path of the *next* net occurrence),
    and making Occurrence constructor throw an exception.
* Change: In Cell::flattenNets(), DeepNet::_createRoutingPads(),
    Occurrence::Occurrence() and UpdateSession, added even more trace
    informations.
This commit is contained in:
Jean-Paul Chaput 2021-03-23 17:06:02 +01:00
parent cfcd4b7115
commit 9230d52b64
6 changed files with 42 additions and 13 deletions

View File

@ -818,7 +818,7 @@ void Cell::flattenNets (uint64_t flags )
void Cell::flattenNets ( const Instance* instance, uint64_t flags ) void Cell::flattenNets ( const Instance* instance, uint64_t flags )
// **************************************************************** // ****************************************************************
{ {
cdebug_log(18,0) << "Cell::flattenNets() flags:0x" << hex << flags << endl; cdebug_log(18,1) << "Cell::flattenNets() flags:0x" << hex << flags << endl;
UpdateSession::open(); UpdateSession::open();
@ -868,8 +868,12 @@ void Cell::flattenNets ( const Instance* instance, uint64_t flags )
for ( size_t i=0 ; i<hyperNets.size() ; ++i ) { for ( size_t i=0 ; i<hyperNets.size() ; ++i ) {
DeepNet* deepNet = DeepNet::create( hyperNets[i] ); DeepNet* deepNet = DeepNet::create( hyperNets[i] );
cdebug_log(18,1) << "Flattening hyper net: " << deepNet << endl;
if (deepNet) deepNet->_createRoutingPads( flags ); if (deepNet) deepNet->_createRoutingPads( flags );
cdebug_log(18,0) << "Done: " << deepNet << endl;
cdebug_tabw(18,-1);
} }
cdebug_log(18,0) << "Non-root HyperNet (DeepNet) done" << endl;
unsigned int rpFlags = (flags & Flags::StayOnPlugs) ? 0 : RoutingPad::BiggestArea; unsigned int rpFlags = (flags & Flags::StayOnPlugs) ? 0 : RoutingPad::BiggestArea;
@ -903,7 +907,9 @@ void Cell::flattenNets ( const Instance* instance, uint64_t flags )
DebugSession::close(); DebugSession::close();
} }
cdebug_log(18,0) << "Before closing UpdateSession" << endl;
UpdateSession::close(); UpdateSession::close();
cdebug_log(18,-1) << "Cell::flattenNets() Done" << endl;
} }

View File

@ -85,6 +85,8 @@ namespace Hurricane {
size_t DeepNet::_createRoutingPads ( unsigned int flags ) size_t DeepNet::_createRoutingPads ( unsigned int flags )
{ {
cdebug_log(18,1) << "DeepNet::_createRoutingPads(): " << this << endl;
size_t nbRoutingPads = 0; size_t nbRoutingPads = 0;
HyperNet hyperNet ( _netOccurrence ); HyperNet hyperNet ( _netOccurrence );
RoutingPad* currentRp = NULL; RoutingPad* currentRp = NULL;
@ -92,11 +94,18 @@ namespace Hurricane {
//unsigned int rpFlags = (flags & Cell::Flags::StayOnPlugs) ? 0 : RoutingPad::BiggestArea; //unsigned int rpFlags = (flags & Cell::Flags::StayOnPlugs) ? 0 : RoutingPad::BiggestArea;
for ( Occurrence occurrence : hyperNet.getComponentOccurrences() ) { for ( Occurrence occurrence : hyperNet.getComponentOccurrences() ) {
cdebug_log(18,0) << "| occurrence=" << occurrence << endl;
RoutingPad* rp = dynamic_cast<RoutingPad*>( occurrence.getEntity() ); RoutingPad* rp = dynamic_cast<RoutingPad*>( occurrence.getEntity() );
cdebug_log(18,0) << "| rp=" << rp << endl;
if (rp and (rp->getCell() == getCell())) { createRp = false; break; } if (rp and (rp->getCell() == getCell())) { createRp = false; break; }
if (dynamic_cast<Segment*>(occurrence.getEntity())) { createRp = false; break; } if (dynamic_cast<Segment*>(occurrence.getEntity())) { createRp = false; break; }
cdebug_log(18,0) << "| dynamic_cast OK createRp=" << createRp << endl;
}
if (not createRp) {
cdebug_log(18,0) << "DeepNet::_createRoutingPads(): No RoutingPad created" << endl;
cdebug_tabw(18,-1);
return 0;
} }
if (not createRp) return 0;
for ( Occurrence occurrence : hyperNet.getTerminalNetlistPlugOccurrences() ) { for ( Occurrence occurrence : hyperNet.getTerminalNetlistPlugOccurrences() ) {
nbRoutingPads++; nbRoutingPads++;
@ -110,6 +119,8 @@ namespace Hurricane {
} }
} }
cdebug_log(18,0) << "DeepNet::_createRoutingPads(): done on " << this << endl;
cdebug_tabw(18,-1);
return nbRoutingPads; return nbRoutingPads;
} }

View File

@ -1224,23 +1224,32 @@ void HyperNet_ComponentOccurrences::Locator::progress()
if (_componentLocator.isValid()) { if (_componentLocator.isValid()) {
Path path = _netOccurrenceLocator.getElement().getPath(); Path path = _netOccurrenceLocator.getElement().getPath();
Component* component = _componentLocator.getElement(); Component* component = _componentLocator.getElement();
cdebug_log(18,0) << "| progress component: " << component << endl;
//_componentOccurrence = Occurrence( component, path.getHeadPath() );
_componentOccurrence = Occurrence( component, path );
cdebug_log(18,0) << "| component occ OK" << endl;
_componentLocator.progress(); _componentLocator.progress();
_componentOccurrence = Occurrence( component, path.getHeadPath() );
} else { } else {
_netOccurrenceLocator.progress();
if (_netOccurrenceLocator.isValid()) { if (_netOccurrenceLocator.isValid()) {
Occurrence netOccurrence = _netOccurrenceLocator.getElement(); Occurrence netOccurrence = _netOccurrenceLocator.getElement();
_netOccurrenceLocator.progress(); cdebug_log(18,0) << "| progress net occ: " << _netOccurrenceLocator.getElement() << endl;
Net* net = static_cast<Net*>( netOccurrence.getEntity() ); Net* net = static_cast<Net*>( netOccurrence.getEntity() );
//if (_withTerminalNetlistCells or not net->getCell()->isTerminal()) { //if (_withTerminalNetlistCells or not net->getCell()->isTerminal()) {
if (not net->getCell()->isTerminalNetlist()) { if (not net->getCell()->isTerminalNetlist()) {
cdebug_log(18,0) << "| Non Terminal netlist: " << net->getCell() << endl;
cdebug_log(18,0) << "| set component loc on: " << net << endl;
_componentLocator = net->getComponents().getLocator(); _componentLocator = net->getComponents().getLocator();
} else {
cdebug_log(18,0) << "| Terminal netlist: " << net->getCell() << endl;
} }
} else } else
break; break;
} }
} }
cdebug_log(18,0) << "| progress done: " << endl;
} }
string HyperNet_ComponentOccurrences::Locator::_getString() const string HyperNet_ComponentOccurrences::Locator::_getString() const

View File

@ -51,9 +51,11 @@ Occurrence::Occurrence(const Entity* entity, const Path& path)
if (_sharedPath) { if (_sharedPath) {
if (_entity->getCell() != _sharedPath->getMasterCell()) if (_entity->getCell() != _sharedPath->getMasterCell())
throw Error( "Occurrence::Occurrence(): Entity incompatible with the path.\n" throw Error( "Occurrence::Occurrence(): Entity incompatible with the path.\n"
" * Entity master cell: %s\n" " * Entity %s, master cell %s\n"
" * Path master cell: %s" " * Path %s, master cell %s"
, getString(entity).c_str()
, getString(entity->getCell()).c_str() , getString(entity->getCell()).c_str()
, getString(path).c_str()
, getString(_sharedPath->getMasterCell()).c_str() , getString(_sharedPath->getMasterCell()).c_str()
); );
} }

View File

@ -190,7 +190,7 @@ void Go::invalidate(bool propagateFlag)
void UpdateSession::open() void UpdateSession::open()
// *********************** // ***********************
{ {
cdebug_log(18,1) << "UpdateSession::open()" << endl; cdebug_log(18,1) << "UpdateSession::open() [stack=" << (UPDATOR_STACK->size()+1) << "]" << endl;
UpdateSession::_create(); UpdateSession::_create();
} }
@ -198,7 +198,7 @@ void UpdateSession::close()
// ************************ // ************************
{ {
cdebug_tabw(18,-1); cdebug_tabw(18,-1);
cdebug_log(18,1) << "UpdateSession::close() - Start materialization." << endl; cdebug_log(18,1) << "UpdateSession::close() [stack:" << UPDATOR_STACK->size() << "] Start materialization." << endl;
if (!UPDATOR_STACK || UPDATOR_STACK->empty()) if (!UPDATOR_STACK || UPDATOR_STACK->empty())
throw Error("Can't end update : empty update session stack"); throw Error("Can't end update : empty update session stack");
@ -206,7 +206,7 @@ void UpdateSession::close()
UPDATOR_STACK->top()->_destroy(); UPDATOR_STACK->top()->_destroy();
cdebug_tabw(18,-1); cdebug_tabw(18,-1);
cdebug_log(18,0) << "UpdateSession::close() - Materialization completed." << endl; cdebug_log(18,0) << "UpdateSession::close() [stack:" << UPDATOR_STACK->size() << "] Materialization completed." << endl;
} }
void UpdateSession::reset() void UpdateSession::reset()

View File

@ -74,6 +74,7 @@ namespace Hurricane {
bool ExceptionWidget::catchAllWrapper ( std::function< void() > method ) bool ExceptionWidget::catchAllWrapper ( std::function< void() > method )
{ {
cdebug_log(18,0) << "ExceptionWidget::catchAllWrapper()" << endl;
bool failure = true; bool failure = true;
try { try {
method(); method();