arch: Only build GPU switching headers if building the GPU.

Otherwise, SCons may discover an include which is guarded with BUILD_GPU
(like GPUCoalescer in mem/ruby/profiler/Profiler.cc), but not understand
that BUILD_GPU is not true. It will then follow the includes and find
generated headers which it will then generate, specifically X86 headers
for X86TLB and X86Pagetable param structs.

If not using x86, for instance if building the NULL isa, it may not be
possible to generate those headers because those objects are not visible
to SCons.

Change-Id: I955d0ef6ffb146eeb99bb052d29abe835cac5d9a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51829
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-10-20 05:41:20 -07:00
parent 8f33e9e34e
commit f65a704296

View File

@@ -69,15 +69,16 @@ env.SwitchingHeaders(
amdgpu_isa = ['gcn3', 'vega']
env.SwitchingHeaders(
Split('''
gpu_decoder.hh
gpu_isa.hh
gpu_registers.hh
gpu_types.hh
'''),
'{}'.format('amdgpu/' if env['TARGET_GPU_ISA'] in amdgpu_isa else '')+
env.subst('${TARGET_GPU_ISA}'))
if env['BUILD_GPU']:
env.SwitchingHeaders(
Split('''
gpu_decoder.hh
gpu_isa.hh
gpu_registers.hh
gpu_types.hh
'''),
'{}'.format('amdgpu/' if env['TARGET_GPU_ISA'] in amdgpu_isa else '')+
env.subst('${TARGET_GPU_ISA}'))
#################################################################
#