You are the lead designer of a new processor. The processor design and compiler are complete, and now you must decide whether to produce the current design as it stands or spend additional time to improve it.
1.1 [10%] (a) Leave the design as it stands. Call this base machine Mbase. It has a clock rate of 500 MHz. (b) Optimize the hardware: clock rate of 600 MHz. Call this machine Mopt.
| Instruction class | Frequency | CPI | |
|---|---|---|---|
| Mbase | Mopt | ||
| A | 40% | 2 | 2 |
| B | 25% | 3 | 2 |
| C | 25% | 3 | 3 |
| D | 10% | 5 | 4 |
What are the CPI and MIPS rate for Mbase and Mopt? (Table 1-1)
1.2 [8%] The compiler team proposes to improve the compiler (Mcomp = improved compiler + base machine). Percentage of instructions executed vs. base machine: A 90%, B 90%, C 85%, D 95%. What is the CPI for Mcomp? How much faster is Mcomp than Mbase? (Table 1-2)
1.1 \(\text{CPI}=\sum f_i\,\text{CPI}_i\),\(\text{MIPS}=\dfrac{\text{clock (MHz)}}{\text{CPI}}\)
Mbase:\(0.4\cdot2+0.25\cdot3+0.25\cdot3+0.1\cdot5=0.8+0.75+0.75+0.5=2.8\)
Mopt:\(0.4\cdot2+0.25\cdot2+0.25\cdot3+0.1\cdot4=0.8+0.5+0.75+0.4=2.45\)
| Machine | CPI | MIPS rate |
|---|---|---|
| Mbase | 2.8 | \(500/2.8\approx178.6\) |
| Mopt | 2.45 | \(600/2.45\approx244.9\) |
1.2 設 Mbase 執行 1 條指令為基準,Mcomp 各類指令數:A 0.36、B 0.225、C 0.2125、D 0.095
指令數 \(0.36+0.225+0.2125+0.095=0.8925\)
cycles \(0.36\cdot2+0.225\cdot3+0.2125\cdot3+0.095\cdot5=0.72+0.675+0.6375+0.475=2.5075\)
\(\text{CPI}=2.5075/0.8925\approx2.81\)
時脈相同(500 MHz),時間比 = cycles 比:\(2.8/2.5075\approx1.12\)
| Machine | CPI | Time(Mbase) / Time(Mcomp) |
|---|---|---|
| Mcomp | 2.81 | 1.12 |
Mcomp 的 CPI 比 Mbase 大(2.81 \(\gt\) 2.8),但指令數少 10.75%,總時間仍較短;CPI 不能單獨比效能。