diff -r 3f37cc5d25bc -r ab284c6ba421 src/python/m5/SimObject.py --- a/src/python/m5/SimObject.py Mon May 23 14:36:22 2011 -0400 +++ b/src/python/m5/SimObject.py Thu May 26 21:15:47 2011 -0500 @@ -726,6 +726,20 @@ 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): + 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): + all[match_obj] = True + return all.keys(), True + def unproxy(self, base): return self diff -r 3f37cc5d25bc -r ab284c6ba421 src/python/m5/params.py --- a/src/python/m5/params.py Mon May 23 14:36:22 2011 -0400 +++ b/src/python/m5/params.py Thu May 26 21:15:47 2011 -0500 @@ -184,7 +184,10 @@ return [ v.getValue() for v in self ] def unproxy(self, base): - return [v.unproxy(base) for v in self] + val = [v.unproxy(base) for v in self] + if len(val) and isinstance(val[0], (list, tuple)): + return val[0] + return val class SimObjectVector(VectorParamValue): # support clone operation diff -r 3f37cc5d25bc -r ab284c6ba421 src/python/m5/proxy.py --- a/src/python/m5/proxy.py Mon May 23 14:36:22 2011 -0400 +++ b/src/python/m5/proxy.py Thu May 26 21:15:47 2011 -0500 @@ -184,6 +184,13 @@ def path(self): return 'any' +class AllProxy(BaseProxy): + def find(self, obj): + return obj.find_all(self._pdesc.ptype) + + def path(self): + return 'all' + def isproxy(obj): if isinstance(obj, (BaseProxy, params.EthernetAddr)): return True @@ -201,6 +208,8 @@ def __getattr__(self, attr): if attr == 'any': return AnyProxy(self.search_self, self.search_up) + elif attr == 'all': + return AllProxy(self.search_self, self.search_up) else: return AttrProxy(self.search_self, self.search_up, attr) diff -r 3f37cc5d25bc -r ab284c6ba421 src/sim/System.py --- a/src/sim/System.py Mon May 23 14:36:22 2011 -0400 +++ b/src/sim/System.py Thu May 26 21:15:47 2011 -0500 @@ -47,6 +47,8 @@ physmem = Param.PhysicalMemory(Parent.any, "physical memory") mem_mode = Param.MemoryMode('atomic', "The mode the memory system is in") + memories = VectorParam.PhysicalMemory(Self.all, "All memories is the system") + work_item_id = Param.Int(-1, "specific work item id") work_begin_cpu_id_exit = Param.Int(-1, "work started on specific id, now exit simulation")