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.post80.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.post80-pp37-pypy37_pp73-win_amd64.whl (67.1 kB view details)

Uploaded PyPyWindows x86-64

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

Uploaded PyPymacOS 10.15+ x86-64

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

Uploaded PyPyWindows x86

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

Uploaded PyPymacOS 10.15+ x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.9macOS 10.15+ x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.8macOS 10.15+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.7mmacOS 10.15+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

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

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80.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.post80.tar.gz
Algorithm Hash digest
SHA256 df96c84b1d2e84956e95571eb998f911edbf7d66b901193362789fd919918cb5
MD5 8345381781551b99830d270a2a52fa4b
BLAKE2b-256 9cc6b322e667c004b3c0b7b4e44ffbd81a2e28568e08ba1d5f6c4ec5b72f1739

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 e47ffed4e7c16383955255f4fb7658747549f859a25f54f1477ba7e4893686ea
MD5 c64a1cde28b0e1e23ae8a57e59d51761
BLAKE2b-256 d74cf1860587ebc6e2dc5d28d03f3c945a6b1e5566162fb20ab52299ae399b68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2546877a992ab950ecc978091fd94c0de30ac67fd1ad03a1e67bb161a33acff8
MD5 26e3b2c1be283e74a89d0fc24dcc6580
BLAKE2b-256 929a59b487b9ad1203a55f2b3672ee611369c30fee47b14be56ec93757de3c1a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-pp36-pypy36_pp73-win32.whl
Algorithm Hash digest
SHA256 1cb70d42e3a18707d795d6e3546cf6d086f0a2f17ab6982f1531c802c9d0af0c
MD5 0fda7a7d85474a70287b0528b5a34cee
BLAKE2b-256 c0ba9ceb2c0cd328d7a0436c43f9a2189376d39c4d4d456ecb9d9ce11b14ec00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 644ff937cb50829e40289ddae916884d250cff7631a022f93a36ae78c999da1e
MD5 82e1a66fc6be46da856a0806017f9674
BLAKE2b-256 3b85f642d34d65e46efcde8fa71b93642bfcde41d07efee52714f1ed7c97411e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1296dd24858cda0ccbfead20ec1307c1e1357c138e0fea2d204c3e3561f6732b
MD5 4bdd751a17fe35b6907ae7ed57a90c62
BLAKE2b-256 0ba6f4cbbfe1b9a594edad799a689bcc34964afdd74158466347a4a35863077e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post80-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 aa492c4d970120a15e786d421a23f3779963d9abcad2d19192e3c10250c0b515
MD5 ef277fadb2d1e7af9b2934b1da8760ff
BLAKE2b-256 419f56829643ab8369b372b24e32341bb3be1f0af92663f5df41c7fb57f57ffa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8ea71035fec195f244d2b23751f2245b411857ee8dafd5ce53192a85dcdc107c
MD5 1743650f1f889ed18f0c28b04b259730
BLAKE2b-256 4053581c77c447fe253981022750d4641f2b596fa7ac2754a43e89e81f6bb11e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 390566cc941a5fc29beb5bfe16d0f984b273afccfb0d7219106e395ef1620a35
MD5 a2f3240c3fe00b3642b5215dcf2677d3
BLAKE2b-256 9b8156de6dd41917cab48132af69ad5d346dfd6873022edd07c712ba050987c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post80-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b38524181ce3a0d80d0e2f56c5ad11e7e539c7dec718c0577ea8a89c8da4e4dc
MD5 6fe9a1f9167f6540bfebb71a2615ad95
BLAKE2b-256 dabee83d4827c40314893ba90989a5a746f8568df45e0de1fd5bd8968b6780d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 24ff374362580a920ac31b17ec0353cf693acb4781be4859285b151b11e8af4e
MD5 ab05ccabb1afb3e1d3786bd09eacaee3
BLAKE2b-256 681ab9d5166c604a1b042304e2b9ca78c45b20bfc2f0946cd3981169ef28c323

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 954f6d6547136ce88b6bddcc61a56bd27532d8374e84dc3dca63ba998b297b7a
MD5 75dac5a5588539ab783c19c13d89e4b2
BLAKE2b-256 e8d68a97ef9e88c5045731f42c67cccca0c81630235c4ea733ada4ebf301e826

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post80-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 10aaa1c0c15c148f25bdc8b81ab0e0a29e4aebd3125e59e6fb6da4f3ef698ac0
MD5 763b78db94f1718da64f8f4e4701df88
BLAKE2b-256 a0087370cad88ba2e6ed177cdd62e40517a4b32e54b95d436cfabda61f6dc0aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2dd4b1414b3128915633c56bc97350826d427ca25928a0958adce470628f4dc7
MD5 f33c3f1c17f836b029ebed1649e24c6b
BLAKE2b-256 4c4b3582c59295988d83670989eb5d527a5ff07e3cd8cfbf3c49680473c5089a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 74231b22d12804e50d70b9caeee54b12e388aed7a489560214002f7a8d4ef14b
MD5 fd7fc2891d4dfce92414a11d59df7764
BLAKE2b-256 6ef68dcdaf5244ba6e9d2caf00669fed9d3d3180fbfae96b7e1fdb320e1e78c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post80-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 29ebfb26b15b3c0bf99ec877a4600879d642db8cec287ae95799bf8b1c26fd56
MD5 4613e28eb7a1136e002f4afdc1c06282
BLAKE2b-256 4bf3a9484b084763956e574e93b34c6753d568850f3245c741bc02b2dba5fb3b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post80-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.post80-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d46f1e1d8acd24445a2c0cf6276fa70df2829ddf50b6405034f50ae4bcd1e005
MD5 dbf420c8d9a41cc7289336ce3874ddb6
BLAKE2b-256 bf848b17b66cb653c939ff468946245dea8174778589d6453651a0a87d4a8b96

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