1 / 7

Recap: Memory Hierarchy of a Modern Computer System

Recap: Memory Hierarchy of a Modern Computer System. By taking advantage of the principle of locality: Present the user with as much memory as is available in the cheapest technology. Provide access at the speed offered by the fastest technology. Processor. Control. Tertiary Storage (Disk).

Télécharger la présentation

Recap: Memory Hierarchy of a Modern Computer System

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. Recap: Memory Hierarchy of a Modern Computer System • By taking advantage of the principle of locality: • Present the user with as much memory as is available in the cheapest technology. • Provide access at the speed offered by the fastest technology. Processor Control Tertiary Storage (Disk) Secondary Storage (Disk) Second Level Cache (SRAM) Main Memory (DRAM) On-Chip Cache Datapath Registers Speed (ns): 1s 10s 100s 10,000,000s (10s ms) 10,000,000,000s (10s sec) Size (bytes): 100s Ks Ms Gs Ts

  2. 4 Questions for Memory Hierarchy • Q1: Where can a block be placed in the cache? (Block placement) • Q2: How is a block found if it is in the cache?(Block identification) • Q3: Which block should be replaced on a miss? (Block replacement) • Q4: What happens on a write? (Write strategy)

  3. Summary of caches: • The Principle of Locality: • Program likely to access a relatively small portion of the address space at any instant of time. • Temporal Locality: Locality in Time • Spatial Locality: Locality in Space • Three Major Categories of Cache Misses: • Compulsory Misses: sad facts of life. Example: cold start misses. • Conflict Misses: increase cache size and/or associativity. Nightmare Scenario: ping pong effect! • Capacity Misses: increase cache size • Cache Design Space • total size, block size, associativity • replacement policy • write-hit policy (write-through, write-back)

  4. Q1: Where can a block be placed in the cache? • Direct mapped – every block has only one possible location, shared by others • Set associative – every block has several possible locations, shared by others in its set • Fully associative – a block may be located anywhere • Why not always use full associativity?

  5. Q2: How is a block found if it is in the cache? • Index is used to find possible location(s) • Tag on each block within possible locations must be compared against tag in address we’re looking for • Increasing associativity shrinks index, expands tag so it becomes more expensive to determine whether block is in cache

  6. Q3: Which block should be replaced on a miss? • Easy for Direct Mapped (why?) • Set Associative or Fully Associative: • Random • LRU (Least Recently Used)

  7. Q4: What happens on a write? • Write through—The information is written to both the block in the cache and to the block in the lower-level memory. • Write back—The information is written only to the block in the cache. The modified cache block is written to main memory only when it is replaced. • Have to check whether block is clean or dirty • Pros and Cons of each? • WT: read misses cannot result in writes • WB: no writes of repeated writes • WT always combined with write buffers so that don’t wait for lower level memory

More Related