A 5-stage scalar pipeline has an ideal CPI of 1.0. The instruction mix consists of 20% branch instructions and 30% load instructions. Every branch suffers a 2-cycle branch penalty. Additionally, 50% of the load instructions are immediately followed by a dependent instruction, causing a 1-cycle data hazard stall. What is the actual CPI of this pipeline?
Actual CPI = Ideal CPI + Stall Cycles per Instruction. The stall cycles due to branches = 20% 2 cycles = 0.40 cycles per instruction. The stall cycles due to load data hazards = 30% 50% * 1 cycle = 0.15 cycles per instruction. Actual CPI = 1.0 + 0.40 + 0.15 = 1.55