Memory training method, memory controller, processor and electronic device

By adjusting the DQS transmission latency of the memory controller, the relative timing positions of DQS and DQ are quickly aligned, solving the problem of increased data transmission error rate in electronic devices. This enables efficient memory training during processor operation, maintaining the accuracy and stability of data transmission.

CN114356206BActive Publication Date: 2024-11-26HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011063745.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2024-11-26
Estimated Expiration
2040-09-30

AI Technical Summary

Technical Problem

In the prior art, during the operation of electronic devices, the relative timing position offset between DQS and DQ in the data transmission between the memory controller and the memory chip is caused by environmental factors, which leads to an increase in the data transmission error rate. Existing memory training methods are too time-consuming to be executed frequently.

Method used

By adjusting the transmission latency of DQS by the memory controller, the target DQS transmission latency is determined so that the interval between it and the maximum and minimum transmission latency meets the timing requirements of the memory chip, thereby quickly aligning the relative timing positions of DQS and DQ during processor operation.

Benefits of technology

Without affecting processor operation, frequent memory training is performed to maintain sufficient timing margin between DQS and DQ, thereby improving the accuracy and stability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356206B_ABST
    Figure CN114356206B_ABST
Patent Text Reader

Abstract

The present application provides a memory training method, a memory controller, a processor and an electronic device, wherein the memory controller keeps the transmission delay of N DQs unchanged, adjusts the transmission delay of DQS, and determines the maximum DQS transmission delay and / or minimum DQS transmission delay of DQS when all the data carried by N DQs are transmitted correctly. The memory controller adjusts the transmission delay of DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay. This method is conducive to quickly aligning the relative timing position between DQS and N DQs, so that memory training can be repeatedly performed during the operation of the processor to keep the N DQs with sufficient timing margin.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of memory training technology, and in particular to a memory training method, a memory controller, a processor and an electronic device. Background Art

[0002] In current electronic devices, most of them are integrated with processors and memory chips. Among them, the memory chip is the basis for the processor to perform operations, and the processor can be coupled to the memory chip through a memory controller. The memory controller and the memory chip are connected through a memory bus. Among them, the memory bus mainly includes at least one data signal line and a timing signal line. Each data signal line can transmit a data signal (data signal), and DQ is used to represent the data signal in this application, wherein DQ is the abbreviation of the data signal defined in the double data rate synchronous dynamic random access memory (DDR SDRAM) protocol, also known as the DDR protocol, and the timing signal line can transmit a data strobe signal (data strobe signal), and DQS is used to represent the data strobe signal in this application, wherein DQS is the abbreviation of the data strobe signal defined in the DDR protocol, and both DQ and DQS are periodic signals, and the two generally have the same cycle length.

[0003] In most cases, the processor can read data from the memory chip through the memory controller, and can also write data to the memory chip through the memory controller. In the process of the memory controller reading data from the memory chip, the memory controller can instruct the memory chip to send DQ and DQS to the memory controller, wherein the DQ can carry the data to be read by the memory controller in the memory chip, and the DQS can trigger the memory controller to identify the level state of the above DQ, and the memory controller can then obtain the data carried in the DQ signal according to the level state of the DQ signal.

[0004] When the memory controller writes data to the memory chip, the memory controller can send DQ and DQS to the memory chip, wherein the DQ can carry the data that the memory controller wants to write into the memory chip, and the DQS can trigger the memory chip to identify the level state of the above DQ, and then the data carried in the DQ can be written into the memory chip.

[0005] From the above process of the memory controller reading data from the memory chip and the process of the memory controller writing data to the memory chip, it can be seen that the accuracy of data transmission between the memory controller and the memory chip depends on the relative timing position alignment between DQS and DQ, that is, only when DQ has sufficient timing margin relative to DQS can the receiving end of DQ have a lower bit error rate, thereby ensuring the accuracy of data transmission.

[0006] Although most electronic devices will perform memory initialization after power-on, memory initialization includes relatively complex memory training, which can accurately align the relative timing position between DQS and DQ, but due to objective factors such as ambient temperature and error accumulation, the relative timing position between DQS and DQ may still be offset after the electronic device completes memory initialization. However, the current memory training method takes too long, so it is impossible to repeatedly perform memory training during the operation of the electronic device. As the working time of the electronic device increases, the offset of the relative timing position between DQS and DQ gradually increases, and the bit error rate of data transmission between the memory controller and the memory chip in the electronic device gradually increases, and the accuracy of data transmission decreases accordingly. Summary of the invention

[0007] In view of this, the present application provides a memory training method, which is conducive to aligning the relative timing position between DQS and DQ transmitted in the same direction in a short time. Therefore, memory training can be repeatedly performed during the operation of the processor to ensure that the DQ transmitted between the memory controller and the memory chip maintains sufficient timing margin.

[0008] In the first aspect, an embodiment of the present application provides a memory training method, which can be applied to a memory controller and mainly includes the following steps: the memory controller keeps the transmission delay of N DQs unchanged, and adjusts the transmission delay of DQS, and determines the maximum DQS transmission delay and / or minimum DQS transmission delay of DQS when all the data carried by N DQs are transmitted correctly. The memory controller adjusts the transmission delay of DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay. Among them, the interval between the target DQS transmission delay and the maximum DQS transmission delay is not less than the target hold time applicable to the receiving end, and / or the interval between the target DQS transmission delay and the minimum DQS transmission delay is not less than the target establishment time applicable to the receiving end.

[0009] In the embodiment of the present application, N DQs and DQSs are signals transmitted in the same direction, for example, N DQs and DQSs are transmitted from the memory controller to the memory chip, or from the memory chip to the memory controller. DQS can trigger the receiving end of N DQs to identify the level state of N DQs, wherein the adjustment of the DQS transmission delay by the memory controller is used to adjust the phase of DQS.

[0010] Specifically, when N DQs and DQSs are transmitted from the memory controller to the memory chip, the receiving end of the N DQs is the memory chip, and the transmission delay of the DQS is the transmission delay of the DQS. Then the memory controller adjusts the transmission delay of the DQS to the target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay, and the interval between the target DQS transmission delay and the maximum DQS transmission delay is not less than the target hold time applicable to the memory chip, and / or, the interval between the target DQS transmission delay and the minimum DQS transmission delay is not less than the target establishment time applicable to the memory chip. In this case, the correct transmission of all the data carried by the N DQs can be understood as the memory chip being able to correctly identify the level status of the N DQs, so that all the data carried by the N DQs can be correctly written into the memory chip.

[0011] When N DQs and DQSs are transmitted from the memory chip to the memory controller, the receiving end of the N DQs is the memory controller, and the transmission delay of the DQS is the receiving delay of the DQS. Then the memory controller adjusts the receiving delay of the DQS to a target DQS receiving delay between the maximum DQS receiving delay and the minimum DQS receiving delay, and the interval between the target DQS receiving delay and the maximum DQS receiving delay is not less than the target holding time applicable to the memory controller, and / or, the interval between the target DQS receiving delay and the minimum DQS receiving delay is not less than the target establishment time applicable to the memory controller. In this case, the data carried by the N DQs are all transmitted correctly, which can be understood as the memory controller can correctly identify the level status of the N DQs, so that the data carried by the N DQs can be correctly read.

[0012] In the technical solution provided in the embodiment of the present application, the memory controller can align the relative timing positions between N DQs and DQS by adjusting the transmission delay of DQS, so that the N DQs have sufficient timing margin. Compared with the memory training solution of adjusting the transmission delay of DQS and N DQs separately, the embodiment of the present application reduces the steps of adjusting the transmission delay, which is conducive to quickly aligning the relative timing positions between DQS and N DQs. Therefore, memory training can be repeatedly performed during the operation of the processor to keep the N DQs with sufficient timing margin.

[0013] Next, a specific implementation method of determining the minimum DQS transmission delay by the memory controller is further described by way of example:

[0014] In a possible implementation, the memory controller may start from the initial DQS transmission delay and gradually reduce the DQS transmission delay until a data transmission error carried by at least one DQ occurs, at which point the DQS transmission delay may be used as the minimum DQS transmission delay.

[0015] In another possible implementation, the memory controller may first reduce the transmission delay of DQS to a first DQS transmission delay, the first DQS transmission delay being separated from the transmission delay of DQS before reduction by a target setup time applicable to the receiving end; when there is a data transmission error carried by at least one DQ, the memory controller gradually increases the transmission delay of DQS until all the data carried by N DQs are transmitted correctly, and determines that the corresponding DQS transmission delay is the minimum DQS transmission delay of DQS.

[0016] The DQS transmission delay before reduction may be an initial DQS transmission delay, for example, a DQS transmission delay before or when the memory controller starts to execute the current memory training.

[0017] Since the target setup time applicable to the receiving end is often less than the duration of the half cycle of DQ, the distance between the reduced DQS transmission delay and the minimum transmission delay will not exceed the target setup time applicable to the receiving end. With this implementation, the steps of adjusting the DQS transmission delay can be reduced, and the minimum DQS transmission delay can be quickly determined.

[0018] Exemplarily, when gradually increasing the transmission delay of DQS, the memory controller may gradually increase the transmission delay of DQS by increasing the first DQS adjustment amplitude each time. The first DQS adjustment amplitude is less than the target setup time applicable to the receiving end. For example, the first DQS adjustment amplitude may be the minimum adjustment amplitude of the memory controller for the transmission delay of DQS.

[0019] Next, a specific implementation method of determining the maximum DQS transmission delay by the memory controller is further described by way of example:

[0020] In a possible implementation, the memory controller may start from the initial DQS transmission delay and gradually increase the DQS transmission delay until a data transmission error carried by at least one DQ occurs. At this time, the DQS transmission delay may be used as the maximum DQS transmission delay.

[0021] In another possible implementation, the memory controller may increase the transmission delay of DQS to a second DQS transmission delay, the second DQS transmission delay being separated from the transmission delay of DQS before the increase by a target hold time applicable to the receiving end; when there is a data transmission error carried by at least one DQ, the memory controller gradually reduces the transmission delay of DQS until all the data carried by N DQs are transmitted correctly, and determines that the corresponding DQS transmission delay is the maximum DQS transmission delay of DQS.

[0022] The DQS transmission delay before the increase may be an initial DQS transmission delay, for example, it may be a DQS transmission delay before the memory controller starts to execute the current memory training or when the memory controller starts to execute the current memory training.

[0023] This implementation method is helpful to reduce the number of times of adjusting the DQS transmission delay, thereby facilitating the rapid determination of the maximum DQS transmission delay. The specific analysis is similar to the above determination of the minimum DQS transmission delay, which will not be repeated here.

[0024] Exemplarily, when gradually reducing the transmission delay of DQS, the memory controller may gradually reduce the transmission delay of DQS by reducing the second DQS adjustment amplitude each time. The second DQS adjustment amplitude is less than the target hold time applicable to the receiving end. For example, the second DQS adjustment amplitude may be the minimum adjustment amplitude of the memory controller for the transmission delay of DQS.

[0025] In the second aspect, an embodiment of the present application provides a memory training method, which can be applied to a memory controller, and mainly includes the following steps: the memory controller keeps the transmission delay of DQS unchanged, and adjusts the transmission delay of the first DQ, so as to determine the maximum DQ transmission delay and / or minimum DQ transmission delay of the first DQ when the data carried by the first DQ is correctly transmitted. The memory controller adjusts the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay, and the interval between the target DQ transmission delay and the maximum DQ transmission delay is not less than the target setup time applicable to the receiving end, and / or the interval between the target DQ transmission delay and the minimum DQ transmission delay is not less than the target hold time applicable to the receiving end.

[0026] In the embodiment of the present application, DQS and the first DQ are signals transmitted in the same direction. For example, DQS and the first DQ can be transmitted from the memory controller to the memory chip, or from the memory chip to the memory controller. DQS can trigger the receiving end of the first DQ to identify the level state of the first DQ, wherein the memory controller adjusts the transmission delay of the first DQ to adjust the phase of the first DQ.

[0027] Specifically, when the first DQ and DQS are transmitted from the memory controller to the memory chip, the receiving end of the first DQ is the memory chip, and the transmission delay of the first DQ is the transmission delay of the first DQ, then the memory controller adjusts the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay. The interval between the target DQ transmission delay and the maximum DQ transmission delay is not less than the target setup time applicable to the memory chip, and / or the interval between the target DQ transmission delay and the minimum DQ transmission delay is not less than the target setup time applicable to the target chip.

[0028] When the first DQ and DQS are transmitted from the memory chip to the memory controller, the receiving end of the first DQ is the memory controller, and the transmission delay of the first DQ is the receiving delay of the first DQ, then the memory controller adjusts the receiving delay of the first DQ to a target DQ receiving delay between the maximum DQ receiving delay and the minimum DQ receiving delay. The interval between the target DQ receiving delay and the maximum DQ receiving delay is not less than the target setup time applicable to the memory controller, and / or the interval between the target DQ receiving delay and the minimum DQ receiving delay is not less than the target hold time applicable to the memory controller.

[0029] In an embodiment of the present application, DQS may correspond to N DQs, that is, the DQS may trigger the receiving end of the N DQs to identify the level state of the N DQs. In an embodiment of the present application, the first DQ is located within the N DQs and may be one of the DQs. In this case, before adjusting the transmission delay of the first DQ, the memory controller may also determine, according to the round-robin rule, that the next DQ of the DQ that completed the previous memory training among the N DQs is the first DQ.

[0030] In an embodiment of the present application, the memory controller only adjusts the transmission delay of one DQ (the first DQ) during each memory training process. Compared with the memory training scheme that adjusts the transmission delays of DQS and DQ separately, the embodiment of the present application reduces the steps of adjusting the transmission delay, which is conducive to quickly aligning the relative timing position between DQS and the first DQ. Moreover, when adjusting the transmission delay of one of the DQs, the processor can still access the memory chip through other DQs, which is conducive to further reducing the impact of memory training on the operation of the processor. Therefore, memory training can be repeatedly performed during the operation of the processor to keep N DQs with sufficient timing margin.

[0031] Next, the method for determining the minimum DQ transmission delay by the control circuit is further described:

[0032] In a possible implementation, the memory controller may start from the initial DQ transmission delay and gradually reduce the transmission delay of the first DQ until the data transmission error carried by the first DQ is reached. At this time, the transmission delay of the first DQ can be used as the minimum DQ transmission delay.

[0033] In another possible implementation, the memory controller may reduce the transmission delay of the first DQ to the first DQ transmission delay, and the first DQ transmission delay and the transmission delay of the first DQ before reduction are separated by a target hold time applicable to the receiving end; when the data transmission carried by the first DQ is erroneous, the memory controller may gradually increase the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and determine that the corresponding first DQ transmission delay is the minimum DQ transmission delay.

[0034] The transmission delay of the first DQ before reduction may be an initial DQ transmission delay, for example, the transmission delay of the first DQ before the memory controller can start to execute the current memory training or when the memory controller starts to execute the current memory training.

[0035] Since the target hold time applicable to the receiving end is often less than half the cycle of the first DQ, and the reduced transmission delay of the first DQ and the minimum DQ transmission delay will not exceed the target hold time applicable to the receiving end, this implementation method is beneficial to reducing the number of times the first DQ transmission delay is adjusted, thereby quickly determining the minimum DQ transmission delay.

[0036] Exemplarily, when gradually increasing the transmission delay of the first DQ, the memory controller may gradually increase the transmission delay of the first DQ by increasing the adjustment amplitude of the first DQ each time. The adjustment amplitude of the first DQ is less than the target retention time applicable to the receiving end. Exemplarily, the adjustment amplitude of the first DQ is the minimum adjustment amplitude of the delay circuit for the transmission delay of the first DQ.

[0037] Next, the method by which the memory controller determines the maximum DQ transmission latency is further described:

[0038] In a possible implementation, the memory controller may start from the initial DQ transmission delay and gradually increase the transmission delay of the first DQ until the data transmission carried by the first DQ is erroneous. At this time, the transmission delay of the first DQ may be used as the maximum DQ transmission delay.

[0039] In another possible implementation, the memory controller may increase the transmission delay of the first DQ to a second DQ transmission delay, where the second DQ transmission delay is separated from the transmission delay of the first DQ before the increase by a target setup time applicable to the receiving end; when the data transmission carried by the first DQ is erroneous, the control circuit may control the delay circuit to gradually reduce the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and the corresponding transmission delay of the first DQ is determined to be the maximum DQ transmission delay.

[0040] The transmission delay of the first DQ before the increase may be the initial DQ transmission delay, for example, the transmission delay of the first DQ before the control circuit starts to execute the current memory training or when the control circuit starts to execute the current memory training.

[0041] This implementation is helpful to reduce the number of times of adjusting the first DQ transmission delay, thereby facilitating rapid determination of the maximum DQ transmission delay. The specific analysis is similar to the above determination of the minimum DQ transmission delay, which will not be repeated here.

[0042] Exemplarily, the control circuit may control the delay circuit to gradually reduce the transmission delay of the first DQ by reducing the second DQ adjustment amplitude each time. The second DQ adjustment amplitude is less than the target setup time applicable to the receiving end. For example, the second DQ adjustment amplitude may be the minimum adjustment amplitude of the delay circuit for the transmission delay of the first DQ.

[0043] In a third aspect, an embodiment of the present application provides a memory controller, which can implement the memory training method provided in any one of the first aspects. The technical effects of the corresponding scheme in the third aspect can refer to the technical effects that can be obtained by the corresponding scheme in the first aspect, and the repeated parts are not described in detail. Exemplary:

[0044] The memory controller mainly includes a delay circuit and a control circuit. The delay circuit can generate a transmission delay of DQS under the control of the control circuit. The delay circuit adjusts the transmission delay of DQS and can adjust the phase of DQS. The control circuit can control the delay circuit to keep the transmission delay of N DQs unchanged, and control the delay circuit to adjust the transmission delay of DQS, so as to determine the maximum DQS transmission delay and / or minimum DQS transmission delay of DQS when all the data carried by N DQs are transmitted correctly. Among them, the above-mentioned N DQs and DQSs are all transmitted from the memory controller to the memory chip, or are all transmitted from the memory chip to the memory controller, and DQS can trigger the receiving end of N DQs to identify the level state of N DQs. When N DQs and DQSs are transmitted from the memory controller to the memory chip, the receiving end of N DQs is the memory chip, and when N DQs and DQSs are transmitted from the memory chip to the memory controller, the receiving end of N DQs is the memory controller. The control circuit controls the delay circuit to adjust the DQS transmission delay to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay, wherein the interval between the target DQS transmission delay and the maximum DQS transmission delay is not less than a target hold time applicable to the receiving end, and / or the interval between the target DQS transmission delay and the minimum DQS transmission delay is not less than a target setup time applicable to the receiving end.

[0045] Specifically, N DQs and DQSs may be transmitted from the memory controller to the memory chip, and the transmission delay of the DQS is the transmission delay of the DQS. In this case, the control circuit may control the delay circuit to adjust the transmission delay of the DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay.

[0046] N DQs and DQSs may also be transmitted from the memory chip to the memory controller, and the transmission delay of the DQS is the reception delay of the DQS. In this case, the control circuit may control the delay circuit to adjust the reception delay of the DQS to a target DQS reception delay between the maximum DQS reception delay and the minimum DQS reception delay.

[0047] Next, the method of determining the minimum DQS transmission delay of the control circuit is further explained:

[0048] In a possible implementation, the control circuit can control the delay circuit to gradually reduce the DQS transmission delay starting from the initial DQS transmission delay until at least one DQ-borne data transmission error occurs. At this point, the DQS transmission delay can be used as the minimum DQS transmission delay.

[0049] In another possible implementation, the control circuit may control the delay circuit to reduce the transmission delay of DQS to a first DQS transmission delay, the first DQS transmission delay being separated from the transmission delay of DQS before reduction by a target setup time applicable to the receiving end; when there is a data transmission error carried by at least one DQ, the control circuit controls the delay circuit to gradually increase the transmission delay of DQS until all the data carried by N DQs are transmitted correctly, and the corresponding DQS transmission delay is determined to be the minimum DQS transmission delay of DQS.

