CXL module, data transfer method, DMA controller, and control chip

By configuring the DMA controller to move data sequentially and process access commands during DMA transfer, the problems of data conflict and loss in the CXL module were solved, ensuring the normal operation of host services and the reliability of data transmission.

WO2026237677A1PCT designated stage Publication Date: 2026-11-19BEIJING SUPERSTRING ACAD OF MEMORY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/092305
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-13
Filing Date
2026-04-22
Publication Date
2026-11-19

AI Technical Summary

Technical Problem

When the CXL module performs DMA transfer, data conflicts or loss may occur between the host access command and the DMA transfer, affecting the normal operation of the host service.

Method used

By configuring the DMA controller to move data of a preset granularity one at a time and directly executing or replacing access instructions during DMA transfer, data conflicts or loss can be avoided, including taking appropriate measures when access addresses hit data in different states.

Benefits of technology

It effectively avoids the impact of DMA transfer on host services, ensures the integrity and continuity of data transmission, and reduces the risk of data conflicts and loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026092305_19112026_PF_FP_ABST
    Figure CN2026092305_19112026_PF_FP_ABST
Patent Text Reader

Abstract

A CXL module, a data transfer method, a DMA controller, and a control chip, which relate to the technical field of data storage. The CXL module (2) comprises a CXL controller (21), a DMA controller (22), and a storage module (23) for storing data, wherein the CXL controller (21) is configured to: receive an access instruction from a host and send same to the DMA controller (22); and the DMA controller (22) is configured to: control DMA transmission to perform successive data transfer, and upon receiving the access instruction from the host during the DMA transmission, directly execute the access instruction, or replace an access address of the access instruction and then execute the access instruction so as to avoid data conflicts or data loss, and continue with the data transfer after executing the access instruction.
Need to check novelty before this filing date? Find Prior Art

Description

CXL module, data transfer method, DMA controller and control chip

[0001] This application claims priority to Chinese Patent Application No. 2025106116315, filed on May 13, 2025, entitled "CXL Module, Data Transfer Method, DMA Controller and Control Chip", the contents of which are to be understood as incorporated herein by reference. Technical Field

[0002] This application relates to the field of data storage technology, and more particularly to a CXL module, a data transfer method, a DMA controller, and a control chip. Background Technology

[0003] With the development of technologies such as cloud computing, big data, and artificial intelligence, computer systems are placing higher demands on memory performance. To address this, memory manufacturers and system designers are constantly introducing new technologies and methods to improve the reliability, availability, and maintainability of memory in order to meet the ever-increasing performance requirements.

[0004] CXL (Compute Express Link) technology, built upon PCIe (Peripheral Component Interconnect Express), expands memory bandwidth and improves overall system performance, playing a crucial role in high-speed interconnect computing architectures. However, if data transfer is occurring within the CXL module when a host accesses it, it can impact the host's operations. Summary of the Invention

[0005] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of the claims.

[0006] This application provides a CXL module, a data transfer method, a DMA controller, and a control chip.

[0007] In a first aspect, embodiments of this application provide a CXL module, including a CXL controller, a DMA controller, and a storage module for storing data, wherein: the CXL controller is configured to: receive access instructions from the host and send them to the DMA controller;

[0008] The DMA controller is configured to: control DMA transfers to move data sequentially, moving data of a preset granularity from the source address to the corresponding destination address each time; when an access command is received from the host during DMA transfer, execute the access command directly, or replace the access address of the access command before executing the access command to avoid data conflicts or data loss; and continue moving data after executing the access command.

[0009] Secondly, embodiments of this application also provide a data transfer method applied to a DMA controller, the method comprising:

[0010] The DMA transfer is controlled to move data sequentially, moving data of a preset granularity from the source address to the corresponding destination address each time. When an access command is received from the host during the DMA transfer, the access command is executed directly, or the access address of the access command is replaced before execution to avoid data conflicts or data loss. After the access command is executed, the data transfer continues.

[0011] This application also provides a DMA controller, including logic circuitry and a storage medium for temporarily storing data, wherein the logic circuitry is configured to execute the data transfer method of any embodiment of this application.

[0012] This application also provides a control chip, wherein the control chip integrates a CXL controller and a DMA controller according to any embodiment of this application.

[0013] After reading and understanding the accompanying diagrams and detailed descriptions, the other aspects can be understood.

[0014] Overview of the attached figures

[0015] The accompanying drawings are used to provide an understanding of the technical solutions of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.

[0016] Figure 1 is a schematic diagram of the structure of the host and CXL module according to an embodiment of this application;

[0017] Figure 2 is a flowchart of a data transfer method according to an embodiment of this application;

[0018] Figure 3 is a schematic diagram of a DMA controller according to an embodiment of this application.

[0019] Detailed Explanation

[0020] The embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. Unless otherwise specified, the embodiments and features described herein can be combined arbitrarily.

[0021] The embodiments disclosed herein are not necessarily limited to the dimensions shown in the drawings, and the shapes and sizes of the components in the drawings do not reflect actual proportions. Furthermore, the drawings schematically illustrate ideal examples, and the embodiments of this disclosure are not limited to the shapes or values ​​shown in the drawings.

[0022] The ordinal numbers such as "first" and "second" used in this disclosure are for the purpose of avoiding confusion among the constituent elements and do not indicate any order, quantity, or importance. Multiple embodiments are described, but this description is exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described in this disclosure. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with or in lieu of any other feature or element in any other embodiment.

[0023] This disclosure includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this disclosure may also be combined with any conventional features or elements to form the scheme defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other disclosed schemes to form another scheme defined by the claims. Therefore, it should be understood that any feature shown and discussed in this disclosure may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.

[0024] Furthermore, in describing representative embodiments, the specification may have presented methods and processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described in this disclosure to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and process should not be limited to performing the steps in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this disclosure.

[0025] In the description of this disclosure, unless otherwise stated, "multiple" means two or more.

