power don't required related_pg_pin in internal_power
This commit is contained in:
parent
e6ff991859
commit
c6db5eb0ae
BIN
doc/OpenSTA.odt
BIN
doc/OpenSTA.odt
Binary file not shown.
|
|
@ -29,7 +29,9 @@ namespace sta {
|
||||||
LibExprParser *libexpr_parser;
|
LibExprParser *libexpr_parser;
|
||||||
|
|
||||||
FuncExpr *
|
FuncExpr *
|
||||||
parseFuncExpr(const char *func, LibertyCell *cell, const char *error_msg,
|
parseFuncExpr(const char *func,
|
||||||
|
LibertyCell *cell,
|
||||||
|
const char *error_msg,
|
||||||
Report *report)
|
Report *report)
|
||||||
{
|
{
|
||||||
if (func != nullptr && func[0] != '\0') {
|
if (func != nullptr && func[0] != '\0') {
|
||||||
|
|
@ -42,8 +44,10 @@ parseFuncExpr(const char *func, LibertyCell *cell, const char *error_msg,
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
LibExprParser::LibExprParser(const char *func, LibertyCell *cell,
|
LibExprParser::LibExprParser(const char *func,
|
||||||
const char *error_msg, Report *report) :
|
LibertyCell *cell,
|
||||||
|
const char *error_msg,
|
||||||
|
Report *report) :
|
||||||
func_(func),
|
func_(func),
|
||||||
cell_(cell),
|
cell_(cell),
|
||||||
error_msg_(error_msg),
|
error_msg_(error_msg),
|
||||||
|
|
@ -84,7 +88,8 @@ LibExprParser::makeFuncExprNot(FuncExpr *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
FuncExpr *
|
FuncExpr *
|
||||||
LibExprParser::makeFuncExprXor(FuncExpr *arg1, FuncExpr *arg2)
|
LibExprParser::makeFuncExprXor(FuncExpr *arg1,
|
||||||
|
FuncExpr *arg2)
|
||||||
{
|
{
|
||||||
if (arg1 && arg2)
|
if (arg1 && arg2)
|
||||||
return FuncExpr::makeXor(arg1, arg2);
|
return FuncExpr::makeXor(arg1, arg2);
|
||||||
|
|
@ -93,7 +98,8 @@ LibExprParser::makeFuncExprXor(FuncExpr *arg1, FuncExpr *arg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
FuncExpr *
|
FuncExpr *
|
||||||
LibExprParser::makeFuncExprAnd(FuncExpr *arg1, FuncExpr *arg2)
|
LibExprParser::makeFuncExprAnd(FuncExpr *arg1,
|
||||||
|
FuncExpr *arg2)
|
||||||
{
|
{
|
||||||
if (arg1 && arg2)
|
if (arg1 && arg2)
|
||||||
return FuncExpr::makeAnd(arg1, arg2);
|
return FuncExpr::makeAnd(arg1, arg2);
|
||||||
|
|
@ -102,7 +108,8 @@ LibExprParser::makeFuncExprAnd(FuncExpr *arg1, FuncExpr *arg2)
|
||||||
}
|
}
|
||||||
|
|
||||||
FuncExpr *
|
FuncExpr *
|
||||||
LibExprParser::makeFuncExprOr(FuncExpr *arg1, FuncExpr *arg2)
|
LibExprParser::makeFuncExprOr(FuncExpr *arg1,
|
||||||
|
FuncExpr *arg2)
|
||||||
{
|
{
|
||||||
if (arg1 && arg2)
|
if (arg1 && arg2)
|
||||||
return FuncExpr::makeOr(arg1, arg2);
|
return FuncExpr::makeOr(arg1, arg2);
|
||||||
|
|
@ -117,7 +124,8 @@ LibExprParser::setResult(FuncExpr *result)
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t
|
size_t
|
||||||
LibExprParser::copyInput(char *buf, size_t max_size)
|
LibExprParser::copyInput(char *buf,
|
||||||
|
size_t max_size)
|
||||||
{
|
{
|
||||||
size_t length = strlen(func_);
|
size_t length = strlen(func_);
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,9 @@ class LibertyCell;
|
||||||
class FuncExpr;
|
class FuncExpr;
|
||||||
|
|
||||||
FuncExpr *
|
FuncExpr *
|
||||||
parseFuncExpr(const char *func, LibertyCell *cell, const char *error_msg,
|
parseFuncExpr(const char *func,
|
||||||
|
LibertyCell *cell,
|
||||||
|
const char *error_msg,
|
||||||
Report *report);
|
Report *report);
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
||||||
|
|
@ -505,8 +505,8 @@ Power::power(const Instance *inst,
|
||||||
if (to_port->direction()->isAnyOutput())
|
if (to_port->direction()->isAnyOutput())
|
||||||
findSwitchingPower(cell, to_port, activity, load_cap,
|
findSwitchingPower(cell, to_port, activity, load_cap,
|
||||||
dcalc_ap, result);
|
dcalc_ap, result);
|
||||||
findInternalPower(to_port, inst, cell, activity,
|
findInternalPower(to_pin, to_port, inst, cell, activity,
|
||||||
inst_clk, load_cap, dcalc_ap, result);
|
load_cap, dcalc_ap, result);
|
||||||
}
|
}
|
||||||
delete pin_iter;
|
delete pin_iter;
|
||||||
findLeakagePower(inst, cell, result);
|
findLeakagePower(inst, cell, result);
|
||||||
|
|
@ -528,11 +528,11 @@ Power::findInstClk(const Instance *inst)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Power::findInternalPower(const LibertyPort *to_port,
|
Power::findInternalPower(const Pin *to_pin,
|
||||||
|
const LibertyPort *to_port,
|
||||||
const Instance *inst,
|
const Instance *inst,
|
||||||
LibertyCell *cell,
|
LibertyCell *cell,
|
||||||
PwrActivity &to_activity,
|
PwrActivity &to_activity,
|
||||||
const Clock *inst_clk,
|
|
||||||
float load_cap,
|
float load_cap,
|
||||||
const DcalcAnalysisPt *dcalc_ap,
|
const DcalcAnalysisPt *dcalc_ap,
|
||||||
// Return values.
|
// Return values.
|
||||||
|
|
@ -554,10 +554,9 @@ Power::findInternalPower(const LibertyPort *to_port,
|
||||||
if (pwr->port() == to_port) {
|
if (pwr->port() == to_port) {
|
||||||
const char *related_pg_pin = pwr->relatedPgPin();
|
const char *related_pg_pin = pwr->relatedPgPin();
|
||||||
const LibertyPort *from_port = pwr->relatedPort();
|
const LibertyPort *from_port = pwr->relatedPort();
|
||||||
if (from_port == nullptr) {
|
if (from_port == nullptr)
|
||||||
// Input port internal power.
|
// Input port internal power.
|
||||||
from_port = to_port;
|
from_port = to_port;
|
||||||
}
|
|
||||||
FuncExpr *when = pwr->when();
|
FuncExpr *when = pwr->when();
|
||||||
// If all the "when" clauses exist VSS internal power is ignored.
|
// If all the "when" clauses exist VSS internal power is ignored.
|
||||||
if ((when && internalPowerMissingWhen(cell, to_port, related_pg_pin))
|
if ((when && internalPowerMissingWhen(cell, to_port, related_pg_pin))
|
||||||
|
|
@ -570,9 +569,10 @@ Power::findInternalPower(const LibertyPort *to_port,
|
||||||
else if (search_->isClock(from_vertex))
|
else if (search_->isClock(from_vertex))
|
||||||
duty = 1.0;
|
duty = 1.0;
|
||||||
else {
|
else {
|
||||||
PwrActivity from_activity = findClkedActivity(from_pin, inst_clk);
|
PwrActivity from_activity = findActivity(from_pin);
|
||||||
float duty1 = 1.0 - (input_duty_sum - from_activity.duty());
|
PwrActivity to_activity = findActivity(to_pin);
|
||||||
duty = from_activity.activity() * duty1 / to_activity.activity();
|
float duty1 = input_duty_sum - from_activity.duty();
|
||||||
|
duty = from_activity.activity() * (1.0 - duty1) / to_activity.activity();
|
||||||
}
|
}
|
||||||
float port_energy = 0.0;
|
float port_energy = 0.0;
|
||||||
TransRiseFallIterator tr_iter;
|
TransRiseFallIterator tr_iter;
|
||||||
|
|
@ -624,7 +624,7 @@ Power::internalPowerMissingWhen(LibertyCell *cell,
|
||||||
auto when = pwr->when();
|
auto when = pwr->when();
|
||||||
if (pwr->port() == to_port
|
if (pwr->port() == to_port
|
||||||
&& pwr->relatedPort() == nullptr
|
&& pwr->relatedPort() == nullptr
|
||||||
&& stringEq(pwr->relatedPgPin(), related_pg_pin)
|
&& stringEqIf(pwr->relatedPgPin(), related_pg_pin)
|
||||||
&& when) {
|
&& when) {
|
||||||
when_count++;
|
when_count++;
|
||||||
when_input_count = funcExprPortCount(when);
|
when_input_count = funcExprPortCount(when);
|
||||||
|
|
|
||||||
|
|
@ -107,11 +107,11 @@ protected:
|
||||||
const Corner *corner,
|
const Corner *corner,
|
||||||
// Return values.
|
// Return values.
|
||||||
PowerResult &result);
|
PowerResult &result);
|
||||||
void findInternalPower(const LibertyPort *to_port,
|
void findInternalPower(const Pin *to_pin,
|
||||||
|
const LibertyPort *to_port,
|
||||||
const Instance *inst,
|
const Instance *inst,
|
||||||
LibertyCell *cell,
|
LibertyCell *cell,
|
||||||
PwrActivity &to_activity,
|
PwrActivity &to_activity,
|
||||||
const Clock *inst_clk,
|
|
||||||
float load_cap,
|
float load_cap,
|
||||||
const DcalcAnalysisPt *dcalc_ap,
|
const DcalcAnalysisPt *dcalc_ap,
|
||||||
// Return values.
|
// Return values.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue