From 966c3f4bc5581347a411c25db1440afb97f12dab Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 2 Dec 2014 06:08:22 -0500 Subject: 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. --- src/python/m5/SimObject.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/python') 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] -- cgit v1.2.3