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 F4PGA 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 F4PGA 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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

fasm-0.0.2.post100-pp37-pypy37_pp73-win_amd64.whl (73.8 kB view details)

Uploaded PyPy Windows x86-64

fasm-0.0.2.post100-pp37-pypy37_pp73-macosx_11_0_x86_64.whl (399.0 kB view details)

Uploaded PyPy macOS 11.0+ x86-64

fasm-0.0.2.post100-pp36-pypy36_pp73-win32.whl (73.8 kB view details)

Uploaded PyPy Windows x86

fasm-0.0.2.post100-cp39-cp39-win_amd64.whl (73.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

fasm-0.0.2.post100-cp39-cp39-macosx_11_0_x86_64.whl (420.4 kB view details)

Uploaded CPython 3.9 macOS 11.0+ x86-64

fasm-0.0.2.post100-cp38-cp38-win_amd64.whl (73.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

fasm-0.0.2.post100-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (820.3 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post100-cp38-cp38-macosx_11_0_x86_64.whl (419.0 kB view details)

Uploaded CPython 3.8 macOS 11.0+ x86-64

fasm-0.0.2.post100-cp37-cp37m-win_amd64.whl (73.8 kB view details)

Uploaded CPython 3.7m Windows x86-64

fasm-0.0.2.post100-cp37-cp37m-macosx_11_0_x86_64.whl (418.1 kB view details)

Uploaded CPython 3.7m macOS 11.0+ x86-64

fasm-0.0.2.post100-cp36-cp36m-win_amd64.whl (73.8 kB view details)

Uploaded CPython 3.6m Windows x86-64

fasm-0.0.2.post100-cp36-cp36m-macosx_11_0_x86_64.whl (417.3 kB view details)

Uploaded CPython 3.6m macOS 11.0+ x86-64

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post100-pp37-pypy37_pp73-win_amd64.whl
Algorithm Hash digest
SHA256 ae97ccf86628133ae2f6701b2dfd525b4a9251005b4f5c408a98d1296df3f52f
MD5 5cf9bb421ef426538f8032018367d84a
BLAKE2b-256 e12ee9724c6bd019ba5794ece14d9ec7607ff359077eed1a166550e8002fa7f6

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post100-pp37-pypy37_pp73-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post100-pp37-pypy37_pp73-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 48fedde002a0f4dd909223f78f70e77d01180aecb1a97b61d82728ac00932499
MD5 dd156e87d19861b9b46f6c7d991511bf
BLAKE2b-256 ca367538de4a8029c1466cdb5ae07c4e289f4cf65b6011f1ead05bafef89fbc0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post100-pp36-pypy36_pp73-win32.whl
  • Upload date:
  • Size: 73.8 kB
  • Tags: PyPy, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 PyPy/7.3.3

File hashes

Hashes for fasm-0.0.2.post100-pp36-pypy36_pp73-win32.whl
Algorithm Hash digest
SHA256 bea2862225219f1dab75c6d2102b0b12f3a904472285f97ca6e576d47a47de8a
MD5 499836dd82e13426357c4b4dee671459
BLAKE2b-256 76f9bddb55dd29858ab3cc5035acfd697c77cfbe09b42759ecd068eba167d12e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post100-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 83c017fa45dbd98684410a64d2babae2f9cfbcc5649b26adb2f0dead2e365024
MD5 c496599351611950dc45812de2c70b5a
BLAKE2b-256 fd881e34854e09eab7025110128fa025fa675128bb651bbff57067ebcdb9edb7

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post100-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post100-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 f0992a6216eddfd4a25d1332a08f9b8daa36a67ee84dee4c084921ed9355ff29
MD5 8aeb61ccd4750a1820ee2a358c93364b
BLAKE2b-256 cd1e272517e26b3052181bd7132a6805445a3d910bead28dcb0d8280cd761fe7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post100-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 590a54e7d4e4897f02ad2e67edbfb825dd3f629cd07e88aeac37622c1da164d5
MD5 8a9110eda9da1d69799eaac5fc7e9055
BLAKE2b-256 258ae56d03dc90fe310ed52f183da094ee65e68e4cf54563d63468babac8c11d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post100-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c73de7af79b5271bd5344c39f293d3728ee69dcc69aef4115f529af82ca88adb
MD5 189b9ba4083039a5a37632aac060e849
BLAKE2b-256 807890c58394b5f3307a40c4c6737ae6099d4103ddb822f6980269837097d4d5

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post100-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post100-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 2054935da2b2d04587069ce415e3cc6cf425cf2352405e3c81917edc9a49c19d
MD5 c75ef1eb1b925946618df745bbf437fb
BLAKE2b-256 cb7b2001a45749453288f73e90280f722d6ccf96029701165097c9741f79b6ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fasm-0.0.2.post100-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 456b9a30c3d6f94df45cf93e733aae6907223b1493015569b933928b142128b0
MD5 fbc8c07d02f4fdeb6e0cd54fa9970602
BLAKE2b-256 fe7fe567b4d01ec48a894bebbc3f65e51d64583c5c497c6f1b764c3221c81897

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post100-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for fasm-0.0.2.post100-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fa5e32ed5a642e93149d3a521f338d14e7b039d47fb70996f575ddc7b2a7e869
MD5 e0ccddc34ab1cac0f1fade3aaef4cad9
BLAKE2b-256 dd5bb84df15d1842b8ac08e7756989ae4e3a779824a1a9ce5cfef9a201d3800f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post100-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 73.8 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for fasm-0.0.2.post100-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 13bc3c1c474975dc456e595b5e6ab61d2d2d39f5f025a16e09d9b389da4f137e
MD5 773fa7d1a7417012cfff412966a529cc
BLAKE2b-256 fe4c894220036974fbae2d924f1569885274490c5866d3ee681885e11cbccbae

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post100-cp36-cp36m-macosx_11_0_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post100-cp36-cp36m-macosx_11_0_x86_64.whl
  • Upload date:
  • Size: 417.3 kB
  • Tags: CPython 3.6m, macOS 11.0+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.2.0 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15

File hashes

Hashes for fasm-0.0.2.post100-cp36-cp36m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b670a194a13a7934c3d8689cdf0c1d71a105e8996add2dedab6db6a7d15461e4
MD5 b245b1713f7e676d231d1c7bfa68a9d1
BLAKE2b-256 a4d6cbd0a7b6f3adf711b7ec0176b8562bb0ac31cad2d264381a11079e42b383

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