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

Run Gemmini tests in CI #243

Merged
merged 10 commits into from
Oct 5, 2022
51 changes: 51 additions & 0 deletions .github/workflows/gemmini.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Gemmini CI
on:
push:
branches:
- master
pull_request:
jobs:
gemmini:
runs-on: ubuntu-latest

container:
image: ghcr.io/exo-lang/gemmini:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: exo-lang/gemmini-rocc-tests
ref: exo
submodules: recursive
path: gemmini-rocc-tests

- uses: actions/setup-python@v2

- name: Generate code with Exo
run: |
python -m pip install -r requirements.txt
pytest tests/gemmini/matmul/test_gemmini_matmul.py tests/gemmini/conv/test_gemmini_conv.py

- name: Build GEMMINI tests
run: ./build.sh
env:
# TODO: these need to be fixed rather than removed, but there are so many that the logs are not interpretable
CFLAGS: -Wno-pointer-to-int-cast -Wno-discarded-qualifiers -Wno-int-to-pointer-cast -I ${GITHUB_WORKSPACE}/tests/gemmini/gemmini_build -I ${GITHUB_WORKSPACE}/src/exo/libs
working-directory: gemmini-rocc-tests

- name: Run GEMMINI tests
run: |
spike --extension=gemmini tiled_matmul_ws-baremetal
spike --extension=gemmini tiled_matmul_ws-2-baremetal
spike --extension=gemmini tiled_matmul_ws-3-baremetal
spike --extension=gemmini tiled_matmul_ws-4-baremetal
spike --extension=gemmini tiled_matmul_ws-5-baremetal
spike --extension=gemmini tiled_matmul_ws-6-baremetal
spike --extension=gemmini conv-baremetal
spike --extension=gemmini conv-2-baremetal
spike --extension=gemmini conv-3-baremetal
working-directory: gemmini-rocc-tests/build/bareMetalC
22 changes: 0 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,8 @@ jobs:
- name: Run tox
run: tox

# - name: Build package
# run: python -m build
#
# - name: Install package
# run: pip install dist/*.whl

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

# # Skip running on macOS since the SDE simulator is too slow there
# - name: Install apps deps
# if: runner.os == 'Linux'
# run: |
# sudo apt update
# sudo apt install g++-11

# - name: Build apps with CMake
# if: runner.os == 'Linux'
# run: ./apps/build.sh

# - name: Check apps run with CMake
# if: runner.os == 'Linux'
# run: ctest --output-on-failure
# working-directory: build
11 changes: 2 additions & 9 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2

- name: Install Python dependencies
run: |
python -m pip install -U pip
Expand All @@ -19,15 +21,6 @@ jobs:
- name: Build Python package
run: python -m build --sdist --wheel --outdir dist/ .

- name: Install Python package
run: python -m pip install dist/*.whl

- name: Test that exocc runs
run: exocc -o tmp --stem conv apps/x86_demo/conv/conv.py

- name: Show generated C code (manual inspection for now)
run: cat tmp/conv.c

# Will only run on release.
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
Expand Down
9 changes: 4 additions & 5 deletions tests/gemmini/harness_gemmini.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@

from exo import compile_procs

# TODO: actually fix this
RISCV = None
GEMMINI_ROOT = os.getenv('GEMMINI_ROOT')
if GEMMINI_ROOT is None:
RISCV = os.getenv('RISCV')
if RISCV is None:
pass
else:
# RISCV = os.getenv('RISCV')
if RISCV is not None:
GEMMINI_ROOT = os.path.join(RISCV,'..','generators','gemmini')


if RISCV is not None:
GEMMINI_ROOT = os.path.abspath(GEMMINI_ROOT)
CHIPYARD_ROOT = os.path.abspath(os.path.join(GEMMINI_ROOT,'..','..'))
Expand Down