Nios® V Processor Reference Manual

ID 683632
Date 11/15/2021

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.2. Processor Pipeline

The Nios V/m processor employs a 5-stages pipeline.

Table 4.  Processor Pipeline Stages
Stage Denotation Function
Instruction Fetch F
  • PC+4 calculation
  • Next instruction fetch
  • Pre-decode for register file read
Instruction Decode D
  • Decode the instruction
  • Register file read data available
  • Hazard resolution and data forwarding
Instruction Execute E
  • ALU operations
  • Memory address calculation
  • Branch resolution
  • CSR read/write
Memory M
  • Memory and multicycle operations
  • Register file write
  • Branch redirection
Write Back W
  • Facilitates data dependency resolution by providing General Purpose Register value.

The Nios® V/m processor implements the General Purpose Register file using M20K memory block. It takes one cycle to read from a M20K location. Hence, the F-stage initiates register file reads so General Purpose Register values are available in D-stage.

It takes two cycles to write to a M20K location. Hence, the M-stage initiates writes to a General Purpose Register and carries forward the value to W-stage, if there is a dependency to be resolved.

The core resolves data dependencies in D-stage, and operands can move from register file read or E-stage, M-stage, or W-stage.

The pipeline can stall due to following reasons:
  • Data dependency: If the source operand is not available in D-stage, instruction in D-stage and F-stage stalls until the operand becomes available. The scenario can happen if destination General Purpose Register of load or multicycle instruction in E-stage or M-stage is the source for instruction in D-stage.
  • Resource stall: If a memory operation or multicycle is pending in M-stage, the instructions in preceding stages stalls until M-stage completes the instruction.