Firmware-controlled table-based conditional action for flexible storage controllers

The firmware instructions of NAND flash memory devices are managed through condition tables and sequencing tables, which optimizes the performance and flexibility of the storage system, solves the efficiency problems of device management and exception handling in the existing technology, and realizes the operation of different manufacturers' devices on devices. Efficient performance management and rapid recovery.

CN115878501BActive Publication Date: 2024-09-10NANJING TENAFE ELECTRONIC TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210891154.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-07-15
Filing Date
2022-07-27
Publication Date
2024-09-10
Estimated Expiration
2042-07-27

AI Technical Summary

Technical Problem

Existing storage controllers are difficult to effectively optimize performance and flexibility when managing NAND flash memory devices from multiple manufacturers, especially in terms of size, cost and power consumption, and lack efficient solutions when handling exceptions. plan.

Method used

Use condition tables and sequencing tables to manage storage media devices, select appropriate instruction sequences through the conditions and status information of firmware instructions, optimize the performance of the storage system, and prioritize instructions in the exception handling set during exception handling to reduce the need for non-exception Effects of treatment sets.

Benefits of technology

It achieves flexibility and efficient performance management on devices from different manufacturers, reducing firmware complexity and power consumption, while quickly restoring system performance under abnormal conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115878501B_ABST
    Figure CN115878501B_ABST
Patent Text Reader

Abstract

Firmware-controlled table-based conditional action for a flexible storage controller is provided. Based at least in part on: (1) a condition table including one or more conditions for processing multiple firmware instructions and (2) status information, (one or more) firmware instructions are selected from the multiple firmware instructions. Based at least in part on: (1) the condition table and (2) the status information, it is determined how to process the one or more selected firmware instructions. In the case where the determined processing is to execute the selected firmware instructions, at least in part based on the one or more selected firmware instructions, an instruction sequence is obtained from a sequencing table including one or more instruction sequences associated with a storage media device. In the case where the determined processing is to execute the one or more selected firmware instructions, the obtained instruction sequence is output to the storage media device.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Cross-references to other applications

[0002] This application claims priority to U.S. Provisional Patent Application No. 63 / 226,009, filed on July 27, 2021, entitled “FIRMWARE CONTROLLED HARDWARE SEQUENCE HANDLING FOR REGULAR AND EXCEPTION CASES,” which is incorporated herein by reference for all purposes. Background Art

[0003] Storage systems, such as NAND flash memory systems, are composed of multiple components, each of which may be manufactured by a variety of manufacturers. For example, in a storage system, storage media devices (e.g., NAND flash memory devices) may be manufactured by a variety of companies. New and improved storage controllers are desirable that can better manage a variety of storage media devices from various manufacturers under various conditions (e.g., normal processing as well as exception processing) in a manner that is sensitive to size, cost, and / or power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0004] Various embodiments of the invention are disclosed in the following detailed description and accompanying drawings.

[0005] Figure 1 is a diagram illustrating an embodiment of a memory system having a NAND flash interface controller including a condition table via which firmware specifies to hardware conditions for processing firmware instructions.

[0006] Figure 2 is a flow chart illustrating an embodiment of a process for managing a storage medium device using a condition table and a sequencing table.

[0007] Figure 3 is a diagram illustrating an embodiment of a NAND flash interface controller in which table-based conditions are implemented using a pre-sequence queue table, a pre-sequence execution table, and a post-sequence update table.

[0008] Figure 4 is a diagram illustrating an example of a condition table.

[0009] Figure 5 is a diagram illustrating an embodiment of state information including state information associated with multiple dies in a NAND flash memory device.

[0010] Figure 6 is a diagram illustrating one embodiment in which an erase operation is conditionally suspended so that a program operation can be performed, and then the suspended erase operation is resumed when the program operation is complete.

[0011] Figure 7 is a diagram illustrating an embodiment of signal paths in a NAND flash interface controller associated with command or operation skipping.

[0012] Figure 8 is a flow chart illustrating an embodiment of exception handling using a condition table.

[0013] Figure 9 is a diagram illustrating an embodiment of a storage controller that performs exception handling using state information including exception handling state variables.

[0014] Figure 10 is a diagram illustrating an embodiment of non-exception handling firmware instructions that are stalled in favor of exception handling firmware instructions. DETAILED DESCRIPTION

[0015] The present invention may be implemented in a variety of ways, including as a process; an apparatus; a system; a composition of matter; a computer program product embodied on a computer-readable storage medium; and / or a processor, such as a processor configured to execute instructions stored on and / or provided by a memory coupled to the processor. In this specification, these implementations, or any other form that the invention may take, may be referred to as techniques. In general, the order of steps of the disclosed processes may be changed within the scope of the present invention. Unless otherwise specified, a component such as a processor or memory described as being configured to perform a task may be implemented as a general-purpose component that is temporarily configured to perform a task at a given time, or as a specific component manufactured to perform the task. As used herein, the term "processor" refers to one or more devices, circuits, and / or processing cores that are configured to process data, such as computer program instructions.

[0016] The following provides a detailed description of one or more embodiments of the present invention, together with the accompanying drawings that illustrate the principles of the invention. The present invention is described in conjunction with such embodiments, but the invention is not limited to any embodiment. The scope of the present invention is limited only by the claims, and the present invention encompasses many alternatives, modifications, and equivalents. In order to provide a thorough understanding of the present invention, many specific details are set forth in the following description. These details are provided for illustrative purposes, and the present invention can be practiced according to the claims without some or all of these specific details. For the purpose of clarity, technical material known in the technical field related to the present invention has not been described in detail to avoid unnecessarily obscuring the present invention.

[0017] Figure 1The present invention is a diagram illustrating an embodiment of a storage system having a NAND flash interface controller including a condition table, via which firmware specifies conditions for processing firmware instructions to hardware. In this example, the storage system (101) includes a storage controller (100) that manages a storage media device, which in this example is a NAND flash memory device (106). The storage controller (100) is implemented on a system on a chip (SOC) that includes firmware (102) and a NAND flash interface controller (104), wherein the NAND flash interface controller (104) is implemented on hardware (e.g., an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA)).

[0018] In this example, the storage system (101) is designed to use a variety of NAND flash memory devices (106) manufactured by multiple vendors. As such, the storage controller (100) needs to be able to support different storage media devices from different vendors and / or manufacturers (e.g., where the different storage media devices have different supported operations, different register locations, different command or instruction sequences, different timing requirements, etc.). Using multiple storage media device vendors can reduce the risk of supply chain issues and / or enable vendors to compete with each other for better prices, which may be desirable for the manufacturer of the storage system (101).

[0019] To support various NAND flash memory devices (106), the NAND flash interface controller (104) in this example includes a condition table (108) having one or more (e.g., manufacturer-specific) conditions for processing instructions (110) from firmware. As will be described in more detail below, the condition table (108) is programmed and / or configured by the firmware (102) and used by the NAND flash interface controller (104) to (for example) determine or otherwise select which (one or more) firmware instructions to evaluate or otherwise assess next, and whether to actually execute the (one or more) selected firmware instructions based on the status information (112). The sequencing table (114) is used to store (e.g., manufacturer-specific) instruction sequences sent from the NAND flash interface controller (104) to the NAND flash memory device (106). As part of the initialization process, the condition table (108) and sequencing table (114) may be programmed by firmware depending on the specific NAND flash memory device (106) (eg, manufacturer, model, and / or version).