[0026] CXL is developed based on PCIe 5.0 and runs on top of the PCIe physical layer. Based on the characteristics of memory access, CXL is typically divided into three sub-protocols: 1) CXL.io, 2) CXL.mem, and 3) CXL.cache. Correspondingly, CXL devices (also called CXL modules) are divided into three types: Type 1 CXL device, Type 2 CXL device, and Type 3 CXL device. Type 2 and Type 3 devices can have multiple memory modules, which can be of types such as DDR (Double Data Rate) or HBM (High Bandwidth Memory). Taking Type 2 devices as an example, a Type 2 device can be an accelerator card (such as a GPU) in a real-world application scenario, with the host providing data and the accelerator card handling the computation. The HDM model allows the host to directly manage and control the storage space on Type 2 devices, dynamically allocate and configure device memory according to application needs, and perform direct read and write operations. CXL Type 3 devices can provide the host with large-capacity DRAM and can also support persistent media (i.e., non-volatile media, such as flash memory chips).

[0027] Figure 1 illustrates a CXL module that can be used in embodiments of this application. This CXL module can be a second type of CXL device or a third type of CXL device, but is not limited thereto. As shown in Figure 1, the CXL module 2 includes a CXL controller 21, a DMA controller 22, and a storage module 23 for storing data. The storage module 23 includes a memory controller and a memory chip. The memory controller can include the memory controller 231 shown in the figure, such as a DDR controller; the memory chip can include the memory chip 232 shown in the figure, such as a DDR5 chip, but this application is not limited thereto. Any storage medium chip in the CXL module 2 that can serve as host extended memory can be used as the memory chip in embodiments of this application. These storage media can be persistent memory (PMEM), phase-change memory (PCM), magnetic random-access memory (MRAM), resistive random-access memory (ReRAM), high-bandwidth memory, non-volatile memory express solid-state drive (NVMe SSD), etc.

[0028] The CXL controller 21, DMA controller 22, and memory controller 231 in Figure 1 can be integrated into a single control chip, but this is merely an example. The CXL controller 21, Direct Memory Access (DMA) controller 22, and memory controller 231 can also be located in different chips, or two controllers can be integrated into one chip while the other is located in a separate chip. This application does not limit this. The CXL controller 21 includes a CXL interface, a processor, and an address substitution table. The CXL interface is connected to host 1, enabling host 1 to communicate with CXL module 2 via the CXL protocol. For example, based on the CXL.io protocol, host 1 can send control commands to CXL module 2; based on the CXL.mem protocol, host 1 can send access commands to CXL module 2 to read data from memory chip 232 or write external data to memory chip 232. The processor in the CXL controller 21 can process the commands sent by the host to achieve data access, and can also implement various control and data management functions within the CXL module. The DMA controller 22 can initiate DMA transfers based on the control of the CXL module 2 or the host 1, to move data between memory chips 232, or to move data between memory chips 232 and other storage media (such as other storage media in the CXL module 2, or storage media of external devices).

[0029] In one example, the memory chip 232's storage space includes host-accessible memory space and redundant storage space. The CXL controller 21 is further configured to: allocate corresponding redundant storage units for failed memory units appearing in the memory space within the redundant storage space; update the failed address of the failed memory unit and the redundant address of the redundant storage unit to the address replacement table; and send the update information (referring to the failed address and redundant address updated in the address replacement table) to the DMA controller. Upon receiving the update information, the DMA controller 22 uses the failed address as the source address for DMA transfer and the redundant address as the destination address for DMA transfer, sequentially moving data from the failed memory unit to the redundant address of the redundant storage unit via DMA transfer to avoid data loss. This process enables the repair of bad blocks in memory.

[0030] In some technologies, if the CXL module receives an access command from the host during DMA transfer, the CXL module may delay executing the host's access command or notify the host to resend the access command after the DMA transfer is completed, because data conflicts or data loss may occur between the two (DMA transfer and host access). This will affect the normal operation of the host's services.

[0031] Therefore, one embodiment of this application provides a CXL module 2, including a CXL controller 21, a DMA controller 22 and a storage module 23 for storing data. As shown in FIG1, the CXL controller 21 is configured to receive access instructions from the host and send them to the DMA controller.

[0032] The DMA controller 22 is configured to: control DMA transfer to move data sequentially, moving data of a preset granularity from the source address to the corresponding destination address each time; when an access instruction is received from the host during DMA transfer, execute the access instruction directly, or replace the access address of the access instruction before executing the access instruction to avoid data conflicts or data loss; and continue moving data after executing the access instruction.

[0033] The aforementioned data transfer operations can be performed by the data transfer unit in the DMA controller 22, and the related processing of access commands can be performed by the monitoring and security control unit in the DMA controller 22. Here, the data transfer unit and the monitoring and security control unit are logical units and can be implemented through corresponding hardware circuits. The hardware circuits of the data transfer unit and the monitoring and security control unit can be integrated together or set up relatively independently.

[0034] In one example of this embodiment, the access instruction is a write instruction, and the access address is the destination address in the write instruction. In another example of this embodiment, the access instruction is a read instruction, and the access address is the source address in the read instruction.

[0035] In this embodiment, DMA transfer is achieved by sequentially moving data, moving data of a preset granularity size from the source address to the corresponding destination address each time. In one example, the preset granularity size can be equal to the data size of a burst transfer, and the data size of a burst transfer is related to the bus type, storage medium type, hardware design, etc. Taking the AXI (Advanced eXtensible Interface) bus and DDR5 chip as an example, the burst length of DDR5 is BL16, which means that data is transferred over 16 consecutive clock edges (including rising and falling edges) during a burst transfer. For DDR5, each address typically contains 64 bits of data, or 8 bytes. Since the burst length is BL16, this means that a burst will transfer data for 16 consecutive addresses. Therefore, the amount of data transferred in one transaction = burst length × data size per address = 16 × 8 bytes = 128 bytes. In other examples, the bus can also be a PCIe bus, AHB (Advanced High-performance Bus), etc., and the storage medium can be NVMe SSD, HBM, PMEM, etc. The data size of a single burst transfer can be 256 bytes to 4KB, or even larger.

