Claims
- 1. An N-way associative cache memory, comprising:
a data array, comprising a first plurality of storage elements for storing cache lines arranged as M rows and N ways; a tag array, coupled to said data array, comprising a second plurality of storage elements arranged as said M rows and said N ways, each of said second plurality of storage elements for storing a tag of a corresponding one of said cache lines, wherein each of said second plurality of storage elements is also configured to store information used to determine which of said N ways to replace; and control logic, coupled to said tag array, configured to read said information from all of said N ways of a selected one of said M rows, to select one of said N ways to replace based on said information read from all of said N ways, and to update only said information in said one of said N ways selected to replace.
- 2. The cache memory of claim 1, wherein said control logic is configured to update said tag in said one of said N ways selected to replace concurrently with said information.
- 3. The cache memory of claim 1, wherein said control logic is further configured to update one of said cache lines corresponding to said tag in said one of said N ways selected to replace substantially concurrently with said information.
- 4. The cache memory of claim 1, wherein said control logic is configured to determine from said information read from said all of said N ways collectively which of said N ways of said selected one of said M rows is substantially least recently used.
- 5. The cache memory of claim 4, wherein said control logic is configured to encode said information read from said all of said N ways into a plurality of bits specifying which of said N ways of said selected one of said M rows is substantially least recently used according to a pseudo-least-recently-used encoding.
- 6. The cache memory of claim 5, wherein N is 4.
- 7. The cache memory of claim 6, wherein said information stored in each of said second plurality of storage elements comprises 2 bits.
- 8. The cache memory of claim 7, wherein said plurality of bits specifying which of said N ways of said selected one of said M rows is substantially least recently used according to a pseudo-least-recently-used encoding comprises 3 bits.
- 9. The cache memory of claim 4, wherein said control logic is configured to select said one of said N ways to replace based on determining from said information read from said all of said N ways collectively which of said N ways of said selected one of said M rows is substantially least recently used.
- 10. The cache memory of claim 9, wherein said control logic is configured to generate new information for updating only said information in said one of said N ways selected to replace.
- 11. The cache memory of claim 10, wherein said control logic generates said new information based on which of said N ways of said selected one of said M rows is substantially least recently used.
- 12. The cache memory of claim 11, wherein said control logic generates said new information based further on said information in said one of said N ways selected to replace.
- 13. The cache memory of claim 10, wherein said control logic generates said new information based further on said one of said N ways selected to replace.
- 14. The cache memory of claim 13, wherein said control logic generates said new information based further on said information in said one of said N ways selected to replace.
- 15. The cache memory of claim 4, wherein said information from any one of said N ways of said selected one of said M rows does not individually specify which of said N ways is substantially least recently used.
- 16. The cache memory of claim 4, wherein said control logic is configured to determine from said information read from said all of said N ways collectively which of said N ways of said selected one of said M rows is substantially least recently used by performing an exclusive-OR operation in a predetermined manner on said information read from said all of said N ways.
- 17. An N-way associative cache memory, comprising:
a data array, arranged as N ways, comprising a plurality of rows, each of said plurality of rows configured to store N cache lines corresponding to said N ways, and an index input for selecting one of said plurality of rows; a directory, coupled to said data array, arranged as said N ways, comprising said plurality of rows, each of said plurality of rows configured to store cache line replacement information, wherein said cache line replacement information is distributed across said N ways such that each of said N ways stores only a portion of said cache line replacement information; and control logic, coupled to said directory, configured to receive said cache line replacement information from said selected one of said plurality of rows, and to generate a signal in response thereto, said signal specifying one of said N ways of said data array for replacing a corresponding one of said N cache lines in said selected one of said plurality of rows.
- 18. The cache memory of claim 17, wherein each of said plurality of rows of said directory is configured to store N tags, said N tags specifying at least a portion of an address of a corresponding one of said N cache lines stored in said data array.
- 19. The cache memory of claim 17, wherein each of said plurality of rows of said directory is configured to store N status information, said N status information specifying cache status of a corresponding one of said N cache lines stored in said data array.
- 20. The cache memory of claim 19, wherein said N status information comprises information specifying whether said corresponding one of said N cache lines stored in said data array is modified, exclusively held, shared, or invalid.
- 21. The cache memory of claim 17, wherein said cache line replacement information comprises information used for determining which of said N cache lines in said one of said plurality of rows selected by said index input is least recently used.
- 22. The cache memory of claim 21, wherein said control logic comprises an encoder for encoding said cache line replacement information into an encoded form of said cache line replacement information.
- 23. The cache memory of claim 22, wherein said encoded form of said cache line replacement information comprises information for specifying which of said N cache lines in said one of said plurality of rows selected by said index input is least recently used according to a pseudo-least recently used encoding.
- 24. The cache memory of claim 22, wherein said encoder encodes said cache line replacement information into said encoded form of said cache line replacement information by exclusive-ORing predetermined subsets of said cache line replacement information to generate said encoded form.
- 25. The cache memory of claim 17, wherein said control logic is further configured to generate updated cache line replacement information for storage in said selected one of said plurality of rows of said directory.
- 26. The cache memory of claim 25, wherein said control logic generates said updated cache line replacement information in response to said signal specifying one of said N ways.
- 27. The cache memory of claim 25, wherein said portion of said cache line replacement information stored in each of said N ways is individually updateable.
- 28. The cache memory of claim 27, wherein said updated cache line replacement information comprises information for updating only said portion of said cache line replacement information corresponding to said one of said N ways specified by said signal.
- 29. The cache memory of claim 17, wherein said N is 4.
- 30. The cache memory of claim 17, wherein said control logic comprises encoding logic for receiving said portion of said cache line replacement information from each of said N ways of said selected one of said plurality of rows, and encoding same into encoded information specifying which of said N ways of said selected one of said plurality of rows is substantially least recently used.
- 31. A 4-way associative cache, comprising:
a data array, having M rows, each of said M rows having 4 ways, each of said 4 ways in each of said M rows having a line storage element for storing a cache line; a directory, coupled to said data array, having said M rows, each of said M rows having said 4 ways, each of said 4 ways in each of said M rows having a tag storage element for storing a tag of said cache line stored in a corresponding said line storage element of said data array, said tag storage element further configured to store 2 bits of cache line replacement information; and an encoder, coupled to said directory, for reading 8 bits comprising said 2 bits of cache line replacement information from each of said 4 ways of a selected one of said M rows, and encoding said 8 bits into 3 bits according to a pseudo-least-recently-used encoding, wherein said 3 bits specify which of said 4 ways of said selected one of said M rows is substantially least recently used.
- 32. The cache of claim 31, wherein said encoder performs exclusive-OR operations on portions of said 8 bits in a predetermined manner to generate said 3 bits.
- 33. The cache of claim 31, further comprising:
a decoder, coupled to said directory, for generating 2 new bits of cache line replacement information for updating said one of said 4 ways of said selected one of said M rows that is substantially least recently used.
- 34. The cache of claim 33, wherein said decoder generates said 2 new bits based on said one of said 4 ways of said selected one of said M rows that is substantially least recently used.
- 35. The cache of claim 34, wherein said decoder generates said 2 new bits based further on said 2 bits of cache line replacement information from said one of said 4 ways of said selected one of said M rows that is substantially least recently used.
- 36. The cache of claim 31, further comprising:
a replacement way generator, coupled to said directory, for generating a signal for specifying which of said 4 ways of said selected one of said M rows is substantially least recently used based on said 3 bits.
- 37. An associative cache memory having an integrated tag and cache line replacement information array, comprising:
an M row by N way array of storage elements, each storage element for storing a cache line tag and per way replacement information, said array having an input for receiving an index for selecting one of said M rows of said array; and control logic, coupled to said array of storage elements, configured to encode said per way replacement information from all of said N ways of said selected one of said M rows into per row replacement information, thereby obviating a need for a separate cache line replacement information array of storage elements.
- 38. The cache memory of claim 37, wherein said per row replacement information specifies which one of said N ways of said selected one of said M rows is substantially least recently used.
- 39. The cache memory of claim 38, wherein said control logic is further configured to update said per way replacement information in said one of said N ways that is substantially least recently used.
- 40. The cache memory of claim 37, wherein said control logic decodes said per way replacement information such that said per way replacement information is individually updateable without requiring update of said per way replacement information in each of said N ways of said selected one of said M rows.
- 41. The cache memory of claim 37, further comprising:
a second M row by N way array of storage elements, coupled to said control logic, each storage element of said second array for storing a cache line corresponding to said tag stored in said first M row by N way array of storage elements.
- 42. An N-way associative cache memory, comprising:
a two-dimensional tag and least-recently-used (LRU) array, each row of said array configured to store N tags in N ways of said row, each row of said array further configured to store pseudo-LRU information, said pseudo-LRU information comprising N portions distributed across said N ways of said row, said N portions collectively specifying which of said N ways is pseudo-least-recently-used, each of said N portions of said pseudo-LRU information associated with a corresponding one of said N tags and individually updateable along with said corresponding one of said N tags; and control logic, coupled to said array, configured to receive said N portions of said pseudo-LRU information distributed across said N ways of said row, and to replace a cache line in a two-dimensional data array of the cache memory corresponding to said two-dimensional tag and LRU array, wherein said N portions specify said cache line as pseudo-least-recently-used in said row.
- 43. The cache memory of claim 42, wherein said N portions of said pseudo-LRU information are distributed across all said N ways of said row in a predetermined manner.
- 44. The cache memory of claim 42, wherein said control logic is configured to update one of said N portions of said pseudo-LRU information based on a load hit of one of said N ways storing said one of said N portions.
- 45. The cache memory of claim 42, wherein if one of said N ways of said row is invalid, said control logic replaces said invalid cache line rather than said pseudo-least-recently-used cache line.
- 46. A method for updating an associative cache having M rows and N ways, comprising the steps of:
selecting a row from said M rows of said cache based on a cache line address; reading cache line replacement information stored in each of said N ways of said row selected; selecting a way for replacement of said N ways of said row selected in response to said reading; generating new cache line replacement information in response to said reading and said selecting said way; and updating said way with said new cache line replacement information after said generating.
- 47. The method of claim 46, wherein said updating said way comprises updating only said way of said N ways of said row selected for replacement.
- 48. The method of claim 46, further comprising:
updating said way with a new cache line substantially concurrently with said updating said way with said new cache line replacement information.
- 49. The method of claim 46, further comprising:
updating said way with a new cache line tag substantially concurrently with said updating said way with said new cache line replacement information.
- 50. The method of claim 46, wherein said selecting a way for replacement comprises:
determining which of said N ways of said row selected is substantially least recently used in response to said reading said cache line replacement information stored in each of said N ways of said row selected.
CROSS REFERENCE TO RELATED APPLICATIONS
[0001] This application claims priority based on U.S. Provisional Application, Serial Number ______, filed Oct. 23, 2001, entitled “L2 CACHE LRU GENERATION METHOD AND APPARATUS.”
Provisional Applications (1)
|
Number |
Date |
Country |
|
60345451 |
Oct 2001 |
US |