Hello all! I’m a hardware designer familiar with Chisel and the Scala FIRRTL Compiler (SFC). My company uses Chipyard for SoC development, and we’re excited to learn more about CIRCT. As an initial experiment, I’m interested in porting some of our custom FIRRTL passes from the SFC into the CIRCT framework, but I’m not sure where to get started.
- Is there a process for adding custom passes/annotations to CIRCT/firtool? Should I just be forking the CIRCT repo and adding new files to the “lib/Dialect/FIRRTL/Transforms” directory, or is there a way I can use CIRCT as more of a library? I’m curious about how this compares to the Scala version of this, where I can pull FIRRTL in as a dependency to an sbt project, write my FIRRTL passes/annotations in that project, and then inject them into the compiler passes with the DependencyAPIMigration trait.
- Is there any documentation (or example files to read through) for familiarizing myself with some of the data structures available while writing CIRCT passes? I’m thinking of analogs to the SFC DiGraph, InstanceKeyGraph, and ConnectionGraph classes, for example. Looking at
lib/Dialect/FIRRTL/Transforms/CheckCombCycles.cpp, I can see that you pull in a number of both FIRRTL and LLVM data structures. I see the LLVM Programmer’s Manual, and that will probably help me familiarize myself with LLVM data structures, but should I just read through code and GitHub PRs to learn about the FIRRTL/CIRCT data structures?
Finally, thank you for all of the work on this! I’m hoping to be able to contribute soon.