Method and apparatus for caching address mapping information in flash memory based storage devices
By caching the node index and L2P address of the G2F mapping table in the SRAM of the flash memory controller, the performance problem caused by frequent G2F mapping table lookups is solved, improving the read/write performance and processing efficiency of the flash memory.
Patent Information
- Application Number
- CN202211357247.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-14
- Filing Date
- 2022-11-01
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-11-01
AI Technical Summary
The read/write performance of existing flash memory is negatively affected by frequent G2F mapping table lookups, resulting in prolonged response time. A more efficient address mapping information loading and caching method is needed.
The node index and L2P address of the G2F mapping table are cached in the SRAM of the flash memory controller to avoid frequent lookups of the G2F mapping table and directly obtain the L2P address from the SRAM for operation.
It improves the read and write performance of flash memory, reduces the address update time for host data writing, and enhances processing efficiency.
Smart Images

Figure CN116795279B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to flash memory, and more particularly to a method for caching address mapping information and a related flash memory controller used in a flash memory-based storage device. Background Technology
[0002] Generally, flash memory controllers rely on logical-to-physical (L2P) mapping tables to translate the logical addresses of host read / write commands into physical addresses on the flash memory. The L2P mapping table is typically continuously stored in the flash memory and loaded into the flash memory controller's dynamic random access memory (DRAM) when a host read / write command is processed. Due to the limited capacity of the DRAM and the considerable size of the L2P mapping table, only a portion of the L2P mapping table (e.g., a group or several mappings) is loaded into the DRAM each time a host read / write command is processed. Therefore, a group-to-flash (G2F) mapping table is needed to record the physical addresses of the groups containing the latest data from the L2P mappings. The G2F mapping table needs to be consulted frequently for host random read / write commands. For example, the G2F mapping table needs to be consulted first to determine if the required L2P mapping has been loaded into DRAM, and then the G2F mapping table needs to be consulted again to determine where the required L2P mapping group is stored in DRAM. For host write commands, the G2F mapping table needs to be consulted to modify the L2P address of the host write data when moving the host write data to a different physical location (e.g., flash memory or data cache). Frequent consultation of the G2F mapping table can negatively impact the response time of processing host read / write commands, leading to a degrade in flash memory read / write performance. Therefore, an innovative method is needed to more efficiently load and cache L2P mapping information. Summary of the Invention
[0003] In view of this, the object of the present invention is to provide a method for loading and caching address mapping information in a flash memory-based storage device. In embodiments of the present invention, the node index obtained from the G2F mapping table (which indicates the entity address of the mapping relationship group in the L2P mapping table) is cached in the SRAM of the flash memory controller. This avoids repeatedly consulting the G2F mapping table when processing host random read / write commands. Furthermore, in embodiments of the present invention, the L2P address corresponding to the host write command data is cached in an L2P address array stored in the SRAM of the flash memory controller, which significantly reduces the time spent updating the L2P address of the host write data during the movement of host write data between the flash memory controller and the flash memory.
[0004] Embodiments of the present invention provide a method for caching address mapping information in a flash memory device. The flash memory device includes a flash memory controller and a flash memory. The method includes: in response to a host read / write command, consulting a group-to-flash (G2F) mapping table to determine whether a logical-to-physical (L2P) mapping group required for processing the host read / write command has been loaded into a dynamic random access memory (DRAM) of the flash memory controller, and obtaining a node index thereon, wherein the L2P mapping group is part of an L2P mapping table, and the node index indicates which memory node (memory mode) of the DRAM stores the required L2P mapping group; and recording the node index into a static random access memory (SRAM) of the flash memory controller. In a first region of the flash memory (SRAM); without consulting the G2F mapping table, by consulting the node index stored in the first region of the SRAM, the DRAM is accessed to obtain an L2P address from the required L2P mapping set, wherein the L2P address points to an entity address associated with the host read / write command; and a read / write operation is performed on the flash memory based on the obtained L2P address to respond to the host read / write command.
[0005] Embodiments of the present invention provide a flash memory controller for accessing a flash memory. The flash memory controller includes: a storage unit, a dynamic random access memory (DRAM), a static random access memory (SRAM), and a processing unit. The storage unit is used to store information and program code. The processing unit can execute the program code to perform the following actions in response to a host read / write command: consulting a group-to-flash (G2F) mapping table to determine whether a logical-to-physical (L2P) mapping group required for processing the host read / write command has been loaded into the DRAM; obtaining a node index thereon, wherein the L2P mapping group is part of an L2P mapping table, and the node index indicates which memory node in the DRAM stores the required L2P mapping group; recording the node index in a first region of the SRAM; accessing the DRAM to obtain an L2P address from the required L2P mapping group by consulting the node index stored in the first region of the SRAM without consulting the G2F mapping table, wherein the L2P address indicates a physical address associated with the host read / write command; and performing a read / write operation on the flash memory based on the obtained L2P address in response to the host read / write command. Attached Figure Description
[0006] Figure 1 This is a schematic diagram of the architecture of the flash memory device and flash memory controller according to an embodiment of the present invention.
[0007] Figure 2 This is a schematic diagram of the internal memory architecture of the flash memory controller according to an embodiment of the present invention.
[0008] Figure 3 This illustration shows how an embodiment of the present invention caches a group of L2P mapping relationships in an L2P mapping table.
[0009] Figure 4 This illustration shows how another embodiment of the invention caches a group of L2P mapping relationships in an L2P mapping table.
[0010] Figure 5 This is a flowchart of a preload phase for processing host read / write commands in an embodiment of the present invention.
[0011] Figure 6This is a flowchart of a load status check phase for processing host read / write commands in an embodiment of the present invention.
[0012] Figure 7 This is a flowchart of a command service stage for processing host read commands in an embodiment of the present invention.
[0013] Figure 8 This is a flowchart of a command service stage for processing host write commands in an embodiment of the present invention.
[0014] Figure 9 This is a flowchart of a method for processing host read command loading and cache address mapping information in an embodiment of the present invention.
[0015] [Symbol Explanation]
[0016] 10 Electronic devices
[0017] 50 Main Units
[0018] 52 processor
[0019] 100 memory devices
[0020] 110 Memory Controller
[0021] 120 NV memory
[0022] 122_1~122_N NV memory elements
[0023] 112 Processing Units
[0024] 112C program code
[0025] 112M Read-Only Memory
[0026] 113 Internal Memory
[0027] 114 Control Logic Circuit
[0028] 118 Transmission Interface Circuit
[0029] 1131 DRAM
[0030] DRAM region 1131_1~1131_2
[0031] 1132 Shared SRAM
[0032] 1132_1~1131_3 Shared SRAM region
[0033] 1133 L1 Cache
[0034] 1134 L2 Cache
[0035] Steps S101~S107, S201~S214, S301~S308, S401~S407, S510~S540 Detailed Implementation
[0036] Numerous specific details are described below to provide the reader with a thorough understanding of embodiments of the invention. However, those skilled in the art will appreciate how the invention can be implemented in the absence of one or more specific details, or by utilizing other methods, elements, or materials. In other instances, well-known structures, materials, or operations are not shown or described in detail to avoid obscuring the core concepts of the invention.
[0037] The phrase "in one embodiment" in this specification means that a particular feature, structure, or characteristic described in that embodiment may be included in at least one embodiment of the invention. Therefore, the phrase "in one embodiment" appearing throughout this specification does not necessarily mean the same embodiment. Furthermore, the aforementioned particular features, structures, or characteristics may be combined in any suitable form in one or more embodiments.
[0038] Figure 1 This is a schematic diagram of the architecture of an electronic device 10 according to an embodiment of the present invention. As shown, the electronic device 10 includes a host device 50 and a memory device 100. The host device 50 may include a random access memory (RAM) 54 and at least one processor 52 for controlling the operation of the host device 50. In different embodiments, the host device 50 may be (but is not limited to): a smartphone, tablet computer, wearable device, personal computer, laptop computer, digital camera, digital video recorder, game console, car navigation system, printer, scanner, or server system. In addition, in different embodiments, the memory device 100 may be (but is not limited to): a portable memory device (such as a memory card conforming to SD / MMC, CF, MS, XD, or UFS standards), a solid state drive (SSD), and various embedded storage devices (such as embedded storage devices conforming to UFS or eMMC standards).
[0039] In various embodiments of the present invention, the memory device 100 may include a controller such as a memory controller 110, and may also include non-volatile (NV) memory 120. NV memory 120 is used to store information. NV memory 120 may include one or more NV memory elements, for example, a plurality of NV memory elements 122_1 to 122_N. Furthermore, NV memory 120 may be flash memory, and NV memory elements 122_1 to 122_N may be a plurality of flash memory wafers or a plurality of flash memory dies, but the present invention is not limited thereto. Additionally, NV memory 120 may include memory cells with a two-dimensional structure, or may include memory cells with a three-dimensional structure.
[0040] like Figure 1 As shown, the memory controller 110 may include processing circuitry such as a processing unit 112 (which may further include multiple processor cores for executing different tasks simultaneously), storage elements such as read-only memory (ROM) 112M, control logic circuitry 114, internal memory 113, and transmission interface circuitry 118. At least some (e.g., some or all) of these elements may be interconnected via a bus. The internal memory 113 may be implemented using random access memory (RAM), for example, it may include static random access memory (SRAM) and dynamic random access memory (DRAM). The internal memory 113 may be configured to provide internal storage space to the memory controller 110, for example, temporarily storing variables and data. Furthermore, in this embodiment, the read-only memory 112M is used to store program code 112C, and the processing unit 112 is used to execute program code 112C, thereby controlling access to the NV memory 120. Alternatively, program code 112C can also be stored in NV memory 120.
[0041] The memory controller 110 controls the reading, writing, and erasing of the NV memory 120 via control logic circuitry 114. Furthermore, the memory controller 110 can simultaneously execute user data writing based on host commands from the host device 50, and collect valid data from the NV memory 120 through garbage collection or wear-leveling operations, writing the valid data to different storage spaces within the NV memory 120. The control logic circuitry 114 can further be used to control the NV memory 120, and includes error correction code (ECC) circuitry (not shown) to perform data protection and / or correction, but the invention is not limited thereto. The transmission interface circuit 118 conforms to specific data transmission specifications (e.g., Serial Advanced Technology Attachment (SATA) specification, Universal Serial Bus (USB) specification, Peripheral Component Interconnect Express (PCIE) specification, Embedded Multimedia Card (eMMC) specification, or Universal Flash Storage (UFS) specification), and can communicate with the host device 50 according to specific communication specifications.
[0042] Generally, the host device 50 can indirectly access the memory device 100 by sending host commands and corresponding logical addresses to the memory controller 110. The memory controller 110 receives the host commands and logical addresses, translates the host commands into memory operation commands, and further uses the memory operation commands to control the NV memory 120, thereby performing read, write, or erase operations on memory cells or pages with specific physical addresses within the NV memory 120, where the physical address corresponds to the logical address. When the memory controller 110 performs an erase operation on any NV memory element 122_k among NV memory elements 122_1 to 122_N, at least one block in the NV memory element 122_k may be erased. In addition, each block of the NV memory element 122_k may contain multiple pages, and read or write access operations can be performed on one or more pages.
[0043] Figure 2 The architecture of the internal memory 113 according to an embodiment of the present invention is illustrated. For example... Figure 2As shown, the internal memory 113 includes DRAM 1131, shared SRAM 1132, L1 cache 1133, and L2 cache 1134. Specifically, a first region 1131_1 of the DRAM 1131 is configured to store DRAM variables. In one embodiment, the variables stored in the first region 1131_1 may be one or more group-to-flash (G2F) mapping tables, and / or DRAM node information (i.e., indicating the load status of each DRAM node). A second region 1131_2 of the DRAM 1131 is used to store one or more logical-to-physical (L2P) mapping tables.
[0044] Furthermore, the first region 1132_1 of the shared SRAM 1132 is configured for storing variables. For example, the first region 1132_1 can be configured as a request first-in and first-out (FIFO) buffer 1132F. The request FIFO buffer 1132F can be shared by multiple processing cores of the processing unit 112 for data and command exchange. Additionally, the first region 1132_1 can be configured to cache the L2P address array. The second region 1132_2 of the shared SRAM 1132 can be configured as a buffer for caching host write data (i.e., host write data cache). The third region 1132_3 of the shared SRAM 1132 can be configured as a buffer to cache data to be written to the NV memory 120, or to cache data from the L2P mapping group (i.e., a portion of the L2P mapping table) loaded from the NV memory 120. Furthermore, internal memory 113 may include multiple L1 caches 1133 and multiple L2 caches. Each L1 cache 1133 may be dedicated to a processing core and can be used to cache variables in a first region 1132_1 of shared SRAM 1132, and / or cache variables in a first region 1131_1 of DRAM 1131. For example, caching information in the request FIFO buffer 1132F, and caching L2P addresses cached in the L2P address array. Each L2 cache 1134 may be dedicated to a processing core and can be used to cache variables in the first region 1132_1 of shared SRAM 1132, for example, caching L2P values associated with host read / write commands.
[0045] Generally, the host device 50 can provide host read / write commands with logical block addresses (LBAs) to the memory controller 110 through the transmission interface circuit 118 to indicate the address at which data is read from or written to the NV memory 120. However, to optimize data access efficiency, data with consecutive logical block addresses is distributed across different physical regions of the NV memory 120. Therefore, an L2P mapping table is needed to indicate which physical location in the NV memory 120 each piece of data is stored in. The L2P mapping table stores information about the actual physical location of each logical address in the NV memory 120, and this information is arranged in the order of the logical storage addresses. The logical storage address can be represented by an LBA, and each LBA is associated with a fixed-length physical storage space, such as 256K, 512K, or 1024K bytes.
[0046] Furthermore, the L2P mapping table is persistently stored in the NV memory 120. When the memory controller 110 intends to process a host read / write command, the L2P mapping table is loaded into the internal memory 113 to improve address translation efficiency. However, since the L2P mapping table may require up to 1 gigabyte of storage (depending on the actual capacity of the NV memory 120), this size is considerable for the internal memory 113. Therefore, the L2P mapping table is divided into multiple mapping groups. Each time the memory controller 110 executes a host read / write command, only one or more mapping groups (i.e., a portion of the L2P mapping table) are loaded. In one embodiment, each mapping group may contain 1024 L2P entries, where each L2P entry contains a logical address and its corresponding physical address. In the following text, the terms "L2P value" and "L2P address" are used to describe: "Information indicating the physical address in NV memory 120 corresponding to a host read / write command, or the physical address of temporarily stored data in internal memory 113."
[0047] In some embodiments of the present invention, when an LBA (Large Element Class) of a host read command is received, the memory controller 110 checks whether an L2P mapping group corresponding to this LBA has been loaded into the internal memory 113. If yes, the memory controller 110 performs L2P address translation by referring to the loaded L2P mapping group and performs read / write operations on the NV memory 120 accordingly (through control logic circuitry 114). If no, the memory controller 110 loads the L2P mapping group corresponding to the LBA of the host read command into the shared SRAM 1132 and directly accesses the SRAM 1132 to obtain the L2P address required to process the host read command. Please refer to... Figure 3 To further understand the above concepts, such as... Figure 3 As shown, multiple L2P mapping groups in the L2P mapping table can be stored in the storage cells of NV memory 120. If the L2P mapping group required by the LBA for processing host read / write commands has not yet been loaded into internal memory 113, the L2P mapping group will first be loaded into the third region 1132_3 of shared SRAM 1132. Processing unit 112 will directly access the L2P entries to obtain the L2P values required for processing host read commands.
[0048] In some embodiments of the present invention, multiple L2P mapping groups of the L2P mapping table may have been loaded into DRAM 1131. In response to host read / write commands, the present invention obtains the node index by consulting a group-to-flash (G2F) mapping table. The node index indicates which memory element (e.g., memory node) in DRAM 1131 stores the L2P mapping group, as shown in the figure. Figure 4The obtained node indices will be recorded in storage units FIFO_0 to FIFO_x of the request FIFO buffer 1132F. To process host read / write commands, processing unit 112 will access the L2P value associated with the LBA of the host read command by directly consulting the node indices in the request FIFO buffer 1132F, without repeatedly consulting the G2F mapping table. Furthermore, when processing host write commands, processing unit 112 uses the first region 1132_1 of the shared SRAM 1132 to store an L2P address array. As shown, the data Unit_0 to Unit_y of the host write command will be cached in a host write cache, which is actually located in the second region 1132_2 of the shared SRAM 1132. The L2P address array stored in the first region 1132_1 of the shared SRAM 1132 caches the L2P addresses Addr_0 to Addr_y corresponding to the data used for host write commands (hereinafter referred to as host write data). Since the host write data may move between different memories in the internal memory 113, the L2P addresses Addr_0 to Addr_y of the host write data Unit_0 to Unit_y need to be updated frequently to reflect the latest physical addresses. Caches and updates the L2P addresses Addr_0 to Addr_y of the host write data Unit_0 to Unit_y in the L2P address array, which saves more time than directly updating and modifying the L2P mapping table, because updating and modifying the L2P mapping table requires consulting the G2F mapping table.
[0049] The present invention processes host read / write commands from host device 50 through three stages: a pre-loading stage, a loading state checking stage, and a command serving stage. Figure 5A flowchart illustrating the preload phase in an embodiment of the present invention is shown. In the preload phase, one or more L2P mapping sets required to process host read / write commands are loaded and cached in internal memory 113. As shown, the process begins at step S101, which determines whether a host read / write command from host device 50 only requires one set of L2P mapping sets for address translation. If not, the process proceeds to step S102 and then ends. In step S102, the load state in the request FIFO buffer 1132F is set to "No_Prefectch," which means that more than one L2P mapping set needs to be loaded to process the host read / write command. In this case, multiple L2P mapping sets will be loaded into the second region 1131_2 of DRAM 1131, instead of... Figure 3 In the illustrated embodiment, data is directly loaded into the third region 1132_3 of the shared SRAM 1132. If the host read / write command only needs to load one L2P mapping group, the process proceeds to step S103. In step S103, it is determined whether the host read / write command is an aligned 4K read command and whether the required unique L2P mapping group has not yet been loaded into the second region 1131_2 of DRAM 1131. This determination is made by consulting the G2F mapping table, which indicates whether the data for each L2P mapping group is stored in internal memory 113 or NV memory 120, and also indicates which memory element (e.g., memory node) in the second region 1131_2 of DRAM 1131 contains the data for the L2P mapping group.
[0050] If the check result of step S103 is negative, the process proceeds to step S104. In step S104, since the required L2P mapping group may be stored in the second region 1131_2 of DRAM 1131, a node index indicating which node in DRAM 1131 the required L2P mapping group is stored on will be obtained by consulting the G2F mapping table. The obtained node index will be recorded in the storage cell of the request FIFO buffer 1132F (e.g., FIFO_0 to FIFO_x), and the load status in the request FIFO buffer 1132F will be set to "Prefectch_Node". Furthermore, if the host command is not an aligned 4K read command, but the required L2P mapping group has not yet been loaded into the second region 1131_2 of DRAM 1131, the process may proceed to step S104. In this case, a command will be issued to load the required L2P mapping group from NV memory 120 into the second region 1131_2 of DRAM 1131, and to record the node index into the request FIFO buffer 1132F, and set the load status in the request FIFO buffer 1132F to "Prefectch_Node".
[0051] On the other hand, if the judgment result of step S103 is yes, the process proceeds to step S105. In step S105, the G2F mapping table is checked again to determine whether the required unique set of L2P mapping relationships is dummy data. This can be achieved by checking where the required unique set of L2P mapping relationships is stored in the NV memory 120. If the required unique set of L2P mapping relationships is not in the NV memory 120, it is determined that the required unique set of L2P mapping relationships is dummy data, and the process continues to step S106. In step S106, the load state in the request FIFO buffer 1132F is set to "Prefetch_Dummy", and the corresponding L2P value in the request FIFO buffer 1132 (i.e., the physical address of the NV memory 120 corresponding to the logical address of the host read command) will be filled as dummy data. If the judgment result of step S105 is no, it means that the required unique set of L2P mapping relationships is stored in the NV memory 120, so the process proceeds to step S107. In step S107, the load status in the request FIFO buffer 1132F is set to "Prefetch_From_SRAM_Issued", and a command is issued instructing the loading of the required unique set of L2P mappings from the NV memory 120 into the third region 1132_3 of the shared SRAM 1132. In some embodiments, the task of loading the required unique set of L2P mappings from the NV memory 120 into the third region 1132_3 can be taken over by another processing core of the processing unit 112. Once the task of loading the required unique set of L2P mappings from the NV memory 120 into the third region 1132_3 of the SRAM 1132 is completed, the load status in the request FIFO buffer 1132F will be set to "Prefetch_From_SRAM_Finished".
[0052] Figure 6A flowchart illustrating the load status check phase in an embodiment of the present invention is provided. In the load status check phase, it is checked whether the required L2P mapping relationship group in the L2P mapping table has been correctly loaded and cached in the internal memory 113 of the flash memory controller 110. As shown, this process begins at step S201, which checks whether the load status in the request FIFO buffer 1132F is “No_Prefetch”. If yes, the process proceeds to step S204; otherwise, the process proceeds to step S202. In step S202, it checks whether the load status in the request FIFO buffer 1132F is “Prefetch_Node”. If yes, the process proceeds to step S203; otherwise, the process proceeds to step S208. In step S203, since the load state in the request FIFO buffer 1132F is "Prefetch_Node", a processing core of the processing unit 112 can obtain the node index from the request FIFO buffer 1132F to determine which node in the second region 1131_2 of the DRAM 1131 stores the required L2P mapping relationship group. Afterwards, the process proceeds to step S206. In step S206, it is checked whether the L2P mapping relationship group indicated by the node index in the request FIFO buffer 1132F is consistent with the L2P mapping relationship group actually stored in the DRAM node. This is because internal operations of the memory controller 110, such as garbage collection operations, may cause the index information in the request FIFO buffer 1132F to be inconsistent with the L2P mapping relationship group actually stored in the DRAM node. Therefore, it is necessary to confirm that the L2P mapping relationship group indicated by the node index is the same as the L2P mapping relationship group actually stored in the DRAM node.
[0053] If the check result of step S206 is yes, the process proceeds to step S205; otherwise, the process proceeds to step S207. In step S204, since the load status in the request FIFO buffer 1132F is "No_Prefetch", if the required L2P mapping group has already been loaded into DRAM 1131, the node index is obtained by consulting the G2F mapping table. Otherwise, a command to load the required L2P mapping group will be issued, thereby loading the required L2P mapping group from NV memory 120 into the second region 1131_2 of DRAM 1131. After step S204 is completed, the process proceeds to step S205. In step S205, since the L2P mapping group in the DRAM node does indeed match the L2P mapping group indicated by the node index in the request FIFO buffer 1132F, it is further checked whether the operation of loading the L2P mapping group into the second region 1131_2 of DRAM 1131 has been completed. If the check result of step S205 is yes, the process proceeds to step S210; otherwise, the process proceeds to step S214. In step S207, since the L2P mapping group in the DRAM node fails to match the L2P mapping group indicated by the node index in the request FIFO buffer 1132F, the load status in the request FIFO buffer 1132F will be set to "No_Prefetch". After that, the process returns to step S201.
[0054] In step S208, it is checked whether the load status in the request FIFO buffer 1132F is "Prefetch_Dummy". If the result of step S208 is yes, the process proceeds to S213; otherwise, the process proceeds to step S209. In step S209, it is checked whether the load status in the request FIFO buffer 1132F is "Prefetch_from_SRAM_Finished". As mentioned above, once the required L2P mapping group is loaded into the third region 1132_3 of SRAM 1132, the load status in the request FIFO buffer 1132F will be set to "Prefetch_from_SRAM_Finished". If yes, the process proceeds to step S213; otherwise, the process proceeds to step S210. In step S210, it is further checked whether the load status in the request FIFO buffer 1132F is "Prefetch_from_SRAM_Error". Furthermore, during the loading of the L2P mapping group from NV memory 120, another processing core responsible for loading the L2P mapping group may encounter a loading error. If a loading error occurs, this other processing core can set the load status in the request FIFO buffer 1132F to "Prefetch_from_SRAM_Error". If the check result of step S210 is negative, it means that no loading error has occurred, and the process will pause here until the required L2P mapping group in the L2P mapping table has been fully loaded. At the same time, the current processing core can start processing other tasks.
[0055] In step S210, it is checked whether a loading error occurred after the node was loaded. If the result of step S210 is yes, the process proceeds to step S212; otherwise, the process proceeds to step S213. In step 211, since the loading status in the request FIFO buffer 1132F is not "Prefetch_from_SRAM_Finished", it is further checked whether the loading status in the request FIFO buffer 1132F is "Prefetch_from_SRAM_Error". If yes, the process proceeds to step 212; otherwise, the process proceeds to step 214. In step 212, since a loading error exists after the node is loaded, or the loading status in the request FIFO buffer 1132F is "Prefetch_From_SRAM_Error", an error handling procedure will be used to correct the error. Accordingly, if the error handling procedure has been completed, the process will proceed to step 213. In step 213, the processing phase ends, and the process enters the command service phase. In step 214, since the required L2P mapping relationship group in the L2P mapping table has not been fully loaded, the process will continue to wait until the loading is complete.
[0056] Figure 7 A flowchart illustrating the command service phase (the portion for processing host read commands) in an embodiment of the present invention is shown. In this phase, the read operation of the NV memory 120 is performed based on the L2P address obtained from the L2P mapping group. As shown, the process begins at step S301, which checks whether the load status in the request FIFO buffer 1132F is "No_Prefetch". If yes, the process proceeds to step S304; otherwise, the process proceeds to step 302. In step S302, the load status of the request FIFO buffer 1132F is checked to be "Prefetch_Node". If the result of step S302 is yes, the process proceeds to step S307; otherwise, the process proceeds to step 303. In step S303, the load status of the request FIFO buffer 1132F is checked to be "Prefetch_Dummy". If the result of step S303 is yes, the process proceeds to step S306; otherwise, the process proceeds to step S305.
[0057] In step S304, since the load state of the request FIFO buffer 1132F is "No_Prefetch", the node index is obtained by consulting the G2F mapping table. By referring to the obtained node index, the L2P address associated with the host read command is then obtained from DRAM 1131. In step S305, since the load state of the request FIFO buffer 1132F is not "Prefetch_Dummy", this means that the required L2P mapping set should have been loaded into the third region 1132_3 of the shared SRAM 1132 by a processing core, and the L2P value associated with the host read command has been obtained from the required L2P mapping set by another processing core and stored in the request FIFO buffer 1132F. Therefore, after step S305, the L2P value associated with the host read command can be obtained from the request FIFO buffer 1132F. In step S306, since the loading status of the requested FIFO buffer 1132F is "Prefetch_Dummy", the processing core will obtain the L2P value using dummy data.
[0058] In step S307, since the load state of the request FIFO buffer is "Prefetch_Node", the node index is obtained from the request FIFO buffer 1132F. Based on the obtained node index, the L2P address associated with the host read command can be obtained from the second region 1131_2 of the DRAM 1131 indicated by the node index. After completing steps S304, S305, S306 or S307, the process proceeds to step S308, where a read operation on the NV memory 120 is performed by issuing a flash read command to the NV memory 120, or a dummy read (i.e., reporting a null value to the host device 50) is performed.
[0059] Figure 8A flowchart illustrating the command service phase (the part for processing host write commands) in an embodiment of the present invention is shown. As shown, the process begins at step S401, which checks whether the load status of the request FIFO buffer 1132F is "No_Prefetch". If the check result of step 401 is yes, the process proceeds to step S403; otherwise, the process proceeds to step 402. In step S402, the load status of the request FIFO buffer 1132F is checked whether it is "Prefetch_Node". If the check result of step S402 is yes, the process proceeds to step S404. In step S403, since the load status of the request FIFO buffer 1132F is "No_Prefetch", the node index is obtained by consulting the G2F mapping table. Therefore, the L2P address associated with the host write command can be obtained from the second region 1131_2 of DRAM 1131 by consulting the node index. In step S404, since the load state of the request FIFO buffer 1132F is "Prefetch_Node", the node index can be obtained from the request FIFO buffer 1132F, and the L2P address associated with the host write command can be obtained from the DRAM 1131 by looking up the node index.
[0060] After completing steps S403 or S404, the L2P address of the host write command can be obtained, and the process proceeds to step S405. In step S405, one processing core of the processing unit 112 updates the L2P address of the host write data according to the storage address of the host write data in the second region 1132_2 of the shared SRAM 1132. Figure 4 As shown, once a unit of data written by the host (e.g., Unit_0 to Unit_y) is cached in the second region 1132_2 of the shared SRAM 1132, its corresponding L2P address (e.g., Addr_0 to Addr_y) will be cached in an L2P address array stored in the first region 1132_1 of the shared SRAM 1132. Accordingly, the L2P address of the host-written data will be updated based on the physical address of the host-written data stored in the second region 1132_2 of the shared SRAM 1132.
[0061] Next, the process proceeds to step S406, checking whether a flush of the host write cache (i.e., the second region 1132_2 of the shared SRAM 1132) is required. In other words, if the host write cache is full, or if the host device 50 issues a cache flushing command, the host write data will be written to the NV memory 120. If so, the process proceeds to step S407, where a write operation is performed on the NV memory 120. Specifically, by issuing a flash memory write command to the NV memory 120, the host write data cached in the second region 1132_2 of the shared SRAM 1132 is written to the NV memory 120. Furthermore, the L2P address corresponding to the host write data cached in the L2P address array needs to be updated based on the new physical address of the NV memory 120 where the host write data is actually written.
[0062] Figure 9 This illustration depicts a method for loading and cached address mapping information in an embodiment of the present invention. As shown in the figure, the method of the present invention includes the following simplified process:
[0063] S510: In response to a host read / write command, consult a G2F mapping table to determine whether an L2P mapping set required to process the host read / write command has been loaded into a DRAM of a flash memory controller, and obtain a node index thereon, wherein the L2P mapping set is part of an L2P mapping table, and the node index indicates which memory node of the DRAM stores the required L2P mapping set;
[0064] S520: Record the node index into a first region of an SRAM of the flash memory controller;
[0065] S530: Without consulting the G2F mapping table, by consulting the node index stored in the first region of the SRAM, the DRAM is accessed to obtain an L2P address from the required L2P mapping set, wherein the L2P address points to an entity address associated with the host read / write command; and
[0066] S540: Perform a read / write operation on the flash memory based on the acquired L2P address in response to the host read / write command.
[0067] Since the principles and specific details of the above steps have been explained in detail through previous embodiments, they will not be repeated here. It should be noted that the above process can be improved by adding other additional steps or making appropriate modifications and adjustments to better achieve flash memory access control, thereby improving the read and write performance of the flash memory. Furthermore, all operations described in the embodiments of the specification can be implemented through… Figure 1 The memory controller 110 shown is used to implement this.
[0068] Embodiments of the present invention can be implemented using hardware, software, firmware, and combinations thereof. Embodiments of the present invention can be implemented using software or firmware stored in a memory, provided a suitable instruction execution system is employed. In terms of hardware, any of the following technologies or combinations thereof can be used: individual operational logic with logic gates capable of performing logic functions based on data signals; an application-specific integrated circuit (ASIC) with suitable combinational logic gates; a programmable gate array (PGA); or a field-programmable gate array (FPGA), etc.
[0069] The flowcharts and blocks in the specification illustrate the architecture, functionality, and operation achievable by systems, methods, and computer software products based on various embodiments of the present invention. In this regard, each block in the flowchart or function block diagram may represent a module, segment, or portion of program code, comprising one or more executable instructions for implementing a specified logical function. Furthermore, each block in the function block diagram and / or flowchart, and combinations of blocks, can be substantially implemented by a dedicated hardware system that performs the specified function or action, or a combination of dedicated hardware and computer program instructions. These computer program instructions may also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable medium implement the function / action specified by the blocks in the flowchart and / or function block diagram.
[0070] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention should be included in the scope of the present invention.
Claims
1. A method for cached address mapping information in a flash memory device, the flash memory device comprising a flash memory controller and a flash memory, the method comprising: In response to a host read / write command, a set of gate-to-flash memory (G2F) mapping tables is consulted to determine whether a logical-to-entity (L2P) mapping set required to process the host read / write command has been loaded into a dynamic random access memory (DRAM) of the flash memory controller, and a node index is obtained accordingly. The L2P mapping set is part of an L2P mapping table, and the node index indicates which memory node of the DRAM stores the required L2P mapping set. The node index is recorded in a first region of a static random access memory (SRAM) of the flash memory controller; Without consulting the G2F mapping table, the DRAM is accessed by consulting the node index stored in the first region of the SRAM to obtain an L2P address from the required L2P mapping set, wherein the L2P address points to an entity address associated with the host read / write command. as well as Perform a read / write operation on the flash memory based on the acquired L2P address to respond to the host's read / write command.
2. The method as described in claim 1, characterized in that, Also includes: In response to a host write command, host write data is stored in a host write cache in a second region of the SRAM. Update one or more L2P addresses associated with the host-written data based on one or more physical addresses stored in the SRAM; and One or more updated L2P addresses are cached in an L2P address array, wherein the L2P address array is stored in the first region of the SRAM.
3. The method as described in claim 2, characterized in that, Also includes: In response to an overflow command from the host write cache, the host write data in the host write cache is written to the flash memory; and Based on one or more physical addresses in the flash memory where the host writes data, update one or more L2P addresses cached in the L2P address array that are associated with the host write data.
4. The method as described in claim 1, characterized in that, Also includes: If the required L2P mapping set has not yet been loaded into the DRAM, then the required L2P mapping set is loaded from the flash memory into the DRAM.
5. The method as described in claim 1, characterized in that, The step of recording the node index into the first region of the SRAM of the flash memory controller includes: Before performing the read / write operation on the flash memory, multiple node index records are recorded into storage cells in a first-in-first-out buffer configured from the first region of the SRAM.
6. The method as described in claim 1, characterized in that, Also includes: Consult the G2F mapping table to determine if the required L2P mapping relationship group is dummy data; and If the required L2P mapping group is dummy data, then return an empty value in response to the host read command.
7. A flash memory controller for accessing a flash memory, comprising: A storage unit used to store information and program code; A dynamic random access memory (DRAM); A static random access memory (SRAM); and A processing unit that can execute this program code to perform: In response to a host read / write command, a set of gate-to-flash (G2F) mapping tables is consulted to determine whether a logical-to-entity (L2P) mapping set required to process the host read / write command has been loaded into the DRAM, and a node index is obtained accordingly. The L2P mapping set is part of an L2P mapping table, and the node index indicates which memory node of the DRAM stores the required L2P mapping set. Record the node index in a first region of the SRAM; Without consulting the G2F mapping table, the DRAM is accessed by consulting the node index stored in the first region of the SRAM to obtain an L2P address from the required L2P mapping set, wherein the L2P address points to an entity address associated with the host read / write command. as well as Perform a read / write operation on the flash memory based on the acquired L2P address to respond to the host's read / write command.
8. The flash memory controller as described in claim 7, characterized in that, This processing unit is used for: In response to a host write command, host write data is stored in a host write cache in a second region of the SRAM. Update one or more L2P addresses associated with the host-written data based on one or more physical addresses stored in the SRAM; and One or more updated L2P addresses are cached in an L2P address array, wherein the L2P address array is stored in the first region of the SRAM.
9. The flash memory controller as described in claim 8, characterized in that, This processing unit is used for: In response to an overflow command that writes data to the host cache, the host write data in the host write cache is written to the flash memory. as well as Based on one or more physical addresses in the flash memory where the host writes data, update one or more L2P addresses cached in the L2P address array that are associated with the host write data.
10. The flash memory controller as claimed in claim 7, characterized in that, If the required L2P mapping set has not yet been loaded into the DRAM, the processing unit loads the required L2P mapping set from the flash memory into the DRAM.
11. The flash memory controller as claimed in claim 7, characterized in that, Before performing the read / write operation on the flash memory, the processing unit records multiple node indexes into storage cells in a first-in-first-out buffer configured from the first region of the SRAM.
12. The flash memory controller as claimed in claim 7, characterized in that, This processing unit is used for: Consult the G2F mapping table to determine if the required L2P mapping relationship group is dummy data; and If the required L2P mapping group is dummy data, return an empty value in response to the host's read / write commands.
Citation Information
Patent Citations
FTL-provided cache
CN110968527A
Command selection policy
CN111566610A
