-
Notifications
You must be signed in to change notification settings - Fork 10
163 lines (131 loc) · 4.43 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- name: Checkout Muntjac
uses: actions/checkout@v4
- name: Install Verilator
run: |
VERILATOR_VERSION=v4.210
wget https://storage.googleapis.com/verilator-builds/verilator-"$VERILATOR_VERSION".tar.gz
sudo mkdir -p /tools/verilator
sudo chmod 777 /tools/verilator
sudo tar -C /tools/verilator -xvzf verilator-"$VERILATOR_VERSION".tar.gz
echo "/tools/verilator/$VERILATOR_VERSION/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: pip3 install setuptools wheel
- name: Install FuseSoC
run: pip3 install -r python-requirements.txt
- name: Run lint
run: make lint
simulator-build:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- name: pipeline
sim: muntjac_pipeline
- name: core
sim: muntjac_core
steps:
- name: Checkout Muntjac
uses: actions/checkout@v4
- name: Install Verilator
run: |
VERILATOR_VERSION=v4.210
wget https://storage.googleapis.com/verilator-builds/verilator-"$VERILATOR_VERSION".tar.gz
sudo mkdir -p /tools/verilator
sudo chmod 777 /tools/verilator
sudo tar -C /tools/verilator -xvzf verilator-"$VERILATOR_VERSION".tar.gz
echo "/tools/verilator/$VERILATOR_VERSION/bin" >> $GITHUB_PATH
- name: Install Python dependencies
run: pip3 install setuptools wheel
- name: Install FuseSoC
run: pip3 install -r python-requirements.txt
- name: Run build
run: make sim-${{ matrix.name }}
- name: Upload simulator
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.sim }}
path: bin/${{ matrix.sim }}
if-no-files-found: error
riscv-tests-build:
runs-on: ubuntu-22.04
steps:
- name: Checkout Muntjac
uses: actions/checkout@v4
- name: Checkout riscv-tests
uses: actions/checkout@v4
with:
repository: riscv/riscv-tests
ref: c4217d88bce9f805a81f42e86ff56ed363931d69
submodules: recursive
path: riscv-tests
- name: Override with custom link.ld
run: |
cp flows/link.ld riscv-tests/env/p/link.ld
- name: Download compiler toolchain
uses: i3h/download-release-asset@v1
with:
owner: lowRISC
repo: lowrisc-toolchains
tag: 20230427-1
file: lowrisc-toolchain-gcc-rv64imac-20230427-1.tar.xz
# Also add the tools to PATH for next step.
- name: Extract compiler toolchain
run: |
tar -xf lowrisc-toolchain-gcc-rv64imac-20230427-1.tar.xz
echo "`pwd`/lowrisc-toolchain-gcc-rv64imac-20230427-1/bin" >> $GITHUB_PATH
# All tests except breakpoint - it is not part of the core specification.
- name: Build ISA tests
run: |
cd riscv-tests/isa
make -j$(nproc)
rm *.dump
rm rv64mi-p-breakpoint
tar -cjf ~/riscv-isa-tests.tar.xz *
- name: Upload test binaries
uses: actions/upload-artifact@v4
with:
name: riscv-isa-tests
path: ~/riscv-isa-tests.tar.xz
if-no-files-found: error
riscv-tests-run:
runs-on: ubuntu-22.04
needs: [simulator-build, riscv-tests-build]
strategy:
matrix:
include:
- name: pipeline
sim: muntjac_pipeline
- name: core
sim: muntjac_core
steps:
- name: Checkout Muntjac
uses: actions/checkout@v4
- name: Get simulator
uses: actions/download-artifact@v4
with:
name: ${{ matrix.sim }}
- name: Get tests
uses: actions/download-artifact@v4
with:
name: riscv-isa-tests
- name: Unpack tests
run: |
mkdir tests
tar -xf riscv-isa-tests.tar.xz -C tests
# Create a summary of each test outcome in the JUnit XML format.
- name: Run tests
run: |
chmod +x ${{ matrix.sim }}
make -f test/riscv-tests/Makefile results.xml -j$(nproc) TEST_DIR=tests MUNTJAC_SIM=./${{ matrix.sim }}
- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: riscv-tests-${{ matrix.name }}
path: results.xml
if-no-files-found: error