From a216bc70b58f9e668123a292f9f995b7ce755848 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sat, 4 Apr 2020 06:54:22 -0700 Subject: [PATCH] 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 Maintainer: Giacomo Travaglini Tested-by: kokoro --- util/m5/SConstruct | 22 +++++++++++----------- util/m5/src/SConscript | 4 ++-- util/m5/src/{ => abi}/aarch64/SConsopts | 4 ++-- util/m5/src/{ => abi}/aarch64/m5op.S | 0 util/m5/src/{ => abi}/aarch64/m5op_addr.S | 0 util/m5/src/{ => abi}/aarch64/m5op_semi.S | 0 util/m5/src/{ => abi}/arm/SConsopts | 4 ++-- util/m5/src/{ => abi}/arm/m5op.S | 0 util/m5/src/{ => abi}/sparc/SConsopts | 4 ++-- util/m5/src/{ => abi}/sparc/m5op.S | 0 util/m5/src/{ => abi}/thumb/SConsopts | 4 ++-- util/m5/src/{ => abi}/thumb/m5op.S | 0 util/m5/src/{ => abi}/x86/SConsopts | 4 ++-- util/m5/src/{ => abi}/x86/m5op.S | 0 util/m5/src/{ => abi}/x86/m5op_addr.S | 0 15 files changed, 23 insertions(+), 23 deletions(-) rename util/m5/src/{ => abi}/aarch64/SConsopts (95%) rename util/m5/src/{ => abi}/aarch64/m5op.S (100%) rename util/m5/src/{ => abi}/aarch64/m5op_addr.S (100%) rename util/m5/src/{ => abi}/aarch64/m5op_semi.S (100%) rename util/m5/src/{ => abi}/arm/SConsopts (95%) rename util/m5/src/{ => abi}/arm/m5op.S (100%) rename util/m5/src/{ => abi}/sparc/SConsopts (95%) rename util/m5/src/{ => abi}/sparc/m5op.S (100%) rename util/m5/src/{ => abi}/thumb/SConsopts (95%) rename util/m5/src/{ => abi}/thumb/m5op.S (100%) rename util/m5/src/{ => abi}/x86/SConsopts (96%) rename util/m5/src/{ => abi}/x86/m5op.S (100%) rename util/m5/src/{ => abi}/x86/m5op_addr.S (100%) diff --git a/util/m5/SConstruct b/util/m5/SConstruct index 8ff6aeabf..e539d8d98 100644 --- a/util/m5/SConstruct +++ b/util/m5/SConstruct @@ -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') diff --git a/util/m5/src/SConscript b/util/m5/src/SConscript index ee725fd99..0082ebcb8 100644 --- a/util/m5/src/SConscript +++ b/util/m5/src/SConscript @@ -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() diff --git a/util/m5/src/aarch64/SConsopts b/util/m5/src/abi/aarch64/SConsopts similarity index 95% rename from util/m5/src/aarch64/SConsopts rename to util/m5/src/abi/aarch64/SConsopts index 6032aea48..938a866ec 100644 --- a/util/m5/src/aarch64/SConsopts +++ b/util/m5/src/abi/aarch64/SConsopts @@ -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') diff --git a/util/m5/src/aarch64/m5op.S b/util/m5/src/abi/aarch64/m5op.S similarity index 100% rename from util/m5/src/aarch64/m5op.S rename to util/m5/src/abi/aarch64/m5op.S diff --git a/util/m5/src/aarch64/m5op_addr.S b/util/m5/src/abi/aarch64/m5op_addr.S similarity index 100% rename from util/m5/src/aarch64/m5op_addr.S rename to util/m5/src/abi/aarch64/m5op_addr.S diff --git a/util/m5/src/aarch64/m5op_semi.S b/util/m5/src/abi/aarch64/m5op_semi.S similarity index 100% rename from util/m5/src/aarch64/m5op_semi.S rename to util/m5/src/abi/aarch64/m5op_semi.S diff --git a/util/m5/src/arm/SConsopts b/util/m5/src/abi/arm/SConsopts similarity index 95% rename from util/m5/src/arm/SConsopts rename to util/m5/src/abi/arm/SConsopts index 8956b2e2e..1a24ef023 100644 --- a/util/m5/src/arm/SConsopts +++ b/util/m5/src/abi/arm/SConsopts @@ -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) diff --git a/util/m5/src/arm/m5op.S b/util/m5/src/abi/arm/m5op.S similarity index 100% rename from util/m5/src/arm/m5op.S rename to util/m5/src/abi/arm/m5op.S diff --git a/util/m5/src/sparc/SConsopts b/util/m5/src/abi/sparc/SConsopts similarity index 95% rename from util/m5/src/sparc/SConsopts rename to util/m5/src/abi/sparc/SConsopts index d55ff7abf..18374c42f 100644 --- a/util/m5/src/sparc/SConsopts +++ b/util/m5/src/abi/sparc/SConsopts @@ -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) diff --git a/util/m5/src/sparc/m5op.S b/util/m5/src/abi/sparc/m5op.S similarity index 100% rename from util/m5/src/sparc/m5op.S rename to util/m5/src/abi/sparc/m5op.S diff --git a/util/m5/src/thumb/SConsopts b/util/m5/src/abi/thumb/SConsopts similarity index 95% rename from util/m5/src/thumb/SConsopts rename to util/m5/src/abi/thumb/SConsopts index 55860d1e5..b78cc068a 100644 --- a/util/m5/src/thumb/SConsopts +++ b/util/m5/src/abi/thumb/SConsopts @@ -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) diff --git a/util/m5/src/thumb/m5op.S b/util/m5/src/abi/thumb/m5op.S similarity index 100% rename from util/m5/src/thumb/m5op.S rename to util/m5/src/abi/thumb/m5op.S diff --git a/util/m5/src/x86/SConsopts b/util/m5/src/abi/x86/SConsopts similarity index 96% rename from util/m5/src/x86/SConsopts rename to util/m5/src/abi/x86/SConsopts index 47572ab0a..95c57d451 100644 --- a/util/m5/src/x86/SConsopts +++ b/util/m5/src/abi/x86/SConsopts @@ -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') diff --git a/util/m5/src/x86/m5op.S b/util/m5/src/abi/x86/m5op.S similarity index 100% rename from util/m5/src/x86/m5op.S rename to util/m5/src/abi/x86/m5op.S diff --git a/util/m5/src/x86/m5op_addr.S b/util/m5/src/abi/x86/m5op_addr.S similarity index 100% rename from util/m5/src/x86/m5op_addr.S rename to util/m5/src/abi/x86/m5op_addr.S -- 2.30.2