|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Memory: cache |
|
|
|
|
|
|
|
Memory hierarchy |
|
|
|
|
|
As distance from CPU
increases, so does size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fig 7.3 |
|
|
|
|
|
|
To take advantage of: |
|
|
|
|
|
temporal locality: keep
recently used data closer to CPU |
|
|
|
|
|
spatial locality: when
moving data to a higher level, move a contiguous block |
|
|
Miss:
requested data not found in currrent level |
|
|
|
Hit:
requested data is found in current level |
|
|
|
Hit rate: how often a requested data item is found in a given level of
the hierarchy |
|
|
If
hit rate at the top levels of the hierarchy is large, then the average access
time |
|
|
will be close to the
fastest access time |
|
|
|
|
Cache:
level in hierarchy between CPU and main memory |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|