[0020] A benefit of the memory controller embodiments and / or techniques described herein is that they are flexible enough to work with a variety of NAND flash memory devices (106) from different manufacturers, while also being implemented in a manner that is sensitive to the size, cost, and / or power consumption of the memory controller (100). Some other memory controllers use a general-purpose processor (e.g., a CPU) to give their memory controllers fully programmable control. However, such designs are unattractive (particularly for applications that are sensitive to size, cost, and / or power consumption) because general-purpose processors require a large area of ​​silicon (i.e., they are large and / or expensive to manufacture) and consume a relatively large amount of power compared to the partially programmable controllability provided by the embodiments described herein. The embodiments described herein provide a sufficient degree of flexibility while being mindful of size, cost, and / or power consumption.

[0021] The flexibility provided is desirable even if only one storage media device manufacturer is supported because storage media devices may have different versions with different instruction sequences, supported features, timing requirements, etc. Table-based conditions and table-based sequencing can also be used to optimize the performance of the storage system (101) even if only one storage media device manufacturer is supported. For example, a given NAND flash memory device (106) may perform better when certain types of operations are grouped together rather than separating them. Or, if the NAND flash memory device (106) includes multiple dies, accessing the dies in a particular sequence may provide better performance results than otherwise (e.g., grouping accesses by die may be better than interleaving or switching back and forth between dies). The condition table (108) and / or sequencing table (114) can be used to optimize the firmware instructions (110) in a manner that improves the performance of the storage system (101) (e.g., by executing instructions in an efficient sequence and / or during a better state of the storage system (101)).

[0022] Even though some other memory controllers may have table-based sequencing, they do not include table-based conditionaling, which allows more high-level control to be moved from the firmware domain to the interface controller domain, thereby reducing firmware complexity, reducing firmware code memory size, and allowing the use of lower-power processors, while providing a high level of flexibility to support a wide range of functional NAND flash behaviors, optimize system performance (e.g., for specific timing requirements and / or rules associated with a given NAND flash memory device), and support different Quality of Service (QoS) models.

[0023] The memory system (101) shown herein can be used in a variety of applications and / or scenarios. First, some embodiments of a memory controller (100) that may be beneficial and / or useful during normal and / or regular operating conditions (e.g., when the NAND flash memory device (106) does not issue an indication of an error or anomaly) are described in the following figures. Then, some embodiments of a memory controller (100) that may be beneficial and / or useful during error and / or abnormal operating conditions (e.g., when the NAND flash memory device (106) issues an error or anomaly notification) are described. As used herein, the term "exception" is understood to include "error," such that (as an example) "exception handling" is interpreted to include "error handling," and so on.

[0024] Figure 2 is a flow chart illustrating an embodiment of a process for managing a storage media device using a condition table and a sequence table. In some embodiments, Figure 2 The process is performed during normal and / or conventional operating conditions. In one example, Figure 2 The process is carried out by Figure 1 The NAND flash interface controller (104) performs

[0025] At 200 , one or more firmware instructions are selected from a plurality of firmware instructions based at least in part on: (1) a condition table including one or more conditions for processing the plurality of firmware instructions and (2) state information.

[0026] For example, in Figure 1 In one example of step 200, the state information (112) may relate to the state of the NAND flash memory device (106), the NAND flash interface controller (104), and / or the firmware (102). In one example of step 200, the NAND flash memory device (106) is in the middle of operation, and the operating condition or state is reflected in the state information (112). During this state, the manufacturer may not permit certain types of firmware instructions (e.g., from those stored in block 110) to be sent to the NAND flash memory device (106), or may permit them but may be suboptimal (e.g., because they slow down the NAND flash memory device (106)). The condition table (108) may be programmed (e.g., by the firmware (102)) to specify rules or conditions for selecting the next (multiple) firmware instructions (e.g., including a permitted or non-permitted state for certain types of firmware operations).

[0027] In some embodiments, firmware instructions (e.g., Figure 1 110 in step 200) are stored in a plurality of queues, and the selection at step 200 includes selecting one of the queues.

[0028] In one example of step 200, a condition table is used to specify that a given type of firmware command or instruction should be treated differently depending on a specified condition or particular state. In one example, if the storage media device is busy executing a time-consuming operation, some firmware instructions may not be permitted, or may be permitted but suboptimal under that particular state. Alternatively, under certain conditions, one firmware command queue may have a higher priority than another, but under other conditions or states, a different priority may be required or optimal. This information is specified in the condition table.

