This exercise is intended to help you understand the | StudySoup

Textbook Solutions for Computer Organization and Design

Chapter 4 Problem 4.12

Question

This exercise is intended to help you understand the cost/complexity/performance trade-offs of forwarding in a pipelined processor. Problems in this exercise refer to pipelined datapaths from Figure 4.45. These problems assume that, of all the instructions executed in a processor, the following fraction of these instructions have a particular type of RAW data dependence. The type of RAW data dependence is identified by the stage that produces the result (EX or MEM) and the instruction that consumes the result (1st instruction that follows the one that produces the result, 2nd instruction that follows, or both). We assume that the register write is done in the first half of the clock cycle and that register reads are done in the second half of the cycle, so “EX to 3rd” and “MEM to 3rd” dependences are not counted because they cannot result in data hazards. Also, assume that the CPI of the processor is 1 if there are no data hazards.

\(\begin{array}{|c|c|c|c|c|c|}
\hline \begin{array}{c}
\text { EX to } 1^{\text {st }} \\
\text { Only }
\end{array} & \begin{array}{c}
\text { MEM to } 1^{\text {st }} \\
\text { Only }
\end{array} & \begin{array}{c}
\text { EX to } 2^{\text {nd }} \\
\text { Only }
\end{array} & \begin{array}{c}
\text { MEM to } 2^{\text {nd }} \\
\text { Only }
\end{array} & \begin{array}{l}
\text { EX to } 1^{\text {st }} \\
\text { and MEM } \\
\text { to 2nd }
\end{array} & \begin{array}{c}
\text { Other RAW } \\
\text { Dependences }
\end{array} \\
\hline 5 \% & 20 \% & 5 \% & 10 \% & 10 \% & 10 \% \\
\hline
\end{array}\)

Assume the following latencies for individual pipeline stages. For the EX stage, latencies are given separately for a processor without forwarding and for a processor with different kinds of forwarding.

\(\begin{array}{|c|c|c|c|c|c|c|c|}
\hline \text { IF } & \text { ID } & \begin{array}{c}
\text { EX } \\
\text { (no FW) }
\end{array} & \begin{array}{c}
\text { EX } \\
\text { (full FW) }
\end{array} & \begin{array}{c}
\text { EX (FW from } \\
\text { EX/MEM only) }
\end{array} & \begin{array}{c}
\text { EX (FW } \\
\text { from MEM/ } \\
\text { WB only) }
\end{array} & \text { MEM } & \text { WB } \\
\hline 150 \mathrm{ps} & 100 \mathrm{ps} & 120 \mathrm{ps} & 150 \mathrm{ps} & 140 \mathrm{ps} & 130 \mathrm{ps} & 120 \mathrm{ps} & 100 \mathrm{ps} \\
\hline
\end{array}\)

Solution

Step 1 of 3)

The first step in solving 4 problem number 60 trying to solve the problem we have to refer to the textbook question: This exercise is intended to help you understand the cost/complexity/performance trade-offs of forwarding in a pipelined processor. Problems in this exercise refer to pipelined datapaths from Figure 4.45. These problems assume that, of all the instructions executed in a processor, the following fraction of these instructions have a particular type of RAW data dependence. The type of RAW data dependence is identified by the stage that produces the result (EX or MEM) and the instruction that consumes the result (1st instruction that follows the one that produces the result, 2nd instruction that follows, or both). We assume that the register write is done in the first half of the clock cycle and that register reads are done in the second half of the cycle, so “EX to 3rd” and “MEM to 3rd” dependences are not counted because they cannot result in data hazards. Also, assume that the CPI of the processor is 1 if there are no data hazards.\(\begin{array}{|c|c|c|c|c|c|}\hline \begin{array}{c}\text { EX to } 1^{\text {st }} \\\text { Only }\end{array} & \begin{array}{c}\text { MEM to } 1^{\text {st }} \\\text { Only }\end{array} & \begin{array}{c}\text { EX to } 2^{\text {nd }} \\\text { Only }\end{array} & \begin{array}{c}\text { MEM to } 2^{\text {nd }} \\\text { Only }\end{array} & \begin{array}{l}\text { EX to } 1^{\text {st }} \\\text { and MEM } \\\text { to 2nd }\end{array} & \begin{array}{c}\text { Other RAW } \\\text { Dependences }\end{array} \\\hline 5 \% & 20 \% & 5 \% & 10 \% & 10 \% & 10 \% \\\hline\end{array}\)Assume the following latencies for individual pipeline stages. For the EX stage, latencies are given separately for a processor without forwarding and for a processor with different kinds of forwarding.\(\begin{array}{|c|c|c|c|c|c|c|c|}\hline \text { IF } & \text { ID } & \begin{array}{c}\text { EX } \\\text { (no FW) }\end{array} & \begin{array}{c}\text { EX } \\\text { (full FW) }\end{array} & \begin{array}{c}\text { EX (FW from } \\\text { EX/MEM only) }\end{array} & \begin{array}{c}\text { EX (FW } \\\text { from MEM/ } \\\text { WB only) }\end{array} & \text { MEM } & \text { WB } \\\hline 150 \mathrm{ps} & 100 \mathrm{ps} & 120 \mathrm{ps} & 150 \mathrm{ps} & 140 \mathrm{ps} & 130 \mathrm{ps} & 120 \mathrm{ps} & 100 \mathrm{ps} \\\hline\end{array}\)
From the textbook chapter The Processor you will find a few key concepts needed to solve this.

Step 2 of 7)

Visible to paid subscribers only

Step 3 of 7)

Visible to paid subscribers only

Subscribe to view the
full solution

Title Computer Organization and Design 5 
Author David A. Patterson
ISBN 9780124077263

This exercise is intended to help you understand the

Chapter 4 textbook questions

×

Login

Organize all study tools for free

Or continue with
×

Register

Sign up for access to all content on our site!

Or continue with

Or login if you already have an account

×

Reset password

If you have an active account we’ll send you an e-mail for password recovery

Or login if you have your password back