Serial Execution

Pipelined Execution - goal is to complete one instruction per clock cycle

Advanced Architectures - multiple instructions completed per clock cycle

(Original RISC - one instruction completed per clock cycle)

  1. superpipelined (e.g., MIPS R4000)- split each stage into substages to create finer-grain stages
  2. superscalar (e.g., Intel Pentium, AMD Athlon)- multiple instructions in the same stage of execution in duplicate pipeline hardware
Figure 8.15 on page 288 - several instructions in the "execute" stage on different functional units
  1. very-long-instruction-word, VLIW (e.g., Intel Itanium) - compiler encodes multiple operations into a long instruction word so hardware can schedule these operations at run-time on multiple functional units without analysis
machine parallelism - the ability of the processor to take advantage of instruction-level parallelism. This is limited by: Limitations of superscalar - how much "instruction-level parallelism" (ILP) exists in the program. Independent instructions in the program can be executed in parallel, but not all can be.

1) true data dependency:

SUB R1, R2, R3 ; R1 R2 - R3

ADD R4, R1, R1 ; R4 R1 + R1

Cannot be avoided by rearranging code

2) procedural dependency - cannot execute instructions after branch until branch executes

3) resource conflict / structural hazard - several instructions need same piece of hardware at the same time (e.g., memory, caches, buses, register file, functional units)

Three types of orderings:

1) order in which instructions are fetched

2) order in which instructions are executed (called instruction issuing)

3) order in which instructions update registers and memory

The more sophisticated the processor, the less it is bound by the strict relationship between these orderings. The only real constraint is that the results match that of sequential execution.

Some Categories:

a) In-order issue with In-order completion.

b) In-order issue with out-of-order completion

Problem: Output dependency / WAW dependency (Write-After-Write)

I1: R3 R3 op R5

I2: R4 R3 + 1

I3: R3 R5 + 1

I4: R7 R3 op R4 ; R3 value generated from I3 must be used

c) Out-of-Order Issue (decouple decode and execution) with Out-of-Order Completion

Instruction window provides a pool of possible instructions to be executed:

  1. Issue - decodes instructions and checks for structural hazards. Instructions are issued in-order through a FIFO queue to maintain correct data flow. If there is not a free reservation station of the appropriate type, the instruction queue stalls.
  2. Read operands - waits until no data hazards, then read operands
  3. Write result - send the result to the CDB to be grabbed by any waiting register or reservation stations
All instructions pass through the issue stage in order, but instructions stalling on operands can be bypass by later instructions whose operands are available. RAW hazards are handled by delaying instructions in reservation stations until all their operands are available. WAR and WAW hazards are handled by renaming registers in instructions by reservation station numbers. Load and Store instructions to different memory addresses can be done in any order, but the relative order of a Store and accesses to the same memory location must be maintained. One way to perform dynamic disambiguation of memory references, is to perform effective address calculations of Loads and Stores in program order in the issue stage.