class TstL0CacheBuffer(Elaboratable):
- def __init__(self, n_units=3, regwid=16, addrwid=4, ifacetype='testpi'):
- pspec = TestMemPspec(ldst_ifacetype=ifacetype,
- imem_ifacetype='',
- addr_wid=addrwid<<1,
- mask_wid=8,
- reg_wid=regwid)
+ def __init__(self, pspec, n_units=3):
+ regwid = pspec.reg_wid
+ addrwid = pspec.addr_wid
self.cmpi = ConfigMemoryPortInterface(pspec)
self.pimem = self.cmpi.pi
self.l0 = L0CacheBuffer(n_units, self.pimem, regwid, addrwid<<1)
from soc.decoder.power_decoder2 import PowerDecode2
from soc.decoder.decode2execute1 import Data
from soc.experiment.l0_cache import TstL0CacheBuffer # test only
+from soc.config.test.test_loadstore import TestMemPspec
import operator
class NonProductionCore(Elaboratable):
- def __init__(self, addrwid=6, idepth=16, ifacetype='testpi'):
+ def __init__(self, pspec):
+ addrwid = pspec.addr_wid
# single LD/ST funnel for memory access
- self.l0 = TstL0CacheBuffer(n_units=1, regwid=64,
- addrwid=addrwid, ifacetype=ifacetype)
+ self.l0 = TstL0CacheBuffer(pspec, n_units=1)
pi = self.l0.l0.dports[0]
# function units (only one each)
if __name__ == '__main__':
- dut = NonProductionCore()
+ pspec = TestMemPspec(ldst_ifacetype='testpi',
+ imem_ifacetype='',
+ addr_wid=48,
+ mask_wid=8,
+ reg_wid=64)
+ dut = NonProductionCore(pspec)
vl = rtlil.convert(dut, ports=dut.ports())
with open("test_core.il", "w") as f:
f.write(vl)
efficiency and speed is not the main goal here: functional correctness is.
"""
- def __init__(self, addrwid=6, idepth=6, ifacetype='testpi',
- imemtype='testmem'):
+ def __init__(self, pspec):
# main instruction core
- self.core = core = NonProductionCore(addrwid, ifacetype=ifacetype)
+ self.core = core = NonProductionCore(pspec)
- pspec = TestMemPspec(ldst_ifacetype=ifacetype,
- imem_ifacetype=imemtype,
- addr_wid=addrwid<<1,
- mask_wid=8,
- reg_wid=64) # instruction memory width
# Test Instruction memory
self.imem = ConfigFetchUnit(pspec).fu
# one-row cache of instruction read
if __name__ == '__main__':
- dut = TestIssuer()
+ pspec = TestMemPspec(ldst_ifacetype='testpi',
+ imem_ifacetype='testmem',
+ addr_wid=48,
+ mask_wid=8,
+ reg_wid=64)
+ dut = TestIssuer(pspec)
vl = rtlil.convert(dut, ports=dut.ports(), name="test_issuer")
with open("test_issuer.il", "w") as f:
f.write(vl)
from soc.simple.issuer import TestIssuer
from soc.experiment.compalu_multi import find_ok # hack
+from soc.config.test.test_loadstore import TestMemPspec
from soc.simple.test.test_core import (setup_regs, check_regs,
wait_for_busy_clear,
wait_for_busy_hi)
go_insn_i = Signal()
pc_i = Signal(32)
- m.submodules.issuer = issuer = TestIssuer(ifacetype="test_bare_wb",
- imemtype="test_bare_wb")
+ pspec = TestMemPspec(ldst_ifacetype='test_bare_wb',
+ imem_ifacetype='test_bare_wb',
+ addr_wid=48,
+ mask_wid=8,
+ reg_wid=64)
+ m.submodules.issuer = issuer = TestIssuer(pspec)
imem = issuer.imem._get_memory()
core = issuer.core
pdecode2 = core.pdecode2