From d2cb41bc63d363f7a4c0f26e91ca5b9c8f44d36a Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 17 Mar 2015 15:58:21 +0100 Subject: [PATCH] LiteXXX cores: convert port parameter to int if is digit in test/make.py --- misoclib/com/liteeth/example_designs/test/make.py | 3 ++- misoclib/mem/litesata/example_designs/test/make.py | 3 ++- misoclib/tools/litescope/example_designs/test/make.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/misoclib/com/liteeth/example_designs/test/make.py b/misoclib/com/liteeth/example_designs/test/make.py index 54f2ca45f..f9ccec089 100644 --- a/misoclib/com/liteeth/example_designs/test/make.py +++ b/misoclib/com/liteeth/example_designs/test/make.py @@ -18,7 +18,8 @@ if __name__ == "__main__": args = _get_args() if args.bridge == "uart": from misoclib.tools.litescope.host.driver.uart import LiteScopeUARTDriver - wb = LiteScopeUARTDriver(args.port, args.baudrate, "./csr.csv", int(args.busword), debug=False) + port = args.port if not args.port.isdigit() else int(args.port) + wb = LiteScopeUARTDriver(port, args.baudrate, "./csr.csv", int(args.busword), debug=False) elif args.bridge == "etherbone": from misoclib.tools.litescope.host.driver.etherbone import LiteScopeEtherboneDriver wb = LiteScopeEtherboneDriver(args.ip_address, int(args.udp_port), "./csr.csv", int(args.busword), debug=False) diff --git a/misoclib/mem/litesata/example_designs/test/make.py b/misoclib/mem/litesata/example_designs/test/make.py index 54f2ca45f..f9ccec089 100644 --- a/misoclib/mem/litesata/example_designs/test/make.py +++ b/misoclib/mem/litesata/example_designs/test/make.py @@ -18,7 +18,8 @@ if __name__ == "__main__": args = _get_args() if args.bridge == "uart": from misoclib.tools.litescope.host.driver.uart import LiteScopeUARTDriver - wb = LiteScopeUARTDriver(args.port, args.baudrate, "./csr.csv", int(args.busword), debug=False) + port = args.port if not args.port.isdigit() else int(args.port) + wb = LiteScopeUARTDriver(port, args.baudrate, "./csr.csv", int(args.busword), debug=False) elif args.bridge == "etherbone": from misoclib.tools.litescope.host.driver.etherbone import LiteScopeEtherboneDriver wb = LiteScopeEtherboneDriver(args.ip_address, int(args.udp_port), "./csr.csv", int(args.busword), debug=False) diff --git a/misoclib/tools/litescope/example_designs/test/make.py b/misoclib/tools/litescope/example_designs/test/make.py index 676356fec..b0a3c2bcd 100644 --- a/misoclib/tools/litescope/example_designs/test/make.py +++ b/misoclib/tools/litescope/example_designs/test/make.py @@ -18,7 +18,8 @@ if __name__ == "__main__": args = _get_args() if args.bridge == "uart": from misoclib.tools.litescope.host.driver.uart import LiteScopeUARTDriver - wb = LiteScopeUARTDriver(args.port, args.baudrate, "./csr.csv", int(args.busword), debug=False) + port = args.port if not args.port.isdigit() else int(args.port) + wb = LiteScopeUARTDriver(port, args.baudrate, "./csr.csv", int(args.busword), debug=False) elif args.bridge == "etherbone": from misoclib.tools.litescope.host.driver.etherbone import LiteScopeEtherboneDriver wb = LiteScopeEtherboneDriver(args.ip_address, int(args.udp_port), "./csr.csv", int(args.busword), debug=False)