Embodiments described herein relate generally to a memory controller, a storage device and a memory control method.
In a NAND flash memory (hereinafter called a NAND memory), page data to be written is error correction coded for protection. As a scheme of error correction coding, there is a method using LDPC (Low Density Parity Check) codes. In a region where the error rate is low, the probability of failing in decoding an LDPC code is affected by a set of bits linked in a specific relation (a trapping set).
In general, according to one embodiment, a memory controller comprises an encoding unit that encodes first unit data and second unit data to generate a first codeword and a second codeword; a rearranging unit that extracts a bit string (first bit string) in specific bit positions from each of the first codeword and the second codeword to generate first page data and to generate second and subsequent page data containing the remaining bit strings (second bit strings) other than the first bit strings respectively in the first codeword and the second codeword; and a write control unit that writes the first page data and the second page data respectively into a first page and a second page of a nonvolatile memory.
Exemplary embodiments of a memory controller, a storage device and a memory control method will be explained below in detail with reference to the accompanying drawings. The present invention is not limited to the following embodiments.
The nonvolatile memory 3 is a nonvolatile memory configured to store data in a nonvolatile manner. The nonvolatile memory 3 is, for example, a NAND memory. Note that, in an example explained below, the NAND memory is used as the nonvolatile memory 3. However, the nonvolatile memory 3 can be a memory other than the NAND memory. In the NAND memory, in general, data is written and read out for each of write unit data called page.
The memory controller 2 controls writing into the nonvolatile memory 3 according to a write command received from the host 4. The memory controller 2 controls reading from the nonvolatile memory 3 according to a read command received from the host 4. The memory controller 2 comprises a host I/F 21, a memory I/F 22 (a write control unit), a control unit 23, an ECC (Error Correcting Code) unit 24, a data buffer 27, and a rearranging unit 28, which are connected to each other via an internal bus 20.
The host I/F 21 outputs commands, user data (write data), and the like received from the host 4 onto the internal bus 20. The host I/F 21 transmits user data read from the nonvolatile memory 3, responses from the control unit 23, and the like to the host 4.
The memory I/F 22 controls writing user data and the like into the nonvolatile memory 3 and reading from the nonvolatile memory 3 based on instructions from the control unit 23.
The control unit 23 collectively controls the semiconductor storage device 1. The control unit 23 is, for example, a CPU (Central Processing Unit), MPU (Micro Processing Unit), or the like. When receiving a command from the host 4 via the host I/F 21, the control unit 23 performs control according to the command. For example, the control unit 23, according to a command from the host 4, instructs the memory I/F 22 to write user data and parity into the nonvolatile memory 3. Also, the control unit 23, according to a command from the host 4, instructs the memory I/F 22 to read user data and parity from the nonvolatile memory 3.
The control unit 23 determines a storage area (memory area) on the nonvolatile memory 3 for user data stored in the data buffer 27. User data is stored in the data buffer 27 via the internal bus 20. The control unit 23 performs the determination of the memory area for data in a page unit (page data), which is a write unit. In the present description, unit data is defined as user data stored in one page of the nonvolatile memory 3. In the present embodiment, a codeword is generated by encoding, described later, for the unit data and stored as one page of data in one page of the nonvolatile memory 3. In the present description, the memory cells connected in common to one word line are referred to as a memory cell group. Where the memory cell is a single-level cell, the memory cell group corresponds to one page. Where the memory cell is a multi-level cell, the memory cell group corresponds to multiple pages. For example, when 2-bit storable multilevel cells are used, the memory cell group corresponds to two pages. The control unit 23 determines the memory area of the nonvolatile memory 3 for each unit data to be written into. Physical address is assigned to the memory area of the nonvolatile memory 3. The control unit 23 manages the write destination memory area of the unit data using the physical address. The control unit 23 instructs the memory I/F 22 to write user data into the nonvolatile memory 3 with specifying the determined memory area (physical address). The control unit 23 manages the correspondence between logical addresses of user data (logical addresses managed by the host 4) and physical addresses. When receiving a read command including a logical address from the host 4, the control unit 23 identifies the physical address corresponding to the logical address and instructs the memory I/F 22 to read user data with specifying the physical address.
The ECC unit 24 encodes unit data stored in the data buffer 27 to generate a codeword. The ECC unit 24 comprises an encoding unit 25 and a decoding unit 26. The encoding unit 25 encodes unit data written in the same page to generate a codeword. Here, an example where the encoding unit 25 performs LDPC encoding will be described. The encoding performed by the encoding unit 25 is not limited to this. As long as a restriction is imposed on the storage destination for a specific bit set out of the generated codeword, the operation of the present embodiment can be applied regardless of the encoding scheme. The decoding unit 26 decodes codeword with noise attributed to writing, reading, and storing, which is read from the nonvolatile memory 3.
The data buffer 27 temporarily stores user data received from the host 4 until it is stored in the nonvolatile memory 3 and temporarily stores data read from the nonvolatile memory 3 until it is transmitted to the host 4. The data buffer 27 is constituted by, e.g., a general-purpose memory such as an SRAM (Static Random Access Memory) or a DRAM (Dynamic Random Access Memory).
The rearranging unit 28 rearranges codewords generated by the encoding unit 25 with use of a table held therein. This table is a table having stored therein rules in rearranging generated codewords and is created in advance. The details of the table will be described later. The rearranging unit 28 rearranges data read from the nonvolatile memory 3 using the table.
Here, it is supposed that codewords generated by the encoding unit 25 are stored in the data buffer 27. Then, the rearranging unit 28 rearranges a codeword on the data buffer 27 using the table and stores the rearranged codeword in the data buffer 27. The memory I/F 22 writes the rearranged codeword on the data buffer 27 into the nonvolatile memory 3 based on an instruction from the control unit 23. When reading from the nonvolatile memory 3, the memory I/F 22 stores a codeword read from the nonvolatile memory 3 in the data buffer 27. The rearranging unit 28 rearranges the codeword on the data buffer 27 and stores the rearranged codeword in the data buffer 27.
Although the example where the data buffer 27 is used as a working memory for rearrangement has been described, a buffer other than the data buffer 27 may be used as a working memory for rearrangement. For example, since the ECC unit 24 generally has a buffer used for encoding and decoding, this buffer may be used as a working memory for rearrangement. Or without using a working memory for rearrangement, the rearranging unit 28 may perform rearrangement when transferring a codeword from the data buffer 27 to the memory I/F 22. Likewise, as to rearrangement when reading, the data buffer 27 or a buffer other than the data buffer 27 may be used as a working buffer. Or a working buffer does not have to be used.
The decoding failure probability of LDPC codes will be described.
However, as the code rate increases (redundancy decreases), that is, as relational expressions between bits (bit constraints) become fewer, the degrees of freedom in changing the relational expressions become fewer, and hence it becomes difficult to remove all the trapping sets greatly affecting the error floor worsening. Thus, a trapping set may remain.
In the present embodiment, when storing a codeword in the nonvolatile memory 3, the trapping set is stored in a storage area having a low error occurrence probability. Thus, the error floor can be improved. For example, where memory cells storing four values per cell (memory cells of two bits per cell) are used, two bits stored in each memory cell correspond to two pages called a lower page, an upper page. The lower page and the upper page are generally different in error occurrence probability. Accordingly, the trapping set is stored in a page having a low error occurrence probability from among the lower page and the upper page. Or, if the error occurrence probability differs for each chip, the trapping set is stored in a chip having a low error occurrence probability. Or, if the error occurrence probability differs for each storage area such as storage area on a block basis, the trapping set may be stored in a storage area having a low error occurrence probability.
Although there is no restriction on the method of calculating the error occurrence probability on a storage area basis, for example, in the case of the lower page and the upper page, the error occurrence probability can be determined by the method of assigning voltage thresholds. Or, if on a chip basis or on a block basis, the numbers of write times, error occurrence frequencies, or the like may be recorded, and the error occurrence probability may be determined based on the past numbers of write times, error occurrence frequencies, or the like.
The trapping set is calculated by simulation or the like beforehand at the time of code designing. There is no restriction on the method of simulation. For example, a decoding simulation with data having a codeword randomly given errors as an input is performed, and which bits are in error is recorded and analyzed at decoding failure. By this means, trapping sets having a bad effect are obtained. The trapping sets obtained in this way are stored in the form of a table.
There is no restriction on the format of the table storing trapping sets, and information by which bit positions in the codeword of the bits corresponding to a trapping set are identifiable is stored. For example, let a codeword be formed of n bits and the bit positions in the codeword be denoted by numbers of from 0 to n−1. Then, numbers denoting the bit positions corresponding to a trapping set are stored in the table.
In the present embodiment, the rearranging unit 28 realizes data of the bit positions corresponding to the trapping set in each of LDPC1 and LDPC2 (hereinafter called the bit string of a trapping set) based on the table and stores these data in a place having a low error occurrence probability in the nonvolatile memory 3. The other bits (second bit string) than the bit string (first bits) of the trapping set in each codeword (LDPC1, LDPC2 in
When reading from the nonvolatile memory 3, data of the two pages shown on the right side of
Note that
Although
Where the codewords in the group are distributed to and stored in chips different in error occurrence probability, the bits of the trapping sets of the codewords in the group are stored in a chip having a low error occurrence probability. The bits other than the bit strings of the trapping sets are distributed to and stored in the chip having a low error occurrence probability and the other chips. When reading, reading from multiple pages forming one group is performed. Accordingly, if reading from chips in parallel can be performed, data of one group is distributed to and stored in the different chips, and by reading from the chips simultaneously, the read time can be shortened.
The rearranging unit 28 divides each codeword into parts on a storage-destination page basis based on the table (step S13). In the case of the example of
The rearranging unit 28 generates page data from divided codewords (step S14). The rearranging unit 28 writes the generated page data over the area where the original codeword (from which the page data was generated) has been stored on the data buffer 27. At this time, the rearranging unit 28 writes page data in which the bit strings of trapping sets are gathered (the lower part of the right side in the example of
The control unit 23 notifies the correspondence between the storage position of page data on the data buffer 27 and the storage area on the nonvolatile memory 3 to the memory I/F 22. The memory I/F 22 stores the page data on the data buffer 27 in the nonvolatile memory 3 based on the notification from the control unit 23 (step S15). Having undergone the above process, the page data in which the bit strings of trapping sets are gathered is stored in a page having a low error occurrence probability.
The rearranging unit 28, referring to the table, restores codewords from the data read from the nonvolatile memory 3 (step S22). That is, rearrangement is performed such that the codewords rearranged when writing return to the state before that rearrangement (the codewords on the right side of
The control unit 23 instructs the decoding unit 26 to decode the codeword corresponding to unit data to be read, and the decoding unit 26 decodes the codeword based on the instruction (step S23). Having undergone the above process, unit data (user data) after decoding is obtained.
Because the positions of bits forming the trapping set in a codeword are fixed regardless of information which is the input to the encoding, the rearranging unit 28 does not need to refer to the table each time when writing. The rearrangement may be realized by configuring the rearranging unit 28 to divide a codeword into data of pages to be distributed in a fixed order. The same applies to rearrangement when reading.
Although in the present embodiment one codeword is generated using user data (unit data) to be written into one page, one codeword may be generated using multiple unit data. Or unit data may be divided into multiple parts, and multiple codewords generated using divided data may be stored in one page. Also in these cases, with a group being formed of multiple pages different in error occurrence probability, codewords are rearranged such that the bit strings of trapping sets of the codewords in the group are stored in a page having a low error occurrence probability, and thereby the error floor can be improved.
In the above example, the bit strings of trapping sets in LPDC codes are gathered in a page having a low error occurrence probability. But, not being limited to this, with another encoding scheme, if specific bit sets in codewords affects the error occurrence probability, by gathering the specific bit sets in a page having a low error occurrence probability, the error rate after decoding can be reduced.
Although in the first embodiment the example where there is lopsidedness in error occurrence probability between storage areas has been described, even where no lopsidedness exists, by gathering trapping sets in a page to add parity to and to store, the error floor can be improved.
In the present embodiment, as shown in
The rearranging unit 28 generates page data containing the codeword except the bit string of a trapping set for each codeword generated by the encoding unit 25 (LDPC1, LDPC2, . . . on the right side of
The rearranging unit 28 generates page data containing the codeword except the bit string of a trapping set and TS page data for each codeword generated by the encoding unit 25 (step S35). The control unit 23 notifies the correspondence between the storage position of page data on the data buffer 27 and the storage area on the nonvolatile memory 3 to the memory I/F 22. The memory I/F 22 stores the page data on the data buffer 27 in the nonvolatile memory 3 based on the notification from the control unit 23 (step S36).
The decoding unit 26 decodes the codeword read from the nonvolatile memory 3 (step S42). The decoding unit 26 notifies whether it has succeeded in decoding to the control unit 23. The control unit 23 determines whether it has succeeded in decoding (step S43), and if having succeeded (Yes at step S43), finishes reading. If having failed in decoding (No at step S43), the control unit 23 reads TS page data to decode (step S44). Specifically, the control unit 23 instructs the memory I/F 22 to read TS page data corresponding to the codeword to be read. The memory I/F 22 reads the TS page data from the nonvolatile memory 3 based on the instruction from the control unit 23. Then, the decoding unit 26 decodes the TS page data. Thus, the bit strings of the trapping sets are decoded.
The rearranging unit 28 replaces data of the bit positions corresponding to the trapping set of the codeword read from the nonvolatile memory 3 with bit values of the decoded trapping set (step S45). The decoding unit 26 decodes the codeword after the bit value replacement (step S46).
In the case where the bit string of a trapping set is removed from the original codeword to generate page data, TS page data is also read from the nonvolatile memory 3 in step S41. Then, without executing steps S42, S43, S44, step S45 and later steps are executed.
As such, in the present embodiment, the bit strings of trapping sets are gathered to add parity to and to store in the nonvolatile memory 3. Thus, the probability that errors will remain in the bit strings of trapping sets can be reduced, so that the error floor can be improved.
Note that the first embodiment and the present embodiment may be combined. For example, although in the example of
While certain embodiments have been described, these embodiments have been presented by way of example only, and are not intended to limit the scope of the inventions. Indeed, the novel embodiments described herein may be embodied in a variety of other forms; furthermore, various omissions, substitutions and changes in the form of the embodiments described herein may be made without departing from the spirit of the inventions. The accompanying claims and their equivalents are intended to cover such forms or modifications as would fall within the scope and spirit of the inventions.
This application is based upon and claims the benefit of priority from U.S. Provisional Application No. 61/936,038, filed on Feb. 5, 2014; the entire contents of which are incorporated herein by reference.
Number | Date | Country | |
---|---|---|---|
61936038 | Feb 2014 | US |