ROB (Reorder Buffer)

Introduction

A ROB is an extension to Tomasulo's Algorithm that allows us to:

It's usually implemented as a circular buffer (FIFO) that keeps the order of instructions, its destination and value. That way we can temporary store the result of the instruction until it's no longer speculative and then Commit it to the register or memory. In case the branch prediction was wrong, it's easy to roll-back the changes in the ROB.

Tranks to the ROB, instructions can execute out-of-order but commit always in-order.

The structures are similar to what we already know of Tomasulo's Machine. The main differences consist in that a Reorder Buffer is added to temporary store the order and result of instructions. There is no store buffer for memory store operations because the ROB already contains them. Appart from that, the instructions are sent to the Reservation Stations labeled with the ROB entry number, that way, when the result is broadcast through the Commmon Data Bus, all RS, and the ROB itself, can get the result they are waiting for. As you can see, the ROB can be now another source for the operands sent to the Reservation Stations. The Registers and memory are written when an instruction Commits.

ROBMachine.pptx file.

A typical ROB will look like this:

Instruction Destination Result
flw f1,34(t0) F1 null
fsw f2,45(t1) Mem[55] 10
fmul.s f3,f2,f4 F3 null
fsub.s f5,f1,f2 F5 34
fdiv.s f0,f3,f1 F0 null
fadd.s f1,f5,f2 F1 56

Stages of a ROB (Reorder Buffer) machine:

Reorder buffer example:

I haven't been able to find much information on how the ROB interacts with the integer pipeline, and all texts I've found are vague about it, which is strange considering how tightly related are ROB and branches, but I've managed to pull an example, cycle by cycle, guessing how it would work here:

ROBExample.pptx and ROBExample.pdf

Where to go from here

I recommend you this Computer Architecture course. It's free and has a lot of information you won't find elsewhere.