Commit adb00f76 authored by Tristan Gingold's avatar Tristan Gingold

Fix mockturtle-debug.py python3 compatibility.

parent f72e4071
......@@ -358,7 +358,7 @@ class GdbServer(object):
def send(self, packet):
pkt = "${}#{:02x}".format(packet, self.checksum(packet))
if flag_verbose:
print "> {}".format(packet)
print("> {}".format(packet))
self.conn.send(pkt)
def read_reg(self, reg):
......@@ -615,7 +615,7 @@ class GdbServer(object):
def gdb_command(self, packet):
if flag_verbose:
print "< {}".format(packet)
print("< {}".format(packet))
cmd = packet[0]
m = getattr(self, 'handle_' + cmd, None)
if m:
......@@ -646,17 +646,17 @@ class GdbServer(object):
# Ignore ack to answers.
pass
elif c == '\x03':
print "Got a break!"
print ("Got a break!")
else:
if flag_verbose:
print "Ignore character {:x}".format(ord(c))
print ("Ignore character {:x}".format(ord(c)))
else:
packet += c
if len(packet) > 3 and packet[-3] == '#':
chk = self.checksum(packet[1:-3])
pchk = int(packet[-2:], 16)
if chk != pchk:
print 'chkerr: {:x} vs {:x}'.format(chk, pchk)
print ('chkerr: {:x} vs {:x}'.format(chk, pchk))
# print 'pkt: {}'.format(packet[1:-3])
raise Exception('invalid checksum')
self.conn.send('+')
......@@ -700,7 +700,7 @@ def main():
try:
opts, args = getopt.getopt(sys.argv[1:], "s:vkc:b")
except getopt.GetoptError as err:
print str(err)
print (str(err))
sys.exit(2)
for o, a in opts:
if o == "-s":
......@@ -720,7 +720,7 @@ def main():
mt_desc = PyUAL.PyUALVME(4, 0x39, 0x80000, slot << 19, 1)
csr = PyUAL.PyUAL("vme", mt_desc)
else:
print "missing slot (try -s SLOT)"
print ("missing slot (try -s SLOT)")
sys.exit(2)
cmds = {'status': cmd_status,
......@@ -740,7 +740,7 @@ def main():
if f:
f(csr)
else:
print "Unknown command {}".format(cmd)
print ("Unknown command {}".format(cmd))
sys.exit(2)
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment