Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:

env:
ARM_UBL_ACTIVATION_CODE: ${{ secrets.ARM_UBL_ACTIVATION_CODE }}
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}

steps:
- uses: actions/checkout@v5
Expand All @@ -39,12 +40,12 @@ jobs:
sudo apt-get update
sudo apt-get install libtinfo5 llvm-15-tools
sudo ln -s /usr/bin/FileCheck-15 /usr/bin/FileCheck

- name: Activate vcpkg environment
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: ./CMSIS/Core/Test/vcpkg-configuration.json

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@v1
with:
Expand All @@ -57,6 +58,13 @@ jobs:
run: |
./build.py lit

- name: Archive Test Results
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: lit-test-results
path: ./CMSIS/Core/Test/*.xunit

- name: Publish Test Results
if: ${{ !cancelled() }}
uses: EnricoMi/publish-unit-test-result-action@v2
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/corevalidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,24 @@ on:
- CMSIS/CoreValidation/**/*
push:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-run:

strategy:
fail-fast: true
matrix:
compiler: [AC6, GCC, Clang]
compiler: [AC6, GCC, Clang, IAR]

runs-on: ubuntu-22.04

env:
ARM_UBL_ACTIVATION_CODE: ${{ secrets.ARM_UBL_ACTIVATION_CODE }}
IAR_LMS_BEARER_TOKEN: ${{ secrets.IAR_LMS_BEARER_TOKEN }}

steps:
- run: |
Expand All @@ -49,7 +50,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.10'
cache: 'pip'

- name: Python requirements
Expand All @@ -62,17 +63,17 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install libtinfo5

- name: Activate vcpkg environment
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: ./CMSIS/CoreValidation/Project/vcpkg-configuration.json

- name: Activate Arm tool license
uses: ARM-software/cmsis-actions/armlm@v1
with:
code: "${{ env.ARM_UBL_ACTIVATION_CODE }}"

- name: Initialize CodeQL
if: matrix.compiler == 'GCC'
uses: github/codeql-action/init@v3
Expand All @@ -85,6 +86,7 @@ jobs:

- name: Build
working-directory: ./CMSIS/CoreValidation/Project
shell: bash
run: |
echo "Register local Cortex_DFP pack"
cpackget add /home/runner/Cortex_DFP/ARM.Cortex_DFP.pdsc
Expand All @@ -98,7 +100,7 @@ jobs:

- name: Execute
working-directory: ./CMSIS/CoreValidation/Project
run: |
run: |
echo "Run test projects ..."
./build.py --verbose -c ${{ matrix.compiler }} -d "CM*" run || echo "::warning::==== Some configurations failed to run! ==="

Expand Down
3 changes: 1 addition & 2 deletions CMSIS/Core/Include/m-profile/cmsis_iccarm_m.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ __iar_builtin_ISB();
#define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE)))

#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
!(defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)) && \
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
!(defined (__ARM_ARCH_8_1M_MAIN__ ) && (__ARM_ARCH_8_1M_MAIN__ == 1)))
// without main extensions, the non-secure PSPLIM is RAZ/WI
#define __TZ_get_PSPLIM_NS() (0U)
#define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE))
Expand Down
2 changes: 2 additions & 0 deletions CMSIS/Core/Test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Currently, the following build configurations are provided:
- Arm Compiler 6 (AC6)
- GNU Compiler (GCC)
- LLVM/Clang (Clang)
- IAR Toolchain (IAR)
2. Devices
- Cortex-M0
- Cortex-M0+
Expand Down Expand Up @@ -76,6 +77,7 @@ The following tools are required to build and run the Core tests:
- [Arm Compiler 6.23](https://artifacts.tools.arm.com/arm-compiler/6.23/32/)*
- [GCC Compiler 14.2.1](https://artifacts.keil.arm.com/arm-none-eabi-gcc/14.2.1/)*
- [Clang Compiler 20.1.0](https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/tag/release-20.1.0)*
- [IAR Toolchain 9.70.1](https://github.com/iarsystems/arm/releases/tag/9.70.1)*
- [Python 3.9](https://www.python.org/downloads/)
- [LLVM FileCheck](https://github.com/llvm/llvm-project/releases/)
- Ubuntu package `llvm-<version>-tools`
Expand Down
5 changes: 0 additions & 5 deletions CMSIS/Core/Test/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ def run_lit(toolchain, device, optimize):
return ["lit", "--xunit-xml-output", f"lit.xml", "-D", f"toolchain={toolchain}", "-D", f"device={device}", "-D", f"optimize={optimize}", "src" ]


@matrix_filter
def filter_iar(config):
return config.compiler == CompilerAxis.IAR


@matrix_filter
def filter_gcc_cm52(config):
device = config.device.match('CM52*')
Expand Down
57 changes: 56 additions & 1 deletion CMSIS/Core/Test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
'triple': 'thumbv7-em',
'abi': 'eabi',
'mcpu': 'cortex-m7',
'mfpu': 'fpv4-sp-d16',
'mfpu': 'fpv5-sp-d16',
'mpu': True,
'features': ['thumbv6m', 'thumbv7m', 'dsp', 'thumb-2', 'sat', 'ldrex', 'clz'],
'header': 'core_cm7.h',
Expand Down Expand Up @@ -847,13 +847,64 @@ def get_ccflags(self):

return ccflags

class Toolchain_IAR(Toolchain):
OPTIMIZE = {
'none': '-On',
'balanced': '-Oh',
'speed': '-Ohs',
'size': '-Ohz'
}
FPU = {
'none': 'none',
'fpv4-sp-d16': 'VFPv4-SP',
'fpv5-sp-d16': 'VFPv5-SP',
'fpv5-d16': 'VFPv5_D16',
'neon-vfpv3': 'VFPv3',
'neon-vfpv4': 'VFPv4',
}
CPU = {
'CA5': 'Cortex-A5',
'CA5neon': 'Cortex-A5.neon',
'CA7': 'Cortex-A7.no_neon',
'CA7neon': 'Cortex-A7',
'CA9': 'Cortex-A9.no_neon',
'CA9neon': 'Cortex-A9',
}
def __init__(self, **args):
super().__init__('IAR', **args)

def get_cc(self):
return os.path.join(self.get_root(), 'iccarm')

def cpu(self):
if self.device in self.CPU:
return self.CPU[self.device]
return DEVICES[self.device]["mcpu"]

def fpu(self):
return self.FPU[DEVICES[self.device]["mfpu"]]

def get_ccflags(self):
ccflags = [
self.OPTIMIZE[self.optimize],
f'--cpu={self.cpu()}', f'--fpu={self.fpu()}',
'-I', os.path.abspath('../Include'), '-c', '-D', f'CORE_HEADER="{DEVICES[device]["header"]}"']
if device.endswith('S') and not device.endswith('NS'):
ccflags += ["--cmse"]
ccflags += list(sum([('-D', f'{define}={value}') for (define, value) in DEVICES[self.device]['defines'].items()], ()))

return ccflags

tc = None
if toolchain == 'AC6':
tc = Toolchain_AC6(device=device, optimize=optimize)
elif toolchain == 'GCC':
tc = Toolchain_GCC(device=device, optimize=optimize)
elif toolchain == 'Clang':
tc = Toolchain_Clang(device=device, optimize=optimize)
elif toolchain == 'IAR':
tc = Toolchain_IAR(device=device, optimize=optimize)
config.environment['IAR_LMS_BEARER_TOKEN'] = os.environ.get('IAR_LMS_BEARER_TOKEN')

prefixes = ['CHECK']
if device.endswith('NS'):
Expand All @@ -864,6 +915,10 @@ def get_ccflags(self):
prefixes += ['CHECK-THUMB']
elif DEVICES[device]['arch'].startswith('arm'):
prefixes += ['CHECK-ARM']
if toolchain == 'IAR':
prefixes += ['CHECK-IAR']
else:
prefixes += ['CHECK-NON-IAR']

if DEVICES[device]["mfpu"] != 'none':
config.available_features.add('fpu')
Expand Down
2 changes: 1 addition & 1 deletion CMSIS/Core/Test/src/cpsr.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void set_cpsr() {
void get_mode() {
// CHECK-LABEL: <get_mode>:
// CHECK: mrs [[REG:r[0-9]+]], apsr
// CHECK: and [[REG]], [[REG]], #{{31|0x1f}}
// CHECK: and{{s?}} [[REG]], [[REG]], #{{31|0x1f}}
volatile uint32_t result = __get_mode();
// CHECK: {{(bx lr)|(pop {.*pc})}}
}
Expand Down
2 changes: 1 addition & 1 deletion CMSIS/Core/Test/src/noreturn.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ static void func() {

void noreturn() {
// CHECK-LABEL: <noreturn>:
// CHECK: b 0x0 <noreturn>
// CHECK: {{b|bl}} {{0x[0-9a-fA-F]+}} <noreturn{{.*}}>
func();
// CHECK-NOT: bx lr
}
4 changes: 2 additions & 2 deletions CMSIS/Core/Test/src/ror.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ static volatile uint32_t b = 2u;

void ror() {
// CHECK-LABEL: <ror>:
// CHECK-THUMB: ror{{ne|s|.w}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-ARM: {{ror|rorne}} {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-THUMB: ror{{ne|s|.w|s.w}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-ARM: ror{{s?|ne}} {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}
volatile uint32_t c = __ROR(a, b);
// CHECK: {{(bx lr)|(pop {.*pc})}}
}
Expand Down
2 changes: 1 addition & 1 deletion CMSIS/Core/Test/src/rrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ static volatile uint32_t a = 10u;

void rrx() {
// CHECK-LABEL: <rrx>:
// CHECK: rrx {{r[0-9]+}}, {{r[0-9]+}}
// CHECK: {{rrx|rrxs}} {{r[0-9]+}}, {{r[0-9]+}}
volatile uint32_t c = __RRX(a);
// CHECK: {{(bx lr)|(pop {.*pc})}}
}
36 changes: 24 additions & 12 deletions CMSIS/Core/Test/src/simd.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,23 +471,29 @@ void pkhtb() {

void sxtb16_ror() {
// CHECK-LABEL: <sxtb16_ror>:
// CHECK: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}, ror #8
// CHECK-NON-IAR: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}, ror #8
// CHECK-IAR: rors{{(\.w)?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#8|#0x8}}
// CHECK-IAR: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}
volatile uint32_t result = __SXTB16_RORn(s32_1, 8);

// CHECK: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}, ror #16
// CHECK-NON-IAR: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}, ror #16
// CHECK-IAR: rors{{(\.w)?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#16|#0x10}}
// CHECK-IAR: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}
result = __SXTB16_RORn(s32_1, 16);

// CHECK: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}, ror #24
// CHECK-NON-IAR: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}, ror #24
// CHECK-IAR: rors{{(\.w)?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#24|#0x18}}
// CHECK-IAR: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}
result = __SXTB16_RORn(s32_1, 24);

// CHECK-THUMB: ror.w [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK-ARM: ror [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK-THUMB: ror{{s?}}.w [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK-ARM: ror{{s?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK: sxtb16 {{r[0-9]+}}, [[REG]]
// CHECK-NOT: , ror
result = __SXTB16_RORn(s32_1, 5);

// CHECK-THUMB: ror{{.w|ne|s}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-ARM: ror{{(ne)?}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-ARM: ror{{s?|ne}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK: sxtb16 {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-NOT: , ror
result = __SXTB16_RORn(s32_1, u8);
Expand All @@ -498,23 +504,29 @@ void sxtb16_ror() {
void sxtab16_ror() {
// CHECK-LABEL: <sxtab16_ror>:

// CHECK: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}, ror #8
// CHECK-NON-IAR: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}, ror #8
// CHECK-IAR: rors{{(\.w)?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#8|#0x8}}
// CHECK-IAR: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}
volatile uint32_t result = __SXTAB16_RORn(s32_1, s32_2, 8);

// CHECK: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}, ror #16
// CHECK-NON-IAR: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}, ror #16
// CHECK-IAR: rors{{(\.w)?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#16|#0x10}}
// CHECK-IAR: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}
result = __SXTAB16_RORn(s32_1, s32_2, 16);

// CHECK: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}, ror #24
// CHECK-NON-IAR: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}, ror #24
// CHECK-IAR: rors{{(\.w)?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#24|#0x18}}
// CHECK-IAR: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}
result = __SXTAB16_RORn(s32_1, s32_2, 24);

// CHECK-THUMB: ror.w [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK-ARM: ror [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK-THUMB: ror{{s?}}.w [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK-ARM: ror{{s?}} [[REG:r[0-9]+]], {{r[0-9]+}}, {{#5|#0x5}}
// CHECK: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, [[REG]]
// CHECK-NOT: , ror
result = __SXTAB16_RORn(s32_1, s32_2, 5);

// CHECK-THUMB: ror{{.w|ne|s}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-ARM: ror{{(ne)?}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-ARM: ror{{s?|ne}} {{r[0-9]+}}, {{r[0-9]+}}
// CHECK: sxtab16 {{r[0-9]+}}, {{r[0-9]+}}, {{r[0-9]+}}
// CHECK-NOT: , ror
result = __SXTAB16_RORn(s32_1, s32_2, u8);
Expand Down
3 changes: 2 additions & 1 deletion CMSIS/Core/Test/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"requires": {
"arm:compilers/arm/armclang": "6.23.0",
"arm:compilers/arm/arm-none-eabi-gcc": "14.2.1",
"arm:compilers/arm/llvm-embedded": "20.1.0"
"arm:compilers/arm/llvm-embedded": "20.1.0",
"arm:compilers/iar/cxarm": "9.70.1"
}
}
7 changes: 1 addition & 6 deletions CMSIS/CoreValidation/Project/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def image_ext(self):
ext = {
CompilerAxis.AC6: 'axf',
CompilerAxis.GCC: 'elf',
CompilerAxis.IAR: 'elf',
CompilerAxis.IAR: 'out',
CompilerAxis.CLANG: 'elf',
}
return ext[self]
Expand Down Expand Up @@ -286,11 +286,6 @@ def qemu_exec(config):
return cmdline


@matrix_filter
def filter_iar(config):
return config.compiler == CompilerAxis.IAR


@matrix_filter
def filter_gcc_cm52(config):
device = config.device.match('CM52*')
Expand Down
5 changes: 3 additions & 2 deletions CMSIS/CoreValidation/Project/vcpkg-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
}
],
"requires": {
"arm:tools/kitware/cmake": "3.28.4",
"arm:tools/kitware/cmake": "3.31.5",
"arm:compilers/arm/armclang": "6.23.0",
"arm:compilers/arm/arm-none-eabi-gcc": "14.2.1",
"arm:compilers/arm/llvm-embedded": "20.1.0",
"arm:compilers/iar/cxarm": "9.70.1",
"arm:tools/open-cmsis-pack/cmsis-toolbox": "2.10.0",
"arm:models/arm/avh-fvp": "11.27.31",
"arm:tools/ninja-build/ninja": "1.12.0"
}
}
}
Loading
Loading