Creating a Custom Cache Partitioning Scheme
You can create a custom cache partitioning scheme to suit your use case by combining the three main capabilities of the cache configurator. These capabilities override each other in different ways. Because of these underlying effects, the recommended order of operation is:
- Start with a cache partitioning preset
- (Optional) Modify software SRAM buffers
- (Optional) Partition the cache manually
You can omit any step in the sequence depending on your needs and where you are starting from. You might also need to repeat certain steps to find the right configuration.
As you are refining your configuration, note how these capabilities affect each other.
Recommended Approach and Effects
- Start by selecting a cache partitioning preset because selecting a preset overwrites the current configuration.
- If needed, further customize the configuration by adding or deleting software SRAM buffers. Adjusting buffers has the following effects:When you reserve or free a software SRAM buffer, the cache configuration is updated automatically, starting from the base configuration that is derived from the platform. But if you select a preset or partition the cache prior to buffer editing, the base configuration will change accordingly.The cache configurator places the software SRAM buffer on the left side of the cache, starting at the left-most cache way. A software SRAM buffer cannot overlap cache ways allocated to a caching agent (for example, GPU or I/O), and software SRAM has priority over caching agents. When adding or increasing the size of a buffer, the cache configurator resolves overlapping cache ways according to the following rules:
- If the buffer mask partially overlaps the cache agent mask, remove the intersection from the cache agent mask.In this example, three cache ways are already allocated to the GPU (G). The cache configurator receives a request to add a software SRAM buffer (S) consisting of 3 cache ways. Since the cache configurator places software SRAM on the left side of the cache, the new buffer overlaps two of the three cache ways originally allocated to the GPU. The cache configurator eliminates the overlap by reducing the size of the GPU region from three cache ways to one.
- If the buffer mask fully overlaps the cache agent mask, allocate one specific cache way to the caching agent.If the caching agent is a GPU, allocate the penultimate cache way. If it is I/O, allocate the last cache way. If the software SRAM buffer occupies all the cache except the last cache way, allocate the last cache way to the GPU to avoid intersections with the buffer.In this example, two cache ways are already allocated to the GPU (G). The cache configurator receives a request to add a software SRAM buffer (S) consisting of 4 cache ways. Since the cache configurator places software SRAM on the left side of the cache, the new buffer overlaps all cache ways originally allocated to the GPU. The cache configurator eliminates the overlap by allocating the penultimate cache way to the GPU.
- If the buffer mask does not overlap a cache agent mask, keep it.In this example, one cache way is already allocated to the GPU (G). The cache configurator receives a request to add a software SRAM buffer (S) consisting of 3 cache ways. Since those cache ways are available, the cache configurator completes the request without changing the GPU region.
When deleting or reducing the size of a buffer, the following cases may occur:- If the initial buffer mask borders a cache agent mask, increase the size of the cache agent mask to fill the cache ways left vacant by the buffer.In this example, an existing software SRAM buffer (S) borders an existing GPU region (G). The cache configurator receives a request to delete the buffer. The cache configurator deletes the buffer and adds those cache ways to the GPU region.
- If the initial buffer mask does not border a cache agent mask, keep it.In this example, a software SRAM buffer (S) and GPU region (G) exist but do not border each other. The cache configurator receives a request to delete the buffer. It does so with no change to the GPU region.
- If needed, further customize the configuration by partitioning the cache manually among caching agents. In the cache partitioning interface, you can see the current configuration and adjust the cache ways allocated to caching agents.Software SRAM buffers have priority over caching agents. This means the portion of the cache reserved for software SRAM will not be accessible for manual cache partitioning.