summaryrefslogtreecommitdiff
path: root/configs/example/garnet_synth_traffic.py
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2019-01-26 10:57:44 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2019-02-26 10:28:00 +0000
commit32bbddf2362421021b016d995f5e27b2bceea3a2 (patch)
tree500971374192fb73f41ee41a4e419a61bfca03b9 /configs/example/garnet_synth_traffic.py
parentc38a6523ab4df2b57337be0b2446bd9d30be94b4 (diff)
downloadgem5-32bbddf2362421021b016d995f5e27b2bceea3a2.tar.xz
configs: Fix Python 3 iterator and exec compatibility issues
Python 2.7 used to return lists for operations such as map and range, this has changed in Python 3. To make the configs Python 3 compliant, add explicit conversions from iterators to lists where needed, replace xrange with range, and fix changes to exec syntax. This change doesn't fix import paths since that might require us to restructure the configs slightly. Change-Id: Idcea8482b286779fc98b4e144ca8f54069c08024 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/16002 Reviewed-by: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'configs/example/garnet_synth_traffic.py')
-rw-r--r--configs/example/garnet_synth_traffic.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/configs/example/garnet_synth_traffic.py b/configs/example/garnet_synth_traffic.py
index 92fb3a047..f5b7690de 100644
--- a/configs/example/garnet_synth_traffic.py
+++ b/configs/example/garnet_synth_traffic.py
@@ -87,7 +87,8 @@ parser.add_option("--inj-vnet", type="int", default=-1,
#
Ruby.define_options(parser)
-execfile(os.path.join(config_root, "common", "Options.py"))
+exec(compile(open(os.path.join(config_root, "common", "Options.py")).read(),
+ os.path.join(config_root, "common", "Options.py"), 'exec'))
(options, args) = parser.parse_args()
@@ -112,7 +113,7 @@ cpus = [ GarnetSyntheticTraffic(
inj_vnet=options.inj_vnet,
precision=options.precision,
num_dest=options.num_dirs) \
- for i in xrange(options.num_cpus) ]
+ for i in range(options.num_cpus) ]
# create the desired simulated system
system = System(cpu = cpus, mem_ranges = [AddrRange(options.mem_size)])