summaryrefslogtreecommitdiff
path: root/src/sim/power
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/power')
-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