Cache Advanced Higher
SQA Arrangements Description of the structured use of cache memory to improve processor performance referring to the use of level 1 and level 2 cache as well as the use of static RAM.
Cache and Its Importance in Performance Motivation: Time to run code = clock cycles running code + clock cycles waiting for memory For many years, CPU’s have sped up an average of 50% per year over memory chip speed ups. Hence, memory access is the bottleneck to computing fast Definition of a cache: Dictionary: a safe place to hide or store things. Computer: a level in a memory hierarchy.
What is a cache? Small, fast storage used to improve average access time to slow memory. Exploits spatial and temporal locality In computer architecture, almost everything is a cache! Registers “a cache” on variables – software managed First-level cache a cache on second-level cache Second-level cache a cache on memory Memory a cache on disk (virtual memory) TLB a cache on page table Branch-prediction a cache on prediction information?
Access Times L1 cache - Memory accesses at full microprocessor speed (10 nanoseconds, 4 kilobytes to 16 kilobytes in size) L2 cache - Memory access of type SRAM (around 20 to 30 nanoseconds, 128 kilobytes to 512 kilobytes in size) Main memory - Memory access of type RAM (around 60 nanoseconds, 32 megabytes to 128 megabytes in size) Hard disk - Mechanical, slow (around 12 milliseconds, 1 gigabyte to 10 gigabytes in size) Internet - Incredibly slow (between 1 second and 3 days, unlimited size)