[0050] The DQS transmission delay before reduction may be an initial DQS transmission delay, for example, it may be a DQS transmission delay before the control circuit starts to execute the current memory training or when the control circuit starts to execute the current memory training.

[0051] Exemplarily, when controlling the delay circuit to gradually increase the transmission delay of DQS, the control circuit may control the delay circuit to gradually increase the transmission delay of DQS by increasing the first DQS adjustment amplitude each time. The first DQS adjustment amplitude is less than the target setup time applicable to the receiving end. For example, the first DQS adjustment amplitude may be the minimum adjustment amplitude of the delay circuit for the transmission delay of DQS.

[0052] Next, the method of determining the maximum DQS transmission delay of the control circuit is further explained:

[0053] In a possible implementation, the control circuit can control the delay circuit to gradually increase the DQS transmission delay starting from the initial DQS transmission delay until at least one DQ carries a data transmission error. At this time, the DQS transmission delay can be used as the maximum DQS transmission delay.

[0054] In another possible implementation, the control circuit may control the delay circuit to increase the transmission delay of DQS to a second DQS transmission delay, the second DQS transmission delay being separated from the transmission delay of DQS before the increase by a target hold time applicable to the receiving end; when there is a data transmission error carried by at least one DQ, the control circuit controls the delay circuit to gradually reduce the transmission delay of DQS until all the data carried by N DQs are transmitted correctly, and the corresponding DQS transmission delay is determined to be the maximum DQS transmission delay of DQS.

[0055] The DQS transmission delay before the increase may be an initial DQS transmission delay, for example, it may be a DQS transmission delay before the control circuit starts to execute the current memory training or when the control circuit starts to execute the current memory training.

[0056] Exemplarily, when controlling the delay circuit to gradually reduce the transmission delay of DQS, the control circuit may control the delay circuit to gradually reduce the transmission delay of DQS by reducing the second DQS adjustment amplitude each time. The second DQS adjustment amplitude is less than the target hold time applicable to the receiving end. For example, the second DQS adjustment amplitude may be the minimum adjustment amplitude of the delay circuit for the transmission delay of DQS.

[0057] In a fourth aspect, an embodiment of the present application provides a memory controller, which can implement the memory training method provided in any one of the second aspects. The technical effects of the corresponding scheme in the fourth aspect can refer to the technical effects that can be obtained by the corresponding scheme in the second aspect, and the repeated parts will not be described in detail. Exemplary:

[0058] The delay circuit can generate a transmission delay of the first DQ under the control of the control circuit. The delay circuit adjusts the transmission delay of the first DQ and can adjust the phase of the first DQ. The control circuit can control the delay circuit to keep the transmission delay of DQS unchanged, and control the delay circuit to adjust the transmission delay of the first DQ, so as to determine the maximum DQ transmission delay and / or minimum DQ transmission delay of the first DQ when the data carried by the first DQ is transmitted correctly. Wherein, the above-mentioned DQS and the first DQ are both transmitted from the memory controller to the memory chip, or are both transmitted from the memory chip to the memory controller, and the DQS can trigger the receiving end of the first DQ to identify the level state of the first DQ, wherein when the first DQ and DQS are transmitted from the memory controller to the memory chip, the receiving end of the first DQ is the memory chip, and when the first DQ and DQS are transmitted from the memory chip to the memory controller, the receiving end of the first DQ is the memory controller; the control circuit controls the delay circuit to adjust the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay, the interval between the target DQ transmission delay and the maximum DQ transmission delay is not less than the target setup time applicable to the receiving end, and / or the interval between the target DQ transmission delay and the minimum DQ transmission delay is not less than the target hold time applicable to the receiving end.

[0059] The DQS may correspond to N DQs, and the first DQ is located within the N DQs. Before controlling the delay circuit to keep the transmission delay of the DQS unchanged and controlling the delay circuit to adjust the transmission delay of the first DQ, the control circuit may also first determine, according to a round-robin rule, that the next DQ of the DQ that previously completed memory training among the N DQs is the first DQ.

[0060] Specifically, the first DQ and DQS may both be transmitted from the memory controller to the memory chip, and the transmission delay of the first DQ is the transmission delay of the first DQ. In this case, the control circuit may control the delay circuit to adjust the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay.

[0061] The first DQ and DQS may also be transmitted from the memory chip to the memory controller, and the transmission delay of the first DQ is the reception delay of the first DQ. In this case, the control circuit may control the delay circuit to adjust the reception delay of the first DQ to a target DQ reception delay between the maximum DQ reception delay and the minimum DQ reception delay.

[0062] Next, the method for determining the minimum DQ transmission delay by the control circuit is further described:

[0063] In a possible implementation, the control circuit can control the delay circuit to gradually reduce the transmission delay of the first DQ from the initial DQ transmission delay until the data transmission error carried by the first DQ is reached. At this time, the transmission delay of the first DQ can be used as the minimum DQ transmission delay.

[0064] In another possible implementation, the control circuit may control the delay circuit to reduce the transmission delay of the first DQ to the first DQ transmission delay, and the first DQ transmission delay is separated from the transmission delay of the first DQ before reduction by a target hold time applicable to the receiving end; when the data transmission carried by the first DQ is erroneous, the control circuit may control the delay circuit to gradually increase the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and the corresponding first DQ transmission delay is determined to be the minimum DQ transmission delay.

[0065] The transmission delay of the first DQ before reduction may be the initial DQ transmission delay, for example, the transmission delay of the first DQ before the control circuit starts to execute the current memory training or when the control circuit starts to execute the current memory training.

[0066] Exemplarily, when controlling the delay circuit to gradually increase the transmission delay of the first DQ, the control circuit may control the delay circuit to gradually increase the transmission delay of the first DQ by increasing the adjustment amplitude of the first DQ each time. The adjustment amplitude of the first DQ is less than the target hold time applicable to the receiving end. Exemplarily, the adjustment amplitude of the first DQ is the minimum adjustment amplitude of the delay circuit on the transmission delay of the first DQ.

[0067] Next, the method for determining the maximum DQ transmission delay by the control circuit is further described:

[0068] In a possible implementation, the control circuit can control the delay circuit to gradually increase the transmission delay of the first DQ from the initial DQ transmission delay until the data transmission error carried by the first DQ occurs. At this time, the transmission delay of the first DQ can be used as the maximum DQ transmission delay.

[0069] In another possible implementation, the control circuit can control the delay circuit to increase the transmission delay of the first DQ to the second DQ transmission delay, and the interval between the second DQ transmission delay and the transmission delay of the first DQ before the increase is a target establishment time applicable to the receiving end; when the data transmission carried by the first DQ is erroneous, the control circuit can control the delay circuit to gradually shorten the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and determine that the corresponding first DQ transmission delay is the maximum DQ transmission delay.

[0070] The transmission delay of the first DQ before the increase may be the initial DQ transmission delay, for example, the transmission delay of the first DQ before the control circuit starts to execute the current memory training or when the control circuit starts to execute the current memory training.

[0071] Exemplarily, the control circuit may control the delay circuit to gradually reduce the transmission delay of the first DQ by reducing the second DQ adjustment amplitude each time. The second DQ adjustment amplitude is less than the target setup time applicable to the receiving end. For example, the second DQ adjustment amplitude may be the minimum adjustment amplitude of the delay circuit for the transmission delay of the first DQ.

[0072] In a fifth aspect, an embodiment of the present application provides a memory training device, which may be a memory controller. Exemplarily, the memory training device may execute the memory training method provided in any one of the first aspect or the second aspect. Specifically, the second communication device may include a module for executing the method in the second aspect or any possible implementation, such as a control unit and a delay unit.

[0073] Exemplarily, the delay unit can impose a transmission delay on DQS or the first DQ, and the control unit can adjust the DQS or the first DQ transmission delay by controlling the delay unit, so that the memory training device can execute the memory training method provided in any one of the first or second aspects above.

[0074] In a sixth aspect, an embodiment of the present application further provides a processor, which may include a processor core and a memory controller provided in any one of the third aspect and the fourth aspect. The processor core may send a trigger instruction to the memory controller; and the memory controller may perform memory training after receiving the trigger instruction.

[0075] Exemplarily, the processor core may send a trigger instruction to the memory controller when determining that the difference between the current ambient temperature and the historical ambient temperature exceeds the temperature fluctuation threshold, wherein the historical ambient temperature is the ambient temperature when the processor core sent the trigger instruction last time.

[0076] Exemplarily, the processor core may send the trigger instruction to the memory controller when determining that the time interval between the current time point and the time point when the processor core last completed memory training exceeds a time threshold.

[0077] In a seventh aspect, the present application provides an electronic device, which may include a processor and a memory chip as provided in the sixth aspect, and the memory chip is connected to a memory controller in the processor.

[0078] In an eighth aspect, an embodiment of the present application provides an electronic device, which mainly includes a processor, a memory chip and a memory controller, and the memory controller can be a memory controller as provided in any one of the third and fourth aspects above. The memory controller is connected to the processor and the memory chip respectively;

[0079] The processor may send a trigger instruction to the memory controller; and the memory controller may perform memory training after receiving the trigger instruction.

[0080] For example, the processor may send a trigger instruction to the memory controller when determining that the difference between the current ambient temperature and the historical ambient temperature exceeds the temperature fluctuation threshold, wherein the historical ambient temperature is the ambient temperature when the processor sent the trigger instruction last time.

[0081] For another example, the processor may send a trigger instruction to the memory controller when determining that the time interval between the current time point and the time point at which the trigger instruction was last sent exceeds a time threshold.

[0082] In a ninth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a memory controller, enable the memory controller to execute the methods described in the above aspects.

[0083] In a tenth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a memory controller, enables the memory controller to execute the methods described in the above aspects.

[0084] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] Figure 1 It is a schematic diagram of the structure of an electronic device;

[0086] Figure 2 A schematic diagram of the corresponding relationship between DQ and DQS;

[0087] Figure 3 A schematic diagram of a register in a memory controller;

[0088] Figures 4a to 4e A schematic diagram of the transmission delay adjustment of DQ and DQS during memory training;

[0089] Figure 5 It is a schematic diagram of a memory initialization process;

[0090] Figure 6 A flowchart of a memory training method provided in an embodiment of the present application;

[0091] Figure 7 A schematic diagram of the relative timing position relationship between DQ and DQS provided in an embodiment of the present application;

[0092] Figure 8 A schematic flow chart of a method for determining a maximum DQS transmission delay and / or a minimum DQS transmission delay provided in an embodiment of the present application;

[0093] Figure 9a and Figure 9b A schematic diagram of adjusting the transmission delay of DQS during a memory training process provided in an embodiment of the present application;

[0094] Fig.10 A flowchart of a memory training method provided in an embodiment of the present application;

[0095] Figures 11a to 11d A schematic diagram of adjusting the transmission delay of DQ and DQS during a memory training process provided in an embodiment of the present application;

[0096] Fig.12 A flowchart of a memory training method provided in an embodiment of the present application;

[0097] Fig.13 A schematic diagram of a maximum DQ transmission delay and a minimum DQ transmission delay provided in an embodiment of the present application;

[0098] Fig.14 A flowchart of a method for determining a maximum DQ transmission delay and / or a minimum DQ transmission delay provided in an embodiment of the present application;

[0099] Fig.15 A schematic diagram of DQ transmission delay adjustment during a memory training process provided in an embodiment of the present application;

[0100] Fig.16 A schematic diagram of DQ transmission delay adjustment during a memory training process provided in an embodiment of the present application;

[0101] Fig.17 A flowchart of a memory training method provided in an embodiment of the present application;

[0102] Fig.18 A schematic diagram of DQ transmission delay adjustment during a memory training process provided in an embodiment of the present application;

[0103] Fig.19 A schematic diagram of DQ transmission delay adjustment during a memory training process provided in an embodiment of the present application;

[0104] Fig. 20 A schematic diagram of a round-robin rule provided in an embodiment of the present application;

[0105] Fig.21 A schematic diagram of a memory controller structure provided in an embodiment of the present application;

[0106] Fig. 22 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0107] In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The specific operating method in the method embodiment can also be applied to the device embodiment or the system embodiment. It should be noted that in the description of the present application, "at least one" refers to one or more, wherein multiple refers to two or more. In view of this, "multiple" can also be understood as "at least two" in the embodiment of the present invention. "And / or" describes the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / ", unless otherwise specified, generally indicates that the related objects before and after are in an "or" relationship. In addition, it should be understood that in the description of the present application, words such as "first" and "second" are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.

[0108] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0109] In electronic devices (such as smartphones, tablets, base stations, smart cameras, self-driving vehicles, etc.), memory chips are the basis for processors to perform operations, and processors can be coupled to memory chips through memory controllers. Among them, the memory controller can be connected to the processor or integrated inside the processor.

[0110] For example, Figure 1 As shown, the electronic device 10 mainly includes a processor 11 and a memory chip 12. The processor 11 includes a processor core 112 and a memory controller 111. In another possible architecture, the memory controller 111 is located outside the processor 11, which will not be described in detail.

[0111] In the embodiment of the present application, the processor core 112 may be a logic circuit with logic operation capability, and the memory chip 12 may be a memory chip supporting double data rate synchronous dynamic random access memory (DDR SDRAM), wherein DDR SDRAM is usually referred to as DDR. For example, the memory chip 12 may support the fifth generation DDR (5 thDDR, DDR5), specifically low power DDR5 (low power DDR5, LPDDR5). The memory chip 12 can also support the fourth generation DDR (4 th DDR, DDR4), specifically low power DDR4 (low power DDR4, LPDDR4).

