The Reorder Buffer: Retiring in Order, Speculation and Recovery

Instructions now finish in any order. Then one of them traps, or a branch turns out to be guessed wrong. Which results count? The core needs one place where order is put back.

You Will Be Able To

  • Say why results must become final in program order, and how a reorder buffer does it.
  • Read a cycle of the buffer: what enters, what is finished, what retires.
  • Explain what a core must undo after a wrong branch guess, and what a store may not do before it retires.
Lesson
S2.32
Time
40 min
Runs on
Your browser
Check
6 questions

S2.31 let instructions overtake each other. S2.29 demanded a precise trap. The two only fit together through a buffer.

Before You Start

You need renaming from S2.31: the rename table, the free list, and instructions that start when ready.

You need the precise trap from S2.29 and the guess "not taken" from S2.10.

Five questions this page answers
Question
1Why must results become final in program order?
2Which entry of the reorder buffer may retire?
3What is speculation?
4What is undone after a wrong guess?
5When may a store write memory?

The Idea: Finish in Any Order, Count in Program Order

A program is written as a sequence. A trap handler, and a debugger, expect that sequence: all of this done, none of that.

An out-of-order core breaks the sequence inside. So it keeps a list of every instruction in flight, in program order.

The list is the reorder buffer. An instruction enters at its tail when it is renamed. That step is called dispatch.

It executes whenever it can. Its result waits in a physical register. Its entry is marked as finished.

It leaves at the head, and only when it is the oldest and finished. To leave is to retire. Only then does its result count.

This also solves the branch. The core does not wait for a branch to be decided. It guesses and fetches on along the guess.

Executing instructions behind a guess is speculation. They are in the buffer, but none of them can retire before the branch.

If the guess was wrong, every entry younger than the branch is thrown away. That is a squash. Nothing they did had counted yet.

The real core of this track, ap_rv32, finishes instructions in order and needs no such buffer. What follows is a model.

New Words

New words on this page
WordMeaning
Reorder bufferA list of the instructions in flight, in program order. Often written ROB.
DispatchTo put a renamed instruction into the reorder buffer, at the tail.
Head, tailThe oldest entry of the buffer, and the place where the newest one is added.
Retire, retiredTo leave the buffer at the head. From then on the result of the instruction is final. Also called commit.
SpeculationExecuting instructions before it is known that they should run at all.
SquashTo throw away the entries behind a wrong guess, before any of them has retired.
RecoveryPutting the core back as it was at the branch: the buffer, the rename table and the free list.
Store bufferA place where the address and data of a store wait until the store retires.

One Picture: The Buffer and Its Two Ends

In at the Tail, Out at the HeadStep through the picture. It follows instructions through the reorder buffer, and shows what a wrong guess does.
  • Control / FSM
  • Memory
  • Processor
  • Bus
In at the Tail, Out at the HeadStep through the picture. It follows instructions through the reorder buffer, and shows what a wrong guess does. component Rename anddispatch in program order, twoin a cycle component Reorder buffer one entry for eachinstruction in flight,oldest at the head component Execute whenever the inputsare ready component Retire from the head, only iffinished component Registers andmemory what the program cansee component Branch guess the fetch goes onalong the guess enter at the tailstart when readymark: finishedleave at the headnow it countsinstructions behind aguessthe guess was wrong:squash
  1. component Rename and dispatchin program order, two in a cycle
    • enter at the tail → Reorder buffer
  2. component Reorder bufferone entry for each instruction in flight, oldest at the head
    • start when ready → Execute
    • leave at the head → Retire
  3. component Executewhenever the inputs are ready
    • mark: finished → Reorder buffer
    • the guess was wrong: squash → Branch guess
  4. component Retirefrom the head, only if finished
    • now it counts → Registers and memory
  5. component Registers and memorywhat the program can see
  6. component Branch guessthe fetch goes on along the guess
    • instructions behind a guess → Rename and dispatch
  1. Enter in order

    Renamed instructions take the next entries of the buffer, in program order. The newest is the tail.

  2. Execute in any order

    An entry starts when its inputs are ready. When it is finished, its entry is marked.

  3. Leave in order

    Only the oldest entry may leave, and only if it is finished. A finished younger one waits behind it.

  4. Only then is it final

    At retirement a result belongs to the program: a store writes memory, and an old register place is freed.

  5. A guess, and its price

    Behind a branch the fetch follows a guess. If the branch finishes and the guess was wrong, every younger entry is squashed.

