power use cofactor activity for internal power
This commit is contained in:
parent
bb4ceacd4d
commit
37ac4684a3
|
|
@ -664,14 +664,16 @@ Power::findExprOutPort(FuncExpr *expr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Eval activity of differenc(expr) wrt cofactor port.
|
||||||
PwrActivity
|
PwrActivity
|
||||||
Power::evalActivityDifference(FuncExpr *expr,
|
Power::evalActivityDifference(FuncExpr *expr,
|
||||||
const Instance *inst,
|
const Instance *inst,
|
||||||
const LibertyPort *cofactor_port)
|
const LibertyPort *cofactor_port)
|
||||||
{
|
{
|
||||||
|
// Activity of positive/negative cofactors.
|
||||||
PwrActivity pos = evalActivity(expr, inst, cofactor_port, true);
|
PwrActivity pos = evalActivity(expr, inst, cofactor_port, true);
|
||||||
PwrActivity neg = evalActivity(expr, inst, cofactor_port, false);
|
PwrActivity neg = evalActivity(expr, inst, cofactor_port, false);
|
||||||
// difference(expr) wrt cofactor port = xor(pos, neg).
|
// difference = xor(pos, neg).
|
||||||
float p1 = pos.duty() * (1.0 - neg.duty());
|
float p1 = pos.duty() * (1.0 - neg.duty());
|
||||||
float p2 = neg.duty() * (1.0 - pos.duty());
|
float p2 = neg.duty() * (1.0 - pos.duty());
|
||||||
return PwrActivity(pos.activity() * p1 + neg.activity() * p2,
|
return PwrActivity(pos.activity() * p1 + neg.activity() * p2,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue