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.post76

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.post76
File Size Uploaded Provenance Actions
fasm-0.0.2.post76.tar.gz 80.4 kB Without provenance Details for fasm-0.0.2.post76.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fasm 0.0.2.post76
File Actions
fasm-0.0.2.post76-pp37-pypy37_pp73-win_amd64.whl PyPy 3.7 PyPy 3.7 7.3 Windows x86-64 Details for fasm-0.0.2.post76-pp37-pypy37_pp73-win_amd64.whl
fasm-0.0.2.post76-pp37-pypy37_pp73-macosx_10_15_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 macOS 10.15+ x86-64 Details for fasm-0.0.2.post76-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
fasm-0.0.2.post76-pp36-pypy36_pp73-win32.whl PyPy 3.6 PyPy 3.6 7.3 Windows x86-32 Details for fasm-0.0.2.post76-pp36-pypy36_pp73-win32.whl
fasm-0.0.2.post76-pp36-pypy36_pp73-macosx_10_15_x86_64.whl PyPy 3.6 PyPy 3.6 7.3 macOS 10.15+ x86-64 Details for fasm-0.0.2.post76-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
fasm-0.0.2.post76-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for fasm-0.0.2.post76-cp39-cp39-win_amd64.whl
fasm-0.0.2.post76-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details for fasm-0.0.2.post76-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
fasm-0.0.2.post76-cp39-cp39-macosx_10_15_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.15+ x86-64 Details for fasm-0.0.2.post76-cp39-cp39-macosx_10_15_x86_64.whl
fasm-0.0.2.post76-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details for fasm-0.0.2.post76-cp38-cp38-win_amd64.whl
fasm-0.0.2.post76-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details for fasm-0.0.2.post76-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
fasm-0.0.2.post76-cp38-cp38-macosx_10_15_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.15+ x86-64 Details for fasm-0.0.2.post76-cp38-cp38-macosx_10_15_x86_64.whl
fasm-0.0.2.post76-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details for fasm-0.0.2.post76-cp37-cp37m-win_amd64.whl
fasm-0.0.2.post76-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details for fasm-0.0.2.post76-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
fasm-0.0.2.post76-cp37-cp37m-macosx_10_15_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.15+ x86-64 Details for fasm-0.0.2.post76-cp37-cp37m-macosx_10_15_x86_64.whl
fasm-0.0.2.post76-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details for fasm-0.0.2.post76-cp36-cp36m-win_amd64.whl
fasm-0.0.2.post76-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details for fasm-0.0.2.post76-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
fasm-0.0.2.post76-cp36-cp36m-macosx_10_15_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.15+ x86-64 Details for fasm-0.0.2.post76-cp36-cp36m-macosx_10_15_x86_64.whl

Total release size: 6.1 MB

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

Download URL fasm-0.0.2.post76.tar.gz
Size 80.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c07c328f4c81b4dc12adb0a5b3bd1b99227e176efc16124354713e4a252edca6
BLAKE2b-256 checksum
How to use checksums
4dd9579cd9df4aab053be4e1812d44ac35bc14fef1ed122b7680ed0a363efede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / fasm-0.0.2.post76-pp37-pypy37_pp73-win_amd64.whl

Download URL fasm-0.0.2.post76-pp37-pypy37_pp73-win_amd64.whl
Size 67.1 kB
Tags PyPy 3.7 PyPy 3.7 7.3 Windows x86-64
SHA-256 checksum
How to use checksums
225278821e637df9206985448594520c81d0a74709d7eecda533fd114cf28ad0
BLAKE2b-256 checksum
How to use checksums
6a03c77f7b633436e0058a17aa41a0eda7fcc16c7a001532d7671f1f95d072dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.5

Release files / fasm-0.0.2.post76-pp37-pypy37_pp73-macosx_10_15_x86_64.whl

Download URL fasm-0.0.2.post76-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
Size 395.6 kB
Tags PyPy 3.7 PyPy 3.7 7.3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
bd5aef8f0bef79b59abdbe71d2bc15d24addba9e18f78feef64d06d9b1f0bb43
BLAKE2b-256 checksum
How to use checksums
a94ff475f4ad36fa3c67f2b6ee7fa93d6b83f3f28d918f11f39dd54c905b8053
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.5

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

Download URL fasm-0.0.2.post76-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
25d181f42ee2cf743a3e0c2767f240d2d79f8b41ef041d7a3474cd5c7ab4239b
BLAKE2b-256 checksum
How to use checksums
cfa9c27f97e1bbb4a722a3a6f511718298d05a82b2bccc2c9a67850971cc07fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.3

Release files / fasm-0.0.2.post76-pp36-pypy36_pp73-macosx_10_15_x86_64.whl

Download URL fasm-0.0.2.post76-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
Size 395.6 kB
Tags PyPy 3.6 PyPy 3.6 7.3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
3737ea626c8f10801d81b605044e5744fb3ff274d6a3a7eff74b654ee8094f22
BLAKE2b-256 checksum
How to use checksums
a0eb5cd227c308cd2cc6751c6c6d9a99f87494ea51d7df5cea285c984018e05c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.3

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

