Repository navigation
Conversation
The existing FIR tests use at most 25 taps, so they never reach the generic Helium kernels of arm_fir_q15 (numTaps > 32) and arm_fir_q7 (numTaps > 64). New tests test_fir_long_q15 and test_fir_long_q7 in the FIR Q15 and FIR Q7 suites: - numTaps 34 to 200 (Q15) and 65 to 200 (Q7), blockSize 1 to 8, 13 and 16 (all the values of blockSize & 3), 3 successive calls on the same instance - references computed with an exact model of the fixed point FIR (PatternGeneration/FIR.py), compared bit exact - guard samples after the documented size of the state buffer to detect writes beyond it On Cortex-M55 these tests fail with the current Helium kernels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generic Helium kernels, used by arm_fir_q15 for numTaps > 32 and by arm_fir_q7 for numTaps > 64, had three defects: - the tail of the block (blockSize & 3 equal to 2 or 3) computed the outputs 1 and 2 from the wrong delayed samples (offsets 2 and 4 for Q15, 4 and 8 for Q7, instead of 1 and 2), and the Q15 tail of 3 samples shifted the accumulators twice - for each group of 4 outputs, a full vector of input samples (8 for Q15, 16 for Q7) was copied into the state and both pointers were advanced by the vector length: pSrc was read past the end of the block and pState was written past its documented size - the final copy of the history copied numTaps samples instead of numTaps - 1, reading one sample past the documented state size Only the input samples consumed by the outputs are now copied, with predicated loads and stores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 generic Helium kernels, used by
arm_fir_q15for numTaps > 32 and byarm_fir_q7for numTaps > 64, give wrong results and access memory outsidethe documented buffers. The existing FIR tests use at most 25 taps, so they
never reach these kernels.
Defects
computed from the wrong delayed samples (offsets 2 and 4 for Q15, 4 and 8
for Q7, instead of 1 and 2). For Q15, the tail of 3 samples also shifted
the accumulators twice.
16 for Q7) was copied into the state and both pointers were advanced by
the vector length :
pSrcwas read past the end of the block andpStatewas written past its documented size(numTaps + blockSize - 1).
numTaps - 1, reading one sample past the documented state size.