1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-18 20:11:20 +00:00

framework/target: add ability to pass additional platform params.

Gem5Platform requires a host output directory as one if it's
instantiation parameters. This is not something we want to expose a
configuration parameter to the user, as for WA, the standard output
directory ought to be used.

Up to this point, WA's target instatiation process assumed that all
parameters came from the user, and there was no way for WA itself to set
them. This commit adds extra_platform_parms argument to
instantiate_target, to remedi this.

extra_platform_parms is then used to set the host output directory for
gem5 appropriately.
This commit is contained in:
Sergei Trofimov 2017-10-05 15:17:58 +01:00
parent 55a72002ca
commit c89e249732
2 changed files with 13 additions and 3 deletions

View File

@ -269,7 +269,8 @@ class Executor(object):
self.logger.info('Connecting to target')
self.target_manager = TargetManager(config.run_config.device,
config.run_config.device_config)
config.run_config.device_config,
output.basepath)
output.write_target_info(self.target_manager.get_target_info())
self.logger.info('Initializing execution context')

View File

@ -1,4 +1,5 @@
import logging
import os
from wa.framework import signal
from wa.framework.plugin import Parameter
@ -8,6 +9,7 @@ from wa.framework.target.descriptor import (get_target_descriptions,
from wa.framework.target.info import TargetInfo
from wa.framework.target.runtime_parameter_manager import RuntimeParameterManager
from devlib import Gem5SimulationPlatform
from devlib.utils.misc import memoized
from devlib.exception import TargetError
@ -25,7 +27,8 @@ class TargetManager(object):
"""),
]
def __init__(self, name, parameters):
def __init__(self, name, parameters, outdir):
self.outdir = outdir
self.logger = logging.getLogger('tm')
self.target_name = name
self.target = None
@ -85,8 +88,14 @@ class TargetManager(object):
if self.target_name not in target_map:
raise ValueError('Unknown Target: {}'.format(self.target_name))
tdesc = target_map[self.target_name]
extra_plat_params={}
if tdesc.platform is Gem5SimulationPlatform:
extra_plat_params['host_output_dir'] = self.outdir
self.logger.debug('Creating {} target'.format(self.target_name))
self.target = instantiate_target(tdesc, self.parameters, connect=False)
self.target = instantiate_target(tdesc, self.parameters, connect=False,
extra_platform_params=extra_plat_params)
with signal.wrap('TARGET_CONNECT'):
self.target.connect()