JP2020194428A - Data recording device - Google Patents

Data recording device Download PDF

Info

Publication number
JP2020194428A
JP2020194428A JP2019100474A JP2019100474A JP2020194428A JP 2020194428 A JP2020194428 A JP 2020194428A JP 2019100474 A JP2019100474 A JP 2019100474A JP 2019100474 A JP2019100474 A JP 2019100474A JP 2020194428 A JP2020194428 A JP 2020194428A
Authority
JP
Japan
Prior art keywords
data
area
control unit
recording device
coding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2019100474A
Other languages
Japanese (ja)
Inventor
政治 水野
Seiji Mizuno
政治 水野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2019100474A priority Critical patent/JP2020194428A/en
Publication of JP2020194428A publication Critical patent/JP2020194428A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Detection And Correction Of Errors (AREA)

Abstract

To provide a data recording device capable of preventing an occurrence of error-correcting code (ECC) due to overwriting of data even when a piece of data is overwritten on a data area where data is already stored.SOLUTION: A data recording device 100 includes: a non-volatile memory 2 for storing data; and a control unit 1 that controls writing and erasing data on the non-volatile memory 2. The non-volatile memory 2 has a data area for storing data and a spare area for storing error correction code values of data. The control unit 1 has an encoding unit 11 that encodes the data so that the error correction code values of the data in the data area are all 1 and a decoding unit 12 that decodes the encoded data into the un-encoded data.SELECTED DRAWING: Figure 1

Description

本発明は、誤り訂正符号化を用いてデータを記録するデータ記録装置に関する。 The present invention relates to a data recording device that records data using error correction coding.

データを記録するNAND型のフラッシュメモリといった不揮発性メモリは、新たなデータの書き込み(Program)を行う前には、データの消去(Erase)によって、決められた範囲(ブロック)の全てのビットを「1」に変化させる必要がある。このような不揮発性メモリは、データの書き込み動作の際に、所望のビットを「1」から「0」に変化させることはできるが、ビットを「0」から「1」に変化させることはできない。このため、不揮発性メモリは、所望のビットを「1」から「0」に変化させる場合に限り、データを消去することなく続けてデータの書き込み(上書き)を行うことができる。 In non-volatile memory such as NAND flash memory that records data, all bits in the range (block) determined by erasing the data (Erase) are set to "" before writing new data (Program). It is necessary to change it to "1". In such a non-volatile memory, the desired bit can be changed from "1" to "0" during the data writing operation, but the bit cannot be changed from "0" to "1". .. Therefore, the non-volatile memory can continuously write (overwrite) data without erasing the data only when the desired bit is changed from "1" to "0".

このような不揮発性メモリは、記録するデータの内容を保証することが望まれる。特許文献1に記載の不揮発性メモリは、データを格納するデータ領域に加え、スペアデータを格納するスペア領域を備えている。スペアデータは、データ領域に格納されたデータのビットエラー等を検出し訂正する際に用いられる誤り訂正符号(ECC:Error Correcting Code)値等である。これにより、特許文献1に記載の不揮発性メモリは、スペアデータを用いて、データ領域に記録されるデータの内容を保証している。 Such a non-volatile memory is desired to guarantee the content of the data to be recorded. The non-volatile memory described in Patent Document 1 includes a spare area for storing spare data in addition to a data area for storing data. The spare data is an error correcting code (ECC) value or the like used when detecting and correcting a bit error or the like of the data stored in the data area. As a result, the non-volatile memory described in Patent Document 1 guarantees the content of the data recorded in the data area by using the spare data.

特許第5521437号公報Japanese Patent No. 5521437

しかしながら、上記特許文献1に記載の不揮発性メモリにおいて、データ領域に記録されているデータを上書きすると、データ領域のデータのECC値が変化するが、スペア領域に書き込み済みのECC値に対しビットを「0」から「1」に変化させることができない。すなわち、特許文献1に記載の不揮発性メモリは、スペア領域には最初のデータ書き込みの際のECC値が格納されており、上書きによって変化したデータ領域のデータのECC値をスペア領域に上書きしようとしても、ビットの値を「0」から「1」に上書きすることはできない。このため、特許文献1に記載の不揮発性メモリにおいて、データ領域に記録されているデータを上書きすると、上書きされたデータのECC値と、スペア領域に格納されているECC値とが相違することとなり、データの上書きが原因のECCエラーが発生してしまう。このように、特許文献1に記載の不揮発性メモリは、一旦、スペア領域のECC値を消去しないと、データ領域のデータを上書きすることができないという問題があった。 However, in the non-volatile memory described in Patent Document 1, when the data recorded in the data area is overwritten, the ECC value of the data in the data area changes, but a bit is added to the ECC value written in the spare area. It cannot be changed from "0" to "1". That is, in the non-volatile memory described in Patent Document 1, the ECC value at the time of the first data writing is stored in the spare area, and the spare area is attempted to overwrite the ECC value of the data in the data area changed by overwriting. However, the bit value cannot be overwritten from "0" to "1". Therefore, in the non-volatile memory described in Patent Document 1, when the data recorded in the data area is overwritten, the ECC value of the overwritten data and the ECC value stored in the spare area are different. , ECC error occurs due to overwriting of data. As described above, the non-volatile memory described in Patent Document 1 has a problem that the data in the data area cannot be overwritten unless the ECC value in the spare area is erased once.

本発明は、上記に鑑みてなされたものであって、データを格納済みのデータ領域に対してデータを上書きした場合であってもデータの上書きが原因のECCエラーの発生を防止することができるデータ記録装置を得ることを目的とする。 The present invention has been made in view of the above, and even when data is overwritten on a data area in which data is stored, it is possible to prevent the occurrence of an ECC error due to overwriting of data. The purpose is to obtain a data recording device.

上述した課題を解決し、目的を達成するために、本発明のデータ記録装置は、データを記録する不揮発性メモリと、不揮発性メモリへのデータの書き込みおよび消去を制御する制御部と、を備える。不揮発性メモリは、データを格納するデータ領域と、データの誤り訂正符号値を格納するスペア領域と、を有する。制御部は、データ領域内のデータの誤り訂正符号値が全て1となるようにデータを符号化する符号化部と、符号化部によって符号化された符号化後のデータを符号化前のデータに復号する復号化部と、を有する。 In order to solve the above-mentioned problems and achieve the object, the data recording apparatus of the present invention includes a non-volatile memory for recording data and a control unit for controlling writing and erasing of data to the non-volatile memory. .. The non-volatile memory has a data area for storing data and a spare area for storing error correction code values of data. The control unit encodes the data so that the error correction code values of the data in the data area are all 1, and the coded data encoded by the encoding unit is the data before encoding. It has a decoding unit for decoding.

