Writing as nand2mario, the z86 builder explains how they debugged a Pentium Pro–inspired CPU on a programmable chip. An out-of-order CPU runs independent instructions while earlier ones wait, but makes their results visible in program order. When a boot failed, the author needed to know whether an instruction did the wrong thing or whether the new hardware made its result visible at the wrong time.
- Start with a sequential model. A small C simulator ran the same internal operations one at a time. It could run DOOM before the author had to get the same behavior working in the speculative hardware.
- Stop at the first mismatch. The hardware simulation ran alongside the 86Box emulator. When they disagreed, the author checked the manuals or ran a probe on an actual Pentium Pro. Sometimes the emulator was wrong.
- Debug at real speed. Bugs that took hours to reach in simulation could show up within a minute of a live boot. An on-chip debugger froze the CPU so the author could inspect what it had just done.
The same approach works for a concurrent rewrite. Keep a simpler implementation around, compare results where they become visible, and investigate the first disagreement instead of starting at the eventual crash.