coreblocks.cache package
Submodules
coreblocks.cache.icache module
- class coreblocks.cache.icache.ICache
Bases:
Elaboratable
,CacheInterface
A simple set-associative instruction cache.
The replacement policy is a pseudo random scheme. Every time a line is trashed, we select the next way we write to (we keep one global counter for selecting the next way).
Refilling a cache line is abstracted away from this module. ICache module needs two methods from the refiller refiller_start, which is called whenever we need to refill a cache line. refiller_accept should be ready to be called whenever the refiller has another fetch block ready to be written to cache. refiller_accept should set last bit when either an error occurs or the transfer is over. After issuing last bit, refiller_accept shouldn’t be ready until the next transfer is started.
- __init__(layouts: ICacheLayouts, params: ICacheParameters, refiller: CacheRefillerInterface) None
- Parameters
- layoutsICacheLayouts
Instance of ICacheLayouts used to create cache methods.
- paramsICacheParameters
Instance of ICacheParameters with parameters which should be used to generate the cache.
- refiller_startMethod
A method with input layout ICacheLayouts.start_refill
- refiller_acceptMethod
A method with output layout ICacheLayouts.accept_refill
- deserialize_addr(raw_addr: Value) dict[str, amaranth.hdl._ast.Value]
- class coreblocks.cache.icache.ICacheBypass
Bases:
Elaboratable
,CacheInterface
- __init__(layouts: ICacheLayouts, params: ICacheParameters, bus_master: BusMasterInterface) None
coreblocks.cache.iface module
- class coreblocks.cache.iface.CacheInterface
Bases:
HasElaborate
,Protocol
Cache Interface.
- Parameters
- issue_reqMethod
A method that is used to issue a cache lookup request.
- accept_resMethod
A method that is used to accept the result of a cache lookup request.
- flushMethod
A method that is used to flush the whole cache.
coreblocks.cache.refiller module
- class coreblocks.cache.refiller.SimpleCommonBusCacheRefiller
Bases:
Elaboratable
,CacheRefillerInterface
- __init__(layouts: ICacheLayouts, params: ICacheParameters, bus_master: BusMasterInterface)