config: Traverse lists when visiting children in all proxy

This patch makes the all proxy traverse any potential list that is
encountered in the object hierarchy instead of only looking at
children that are SimObjects. An example of where this is useful is
when creating a multi-channel memory system as a list of controllers,
whilst ensuring that the memories are still visible in the system.
This commit is contained in:
Andreas Hansson 2013-01-07 13:05:38 -05:00
parent e0d93fde99
commit e6c57786a4

View file

@ -872,6 +872,13 @@ class SimObject(object):
all = {} all = {}
# search children # search children
for child in self._children.itervalues(): for child in self._children.itervalues():
# a child could be a list, so ensure we visit each item
if isinstance(child, list):
children = child
else:
children = [child]
for child in children:
if isinstance(child, ptype) and not isproxy(child) and \ if isinstance(child, ptype) and not isproxy(child) and \
not isNullPointer(child): not isNullPointer(child):
all[child] = True all[child] = True