single-cycle mode fix on wb "wen" signal, must hold fully until ACKed
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 16 Apr 2021 22:47:15 +0000 (23:47 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 16 Apr 2021 22:47:15 +0000 (23:47 +0100)
c4m/nmigen/jtag/tap.py

index 5743363a5b8bc5ba007249f4c764f0742f71c844..09da1fb8f7e7f0b8f8857962a436c241272fad09 100755 (executable)
@@ -789,6 +789,7 @@ class TAP(Elaboratable):
                 if hasattr(wb, "stall"):
                     m.d.comb += wb.stb.eq(fsm.ongoing("READ") |
                                           fsm.ongoing("WRITEREAD"))
+                    m.d.comb += wb.we.eq(fsm.ongoing("WRITEREAD"))
                 else:
                     # non-stall is single-cycle (litex), must assert stb
                     # until ack is sent
@@ -796,7 +797,6 @@ class TAP(Elaboratable):
                                           fsm.ongoing("WRITEREAD") |
                                           fsm.ongoing("READACK") |
                                           fsm.ongoing("WRITEREADACK"))
-                m.d.comb += [
-                    wb.cyc.eq(~fsm.ongoing("IDLE")),
-                    wb.we.eq(fsm.ongoing("WRITEREAD")),
-                ]
+                    m.d.comb += wb.we.eq(fsm.ongoing("WRITEREAD") |
+                                         fsm.ongoing("WRITEREADACK"))
+                m.d.comb += wb.cyc.eq(~fsm.ongoing("IDLE"))