Pipeline Data Hazards and Forwarding

Determine when a dependent instruction can use a value and decide whether bypassing or a stall is necessary.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. The consumer needs the producer’s new value
  2. A bypass cannot deliver data before it exists

The consumer needs the producer’s new value

In a simple pipeline, an addition may produce its result at execution before it commits the value to the register file. A following subtraction reading that register needs the addition’s new result. Forwarding sends it directly from the stage where it became available to the dependent stage, avoiding waits for the ordinary register read and write path. Select the youngest preceding producer if several affect the same register.

A bypass cannot deliver data before it exists

A load may obtain its contents later than an arithmetic instruction, so an immediate dependent operation can require a stall even with forwarding. Independent work can be scheduled between them. Name reuse produces other kinds of dependence, addressed by register renaming. Pipeline throughput assumes independent operations and therefore describes a limit rather than every dependency chain.[1][2]

References

  1. RISC-V International, The RISC-V Instruction Set Manual: Unprivileged Architecture ↩
  2. MIT OpenCourseWare, Computation Structures ↩