[0112] Figure 1 In the embodiment, the memory controller 111 and the memory chip 12 are connected via a memory bus 13. The memory bus 13 mainly includes a plurality of data signal lines (such as Figure 1 data signal lines L0 to L7), and multiple timing signal lines (such as Figure 1 The timing signal lines LS-P and LS-N in the circuit.

[0113] Data signal line L0 to data signal line L7 can transmit 8 data signals (data signal, DQ) in parallel. For example, data signal line L0 can transmit DQ0, data signal line L1 can transmit DQ1, ..., data signal line L7 can transmit DQ7. It should be understood that DQ is a periodic digital signal and can therefore carry data. For example, DQ can transmit 1 bit of data in one cycle, wherein, in a low level cycle, 1 bit of data "0" can be transmitted, and in a high level cycle, 1 bit of data "1" can be transmitted. Since data signal line L0 to data signal line L7 can transmit 8 DQs in parallel, data signal line L0 to data signal line L7 transmit a total of 8 bits of data in one cycle.

[0114] It can be understood that since DQ is a digital signal, the receiving end of DQ needs to use a clock signal with the same period as DQ to correctly distinguish the period of DQ, so as to correctly identify the level state of DQ, and then correctly obtain the data carried by DQ. In view of this, the memory bus 13 can also include a timing signal line LS-N and a timing signal line LS-P, and the timing signal line LS-N and the timing signal line LS-P can transmit a data strobe signal (data strobe signal, DQS).

[0115] Specifically, the timing signal line LS-N can transmit DQS-N, and the timing signal line LS-P can transmit DQS-P. Wherein, DQS-N and DQS-P are inverted signals. For example, DQS-N and DQS-P can be as follows Figure 2 DQS includes DQS-N and DQS-P. DQS can be used as a clock signal corresponding to DQ, has the same transmitting end and receiving end as DQ, and can trigger the receiving end of DQ to identify the level state of DQ. For ease of description, the embodiments of the present application will refer to DQS-N and DQS-P as DQS.

[0116] It should be noted that bidirectional data transmission between the memory controller 111 and the memory chip 12 can be achieved through the memory bus 13. For example, when the memory controller 111 writes data to the memory chip 12, the memory controller 111 can be used as the transmitter of DQS and DQ, and the memory chip 12 can be used as the receiver of DQS and DQ. When the memory controller 111 reads data from the memory chip 12, the memory chip 12 can be used as the transmitter of DQS and DQ, and the memory controller 111 can be used as the receiver of DQS and DQ.

[0117] For ease of description, in the present embodiment, write DQ and write DQS are used to represent the DQ and DQS sent by the memory controller 111 to the memory chip 12 during the process of the memory controller 111 writing data to the memory chip 12; and read DQ and read DQS are used to represent the DQ and DQS sent by the memory chip 12 to the memory controller 111 during the process of the memory controller 111 reading data from the memory chip 12. The write DQ includes write DQ0 to write DQ7, and the read DQ includes read DQ0 to read DQ7.

[0118] Next, the specific implementation of writing data and reading data is explained respectively:

[0119] Scenario 1: Memory controller 111 writes data to memory chip 12

[0120] During the operation of the processor 11, the processor core 112 may call the memory controller 111 to write data into the memory chip 12. The specific implementation of the processor core 112 calling the memory controller 111 may refer to the prior art, and the embodiment of the present application does not impose any restrictions on this.

[0121] The memory controller 111 can write data to the memory chip 12 under the call of the processor core 112. Specifically, the memory controller 111 can send write DQ0 to write DQ7 to the memory chip 12 through the data signal line L0 to the data signal line L7, wherein the write DQ0 to write DQ7 sent by the memory controller 111 can carry the target write data that needs to be written to the memory chip 12.

[0122] During the process of the memory controller 111 writing data to the memory chip 12, the memory controller 111 will also send a write DQS to the memory chip 12. The write DQS can trigger the memory chip 12 to identify the level status of write DQ0 to write DQ7. The memory chip 12 can then store the data carried by write DQ0 to write DQ7 according to the identified level status, thereby realizing the writing of data to the memory chip 12.

[0123] Generally speaking, in the write DQS sent by the memory controller 111 to the memory chip 12, the intersection point between the write DQS-N and the write DQS-P (such as Figure 2 ) can be used as a trigger point for triggering the memory chip 12 to identify the level state of the write DQ. That is, when the memory chip 12 determines that the received write DQS is at a cross point, the memory chip 12 can identify the current level state of write DQ0 to write DQ7, so that the target write data carried by write DQ0 to write DQ7 can be written into the memory chip 12.

[0124] For example, if the target write data is 11010011, it corresponds to the same cross point in write DQS. At this time, the data carried by write DQ0 to write DQ7 are: write DQ0 can carry "1", write DQ1 can carry "1", write DQ2 can carry "0", write DQ3 can carry "1", write DQ4 can carry "0", write DQ5 can carry "0", write DQ6 can carry "1", and write DQ7 can carry "1".

[0125] When the memory chip 12 determines that the received write DQS is at a cross point, it can identify the level states of the received write DQ0 to write DQ7. As in the above example, write DQ0 is high (carrying "1"), write DQ1 is high (carrying "1"), write DQ2 is low (carrying "0"), write DQ3 is high (carrying "1"), write DQ4 is low (carrying "0"), write DQ5 is low (carrying "0"), write DQ6 is high (carrying "1"), and write DQ7 is high (carrying "1"). The memory chip 12 can then store the target write data "11010011" according to the identified level states of write DQ0 to write DQ7.

[0126] Scenario 2: Memory controller 111 reads data from memory chip 12

[0127] During the operation of the processor 11, the processor core 112 may call the memory controller 111 to read data from the memory chip 12. The specific implementation of the processor core 112 calling the memory controller 111 may refer to the prior art, and the embodiment of the present application does not impose any restrictions on this.

[0128] The memory controller 111, under the call of the processor core 112, can instruct the memory chip 12 to send the target read data to the memory controller 111, so that the memory controller 111 reads the target read data in the memory chip 12. The specific implementation of the memory controller 111 instructing the memory chip 12 can refer to the prior art, and the embodiment of the present application does not impose any restrictions on this.

[0129] The memory chip 12 can send read DQ0 to read DQ7 to the memory controller 111 through the data signal line L0 to the data signal line L7, and the read DQ0 to read DQ7 can carry the target read data sent to the memory controller 111. When the memory chip 12 sends read DQ0 to read DQ7 to the memory controller 111, the memory chip 12 also sends a read DQS to the memory controller 111. The memory controller 111 can identify the level state of read DQ0 to read DQ7 according to the read DQS, and obtain the target read data carried by read DQ0 to read DQ7 according to the identified level state, thereby realizing the reading of data from the memory chip 12.

[0130] The specific implementation of reading DQS and reading DQ0 to reading DQ7 is similar to the above scenario 1, which will not be described in detail. The difference is that in the read DQS sent by the memory chip 12 to the memory controller 111, the middle point between two adjacent intersections can usually be used as a trigger point for triggering the memory controller 111 to identify the level state of read DQ0 to read DQ7. In other words, when the memory chip 12 determines that the received read DQS is at the middle point, the memory controller 111 can identify the current level state of read DQ0 to read DQ7 to obtain the target read data carried by read DQ0 to read DQ7.

[0131] From the above scenarios 1 and 2, it can be seen that whether the memory controller 111 and the memory chip 12 can accurately transmit data is closely related to whether the relative timing positions of the DQS and DQ transmitted in the same direction are aligned. Among them, the DQS and DQ transmitted in the same direction can be understood as read DQS and read DQ, and can also be understood as write DQS and write DQ.

[0132] by Figure 2 Taking the write DQS and write DQ shown in the figure as an example, the write DQ can be any write DQ from write DQ0 to write DQ7. The intersection of write DQS is used as a trigger point, and the write DQ cycle corresponding to the intersection refers to the write DQ cycle in which the intersection occurs. Figure 2 It can be seen that the trigger point (cross point) of the write DQS can divide the write DQ cycle corresponding to the trigger point into two parts, the part before the trigger point is the setup time, and the part after the trigger point is the hold time. Assume that the start time point of any write DQ cycle received by the memory chip 12 is t1, and the end time point of the write DQ cycle is t2. Between t1 and t2, the time point at which the write DQS received by the memory chip 12 is at the trigger point is t0. In this case, the time period between t1 and t0 can be called the setup time, and the time period between t0 and t2 can be called the hold time.

[0133] Sufficient setup time for write DQ is beneficial to improve the accuracy of data transmission. Specifically, since write DQ is a digital signal, the level state of write DQ often changes, that is, write DQ may be low or high in any cycle. Between two adjacent cycles, the level state of write DQ may remain unchanged, change from low to high, or change from high to low.

[0134] Usually, the high level and the low level are relative to the reference level, that is, if the level of the write DQ is lower than the reference level, the write DQ is a low level, and if the level of the write DQ is higher than the reference level, the write DQ is a high level. When the level state of the write DQ changes, it often takes a certain delay to complete the level state switching. For example, Figure 2 As shown, the level of write DQ reaches the reference level at tmin and tmax.

[0135] Taking the switching from the low level of the previous cycle to the high level of the current cycle as an example, if the setup time is insufficient, such as t0 is between t1 and tmin, the level of the write DQ at t0 may not have completely risen to a high level greater than the reference level, and the memory chip 12 may mistakenly think that the write DQ is at a low level in the current cycle. That is, the write DQ of the current cycle should be a high level, but because t0 is between t1 and tmin and the level has not completely risen to a level greater than the reference level, it is mistakenly identified as a low level, thereby causing errors in the data written to the memory chip 12. Therefore, in order to ensure the accuracy of data transmission between the memory controller 111 and the memory chip 12, it is necessary to ensure that the setup time is long enough.

[0136] The sufficient holding time of write DQ is also conducive to improving the accuracy of data transmission. Specifically, the memory chip 12 needs a certain delay to identify the level state of write DQ. Taking the high level of the current cycle switching to the low level of the next cycle as an example, the memory chip 12 starts to identify the level state of write DQ at t0. If the holding time is insufficient, such as t0 is between tmax and t2, the level of write DQ may drop below the reference level (write DQ is low in the next cycle) during the period when the memory chip 12 identifies the level state of write DQ, so that the memory chip 12 mistakenly recognizes the level of the current cycle as a low level, thereby causing errors in the data written to the memory chip 12. In other words, the level of write DQ in the current cycle should be a high level, but because t0 is between tmax and t2 and the level drops below the reference level, it is mistakenly regarded as a low level. Therefore, in order to ensure the accuracy of data transmission between the memory controller 111 and the memory chip 12, it is necessary to ensure that the holding time is long enough.

[0137] In summary, in order to improve the accuracy of data transmission between the memory controller 111 and the memory chip 12, the hold time and setup time of the write DQ need to be longer. When the hold time or setup time of the write DQ is insufficient, the accuracy of data transmission between the memory controller 111 and the memory chip 12 is reduced, and the bit error rate is increased.

[0138] Generally speaking, the reference voltages in the memory controller 111 and the memory chip 12 are the same. Figure 2 The time interval between the write DQS and the write DQ, tmin and t1 shown can also be called the minimum setup time applicable to the memory chip 12, and the time interval between tmax and t2 can also be called the minimum hold time applicable to the memory chip t2.

[0139] In a write DQ cycle, the difference between the setup time of the write DQS and the minimum setup time applicable to the memory chip 12 can be called the timing margin of the write DQ setup time, and the difference between the hold time of the write DQS and the minimum hold time applicable to the memory chip 12 can be called the timing margin of the write DQ hold time. The minimum value of the timing margin of the write DQ setup time and the timing margin of the hold time can be understood as the timing margin of the write DQ. For example Figure 2 In the example, the timing margin for writing DQ is the minimum value between the difference between t0 and tmin, and the difference between tmax and t0.

[0140] Generally speaking, the time interval between tmin and tmax is mainly determined by the performance of the memory chip 12. That is to say, for the memory controller 111, the sum of the timing margin of the setup time of the write DQ and the timing margin of the hold time is not adjustable. In this case, the memory controller 111 can adjust the time point t0 corresponding to the intersection of the write DQS to the middle position of tmin and tmax, that is, the timing margin of the setup time of the write DQ is equal to the timing margin of the hold time, so that the timing margin of the write DQ can reach the maximum value, so that the accuracy of the data transmission from the memory controller 111 to the memory chip 12 can be optimized from the perspective of the timing margin.

[0141] Based on the same principle, in the process of the memory controller 111 reading data from the memory chip 12, the difference between the hold time of the read DQ sent by the memory chip 12 to the memory controller 111 and the minimum hold time applicable to the memory controller 111 can also be called the timing margin of the hold time of the read DQ. The difference between the setup time of the read DQ and the minimum setup time applicable to the memory controller 111 can also be called the timing margin of the setup time of the read DQ. The timing margin of the read DQ can be understood as the minimum value of the timing margin of the hold time of the read DQ and the timing margin of the setup time. When the timing margin of the hold time and the timing margin of the setup time in the read DQ sent by the memory chip 12 to the memory controller 111 are equal, the timing margin of the read DQ can reach the maximum value. In this case, the accuracy of data transmission from the memory chip 12 to the memory controller 111 can be optimized from the perspective of the timing margin.

[0142] In order to improve the timing margin of reading DQ and writing DQ, thereby improving the accuracy of data transmission between the memory controller 111 and the memory chip 12, it is often necessary to align the relative timing positions of DQ and DQS transmitted in the same direction. This process is often called memory training.

[0143] In the embodiment of the present application, "alignment" can be understood as that in the DQS and DQ transmitted in the same direction, the timing margin of the DQ hold time and the timing margin of the setup time are equal, or the timing margin of the DQ hold time and the timing margin of the setup time are not much different, so that the DQ has a relatively sufficient timing margin of the hold time and the timing margin of the setup time. The timing margin of the DQ setup time is relative to the minimum setup time applicable to the receiving end, and the timing margin of the DQ hold time is also relative to the minimum hold time applicable to the receiving end. In other words, "alignment" can make the DQ setup time not less than the minimum setup time applicable to the receiving end, and make the DQ hold time not less than the minimum hold time applicable to the receiving end.

[0144] The receiving end may be either the memory chip 12 or the memory controller 111. The minimum setup time and the minimum hold time applicable to the receiving end may be obtained based on factors such as the structure and performance of the receiving end. If the setup time of the DQ is less than the minimum setup time applicable to the receiving end, or the hold time of the DQ is less than the minimum hold time applicable to the receiving end, the receiving end may be unable to correctly identify the data carried by the DQ.

[0145] In view of this, during the startup of the electronic device 10, the memory training can be performed during the initialization period after the processor 11 is powered on to align the relative timing position between the DQ and DQS transmitted in the same direction. Currently, there are many complex memory training schemes. In most memory training schemes, the memory controller 111 mainly adjusts the transmission delay of DQ and DQS, thereby changing the phase of DQ and DQS, so that the relative timing position of the DQ and DQS transmitted in the same direction is aligned.

[0146] Specifically, the transmission delay of write DQ and write DQS can be called the sending delay, and the memory controller 111 adjusts the sending delay of write DQ and write DQS to align the relative timing positions of write DQ and write DQS. The transmission delay of read DQ and read DQS can be called the receiving delay, and the memory controller 111 adjusts the receiving delay of read DQ and read DQS to align the relative timing positions of read DQ and read DQS.

[0147] Among them, the transmission delay of write DQ and write DQS can be understood as the phase adjustment amplitude applied by the memory controller 111 to write DQ and write DQS. Specifically, the memory controller 111 is provided with multiple phase adjusters corresponding to multiple write DQs and write DQSs. Taking write DQS as an example, the write DQS signal generated by the memory controller 111 can be input into the phase adjuster corresponding to the write DQS, and the phase adjuster can apply a certain delay to the write DQS, that is, the transmission delay of the write DQS, so as to change the phase of the output write DQS. The write DQS will be output from the memory controller 111 only after it is transmitted by the corresponding phase adjuster.

[0148] Similarly, the reception delay of read DQ and read DQS can be understood as the phase adjustment amplitude applied by the memory controller 111 to read DQ and read DQS. Specifically, the memory controller 111 is provided with multiple phase adjusters corresponding to multiple read DQs and read DQSs. Taking read DQS as an example, the read DQS signal received by the memory controller 111 can be input into the phase adjuster corresponding to the read DQS, and the phase adjuster can apply a certain delay to the read DQS, that is, the reception delay of the read DQS, so as to change the phase of the received read DQS. After the read DQS is adjusted by the corresponding phase adjuster, the memory controller 111 further identifies the trigger point of the read DQS, and identifies the level state of the read DQ according to the identified trigger point.

[0149] For example, Figure 3The memory controller 111 shown mainly includes 8 registers (register, REG) 1, specifically REG1-0 to REG1-7, and the 8 REG1s correspond one-to-one with the phase adjusters of writing DQ0 to writing DQ7 (for example, REG1-0 corresponds to the phase adjuster of DQ0, REG1-1 corresponds to the phase adjuster of DQ1, and so on), which can be used to adjust the transmission delay of writing DQ0 to writing DQ7. Exemplarily, each REG1 can be a first input first output (FIFO) register.

[0150] Each REG1 may include 32 bits, which correspond to 32 types of transmission delays. For example, there are 32 possible values ​​for the transmission delay of write DQ1, which increases from the first value to the 32nd value, and the interval between any two adjacent values ​​is a fixed value. The fixed value can also be called a 1-step transmission delay, and the 1-step transmission delay can also be understood as the minimum adjustment range that the memory controller 111 can adjust the transmission delay of write DQ.

[0151] From the 1st bit to the 32nd bit of REG1-1, there are 32 possible values ​​of the transmission delay of writing DQ1. For every additional bit in REG1-1, the corresponding transmission delay increases by 1 step transmission delay. Exemplarily, the memory controller 111 can set any bit in REG1-1 to a high level, and keep the other bits at a low level, so that the transmission delay of writing DQ1 can be adjusted to the transmission delay corresponding to the high-level bit.

[0152] The memory controller 111 also includes REG2, which corresponds to the phase adjuster of write DQS and can be used to adjust the transmission delay of write DQS. The memory controller 111 also includes 8 REG3, specifically REG3-0 to REG3-7, which correspond to the phase adjusters of read DQ0 to read DQ7, and can be used to adjust the reception delay of read DQ0 to read DQ7. The memory controller 111 also includes REG4, which corresponds to the phase adjuster of read DQS and can be used to adjust the reception delay of read DQS.

[0153] It should be pointed out that the specific implementation method in which the memory controller 111 adjusts the sending delay of write DQ0 to write DQ7 through REG1-0 to REG1-7, the specific implementation method in which the memory controller 111 adjusts the sending delay of write DQS through REG2, the specific implementation method in which the memory controller 111 adjusts the receiving delay of read DQ0 to read DQ7 through REG3-0 to REG3-7, and the specific implementation method in which the memory controller 111 adjusts the receiving delay of read DQS through REG4 can all refer to the existing technology and will not be repeated here.

[0154] based on Figure 3 The memory controller 111 shown in the figure, the currently common timing position alignment method mainly includes the following processes:

[0155] 1. The relative timing position between write DQ and write DQS is aligned.

[0156] Before the memory controller 111 starts to align the relative timing position between write DQ and write DQS, the memory controller 111 can first configure the send delay of write DQ0 to write DQ7, and write DQS as the default send delay or the default send delay. The memory controller 111 can then adjust the send delay of DQS and each DQ based on the default send delay. Among them, the default send delays of write DQ0 to write DQ7 and write DQS can be the same or different, and the embodiments of the present application do not impose any restrictions on this.

[0157] For example, based on the default transmission delay configured by the memory controller 111, the relative timing positions between write DQ0 to write DQ7 and write DQS can be as follows: Figure 4a As shown, the relative timing positions between write DQ0 to write DQ7 and between write DQS and multiple write DQs are greatly offset.

[0158] It should be pointed out that Figure 4a Only the relative timing positions between a cycle of write DQ0 to a cycle of write DQ7 and the cross points in write DQS are shown. Since each write DQ in write DQ0 to write DQ7 has the same cycle as write DQS, when the memory controller 111 does not change the transmission delay of write DQ0 to write DQ7 and write DQS, the relative timing positions between the cross points of write DQS and the corresponding write DQ cycles in other cycles can be as shown. Figure 4a That is, assuming that the cycle length is T, the relative timing position between the intersection of the write DQS at t00+MT and the corresponding write DQ cycle can also be as follows: Figure 4a As shown, where M is an integer greater than or equal to 0.

[0159] right Figure 4a The timing position alignment process between the write DQ and the write DQS sent by the memory controller 111 mainly includes the following steps:

[0160] Step 1: If Figure 4b As shown, the memory controller 111 gradually reduces the sending delay of the write DQS until at least one of the data carried by the write DQ cannot be correctly written into the memory chip 12. At this time, the cross point of the write DQS sent by the memory controller 111 can be as follows: Figure 4b shown.

[0161] Understandably, Figure 4b The relative timing positions between the intersections of write DQ0 to write DQ7 and write DQS of the memory controller 111 are shown. Without considering the transmission error of the memory bus 13, the relative timing positions between the intersections of write DQ0 to write DQ7 and write DQS received by the memory chip 12 can also be as follows: Figure 4b shown.

[0162] Since the memory controller 111 reduces the sending delay of the write DQS and keeps the sending delay of write DQ0 to write DQ7 unchanged, the time point at which the memory controller 111 sends the cross point of the write DQS corresponding to any write DQ cycle from write DQ0 to write DQ7 is advanced compared to the time point at which the memory controller 111 sends any write DQ cycle from write DQ0 to write DQ7. Figure 4b As the time shown increases, the crossing point of the write DQS will move in the opposite direction of the direction shown by the arrow.

[0163] like Figure 4b As shown, at this time, the setup time of writing DQ3 is too short, so that the memory chip 12 cannot correctly identify the level state of writing DQ3, and therefore the data carried by writing DQ3 cannot be correctly written into the memory chip 12. At this point, the memory controller 111 can stop reducing the sending delay of writing DQS. At this point, the current setup time of writing DQ3 is approximately equal to (slightly less than) the minimum setup time applicable to the memory chip 12.

[0164] Step 2: The memory controller 111 maintains the current write DQS transmission delay (assuming that the current write DQS transmission delay is D1), and the memory controller 111 gradually increases the transmission delays of write DQ0 to write DQ2, and write DQ4 to write DQ7, until the data carried by write DQ0 to write DQ7 cannot be correctly written into the memory chip 12. At this time, the relative timing position between any write DQ cycle and write DQS can be as follows: Figure 4c shown.

[0165] Specifically, in the above step 1, after the memory controller 111 adjusts the sending delay of the write DQS to the sending delay D1, some write DQs (such as Figure 4b The data carried by Write DQ0 to Write DQ2, and Write DQ4 to Write DQ7) can be correctly written into the memory chip 12.

[0166] In this case, the memory controller 111 can increase the sending delays of writing DQ0 to writing DQ2, and writing DQ4 to writing DQ7 in sequence. Taking writing DQ0 as an example, when the memory controller 111 keeps the sending delay of writing DQS unchanged, the memory controller 111 increases the sending delay of writing DQ0, so that compared with the time point of the cross point when the memory controller 111 sends writing DQS, the cycle time point when the memory controller 111 sends writing DQ0 corresponding to the cross point is delayed. In other words, based on Figure 4c In the direction of time increase shown in the figure, the memory controller 111 increases the sending delay of writing DQ0, so that a cycle of writing DQ0 can move along the direction shown by the arrow in the figure.

[0167] It can be seen from this that the memory controller 111 gradually increases the transmission delay of write DQ0 to write DQ7 until the data carried by write DQ0 to write DQ7 cannot be correctly written into the memory chip 12, which will make the setup time of write DQ0 to the setup time of write DQ7 equal and approach (slightly less than) the minimum setup time applicable to the memory chip 12.

[0168] The timing alignment between writing DQ0 to writing DQ7 is completed through step 2. It can also be understood that, through step 2, the phase synchronization between writing DQ0 to writing DQ7 can be maintained.

[0169] Step 3: The memory controller 111 maintains the transmission delay of writing DQ0 to writing DQ7 after step 2, and continues to increase the transmission delay of writing DQS. Figure 4d In the direction of time increase shown in FIG. 1 , the memory controller 111 increases the sending delay of the write DQS. Then, compared with the time point at which the memory controller 111 sends any DQ cycle from write DQ0 to write DQ7, the time point at which the memory controller 111 sends the cross point of the DQS corresponding to the DQ cycle will be delayed. In other words, relative to the timing position of the write DQ, the memory controller 111 increases the sending delay of the write DQS, which will cause the cross point of the write DQS to be closer to the write DQ0. Figure 4d Move in the direction indicated by the arrow.

[0170] The memory controller 111 gradually increases the sending delay of the write DQS until the data carried by at least one write DQ cannot be correctly written into the memory chip 12. At this time, the hold time of at least one write DQ is too short, approaching (slightly less than) the minimum hold time applicable to the memory chip 12.

[0171] For example, the relative timing positions between the intersections of write DQ0 to write DQ7 and write DQS can be as follows: Figure 4dAs shown. Generally speaking, write DQ0 to write DQ7 have the same write DQ cycle, and the phases of write DQ0 to write DQ7 are synchronized, so write DQ0 to write DQ7 can have the same hold time. That is to say, after adjusting the send delay of write DQS in step 3, the hold time of write DQ0 to write DQ7 is close to (slightly less than) the minimum hold time applicable to the memory chip 12.

[0172] Assumptions Figure 4c The sending delay of DQS is D1. Figure 4d If the sending delay of write DQS is D2, the memory controller 111 can reduce the sending delay of write DQS from D2 to (D1+D2) / 2 after step 3, so that the timing margin of write DQ0 to write DQ7 can reach the maximum value. At this point, the alignment of the relative timing positions between write DQ0 to write DQ7 and write DQS is completed.

[0173] 2. The relative timing positions between read DQ and read DQS are aligned.

[0174] Similar to write DQ and write DQS, read DQ and read DQS also need to be aligned. The specific implementation process can refer to the alignment of the relative timing position between write DQ and write DQS mentioned above. The difference is that in the specific implementation process of the relative timing position alignment between read DQ and read DQS, the memory chip 12 sends read DQ and read DQS to the memory controller 111, and the middle point of DQS triggers the memory controller 111 to identify the level state of read DQ, and the memory controller 111 adjusts the receiving delay of read DQ and read DQS to achieve the relative timing position alignment of read DQ and read DQS on the memory controller 111 side, which will not be described in detail.

[0175] From the above description of the current timing position alignment method, it can be seen that in the current timing position alignment method, not only the sending delay of writing DQS and the receiving delay of reading DQS need to be adjusted, but also the sending delay of writing DQ0 to writing DQ7 and the receiving delay of reading DQ0 to reading DQ7 need to be adjusted. In this implementation method, there are many adjustment steps, which makes this implementation method take a long time.

[0176] Furthermore, since the processor 11 cannot normally access the memory chip 12 when the memory controller 111 performs timing position alignment on the DQS and DQ transmitted in the same direction, the above memory training method can usually only be applied to the memory initialization during the startup process of the electronic device 10. If the memory retraining is performed during the operation of the electronic device 10, the processor 11 will be unable to access the memory chip 12 for a long time, causing the electronic device 10 to interrupt operation.

[0177] However, as the computing power of the processor 11 in the electronic device 10 increases, the operating frequencies of the processor core 112, the memory controller 111, and the memory chip 12 also gradually increase. The increase in the operating frequency of the memory controller 111 will shorten the cycle of the write DQ and write DQS sent by the memory controller 111 to the memory chip 12. In this case, even if the relative timing positions of the write DQ and write DQS are aligned, the timing margin of the memory chip 12 is small, which leads to an unstable bit error rate of data transmission from the memory controller 111 to the memory chip 12.

[0178] In addition, the working scenarios of the current electronic device 10 are becoming more and more complex, and more and more environmental factors may affect the timing margin of the memory controller 111 and the memory chip 12. For example, an artificial intelligence (AI) chip (one of the specific implementations of the processor 11) is often provided in an autonomous driving vehicle (one of the specific implementations of the electronic device 10), and the AI ​​chip can be a chip in the autonomous driving central control platform or a chip in the smart cockpit of the car.

[0179] The working environment of autonomous driving vehicles is complex and changeable. The temperature of the board carrying the AI ​​chip generally varies within a wide temperature range of -40 to 125°C. The large temperature variation range will have a greater impact on the timing margin of the memory controller 111 and the memory chip 12. For AI chips working at high frequencies and memory chips coupled with the AI ​​chips, there is a high possibility of insufficient timing margin.

[0180] In view of this, an embodiment of the present application provides a memory training method, which can quickly align the relative timing positions of DQS and DQ transmitted in the same direction between the memory controller 111 and the memory chip 12. Since the memory training method provided in the embodiment of the present application takes a short time, it can be repeatedly executed during the operation of the electronic device 10. Therefore, the memory training method provided in the embodiment of the present application can also be called a memory retraining method, which can enable the memory controller 111 and the memory chip 12 in the electronic device 10 to always maintain a relatively sufficient timing margin, thereby facilitating the improvement of the accuracy of data transmission between the memory controller 111 and the memory chip 12.

[0181] Exemplarily, during the operation of the electronic device 10, the processor core 112 may send a trigger instruction to the memory controller 111 to trigger the memory controller 111 to execute the memory training method provided in the embodiment of the present application. After executing the memory training method provided in the embodiment of the present application, the memory controller 111 may also feedback the execution result to the processor core 112, so that after the memory controller 111 completes the alignment of the relative timing position between the DQS and DQ transmitted in the same direction, the processor core 112 can continue to access the memory chip 12 through the memory controller 111.

[0182] In a possible implementation, the processor core 112 may periodically trigger the memory controller 111 to perform the memory training method provided in the embodiment of the present application according to a configured memory training cycle.

[0183] Specifically, the processor core 112 can send a trigger instruction to the memory controller 111 every other memory training cycle. Exemplarily, the timing starts after the memory initialization is completed during the startup process of the electronic device 10, and a trigger instruction is sent to the memory controller 111 after the timing duration reaches the memory training cycle. After the memory controller 111 receives the trigger instruction, it can start executing the memory training method provided in the embodiment of the present application. After the memory controller 111 completes the alignment of the relative timing position between the DQS and DQ transmitted in the same direction, the processor core 112 can set the above timing duration to zero and continue timing. After the timing duration reaches the above memory training cycle again, the processor core 112 can send a trigger instruction to the memory controller 111 again, so that the memory controller 111 can execute the memory training method provided in the embodiment of the present application again.

[0184] In another possible implementation, Figure 1 As shown, the electronic device 10 may also include a temperature sensor 14. Exemplarily, the temperature sensor 14 may be carried on the same printed circuit board (PCB) as the processor 11 and / or the memory chip 12. The processor core 112 may detect the ambient temperature through the temperature sensor 14. When it is determined that the difference between the current ambient temperature and the historical ambient temperature exceeds the temperature fluctuation threshold, the processor core 112 may send the above-mentioned trigger instruction to the memory controller 111, so that the memory controller 111 executes the memory training method provided in the embodiment of the present application. Among them, the above-mentioned historical ambient temperature can be understood as the ambient temperature when the processor core 112 sent the trigger instruction last time.

[0185] Specifically, assuming that the historical ambient temperature is 25°C and the temperature fluctuation threshold is ±20°C. Then, when the current ambient temperature is higher than 45°C or lower than 5°C, the processor core 112 will send the above trigger instruction to the memory controller 111. For example, the current ambient temperature is 47°C, and the difference between the current ambient temperature and the historical ambient temperature exceeds the temperature fluctuation threshold, so the processor core 112 can send a trigger instruction to the memory controller 111. And, after the memory controller 111 completes the alignment of the relative timing position between the DQS and DQ transmitted in the same direction, the processor core 112 can also update the historical ambient temperature to 47°C.

[0186] It is understandable that the relative timing position between DQS and DQ transmitted in the same direction may be offset due to changes in ambient temperature, which may lead to insufficient timing margin between the memory controller 111 and the memory chip 12. In the embodiment of the present application, the ambient temperature is used as a trigger condition for triggering the memory controller 111 to execute the memory training method, so that the memory controller 111 can timely calibrate the relative timing position between DQS and DQ transmitted in the same direction when the ambient temperature changes greatly, which is conducive to maintaining the memory controller 111 and the memory chip 12 with a relatively sufficient timing margin.

[0187] Exemplarily, in the above process, the memory controller 111 mainly performs the following steps: Figure 5 The workflow is shown in Figure 1. Figure 5 As shown, it mainly includes the following steps:

[0188] S501: Power on the memory controller 111. Generally speaking, after the electronic device 10 or the processor 11 is powered on, the memory controller 111 can be powered on.

[0189] S502: After the memory controller 111 is powered on, ZQ calibration is performed. The specific implementation of ZQ calibration can refer to the prior art, which will not be described in detail.

[0190] S503: The memory controller 111 receives the call from the processor core 112, thereby completing the memory training. In a possible implementation, the memory controller 111 may follow the conventional memory training method, such as Figures 4a to 4e Use the memory training method shown to complete memory training.

[0191] This is because the memory controller 111 performs memory training for the first time when executing S503. At this time, the relative timing position deviation between the DQ and DQS transmitted in the same direction is relatively large. The current conventional memory training method can accurately align the relative timing position between the DQ and DQS transmitted in the same direction. In this case, even if the relative timing position between the DQ and DQS transmitted in the same direction is offset subsequently, the offset degree will be small, which is conducive to shortening the time of subsequent memory training.

[0192] S504: After completing the memory training, the memory controller 111 can work normally. The memory controller 111 can access the memory chip 12 based on the call of the processor core 112. For example, the memory controller 111 can read data from the memory chip 12, write data to the memory chip 12, and so on.

[0193] S505: During normal operation, if the memory controller 111 receives a trigger instruction sent by the processor core 112, it continues to execute S506. If it does not receive a trigger instruction sent by the processor core 112, it continues to maintain normal operation.

[0194] S506: The memory controller 111 executes the memory training method provided in the embodiment of the present application.

[0195] Specifically, memory training includes relative timing position alignment between write DQ and write DQS (S5061) and relative timing position alignment between read DQ and read DQS (S5062). It should be understood that the embodiment of the present application does not strictly limit the order between S5061 and S5062. The memory controller 111 can either execute S5061 first and then execute S5062, or execute S5062 first and then execute S5061.

[0196] In the memory training method provided in the embodiment of the present application, the memory controller 111 can align the relative timing positions between write DQ and write DQS by adjusting the sending delay of write DQS or write DQ, and can align the relative timing positions between read DQ and read DQS by adjusting the receiving delay of read DQS or read DQ. Figures 4a to 4e In the memory training process shown, the embodiment of the present application can significantly reduce the steps of adjusting the transmission delay, thereby facilitating the alignment of the relative timing positions between DQS and DQ transmitted in the same direction in a short time.

[0197] Next, the memory training method provided by the embodiment of the present application is further illustrated by the following embodiments 1 to 4. It should be understood that the DQS of the same direction transmission corresponds to N DQs, where N is an integer greater than or equal to 1, and the DQS can trigger the receiving end to identify the level status of the N DQs. For example, based on Figure 1 In the memory bus 13 shown, the DQS transmitted in the same direction corresponds to 8 DQs (ie, DQ0 to DQ7). For ease of understanding, the present embodiment of the application is described below by taking the DQS and DQ0 to DQ7 transmitted in the same direction as an example.

[0198] Embodiment 1: adjusting the sending delay of the write DQS to align the relative timing position between the write DQ and the write DQS.

[0199] For example, Figure 6 As shown, the first embodiment mainly includes the following steps:

[0200] S601: When the memory controller 111 determines that all data carried by N write DQs are written correctly, the maximum DQS transmission delay and / or the minimum DQS transmission delay of the write DQS.

[0201] For example, it is assumed that N write DQs include write DQ0 to write DQ7, and the relative timing positions between write DQ0 to write DQ7 and write DQS are as follows: Figure 7 As shown. It can be understood that if the sending delay of write DQS is too large or too small, it may cause the data carried by write DQ0 to write DQ7 to be written incorrectly. Figure 7 In the figure, when all the data carried by DQ0 to DQ7 are written correctly, the intersection point of the write DQS when the transmission delay of the write DQS is the minimum DQS transmission delay can be represented by the intersection point 1a, and the straight line corresponding to the intersection point 1a represents the time point where the intersection point 1a is located. The intersection point of the write DQS when the transmission delay of the write DQS is the maximum DQS transmission delay can be represented by the intersection point 1b, and the straight line corresponding to the intersection point 1b represents the time point where the intersection point 1b is located. The straight lines corresponding to the intersection points (or midpoints) in the subsequent figures can all represent the time points where the intersection points (or midpoints) are located, which will not be repeated here.

[0202] If the write DQS transmission delay is less than the minimum DQS transmission delay, the setup time of one or more write DQs will be insufficient, resulting in data write errors. If the write DQS transmission delay is greater than the maximum DQS transmission delay, the hold time of one or more write DQs will be insufficient, resulting in data write errors.

[0203] S602: The memory controller 111 maintains the transmission delay of N write DQs, and adjusts the transmission delay of the write DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay, wherein the interval between the target DQS transmission delay and the maximum DQS transmission delay is not less than the target hold time H1 applicable to the memory chip 12, and the interval between the target DQS transmission delay and the minimum DQS transmission delay is not less than the target establishment time S1 applicable to the memory chip 12.

[0204] The target retention time H1 applicable to the memory chip 12 may be equal to the minimum retention time applicable to the memory chip 12, or may be greater than the minimum retention time applicable to the memory chip 12. The target setup time S1 applicable to the memory chip 12 may be equal to the minimum setup time applicable to the memory chip 12, or may be greater than the minimum setup time applicable to the memory chip 12. The specific implementation of the target retention time H1 and the target setup time S1 may be determined based on the performance requirements for data transmission between the memory controller 111 and the memory chip 12, and the embodiments of the present application do not impose any restrictions on this.

[0205] It should be noted that, since the memory controller 111 determines one or both of the maximum DQS transmission delay and the minimum DQS transmission delay of the write DQS in S601 , the target DQS transmission delay in S602 also needs to be explained on a case-by-case basis.

[0206] Case 1: The memory controller 111 determines the maximum DQS transmission delay of the write DQS, but does not determine the minimum DQS transmission delay of the write DQS. In this case, the target DQS transmission delay may be separated from the maximum DQS transmission delay by the target retention time H1 applicable to the memory chip 12.

[0207] Among them, since the embodiment of the present application can be memory training performed after memory initialization, that is, memory retraining, the offset between write DQs is often small, that is, the time interval between the above-mentioned maximum DQS transmission delay and the minimum DQS transmission delay is large, approaching the cycle length of the write DQ. In addition, since the cycle of the write DQ is often much longer than the target hold time H1 applicable to the memory chip 12, when the target DQS transmission delay and the maximum DQS transmission delay are separated by the target hold time H1 applicable to the memory chip 12, the interval between the target DQS transmission delay and the minimum DQS transmission delay is usually greater than the target establishment time S1 applicable to the memory chip 12.

[0208] Case 2: The memory controller 111 determines the minimum DQS transmission delay of the write DQS, but does not determine the maximum DQS transmission delay of the write DQS. In this case, the target DQS transmission delay may be separated from the minimum DQS transmission delay by the target setup time S1 applicable to the memory chip 12.

[0209] As mentioned above, the time interval between the maximum DQS transmission delay and the minimum DQS transmission delay is relatively large, approaching the cycle length of the write DQ. Since the write DQ cycle is often much longer than the target setup time S1 applicable to the memory chip 12, when the target DQS transmission delay and the minimum DQS transmission delay are separated by the target setup time S1 applicable to the memory chip 12, the interval between the target DQS transmission delay and the maximum DQS transmission delay is usually greater than the target hold time H1 applicable to the memory chip 12.

[0210] Case 3: The memory controller 111 determines the minimum DQS transmission delay and the maximum DQS transmission delay of the write DQS. In this case, the target DQS transmission delay can be separated from the maximum DQS transmission delay by the target hold time H1 applicable to the memory chip 12, or the target DQS transmission delay can be separated from the minimum DQS transmission delay by the target setup time S1 applicable to the memory chip 12, or the target DQS transmission delay can be located in the middle of the maximum DQS transmission delay and the minimum DQS transmission delay.

[0211] As mentioned above, the time interval between the maximum DQS transmission delay and the minimum DQS transmission delay is relatively large, approaching the cycle length of the write DQ. The target DQS transmission delay is located in the middle of the maximum DQS transmission delay and the minimum DQS transmission delay, so that the time interval between the target DQS transmission delay and the minimum DQS transmission delay can be greater than the target setup time S1 applicable to the memory chip 12, and the time interval between the target DQS transmission delay and the maximum DQS transmission delay can be greater than the target hold time H1 applicable to the memory chip 12.

[0212] Since the memory controller 111 in the embodiment of the present application can align the relative timing positions between write DQ0 to write DQ7 and write DQS by adjusting the sending delay of write DQS, compared with Figures 4a to 4e In the memory training process shown, the memory controller 111 in the embodiment of the present application does not need to adjust the sending delay from writing DQ0 to writing DQ7, which is beneficial to shorten the memory training time.

[0213] It should be pointed out that when the memory controller 111 executes S601, the memory controller 111 can respectively determine the maximum DQS transmission delay and the minimum DQS transmission delay of the write DQS. When the initial DQS transmission delay of the write DQS is greatly offset from the minimum DQS transmission delay, it means that under the initial DQS transmission delay, each write DQ has sufficient setup time, and at this time, only the maximum DQS transmission delay can be determined. Similarly, when the initial DQS transmission delay of the write DQS is greatly offset from the maximum DQS transmission delay, it means that each current write DQ has sufficient hold time, and at this time, only the minimum DQS transmission delay can be determined.

[0214] Among them, the initial DQS transmission delay of the write DQS can be understood as the transmission delay of the write DQS before the memory controller 111 starts to execute this memory training or when it starts to execute this memory training. It can also be understood as the transmission delay of the write DQS before the memory controller 111 receives the above trigger instruction. Exemplarily, the transmission delay of the write DQS is the initial DQS transmission delay, and the intersection of the write DQS can be as follows Figure 7 The intersection point 0 is shown in .

[0215] In a possible implementation, the memory controller 111 may gradually reduce the write DQS transmission delay from the initial DQS transmission delay until at least one write DQ carries a data write error, at which point the write DQS transmission delay may be used as the minimum DQS transmission delay.

[0216] The memory controller 111 may also gradually increase the write DQS transmission delay from the initial DQS transmission delay until at least one write DQ carries a data write error, at which point the write DQS transmission delay may be used as the maximum DQS transmission delay.

[0217] In another possible implementation, the memory controller 111 may also adopt the following method: Figure 8 The method shown determines the maximum DQS transmission delay and / or the minimum DQS transmission delay, and mainly includes the following steps:

[0218] S801: The memory controller 111 reduces the write DQS transmission delay based on the initial DQS transmission delay according to the target setup time S1 applicable to the memory chip 12. That is, the memory controller 111 can reduce the write DQS transmission delay from the initial DQS transmission delay to the first DQS transmission delay, and the first DQS transmission delay is separated from the initial DQS transmission delay by the target setup time applicable to the memory chip 12.

[0219] For example, Figure 9a As shown in FIG. 1 , when the transmission delay of the write DQS is equal to the initial DQS transmission delay, the cross point of the write DQS can be as follows: Figure 9a The memory controller 111 maintains the transmission delay of write DQ0 to write DQ7, so that the time for each write DQ cycle to be transmitted to the memory chip 12 remains stable. The memory controller 111 reduces the transmission delay of write DQS. Compared with the write DQ cycle corresponding to the cross point of write DQS, the time for the cross point of write DQS to be transmitted to the memory chip 12 is advanced, that is, Figure 9a As shown, the crossing point of the write DQS is along Figure 9a Move in the opposite direction of the arrow.

[0220] When the transmission delay of the write DQS is the first DQS transmission delay, the cross point of the write DQS can be as follows Figure 9a The time interval between the cross point 1 and the cross point 0 is the time interval between the first DQS transmission delay and the initial DQS transmission delay, that is, the target setup time S1 applicable to the memory chip 12.

[0221] S802: If there is a write error in the data carried by at least one write DQ, the memory controller 111 continues to execute S803. If all the data carried by write DQ0 to write DQ7 are written correctly, the memory controller 111 continues to execute S805.

[0222] It can be understood that if all the data carried by Write DQ0 to Write DQ7 are written correctly, it means that the time interval between the initial DQS transmission delay and the minimum DQS transmission delay is large, and under the initial DQS transmission delay, the setup time of Write DQ0 to Write DQ7 is sufficient and no calibration is required. Therefore, the memory controller 111 can continue to execute S805 without determining the minimum DQS transmission delay, increase the write DQS transmission delay, and determine the maximum DQS transmission delay of the write DQS.

[0223] If there is a data write error carried by at least one write DQ, it means that the setup time of at least one write DQ under the initial DQS transmission delay is insufficient to meet the transmission performance (stability) requirements, and calibration is required. For example, assuming that the transmission delay of the write DQS is the first DQS transmission delay, the cross point of the write DQS can be as follows Figure 9a The intersection point 1 is shown in the figure. Figure 9a It can be seen that the setup time for writing DQ3 and writing DQ6 is insufficient, and the data carried by writing DQ3 and writing DQ6 is written incorrectly at this time, and the memory controller 111 continues to execute S803.

[0224] S803: The memory controller 111 increases the write DQS transmission delay according to the first adjustment range. It should be noted that the first adjustment range is less than the target setup time S1 applicable to the memory chip 12. Generally speaking, the first adjustment range can be the minimum adjustment range that the memory controller 111 can adjust the write DQS transmission delay, and the minimum adjustment range can also be called a step.

[0225] S804: If there is a write error in the data carried by at least one write DQ, the memory controller 111 returns to continue executing S803.

[0226] The memory controller 111 executes S803 and S804 once or multiple times, gradually increasing the write DQS transmission delay until all the data carried by write DQ0 to write DQ7 are written correctly. At this time, the write DQS transmission delay can be used as the minimum DQS transmission delay, and the cross point of the write DQS can be as follows: Figure 7 The intersection point in 1a is shown.

[0227] It can be understood that even if the cross point of the write DQS is offset from the middle position of the corresponding write DQ cycle during the operation of the electronic device 10, the cross point of the write DQS will still be located in the middle position of the corresponding write DQ cycle. In this case, if the memory controller 111 gradually reduces the write DQS transmission delay from the initial DQS transmission delay, the memory controller 111 needs to adjust the write DQS transmission delay multiple times and verify whether the data carried by write DQ0 to write DQ7 is written correctly, in order to determine the minimum DQS transmission delay.

[0228] In S801 to S804 provided in the embodiment of the present application, since the target setup time S1 applicable to the memory chip 12 is often less than the duration of the half cycle of the write DQ, and the adjustment range from the first DQS transmission delay to the minimum DQS transmission delay does not exceed the target setup time S1 applicable to the memory chip 12, the number of executions of S803 is small, so that the minimum DQS transmission delay can be quickly determined.

[0229] S805: The memory controller 111 increases the write DQS transmission delay based on the initial DQS transmission delay according to the target hold time H1 applicable to the memory chip 12. That is, the memory controller 111 can increase the write DQS transmission delay from the initial DQS transmission delay to a second DQS transmission delay, and the second DQS transmission delay is separated from the initial DQS transmission delay by the target hold time H1 applicable to the memory chip 12.

[0230] For example, Figure 9b As shown in FIG. 1 , when the transmission delay of the write DQS is equal to the initial DQS transmission delay, the cross point of the write DQS can be as follows: Figure 9b The memory controller 111 maintains the transmission delay of write DQ0 to write DQ7, so that the time for each write DQ cycle to be transmitted to the memory chip 12 remains stable. The memory controller 111 increases the transmission delay of write DQS. Compared with the write DQ cycle corresponding to the cross point of write DQS, the time for the cross point of write DQS to be transmitted to the memory chip 12 is delayed, that is, Figure 9b As shown, the cross point of writing DQS is along Figure 9b Move in the direction indicated by the arrow.

[0231] When the write DQS transmission delay is the second DQS transmission delay, the cross point of the write DQS can be as follows Figure 9b The time interval between the intersection 2 and the intersection 0 is the time interval between the second DQS transmission delay and the initial DQS transmission delay, that is, the target holding time H1 applicable to the memory chip 12.

[0232] S806: If there is a write error in the data carried by at least one write DQ, the memory controller 111 continues to execute S807. If all the data carried by write DQ0 to write DQ7 are written correctly, the memory controller 111 continues to execute S808.

[0233] It can be understood that if all the data carried by Write DQ0 to Write DQ7 are written correctly, it means that the time interval between the initial DQS transmission delay and the maximum DQS transmission delay is large, and the hold time of Write DQ0 to Write DQ7 is sufficient, and no calibration is required. Therefore, the memory controller 111 does not need to confirm the maximum DQS transmission delay and can continue to execute S602.

[0234] In some scenarios, it may also happen that the data carried by Write DQ0 to Write DQ7 in S802 and S806 are all written correctly. That is to say, on the basis of the initial DQS transmission delay, after reducing the Write DQS transmission delay according to the target setup time S1 applicable to the memory chip 12, the data carried by Write DQ0 to Write DQ7 are all written correctly, that is, Write DQ0 to Write DQ7 have sufficient setup time under the initial DQS transmission delay. On the basis of the initial DQS transmission delay, after increasing the Write DQS transmission delay according to the target hold time H1 applicable to the memory chip 12, the data carried by Write DQ0 to Write DQ7 are all written correctly, that is, Write DQ0 to Write DQ7 have sufficient hold time under the initial DQS transmission delay. In this case, the memory controller 111 can directly use the initial DQS transmission delay as the target DQS transmission delay.

[0235] If there is a data write error carried by at least one write DQ, it means that the hold time of at least one write DQ is insufficient and calibration is required. At this time, the cross point of the write DQS can be as follows: Figure 9b As shown at the intersection 2 in FIG. Therefore, the memory controller 111 may continue to execute S807 .

[0236] S807: The memory controller 111 reduces the transmission delay of the write DQS according to the second adjustment range. It should be noted that the second adjustment range is less than the target retention time H1 applicable to the memory chip 12. Generally speaking, the second adjustment range can also be the minimum adjustment range that the memory controller 111 can adjust the transmission delay of the write DQS, that is, the range of 1 step.

[0237] S808: If there is a write error in the data carried by at least one write DQ, the memory controller 111 returns to continue executing S807.

[0238] The memory controller 111 executes S807 and S808 once or multiple times, gradually reducing the write DQS transmission delay until all the data carried by write DQ0 to write DQ7 are written correctly. At this time, the write DQS transmission delay can be used as the maximum DQS transmission delay, and the cross point of the write DQS can be as follows: Figure 7 The intersection point in 1b is shown.

[0239] The memory controller 111 performs the following steps: Figure 8 The method shown can determine the maximum DQS transmission delay and / or the minimum DQS transmission delay of the write DQS. Then, the memory controller 111 can continue to execute S602 based on the maximum DQS transmission delay and / or the minimum DQS transmission delay.

[0240] It can be understood that in the process of determining the maximum DQS transmission delay and / or the minimum DQS transmission delay of the write DQS, the memory controller 111 can also first increase the transmission delay of the write DQS according to the target hold time H1 applicable to the memory chip 12 on the basis of the initial DQS transmission delay to determine the maximum DQS transmission delay of the write DQS, and then reduce the transmission delay of the write DQS according to the target establishment time S1 applicable to the memory chip 12 on the basis of the initial DQS transmission delay to determine the minimum DQS transmission delay of the write DQS. The above process should also be included in the embodiments of the present application, and the specific implementation will not be repeated.

[0241] Embodiment 2: Adjusting the reception delay of the read DQS to align the relative timing position between the read DQ and the read DQS

[0242] Based on a technical concept similar to that of the first embodiment, the second embodiment provided in the embodiments of the present application can align the relative timing position between the read DQ and the read DQS.

[0243] Specifically, if Fig.10 As shown, the second embodiment mainly includes the following steps:

[0244] S1001: When the memory controller 111 determines that all data carried by N read DQs are read correctly, the maximum DQS receiving delay and / or the minimum DQS receiving delay of the read DQS.

[0245] This process is similar to S602, except that the memory chip 12 outputs N read DQs and read DQSs corresponding to the N read DQs, and the memory controller 111 receives the N read DQs and the read DQSs corresponding to the N read DQs. Usually, the middle point between the cross points in the read DQS is used as a trigger point to trigger the memory controller 111 to identify the level status of the N read DQs.

[0246] Specifically, in one possible implementation, the memory controller 111 can gradually reduce the reception delay of the read DQS from the initial DQS reception delay until a data read error carried by at least one read DQ occurs. At this time, the reception delay of the read DQS can be used as the minimum DQS reception delay. The memory controller 111 can also gradually increase the reception delay of the read DQS from the initial DQS reception delay until a data read error carried by at least one read DQ occurs. At this time, the reception delay of the read DQS can be used as the maximum DQS reception delay.

[0247] The initial DQS receiving delay of the read DQS can be understood as the receiving delay of the read DQS before the memory controller 111 starts to adjust the receiving delay of the read DQS, or can be understood as the receiving delay of the read DQS before the memory controller 111 receives the trigger instruction.

[0248] In another possible implementation, the memory controller 111 may also use Figure 8 A similar process determines the maximum DQS reception delay and the minimum DQS reception delay of the read DQS. Specifically, the memory controller 111 can determine the maximum DQS reception delay and / or the minimum DQS reception delay respectively:

[0249] 1. Determine the minimum DQS reception delay

[0250] Based on the initial DQS reception delay, the memory controller 111 reduces the read DQS reception delay according to the target setup time S2 applicable to the memory controller 111. That is, the memory controller 111 reduces the read DQS reception delay from the initial DQS reception delay to the first DQS reception delay, and the first DQS reception delay is separated from the initial DQS reception delay by the target setup time S2 applicable to the memory controller 111.

[0251] The target setup time S2 applicable to the memory controller 111 may be equal to or greater than the minimum setup time applicable to the memory controller 111. The specific implementation of the target setup time S2 may be determined based on the performance requirements for data transmission between the memory controller 111 and the memory chip 12, and the embodiments of the present application do not impose any restrictions on this.

[0252] For example, Fig.11a As shown in FIG. 1 , when the reception delay of the read DQS is equal to the initial DQS reception delay, the middle point of the read DQS can be as follows: Fig.11a The memory controller 111 maintains the reception delay of read DQ0 to read DQ7, shortens the reception delay of read DQS, and the memory controller 111 recognizes the time of the middle point of read DQS earlier than the cycle of read DQ corresponding to the middle point of read DQS, that is, Fig.11a As shown, the midpoint of the read DQS edge is Fig.11a Move in the opposite direction of the arrow.

[0253] When the reception delay of the read DQS is the first DQS reception delay, the middle point of the read DQS can be as follows Fig.11a The time interval between the middle point 1 and the middle point 0 is the time interval between the first DQS receiving delay and the initial DQS receiving delay, that is, the target establishment time S2 applicable to the memory controller 111.

[0254] Under the first DQS receiving delay, if the data carried by read DQ0 to read DQ7 are all read correctly, it means that the time interval between the initial receiving delay and the minimum receiving delay is large. Under the initial DQS receiving delay, the setup time between read DQ0 and read DQ7 is sufficient and no calibration is required. In this case, there is no need to determine the minimum DQS receiving delay, and the maximum DQS receiving delay can be determined. If there is a data reading error carried by at least one read DQ, it means that the setup time of at least one read DQ under the initial DQS receiving delay is not enough to meet the transmission performance (stability) requirements, and calibration is required. At this time, the middle point of the read DQS can be as follows Fig.11a shown.

[0255] Under the first DQS receiving delay, if there is a data read error carried by at least one read DQ, the memory controller 111 can gradually increase the receiving delay of the read DQS so that the middle point of the read DQS is along the Fig.11a Move in the direction indicated by the arrow until all the data carried by read DQ0 to read DQ7 are read correctly. At this time, the reception delay of read DQS is the minimum DQS reception delay. Under the minimum DQS reception delay, the cross point of read DQS can be as follows: Fig.11b shown.

[0256] It should be understood that the above process is only a brief description, and the specific implementation can refer to Figure 8 The process of the memory controller 111 determining the minimum DQS transmission delay of the write DQS shown in S801 to S804 is not described in detail.

[0257] 2. Determine the maximum DQS reception delay

[0258] Based on the initial DQS reception delay, the memory controller 111 increases the read DQS reception delay according to the target hold time H2 applicable to the memory controller 111. That is, the memory controller 111 increases the read DQS reception delay from the initial DQS reception delay to the second DQS reception delay, and the second DQS reception delay is separated from the initial DQS reception delay by the target hold time H2 applicable to the memory controller 111.

[0259] The target retention time H2 applicable to the memory controller 111 may be equal to or greater than the minimum retention time applicable to the memory controller 111. The specific implementation of the target retention time H2 may be determined based on the performance requirements for data transmission between the memory controller 111 and the memory chip 12, and the embodiments of the present application do not impose any restrictions on this.

[0260] For example, Fig.11c As shown in FIG. 1 , when the reception delay of the read DQS is equal to the initial DQS reception delay, the middle point of the read DQS can be as follows: Figure 9a The memory controller 111 maintains the reception delay of read DQ0 to read DQ7, increases the reception delay of read DQS, and compared with the cycle of read DQ corresponding to the middle point of read DQS, the time when the memory controller 111 recognizes the middle point of read DQS is delayed, that is, Fig.11c As shown, the midpoint of the read DQS edge Fig.11c Move in the direction indicated by the arrow.

[0261] When the reception delay of the read DQS is the second DQS reception delay, the middle point of the read DQS can be as follows Fig.11c The time interval between the middle point 2 and the middle point 0 is the time interval between the second DQS receiving delay and the initial DQS receiving delay, that is, the target holding time H2 applicable to the memory controller 111.

[0262] Under the second DQS receiving delay, if the data carried by reading DQ0 to reading DQ7 are all read correctly, it means that the time interval between the initial DQS receiving delay and the maximum DQS receiving delay is large, and the holding time between reading DQ0 and reading DQ7 is sufficient, and no calibration is required. In this case, there is no need to determine the maximum DQS receiving delay, and S1002 can be continued.

[0263] It can be understood that there may also be a situation where the time intervals between the initial DQS receiving delay and the maximum DQS receiving delay and the minimum DQS receiving delay are both large. That is to say, on the basis of the initial DQS receiving delay, after reducing the receiving delay of the read DQS according to the target setup time S2 applicable to the memory controller 111, the data carried by read DQ0 to read DQ7 are all read correctly, that is, read DQ0 to read DQ7 have sufficient setup time under the initial DQS receiving delay. On the basis of the initial DQS receiving delay, after increasing the receiving delay of the read DQS according to the target hold time H2 applicable to the memory controller 111, the data carried by read DQ0 to read DQ7 are all read correctly, that is, read DQ0 to read DQ7 have sufficient hold time under the initial DQS receiving delay. In this case, the memory controller 111 can directly use the initial DQS receiving delay as the target DQS receiving delay.

[0264] Under the second DQS receiving delay, if there is a data read error carried by at least one read DQ, it means that the holding time of at least one read DQ under the initial DQS receiving delay is insufficient to meet the transmission performance (stability) requirements, and calibration is required. At this time, the middle point of the read DQS can be as follows Fig.11c The middle point 2 in FIG.

[0265] If there is at least one read DQ data read error, the memory controller 111 can gradually reduce the reception delay of the read DQS so that the middle point of the read DQS is Fig.11c Move in the opposite direction of the arrow until all the data carried by read DQ0 to read DQ7 are read correctly. At this time, the reception delay of read DQS is the maximum DQS reception delay. Under the maximum DQS reception delay, the middle point of read DQS can be Fig.11d shown.

[0266] It should be understood that the above process is only a brief description, and the specific implementation can refer to Figure 8 The process of the memory controller 111 determining the maximum DQS transmission delay of the write DQS shown in S805 to S808 is not described in detail.

[0267] S1002: The memory controller 111 maintains the reception delay of N read DQs, and adjusts the reception delay of the read DQS to a target DQS reception delay between the maximum DQS reception delay and the minimum DQS reception delay, wherein the interval between the target DQS reception delay and the maximum DQS reception delay is not less than the target hold time H2 applicable to the memory controller 111, and the interval between the target DQS reception delay and the minimum DQS reception delay is not less than the target establishment time S2 applicable to the memory controller 111.

[0268] It should be noted that, since the memory controller 111 determines one or both of the maximum DQS reception delay and the minimum DQS reception delay in S1001 , the target DQS reception delay in S1002 also needs to be explained on a case-by-case basis.

[0269] Case 1: The memory controller 111 determines the maximum DQS reception delay but does not determine the minimum DQS reception delay. In this case, the target DQS reception delay may be separated from the maximum DQS reception delay by a target hold time H2 applicable to the memory controller 111.

[0270] Among them, since the embodiment of the present application can be memory training performed after memory initialization, the offset between read DQs is often small, that is, the time interval between the above-mentioned maximum DQS reception delay and the minimum DQS reception delay is large, approaching the cycle length of the read DQ. Since the cycle of the read DQ is often much longer than the target hold time H2 applicable to the memory controller 111, when the target DQS reception delay and the maximum DQS reception delay are separated by the target hold time H2 applicable to the memory controller 111, the interval between the target DQS reception delay and the minimum DQS reception delay is usually greater than the target setup time S2 applicable to the memory controller 111.

[0271] Case 2: The memory controller 111 determines the minimum DQS reception delay but does not determine the maximum DQS reception delay. In this case, the target DQS reception delay may be separated from the minimum DQS reception delay by a target setup time S2 applicable to the memory controller 111.

[0272] As mentioned above, the time interval between the maximum DQS receiving delay and the minimum DQS receiving delay is relatively large, approaching the cycle length of the DQ reading. Since the cycle of the DQ reading is often much longer than the target setup time S2 applicable to the memory controller 111, when the target DQS receiving delay and the minimum DQS receiving delay are separated by the target setup time applicable to the memory controller 111, the interval between the target DQS receiving delay and the maximum DQS receiving delay is usually greater than the target hold time H2 applicable to the memory controller 111.

[0273] Case 3: The memory controller 111 determines the minimum DQS reception delay and the maximum DQS reception delay. In this case, the target DQS reception delay may be separated from the maximum DQS reception delay by the target hold time H2 applicable to the memory controller 111, or the target DQS reception delay may be separated from the minimum DQS reception delay by the target setup time S2 applicable to the memory controller 111, or the target DQS reception delay may be located in the middle of the maximum DQS reception delay and the minimum DQS reception delay.

[0274] As mentioned above, the time interval between the maximum DQS reception delay and the minimum DQS reception delay is relatively large, approaching the cycle length of the DQ read. The target DQS reception delay is located in the middle of the maximum DQS reception delay and the minimum DQS reception delay, so that the time interval between the target DQS reception delay and the minimum DQS reception delay can be greater than the target setup time S2 applicable to the memory controller 111, and the time interval between the target DQS reception delay and the maximum DQS reception delay can be greater than the target hold time H2 applicable to the memory controller 111.

[0275] Since the memory controller 111 in the embodiment of the present application can align the relative timing positions between the read DQ0 to the read DQ7 and the read DQS by adjusting the receiving delay of the read DQS, compared with Figures 4a to 4e In the memory training process shown, in the embodiment of the present application, the memory controller 111 does not need to adjust the receiving delay from reading DQ0 to reading DQ7, which is beneficial to shorten the memory training time.

[0276] Embodiment 3: Adjusting the receiving delay of write DQ to align the relative timing position between write DQ and write DQS

[0277] In both the first and second embodiments above, memory training is achieved by adjusting the receiving delay or sending delay of DQS. It can be understood that since there is a corresponding timing position relationship between DQ and DQS, the relative timing position between DQ and DQS can also be aligned by adjusting the receiving delay or sending delay of DQ.

[0278] In the third embodiment, the memory controller 111 can maintain the transmission delay of the write DQS, and adjust the transmission delays of write DQ0 to write DQ7 respectively, so that the relative timing position of each write DQ is aligned with the write DQS. Exemplarily, for any write DQ, the third embodiment mainly includes the following: Fig.12 The following steps are shown:

[0279] S1201: The memory controller 111 determines a maximum DQ sending latency and / or a minimum DQ sending latency for a first write DQ when data carried by the first write DQ is written correctly.

[0280] Among them, the first write DQ can be any write DQ from DQ0 to DQ7. It can be understood that when the memory controller 111 keeps the sending delay of the write DQS unchanged, the time point when the intersection of the write DQS is transmitted to the memory chip 12 is stable. Relative to the time point when the memory controller 111 sends the intersection of the write DQS, increasing the sending delay of the first write DQ will delay the time point when the memory controller 111 sends the cycle of the first write DQ corresponding to the intersection of the write DQS, so that the establishment time of the first write DQ is shortened and the holding time is increased. Conversely, shortening the sending delay of the first write DQ will advance the time point when the memory controller 111 sends the cycle of the first write DQ corresponding to the intersection of the write DQS, so that the holding time of the first write DQ is shortened and the establishment time is increased.

[0281] In the third embodiment, Fig.13 As shown, when the transmission delay of the first write DQ is greater than the maximum DQ transmission delay, the memory chip 12 cannot correctly identify the level state of the first write DQ because the setup time of the first write DQ is too short, and the data carried by the first write DQ cannot be correctly written into the memory chip 12. When the transmission delay of the first write DQ is less than the minimum DQ transmission delay, the memory chip 12 cannot correctly identify the level state of the first write DQ because the hold time of the first write DQ is too short, and the data carried by the first write DQ cannot be correctly written into the memory chip 12.

[0282] S1202: The memory controller 111 maintains the sending delay of the write DQS, and adjusts the sending delay of the first write DQ to a target DQ sending delay between the maximum DQ sending delay and the minimum DQ sending delay, wherein the interval between the target DQ sending delay and the minimum DQ sending delay is not less than the target holding time H1 applicable to the memory chip 12, and the interval between the target DQ sending delay and the maximum DQ sending delay is not less than the target establishment time S1 applicable to the memory chip 12.

[0283] Among them, the target hold time H1 and the target setup time S1 applicable to the memory chip 12 can all refer to the above embodiment 1, which will not be described in detail. It should be pointed out that since the memory controller 111 will determine one or both of the maximum DQ transmission delay and the minimum DQ transmission delay of the first write DQ in S1201, the target DQ transmission delay in S1202 also needs to be explained in different situations.

[0284] Case 1: the memory controller 111 determines the maximum DQ transmission delay of the first write DQ, but does not determine the minimum DQ transmission delay of the first write DQ. In this case, the target DQ transmission delay may be separated from the maximum DQ transmission delay by the target setup time S1 applicable to the memory chip 12.

[0285] Among them, Fig.13As shown, since the time interval Δt between the maximum DQ sending delay and the minimum DQ sending delay approaches the cycle length of the first write DQ, and the cycle of the first write DQ is often much longer than the target setup time S1 applicable to the memory chip 12, when the target DQ sending delay and the maximum DQ sending delay are separated by the target setup time S1 applicable to the memory chip 12, the interval between the target DQ sending delay and the minimum DQ sending delay will usually be greater than the target hold time H1 applicable to the memory chip 12.

[0286] Case 2: the memory controller 111 determines the minimum DQ transmission delay of the first write DQ, but does not determine the maximum DQ transmission delay of the first write DQ. In this case, the target DQ transmission delay may be separated from the minimum DQ transmission delay by the target retention time H1 applicable to the memory chip 12.

[0287] As mentioned above, the time interval Δt between the maximum DQ sending delay and the minimum DQ sending delay is close to the cycle length of the first write DQ. Since the cycle of the first write DQ is often much longer than the target hold time H1 applicable to the memory chip 12, when the target DQ sending delay and the minimum DQ sending delay are separated by the target hold time H1 applicable to the memory chip 12, the interval between the target DQ sending delay and the maximum DQ sending delay will usually be longer than the target establishment time S1 applicable to the memory chip 12.

[0288] Case 3: The memory controller 111 determines the minimum DQ transmission delay and the maximum DQ transmission delay. In this case, the target DQ transmission delay may be separated from the maximum DQ transmission delay by the target setup time S1 applicable to the memory chip 12, or the target DQ transmission delay may be separated from the minimum DQ transmission delay by the target hold time H1 applicable to the memory chip 12, or the target DQ transmission delay may be located in the middle of the maximum DQ transmission delay and the minimum DQ transmission delay.

[0289] As mentioned above, the time interval Δt between the maximum DQ transmission delay and the minimum DQ transmission delay approaches the cycle length of the first write DQ. The target DQ transmission delay is located in the middle of the maximum DQ transmission delay and the minimum DQ transmission delay, so that the time interval between the target DQ transmission delay and the minimum DQ transmission delay can be greater than the target hold time H1 applicable to the memory chip 12, and the time interval between the target DQ transmission delay and the maximum DQ transmission delay can be greater than the target setup time H1 applicable to the memory chip 12.

[0290] In the third embodiment, the memory controller 111 can align the relative timing positions between the first write DQ and the write DQS by adjusting the transmission delay of the first write DQ. Fig.12The method shown adjusts the transmission delays of Write DQ0 to Write DQ7 in sequence, thereby aligning the relative timing positions between Write DQ0 to Write DQ7 and Write DQS, respectively.

[0291] In the third embodiment, the memory controller 111 only adjusts the transmission delay of one write DQ (the first write DQ) during each memory training process. Figures 4a to 4e In the memory training process shown, in the third embodiment, the memory controller 111 does not need to adjust the transmission delays of other write DQs and write DQSs, which is beneficial to shorten the memory training time.

[0292] It should be noted that, assuming the first write DQ is Figure 1 The write DQ0 transmitted by the data signal line L0 in the memory controller 111 is a write signal of the memory chip 12. Therefore, during the period when the memory controller 111 adjusts the sending delay of the write DQ0, the memory controller 111 can still access the memory chip 12 through the data signal line L1 to the data signal line L7. That is to say, while aligning the relative timing positions between the write DQ0 to the write DQ7 and the write DQS respectively, the embodiment 3 can also access the memory chip 12 in parallel, thereby further reducing the impact of the memory training on the continuous operation of the processor core 112.

[0293] It should be noted that when the memory controller 111 executes S1201, the memory controller 111 can respectively determine the maximum DQ transmission delay and the minimum DQ transmission delay of the first write DQ. When the initial DQ transmission delay of the first write DQ is greatly offset from the minimum DQ transmission delay, it means that under the initial DQ transmission delay, the first write DQ has sufficient hold time, and at this time, only the maximum DQ transmission delay can be determined. Similarly, when the initial DQ transmission delay of the first write DQ is greatly offset from the maximum DQ transmission delay, it means that under the initial DQ transmission delay, the first write DQ has sufficient setup time, and at this time, only the minimum DQ transmission delay can be determined.

[0294] The initial DQ transmission delay of the first write DQ can be understood as the transmission delay of the first write DQ before or when the memory controller 111 starts to perform memory training. It can also be understood as the transmission delay of the first write DQ before the memory controller 111 receives the above trigger instruction.

[0295] In a possible implementation, the memory controller 111 can start from the initial DQ transmission delay and gradually reduce the transmission delay of the first write DQ until the data carried by the first write DQ is written incorrectly. At this time, the transmission delay of the first write DQ can be used as the minimum DQ transmission delay. The memory controller 111 can also start from the initial DQ transmission delay and gradually increase the transmission delay of the first write DQ until the data carried by the first write DQ is written incorrectly. At this time, the transmission delay of the first write DQ can be used as the maximum DQ transmission delay.

[0296] In another possible implementation, the memory controller 111 may also adopt the following method: Fig.14 The method shown determines the maximum DQ transmission delay and / or the minimum DQ transmission delay, and mainly includes the following steps:

[0297] S1401: The memory controller 111 reduces the transmission delay of the first write DQ based on the initial DQ transmission delay according to the target retention time H1 applicable to the memory chip 12. That is, the memory controller 111 can reduce the transmission delay of the first write DQ from the initial DQ transmission delay to the first DQ transmission delay, and the first DQ transmission delay is separated from the initial DQ transmission delay by the target retention time applicable to the memory chip 12.

[0298] S1402: If the data carried by the first write DQ is written incorrectly, the memory controller 111 continues to execute S1403. If the data carried by the first write DQ is written correctly, the memory controller 111 continues to execute S1405.

[0299] It can be understood that if the data carried by the first write DQ is written correctly, it means that the time interval between the initial DQ transmission delay and the minimum DQ transmission delay is large, and under the initial DQ transmission delay, the holding time of the first write DQ is sufficient and no calibration is required. Therefore, the memory controller 111 can continue to execute S1405 without determining the minimum DQ transmission delay, and increase the transmission delay of the first write DQ to determine the maximum DQ transmission delay of the first write DQ.

[0300] If the data carried by the first write DQ is written incorrectly, it means that the hold time of the first write DQ under the initial DQ transmission delay is insufficient to meet the transmission performance (stability) requirements, and calibration is required. Fig.15 As shown, under the initial DQ sending delay, the cross point of the write DQS is located at a later position in the cycle of the first write DQ, that is, under the initial DQ sending delay, the holding time of the first write DQ is shorter.

[0301] Based on the initial DQ transmission delay, the memory controller 111 reduces the transmission delay of the first DQ from the initial DQ transmission delay to the first DQ transmission delay according to the target retention time H1 applicable to the memory chip 12. Since the memory controller 111 maintains the transmission delay of the write DQS, the time when the corresponding first write DQ cycle is transmitted to the memory chip 12 is advanced relative to the cross point of the write DQS, and the advance time amplitude is the target retention time H1 applicable to the memory chip 12.

[0302] Depend on Fig.15 It can be seen that the holding time of the first write DQ is insufficient under the first DQ sending delay, which leads to a write error of the data carried by the first write DQ.

[0303] S1403: The memory controller 111 increases the transmission delay of the first write DQ according to the third adjustment range. It should be noted that the third adjustment range is less than the target retention time H1 applicable to the memory chip 12. Generally speaking, the third adjustment range can be the minimum adjustment range that the memory controller 111 can adjust the transmission delay of the first write DQ.

[0304] S1404: If the data carried by the first write DQ is written incorrectly, the memory controller 111 returns to continue executing 1403.

[0305] The memory controller 111 executes S1403 and S1404 once or multiple times, gradually increasing the transmission delay of the first write DQ until the data carried by the first write DQ is written correctly. At this time, the transmission delay of the first write DQ can be used as the minimum DQ transmission delay, such as Fig.15 shown.

[0306] It can be understood that, during the operation of the electronic device 10, even if the cross point of the write DQS is offset from the middle position of the corresponding first write DQ cycle, the cross point of the write DQS will still be located in the middle position of the corresponding write DQ cycle. In this case, if the memory controller 111 gradually reduces the transmission delay of the first write DQ from the initial DQ time point, the memory controller 111 needs to adjust the transmission delay of the first write DQ multiple times and verify whether the data carried by the first write DQ is written correctly, in order to determine the minimum DQ transmission delay.

[0307] In S1401 to S1404 provided in the embodiment of the present application, since the target hold time H1 applicable to the memory chip 12 is often less than the half cycle of the first write DQ, and the adjustment range from the first DQ transmission delay to the minimum DQ transmission delay does not exceed the target hold time H1 applicable to the memory chip 12, the number of executions of S1403 is small, so that the minimum DQ transmission delay can be quickly determined.

[0308] S1405: The memory controller 111 increases the transmission delay of the first write DQ based on the initial DQ transmission delay according to the target setup time S1 applicable to the memory chip 12. Fig.16 As shown, the memory controller 111 can increase the transmission delay of the first write DQ from the initial DQ transmission delay to the second DQ transmission delay, and the second DQ transmission delay and the initial DQ transmission delay are separated by the target setup time S1 applicable to the memory chip 12.

[0309] Since the memory controller 111 maintains the sending delay of the write DQS and increases the sending delay of the first write DQ, the time for the corresponding first write DQ cycle to be transmitted to the memory chip 12 is delayed compared to the cross point of the write DQS, that is, the first write DQ cycle is delayed along the Fig.16 The moving distance is the target establishment time S1 applicable to the memory chip 12.

[0310] S1406: If the data carried by the first write DQ is written incorrectly, the memory controller 111 continues to execute S1407. If the data carried by the first write DQ is written correctly, the memory controller 111 continues to execute S1408.

[0311] It can be understood that if the data of the first write DQ is written correctly under the second DQ transmission delay, it means that the time interval between the initial DQ transmission delay and the maximum DQ transmission delay is large. Under the initial DQ transmission delay, the holding time of the first write DQ is sufficient and no calibration is required. Fig.16 As shown, under the initial DQ transmission delay, the cross point of the write DQS is located at a late position of the corresponding first write DQ cycle, that is, under the initial DQ transmission delay, the setup time of the first write DQ is longer.

[0312] When the memory controller 111 increases the transmission delay of the first write DQ to the second DQ transmission delay, the first write DQ still has a large setup time, and the data carried by the first write DQ can still be correctly written into the memory chip 12. Therefore, the memory controller 111 does not need to confirm the maximum DQ transmission delay and can continue to execute S1202.

[0313] In some scenarios, it is also possible that the data carried by the first write DQ in S1402 and S1406 are all written correctly. That is to say, on the basis of the initial DQ sending delay, after reducing the sending delay of the first write DQ according to the target hold time H1 applicable to the memory chip 12, the data carried by the first write DQ is written correctly, that is, the first write DQ has sufficient hold time under the initial DQ sending delay. On the basis of the initial DQ sending delay, after increasing the sending delay of the first write DQ according to the target setup time S1 applicable to the memory chip 12, the data carried by the first write DQ is also written correctly, that is, the first write DQ has sufficient setup time under the initial DQ sending delay. In this case, the memory controller 111 can directly use the initial DQ sending delay as the target DQ sending delay.

[0314] Under the second DQ transmission delay, if the data carried by the first write DQ is written incorrectly, it means that the setup time of the first write DQ is insufficient to maintain the transmission performance (stability) requirement, and calibration is required.

[0315] Generally speaking, the target setup time S1 and the target hold time H1 of the memory chip 12 are not greater than the duration of the half cycle of the first write DQ. In other words, if the memory controller 111 determines the minimum DQ transmission delay of the first write DQ, the memory controller 111 does not need to determine the maximum DQ transmission delay of the first write DQ. If the memory controller 111 determines the maximum DQ transmission delay of the first write DQ, the memory controller 111 does not need to determine the minimum DQ transmission delay of the first write DQ.

[0316] S1407: The memory controller 111 reduces the transmission delay of the first write DQ according to the fourth adjustment range. It should be noted that the fourth adjustment range is less than the target setup time applicable to the memory chip 12. Generally speaking, the fourth adjustment range can also be the minimum adjustment range that the memory controller 111 can adjust the transmission delay of the first write DQ.

[0317] S1408: If the data carried by the first write DQ is written incorrectly, the memory controller 111 returns to continue executing S1407.

[0318] The memory controller 111 executes S1407 and S1408 once or multiple times to gradually reduce the transmission delay of the first write DQ until the data carried by the first write DQ is written correctly. At this time, the transmission delay of the first write DQ can be used as the maximum DQ transmission delay.

[0319] The memory controller 111 performs the following steps: Fig.14 The method shown can determine the maximum DQ transmission latency and / or the minimum DQ transmission latency of the first write DQ. Then, the memory controller 111 can continue to execute S1202 based on the maximum DQ transmission latency and / or the minimum DQ transmission latency.

[0320] It can be understood that in the process of determining the maximum DQ transmission delay and / or the minimum DQ transmission delay of the first write DQ, the memory controller 111 can also first increase the transmission delay of the first write DQ according to the target setup time S1 applicable to the memory chip 12 on the basis of the initial DQ transmission delay to determine the maximum DQ transmission delay of the first write DQ, and then reduce the transmission delay of the first write DQ according to the target hold time H1 applicable to the memory chip 12 on the basis of the initial DQ transmission delay to determine the minimum DQ transmission delay of the first write DQ. The above process should also be included in the embodiments of the present application, and the specific implementation will not be repeated.

[0321] Embodiment 4: Adjusting the reception delay of the read DQ to align the relative timing position between the read DQ and the read DQS

[0322] Based on a technical concept similar to that of the third embodiment, the fourth embodiment provided in the embodiments of the present application can align the relative timing position between the read DQ and the read DQS.

[0323] Specifically, if Fig.17 As shown, the fourth embodiment mainly includes the following steps:

[0324] S1701: When the memory controller 111 determines that the data carried by the first read DQ is read correctly, the maximum DQ receiving latency and / or the minimum DQ receiving latency of the first read DQ.

[0325] This process is similar to S1202, except that the memory chip 12 outputs the first read DQ and the read DQS, and the memory controller 111 receives the first read DQ and the read DQS. Usually, the middle point between adjacent cross points in the read DQS is used as a trigger point to trigger the memory controller 111 to identify the level state of the first read DQ.

[0326] Specifically, in one possible implementation, the memory controller 111 can start from the initial DQ reception delay and gradually reduce the reception delay of the first read DQ until the data carried by the first read DQ is read incorrectly. At this time, the reception delay of the first read DQ can be used as the minimum DQ reception delay. The memory controller 111 can also start from the initial DQ reception delay and gradually increase the reception delay of the first read DQ until the data carried by the first read DQ is read incorrectly. At this time, the reception delay of the first read DQ can be used as the maximum DQ reception delay.

[0327] In another possible implementation, the memory controller 111 may also use Fig.14 A similar process determines the maximum DQ receiving delay and the minimum DQ receiving delay of the first read DQ. Specifically, the memory controller 111 can determine the maximum DQ receiving delay and / or the minimum DQ receiving delay respectively:

[0328] 1. Determine the minimum DQ reception delay

[0329] Based on the initial DQ receiving delay, the memory controller 111 reduces the receiving delay of the first read DQ according to the target retention time applicable to the memory controller 111. Fig.18 As shown, the memory controller 111 reduces the reception delay of the first read DQ from the initial DQ reception delay to the first DQ reception delay, and the first DQ reception delay and the initial DQ reception delay are separated by the target retention time H2 applicable to the memory controller 111.

[0330] The specific implementation of the target establishment time H2 applicable to the memory controller 111 may be as described in the above-mentioned embodiment 2, which will not be described in detail.

[0331] Under the first DQ receiving delay, if the data carried by the first read DQ is read correctly, it means that the time interval between the initial DQ receiving delay and the minimum DQ receiving delay is large. Under the initial DQ receiving delay, the setup time of the first read DQ is sufficient and no calibration is required. In this case, there is no need to determine the minimum DQ receiving delay, and the maximum DQ receiving delay can be determined. If the data carried by the first read DQ is read incorrectly, it means that the hold time of the first read DQ under the initial DQ receiving delay is not enough to meet the requirements for transmission performance (stability), and calibration is required, such as Fig.18 shown.

[0332] Under the first DQ receiving delay, if the data carried by the first read DQ is read incorrectly, the memory controller 111 can gradually increase the receiving delay of the first read DQ so that the first read DQ is closer to the middle point of the read DQS. Fig.18 Move in the direction indicated by the arrow until the data carried by the first read DQ is correctly read. At this time, the reception delay of the first read DQ is the minimum DQ reception delay, as shown in Fig.18 shown.

[0333] It should be understood that the above process is only a brief description, and the specific implementation can refer to Fig.14 The process of the memory controller 111 determining the minimum DQ sending delay of the first write DQ shown in S1401 to S1404 is not described in detail again.

[0334] 2. Determine the maximum DQ reception delay

[0335] Based on the initial DQ receiving delay, the memory controller 111 increases the receiving delay of the first read DQ according to the target setup time S2 applicable to the memory controller 111. Fig.19 As shown, the memory controller 111 increases the reception delay of the first read DQ from the initial DQ reception delay to the second DQ reception delay, and the interval between the second DQ reception delay and the initial DQ reception delay is the target setup time S2 applicable to the memory controller 111. The specific implementation of the target setup time S2 applicable to the memory controller 111 can refer to the above-mentioned embodiment 2, which will not be described in detail.

[0336] Under the second DQ receiving delay, if the data of the first read DQ is read correctly, such as Fig.19 As shown, it means that the time interval between the initial DQ receiving delay and the maximum DQ receiving delay is large. Under the initial DQ receiving delay, the setup time of the first read DQ is sufficient and no calibration is required. In this case, it is not necessary to determine the maximum DQ receiving delay and S1702 can be continued.

[0337] It can be understood that there may also be a situation where the time intervals between the initial DQ reception delay and the maximum DQ reception delay and the minimum DQ reception delay are both large. That is to say, on the basis of the initial DQ reception delay, after increasing the reception delay of the first read DQ according to the target setup time S2 applicable to the memory controller 111, the data carried by the first read DQ is read correctly, that is, the first read DQ has sufficient setup time under the initial DQ reception delay. On the basis of the initial DQ reception delay, after reducing the reception delay of the first read DQ according to the target hold time H2 applicable to the memory controller 111, the data carried by the first read DQ is also read correctly, that is, the first read DQ has sufficient hold time under the initial DQ reception delay. In this case, the memory controller 111 can directly use the initial DQ reception delay as the target DQ reception delay.

[0338] Under the second DQ receiving delay, if the data carried by the first read DQ is read incorrectly, it means that under the initial DQ receiving delay, the setup time of the first read DQ is insufficient to maintain the transmission performance (stability), and calibration is required. The memory controller 111 can start from the second DQ receiving delay and gradually reduce the receiving delay of the first read DQ until the data carried by the first read DQ is correctly read. At this time, the receiving delay of the first read DQ is the maximum DQ receiving delay.

[0339] It should be understood that the above process is only a brief description, and the specific implementation can refer to Figure 8 The process of the memory controller 111 determining the maximum DQ sending delay of the first write DQ shown in S1405 to S1408 is not described in detail again.

[0340] Generally speaking, the target setup time S2 and the target hold time H2 of the memory controller 111 are not greater than the duration of the half cycle of the first read DQ. In other words, if the memory controller 111 determines the minimum DQ receiving delay of the first read DQ, the memory controller 111 does not need to determine the maximum DQ receiving delay of the first read DQ. If the memory controller 111 determines the maximum DQ receiving delay of the first read DQ, the memory controller 111 does not need to determine the minimum DQ receiving delay of the first read DQ.

[0341] S1702: The memory controller 111 maintains the reception delay of the read DQS, and adjusts the reception delay of the first read DQ to a target DQ reception delay between the maximum DQ reception delay and the minimum DQ reception delay, wherein the interval between the target DQ reception delay and the maximum DQ reception delay is not less than the target setup time applicable to the memory controller 111, and the interval between the target DQ reception delay and the minimum reception delay is not less than the target hold time applicable to the memory controller 111.

[0342] It should be noted that, since the memory controller 111 determines one or both of the maximum DQ reception delay and the minimum DQ reception delay in S1701 , the target DQ reception delay in S1702 also needs to be explained on a case-by-case basis.

[0343] Case 1: The memory controller 111 determines the maximum DQ receive delay, but does not determine the minimum DQ receive delay. In this case, the target DQ receive delay can be separated from the maximum DQ receive delay by the target setup time S2 applicable to the memory controller 111. Among them, since the time interval between the above-mentioned maximum DQ receive delay and the minimum DQ receive delay is large, it is close to the cycle length of the first read DQ. And since the cycle of the first read DQ is often much longer than the target setup time S2 applicable to the memory controller 111, when the target DQ receive delay and the maximum DQ receive delay are separated by the target setup time applicable to the memory controller 111, the interval between the target DQ receive delay and the minimum DQ receive delay will usually be greater than the target hold time H2 applicable to the memory controller 111.

[0344] Case 2: The memory controller 111 determines the minimum DQ receive delay, but does not determine the maximum DQ receive delay. In this case, the target DQ receive delay can be separated from the minimum DQ receive delay by the target hold time H2 applicable to the memory controller 111. As mentioned above, the time interval between the maximum DQ receive delay and the minimum DQ receive delay is large, approaching the cycle length of the first read DQ. And because the cycle of the first read DQ is often much longer than the target hold time H2 applicable to the memory controller 111, when the target DQ receive delay and the minimum DQ receive delay are separated by the target hold time H2 applicable to the memory controller 111, the interval between the target DQ receive delay and the maximum DQ receive delay will usually be greater than the target establishment time S2 applicable to the memory controller 111.

[0345] Case 3: The memory controller 111 determines the minimum DQ reception delay and the maximum DQ reception delay. In this case, the target DQ reception delay may be separated from the maximum DQ reception delay by the target setup time S2 applicable to the memory controller 111, or the target DQ reception delay may be separated from the minimum DQ reception delay by the target hold time H2 applicable to the memory controller 111, or the target DQ reception delay may be located in the middle of the maximum DQ reception delay and the minimum DQ reception delay.

[0346] As mentioned above, the time interval between the maximum DQ receiving delay and the minimum DQ receiving delay is relatively large, and is close to the cycle length of the DQ read. The target DQ receiving delay is located in the middle of the maximum DQ receiving delay and the minimum DQ receiving delay, so that the time interval between the target DQ receiving delay and the minimum DQ receiving delay can be greater than the target hold time H2 applicable to the memory controller 111, and the time interval between the target DQ receiving delay and the maximum DQ receiving delay can be greater than the target setup time H2 applicable to the memory controller 111.

[0347] In the fourth embodiment, the memory controller 111 adjusts the reception delay of only one read DQ (the first read DQ) during each memory training process. Figures 4a to 4e In the memory training process shown, in the fourth embodiment, the memory controller 111 does not need to adjust the receiving delays of other read DQs and read DQSs, which is beneficial to shorten the memory training time.

[0348] It should be noted that, assuming the first read DQ is Figure 1 The read DQ0 transmitted by the data signal line L0 in the memory controller 111 is read. Then, during the period when the memory controller 111 adjusts the reception delay of the write DQ0, the memory controller 111 can still access the memory chip 12 through the data signal line L1 to the data signal line L7. That is to say, while aligning the relative timing positions between the read DQ0 to the read DQ7 and the read DQS respectively, the fourth embodiment can also access the memory chip 12 in parallel, thereby further reducing the impact of memory training on the continuous operation of the processor core 112.

[0349] It should be noted that in the third and fourth embodiments, the memory controller 111 can align the relative timing position between the write DQ and the write DQS on only one data transmission line, and the relative timing position between the read DQ and the read DQS on the data transmission line, for each memory training. The memory controller 111 adopts a round-robin rule to sequentially complete the alignment between write DQ0 to write DQ7 and write DQS, and the alignment between read DQ0 to read DQ7 and read DQS. Exemplarily, the round-robin rule adopted by the memory controller 111 can be as follows: Fig. 20 As shown, it mainly includes the following steps:

[0350] S2001: The memory controller 111 receives a trigger instruction.

[0351] S2002: The memory controller 111 determines that the sending delay of write DQ0 and the receiving delay of read DQ0 need to be adjusted according to the round-robin rule. The memory controller 111 further adjusts the sending delay of write DQ0 to align the relative timing positions between write DQ0 and write DQS. Also, the memory controller 111 adjusts the receiving delay of read DQ0 to align the relative timing positions between read DQ0 and read DQS.

[0352] S2003: The memory controller 111 completes memory training.

[0353] S2004: The memory controller 111 receives a trigger instruction.

[0354] S2005: The memory controller 111 determines that the sending delay of write DQ1 and the receiving delay of read DQ1 need to be adjusted according to the round-robin rule. The memory controller 111 further adjusts the sending delay of write DQ1 to align the relative timing positions between write DQ1 and write DQS. Also, the memory controller 111 adjusts the receiving delay of read DQ1 to align the relative timing positions between read DQ1 and read DQS.

[0355] S2006: The memory controller 111 completes memory training.

[0356] By analogy, the memory controller 111 adjusts the sending delay from write DQ2 to write DQ7 and the receiving delay from read DQ2 to read DQ7 in sequence according to the above rules.

[0357] S2007: The memory controller 111 receives a trigger instruction.

[0358] S2008: The memory controller 111 determines that the sending delay of write DQ7 and the receiving delay of read DQ7 need to be adjusted according to the round-robin rule. The memory controller 111 further adjusts the sending delay of write DQ7 to align the relative timing positions between write DQ7 and write DQS. In addition, the memory controller 111 adjusts the receiving delay of read DQ7 to align the relative timing positions between read DQ7 and read DQS.

[0359] S2009: The memory controller 111 completes memory training.

[0360] The next time a trigger instruction is received (i.e. Fig. 20 As shown, after returning from S2009 to S2001), the memory controller 111 will determine according to the round-robin rule that the send delay of write DQ0 and the receive delay of read DQ0 need to be adjusted next, and then adjust the send delay of write DQ0 to align the relative timing position between write DQ0 and write DQS, and the memory controller 111 adjusts the receive delay of read DQ0 to align the relative timing position between read DQ0 and read DQS (S2002).

[0361] The memory training method provided by the present application is introduced above from the perspective of a method embodiment. It is understandable that in order to implement the above functions, the memory controller may include hardware circuits and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the steps of the various examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0362] Exemplarily, an embodiment of the present application provides a memory controller, which can implement the memory training method provided in any of the above embodiments. Fig.21 As shown, the memory controller 2100 mainly includes a delay circuit 2101 and a control circuit 2102. The memory controller 2100 can be used as Figure 1 A memory controller 111 is shown.

[0363] In a possible implementation, the delay circuit 2101 may generate a transmission delay of the DQS under the control of the control circuit 2102. The delay circuit 2101 adjusts the transmission delay of the DQS and may adjust the phase of the DQS.

[0364] For example, the delay circuit 2101 may include a register and a phase adjuster, the phase adjuster may generate a transmission delay of DQS, and the register may serve as a control interface for the control circuit 2102 to control the delay circuit 2101, so that the control circuit 2102 may control the delay circuit 2101 through the register to adjust the transmission delay of DQS.

[0365] The control circuit 2102 may be a logic circuit with certain logic operation capabilities, which may control the delay circuit 2101 to adjust the transmission delay of DQS, thereby enabling the memory controller 2100 to execute the method for performing memory training by adjusting the transmission delay of DQS in the embodiment of the present application.

[0366] In a specific example, the control circuit 2102 can control the delay circuit 2101 to keep the transmission delay of N DQs unchanged, and control the delay circuit 2101 to adjust the transmission delay of DQS, so as to determine the maximum DQS transmission delay and / or minimum DQS transmission delay of DQS when all the data carried by N DQs are transmitted correctly. Wherein, the above-mentioned N DQs and DQSs are transmitted from the memory controller 2100 to the memory chip, or are transmitted from the memory chip to the memory controller 2100, and DQS can trigger the receiving end of the N DQs to identify the level state of the N DQs. When the N DQs and DQSs are transmitted from the memory controller 2100 to the memory chip, the receiving end of the N DQs is the memory chip, and when the N DQs and DQSs are transmitted from the memory chip to the memory controller 2100, the receiving end of the N DQs is the memory controller 2100. The control circuit 2102 controls the delay circuit 2101 to adjust the transmission delay of DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay, wherein the interval between the target DQS transmission delay and the maximum DQS transmission delay is not less than the target hold time applicable to the receiving end, and / or the interval between the target DQS transmission delay and the minimum DQS transmission delay is not less than the target setup time applicable to the receiving end.

