From: Jean THOMAS Date: Mon, 13 Jul 2020 09:18:16 +0000 (+0200) Subject: Fix FakePHY bank emulation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd9252889a17310191a2375e34c60241e9c5f660;p=gram.git Fix FakePHY bank emulation --- diff --git a/gram/phy/fakephy.py b/gram/phy/fakephy.py index 7da5447..3d11371 100644 --- a/gram/phy/fakephy.py +++ b/gram/phy/fakephy.py @@ -74,7 +74,7 @@ class BankModel(Elaboratable): ] bank_mem_len = nrows*ncols//(burst_length*self.nphases) - mem = Memory(width=data_width, depth=100, init=init) + mem = Memory(width=data_width, depth=1024, init=init) write_port = mem.write_port(granularity=we_granularity) read_port = mem.read_port(domain="comb") m.submodules += read_port, write_port @@ -83,13 +83,13 @@ class BankModel(Elaboratable): rdaddr = Signal(range(bank_mem_len)) m.d.comb += [ - wraddr.eq((row*ncols | self.write_col)[log2_int(burst_length*self.nphases):] % 100), - rdaddr.eq((row*ncols | self.read_col)[log2_int(burst_length*self.nphases):] % 100), + wraddr.eq((row*ncols | self.write_col)[log2_int(burst_length*self.nphases):] % mem.depth), + rdaddr.eq((row*ncols | self.read_col)[log2_int(burst_length*self.nphases):] % mem.depth), ] with m.If(active): m.d.comb += [ - write_port.addr.eq(wraddr % 100), + write_port.addr.eq(wraddr), write_port.data.eq(self.write_data), ]