diff options
author | Nathan Binkert <binkertn@umich.edu> | 2005-03-22 14:47:18 -0500 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2005-03-22 14:47:18 -0500 |
commit | ac547c64892f9b93817787cd3dcf5d63ba6e5521 (patch) | |
tree | df51e8df506ebbcf654bb573a6edca511bb9d967 /python | |
parent | 5f2b3a6e5d38ea257ee7bbe78ef548905f083290 (diff) | |
download | gem5-ac547c64892f9b93817787cd3dcf5d63ba6e5521.tar.xz |
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
Diffstat (limited to 'python')
-rw-r--r-- | python/m5/config.py | 16 |
1 files changed, 7 insertions, 9 deletions
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 |