本発明によれば、データを格納済みのデータ領域に対してデータを上書きした場合であってもデータの上書きが原因のECCエラーの発生を防止することができるという効果を奏する。 According to the present invention, even when the data is overwritten on the data area in which the data is stored, it is possible to prevent the occurrence of an ECC error due to the overwriting of the data.

実施の形態1にかかるデータ記録装置の構成を示す図The figure which shows the structure of the data recording apparatus which concerns on Embodiment 1. 実施の形態1にかかるデータ記録装置が備える不揮発性メモリの構成を示す図The figure which shows the structure of the non-volatile memory provided in the data recording apparatus which concerns on Embodiment 1. 実施の形態1にかかるデータ記録装置による符号化処理の例を説明するための図The figure for demonstrating the example of the coding process by the data recording apparatus which concerns on Embodiment 1. 実施の形態1にかかるデータ記録装置のハードウェア構成例を示す図The figure which shows the hardware configuration example of the data recording apparatus which concerns on Embodiment 1.

以下に、本発明にかかるデータ記録装置の実施の形態を図面に基づいて詳細に説明する。なお、これらの実施の形態によりこの発明が限定されるものではない。 Hereinafter, embodiments of the data recording apparatus according to the present invention will be described in detail with reference to the drawings. The present invention is not limited to these embodiments.

実施の形態1.
図1は、実施の形態1にかかるデータ記録装置の構成を示す図である。データ記録装置100は、通信装置などのホスト装置と通信線で接続される装置であり、ホスト装置の外部記憶装置として機能する。なお、データ記録装置100は、外部記憶装置として用いられる場合に限らず、何れの装置として用いられてもよい。データ記録装置100は、例えば、自らが生成したデータを記録(記憶)してもよいし、自らの動作に必要なデータを記録してもよい。
Embodiment 1.
FIG. 1 is a diagram showing a configuration of a data recording device according to the first embodiment. The data recording device 100 is a device connected to a host device such as a communication device by a communication line, and functions as an external storage device of the host device. The data recording device 100 is not limited to the case where it is used as an external storage device, and may be used as any device. For example, the data recording device 100 may record (store) the data generated by itself, or may record the data necessary for its own operation.

データ記録装置100は、制御部1と不揮発性メモリ2とを備えている。不揮発性メモリ2は種々のデータを記録し、制御部1は、不揮発性メモリ2を制御する。不揮発性メモリ2は、データ(実データ)を格納するデータ領域と、データ領域内のデータのECC値を格納するスペア領域とを有している。不揮発性メモリ2の例は、NAND型のフラッシュメモリである。 The data recording device 100 includes a control unit 1 and a non-volatile memory 2. The non-volatile memory 2 records various data, and the control unit 1 controls the non-volatile memory 2. The non-volatile memory 2 has a data area for storing data (actual data) and a spare area for storing the ECC value of the data in the data area. An example of the non-volatile memory 2 is a NAND flash memory.

制御部1は、不揮発性メモリ2に対し、データの読み出し、データの書き込み、データの消去等を制御する。具体的な制御方法の詳細は、本実施の形態の本質ではないので省略する。 The control unit 1 controls the non-volatile memory 2 to read data, write data, erase data, and the like. The details of the specific control method are omitted because they are not the essence of the present embodiment.

制御部1は、データに対して種々の計算を行う計算機として動作する。制御部1は、不揮発性メモリ2に格納するデータを符号化する符号化部11と、不揮発性メモリ2に格納されているデータを復号する復号化部12と含んで構成されている。 The control unit 1 operates as a computer that performs various calculations on the data. The control unit 1 includes a coding unit 11 that encodes the data stored in the non-volatile memory 2 and a decoding unit 12 that decodes the data stored in the non-volatile memory 2.

本実施の形態の符号化部11は、データ領域内のデータのECC値が全て「1」となるようにデータを符号化する。すなわち、符号化部11は、符号化後のデータのECC値が全て「1」となるようにデータを符号化する。復号化部12は、符号化されてデータ領域に格納されているデータを元の値に復号する。なお、制御部1は、符号化部11、復号化部12以外の構成要素を有していてもよい。 The coding unit 11 of the present embodiment encodes the data so that the ECC values of the data in the data area are all "1". That is, the coding unit 11 encodes the data so that the ECC values of the coded data are all "1". The decoding unit 12 decodes the encoded data stored in the data area to the original value. The control unit 1 may have components other than the coding unit 11 and the decoding unit 12.

図2は、実施の形態1にかかるデータ記録装置が備える不揮発性メモリの構成を示す図である。不揮発性メモリ2は、データ消去の単位であるブロックを複数備えている。図2では、ブロックがブロックB0〜BN(Nは自然数)である場合を図示している。各ブロックB0〜BNは、データ書き込みの単位であるページを複数備えている。図2では、ページが、ページP0〜PM(Mは自然数)である場合を図示している。各ページP0〜PMは、データを格納するデータ領域と、スペアデータを格納するスペア領域とを有している。 FIG. 2 is a diagram showing a configuration of a non-volatile memory included in the data recording device according to the first embodiment. The non-volatile memory 2 includes a plurality of blocks which are units for erasing data. FIG. 2 illustrates the case where the blocks are blocks B0 to BN (N is a natural number). Each block B0 to BN includes a plurality of pages which are units for writing data. FIG. 2 illustrates the case where the pages are pages P0 to PM (M is a natural number). Each page P0 to PM has a data area for storing data and a spare area for storing spare data.

なお、以下の説明ではブロックB0〜BNを識別する必要が無い場合には、ブロックをブロックBxという場合がある。また、以下の説明ではページP0〜PMを識別する必要が無い場合には、ページをページPxという場合がある。 In the following description, when it is not necessary to identify blocks B0 to BN, the block may be referred to as block Bx. Further, in the following description, when it is not necessary to identify pages P0 to PM, the page may be referred to as page Px.

