stdlib: Implement Simpoint Resources
This patches does the following:
- Adds 'SimpointResource' which encapsulates Simpoint data and
functionality. It replaces the old 'gem5.util.simpoint.SimPoint'
class. Simpoints can be loaded from gem5-resources using the
`obtain_resource` function.
- Adds 'SimpointDirectoryResource'. This inherits form
'SimpointResource'. While 'SimpointResource' takes raw Simpoint data
via parameters, 'SimpointDirectoryResource' assumes the data exists
in files, in a directory.
- Updates the
"configs/example/gem5_library/checkpoints/simpoints-se-checkpoint.py"
and
"configs/example/gem5_library/checkpoints/simpoints-se-restory.py"
example files to utilize this new Simpoint resource classes.
**Note**: While the old "SimPoint" class
("src/python/gem5/util/simpoint.py") is marked as deprecated, it may be
difficult to utilize given updates to the APIs in the gem5 stdlib Cores
and Simulator modules.
Change-Id: I9bed5c643ffc735838c9f22a58c53547941010e7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/67339
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
committed by
Zhantong Qiu
parent
cc838d72a6
commit
e1601954f0
@@ -58,6 +58,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.workload import Workload
|
||||
from gem5.resources.resource import obtain_resource, SimpointResource
|
||||
from pathlib import Path
|
||||
from gem5.components.cachehierarchies.classic.no_cache import NoCache
|
||||
from gem5.simulate.exit_event_generators import (
|
||||
@@ -108,7 +109,23 @@ board = SimpleBoard(
|
||||
cache_hierarchy=cache_hierarchy,
|
||||
)
|
||||
|
||||
board.set_workload(Workload("x86-print-this-15000-with-simpoints"))
|
||||
# board.set_workload(
|
||||
# Workload("x86-print-this-15000-with-simpoints")
|
||||
#
|
||||
# **Note: This has been removed until we update the resources.json file to
|
||||
# encapsulate the new Simpoint format.
|
||||
# Below we set the simpount manually.
|
||||
|
||||
board.set_se_simpoint_workload(
|
||||
binary=obtain_resource("x86-print-this"),
|
||||
arguments=["print this", 15000],
|
||||
simpoint=SimpointResource(
|
||||
simpoint_interval=1000000,
|
||||
simpoint_list=[2, 3, 4, 15],
|
||||
weight_list=[0.1, 0.2, 0.4, 0.3],
|
||||
warmup_interval=1000000,
|
||||
),
|
||||
)
|
||||
|
||||
dir = Path(args.checkpoint_path)
|
||||
dir.mkdir(exist_ok=True)
|
||||
|
||||
@@ -63,8 +63,9 @@ from gem5.components.memory import DualChannelDDR4_2400
|
||||
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 Resource
|
||||
from gem5.resources.resource import SimpointResource, obtain_resource
|
||||
from gem5.resources.workload import Workload
|
||||
from gem5.resources.resource import SimpointResource
|
||||
|
||||
from pathlib import Path
|
||||
from m5.stats import reset, dump
|
||||
@@ -96,11 +97,29 @@ board = SimpleBoard(
|
||||
cache_hierarchy=cache_hierarchy,
|
||||
)
|
||||
|
||||
# Here we obtain the workloadfrom gem5 resources, the checkpoint in this
|
||||
# Here we obtain the workload from gem5 resources, the checkpoint in this
|
||||
# workload was generated from
|
||||
# `configs/example/gem5_library/checkpoints/simpoints-se-checkpoint.py`.
|
||||
board.set_workload(
|
||||
Workload("x86-print-this-15000-with-simpoints-and-checkpoint")
|
||||
# board.set_workload(
|
||||
# Workload("x86-print-this-15000-with-simpoints-and-checkpoint")
|
||||
#
|
||||
# **Note: This has been removed until we update the resources.json file to
|
||||
# encapsulate the new Simpoint format.
|
||||
# Below we set the simpount manually.
|
||||
#
|
||||
# This loads a single checkpoint as an example of using simpoints to simulate
|
||||
# the function of a single simpoint region.
|
||||
|
||||
board.set_se_simpoint_workload(
|
||||
binary=obtain_resource("x86-print-this"),
|
||||
arguments=["print this", 15000],
|
||||
simpoint=SimpointResource(
|
||||
simpoint_interval=1000000,
|
||||
simpoint_list=[2, 3, 4, 15],
|
||||
weight_list=[0.1, 0.2, 0.4, 0.3],
|
||||
warmup_interval=1000000,
|
||||
),
|
||||
checkpoint=obtain_resource("simpoints-se-checkpoints-v22-1-v2"),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user