Getting Started

FuTIL is an intermediate language and infrastructure for building compilers that generate custom hardware accelerators.

The following instructions will install all dependencies required to build the compiler and run the compiler tests.

Start the process by cloning the repository:

git clone https://github.com/cucapra/futil.git

Compiler dependencies

Install Rust (it should automatically install cargo).

Testing dependencies

The compiler uses expectation tests as well as hardware simulation tests.

  1. runt by running cargo install runt
  2. vcdump by running cargo install vcdump
  3. Verilator:
    • Ubuntu: sudo apt install verilator
    • Fedora: sudo dnf install verilator
    • Mac: brew install verilator
    • Other platforms: Verilator installation.
  4. jq:
    • Ubuntu: sudo apt install jq
    • Fedora: sudo dnf install jq
    • Mac: brew install jq
    • Other platforms: JQ installation.

Install the FuTIL Driver

The FuTIL driver is required to run the various tests. Follow the installation instructions.

Building and Testing

In the root of the repository, run the following:

  1. Run cargo build to build the compiler.

  2. Run ./target/debug/futil --help to get options from the futil binary. Alternatively, run cargo run -- --help which rebuilds and runs the compiler.

  3. Run the tests (excluding the test for the frontend compilers):

runt --exclude frontend

Running an Example Program

In order to run a FuTIL program, execute the following command from the repository:

cargo run -- examples/futil/simple.futil

This will run the FuTIL compiler with input file examples/futil/simple.futil, and generate a FuTIL program without control constructs. In order to generate SystemVerilog, execute the following:

cargo run -- examples/futil/simple.futil -b verilog