liteusb/frontend/wishbone: use new packetized mode (allow grouping response in a...
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 2 May 2015 14:15:58 +0000 (16:15 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 2 May 2015 14:22:45 +0000 (16:22 +0200)
misoclib/com/liteusb/frontend/wishbone.py
misoclib/com/liteusb/software/ftdi/__init__.py

index 8b4d4dc1816962a9b0aec0375f49f815fbba1536..c2c00d30cb00838d789ccb73a23266b90dba5fa9 100644 (file)
@@ -6,9 +6,4 @@ from misoclib.tools.litescope.frontend.wishbone import LiteScopeWishboneBridge
 class LiteUSBWishboneBridge(LiteScopeWishboneBridge):
     def __init__(self, port, clk_freq):
         LiteScopeWishboneBridge.__init__(self, port, clk_freq)
-        self.comb += [
-            port.sink.sop.eq(1),
-            port.sink.eop.eq(1),
-            port.sink.length.eq(1),
-            port.sink.dst.eq(port.tag)
-        ]
+        self.comb += port.sink.dst.eq(port.tag)
index 17e60b408ca7580f6b6d8de4ac7c16cd4f0e0e64..006868fed212cfb8734681ce59cb3bcfe7e978e2 100644 (file)
@@ -179,10 +179,15 @@ class UART:
             self.q = queue.Queue()
 
         def get_packet_size(self, buf):
-            return 10
+            payload_size = buf[5] << 24
+            payload_size |= buf[6] << 16
+            payload_size |= buf[7] << 8
+            payload_size |= buf[8] << 0
+            return 9 + payload_size
 
         def consume(self, buf):
-            self.q.put(buf[9])
+            for value in buf[9:]:
+                self.q.put(value)
 
     def __init__(self, tag):
         self.tag = tag