tools/remove: add 0x to hex debug prints.

This commit is contained in:
Florent Kermarrec 2020-11-24 14:06:14 +01:00
parent cddf19df98
commit f918d0bf02
4 changed files with 8 additions and 8 deletions

View File

@ -33,7 +33,7 @@ class CommPCIe:
for i in range(length_int):
value = ctypes.c_uint32.from_buffer(self.mmap, addr + 4*i).value
if self.debug:
print("read {:08x} @ {:08x}".format(value, addr + 4*i))
print("read 0x{:08x} @ 0x{:08x}".format(value, addr + 4*i))
if length is None:
return value
data.append(value)
@ -45,4 +45,4 @@ class CommPCIe:
for i, value in enumerate(data):
ctypes.c_uint32.from_buffer(self.mmap, addr + 4*i).value = value
if self.debug:
print("write {:08x} @ {:08x}".format(value, addr + 4*i))
print("write 0x{:08x} @ 0x{:08x}".format(value, addr + 4*i))

View File

@ -61,7 +61,7 @@ class CommUART:
for i in range(length_int):
value = int.from_bytes(self._read(4), "big")
if self.debug:
print("read {:08x} @ {:08x}".format(value, addr + 4*i))
print("read 0x{:08x} @ 0x{:08x}".format(value, addr + 4*i))
if length is None:
return value
data.append(value)
@ -83,6 +83,6 @@ class CommUART:
for i, value in enumerate(data[offset:offset+size]):
self._write(list(value.to_bytes(4, byteorder="big")))
if self.debug:
print("write {:08x} @ {:08x}".format(value, addr + offset, 4*i))
print("write 0x{:08x} @ 0x{:08x}".format(value, addr + offset, 4*i))
offset += size
length -= size

View File

@ -48,7 +48,7 @@ class CommUDP:
datas = packet.records.pop().writes.get_datas()
if self.debug:
for i, value in enumerate(datas):
print("read {:08x} @ {:08x}".format(value, addr + 4*i))
print("read 0x{:08x} @ 0x{:08x}".format(value, addr + 4*i))
return datas[0] if length is None else datas
def write(self, addr, datas):
@ -66,4 +66,4 @@ class CommUDP:
if self.debug:
for i, value in enumerate(datas):
print("write {:08x} @ {:08x}".format(value, addr + 4*i))
print("write 0x{:08x} @ 0x{:08x}".format(value, addr + 4*i))

View File

@ -102,7 +102,7 @@ class CommUSB:
if value is None:
value = 0xffffffff
if self.debug:
print("read {:08x} @ {:08x}".format(value, addr))
print("read 0x{:08x} @ 0x{:08x}".format(value, addr))
if length is None:
return value
data.append(value)
@ -137,7 +137,7 @@ class CommUSB:
for i, value in enumerate(data):
self.usb_write(addr, value)
if self.debug:
print("write {:08x} @ {:08x}".format(value, addr + 4*i))
print("write 0x{:08x} @ 0x{:08x}".format(value, addr + 4*i))
def usb_write(self, addr, value, depth=0):
try: