# Kevin Lim
import os, signal
-import sys
+import sys, time
import glob
from SCons.Script.SConscript import SConsEnvironment
if env['BATCH']:
cmd = '%s -t %d %s' % (env['BATCH_CMD'], timeout, cmd)
+ pre_exec_time = time.time()
status = env.Execute(env.subst(cmd, target=target, source=source))
if status == 0:
# M5 terminated normally.
# Run diff on output & ref directories to find differences.
# Exclude the stats file since we will use diff-out on that.
+
+ # NFS file systems can be annoying and not have updated yet
+ # wait until we see the file modified
+ statsdiff = os.path.join(tgt_dir, 'statsdiff')
+ m_time = 0
+ nap = 0
+ while m_time < pre_exec_time and nap < 10:
+ try:
+ m_time = os.stat(statsdiff).st_mtime
+ except OSError:
+ pass
+ time.sleep(1)
+ nap += 1
+
outdiff = os.path.join(tgt_dir, 'outdiff')
- diffcmd = 'diff -ubr %s ${SOURCES[2].dir} %s > %s' \
+ # tack 'true' on the end so scons doesn't report diff's
+ # non-zero exit code as a build error
+ diffcmd = 'diff -ubrs %s ${SOURCES[2].dir} %s > %s; true' \
% (output_ignore_args, tgt_dir, outdiff)
env.Execute(env.subst(diffcmd, target=target, source=source))
print "===== Output differences ====="
print contents(outdiff)
# Run diff-out on stats.txt file
- statsdiff = os.path.join(tgt_dir, 'statsdiff')
diffcmd = '$DIFFOUT ${SOURCES[2]} %s > %s' \
% (os.path.join(tgt_dir, 'stats.txt'), statsdiff)
diffcmd = env.subst(diffcmd, target=target, source=source)
# - long-winded message about ignored sources
ignore_msg = '''
Note: The following file(s) will not be copied. New non-standard
- output files must be copied manually once before update_ref will
+ output files must be copied manually once before --update-ref will
recognize them as outputs. Otherwise they are assumed to be
inputs and are ignored.
'''
testAction)
# phony target to echo status
- if env['update_ref']:
+ if GetOption('update_ref'):
p = env.Command(tgt('_update'),
[ref_stats, new_stats, status_file],
updateAction)
'tsunami-simple-atomic-dual',
'tsunami-simple-timing-dual',
'twosys-tsunami-simple-atomic',
- 'tsunami-o3', 'tsunami-o3-dual']
+ 'tsunami-o3', 'tsunami-o3-dual',
+ 'tsunami-inorder']
if env['TARGET_ISA'] == 'sparc':
configs += ['t1000-simple-atomic',
't1000-simple-timing']
+ if env['TARGET_ISA'] == 'arm':
+ configs += ['realview-simple-atomic',
+ 'realview-simple-atomic-dual',
+ 'realview-simple-timing',
+ 'realview-simple-timing-dual',
+ 'realview-o3',
+ 'realview-o3-dual']
+ if env['TARGET_ISA'] == 'x86':
+ configs += ['pc-simple-atomic',
+ 'pc-simple-timing',
+ 'pc-o3-timing']
else:
configs += ['simple-atomic', 'simple-timing', 'o3-timing', 'memtest',
'simple-atomic-mp', 'simple-timing-mp', 'o3-timing-mp',
- 'inorder-timing']
+ 'inorder-timing', 'rubytest']
-if env['RUBY']:
- # Hack for Ruby
- configs += [c + '-ruby' for c in configs]
+if env['PROTOCOL'] != 'None':
+ if env['PROTOCOL'] == 'MI_example':
+ configs += [c + "-ruby" for c in configs]
+ else:
+ configs = [c + "-ruby-" + env['PROTOCOL'] for c in configs]
cwd = os.getcwd()
os.chdir(str(Dir('.').srcdir))
for config in configs:
dirs = glob.glob('*/*/ref/%s/*/%s' % (env['TARGET_ISA'], config))
for d in dirs:
- test_builder(env, d)
+ if not os.path.exists(os.path.join(d, 'skip')):
+ test_builder(env, d)
os.chdir(cwd)