summaryrefslogtreecommitdiff
path: root/src/python/m5/SimObject.py
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-04-05 10:44:35 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-04-05 10:44:35 -0400
commitaab2001ab7a8196eb01be1a05977400fed8d8d79 (patch)
treef6767b7fb540f1e3f45fc0a28f68955381ff8c48 /src/python/m5/SimObject.py
parenta8e6adb0b1284e89a63bcb14fe1fdace2b89e0c8 (diff)
downloadgem5-aab2001ab7a8196eb01be1a05977400fed8d8d79.tar.xz
Python: Make the All proxy traverse SimObject children as well
This patch changes the behaviour of the All proxy parameter to not only consider the direct children, but also do a pre-order depth-first traversal of the object tree and append all results from the children. This is used in a later patch to find all the memories in the system, independent of where they are located in the hierarchy.
Diffstat (limited to 'src/python/m5/SimObject.py')
-rw-r--r--src/python/m5/SimObject.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index 8c14be287..c1f0ff63e 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -865,6 +865,10 @@ class SimObject(object):
if isinstance(child, ptype) and not isproxy(child) and \
not isNullPointer(child):
all[child] = True
+ if isSimObject(child):
+ # also add results from the child itself
+ child_all, done = child.find_all(ptype)
+ all.update(dict(zip(child_all, [done] * len(child_all))))
# search param space
for pname,pdesc in self._params.iteritems():
if issubclass(pdesc.ptype, ptype):