phy: Align Artix-7 DDR3 reads without altering CL - #400
Merged
Conversation
The Artix-7 DDR3 PHY previously programmed MR0 with CL + 1 while calculating its read phase and latency from the selected CL. This placed returned data one memory-clock phase into the ISERDESE2 word, but mixed PHY alignment with the DRAM timing configuration and made an explicit CL 14 unencodable. Keep the selected CL in MR0 and move the Artix-7 read phase by one memory clock instead. Fold phase wrapping into the controller-visible read latency so the returned data keeps the required word alignment. Add settings and MR0 tests across the default frequency ranges, all legal DDR3 CL values, command latencies, and the unchanged Kintex-7 path.
enjoy-digital
marked this pull request as ready for review
July 23, 2026 21:15
Owner
Author
|
Validated Build results:
Hardware results:
This confirms the adjusted read schedule works on Artix-7 hardware while preserving the frequency-selected DDR3 CL. CI is also green, so I am going to merge this. |
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.
Follow-up to #397 and @gatecat's observation about the similar Artix-7 read-path workaround.
Summary
Rationale
Since 6f323f6, the Artix-7 PHY has calculated its read phase and system latency from the selected CL but programmed
CL + 1in MR0. This places returned data one memory-clock phase into the ISERDESE2 word and improved read-leveling reliability, but it represents PHY alignment by changing the DRAM timing configuration. It also turns an explicitly selected CL 14 into the unsupported MR0 value 15.The new schedule keeps the same intra-word read position by incrementing
rdphaseinstead.divmod()normalizes the phase and carries a phase wrap intoread_latency, making both parts of the timing relationship explicit.Testing
pytest -q test/test_s7ddrphy.py test/test_ddr3_phy_settings.py test/test_nxddrphy.py test/test_init.py test/test_gen.py: 13 passed, 86 subtests passed.Hardware Validation
This is intentionally a draft until it has been exercised on Artix-7 hardware. The useful checks are read-leveling windows and repeated memory tests at 50, 75, 100, and 125 MHz. A phase-wrap configuration, such as CL 13, should also be tested if practical because it reduces the controller-visible read latency by one system cycle.