z80replacement · a Z80 CPU replacement with an FPGA

Build from source

This page gives the folders of the repository, the tools and the commands that build each part of the design. Nobody did these steps on a board yet.

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.

Status

This page gives the state of the repository on 29 November 2026.

  • The source files are in the repository https://github.com/avwohl/z80replacement. The repository is public from 29 November 2026.
  • No board exists yet. Thus nobody did the steps of this page on a board. The gateware test benches pass in simulation, and the firmware passes its host test with 213 checks. These results come from simulation and from models, not from hardware.
  • The project has no user guide yet. Phase 6 of the project plan has this work: a user guide for the installation, the memory modes and the USB tool.
  • This site does not give the Gerber files or the placement file. The project puts these files in a release only after the first boards pass the board test. The repository has the KiCad files, and hardware/pcb/make_fab.py makes the Gerber files from them. Do not order a board before the first boards pass the board test.

The folders of the repository

Folder Contents
hardware/schematic The KiCad 10 schematic of the full version: the root sheet and five sheets. Python programs write the symbols, the footprints and the schematic. The schematic comes from a model of the circuit. check_sch.py does the check of the schematic.
hardware/pcb The KiCad 10 board of the full version. make_pcb.py makes the board from the model. The folder also has the escape, fan-out, supply and signal routers, their data files, the DRC script check_pcb.py and make_fab.py for the fab files.
hardware/placement_study The placement study of phase 1: all parts on a DIP-40 outline, with no nets and no tracks, and an estimate of the route lengths.
gateware/bus The pin stage, the bus top level z80r_bus, memory mode 1 with the boot copy, the console ACIA, the control port, memory mode 2 with its cache, and the test benches.
gateware/dbg The ER1 link and the memory port of the debug unit, the test benches, the cosim, and the Python tests of the bridge, udb80, GDB and the RAM loader.
gateware/sram The SRAM controller of memory mode 2, a model of the SRAM that checks the SRAM timing, and the test benches.
gateware/ddr History: the LiteDRAM DDR3L controller. The SRAM replaced the DDR3L on 9 November 2026.
gateware/top The top level on the FPGA balls (z80r_top.sv), the pin file z80r_mg285.lpf and its source make_lpf.py, the emergency bitstream, a timing wrapper and a /WAIT patch for z80fpga.
gateware/check_z80fpga.py The version check of the z80fpga checkout. The gateware Makefiles do this check before each build that reads the Z80 core.
firmware The RP2354A firmware (src/), the board header (boards/), the partition table, the host test (test/) and two tools (tools/efuse.py, tools/mk_safe_image.py).
tools Two host tools: the RAM loader z80r_load.py, and z80r_romimg.py, which makes the ROM slot files.
docs The design documents. This site shows most documents as pages.
web The source of this site: the pages, the blog posts, the PHP files, the static files, the style sheet and make_web.py.

The files in hardware/ use the license CERN-OHL-S-2.0. All other files use GPL-3.0-or-later. Licensing gives the details.

The Z80 core is not in this repository. The core is in z80fpga, a separate repository. The gateware Makefiles find z80fpga in the folder z80fpga next to the checkout of this repository. The variable Z80FPGA gives a different folder.

The tools

All tools are open source. The project uses no vendor FPGA tool. The table gives a minimum version only where a document or the code gives one. The license column gives the license that the documents state.

Tool Use in the project Minimum version License
KiCad 10 (with kicad-cli) Schematic, board, ERC, DRC, fab files, 3D renders 10: the board file has the KiCad 10 format GPL-3.0
FreeCAD 3D check of the module in a socket not given LGPL-2.0
Python 3 All scripts: schematic, board, pin file, ROM slot files, RAM loader, tests of the debug path, web site 3.8 for the RAM loader not given
numpy, scipy, shapely The escape, fan-out, supply and signal routers of the board (system Python) not given not given
A host C compiler (gcc or cc) The firmware host test and picotool. route_signals.py compiles the signal router sigroute.c with gcc. not given not given
yosys Synthesis not given ISC
nextpnr-ecp5 Place and route not given ISC
Project Trellis (ecppack) Bitstream files not given ISC
Icarus Verilog (iverilog, vvp) The test benches and the cosim not given GPL-2.0
Verilator mingw32-make lint in gateware/bus not given LGPL-3.0 or Artistic-2.0
openFPGALoader Load of the bitstream and the ROM slot files through the USB-C port not given Apache-2.0
OSS CAD Suite One package with yosys, nextpnr, Project Trellis, Icarus Verilog, Verilator and openFPGALoader, for Linux, macOS and Windows not given not given
z80fpga The Z80 core, the debug unit, the bridge z80dbg_bridge.py, the assembler zasm.py, the script ossenv.sh 0.2.1 (gateware/bus alone needs 0.2.0) GPL-3.0
Raspberry Pi pico-sdk, with TinyUSB SDK and USB stack of the firmware not given BSD-3-Clause (pico-sdk), MIT (TinyUSB)
Arm GNU Toolchain (arm-none-eabi) Compiler for the RP2354A not given GPL-3.0
CMake Build files of the firmware 3.13 not given
Ninja Firmware build not given not given
picotool The UF2 file, the partition information, the load of the emergency bitstream image, firmware updates not given not given
GDB with the z80 target Debug of a Z80 program through the bridge, mingw32-make test-gdb not given not given
udb80 (part of um80) Debug of a Z80 program through the bridge, test-udb80, and dbg2elf for test-gdb um80 0.4.2 not given
pyserial The debug port: the RAM loader and the bridge not given not given
pyusb firmware/tools/efuse.py, the eFuse control not given not given
matplotlib The panel drawing for PCBWay, and route_signals.py not given not given
The Noto Sans CJK font The Chinese labels of the panel drawing on Linux not given not given
Python-Markdown, markdown-it-py, mdit-py-plugins, rsvg-convert, PHP The web site build not given not given

The pico-sdk downloads and builds picotool at the first firmware build.

The documents give the commands of a Windows test computer. On that computer, MSYS2 gives the shell, and mingw32-make reads the Makefiles. Paths that start with %LOCALAPPDATA% or C:/ are paths on that Windows computer. The web site build runs on a Linux computer.

On Linux and macOS, use make in place of mingw32-make. The documents write python. On a computer with no python command, use python3.

Build steps

Each subsection gives the commands of the documents and the Makefiles. The commands start in the top folder of the repository, unless the step gives a different folder.

The schematic

The schematic is in the repository. Python programs write the schematic from the model of the circuit in make_sch.py. Do not edit the .kicad_sch files by hand.

  1. Install KiCad 10 or later.
  2. If KiCad is not a user install on Windows, set KICAD_DIR to the KiCad folder. The programs use bin/kicad-cli in that folder.
  3. If necessary, change the model in make_sch.py.
  4. Enter these commands:

    cd hardware/schematic
    python make_lib.py
    python make_fp.py
    python make_sch.py
    python check_sch.py
    
  5. Read the last line of the output. The last line must be PASS.

The programs write these files:

  • make_lib.py writes the symbols z80r.kicad_sym.
  • make_fp.py writes the footprints z80r.pretty.
  • make_sch.py writes the project, the root sheet, the five sheets, model.json and parts.json. The board step reads model.json and parts.json.

check_sch.py examines five items:

  • The ERC gives no errors.
  • Each pin of each part is on the net of the model.
  • Each signal of gateware/top/make_lpf.py is on its ECP5 ball.
  • For each isolator row of Board pins, the RP2354A pin, the isolator pins and the ECP5 ball are on the same nets.
  • No net has only one pin.

The PCB and the fab files

All signal nets of the board hardware/pcb/z80r.kicad_pcb have tracks. The board comes from the third board round of 11 November 2026 (the variant 3c). On that day, check_pcb.py --routed gave no violation and no unconnected item.

make_pcb.py makes the board from the model of the schematic (model.json and parts.json). The program then adds the copper of the data files in escape/, power/ and signals/. These data files are in git, and they keep the hash of build/base.json. If the placement or the fanout changes, make_pcb.py does not use the old data files. The program then tells you to make the data files again.

