SimObject.py (12770:42f6afaab313) | SimObject.py (12786:e3a5c978e7d1) |
---|---|
1# Copyright (c) 2017 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 1506 unchanged lines hidden (view full) --- 1515 1516 # Default function for generating the device structure. 1517 # Can be overloaded by the inheriting class 1518 def generateDeviceTree(self, state): 1519 return # return without yielding anything 1520 yield # make this function a (null) generator 1521 1522 def recurseDeviceTree(self, state): | 1# Copyright (c) 2017 ARM Limited 2# All rights reserved. 3# 4# The license below extends only to copyright in the software and shall 5# not be construed as granting a license to any other intellectual 6# property including but not limited to intellectual property relating 7# to a hardware implementation of the functionality of the software 8# licensed hereunder. You may use the software subject to the license --- 1506 unchanged lines hidden (view full) --- 1515 1516 # Default function for generating the device structure. 1517 # Can be overloaded by the inheriting class 1518 def generateDeviceTree(self, state): 1519 return # return without yielding anything 1520 yield # make this function a (null) generator 1521 1522 def recurseDeviceTree(self, state): |
1523 for child in [getattr(self, c) for c in self._children]: | 1523 for child in self._children.itervalues(): |
1524 for item in child: # For looping over SimObjectVectors | 1524 for item in child: # For looping over SimObjectVectors |
1525 if isinstance(item, SimObject): 1526 for dt in item.generateDeviceTree(state): 1527 yield dt | 1525 for dt in item.generateDeviceTree(state): 1526 yield dt |
1528 1529# Function to provide to C++ so it can look up instances based on paths 1530def resolveSimObject(name): 1531 obj = instanceDict[name] 1532 return obj.getCCObject() 1533 1534def isSimObject(value): 1535 return isinstance(value, SimObject) --- 59 unchanged lines hidden --- | 1527 1528# Function to provide to C++ so it can look up instances based on paths 1529def resolveSimObject(name): 1530 obj = instanceDict[name] 1531 return obj.getCCObject() 1532 1533def isSimObject(value): 1534 return isinstance(value, SimObject) --- 59 unchanged lines hidden --- |