Anouk Van Laer has submitted this change and it was merged. ( https://gem5-review.googlesource.com/8602 )

Change subject: sim, power: Temperature used for power calculations
......................................................................

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 <[email protected]>
Reviewed-by: Andreas Sandberg <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/8602
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Andreas Sandberg <[email protected]>
---
M src/sim/power/PowerModel.py
M src/sim/power/power_model.cc
2 files changed, 9 insertions(+), 0 deletions(-)

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



diff --git a/src/sim/power/PowerModel.py b/src/sim/power/PowerModel.py
index 3425690..e3c0fb9 100644
--- a/src/sim/power/PowerModel.py
+++ b/src/sim/power/PowerModel.py
@@ -63,3 +63,6 @@

     # 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 e8c522c..6e065d6 100644
--- a/src/sim/power/power_model.cc
+++ b/src/sim/power/power_model.cc
@@ -57,6 +57,12 @@
     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

--
To view, visit https://gem5-review.googlesource.com/8602
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: I7ca8fa6766bdcba9d362c12fc75d1e1f74385f35
Gerrit-Change-Number: 8602
Gerrit-PatchSet: 3
Gerrit-Owner: Anouk Van Laer <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Anouk Van Laer <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to