summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnouk Van Laer <anouk.vanlaer@arm.com>2017-08-21 16:02:45 +0100
committerAnouk Van Laer <anouk.vanlaer@arm.com>2018-02-28 21:56:08 +0000
commitf4d83eaf52926aa379292a9f75ba6b36eb04c52d (patch)
tree63e9ce7104671974908bdd294cd04fcb71c6f58e /src
parented0f02e1f68e8771f4de514716f34c3de32b3045 (diff)
downloadgem5-f4d83eaf52926aa379292a9f75ba6b36eb04c52d.tar.xz
sim, power: Temperature used for power calculations
The temperature used for the power calculations was fixed at 0 degrees, unless a thermal model was setup. This commit allows the user to set the temperature that needs to be used by the power calculation during gem5 configuration. This value will be overwritten if there are thermal models present. Change-Id: I7ca8fa6766bdcba9d362c12fc75d1e1f74385f35 Reviewed-by: Sascha Bischoff <sascha.bischoff@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/8602 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src')
-rw-r--r--src/sim/power/PowerModel.py3
-rw-r--r--src/sim/power/power_model.cc6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/sim/power/PowerModel.py b/src/sim/power/PowerModel.py
index 342569013..e3c0fb943 100644
--- a/src/sim/power/PowerModel.py
+++ b/src/sim/power/PowerModel.py
@@ -63,3 +63,6 @@ class PowerModel(SimObject):
# Type of power model
pm_type = Param.PMType("All", "Type of power model")
+
+ # Ambient temperature to be used when no thermal model is present
+ ambient_temp = Param.Float(25.0, "Ambient temperature")
diff --git a/src/sim/power/power_model.cc b/src/sim/power/power_model.cc
index e8c522cad..6e065d6d6 100644
--- a/src/sim/power/power_model.cc
+++ b/src/sim/power/power_model.cc
@@ -57,6 +57,12 @@ PowerModel::PowerModel(const Params *p)
panic_if(subsystem == NULL,
"Subsystem is NULL! This is not acceptable for a PowerModel!\n");
subsystem->registerPowerProducer(this);
+ // The temperature passed here will be overwritten, if there is
+ // a thermal model present
+ for (auto & pms: states_pm){
+ pms->setTemperature(p->ambient_temp);
+ }
+
}
void