CMSC 201 -- Cache Lab

Lab 4 -- Cache Lab

The Problem

Write the code for a program that simulates a cache. Your program will take in the filename of a trace file as a command line argument. In this lab we will:
  1. simulate a direct mapped, fully associative, and set associative caches
  2. write a README.txt
  3. interpret our results
Remember, you will be graded on style, syntax, functionality, and correctness.

Getting Started

Log into the computer science server and create a new directory.
  1. Use wget to download the trace file at http://cs.longwood.edu/courses/cmsc201/f17/files/best.trace
  2. Use wget to download a Makefile file at http://cs.longwood.edu/courses/cmsc201/f17/files/Makefile
Trace files contain one memory operation per line. The last number on the line is the number of bytes to read/write (all bytes need to be in the cache to have a hit).

Implementation

You will need to simulate several different features of a caches:
  1. Block sizes of at least 8, 16, 32, and 64 bytes
  2. Sets sizes of at least 8, 16, 32, and 64 cache lines
  3. Direct mapped caches
  4. Fully associative caches
  5. Replacement policy of both Random and LRU
  6. Cache sizes of at least 1024, 2048, 4096, and 8192 bytes
You will need to output a single file containing tables showing the hit rate for each of these caches. An example results file can be seen here. Included in your readme should be an analysis of the results.

Handin

When you are done you may hand in your lab by using the handin script (lab4).

The lab is due at 11:59pm Nov. 28th 2017.