Commit graph

57 commits

Author SHA1 Message Date
Gerard Marull-Paretas 6810a53297 twister: s/riscv(32|64)/riscv
Only riscv is supported now, any 32/64-bit requirements need to use
CONFIG_64BIT now.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-02-26 12:49:06 +01:00
Benedikt Schmidt aa25e212d1 tests: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Anas Nashif 345735d0a8 tests: remove CONFIG_ZTEST_NEW_API in all tests
Remove all usage of CONFIG_ZTEST_NEW_API from tests and sample as this
is now enabled by default.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-20 15:04:29 +02:00
Gerard Marull-Paretas 9c961571a2 modules: cmsis: move glue code to modules/cmsis
The CMSIS module glue code was part of arch/ directory. Move it to
modules/cmsis, and provide a single entry point for it: cmsis_core.h.
This entry header will include the right CMSIS header (M or A/R).

To make this change possible, CMSIS module Kconfig/CMake are declared as
external, allowing us to add a new Zephyr include directory.

All files including CMSIS have been updated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-08-24 13:20:21 +02:00
Ryan McClelland 9ce16f8465 tests: kernel: fpu_sharing: fix double-promotions
Double promotion warnings are generated with the flag -Wdouble-promotion

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-08-18 12:06:31 +02:00
Johan Hedberg 03905f7e55 boards: x86: Add intel_ prefix to Elkhart Lake boards
This follows the same convention that has already been adopted by Intel
Alder Lake and Raptor Lake boards.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-08-15 11:24:35 +00:00
Daniel Leung 174caf0c10 tests: kernel: renames shadow variables
Renames	shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Huifeng Zhang 9edd2951ef tests: kernel: fpu_sharing: Add double type support
Use double type when FPU supports double precision.

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-06-21 16:06:08 +02:00
Huifeng Zhang 1cec85dc07 tests: kernel: fpu_sharing: Enable it on VFP platfrom of aarch32
- Remove raising compilation error in `float_regs_arm_gcc.h`
    These macros are checked in 'load_store.c', so no need to check them
    again in 'float_regs_arm_gcc.h'

- Enable this test on the VFP platform of aarch32

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2023-06-21 16:06:08 +02:00
Anas Nashif b835b02136 tests: cleanup metadata and filtering
- Add integration_platforms to avoid excessive filtering
- Make sure integration platforms are actually part of the filter
- Fix some tags and test meta data

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-06-13 09:38:27 -04:00
Jaxson Han 7d174eed41 test: kernel: fpu_sharing: Fix text exception by increasing the stack size
The test case will show an unexpected exception in the idle thread after
all test cases pass. The issue is caused by the main thread
stackoverflow.

Increase the main stack configured in this test case to fix the issue.

Signed-off-by: Jaxson Han <jaxson.han@arm.com>
2023-05-30 10:14:55 +02:00
Carlo Caione 6f3a13d974 barriers: Move __ISB() to the new API
Remove the arch-specific ARM-centric __ISB() macro and use the new
barrier API instead.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-05-24 13:13:57 -04:00
Carlo Caione cb11b2e84b barriers: Move __DSB() to the new API
Remove the arch-specific ARM-centric __DSB() macro and use the new
barrier API instead.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-05-24 13:13:57 -04:00
Gerard Marull-Paretas 93b63df762 samples, tests: convert string-based twister lists to YAML lists
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-10 09:52:37 +02:00
Keith Packard e17191b146 tests/fpu_sharing: Increase main stack size on riscv64
Looks like switching the main return value to int means that stack
frame persists and increases stack usage by a few bytes. Increase the
main stack size to avoid overflows.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Lucas Tamborrino 9e4d1a817c tests: kernel: fpu_sharing: generic: add xtensa testing
Add xtensa arch to FPU test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2023-04-08 12:34:25 +02:00
Kumar Gala d31814e990 tests: Fix floating point test variants on x86 w/LLVM
LLVM doesn't support SSE + 387 math.  As such if SSE is enabled we
have to utilize SSE floating point.  To utilize 387 math, SSE has
to be disabled.

Update the floating point related tests to introduce 387 only variants
that will build on both GCC & LLVM based tools.  Than we exclude llvm
based (llvm, oneApi) toolchains from the CONFIG_X86_SSE_FP_MATH=n and
CONFIG_X86_SSE=y test variants.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-02-21 08:25:38 -05:00
Nicolas Pitre 45623585ab tests/kernel/fpu_sharing/generic: enforce execution on a single CPU
This test relies on one thread interrupting another to exercize the FPU
sharing. On SMP those threads get one CPU each with no sharing of their
FPU making the test rather pointless.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-02-19 21:00:32 -05:00
Nicolas Pitre 189fcbb3af tests: float_disable: this is no longer applicable to RISC-V
With lazy FPU context switching, k_float_disable() is merely triggering
a synchronous FPU context save and k_float_enable() is a no-op.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2023-01-24 15:26:18 +01:00
Anas Nashif ed79b1f25e tests: use namespacing in extra_configs and drop duplicated scenarios
Use namespacing with extra_configs in some tests and remove duplicated
scenarios the were made arch or platform specifc.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-01-13 09:42:59 +01:00
Lucas Tamborrino a5515d43a5 tests: kernel: fpu_sharing: add xtensa arch
Add xtensa arch to Shared Floating Point Support test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2022-12-27 13:23:17 +01:00
Anas Nashif ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Kumar Gala 4f0166088c tests: move to using CONFIG_MP_MAX_NUM_CPUS
For tests that set CONFIG_MP_NUM_CPUS, switch to using
CONFIG_MP_MAX_NUM_CPUS instead as we work to phase out
CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-20 22:04:10 +09:00
Michał Barnaś dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Julius Barendt e54cc1f6d1 tests: fpu_sharing/generic: Remove qemu_leon3 workaround
This workaround is no longer needed as sparc stack footprint
is reduced in this commit:
5cf2083e8b87f918a522423a1659ae58137ceea0

Signed-off-by: Julius Barendt <julius.barendt@gaisler.com>
2022-08-03 12:05:49 +02:00
Fabio Baltieri def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Guo Lixin d6995cb050 tests: fpu_sharing/generic: workaround crash on qemu_leon3
When running tests/kernel/fpu_sharing/generic on qemu_leon3 with the
new ztest API, a fatal error is raised while test is reported success.
So workaround this by changing the main stack size to 2048.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-07-18 12:20:39 -04:00
Guo Lixin 948cb6a8d9 tests: kernel: generic: move to new ztest API
Move tests/kernel/fpu_sharing/generic/ to use new ztest API.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-07-18 12:20:39 -04:00
Guo Lixin 4f37c99601 tests: kernel: float_disable: move to new ztest API
Move tests/kernel/fpu_sharing/float_disable/ to use new ztest API.

Signed-off-by: Guo Lixin <lixinx.guo@intel.com>
2022-07-18 12:20:39 -04:00
Yinfang Wang e19fd4d3fa tests: fpu_sharing: Fix the skipped testing on acrn_ehl_crb
acrn_ehl_crb itself supports fpu_sharing.
Enable the fpu_sharing testing on acrn_ehl_crb.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-05-20 19:24:54 -07:00
Yinfang Wang dffe3508dc tests: fpu_sharing: Fix the skipped testing on ehl_crb
ehl_crb itself supports fpu_sharing.
  Enable the fpu_sharing testing on ehl_crb.

Signed-off-by: Yinfang Wang <yinfang.wang@intel.com>
2022-05-16 22:42:49 -04:00
Gerard Marull-Paretas ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Bradley Bolen afef64e236 tests: fpu_sharing: Support FPU disable test for Cortex-A/R
For testing, assume that the Cortex-A/R platforms are using a GIC
interrupt controller.  Use the last GIC SGI to trigger an interrupt for
the test.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2022-05-05 12:03:27 +09:00
Bradley Bolen 90b1c6a3e8 tests: fpu_sharing: Enable support for Cortex-R
Reuse the Cortex-M paths for testing the floating point unit.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2022-05-05 12:03:27 +09:00
Ederson de Souza ab17f69a72 tests/kernel/fpu_sharing: Run test with MP_NUM_CPUS=1
This test uses k_yield() to "sync" between threads, so it's implicitly
supposed to run on a single CPU. Make it explicit, to avoid issues on
platforms with more cores.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>

