An optimized method, system, and apparatus for determining optimal DQS delay for DDR memory interfaces are disclosed. The method performs data eye training in a two dimensional space with time delay value as x-axis and reference voltage (Vref) as y-axis to determine a rectangular data eye within an overall data eye with Vref margin.
Please help me write a proper abstract based on the patent claims. CLAIM: 1. A system for data eye training comprising: a memory device having a data input and a data strobe input; and a training control interface having a data generation and comparison logic and state machines, wherein the training control interface is coupled to the data input and the data strobe input for writing data to and reading data from the memory device, wherein the state machines are operable by the data generation and comparison logic for determining a largest rectangular area within a data eye, and wherein the training control interface is operable to set a reference voltage and a data strobe timing to the middle of the largest rectangle area within the data eye. 2. The system of claim 1 wherein the training control interface further comprises: a PHY write data eye training state machine to adjust a data timing for a data write pattern; a PHY write leveling training state machine to adjust a data strobe timing for a write command; a DQS generation logic to generate a data strobe; flip-flops to hold the data write pattern and the data strobe; variable delay lines for applying the data timing and the data strobe timing on the flip-flops; and transmitters for driving the data write pattern and the data strobe to the memory device. 3. The system of claim 2 wherein the data generation and comparison logic has state machine outputs to indicate a status and a pass/fail determination, a data pattern output, and a write enable output, wherein the state machine outputs are coupled to inputs of the PHY write data eye training state machine and the PHY write leveling training state machine, wherein the data pattern output is coupled to a first one of the flip-flops to be driven as the data write pattern, and wherein the write enable output is coupled to the DQS generation logic. 4. The system of claim 3 wherein outputs of the DQS generation logic are coupled to data inputs of a second one of the flip-flops and of a third one of the flip-flops, wherein the PHY write data eye training state machine has a data delay output coupled to an input of a first one of the variable delay lines, wherein the first one of the variable delay lines has an input for a memory clock signal and an output for a first delayed version of the memory clock signal that is based on the data delay output, wherein first one of the flip-flops has a clock input coupled to the first delayed version of the memory clock signal, wherein the PHY write leveling training state machine has a data strobe delay output coupled to an input of a second one of the variable delay lines, wherein the second one of the variable delay lines has an input for the memory clock signal and an output for a second delayed version of the memory clock signal that is based on the data strobe delay output, and wherein the second one of the flip-flops and the third one of the flip-flops each have a clock input coupled to the second delayed version of the memory clock signal. 5. The system of claim 1 wherein the training control interface further comprises: a PHY read data eye training state machine to adjust a read data strobe timing and adjusting a voltage reference; a first-in-first-out (“FIFO”) buffer to capture read data; receivers for receiving read data and a data strobe from the memory device; a third variable delay line for adjusting the data strobe; and a voltage generator for generating the voltage reference. 6. The system of claim 5 wherein the data generation and comparison logic has state machine outputs to indicate a status and a pass/fail determination, wherein the state machine outputs are coupled to inputs of the PHY read data eye training state machine, and wherein the PHY read data eye training state machine has a reference voltage code output to adjust the reference voltage and a read data strobe delay output for adjusting the delay of the data strobe. 7. The system of claim 6 wherein a read data input of the FIFO buffer is coupled to read data from the memory device via a first receiver, wherein the third variable delay line has inputs for a read data strobe from the memory device and the read data strobe delay output, wherein the read data strobe is coupled to the third variable delay line via a second receiver wherein the read data strobe delay output is coupled to a clock input of the FIFO buffer, and wherein the FIFO buffer has a read data output that is coupled to an input of the data generation and comparison logic for comparing the read data to an expected data. 8. The system of claim 5 wherein the data generation and comparison logic and the PHY read data eye training state machine are operable to determine a lower segment within a data eye and an upper segment within the data eye providing the largest rectangular area within the data eye, and wherein the training control interface is operable to set the data strobe timing and the voltage reference to the middle of the largest rectangular area within the data eye. 9. The system of claim 8 wherein the data generation and comparison logic and the PHY read data eye training state machine are operable to read data points along a predefined voltage reference of the data eye to determine a valid starting point within the data eye for the lower segment and a valid ending point within the data eye for the lower segment. 10. The system of claim 8 wherein the data generation and comparison logic and the PHY read data eye training state machine are operable to read data points along the predefined voltage reference plus a margin of the data eye to determine a valid starting point within the data eye for the upper segment and a valid ending point within the data eye for the lower segment. 11. The system of claim 10 wherein the training control interface is operated to determine a largest rectangle that is within an area of the data eye bounded between the upper segment and the lower segment. 12. The system of claim 11 wherein the training control interface is operated to compare the determined largest rectangle with a previous best rectangle and wherein, if a total area of the determined largest rectangle is greater than a total area of said previous best rectangle, then the determined largest rectangle is stored as said previous best rectangle for any future comparisons. 13. A non-transitory computer readable medium having computer executable instructions stored thereon for aligning a data strobe signal to a data signal of a memory device, wherein the instructions include the steps comprising: determining points A, B, C, and D of the data signal that cross at a reference voltage and at a sum of the reference voltage and a reference voltage margin; determining a largest rectangle that fits within the determined points A, B, C, and D; comparing the determined largest rectangle with a previous best rectangle, wherein if the determined largest rectangle is greater in area than the previous best rectangle, then the determined largest rectangle is stored as the previous best rectangle; and setting a delay for the data strobe signal based on a center of the previous best rectangle. 14. The non-transitory computer readable medium having computer executable instructions stored thereon of claim 13, further comprising the step after the comparing step and before the setting the delay step of: if the reference voltage is not equal to an ending reference voltage, increasing the reference voltage by a reference voltage step size and repeating the steps starting at the determining points A, B, C, and D step using the increased reference voltage in place of the reference voltage. 15. The non-transitory computer readable medium having computer executable instructions stored thereon of claim 13, wherein the determined points A, B, C, and D form a lower segment in a data eye and an upper segment in the data eye. 16. The non-transitory computer readable medium having computer executable instructions stored thereon of claim 13, wherein data points are read along said reference voltage to determine a valid starting point A on the data eye for the lower segment and a valid ending point B on the data eye for the lower segment. 17. The non-transitory computer readable medium having computer executable instructions stored thereon of claim 13, wherein data points are read along said sum of the reference voltage and the reference voltage margin to determine a valid starting point C on the data eye for the upper segment and a valid ending point D on the data eye for the upper segment.