From a23641e01fc085fa59528b2fa1c404915bc485bc Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Tue, 6 Dec 2022 10:39:18 -0800 Subject: [PATCH] configs: Fix x86-gapbs-benchmarks.py example With https://gem5-review.googlesource.com/c/public/gem5/+/64791 we updated the configs/example/gem5_library to utilize the `m5.simulate` module. The GAPBS benchmark example uses the "WORKBEGIN" and "WORKEND" exit events to specify the ROI. The patch incorrectly assumed an "EXIT" exit event were used. As such, the "test-gem5-library-example-x86-gapbs-benchmarks-ALL-x86_64-opt-MESI_Two_Level" test was not properly running, causing the Nightly test to fail: https://jenkins.gem5.org/job/nightly/444. This patch fixes this error. Change-Id: I207fe3563c8d9c59bcb79428fe62d2d2bbccd013 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/66512 Maintainer: Bobby Bruce Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- configs/example/gem5_library/x86-gapbs-benchmarks.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configs/example/gem5_library/x86-gapbs-benchmarks.py b/configs/example/gem5_library/x86-gapbs-benchmarks.py index 638d34b599..6ab37479f9 100644 --- a/configs/example/gem5_library/x86-gapbs-benchmarks.py +++ b/configs/example/gem5_library/x86-gapbs-benchmarks.py @@ -211,7 +211,7 @@ board.set_kernel_disk_workload( ) -def handle_exit(): +def handle_workbegin(): print("Done booting Linux") print("Resetting stats at the start of ROI!") m5.stats.reset() @@ -219,6 +219,9 @@ def handle_exit(): start_tick = m5.curTick() processor.switch() yield False # E.g., continue the simulation. + + +def handle_workend(): print("Dump stats at the end of the ROI!") m5.stats.dump() yield True # Stop the simulation. We're done. @@ -227,7 +230,8 @@ def handle_exit(): simulator = Simulator( board=board, on_exit_event={ - ExitEvent.EXIT: handle_exit(), + ExitEvent.WORKBEGIN: handle_workbegin(), + ExitEvent.WORKEND: handle_workend(), }, )