The structure of the memory
Recently seen in terms of the relevant cache GPU reading the literature of the time, the time I saw them was at school, when some can not remember, turned down CSAPP review the next cache line, cache set relevant content.
Cache organization
is divided into a number of cache set, each set there are a number of cache line, each valid bit Cache line and contains the tag bits, high to low so that the memory address is divided into three parts:
- tags, used to determine which cache line set in
- set index, set to select
- block offset in cache line, the cache line to memory offset positioning
Three different cache layout
- direct mapped caches
- The simplest, each set only one cache line
- The disadvantage is that only when continuous access to different tag multiple memory addresses, can cause continuous cache miss
- set associative caches
- Is a compromise designed two programs
- full associative caches
- The most complex, there is only one set
- The disadvantage is that a set has a lot of cache line, find the time complexity of complex tag is high, poor hardware design