From: Tobias Platen Date: Thu, 20 Aug 2020 18:47:39 +0000 (+0200) Subject: start wiring TestCachedMemoryPortInterface X-Git-Tag: semi_working_ecp5~288^2~3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2e80a1ff77c59151ce0ba7ce3739636644e1bcc;p=soc.git start wiring TestCachedMemoryPortInterface --- diff --git a/src/soc/experiment/test/test_l0_cache_buffer2.py b/src/soc/experiment/test/test_l0_cache_buffer2.py index 3a17749f..35473078 100644 --- a/src/soc/experiment/test/test_l0_cache_buffer2.py +++ b/src/soc/experiment/test/test_l0_cache_buffer2.py @@ -3,7 +3,7 @@ test cases for LDSTSplitter and L0CacheBuffer2 """ from soc.experiment.l0_cache import L0CacheBuffer2 -from nmigen import Module +from nmigen import Module, Signal, Mux, Elaboratable, Cat, Const from nmigen.cli import rtlil from soc.scoreboard.addr_split import LDSTSplitter from soc.scoreboard.addr_match import LenExpand @@ -18,20 +18,22 @@ class TestCachedMemoryPortInterface(PortInterfaceBase): """TestCacheMemoryPortInterface This is a test class for simple verification of LDSTSplitter - conforming to PortInterface, + conforming to PortInterface """ def __init__(self, regwid=64, addrwid=4): super().__init__(regwid, addrwid) - #self.ldst = LDSTSplitter() + self.ldst = LDSTSplitter(32, 48, 4) + + # TODO implement these def set_wr_addr(self, m, addr, mask): lsbaddr, msbaddr = self.splitaddr(addr) - #m.d.comb += self.mem.wrport.addr.eq(msbaddr) + #m.d.comb += self.ldst... ### .eq(msbaddr) def set_rd_addr(self, m, addr, mask): lsbaddr, msbaddr = self.splitaddr(addr) - #m.d.comb += self.mem.rdport.addr.eq(msbaddr) + #m.d.comb += self..eq(msbaddr) def set_wr_data(self, m, data, wen): #m.d.comb += self.mem.wrport.data.eq(data) # write st to mem @@ -39,8 +41,7 @@ class TestCachedMemoryPortInterface(PortInterfaceBase): return Const(1, 1) #document return value def get_rd_data(self, m): - #return self.mem.rdport.data, Const(1, 1) - return None + return self.ldst.ld_data_o.data, Const(1, 1) def elaborate(self, platform): m = super().elaborate(platform) diff --git a/src/soc/scoreboard/addr_split.py b/src/soc/scoreboard/addr_split.py index 4a957338..3d197f2e 100644 --- a/src/soc/scoreboard/addr_split.py +++ b/src/soc/scoreboard/addr_split.py @@ -6,7 +6,7 @@ Links: * http://bugs.libre-riscv.org/show_bug.cgi?id=216 """ -from soc.experiment.pimem import PortInterface +#from soc.experiment.pimem import PortInterface from nmigen import Elaboratable, Module, Signal, Record, Array, Const, Cat from nmutil.latch import SRLatch, latchregister @@ -80,19 +80,14 @@ class LDSTSplitter(Elaboratable): # cline_wid = 8<