z386 is an open-source FPGA implementation of the Intel 80386 CPU that uses the original recovered Intel microcode as its control program rather than reimplementing instructions behaviorally. The project reconstructs the 386's eight major units: prefetch, decode, microcode sequencer, ALU/shifter, segmentation, protection, paging, and BIU/cache. It boots DOS 6/7, runs protected-mode software via DOS/4GW and DOS/32A, and plays games like Doom at ~16.5 FPS. The post details the instruction prefetch queue, two-pass PLA-based decoder, microcode sequencer with delay slots, a 16KB 4-way VIPT L1 cache, and the testing methodology using SingleStepTests, 86Box-based protected-mode tests, and real software. Compared to ao486, z386 uses fewer lines of code (8K vs 17.6K) and slightly fewer FPGA resources, trading some performance for architectural fidelity to the original 386 design.

20m read timeFrom nand2mario.github.io
Post cover image
Table of contents
From z8086 to z386z386 - high-level viewInstruction prefetchDecodeMicrocode sequencer - the control programCacheTestingz386 and ao486Current StatusThoughtsCredits
758 Impressions