Sherif Elhabbal has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12664 )

Change subject: power: Add a clock_period variable to power expressions
......................................................................

power: Add a clock_period variable to power expressions

Currently 'Clock period in ticks' stat is not accessible in power equations . This patch adds a variable 'clock_period' to be referenced to get the Clock period in
ticks

Signed-off-by: Sherif Elhabbal <[email protected]>
Change-Id: Icac6a2e2003ed75d1680180e53343b0203139d72
Reviewed-on: https://gem5-review.googlesource.com/12664
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
---
M src/sim/power/mathexpr_powermodel.cc
1 file changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved



diff --git a/src/sim/power/mathexpr_powermodel.cc b/src/sim/power/mathexpr_powermodel.cc
index ab48720..402a2c0 100644
--- a/src/sim/power/mathexpr_powermodel.cc
+++ b/src/sim/power/mathexpr_powermodel.cc
@@ -127,7 +127,9 @@
         return _temp;
     } else if (name == "voltage") {
         return clocked_object->voltage();
-    }
+    } else if (name=="clock_period") {
+        return clocked_object->clockPeriod();
+    }

     // 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/c/public/gem5/+/12664
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Icac6a2e2003ed75d1680180e53343b0203139d72
Gerrit-Change-Number: 12664
Gerrit-PatchSet: 4
Gerrit-Owner: Sherif Elhabbal <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Anouk Van Laer <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Sherif Elhabbal <[email protected]>
Gerrit-CC: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to