From b1cb96672a7e32dcf341cb665a5676f046125dd9 Mon Sep 17 00:00:00 2001 From: Sherif Elhabbal Date: Thu, 13 Sep 2018 16:01:55 +0200 Subject: [PATCH] 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 Change-Id: Icac6a2e2003ed75d1680180e53343b0203139d72 Reviewed-on: https://gem5-review.googlesource.com/12664 Reviewed-by: Jason Lowe-Power Maintainer: Andreas Sandberg --- src/sim/power/mathexpr_powermodel.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sim/power/mathexpr_powermodel.cc b/src/sim/power/mathexpr_powermodel.cc index ab4872007..402a2c059 100644 --- a/src/sim/power/mathexpr_powermodel.cc +++ b/src/sim/power/mathexpr_powermodel.cc @@ -127,7 +127,9 @@ MathExprPowerModel::getStatValue(const std::string &name) const 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); -- 2.30.2