Retro school children University of Washington Computer Science & Engineering
 CSE 548: Computer Architecture - Winter 2006
  CSE Home   About Us    Search    Contact Info 

 Course Home
   

Homework Assignment 1

Book Exercises

Problem 2.12 a,b,c

Inferring Cache Geometries

Chip D. Signer, Ph.D, is trying to reverse engineer a competitor's microprocessors to discover their cache geometry. Instead of running programs on these processors and inferring the cache layout from timing results, we will approximate his work by using a simulator.

Specifically, each of these "processors" is provided as an object file (.o file) against which you will link your code. See the file mystery-cache.h for documentation of the function interface that these object files export. Your job is to fill in the function stubs in cache-test-skel.c. When linked with one of these cache object files the resulting executable will determine and then output the cache size, block size, associativity. If the cache has a victim buffer, the number of entries will also be calculated and printed. As a sanity check, the file cache_64c_2a_16b.o is a 64 KB capacity, 2-way set-associative cache with 16B blocks) to help you check your work.

You should assume that the mystery caches have sizes that are powers of 2. You cannot assume anything else about the cache parameters except what you can infer from the cache size. Finally, the mystery caches are all pretty realistic in their geometries, so use this fact to sanity check your results.

You will need to complete this assignment on a Linux machine. All the files you need are in hw1.tar.gz. To extract the files from this archive, simply use the command:

tar xzf hw3.tar.gz

and the files will be extracted into the current directory. The provided Makefile includes a target cache-test. To use it, set TEST_CACHE to the object file to link against on the command line - i.e. run the command:

make cache-test TEST_CACHE=cache_64c_2a_16b.o

This will create an executable cache-test that will run your cache-inference code against the supplied cache object. Run this executable like so:

./cache-test

and it will print the results to the screen.

What you need to do

  1. Implement the 4 stub functions in cache-test-skel.c which have /* YOUR CODE GOES HERE */ comments in them.
  2. Determine the cache parameters for the provided mystery caches and add the results to your solutions for the problems from the book.
  3. Construct a short sequence of accesses to determine if a cache uses the LRU replacement policy. Add this sequence and a short description (2-3 sentences max) to your written solutions.

Turning in the assignment

For this assignment, submit your modified version of cache-test-skel.c via the Catalyst dropbox at https://catalysttools.washington.edu/collectit/dropbox/sbalensi/1651.

Produce a hard-copy for the rest of the problems, due in class on 2/4.


CSE logo Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA  98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to Joe]