I'd like to pass in environment variables to the application is SE mode. I've
made to following changes to support this.
--- a/configs/example/se.py Mon Mar 18 11:24:56 2013 +0100
+++ b/configs/example/se.py Mon Mar 25 09:46:20 2013 -0600
@@ -69,6 +69,7 @@
outputs = []
errouts = []
pargs = []
+ penvs = []
workloads = options.cmd.split(';')
if options.input != "":
@@ -79,6 +80,9 @@
errouts = options.errout.split(';')
if options.options != "":
pargs = options.options.split(';')
+ if options.environment != "":
+ penvs = options.environment.split(';')
+
idx = 0
for wrkld in workloads:
@@ -90,6 +94,11 @@
else:
process.cmd = [wrkld]
+ if len(penvs) > idx:
+ process.env = [wrkld] + penvs[idx].split()
+ else:
+ process.env = [wrkld]
+
--- a/configs/common/Options.py Mon Mar 18 11:24:56 2013 +0100
+++ b/configs/common/Options.py Mon Mar 25 09:46:20 2013 -0600@@ -64,6 +64,7 @@
@@ -149,6 +150,9 @@
parser.add_option("-o", "--options", default="",
help="""The options to pass to the binary, use " "
around the entire string""")
+ parser.add_option("-e", "--environment", default="",
+ help="""The environment to pass to the binary, use " "
+ around the entire string""")
parser.add_option("-i", "--input", default="",
help="Read stdin from a file.")
parser.add_option("--output", default="",
Mike
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev