diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-01-26 09:19:22 +0000 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2019-02-22 10:47:36 +0000 |
commit | 7d71f6641fcb660de0f003e2c028b464d7116ca1 (patch) | |
tree | eab821617b26ce34b0dc834f2e0f11cfee67c2a0 /src/systemc/tests | |
parent | 8e5d168332c4ac3851aee4f815cff0b62b37cc40 (diff) | |
download | gem5-7d71f6641fcb660de0f003e2c028b464d7116ca1.tar.xz |
python: Make iterator handling Python 3 compatible
Many functions that used to return lists (e.g., dict.items()) now
return iterators and their iterator counterparts (e.g.,
dict.iteritems()) have been removed. Switch calls to the Python 2.7
iterator methods to use the Python 3 equivalent and add explicit list
conversions where necessary.
Change-Id: I0c18114955af8f4932d81fb689a0adb939dafaba
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/15992
Reviewed-by: Juha Jäykkä <juha.jaykka@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/systemc/tests')
-rw-r--r-- | src/systemc/tests/tlm/endian_conv/testall.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/systemc/tests/tlm/endian_conv/testall.py b/src/systemc/tests/tlm/endian_conv/testall.py index 63bf6abe8..a534fa7f4 100644 --- a/src/systemc/tests/tlm/endian_conv/testall.py +++ b/src/systemc/tests/tlm/endian_conv/testall.py @@ -93,7 +93,7 @@ def txn_generator(nr): pr_enabled = 0.5 bus_widths = [1, 2, 4, 8, 16] data_widths = [1, 2, 4, 8, 16] + [1, 2, 4, 8] + [1, 2, 4] + [1, 2] - lengths = range(1,33) + range(1,17) + range(1,9) + range(1,5) + range(1,3) + lengths = list(range(1,33)) + list(range(1,17)) + list(range(1,9)) + list(range(1,5)) + list(range(1,3)) pr_short_be = 0.2 pr_stream = 0.1 nr_generated = 0 @@ -105,8 +105,8 @@ def txn_generator(nr): if data_width <= bus_width: break if random.random() < 0.25: break length = random.choice(lengths) - addr_base = random.choice(range(0,1024,bus_width)) - addr_offset = random.choice(range(bus_width)+[0]*(bus_width/2)) + addr_base = random.choice(list(range(0,1024,bus_width))) + addr_offset = random.choice(list(range(bus_width))+[0]*(bus_width/2)) txn = transaction( bus_width = bus_width, data_width = data_width, |