Flash memory controller and related control method

By using time queue and virtual queue processing commands in flash memory controllers, the problem of low processing efficiency of high priority commands in the existing technology is solved, and more efficient command execution and system performance improvement is achieved.

CN118939583APending Publication Date: 2024-11-12SILICON MOTION INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310617924.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-12
Filing Date
2023-05-29
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

When existing flash memory controllers process specific commands with high priority, they need to read all commands out and sort, resulting in reduced performance and the front-end locking queue affects continuous command reception.

Method used

Use time queues and at least one virtual queue to process commands from the main device, write command information into the time queue through the command processing circuit, and selectively write part of the command information into the virtual queue, microprocessor Selectively read to optimize the order of command execution.

Benefits of technology

Improves the execution efficiency of the flash memory controller, avoids unnecessary command sorting and locking queue operations, and improves system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939583A_ABST
    Figure CN118939583A_ABST
Patent Text Reader

Abstract

The invention relates to a flash memory controller and a related control method. The flash memory controller is used for accessing a flash memory module, and the flash memory controller comprises a transmission interface circuit, a buffer memory and a microprocessor. The transmission interface circuit is coupled to a main device, the transmission interface circuit comprises a time queue, at least one virtual queue and a command processing circuit, and the command processing circuit is used for receiving a plurality of commands from the main device and writing information of the commands into the time queue in sequence. And writing information of at least one part of commands in the plurality of commands into the at least one virtual queue. The buffer memory is used for storing the plurality of commands. The microprocessor is used for selectively reading the time queue or the at least one virtual queue so as to read the information of the plurality of commands.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a flash memory controller. Background Art

[0002] In a current flash memory controller, at least one queue is usually arranged to temporarily store multiple commands from a host device so that a processor inside the flash memory controller can process these commands sequentially.

[0003] In practice, in order to improve the efficiency of processing these commands, a read command queue, a write command queue and an other command queue are usually set, wherein the read command queue is specifically used to temporarily store the read command from the master device, the write command queue is specifically used to temporarily store the write command from the master device, and the other command queue is used to temporarily store all other commands except the read command and the write command. However, if the master device sends a specific command with a high priority, according to the Universal Flash Storage (UFS) specification, the execution time of the specific command with a high priority must be earlier than the execution time of the command issued later. Therefore, the flash memory controller needs to read all the commands in the read command queue, the write command queue and the other command queues and sort them according to the received time to determine the execution time of the specific command with a high priority. However, this method will seriously affect the performance of the flash memory controller.

[0004] In addition, when the flash memory controller reads all commands in the read command queue, the write command queue and other command queues and sorts them according to the received time, it is necessary to lock the front end of the read command queue, the write command queue and other command queues to avoid continuously receiving commands from the host device and affecting related operations. However, this will further reduce the performance of the flash memory controller. Summary of the invention

[0005] Therefore, one of the objectives of the present invention is to provide a flash memory controller which uses a time queue and at least one virtual queue to perform related execution sequence planning for commands from a host device to solve the problems described in the prior art.

[0006] In one embodiment of the present invention, a flash memory controller is disclosed, which is used to access a flash memory module, and the flash memory controller includes a transmission interface circuit, a buffer memory and a microprocessor. The transmission interface circuit is coupled to a host device, wherein the transmission interface circuit includes a time queue, at least one virtual queue and a command processing circuit, wherein the command processing circuit is used to receive a plurality of commands from the host device, and write the information of the plurality of commands into the time queue in sequence, and write the information of at least a part of the plurality of commands into the at least one virtual queue. The buffer memory is used to store the plurality of commands. The microprocessor is used to selectively read the time queue or the at least one virtual queue to read the information of the plurality of commands.

[0007] In one embodiment of the present invention, a control method for a flash memory controller is disclosed, which includes: setting a time queue and at least one virtual queue; receiving multiple commands from a host device; writing information of the multiple commands into the time queue in sequence, and writing information of at least a part of the multiple commands into the at least one virtual queue; and selectively reading the time queue or the at least one virtual queue to read the information of the multiple commands. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 FIG. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention.

[0009] Figure 2 A diagram showing how to configure multiple queues using registers.

[0010] Figure 3 FIG. 4 is a flow chart of a control method of a flash memory controller according to an embodiment of the present invention.

[0011]

Explanation of symbols

[0012] 10: Electronic devices

[0013] 50: Main device

[0014] 52: Processor

[0015] 54: Power supply circuit

[0016] 100: Memory Device

[0017] 110: Flash memory controller

[0018] 112: Microprocessor

[0019] 112M: Read-only memory

