Repository navigation
modules: DDR4 same bank group tCCD limit and per speed grade tCCD, tRRD and CL/CWL. - #470
Merged
Merged
Conversation
tCCD and tRRD could only be set per technology and CL/CWL only came from a clock rate table, while they depend on the speed grade (litedram #306, #185). _SpeedgradeTimings now accepts optional tCCD, tRRD, cl and cwl: tCCD/tRRD override the technology timings when set, and SDRAMModule.get_cl_cwl returns the speed grade's CL/CWL. litedram_gen gets sdram_module_speedgrade (previously ignored), cl and cwl keys: CL/CWL come from the YAML, then the speed grade, else the PHY defaults. Existing modules define no override, so their timings do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…gin. Hand-written DDR4 modules used tCCD=(4, None), so at 1:4 with sys_clk > 200 MHz consecutive CAS commands to a bank group were closer than tCCD_L (litedram #306). Use the tCCD_L of the Micron 8Gb DDR4 datasheet: 5ns from DDR4-2400, 5.355ns for the DDR4-2133 modules, with 4nCK as minimum. ck_ns_to_cycles also adds a phase margin of 3/4 sys_clk, which would give tCCD=2 at every usual clock and halve sequential throughput, as already happened with the (4, 5) RDIMM modules. Consecutive CAS commands of the same type are on the same DFI phase, so their spacing is an exact number of cycles: compute tCCD without this margin. tCCD compared over all modules and clocks: unchanged for DDR2/DDR3/SDR and for hand-written DDR4 modules up to 156.25 MHz sys_clk; HMA82GR7DJR4N, HMA84GR7DJR4N, M393A2K40DB3 and M393A4K40DB3 go from 2 to 1 up to 200 MHz. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
enjoy-digital
added a commit
that referenced
this pull request
Nov 6, 2026
This x8 DDR4-2133 module used tRRD=(4, 4.9), the DDR4-2400 value: tRRD_L is 5.3ns at DDR4-2133 with 1KB pages (Micron 8Gb DDR4 datasheet, Table 161). Set it on the speed grade, with the per speed grade tRRD from #470. The phase margin was covering the difference: among the clocks compared, the controller's tRRD only changes at 50 MHz sys_clk (1 to 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #306. Refs #185, #406.
Per speed grade timings (first commit)
_SpeedgradeTimingsaccepts optionaltCCD,tRRD,clandcwl.tCCD/tRRDoverride the technology timings when set, andSDRAMModule.get_cl_cwl()returns the speed grade's CL/CWL.litedram_gengetssdram_module_speedgrade(previously ignored),clandcwl. CL/CWL come from the YAML, then the speed grade, else the PHY defaults.--simcores do not usecl/cwl.sdram_module_speedgradenow raises aKeyError, where the key used to be ignored.DDR4 tCCD (second commit)
tCCD=(4, None), so with sys_clk above 200 MHz at 1:4, consecutive CAS commands to a bank group were closer than tCCD_L.tCCDis now computed without the 3/4 sys_clk phase margin. That margin would givetCCD=2at every usual clock and halve sequential throughput. It is not needed since consecutive CAS commands of the same type are on the same DFI phase.Effect on tCCD (all modules, 10 clocks from 25 to 400 MHz, no other timing changes)
HMA82GR7DJR4N,HMA84GR7DJR4N,M393A2K40DB3,M393A4K40DB3The four RDIMM modules, and modules built from SPD data, get more sequential throughput at usual clocks. That is the change most worth reviewing, since it relaxes real designs.
Known limits, not changed here
USDDRPHY/USPDDRPHYtoday.init.pystill programs MR6 withformat_mr6(4) # FIXME: tCCD. phy: add experimental UltraScale native DDR4 support #406 changes that line, so I left it to avoid a conflict.modules.py, and itstCCD == 2check should now be met by these modules at 300 MHz and above. I did not run phy: add experimental UltraScale native DDR4 support #406 on this branch.Tested
test_modules,test_timing,test_controller_timing,test_gen,test_init,test_multiplexer,test_crossbarandtest_controllerpass.arty,ulx3s,kcu105,xcu1525and a USP DDR4 core: withcl/cwlthe init sequence has CL=11, and CL=9 without them.Written by Claude Code (AI agent), supervised by Florent Kermarrec.
🤖 Generated with Claude Code