Skip to content

Commit e5981f6

Browse files
authored
Initialize benchmarking
0 parents  commit e5981f6

58 files changed

Lines changed: 107060 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cproject

Lines changed: 406 additions & 0 deletions
Large diffs are not rendered by default.

.devcontainer/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM ubuntu:24.04
2+
3+
# Install git, git-lfs, colorama and build tools
4+
RUN echo "deb http://security.ubuntu.com/ubuntu focal-security main universe" > /etc/apt/sources.list.d/ubuntu-focal-sources.list && \
5+
apt-get update && apt-get -y install git git-lfs python3 python3-pip curl python3-colorama cmake g++ build-essential libncurses5 libusb-1.0-0 gdb && \
6+
git lfs install
7+
8+
# Install cubeclt
9+
RUN mkdir /temp && cd /temp && git clone https://github.com/HyperloopUPV-H8/cubeclt.git && \
10+
cd cubeclt && git lfs pull && chmod +x cubeclt_1.16.0_installer.sh && \
11+
echo | LICENSE_ALREADY_ACCEPTED=1 ./cubeclt_1.16.0_installer.sh
12+
13+
ENV PATH="$PATH:/opt/st/stm32cubeclt_1.16.0/GNU-tools-for-STM32/bin:/opt/st/stm32cubeclt_1.16.0/CMake/bin:/opt/st/stm32cubeclt_1.16.0/Ninja/bin"
14+
15+
ENV PYTHONPATH="/workspaces/template-project/Tests/VirtualMCU/src/:$PYTHONPATH"

.devcontainer/devcontainer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "Dev Container for Template Project",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"options": [
6+
"--platform=linux/amd64"
7+
]
8+
},
9+
"runArgs": [
10+
"--cap-add=SYS_PTRACE",
11+
"--security-opt=seccomp=unconfined"
12+
],
13+
"remoteUser": "root",
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"ms-vscode.cpptools-extension-pack",
18+
"ms-python.python",
19+
"mcu-debug.debug-tracker-vscode",
20+
"marus25.cortex-debug"
21+
]
22+
}
23+
}
24+
}

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Build Project
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
preset:
7+
description: |
8+
'CMake preset to build the project, run `cmake --build --list-presets' to see a complete list of options'
9+
required: true
10+
type: string
11+
default: 'nucleo-debug'
12+
outputs:
13+
build-artifact:
14+
description: 'Build result artifact id for later use'
15+
value: ${{ jobs.build.outputs.build-artifact }}
16+
workflow_dispatch:
17+
inputs:
18+
preset:
19+
description: |
20+
'CMake preset to build the project, run `cmake --build --list-presets' to see a complete list of options'
21+
required: true
22+
type: string
23+
default: 'nucleo-debug'
24+
25+
jobs:
26+
build:
27+
name: Build Project
28+
runs-on: ubuntu-24.04
29+
outputs:
30+
build-artifact: ${{ steps.upload-build-artifact.outputs.artifact-id }}
31+
container:
32+
image: jmaralo/hyperloop-upv-firmware:latest
33+
steps:
34+
- name: Clone Project
35+
uses: actions/checkout@v3
36+
with:
37+
submodules: recursive
38+
- name: Configure
39+
run: |
40+
apt update && apt install -y sudo
41+
sudo apt update
42+
apt install -y python3.12-venv
43+
python3 -m venv virtual
44+
source virtual/bin/activate
45+
pip install -r requirements.txt
46+
shell: bash
47+
- name: Build
48+
run: |
49+
source virtual/bin/activate
50+
cmake --preset ${{ inputs.preset }} .
51+
cmake --build --preset ${{ inputs.preset }}
52+
shell: bash
53+
- name: Run Simulator Tests
54+
if: inputs.preset == 'simulator'
55+
run: |
56+
cd Tests
57+
echo "Running tests against $(cd .. && pwd)/out/build/simulator/latest.elf"
58+
set -e
59+
python3 test.py -uut="$(cd .. && pwd)/out/build/latest.elf"
60+
- name: Upload Build
61+
id: upload-build-artifact
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: ${{ inputs.preset }}
65+
path: out/build/latest.elf
66+
retention-days: 7
67+
compression-level: 0
68+
if-no-files-found: error
69+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Compile Checks
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
compile-checks:
8+
name: Check project compiles
9+
strategy:
10+
matrix:
11+
preset:
12+
- nucleo-debug
13+
- nucleo-release
14+
- nucleo-relwithdebinfo
15+
- nucleo-debug-eth
16+
- nucleo-release-eth
17+
- nucleo-relwithdebinfo-eth
18+
- board-debug
19+
- board-release
20+
- board-relwithdebinfo
21+
- board-debug-eth
22+
- board-release-eth
23+
- board-relwithdebinfo-eth
24+
- simulator
25+
fail-fast: false
26+
uses: ./.github/workflows/build.yml
27+
with:
28+
preset: ${{ matrix.preset }}

.gitignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# *-----------------------*
2+
# | General |
3+
# *-----------------------*
4+
5+
# Python
6+
__pycache__/
7+
virtual/
8+
# Build
9+
Debug/
10+
Release/
11+
build/
12+
out/
13+
14+
# IDE
15+
*.launch
16+
.metadata
17+
.settings/
18+
compile_commands.json
19+
20+
# *-----------------------*
21+
# | CMake |
22+
# *-----------------------*
23+
24+
CMakeLists.txt.user
25+
CMakeCache.txt
26+
CMakeFiles
27+
CMakeScripts
28+
Testing
29+
Makefile
30+
cmake_install.cmake
31+
install_manifest.txt
32+
compile_commands.json
33+
CTestTestfile.cmake
34+
_deps
35+
CMakeUserPresets.json
36+
.cache
37+
38+
# *-----------------------*
39+
# | Flash Dump Utilities |
40+
# *-----------------------*
41+
42+
tools/*.bin
43+
# *-----------------------*
44+
# | C/C++ |
45+
# *-----------------------*
46+
47+
# Prerequisites
48+
*.d
49+
50+
# Compiled Object files
51+
*.slo
52+
*.lo
53+
*.o
54+
*.obj
55+
*.ko
56+
*.elf
57+
58+
# Precompiled Headers
59+
*.gch
60+
*.pch
61+
62+
# Compiled Dynamic libraries
63+
*.so
64+
*.dylib
65+
*.dll
66+
*.so.*
67+
68+
# Compiled Static libraries
69+
*.lai
70+
*.la
71+
*.a
72+
*.lib
73+
*.lo
74+
75+
# Executables
76+
*.exe
77+
*.out
78+
*.app
79+
*.i*86
80+
*.x86_64
81+
*.hex
82+
83+
# Linker output
84+
*.ilk
85+
*.map
86+
*.exp
87+
88+
# Precompiled Headers
89+
*.gch
90+
*.pch
91+
92+
# Debug files
93+
*.dSYM/
94+
*.su
95+
*.idb
96+
*.pdb
97+
98+
# Log files
99+
*.log

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "deps/ST-LIB"]
2+
path = deps/ST-LIB
3+
url = https://github.com/HyperloopUPV-H8/ST-LIB
4+
[submodule "Core/Inc/Communications/JSON_ADE"]
5+
path = Core/Inc/Code_generation/JSON_ADE
6+
url = https://github.com/HyperloopUPV-H8/JSON_ADE
7+
[submodule "Tests/VirtualMCU"]
8+
path = Tests/VirtualMCU
9+
url = https://github.com/HyperloopUPV-H8/VirtualMCU

.mxproject

Lines changed: 34 additions & 0 deletions
Large diffs are not rendered by default.

.project

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>template-project</name>
4+
<comment></comment>
5+
<projects>
6+
<project>ST-LIB</project>
7+
</projects>
8+
<buildSpec>
9+
<buildCommand>
10+
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
11+
<triggers>clean,full,incremental,</triggers>
12+
<arguments>
13+
</arguments>
14+
</buildCommand>
15+
<buildCommand>
16+
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
17+
<triggers>full,incremental,</triggers>
18+
<arguments>
19+
</arguments>
20+
</buildCommand>
21+
</buildSpec>
22+
<natures>
23+
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
24+
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
25+
<nature>org.eclipse.cdt.core.cnature</nature>
26+
<nature>org.eclipse.cdt.core.ccnature</nature>
27+
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
28+
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
29+
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
30+
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
31+
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
32+
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
33+
</natures>
34+
</projectDescription>

.vscode/c_cpp_properties.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "CMake",
5+
"cStandard": "c17",
6+
"cppStandard": "c++20",
7+
"configurationProvider": "ms-vscode.cmake-tools",
8+
"compileCommands": "compile_commands.json"
9+
}
10+
],
11+
"version": 4
12+
}

0 commit comments

Comments
 (0)