The scripts need different Python environments:

  • make_pcb.py needs the KiCad Python, because the program uses the pcbnew module.
  • escape_bga.py, fanout_bga.py, power_route.py and route_signals.py need the system Python with numpy, scipy and shapely. route_signals.py also needs matplotlib and gcc. The script compiles sigroute.c with gcc.
  • check_pcb.py and make_fab.py use kicad-cli and need only Python.

To make the board from the data files in git and do the DRC:

  1. Go to hardware/pcb.
  2. Make the board with the KiCad Python. The path of the KiCad Python is the path on Windows.

    "%LOCALAPPDATA%/Programs/KiCad/10.0/bin/python.exe" make_pcb.py
    
  3. Do the DRC of the routed board:

    python check_pcb.py --routed
    
  4. Read the output. The output must give 0 violations and 0 unconnected items.

After a change of the placement or the fanout, make the data files again with the routers. PCB gives the commands.

NOTE: The signal copper in git comes from a run with HIST_ADD at 1.7 and 60 iterations. In route_signals.py, the default of HIST_ADD is 1.5 and the default of --iterations is 60. The environment variable HIST_ADD sets the value. A small change of a router value can leave nets open.

  1. Go to hardware/pcb.
  2. Enter the commands of PCB:

    "%LOCALAPPDATA%/Programs/KiCad/10.0/bin/python.exe" make_pcb.py
    python escape_bga.py U1 build/base.json escape/u1.json
    python fanout_bga.py U1 build/base.json escape/u1.json escape/u1_fan.json
    python power_route.py build/base.json escape/u1.json,escape/u1_fan.json power/power.json
    "%LOCALAPPDATA%/Programs/KiCad/10.0/bin/python.exe" make_pcb.py
    python check_pcb.py
    python route_signals.py
    "%LOCALAPPDATA%/Programs/KiCad/10.0/bin/python.exe" make_pcb.py
    
  3. Do the DRC of the routed board with python check_pcb.py --routed.

  4. Read the output. The output must give 0 violations and 0 unconnected items.

To make the fab files:

CAUTION: NO BOARD FROM THESE FILES EXISTS YET. Do not order boards from these files before the first boards of the project pass the board test. The design can have errors that only a real board shows.

  1. In the top folder of the repository, make the fab files:

    python hardware/pcb/make_fab.py
    
  2. Find the files in hardware/pcb/fab/:

    • z80r-bom.csv: the BOM in the PCBWay format, one line for each part type.
    • z80r-cpl.csv: the placement file of the SMD parts.
    • gerber/: the Gerber files of all layers and the drill files.
  3. Go to hardware/pcb.

  4. Make the panel drawing for PCBWay (2 boards in a 1x2 panel):
    python make_panel_drawing.py
    

With the option --no-gerber, make_fab.py makes only the BOM and the placement file. The fab files are not in git. The panel drawing goes to fab/order/z80r-panel-1x2.png. A file name after make_panel_drawing.py gives a different output file. The Chinese labels of the drawing need the font Microsoft YaHei on Windows, or Noto Sans CJK on Linux.

The gateware bitstreams

The gateware Makefiles use the OSS CAD Suite and the z80fpga checkout. Before a build that reads the Z80 core, the Makefile compares the version of z80fpga with the lowest version that the build needs. The script ossenv.sh of z80fpga puts the OSS CAD Suite on PATH.

  1. Put a z80fpga checkout next to the checkout of this repository.
  2. Go to gateware/top.
  3. If the OSS CAD Suite is not in the default folder of ossenv.sh, set OSS_CAD_ROOT to its folder.
  4. Put the OSS CAD Suite on PATH:

    source ../../../z80fpga/tools/ossenv.sh
    
  5. Build the bitstream of the full version (LFE5U-85F):

    mingw32-make bit-85k
    
  6. For memory mode 2 with the SRAM controller, add MEM2=1:

    mingw32-make bit-85k MEM2=1
    
  7. For the boot copy of the ROM slots, add BOOT=1:

    mingw32-make bit-85k BOOT=1
    

