From 79cfef2650465942bd0e6f27187dc4aed4649337 Mon Sep 17 00:00:00 2001 From: Alvaro Moreno Date: Wed, 15 Mar 2023 12:38:44 +0100 Subject: [PATCH] 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 Maintainer: Bobby Bruce Tested-by: kokoro --- src/python/gem5/components/boards/se_binary_workload.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/python/gem5/components/boards/se_binary_workload.py b/src/python/gem5/components/boards/se_binary_workload.py index 23be81b03d..98fe840a27 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 @@ class SEBinaryWorkload: 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 @@ class SEBinaryWorkload: :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 @@ class SEBinaryWorkload: 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)