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 <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2018-03-05 22:51:34 -08:00
parent 0bb50e6745
commit 659900aedd
39 changed files with 273 additions and 194 deletions

View File

@@ -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())

View File

@@ -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))

View File

@@ -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())

View File

@@ -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())