Read the diagram as text
  • Rename and dispatch: in program order, two in a cycle
  • Reorder buffer: one entry for each instruction in flight, oldest at the head
  • Execute: whenever the inputs are ready
  • Retire: from the head, only if finished
  • Registers and memory: what the program can see
  • Branch guess: the fetch goes on along the guess
  • Rename and dispatch → Reorder buffer: enter at the tail
  • Reorder buffer → Execute: start when ready
  • Execute → Reorder buffer: mark: finished
  • Reorder buffer → Retire: leave at the head
  • Retire → Registers and memory: now it counts
  • Branch guess → Rename and dispatch: instructions behind a guess
  • Execute → Branch guess: the guess was wrong: squash

The middle of the core runs in any order. Its two ends, dispatch and retirement, stay in program order.

What an entry of the buffer holds, in the model
FieldMeaningUsed when
The instructionWhich row of the programalways
Finished in cycleWhen its result is readyat retirement: only a finished head may leave
The new placeThe physical register it writesat a squash: back to the free list
The old placeWhere that register name was beforeat a squash: back into the rename table. At retirement: freed
Guessed wrongA branch whose guess will turn out wrongwhen it is finished: squash what is behind it

The old place answers the open question of S2.31. A physical register is given back when the write after it retires.

The Smallest Example, Worked by Hand

Part of a program with no branch
AddressInstructionFinished in cycleRetires in cycle
14lw x5, 0(x8)56
18add x6, x5, x967
1csw x6, 4(x8)78
20addi x5, x10, 168
24add x7, x5, x579

From a run of the model. The load at 14 takes 2 cycles. Two instructions may enter, and two may retire, in a cycle.

Look at the addi at 20. It needs only x10. It is finished in cycle 6, one cycle before the store at 1c.

May it retire in cycle 7? No. The store at 1c is older and is still in the buffer. The addi is not at the head.

In cycle 8 the store, finished in cycle 7, is the head and leaves. The addi is right behind it, and leaves in the same cycle.

So the addi sat finished in the buffer for one cycle. That wait is the price of order.

What was gained? Suppose the store at 1c had trapped. The addi had run, but it had changed nothing that counts. It is thrown away.

The Rules

  1. Rule 1: Instructions enter the buffer in program order.

    Renamed, at the tail. If the buffer is full, dispatch waits.

  2. Rule 2: An entry executes when its inputs are ready, and is then marked finished.

    This is the out-of-order part, as in S2.31.

  3. Rule 3: Only a finished head may retire.

    So results become final in program order. A trap is taken when its instruction is the head.

  4. Rule 4: At retirement the old place of the written register is freed.

    No instruction in flight can still read it.

  5. Rule 5: Behind a branch, the fetch follows a guess, and those instructions are speculative.

    They execute, but they cannot retire before the branch does.

  6. Rule 6: A wrong guess squashes every younger entry.

    Their new places go back to the free list, and the rename table gets its old entries back.

  7. Rule 7: A store writes memory only when it retires.

    A register can be renamed back. A word in memory or in a device cannot.

Sources for These Rules

Checked in the library: Patterson and Hennessy, Computer Organization and Design (ARM edition), section 4.10. It has the commit unit with a reorder buffer, in-order commit, speculation, and stores held until commit. Its section 4.11 describes a real core with a reorder buffer and renaming that executes up to six operations in a cycle. Harris and Harris, Digital Design and Computer Architecture (ARM edition), section 7.7.5, has out-of-order execution. Both books use other processors than ours. The loop on this page is the trace of the real core ap_rv32. The real core ran it in order, in 30 cycles. It has no reorder buffer, and it guesses nothing beyond "not taken". Every number of the reorder buffer is from a model. Its choices are: 8 entries, two in and two out in a cycle, a load of 2 cycles, every branch guessed not taken.

Now Run It

The lab at the end of this page replays the loop of S2.15: three rounds, 19 instructions. Every branch is guessed "not taken".

Each row is one cycle. "in" lists what is dispatched, "done" what is finished in this cycle, "out" what retires.

