fastmodel: follow .sgproj SIMGEN_COMMAND_LINE

ARM's .sgproj has SIMGEN_COMMAND_LINE to be fed into simgen when
running. However, simgen itself doesn't parse that option and apply. We
need to parse it by ourself and pass the arg to simgen when invoking.

Change-Id: I43b131a1ca9f98891ab390de583589a710e7c812
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/60369
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/arch/arm/fastmodel/SConscript b/src/arch/arm/fastmodel/SConscript
index 0e9d84e..35c0da1 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -318,6 +318,8 @@
         tlc = None
         # Config name.
         config_name = None
+        # simgen_arg
+        simgen_command_line = ''
 
         # Scan for particular properties of the project.
         for param in proj.params:
@@ -327,6 +329,12 @@
                 elif param.name == 'ACTIVE_CONFIG_LINUX':
                     config_name = param.value
 
+        for param in proj.params:
+            if param.name == config_name:
+                for sub_param in param.params:
+                    if sub_param.name == 'SIMGEN_COMMAND_LINE':
+                        simgen_command_line = sub_param.value
+
         assert tlc is not None and config_name is not None
 
         simgen_dir = project_file_dir.Dir(config_name)
@@ -369,11 +377,12 @@
         self.rpaths = [simgen_dir, project_file_dir]
         self.log = gen_dir.File('build_%s.log' % tlc)
         self.simgen_cmd = env.subst('${CONF["SIMGEN"]} -p %s '
-            '--configuration %s -b --verbose off --num-build-cpus %d '
+            '--configuration %s -b --verbose off --num-build-cpus %d %s '
             '--build-dir %s >%s') % \
             (shlex.quote(project_file.srcnode().abspath),
              shlex.quote(config_name),
              GetOption('num_jobs'),
+             simgen_command_line,
              shlex.quote(simgen_dir.abspath),
              shlex.quote(self.log.abspath))