[0036] A single DMA transfer can typically move multiple data sets of a preset granularity. Before initiating a DMA transfer, the processor can configure the source and destination addresses of the data to be transferred to the DMA controller. This is usually represented by the start source address, start destination address, and data length, but it includes information about the source and destination addresses of the data to be transferred each time. The DMA controller can set the source address of the first data transfer as the start source address and the destination address as the start destination address. After each data transfer, the controller offsets the currently used source and destination addresses by a predetermined value to obtain the source and destination addresses of the next data transfer.

[0037] If the source address of a data transfer is As and the destination address is Ad, Ad will be referred to as the destination address corresponding to As, and As will be referred to as the source address corresponding to Ad.

[0038] This embodiment controls DMA transfer to move data sequentially. When an access command from the host is received during DMA transfer, the access command is executed directly, or the access address of the access command is replaced before execution to avoid data conflicts or data loss. After the access command is executed, data transfer continues. This embodiment can reduce the impact of DMA transfer on host services, such as the inability to respond to host access commands in a timely manner, and can also minimize data conflicts or data loss during DMA transfer.

[0039] In an exemplary embodiment of this application, a data conflict refers to data written to the destination address based on an access instruction being overwritten by subsequently moved data. Data loss refers to data written to the source address based on an access instruction not being moved to the corresponding destination address.

[0040] During DMA transfer, the process of moving data of a preset granularity from its source address to its destination address can be broken down into the following steps: First, read the data of the preset granularity from its source address and temporarily store it, for example, in the DMA controller's buffer; second, write the temporarily stored data to the corresponding destination address, completing the data transfer; third, update the source and destination addresses to the source and destination addresses of the next data transfer (e.g., by increasing the column address of both the source and destination addresses by a burst length). After the third step is completed, one data transfer is finished, and the next data transfer can begin.

[0041] If, during the transfer of data (referring to data of a preset granularity, also known as a data block), an access command is received from the host while the data read from the source address has been temporarily stored but not yet written to the destination address, then this data is considered to be being transferred. All data transferred before this data is considered transferred data, and all data transferred after this data is considered pending data. However, if an access command is received from the host after writing data to the destination address and before reading the next data (whether the address has been updated or not), then this data and all previously transferred data are considered transferred data, and all data transferred after this data is considered pending data. In this case, there is no data being transferred.

[0042] If an access instruction's access address matches a destination address where data has not been moved, and the instruction is executed directly, writing data to such an address will result in the data being overwritten by subsequently moved data, a data conflict (new data being overwritten by old data). Conversely, if an access instruction's access address matches a source address where data has already been moved, writing data to such an address will prevent the data from being moved to the corresponding destination address. Subsequent access to this newly written data will be unavailable, resulting in data loss. This is merely an example to illustrate the meaning of data conflict and data loss; the situations that may lead to data conflict and data loss are not limited to these examples.

[0043] When the text describes an address hitting another address, it means that the storage space corresponding to the first address is the same as or part of the storage space corresponding to the second address.

[0044] In an exemplary embodiment of this application, the DMA controller directly executes an access instruction and continues data transfer after the access instruction is executed, including at least one of the following: when the access address is different from all source addresses and / or all destination addresses of the DMA transfer, the access instruction is directly executed, and data transfer continues after the access instruction is executed; the aforementioned "all source addresses" refers to the source addresses of all data of a preset granularity size to be transferred, and "all destination addresses" refers to the destination addresses of all data of a preset granularity size to be transferred. In this case, if the access address is different from all source addresses and / or all destination addresses of the DMA transfer, data conflict and data loss will not occur, and the access instruction can be directly executed, and data transfer can continue after the access instruction is executed.

[0045] When the access address hits the source address of data to be transferred, the access instruction is executed directly. After the access instruction is executed, the subsequent data is transferred. In this case, the data written to the source address by the write instruction will be transferred to the corresponding destination address in the subsequent transfer process, so no data loss will occur. Since the data is still at the source address and has not been transferred, the required data can also be read directly from the source address by the read instruction.

[0046] When the access address hits a destination address where data has already been moved, the access instruction is executed directly. After the access instruction is executed, subsequent data is moved. In this case, the data written to the destination address by the write instruction will not be overwritten by the subsequently moved data, so no data conflict will occur. Since the data has already been moved to the destination address, the read instruction can also be executed directly to read the required data at the destination address.

[0047] When the access address matches the source address of the data being moved, the access instruction is executed directly. After the access instruction is executed, the current data movement is re-executed before moving subsequent data. In this case, the data being moved is temporarily stored by the DMA controller. After the write instruction is executed to write the data to the source address, the current data movement needs to be re-executed to move the newly written data to the corresponding destination address before moving subsequent data to avoid data loss. Conversely, directly executing the read instruction can read the required data from the source address. In this case, the current data movement can be re-executed first, or it can be skipped and the subsequent data can be moved after the access instruction is executed.

[0048] The above-listed scenarios allow for direct execution of access instructions, but in some applications, only a portion of these scenarios need to be considered. For example, in the scenario mentioned above where data is moved from a failed address (as the source address) to a redundant address (as the destination address), if an address replacement table is enabled during DMA transfer to replace the failed address with the redundant address, the original access address of the host access instruction will be replaced by the CXL controller if it hits the failed address. After replacement, it will no longer hit the failed address as the source address; only a comparison with the redundant address as the destination address is needed to determine if a hit has occurred. If the address replacement table is disabled during DMA transfer, i.e., no replacement from failed address to redundant address occurs, the access address of the host access instruction will also not hit the redundant address; only a comparison with the failed address as the source address is needed to determine if a hit has occurred. In other application scenarios, such as moving data from its current location in host-accessible memory space to another location, both the source and destination addresses of the data can be determined simultaneously. Furthermore, the access instructions described in this embodiment may be just write instructions, or they may include both write and read instructions. When both write and read instructions are included, the same processing method may be used for the read and write instructions, or the same processing method may be used only in some cases.

