Pipelining a Datapath

Tom Kelliher, CS 240

Apr. 15, 2002

Administrivia

Announcements

Assignment

Read 6.3.

From Last Time

Overview of pipelining.

Outline

  1. Pipelining: a pipelined datapath. Hazards.

  2. Simple example: a single lw.

Coming Up

Pipelined control.

Pipelining

A pipelined datapath:

Consider four instructions: R-mode, a branch, LW, SW.

Observations:

  1. Not a true pipeline: feedback.

  2. How do we re-design control?

Hazards

  1. Structural hazards.

    Example: unified L1 cache/memory.

  2. Control hazards. Consider the following example:

    Solutions:

    1. Stall.

    2. Predict.

      Static prediction. Truly static. Compile-time determined.

      Dynamic prediction. Branch history tables. One-, two-bit counters.

    3. Delayed branch.

      Assumes you know branch outcome early.

      Code scheduling:

    Consideration: deeper pipelines.

  3. Data hazards.

    Data not available when needed.

    ALU example:

    Fixed by forwarding.

    Memory example:

    How can this be fixed?

Simple Example

Let's follow a lw. What's going on during each clock cycle?



Thomas P. Kelliher
Thu Apr 11 12:58:35 EDT 2002
Tom Kelliher