tty working
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 22 Feb 2015 14:23:55 +0000 (15:23 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sun, 22 Feb 2015 14:23:55 +0000 (15:23 +0100)
liteeth/generic/packetizer.py
test/config.py
test/test_tty.py

index d15b8515b5117b238843401479288a8707297299..418da8146dcdedf07db84a97e973523425f29953 100644 (file)
@@ -67,7 +67,7 @@ class LiteEthPacketizer(Module):
                        fsm.act("SEND_HEADER",
                                source.stb.eq(1),
                                source.sop.eq(0),
-                               source.eop.eq(sink.eop & (counter.value == header_words-2)),
+                               source.eop.eq(0),
                                source.data.eq(header_reg[dw:2*dw]),
                                If(source.stb & source.ack,
                                        shift.eq(1),
index 60687bf3ceee58a3feda0c6807930daeab27c91b..fc4a2f6ec9f755b05177951effc5920b17b94545 100644 (file)
@@ -1,5 +1,5 @@
-use_uart = 0
-use_eth = 1
+use_uart = 1
+use_eth = 0
 
 csr_csv_file = "./csr.csv"
 busword = 32
@@ -7,7 +7,7 @@ debug_wb = False
 
 if use_uart:
        from litescope.host.driver.uart import LiteScopeUARTDriver
-       wb = LiteScopeUART2WBDriver(2, 921600, csr_csv_file, busword, debug_wb)
+       wb = LiteScopeUARTDriver(2, 921600, csr_csv_file, busword, debug_wb)
 
 if use_eth:
        from litescope.host.driver.etherbone import LiteScopeEtherboneDriver
index af0e5d087392546b32aa92f24b3c51f261ea023b..132b72f040f1d72ff4d25c0ec7102bdda8f520a1 100644 (file)
@@ -1,20 +1,20 @@
 import socket
 import threading
 
-test_message = "LiteEth virtual TTY Hello world"
-
 def test(fpga_ip, udp_port, test_message):
        tx_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        rx_sock  = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        rx_sock.bind(("", udp_port))
+       rx_sock.settimeout(0.5)
 
        def receive():
-               data, addr = rx_sock.recvfrom(8192)
-               rx_packet = []
-               for byte in data:
-                       rx_packet.append(int(byte))
-               for e in rx_packet:
-                       print(chr(e))
+               while True:
+                       try:
+                               msg = rx_sock.recv(8192)
+                               for byte in msg:
+                                       print(chr(byte), end="")
+                       except:
+                               break
 
        def send():
                tx_sock.sendto(bytes(test_message, "utf-8"), (fpga_ip, udp_port))
@@ -26,8 +26,8 @@ def test(fpga_ip, udp_port, test_message):
        send_thread.start()
 
        try:
-               send_thread.join(10)
-               receive_thread.join(0.1)
+               send_thread.join(5)
+               send_thread.join(5)
        except KeyboardInterrupt:
                pass