diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-01-26 10:57:44 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-02-26 10:28:00 +0000 |
commit | 32bbddf2362421021b016d995f5e27b2bceea3a2 (patch) | |
tree | 500971374192fb73f41ee41a4e419a61bfca03b9 /configs/topologies/Mesh_westfirst.py | |
parent | c38a6523ab4df2b57337be0b2446bd9d30be94b4 (diff) | |
download | gem5-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/topologies/Mesh_westfirst.py')
-rw-r--r-- | configs/topologies/Mesh_westfirst.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/configs/topologies/Mesh_westfirst.py b/configs/topologies/Mesh_westfirst.py index 6139f6742..f3278200d 100644 --- a/configs/topologies/Mesh_westfirst.py +++ b/configs/topologies/Mesh_westfirst.py @@ -82,7 +82,7 @@ class Mesh_westfirst(SimpleTopology): # distributed across the network. network_nodes = [] remainder_nodes = [] - for node_index in xrange(len(nodes)): + for node_index in range(len(nodes)): if node_index < (len(nodes) - remainder): network_nodes.append(nodes[node_index]) else: @@ -114,8 +114,8 @@ class Mesh_westfirst(SimpleTopology): int_links = [] # East output to West input links (weight = 2) - for row in xrange(num_rows): - for col in xrange(num_columns): + for row in range(num_rows): + for col in range(num_columns): if (col + 1 < num_columns): east_out = col + (row * num_columns) west_in = (col + 1) + (row * num_columns) @@ -127,8 +127,8 @@ class Mesh_westfirst(SimpleTopology): link_count += 1 # West output to East input links (weight = 1) - for row in xrange(num_rows): - for col in xrange(num_columns): + for row in range(num_rows): + for col in range(num_columns): if (col + 1 < num_columns): east_in = col + (row * num_columns) west_out = (col + 1) + (row * num_columns) @@ -141,8 +141,8 @@ class Mesh_westfirst(SimpleTopology): # North output to South input links (weight = 2) - for col in xrange(num_columns): - for row in xrange(num_rows): + for col in range(num_columns): + for row in range(num_rows): if (row + 1 < num_rows): north_out = col + (row * num_columns) south_in = col + ((row + 1) * num_columns) @@ -154,8 +154,8 @@ class Mesh_westfirst(SimpleTopology): link_count += 1 # South output to North input links (weight = 2) - for col in xrange(num_columns): - for row in xrange(num_rows): + for col in range(num_columns): + for row in range(num_rows): if (row + 1 < num_rows): north_in = col + (row * num_columns) south_out = col + ((row + 1) * num_columns) |