Printed by the lab on Icarus: a model. The program and the outcome of each branch are the trace of the real core ap_rv32.
 1 | in: 00 04 | done: -- | out: -- | holds 2
 2 | in: 08 0c | done: 00 04 | out: -- | holds 4
 3 | in: 10 14 | done: 08 | out: 00 04 | holds 4
 4 | in: 18 1c | done: 0c 14 | out: 08 | holds 5
 5 | in: 20 24 | done: 10 18 | out: 0c | holds 6
 6 | in: -- | done: 1c 20 24 | out: 10 14 | holds 4
 7 | squash: 20 24 | fetch goes to 0c
 7 | in: 0c 10 | done: -- | out: 18 1c | holds 2
 8 | in: 14 18 | done: -- | out: -- | holds 4
 9 | in: 1c 20 | done: 0c 14 18 | out: -- | holds 6
10 | in: 24 | done: 10 1c | out: 0c | holds 6
11 | squash: 20 24 | fetch goes to 0c
11 | in: 0c 10 | done: -- | out: 10 14 | holds 4
12 | in: 14 18 | done: -- | out: 18 1c | holds 4
13 | in: 1c 20 | done: 0c 14 18 | out: -- | holds 6
14 | in: 24 | done: 10 1c | out: 0c | holds 6
15 | in: -- | done: 20 24 | out: 10 14 | holds 4
16 | in: -- | done: -- | out: 18 1c | holds 2
17 | in: -- | done: -- | out: 20 24 | holds 0
retired=19 squashed=4 cycles=17

Rule 2 at work: row 4. The addi at 14 is finished in the same cycle as the load at 0c. The add at 10, between them, is not.

Rule 3 at work: row 5 retires only the load at 0c. The addi at 14 is finished and waits. Row 6 retires 10 and 14 together.

Rule 5 at work: row 4 dispatches the branch at 1c. Row 5 goes on at 20 and 24, as if the branch were not taken.

Row 6: the branch is finished, and so are the two instructions behind it. The store at 20 has run. It has not retired.

Rule 6 at work: the line "squash: 20 24". The branch was taken. Both entries are thrown away, and the fetch goes to 0c.

The same happens in cycle 11 for the second round. In the third round the guess is right: 20 and 24 retire in row 17.

The last line: 19 instructions retired, 4 squashed, 17 cycles. The real core, in order, took 30 cycles for the same loop.

The two numbers are not a fair race. The model has no fetch stage and no penalty for the redirect. It shows the mechanism.

Why It Is Built This Way

Design choiceThe alternativeWhat the choice buys, and costs
Retire in program orderMake each result final when it is finishedA precise trap, and a clean undo. Finished instructions wait behind an unfinished head.
Speculate behind a branchStop the fetch until the branch is finishedWork goes on during the wait. Wrong work costs energy, and must be undone.
Keep the old place in the entryCopy the whole rename table at every branchA few bits in each entry. Recovery walks back through the squashed entries.
Free a place at retirementFree it when the next write is renamedA squashed write can be undone, because the old value is still there. Places are held longer.
Hold stores until they retireWrite memory when the store executesA squashed store leaves no mark. Later loads must look into the store buffer.
A buffer of fixed sizeAs many entries as neededKnown cost. When it is full, dispatch stops.

The size sets how far the core can look ahead. With four entries, the model needs 18 cycles for this loop, one more than with eight.

The Trap: Letting a Finished Store Write

Read rows 5 to 7 again. The store at 20 was dispatched in cycle 5 and finished in cycle 6. In cycle 7 it was squashed.

It belongs to a path that the program never took. In the real run, this store happens once, after the third round.

Suppose the model wrote memory when a store is finished. Then the sum of one word would be in memory after round one.

In ordinary memory the right value would overwrite it later. Now let the address be a device: a UART sends a byte that was never meant.

No recovery can call that byte back. So "finished" must not mean "visible". Only the head of the buffer may touch the world.

At Scale

This lab8 entries, 2 in and 2 out in a cycle
A wide out-of-order corehundreds of entries, 4 or more in and out in a cycle

This section looks ahead, and names what real cores do. Eight entries show the mechanism. Real buffers are far larger.

  1. What real cores do

    One well-known desktop core renames registers, keeps a reorder buffer and executes up to six operations in a cycle. The textbook of Patterson and Hennessy describes it.

  2. Small cores stay in order

    A core like ap_rv32 has none of this. For a microcontroller, a small area and a known timing matter more than IPC. That is common practice.

  3. Prediction decides everything

    Every wrong guess throws away all work behind the branch. So these cores carry the predictors of S2.12 and S2.28.

  4. Speculation and security

    Squashed instructions change no register and no memory word. They can still leave traces in a cache. S9.5 looks at what a chip must keep apart.