[0020] 112C: Program code

[0021] 114: memory interface circuit

[0022] 116: Buffer memory

[0023] 118: Transmission interface circuit

[0024] 118M:M physical layer circuit

[0025] 118P: Unipro layer

[0026] 118U:UFS controller

[0027] 120: Flash memory module

[0028] 122-1-122-N: Flash memory device

[0029] 142: Command processing circuit

[0030] 144: Register

[0031] 210: Time Queue

[0032] 220_1: Read command virtual queue

[0033] 220_2: Write command virtual queue

[0034] 220_3: Other command virtual queues

[0035] 220_4: Task management command virtual queue

[0036] 220_5: Query command virtual queue

[0037] 300~308: Steps DETAILED DESCRIPTION

[0038] Figure 11 is a schematic diagram of an electronic device 10 according to an embodiment of the present invention, wherein the electronic device 10 may include a host device 50 and a memory device 100. The host device 50 may include at least one processor 52, and the host device 50 may further include a power supply circuit 54 coupled to the processor 52. The processor 52 is used to control the operation of the host device 50, and the power supply circuit 52 is used to supply power to the processor 52 and the memory device 100, and output one or more driving voltages to the memory device 100. The memory device 100 can be used to provide storage space for the host device 50, and obtain the one or more driving voltages from the host device 50 as a power supply for the memory device 100. In one embodiment, the host device 50 may be a multi-function mobile phone, a wearable device, a tablet computer, a personal computer or any other electronic product, and the memory device 100 may be an embedded storage device, such as an embedded storage device that complies with the UFS standard. According to this embodiment, the memory device 100 may include a flash memory controller 110 and a flash memory module 120, wherein the memory controller 110 is used to control the operation of the memory device 100 and access the flash memory module 120, and the flash memory module 120 is used to store information. The flash memory module 120 may include at least one flash memory element (e.g., one or more flash memory chips or one or more flash memory dies), such as a plurality of flash memory elements 122-1, 122-2, ..., and 122-N, wherein N is a positive integer greater than one.

[0039] like Figure 1As shown, the flash memory controller 110 may include a microprocessor 112, a read-only memory (ROM) 112M, a memory interface circuit 114, a buffer memory 116, and a transmission interface circuit 118, wherein the above components may be coupled to each other via a bus. The buffer memory 116 is implemented by a static random access memory (SRAM), and the buffer memory 116 may be used to provide internal storage space for the memory controller 110. In addition, the read-only memory 112M of the present embodiment is used to store a program code 112C, and the microprocessor 112 is used to execute the program code 112C to control the access of the flash memory 120. Please note that in some examples, the program code 112C may be stored in the buffer memory 116 or any type of memory. In addition, the memory interface circuit may include an encoder and a decoder to encode data written into the flash memory module 120 or decode data read from the flash memory module 120; and the transmission interface circuit 118 may comply with a specific communication standard (e.g., the UFS standard) and may communicate according to the specific communication standard, for example, for the memory device 100 to communicate with the host device 50. The transmission interface circuit 118 may include a universal flash memory storage controller (referred to as UFS controller) 118U, an M-physical layer (M-PHY) circuit 118M and a standardized communication protocol (Unified Protocol, commonly referred to as UniPro) layer 118P that comply with the relevant specifications of the MIPI Alliance, which may interact with each other, and the UFS controller 118U at least includes a command processing circuit 142 and a register 144.

[0040] In this embodiment, the host device 50 may transmit a plurality of commands to the flash memory controller 110 , and the flash memory controller 110 may then perform read or write operations on the flash memory module 120 according to the commands from the host device 50 .

[0041] In this embodiment, the host device 50 transmits a variety of different commands to the flash memory controller 110 to instruct related operations, such as a read command, a write command, a task management command, a query command, and other commands, etc. Among them, the read command includes a logical address, and the read command requires the flash memory controller 110 to read the data corresponding to the logical address from the flash memory module 120 and return the data to the host device 50; the write command includes a logical address and corresponding data, and the write command requires the flash memory controller 110 to write the data into the flash memory module 120; the task management command is used to indicate how to process the received command, such as deleting a certain command; the query command requires the flash memory controller 110 to provide the configuration, enumeration, device description, and attributes of the memory device 100 to the host device 50; and other commands refer to all other commands different from the above-mentioned read command, write command, task management command, and query command. In addition, since the host device 50 does not classify and sort the types of commands when transmitting commands, and some commands may need to be executed first, this embodiment proposes a queue design that can efficiently process the received commands.

