Sort fields in .ini files generated by Python config
authorSteve Reinhardt <stever@eecs.umich.edu>
Sun, 6 Mar 2005 00:28:43 +0000 (19:28 -0500)
committerSteve Reinhardt <stever@eecs.umich.edu>
Sun, 6 Mar 2005 00:28:43 +0000 (19:28 -0500)
to make it easier to diff output from modified versions.

sim/pyconfig/m5config.py:
    Sort .ini outputs for repeatable results across versions.

--HG--
extra : convert_revision : fa918f2c53635eca3a02ce02af9b320eacd1f057

sim/pyconfig/m5config.py

index c413fef714fac1118becbe97176143af201502f3..17a0d8f4229c35a5fc76eeebe5524f5a930148df 100644 (file)
@@ -698,9 +698,11 @@ class Node(object):
             # instantiate children in same order they were added for
             # backward compatibility (else we can end up with cpu1
             # before cpu0).
+            self.children.sort(lambda x,y: cmp(x.name, y.name))
             children = [ c.name for c in self.children if not c.paramcontext]
             print 'children =', ' '.join(children)
 
+        self.params.sort(lambda x,y: cmp(x.name, y.name))
         for param in self.params:
             try:
                 if param.value is None: