diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 60d9321558048..16df0fa17ede7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -16,7 +16,7 @@ variables: VERIBLE_VERSION: v0.0-1213-g9e5c085 RUST_VERSION: 1.55.0 # Release tag from https://github.com/lowRISC/lowrisc-toolchains/releases - TOOLCHAIN_VERSION: 20210412-1 + TOOLCHAIN_VERSION: 20220210-1 # This controls where builds happen, and gets picked up by build_consts.sh. BUILD_ROOT: $(Build.ArtifactStagingDirectory) VIVADO_VERSION: "2020.2" diff --git a/doc/ug/install_instructions/index.md b/doc/ug/install_instructions/index.md index a1020913f406e..6b935091e9aac 100644 --- a/doc/ug/install_instructions/index.md +++ b/doc/ug/install_instructions/index.md @@ -154,19 +154,14 @@ $ pip3 install --user -r python-requirements.txt ## Software development -### Device compiler toolchain (RV32IMC) +### Device compiler toolchain -To build device software you need a baremetal RV32IMC compiler toolchain. +To build device software you need a baremetal RISC-V toolchain. We recommend using a prebuilt toolchain provided by lowRISC. -Alternatively, you can build your own. -Whichever option you choose, we recommend installing the toolchain to `/tools/riscv`. +The prebuilt toolchains contain both GCC and Clang, targeting RISC-V. +By default the OpenTitan device software is built with Clang. -#### Option 1 (recommended): Use the lowRISC-provided prebuilt toolchain - -lowRISC provides a prebuilt toolchain for the OpenTitan project. -This toolchain contains both GCC and Clang, targeting RISC-V. -By default the device software is built with Clang. -We recommend using the `util/get-toolchain.py` tool to download and install the latest version of this toolchain. +We recommend using the `util/get-toolchain.py` tool to download and install the latest version of this toolchain, and that you install the toolchain to the default path, `/tools/riscv`. ```cmd $ cd $REPO_TOP @@ -175,52 +170,7 @@ $ ./util/get-toolchain.py This tool will automatically adjust the toolchain configuration if you override the installation directory (by using the `--install-dir` option). It also provides the ability to perform a staged installation (by supplying a `--dest-dir` option), if the toolchain needs to be unpacked first at a temporary staging directory, before it can be moved to the final installation directory. -Alternatively, manually download the file starting with `lowrisc-toolchain-rv32imc-` from [GitHub releases](https://github.com/lowRISC/lowrisc-toolchains/releases/latest) and unpack it to the desired installation directory. - -#### Option 2: Compile your own GCC toolchain - -1. Install all build prerequisites listed [in the documentation](https://github.com/riscv/riscv-gnu-toolchain/#prerequisites). - -2. Build the toolchain (this should be done outside the `$REPO_TOP` directory): - ```console - $ git clone --recursive https://github.com/riscv/riscv-gnu-toolchain - $ cd riscv-gnu-toolchain - $ ./configure --prefix=/tools/riscv --with-abi=ilp32 --with-arch=rv32imc --with-cmodel=medany - $ make - ``` - - The `make` command installs the toolchain to `/tools/riscv`, no additional `make install` step is needed. - -3. Write a [meson toolchain configuration file](https://mesonbuild.com/Cross-compilation.html#defining-the-environment) for your toolchain. - It should look like the following (though your paths may be different): - ```ini - [binaries] - c = '/tools/riscv/bin/riscv32-unknown-elf-gcc' - cpp = '/tools/riscv/bin/riscv32-unknown-elf-g++' - ar = '/tools/riscv/bin/riscv32-unknown-elf-ar' - ld = '/tools/riscv/bin/riscv32-unknown-elf-ld' - objdump = '/tools/riscv/bin/riscv32-unknown-elf-objdump' - objcopy = '/tools/riscv/bin/riscv32-unknown-elf-objcopy' - strip = '/tools/riscv/bin/riscv32-unknown-elf-strip' - as = '/tools/riscv/bin/riscv32-unknown-elf-as' - - [properties] - needs_exe_wrapper = true - has_function_printf = false - c_args = ['-march=rv32imc', '-mabi=ilp32', '-mcmodel=medany'] - c_link_args = ['-march=rv32imc', '-mabi=ilp32', '-mcmodel=medany'] - cpp_args = ['-march=rv32imc', '-mabi=ilp32', '-mcmodel=medany'] - cpp_link_args = ['-march=rv32imc', '-mabi=ilp32', '-mcmodel=medany'] - - [host_machine] - system = 'bare metal' - cpu_family = 'riscv32' - cpu = 'ibex' - endian = 'little' - ``` - - You will need to pass the path to this file to `./meson_init.sh` using the `-t FILE` option. - +Alternatively, manually download the file starting with `lowrisc-toolchain-rv32imcb-` from [GitHub releases](https://github.com/lowRISC/lowrisc-toolchains/releases/latest) and unpack it to the desired installation directory. ### OpenOCD diff --git a/util/container/Dockerfile b/util/container/Dockerfile index 17d69fbbbb450..fb7fb37657c68 100644 --- a/util/container/Dockerfile +++ b/util/container/Dockerfile @@ -10,7 +10,7 @@ ARG VERILATOR_VERSION=4.210 ARG OPENOCD_VERSION=0.11.0 ARG VERIBLE_VERSION=v0.0-1213-g9e5c085 # The RISCV toolchain version should match the release tag used in GitHub. -ARG RISCV_TOOLCHAIN_TAR_VERSION=20210412-1 +ARG RISCV_TOOLCHAIN_TAR_VERSION=20220210-1 ARG RUST_VERSION=1.55.0 # Main container image. diff --git a/util/get-toolchain.py b/util/get-toolchain.py index 957a5199b3272..18297c2804e81 100755 --- a/util/get-toolchain.py +++ b/util/get-toolchain.py @@ -19,8 +19,8 @@ # the keys in this dictionary specify valid toolchain kinds ASSET_PREFIXES = { # kind : prefix, - "combined": "lowrisc-toolchain-rv32imc-", - "gcc-only": "lowrisc-toolchain-gcc-rv32imc-", + "combined": "lowrisc-toolchain-rv32imcb-", + "gcc-only": "lowrisc-toolchain-gcc-rv32imcb-", } ASSET_SUFFIX = ".tar.xz" RELEASES_URL_BASE = 'https://api.github.com/repos/lowRISC/lowrisc-toolchains/releases'