Memory controller, memory access method, storage module and electronic device
By using both fast and slow storage media in the memory controller, and using interfaces and processing circuits for address mapping and access management, the memory wall problem and the high cost of storage modules are solved, and flexible access modes and reduced costs are achieved. The effect of resource waste.
Patent Information
- Application Number
- PCT/CN2023/139873
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-31
- Filing Date
- 2023-12-19
- Publication Date
- 2024-10-03
AI Technical Summary
Due to capacity and cost limitations of traditional double transfer dual in-line storage (DDR DIMM), the growth rate of memory capacity does not match the growth rate of central processing unit (CPU) computing power, forming a serious memory wall problem. The existing computing fast link-based The storage module of CXL only contains fast storage media, which cannot effectively reduce costs, and the synchronous access of slow storage media leads to a waste of computing power resources of the host system.
Design a memory controller that uses both fast storage media and slow storage media, uses interfaces and processing circuits to receive and map access messages from the host system respectively, realizes access to the two types of media, supports synchronous and asynchronous access protocols, and reduces equipment costs and simplify storage management.
It achieves a simpler memory expansion method while taking into account costs, reduces the complexity of host system storage management, and avoids the waste of computing resources caused by synchronous access to slow storage media by supporting asynchronous access mode.
Smart Images

Figure CN2023139873_03102024_PF_FP_ABST
Abstract
Description
Memory controller, memory access method, storage module and electronic device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on March 31, 2023, with application number 202310380108.7 and application name “Memory controller, memory access method, storage module and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] Embodiments of the present application relate to the field of storage technology, and in particular to a memory controller, a memory access method, a storage module, and an electronic device. Background Art
[0003] The widespread application of artificial intelligence (AI) and machine learning (ML) is driving increasing demand for memory capacity. However, due to capacity and cost limitations, traditional double-data-rate dual-inline-memory modules (DDR DIMMs) have seen a mismatch between memory capacity growth and the computing power of central processing units (CPUs). Consequently, they are unable to meet the needs of system applications, leading to a serious memory wall problem. To address this, major internet technology (IT) vendors have proposed various solutions, with Compute Express Link (CXL) currently being the mainstream technology for memory expansion.
[0004] Typically, a CXL-based storage module includes a CXL controller, which is connected to fast storage media such as full DDR or DDR-like memory. The host system accesses fast storage media such as DDR by computing the CXL.mem protocol, a fast link storage. This type of storage module only contains fast, non-persistent (volatile) storage media and does not contain slow, persistent (non-volatile) storage media, such as Flash. When expanding memory capacity with this type of storage module, the expanded memory typically also uses fast storage media. Since the storage media within the storage module are all high-cost, fast storage media such as DDR or DDR-like, this is not conducive to cost control.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a memory controller, a memory access method, a storage module, and an electronic device, which can achieve memory expansion in a simpler manner while taking cost into consideration.
[0007] In a first aspect, a memory controller is provided. The memory controller is connected to a host system and a memory, respectively. The memory includes a first storage medium and a second storage medium, wherein the first storage medium has a higher access speed than the second storage medium. Generally, in the following examples, the first storage medium may also be referred to as a fast storage medium, and the second storage medium may also be referred to as a slow storage medium. The memory controller includes an interface and a processing circuit.
[0008] Functionally, the interface is used to receive a first access message and a second access message from the host system; the processing circuit is used to map the first access address of the first access message to a first storage address in the memory address space of the host system, and access the first storage medium according to the first storage address; the processing circuit is also used to map the second access address of the second access message to a second storage address in the memory address space of the host system, and access the second storage medium according to the second storage address.
[0009] In the above scheme, the memory controller can respectively access the fast storage medium and the slow storage medium according to the access message received by the interface from the host system. Since the memory uses both fast storage medium and slow storage medium, the equipment cost can be reduced; in addition, the processing circuit can specifically map the first access address of the first access message to the memory address space of the host system according to the first access message, and then access the fast storage medium according to the first storage address, or map the second access address of the second access message to the memory address space of the host system according to the second access message, and then access the fast storage medium according to the first storage address, that is, all the addresses of the fast storage medium and the slow storage medium are mapped to the memory address space of the host system for access. Therefore, the host system only needs to manage the linear address of the memory address space through memory semantics, which reduces the complexity of the host system storage management.
[0010] In one possible implementation, in order to avoid address conflicts between the first storage medium and the second storage medium, the storage address of the first storage medium belongs to the first address segment in the memory address space, and the storage address of the second storage medium belongs to the second address segment in the memory address space, and the first address segment and the second address segment are different. The difference between the first address segment and the second address segment here means that the two do not overlap. In this way, the fast storage medium and the slow storage medium of the storage module are distinguished by different address segments, which allows the host system to store the business data in different areas according to the business data situation, and the host system can complete the data exchange between the slow storage medium and the fast storage medium as needed to ensure that the business access delay is controllable.
[0011] In a possible implementation, the first access message supports a first protocol; the processing circuit is configured to parse the first access message according to the first protocol to obtain the first access address or the second access address, wherein the first protocol is a synchronous access protocol.
[0012] In a possible implementation, the second access message supports a first protocol; the processing circuit is further configured to parse the second access message according to the first protocol to obtain the second access address, wherein the first protocol is a synchronous access protocol.
[0013] In a possible implementation, the first access message supports a second protocol; and the processing circuit is configured to parse the first access message according to the second protocol to obtain the first access address or the second access address, wherein the second protocol is an asynchronous access protocol.
[0014] In a possible implementation, the second access message supports a second protocol; the processing circuit is further configured to parse the second access message according to the second protocol to obtain the second access address, wherein the second protocol is an asynchronous access protocol.
[0015] The storage module supports both synchronous and asynchronous access, providing businesses with more flexible and richer access modes, and fully solving the problem of waste of host system computing resources caused by synchronous access to slow storage media.
[0016] In a possible implementation, the first protocol includes any one of the following: a Computing Express Interconnect Storage (CXL.mem) protocol, a Computing Express Interconnect Storage (CXL.io) protocol, a high-speed serial computer expansion bus (PCIe) bar protocol, and other custom synchronous access protocols.
[0017] In one possible implementation, the second protocol includes any one of the following: a non-volatile high-speed transmission bus NVMe protocol, and other custom asynchronous access protocols.
[0018] In a possible implementation, the first storage medium includes any one of the following random access memories RAN: dynamic random access memory DRAM, static random access memory SRAM, ferroelectric random access memory FRAM and magnetic random access memory; the second storage medium includes a flash memory.
[0019] In one possible implementation, the first access request includes an access request for any of the following operations: read, write, data swap, data copy, link creation, and enumeration. The host system performs data swap and data copy between the slow storage medium and the fast storage medium as needed, ensuring that service access latency is controllable.
[0020] In a second aspect, a memory access method is provided, which is applied to a memory controller, the memory controller being connected to a host system and a memory, respectively, and the memory comprising a first storage medium and a second storage medium; the access speed of the first storage medium is greater than the access speed of the second storage medium; the method comprising: receiving a first access message and a second access message from the host system; mapping a first access address of the first access message to a first storage address in a memory address space of the host system, and accessing the first storage medium according to the first storage address; mapping a second access address of the second access message to a second storage address in the memory address space of the host system, and accessing the second storage medium according to the second storage address.
[0021] In a possible implementation, the storage address of the first storage medium belongs to a first address segment in the memory address space, and the storage address of the second storage medium belongs to a second address segment in the memory address space, and the first address segment and the second address segment are different.
[0022] In a possible implementation, the first access message supports a first protocol, and the method further includes: parsing the first access message according to the first protocol to obtain a first access address or a second access address; wherein the first protocol is a synchronous access protocol.
[0023] In a possible implementation, the second access message supports a first protocol, and the method further includes: parsing the second access message according to the first protocol to obtain a second access address; wherein the first protocol is a synchronous access protocol.
[0024] In a possible implementation, the first protocol includes any one of the following: a Computing Express Interconnect Storage (CXL.mem) protocol, a Computing Express Interconnect Storage (CXL.io) protocol, a high-speed serial computer expansion bus (PCIe) bar protocol, and other custom synchronous access protocols.
[0025] In a possible implementation, the first access message supports a second protocol, and the method further includes: parsing the first access message according to the second protocol to obtain a first access address or a second access address; wherein the second protocol is an asynchronous access protocol.
[0026] In a possible implementation, the second access message supports a second protocol, and the method further includes: parsing the second access message according to the second protocol to obtain a second access address; wherein the second protocol is an asynchronous access protocol.
[0027] In one possible implementation, the second protocol includes any one of the following: a non-volatile high-speed transmission bus NVMe protocol, and other custom asynchronous access protocols.
[0028] In a possible implementation, the first storage medium includes any one of the following random access memories RAM: dynamic random access memory DRAM, static random access memory SRAM, ferroelectric random access memory FRAM, and magnetic random access memory MRAM; the second storage medium includes a flash memory.
[0029] In a possible implementation, the first access request includes an access request for any of the following operations: read, write, data swap, data copy, link creation, and enumeration.
[0030] In a third aspect, a storage module is provided, comprising: a memory and a memory controller as described in the first aspect and its possible implementation methods.
[0031] In a fourth aspect, an electronic device includes: a processor and the storage module as described in the third aspect; the processor is used to generate the first access message.
[0032] In a possible implementation, the system further includes a main memory; the processor is further configured to generate a second access message and access the main memory according to a third access address of the second access message; the third access address belongs to the memory address space of the host system.
[0033] In one possible implementation, the memory address space includes a first address range and a second address range; the first access address and the second access address belong to the first address range, and the third access address belongs to the second address range, wherein the first address range and the second address range are different.
[0034] Among them, the technical problems solved by the second aspect, the third aspect, the fourth aspect and their possible implementation methods and the technical effects achieved can be referred to the description in the first aspect and its possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0036] FIG2 is a schematic structural diagram of a storage module provided in another embodiment of the present application;
[0037] FIG3 is a schematic structural diagram of a storage module provided in yet another embodiment of the present application;
[0038] FIG4 is a schematic structural diagram of a storage module provided in yet another embodiment of the present application;
[0039] FIG5 is a schematic diagram of a mapping relationship of a memory address space provided in an embodiment of the present application;
[0040] FIG6 is a schematic structural diagram of a storage module provided in another embodiment of the present application;
[0041] FIG7 is a schematic structural diagram of a storage module provided in yet another embodiment of the present application;
[0042] FIG8 is a schematic diagram of a mapping relationship of a memory address space provided by another embodiment of the present application;
[0043] FIG9 is a flow chart of a memory access method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] The following explains some of the terms involved in the embodiments of this application:
[0045] 1) Storage media: including various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks. Generally, fast storage media refers to storage media with faster file access (read and write) speeds, and slow storage media refers to storage media with slower file access (read and write) speeds. In the embodiments of the present application, the access speed of fast storage media is higher than that of slow storage media. Therefore, in some examples, the fast storage medium may be RAM or other new fast storage media. In the following examples, double-data-rate synchronous dynamic random access memory (DDR SDRAM, abbreviated as DDR) or DDR-like is mainly used as an example for explanation. In addition, the fast storage medium can also be a volatile storage medium with a high access rate similar to DDR that can be used as memory, cache, etc., such as dynamic random access memory (DRAM), static random access memory (SRAM), ferroelectric RAM (FRAM) and magnetic random access memory (MRAM); in the embodiments of the present application, the slow storage medium is mainly explained by taking flash memory as an example, and the slow storage medium can also be a non-volatile storage medium such as a solid state disk (SSD) and a low latency flash memory.
[0046] 2) Other terms
[0047] In the embodiments of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the terms "first storage medium" and "second storage medium" are used solely to distinguish between different storage media and do not limit their order. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that terms such as "first" and "second" do not necessarily define differences.
[0048] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described in the present application as "exemplary" or "for example" should not be interpreted as being more preferred or advantageous than other embodiments or designs. To be precise, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. "For" is used to indicate that circuits, modules, units, etc. have one or more functions (capabilities). Of course, in the embodiments of the present application, for the same circuit, multiple functions defined by "for" are not limited to being implemented simultaneously. For example, the same circuit can selectively implement one or more of the multiple functions at different stages.
[0049] In the embodiments of the present application, the description of the electronic device architecture is intended to more clearly illustrate the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will know that with the evolution of electronic device architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0050] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0051] The following describes an electronic device provided by an embodiment of the present application in conjunction with Figures 1 and 2. The electronic device 100 may include electronic devices such as mobile phones, tablet computers, laptop computers, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, personal digital assistants (PDAs), wearable electronic devices, virtual reality devices, servers, etc. The electronic device 100 may include a processor 110 and a main memory 120, wherein the processor 110 and the main memory 120 constitute a host system.
[0052] The processor 110 may be a processor core (CPU core) of the electronic device 100. The processor 110 may process data by parsing commands of an operating system or executing various programs on the electronic device 100. The processor 110 may communicate with the main memory 120. Data processed by the processor 110 or data required during operation of the processor 110 may be stored in the main memory 120. In an example embodiment, the main memory 120 may be double-data-rate dual-inline-memory-modules (DDR DIMMs) and may communicate directly with the processor 110. The main memory 120 may be used as a buffer memory, a cache memory, or a system memory for the processor 110.
[0053] The widespread application of artificial intelligence (AI) and machine learning (ML) is driving increasing demand for memory capacity. However, due to capacity and cost limitations, traditional double-data-rate dual-inline-memory modules (DDR DIMMs) have seen a mismatch between memory capacity growth and the computing power of central processing units (CPUs). Consequently, they are unable to meet the needs of system applications, leading to a serious memory wall problem. To address this, major internet technology (IT) vendors have proposed various solutions, with Compute Express Link (CXL) currently being the mainstream technology for memory expansion. Typically, as shown in FIG1 , the electronic device further includes a memory module 130 . As shown in FIG2 , the memory module 130 may include an interface 131 (using a high-speed serial computer expansion bus standard Peripheral Component Interconnect Express (PCIe) end point (EP) interface as an example in FIG2 ), a CXL controller 132 (also referred to as a CXL ctrl), and a fast storage medium 133 (which may be a fast storage medium such as DDR or DDR-like in FIG2 ). In some examples, the interface 131 and the CXL controller 132 together constitute a memory controller.
[0054] The interface 131 can communicate with the processor 110 and can exchange data according to, for example, a CXL protocol (e.g., a CXL.mem protocol). The interface 131 can adopt a heterogeneous computing interface circuit that meets the high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIe), that is, a PCIe interface. The interface 131 implements a consistent interconnection between the processor 110 (i.e., a general-purpose processor) and the storage module 130. In an example embodiment, the interface 131 may include an interface based on the CXL protocol, i.e., a CXL interface. In some examples, the interface may also be implemented based on at least one of the following various computing interfaces: Gen-Z protocol, NVLink protocol, cache coherent interconnect for accelerators (CCIX) protocol, and open coherent accelerator processor interface (CAPI) protocol.
[0055] When accessing the fast storage medium 133, the CXL controller 132 can store data in the fast storage medium 133 or read data stored in the fast storage medium 133. The main memory 120 and the fast storage medium 133 are used as system memory to store multiple pieces of operating data or output the stored pieces of operating data under the control of the processor 110. The electronic device 100 may include one or more storage modules 130. Storage modules 130 can store data or output stored data via a CXL interface based on access control by the processor 110. In other words, the processor 110 can use the storage modules 130 as a storage area with similar functionality to the main memory 120, thereby expanding the main memory 120.
[0056] However, this storage module 130 only includes fast storage media 133 and does not include slower, persistent storage media, such as Flash. When expanding memory capacity in this type of storage module 130, the expanded memory typically also uses fast storage media. This is disadvantageous for cost control, as the storage media within the storage module are all high-cost, fast storage media such as DDR or DDR-like.
[0057] In addition, the electronic device 100 may include a solid-state drive (SSD) 140. In FIG1 , the processor 110, the storage module 130, and the SSD 140 may communicate with each other via a system bus (BUS). Of course, the electronic device 100 shown in FIG1 is merely an example. In some examples, the components connected to the BUS may include more modules or devices.
[0058] In some implementations, to reduce costs, as shown in FIG3 , a CXL controller 132 connects a small amount of fast storage media 133 (e.g., DDR) as a cache. When expanding memory capacity, the CXL controller 132 uses a PCIe root point (RP) interface in interface 131 to connect to a standard SSD controller 135 (e.g., a non-volatile memory express (NVMe) controller) to access a slow storage media 136 (e.g., Flash). In this method, DDR acts as a cache for the slow storage media Flash, and the host system accesses DDR via the CXL.mem protocol. During this access, the host system primarily accesses the DDR based on the linear address (also known as the virtual address) of memory semantics. Simultaneously, Flash can be accessed by the host system via the NVMe protocol based on the logical block address (LBA). Thus, the entire storage module 130 has memory semantics with linear addresses and LBA access. Since slow storage media are relatively inexpensive, a hybrid model combining fast and slow storage media reduces storage module costs. However, when the host system accesses DDR using the CXL.mem protocol and a cache miss occurs, it must retrieve data from the Flash memory via the PCIe RP. Since the cache is controlled by the storage module and the system cannot predict it in advance, this can lead to uncontrollable system access times. Furthermore, Flash memory on the host system side is still accessed based on LBA. This requires managing both the linear address space of DDR memory semantics and the LBA address space, complicating system management.
[0059] Therefore, how to achieve memory expansion in a simpler way while taking cost into consideration becomes a problem that needs to be solved.
[0060] 4 , a memory module 130 is provided, wherein the memory module 130 includes a memory controller 200 and a memory 300. The memory controller 200 is connected to a host system and the memory 300 respectively.
[0061] The memory 300 includes a first storage medium 301 (a fast storage medium is used as an example in Figure 4) and a second storage medium 302 (a slow storage medium is used as an example in Figure 4), and the access speed of the first storage medium 301 is greater than the access speed of the second storage medium 302; the memory controller 200 includes an interface 201 and a processing circuit 202.
[0062] The interface 201 is used to receive an access message from the host system (for example, a first access message and a second access message at the same time or at different times); wherein, as shown in FIG1 , the first access message and the second access message may be generated by the processor 110 in the host system; the processing circuit 202 is used to map the first access address of the first access message to a first storage address in the memory address space of the host system, and access the first storage medium 301 according to the first storage address; the processing circuit 202 is also used to map the second access address of the second access message to a second storage address in the memory address space of the host system, and access the second storage medium 302 according to the second storage address.
[0063] In addition, in order to avoid address conflicts between the first storage medium and the second storage medium, the storage address of the first storage medium belongs to the first address segment in the memory address space, and the storage address of the second storage medium belongs to the second address segment in the memory address space, and the first address segment and the second address segment are different; wherein, the first address segment and the second address segment are different here means that the two do not overlap. Based on the address mapping relationship diagram of the memory address space shown in FIG5 , it can be seen that when the electronic device has two storage modules (130-a and 130-b), the solution provided by the embodiment of the present application can map the storage address of the fast storage medium of storage module 130-a to the virtual address segment VA-F1 of the memory address space; map the storage address of the slow storage medium of storage module 130-a to the virtual address segment VA-S1 of the memory address space; map the storage address of the fast storage medium of storage module 130-b to the virtual address segment VA-F2 of the memory address space; and map the storage address of the slow storage medium of storage module 130-b to the virtual address segment VA-S2 of the memory address space. In addition, for the main memory 120 in the host system (using DIMM as an example in FIG5 ), its storage address is mapped to the virtual address segment VA-D of the memory address space. In addition, the processor 110 can also generate a third access message and access the main memory 120 according to the third access address in VA-D carried by the third access message. Each of the aforementioned virtual address segments VA-F1, VA-S1, VA-F2, VA-S2 and VA-D is different from each other, that is, the third access address belongs to a different address range from the first access address and the second access address.
[0064] In the above scheme, the memory controller can respectively access the fast storage medium and the slow storage medium according to the access message received by the interface from the host system. Since the memory uses both fast storage medium and slow storage medium, the equipment cost can be reduced; in addition, the processing circuit can specifically map the first access address of the first access message to the memory address space of the host system according to the first access message, and then access the fast storage medium according to the first storage address, or map the second access address of the second access message to the memory address space of the host system according to the second access message, and then access the fast storage medium according to the first storage address, that is, all the addresses of the fast storage medium and the slow storage medium are mapped to the memory address space of the host system for access. Therefore, the host system only needs to manage the linear address of the memory address space through memory semantics, which reduces the complexity of the host system storage management.
[0065] Based on the above scheme, the storage module 130 supports both synchronous memory access and asynchronous memory access. Specifically, when the first access message supports the first protocol, the processing circuit 202 is also used to parse the first access message according to the first protocol to obtain the first access address; when the second access message supports the first protocol, the processing circuit 202 is also used to parse the second access message according to the first protocol to obtain the second access address, wherein the first protocol is a synchronous access protocol. Alternatively, when the first access message supports the second protocol, the processing circuit 202 is also used to parse the first access message according to the second protocol to obtain the first access address; when the second access message supports the second protocol, the processing circuit 202 is also used to parse the second access message according to the second protocol to obtain the second access address, wherein the second protocol is an asynchronous access protocol. Typically, the first protocol may include any of the following: Computing Express Interconnect Storage CXL.mem protocol, Computing Express Interconnect Storage Interface CXL.io protocol, High-speed Serial Computer Expansion Bus PCIe bar protocol and other custom synchronous access protocols. The second protocol may include any of the following: Non-Volatile High-Speed Transmission Bus NVMe protocol, and other custom asynchronous access protocols. The storage module supports both synchronous and asynchronous access, providing businesses with more flexible and richer access modes, and fully solving the problem of waste of host system computing resources caused by synchronous access to slow storage media.
[0066] In Figure 6, the processing circuit 202 may specifically include: a first memory controller 2021 (taking a memory synchronization controller (memory sync ctrl) as an example in Figure 6), a second memory controller 2022 (taking a memory asynchronous controller (memory async ctrl) as an example in Figure 6), and a coherency address circuit 2023.
[0067] Among them, the interface 201 can send the first access message to the memory sync ctrl when it is determined that the received first access message supports the first protocol; the first memory controller 2021 is specifically used to parse the first access message according to the first protocol to obtain the first access address; the interface 201 can also send the second access message to the memory sync ctrl when it is determined that the received second access message supports the first protocol; the first memory controller 2021 is specifically used to parse the second access message according to the first protocol to obtain the second access address; then, the consistency address circuit 2023 accesses the corresponding storage medium according to the first access address or the second access address. Alternatively, the interface 201 can send the first access message to the memory async ctrl when it is determined that the received first access message supports the second protocol; the second memory controller 2022 is specifically used to parse the first access message according to the second protocol to obtain the first access address; the interface 201 can also send the second access message to the memory async ctrl when it is determined that the received second access message supports the second protocol; the second memory controller 2022 is specifically used to parse the second access message according to the second protocol to obtain the second access address; then, the consistency address circuit 2023 accesses the corresponding storage medium according to the first access address or the second access address. Among them, the consistency address circuit 2023 performs memory synchronization and memory asynchronous access according to the first access address or the second access address, and can solve memory synchronization and memory asynchronous access, for example, by preserving order (for example, building a first in first out (FIFO) queue), so that the same address can be accessed simultaneously based on memory synchronization semantics and memory asynchronous semantics.
[0068] The first access message provided by the embodiment of the present application includes an access request for any of the following operations: read, write, data exchange SWAP, data copy COPY, link building, and enumeration. Based on the address mapping relationship diagram of the memory address space shown in Figure 5 above, the storage module 130 supports receiving the access message of the host system to complete the data exchange SWAP and data copy COPY functions between the slow storage medium and the fast storage medium in the storage module. For example: the storage module 103-a supports receiving the command (src VA (source virtual address) + dst VA (destination virtual address) + len (length)) of the host system to complete the data exchange SWAP and data copy COPY between the fast storage medium and the slow storage medium, the fast storage medium and the fast storage medium, and the slow storage medium and the slow storage medium of the storage module 103-a, wherein the command can be a customized NVMe IO command.
[0069] In Figure 5, when multiple storage modules (130-a and 130-b) are included, the different storage modules (130-a and 130-b) are uniformly mounted on the same host system, and the host system has visibility into the global memory address space. The storage modules then support receiving host commands (src VA + dst VA + len) to complete data exchange (SWAP) and data copying between fast and slow storage media, fast and fast storage media, and slow and slow storage media, between the storage modules. It is understood that when performing data exchange (SWAP) and data copying between storage modules, the src VA and dst VA are mapped to different storage modules. In this way, the fast and slow storage media of the storage modules are distinguished by different address segments, allowing the host system to store data in different regions according to the business data. The host system can also complete data exchange and data copying between the slow and fast storage media as needed, ensuring controllable business access latency.
[0070] In addition, referring to Figure 7, taking the above-mentioned memory synchronization controller 2021 using a CXL controller and the memory asynchronous controller 2022 using an NVMe controller as an example, of course, in the example shown in Figure 7, the processing circuit 202 also includes more controllers 2024 that support other protocols (for example, supporting CXL.io protocol, PCIe bar protocol). In this way, interface 201 (PCIe EP) of the storage module 103 is responsible for identifying the protocol type supported by the received message (CXL.mem protocol, CXL.io protocol, PCIe bar protocol, and NVMe protocol, etc.), and forwarding it to different controllers for processing according to the supported protocols. The controller then accesses the storage medium corresponding to the mapped storage address through the consistency address circuit, thereby realizing CXL management functions (disk scanning, etc.), synchronous IO functions (such as CXL.mem Rd / Wr), NVMe protocol management functions (identification, etc.), and asynchronous IO functions (custom IO commands, such as Trim cleaning, Format formatting, and other storage module management extension functions); in this way, the storage module can support the functions of the CXL protocol while reusing various mature functions of the NVMe protocol.
[0071] In addition, in some examples, as shown in FIG8 , storage module 130 simultaneously supports mapping fast storage media and slow storage media to the host system's memory address space via the CXL.io protocol, the CXL.mem protocol, and the PCIe bar protocol. In FIG8 , the CXL.io protocol maps the fast storage media to the address segment VA-F1(1) in the host system's memory address space, and maps the slow storage media to the address segment VA-S1(1) in the host system's memory address space. The CXL.mem protocol maps the fast storage media to the address segment VA-F1(2) in the host system's memory address space, and maps the slow storage media to the address segment VA-S1(2) in the host system's memory address space. The PCIe bar maps the fast storage medium to the address segment VA-F1(3) in the memory address space of the host system, and maps the slow storage medium to the address segment VA-S1(3) in the memory address space of the host system. The NVMe protocol maps the fast storage medium to the address segment VA-F1(4) in the memory address space of the host system, and maps the slow storage medium to the address segment VA-S1(4) in the memory address space of the host system.
[0072] In this way, address segments VA-F1(1), VA-F1(2), VA-F1(3) and VA-F1(4) are all mapped to the address segment VA-F1 of the fast storage address, and address segments VA-S1(1), VA-S1(2), VA-S1(3) and VA-S1(4) are all mapped to the address segment VA-S1 of the slow storage address. Then, the host system can re-image the above multiple address segments to the unique memory address space visible to the CPU through the virtual memory service (VMS). In addition, the storage module supports PCIe single-port and dual-port modes; and in the dual-port mode, each port can be configured with the same fast storage medium and slow storage medium or different fast storage medium and slow storage medium.
[0073] 9 , based on the above-mentioned memory controller, a memory access method is also provided, the method comprising the following steps:
[0074] S101: Receive a first access message and a second access message from a host system.
[0075] S102: Map a first access address of a first access message to a first storage address in a memory address space of a host system; and access the first storage medium according to the first storage address.
[0076] If the first access message supports the first protocol, before step S102, the method further includes: parsing the first access message according to the first protocol to obtain a first access address; if the first access message supports the second protocol, before step S102, the method further includes: parsing the first access message according to the second protocol to obtain the first access address; wherein the second protocol is an asynchronous access protocol. The first protocol is a synchronous access protocol, and the second protocol is an asynchronous access protocol.
[0077] S103: Map the second access address of the second access message to a second storage address in the memory address space of the host system; and access the second storage medium according to the second storage address.
[0078] If the second access message supports the first protocol, before step S103, the method further includes: parsing the second access message according to the first protocol to obtain a second access address; if the second access message supports the second protocol, before step S103, the method further includes: determining to parse the second access message according to the second protocol to obtain a second access address; wherein the second protocol is an asynchronous access protocol. The first protocol includes any of the following: the Computing Express Interconnect Storage (CXL.mem) protocol, the Computing Express Interconnect Storage (CXL.io) protocol, the PCIe (PCIe) bar protocol, and other custom synchronous access protocols. The second protocol includes any of the following: the Non-Volatile Express (NVMe) protocol, and other custom asynchronous access protocols.
[0079] It can be understood that the above-mentioned memory access method is applied to the above-mentioned memory controller, so the technical effects of the corresponding description can be directly related to the relevant description of the memory controller, which will not be repeated here.
[0080] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A memory controller, characterized in that: The memory controller is connected to the host system and the memory respectively; the memory includes a first storage medium and a second storage medium, and the access speed of the first storage medium is greater than the access speed of the second storage medium; the memory controller includes an interface and a processing circuit; The interface is used to receive a first access message and a second access message from the host system; The processing circuit is configured to map a first access address of the first access message to a first storage address in a memory address space of the host system, and access the first storage medium according to the first storage address; The processing circuit is further configured to map a second access address of the second access message to a second storage address in the memory address space of the host system, and access the second storage medium according to the second storage address.
2. The memory controller according to claim 1, wherein: The storage address of the first storage medium belongs to a first address segment in the memory address space, and the storage address of the second storage medium belongs to a second address segment in the memory address space, and the first address segment and the second address segment are different.
3. The memory controller according to claim 1 or 2, characterized in that: The first access message supports a first protocol; The processing circuit is further configured to parse the first access message according to the first protocol to obtain the first access address, wherein the first protocol is a synchronous access protocol.
4. The memory controller according to claim 1 or 2, characterized in that: The second access message supports a first protocol; The processing circuit is further configured to parse the second access message according to the first protocol to obtain the second access address, wherein the first protocol is a synchronous access protocol.
5. The memory controller according to claim 3 or 4, characterized in that: The first protocol includes any one of the following: a computing fast interconnect storage protocol, a computing fast interconnect storage interface protocol, a high-speed serial computer expansion bus protocol, and other custom synchronous access protocols.
6. The memory controller according to claim 1 or 2, characterized in that: The first access message supports a second protocol; The processing circuit is further configured to parse the first access message according to the second protocol to obtain the first access address, wherein the second protocol is an asynchronous access protocol.
7. The memory controller according to claim 1 or 2, characterized in that: The second access message supports a second protocol; The processing circuit is further configured to parse the second access message according to the second protocol to obtain the second access address, wherein the second protocol is an asynchronous access protocol.
8. The memory controller according to claim 6 or 7, characterized in that: The second protocol includes any one of the following: a non-volatile high-speed transmission bus protocol, and other custom asynchronous access protocols.
9. The memory controller according to any one of claims 1 to 8, characterized in that: The first storage medium includes any one of the following random access memories: dynamic random access memory, static random access memory, ferroelectric random access memory and magnetic random access memory; the second storage medium includes flash memory.
10. The memory controller according to any one of claims 1 to 9, characterized in that: The first access request includes an access request for any of the following operations: reading, writing, data exchange, data copying, link building, and enumeration.
11. A method for accessing a memory, applied to a memory controller, wherein the memory controller is connected to a host system and the memory, respectively, and characterized in that: The memory includes a first storage medium and a second storage medium; The access speed of the first storage medium is greater than the access speed of the second storage medium; the method comprises: receiving a first access message and a second access message from the host system; Mapping a first access address of the first access message to a first storage address in a memory address space of the host system, and accessing the first storage medium according to the first storage address; Map a second access address of the second access message to a second storage address in the memory address space of the host system, and access the second storage medium according to the second storage address.
12. The memory access method according to claim 11, characterized in that: The storage address of the first storage medium belongs to a first address segment in the memory address space, and the storage address of the second storage medium belongs to a second address segment in the memory address space, and the first address segment and the second address segment are different.
13. The memory access method according to claim 11 or 12, characterized in that: The first access message supports a first protocol, and the method further includes: parsing the first access message according to the first protocol to obtain the first access address; wherein the first protocol is a synchronous access protocol.
14. The memory access method according to claim 11 or 12, characterized in that: The second access message supports a first protocol, and the method further includes: parsing the second access message according to the first protocol to obtain the second access address; wherein the first protocol is a synchronous access protocol.
15. The memory access method according to claim 13 or 14, characterized in that: The first protocol includes any one of the following: a computing fast interconnect storage protocol, a computing fast interconnect storage interface protocol, a high-speed serial computer expansion bus protocol, and other custom synchronous access protocols.
16. The memory access method according to claim 11 or 12, characterized in that: The first access message supports a second protocol, and the method further includes: The first access message is parsed according to the second protocol to obtain the first access address; wherein the second protocol is an asynchronous access protocol.
17. The memory access method according to claim 11 or 12, characterized in that: The second access message supports a second protocol, and the method further includes: The second access message is parsed according to the second protocol to obtain the second access address; wherein the second protocol is an asynchronous access protocol.
18. The memory access method according to claim 16 or 17, characterized in that: The second protocol includes any one of the following: a non-volatile high-speed transmission bus protocol, and other custom asynchronous access protocols.
19. The memory access method according to any one of claims 11 to 18, characterized in that: The first storage medium includes any one of the following random access memories: dynamic random access memory, static random access memory, ferroelectric random access memory and magnetic random access memory; the second storage medium includes flash memory.
20. The memory access method according to any one of claims 11 to 19, characterized in that: The first access request includes an access request for any of the following operations: reading, writing, data exchange, data copying, link building, and enumeration.
21. A storage module, characterized in that: include: A memory and a memory controller as claimed in any one of claims 1 to 10.
22. An electronic device, characterized in that: include: A processor and a storage module as claimed in claim 21; The processor is configured to generate the first access message and the second access message.
23. The electronic device according to claim 22, characterized in that: Also includes main memory; The processor is further configured to generate a third access message, and access the main memory according to a third access address of the second access message; the third access address belongs to the memory address space of the host system.
24. The electronic device according to claim 23, characterized in that: The memory address space includes a first address range and a second address range; the first access address and the second access address belong to the first address range, and the third access address belongs to the second address range, wherein the first address range and the second address range are different.
Citation Information
Patent Citations
Data processing method and device based on distributed shared memory system
CN113590364A
Data processing method, data processing system and computer readable storage medium
CN114780037A
Method and device for expanding memory and related equipment
CN115794669A
Method for accessing device memory, method for managing device memory, device and medium
CN116185910A
Workload scheduler for memory allocation
US20200192715A1
Cited By
Data processing method, memory, electronic equipment and storage medium
CN120085814A
A data processing method, a memory, an electronic device, and a storage medium
CN120085814B
Memory expansion and memory access
WO2026189110A1
