diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index 010ed09e..8e938eb7 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -617,12 +617,14 @@ void Cell::flattenNets(unsigned int flags) HyperNet hyperNet ( occurrence ); if ( not occurrence.getPath().isEmpty() ) { - //cerr << "* HyperNet: " << occurrence.getName() << endl; Net* duplicate = getNet( occurrence.getName() ); if (not duplicate) { hyperNets.push_back( HyperNet(occurrence) ); } else { - trace << "Found " << duplicate << " in " << duplicate->getCell() << endl; + cerr << Warning( "Cell::flattenNets(): Found duplicate: \"%s\" in \"%s\"" + , getString(duplicate).c_str() + , getString(duplicate->getCell()->getName()).c_str() + ) << endl; } continue; } diff --git a/hurricane/src/hurricane/CellCollections.cpp b/hurricane/src/hurricane/CellCollections.cpp index 83b09eba..904cff01 100644 --- a/hurricane/src/hurricane/CellCollections.cpp +++ b/hurricane/src/hurricane/CellCollections.cpp @@ -4704,7 +4704,7 @@ string Cell_HyperNetRootNetOccurrences::_getString() const // **************************************************************************************************** Cell_HyperNetRootNetOccurrences::Locator::Locator() -// *********************************** +// ************************************************ : Inherit(), _path(), _netLocator(), @@ -4714,22 +4714,24 @@ Cell_HyperNetRootNetOccurrences::Locator::Locator() } Cell_HyperNetRootNetOccurrences::Locator::Locator(const Cell* cell, Path path) -// ************************************************************** +// *************************************************************************** : Inherit(), _path(path), _netLocator(), _instanceLocator(), _hyperNetRootNetOccurrenceLocator() { - _netLocator=cell->getNets().getLocator(); + _netLocator = cell->getNets().getLocator(); + _instanceLocator = cell->getInstances().getLocator(); - _instanceLocator=cell->getInstances().getLocator(); - - while (_netLocator.isValid() && !isHyperNetRootNetOccurrence(Occurrence(_netLocator.getElement(),_path))) + while ( _netLocator.isValid() + and ( dynamic_cast(_netLocator.getElement()) + or _netLocator.getElement()->isAutomatic() + or not isHyperNetRootNetOccurrence(Occurrence(_netLocator.getElement(),_path))) ) _netLocator.progress(); - if (!_netLocator.isValid()) - while (!_hyperNetRootNetOccurrenceLocator.isValid() && _instanceLocator.isValid()) + if (not _netLocator.isValid()) + while (not _hyperNetRootNetOccurrenceLocator.isValid() and _instanceLocator.isValid()) { Instance* instance = _instanceLocator.getElement(); _hyperNetRootNetOccurrenceLocator=Locator(instance->getMasterCell(),Path(_path,instance)); @@ -4738,7 +4740,7 @@ Cell_HyperNetRootNetOccurrences::Locator::Locator(const Cell* cell, Path path) } Cell_HyperNetRootNetOccurrences::Locator::Locator(const Locator& locator) -// ********************************************************* +// ********************************************************************** : Inherit(), _path(locator._path), _netLocator(locator._netLocator), @@ -4748,7 +4750,7 @@ Cell_HyperNetRootNetOccurrences::Locator::Locator(const Locator& locator) } Cell_HyperNetRootNetOccurrences::Locator& Cell_HyperNetRootNetOccurrences::Locator::operator=(const Locator& locator) -// **************************************************************************************** +// ****************************************************************************************************************** { _path = locator._path; _netLocator = locator._netLocator; @@ -4758,7 +4760,7 @@ Cell_HyperNetRootNetOccurrences::Locator& Cell_HyperNetRootNetOccurrences::Locat } Occurrence Cell_HyperNetRootNetOccurrences::Locator::getElement() const -// ****************************************************** +// ******************************************************************** { if (_netLocator.isValid()) return Occurrence(_netLocator.getElement(),_path); @@ -4770,25 +4772,26 @@ Occurrence Cell_HyperNetRootNetOccurrences::Locator::getElement() const } Locator* Cell_HyperNetRootNetOccurrences::Locator::getClone() const -// ************************************************************** +// **************************************************************************** { return new Locator(*this); } bool Cell_HyperNetRootNetOccurrences::Locator::isValid() const -// ********************************************** +// *********************************************************** { return (_netLocator.isValid() || (_hyperNetRootNetOccurrenceLocator.isValid())); } void Cell_HyperNetRootNetOccurrences::Locator::progress() -// ***************************************** +// ****************************************************** { if (_netLocator.isValid()) { _netLocator.progress(); while ( _netLocator.isValid() ) { if ( not dynamic_cast(_netLocator.getElement()) + and not _netLocator.getElement()->isAutomatic() and isHyperNetRootNetOccurrence(Occurrence(_netLocator.getElement(),_path))) break; _netLocator.progress(); @@ -4808,7 +4811,7 @@ void Cell_HyperNetRootNetOccurrences::Locator::progress() } string Cell_HyperNetRootNetOccurrences::Locator::_getString() const -// *************************************************** +// **************************************************************** { string s = "<" + _TName("Cell::HyperNetRootNetOccurrences::Locator"); if (!_path.isEmpty()) diff --git a/hurricane/src/hurricane/DeepNet.cpp b/hurricane/src/hurricane/DeepNet.cpp index 301ab269..8bb83f46 100644 --- a/hurricane/src/hurricane/DeepNet.cpp +++ b/hurricane/src/hurricane/DeepNet.cpp @@ -29,6 +29,7 @@ // +-----------------------------------------------------------------+ +#include "hurricane/Warning.h" #include "hurricane/DeepNet.h" #include "hurricane/Cell.h" #include "hurricane/Instance.h" @@ -64,14 +65,20 @@ namespace Hurricane { if (not hyperNet.isValid()) throw Error ( "Can't create " + _TName("DeepNet") + ": occurence is invalid." ); + if (not isHyperNetRootNetOccurrence(hyperNet.getNetOccurrence())) { + cerr << Warning( "DeepNet::create(): Occurrence \"%s\" is not a root one." + , hyperNet.getNetOccurrence().getCompactString().c_str() + ) << endl; + } + Occurrence rootNetOccurrence = getHyperNetRootNetOccurrence( hyperNet.getNetOccurrence() ); if (rootNetOccurrence.getMasterCell()->isFlattenLeaf()) return NULL; if (rootNetOccurrence.getPath().isEmpty()) return NULL; - + DeepNet* deepNet = new DeepNet( rootNetOccurrence ); deepNet->_postCreate(); - + return deepNet; } @@ -84,7 +91,8 @@ namespace Hurricane { bool createRp = true; for ( Occurrence occurrence : hyperNet.getComponentOccurrences() ) { - if ( dynamic_cast(occurrence.getEntity()) ) { createRp = false; break; } + RoutingPad* rp = dynamic_cast(occurrence.getEntity()); + if ( rp and (rp->getCell() == getCell()) ) { createRp = false; break; } if ( dynamic_cast(occurrence.getEntity()) ) { createRp = false; break; } } if (not createRp) return 0; @@ -97,9 +105,7 @@ namespace Hurricane { currentRp->isPlacedOccurrence ( RoutingPad::ShowWarning ); if (nbRoutingPads == 1) { - //Net* net = currentRp->getNet(); - //cerr << "_createRoutingPads on " << net->getName() << " buildRing:" << endl; } } diff --git a/hurricane/src/hurricane/hurricane/HyperNet.h b/hurricane/src/hurricane/hurricane/HyperNet.h index 0a3530d7..bb0352c3 100644 --- a/hurricane/src/hurricane/hurricane/HyperNet.h +++ b/hurricane/src/hurricane/hurricane/HyperNet.h @@ -84,6 +84,7 @@ bool isHyperNetRootNetOccurrence(Occurrence netoccurrence); INSPECTOR_P_SUPPORT(Hurricane::HyperNet); +IOSTREAM_VALUE_SUPPORT(Hurricane::HyperNet);