GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - llvm/circt: Circuit IR Compilers and Tools

BranchesTags
Open more actions menu

Latest commit

 

History

12,318 Commits
12,318 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.idea
.idea
 
 
.vscode
.vscode
 
 
cmake/modules
cmake/modules
 
 
docs
docs
 
 
examples/circt-standalone
examples/circt-standalone
 
 
frontends
frontends
 
 
include
include
 
 
integration_test
integration_test
 
 
lib
lib
 
 
llvm @ a17069f
llvm @ a17069f
 
 
test
test
 
 
tools
tools
 
 
unittests
unittests
 
 
utils
utils
 
 
.clang-format
.clang-format
 
 
.clang-tidy
.clang-tidy
 
 
.editorconfig
.editorconfig
 
 
.git-blame-ignore-revs
.git-blame-ignore-revs
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
.style.yapf
.style.yapf
 
 
.yapfignore
.yapfignore
 
 
AGENTS.md
AGENTS.md
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CODEOWNERS
CODEOWNERS
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 

Repository files navigation

Nightly integration tests

⚡️ "CIRCT" / Circuit IR Compilers and Tools

"CIRCT" stands for "Circuit Intermediate Representations (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. See our Developer Policy and AI Tool Use Policy for more details.

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.

Getting Started

To get started hacking on CIRCT quickly, run the following commands. If you want to include circt-verilog in the build, add -DCIRCT_SLANG_FRONTEND_ENABLED=ON to the cmake call:

# Clone the repository and its submodules
git clone [email protected]:llvm/circt.git --recursive
cd circt

# Configure the build
cmake -G Ninja llvm/llvm -B build \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DLLVM_TARGETS_TO_BUILD=host \
    -DLLVM_ENABLE_PROJECTS=mlir \
    -DLLVM_EXTERNAL_PROJECTS=circt \
    -DLLVM_EXTERNAL_CIRCT_SOURCE_DIR=$PWD \
    -DLLVM_ENABLE_LLD=ON

If you want to build everything about the CIRCT tools and libraries, run below command(also runs all tests):

ninja -C build check-circt

If you want to only build a specific part, for example the circt-opt tool:

ninja -C build bin/circt-opt

or the firtool tool:

ninja -C build bin/firtool

This will only build the necessary parts of LLVM, MLIR, and CIRCT, which can be a lot quicker than building everything.

Dependencies

If you have git, ninja, python3, cmake, and a C++ toolchain installed, you should be able to build CIRCT. For a more detailed description of dependencies, take a look at:

  • Getting Started with MLIR
  • LLVM Requirements

Useful Options

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 compile_commands.json file, which can be used by editors and language servers for autocomplete and other IDE-like features.

To get something that runs faster but is still easy to debug, use the -DCMAKE_BUILD_TYPE=RelWithDebInfo flag to do a release build with debug info.

To do a release build that runs very fast, use the -DCMAKE_BUILD_TYPE=Release flag. 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.

Submodules

CIRCT contains LLVM as a git submodule. The LLVM repository 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.

Whenever you checkout a new CIRCT branch that points to a different version of LLVM, run the following command to update the submodule:

git submodule update

The repository is set up to perform a shallow clone of the submodules, 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 submodule:

cd llvm
git fetch --unshallow

Building LLVM/MLIR Separately

You can also build LLVM/MLIR in isolation first, and then build CIRCT using that first build. This allows you to pick different compiler options for the two builds, such as building CIRCT in debug mode but LLVM/MLIR in release mode.

First, build and test LLVM/MLIR:

cd llvm
cmake -G Ninja llvm -B build \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DLLVM_ENABLE_PROJECTS=mlir \
    -DLLVM_TARGETS_TO_BUILD=host
ninja -C build
ninja -C build check-mlir
cd ..

Then build and test CIRCT:

cmake -G Ninja . -B build \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DMLIR_DIR=$PWD/llvm/build/lib/cmake/mlir \
    -DLLVM_DIR=$PWD/llvm/build/lib/cmake/llvm
ninja -C build
ninja -C build check-circt
ninja -C build check-circt-integration

About

Circuit IR Compilers and Tools

circt.org

Topics

circtllvmmlir

Resources

Readme
License

Security policy

Security policy
Activity
Custom properties

Stars

2.3k stars

Watchers

236 watching

Forks

550 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.