[0367] Specifically, N DQs and DQSs may be transmitted to the memory chip by the memory controller 2100, and the transmission delay of the DQS is the transmission delay of the DQS. In this case, the control circuit 2102 may control the delay circuit 2101 to adjust the transmission delay of the DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay.

[0368] N DQs and DQSs may also be transmitted from the memory chip to the memory controller 2100, and the transmission delay of DQS is the reception delay of DQS. In this case, the control circuit 2102 may control the delay circuit 2101 to adjust the reception delay of DQS to a target DQS reception delay between the maximum DQS reception delay and the minimum DQS reception delay.

[0369] Next, the method for the control circuit 2102 to determine the minimum DQS transmission delay is further described:

[0370] In a possible implementation, the control circuit 2102 can control the delay circuit 2101 to gradually reduce the DQS transmission delay starting from the initial DQS transmission delay until at least one DQ-borne data transmission error occurs. At this point, the DQS transmission delay can be used as the minimum DQS transmission delay.

[0371] In another possible implementation, the control circuit 2102 may control the delay circuit 2101 to reduce the transmission delay of DQS to a first DQS transmission delay, where the first DQS transmission delay is separated from the transmission delay of DQS before reduction by a target setup time applicable to the receiving end; when there is a data transmission error carried by at least one DQ, the control circuit 2102 controls the delay circuit 2101 to gradually increase the transmission delay of DQS until all the data carried by N DQs are transmitted correctly, and the corresponding DQS transmission delay is determined to be the minimum DQS transmission delay of DQS.

