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.post67.tar.gz (80.9 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.post67-pp37-pypy37_pp73-win32.whl (66.9 kB view details)

Uploaded PyPyWindows x86

fasm-0.0.2.post67-pp37-pypy37_pp73-macosx_10_15_x86_64.whl (403.3 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

fasm-0.0.2.post67-pp36-pypy36_pp73-win32.whl (66.9 kB view details)

Uploaded PyPyWindows x86

fasm-0.0.2.post67-pp36-pypy36_pp73-macosx_10_15_x86_64.whl (403.3 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

fasm-0.0.2.post67-cp39-cp39-win_amd64.whl (66.9 kB view details)

Uploaded CPython 3.9Windows x86-64

fasm-0.0.2.post67-cp39-cp39-manylinux2010_x86_64.whl (792.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post67-cp39-cp39-macosx_10_15_x86_64.whl (424.3 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

fasm-0.0.2.post67-cp38-cp38-win_amd64.whl (66.9 kB view details)

Uploaded CPython 3.8Windows x86-64

fasm-0.0.2.post67-cp38-cp38-manylinux2010_x86_64.whl (815.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post67-cp38-cp38-macosx_10_15_x86_64.whl (422.8 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

fasm-0.0.2.post67-cp37-cp37m-win_amd64.whl (66.9 kB view details)

Uploaded CPython 3.7mWindows x86-64

fasm-0.0.2.post67-cp37-cp37m-manylinux2010_x86_64.whl (763.7 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

fasm-0.0.2.post67-cp37-cp37m-macosx_10_15_x86_64.whl (421.8 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

fasm-0.0.2.post67-cp36-cp36m-win_amd64.whl (66.9 kB view details)

Uploaded CPython 3.6mWindows x86-64

fasm-0.0.2.post67-cp36-cp36m-manylinux2010_x86_64.whl (766.1 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

fasm-0.0.2.post67-cp36-cp36m-macosx_10_15_x86_64.whl (421.4 kB view details)

Uploaded CPython 3.6mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67.tar.gz
  • Upload date:
  • Size: 80.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for fasm-0.0.2.post67.tar.gz
Algorithm Hash digest
SHA256 5e8258d45818122b403b27327c79047f9cfa2e092db56265a1351e3738df10d4
MD5 c9fd7d796fc7c723ef468b0578352549
BLAKE2b-256 8f5f9492baf44a769e99252da8615cb0ae72fa6159186a56ebc28629cd1b37b9

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post67-pp37-pypy37_pp73-win32.whl.

File metadata

  • Download URL: fasm-0.0.2.post67-pp37-pypy37_pp73-win32.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: PyPy, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.57.0 PyPy/7.3.3beta

File hashes

Hashes for fasm-0.0.2.post67-pp37-pypy37_pp73-win32.whl
Algorithm Hash digest
SHA256 baf8d16961885980ddbf724e884273ca6c05d1032610988ce43f622a8dcf6421
MD5 3489417df6fc73f72022ab59266083c4
BLAKE2b-256 4226e0c4cb040869078e5dbf630ba59cadbea5447e86b1181f304e67239478ef

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 403.3 kB
  • Tags: PyPy, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.57.0 PyPy/7.3.3beta

File hashes

Hashes for fasm-0.0.2.post67-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 38e1814d5ac2785d0e200eafeb93dd43d45e44e61d9cf4401b21f246a68975f4
MD5 d112bef33e8660b0babdb8553cb344d3
BLAKE2b-256 6cbf48cce0eda81a96c89599c05e8766da7f1fc836f07b1fae8f57049b54d789

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-pp36-pypy36_pp73-win32.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: PyPy, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 PyPy/7.3.3

File hashes

Hashes for fasm-0.0.2.post67-pp36-pypy36_pp73-win32.whl
Algorithm Hash digest
SHA256 efb0ccf9b38fd138eebac32f516ef328375db3cf80b4a5b16de6387266d4d30a
MD5 675a58687e28aafc9de9151b88d078e0
BLAKE2b-256 ace0e1bc5801a734737d0abb53772001a498b7005aa4131042d4e5faf3d0bbb8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 403.3 kB
  • Tags: PyPy, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 PyPy/7.3.3

File hashes

Hashes for fasm-0.0.2.post67-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4c38437e91e72b4456dec3ed58a3ae4e14c7d189f9400b5ccaac56de0c08e968
MD5 b0d097c11b0c19d59adc8b0f9958d00f
BLAKE2b-256 2256a000b1a9bdc3e2a303fdb4205db79c2b05008faca2b4988a30ee9a021639

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for fasm-0.0.2.post67-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 a9c28ea821c2f81d11ec79f16027a80b827795b7ca033898afcba10e3045862a
MD5 2067864238fa2af3194b8c742737fe5d
BLAKE2b-256 18ca4b02c479107d14a5482f0c04dcf5f9d3249db1ec88c3cc9faafd0b551144

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post67-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post67-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 792.6 kB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for fasm-0.0.2.post67-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2b8d1f395fda87f9e2e3e67d5e8cf4ac6c182df3c2b2b45c64a19ac6b55c8856
MD5 2e12c2f013954e6380e0650b02844d8b
BLAKE2b-256 5af0db057e2b9d0edd52eae3915b3c8771d08401c44df61949d4b13fd6ab9534

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 424.3 kB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for fasm-0.0.2.post67-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 00458a921acddd46d89542f521c146667d00cdad896e4dfc65dfbe36a8bf4f62
MD5 096f9ae97eb33dca221c1580493bb7d4
BLAKE2b-256 fd3487232f14436011069e6a7250c8794b3529944e4fc08002c11e8dd5c8f2f9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.7

File hashes

Hashes for fasm-0.0.2.post67-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 6d3d7f819e4e1cd960a61502b30917623a187f56c5666d15f0e11a921936e726
MD5 5564d18f08f1299f124e2a571dea4c87
BLAKE2b-256 ae92ae6a9292206af0aa8f8626edc1306ab7c5b9c19c49436243e5b66e9ec492

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post67-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post67-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 815.1 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for fasm-0.0.2.post67-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 222ba6a0200b86f6b782fafecfc22641d8e49b455ad77af9fba3fa82791cfca7
MD5 4805258d7e4182229d37a32fa35871c5
BLAKE2b-256 faae79af8fea02c5c156c031882c0bec09edc724ef522ca5e98d90d672cd0658

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 422.8 kB
  • Tags: CPython 3.8, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.7

File hashes

Hashes for fasm-0.0.2.post67-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 49b48e572fbfdb101f42627da5eb3f585161154287baa803af9885758dd06f69
MD5 666326514c8b171686cdc3ca6cdb4bde
BLAKE2b-256 1d6a9ce2fa66f7eb157089568d8788c705bbfe80571b3777c9c1c31c719e7b6a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.9

File hashes

Hashes for fasm-0.0.2.post67-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a2254c9860f6d4d30217276e33818d8dffcd55676488b872c62e2474b1edbb35
MD5 487775045bdcc4ba9f8a931aef1468c4
BLAKE2b-256 1da7e82b32408290070e90370f5ac8cb80f721568fbf346a23687e30167c7970

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 763.7 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for fasm-0.0.2.post67-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c85213f68c433493f30e643028e7f1fd1ad3b6d3ec8cff43ca360eb917b800f1
MD5 51adfa62e5256928312974998e89643c
BLAKE2b-256 71ae65943f9818f1238824ae0d01ead30464092490340c3bd2951d94eb6edf62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 421.8 kB
  • Tags: CPython 3.7m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.7.9

File hashes

Hashes for fasm-0.0.2.post67-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7c0b0485d0ede0a5eede7856fc071c3032eb90ef9d49ac8b2f19e4198446768e
MD5 7650fb4d15dc4f461c6c89112bcdf8a1
BLAKE2b-256 e59066aeb557739c42eaaf9b7c0894fac378c4486f27a97871cb9666966def46

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 66.9 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.6.8

File hashes

Hashes for fasm-0.0.2.post67-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 88245a937fe311208300f094f94c7fd3e230f8db54c58f770bb55266533cbbc7
MD5 cc45daca93b5b721b2315a796b5b5dae
BLAKE2b-256 80be713c5b63e9029eddfd943579c2153baef24968c89bca6391675a90b153af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 766.1 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for fasm-0.0.2.post67-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 8ddb8a32e52bca67abf2b89809eaf19a564cc639b3eabe676ee77cb127be9686
MD5 6024893b64ac3d12447ab15a9dd997b6
BLAKE2b-256 67c2b63a9aac59ee30b2a7bd8821adf3cf4aed81ce7f81f0bd4a7d8763506812

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post67-cp36-cp36m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 421.4 kB
  • Tags: CPython 3.6m, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.6.12

File hashes

Hashes for fasm-0.0.2.post67-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 83b6e03463b76b898458fb2c697e3928610e271cb5436e7dc6d86f163e9fa635
MD5 c397c1c06a7891ab85a5558018b5ce52
BLAKE2b-256 5c22d23f9fdac418ac2491459dbb85fddfab88e344302765fa8fdf38a9b530a5

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