base, python: Add a Temperature type and associated param
authorAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 19 Jan 2021 10:09:56 +0000 (10:09 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Tue, 26 Jan 2021 10:40:11 +0000 (10:40 +0000)
commit69f4aee33c07134a651dd032f28944e30ab5b322
tree46af97c38a8d93b9c23125f4c4c5f1c07460fcf0
parente0441fa7a7c858d7e472fbb1e03089a9a11b8462
base, python: Add a Temperature type and associated param

Add a class to represent a temperature. The class stores temperatures
in Kelvin and provides helper methods to convert to/from Celsius. The
corresponding param type automatically converts from Kelvin, Celsius,
and Fahrenheit to the underlying C++ type.

Change-Id: I5783cc4f4fecbea5aba9821dfc71bfa77c3f75a9
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39218
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/base/SConscript
src/base/temperature.cc [new file with mode: 0644]
src/base/temperature.hh [new file with mode: 0644]
src/base/temperature.test.cc [new file with mode: 0644]
src/python/m5/params.py
src/python/m5/util/convert.py
src/python/pybind11/core.cc
tests/pyunit/util/test_convert.py