Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/64551?usp=email )

 (

4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one. )Change subject: stdlib: add 'get_simpoint' function to se_binary_workload.py
......................................................................

stdlib: add 'get_simpoint' function to se_binary_workload.py

This function is necessary to obtain the workload from a board once set.
This is a stop-gap solution to get SimPoints working with SE workloads
but will need revision when implementing this functionality for FS.

Change-Id: Ided2b1a5867655a98730879524e0be61c3f20295
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/64551
Maintainer: Bobby Bruce <bbr...@ucdavis.edu>
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Melissa Jost <mkj...@ucdavis.edu>
---
M configs/example/gem5_library/checkpoints/simpoints-se-restore.py
M src/python/gem5/components/boards/se_binary_workload.py
2 files changed, 34 insertions(+), 5 deletions(-)

Approvals:
  kokoro: Regressions pass
  Bobby Bruce: Looks good to me, approved
  Melissa Jost: Looks good to me, approved




diff --git a/configs/example/gem5_library/checkpoints/simpoints-se-restore.py b/configs/example/gem5_library/checkpoints/simpoints-se-restore.py
index 82b56b5..aacddd7 100644
--- a/configs/example/gem5_library/checkpoints/simpoints-se-restore.py
+++ b/configs/example/gem5_library/checkpoints/simpoints-se-restore.py
@@ -129,7 +129,9 @@
             print("end of warmup, starting to simulate SimPoint")
             warmed_up = True
             # Schedule a MAX_INSTS exit event during the simulation
-            simulator.schedule_max_insts(simpoint.get_simpoint_interval())
+            simulator.schedule_max_insts(
+                board.get_simpoint().get_simpoint_interval()
+            )
             dump()
             reset()
             yield False
@@ -146,5 +148,5 @@
 # is greater than 0.
 # In here, it schedules an exit event for the first SimPoint's warmup
 # instructions
-simulator.schedule_max_insts(simpoint.get_warmup_list()[0], True)
+simulator.schedule_max_insts(board.get_simpoint().get_warmup_list()[0], True)
 simulator.run()
diff --git a/src/python/gem5/components/boards/se_binary_workload.py b/src/python/gem5/components/boards/se_binary_workload.py
index 545dc40..7713b11 100644
--- a/src/python/gem5/components/boards/se_binary_workload.py
+++ b/src/python/gem5/components/boards/se_binary_workload.py
@@ -123,15 +123,16 @@

         # convert input to SimPoint if necessary
         if isinstance(simpoint, AbstractResource):
-            simpoint_object = SimPoint(simpoint)
+            self._simpoint_object = SimPoint(simpoint)
         else:
             assert isinstance(simpoint, SimPoint)
-            simpoint_object = simpoint
+            self._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
+            inst_starts=self._simpoint_object.get_simpoint_start_insts(),
+            init=True,
         )

         # Call set_se_binary_workload after SimPoint setup is complete
@@ -139,3 +140,12 @@
             binary=binary,
             arguments=arguments,
         )
+
+    def get_simpoint(self) -> SimPoint:
+        """
+ Returns the SimPoint object set. If no SimPoint object has been set an
+        exception is thrown.
+        """
+        if getattr(self, "_simpoint_object", None):
+            return self._simpoint_object
+        raise Exception("This board does not have a simpoint set.")

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/64551?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: Ided2b1a5867655a98730879524e0be61c3f20295
Gerrit-Change-Number: 64551
Gerrit-PatchSet: 6
Gerrit-Owner: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Bobby Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Melissa Jost <mkj...@ucdavis.edu>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to