69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
name: Build
|
|
|
|
on: push
|
|
|
|
jobs:
|
|
|
|
# lint:
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/checkout@master
|
|
# - uses: chipsalliance/verible-linter-action@main
|
|
# # with:
|
|
# # paths: |
|
|
# # ./src
|
|
# # ./lib
|
|
# # ./tests
|
|
# # extra_args: "--check_syntax=true"
|
|
|
|
# enumerate-tests:
|
|
# name: Enumerate tests
|
|
# runs-on: ubuntu-latest
|
|
# outputs:
|
|
# matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
# steps:
|
|
# - uses: actions/checkout@v2
|
|
# - id: set-matrix
|
|
# run: echo "::set-output name=matrix::$(ls tests | grep test_* | jq -R -s -c 'split("\n")[:-1]')"
|
|
|
|
test:
|
|
# needs: enumerate-tests
|
|
name: Run Test `${{ matrix.test }}`
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
# test: ${{ fromJson(needs.enumerate-tests.outputs.matrix) }}
|
|
test:
|
|
- test_basic
|
|
- test_c
|
|
max-parallel: 1
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build executables
|
|
uses: docker://runtimeverificationinc/riscv-gnu-toolchain:ubuntu-jammy-2024.04.12
|
|
with:
|
|
entrypoint: sh
|
|
args: |
|
|
-c "\
|
|
cd tests/${{ matrix.test }} && \
|
|
make obj && \
|
|
riscv64-unknown-elf-ld -melf32lriscv -T tb.ld *.o -o tb.elf && \
|
|
riscv64-unknown-elf-objcopy --target=verilog tb.elf tb.hex && \
|
|
riscv64-unknown-elf-objdump -xhdtsf tb.elf && \
|
|
echo "done" \
|
|
"
|
|
|
|
- name: Run Simulation
|
|
uses: docker://brendanhaines/iverilog:latest
|
|
with:
|
|
entrypoint: bash
|
|
args: |
|
|
-c "\
|
|
cd tests/${{ matrix.test }} && \
|
|
iverilog -g2012 -o tb.out tb.sv ../../src/*.v -Y .sv -I ../../lib && \
|
|
./tb.out | tee tb.log &&\
|
|
grep -q "ERROR" tb.log || true &&\
|
|
grep -q "SUCCESS" tb.log &&\
|
|
echo "done"
|
|
"
|