-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (129 loc) · 5.49 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
##
## Copyright (c) 2022 TUM Department of Electrical and Computer Engineering.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
# GitHub CI build pipeline
name: Run ETISS RISC-V Tests
on:
push:
branches:
- main
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8"]
xlen: [32, 64]
# xlen: [32]
# virt: ["p", "v"]
virt: ["p"]
exts: ["IMACFD"]
# jit: ["tcc", "gcc", "llvm"]
jit: ["tcc"]
runlevel: ["msu"]
# etiss-arch: ["RV32IMACFD", "RV64IMACFD"]
steps:
- name: Clone wrapper repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Initialize Virtualenv
run: |
python -m pip install --upgrade pip virtualenv
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
- name: Get riscv-gcc
# TODO: custom build + rvv + clang as alternative?
run: |
# sudo apt install -y gcc-riscv64-unknown-elf
cd /tmp/
wget -q https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
mkdir -p /opt/riscv/
tar xvf riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz --strip-components=1 -C /opt/riscv
echo "/opt/riscv/bin/" >> $GITHUB_PATH
cd -
# - name: Setup M2-ISA-R
# run: |
# source .venv/bin/activate
# cd M2-ISA-R
# pip install -e .
# - name: Run M2-ISA-R
# run: |
# source .venv/bin/activate
# python -m m2isar.frontends.coredsl2.parser etiss_arch_riscv/top.core_desc
# python -m m2isar.backends.etiss.writer etiss_arch_riscv/gen_model/top.m2isarmodel --static-scalars --separate
# # coredsl2_parser etiss_arch_riscv/top.core_desc
# # etiss_writer etiss_arch_riscv/gen_model/top.m2isarmodel --static-scalars --separate
# cp -r etiss_arch_riscv/gen_output/top/* etiss/ArchImpl/
# grep -qF -- "ADD_SUBDIRECTORY(RV${{ matrix.xlen }}${{ matrix.exts }})" etiss/ArchImpl/CMakeLists.txt || echo "ADD_SUBDIRECTORY(RV${{ matrix.xlen }}${{ matrix.exts }})" >> etiss/ArchImpl/CMakeLists.txt
- name: Setup ETISS
run: |
cd etiss
sudo apt install -y g++ libboost-system-dev libboost-filesystem-dev libboost-program-options-dev graphviz doxygen libtinfo-dev zlib1g-dev texinfo
cd PluginImpl
ln -s ../../etiss_riscv_tests/FileLoggerPlugin .
cd -
mkdir build
cmake -DCMAKE_BUILD_TYPE=Debug -B build/
cmake --build build/ -j `nproc`
- name: Setup riscv-tests
run: |
cd riscv-tests
autoconf
./configure
make RISCV_PREFIX=riscv64-unknown-elf- XLEN=${{ matrix.xlen }} isa -j `nproc`
- name: Setup etiss_riscv_tests
run: |
sudo apt install -y gdb
source .venv/bin/activate
cd etiss_riscv_tests
pip install -r requirements.txt
- name: Upper string case
id: string
uses: ASzc/change-string-case-action@v6
with:
string: ${{ matrix.exts }}
- name: Run etiss_riscv_tests
continue-on-error: true
run: |
source .venv/bin/activate
# etiss_riscv_tests/test.py --arch RV${{ matrix.xlen }}-${{ matrix.exts }} --bits ${{ matrix.xlen }} --ext ${{ steps.string.outputs.lowercase }} --virt p v --timeout 10 --jit ${{ matrix.jit }} riscv-tests/isa etiss/build/bin/bare_etiss_processor
# python etiss_riscv_tests/test.py --arch RV${{ matrix.xlen }}${{ matrix.exts }} --bits ${{ matrix.xlen }} --ext ${{ steps.string.outputs.lowercase }} --virt pv --timeout 10 --jit ${{ matrix.jit }} riscv-tests/isa etiss/build/bin/bare_etiss_processor --fail
python etiss_riscv_tests/test.py --arch RV${{ matrix.xlen }}${{ matrix.exts }} --bits ${{ matrix.xlen }} --ext ${{ steps.string.outputs.lowercase }} --virt ${{ matrix.virt }} --timeout 10 --jit ${{ matrix.jit }} --runlevel ${{ matrix.runlevel }} riscv-tests/isa etiss/build/bin/bare_etiss_processor && FAILED=0 || FAILED=1
python3 gen_summary.py results_* --etiss-dir etiss --etiss-arch-riscv-dir etiss_arch_riscv --m2isar-dir M2-ISA-R --riscv-tests-dir riscv-tests >> $GITHUB_STEP_SUMMARY
python3 gen_messages.py results_*
- name: Archive files
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: result-rv${{ matrix.xlen }}-${{ matrix.virt }}-${{ steps.string.outputs.lowercase }}-${{ matrix.jit }}-${{ matrix.runlevel }}
path: results_*
merge:
runs-on: ubuntu-latest
needs: test
steps:
- name: Clone wrapper repo
uses: actions/checkout@v4
- name: Download reports' artifacts
uses: actions/download-artifact@v4
- name: Check downloaded files
run: |
ls -l