From: Andreas Hansson Date: Mon, 19 Mar 2012 10:34:02 +0000 (-0400) Subject: scripts: Fix to ensure that port connection count is always set X-Git-Tag: stable_2012_06_28~173 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a444a6f8d666f7922460dc0fe75877680fd23546;p=gem5.git scripts: Fix to ensure that port connection count is always set This patch ensures that the port connection count is set to zero in those cases when the port is not connected. --- diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 9c6a32f41..a447d96db 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -993,9 +993,8 @@ class SimObject(object): port_names.sort() for port_name in port_names: port = self._port_refs.get(port_name, None) - if port != None: - setattr(cc_params, 'port_' + port_name + '_connection_count', - len(port)) + setattr(cc_params, 'port_' + port_name + '_connection_count', + len(port) if port != None else 0) self._ccParams = cc_params return self._ccParams