seal5

Seal5 - Semi-automated LLVM Support for RISC-V Extensions including Autovectorization

https://github.com/tum-ei-eda/seal5

Science Score: 62.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: ieee.org
  • Academic email domains
  • Institutional organization owner
    Organization tum-ei-eda has institutional domain (www.eda.ei.tum.de)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.0%) to scientific vocabulary

Keywords

compiler coredsl coredsl2 isel llvm retargeting risc-v riscv
Last synced: 6 months ago · JSON representation ·

Repository

Seal5 - Semi-automated LLVM Support for RISC-V Extensions including Autovectorization

Basic Info
Statistics
  • Stars: 20
  • Watchers: 3
  • Forks: 8
  • Open Issues: 61
  • Releases: 6
Topics
compiler coredsl coredsl2 isel llvm retargeting risc-v riscv
Created about 2 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Seal5

[!NOTE] Starting July 11, 2024 we will be offering (monthly) Seal5 Development/User meetings.

Click here for details (slides, next dates,...), if you are interested!

[!NOTE] Seal5 was recently presented at the RISC-V Summit Europe 2024. Click here to access the poster, slides & recording.

Our Seal5 paper was published and presented on the DSD 2024 conference: See References section for details.

pypi package readthedocs GitHub license

demo workflow

Overview

The RISC-V instruction set architecture (ISA) is popular for its extensibility. However, a quick exploration of instruction candidates fails due to the lack of tools to auto-generate embedded software toolchain support. Seal5 work establishes a semi-automated flow to generate LLVM compiler support for custom instructions based on the CoreDSL2 ISA description language. Seal5 is capable of generating support for functionalities ranging from baseline assembler-level support, over builtin functions to compiler code generation patterns for scalar as well as vector instructions, while requiring no deeper compiler know-how.

Eliminating manual efforts for Retargeting is crutial for the automated exploration of custom RISC-V instructions as depicted in the following image. Seal5's code-generation support allows to make use of custom instructions without needing to make changes to the programs/benchmarks source code (i.e. adding inline-assembly calls).

ISADSESeal5

Prerequisites

To be able to run the examples, make sure to clone the Seal5 repo using the --recursive flag. Otherwise run the following command to fetch (and update) the referenced submodules.

sh git submodule update --init --recursive

Ubuntu Packages

First, a set of APT packages needs to be installed:

sh sudo apt install python3-pip python3-venv cmake make ninja-build

Python Requirements

First, setup a virtual environment with Python v3.8 or newer.

Install all required python packages using the following command:

pip install -r requirements.txt.

For development (linting, packaging,...) there are a few more dependencies which can be installed via:

pip install -r requirements_dev.txt.

System Requirements

The initial cloning of the llvm-project repo will take a long time, hence a good internet connection is recommended. To run the demo, make sure to have at least 20GB (>40GB for debug builds) of disk space available in the destination (/tmp/seal5_llvm_demo) directory. The target directory can be changed as follows: DEST=$HOME/seal5_demo.

Installation

Warning: It is highly recommended to install seal5 into a new virtual environment. Follow these steps to initialize and enter a venv in your seal5 repo directory:

```sh

alternative: python3 -m venv venv

virtualenv -p python3.8 venv source venv/bin/activate ```

From PyPI

pip install seal5

Local Development Version

First prepare your shell by executing export PYTHONPATH=$(pwd):$PYTHONPATH inside the seal5 repository. Then you should be able to use Seal5 without needing to reinstall it.

Alternatively you should be able to use pip install -e ..

Usage

Python API

The flow can be sketched as follows (see Example below for functional code!):

