This document defines the interface signals and protocols for the hierarchical_cache_top module. The design uses SystemVerilog Interfaces and Structs for a clean, modular connection, but can be viewed as standard bus protocols.
| Signal | Direction | Width | Description |
|---|---|---|---|
clk |
Input | 1 | System Clock. All logic is positive-edge triggered. |
rst_n |
Input | 1 | Active Low Asynchronous Reset. |
The top module exposes two ports for the CPU: Instruction Cache (L1I) and Data Cache (L1D). Both share the same request/response protocol.
Instruction Port (cpu_l1i_req_i / cpu_l1i_resp_o)
Data Port (cpu_l1d_req_i / cpu_l1d_resp_o)
| Field | Width | Description |
|---|---|---|
addr |
32 | Physical Address. |
data |
32 | Write Data (for Single Word Writes). |
cmd |
2 | Command: READ (00), WRITE (01), FLUSH (10). |
valid |
1 | Master indicates request is valid. |
is_burst |
1 | 0 for Word Access, 1 for Line Access (Internal/DMA). CPU typically uses 0. |
byte_en |
4 | Byte Enable for writes (Not fully supported in current demo version). |
| Field | Width | Description |
|---|---|---|
data |
32 | Read Data (for Word Reads). |
ready |
1 | Slave indicates it is ready to accept a request. Handshake completes when valid && ready. |
valid |
1 | Slave indicates Read Data is valid or Write is complete. |
error |
1 | Indicates error response (e.g., bus error). |
The L3 Cache acts as the master to the Main Memory (DRAM).
Memory Port (mem_req_o / mem_resp_i)
- Commands: READ, WRITE.
- Bursts: Always Line Access (
is_burst=1). - Data:
line_data(512-bit) used for Writebacks.
- Data:
line_data(512-bit) return for Reads. - Latency: Variable. Cache waits for
valid.
The interface uses a simplified handshake similar to AXI-Lite/AXI-Stream.
- Request: Master asserts
req.validand stable control signals/data. - Acceptance: Slave asserts
resp.readywhen it can accept. Transaction is "Accepted" on posedgeclkwherereq.valid && resp.readyis high. - Completion:
- For Write: Slave asserts
resp.valid(andresp.ready) usually immediately or after operation. - For Read: Slave asserts
resp.validand providesresp.datawhen data is available. Master must capture data whenresp.validis high.
- For Write: Slave asserts
See rtl/include/cache_pkg.sv for system parameters.
DATA_WIDTH: 32 bitsCACHE_LINE_SIZE: 512 bits (64 Bytes)ADDR_WIDTH: 32 bits