Álvaro Moreno has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/68937?usp=email )

Change subject: stdlib: Define env variables in SE workload
......................................................................

stdlib: Define env variables in SE workload

Implements a parameter in SE binary workload class
to define env variables inside each process.

Change-Id: I943a560043eff423989297cb2afa386a90df6791
---
M src/python/gem5/components/boards/se_binary_workload.py
1 file changed, 13 insertions(+), 0 deletions(-)



diff --git a/src/python/gem5/components/boards/se_binary_workload.py b/src/python/gem5/components/boards/se_binary_workload.py
index 23be81b..139f6a3 100644
--- a/src/python/gem5/components/boards/se_binary_workload.py
+++ b/src/python/gem5/components/boards/se_binary_workload.py
@@ -66,6 +66,7 @@
         stdin_file: Optional[FileResource] = None,
         stdout_file: Optional[Path] = None,
         stderr_file: Optional[Path] = None,
+        env_file: Optional[Path] = None,
         arguments: List[str] = [],
         checkpoint: Optional[Union[Path, CheckpointResource]] = None,
     ) -> None:
@@ -80,6 +81,15 @@
: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 stdout_file: The output file for the binary
+        :param stderr_file: The error output file for the binary
+        :param env_file: The environment variables defined for the binary
+                        ******** Example File *******
+                        env_var_1=1
+                        env_var_2=2
+                        ....
+                        env_var_n=n
+                        ******** End of Example *******
         :param arguments: The input arguments for the binary
         :param checkpoint: The checkpoint directory. Used to restore the
         simulation to that checkpoint.
@@ -105,6 +115,9 @@
             process.output = stdout_file.as_posix()
         if stderr_file is not None:
             process.errout = stderr_file.as_posix()
+        if env_file is not None:
+            with open(env_file.as_posix()) as f:
+                process.env = [line.rstrip() for line in f]

         for core in self.get_processor().get_cores():
             core.set_workload(process)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/68937?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: I943a560043eff423989297cb2afa386a90df6791
Gerrit-Change-Number: 68937
Gerrit-PatchSet: 1
Gerrit-Owner: Álvaro Moreno <gmalvaromor...@gmail.com>
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