Welcome to FPGA MicroPython (FμPy)
The aim of this project is to make MicroPython run on FPGAs using the LiteX & Migen+MiSoC technologies. This allows you to do full stack development (FPGA gateware & soft CPU firmware) in Python!
Gateware
Gateware is the name we use for the hardware code that is loaded onto the FPGA that MicroPython runs on.
For MicroPython development we use a slightly modified version of the HDMI2USB-litex-firmware from the HDMI2USB project.
Getting Started
-
Jan 2018 blog post with instructions for Numato Mimas v2 and Digilent Arty A7, using
timvideos/litex-buildenv(currently more maintained than thefupylitex environment). -
Older detailed instructions for the MimasV2 (note: since this was written the repository has been renamed from
upy-fpgatofupyand the build process has been streamlined; see blog post above)
Developing in MicroPython environment
- get lm32 toolchain
- git clone https://github.com/fupy/micropython.git
- cd litex
- Download prebuilt gateware + headers using
get-gateware.sh - Compile micropython
- Load micropython
Developing in HDMI2USB LiteX environment
- Follow getting started instructions to setup gateware environment.
- Enter the gateware environment with ./scripts/enter-env.sh
- Set PLATFORM and TARGET correctly - IE “export PLATFORM=mimasv2” if using the MimasV2
- Build the gateware with
make gateware - Run
./scripts/build-micropython.sh
This will give you an image for your target at ./build/$PLATFORM_$TARGET_lm32/micropython.bin which you can then flash to your board.
Running MicroPython inside QEmu environment
The HDMI2USB LiteX environment provides some limited QEmu emulation of the FPGA gateware, this means you can test your code without needing hardware.
It can be used with the MicroPython image by running ./scripts/build-qemu.sh and then replacing -kernel qemu.bin with -kernel micropython.bin in the last command.
See the TimVideos’ QEmu for LiteX GitHub Repo
More Information
Contact
Current Targets
Hardware Targets
-
MimasV2 - $50 USD, Spartan 6 board with DDR memory.

-
Future FPGA MicroPython targets are documented in this spreadsheet.
Software Targets
These targets don’t need any physical hardware and are good for testing / developing.
- LiteX QEmu emulation (see MicroPython on FPGAs Wiki Page for notes on getting started)
- Verilator Verilog Simulator
