SPRUIU1C July 2020 – February 2024 DRA821U , DRA821U-Q1
The random replacement implementation attempts to minimize any allocation bias throughout the ways for a large number of allocations. However, it can be useful to introduce purposeful bias to help keep the state of certain tasks resident in the cache. To serve this end, MSMC supports programmable way-partitioning based on real-time versus nonreal-time traffic.
To accomplish this without introducing other unpredictable bias MSMC provides groups of AND-OR masks which can be attached to a group of IDs. The AND-OR masks consist of two fields: a two-bit AND field and a two-bit OR field. MSMC applies these two fields to the lower two bits of the randomly chosen allocation way. Figure 8-5 shows how MSMC calculates the final allocation pointer using the initial random state and the user-defined AND-OR mask.
The two-bit masks allow rough partitioning for quadrants of the cache. Depending on the configured cache size, the cache consists of 0-7 groups of 4 ways each, for a maximum of 32 ways. The upper 3 bits in the allocation pointer determine which group of 4 ways. The final two bits determine selection between the 4 ways within that group. Table 8-5 describes the possible values for the AND-OR mask and the resulting available ways.
Way 3 | Way 2 | Way 1 | Way 0 | AND Mask | OR Mask |
---|---|---|---|---|---|
X | X | X | X | 11 | 00 |
X | X | -1 | 10 | ||
X | X | 01 | 00 | ||
X | X | 1- | 01 | ||
X | X | 10 | 00 | ||
X | -- | 11 | |||
X | -0 | 10 | |||
X | 0- | 01 | |||
X | 00 | 00 |
The AND-OR masks are programmed via the following bit fields: