Hello Nikos Nikoleris,
I'd like you to do a code review. Please visit
https://gem5-review.googlesource.com/2662
to review the following change.
Change subject: power: Add a voltage variable to power expressions
......................................................................
power: Add a voltage variable to power expressions
There is currently no good way of extracting the current operating
voltage in MathExprPowerModels. This change adds a magic variable,
'voltage', that can be referenced from such expressions to get the
current operating voltage.
Change-Id: Ice3c9a4a221921a542de5da52f83f3f88862d246
Signed-off-by: Andreas Sandberg <[email protected]>
Reviewed-by: Nikos Nikoleris <[email protected]>
Reviewed-by: Sascha Bischoff <[email protected]>
---
M src/sim/power/mathexpr_powermodel.cc
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/sim/power/mathexpr_powermodel.cc
b/src/sim/power/mathexpr_powermodel.cc
index 13d225e..a77e14a 100644
--- a/src/sim/power/mathexpr_powermodel.cc
+++ b/src/sim/power/mathexpr_powermodel.cc
@@ -115,8 +115,11 @@
using namespace Stats;
// Automatic variables:
- if (name == "temp")
+ if (name == "temp") {
return _temp;
+ } else if (name == "voltage") {
+ return clocked_object->voltage();
+ }
// Try to cast the stat, only these are supported right now
const auto it = stats_map.find(name);
--
To view, visit https://gem5-review.googlesource.com/2662
To unsubscribe, visit https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ice3c9a4a221921a542de5da52f83f3f88862d246
Gerrit-Change-Number: 2662
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev