Skip to content

vpu_tests#233

Merged
uvvpavel merged 4 commits into
developfrom
xs3_tests
May 22, 2026
Merged

vpu_tests#233
uvvpavel merged 4 commits into
developfrom
xs3_tests

Conversation

@uvvpavel
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_tests Unity test app and wired it into tests/CMakeLists.txt and Jenkinsfile.
  • Introduced xmath/vpu/* umbrella headers and updated includes across the library/tests to use the new path and macro names.
  • Added tests/xc_compat app 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 (and printf is not declared). This will typically fail to compile with modern toolchains / -Werror due to implicit function declaration. Include <stdio.h> (or remove the printf() 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 like INT8_MIN/INT16_MIN/INT32_MIN, but it doesn't include <stdint.h>. Including xmath/vpu/vpu.h directly 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() returns int16_t, but these tests use TEST_ASSERT_EQUAL_INT8() (and compare against VPU_INT16_MAX/MIN). This truncates the expected/actual values and makes the test incorrect. Use TEST_ASSERT_EQUAL_INT16() for these checks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.rst Outdated
Copy link
Copy Markdown

@xalbertoisorna xalbertoisorna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are good changes, nice to see both vx4 and xs3 tests passing on CI 👍
My only comment to discuss together is the vx4b preference against xs3 and host behavior, this is aplied in different places, see comments below.

Comment thread lib_xcore_math/api/xmath/vpu/vpu_info.h Outdated
Comment thread lib_xcore_math/api/xmath/vpu/vpu_info.h
Comment thread lib_xcore_math/api/xmath/vpu/vpu_info.h
Comment thread lib_xcore_math/api/xmath/vpu/vpu_scalar_ops.h
Comment thread tests/vpu_tests/src/test_vpu_scalar_ops_s16.c
Comment thread Jenkinsfile
@uvvpavel uvvpavel merged commit c321020 into develop May 22, 2026
3 checks passed
@uvvpavel uvvpavel deleted the xs3_tests branch May 22, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants