diff options
author | Gabe Black <gabeblack@google.com> | 2017-11-10 03:36:57 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2017-11-13 17:12:42 +0000 |
commit | 237d2f260bd8645d31b083879784e96e9c5c27f5 (patch) | |
tree | 7631baf1fb25cbbcef03e873282e28fc45778571 /src/python/m5/util | |
parent | 8327f8eb72764a277c4c5d21f483e0cd491c2d0e (diff) | |
download | gem5-237d2f260bd8645d31b083879784e96e9c5c27f5.tar.xz |
util: Add a "toEnergy" function to the convert module.
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>
Diffstat (limited to 'src/python/m5/util')
-rw-r--r-- | src/python/m5/util/convert.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/python/m5/util/convert.py b/src/python/m5/util/convert.py index cffa1bb49..5ae31216b 100644 --- a/src/python/m5/util/convert.py +++ b/src/python/m5/util/convert.py @@ -242,3 +242,6 @@ def toVoltage(value): def toCurrent(value): return toMetricFloat(value, 'current', 'A') + +def toEnergy(value): + return toMetricFloat(value, 'energy', 'J') |