Skip to main content

FPGA development helper for installing OSS CAD Suite and running build/flash flows.

Project description

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.

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

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

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 runs Yosys with the GHDL plugin before synthesis. OSS CAD Suite is expected to provide that plugin.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

devlab_fpga-0.1.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

devlab_fpga-0.1.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file devlab_fpga-0.1.2.tar.gz.

File metadata

  • Download URL: devlab_fpga-0.1.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for devlab_fpga-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a931ab56efb94bb0cf13b48d535c19674ef6ed8621da090e6873a5c44b6b94ca
MD5 1289b353e3075e071c2a1ac0a4e983ab
BLAKE2b-256 4319cba61eaf9f8fa86eff6610b66f06b75236e6c9929a51aac7555cc2f1cd3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for devlab_fpga-0.1.2.tar.gz:

Publisher: workflow.yml on UNIT-Electronics-Labs/unit_devlab_lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file devlab_fpga-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: devlab_fpga-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for devlab_fpga-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8316d47e06c6aff1c249c7b852b53e595a8989a28f88e596d459b387205961ac
MD5 301f0daaddc79f0dc32bf60b49315853
BLAKE2b-256 08a3b9a00ddb8103eb980ff5cbc19c956e38301fe875cf98bb54fe0c8bddd94f

See more details on using hashes here.

Provenance

The following attestation bundles were made for devlab_fpga-0.1.2-py3-none-any.whl:

Publisher: workflow.yml on UNIT-Electronics-Labs/unit_devlab_lib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page