Make ConfigNodes as intermediate containers work again.
authorNathan Binkert <binkertn@umich.edu>
Fri, 11 Mar 2005 23:30:44 +0000 (18:30 -0500)
committerNathan Binkert <binkertn@umich.edu>
Fri, 11 Mar 2005 23:30:44 +0000 (18:30 -0500)
python/m5/config.py:
    move the type stuff into the Node constructor and
    only try to grab self.type if the realtype is a SimObject

--HG--
extra : convert_revision : 00f6ece47e3812f67f9e1f062fe9c060bd6dd1cf

python/m5/config.py

index b39a8b9a6628dff7861393c1fc1d124a9d1eaa0a..33e329f3ff345491c00ad17e181d849ae8f6bfdf 100644 (file)
@@ -449,7 +449,7 @@ class MetaConfigNode(type):
 
     # Print instance info to .ini file.
     def instantiate(cls, name, parent = None):
-        instance = Node(name, cls, cls.type, parent, isParamContext(cls))
+        instance = Node(name, cls, parent, isParamContext(cls))
 
         if hasattr(cls, 'check'):
             cls.check()
@@ -584,10 +584,13 @@ class NodeParam(object):
 
 class Node(object):
     all = {}
-    def __init__(self, name, realtype, type, parent, paramcontext):
+    def __init__(self, name, realtype, parent, paramcontext):
         self.name = name
         self.realtype = realtype
-        self.type = type
+        if isSimObject(realtype):
+            self.type = realtype.type
+        else:
+            self.type = None
         self.parent = parent
         self.children = []
         self.child_names = {}