Repository navigation
Conversation
tmleman
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
December 3, 2026 16:50
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The moving Zephyr PR-head reference allows upstream pushes to change firmware and test dependencies for the same SOF commit, making builds non-reproducible.
1 open issue
What changed in this PR
This proof of concept extends SOF math unit tests to Cadence xt-run, exercising DSP-specific implementations without hardware while retaining native simulation.
Changes:
- Add ISS scenarios for FFT, DFT3, and advanced math tests.
- Provide ISS build configuration, headers, and library support.
- Reference the Zephyr PR providing the simulator boards.
| File | Description |
|---|---|
| west.yml | Select ISS-enabled Zephyr PR. |
| test/ztest/unit/math/fft_multi/testcase.yaml | Add FFT ISS scenarios. |
| test/ztest/unit/math/fft_multi/prj.conf | Configure diagnostics and heap metadata. |
| test/ztest/unit/math/fft_multi/CMakeLists.txt | Separate platform settings; add HiFi FFT source. |
| test/ztest/unit/math/fft_multi/boards/native_sim.conf | Preserve sanitizer-visible native allocations. |
| test/ztest/unit/math/dft3/testcase.yaml | Add DFT3 ISS scenarios. |
| test/ztest/unit/math/dft3/prj.conf | Enable floating-point diagnostics. |
| test/ztest/unit/math/dft3/CMakeLists.txt | Limit POSIX settings to native builds. |
| test/ztest/unit/math/advanced/functions/testcase.yaml | Add advanced math ISS scenarios. |
| test/ztest/unit/math/advanced/functions/prj.conf | Enable floating-point diagnostics. |
| test/ztest/unit/math/advanced/functions/CMakeLists.txt | Add ISS math-library integration. |
| test/ztest/unit/common/xtensa_iss/newlib_errno.c | Bridge newlib errno to Zephyr. |
| test/ztest/unit/common/xtensa_iss/include/platform/platform.h | Provide core-only platform stub. |
| test/ztest/unit/common/xtensa_iss/include/platform/lib/memory.h | Provide core-only memory stub. |
| test/ztest/unit/common/xtensa_iss/include/math.h | Declare reference math functions. |
Review effort: Balanced
| - name: zephyr | ||
| repo-path: zephyr | ||
| revision: 25851fa15cdc2dc9c395807bce97fa81c46c10ee | ||
| revision: pull/128018/head |
Use the head of zephyrproject-rtos/zephyr PR 128018 as the Zephyr revision. The PR adds the Intel ADSP core instruction-set simulator boards intel_adsp_iss/ace20_lnl_iss, ace30_ptl_iss and ace40_nvl_iss, and the ztest changes needed to run unit tests on them with the Cadence xt-run simulator. The PR is based on the current Zephyr main, so this also moves SOF from 25851fa15cdc to a newer Zephyr. The revisions of the imported modules do not change. A pull request reference moves with the PR. It has to be replaced with a commit of Zephyr main once the PR is merged. Link: zephyrproject-rtos/zephyr#128018 Assisted-by: Copilot:claude-fable-5.2 Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Add a scenario that builds the DFT3 unit test with xt-clang for the Intel ADSP instruction-set simulator boards and runs it with xt-run, on the ACE20 (HiFi4), ACE30 (HiFi4) and ACE40 (HiFi5) core profiles. The native_sim scenario is unchanged. To build for a non-POSIX target, apply the POSIX platform include directory and the CONFIG_ZEPHYR_POSIX and CONFIG_LIBRARY definitions only to POSIX builds, and stop excluding the Xtensa architecture. Enable CONFIG_CBPRINTF_FP_SUPPORT, the test prints its error figures as floating point values. The ISS scenario has no integration_platforms entry: the boards only support xt-clang, and Twister in integration mode reports an integration platform that the selected toolchain cannot build as an error. Assisted-by: Copilot:gpt-6.1-sol Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Add a scenario that builds the multi-size FFT unit test with xt-clang for the Intel ADSP instruction-set simulator boards and runs all eleven FFT and IFFT cases with xt-run, with the same reference vectors and tolerances as on native_sim. To build for the simulator: - apply the POSIX platform include directories and definitions only to POSIX builds, and stop excluding the Xtensa architecture; - add core-only platform headers for the ISS boards. They are empty: the core simulator has no SOF platform devices and no ACE memory map, the SOF heap of zephyr/lib/alloc.c uses the linker-provided bounds; - link fft_32_hifi3.c, which provides the 32 bit FFT on HiFi targets and compiles to nothing elsewhere; - move CONFIG_SOF_NATIVE_SIM_HOST_HEAP to a native_sim board configuration, the option does not exist for other boards. Enable CONFIG_CBPRINTF_FP_SUPPORT for the floating point values in the test messages. The ISS scenario has no integration_platforms entry, for the same reason as in the dft3 test. Assisted-by: Copilot:gpt-6.1-sol Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Add a scenario that builds the math advanced functions suite with xt-clang for the Intel ADSP ISS boards and runs it with xt-run. On these targets sofm_exp_approx(), sofm_exp_fixed() and sofm_db2lin_fixed() come from the HiFi implementation in src/math/exp_fcn_hifi.c, which no unit test executed so far: on native_sim the file compiles to nothing and the generic exp_fcn.c is tested instead. The tests calculate their reference values with libm functions. For the ISS targets: - link the math library of the Cadence toolchain. It is built against newlib and needs __errno(), which the Zephyr minimal C library does not have, so add a hook that returns the Zephyr errno; - declare exp(), fabs(), fabsf(), pow() and round(). The math.h of the minimal C library only declares sqrt() and sqrtf(), and without a prototype the calls return garbage; - scope the POSIX include directories and definitions to native_sim. Enable CONFIG_CBPRINTF_FP_SUPPORT, the failure messages of the tests print floating point values. Verification: - 8/8 cases pass on intel_adsp_iss/ace20_lnl_iss (HiFi4), ace30_ptl_iss (HiFi4) and ace40_nvl_iss (HiFi5), and on native_sim, also with ASan/LSan. - The ISS image links the three functions from exp_fcn_hifi.c; the object of exp_fcn.c has no code there. - Mutation test: adding 64 to the result of sofm_exp_fixed() in exp_fcn_hifi.c fails test_function_sofm_exp_fixed and test_function_sofm_db2lin_fixed on the ISS and does not affect native_sim. Reverted, no diff remains. The ISS scenario has no integration_platforms entry: the boards only support xt-clang, and Twister in integration mode reports an integration platform that the selected toolchain cannot build as an error. Closes thesofproject#11591 Assisted-by: Copilot:claude-fable-5.2 Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
lgirdwood
reviewed
Dec 3, 2026
lgirdwood
left a comment
Member
There was a problem hiding this comment.
What output do we get in CI for tests ? i.e. if we assert or crash does it produce the full zephyr oops message ?
PR 11614: test resultsRun date: 2026-12-03 20:12 UTC Tested commit: f47169807b5dd447d18b600774882fb1a9a1accf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.