[0042] refer to Figure 2 , which depicts a schematic diagram of the register 114 being configured as a plurality of queues. The register 114 is divided into six parts, wherein the first part is used as a time queue 210, and the time queue 210 is used to sequentially store all commands from the master device 50. Figure 2Taking an example for illustration, assuming that the main device 50 sequentially transmits other commands O1, O2, read command R1, write command W1, read command R2, write command W2, read command R3, task management command TM1, other command O3, inquiry command Q1, task management command TM2, and other command O4 to the flash memory controller 110, then after these commands are processed by the M physical layer circuit 118M and the Unipro layer 118P, the command processing circuit 142 will temporarily store the above commands in the buffer memory 116, and store the information of the above commands, such as the serial number of each command or the address where the command is stored in the buffer memory 116, in sequence in the time queue 210. The second part of the register 144 is used as a read command virtual queue 220_1, which is only used to store information of the read command received by the flash memory controller 110. In one embodiment, the read command virtual queue 220_1 stores pointers to the read commands in the time queue 210. For example, the first data in the read command virtual queue 220_1 points to the read command R1 in the time queue 210, the second data in the read command virtual queue 220_1 points to the read command R2 in the time queue 210, and so on. The third part of the register 144 is used as a write command virtual queue 220_2, which is only used to store information of the write command received by the flash memory controller 110. In one embodiment, the write command virtual queue 220_2 stores a pointer to the write command in the time queue 210. For example, the first data in the write command virtual queue 220_2 points to the read write W1 in the time queue 210, the second data in the write command virtual queue 220_2 points to the write command W2 in the time queue 210, and so on. The fourth part of the register 144 is used as an other command virtual queue 220_3, which is only used to store information of other commands received by the flash memory controller 110. In one embodiment, the other command virtual queue 220_3 stores pointers to other commands in the time queue 210. For example, the first data in the other command virtual queue 220_3 points to other write O1 in the time queue 210, the second data in the other command virtual queue 220_3 points to other command O2 in the time queue 210, and so on.The fifth part of the register 144 is used as a task management command virtual queue 220_4, which is only used to store information of the task management command received by the flash memory controller 110. In one embodiment, the task management command virtual queue 220_4 stores a pointer to the task management command in the time queue 210. For example, the first data in the task management command virtual queue 220_4 points to the task management command TM1 in the time queue 210, and the second data in the task management command virtual queue 220_4 points to the task management command TM2 in the time queue 210. The sixth part of the register 144 is used as an inquiry command virtual queue 220_5, which is only used to store information of the inquiry command received by the flash memory controller 110. In one embodiment, the inquiry command virtual queue 220_5 stores a pointer to the inquiry command in the time queue 210. For example, the data in the inquiry command virtual queue 220_5 points to the inquiry command Q1 in the time queue 210.

[0043] It should be noted that the sizes of the read command virtual queue 220_1, the write command virtual queue 220_2, the other command virtual queue 220_3 and the task management command virtual queue 220_4 can be adjusted according to the designer's consideration, and do not need to store all the corresponding commands in the time queue 210. For example, the read command virtual queue 220_1 can have only one register, and the data stored therein points to the read command R1 in the time queue 210, that is, the read command virtual queue 220_1 does not have the information of the other read commands R2 and R3 in the time queue 210. Similarly, the task management command virtual queue 220_4 can also have only one register, and the data stored therein points to the task management command TM1 in the time queue 210, that is, the task management command virtual queue 220_4 does not have the information of the other task management command TM2 in the time queue 210.

[0044] In addition, the contents of the read command virtual queue 220_1, the write command virtual queue 220_2, the other command virtual queue 220_3, the task management command virtual queue 220_4 and the query command virtual queue 220_5 are synchronized with the time queue 210. That is, if the contents of the time queue 210 are changed, the contents of the read command virtual queue 220_1, the write command virtual queue 220_2, the other command virtual queue 220_3, the task management command virtual queue 220_4 and the query command virtual queue 220_5 will also be changed accordingly; similarly, if the contents of the read command virtual queue 220_1, the write command virtual queue 220_2, the other command virtual queue 220_3, the task management command virtual queue 220_4 and the query command virtual queue 220_5 are changed, the contents of the time queue 210 will also be changed accordingly.

