To Ken, BadOmen, and janhendrik:
BadOmem summed up what I was refering to better than I. He is right that we are concerned with trace delay. However there is more to it -- what we're really concerned with is the difference in propagation between the various signals that arrive at the SDRAM and make their way back to the FPGA.
to ken land: The first thing to worry about is clock skew between the clock that arrives at SDRAM and various other control signals (address, dqm, cas, ras). These signals are synchronous to the FPGA clock driving your processor/bus... but nothing is free or instantaneous; it takes time for our internal clock to traverse the chip, go through logic, activate the relevant SDRAM control signal, and be driven out to an IO. At the same time, we are driving a clock out to SDRAM which comes into the FPGA from an oscillator, passes through a PLL, and exits via a high-speed IO (zero delay through logic)
In summary, without any PLL compensation the clock signal would arrive too soon for the control signals. So the most simple measurement you can perform is right on the SDRAM. Just scope the SDRAM clock input alongside several of the control signals (one at a time if you wish). Do this while you have a test program running on Nios that does SDRAM access or just executes code. Without any PLL adjustment you should notice the clock arrives too soon -- check against the SDRAM data sheet to meet the spec. The other danger here is in "over-tuning" the PLL by shifting the clock too far back.
I could write much more but its really just basic timing analysis: look at the waveforms in the back of the datasheet, correlate to the speed grade of chip you have, make your measurements, etc. Also remember to check on the FPGA timing - in the Quartus timing analyzer you'll get *worst case* Tco and Tsu data for all of your external IO, giving the remaining pieces of the puzzle.
Please let me know if I'm too vauge on the above; its hard to gauge what level of detail to describe here has some people know this stuff a lot better than I do!
to janhendrik: I am happy to hear of your success..but at the same time I have to say:
your system is working by accident, something is wrong! The fact that it works at multiples of the original clock speed indicates that there is some crazy timing problem that still exists, but is being masked by the clock edge showing up at the "same" place in time (because the freq is doubled). Please save yourself a lot of trouble later on and concentrate on this before moving on with your design; I guarantee that proving out the memory first will lead to far less problems down the road.
A final thought: even with an existing timing problem you're likely to get a data-interface to SDRAM working; if a subtle timing problem exists you'll see errant behavior when you're "stressing" the SDRAM. This is because when a processor performs data access (ld/st instructions), they are typically not back-to-back, allowing extra time for any problems to resolve themselves. This can be a real red herring. You can adequately test SDRAM in in two easy-to-test cases:
1. Executing code from SDRAM.. filling the cache will mean back-to-back accesses. If something's wrong, the execution of code will likely fail.
2. Performing DMA transfers or other back-to-back transfers with your own custom peripheral.