gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: configs: Update Arm simple configs to enable --interactive option

RC
Richard Cooper (Gerrit)
Wed, Apr 12, 2023 7:41 AM

Richard Cooper has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/69687?usp=email )

Change subject: configs: Update Arm simple configs to enable --interactive
option
......................................................................

configs: Update Arm simple configs to enable --interactive option

Removed the calls to sys.exit() from the Arm simple configs. These
calls terminate gem5's embedded Python interpreter and gem5 at the end
of the config script, preventing gem5 from dropping into the
interactive IPython shell when the --interactive option has been
specified.

Change-Id: I0c350b0d107f297691255361d25c566c889f9469

M configs/example/arm/baremetal.py
M configs/example/arm/starter_fs.py
M configs/example/arm/starter_se.py
3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/configs/example/arm/baremetal.py
b/configs/example/arm/baremetal.py
index 9caab9d..ab24fd3 100644
--- a/configs/example/arm/baremetal.py
+++ b/configs/example/arm/baremetal.py
@@ -174,11 +174,9 @@
m5.checkpoint(os.path.join(cpt_dir))
print("Checkpoint done.")
else:

  •        print(exit_msg, " @ ", m5.curTick())
    
  •        print(f"{exit_msg} ({event.getCode()}) @ {m5.curTick()}")
            break
    
  • sys.exit(event.getCode())

def main():
parser = argparse.ArgumentParser(epilog=doc)
diff --git a/configs/example/arm/starter_fs.py
b/configs/example/arm/starter_fs.py
index cc5f63f..f1e1983 100644
--- a/configs/example/arm/starter_fs.py
+++ b/configs/example/arm/starter_fs.py
@@ -194,12 +194,9 @@
m5.checkpoint(os.path.join(cpt_dir))
print("Checkpoint done.")
else:

  •        print(exit_msg, " @ ", m5.curTick())
    
  •        print(f"{exit_msg} ({event.getCode()}) @ {m5.curTick()}")
            break
    
  • sys.exit(event.getCode())
  • def main():
    parser = argparse.ArgumentParser(epilog=doc)

diff --git a/configs/example/arm/starter_se.py
b/configs/example/arm/starter_se.py
index 33514c7..f21f399 100644
--- a/configs/example/arm/starter_se.py
+++ b/configs/example/arm/starter_se.py
@@ -257,8 +257,7 @@
# Print the reason for the simulation exit. Some exit codes are
# requests for service (e.g., checkpoints) from the simulation
# script. We'll just ignore them here and exit.

  • print(event.getCause(), " @ ", m5.curTick())
  • sys.exit(event.getCode())
  • print(f"{event.getCause()} ({event.getCode()}) @ {m5.curTick()}")

if name == "m5_main":

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69687?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I0c350b0d107f297691255361d25c566c889f9469
Gerrit-Change-Number: 69687
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Cooper richard.cooper@arm.com
Gerrit-MessageType: newchange

Richard Cooper has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69687?usp=email ) Change subject: configs: Update Arm simple configs to enable --interactive option ...................................................................... configs: Update Arm simple configs to enable --interactive option Removed the calls to `sys.exit()` from the Arm simple configs. These calls terminate gem5's embedded Python interpreter and gem5 at the end of the config script, preventing gem5 from dropping into the interactive IPython shell when the `--interactive` option has been specified. Change-Id: I0c350b0d107f297691255361d25c566c889f9469 --- M configs/example/arm/baremetal.py M configs/example/arm/starter_fs.py M configs/example/arm/starter_se.py 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/configs/example/arm/baremetal.py b/configs/example/arm/baremetal.py index 9caab9d..ab24fd3 100644 --- a/configs/example/arm/baremetal.py +++ b/configs/example/arm/baremetal.py @@ -174,11 +174,9 @@ m5.checkpoint(os.path.join(cpt_dir)) print("Checkpoint done.") else: - print(exit_msg, " @ ", m5.curTick()) + print(f"{exit_msg} ({event.getCode()}) @ {m5.curTick()}") break - sys.exit(event.getCode()) - def main(): parser = argparse.ArgumentParser(epilog=__doc__) diff --git a/configs/example/arm/starter_fs.py b/configs/example/arm/starter_fs.py index cc5f63f..f1e1983 100644 --- a/configs/example/arm/starter_fs.py +++ b/configs/example/arm/starter_fs.py @@ -194,12 +194,9 @@ m5.checkpoint(os.path.join(cpt_dir)) print("Checkpoint done.") else: - print(exit_msg, " @ ", m5.curTick()) + print(f"{exit_msg} ({event.getCode()}) @ {m5.curTick()}") break - sys.exit(event.getCode()) - - def main(): parser = argparse.ArgumentParser(epilog=__doc__) diff --git a/configs/example/arm/starter_se.py b/configs/example/arm/starter_se.py index 33514c7..f21f399 100644 --- a/configs/example/arm/starter_se.py +++ b/configs/example/arm/starter_se.py @@ -257,8 +257,7 @@ # Print the reason for the simulation exit. Some exit codes are # requests for service (e.g., checkpoints) from the simulation # script. We'll just ignore them here and exit. - print(event.getCause(), " @ ", m5.curTick()) - sys.exit(event.getCode()) + print(f"{event.getCause()} ({event.getCode()}) @ {m5.curTick()}") if __name__ == "__m5_main__": -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69687?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I0c350b0d107f297691255361d25c566c889f9469 Gerrit-Change-Number: 69687 Gerrit-PatchSet: 1 Gerrit-Owner: Richard Cooper <richard.cooper@arm.com> Gerrit-MessageType: newchange