Merge ktlim@zizzer.eecs.umich.edu:/bk/m5
[gem5.git] / python / m5 / config.py
index e6ad5a0ba5a1edb60b55c8283642b4bf1c32d438..64ec994906ee3a5b12062017e18695aac078a55c 100644 (file)
@@ -27,6 +27,7 @@
 from __future__ import generators
 import os, re, sys, types, inspect
 
+from m5 import panic
 from convert import *
 
 noDot = False
@@ -197,12 +198,13 @@ class Proxy(object):
                 raise AttributeError, \
                       'Parent of %s type %s not found at path %s' \
                       % (base.name, ptype, self._path)
-            found, done = obj.find(ptype, self._path)
-            if isinstance(found, Proxy):
-                done = False
+            result, done = obj.find(ptype, self._path)
             obj = obj.parent
 
-        return self._mulcheck(found)
+        if isinstance(result, Proxy):
+            result = result.unproxy(obj, ptype)
+
+        return self._mulcheck(result)
 
     def getindex(obj, index):
         if index == None:
@@ -895,6 +897,9 @@ class Value(object):
     def __str__(self):
         return str(self._getattr())
 
+    def __len__(self):
+        return len(self._getattr())
+
 # Regular parameter.
 class _Param(object):
     def __init__(self, ptype, *args, **kwargs):