FIXKFLOATDISABLE
2022-02-25 19:13:50 -05:00
Carles Cufi e83a13aabf kconfig: Rename the TEST_EXTRA stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Daniel Leung 8f7f62869a tests: remove @return doc for void functions
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-12 16:02:16 -05:00
Torsten Rasmussen 1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Ioannis Glaropoulos 1a7228a462 tests: add fpu tag the tests which enable FPU and FPU_SHARING options
Introduce the fpu tag to tests that explicitly enable
the FPU and FPU_SHARING Kconfig options. The tag could
be used to run all FPU-related tests in the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-22 08:45:41 -04:00
Nicolas Pitre f1f63dda17 arm64: FPU context switching support
This adds FPU sharing support with a lazy context switching algorithm.

Every thread is allowed to use FPU/SIMD registers. In fact, the compiler
may insert FPU reg accesses in anycontext to optimize even non-FP code
unless the -mgeneral-regs-only compiler flag is used, but Zephyr
currently doesn't support such a build.

It is therefore possible to do FP access in IRS as well with this patch
although IRQs are then disabled to prevent nested IRQs in such cases.

Because the thread object grows in size, some tests have to be adjusted.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-05-03 11:56:50 +02:00
Katsuhiro Suzuki 19db485737 kernel: arch: use ENOTSUP instead of ENOSYS in k_float_disable()
This patch replaces ENOSYS into ENOTSUP to keep consistency with
the return value specification of k_float_enable().

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-03-25 14:13:23 +01:00
Eugeniy Paltsev 1b41da2630 ARC: Kconfig: rename CPU_ARCV2 option to ISA_ARCV2
* Rename CPU_ARCV2 to ISA_ARCV2. That helps to avoid conflict between
  CPU families naming and ISAs naming and aligns this options
  with other ARC OSS projects.

* Generalize ARCV2 check to ARC check where it is required.

NOTE: we add ISA_ARCV2 option in a choice list as a preparation
for ISA_ARCV3 addition.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2021-03-25 07:23:02 -04:00
Anas Nashif 5c90ceb105 clock: rename z_tick_get_32 -> sys_clock_tick_get_32
Do not use z_ for internal APIs, z_ is for private APIs within one
subsystem only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-19 11:22:17 -04:00
Daniel Leung e0fe89cdda tests: fpu_sharing: allow board qemu_x86_lakemont
This adds qemu_x86_lakemont to the platform allow list
for the FPU sharing tests. Since Lakemont supports SSE3
and SSSE3, it is better to test them also.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-19 18:51:04 -05:00
Daniel Leung ce44048d46 x86: rename CONFIG_SSE* to CONFIG_X86_SSE*
This adds X86 keyword to the kconfigs to indicate these are
for x86. The old options are still there marked as
deprecated.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-15 08:21:15 -05:00
Daniel Leung 735c0096ae tests: fpu_sharing: test both FPU and SSE on x86
On x86, it is possible to use FPU (387) and SSE for floating
point operations. So test both.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-02-15 08:21:15 -05:00
Martin Åberg 4604c45541 tests: enable and run many tests on RISC-V
This commit enables lots of tests on riscv32 and riscv64 which were
previously disabled.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2021-01-15 13:06:33 -05:00
Hake Huang 129ddfe5c6 tests: fpu_sharing fix print size issue
As FPU enalbed the printf code size is changed,
so increase main stack size to make test pass on NXP RT platforms

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-01-14 07:30:30 -05:00
Martin Åberg ebcdb210e3 tests/float_disable: ported to SPARC
Enable the test for SPARC and take into account that
arch_float_disable() returns -ENOSYS.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00
Martin Åberg 5fc94948a8 tests/fpu_sharing: ported to SPARC
Added the bits and pieces required to run the test on SPARC.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-12-04 14:33:43 +02:00