Skip to main content

FPGA Assembly (FASM) Parser and Generation library

This repository documents the FASM file format and provides parsing libraries and simple tooling for working with FASM files.

It provides both a pure Python parser based on textx and a significantly faster C parser based on ANTLR. The library will try and use the ANTLR parser first and fall back to the textx parser if the compiled module is not found.

Which parsers are supported by your currently install can be found via python3 -c "import fasm.parser as p; print(p.available). The currently in use parser can be found via fasm.parser.implementation.

It is highly recommended to use the ANTLR parser as it is about 15 times faster.

functions for parsing and generating FASM files.

Build Instructions

CMake is required, and ANTLR has a few dependencies:

sudo apt install cmake default-jre-headless uuid-dev libantlr4-runtime-dev

Pull dependencies in third_party:

git submodule update --init

Build:

make build

Test with:

python setup.py test

The ANTLR runtime can either be linked statically or as a shared library. Use the --antlr-runtime=[static|shared] flag to select between the two modes e.g.:

python setup.py install --antlr-runtime=shared

Or, using pip:

pip install . --install-option="--antlr-runtime=shared" --no-use-pep517

The runtime will be built and statically linked by default. This flag is available in the build_ext, build, develop, and install commands.

The --no-use-pep517 flag is needed because there is currently no way to pass flags with PEP517.
Relevant issue: https://github.com/pypa/pip/issues/5771

FPGA Assembly (FASM)

FPGA Assembly is a file format designed by the SymbiFlow Project developers to provide a plain text file format for configuring the internals of an FPGA.

It is designed to allow FPGA place and route to not care about the actual bitstream format used on an FPGA.

FASM Ecosystem Diagram

Properties

  • Removing a line from a FASM file leaves you with a valid FASM file.
  • Allow annotation with human readable comments.
  • Allow annotation with "computer readable" comments.
  • Has syntactic sugar for expressing memory / lut init bits / other large arrays of data.
  • Has a canonical form.
  • Does not require any specific bitstream format.

Supported By

FASM is currently supported by the SymbiFlow Verilog to Routing fork, but we hope to get it merged upstream sometime soon.

It is also used by Project X-Ray.

Metadata

Release files for fasm 0.0.2.post70

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

Source distribution (sdist)

Source distribution for fasm 0.0.2.post70
File Size Uploaded Provenance Actions
fasm-0.0.2.post70.tar.gz 80.5 kB Without provenance Details for fasm-0.0.2.post70.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fasm 0.0.2.post70
File Actions
fasm-0.0.2.post70-pp37-pypy37_pp73-win32.whl PyPy 3.7 PyPy 3.7 7.3 Windows x86-32 Details for fasm-0.0.2.post70-pp37-pypy37_pp73-win32.whl
fasm-0.0.2.post70-pp37-pypy37_pp73-macosx_10_7_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 macOS 10.7+ x86-64 Details for fasm-0.0.2.post70-pp37-pypy37_pp73-macosx_10_7_x86_64.whl
fasm-0.0.2.post70-pp36-pypy36_pp73-win32.whl PyPy 3.6 PyPy 3.6 7.3 Windows x86-32 Details for fasm-0.0.2.post70-pp36-pypy36_pp73-win32.whl
fasm-0.0.2.post70-pp36-pypy36_pp73-macosx_10_7_x86_64.whl PyPy 3.6 PyPy 3.6 7.3 macOS 10.7+ x86-64 Details for fasm-0.0.2.post70-pp36-pypy36_pp73-macosx_10_7_x86_64.whl
fasm-0.0.2.post70-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for fasm-0.0.2.post70-cp39-cp39-win_amd64.whl
fasm-0.0.2.post70-cp39-cp39-macosx_10_14_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.14+ x86-64 Details for fasm-0.0.2.post70-cp39-cp39-macosx_10_14_x86_64.whl
fasm-0.0.2.post70-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for fasm-0.0.2.post70-cp38-cp38-win_amd64.whl
fasm-0.0.2.post70-cp38-cp38-macosx_10_14_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.14+ x86-64 Details for fasm-0.0.2.post70-cp38-cp38-macosx_10_14_x86_64.whl
fasm-0.0.2.post70-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for fasm-0.0.2.post70-cp37-cp37m-win_amd64.whl
fasm-0.0.2.post70-cp37-cp37m-macosx_10_14_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 Details for fasm-0.0.2.post70-cp37-cp37m-macosx_10_14_x86_64.whl
fasm-0.0.2.post70-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details for fasm-0.0.2.post70-cp36-cp36m-win_amd64.whl
fasm-0.0.2.post70-cp36-cp36m-macosx_10_14_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 Details for fasm-0.0.2.post70-cp36-cp36m-macosx_10_14_x86_64.whl

