Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/56897 )
Change subject: scons: Use Kconfig to configure gem5.
......................................................................
scons: Use Kconfig to configure gem5.
Switch SCons/gem5 to use Kconfig for configuration, except EXTRAS which
is still a sticky SCons variable. This is necessary because EXTRAS also
controls what config options exist. If it came from Kconfig itself, then
there would be a circular dependency. This dependency could
theoretically be handled by reparsing the Kconfig when EXTRAS
directories were added or removed, but that would be complicated, and
isn't supported by kconfiglib. It wouldn't be worth the significant
effort it would take to add it, just to use Kconfig more purely.
Change-Id: I29ab1940b2d7b0e6635a490452d05befe5b4a2c9
---
M SConstruct
A site_scons/gem5_scons/kconfig.py
D src/SConsopts
D src/arch/SConsopts
D src/arch/arm/fastmodel/SConsopts
M src/base/SConsopts
M src/cpu/kvm/SConsopts
M src/cpu/testers/directedtest/SConscript
M src/cpu/testers/garnet_synthetic_traffic/SConscript
M src/cpu/testers/gpu_ruby_test/SConscript
M src/cpu/testers/rubytest/SConscript
D src/gpu-compute/SConsopts
M src/mem/ruby/SConscript
M src/mem/ruby/SConsopts
M src/mem/ruby/common/SConscript
M src/mem/ruby/network/SConscript
M src/mem/ruby/network/fault_model/SConscript
M src/mem/ruby/network/garnet/SConscript
M src/mem/ruby/network/simple/SConscript
M src/mem/ruby/profiler/SConscript
M src/mem/ruby/protocol/SConscript
M src/mem/ruby/protocol/SConsopts
M src/mem/ruby/slicc_interface/SConscript
M src/mem/ruby/structures/SConscript
M src/mem/ruby/system/SConscript
M src/systemc/SConsopts
26 files changed, 154 insertions(+), 292 deletions(-)
diff --git a/SConstruct b/SConstruct
index 1c69eb9..b272bec 100755
--- a/SConstruct
+++ b/SConstruct
@@ -77,6 +77,7 @@
# Global Python imports
import atexit
+import itertools
import os
import sys
@@ -104,8 +105,6 @@
help="Don't add color to abbreviated scons output")
AddOption('--with-cxx-config', action='store_true',
help="Build with support for C++-based configuration")
-AddOption('--default',
- help='Override which build_opts file to use for defaults')
AddOption('--ignore-style', action='store_true',
help='Disable style checking hooks')
AddOption('--linker', action='store', default=None, choices=linker_options,
@@ -145,6 +144,7 @@
import gem5_scons
from gem5_scons.builders import ConfigFile, AddLocalRPATH, SwitchingHeaders
from gem5_scons.builders import Blob
+from gem5_scons.kconfig import defconfig, update_from_kconfig
from gem5_scons.sources import TagImpliesTool
from gem5_scons.util import compareVersions, readCommand
@@ -191,13 +191,6 @@
#
########################################################################
-# helper function: find last occurrence of element in list
-def rfind(l, elt, offs = -1):
- for i in range(len(l)+offs, 0, -1):
- if l[i] == elt:
- return i
- raise ValueError("element not found")
-
# Take a list of paths (or SCons Nodes) and return a list with all
# paths made absolute and ~-expanded. Paths will be interpreted
# relative to the launch directory unless a different root is provided
@@ -341,6 +334,10 @@
env['GEM5BUILD'] = gem5_build
Execute(Mkdir(gem5_build))
+ config_file = Dir(gem5_build).File('config')
+ kconfig_file = Dir(gem5_build).File('Kconfig')
+ gem5_kconfig_file = Dir('#src').File('Kconfig')
+
env.SConsignFile(os.path.join(gem5_build, 'sconsign'))
# Set up default C++ compiler flags
@@ -557,59 +554,13 @@
after_sconsopts_callbacks.append(cb)
Export('AfterSConsopts')
- # Sticky variables get saved in the variables file so they persist from
- # one invocation to the next (unless overridden, in which case the new
- # value becomes sticky).
- sticky_vars = Variables(args=ARGUMENTS)
- Export('sticky_vars')
+ extras_file = os.path.join(gem5_build, 'extras')
+ extras_var = Variables(extras_file, args=ARGUMENTS)
- # EXTRAS is special since it affects what SConsopts need to be read.
- sticky_vars.Add(('EXTRAS', 'Add extra directories to the
compilation', ''))
-
- # Set env variables according to the build directory config.
- sticky_vars.files = []
- # Variables for $BUILD_ROOT/$VARIANT_DIR are stored in
- # $BUILD_ROOT/$VARIANT_DIR/gem5.build/variables
-
- gem5_build_vars = os.path.join(gem5_build, 'variables')
- build_root_vars = os.path.join(build_root, 'variables', variant_dir)
- current_vars_files = [gem5_build_vars, build_root_vars]
- existing_vars_files = list(filter(isfile, current_vars_files))
- if existing_vars_files:
- sticky_vars.files.extend(existing_vars_files)
- if not GetOption('silent'):
- print('Using saved variables file(s) %s' %
- ', '.join(existing_vars_files))
- else:
- # Variant specific variables file doesn't exist.
-
- # Get default build variables from source tree. Variables are
- # normally determined by name of $VARIANT_DIR, but can be
- # overridden by '--default=' arg on command line.
- default = GetOption('default')
- opts_dir = Dir('#build_opts').abspath
- if default:
- default_vars_files = [
- gem5_build_vars,
- build_root_vars,
- os.path.join(opts_dir, default)
- ]
- else:
- default_vars_files = [os.path.join(opts_dir, variant_dir)]
- existing_default_files = list(filter(isfile, default_vars_files))
- if existing_default_files:
- default_vars_file = existing_default_files[0]
- sticky_vars.files.append(default_vars_file)
- print("Variables file(s) %s not found,\n using defaults
in %s" %
- (' or '.join(current_vars_files), default_vars_file))
- else:
- error("Cannot find variables file(s) %s or default
file(s) %s" %
- (' or '.join(current_vars_file),
- ' or '.join(default_vars_files)))
- Exit(1)
+ extras_var.Add(('EXTRAS', 'Add extra directories to the
compilation', ''))
# Apply current settings for EXTRAS to env.
- sticky_vars.Update(env)
+ extras_var.Update(env)
# Parse EXTRAS variable to build list of all directories where we're
# look for sources etc. This list is exported as extras_dir_list.
@@ -620,6 +571,17 @@
Export('extras_dir_list')
+ # Generate a Kconfig that will source the main gem5 one, and any in any
+ # EXTRAS directories.
+ kconfig_base_py = Dir('#build_tools').File('kconfig_base.py')
+ kconfig_base_cmd_parts =
[f'"{kconfig_base_py}" "{kconfig_file.abspath}"',
+ f'"{gem5_kconfig_file.abspath}"']
+ for ed in extras_dir_list:
+ kconfig_base_cmd_parts.append(f'"{ed}"')
+ kconfig_base_cmd = ' '.join(kconfig_base_cmd_parts)
+ if env.Execute(kconfig_base_cmd) != 0:
+ error("Failed to build base Kconfig file")
+
# Variables which were determined with Configure.
env['CONF'] = {}
@@ -641,24 +603,15 @@
for cb in after_sconsopts_callbacks:
cb()
- # Update env for new variables added by the SConsopts.
- sticky_vars.Update(env)
+ # If no config exists yet, see if we know how to make one?
+ if not isfile(config_file.abspath):
+ defconfig_file = Dir('#defconfig').File(variant_dir)
+ if not isfile(defconfig_file.abspath):
+ error('No config found, and no implicit config recognized')
+ defconfig(env, kconfig_file.abspath, defconfig_file.abspath,
+ config_file.abspath)
- Help('''
-Build variables for {dir}:
-{help}
-'''.format(dir=variant_dir, help=sticky_vars.GenerateHelpText(env)),
- append=True)
-
- # If the old vars file exists, delete it to avoid confusion/stale
values.
- if isfile(build_root_vars):
- warning(f'Deleting old variant variables file "{build_root_vars}"')
- remove(build_root_vars)
- # Save sticky variables back to the gem5.build variant variables file.
- sticky_vars.Save(gem5_build_vars, env)
-
- # Pull all the sticky variables into the CONF dict.
- env['CONF'].update({key: env[key] for key in sticky_vars.keys()})
+ update_from_kconfig(env, kconfig_file.abspath, config_file.abspath)
# Do this after we save setting back, or else we'll tack on an
# extra 'qdo' every time we run scons.
diff --git a/site_scons/gem5_scons/kconfig.py
b/site_scons/gem5_scons/kconfig.py
new file mode 100644
index 0000000..6026481
--- /dev/null
+++ b/site_scons/gem5_scons/kconfig.py
@@ -0,0 +1,90 @@
+# Copyright 2022 Google, Inc.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+from . import error
+import kconfiglib
+
+def _prep_env(env, base_kconfig, config_path=None):
+ kconfig_env = env.Clone()
+ for key, val in kconfig_env['CONF'].items():
+ if isinstance(val, bool):
+ val = 'y' if val else 'n'
+ kconfig_env['ENV'][key] = val
+ kconfig_env['ENV']['CONFIG_'] = ''
+ if config_path:
+ kconfig_env['ENV']['KCONFIG_CONFIG'] = config_path
+
+ ext = env.Dir('#ext')
+ kconfiglib_dir = ext.Dir('Kconfiglib')
+ defconfig_py = kconfiglib_dir.File('defconfig.py')
+ menuconfig_py = kconfiglib_dir.File('menuconfig.py')
+
+ kconfig_env['DEFCONFIG_PY'] = defconfig_py
+ kconfig_env['MENUCONFIG_PY'] = menuconfig_py
+ kconfig_env['BASE_KCONFIG'] = base_kconfig
+ return kconfig_env
+
+def defconfig(env, base_kconfig, config_in, config_out):
+ kconfig_env = _prep_env(env, base_kconfig, config_out)
+ kconfig_env['CONFIG_IN'] = config_in
+ if kconfig_env.Execute('"${DEFCONFIG_PY}" --kconfig "${BASE_KCONFIG}" '
+ '"${CONFIG_IN}"') != 0:
+ error("Failed to run defconfig")
+
+def update_from_kconfig(env, base_kconfig, config_path):
+ kconfig_env = _prep_env(env, base_kconfig, config_path)
+
+ saved_env = os.environ
+ os.environ.update({key: str(val) for key, val in
+ kconfig_env['ENV'].items()})
+ kconfig = kconfiglib.Kconfig(filename=base_kconfig)
+ os.environ = saved_env
+
+ kconfig.load_config(config_path)
+ for sym in kconfig.unique_defined_syms:
+ val = sym.str_value
+ if sym.type == kconfiglib.BOOL:
+ env['CONF'][sym.name] = True if val == 'y' else False
+ elif sym.type == kconfiglib.TRISTATE:
+ warning('No way to configure modules for now')
+ env['CONF'][sym.name] = True if val == 'y' else False
+ elif sym.type == kconfiglib.INT:
+ if not val:
+ val = '0'
+ env['CONF'][sym.name] = int(val, 0)
+ elif sym.type == kconfiglib.HEX:
+ if not val:
+ val = '0'
+ env['CONF'][sym.name] = int(val, 16)
+ elif sym.type == kconfiglib.STRING:
+ env['CONF'][sym.name] = val
+ elif sym.type == kconfiglib.UNKNOWN:
+ warning(f'Config symbol "{sym.name}" has unknown type')
+ env['CONF'][sym.name] = val
+ else:
+ type_name = kconfiglib.TYPE_TO_STR[sym.type]
+ error(f'Unrecognized symbol type {type_name}')
diff --git a/src/SConsopts b/src/SConsopts
deleted file mode 100644
index bb2de86..0000000
--- a/src/SConsopts
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (c) 2013, 2015-2020 ARM Limited
-# All rights reserved.
-#
-# The license below extends only to copyright in the software and shall
-# not be construed as granting a license to any other intellectual
-# property including but not limited to intellectual property relating
-# to a hardware implementation of the functionality of the software
-# licensed hereunder. You may use the software subject to the license
-# terms below provided that you ensure that this notice is replicated
-# unmodified and in its entirety in all distributions of the software,
-# modified or unmodified, in source code or in binary form.
-#
-# Copyright (c) 2011 Advanced Micro Devices, Inc.
-# Copyright (c) 2009 The Hewlett-Packard Development Company
-# Copyright (c) 2004-2005 The Regents of The University of Michigan
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import os.path
-
-from gem5_scons import warning
-
-Import('*')
-
-sticky_vars.AddVariables(
- ('BATCH', 'Use batch pool for build and tests', False),
- ('BATCH_CMD', 'Batch pool submission command name', 'qdo'),
- ('M5_BUILD_CACHE', 'Cache built objects in this directory', False),
- ('USE_EFENCE', 'Link with Electric Fence malloc debugger', False),
- )
diff --git a/src/arch/SConsopts b/src/arch/SConsopts
deleted file mode 100644
index 048814e..0000000
--- a/src/arch/SConsopts
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2020 Google, Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Import('*')
-
-def add_isa_lists():
- sticky_vars.AddVariables(
- EnumVariable('TARGET_ISA', 'Target ISA', 'null',
- sorted(set(main.Split('${ALL_ISAS}')))),
- EnumVariable('TARGET_GPU_ISA', 'Target GPU ISA', 'gcn3',
- sorted(set(main.Split('${ALL_GPU_ISAS}')))),
- )
-AfterSConsopts(add_isa_lists)
diff --git a/src/arch/arm/fastmodel/SConsopts
b/src/arch/arm/fastmodel/SConsopts
deleted file mode 100644
index c7bfd84..0000000
--- a/src/arch/arm/fastmodel/SConsopts
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2019 Google, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Import('*')
-
-import os
-
-default_simgen = os.path.join('${MAXCORE_HOME}', 'bin', 'simgen')
-
-sticky_vars.AddVariables(
- BoolVariable('USE_ARM_FASTMODEL',
- 'Build support for integrating ARM Fast Models', False),
- ('PVLIB_HOME', 'Fast Model portfolio directory',
- os.environ.get('PVLIB_HOME', '')),
- ('PVLIB_FLAVOR', 'What build flavor of the Fast Model pvlib to use',
- 'Linux64_GCC-6.4'),
- ('MAXCORE_HOME', 'Fast Model tools directory',
- os.environ.get('MAXCORE_HOME', '')),
- ('ARMLMD_LICENSE_FILE', 'ARM license file location',
- os.environ.get('ARMLMD_LICENSE_FILE', '')),
- ('ARMLMD_LICENSE_COUNT',
- 'The maximum number of ARM licenses to use concurrently', 1),
- ('SIMGEN', 'simgen executable', os.environ.get('SIMGEN',
default_simgen)),
-)
diff --git a/src/base/SConsopts b/src/base/SConsopts
index 8e06612..6c17d22 100644
--- a/src/base/SConsopts
+++ b/src/base/SConsopts
@@ -79,6 +79,3 @@
warning("Deprecated namespaces are not supported by this
compiler.\n"
"Please make sure to check the mailing list for
deprecation "
"announcements.")
-
-sticky_vars.Add(BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks',
- '${CONF["HAVE_POSIX_CLOCK"]}'))
diff --git a/src/cpu/kvm/SConsopts b/src/cpu/kvm/SConsopts
index dfb9f5b..bb31d20 100644
--- a/src/cpu/kvm/SConsopts
+++ b/src/cpu/kvm/SConsopts
@@ -69,9 +69,5 @@
warning("perf_event headers lack support for the exclude_host "
"attribute. KVM instruction counts will be
inaccurate.")
-if main['CONF']['KVM_ISA']:
- sticky_vars.Add(BoolVariable('USE_KVM',
- 'Enable hardware virtualized (KVM) CPU models', True))
-else:
- main['CONF']['USE_KVM'] = False
+if not main['CONF']['KVM_ISA']:
warning("Can not enable KVM, host seems to lack KVM support")
diff --git a/src/cpu/testers/directedtest/SConscript
b/src/cpu/testers/directedtest/SConscript
index 6787648..e4e9f10 100644
--- a/src/cpu/testers/directedtest/SConscript
+++ b/src/cpu/testers/directedtest/SConscript
@@ -35,7 +35,7 @@
# When this dependency is removed, the ruby tester should be compiled
# independently from Ruby
#
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('RubyDirectedTester.py', sim_objects=[
diff --git a/src/cpu/testers/garnet_synthetic_traffic/SConscript
b/src/cpu/testers/garnet_synthetic_traffic/SConscript
index 14f4abd..e2eb4cf 100644
--- a/src/cpu/testers/garnet_synthetic_traffic/SConscript
+++ b/src/cpu/testers/garnet_synthetic_traffic/SConscript
@@ -28,7 +28,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('GarnetSyntheticTraffic.py',
sim_objects=['GarnetSyntheticTraffic'])
diff --git a/src/cpu/testers/gpu_ruby_test/SConscript
b/src/cpu/testers/gpu_ruby_test/SConscript
index 0231649..b56be94 100644
--- a/src/cpu/testers/gpu_ruby_test/SConscript
+++ b/src/cpu/testers/gpu_ruby_test/SConscript
@@ -34,7 +34,7 @@
if not env['CONF']['BUILD_GPU']:
Return()
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('ProtocolTester.py', sim_objects=['ProtocolTester'])
diff --git a/src/cpu/testers/rubytest/SConscript
b/src/cpu/testers/rubytest/SConscript
index cc76d2b..a4eac87 100644
--- a/src/cpu/testers/rubytest/SConscript
+++ b/src/cpu/testers/rubytest/SConscript
@@ -35,7 +35,7 @@
# When this dependency is removed, the ruby tester should be compiled
# independently from Ruby
#
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('RubyTester.py', sim_objects=['RubyTester'])
diff --git a/src/gpu-compute/SConsopts b/src/gpu-compute/SConsopts
deleted file mode 100644
index 251ac5d..0000000
--- a/src/gpu-compute/SConsopts
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2020 Google, Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met: redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer;
-# redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution;
-# neither the name of the copyright holders nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Import('*')
-
-sticky_vars.Add(BoolVariable('BUILD_GPU', 'Build the compute-GPU model',
- False))
diff --git a/src/mem/ruby/SConscript b/src/mem/ruby/SConscript
index b8f5584..d883c76 100644
--- a/src/mem/ruby/SConscript
+++ b/src/mem/ruby/SConscript
@@ -37,7 +37,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
DebugFlag('ProtocolTrace')
diff --git a/src/mem/ruby/SConsopts b/src/mem/ruby/SConsopts
index f26b6d0..7c4a1a9 100644
--- a/src/mem/ruby/SConsopts
+++ b/src/mem/ruby/SConsopts
@@ -25,12 +25,4 @@
Import('*')
-main.SetDefault(ALL_PROTOCOLS=[], PROTOCOL_DIRS=[], SLICC_INCLUDES=[])
-
-def add_protocols_var():
- sticky_vars.Add(EnumVariable('PROTOCOL', 'Coherence protocol for Ruby',
- 'None', main['ALL_PROTOCOLS']))
-AfterSConsopts(add_protocols_var)
-
-sticky_vars.Add(('NUMBER_BITS_PER_SET', 'Max elements in set (default 64)',
- 64))
+main.SetDefault(PROTOCOL_DIRS=[], SLICC_INCLUDES=[])
diff --git a/src/mem/ruby/common/SConscript b/src/mem/ruby/common/SConscript
index 9f683cb..9c1fc79 100644
--- a/src/mem/ruby/common/SConscript
+++ b/src/mem/ruby/common/SConscript
@@ -28,7 +28,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
env.Append(CPPDEFINES={'NUMBER_BITS_PER_SET':
diff --git a/src/mem/ruby/network/SConscript
b/src/mem/ruby/network/SConscript
index b5a4e79..e9a7974 100644
--- a/src/mem/ruby/network/SConscript
+++ b/src/mem/ruby/network/SConscript
@@ -28,7 +28,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('BasicLink.py', sim_objects=[
diff --git a/src/mem/ruby/network/fault_model/SConscript
b/src/mem/ruby/network/fault_model/SConscript
index 701b59a..44c68bb 100644
--- a/src/mem/ruby/network/fault_model/SConscript
+++ b/src/mem/ruby/network/fault_model/SConscript
@@ -33,7 +33,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('FaultModel.py', sim_objects=['FaultModel'])
diff --git a/src/mem/ruby/network/garnet/SConscript
b/src/mem/ruby/network/garnet/SConscript
index 9e6e19e..b0dcfe6 100644
--- a/src/mem/ruby/network/garnet/SConscript
+++ b/src/mem/ruby/network/garnet/SConscript
@@ -28,7 +28,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('GarnetLink.py', enums=['CDCType'], sim_objects=[
diff --git a/src/mem/ruby/network/simple/SConscript
b/src/mem/ruby/network/simple/SConscript
index 97055f5..011552a 100644
--- a/src/mem/ruby/network/simple/SConscript
+++ b/src/mem/ruby/network/simple/SConscript
@@ -40,7 +40,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('SimpleLink.py', sim_objects=['SimpleExtLink', 'SimpleIntLink'])
diff --git a/src/mem/ruby/profiler/SConscript
b/src/mem/ruby/profiler/SConscript
index 0c493e9..ff9cc09 100644
--- a/src/mem/ruby/profiler/SConscript
+++ b/src/mem/ruby/profiler/SConscript
@@ -28,7 +28,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
Source('AccessTraceForAddress.cc')
diff --git a/src/mem/ruby/protocol/SConscript
b/src/mem/ruby/protocol/SConscript
index 238ce2f..6dd3868 100644
--- a/src/mem/ruby/protocol/SConscript
+++ b/src/mem/ruby/protocol/SConscript
@@ -36,7 +36,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
output_dir = Dir('.')
diff --git a/src/mem/ruby/protocol/SConsopts
b/src/mem/ruby/protocol/SConsopts
index 2fcc57a..bcbc83b 100644
--- a/src/mem/ruby/protocol/SConsopts
+++ b/src/mem/ruby/protocol/SConsopts
@@ -30,23 +30,6 @@
Import('*')
-main.Append(ALL_PROTOCOLS=[
- 'GPU_VIPER',
- 'MOESI_AMD_Base',
- 'MESI_Two_Level',
- 'MESI_Three_Level',
- 'MESI_Three_Level_HTM',
- 'MI_example',
- 'MOESI_CMP_directory',
- 'MOESI_CMP_token',
- 'MOESI_hammer',
- 'Garnet_standalone',
- 'None'
- ])
-
-opt = BoolVariable('SLICC_HTML', 'Create HTML files', False)
-sticky_vars.Add(opt)
-
main.Append(PROTOCOL_DIRS=[Dir('.')])
protocol_base = Dir('.')
diff --git a/src/mem/ruby/slicc_interface/SConscript
b/src/mem/ruby/slicc_interface/SConscript
index 47dd49d..7fb84b3 100644
--- a/src/mem/ruby/slicc_interface/SConscript
+++ b/src/mem/ruby/slicc_interface/SConscript
@@ -28,7 +28,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('Controller.py', sim_objects=['RubyController'])
diff --git a/src/mem/ruby/structures/SConscript
b/src/mem/ruby/structures/SConscript
index 0e99b3e..63bf32f 100644
--- a/src/mem/ruby/structures/SConscript
+++ b/src/mem/ruby/structures/SConscript
@@ -28,7 +28,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
SimObject('RubyCache.py', sim_objects=['RubyCache'])
diff --git a/src/mem/ruby/system/SConscript b/src/mem/ruby/system/SConscript
index c0b85bb..43187c5 100644
--- a/src/mem/ruby/system/SConscript
+++ b/src/mem/ruby/system/SConscript
@@ -40,7 +40,7 @@
Import('*')
-if env['CONF']['PROTOCOL'] == 'None':
+if not env['CONF']['RUBY']:
Return()
env.Append(CPPDEFINES=['PROTOCOL_' + env['CONF']['PROTOCOL']])
diff --git a/src/systemc/SConsopts b/src/systemc/SConsopts
index e870288..20436ec 100644
--- a/src/systemc/SConsopts
+++ b/src/systemc/SConsopts
@@ -45,6 +45,3 @@
main.AddMethod(use_systemc_check, 'UseSystemcCheck')
main['CONF']['USE_SYSTEMC'] = main.UseSystemcCheck()
-
-sticky_vars.Add(BoolVariable('USE_SYSTEMC', 'Enable SystemC API support',
- main.UseSystemcCheck()))
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/56897
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: I29ab1940b2d7b0e6635a490452d05befe5b4a2c9
Gerrit-Change-Number: 56897
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.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