Zhantong Qiu has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/64991?usp=email )

Change subject: stdlib: Allow se_binary_workload to setup LoopPoints
......................................................................

stdlib: Allow se_binary_workload to setup LoopPoints

Added a set_se_looppoint_workload function to take in information for
workload and a stdlib LoopPoint object that stores all the information
the workload needed to run the LoopPoint sampling method.
Added a get_looppoint function to return the stdlib LoopPoint object.

Change-Id: I7872d594bf4c86bc5d9329319ec0be72b2b9670d
---
M src/python/gem5/components/boards/se_binary_workload.py
1 file changed, 58 insertions(+), 1 deletion(-)



diff --git a/src/python/gem5/components/boards/se_binary_workload.py b/src/python/gem5/components/boards/se_binary_workload.py
index afd7cef..2a92dcf 100644
--- a/src/python/gem5/components/boards/se_binary_workload.py
+++ b/src/python/gem5/components/boards/se_binary_workload.py
@@ -27,10 +27,11 @@
 from .abstract_board import AbstractBoard
 from ...resources.resource import AbstractResource
 from gem5.utils.simpoint import SimPoint
+from gem5.utils.looppoint import BaseLoopPoint

 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

@@ -111,3 +112,45 @@

         # Set whether to exit on work items for the se_workload
         self.exit_on_work_items = exit_on_work_items
+
+    def set_se_looppoint_workload(
+        self,
+        binary: AbstractResource,
+        arguments: List[str] = [],
+        looppoint: Union[AbstractResource, BaseLoopPoint] = None,
+    ) -> None:
+        """Set up the system to run a LoopPoint workload.
+
+        **Limitations**
+ * Dynamically linked executables are partially supported when the host
+          ISA and the simulated ISA are the same.
+
+        :param binary: The resource encapsulating the binary to be run.
+ :param simpoint: The LoopPoint object that contain all the information + gather from the LoopPoint files and a LoopPointManager that will raise
+        exit events for LoopPoints
+        :param arguments: The input arguments for the binary
+        """
+
+        if isinstance(looppoint, AbstractResource):
+            self._looppoint_object = BaseLoopPoint(looppoint)
+        else:
+            assert isinstance(looppoint, BaseLoopPoint)
+            self._looppoint_object = looppoint
+
+        self._looppoint_object.setup_processor(self.get_processor())
+
+        # Call set_se_binary_workload after SimPoint setup is complete
+        self.set_se_binary_workload(
+            binary=binary,
+            arguments=arguments,
+        )
+
+    def get_looppoint(self) -> BaseLoopPoint:
+        """
+ Returns the LoopPoint object set. If no LoopPoint object has been set
+        an exception is thrown.
+        """
+        if getattr(self, "_looppoint_object", None):
+            return self._looppoint_object
+        raise Exception("This board does not have a looppoint set.")

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/64991?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: I7872d594bf4c86bc5d9329319ec0be72b2b9670d
Gerrit-Change-Number: 64991
Gerrit-PatchSet: 1
Gerrit-Owner: Zhantong Qiu <zt...@ucdavis.edu>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to