```python

Create flow

seal5_flow = Seal5Flow(...)

Initialize LLVM repo and .seal5 directories

seal5_flow.initialize(...)

Optional: remove artifacts from previous builds

seal5_flow.reset(...)

Install Seal5 dependencies (CDSL2LLVM/PatternGen)

seal5_flow.setup(...)

Load CoreDSL2+CFG files (Git config, filters,...)

seal5_flow.load(...)

Transform Seal5 model (Extract side effects, operands,...)

seal5_flow.transform(...)

Generate patches based on Seal5 model (ISel patterns, RISC-V features,...)

seal5_flow.generate(...)

Apply generated (and manual) patches to LLVM codebase

seal5_flow.patch(...)

Build patches LLVM (This will take a while)

seal5_flow.build(...)

Run LLVM+Seal5 tests to verify functionality

seal5_flow.test(...)

Combine patches and install LLVM

seal5_flow.deploy(...)

Archive final LLVM (optionally inclusing logs, reports,...)

seal5_flow.export(...)

Optional: Cleanup all artifacts

seal5_flow.cleanup(...) ```

Command-Line Interface

Command line interface is aligned with the Python API. See examples/demo.sh for an full usage example

sh export SEAL5_HOME=... seal5 --dir $SEAL5_HOME reset --settings seal5 init [--non-interactive] [-c] seal5 load --files ... seal5 setup ... seal5 transform ... seal5 generate ... seal5 patch ... seal5 build ... seal5 test ... seal5 deploy ... seal5 export ... seal5 clean [--temp] [--patches] [--models] [--inputs]

Examples

See examples/demo.py for example of end-to-end flow!

Documentation

Checkout Seal5's ReadTheDocs Page!

Limitations

See here.

CI/CD Flow

We added a (manual) CI job to run the examples/demo.py script via GitHub actions.

Contributions

Seal5 issue tracker: https://github.com/tum-ei-eda/seal5/issues

CoreDSL2LLVM/PatternGen issue tracker: https://github.com/mathis-s/CoreDSL2LLVM/issues

References

2024 27th Euromicro Conference on Digital System Design (DSD)

BibTeX

bibtex @inproceedings{van2024seal5, title={Seal5: Semi-Automated LLVM Support for RISC-V ISA Extensions Including Autovectorization}, author={Van Kempen, Philipp and Salmen, Mathis and Mueller-Gritschneder, Daniel and Schlichtmann, Ulf}, booktitle={2024 27th Euromicro Conference on Digital System Design (DSD)}, pages={335--342}, year={2024}, organization={IEEE} }

Acknowledgment

drawing

This research is partially funded by the German Federal Ministry of Education and Research (BMBF) within the projects Scale4Edge (grant number 16ME0465) and MANNHEIM-FlexKI (grant number 01IS22086L).

Owner

  • Name: EDA@TUM
  • Login: tum-ei-eda
  • Kind: organization
  • Email: eda@ei.tum.de
  • Location: Munich, Germany

Open Source Repository of the Chair of Electronic Design Automation, TU Munich

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Seal5
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Philipp
    family-names: Van Kempen
    email: philipp.van-kempen@tum.de
    orcid: 'https://orcid.org/0000-0002-1135-8070'
    affiliation: Technical University of Munich
  - given-names: Mathis
    family-names: Salmen
    affiliation: Technical University of Munich
    orcid: 'https://orcid.org/0009-0006-3449-1460'
  - given-names: Daniel
    family-names: Mueller-Gritschneder
    orcid: 'https://orcid.org/0000-0003-0903-631X'
    affiliation: TU Wien
  - given-names: Ulf
    family-names: Schlichtmann
    affiliation: Technical University of Munich
    orcid: 'https://orcid.org/0000-0003-4431-7619'
identifiers:
  - type: doi
    value: 10.1109/DSD64264.2024.00052
