Skip to main content

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.

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.

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

fasm-0.0.2.post84.tar.gz (80.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

fasm-0.0.2.post84-pp37-pypy37_pp73-win_amd64.whl (67.9 kB view details)

Uploaded PyPyWindows x86-64

fasm-0.0.2.post84-pp37-pypy37_pp73-macosx_10_15_x86_64.whl (394.4 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

fasm-0.0.2.post84-pp36-pypy36_pp73-win32.whl (67.9 kB view details)

Uploaded PyPyWindows x86

fasm-0.0.2.post84-pp36-pypy36_pp73-macosx_10_15_x86_64.whl (394.4 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

fasm-0.0.2.post84-cp39-cp39-win_amd64.whl (68.0 kB view details)

Uploaded CPython 3.9Windows x86-64

fasm-0.0.2.post84-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (790.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post84-cp39-cp39-macosx_10_15_x86_64.whl (73.4 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

fasm-0.0.2.post84-cp38-cp38-win_amd64.whl (67.9 kB view details)

Uploaded CPython 3.8Windows x86-64

fasm-0.0.2.post84-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (812.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post84-cp38-cp38-macosx_10_15_x86_64.whl (413.9 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

fasm-0.0.2.post84-cp37-cp37m-win_amd64.whl (67.9 kB view details)

Uploaded CPython 3.7mWindows x86-64

fasm-0.0.2.post84-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (761.9 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

fasm-0.0.2.post84-cp37-cp37m-macosx_10_15_x86_64.whl (412.9 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

fasm-0.0.2.post84-cp36-cp36m-win_amd64.whl (67.9 kB view details)

Uploaded CPython 3.6mWindows x86-64

fasm-0.0.2.post84-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (764.5 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

fasm-0.0.2.post84-cp36-cp36m-macosx_10_15_x86_64.whl (412.5 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

Details for the file fasm-0.0.2.post84.tar.gz.

File metadata

  • Download URL: fasm-0.0.2.post84.tar.gz
  • Upload date:
  • Size: 80.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for fasm-0.0.2.post84.tar.gz
Algorithm Hash digest
SHA256 b123c7beebda73b76463e93c0e3285dbffd3167a3425d8d12adb3f3c5ffedbf5
MD5 29a550db9e98eb2012f50121da9a92ef
BLAKE2b-256 173bc9902dbd8e298b56871a503af1d486977ef4a330ddeeaea2a2187b49c1f0

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-pp37-pypy37_pp73-win_amd64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-pp37-pypy37_pp73-win_amd64.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: PyPy, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.7

File hashes

Hashes for fasm-0.0.2.post84-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 7f28b8a2a1b1a014c79647ae14ff61b10c9d0050d71d9abd6884087eb39727bf
MD5 5b17dbc7c9b122461c8f467f6457ea26
BLAKE2b-256 b88fd4db2a3200cb144dac7e32fd220664715a0b1109cd4e7966fa85c21f157c

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-pp37-pypy37_pp73-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 394.4 kB
  • Tags: PyPy, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.7

File hashes

Hashes for fasm-0.0.2.post84-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6de9f7ee23fd4b505d53f5608cdd27db5aa3cbe56e9952eaaa738b09d324f2e6
MD5 35d57af876e0c09ab3d22c254026bd5b
BLAKE2b-256 83b9257c691aec424894b702f8cc45db1304670759ea8de7bef1f9170330f3ec

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-pp36-pypy36_pp73-win32.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-pp36-pypy36_pp73-win32.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: PyPy, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.3

File hashes

Hashes for fasm-0.0.2.post84-pp36-pypy36_pp73-win32.whl
Algorithm Hash digest
SHA256 3bad47ce1d6741f17bd1189a182011c53844876d8939f4b43806ac8400992199
MD5 cf396571f8b4d9f14141728a8b43a059
BLAKE2b-256 8715e77e0d465167172ca8da086808435d8d90ebd5b967ba106c9feddf6add1b

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-pp36-pypy36_pp73-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 394.4 kB
  • Tags: PyPy, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 PyPy/7.3.3

File hashes

Hashes for fasm-0.0.2.post84-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2fda6bd42c1a6a09be5290f132e09a3cb7c920b65fa0bd959921cf31b83a6402
MD5 f684576045e8974fd970bf98be9302db
BLAKE2b-256 b7c8b84dfb430b33f44c1fcfc5887f167a4b71093e0ae2d671b3681b4eeb51fd

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 68.0 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for fasm-0.0.2.post84-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 97f43cd31eff29bad0e18a30d110e1343d797f7ebec083b3af418f4dac7bbd6b
MD5 2a038e9cbc632db4a9a7055731660c90
BLAKE2b-256 be49224bcaf25e3082f38ce2520f4b0477cb97a644cac7f9cd0cd078874e59e4

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post84-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 fb18125baa311c8831667abd3befc27947ff9a2a049c3843e101d0be9e4bdf74
MD5 0a2603976cb8975386750cdd903df2dd
BLAKE2b-256 3a8e0d241b7f22b0252141063dc15ba69b3f6be836c2f24ae009408a862da9ce

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 73.4 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for fasm-0.0.2.post84-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0c070549df404d217acceb9db0495f53ab1179f18d6ff50232d81333ec0a9a63
MD5 cd60c44b1b6b1eeb6a4b54a693d5beec
BLAKE2b-256 5fea3a4eb52109056440f10dafc9450daf6b9080c5fb7dfff289b88675716daf

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for fasm-0.0.2.post84-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 a41faffe95f578da7154016518685f7893c639a031e23f4fe5764c3fb3b38dbc
MD5 e7d96b149a27c28acbf11a643d55e0ee
BLAKE2b-256 ff5203120c87c60c8703a17685e3c0c917e30cc0013fb73a9b8e9090556ded9e

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post84-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 35c2512ea3d71957203a2eaf12ef2ec9f4f855692f24de961d597cdf3e75072f
MD5 486c0f87a86c2ba433db08323ab63618
BLAKE2b-256 4729f4ce9454e6b1a0f88d4f97c37d2d7fc471d4004000c02802187053ce425d

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 413.9 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for fasm-0.0.2.post84-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3c40ee3d373d24b6dd1ae7e0e831a5cba55ee70e8d0c5d16daff7e3f73cc8596
MD5 a2b2fa656294865a9cb96dcde4edd420
BLAKE2b-256 83f9410fc270eaea98af32d02ed2abccbf8b09cac6d88c9ad00878b5144ca81b

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.9

File hashes

Hashes for fasm-0.0.2.post84-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 10e5c6db8a1d8ff9e39c6d1253e8c2df650a9797d068cf3704c053eb4e66bc17
MD5 e035de7b18b99ca4a420afe9200f9e6f
BLAKE2b-256 713f41aa04e352e96d8584e2a621c9cf61e82ece92ba6b1d699263b96bf4c51b

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post84-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 85581ac13755c253e0aa3eb2b3073d1f9e9c06941edbe3c108153e25b1cccd7e
MD5 ea1554dfc9eeb64af7ba839c619ca535
BLAKE2b-256 ed3afce4fb05c8914000629c2e346a5521390524aaf6007fa50657e794536928

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 412.9 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for fasm-0.0.2.post84-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4546ac817af3cbcdc9612a2ddad5eeaae31e0165025aae9c37923acced4112d8
MD5 ae02e704dd855ddc7629bff1ce093835
BLAKE2b-256 913929a0a46d2997317bab500a03edfd662fc1cc5c75cc07e5d8e0e0ba40d92d

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.8

File hashes

Hashes for fasm-0.0.2.post84-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 8d10abad8ec493e1cbc6b158d13aec27b1747f9f05177a107aff14dd64df671d
MD5 988abbfa1449002e28b3e725c1280540
BLAKE2b-256 fba624ff4522b1196524cd06caf6bf09c6a6a2308a1cb7f2fa2959756c092582

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post84-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9c4a4cbb04081aa1a6e0e9fc95dded50ca38f0cbd66355ecb90d45db4538befe
MD5 162cc6ce4974af44fcece72c5b753201
BLAKE2b-256 19abc9cdecfb91e76a9585a19a57938663b92914ed51d3c6d23298a99a0fcf66

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post84-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post84-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 412.5 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.2.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.6.15

File hashes

Hashes for fasm-0.0.2.post84-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7e08f4783250f91cf27a94bcce04532b9e2b671408cd7a35244dcd7f9c0fd8fa
MD5 972f5179197db01faf509ba076dfcb91
BLAKE2b-256 5f853a2badcbc6114f108ff7eb969dfbc6cf5a42665911122acf1f96eaa1a55d

See more details on using hashes here.

Supported by

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