[0045] In the operation of the flash memory controller 110 executing a command from the host device 50, in the normal mode or the default mode, the microprocessor 112 periodically reads the content in the time queue 210 to determine whether it is necessary to read and execute a command from the buffer memory 116. Specifically, the microprocessor 112 reads the first data (the earliest command information) in the time queue 210, for example Figure 2 The command processing circuit 142 reads the information of the other command O1 shown in the time queue 210, and reads and executes the other command O1 from the buffer memory 116 according to the information of the other command O1. After executing the other command O1, the command processing circuit 142 deletes the information of the other command O1 in the time queue 210, and overwrites the other command information in the time queue 210 in sequence, that is, the information of the other command O2 becomes the first data in the time queue 210, the information of the read command R1 becomes the second data in the time queue 210, and so on. In addition, since the time queue 210 and the other command virtual queue 220_3 are synchronized with each other, after the information of the other command O1 is removed from the time queue 210, the other command virtual queue 220_3 will also remove the information of the other command O1 itself, and overwrite the remaining information of the other commands O2-O4 in sequence. In addition, after the other command virtual queue 220_3 removes the information of the other command O1, since there are unused registers in the other command virtual queue 220_3, the command processing circuit 142 searches the time queue 210 to find out whether there are other commands that have not been recorded by the other command virtual queue 220_3. If so, the last register of the other command virtual queue 220_3 is written with the information of the other command.

[0046] Similar to the above operation, the microprocessor 112 then processes the other commands O2, read command R1, write command W1, ... corresponding to the time queue 210 in sequence, and the contents of the read command virtual queue 220_1, the write command virtual queue 220_2, the other command virtual queue 220_3, the task management command virtual queue 220_4 and the query command virtual queue 220_5 are synchronized with the time queue 210 to delete the related contents in sequence.

[0047] In addition, the microprocessor 112 can control the flash memory controller 110 to operate in one of a plurality of specific modes according to the user's settings or the control mechanism of the firmware, wherein the plurality of specific modes are used to indicate the priority order of at least a part of the read command, the write command, the task management command, the query command and other commands, or their execution methods (for example, executing one command or multiple commands at a time). For example, when the flash memory controller 110 operates in a specific mode, the microprocessor 112 will preferentially execute the content of the query command virtual queue 220_5, that is, the microprocessor 112 will directly read the information of the query command Q1 in the query command virtual queue 220_5, and read and execute the query command Q1 from the buffer memory 116 according to the information of the query command Q1. After executing the query command Q1, the command processing circuit 142 will delete the information of the query command Q1 in the query command virtual queue 220_5, and will also delete the information of the query command Q1 in the time queue 210, and will overwrite the information of the commands in the time queue 210 that are located after the query command Q1 in sequence. In addition, if there is no information of unexecuted query commands in the query command virtual queue 220_5, the microprocessor 112 will read the contents of the time queue 210 in sequence.

[0048] In another embodiment, the microprocessor 112 can set the task management command to have a higher priority, that is, the microprocessor 112 will directly read the information of the task management commands TM1 and TM2 in the task management command virtual queue 220_4 in sequence, and read the relevant commands from the buffer memory 116 according to the information of the task management commands TM1 and TM2 and execute them.

[0049] In another embodiment, the microprocessor 112 may set a specific mode to continuously execute a large number of read commands or write commands. Specifically, the microprocessor 112 may directly read information of multiple read commands from the read command virtual queue 220_1 at one time, or the microprocessor 112 may directly read information of multiple write commands from the write command virtual queue 220_2 at one time, and execute the related read / write commands accordingly.

[0050] As described above, when the microprocessor 112 sets a read command, a write command, a task management command, an inquiry command or other commands to have a higher execution priority, or the microprocessor 112 sets to continuously execute a large number of read commands or write commands, the microprocessor 112 will directly read the relevant content from the read command virtual queue 220_1, the write command virtual queue 220_2, the other command virtual queue 220_3, the task management command virtual queue 220_4 and the inquiry command virtual queue 220_5, without spending a lot of time searching for relevant command information from the time queue 210. Therefore, the command processing method of this embodiment can effectively increase the execution efficiency.

[0051] also, Figure 2 The number of virtual queues shown is for illustrative purposes only and is not intended to be limiting of the present invention. In other embodiments, the register 144 may be configured with more virtual queues or may only have a portion of the read command virtual queue 220_1, the write command virtual queue 220_2, the other command virtual queue 220_3, the task management command virtual queue 220_4, and the query command virtual queue 220_5. For example, the task management command virtual queue 220_4 and the query command virtual queue 220_5 may be configured to be independent of each other. Figure 2 In the illustrated embodiment, the task management commands and the inquiry commands are deleted, and they can be classified as other commands.

[0052] Figure 3 FIG. 1 is a flow chart of a control method of the flash memory controller 110 according to an embodiment of the present invention. Referring to the contents described in the above embodiment, the flow chart is as follows:

[0053] Step 300: The process starts.

[0054] Step 302: Set a time queue and at least one virtual queue.

