Memory controller and data processing method
By introducing a buffer memory and a routing management device into the memory controller, the problem of disordered data writing in a multi-channel architecture is solved, efficient sequential processing of data transmission is achieved, and the access speed of the flash memory is improved.
Patent Information
- Application Number
- CN202210380935.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-03-23
- Filing Date
- 2022-04-11
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-04-11
AI Technical Summary
How to improve the access speed of flash memory, especially in multi-channel architectures where the disorder of data leads to low read operation efficiency.
By introducing a buffer memory, a descriptor pool, and a routing management device into the memory controller, the descriptor pool temporarily stores descriptors, and the routing management device sequentially selects descriptors to provide to the direct memory access engine. This ensures that data transmission occurs in chronological order and avoids waiting when data is written to the buffer memory out of order.
It improves the data processing efficiency of the memory controller, ensures that data transmission is performed in the correct order, and enhances the efficiency of read operations.
Smart Images

Figure CN116841457B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a data processing method for improving the data processing efficiency and read operation efficiency of a memory controller. Background Technology
[0002] With the rapid development of data storage technology in recent years, many data storage devices, such as those compliant with Secure Digital (SD) / Multi Media Card (MMC), Compact Flash (CF), Memory Stick (MS), Extreme Digital (XD) memory cards, solid-state drives, embedded Multi Media Card (eMMC), and Universal Flash Storage (UFS), have been widely used for various applications. Consequently, the demand for data storage devices in various fields has grown significantly. Taking UFS as an example, due to its high transfer speed and high stability, it has been widely used in consumer electronics products such as digital cameras, smartphones, laptops, and desktop computers.
[0003] Therefore, improving the access speed of flash memory has become an important issue. Summary of the Invention
[0004] One objective of this invention is to improve the access speed of flash memory.
[0005] According to an embodiment of the present invention, a memory controller, coupled to a memory device and a host device, is used to control the access operations of the memory device. The controller includes a buffer memory, a memory interface, a microprocessor, and a host interface. The memory interface is coupled to the buffer memory and the memory device and is used to read the memory device in response to a read instruction issued by the host device to read predetermined data. The predetermined data includes multiple parts, each assigned a different tag value. The memory interface reads these parts of the predetermined data from the memory device and writes them to the buffer memory to complete the data transfer of these parts. In response to the completion of the data transfer of each part of the predetermined data, the memory interface sequentially provides the microprocessor with access information corresponding to each part. The microprocessor generates multiple descriptors in response to the acquisition of the access information of the predetermined data. The microprocessor directly generates and outputs a descriptor corresponding to each piece of access information as one of these descriptors, according to the chronological order in which the access information is acquired. The host interface is coupled to the host device and the buffer memory and includes a descriptor pool, a routing management device, and a direct memory access engine. The descriptor pool is used to receive and temporarily store these descriptors. The routing management unit, coupled to the descriptor pool, sequentially selects a descriptor from the temporarily stored descriptors based on its tag value as the latest descriptor and provides it to the direct memory access engine. The direct memory access engine, coupled to the routing management unit, reads from the buffer memory based on the latest descriptor to obtain at least a portion of the predetermined data.
[0006] According to another embodiment of the present invention, a data processing method includes: reading a memory device in response to a read instruction to read out a plurality of portions comprising predetermined data, wherein the read instruction is issued by a host device to read the predetermined data, and the portions are assigned different tag values; writing the portions of the predetermined data read out to a buffer memory of a memory controller to complete the data transmission of the portions of the predetermined data; sequentially providing access information corresponding to each portion in response to the completion of the data transmission of each portion of the predetermined data; acquiring the access information of the predetermined data and generating a plurality of descriptors in chronological order of acquiring the access information; receiving and temporarily storing the descriptors by a descriptor pool; sequentially selecting a descriptor from the descriptors temporarily stored in the descriptor pool as a latest descriptor based on the tag values by a routing management device, and providing the latest descriptor to a direct memory access engine; and the direct memory access engine reading the buffer memory based on the latest descriptor to obtain at least a portion of the predetermined data. Attached Figure Description
[0007] Figure 1This shows a block diagram example of a data storage device according to an embodiment of the present invention.
[0008] Figure 2 A simplified schematic diagram showing a data transmission operation of the host interface triggered by a microprocessor based on acquired access information, as illustrated in one embodiment of the present invention.
[0009] Figure 3 This diagram shows an example flowchart of a data processing method according to an embodiment of the present invention.
[0010] Figure 4 This diagram shows an example block diagram of devices such as a direct memory access engine, a routing management device, and a descriptor pool configured within a host interface according to an embodiment of the present invention.
[0011] Figure 5 This diagram illustrates a descriptor processing flow within a host interface according to an embodiment of the present invention.
[0012] Symbol Explanation
[0013] 100: Data storage device
[0014] 110: Memory controller
[0015] 112: Microprocessor
[0016] 112C: Program Code
[0017] 112M: Read-Only Memory
[0018] 114: Memory Interface
[0019] 116: Buffer memory
[0020] 118: Host Interface
[0021] 120: Memory device
[0022] 130: Main unit
[0023] 140: Error correction code engine
[0024] 150, 160, 460: Direct Memory Access Engine
[0025] 170, 470: Routing management devices
[0026] 180, 480: Descriptor pool
[0027] 200: Access Information Collection
[0028] 220, 520: Triggering data sets
[0029] 461: Direct Memory Access Management Device
[0030] 462: Direct Memory Access Device
[0031] 471: Descriptor Output Device
[0032] 472-1, 472-2, 472-(n): Routing engine
[0033] 490: State Buffer
[0034] 540: Descriptor Set
[0035] Slot_Num: Storage slot number
[0036] T0~T7: Time points
[0037] Tag_Num: Tag value Detailed Implementation
[0038] Numerous specific details are described below to provide a thorough understanding of embodiments of the invention. However, those skilled in the art will appreciate how the invention can be practiced in the absence of one or more specific details or in reliance on other methods, elements, or materials. In other instances, well-known structures, materials, or operations have not been shown or described in detail to avoid obscuring the main concepts of the invention.
[0039] Throughout this specification, references to "an embodiment" or "an example" mean that a particular feature, structure, or characteristic described in connection with that embodiment or example is included in at least one of the various embodiments of the invention. Therefore, the phrases "in an embodiment of the invention," "according to an embodiment of the invention," "in an example," or "according to an example" appearing in various places throughout this specification do not necessarily refer to the same embodiment or example. Furthermore, specific features, structures, or characteristics may be combined in any suitable combination and / or sub-combination in one or more embodiments or examples.
[0040] Furthermore, to make the objectives, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below in detail with reference to the accompanying drawings. The purpose is to illustrate the spirit of the present invention and not to limit the scope of protection of the present invention. It should be understood that the following embodiments can be implemented by software, hardware, firmware, or any combination thereof.
[0041] Figure 1This diagram illustrates a block diagram example of a data storage device according to an embodiment of the present invention. The data storage device 100 may include a memory device 120 and a memory controller 110. The memory controller 110 is used to access the memory device 120 and control its operation. The memory device 120 may be a non-volatile (NV) memory device (e.g., a flash memory) and may include one or more memory elements (e.g., one or more flash memory dies, one or more flash memory chips, or other similar elements).
[0042] Data storage device 100 may be coupled to a host device 130. Host device 130 may include at least a processor, a power supply circuit, and at least one random access memory (RAM), such as at least one dynamic random access memory (DRAM), at least one static random access memory (SRAM), etc. (not shown above). Figure 1 The processor and random access memory (RAM) can be interconnected via a bus and coupled to a power supply circuit to obtain power. The processor controls the operation of the host device 130. The power supply circuit can supply power to the processor, RAM, and data storage device 100, for example, by outputting one or more drive voltages to the data storage device 100. The data storage device 100 can obtain the drive voltage from the host device 130 as its power source and provide storage space for the host device 130.
[0043] According to one embodiment of the present invention, the host device 130 may issue instructions to the data storage device 100, such as read instructions or write instructions, to access the data stored in the memory device 120, or the host device 130 may issue instructions to the data storage device 100 to further control and manage the data storage device 100.
[0044] According to one embodiment of the present invention, the memory controller 110 may include a microprocessor 112, a read-only memory (ROM) 112M, a memory interface 114, a buffer memory 116, and a host interface 118. The ROM 112M is used to store program code 112C. The microprocessor 112 is used to execute program code 112C to control access to the memory device 120. Program code 112C may include one or more program modules, such as bootloader program code. When the data storage device 100 receives power from the host device 130, the microprocessor 112 may execute an initialization program of the data storage device 100 by executing program code 112C. In the initialization program, the microprocessor 112 may load a set of in-system programming (ISP) code (not shown) from the memory device 120. Figure 1 The microprocessor 112 can execute this set of in-system programming code, enabling the data storage device 100 to possess various functions. According to one embodiment of the invention, this set of in-system programming code may include, but is not limited to: one or more program modules related to memory access (e.g., read, write, and erase), such as a read operation module, a lookup table module, a wear leveling module, a read refresh module, a read reclaim module, a garbage collection module, a sudden power off recovery (SPOR) module, and an uncorrectable error correction code (UECC) module, which are respectively provided to perform corresponding read, lookup table, wear leveling, read refresh, read reclaim, garbage collection, sudden power off recovery, and error handling of detected UECC errors.
[0045] Memory interface 114 includes an error correction code engine 140. The error correction code engine 140 may internally include a data buffer (not shown) for temporarily storing data to assist the engine in performing encoding and decoding operations. During the write process of writing data to memory device 120, the error correction code engine 140 encodes the data to be written to memory device 120, for example, by performing error correction code (ECC) encoding to generate additional parity bits. During the read process of reading data from memory device 120, the error correction code engine 140 decodes the data read from memory device 120 to detect erroneous bits in the data, and, if correctable (e.g., the number of erroneous bits in the data does not exceed the upper limit of the number of erroneous bits that the error correction code engine 140 can correct), corrects the bit values of the erroneous bits.
[0046] In a typical configuration, memory device 120 includes multiple memory elements, such as multiple flash memory chips or flash memory dies, and each memory element may contain multiple memory blocks. Memory controller 110 performs data erasure operations on memory device 120 on a block-by-block basis. Additionally, a memory block may record (contain) a specific number of data pages, such as physical data pages, wherein memory controller 110 performs data write operations on memory device 120 on a page-by-page basis.
[0047] In practice, the memory controller 110 can use its internal components to perform various control operations, such as using the memory interface 114 to control the access operations of the memory device 120 (especially the access operations to at least one memory block or at least one data page), using the buffer memory 116 to perform the necessary buffering operations, and using the host interface 118 to communicate with the host device 130.
[0048] In one embodiment, the memory controller 110 communicates with the host device 130 via the host interface 118 and using a standard communication protocol. For example, the aforementioned standard communication protocol includes (but is not limited to): Universal Serial Bus (USB) standard, SD interface standard, Ultra High Speed-I (UHS-I) interface standard, Ultra High Speed-II (UHS-II) interface standard, CF interface standard, MMC interface standard, eMMC interface standard, UFS interface standard, Advanced Technology Attachment (ATA) standard, Serial ATA (SATA) standard, Peripheral Component Interconnect Express (PCI-E) standard, Parallel Advanced Technology Attachment (PATA) standard, etc.
[0049] In one embodiment, the buffer memory 116 used to provide data buffering is implemented as random access memory. For example, the buffer memory 116 may be static random access memory, but the invention is not limited thereto. In other embodiments, the buffer memory 116 may be dynamic random access memory.
[0050] In one embodiment, the data storage device 100 may be a portable storage device (e.g., a memory card conforming to SD / MMC, CF, MS, XD standards, a USB flash drive, etc.), and the host device 130 may be an electronic device that can be connected to the data storage device, such as a mobile phone, a laptop, a desktop computer, etc. In another embodiment, the data storage device 100 may be a solid-state drive or an embedded storage device conforming to UFS or eMMC specifications, and may be disposed in an electronic device, such as a mobile phone, a laptop, or a desktop computer, in which case the host device 130 may be a processor of the electronic device.
[0051] According to one embodiment of the present invention, the memory interface 114 may further include a Direct Memory Access (DMA) engine 150 for performing data transfer operations, such as transferring data between the buffer memory 116 and the memory device 120 to assist the access operations of the memory device 120. Similarly, the host interface 118 may also include a DMA engine 160 for transferring data between the host device 130 (or a corresponding data buffer or bus) and the buffer memory 116. For the sake of simplicity, ... Figure 1 The direct memory access engines 150 and 160 are designated as DMA engine 150 and DMA engine 160, respectively.
[0052] In a read operation, memory interface 114 reads data from the corresponding location of memory device 120 via DMA engine 150 according to the address information in the read instruction, and temporarily stores the data read from memory device 120 (hereinafter referred to as Read-Out-Data) in buffer memory 116. After the Read-Out-Data is transferred to buffer memory 116, memory interface 114 provides the microprocessor 112 with the relevant information of the data stored in buffer memory 116 (hereinafter referred to as access information) to trigger data transfer operation of host interface 118. For example, DMA engine 160 of host interface 118 further transfers the data stored in buffer memory 116 to the data buffer or bus inside host interface 118, and then provides the data to host device 130 through host interface 118.
[0053] Generally, after completing a Read-Out-Data transfer, the memory interface 114 provides the access information corresponding to that Read-Out-Data to the microprocessor 112, allowing the microprocessor 112 to immediately trigger the data transfer operation of the host interface 118 based on the acquired access information. However, the memory interface 114 may not complete the data transfer in the original order, where the original order of the data can be defined according to the logical address of the data, which is the address used by the host device 130 to identify the data stored in the memory device 120. For example, assuming that the maximum data size that the memory interface 114 can process in a single read operation is 4KB, if the host device 130 issues a read instruction to read 16KB of data, the memory interface 114 will divide the 16KB of data to be read by the read instruction into four parts of 4KB each, and perform four read operations accordingly. Since the time consumed by each read operation may not be the same, these four parts may not be written to the buffer memory 116 in the original order of the data when viewed along the timeline. For example, the memory interface 114 may complete the write operation of the fourth part of the aforementioned 16K-byte data first, and then complete the write operation of its third part. In the 16K-byte data, the fourth part follows the third part, so the logical memory address corresponding to the fourth part will follow the third part.
[0054] This phenomenon is more likely to occur when the memory interface 114 is designed to perform memory device 120 access operations using a multi-channel architecture. Since multiple channels can be configured to process read operations corresponding to multiple read instructions simultaneously, the aforementioned disorder phenomenon will be more pronounced.
[0055] When read-out data is written out of order to buffer memory 116, the access information provided sequentially by memory interface 114 in response to the completion of data transfer, or collected sequentially by microprocessor 112, will also be out of order in terms of timeline; that is, not in the original order of the data, which can be defined according to the logical address of the data. For example, for several data entries with consecutive logical addresses, microprocessor 112 may not be able to collect the corresponding access information in ascending (or descending) order of their logical addresses.
[0056] Figure 2 This is a simplified schematic diagram illustrating a data transmission operation of the host interface triggered by the microprocessor 112 based on acquired access information, as shown in an embodiment of the present invention. The access information set 200 comprises the access information sequentially provided by the memory interface 114 in response to the completion of data transmission or sequentially collected by the microprocessor 112. The access information set 200 may be a collection of multiple access information entries, for example, in... Figure 2 In this diagram, a horizontal row represents a single access record. An access record corresponds to a piece of data stored in the buffer memory 116, or to data written during a write operation of the buffer memory 116, and may include at least a slot number (Slot_Num) and a tag value (Tag_Num). According to one embodiment of the present invention, a read command issued by the host device 130 is assigned a slot number (Slot_Num), for example, an integer value such as 0, 1, 2, 3, etc. To distinguish multiple read commands received from the host device 130 within a predetermined time period, different read commands received within that predetermined time period are assigned different slot numbers (Slot_Num), that is, different read commands correspond to different slot numbers (Slot_Num).
[0057] Furthermore, as described above, since the memory interface 114 may divide the data to be read by a read instruction into multiple parts and perform multiple read operations accordingly, different parts can be assigned different tag values Tag_Num, but the multiple parts contained in the given data corresponding to a given read instruction will be assigned the same storage slot number. For example, if the host device 130 issues a read instruction to read 16 KB of data as described above, the memory interface 114 will assign the 16 KB of data to be read by this read instruction the same storage slot number, and further divide the data into four parts of 4 KB each, and these four parts can be assigned tag values in sequence: 0, 1, 2, Last (last), or other consecutive or increasing sequences, where Last is used to represent the last part of this data. For another example, if host device 130 issues a read instruction to read predetermined data, where the logical address range corresponding to the predetermined data is from Logical Block Address (LBA) LBA1 to LBA16, memory interface 114 can divide the predetermined data into multiple parts, such as 2, 4, or 8 parts. Assuming that memory interface 114 can handle the amount of data of two logical block addresses when performing a read operation, the predetermined data can be divided into 8 parts, and these 8 parts can be assigned the same storage slot number as described above, and sequentially assigned tag values 0, 1, 2, ... Last, or sequentially assigned tag values 0, 2, 4, 6, 8, 10, 12, 14. In other words, in embodiments of the present invention, the tag value Tag_Num can be set to a consecutive and increasing (or decreasing) integer, or set to an offset of a memory address recognizable by the DMA engine 160. This offset can be an increasing (or decreasing) sequence, or an equal increasing (or decreasing) sequence, allowing the DMA engine 160 to calculate from which memory address in the buffer memory 116 to retrieve the portion of data corresponding to each tag value, based on the tag value Tag_Num and the starting address of the predetermined data in the buffer memory 116. Therefore, in embodiments of the present invention, the tag values allocated to multiple portions of a predetermined data have a predetermined order, which can be an increasing (or decreasing) numerical order, a consecutive numerical order, or any other specific order sufficient to distinguish the original order or logical address order of the predetermined data.
[0058] Figure 2The leftmost arrow, pointing downwards, represents the timeline, encompassing time points T0 to T7, indicating the chronological order of information retrieval. Information with both Slot_Num and Tag_Num marked as 0 is the earliest retrieved information in the information set 200, corresponding to time point T0. Information with both Slot_Num and Tag_Num marked as Last is the latest retrieved information in the information set 200, corresponding to time point T7. As mentioned above, since the time consumed by each read operation may not be the same, the microprocessor 112 may not collect the corresponding information according to the original data order, or even according to the receiving order of multiple read instructions.
[0059] Figure 2 It also displays the trigger data set 220 generated by the microprocessor 112 based on the acquired access information. The trigger data set 220 can be a collection of multiple trigger data entries, for example, in... Figure 2 In the diagram, a horizontal row represents a trigger data entry used to initiate a data transfer operation, and the access information corresponding to each trigger data entry is displayed using the storage slot number Slot_Num and tag value Tag_Num. Since the data transfer operations of the host interface 118 must be triggered in the correct order (i.e., the original order of the aforementioned data or the order of the aforementioned logical address incrementing (or decrementing)), in this embodiment, as shown, after the microprocessor 112 receives the first access information where the storage slot number Slot_Num is marked as 0 and the tag value Tag_Num is marked as 0, and the second access information where the storage slot number Slot_Num is marked as 0 and the tag value Tag_Num is marked as 2, since the second access information is not the correct access information (and is not the access information corresponding to the next data or part of the data or part pointed to by the first access information), the microprocessor 112 can only generate the first trigger data based on the first access information, and then must wait until the next correct access information, such as the storage slot number Slot_Num... Once the third access information, marked as 0 and with the tag value Tag_Num marked as 1, is collected, the second trigger data can be generated based on the third access information, and the third trigger data can be generated based on the second access information, and so on.
[0060] Trigger data generated by microprocessor 112 is provided to the DMA engine 160 of host interface 118 to trigger data transfer operations of DMA engine 160, which further transfers the data stored in buffer memory 116 to the data buffer or bus inside host interface 118. The trigger data can be provided directly to DMA engine 160 after being appended with other necessary information (e.g., source and destination start addresses, data size to be transferred, etc.), or microprocessor 112 can append other additional information (e.g., status information, etc.) to the trigger data before providing it to DMA engine 160, or microprocessor 112 can generate a corresponding descriptor based on the trigger data or the trigger data and other necessary information before providing it to DMA engine 160. This invention is not limited to any one of these embodiments. It should be noted that although this invention is not limited to any one embodiment, for the sake of brevity, the term "descriptor" will be used consistently in the following description.
[0061] Figure 2 The right side displays multiple descriptors provided by the microprocessor 112 to the DMA engine 160. The right-to-left arrows below represent a timeline, showing the chronological order in which the descriptors were provided. The values (X, Y) in the cells represent the descriptor corresponding to the trigger data with storage slot number X and tag value Y. The cells filled with diagonal lines represent periods when descriptors could not be provided due to the microprocessor 112's waiting operation. As shown, the inability of the DMA engine 160 to continuously receive descriptors significantly impacts the efficiency of read operations.
[0062] To address the aforementioned issues, in other embodiments of the present invention, a routing management device 170 and a descriptor pool 180 are further configured within the host interface 118. The descriptor pool 180 receives and temporarily stores descriptors provided by the microprocessor 112, allowing the microprocessor 112 to generate corresponding descriptors directly based on the acquired or collected access information without waiting for the correct access sequence, and then directly provide the descriptors to the host interface 118. That is, in embodiments of the present invention, the microprocessor may disregard or ignore (or ignore or disregard) the continuity or inherent order of the tag values within the access information, and only output the descriptors corresponding to each access information according to the chronological order of access information acquisition. In this way, the microprocessor 112 can efficiently complete the task of triggering the host interface 118 to perform data transmission in a shorter time, without waiting for access information. Once the microprocessor 112 has completed the task of triggering the host interface 118, it can execute other tasks of the memory controller 110. Therefore, the data processing efficiency of the memory controller 110 can be effectively improved.
[0063] Figure 3 An exemplary flowchart of a data processing method according to an embodiment of the present invention is shown, comprising the following steps: Step S302: In response to a read instruction, read the memory device 120 to read out multiple portions of a given data, wherein the read instruction is issued by the host device 130 to read the given data, and as described above, these portions of the given data are assigned different tag values, and the tag values assigned to these portions of the given data have a predetermined order according to their proper data order.
[0064] Step S304: Write these portions of the predetermined data read out sequentially into the buffer memory 116 of the memory controller 110 to complete the data transmission of the predetermined data.
[0065] Step S306: In response to the completion of data transmission of each part of the given data, access information corresponding to each part is provided sequentially.
[0066] In one embodiment of the present invention, the microprocessor 112 of the memory controller 110 may trigger the memory interface 114 to execute steps S302 and S304 in response to a received read instruction, so as to complete the first stage of data transmission of the predetermined data. Furthermore, in some embodiments of the present invention, step S306 may be executed by the memory interface 114, while in other embodiments, step S306 may be replaced by the microprocessor 112 actively collecting access information corresponding to each part in response to the completion of data transmission of each portion of the predetermined data (e.g., the memory interface 114 may notify the microprocessor 112 after data transmission is completed).
[0067] Step S308: Obtain access information for predetermined data and generate multiple descriptors in chronological order of obtaining the access information. In an embodiment of the present invention, step S308 can be executed by microprocessor 112, and after generating the descriptors, microprocessor 112 can directly provide the descriptors to host interface 118. Furthermore, in an embodiment of the present invention, the access information may include information about a storage slot number and a tag value corresponding to each part of the predetermined data to be read by host device 130, and the descriptor (or, the aforementioned trigger data) may also include the storage slot number and tag value information to inform host interface 118 of the relevant information about the storage slot number and tag value corresponding to the data currently stored in buffer memory 116. Next, steps S310 to S314 are internal operations of host interface 118 to complete the second stage of predetermined data transmission.
[0068] Step S310: These descriptors are received and temporarily stored by the descriptor pool 180 of the host interface 118. In some embodiments of the present invention, the descriptor pool 180 may be implemented by one or more registers.
[0069] Step S312: The routing management device 170 sequentially selects a descriptor from the descriptors temporarily stored in the descriptor pool 180 according to the storage slot number and tag value as the latest descriptor, and provides the latest descriptor to the DMA engine 160. It should be noted that, in embodiments of the present invention, the routing management device 170 may include multiple routing engines (shown on...). Figure 4 Each routing engine corresponds to a different storage slot number. Each routing engine is used to specifically process descriptors marked with their corresponding storage slot number. Therefore, the operation in step S312 can also be that each routing engine selects a descriptor from the descriptors temporarily stored in the descriptor pool 180 according to the predetermined order of the tag values.
[0070] Step S314: The direct memory access engine reads the buffer memory 116 according to the latest descriptor to obtain at least a portion of the predetermined data.
[0071] After acquiring the predetermined data or at least a portion thereof, the DMA engine 160 may further transfer the acquired data to the data buffer or bus within the host interface 118. Then, the predetermined data is provided to the host device 130 after the parts of the predetermined data are combined in the correct order (i.e., the original order of the aforementioned data) and packaged in accordance with the aforementioned standard communication protocol (e.g., UFS interface standard) through the host interface 118.
[0072] Figure 4 This diagram illustrates an example block diagram of a direct memory access engine, routing management device, and descriptor pool configured within a host interface according to an embodiment of the present invention. In this embodiment, the microprocessor 112 can directly and continuously provide descriptors to the descriptor pool 480. For example, the microprocessor 112 can directly generate and output a descriptor corresponding to each piece of access information in response to acquired or collected access information. Therefore, in this embodiment, the microprocessor 112 can generate and output descriptors corresponding to each piece of access information in the chronological order of acquiring the access information, and directly provide the descriptors to the descriptor pool 480.
[0073] The routing management device 470 may include a descriptor output device 471 and a plurality of routing engines 472-1, 472-2…472-(n), where n is a positive integer. In embodiments of the present invention, different storage slot numbers can be assigned to different routing engines. Therefore, routing engines 472-1, 472-2…472-(n) may correspond to different storage slot numbers, and are used to retrieve a descriptor with a corresponding storage slot number from a plurality of descriptors temporarily stored in the descriptor pool 480 according to a predetermined order of tag values as a target descriptor. The descriptor output device 471 is coupled to the routing engines 472-1, 472-2…472-(n) and can act as an arbitrator, receiving the target descriptors retrieved by each routing engine from the routing engines 472-1, 472-2…472-(n), and sequentially selecting one of these target descriptors as the latest descriptor to be output, and outputting these target descriptors sequentially. For example, the descriptor output device 471 can output the target descriptors retrieved from the routing engines 472-1, 472-2…472-(n) in a round-robin manner as the latest descriptors. In other embodiments, the routing engines 472-1, 472-2…472-(n) can also be assigned different priorities, and the descriptor output device 471 can sequentially select the corresponding target descriptors according to the priority order to output as the latest descriptors.
[0074] The direct memory access engine 460 may include a direct memory access management device 461 (hereinafter referred to as DMA management device 461) and a direct memory access device 462 (hereinafter referred to as DMA device 462). The DMA management device 461 may sequentially receive the latest descriptor from the descriptor output device 471, translate the latest descriptor into information required or recognizable by the DMA device 462, and then provide the translated information to the DMA device 462. The DMA device 462 may read the buffer memory 116 according to the information provided by the DMA management device 461 to obtain at least a portion of the data that the host device wishes to read.
[0075] In some embodiments of the present invention, after completing the data transfer, the DMA device 462 may report a status of the data transfer operation, and the host interface 118 may further include a status buffer 490 for temporarily storing the status reported by the DMA device 462. The microprocessor 112 may access the status buffer 490 to obtain the required status information.
[0076] Figure 5 This diagram illustrates a descriptor processing flow within a host interface according to an embodiment of the present invention. (Continued) Figure 2The example of access information set 200 shown includes a trigger data set 520, which is a set of trigger data generated by the microprocessor 112 based on the access information within the access information set 200. Alternatively, as described above, it can also represent a set of descriptors generated by the microprocessor 112 based on the access information, trigger data, or other necessary information. The descriptor set 540 is a set of descriptors stored in the descriptor pool 480. Figure 5 As can be seen from the embodiments of the present invention, since the microprocessor 112 can directly and continuously provide descriptors to the descriptor pool 480, the data order corresponding to the trigger data set 520 is the same as the data order corresponding to the descriptor set 540 when viewed along the time axis.
[0077] As described above, a read command issued by the host device 130 is assigned a storage slot number Slot_Num, and routing engines 472-1, 472-2…472-(n) can each correspond to a different storage slot number to specifically process descriptors marked with their corresponding storage slot numbers. Assume that routing engine 472-1 (in… Figure 5 The marking "Route Engine 1" corresponds to storage slot number 0, and route engine 472-2 (in...) Figure 5 The marking "Route Engine 2" corresponds to storage slot number 1, and route engine 472-3 (in...) Figure 5 If the label is marked as routing engine 3 and corresponds to storage slot number 3, then routing engine 472-1 will sequentially retrieve the descriptor with storage slot number 0 from the multiple descriptors temporarily stored in descriptor pool 480 according to the predetermined order of the label values. Routing engine 472-2 will sequentially retrieve the descriptor with storage slot number 1 from the multiple descriptors temporarily stored in descriptor pool 480 according to the predetermined order of the label values, and so on.
[0078] In embodiments of the present invention, the predetermined order can be a sequential order or an ascending order. Routing engines 1, 2, and 3 can set the target descriptors to be retrieved according to the predetermined order of tag values (e.g., setting the current storage slot number and tag value to be retrieved), such that the data or portion pointed to by the target descriptor is the next data or portion following the data pointed to by the previously retrieved descriptor. The target descriptors are retrieved from multiple descriptors temporarily stored in the descriptor pool 480, each target descriptor having the storage slot number corresponding to the routing engine and the currently set tag value. The target descriptors retrieved sequentially by routing engines 1, 2, and 3 are provided to the descriptor output device 471, which sequentially selects one of them for output.
[0079] Figure 5The right side displays the descriptors retrieved sequentially by routing engines 1, 2, and 3, and the descriptors output sequentially by descriptor output device 471. The right-to-left arrows below represent a timeline, showing the chronological order of the output descriptors. The value (X, Y) in the cells represents the descriptor corresponding to the accessed data with storage slot number X and tag value Y. As shown, routing engines 1, 2, and 3 retrieve the corresponding descriptors according to a predetermined order of tag values, while descriptor output device 471 provides the descriptors to the direct memory access engine sequentially according to its custom arbitration mechanism. It should be noted that although the predetermined order in this example is a sequential or ascending order, in other embodiments of the invention, the predetermined order can also be a descending order.
[0080] In embodiments of the present invention, multiple portions of predetermined data corresponding to a read instruction can be assigned different tag values in a predetermined order, unlike... Figure 2 Implementation examples, in Figure 5 In this implementation example, the microprocessor 112 disregards or ignores the predetermined order of tag values, and outputs the descriptors corresponding to each access message only according to the chronological order in which the access information is acquired. That is, the microprocessor 112 can output the corresponding descriptor immediately in response to the latest access information. Then, the routing engine in the routing management device retrieves the correctly sorted descriptors in a predetermined order, so that the data transmission operation of the host interface 118 can be triggered in the correct order (i.e., the original order of the aforementioned data or the order of the aforementioned logical address incrementing (or decrementing). In this way, the microprocessor 112 can efficiently complete the operation of triggering the host interface 118 to perform data transmission in a shorter time, without having to spend time waiting for access information. In addition, the DMA engine 160 does not need to wait for the arrival of descriptors, but can continuously execute data transmission operations, thus effectively improving the data processing efficiency and read operation efficiency of the memory controller 110.
[0081] 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 memory controller coupled to a memory device and a host device for controlling access operations of the memory device, comprising: A buffer memory; A memory interface, coupled to the buffer memory and the memory device, is used to read the memory device in response to a read instruction issued by the host device to read predetermined data, the predetermined data comprising multiple parts, each part being assigned a different tag value. The memory interface reads each part of the predetermined data from the memory device and writes the read parts of the predetermined data into the buffer memory to complete the data transfer of the parts of the predetermined data from the memory device to the buffer memory. In response to the completion of the data transfer of each part of the predetermined data, an access information corresponding to each part is sequentially provided to a microprocessor. The microprocessor generates multiple descriptors in response to the acquisition of these access information of the given data, wherein the microprocessor directly generates and outputs a descriptor corresponding to each access information in the order of the acquisition of these access information. as well as A host interface, coupled to the host device and the buffer memory, includes: A descriptor pool is used to receive and temporarily store these descriptors; A routing management device, coupled to the descriptor pool, sequentially selects a descriptor from the descriptors temporarily stored in the descriptor pool according to these tag values as the latest descriptor, and provides the latest descriptor to a direct memory access engine; and The direct memory access engine, coupled to the routing management device, is used to read the buffer memory based on the latest descriptor to obtain at least a portion of the given data.
2. The memory controller as claimed in claim 1, characterized in that, The routing management device includes: Multiple routing engines, each corresponding to a different storage slot number, are used to retrieve a descriptor with the corresponding storage slot number from the descriptors temporarily stored in the descriptor pool according to a predetermined order of their tag values, and use it as a target descriptor; and A descriptor output device, coupled to these routing engines, is used to receive these target descriptors from these routing engines and sequentially select one of these target descriptors as the latest descriptor.
3. The memory controller as described in claim 2, characterized in that, The established order is an ascending order.
4. The memory controller as described in claim 2, characterized in that, These portions of the given data are assigned the same storage slot number.
5. The memory controller as described in claim 2, characterized in that, Different read commands correspond to different storage slot numbers.
6. The memory controller as claimed in claim 4, characterized in that, The access information provided by the memory interface for each part includes the storage slot number and the tag value corresponding to each part.
7. The memory controller as claimed in claim 2, characterized in that, These portions of the given data are assigned different but consecutive tag values. The microprocessor ignores the predetermined order of these tag values and outputs the descriptor corresponding to each access information only in the order in which the access information is obtained.
8. A data processing method, comprising: A memory device is read in response to a read instruction to read out multiple portions of a given set of data, wherein the read instruction is issued by a host device to read the given data, and these portions are assigned different tag values. These portions of the predetermined data, read out separately, are written into a buffer memory of a memory controller to complete the data transfer of these portions of the predetermined data from the memory device to the buffer memory; In response to the completion of data transmission for each part of the given data, access information corresponding to each part is provided sequentially. The access information for the given data is obtained, and multiple descriptors are generated accordingly in the order in which the access information is obtained. These descriptors are received and temporarily stored by a descriptor pool; A routing management device sequentially selects a descriptor from the descriptors temporarily stored in the descriptor pool based on these tag values as the latest descriptor, and provides the latest descriptor to a direct memory access engine. as well as The direct memory access engine reads the buffer memory based on the latest descriptor to obtain at least a portion of the given data.
9. The data processing method as described in claim 8, characterized in that, The descriptor pool, the routing management device, and the direct memory access engine are located within a host interface of the memory controller.
10. The data processing method according to claim 8, characterized in that, Also includes: Different storage slot numbers are assigned to multiple routing engines of the routing management device; These routing engines retrieve a descriptor with the corresponding storage slot number from the descriptors temporarily stored in the descriptor pool according to a predetermined order of these tag values, and use it as a target descriptor; as well as The routing management device receives these destination descriptors from these routing engines and selects one of these destination descriptors as the latest descriptor in sequence.
11. The data processing method as described in claim 10, characterized in that, The established order is an ascending order.
12. The data processing method as described in claim 10, characterized in that, These portions of the given data are assigned the same storage slot number.
13. The data processing method as described in claim 10, characterized in that, Different read commands correspond to different storage slot numbers.
14. The data processing method as described in claim 12, characterized in that, The access information corresponding to each part includes the storage slot number and the tag value corresponding to each part.
15. The data processing method as described in claim 8, characterized in that, These portions of the given data are assigned different tag values in a predetermined order, and this predetermined order of the tag values is not considered when performing the steps of obtaining the access information of the given data and generating the descriptors accordingly in the chronological order of obtaining the access information.
Citation Information
Patent Citations
Memory transaction request management
CN111124274A
Memory controller, memory device having the same, and memory control method
US20170123729A1
