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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/68937
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
diff --git a/src/python/gem5/components/boards/se_binary_workload.py b/src/python/gem5/components/boards/se_binary_workload.py
index 23be81b..98fe840 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_list: Optional[List[str]] = None,
arguments: List[str] = [],
checkpoint: Optional[Union[Path, CheckpointResource]] = None,
) -> None:
@@ -80,6 +81,9 @@
: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_list: The environment variables defined for the binary
:param arguments: The input arguments for the binary
:param checkpoint: The checkpoint directory. Used to restore the
simulation to that checkpoint.
@@ -105,6 +109,8 @@
process.output = stdout_file.as_posix()
if stderr_file is not None:
process.errout = stderr_file.as_posix()
+ if env_list is not None:
+ process.env = env_list
for core in self.get_processor().get_cores():
core.set_workload(process)