スペア領域に格納されるスペアデータの例は、データ領域に格納されるデータ(符号化後のデータ)のECC値である。ブロックBy(yは0からNの何れか)のページPz(zは0からMの何れか)のスペア領域には、ブロックByのページPzのデータ領域に格納されるデータのECC値が格納される。 An example of spare data stored in the spare area is the ECC value of the data (encoded data) stored in the data area. In the spare area of the page Pz (z is any of 0 to M) of the block By (y is any of 0 to N), the ECC value of the data stored in the data area of the page Pz of the block By is stored. To.

次に、データ記録装置100によるデータ記録処理について説明する。制御部1は、不揮発性メモリ2へのデータの書き込みを、ページ単位で行う。制御部1が、データの書き込みを行うと、不揮発性メモリ2の指定されたページPxのデータ領域は、所望のビット(指定されたビット)が「1」から「0」に変化する。制御部1は、このデータの書き込みによってビットを「0」から「1」に変化させることはできない。例えば、データの元の値が「1111」であった場合、制御部1は、データの書き込みによって、「1111」を「1010」に変化させることはできる。制御部1は、更なる書き込みによって「1010」を「1000」に変化させることもできる。しかし、制御部1は、「1010」を「1110」に変化させることはできない。 Next, the data recording process by the data recording device 100 will be described. The control unit 1 writes data to the non-volatile memory 2 on a page-by-page basis. When the control unit 1 writes data, the desired bit (designated bit) changes from "1" to "0" in the data area of the designated page Px of the non-volatile memory 2. The control unit 1 cannot change the bit from "0" to "1" by writing this data. For example, when the original value of the data is "1111", the control unit 1 can change "1111" to "1010" by writing the data. The control unit 1 can also change "1010" to "1000" by further writing. However, the control unit 1 cannot change "1010" to "1110".

制御部1は、指定したページPxのデータ領域にデータを書き込む際には、指定したページPxのスペア領域に、データ領域のデータに対応するECC値を格納する。スペア領域のビットも、データ領域のビットと同様に、書き込み動作によって変化できるのは「1」から「0」であり、「0」から「1」へは変化できない。例えば、データ領域へのデータの書き込みによって、データ領域のデータのECC値が「1010」となった場合、この「1010」がスペア領域に格納される。データ領域への更なるデータの書き込みによって、データ領域のデータのECC値が「1110」に変化した場合、既にスペア領域に格納されているECC値が「1010」であるため、新しいECC値である「1110」をスペア領域に格納することはできない。 When the control unit 1 writes data to the data area of the designated page Px, the control unit 1 stores the ECC value corresponding to the data in the data area in the spare area of the designated page Px. Like the bits in the data area, the bits in the spare area can be changed from "1" to "0" by the writing operation, and cannot be changed from "0" to "1". For example, when the ECC value of the data in the data area becomes "1010" by writing the data to the data area, this "1010" is stored in the spare area. When the ECC value of the data in the data area changes to "1110" due to further writing of data to the data area, the ECC value already stored in the spare area is "1010", which is a new ECC value. "1110" cannot be stored in the spare area.

不揮発性メモリ2内のビットを「0」から「1」に変化させるにはデータの消去が必要となる。制御部1によるデータの消去は、ブロック単位で行われる。制御部1によるデータの消去によって、不揮発性メモリ2の指定されたブロックBxに含まれる全てのページP0〜PMのデータ領域およびスペア領域において、全てのビットが「1」になる。制御部1は、あるページPxのビットだけを「0」から「1」に変化させたい場合であっても、このページPxが含まれるブロックBxの全体のデータを消去する必要があり、このブロックBxに含まれる他のページの全てのビットを「1」に変化させることとなる。 It is necessary to erase the data in order to change the bit in the non-volatile memory 2 from "0" to "1". Data is erased by the control unit 1 in block units. By erasing the data by the control unit 1, all the bits become "1" in the data area and the spare area of all pages P0 to PM included in the designated block Bx of the non-volatile memory 2. Even if the control unit 1 wants to change only the bit of a certain page Px from "0" to "1", it is necessary to erase the entire data of the block Bx including this page Px, and this block All the bits of other pages included in Bx will be changed to "1".

このように、スペア領域に格納されるECC値が「0」を含む場合、データ領域へのデータの上書きが困難となる。このため、本実施の形態では、制御部1が、データ領域のデータのECC値が常に全て「1」となるよう、データ領域に書き込むデータを符号化する。 As described above, when the ECC value stored in the spare area includes "0", it becomes difficult to overwrite the data in the data area. Therefore, in the present embodiment, the control unit 1 encodes the data to be written in the data area so that the ECC values of the data in the data area are always "1".

制御部1は、データ領域に格納されているデータのECC値が全て「1」となるようデータが符号化されているので、データ領域に格納されているデータを上書きした場合であってもデータ領域のデータのECC値は全て「1」のままである。このため、制御部1は、スペア領域のECC値を消去せずにデータ領域のデータを上書きしても、データ領域のデータのECC値と、スペア領域のECC値とを同じに保つことができる。したがって、制御部1は、データの消去を行うことなくデータ領域のデータを上書きすることができる。 Since the control unit 1 encodes the data so that all the ECC values of the data stored in the data area are "1", the data is overwritten even when the data stored in the data area is overwritten. All ECC values of the region data remain "1". Therefore, even if the control unit 1 overwrites the data in the data area without erasing the ECC value in the spare area, the ECC value of the data in the data area and the ECC value in the spare area can be kept the same. .. Therefore, the control unit 1 can overwrite the data in the data area without erasing the data.

制御部1は、データの上書きを行いたい場合には、符号化部11にデータを符号化させる。制御部1は、書き込むデータを符号化部11に符号化させた後、符号化させたデータを不揮発性メモリ2に書き込む。 When the control unit 1 wants to overwrite the data, the control unit 1 causes the coding unit 11 to encode the data. The control unit 1 encodes the data to be written in the coding unit 11 and then writes the encoded data in the non-volatile memory 2.

制御部1は、データを書き込んだページPxからデータを読み出す際には、復号化部12にデータを復号させる。制御部1は、不揮発性メモリ2から読み出したデータを復号化部12に復号させることによって、不揮発性メモリ2から読み出したデータを元のデータに戻す。 When the control unit 1 reads the data from the page Px in which the data is written, the control unit 1 causes the decoding unit 12 to decode the data. The control unit 1 restores the data read from the non-volatile memory 2 to the original data by causing the decoding unit 12 to decode the data read from the non-volatile memory 2.

このように、本実施の形態の符号化部11は、データ領域のECC値が常に全て「1」となるよう、データ領域に書き込むデータを符号化する。以下、8ビットのデータに対して6ビットのECC値が用いられる場合を例として、符号化の処理を説明する。 As described above, the coding unit 11 of the present embodiment encodes the data to be written in the data area so that the ECC values of the data area are always "1". Hereinafter, the coding process will be described by taking the case where a 6-bit ECC value is used for 8-bit data as an example.

6ビットのECC値が全て「1」となる8ビットのデータには、例えば以下のデータがある。符号化部11は、データ領域に格納するデータを、以下のようなデータに符号化する。
「00000000」
「00001111」
「00110011」
「00111100」
「01010101」
「01011010」
「01100110」
「01101001」
「10010110」
「10011001」
「10100101」
「10101010」
「11000011」
「11001100」
「11110000」
「11111111」
The 8-bit data in which all 6-bit ECC values are "1" includes, for example, the following data. The coding unit 11 encodes the data stored in the data area into the following data.
"00000000"
"00001111"
"00110011"
"00111100"
"01010101"
"01011010"
"01100110"
"01101001"
"10010110"
"101001"
"10100101"
"10101010"
"11000011"
"11001100"
"11110,000"
"11111111"

例えば、データ記録装置100は、元のデータ(符号化前のデータ)と符号化後のデータとの対応関係を示す対応表を格納しておく。この場合、符号化部11は、対応表を参照することで元のデータから符号化後のデータを生成する。また、復号化部12は、対応表を参照することで符号化後のデータから元のデータを生成(復号)する。 For example, the data recording device 100 stores a correspondence table showing the correspondence between the original data (data before coding) and the data after coding. In this case, the coding unit 11 generates the coded data from the original data by referring to the correspondence table. Further, the decoding unit 12 generates (decodes) the original data from the encoded data by referring to the correspondence table.

また、符号化部11は、符号化後のデータの一部に、元のデータが含まれるように、データを符号化してもよい。すなわち、符号化部11は、符号化前の特定ビット(第1の位置のビット)の値と、符号化後の特定ビット(第2の位置のビット)の値と、が一致するよう、データを符号化してもよい。 Further, the coding unit 11 may encode the data so that the original data is included in a part of the coded data. That is, the coding unit 11 performs data so that the value of the specific bit (bit at the first position) before coding and the value of the specific bit (bit at the second position) after coding match. May be encoded.

図3は、実施の形態1にかかるデータ記録装置による符号化処理の例を説明するための図である。図3では、元のデータと、符号化後のデータとの対応関係を示している。ここでは、元のデータを3ビット長とし、符号化後のデータを8ビット長とした場合に、6ビットのECC値が全て「1」となる8ビットのデータのうち、下位3ビットが元のデータと一致するデータの例を示している。 FIG. 3 is a diagram for explaining an example of coding processing by the data recording apparatus according to the first embodiment. FIG. 3 shows the correspondence between the original data and the encoded data. Here, when the original data has a 3-bit length and the encoded data has an 8-bit length, the lower 3 bits of the 8-bit data in which all 6-bit ECC values are "1" are the original. An example of data that matches the data in is shown.

例えば、元のデータが「111」である場合、6ビットのECC値が全て「1」となり、且つ下位3ビットが元のデータである「111」と一致するデータは、「00001111」または「11111111」である。したがって、符号化部11は、元のデータである「111」に対しては、符号化後のデータである「00001111」または「11111111」を適用する。 For example, when the original data is "111", the data in which all 6-bit ECC values are "1" and the lower 3 bits match "111" which is the original data is "000011111" or "111111111". ". Therefore, the coding unit 11 applies the coded data “000011111” or “11111111” to the original data “111”.

符号化部11が、図3に示す対応関係に基づいて元のデータを符号化した場合、復号化部12は、符号化後のデータの一部を抜き出すだけで、元のデータを生成することができる。すなわち、復号化部12は、符号化後のデータの下位3ビットの値(第2の位置のビットの値)をそのまま抽出することで、復号を行うことができる。 When the coding unit 11 encodes the original data based on the correspondence shown in FIG. 3, the decoding unit 12 generates the original data only by extracting a part of the coded data. Can be done. That is, the decoding unit 12 can perform decoding by extracting the value of the lower 3 bits (the value of the bit at the second position) of the encoded data as it is.

例えば、符号化後のデータが「00001111」である場合、復号化部12は、「00001111」の下位3ビットのデータである「111」を復号後のデータとして抽出する。 For example, when the encoded data is "000011111", the decoding unit 12 extracts "111", which is the data of the lower 3 bits of "000011111", as the decrypted data.

また、符号化部11は、特定の計算処理によって、符号化後のデータを生成してもよい。この場合、符号化部11は、例えば、元のデータに偶数パリティを付与し、偶数パリティを付与したデータの値を、そのまま又は反転したうえで、偶数パリティを付与したデータに付与することで、符号化後のデータを生成できる。図3に示した例では、元のデータ「001」は、偶数パリティを付与すると「1001」となる。符号化部11は、このデータをそのまま「1001」に付与すると「10011001」を生成することができ、反転して付与すると「01101001」を生成することができる。 Further, the coding unit 11 may generate the coded data by a specific calculation process. In this case, for example, the coding unit 11 imparts even parity to the original data, and assigns the value of the data to which even parity has been added to the data to which even parity has been added, as it is or after inverting it. Encoded data can be generated. In the example shown in FIG. 3, the original data "001" becomes "1001" when even parity is added. The coding unit 11 can generate "1011001" by adding this data to "1001" as it is, and can generate "01101001" by inverting and adding this data.

