next up previous
Next: Measurements Up: Set-Associative Instruction Caches Previous: Set-Associative Instruction Caches

Example

Consider the example in Figure 7.

  
Figure 7: Example of Instruction Categories

Program lines A, B, and C map into the same cache line within a 2-way set-associative cache. B and C are executed within a loop. A is executed before the loop (instance 1 of foo) and twice within the loop (instances 2 and 3 of foo). For foo(1), A is an always miss since A is not in the ACS of foo(1). For foo(2), A is a first-hit since it was brought into cache by foo(1), there are 3 conflicts within the loop (and only 2 cache lines within the set) but B is the only conflict in the output ACS and the LCS within the loop. For foo(3), A is an always-hit due to temporal locality since it was brought into the ACS by foo(2) and there are no conflicts in this ACS. Notice that B and C are always-misses since they are not in the ACS of their blocks. However, if there were no calls to foo() within the loop, B and C would be first-misses since they would remain in the sets once they are referenced and brought into cache and there are only 2 conflicting lines within the loop.



Robert Palmer
Mon May 19 10:18:36 EDT 1997