Giacomo Travaglini has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44167 )

Change subject: sim: Fix Temperature class
......................................................................

sim: Fix Temperature class

* Adding __str__ method: To fix its printing on config.ini
(Replacing <m5.params.Temperature> with the Temperature value

* Replacing "fromKelvin" with from_kelvin (that's how pybind exports it)

* Fixing config_value to allow JSON serialization
(JIRA: https://gem5.atlassian.net/browse/GEM5-951)

Change-Id: I1aaea9c9df6466a5cbed0a29c5937243796948d2
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
---
M src/python/m5/params.py
1 file changed, 5 insertions(+), 2 deletions(-)



diff --git a/src/python/m5/params.py b/src/python/m5/params.py
index c2c0534..8e42eb9 100644
--- a/src/python/m5/params.py
+++ b/src/python/m5/params.py
@@ -1706,12 +1706,15 @@
         self.__init__(value)
         return value

+    def __str__(self):
+        return str(self.value)
+
     def getValue(self):
         from _m5.core import Temperature
-        return Temperature.fromKelvin(self.value)
+        return Temperature.from_kelvin(self.value)

     def config_value(self):
-        return self
+        return self.value

     @classmethod
     def cxx_predecls(cls, code):

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44167
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I1aaea9c9df6466a5cbed0a29c5937243796948d2
Gerrit-Change-Number: 44167
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to