From 09b9512acd811861dc77ebcf60f705b29d261e1f Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Wed, 21 Apr 2021 11:44:40 +0100 Subject: [PATCH] configs: restore_simpoint_checkpoint should be a boolean The --restore_simpoint_checkpoint option is a boolean; however if no default value is supplied, optparse sets the default value to None This is not valid for argparse. Argparse recognizes the store_true action and it is automatically treating the option as a boolean, hence providing a default=False instead of default=None Change-Id: I6b09edf6911be71a06001730be1232a1b5c8482c Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44765 Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- configs/common/Options.py | 1 + configs/common/Simulation.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configs/common/Options.py b/configs/common/Options.py index c48bfe64e6..b833531f4e 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -305,6 +305,7 @@ def addCommonOptions(parser): parser.add_option("--take-simpoint-checkpoints", action="store", type="string", help="") parser.add_option("--restore-simpoint-checkpoint", action="store_true", + default=False, help="restore from a simpoint checkpoint taken with " + "--take-simpoint-checkpoints") diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py index 067bc01da0..3b9efc0c93 100644 --- a/configs/common/Simulation.py +++ b/configs/common/Simulation.py @@ -710,7 +710,7 @@ def run(options, root, testsys, cpu_class): takeSimpointCheckpoints(simpoints, interval_length, cptdir) # Restore from SimPoint checkpoints - elif options.restore_simpoint_checkpoint != None: + elif options.restore_simpoint_checkpoint: restoreSimpointCheckpoint() else: