Params: Fix check for cycles in the configuration and clarify the comments/error...
authorGabe Black <gblack@eecs.umich.edu>
Tue, 13 Nov 2007 02:06:02 +0000 (18:06 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 13 Nov 2007 02:06:02 +0000 (18:06 -0800)
--HG--
extra : convert_revision : 8f35dde408fae874bcba1a248d32a22222d98c35

src/python/m5/SimObject.py

index d3e7d7975264d2ebc112f7453cce1109f9dd13ad..78df6bef1f1979f8844b124b462da117ee9ece77 100644 (file)
@@ -793,12 +793,14 @@ class SimObject(object):
     # necessary to construct it.  Does *not* recursively create
     # children.
     def getCCObject(self):
-        params = self.getCCParams()
         if not self._ccObject:
-            self._ccObject = -1 # flag to catch cycles in recursion
+            # Cycles in the configuration heirarchy are not supported. This
+            # will catch the resulting recursion and stop.
+            self._ccObject = -1
+            params = self.getCCParams()
             self._ccObject = params.create()
         elif self._ccObject == -1:
-            raise RuntimeError, "%s: recursive call to getCCObject()" \
+            raise RuntimeError, "%s: Cycle found in configuration heirarchy." \
                   % self.path()
         return self._ccObject