なお、図3では、元のデータが3ビット長であり、符号化後のデータが8ビット長である場合について説明したが、データのビット長は、何れの長さであってもよい。元のデータを4ビット長とした場合、符号化部11は、例えば、4ビットのデータを、上位1ビットと下位3ビットとに分割する。符号化部11は、下位3ビットに対して偶数パリティを付与した後、上位1ビットが「0」であるか「1」であるかによって、偶数パリティを付与したデータをそのまま付与するか、反転して付与するかを決定する。符号化部11は、例えば、上位1ビットが「0」である場合に、偶数パリティを付与したデータを、偶数パリティを付与したデータにそのまま付与することで、符号化後のデータを生成する。なお、符号化部11は、偶数パリティの代わりに奇数パリティを付与してもよい。 Although the case where the original data has a 3-bit length and the encoded data has an 8-bit length has been described with reference to FIG. 3, the bit length of the data may be any length. When the original data has a length of 4 bits, the encoding unit 11 divides the 4-bit data into, for example, the upper 1 bit and the lower 3 bits. After imparting even parity to the lower 3 bits, the encoding unit 11 assigns the data to which the even parity is added as it is or inverts it depending on whether the upper 1 bit is "0" or "1". To decide whether to grant. For example, when the upper 1 bit is "0", the coding unit 11 generates the coded data by directly adding the data to which the even parity is added to the data to which the even parity is given. Note that the coding unit 11 may provide odd parity instead of even parity.

また、元のデータを5ビット長とした場合、符号化部11は、例えば、5ビットのデータを、上位2ビットと下位3ビットとに分割する。符号化部11は、下位3ビットに対して8ビット長の符号化後のデータを生成し、上位2ビットについては3ビット長に拡張してから8ビット長の符号化後のデータを生成する。 Further, when the original data has a length of 5 bits, the encoding unit 11 divides, for example, the 5-bit data into upper 2 bits and lower 3 bits. The coding unit 11 generates 8-bit length encoded data for the lower 3 bits, expands the upper 2 bits to 3 bit length, and then generates 8-bit length encoded data. ..

元のデータを6ビット長以上とした場合も、符号化部11は、元のデータを4ビット長または5ビット長とした場合と同様の符号化を行う。すなわち、符号化部11は、元のデータが6ビット長以上の場合、元のデータを下位ビットから3ビットずつに分割する。符号化部11は、3ビットのデータに対しては、8ビット長の符号化後のデータを生成する。符号化部11は、上位に残ったビットが1ビットである場合は、元のデータが4ビットである場合の上位1ビットと同様の処理を行い、上位に残ったビットが2ビットである場合は、元のデータが5ビットである場合の上位2ビットと同様の処理を行う。 Even when the original data has a length of 6 bits or more, the coding unit 11 performs the same coding as when the original data has a length of 4 bits or 5 bits. That is, when the original data has a length of 6 bits or more, the coding unit 11 divides the original data into 3 bits from the lower bits. The coding unit 11 generates 8-bit length encoded data for 3-bit data. When the upper remaining bit is 1 bit, the coding unit 11 performs the same processing as the upper 1 bit when the original data is 4 bits, and when the upper remaining bit is 2 bits. Performs the same processing as the upper 2 bits when the original data is 5 bits.

なお、上述した符号化部11による符号化処理は、一例であり、符号化部11は、上述した符号化処理以外の符号化処理によって、データ領域のデータのECC値が全て「1」となるよう元のデータを符号化してもよい。 The coding process by the coding unit 11 described above is an example, and the coding unit 11 sets all the ECC values of the data in the data area to "1" by the coding process other than the coding process described above. The original data may be encoded.

このように、制御部1は、符号化部11に符号化させることによって、データ領域に格納するデータのECC値を全て「1」とすることができる。制御部1は、符号化部11が符号化したデータをデータ領域に格納し、全ての値が「1」であるECC値をスペア領域に格納する。制御部1は、このデータ領域に対してさらにデータの書き込みを行う場合(上書きする場合)も、データ領域に格納するデータ(上書き用のデータ)を符号化部11に符号化させる。これにより、制御部1は、データ領域に上書きするデータのECC値を全て「1」とすることができる。この場合のスペア領域に格納されるECC値は、全てが「1」のまま変化しない。このように、符号化部11がデータを符号化することによって、制御部1による不揮発性メモリ2へのデータの上書きが可能となる。なお、制御部1は、データ領域のビットを「0」から「1」に変化させるような上書きはできないので、この場合は、上書きを行わない。 In this way, the control unit 1 can set all the ECC values of the data stored in the data area to "1" by having the coding unit 11 encode the data. The control unit 1 stores the data encoded by the coding unit 11 in the data area, and stores the ECC values in which all the values are "1" in the spare area. The control unit 1 also causes the coding unit 11 to encode the data (data for overwriting) stored in the data area even when further writing data to the data area (overwriting). As a result, the control unit 1 can set all the ECC values of the data to be overwritten in the data area to "1". In this case, all the ECC values stored in the spare area remain "1" and do not change. By encoding the data by the coding unit 11 in this way, the control unit 1 can overwrite the data on the non-volatile memory 2. Note that the control unit 1 cannot overwrite such that the bit of the data area is changed from "0" to "1". Therefore, in this case, the overwriting is not performed.

スペア領域に格納されるECC値が「0」を含む場合にデータ領域のデータが上書きされると、データ領域のデータのECC値とスペア領域のECC値とが異なることとなり、ECCエラーが発生する。本実施の形態では、制御部1が、データ領域のデータのECC値が全て「1」となるよう、データ領域に書き込むデータを符号化するので、データ領域にデータを上書きしてもECC値は全て「1」のままである。したがって、データ領域にデータを上書きした場合であっても、データの上書きが原因のECCエラーの発生を防止できる。 If the data in the data area is overwritten when the ECC value stored in the spare area contains "0", the ECC value of the data in the data area and the ECC value of the spare area will be different, and an ECC error will occur. .. In the present embodiment, the control unit 1 encodes the data to be written in the data area so that the ECC values of the data in the data area are all "1". Therefore, even if the data is overwritten in the data area, the ECC value is the same. All remain "1". Therefore, even when the data is overwritten in the data area, it is possible to prevent the occurrence of an ECC error due to the overwriting of the data.

また、制御部1は、データ領域のデータを上書きできるので、データ領域のデータの消去回数を抑制することができる。したがって、制御部1は、データ領域の劣化を抑制することができる。 Further, since the control unit 1 can overwrite the data in the data area, the number of times of erasing the data in the data area can be suppressed. Therefore, the control unit 1 can suppress the deterioration of the data area.

