litescope/frontend/wishbone: add support for packetized mode
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 2 May 2015 14:15:08 +0000 (16:15 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Sat, 2 May 2015 14:22:43 +0000 (16:22 +0200)
misoclib/tools/litescope/frontend/wishbone.py

index 7937498f58727325721ce04fbe3be5426c247b47..e7e00660192c77fd2757d6c8f646199c7bb0132e 100644 (file)
@@ -139,3 +139,11 @@ class LiteScopeWishboneBridge(Module):
                 )
             )
         )
+
+        if phy.sink.description.packetized:
+            self.comb += [
+                phy.sink.sop.eq((byte_counter.value == 0) & (word_counter.value == 0)),
+                phy.sink.eop.eq((byte_counter.value == 3) & (word_counter.value == (length-1)))
+            ]
+            if hasattr(phy.sink, "length"):
+                self.comb += phy.sink.length.eq(4*length)