Try to make unproxy order more deterministic.

--HG--
extra : convert_revision : 0bc543014dced6dfed4122d4c1b8f22e6c8d7a13
This commit is contained in:
Steve Reinhardt 2006-09-06 22:37:35 -07:00
parent 54698f6be8
commit c15e6d8e0a

View file

@ -633,13 +633,20 @@ class SimObject(object):
raise raise
setattr(self, param, value) setattr(self, param, value)
for port_name in self._ports.iterkeys(): # Unproxy ports in sorted order so that 'append' operations on
# vector ports are done in a deterministic fashion.
port_names = self._ports.keys()
port_names.sort()
for port_name in port_names:
port = self._port_refs.get(port_name) port = self._port_refs.get(port_name)
if port != None: if port != None:
port.unproxy(self) port.unproxy(self)
for child in self._children.itervalues(): # Unproxy children in sorted order for determinism also.
child.unproxy_all() child_names = self._children.keys()
child_names.sort()
for child in child_names:
self._children[child].unproxy_all()
def print_ini(self): def print_ini(self):
print '[' + self.path() + ']' # .ini section header print '[' + self.path() + ']' # .ini section header