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
Hashes for fasm-0.0.2.post78-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65573c527be071699c39e4e009110fb613f3e94741fa6d9729c32aa5fdd4a198 |
|
MD5 | 2865abcefa1c4df489397e01fcadfae4 |
|
BLAKE2b-256 | f1c88ce44a75f68b9d7c68539bf9a73e15fd13cebb94db220754dd82374812b3 |
Hashes for fasm-0.0.2.post78-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b02941eb357b98b2ea2f75bb76eea6eebe471af19b1c26436590f27477225479 |
|
MD5 | 3ef92702e5edcd0805d4f16058f2cf71 |
|
BLAKE2b-256 | 22849386c0f6ca95ed318b220947a13a169660a981da4f3dd39997e03c0e14a4 |
Hashes for fasm-0.0.2.post78-pp36-pypy36_pp73-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dd4b333ad346cde975e6ceffe89bc0eed35a4410e83067c7cfca7ef00a45edc |
|
MD5 | 589ea71e8ffedf08677e7c3eebafce1e |
|
BLAKE2b-256 | aacb1896c2c08c44ced21e3164ef4be1e40787bc5c296c3535fc83427c6d7d58 |
Hashes for fasm-0.0.2.post78-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7c951cdf9947b3bcae5221105d4b300ef75f7c8d94da2c6ca2f1d13a2db9e6d |
|
MD5 | f9625b562816b7ae6dcddf42d0616b58 |
|
BLAKE2b-256 | e513b4c6fab12a1c94d71ea6edebecc77eeafff3eb3ef90611f32f65d7e54a64 |
Hashes for fasm-0.0.2.post78-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2087cf914511cd955419ec492a66fd65bd317996375c89d444b395381aed4af0 |
|
MD5 | 089dc057f5860b038d3bc377a3346779 |
|
BLAKE2b-256 | 110648f5d90d709e11b1604adbaa8bb000f1e2112d591a151d790c4b51a39fd7 |
Hashes for fasm-0.0.2.post78-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f6285a3e6977bea414f367fd5ba1a1c4d81dd7388f12703b316a81a59e66d64 |
|
MD5 | e018b5d3edd90182824c6437fdc7bf12 |
|
BLAKE2b-256 | baa9e2e0ba705a677a9fd52d19d48cdc2868355b575c67a41174953c4fba55e7 |
Hashes for fasm-0.0.2.post78-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eace3b1bc03b9d7c5892b4ed01dfb12a211cf247c2187bfbb4e5a5798d3bcd9e |
|
MD5 | ed9a1c14d0fb1e63fa9fc529088550b3 |
|
BLAKE2b-256 | 347176782e38899c402003aa6008b23b2439aa5e37f93e28956bd3921f1203c0 |
Hashes for fasm-0.0.2.post78-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44071a4424d15a4dadc636e42a53102105f82313a8fb135ba03a18e1679a3f62 |
|
MD5 | 2aa168fba839d47ecd662cf28aac0fc0 |
|
BLAKE2b-256 | 25288574acb87466d1e8db5b42584f54d7c9f46693a5f9eb9c0dd247f221a65a |
Hashes for fasm-0.0.2.post78-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3342fc4461bd184180afd91c62410c83be56a7de6195f1a0e502c3edb83ac8f |
|
MD5 | 8cad5ca009c61a85a90567f83092b923 |
|
BLAKE2b-256 | e6baa50501797117dacef33c8ef6d3bf3f260447463710fd728c5fed1898b364 |
Hashes for fasm-0.0.2.post78-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51b32bdb7c1fe7d2d538c84a52310d8032bff6c4cb046179bfc6d2a9d0c5d07c |
|
MD5 | 33104574793f48518996d7609bae3ec3 |
|
BLAKE2b-256 | c461afab0c05bb03b2bf31785f7a3f0460f6eee9f0767f69105a4ec0fb68d838 |
Hashes for fasm-0.0.2.post78-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e14d407f9b12c81e2bbf0676b18b852dec16e5a3c32f98ca478418889e90d17d |
|
MD5 | a3309b58151209408fd3ba2dda460043 |
|
BLAKE2b-256 | 643fc6a263900d186c80458db776a3ab5639a5d9f3c1de2fce3251d687e12800 |
Hashes for fasm-0.0.2.post78-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a15e702655ec4c1f2193dc221274612b8909450486fa8780c0f18c25a7d4494b |
|
MD5 | 410fc43ea032e6a6343223059cf930b4 |
|
BLAKE2b-256 | 7f7d15d0291167e8eec882baffe376aa7613f59d74a25b757e1fa35509936ef0 |
Hashes for fasm-0.0.2.post78-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af368c78c546c0dafea421f655da66907f40663add113ff2c39da11da103b75c |
|
MD5 | 5d2bcff2a31d443e6be76cc92f575dcc |
|
BLAKE2b-256 | 96568185071748cda828d012d9e1909070bcae4b28ad9baa4da1f8295c6169ca |
Hashes for fasm-0.0.2.post78-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c80a04f377932bc2b3e9e043080dc9e07b1e68d896c1c19b93703624019e1d70 |
|
MD5 | 3918315b5db7d9d7e7a41363b1640f40 |
|
BLAKE2b-256 | 0e406de59f1d1a16757a7c8df2ab41230f328833f9a3199c6c892330fd881d9b |
Hashes for fasm-0.0.2.post78-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | faa2004292bc0bd0e3d733e0c4854f8f1a36332b770aaf9fc27a22487bb56488 |
|
MD5 | 95197191808724547f90a34bfa652108 |
|
BLAKE2b-256 | 5bb6fdb0e5aefe59cad435bf7396a9ce68d931be3324ed00984f882f3915f3bc |
Hashes for fasm-0.0.2.post78-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81655fe0f7af8c7d2d9db0c215efbbd247c1be6311105b258066a276a1cb7328 |
|
MD5 | 95108f7e2942f12e69a63562aade0fac |
|
BLAKE2b-256 | bd05185837bd3ac54806788028cd54ca6d95f8e1979a4fad3f157f76b19dc1be |