Skip to main content

A package manager for FPGA/HDL development: resolve, fetch and assemble IP cores from the LibFPGA registry.

Project description

lfpga

A package manager for FPGA/HDL development. Resolve, fetch and assemble open IP cores from the LibFPGA registry into a source list your simulator or synthesis tool can consume.

The registry is the pypi.org of FPGA IP: curated, ownership-claimed, and toolchain-verified. lfpga is the pip, and its superpower is that every package can carry an earned verification badge (lints clean, synthesizes, testbench passes).

$ lfpga init my-soc
$ lfpga add libfpga
Found libfpga: https://github.com/libfpga/libfpga
  license MIT · verilog · ✓ lint, synth, testbench, formal
$ lfpga add picorv32
$ lfpga install
  libfpga        a4ef4a3fa4ac  1 files  ✓ lint, synth, testbench, formal
  picorv32       e9c4c5b8...   1 files  unverified

Wrote lfpga.lock and build/sources.f (2 source files).

Then point your tool at the generated filelist:

$ verilator --lint-only -f build/sources.f
$ iverilog -o sim.vvp -f build/sources.f
# Vivado: read_verilog -f build/sources.f (via -f)

Why a package manager for FPGA is different

FPGA IP is source, not binaries: there is no ABI and no linking, so lfpga vendors declared HDL files and hands them to the tool of your choice. It does not replace your simulator or synthesizer; it produces the inputs they expect. See the design notes for the full rationale (name collisions, fuzzy versioning, filesets, vendor primitives).

Install

pip install lfpga        # Python 3.11+

Commands

Command What it does
lfpga init [name] Create a libfpga.yaml here
lfpga add <pkg> Add a dependency (name, name@rev, or a git URL)
lfpga install Resolve, pin (lfpga.lock), fetch, and write build/sources.f
lfpga list Show the locked dependencies and their badges
lfpga sources [--format verilator] Emit the assembled source list

The manifest (libfpga.yaml)

One file, like Cargo.toml: it both declares your dependencies and (if you publish) describes this repo as a package for the registry.

name: my-soc
dependencies:
  libfpga: "*"                       # latest default branch
  picorv32: { rev: v1.0.3 }          # pin a tag, branch or commit
  libfpga-myhdl: { modules: [lfpga_mac] }   # sub-select from a repo
  private-mac: { git: "https://github.com/acme/mac.git" }

The lockfile (lfpga.lock)

Commit it. Because HDL builds are source-and-elaborate, reproducibility is lockfile-first: it pins the exact commit and the exact build sources, so a build is identical across machines and over time.

Status

Phase 1: manifest, lockfile, git fetch, filelist emitter, SemVer range resolution over a package's git tags (^1.2, ~1.0, 1.x, exact), and module-collision detection. On the roadmap: sim/synth/formal filesets, Edalize/FuseSoC integration (lfpga sim / lfpga synth), and lfpga publish gated by the verification toolchain.

MIT licensed. Part of LibFPGA.

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

lfpga-0.2.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

lfpga-0.2.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file lfpga-0.2.0.tar.gz.

File metadata

  • Download URL: lfpga-0.2.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for lfpga-0.2.0.tar.gz
Algorithm Hash digest
SHA256 81d29e5029d16613fb6f7051fae8d0fcc018ba455a2b2b47b527d5636e8ab2b8
MD5 3ca7e5d5d9a8e9de2f3d556781528366
BLAKE2b-256 7014bb0c80fa2af6732cede6a5eda0399504630bb3251873975ec18b8503b3b8

See more details on using hashes here.

File details

Details for the file lfpga-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: lfpga-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for lfpga-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb2183782a16f8882f879d8c74846ca40333b46d4bd5691c09c4a441a1dafc2f
MD5 3a18930ce09d18b38983f26478bee472
BLAKE2b-256 2b55488c247b0d966de334819306157bd927ac9861d78ef00c5bf28fa618640f

See more details on using hashes here.

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