From ea38329de124967425881405ad3557e4da70cc99 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 3 Aug 2020 19:35:21 +0200 Subject: [PATCH] * Bug: In CellCollection::Cell_HyperNetRootNetOccurrences::progress(), skip Nets that are inside Terminal Netlist master cells. Was done ine the locator constructor but forgotten in the progress(). --- hurricane/src/hurricane/CellCollections.cpp | 3 ++- hurricane/src/hurricane/HyperNet.cpp | 10 ++++++---- hurricane/src/hurricane/Occurrence.cpp | 13 +++++++++++++ hurricane/src/hurricane/hurricane/Occurrence.h | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/hurricane/src/hurricane/CellCollections.cpp b/hurricane/src/hurricane/CellCollections.cpp index 6d8eb324..d503ccb3 100644 --- a/hurricane/src/hurricane/CellCollections.cpp +++ b/hurricane/src/hurricane/CellCollections.cpp @@ -4694,7 +4694,8 @@ Cell_HyperNetRootNetOccurrences::Locator::Locator(const Cell* cell, Path path) while (not _hyperNetRootNetOccurrenceLocator.isValid() and _instanceLocator.isValid()) { Instance* instance = _instanceLocator.getElement(); - _hyperNetRootNetOccurrenceLocator=Locator(instance->getMasterCell(),Path(_path,instance)); + if (not instance->isTerminalNetlist()) + _hyperNetRootNetOccurrenceLocator=Locator(instance->getMasterCell(),Path(_path,instance)); _instanceLocator.progress(); } } diff --git a/hurricane/src/hurricane/HyperNet.cpp b/hurricane/src/hurricane/HyperNet.cpp index 95f47887..e4b1683a 100644 --- a/hurricane/src/hurricane/HyperNet.cpp +++ b/hurricane/src/hurricane/HyperNet.cpp @@ -120,15 +120,17 @@ class HyperNet_NetOccurrencesUnder : public Collection { public: typedef Hurricane::Locator Inherit; private: const HyperNet* _hyperNet; - private: Box _area; + private: Box _area; private: bool _doExtraction; private: bool _allowInterruption; private: set _netOccurrenceSet; private: stack _netOccurrenceStack; public: Locator(); - public: Locator(const HyperNet* hyperNet, Box area, - bool doExtraction = false, bool allowInterruption = false); + public: Locator(const HyperNet* hyperNet + , Box area + , bool doExtraction = false + , bool allowInterruption = false); public: Locator(const Locator& locator); public: Locator& operator=(const Locator& locator); @@ -148,7 +150,7 @@ class HyperNet_NetOccurrencesUnder : public Collection { // ********** private: const HyperNet* _hyperNet; - private: Box _area; + private: Box _area; private: bool _doExtraction; private: bool _allowInterruption; diff --git a/hurricane/src/hurricane/Occurrence.cpp b/hurricane/src/hurricane/Occurrence.cpp index be6b2deb..ccb9b975 100644 --- a/hurricane/src/hurricane/Occurrence.cpp +++ b/hurricane/src/hurricane/Occurrence.cpp @@ -105,6 +105,19 @@ bool Occurrence::operator<(const Occurrence& occurrence) const // ((_entity == occurrence._entity) and (_sharedPath < occurrence._sharedPath))); } +bool Occurrence::isBelowTerminalNetlist() const +// ******************************************** +{ + SharedPath* tail = _sharedPath; + while ( tail ) { + Instance* instance = tail->getHeadInstance(); + tail = tail->getTailSharedPath(); + + if (tail and instance->isTerminalNetlist()) return true; + } + return false; +} + Cell* Occurrence::getOwnerCell() const // ********************************** { diff --git a/hurricane/src/hurricane/hurricane/Occurrence.h b/hurricane/src/hurricane/hurricane/Occurrence.h index eaf18c51..baae81c9 100644 --- a/hurricane/src/hurricane/hurricane/Occurrence.h +++ b/hurricane/src/hurricane/hurricane/Occurrence.h @@ -79,6 +79,7 @@ class Occurrence { // ********** public: bool isValid() const {return (_entity != NULL);}; + public: bool isBelowTerminalNetlist() const; public: bool hasProperty() const; // Updators