Prerequisites

On an Ubuntu system, the following are the main dependencies:

  • The build system: install pdm

  • For synthesis/simulation: install oss-cad-suite (and see note below)

  • For any SoC examples that include a CPU: rust

    • To build stripped images for RISC-V, you also need:

      rustup target add riscv32im-unknown-none-elf
      rustup target add riscv32imafc-unknown-none-elf # for `macro_osc` only, it uses an FPU
      rustup component add rustfmt clippy llvm-tools
      cargo install cargo-binutils svd2rust form
      

Note

By default, synthesis will use yowasp-yosys and yowasp-nextpnr-ecp5 (python packages), rather than any oss-cad-suite you have installed. When running locally, builds are usually faster if you point to your own installation - modify gateware/.env.toolchain (simply deleting it will try to find yosys in your PATH).

To set up the repository:

cd gateware
git submodule update --init --recursive

To install all python dependencies in a PDM-managed venv:

pdm install

Note

Most examples are built in CI. If you’re having trouble setting up your environment, it may also be worth checking the github workflow configuration.