CS 4753 Computer Architecture Lab
Lab1 Cache Simulation and
Associativity
Overview:
This problem introduces the sim-cheetah cache simulator. In order to
simulate several cache configurations at one time, the simulator utilizes
an algorithm devised by Rabin Sugumar and Santosh Abraham while they were
at the University of Michigan. You can look at the sim-cheetah summary by
entering the command sim-cheetah by itself.
A single run of sim-cheetah can
simulate cache performance over a range of associativity (cache lines per set) and number of sets.
In this lab, you will investigate the performance while executing the SPEC95 benchmark swim.ss
The command line will
be:
sim-cheetah <argument> swim.ss
if you use configuration file, e.x. test.cfg, then the command line will be:
sim-cheetah -config test.cfg swim.ss
( use "ctrl - d" to continue execution, do not
use "ctrl - x")
Methods:
1. Use a single run of sim-cheetah to simulate the performance of the
cache under the following conditions:
- least-recently-used (LRU) replacement policy
- 32 to 512 sets
- 1-way to 4-way associativity
- 16-byte cache lines (block size)
Do this two times, once each for a data-only cache and an instruction-only cache.
Tabulate your results like the table below (as presented by the simulator). Save (cut & paste) the results from each
simulation into an appropriately named ASCII file.
| Miss ratio |
1-way |
2-way |
3-way |
4-way |
| 32 sets |
|
|
|
|
| 64 sets |
|
|
|
|
| 128 sets |
|
|
|
|
| 256 sets |
|
|
|
|
| 512 sets |
|
|
|
|
2. Use Matlab to plot the results of the simulations (load the data from each ASCII file into a matrix).
For each of the simulations (data, instruction), plot the miss ratio versus associativity
for each number of sets. Using markers, show the points on the curves which correspond to total cache sizes of
1 Kbytes, 2 Kbytes, 4 Kbytes and 8 K bytes (total cache size = sets * block size * associativity). For each simulation, you should produce something that resembles the plot below,
in which the results are from the instruction cache simulation. (You can also use
Excel to plot the results)

Submit:
In your report, you should include content of configuration file, the table and plot for each simulation. From these plots obtained above,
assess the relative performance benefits of cache associativity versus the number of sets.
You should address (and explain) the following issues:
- For a given number of sets, what effect does increasing associativity have on the miss ratio?
- For a given associativity, what is the effect of increasing the number of sets?
- For a given cache size, how does the miss ratio change when going from an associativity of one to two to four? Explain.
- If you were to design a data cache, limited to a total cache size of 4 Kbytes, which cache organization would you choose, based solely on performance?
Due: Before midnight on Feb. 26th 2004
Last modified by Kevin Su,
xsu@ cs.utsa.edu ,