Draft
Conversation
d7d6b73 to
77fa25d
Compare
Member
Author
77fa25d to
1457ed3
Compare
If CONFIG_SOF_BOOT_TEST_STANDALONE is set, ipc_init() is terminated early. This ensures SOF will not start to generate or respond to IPC messages that could potentially interfere with standalone test cases (some of which send and receive IPCs). The current implementation leaves the component list uninitialized and this can cause trouble to standalone tests that want to utilzie common IPC code to build messages. Fix this problem by executing more of ipc_init() also in the standalone mode. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add a method to add access to a component object to a particular thread. This is required as component object state includes kernel objects and to use these from user-space, access needs to be granted. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
In userspace LL builds, use a mutex to protect component connections. This code shoudl work for kernel builds, but at least now add new code under a ifdef to avoid the cost of additional mutex object. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
- replace dynamically-allocated k_mutex *list_mutex with embedded sys_mutex - remove k_object_alloc in comp_init, k_object_release in comp_free - remove comp_grant_access_to_thread() function and caller - update PPL_LOCK/PPL_UNLOCK and ipc-helper lock sites Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add sof_sys_user_heap_get() to get heap object to use for SOF audio application heap allocations. When SOF is built with CONFIG_SOF_USERSPACE_LL, this will return a heap that can be used for user-space code. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add APP_SYSUSER_BSS() and APP_SYSUSER_DATA() macros to put global objects to a memory partition that is available to the user context used to run main SOF application. If SOF is run in kernel space, these are no-ops, but if CONFIG_SOF_USERSPACE_LL is set, a dedicated memory partition is used. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add a built option to make sof_heap_allo/free available as system calls to user-space. Add a test case for the functions that runs in a user-space thread. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Separate the state for LL scheduler memory into kernel and user accessible resources. The pointer to the LL heap must be accessible from user-space, so that user space can allocate memory and pass the heap pointer as argument. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Turn the pdata->sem into a dynamic object in userspace LL builds. Keep statically allocated semaphore for kernel LL builds. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Replace the dynamically-allocated k_sem (via k_object_alloc) in zephyr_ll_pdata with an embedded sys_sem. The dynamic kernel semaphore could not be freed from user-space threads, causing kernel object leaks that exhausted the kernel object pool during long test runs. sys_sem uses k_futex in user mode and lives in user memory, so no kernel object allocation or cleanup is needed. Add POSIX no-op stubs for sys_sem to maintain testbench build compatibility. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Move the user-accessible heap pointer to common partition defined in userspace_helper.h. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add a heap parameter to DMA scatter-gather allocation interface. This makes it possible to control how allocations are done for the DMA buffers. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Continue the work in commit 9567234 ("buffer: allocate on specific heap") and add ability to specify the heap to all buffer interface functions. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add an overlay for Intel 'ptl' target that allows to build SOF with all audio pipeline code running in Zephyr user-sapce. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Allow a non-null pointer at the end of the DMA transfer block list, if and only if it points to the first entry in the block list. The SOF DAI module sets the DMA transfers blocks like this and this change is required to use DAI module from user-space. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The platform data descriptions need to be accessible to all threads. These are e.g. used when setting up host/DAI copiers and they need platform DMA properties. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Use separate heaps depending whether host copier is run in user or kernel space. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
For historical reasons, host-zephyr has somewhat complicated code to manage the DMA channel instance information. When a DMA channel is allocated, a pointer to the system DMA channel table is acquired and some additional information is stored per channel. This is however redundant as the only piece of information actually needed is the channel index. Simplify the code by not storing the channel pointer anymore, but rather just store the channel index and use that in all calls to the DMA driver. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Make sure we use the same heap to allocate DMA SG buffers as we use for other component resources. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
These interfaces are no longer used anywhere, so they can be safely removed. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
TBD if needed Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
TBD if needed. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add the --rebuild option to sof-qemu-run.py to optionally skip Zephyr build/recompilation steps, enabling faster iterative testing for ztest and valgrind runs. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Remove the qemu_started variable constraint to ensure the script drops into QEMU monitor and dumps registers after 2 seconds of log inactivity, regardless of explicit Zephyr boot strings. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Check the modification time of external QEMU log files (-D, MTRACE) instead of relying solely on stdout to prevent premature unresponsiveness timeouts. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Remove the -D QEMU trace log from the inactivity monitor since a crashing Zephyr firmware running an infinite loop will keep QEMU pumping instructions to the -D log. Instead, strictly monitor the ace-mtrace file which stops accurately on crashes. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Refactor the runner to open a concurrent file descriptor against the ace-mtrace file, instantly scanning it for 'halting system' messages instead of relying on delayed filesystem mtime. Timeout is extended to 5 seconds to gracefully account for the initial Zephyr banner loading gap. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Introcude args.timeout (default 5.0) allowing users to pass greater thresholds for tests that naturally take longer to exhibit initial output gaps. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Allow users to specify the number of CPU cores for the QEMU machine, extending -smp appropriately and seamlessly integrating with existing west build loops. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Enable users to spawn a TCP QEMU monitor socket (defaults to localhost:1025) using -monitor tcp:localhost:PORT,server,nowait syntax. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Map the __log_strings linker section directly into the user thread's memory domains to restore userspace accessibility to LOG_INF calls. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Substituted the previously hardcoded mpart2 0x400be000 block with dynamic log_part linker mappings identically across the full test suite. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…cros Leverage ROUND_DOWN and ROUND_UP macros from zephyr/sys/util.h to establish the dynamic memory bounds for .log_strings, dropping arbitrary bitwise operations for clearer upstream conformity. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Substituted arbitrary 4096 integer allocations with CONFIG_MMU_PAGE_SIZE across partition bindings and memory bounds to respect underlying compilation constants dynamically. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…fix XTENSA linkage Substituted missing __log_strings linker symbols strictly with the Zephyr __rodata_region_start equivalents. Intel ADSP targets typically funnel strings into generic .rodata, negating isolated log strings allocations. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…aults Userspace log emissions dynamically execute against k_log_partition data allocations to evaluate filter levels. Restored access to this data by securely mapping the global structurally exported partition into the generic userspace test domains instead of hardcoding arbitrary memory intercepts. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…gion to fix XTENSA linkage" This reverts commit 49342ff4a75cb5ee414f2a4bdd80d259308670eb.
…egion to fix XTENSA linkage" This reverts commit c0a85a8c1083e5f09dbd0668dbc2ab8610c0fdd7.
Substituted missing k_mem_domain_remove_partition closures at the end of the un-synchronized userspace tests to ensure complete environmental cleanup and prevent overlapping domain memory locks. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
… log structure targets instead of generalized rodata Substituted wide-reaching __rodata_region mappings strictly to the constrained z_data_smem_k_log_partition allocations. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Since log_part was refactored to manually wrap the z_data_smem_k_log_partition boundaries to avoid mapping the entire __rodata blob, the secondary &k_log_partition attachments became overlapping duplicates. Stripped the overlapping domain attachments to leave a single clean mapping. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Commented out test_user_thread and test_user_thread_with_sem from the sof_boot test suite to isolate test execution. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…builds Automated the injection of the SOF_USERSPACE_LL configuration variable natively into the mathematical ZTest compilation loop. This enables CMake to conditionally bundle the critical IPC4 userspace pipeline tests alongside the arithmetic suites. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This adds: 1. --load-llext implementation triggering SOF_IPC4_GLB_LOAD_LIBRARY over TCP. 2. --start-core for dynamic secondary DSP initialization logic relying on SOF_IPC4_MOD_SET_DX. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Wrapped audio test compilation rules in zephyr_library_sources_ifdef to prevent compiler linkage errors when optional components are disabled. Injected essential core components (SRC, Copier, Mixin, Volume) to the ztest compilation hook. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
… measurements Since SOF_TELEMETRY can be toggled via conditions (such as isolated test builds toggling SOF_USERSPACE_LL), the SOF_TELEMETRY_PERFORMANCE_MEASUREMENTS Kconfig needs a strict 'depends on SOF_TELEMETRY' to prevent the framework from blindly compiling performance_monitor.c while telemetry.c is disabled, which reliably leads to undefined reference linker crashes for 'telemetry_get_systick_info_ptr'. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Since enabling the IPC4 Pipeline tests introduces ~27 additional audio test threads and module workers into the build, the native kobject prebuilt hash exceeds the default thread bytes limit during post-link. Increased CONFIG_MAX_THREAD_BYTES to 4 to allow the python indexer to definitively accommodate the dynamic ztest suites. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Since CONFIG_SOF_BOOT_TEST inherently controls whether tests are launched during firmware initialisation, replacing the rigid CONFIG_SOF_BOOT_TEST_STANDALONE condition natively allows ZTests to be cleanly bundled inside fully-featured firmware payloads without exclusively executing in isolated testing modes. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Added the '--test-fw-standard' execution path to the QEMU automation runner. This compiles a fully-functional baseline firmware topology (avoiding the isolated STANDALONE runtime) but still transparently links the ZTest executable blocks so they can trigger via the standard IPC boot hook. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
d8191af to
498d45a
Compare
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.
Very basic/simple ztest to start with user LL. For developers only, lots still todo. Includes qemu support for dc233c atm.