From cec248ceaa2d1891da51195f7319aaa466f297c0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 9 Apr 2021 00:02:24 +0100 Subject: [PATCH] if no wb stall assume single-cycle mode --- c4m/nmigen/jtag/tap.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/c4m/nmigen/jtag/tap.py b/c4m/nmigen/jtag/tap.py index 4be9557..caf2ce4 100755 --- a/c4m/nmigen/jtag/tap.py +++ b/c4m/nmigen/jtag/tap.py @@ -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")), ] -- 2.30.2