Total release size: 583.4 kB

Release files / fasm-0.0.2.post70.tar.gz

Download URL fasm-0.0.2.post70.tar.gz
Size 80.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5ac697accf7965aaf2bcffbfc1043cc217fd44a815ba990f4ee578875afba680
BLAKE2b-256 checksum
How to use checksums
1a7d3acc10f3e99b37eb7dcda54fc5c027fe8905e918156b5a58314b851897f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / fasm-0.0.2.post70-pp37-pypy37_pp73-win32.whl

Download URL fasm-0.0.2.post70-pp37-pypy37_pp73-win32.whl
Size 67.1 kB
Tags PyPy 3.7 PyPy 3.7 7.3 Windows x86-32
SHA-256 checksum
How to use checksums
50fbbd856f64016a819f6bb41fb1216bd82c53bebf384d6fe35f3f9d34fe0b1d
BLAKE2b-256 checksum
How to use checksums
93dbb40fdf806efa6df7f434733ab5a5459370a7ea06ec93251a4fd147e13362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 PyPy/7.3.3beta

Release files / fasm-0.0.2.post70-pp37-pypy37_pp73-macosx_10_7_x86_64.whl

Download URL fasm-0.0.2.post70-pp37-pypy37_pp73-macosx_10_7_x86_64.whl
Size 16.7 kB
Tags PyPy 3.7 PyPy 3.7 7.3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
79d1cf12e4d729e007a3cc9e737629b0c8329c4a39c961b86dd6e6e46248a78e
BLAKE2b-256 checksum
How to use checksums
24b014b81cfe9c31129010ae176c7b1ab4a81bdf496a2982ef7ccaef01ddcc33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 PyPy/7.3.4

Release files / fasm-0.0.2.post70-pp36-pypy36_pp73-win32.whl

Download URL fasm-0.0.2.post70-pp36-pypy36_pp73-win32.whl
Size 67.1 kB
Tags PyPy 3.6 PyPy 3.6 7.3 Windows x86-32
SHA-256 checksum
How to use checksums
bc42171ad12cbaa8f7f00a8daf5e2b93c3856a59c0d3f859b80c1bef8edffc04
BLAKE2b-256 checksum
How to use checksums
3292fc9668cbb4da9a4b43363ea2e193fafc7d8c82f2579ed95ea848a797fd0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 PyPy/7.3.3

Release files / fasm-0.0.2.post70-pp36-pypy36_pp73-macosx_10_7_x86_64.whl

Download URL fasm-0.0.2.post70-pp36-pypy36_pp73-macosx_10_7_x86_64.whl
Size 16.7 kB
Tags PyPy 3.6 PyPy 3.6 7.3 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
96998323ad01f15b2011d4c95c88afde2fe467b07676e8b6b5a72014b1b62f54
BLAKE2b-256 checksum
How to use checksums
a12beef8192324e19018e4021ca3dae79883ce13845e0939fccde5d349e9c8bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 PyPy/7.3.3

Release files / fasm-0.0.2.post70-cp39-cp39-win_amd64.whl

