if no wb stall assume single-cycle mode
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 8 Apr 2021 23:02:24 +0000 (00:02 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 8 Apr 2021 23:02:24 +0000 (00:02 +0100)
c4m/nmigen/jtag/tap.py

index fe6e26b7285125d71fde0e5f9c5e033c6881011f..dff63ac989de9f1d5b23419ee6388815af9ebc60 100755 (executable)
@@ -786,8 +786,17 @@ class TAP(Elaboratable):
                         m.d[domain] += wb.adr.eq(wb.adr + 1)
                         m.next = "READ"
 
+                if hasattr(wb, "stall"):
+                    m.d.comb += wb.stb.eq(fsm.ongoing("READ") |
+                                          fsm.ongoing("WRITEREAD"))
+                else:
+                    # non-stall is single-cycle (litex), must assert stb
+                    # until ack is sent
+                    m.d.comb += wb.stb.eq(fsm.ongoing("READ") |
+                                          fsm.ongoing("WRITEREAD") |
+                                          fsm.ongoing("READACK") |
+                                          fsm.ongoing("WRITEREADACK"))
                 m.d.comb += [
                     wb.cyc.eq(~fsm.ongoing("IDLE")),
-                    wb.stb.eq(fsm.ongoing("READ") | fsm.ongoing("WRITEREAD")),
                     wb.we.eq(fsm.ongoing("WRITEREAD")),
                 ]