1 / 14

CPU Optimization

CPU Optimization. Cache Mapping. Associative Mapping. Cache item stores in any empty slot Most efficient use of cache space Not practical – too slow. Memory Fragmentation Prevents Associative Mapping from being practical. Direct Mapping. Cache Location = MOD (Address, Cache Size)

triage
Download Presentation

CPU Optimization

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPU Optimization Cache Mapping

  2. Associative Mapping • Cache item stores in any empty slot • Most efficient use of cache space • Not practical – too slow

  3. Memory Fragmentation Prevents Associative Mapping from being practical

  4. Direct Mapping • Cache Location = MOD (Address, Cache Size) • Simplest and fastest • Low cache space utilization

  5. N-way Set-Associative Mapping • Cache Set Location = MOD (Address, Cache Size) • Each location can have “n ways” or slots • Most practical

  6. Source: CPU World

  7. Cache Considerations Factors that impact its performance

  8. Cache Levels

  9. LocalityWhich program do you think works better with cache? Photoshop MP3 Player Software

  10. Spatial Map of the Memory Use Total Memory use Instruction used. Used repeatedly during execution Data used (the image) Used repeatedly

  11. Cache Pollution: When cache stores data that is not resued Instruction used. Used repeatedly during execution Data used (the song) Used only once - Good instruction locality- Bad data locality

  12. Some Cache Systems Separate Instruction Cache and Data Cache Source: CPU World

  13. Why larger cache size is better? Cache performance depends on locality and the size of that locality Instruction Cache size (Too small) Instruction Cache size (OK)

  14. Nested LocalityA program typically has many levels of locality Example: - Smallest locality = 20 units - Medium locality = 200 units - Largest locality = 1000 units What should be the size of the cache? What if you have many cache levels?

More Related