ここで、データ記録装置100のハードウェア構成について説明する。図4は、実施の形態1にかかるデータ記録装置のハードウェア構成例を示す図である。データ記録装置100を構成する構成要素の一部又は全部の機能は、プロセッサ101およびメモリ102により実現することができる。 Here, the hardware configuration of the data recording device 100 will be described. FIG. 4 is a diagram showing a hardware configuration example of the data recording device according to the first embodiment. Some or all the functions of the components constituting the data recording device 100 can be realized by the processor 101 and the memory 102.

プロセッサ101の例は、CPU(Central Processing Unit、中央処理装置、処理装置、演算装置、マイクロプロセッサ、マイクロコンピュータ、プロセッサ、DSP(Digital Signal Processor)ともいう)またはシステムLSI(Large Scale Integration)である。メモリ102の例は、RAM(Random Access Memory)、ROM(Read Only Memory)、フラッシュメモリである。 An example of the processor 101 is a CPU (Central Processing Unit, central processing unit, processing unit, arithmetic unit, microprocessor, microcomputer, processor, DSP (Digital Signal Processor)) or system LSI (Large Scale Integration). Examples of the memory 102 are a RAM (Random Access Memory), a ROM (Read Only Memory), and a flash memory.

データ記録装置100の一部の機能は、プロセッサ101が、メモリ102で記憶されている、データ記録装置100の動作を実行するためのプログラムを読み出して実行することにより実現される。また、このプログラムは、データ記録装置100の手順または方法をコンピュータに実行させるものであるともいえる。メモリ102は、プロセッサ101が各種処理を実行する際の一時メモリにも使用される。 Some functions of the data recording device 100 are realized by the processor 101 reading and executing a program stored in the memory 102 for executing the operation of the data recording device 100. It can also be said that this program causes a computer to execute the procedure or method of the data recording device 100. The memory 102 is also used as a temporary memory when the processor 101 executes various processes.

なお、データ記録装置100の機能について、一部を専用のハードウェアで実現し、一部をソフトウェアまたはファームウェアで実現するようにしてもよい。すなわち、データ記録装置100の一部の機能を図4に示したプロセッサ101およびメモリ102で実現し、残りの機能を専用の処理回路で実現するようにしてもよい。 It should be noted that some of the functions of the data recording device 100 may be realized by dedicated hardware, and some may be realized by software or firmware. That is, a part of the functions of the data recording device 100 may be realized by the processor 101 and the memory 102 shown in FIG. 4, and the remaining functions may be realized by a dedicated processing circuit.

このように実施の形態1によれば、符号化部11が、データ領域内のデータのECC値が全て「1」となるようにデータを符号化するので、データを格納済みのデータ領域に対してデータを上書きした場合であってもデータの上書きが原因のECCエラーの発生を防止することができる。 As described above, according to the first embodiment, since the coding unit 11 encodes the data so that the ECC values of the data in the data area are all "1", the data is stored in the data area. Even when the data is overwritten, it is possible to prevent the occurrence of an ECC error due to the overwriting of the data.

実施の形態2.
つぎに、この発明の実施の形態2について説明する。実施の形態2では、データ記録装置100が、データ領域に格納されるデータを管理するための管理情報を、符号化部11に符号化させた後に、特定のデータ領域に格納する。データ記録装置100は、データ領域内で管理情報を上書きする。
Embodiment 2.
Next, a second embodiment of the present invention will be described. In the second embodiment, the data recording device 100 encodes the management information for managing the data stored in the data area by the coding unit 11 and then stores the management information in the specific data area. The data recording device 100 overwrites the management information in the data area.

データ領域に格納されるデータを管理するための管理情報は、例えば、データ領域が未使用か否かを示す情報、データ領域が不良ブロックであるか否かを示す情報、データ領域の論理アドレス、データ領域のセクタ番号などである。 The management information for managing the data stored in the data area includes, for example, information indicating whether the data area is unused, information indicating whether the data area is a bad block, a logical address of the data area, and the like. Such as the sector number of the data area.

制御部1は、管理情報をページPx毎に管理する。すなわち、データ領域に格納される管理情報は、各ページPxの管理情報を含んでいる。制御部1は、ページPxが未使用である場合は、このページPxの管理情報を示すビットの全てを「1」にする。また、制御部1は、ページPxに意味のあるデータが格納されている場合には、このページPxの管理情報に、格納されているデータを特定するためのID(Identification)番号を設定する。ID番号の例は、論理アドレス、セクタ番号である。また、制御部1は、ページPxのデータが使用済みとなり、ページPxのデータを消去可能な場合は、このページPxの管理情報を示すビットの全てを「0」にする。 The control unit 1 manages management information for each page Px. That is, the management information stored in the data area includes the management information of each page Px. When the page Px is unused, the control unit 1 sets all the bits indicating the management information of the page Px to "1". Further, when the page Px stores meaningful data, the control unit 1 sets an ID (Identification) number for identifying the stored data in the management information of the page Px. Examples of ID numbers are logical addresses and sector numbers. Further, when the data of the page Px is used up and the data of the page Px can be erased, the control unit 1 sets all the bits indicating the management information of the page Px to "0".

制御部1は、例えば、各ブロックBxのページP0のデータ領域に、ブロックBx内の他のページの管理情報を格納する。不揮発性メモリ2の初期状態は、全てのページP0〜PMが未使用であるので、各ページの管理情報は全て「1」である。 The control unit 1 stores, for example, the management information of other pages in the block Bx in the data area of the page P0 of each block Bx. In the initial state of the non-volatile memory 2, since all pages P0 to PM are unused, the management information of each page is all "1".

例えば、ページP1にID番号=3のデータが書き込まれる場合、ページP1の管理情報はID番号=3となる。したがって、制御部1は、このID番号=3を、符号化部11に符号化させ、ページP0のデータ領域に格納されている管理情報に上書きする。このとき、符号化部11は、ECC値が全て「1」となるようID番号=3を符号化する。したがって、スペア領域に格納されているECC値は全て「1」のまま変化しない。 For example, when the data of ID number = 3 is written on page P1, the management information of page P1 is ID number = 3. Therefore, the control unit 1 encodes the ID number = 3 in the coding unit 11 and overwrites the management information stored in the data area on page P0. At this time, the coding unit 11 encodes the ID number = 3 so that all the ECC values are "1". Therefore, all the ECC values stored in the spare area remain "1" and do not change.

続いて、ページP2にID番号=5のデータが書き込まれる場合、ページP2の管理情報はID番号=5となる。したがって、制御部1は、このID番号=5を、符号化部11に符号化させ、ページP0のデータ領域に格納されている管理情報に上書きする。この上書きでも、符号化部11は、ECC値が全て「1」となるようID番号=5を符号化する。したがって、スペア領域に格納されているECC値は全て「1」のまま変化しない。 Subsequently, when the data of the ID number = 5 is written on the page P2, the management information of the page P2 becomes the ID number = 5. Therefore, the control unit 1 encodes the ID number = 5 in the coding unit 11 and overwrites the management information stored in the data area on page P0. Even in this overwriting, the encoding unit 11 encodes the ID number = 5 so that all the ECC values are "1". Therefore, all the ECC values stored in the spare area remain "1" and do not change.

その後、ページP1に格納されているID番号=3のデータが不要となった場合、ページP1の管理情報は、使用済みを示す情報(全て「0」)となる。したがって、制御部1は、ページP1の管理情報のデータ(全て「0」)を、符号化部11に符号化させ、ページP1のデータ領域に格納されている管理情報に上書きする。この上書きでも、符号化部11は、ECC値が全て「1」となるようデータを符号化する。したがって、スペア領域に格納されているECC値は全て「1」のまま変化しない。 After that, when the data of the ID number = 3 stored in the page P1 becomes unnecessary, the management information of the page P1 becomes the information indicating used (all "0"). Therefore, the control unit 1 encodes the data of the management information on the page P1 (all "0") by the coding unit 11 and overwrites the management information stored in the data area of the page P1. Even with this overwriting, the encoding unit 11 encodes the data so that all the ECC values are "1". Therefore, all the ECC values stored in the spare area remain "1" and do not change.

このように、ページP0に格納された管理情報は、未使用の状態から最終的に使用済みとなるまで、消去されることなく、上書きすることができる。 In this way, the management information stored on page P0 can be overwritten without being erased from the unused state until it is finally used.

なお、ページP0に格納される管理情報以外のデータ、すなわちページP0以外の他のページに格納される意味のあるデータは、実施の形態1の方法によって上書きされてもよいし、上書きされなくてもよい。制御部1は、ページP0以外のページにおいてデータを上書きしない場合、符号化部11に符号化させる必要はない。この場合、制御部1は、元のデータをそのままデータ領域に書き込めばよい。また、制御部1は、元のデータを一般的な符号化処理によって符号化してからデータ領域に書き込んでもよい。 The data other than the management information stored on the page P0, that is, the meaningful data stored on the page other than the page P0 may or may not be overwritten by the method of the first embodiment. May be good. When the control unit 1 does not overwrite the data on a page other than the page P0, the control unit 1 does not need to be encoded by the coding unit 11. In this case, the control unit 1 may write the original data as it is in the data area. Further, the control unit 1 may encode the original data by a general coding process and then write it to the data area.

本実施の形態では、各ブロックBxのページP0に、自らのブロックBx内のページP0以外の他のページの管理情報を格納する場合について説明したが、制御部1は、ページP0以外の他の領域に管理情報を格納してもよい。制御部1は、例えば、ページP1に管理情報を格納してもよいし、ページP0,P1以外の別のページに管理情報を格納してもよい。また、ブロックB0の各ページに、他のブロックの各ページの管理情報を格納してもよい。 In the present embodiment, the case where the management information of the page other than the page P0 in the own block Bx is stored in the page P0 of each block Bx has been described, but the control unit 1 has described the case where the page P0 other than the page P0 is stored. Management information may be stored in the area. The control unit 1 may store the management information on the page P1 or may store the management information on a page other than the pages P0 and P1. Further, the management information of each page of another block may be stored in each page of the block B0.

仮に、各ページの管理情報が、ページ毎のスペア領域に格納される場合、各スペア領域から管理情報が読み出される必要があるので、全ての管理情報を読み出すのに長時間を要する。一方、制御部1は、管理情報を特定の領域にまとめて格納している。これにより、制御部1は、管理情報を短時間で読み出すことできる。 If the management information of each page is stored in the spare area for each page, it takes a long time to read all the management information because the management information needs to be read from each spare area. On the other hand, the control unit 1 collectively stores the management information in a specific area. As a result, the control unit 1 can read the management information in a short time.

また、管理情報が特定のデータ領域にまとめて格納される場合であっても、管理情報が上書きのできない態様でデータ領域に格納されると、管理情報が更新されるたびに、データ領域の管理情報が消去されて、新しい管理情報が書き込まれることとなる。この場合、管理情報を格納するデータ領域の劣化が早められてしまう。一方、本実施の形態の制御部1は、管理情報のECC値が全て「1」となるよう、符号化部11に管理情報を符号化させている。これにより、制御部1は、管理情報を格納するデータ領域の消去回数を抑制することができるので、データ領域の劣化を抑制することができる。 Further, even when the management information is collectively stored in a specific data area, if the management information is stored in the data area in a manner that cannot be overwritten, the data area is managed every time the management information is updated. The information will be erased and new management information will be written. In this case, the deterioration of the data area for storing the management information is accelerated. On the other hand, the control unit 1 of the present embodiment has the coding unit 11 encode the management information so that the ECC values of the management information are all "1". As a result, the control unit 1 can suppress the number of times of erasing the data area for storing the management information, so that the deterioration of the data area can be suppressed.

このように、実施の形態2によれば、制御部1が、データ領域のうちの特定のデータ領域に、管理情報をまとめて格納するので、データ領域の劣化を抑制することが可能となる。 As described above, according to the second embodiment, since the control unit 1 collectively stores the management information in the specific data area of the data area, it is possible to suppress the deterioration of the data area.

以上の実施の形態に示した構成は、本発明の内容の一例を示すものであり、別の公知の技術と組み合わせることも可能であるし、本発明の要旨を逸脱しない範囲で、構成の一部を省略、変更することも可能である。 The configuration shown in the above-described embodiment shows an example of the content of the present invention, can be combined with another known technique, and is one of the configurations without departing from the gist of the present invention. It is also possible to omit or change the part.

1 制御部、2 不揮発性メモリ、11 符号化部、12 復号化部、100 データ記録装置、101 プロセッサ、102 メモリ。 1 control unit, 2 non-volatile memory, 11 coding unit, 12 decoding unit, 100 data recording device, 101 processor, 102 memory.

Claims (6)

データを記録する不揮発性メモリと、
前記不揮発性メモリへのデータの書き込みおよび消去を制御する制御部と、
を備え、
前記不揮発性メモリは、前記データを格納するデータ領域と、
前記データの誤り訂正符号値を格納するスペア領域と、
を有し、
前記制御部は、
前記データ領域内の前記データの誤り訂正符号値が全て1となるように前記データを符号化する符号化部と、
前記符号化部によって符号化された符号化後のデータを符号化前のデータに復号する復号化部と、
を有する、
ことを特徴とするデータ記録装置。
Non-volatile memory for recording data and
A control unit that controls writing and erasing of data to the non-volatile memory,
With
The non-volatile memory includes a data area for storing the data and
A spare area for storing the error correction code value of the data and
Have,
The control unit
A coding unit that encodes the data so that the error correction code values of the data in the data area are all 1.
A decoding unit that decodes the encoded data encoded by the encoding unit into unencoded data, and a decoding unit.
Have,
A data recording device characterized in that.
前記符号化部は、符号化前のデータと符号化後のデータとの対応関係を示す対応表に基づいて、前記データを符号化し、
前記復号化部は、前記対応表に基づいて、前記符号化後のデータを復号する、
ことを特徴とする請求項1に記載のデータ記録装置。
The coding unit encodes the data based on a correspondence table showing the correspondence between the data before coding and the data after coding.
The decoding unit decodes the coded data based on the correspondence table.
The data recording device according to claim 1.
前記符号化部は、前記符号化前のデータに含まれる第1の位置のビットの値と、前記符号化後のデータに含まれる第2の位置のビットの値と、が一致するよう、前記データを符号化し、
前記復号化部は、前記符号化後のデータから前記第2の位置のビットの値を抽出することによって、前記符号化後のデータを復号する、
ことを特徴とする請求項1または2に記載のデータ記録装置。
The coding unit is described so that the value of the bit at the first position included in the data before coding and the value of the bit at the second position included in the data after coding match. Encode the data
The decoding unit decodes the coded data by extracting the value of the bit at the second position from the coded data.
The data recording device according to claim 1 or 2.
前記符号化部は、計算処理によって前記データを符号化する、
ことを特徴とする請求項1または2に記載のデータ記録装置。
The coding unit encodes the data by a calculation process.
The data recording device according to claim 1 or 2.
前記符号化部は、前記符号化前のデータにパリティを付与し、前記パリティを付与したデータまたは前記パリティを付与したデータを反転したデータを、前記パリティを付与したデータに付与することによって、前記データを符号化する、
ことを特徴とする請求項4に記載のデータ記録装置。
The coding unit imparts parity to the unencoded data, and by imparting the data to which the parity is given or the data obtained by inverting the data to which the parity is given to the data to which the parity is given. Encode the data,
The data recording device according to claim 4.
前記符号化部が符号化するデータは、前記データ領域に格納されるデータをページ毎に管理するための管理情報であり、
前記制御部は、前記データ領域のうちの特定のデータ領域に、前記ページ毎の前記管理情報をまとめて格納する、
ことを特徴とする請求項1から5の何れか1つに記載のデータ記録装置。
The data encoded by the coding unit is management information for managing the data stored in the data area for each page.
The control unit collectively stores the management information for each page in a specific data area of the data area.
The data recording device according to any one of claims 1 to 5, wherein the data recording device is characterized.
JP2019100474A 2019-05-29 2019-05-29 Data recording device Pending JP2020194428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019100474A JP2020194428A (en) 2019-05-29 2019-05-29 Data recording device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019100474A JP2020194428A (en) 2019-05-29 2019-05-29 Data recording device

Publications (1)

Publication Number Publication Date
JP2020194428A true JP2020194428A (en) 2020-12-03

Family

ID=73546382

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019100474A Pending JP2020194428A (en) 2019-05-29 2019-05-29 Data recording device

Country Status (1)

Country Link
JP (1) JP2020194428A (en)

Similar Documents

Publication Publication Date Title
US10540276B2 (en) Method of processing data based on erase operations of logical pages related to data compression rate of mapping table in data storage device
JP4740216B2 (en) Nonvolatile memory management method and apparatus
US8055983B2 (en) Data writing method for flash memory and error correction encoding/decoding method thereof
US7725646B2 (en) Method of using a flash memory for a circular buffer
US8463985B2 (en) Constrained coding to reduce floating gate coupling in non-volatile memories
US20120144249A1 (en) Program Disturb Error Logging and Correction for Flash Memory
TWI633428B (en) Data storage device and methods for processing data in the data storage device
JP2012118979A (en) System, method, and computer program for probabilistic multilayer error correction of nand flash memory
TW201521032A (en) Error correction code unit, self-test method and associated controller applied to flash memory device
US20160283319A1 (en) Data storage device and encoding method thereof
US20150089124A1 (en) Data accessing method for flash memory storage device having data perturbation module, and storage system and controller using the same
JP2019192316A (en) Nonvolatile storage device, memory control device, and memory control method
US11176033B2 (en) Data storage devices and data processing methods
JP2015225661A (en) Marker programming in non-volatile memories
US10574270B1 (en) Sector management in drives having multiple modulation coding
JP2009064238A (en) Memory system
JP6975047B2 (en) Write-once memory code error correction code management
CN109215726B (en) Memory test method and memory device thereof
JP2006221334A (en) Memory controller, flash memory system, and control method for flash memory
JP5335779B2 (en) Semiconductor recording device
JP2020194428A (en) Data recording device
JP2012068765A (en) Memory controller, flash memory system with memory controller, and control method of flash memory
US10546640B2 (en) Data protecting method and memory storage device
JP2020154728A (en) Memory system and its control method
JP2020042326A (en) Memory controller apparatus, memory apparatus having memory controller apparatus, and control method