Assigned: 2 November 2004
Due: 16 November 2004
The goal of this assignment is to give you a more concrete idea about caching. You will write your own data Cache Simulator and observe its behavior. Your results will be summarized in a written report, which you will turn in with your Simulator.
Cache Simulator Specifications
The input will be a series of decimal addresses that your cache will interpret as READS at that address. For simplicity, assume memory is word addressable and your cache blocks are 1 word each. A word in our system is 4 bytes. The size of your cache will be specified in words.
The input file can be downloaded from here or from blackboard.
In a real system, meaningful data would exist in memory. For this project, assume that each memory address requested contains one word, the address at which it is located. So, for example, address 100 would have the data 100 stored at it. Please follow this convention for testing. What does this mean as far as your source code? When you get a cache miss you should store the address requested in the appropriate location in the cache.
Your cache will run under two configurations:
You will run each configuration on 4 different sizes, for a total of 8 different cache simulations on the input. The sizes you run will depend on the last 2 digits of your PID as indicated in the table below:
|last 2 PID digits||Cache sizes|
|00–24||64, 256, 512, 8k|
|25–49||32, 128, 1k, 16k|
|50–74||128, 256, 2k, 32k|
|75–99||256, 512, 4k, 16k|
The output of your program should be (under each configuration and size combination):
Your program should be invoked with a line like the following:
cache trc.txt 1 1024
which would run your cache on trc.txt input with configuration 1 (direct mapped) and a cache of total size 1024 words.
Your Cache Simulator will be written in C, C++, or Java. It will not be graded unless it builds cleanly.
You will email firstname.lastname@example.org with your source files and a Word or PDF file describing your results.
Your written report should include:
You should be able to convey your ideas (#1 and #2) in less than a page. A program turned in without a written report will receive very little partial credit, so please write up a discussion of any results you have before submitting your work.