From f29e311812ffb1db526b1782f3a1bdba976ded89 Mon Sep 17 00:00:00 2001 From: Jonatan Antoni Date: Fri, 24 Nov 2023 10:10:49 +0100 Subject: [PATCH] Fixup --- .github/workflows/cmsis_rv2.yml | 88 +++++++++++------------------ .gitignore | 1 + .vscode/launch.json | 10 ++-- .vscode/vcpkg-configuration.json | 17 ++++++ Project/.clangd | 3 - Project/README.md | 96 +++++++++++++++++++------------- 6 files changed, 112 insertions(+), 103 deletions(-) create mode 100644 .vscode/vcpkg-configuration.json delete mode 100644 Project/.clangd diff --git a/.github/workflows/cmsis_rv2.yml b/.github/workflows/cmsis_rv2.yml index ae247e3..d928f25 100644 --- a/.github/workflows/cmsis_rv2.yml +++ b/.github/workflows/cmsis_rv2.yml @@ -25,54 +25,28 @@ jobs: steps: - uses: actions/checkout@v4 + with: + path: CMSIS-RTOS2_Validation + + - uses: actions/checkout@v4 + with: + repository: ARM-software/CMSIS_6 + path: CMSIS_6 - - working-directory: /home/runner - env: - GH_TOKEN: ${{ github.token }} - run: | - if [ -d CMSIS_6 ]; then - cd CMSIS_6 - git fetch origin main - git checkout -f origin/main - else - gh repo clone ARM-software/CMSIS_6 - fi - - - working-directory: /home/runner - env: - GH_TOKEN: ${{ github.token }} - run: | - if [ -d CMSIS-RTX ]; then - cd CMSIS-RTX - git fetch origin main - git checkout -f origin/main - else - gh repo clone ARM-software/CMSIS-RTX - fi + - uses: actions/checkout@v4 + with: + repository: ARM-software/CMSIS-RTX + path: CMSIS-RTX - - working-directory: /home/runner - env: - GH_TOKEN: ${{ github.token }} - run: | - if [ -d CMSIS-FreeRTOS ]; then - cd CMSIS-FreeRTOS - git fetch origin main - git checkout -f origin/main - else - gh repo clone ARM-software/CMSIS-FreeRTOS - fi + - uses: actions/checkout@v4 + with: + repository: ARM-software/Cortex_DFP + path: Cortex_DFP - - working-directory: /home/runner - env: - GH_TOKEN: ${{ github.token }} - run: | - if [ -d Cortex_DFP ]; then - cd Cortex_DFP - git fetch origin main - git checkout -f origin/main - else - gh repo clone ARM-software/Cortex_DFP - fi + - uses: actions/checkout@v4 + with: + repository: ARM-software/CMSIS-FreeRTOS + path: CMSIS-FreeRTOS - uses: actions/setup-python@v4 with: @@ -86,7 +60,7 @@ jobs: - name: Python requirements run: | - pip install -r ./Project/requirements.txt + pip install -r ./CMSIS-RTOS2_Validation/Project/requirements.txt - name: Cache packs uses: actions/cache@v3 @@ -105,7 +79,7 @@ jobs: path: /home/runner/.vcpkg - name: Prepare vcpkg env - working-directory: ./Project + working-directory: ./CMSIS-RTOS2_Validation/Project run: | . <(curl https://aka.ms/vcpkg-init.sh -L) vcpkg x-update-registry --all @@ -117,7 +91,7 @@ jobs: popd - name: Activate Arm tool license - working-directory: ./Project + working-directory: ./CMSIS-RTOS2_Validation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate @@ -138,24 +112,24 @@ jobs: queries: security-and-quality - name: Build - working-directory: ./Project + working-directory: ./CMSIS-RTOS2_Validation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate echo "Register local packs" - cpackget rm ARM::CMSIS ARM::CMSIS-RTX ARM::CMSIS-FreeRTOS || echo "Ok" - cpackget add /home/runner/CMSIS_6/ARM.CMSIS.pdsc - cpackget add /home/runner/CMSIS-RTX/ARM.CMSIS-RTX.pdsc - cpackget add /home/runner/CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc - cpackget add /home/runner/Cortex_DFP/ARM.Cortex_DFP.pdsc + cpackget rm ARM::CMSIS ARM::Cortex_DFP ARM::CMSIS-RTX ARM::CMSIS-FreeRTOS || echo "Ok" + cpackget add ${{ github.workspace }}/CMSIS_6/ARM.CMSIS.pdsc + cpackget add ${{ github.workspace }}/CMSIS-RTX/ARM.CMSIS-RTX.pdsc + cpackget add ${{ github.workspace }}/CMSIS-FreeRTOS/ARM.CMSIS-FreeRTOS.pdsc + cpackget add ${{ github.workspace }}/Cortex_DFP/ARM.Cortex_DFP.pdsc echo "Build test projects ..." ./build.py --verbose -r ${{ matrix.rtos }} -c ${{ matrix.compiler }} build || echo "::warning::=== Some configurations failed to build! ===" - name: Execute if: ${{ env.ARM_UBL_ACTIVATION_CODE }} - working-directory: ./Project + working-directory: ./CMSIS-RTOS2_Validation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate @@ -165,7 +139,7 @@ jobs: - name: Deactivate Arm tool license if: always() - working-directory: ./Project + working-directory: ./CMSIS-RTOS2_Validation/Project run: | . /home/runner/.vcpkg/vcpkg-init vcpkg activate @@ -184,7 +158,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: test-results-${{ matrix.rtos }}-${{ matrix.compiler }} - path: Project/*.junit + path: ./CMSIS-RTOS2_Validation/Project/*.junit publish-test-results: diff --git a/.gitignore b/.gitignore index b28591e..eea49ab 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Doxygen/linkchecker-out.csv Project/Validation.**/* Project/*.zip Project/*.junit +.clangd diff --git a/.vscode/launch.json b/.vscode/launch.json index f49c5b4..e791d39 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,19 +5,19 @@ "version": "0.2.0", "configurations": [ { - "name": "RTX5, GCC, CM33_FP_VHT", + "name": "RTX5, AC6, Cortex-M33", "type": "arm-debug", - "request": "launch", - "program": "${workspaceFolder}/Project/Validation.RTX5+CM33_FP_GCC/Validation.RTX5+CM33_FP_OutDir/Validation.elf", + "request": "launch", + "program": "${workspaceFolder}/Project/Validation.RTX5+CM33_AC6/Validation.RTX5+CM33_OutDir/Validation.axf", // armdbg --cdb-list "" "cdbEntry": "Arm FVP::MPS2_Cortex_M33::Bare Metal Debug::Bare Metal Debug::Cortex-M33_0", "cdbEntryParams": { - "model_params": "-f ${workspaceFolder}/Layer/Target/CM33_FP_VHT/vht_config.txt", + "model_params": "-f ${workspaceFolder}/Layer/Target/CM33/model_config.txt", "model_connection_address": "127.0.0.1:7100", "connect_existing_model": false }, "programMode": "ram", - "debugFrom": "Reset_Handler" + "debugFrom": "tf_main" } ] } diff --git a/.vscode/vcpkg-configuration.json b/.vscode/vcpkg-configuration.json new file mode 100644 index 0000000..c926a89 --- /dev/null +++ b/.vscode/vcpkg-configuration.json @@ -0,0 +1,17 @@ +{ + "registries": [ + { + "kind": "artifact", + "location": "https://aka.ms/vcpkg-ce-default", + "name": "microsoft" + }, + { + "kind": "artifact", + "location": "https://artifacts.keil.arm.com/vcpkg-ce-registry/registry.zip", + "name": "arm" + } + ], + "requires": { + "arm:debuggers/arm/armdbg": "^6.0.1" + } +} diff --git a/Project/.clangd b/Project/.clangd deleted file mode 100644 index d2456f8..0000000 --- a/Project/.clangd +++ /dev/null @@ -1,3 +0,0 @@ -CompileFlags: - CompilationDatabase: >- - /Users/jonant01/git/ARM-software/CMSIS-RTOS2_Validation/Project/tmp/Validation/CM0plus/RTX5 diff --git a/Project/README.md b/Project/README.md index 3b7a350..b9b5498 100644 --- a/Project/README.md +++ b/Project/README.md @@ -8,60 +8,75 @@ Independent project can be generated for specific RTOS, DEVICE and COMPILER. Pos |----------|----------|----------| | FreeRTOS | CM0plus | AC6 | | RTX5 | CM3 | GCC | -| | CM4_FP | CLANG | -| | CM7_DP | | -| | CM7_SP | | +| | CM4 | CLANG | +| | CM7 | | | | CM23 | | -| | CM33_FP | | +| | CM33 | | | | CM55 | | | | CM85 | | Input file for cbuild is Validation.csolution.yml -## Unsupported contexts -The below table lists contexts that are currently not available: -| Context | Toolchain | Reason | -|----------------|-----------|----------------------------------------------------| -| +CM55 | GCC/CLANG | Device:Startup component has no GCC/CLANG support | -| +CM85 | CLANG | Device:Definition component has no CLANG support | - ## Prerequisites -- [CMSIS-Toolbox 2.1.0](https://github.com/Open-CMSIS-Pack/cmsis-toolbox/releases) -- Arm Virtual Hardware executables installed with installation path added to the system environment path -- Python or Keil MDK Professional +- [CMSIS-Toolbox 2.1.0](https://artifacts.keil.arm.com/cmsis-toolbox/2.1.0/) +- [Arm Virtual Hardware for Cortex-M based on FastModels 11.22.39](https://artifacts.keil.arm.com/avh/11.22.39/) +- [Arm Compiler 6.20](https://artifacts.keil.arm.com/arm-compiler/6.20/21/) +- [GCC Compiler 13.2.1](https://artifacts.keil.arm.com/arm-none-eabi-gcc/13.2.1/) +- [Clang Compiler 17.0.1](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/tag/release-17.0.1) +- [CMake 3.25.2 or later](https://cmake.org/download/) +- [Ninja 1.10.2 or later](https://github.com/ninja-build/ninja/releases) +- Python (to use `build.py` script) +- MDK Professional (for debugging, Windows only) + +These prerequisites can be installed automatically using `vcpkg`: + +```Shell + ./Project $ vcpkg activate +``` + +Python packages required to build and run with `build.py`: -Packages required to build and run with Python: - python-matrix-runner 1.0 - lxml 4.8 -Python packages can be installed by executing in bash shell: +These can be installed with `pip``: + ```Shell -$ pip install -r requirements.txt + ./Project $ pip install -r requirements.txt ``` Required CMSIS Packs: + - ARM.CMSIS - ARM.CMSIS-RTX - ARM.CMSIS-FreeRTOS - ARM.Cortex_DFP +These get installed automatically if missing. One can explicitly install the packs using `cpackget` from CMSIS-Toolbox. + ## Build and Execute Projects with Arm Virtual Hardware + The simplest way to execute this validation suite is to build and run configured targets using Python script: + ```Shell -$ python build.py build run + ./Project $ python build.py build run ``` -Use --verbose command to output more information: + +Use `--verbose` command to output more information: + ```Shell -$ python build.py --verbose build run + ./Project $ python build.py --verbose build run ``` Above commands will build all defined projects and run each target. One might be interested in only one RTOS/Device/Compiler combination and can also build and run a project for specific combination, see below. ## Build and Execute Project for Specific Target + To build and execute validation suite for specific target use the following command: + ```Shell -$ python build.py build run -r {RTOS} -d {DEVICE} -c {COMPILER} + ./Project $ python build.py build run -r {RTOS} -d {DEVICE} -c {COMPILER} ``` > Note: Mentioned commands can be executed either in Windows command prompt or bash shell. @@ -69,31 +84,36 @@ $ python build.py build run -r {RTOS} -d {DEVICE} -c {COMPILER} Python script is used to simplify build commands and Virtual Hardware Target model execution. One can call cbuild and execute the model manually, see below. ## Manually Build and Execute Project for Specific Target + Behind the scenes, build.py script calls cbuild and VHT model executable to build and execute the test suite. The following command will build the project for specified RTOS/Device/Compiler and its output is an executable (either Validation.axf or Validation.elf): + ```Shell -$ cbuild Validation.csolution.yml --update-rte --context .{RTOS}+{DEVICE} --toolchain {COMPILER} -``` + ./Project $ cbuild Validation.csolution.yml --update-rte --context .{RTOS}+{DEVICE} --toolchain {COMPILER} + ``` + Executable file is then used as input parameter when calling Virtual Hardware Target model to run the validation: + ```Shell -$ {VHT_MODEL} -f ../Layer/Target/{DEVICE}_VHT/vht_config.txt -a Validation.{RTOS}+{DEVICE}_{COMPILER}/Validation.{RTOS}+{DEVICE}_OutDir/Validation.axf + ./Project $ {VHT_MODEL} -f ../Layer/Target/{DEVICE}/model_-config.txt -a Validation.{RTOS}+{DEVICE}_{COMPILER}/Validation.{RTOS}+{DEVICE}_OutDir/Validation.axf ``` -Please see a table below for a possible {VHT_MODEL} variable value when a project for specified {DEVICE} was built: -| VHT_MODEL | DEVICE | + +Please see a table below for a possible {AVH_MODEL} variable value when a project for specified {DEVICE} was built: + +| AVH_MODEL | DEVICE | |---------------------------|---------| -| VHT_MPS2_Cortex-M0plus | CM0plus | -| VHT_MPS2_Cortex-M3 | CM3 | -| VHT_MPS2_Cortex-M4 | CM4_FP | -| VHT_MPS2_Cortex-M7 | CM7_DP | -| VHT_MPS2_Cortex-M7 | CM7_SP | -| VHT_MPS2_Cortex-M23 | CM23 | -| VHT_MPS2_Cortex-M33 | CM33_FP | -| VHT_MPS3_Corstone_SEE-300 | CM55 | -| VHT_Corstone_SSE-310 | CM85 | - - -## Debug the Project using Keil MDK-Professional: +| FVP_MPS2_Cortex-M0plus | CM0plus | +| FVP_MPS2_Cortex-M3 | CM3 | +| FVP_MPS2_Cortex-M4 | CM4 | +| FVP_MPS2_Cortex-M7 | CM7 | +| FVP_MPS2_Cortex-M23 | CM23 | +| FVP_MPS2_Cortex-M33 | CM33 | +| FVP_MPS2_Cortex-M55 | CM55 | +| FVP_MPS2_Cortex-M85 | CM85 | + +## Debug the Project using Keil MDK-Professional + All projects can be opened and debugged using Keil MDK-Professional no matter whether the project was build using Python script or manually with cbuild. After the project was successfully built, follow the steps below: