Package: hgdb-circt
This is a modified version of CIRCT that supports source-level debugging viahgdb. Below is the original
README.↳ 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:Join ourDiscourse Forumon 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 onCIRCT channelof LLVM discord server.Join our weekly video chat.  Please see themeeting notes documentfor more information.Contribute code.  CIRCT follows all of the LLVM Policies: you can create pull
requests for the CIRCT repository, and gain commit access using thestandard LLVM policies.MotivationThe 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 withVerilog(alsoVHDL) 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 longercharter document.Setting this upThese commands can be used to setup CIRCT project:Install Dependenciesof LLVM/MLIR according tothe
instructions, including cmake and
ninja.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 updateNote:The repository is set up so thatgit submodule updateperforms 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 --unshallowBuild 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-mlirBuild 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=DEBUGflag 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=ONflag generates
abuild/compile_commands.jsonfile, 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=Releaseor-DCMAKE_BUILD_TYPE=RelWithDebInfoif you want to go fast and optionally if
you want debug info to go with it.Releasemode makes a very large difference
in performance.Consult theGetting Startedpage for detailed
information on configuring and compiling CIRCT.Consult thePython Bindingspage if you are mainly
interested in using CIRCT from a Python prompt or script.