diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 8c14be2873..c1f0ff63ee 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): diff --git a/src/python/m5/proxy.py b/src/python/m5/proxy.py index a292658929..8c1a46909c 100644 --- a/src/python/m5/proxy.py +++ b/src/python/m5/proxy.py @@ -184,6 +184,8 @@ class AnyProxy(BaseProxy): def path(self): return 'any' +# The AllProxy traverses the entire sub-tree (not only the children) +# and adds all objects of a specific type class AllProxy(BaseProxy): def find(self, obj): return obj.find_all(self._pdesc.ptype)