From ac547c64892f9b93817787cd3dcf5d63ba6e5521 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 22 Mar 2005 14:47:18 -0500 Subject: Fix a bug introduced with the multidict commit. python/m5/config.py: search for any base class that is a confignode instead of those that derive from param type so that non-type classes work too. (Those that are just derived from ConfigNode and not SimObject.) --HG-- extra : convert_revision : 422181b2e5efd4675ec34adcffecfb58eee0e4e7 --- python/m5/config.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'python/m5') diff --git a/python/m5/config.py b/python/m5/config.py index 8a2a8c275..f696adc79 100644 --- a/python/m5/config.py +++ b/python/m5/config.py @@ -335,14 +335,12 @@ class MetaConfigNode(type): # We don't support multiple inheritence. If you want to, you # must fix multidict to deal with it properly. - sob = [ base for base in bases \ - if issubclass(base, ParamType) and base != ParamType ] - - if len(sob) == 1: + cnbase = [ base for base in bases if isConfigNode(base) ] + if len(cnbase) == 1: # If your parent has a value in it that's a config node, clone # it. Do this now so if we update any of the values' # attributes we are updating the clone and not the original. - for key,val in sob[0]._values.iteritems(): + for key,val in cnbase[0]._values.iteritems(): # don't clone if (1) we're about to overwrite it with # a local setting or (2) we've already cloned a copy @@ -355,14 +353,14 @@ class MetaConfigNode(type): elif isSimObjSequence(val) and len(val): cls._values[key] = [ v() for v in val ] - cls._params.parent = sob[0]._params - cls._values.parent = sob[0]._values + cls._params.parent = cnbase[0]._params + cls._values.parent = cnbase[0]._values - elif len(sob) > 1: + elif len(cnbase) > 1: panic("""\ The config hierarchy only supports single inheritence of SimObject classes. You're trying to derive from: -%s""" % str(sob)) +%s""" % str(cnbase)) # process param types from _init_dict, as these may be needed # by param descriptions also in _init_dict -- cgit v1.2.3