return
# suite of PLRUs with a selection and output mechanism
- tlb_plrus = PLRUs(self.TLB_SET_SIZE, self.TLB_WAY_BITS)
+ tlb_plrus = PLRUs("d_tlb", self.TLB_SET_SIZE, self.TLB_WAY_BITS)
m.submodules.tlb_plrus = tlb_plrus
comb += tlb_plrus.way.eq(r1.tlb_hit.way)
comb += tlb_plrus.valid.eq(r1.tlb_hit.valid)
return
# suite of PLRUs with a selection and output mechanism
- m.submodules.plrus = plrus = PLRUs(self.NUM_LINES, self.WAY_BITS)
+ m.submodules.plrus = plrus = PLRUs("dtag", self.NUM_LINES,
+ self.WAY_BITS)
comb += plrus.way.eq(r1.hit_way)
comb += plrus.valid.eq(r1.cache_hit)
comb += plrus.index.eq(r1.hit_index)
return
- m.submodules.plrus = plru = PLRUs(self.NUM_LINES, self.WAY_BITS)
+ m.submodules.plrus = plru = PLRUs("itag", self.NUM_LINES,
+ self.WAY_BITS)
comb += plru.way.eq(r.hit_way)
comb += plru.valid.eq(r.hit_valid)
comb += plru.index.eq(self.get_index(r.hit_nia))
class PLRUs(Elaboratable):
- def __init__(self, n_plrus, n_bits):
+ def __init__(self, cachetype, n_plrus, n_bits):
+ self.cachetype = cachetype
self.n_plrus = n_plrus
self.n_bits = n_bits
self.valid = Signal()
for i in range(self.n_plrus):
# PLRU interface
- m.submodules["plru_%d" % i] = plru = PLRU(self.n_bits)
+ name = "%s_plru_%d" % (self.cachetype, i)
+ m.submodules[name] = plru = PLRU(self.n_bits)
comb += plru.acc_en.eq(te.o[i])
comb += plru.acc_i.eq(self.way)
f.write(vl)
- dut = PLRUs(4, 2)
+ dut = PLRUs("testing", 4, 2)
vl = rtlil.convert(dut, ports=dut.ports())
with open("test_plrus.il", "w") as f:
f.write(vl)