summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-12-06 14:18:18 -0800
committerNathan Binkert <nate@binkert.org>2008-12-06 14:18:18 -0800
commite08c6be9feb5d381ca45afc581cf6efb090f0dd7 (patch)
tree52284654e7195c18ec4379958c52dcec968b13cd /src/python
parentc55ae0cf5dcff2c0be98ff0e9ec971c6744beb35 (diff)
downloadgem5-e08c6be9feb5d381ca45afc581cf6efb090f0dd7.tar.xz
SimObject: change naming of vectors so there are the same numbers of digits.
i.e. we used to have Foo0, Foo1, ..., Foo10, Foo11, ..., Foo100 now we have Foo000, Foo001, ..., Foo010, Foo011, ..., Foo100
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/SimObject.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index ac81582f3..868f969a6 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -27,7 +27,9 @@
# Authors: Steve Reinhardt
# Nathan Binkert
-import sys, types
+import math
+import sys
+import types
import proxy
import m5
@@ -627,8 +629,9 @@ class SimObject(object):
if len(value) == 1:
value[0]._maybe_set_parent(self, attr)
else:
+ width = int(math.ceil(math.log(len(value))/math.log(10)))
for i,v in enumerate(value):
- v._maybe_set_parent(self, "%s%d" % (attr, i))
+ v._maybe_set_parent(self, "%s%0*d" % (attr, width, i))
self._values[attr] = value