[0372] The DQS transmission delay before reduction may be an initial DQS transmission delay, for example, it may be a DQS transmission delay before the control circuit 2102 starts to execute the current memory training or when the control circuit 2102 starts to execute the current memory training.

[0373] Exemplarily, the control circuit 2102 controls the delay circuit 2101 to gradually increase the transmission delay of DQS, and can control the delay circuit 2101 to gradually increase the transmission delay of DQS by increasing the first DQS adjustment amplitude each time. The first DQS adjustment amplitude is less than the target setup time applicable to the receiving end. For example, the first DQS adjustment amplitude can be the minimum adjustment amplitude of the transmission delay of DQS by the delay circuit 2101.

[0374] Next, the method for the control circuit 2102 to determine the maximum DQS transmission delay is further described:

[0375] In a possible implementation, the control circuit 2102 can control the delay circuit 2101 to gradually increase the DQS transmission delay starting from the initial DQS transmission delay until at least one DQ-borne data transmission error occurs. At this time, the DQS transmission delay can be used as the maximum DQS transmission delay.

[0376] In another possible implementation, the control circuit 2102 may control the delay circuit 2101 to increase the transmission delay of DQS to a second DQS transmission delay, where the second DQS transmission delay is separated from the transmission delay of DQS before the increase by a target hold time applicable to the receiving end; when there is a data transmission error carried by at least one DQ, the control circuit 2102 controls the delay circuit 2101 to gradually reduce the transmission delay of DQS until all the data carried by N DQs are transmitted correctly, and the corresponding DQS transmission delay is determined to be the maximum DQS transmission delay of DQS.

