report_power -instance hierarchical
Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
parent
695b0bed2f
commit
4b009e50dc
BIN
doc/OpenSTA.odt
BIN
doc/OpenSTA.odt
Binary file not shown.
BIN
doc/OpenSTA.pdf
BIN
doc/OpenSTA.pdf
Binary file not shown.
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue