From a7e8a789585193903e5fd9d07d320f5ea89b927b Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Fri, 8 Sep 2006 19:10:11 -0400 Subject: 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 --- src/python/m5/proxy.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/python/m5/proxy.py') 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 -- cgit v1.2.3