[0377] The DQS transmission delay before the increase may be an initial DQS transmission delay, for example, it may be a DQS transmission delay before the control circuit 2102 starts to execute the current memory training or when the control circuit 2102 starts to execute the current memory training.

[0378] Exemplarily, the control circuit 2102 controls the delay circuit 2101 to gradually reduce the transmission delay of DQS, and can control the delay circuit 2101 to gradually reduce the transmission delay of DQS by reducing the second DQS adjustment amplitude each time. The second DQS adjustment amplitude is less than the target hold time applicable to the receiving end. For example, the second DQS adjustment amplitude can be the minimum adjustment amplitude of the delay circuit 2101 for the transmission delay of DQS.

[0379] In another possible implementation, the delay circuit 2101 may generate a transmission delay of the first DQ under the control of the control circuit 2102. The delay circuit 2101 adjusts the transmission delay of the first DQ and may adjust the phase of the first DQ.

[0380] For example, the delay circuit 2101 may include a register and a phase adjuster, the phase adjuster may generate a transmission delay of the first DQ, and the register may serve as a control interface for the control circuit 2102 to control the delay circuit 2101, so that the control circuit 2102 may control the delay circuit 2101 through the register to adjust the transmission delay of the first DQ.

[0381] The control circuit 2102 may be a logic circuit with certain logic operation capabilities, which may control the delay circuit 2101 to adjust the transmission delay of the first DQ, thereby enabling the memory controller 2100 to execute the method for performing memory training by adjusting the transmission delay of the first DQ in the embodiment of the present application.

[0382] In a specific example, the control circuit 2102 can control the delay circuit 2101 to keep the transmission delay of DQS unchanged, and control the delay circuit 2101 to adjust the transmission delay of the first DQ, thereby determining the maximum DQ transmission delay and / or minimum DQ transmission delay of the first DQ when the data carried by the first DQ is transmitted correctly. Wherein, the above-mentioned DQS and the first DQ are both transmitted from the memory controller 2100 to the memory chip, or are both transmitted from the memory chip to the memory controller 2100, and the DQS can trigger the receiving end of the first DQ to identify the level state of the first DQ, wherein when the first DQ and DQS are transmitted from the memory controller 2100 to the memory chip, the receiving end of the first DQ is the memory chip, and when the first DQ and DQS are transmitted from the memory chip to the memory controller 2100, the receiving end of the first DQ is the memory controller 2100; the control circuit 2102 controls the delay circuit 2101 to adjust the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay, and the interval between the target DQ transmission delay and the maximum DQ transmission delay is not less than the target setup time applicable to the receiving end, and / or the interval between the target DQ transmission delay and the minimum DQ transmission delay is not less than the target hold time applicable to the receiving end.

[0383] The DQS may correspond to N DQs, and the first DQ is located within the N DQs. Before controlling the delay circuit 2101 to keep the transmission delay of the DQS unchanged and controlling the delay circuit 2101 to adjust the transmission delay of the first DQ, the control circuit 2102 may also first determine, according to the round-robin rule, that the next DQ of the DQ that completed the memory training the previous time among the N DQs is the first DQ.

[0384] Specifically, the first DQ and DQS may both be transmitted to the memory chip by the memory controller 2100, and the transmission delay of the first DQ is the transmission delay of the first DQ. In this case, the control circuit 2102 may control the delay circuit 2101 to adjust the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay.

[0385] The first DQ and DQS may also be transmitted from the memory chip to the memory controller 2100, and the transmission delay of the first DQ is the reception delay of the first DQ. In this case, the control circuit 2102 may control the delay circuit 2101 to adjust the reception delay of the first DQ to a target DQ reception delay between the maximum DQ reception delay and the minimum DQ reception delay.

[0386] Next, the method for the control circuit 2102 to determine the minimum DQ transmission delay is further described:

[0387] In a possible implementation, the control circuit 2102 can control the delay circuit 2101 to gradually reduce the transmission delay of the first DQ from the initial DQ transmission delay until the data transmission error carried by the first DQ is reached. At this time, the transmission delay of the first DQ can be used as the minimum DQ transmission delay.

[0388] In another possible implementation, the control circuit 2102 may control the delay circuit 2101 to reduce the transmission delay of the first DQ to the first DQ transmission delay, and the first DQ transmission delay is separated from the transmission delay of the first DQ before reduction by a target hold time applicable to the receiving end; when the data transmission carried by the first DQ is erroneous, the control circuit 2102 may control the delay circuit 2101 to gradually increase the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and the corresponding first DQ transmission delay is determined to be the minimum DQ transmission delay.

[0389] The transmission delay of the first DQ before reduction may be the initial DQ transmission delay, for example, the transmission delay of the first DQ before or when the control circuit 2102 starts to execute the current memory training.

[0390] Exemplarily, the control circuit 2102 can control the delay circuit 2101 to gradually increase the transmission delay of the first DQ by increasing the adjustment amplitude of the first DQ each time when gradually increasing the transmission delay of the first DQ. The adjustment amplitude of the first DQ is less than the target hold time applicable to the receiving end. Exemplarily, the adjustment amplitude of the first DQ is the minimum adjustment amplitude of the delay circuit 2101 for the transmission delay of the first DQ.

[0391] Next, the method for the control circuit 2102 to determine the maximum DQ transmission delay is further described:

[0392] In a possible implementation, the control circuit 2102 can control the delay circuit 2101 to gradually increase the transmission delay of the first DQ from the initial DQ transmission delay until the data transmission error carried by the first DQ occurs. At this time, the transmission delay of the first DQ can be used as the maximum DQ transmission delay.

[0393] In another possible implementation, the control circuit 2102 can control the delay circuit 2101 to increase the transmission delay of the first DQ to the second DQ transmission delay, and the interval between the second DQ transmission delay and the transmission delay of the first DQ before the increase is the target establishment time applicable to the receiving end; when the data transmission carried by the first DQ is erroneous, the control circuit 2102 can control the delay circuit 2101 to gradually shorten the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and determine that the corresponding first DQ transmission delay is the maximum DQ transmission delay.

