From 9ee6c35b42be6eadcf9fdd3c4497e1523900f802 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sat, 20 Apr 2019 10:44:53 +0200 Subject: [PATCH] tools: move from litex.soc.tools to litex.tools and fix usb.core import --- litex/__init__.py | 2 +- litex/soc/software/bios/Makefile | 4 ++-- litex/soc/{tools => software}/mkmscimg.py | 0 litex/soc/tools/remote/__init__.py | 5 ----- litex/{utils => tools}/__init__.py | 0 litex/{soc/tools/remote => tools}/litex_client.py | 8 ++++---- litex/{utils => tools}/litex_read_verilog.py | 0 litex/{utils => tools}/litex_server.py | 12 ++++++------ litex/{utils => tools}/litex_sim.py | 0 litex/{utils => tools}/litex_term.py | 0 litex/{soc/tools => tools/remote}/__init__.py | 0 litex/{soc => }/tools/remote/comm_pcie.py | 0 litex/{soc => }/tools/remote/comm_uart.py | 0 litex/{soc => }/tools/remote/comm_udp.py | 4 ++-- litex/{soc => }/tools/remote/comm_usb.py | 0 litex/{soc => }/tools/remote/csr_builder.py | 0 litex/{soc => }/tools/remote/etherbone.py | 0 setup.py | 9 ++++----- 18 files changed, 19 insertions(+), 25 deletions(-) rename litex/soc/{tools => software}/mkmscimg.py (100%) delete mode 100644 litex/soc/tools/remote/__init__.py rename litex/{utils => tools}/__init__.py (100%) rename litex/{soc/tools/remote => tools}/litex_client.py (88%) rename litex/{utils => tools}/litex_read_verilog.py (100%) rename litex/{utils => tools}/litex_server.py (94%) rename litex/{utils => tools}/litex_sim.py (100%) rename litex/{utils => tools}/litex_term.py (100%) rename litex/{soc/tools => tools/remote}/__init__.py (100%) rename litex/{soc => }/tools/remote/comm_pcie.py (100%) rename litex/{soc => }/tools/remote/comm_uart.py (100%) rename litex/{soc => }/tools/remote/comm_udp.py (92%) rename litex/{soc => }/tools/remote/comm_usb.py (100%) rename litex/{soc => }/tools/remote/csr_builder.py (100%) rename litex/{soc => }/tools/remote/etherbone.py (100%) diff --git a/litex/__init__.py b/litex/__init__.py index c489b99c..19eec2b3 100644 --- a/litex/__init__.py +++ b/litex/__init__.py @@ -1 +1 @@ -from litex.soc.tools.remote import RemoteClient +from litex.tools.litex_client import RemoteClient \ No newline at end of file diff --git a/litex/soc/software/bios/Makefile b/litex/soc/software/bios/Makefile index 534c09db..a454a17e 100755 --- a/litex/soc/software/bios/Makefile +++ b/litex/soc/software/bios/Makefile @@ -16,9 +16,9 @@ ifneq ($(OS),Windows_NT) chmod -x $@ endif ifeq ($(CPUENDIANNESS),little) - $(PYTHON) -m litex.soc.tools.mkmscimg $@ --little + $(PYTHON) -m litex.soc.software.mkmscimg $@ --little else - $(PYTHON) -m litex.soc.tools.mkmscimg $@ + $(PYTHON) -m litex.soc.software.mkmscimg $@ endif bios.elf: $(BIOS_DIRECTORY)/linker.ld $(OBJECTS) diff --git a/litex/soc/tools/mkmscimg.py b/litex/soc/software/mkmscimg.py similarity index 100% rename from litex/soc/tools/mkmscimg.py rename to litex/soc/software/mkmscimg.py diff --git a/litex/soc/tools/remote/__init__.py b/litex/soc/tools/remote/__init__.py deleted file mode 100644 index d61f3888..00000000 --- a/litex/soc/tools/remote/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from litex.soc.tools.remote.comm_uart import CommUART -from litex.soc.tools.remote.comm_udp import CommUDP -from litex.soc.tools.remote.comm_pcie import CommPCIe -from litex.soc.tools.remote.comm_usb import CommUSB -from litex.soc.tools.remote.litex_client import RemoteClient diff --git a/litex/utils/__init__.py b/litex/tools/__init__.py similarity index 100% rename from litex/utils/__init__.py rename to litex/tools/__init__.py diff --git a/litex/soc/tools/remote/litex_client.py b/litex/tools/litex_client.py similarity index 88% rename from litex/soc/tools/remote/litex_client.py rename to litex/tools/litex_client.py index bddbbe7f..c9e0d43e 100644 --- a/litex/soc/tools/remote/litex_client.py +++ b/litex/tools/litex_client.py @@ -1,9 +1,9 @@ import socket -from litex.soc.tools.remote.etherbone import EtherbonePacket, EtherboneRecord -from litex.soc.tools.remote.etherbone import EtherboneReads, EtherboneWrites -from litex.soc.tools.remote.etherbone import EtherboneIPC -from litex.soc.tools.remote.csr_builder import CSRBuilder +from litex.tools.remote.etherbone import EtherbonePacket, EtherboneRecord +from litex.tools.remote.etherbone import EtherboneReads, EtherboneWrites +from litex.tools.remote.etherbone import EtherboneIPC +from litex.tools.remote.csr_builder import CSRBuilder class RemoteClient(EtherboneIPC, CSRBuilder): diff --git a/litex/utils/litex_read_verilog.py b/litex/tools/litex_read_verilog.py similarity index 100% rename from litex/utils/litex_read_verilog.py rename to litex/tools/litex_read_verilog.py diff --git a/litex/utils/litex_server.py b/litex/tools/litex_server.py similarity index 94% rename from litex/utils/litex_server.py rename to litex/tools/litex_server.py index 49101225..702f0349 100755 --- a/litex/utils/litex_server.py +++ b/litex/tools/litex_server.py @@ -7,8 +7,8 @@ import socket import time import threading -from litex.soc.tools.remote.etherbone import EtherbonePacket, EtherboneRecord, EtherboneWrites -from litex.soc.tools.remote.etherbone import EtherboneIPC +from litex.tools.remote.etherbone import EtherbonePacket, EtherboneRecord, EtherboneWrites +from litex.tools.remote.etherbone import EtherboneIPC class RemoteServer(EtherboneIPC): @@ -136,7 +136,7 @@ def main(): if args.uart: - from litex.soc.tools.remote import CommUART + from litex.tools.remote import CommUART if args.uart_port is None: print("Need to specify --uart-port, exiting.") exit() @@ -145,13 +145,13 @@ def main(): print("[CommUART] port: {} / baudrate: {} / ".format(uart_port, uart_baudrate), end="") comm = CommUART(uart_port, uart_baudrate) elif args.udp: - from litex.soc.tools.remote import CommUDP + from litex.tools.remote import CommUDP udp_ip = args.udp_ip udp_port = int(args.udp_port) print("[CommUDP] ip: {} / port: {} / ".format(udp_ip, udp_port), end="") comm = CommUDP(udp_ip, udp_port) elif args.pcie: - from litex.soc.tools.remote import CommPCIe + from litex.tools.remote import CommPCIe pcie_bar = args.pcie_bar if args.pcie_bar is None: print("Need to speficy --pcie-bar, exiting.") @@ -159,7 +159,7 @@ def main(): print("[CommPCIe] bar: {} / ".format(args.pcie_bar), end="") comm = CommPCIe(args.pcie_bar) elif args.usb: - from litex.soc.tools.remote import CommUSB + from litex.tools.remote import CommUSB if args.usb_pid is None and args.usb_vid is None: print("Need to speficy --usb-vid or --usb-pid, exiting.") exit() diff --git a/litex/utils/litex_sim.py b/litex/tools/litex_sim.py similarity index 100% rename from litex/utils/litex_sim.py rename to litex/tools/litex_sim.py diff --git a/litex/utils/litex_term.py b/litex/tools/litex_term.py similarity index 100% rename from litex/utils/litex_term.py rename to litex/tools/litex_term.py diff --git a/litex/soc/tools/__init__.py b/litex/tools/remote/__init__.py similarity index 100% rename from litex/soc/tools/__init__.py rename to litex/tools/remote/__init__.py diff --git a/litex/soc/tools/remote/comm_pcie.py b/litex/tools/remote/comm_pcie.py similarity index 100% rename from litex/soc/tools/remote/comm_pcie.py rename to litex/tools/remote/comm_pcie.py diff --git a/litex/soc/tools/remote/comm_uart.py b/litex/tools/remote/comm_uart.py similarity index 100% rename from litex/soc/tools/remote/comm_uart.py rename to litex/tools/remote/comm_uart.py diff --git a/litex/soc/tools/remote/comm_udp.py b/litex/tools/remote/comm_udp.py similarity index 92% rename from litex/soc/tools/remote/comm_udp.py rename to litex/tools/remote/comm_udp.py index 82530c45..e938f2d7 100644 --- a/litex/soc/tools/remote/comm_udp.py +++ b/litex/tools/remote/comm_udp.py @@ -1,7 +1,7 @@ import socket -from litex.soc.tools.remote.etherbone import EtherbonePacket, EtherboneRecord -from litex.soc.tools.remote.etherbone import EtherboneReads, EtherboneWrites +from litex.tools.remote.etherbone import EtherbonePacket, EtherboneRecord +from litex.tools.remote.etherbone import EtherboneReads, EtherboneWrites class CommUDP: diff --git a/litex/soc/tools/remote/comm_usb.py b/litex/tools/remote/comm_usb.py similarity index 100% rename from litex/soc/tools/remote/comm_usb.py rename to litex/tools/remote/comm_usb.py diff --git a/litex/soc/tools/remote/csr_builder.py b/litex/tools/remote/csr_builder.py similarity index 100% rename from litex/soc/tools/remote/csr_builder.py rename to litex/tools/remote/csr_builder.py diff --git a/litex/soc/tools/remote/etherbone.py b/litex/tools/remote/etherbone.py similarity index 100% rename from litex/soc/tools/remote/etherbone.py rename to litex/tools/remote/etherbone.py diff --git a/setup.py b/setup.py index ed0dd4d3..9039037c 100755 --- a/setup.py +++ b/setup.py @@ -36,11 +36,10 @@ setup( include_package_data=True, entry_points={ "console_scripts": [ - "mkmscimg=litex.soc.tools.mkmscimg:main", - "litex_term=litex.utils.litex_term:main", - "litex_server=litex.utils.litex_server:main", - "litex_sim=litex.utils.litex_sim:main", - "litex_read_verilog=litex.utils.litex_read_verilog:main", + "litex_term=litex.tools.litex_term:main", + "litex_server=litex.tools.litex_server:main", + "litex_sim=litex.tools.litex_sim:main", + "litex_read_verilog=litex.tools.litex_read_verilog:main", "litex_simple=litex.boards.targets.simple:main", ], }, -- 2.30.2