The build writes two files:

  • build/top-85k.bit: the image for the configuration flash U17. The ecppack options are --compress --freq 38.8 --spimode fast-read (BITOPT).
  • build/sram-85k.bit: the same design for a load into the SRAM of the FPGA through JTAG. The file has only --compress (SRAMOPT) and no SPI mode command.

mingw32-make bit-12k writes build/top-12k.bit and build/sram-12k.bit for the LFE5U-12F of the lite version.

These variables of the Makefile set the design:

Variable Default Function
OVL_MAP 0 The internal pages of memory mode 1, in decimal: 49155 is C003H
OVL_RO 0 The read-only pages of memory mode 1, in decimal
OVL_KB 16 The size of the block RAM of memory mode 1, in KB
BOOT 0 1 adds the boot copy from the configuration flash
MEM2 0 1 adds memory mode 2 with the SRAM controller (the 85F only)

The ROM slots have an effect only when the bitstream has the boot copy (BOOT=1). The other targets of gateware/top are report (place and route on the 12F and the 85F), timing (the delay of each group of pins) and lpf (make_lpf.py writes z80r_mg285.lpf).

To build the emergency bitstream of the safe mode:

  1. In gateware/top, do the test of the emergency bitstream:

    mingw32-make test
    
  2. Build the emergency bitstream for the 85F and the 12F:

    mingw32-make safe
    

The target safe writes build/safe-85k.bit and build/safe-12k.bit with the USERCODE Z80E. The target also writes build/safe-85k.img and build/safe-12k.img, the images for the partition safe_bitstream of the RP2354A flash. The build runs check_safe_pins.py on each netlist and stops if the check fails. Use the image that fits the FPGA of the module.

The simulation test benches

The test benches use Icarus Verilog. Each bench prints PASS or FAIL as its last line. A target fails if a bench does not print PASS. The table also gives the lint, synthesis and place and route targets.

Folder Target What the target does
gateware/bus test The pin stage, memory mode 1, the boot copy, the console ACIA and the control port, at several bus clocks
gateware/bus lint A Verilator lint of z80r_bus
gateware/bus report Place and route of z80r_bus on the 12F and the 85F, with no pin locations
gateware/sram test The SRAM controller, a negative test that must fail, and memory mode 2 at 10, 4 and 20 MHz
gateware/sram synth A yosys synthesis of the SRAM controller alone
gateware/dbg test The debug unit at 10 MHz and 4 MHz, and the debug unit under the control port
gateware/dbg test-bridge The GDB remote protocol through the bridge of z80fpga, against the cosim
gateware/dbg test-udb80 A udb80 session against the cosim
gateware/dbg test-gdb A GDB session against the cosim
gateware/dbg test-load The RAM loader against the cosim
gateware/top test The emergency bitstream
  1. Go to the top folder of the repository.
  2. Enter the commands of Pin stage for gateware/bus:

    source ../z80fpga/tools/ossenv.sh
    cd gateware/bus
    mingw32-make test
    mingw32-make lint
    mingw32-make report
    
  3. For a different folder of the table, go to that folder.

  4. Enter mingw32-make and the target of the table.

The targets of the debug path need more tools:

  • test-udb80 and test-gdb need um80 0.4.2 or later.
  • test-gdb needs a GDB with the z80 target. On Windows, the documents use the gdb-multiarch of MSYS2. The gdb of WinLibs has no z80 target.
  • The variable Z80R_GDB selects a different GDB. If no GDB has the z80 target, the test reports SKIP. With Z80R_REQUIRE_GDB=1, the test fails in that case.

gateware/ddr holds the old DDR3L flow. That flow needs the LiteDRAM generator. The SRAM replaced the DDR3L, thus the module does not use that flow.

The firmware

The firmware runs on the RP2354A. The build makes build/z80r_usb.uf2. The host test examines the firmware logic on a model of the ECP5 TAP, with no pico-sdk and no board.

To install the tools:

  1. Make a clone of the pico-sdk from https://github.com/raspberrypi/pico-sdk.
  2. In the pico-sdk folder, get the submodules. TinyUSB is one of the submodules.

    git submodule update --init --depth 1
    
  3. Download the Arm GNU Toolchain (arm-none-eabi) for the computer from developer.arm.com.

  4. Compare the SHA-256 of the download with the .sha256asc file from the same page.
  5. Install CMake, Ninja and a host C compiler.
  6. Put the bin folder of the Arm GNU Toolchain first on PATH.

To build the firmware:

  1. Go to firmware.
  2. Enter these commands. C:/temp/tools/pico-sdk is the pico-sdk folder of the Windows test computer. Give the folder of your pico-sdk clone.

    cmake -S . -B build -G Ninja -DPICO_SDK_PATH=C:/temp/tools/pico-sdk -DCMAKE_BUILD_TYPE=Release
    cmake --build build
    
  3. Find the result in build/z80r_usb.uf2.

The build uses -Werror, thus a warning stops the build. For an update image with try before you buy, add -DZ80R_TBYB=ON to the first command (Recovery, level 1).

To do the host test:

  1. Go to firmware/test.
  2. Enter this command. On Windows, enter mingw32-make CC=gcc in place of make.

    make
    
  3. Read the last line of the output. The last line must be PASS.

The ROM slot files

The configuration flash U17 holds a selector at 400000H and 11 slots. Slot n is at 500000H + n × 100000H, for n = 0 to 10. Each slot holds one ROM image after a header of 16 bytes. The header holds the settings of the image. At power-up, a bitstream with the boot copy reads the selector and copies the selected slot.

tools/z80r_romimg.py makes the slot files and the selector file. Memory calls this tool the USB tool. The tool prints the openFPGALoader command for each file.

To make the files for memory mode 1:

  1. Make the slot file for slot 0. This example puts rom.bin at 0000H, with the internal pages C003H and the read-only pages 0003H:

    python3 tools/z80r_romimg.py --map C003 --ro 0003 --kb 16 --slot 0 rom.bin@0000 -o slot0.bin
    
  2. Make the selector file for slot 0:

    python3 tools/z80r_romimg.py --select 0 -o select.bin
    

To make a slot file for memory mode 2 from a RomWBW ROM file:

  1. Enter this command:
    python3 tools/z80r_romimg.py --mode2 SBC_std.rom --slot 0 -o slot0.bin
    

The slot files have an effect only if the bitstream has the boot copy (BOOT=1). The options must agree with the bitstream:

  • --kb must be the OVL_KB of the bitstream.
  • --rom-kb must be the MEM2_ROM_KB of the bitstream. The default is 512.
  • Each page of --ro must also be in --map.

python3 tools/z80r_romimg.py --help lists the other options: the ACIA, the opcode echo and the control port.

Load a board through the USB-C port

Nobody did these steps on a board yet, because no board exists.

The RP2354A of the module is the JTAG adapter. The firmware uses the DirtyJTAG IDs (VID 1209H, PID C0CAH). Thus openFPGALoader finds the module with the option -c dirtyJtag. A new board needs no other JTAG adapter and no SWD probe. All loads go through the USB-C port.

Linux needs a udev rule that gives users access to the device. The FPGA and the flash U17 are on the Z80 side. Thus the Z80 side must have power during a load. The power comes from 5 V on the socket, or from the USB power option with its jumpers JP1 and JP2 (USB-C and power). The firmware does not turn the eFuse of the USB power option on by itself. The command python3 firmware/tools/efuse.py on turns the eFuse on.

To load the RP2354A firmware:

  1. Push and hold SW1 (BOOTSEL).
  2. Connect the USB-C cable to the computer.
  3. Release SW1. The computer shows the drive RP2350.
  4. Copy firmware/build/z80r_usb.uf2 to the drive RP2350. The RP2354A then starts the firmware.

NOTE: An RP2354A with an empty flash starts the USB boot loader without SW1. The boot loader is in the mask ROM of the RP2354A.

To write the bitstream to the flash U17:

  1. Apply 5 V to socket pin 11 and GND to socket pin 29 from a current-limited supply.
  2. Read the IDCODE of the ECP5 and the ID of the flash U17:

    openFPGALoader -c dirtyJtag --detect -f
    
  3. Make sure that the output shows the LFE5U-85F and a Winbond flash of 128 Mbit.

  4. Go to gateware/top.
  5. Write the bitstream to the flash U17. With --verify, openFPGALoader reads the data back and compares the data.

    openFPGALoader -c dirtyJtag -f --verify build/top-85k.bit
    
  6. Do a power cycle of the 5 V supply.

  7. Measure DONE. DONE must be high.

NOTE: openFPGALoader does not write the text header of the .bit file into the flash U17. Thus a dump of the flash is not equal to top-85k.bit. The check of the bitstream is --verify.

To write the ROM slot files to the flash U17:

  1. Make sure that the bitstream in the flash U17 has the boot copy (BOOT=1).
  2. Go to the top folder of the repository.
  3. Write the slot file to slot 0:

    openFPGALoader -c dirtyJtag -f --verify -o 0x500000 slot0.bin
    
  4. Write the selector file:

    openFPGALoader -c dirtyJtag -f --verify -o 0x400000 select.bin
    
  5. On the first board, read the slot and the selector back.

    CAUTION: GIVE A NEW FILE NAME FOR EACH DUMP. openFPGALoader writes the dump into the file of the command line and overwrites that file.

    Enter these commands. Replace SIZE with the size of the file in bytes.

    openFPGALoader -c dirtyJtag --dump-flash -o 0x500000 --file-size SIZE slot0-dump.bin
    cmp slot0.bin slot0-dump.bin
    openFPGALoader -c dirtyJtag --dump-flash -o 0x400000 --file-size SIZE select-dump.bin
    cmp select.bin select-dump.bin
    
  6. Make sure that cmp prints nothing. Then each dump is equal to its file.

  7. Do a power cycle. The bitstream copies the selected slot, and then the Z80 core starts.

To load the image of the emergency bitstream into the partition safe_bitstream:

  1. Go to gateware/top.
  2. Find the address of the partition:

    picotool partition info
    
  3. Load the image at that address:

    picotool load -o <address> build/safe-85k.img
    

To update the firmware in the other partition of the A/B pair:

  1. Build the firmware with -DZ80R_TBYB=ON.
  2. Apply power to the Z80 side. Without power, the new image does not pass its self-test, and the old image comes back.
  3. Go to firmware/build.
  4. Load the new image:
    picotool load -u -v -x z80r_usb.uf2
    

NOTE: The new image starts with the eFuse off. If the Z80 side has power only through the eFuse, the host must turn the eFuse on again immediately. RP2354A firmware, "eFuse", gives the details.

For a load into the SRAM of the FPGA through JTAG, use build/sram-85k.bit. The documents give no command line for this load yet. If the firmware load fails, use the SWD test pads (SWCLK, SWDIO, RUN) with a Raspberry Pi Debug Probe.

The RAM loader

tools/z80r_load.py writes program and data images into the RAM of the Z80 system through the debug port of the module. The loader stops the CPU core with the debug unit and writes each image. Then the loader reads each image back and compares the bytes. A test examines the loader in simulation only.

The loader needs these items:

  • Python 3.8 or later.
  • pyserial, for the debug port of the module.
  • A z80fpga checkout. The loader finds the checkout from --z80fpga, from the variable Z80FPGA, or in ../z80fpga next to this repository.

On macOS and Linux, the debug port is the second CDC port of the module. On Windows, the debug port is the second COM port of the module. In the commands below, replace COM5, /dev/cu.usbmodem3 and /dev/ttyACM1 with the debug port of your computer.

CAUTION: DO NOT USE --bank ON A Z80 SYSTEM WITH A DIFFERENT BANK SCHEME. The I/O writes to 78H and 7CH can change a different register on that system.

  1. Stop the GDB bridge. The bridge and the loader use the same debug port.
  2. Load a binary file at 9000H and start the program at 9000H:

    python3 tools/z80r_load.py --serial COM5 prog.bin@9000 --run 9000
    
  3. To load an Intel HEX file into bank 85H, use --bank:

    python3 tools/z80r_load.py --serial /dev/cu.usbmodem3 --bank 85 data.hex
    

