Write merging on stores with different tags
Techniques for caching data are provided that include receiving, by a caching system, a write memory command for a memory address, the write memory command associated with a first color tag, determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache, determining, by second sub-cache of the caching system, that the memory address is not cached in the second sub-cache, storing first data associated with the first write memory command in a cache line of the second sub-cache, storing the first color tag in the second sub-cache, receiving a second write memory command for the cache line, the write memory command associated with a second color tag, merging the second color tag with the first color tag, storing the merged color tag, and evicting the cache line based on the merged color tag.
1. A caching system comprising:
a first sub-cache; and
a second sub-cache, coupled in parallel with the first sub-cache, for storing cache data evicted from the first sub-cache and write-memory commands that are not cached in the first sub-cache, the second sub-cache including:
color tag bits configured to store an indication that a corresponding line of the second sub-cache is associated with a color tag; and
an eviction controller configured to evict cache lines of the second sub-cache storing write-memory data based on the color tag associated with the line, and
wherein the second sub-cache is further configured to:
receive a first write memory command for a memory address, the first write memory command associated with a first color tag;
store first data associated with the first write memory command in a cache line of the second sub-cache;
store the first color tag in the second sub-cache;
receive a second write memory command for the cache line, the second write memory command associated with a second color tag;
merge the second color tag with the first color tag to produce a merged color tag;
store the merged color tag; and
evict the cache line based on the merged color tag.
2. The caching system of claim 1 , wherein the first color tag and the second color tag represent the same color tag.
3. The caching system of claim 1 , wherein the first color tag and the second color tag represent different color tags, and wherein the merged color tag comprises a first bit representing the first color tag and a second bit representing the second color tag.
4. The caching system of claim 3 , wherein the second sub-cache is further configured to evict the cache line based on the first color tag.
5. The caching system of claim 4 , wherein the second sub-cache is further configured to evict the cache line based on the second color tag.
6. The caching system of claim 1 , wherein the first color tag and the second color tag are stored in a bit field in a memory tracking modified, exclusive, shared, and invalid (MESI) state of entries in the second sub-cache data.
7. The caching system of claim 6 , wherein the bit field includes a bit storing the state for each color tag.
8. A method for caching data, comprising:
receiving, by a caching system, a first write memory command for a memory address, the first write memory command associated with a first color tag;
determining, by a first sub-cache of the caching system, that the memory address is not cached in the first sub-cache;
determining, by second sub-cache of the caching system, that the memory address is not cached in the second sub-cache, wherein the second sub-cache is configured to store, in parallel with the first sub-cache, cache data evicted from the first sub-cache and write-memory commands that are not cached in the first sub-cache;
storing first data associated with the first write memory command in a cache line of the second sub-cache;
storing the first color tag in the second sub-cache;
receiving a second write memory command for the cache line, the second write memory command associated with a second color tag;
merging the second color tag with the first color tag to produce a merged color tag;
storing the merged color tag; and
evicting the cache line based on the merged color tag.
9. The method of claim 8 , wherein the first color tag and the second color tag represent the same color tag.
10. The method of claim 8 , wherein the first color tag and the second color tag represent different color tags, and wherein the merged color tag comprises a first bit representing the first color tag and a second bit representing the second color tag.
11. The method of claim 10 , wherein the evicting is based on the first color tag.
12. The method of claim 11 , wherein the evicting is based on the second color tag.
13. The method of claim 8 , wherein the first color tag and the second color tag are stored in a bit field in a memory tracking a modified, exclusive, shared, and invalid (MESI) state of entries in the second sub-cache data.
14. The method of claim 13 , wherein the bit field includes a bit storing the state for each color tag.
15. A device comprising:
a processor;
a first sub-cache; and
a second sub-cache coupled in parallel with the first sub-cache, for storing cache data evicted from the first sub-cache and write-memory commands that are not cached in the first sub-cache, and the second sub-cache including:
color tag bits configured to store an indication that a corresponding line of the second sub-cache is associated with a color tag; and
an eviction controller configured to evict cache lines of the second sub-cache storing write-memory data based on the color tag associated with the line, and
wherein the second sub-cache is further configured to:
receive a first write memory command for a memory address, the first write memory command associated with a first color tag;
store first data associated with the first write memory command in a cache line of the second sub-cache;
store the first color tag in the second sub-cache;
receive a second write memory command for the cache line, the second write memory command associated with a second color tag;
merge the second color tag with the first color tag to produce a merged color tag;
store the merged color tag; and
evict the cache line based on the merged color tag.
16. The device of claim 15 , wherein the first color tag and the second color tag represent the same color tag.
17. The device of claim 15 , wherein the first color tag and the second color tag represent different color tags, and wherein the merged color tag comprises a first bit representing the first color tag and a second bit representing the second color tag.
18. The device of claim 17 , wherein the second sub-cache is further configured to evict the cache line based on the first color tag.
19. The device of claim 18 , wherein the second sub-cache is further configured to evict the cache line data based on the second color tag.
20. The device of claim 15 , wherein the first color tag and the second color tag are stored in a bit field in a memory tracking modified, exclusive, shared, and invalid (MESI) state of entries in the second sub-cache data.