Add I2C target SCL high-spike filtering - #122
Draft
xross wants to merge 5 commits into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds SCL high-spike filtering to the I2C target (slave) implementation to improve robustness in the presence of short SCL high glitches (e.g., I3C bus coexistence), and introduces simulator-based tests to validate the behavior.
Changes:
- Add optional SCL high-spike filtering logic to
i2c_slave.xcand apply it to clock-edge handling and START/STOP detection. - Add a new Pyxsim/pytest test suite to inject short SCL high glitches at specific bit positions and verify behavior matches the existing expected output.
- Update test dependency wiring, build optimization flags, and the changelog.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_slave_scl_spike_filter.py | New simulator test injecting SCL high glitches at various pulse indices. |
| tests/requirements.txt | Changes how test_support is pulled in for tests (now via relative editable path). |
| tests/i2c_slave_test/CMakeLists.txt | Changes test app optimization level (-O2 → -O3). |
| lib_i2c/src/i2c_slave.xc | Implements SCL high-spike filtering and uses it in key state-machine decisions. |
| lib_i2c/lib_build_info.cmake | Changes library optimization (-Os → -O3) for the CMake-based build path. |
| CHANGELOG.rst | Adds an UNRELEASED section describing the changes (currently includes an entry not reflected in this diff). |
Suppressed comments (1)
lib_i2c/lib_build_info.cmake:13
- This changes the library compiler optimization from
-Osto-O3, but the legacylib_i2c/module_build_infostill uses-Os(line 6). That makes optimization level depend on which build system is used; consider keeping-Oshere (or updating all build entrypoints consistently).
set(LIB_COMPILER_FLAGS -O3
-Wall
-Wextra
-Wsign-compare
-Wconversion)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
xross
force-pushed
the
feature/spike_filter
branch
6 times, most recently
from
July 31, 2026 15:05
ced5614 to
d112711
Compare
xross
marked this pull request as draft
July 31, 2026 16:21
xross
force-pushed
the
feature/spike_filter
branch
from
July 31, 2026 16:49
1dff8c0 to
a9daee9
Compare
Contributor
Author
|
Exposed this: #123 |
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.
Summary
Testing