summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-12-02 17:50:38 -0800
committerGabe Black <gabeblack@google.com>2019-12-03 13:24:28 +0000
commite5203b88eac6eed12674327c5cd0ac658a27573b (patch)
tree50f5c681c6de267a1ffeebfd91cba2080a75f601 /src
parent6ac429af8744edeba100bb8617184da474a5dd1f (diff)
downloadgem5-e5203b88eac6eed12674327c5cd0ac658a27573b.tar.xz
systemc,fastmodel: Use the gem5_scons error and warning functions.
Use them in place of messing with termcap directly. Change-Id: I093efa95e6b6ea7af198dc1395dce05ca6d6575f Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23263 Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/arch/arm/fastmodel/SConscript12
-rw-r--r--src/systemc/SConsopts10
2 files changed, 7 insertions, 15 deletions
diff --git a/src/arch/arm/fastmodel/SConscript b/src/arch/arm/fastmodel/SConscript
index e4c95900b..2cd577dcd 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -29,18 +29,15 @@ from __future__ import print_function
Import('*')
-from m5.util.terminal import termcap
from m5.util.grammar import Grammar
-from gem5_scons import Transform
+from gem5_scons import Transform, warning, error
import os.path
if env['USE_ARM_FASTMODEL']:
if not env['USE_SYSTEMC']:
- print(termcap.Yellow + termcap.Bold +
- 'Warning: ARM Fast Models require systemc support' +
- termcap.Normal)
+ warning('ARM Fast Models require systemc support')
env['USE_ARM_FASTMODEL'] = False
Return()
@@ -53,10 +50,7 @@ env['ENV']['SYSTEMC_HOME'] = systemc_home.abspath
def extract_var(name):
if name not in env:
- print(termcap.Red + termcap.Bold +
- ('Error: %s is not set' % name) +
- termcap.Normal)
- Exit(1)
+ error('Error: %s is not set' % name)
print('%s = %s' % (name, env[name]))
# Make sure the value of this variable shows up as an environment variable
# for commands scons runs.
diff --git a/src/systemc/SConsopts b/src/systemc/SConsopts
index 172de5724..4e57fd4c1 100644
--- a/src/systemc/SConsopts
+++ b/src/systemc/SConsopts
@@ -28,20 +28,18 @@
Import('*')
from m5.util import compareVersions
-from m5.util.terminal import termcap
+
+from gem5_scons import warning
def use_systemc_check(env, warn=False):
if ('GCC_VERSION' in env and
compareVersions(env['GCC_VERSION'], '5.0') < 0):
if warn:
- print(termcap.Yellow + termcap.Bold +
- 'Warning: Systemc may not work on gcc versions less '
- 'than 5.0.' + termcap.Normal)
+ warning('Systemc may not work on gcc versions less than 5.0.')
return False
elif env['PLATFORM'] == 'darwin':
if warn:
- print(termcap.Yellow + termcap.Bold +
- 'Warning: Systemc may not work on Mac OS.' + termcap.Normal)
+ warning('Warning: Systemc may not work on Mac OS.')
return False
return True