Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic actions #77

Merged
merged 2 commits into from
May 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
CMAKE_BUILD_TYPE: Release

jobs:
software:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt install srecord
sudo mkdir -p /tools/riscv
sudo chmod 777 /tools/riscv
curl -Ls -o rv32-toolchain.tar.xz "https://github.com/lowRISC/lowrisc-toolchains/releases/download/20230427-1/lowrisc-toolchain-gcc-rv32imcb-20230427-1.tar.xz"
sudo tar -C /tools/riscv -xf rv32-toolchain.tar.xz --strip-components=1
echo "/tools/riscv/bin" >> $GITHUB_PATH

- name: Clang lint
run: find -name "*.[cc|c|h]" -exec clang-format -n {} \;

- name: Configure CMake for legacy software
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
mkdir build
cd build
cmake ..
working-directory: sw/legacy

- name: Build legacy software
# Build your software with the given configuration
run: |
make
working-directory: sw/legacy/build

simulator:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt install verilator libelf-dev
pip install -r python-requirements.txt

- name: Build Verilator simulator
run: |
fusesoc --cores-root=. run --target=sim --tool=verilator --setup --build lowrisc:sonata:system --verilator_options="+define+RVFI"