From 2e939e5355bfc0584453de170abe966618473e77 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 21 Jun 2014 17:57:15 +0200 Subject: [PATCH] Cell::flattenNets() checks for already flattened top nets. * Change: In Hurricane, in Cell::flattenNets(), do not flatten a *top net* if at least one RoutingPad is present. In that case, we assumes that the net has already been completly flattened. * New: In Hurricane, in Entity, add an accessor to unique id counter. --- hurricane/src/hurricane/Cell.cpp | 13 +++++++++++++ hurricane/src/hurricane/Entity.cpp | 4 ++++ hurricane/src/hurricane/hurricane/Entity.h | 2 ++ 3 files changed, 19 insertions(+) diff --git a/hurricane/src/hurricane/Cell.cpp b/hurricane/src/hurricane/Cell.cpp index 65d62b3c..abcccd32 100644 --- a/hurricane/src/hurricane/Cell.cpp +++ b/hurricane/src/hurricane/Cell.cpp @@ -212,6 +212,19 @@ void Cell::flattenNets(unsigned int flags) buildRing = flags & Cell::BuildRings; } + bool hasRoutingPads = false; + forEach ( Component*, icomponent, net->getComponents() ) { + RoutingPad* rp = dynamic_cast( *icomponent ); + if (rp) { + // At least one RoutingPad is present: assumes that the net is already + // flattened (completly). + //cerr << net << " has already RoutingPads, skipped " << rp << endl; + hasRoutingPads = true; + break; + } + } + if (hasRoutingPads) continue; + forEach ( Component*, icomponent, net->getComponents() ) { Plug* primaryPlug = dynamic_cast( *icomponent ); if (primaryPlug) { diff --git a/hurricane/src/hurricane/Entity.cpp b/hurricane/src/hurricane/Entity.cpp index 96739147..9d636a68 100644 --- a/hurricane/src/hurricane/Entity.cpp +++ b/hurricane/src/hurricane/Entity.cpp @@ -37,6 +37,10 @@ namespace Hurricane { unsigned int Entity::_idCounter = 0; + unsigned int Entity::getIdCounter () + { return _idCounter; } + + Entity::Entity() : Inherit() , _id(_idCounter++) diff --git a/hurricane/src/hurricane/hurricane/Entity.h b/hurricane/src/hurricane/hurricane/Entity.h index 4023ec32..513a8e56 100644 --- a/hurricane/src/hurricane/hurricane/Entity.h +++ b/hurricane/src/hurricane/hurricane/Entity.h @@ -40,6 +40,8 @@ namespace Hurricane { { public: typedef DBo Inherit; + public: + static unsigned int getIdCounter (); public: inline unsigned int getId () const; virtual Cell* getCell () const = 0;