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>
This commit is contained in:
Andreas Sandberg
2021-01-19 10:09:56 +00:00
parent e0441fa7a7
commit 69f4aee33c
8 changed files with 478 additions and 2 deletions

View File

@@ -72,6 +72,8 @@ Source('str.cc')
GTest('str.test', 'str.test.cc', 'str.cc')
Source('time.cc')
Source('version.cc')
Source('temperature.cc')
GTest('temperature.test', 'temperature.test.cc', 'temperature.cc')
Source('trace.cc')
GTest('trie.test', 'trie.test.cc')
Source('types.cc')