Draft
Add meta-IRQ based mayfly HAL implementation with babblesim test coverage#32
Conversation
Copilot created this pull request from a session on behalf of
cvinayak
May 28, 2026 20:31
View session
Copilot
AI
changed the title
Add meta-IRQ based mayfly HAL implementation
Add meta-IRQ based mayfly HAL implementation with babblesim test coverage
May 28, 2026
Add meta-IRQ based mayfly implementation with Kconfig option. Add CONFIG_BT_CTLR_MAYFLY_META_IRQ Kconfig option and a new mayfly_meta_irq.c HAL implementation that uses Zephyr meta-IRQ priority threads instead of SWI/NVIC for mayfly scheduling. Each mayfly execution context (LLL, ULL_HIGH, ULL_LOW) gets a dedicated meta-IRQ thread. mayfly_pend() wakes the corresponding thread via a semaphore, and the thread calls mayfly_run() for that context. Assisted-by: Github CoPilot: Claude Opus 4.6 Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add babblesim encrypted conn test with meta-IRQ mayfly variant. Add a new babblesim coverage test variant of basic_conn_encrypted_split that uses the meta-IRQ based mayfly implementation instead of SWI. New files: - prj_split_meta_irq.conf: Config enabling BT_CTLR_MAYFLY_META_IRQ - tests_scripts/basic_conn_encrypted_split_meta_irq.sh: Test script Assisted-by: Github CoPilot: Claude Opus 4.6 Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Trivial re-order of compilations in the compile script to keep similar feature tests grouped together. Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
d8e0323 to
96e470a
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.
The existing
hal/nrf5/mayfly.cuses ARM Cortex-M SWI IRQs and NVIC tail-chaining to schedule mayfly execution contexts. This adds a portable alternative using Zephyr meta-IRQ threads, and a babblesim test to exercise it.Meta-IRQ mayfly implementation
CONFIG_BT_CTLR_MAYFLY_META_IRQ— New Kconfig to select meta-IRQ threads over SWI. RequiresNUM_METAIRQ_PRIORITIES > 0.CONFIG_BT_CTLR_MAYFLY_META_IRQ_STACK_SIZE— Per-thread stack size (default 1024).hal/nrf5/mayfly_meta_irq.c— Three dedicated meta-IRQ threads (LLL, ULL_HIGH, ULL_LOW), one per execution context.mayfly_pend()posts a semaphore; the thread wakes and callsmayfly_run().K_HIGHEST_THREAD_PRIO, ULL_HIGH → +1, ULL_LOW → +2.CMakeLists.txt— selectsmayfly_meta_irq.cormayfly.cbased on Kconfig.Babblesim test
prj_split_meta_irq.conf— Based onprj_split.conf, enablesBT_CTLR_MAYFLY_META_IRQwith 4 meta-IRQ priorities.basic_conn_encrypted_split_meta_irq.sh— Runs the encrypted connection test (peripheral + central_encrypted) against the meta-IRQ mayfly build. Auto-discovered bytests.nrf52bsim.txt.