Bobby R. Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/47022 )
Change subject: systemc,tests,python: Updated testall.py to python3
......................................................................
systemc,tests,python: Updated testall.py to python3
Change-Id: I95fce9d71bf0af9cd76e8bf0dd353281cff8ed74
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47022
Maintainer: Bobby R. Bruce <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/systemc/tests/tlm/endian_conv/testall.py
1 file changed, 16 insertions(+), 16 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
Bobby R. Bruce: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/systemc/tests/tlm/endian_conv/testall.py
b/src/systemc/tests/tlm/endian_conv/testall.py
index a534fa7..f3a9d0b 100644
--- a/src/systemc/tests/tlm/endian_conv/testall.py
+++ b/src/systemc/tests/tlm/endian_conv/testall.py
@@ -106,7 +106,7 @@
if random.random() < 0.25: break
length = random.choice(lengths)
addr_base = random.choice(list(range(0,1024,bus_width)))
- addr_offset = random.choice(list(range(bus_width))+[0]*(bus_width/2))
+ addr_offset =
random.choice(list(range(bus_width))+[0]*int(bus_width//2))
txn = transaction(
bus_width = bus_width,
data_width = data_width,
@@ -137,15 +137,15 @@
# test code for transaction generator
if False:
for t in txn_generator(20):
- print t
+ print(t)
raise Exception
# end test code
class memory_state_cl:
buffer_size = 2048
- repeats = 10 * buffer_size / 36
- population = (string.lowercase + string.digits) * repeats
+ repeats = 10 * buffer_size // 36
+ population = (string.ascii_lowercase + string.digits) * int(repeats)
def __init__(self):
self.initiator = "".join(
random.sample(memory_state_cl.population,
memory_state_cl.buffer_size))
@@ -293,10 +293,10 @@
# test code for fragmenters
if False:
for t in txn_generator(1):
- print t
- print
+ print(t)
+ print()
for u in fragmenters[4](t):
- print u
+ print(u)
raise Exception
# end test code
@@ -401,16 +401,16 @@
from sys import argv
-print "Testing Endianness Conversion Functions"
-print "March 2008"
-print "OSCI TLM-2"
+print("Testing Endianness Conversion Functions")
+print("March 2008")
+print("OSCI TLM-2")
try: nr_txns_to_test = int(argv[1])
except:
- print "No command line input for number of tests, using default"
+ print("No command line input for number of tests, using default")
nr_txns_to_test = 1000
-print "Number to test:", nr_txns_to_test
+print("Number to test:", nr_txns_to_test)
# generate and test a number of transactions
for txn in txn_generator(nr_txns_to_test):
@@ -445,12 +445,12 @@
actual memory:
%s""" % (fragmenter, txn, initial_memory, golden_memory_state,
memory_state))
- print ".",
-print
+ print("."),
+print()
-print "Conversion functions usage frequency:"
+print("Conversion functions usage frequency:")
for c in all_converters:
- print c.nr, c.__name__, c.usage
+ print(c.nr, c.__name__, c.usage)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/47022
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I95fce9d71bf0af9cd76e8bf0dd353281cff8ed74
Gerrit-Change-Number: 47022
Gerrit-PatchSet: 4
Gerrit-Owner: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s