Pipeline to data cache interface

November 3, 2020 ยท View on GitHub

This interface allows the pipeline to read and write information to the data cache.

Every request must receive a response, even if that response is only "the request completed without triggering an exception". The cache may not respond on the same clock cycle as the request arrived.

All valid signals should remain high for at most one clock cycle per request/response.

Pipeline to data cache

SignalTypeDescription
req_validBooleanWhether the request is valid.
req_address64 bitsMemory address to be accessed.
req_value64 bitsValue to be stored or used in atomic operations.
req_opmem_op_eType of memory operation. (Available options)
req_size2 bitslog2(bytes to access). Not all request sizes are compatible with all request operations.
req_unsignedBooleanWhether MEM_LOAD operations are unsigned. Unused for all other operation types.
req_amo7 bitsWhen req_op is MEM_AMO, this dictates the type and ordering requirements of the operation. TODO: more detail - create a new struct+enum for AMOs?
req_prvBooleanWhether the core is in Supervisor mode.
req_sumBooleanThe value of the MSTATUS control register's SUM bit (permit Supervisor User Memory access).
req_mxrBooleanThe value of the MSTATUS control register's MXR bit (Make eXecutable Readable).
req_atp64 bitsThe value of the ATP (Address Translation and Protection) control register.
notif_validBooleanWhether a fence is being requested.
notif_reason1 bitReason for requesting a fence. 0: SATP bits changed; 1: SFENCE.VMA instruction executed.

Data cache to pipeline

SignalTypeDescription
req_readyBooleanWhether the cache is ready to receive a new request.
resp_validBooleanWhether the response is valid. This signal cannot be high if ex_valid is also high.
resp_value64 bitsResponse data.
ex_validBooleanWhether there was an exception when performing the operation.
ex_exceptionexception_tInformation about exception. (More details)
notif_readyBooleanWhether the requested fence operation has completed. There must be at least one clock cycle between the request being made and this notification being sent.

mem_op_e

Types of memory operation.

ValueDescription
MEM_LOADLoad data.
MEM_STOREStore data.
MEM_LRLoad reserved.
MEM_SCStore conditional.
MEM_AMOAtomic memory operation.

exception_t

Information about an exception. A compound type consisting of:

FieldTypeDescription
causeexc_cause_eThe cause of the exception. (Available options)
tval64 bitsA payload with additional information, usually the address being accessed when the exception occurred.

exc_cause_e

Reasons for an exception taking place. More options are available; these are the ones relevant to the data cache.

ValueDescription
EXC_CAUSE_LOAD_MISALIGNMisaligned load.
EXC_CAUSE_LOAD_ACCESS_FAULTInsufficient permissions for load.
EXC_CAUSE_STORE_MISALIGNMisaligned store.
EXC_CAUSE_STORE_ACCESS_FAULTInsufficient permissions for store.
EXC_CAUSE_LOAD_PAGE_FAULTPage fault on load.
EXC_CAUSE_STORE_PAGE_FAULTPage fault on store.