Download URL fasm-0.0.2.post70-cp39-cp39-win_amd64.whl
Size 67.1 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
e8749998b14f7c1cc91a6abe53b476880348e8ad264bb0f46b53b3841d0b03e9
BLAKE2b-256 checksum
How to use checksums
f6ceb6590037f86beb1a13de096b3cda7ebb4dbc6c744a6a538547a6cbbae361
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / fasm-0.0.2.post70-cp39-cp39-macosx_10_14_x86_64.whl

Download URL fasm-0.0.2.post70-cp39-cp39-macosx_10_14_x86_64.whl
Size 16.7 kB
Tags CPython 3.9 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
277194f173233d710a3f5223d9fc427bf3e8e42cd59c25025734f016e836c72d
BLAKE2b-256 checksum
How to use checksums
43810cee5bf7272e15d2f3c3f97b80af206135313190c5d908e88fdc372afc16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / fasm-0.0.2.post70-cp38-cp38-win_amd64.whl

Download URL fasm-0.0.2.post70-cp38-cp38-win_amd64.whl
Size 67.1 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
5068d26f62be497c3bf2ef2cb84c9bc6aa06a54ba5921b19edab98139751c242
BLAKE2b-256 checksum
How to use checksums
1a46fa0de3b6d6057862ebd231165c3070e0be16d50cb44c8ccf068cf4347009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

Release files / fasm-0.0.2.post70-cp38-cp38-macosx_10_14_x86_64.whl

Download URL fasm-0.0.2.post70-cp38-cp38-macosx_10_14_x86_64.whl
Size 16.7 kB
Tags CPython 3.8 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
ed2dcc883f2f92ca1ddbe23bb1ae75149cb662131c6da6e92d31893436bc637b
BLAKE2b-256 checksum
How to use checksums
086711e42bc207d92c9a56e648aec0771add42f375a98b540a0b1aa4a35f1ec5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.9

Release files / fasm-0.0.2.post70-cp37-cp37m-win_amd64.whl

Download URL fasm-0.0.2.post70-cp37-cp37m-win_amd64.whl
Size 67.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
dbc1ae2b90c0c90d3ac5be9ca45633b172ce4164cd97f03ffaa77b345a050936
BLAKE2b-256 checksum
How to use checksums
4dbbf0d29d86ca27150f6f0295259c94741bff6d9e3cb5a58dcdb48c1d46b606
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.9

Release files / fasm-0.0.2.post70-cp37-cp37m-macosx_10_14_x86_64.whl

Download URL fasm-0.0.2.post70-cp37-cp37m-macosx_10_14_x86_64.whl
Size 16.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
460b79f9a5b89e5ab42421c1107b0bdf73c42b1962a1f71b3d893d4fe72b1ca2
BLAKE2b-256 checksum
How to use checksums
7f04b89928128b08ea62700dc193857d4a3fa9b27e037bd129146a21fac503d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10

Release files / fasm-0.0.2.post70-cp36-cp36m-win_amd64.whl

Download URL fasm-0.0.2.post70-cp36-cp36m-win_amd64.whl
Size 67.1 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
632dbeec492dd2798ee111cbf3cd06be887cf12d98e6b5fca34e9630d8527648
BLAKE2b-256 checksum
How to use checksums
1ba271ea907145c8ab09cc80d8467bcad8e6740bf1d7b659c4419fd3f117e8ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.8

Release files / fasm-0.0.2.post70-cp36-cp36m-macosx_10_14_x86_64.whl

Download URL fasm-0.0.2.post70-cp36-cp36m-macosx_10_14_x86_64.whl
Size 16.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
c1e0e11fa600d28b88fb8a04ea177e0ef775011d449c752894130f9672619e65
BLAKE2b-256 checksum
How to use checksums
3fb1f833c5f0d90278851ab58e6ba482f5160c65829dc630db341e43f3950201
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

Security for fasm 0.0.2.post70

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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