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

@@ -39,6 +39,8 @@
# Authors: Ron Dreslinski
# Andreas Hansson
from __future__ import print_function
import optparse
import random
import sys
@@ -108,7 +110,7 @@ parser.add_option("--sys-clock", action="store", type="string",
(options, args) = parser.parse_args()
if args:
print "Error: script doesn't take any positional arguments"
print("Error: script doesn't take any positional arguments")
sys.exit(1)
# Start by parsing the command line options and do some basic sanity
@@ -118,36 +120,36 @@ if options.random:
tree_depth = random.randint(1, 4)
cachespec = [random.randint(1, 3) for i in range(tree_depth)]
testerspec = [random.randint(1, 3) for i in range(tree_depth + 1)]
print "Generated random tree -c", ':'.join(map(str, cachespec)), \
"-t", ':'.join(map(str, testerspec))
print("Generated random tree -c", ':'.join(map(str, cachespec)),
"-t", ':'.join(map(str, testerspec)))
else:
try:
cachespec = [int(x) for x in options.caches.split(':')]
testerspec = [int(x) for x in options.testers.split(':')]
except:
print "Error: Unable to parse caches or testers option"
print("Error: Unable to parse caches or testers option")
sys.exit(1)
if len(cachespec) < 1:
print "Error: Must have at least one level of caches"
print("Error: Must have at least one level of caches")
sys.exit(1)
if len(cachespec) != len(testerspec) - 1:
print "Error: Testers must have one element more than caches"
print("Error: Testers must have one element more than caches")
sys.exit(1)
if testerspec[-1] == 0:
print "Error: Must have testers at the uppermost level"
print("Error: Must have testers at the uppermost level")
sys.exit(1)
for t in testerspec:
if t < 0:
print "Error: Cannot have a negative number of testers"
print("Error: Cannot have a negative number of testers")
sys.exit(1)
for c in cachespec:
if c < 1:
print "Error: Must have 1 or more caches at each level"
print("Error: Must have 1 or more caches at each level")
sys.exit(1)
# Determine the tester multiplier for each level as the string
@@ -155,7 +157,7 @@ else:
multiplier = [1]
for c in cachespec:
if c < 1:
print "Error: Must have at least one cache per level"
print("Error: Must have at least one cache per level")
multiplier.append(multiplier[-1] * c)
numtesters = 0
@@ -275,7 +277,7 @@ def make_cache_level(ncaches, prototypes, level, next_cache):
cache.mem_side = xbar.slave
else:
if not next_cache:
print "Error: No next-level cache at top level"
print("Error: No next-level cache at top level")
sys.exit(1)
if ntesters > 1:
@@ -315,4 +317,4 @@ m5.instantiate()
# Simulate until program terminates
exit_event = m5.simulate(options.maxtick)
print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
print('Exiting @ tick', m5.curTick(), 'because', exit_event.getCause())