Instead of using a convoluted getattr call, use the conventional
iteritems() interface.
Change-Id: I6d6bbccf865f8a0e8ff0767914157a7460099b09
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/10782
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
yield # make this function a (null) generator
def recurseDeviceTree(self, state):
- for child in [getattr(self, c) for c in self._children]:
+ for child in self._children.itervalues():
for item in child: # For looping over SimObjectVectors
- if isinstance(item, SimObject):
- for dt in item.generateDeviceTree(state):
- yield dt
+ for dt in item.generateDeviceTree(state):
+ yield dt
# Function to provide to C++ so it can look up instances based on paths
def resolveSimObject(name):