litedram icon indicating copy to clipboard operation
litedram copied to clipboard

Refresh S6DDRPHY

Open enjoy-digital opened this issue 4 years ago • 14 comments

The Spartan6 S6DDRPHY needs to be refreshed with the simplifications/improvements made to the others PHYs.

enjoy-digital avatar Apr 23 '20 10:04 enjoy-digital

@enjoy-digital Could you please elaborate a bit more on what simplifications/improvements are not implemented/missing for S6DDRPHY? Is one of the missing features that S6DDRPHY doesn't use IDELAY/ODELAY for data alignment?

cklarhorst avatar Jul 16 '20 11:07 cklarhorst

@cklarhorst: sorry i forgot to answer, the S6DDRPHY is the first PHY that has been created and we improved things since then, so the architecture would need to be updated a bit and it's also possible some features are missing (DQS Pre/Post amble for example). That's not necessarilly something easy to work on when not familiar with LiteDRAM, so i was planning to work on that, but if you want to have a closer look, i could help you getting started.

enjoy-digital avatar Jul 31 '20 09:07 enjoy-digital

@enjoy-digital I am currently implementing Litex on a custom XC6SLX16-3 board which comes with LPDDR (Winbond W949D6KBH) It works fine using parameters copy from the pipistrello board - CPU clock at 83.3 MHz and memory at 166MHz

  • trying 200MHz memory clock and 100MHz CPU clock results in mem_test failing

So, before start digging into this, I am wondering if you started refreshing the S6DDRPHY already?

norbertthiel avatar Feb 10 '21 21:02 norbertthiel

@norbertthiel: Hi, the work has not been initiated in this no.

enjoy-digital avatar Feb 11 '21 07:02 enjoy-digital

@norbertthiel: Hi, the work has not been initiated in this no.

Hi and thanks for the reply. Any short-term plans for initiating this?

Maybe you can point me were to start looking at to fix my "problem":

  • 83,3MHz sys, 166MHz sdram_half, 333MHz sdram_full (pippistrello org settings) => works
  • 90Mhz sys, 180Mhz sdram_half, 360MHz sdram_full => when using "mem_write 0x40000000 0x01020304 8" I get all 8 values written = but at an offset of roughly 124 bytes there is a garbage word written to memory (3 garbage words written at offset 0x8e, 0x9e, 0x116) ... I have no idea were this is coming from - any idea/hint?

memory supports 200MHz, FPGA has speedgrade 3

norbertthiel avatar Feb 11 '21 07:02 norbertthiel

@enjoy-digital like this: image

norbertthiel avatar Feb 11 '21 07:02 norbertthiel

Hi @norbertthiel,

the S6DDRPHY needs to be refreshed since as you saw is not very flexible and can require manual adjustments to get it working. Are the timings OK at 100MHz sys_clk? If yes, you could try to adjust the passed rd_bitslip/wr_bitslip values: https://github.com/enjoy-digital/litedram/blob/master/litedram/phy/s6ddrphy.py#L38.

I'd like the refresh work to be done in the next months but can't guarantee it.

Florent

enjoy-digital avatar Feb 11 '21 18:02 enjoy-digital

Hi @norbertthiel,

the S6DDRPHY needs to be refreshed since as you saw is not very flexible and can require manual adjustments to get it working. Are the timings OK at 100MHz sys_clk? If yes, you could try to adjust the passed rd_bitslip/wr_bitslip values: https://github.com/enjoy-digital/litedram/blob/master/litedram/phy/s6ddrphy.py#L38.

I'd like the refresh work to be done in the next months but can't guarantee it.

Florent

Thanks Florent, yepp I saw that a few timings are not flexible and I am going to play with that. Looking forward to your refresh work. Any other sys_clk timing I tried did not work.

I will play with bitslip and also thought that read_latency could have an impact.

Are timings OK at 100MHz sys_clk?

Didn’t connect litescope yet -probably gonna try soon - or do you suggest to use simulation?

norbertthiel avatar Feb 11 '21 19:02 norbertthiel

For the timings, this is reported by ISE.

enjoy-digital avatar Feb 11 '21 20:02 enjoy-digital

For the timings, this is reported by ISE.

Ah those, sorry, yepp, constraints met, no problems reported

norbertthiel avatar Feb 11 '21 21:02 norbertthiel

@enjoy-digital quick update: sys_clk 100MHz (400MHz sdram_full) works with:

  • clk_sdram_half_shifted - phase shift 240
  • cd_sdram_half phase shift 270
  • rd_bitslip: 0
  • wr_bitslip: 3
  • dqs_ddr_alignment: C1 image

norbertthiel avatar Feb 23 '21 16:02 norbertthiel

Great @norbertthiel, thanks for the feedback!

enjoy-digital avatar Feb 25 '21 08:02 enjoy-digital

Great @norbertthiel, thanks for the feedback!

in fact phase shifts 230 and 260 work stable - 240 and 270 did occasionally result in memtest errors - 260 and 230 seems to work reliably

and let me just say how much I enjoy using LiteX

norbertthiel avatar Feb 25 '21 08:02 norbertthiel

Thanks, tweaking the S6DDRPHY's settings is not necessarily the easiest thing to start with :) (in 7-Series / Ultrascale these manual settings are almost all automated and the aim of this issue is also simplify this for Spartan6), but glad you manage to get it working, things should be easier now.

enjoy-digital avatar Feb 25 '21 09:02 enjoy-digital