Try It

Run the lab. Find the two squash lines, and the cycle in which each squashed instruction was dispatched.

Set SIZE to 4 and run again. In which cycle does dispatch first take one instruction where it took two before?

In load_program, set outcome[0] and outcome[1] to 0. The model now believes that no branch was taken. How many instructions retire, and why is that run not the real program?

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 1 | in: 00 04 | done: -- | out: -- | holds 2 2 | in: 08 0c | done: 00 04 | out: -- | holds 4 3 | in: 10 14 | done: 08 | out: 00 04 | holds 4 4 | in: 18 1c | done: 0c 14 | out: 08 | holds 5 5 | in: 20 24 | done: 10 18 | out: 0c | holds 6 6 | in: -- | done: 1c 20 24 | out: 10 14 | holds 4 7 | squash: 20 24 | fetch goes to 0c 7 | in: 0c 10 | done: -- | out: 18 1c | holds 2 8 | in: 14 18 | done: -- | out: -- | holds 4 9 | in: 1c 20 | done: 0c 14 18 | out: -- | holds 6 10 | in: 24 | done: 10 1c | out: 0c | holds 6 11 | squash: 20 24 | fetch goes to 0c 11 | in: 0c 10 | done: -- | out: 10 14 | holds 4 12 | in: 14 18 | done: -- | out: 18 1c | holds 4 13 | in: 1c 20 | done: 0c 14 18 | out: -- | holds 6 14 | in: 24 | done: 10 1c | out: 0c | holds 6 15 | in: -- | done: 20 24 | out: 10 14 | holds 4 16 | in: -- | done: -- | out: 18 1c | holds 2 17 | in: -- | done: -- | out: 20 24 | holds 0 retired=19 squashed=4 cycles=17

Check Yourself

