sim: Use the Temperature type in power/thermal models
The thermal models currently work on temperatures in Celsius stored in plain doubles. Switch to using Temperature instead and internal processing in Kelvin. There should be no impact on the result since all thermal processes work on temperature deltas. Change-Id: I22d0261ae102f30d86051f24a2d88b067b321c91 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39455 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010,2013,2015 ARM Limited
|
||||
* Copyright (c) 2010, 2013, 2015, 2021 Arm Limited
|
||||
* All rights reserved
|
||||
*
|
||||
* The license below extends only to copyright in the software and shall
|
||||
@@ -304,7 +304,7 @@ RealViewTemperatureSensor::read() const
|
||||
// Temperature reported in uC
|
||||
ThermalModel * tm = system->getThermalModel();
|
||||
if (tm) {
|
||||
double t = tm->getTemp();
|
||||
double t = tm->getTemperature().toCelsius();
|
||||
if (t < 0)
|
||||
warn("Temperature below zero!\n");
|
||||
return fmax(0, t) * 1000000;
|
||||
|
||||
Reference in New Issue
Block a user