Skip to content

Add XS and VX build and test support - #67

Open
xross wants to merge 1 commit into
xmos:developfrom
xross:feature/vx
Open

Add XS and VX build and test support#67
xross wants to merge 1 commit into
xmos:developfrom
xross:feature/vx

Conversation

@xross

@xross xross commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Build and test lib_xassert on both XS and VX architectures.
  • Use lib_basix for portable trap, timer, delay, and print support.
  • Replace XS-specific timer assembly and toolchain dependencies.
  • Add portable C coverage for assertions, failures, unreachable code, and timing checks.
  • Retain XC compatibility tests on XS while excluding them from VX builds.
  • Make application hardware targets overrideable from Jenkins.
  • Use XJSL runPytest() for test execution and reporting.

Dependency

Depends on the corresponding lib_basix compatibility changes (released in v0.1.0)

@xross
xross force-pushed the feature/vx branch 3 times, most recently from 698fd55 to a809158 Compare August 7, 2026 13:24
@xross
xross requested review from xalbertoisorna and a lite review from Copilot August 7, 2026 13:33

Copilot AI left a comment

Copy link
Copy Markdown

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 updates lib_xassert to build and run its examples/tests on both XS and VX targets by switching platform-specific trap/print/timer dependencies to lib_basix, adding portable C-based tests, and updating CI (Jenkins) to run architecture-specific build/test flows.

Changes:

  • Replace XS-specific trap/timer usage with lib_basix APIs in the xassert public header and example code.
  • Add new C test applications/expected outputs and gate XC-compatibility tests behind a CMake option for VX builds.
  • Update Jenkins pipeline to build/test separately on XS and VX and use runPytest() for reporting; make hardware target overrideable via APP_HW_TARGET.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/CMakeLists.txt Adds C-test subdirectories and gates XC tests via XASSERT_BUILD_XC_TESTS.
tests/assert_c_test/src/main.c New C assertion test app.
tests/assert_c_test/CMakeLists.txt Registers new C assertion test app with overrideable target.
tests/assert_c_test.expect Expected output for C assertion failure.
tests/assert_unit_c_test/src/main.c New C “unit” assertion test with per-unit debug config.
tests/assert_unit_c_test/CMakeLists.txt Registers new C unit assertion test app.
tests/assert_unit_c_test.expect Expected output for unit assertion failure.
tests/fail_c_test/src/main.c New C fail() test app.
tests/fail_c_test/CMakeLists.txt Registers new C fail() test app.
tests/fail_c_test.expect Expected output for fail().
tests/unreachable_c_test/src/main.c New C unreachable() test app.
tests/unreachable_c_test/CMakeLists.txt Registers new C unreachable() test app.
tests/unreachable_c_test.expect Expected output for unreachable().
tests/timing_block_c_test/src/main.c Updates timing test to use basix_delay_ticks().
tests/timing_debug_c_test/src/main.c Updates timing test to use basix_delay_ticks().
tests/timing_loop_c_test/src/main.c Replaces hwtimer usage with basix_delay_ticks().
tests/assert_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/assert_test_unit/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/fail_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/unreachable_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/timing_block_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/timing_debug_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/timing_loop_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/timing_block_c_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/timing_debug_c_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
tests/timing_loop_c_test/CMakeLists.txt Makes APP_HW_TARGET overrideable.
examples/deps.cmake Adds lib_basix as a common example dependency.
examples/app_assert/CMakeLists.txt Makes APP_HW_TARGET overrideable.
examples/app_fail/CMakeLists.txt Makes APP_HW_TARGET overrideable.
examples/app_timed_block/CMakeLists.txt Makes APP_HW_TARGET overrideable.
examples/app_timed_loop/CMakeLists.txt Makes APP_HW_TARGET overrideable.
examples/app_timing_loop_exception/CMakeLists.txt Makes APP_HW_TARGET overrideable.
examples/app_unreachable/CMakeLists.txt Makes APP_HW_TARGET overrideable.
examples/app_timed_loop/src/fn_no_assert.c Switches printing include to <basix/print.h>.
lib_xassert/lib_build_info.cmake Declares lib_basix dependency at 0.1.0.
lib_xassert/api/xassert.h Switches to lib_basix trap/print/time APIs and BASIX timer frequency.
Jenkinsfile Splits XS/VX build+test stages and uses runPytest().
README.rst Documents XS/VX support and adds lib_basix as a dependency.
CHANGELOG.rst Adds UNRELEASED entries describing the changes.

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

Comment thread lib_xassert/api/xassert.h
Comment on lines 124 to +129
# define fail_timing(tag, actual, limit, file, line) do { printstr("Timing failed for: "); \
printf("%s", (const char *) tag); \
fflush(stdout); \
printstr("\nΔt = "); printint(actual); printstr(" ticks ("); printint((actual) * 10); printstr(" ns), "); \
printstr("limit = "); printint(limit); printstr(" ticks ("); printint((limit) * 10); printstr(" ns) "); \
xassert_timing_print_line(file, line); __builtin_trap();\
xassert_timing_print_line(file, line); basix_trap();\
Comment thread examples/deps.cmake Outdated

@xalbertoisorna xalbertoisorna left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have not done a extensive review but all looks good one minor comment.

@@ -0,0 +1,2 @@
0
Unhandled exception: ECALL, data: 0x00000000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ive observed xrun and xsim produce different outputs?

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