Claims
- 1. A cache memory for use in a multithreaded processor, the cache memory comprising a plurality of thread caches, at least a given one of the thread caches comprising:
a memory array comprising a plurality of sets of memory locations; and a directory for storing tags each corresponding to at least a portion of a particular address of one of the memory locations, the directory having a plurality of entries each storing multiple ones of the tags; wherein an entry in a particular one of the memory locations is selected for eviction from the given thread cache in conjunction with a cache miss event based at least in part on at least a portion of a thread identifier of the given thread cache.
- 2. The cache memory of claim 1 wherein the plurality of sets of memory locations comprises n sets of memory locations and the directory entries each store n tags.
- 3. The cache memory of claim 2 wherein a total number of replacement policy state information bits stored in the given thread cache is given approximately by n(n−2)/8.
- 4. The cache memory of claim 1 wherein the given thread cache operates as a set-associative cache.
- 5. The cache memory of claim 1 wherein the given thread cache further comprises a thread register for storing the thread identifier.
- 6. The cache memory of claim 1 wherein the given thread cache further comprises a register for storing one or more replacement policy bits, the memory location entry selected for eviction from the given thread cache being selected based at least in part on the thread identifier and the one or more stored replacement policy bits.
- 7. The cache memory of claim 6 wherein one or more bits of the thread identifier are used to determine a particular portion of the directory from which a tag will be selected for determination of the entry to be evicted from the given thread cache, the particular portion having in a given entry thereof multiple tags associated therewith, and further wherein the one or more stored replacement policy bits determine the selected tag from the multiple tags associated with the particular portion as determined based on the one or more bits of the thread identifier.
- 8. The cache memory of claim 1 wherein the given thread cache utilizes a least recently used (LRU) replacement policy in selecting the particular entry to be evicted from the thread cache.
- 9. The cache memory of claim 1 wherein one or more least significant bits of the thread identifier are utilized to determine a particular portion of the directory from which a tag corresponding to the memory location entry to be evicted is selected.
- 10. The cache memory of claim 1 wherein the directory is organized into a first portion and a second portion, each of the entries of the directory having one or more associated tags in the first portion of the directory and one or more associated tags in the second portion of the directory, and further wherein a least significant bit of the thread identifier is used to determine whether a tag corresponding to the entry to be evicted is selected from the first portion of the directory or the second portion of the directory.
- 11. The cache memory of claim 1 further comprising eviction determination circuitry associated with at least the given thread cache and comprising:
first selection circuitry for selecting a subset of a total number of tags in a given entry of the directory, based on one or more bits of the thread identifier; and second selection circuitry for selecting a particular one of the tags of the subset of tags for eviction from the directory, based on one or more replacement policy bits associated with the given thread cache.
- 12. The cache memory of claim 11 wherein the first selection circuitry comprises a first multiplexer having a plurality of inputs each corresponding to one of the tags and a select signal corresponding to the one or more bits of the thread identifier.
- 13. The cache memory of claim 12 wherein the second selection circuitry comprises a second multiplexer having a plurality of inputs each corresponding to an output of the first multiplexer and a select signal corresponding to the one or more replacement policy bits.
- 14. A multithreaded processor comprising:
a cache memory for storing instructions to be executed by the processor; a data memory for storing data to be processed in accordance with the instructions; an instruction decoder for decoding instructions fetched from the cache memory; and one or more arithmetic logic units for performing operations on the data in accordance with the decoded instructions; wherein the cache memory comprises a plurality of thread caches, at least a given one of the thread caches comprising:
a memory array comprising a plurality of sets of memory locations; and a directory for storing tags each corresponding to at least a portion of a particular address of one of the memory locations, the directory having a plurality of entries each storing multiple ones of the tags; wherein an entry in a particular one of the memory locations is selected for eviction from the given thread cache in conjunction with a cache miss event based at least in part on at least a portion of a thread identifier of the given thread cache.
- 15. A method of controlling a cache memory in a multithreaded processor, the cache memory comprising a plurality of thread caches, at least a given one of the thread caches comprising a memory array having a plurality of sets of memory locations and a directory for storing tags each corresponding to at least a portion of a particular address of one of the memory locations, the directory having a plurality of entries each storing multiple ones of the tags, the method comprising the steps of:
determining the occurrence of a cache miss event in the given thread cache; and selecting an entry in a particular one of the memory locations for eviction from the given thread cache in conjunction with the cache miss event based at least in part on at least a portion of a thread identifier of the given thread cache.
RELATED APPLICATION(S)
[0001] The present invention is related to the invention described in U.S. patent application Attorney Docket No. 1007-3, filed concurrently herewith and entitled “Method and Apparatus for Multithreaded Cache with Simplified Implementation of Cache Replacement Policy,” which is hereby incorporated by reference herein.