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")
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()
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
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()
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):
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