#
# Authors: Andreas Sandberg
+from __future__ import print_function
+
from multiprocessing import Process
import sys
import os
elif cause in _exit_normal:
sys.exit(_exitcode_done)
else:
- print "Test failed: Unknown exit cause: %s" % cause
+ print("Test failed: Unknown exit cause: %s" % cause)
sys.exit(_exitcode_fail)
def run_test(root, interval=0.5, max_checkpoints=5):
restore = cpt_name
if p.exitcode == _exitcode_done:
- print >> sys.stderr, "Test done."
+ print("Test done.", file=sys.stderr)
sys.exit(0)
elif p.exitcode == _exitcode_checkpoint:
pass
else:
- print >> sys.stderr, "Test failed."
+ print("Test failed.", file=sys.stderr)
sys.exit(1)
# Maximum number of checkpoints reached. Just run full-speed from
if cause in _exit_normal:
sys.exit(0)
else:
- print "Test failed: Unknown exit cause: %s" % cause
+ print("Test failed: Unknown exit cause: %s" % cause)
sys.exit(1)
#
# Authors: Andreas Sandberg
+from __future__ import print_function
+
import m5
import _m5
from m5.objects import *
next_cpu = switcher.next()
if verbose:
- print "Switching CPUs..."
- print "Next CPU: %s" % type(next_cpu)
+ print("Switching CPUs...")
+ print("Next CPU: %s" % type(next_cpu))
m5.drain()
if current_cpu != next_cpu:
m5.switchCpus(system, [ (current_cpu, next_cpu) ],
verbose=verbose)
else:
- print "Source CPU and destination CPU are the same, skipping..."
+ print("Source CPU and destination CPU are the same,"
+ " skipping...")
current_cpu = next_cpu
elif exit_cause == "target called exit()" or \
exit_cause == "m5_exit instruction encountered":
sys.exit(0)
else:
- print "Test failed: Unknown exit cause: %s" % exit_cause
+ print("Test failed: Unknown exit cause: %s" % exit_cause)
sys.exit(1)
#
# Authors: Korey Sewell
+from __future__ import print_function
+
m5.util.addToPath('../configs/common')
from cpu2000 import twolf
import os
try:
os.unlink(sav_file)
except:
- print "Couldn't unlink ", sav_file
+ print("Couldn't unlink ", sav_file)
try:
os.unlink(sv2_file)
except:
- print "Couldn't unlink ", sv2_file
+ print("Couldn't unlink ", sv2_file)
#
# Author: Brad Beckmann
#
+
+from __future__ import print_function
+
executable = binpath('gpu-hello')
kernel_path = os.path.dirname(executable)
kernel_files = glob.glob(os.path.join(kernel_path, '*.asm'))
if kernel_files:
- print "Using GPU kernel code file(s)", ",".join(kernel_files)
+ print("Using GPU kernel code file(s)", ",".join(kernel_files))
else:
fatal("Can't locate kernel code (.asm) in " + kernel_path)
#
# Authors: Korey Sewell
+from __future__ import print_function
+
m5.util.addToPath('../configs/common')
+
from cpu2000 import twolf
import os
try:
os.unlink(sav_file)
except:
- print "Couldn't unlink ", sav_file
+ print("Couldn't unlink ", sav_file)
try:
os.unlink(sv2_file)
except:
- print "Couldn't unlink ", sv2_file
+ print("Couldn't unlink ", sv2_file)
#
# Authors: Steve Reinhardt
+from __future__ import print_function
+
import os
import sys
import re
"""
if reason:
- print "Skipping test: %s" % reason
+ print("Skipping test: %s" % reason)
sys.exit(2)
def has_sim_object(name):
# simulate until program terminates
exit_event = m5.simulate(maxtick)
- print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
+ print('Exiting @ tick', m5.curTick(), 'because', exit_event.getCause())
# Since we're in batch mode, dont allow tcp socket connections
m5.disableAllListeners()
#
# Authors: Andreas Sandberg
+from __future__ import print_function
+
import subprocess
from threading import Timer
import time
ignore_list.rules.append(FileIgnoreList.simple("bar.txt"))
assert "bar.txt" in ignore_list
- print "SUCCESS!"
+ print("SUCCESS!")
#
# Authors: Andreas Sandberg
+from __future__ import print_function
+
import argparse
import sys
import os
for test in get_tests(isa, categories=categories, modes=modes,
ruby_protocol=args.ruby_protocol,
gpu_isa=args.gpu_isa):
- print "/".join(test)
+ print("/".join(test))
sys.exit(0)
def _run_tests_args(subparsers):
def _run_tests(args):
if not os.path.isfile(args.gem5) or not os.access(args.gem5, os.X_OK):
- print >> sys.stderr, \
- "gem5 binary '%s' not an executable file" % args.gem5
+ print("gem5 binary '%s' not an executable file" % args.gem5,
+ file=sys.stderr)
sys.exit(2)
formatter = _create_formatter(args)
skip_diff_out=args.skip_diff_out))
all_results = []
- print "Running %i tests" % len(tests)
+ print("Running %i tests" % len(tests))
for testno, test in enumerate(tests):
- print "%i: Running '%s'..." % (testno, test)
+ print("%i: Running '%s'..." % (testno, test))
all_results.append(test.run())
try:
return pickle.load(f)
except EOFError:
- print >> sys.stderr, 'Could not read file %s' % f.name
+ print('Could not read file %s' % f.name, file=sys.stderr)
return []
formatter = _create_formatter(args)
try:
suites = sum([ pickle.load(f) for f in args.result ], [])
except EOFError:
- print >> sys.stderr, 'Could not read all files'
+ print('Could not read all files', file=sys.stderr)
sys.exit(2)
if all(s for s in suites):