Machine Organization and Assembly Language programming
Problem Set #7 Due: Friday May 30th

In this assignment you will write in a language of your choice (C, C++, Java) the skeleton of a trace-driven simulator for assessing the performance of a cache. You should do this assignment by yourself.

It is recommended that you use Java so that it will be easier for Tapan to compile/run your programs. If you use C or C++, and even in the case of Java, limit the use of any external GUI libraries or other helper libraries. For anything non-standard, include detailed explanations in the README file.

Trace-driven simulation is a widely used technique to assess the performance of the components of the memory hierarchy. A sample trace file is here. In broad terms, the simulator works as follows

Input Output Algorithm
  • Process each memory reference in turn. Decompose the address in (tag, index, displacement) components
  • Check if the memory reference hits in the appropriate cache (note that you don't bring data in the simulated cache; you only simulate the presence/absence of particular blocks)
  • Take appropriate actions. In case of a hit, record statistics, maybe turn on some valid/dirty bits etc. In case of a miss, bring in the missing block, replace an old one, record statistics etc.

    Your assignment is to write a cache simulator (you can do exercise 7.7 in your book by hand to warm you up) with the following specifications.

    The output statistics that you should generate are:

    You should turnin a README file indicating briefly how to run your program and how to read the output. In case you are aware of bugs and did not have time to correct them, indicate it in the README file. Send e-mail to Tapan (tapan@cs) with subject 378ASS7 with your file called LASTNAME.xyz (xyz depends on the language you used).


    baer@cs.washington.edu (Last Update: 4/23/03 )