diff --git a/doc/OpenSTA.odt b/doc/OpenSTA.odt index b6a82082..add3f7f8 100644 Binary files a/doc/OpenSTA.odt and b/doc/OpenSTA.odt differ diff --git a/doc/OpenSTA.pdf b/doc/OpenSTA.pdf index 0777bd39..ada7e0f1 100644 Binary files a/doc/OpenSTA.pdf and b/doc/OpenSTA.pdf differ diff --git a/power/Power.cc b/power/Power.cc index a3ee7888..6ebe3576 100644 --- a/power/Power.cc +++ b/power/Power.cc @@ -236,6 +236,11 @@ PowerResult Power::power(const Instance *inst, const Corner *corner) { + if (network_->isHierarchical(inst)) { + PowerResult result; + powerInside(inst, corner, result); + return result; + } LibertyCell *cell = network_->libertyCell(inst); if (cell) { ensureActivities(); @@ -244,6 +249,27 @@ Power::power(const Instance *inst, return PowerResult(); } +void +Power::powerInside(const Instance *hinst, + const Corner *corner, + PowerResult &result) +{ + InstanceChildIterator *child_iter = network_->childIterator(hinst); + while (child_iter->hasNext()) { + Instance *child = child_iter->next(); + if (network_->isHierarchical(child)) + powerInside(child, corner, result); + else { + LibertyCell *cell = network_->libertyCell(child); + if (cell) { + PowerResult inst_power = power(child, cell, corner); + result.incr(inst_power); + } + } + } + delete child_iter; +} + //////////////////////////////////////////////////////////////// class ActivitySrchPred : public SearchPredNonLatch2 diff --git a/power/Power.hh b/power/Power.hh index 73a6110b..293bb3c5 100644 --- a/power/Power.hh +++ b/power/Power.hh @@ -87,6 +87,9 @@ public: PwrActivity findClkedActivity(const Pin *pin); protected: + void powerInside(const Instance *hinst, + const Corner *corner, + PowerResult &result); void ensureActivities(); bool hasUserActivity(const Pin *pin); PwrActivity &userActivity(const Pin *pin);