summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:08:22 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:08:22 -0500
commit966c3f4bc5581347a411c25db1440afb97f12dab (patch)
tree72e14bcb462403383f584a1b10cd03f4c8cb5a84 /src/python
parent5d22250845f6160bb0529ab510918f56a5c30f94 (diff)
downloadgem5-966c3f4bc5581347a411c25db1440afb97f12dab.tar.xz
scons: Ensure dictionary iteration is sorted by key
This patch adds sorting based on the SimObject name or parameter name for all situations where we iterate over dictionaries. This should ensure a deterministic and consistent order across the host systems and hopefully avoid regression results differing across python versions.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/SimObject.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index 71091ce6c..240b449df 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -691,8 +691,8 @@ class MetaSimObject(type):
# The 'local' attribute restricts us to the params declared in
# the object itself, not including inherited params (which
# will also be inherited from the base class's param struct
- # here).
- params = cls._params.local.values()
+ # here). Sort the params based on their key
+ params = map(lambda (k, v): v, sorted(cls._params.local.items()))
ports = cls._ports.local
code('%module(package="m5.internal") param_$cls')
@@ -772,8 +772,8 @@ using std::ptrdiff_t;
# The 'local' attribute restricts us to the params declared in
# the object itself, not including inherited params (which
# will also be inherited from the base class's param struct
- # here).
- params = cls._params.local.values()
+ # here). Sort the params based on their key
+ params = map(lambda (k, v): v, sorted(cls._params.local.items()))
ports = cls._ports.local
try:
ptypes = [p.ptype for p in params]