util: Move the m5 utility ABIs into a subdir.
Change-Id: Ia268fad950c8e7ad9ccfe69af72b57d33f6787b9 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27552 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -84,31 +84,31 @@ call_types = {
|
||||
}
|
||||
|
||||
for root, dirs, files in os.walk(abspath(src_dir)):
|
||||
# Each SConsopts file describes a variant of the m5 utility.
|
||||
# Each SConsopts file describes an ABI of the m5 utility.
|
||||
if 'SConsopts' in files:
|
||||
env = main.Clone()
|
||||
|
||||
env['CALL_TYPE'] = copy.deepcopy(call_types)
|
||||
|
||||
# The user may override variant settings by setting environment
|
||||
# variables of the form ${VARIANT}.${OPTION}. For instance, to set the
|
||||
# CROSS_COMPILE prefix for variant foo to bar-, the user would set an
|
||||
# The user may override ABI settings by setting environment
|
||||
# variables of the form ${ABI}.${OPTION}. For instance, to set the
|
||||
# CROSS_COMPILE prefix for abi foo to bar-, the user would set an
|
||||
# environment variable foo.CROSS_COMPILE=bar-.
|
||||
#
|
||||
# This also considers scons command line settings which may look like
|
||||
# environment variables, but are set after "scons" on the command line.
|
||||
def get_variant_opt(name, default):
|
||||
var_name = env.subst('${VARIANT}.%s' % name)
|
||||
def get_abi_opt(name, default):
|
||||
var_name = env.subst('${ABI}.%s' % name)
|
||||
env[name] = os.environ.get(
|
||||
var_name, ARGUMENTS.get(var_name, default))
|
||||
|
||||
# Process the variant's settings in the SConsopts file, storing them
|
||||
# Process the ABI's settings in the SConsopts file, storing them
|
||||
# in a copy of the primary environment.
|
||||
env.SConscript(Dir(root).File('SConsopts'),
|
||||
exports=[ 'env', 'get_variant_opt' ])
|
||||
exports=[ 'env', 'get_abi_opt' ])
|
||||
|
||||
# Once all the options have been configured, set up build targets for
|
||||
# this variant.
|
||||
variant_dir = build_dir.Dir(env.subst('${VARIANT}'))
|
||||
# this abi.
|
||||
abi_dir = build_dir.Dir(env.subst('${ABI}'))
|
||||
env.SConscript(src_dir.File('SConscript'),
|
||||
variant_dir=variant_dir, exports='env')
|
||||
variant_dir=abi_dir, exports='env')
|
||||
|
||||
@@ -42,12 +42,12 @@ lua = 'lua_gem5Op.cc'
|
||||
|
||||
all_call_types = list(env['CALL_TYPE'].values())
|
||||
call_types = list([ ct for ct in all_call_types if ct.enabled ])
|
||||
m5ops = list([ '${VARIANT}/%s' % ct.impl_file for ct in call_types ])
|
||||
m5ops = list([ 'abi/${ABI}/%s' % ct.impl_file for ct in call_types ])
|
||||
|
||||
default_call_type = list([ ct for ct in call_types if ct.default ])
|
||||
assert len(default_call_type) == 1, \
|
||||
'There should be exactly one default call type for %s, found %d' % \
|
||||
(env['VARIANT'], len(default_call_type))
|
||||
(env['ABI'], len(default_call_type))
|
||||
default_call_type = default_call_type[0]
|
||||
|
||||
static_env = env.Clone()
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
Import('*')
|
||||
|
||||
env['VARIANT'] = 'aarch64'
|
||||
get_variant_opt('CROSS_COMPILE', 'aarch64-linux-gnu-')
|
||||
env['ABI'] = 'aarch64'
|
||||
get_abi_opt('CROSS_COMPILE', 'aarch64-linux-gnu-')
|
||||
|
||||
env['CALL_TYPE']['inst'].impl('m5op.S', default=True)
|
||||
env['CALL_TYPE']['addr'].impl('m5op_addr.S')
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
Import('*')
|
||||
|
||||
env['VARIANT'] = 'arm'
|
||||
get_variant_opt('CROSS_COMPILE', 'arm-linux-gnueabihf-')
|
||||
env['ABI'] = 'arm'
|
||||
get_abi_opt('CROSS_COMPILE', 'arm-linux-gnueabihf-')
|
||||
env.Append(CXXFLAGS='-march=armv7-a')
|
||||
|
||||
env['CALL_TYPE']['inst'].impl('m5op.S', default=True)
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
Import('*')
|
||||
|
||||
env['VARIANT'] = 'sparc'
|
||||
get_variant_opt('CROSS_COMPILE', 'sparc64-linux-gnu-')
|
||||
env['ABI'] = 'sparc'
|
||||
get_abi_opt('CROSS_COMPILE', 'sparc64-linux-gnu-')
|
||||
env.Append(CXXFLAGS='-m64')
|
||||
|
||||
env['CALL_TYPE']['inst'].impl('m5op.S', default=True)
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
Import('*')
|
||||
|
||||
env['VARIANT'] = 'thumb'
|
||||
get_variant_opt('CROSS_COMPILE', 'arm-linux-gnueabihf-')
|
||||
env['ABI'] = 'thumb'
|
||||
get_abi_opt('CROSS_COMPILE', 'arm-linux-gnueabihf-')
|
||||
env.Append(CXXFLAGS=[ '-mthumb', '-march=armv7' ])
|
||||
|
||||
env['CALL_TYPE']['inst'].impl('m5op.S', default=True)
|
||||
@@ -25,8 +25,8 @@
|
||||
|
||||
Import('*')
|
||||
|
||||
env['VARIANT'] = 'x86'
|
||||
get_variant_opt('CROSS_COMPILE', '')
|
||||
env['ABI'] = 'x86'
|
||||
get_abi_opt('CROSS_COMPILE', '')
|
||||
env.Append(CXXFLAGS='-DM5OP_ADDR=0xFFFF0000')
|
||||
env.Append(CCFLAGS='-DM5OP_ADDR=0xFFFF0000')
|
||||
|
||||
Reference in New Issue
Block a user