From 34b007434a2fa5d46c678883289ab17dc88363a0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 17 Jul 2020 20:18:23 +0100 Subject: [PATCH] =?utf8?q?forward-port=20minerva=20loadstore=20bugfix=20co?= =?utf8?q?mmit=20a03a72e04764dc976d85ea44b1cf0767e240b81f=20Author:=20Jean?= =?utf8?q?-Fran=C3=A7ois=20Nguyen=20=20Date:=20=20?= =?utf8?q?=20Thu=20Apr=2030=2012:23:36=202020=20+0200?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit loadstore: fix conflict between write buffer and dcache refill. --- src/soc/minerva/units/loadstore.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/soc/minerva/units/loadstore.py b/src/soc/minerva/units/loadstore.py index f3ca09d7..a4d76d19 100644 --- a/src/soc/minerva/units/loadstore.py +++ b/src/soc/minerva/units/loadstore.py @@ -184,22 +184,21 @@ class CachedLoadStoreUnit(LoadStoreUnitInterface, Elaboratable): m.d.comb += dba.bus.connect(self.dbus) wrbuf_port = dbus_arbiter.port(priority=0) - with m.If(wrbuf_port.cyc): + m.d.comb += [ + wrbuf_port.cyc.eq(wrbuf.r_rdy), + wrbuf_port.we.eq(Const(1)), + ] + with m.If(wrbuf_port.stb): with m.If(wrbuf_port.ack | wrbuf_port.err): - m.d.sync += [ - wrbuf_port.cyc.eq(0), - wrbuf_port.stb.eq(0) - ] + m.d.sync += wrbuf_port.stb.eq(0) m.d.comb += wrbuf.r_en.eq(1) with m.Elif(wrbuf.r_rdy): m.d.sync += [ - wrbuf_port.cyc.eq(1), wrbuf_port.stb.eq(1), wrbuf_port.adr.eq(wrbuf_r_data.addr), wrbuf_port.sel.eq(wrbuf_r_data.mask), wrbuf_port.dat_w.eq(wrbuf_r_data.data) ] - m.d.comb += wrbuf_port.we.eq(Const(1)) dcache_port = dba.port(priority=1) cti = Mux(dcache.bus_last, Cycle.END, Cycle.INCREMENT) -- 2.30.2