SPRUJ52C june 2022 – july 2023 AM69 , AM69A , TDA4AH-Q1 , TDA4AP-Q1 , TDA4VH-Q1 , TDA4VP-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-4 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-1 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:
MSMC also provides software control over the number of cache way groups real time and non-real time transactions are each allowed to allocate into. The MSMC_RT_WAY_SELECT2[19-16] DATABACKED_GROUPS and MSMC_NRT_WAY_SELECT2[19-16] DATABACKED_GROUPS fields control the number of data backed way groups to be allocatable by real-time and non-real-time transactions, respectively. Similarly, the MSMC_RT_WAY_SELECT2[27-24] NON_DATABACKED_GROUPS and MSMC_NRT_WAY_SELECT2[27-24] NON_DATABACKED_GROUPS fields control the number of way groups without data backing that can be allocated by real-time and non-real-time transactions, respectively.
For any setting of these values MSMC minimizes the number of way groups that are simultaneously allocatable by both real-time and non-real-time transactions. For example, if there are 3 way groups with data backing and both real-time and non-real-time transactions are configured to be allocateable in 2 data backed way groups, then one way group will be allocateable by only real-time transactions, one only by non-real-time transactions, and one that is allocateable by both real-time non-real-time transactions.
If DATABACKED_GROUPS is set to 0h or is a value greater than the value of the MSMC_CACHE_CTRL[3-0] CACHE_SIZE filed, then MSMC will defer to the CACHE_SIZE setting to determining what way groups are available for any data-allocating transactions. Similarly, if NON_DATABACKED_GROUPS is set to 0h or is a value greater than the value of (8-CACHE_SIZE), then MSMC will defer to (8-CACHE_SIZE) when determining what way groups are available for any non-data allocating transactions.