[0049] In an exemplary embodiment of this application, the DMA controller replaces the access address of an access instruction before executing the access instruction, and continues data transfer after the access instruction is executed. This includes at least one of the following: when the access address matches the destination address of the data being transferred, the access address is replaced with the source address corresponding to the matched destination address before executing the access instruction. After the access instruction is executed, the current data transfer is re-executed before continuing to transfer subsequent data. In this case, the data being transferred is in a temporary state. If a write instruction is executed directly to write the data to the destination address of the data being transferred, it will be overwritten by the transferred data. However, in this embodiment, after replacing the access address with the source address corresponding to the matched destination address, the data is written to the source address of the data being transferred. After the write instruction is executed, the current data transfer is re-executed to transfer the newly written data to the corresponding destination address, thus preventing data conflicts and data loss. Read instructions can also be processed in this way to read the required data.

[0050] When an access address matches the destination address of data to be transferred, the access address is replaced with the source address corresponding to the matched destination address before the access instruction is executed. After the access instruction is executed, subsequent data transfer continues. In this case, if a write instruction is executed directly, the data written to the destination address will be overwritten by the subsequently transferred data, resulting in a data conflict. In this embodiment, the access address is replaced with the source address corresponding to the matched destination address. After the data is written to the corresponding source address, it can be transferred to the destination address through subsequent transfer operations, preventing data conflicts and data loss. For read instructions, after the access address is replaced, the required data can also be read from the corresponding source address.

[0051] In an exemplary embodiment of this application, the DMA controller replaces the access address of the access instruction before executing the access instruction, and continues to transfer data after the access instruction is executed. This includes: when the access address hits the source address of already transferred data, replacing the access address with the destination address corresponding to the hit source address, and then executing the access instruction to avoid data loss, and continuing to transfer subsequent data after the access instruction is executed.

[0052] In this situation, if a write command is executed directly to write data to the source address where the data has already been moved, the written data will not be moved to the destination address along with other data, resulting in data loss. This embodiment replaces the access address with the destination address corresponding to the hit source address, replacing the old data with new data, thus preventing data conflicts and data loss. For read commands, the required data (the moved data) can also be read in this way.

[0053] In an exemplary embodiment of this application, the access instruction is a write instruction, and the access address is the destination address in the write instruction; or, the access instruction is a read instruction, and the access address is the source address in the read instruction; the preset granularity size is equal to the data size of a single burst transmission;

[0054] The size of the data written or read by a single access instruction is less than or equal to the preset granularity. For example, the host can write data of the preset granularity to the memory chip of the CXL module or read data of the preset granularity from the memory chip of the CXL module in a single access.

[0055] In an exemplary embodiment of this application, the DMA controller is further configured to: record and update information on the current address and transfer status during DMA transfer, wherein the current address is the source address and / or destination address of the data transferred by the DMA transfer, and the transfer status includes part or all of the data being transferred, transferred, and to be transferred; accordingly, the DMA controller can determine whether the access address meets the hit condition by comparing the access address with the current address and based on the comparison result and the transfer status.

[0056] In one example of this embodiment, the source address can be a failed address, and the destination address can be a redundant address used to replace the failed address; the CXL controller is also configured to: pause the replacement of the failed address to the redundant address during DMA transfer, where the current address includes the source address of the data; or, perform the replacement of the failed address to the redundant address during DMA transfer, where the current address includes the destination address of the data.

[0057] In order to facilitate the determination of whether the access address meets the aforementioned hit conditions, the DMA controller can record and update the current address and transfer status information during the DMA transfer process. In the first scenario, after the DMA controller reads and temporarily stores data from the source address, it executes an access instruction before writing the temporarily stored data to the destination address. In this case, the current address is the address of the data (source address and / or destination address), and the data transfer status is "current transfer," meaning the data at the current address is the data being transferred, all data before the data at the current address is transferred data, and all data after the data at the current address is data to be transferred. In the second scenario, after the DMA controller writes data to the destination address, it executes an access instruction before updating the address and reading the next data. In this case, the current address is the address of the data, and the data transfer status is "transferred," meaning the data at the current address and all data before it are transferred data, and all data after the data at the current address is data to be transferred. In the third scenario, after the DMA controller writes data to the destination address and updates the address, it executes an access instruction before reading the next data based on the updated address. In this case, the current address is the address of the next data, and the data transfer status is "pending transfer," meaning the data before the data at the current address (the next data) is transferred data, and all data after the data at the current address is data to be transferred.

[0058] In one example of this embodiment, the DMA controller can execute the access command in all three of the above-mentioned cases, covering all the opportunities during the DMA transfer process. The DMA controller can execute the access command immediately upon receiving it, without waiting. In other examples, the access command is executed only in any one or two of these cases. If the timing of receiving the access command is not within the allowed conditions for executing the access command, a slight delay can be made. For example, in another example, the access command is executed only in the first case mentioned above, that is, the host's access command is allowed to be executed after the read data is temporarily stored and before it is written to the destination address. If the access command is received after the data is written to the destination address and before the next data is read out, the access command is delayed until the next data is read out and temporarily stored before execution. At this time, the current address compared with the access address of the access command is the address of the next data, and the transfer state is in progress. In another example, access instructions are only allowed to be executed in the second scenario described above. If an access instruction is received after reading and temporarily storing data from the source address but before writing the temporarily stored data to the destination address, the instruction is delayed until after the data is written to the destination address and before the address is updated. In this case, the current address compared with the access address is still the address of the data, but the transport status is "transported". Similarly, in other examples, access instructions can be executed only in the third scenario, or only in the first and second scenarios, or only in the first and third scenarios, etc. Regardless of the combination, the current address compared with the access address is the current address at the time of executing the access instruction, and the transport status used to determine whether a match has occurred is the transport status at the time of executing the access instruction.

