summaryrefslogtreecommitdiff
path: root/src/python/m5/SimObject.py
diff options
context:
space:
mode:
authorGeoffrey Blake <geoffrey.blake@arm.com>2013-10-31 13:41:13 -0500
committerGeoffrey Blake <geoffrey.blake@arm.com>2013-10-31 13:41:13 -0500
commit15938e049267d87e4272aa863741e56eba883117 (patch)
tree129ca1c1fe7843d561439b1269c9ea80016b2037 /src/python/m5/SimObject.py
parent6b4543184ea4203f44210f8061b888d8d683979a (diff)
downloadgem5-15938e049267d87e4272aa863741e56eba883117.tar.xz
config: Fix handling of parents for simobject vectors
SimObjectVector objects did not provide the same interface to the _parent attribute through get_parent() like a normal SimObject. It also handled assigning a _parent incorrectly if objects in a SimObjectVector were changed post-creation, leading to errors later when the simulator tried to execute. This patch fixes these two omissions.
Diffstat (limited to 'src/python/m5/SimObject.py')
-rw-r--r--src/python/m5/SimObject.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py
index 8aa7260e7..14499759c 100644
--- a/src/python/m5/SimObject.py
+++ b/src/python/m5/SimObject.py
@@ -784,6 +784,11 @@ class SimObject(object):
self._parent = parent
self._name = name
+ # Return parent object of this SimObject, not implemented by SimObjectVector
+ # because the elements in a SimObjectVector may not share the same parent
+ def get_parent(self):
+ return self._parent
+
# Also implemented by SimObjectVector
def get_name(self):
return self._name