Skip to content

Commit

Permalink
Consolidate on XPack GCC and move to Github Actions (#99)
Browse files Browse the repository at this point in the history
* Use Github Actions instead of Azure

* Use riscv-none-elf from Xpack project.
  • Loading branch information
erlingrj authored Sep 16, 2024
1 parent 32f8817 commit 167a18b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 57 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Continuous Integration

on: [push, pull_request]

jobs:
ci:
name: ci
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Scala
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]
- name: Cache Scala
uses: coursier/cache-action@v5
- name: Install dependencies
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: |
source env.bash
cd sdk && cmake -B build && cd build && make && ctest
- name: Run multithreaded C tests
run: |
source env.bash
# Run multiple tests with script
./scripts/run_multiple_tests.sh
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ For more information on the processor architecture:
# Tools and installation

## RISC-V Compiler
We use the Newlib installation of the [rv32i-4.0.0](https://github.com/stnolting/riscv-gcc-prebuilt). Download and extract it to a convenient location on the PATH. Also set the `RISCV_TOOL_PATH_PREFIX` environment variable to the location of `bin/`. E.g., if you extracted the compiler to `/opt/riscv`, then `export RISCV_TOOL_PATH_PREFIX=/opt/riscv` is needed. We recommend adding this to your `~/.bashrc`.
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.

```
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.
Expand Down
55 changes: 0 additions & 55 deletions azure-pipelines.yml

This file was deleted.

2 changes: 1 addition & 1 deletion sdk/cmake/riscv-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down

0 comments on commit 167a18b

Please sign in to comment.