liteusb/frontend/wishbone: use new packetized mode (allow grouping response in a single packet)
This commit is contained in:
parent
1761bfba8a
commit
e9ef11620f
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue