Memory controller, access method of memory, storage module and electronic equipment
By using both fast and slow storage media in the memory controller and using processing circuits for address mapping, the cost and management complexity issues in the memory wall problem are solved, enabling flexible access patterns and reducing the waste of computing resources.
Patent Information
- Application Number
- CN202310380108.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
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 CXL) storage module only contains high-cost fast storage media and cannot effectively reduce equipment costs.
Design a memory controller that uses both fast storage media and slow storage media, and uses processing circuits to map the address of the access message to the memory address space of the host system to achieve access to both types of storage media, reduce equipment costs, and Supports synchronous and asynchronous access protocols and provides flexible access modes.
It realizes the expansion of memory capacity in a simple way while taking into account costs, reduces the complexity of host system storage management, and solves the problem of wasting computing resources caused by synchronous access to slow storage media.
Smart Images

Figure CN118732935A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] Due to the widespread application of artificial intelligence (AI) and machine learning (ML), businesses are increasingly demanding memory capacity. Due to capacity and cost limitations, the growth rate of traditional double-data-rate dual-inline-memory-modules (DDR DIMMs) does not match the growth rate of central processing unit (CPU) computing power, which does not meet the needs of system applications and forms a serious memory wall problem. In order to solve the memory wall problem, major Internet technology (IT) manufacturers have proposed different solution technologies, and compute express link (CXL) is currently the mainstream technology for solving memory expansion.
[0003] Typically, a CXL-based storage module includes a CXL controller that is connected to a full DDR or DDR-like fast storage medium. The host system accesses fast storage media such as DDR by computing the fast link storage CXL.mem protocol. This type of storage module only contains non-persistent (volatile) fast storage media, and does not contain persistent (non-volatile) slow storage media, such as Flash. When this type of storage module expands memory capacity, the expanded memory usually also uses fast storage media. Since the storage media in the storage module are all high-cost fast storage media such as DDR or DDR Like, it is not conducive to cost control. Summary of the invention
[0004] 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 way while taking cost into consideration.
[0005] 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, and the access speed of the first storage medium is greater than the access speed of 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.
[0006] 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.
[0007] 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 from the host system by the interface. Since the memory uses both the fast storage medium and the slow storage medium, the device cost can be reduced. In addition, the processing circuit can 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 storage management of the host system.
[0008] 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, and the host system can complete the data exchange between the slow storage medium and the fast storage medium as needed, ensuring that the business access delay is controllable.
[0009] 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 a first access address or a second access address, wherein the first protocol is a synchronous access protocol.
[0010] 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 a second access address, wherein the first protocol is a synchronous access protocol.
[0011] 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 a first access address or a second access address, wherein the second protocol is an asynchronous access protocol.
[0012] 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 a second access address, wherein the second protocol is an asynchronous access protocol.
[0013] The storage module supports both synchronous access and asynchronous access, providing services 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.
[0014] In a possible implementation, the first protocol includes any one of the following: a computing fast interconnect storage CXL.mem protocol, a computing fast interconnect storage interface CXL.io protocol, a high-speed serial computer expansion bus PCIe bar protocol, and other custom synchronous access protocols.
[0015] In one possible implementation, the second protocol includes any of the following: a non-volatile high-speed transmission bus NVMe protocol, and other custom asynchronous access protocols.
[0016] 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.
[0017] In a possible implementation, the first access request includes an access request for any of the following operations: read, write, data exchange SWAP, data copy COPY, link building, and enumeration. The host system completes data exchange and data copy between the slow storage medium and the fast storage medium as needed, which can ensure that the service access delay is controllable.
[0018] In a second aspect, a method for accessing a memory is provided, which is applied to a memory controller, wherein the memory controller is connected to a host system and a memory, respectively, and the memory includes a first storage medium and a second storage medium; an access speed of the first storage medium is greater than an access speed of the second storage medium; the method includes: 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.
[0019] In a possible implementation, the storage address of the first storage medium belongs to a first address segment in the memory address space, 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.
[0020] 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.
[0021] 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.
[0022] In a possible implementation, the first protocol includes any one of the following: a computing fast interconnect storage CXL.mem protocol, a computing fast interconnect storage interface CXL.io protocol, a high-speed serial computer expansion bus PCIe bar protocol, and other custom synchronous access protocols.
[0023] 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.
[0024] 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.
[0025] In one possible implementation, the second protocol includes any of the following: a non-volatile high-speed transmission bus NVMe protocol, and other custom asynchronous access protocols.
[0026] 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.
[0027] In a possible implementation, the first access request includes an access request for any of the following operations: read, write, data exchange SWAP, data copy COPY, link creation, and enumeration.
[0028] 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.
[0029] 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.
[0030] In a possible implementation, it also includes a main memory; the processor is further used 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.
[0031] 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.
[0032] 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
[0033] Figure 1 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0034] Figure 2 A schematic diagram of the structure of a storage module provided in another embodiment of the present application;
[0035] Figure 3 A structural schematic diagram of a storage module provided for another embodiment of the present application;
[0036] Figure 4 A schematic diagram of the structure of a storage module provided in yet another embodiment of the present application;
[0037] Figure 5 A schematic diagram of a mapping relationship of a memory address space provided for an embodiment of the present application;
[0038] Figure 6 A schematic diagram of the structure of a storage module provided in another embodiment of the present application;
[0039] Figure 7 A structural schematic diagram of a storage module provided for another embodiment of the present application;
[0040] Figure 8 A schematic diagram of a mapping relationship of a memory address space provided for another embodiment of the present application;
[0041] Fig. 9 A flowchart of a method for accessing a memory provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following is an explanation of some of the terms involved in the embodiments of the present application:
[0043] 1) Storage media: including: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code. Usually, fast storage media refers to storage media with faster file access (read and write) speed, and slow storage media refers to storage media with slower file access (read and write) speed. In the embodiments of the present application, the access speed of the fast storage medium is higher than the access speed of the slow storage medium. Therefore, in some examples, the fast storage medium can be RAM or other new fast storage media. In the following examples, double-data-rate synchronous dynamic random access memory (DDR SDRAM, referred to 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., for example, 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.
[0044] 2) Other terms
[0045] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with substantially identical functions and effects. For example, the first storage medium and the second storage medium are only used to distinguish between different storage media, and do not limit their order. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.
[0046] 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 more advantageous than other embodiments or designs. Specifically, 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. Exemplarily, the same circuit can selectively implement one or more of the multiple functions at different stages.
[0047] In the embodiments of the present application, the description of the electronic device architecture is for more clearly illustrating the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided by the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the electronic device architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0048] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" 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: A exists alone, A and B exist at the same time, and B exists 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" or similar expressions refers to any combination of these items, including any combination of single 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.
[0049] The following, combined Figure 1 and Figure 2, illustrating the electronic device provided by the embodiment of the present application. 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.
[0050] The processor 110 may be a 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 a double-data-ratedual-inline-memory-modules (DDR DIMM) 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 of the processor 110.
[0051] Due to the widespread application of artificial intelligence (AI) and machine learning (ML), businesses are increasingly demanding memory capacity. Due to capacity and cost limitations, the growth rate of memory capacity of traditional double-data-rate dual-inline-memory-modules (DDR DIMM) does not match the growth rate of central processing unit (CPU) computing power, which cannot meet the needs of system applications and forms a serious memory wall problem. In order to solve the memory wall problem, major Internet technology (IT) manufacturers have proposed different solution technologies. Compute Express Link (CXL) is currently the mainstream technology for solving memory expansion. Usually, referring to Figure 1 As shown, the electronic device also includes a memory module 130; Figure 2 As shown, the storage module 130 may include an interface 131 (in Figure 2In the example of the high-speed serial computer expansion bus standard peripheral component interconnect express (PCIe) leaf node (end point, EP) interface), CXL controller 132 (also referred to as CXL ctrl) and fast storage medium 133 (in Figure 2 The medium may be a fast storage medium such as DDR or DDR-like medium. In some examples, the interface 131 and the CXL controller 132 together constitute a memory controller.
[0052] 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.
[0053] When accessing the fast storage medium 133, the CXL controller 132 may 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 system memories for storing a plurality of pieces of operation data or outputting the stored plurality of pieces of operation data under the control of the processor 110. The electronic device 100 may include one or more storage modules 130. The storage module 130 may store data or output the stored data through the CXL interface according to the access control of the processor 110. That is, the processor 110 may use the storage module 130 as a storage area having a function similar to that of the main memory 120, thereby realizing the expansion of the main memory 120.
[0054] However, this storage module 130 only includes fast storage media 133, and does not include slow storage media that can be persistent, such as Flash. When this type of storage module 130 is used to expand the memory capacity, the expanded memory is usually also a fast storage medium. Since the storage media in the storage module are all high-cost fast storage media such as DDR or DDR Like, it is not conducive to cost control.
[0055] In addition, the electronic device 100 may include a solid state drive (SSD) 140. Figure 1 In the embodiment, the processor 110, the storage module 130 and the SSD 140 can communicate with each other through the system bus (BUS). Figure 1 The electronic device 100 shown is only an example. In some examples, the components connected to the BUS may include more modules or devices.
[0056] In some implementations, in order to reduce costs, reference Figure 3 As shown, the CXL controller 132 is connected to a small amount of fast storage media 133 (such as DDR) as a cache. When expanding the memory capacity, the CXL controller 132 uses the PCIe root node (RP) interface in the interface 131 to connect the standard SSD controller 135 (for example: non-volatile memory express (NVMe) controller) to access the slow storage medium 136 (for example, Flash). In this method, DDR exists as a cache of the slow storage medium Flash, and the host system accesses DDR through the CXL.mem protocol; wherein, during the access process, the host system mainly accesses DDR based on the linear address (also called virtual address) of the memory semantics. At the same time, Flash can be accessed by the host system based on the logical block address (LBA) through the NVMe protocol. In this way, the entire storage module 130 has the linear address and LBA access of the memory semantics. Since the cost of the slow storage medium is relatively low, the hybrid mode of fast storage medium + slow storage medium is adopted to reduce the cost of the storage module. However, when the host system uses the CXL.mem protocol to access DDR, if a cache miss occurs, it is necessary to obtain data from the Flash through the PCIe RP. Since the cache is controlled by the storage module, the system cannot predict in advance, which will cause the system access time to be uncontrollable. In addition, Flash is still based on LBA access on the host system side. In this way, it is necessary to manage both the linear address space of the DDR memory semantics and the LBA address space, which makes system management complicated.
[0057] Therefore, how to achieve memory expansion in a simpler way while taking cost into consideration becomes a problem that needs to be solved.
[0058] Reference Figure 4 As shown, a storage module 130 is provided, wherein the storage 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.
[0059] The memory 300 includes a first storage medium 301 ( Figure 4 The fast storage medium is used as an example) and the second storage medium 302 ( Figure 4 In the example of the slow storage medium, 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 .
[0060] Interface 201 is used to receive an access message from a host system (for example, a first access message and a second access message at the same time or at different times); wherein, reference is made to Figure 1 As shown, the first access message and the second access message can 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 the 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 the 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.
[0061] 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. Figure 5As shown in the schematic diagram of the address mapping relationship of the memory address space, it can be seen that when the electronic device has two storage modules (130-a and 130-b), the solution provided based on the embodiment of the present application can map the storage address of the fast storage medium of the 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 the 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 the storage module 130-b to the virtual address segment VA-F2 of the memory address space; map the storage address of the slow storage medium of the storage module 130-b to the virtual address segment VA-S2 of the memory address space; in addition, for the main memory 120 ( Figure 5 In the example of DIMM, the storage address is mapped to the virtual address segment VA-D of the memory address space. In addition, the processor 110 may 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 above-mentioned 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.
[0062] 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 from the host system by the interface. Since the memory uses both the fast storage medium and the slow storage medium, the device cost can be reduced. In addition, the processing circuit can 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 storage management of the host system.
[0063] 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 fast interconnect storage CXL.mem protocol, computing fast interconnect storage interface CXL.io protocol, high-speed serial computer expansion bus PCIebar 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 access and asynchronous access, providing services 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.
[0064] exist Figure 6 In the embodiment, the processing circuit 202 may specifically include: a first memory controller 2021 ( Figure 6 In the example of memory synchronization controller (memory sync ctrl), the second memory controller 2022 ( Figure 6 Take the memory asynchronous controller (memoryasync ctrl) as an example), and the coherency address circuit 2023.
[0065] 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, through order-preserving processing (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.
[0066] 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 the above 5, 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 of the host system (src VA (source virtual address) + dst VA (destination virtual address) + len (length)) 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 of the storage module 103-a, wherein the command can be a customized NVMe IO command.
[0067] exist Figure 5In the embodiment, when multiple storage modules (130-a and 130-b) are included, different storage modules (130-a and 130-b) are uniformly mounted under the same host system, and the host system is visible to the global memory address space. Then, the storage module supports receiving host commands (src VA+dst VA+len) to complete data exchange SWAP and data copy COPY between fast storage media and slow storage media, fast storage media and fast storage media, and slow storage media and slow storage media between storage modules. It can be understood that when data exchange SWAP and data copy COPY are performed between storage modules, src VA and dstVA are mapped to different storage modules respectively. In this way, the fast storage medium and slow storage medium of the storage module are distinguished by different address segments, which allows the host system to store in different regions according to the business data situation, and the host system completes data exchange and data copy between the slow storage medium and the fast storage medium as needed, which can ensure that the business access delay is controllable.
[0068] In addition, refer to Figure 7 As shown, taking the above memory synchronization controller 2021 using a CXL controller and the memory asynchronous controller 2022 using an NVMe controller as an example, of course, in Figure 7 In the example shown, the processing circuit 202 also includes more controllers 2024 that support other protocols (for example, supporting CXL.io protocol and PCIe bar protocol). In this way, the 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.), forwarding different controllers for processing according to the supported protocols, and having the controller access the storage medium corresponding to the mapped storage address via 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 storage module management extension functions such as cleaning Trim and formatting Format), etc.; in this way, the storage module can reuse various mature functions of the NVMe protocol while supporting the functions of the CXL protocol.
[0069] In addition, in some examples, reference Figure 8 As shown, the storage module 130 supports mapping fast storage media and slow storage media to the memory address space of the host system through the CXL.io protocol, the CXL.mem protocol and the PCIe bar protocol. Figure 8In the CXL.io protocol, the fast storage medium is mapped to the address segment VA-F1(1) in the memory address space of the host system, and the slow storage medium is mapped to the address segment VA-S1(1) in the memory address space of the host system. The CXL.mem protocol maps the fast storage medium to the address segment VA-F1(2) in the memory address space of the host system, and the slow storage medium is mapped to the address segment VA-S1(2) in the memory address space of the host system. 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 the slow storage medium is mapped 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 the slow storage medium is mapped to the address segment VA-S1(4) in the memory address space of the host system.
[0070] 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, and 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.
[0071] Reference Fig. 9 As shown, based on the above memory controller, a memory access method is also provided, the method comprising the following steps:
[0072] S101: Receive a first access message and a second access message from a host system.
[0073] 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.
[0074] 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 the 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. wherein the first protocol is a synchronous access protocol, and the second protocol is an asynchronous access protocol.
[0075] S103: 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 a second storage medium according to the second storage address.
[0076] If the second access message supports the first protocol, before step S103, it also includes: parsing the second access message according to the first protocol to obtain the second access address; if the second access message supports the second protocol, before step S103, it also includes: determining 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. The first protocol includes any of the following: computing fast interconnect storage CXL.mem protocol, computing fast interconnect storage interface CXL.io protocol, high-speed serial computer expansion bus PCIe bar protocol and other custom synchronous access protocols. The second protocol includes any of the following: non-volatile high-speed transmission bus NVMe protocol, and other custom asynchronous access protocols.
[0077] 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.
[0078] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope 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
Cited By
Data processing method, memory, electronic equipment and storage medium
CN120085814A
