A cache simulator

The problem

Build a configurable cache simulator that replays a trace of memory addresses, and use it to find out how block size, associativity and replacement change the hit rate of a small program.

Requirements

Technologies

Step by step

  1. Write the function that splits an address into tag, index and offset.
  2. Implement a set with LRU order and test it on a short trace by hand.
  3. Add the miss classification and the hit rate and AMAT report.
  4. Run row-order and column-order traces and several cache shapes, and write down what you see.

Expected result

A program and a short table that show how cache shape and access order change hits, misses and average access time.

How it is evaluated

Ways to improve it