• Stars
    star
    1,527
  • Rank 30,669 (Top 0.7 %)
  • Language
    C++
  • License
    Other
  • Created over 4 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Circuit IR Compilers and Tools

Nightly integration tests

Track LLVM Changes
↳ If failing, there exists an upstream LLVM commit which breaks CIRCT.

⚑️ "CIRCT" / Circuit IR Compilers and Tools

"CIRCT" stands for "Circuit IR Compilers and Tools". One might also interpret it as the recursively as "CIRCT IR Compiler and Tools". The T can be selectively expanded as Tool, Translator, Team, Technology, Target, Tree, Type, ... we're ok with the ambiguity.

The CIRCT community is an open and welcoming community. If you'd like to participate, you can do so in a number of different ways:

  1. Join our Discourse Forum on the LLVM Discourse server. To get a "mailing list" like experience click the bell icon in the upper right and switch to "Watching". It is also helpful to go to your Discourse profile, then the "emails" tab, and check "Enable mailing list mode". You can also do chat with us on CIRCT channel of LLVM discord server.

  2. Join our weekly video chat. Please see the meeting notes document for more information.

  3. Contribute code. CIRCT follows all of the LLVM Policies: you can create pull requests for the CIRCT repository, and gain commit access using the standard LLVM policies.

Motivation

The EDA industry has well-known and widely used proprietary and open source tools. However, these tools are inconsistent, have usability concerns, and were not designed together into a common platform. Furthermore these tools are generally built with Verilog (also VHDL) as the IRs that they interchange. Verilog has well known design issues, and limitations, e.g. suffering from poor location tracking support.

The CIRCT project is an (experimental!) effort looking to apply MLIR and the LLVM development methodology to the domain of hardware design tools. Many of us dream of having reusable infrastructure that is modular, uses library-based design techniques, is more consistent, and builds on the best practices in compiler infrastructure and compiler design techniques.

By working together, we hope that we can build a new center of gravity to draw contributions from the small (but enthusiastic!) community of people who work on open hardware tooling. In turn we hope this will propel open tools forward, enables new higher-level abstractions for hardware design, and perhaps some pieces may even be adopted by proprietary tools in time.

For more information, please see our longer charter document.

Setting this up

These commands can be used to setup CIRCT project:

  1. Install Dependencies of LLVM/MLIR according to the instructions, including cmake and ninja.

  2. Check out LLVM and CIRCT repos. CIRCT contains LLVM as a git submodule. The LLVM repo here includes staged changes to MLIR which may be necessary to support CIRCT. It also represents the version of LLVM that has been tested. MLIR is still changing relatively rapidly, so feel free to use the current version of LLVM, but APIs may have changed.

$ git clone [email protected]:llvm/circt.git
$ cd circt
$ git submodule init
$ git submodule update

Note: The repository is set up so that git submodule update performs a shallow clone, meaning it downloads just enough of the LLVM repository to check out the currently specified commit. If you wish to work with the full history of the LLVM repository, you can manually "unshallow" the the submodule:

$ cd llvm
$ git fetch --unshallow
  1. Build and test LLVM/MLIR:
$ cd circt
$ mkdir llvm/build
$ cd llvm/build
$ cmake -G Ninja ../llvm \
    -DLLVM_ENABLE_PROJECTS="mlir" \
    -DLLVM_TARGETS_TO_BUILD="host" \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DCMAKE_BUILD_TYPE=DEBUG \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
$ ninja
$ ninja check-mlir
  1. Build and test CIRCT:
$ cd circt
$ mkdir build
$ cd build
$ cmake -G Ninja .. \
    -DMLIR_DIR=$PWD/../llvm/build/lib/cmake/mlir \
    -DLLVM_DIR=$PWD/../llvm/build/lib/cmake/llvm \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DCMAKE_BUILD_TYPE=DEBUG \
    -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
$ ninja
$ ninja check-circt
$ ninja check-circt-integration # Run the integration tests.

The -DCMAKE_BUILD_TYPE=DEBUG flag enables debug information, which makes the whole tree compile slower, but allows you to step through code into the LLVM and MLIR frameworks. The -DCMAKE_EXPORT_COMPILE_COMMANDS=ON flag generates a build/compile_commands.json file, which can be used by editors (or plugins) for autocomplete and/or IDE-like features.

To get something that runs fast, use -DCMAKE_BUILD_TYPE=Release or -DCMAKE_BUILD_TYPE=RelWithDebInfo if you want to go fast and optionally if you want debug info to go with it. Release mode makes a very large difference in performance.

Consult the Getting Started page for detailed information on configuring and compiling CIRCT.

Consult the Python Bindings page if you are mainly interested in using CIRCT from a Python prompt or script.

More Repositories

1

llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
LLVM
28,809
star
2

torch-mlir

The Torch-MLIR project aims to provide first class support from the PyTorch ecosystem to the MLIR ecosystem.
C++
1,344
star
3

Polygeist

C/C++ frontend for MLIR. Also features polyhedral optimizations, parallel optimizations, and more!
C++
481
star
4

clangir

A new (MLIR based) high-level IR for clang.
LLVM
377
star
5

llvm-test-suite

Logos
130
star
6

mlir-www

SCSS
60
star
7

llvm-zorg

Python
51
star
8

vscode-mlir

TypeScript
45
star
9

llvm-www

HTML
28
star
10

llvm-blog-www

The LLVM Project Blog
HTML
23
star
11

clangd-www

Markdown
22
star
12

llvm-lnt

Python
21
star
13

llvm-iwg

The LLVM Infrastructure Working Group
18
star
14

circt-www

CIRCT website
SCSS
10
star
15

llvm-project-staging

Staging repository for https://github.com/llvm/llvm-project. Used for official contributions to the LLVM project that LLVM contributors will collaboratively split up for regular patch review.
10
star
16

llvm-project-release-prs

Repository for pull requests used for testing release branch backports in llvm/llvm-project
9
star
17

llvm-www-pubs

HTML
9
star
18

actions

TypeScript
8
star
19

llvm-archive

Archive of old/discontinued llvm projects, converted from SVN.
7
star
20

wg-hlsl

HLSL Working Group documentation and task tracking.
Python
7
star
21

llvm-foundation-www

LLVM Foundation Website
SCSS
6
star
22

www-releases

HTML
5
star
23

llvm-bugzilla-archive

4
star
24

llvm-project-legacy-branches

Miscellaneous unofficial branches and tags converted from svn.
C++
3
star
25

llvm-admin

Internal repository for LLVM admin scripts
Python
3
star
26

torch-mlir-release

Automated releases for torch-mlir
3
star
27

temp-issue-tester

Repository for testing GitHub issue features
Python
2
star
28

Community.o

Community.o website and other resources
1
star
29

llvm-project-ci-bridge

llvm/llvm-project mirrior to facilitate the integration between Phabricator and Buildkite.
1
star
30

llvm-security-test-repo

Repo to test filing security issues
1
star