Code Monkey home page Code Monkey logo

fasm's Introduction

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: pypa/pip#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.

fasm's People

Contributors

arn4ud avatar daniellimws avatar hackerfoo avatar ianboyanzhang avatar kgugala avatar litghost avatar mithro avatar tmichalak avatar umarcor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fasm's Issues

Improve the cmake flag configuration

The cmake file needs some improvement.

It should add;

  • Add -Wimplicit-fallthrough=0 if it is supported on non-Windows
  • Add -Wno-attributes if it is supported on non-Windows
  • Add /std:c++latest on Windows.

This is related to #50.

Originally posted by @mithro in #48 (comment)

Windows CI is failing do to permission error installing wheel

  Downloading pip-21.3-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 21.2.4
    Uninstalling pip-21.2.4:
      Successfully uninstalled pip-21.2.4
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pip-uninstall-71pdwakp\\pip.exe'
Consider using the `--user` option or check the permissions.

Error: Process completed with exit code 1.

Remove generated files on "pip uninstall"

Context: #28 (comment)

litghost commented 1 hour ago โ€ข

Try this, with ANTLR4 runtime installed:

python3 -mvenv test_env
source test_env/bin/activate
pip install -v git+https://github.com/HackerFoo/fasm.git@antltr_cpp
pip uninstall fasm

I get the following message when running pip uninstall fasm:

