Matthew Poremba has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/44785 )

Change subject: configs: Update apu_se.py argparse support
......................................................................

configs: Update apu_se.py argparse support

There was a merge error caused by new options being added to this script
while all scripts were being converted from optparse. This fixes the
error.

This also removes the mostly unused setOption / getOption as you can
directly assign a value to an argument after parsing

Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba5f0fbf5b
---
M configs/example/apu_se.py
1 file changed, 7 insertions(+), 27 deletions(-)



diff --git a/configs/example/apu_se.py b/configs/example/apu_se.py
index dd060a3..01213bd 100644
--- a/configs/example/apu_se.py
+++ b/configs/example/apu_se.py
@@ -49,26 +49,6 @@
 import hsaTopology
 from common import FileSystemConfig

-########################## Script Options ########################
-def setOption(parser, opt_str, value = 1):
-    # check to make sure the option actually exists
-    if not parser.has_option(opt_str):
- raise Exception("cannot find %s in list of possible options" % opt_str)
-
-    opt = parser.get_option(opt_str)
-    # set the value
-    exec("parser.values.%s = %s" % (opt.dest, value))
-
-def getOption(parser, opt_str):
-    # check to make sure the option actually exists
-    if not parser.has_option(opt_str):
- raise Exception("cannot find %s in list of possible options" % opt_str)
-
-    opt = parser.get_option(opt_str)
-    # get the value
-    exec("return_value = parser.values.%s" % opt.dest)
-    return return_value
-

 # Adding script options
 parser = argparse.ArgumentParser()
@@ -186,12 +166,12 @@
 parser.add_argument("--reg-alloc-policy", type=str, default="simple",
                     help="register allocation policy (simple/dynamic)")

-parser.add_option("--dgpu", action="store_true", default=False,
-                  help="Configure the system as a dGPU instead of an APU. "
- "The dGPU config has its own local memory pool and is not "
-                  "coherent with the host through hardware.  Data is "
- "transfered from host to device memory using runtime calls "
-                  "that copy data over a PCIe-like IO bus.")
+parser.add_argument("--dgpu", action="store_true", default=False,
+ help="Configure the system as a dGPU instead of an APU. " + "The dGPU config has its own local memory pool and is not "
+                    "coherent with the host through hardware.  Data is "
+ "transfered from host to device memory using runtime calls "
+                    "that copy data over a PCIe-like IO bus.")

 Ruby.define_options(parser)

@@ -201,7 +181,7 @@
 args = parser.parse_args()

 # The GPU cache coherence protocols only work with the backing store
-setOption(parser, "--access-backing-store")
+args.access_backing_store = True

 # if benchmark root is specified explicitly, that overrides the search path
 if args.benchmark_root:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44785
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: Ic8aaa0728a43936cd4c6e1ed590e01ba5f0fbf5b
Gerrit-Change-Number: 44785
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew Poremba <matthew.pore...@amd.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to