Melissa Jost has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/64432?usp=email )
Change subject: stdlib: Added set_se_simpoint_workload to SEBinaryWorkload
......................................................................
stdlib: Added set_se_simpoint_workload to SEBinaryWorkload
Change-Id: I815d4aff655e96619a44fc6fc04b674a794056a2
---
M src/python/gem5/components/boards/se_binary_workload.py
1 file changed, 50 insertions(+), 14 deletions(-)
diff --git a/src/python/gem5/components/boards/se_binary_workload.py
b/src/python/gem5/components/boards/se_binary_workload.py
index afd7cef..47c989e 100644
--- a/src/python/gem5/components/boards/se_binary_workload.py
+++ b/src/python/gem5/components/boards/se_binary_workload.py
@@ -25,7 +25,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from .abstract_board import AbstractBoard
-from ...resources.resource import AbstractResource
+from ...resources.resource import AbstractResource, CustomResource
from gem5.utils.simpoint import SimPoint
from m5.objects import SEWorkload, Process
@@ -57,7 +57,6 @@
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 @@
* 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,45 @@
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: AbstractResource or 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 type(simpoint) is AbstractResource or CustomResource:
+ simpoint_object = SimPoint(simpoint)
+ else:
+ 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,
+ )
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/64432?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: I815d4aff655e96619a44fc6fc04b674a794056a2
Gerrit-Change-Number: 64432
Gerrit-PatchSet: 1
Gerrit-Owner: Melissa Jost <melissakj...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org