From e9ef11620f05a646fe0fb4c8c1a246d42ea51459 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sat, 2 May 2015 16:15:58 +0200 Subject: [PATCH] liteusb/frontend/wishbone: use new packetized mode (allow grouping response in a single packet) --- misoclib/com/liteusb/frontend/wishbone.py | 7 +------ misoclib/com/liteusb/software/ftdi/__init__.py | 9 +++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/misoclib/com/liteusb/frontend/wishbone.py b/misoclib/com/liteusb/frontend/wishbone.py index 8b4d4dc18..c2c00d30c 100644 --- a/misoclib/com/liteusb/frontend/wishbone.py +++ b/misoclib/com/liteusb/frontend/wishbone.py @@ -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) diff --git a/misoclib/com/liteusb/software/ftdi/__init__.py b/misoclib/com/liteusb/software/ftdi/__init__.py index 17e60b408..006868fed 100644 --- a/misoclib/com/liteusb/software/ftdi/__init__.py +++ b/misoclib/com/liteusb/software/ftdi/__init__.py @@ -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