From: Florent Kermarrec Date: Wed, 27 May 2020 06:59:12 +0000 (+0200) Subject: tools/litex_jtag_uart: add openocd config and telnet port parameters. X-Git-Tag: 24jan2021_ls180~288 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3b47d4a4790f60bf918cbaa5aac99af201b88e0b;p=litex.git tools/litex_jtag_uart: add openocd config and telnet port parameters. --- diff --git a/litex/tools/litex_jtag_uart.py b/litex/tools/litex_jtag_uart.py index 715a5ef3..4be16fd3 100755 --- a/litex/tools/litex_jtag_uart.py +++ b/litex/tools/litex_jtag_uart.py @@ -10,14 +10,18 @@ import pty import threading import telnetlib import time +import argparse from litex.build.openocd import OpenOCD -telnet_port = 20000 +parser = argparse.ArgumentParser(description="LiteX JTAG UART bridge tool") +parser.add_argument("--config", default="openocd_xc7_ft2232.cfg", help="OpenOCD config file") +parser.add_argument("--telnet-port", default="20000", help="OpenOCD telnet port") +args = parser.parse_args() def openocd_jtag_telnet(): - prog = OpenOCD("openocd_xc7_ft2232.cfg") - prog.stream(telnet_port) + prog = OpenOCD(args.config) + prog.stream(int(args.telnet_port)) m, s = pty.openpty() print("LiteX JTAG UART created: {}".format(os.ttyname(s))) @@ -27,7 +31,7 @@ openocd_jtag_telnet_thread.start() time.sleep(1) -t = telnetlib.Telnet("localhost", telnet_port) +t = telnetlib.Telnet("localhost", int(args.telnet_port)) def pty2telnet(m): while True: