This application is based upon and claims the benefit of priority from the prior Japanese Patent Application No. 2008-328465, filed on Dec. 24, 2008; the entire contents of which are incorporated herein by reference.
1. Field of the Invention
The present invention relates to a memory system, a transfer controller, and a memory control method.
2. Description of the Related Art
As a memory system used in a computer system, a solid state drive (SSD) mounted with a nonvolatile semiconductor memory such as a NAND flash memory (hereinafter, “NAND memory”) attracts attention. The memory system such as the SSD has advantages such as high speed and light weight compared with a magnetic disk device.
In the NAND memory, an error rate rises as the number of times of rewriting increases. Therefore, in the SSD, an error correcting code circuit is mounted in a NAND memory chip or a transfer controller that controls data transfer between the NAND memory and a host apparatus such as a personal computer (see, for example, Japanese Patent Application Laid-Open No. 2008-041171).
The SSD includes a nonvolatile memory such as a dynamic random access memory (DRAM) used as a buffer memory or a cache memory for performing data transfer between the NAND memory and the host apparatus such as the personal computer. In recent years, it has become evident that, when a DRAM is connected to the outside of a transfer controller, an error occurs in access to the DRAM because of the influence of noise and the like. In the SSD in the past, the error that occurs in the access to the DRAM is corrected by an ECC circuit mounted on the transfer controller, a driver of the host apparatus, or the like. The operation for the error correction is a cause of deterioration in data transfer efficiency of the SSD. Therefore, there is a demand for a technology for reducing a frequency of occurrence of an error during the access to the DRAM.
A memory system according to an embodiment of the present invention comprises:
a nonvolatile memory;
a volatile buffer memory connected to the nonvolatile memory;
an error counting unit that detects, for each of divided areas formed by dividing a storage area of the volatile buffer memory into a plurality of areas, a parity error in inputting data to and outputting data from the divided areas and counts a number of times of accumulation of the parity error; and
a control unit that sets the divided area, in which the number of times of accumulation of the parity error counted by the error counting unit exceeds a predetermined number of times, in a disabled state.
A transfer controller that controls a nonvolatile memory and a volatile buffer memory connected to the nonvolatile memory according to an embodiment of the present invention comprises:
an error counting unit that detects, for each of divided areas formed by dividing a storage area of the volatile buffer memory into a plurality of areas, a parity error in inputting data to and outputting data from the divided areas and counts a number of times of accumulation of the parity error; and
a control unit that sets the divided area, in which the number of times of accumulation of the parity error counted by the error counting unit exceeds a predetermined number of times, in a disabled state.
A memory control method for controlling a nonvolatile memory and a volatile buffer memory connected to the nonvolatile memory according to an embodiment of the present invention comprises:
dividing a storage area of the volatile buffer memory into a plurality of areas;
detecting a parity error in inputting data to and outputting data from the divided areas;
counting a number of times of accumulation of the parity error; and
setting the divided area, in which the number of times of accumulation of the parity error exceeds a predetermined number of times, in a disabled state.
Exemplary embodiments of a memory system, a transfer controller, and a memory control method according to the present invention will be explained below in detail with reference to the accompanying drawings. The present invention is not limited to the following embodiments.
The SSD controller 3 includes a data access bus 101 and a circuit control bus 102. A processor 103 that controls the entire SSD controller 3 is connected to the circuit control bus 102. A read only memory (ROM) 104 having stored therein a boot program for booting management programs (firmware) stored in the NAND memory 2 is also connected to the circuit control bus 102.
A static random access memory (SRAM) 105 used as a data work area and a firmware expansion area is connected to the data access bus 101 via an SRAM controller 106. During starting, the firmware stored in the NAND memory 2 is transferred to the SRAM 105 and expanded by the boot program stored in the ROM 104. The processor 103 executes the firmware expanded in the SRAM 105 to thereby control the entire SSD controller 3.
A DRAM controller 107 that executes read and write control for the DRAM 4 is also connected to the data access bus 101. The DRAM controller 107 detects errors that occur before and after a series of DRAM access for writing transfer data in the DRAM 4 and reading out the written transfer data and disables an area where errors frequently occur during access. Functions of the DRAM controller 107 are explained in detail later.
A SATA interface controller (a SATA controller) 108, a NAND error correction circuit 109, and a NAND controller 110 are connected to both the data access bus 101 and the circuit control bus 102. The SATA controller 108 transmits and receives data to and from the host apparatus via a SATA interface.
The NAND controller 110 has an interface function for the NAND memory 2 and an error correcting function for correcting an error that occurs during access to the NAND memory 2. The error correcting function of the NAND controller 110 is a function for performing encoding of a second error correction code and encoding and decoding of a first error correction code. The NAND error correction circuit 109 performs decoding of the second error correction code. The first error correction code and the second error correction code are, for example, a Hamming code, a Bose Chaudhuri Hocqenghem (BCH) code, a Reed Salomon (RS) code, or a low density parity check (LDPC) code. A correction ability of the second error correction code is higher than that of the first error correction code.
A data flow between the host apparatus and the NAND memory 2 in the SSD 1 configured as explained above is explained. Data transmitted from the host apparatus and written in the NAND memory 2 is referred to as Write data. Data read out from the NAND memory 2 and transferred to the host apparatus is referred to as Read data.
The processor 103 issues, to the NAND controller 110, a second transfer command for reading out the Write data written in the DRAM 4 and writing the Write data in the NAND memory 2. The NAND controller 110 reads out, based on the second transfer command, the Write data written in the DRAM 4 and writes the Write data in the NAND memory 2 (data flow F2). In writing the Write data, the NAND controller 110 applies encoding of the second error correction code and the first error correction code to the Write data and writes the Write data in the NAND memory 2 together with the first and second error correction codes.
When the NAND controller 110 fails in the correction of an error in a process for executing the third transfer command, the NAND controller 110 notifies the processor 103 that the NAND controller 110 fails in the error correction. The processor 103 receives the notification and issues an error correction command to the NAND error correction circuit 109. The NAND error correction circuit 109 reads out, based on the error correction command from the processor 103, the Read data written in the DRAM 4 in the data flow F3 (data flow F4). The NAND error correction circuit 109 applies decoding of the second error correction code to the read-out Read data, executes error detection and correction, and writes the Read data subjected to the error detection and correction in the DRAM 4 again (data flow F5).
The processor 103 issues, to the SATA controller 108, a fourth transfer command for reading out the Read data and transferring the Read data to the host apparatus. The SATA controller 108 reads out, based on the fourth transfer command, the Read data subjected to the error correction by the NAND error correction circuit 109 and written in the DRAM 4 and transfers the Read data to the host apparatus (data flow F6).
When the NAND controller 110 succeeds in the error detection and correction in a process for executing the third transfer command, the NAND error correction circuit 109 does not execute the error correction. In this case, the SATA controller 108 reads out, based on the fourth transfer command, the Read data written in the DRAM 4 in the data flow F3 and transfers the Read data to the host apparatus (data flow F6).
In the first to fourth transfer commands and the error correction command issued by the processor 103, addresses of access destinations in the DRAM 4 are designated. Components at access sources (the SATA controller 108, the NAND error correction circuit 109, and the NAND controller 110) write data in and read out data from the addresses at the access destinations designated in the commands.
When the data is written in the DRAM 4 in the data flows F1, F3, and F5, the DRAM controller 107 applies parity calculation to the data to be written. When the data is read out from the DRAM 4 in the data flows F2, F4, and F6, the DRAM controller 107 applies parity calculation to the read-out data. The DRAM controller 107 compares results of the parity calculations during the data writing and during the data readout to thereby detect errors (parity errors) that occur before and after a series of operation for writing the data in the DRAM 4 and reading out the written data.
When the DRAM controller 107 detects an error, the DRAM controller 107 notifies the processor 103 that the error is detected. The processor 103 receives the error detection notification and determines in which data the error is detected. When the error is detected in the Write data read out from the DRAM 4 in the data flow F2, the processor 103 requests the SATA controller 108 to transmit the Write data again. When the error is detected in the Read data read out from the DRAM 4 in the data flow F6, the processor 103 requests the NAND controller 110 to transmit the Read data again. When the error is detected in the Read data read out from the DRAM 4 in the data flow F4, the processor 103 can request the NAND controller 110 to retransmit the Read data or can cause, without requesting the retransmission of the Read data, the NAND error correction circuit 109 to correct the data in which the error is detected.
Further, the DRAM controller 107 counts the number of times of accumulation of parity errors detected in each of divided areas formed by dividing a storage area of the DRAM 4 into a plurality of areas. When there is a divided area in which a count value exceeds a predetermined number of times, the DRAM controller 107 notifies the processor 103 that the divided area is disabled. The processor 103 receives the disable notification and does not designate the disabled area as a writing destination in the first and third transfer command. In short, in a divided area in which errors frequently occur, a count value exceeds the predetermined number of times. The divided area is set in a disabled state.
The parity storing SRAM 11 is a volatile memory as temporary storage means that temporarily stores a parity calculation result calculated for each data of a predetermined size. The size of an execution unit of parity calculation is hereinafter referred to as a parity calculation unit.
The DRAM/SRAM allocation table 12 is a table for managing, for each parity calculation unit, correspondence between an address of data written in the DRAM 4 and an address in the parity storing SRAM 11 in which a parity calculation result concerning the data is stored.
Referring back to
The parity calculating and comparing unit 14 and the number-of-times-of-error-detection recording unit 15 function as error counting means for detecting, for each of the Areas, a parity error in inputting data to and outputting data from the Area and cumulatively counting the number of times of detection of the parity error.
Specifically, every time the DRAM-access circuit unit 13 receives data from an access destination in the parity calculation unit, the parity calculating and comparing unit 14 calculates a parity for the received data in the parity calculation unit before being written in the DRAM 4. The parity calculating and comparing unit 14 calculates, referring to the DRAM/SRAM allocation table 12, an address of the parity storing SRAM 11, in which a parity calculation result is stored, corresponding to an address of the DRAM 4 at a writing destination of the received data in the parity calculation unit. The parity calculating and comparing unit 14 stores a parity calculation result of the data in the calculated address of the parity storing SRAM 11. The parity calculating and comparing unit 14 executes, every time the DRAM-access circuit unit 13 reads out data in the parity calculation unit from the DRAM 4, parity calculation on the read-out data in the parity calculation unit. The parity calculating and comparing unit 14 calculates, referring to the DRAM/SRAM allocation table 12, an address on the parity storing SRAM 11, in which a parity calculation result is stored, corresponding to an address on the DRAM 4 in which the read-out data in the parity calculation unit is written. The parity calculating and comparing unit 14 reads out a parity calculation result during writing of the data from the calculated address and compares the parity calculation result with a parity calculation result obtained when the data is read out. When the parity calculation results are different, the parity calculating and comparing unit 14 notifies the number-of-times-of-error-detection recording unit 15 and the processor 103 that an error is detected.
The number-of-times-of-error-detection recording unit 15 counts, for each of the Areas, the error detection notification received from the parity calculating and comparing unit 14 and records a count value of the error detection notification. In other words, the number-of-times-of-error-detection recording unit 15 counts, for each of the Areas, the number of times of occurrence of a parity error and records a cumulative result of the parity error.
The DRAM/SRAM allocation unit 16 and the processor 103 function as allocation control means for setting an Area in which a count value exceeds a predetermined number of times in the disabled state. Specifically, when there is an Area in which a count value of error detection recorded by the number-of-times-of-error-detection recording unit 15 exceeds a predetermined number of times set by the processor 103 (firmware) or the like, the DRAM/SRAM allocation unit 16 issues disable notification for disabling the Area to the processor 103. The processor 103 receives the disable notification and disables the Area.
In
The DRAM-access circuit unit 13 receives data and writes the data in the Area 0. The parity calculating and comparing unit 14 calculates, every time the DRAM-access circuit unit 13 receives the data by 64 bytes, a parity for the received 64-byte data (step S1). The parity calculating and comparing unit 14 stores, based on the DRAM/SRAM allocation table 12, a parity calculation result in the parity storing SRAM 11 (step S2).
The parity calculating and comparing unit 14 determines whether the data reception from the access source ends (step S3). When the data reception does not end (“No” at step S3), the parity calculating and comparing unit 14 shifts to step S1. When the data reception ends (“Yes” at step S3), i.e., when all the 512-byte data write-requested by the access source are received, the parity calculating and comparing unit 14 ends the operation. According to the operation, eight parity calculation results are calculated from the data stored in the Area 0 and are stored in the parity storing SRAM 11.
The DRAM-access circuit unit 13 reads out data from the Area 0 and transmits the read-out data to the access source. The parity calculating and comparing unit 14 calculates, every time the DRAM-access circuit unit 13 reads out the data by 64 bytes, a parity for the read-out 64-byte data (step S11). The parity calculating and comparing unit 14 reads out the parity calculation result of the data stored in the parity storing SRAM 11 at step S2 (step S12). The parity calculating and comparing unit 14 compares the read-out parity calculation result and a parity calculation result calculated at step S11 and determines whether the parity calculation results coincide with each other (step S13). When the parity calculation results coincide with each other (“Yes” at step S13), the parity calculating and comparing unit 14 determines that an error is not detected and further determines whether the readout of data transmitted to the access source is completed (step S14). When the readout of data is completed (“Yes” at step S14), the parity calculating and comparing unit 14 ends the operation. When the readout of data is not completed (“No” at step S14), the parity calculating and comparing unit 14 shifts to step S11.
When the parity calculation results do not coincide with each other at step S13 (“No” at step S13), the parity calculating and comparing unit 14 determines that an error is detected and notifies the processor 103 and the number-of-times-of-error-detection recording unit 15 that the error is detected (step S15). The number-of-times-of-error-detection recording unit 15 increments a count value for recording the number of times of error detection in the Area 0 (step S16) and shifts to step S14.
In the above explanation, the number of times of error detection is counted for each of the Areas and, when the count value exceeds the predetermined number of times, the disable notification for disabling the area in which the count value exceeds the predetermined number of times is issued. However, it is also possible to periodically reset the count value for each of the Areas to thereby substantially record an error detection frequency and issue disable notification for disabling an Area in which the error detection frequency exceeds a reference set by firmware or the like.
The functional components of the DRAM controller 107 do not need to be realized in the DRAM controller 107. A part or all of the functional components can be realized in other components of the SSD 1 such as the processor 103. In the above explanation, the parity storing SRAM 11 is used as the area for storing a parity. However, a parity can be stored in other memories.
In the above explanation, the DRAM controller 107 notifies the processor 103 of the disabling of an Area and the processor 103 does not designate the notified Area as a writing destination to thereby disable the Area. However, instead of notifying the processor 103 of the disabling an Area, the DRAM controller 107 can change, when access with a writing destination set in an Area in which the number of times of error detection exceeds the predetermined number of times is received, the writing destination to another Area in the DRAM 4 to thereby substantially disable the area in which the number of times of error detection exceeds the predetermined number of times.
In the above explanation, the DRAM 4 is used as a buffer area for data transfer. However, the DRAM 4 can be used as a cache area.
As explained above, according to the first embodiment, the SSD controller 2 calculates, for each of the Areas formed by dividing the storage area of the DRAM 4 into a plurality of areas, a parity error in inputting data to and outputting data from the Areas, counts the number of times of parity error accumulation, and disables an Area in which the number of times of parity error accumulation exceeds the predetermined number of times. This makes it possible to obtain a memory system in which a frequency of occurrence of an error during DRAM access is reduced as much as possible.
According to the first embodiment, when a designer or the like changes the capacity of the DRAM 4, the designer has to change hardware design including a change of a capacity of the parity storing SRAM 11 according to the change of the capacity of the DRAM 4. Therefore, a second embodiment of the present invention allows, by making a parity calculation unit variable, the designer to cope with the change of the capacity of the DRAM 4 without changing the parity storing SRAM 11.
As shown in
The DRAM/SRAM allocation unit 26 changes a parity calculation unit based on input from the processor 103 (firmware). Specifically, the DRAM/SRAM allocation unit 26 changes association of an address for storing data in the DRAM 4 and an address for storing a parity calculation result of the DRAM/SRAM allocation table 13 to thereby change the parity calculation unit.
As explained above, according to the second embodiment, because the parity calculation unit can be changed, it is possible to change the capacity of the DRAM 4 without changing the capacity of a parity storage area.
A SSD according to a third embodiment of the present invention can allocate, when a certain Area is disabled, a storage area in the parity storing SRAM 11, in which a parity calculation result of this Area is stored, to another Area.
As shown in
The DRAM/SRAM allocation unit 36 allocates, when a certain Area in the DRAM 4 is disabled, a storage area of the parity storing SRAM 11, to which this area is allocated, to an area in which a parity calculation result is stored of another Area not disabled. The DRAM/SRAM allocation unit 36 changes a parity calculation unit of the new allocated Area to be smaller. The DRAM/SRAM allocation unit 36 corrects the DRAM/SRAM allocation table 12 and reflects the allocation of the Area and the change of the parity calculation unit on the DRAM/SRAM allocation table 12.
As explained above, according to the third embodiment, an area of the parity storing SRAM 11, in which the parity of data is stored, of the disabled Area is allocated to an area for storing the parity of data of another Area. A parity calculation unit of the data of the other Area is set finer. This makes it possible to efficiently use the parity storing SRAM 11.
According to a fourth embodiment of the present invention, parity calculation results are deleted or invalidated in order from oldest one to save the capacity of the parity storing SRAM 11.
In
The parity-generation-time recording unit 47 records time when a parity calculation result is stored in the parity storing SRAM 11.
The DRAM/SRAM allocation unit 46 deletes or invalidates, referring to parity storage time recorded by the parity-storage-time recording unit 47, a parity calculation result stored exceeding a term of validity set by firmware or the like. The DRAM/SRAM allocation unit 46 allocates anew an area in which the deleted or invalidated parity calculation result is stored as an area for storing or overwriting a parity calculation result of another data. The DRAM/SRAM allocation unit 46 corrects the DRAM/SRAM allocation table 12 to thereby reflect the new allocation thereon.
As explained above, according to the fourth embodiment, because old parity calculation results are deleted, the number of parity calculation results stored in the parity storing SRAM 11 can be reduced. This makes it possible to reduce the capacity of the parity storing SRAM 11.
In the above explanation, a parity calculation result stored exceeding the term of validity is deleted and the area from which the parity calculation result is deleted is allocated as a storage area for a parity calculation result of another data. However, when a new parity calculation result needs to be stored, a parity calculation result stored at earliest time can be deleted to allocate an area from which the parity calculation result is deleted as an area for storing the new parity calculation result. A parity calculation result read out at earliest time rather than stored at earliest time can be deleted.
According to a fifth embodiment of the resent invention, a parity storing SRAM compresses and stores parity calculation results.
As shown in
The parity compressing and expanding unit 57 collects a plurality of parity calculation results calculated by the parity calculating and comparing unit 14, compresses the parity calculation results with a reversible code such as a Huffman code, and stores the parity calculation results in the parity storing SRAM 11. The parity compressing and expanding unit 57 reads out parity calculation results compressed and stored in the parity storing SRAM 11, expands the read-out parity calculation results, and passes the parity calculation results to the parity calculating and comparing unit 14.
As explained above, according to the fifth embodiment, parity calculation results of data stored in the DRAM 4 are compressed and stored. This makes it possible to save the capacity of the parity storing SRAM 11.
With SSDs according to the first to fifth embodiments, even when data written in a DRAM is rewritten by 1 bit, it is necessary to read out data for the parity calculation unit and executes parity calculation on the read-out data for the parity calculation unit again. On the other hand, when data written in a DRAM is rewritten by the size equal to or smaller than a parity calculation unit, an SSD according to a sixth embodiment of the present invention changes, based on a change of a rewritten section, a parity calculation result stored in a parity storing SRAM.
Subsequently, the parity calculating and comparing unit 64 reflects the 1-bit rewriting request from the access source on the read-out 1-byte data including the 1-bit rewritten section and generates 1-byte data anew ((3) in the figure). The parity calculating and comparing unit 64 recalculates a parity from the read-out parity calculation result and the number of bits of content requested to be rewritten ((4) in the figure). When the size of the written section is odd number bits, the parity calculating and comparing unit 64 reverses the parity. When the size of the written section is even number bits, the parity calculating and comparing unit 64 does not reverse the parity. Because the content to be changed is only 1 bit, the parity calculating and comparing unit 64 reverses the read-out parity calculation result. Finally, the parity calculating and comparing unit 64 overwrites the second byte section from the top of the data 1 stored in the DRAM 4 with the rewritten 1-byte data and overwrites the parity calculation result of the data 1 with a value obtained by the recalculation ((5) in the figure).
As explained above, according to the sixth embodiment, when, in data of the parity calculation unit stored in the DRAM 4, a part of the data having size smaller than the parity calculation unit is rewritten, the parity calculating and comparing unit 64 rewrites, based on a change between before and after the rewriting of this part of the data, the parity calculation result stored in the parity storing SRAM 11. Therefore, it is possible to avoid the necessity of reading out the data of the parity calculation unit and recalculate a parity to rewrite a part of data having size smaller than the parity calculation unit. This makes it possible to obtain a parity calculation result at high speed.
Additional advantages and modifications will readily occur to those skilled in the art. Therefore, the invention in its broader aspects is not limited to the specific details and representative embodiments shown and described herein. Accordingly, various modifications may be made without departing from the spirit or scope of the general inventive concept as defined by the appended claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2008-328465 | Dec 2008 | JP | national |