From: bpotter Date: Thu, 23 Apr 2015 20:40:18 +0000 (-0700) Subject: config: enable setting SE-mode environment variables from file X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=936768c8f4b266e5cc5317def6f34306def29c56;p=gem5.git config: enable setting SE-mode environment variables from file --- diff --git a/configs/common/Options.py b/configs/common/Options.py index 45292b249..35d453d24 100644 --- a/configs/common/Options.py +++ b/configs/common/Options.py @@ -234,6 +234,8 @@ def addSEOptions(parser): parser.add_option("-o", "--options", default="", help="""The options to pass to the binary, use " " around the entire string""") + parser.add_option("-e", "--env", default="", + help="Initialize workload environment from text file.") parser.add_option("-i", "--input", default="", help="Read stdin from a file.") parser.add_option("--output", default="", diff --git a/configs/example/se.py b/configs/example/se.py index a582d2976..5357ed7a2 100644 --- a/configs/example/se.py +++ b/configs/example/se.py @@ -94,6 +94,10 @@ def get_processes(options): process.executable = wrkld process.cwd = os.getcwd() + if options.env: + with open(options.env, 'r') as f: + process.env = [line.rstrip() for line in f] + if len(pargs) > idx: process.cmd = [wrkld] + pargs[idx].split() else: