stdlib: Small fix in stdlib spec2006 script

The call to processor switch from KVM to TIMING was
removed in an earlier commit. This change fixes that.
Also, get_roi_ticks() doesn't work because spec2006
does not have work_begin and work_exit annotations.
This change uses get_tick_stopwatch() to calculate
the roi ticks.

Change-Id: I55efe28ebd686cb4e6c88a528533127fb73c88ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69357
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
HJikram
2023-03-29 14:00:58 +05:00
committed by humza jahangir ikram
parent 59ea30913f
commit f7f5b68202

View File

@@ -272,6 +272,7 @@ def handle_exit():
print("Done bootling Linux")
print("Resetting stats at the start of ROI!")
m5.stats.reset()
processor.switch()
yield False # E.g., continue the simulation.
print("Dump stats at the end of the ROI!")
m5.stats.dump()
@@ -304,7 +305,11 @@ print("All simulation events were successful.")
print("Performance statistics:")
print("Simulated time: " + ((str(simulator.get_roi_ticks()[0]))))
roi_begin_ticks = simulator.get_tick_stopwatch()[0][1]
roi_end_ticks = simulator.get_tick_stopwatch()[0][1]
print("roi simulated ticks: " + str(roi_end_ticks - roi_begin_ticks))
print(
"Ran a total of", simulator.get_current_tick() / 1e12, "simulated seconds"
)