



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!




CIS501 Fall 2005
Due: Tuesday, September 27th^ at noon.
Instructions: Your submission for this assignment must be type-written, except for your answers to Question 4, parts (a) and (b), which must be completed on the enclosed worksheet. To submit the assignment, you will hand in a print out of your answers, along with the worksheet at the start of class on the 27th.
Question 1: Processor X has a clock speed of 1 GHz, and takes 1 cycle for integer operations, 2 cycles for memory operations, and 4 cycles for floating point operations. Empirical data shows that programs run on Processor X typically are composed of 35% floating point operations, 30% memory operations, and 35% integer operations. You are design- ing Processor Y, an improvement on Processor X which will run the same programs and you have 2 options to improve the performance:
Compute the speedup for both options and decide the option Processor Y should take.
Question 2: You have learned about the difference between RISC and CISC ISAs, as well as many of the advantages of a RISC ISA for actual hard- ware. Consider for a moment, a virtual machine– a piece of software that decodes and executes instructions (for example, a Java virtual ma- chine executes Java instructions in Java bytecode). Suppose that you were asked to design a new ISA which will only be implemented in a vitual machine, never in hardware. Analyze the benefits and disadvan- tages of RISC vs CISC features for this new ISA. Some of the features you should include in your analysis are:
Question 3: Consider the expressions:
Where variables A, B, and C are initially in memory and the destina- tions of D and E are also in memory.
Question 4: For this question, you will be using the SimpleScalar simulator (see below) on two benchmarks- twolf (from SpecInt) and art (from SpecFP).
In order to obtain the source code for SimpleScalar for this homework, copy the contents of ~cis501/SimpleScalar/hwk1/ to your home directory, your computer, or wherever you plan to edit the code. You should be able to build the simulator simply by running “make”. The SimpleScalar distri- bution for this homework is stripped down to contain only the functional simulator sim-func. A functional simulation means that only the effects of the instructions are simulated, not timing or power information. SimpleScalar does not run the operating system, instead it reads a file which contains the program, as well as the results of system calls (i.e. the inputs of the program). The two programs you will be experimenting with in this assignment are found in the “programs” directory. In order to run the functional simulator on twolf, for example, you would do:
./sim-func programs/twolf.eio Note that on eniac-l, twolf takes about 45 seconds, and art takes about 4 minutes to run. For part (b) of Question 4, you are asked to modify the code for the simulator. In order to simplify this task, we have indicated where you will need to modify the simulator. If you look in sim-func.c, you will find 3 comments stating /* YOUR CODE GOES HERE /. One of these is found in the function sim_aux_stats, which prints the simulation statistics. This is where you should insert your code to print out the counts you gather. To accomplish this task, you should use the print_counter function which takes 4 arguments- the stream to print to, the name of the statistic being printed, the value, and a description of the statistic. The second / YOUR CODE GOES HERE / comment is found inside the sim_sample_on function- the main loop of the simulator which executes the instructions. We have provided code which tests if the current instruction is a load or store, and if it has an immediate offset. Additionally, we have provided code to extract that immediate offset into the variable “immediate” as a signed integer. The final / YOUR CODE GOES HERE */ comment is found in sim_start, which is called once before the simulation starts. If your solution needs any one time initalization code, it should be placed here. These comments are only hints, not requirements. If you want to write a solution which ignores these hints, you are free to do so. Two final warnings: