Skip to main content

devlab

devlab is a Python CLI package for FPGA development. It installs the matching OSS CAD Suite build for the current operating system, creates a small FPGA project, and runs build/flash commands from devlab.toml.

Install

pip install devlab-fpga

For local development from this repository:

pip install -e .

Commands

devlab doctor
devlab install
devlab new blink
devlab new blink-vhdl --hdl vhdl
cd blink
devlab build
devlab flash

devlab install downloads OSS CAD Suite release 2026-07-06 from YosysHQ. The installer selects the correct asset for:

  • Linux x64
  • Linux arm64
  • macOS x64
  • macOS arm64
  • Windows x64

The default install location is ~/.devlab. Set DEVLAB_HOME to use a different directory.

devlab build, devlab flash, and devlab flash --detect automatically run OSS CAD Suite tools with the installed suite environment, including the official bin, py3bin, VIRTUAL_ENV, VERILATOR_ROOT, and GHDL_PREFIX settings. You do not need to manually source environment for those commands. devlab doctor checks the tools required by the current platform.

On Windows, OSS CAD Suite may be distributed as a 7-Zip self-extracting .exe archive. devlab install extracts it automatically into ~/.devlab/toolchains without opening an installer:

devlab install

The installed tree keeps the official OSS CAD Suite layout:

~/.devlab/toolchains/oss-cad-suite-2026-07-06-windows-x64/
  oss-cad-suite/
    bin/
    environment.bat
    environment.ps1

The Windows OSS CAD Suite package does not include GHDL. For VHDL projects on Windows, install the standalone GHDL package separately:

devlab install-ghdl

This downloads ghdl-mcode-6.0.0-ucrt64.zip and installs it under ~/.devlab/toolchains. Windows VHDL builds use ghdl --synth --out=verilog to generate an intermediate Verilog file before running Yosys, so no yosys-ghdl plugin is required on Windows.

For a full Windows setup and troubleshooting guide, see docs/windows-ghdl-support.md.

On Windows, install 7-Zip before devlab install when possible. If 7z.exe is available, devlab extracts the OSS CAD Suite self-extracting archive without executing the downloaded .exe, which avoids common antivirus/App Control blocks.

OSS CAD Suite Source

Default release:

https://github.com/YosysHQ/oss-cad-suite-build/releases/tag/2026-07-06

Example assets:

https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2026-07-06/oss-cad-suite-linux-arm64-20260706.tgz
https://github.com/YosysHQ/oss-cad-suite-build/releases/download/2026-07-06/oss-cad-suite-windows-x64-20260706.exe

Downloaded archives are verified with the SHA-256 digest published by the GitHub release API.

Project Format

devlab new blink creates:

blink/
  devlab.toml
  pins.cst
  src/top.v

Use --hdl vhdl to create src/top.vhd instead:

devlab new blink-vhdl --hdl vhdl

Default devlab.toml:

[fpga]
family = "GW1N-9C"
device = "GW1NR-LV9QN88PC6/I5"
cst = "pins.cst"

[build]
top = "top"
sources = ["src/top.v"]
constraints = "pins.cst"
build_dir = "build"

[flash]
board = "tangnano9k"
mode = "sram"
verify = false

For Gowin, family is the FPGA series used by the packer and place-and-route flow, for example GW1N-9C. device is the complete part number, for example GW1NR-LV9QN88PC6/I5. pins.cst is the Gowin constraints file.

Update pins.cst and [flash].board for the real FPGA board before building and flashing hardware.

Build Flows

For Gowin GW1N-9C / GW1NR-LV9QN88PC6/I5, devlab build runs:

yosys
nextpnr-himbaechel
gowin_pack

The iCE40 and ECP5 flows are still available by setting family = "ice40" or family = "ecp5" in devlab.toml.

For iCE40, it runs:

yosys
nextpnr-ice40
icepack

devlab flash uses openFPGALoader. By default it writes SRAM, so the FPGA loses the design after power cycling. Use flash mode to write the bitstream to non-volatile memory:

devlab flash --mode flash

Before writing flash on board variants where flash may or may not be populated, run detection:

devlab flash --detect
devlab flash --detect --board tangnano9k

Persistent flash can also be configured in devlab.toml:

[flash]
board = "tangnano9k"
mode = "flash"
verify = false
# external_flash = true
# offset = "0"

For Tang Nano 9K/Gowin, flash write verification may print writing verification not supported and fail the CRC check even when the flash write completed. Keep verify = false unless the selected board/programming path explicitly supports flash verification.

When sources end in .vhd or .vhdl, devlab build uses GHDL before FPGA synthesis. On Linux and macOS it runs Yosys with the GHDL plugin from the installed OSS CAD Suite tree. On Windows it uses the standalone GHDL package to write build/<top>_ghdl.v, then runs the normal Yosys synthesis flow on that generated Verilog file.

Use --dry-run to print the commands without executing them:

devlab build --dry-run
devlab flash --dry-run --board tangnano9k
devlab flash --dry-run --mode flash

Metadata

Release files for devlab-fpga 0.1.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for devlab-fpga 0.1.12
File Size Uploaded Provenance
devlab_fpga-0.1.12.tar.gz 17.6 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for devlab-fpga 0.1.12
File Interpreter ABI Platform
devlab_fpga-0.1.12-py3-none-any.whl Python 3 none any Details

Total release size: 35.2 kB

Release files / devlab_fpga-0.1.12.tar.gz

Download URL devlab_fpga-0.1.12.tar.gz
Size 17.6 kB
Tags Source
SHA-256 checksum
How to use checksums
80c02749d28317532afbf3580ccc73fb57249f3742e74ab24bc298dd63cefc97
BLAKE2b-256 checksum
How to use checksums
dc10e1582749605a22c8fb8d1cac4cd731b467c4c6fed171ef610bfa5ec97bb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / devlab_fpga-0.1.12-py3-none-any.whl

Download URL devlab_fpga-0.1.12-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cb2ebe4c907d2dee5b4e0636ee126a54f6c96442c79894b61094a9fd3e3f038
BLAKE2b-256 checksum
How to use checksums
1743be85d1f386e8fc6be4f3bd32a20f7f96165467ea60ce596f9aff656436e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Security for devlab-fpga 0.1.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for devlab_fpga-0.1.12.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page