Skip to content

Commit defb2dc

Browse files
authored
Merge pull request #760 from cppalliance/update_metal_ci
Update GDB run in metal CI
2 parents 695b678 + 8d83b73 commit defb2dc

File tree

5 files changed

+76
-155
lines changed

5 files changed

+76
-155
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,11 @@ jobs:
251251

252252
timeout-minutes: 180
253253
runs-on: ${{matrix.os}}
254-
container: ${{matrix.container}}
254+
container:
255+
image: ${{matrix.container}}
256+
volumes:
257+
- /node20217:/node20217:rw,rshared
258+
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
255259

256260
steps:
257261
- name: Setup environment
@@ -275,9 +279,13 @@ jobs:
275279
fi
276280
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common tzdata wget curl apt-transport-https ca-certificates make build-essential g++ $PYTHON_PACKAGE python3 perl git cmake
277281
fi
282+
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
283+
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
284+
curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217
285+
fi
278286
fi
279287
git config --global pack.threads 0
280-
- uses: actions/checkout@v3
288+
- uses: actions/checkout@v4
281289

282290
- name: Install packages
283291
if: matrix.install
@@ -489,7 +497,7 @@ jobs:
489497
runs-on: ${{matrix.os}}
490498

491499
steps:
492-
- uses: actions/checkout@v3
500+
- uses: actions/checkout@v4
493501

494502
- name: Setup Boost
495503
shell: cmd
@@ -533,11 +541,11 @@ jobs:
533541
runs-on: ${{matrix.os}}
534542

535543
steps:
536-
- uses: actions/checkout@v3
544+
- uses: actions/checkout@v4
537545

538546
- name: Install packages
539547
if: matrix.install
540-
run: sudo apt install ${{matrix.install}}
548+
run: sudo apt-get -y install ${{matrix.install}}
541549

542550
- name: Setup Boost
543551
run: |
@@ -582,7 +590,7 @@ jobs:
582590
runs-on: ${{matrix.os}}
583591

584592
steps:
585-
- uses: actions/checkout@v3
593+
- uses: actions/checkout@v4
586594

587595
- name: Install packages
588596
if: matrix.install
@@ -641,7 +649,7 @@ jobs:
641649
runs-on: ${{matrix.os}}
642650

643651
steps:
644-
- uses: actions/checkout@v3
652+
- uses: actions/checkout@v4
645653

646654
- name: Install packages
647655
if: matrix.install
@@ -698,7 +706,7 @@ jobs:
698706
runs-on: windows-latest
699707

700708
steps:
701-
- uses: actions/checkout@v3
709+
- uses: actions/checkout@v4
702710

703711
- name: Setup MSYS2 environment
704712
uses: msys2/setup-msys2@v2
@@ -709,7 +717,7 @@ jobs:
709717
pacboy: gcc:p cmake:p ninja:p
710718

711719
- name: Fetch Boost.CI
712-
uses: actions/checkout@v3
720+
uses: actions/checkout@v4
713721
with:
714722
repository: boostorg/boost-ci
715723
ref: master

