-
Notifications
You must be signed in to change notification settings - Fork 191
323 lines (322 loc) · 13.3 KB
/
real-time-cpp-benchmarks.yml
File metadata and controls
323 lines (322 loc) · 13.3 KB
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
##############################################################################
# Copyright Christopher Kormanyos 2021 - 2025.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
name: real-time-cpp-benchmarks
on:
push:
branches:
- '**'
pull_request:
schedule:
- cron: '51 23 * * *' # run at 11:51 PM UTC
jobs:
benchmark_gcc-clang:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
standard: [ c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clone-submods-bootstrap-headers-boost-develop
run: |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
cd ../boost-root
git submodule update --init tools
git submodule update --init libs/config
git submodule update --init libs/math
git submodule update --init libs/multiprecision
./bootstrap.sh
./b2 headers
working-directory: ./
- name: clone-cppalliance-decimal
run: |
git clone -b develop --depth 1 https://github.com/cppalliance/decimal.git ../cppalliance-decimal-root
- name: clone-cppalliance-crypt
run: |
git clone -b develop --depth 1 https://github.com/cppalliance/crypt.git ../cppalliance-crypt-root
working-directory: ./
- name: benchmark_gcc-clang
run: ./target/build/test_app_benchmarks.sh ${{ matrix.compiler }} ${{ matrix.standard }}
working-directory: ./ref_app/
benchmark_apple-clang:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
standard: [ c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: clone-submods-bootstrap-headers-boost-develop
run: |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
cd ../boost-root
git submodule update --init tools
git submodule update --init libs/config
git submodule update --init libs/math
git submodule update --init libs/multiprecision
./bootstrap.sh
./b2 headers
working-directory: ./
- name: clone-cppalliance-decimal
run: |
git clone -b develop --depth 1 https://github.com/cppalliance/decimal.git ../cppalliance-decimal-root
working-directory: ./
- name: benchmark_apple-clang
run: ./target/build/test_app_benchmarks.sh ${{ matrix.compiler }} ${{ matrix.standard }}
working-directory: ./ref_app/
benchmark_builds-avr:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++20, c++23 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: |
wget --no-check-certificate https://github.com/ckormanyos/avr-gcc-build/releases/download/v15.1.0/gcc-15.1.0-avr.tar.gz
tar -xzf gcc-15.1.0-avr.tar.gz -C ${{ runner.workspace }}
- name: benchmark_builds-avr
run: |
echo
echo 'Add avr-g++ path'
echo
PATH="${{ runner.workspace }}/gcc-15.1.0-avr/bin:$PATH"
echo 'Query avr-g++ version'
echo
avr-g++ -v
echo
echo 'Build avr benchmarks'
echo
./target/build/test_app_benchmarks_avr.sh ${{ matrix.standard }}
working-directory: ./ref_app/
benchmark_builds-riscv:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: |
wget --no-check-certificate https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v14.2.0-3/xpack-riscv-none-elf-gcc-14.2.0-3-linux-x64.tar.gz
tar -xzf xpack-riscv-none-elf-gcc-14.2.0-3-linux-x64.tar.gz -C ${{ runner.workspace }}
working-directory: ./
- name: benchmark_builds-riscv
run: |
PATH="${{ runner.workspace }}/xpack-riscv-none-elf-gcc-14.2.0-3/bin:$PATH"
./target/build/test_app_benchmarks_riscv.sh ${{ matrix.standard }}
working-directory: ./ref_app/
benchmark_builds-rl78:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++23 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: |
wget --no-check-certificate https://github.com/ckormanyos/gcc-rl78-unknown-elf/releases/download/v15.1.0/gcc-15.1.0-rl78-unknown-elf.tar.gz
tar -xzf gcc-15.1.0-rl78-unknown-elf.tar.gz -C ${{ runner.workspace }}
- name: benchmark_builds-rl78
run: |
echo
echo 'Add rl78-unknown-elf-g++ path'
echo
PATH="${{ runner.workspace }}/gcc-15.1.0-rl78-unknown-elf/bin:$PATH"
echo 'Query rl78-unknown-elf-g++ version'
echo
rl78-unknown-elf-g++ -v
echo
echo 'Build rl78-unknown-elf-g++ benchmarks'
echo
./target/build/test_app_benchmarks_rl78.sh ${{ matrix.standard }}
working-directory: ./ref_app/
benchmark_builds-stm32f446:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install gcc-arm-none-eabi
- name: clone-submods-bootstrap-headers-boost-develop
run: |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
cd ../boost-root
git submodule update --init tools
git submodule update --init libs/config
git submodule update --init libs/math
git submodule update --init libs/multiprecision
./bootstrap.sh
./b2 headers
working-directory: ./
- name: clone-cppalliance-decimal
run: |
git clone -b develop --depth 1 https://github.com/cppalliance/decimal.git ../cppalliance-decimal-root
- name: clone-cppalliance-crypt
run: |
git clone -b develop --depth 1 https://github.com/cppalliance/crypt.git ../cppalliance-crypt-root
working-directory: ./
- name: benchmark_builds-stm32f446
run: ./target/build/test_app_benchmarks_stm32f446.sh ${{ matrix.standard }}
working-directory: ./ref_app/
benchmark_builds-v850:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++23 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: |
wget --no-check-certificate https://github.com/ckormanyos/gcc-v850-unknown-elf/releases/download/v14.2.0/gcc-14.2.0-v850-unknown-elf.tar.gz
tar -xzf gcc-14.2.0-v850-unknown-elf.tar.gz -C ${{ runner.workspace }}
- name: benchmark_builds-v850
run: |
echo
echo 'Add v850-unknown-elf-g++ path'
echo
PATH="${{ runner.workspace }}/gcc-14.2.0-v850-unknown-elf/bin:$PATH"
echo 'Query v850-unknown-elf-g++ version'
echo
v850-unknown-elf-g++ -v
echo
echo 'Build v850-unknown-elf-g++ benchmarks'
echo
./target/build/test_app_benchmarks_v850.sh ${{ matrix.standard }}
working-directory: ./ref_app/
benchmark_single-stm32f446:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install gcc-arm-none-eabi
- name: benchmark_single-stm32f446
run: |
mkdir -p bin
arm-none-eabi-g++ -std=c++20 -Wall -Wextra -Wpedantic -O2 -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f446 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_CRC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_crc.cpp ./target/micros/stm32f446/make/single/crt.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_crc.map -T ./target/micros/stm32f446/make/stm32f446.ld -o ./bin/app_benchmark_crc.elf
arm-none-eabi-objcopy ./bin/app_benchmark_crc.elf -O ihex ./bin/app_benchmark_crc.hex
ls -la ./bin/app_benchmark_crc.elf ./bin/app_benchmark_crc.hex ./bin/app_benchmark_crc.map
working-directory: ./ref_app/
benchmark_single-cnl:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
compiler: [ g++, clang++ ]
standard: [ c++20 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: benchmark_single-cnl
run: |
git clone -b main --depth 1 https://github.com/johnmcfarlane/cnl.git ../cnl-root
mkdir -p bin
${{ matrix.compiler }} -std=${{ matrix.standard }} -Wall -Werror -O2 -m64 -I./src -I../cnl-root/include -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_CNL_SCALED_INTEGER -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_cnl_scaled_integer.cpp -o ./bin/app_benchmark_cnl_scaled_integer.exe
ls -la ./bin/app_benchmark_cnl_scaled_integer.exe
./bin/app_benchmark_cnl_scaled_integer.exe
working-directory: ./ref_app/
benchmark_single-stm32f429-qemu:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: |
sudo apt update
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncursesw5_6.3-2ubuntu0.1_amd64.deb
sudo apt install ./libncursesw5_6.3-2ubuntu0.1_amd64.deb
mkdir -p emu_env && cd emu_env
wget --no-check-certificate https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
tar -xf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
wget --no-check-certificate https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v8.2.6-1/xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
tar -xzf xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
working-directory: ./ref_app/
- name: build benchmark_single-stm32f429
run: |
PATH="${{ runner.workspace }}/real-time-cpp/ref_app/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
echo 'Query arm-none-eabi-g++ version'
echo
arm-none-eabi-g++ -v
echo
mkdir -p bin
arm-none-eabi-g++ -std=c++20 -Werror -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -O2 -g -gdwarf-2 -ffunction-sections -fdata-sections -x c++ -fno-rtti -fno-use-cxa-atexit -fno-exceptions -fno-nonansi-builtins -fno-threadsafe-statics -fno-enforce-eh-specs -ftemplate-depth=32 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I./src/mcal/stm32f429 -I./src -DAPP_BENCHMARK_TYPE=APP_BENCHMARK_TYPE_CRC -DAPP_BENCHMARK_STANDALONE_MAIN ./src/app/benchmark/app_benchmark_crc.cpp ./target/micros/stm32f429/make/single/crt.cpp -nostartfiles -nostdlib -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_crc.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -o ./bin/app_benchmark_crc.elf
arm-none-eabi-objcopy ./bin/app_benchmark_crc.elf -O ihex ./bin/app_benchmark_crc.hex
ls -la ./bin/app_benchmark_crc.elf ./bin/app_benchmark_crc.hex ./bin/app_benchmark_crc.map
working-directory: ./ref_app/
- name: emulate-target stm32f429
run: |
PATH="${{ runner.workspace }}/real-time-cpp/ref_app/emu_env/xpack-qemu-arm-8.2.6-1/bin:$PATH"
qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors &
sleep 2
working-directory: ./ref_app/
- name: run-test-on-target
run: |
sleep 2
PATH="${{ runner.workspace }}/real-time-cpp/ref_app/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
echo 'Run test on target'
echo
arm-none-eabi-gdb ./bin/app_benchmark_crc.elf -x ./target/build/test_app_benchmarks_emulator.gdb > ./app_benchmark_crc.txt
cat ./app_benchmark_crc.txt
echo
echo 'We will now grep for the right answer...'
grep 'value 0xF00DCAFE' ./app_benchmark_crc.txt
working-directory: ./ref_app/