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]
serialize_addr(addr: View) 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.

accept_res: Method
flush: Method
issue_req: Method
class coreblocks.cache.iface.CacheRefillerInterface

Bases: HasElaborate, Protocol

Cache Refiller Interface.

Parameters
start_refillMethod

A method that is used to start a refill for a given cache line.

accept_refillMethod

A method that is used to accept one fetch block from the requested cache line.

accept_refill: Method
start_refill: Method

coreblocks.cache.refiller module

class coreblocks.cache.refiller.SimpleCommonBusCacheRefiller

Bases: Elaboratable, CacheRefillerInterface

__init__(layouts: ICacheLayouts, params: ICacheParameters, bus_master: BusMasterInterface)

Module contents