Skip to main content

Official WebFPGA Command-line Utility

Project description

webfpga/cli

PyPI version

Python migration is complete! This repository is feature-complete with the web IDE.

Welcome to the official command-line utility for WebFPGA compatible devices. If you are unfamiliar with WebFPGA, please checkout the homepage (webfpga.io) or our Kickstarter (webfpga.io/kickstarter).

This utility provides access to the official backend for Verilog synthesis. It also provides flashing capability for the official WebFPGA family of boards (store.webfpga.io). You are free to use bitstreams sourced from our tools, Lattice's iCECube, or IceStorm. They should all work.

Installation

$ pip install webfpga
$ webfpga --help
Usage: webfpga [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  flash  Flash the first connected WebFPGA device
  synth  Synthesize one or more input Verilog files and save the bitstream

Example

The utility is fairly simply to use once installed. Simply synthesize one or more Verilog source files to produce a bitstream. Then, feed that bitstream into webfpga flash to load the binary onto your local device. E.g. webfpga synth input.v -o bitstream.bin && webfpga flash bitstream.bin. By default, webfpga synth will save the bitstream as bitstream.bin, but you can use -o to specify a different filename.

$ curl -O https://beta.webfpga.io/static/WF_blinky.v
$ webfpga synth WF_blinky.v
WebFPGA CLI v0.3

Connecting to remote synthesis engine...
200 {"status":"ok"} 

Attempting synthesis (saving to bitstream.bin)...
  - WF_blinky.v

... verbose output omitted ...

purging build directory...
synthesis complete!

$ webfpga flash bitstream.bin
ryan@mu2 ~/cli $ ./webfpga flash bitstream.bin 
WebFPGA CLI v0.3

Opening USB device...

Preparing device for flashing...
AT: Hi
API: C_WEBUSB+
APR: 000921
Found programmer.
Checking for FPGA module and its flash configuration...
APWE: wren
AMQ: SA016WHEe

Erasing device...
AMBE: DONE
AMQ: SA016WHEE

Flashing device...
AMW: OK
AMWD: 0  3e  0  3e
RESPONSE => 62 

IceStorm Example.

If you would like to produce logic with Yosys, IceStorm, and friends — then please check out webfpga_icestorm_examples. Once you have produced a bitstream, simply run webfpga flash bitstream.bin.

What is a compressed bitstream?

FPGA bitstreams are typically full of contiguous zeroes. Therefore, compression on the host and decompression in the device's firmware makes perfect sense. Flashing speeds are about 20x faster when using compressed bitstreams.

Right now, the device's firmware expects compressed bitstreams. WebFPGA doesn't support uncompressed, raw bitstreams (such as ones outputted from iCECube/IceStorm tools.) These compressed bitstreams are chunked into sub-64-byte chunks that fit into standard USB control transfer frames.

But don't fret! Our flashing utility automatically detects uncompressed bitstreams and transparently compresses them before transferring them. Bitstreams that originate from the official WebFPGA backend arrive pre-compressed.

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

webfpga-0.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distributions

webfpga-0.3-py3.7.egg (16.6 kB view details)

Uploaded Source

webfpga-0.3-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file webfpga-0.3.tar.gz.

File metadata

  • Download URL: webfpga-0.3.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for webfpga-0.3.tar.gz
Algorithm Hash digest
SHA256 54ac53e2ec0a54a543b7982c93a60c2afafc722c7b5cbe607979d684f8b00ee2
MD5 c8526e029aafb7891bdf1c44e1dba4f7
BLAKE2b-256 c11e56cae79b87d1f15d35ae7e50dd2d95c0918eaf7f175fdfd26ebc13346380

See more details on using hashes here.

File details

Details for the file webfpga-0.3-py3.7.egg.

File metadata

  • Download URL: webfpga-0.3-py3.7.egg
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for webfpga-0.3-py3.7.egg
Algorithm Hash digest
SHA256 7477805e4ab478bba87bee162708871498715ff26c6e124161279adab627bdc8
MD5 0b3d00cede1f3b6e8260361c7f904223
BLAKE2b-256 facf4f595557cecbae9f7d0eb6c0726e9d384fbcdfdc9be000da20e0fc182997

See more details on using hashes here.

File details

Details for the file webfpga-0.3-py3-none-any.whl.

File metadata

  • Download URL: webfpga-0.3-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.4

File hashes

Hashes for webfpga-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1b9c1be9fe2cebcd7acadca232f3cc9da683f8e421cd3f17de8e8083c5ff37d7
MD5 40ac7f059fd54642f6e1238bf15a7cce
BLAKE2b-256 c39f4351ae2f612cd5f8211ea1dc91e92b9e2262b17a49e51b8c774a3923f2be

See more details on using hashes here.

Supported by

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