From f918d0bf0257e0193cd8e7b355751750fdb59a67 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 24 Nov 2020 14:06:14 +0100 Subject: [PATCH] tools/remove: add 0x to hex debug prints. --- litex/tools/remote/comm_pcie.py | 4 ++-- litex/tools/remote/comm_uart.py | 4 ++-- litex/tools/remote/comm_udp.py | 4 ++-- litex/tools/remote/comm_usb.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/litex/tools/remote/comm_pcie.py b/litex/tools/remote/comm_pcie.py index 0d024a858..09acf7134 100644 --- a/litex/tools/remote/comm_pcie.py +++ b/litex/tools/remote/comm_pcie.py @@ -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)) diff --git a/litex/tools/remote/comm_uart.py b/litex/tools/remote/comm_uart.py index 8c2a7c2e9..9daccb1db 100644 --- a/litex/tools/remote/comm_uart.py +++ b/litex/tools/remote/comm_uart.py @@ -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 diff --git a/litex/tools/remote/comm_udp.py b/litex/tools/remote/comm_udp.py index bba60f2eb..ee62d503d 100644 --- a/litex/tools/remote/comm_udp.py +++ b/litex/tools/remote/comm_udp.py @@ -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)) diff --git a/litex/tools/remote/comm_usb.py b/litex/tools/remote/comm_usb.py index 9acead30c..4fdc19b46 100644 --- a/litex/tools/remote/comm_usb.py +++ b/litex/tools/remote/comm_usb.py @@ -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: