mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-04 20:32:36 +01: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:
@@ -138,6 +138,9 @@ class ExecutionContext(object):
|
|||||||
self.output.write_state()
|
self.output.write_state()
|
||||||
self.output.write_result()
|
self.output.write_result()
|
||||||
|
|
||||||
|
def finalize(self):
|
||||||
|
self.tm.finalize()
|
||||||
|
|
||||||
def start_job(self):
|
def start_job(self):
|
||||||
if not self.job_queue:
|
if not self.job_queue:
|
||||||
raise RuntimeError('No jobs to run')
|
raise RuntimeError('No jobs to run')
|
||||||
@@ -296,6 +299,7 @@ class Executor(object):
|
|||||||
runner = Runner(context, pm)
|
runner = Runner(context, pm)
|
||||||
signal.send(signal.RUN_STARTED, self)
|
signal.send(signal.RUN_STARTED, self)
|
||||||
runner.run()
|
runner.run()
|
||||||
|
context.finalize()
|
||||||
self.execute_postamble(context, output)
|
self.execute_postamble(context, output)
|
||||||
signal.send(signal.RUN_COMPLETED, self)
|
signal.send(signal.RUN_COMPLETED, self)
|
||||||
|
|
||||||
|
@@ -56,8 +56,8 @@ class TargetManager(object):
|
|||||||
self.rpm = RuntimeParameterManager(self.target)
|
self.rpm = RuntimeParameterManager(self.target)
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
self.logger.info('Disconnecting from the device')
|
if self.disconnect or isinstance(self.target.platform, Gem5SimulationPlatform):
|
||||||
if self.disconnect:
|
self.logger.info('Disconnecting from the device')
|
||||||
with signal.wrap('TARGET_DISCONNECT'):
|
with signal.wrap('TARGET_DISCONNECT'):
|
||||||
self.target.disconnect()
|
self.target.disconnect()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user