I got two questions about cpu time and CPI but it is hard than I expected because of unfamiliar words :( Could you tell me whether my answer is right or not.
Question : If company A has designed a processor P1 with the following CPIs like below and clock rate of P1 is 2GHz.
Q1: You have written an application program that has 0.1million instructions in a loop that is executed 1000 times with the following instruction mix. What is the expected CPI for this workload? and how long does the benchmark take to execute?
A1: In this processor average CPI =3x0.3+2x0.15+1x0.4+3x0.1+2x0.05=2, cpu time = instruction count * cpi(1/clock rate)=10^5x2x(1/2x(10^9))=10^-4
Q2: Assume new special addition instruction merges the load and add operation. For this new instruction , 1/2 of ALU instruction can be merged with preceding load instruction, the CPI of the new instruction is 5 cycles and clock frequency can be changed to 1 GHz. Then what is the new execution time?
A2: After the new special addition, instruction count is 10^5 , cpi is 5 and clock rate is 10^9 so new excutution time should be 10^5x5x(1/(10^9))= 5x10^-4
| instruction type | CPI |
|---|---|
| load | 3 |
| store | 2 |
| ALU operations | 1 |
| branch | 3 |
| jumps | 2 |
original frequency before new special addition
| instruction type | Frequency |
|---|---|
| load | 30% |
| store | 15% |
| ALU operations | 40% |
| branch | 10% |
| jumps | 5% |