[0059] In the examples described above in this embodiment, although there is a slight delay after receiving the access command, this delay is very short and has little impact on the host's operations. Restricting the timing of the access command execution simplifies the DMA controller's processing logic and facilitates the corresponding hardware circuit design. For example, when the access command is executed only in one scenario, the "transfer status" information in the current address and transfer status information can be implicitly represented. Furthermore, if the access command is not executed in the first scenario, there is no current transfer status, and there is no need to determine whether current transfer data has been hit and to perform corresponding processing.

[0060] The text describes how the DMA controller continues to transfer data after executing the access instruction, meaning that the DMA controller pauses data transfer while executing the access instruction.

[0061] As mentioned earlier, during DMA transfer, the addresses (source and destination addresses) of the data being transferred each time are typically obtained by adding an offset (such as burst length) to the address of the data transferred previously. After determining the transfer status of the data corresponding to the current address, a hit determination can be made. For example, if the current address is the destination address, the data corresponding to the current address is being transferred, the row address of the access address is the same as the row address of the current address, and the column addresses under that row address all belong to the column addresses of the data being transferred, then if the column address of the access address is equal to the column address of the current address, it means that the access address has hit the destination address of the data being transferred; if the column address of the access address is less than the column address of the current address, it means that the destination address of the already transferred data has been hit; if the column address of the access address is greater than the column address of the current address, it means that the destination address of the data to be transferred has been hit. The hit determination in other cases is similar and will not be elaborated further.

[0062] In an exemplary embodiment of this application, the storage module includes a memory controller and a memory chip. The storage space of the memory chip includes memory space that can be accessed by the host, and also includes redundant storage space.

[0063] The CXL controller is also configured to: allocate corresponding redundant storage units for failed storage units appearing in the memory space in the redundant storage space, update the failure address of the failed storage unit and the redundant address of the redundant storage unit to the address replacement table, and send the update information to the DMA controller.

[0064] The DMA controller is also configured to, upon receiving update information, use the failed address as the source address for DMA transfer and the redundant address as the destination address for DMA transfer, and sequentially move the data in the failed memory cell to the redundant address of the redundant memory cell through DMA transfer to achieve address repair.

[0065] An embodiment of this application also provides a data transfer method applied to a DMA controller, as shown in FIG2, which may include the following steps.

[0066] Step 110: Control DMA transfer to move data sequentially, each time moving data of a preset granularity from the source address to the corresponding destination address.

[0067] Step 120: When an access instruction is received from the host during DMA transfer, execute the access instruction directly, or replace the access address of the access instruction before executing the access instruction to avoid data conflicts or data loss.

[0068] Step 130: After executing the access command, continue transferring data.

[0069] This embodiment controls DMA transfer to move data sequentially. When an access command from the host is received during DMA transfer, the access command is executed directly, or the access address of the access command is replaced before execution to avoid data conflicts or data loss. After the access command is executed, data transfer continues. This embodiment will not fail to respond to the host's access command in a timely manner due to DMA transfer, nor will it cause data conflicts or data loss due to directly executing the host's command during DMA transfer, which is beneficial to the normal operation of host services.

[0070] This embodiment describes the processing method of the DMA controller after receiving an access command from the host during DMA transfer. The DMA controller can be, but is not limited to, the DMA controller in the CXL module. Further limitations on the above steps and features added based on the above steps can be found in the CXL module embodiment above.

[0071] In an exemplary embodiment of this application, a data conflict refers to data written to the destination address based on an access instruction being overwritten by subsequently moved data, and a data loss refers to data written to the source address based on an access instruction not being moved to the corresponding destination address.

[0072] In an exemplary embodiment of this application, directly executing an access instruction and continuing data transfer after executing the access instruction includes at least one of the following (i.e., any one or any combination of any combination): when the access address is different from all source addresses and / or all destination addresses of DMA transfer, directly executing the access instruction and continuing data transfer after executing the access instruction; when the access address matches a source address of data to be transferred, directly executing the access instruction and continuing to transfer subsequent data after executing the access instruction; when the access address matches a destination address of already transferred data, directly executing the access instruction and continuing to transfer subsequent data after executing the access instruction; when the access address matches a source address of data currently being transferred, directly executing the access instruction, re-executing the current data transfer after executing the access instruction, and then continuing to transfer subsequent data.

[0073] In an exemplary embodiment of this application, the access address of the access instruction is replaced before the access instruction is executed, and data transfer continues after the access instruction is executed. This includes at least one of the following: when the access address matches the destination address of the data being transferred, the access address is replaced with the source address corresponding to the matched destination address before the access instruction is executed. After the access instruction is executed, the current data transfer is re-executed before the subsequent data transfer continues; when the access address matches the destination address of data to be transferred, the access address is replaced with the source address corresponding to the matched destination address before the access instruction is executed. After the access instruction is executed, the subsequent data transfer continues.

[0074] In an exemplary embodiment of this application, the access address of the access instruction is replaced before the access instruction is executed, and data continues to be transferred after the access instruction is executed. This includes: when the access address hits the source address of the transferred data, the access address is replaced with the destination address corresponding to the hit source address, and the access instruction is executed again to avoid data loss. After the access instruction is executed, subsequent data continues to be transferred.

[0075] In an exemplary embodiment of this application, the access instruction is a write instruction, and the access address is the destination address in the write instruction; or, the access instruction is a read instruction, and the access address is the source address in the read instruction; the preset granularity size is equal to the data size of a burst transmission; the size of the data written or read by executing a single access instruction is less than or equal to the preset granularity size.

[0076] In an exemplary embodiment of this application, the data transfer method may further include: recording and updating information on the current address and transfer status during DMA transfer, wherein the current address is the source address and / or destination address of the data transferred by DMA transfer, and the transfer status includes part or all of the data being transferred, transferred, and to be transferred; whether the access address meets the hit condition can be determined by comparing the access address with the current address and based on the comparison result and the transfer status.

[0077] In one example of this embodiment, the source address is a failed address and the destination address is a redundant address used to replace the failed address. The data transfer method may further include: pausing the replacement of the failed address to the redundant address during DMA transfer, where the current address includes the source address of the data; or, performing the replacement of the failed address to the redundant address during DMA transfer, where the current address includes the destination address of the data.

[0078] The embodiments described above in this application monitor the transfer address and compare it with the access address. Based on the comparison result, the execution of the access command is subject to security control. This ensures that the host service is not interrupted during the data transfer process and that there will be no conflict where old data overwrites new data, or loss where new data is not transferred to the new address.

[0079] An embodiment of this application also provides a DMA controller, as shown in FIG3, including a logic circuit 5 and a storage medium 6 for temporarily storing data, wherein the logic circuit 5 is configured to execute the data transfer method in any embodiment of this application.

[0080] One embodiment of this application also provides a control chip, as shown in FIG1. ​​The control chip integrates a CXL controller 22 and a DMA controller 22 of any embodiment of this application.

[0081] One embodiment of this application provides a data transfer method applied to a CXL module, as shown in Figure 1. The CXL module may include a CXL controller 21, a DMA controller 22, and a storage module 23. The storage module 23 includes a memory controller 231 and a memory chip 232. In addition to the host-accessible memory space, the memory chip also has redundant storage space. Taking DRAM chips as an example, in the application of the CXL module, when an unrepairable error occurs in a row, column, or block within the DRAM chip, the address of the unrepairable failed memory cell can be mapped to the address of the reserved redundant area within the DRAM chip by updating the address replacement table, thereby achieving the repair of various types of data errors.

[0082] This embodiment relates to data transfer initiated during the repair process of failed memory units in memory space, but this application is not limited to this. In this embodiment, after allocating corresponding redundant memory units to the failed memory units (error areas) in the redundant storage space, the failed address of the failed memory unit and the redundant address of the redundant memory unit are updated in the address replacement table. When the address replacement table is updated, to ensure no information loss, the data in the source address (i.e., the failed address) needs to be transferred to the destination address (i.e., the redundant address). This data transfer is completed by the DMA controller without the intervention of the processor (CPU) in the CXL controller. This embodiment relates to updating the address replacement table so that the original address data can be transferred to the new replacement address without affecting host services (i.e., host services continue normally during the data transfer process by the DMA controller). Furthermore, it addresses how to monitor and process host services in real time to ensure that DMA data transfer does not conflict with host data read / write, preventing situations where old data replaces new data or new data is lost.

[0083] In one example of this embodiment, a row error occurs in the DRAM chip, requiring row replacement. After allocating a redundant row (also called a new replacement row) to the erroneous row (also called the original row), the replacement table is updated by writing the address information of the original row (row_original) and the address information of the redundant row (row_redundancy, the redundant row is used to replace the original row) into the address replacement table. The updated information of the address replacement table is synchronously sent to the DMA controller (also called the DMA data transfer module). This example allows address replacement to be performed using the address replacement table during DMA transfer.

[0084] When no host message is received, the DMA controller can complete a data transfer using the following steps: First, initiate a read operation on the DRAM chip to read and temporarily store the data from the source address; for example, when reading the first data of a preset granularity size in a DMA transfer, the row address in the source address = row_original, and the column address = 0; Second, perform a write operation on the DRAM chip to write the temporarily stored data to the destination address; for example, when writing the first data in a DMA transfer, the row address in the destination address = row_redundancy, and the column address = 0.

[0085] The third step is to increase the column address of both the source address and the destination address by a burst length. For example, the burst length is 16 (BL16) when the DRAM chip is DDR5 and 8 (BL8) when the DRAM chip is DDR4.

[0086] After completing one data transfer, repeat the above steps until the entire row of data has been transferred. The process ends when the column address increases to the page size. The total amount of data transferred is equal to the page size specified by the system.

[0087] In this example, if a write command is detected in real time after data is read from the source address and temporarily stored but not written to the destination address during a data transfer process, there is a risk of data conflict. That is, the new data written by the host may be replaced by the old data transferred from the source address by the DMA, resulting in an error.

[0088] This example prevents data conflicts by performing the following steps: It checks if the row address in the write instruction's destination address is the same as the row address of the current data transfer destination address. If not, the access instruction can be executed directly without a data conflict. If so, it compares the column address Ac1 in the write instruction's destination address with the column address Ac2 of the current data transfer destination address. If Ac1 is less than Ac2, the destination address of the already transferred data has been hit, and the access instruction is executed directly to write the data to the redundant row without a data conflict. After the access instruction is executed, subsequent data transfer continues. If Ac1 equals Ac2, it means the destination address of the currently transferred data has been hit, and the access address is replaced with the source address corresponding to the hit destination address. The address is used to execute the access command to write the data to the original row (e.g., copy the current host write operation command, use the address row_original of the original row as the destination address, and write the corresponding data to the original row). After the access command is executed, the data transfer is re-executed to move the data written to the original row by the access command to the corresponding destination address, and then the subsequent data transfer continues. If Ac1 is greater than Ac2, it means that the destination address of the data to be transferred has been hit. The access address is replaced with the source address corresponding to the hit destination address, and the access command is executed again to write the data to the original row to wait for transfer. After the access command is executed, the subsequent data transfer continues, and the data written to the original row will be transferred to the corresponding destination address.

[0089] The above processing in this example ensures that when DMA moves data to the address corresponding to the access address, the old data being moved will not overwrite the new data written when the access instruction is executed.

