configs,stdlib: Add Workloads to Looppoint examples
Change-Id: I6a0eebb127ad8a6796c96390594868668424c9b4 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68117 Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Bobby Bruce
parent
b4b024808e
commit
3bb19be083
@@ -56,7 +56,7 @@ from gem5.components.memory.single_channel import SingleChannelDDR3_1600
|
||||
from gem5.components.processors.simple_processor import SimpleProcessor
|
||||
from gem5.components.processors.cpu_types import CPUTypes
|
||||
from gem5.isas import ISA
|
||||
from gem5.resources.resource import obtain_resource
|
||||
from gem5.resources.workload import Workload
|
||||
from pathlib import Path
|
||||
from gem5.simulate.exit_event_generators import (
|
||||
looppoint_save_checkpoint_generator,
|
||||
@@ -110,13 +110,7 @@ board = SimpleBoard(
|
||||
cache_hierarchy=cache_hierarchy,
|
||||
)
|
||||
|
||||
looppoint = obtain_resource("x86-matrix-multiply-omp-100-8-global-pinpoints")
|
||||
board.set_se_looppoint_workload(
|
||||
binary=obtain_resource("x86-matrix-multiply-omp"),
|
||||
arguments=[100, 8],
|
||||
# Pass LoopPoint module into the board
|
||||
looppoint=looppoint,
|
||||
)
|
||||
board.set_workload(Workload("x86-matrix-multiply-omp-100-8-looppoint-csv"))
|
||||
|
||||
dir = Path(args.checkpoint_path)
|
||||
dir.mkdir(exist_ok=True)
|
||||
@@ -126,7 +120,7 @@ simulator = Simulator(
|
||||
on_exit_event={
|
||||
ExitEvent.SIMPOINT_BEGIN: looppoint_save_checkpoint_generator(
|
||||
checkpoint_dir=dir,
|
||||
looppoint=looppoint,
|
||||
looppoint=board.get_looppoint(),
|
||||
# True if the relative PC count pairs should be updated during the
|
||||
# simulation. Default as True.
|
||||
update_relatives=True,
|
||||
@@ -141,4 +135,4 @@ simulator = Simulator(
|
||||
simulator.run()
|
||||
|
||||
# Output the JSON file
|
||||
looppoint.output_json_file()
|
||||
board.get_looppoint().output_json_file()
|
||||
|
||||
@@ -54,8 +54,7 @@ from gem5.components.processors.simple_processor import SimpleProcessor
|
||||
from gem5.components.processors.cpu_types import CPUTypes
|
||||
from gem5.isas import ISA
|
||||
from gem5.resources.resource import obtain_resource
|
||||
from pathlib import Path
|
||||
from gem5.utils.resource import LooppointJsonLoader
|
||||
from gem5.resources.workload import Workload
|
||||
from m5.stats import reset, dump
|
||||
|
||||
requires(isa_required=ISA.X86)
|
||||
@@ -113,24 +112,17 @@ board = SimpleBoard(
|
||||
cache_hierarchy=cache_hierarchy,
|
||||
)
|
||||
|
||||
looppoint = LooppointJsonLoader(
|
||||
looppoint_file=Path(
|
||||
obtain_resource(
|
||||
"x86-matrix-multiply-omp-100-8-looppoint"
|
||||
).get_local_path()
|
||||
),
|
||||
region_id=args.checkpoint_region,
|
||||
)
|
||||
|
||||
board.set_se_looppoint_workload(
|
||||
binary=obtain_resource("x86-matrix-multiply-omp"), looppoint=looppoint
|
||||
board.set_workload(
|
||||
Workload(
|
||||
f"x86-matrix-multiply-omp-100-8-looppoint-region-{args.checkpoint_region}"
|
||||
)
|
||||
)
|
||||
|
||||
# This generator will dump the stats and exit the simulation loop when the
|
||||
# simulation region reaches its end. In the case there is a warmup interval,
|
||||
# the simulation stats are reset after the warmup is complete.
|
||||
def reset_and_dump():
|
||||
if len(looppoint.get_targets()) > 1:
|
||||
if len(board.get_looppoint().get_targets()) > 1:
|
||||
print("Warmup region ended. Resetting stats.")
|
||||
reset()
|
||||
yield False
|
||||
@@ -141,9 +133,6 @@ def reset_and_dump():
|
||||
|
||||
simulator = Simulator(
|
||||
board=board,
|
||||
checkpoint_path=obtain_resource(
|
||||
f"x86-matrix-multiply-omp-100-8-looppoint-checkpoint-region-{args.checkpoint_region}"
|
||||
).get_local_path(),
|
||||
on_exit_event={ExitEvent.SIMPOINT_BEGIN: reset_and_dump()},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user