Bobby Bruce has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/68117?usp=email )
Change subject: configs,stdlib: Add Workloads to Looppoint examples
......................................................................
configs,stdlib: Add Workloads to Looppoint examples
Change-Id: I6a0eebb127ad8a6796c96390594868668424c9b4
---
M configs/example/gem5_library/looppoints/create-looppoint-checkpoints.py
M configs/example/gem5_library/looppoints/restore-looppoint-checkpoint.py
2 files changed, 21 insertions(+), 25 deletions(-)
diff --git
a/configs/example/gem5_library/looppoints/create-looppoint-checkpoints.py
b/configs/example/gem5_library/looppoints/create-looppoint-checkpoints.py
index 6c23d38..fcb8af0 100644
---
a/configs/example/gem5_library/looppoints/create-looppoint-checkpoints.py
+++
b/configs/example/gem5_library/looppoints/create-looppoint-checkpoints.py
@@ -56,7 +56,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 gem5.resources.workload import Workload
from pathlib import Path
from gem5.simulate.exit_event_generators import (
looppoint_save_checkpoint_generator,
@@ -110,13 +110,7 @@
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-looppoints"))
dir = Path(args.checkpoint_path)
dir.mkdir(exist_ok=True)
@@ -126,7 +120,7 @@
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.run()
# Output the JSON file
-looppoint.output_json_file()
+board.get_looppoint().output_json_file()
diff --git
a/configs/example/gem5_library/looppoints/restore-looppoint-checkpoint.py
b/configs/example/gem5_library/looppoints/restore-looppoint-checkpoint.py
index c54fdab..fc6cc1b 100644
---
a/configs/example/gem5_library/looppoints/restore-looppoint-checkpoint.py
+++
b/configs/example/gem5_library/looppoints/restore-looppoint-checkpoint.py
@@ -54,8 +54,7 @@
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 @@
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
@@ -142,7 +134,8 @@
simulator = Simulator(
board=board,
checkpoint_path=obtain_resource(
-
f"x86-matrix-multiply-omp-100-8-looppoint-checkpoint-region-{args.checkpoint_region}"
+ "x86-matrix-multiply-omp-100-8-looppoint-checkpoint-region-"
+ f"{args.checkpoint_region}"
).get_local_path(),
on_exit_event={ExitEvent.SIMPOINT_BEGIN: reset_and_dump()},
)
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/68117?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I6a0eebb127ad8a6796c96390594868668424c9b4
Gerrit-Change-Number: 68117
Gerrit-PatchSet: 1
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org