scons: Further simplify the_gpu_isa.hh.

Turn the "namespace" function into a simple variable. Also, since the
only thing defined in the file is a macro, we can drop the compiler
guards and use that macro as its own compiler guard.

Change-Id: I1e8559fc7add61105b2990f76226714ba282581d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48967
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Gabe Black
2021-08-02 00:47:59 -07:00
parent 774f801589
commit b7aebc1220

View File

@@ -744,19 +744,15 @@ env.Command('config/the_isa.hh', [],
MakeAction(makeTheISA, Transform("CFG ISA", 0)))
def makeTheGPUISA(source, target, env):
target_gpu_isa = env['TARGET_GPU_ISA']
gpu_isa = env['TARGET_GPU_ISA']
def namespace(isa):
return isa[0].upper() + isa[1:].lower() + 'ISA'
namespace = gpu_isa[0].upper() + gpu_isa[1:].lower() + 'ISA'
code = code_formatter()
code('''\
#ifndef __CONFIG_THE_GPU_ISA_HH__
#define __CONFIG_THE_GPU_ISA_HH__
#define TheGpuISA ${{namespace(target_gpu_isa)}}
#endif // __CONFIG_THE_GPU_ISA_HH__''')
#ifndef TheGpuISA
#define TheGpuISA ${namespace}
#endif // TheGpuISA''')
code.write(str(target[0]))