Intro to cache memory. Kosarev Nikolay MIPT Nov, 200 9. Agenda. Cache Placement of cache block Searching of data in the cache Replacement policies Write policies. Cache. Cache is a buffer for storing of data copies for rapid access
Intro to cache memoryKosarev NikolayMIPT Nov, 2009Agenda
CachePlacement of cache blockSearching of data in the cacheReplacement policiesWrite policiesCacheCache is a buffer for storing of data copies for rapid access
Takes advantage of the principle of locality (temporal, spatial)Consists of blocks / lines (portions of data retrieved from the main memory)Each block has an address tag (address of the block in the main memory)Hit (Miss) – data was found (wasn’t found) in the cachePlacement of cache block3 types of cache
Direct mapped: (block address) mod (blocks in cache)Set associative: (block address) mod (sets in cache)Fully associative2-way set associative cacheSearching of dataProcessor address is analyzed
Index field selects the setTag is compared against all blocks in set for a hitOffset field selects data from the blockNote: all address tags are searched in parallelCache HIT access time is criticalReplacement policies3 frequently used algorithms
RandomSimple to implementLeast recently used (LRU)Block unused for the longest time is replacedComplicated to calculate -> approximatedFirst in first out (FIFO)The oldest block is replaced