Download URL fasm-0.0.2.post76-cp39-cp39-win_amd64.whl
Size 67.1 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
3aba9c5c34d7d7a0e569f12d54a9bc91e4bef6d33b7642a386947fe17c442ff4
BLAKE2b-256 checksum
How to use checksums
a0d5a59a3199fd0633c8212b52eb8695044249921802c5616f0247206d381405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / fasm-0.0.2.post76-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL fasm-0.0.2.post76-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 788.8 kB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
f4fa31a1cbe9fdecf55bb1b87759833a3abbc78790c15bc74d414546282c7f74
BLAKE2b-256 checksum
How to use checksums
1f2038a6f94f34f4cb3357d19a928a14ef926d5b7985c1fd05943e10ca8fedab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / fasm-0.0.2.post76-cp39-cp39-macosx_10_15_x86_64.whl

Download URL fasm-0.0.2.post76-cp39-cp39-macosx_10_15_x86_64.whl
Size 416.6 kB
Tags CPython 3.9 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
2ddd140807c2e5aab11f8a11378eec4a4f61d2f11e5b2033d6db393a9e114c7a
BLAKE2b-256 checksum
How to use checksums
9562d61ea50032c5037063b806ea9634291fccace905a49e2de8ecd0a7b55604
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

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

Download URL fasm-0.0.2.post76-cp38-cp38-win_amd64.whl
Size 67.1 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
41b3e7af7962c4564622922a2864595a0723e0a013ce8ecd33b2e86a5bd44e1d
BLAKE2b-256 checksum
How to use checksums
95e3028ae002167835cbdd7649e148d499246c1981692aa8b4ca1d1d5ffa628d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / fasm-0.0.2.post76-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL fasm-0.0.2.post76-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 810.9 kB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
35f8d88f2334842e159594113a725fa628ea6f259dae19927358d019af17dfef
BLAKE2b-256 checksum
How to use checksums
38835789158a1d6cd5781f316a8591a053fb9ac06faaf610d02eaa0770c88339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / fasm-0.0.2.post76-cp38-cp38-macosx_10_15_x86_64.whl

Download URL fasm-0.0.2.post76-cp38-cp38-macosx_10_15_x86_64.whl
Size 415.0 kB
Tags CPython 3.8 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
e932643a259c9c8d860b5a0586b1ce39351516b5de7af83c2f3e003026add14b
BLAKE2b-256 checksum
How to use checksums
a1c6efc8468cf98bac6cb579c68314de3072f7ee725cf90d75f533c788ee4c00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

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

Download URL fasm-0.0.2.post76-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
219924d2b7b42be226bb88d71967ef162807b1666887aa5337875a9973cb9a8a
BLAKE2b-256 checksum
How to use checksums
b11eabf1b96a5af6823fc3d537b39cd3a158458d525a27d9a7d6a2db932dbde1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

Release files / fasm-0.0.2.post76-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL fasm-0.0.2.post76-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 759.6 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
0f58a29717d16440c779e7ab86251c0256b0c6015794a60d8a05edf3f1f3335a
BLAKE2b-256 checksum
How to use checksums
7fb295b900343f6a63ed380c701fea9887cca50aa56708f15c18e216515f3c41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / fasm-0.0.2.post76-cp37-cp37m-macosx_10_15_x86_64.whl

Download URL fasm-0.0.2.post76-cp37-cp37m-macosx_10_15_x86_64.whl
Size 414.0 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
f9deda6dc4c7e6aea7797001d7b9c8f98edcad4e111eb6d65ed7f55a11772685
BLAKE2b-256 checksum
How to use checksums
9ab6c03a6653709232b0a18068a2476f948a5d494820abbad26f397cbbde45ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

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

Download URL fasm-0.0.2.post76-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
9e90f42149c9a0f39e88ac6939ca59a0cb9ae0327853cd254218d1b5a2561d9d
BLAKE2b-256 checksum
How to use checksums
ac6c13477a5db79ee2c4679bc5732b08e9e3c3cfbeea3aac1ea3cdb977141b0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

Release files / fasm-0.0.2.post76-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL fasm-0.0.2.post76-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 761.9 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
475204abf4dcf79f351f65941a7fa0f1fcc71e4e4cef70ce0a9d6ab7d49eeaa1
BLAKE2b-256 checksum
How to use checksums
f1fd80af24e123fcc825c8d7de971a09c041fd7e6e9b6139fc8f6c1aefb6d22c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / fasm-0.0.2.post76-cp36-cp36m-macosx_10_15_x86_64.whl

Download URL fasm-0.0.2.post76-cp36-cp36m-macosx_10_15_x86_64.whl
Size 413.6 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
419fd5b4ede12bcfeca352e8cb54f1086ffa34e45b2a51d7651b4ef68c548388
BLAKE2b-256 checksum
How to use checksums
95993a824c5196c5be6460965aafdba7d4f260479468d87cd4b0c2f3208ce484
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.2.0 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

Security for fasm 0.0.2.post76

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