
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Score:______ Section:____________ Date:__________ Name:______________________________
In this lab, you will use Java or C/C++ to write a program that will evaluate and compare the cache hit rates for several cache architectures. Given a particular memory organization (size of address space, and size of cache memory), the program will read a file containing a memory trace (a sequence of memory addresses) and determine which of the memory references will cause cache hits. The program should keep track of the total number of hits and misses generated by each cache over the entire trace. The hit rate should be plotted for different cache memory sizes and architectures (as detailed below). The trace file is available in zip format from the Lab Web page:
There are 1,000,000 memory references in the trace file stored one per line. The address is the second field on the line. The first field gives the type of the memory reference (2 for instruction fetch, 1 for store, and 0 for load). The third field gives the instruction value for a fetch and is always 0 for loads and stores. Keep track of combined hits rate and the hit rate for instructions and data. To help you get started on the lab, a simple program that reads the trace file, extracts the address, and performs some simple bit-wise operations similar to what is needed to extract a bit fields from the address to determine the cache address is available at the URL below in both C and Java formats.
If you need help on the Java or C tools available on the ECE PC lab machines, see:
( 80% ) Part 1: On a single page, plot the cache hit rates versus cache memory size for a single direct-mapped cache, and a separate direct-mapped instruction and data cache (each the same size, ½ of the single combined cache) using the trace file. Data comes from LOAD or STORE operations. Data points should be generated for cache memory sizes starting at 128 to 32K in powers of two. Include 64K and 128K, if possible. ( 20% + 10% extra credit ) Part 2 - Optional: Repeat Part 1 for 2, 4, and 8 sets in a set-associative cache and compare results with the same total number of cached data locations from Part 1. You do not have to write code to plot the data, only to calculate it. The plotting can be done by any method you wish, e.g. by hand or graph paper or with an available plotting program such as MS Excel.