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

framework/execution: fix TargetManager termination

- Make sure TargetManager.finalize() actually gets called at the end
  of the run.
- Overrule the "diconnect" parameter behavior for gem5 and make sure it
  always disconnects. This necessary for stats to be generated properly.
This commit is contained in:
Sergei Trofimov 2017-10-05 18:25:29 +01:00
parent 05e90bd623
commit 5ecc4703e4
2 changed files with 6 additions and 2 deletions

View File

@ -138,6 +138,9 @@ class ExecutionContext(object):
self.output.write_state()
self.output.write_result()
def finalize(self):
self.tm.finalize()
def start_job(self):
if not self.job_queue:
raise RuntimeError('No jobs to run')
@ -296,6 +299,7 @@ class Executor(object):
runner = Runner(context, pm)
signal.send(signal.RUN_STARTED, self)
runner.run()
context.finalize()
self.execute_postamble(context, output)
signal.send(signal.RUN_COMPLETED, self)

View File

@ -56,8 +56,8 @@ class TargetManager(object):
self.rpm = RuntimeParameterManager(self.target)
def finalize(self):
self.logger.info('Disconnecting from the device')
if self.disconnect:
if self.disconnect or isinstance(self.target.platform, Gem5SimulationPlatform):
self.logger.info('Disconnecting from the device')
with signal.wrap('TARGET_DISCONNECT'):
self.target.disconnect()