Docsity

Lab Assignment 4: Evaluating Cache Hit Rates for Different Cache Architectures - Prof. Jam, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
Score:______ Section:____________ Date:__________ Name:______________________________
ECE 3055 Laboratory Assignment 4
Due Date: Wednesday, March 20
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:
http://www.ece.gatech.edu/~hamblen/3055/gcc_trace_txt.zip
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.
http://www.ece.gatech.edu/~hamblen/3055/read_trace.c
http://www.ece.gatech.edu/~hamblen/3055/read_trace.j
If you need help on the Java or C tools available on the ECE PC lab machines, see:
http://www.ece.gatech.edu/~hamblen/3055/VisCtut.doc
or
http://www.ece.gatech.edu/~hamblen/3055/VisJtut.doc
(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.

Partial preview of the text

Download Lab Assignment 4: Evaluating Cache Hit Rates for Different Cache Architectures - Prof. Jam and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Score:______ Section:____________ Date:__________ Name:______________________________

ECE 3055 Laboratory Assignment 4

Due Date: Wednesday, March 20

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:

http://www.ece.gatech.edu/~hamblen/3055/gcc_trace_txt.zip

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.

http://www.ece.gatech.edu/~hamblen/3055/read_trace.c

http://www.ece.gatech.edu/~hamblen/3055/read_trace.j

If you need help on the Java or C tools available on the ECE PC lab machines, see:

http://www.ece.gatech.edu/~hamblen/3055/VisCtut.doc

or

http://www.ece.gatech.edu/~hamblen/3055/VisJtut.doc

( 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.