[0029] In some embodiments, the hardware (e.g., Figure 1 The NAND flash interface controller (104) in the memory updates the state information (112) because it is faster than the firmware (102) and is therefore more suitable for updating the state information. In some embodiments, the state information (112) is updated by the firmware (102), for example, because the updated information is a state associated with the firmware (102).

[0030] Back to Figure 2 At 202, a determination is made as to how to process one or more selected firmware instructions based, at least in part, on: (1) the condition table and (2) the state information. In other words, step 200 selects which firmware instruction(s) to evaluate or assess next. Step 202 determines how to process the firmware instruction(s). In this example, possible processing options at step 202 are: (1) skip (i.e., discard) the selected firmware instruction(s), (2) execute the selected firmware instruction(s), or (3) execute the selected firmware instruction(s) after a wait condition becomes true (e.g., state information changes, a timer expires, etc.).

[0031] Depending on the processing, the process branches (204). If the firmware instruction(s) were skipped, then the next batch(es) of firmware instructions are again selected at step 200. In some embodiments, additional step(s) are performed (206), e.g., reporting to the firmware which firmware instruction(s) were skipped so that the firmware can proceed accordingly without waiting for results from the skipped and / or discarded firmware instructions. Examples of this are described in more detail below.

[0032] If the process is to stay and / or wait, the process returns to step 202. For example, the process may wait for the status information to change so that the process can switch from "stay / wait" to "execute" or "skip."

[0033] If the processing is to execute (one or more) firmware instructions, then based at least in part on the one or more selected firmware instructions, an instruction sequence is obtained from a sequenced table including one or more instruction sequences associated with the storage media device at 208. Then, at 210, the obtained instruction sequence is output to the storage media device.

[0034] For example, suppose the firmware instruction is a status check of a storage media device. The instruction sequence obtained in step 208 may describe the signaling required to transmit the status check to the storage media device of that manufacturer, model, and / or version. Then, step 210 will be performed in Figure 1 Driving specified signal levels with specified signal timing (eg, how long to maintain or when to switch those signal levels) on physical pins or connections (as an example) between a NAND flash interface controller (104) and a NAND flash memory device (106).

[0035] In some embodiments, additional step(s) are performed (212). For example, there may be some configurable and / or table-based post-sequence (i.e., after the instruction sequence is output to the storage media device), thereby allowing for additional flexibility. Examples of this are described in more detail below.

[0036] In order to better understand the above embodiments, it may be helpful to describe more specific and / or detailed examples. The following figure describes Figure 1 A more detailed example of a NAND flash interface controller (104) is provided.

[0037] Figure 3 is a diagram illustrating an embodiment of a NAND flash interface controller in which table-based conditions are implemented using a pre-sequence queue table, a pre-sequence execution table, and a post-sequence update table. In some embodiments, Figure 1 The NAND flash interface controller (104) is as follows Figure 3 This is done as shown in .

[0038] In this example, firmware (302a) sends commands to a NAND flash interface controller (300), and the firmware commands are stored in one of a plurality of firmware command queues (310). A pre-sequence queue selector (308) selects which firmware command queue (310) to access or process next based on state information (309) and a pre-sequence queue table (307). More specifically, the pre-sequence queue selector (308) uses the pre-sequence queue table (307) to examine (as an example) the current state (309) of the die and / or memory controller itself that make up the NAND flash memory device to determine whether any available firmware instructions in the firmware command queue (310) are suitable for potential execution at the next interface idle point.

[0039] In one example, the pre-sequence queue table (307) is used to specify how to handle firmware instructions of the same type differently depending on specified conditions or particular states. For example, if the selected firmware command queue includes two back-to-back firmware instructions of a given type at the top of the selected queue, then under certain conditions and / or states, both firmware instructions are forwarded to the pre-sequence execution checker (311), but under a different set of conditions and / or states, only one firmware instruction is forwarded.

[0040] The selected firmware instruction(s) are then passed from the pre-sequence queue selector (308) to the pre-sequence execution checker (311) for the next stage of processing. At a high level, the pre-sequence execution checker (311) decides whether to execute the firmware instruction or command passed to it by the pre-sequence queue selector (308) or skip it (in this simple and binary example). For example, the firmware (302a / 302b) is much slower than the hardware (300) and may place commands in the firmware command queue (310) that are no longer relevant or no longer need to be executed by the time they reach the pre-sequence execution checker (311).

[0041] As desired or if desired, the pre-sequence execution table (312) can be changed by the firmware (302a / 302b) to control the decision making and / or command processing of the pre-sequence execution checker (311). For example, different NAND flash memory device manufacturers may present different status information that can be checked by the pre-sequence execution checker (311), and / or different NAND flash memory device manufacturers may process commands in different ways that must be accommodated.

[0042] Those firmware instructions that the pre-sequence execution checker (311) determines to be executed or otherwise executed are passed from the pre-sequence execution checker (311) to the command sequencer. The command sequencer (303) has access to a first writeable control storage (WCS) table (304) of command sequences. The firmware instruction includes an index into this first WCS table (304). The instruction found at this index is the first instruction to be executed in the command sequence; sequence execution continues until a sequence termination instruction is encountered.

[0043] Each command sequence instruction may include an index to a physical command table stored in a second writeable control storage (WCS) table (305) of the physical command instruction. The physical command instruction is interpreted by a physical command sequencer (306), which includes a low-level state machine and logic that drives the physical pins (315) associated with the flash interface. If the command sequence instruction performs only local control (i.e., it is only internal and remains internal to the NAND flash interface controller (300)) and does not affect the flash physical interface (315), the command sequence instruction (e.g., obtained from the first WCS table (304)) may omit the index to the physical command table (i.e., the second WCS table (305)).

[0044] As shown in this figure, in some embodiments, the sequencing table (e.g., Figure 2 (mentioned in steps 200 and 202) includes: (1) a first writable control store (WCS) table of command sequences (e.g., 304) and (2) a second WCS table of physical command instructions (e.g., 305); obtaining the instruction sequence includes: accessing the first WCS table of the command sequence at a first index included in the one or more selected firmware instructions to obtain a second index in the second WCS table of physical command instructions; accessing the second WCS table of physical command instructions at the second index to obtain one or more physical command instructions; and outputting the obtained instruction sequence includes using the one or more physical command instructions located at the second index in the second WCS table of physical command instructions.

[0045] In some such embodiments, accessing the first WCS table of a command sequence at a first index included in one or more selected firmware instructions further includes: obtaining an internal-only command sequence; and responsive to obtaining the internal-only command sequence: an indication of whether to skip a step of accessing a second WCS table of physical command instructions; and outputting a skip instruction for the obtained instruction sequence step.

[0046] In some embodiments, the command sequencer (303) rearranges the sequence or order of (firmware) commands so that the order in which the commands are output to the physical sequencer (306) does not necessarily match the order in which they were received from the pre-sequence execution checker (311). This can be set using the first WCS table (304) and can depend on the state information (309), for example.

[0047] The post-sequence update condition checker (313) uses the post-sequence update table (314) to determine which state variables in the firmware status queue (316) should be updated, and the updated values. The firmware status queue (316) is how the hardware (300) updates the firmware (302b) regarding the status of the commands sent by the firmware (302a) to the firmware command queue (310). The post-sequence update table (314) is programmed by the firmware (302a / 302b). For example, different NAND flash memory device manufacturers may have different variables (e.g., register locations) that need to be updated and / or updated with different update values. In another example, the firmware (302a / 302b) is in debug mode and wants more information returned to it when the update is performed. This is Figure 2 An example of step 212 of the middle and rear sequence.

[0048] As described in the above example, in some embodiments, the condition table includes a post-processing condition, which includes: (1) a status update location specific to the storage medium device, and (2) a status update value specific to the storage medium device; and the hardware is further configured to update the status update location with the status update value specified by the post-processing condition.

[0049] As described in the above example, in some embodiments, the condition table includes a post-processing condition, the post-processing condition including: (1) a debug-related update location and (2) a debug-related update value, wherein the firmware enables the post-processing condition when the firmware is in debug mode. The hardware is further configured to update the debug-related update location with the debug-related update value specified by the post-processing condition.

[0050] Using these three stages and / or types of table-based conditional checks (i.e., at the pre-sequence queue selector (308), pre-sequence execution checker (311), and post-sequence update checker (313)), the storage controller including firmware (302a / 302b) and NAND flash interface controller (300) permits and / or enables:

[0051] 1) When NAND flash memory devices (e.g. Figure 1 106) Firmware commands to be executed when idle.

[0052] 2) Firmware commands that interrupt other executing commands as programmed (e.g., statically). For example, some NAND flash memory device manufacturers allow erase operations (on NAND flash memory devices) to be interrupted by other commands or operations. The command sequencer (303) can be configured using the first WCS table (304) to allow commands after an erase to interrupt the previous erase. This sequencing is enabled using the pre-queue selector (308) to allow another command (e.g., to the same die) to pass through or otherwise be forwarded while an erase command is in progress.

[0053] 3) Dynamically change the behavior of new commands in the firmware command queue (310) based on currently executed commands or recently executed commands to other NAND flash memories (e.g., via the die current state table in the state information (309)). For example, the previous sequence execution checker (311) allows the same command in the (e.g., selected) queue to be issued or waited based on the previous command issued by the other die programmed in the previous sequence execution table (312).

[0054] In order to Figure 3 Put in Figure 2 In the context of Figure 2 An example of a module of step 200 selecting (one or more) firmware instructions; a pre-sequence execution checker (311) is in Figure 2 The command sequencer (303) is an example of a module that obtains the instruction sequence at step 208; and the physical sequencer (306) is an example of a module that determines the processing of the firmware instruction(s) at step 202; Figure 2 Step 210 outputs an example of a module of instruction sequences.

[0055] The following figure describes Figure 3 More detailed examples of some of the modules shown in .

[0056] Figure 4 is a diagram illustrating an embodiment of a condition table. In some embodiments, Figure 3 One or more condition tables (e.g., a pre-sequence queue table (307), a pre-sequence execution table (312), and a post-sequence update table (314)) in the example are implemented as shown herein. In this example, the condition table (401) includes an array of elements (402), where each element contains an enable array (403) of an enable field or flag (404) and a value array (405) of values ​​(406) that can be used to check (e.g., perform a read and then compare the read value to a stored value (406)) or modify (e.g., write a stored value (406)). For example, a pair of enable and value fields (404 and 406) can be used to check and / or modify Figure 3The state variables in the state information (309) are stored in the memory. When an update or modification is performed, the multiplexer (407) is used to select and output the stored value (406) as the new value.

