Master the fundamental concepts of pipelining & out-of-order execution through this focused micro-challenge.
Out-of-order CPUs execute speculatively but retire instructions in original program order through a Reorder Buffer (ROB). Each entry tracks destination, value readiness, and exception state. Only when an instruction is oldest and complete does it commit to architectural state.
cLoading…
For example, if a divide-by-zero occurs in the ROB but younger ops already executed, the fault fires only when the divide reaches the ROB head.
For this exercise, you will simulate a small ROB that buffers out-of-order completion and commits in order. This task asks you to model flush on branch mispredict before studying Tomasulo's algorithm.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Simulate reorder buffer for out-of-order execution.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github