experimenting with ld/st comp unit
[soc.git] / src / soc / experiment / testmem.py
1 from nmigen import Module, Elaboratable, Memory
2
3
4 class TestMemory(Elaboratable):
5 def __init__(self, regwid, addrw):
6 self.ddepth = 1 # regwid //8
7 depth = (1<<addrw) // self.ddepth
8 self.mem = Memory(width=regwid, depth=depth,
9 init=range(0, depth*2, 2))
10 self.rdport = self.mem.read_port() # not now transparent=False)
11 self.wrport = self.mem.write_port()
12
13 def elaborate(self, platform):
14 m = Module()
15 m.submodules.rdport = self.rdport
16 m.submodules.wrport = self.wrport
17 return m