CS352: Final Project
Project Assignment (due May 4, 2007 5:00 pm).
Source code to get started:
C++ Files: The following files can be used as a starting point for the project.
- Makefile
Configuration file for building your project. You will probably need to make
changes to it as your project evolves. Look in its comments for more details,
or in the man page:
$ man make
- funcs.cc
This file contains parseParams(), a function to help parse the command line
parameters that are passed to our cache simulator.
Note: Command line options have changed:
- -c = cache capacity
- -b = blocksize
- -a = associativity
The parseParams function takes care of this, just call it with the appropriate
variables. Remember to check the return value of the function as in main.cc.
- main.cc
Meant to be the top-level entry point for the project, it currently simply
illustrates the use of parseParams() to parse the commandline.
- funcs.h
Header file for funcs.cc
- io.cc
Sample code for reading the input trace format.
Java:
- cache_sim.java
Top level entry point
for the project. Currently contains the parseParams routine.
- io.java
Contains routines for reading in data
and writing out final cache statistics and contents. You should move
these routines to your own classes and code.
A perl script to check the formatting of your program's output:
- checker
Note that we will use a variation of this script for grading, so please
verify that it can parse your output correctly. To run this program,
download it and then change the file to executable. You can do this
using chmod +x checker. Then use checker outputfile to
check the output file.
Sample input and output file to help you test your program:
File containing input traces for test cases #1-#4: smalltraces.txt
File containing main address trace: cs352.trace
File containing main address trace, with smaller data values, suitable
for Java folks: new-cs352.trace
Note:
Java does not seem to support unsigned integers.
cs352.trace contains integers that are larger than the Java limit, and
as a result, the sample Java I/O code does not read them.
If you decide to use Java's signed numbers, you should use
new-cs352.trace which is an identical stream of requests, with the
exception that all large data values have been replaced by a smaller
ones. It should have identical hit and miss patterns, but should have
different final data than the cs352.trace output.
C++ programs should still use unsigned integers for the data, and should
have no trouble in this regard.
Last Modified : 4/5/07
by Bill Mark