Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/58354 )
Change subject: scons: Rework the fastmodel extract_var helper.
......................................................................
scons: Rework the fastmodel extract_var helper.
This helper extracts config variables and sets them up for use in
fast model tools. Rework this function for two purposes. First, ensure
that the ['CONF'] subdict is used consistently. It was used in one spot
in that function, but not anywhere else. Avoid those mistakes by
accessing the configuration dict only once, and then reusing the value.
Second, only print the values of those variables if they aren't empty.
That avoids extra log output for values which aren't set up and aren't
being used, while still exposing those values if they are set up. This
will print them even if they aren't being actively used, but are set up
and could be with other changes in the config.
Change-Id: Ia3ea76e6cb6b3347fd082112a1eaa8d594e06ca2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58354
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/arm/fastmodel/SConscript
1 file changed, 32 insertions(+), 5 deletions(-)
Approvals:
Gabe Black: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/arch/arm/fastmodel/SConscript
b/src/arch/arm/fastmodel/SConscript
index 5c4bbf9..cfbe4b9 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -61,13 +61,15 @@
env['ENV']['SYSTEMC_HOME'] = systemc_home.abspath
def extract_var(name):
- if name not in env['CONF']:
- error('Error: %s is not set' % name)
- print('%s = %s' % (name, env[name]))
+ val = env['CONF'].get(name, None)
+ if val is None:
+ error(f'{name} is not set')
+ if env['CONF']['USE_ARM_FASTMODEL']:
+ print(f'{name} = {val}')
# Make sure the value of this variable shows up as an environment
variable
# for commands scons runs.
- env['ENV'][name] = env[name]
- return env[name]
+ env['ENV'][name] = val
+ return val
pvlib_home, maxcore_home, armlmd_license_file = \
list(map(extract_var, ('PVLIB_HOME', 'MAXCORE_HOME',
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58354
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: Ia3ea76e6cb6b3347fd082112a1eaa8d594e06ca2
Gerrit-Change-Number: 58354
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Earl Ou <shunhsin...@google.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Jui-min Lee <f...@google.com>
Gerrit-Reviewer: Yu-hsin Wang <yuhsi...@google.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
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