Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new vpu_tests test application and renames/migrates VPU-related headers from xmath/xs3/ to xmath/vpu/, updating library code, tests, and CI accordingly. It also adds an XC compatibility build to ensure xmath/xmath.h can be included from XC sources.
Changes:
- Added new
tests/vpu_testsUnity test app and wired it intotests/CMakeLists.txtandJenkinsfile. - Introduced
xmath/vpu/*umbrella headers and updated includes across the library/tests to use the new path and macro names. - Added
tests/xc_compatapp and CI step to validate XC compilation.
Reviewed changes
Copilot reviewed 93 out of 98 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/xc_compat/src/dummy.xc | XC compilation compatibility app source (includes xmath from XC). |
| tests/xc_compat/CMakeLists.txt | CMake project to build the XC compatibility app. |
| tests/vpu_tests/src/unity_config.h | Unity configuration for the new VPU test app. |
| tests/vpu_tests/src/tst_common.h | Common test helpers/macros for VPU tests. |
| tests/vpu_tests/src/tst_common.c | Implements test-detail helpers for Unity reports. |
| tests/vpu_tests/src/tst_asserts.h | Additional assertion helpers used by VPU tests. |
| tests/vpu_tests/src/test_vpu_scalar_ops_s8.c | VPU scalar-op tests for s8, incl. VX4B conditionals. |
| tests/vpu_tests/src/test_vpu_scalar_ops_s16.c | VPU scalar-op tests for s16, incl. VX4B conditionals. |
| tests/vpu_tests/src/test_vpu_scalar_ops_s32.c | VPU scalar-op tests for s32, incl. formatting/behavior updates. |
| tests/vpu_tests/src/main.c | Unity test runner main() for vpu_tests. |
| tests/vpu_tests/CMakeLists.txt | Build definition for the new vpu_tests application. |
| tests/vect_tests/src/vect/test_vect_zip.c | Update includes to new VPU header path / cleanup whitespace. |
| tests/vect_tests/src/vect/test_vect_sqrt.c | Update includes/formatting and VX4B conditional assertion tweak. |
| tests/vect_tests/src/vect/test_vect_scale.c | Update includes to new VPU header path / formatting fixes. |
| tests/vect_tests/src/vect/test_vect_s32_convolve.c | Remove old xs3 VPU include. |
| tests/vect_tests/src/vect/test_vect_mul.c | Remove old xs3 VPU include and minor formatting fix. |
| tests/vect_tests/src/vect/test_vect_min_elementwise.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/test_vect_max_elementwise.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/test_vect_macc.c | Remove old xs3 VPU include and formatting cleanup. |
| tests/vect_tests/src/vect/test_vect_log.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/test_vect_inverse.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/test_vect_exp.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/test_vect_copy.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/test_vect_add_scalar.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/float/test_vect_s32_to_f32.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/float/test_vect_f32_to_s32.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/float/test_vect_f32_dot.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/float/test_vect_f32_add.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/float/test_vect_complex_f32_mul.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/float/test_vect_complex_f32_macc.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/complex/test_vect_complex_sub.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/complex/test_vect_complex_real_scale.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/complex/test_vect_complex_macc.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/complex/test_vect_complex_conj_macc.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/vect_tests/src/vect/complex/test_vect_complex_add_scalar.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/CMakeLists.txt | Register vpu_tests in the overall tests build. |
| tests/bfp_tests/src/bfp/real/test_bfp_use_exponent.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/bfp_tests/src/bfp/real/test_bfp_sqrt_vect.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/bfp_tests/src/bfp/real/test_bfp_inverse.c | Remove old xs3 VPU include. |
| tests/bfp_tests/src/bfp/real/test_bfp_convolve.c | Remove old xs3 VPU include and whitespace cleanup. |
| tests/bfp_tests/src/bfp/complex/test_bfp_complex_use_exponent.c | Remove old xs3 VPU include and whitespace cleanup. |
| README.rst | Update “Known issues” to reflect native build VPU emulation constraints. |
| lib_xcore_math/src/vect/vpu_helper.h | Remove old xs3 vpu_info include (now via unified headers). |
| lib_xcore_math/src/vect/prepare.c | Remove old xs3 scalar-ops include and minor formatting. |
| lib_xcore_math/src/dct/dct_inverse.c | Remove xs3-only conditional include and minor whitespace cleanup. |
| lib_xcore_math/src/dct/dct_forward.c | Remove xs3-only conditional include and minor whitespace cleanup. |
| lib_xcore_math/src/arch/vx4b/vect_s16/vect_s16_dot.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/vx4b/scalar/scalar_op_s8.S | Fix comments/sign-extension and align VX4B scalar op behavior. |
| lib_xcore_math/src/arch/vx4b/scalar/scalar_op_s32.S | Adjust VX4B complex op load/setup sequence. |
| lib_xcore_math/src/arch/vx4b/scalar/float_s32.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/vx4b/chunk_s16/chunk_s16_accumulate.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vpu_scalar_ops.c | Make shifts/return types architecture-aware via new VPU constants. |
| lib_xcore_math/src/arch/ref/vect_zip.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_sXX.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_sum.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_stats.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/vect_sqrt.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_shl.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_s16_extract.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_mul.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_macc.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_inverse.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/vect_f32.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/vect_dot.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_depth_convert.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_copy.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_convolve.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/vect_add_sub.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/vect_abs_clip_rect.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/qXX.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/misc.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/matrix/mat_mul_s8_x_s8_yield_s32.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/float_s32.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/filter/filter_fir_s32.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/fft/fft_util.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/f32.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/dct/idct.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/dct/dct8x8.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/dct/dct.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/complex/vect_complex_mul.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/complex/vect_complex_mag.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/complex/vect_complex_macc.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/complex/vect_complex_conjugate.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/src/arch/ref/complex/vect_complex_conj_macc.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/chunk.c | Remove old xs3 scalar-ops include and whitespace cleanup. |
| lib_xcore_math/src/arch/ref/chunk_s16_accumulate.c | Remove old xs3 scalar-ops include. |
| lib_xcore_math/api/xmath/xmath.h | Include new xmath/vpu/vpu.h umbrella; remove xs3-only include. |
| lib_xcore_math/api/xmath/vpu/vpu.h | New umbrella header for VPU info + scalar ops. |
| lib_xcore_math/api/xmath/vpu/vpu_scalar_ops.h | Move includes to xmath/vpu/* and adjust VX4B conditionals. |
| lib_xcore_math/api/xmath/vpu/vpu_info.h | Rename macros/types and add VX4B-specific shift constants. |
| lib_xcore_math/api/xmath/vect/chunk_s32.h | Update include to new VPU info header location. |
| lib_xcore_math/api/xmath/scalar/scalar_misc.h | Update include to new VPU info header location. |
| lib_xcore_math/api/xmath/scalar/s32.h | Update include to new VPU info header location. |
| lib_xcore_math/api/xmath/scalar/s16.h | Update include to new VPU info header location. |
| Jenkinsfile | Run vpu_tests and add XC compatibility build step in CI. |
| doc/rst/src/tests.rst | Remove unit test build documentation page. |
| doc/rst/lib_xcore_math.rst | Drop reference to removed src/tests doc page. |
| CHANGELOG.rst | Document the header folder rename and macro rename. |
Comments suppressed due to low confidence (3)
tests/xc_compat/src/dummy.xc:18
printf()is used in this XC file but<stdio.h>is never included (andprintfis not declared). This will typically fail to compile with modern toolchains /-Werrordue to implicit function declaration. Include<stdio.h>(or remove theprintf()call if you only need an include-only compile check).
lib_xcore_math/api/xmath/vpu/vpu_info.h:6- This public header uses fixed-width integer types (
int32_t,int64_t) and limit macros likeINT8_MIN/INT16_MIN/INT32_MIN, but it doesn't include<stdint.h>. Includingxmath/vpu/vpu.hdirectly will include this header before any other standard headers, causing compilation failures. Add#include <stdint.h>to make the header self-contained.
tests/vpu_tests/src/test_vpu_scalar_ops_s32.c:267 vdepth16_32()returnsint16_t, but these tests useTEST_ASSERT_EQUAL_INT8()(and compare againstVPU_INT16_MAX/MIN). This truncates the expected/actual values and makes the test incorrect. UseTEST_ASSERT_EQUAL_INT16()for these checks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
xalbertoisorna
approved these changes
May 22, 2026
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.