"""
from soc.experiment.imem import TestMemFetchUnit
from soc.bus.test.test_minerva import TestSRAMBareFetchUnit
+from soc.minerva.units.fetch import BareFetchUnit
class ConfigFetchUnit:
def __init__(self, pspec):
fudict = {'testmem': TestMemFetchUnit,
'test_bare_wb': TestSRAMBareFetchUnit,
+ 'bare_wb': BareFetchUnit,
#'test_cache_wb': TestCacheFetchUnit
}
fukls = fudict[pspec.imem_ifacetype]
from soc.bus.test.test_minerva import TestSRAMBareLoadStoreUnit
from soc.experiment.pi2ls import Pi2LSUI
from soc.experiment.pimem import TestMemoryPortInterface
+from soc.minerva.units.loadstore import BareLoadStoreUnit
class ConfigLoadStoreUnit:
def __init__(self, pspec):
lsidict = {'testmem': TestMemLoadStoreUnit,
'test_bare_wb': TestSRAMBareLoadStoreUnit,
+ 'bare_wb': BareLoadStoreUnit,
#'test_cache_wb': TestCacheLoadStoreUnit
}
lsikls = lsidict[pspec.ldst_ifacetype]
class ConfigMemoryPortInterface:
def __init__(self, pspec):
+ self.pspec = pspec
if pspec.ldst_ifacetype == 'testpi':
self.pi = TestMemoryPortInterface(addrwid=pspec.addr_wid, # adr bus
regwid=pspec.reg_wid) # data bus
addr_wid=pspec.addr_wid, # address range
mask_wid=pspec.mask_wid, # cache line range
data_wid=pspec.reg_wid) # data bus width
+
+ def ports(self):
+ if self.pspec.ldst_ifacetype == 'testpi':
+ return self.pi.ports()
+ return list(self.pi.ports()) + self.lsmem.lsi.ports()
return m
def ports(self):
+ yield from self.cmpi.ports()
yield from self.l0.ports()
- yield from self.pimem
+ yield from self.pimem.ports()
def wait_busy(port, no=False):
return m
def ports(self):
- for p in self.dports:
- yield from p.ports()
+ yield from self.pi.ports()
class TestMemoryPortInterface(PortInterfaceBase):
self.f_fetch_err_o = Signal()
self.f_badaddr_o = Signal(bad_wid)
+ def __iter__(self):
+ yield self.a_pc_i
+ yield self.a_stall_i
+ yield self.a_valid_i
+ yield self.f_stall_i
+ yield self.f_valid_i
+ yield self.a_busy_o
+ yield self.f_busy_o
+ yield self.f_instr_o
+ yield self.f_fetch_err_o
+ yield self.f_badaddr_o
+ for sig in self.ibus.fields.values():
+ yield sig
+
+ def ports(self):
+ return list(self)
+
class BareFetchUnit(FetchUnitInterface, Elaboratable):
def elaborate(self, platform):
self.m_store_err_o = Signal() # if there was an error when storing
self.m_badaddr_o = Signal(badwid) # The address of the load/store error
+ def __iter__(self):
+ yield self.x_addr_i
+ yield self.x_mask_i
+ yield self.x_ld_i
+ yield self.x_st_i
+ yield self.x_st_data_i
+
+ yield self.x_stall_i
+ yield self.x_valid_i
+ yield self.m_stall_i
+ yield self.m_valid_i
+ yield self.x_busy_o
+ yield self.m_busy_o
+ yield self.m_ld_data_o
+ yield self.m_load_err_o
+ yield self.m_store_err_o
+ yield self.m_badaddr_o
+ for sig in self.dbus.fields.values():
+ yield sig
+
+ def ports(self):
+ return list(self)
+
class BareLoadStoreUnit(LoadStoreUnitInterface, Elaboratable):
def elaborate(self, platform):
def __iter__(self):
yield from self.fus.ports()
yield from self.pdecode2.ports()
+ yield from self.l0.ports()
# TODO: regs
def ports(self):
if __name__ == '__main__':
- pspec = TestMemPspec(ldst_ifacetype='testpi',
- imem_ifacetype='testmem',
+ pspec = TestMemPspec(ldst_ifacetype='bare_wb',
+ imem_ifacetype='bare_wb',
addr_wid=48,
mask_wid=8,
reg_wid=64)