Flash memory physical resource set management device and method and computer readable storage medium
By using an address conversion circuit in the flash memory physical resource collection management device to convert the access address of the flash memory translation layer into a relative address, the operation blocking problem caused by multiple applications sharing flash memory resources is solved, system performance is improved, and firmware design is simplified. .
Patent Information
- Application Number
- CN201910925890.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-06-21
- Filing Date
- 2019-09-27
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-09-27
AI Technical Summary
In the existing flash memory standards, multiple applications share flash memory physical resources, resulting in operational obstruction between applications and reducing system performance. Furthermore, the firmware design of the new generation flash memory standards is complex, which may lead to difficulty in program code maintenance and execution errors.
Design a flash memory physical resource collection management device, including a random access memory, a processing unit and an address conversion circuit. The address conversion circuit converts the memory address of the flash memory conversion layer into a relative address, reducing the hardware and software required under the design of multiple flash memory conversion layers. Resource consumption enables a single FTL to manage multiple collections.
The access address of the flash memory translation layer is converted to the relative address in the allocation space of the associated physical resource set through the address translation circuit, which reduces the consumption of software and hardware resources under the design of multiple flash memory translation layers, improves system performance and reduces program code complexity. Maintenance difficulty.
Smart Images

Figure CN112115067B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a storage device, and in particular to a flash memory physical resource set management device and method and a computer-readable storage medium. Background Art
[0002] Flash memory is usually divided into NOR flash memory and NAND flash memory. NOR flash memory is a random access device. The central processing unit (Host) can provide any address to access the NOR flash memory on the address pin and obtain the data stored at the address from the data pin of the NOR flash memory in a timely manner. In contrast, NAND flash memory is not random access, but serial access. NAND flash memory cannot access any random address like NOR flash memory. Instead, the central processing unit needs to write serial byte values to the NAND flash memory to define the type of request command (such as read, write, erase, etc.) and the address used in this command. The address can point to a page (the smallest data block for write operations in flash memory) or a block (the smallest data block for erase operations in flash memory).
[0003] In the current flash memory standard, all applications share the physical resources in the flash memory device, which may cause one application to block the operation of another application when accessing the flash memory device, thereby reducing the performance of the system. The new generation of flash memory standards (such as Non-Volatile Memory Express NVMe 1.4) divides the flash memory physical resources into multiple sets, each set containing a portion of channels (Channels) and logical unit numbers (Logical Unit Numbers LUNs). Each of the different applications can only perform operations such as read, write, and erase on the physical resources of one set, reducing the possibility of mutual blocking between applications and improving the performance of the system. The firmware in the flash memory controller needs to be redesigned to support this new specification. However, if the new firmware is poorly designed, it may make it difficult to maintain the program code. In the worst case, it may cause unexpected errors during execution. Therefore, the present invention proposes a flash memory physical resource set management device and method and a computer-readable storage medium to solve the above-mentioned problems. Summary of the invention
[0004] In view of this, how to alleviate or eliminate the deficiencies in the above-mentioned related fields is indeed a problem to be solved.
[0005] The present invention proposes a flash memory physical resource set management device, comprising: a random access memory; a processing unit; and an address conversion circuit. The random access memory comprises a plurality of temporary storage spaces, each of which stores variables associated with a specific flash memory physical resource set. The processing unit accesses user data in the flash memory physical resource set when executing a program code of a flash memory conversion layer. The address conversion circuit receives a memory address issued by the flash memory conversion layer, converts the memory address into a relative address in a temporary storage space associated with the flash memory conversion layer, and outputs the relative address to the random access memory for accessing the variables in the temporary storage space.
[0006] The present invention further proposes a flash memory physical resource set management method, which is implemented when a processing unit loads and executes a program code of a flash memory conversion layer, and includes the following steps: during the execution of the operation, after writing the number of the physical resource set corresponding to the flash memory conversion layer to the set selection register in the address conversion circuit, transmitting the memory address of the variable value to be read or written to the address conversion circuit, so that the address conversion circuit converts the memory address to a relative address in the allocated space corresponding to the physical resource set, and outputs the relative address to a random access memory; and reading the variable value from the relative address of the random access memory, or writing the variable value to the relative address of the random access memory.
[0007] The present invention further proposes a computer-readable storage medium for flash memory physical resource set management, which is used to store a computer program of a flash memory conversion layer that can be loaded and executed by a processing unit. When the computer program is executed by the processing unit, the following steps are implemented: during the execution of the operation, after writing the number of the physical resource set corresponding to the flash memory conversion layer to the set selection register in the address conversion circuit, the memory address of the variable value to be read or written is transmitted to the address conversion circuit, so that the address conversion circuit converts the memory address to a relative address in the allocated space corresponding to the physical resource set, and outputs the relative address to the random access memory; and reading the variable value from the relative address of the random access memory, or writing the variable value to the relative address of the random access memory.
[0008] One of the advantages of the above embodiment is that the memory address issued by the flash translation layer access is converted into a relative address in the allocation space of the associated physical resource set by the address conversion circuit, which can reduce the software and hardware resources consumed in the design architecture of multiple flash translation layers.
[0009] Other advantages of the present invention will be explained in more detail with reference to the following description and accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0011] Figure 1 FIG. 4 is a schematic diagram of a system architecture of a flash memory according to an embodiment of the present invention.
[0012] Figure 2 A schematic diagram of the connection between a flash memory interface and a logical unit number (LUN).
[0013] Figure 3 A schematic diagram of the relationship between the command queue and the Flash Translation Layer (FTL).
[0014] Figure 4 and Figure 5 FIG. 4 is a block diagram of a random access memory and an address conversion circuit according to an embodiment of the present invention.
[0015] Figure 6 is a flow chart of a data processing method according to an embodiment of the present invention.
[0016] [List of Reference Numerals]
[0017] 10 Electronic devices
[0018] 100 hosts
[0019] 110 CPU
[0020] 120, 131 Random Access Memory
[0021] 230 Storage Device
[0022] 232 Host Interface
[0023] 233 Processing Units
[0024] 234 Data storage media
[0025] 235 Flash Memory Controller
[0026] 236 Memory Controller
[0027] 237 Flash memory interface
[0028] 239 Logical Unit Numbers (LUNs)
[0029] 239#0~239#11 LUN
[0030] CH#0~CH#3 Output and input channels
[0031] CE#0~CE#3 enable signal
[0032] 310#0~310#2 Submission queue
[0033] 330#0~330#2 Completed queue
[0034] 350#0~350#2 Flash translation layer
[0035] CQH, CQT, SQH, SQT pointers
[0036] 500, 600 address conversion circuit
[0037] 510, 610 Set selection register
[0038] 530 Offset register
[0039] 550 Multiplier
[0040] 570, 670 Adder
[0041] 631, 633, 635 address registers
[0042] 650 Multiplexer
[0043] Addr Memory address
[0044] Addr* Relative address
[0045] CMD command
[0046] Ctrl control signal
[0047] DAT variable value
[0048] 2311 Storage Unit
[0049] 2313 Read and Write Control Circuit
[0050] 2315 Data Buffer
[0051] 2317 Command and address decoder
[0052] S610~S690 Method Steps DETAILED DESCRIPTION
[0053] The embodiments of the present invention will be described below with reference to the accompanying drawings. In these drawings, the same reference numerals represent the same or similar components or method flows.
[0054] It must be understood that the words "comprise", "include" and the like used in this specification are used to indicate the existence of specific technical features, values, method steps, job processing, components and / or assemblies, but do not exclude the addition of more technical features, values, method steps, job processing, components, assemblies, or any combination of the above.
[0055] The words "first", "second", "third", etc. used in the present invention are used to modify the components in the claims, and are not used to indicate a priority order, a prior relationship, or that one component precedes another, or a time sequence when executing method steps. They are only used to distinguish components with the same name.
[0056] It should be understood that when a component is described as being "connected" or "coupled" to another component, it can be directly connected or coupled to the other component, and there may be intervening components. Conversely, when a component is described as being "directly connected" or "directly coupled" to another component, there are no intervening components. Other words used to describe the relationship between components can also be interpreted in a similar manner, such as "between" versus "directly between", or "adjacent" versus "directly adjacent", etc.
[0057] refer to Figure 1 The electronic device 10 includes a host 100 and a storage device 230. The host 100 mainly includes a central processing unit 110 and a random access memory (RAM). The electronic device 10 is, for example, a personal computer, a laptop computer (Laptop PC), a tablet computer, a mobile phone, a digital camera, a digital video camera, and other electronic products. A specific part of the random access memory 120 can be configured as a data buffer.
[0058] The storage device 230 may include a processing unit 233 and a data storage medium 234, and may also include a random access memory 231 to improve the performance of the storage device 230. The processing unit 233 may receive commands from the central processor 110 through a host interface (Host Interface) 232, and instruct the flash controller 235 to perform data reading, writing, erasing and other operations accordingly. The host interface 232 may comply with communication protocols such as Universal Flash Storage (UFS), Non-Volatile Memory Express (NVMe), Universal Serial Bus (USB), Advanced Technology Attachment (ATA), Serial Advanced Technology Attachment (SATA), and Peripheral Component Interconnect Express (PCI-E). Any of the CPU 110 and the processing unit 233 can be implemented in a variety of ways, such as using general-purpose hardware (e.g., a single processor, a multiprocessor with parallel processing capabilities, a graphics processor, or other processors with computing capabilities), and provide the functions described below when executing software and / or firmware instructions. The processing unit 233 also includes a memory controller 236 to control the operation of the random access memory 231, so that the processing unit 233 can use the random access memory 231 to store data required during operation, such as variables, data tables, etc.
[0059] The data storage medium 234 may be composed of a plurality of logical unit numbers (LUNs) 239. The flash memory controller 235 communicates with the data storage medium 234 through a flash memory interface 237. Specifically, the flash memory interface 237 may comply with / support the double data rate (DDR) communication protocol of the Open NAND Flash Interface (ONFI), a double data rate switch (DDR Toggle), or other interfaces. The flash memory controller 235 of the storage device 230 writes user data to a specified address (destination address) of the LUNs 239 in the data storage medium 234 through the flash memory interface 237, and reads user data from a specified address (source address) in the LUNs 239. The flash memory interface 237 uses a plurality of electronic signals to coordinate the data and command transmission between the flash memory controller 235 and the LUNs 239, including a data line, a clock signal, and a control signal. The data lines can be used to transmit commands, addresses, read and write data; the control signal lines can be used to transmit control signals such as chip enable (CE), address latch enable (ALE), command latch enable (CLE), write enable (WE), etc. The processing unit 233 and the flash memory controller 235 can exist separately or be integrated into the same chip.
[0060] LUNs 239 provide a large amount of storage space, usually hundreds of Gigabytes or even Terabytes, which can be used to store a large amount of user data, such as high-resolution pictures, movies, etc. LUNs 239 include control circuits and flash memory arrays. The storage cells in the flash memory array can be triple-level cells (TLCs) or quad-level cells (QLCs).
[0061] The random access memory 231 can be used to cache user data that the CPU 110 is about to write to the LUN 239, user data that is read from the LUN 239 and is about to be knocked out to the CPU 110, and the logical-physical address mapping table (Logical-Physical Addresses Mapping Table, L2P mapping table) required for search. The random access memory 231 can also store data required in the process of executing software and firmware instructions, such as variables, data tables, etc. The random access memory 231 can include static random access memory (State Random Access Memory, SRAM), dynamic random access memory (Dynamic Random Access Memory, DRAM), or both.
[0062] refer to Figure 2 The flash memory interface 237 may include four I / O channels (hereinafter referred to as channels) CH#0 to CH#3, each of which is connected to four LUNs 239, for example, channel CH#0 is connected to LUNs 239#0, 239#4, 239#8 and 239#12. A die may include one LUN or multiple LUNs 239, each of which may be controlled by a specific CE signal. Therefore, the flash memory controller 235 may drive the flash memory interface 237 to send one of the start signals CE#0 to CE#3 to start LUNs 239#0 to 239#3, 239#4 to 239#7, 239#8 to 239#11, or 239#12 to 239#15, and then read user data from the started LUN 239 in parallel, or write user data to the started LUN 239.
[0063] In the new flash memory standard, channels and LUNs 239 can be set into multiple sets (Sets), so that each set only contains a part of the channels and LUNs 239, and the multiple sets are operated and managed independently. For example, physical resources can be divided into three sets: Set #0 contains channels CH #0 and CH #1, and LUNs 239 #0-1, 239 #4-5, 239 #8-9, and 239 #12-13; Set #1 contains channel CH #2, and LUNs 239 #2, 239 #6, 239 #10, and 239 #14; Set #2 contains channel CH #3, and LUNs 239 #3, 239 #7, 239 #11, and 239 #15.
[0064] After the CPU 110 sets the channels and LUNs 239 into multiple sets, the CPU 110 configures multiple queues in the RAM 120, each queue being independently associated with a set. Figure 3 For example, Set#0 is associated with Submission Queue SQ 310#0 and Completion Queue CQ 330#0, Set#1 is associated with Submission Queue 310#1 and Completion Queue 330#1, and Set#2 is associated with Submission Queue 310#2 and Completion Queue 330#2. Each submission queue is used to store host commands (HostCommands) from the central processor 110, and the host commands are finally read and executed by the storage device 230. Each completion queue is used to store the completion element (CE) generated after the storage device 230 executes the host command. The completion element will display the execution result of the host command, such as success or failure. The central processor 110 can read the completion element to know the execution result of the host command. Each of the submission queue and the completion queue contains a collection of multiple entries. Each entry in the submission queue 310 can store a host command, or more specifically, an input / output command (I / O Command), such as a data read, data write command, etc. The items in the collection are preferably stored in sequence. The basic principle of the operation of the queue is to add entries from the end position (such as the position pointed to by the pointer SQT or CQT) (which can be called enqueue), and remove entries from the starting position (such as the position pointed to by the pointer SQH or CQH) (which can be called dequeue). In other words, the first command added to the submission queue will also be the first to be removed. In this way, the central processor 110 can output multiple input / output commands, which are then read, executed and returned by the processing unit 233 / flash memory controller 235 of the storage device 230. Finally, the central processor 110 can know the execution result of the host command.
[0065] For the configuration supporting multiple sets, the processing unit 233 may start and execute multiple FTLs, and each FTL is independently associated with a set. Figure 3For example, Set#0 is associated with FTL 350#0, Set#1 is associated with FTL350#1, and Set#2 is associated with FTL 350#2. FTL 350 is mainly responsible for mapping the logical block addresses (LBAs) of user data (referred to as data) from the host 100 to physical addresses in LUNs 239, which is also called logical-physical address conversion, where the physical address can be represented by information such as channel ID, block ID, page ID and segment ID. In order to improve the wear resistance of storage units in LUNs 239, the physical position of LBA may be dynamically changed in data management algorithms such as wear leveling, garbage collection, and data migration. The following takes FTL 350#0 as an example, and those skilled in the art can apply it to other flash translation layers after appropriate modifications. In some embodiments, when the processing unit 233 executes FTL 350#0, it reads (or fetches) the earliest arriving I / O command for Set#0 from the submission queue 310#0, and drives the flash interface 237 to operate LUNs 239 through the flash controller 235 according to the parameters (such as LBA, etc.) in the I / O command to complete the execution of the I / O command. After the operation is completed, the processing unit 233 executes FTL 350#0 and writes the completion component to the completion queue 330#0. Finally, the CPU 110 can read the completion component to determine the execution result of the I / O command. In other embodiments, for example, in the background mode, when the processing unit 233 executes FTL 350#0, it can autonomously drive the flash interface 237 to operate LUNs 239 through the flash controller 235 to complete specific background operations, such as: wear leveling, garbage collection, data migration and other programs.
[0066] However, the above design has significant shortcomings. When the processing unit 233 executes multiple FTLs 350 to access multiple sets, not only will a lot of software and hardware resources be consumed, but the switching and reading of multiple FTLs 350 will also consume a lot of time. In order to overcome the above shortcomings, the present invention discloses a data processing method that only executes and manages one FTL 350, and sets multiple sets of variables required for the operation of FTL 350, each set of variables can be associated with a set. When accessing any next set, FTL 350 only needs to save / update the variables associated with the current set, and then obtain the variables associated with the next set. FTL 350 can use the variables associated with the next set to access the next set. In this way, the purpose of managing / accessing multiple sets with a single FTL 350 can be achieved.
[0067] In order to achieve the above purpose, first, we need to determine the variables associated with the set, and the remaining variables are variables not associated with the set. The variables associated with the set (hereinafter referred to as variables) include the active block number (Active Block Number), the active page pointer (Active Page Pointer), the total number of spare blocks in each plane (Spare Block Amount), the wear count value of each block (Wear-leveling Count), the erase count value of each block (Erase Count), etc. The example of variable declaration (Variable Declaration) is as follows:
[0068] Private garActiveFBlock;
[0069] Private garActiveFPage;
[0070] Private garSpareFBlock[C_MaxPlane];
[0071] Private garWearLevelingCnt[C_MaxBlock];
[0072] Private garBlockEraseCnt[C_MaxBlock];
[0073] Wherein, parameter C_MaxPlane indicates the total number of data planes in a specific set, parameter C_MaxBlock indicates the total number of blocks in a specific set, garActiveFBlock indicates the active block number in a specific set, garActiveFPage indicates the active page pointer in a specific set, garSpareFBlock[] indicates the total number of idle blocks in each plane in a specific set, garWearLevelingCnt[] indicates the wear count value of each block in a specific set, and garBlockEraseCnt[] indicates the erase count value of each block in a specific set. Since the variable is associated with a specific set, the variable is preferably declared as a local (private) variable, and can also be declared as a public (Public) variable.
[0074] Next, the storage address of the variable is determined. The present invention allocates multiple segments of temporary storage space in the random access memory 231, and each segment of temporary storage space stores a variable associated with a set. Figure 4For example, the random access memory 231 includes a storage unit 2311, wherein the temporary storage space formed by the memory address ranges 0xA000-0xAFFFF, 0xB000-0xBFFF and 0xC000-0xCFFF stores variables associated with the sets Set#0, Set#1 and Set#2 respectively.
[0075] Finally, an address conversion circuit 500 is provided in the storage device 230, preferably in the memory controller 236, for converting the memory address of the specific set of variables to be accessed by the FTL 350 to the memory address of the specific temporary storage space. In some embodiments, the address conversion circuit 500 can be implemented as follows: Figure 4 The address conversion circuit 500 can use formula (1) to convert the memory address to be accessed by the FTL into the relative address Addr* in the temporary storage space of the corresponding set:
[0076] Addr*=Addr+SET×OFFSET
[0077] Wherein, Addr represents the memory address to which the FTL wants to write or read data, SET represents the set number stored in the set selection register 510, and OFFSET represents the value stored in the offset register 530, which represents the total length of the memory space allocated to a set. When executing the FTL 350, the processing unit 233 sets the value in the set selection register 510 to the number of the corresponding set. For example, when the FTLs 350 is executed and before accessing the random access memory 231, "0", "1" and "2" are stored in the set selection register 510 respectively. The offset register 530 can be stored with a default value before the storage device 230 leaves the factory or in the boot program of the storage device 230. The multiplier 550 is coupled to the set selection register 510, the offset register 530 and the adder 570, and is used to multiply the values in the set selection register 510 and the offset register 530, and output the calculation result to the adder 570. The adder 570 is coupled to the processing unit 233 , receives the memory address Addr to be accessed by the FTL 350 from the processing unit 233 , adds the calculation result output by the multiplier 550 to the memory address Addr to generate a relative address Addr*, and the memory controller 236 outputs the relative address Addr* to the random access memory 231 .
[0078] The random access memory 231 includes a command and address decoder 2317 coupled to the memory controller 236. The command and address decoder 2317 receives and interprets the command CMD issued by the FTL 350 from the memory controller 236, and receives and interprets the relative address Addr* from the memory controller 236. The random access memory 231 also includes a read / write control circuit 2313 and a data buffer 2315. The read / write control circuit 2313 is coupled to the storage unit 2311 and the command and address decoder 2317, and the data buffer 2315 is coupled to the read / write control circuit 2313 and the processing unit 233. The read / write control circuit 2313 receives a read command and a read address from the command and address decoder 2317, reads data of a specified length from the read address (or the starting address) of the storage unit 2311, and outputs the data to the data buffer 2315, so that the FTL 350 executed by the processing unit 233 can obtain a specific variable value DAT from the data buffer 2315. In addition, the read / write control circuit 2313 receives a write command and a write address from the command and address decoder 2317 , obtains the variable value DAT to be written by the FTL 350 executed by the processing unit 233 from the data buffer 2315 , and writes the variable value DAT into the write address of the storage unit 2311 .
[0079] In some other embodiments, the address conversion circuit 500 may be implemented as follows: Figure 5 The structure shown. Figure 5 , the set selection register 610 is similar to Figure 4The set selection register 510 in the address conversion circuit 500 is used to allow the FTL 350 to store the number of the corresponding set when executing. The address conversion circuit 500 includes a plurality of address registers, each of which stores the starting address of the variable corresponding to a set. For example, the first to third address registers 631, 633 and 635 store the starting addresses "0xA0000", "0xB0000" and "0xC0000" of the variables of the sets Set#0 to Set#2, respectively. The first to third address registers 631, 633 and 635 can be stored with default values before the storage device 230 leaves the factory or in the boot procedure of the storage device 230. The address conversion circuit 500 includes a multiplexer 650, which is coupled to the first to third address registers 631, 633 and 635, the set selection register 610, and an adder 670, and is used to connect one of the first to third address registers 631, 633 and 635 to the adder 670 according to the control signal Ctrl corresponding to the value in the set selection register 610. For example, when the value in the set selection register 610 is "0", the multiplexer 650 connects the first address register 631 to the adder 670; when the value in the set selection register 610 is "1", the multiplexer 650 connects the first address register 633 to the adder 670, and so on. The adder 670 is coupled to the processing unit 233, receives the memory address Addr to be accessed by the FTL 350 from the processing unit 233, adds the start address output by the multiplexer 650 to the memory address Addr to generate a relative address Addr*, and the memory controller 236 outputs the relative address Addr* to the random access memory 231.
[0080] Whether Figure 4 or Figure 5 The address conversion circuit 500 shown, for example, when the FTL 350 stores "0" to the set selection register 510 or 610 and issues the memory address 0x0010 to the memory controller 236, the memory controller 236 outputs the relative address 0xA010 to the random access memory 231; when the FTL 350 stores "1" to the set selection register 510 or 610 and issues the memory address 0x0010 to the memory controller 236, the memory controller 236 outputs the relative address 0xB010 to the random access memory 231; when the FTL 350 stores "2" to the set selection register 510 or 610 and issues the memory address 0x0010 to the memory controller 236, the memory controller 236 outputs the relative address 0xC010 to the random access memory 231.
[0081] Response Figure 4 or Figure 5 The address conversion circuit 500 is set, referring to Figure 6The embodiment of the data processing method of the present invention is shown, and the method is implemented when the processing unit 233 loads and executes the program code of the FTL 350 .
[0082] Step S610: The processing unit 233 obtains a target input / output command from one of the plurality of submission queues, wherein each submission queue is associated with a set. For example, submission queue 310#0 is associated with Set#0, submission queue 310#1 is associated with Set#1, and submission queue 310#1 is associated with Set#1. When the processing unit 233 executes FTL 350, it may read one or more input / output commands associated with Set#0 from submission queue 310#0 as target input / output commands, or read one or more input / output commands associated with Set#1 from submission queue 310#1 as target input / output commands, or read one or more input / output commands associated with Set#2 from submission queue 310#2 as target input / output commands. The FTL preferably reads different sets of I / O commands from the submission queue 310#0, submission queue 310#1, and submission queue 310#2 in turn, or determines the reading order and number of submission queue 310#0, submission queue 310#1, or submission queue 310#2 according to the weight setting. For example, the FTL 350 reads an I / O command associated with Set#0 from the submission queue 310#0 as the target I / O command.
[0083] Step S630: The processing unit 233 writes the set number corresponding to one of the plurality of submission queues to the memory controller 236. For example, when the processing unit 233 executes the FTL 350, after reading the target input / output command associated with Set#0 from the submission queue 310#0, it writes "0" to the set selection register 510 or 610 in the memory controller 236.
[0084] Step S650: The processing unit 233 outputs the instruction and the memory address Addr to the memory controller 236 to access the target variable. Since the processing unit 233 writes "0" to the set selection register 510 or 610 of the memory controller 236, the memory controller 236 converts the memory address Addr into a relative address Addr*, and the processing unit 233 accesses the target variable stored at the relative address Addr* in the random access memory 231 through the memory controller 236. In other words, the FTL 350 can read the variable associated with Set#0 from the relative address Addr* in the random access memory 231, or write the variable associated with Set#0 to the relative address Addr* in the random access memory 231.
[0085] Step S670: The processing unit 233 executes the target output input command according to the target variable. After obtaining the target variable, the FTL 350 can correctly execute the target output input command or correctly update the target variable. For example, the processing unit 233 executes the FTL 350 to read data from LUNs 239#0-1 or write data from 239#4-5 according to the variable associated with Set#0.
[0086] Step S690: The processing unit 233 writes the execution result of the target I / O command to the completion queue corresponding to one of the multiple submission queues. For example, if the data of LUNs 239#0-1 is read successfully, the processing unit 233 executes FTL 350 and writes the completion component indicating the successful execution to the completion queue 330#0. The CPU 110 reads the completion component in the completion queue 330#0 to obtain the execution result of the I / O command in the submission queue 310#0.
[0087] All or part of the steps in the method described in the present invention can be implemented in a computer program, such as an operating system of a computer, a driver for specific hardware in a computer, or a software program. In addition, it can also be implemented in other types of programs as shown above. A person with ordinary knowledge in the art can write the method of the embodiment of the present invention into a computer program, which will not be described for simplicity. The computer program implemented according to the method of the embodiment of the present invention can be stored in an appropriate computer-readable data carrier, such as a DVD, CD-ROM, USB, hard disk, or can be placed in a network server that can be accessed through a network (e.g., the Internet, or other appropriate carriers).
[0088] Although Figure 1 , Figure 2 , Figure 4 and Figure 5 The components described above are included, but it does not exclude the use of more additional components without violating the spirit of the invention to achieve better technical effects. Figure 6 The flowchart is executed in a specified order, but without violating the spirit of the invention, a person skilled in the art can modify the order of these steps while achieving the same effect, so the present invention is not limited to the order described above. In addition, a person skilled in the art can also integrate several steps into one step, or perform more steps sequentially or in parallel in addition to these steps, and the present invention is not limited thereto.
[0089] Although the present invention is described using the above embodiments, it should be noted that these descriptions are not intended to limit the present invention. On the contrary, the present invention covers obvious modifications and similar arrangements that are obvious to those skilled in the art. Therefore, the scope of the claims should be interpreted in the broadest way to include all obvious modifications and similar arrangements.
Claims
1. A flash memory physical resource set management device, characterized in that: Include: A random access memory including a plurality of temporary storage spaces, each temporary storage space storing variables associated with a specific set of flash memory physical resources; A processing unit, coupled to the random access memory, accesses user data in the flash memory physical resource set when executing the program code of the flash translation layer; as well as an address conversion circuit coupled to the random access memory, receiving a memory address issued by the flash translation layer, converting the memory address into a relative address in a segment of temporary storage space associated with the flash translation layer, and outputting the relative address to the random access memory for accessing a variable in the segment temporary storage space, Wherein, the address conversion circuit comprises: Set selection register; a multiplier, coupled to the set selection register, for multiplying the value in the set selection register by the total length of the temporary storage space allocated to each flash memory physical resource set to generate a calculation result; as well as An adder, coupled to the multiplier, adds the calculation result to the memory location to generate the relative address, and outputs the relative address to the random access memory.
2. The flash memory physical resource set management device according to claim 1, characterized in that: Include: an offset register, coupled to the multiplier, storing the total length of the temporary storage space allocated to each flash memory physical resource set, Wherein, before accessing the random access memory, the flash translation layer sets the value in the set selection register to the serial number of the associated flash physical resource set.
3. The flash memory physical resource set management device according to any one of claims 1 to 2, characterized in that: The flash memory physical resource set includes a portion of a plurality of channels and a portion of a plurality of logical unit numbers.
4. A flash memory physical resource set management method, used for processing units to load and execute program codes of a flash memory translation layer, characterized in that: Include: During the execution of the operation, after writing the number corresponding to the physical resource set to the set selection register in the address conversion circuit, the memory address of the variable value to be read or written is transmitted to the address conversion circuit, so that the address conversion circuit converts the memory address to a relative address in the allocation space corresponding to the physical resource set, and outputs the relative address to the random access memory; and reads the variable value from the relative address of the random access memory, or writes the variable value to the relative address of the random access memory, Wherein, the address conversion circuit is configured to implement the following steps: Multiplying the value in the set selection register by the total length of the temporary storage space allocated to each flash physical resource set to generate a calculation result; and The calculation result is added to the memory location to generate the relative address, and the relative address is output to the random access memory.
5. The flash memory physical resource set management method according to claim 4, characterized in that: The operation is associated with an input / output command read from a submission queue, or the operation is a background operation independent of the host.
6. The flash memory physical resource set management method according to claim 4, characterized in that: The random access memory includes a plurality of temporary storage spaces, each of which stores variables associated with a specific flash memory physical resource set.
7. The flash memory physical resource set management method according to any one of claims 4 to 6, characterized in that: Include: During the execution of the operation, the flash memory interface is driven to access the user data in the physical resource set.
8. A computer-readable storage medium for managing a collection of flash memory physical resources, for storing a computer program of a flash memory translation layer that can be executed by a processing unit, characterized in that: When the computer program is executed by the processing unit, the following steps are implemented: During the execution of the operation, after writing the number corresponding to the physical resource set to the set selection register in the address conversion circuit, the memory address of the variable value to be read or written is transmitted to the address conversion circuit, so that the address conversion circuit converts the memory address to a relative address in the allocation space corresponding to the physical resource set, and outputs the relative address to the random access memory; and reads the variable value from the relative address of the random access memory, or writes the variable value to the relative address of the random access memory, Wherein, the address conversion circuit is configured to implement the following steps: Multiplying the value in the set selection register by the total length of the temporary storage space allocated to each flash physical resource set to generate a calculation result; and The calculation result is added to the memory location to generate the relative address, and the relative address is output to the random access memory.
9. The computer-readable storage medium for managing a flash memory physical resource set according to claim 8, wherein: When the computer program is executed by the processing unit, the following steps are implemented: During the execution of the operation, the flash memory interface is driven to access the user data in the physical resource set.
