






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!







College of Computing
CS6290/CS4290 — High-Performance Computer Architecture Fall 2001
CS6290/CS4290 Issued: August 24, 2001 Project 1 Due: September 21, 2001
Purpose: The goal of this project is to understand the tradeoffs in caches by designing a multilevel cache hierarchy. The project will also expose you to some architecture evaluation techniques.
Reading: H&P Chapter 5, [Jouppi90] Also, the various “real machine” descriptions are useful
Problems: 1. Warmup: Benchmarks
To turn in: Turn in a write-up that describes your cache configuration, its cost and performance and a justification (including data) for your con- clusions.
Collaboration: (As in the syllabus) collaboration on projects and homework in pairs is encouraged. If you work in a pair, turn in one write-up with the names of both collaborators. You’re welcome to discuss high-level concepts with other groups, but all homework solutions must be worked out and written up separately.
Appendix: man page for cachesim
NOTE: support files for this assignment are available via NFS on CoC machines in the following directory: /users/projects/class/6290/fall01/
Problem 1: Cache Simulation
This is a warm-up problem: find the cache simulator and benchmarks. To make the exercise concrete, pick one benchmark and simulate it with a range of cache sizes. The results should reveal the “characteristic” of this application with respect to the cache.
The simulator, cachesim5, is restricted to running on Sun Sparc-based machines. The restriction arises because the simulator uses a dynamic code generation technique that operates by rewriting the target executable on the fly to include instrumentation code. The result is a fast simulation technique but one that is tied to a particular instruction set.
Machines
Use the Sun Ultra 10 workstations in the CoC “cities” cluster. The benchmarks are sized to require about a minute of CPU time on these machines for one run with a cache.
Please observe the following policy when using machines remotely:
Simulator Executable
The simulator is called “cachesim5”. To prepare to run the simulator, set your path as follows (on an Ultra running Solaris):
set path = ($path /users/projects/class/6290/fall01/shade/shade.v9.elf/bin)
B: Find the miss rates for a range of cache sizes using your bench- mark. Use a separate I and D caches (to keep the effects separate) and a 16-byte block size. In the spirit of striving to avoid work bet- ter performed by a machine, here’s an example of a shell script for testing a range of cache designs.
#!/bin/csh
foreach x (128 256 512 1K 2K 4K 8K 16K 32K 64K) echo "$x-bytes:" echo ’/bin/date’ | cachesim5 -i$x’b16’ -d$x’b16’ | egrep ’. misses’ end
Note that the miss rate numbers you want are the ones in parentheses at the end of the “I misses” and “D misses” lines – the egrep command selects those lines only.
C: Plot the results obtained above for your selected benchmark. Plot percent misses versus cache size on a semi-log plot.
D: What can you deduce about the memory needs of the appli- cation from the plot? E.g. how big is the “hot” part (the “working- set”) of instructions? of data? Is there more than one working-set size?
Different benchmarks will obviously lead to different results. We’ll try to compare results for all three benchmarks in class at some point. Note that you can use cachesim5 to characterize any SPARC/Solaris application this way.
Problem 2: Design Specifications
This section describes the constraints on the cache design. There is nothing to turn in for this problem – the “questions” are parts of the design statement.
The goal of the project is to design a cache with the best (smallest) average memory access time (AMAT) given these constraints. The information below describes the constraints in three parts: first, the time and space (clock cycle and transistor budget) and external constraints on the design, second, a model you should use for estimating the number of transistors in a cache design and third, a model for estimating the access time for a cache design.
Note: despite the VLSI-level detail here, you don’t need any prior knowledge of VLSI to approach this assignment.
A: CONSTRAINTS As the memory system designer for a microprocessor, you are constrained by the amount of space available on the die, the amount of time in a clock cycle and the limitations of the devices to which you must interface. Ordinarily, there’d be some give-and-take between the resources used by the cache and those used by other things, but we’ll assume that all these parameters are fixed. In short, then:
Parameter Constraint Space 10,000,000 transistors, on-chip Time fixed 1nS (1 · 10 −^9 seconds) clock period DRAM time first access, TDRAM 100 clock cycles (100nS) DRAM time, subsequent accesses 20 clock cycles (20nS) DRAM data bus width 128 bits
The goal is to minimize the average memory access time (AMAT). For instance, with a one-level cache with a line size of up to 16 bytes (128 bits), you’d write:
AMAT = Thit + (1 − h) · Tmiss = Thit + (1 − h) · TDRAM = Thit + (1 − h) · 100 cycles
Where TDRAM is 100 cycles, Thit is some integral number of clock cycles given by your cache design according to the model described below and (1 − h) is the miss rate, as determined from simulation of the your cache design.
The total number of transistors, Ntransistors, estimated for your de- sign using this model must fit within the budget of 10,000,000 tran- sistors.
C: HIT TIME MODEL Similarly, in order to know the number of clock cycles your cache(s) require, you need to be able to estimate the delay through a cache. The largest component of delay through a memory is generally the time required to charge the (long) row and column wires. The time is proportional to the length of the wires. We’ll adopt a timing model that uses this length as the basic delay estimate and then add a penalty for associativity as suggested by the text. The timing model is then (for each individual cache):
i. Estimate the base time as Tarray = 2 ·
Nbits · 3pS, where Nbits is the total number of bits in the memory array as estimated earlier and 3pS/wire is a wild guess. Note, pS is picoseconds – 10−^12 seconds. ii.a. If the cache is direct, Tcache = Tarray. ii.b. Otherwise, Tcache = T array · (1.10 + 0. 02 · (dlog 2 (N )e − 1)) for N -way associativity. i.e., 10% for the first multiplexor plus 2% for each additional multiplexor. iii. All accesses require integral numbers of clock cycles, so be sure to round Tcache up to the next multiple of 1nS.
There are no restrictions per se on the number of clocks required to access a cache; the number just contributes to Thit for that level of the cache. However, my bet is that the lowest AMAT will be achieved with a single-cycle L1 cache.
D: MISS PENALTY TIME MODEL Finally, the miss penalty for each cache must account for all three components of miss time: bus busy time, access time and transfer time.
i. The access time is the time to get the first block from the next lower level of memory. For the lowest level of cache, this time is 100 cycles (100nS) by definition for the first 16 bytes. ii. The transfer time is the time to fetch subsequent blocks if necessary. From main memory, subsequent blocks require 20 cycles (20ns) each by definition. iii. Bus busy time is the time the bus the occupied with other work before an access can begin. Not all designs will have a bus busy time and designs that do will be scrutinized closely. Bus busy can only arise if there can
be independent “background” accesses to memory indepen- dent of (and effectively in parallel with) the main, “fore- ground” cache miss accesses. In this project, background accesses arise if you use write buffers circuits and/or early- restart/critical-word-first circuits. If your design must ac- count for bus busy time, provide an approximation to the bus busy time including detailed calculations or prove that the bus busy time is negligible.
i. Assume byte addressing. ii. Assume the processor addresses are 32 bits. iii. On-chip, inter-cache-level busses may be as wide as you like (as wide as a cache line). iv. If you use a write buffer, you may assume that it has unlim- ited size. Specifically, if the write buffer is in the middle of accessing main memory at the time a cache miss occurs, you only have to add busy time to wait for that one write-buffer write to finish, not for the whole write buffer to empty itself. v.-∞. State any other assumptions you need to make.
Problem 3: Cache Design and Writeup
A: Go design some caches!
Limit yourself to what you can simulate with cachesim5 (see the attached man page). For instance, cachesim5 doesn’t model victim caches (unless you feel like extending it...). Happily, all these dimensions are available:
i. Blocksize. ii. Write policy. iii. Associativity (1-way to 8-way). iv. Replacement policy. v. Single and two-level caches (I can’t imagine more than two levels being profitable). vi. Split instruction and data (I&D) caches versus a unified.
I’d start by doing some arithmetic to feel out the limits for what will fit, then simulating a few points with one of the benchmarks to get a feel for what is sane. Finally, when you’ve narrowed the space down to just a few candidates, set up some simulations to do the final tuning.
B: Write up your design in the form of a lab report. The writeup should address at least the following points: i. Describe the final design, draw its logical structure and label all the components. ii. Give the cachesim5 command line you use. iii. Give the cost in space and time of each cache and each miss penalty according to the models. iv. Give the AMAT equation for your hardware. Note that it is a good practice to compute your AMAT by dividing the total using the total counts of events and instructions reported by the simulator rather than using the ratios reported by the simulator. v. List any other assumptions you had to make. vi. Explain how you narrowed the design space, describe your experiments and present the data you used to justify the final design. vii. Explain any parameters or other ambiguities you couldn’t pin down (e.g., because pinning them down would have required prohibitive simulation time).
Finally,
viii. How (where) would you add a victim cache? Would you expect much benefit?