Firrtl is an intermediate representation (IR) for digital circuits designed as a platform for writing circuit-level transformations. This repository consists of a collection of transformations (written in Scala) which simplify, verify, transform, or emit their input circuit.
A Firrtl compiler is constructed by chaining together these transformations, then writing the final circuit to a file.
For a detailed description of Firrtl's intermediate representation, see the document "Specification of the Firrtl Language" located in spec/spec.pdf.
This repository is in ALPHA VERSION, so many things may change in the coming months.
Disclaimer: This project is in alpha, so there is no guarantee anything works. The installation instructions should work for OSX/Linux machines.
- If not already installed, install verilator (Requires at least v3.886)
- If not already installed, install sbt (Requires at least v0.13.6)
- Clone the repository:
git clone https://github.com/apl-cornell/sirrtl.git; cd sirrtl
- Compile firrtl:
sbt compile
- Run tests:
sbt test
- Build executable (
utils/bin/sirrtl
):sbt assembly
- Note: You can add
utils/bin
to your path to call sirrtl from other processes
- Note: You can add
- Publish this version locally in order to satisfy other tool chain library dependencies:
sbt publish-local
- Run a single test suite:
sbt "testOnly firrtlTests.UnitTests"
- Continually execute a command:
sbt ~compile
- Only invoke sbt once:
sbt
> compile
> test
utils/bin/sirrtl -i regress/rocket.fir -o regress/rocket.v -X verilog // Compiles rocket-chip to Verilog
utils/bin/sirrtl --help // Returns usage string
Firrtl syntax highlighting for Vim users: https://github.com/azidar/firrtl-syntax