Skip to main content

Setup

Let's get started.

This page explains the general requirements for getting this to work.

Rust

First of all, we will need the obvious: Rust. You can get it from rustup.rs where they have a guide on how to get it up and running.

If you are running on a UNIX, it boils down to the following:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Targets

We're not quite done, as we will need some additional setup. Depending on the softcore you will use, an additional toolchain is required.

  • Altera NIOS-V m/c - The compact and microcontroller variants: riscv32i-unknown-none-elf
  • Altera NIOS-V g - The general purpose big variant: riscv32im-unknown-none-elf

You can install them using the rustup command:

rustup target add <TOOLCHAIN>

Here is a quick copy-friendly command to install all of them:

rustup target add riscv32i-unknown-none-elf
rustup target add riscv32im-unknown-none-elf

IDE

You will also most probably need an IDE to edit your Rust code. This series uses Visual Studio Code for its flexibility.

vscode plugins

To use vscode more effectively, the following plugins can be used and might come in handy:

  • rust-analyzer: The obvious one for Rust support
  • TerosHDL: A handy plugin for working with HDLs such as VHDL and Verilog in vscode