From 3547af6e449c4bc0797c1c333bdce9c1c3ee2b66 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Mon, 20 Mar 2017 10:44:07 +0000 Subject: config, arm: Unify checkpoint path handling in bL configs The vanilla bL configuration file and the dist-gem5 configuration file use slightly different code paths when restoring from checkpoints. Unify this by passing the parsed options to the instantiate() method and adding an optional checkpoint keyword argument for checkpoint directories (only used by the dist-gem5 script). Change-Id: I9943ec10bd7a256465e29c8de571142ec3fbaa0e Signed-off-by: Andreas Sandberg Reviewed-by: Curtis Dunham Reviewed-by: Sascha Bischoff Reviewed-by: Gabor Dozsa Reviewed-on: https://gem5-review.googlesource.com/2560 Reviewed-by: Jason Lowe-Power Reviewed-by: Weiping Liao --- configs/example/arm/fs_bigLITTLE.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'configs/example/arm/fs_bigLITTLE.py') diff --git a/configs/example/arm/fs_bigLITTLE.py b/configs/example/arm/fs_bigLITTLE.py index c542b8510..c2ecf8831 100644 --- a/configs/example/arm/fs_bigLITTLE.py +++ b/configs/example/arm/fs_bigLITTLE.py @@ -1,4 +1,4 @@ -# Copyright (c) 2016 ARM Limited +# Copyright (c) 2016-2017 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall @@ -209,11 +209,16 @@ def build(options): return root -def instantiate(checkpoint_path=None): +def instantiate(options, checkpoint_dir=None): # Get and load from the chkpt or simpoint checkpoint - if checkpoint_path is not None: - m5.util.inform("Restoring from checkpoint %s", checkpoint_path) - m5.instantiate(checkpoint_path) + if options.restore_from: + if checkpoint_dir and not os.path.isabs(options.restore_from): + cpt = os.path.join(checkpoint_dir, options.restore_from) + else: + cpt = options.restore_from + + m5.util.inform("Restoring from checkpoint %s", cpt) + m5.instantiate(cpt) else: m5.instantiate() @@ -241,7 +246,7 @@ def main(): addOptions(parser) options = parser.parse_args() root = build(options) - instantiate(options.restore_from) + instantiate(options) run() -- cgit v1.2.3