From 3d582c767a2891d4a4ab8defa8929b061cbcee18 Mon Sep 17 00:00:00 2001 From: Geoffrey Blake Date: Thu, 17 Oct 2013 10:20:45 -0500 Subject: config: Fix for port references generated multiple times SimObjects are expected to only generate one port reference per port belonging to them. There is a subtle bug with using "not" here as a VectorPort is seen as not having a reference if it is either None or empty as per Python docs sec 9.9 for Standard operators. Intended behavior is to only check if we have not created the reference. --- src/python/m5/SimObject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 09145f498..8aa7260e7 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -698,7 +698,7 @@ class SimObject(object): # via __setattr__. There is only ever one reference # object per port, but we create them lazily here. ref = self._port_refs.get(attr) - if not ref: + if ref == None: ref = self._ports[attr].makeRef(self) self._port_refs[attr] = ref return ref -- cgit v1.2.3