feat(ccu): add core microcode planning - #72
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4a21ed788f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ((spec.ckeId == 0 || spec.mask == 0) && (spec.waitCkeId == 0 || spec.waitMask == 0)) { | ||
| return TILEXR_ERROR_PARA_CHECK_FAIL; |
There was a problem hiding this comment.
Reject incomplete CKE identifier and mask pairs
When either the set pair or wait pair is complete, this condition accepts a malformed second pair such as ckeId != 0, mask == 0, and the encoder emits that partial operation into the instruction. The transfer encoders already require each ID/mask pair to be either fully present or fully absent; the SetCKE and analogous ClearCKE path should enforce the same rule so malformed synchronization requests cannot produce invalid microcode.
Useful? React with 👍 / 👎.
| const uint32_t localXnCount = std::max(localSqeXnCount, request.syncResourceCount); | ||
| const uint32_t remoteXnCount = request.syncResourceCount; |
There was a problem hiding this comment.
Skip XN allocation for CKE-only barrier modes
With no SQE-load task, SyncCke, SyncCkePostOnly, and the local-CKE modes encode no XN operations—the barrier builder explicitly omits XNs from their required resources—yet the allocator still reserves one local and one remote XN per sync resource. A valid CKE-only request can therefore fail with insufficient XN resources despite having enough CKE and channel capacity; derive these counts from barrierMode instead of allocating them unconditionally.
Useful? React with 👍 / 👎.
Summary
Stack
1 of 9. Base:
main.Validation
git diff --checkpython3 -m unittest tests.ccu.test_tilexr_ccu_barrier_program tests.ccu.test_tilexr_ccu_memory_program tests.ccu.test_tilexr_ccu_microcode tests.ccu.test_tilexr_ccu_producer_plan tests.ccu.test_tilexr_ccu_resource_allocator tests.ccu.test_tilexr_ccu_runtime_boundary tests.ccu.test_tilexr_ccu_specsScope
Host-only validation. No direct CCU data-plane claim.