Hi Norihiro-san,
Jiri will be leaving NXP very soon, so I will take over responsibility for answering your questions.
First, I want to make sure that we correctly define and understand the different timing parameters, because the IP we are using in Vybrid uses confusing terms:
- Write Leveling (WRLVL_DL_0/1) refers to adjusting the timing between the Write DQS strobe signal and the SDCLK signals, so that the edges align.
- DLL Write delay (DLL_WRITE_DL) refers to adjusting the DQS strobe in relation to the DQ signals so that the strobe edge is centered in the window of valid write data.
- Read Leveling (RDLVL_DL_0/1) refers to adjusting the DQS strobe in relation to the DQ signals so that the strobe edge is
centered in the window of valid read data. - Read Gate Delay (RDLVL_GTDL_0/1) refers to the delay the PHY uses to un-gate the Read DQS strobe pad from the time that the PHY enables the pad to input the strobe signal.
To help understand this last point, I am attaching an explanation I recently wrote that discusses Write and Read Latency timings and the settings
used both for the DDR devices and for the PHY.
Second, the Vybrid DDR controller only supports training using a software mode controlled by the Memory Controller (Hardware Training is
not supported by the PHY). NXP does not have any SW to perform Write Leveling because we do not expect customers to use memory in a Fly-By Topology. The
total memory address space supported by Vybrid is easily accommodated by one or two DDR devices. Fly-By Topology is typically used for x64 and x128 bus widths.
Nevertheless, if the customer really wants to configure DDR3 in a Fly-By Topology, they can manually enter delay values into the WRLVL_DL_0/1 fields based on trace
length differences from their layout. Mismatches up to 25% or tCK (clock period) are allowed, so the value in the filed doesn’t have to be very
accurate.
Next, for question #1: Yes, you are correct. The description in Software Gate Training in MC Evaluation Mode does contain a typo. It should
read EN_HALF_CAS and not SW_HALF_CYCLE_SHIFT.
Question #2: You are correct that table 10-27 is not referenced in the procedure. I am going to submit a manual change to reword
Step 14 of the procedure:
- Read the responses from the SWLVL_RESP_X bits. The meaning of the response is based on the previous response and how the delay was
changed for this iteration. Table 10-27 below can be used to help the user determine the next actions to be used in Step 15.
Also, I see a similar problem in Write Leveling and Gate Training, and will update those procedures as well.
Question #3: The edge we should set for the read leveling is rising edge of DQS? – The edge you set in field RDLVL_EDGE will determine which
data pattern you should expect back from a read.
To use the SW Read Level method, you need to set the DDR devices to output a pre-defined data pattern. That is done in step 5 of the
procedure in the Reference Manual: “An MPR write will enable read leveling for the memory…” What this step actually means
is that the software routine needs to do a mode register write (MRS) to MR3 of the DDR device. Setting MR3 to 0x0004 forces the DDR3 device to issue a predefined bit
pattern in response to any subsequent read command until MR3 is programmed back to 0x0000. In the predefined pattern, all Read data bits will be set to ‘0 for
the rising edge of the DQS strobe and will be set to ‘1 for the falling edge of the DQS strobe.
So, by setting the RDLVL_EDGE = 0, the SW should expect to see 0x00 in the SWLLVL_RESP_X field. Any bit that shows up as ‘1 means that the
strobe was either too early or too late to correctly read this DQ trace. The opposite is true for RDLVL=1.
Question #4: Should the software adjust values in SWLVL_RESP_X to RDLVL_DL_X?
As explained above, the values reported in SWLVL_RESP_X represent the data bits strobed into the READ FIFO as a result of the delayed
DQS strobe edge, and should match the predetermined value as selected by RDLVL_EDGE. To find the correct value for RDLVL_DL_X, first find the lowest
value of RDLVL_DL_X which results in SWLVL_RESP_X returning all 8 bits correctly. Then find the highest value of RDLVL_DL_X which results in
SWLVL_RESP_X returning all 8 bits correctly. Average the two values together (Step 16). This is the final value that should be programmed into RDLVL_DL_X. [Note:
Step 16 has a typo when stating the field.]
Question #5: Do we have any reference code for read/write leveling and gate training?
No, sorry we don’t. The best I can do is tell you to use the Processor Expert Tool for Vybrid (VYBRID DDR VALIDATION TOOL), which determines
calibration values using different methods, and not the ones written in the Reference Manual. (I am a HW engineer. I really can’t tell you how to write the
code.)
Case #2: Point-to-Point Topology
DLL_WRITE_DL, RDLVL_DL and RDLVL_GTDL are still necessary for Point-to-Point topology. Write Leveling calibration is not necessary and is
a waste of effort. The SW routine to find these three calibration values should be the same as the Fly-By Topology case. Nevertheless, I still recommend that
you use “VYBRID DDR VALIDATION TOOL”.
Hopefully my write up to this point fully answers all of your original questions. If not, or if you have other questions, please let me know.
Now to respond to your print out results:
Your first case looks exactly as expected.
Your second case (decreasing RDLVL_DL_X by 1) does not make sense. It would help if the RDLVL_DL0/1 values printed out above the responses
were the actual programmed value of RDLVL_DL_X. (I would expect that the value started at 89 and decreased down to 00, one at a time. There is no reason to
expect that the second case should not look exactly like the first case, except in reverse order, as long as all the other parameters were not changed.
In particular, I would expect the starting point of RDLVL_DL_X to be 89, and not 65535 (0xFFFF) or 255 (0xFF). Also, please make
sure that you are using RDLVL_EDGE=0. I am not convinced that, if using the falling edge, the DQ traces would return to ‘0 value after the last word is received.
If the results for Case #2 are not resolved, could you provide the portion of code the performs the RDLVL_DL_X value changes?
Cheers,
Mark