From 32bbddf2362421021b016d995f5e27b2bceea3a2 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Sat, 26 Jan 2019 10:57:44 +0000 Subject: 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 Reviewed-on: https://gem5-review.googlesource.com/c/16002 Reviewed-by: Gabe Black --- configs/dram/lat_mem_rd.py | 2 +- configs/dram/low_power_sweep.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'configs/dram') diff --git a/configs/dram/lat_mem_rd.py b/configs/dram/lat_mem_rd.py index dc80bd287..a1aa77df4 100644 --- a/configs/dram/lat_mem_rd.py +++ b/configs/dram/lat_mem_rd.py @@ -188,7 +188,7 @@ def create_trace(filename, max_addr, burst_size, itt): protolib.encodeMessage(proto_out, header) # create a list of every single address to touch - addrs = range(0, max_addr, burst_size) + addrs = list(range(0, max_addr, burst_size)) import random random.shuffle(addrs) diff --git a/configs/dram/low_power_sweep.py b/configs/dram/low_power_sweep.py index 2aa64906f..e9714a6dc 100644 --- a/configs/dram/low_power_sweep.py +++ b/configs/dram/low_power_sweep.py @@ -166,11 +166,11 @@ pd_entry_time = (system.mem_ctrls[0].tRAS.value + # We sweep itt max using the multipliers specified by the user. itt_max_str = args.itt_list.strip().split() -itt_max_multiples = map(lambda x : int(x), itt_max_str) +itt_max_multiples = [ int(x) for x in itt_max_str ] if len(itt_max_multiples) == 0: fatal("String for itt-max-list detected empty\n") -itt_max_values = map(lambda m : pd_entry_time * m, itt_max_multiples) +itt_max_values = [ pd_entry_time * m for m in itt_max_multiples ] # Generate request addresses in the entire range, assume we start at 0 max_addr = mem_range.end -- cgit v1.2.3