Control-Status Registers (CSRs)
Dedicated CSR address space
The HPDcache defines a dedicated memory address space for configuring and checking the internal status. This memory space is shared among all the requesters connected to the same HPDcache. However, this space is private to those requesters in a system-wide point of view. This is, this dedicated CSR address space is not visible to other requesters integrated in the system.
The dedicated CSR address space is aligned to 4 Kibytes and has this same size. Current version of the HPDcache uses a very small subset of this address space, but the aligning to 4 Kibytes, allows easier mapping in the virtual address space by the OS. The smallest virtual/physical page size defined in the [RISCVP2019] is 4 Kibytes. Figure 6 displays the layout of the dedicated CSR address space of the HPDcache.
The \(\mathsf{CFIG\_BASE}\) address is specified through an input port of
the HPDcache. The name of this input pin is cfig_base_i
. It is a multi-bit
signal. The number of bits is \(\mathsf{CONF\_HPDCACHE\_PA\_WIDTH}\). As
mentioned above, as this segment must be aligned to 4 KiB, the 12 least
significant bits must be all 0.
Fig. 6 HPDcache CSR Dedicated Address Space
Configuration registers
Table 22 lists the configuration registers implemented in the HPDcache.
These are mapped on the \(\mathsf{CFIG}\) memory address segment (Figure 6).
CFIG Segment |
||
---|---|---|
Register |
Description |
Base address |
|
64-bits register with cache version |
|
|
64-bits register with cache information (part I) |
|
|
64-bits register with cache information (part II) |
|
|
64-bits register to configure the cache controller |
|
|
64-bits register to configure the write buffer |
|
cfig_version
Bits |
Field |
Description |
Mode |
Reset Value |
---|---|---|---|---|
[15:0] |
MinorID |
Minor Version ID of the HPDcache |
RO |
\(\small\mathsf{0x0001}\) |
[31:16] |
MajorID |
Major Version ID of the HPDcache |
RO |
\(\small\mathsf{0x0001}\) |
[47:32] |
IpID |
IP ID of the HPDcache |
RO |
\(\small\mathsf{0x0001}\) |
[63:48] |
VendorID |
Vendor ID |
RO |
\(\small\mathsf{0x0001}\) |
cfig_info
Bits |
Field |
Description |
Mode |
Reset Value |
---|---|---|---|---|
[15:0] |
Sets |
Number of sets in the cache (one-based) |
RO |
\(\scriptsize\mathsf{CONF\_HPDCACHE\_SETS - 1}\) |
[23:16] |
Ways |
Number of ways in the cache (one-based) |
RO |
\(\scriptsize\mathsf{CONF\_HPDCACHE\_WAYS - 1}\) |
[27:24] |
ClBytes |
Number of bytes per cacheline (power of 2) |
RO |
\(\scriptsize\mathsf{log_2(CONF\_HPDCACHE\_CL\_WIDTH/8)}\) |
[39:32] |
MSHRSets |
Number of sets in the MSHR (one-based) |
RO |
\(\scriptsize\mathsf{CONF\_HPDCACHE\_MSHR\_SETS - 1}\) |
[47:40] |
MSHRWays |
Number of ways in the MSHR (one-based) |
RO |
\(\scriptsize\mathsf{CONF\_HPDCACHE\_MSHR\_WAYS - 1}\) |
cfig_info2
Bits |
Field |
Description |
Mode |
Reset Value |
---|---|---|---|---|
[7:0] |
RTAB |
Number of entries in the RTAB (one-based) |
RO |
\(\scriptsize\mathsf{CONF\_HPDCACHE\_RTAB\_ENTRIES - 1}\) |
[23:16] |
WBufDir |
Number of entries in the directory of the Write Buffer (one-based) |
RO |
\(\scriptsize\mathsf{CONF\_HPDCACHE\_WBUF\_DIR\_ENTRIES - 1}\) |
[31:24] |
WBufData |
Number of entries in the data buffer of the Write Buffer (one-based) |
RO |
\(\scriptsize\mathsf{CONF\_HPDCACHE\_WBUF\_DATA\_ENTRIES - 1}\) |
[35:32] |
WBufBytes |
Number of bytes per Write-Buffer Data Entry (power of 2) |
RO |
\(\scriptsize\mathsf{log_2(CONF\_HPDCACHE\_WBUF\_WIDTH/8)}\) |
cfig_cachectrl
Bits |
Field |
Description |
Mode |
Reset Value |
---|---|---|---|---|
[0:0] |
E |
Cache Enable - When set to 0, all memory accesses are considered uncacheable |
RW |
\(\small\mathsf{0}\) |
[8:8] |
P |
Performance Counters Enable - When set to 1, performance counter count events |
RW |
\(\small\mathsf{1}\) |
[56:56] |
R |
Single-Entry RTAB (fallback mode) - When set to 1, the cache controller only uses one entry of the Replay Table. |
RW |
\(\small\mathsf{0}\) |
cfig_wbuf
Bits |
Field |
Description |
Mode |
Reset Value |
---|---|---|---|---|
[0:0] |
R |
Reset time-counter on write - When set to 1, write accesses restart the time-counter to 0 of the used write-buffer entry |
RW |
\(\small\mathsf{1}\) |
[1:1] |
S |
Sequential Write after Write - When set to 1, the write buffer stalls write accesses that collide with an in-flight write transaction (SENT). |
RW |
\(\small\mathsf{0}\) |
[2:2] |
I |
Inhibit Write Coalescing - When set to 1, entries in the write-buffer go from the FREE state to the PEND state directly (bypassing the OPEN state). Moreover, no coalescing is accepted while the entry is in the PEND state. |
RW |
\(\small\mathsf{0}\) |
[15:8] |
T |
Time-counter Threshold - This field defines the time-counter threshold on which open write-buffer entries (OPEN) go to the pending state (PEND) |
RW |
\(\small\mathsf{3}\) |
Performance counters
The HPDcache provides a set of performance counters. These counters provide information that can be used by software developers, at OS level or user application level, to, for example, debug performance issues.
These counters are implemented in the HPDcache only if
\(\scriptsize\mathsf{CONF\_HPDCACHE\_SUPPORT\_PERF}\) is set to 1. If this
configuration parameter is set to 0, any read or write to performance counters
is ignored and a response with an error is sent to the corresponding requester
when core_req_i.need_rsp
is set to 1.
Performance counters are incremented automatically by the hardware when the
corresponding event is triggered and the cfig_cachectrl.P
(see cfig_cachectrl) bit is set to 1.
Table 28 lists the performance counters provided by the HPDcache. These are mapped on the \(\mathsf{PERF}\) memory address segment (Figure 6).
Counter |
Description |
Base Address |
---|---|---|
|
64-bit counter for processed write requests |
|
|
64-bit counter for processed read requests |
|
|
64-bit counter for processed prefetch requests |
|
|
64-bit counter for processed uncached requests |
|
|
64-bit counter for processed CMO requests |
|
|
64-bit counter for processed requests |
|
|
64-bit counter for write cache misses |
|
|
64-bit counter for read cache misses |
|
|
64-bit counter for requests put on-hold |
|
|
64-bit counter for requests put on-hold because of MSHR conflicts |
|
|
64-bit counter for requests put on-hold because of WBUF conflicts |
|
|
64-bit counter for requests put on-hold (again) after a rollback |
|
|
64-bit counter for stall cycles (cache does not accept a request) |
|