summaryrefslogtreecommitdiff
path: root/src/python/m5/SimObject.py
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2011-07-10 12:56:08 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2011-07-10 12:56:08 -0500
commit9751a1d3e78cbbcd17835ab967f036945ee2cec2 (patch)
treee670aaee81a41e463bab3d5d3eb057d328d9bafc /src/python/m5/SimObject.py
parent83f91db2ccbdf5af0ec984b1f94c83b8a4fbdc1e (diff)
downloadgem5-9751a1d3e78cbbcd17835ab967f036945ee2cec2.tar.xz
Config: Add support for a Self.all proxy object
Diffstat (limited to 'src/python/m5/SimObject.py')
-rw-r--r--src/python/m5/SimObject.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index c18d6900c..9729fd30f 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -746,6 +746,21 @@ class SimObject(object):
found_obj = match_obj
return found_obj, found_obj != None
+ def find_all(self, ptype):
+ all = {}
+ # search children
+ for child in self._children.itervalues():
+ if isinstance(child, ptype) and not isproxy(child) and \
+ not isNullPointer(child):
+ all[child] = True
+ # search param space
+ for pname,pdesc in self._params.iteritems():
+ if issubclass(pdesc.ptype, ptype):
+ match_obj = self._values[pname]
+ if not isproxy(match_obj) and not isNullPointer(match_obj):
+ all[match_obj] = True
+ return all.keys(), True
+
def unproxy(self, base):
return self