Introduction
The world of CPU emulation was revolutionized when the 8088 microcode was decoded in 2020, enabling extremely accurate emulation. Today, the spotlight is on the NEC V20. While the V20 was supported in MartyPC, its cycle accuracy was lacking due to the missing microcode. Let's explore how this gap is being closed and the implications for emulation.
Why Microcode is Crucial
Microcode is crucial for executing instructions at the hardware level. It defines how a processor performs instructions at a fundamental level. For the NEC V20, having access to its microcode means being able to emulate its real performance, cycle by cycle. Without it, one risks approximations that can affect emulation accuracy.
The Challenge of Decoding Microcode
Decoding microcode is no trivial task. The V20's microcode resides in a ROM on the chip, a dense space of 29,928 bits organized in a 258x116 matrix. The challenge is not only reading these bits but also interpreting them correctly.
Chip Photography
One of the first steps to obtaining the microcode involves chip photography. In the case of the NEC V20, a high-resolution photo-mosaic was created, revealing a 5.6 Gigapixel image. This image allows visualization of the bits in the ROM, but manual extraction remains tedious.
Using Decoding Tools
Tools like MaskRomTool, developed by Travis Goodspeed, have been used to facilitate microcode extraction. However, bit detection proved complex due to the low contrast between bits and non-bits. The process requires adjustments to work around the limitations of existing tools.
Implications for Emulation
Once the microcode is correctly extracted and interpreted, it opens the door to high-fidelity emulation of the NEC V20. This means emulator developers can expect to replicate the processor's behavior at a previously unattainable level, essential for critical applications where precision is paramount.
Conclusion
Decoding the NEC V20's microcode represents a significant breakthrough for the emulation community. It underscores the importance of collaboration between hardware experts and software developers to push the boundaries of what is possible.
Let's discuss your project in 15 minutes.