[0090] In another example of this embodiment, a column error occurs in the DRAM chip, requiring column replacement. Column replacement is based on the size of the Matrix Address Table (MAT), and the number of rows it occupies is determined by `row_start` and `row_end`. After allocating a redundant column for the erroneous column, the replacement table is updated by writing the address information of the original column (`col_original`) and the column address information of the replaced redundant region (`col_redundancy`) into the address replacement table. The updated information of the address replacement table is synchronously sent to the DMA controller. This example allows address replacement to be performed using the address replacement table during DMA transfer.

[0091] When no host message is received, the DMA controller can complete a data transfer using the following steps: First, it sends a read operation to the DRAM chip, reading and temporarily storing the data from the source address. For example, when reading the first preset granularity of data for a DMA transfer, the row address in the source address is `row_start`, and the column address is `col_original`; the actual data read may include multiple columns of `col_original`. Second, it performs a write operation to the DRAM chip, writing the temporarily stored data to the destination address. For example, when writing the first preset granularity of data for a DMA transfer, the row address in the destination address is `row_start`, and the column address is `col_redundancy`. Third, it increments the row addresses of both the source and destination addresses by 1, completing the data transfer.

[0092] Repeat the above steps until all the corresponding column data has been transferred, at which point the DMA transfer can be terminated when the row address reaches the row_end position.

[0093] In this example, if a write command sent by the host is detected in real time after the temporary data has been written to the destination address but before the address has been updated during a data transfer process, there is a risk of data conflict. That is, the new data written by the host may be replaced by the old data transferred from the source address by the DMA, resulting in an error.

[0094] This example prevents data conflicts by performing the following steps: It checks if the column address in the destination address of the write instruction is the same as the column address of the current data transfer destination address. If not, the access instruction can be executed directly without a data conflict. If so, it compares the row address Ar1 in the write instruction's destination address with the row address Ar2 in the current data transfer destination address. If Ar1 is less than or equal to Ar2, it indicates that the destination address of the transferred data has been hit, and the access instruction is executed directly to write the data to the redundant area without a data conflict. After the access instruction is executed, subsequent data transfer continues. If Ar1 is greater than Ar2, it indicates that the destination address of the data to be transferred has been hit. The access address is replaced with the source address corresponding to the hit destination address, and the access instruction is executed again to write the data to the original column area. After the access instruction is executed, subsequent data transfer continues, and the data written to the original column area is transferred to the corresponding destination address.

[0095] The above processing in this example ensures that when DMA moves data, the old data being moved will not overwrite the new data written when the access instruction is executed.

[0096] If, during a data transfer process, temporary data has been written to the destination address and the address has been updated, and a write command sent by the host is detected in real time before reading the next data from the source address, the hit judgment in the above processing logic needs to be adjusted as follows: If Ar1 is less than Ar2, the destination address of the transferred data has been hit; if Ar1 is greater than or equal to Ar2, the destination address of the data to be transferred has been hit; the corresponding processing of the access command when the destination address of the transferred data has been hit and when the destination address of the data to be transferred has been hit can be the same.

[0097] In the example above of this embodiment, if an error is found when the data written to the source address is written to the destination address, it can be corrected by a preset error correction algorithm.

[0098] The embodiments described above in this application transfer data via DMA without CPU intervention. After the replacement table is updated, data from the address to be repaired (source address) can be efficiently and quickly transferred to a new address (destination address, used to replace the address to be repaired). By monitoring the access address sent by the host in real time and comparing it with the destination address, if the access address of the write instruction sent by the host matches the destination address of the data to be transferred, the data is written to the source address corresponding to the matched destination address when the access instruction is executed. For example, a copy of the host's write data is sent to the corresponding source address, thereby ensuring that there will be no loss of old data, conflict between old and new data, or data loss issues.

[0099] In other embodiments of this application, unlike the aforementioned embodiments which aim to avoid data conflicts and data loss, one embodiment only addresses the case where data conflicts occur when directly executing access instructions. In this case, the access address of the access instruction is replaced according to the address specified in the corresponding embodiment. For cases where data loss occurs when directly executing access instructions, delayed execution of the access instruction or other methods are used. In another embodiment, only the case where data loss occurs when directly executing access instructions is addressed. In this case, delayed execution of the access instruction or other methods are used. Some embodiments of this application do not require DMA transfer to completely eliminate the impact on the normal operation of host services; it is sufficient that the impact of DMA transfer on host services can be reduced compared to existing technologies. Some embodiments of this application also do not require complete avoidance of data loss; it is sufficient to minimize data conflicts or data loss during DMA transfer.

[0100] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Claims

1. A CXL module comprising a CXL controller, a DMA controller and a storage module storing data, wherein: the CXL controller is configured to receive an access instruction of a host and send the access instruction to the DMA controller; the DMA controller is configured to control DMA transfer to move data in a predetermined granularity each time from a source address of the data to a corresponding destination address, and when receiving the access instruction of the host during the DMA transfer, directly execute the access instruction or execute the access instruction after replacing an access address of the access instruction to avoid data conflict or data loss, and continue to move data after executing the access instruction. 2.The CXL module of claim 1, wherein: the data conflict refers to data written to the destination address based on the access instruction being overwritten by subsequent moved data, and the data loss refers to data written to the source address based on the access instruction not being moved to the corresponding destination address. 3.The CXL module of claim 1, wherein: the DMA controller directly executes the access instruction and continues to move data after executing the access instruction, including at least one of the following ways: when the access address is different from all source addresses and / or all destination addresses of the DMA transfer, directly executing the access instruction and continuing to move data after executing the access instruction; when the access address hits a source address of data to be moved, directly executing the access instruction and continuing to move subsequent data after executing the access instruction; when the access address hits a destination address of data that has been moved, directly executing the access instruction and continuing to move subsequent data after executing the access instruction; when the access address hits a source address of data being moved, directly executing the access instruction, re-executing the current data movement after executing the access instruction, and then continuing to move subsequent data. 4.The CXL module of claim 1, wherein: the DMA controller replaces the access address of the access instruction and then executes the access instruction, and continues to move data after executing the access instruction, including at least one of the following ways: when the access address hits a destination address of data being moved, replacing the access address with a corresponding source address of the hit destination address and then executing the access instruction, re-executing the current data movement after executing the access instruction, and then continuing to move subsequent data; when the access address hits a destination address of data to be moved, replacing the access address with a corresponding source address of the hit destination address and then executing the access instruction, and continuing to move subsequent data after executing the access instruction. 5.The CXL module of claim 1, wherein: The DMA controller replaces the access address of the access instruction and executes the access instruction, and continues to carry data after the execution of the access instruction, including: when the access address hits a source address of carried data, replacing the access address with a corresponding destination address of the hit source address, and then executing the access instruction to avoid data loss, and continuing to carry subsequent data after the execution of the access instruction.

