python: Refactor toNum to support a selection of units
authorAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 18 Jan 2021 19:04:39 +0000 (19:04 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 25 Jan 2021 15:04:48 +0000 (15:04 +0000)
commitc9bd435e385df8452b5c86686691b31afe7a890d
tree2dea7981aefaa524444a320e66bc8f1db2cec19e
parent7a5be9aae7a62ada366b033b5300ba9b4f67ed27
python: Refactor toNum to support a selection of units

Add support for matching one of several different units in toNum. The
units parameter can now either be a tuple or a string describing the
supported unit(s). The function now returns a (magnitude, unit) tuple.

Change-Id: I683819722a93ade91a6def2bfa77209c29b4b39e
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39217
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
src/python/m5/util/convert.py