3. The CPU Pipeline

3.1 CPU Pipeline Operation


The CPU has an eight-stage instruction pipeline; each stage takes one PCycle (one cycle of PClock, which runs at twice the frequency of MasterClock). Thus, the execution of each instruction takes at least eight PCycles (four MasterClock cycles). An instruction can take longer--for example, if the required data is not in the cache, the data must be retrieved from main memory.

Once the pipeline has been filled, eight instructions are executed simultaneously. Figure 3-1 shows the eight stages of the instruction pipeline; the next section describes the pipeline stages.



Figure 3-1 Instruction Pipeline Stages

CPU Pipeline Stages

This section describes each of the eight pipeline stages:

IF - Instruction Fetch, First Half

During the IF stage, the following occurs:

IS - Instruction Fetch, Second Half

During the IS stage, the instruction cache fetch and the virtual-to-physical address translation are completed.

RF - Register Fetch

During the RF stage, the following occurs:

EX - Execution

During the EX stage, one of the following occurs:

DF - Data Fetch, First Half

During the DF stage, one of the following occurs:

  • No operations are performed during the DF, DS, and TC stages for register-to-register instructions.

    DS - Data Fetch, Second Half

    During the DS stage, one of the following occurs:

    TC - Tag Check

    For load and store instructions, the cache performs the tag check during the TC stage. The physical address from the TLB is checked against the cache tag to determine if there is a hit or a miss.

    WB - Write Back

    For register-to-register instructions, the instruction result is written back to the register file during the WB stage. Branch instructions perform no operation during this stage.

    Figure 3-2 shows the activities occurring during each ALU pipeline stage, for load, store, and branch instructions.



    Figure 3-2 CPU Pipeline Activities



    Copyright 1996, MIPS Technologies, Inc. -- 21 MAR 96

    Generated with CERN WebMaker
    statistics