util: Simplify/consolidate the python conversion module.
authorGabe Black <gabeblack@google.com>
Fri, 10 Nov 2017 10:04:00 +0000 (02:04 -0800)
committerGabe Black <gabeblack@google.com>
Mon, 13 Nov 2017 09:03:46 +0000 (09:03 +0000)
commit0a67a7a7ce42fd1af0f5013b9723126e18f45378
treea58af955496f680b7b6dbf72b164b36d96868414
parent49cf9fded08741099d25848807442a89c4d21399
util: Simplify/consolidate the python conversion module.

The python conversion module was really repetitive and fragmented,
where some types of conversions use common code, and some use hand
written case statements which did something very similar. Also, some
types like Voltage could only handle V and mV but no other scaling
prefix.

This change restructures the module to centralize a lot of the unit
handling code into toFloat, and makes the various other functions use
it.

Change-Id: Ic8529203cc226c9b551b8535a444e3f2f25ad1eb
Reviewed-on: https://gem5-review.googlesource.com/5621
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
src/python/m5/util/convert.py