z80replacement · a Z80 CPU replacement with an FPGA
Project plan
the phases, the tests and the risks
Status, 29 November 2026: nobody has built this module yet. The first sample run of 2 boards comes soon. Wait until the project has tested these boards before you send an order or a build request to a factory.
Repository file: docs/plan.md
This file gives the work in phases, the tests for each phase, and the risks. The other documents give the design decisions:
- requirements.md: what the module must do
- fpga.md: the FPGA family and the lite and full versions
- bus_interface.md: pins, level translators, timing
- memory.md: SRAM, flash and the memory modes
- clock_speeds.md: Z80 speed grades and system clocks
- usb_power.md: USB-C, isolation and power
- mechanical.md: outline, socket pins, PCB, assembly, placement study
- bus_timing.md: Z84C00 AC timing, module delays, core changes
- fpga_pinout.md: csfBGA285 banks and the bank split
- toolchain.md: the open-source tools
- prior_art.md: other Z80 replacement projects
- open_questions.md: decisions that are not made yet
- licensing.md: the two licenses and the notices
Block diagram
USB-C ── ESD ── RP2354A ──┐ ┌── QSPI flash
│ │ isolator │
LDO 3.3 V (USB side) ├──JTAG──────┤
├──UART──────┤
isolation gap ═╪════════════╪═══════════════
│ │
5 V (pin 11) ─ regulators ─ ECP5 ── SRAM 2 MB (full)
│
SN74LVC4245A × 6, 74LVC1G17 (CLK)
│
40 socket pins (Z80 bus)
Phases
Phase 0: decisions
- Answer the questions in open_questions.md.
- Get prices and stock for the FPGA, SRAM, translators and RP2354A.
Result: a fixed part list for the first board.
Phase 1: feasibility
These four tasks can occur at the same time.
- Gateware in simulation. Write the pin stage that adds the half T-state edges to the z80fpga core. Write a test bench that compares the pins with the edges in bus_interface.md. Build for the LFE5U-12F and the LFE5U-85F and read the timing reports.
- Timing table. Write
docs/bus_timing.md. Compare each Z84C00 AC parameter with the module delays at 4, 6, 8, 10 and 20 MHz. - Placement study. In KiCad, put all parts on the outline. Decide between layout choice A and B in mechanical.md. Get an HDI quotation from PCBWay.
- Pinout check. Compare the csfBGA285 pinouts of the 12F and the 85F.
Result: the board outline, the layer stack, and proof that the timing closes.
Status, 8 November 2026:
| Task | Status |
|---|---|
| 1, gateware | The four changes to the z80fpga core are done. The pin stage and its test bench are done: no failures at 4 MHz and 10 MHz with random /WAIT, /BUSREQ, /INT and /NMI. 6435 LUT4, highest bus clock 17.3 MHz to 18.5 MHz. See pin_stage.md. |
| 1, gateware (more) | In simulation, with test benches: the debug unit on ER1 for GDB and udb80 (debugger.md), memory mode 1 with the boot copy from the flash, 11 ROM image slots and the settings in the flash (memory.md), and the console ACIA (console.md). The full build is 7605 LUT4, and all pin groups meet the 10 MHz and 20 MHz limits (routing_study.md). Memory mode 2 in simulation: the bank decode, a 32 KB cache, the boot copy of the ROM from the flash into the DRAM, and the LiteDRAM DDR3L controller with an init and read-leveling sequencer (ddr3.md); the full build with mode 2 is about 11000 LUT4, and the DRAM clock has almost no timing margin. On 9 November 2026 the SRAM controller gateware/sram/z80r_mem2_sram.sv replaced the DDR3L controller: 8251 TRELLIS_COMB, 1872 FF, bus clock 16.86 MHz. |
| 2, timing table | Done for the estimates in bus_timing.md. Calculate again after the LPF pin locations exist. |
| 3, placement study | All parts fit on two sides. See mechanical.md. The routing study has started: pin assignment, route lengths, timing on the real balls. See routing_study.md. Open: the routed escape of the FPGA (the DDR3L was the routing block, and the SRAM replaced the DDR3L on 9 November 2026), and the PCBWay answer about the via and track rules. |
| 4, pinout check | One footprint for 12F to 85F. Bank split found. See fpga_pinout.md. |
| Schematic (phase 3, step 1) | A generated draft of the full version passes ERC and a netlist check against the pin assignment (schematic.md). The wiring of the translators found a wrong DIR polarity in the gateware, now fixed. Open: the items to check in schematic.md, the most important the Nexperia DHVQFN24 pin numbers. |
| PCB (phase 3, step 2) | A generated board with 186 parts placed (158 parts after the change to SRAM on 9 November 2026, and 159 parts since the third board round of 11 November 2026) on two sides; the DRC has no violation (pcb.md). The board must be HDI 1+1+4+1+1 (8 layers, staggered microvias): through vias under the BGAs take the bottom area that the parts need. Open: the BGA fanout, the planes, the routing, and the files for PCBWay. |
Phase 2: bus interface on a large board
Before the small module, prove the bus interface on a board that is easy to probe.
- Use an ECP5 development board with enough I/O pins, for example the OrangeCrab or the ULX3S. The OrangeCrab has the same csfBGA285 package and DDR3L (the module has SRAM since 9 November 2026). The ULX3S has more I/O pins and an LFE5U-85F option.
- Design a 2-layer or 4-layer adapter board in KiCad. The adapter board has the same translators as the module and a cable to a DIP-40 plug.
- Connect the logic analyzer to an RC2014 with a real Z84C00. Record the bus during a known program, for example the RomWBW boot.
- Put the adapter in the same RC2014. Record the same program. Compare the two recordings cycle by cycle.
- Test the memory modes 1 and 2 with the memory of the development board. That memory is DRAM, not the SRAM of the module.
The cable adds delay. Thus phase 2 proves the logic at 7.3728 MHz, and phase 4 proves the timing at higher clocks.
Result: the module design runs RomWBW and CP/M on a real RC2014.
Phase 3: module revision A
- Draw the schematic of the full version in KiCad. A generated draft exists and passes its checks (schematic.md); review the items to check in that file. Put the license notice from licensing.md in each sheet.
- Do the layout with the layer stack from phase 1. Put the source location and the license name on the silkscreen.
- Write the RP2354A firmware: the JTAG adapter, the console port and the debug port for GDB (debugger.md). The firmware exists and passes its host test (firmware.md). The schematic uses the GPIO numbers and the isolator channels of board_pins.md.
- Order 5 full boards, assembled, from PCBWay.
Phase 4: bring-up
Do these steps in sequence on each board. Stop at the first step that fails.
- Measure the resistance from each rail to ground with no power.
- Apply 5 V from a current-limited supply. Measure each rail.
- Connect USB. Load a test bitstream with openFPGALoader.
- Write the configuration flash. Do a power cycle. Check DONE.
- Put the module in an RC2014 at 7.3728 MHz in mode 0. Boot the ROM of the system.
- Do the trace comparison of phase 2 again with the module.
- Increase the bus clock in steps to 10 MHz, then to 20 MHz.
- Test the memory modes 1 and 2.
- Test the USB power option (JP1, JP2).
- Debug a CP/M program with GDB and udb80 through the USB-C port.
- Measure the current at 5 V. Write the result in usb_power.md.
Phase 5: lite version and revision B
- Assemble boards with the lite bill of materials.
- Correct the problems that phase 4 found. Order revision B.
Phase 6: release
- Make the repository public.
- Add the fabrication files and the bill of materials of each version to a GitHub release.
- Write the user guide: install, the memory modes, the USB tool.
Test systems
| System | Why |
|---|---|
| RC2014 with RomWBW | The main target. Many boards, a known boot sequence. |
| RC2014 Classic or Mini | Simple system, ROM BASIC. |
| A system with an NMOS Z80 and NMOS peripherals | Tests the TTL input levels. |
| ZX Spectrum (optional) | The ULA stops CLK during contended memory cycles. Tests a stopped CLK. |
Risks
| Risk | Effect | Action |
|---|---|---|
| The parts do not fit the outline. | No module of DIP size. | Placement study in phase 1. Two-board design as a fallback. |
| HDI cost is high. | Each module costs too much. | Quotation in phase 1. Larger batch. |
| Half T-state paths do not close at 20 MHz. | The module operates only up to 10 MHz, the required range. | Timing table in phase 1. State the highest clock that the module supports. |
| SRAM latency is too long at 20 MHz. | Memory mode 2 has 32.2 T of wait states per miss at 20 MHz. | Block RAM for the most used area. See memory.md. |
| The SRAM ball map (from a text extract of the data sheet) is wrong, or the part has no stock. | The first board does not work, or cannot be built. | Compare the ball map with the official PDF before the PCB order. Find stock first. Fallback: IS61WV20488FBLL (10 ns), same package. |
| History, until 9 November 2026: DDR3L does not fit, or the banks have too few pins. | 256 MB was not possible. | Fallback was 32 MB SDR SDRAM. The DDR3L is removed, see ddr3.md. |
| History, until 9 November 2026: DDR3L supply ends. | The full version could not be built. | Two sources before the schematic. |
| The csfBGA285 pinouts differ between densities. | Lite and full need two PCBs. | Pinout check in phase 1. |
| The module takes more current than the Z80. | Weak supplies fail. | Measure in phase 4. Write the value in the documents. |
| A socket type has no space below the module. | The module does not seat. | Measure sockets in phase 1. |
| Bus behavior that SingleStepTests does not test, for example /BUSREQ during a block instruction. | A peripheral fails. | Trace comparison with a real Z84C00 in phase 2 and phase 4. |
Source of this page: web/ and docs/ in the
z80replacement repository. Hardware: CERN-OHL-S-2.0. Other files: GPL-3.0-or-later.