[0394] The transmission delay of the first DQ before the increase may be the initial DQ transmission delay, for example, the transmission delay of the first DQ before the control circuit 2102 starts to execute the current memory training or when the control circuit 2102 starts to execute the current memory training.

[0395] Exemplarily, the control circuit 2102 may control the delay circuit 2101 to gradually reduce the transmission delay of the first DQ by reducing the second DQ adjustment amplitude each time. The second DQ adjustment amplitude is less than the target setup time applicable to the receiving end. For example, the second DQ adjustment amplitude may be the minimum adjustment amplitude of the delay circuit 2101 for the transmission delay of the first DQ.

[0396] Based on the same technical concept, the embodiment of the present application also provides a processor, which can be Figure 1 The processor 11 shown in FIG. illustratively, the processor 11 includes a processor core 112 and a memory controller 111. The specific implementation of the processor core 112 and the memory controller 111 can refer to the above embodiment, which will not be described in detail.

[0397] Based on the same technical concept, the embodiment of the present application also provides an electronic device, which can be as follows Figure 1 The electronic device 10 shown includes a processor 11 and a memory chip 12, and the memory chip 12 is connected to a memory controller 111 in the processor 11. The specific implementation of the electronic device can refer to the above embodiment, which will not be described in detail.

[0398] Based on the same technical concept, the embodiment of the present application also provides an electronic device, such as Fig. 22 As shown, the electronic device 2200 mainly includes a processor 11, a memory chip 12 and a memory controller 111. The memory controller 111 can be a memory controller provided by any of the above embodiments. The memory controller 111 is connected to the processor 11 and the memory chip 12 respectively;

[0399] The processor 11 may send a trigger instruction to the memory controller 111 ; the memory controller 111 may execute the memory training method provided in the embodiment of the present application after receiving the trigger instruction.

[0400] For example, the processor 11 may send a trigger instruction to the memory controller 111 when determining that the difference between the current ambient temperature and the historical ambient temperature exceeds the temperature fluctuation threshold, wherein the historical ambient temperature is the ambient temperature when the processor sent the trigger instruction last time.

[0401] For another example, the processor may send a trigger instruction to the memory controller 111 when determining that the time interval between the current time point and the time point at which the trigger instruction was last sent exceeds a time threshold.

[0402] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0403] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0404] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0405] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0406] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A memory training method, characterized in that: Applied to a memory controller, the method comprises: The memory controller keeps the transmission delay of the N DQs unchanged, and adjusts the transmission delay of the DQS, determines the maximum DQS transmission delay and / or the minimum DQS transmission delay of the DQS when all the data carried by the N DQs are transmitted correctly, the N DQs and the DQS are transmitted from the memory controller to the memory chip, or are transmitted from the memory chip to the memory controller, the DQS is used to trigger the receiving end of the N DQs to identify the level state of the N DQs, when the N DQs and the DQS are transmitted from the memory controller to the memory chip, the receiving end of the N DQs is the memory chip, and when the N DQs and the DQS are transmitted from the memory chip to the memory controller, the receiving end of the N DQs is the memory controller; The memory controller adjusts the transmission delay of the DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay, wherein the interval between the target DQS transmission delay and the maximum DQS transmission delay is not less than a target hold time applicable to the receiving end, and / or the interval between the target DQS transmission delay and the minimum DQS transmission delay is not less than a target setup time applicable to the receiving end.

2. The memory training method according to claim 1, characterized in that: When the N DQs and the DQS are transmitted from the memory controller to the memory chip, the transmission delay of the DQS is the transmission delay of the DQS, and the memory controller adjusts the transmission delay of the DQS to a target DQS transmission delay between a maximum DQS transmission delay and a minimum DQS transmission delay.

3. The memory training method according to claim 1, characterized in that: When the N DQs and the DQS are transmitted from the memory chip to the memory controller, the transmission delay of the DQS is the reception delay of the DQS, and the memory controller adjusts the reception delay of the DQS to a target DQS reception delay between the maximum DQS reception delay and the minimum DQS reception delay.

4. The memory training method according to any one of claims 1 to 3, characterized in that: The memory controller determines the minimum DQS transmission delay of the DQS when all data carried by N DQs are transmitted correctly, specifically including: The memory controller reduces the transmission delay of the DQS to a first DQS transmission delay, and the interval between the first DQS transmission delay and the transmission delay of the DQS before the reduction is a target setup time applicable to the receiving end; When there is a data transmission error carried by at least one DQ, the memory controller gradually increases the transmission delay of the DQS until all the data carried by the N DQs are transmitted correctly, and determines that the corresponding transmission delay of the DQS is the minimum DQS transmission delay of the DQS.

5. The memory training method according to claim 4, characterized in that: The memory controller gradually increases the transmission delay of the DQS, specifically including: The memory controller gradually increases the transmission delay of the DQS by increasing the first DQS adjustment amplitude each time, and the first DQS adjustment amplitude is smaller than the target setup time applicable to the receiving end.

6. The memory training method according to claim 5, characterized in that: The first DQS adjustment range is a minimum adjustment range of the transmission delay of the DQS by the memory controller.

7. The memory training method according to any one of claims 1 to 3, characterized in that: The memory controller determines the maximum DQS transmission delay of the DQS when all data carried by N DQs are transmitted correctly, specifically including: The memory controller increases the transmission delay of the DQS to a second DQS transmission delay, and the interval between the second DQS transmission delay and the DQS transmission delay before the increase is a target holding time applicable to the receiving end; When there is a data transmission error carried by at least one DQ, the memory controller gradually reduces the transmission delay of the DQS until all the data carried by the N DQs are transmitted correctly, and determines that the corresponding transmission delay of the DQS is the maximum DQS transmission delay of the DQS.

8. The memory training method according to claim 7, characterized in that: The memory controller gradually reduces the transmission delay of the DQS, specifically including: The memory controller gradually reduces the transmission delay of the DQS by reducing the second DQS adjustment amplitude each time, and the second DQS adjustment amplitude is smaller than the target holding time applicable to the receiving end.

9. The memory training method according to claim 8, characterized in that: The second DQS adjustment range is a minimum adjustment range of the transmission delay of the DQS by the memory controller.

10. A memory training method, characterized in that: Applied to a memory controller, the method comprises: The memory controller keeps the transmission delay of the DQS unchanged, and adjusts the transmission delay of the first DQ, determines the maximum DQ transmission delay and / or the minimum DQ transmission delay of the first DQ when the data carried by the first DQ is correctly transmitted, the DQS and the first DQ are both transmitted by the memory controller to the memory chip, or are both transmitted by the memory chip to the memory controller, the DQS is used to trigger the receiving end of the first DQ to identify the level state of the first DQ, when the first DQ and the DQS are transmitted by the memory controller to the memory chip, the receiving end of the first DQ is the memory chip, and when the first DQ and the DQS are transmitted by the memory chip to the memory controller, the receiving end of the first DQ is the memory controller; The memory controller adjusts the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay, wherein the interval between the target DQ transmission delay and the maximum DQ transmission delay is not less than a target setup time applicable to the receiving end, and / or the interval between the target DQ transmission delay and the minimum DQ transmission delay is not less than a target hold time applicable to the receiving end.

11. The method according to claim 10, characterized in that N DQs correspond to the DQS, the first DQ is located within the N DQs, Before the memory controller adjusts the transmission delay of the first DQ, the method further includes: The memory controller determines, according to a round-robin rule, that the next DQ of the DQ that has completed the previous memory training among the N DQs is the first DQ.

12. The method according to claim 10 or 11, characterized in that: When both the first DQ and the DQS are transmitted by the memory controller to the memory chip, the transmission delay of the first DQ is the sending delay of the first DQ, and the memory controller adjusts the sending delay of the first DQ to a target DQ sending delay between the maximum DQ sending delay and the minimum DQ sending delay.

13. The method according to claim 10 or 11, characterized in that: When both the first DQ and the DQS are transmitted from the memory chip to the memory controller, the transmission delay of the first DQ is the reception delay of the first DQ, and the memory controller adjusts the reception delay of the first DQ to a target DQ reception delay between the maximum DQ reception delay and the minimum DQ reception delay.

14. The method according to claim 10, characterized in that The memory controller determines the minimum DQ transmission delay of the first DQ when the data carried by the first DQ is correctly transmitted, specifically including: The memory controller reduces the transmission delay of the first DQ to the first DQ transmission delay, and the first DQ transmission delay is separated from the transmission delay of the first DQ before the reduction by a target retention time applicable to the receiving end; When data transmission carried by the first DQ is erroneous, the memory controller gradually increases the transmission delay for the first DQ until the data transmission carried by the first DQ is correct, and determines that the corresponding transmission delay of the first DQ is the minimum DQ transmission delay.

15. The method according to claim 14, characterized in that The memory controller gradually increases the transmission delay of the first DQ, specifically including: The memory controller gradually increases the transmission delay of the first DQ by increasing the first DQ adjustment amplitude each time, and the first DQ adjustment amplitude is smaller than the target retention time applicable to the receiving end.

16. The method according to claim 15, characterized in that The first DQ adjustment range is a minimum adjustment range of the memory controller for the transmission delay of the first DQ.

17. The method according to claim 10, characterized in that The memory controller determines a maximum DQ transmission delay of the first DQ when data carried by the first DQ is transmitted correctly, specifically including: The memory controller increases the transmission delay of the first DQ to a second DQ transmission delay, and the second DQ transmission delay and the transmission delay of the first DQ before the increase are separated by a target setup time applicable to the receiving end; When data transmission carried by the first DQ is erroneous, the memory controller gradually reduces the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and determines that the corresponding transmission delay of the first DQ is the maximum DQ transmission delay.

18. The method according to claim 17, characterized in that The memory controller gradually reduces the transmission delay of the first DQ, specifically including: The memory controller gradually reduces the transmission delay of the first DQ by reducing the second DQ adjustment amplitude each time, and the second DQ adjustment amplitude is smaller than the target setup time applicable to the receiving end.

19. The method according to claim 18, characterized in that The second DQ adjustment range is a minimum adjustment range of the memory controller for the transmission delay of the first DQ.

20. A memory controller, characterized in that: Including a time delay circuit and a control circuit; The delay circuit is used to generate a transmission delay of DQS under the control of the control circuit; The control circuit is used for: Control the delay circuit to keep the transmission delay of the N DQs unchanged, and control the delay circuit to adjust the transmission delay of the DQS, determine the maximum DQS transmission delay and / or the minimum DQS transmission delay of the DQS when all the data carried by the N DQs are transmitted correctly, the N DQs and the DQS are transmitted from the memory controller to the memory chip, or are transmitted from the memory chip to the memory controller, and the DQS is used to trigger the receiving end of the N DQs to identify the level state of the N DQs, wherein, when the N DQs and the DQSs are transmitted from the memory controller to the memory chip, the receiving end of the N DQs is the memory chip, and when the N DQs and the DQSs are transmitted from the memory chip to the memory controller, the receiving end of the N DQs is the memory controller; Control the delay circuit to adjust the transmission delay of the DQS to a target DQS transmission delay between the maximum DQS transmission delay and the minimum DQS transmission delay, wherein the interval between the target DQS transmission delay and the maximum DQS transmission delay is not less than a target hold time applicable to the receiving end, and / or the interval between the target DQS transmission delay and the minimum DQS transmission delay is not less than a target setup time applicable to the receiving end.

21. The memory controller according to claim 20, characterized in that: When the N DQs and the DQS are transmitted from the memory controller to the memory chip, the transmission delay of the DQS is the sending delay of the DQS, and the control circuit is specifically used for: The delay circuit is controlled to adjust the DQS transmission delay to a target DQS transmission delay between a maximum DQS transmission delay and a minimum DQS transmission delay.

22. The memory controller according to claim 20, characterized in that: When the N DQs and the DQS are transmitted from the memory chip to the memory controller, the transmission delay of the DQS is the reception delay of the DQS, and the control circuit is specifically used for: The delay circuit is controlled to adjust the DQS reception delay to a target DQS reception delay between a maximum DQS reception delay and a minimum DQS reception delay.

23. The memory controller according to any one of claims 20 to 22, characterized in that: The control circuit is specifically used for: Controlling the delay circuit to reduce the transmission delay of the DQS to a first DQS transmission delay, wherein the first DQS transmission delay and the DQS transmission delay before reduction are separated by a target setup time applicable to the receiving end; When there is a data transmission error carried by at least one DQ, the delay circuit is controlled to gradually increase the transmission delay of the DQS until all the data carried by the N DQs are transmitted correctly, and the corresponding transmission delay of the DQS is determined to be the minimum DQS transmission delay of the DQS.

24. The memory controller according to claim 23, characterized in that: The control circuit is specifically used for: The delay circuit is controlled to gradually increase the transmission delay of the DQS by increasing a first DQS adjustment amplitude each time, wherein the first DQS adjustment amplitude is smaller than a target setup time applicable to the receiving end.

25. The memory controller according to claim 24, characterized in that: The first DQS adjustment amplitude is a minimum adjustment amplitude of the transmission delay of the DQS by the delay circuit.

26. The memory controller according to any one of claims 20 to 22, characterized in that: The control circuit is specifically used for: Controlling the delay circuit to increase the transmission delay of the DQS to a second DQS transmission delay, wherein the second DQS transmission delay is separated from the transmission delay of the DQS before the increase by a target holding time applicable to the receiving end; When there is a data transmission error carried by at least one DQ, the delay circuit is controlled to gradually reduce the transmission delay of the DQS until all the data carried by the N DQs are transmitted correctly, and the corresponding transmission delay of the DQS is determined to be the maximum DQS transmission delay of the DQS.

27. The memory controller according to claim 26, characterized in that: The control circuit is specifically used for: The delay circuit is controlled to gradually reduce the transmission delay of the DQS in a manner of reducing the second DQS adjustment amplitude each time, and the second DQS adjustment amplitude is smaller than the target holding time applicable to the receiving end.

28. The memory controller according to claim 27, characterized in that: The second DQS adjustment amplitude is a minimum adjustment amplitude of the transmission delay of the DQS by the delay circuit.

29. A memory controller, characterized in that: Including a time delay circuit and a control circuit; The delay circuit is used to generate a transmission delay of the first DQ under the control of the control circuit; The control circuit is used for: Control the delay circuit to keep the transmission delay of DQS unchanged, and control the delay circuit to adjust the transmission delay of the first DQ, determine the maximum DQ transmission delay and / or the minimum DQ transmission delay of the first DQ when the data carried by the first DQ is correctly transmitted, the DQS and the first DQ are both transmitted from the memory controller to the memory chip, or are both transmitted from the memory chip to the memory controller, the DQS is used to trigger the receiving end of the first DQ to identify the level state of the first DQ, wherein when the first DQ and the DQS are transmitted from the memory controller to the memory chip, the receiving end of the first DQ is the memory chip, and when the first DQ and the DQS are transmitted from the memory chip to the memory controller, the receiving end of the first DQ is the memory controller; Control the delay circuit to adjust the transmission delay of the first DQ to a target DQ transmission delay between the maximum DQ transmission delay and the minimum DQ transmission delay, wherein the interval between the target DQ transmission delay and the maximum DQ transmission delay is not less than a target setup time applicable to the receiving end, and / or the interval between the target DQ transmission delay and the minimum DQ transmission delay is not less than a target hold time applicable to the receiving end.

30. The memory controller according to claim 29, characterized in that: N DQs correspond to the DQS, the first DQ is located within the N DQs, The control circuit is also used for: According to the round-robin rule, the next DQ of the DQ that completed the memory training last time among the N DQs is determined to be the first DQ.

31. The memory controller according to claim 29 or 30, characterized in that: When both the first DQ and the DQS are transmitted from the memory controller to the memory chip, the transmission delay of the first DQ is the sending delay of the first DQ, and the control circuit is specifically used for: The delay circuit is controlled to adjust the transmission delay of the first DQ to a target DQ transmission delay between a maximum DQ transmission delay and a minimum DQ transmission delay.

32. The memory controller according to claim 29 or 30, characterized in that: When both the first DQ and the DQS are transmitted from the memory chip to the memory controller, the transmission delay of the first DQ is the reception delay of the first DQ, and the control circuit is specifically used for: The delay circuit is controlled to adjust the first DQ reception delay to a target DQ reception delay between a maximum DQ reception delay and a minimum DQ reception delay.

33. The memory controller according to claim 29, characterized in that: The control circuit is specifically used for: Controlling the delay circuit to reduce the transmission delay of the first DQ to the first DQ transmission delay, wherein the first DQ transmission delay and the transmission delay of the first DQ before reduction are separated by a target holding time applicable to the receiving end; When data transmission carried by the first DQ is erroneous, the delay circuit is controlled to gradually increase the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and the corresponding transmission delay of the first DQ is determined to be the minimum DQ transmission delay.

34. The memory controller according to claim 33, characterized in that: The control circuit is specifically used for: The delay circuit is controlled to gradually increase the transmission delay of the first DQ in a manner of increasing the first DQ adjustment amplitude each time, and the first DQ adjustment amplitude is smaller than the target holding time applicable to the receiving end.

35. The memory controller according to claim 34, characterized in that: The first DQ adjustment amplitude is a minimum adjustment amplitude of the delay circuit on the transmission delay of the first DQ.

36. The memory controller according to claim 29, characterized in that The control circuit is specifically used for: Control the delay circuit to increase the transmission delay of the first DQ to a second DQ transmission delay, wherein the second DQ transmission delay and the transmission delay of the first DQ before the increase are separated by a target setup time applicable to the receiving end; When data transmission carried by the first DQ is erroneous, the delay circuit is controlled to gradually reduce the transmission delay of the first DQ until the data transmission carried by the first DQ is correct, and the corresponding transmission delay of the first DQ is determined to be the maximum DQ transmission delay.

37. The memory controller according to claim 36, characterized in that: The control circuit is specifically used for: The delay circuit is controlled to gradually reduce the transmission delay of the first DQ in a manner of reducing the second DQ adjustment amplitude each time, and the second DQ adjustment amplitude is smaller than the target setup time applicable to the receiving end.

38. The memory controller according to claim 37, characterized in that: The second DQ adjustment amplitude is a minimum adjustment amplitude of the delay circuit on the transmission delay of the first DQ.

39. A processor, characterized in that: comprising a processor core and a memory controller as claimed in any one of claims 20 to 38; The processor core is used to send a trigger instruction to the memory controller; The memory controller is used to perform memory training after receiving the trigger instruction.

40. The processor of claim 39, wherein: The processor core is specifically used for: When it is determined that the difference between the current ambient temperature and the historical ambient temperature exceeds the temperature fluctuation threshold, the trigger instruction is sent to the memory controller, and the historical ambient temperature is the ambient temperature when the processor core sent the trigger instruction last time.

41. A processor according to claim 39 or 40, characterized in that The processor core is specifically used for: When it is determined that the time interval between the current time point and the time point at which the processor core last completed the memory training exceeds a time threshold, the trigger instruction is sent to the memory controller.

42. An electronic device, characterized in that: It comprises a processor and a memory chip as described in any one of claims 39 to 41, wherein the memory chip is connected to a memory controller in the processor.

43. An electronic device, characterized in that: comprising a processor, a memory chip and a memory controller as claimed in any one of claims 20 to 38, wherein the memory controller is connected to the processor and the memory chip respectively; The processor is used to send a trigger instruction to the memory controller; The memory controller is used to perform memory training after receiving the trigger instruction.

44. The electronic device according to claim 43, characterized in that The processor is specifically used for: When it is determined that the difference between the current ambient temperature and the historical ambient temperature exceeds the temperature fluctuation threshold, the trigger instruction is sent to the memory controller, and the historical ambient temperature is the ambient temperature when the processor sent the trigger instruction last time.

45. The electronic device according to claim 43 or 44, characterized in that: The processor is specifically used for: When it is determined that the time interval between the current time point and the time point at which the trigger instruction was last sent exceeds a time threshold, the trigger instruction is sent to the memory controller.