Instructor: Michael Taylor
Homework Policies:
Homework:
What are the two types of "RAT's" in the Netburst architecture? Why are two types needed compared to only 1 in the P6 architecture?
During a sleepless night, you decide to check out the assembly code for a bunch of programs you have compiled on your SatTech MIPS-based computer. You happen to notice the following sequence of instructions happening a lot in your code (although not necessarily with the same registers):
load R1, 0(R2)
add R1, R1, R3
store R1, 0(R2)
Basically, this sequence fetches a value from memory, increments it by some amount and stores it back immediately. You decide it would be handy to add the following instruction to your ISA:
INC R1, 0(R2)
The INC instruction takes the value in R1 and adds it to the address specified in the 2nd part of the instruction (in this case 0 + address of R2). Unfortunately, you don't have any memory that will support this type of operation in memory so you need to modify your CPU to support it.
a) Using the basic 5-stage MIPS pipeline as your inspiration, create a new pipeline that will be able to handle the new INC instruction. Make sure to explain how your pipeline operates (specifically on load/store ops, ALU ops, and the new INC op) and why it should be ok on other instructions. Remember that all instructions must go through all of the stages (although it is ok if some stages don't do anything on certain instructions).
b) You would like to compare your new pipeline with the INC instruction to the old 5-stage MIPS pipeline without the new instruction. Do so by comparing the number of cycles required for each set of instructions given below on the 2 different pipelines, assuming that you have data forwarding available (draw pipeline diagrams like in Fig. A.33).
load R1, 0(R2)
add R1, R1, R3 store R1, 0(R2) |
vs. | inc R3, 0(R2) |
load R1, 0(R2)
add R1, R1, R3 store R1, 0(R2) load R1, 0(R4) add R1, R1, R5 store R1, 0(R4) |
vs. |
inc R3, 0(R2)
inc R5, 0(R4) |
Does your performance (relative to the old pipeline) increase with multiple INC instructions in a row?
c) Draw a pipeline diagram (as in Fig. A.33) to show what happens on your new pipeline with the following code fragment.
inc R1, 0(R2)
load R2, 0(R3)
inc R1, 0(R2)
d) Now assume that you are able to change your pipeline control so that operations that don't use all the stages of your new pipeline can skip the ones that they don't use. How would or wouldn't this improve the performance of your pipeline (give a specific example)?