soc/tools/remote/server: add --debug parameter
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 17 Nov 2015 14:43:10 +0000 (15:43 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 17 Nov 2015 14:43:10 +0000 (15:43 +0100)
litex/soc/tools/remote/comm_uart.py
litex/soc/tools/remote/server.py

index 0f20dd16028dc4f75151e0623a3ca4578dba0c5e..0f7987d12377ce9f773916c9cb3cd754eca9d4ec 100644 (file)
@@ -45,7 +45,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(data, addr + 4*i))
+                print("read {:08x} @ {:08x}".format(value, addr + 4*i))
             if length is None:
                 return value
             data.append(value)
index 8b6e304ce87a3d768b2b17ff073256a46660731e..dff47710c5bfa31f6ed63ddacf0c72fa50496df1 100644 (file)
@@ -73,6 +73,7 @@ def _get_args():
     parser.add_argument("--comm", default="uart", help="comm interface")
     parser.add_argument("--port", default="2", help="UART port")
     parser.add_argument("--baudrate", default=115200, help="UART baudrate")
+    parser.add_argument("--debug", action="store_true", help="enable debug")
     return parser.parse_args()
 
 def main():
@@ -83,7 +84,7 @@ def main():
         print("Using CommUART, port: {} / baudrate: {}".format(args.port, args.baudrate))
         comm = CommUART(args.port if not args.port.isdigit() else int(args.port),
                         args.baudrate,
-                        debug=False)
+                        debug=args.debug)
     else:
         raise NotImplementedError