util: Add a "toEnergy" function to the convert module.
authorGabe Black <gabeblack@google.com>
Fri, 10 Nov 2017 11:36:57 +0000 (03:36 -0800)
committerGabe Black <gabeblack@google.com>
Mon, 13 Nov 2017 17:12:42 +0000 (17:12 +0000)
Change-Id: I7299af0e2a6ce9bd2272d6ccb898997336e95e51
Reviewed-on: https://gem5-review.googlesource.com/5623
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/python/m5/util/convert.py

index cffa1bb492805b3d5a659fca452f82755035c046..5ae31216bd4c0adc12973e0f5bdf26297074f5c6 100644 (file)
@@ -242,3 +242,6 @@ def toVoltage(value):
 
 def toCurrent(value):
     return toMetricFloat(value, 'current', 'A')
+
+def toEnergy(value):
+    return toMetricFloat(value, 'energy', 'J')