Patent ID: 7069388

Claim:
A method for caching specified data of a primary storage main memory in an n-way set associative memory with a copy-back update policy, said associative memory comprising a plurality of rows, each row comprising n ways, said method comprising: selecting a row of said associative memory according to an address of said specified data; if a first way of said selected row comprises invalid data, caching said specified data in said first way and discontinuing said data caching process; and if all of said n ways of said selected row comprise valid data, performing the steps of: i. selecting a second way of said selected row according to a first predetermined replacement strategy; ii. if said second way comprises unmodified data, caching said specified data in said second way and discontinuing said data caching process; iii. if said second way comprises modified data, and if at least one of said ways comprises data from a currently open page of said main memory, caching said specified data in a way comprising data from said currently open page and discontinuing said data caching process; and iv. if said second way comprises modified data, and if none of said n ways of said selected row comprise data from said currently open page of said main memory, caching said specified data in said second way.