Submit your solution online by 2:45pm on Wednesday, December 5.
Do this by creating a directory named proj5
that contains a file named proj5.c.
From within that directory, type "submit proj5".
The files are
provided in the directory ~cs61c/files/proj/5 augment a solution
to proj3 to add a simulation of the cache.
Complete the program by filling in appropriate procedures in
The code in sim.c is similar to its proj3
It is used as follows:
sim [-i -r -m -c -d -aarg -sarg -barg] inputfile
The following is a list of the framework files and their purposes. Download, or
copy them from ~cs61c/files/proj/5/.
You are to complete the simulator by writing the unfinished code in the file proj5.c.
Do not change the framework code or add any more source files;
just fill in the frameworks where indicated. You may provide additional helper functions.
The procedures that you must complete in proj5.c are:
While these may seem like trivial corner cases, to some extent these details do
reflect the real operation of a cache. Of course, some of this is merely an
outgrowth of our need to rely on the autograder, for which we really do apologize.
You should have more than enough code to test a processor at this point, given proj3 and proj4.
However, you will need to be sure to exercise
your cache thoroughly. A test program such as cache.s from lab12
is a decent start, though it certainly isn't the whole story.
There are two possible errors which can arise in the code you need to write. These are both documented in the comments for the relevant code.