From: Luke Kenneth Casson Leighton Date: Sat, 1 May 2021 12:13:00 +0000 (+0100) Subject: resolve DriverConflict in TstL0CacheBuffer, really bad hack X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ceeae21057efb07fb315cfbaedb18545f5b0a558;p=soc.git resolve DriverConflict in TstL0CacheBuffer, really bad hack --- diff --git a/src/soc/experiment/l0_cache.py b/src/soc/experiment/l0_cache.py index e4f02513..43bee1e9 100644 --- a/src/soc/experiment/l0_cache.py +++ b/src/soc/experiment/l0_cache.py @@ -309,6 +309,7 @@ class L0CacheBuffer(Elaboratable): class TstL0CacheBuffer(Elaboratable): def __init__(self, pspec, n_units=3): + self.pspec = pspec regwid = pspec.reg_wid addrwid = pspec.addr_wid self.cmpi = ConfigMemoryPortInterface(pspec) @@ -319,8 +320,18 @@ class TstL0CacheBuffer(Elaboratable): m = Module() m.submodules.pimem = self.pimem m.submodules.l0 = self.l0 - if hasattr(self.cmpi, 'lsmem'): # hmmm not happy about this - m.submodules.lsmem = self.cmpi.lsmem.lsi + + if not hasattr(self.cmpi, 'lsmem'): + return m + + # really bad hack, the LoadStore1 classes already have the + # lsi (LoadStoreInterface) as a submodule. + if pspec.ldst_ifacetype in ['mmu_cache_wb', 'test_mmu_cache_wb']: + return m + + # hmmm not happy about this - should not be digging down and + # putting modules in + m.submodules.lsmem = self.cmpi.lsmem.lsi return m