sim: Use the Temperature param type

Add support for passing typed temperatures using the new Temperature
param type.

Change-Id: If68d619fd824e171d895a5cbbe4d0325d4c4f4db
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39219
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Andreas Sandberg
2021-01-19 10:16:03 +00:00
parent 69f4aee33c
commit ad82dd3b56
6 changed files with 11 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2016-2018 ARM Limited
# Copyright (c) 2016-2018, 2021 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -63,4 +63,4 @@ class PowerModel(SimObject):
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")
ambient_temp = Param.Temperature("25.0C", "Ambient temperature")

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2015 ARM Limited
# Copyright (c) 2015, 2021 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -46,4 +46,4 @@ class ThermalDomain(SimObject):
]
# Static temperature which may change over time
initial_temperature = Param.Float(25.0, "Initial temperature")
initial_temperature = Param.Temperature("25.0C", "Initial temperature")

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2015 ARM Limited
# Copyright (c) 2015, 2021 Arm Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -77,7 +77,7 @@ class ThermalReference(SimObject, object):
]
# Static temperature which may change over time
temperature = Param.Float(25.0, "Operational temperature in Celsius")
temperature = Param.Temperature("25.0C", "Operational temperature")
# Represents a thermal capacitor

View File

@@ -66,7 +66,7 @@ PowerModel::PowerModel(const Params &p)
// The temperature passed here will be overwritten, if there is
// a thermal model present
for (auto & pms: states_pm){
pms->setTemperature(p.ambient_temp);
pms->setTemperature(p.ambient_temp.toCelsius());
}
dynamicPower

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 ARM Limited
* Copyright (c) 2015, 2021 Arm Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -49,7 +49,7 @@
#include "sim/sub_system.hh"
ThermalDomain::ThermalDomain(const Params &p)
: SimObject(p), _initTemperature(p.initial_temperature),
: SimObject(p), _initTemperature(p.initial_temperature.toCelsius()),
node(NULL), subsystem(NULL),
ADD_STAT(currentTemp, "Temperature in centigrade degrees")
{

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 ARM Limited
* Copyright (c) 2015, 2021 Arm Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -51,7 +51,7 @@
* ThermalReference
*/
ThermalReference::ThermalReference(const Params &p)
: SimObject(p), _temperature(p.temperature), node(NULL)
: SimObject(p), _temperature(p.temperature.toCelsius()), node(NULL)
{
}