1 / 6

Computer Architecture Cache Model John Morris

Computer Architecture Cache Model John Morris Electrical & Computer Enginering/ Computer Science, The University of Auckland. Iolanthe II drifts off Waiheke Island. 32. Cache Model. Cache size: 64 kbytes = 2 16 bytes Word size: 4 = 2 2 bytes = 32 bits Direct mapped cache

alika-hays
Download Presentation

Computer Architecture Cache Model John Morris

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. Computer Architecture Cache Model John Morris Electrical & Computer Enginering/Computer Science, The University of Auckland Iolanthe II drifts off Waiheke Island

  2. 32 Cache Model • Cache size: 64 kbytes = 216 bytes • Word size: 4 = 22 bytes = 32 bits • Direct mapped cache • Number of lines = 216/22 = 214 = 16384 • 2 bits: byte within a word • 14 bits: address of line • 32-14-2 = 16 bits: tag 16 14 2

  3. 32 Cache Model • Cache size: 64 kbytes = 216 bytes • Word size: 4 bytes = 32 bits • Line size: 32 = 25 bytes • Set associative cache • Number of ways = 8 • Number of lines = 216/25 = 211 = 2048 • Number of sets = 211/23 = 28 = 256 • 5 bits: byte within a line • 8 bits: address of set • 32-8-5 = 19 bits: tag 19 5 8

  4. Cache - Conflicts • Conflicts • Two addresses separated by 2k+mwill hit the same cache location p bits p-k-m k m cache address tag byte address Addresses in which these k bitsare the same will map to the samecache line

  5. 32 Cache Model • Cache size: 64 kbytes = 216 bytes • Word size: 4 bytes = 32 bits • Line size: 32 = 25 bytes • Set associative cache • Number of ways = 8 • Number of lines = 216/25 = 211 = 2048 • Number of sets = 211/23 = 28 = 256 • 5 bits: byte within a line • 8 bits: address of set • 32-8-5 = 19 bits: tag Step size for conflicts 28+5 = 8192 bytes 19 5 8

  6. Cache Model – Performance pitfalls • n-way set associative cachetolerates n conflicts at steps of 2k+m bytes through memory • Avoid data structures with elements of this size eg matrices with rows of 2k+m bytes Example: matrices with float (4 byte) elements 28+5 / 4 = 2048 elements • 2048 element arrays may show poor performance and are best avoided Similarly 1024 element arrays of doubles (8 bytes) may process slowly Using cache onprevious slide:Step size for conflicts 28+5 = 8192 bytes

More Related