Lab One: Cache Simulator Steve Shen
Lab One: Cache Simulator Steve Shen
Lab One: Cache Simulator Steve Shen
Lab1
In general, higher blocks had a smaller miss rate. The RAND technique overall had the lowest miss rate using the given input sequence and the Least recently used (LRU) came in second. For the given input sequence, the 64 block 4-way RAND had the best performance. (b) What other block replacement technique can be used and is proved to be the ideal? Explain. Optimal page replacement (OPT) swaps out a page whose next use will occur furthers in the future whenever a page needs to be swapped in; however, it is difficult to figure out how long it will be before a page is going to be used so it is impractical except when the software that runs on the system will work with static analysis of its memory reference patterns. 2) In an N-way set-associative cache, blocks are mapped to different sets when N changes. Also, for a particular sequence, the number of compulsory and conflict misses change with the cache type. Consider the following sequence 4 0 9 7 8 11 7 5 2 1 12 6 8.
COSC6340
Lab1
(a) List the compulsory and conflict misses for techniques for the caches below. MISSES LRU FIFO Comp Conflict Comp 4 blocks 2 sets 4 8 4 8 blocks 2 sets 8 3 8 16 blocks 2 sets 11 0 11
(b) Define compulsory, capacity and conflict misses. Explain the difference between them. Compulsory misses are those misses caused by the first reference to a location in memory. Capacity misses are ones that happen due to the limited size of the cache and conflict misses are misses that happen when several blocks are mapped to the same set or block frame. (c) What is the best way to reduce conflict misses? Can it be used? A fully associative cache would reduce miss rates the most; however, the perfection of one is impossible because the future cannot be read so currently you have to deal with a trade-off where you can get lower miss rates but suffer from a high miss penalty. (d) List which set in the given cache will the following blocks be mapped BLOCK 0 9 11 4 2 9 10 4 7 1 12 3 CACHE 8 blocks, 2 sets #SET 0 1 1 0 2 1 2 0 1 1 0 1
8 blocks, 4 sets
16 blocks, 2 sets