Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

SDRAM pll phase shift calculation

Altera_Forum
Honored Contributor II
1,378 Views

Hello. 

I need to do phase shift on clock going to sdram but i don't know how to do it. I have read some documents where examples are given with values of Th, Tsu and Tco of the used device (the FPGA) but i don't know from where those values were taken. 

I saw the above values at two places.... 

1. In the FPGA timing datasheet. 

2. In the compilation report of classic timing analyzer. 

 

And to add to the confusion the above locations provide different values. 

So guys which location values should i use?? 

Please help me out.....I am stuck with this. 

Waiting for your reply... 

 

Regards.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
355 Views

I'm not sure a set phase shift (ns offset) is possible with classic TAN. It should be with TimeQuest. 

 

Alternately, you could control the phase between your system and SDRAM clock by using PLLs. Refer to the nios2_stratixII_2s60 design examples ($SOPC_KIT_NIOS2/examples/[verilog|vhdl]). 

 

Cheers, 

 

- slacker
0 Kudos
Altera_Forum
Honored Contributor II
355 Views

based on my experiences i would recommend to use a pll with 2 outputs set both outputs to the same frequency. for example set c0 to 96MHz and c1 also to 96MHz. connect c0 to fpga internal ips like nios and connect c1 to an external pin, a dedicated clock output pin, and let this pin be sdram clock. 

now you can, and must, set the phase of c1 that is done by calculation as described in one of the appnotes. 

for these calculations you need a couple of values. some values are coming from your sdram datasheet and you can directly use them. the other values are comming from your first compilation. i would recommend if you use the classic timing analyser to set it up to give slow and fast timings seperatly.  

now it gets a bit anoying 

have a look at the timing folder and look for tco th .. values.  

you should mark all those signals that are sdram related (A[..] DQ[] as well as the control signals) and search for the related min and max values you need for calculation. 

now enter all these values into a spread sheet that does the calculation for you and you get the phase shift. 

now modify your pll by using the calculated value and rebuild the system. 

it is very importand that you check the timing tco th ... values that they do not change too much. 

 

but some side notes. 

these calculation do not take into account that there is another component between the fpga and your sdram, thats your pcb.  

i use a very fast scope and compare the timing relation ship between sdram clk and RAS to see if it as it should be. 

also i would recommend to remeasuhe again at your lowest and your highest operating temperature.  

this is important due to the therma behavioral, even hold timing for example gets critical under lower temperatur as the fpga gets faster. 

 

next thing is to setup quartus correctly. use fast input output registers and setup the current correctly to avoid over and undershots. 

 

the higher you get with sdrqam clock the more importat this gets.
0 Kudos
Reply