diff options
author | Ali Saidi <Ali.Saidi@ARM.com> | 2012-01-09 18:08:20 -0600 |
---|---|---|
committer | Ali Saidi <Ali.Saidi@ARM.com> | 2012-01-09 18:08:20 -0600 |
commit | 68d387ec802083322196f609c755b993771e9d19 (patch) | |
tree | efad84d35ea288a87c101a71a705962a0334f909 /src/python/m5/params.py | |
parent | c94e5256d9d6a076118336a61b951bcf9b5482a1 (diff) | |
download | gem5-68d387ec802083322196f609c755b993771e9d19.tar.xz |
config: support outputing a pickle of the configuration tree
Diffstat (limited to 'src/python/m5/params.py')
-rw-r--r-- | src/python/m5/params.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/python/m5/params.py b/src/python/m5/params.py index 03917d085..05fe9b774 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -228,6 +228,12 @@ class SimObjectVector(VectorParamValue): for obj in v.descendants(): yield obj + def get_config_as_dict(self): + a = [] + for v in self: + a.append(v.get_config_as_dict()) + return a + class VectorParamDesc(ParamDesc): # Convert assigned value to appropriate type. If the RHS is not a # list or tuple, it generates a single-element list. @@ -964,6 +970,9 @@ class Time(ParamValue): def ini_str(self): return str(self) + def get_config_as_dict(self): + return str(self) + # Enumerated types are a little more complex. The user specifies the # type as Enum(foo) where foo is either a list or dictionary of # alternatives (typically strings, but not necessarily so). (In the |