A NAND Flash Read DQS Sampling Method
By treating DQS as a data signal and using the same frequency NAND Flash PHY clock for phase shift training, a suitable read clock is generated, which solves the problem of uncertain DQS sampling frequency in FPGA and achieves correct sampling and saving of clock resources. It is applicable in different working conditions.
Patent Information
- Application Number
- CN202210034310.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-13
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-01-13
AI Technical Summary
In FPGA, due to limited clock resources and low clock frequency of NAND Flash PHY, it is difficult to achieve correct sampling of DQS signals, resulting in uncertainty in frequency during read operations and affecting the data transfer rate.
Treat DQS as a data signal, use the NAND Flash PHY clock clk_phy with the same frequency for sampling, and perform phase shift training through the clock management unit MMCM to generate a suitable read clock clk_rd to achieve accurate sampling of DQS.
Through this method, clock resources can be effectively saved in the FPGA, ensuring correct sampling of DQS and avoiding metastable phenomena. It is suitable for different NAND Flash models and usage conditions.
Smart Images

Figure CN114528239B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of DDR memory data reading and writing, and in particular to a NAND FLASH read DQS sampling method. Background Art
[0002] Currently, there are two NAND Flash interface protocols: ONFI and Toggle. To increase the data transmission rate, both use the DDR method, that is, data transmission is performed on the rising and falling edges of DQS. When performing NAND Flash read operations, DQS is returned by NAND Flash and is asynchronous with the NAND Flash PHY clock, that is, the phase relationship is uncertain, so it becomes a problem to achieve correct sampling of DQS reading. According to the Nyquist sampling theorem, the sampling frequency must be greater than twice the highest frequency of the sampled signal. Therefore, in order to achieve correct sampling of DQS reading and fully recover it, in general, the NAND Flash PHY clock frequency must be greater than twice the DQS frequency. However, in FPGAs, clock resources are limited, and the FPGA prototype verification clock frequency is lower than that of ASICs. Summary of the invention
[0003] The technical problem to be solved by the present invention is a NAND Flash read DQS sampling method, which regards DQS as a data signal and uses a NAND Flash PHY clock clk_phy with the same frequency to implement the sampling of the read DQS, thereby saving clock resources.
[0004] In order to solve the technical problem, the technical solution adopted by the present invention is: a NAND Flash read DQS sampling method, which regards DQS as a data signal and uses a NAND Flash PHY clock clk_phy with the same frequency to implement the sampling of read DQS, wherein clk_phy needs to be phase-shifted by a clock management unit MMCM to achieve an optimal sampling position.
[0005] Furthermore, the process of phase shifting of clk_phy is as follows: training clk_phy, during which the phase shift value shift_val increases from 0 to the maximum value, and at the same time performing a read operation, recording the value of dqs_underrun corresponding to each shift_val value, the value of dqs_underrun indicates that the read DQS is not correctly sampled by clk_phy during the reading process, thus forming a data eye diagram, in which 1 indicates that the eye diagram is closed, indicating that the correct read DQS cannot be sampled by the rising edge of clk_phy using the current phase shift value, and 0 indicates that the eye diagram is open, indicating that the correct read DQS can be sampled by the rising edge of clk_phy using the current phase shift value, and the intermediate value of shift_val when dqs_underrun is 0 is used as the final clk_phy phase shift value to generate the final read clock clk_rd, which can accurately sample the read DQS using clk_rd.
[0006] Furthermore, clk_phy training is performed through the phase shift state controller. The phase shift state controller has 6 states: idle state, reset state, calculation state, request phase shift state, wait phase shift state and response state. The phase shift state controller defaults to idle state. When the phase shift adjustment signal received is 1, it enters the reset state. If the reset signal is valid at this time, it remains in the reset state. If it is invalid, it enters the phase shift calculation state. The transfer condition of the phase shift calculation state is controlled by two signals: the phase shift lock signal and the phase shift count value. The phase shift lock signal is 1, indicating that the calculation state can be output stably. The phase shift control state machine assigns the received phase shift initial value shift_val to the phase shift count value. In the phase shift request state, the input clock clk_phy is phase shifted. The phase shift value shift_val increases from 0 to the maximum value. The wait phase shift state waits for the phase shift to be completed. After the phase shift is completed, it enters the response state and finally enters the idle state.
[0007] Furthermore, the implementation steps of this method are:
[0008] S01), read DQS into IDDR, use clk_rd for sampling, output q0 and q1, where q0 is the read DQS level sampled on the rising edge of clk_phy, marked as dqs_valid, q1 is the read DQS level sampled on the falling edge of clk_phy, only q0 is used in this method;
[0009] S02) Define dfi_dqs_underrun, which indicates that the read DQS is not correctly sampled by clk_rd during the read process. The judgment condition is that dqs_valid is 0 and the DFI interface read data enable signal dfi_rddata_en received by PHY is 1;
[0010] S03), clk_phy generates a read clock clk_rd after passing through the clock management unit MMCM, and trains clk_rd to generate a suitable phase shift;
[0011] S04) Treat DQS as a data signal and use a read clock clk_rd with the same frequency to implement sampling of the read DQS.
[0012] Furthermore, this method is used in the field of FPGA prototype verification, and DQS is regarded as a data signal. That is, after it enters the FPGA, it is converted into a level signal using the input DDR sampling unit IDDR on the FPGA interface, and enters the FIFO together with the read data. The NAND Flash PHY clock clk_phy with the same frequency can be used to implement the sampling of the read DQS.
[0013] Beneficial effects of the present invention: The present invention regards the read DQS as a data signal, and uses clk_phy with the same frequency to correctly sample the read DQS, thereby saving clock resources.
[0014] The present invention introduces a NAND FLash read DQS sampling method in the field of FPGA prototype verification, and introduces a read DQS phase shift control logic and a training method. The method is flexible, fast and accurate, and can select the best read DQS sampling position according to different NAND Flash models and usage conditions to avoid the occurrence of metastable states. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 This is the system architecture diagram of this method;
[0016] Figure 2 Schematic diagram of the phase shift control state machine. DETAILED DESCRIPTION
[0017] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0018] Example 1
[0019] The present embodiment discloses a NAND Flash read DQS sampling method. The method regards DQS as a data signal and uses a NAND Flash PHY clock clk_phy with the same frequency to implement the sampling of the read DQS, wherein clk_phy needs to be phase-shifted by a clock management unit MMCM to achieve an optimal sampling position.
[0020] The process of phase shifting of clk_phy is as follows: training clk_phy. During the training process, the phase shift value shift_val increases from 0 to the maximum value, and the read operation is performed at the same time. The value of dqs_underrun corresponding to each shift_val value is recorded. The value of dqs_underrun indicates that the read DQS is not correctly sampled by clk_phy during the reading process. This will form a data eye diagram, in which 1 indicates that the eye diagram is closed, indicating that the current phase shift value is used and the rising edge of clk_phy cannot sample the correct read DQS. 0 indicates that the eye diagram is open, indicating that the current phase shift value is used and the rising edge of clk_phy can sample the correct read DQS. The intermediate value of shift_val when dqs_underrun is 0 is used as the final clk_phy phase shift value to generate the final read clock clk_rd, which can accurately sample the read DQS with clk_rd.
[0021] In this embodiment, clk_phy training is performed through a phase shift state controller, such as Figure 2 As shown, the phase shift state controller has 6 states: idle state, reset state, calculation state, request phase shift state, wait phase shift state and response state. The phase shift state controller defaults to idle state. When the phase shift adjustment signal received is 1, it enters the reset state. If the reset signal is valid at this time, it remains in the reset state. If it is invalid, it enters the phase shift calculation state. The transfer condition of the phase shift calculation state is controlled by two signals: the phase shift lock signal and the phase shift count value. The phase shift lock signal is 1, which means that the calculation state can be output stably. The phase shift control state machine assigns the received phase shift initial value shift_val to the phase shift count value. In the phase shift request state, the input clock clk_phy is phase shifted. The phase shift value shift_val increases from 0 to the maximum value. The wait phase shift state waits for the phase shift to be completed. After the phase shift is completed, it enters the response state and finally enters the idle state.
[0022] The implementation steps of this method are:
[0023] S01), read DQS into IDDR, use clk_rd for sampling, output q0 and q1, where q0 is the read DQS level sampled on the rising edge of clk_phy, marked as dqs_valid, q1 is the read DQS level sampled on the falling edge of clk_phy, only q0 is used in this method;
[0024] S02) Define dfi_dqs_underrun, which indicates that the read DQS is not correctly sampled by clk_rd during the read process. The judgment condition is that dqs_valid is 0 and the DFI interface read data enable signal dfi_rddata_en received by PHY is 1;
[0025] S03), clk_phy generates a read clock clk_rd after passing through the clock management unit MMCM, and trains clk_rd to generate a suitable phase shift;
[0026] S04) Treat DQS as a data signal and use a read clock clk_rd with the same frequency to implement sampling of the read DQS.
[0027] Example 2
[0028] This embodiment relates to a NAND Flash read DQS sampling method, which is used in the field of FPGA prototype verification, such as Figure 1 As shown in the figure, when performing NAND Flash read operation, NAND Flash returns DQS and DQ to NAND Flash PHY, where DQ changes at the DQS transition edge. Since the read DQS and NAND Flash PHY clock clk_phy have the same clock frequency, but are asynchronous clock relationships, that is, the phase relationship between the read DQS and clk_phy is not fixed, it is easy to produce metastable phenomena when using clk_phy to sample the read DQS. Therefore, it is necessary to train the clk_phy clock domain, generate a suitable phase shift through MMCM and fix it, generate the clock clk_rd, and use clk_rd to achieve correct sampling of the read DQS. Finally, it is converted into a standard DDR PHY Interface (DFI) interface signal.
[0029] The training of the clk_phy clock domain is the same as that in Example 1, and will not be repeated here.
[0030] The above description is only the basic principle and preferred embodiments of the present invention. Modifications and substitutions made by those skilled in the art based on the present invention belong to the protection scope of the present invention.
Claims
1. A NAND Flash read DQS sampling method, Features: This method regards DQS as a data signal and uses the NAND Flash PHY clock clk_phy with the same frequency to implement the sampling of reading DQS, wherein clk_phy needs to be phase-shifted by the clock management unit MMCM to achieve the best sampling position; The process of phase shifting of clk_phy is as follows: training clk_phy. During the training process, the phase shift value shift_val increases from 0 to the maximum value, and the read operation is performed at the same time. The value of dqs_underrun corresponding to each shift_val value is recorded. The value of dqs_underrun indicates that the read DQS is not correctly sampled by clk_phy during the reading process, which will form a data eye diagram, where 1 indicates that the eye diagram is closed, indicating that the current phase shift value is used and the rising edge of clk_phy cannot sample the correct read DQS. 0 indicates that the eye diagram is open, indicating that the current phase shift value is used and the rising edge of clk_phy can sample the correct read DQS. The intermediate value of shift_val when dqs_underrun is 0 is used as the final clk_phy phase shift value to generate the final read clock clk_rd, which can accurately sample the read DQS with clk_rd. clk_phy training is performed through the phase shift state controller. The phase shift state controller has 6 states: idle state, reset state, calculation state, request phase shift state, wait phase shift state and response state. The phase shift state controller defaults to idle state. When the phase shift adjustment signal received is 1, it enters the reset state. If the reset signal is valid at this time, it remains in the reset state. If it is invalid, it enters the phase shift calculation state. The transfer condition of the phase shift calculation state is controlled by two signals: the phase shift lock signal and the phase shift count value. The phase shift lock signal is 1, indicating that the calculation state can be output stably. The phase shift control state machine assigns the received phase shift initial value shift_val to the phase shift count value. In the phase shift request state, the input clock clk_phy is phase shifted. The phase shift value shift_val increases from 0 to the maximum value. The waiting dependent state waits for the phase shift to be completed. After the phase shift is completed, it enters the response state and finally enters the idle state. The implementation steps of this method are: S01), read DQS into IDDR, use clk_rd for sampling, output q0 and q1, where q0 is the read DQS level sampled on the rising edge of clk_phy, marked as dqs_valid, q1 is the read DQS level sampled on the falling edge of clk_phy, only q0 is used in this method; S02) Define dfi_dqs_underrun, which indicates that the read DQS is not correctly sampled by clk_rd during the read process. The judgment condition is that dqs_valid is 0 and the DFI interface read data enable signal dfi_rddata_en received by PHY is 1; S03), clk_phy generates a read clock clk_rd after passing through the clock management unit MMCM, and trains clk_rd to generate a phase shift; S04) Treat DQS as a data signal and use a read clock clk_rd with the same frequency to implement sampling of the read DQS.
2. The NAND Flash read DQS sampling method according to claim 1, Features: This method is used in the field of FPGA prototype verification. DQS is regarded as a data signal. That is, after it enters the FPGA, it is converted into a level signal using the input DDR sampling unit IDDR on the FPGA interface and enters the FIFO together with the read data. The NAND Flash PHY clock clk_phy with the same frequency can be used to implement the sampling of the read DQS.
Citation Information
Patent Citations
Quad-data rate (QDR) controller and realization method thereof
CN102254569A
Sequential control all-digital DLL control circuit and control method of NAND Flash controller
CN106374916A
Phase synchronization method and circuit based on data gating signal sampling
CN111063381A
Implementing Calibration of DQS Sampling During Synchronous DRAM Reads
US20080239841A1
DDR memory controller
US20090307521A1
