scons: Put all config variables in an env['CONF'] sub-dict.

This makes what are configuration and what are internal SCons variables
explicit and separate, and makes it unnecessary to call out what
variables to export to C++.

These variables will also be plumbed into and out of kconfiglib in later
changes.

Change-Id: Iaf5e098d7404af06285c421dbdf8ef4171b3f001
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56892
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2022-02-15 22:23:43 -08:00
parent caa5f12e21
commit e6c0ba97db
87 changed files with 211 additions and 233 deletions

View File

@@ -97,7 +97,7 @@ Source('port_terminator.cc')
GTest('translation_gen.test', 'translation_gen.test.cc')
if env['TARGET_ISA'] != 'null':
if env['CONF']['TARGET_ISA'] != 'null':
Source('translating_port_proxy.cc')
Source('se_translating_port_proxy.cc')
Source('page_table.cc')

View File

@@ -47,6 +47,5 @@ SimObject('MemFootprintProbe.py', sim_objects=['MemFootprintProbe'])
Source('mem_footprint.cc')
# Packet tracing requires protobuf support
if env['HAVE_PROTOBUF']:
SimObject('MemTraceProbe.py', sim_objects=['MemTraceProbe'])
Source('mem_trace.cc')
SimObject('MemTraceProbe.py', sim_objects=['MemTraceProbe'], tags='protobuf')
Source('mem_trace.cc', tags='protobuf')

View File

@@ -37,7 +37,7 @@ from gem5_scons import Transform
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
DebugFlag('ProtocolTrace')

View File

@@ -28,10 +28,11 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
env.Append(CPPDEFINES={'NUMBER_BITS_PER_SET': env['NUMBER_BITS_PER_SET']})
env.Append(CPPDEFINES={'NUMBER_BITS_PER_SET':
env['CONF']['NUMBER_BITS_PER_SET']})
Source('Address.cc')
Source('BoolVec.cc')

View File

@@ -28,7 +28,7 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
SimObject('BasicLink.py', sim_objects=[

View File

@@ -33,7 +33,7 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
SimObject('FaultModel.py', sim_objects=['FaultModel'])

View File

@@ -28,7 +28,7 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
SimObject('GarnetLink.py', enums=['CDCType'], sim_objects=[

View File

@@ -40,7 +40,7 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
SimObject('SimpleLink.py', sim_objects=['SimpleExtLink', 'SimpleIntLink'])

View File

@@ -28,7 +28,7 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
Source('AccessTraceForAddress.cc')

View File

@@ -36,7 +36,7 @@ from gem5_scons import Transform
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
output_dir = Dir('.')
@@ -69,7 +69,7 @@ def slicc_emitter(target, source, env):
slicc = SLICC(filepath, protocol_base.abspath, verbose=False)
slicc.process()
slicc.writeCodeFiles(output_dir.abspath, slicc_includes)
if env['SLICC_HTML']:
if env['CONF']['SLICC_HTML']:
slicc.writeHTMLFiles(html_dir.abspath)
target.extend([output_dir.File(f) for f in sorted(slicc.files())])
@@ -82,13 +82,13 @@ def slicc_action(target, source, env):
slicc = SLICC(filepath, protocol_base.abspath, verbose=True)
slicc.process()
slicc.writeCodeFiles(output_dir.abspath, slicc_includes)
if env['SLICC_HTML']:
if env['CONF']['SLICC_HTML']:
slicc.writeHTMLFiles(html_dir.abspath)
slicc_builder = Builder(action=MakeAction(slicc_action, Transform("SLICC")),
emitter=slicc_emitter)
protocol = env['PROTOCOL']
protocol = env['CONF']['PROTOCOL']
protocol_dir = None
for path in env['PROTOCOL_DIRS']:
if os.path.exists(path.File("%s.slicc" % protocol).abspath):

View File

@@ -28,7 +28,7 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
SimObject('Controller.py', sim_objects=['RubyController'])

View File

@@ -28,7 +28,7 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
SimObject('RubyCache.py', sim_objects=['RubyCache'])

View File

@@ -40,31 +40,31 @@
Import('*')
if env['PROTOCOL'] == 'None':
if env['CONF']['PROTOCOL'] == 'None':
Return()
env.Append(CPPDEFINES=['PROTOCOL_' + env['PROTOCOL']])
env.Append(CPPDEFINES=['PROTOCOL_' + env['CONF']['PROTOCOL']])
if env['PROTOCOL'] in env['NEED_PARTIAL_FUNC_READS']:
if env['CONF']['PROTOCOL'] in env['NEED_PARTIAL_FUNC_READS']:
env.Append(CPPDEFINES=['PARTIAL_FUNC_READS'])
if env['BUILD_GPU']:
if env['CONF']['BUILD_GPU']:
SimObject('GPUCoalescer.py', sim_objects=['RubyGPUCoalescer'])
SimObject('RubySystem.py', sim_objects=['RubySystem'])
SimObject('Sequencer.py', sim_objects=[
'RubyPort', 'RubyPortProxy', 'RubySequencer', 'RubyHTMSequencer',
'DMASequencer'])
if env['BUILD_GPU']:
if env['CONF']['BUILD_GPU']:
SimObject('VIPERCoalescer.py', sim_objects=['VIPERCoalescer'])
Source('CacheRecorder.cc')
Source('DMASequencer.cc')
if env['BUILD_GPU']:
if env['CONF']['BUILD_GPU']:
Source('GPUCoalescer.cc')
Source('HTMSequencer.cc')
Source('RubyPort.cc')
Source('RubyPortProxy.cc')
Source('RubySystem.cc')
Source('Sequencer.cc')
if env['BUILD_GPU']:
if env['CONF']['BUILD_GPU']:
Source('VIPERCoalescer.cc')