Design and Testing of a CPU Emulator

MSR-TR-2009-115 |

In this paper, we describe the design and testing process of an x86 CPU model for the Giano simulator. We used a hardware-oracle for test generation and as a reference behavioral specification. We developed an automatic tester that extracts the CPU specifications from the published CPU datasheets, and automatically generates test cases with complete test coverage. The number of required tests is reduced by many orders of magnitude by the separate testing of operand routing from computation. Debugging efficacy is such that the tester is now used concurrently with the development process, not afterwards. The hardware-oracle detects and documents several undocumented or erroneously-specified CPU behaviors which would be difficult to detect by conventional testing methods.