Skip to content

Commit

Permalink
issue 107 xor activity
Browse files Browse the repository at this point in the history
Signed-off-by: James Cherry <[email protected]>
  • Loading branch information
jjcherry56 committed Aug 22, 2022
1 parent 28c8185 commit bb50746
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions search/Power.cc
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ Power::evalActivity(FuncExpr *expr,
cofactor_port, cofactor_positive);
float p1 = 1.0 - activity1.duty();
float p2 = 1.0 - activity2.duty();
return PwrActivity(activity1.activity() * p2
+ activity2.activity() * p1,
return PwrActivity(activity1.activity() * p2 + activity2.activity() * p1,
1.0 - p1 * p2,
PwrActivityOrigin::propagated);
}
Expand All @@ -454,9 +453,11 @@ Power::evalActivity(FuncExpr *expr,
cofactor_port, cofactor_positive);
PwrActivity activity2 = evalActivity(expr->right(), inst,
cofactor_port, cofactor_positive);
float p1 = activity1.duty() * (1.0 - activity2.duty());
float p2 = activity2.duty() * (1.0 - activity1.duty());
return PwrActivity(activity1.activity() * p1 + activity2.activity() * p2,
float d1 = activity1.duty();
float d2 = activity2.duty();
float p1 = d1 * (1.0 - d2);
float p2 = (1.0 - d1) * d2;
return PwrActivity(activity1.activity() + activity2.activity(),
p1 + p2,
PwrActivityOrigin::propagated);
}
Expand Down

0 comments on commit bb50746

Please sign in to comment.