pip uninstall fasm
Found existing installation: fasm 0.0.2
Uninstalling fasm-0.0.2:
Would remove:
test_pip/bin/fasm
test_pip/lib/python3.7/site-packages/fasm-0.0.2-py3.7.egg-info
test_pip/lib/python3.7/site-packages/fasm/*
Would not remove (might be manually added):
test_pip/lib/python3.7/site-packages/fasm/parser/libparse_fasm.so
test_pip/lib/python3.7/site-packages/fasm/parser/tags.py
Proceed (y/n)?

Note the lines under Would not remove (might be manually added):. Even if I say y, it doesn't remove the .so and tags.py.

Remove `add_flags` method in setup.py by fixing cmake config file

The pull request at #48 adds a add_flags method. These flags should be instead correctly set via detection in the cmake file.

The code is shown below;

    def add_flags(self):
        if sys.platform.startswith('win'):
            return


        for flag in ["CFLAGS", "CXXFLAGS"]:
            flags = [os.environ.get(flag, "")]
            if not flags[0]:
                flags.pop(0)


            if shared_options.antlr_runtime == 'static':
                # When linking the ANTLR runtime statically, -fPIC is
                # still necessary because libparse_fasm will be a
                # shared library.
                flags.append("-fPIC")


            # FIXME: These should be in the cmake config file?
            # Disable excessive warnings currently in ANTLR runtime.
            # warning: type attributes ignored after type is already defined
            # `class ANTLR4CPP_PUBLIC ATN;`
            flags.append('-Wno-attributes')


            # Lots of implicit fallthroughs.
            # flags.append('-Wimplicit-fallthrough=0')


            if flags:
                os.environ[flag] = " ".join(flags)

cython3 need mentioning in the dependencies

When running the compile as in the README, the following failure happens:

$ python3 setup.py test
Traceback (most recent call last):
  File "/home/hzeller/src/fasm/setup.py", line 28, in <module>
    from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'

So in the apt install line, it would then require cython3

Then, the setup test runs but it still fails with some other issue, please advise:

  File "/home/hzeller/src/fasm/setup.py", line 265, in <module>
    setuptools.setup(
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 223, in run
    self.run_tests()
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 226, in run_tests
    test = unittest.main(
  File "/usr/lib/python3.10/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python3.10/unittest/main.py", line 124, in parseArgs
    self._do_discovery(argv[2:])
  File "/usr/lib/python3.10/unittest/main.py", line 244, in _do_discovery
    self.createTests(from_discovery=True, Loader=Loader)
  File "/usr/lib/python3.10/unittest/main.py", line 154, in createTests
    self.test = loader.discover(self.start, self.pattern, self.top)
  File "/usr/lib/python3.10/unittest/loader.py", line 349, in discover
    tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib/python3.10/unittest/loader.py", line 405, in _find_tests
    tests, should_recurse = self._find_test_path(
  File "/usr/lib/python3.10/unittest/loader.py", line 483, in _find_test_path
    tests = self.loadTestsFromModule(package, pattern=pattern)
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 42, in loadTestsFromModule
    tests.append(TestLoader.loadTestsFromModule(self, module))
  File "/usr/lib/python3.10/unittest/loader.py", line 121, in loadTestsFromModule
    for name in dir(module):
TypeError: 'str' object is not callable

Since the stacktrace is a bit hard to read as Python reverses it, here a bit more digestable:

TypeError: 'str' object is not callable
        /usr/lib/python3.10/unittest/loader.py:121           loadTestsFromModule    for name in dir(module):
        /usr/lib/python3/dist-packages/setuptools/command/test.py:42 loadTestsFromModule    tests.append(TestLoader.loadTestsFromModule(self, module))
        /usr/lib/python3.10/unittest/loader.py:483           _find_test_path    tests = self.loadTestsFromModule(package, pattern=pattern)
        /usr/lib/python3.10/unittest/loader.py:405           _find_tests        tests, should_recurse = self._find_test_path(
        /usr/lib/python3.10/unittest/loader.py:349           discover           tests = list(self._find_tests(start_dir, pattern))
        /usr/lib/python3.10/unittest/main.py:154             createTests        self.test = loader.discover(self.start, self.pattern, self.top)
        /usr/lib/python3.10/unittest/main.py:244             _do_discovery      self.createTests(from_discovery=True, Loader=Loader)
        /usr/lib/python3.10/unittest/main.py:124             parseArgs          self._do_discovery(argv[2:])
        /usr/lib/python3.10/unittest/main.py:100             __init__           self.parseArgs(argv)
        /usr/lib/python3/dist-packages/setuptools/command/test.py:226 run_tests          test = unittest.main(
        /usr/lib/python3/dist-packages/setuptools/command/test.py:223 run                self.run_tests()
        /usr/lib/python3.10/distutils/dist.py:985            run_command        cmd_obj.run()
        /usr/lib/python3.10/distutils/dist.py:966            run_commands       self.run_command(cmd)
        /usr/lib/python3.10/distutils/core.py:148            setup              dist.run_commands()
        /usr/lib/python3/dist-packages/setuptools/__init__.py:153 setup              return distutils.core.setup(**attrs)
        /home/hzeller/src/fasm/setup.py:265                  <module>           setuptools.setup(

I have no idea what is happening here, does it mean there is an issue in loader.py in the local installation ?

Compilation error

Hello, I am trying to compile and install but I found this error following the compiling steps:
ccc
error

Replace slow implementation with single-header, plain c++ version ?

I heard once that fasm-parsing was eating a significant amount of time in some projects and wanted to have a quick look.

But when attempting to look at it a while back I couldn't get it even to compile because of a forest of intertangled Python dependencies . Looks like the early days were centered around Python for interactive and debugging reasons.
Given that fasm is used as an important part of actual flows these days, it is probably time to slim down the dependencies, and focus on it not being a bottleneck in production flows (Maybe still keep a Python implementation to focus for the interactive experiments.)

Since this project didn't compile but I still wanted to explore the format I ended up writing a parser in a header-only C++ implementation (including a C binding) to play with it. Content is parsed, values decoded and the feature names and bits are returned via callbacks. It parses FASM at about 1GiB/s per core.

Since I am not actively working in a project using fasm, I just leave it here in case you want to pick it up.
https://github.com/hzeller/simple-fasm

Add license automated check in Travis

There should be an automated test to check that all source code in the project has the SPDX Identifier, and, in case of third_party tools, that the LICENSE file is present.

This script can be used and changed accordingly to the source file-types by adding/removing the correct extensions

Improving naming of fasm.parser.parse_fasm_X API

Context from #28 (comment):

@mithro mithro 17 hours ago Member

[optional] I wonder if these should be fasm.parser.filename and fasm.parser.string. Then maybe you can do either;

import fasm.parser
fasm.parser.filename(XXXX)

or

from fasm.parser import filename as fasm_parser_filename

Currently this "stutters" a bit.

From https://blog.golang.org/package-names

Avoid stutter. Since client code uses the package name as a prefix when referring to the package contents, the names for those contents need not repeat the package name. The HTTP server provided by the http package is called Server, not HTTPServer. Client code refers to this type as http.Server, so there is no ambiguity.

See also https://michaelwhatcott.com/go-code-that-stutters/ and rust-lang/api-guidelines#66
@HackerFoo HackerFoo 17 hours ago Author Member

I like fasm.parse.from_X, but it can make things like parse.available and parse.implementation slightly awkward.

fasm.parser.from_X isn't bad.
@HackerFoo HackerFoo 14 hours ago Author Member

I'm going to keep the same names for now to make it clear that they are replacements for the old code.
@mithro mithro 2 hours ago Member

Please create a follow up GitHub issue to track cleaning up these names then.

Cleanup the cmake output

Currently cmake complains heavily during the build, figure out what needs to be done to fix the issues;

CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/ExternalProject.cmake:2143 (message):
  Policy CMP0114 is not set: ExternalProject step targets fully adopt their
  steps.  Run "cmake --help-policy CMP0114" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  ExternalProject target 'antlr4_runtime' would depend on the targets for
  step(s) 'build_static' under policy CMP0114, but this is being left out for
  compatibility since the policy is not set.
Call Stack (most recent call first):
  /home/runner/work/fasm/fasm/third_party/antlr4/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake:128 (ExternalProject_Add_StepTargets)
  CMakeLists.txt:23 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/local/share/cmake-3.19/Modules/ExternalProject.cmake:2143 (message):
  Policy CMP0114 is not set: ExternalProject step targets fully adopt their
  steps.  Run "cmake --help-policy CMP0114" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  ExternalProject target 'antlr4_runtime' would depend on the targets for
  step(s) 'build_shared' under policy CMP0114, but this is being left out for
  compatibility since the policy is not set.
Call Stack (most recent call first):
  /home/runner/work/fasm/fasm/third_party/antlr4/runtime/Cpp/cmake/ExternalAntlr4Cpp.cmake:145 (ExternalProject_Add_StepTargets)
  CMakeLists.txt:23 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at /home/runner/work/fasm/fasm/third_party/googletest/CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at /home/runner/work/fasm/fasm/third_party/googletest/googlemock/CMakeLists.txt:45 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


CMake Deprecation Warning at /home/runner/work/fasm/fasm/third_party/googletest/googletest/CMakeLists.txt:56 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

Create specification for common "FASM annotations"

FASM supports computer readable metadata called annotations in the fasm file.

We should specify a bunch of common stuff;

  • Target information
    • Which FPGA this FASM file is for
  • Tooling information
    • What tool + version generated this
    • Tooling arguments / parameters.
    • architecture checksums
    • (maybe) run time information (how long, how much memory, etc?)
  • Input information / "debug symbols" (?)
    • input netlist checksums
    • src code line mappings
    • netlist name mappings
    • path timing annotations

Latest fasm setup.py no longer works as a git+https URL

https://github.com/SymbiFlow/symbiflow-xc-fasm2bels/blob/master/requirements.txt#L11

Replication:

python3 -mvenv env
source env/bin/activate
pip install --upgrade wheel
pip install --upgrade pip
pip install git+https://github.com/SymbiFlow/fasm.git#egg=fasm

Error:

  Building wheel for fasm (PEP 517) ... done
  Created wheel for fasm: filename=fasm-UNKNOWN-cp38-cp38-linux_x86_64.whl size=642389 sha256=a91aab3db5b998176a45237691fc079f7cba1b9c508a202b0175fd1cf907c17f
  Stored in directory: /tmp/pip-ephem-wheel-cache-n9jo50br/wheels/a4/27/09/7e90d3d4e2b629aa65ee58ad49638067e48f727e1d0cc7897c
  WARNING: Built wheel for fasm is invalid: Metadata 1.2 mandates PEP 440 version, but 'UNKNOWN' is not
Failed to build fasm
ERROR: Could not build wheels for fasm which use PEP 517 and cannot be installed directly

Broken installation due to probable circular import

Hi, i'm currently using docker to try and make a container out of symbiflow but i am encountering this issue when i try and call for the fasm command.
Here is the dockerfile

FROM continuumio/miniconda3 
WORKDIR /symb
ENV INSTALL_DIR=/symb
ENV FPGA_FAM=xc7
RUN apt update && \
    apt install -y git wget picocom xz-utils
RUN git clone https://github.com/SymbiFlow/symbiflow-examples && \
    cd symbiflow-examples
RUN conda env create -f ${INSTALL_DIR}/symbiflow-examples/${FPGA_FAM}/environment.yml
RUN mkdir -p $INSTALL_DIR/xc7/install && \
    wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/112/20201208-080919/symbiflow-arch-defs-install-7c1267b7.tar.xz | tar -xJC $INSTALL_DIR/xc7/install       && \
    wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/112/20201208-080919/symbiflow-arch-defs-xc7a50t_test-7c1267b7.tar.xz | tar -xJC $INSTALL_DIR/xc7/install
RUN echo "source activate xc7" > ~/.bashrc
ENV PATH="$PATH:/symb/xc7/install/bin"

Here is the issue

(xc7) root@caaa33124948:/symb# fasm
/opt/conda/envs/xc7/lib/python3.7/site-packages/fasm/parser/__init__.py:27: RuntimeWarning: 
Falling back on slower textX parser implementation:
  ImportError: cannot import name 'antlr_to_tuple' from 'fasm.parser' (/opt/conda/envs/xc7/lib/python3.7/site-packages/fasm/parser/__init__.py)
Please install all dependencies and reinstall with:
  pip uninstall
  pip install -v fasm
  '  pip install -v fasm'.format(e), RuntimeWarning)
Traceback (most recent call last):
  File "/opt/conda/envs/xc7/bin/fasm", line 5, in <module>
    from fasm import main
ImportError: cannot import name 'main' from 'fasm' (/opt/conda/envs/xc7/lib/python3.7/site-packages/fasm/__init__.py)

While trying to use the repo in an isolated environment i get the same issue but with a Circular Import warning hence the name of the issue

Add license header to top of all code files

See https://opensource.google/docs/releasing/licenses/

We can either use;

Copyright (C) 2020  The SymbiFlow Authors.

Use of this source code is governed by a ISC-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/ISC

Or put the full license at the top;

Copyright (C) 2020  The SymbiFlow Authors.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AttributeError: 'FileNotFoundError' object has no attribute 'read'

  File "/home/runner/work/fasm/fasm/env/conda/envs/make-env/lib/python3.10/site-packages/pip/_internal/network/session.py", line 454, in request
    return super().request(method, url, *args, **kwargs)
  File "/home/runner/work/fasm/fasm/env/conda/envs/make-env/lib/python3.10/site-packages/pip/_vendor/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/runner/work/fasm/fasm/env/conda/envs/make-env/lib/python3.10/site-packages/pip/_vendor/requests/sessions.py", line 697, in send
    r.content
  File "/home/runner/work/fasm/fasm/env/conda/envs/make-env/lib/python3.10/site-packages/pip/_vendor/requests/models.py", line 836, in content
    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
  File "/home/runner/work/fasm/fasm/env/conda/envs/make-env/lib/python3.10/site-packages/pip/_vendor/requests/models.py", line 769, in generate
    chunk = self.raw.read(chunk_size)
AttributeError: 'FileNotFoundError' object has no attribute 'read'

Antlr build fails on Windows with error about MSBUILD not supporting -j

-- Build files have been written to: D:/a/fasm/fasm/build/temp.win-amd64-3.5/Release
Microsoft (R) Build Engine version 16.8.3+39993bd9d for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1001: Unknown switch.
Switch: -j

For switch syntax, type "MSBuild -help"
Failed to build ANTLR parser, falling back on slower textX parser. Error:
 Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j']' returned non-zero exit status 1

If there someone could tell me how to install fasm in windows?

`
running build
running build_py
running egg_info
writing fasm.egg-info\PKG-INFO
writing dependency_links to fasm.egg-info\dependency_links.txt
writing entry points to fasm.egg-info\entry_points.txt
writing requirements to fasm.egg-info\requires.txt
writing top-level names to fasm.egg-info\top_level.txt
reading manifest file 'fasm.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs_*'
no previously-included directories found matching 'docs\env'
warning: no previously-included files matching '.git' found anywhere in distribution
warning: no previously-included files found matching '.gitmodules'
warning: no previously-included files found matching 'update_version.py'
no previously-included directories found matching 'third_party'
no previously-included directories found matching '.github'
no previously-included directories found matching 'pycache'
writing manifest file 'fasm.egg-info\SOURCES.txt'
running build_ext
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /mingw64/bin/cc.exe
-- Check for working C compiler: /mingw64/bin/cc.exe - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /mingw64/bin/c++.exe
-- Check for working CXX compiler: /mingw64/bin/c++.exe - works
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:34 (find_library):
Could not find ANTLR4_RUNTIME using the following names: antlr4-runtime

-- Configuring incomplete, errors occurred!
See also "/c/userdata/code/EDA/symbiflow/env/fasm/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeOutput.log".
See also "/c/userdata/code/EDA/symbiflow/env/fasm/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeError.log".
Failed to build ANTLR parser, falling back on slower textX parser. Error:
Command '['cmake', 'C:\userdata\code\EDA\symbiflow\env\fasm\src', '-DCMAKE_INSTALL_PREFIX=C:\userdata\code\EDA\symbiflow\env\fasm\build\lib.win-amd64-3.8\fasm/parser', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\userdata\code\EDA\symbiflow\env\fasm\build\lib.win-amd64-3.8\fasm/parser', '-DPYTHON_EXECUTABLE=C:\software\miniconda3\python.exe', '-DANTLR_RUNTIME_TYPE=shared', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
Traceback (most recent call last):
File "setup.py", line 103, in run
super().run()
File "C:\software\miniconda3\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
_build_ext.run(self)
File "C:\software\miniconda3\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\software\miniconda3\lib\distutils\command\build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "C:\software\miniconda3\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "setup.py", line 185, in build_extension
subprocess.check_call(
File "C:\software\miniconda3\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\userdata\code\EDA\symbiflow\env\fasm\src', '-DCMAKE_INSTALL_PREFIX=C:\userdata\code\EDA\symbiflow\env\fasm\build\lib.win-amd64-3.8\fasm/parser', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\userdata\code\EDA\symbiflow\env\fasm\build\lib.win-amd64-3.8\fasm/parser', '-DPYTHON_EXECUTABLE=C:\software\miniconda3\python.exe', '-DANTLR_RUNTIME_TYPE=shared', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
`

Create VPR arch and rrgraph linting tools

Currently FASM annotations errors are detected late in the flow. A tool to sanity check VPR arch and rrgraph annotations would allow earlier error detection, and cross linking with Verilog blackbox definitions.

Suggested lint passes:

  • Error if FASM mux definition defines an input that does not exist
  • Error if FASM mux definition does not an input that is specified in the mux/direct tag
  • Warning if FASM params definition is missing a parameter defined in the Verilog module
  • Error if FASM params definition defines a parameter that does not exist in the Verilog module
  • Error if the bit width of the FASM params definitions does not match the Verilog module parameter width
  • Error if FASM prefix length does not match num_pb value
  • Error if FASM annotation generates a FASM tag that does not exist
  • Error if FASM lut annotation is missing on a class="lut" or subckt=".names" black box.
  • Error if FASM annotation is illegal (e.g. syntax error)

Why does building the antlr4_runtime clone utfcpp?

[ 44%] Performing build_static step for 'antlr4_runtime'                                                                                          gmake[4]: Entering directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'
gmake[5]: Entering directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'
gmake[6]: Entering directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'
gmake[7]: Entering directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'               gmake[7]: Entering directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'
Scanning dependencies of target make_lib_output_dir                                                                                               
Scanning dependencies of target utfcpp
gmake[7]: Leaving directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'                gmake[7]: Leaving directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'
gmake[7]: Entering directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'
gmake[7]: Entering directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'
gmake[7]: Leaving directory '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp'                [  0%] Creating directories for 'utfcpp'
[  0%] Built target make_lib_output_dir
[  1%] Performing download step (git clone) for 'utfcpp'
Cloning into 'utfcpp'...                                                                                                                          Note: switching to 'v3.1.1'.
                                    
You are in 'detached HEAD' state. You can look around, make experimental                                                                          changes and commit them, and you can discard any commits you make in this 
state without impacting any branches by switching back to a branch.                                                                                                                   
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
                                                                                                                                                    git switch -c <new-branch-name>
                                                                                                                                                  Or undo this operation with:
                                                                                                                                                    git switch -          
                                                                                                                                                  Turn off this advice by setting config variable advice.detachedHead to false
                                                                                                                                                  
HEAD is now at 944ef05 Merge pull request #55 from Flamefire/disable_tests_for_subproject 
Submodule 'extern/gtest' (https://github.com/google/googletest) registered for path 'extern/gtest'
Cloning into '/ssd/github/SymbiFlow/fasm/build/temp.linux-x86_64-3.9/antlr4_runtime/src/antlr4_runtime/runtime/Cpp/runtime/thirdparty/utfcpp/exter
n/gtest'...
Submodule path 'extern/gtest': checked out '2fe3bd994b3189899d93f1d5a881e725e046fdc2'
[  1%] No patch step for 'utfcpp'
[  1%] Performing configure step for 'utfcpp'
-- The CXX compiler identification is GNU 10.2.1

Write a specification for a "FASM database" format

The fasm assembler uses;

  • Common logic which translate FASM feature names into bit positions
  • Custom logic to convert the bit position map into a bitstream by adding framing, headers, compression, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.