repository-code: 'https://github.com/tum-ei-eda/seal5'
url: 'https://tum-ei-eda.github.io/seal5/'
license: Apache-2.0
preferred-citation:
  type: conference-paper
  authors:
  - given-names: Philipp
    family-names: Van Kempen
    email: philipp.van-kempen@tum.de
    orcid: 'https://orcid.org/0000-0002-1135-8070'
    affiliation: Technical University of Munich
  - given-names: Mathis
    family-names: Salmen
    affiliation: Technical University of Munich
    orcid: 'https://orcid.org/0009-0006-3449-1460'
  - given-names: Daniel
    family-names: Mueller-Gritschneder
    orcid: 'https://orcid.org/0000-0003-0903-631X'
    affiliation: TU Wien
  - given-names: Ulf
    family-names: Schlichtmann
    affiliation: Technical University of Munich
    orcid: 'https://orcid.org/0000-0003-4431-7619'
  year: "2024"
  title: "Seal5: Semi-Automated LLVM Support for RISC-V ISA Extensions Including Autovectorization"
  start: "335"
  end: "342"
  doi: "10.1109/DSD64264.2024.00052"
  url: "https://doi.org/10.1109/DSD64264.2024.00052"
  publisher: "IEEE"
  conference: "27th Euromicro Conference on Digital System Design (DSD)"
  location: "Paris, France"
  collection-type: "proceedings"
  isbn: "979-8-3503-8038-5"

GitHub Events

Total
  • Create event: 34
  • Release event: 2
  • Issues event: 79
  • Watch event: 9
  • Delete event: 16
  • Issue comment event: 66
  • Push event: 184
  • Pull request review event: 5
  • Pull request review comment event: 17
  • Pull request event: 39
  • Fork event: 1
Last Year
  • Create event: 34
  • Release event: 2
  • Issues event: 79
  • Watch event: 9
  • Delete event: 16
  • Issue comment event: 66
  • Push event: 184
  • Pull request review event: 5
  • Pull request review comment event: 17
  • Pull request event: 39
  • Fork event: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 24
  • Total pull requests: 22
  • Average time to close issues: 7 months
  • Average time to close pull requests: 12 days
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 1.42
  • Average comments per pull request: 0.14
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 13
  • Pull requests: 22
  • Average time to close issues: 2 months
  • Average time to close pull requests: 12 days
  • Issue authors: 2
  • Pull request authors: 2
  • Average comments per issue: 1.85
  • Average comments per pull request: 0.14
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • PhilippvK (61)
  • kebi-be (4)
  • thomasgoodfellow (3)
  • dingzex (1)
Pull Request Authors
  • PhilippvK (29)
  • thomasgoodfellow (5)
  • kebi-be (4)
  • jokap11 (1)
Top Labels
Issue Labels
priority:medium (13) type:help wanted (12) type:support (11) type:enhancement (8) priority:low (8) priority:high (6) infra:testing (5) layer:builtins (5) infra:cicd (4) infra:docs (3) seal5:transform (2) seal5:backend (2) infra:release (2) type:bug (2) seal5:settings (1) seal5:cli (1) type:good first issue (1) seal5:simd (1) layer:codegen (1) layer:assembly (1) seal5:flow (1)
Pull Request Labels
priority:medium (5) type:enhancement (2) priority:low (2) type:support (2) seal5:settings (1) seal5:model (1) seal5:cli (1) infra:cicd (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 17 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 7
  • Total maintainers: 1
pypi.org: seal5

Seal5 - Semi-automated LLVM Support for RISC-V Extensions including Autovectorization

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 17 Last month
Rankings
Dependent packages count: 10.9%
Average: 36.2%
Dependent repos count: 61.4%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/demo.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v4 composite
.github/workflows/docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v2 composite
  • peaceiris/actions-gh-pages v3 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/create-release v1 composite
  • metcalfc/changelog-generator v0.4.3 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/style.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • wearerequired/lint-action v1 composite
docs/requirements.txt pypi
  • Sphinx >=5.0
  • myst-parser *
  • numpydoc *
  • sphinx-rtd-theme *
  • sphinxemoji *
pyproject.toml pypi
requirements.txt pypi
  • dacite *
  • gitpython *
  • importlib_resources *
  • mako *
  • pyyaml *
requirements_dev.txt pypi
  • black >=22.8.0 development
  • flake8 * development
  • pylint * development
setup.py pypi
seal5/cli/setup.py pypi