[0057] In one example, the lowest level component that can be selected or specified in a NAND flash memory device is a die. One or more dies can be included on a chip. One or more chips can share a bus. The condition table (401) can be used to select or otherwise specify the die, chip, and / or bus of interest. The enable field (404) is used to enable the corresponding value field (406). The value field (406) specifies the checker (e.g., Figure 3 conditions that the pre-sequence queue selector (308), pre-sequence execution checker (311), and / or post-sequence update checker (313) in the . This allows, for example, hardware (e.g., Figure 3 300) makes decisions based on pre-programmed die-level controls or chip-level controls (if desired). A pseudocode example is shown below using die-based information as an example. Each of DIEBASEDMASK, DIEBASEDVALUE, and CURRENTSTATE is a multi-bit variable in the 32-bit, 40-bit, or 64-bit range.

[0058] DIEBASEDMASK is used to select whether specific CURRENTSTATE bit(s) are to be taken into account when making decisions.

[0059] The DIEBASEDVALUE is used to compare with the CURRENTSTATE to make a success or failure decision.

[0060] If (DIEBASEDMASK(n)=1) then

[0061] if (DIESTATE(n)==DIEBASEDVALUE(n)) then

[0062] Sequence check / update passed

[0063] else if (DIEBASEDMASK(n)=0) then

[0064] Ignore field checks in CURRENTSTATE variables (n)

[0065] end

[0066] Return briefly Figure 3In the example of the exemplary NAND flash interface controller, all tables (i.e., WCS tables (304 and 305) and condition tables (307, 312, and 314)) are pseudo-static; that is, under normal operating conditions, when the functions they control are non-static, their contents do not change dynamically. Static tables provide the flexibility to implement different interaction models between firmware and flash memory by statically changing the contents of the tables.

[0067] Figure 5 is a diagram illustrating an embodiment of state information including state information associated with multiple dies in a NAND flash memory device. In some embodiments, Figure 3 The state information (309) in is implemented as shown here. In this example, the NAND flash memory device (500) includes two dies: a first die (502) with a die index of 0 and a second die (504) with a die index of 1. Depending on the manufacturer, in some embodiments, the dies (502 and 504) can execute operations and / or instructions in a (semi-)independent manner.

[0068] To help the memory controller ensure that instructions are sent to both dies at permitted and / or performance-optimized states or times, the state information (506) shown here includes die state information (508) for the first die (502) indexed at 0 and die state information (510) for the second die (504) indexed at 1.

[0069] Diagram 512 shows the die status information (e.g., 508) in more detail. In this example, the first byte (520) is associated with the NAND flash memory status. In this example, the first bit (521) is used to indicate whether the die is in an abnormal (e.g., failed or error) state, the second bit (522) is used to indicate whether the die is in low power mode, and the third bit (523) is used to indicate whether the die is in debug mode.

[0070] For example, the exception bit (521) can be used to stall or stop sending new instructions to the die, the low power mode bit (522) can be used to determine whether the memory controller needs to "wake up" the die before sending any new instructions to the die, and the debug mode bit (523) can let the memory controller know that the die has reported additional debug information that it would not normally report (e.g., so the memory controller knows that there is additional debug information that can be used in its decision making).

[0071] In this example, the NAND flash status byte (520) is primarily or mostly controlled by hardware (i.e., the NAND flash interface controller), but firmware can also control this byte if needed (e.g., if there is a problem with the hardware). For example, both dies (502 and 504) have a 1-byte status that they return to the hardware (i.e., the NAND flash interface controller); for example, the hardware puts the status byte in this first byte (520) for the firmware to read.

[0072] The second byte (530) is associated with suspend and resume operations. In this example, the die (502 and 504) has the ability to execute a suspend command, wherein the indicated die suspends the execution of the command that the die is currently executing. For example, erase (i.e., clear) and program (i.e., write) operations take a relatively long time on NAND flash storage media, and therefore the exemplary die (502 and 504) permits suspending erase and program operations. Bits 531 and 534 are used to indicate that a suspend command has been issued for the erase and program commands, respectively (e.g., by firmware). Bits 532 and 535 are used to indicate the failure of the suspend command for the erase and program commands, respectively. Bits 533 and 536 are used to indicate that a resume command has been issued (e.g., by firmware) to resume the previously suspended erase or program operation, respectively. In this example, this byte (530) is controlled and / or written by the firmware.

[0073] The third byte (540) is associated with exception handling and will be described in more detail below. In this example, the first bit (541) is the freeze bit for example die 0, and the second bit (542) is the refresh bit for example die 0. In this example, this byte (540) is controlled and / or written by firmware.

[0074] The fourth byte (550) is used for various timers. In this example, the manufacturer of the die (502 and 504) has specified that program and erase operations take a certain, non-negligible amount of time. The program timer bit (551) and the erase timer bit (552) are used to indicate when the program timer and erase timer have stopped, thereby indicating that the required or specified amount of time to perform those operations has elapsed. In this example, these timers are started and monitored by hardware, and this byte is typically controlled by hardware, but can be written to and / or controlled by firmware if desired (for example, if the hardware is "stuck" or in an abnormal state).

[0075] For example, without the timer status byte (540), the memory controller may have to continually send "check status" commands to the die, and the die may have to return status information in response. This is inefficient (e.g., it consumes communication channel resources, as well as resources at the memory controller and the die), and it is more efficient to use a hardware-managed timer whose status is reported in the timer status byte.

[0076] The status bits and / or variables shown in diagram 512 are exemplary only, and what status information is reported and the use and / or interpretation of the status information is configurable and / or adjustable by firmware as desired. This configurability allows the memory controller to adapt to the timing, supported operations, and / or regulations of different die manufacturers.

[0077] As shown in this example, in some embodiments, the storage medium device (500) supports a suspend command that permits suspending one or more of the following: a program command or an erase command; the status information includes suspend-related status information (e.g., see byte 1 (530)); the condition table includes suspend-related condition information; and determining how to process one or more selected firmware instructions includes comparing the suspend-related status information and the suspend-related condition information. The suspend-related status information includes, for example, status information associated with a command to resume a pause (see, for example, the erase resume send bit (533) and the program resume send bit (536)).

[0078] As shown in this example, in some embodiments, the state information includes timer-related state information; the condition table includes timer-related condition information; and determining how to process one or more selected firmware instructions includes comparing the timer-related state information and the timer-related condition information. In some such embodiments, a timer associated with the timer-related state information begins counting in response to one or more of: a program command or an erase command (e.g., see byte 3 (540)).

[0079] The following figure shows a more detailed example illustrating table-based decision making at various modules in the NAND Flash interface controller associated with the suspension of an erase command.

[0080] Figure 6 is a diagram illustrating one embodiment in which an erase operation is conditionally suspended so that a program operation can be performed, and then when the program operation is complete, the suspended erase operation is resumed. In this example, the firmware command queue (610) corresponds to Figure 3 The module of the same name (310) in the pre-sequence queue selector (611) corresponds to Figure 3 The module of the same name (308) in the pre-sequence execution checker (612) corresponds to Figure 3 The modules of the same name (311), command and physical sequencers (613) correspond to Figure 3 The modules of the same name (303 and 306) in the post-sequence update checker (614) correspond to Figure 3 The module of the same name (313) in the , and the status information (615) corresponds to Figure 3For the sake of clarity and / or brevity, some exception handling and robustness enhancements and / or features are not necessarily described in this example.

[0081] In this example, each page program (e.g., 605) is always preceded by an erase suspend command (e.g., 603) and followed by an erase resume command (e.g., 607), as shown in the firmware command queue (610) in diagram 601. If the erase suspend is not applicable and / or not needed at the time it is to be executed, it is simply discarded; if applicable and / or needed, the erase suspend is executed. This discard and execution decision is made by the pre-sequence execution checker module (e.g., Figure 3 311 in or 612 here). (As mentioned above, the erase suspend can be performed by firmware (e.g., Figure 3 302a / 302b in ), which is slow and / or has very coarse timing resolution, but the decision as to whether to actually perform the erase suspend is made by hardware that is much faster and / or has finer timing resolution (e.g., Figure 3 300 in the above). ) by updating the relevant variables in the state information (for example, Figure 3 309 or 615 here) to mark or otherwise indicate that the erase suspension is executed (e.g., whether or when it is executed).

[0082] In this example, the command following the Page Program command (605) is an Erase Resume command (607). This Erase Resume command (where suspend and / or resume may be a feature not necessarily supported by other older systems) checks the state set by the Erase Suspend command (e.g., in the Status Information (615)). (e.g., by a previous sequence execution checker (e.g., Figure 3 311 in or 612 here)) makes a decision as to whether to execute or skip the Erase Resume command. If the decision is to execute the Erase Suspend command, then the decision is also to execute the Erase Resume command. Naturally, if the decision is not to execute or otherwise execute the Erase Suspend, then likewise the Erase Resume command does not need to be executed and is skipped (e.g., for efficiency and / or to preserve system resources). This dynamic behavior is managed entirely by setting and checking appropriate values ​​in the state information. For example, as indicated and / or specified, the Pre-Sequence Execution Checker (612) checks the Pre-Sequence Execution Table (e.g., Figure 3 312 in ), and the post-sequence update checker (614) checks the post-sequence update table (e.g., Figure 3 314 in the and check and update the various bits in the status information (615). Executing these commands in the correct order and selecting from the multiple firmware command queues (310) is done by the pre-sequence queue selector (611) based on the pre-sequence queue table (e.g., Figure 3 This is done by using 307 in the .

[0083] The following describes Figure 6 The sequence shown in .

[0084] 1. Firmware Command: Block Erase (602)

[0085] a. Pre-Sequence Queue Selector (611): Is "Die Idle" (615) asserted? (620) (In this case, yes) ← Note that this is a low priority command and will only execute if the die is idle

[0086] b. Main Sequence → Physical Sequencer (613): Issue Block Erase Command (621)

[0087] c. Main sequence: Start status polling in the background (622)

[0088] d. Post-Sequence Update Checker (614): Clears the "Die Idle" (615) state and sets the "Erase" (615) state (624)

[0089] 2. Firmware Command: Erase Suspend (Queue) (603) ← Note that this queued command is not executed immediately

[0090] 3. Firmware Command in Priority Queue: Terminate Status Polling (604)

[0091] a. Pre-Sequence Execution Checker (612): “Erase” (615) asserted and “Die Ready” (615) not asserted? (626) (in this case, yes) ← This check automatically performs the case where erase is already complete and no pause is required

[0092] b. Main Sequence → Physical Sequencer (613): Terminate Status Poll (628) ← If the erase is complete, do not execute

[0093] 4. Firmware Command: Page Programming (Queue) (605) ← Note that this queued command is not executed immediately

[0094] 5. Firmware Command: Erase Recovery (Queued) (607) ← Note that this queued command is not executed immediately

[0095] 6. Queued Command: Erase Suspend (603)

[0096] a. Pre-Sequence Execution Checker (612): “Die Ready” (615) not asserted? (630) (in this case, yes) ← If erase is already complete, then no execution (and thus the chip is no longer busy)

[0097] b. Main Sequence → Physical Sequencer (613): Issue Erase Suspend Command (632)

[0098] c. Post-Sequence Update Checker (614): Clears the "Erase" (615) state and sets the "Erase Suspended" (615) state (634)

[0099] 7. Queuing Commands: Page Programming (605)

[0100] a. Main Sequence → Physical Sequencer (613): Issue a write data transfer command (636)

[0101] b. Main Sequence → Physical Sequencer (613): Issue Page Program Command (638)

[0102] c. Main Sequence → Physical Sequencer (613): Start status polling in the background (640)

[0103] d. Post-Sequence Update Checker (614): Set "Programming" (615) Status (642)

[0104] 8. The NAND flash die completes programming and sets its "die ready" (615) status (606)

[0105] a. Main Sequence → Physical Sequencer (613): Status Poll (640) Completed

[0106] b. Post-Sequence Update Checker (614): Clear "Programming" (615) Status (644)

[0107] 9. Queued Commands: Erase Recovery (607)

[0108] a. Pre-Sequence Execution Checker (612): Is Erase Suspend (615) asserted? (646) (In this case, it is)

[0109] b. Main Sequence → Physical Sequencer (613): Issue Erase Resume Command (648)

[0110] c. Main Sequence → Physical Sequencer (613): Start status polling in the background (650)

[0111] d. Post-Sequence Update Checker (614): Clear "erase pause" (615) state, set "erase" (615) state (652)

[0112] 10. The NAND flash die completes erasure and sets its "die ready" (615) status (608)

[0113] a. Main Sequence → Physical Sequencer (613): Status Poll (650) Completed

[0114] b. Post-Sequence Update Checker (614): Clears the "Erase" (615) state and sets the "Chip Idle" (615) state (654).

[0115] Note that table-based conditionals, table-based sequencing, and / or the meaning and / or interpretation of state information are firmware programmable and, therefore, flexible, enabling support for a variety of storage media devices (e.g., with different timing rules, different supported operations, etc.). Although not described above, other (e.g., more complex) sequences can be supported by manipulating and testing additional state elements. Examples of such sequences include: exception handling situations; pausing a NAND flash programming operation to read data from the NAND flash die; and so on.

[0116] As described above, in some embodiments, a decision to skip (i.e., discard or not execute) a firmware command is made by, for example, a pre-sequence queue selector (611) or a pre-sequence execution checker (612). The following figure shows an example of the signal paths associated with skip reporting (e.g., so that the firmware knows when a command is skipped and can reissue the command as needed or if necessary).

[0117] Figure 7 is a diagram illustrating an embodiment of a signal path in a NAND flash interface controller associated with a command or operation skip. In this example, the module shown is part of a NAND flash interface controller (ie, hardware) in a memory controller. The diagram shows an example of a NAND flash interface controller that performs a command or operation skip. Figure 2 An example of a module that skips the relevant step 206 in .

[0118] In this example, firmware commands are stored in a firmware command queue (700). A pre-sequence queue selector (702) selects the next queue, as described above (e.g., using a pre-sequence queue table). A die command arbitrator (704) arbitrates or otherwise selects one or more firmware commands from the selected firmware command queue based on the die in the storage media device (e.g., the state of the die). For example, the die command arbitrator may determine that, for performance reasons, it wants to send multiple read commands together and / or sequentially to the same die, and therefore arbitrates in favor of the read commands. As used herein, arbitration is the act of selecting and / or prioritizing without discarding, so that any firmware commands not selected by the die command arbitrator (704) remain in their queues.

[0119] In contrast, the skip checker (706) decides whether to skip (i.e., discard) or execute the firmware commands passed to it by the die command arbiter (704). If the skip checker (706) decides to skip the firmware command(s), a signal path from the skip checker (706) to the command status updater (708) is used. For example, the command status updater (708) can provide updates about the commands queued in the firmware command queue (700) via a firmware status queue (e.g., which corresponds to an input queue). For example, in Figure 6 In the example of FIG. 7 , if the erase has already completed when the Erase Suspend command is contemplated, the Erase Suspend command will be skipped, and in this scenario, the Erase Suspend command will be skipped. Similarly, if the Erase Suspend command is skipped, then the Erase Resume command queued later will similarly be skipped. Information about the skipped Erase Suspend command and / or Erase Resume command can be passed to the firmware via the path from the Skip Checker ( 706 ) to the Command Status Updater ( 708 ).

[0120] If the skip checker (706) decides to execute the firmware command(s) passed to it by the die command arbiter (704), then control passes to the die state updater (710a). For example, the die state updater (710a) updates the state information associated with the relevant die to reflect the firmware command that the die is about to execute. Figure 6 In the example of , the “die idle” and “erase” states ( 624 ) are updated by the die state updater ( 710 a ). The update position and / or update value of the die state updater ( 710 a ) may be specified and / or controlled via a table.

[0121] The physical sequencer (712) then takes the physical command sequence and drives the NAND flash physical interface pin controls (e.g., according to table-based sequencing) as described above. Any partially executed commands (714) are sent back from the physical sequencer (712) to the pre-queue selector (702) so they have a chance to complete. A command can be partially executed if it allows a second command to be issued while the first is executing.

[0122] Following the physical sequencer (712) is a post-sequence condition checker (716) that checks and / or ensures that the firmware command has been (e.g., completely) executed and that the state information is in some expected and / or completed state. If so, the die status updater (710b) updates the relevant state information associated with the relevant die to reflect the completion of the executed firmware command. Figure 6In the example shown, when the page program operations (638 and 640) are complete, the die status updater (710b) updates the "program" status to zero (644). The "execute" path then rejoins the "skip" path at the command status updater (708), which (for example) notifies the firmware that the completion of the firmware command (e.g., which follows the "execute" path described above) has been executed.

[0123] As described above, in some embodiments, during the handling of an abnormal situation (e.g., when Figure 5

[0045] When one of the die (502 and 504) in the memory asserts an exception flag), some of the techniques and / or systems described above (e.g., table-based conditional actions) may be used. As described above, a storage controller sometimes needs to support a range of storage media devices with a range of behaviors that may differ between specific components and / or manufacturers. In some other storage systems, if an exception occurs (e.g., a storage media device or a NAND flash interface controller asserts an exception flag or register), other types of firmware (i.e., those that do not implement the techniques described herein) reset at least some portions of the NAND flash interface controller (i.e., the hardware in the storage controller). This is highly undesirable because resetting any portion of the hardware (300) may cause long idle periods that disrupt traffic flow and be detrimental to system performance. For example, the firmware may not know what command the NAND flash memory device is executing and whether the command is being fully executed or partially executed. Determining the state of the NAND flash memory device and / or which firmware commands are not executed, partially executed, or fully executed can be a time-consuming process.

[0124] Another recovery strategy available to other types of storage controllers (i.e., types that do not implement the techniques described herein) is to wait for the hardware in the storage controller to execute queued firmware commands (i.e., issued before the exception occurred) so that the hardware can eventually execute the firmware commands that handle the exception. This solution is undesirable because processing queued firmware commands can be very time-consuming (especially when an exception is present), and in some cases, the controller may not be able to process queued firmware commands before resuming the associated commands.

[0125] Therefore, there is a need for an improved storage controller that can better handle exception situations.The following figures describe some storage controller embodiments, showing how exception situations can be handled in a cleaner and / or faster manner than previously possible.

[0126] Figure 8 is a table illustrating the conditions of use (e.g. Figure 1 108) is a flowchart of an embodiment of exception handling. In one example, Figure 8 The process of Figure 1The memory controller (100) in the embodiment of the present invention manages access to the NAND flash memory device (106).

[0127] At 800, in response to receiving an indication associated with an anomaly, including in state information (e.g., Figure 5 508, 510) in the exception handling state variables (e.g., Figure 5 For example, the firmware may assert (e.g., change the value from 0 to 1) the freeze bit (541) and / or the flush bit (542) in the exception handling byte (540) in the exemplary status information (512).

[0128] At 802, one or more firmware instructions are selected from a plurality of firmware instructions based at least in part on: (1) a condition table comprising one or more conditions for processing the plurality of firmware instructions, and (2) state information comprising an exception handling state variable. For example, Figure 3 The pre-sequence queue selector (308) in can perform step 802. The pre-sequence queue table (307) can specify queue selection priorities, orders, and / or rules when the exception handling state variable is not asserted (e.g., queue selection priorities, orders, and / or rules for regular processing), and queue selection priorities, orders, and / or rules when the exception handling state variable is asserted (e.g., queue selection priorities, orders, and / or rules for exception processing).

[0129] At 804, determining how to handle one or more selected firmware instructions is based at least in part on: (1) a condition table and (2) state information including an exception handling state variable, wherein: the plurality of firmware instructions include: (1) a non-exception handling set of one or more firmware instructions not related to exception handling, and (2) an exception handling set of one or more firmware instructions related to exception handling; and if the exception handling state variable is asserted, the condition table causes hardware to prioritize execution of the exception handling set of firmware instructions over execution of the non-exception handling set of firmware instructions.

[0130] In one example of step 804, the storage media device includes multiple dies, and one of the dies is in an abnormal state. In some embodiments, the exception handling set of firmware instructions includes a reset instruction for the die in the abnormal state. In some embodiments, the firmware first evaluates the state of the die in the abnormal state before issuing any reset instructions, because resetting the die is an extreme and / or drastic step that may result in data loss.

[0131] In another example of step 804, step 804 may be performed by Figure 3The pre-sequence execution checker (311) in the embodiment of the present invention is executed, and the pre-sequence execution table (312) may include non-exception handling rules and exception handling rules. The exception handling rules may include skipping, pausing and / or interrupting instructions from the non-exception handling set of firmware instructions so that the hardware can reach the exception handling set of firmware instructions more quickly.

[0132] At 806, communicate with the storage media device. For example, Figure 3 In the embodiment of the present invention, the physical sequencer (306) drives the physical pins (315) associated with the flash interface based on the instructions from the command sequencer (303). With other types of storage controllers (i.e., those that do not implement the techniques described herein), an observer at the physical pins (315) will notice that when the firmware resets the hardware in response to an exception, some non-exception processing instructions or commands to the storage media device may be interrupted. This is undesirable because recovering from a hardware reset is time-consuming.

[0133] In contrast, using the techniques and / or systems described herein, the firmware can (e.g., asynchronously) assert the exception handling state variable, and the firmware will subsequently prioritize exception handling firmware instructions over non-exception handling firmware instructions in an orderly and / or graceful manner (e.g., synchronously). Another way to describe this is that when the exception handling state variable is asserted (at least in some embodiments), non-exception handling firmware instructions that are in execution are permitted to complete (or at least reach a graceful exit or stall point). The next time the hardware selects a queue (e.g., in Figure 3 ) or decide how to process the selected firmware instruction (e.g., at the front-sequence queue selector (308) in Figure 3 When executing the checker (311) in the previous sequence, because of the asserted exception handling state variable (e.g., Figure 3 309 in ) and related tables consulted (e.g., Figure 3 307, 312 and / or 314 in the example), the hardware will prioritize exception handling firmware commands over non-exception handling firmware commands.

[0134] Some other types of storage controllers (i.e., those that do not implement the techniques described herein) provide hardware assistance for exception handling, but these other solutions are hard-coded to perform only specific, pre-identified function(s). Note that due to the nature of table-based conditional actions, the techniques described herein are much more flexible. For example, the techniques can be used to adapt to unexpected and / or new exception flag positions or values ​​and respond to exceptions in a variety of adaptable ways. For example, some exception handling may require freezing certain types of non-exception handling instructions while refreshing (i.e., skipping) other types of non-exception handling instructions, and the adaptable nature of the techniques and systems described herein allows for flexibility in situations where non-exception handling instructions are moved from a frozen category to a refresh category.

[0135] In some embodiments, any of steps 800, 802, 804, and 806 is performed by hardware in a memory controller implemented on a SOC (e.g., a NAND flash interface controller). As described above, in some embodiments, the hardware includes one or more of the following: an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA).

[0136] Figure 9 is a diagram illustrating an embodiment of a storage controller that uses state information, including exception handling state variables, to perform exception handling. For simplicity and ease of explanation, a simplified NAND flash interface controller (902) is shown, into which the implementation details shown in the above examples may be incorporated. In other words, in some embodiments, some of the system components and / or features described above (e.g., for normal processing) are used to support exception handling.

[0137] In this example, a NAND flash interface controller (902) is part of a storage system (901) that includes a sequencer (903) (e.g., in hardware) that executes instructions from a programmable control memory (904). The instructions include the ability to examine (e.g., read and compare some other value) and modify state information (905) including one or more state variables. In some embodiments, firmware (906a / 906b) executing on the storage system (901) can also modify and examine at least some of the state variables.

[0138] As will be described in more detail below, the state information (905) includes one or more exception handling state variables (e.g., including one or more bits), and the control storage (904) includes (e.g., programmable and / or configurable) instructions for what the sequencer (903) should do when the exception handling state variable is asserted (e.g., has a value of 1) or not asserted (e.g., has a value of 0).

[0139] In order to Figure 9 Put in Figure 3 In the context of, in some embodiments, the sequencer (903) shown here includes from Figure 3 The pre-sequence queue selector (308), the pre-sequence execution checker (311), the command sequencer (303), the physical sequencer (306) and the post-sequence update checker (313).

[0140] Figure 10 is a diagram illustrating an embodiment of non-exception handling firmware instructions (1000a and 1000b) that are stalled in favor of exception handling firmware instructions (1006). In this example, the exception handling state variable (1002a) (e.g., in Figure 8 The process mentioned) is the frozen bit (for example, Figure 5 541). In this example, an exception handling state variable is maintained for each NAND flash component entity (e.g., die, logic unit, or word line). In some embodiments, the exception handling state variable is maintained for an entity aggregator such as a collection of component entities or a physical interface of a storage media device.

[0141] Figure 5 An example of this is shown where there are two dies (502 and 504) in a NAND flash memory device (500) such that there are two sets of die status information (508 and 510), and each has its own exception handling byte (540) so that exception handling for both dies can be managed and / or performed independently of the other.

[0142] exist Figure 9 In the example, a sequencer (903) executes instructions in response to a command (907) issued by firmware (906a) executing in a storage system (901). The command (907) includes arguments used in the execution of the command and may include an argument specifying a first instruction for the sequencer (903) to use to process the command. The firmware may issue commands such that there are multiple commands available for processing by the sequencer at the same time (i.e., there are multiple commands outstanding). In this example, commands are placed in multiple firmware command queues (908), any one of which may be selected for processing by the sequencer (903).

[0143] Before executing the selected firmware instruction, the sequencer (903) examines the state information (905) for relevant state variables associated with the command or instruction; depending on the arguments associated with the command or instruction, the relevant state variables may be any variables associated with a component entity, an aggregation of entities, or any combination of such variables.

[0144] exist Figure 10In the example, if the exception handling state variables (1002a and 1002b) (in this example, the freeze bit) are in the asserted state, then the execution of the non-exception handling firmware instruction (1000a) is deferred. For example, an exception event (1004) occurs, causing the firmware to assert the freeze bit (i.e., set the freeze bit to 1). In response to the assertion of the freeze bit, the hardware does not select and / or execute the non-exception handling firmware instruction (e.g., which was issued before the exception event (1004) and Figure 9 Pending in the firmware command queue (908) in ), so that the exception handling firmware instructions (1006) can be prioritized and / or executed by the hardware instead.

[0145] For example, in Figure 9 In some embodiments, the exception handling firmware instruction may be placed into one of the empty firmware command queues (908), and the hardware prioritizes this newly filled queue over (e.g., during queue selection) the other queues. In some embodiments, there are no empty firmware command queues (908), and when the flush bit is asserted (i.e., set to 1) to create an empty queue into which to place the exception handling firmware instruction, the sequencer (903) is instructed (e.g., using instructions in the control store (904)) to empty or flush one of the firmware command queues (e.g., a queue with low value or easily replaceable commands).

[0146] Back to Figure 10 , once all exception handling firmware instructions have been executed (1006), the freeze bit is deasserted (1002b). Figure 9 In the example of FIG, the hardware (902) may indicate the end of the exception handling firmware instructions via a status message (909) to the firmware (906b) or by asserting an interrupt (910) to the firmware (906b). Once the firmware has received confirmation that the exception handling firmware instructions (1006) have been executed and the firmware is satisfied that the storage system can resume normal processing, the firmware sets the value of the freeze bit to 0 (1002b).

[0147] In response to the freeze bit being deasserted (1002b), the hardware resumes processing of non-exception handling firmware instructions (1000b). For example, Figure 9 In the example embodiment, non-exception handling firmware instructions issued before the exception (1004) occurs will remain in the firmware command queue (908) until the exception handling is completed and are available for immediate processing when the freeze bit is deasserted.

[0148] In some embodiments, the exception handling state variables (1002a and 1002b) are flush bits (e.g., Figure 5542 in the example). In the event that the flush bit is asserted, the affected non-exception handling firmware instructions will be skipped or otherwise flushed from the system while the flush bit is asserted. Upon resuming normal processing (e.g., when the flush bit is set to 0), the affected non-exception handling firmware instructions will no longer be present in the firmware command queue.

[0149] exist Figure 7 In the case of a command that is not in the queue, the pre-queue selector (702) can check the freeze bit and respond accordingly, as described above. As described above, the pre-queue selector (702) does not discard the command, but rather selects the next queue; this functionality supports the freezing technique described above. In contrast, the skip checker (706) does have the ability to discard or otherwise flush out commands and is an example of a block that checks the flush bit and responds accordingly, as described above.

[0150] In some embodiments, when the freeze bit is asserted (i.e., freeze = 1), any non-exception handling firmware commands between the skip checker (706) and the physical sequencer (712) are frozen by sending them back to the pre-sequence queue selector (702) via the partially executed command (714) path if or when in a state or point where doing so is permitted and / or easy. In other words, in some embodiments, freezing includes stalling a partially executed command where execution of the command began when the freeze bit was not asserted.

[0151] In some embodiments, when the refresh bit is asserted (i.e., refresh = 1), any non-exception handling firmware commands in the die state updater (710a) and physical sequencer (712) are refreshed by sending them back to the pre-sequence queue selector (702) via the partially executed command (714) path if or when it is permitted and / or easy to do so. At those blocks, the commands have already passed through the skip path branching from the skip checker (706). To return to the skip path, the commands in both modules are sent back via the partially executed command (714) and then diverted to the skip path by the skip checker (706).

[0152] One example of when the refresh bit may be asserted is when the firmware needs to handle a system exception such as a power-off notification from the host. In another example, the hardware may set the refresh bit when it receives an error from the NAND flash device (e.g., because the firmware cannot respond when the NAND flash device is in that state).

[0153] As mentioned above, the decision making for some non-exception handling firmware instructions can be done by freezing bits (e.g. Figure 5 541) and / or refresh bits (e.g., Figure 5Which non-exception handling firmware instructions are controlled by which exception handling state variable is configurable (e.g., by Figure 9 in the control storage (904), or by Figure 3 ). In various embodiments, the exception handling state variable can be used to skip a particular type of command, stall (e.g., postpone) a particular type of command, or execute a particular type of command. More generally, the techniques described herein permit firmware (as desired or if desired) to issue a different (e.g., exception handling) set of commands before processing a previously issued (e.g., non-exception handling) command, perform cleanup before sending a previously issued command out to the NAND flash memory device, and / or discard a previously issued (e.g., non-exception handling) command and process a different (e.g., exception handling) set of commands. The exemplary systems described herein provide the flexibility to perform any of those options.

[0154] As described above, in some embodiments, the storage medium device includes a plurality of dies; the state information includes a plurality of die-specific state information; and each of the plurality of die-specific state information includes a die-specific exception handling state variable. For example, see Figure 5 .

[0155] As described above, in some such embodiments (having die-specific exception handling state variables), the die-specific exception handling state variables include a freeze bit; the firmware is further configured to place the exception handling set of firmware instructions into a prioritized queue; and selecting one or more firmware instructions from a plurality of firmware instructions includes: in response to the freeze bit being asserted, for a die among the plurality of dies corresponding to the asserted freeze bit, selecting the prioritized queue having the exception handling set of firmware instructions over a lower priority queue having a non-exception handling set of firmware instructions, as specified by a condition table; and in response to the freeze bit being de-asserted, for a die among the plurality of dies corresponding to the asserted freeze bit, resuming selection of the lower priority queue having the non-exception handling set of firmware instructions, as specified by the condition table.

[0156] As described above, in some embodiments, the die-specific exception handling state variable includes a refresh bit; and determining how to handle one or more selected firmware instructions includes: in response to the refresh bit being asserted, for the die corresponding to the asserted refresh bit in the multiple die, discarding the non-exception handling set of firmware instructions in the to-be-refreshed queue, as specified by the condition table.

[0157] As described above, in some such embodiments (e.g., with a flush bit), discarding further includes selectively discarding based on instruction type, such that: a first non-exception handling firmware instruction of a first instruction type and included in a pending flush queue is retained in the pending flush queue after the flush; and a second non-exception handling firmware instruction of a second instruction type and included in the pending flush queue is discarded from the pending flush queue after the flush. For example, depending on the situation, it may be desirable to skip or otherwise discard certain types of commands (e.g., discard commands that take a relatively long time, such as program commands or erase commands, but retain relatively fast commands, such as read commands or health check commands).

[0158] As described above, in some such embodiments (e.g., with a flush bit), discarding further includes rerouting the non-exception handling firmware instruction that has passed through the skip comparison execution branch back to the skip comparison execution branch via the path for the partially executed firmware instruction. For example, see Figure 7 .

[0159] Although the foregoing embodiments have been described in some detail for purposes of clarity of understanding, the invention is not limited to the details provided. There are many alternative ways to implement the invention. The disclosed embodiments are illustrative, not restrictive.

Claims

1. A storage controller system, comprising: The hardware is configured as: selecting one or more firmware instructions from the plurality of firmware instructions based at least in part on: a condition table including one or more conditions for processing the plurality of firmware instructions and the state information; determining how to process one or more selected firmware instructions based at least in part on: the condition table and the state information; and where the determined processing is execution of the one or more selected firmware instructions, obtaining an instruction sequence from a sequenced table including one or more instruction sequences associated with the storage media device based at least in part on the one or more selected firmware instructions; as well as The interface is configured to output the obtained instruction sequence to the storage medium device if the determined processing is to execute one or more selected firmware instructions.

2. The storage controller system according to claim 1, wherein: The hardware includes one or more of the following: an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA).

3. The storage controller system according to claim 1, wherein: The sequencing table includes: a first writable control storage table of command sequences, and a second writable control storage table of physical command instructions; The command sequence includes: accessing a first writable control storage table of command sequences at a first index included in the one or more selected firmware instructions to obtain a second index in a second writable control storage table of physical command instructions; and accessing a second writable control storage table of physical command instructions at a second index to obtain one or more physical command instructions; and Outputting the obtained instruction sequence includes using one or more physical command instructions located at least in part at a second index in a second writable control storage table of physical command instructions.

4. The storage controller system according to claim 3, wherein: Accessing a first writable control storage table of command sequences at a first index included in the one or more selected firmware instructions further comprises: obtaining an internal-only command sequence; and In response to getting only the internal command sequence: Skipping the step of accessing a second writable control storage table of physical command instructions; and Skip the step of outputting the obtained instruction sequence.

5. The storage controller system according to claim 1, wherein: The condition table includes post-processing conditions, the post-processing conditions including: a status update position specific to the storage medium device, and a status update value specific to the storage medium device; and The hardware is further configured to update the status update location with a status update value specified by the post-processing condition.

6. The storage controller system according to claim 1, wherein: The condition table includes a post-processing condition, wherein the post-processing condition includes: a debug-related update position and a debug-related update value, wherein the firmware enables the post-processing condition when the firmware is in debug mode; and The hardware is further configured to update the debug-related update location with a debug-related update value specified by the post-processing condition.

7. The storage controller system according to claim 1, wherein: The storage medium device supports a suspend command that permits suspending one or more of: a program command or an erase command; The status information includes suspension-related status information; The condition table includes suspension-related condition information; and Determining how to process the one or more selected firmware instructions includes comparing the suspend-related state information and the suspend-related condition information.

8. The storage controller system of claim 1, wherein: The status information includes timer-related status information; The condition table includes timer-related condition information; and Determining how to process the one or more selected firmware instructions includes comparing the timer-related state information and the timer-related condition information.

9. The storage controller system according to claim 8, wherein: A timer associated with the timer-related state information begins counting in response to one or more of: a program command or an erase command.

10. A method comprising: Provide hardware, the hardware being configured to: selecting one or more firmware instructions from the plurality of firmware instructions based at least in part on: a condition table including one or more conditions for processing the plurality of firmware instructions and the state information; determining how to process one or more selected firmware instructions based at least in part on: the condition table and the state information; and where the determined processing is execution of the one or more selected firmware instructions, obtaining an instruction sequence from a sequenced table including one or more instruction sequences associated with the storage media device based at least in part on the one or more selected firmware instructions; as well as An interface is provided, the interface being configured to output the obtained instruction sequence to a storage medium device if the determined processing is execution of one or more selected firmware instructions.

11. The method according to claim 10, wherein: The hardware includes one or more of the following: an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA).

12. The method according to claim 10, wherein: The sequencing table includes: a first writable control storage table of command sequences, and a second writable control storage table of physical command instructions; The command sequence includes: accessing a first writable control storage table of command sequences at a first index included in the one or more selected firmware instructions to obtain a second index in a second writable control storage table of physical command instructions; and accessing a second writable control storage table of physical command instructions at a second index to obtain one or more physical command instructions; and Outputting the obtained instruction sequence includes using one or more physical command instructions located at least in part at a second index in a second writable control storage table of physical command instructions.

13. The method according to claim 12, wherein: Accessing a first writable control storage table of command sequences at a first index included in the one or more selected firmware instructions further comprises: obtaining an internal-only command sequence; and In response to getting only the internal command sequence: Skipping the step of accessing a second writable control storage table of physical command instructions; and Skip the step of outputting the obtained instruction sequence.

14. The method of claim 10, wherein: The condition table includes post-processing conditions, the post-processing conditions including: a status update position specific to the storage medium device, and a status update value specific to the storage medium device; and The hardware is further configured to update the status update location with a status update value specified by the post-processing condition.

15. The method of claim 10, wherein: The condition table includes a post-processing condition, wherein the post-processing condition includes: a debug-related update position and a debug-related update value, wherein the firmware enables the post-processing condition when the firmware is in debug mode; and The hardware is further configured to update the debug-related update location with a debug-related update value specified by the post-processing condition.

16. The method of claim 10, wherein: The storage medium device supports a suspend command that permits suspending one or more of: a program command or an erase command; The status information includes suspension-related status information; The condition table includes suspension-related condition information; and Determining how to process the one or more selected firmware instructions includes comparing the suspend-related state information and the suspend-related condition information.

17. The method of claim 10, wherein: The status information includes timer-related status information; The condition table includes timer-related condition information; and Determining how to process the one or more selected firmware instructions includes comparing the timer-related state information and the timer-related condition information.

18. The method according to claim 17, wherein: A timer associated with the timer-related state information begins counting in response to one or more of: a program command or an erase command.

Citation Information

Patent Citations

  • Method and system for communicating with non-volatile memory

    CN105723317A

  • Flexible interface for NAND flash memory

    CN106469026A

  • Concurrent read and reconfigured write operations in a memory device

    CN107615249A

  • Firmware refreshing method and device, computer equipment and storage medium

    CN112506758A

  • Nonvolatile memory device and operation method thereof

    US20190121720A1