59.3k views
5 votes
We study the performance of an application on processor B. The ideal CPI is 1. However, the actual CPI is higher because of hazards.

Suppose the instructions executed in an application break down into the following categories.

Type Percentage
Arithmetic and Logic 30%
Load 30%
Store 15%
Branch 15%
Jump 10%

A jump instruction always flushes its next instruction. 10% of the load instructions cause 1 cycle stall because of the load-use hazards. 27% of the branches have 1 cycle stall because of data hazards resulting from resolving branches in ID. 60% of the executed branches are taken.

What is the CPI overhead due to data hazards?

User AaronD
by
7.8k points

1 Answer

2 votes

Final answer:

To determine the CPI overhead due to data hazards, the calculation considers the percentage of load and branch instructions that cause stalls. The CPI overhead is found to be 7.05%, which reflects the performance impact of these data hazards on the application running on the processor.

Step-by-step explanation:

The student is asking about the CPI overhead due to data hazards in a processor when running an application. To calculate this, we can use the given instruction breakdown along with the percentages of instructions that cause stalls. We analyze load instructions, branch instructions, and jump instructions for their impact on the CPI.

For load instructions causing a stall 10% of the time, with a 30% overall load instruction rate, we get 3% of all instructions causing a stall (0.10 * 0.30).

For branch instructions with a 27% stall rate and a 15% overall branch instruction rate, we get 4.05% (0.27 * 0.15) of all instructions causing a stall.

Jump instructions always flush the next instruction, but these do not cause a stall; they cause a flush which is a different type of overhead.

Adding up these percentages of stalls, we get a total data hazard overhead of 3% (load) + 4.05% (branch) = 7.05% of all instructions causing a stall. Since each stall is 1 cycle, and the ideal CPI is 1, we have a CPI overhead of 7.05% or 0.0705 due to data hazards.

User Peter Branforn
by
8.1k points