sim, power: Temperature used for power calculations
authorAnouk Van Laer <anouk.vanlaer@arm.com>
Mon, 21 Aug 2017 15:02:45 +0000 (16:02 +0100)
committerAnouk Van Laer <anouk.vanlaer@arm.com>
Wed, 28 Feb 2018 21:56:08 +0000 (21:56 +0000)
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>

src/sim/power/PowerModel.py
src/sim/power/power_model.cc

index 3425690130a9fe04f53ee3cb112e2786d0c5a82d..e3c0fb943cb6462cacb0a83d1a20263701f58b7c 100644 (file)
@@ -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")
index e8c522cad7850b01494e9c141e7b10e00763a76a..6e065d6d63ca4853d89ac47d2989ebd977e39def 100644 (file)
@@ -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