arch-arm: Add support to exit the simloop on PMU control

PMU enables/disables/resets are often used to identify and demark
regions of interest in a workload intended for sampled
simulation (e.g. fast-forward, warm-up, detailed simulation).

This patch adds the option to exit the simulation loop when these
events occur so additional simulation control can be effected (e.g.
stats dump/reset, CPU switch, etc).

Original patch by Nicholas Lindsay <Nicholas.Lindsey@arm.com>.
Updated by Richard Cooper <richard.cooper@arm.com>.

Change-Id: I19be0def8d52fa036a3eee6bafeb63cc1f41694a
Signed-off-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70417
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Nicholas Lindsay
2018-06-07 14:48:03 +01:00
committed by Richard Cooper
parent e90bd5feb9
commit 5fc8188ab3
4 changed files with 40 additions and 5 deletions

View File

@@ -49,6 +49,9 @@ class ExitEvent(Enum):
)
SIMPOINT_BEGIN = "simpoint begins"
MAX_INSTS = "number of instructions reached"
PERF_COUNTER_ENABLE = "performance counter enabled"
PERF_COUNTER_DISABLE = "performance counter disabled"
PERF_COUNTER_RESET = "performance counter reset"
@classmethod
def translate_exit_status(cls, exit_string: str) -> "ExitEvent":
@@ -90,6 +93,12 @@ class ExitEvent(Enum):
return ExitEvent.SIMPOINT_BEGIN
elif exit_string == "a thread reached the max instruction count":
return ExitEvent.MAX_INSTS
elif exit_string == "performance counter enabled":
return ExitEvent.PERF_COUNTER_ENABLE
elif exit_string == "performance counter disabled":
return ExitEvent.PERF_COUNTER_DISABLE
elif exit_string == "performance counter reset":
return ExitEvent.PERF_COUNTER_RESET
elif exit_string.endswith("will terminate the simulation.\n"):
# This is for the traffic generator exit event
return ExitEvent.EXIT