[0055] Step 304: Receive a plurality of commands from a host device.

[0056] Step 306: Write the information of the plurality of commands into the time queue in sequence, and write the information of at least a part of the plurality of commands into the at least one virtual queue.

[0057] Step 308: Selectively read the time queue or the at least one virtual queue to read information of the plurality of commands.

[0058] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made according to the scope of the patent application of the present invention should fall within the scope of the present invention.

Claims

1. A flash memory controller, which is used to access a flash memory module, and the flash memory controller comprises: A transmission interface circuit is coupled to a host device, wherein the transmission interface circuit comprises: Waiting in line for a while; at least one virtual queue; and A command processing circuit, which is used to receive a plurality of commands from the host device, and write the information of the plurality of commands into the time queue in sequence, and write the information of at least a part of the plurality of commands into the at least one virtual queue; a buffer memory for storing the plurality of commands; and A microprocessor is used for selectively reading the time queue or the at least one virtual queue to read the information of the plurality of commands.

2. The flash memory controller according to claim 1, wherein: The at least one virtual queue includes a read command virtual queue, and the information of the at least one part of commands is information of at least one read command included in the plurality of commands.

3. The flash memory controller according to claim 1, wherein: The at least one virtual queue includes a write command virtual queue, and the information of the at least one part of commands is information of at least one write command included in the plurality of commands.

4. The flash memory controller according to claim 1, wherein: The at least one virtual queue includes a task management command virtual queue, and the information of the at least one part of the commands is the information of at least one task management command included in the plurality of commands.

5. The flash memory controller according to claim 1, wherein: The at least one virtual queue includes an inquiry command virtual queue, and the information of the at least one part of the commands is information of an inquiry command included in the plurality of commands.

6. The flash memory controller according to claim 1, wherein: The information of the at least one part of the commands stored in the at least one virtual queue is synchronized with the information of the at least one part of the commands stored in the time series.

7. The flash memory controller according to claim 6, wherein: When the flash memory controller operates in a normal mode or a preset mode, the microprocessor reads the information of the multiple commands from the time queue in sequence; and for each command information, after the microprocessor executes the corresponding command, the microprocessor deletes the command information in the time queue and also simultaneously deletes the command information in the at least one virtual queue.

8. The flash memory controller according to claim 7, wherein: When the flash memory controller operates in a specific mode, the microprocessor sequentially reads the information of at least a portion of the commands from the at least one virtual queue; and for each command information, after the microprocessor executes the corresponding command, the microprocessor deletes the command information in the at least one virtual queue and also synchronously deletes the command information in the time queue.

9. A control method of a flash memory controller, comprising: Setting a time queue and at least one virtual queue; receiving a plurality of commands from a master device; Writing information of the plurality of commands into the time queue in sequence, and writing information of at least a portion of the plurality of commands into the at least one virtual queue; and The time queue or the at least one virtual queue is selectively read to read information of the plurality of commands.

10. The control method according to claim 9, characterized in that: The at least one virtual queue includes a read command virtual queue, and the information of the at least one part of commands is information of at least one read command included in the plurality of commands.

11. The control method according to claim 9, characterized in that: The at least one virtual queue includes a write command virtual queue, and the information of the at least one part of commands is information of at least one write command included in the plurality of commands.

12. The control method according to claim 9, characterized in that: The at least one virtual queue includes a task management command virtual queue, and the information of the at least one part of the commands is the information of at least one task management command included in the plurality of commands.

13. The control method according to claim 9, characterized in that: The at least one virtual queue includes an inquiry command virtual queue, and the information of the at least one part of commands is information of an inquiry command included in the plurality of commands.

14. The flash memory controller according to claim 9, wherein: The information of the at least one part of the commands stored in the at least one virtual queue is synchronized with the information of the at least one part of the commands stored in the time series.

15. The flash memory controller according to claim 14, wherein: Selectively reading the time queue or the at least one virtual queue to read a portion of the information of the plurality of commands comprises: When the flash memory controller operates in a normal mode or a default mode, sequentially reading information of the plurality of commands from the time queue; as well as For each command information, after the corresponding command is executed, the command information in the time queue is deleted, and the command information in the at least one virtual queue is also deleted synchronously.

16. The flash memory controller according to claim 15, wherein: Selectively reading the time queue or the at least one virtual queue to read a portion of the information of the plurality of commands comprises: When the flash memory controller operates in a specific mode, sequentially reading information of the at least a portion of the commands from the at least one virtual queue; and For each command information, after the corresponding command is executed, the command information in the at least one virtual queue is deleted, and the command information in the time queue is also deleted synchronously.