In this lab, you will write a trace-driven cache simulation program to compare an associative cache with a victim cache arrangement. You will turn in (C or C++) source code and a PC executable called "cachesim." Your executable will take two arguments:
cachesim [tracefile] -[flag]
For all caches simulated:
The victim buffer will have eight entries.
Your program will report:
You will also output a file called "misses" which will contain a list of line numbers (each on a new line) that correspond to the line number of every reference from the tracefile that caused a miss.
The trace file will contain a series of memory references, each on a new line and represented in ASCII as follows:
[hex address]
The first item is a hexadecimal memory address printed in ASCII.
You will generate one trace file with which to demonstrate your program. The trace will be synthetic (not based upon real programs). The trace should perform equally well on the victim cache as the 4-way set associative cache, but not as well on a 2-way set associative cache. The tracefile should be 1000 references long. I suggest you write a small program to generate each one.
You will turn in the tracefile, your source code, and your cachesim executable. Please include a Makefile and/or instructions on how to compile your program. The grader will also run his own tracefiles with your simulator.