reset now correctly zeroes out all registers #49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - '**.hpp' | |
| - '**.cpp' | |
| - '**.h' | |
| - '**.c' | |
| - '**.S' | |
| - '**CMakeLists.txt' | |
| - '.github/workflows/**' | |
| - 'conanfile.py' | |
| pull_request: | |
| paths: | |
| - '**.hpp' | |
| - '**.cpp' | |
| - '**.h' | |
| - '**.c' | |
| - '**.S' | |
| - '**CMakeLists.txt' | |
| - '.github/workflows/**' | |
| - 'conanfile.py' | |
| jobs: | |
| cpp-compliance: | |
| name: C++ Std Compliance (C++${{ matrix.cpp_std }}) | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| cpp_std: [17, 20] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Update submodules | |
| run: git submodule update --init --recursive | |
| - name: Cache Conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan2 | |
| key: conan-${{ runner.os }}-unit-cpp${{ matrix.cpp_std }}-${{ hashFiles('conanfile.py') }} | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get install -y g++ python3-pip cmake llvm-19-dev | |
| pip3 install conan | |
| cmake --version | |
| - name: Configure | |
| run: cmake --preset Release -B build -DCMAKE_CXX_STANDARD=${{ matrix.cpp_std }} -DWITH_LLVM=ON -DWITH_SYSTEM_LLVM=ON | |
| - name: Build | |
| run: cmake --build build -j | |
| - name: Smoke test | |
| run: ./build/riscv-sim -h | |
| # NOTE: .so filename is tied to VERSION in top-level CMakeLists.txt - update both together | |
| - name: Upload binary | |
| if: matrix.cpp_std == 20 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: riscv-sim | |
| path: | | |
| build/riscv-sim | |
| build/libdbt-rise-riscv.so.2.1.0 | |
| pmp-tests: | |
| name: PMP Functional Tests | |
| runs-on: ubuntu-24.04 | |
| needs: cpp-compliance | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install RISC-V toolchain | |
| run: sudo apt-get install -y gcc-riscv64-unknown-elf | |
| - name: Download riscv-sim binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: riscv-sim | |
| - name: Make binary executable | |
| run: chmod +x riscv-sim | |
| - name: Build PMP CSR test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_csr_test \ | |
| contrib/fw/pmp-csr-test/pmp_csr_test.S | |
| - name: rv64gc_m CSR test - interp (no PMP, expect exit 2) | |
| run: | | |
| LD_LIBRARY_PATH=. ./riscv-sim -f pmp_csr_test --isa rv64gc_m --backend interp || rc=$? | |
| [ "${rc:-0}" -eq 2 ] | |
| - name: rv64gc_mp_64 CSR test - interp (with PMP) | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_csr_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP enforcement test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_enforce_test \ | |
| contrib/fw/pmp-enforce-test/pmp_enforce_test.S | |
| - name: rv64gc_mp_64 enforcement test - interp | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_enforce_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP shift test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_shift_test \ | |
| contrib/fw/pmp-shift-test/pmp_shift_test.S | |
| - name: rv64gc_mp_64 shift test - interp | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_shift_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP upper-cfg test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_upper_cfg_test \ | |
| contrib/fw/pmp-upper-cfg-test/pmp_upper_cfg_test.S | |
| - name: rv64gc_mp_64 upper-cfg test - interp | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_upper_cfg_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP cfg2 test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_cfg2_test \ | |
| contrib/fw/pmp-cfg2-test/pmp_cfg2_test.S | |
| - name: rv64gc_mp_64 cfg2 test - interp | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_cfg2_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP TOR test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_tor_test \ | |
| contrib/fw/pmp-tor-test/pmp_tor_test.S | |
| - name: rv64gc_mp_64 TOR test - interp | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_tor_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP 64-entry pmpaddr test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_64entry_addr_test \ | |
| contrib/fw/pmp-64entry-addr-test/pmp_64entry_addr_test.S | |
| - name: rv64gc_mp_64 64-entry pmpaddr test - interp | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_64entry_addr_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP 64-entry pmpcfg test firmware | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_64entry_cfg_test \ | |
| contrib/fw/pmp-64entry-cfg-test/pmp_64entry_cfg_test.S | |
| - name: rv64gc_mp_64 64-entry pmpcfg test - interp | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_64entry_cfg_test --isa rv64gc_mp_64 --backend interp | |
| - name: Build PMP 8-entry guard test firmware (VP/S5 model) | |
| run: | | |
| riscv64-unknown-elf-gcc -nostdlib -march=rv64gc -mabi=lp64 \ | |
| -Wl,-Ttext=0x10000,--no-dynamic-linker \ | |
| -o pmp_8entry_guard_test \ | |
| contrib/fw/pmp-8entry-guard-test/pmp_8entry_guard_test.S | |
| - name: rv64gc_mp_8 8-entry enforcement test - interp (VP/S5 model) | |
| run: LD_LIBRARY_PATH=. ./riscv-sim -f pmp_8entry_guard_test --isa rv64gc_mp_8 --backend interp |