m = super().elaborate(platform)
comb = m.d.comb
# small 16-entry Memory
- memory = Memory(width=self.data_wid, depth=16)
+ self.mem = memory = Memory(width=self.data_wid, depth=16)
m.submodules.sram = sram = SRAM(memory=memory, granularity=8,
features={'cti', 'bte', 'err'})
dbus = self.dbus
res[i] = inp[wrop]
return res
+def get_l0_mem(l0): # BLECH!
+ if hasattr(l0.pimem, 'lsui'):
+ return l0.pimem.lsui.mem
+ return l0.pimem.mem.mem
+
def setup_test_memory(l0, sim):
- mem = l0.pimem.mem.mem
+ mem = get_l0_mem(l0)
print ("before, init mem", mem.depth, mem.width, mem)
for i in range(mem.depth):
data = sim.mem.ld(i*8, 8, False)
def check_sim_memory(dut, l0, sim, code):
- mem = l0.pimem.mem.mem
+ mem = get_l0_mem(l0)
print ("sim mem dump")
for k, v in sim.mem.mem.items():
print (" %6x %016x" % (k, v))
from soc.experiment.l0_cache import TstL0CacheBuffer
m.submodules.l0 = l0 = TstL0CacheBuffer(n_units=1, regwid=64,
addrwid=3,
- ifacetype='test_bare_wb')
+ ifacetype='testpi')
pi = l0.l0.dports[0]
m.submodules.cu = cu = self.fukls(pi, awid=3)
m.d.comb += cu.ad.go.eq(cu.ad.rel) # link addr-go direct to rel