Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/2984 )

Change subject: scons: Use the generalized switching headers on the GPU ISA.
......................................................................

scons: Use the generalized switching headers on the GPU ISA.

Now that the switching header implementation has been generalized, there's
no need to have two nearly identical implementations for the two different
groups of headers.

Change-Id: Ie7c24fcddbc672ac5ca2d69bfc35696f42c55580
Reviewed-on: https://gem5-review.googlesource.com/2984
Maintainer: Andreas Sandberg <[email protected]>
Reviewed-by: Curtis Dunham <[email protected]>
Reviewed-by: Tony Gutierrez <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
---
M SConstruct
M src/arch/SConscript
2 files changed, 4 insertions(+), 35 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, but someone else must approve
  Curtis Dunham: Looks good to me, approved
  Tony Gutierrez: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved



diff --git a/SConstruct b/SConstruct
index 1efd106..30f99c7 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1331,8 +1331,6 @@
 #
 ###################################################

-main['ALL_GPU_ISA_LIST'] = all_gpu_isa_list
-
 def build_switching_header(target, source, env):
     path = str(target[0])
     subdir = str(source[0])
@@ -1357,35 +1355,6 @@

 main.AddMethod(switching_headers, 'SwitchingHeaders')

-def make_gpu_switching_dir(dname, switch_headers, env):
-    # Generate the header.  target[0] is the full path of the output
-    # header to generate.  'source' is a dummy variable, since we get the
-    # list of ISAs from env['ALL_ISA_LIST'].
-    def gen_switch_hdr(target, source, env):
-        fname = str(target[0])
-
-        isa = env['TARGET_GPU_ISA'].lower()
-
-        try:
-            f = open(fname, 'w')
- print >>f, '#include "%s/%s/%s"' % (dname, isa, basename(fname))
-            f.close()
-        except IOError:
-            print "Failed to create %s" % fname
-            raise
-
-    # Build SCons Action object. 'varlist' specifies env vars that this
-    # action depends on; when env['ALL_ISA_LIST'] changes these actions
-    # should get re-executed.
-    switch_hdr_action = MakeAction(gen_switch_hdr,
- Transform("GENERATE"), varlist=['ALL_ISA_GPU_LIST'])
-
-    # Instantiate actions for each header
-    for hdr in switch_headers:
-        env.Command(hdr, [], switch_hdr_action)
-
-Export('make_gpu_switching_dir')
-
 # all-isas -> all-deps -> all-environs -> all_targets
 main.Alias('#all-isas', [])
 main.Alias('#all-deps', '#all-isas')
diff --git a/src/arch/SConscript b/src/arch/SConscript
index 891a5a2..ea94056 100644
--- a/src/arch/SConscript
+++ b/src/arch/SConscript
@@ -67,13 +67,13 @@
     env.subst('${TARGET_ISA}'))

 if env['BUILD_GPU']:
-    gpu_isa_switch_hdrs = Split('''
+    env.SwitchingHeaders(
+        Split('''
             gpu_decoder.hh
             gpu_isa.hh
             gpu_types.hh
-            ''')
-
-    make_gpu_switching_dir('arch', gpu_isa_switch_hdrs, env)
+            '''),
+        env.subst('${TARGET_GPU_ISA}'))

 #################################################################
 #

--
To view, visit https://gem5-review.googlesource.com/2984
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie7c24fcddbc672ac5ca2d69bfc35696f42c55580
Gerrit-Change-Number: 2984
Gerrit-PatchSet: 6
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Curtis Dunham <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Tony Gutierrez <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to