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.post61.tar.gz (80.8 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.post61-pp37-pypy37_pp73-win32.whl (66.8 kB view details)

Uploaded PyPyWindows x86

fasm-0.0.2.post61-pp37-pypy37_pp73-macosx_10_15_x86_64.whl (403.2 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

fasm-0.0.2.post61-pp36-pypy36_pp73-win32.whl (66.8 kB view details)

Uploaded PyPyWindows x86

fasm-0.0.2.post61-pp36-pypy36_pp73-macosx_10_15_x86_64.whl (403.2 kB view details)

Uploaded PyPymacOS 10.15+ x86-64

fasm-0.0.2.post61-cp39-cp39-win_amd64.whl (66.8 kB view details)

Uploaded CPython 3.9Windows x86-64

fasm-0.0.2.post61-cp39-cp39-manylinux2010_x86_64.whl (792.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post61-cp39-cp39-macosx_10_15_x86_64.whl (424.2 kB view details)

Uploaded CPython 3.9macOS 10.15+ x86-64

fasm-0.0.2.post61-cp38-cp38-win_amd64.whl (66.8 kB view details)

Uploaded CPython 3.8Windows x86-64

fasm-0.0.2.post61-cp38-cp38-manylinux2010_x86_64.whl (815.0 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

fasm-0.0.2.post61-cp38-cp38-macosx_10_15_x86_64.whl (422.7 kB view details)

Uploaded CPython 3.8macOS 10.15+ x86-64

fasm-0.0.2.post61-cp37-cp37m-win_amd64.whl (66.8 kB view details)

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

fasm-0.0.2.post61-cp37-cp37m-macosx_10_15_x86_64.whl (421.7 kB view details)

Uploaded CPython 3.7mmacOS 10.15+ x86-64

fasm-0.0.2.post61-cp36-cp36m-win_amd64.whl (66.8 kB view details)

Uploaded CPython 3.6mWindows x86-64

fasm-0.0.2.post61-cp36-cp36m-manylinux2010_x86_64.whl (766.0 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.12+ x86-64

fasm-0.0.2.post61-cp36-cp36m-macosx_10_14_x86_64.whl (70.2 kB view details)

Uploaded CPython 3.6mmacOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61.tar.gz
  • Upload date:
  • Size: 80.8 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.post61.tar.gz
Algorithm Hash digest
SHA256 87fc78568d62edf9a786b302ae2a8bf4042257d6f348f15c33556b33debd84d4
MD5 a44307756945724b6d0085c8e7d3eeea
BLAKE2b-256 74cff897e30db59eec5beba7cd13c7eb5ee56f1f5ef37eb984fde7c6a70cd75e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-pp37-pypy37_pp73-win32.whl
  • Upload date:
  • Size: 66.8 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.post61-pp37-pypy37_pp73-win32.whl
Algorithm Hash digest
SHA256 39f348d3a29276015eb8af34c2b3ff77cfa965e68d00ba996cdd5a6b04050348
MD5 5a1e39c168ec30b4a189b1cc282ef133
BLAKE2b-256 59f5a2d90f2216823284aceaa1f9c7276f4bffea8fa4450af16c0a6c28c7f0b3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 403.2 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.post61-pp37-pypy37_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 1d23cd3f0aac07ea4e0a8f4bcd507b7e054f7e3a62121bcdde1248a724cb5b4f
MD5 6359e1e83890bba40c22f363957fdea7
BLAKE2b-256 7bdc7f9ba17056e40e0d28e9182414539e83dda9572566af3f7ed28846e16e26

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-pp36-pypy36_pp73-win32.whl
  • Upload date:
  • Size: 66.8 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.post61-pp36-pypy36_pp73-win32.whl
Algorithm Hash digest
SHA256 d13c6a5024e8e8c76793cd5fc350b258e6732398b766ce4476e9e729f2961e97
MD5 55c134e0043088dddcf57b3c7f9cfa73
BLAKE2b-256 93e004d4daefdca4a72e45c9b52c016a4d2f78c64d6bfa194288dff7fb926a3e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 403.2 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.post61-pp36-pypy36_pp73-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8a2e1979b1c3fc1520376c85b93526d5482089c00aad86ad49bef4db07285ca9
MD5 2d23876511907e835c3d2af665a1a968
BLAKE2b-256 a2cc8f6eaf15ebf976d88021cd9c007da9d309be8bc6e24286026524c2241502

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 66.8 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.post61-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 bb87788906f7db705ca107b64220307b43b5b997a1e7b0ed574fa820e3cfbb69
MD5 7146f106ad2d01c9b08e1e80a97e4063
BLAKE2b-256 387378c7ea8a917651149dd75757db817c70cc5a1367e2e9a6f0705c7534d8f1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 792.5 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.post61-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d79c9d3aa1c77f943a6061cb27492e005231effc6044cc5686de7295a41dc28c
MD5 d4cf685884b88dc19b966408ac034fdd
BLAKE2b-256 334b98e83bcb74431921e644ceb1c8ae274d8aaa1b5cf48564415bbf4ab91bc8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 424.2 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.post61-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9dafe59c41ef8627f3665eff65187fb485e1383621ae3d82f980232cf04bdd22
MD5 8162c5f315f554b94f59370855d7546b
BLAKE2b-256 5caeda7021d9f534e58de8ba14172c623731b6630ba6c3725aaf2263a8e71205

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 66.8 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.post61-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e432ec5f8d76770a44c3d04840b552ff6f76f9d1bdfa28b81233de332517a1e4
MD5 9963119eba2ad053995cd79c49f4daad
BLAKE2b-256 72b1f6739f2362ede4d25890de391368fc5c5ade458dd8b95d6b98849cf236e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 815.0 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.post61-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7c60afdeff29aa76e42e559a2868f483494976a27350bc43a9f15356cea4f2d5
MD5 29927d5609bab6d9765b83659e6c63e0
BLAKE2b-256 8bbc62f55c5ce21ecd6cb646b415edb3a053cbab89a30fb281a9cfaff15a4e81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp38-cp38-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 422.7 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.post61-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 89d53bf03a233d56eaae25397823b77c13c075b7b3e70d8ce07877428f119352
MD5 8926eb44a45b5461e96176c02393d82a
BLAKE2b-256 a4125546e32fba5dd84cd136dacea4c2401433f40f29ec5538f1979c0b57c0b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 66.8 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.post61-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 ad0bffd9bc9f8584ed02df56e7cc50d856143cac99c51466f94cdf2e530aa421
MD5 2d75b0ac95d46a6a37495033203a922d
BLAKE2b-256 86e60969d01a0d9b370a0d9a6076cc57845c52c45425afd738aaf5300e8a7a0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-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.post61-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 62089f651a0c1088d26b98699dc2941c1d6ee2608a9db3b44948f835b3bddf9d
MD5 09fb775133f5abd16d463854e09d6e8c
BLAKE2b-256 20ad95b350227a29fb7775e83b8f5c173a1e5071051e7f85c2589cb1a44c05ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp37-cp37m-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 421.7 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.post61-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 17394dfafdc31101e0f8c57ef37a8a5d3e4e8b4cf2ae062710c39da3675cdbad
MD5 f058000a6b5b2df52d94d18210d26994
BLAKE2b-256 6ddda62c09b23622d0a2da19801da246634872a1f5c6279d9fae4709c8b5c0d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 66.8 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.post61-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 07fced827834b49e5ba7277cd17b665ff90ad92c184fc4ee64e7671d482c2a31
MD5 f44a81eb9f863a64780041bee7e29fee
BLAKE2b-256 b140bbb62e204e54ef47821664871cddab8876fa918e1d6d778a49f7c48995f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fasm-0.0.2.post61-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 766.0 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.post61-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 155d135cbf51b318bbff40cf9497c597b73c7e2ae92fbea7bfce1b077e9f0d5c
MD5 28cea5cfc507c7e950a1a2ecced52c39
BLAKE2b-256 87d83d304a14fc03ff0a0bfd185bd7f8d764c3046db87a052f427aa44ce46bbf

See more details on using hashes here.

File details

Details for the file fasm-0.0.2.post61-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: fasm-0.0.2.post61-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 70.2 kB
  • Tags: CPython 3.6m, macOS 10.14+ 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.post61-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f652bd5e9619ec1ba380283eb6f30feb1a8c79cfbfe4e5a990341b83b755e004
MD5 a0b226ac936b62406b81c5e5f34687ed
BLAKE2b-256 c684472b5d3dbe1e90d8479e6c5efd40b09d0c1dfe7d1e2d502110f7a56e85d1

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