Do problem 3.1 in the text for the following code sequence, assuming that
R4 = R3 - 196 at the start of the loop. In addition, write
the C code that this assembly language code implements.
You are trying to choose between a history file and a futures file for handling
exceptions and restoring values to registers. What information do you need
to make your choice? In particular, how could you quantify the cost of using
each option? Which option is likely to require more hardware (registers and/or
control)? Why?
Your measurements have shown that exceptions occur on average once every
500 instructions. The overall CPI of your architecture without exceptions
is 1.2, and the CPU runs at 500 MHz. You are considering two approaches to
handling exceptions. The first method allows the five stage pipeline to drain
completely, cancelling all in-progress instructions currently in the pipeline.
The exception instruction then starts in an empty pipeline. The second method
uses advanced techniques to keep the pipeline full, but this reduces the processor
speed to 475 MHz to accommodate the more complex logic. Assume the CPU has
the standard 5-stage DLX pipeline, and that 60% of exceptions are IF faults
(page faults, illegal memory access, etc.), 25% are MEM page faults, 5% are
illegal instructions (handled in ID), and 10% are ALU faults. Which exception
handling method results in a faster CPU? Hint: figure out how many
instructions are "wasted" for each type of exception....
In a very high-speed processor, it might be necessary to split the ALU stage
into two cycles (i.e., the ALU takes two cycles to generate a result). How
would this change affect the standard DLX pipeline?
What additional data hazards would be introduced? Assume all possible
forwarding paths are implemented.
How could you estimate the performance penalty due to these hazards?
Can you place a bound on the maximum penalty to the CPI from making this
change?
Is there any benefit to having a pipeline in which the clock runs twice
as fast but the pipeline is twice as deep (in other words, a pipeline in which
each stage is split into two stages that are half as long)? What drawbacks
would such an arrangement have?