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)
committerStaf Verhaegen <staf@stafverhaegen.be>
Thu, 22 Apr 2021 09:15:53 +0000 (11:15 +0200)
c4m/nmigen/jtag/tap.py

index 19902dc4768e8e51d19936e9294088e33388e99c..a72c89a0956f25b41e9fb10ed088f3844afd0b84 100755 (executable)
@@ -794,6 +794,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
@@ -801,7 +802,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"))