SimObject.py (10458:64809024b924) | SimObject.py (10532:66451b99f3e6) |
---|---|
1# Copyright (c) 2012 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 --- 1275 unchanged lines hidden (view full) --- 1284 child_all, done = child.find_all(ptype) 1285 all.update(dict(zip(child_all, [done] * len(child_all)))) 1286 # search param space 1287 for pname,pdesc in self._params.iteritems(): 1288 if issubclass(pdesc.ptype, ptype): 1289 match_obj = self._values[pname] 1290 if not isproxy(match_obj) and not isNullPointer(match_obj): 1291 all[match_obj] = True | 1# Copyright (c) 2012 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 --- 1275 unchanged lines hidden (view full) --- 1284 child_all, done = child.find_all(ptype) 1285 all.update(dict(zip(child_all, [done] * len(child_all)))) 1286 # search param space 1287 for pname,pdesc in self._params.iteritems(): 1288 if issubclass(pdesc.ptype, ptype): 1289 match_obj = self._values[pname] 1290 if not isproxy(match_obj) and not isNullPointer(match_obj): 1291 all[match_obj] = True |
1292 return all.keys(), True | 1292 # Also make sure to sort the keys based on the objects' path to 1293 # ensure that the order is the same on all hosts 1294 return sorted(all.keys(), key = lambda o: o.path()), True |
1293 1294 def unproxy(self, base): 1295 return self 1296 1297 def unproxyParams(self): 1298 for param in self._params.iterkeys(): 1299 value = self._values.get(param) 1300 if value != None and isproxy(value): --- 131 unchanged lines hidden (view full) --- 1432 self._ccObject = params.create() 1433 elif self._ccObject == -1: 1434 raise RuntimeError, "%s: Cycle found in configuration hierarchy." \ 1435 % self.path() 1436 return self._ccObject 1437 1438 def descendants(self): 1439 yield self | 1295 1296 def unproxy(self, base): 1297 return self 1298 1299 def unproxyParams(self): 1300 for param in self._params.iterkeys(): 1301 value = self._values.get(param) 1302 if value != None and isproxy(value): --- 131 unchanged lines hidden (view full) --- 1434 self._ccObject = params.create() 1435 elif self._ccObject == -1: 1436 raise RuntimeError, "%s: Cycle found in configuration hierarchy." \ 1437 % self.path() 1438 return self._ccObject 1439 1440 def descendants(self): 1441 yield self |
1440 for child in self._children.itervalues(): | 1442 # The order of the dict is implementation dependent, so sort 1443 # it based on the key (name) to ensure the order is the same 1444 # on all hosts 1445 for (name, child) in sorted(self._children.iteritems()): |
1441 for obj in child.descendants(): 1442 yield obj 1443 1444 # Call C++ to create C++ object corresponding to this object 1445 def createCCObject(self): 1446 self.getCCParams() 1447 self.getCCObject() # force creation 1448 1449 def getValue(self): 1450 return self.getCCObject() 1451 1452 # Create C++ port connections corresponding to the connections in 1453 # _port_refs 1454 def connectPorts(self): | 1446 for obj in child.descendants(): 1447 yield obj 1448 1449 # Call C++ to create C++ object corresponding to this object 1450 def createCCObject(self): 1451 self.getCCParams() 1452 self.getCCObject() # force creation 1453 1454 def getValue(self): 1455 return self.getCCObject() 1456 1457 # Create C++ port connections corresponding to the connections in 1458 # _port_refs 1459 def connectPorts(self): |
1455 for portRef in self._port_refs.itervalues(): | 1460 # Sort the ports based on their attribute name to ensure the 1461 # order is the same on all hosts 1462 for (attr, portRef) in sorted(self._port_refs.iteritems()): |
1456 portRef.ccConnect() 1457 1458# Function to provide to C++ so it can look up instances based on paths 1459def resolveSimObject(name): 1460 obj = instanceDict[name] 1461 return obj.getCCObject() 1462 1463def isSimObject(value): --- 55 unchanged lines hidden --- | 1463 portRef.ccConnect() 1464 1465# Function to provide to C++ so it can look up instances based on paths 1466def resolveSimObject(name): 1467 obj = instanceDict[name] 1468 return obj.getCCObject() 1469 1470def isSimObject(value): --- 55 unchanged lines hidden --- |