From 659900aedd1b4fc69b61b5dbaee39dba26848637 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 5 Mar 2018 22:51:34 -0800 Subject: config: Switch from the print statement to the print function. Change-Id: I701fa58cfcfa2767ce9ad24da314a053889878d0 Reviewed-on: https://gem5-review.googlesource.com/8762 Reviewed-by: Andreas Sandberg Reviewed-by: Jason Lowe-Power Reviewed-by: Anthony Gutierrez Maintainer: Gabe Black --- configs/example/arm/fs_bigLITTLE.py | 8 +++++--- configs/example/arm/fs_power.py | 12 +++++++----- configs/example/arm/starter_fs.py | 12 +++++++----- configs/example/arm/starter_se.py | 10 ++++++---- 4 files changed, 25 insertions(+), 17 deletions(-) (limited to 'configs/example/arm') diff --git a/configs/example/arm/fs_bigLITTLE.py b/configs/example/arm/fs_bigLITTLE.py index 7e0555c00..7d66c03a6 100644 --- a/configs/example/arm/fs_bigLITTLE.py +++ b/configs/example/arm/fs_bigLITTLE.py @@ -40,6 +40,8 @@ # a generic ARM bigLITTLE system. +from __future__ import print_function + import argparse import os import sys @@ -311,12 +313,12 @@ def run(checkpoint_dir=m5.options.outdir): event = m5.simulate() exit_msg = event.getCause() if exit_msg == "checkpoint": - print "Dropping checkpoint at tick %d" % m5.curTick() + print("Dropping checkpoint at tick %d" % m5.curTick()) cpt_dir = os.path.join(checkpoint_dir, "cpt.%d" % m5.curTick()) m5.checkpoint(cpt_dir) - print "Checkpoint done." + print("Checkpoint done.") else: - print exit_msg, " @ ", m5.curTick() + print(exit_msg, " @ ", m5.curTick()) break sys.exit(event.getCode()) diff --git a/configs/example/arm/fs_power.py b/configs/example/arm/fs_power.py index 14dbae04a..b27455f13 100644 --- a/configs/example/arm/fs_power.py +++ b/configs/example/arm/fs_power.py @@ -39,6 +39,8 @@ # This configuration file extends the example ARM big.LITTLE(tm) # with example power models. +from __future__ import print_function + import argparse import os @@ -90,11 +92,11 @@ def main(): bL.instantiate(options) - print "*" * 70 - print "WARNING: The power numbers generated by this script are " \ - "examples. They are not representative of any particular " \ - "implementation or process." - print "*" * 70 + print("*" * 70) + print("WARNING: The power numbers generated by this script are " + "examples. They are not representative of any particular " + "implementation or process.") + print("*" * 70) # Dumping stats periodically m5.stats.periodicStatDump(m5.ticks.fromSeconds(0.1E-3)) diff --git a/configs/example/arm/starter_fs.py b/configs/example/arm/starter_fs.py index 2ca1cb800..a1997682e 100644 --- a/configs/example/arm/starter_fs.py +++ b/configs/example/arm/starter_fs.py @@ -43,6 +43,8 @@ Research Starter Kit on System Modeling. More information can be found at: http://www.arm.com/ResearchEnablement/SystemModeling """ +from __future__ import print_function + import os import m5 from m5.util import addToPath @@ -97,7 +99,7 @@ def create(args): dtb_file = args.dtb if args.script and not os.path.isfile(args.script): - print "Error: Bootscript %s does not exist" % args.script + print("Error: Bootscript %s does not exist" % args.script) sys.exit(1) cpu_class = cpu_types[args.cpu][0] @@ -175,18 +177,18 @@ def create(args): def run(args): cptdir = m5.options.outdir if args.checkpoint: - print "Checkpoint directory: %s" % cptdir + print("Checkpoint directory: %s" % cptdir) while True: event = m5.simulate() exit_msg = event.getCause() if exit_msg == "checkpoint": - print "Dropping checkpoint at tick %d" % m5.curTick() + print("Dropping checkpoint at tick %d" % m5.curTick()) cpt_dir = os.path.join(m5.options.outdir, "cpt.%d" % m5.curTick()) m5.checkpoint(os.path.join(cpt_dir)) - print "Checkpoint done." + print("Checkpoint done.") else: - print exit_msg, " @ ", m5.curTick() + print(exit_msg, " @ ", m5.curTick()) break sys.exit(event.getCode()) diff --git a/configs/example/arm/starter_se.py b/configs/example/arm/starter_se.py index 902e6e49a..ef218d978 100644 --- a/configs/example/arm/starter_se.py +++ b/configs/example/arm/starter_se.py @@ -43,6 +43,8 @@ Research Starter Kit on System Modeling. More information can be found at: http://www.arm.com/ResearchEnablement/SystemModeling """ +from __future__ import print_function + import os import m5 from m5.util import addToPath @@ -145,7 +147,7 @@ def get_processes(cmd): process = Process(pid=100 + idx, cwd=cwd, cmd=argv, executable=argv[0]) - print "info: %d. command and arguments: %s" % (idx + 1, process.cmd) + print("info: %d. command and arguments: %s" % (idx + 1, process.cmd)) multiprocesses.append(process) return multiprocesses @@ -168,8 +170,8 @@ def create(args): # that we can pass to gem5. processes = get_processes(args.commands_to_run) if len(processes) != args.num_cores: - print "Error: Cannot map %d command(s) onto %d " \ - "CPU(s)" % (len(processes), args.num_cores) + print("Error: Cannot map %d command(s) onto %d CPU(s)" % + (len(processes), args.num_cores)) sys.exit(1) # Assign one workload to each CPU @@ -225,7 +227,7 @@ def main(): # Print the reason for the simulation exit. Some exit codes are # requests for service (e.g., checkpoints) from the simulation # script. We'll just ignore them here and exit. - print event.getCause(), " @ ", m5.curTick() + print(event.getCause(), " @ ", m5.curTick()) sys.exit(event.getCode()) -- cgit v1.2.3