Tiago Mück has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/19210

Change subject: config: --maxinstsTotal option added
......................................................................

config: --maxinstsTotal option added

--maxinstsTotal stops the simulation when the total number of simulated
instructions reaches the given value. Also updated the --maxinsts help
message for clarification.

Change-Id: Ie0deeccd0f4c698a5cb718f1779042add83227fc
Signed-off-by: Tiago Mück <tiago.m...@arm.com>
---
M configs/common/Options.py
M configs/common/Simulation.py
2 files changed, 10 insertions(+), 2 deletions(-)



diff --git a/configs/common/Options.py b/configs/common/Options.py
index f6fa0d0..f44399d 100644
--- a/configs/common/Options.py
+++ b/configs/common/Options.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2013 ARM Limited
+# Copyright (c) 2013,2019 ARM Limited
 # All rights reserved.
 #
 # The license below extends only to copyright in the software and shall
@@ -268,6 +268,10 @@
     # Run duration options
     parser.add_option("-I", "--maxinsts", action="store", type="int",
                       default=None, help="""Total number of instructions to
+                                            simulate in any thread
+                                            (default: run forever)""")
+    parser.add_option("--maxinstsTotal", action="store", type="int",
+                      default=None, help="""Total number of instructions to
simulate (default: run forever)""")
     parser.add_option("--work-item-id", action="store", type="int",
                       help="the specific work id for exit & checkpointing")
diff --git a/configs/common/Simulation.py b/configs/common/Simulation.py
index 56107c1..723cba3 100644
--- a/configs/common/Simulation.py
+++ b/configs/common/Simulation.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2012-2013 ARM Limited
+# Copyright (c) 2012-2013,2019 ARM Limited
 # All rights reserved
 #
 # The license below extends only to copyright in the software and shall
@@ -614,6 +614,10 @@
     root.apply_config(options.param)
     m5.instantiate(checkpoint_dir)

+    if options.maxinstsTotal:
+        testsys.scheduleInstStop(options.maxinstsTotal,
+ "the system reached the max instruction count")
+
     # Initialization is complete.  If we're not in control of simulation
     # (that is, if we're a slave simulator acting as a component in another
     #  'master' simulator) then we're done here.  The other simulator will

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

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ie0deeccd0f4c698a5cb718f1779042add83227fc
Gerrit-Change-Number: 19210
Gerrit-PatchSet: 1
Gerrit-Owner: Tiago Mück <tiago.m...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to