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.
- runt by running
cargo install runt
- vcdump by running
cargo install vcdump
- Verilator:
- Ubuntu:
sudo apt install verilator
- Fedora:
sudo dnf install verilator
- Mac:
brew install verilator
- Other platforms: Verilator installation.
- Ubuntu:
- jq:
- Ubuntu:
sudo apt install jq
- Fedora:
sudo dnf install jq
- Mac:
brew install jq
- Other platforms: JQ installation.
- Ubuntu:
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:
-
Run
cargo build
to build the compiler. -
Run
./target/debug/futil --help
to get options from thefutil
binary. Alternatively, runcargo run -- --help
which rebuilds and runs the compiler. -
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