Without --run and --resume, the core stays stopped. Then GDB or udb80 can connect through the bridge of z80fpga (Debugger over USB-C). The bridge is tools/z80dbg_bridge.py in the z80fpga checkout, and the bridge needs pyserial.

  1. Go to the z80fpga checkout.
  2. Start the bridge:

    python3 tools/z80dbg_bridge.py --serial /dev/ttyACM1 --listen 1234
    
  3. In a different terminal window, start a GDB with the z80 target:

    gdb
    
  4. Enter these GDB commands:

    set architecture z80
    target remote :1234
    

The web site

web/make_web.py builds this site. The script converts the pages in web/pages/ to PHP pages, and makes a page for each published document in docs/. The script also makes the schematic PDF, the schematic sheets, the 3D renders, the BOM file and the panel drawing. The web site build runs on a Linux computer.

  1. Install these Ubuntu packages:

    sudo apt-get install --no-install-recommends kicad kicad-packages3d \
        python3-markdown python3-markdown-it python3-mdit-py-plugins \
        python3-matplotlib fonts-noto-cjk librsvg2-bin php-cli
    
  2. Make sure that the kicad package gives KiCad 10 or later. The board file has the KiCad 10 format.

  3. Build the site. Replace DIR with the output folder.
    python3 web/make_web.py --out DIR
    

The options of make_web.py:

  • --out DIR: the output folder. The folder above DIR must hold inc/site.php, the page frame of awohl.com. This repository does not have the page frame.
  • --no-renders: use the last 3D renders, also if the board changed. Each new 3D render takes about one minute.
  • --verify URL: get each page from URL after the build. The script stops with an error if a page does not give HTTP 200.
  • --blog-config FILE: the PHP configuration file of the blog on the web server.

The script builds the site in DIR.new and does a check of each internal link. If a link has no target, the script stops, and DIR does not change.

The first load of a new board

Nobody did these steps yet, because no board exists. The project plan, "Phase 4: bring-up", gives the steps. Do the steps in sequence on each board. Stop at the first step that fails.

  1. Measure the resistance from each rail to ground with no power.
  2. Apply 5 V from a current-limited supply. Measure each rail.
  3. Connect USB. Load a test bitstream with openFPGALoader.
  4. Write the configuration flash. Do a power cycle. Measure DONE.
  5. Put the module in an RC2014 at 7.3728 MHz in memory mode 0. Boot the ROM of the system.
  6. Record the bus during a known program. Compare the record cycle by cycle with the record of a real Z84C00 from phase 2.
  7. Increase the bus clock in steps to 10 MHz, then to 20 MHz.
  8. Do a test of memory modes 1 and 2.
  9. Do a test of the USB power option (JP1, JP2).
  10. Debug a CP/M program with GDB and udb80 through the USB-C port.
  11. Measure the current at 5 V.

Steps 3 and 4 use the commands of "Load a board through the USB-C port" above. The document Recovery has the same procedure for a new board, with the ROM load and the check, in the section "First load of a new board".

Detailed documents

  • Toolchain: the open-source tools, and why KiCad.
  • The schematic: how the programs make and check the schematic, and the items to check.
  • PCB: the board, the routers, the fab files and the order remarks for PCBWay.
  • Pin stage: the pin stage and the tests of gateware/bus.
  • Memory: the memory modes, the boot copy, the ROM slots and the USB tool.
  • The SRAM: the SRAM controller and its tests.
  • The emergency bitstream: the bitstream of the safe mode, its build and its pin check.
  • RP2354A firmware: the build, the host test and the USB functions.
  • Recovery: the recovery levels, the BOOTSEL button and the A/B firmware images.
  • RAM loader: the options of the loader and its test.
  • Debugger over USB-C: GDB, udb80 and the bridge.
  • Console ACIA: the console UART in the FPGA and its test.
  • USB-C and power: the USB functions, the drivers and the load times.
  • FPGA selection: the lite and full versions, and the load time of the bitstream.
  • Project plan: the phases, the tests and the risks.
  • Licensing: the two licenses and the notices.

Source of this page: web/ and docs/ in the z80replacement repository. Hardware: CERN-OHL-S-2.0. Other files: GPL-3.0-or-later.