diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afcaef7..66c3a89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,24 +18,21 @@ jobs: - name: Cache Scala uses: coursier/cache-action@v5 - name: Install dependencies - run: sudo apt install verilator gcc-riscv64-unknown-elf cmake -y + run: | + sudo apt install verilator cmake -y + wget -q --show-progress https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v14.2.0-2/xpack-riscv-none-elf-gcc-14.2.0-2-linux-x64.tar.gz -O gcc.tar.gz + tar xvf gcc.tar.gz --directory=/opt + echo "RISCV_TOOL_PATH_PREFIX=/opt/xpack-riscv-none-elf-gcc-14.2.0-2" >> $GITHUB_ENV - name: Run Chisel unit tests run: sbt 'test' - name: Build emulator and SDK run: source env.bash && cmake -Bbuild && cd build && make all install - name: Run C tests run: | - # Set environment to find RISC-V compiler - export RISCV_TOOL_PATH_PREFIX=~/riscv-embed-gcc source env.bash - - # Step into SDK and run tests cd sdk && cmake -B build && cd build && make && ctest - name: Run multithreaded C tests run: | - # Set environment to find RISC-V compiler - export RISCV_TOOL_PATH_PREFIX=~/riscv-embed-gcc source env.bash - # Run multiple tests with script ./scripts/run_multiple_tests.sh \ No newline at end of file diff --git a/README.md b/README.md index cac6c19..e60da3d 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,17 @@ For more information on the processor architecture: # Tools and installation ## RISC-V Compiler -We use the Newlib version of RISC-V GCC which can be installed on Ubuntu with +We use the `riscv-none-elf-gcc` compiler provided by xPack project. To install this toolchain to `/opt/xpack-riscv-none-elf-gcc-14.2.0-2` perform the following steps. + ``` -sudo apt install gcc-riscv64-unknown-elf + wget -q --show-progress https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v14.2.0-2/xpack-riscv-none-elf-gcc-14.2.0-2-linux-x64.tar.gz -O gcc.tar.gz + tar xvf gcc.tar.gz --directory=/opt ``` + +Then add `export RISCV_TOOL_PATH_PREFIX=/opt/xpack-riscv-none-elf-gcc-14.2.0-2` to your `~/.bashrc` + +There are also versions for macOS and Windows. Refer to the [documentation](https://xpack-dev-tools.github.io/riscv-none-elf-gcc-xpack/) for more information. + ## Verilator We use the `verilator` toolchain for running emulations of the core. Install it and check that the version is greater than 4.038. diff --git a/sdk/cmake/riscv-toolchain.cmake b/sdk/cmake/riscv-toolchain.cmake index 555df18..f850dfc 100644 --- a/sdk/cmake/riscv-toolchain.cmake +++ b/sdk/cmake/riscv-toolchain.cmake @@ -20,7 +20,7 @@ set(RISCV_HOST_TAG linux) set(RISCV_TOOL_PATH $ENV{RISCV_TOOL_PATH_PREFIX} CACHE PATH "RISC-V tool path" FORCE) set(RISCV_TOOLCHAIN_ROOT "${RISCV_TOOL_PATH}/bin" CACHE PATH "RISC-V compiler path") -set(RISCV_TOOLCHAIN_PREFIX "riscv64-unknown-elf-" CACHE STRING "RISC-V toolchain prefix") +set(RISCV_TOOLCHAIN_PREFIX "riscv-none-elf-" CACHE STRING "RISC-V toolchain prefix") set(CMAKE_FIND_ROOT_PATH ${RISCV_TOOLCHAIN_ROOT}) list(APPEND CMAKE_PREFIX_PATH "${RISCV_TOOLCHAIN_ROOT}")