[gem5-dev] Change in public/gem5[master]: config: Switch from the print statement to the print function.

2018-03-06 Thread Gabe Black (Gerrit)
Gabe Black has submitted this change and it was merged. (  
https://gem5-review.googlesource.com/8762 )


Change subject: config: Switch from the print statement to the print  
function.

..

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 
---
M configs/common/Benchmarks.py
M configs/common/CacheConfig.py
M configs/common/CpuConfig.py
M configs/common/FSConfig.py
M configs/common/GPUTLBConfig.py
M configs/common/MemConfig.py
M configs/common/PlatformConfig.py
M configs/common/Simulation.py
M configs/common/cores/arm/HPI.py
M configs/common/cpu2000.py
M configs/dram/lat_mem_rd.py
M configs/dram/low_power_sweep.py
M configs/dram/sweep.py
M configs/example/apu_se.py
M configs/example/arm/fs_bigLITTLE.py
M configs/example/arm/fs_power.py
M configs/example/arm/starter_fs.py
M configs/example/arm/starter_se.py
M configs/example/etrace_replay.py
M configs/example/fs.py
M configs/example/garnet_synth_traffic.py
M configs/example/hmctest.py
M configs/example/memcheck.py
M configs/example/memtest.py
M configs/example/read_config.py
M configs/example/ruby_direct_test.py
M configs/example/ruby_gpu_random_test.py
M configs/example/ruby_mem_test.py
M configs/example/ruby_random_test.py
M configs/example/se.py
M configs/learning_gem5/part1/simple.py
M configs/learning_gem5/part1/two_level.py
M configs/learning_gem5/part2/hello_goodbye.py
M configs/learning_gem5/part2/run_simple.py
M configs/learning_gem5/part2/simple_cache.py
M configs/learning_gem5/part2/simple_memobj.py
M configs/ruby/Ruby.py
M configs/splash2/cluster.py
M configs/splash2/run.py
39 files changed, 273 insertions(+), 194 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Andreas Sandberg: Looks good to me, approved
  Anthony Gutierrez: Looks good to me, approved
  Gabe Black: Looks good to me, approved



diff --git a/configs/common/Benchmarks.py b/configs/common/Benchmarks.py
index dec1e3e..b7d10b5 100644
--- a/configs/common/Benchmarks.py
+++ b/configs/common/Benchmarks.py
@@ -26,6 +26,8 @@
 #
 # Authors: Ali Saidi

+from __future__ import print_function
+
 from SysPaths import script, disk, binary
 from os import environ as env
 from m5.defines import buildEnv
@@ -63,8 +65,8 @@
 elif buildEnv['TARGET_ISA'] == 'sparc':
 return env.get('LINUX_IMAGE', disk('disk.s10hw2'))
 else:
-print "Don't know what default disk image to use for %s ISA" %  
\

-buildEnv['TARGET_ISA']
+print("Don't know what default disk image to use for %s ISA" %
+buildEnv['TARGET_ISA'])
 exit(1)

 def rootdev(self):
diff --git a/configs/common/CacheConfig.py b/configs/common/CacheConfig.py
index a0a18a3..3fa3676 100644
--- a/configs/common/CacheConfig.py
+++ b/configs/common/CacheConfig.py
@@ -41,13 +41,15 @@
 # Configure the M5 cache hierarchy config in one place
 #

+from __future__ import print_function
+
 import m5
 from m5.objects import *
 from Caches import *

 def config_cache(options, system):
 if options.external_memory_system and (options.caches or  
options.l2cache):
-print "External caches and internal caches are exclusive  
options.\n"
+print("External caches and internal caches are exclusive  
options.\n")

 sys.exit(1)

 if options.external_memory_system:
@@ -57,7 +59,7 @@
 try:
 from cores.arm.O3_ARM_v7a import *
 except:
-print "O3_ARM_v7a_3 is unavailable. Did you compile the O3  
model?"
+print("O3_ARM_v7a_3 is unavailable. Did you compile the O3  
model?")

 sys.exit(1)

 dcache_class, icache_class, l2_cache_class, walk_cache_class = \
diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py
index 327c431..3f193ae 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -35,6 +35,8 @@
 #
 # Authors: Andreas Sandberg

+from __future__ import print_function
+
 from m5 import fatal
 import m5.objects
 import inspect
@@ -64,23 +66,23 @@
 cpu_class = _cpu_classes[name]
 return cpu_class
 except KeyError:
-print "%s is not a valid CPU model." % (name,)
+print("%s is not a valid CPU model." % (name,))
 sys.exit(1)

 def print_cpu_list():
 """Print a list of available CPU classes including their aliases."""

-print "Available CPU classes:"
+print("Available CPU classes:")
 doc_wrapper = TextWrapper(initial_indent="\t\t",  
subsequent_indent="\t\t")

 for name, cls in _cpu_classes.items():
-print "\t%s" % name
+print("\t%s" % name)

 

[gem5-dev] Change in public/gem5[master]: config: Switch from the print statement to the print function.

2018-03-05 Thread Gabe Black (Gerrit)
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/8762



Change subject: config: Switch from the print statement to the print  
function.

..

config: Switch from the print statement to the print function.

Change-Id: I701fa58cfcfa2767ce9ad24da314a053889878d0
---
M configs/common/Benchmarks.py
M configs/common/CacheConfig.py
M configs/common/CpuConfig.py
M configs/common/FSConfig.py
M configs/common/GPUTLBConfig.py
M configs/common/MemConfig.py
M configs/common/PlatformConfig.py
M configs/common/Simulation.py
M configs/common/cores/arm/HPI.py
M configs/common/cpu2000.py
M configs/dram/lat_mem_rd.py
M configs/dram/low_power_sweep.py
M configs/dram/sweep.py
M configs/example/apu_se.py
M configs/example/arm/fs_bigLITTLE.py
M configs/example/arm/fs_power.py
M configs/example/arm/starter_fs.py
M configs/example/arm/starter_se.py
M configs/example/etrace_replay.py
M configs/example/fs.py
M configs/example/garnet_synth_traffic.py
M configs/example/hmctest.py
M configs/example/memcheck.py
M configs/example/memtest.py
M configs/example/read_config.py
M configs/example/ruby_direct_test.py
M configs/example/ruby_gpu_random_test.py
M configs/example/ruby_mem_test.py
M configs/example/ruby_random_test.py
M configs/example/se.py
M configs/learning_gem5/part1/simple.py
M configs/learning_gem5/part1/two_level.py
M configs/learning_gem5/part2/hello_goodbye.py
M configs/learning_gem5/part2/run_simple.py
M configs/learning_gem5/part2/simple_cache.py
M configs/learning_gem5/part2/simple_memobj.py
M configs/ruby/Ruby.py
M configs/splash2/cluster.py
M configs/splash2/run.py
39 files changed, 273 insertions(+), 194 deletions(-)



diff --git a/configs/common/Benchmarks.py b/configs/common/Benchmarks.py
index dec1e3e..b7d10b5 100644
--- a/configs/common/Benchmarks.py
+++ b/configs/common/Benchmarks.py
@@ -26,6 +26,8 @@
 #
 # Authors: Ali Saidi

+from __future__ import print_function
+
 from SysPaths import script, disk, binary
 from os import environ as env
 from m5.defines import buildEnv
@@ -63,8 +65,8 @@
 elif buildEnv['TARGET_ISA'] == 'sparc':
 return env.get('LINUX_IMAGE', disk('disk.s10hw2'))
 else:
-print "Don't know what default disk image to use for %s ISA" %  
\

-buildEnv['TARGET_ISA']
+print("Don't know what default disk image to use for %s ISA" %
+buildEnv['TARGET_ISA'])
 exit(1)

 def rootdev(self):
diff --git a/configs/common/CacheConfig.py b/configs/common/CacheConfig.py
index a0a18a3..3fa3676 100644
--- a/configs/common/CacheConfig.py
+++ b/configs/common/CacheConfig.py
@@ -41,13 +41,15 @@
 # Configure the M5 cache hierarchy config in one place
 #

+from __future__ import print_function
+
 import m5
 from m5.objects import *
 from Caches import *

 def config_cache(options, system):
 if options.external_memory_system and (options.caches or  
options.l2cache):
-print "External caches and internal caches are exclusive  
options.\n"
+print("External caches and internal caches are exclusive  
options.\n")

 sys.exit(1)

 if options.external_memory_system:
@@ -57,7 +59,7 @@
 try:
 from cores.arm.O3_ARM_v7a import *
 except:
-print "O3_ARM_v7a_3 is unavailable. Did you compile the O3  
model?"
+print("O3_ARM_v7a_3 is unavailable. Did you compile the O3  
model?")

 sys.exit(1)

 dcache_class, icache_class, l2_cache_class, walk_cache_class = \
diff --git a/configs/common/CpuConfig.py b/configs/common/CpuConfig.py
index 327c431..3f193ae 100644
--- a/configs/common/CpuConfig.py
+++ b/configs/common/CpuConfig.py
@@ -35,6 +35,8 @@
 #
 # Authors: Andreas Sandberg

+from __future__ import print_function
+
 from m5 import fatal
 import m5.objects
 import inspect
@@ -64,23 +66,23 @@
 cpu_class = _cpu_classes[name]
 return cpu_class
 except KeyError:
-print "%s is not a valid CPU model." % (name,)
+print("%s is not a valid CPU model." % (name,))
 sys.exit(1)

 def print_cpu_list():
 """Print a list of available CPU classes including their aliases."""

-print "Available CPU classes:"
+print("Available CPU classes:")
 doc_wrapper = TextWrapper(initial_indent="\t\t",  
subsequent_indent="\t\t")

 for name, cls in _cpu_classes.items():
-print "\t%s" % name
+print("\t%s" % name)

 # Try to extract the class documentation from the class help
 # string.
 doc = inspect.getdoc(cls)
 if doc:
 for line in doc_wrapper.wrap(doc):
-print line
+print(line)

 def cpu_names():
 """Return a list of valid CPU names."""
diff --git a/configs/common/FSConfig.py b/configs/common/FSConfig.py
index fc8765b..42cfafe 100644
--- a/configs/common/FSConfig.py
+++ b/configs/common/FSConfig.py
@@