Zynq-7000 AP SoC and 7 Series FPGAs MIS v4.1
605
UG586 November 30, 2016
Chapter 4:
LPDDR2 SDRAM Memory Interface Solution
Implementation Details
This stage of read leveling is performed one byte at a time where each DQS is center
aligned to its valid byte window. At the start of this stage, a write command is issued to a
specified LPDDR2 SDRAM address location with a predefined data pattern. The write data
pattern used is static pattern of FF, 00, FF, 00, FF, 00, FF, 00. This write command is followed
by back-to-back read commands to continuously read data back from the same address
location that was written to.
The algorithm first increments the PHASER_IN stg2 fine delay taps for all DQ bits in a byte
simultaneously until an edge is detected. The STG2 fine tap are increased until a edge is
found. If no edge is found then the STG2 fine taps are decreased to their initial positions.
The calibration logic reads data out of the IN_FIFO and records it for comparison. The data
pattern sequence is important for this stage of calibration. No assumption is made about
the initial relationship between DQS and the data window at tap 0 of the fine delay line. The
algorithm then delays DQ using the IDELAY taps until a DQ window edge is detected.
An averaging algorithm is used for data window detection where data is read back over
multiple cycles at the same tap value. The number of sampling cycles is set to 214. In
addition to averaging, there is also a counter to track whether DQS is positioned in the
unstable jitter region. A counter value of 3 means that the sampled data value was constant
for three consecutive tap increments and DQS is considered to be in a stable region. The
counter value is reset to
0
whenever a value different from the previous value is detected.
The next step is to increment the IDELAY tap values one tap at a time until a data mismatch
is detected. The data read out of IN_FIFO after the required settling time is then compared
with the recorded data at the previous tap value. This is repeated until a data mismatch is
found, indicating the detection of a valid data window edge. A valid window is the number
of IDELAY taps for which the stable counter value is a constant 3. This algorithm mitigates
the risk of detecting a FALSE valid edge in the unstable jitter regions.
There are three possible scenarios for the initial DQS position with respect to the data
window. The first valid rising edge of DQS could either be in the previous data window, in
the left noise region of the current data window, or just past the left noise region inside the
current data window.
The PHASER_IN fine delay line has 64 taps. (A bit time worth of taps. Tap resolution
therefore changes with frequency.)
First, the PHASER_IN fine delay lines are used to find the start of right noise region. In the
first two cases, right noise region would be found with PHASER_IN fine tap increments less
than 64 taps. After the right noise region is found with FINE taps, proceed to use IDELAY
taps to find the start of left noise region by delaying the DATA.