From: Luke Kenneth Casson Leighton Date: Sat, 4 Dec 2021 15:27:42 +0000 (+0000) Subject: wark-wark, broke mmu with removing rin. reverted X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7c343ba7890b4d680da95ef99b3b781d2709740;p=soc.git wark-wark, broke mmu with removing rin. reverted --- diff --git a/src/soc/experiment/mmu.py b/src/soc/experiment/mmu.py index ba2e62ee..981fc841 100644 --- a/src/soc/experiment/mmu.py +++ b/src/soc/experiment/mmu.py @@ -306,19 +306,19 @@ class MMU(Elaboratable): with m.Else(): comb += v.state.eq(State.RADIX_LOOKUP) - def mmu_0(self, m, r, v, l_in, l_out, d_out, addrsh, mask): + def mmu_0(self, m, r, rin, l_in, l_out, d_out, addrsh, mask): comb = m.d.comb sync = m.d.sync # Multiplex internal SPR values back to loadstore1, - # selected by l_in.sprn. only partial SPR identification needed + # selected by l_in.sprn. with m.If(l_in.sprn[9]): - comb += l_out.sprval.eq(v.prtbl) + comb += l_out.sprval.eq(r.prtbl) with m.Else(): - comb += l_out.sprval.eq(v.pid) + comb += l_out.sprval.eq(r.pid) - with m.If(v.valid): - sync += Display("MMU got tlb miss for %x", v.addr) + with m.If(rin.valid): + sync += Display("MMU got tlb miss for %x", rin.addr) with m.If(l_out.done): sync += Display("MMU completing op without error") @@ -327,13 +327,14 @@ class MMU(Elaboratable): sync += Display("MMU completing op with err invalid=" "%d badtree=%d", l_out.invalid, l_out.badtree) - with m.If(v.state == State.RADIX_LOOKUP): + with m.If(rin.state == State.RADIX_LOOKUP): sync += Display ("radix lookup shift=%d msize=%d", - v.shift, v.mask_size) + rin.shift, rin.mask_size) with m.If(r.state == State.RADIX_LOOKUP): sync += Display(f"send load addr=%x addrsh=%d mask=%x", d_out.addr, addrsh, mask) + sync += r.eq(rin) def elaborate(self, platform): m = Module() @@ -345,9 +346,8 @@ class MMU(Elaboratable): mask = Signal(16) finalmask = Signal(44) - # register and internal input. self.v only accessible for test purposes + self.rin = rin = RegStage("r_in") r = RegStage("r") - self.v = v = RegStage() l_in = self.l_in l_out = self.l_out @@ -355,8 +355,9 @@ class MMU(Elaboratable): d_in = self.d_in i_out = self.i_out - self.mmu_0(m, r, v, l_in, l_out, d_out, addrsh, mask) + self.mmu_0(m, r, rin, l_in, l_out, d_out, addrsh, mask) + v = RegStage() dcreq = Signal() tlb_load = Signal() itlb_load = Signal() @@ -488,7 +489,7 @@ class MMU(Elaboratable): comb += pte.eq(Cat(r.pde[0:12], pd44)) # update registers - sync += r.eq(v) + comb += rin.eq(v) # drive outputs with m.If(tlbie_req): @@ -611,7 +612,7 @@ def mmu_sim(dut): yield dut.l_in.rs.eq(0) yield - prtbl = yield (dut.v.prtbl) + prtbl = yield (dut.rin.prtbl) print ("prtbl after MTSPR %x" % prtbl) assert prtbl == 0x1000000