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.post76.tar.gz (80.4 kB view details)

Uploaded Source

Built Distributions

fasm-0.0.2.post76-pp37-pypy37_pp73-win_amd64.whl (67.1 kB view details)

Uploaded PyPy Windows x86-64

fasm-0.0.2.post76-pp37-pypy37_pp73-macosx_10_15_x86_64.whl (395.6 kB view details)

Uploaded PyPy macOS 10.15+ x86-64

fasm-0.0.2.post76-pp36-pypy36_pp73-win32.whl (67.1 kB view details)

Uploaded PyPy Windows x86

fasm-0.0.2.post76-pp36-pypy36_pp73-macosx_10_15_x86_64.whl (395.6 kB view details)

Uploaded PyPy macOS 10.15+ x86-64

fasm-0.0.2.post76-cp39-cp39-win_amd64.whl (67.1 kB view details)

Uploaded CPython 3.9 Windows x86-64

fasm-0.0.2.post76-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (788.8 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post76-cp39-cp39-macosx_10_15_x86_64.whl (416.6 kB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

fasm-0.0.2.post76-cp38-cp38-win_amd64.whl (67.1 kB view details)

Uploaded CPython 3.8 Windows x86-64

fasm-0.0.2.post76-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (810.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post76-cp38-cp38-macosx_10_15_x86_64.whl (415.0 kB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

fasm-0.0.2.post76-cp37-cp37m-win_amd64.whl (67.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

fasm-0.0.2.post76-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (759.6 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post76-cp37-cp37m-macosx_10_15_x86_64.whl (414.0 kB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

fasm-0.0.2.post76-cp36-cp36m-win_amd64.whl (67.1 kB view details)

Uploaded CPython 3.6m Windows x86-64

fasm-0.0.2.post76-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (761.9 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post76-cp36-cp36m-macosx_10_15_x86_64.whl (413.6 kB view details)

Uploaded CPython 3.6m macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76.tar.gz
  • Upload date:
  • Size: 80.4 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76.tar.gz
Algorithm Hash digest
SHA256 c07c328f4c81b4dc12adb0a5b3bd1b99227e176efc16124354713e4a252edca6
MD5 61144fd33180f5d5258faa6fc15ff2a5
BLAKE2b-256 4dd9579cd9df4aab053be4e1812d44ac35bc14fef1ed122b7680ed0a363efede

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-pp37-pypy37_pp73-win_amd64.whl
  • Upload date:
  • Size: 67.1 kB
  • Tags: PyPy, Windows x86-64
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 225278821e637df9206985448594520c81d0a74709d7eecda533fd114cf28ad0
MD5 20004662ee1a9dc2b5c1b310eef732b9
BLAKE2b-256 6a03c77f7b633436e0058a17aa41a0eda7fcc16c7a001532d7671f1f95d072dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 395.6 kB
  • Tags: PyPy, macOS 10.15+ x86-64
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 bd5aef8f0bef79b59abdbe71d2bc15d24addba9e18f78feef64d06d9b1f0bb43
MD5 bd35ea111a9d9994314a72a1093e9b3d
BLAKE2b-256 a94ff475f4ad36fa3c67f2b6ee7fa93d6b83f3f28d918f11f39dd54c905b8053

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-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.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

File hashes

Hashes for fasm-0.0.2.post76-pp36-pypy36_pp73-win32.whl
Algorithm Hash digest
SHA256 25d181f42ee2cf743a3e0c2767f240d2d79f8b41ef041d7a3474cd5c7ab4239b
MD5 762c2df3ad22a6eef227d1bc6f2625f9
BLAKE2b-256 cfa9c27f97e1bbb4a722a3a6f511718298d05a82b2bccc2c9a67850971cc07fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 395.6 kB
  • Tags: PyPy, macOS 10.15+ x86-64
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3737ea626c8f10801d81b605044e5744fb3ff274d6a3a7eff74b654ee8094f22
MD5 800eef1dd78a28918b1931d43c4a42b7
BLAKE2b-256 a0eb5cd227c308cd2cc6751c6c6d9a99f87494ea51d7df5cea285c984018e05c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-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.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

File hashes

Hashes for fasm-0.0.2.post76-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 3aba9c5c34d7d7a0e569f12d54a9bc91e4bef6d33b7642a386947fe17c442ff4
MD5 b96dd2beb516aac9d2415f85e9dc4b7e
BLAKE2b-256 a0d5a59a3199fd0633c8212b52eb8695044249921802c5616f0247206d381405

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post76-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f4fa31a1cbe9fdecf55bb1b87759833a3abbc78790c15bc74d414546282c7f74
MD5 ef2fefc171c93b501aeaf31e26867b20
BLAKE2b-256 1f2038a6f94f34f4cb3357d19a928a14ef926d5b7985c1fd05943e10ca8fedab

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 416.6 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2ddd140807c2e5aab11f8a11378eec4a4f61d2f11e5b2033d6db393a9e114c7a
MD5 eb00713393c3776984ab15fa36f45f3f
BLAKE2b-256 9562d61ea50032c5037063b806ea9634291fccace905a49e2de8ecd0a7b55604

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-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.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

File hashes

Hashes for fasm-0.0.2.post76-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 41b3e7af7962c4564622922a2864595a0723e0a013ce8ecd33b2e86a5bd44e1d
MD5 5341031219b81b4ac85d0f5c2c721372
BLAKE2b-256 95e3028ae002167835cbdd7649e148d499246c1981692aa8b4ca1d1d5ffa628d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post76-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 35f8d88f2334842e159594113a725fa628ea6f259dae19927358d019af17dfef
MD5 26babd7de802ebf4fd538be8ef98cb90
BLAKE2b-256 38835789158a1d6cd5781f316a8591a053fb9ac06faaf610d02eaa0770c88339

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 415.0 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e932643a259c9c8d860b5a0586b1ce39351516b5de7af83c2f3e003026add14b
MD5 4ba6e245ea6e8d58d961f3458d4a9be5
BLAKE2b-256 a1c6efc8468cf98bac6cb579c68314de3072f7ee725cf90d75f533c788ee4c00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-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.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

File hashes

Hashes for fasm-0.0.2.post76-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 219924d2b7b42be226bb88d71967ef162807b1666887aa5337875a9973cb9a8a
MD5 e58732fb321305a1cb1e564d64410a97
BLAKE2b-256 b11eabf1b96a5af6823fc3d537b39cd3a158458d525a27d9a7d6a2db932dbde1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post76-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 0f58a29717d16440c779e7ab86251c0256b0c6015794a60d8a05edf3f1f3335a
MD5 f51d1403157836d727ca50833ec2986e
BLAKE2b-256 7fb295b900343f6a63ed380c701fea9887cca50aa56708f15c18e216515f3c41

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 414.0 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f9deda6dc4c7e6aea7797001d7b9c8f98edcad4e111eb6d65ed7f55a11772685
MD5 2ef0d497ce798d8606db1adfbf22588f
BLAKE2b-256 9ab6c03a6653709232b0a18068a2476f948a5d494820abbad26f397cbbde45ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-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.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

File hashes

Hashes for fasm-0.0.2.post76-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9e90f42149c9a0f39e88ac6939ca59a0cb9ae0327853cd254218d1b5a2561d9d
MD5 5fc9d0290aa6a656b94bd11a9bbfcf7a
BLAKE2b-256 ac6c13477a5db79ee2c4679bc5732b08e9e3c3cfbeea3aac1ea3cdb977141b0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post76-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 475204abf4dcf79f351f65941a7fa0f1fcc71e4e4cef70ce0a9d6ab7d49eeaa1
MD5 59e454f473c5f07baaa74ee586e8a900
BLAKE2b-256 f1fd80af24e123fcc825c8d7de971a09c041fd7e6e9b6139fc8f6c1aefb6d22c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post76-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 413.6 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using 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

File hashes

Hashes for fasm-0.0.2.post76-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 419fd5b4ede12bcfeca352e8cb54f1086ffa34e45b2a51d7651b4ef68c548388
MD5 c454ef2107ae72ed8ac82922ae941119
BLAKE2b-256 95993a824c5196c5be6460965aafdba7d4f260479468d87cd4b0c2f3208ce484

See more details on using hashes here.

Supported by

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