FPGA Assembly (FASM) Parser and Generation library
Project description
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.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file fasm-0.0.2.post70.tar.gz
.
File metadata
- Download URL: fasm-0.0.2.post70.tar.gz
- Upload date:
- Size: 80.5 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ac697accf7965aaf2bcffbfc1043cc217fd44a815ba990f4ee578875afba680 |
|
MD5 | 3370b552d3450d6c85a50465e61c4634 |
|
BLAKE2b-256 | 1a7d3acc10f3e99b37eb7dcda54fc5c027fe8905e918156b5a58314b851897f5 |
File details
Details for the file fasm-0.0.2.post70-pp37-pypy37_pp73-win32.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-pp37-pypy37_pp73-win32.whl
- Upload date:
- Size: 67.1 kB
- Tags: PyPy, Windows x86
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50fbbd856f64016a819f6bb41fb1216bd82c53bebf384d6fe35f3f9d34fe0b1d |
|
MD5 | 8d60ba2f3ef608efd08c791a525d22c2 |
|
BLAKE2b-256 | 93dbb40fdf806efa6df7f434733ab5a5459370a7ea06ec93251a4fd147e13362 |
File details
Details for the file fasm-0.0.2.post70-pp37-pypy37_pp73-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-pp37-pypy37_pp73-macosx_10_7_x86_64.whl
- Upload date:
- Size: 16.7 kB
- Tags: PyPy, macOS 10.7+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79d1cf12e4d729e007a3cc9e737629b0c8329c4a39c961b86dd6e6e46248a78e |
|
MD5 | 16913c4633285508cd07d56e70393d6c |
|
BLAKE2b-256 | 24b014b81cfe9c31129010ae176c7b1ab4a81bdf496a2982ef7ccaef01ddcc33 |
File details
Details for the file fasm-0.0.2.post70-pp36-pypy36_pp73-win32.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-pp36-pypy36_pp73-win32.whl
- Upload date:
- Size: 67.1 kB
- Tags: PyPy, Windows x86
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc42171ad12cbaa8f7f00a8daf5e2b93c3856a59c0d3f859b80c1bef8edffc04 |
|
MD5 | 7320cc3e40996e2863a42ddf5c278ca0 |
|
BLAKE2b-256 | 3292fc9668cbb4da9a4b43363ea2e193fafc7d8c82f2579ed95ea848a797fd0e |
File details
Details for the file fasm-0.0.2.post70-pp36-pypy36_pp73-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-pp36-pypy36_pp73-macosx_10_7_x86_64.whl
- Upload date:
- Size: 16.7 kB
- Tags: PyPy, macOS 10.7+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96998323ad01f15b2011d4c95c88afde2fe467b07676e8b6b5a72014b1b62f54 |
|
MD5 | 5748b4dfa06208f2392e740777f47668 |
|
BLAKE2b-256 | a12beef8192324e19018e4021ca3dae79883ce13845e0939fccde5d349e9c8bf |
File details
Details for the file fasm-0.0.2.post70-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 67.1 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8749998b14f7c1cc91a6abe53b476880348e8ad264bb0f46b53b3841d0b03e9 |
|
MD5 | 167b2c06327d51912a8c20597cb0673a |
|
BLAKE2b-256 | f6ceb6590037f86beb1a13de096b3cda7ebb4dbc6c744a6a538547a6cbbae361 |
File details
Details for the file fasm-0.0.2.post70-cp39-cp39-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp39-cp39-macosx_10_14_x86_64.whl
- Upload date:
- Size: 16.7 kB
- Tags: CPython 3.9, macOS 10.14+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 277194f173233d710a3f5223d9fc427bf3e8e42cd59c25025734f016e836c72d |
|
MD5 | 433bd00b061faaa5670209b91b1ddc60 |
|
BLAKE2b-256 | 43810cee5bf7272e15d2f3c3f97b80af206135313190c5d908e88fdc372afc16 |
File details
Details for the file fasm-0.0.2.post70-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 67.1 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5068d26f62be497c3bf2ef2cb84c9bc6aa06a54ba5921b19edab98139751c242 |
|
MD5 | 9a92e7e2b75312aedd2f118b3ceed387 |
|
BLAKE2b-256 | 1a46fa0de3b6d6057862ebd231165c3070e0be16d50cb44c8ccf068cf4347009 |
File details
Details for the file fasm-0.0.2.post70-cp38-cp38-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp38-cp38-macosx_10_14_x86_64.whl
- Upload date:
- Size: 16.7 kB
- Tags: CPython 3.8, macOS 10.14+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed2dcc883f2f92ca1ddbe23bb1ae75149cb662131c6da6e92d31893436bc637b |
|
MD5 | fff23d729a128ad0450c4cb14b80709e |
|
BLAKE2b-256 | 086711e42bc207d92c9a56e648aec0771add42f375a98b540a0b1aa4a35f1ec5 |
File details
Details for the file fasm-0.0.2.post70-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 67.1 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbc1ae2b90c0c90d3ac5be9ca45633b172ce4164cd97f03ffaa77b345a050936 |
|
MD5 | 1d72fcf979b49d11f173fe9ec76e7e5d |
|
BLAKE2b-256 | 4dbbf0d29d86ca27150f6f0295259c94741bff6d9e3cb5a58dcdb48c1d46b606 |
File details
Details for the file fasm-0.0.2.post70-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 16.7 kB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 460b79f9a5b89e5ab42421c1107b0bdf73c42b1962a1f71b3d893d4fe72b1ca2 |
|
MD5 | c9220d378520259ee9e8943c34b24feb |
|
BLAKE2b-256 | 7f04b89928128b08ea62700dc193857d4a3fa9b27e037bd129146a21fac503d7 |
File details
Details for the file fasm-0.0.2.post70-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 67.1 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632dbeec492dd2798ee111cbf3cd06be887cf12d98e6b5fca34e9630d8527648 |
|
MD5 | ddd28dd2a095f059d863f5e0d4cbddf8 |
|
BLAKE2b-256 | 1ba271ea907145c8ab09cc80d8467bcad8e6740bf1d7b659c4419fd3f117e8ca |
File details
Details for the file fasm-0.0.2.post70-cp36-cp36m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: fasm-0.0.2.post70-cp36-cp36m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 16.7 kB
- Tags: CPython 3.6m, macOS 10.14+ x86-64
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1e0e11fa600d28b88fb8a04ea177e0ef775011d449c752894130f9672619e65 |
|
MD5 | 9cbef150b97379caad3cd814350a63ca |
|
BLAKE2b-256 | 3fb1f833c5f0d90278851ab58e6ba482f5160c65829dc630db341e43f3950201 |