summaryrefslogtreecommitdiff
path: root/src/python/m5/util/convert.py
AgeCommit message (Collapse)Author
2019-02-25python: Add Python 3 workarounds for longAndreas Sandberg
Python 3 doesn't have a separate long type. Make long an alias for int where needed to maintain compatibility. Change-Id: I4c0861302bc3a2fa5226b3041803ef975d29b2fd Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/15988 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
2019-02-20config: Make parameter conversion handle integers in other bases.Gabe Black
Python's float() function/type can't handle hexadecimal notation, but int() can. Since there are also cases where converting to a float and then back to an int (or long) can cause rounding error, this change splits toFloat and toInteger apart and makes them call a worker function which accepts a conversion function which does the work of converting a numeric string into an actual number. in the case of toFloat, it still uses the standard float(), and in the case of toInteger it uses a lambda which wraps int(x, 0). Change-Id: Ic46cf4ae86b7eba6f55d731d1b25e3f84b8bb64c Reviewed-on: https://gem5-review.googlesource.com/c/16504 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2019-02-12python: Make exception handling Python 3 safeAndreas Sandberg
Change-Id: I9c2cdfad20deb1ddfa224320cf93f2105d126652 Reviewed-on: https://gem5-review.googlesource.com/c/15980 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2017-11-13util: Add a "toEnergy" function to the convert module.Gabe Black
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>
2017-11-13util: Simplify/consolidate the python conversion module.Gabe Black
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>
2014-10-09config: Add Current as a parameter typeAndreas Hansson
This patch adds the Python parameter type Current, which is used for the DRAM power modelling (to start with). With this addition we avoid implicit unit assumptions.
2013-08-19power: Add voltage domains to the clock domainsAkash Bagdia
This patch adds the notion of voltage domains, and groups clock domains that operate under the same voltage (i.e. power supply) into domains. Each clock domain is required to be associated with a voltage domain, and the latter requires the voltage to be explicitly set. A voltage domain is an independently controllable voltage supply being provided to section of the design. Thus, if you wish to perform dynamic voltage scaling on a CPU, its clock domain should be associated with a separate voltage domain. The current implementation of the voltage domain does not take into consideration cases where there are derived voltage domains running at ratio of native voltage domains, as with the case where there can be on-chip buck/boost (charge pumps) voltage regulation logic. The regression and configuration scripts are updated with a generic voltage domain for the system, and one for the CPUs.
2010-11-23Copyright: Add AMD copyright to the param changes I just made.Gabe Black
2010-11-23Params: Add parameter types for IP addresses in various forms.Gabe Black
New parameter forms are: IP address in the format "a.b.c.d" where a-d are from decimal 0 to 255. IP address with netmask which is an IP followed by "/n" where n is a netmask length in bits from decimal 0 to 32 or by "/e.f.g.h" where e-h are from decimal 0 to 255 and which is all 1 bits followed by all 0 bits when represented in binary. These can also be specified as an integral IP and netmask passed in separately. IP address with port which is an IP followed by ":p" where p is a port index from decimal 0 to 65535. These can also be specified as an integral IP and port value passed in separately.
2009-09-22python: Move more code into m5.util allow SCons to use that code.Nathan Binkert
Get rid of misc.py and just stick misc things in __init__.py Move utility functions out of SCons files and into m5.util Move utility type stuff from m5/__init__.py to m5/util/__init__.py Remove buildEnv from m5 and allow access only from m5.defines Rename AddToPath to addToPath while we're moving it to m5.util Rename read_command to readCommand while we're moving it Rename compare_versions to compareVersions while we're moving it. --HG-- rename : src/python/m5/convert.py => src/python/m5/util/convert.py rename : src/python/m5/smartdict.py => src/python/m5/util/smartdict.py