summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-03-19 06:34:02 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-03-19 06:34:02 -0400
commita444a6f8d666f7922460dc0fe75877680fd23546 (patch)
tree826d852f3fdd1baf3e3ffe313c80f41790d5bf12 /src/python
parentf02eec93d6785686fb9d4f7160c4af421a47521f (diff)
downloadgem5-a444a6f8d666f7922460dc0fe75877680fd23546.tar.xz
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.
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/SimObject.py5
1 files changed, 2 insertions, 3 deletions
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