config: Handle NULL simobject parameters in read_config.py.
authorGabe Black <gabeblack@google.com>
Fri, 22 Dec 2017 04:49:50 +0000 (20:49 -0800)
committerGabe Black <gabeblack@google.com>
Tue, 2 Jan 2018 07:09:48 +0000 (07:09 +0000)
Change-Id: If0f87e8ee37099be4d0f3567db4fc34f8467e409
Reviewed-on: https://gem5-review.googlesource.com/6943
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

configs/example/read_config.py

index a4f03aa8cb5ae1c58890517d17cb6ab2be053148..7569cd17dc748179a8f35f834ebd24db15ad7a72 100644 (file)
@@ -215,8 +215,10 @@ class ConfigManager(object):
                     param_values = self.config.get_param_vector(object_name,
                         param_name)
 
-                    setattr(obj, param_name, [ self.objects_by_name[name]
-                        for name in param_values ])
+                    setattr(obj, param_name,
+                            [ self.objects_by_name[name]
+                                  if name != 'Null' else m5.params.NULL
+                              for name in param_values ])
                 else:
                     param_value = self.config.get_param(object_name,
                         param_name)
@@ -235,6 +237,8 @@ class ConfigManager(object):
 
         for child_name, child_paths in children:
             param = obj.__class__._params.get(child_name, None)
+            if child_name == 'Null':
+                continue
 
             if isinstance(child_paths, list):
                 child_list = [ self.objects_by_name[path]