Predict the outputThe loop runs with its body in the other order of S2.15: the count is updated right behind the load. The model and its guesses are the same. What does the last line say?
// The loop with its body in another order. What does the last line say?
// Test code. It replays the instructions that the real program executed, through a model of another kind of core.
// The real core ap_rv32 takes one instruction in a cycle and finishes them in program order. It has none of this logic.
module tb;
  // ---- The program. One row for each instruction: what it writes, what it reads, and its kind.
  localparam int ALU = 0, LOAD = 1, STORE = 2, BRANCH = 3, JUMP = 4, STOP = 5;
  localparam int ROWS = 10;
  int s_rd [0:9], s_rs1 [0:9], s_rs2 [0:9], s_kind [0:9], s_target [0:9];
  function automatic string tx(input int row);   // the text of a row
    case (row)
      0: return "lui x8, 0x80000";
      1: return "addi x9, x0, 3";
      2: return "addi x10, x0, 0";
      3: return "lw x5, 0(x8)";
      4: return "addi x9, x9, -1";
      5: return "add x10, x10, x5";
      6: return "addi x8, x8, 4";
      7: return "bne x9, x0, 0x0c";
      8: return "sw x10, 0(x8)";
      9: return "ebreak";
      default: return "?";
    endcase
  endfunction
  function automatic string ad(input int row);   // the address of a row, as two hex digits
    return $sformatf("%02h", 8'(4 * row));
  endfunction
  // The recorded run of the real program: the rows in the order they were executed. leaves[n] is 1 when the
  // instruction was a branch or a jump that did not go on to the next address.
  localparam int COUNT = 19;
  int seq [0:18];
  bit leaves [0:18];
  bit outcome [0:2];   // each executed branch, in order: 1 when it was taken
  task automatic load_program;
    s_rd[0] = 8;  s_rs1[0] = 0;  s_rs2[0] = 0;  s_kind[0] = ALU;  s_target[0] = 'h00;
    s_rd[1] = 9;  s_rs1[1] = 0;  s_rs2[1] = 0;  s_kind[1] = ALU;  s_target[1] = 'h00;
    s_rd[2] = 10;  s_rs1[2] = 0;  s_rs2[2] = 0;  s_kind[2] = ALU;  s_target[2] = 'h00;
    s_rd[3] = 5;  s_rs1[3] = 8;  s_rs2[3] = 0;  s_kind[3] = LOAD;  s_target[3] = 'h00;
    s_rd[4] = 9;  s_rs1[4] = 9;  s_rs2[4] = 0;  s_kind[4] = ALU;  s_target[4] = 'h00;
    s_rd[5] = 10;  s_rs1[5] = 10;  s_rs2[5] = 5;  s_kind[5] = ALU;  s_target[5] = 'h00;
    s_rd[6] = 8;  s_rs1[6] = 8;  s_rs2[6] = 0;  s_kind[6] = ALU;  s_target[6] = 'h00;
    s_rd[7] = 0;  s_rs1[7] = 9;  s_rs2[7] = 0;  s_kind[7] = BRANCH;  s_target[7] = 'h0c;
    s_rd[8] = 0;  s_rs1[8] = 8;  s_rs2[8] = 10;  s_kind[8] = STORE;  s_target[8] = 'h00;
    s_rd[9] = 0;  s_rs1[9] = 0;  s_rs2[9] = 0;  s_kind[9] = STOP;  s_target[9] = 'h00;
    seq[0] = 0;  seq[1] = 1;  seq[2] = 2;  seq[3] = 3;  seq[4] = 4;  seq[5] = 5;  seq[6] = 6;  seq[7] = 7;
    seq[8] = 3;  seq[9] = 4;  seq[10] = 5;  seq[11] = 6;  seq[12] = 7;  seq[13] = 3;  seq[14] = 4;  seq[15] = 5;
    seq[16] = 6;  seq[17] = 7;  seq[18] = 8;
    leaves[0] = 0;  leaves[1] = 0;  leaves[2] = 0;  leaves[3] = 0;  leaves[4] = 0;  leaves[5] = 0;  leaves[6] = 0;  leaves[7] = 1;  leaves[8] = 0;  leaves[9] = 0;
    leaves[10] = 0;  leaves[11] = 0;  leaves[12] = 1;  leaves[13] = 0;  leaves[14] = 0;  leaves[15] = 0;  leaves[16] = 0;  leaves[17] = 0;  leaves[18] = 0;
    outcome[0] = 1;  outcome[1] = 1;  outcome[2] = 0;
  endtask

  // ---- A core that guesses "not taken" at every branch, executes when values are ready, and retires in order.
  localparam int SIZE = 8;          // places in the reorder buffer
  int e_row [0:7], e_done [0:7], e_new [0:7], e_old [0:7];   // the buffer: the oldest instruction is entry 0
  bit e_wrong_guess [0:7];      // a branch that was guessed "not taken" and is taken
  int held;                               // how many entries are in use
  int map [0:31];                         // the rename table
  int ready [0:47];                      // the cycle in which each physical register has its value
  int free_list [0:1023];  int free_head, free_tail;   // the free physical registers, first in, first out
  logic [7:0] pc;                         // the fetch address
  bit fetching, wrong_path, ended, blocked;
  int cycle, retired, squashed, next_outcome, branch_at, row, s;
  string ins, outs, dones, gone;
  function automatic string add_to(input string list, input string item);
    if (list == "") return item;
    return {list, " ", item};
  endfunction
  function automatic string shown(input string list);
    if (list == "") return "--";
    return list;
  endfunction
  initial begin
    load_program();
    for (int r = 0; r < 32; r++) map[r] = r;
    for (int p = 0; p < 48; p++) ready[p] = 0;
    free_head = 0;  free_tail = 0;
    for (int p = 32; p < 48; p++) begin free_list[free_tail] = p;  free_tail++; end
    held = 0;  pc = 0;  fetching = 1;  wrong_path = 0;  ended = 0;  cycle = 0;  retired = 0;  squashed = 0;  next_outcome = 0;
    while (!ended && cycle < 300) begin
      cycle++;  ins = "";  outs = "";  dones = "";
      // Step 1, recovery: a branch that was guessed wrong is finished. Everything younger is squashed.
      branch_at = -1;
      for (int k = 0; k < held; k++) if (branch_at < 0 && e_wrong_guess[k] && e_done[k] < cycle) branch_at = k;
      if (branch_at >= 0) begin
        gone = "";
        for (int k = branch_at + 1; k < held; k++) gone = add_to(gone, ad(e_row[k]));
        for (int k = held - 1; k > branch_at; k--)                 // youngest first: put the rename table back
          if (e_new[k] >= 0) begin map[s_rd[e_row[k]]] = e_old[k];  free_list[free_tail] = e_new[k];  free_tail++; end
        squashed += held - 1 - branch_at;  held = branch_at + 1;
        e_wrong_guess[branch_at] = 0;  pc = s_target[e_row[branch_at]];  fetching = 1;  wrong_path = 0;
        $display("%2d | squash: %s | fetch goes to %02h", cycle, shown(gone), pc);
      end
      // Step 2, retire: up to two finished instructions leave from the head, in program order.
      for (int n = 0; n < 2; n++) if (held > 0 && e_done[0] < cycle) begin
        outs = add_to(outs, ad(e_row[0]));
        if (e_new[0] >= 0) begin free_list[free_tail] = e_old[0];  free_tail++; end   // the old place of the register is free now
        if (s_kind[e_row[0]] == STOP) ended = 1;  else retired++;
        for (int k = 0; k + 1 < held; k++) begin e_row[k] = e_row[k + 1];  e_done[k] = e_done[k + 1];  e_new[k] = e_new[k + 1];  e_old[k] = e_old[k + 1];  e_wrong_guess[k] = e_wrong_guess[k + 1]; end
        held--;
      end
      // Step 3, dispatch: up to two instructions enter at the tail, renamed, with the cycle they will be finished in.
      blocked = 0;
      for (int n = 0; n < 2; n++) if (fetching && held < SIZE && !ended && !blocked) begin
        row = pc >> 2;
        if (row >= ROWS) fetching = 0;
        else if (s_rd[row] != 0 && free_head == free_tail) blocked = 1;
        else begin
          s = cycle + 1;
          if (s_rs1[row] != 0 && ready[map[s_rs1[row]]] + 1 > s) s = ready[map[s_rs1[row]]] + 1;
          if (s_rs2[row] != 0 && ready[map[s_rs2[row]]] + 1 > s) s = ready[map[s_rs2[row]]] + 1;
          e_row[held] = row;  e_done[held] = s + ((s_kind[row] == LOAD) ? 2 : 1) - 1;  e_new[held] = -1;  e_old[held] = -1;  e_wrong_guess[held] = 0;
          if (s_rd[row] != 0) begin
            e_old[held] = map[s_rd[row]];  e_new[held] = free_list[free_head];  free_head++;
            map[s_rd[row]] = e_new[held];  ready[e_new[held]] = e_done[held];
          end
          if (s_kind[row] == BRANCH && !wrong_path) begin            // the true outcome, from the recorded run
            if (outcome[next_outcome]) begin e_wrong_guess[held] = 1;  wrong_path = 1; end
            next_outcome++;
          end
          if (s_kind[row] == STOP) fetching = 0;
          held++;  ins = add_to(ins, ad(row));  pc = pc + 4;
        end
      end
      for (int k = 0; k < held; k++) if (e_done[k] == cycle) dones = add_to(dones, ad(e_row[k]));
      $display("%2d | in: %s | done: %s | out: %s | holds %0d", cycle, shown(ins), shown(dones), shown(outs), held);
    end
    $display("retired=%0d squashed=%0d cycles=%0d", retired, squashed, cycle);
  end
endmodule
ConceptWhy must results become final in program order?
ConceptWhich entry of the reorder buffer may retire?
ConceptWhat is speculation?
ConceptWhat is undone after a wrong branch guess?
ConceptWhen may a store write memory?

Common Mistakes

Wrong Let an instruction retire as soon as it is finished.

An older instruction may still trap, or be a branch that was guessed wrong.

Fix Retire only from the head, in program order.

Wrong Let a speculative store write memory.

After a squash the write cannot be taken back.

Fix Keep it in a store buffer until it retires.

Wrong After a wrong guess, clear the buffer and keep the rename table.

The table points at places of instructions that never ran.

Fix Put the old place of every squashed write back into the table.

Remember

  • The reorder buffer holds the instructions in flight in program order: in at the tail, out at the head.
  • Only a finished head retires. So results are final in order, and a trap is precise.
  • Speculation executes behind a guess. A wrong guess squashes the younger entries and repairs the rename table.
  • A store writes memory only at retirement. ap_rv32 is in-order and has no reorder buffer.

Practice

Report a problem with this page