Repository navigation
phy/s7ddrphy, usddrphy: add an experimental with_dqs_preamble option for the DQS patterns. - #472
Draft
enjoy-digital wants to merge 1 commit into
Draft
enjoy-digital wants to merge 1 commit into
enjoy-digital wants to merge 1 commit into
Conversation
…for the DQS patterns. The DQS preamble/postamble patterns were disabled with FIXMEs: the output enable covers these cycles but DQS keeps toggling through them (litedram #225). Add an opt-in with_dqs_preamble, off by default. DQSPreambleControl generates the controls from wrdata_en and write_latency, aligned on the write data entering the PHY: the pattern goes through a bitslip with the same controls as DQ, so this holds with the bitslip set by the calibration. On the A7 path the pattern register has to be bypassed: with write_latency 1, the preamble is due in the cycle of wrdata_en. S7DDRPHY needs 1:4, patterns being 8-bit. Tested in simulation at the serializer inputs with the controller (A7, K7, USP; single and back-to-back writes); off by default, the Arty and KCU105 netlists have the same logic as before. NOT tested on hardware: the DQS window at the pads depends on OSERDES latencies that are not simulated here. 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.
Do not merge before testing on hardware. Refs #225.
On
S7DDRPHYandUSDDRPHY, the DQS preamble/postamble patterns are disabled with# FIXMElines: the output enable covers these cycles but DQS keeps toggling through them. This adds an opt-inwith_dqs_preamble, off by default.Why they could not simply be enabled
Measured with the real controller and PHY at the serializer inputs on current master, for one write (position of the data beat and of the output enable window, in sys_clk cycles):
So the data is not centered in the enable window at these inputs, and the difference must come from the OSERDES latencies and the write bitslip calibration. Connecting the patterns to the enable-aligned
dqs_preamble/dqs_postamblesignals would misplace them.Changes
DQSPreambleControl(common.py) generates the controls fromwrdata_enandwrite_latency, aligned on the write data entering the PHY. The pattern goes through a bitslip with the samerst/slpcontrols as DQ, so the alignment holds with the bitslip set by the calibration.with_odelay=False),DQSPattern's output register is bypassed when the option is on: withwrite_latency1, the preamble is due in the cycle ofwrdata_en, so a register would make it late. This also moveswlevel_strobeone cycle earlier on that path.S7DDRPHYasserts 1:4 when the option is on, since the patterns are 8-bit. DDR2 at 1:2 is not supported.Tested in simulation only
test/test_dqs_preamble.py: controller and PHY, at the serializer inputs, on A7 DDR3, K7 DDR3 and USP DDR4, with 1 and 3 back-to-back writes. Preamble the cycle before the first beat, toggle on the beats, postamble the cycle after the last.test_s7ddrphy,test_usddrphyandtest_controller_timingpass.digilent_artyandxilinx_kcu105Verilog (--no-compile, no CPU) have the same logic as master. The only difference is the order of two hierarchy comment lines on KCU105.What simulation cannot tell, and what hardware has to answer
0b00010101is sent LSB-first as 1,0,1,0,1,0,0,0, so it has about 1.5 tCK low before the burst, with three extra edges before that.Hardware test plan
Pass
with_dqs_preamble=Trueto the PHY in the target and use--load, on an Arty (A7 DDR3), a KCU105 (US DDR4) and a K7 board with ODELAY if available. Compare with the option off:sdram_cal: write leveling and read windows should not shrink.sdram_test, then a long memory test.sdram_bistormem_speed: throughput should not change.Written by Claude Code (AI agent), supervised by Florent Kermarrec.
🤖 Generated with Claude Code