stdlib: Added set_se_simpoint_workload to SEBinaryWorkload
Change-Id: I815d4aff655e96619a44fc6fc04b674a794056a2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64432 Reviewed-by: Melissa Jost <mkjost@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
This commit is contained in:
committed by
Bobby Bruce
parent
87e774c1d5
commit
f1be0c808a
@@ -116,7 +116,7 @@ simpoint = SimPoint(
|
||||
warmup_interval=1000000,
|
||||
)
|
||||
|
||||
board.set_se_binary_workload(
|
||||
board.set_se_simpoint_workload(
|
||||
binary=Resource("x86-print-this"),
|
||||
arguments=["print this", 15000],
|
||||
simpoint=simpoint,
|
||||
|
||||
@@ -103,8 +103,10 @@ simpoint = SimPoint(
|
||||
warmup_interval=1000000,
|
||||
)
|
||||
|
||||
board.set_se_binary_workload(
|
||||
binary=Resource("x86-print-this"), arguments=["print this", 15000]
|
||||
board.set_se_simpoint_workload(
|
||||
binary=Resource("x86-print-this"),
|
||||
arguments=["print this", 15000],
|
||||
simpoint=simpoint,
|
||||
)
|
||||
|
||||
# Here we obtain the checkpoints from gem5 resources, but these are generated
|
||||
|
||||
@@ -30,7 +30,7 @@ from gem5.utils.simpoint import SimPoint
|
||||
|
||||
from m5.objects import SEWorkload, Process
|
||||
|
||||
from typing import Optional, List
|
||||
from typing import Optional, List, Union
|
||||
from m5.util import warn
|
||||
from pathlib import Path
|
||||
|
||||
@@ -57,7 +57,6 @@ class SEBinaryWorkload:
|
||||
stdout_file: Optional[Path] = None,
|
||||
stderr_file: Optional[Path] = None,
|
||||
arguments: List[str] = [],
|
||||
simpoint: SimPoint = None,
|
||||
) -> None:
|
||||
"""Set up the system to run a specific binary.
|
||||
|
||||
@@ -66,16 +65,11 @@ class SEBinaryWorkload:
|
||||
* Dynamically linked executables are partially supported when the host
|
||||
ISA and the simulated ISA are the same.
|
||||
|
||||
**Warning:** SimPoints only works with one core
|
||||
|
||||
:param binary: The resource encapsulating the binary to be run.
|
||||
:param exit_on_work_items: Whether the simulation should exit on work
|
||||
items. True by default.
|
||||
:param stdin_file: The input file for the binary
|
||||
:param arguments: The input arguments for the binary
|
||||
:param simpoint: The SimPoint object that contains the list of
|
||||
SimPoints starting instructions, the list of weights, and the SimPoints
|
||||
interval
|
||||
"""
|
||||
|
||||
# We assume this this is in a multiple-inheritance setup with an
|
||||
@@ -102,12 +96,46 @@ class SEBinaryWorkload:
|
||||
for core in self.get_processor().get_cores():
|
||||
core.set_workload(process)
|
||||
|
||||
if simpoint is not None:
|
||||
if self.get_processor().get_num_cores() > 1:
|
||||
warn("SimPoints only works with one core")
|
||||
self.get_processor().get_cores()[0].set_simpoint(
|
||||
inst_starts=simpoint.get_simpoint_start_insts(), init=True
|
||||
)
|
||||
|
||||
# Set whether to exit on work items for the se_workload
|
||||
self.exit_on_work_items = exit_on_work_items
|
||||
|
||||
def set_se_simpoint_workload(
|
||||
self,
|
||||
binary: AbstractResource,
|
||||
arguments: List[str] = [],
|
||||
simpoint: Union[AbstractResource, SimPoint] = None,
|
||||
) -> None:
|
||||
"""Set up the system to run a SimPoint workload.
|
||||
|
||||
**Limitations**
|
||||
* Only supports single threaded applications.
|
||||
* Dynamically linked executables are partially supported when the host
|
||||
ISA and the simulated ISA are the same.
|
||||
|
||||
**Warning:** SimPoints only works with one core
|
||||
|
||||
:param binary: The resource encapsulating the binary to be run.
|
||||
:param arguments: The input arguments for the binary
|
||||
:param simpoint: The SimPoint object or Resource that contains the list of
|
||||
SimPoints starting instructions, the list of weights, and the SimPoints
|
||||
interval
|
||||
"""
|
||||
|
||||
# convert input to SimPoint if necessary
|
||||
if isinstance(simpoint, AbstractResource):
|
||||
simpoint_object = SimPoint(simpoint)
|
||||
else:
|
||||
assert isinstance(simpoint, SimPoint)
|
||||
simpoint_object = simpoint
|
||||
|
||||
if self.get_processor().get_num_cores() > 1:
|
||||
warn("SimPoints only works with one core")
|
||||
self.get_processor().get_cores()[0].set_simpoint(
|
||||
inst_starts=simpoint_object.get_simpoint_start_insts(), init=True
|
||||
)
|
||||
|
||||
# Call set_se_binary_workload after SimPoint setup is complete
|
||||
self.set_se_binary_workload(
|
||||
binary=binary,
|
||||
arguments=arguments,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user