Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 0 additions & 6 deletions .dockerignore

This file was deleted.

86 changes: 59 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
runs-on: ubuntu-22.04
# Export Docker image name used by dependent jobs
outputs:
image_name: ${{ steps.image_name.outputs.image_name }}
hw_image_name: ${{ steps.image_name.outputs.hw_image_name }}
sw_image_name: ${{ steps.image_name.outputs.sw_image_name }}
steps:
- name: Define Docker image name
id: image_name
Expand All @@ -33,30 +34,50 @@ jobs:
echo "Sanitized GITHUB_REF_NAME: $SANITIZED_REF_NAME"
SANITIZED_REPO_NAME="$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')"
echo "Sanitized GITHUB_REPOSITORY: $SANITIZED_REPO_NAME"
IMAGE_NAME="ghcr.io/${SANITIZED_REPO_NAME}:${SANITIZED_REF_NAME}"
echo "Image name: $IMAGE_NAME"
echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT
HW_IMAGE_NAME="ghcr.io/${SANITIZED_REPO_NAME}-hw:${SANITIZED_REF_NAME}"
SW_IMAGE_NAME="ghcr.io/${SANITIZED_REPO_NAME}-sw:${SANITIZED_REF_NAME}"
echo "HW image name: $HW_IMAGE_NAME"
echo "SW image name: $SW_IMAGE_NAME"
{
echo "hw_image_name=$HW_IMAGE_NAME"
echo "sw_image_name=$SW_IMAGE_NAME"
} >> $GITHUB_OUTPUT
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
docker-images: false
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: docker/setup-buildx-action@v3
- name: GHCR Log-in
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
# Build and push hardware container
- name: Build and push (hw container)
uses: docker/build-push-action@v6
with:
context: .
file: util/container/Dockerfile
target: snitch_cluster-hw
cache-from: type=gha
cache-to: type=gha,mode=max`
cache-to: type=gha,mode=max
push: true
tags: ${{ steps.image_name.outputs.hw_image_name }}
# Build and push software container
- name: Build and push (sw container)
uses: docker/build-push-action@v6
with:
context: .
file: util/container/Dockerfile
target: snitch_cluster-sw
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ${{ steps.image_name.outputs.image_name }}
tags: ${{ steps.image_name.outputs.sw_image_name }}

########
# Docs #
Expand All @@ -67,9 +88,11 @@ jobs:
runs-on: ubuntu-22.04
needs: build-docker
container:
image: ${{ needs.build-docker.outputs.image_name }}
image: ${{ needs.build-docker.outputs.hw_image_name }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build docs
run: make docs

Expand All @@ -79,9 +102,11 @@ jobs:
needs: build-docker
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
container:
image: ${{ needs.build-docker.outputs.image_name }}
image: ${{ needs.build-docker.outputs.hw_image_name }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
# For some reason, the checkout is done by a different user
# than that deploying to Github (root, possibly due to Docker).
# So we need to set the repository as a safe directory.
Expand All @@ -104,7 +129,7 @@ jobs:
runs-on: ubuntu-22.04
needs: build-docker
container:
image: ${{ needs.build-docker.outputs.image_name }}
image: ${{ needs.build-docker.outputs.hw_image_name }}
steps:
- uses: actions/checkout@v4
- name: Run pytest
Expand All @@ -114,71 +139,78 @@ jobs:
# Simulate SW on Snitch Cluster w/ Verilator #
##############################################

sw-snitch-cluster-vlt:
name: Simulate SW on Snitch Cluster w/ Verilator
snitch-cluster-vlt:
name: Build Snitch Cluster w/ Verilator
runs-on: ubuntu-22.04
needs: build-docker
container:
image: ${{ needs.build-docker.outputs.image_name }}
image: ${{ needs.build-docker.outputs.hw_image_name }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Hash Verilator prerequisites
id: verilator-hash
uses: colluca/list-make-prerequisites@v1.0.3
uses: colluca/pymakeutils@v1.2.0
with:
working-directory: target/snitch_cluster
target: verilator
flags: --recursive
- name: Set up cache for Verilator build
id: verilator-cache
uses: actions/cache@v4
with:
path: target/snitch_cluster/bin
path: target/sim/build/bin
key: verilator-${{ steps.verilator-hash.outputs.hash }}
restore-keys: |
verilator-
- name: Build Hardware
if: steps.verilator-cache.outputs.cache-hit != 'true'
working-directory: target/snitch_cluster
run: |
make CFG_OVERRIDE=cfg/github-ci.json VLT_JOBS=1 verilator

sw-snitch-cluster-vlt:
name: Simulate SW on Snitch Cluster w/ Verilator
runs-on: ubuntu-22.04
needs: build-docker
container:
image: ${{ needs.build-docker.outputs.sw_image_name }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build Software
working-directory: target/snitch_cluster
run: |
make CFG_OVERRIDE=cfg/github-ci.json sw -j
make sw -j
- name: Run Tests
working-directory: target/snitch_cluster
working-directory: test
run: |
./util/run.py sw/run.yaml --simulator verilator -j
./util/run.py sw/riscv_tests_isa.yaml --simulator verilator -j
../util/experiments/run.py run.yaml --simulator verilator -j
../util/experiments/run.py riscv_tests_isa.yaml --simulator verilator -j
- name: Annotate traces
working-directory: target/snitch_cluster
# Build the traces using the --permissive flag, since the Verilator
# testbench does not wait until all the instructions are retired
# (compiler introduces few instructions after exit routine).
run: |
make SIM_DIR=./runs/simple DEBUG=ON annotate -j
make SIM_DIR=./test/runs/simple DEBUG=ON annotate -j

######################
# Sources Up-to-Date #
######################

sources-up-to-date:
name: Check Sources Up-to-Date
runs-on: ubuntu-22.04
needs: build-docker
container:
image: ${{ needs.build-docker.outputs.image_name }}
image: ${{ needs.build-docker.outputs.hw_image_name }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Generate opcodes
run: |
./util/generate-opcodes.sh
./util/clustergen/generate-opcodes.sh
- name: Generate RTL sources
working-directory: target/snitch_cluster
run: |
make rtl
# For some reason, the checkout is done by a different user,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
# yamllint enable rule:line-length
match_regex: true
exclude_paths: |
sw/snRuntime/src/omp/interface.h
sw/runtime/src/omp/interface.h
hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg_pkg.sv
hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg.sv
hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg.svh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/nonfree/**
!/nonfree/util
!/nonfree/util/.gitignore
.cockpitgroup

# Dependency files
/.bender/
Expand Down
44 changes: 22 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ pytest:
snitch-cluster-sw:
needs: [setup]
script:
- cd target/snitch_cluster
- make sw -j
artifacts:
paths:
- target/snitch_cluster/sw/**/build/*.elf
- sw/**/build/*.elf
expire_in: 1 day

#######################
Expand Down Expand Up @@ -105,74 +104,75 @@ snitch-ip-tests:
snitch-cluster-vlt:
needs: [setup, snitch-cluster-sw]
script:
- cd target/snitch_cluster
- make verilator
- ./util/run.py sw/run.yaml --simulator verilator -j --run-dir runs/vlt
- cd test
- ../util/experiments/run.py run.yaml --simulator verilator -j --run-dir runs/vlt

# # VCS
# snitch-cluster-vcs:
# needs: [setup, snitch-cluster-sw]
# script:
# - cd target/snitch_cluster
# - make vcs
# - ./util/run.py sw/run.yaml --simulator vcs -j --run-dir runs/vcs
# - cd test
# - ../util/experiments/run.py run.yaml --simulator vcs -j --run-dir runs/vcs

# Questa
snitch-cluster-vsim:
needs: [setup, snitch-cluster-sw]
script:
- cd target/snitch_cluster
- make vsim -j
- ./util/run.py sw/run.yaml --simulator vsim -j --run-dir runs/vsim
- ./util/run.py sw/riscv_tests_isa.yaml --simulator vsim -j --run-dir runs/vsim
- cd test
- ../util/experiments/run.py run.yaml --simulator vsim -j --run-dir runs/vsim
- ../util/experiments/run.py riscv_tests_isa.yaml --simulator vsim -j --run-dir runs/vsim
# Test trace annotation
- make SIM_DIR=./runs/vsim/simple annotate -j
- make -C .. SIM_DIR=$(PWD)/runs/vsim/simple annotate -j
# Run additional, more extensive tests
- cd sw/apps/blas/gemm/test && ./test.sh && cd -
- cd sw/apps/dnn/transpose/test && ./test.sh && cd -
- cd sw/apps/dnn/flashattention_2/test && ./test.sh && cd -
- cd blas/gemm && ./test.sh && cd -
- cd dnn/transpose && ./test.sh && cd -
- cd dnn/flashattention_2 && ./test.sh && cd -

# Test OmegaNet TCDM interconnect
snitch-cluster-omega-vsim:
needs: [setup]
script:
- cd target/snitch_cluster
- make CFG_OVERRIDE=cfg/omega.json sw -j
- make vsim -j
- ./util/run.py sw/run.yaml --simulator vsim -j --run-dir runs/vsim
- cd test
- ../util/experiments/run.py run.yaml --simulator vsim -j --run-dir runs/vsim

# Test Multi-channel DMA
snitch-cluster-mchan-vsim:
needs: [setup]
script:
- cd target/snitch_cluster
- make CFG_OVERRIDE=cfg/dma_mchan.json sw -j
- make vsim -j
- ./util/run.py sw/dma_mchan.yaml --simulator vsim -j --run-dir runs/vsim
- cd test
- ../util/experiments/run.py dma_mchan.yaml --simulator vsim -j --run-dir runs/vsim

# Additional tests for different FREP configurations
snitch-cluster-frep-vsim:
needs: [setup]
script:
- cd target/snitch_cluster
# Large FREP configuration
- make CFG_OVERRIDE=cfg/frep_xl.json sw -j
- make vsim -j
- ./util/run.py sw/frep_xl.yaml --simulator vsim -j --run-dir runs/vsim
- cd test
- ../util/experiments/run.py frep_xl.yaml --simulator vsim -j --run-dir runs/vsim
- cd -
# Small FREP configuration
- make CFG_OVERRIDE=cfg/frep_xs.json sw -j
- make vsim -j
- ./util/run.py sw/frep_xs.yaml --simulator vsim -j --run-dir runs/vsim
- cd test
- ../util/experiments/run.py frep_xs.yaml --simulator vsim -j --run-dir runs/vsim

# COPIFT and scalar chaining experiments
snitch-cluster-copift-sc-vsim:
needs: [setup]
script:
- cd target/snitch_cluster
- make CFG_OVERRIDE=experiments/copift/cfg.json vsim -j
- cd experiments/copift
- ./experiments.py experiments.yaml --actions sw run perf -j
- cd ../../experiments/chaining
- cd ../chaining
- ./experiments.py experiments.yaml --actions sw run perf -j

############
Expand Down
2 changes: 1 addition & 1 deletion Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
dependencies:
- common_cells
axi:
revision: bec548fa2a9b18cbd7531105bb1fdf481ea8ad49
revision: bd1abffc0812f8170902e5fb93142c7785c0b8c1
version: null
source:
Git: https://github.com/colluca/axi.git
Expand Down
Loading