Skip to content

Commit

Permalink
simutils.py: Correct to return exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Aug 8, 2023
1 parent 542d3a5 commit 5a1cec4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 65 deletions.
42 changes: 6 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,11 @@ jobs:
- name: Build Hardware
run: |
make -C target/snitch_cluster bin/snitch_cluster.vlt
- name: Run Unit Tests
- name: Run Tests
working-directory: target/snitch_cluster
run: |-
./sw/tests/run.py sw/tests/passing-apps.list --simulator verilator \
2>&1 | tee tests.log
- name: Run Test Applications
working-directory: target/snitch_cluster
env:
SNITCH_LOG: info
run: |-
./sw/apps/run.py sw/apps/passing-apps.list --simulator verilator \
2>&1 | tee apps.log
- name: Check Unit Tests
working-directory: target/snitch_cluster
run: |-
grep -zoP 'All tests passed' tests.log
- name: Check Test Applications
working-directory: target/snitch_cluster
run: |-
grep -zoP 'All tests passed' apps.log
./sw/tests/run.py sw/tests/passing-apps.list --simulator verilator
./sw/apps/run.py sw/apps/passing-apps.list --simulator verilator
############################################
# Build SW on Snitch Cluster w/ Banshee #
Expand Down Expand Up @@ -99,25 +84,10 @@ jobs:
- name: Build Software
run: |
make -C target/snitch_cluster SELECT_RUNTIME=banshee sw
- name: Run Unit Tests
working-directory: target/snitch_cluster
env:
SNITCH_LOG: info
run: |-
./sw/tests/run.py sw/tests/banshee-apps.list --simulator banshee \
2>&1 | tee tests.log
- name: Run Test Applications
working-directory: target/snitch_cluster
- name: Run Tests
env:
SNITCH_LOG: info
run: |-
./sw/apps/run.py sw/apps/passing-apps.list --simulator banshee \
2>&1 | tee apps.log
- name: Check Unit Tests
working-directory: target/snitch_cluster
run: |-
grep -zoP 'All tests passed' tests.log
- name: Check Test Applications
working-directory: target/snitch_cluster
run: |-
grep -zoP 'All tests passed' apps.log
./sw/tests/run.py sw/tests/banshee-apps.list --simulator banshee
./sw/apps/run.py sw/apps/passing-apps.list --simulator banshee
33 changes: 10 additions & 23 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ variables:
CLANG: /usr/pack/riscv-1.0-kgf/pulp-llvm-0.12.0/bin/clang
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: /usr/pack/gcc-9.2.0-af/linux-x64/bin/gcc
LLVM_SYS_120_PREFIX: /usr/pack/llvm-12.0.1-af
SNITCH_LOG: info
CMAKE: cmake-3.18.1

before_script:
Expand Down Expand Up @@ -111,42 +110,33 @@ snitch-cluster-vlt:
script:
- cd target/snitch_cluster
- $VERILATOR make bin/snitch_cluster.vlt
- $VERILATOR ./sw/tests/run.py sw/tests/passing-apps.list --simulator verilator 2>&1 | tee tests.log
- $VERILATOR ./sw/apps/run.py sw/apps/passing-apps.list --simulator verilator 2>&1 | tee apps.log
- grep -zoP 'All tests passed' tests.log
- grep -zoP 'All tests passed' apps.log
- $VERILATOR ./sw/tests/run.py sw/tests/passing-apps.list --simulator verilator
- $VERILATOR ./sw/apps/run.py sw/apps/passing-apps.list --simulator verilator
# yamllint enable rule:line-length

# VCS
snitch-cluster-vcs:
needs: [snitch-cluster-sw]
# yamllint disable rule:line-length
script:
- cd target/snitch_cluster
- $VCS make bin/snitch_cluster.vcs
- $VCS ./sw/tests/run.py sw/tests/passing-apps.list --simulator vcs 2>&1 | tee tests.log
- $VCS ./sw/apps/run.py sw/apps/passing-apps.list --simulator vcs 2>&1 | tee apps.log
- grep -zoP 'All tests passed' tests.log
- grep -zoP 'All tests passed' apps.log
# yamllint enable rule:line-length
- $VCS ./sw/tests/run.py sw/tests/passing-apps.list --simulator vcs
- $VCS ./sw/apps/run.py sw/apps/passing-apps.list --simulator vcs

# Questa
snitch-cluster-vsim:
needs: [snitch-cluster-sw]
# yamllint disable rule:line-length
script:
- cd target/snitch_cluster
- $QUESTA make bin/snitch_cluster.vsim
- $QUESTA ./sw/tests/run.py sw/tests/passing-apps.list --simulator vsim 2>&1 | tee tests.log
- $QUESTA ./sw/apps/run.py sw/apps/passing-apps.list --simulator vsim 2>&1 | tee apps.log
- grep -zoP 'All tests passed' tests.log
- grep -zoP 'All tests passed' apps.log
# yamllint enable rule:line-length
- $QUESTA ./sw/tests/run.py sw/tests/passing-apps.list --simulator vsim
- $QUESTA ./sw/apps/run.py sw/apps/passing-apps.list --simulator vsim

# Banshee
snitch-cluster-banshee:
needs: [snitch-cluster-sw-banshee]
# yamllint disable rule:line-length
variables:
SNITCH_LOG: info
script:
- rustup install 1.63.0
- rustup override set 1.63.0
Expand All @@ -156,8 +146,5 @@ snitch-cluster-banshee:
- cd banshee
- cargo install --path .
- cd ../target/snitch_cluster
- ./sw/tests/run.py sw/tests/banshee-apps.list --simulator banshee 2>&1 | tee tests.log
- ./sw/apps/run.py sw/apps/passing-apps.list --simulator banshee 2>&1 | tee apps.log
- grep -zoP 'All tests passed' tests.log
- grep -zoP 'All tests passed' apps.log
# yamllint enable rule:line-length
- ./sw/tests/run.py sw/tests/banshee-apps.list --simulator banshee
- ./sw/apps/run.py sw/apps/passing-apps.list --simulator banshee
2 changes: 1 addition & 1 deletion target/snitch_cluster/sw/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def main():


if __name__ == '__main__':
sys.exit(main())
main()
11 changes: 6 additions & 5 deletions util/simutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import subprocess
from termcolor import colored, cprint
import re
import sys


BANSHEE_CFG = 'src/banshee.yaml'
Expand Down Expand Up @@ -144,8 +145,8 @@ def run_tests(testlist, format_elf_path, simulator, dry_run=False, early_exit=Fa
# from a test name as listed in the test list file
def main(format_elf_path):
args = parse_args()
return run_tests(args.testlist,
format_elf_path,
args.simulator,
args.dry_run,
args.early_exit)
sys.exit(run_tests(args.testlist,
format_elf_path,
args.simulator,
args.dry_run,
args.early_exit))

0 comments on commit 5a1cec4

Please sign in to comment.