6. The CXL module of any of claims 3 to 5, wherein: The access instruction is a write instruction, and the access address is a destination address in the write instruction; or the access instruction is a read instruction, and the access address is a source address in the read instruction; The preset granularity size is equal to the size of data in one burst transmission; The size of data written or read by a single access instruction is less than or equal to the size of the preset granularity.

7. The CXL module of any of claims 3 to 5, wherein: The DMA controller is further configured to record and update information of a current address and a carrying state during DMA transmission, the current address being a source address and / or a destination address of data carried by DMA transmission, and the carrying state including part or all of the following: being carried, having been carried, and being to be carried; The DMA controller compares the access address with the current address, and determines whether the access address meets the hit condition according to the comparison result and the carrying state.

8. The CXL module of claim 7, wherein: The source address includes a failed address, and the destination address includes a redundant address used to replace the failed address; The CXL controller is further configured to suspend the replacement of the failed address with the redundant address during the DMA transmission, the current address including a source address of data; or perform the replacement of the failed address with the redundant address during the DMA transmission, the current address including a destination address of data.

9. The CXL module of claim 1, wherein: The storage module includes a memory controller and a memory chip, and the storage space of the memory chip includes a memory space accessible by a host and a redundant storage space; The CXL controller is further configured to allocate a corresponding redundant storage unit for a failed storage unit in the memory space in the redundant storage space, update a failed address of the failed storage unit and a redundant address of the redundant storage unit in an address replacement table, and send update information to the DMA controller; The DMA controller is further configured to, after receiving the update information, replace the failed address with a source address of DMA transmission and the redundant address with a destination address of DMA transmission.

10. A data carrying method applied to a DMA controller, the method comprising: controlling DMA transmission to carry data in a preset granularity size one by one, each time carrying data in a preset granularity size from a source address to a corresponding destination address; when receiving an access instruction from the host during the DMA transmission, directly executing the access instruction, or replacing the access address of the access instruction and then executing the access instruction to avoid data conflict or data loss; continuing to transfer data after executing the access instruction.

11. The method of claim 10, wherein: the data conflict refers to data written to the destination address based on the access instruction being overwritten by subsequent transferred data, and the data loss refers to data written to the source address based on the access instruction not being transferred to the corresponding destination address.

12. The method of claim 10, wherein: the directly executing the access instruction and continuing to transfer data after executing the access instruction comprises at least one of the following: when the access address is different from all source addresses and / or all destination addresses of the DMA transmission, directly executing the access instruction and continuing to transfer data after executing the access instruction; when the access address hits a source address of data to be transferred, directly executing the access instruction and continuing to transfer subsequent data after executing the access instruction; when the access address hits a destination address of data that has been transferred, directly executing the access instruction and continuing to transfer subsequent data after executing the access instruction; when the access address hits a source address of data being transferred, directly executing the access instruction, re-executing the current data transfer first, and then continuing to transfer subsequent data after executing the access instruction.

13. The method of claim 10, wherein: the replacing the access address of the access instruction and then executing the access instruction and continuing to transfer data after executing the access instruction comprises at least one of the following: when the access address hits a destination address of data being transferred, replacing the access address with a corresponding source address of the hit destination address and then executing the access instruction, re-executing the current data transfer first, and then continuing to transfer subsequent data after executing the access instruction; when the access address hits a destination address of data to be transferred, replacing the access address with a corresponding source address of the hit destination address and then executing the access instruction and continuing to transfer subsequent data after executing the access instruction.

14. The method of claim 10, wherein: the replacing the access address of the access instruction and then executing the access instruction and continuing to transfer data after executing the access instruction comprises, when the access address hits a source address of data that has been transferred, replacing the access address with a corresponding destination address of the hit source address, executing the access instruction to avoid data loss, and continuing to transfer subsequent data after executing the access instruction.

15. The method of any one of claims 12 to 14, wherein: the access instruction is a write instruction and the access address is a destination address of the write instruction, or the access instruction is a read instruction and the access address is a source address of the read instruction; the preset granularity size is equal to a data size of one burst transmission. A size of data written or read by execution of a single said access instruction is less than or equal to a size of said preset granularity.

16. The method of any one of claims 12 to 14, The method further comprises: information of a current address and a carry state is recorded and updated during the DMA transfer, the current address being a source address and / or a destination address of data carried by the DMA transfer, the carry state including part or all of a being carried, having been carried and to be carried; whether the access address is hit or not is determined by comparing the access address with the current address, according to a comparison result and the carry state.

17. The method of claim 16, wherein: the source address includes a invalid address, and the destination address includes a redundant address used to replace the invalid address; the method further includes: suspending replacement of the invalid address by the redundant address during the DMA transfer, the current address including the source address of data; or, performing replacement of the invalid address by the redundant address during the DMA transfer, the current address including the destination address of data.

18. A DMA controller comprising a logic circuit and a storage medium for staging data, wherein, The logic circuit is configured to perform the data carrying method of any one of claims 10 to 17.

19. A control chip, the control chip having integrated therein a CXL controller and the DMA controller of claim 18.