-
If you need help on making a pull request, follow this guide.
-
To understand how to compile and test chisel3 from the source code, install the required dependencies.
-
In order to contribute to chisel3, you'll need to sign the CLA agreement. You will be asked to sign it upon your first pull request.
-
To introduce yourself and get help, you can join the gitter forum. If you have any questions or concerns, you can get help there.
-
You can peruse the good-first-issues for easy tasks to start with. Another easy thing to start with is doing your own pass of the website looking for typos, pages missing their titles, etc. The sources for the website are here.
-
Please make your PRs against the
main
branch. The project admins, when reviewing your PR, will decide which stable version (if any) your change should be backported to. They will apply the appropriatemilestone
marker which controls which branches the backport will be opened to. The backports will be opened automatically on your behalf once yourmain
PR is merged. -
The PR template will require you to select "Type of Improvement." A reviewer or someone with write access will add the appropriate label to your PR based on this type of improvement which will include your PR in the correct category in the release notes.
-
If your backport PR(s) get labeled with
bp-conflict
, it means they cannot be automatically be merged. You can help get them merged by openening a PR against the already-existing backport branch (will be named something likemergify/bp/3.5.x/pr-2512
) with the necessary cleanup changes. The admins will merge your cleanup PR and remove thebp-conflict
label if appropriate.
From the Chisel root directory, run:
# Reformat normal source files
./mill __.reformat
# Reformat mill build files
./mill --meta-level 1 mill.scalalib.scalafmt.ScalafmtModule/reformatAll sources
This section describes the internal Chisel components for contributors.
There is a highly experimental component CIRCT Converter (a.k.a. Panama Converter). It is powered by Java's Panama framework to interact directly with CIRCT by calling the C-APIs of MLIR and CIRCT directly from Scala, enabling seamless emitting Chisel IR to CIRCT FIRRTL Dialect IR (no serialization and deserialization for FIRRTL), flexible executing Passes with PassManager, lowering to / exporting SystemVerilog, accesing OM data, and more.
Here defines the needed CIRCT items that will be processed by the Panama framework's jextract tool for codegen FFI Java code to use in Scala.
It provides a type-safe wrapper for the FFI code generated by jextract.
Here is the implementation of how each Chisel IR will be emitted to the CIRCT.
It needs to be highly synchronized with CIRCT upstream. When updating it, you can refer to CIRCT's FIRRTL Dialect documentation. Some dialect-specific types, conversions may require a specialized C-API function to return from CIRCT, in which case you can open a PR in CIRCT upstream to add it and use it here.
It provides a PassManager, which is used in place of the firtool cli.
After using PassManager to lowering the FIRRTL Dialect to the HW Dialect, you will be able to access the OM data in it.
The data types of the OM are defined here, as well as the way to access them. This is an example of printing out all the Top_Class
fields.
val pm = converter.passManager()
assert(pm.populateFinalizeIR())
assert(pm.run())
val om = converter.om()
val evaluator = om.evaluator()
val top = evaluator.instantiate("Top_Class", Seq(om.newBasePathEmpty)).get
top.foreachField((name, value) => println(s".$name => { ${value.toString} }"))
We used llvm-lit and scala-cli to test CIRCT Converter.
To run the test, make sure the environment variables are defined first:
JAVA_HOME
: The directory where the Java runtime environment. The Panama framework requires Java 21 and higher.
mill -i lit[_].run
When interacting with CIRCT, it is easy to get a JVM crash, which is usually due to an unexpected error inside CIRCT (e.g. an assertion failure). Checking the call stack of the crash will help you to localize the bug.