Fix dynamic baudrate UART issue by explicitly naming CSRs. #2406
Merged
enjoy-digital merged 2 commits intoenjoy-digital:masterfrom Jan 29, 2026
Merged
Fix dynamic baudrate UART issue by explicitly naming CSRs. #2406enjoy-digital merged 2 commits intoenjoy-digital:masterfrom
enjoy-digital merged 2 commits intoenjoy-digital:masterfrom
Conversation
This commit addresses an issue where UART with dynamic baudrate failed to transmit data. The cause was likely failure to extract CSR names for private attributes (`_tuning_word`, `_rxtx`, etc.) in some environments, leading to missing CSRs or incorrect mapping. Explicitly providing names to `CSR`, `CSRStatus`, and `CSRStorage` ensures they are correctly handled by `LiteXModule`/`AutoCSR`. Fixes enjoy-digital#2394.
Fix dynamic baudrate UART by adding explicit CSR names
Owner
|
Thanks @helium729! Let's merge. I'll still probably investigate further since there could be another underlying issue. |
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.
#2394 reported that enabling dynamic baudrate on UART caused transmission failure.
CSRobjects were instantiated without explicit names, relying on automatic name extraction from variable names. This extraction can be fragile, especially with private attributes (starting with_) or in certain contexts (likeEventManager).When
LiteXModuleintrospection logic changed (as noted in the issue referencing commit1b5fc97), this implicit naming likely broke, causing thetuning_wordCSR (required for dynamic baudrate) orrxtxCSR to be mishandled.I reproduced the
ValueError: Cannot extract CSR namein a standalone simulation script, confirming the fragility.The fix involves explicitly passing
name="..."toCSR,CSRStatus, andCSRStorageinRS232PHY,UART, andEventManager.This ensures robust CSR generation and fixes the issue.