.github/workflows/metal.yml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ------------------------------------------------------------------------------
2-
# Copyright Matt Borland 2023.
3-
# Copyright Christopher Kormanyos 2023.
2+
# Copyright Matt Borland 2023 - 2024.
3+
# Copyright Christopher Kormanyos 2023 - 2024.
44
# Distributed under the Boost Software License,
55
# Version 1.0. (See accompanying file LICENSE_1_0.txt
66
# or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -27,28 +27,44 @@ jobs:
2727
fetch-depth: '0'
2828
- name: update-tools
2929
run: |
30-
sudo apt install libncurses5 libpython2.7
30+
sudo apt update
31+
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
32+
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
33+
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncursesw5_6.3-2ubuntu0.1_amd64.deb
34+
sudo apt install ./libncursesw5_6.3-2ubuntu0.1_amd64.deb
3135
mkdir -p emu_env && cd emu_env
32-
wget --no-check-certificate https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
33-
tar -xf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
34-
wget --no-check-certificate https://github.com/xpack-dev-tools/qemu-arm-xpack/releases/download/v7.1.0-1/xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz
35-
tar -xzf xpack-qemu-arm-7.1.0-1-linux-x64.tar.gz
36+
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
37+
tar -xf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
38+
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
39+
tar -xzf xpack-qemu-arm-8.2.6-1-linux-x64.tar.gz
3640
working-directory: ./test/metal/
3741
- name: build benchmark_single-stm32f429
3842
run: |
43+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
44+
echo 'Query arm-none-eabi-g++ version'
45+
echo
46+
arm-none-eabi-g++ -v
47+
echo
3948
mkdir -p bin
40-
emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-g++ -std=c++17 -Wall -Wextra -Wpedantic -Os -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 -fno-inline-functions -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
41-
emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-objcopy ./bin/app_benchmark_non_std_decimal.elf -O ihex ./bin/app_benchmark_non_std_decimal.hex
49+
arm-none-eabi-g++ -std=c++20 -Wall -Wextra -Wpedantic -Os -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 -fno-inline-functions -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
50+
arm-none-eabi-objcopy ./bin/app_benchmark_non_std_decimal.elf -O ihex ./bin/app_benchmark_non_std_decimal.hex
4251
ls -la ./bin/app_benchmark_non_std_decimal.elf ./bin/app_benchmark_non_std_decimal.hex ./bin/app_benchmark_non_std_decimal.map
4352
working-directory: ./test/metal/
4453
- name: emulate-target stm32f429
4554
run: |
46-
./emu_env/xpack-qemu-arm-7.1.0-1/bin/qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors &
55+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/xpack-qemu-arm-8.2.6-1/bin:$PATH"
56+
qemu-system-gnuarmeclipse --verbose --mcu STM32F429ZI --nographic --gdb tcp::9999 -d unimp,guest_errors &
57+
sleep 2
4758
working-directory: ./test/metal/
4859
- name: run-test-on-target
4960
run: |
50-
./emu_env/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb-py ./bin/app_benchmark_non_std_decimal.elf -x ./target/build/test_app_benchmarks_emulator.py
51-
qemu_result=$?
52-
echo "qemu_result" "$qemu_result"
53-
echo "qemu_result" "$qemu_result" | grep 'qemu_result 0'
61+
sleep 2
62+
PATH="${{ runner.workspace }}/decimal/test/metal/emu_env/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin:$PATH"
63+
echo 'Run test on target'
64+
echo
65+
arm-none-eabi-gdb ./bin/app_benchmark_non_std_decimal.elf -x ./target/build/test_app_benchmarks_emulator.gdb > ./app_benchmark_non_std_decimal.txt
66+
cat ./app_benchmark_non_std_decimal.txt
67+
echo
68+
echo 'We will now grep for the right answer...'
69+
grep 'value 0xF00DCAFE' ./app_benchmark_non_std_decimal.txt
5470
working-directory: ./test/metal/

test/metal/app_benchmark_non_std_decimal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// cd /mnt/c/MyGitRepos/cppalliance/decimal/test/metal
1414
// mkdir -p bin
15-
// arm-none-eabi-g++ -std=c++17 -Wall -Wextra -Wpedantic -O0 -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=128 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
15+
// arm-none-eabi-g++ -std=c++20 -Wall -Wextra -Wpedantic -O0 -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=128 -mcpu=cortex-m4 -mtune=cortex-m4 -mthumb -mfloat-abi=soft -mno-unaligned-access -mno-long-calls -I../../include -DBOOST_DECIMAL_DISABLE_CLIB -DAPP_BENCHMARK_STANDALONE_MAIN app_benchmark_non_std_decimal.cpp ./target/micros/stm32f429/make/single/crt.cpp ./target/micros/stm32f429/make/single/mcal_gcc_cxx_completion_with_stdlib.cpp -nostartfiles -Wl,--gc-sections -Wl,-Map,./bin/app_benchmark_non_std_decimal.map -T ./target/micros/stm32f429/make/stm32f429.ld --specs=nano.specs --specs=nosys.specs -Wl,--print-memory-usage -o ./bin/app_benchmark_non_std_decimal.elf
1616
// arm-none-eabi-objcopy ./bin/app_benchmark_non_std_decimal.elf -O ihex ./bin/app_benchmark_non_std_decimal.hex
1717
// ls -la ./bin/app_benchmark_non_std_decimal.elf ./bin/app_benchmark_non_std_decimal.hex ./bin/app_benchmark_non_std_decimal.map
1818

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# ///////////////////////////////////////////////////////////////////
2+
# // Copyright Christopher Kormanyos 2020 - 2024.
3+
# // Distributed under the Boost Software License,
4+
# // Version 1.0. (See accompanying file LICENSE_1_0.txt
5+
# // or copy at http://www.boost.org/LICENSE_1_0.txt)
6+
# //
7+
8+
# Connect to the target (e.g., OpenOCD or another GDB server).
9+
target remote localhost:9999
10+
monitor halt
11+
12+
# Ensure that the program is loaded.
13+
load
14+
15+
# Set a breakpoint at the specified subroutine.
16+
break app_benchmark_get_standalone_result
17+
18+
# Start or continue program execution.
19+
continue
20+
21+
# Format and print the value of a variable.
22+
printf "value 0x%X\n\n", app_benchmark_standalone_result
23+
24+
# Delete (all) breakpoint(s).
25+
delete
26+
27+
# Perform a non-elegant quit of the GDB session.
28+
quit

test/metal/target/build/test_app_benchmarks_emulator.py

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)