forked from tum-ei-eda/etiss
-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (123 loc) · 6.38 KB
/
ci.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
134
135
136
137
138
139
140
141
name: CI
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
config:
- {name: "Linux", os: ubuntu-latest, cmakegen: "", llvm: "linux-gnu-ubuntu-20.04", llvm-ext: ".tar.xz", tc: "linux-ubuntu14", tc-ext: ".tar.gz", unpack: "tar xf"}
- {name: "Windows", os: windows-latest, cmakegen: "-G \"Unix Makefiles\" -DCMAKE_MAKE_PROGRAM=make", llvm: "", llvm-ext: "", tc: "w64-mingw32", tc-ext: ".zip", unpack: "unzip"}
- {name: "Mac", os: macOS-latest, cmakegen: "", llvm: "apple-darwin", llvm-ext: ".tar.xz", tc: "apple-darwin", tc-ext: ".tar.gz", unpack: "tar xf"}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.name }}
steps:
- uses: actions/checkout@v2
- name: Requirements (Linux)
if: matrix.config.name == 'Linux'
run: |
sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-program-options-dev
- name: Requirements (Windows)
if: matrix.config.name == 'Windows'
shell: bash
run: |
choco install boost-msvc-14.2
choco install wget unzip
choco install llvm
choco install make
- name: Requirements (Mac)
if: matrix.config.name == 'Mac'
run: |
brew install boost coreutils
- name: Requirements (Linux/Mac)
if: matrix.config.name == 'Linux' || matrix.config.name == 'Mac'
working-directory: ${{runner.workspace}}
shell: bash
run: |
LLVM_NAME="clang+llvm-11.0.0-x86_64-${{ matrix.config.llvm }}"
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/$LLVM_NAME${{ matrix.config.llvm-ext }}
${{ matrix.config.unpack }} $LLVM_NAME${{ matrix.config.llvm-ext }}
mv $LLVM_NAME llvm-lib
- name: Requirements
shell: bash
working-directory: ${{runner.workspace}}
run: |
TC_NAME="riscv64-unknown-elf-gcc-8.3.0-2020.04.0-x86_64-${{ matrix.config.tc }}"
wget https://static.dev.sifive.com/dev-tools/$TC_NAME${{ matrix.config.tc-ext }}
${{ matrix.config.unpack }} $TC_NAME${{ matrix.config.tc-ext }}
mv $TC_NAME riscv-tc
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
export LLVM_DIR=${{runner.workspace}}/llvm-lib
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=../install
- name: Build
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Install
working-directory: ${{runner.workspace}}/build
shell: bash
run: cmake --build . --config $BUILD_TYPE --target install
- name: Create Test Build Environment
run: |
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv/build
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv/build64
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_cpp/build
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_cpp/build64
cmake -E make_directory ${{runner.workspace}}/install/examples/bare_etiss_processor/build
- name: Setup tests
working-directory: ${{runner.workspace}}/install/examples
shell: bash
run: |
cd SW/riscv/build
cmake .. -DRISCV_ELF_GCC_PREFIX=../../../../../riscv-tc -DRISCV_ELF_GCC_BASENAME=riscv64-unknown-elf ${{matrix.config.cmakegen}}
cmake --build . --config $BUILD_TYPE
cd -
cd SW/riscv/build64
cmake .. -DRISCV_ELF_GCC_PREFIX=../../../../../riscv-tc -DRISCV_ELF_GCC_BASENAME=riscv64-unknown-elf -DRISCV_ARCH=rv64gc -DRISCV_ABI=lp64d ${{matrix.config.cmakegen}}
cmake --build . --config $BUILD_TYPE
cd -
cd SW/riscv_cpp/build
cmake .. -DRISCV_ELF_GCC_PREFIX=../../../../../riscv-tc -DRISCV_ELF_GCC_BASENAME=riscv64-unknown-elf ${{matrix.config.cmakegen}}
cmake --build . --config $BUILD_TYPE
cd -
cd SW/riscv_cpp/build64
cmake .. -DRISCV_ELF_GCC_PREFIX=../../../../../riscv-tc -DRISCV_ELF_GCC_BASENAME=riscv64-unknown-elf -DRISCV_ARCH=rv64gc -DRISCV_ABI=lp64d ${{matrix.config.cmakegen}}
cmake --build . --config $BUILD_TYPE
cd -
cd bare_etiss_processor
cd build
cmake ..
cmake --build . --config $BUILD_TYPE
- name: Test (Linux/Mac)
working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor
#if: matrix.config.name == 'Linux' || matrix.config.name == 'Mac'
if: matrix.config.name == 'Linux'
shell: bash
run: |
./run_helper.sh ../SW/riscv/build/riscv_example.elf
./run_helper.sh ../SW/riscv/build/riscv_example.elf gcc
./run_helper.sh ../SW/riscv/build/riscv_example.elf llvm
./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf
./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf gcc
./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf llvm
./run_helper.sh ../SW/riscv/build64/riscv_example.elf
./run_helper.sh ../SW/riscv_cpp/build64/riscv_example.elf
- name: Test (Windows)
working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor/build
if: matrix.config.name == 'Windows'
shell: bash
run: |
PATH=$PATH:/d/a/etiss/install/lib/
cd $BUILD_TYPE
./main.exe --vp.elf_file=../../../SW/riscv/build/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv/build/riscv_example.elf --jit.type=LLVMJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv_cpp/build/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv_cpp/build/riscv_example.elf --jit.type=LLVMJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv/build64/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv/memsegs.ini -pLogger
./main.exe --vp.elf_file=../../../SW/riscv_cpp/build64/riscv_example.elf --jit.type=TCCJIT --etiss.loglevel=4 -i../../../SW/riscv_cpp/memsegs.ini -pLogger