Go to file
mikeurbach c9c50d2889
[MSFT] Add optional sub-path to PhysLocationAttr. (#2421)
Previously, a sub-path could be specified by encoding it in the name
of the attribute using a certain scheme. This is brittle and
non-standard. To make this more natural and robust, the sub-path is
added as a field of the attribute definition as a StringRef. It is not
required, in which case an empty StringRef can be used. The attribute
name for placement attributes is no longer used in any logic.
2022-01-05 18:39:54 -07:00
.github/workflows LLVM Submodule Update (#2225) 2021-12-01 00:14:17 -05:00
.vscode Add some more flags to the example workspace (#233) 2020-11-11 12:50:54 -08:00
cmake/modules Partially revert #1688 in favor of style used in upstream MLIR (#1698) 2021-09-02 12:32:07 +01:00
codeowners [HW] Remove redundant verification for OutputOp. (#1367) 2021-07-02 17:49:44 -07:00
docs [HW] Add a new op HW::GlobalRef, to replace the FIRRTL::NonLocalAnchor (#2312) 2021-12-27 07:03:26 -08:00
frontends [MSFT] Add optional sub-path to PhysLocationAttr. (#2421) 2022-01-05 18:39:54 -07:00
include [MSFT] Add optional sub-path to PhysLocationAttr. (#2421) 2022-01-05 18:39:54 -07:00
integration_test [MSFT] Add optional sub-path to PhysLocationAttr. (#2421) 2022-01-05 18:39:54 -07:00
lib [MSFT] Add optional sub-path to PhysLocationAttr. (#2421) 2022-01-05 18:39:54 -07:00
llvm@4b553297ef Bump LLVM (#2263) 2021-12-01 09:14:19 +01:00
test [MSFT] Add optional sub-path to PhysLocationAttr. (#2421) 2022-01-05 18:39:54 -07:00
tools [firtoo] Move HWCleanup after canonicalizer (#2395) 2021-12-28 12:23:46 +09:00
utils Update dialect overview diagram (#2072) 2021-12-10 22:26:00 +01:00
.clang-format Improve the README to include some contributor notes, clang-format 2020-03-15 17:59:29 -07:00
.clang-tidy Adds clang-tidy to the workflow (#128) 2020-10-08 13:52:58 -07:00
.gitignore [Python] Add and document setup.py script for Python bindings. (#1913) 2021-10-01 14:20:00 -06:00
.gitmodules [LLVM] Ditch LLVM mirror (#1761) 2021-09-10 14:23:28 -07:00
.style.yapf [Python][CI] Add yapf formatting guidelines and run check in CI. 2021-04-21 15:38:02 -06:00
.yapfignore [Python][CI] Add yapf formatting guidelines and run check in CI. 2021-04-21 15:38:02 -06:00
CMakeLists.txt [NFC] Fix capitalization in cmake package name 2021-11-02 11:06:19 -05:00
LICENSE [Global] Clarify license as Apache 2.0 with LLVM Exceptions (#56) 2020-07-26 11:53:57 -07:00
README.md Update README.md (#2184) 2021-11-15 23:13:06 -08:00

README.md

Nightly integration tests

"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 git@github.com: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.