summaryrefslogtreecommitdiff
path: root/src/python/m5/proxy.py
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-09-08 19:10:11 -0400
committerSteve Reinhardt <stever@eecs.umich.edu>2006-09-08 19:10:11 -0400
commita7e8a789585193903e5fd9d07d320f5ea89b927b (patch)
tree14a9fb2f3d8d9df9cab3a5923de787eb23a02b55 /src/python/m5/proxy.py
parent886c7f7458513c9d0c274fd2927d826008c34e2a (diff)
downloadgem5-a7e8a789585193903e5fd9d07d320f5ea89b927b.tar.xz
Add support for assigning lists of ports or proxies to VectorPorts.
Includes support for printing readable VectorPort and Proxy names (via __str__). --HG-- extra : convert_revision : c48534a498b3036fe6ac45ff1606656546c79afb
Diffstat (limited to 'src/python/m5/proxy.py')
-rw-r--r--src/python/m5/proxy.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/python/m5/proxy.py b/src/python/m5/proxy.py
index 36995397b..7ebc0ae19 100644
--- a/src/python/m5/proxy.py
+++ b/src/python/m5/proxy.py
@@ -39,6 +39,15 @@ class BaseProxy(object):
self._search_up = search_up
self._multiplier = None
+ def __str__(self):
+ if self._search_self and not self._search_up:
+ s = 'Self'
+ elif not self._search_self and self._search_up:
+ s = 'Parent'
+ else:
+ s = 'ConfusedProxy'
+ return s + '.' + self.path()
+
def __setattr__(self, attr, value):
if not attr.startswith('_'):
raise AttributeError, \
@@ -102,6 +111,9 @@ class BaseProxy(object):
return obj
getindex = staticmethod(getindex)
+ # This method should be called once the proxy is assigned to a
+ # particular parameter or port to set the expected type of the
+ # resolved proxy
def set_param_desc(self, pdesc):
self._pdesc = pdesc