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,
|
Power::power(const Instance *inst,
|
||||||
const Corner *corner)
|
const Corner *corner)
|
||||||
{
|
{
|
||||||
|
if (network_->isHierarchical(inst)) {
|
||||||
|
PowerResult result;
|
||||||
|
powerInside(inst, corner, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
LibertyCell *cell = network_->libertyCell(inst);
|
LibertyCell *cell = network_->libertyCell(inst);
|
||||||
if (cell) {
|
if (cell) {
|
||||||
ensureActivities();
|
ensureActivities();
|
||||||
|
|
@ -244,6 +249,27 @@ Power::power(const Instance *inst,
|
||||||
return PowerResult();
|
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
|
class ActivitySrchPred : public SearchPredNonLatch2
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,9 @@ public:
|
||||||
PwrActivity findClkedActivity(const Pin *pin);
|
PwrActivity findClkedActivity(const Pin *pin);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
void powerInside(const Instance *hinst,
|
||||||
|
const Corner *corner,
|
||||||
|
PowerResult &result);
|
||||||
void ensureActivities();
|
void ensureActivities();
|
||||||
bool hasUserActivity(const Pin *pin);
|
bool hasUserActivity(const Pin *pin);
|
||||||
PwrActivity &userActivity(const Pin *pin);
|
PwrActivity &userActivity(const Pin *pin);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue