JP2008158908A - Memory controller, flash memory system, and control method of flash memory - Google Patents

Memory controller, flash memory system, and control method of flash memory Download PDF

Info

Publication number
JP2008158908A
JP2008158908A JP2006348664A JP2006348664A JP2008158908A JP 2008158908 A JP2008158908 A JP 2008158908A JP 2006348664 A JP2006348664 A JP 2006348664A JP 2006348664 A JP2006348664 A JP 2006348664A JP 2008158908 A JP2008158908 A JP 2008158908A
Authority
JP
Japan
Prior art keywords
data
flash memory
page
correction
read
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.)
Granted
Application number
JP2006348664A
Other languages
Japanese (ja)
Other versions
JP4655034B2 (en
Inventor
Takeshi Kamono
武志 鴨野
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.)
TDK Corp
Original Assignee
TDK 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 TDK Corp filed Critical TDK Corp
Priority to JP2006348664A priority Critical patent/JP4655034B2/en
Publication of JP2008158908A publication Critical patent/JP2008158908A/en
Application granted granted Critical
Publication of JP4655034B2 publication Critical patent/JP4655034B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To efficiently correct errors of storage data and restore the corrected data in a flash memory. <P>SOLUTION: Data read from a memory cell array 21 is held in a page register 22. The held data is read by the flash memory controller 3, and inputted to an ECC block 11 within the memory controller 3. The ECC block 11 determines correction data and a column address corresponding to the correction data based on the input data, and accumulates them in a correction register within the controller 3. The correction data accumulated in the correction register is transferred to the page register 22 (the transfer destination of the correction data is specified by the column address accumulated in the correction register) to correct errors contained in the data retained in the page register 22. The corrected data retained in the page register 22 is written to the memory cell array 21. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、メモリコントローラ、当該メモリコントローラを備えるフラッシュメモリシステム及びフラッシュメモリの制御方法に関する。   The present invention relates to a memory controller, a flash memory system including the memory controller, and a flash memory control method.

近年、不揮発性の記憶媒体であるフラッシュメモリの開発が盛んに行われ、デジタルカメラ等の情報機器(ホストシステム)の記憶媒体として普及している。そして、このような情報機器が扱うデータが大容量化したことに伴い、フラッシュメモリの記憶容量も大容量化が進んでいる。そのため、集積度に優れ、大容量化が容易なNAND型フラッシュメモリが注目されている。   In recent years, flash memory, which is a non-volatile storage medium, has been actively developed, and is widely used as a storage medium for information devices (host systems) such as digital cameras. As the data handled by such information devices has increased in capacity, the storage capacity of the flash memory has been increased. For this reason, attention has been focused on NAND flash memories that have a high degree of integration and are easy to increase in capacity.

フラッシュメモリは、メモリセルを消去状態(論理値=1)から書込状態(論理値=0)に変化させる場合には、メモリセル単位で行うことができる。しかし、メモリセルを書込状態(論理値=0)から消去状態(論理値=1)に変化させる場合には、複数のメモリセルからなる所定の消去単位(ブロック単位)でしかこれを行うことができない。   The flash memory can be performed in units of memory cells when the memory cells are changed from the erased state (logical value = 1) to the written state (logical value = 0). However, when the memory cell is changed from the write state (logic value = 0) to the erase state (logic value = 1), this is performed only in a predetermined erase unit (block unit) composed of a plurality of memory cells. I can't.

また、NAND型フラッシュメモリにおいては、上記ブロックは複数のページで構成されている。このページは、データの読み出し及び書き込みにおける処理単位であるが、上記特性によりデータの上書きができないため、記憶されているデータを書き換える場合には、書き換えデータを元のブロックとは異なる消去済みのブロックに書き込まなければならない。   In the NAND flash memory, the block is composed of a plurality of pages. This page is a processing unit for reading and writing data. However, because the data cannot be overwritten due to the above characteristics, when rewriting the stored data, the rewritten data is different from the original block. Must be written to.

さらに、フラッシュメモリは、その特性上、あるメモリセルに対する読み出しや書き込みが実行された場合に、そのメモリセルとビット線を共通にする他のメモリセルの状態が変化してしまうことがある。この現象はディスターブ現象と呼ばれ、メモリセルに対して書き込み動作・消去動作が繰り返されることにより発生率が高くなることが知られている。このディスターブ現象によって、一旦書き込まれたデータが変化し、データに誤りが混入してしまう。   Further, due to the characteristics of a flash memory, when reading or writing is performed on a certain memory cell, the state of another memory cell that shares the bit line with that memory cell may change. This phenomenon is called a disturb phenomenon, and it is known that the occurrence rate is increased by repeating the write / erase operations on the memory cells. Due to the disturb phenomenon, the data once written changes, and an error is mixed in the data.

このような場合、誤りが混入したページのデータをフラッシュメモリから読み出し、その誤りを訂正した後に、再度、フラッシュメモリに書き込むことが好ましい。例えば、特許文献1には、フラッシュメモリから読み出したデータに含まれる誤りが検出されたときに、その誤りを訂正したデータを他のブロックに書き込む発明が開示されている。
特開2004−272476号公報
In such a case, it is preferable to read the data of the page in which the error is mixed from the flash memory, correct the error, and then write the data to the flash memory again. For example, Patent Document 1 discloses an invention in which, when an error included in data read from a flash memory is detected, the corrected data is written in another block.
JP 2004-272476 A

しかしながら、特許文献1に記載された処理では、誤りが検出されたページに記憶されているデータをフラッシュメモリから読み出してメモリコントローラ内のバッファに保持し、そのデータに含まれる誤りを訂正した後、訂正したデータをフラッシュメモリに書き込んでいる。つまり、この処理では、1ページ分のデータをフラッシュメモリからメモリコントローラに転送した後、更に、1ページ分のデータをメモリコントローラからフラッシュメモリに転送しなければならない。従って、特許文献1に記載された処理では、訂正済データをフラッシュメモリに保存し直すときの効率が良くなかった。   However, in the process described in Patent Document 1, data stored in a page in which an error is detected is read from the flash memory and held in a buffer in the memory controller, and after correcting the error included in the data, The corrected data is written to the flash memory. That is, in this process, after one page of data is transferred from the flash memory to the memory controller, one page of data must be transferred from the memory controller to the flash memory. Therefore, the process described in Patent Document 1 is not efficient when the corrected data is stored again in the flash memory.

本発明は、上記実状に鑑みてなされたものであり、フラッシュメモリに記憶されているデータの誤りを、効率良く訂正して、フラッシュメモリに保存し直すことができるメモリコントローラ、フラッシュメモリシステム等を提供することを目的とする。   The present invention has been made in view of the above circumstances, and provides a memory controller, a flash memory system, and the like that can efficiently correct an error in data stored in a flash memory and save the data in the flash memory again. The purpose is to provide.

上記目的を達成するため、本発明の第1の観点に係るメモリコントローラは、複数のページで構成されたメモリセルアレイと、該メモリセルアレイに書き込むデータ又は該メモリセルアレイから読み出したデータをページ単位で保持する内部レジスタとを備えるフラッシュメモリに対して、前記メモリセルアレイ内の第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する読み出し指示と、該読み出し指示に基づいて前記内部レジスタに読み出されたデータを前記第1のページとは異なる第2のページに書き込むことを指示する書き込み指示とを与えるデータ複写指示手段と、
前記第1のページに記憶されているデータを、前記フラッシュメモリのデータバスを介して前記フラッシュメモリから読み出す読み出し手段と、
前記読み出し手段により前記フラッシュメモリから読み出された前記第1のページに記憶されているデータに含まれる誤りの訂正値を求める誤り訂正手段と、
前記データバスのバス幅に対応するビット数単位で、前記訂正値を含む訂正データを保持する訂正データ保持手段と、
前記訂正データ保持手段に保持されている前記訂正データを、前記データバスを介して前記フラッシュメモリに転送し、前記内部レジスタに保持されているデータの一部を前記訂正データで置き換えるデータ置換手段と、を備え、
前記データ複写指示手段は、前記第1のページに記憶されているデータに誤りが含まれている場合に、前記第1のページから前記内部レジスタに読み出されたデータの一部が前記訂正データで置き換えられた後に、前記第2のページに書き込むことを指示する書き込み指示を前記フラッシュメモリに与えることを特徴とする。
To achieve the above object, a memory controller according to a first aspect of the present invention holds a memory cell array composed of a plurality of pages and data to be written to or read from the memory cell array in units of pages. A read instruction that instructs the internal register to read data stored in the first page in the memory cell array, and the internal register based on the read instruction A data copy instruction means for giving a write instruction for instructing to write the data read into the second page different from the first page;
Reading means for reading data stored in the first page from the flash memory via the data bus of the flash memory;
Error correction means for obtaining a correction value of an error included in the data stored in the first page read from the flash memory by the reading means;
Correction data holding means for holding correction data including the correction value in units of bits corresponding to the bus width of the data bus;
Data replacement means for transferring the correction data held in the correction data holding means to the flash memory via the data bus and replacing a part of the data held in the internal register with the correction data; With
When the data stored in the first page includes an error, a part of the data read from the first page to the internal register is the correction data After the replacement, the flash memory is provided with a write instruction for instructing to write to the second page.

上記本発明に係るメモリコントローラでは、フラッシュメモリから読み出したデータに含まれる誤りが検出されたときに、その誤り部分を訂正するための訂正データが、フラッシュメモリに対するデータ転送の単位に相当する前記データバスのバス幅に対応するビット数単位で保持される。更に、この訂正データに対応するデータが保持されている内部レジスタにこの訂正データが転送され、内部レジスタに保持されているデータに含まれる誤りが訂正された後に、内部レジスタに保持されているデータがメモリセルアレイに書き込まれる。つまり、上記本発明に係るメモリコントローラでは、フラッシュメモリから読み出したデータに含まれる誤りが検出されたときに、その誤り部分を訂正するための訂正データだけが内部レジスタに転送され、内部レジスタ上で内部レジスタに保持されているデータの誤りの訂正が行われる。   In the memory controller according to the present invention, when an error included in the data read from the flash memory is detected, the correction data for correcting the error portion is the data corresponding to a unit of data transfer to the flash memory. It is held in units of the number of bits corresponding to the bus width of the bus. Further, after the correction data is transferred to the internal register holding the data corresponding to the correction data, and the error included in the data held in the internal register is corrected, the data held in the internal register Are written into the memory cell array. That is, in the memory controller according to the present invention, when an error included in the data read from the flash memory is detected, only the correction data for correcting the error part is transferred to the internal register, and on the internal register. An error in data held in the internal register is corrected.

前記訂正データ保持手段は、前記訂正データで置き換えられるデータの前記内部レジスタ内での位置を示す位置情報を保持し、前記データ置換手段は該位置情報に対応する部分のデータを前記訂正データと置き換えることを特徴とする。   The correction data holding unit holds position information indicating a position in the internal register of data to be replaced with the correction data, and the data replacement unit replaces a portion of data corresponding to the position information with the correction data. It is characterized by that.

上記目的を達成するため、本発明の第2の観点に係るフラッシュメモリシステムは、
上記メモリコントローラと、フラッシュメモリとを備えることを特徴とする。
In order to achieve the above object, a flash memory system according to a second aspect of the present invention provides:
The memory controller and a flash memory are provided.

上記目的を達成するため、本発明の第3の観点に係るフラッシュメモリの制御方法は、
複数のページで構成されたメモリセルアレイと、該メモリセルアレイに書き込むデータ又は該メモリセルアレイから読み出したデータをページ単位で保持する内部レジスタとを備えるフラッシュメモリに対して、前記メモリセルアレイ内の第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する第1のステップと、
前記第1のステップで前記内部レジスタに読み出されたデータを、前記フラッシュメモリのデータバスを介して前記内部レジスタから読み出す第2のステップと、
前記第2のステップで読み出されたデータに含まれる誤りの訂正値を求める第3のステップと、
前記第3のステップで求められた前記訂正値を含む訂正データを、前記データバスのバス幅に対応するビット数単位で保持する第4のステップと、
前記第4のステップで保持された前記訂正データを、前記データバスを介して前記内部レジスタに転送し、前記内部レジスタに保持されているデータの一部を前記訂正データで置き換える第5のステップと、
前記第5のステップで前記内部レジスタに保持されているデータの一部が前記訂正データで置き換えられた後に、前記フラッシュメモリに対して、前記内部レジスタに保持されているデータを前記第1のページとは異なる第2のページに書き込むことを指示する第6のステップと、
を含むことを特徴とする。
In order to achieve the above object, a flash memory control method according to a third aspect of the present invention includes:
For a flash memory comprising a memory cell array composed of a plurality of pages and an internal register for holding data to be written to the memory cell array or data read from the memory cell array in units of pages, the first in the memory cell array A first step for instructing reading of data stored in a page to the internal register;
A second step of reading data read into the internal register in the first step from the internal register via a data bus of the flash memory;
A third step for obtaining a correction value of an error included in the data read in the second step;
A fourth step of holding correction data including the correction value obtained in the third step in units of bits corresponding to the bus width of the data bus;
A fifth step of transferring the correction data held in the fourth step to the internal register via the data bus, and replacing a part of the data held in the internal register with the correction data; ,
After a part of the data held in the internal register in the fifth step is replaced with the correction data, the data held in the internal register is transferred to the first page with respect to the flash memory. A sixth step for instructing to write to a second page different from
It is characterized by including.

上記目的を達成するため、本発明の第4の観点に係るフラッシュメモリの制御方法は、
複数のページで構成されたメモリセルアレイと、該メモリセルアレイに書き込むデータ又は該メモリセルアレイから読み出したデータをページ単位で保持する内部レジスタとを備えるフラッシュメモリに対して、前記メモリセルアレイ内の第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する第1のステップと、
前記第1のステップで前記内部レジスタに読み出されたデータを、前記フラッシュメモリのデータバスを介して前記内部レジスタから読み出す第2のステップと、
前記第2のステップで読み出されたデータに含まれる誤りの訂正値を求める第3のステップと、
前記第3のステップで求められた前記訂正値を含む訂正データを、前記データバスのバス幅に対応するビット数単位で保持する第4のステップと、
前記フラッシュメモリに対して、前記第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する第5のステップと、
前記第4のステップで保持された前記訂正データを、前記第5のステップで前記内部レジスタに読み出されたデータが保持されている前記内部レジスタに前記データバスを介して転送し、前記内部レジスタに保持されているデータの一部を前記訂正データで置き換える第6のステップと、
前記第6のステップで前記内部レジスタに保持されているデータの一部が前記訂正データで置き換えられた後に、前記フラッシュメモリに対して、前記内部レジスタに保持されているデータを前記第1のページとは異なる第2のページに書き込むことを指示する第7のステップと、
を含むことを特徴とする。
In order to achieve the above object, a flash memory control method according to a fourth aspect of the present invention includes:
For a flash memory comprising a memory cell array composed of a plurality of pages and an internal register for holding data to be written to the memory cell array or data read from the memory cell array in units of pages, the first in the memory cell array A first step for instructing reading of data stored in a page to the internal register;
A second step of reading data read into the internal register in the first step from the internal register via a data bus of the flash memory;
A third step for obtaining a correction value of an error included in the data read in the second step;
A fourth step of holding correction data including the correction value obtained in the third step in units of bits corresponding to the bus width of the data bus;
A fifth step for instructing the flash memory to read the data stored in the first page into the internal register;
The correction data held in the fourth step is transferred via the data bus to the internal register in which the data read in the internal register in the fifth step is held, and the internal register A sixth step of replacing a part of the data held in the data with the corrected data;
After a part of the data held in the internal register in the sixth step is replaced with the correction data, the data held in the internal register is transferred to the first page with respect to the flash memory. A seventh step for instructing to write to a second page different from
It is characterized by including.

本発明によれば、フラッシュメモリに記憶されているデータの誤りを、効率良く訂正して、フラッシュメモリに保存し直すことができる。   According to the present invention, it is possible to efficiently correct an error in data stored in the flash memory and save it again in the flash memory.

以下、図面に基づき、本発明の実施の形態について詳細に説明する。
図1は、本発明の実施の形態に係るフラッシュメモリシステム1の構成を概略的に示すブロック図である。
図1に示すように、フラッシュメモリシステム1は、フラッシュメモリ2と、それを制御するフラッシュメモリコントローラ3とから構成され、外部バス13を介してホストシステム4と接続される。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
FIG. 1 is a block diagram schematically showing a configuration of a flash memory system 1 according to an embodiment of the present invention.
As shown in FIG. 1, the flash memory system 1 includes a flash memory 2 and a flash memory controller 3 that controls the flash memory 2, and is connected to a host system 4 via an external bus 13.

ホストシステム4は、ホストシステム4の全体の動作を制御するためのCPU(Central Processing Unit)、フラッシュメモリシステム1との情報の授受を担うコンパニオンチップ等から構成される。ホストシステム4は、例えば、文字、音声、あるいは画像情報等の種々の情報を処理するパーソナルコンピュータやデジタルスチルカメラをはじめとする各種情報処理装置であってもよい。   The host system 4 includes a CPU (Central Processing Unit) for controlling the entire operation of the host system 4, a companion chip for transferring information to and from the flash memory system 1, and the like. The host system 4 may be various information processing apparatuses such as a personal computer and a digital still camera that process various types of information such as characters, sounds, and image information.

フラッシュメモリ2は、不揮発性メモリであり、メモリセルアレイ21と、ページレジスタ(内部レジスタ)22とを備えている。メモリセルアレイ21に書き込まれるデータ、又はメモリセルアレイ21から読み出されたデータはページレジスタ(内部レジスタ)22に一時的に保持される。   The flash memory 2 is a nonvolatile memory and includes a memory cell array 21 and a page register (internal register) 22. Data written to the memory cell array 21 or data read from the memory cell array 21 is temporarily held in a page register (internal register) 22.

フラッシュメモリコントローラ3はホストシステム4から供給されるデータをフラッシュメモリ2に転送し、フラッシュメモリ2内のページレジスタ(内部レジスタ)22を介してメモリセルアレイ21に書き込み、メモリセルアレイ21に書き込まれているデータをページレジスタ(内部レジスタ)22を介して読み出し、ホストシステム4に提供する。つまり、フラッシュメモリコントローラ3はページレジスタ22へのデータの書き込み又はページレジスタ22からのデータの読み出しを行い、フラッシュメモリ2はフラッシュメモリコントローラ3から与えられるコマンドに従ってページレジスタ22からメモリセルアレイ21へのデータの書き込み(複写)又はメモリセルアレイ21からページレジスタ22へのデータの読み出し(複写)を行う。   The flash memory controller 3 transfers the data supplied from the host system 4 to the flash memory 2, writes it in the memory cell array 21 via the page register (internal register) 22 in the flash memory 2, and writes it in the memory cell array 21. Data is read through the page register (internal register) 22 and provided to the host system 4. That is, the flash memory controller 3 writes data to the page register 22 or reads data from the page register 22, and the flash memory 2 reads data from the page register 22 to the memory cell array 21 in accordance with a command given from the flash memory controller 3. Is written (copied) or data is read (copied) from the memory cell array 21 to the page register 22.

フラッシュメモリ2のアドレス空間は、「ページ」及び「ブロック(物理ブロック)」で構成されている。
ページは、フラッシュメモリ2にて行われるデータ読み出し動作及びデータ書き込み動作の処理単位である。つまり、データ読み出し動作及びデータ書き込み動作では、メモリセルアレイ21内のメモリセルがページ単位で選択され、このページ単位で、ページレジスタ22からメモリセルへのデータの書き込み(複写)、又はメモリセルからページレジスタ22へのデータの読み出し(複写)が行われる。
The address space of the flash memory 2 is composed of “pages” and “blocks (physical blocks)”.
A page is a processing unit of a data read operation and a data write operation performed in the flash memory 2. That is, in the data read operation and data write operation, the memory cells in the memory cell array 21 are selected in units of pages, and data is written (duplicated) from the page register 22 to the memory cells or pages from the memory cells in units of pages. Data is read (copied) from the register 22.

物理ブロックは、フラッシュメモリ2で行われるデータ消去動作の処理単位であり、複数のページで構成されている。従って、データ消去動作では同じ物理ブロックに属する複数のページに記憶されているデータが一緒に消去される。   The physical block is a processing unit of data erasing operation performed in the flash memory 2, and is composed of a plurality of pages. Therefore, in the data erasing operation, data stored in a plurality of pages belonging to the same physical block are erased together.

尚、ページレジスタ22からメモリセルアレイ21へのデータの書き込み、メモリセルアレイ21からページレジスタ22へのデータの読み出し、及びメモリセルアレイ21に記憶されているデータの消去が行われているとき、フラッシュメモリ2は、データ、アドレス情報、内部コマンド等の授受を行うことができないビジー状態になる。   The flash memory 2 is written when data is written from the page register 22 to the memory cell array 21, data is read from the memory cell array 21 to the page register 22, and data stored in the memory cell array 21 is erased. Is in a busy state where data, address information, internal commands, etc. cannot be exchanged.

図2は、フラッシュメモリ2のアドレス空間の構造を概略的に示す図である。
図2に示した例では、フラッシュメモリ2のアドレス空間は、ブロック0〜4095の4096個の物理ブロックで構成されている。また、各物理ブロックは、ページ0〜ページ63の64個のページで構成されている。更に、各ページは、4セクタ(512バイト×4セクタ=2048バイト)のユーザ領域25と、64バイトの冗長領域26と、で構成されている。
FIG. 2 is a diagram schematically showing the structure of the address space of the flash memory 2.
In the example shown in FIG. 2, the address space of the flash memory 2 is composed of 4096 physical blocks of blocks 0 to 4095. Each physical block includes 64 pages, page 0 to page 63. Further, each page includes a user area 25 of 4 sectors (512 bytes × 4 sectors = 2048 bytes) and a redundant area 26 of 64 bytes.

ここで、ユーザ領域25は、ホストシステム4から供給されるユーザデータを格納するための領域である。また、冗長領域26は、付加データを記録するための領域である。付加データは、後述するエラーコレクションコード(ECC)、その物理ブロックと対応関係にある論理ブロックを特定するための論理アドレス情報、その物理ブロックが不良ブロックであるか否かを示すブロックステータス等を含んでいる。   Here, the user area 25 is an area for storing user data supplied from the host system 4. The redundant area 26 is an area for recording additional data. The additional data includes an error correction code (ECC) described later, logical address information for specifying a logical block corresponding to the physical block, a block status indicating whether the physical block is a defective block, and the like. It is out.

このフラッシュメモリ2が有する4096個の物理ブロックに含まれるすべてのページ、つまり262144個のページには、ロウアドレス(0〜262143)が割り当てられている。このロウアドレスにより、書き込み又は読み出しの対象のページが特定される。更に、各ページ内では、ビットb0〜b7のビットからなる1バイト単位で、カラムアドレス(0〜2111)が割り当てられている。このカラムアドレスにより、書き込み又は読み出しの対象のページ内での位置が特定される。ここで、カラムアドレスが0〜2047の2048バイト(4セクタ)の領域がユーザ領域25に対応し、カラムアドレスが2048〜2111の64バイトの領域が冗長領域26に対応している。   Row addresses (0 to 262143) are assigned to all pages included in 4096 physical blocks of the flash memory 2, that is, 262144 pages. A page to be written or read is specified by the row address. Further, in each page, column addresses (0 to 2111) are assigned in units of 1 byte consisting of bits b0 to b7. The position in the page to be written or read is specified by this column address. Here, an area of 2048 bytes (4 sectors) with a column address of 0 to 2047 corresponds to the user area 25, and an area of 64 bytes with a column address of 2048 to 2111 corresponds to the redundant area 26.

尚、フラッシュメモリ2のデータ入出力バス(データを入出力するためのデータバス)が8ビット(8端子)の場合、ページレジスタ(内部レジスタ)22には上記のような1バイト(8ビット)単位のカラムアドレスが割り当てられ、ページレジスタ22に書き込まれるデータは1バイト単位でフラッシュメモリコントローラ3からフラッシュメモリ2に入力(供給)され、ページレジスタ22から読み出されるデータは1バイト単位でフラッシュメモリ2から出力され、フラッシュメモリコントローラ3に入力される。又、フラッシュメモリ2のデータ入出力バス(データを入出力するためのデータバス)が16ビット(16端子)の場合、ページレジスタ22に書き込まれるデータは2バイト単位でフラッシュメモリコントローラ3からフラッシュメモリ2に入力(供給)され、ページレジスタ22から読み出されるデータは2バイト単位でフラッシュメモリ2から出力されるので、ページレジスタ(内部レジスタ)22には2バイト(16ビット)単位のカラムアドレス(0〜1055)が割り当てられている。   When the data input / output bus (data bus for inputting / outputting data) of the flash memory 2 is 8 bits (8 terminals), the page register (internal register) 22 has 1 byte (8 bits) as described above. The unit column address is assigned, and the data written to the page register 22 is input (supplied) from the flash memory controller 3 to the flash memory 2 in units of 1 byte, and the data read from the page register 22 is flash memory 2 in units of 1 byte. Is input to the flash memory controller 3. When the data input / output bus of the flash memory 2 (data bus for inputting / outputting data) is 16 bits (16 terminals), the data written to the page register 22 is in units of 2 bytes from the flash memory controller 3 to the flash memory. Since the data input (supplied) 2 and read from the page register 22 is output from the flash memory 2 in units of 2 bytes, the page register (internal register) 22 has a column address (0 in units of 2 bytes (16 bits)). -1055).

図3は、4セクタ(2048バイト)のユーザ領域25と64バイトの冗長領域26とで構成されているページの記憶領域を示す図である。図3を参照しているページの記憶領域の構成について説明する。尚、ページに書き込むデータ又はページから読み出したデータを一時的に保持するページレジスタ(内部レジスタ)22の構成は、ページの記憶領域の構成と同じになっている。
ユーザ領域25は、第1セクタ領域251、第2セクタ領域252、第3セクタ領域253、第4セクタ領域254の4つの領域に分割して使用される。第1セクタ領域251はカラムアドレスの0〜511に対応する領域であり、第2セクタ領域252はカラムアドレスの512〜1023に対応する領域であり、第3セクタ領域253はカラムアドレスの1024〜1535に対応する領域であり、第4セクタ領域254はカラムアドレスの1536〜2047に対応する領域である。ユーザ領域25を4分割した512バイトの領域である第1セクタ領域251〜第4セクタ領域254には、それぞれ、ホストシステム4から供給される1セクタ(512バイト)のユーザデータが格納される。
FIG. 3 is a diagram showing a storage area of a page configured by a user area 25 of 4 sectors (2048 bytes) and a redundant area 26 of 64 bytes. The configuration of the storage area of the page referring to FIG. 3 will be described. The configuration of the page register (internal register) 22 that temporarily holds data to be written to the page or data read from the page is the same as the configuration of the page storage area.
The user area 25 is divided into four areas, ie, a first sector area 251, a second sector area 252, a third sector area 253, and a fourth sector area 254. The first sector area 251 is an area corresponding to column addresses 0 to 511, the second sector area 252 is an area corresponding to column addresses 512 to 1023, and the third sector area 253 is a column address 1024 to 1535. The fourth sector area 254 is an area corresponding to column addresses 1536 to 2047. User data of one sector (512 bytes) supplied from the host system 4 is stored in each of the first sector area 251 to the fourth sector area 254, which are 512-byte areas obtained by dividing the user area 25 into four.

冗長領域26は、共通領域260、第1個別領域261、第2個別領域262、第3個別領域263、第4個別領域264に分割して使用される。共通領域260は、カラムアドレスの2048〜2011に対応する8バイトの領域であり、論理アドレス情報、ブロックステータス等が記憶される。なお、論理アドレス情報及びブロックステータスは、物理ブロックに含まれる64個のページに共通の管理情報であるため、通常は物理ブロックの先頭ページの共通領域260にだけ書き込まれる。   The redundant area 26 is divided into a common area 260, a first individual area 261, a second individual area 262, a third individual area 263, and a fourth individual area 264. The common area 260 is an 8-byte area corresponding to column addresses 2048 to 2011, and stores logical address information, block status, and the like. Since the logical address information and the block status are management information common to 64 pages included in the physical block, the logical address information and the block status are usually written only in the common area 260 of the first page of the physical block.

第1個別領域261は、カラムアドレスの2056〜2069に対応する14バイトの領域であり、第1セクタ領域251に書き込まれたデータに関する情報が記憶される。第2個別領域262は、カラムアドレスの2070〜2083に対応する14バイトの領域であり、第2セクタ領域252に書き込まれたデータに関する情報が記憶される。第3個別領域263は、カラムアドレスの2084〜2097に対応する14バイトの領域であり、第3セクタ領域253に書き込まれたデータに関する情報が記憶される。第4個別領域264は、カラムアドレス2098〜2111に対応する14バイトの領域であり、第4セクタ領域254に書き込まれたデータに関する情報が記憶される。   The first individual area 261 is a 14-byte area corresponding to the column addresses 2056 to 2069, and stores information related to data written in the first sector area 251. The second individual area 262 is a 14-byte area corresponding to the column addresses 2070 to 2083, and stores information related to the data written in the second sector area 252. The third individual area 263 is a 14-byte area corresponding to the column addresses 2084 to 2097, and stores information related to the data written in the third sector area 253. The fourth individual area 264 is a 14-byte area corresponding to the column addresses 2098 to 2111, and stores information related to data written in the fourth sector area 254.

例えば、第1個別領域261には、第1セクタ領域251に記憶されるデータに対応するエラーコレクションコード等が記憶される。以下同様に、第2セクタ領域252、第3セクタ領域253、第4セクタ領域254にそれぞれ記憶されるデータに対応するエラーコレクションコード等は、第2個別領域262、第3個別領域263、第4個別領域264にそれぞれ記憶される。   For example, in the first individual area 261, an error collection code corresponding to data stored in the first sector area 251 is stored. Similarly, the error correction codes corresponding to the data stored in the second sector area 252, the third sector area 253, and the fourth sector area 254 are the second individual area 262, the third individual area 263, the fourth Each is stored in the individual area 264.

エラーコレクションコードは、第1セクタ領域251から第4セクタ領域254に書き込まれる各ユーザデータに基づいてECCブロック11で生成され、上記の対応関係に従って第1個別領域261から第4個別領域264にそれぞれ書き込まれる。従って、第1セクタ領域251から読み出されたユーザデータに含まれる誤りは、第1個別領域261から読み出されたエラーコレクションコードに基づいて訂正され、第2セクタ領域252から読み出されたユーザデータに含まれる誤りは、第2個別領域262から読み出されたエラーコレクションコードに基づいて訂正され、第3セクタ領域253から読み出されたユーザデータに含まれる誤りは、第3個別領域263から読み出されたエラーコレクションコードに基づいて訂正され、第4セクタ領域254から読み出されたユーザデータに含まれる誤りは、第4個別領域264から読み出されたエラーコレクションコードに基づいて訂正される。   The error collection code is generated by the ECC block 11 based on each user data written from the first sector area 251 to the fourth sector area 254, and is transferred from the first individual area 261 to the fourth individual area 264 according to the above correspondence relationship. Written. Therefore, the error included in the user data read from the first sector area 251 is corrected based on the error collection code read from the first individual area 261, and the user read from the second sector area 252 is corrected. The error included in the data is corrected based on the error collection code read from the second individual area 262, and the error included in the user data read from the third sector area 253 is corrected from the third individual area 263. An error included in the user data read from the fourth sector area 254 is corrected based on the read error collection code, and the error included in the user data read from the fourth sector area 254 is corrected based on the error collection code read from the fourth individual area 264. .

なお、エラーコレクションコードのデータ量は誤りの訂正能力に応じて適宜設定することができる。例えば、リードソロモン符号をエラーコレクションコードとして使用し、10ビットを1シンボルとして、4シンボル以下の誤りを訂正できるようにしたい場合には、8シンボル(10バイト)のエラーコレクションコードが第1個別領域261〜第4個別領域264にそれぞれ書き込まれる。   The data amount of the error correction code can be set as appropriate according to the error correction capability. For example, when Reed-Solomon code is used as an error collection code and 10 bits are used as one symbol and an error of 4 symbols or less is to be corrected, an error collection code of 8 symbols (10 bytes) is the first individual area. 261 to the fourth individual area 264 are written respectively.

図4は、ホストシステム4側のアドレス空間(論理アドレス)とフラッシュメモリ2側のアドレス空間(物理アドレス)の対応関係を示す図である。
フラッシュメモリ2内の各物理ブロックには、物理ブロックアドレス(PBA)が割り当てられている。この物理ブロックアドレス(PBA)によりフラッシュメモリ2内の物理ブロックが特定される。複数の物理ブロックで構成されたフラッシュメモリ2内の記憶領域を複数のゾーンに分割して管理する場合には、複数の物理ブロックで物理ゾーンを構成して、各物理ゾーンに物理ゾーン番号(PZN)を割り当てる。この物理ゾーン番号(PZN)により物理ゾーンが特定される。また、各物理ゾーンに含まれる物理ブロックの、各物理ゾーン内での通番を物理ゾーン内ブロック番号(PZIBN)と呼んでいる。
FIG. 4 is a diagram showing the correspondence between the address space (logical address) on the host system 4 side and the address space (physical address) on the flash memory 2 side.
A physical block address (PBA) is assigned to each physical block in the flash memory 2. The physical block in the flash memory 2 is specified by this physical block address (PBA). When a storage area in the flash memory 2 composed of a plurality of physical blocks is divided into a plurality of zones for management, a physical zone is composed of a plurality of physical blocks, and a physical zone number (PZN) is assigned to each physical zone. ). A physical zone is specified by this physical zone number (PZN). Further, the serial number in each physical zone of the physical block included in each physical zone is called a physical zone block number (PZIBN).

一方、ホストシステム4側のアドレス空間は、セクタ(512バイト)単位で分割した領域に付けた通番であるLBA(Logical Block Address)で管理されている。ホストシステム4は、このLBAでフラッシュメモリ2内のアクセス領域を指定する。   On the other hand, the address space on the host system 4 side is managed by an LBA (Logical Block Address) which is a serial number assigned to an area divided in units of sectors (512 bytes). The host system 4 designates an access area in the flash memory 2 with this LBA.

フラッシュメモリコントローラ3の内部では、複数のセクタをまとめたものを論理ブロックとして取り扱っている。各論理ブロックに対応するデータは、その論理ブロックに割り当てられた物理ブロックに書き込まれる。フラッシュメモリコントローラ3は、論理ブロックと物理ブロックとの対応関係を、冗長領域26に書き込まれている論理アドレス情報に基づいて判断する。   Inside the flash memory controller 3, a group of a plurality of sectors is handled as a logical block. Data corresponding to each logical block is written to the physical block assigned to that logical block. The flash memory controller 3 determines the correspondence between the logical block and the physical block based on the logical address information written in the redundant area 26.

この論理ブロックに付けられた通番を論理ブロック番号(LBN)と呼び、各論理ブロックに含まれるセクタの、各論理ブロック内での通番をセクタ番号(SN)と呼んでいる。   A serial number assigned to this logical block is called a logical block number (LBN), and a serial number in each logical block of sectors included in each logical block is called a sector number (SN).

本実施の形態では、256セクタをまとめたものを論理ブロックとしている。従って、LBAの下位8ビットがSNに対応し、下位8ビットを除いた上位ビット側がLBNに対応する。例えば、LBAが0〜255のセクタで構成された論理ブロックのLBNは0になり、LBAが256〜511のセクタで構成された論理ブロックのLBNは1になる。   In this embodiment, a combination of 256 sectors is used as a logical block. Therefore, the lower 8 bits of the LBA correspond to the SN, and the upper bit side excluding the lower 8 bits corresponds to the LBN. For example, the LBN of a logical block composed of sectors with an LBA of 0 to 255 is 0, and the LBN of a logical block composed of sectors with an LBA of 256 to 511 is 1.

LBAで特定されるセクタが、ページ0〜ページ63のいずれのページであるかは、LBAの下位側から数えて3ビット目から8ビット目の値に基づいて特定される。また、第1セクタ領域251〜第4セクタ領域254のいずれの領域であるかは、LBAの下位2ビット(LBAの下位側から数えて1ビット目と2ビット目)の値に基づいて特定される。例えば、LBAの下位8ビットの値が「00000100」〜「00000111」のセクタは、ページ1に対応する。また、LBAの下位2ビットの値が「00」のセクタは第1セクタ領域251に対応し、「01」のセクタは第2セクタ領域252に対応し、「10」のセクタは第3セクタ領域253に対応し、「11」のセクタは第4セクタ領域254に対応する。   Whether the sector specified by the LBA is any of page 0 to page 63 is specified based on the value of the third to eighth bits counted from the lower side of the LBA. Further, which of the first sector area 251 to the fourth sector area 254 is specified based on the value of the lower 2 bits of the LBA (the first and second bits counted from the lower side of the LBA). The For example, a sector whose LBA lower 8 bits are “00000100” to “00000111” corresponds to page 1. Also, the sector whose LBA lower 2 bits are “00” corresponds to the first sector area 251, the sector “01” corresponds to the second sector area 252, and the sector “10” is the third sector area. The sector “11” corresponds to the fourth sector region 254.

また、複数の論理ブロックをまとめたものを論理ゾーンと呼んでいる。そして、論理ゾーンに付けられた通番を論理ゾーン番号(LZN)と呼び、各論理ゾーンに含まれる論理ブロックの、各論理ゾーン内での通番を論理ゾーン内ブロック番号(LZIBN)と呼んでいる。従って、各論理ゾーンに含まれる論理ブロック数をkとした場合、LBNをkで割ったときの商がLZNに対応し、余りがLZIBNに対応する。   A group of a plurality of logical blocks is called a logical zone. A serial number assigned to the logical zone is called a logical zone number (LZN), and a serial number in each logical zone of a logical block included in each logical zone is called a logical zone block number (LZIBN). Therefore, when the number of logical blocks included in each logical zone is k, the quotient when LBN is divided by k corresponds to LZN, and the remainder corresponds to LZIBN.

また、各論理ゾーンにはそれぞれ1個の物理ゾーンが割り当てられ、論理ゾーンに含まれる各論理ブロックに対応するデータは、その論理ゾーンに割り当てられた物理ゾーンに含まれる物理ブロックに書き込まれる。従って、1個の論理ブロックに含まれるセクタ数は、1個の物理ブロックに含まれるセクタ領域の個数に応じて設定される。但し、1個の論理ブロックを複数個の物理ブロックに割り当てることもでき、その場合には、その複数個の物理ブロックを1個の物理ブロックとみなして1個の論理ブロックに含まれるセクタ数を設定する。   In addition, one physical zone is allocated to each logical zone, and data corresponding to each logical block included in the logical zone is written to a physical block included in the physical zone allocated to the logical zone. Therefore, the number of sectors included in one logical block is set according to the number of sector areas included in one physical block. However, one logical block can be assigned to a plurality of physical blocks. In this case, the plurality of physical blocks are regarded as one physical block, and the number of sectors included in one logical block is determined. Set.

図4に示した例では、1個の物理ブロックが64個のページを含み、1個のページが4個のセクタに対応するフラッシュメモリ、つまり1個の物理ブロックが256個のセクタ領域で構成されたフラッシュメモリを想定している。そのため、256セクタが1個の論理ブロックに対応している。従って、LBN#0〜#499の500個の論理ブロックで構成されたLZN#0の論理ゾーンは、LBA#0〜#127999の128000セクタの領域に対応している。以下同様に、LZN#1の論理ゾーンは、LBA#128000〜#255999の128000セクタの領域に対応し、LZN#2の論理ゾーンは、LBA#256000〜#383999の128000セクタの領域に対応し、・・・、LZN#7の論理ゾーンは、LBA#896000〜#1023999の128000セクタの領域に対応している。   In the example shown in FIG. 4, one physical block includes 64 pages, and one page is a flash memory corresponding to 4 sectors, that is, one physical block is composed of 256 sector areas. Assumed flash memory. Therefore, 256 sectors correspond to one logical block. Therefore, the logical zone of LZN # 0 configured with 500 logical blocks of LBN # 0 to # 499 corresponds to the 128000 sector area of LBA # 0 to # 127999. Similarly, the logical zone of LZN # 1 corresponds to the 128000 sector area of LBA # 128000 to # 255999, the logical zone of LZN # 2 corresponds to the 128000 sector area of LBA # 256000 to # 383999, ..., the logical zone of LZN # 7 corresponds to the 128000 sector area of LBA # 896000 to # 1023999.

また、LBN#0〜#499の500個の論理ブロックで構成されたLZN#0の論理ゾーンは、PBA#0〜#511の512個の物理ブロックで構成されたPZN#0の物理ゾーンに割り当てられている。以下同様に、LZN#1の論理ゾーンは、PZN#1の物理ゾーンに割り当てられ、LZN#2の論理ゾーンは、PZN#2の物理ゾーンに割り当てられ、・・・、LZN#7の論理ゾーンは、PZN#7の物理ゾーンに割り当てられている。ここで、物理ゾーンに含まれる物理ブロックの個数を、論理ゾーンに含まれる論理ブロックの個数より多くしているのは、同一の論理ブロックに対応する新データと旧データとが別々の物理ブロックに並存する場合や、データを正常に書き込むことができない不良ブロックが発生した場合等に対応するためである。   In addition, the logical zone of LZN # 0 configured with 500 logical blocks of LBN # 0 to # 499 is allocated to the physical zone of PZN # 0 configured with 512 physical blocks of PBA # 0 to # 511. It has been. Similarly, the logical zone of LZN # 1 is assigned to the physical zone of PZN # 1, the logical zone of LZN # 2 is assigned to the physical zone of PZN # 2, ..., the logical zone of LZN # 7 Are assigned to the physical zone of PZN # 7. Here, the number of physical blocks included in the physical zone is greater than the number of logical blocks included in the logical zone because the new data and old data corresponding to the same logical block are separated into separate physical blocks. This is to cope with cases where they coexist, or when a defective block in which data cannot be normally written occurs.

また、本実施の形態では、各物理ブロックに、その物理ブロックに割り当てられた論理ブロックのデータがLBAの順番で書き込まれる。このため、物理ブロックと論理ブロックとの対応関係を管理することによって、ホストシステム4から与えられるLBAとフラッシュメモリ2内の記憶領域との対応関係を管理することができる。   In the present embodiment, data of logical blocks assigned to the physical block is written in each physical block in the LBA order. Therefore, by managing the correspondence between the physical block and the logical block, the correspondence between the LBA given from the host system 4 and the storage area in the flash memory 2 can be managed.

フラッシュメモリ2においては、データの消去がブロック単位で行われ、物理ブロックを構成しているページにデータを上書きすることができない。従って、物理ブロック内の一部のページに記憶されているデータを書き換える場合には、書き換え対象のページの書き換えデータと、その書き換え対象のページと同一の物理ブロックに含まれている書き換え対象でないページの記憶データが、消去済みの別の物理ブロックに書き込まれる。   In the flash memory 2, data is erased in units of blocks, and data cannot be overwritten on the pages constituting the physical block. Therefore, when rewriting data stored in some pages in a physical block, the rewritten data of the page to be rewritten and the non-rewritten page included in the same physical block as the page to be rewritten Is stored in another erased physical block.

このようなデータの書き換えでは、書き換えられたデータは、以前に格納されていた物理ブロックとは異なる物理ブロックに書き込まれる。従って、データの書き換えが行われる毎に、論理ブロックと物理ブロックの対応関係が変化する。   In such data rewriting, the rewritten data is written in a physical block different from the physical block stored previously. Therefore, each time data is rewritten, the correspondence between the logical block and the physical block changes.

そこで、個々の時点における両者の対応関係を管理するためのアドレス変換テーブルが作成され、両者の対応関係が変化する毎に更新される。このアドレス変換テーブルにより、ホストシステム4側の論理アドレスと、フラッシュメモリ2内の物理アドレスと、の対応関係が管理される。なお、論理ゾーンと物理ゾーンとの対応関係は予め設定されており、アドレス変換テーブルは論理ゾーン毎に作成される。   Therefore, an address conversion table for managing the correspondence between the two at each time point is created and updated whenever the correspondence between the two changes. With this address conversion table, the correspondence between the logical address on the host system 4 side and the physical address in the flash memory 2 is managed. The correspondence relationship between the logical zone and the physical zone is set in advance, and an address conversion table is created for each logical zone.

アドレス変換テーブルは、物理ブロックの先頭ページの冗長領域26に書き込まれている論理アドレス情報(対応関係にある論理ブロックを示す情報)に基づいて作成される。論理アドレス情報としては、論理ブロック番号(LBN)等の論理ブロックを特定するための情報が用いられる。なお、論理ゾーンと物理ゾーンとの対応関係が予め設定されている場合には、論理ゾーン内ブロック番号(LZIBN)に基づいてアドレス変換テーブルを作成することができるので、LBNよりデータ量の少ないLZIBNを論理アドレス情報として用いることが好ましい。その場合、アドレス変換テーブルは、対応する論理ゾーンと物理ゾーンの組毎に、論理ゾーン内ブロック番号(LZIBN)と物理ゾーン内ブロック番号(PZIBN)との対応関係を記憶する。   The address conversion table is created based on logical address information (information indicating logical blocks having a correspondence relationship) written in the redundant area 26 of the first page of the physical block. As the logical address information, information for specifying a logical block such as a logical block number (LBN) is used. If the correspondence relationship between the logical zone and the physical zone is set in advance, an address conversion table can be created based on the block number (LZIBN) in the logical zone, so LZIBN having a smaller data amount than LBN. Is preferably used as logical address information. In this case, the address conversion table stores the correspondence between the logical zone block number (LZIBN) and the physical zone block number (PZIBN) for each pair of the corresponding logical zone and physical zone.

なお、論理アドレス情報は、ユーザ領域25にデータが記憶されている物理ブロックに対応する論理ブロックを特定するための情報であるため、ユーザ領域25に有効なデータが格納されていない物理ブロックについては、論理アドレス情報は格納されていない。   The logical address information is information for specifying a logical block corresponding to a physical block in which data is stored in the user area 25. Therefore, for a physical block in which valid data is not stored in the user area 25, Logical address information is not stored.

従って、冗長領域26に論理アドレス情報が格納されているか否かを判定することにより、その冗長領域26が含まれている物理ブロックに有効なデータが格納されているか否かを判断することができる。   Therefore, by determining whether or not logical address information is stored in the redundant area 26, it is possible to determine whether or not valid data is stored in the physical block including the redundant area 26. .

また、物理ブロックの先頭ページの冗長領域26には、その物理ブロックが不良ブロックであるか否かを示すブロックステータスが格納されている。正常にデータの書き込み等を行うことができない物理ブロックは、不良ブロックと判別され、冗長領域26に不良ブロックである旨のブロックステータスが書き込まれる。   The redundant area 26 on the first page of the physical block stores a block status indicating whether or not the physical block is a bad block. A physical block that cannot normally perform data writing or the like is determined as a defective block, and a block status indicating that it is a defective block is written in the redundant area 26.

有効なデータが格納されていないブロックであって且つ不良ブロックでない物理ブロックは、データの書き込み先とすることができる。そこで、そのような物理ブロックを消去済みブロック(空きブロック)として管理するために、消去済みブロックテーブルが作成される。この消去済みブロックテーブルは、物理ブロックの先頭ページの冗長領域26に書き込まれている論理アドレス情報とブロックステータスに基づいて物理ゾーン毎に作成される。この消去済みブロックテーブルの例としては、消去済みブロックを特定できる情報(PBA、PZIBN等)を記述したテーブルが挙げられる。   A physical block that does not store valid data and is not a bad block can be a data write destination. In order to manage such physical blocks as erased blocks (empty blocks), an erased block table is created. This erased block table is created for each physical zone based on logical address information and block status written in the redundant area 26 of the first page of the physical block. An example of the erased block table is a table describing information (PBA, PZIBN, etc.) that can identify an erased block.

フラッシュメモリ2に記憶されているデータを書き換えるときには、消去済みブロックテーブルから消去済みブロックを選択し、選択した消去済みブロックに、書き換えデータを書き込む。また、消去済みブロックにデータを書き込んだときや、物理ブロックに記憶されているデータを消去したときは、消去済みブロックテーブルを更新する。   When the data stored in the flash memory 2 is rewritten, the erased block is selected from the erased block table, and the rewritten data is written into the selected erased block. Further, when data is written in the erased block or when data stored in the physical block is erased, the erased block table is updated.

次に、フラッシュメモリ2に対するアクセスを制御するフラッシュメモリコントローラ3について説明する。
フラッシュメモリコントローラ3は、フラッシュメモリ2にデータ、アドレス情報、内部コマンド等を供給することにより、読み出し処理、書き込み処理、ブロック消去処理、データ複写処理等の各処理を行う。
Next, the flash memory controller 3 that controls access to the flash memory 2 will be described.
The flash memory controller 3 supplies data, address information, internal commands and the like to the flash memory 2 to perform each process such as a read process, a write process, a block erase process, and a data copy process.

ここで、内部コマンドとは、フラッシュメモリコントローラ3がフラッシュメモリ2に処理の実行を指示するためのコマンドであり、フラッシュメモリ2はフラッシュメモリコントローラ3から与えられる内部コマンドに従って動作する。これに対し、ホストシステム4からフラッシュメモリコントローラ3に与えられるコマンドを外部コマンドと言う。   Here, the internal command is a command for the flash memory controller 3 to instruct the flash memory 2 to execute processing, and the flash memory 2 operates according to the internal command given from the flash memory controller 3. On the other hand, a command given from the host system 4 to the flash memory controller 3 is called an external command.

図1に示したように、フラッシュメモリコントローラ3は、マイクロプロセッサ6と、ホストインターフェースブロック7と、ワークエリア8と、バッファ9と、フラッシュメモリインターフェースブロック10と、ECC(エラー・コレクション・コード)ブロック11と、ROM(Read Only Memory)12と、を備えている。これら機能ブロックによって構成されるフラッシュメモリコントローラ3は、一つの半導体チップ上に集積される。以下に各機能ブロックについて説明する。   As shown in FIG. 1, the flash memory controller 3 includes a microprocessor 6, a host interface block 7, a work area 8, a buffer 9, a flash memory interface block 10, and an ECC (error collection code) block. 11 and a ROM (Read Only Memory) 12. The flash memory controller 3 constituted by these functional blocks is integrated on one semiconductor chip. Each functional block will be described below.

マイクロプロセッサ6は、ROM12に記憶されているプログラムに従って、フラッシュメモリコントローラ3を構成する各機能ブロックの動作を制御することにより、フラッシュメモリコントローラ3の全体の動作を制御する。   The microprocessor 6 controls the overall operation of the flash memory controller 3 by controlling the operation of each functional block constituting the flash memory controller 3 according to the program stored in the ROM 12.

ホストインターフェースブロック7は、ホストシステム4との間で、外部バス13を介し、データ、アドレス情報、外部コマンド等の授受を行う。ホストシステム4からフラッシュメモリシステム1に供給されるデータ等は、ホストインターフェースブロック7を入口としてフラッシュメモリシステム1の内部(例えばバッファ9)に取り込まれる。また、フラッシュメモリシステム1からホストシステム4に供給されるデータ等は、ホストインターフェースブロック7を出口としてホストシステム4に供給される。   The host interface block 7 exchanges data, address information, external commands, and the like with the host system 4 via the external bus 13. Data or the like supplied from the host system 4 to the flash memory system 1 is taken into the flash memory system 1 (for example, the buffer 9) using the host interface block 7 as an entrance. Data supplied from the flash memory system 1 to the host system 4 is supplied to the host system 4 through the host interface block 7 as an exit.

ワークエリア8は、マイクロプロセッサ6によるフラッシュメモリ2の制御に必要なデータが一時的に格納される作業領域であり、複数のSRAM(Static Random Access Memory)セルによって構成される。ワークエリア8には、例えば、上述のアドレス変換テーブル、消去済みブロックテーブル等が記憶される。   The work area 8 is a work area in which data necessary for controlling the flash memory 2 by the microprocessor 6 is temporarily stored, and is composed of a plurality of SRAM (Static Random Access Memory) cells. In the work area 8, for example, the above-described address conversion table, erased block table, and the like are stored.

バッファ9は、フラッシュメモリ2から読み出されたデータ及びフラッシュメモリ2に書き込まれるデータを一時的に蓄積する。即ち、フラッシュメモリ2から読み出されたデータは、ホストシステム4が受け取り可能な状態となるまでバッファ9に保持される。また、フラッシュメモリ2に書き込まれるデータは、フラッシュメモリ2が書き込み可能な状態となるまでバッファ9に保持される。   The buffer 9 temporarily stores data read from the flash memory 2 and data to be written to the flash memory 2. That is, the data read from the flash memory 2 is held in the buffer 9 until the host system 4 can receive the data. The data written to the flash memory 2 is held in the buffer 9 until the flash memory 2 is in a writable state.

フラッシュメモリインターフェースブロック10は、マイクロプロセッサ6によってROM12から読み出される各種処理を定義したコマンドセット(以下、シーケンスコマンドと言う)に従って、データの読み出しや書き込み等の各種処理を実行する。具体的には、フラッシュメモリインターフェースブロック10は、シーケンスコマンドに従って、フラッシュメモリ2のデータ入出力バスに対してデータ、アドレス情報、ステータス情報、内部コマンド等を入出力する。   The flash memory interface block 10 executes various processes such as data reading and writing in accordance with a command set that defines various processes read from the ROM 12 by the microprocessor 6 (hereinafter referred to as a sequence command). Specifically, the flash memory interface block 10 inputs / outputs data, address information, status information, internal commands, and the like to the data input / output bus of the flash memory 2 according to the sequence command.

ここで、フラッシュメモリ2は、コマンドラッチイネーブル(CLE)、アドレスラッチイネーブル(ALE)、ライトイネーブル(WE)、リードイネーブル(RE)等の制御信号端子を備えている。これらの制御信号端子とデータ入出力バスは内部バス14を介してフラッシュメモリコントローラ3に接続されている。コマンドラッチイネーブル(CLE)とアドレスラッチイネーブル(ALE)の制御信号端子に与えられる信号の信号レベルにより、データ入出力バスに供給される情報の種別が指定される。又、ライトイネーブル(WE)の制御信号端子に与えられる信号の信号レベルが遷移するタイミングでデータ、アドレス情報、内部コマンド等の情報がフラッシュメモリ2に取り込まれ、リードイネーブル(RE)の制御信号端子に与えられる信号の信号レベルが遷移するタイミングでデータ等の情報がフラッシュメモリ2から出力される。   Here, the flash memory 2 includes control signal terminals such as a command latch enable (CLE), an address latch enable (ALE), a write enable (WE), and a read enable (RE). These control signal terminals and the data input / output bus are connected to the flash memory controller 3 via the internal bus 14. The type of information supplied to the data input / output bus is specified by the signal levels of the signals applied to the control signal terminals of command latch enable (CLE) and address latch enable (ALE). Also, information such as data, address information, and internal commands is taken into the flash memory 2 at the timing when the signal level of the signal applied to the control signal terminal of the write enable (WE) transitions, and the control signal terminal of the read enable (RE) The information such as data is output from the flash memory 2 at the timing when the signal level of the signal applied to is changed.

ECCブロック11は、フラッシュメモリ2に書き込むデータに付加されるエラーコレクションコード(ECC)を生成するとともに、読み出しデータに付加されているエラーコレクションコードに基づいて、読み出したデータに含まれる誤りを検出・訂正する。なお、本実施の形態では、エラーコレクションコード(ECC)として、リードソロモン符号を使用し、10ビットを1シンボルとして、シンボル単位でエラーを訂正するものとする。   The ECC block 11 generates an error correction code (ECC) added to data to be written to the flash memory 2 and detects an error included in the read data based on the error correction code added to the read data. correct. In the present embodiment, it is assumed that a Reed-Solomon code is used as an error correction code (ECC), and 10 bits are used as one symbol to correct an error in symbol units.

ROM12は、不揮発性の記憶素子であり、フラッシュメモリコントローラ3の全体の動作を制御するプログラム、上述のシーケンスコマンド等を記憶している。   The ROM 12 is a non-volatile storage element, and stores a program for controlling the entire operation of the flash memory controller 3, the above-described sequence command, and the like.

図5は、ホストインターフェースブロック7及びフラッシュメモリインターフェースブロック10の構成を示すブロック図である。ホストインターフェースブロック7は、コマンドレジスタR1、セクタ数レジスタR2、LBAレジスタR3等を備えている。また、フラッシュメモリインターフェースブロック10は、物理ブロックアドレスレジスタR11、セクタ番号レジスタR12、カウンタR13等を備えている。更に、フラッシュメモリインターフェースブロック10は、後述する訂正データレジスタ(図8参照)を備えている。   FIG. 5 is a block diagram showing the configuration of the host interface block 7 and the flash memory interface block 10. The host interface block 7 includes a command register R1, a sector number register R2, an LBA register R3, and the like. The flash memory interface block 10 includes a physical block address register R11, a sector number register R12, a counter R13, and the like. Further, the flash memory interface block 10 includes a correction data register (see FIG. 8) described later.

コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3には、ホストシステム4から与えられる情報が書き込まれる。コマンドレジスタR1には、書き込みコマンド、読み出しコマンド等の外部コマンドが書き込まれる。セクタ数レジスタR2にはアクセス対象領域のセクタ数が書き込まれる。LBAレジスタR3には、アクセス対象領域の先頭のLBAが書き込まれる。   Information given from the host system 4 is written in the command register R1, the sector number register R2, and the LBA register R3. External commands such as a write command and a read command are written in the command register R1. The number of sectors in the access target area is written in the sector number register R2. In the LBA register R3, the head LBA of the access target area is written.

物理ブロックアドレスレジスタR11、セクタ番号レジスタR12及びカウンタR13には、ホストインターフェースブロック7のセクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて、フラッシュメモリ2内のアクセス対象領域を指示する情報が書き込まれる。
つまり、セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて特定されるLBAの範囲が複数の論理ブロックに跨っていない場合、そのLBAの範囲が含まれる論理ブロックと対応関係にある物理ブロック(消去済みブロックにデータを書き込む場合は消去済みブロック検索用テーブルを用いて選択した消去済みブロック)の物理ブロックアドレス(PBA)が物理ブロックアドレスレジスタR11に設定される。更に、そのLBAの範囲に含まれる先頭セクタのセクタ番号(SN)がセクタ番号レジスタR12に設定され、そのLBAの範囲に含まれセクタの数がカウンタR13に設定される。
In the physical block address register R11, the sector number register R12, and the counter R13, information that indicates an access target area in the flash memory 2 based on information written in the sector number register R2 and the LBA register R3 of the host interface block 7 Is written.
That is, when the LBA range specified based on the information written in the sector number register R2 and the LBA register R3 does not extend over a plurality of logical blocks, the physical relationship corresponding to the logical block including the LBA range is included. The physical block address (PBA) of the block (the erased block selected using the erased block search table when data is written in the erased block) is set in the physical block address register R11. Further, the sector number (SN) of the head sector included in the LBA range is set in the sector number register R12, and the number of sectors included in the LBA range is set in the counter R13.

尚、セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて特定されるLBAの範囲が複数の論理ブロックに跨っている場合は、論理ブロック毎に上記の設定が行われる。   If the LBA range specified based on the information written in the sector number register R2 and the LBA register R3 extends over a plurality of logical blocks, the above setting is performed for each logical block.

読み出し、書き込み等の動作では、物理ブロックアドレスレジスタR11及びセクタ番号レジスタR12に設定された情報に基づいて、フラッシュメモリ2に与えられるロウアドレス及びカラムアドレスが生成される。この読み出し、書き込み等の動作で1セクタ分のユーザデータ及び付加データがフラッシュメモリ2に入力又はフラッシュメモリ2から出力される毎にセクタ番号レジスタR12に設定されている値がインクリメント(1ずつ増加)され、カウンタR13に設定されている値がデクリメント(1ずつ減少)される。このセクタ番号レジスタR12に設定されている値のインクリメントとカウンタR13に設定されている値のデクリメントは、カウンタR13の設定値が0になるまで繰り返される。従って、セクタ番号レジスタR12に初期設定されたSNに基づいて特定されるページ内のセクタ領域から、カウンタR13に初期設定されたセクタ数分の領域が読み出し又は書き込みの対象となる。   In operations such as reading and writing, a row address and a column address given to the flash memory 2 are generated based on information set in the physical block address register R11 and the sector number register R12. The value set in the sector number register R12 is incremented (increased by 1) each time user data and additional data for one sector are input to or output from the flash memory 2 by operations such as reading and writing. Then, the value set in the counter R13 is decremented (decremented by 1). The increment of the value set in the sector number register R12 and the decrement of the value set in the counter R13 are repeated until the set value of the counter R13 becomes zero. Accordingly, areas corresponding to the number of sectors initially set in the counter R13 are read or written from the sector areas in the page specified based on the SN initially set in the sector number register R12.

本実施の形態のように、1個のページが4個のセクタ領域で構成され、1個の物理ブロックが64個のページで構成されている場合には、セクタ番号レジスタR12に、8ビットのSN(0〜255)が設定される。フラッシュメモリ2に与えるロウアドレスは、物理ブロックアドレスレジスタR11に設定されているPBAの下位側にセクタ番号レジスタR12に設定されているSNの上位6ビットを連結することにより求めることができる。一方、フラッシュメモリ2に与えるカラムアドレスはSNの下位2ビットに基づいて求めることができる。つまり、SNの下位2ビットに基づいて第1セクタ領域251〜第4セクタ領域254のいずれかのセクタ領域が特定され、第1セクタ領域251〜第4セクタ領域254のカラムアドレスは予め設定されているので、SNの下位2ビットに基づいてフラッシュメモリ2に与えるカラムアドレスを求めることができる。   As in this embodiment, when one page is composed of four sector areas and one physical block is composed of 64 pages, the sector number register R12 has an 8-bit value. SN (0-255) is set. The row address to be given to the flash memory 2 can be obtained by connecting the upper 6 bits of SN set in the sector number register R12 to the lower side of the PBA set in the physical block address register R11. On the other hand, the column address given to the flash memory 2 can be obtained based on the lower 2 bits of SN. That is, any one of the first sector area 251 to the fourth sector area 254 is specified based on the lower 2 bits of SN, and the column addresses of the first sector area 251 to the fourth sector area 254 are set in advance. Therefore, the column address to be given to the flash memory 2 can be obtained based on the lower 2 bits of SN.

次に、図6を参照して、1個のページに記憶されている4セクタのデータを、フラッシュメモリコントローラ3内のバッファ9を介して、異なる物理ブロック内のページ、又は同じ物理ブロック内の異なるページに転送(複写)する従来の転送処理について説明する。尚、転送元のページに記憶されているデータを読み出す処理は図6(a)を参照し、転送先のページにデータを書き込む処理は図6(b)を参照して説明する。又、説明を簡略化するため、フラッシュメモリ2から読み出されたデータには訂正不能な誤り(5シンボル以上の誤り)は含まれていないものとする。   Next, referring to FIG. 6, the data of 4 sectors stored in one page is transferred to a page in a different physical block or a same physical block via a buffer 9 in the flash memory controller 3. A conventional transfer process for transferring (copying) to different pages will be described. The process of reading data stored in the transfer source page will be described with reference to FIG. 6A, and the process of writing data to the transfer destination page will be described with reference to FIG. 6B. For simplicity of explanation, it is assumed that the data read from the flash memory 2 does not include uncorrectable errors (errors of 5 symbols or more).

この転送処理では、まず、転送元のページからデータを読み出すための情報が物理ブロックアドレスレジスタR11、セクタ番号レジスタR12及びカウンタR13に設定される。つまり、物理ブロックアドレスレジスタR11には、転送元のページが含まれる物理ブロックの物理ブロックアドレス(PBA)が設定される。セクタ番号レジスタR12は、転送元のページ内の第1セクタ領域251に対応するセクタ番号(SN)が設定される。カウンタR13には、1個のページに含まれるセクタ領域の数である4が設定される。   In this transfer process, first, information for reading data from the transfer source page is set in the physical block address register R11, the sector number register R12, and the counter R13. That is, the physical block address (PBA) of the physical block including the transfer source page is set in the physical block address register R11. In the sector number register R12, a sector number (SN) corresponding to the first sector area 251 in the transfer source page is set. The counter R13 is set to 4, which is the number of sector areas included in one page.

これらの設定に基づいて、読み出しコマンド、ロウアドレス(転送元のページに対応するロウアドレス)及びカラムアドレス(第1セクタ領域251に対応するカラムアドレス)がフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。これに応答して、ロウアドレスに対応するページに記憶されているデータが、メモリセルアレイ21からページレジスタ22に読み出される(複写される)。ページレジスタ22に読み出されたデータは、リードイネーブル(RE)端子に与えられる信号の信号レベルがハイからローに遷移するタイミングでデータ入出力バスから順次出力される。データ入出力バスに出力されるデータのカラムアドレスは、フラッシュメモリ2に与えたカラムアドレスから始まって、順次カウントアップされていく。   Based on these settings, a read command, a row address (a row address corresponding to the transfer source page), and a column address (a column address corresponding to the first sector area 251) are given to the flash memory 2 (of the flash memory 2). Input to the data input / output bus). In response to this, the data stored in the page corresponding to the row address is read (copied) from the memory cell array 21 to the page register 22. The data read to the page register 22 is sequentially output from the data input / output bus at the timing when the signal level of the signal applied to the read enable (RE) terminal changes from high to low. The column address of the data output to the data input / output bus starts from the column address given to the flash memory 2 and is sequentially counted up.

ページレジスタ22からは、第1セクタ領域251に記憶されているデータ、第1個別領域261に記憶されているエラーコレクションコード、第2セクタ領域252に記憶されているデータ、第2個別領域262に記憶されているエラーコレクションコード、第3セクタ領域253に記憶されているデータ、第3個別領域263に記憶されているエラーコレクションコード、第4セクタ領域254に記憶されているデータ、第4個別領域264に記憶されているエラーコレクションコードの順番でデータとエラーコレクションコードが読み出される。   From the page register 22, data stored in the first sector area 251, error correction code stored in the first individual area 261, data stored in the second sector area 252, data stored in the second individual area 262 Stored error collection code, data stored in third sector area 253, error collection code stored in third individual area 263, data stored in fourth sector area 254, fourth individual area Data and error correction codes are read out in the order of error correction codes stored in H.264.

第1セクタ領域251に記憶されているデータを読み出した後に、第1個別領域261に記憶されているエラーコレクションコードを読み出すときは、ランダムデータ出力コマンドとカラムアドレス(第1個別領域261に対応するカラムアドレス)がフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。第2セクタ領域252に記憶されているデータ、第2個別領域262に記憶されているエラーコレクションコード、第3セクタ領域253に記憶されているデータ、第3個別領域263に記憶されているエラーコレクションコード、第4セクタ領域254に記憶されているデータ、第4個別領域264に記憶されているエラーコレクションコードを読み出すときも、同様に、ランダムデータ出力コマンドとカラムアドレス(それぞれの領域に対応するカラムアドレス)がフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。 When reading the error correction code stored in the first individual area 261 after reading the data stored in the first sector area 251, the random data output command and the column address (corresponding to the first individual area 261) Column address) is applied to the flash memory 2 (input to the data input / output bus of the flash memory 2). Data stored in the second sector area 252, error collection code stored in the second individual area 262, data stored in the third sector area 253, error collection stored in the third individual area 263 Similarly, when reading the code, the data stored in the fourth sector area 254, and the error correction code stored in the fourth individual area 264, the random data output command and the column address (the column corresponding to each area) Address) is applied to the flash memory 2 (input to the data input / output bus of the flash memory 2).

第1セクタ領域251、第2セクタ領域252、第3セクタ領域253及び第4セクタ領域254から読み出されたデータは、バッファ9とECCブロック11の双方に入力される。第1個別領域261、第2個別領域262、第3個別領域263及び第4個別領域264から読み出されたエラーコレクションコードはECCブロック11に入力される。   Data read from the first sector area 251, the second sector area 252, the third sector area 253, and the fourth sector area 254 is input to both the buffer 9 and the ECC block 11. The error correction codes read from the first individual area 261, the second individual area 262, the third individual area 263, and the fourth individual area 264 are input to the ECC block 11.

第1セクタ領域251から読み出されたデータは、バッファ9の第1バッファ領域91に保持され、第2セクタ領域252から読み出されたデータは、バッファ9の第2バッファ領域92に保持され、第3セクタ領域253から読み出されたデータは、バッファ9の第3バッファ領域93に保持され、第4セクタ領域254から読み出されたデータは、バッファ9の第4バッファ領域94に保持される。 Data read from the first sector area 251 is held in the first buffer area 91 of the buffer 9, and data read from the second sector area 252 is held in the second buffer area 92 of the buffer 9, Data read from the third sector area 253 is held in the third buffer area 93 of the buffer 9, and data read from the fourth sector area 254 is held in the fourth buffer area 94 of the buffer 9. .

ECCブロック11は、第1セクタ領域251から読み出されたデータと第1個別領域261から読み出されたエラーコレクションコードに基づいて、第1セクタ領域251から読み出されたデータに含まれる誤りの検出を行い、誤りが検出された場合は、バッファ9の第1バッファ領域91に保持されているデータに対して誤りの訂正を行う。同様に、第2セクタ領域252、第3セクタ領域253及び第4セクタ領域254から読み出されたデータと第2個別領域262、第3個別領域263及び第4個別領域264から読み出されたエラーコレクションコードに基づいて、各データに含まれる誤りの検出を行い、誤りが検出された場合は、バッファ9の第2バッファ領域92〜第4バッファ領域94に保持されているデータに対して誤りの訂正を行う。   The ECC block 11 detects errors contained in the data read from the first sector area 251 based on the data read from the first sector area 251 and the error collection code read from the first individual area 261. If an error is detected, the error correction is performed on the data held in the first buffer area 91 of the buffer 9. Similarly, data read from the second sector area 252, third sector area 253, and fourth sector area 254 and error read from the second individual area 262, third individual area 263, and fourth individual area 264 Based on the collection code, an error included in each data is detected, and if an error is detected, an error is detected with respect to the data held in the second buffer area 92 to the fourth buffer area 94 of the buffer 9. Make corrections.

次に、転送先のページにデータを書き込むための情報が物理ブロックアドレスレジスタR11、セクタ番号レジスタR12及びカウンタR13に設定される。つまり、物理ブロックアドレスレジスタR11には、転送先のページが含まれる物理ブロックの物理ブロックアドレス(PBA)が設定される。セクタ番号レジスタR12は、転送先のページ内の第1セクタ領域251に対応するセクタ番号(SN)が設定される。カウンタR13には、1個のページに含まれるセクタ領域の数である4が設定される。   Next, information for writing data to the transfer destination page is set in the physical block address register R11, the sector number register R12, and the counter R13. That is, the physical block address (PBA) of the physical block including the transfer destination page is set in the physical block address register R11. In the sector number register R12, a sector number (SN) corresponding to the first sector area 251 in the transfer destination page is set. The counter R13 is set to 4, which is the number of sector areas included in one page.

これらの設定に基づいて、データ入力コマンド、ロウアドレス(転送先のページに対応するロウアドレス)及びカラムアドレス(第1セクタ領域251に対応するカラムアドレス)が、フラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。   Based on these settings, a data input command, a row address (a row address corresponding to the transfer destination page), and a column address (a column address corresponding to the first sector area 251) are given to the flash memory 2 (flash memory). 2 input / output bus).

続いて、バッファ9の第1バッファ領域91に保持されている1セクタ(512バイト)のデータが、バッファ9から順次出力される。バッファ9から出力されたデータはフラッシュメモリ2のデータ入出力バスに入力されると共に、ECCブロック11にも入力される。バッファ9の第1バッファ領域91に保持されている1セクタ(512バイト)のデータがフラッシュメモリ2のデータ入出力バスに入力された後に、ランダムデータ入力コマンドとカラムアドレス(第1個別領域261に対応するカラムアドレス)がフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。更に、ECCブロックから出力されるエラーコレクションコード(バッファ9の第1バッファ領域91に保持されている1セクタ(512バイト)のデータに基づいて生成されたエラーコレクションコード)がフラッシュメモリ2のデータ入出力バスに入力される。   Subsequently, data of one sector (512 bytes) held in the first buffer area 91 of the buffer 9 is sequentially output from the buffer 9. The data output from the buffer 9 is input to the data input / output bus of the flash memory 2 and also input to the ECC block 11. After one sector (512 bytes) of data held in the first buffer area 91 of the buffer 9 is input to the data input / output bus of the flash memory 2, a random data input command and a column address (in the first individual area 261) The corresponding column address) is given to the flash memory 2 (input to the data input / output bus of the flash memory 2). Further, an error correction code output from the ECC block (an error correction code generated based on one sector (512 bytes) data held in the first buffer area 91 of the buffer 9) is input to the data in the flash memory 2. Input to the output bus.

以下同様にして、ランダムデータ入力コマンド及びカラムアドレスと共に、バッファ9の第2バッファ領域92、第3バッファ領域93及び第4バッファ領域94に保持されているデータと、これらのデータに対応するエラーコレクションコード(ECCブロック11で生成されたエラーコレクションコード)がフラッシュメモリ2のデータ入出力バスに入力される。以上のようにして、データ入出力バスに入力されたデータとエラーコレクションコードはページレジスタ22に保持される。   In the same manner, the data held in the second buffer area 92, the third buffer area 93, and the fourth buffer area 94 of the buffer 9 together with the random data input command and the column address, and the error collection corresponding to these data The code (the error correction code generated by the ECC block 11) is input to the data input / output bus of the flash memory 2. As described above, the data input to the data input / output bus and the error correction code are held in the page register 22.

バッファ9の第1バッファ領域91、第2バッファ領域92、第3バッファ領域93及び第4バッファ領域94に保持されているデータと、これらのデータに対応するエラーコレクションコード(ECCブロック11で生成されたエラーコレクションコード)がフラッシュメモリ2のデータ入出力バスに入力された後に、書き込みコマンドがフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。   Data held in the first buffer area 91, the second buffer area 92, the third buffer area 93, and the fourth buffer area 94 of the buffer 9, and error correction codes (generated by the ECC block 11) corresponding to these data The error correction code) is input to the data input / output bus of the flash memory 2, and then a write command is applied to the flash memory 2 (input to the data input / output bus of the flash memory 2).

この書き込みコマンドに応答して、ページレジスタ22に保持されているデータが、メモリセルアレイ21内の転送先のページに書き込まれる(複写される)。   In response to this write command, the data held in the page register 22 is written (copied) to the transfer destination page in the memory cell array 21.

尚、ECCブロック11は、入力された1バイト(8ビット)単位のデータとエラーコレクションコードを10ビット単位のシンボルに変換して処理する。一方、エラーコレクションコードを出力するときは、10ビットのシンボルを1バイト(8ビット)単位の情報に変換して出力する。尚、1セクタのデータは、末尾に予め設定されている4ビットのダミーデータを付加することにより、410個のシンボルに変換される。一方、ECCブロック11で生成された8シンボルのエラーコレクションコードは、10バイトの情報に変換される。又、ECCブロック11は、記憶データが消去された物理ブロックにおけるデータとエラーコレクションコードの不整合を解消するため、生成した8シンボルのエラーコレクションコードに対してマスク処理を施している。このマスク処理では、1セクタのデータに含まれる全てのビットの論理値が1(消去状態の論理値)のときに、このデータに対する8シンボルのエラーコレクションコードに含まれる全てのビットの論理値が1(消去状態の論理値)になるような変換が行われる。つまり、1セクタのデータに含まれる全てのビットの論理値が1(消去状態の論理値)のときに、生成された8シンボルのエラーコレクションコードには論理値が0のビットが含まれているが、マスク処理が施された後は、全てのビットの論理値が1(消去状態の論理値)になる。一方、フラッシュメモリ2の冗長領域26から読み出され、ECCブロック11に入力されたエラーコレクションコードに対しては、生成時に施したマスク処理を解除するための処理が施される。 The ECC block 11 converts the input data of 1 byte (8 bits) and the error correction code into symbols of 10 bits and processes them. On the other hand, when an error correction code is output, a 10-bit symbol is converted into 1-byte (8-bit) information and output. One sector of data is converted into 410 symbols by adding 4-bit dummy data set in advance to the end. On the other hand, the 8-symbol error correction code generated by the ECC block 11 is converted into 10-byte information. In addition, the ECC block 11 performs mask processing on the generated 8-symbol error correction code in order to eliminate the mismatch between the data in the physical block from which the stored data has been erased and the error correction code. In this mask processing, when the logical values of all the bits included in the data of one sector are 1 (logical value in the erased state), the logical values of all the bits included in the error correction code of 8 symbols for this data are obtained. Conversion is performed so as to be 1 (logical value in the erased state). That is, when the logical value of all the bits included in the data of one sector is 1 (the logical value in the erased state), the generated error correction code of 8 symbols includes a bit whose logical value is 0. However, after the mask process is performed, the logical values of all bits become 1 (logical value in the erased state). On the other hand, the error correction code read from the redundant area 26 of the flash memory 2 and input to the ECC block 11 is subjected to processing for canceling the mask processing performed at the time of generation.

次に、本発明に係る転送処理を、図7を参照して説明する。この転送処理では、1個のページに記憶されている4セクタのデータが、異なる物理ブロック内のページ、又は同じ物理ブロック内の異なるページに転送(複写)される。尚、転送元のページに記憶されているデータを読み出す処理は図7(a)を参照し、転送先のページにデータを書き込む処理は図7(b)を参照して説明する。又、説明を簡略化するため、フラッシュメモリ2から読み出されたデータには訂正不能な誤り(5シンボル以上の誤り)は含まれていないものとする。 Next, transfer processing according to the present invention will be described with reference to FIG. In this transfer process, data of four sectors stored in one page is transferred (copied) to a page in a different physical block or a different page in the same physical block. The process of reading data stored in the transfer source page will be described with reference to FIG. 7A, and the process of writing data to the transfer destination page will be described with reference to FIG. 7B. For simplicity of explanation, it is assumed that the data read from the flash memory 2 does not include uncorrectable errors (errors of 5 symbols or more).

従来の転送処理の場合と同様に、転送元のページからデータを読み出すための情報が物理ブロックアドレスレジスタR11、セクタ番号レジスタR12及びカウンタR13に設定される。つまり、物理ブロックアドレスレジスタR11には、転送元のページが含まれる物理ブロックの物理ブロックアドレス(PBA)が設定される。セクタ番号レジスタR12は、転送元のページ内の第1セクタ領域251に対応するセクタ番号(SN)が設定される。カウンタR13には、1個のページに含まれるセクタ領域の数である4が設定される。   As in the conventional transfer process, information for reading data from the transfer source page is set in the physical block address register R11, the sector number register R12, and the counter R13. That is, the physical block address (PBA) of the physical block including the transfer source page is set in the physical block address register R11. In the sector number register R12, a sector number (SN) corresponding to the first sector area 251 in the transfer source page is set. The counter R13 is set to 4, which is the number of sector areas included in one page.

これらの設定に基づいて、読み出しコマンド、ロウアドレス(転送元のページに対応するロウアドレス)及びカラムアドレス(第1セクタ領域251に対応するカラムアドレス)がフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。これ応答して、ロウアドレスに対応するページに記憶されているデータが、メモリセルアレイ21からページレジスタ22に読み出される(複写される)。ページレジスタ22に読み出されたデータは、リードイネーブル(RE)端子に与えられる信号の信号レベルがハイからローに遷移するタイミングでデータ入出力バスから順次出力される。データ入出力バスに出力されるデータのカラムアドレスは、フラッシュメモリ2に与えたカラムアドレスから始まって、順次カウントアップされていく。   Based on these settings, a read command, a row address (a row address corresponding to the transfer source page), and a column address (a column address corresponding to the first sector area 251) are given to the flash memory 2 (of the flash memory 2). Input to the data input / output bus). In response, the data stored in the page corresponding to the row address is read (copied) from the memory cell array 21 to the page register 22. The data read to the page register 22 is sequentially output from the data input / output bus at the timing when the signal level of the signal applied to the read enable (RE) terminal changes from high to low. The column address of the data output to the data input / output bus starts from the column address given to the flash memory 2 and is sequentially counted up.

ここでフラッシュメモリ2に与える読み出しコマンドは、コピーバック用の読み出しコマンドであっても、通常の読み出しコマンドであってもよいが、コピーバック用の読み出しコマンドの方が好ましい。但し、通常の読み出しコマンドでなければ、ページレジスタ22に読み出されたデータを、データ入出力バスを介して出力させることができない仕様のフラッシュメモリの場合は、通常の読み出しコマンドを用いる。   Here, the read command given to the flash memory 2 may be a copy back read command or a normal read command, but a copy back read command is more preferable. However, if it is not a normal read command, the normal read command is used in the case of a flash memory having a specification in which the data read to the page register 22 cannot be output via the data input / output bus.

ページレジスタ22からは、第1セクタ領域251に記憶されているデータ、第1個別領域261に記憶されているエラーコレクションコード、第2セクタ領域252に記憶されているデータ、第2個別領域262に記憶されているエラーコレクションコード、第3セクタ領域253に記憶されているデータ、第3個別領域263に記憶されているエラーコレクションコード、第4セクタ領域254に記憶されているデータ、第4個別領域264に記憶されているエラーコレクションコードの順番でデータとエラーコレクションコードが読み出される。   From the page register 22, data stored in the first sector area 251, error correction code stored in the first individual area 261, data stored in the second sector area 252, data stored in the second individual area 262 Stored error collection code, data stored in third sector area 253, error collection code stored in third individual area 263, data stored in fourth sector area 254, fourth individual area Data and error correction codes are read out in the order of error correction codes stored in H.264.

第1セクタ領域251に記憶されているデータを読み出した後に、第1個別領域261に記憶されているエラーコレクションコードを読み出すときは、ランダムデータ出力コマンドとカラムアドレス(第1個別領域261に対応するカラムアドレス)がフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。第2セクタ領域252に記憶されているデータ、第2個別領域262に記憶されているエラーコレクションコード、第3セクタ領域253に記憶されているデータ、第3個別領域263に記憶されているエラーコレクションコード、第4セクタ領域254に記憶されているデータ、第4個別領域264に記憶されているエラーコレクションコードを読み出すときも、同様に、ランダムデータ出力コマンドとカラムアドレス(それぞれの領域に対応するカラムアドレス)がフラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。 When reading the error correction code stored in the first individual area 261 after reading the data stored in the first sector area 251, the random data output command and the column address (corresponding to the first individual area 261) Column address) is applied to the flash memory 2 (input to the data input / output bus of the flash memory 2). Data stored in the second sector area 252, error collection code stored in the second individual area 262, data stored in the third sector area 253, error collection stored in the third individual area 263 Similarly, when reading the code, the data stored in the fourth sector area 254, and the error correction code stored in the fourth individual area 264, the random data output command and the column address (the column corresponding to each area) Address) is applied to the flash memory 2 (input to the data input / output bus of the flash memory 2).

第1セクタ領域251、第2セクタ領域252、第3セクタ領域253及び第4セクタ領域254から読み出されたデータは、バッファ9とECCブロック11の双方に入力される。第1個別領域261、第2個別領域262、第3個別領域263及び第4個別領域264から読み出されたエラーコレクションコードはECCブロック11に入力される。   Data read from the first sector area 251, the second sector area 252, the third sector area 253, and the fourth sector area 254 is input to both the buffer 9 and the ECC block 11. The error correction codes read from the first individual area 261, the second individual area 262, the third individual area 263, and the fourth individual area 264 are input to the ECC block 11.

ECCブロック11は、第1セクタ領域251から読み出されたデータと第1個別領域261から読み出されたエラーコレクションコードに基づいて、第1セクタ領域251から読み出されたデータに含まれる誤りの検出を行う。誤りが検出された場合は、バッファ9に保持されている第1セクタ領域251から読み出されたデータに対する誤りの訂正を行う。更に、訂正されたビットを含むバイト単位の訂正データと、この訂正データに対応するカラムアドレスが訂正レジスタR20に書き込まれる。   The ECC block 11 detects errors contained in the data read from the first sector area 251 based on the data read from the first sector area 251 and the error collection code read from the first individual area 261. Perform detection. If an error is detected, error correction is performed on the data read from the first sector area 251 held in the buffer 9. Further, the correction data in byte units including the corrected bits and the column address corresponding to the correction data are written in the correction register R20.

例えば、第1セクタ領域251から読み出された512バイトのデータ(カラムアドレスが0〜511のデータ)の先頭から15バイト目のデータに含まれる一部のビットが訂正された場合は、15バイト目のデータ(訂正後のデータ)が訂正データとして訂正レジスタR20に書き込まれる。訂正レジスタR20には、この訂正データと共に訂正データのカラムアドレスとして14が書き込まれる。   For example, if some of the bits included in the 15th byte data from the beginning of the 512-byte data read from the first sector area 251 (data having a column address of 0 to 511) are corrected, 15 bytes The eye data (corrected data) is written as correction data in the correction register R20. 14 is written in the correction register R20 as the column address of the correction data together with the correction data.

第1セクタ領域251から読み出されたデータに対応する訂正データと、そのカラムアドレスが訂正レジスタR20に書き込まれ後に、第2セクタ領域252から読み出されたデータに含まれる誤りの検出が行われる。この誤りの検出は、第2セクタ領域252から読み出されたデータと第2個別領域262から読み出されたエラーコレクションコードに基づいて行われる。誤りが検出された場合は、バッファ9に保持されている第2セクタ領域252から読み出されたデータに対する誤りの訂正が行われる。更に、訂正されたビットを含むバイト単位の訂正データと、この訂正データに対応するカラムアドレスが訂正レジスタR20に書き込まれる。   After the correction data corresponding to the data read from the first sector area 251 and its column address are written to the correction register R20, an error included in the data read from the second sector area 252 is detected. . This error detection is performed based on the data read from the second sector area 252 and the error correction code read from the second individual area 262. When an error is detected, error correction is performed on the data read from the second sector area 252 held in the buffer 9. Further, the correction data in byte units including the corrected bits and the column address corresponding to the correction data are written in the correction register R20.

尚、第2セクタ領域252から読み出された512バイトのデータのカラムアドレスは、512〜1023に対応している。従って、第2セクタ領域252から読み出されたデータの先頭から15バイト目のデータが訂正データとして訂正レジスタR20に書き込まれた場合、訂正レジスタR20には、この訂正データのカラムアドレスとして526が書き込まれる。   The column address of 512-byte data read from the second sector area 252 corresponds to 512 to 1023. Therefore, when the 15th byte data from the beginning of the data read from the second sector area 252 is written as correction data in the correction register R20, 526 is written in the correction register R20 as the column address of the correction data. It is.

以下同様に、第3セクタ領域253及び第4セクタ領域254から読み出されたデータに誤りが含まれていた場合は、訂正データと、そのカラムアドレスが訂正レジスタR20に書き込まれる。又、第3セクタ領域253から読み出された512バイトのデータのカラムアドレスは、1024〜1535に対応し、第4セクタ領域254から読み出された512バイトのデータのカラムアドレスは、1536〜2047に対応している。又、冗長領域26(第1個別領域261〜第4個別領域264)から読み出されたエラーコレクションコードに含まれる誤りが検出された場合も、それに対応する訂正データと、そのカラムアドレスが訂正レジスタR20に書き込まれる。   Similarly, when an error is included in the data read from the third sector area 253 and the fourth sector area 254, the correction data and its column address are written in the correction register R20. The column address of 512-byte data read from the third sector area 253 corresponds to 1024 to 1535, and the column address of 512-byte data read from the fourth sector area 254 is 1536 to 2047. It corresponds to. Also, when an error included in the error correction code read from the redundant area 26 (first individual area 261 to fourth individual area 264) is detected, the corresponding correction data and its column address are stored in the correction register. Written to R20.

尚、本発明に係る転送処理では、従来の転送処理のように、第1セクタ領域251、第2セクタ領域252、第3セクタ領域253及び第4セクタ領域254の各領域から読み出したデータを、バッファ9内の異なる領域(例えば、第1バッファ領域91〜第4バッファ領域94)に保持しておく必要はなく、バッファ9内の同じ領域に、第1セクタ領域251、第2セクタ領域252、第3セクタ領域253及び第4セクタ領域254の各領域から読み出したデータを、順次上書きしていってもよい。   In the transfer process according to the present invention, data read from each of the first sector area 251, the second sector area 252, the third sector area 253, and the fourth sector area 254, as in the conventional transfer process, It is not necessary to hold in different areas (for example, the first buffer area 91 to the fourth buffer area 94) in the buffer 9, and the first sector area 251, the second sector area 252, Data read from each of the third sector area 253 and the fourth sector area 254 may be sequentially overwritten.

上述のようにして訂正レジスタR20に訂正データとそのカラムアドレスが書き込まれた後に、転送先のページへのデータの書き込みが開始される。尚、転送元のページからデータを読み出すときに、コピーバック用の読み出しコマンドではなく、通常の読み出しコマンドでデータを読み出した場合は、以下の処理を開始する前に、コピーバック用の読み出しコマンドにより、転送元のページに記憶されているデータをメモリセルアレイ21からページレジスタ22に読み出しておかなければならない。   After the correction data and its column address are written in the correction register R20 as described above, the writing of data to the transfer destination page is started. When reading data from the transfer source page, if the data is read using a normal read command instead of a copyback read command, the copyback read command should be used before starting the following processing. The data stored in the transfer source page must be read from the memory cell array 21 to the page register 22.

次に、転送先のページにデータを書き込むための情報が物理ブロックアドレスレジスタR11、セクタ番号レジスタR12に設定される。つまり、物理ブロックアドレスレジスタR11には、転送先のページが含まれる物理ブロックの物理ブロックアドレス(PBA)が設定される。セクタ番号レジスタR12は、転送先のページ内の第1セクタ領域251に対応するセクタ番号(SN)が設定される。   Next, information for writing data to the transfer destination page is set in the physical block address register R11 and the sector number register R12. That is, the physical block address (PBA) of the physical block including the transfer destination page is set in the physical block address register R11. In the sector number register R12, a sector number (SN) corresponding to the first sector area 251 in the transfer destination page is set.

物理ブロックアドレスレジスタR11及びセクタ番号レジスタR12に設定されている情報、並びに訂正レジスタR20に書き込まれている訂正データのカラムアドレスに基づいてコピーバック書き込みするためのデータ入力コマンド、ロウアドレス(転送先のページに対応するロウアドレス)及びカラムアドレス(訂正レジスタR20に書き込まれている先頭の訂正データの書き込み先に対応するカラムアドレス)が、フラッシュメモリ2に与えられる(フラッシュメモリ2のデータ入出力バスに入力される)。続いて、訂正レジスタR20に書き込まれている先頭の訂正データがフラッシュメモリ2のデータ入出力バスに入力される。   Based on the information set in the physical block address register R11 and the sector number register R12 and the column address of the correction data written in the correction register R20, a data input command for copyback writing, a row address (transfer destination A row address corresponding to a page) and a column address (a column address corresponding to a write destination of the first correction data written in the correction register R20) are given to the flash memory 2 (to the data input / output bus of the flash memory 2). Entered). Subsequently, the first correction data written in the correction register R 20 is input to the data input / output bus of the flash memory 2.

この後、ランダムデータ入力コマンドと共に、訂正レジスタR20に書き込まれている2番目以降の訂正データとそのカラムアドレスがフラッシュメモリ2のデータ入出力バスに順次入力される。この処理により、ページレジスタ22に保持されている転送元のデータの一部が訂正レジスタR20に保持されている訂正データによって置き換えられる。この置き換えにより、ページレジスタ22に保持されている転送元のデータに含まれる誤りが訂正される。   Thereafter, the second and subsequent correction data written in the correction register R20 and the column address thereof are sequentially input to the data input / output bus of the flash memory 2 together with the random data input command. By this processing, a part of the transfer source data held in the page register 22 is replaced with the correction data held in the correction register R20. By this replacement, the error included in the transfer source data held in the page register 22 is corrected.

訂正レジスタR20に書き込まれている全ての訂正データがフラッシュメモリ2のデータ入出力バスに入力された後に、コピーバック書き込みするための書き込みコマンドがフラッシュメモリ2のデータ入出力バスに入力される。この書き込みコマンドに応答して、ページレジスタ22に保持されている転送元のデータが、メモリセルアレイ21内の転送先のページに書き込まれる(複写される)。   After all the correction data written in the correction register R20 is input to the data input / output bus of the flash memory 2, a write command for copy back writing is input to the data input / output bus of the flash memory 2. In response to this write command, the transfer source data held in the page register 22 is written (copied) to the transfer destination page in the memory cell array 21.

次に、訂正レジスタR20に書き込まれている訂正データで、ページレジスタ22に保持されているデータの一部を置き換える処理を詳細に説明する。訂正レジスタR20には、ページレジスタ22に保持されている転送元のデータを訂正するための訂正データと、この訂正データに対応するカラムアドレスが書き込まれている。つまり、訂正レジスタR20には、ページレジスタ22のカラムアドレス単位の訂正データが書き込まれている。従って、図2に示したように、1個のページが2048バイトのユーザ領域25と64バイトの冗長領域26で構成されているデータ入出力バスが8ビットのフラッシュメモリ2の場合、訂正レジスタR20には、8ビット単位で訂正データが書き込まれ、書き込まれた各訂正データのカラムアドレスは0〜2111のいずれかに対応する。   Next, a process for replacing a part of the data held in the page register 22 with the correction data written in the correction register R20 will be described in detail. In the correction register R20, correction data for correcting the transfer source data held in the page register 22 and a column address corresponding to the correction data are written. That is, correction data in the column address unit of the page register 22 is written in the correction register R20. Therefore, as shown in FIG. 2, when the data input / output bus in which one page is composed of the 2048-byte user area 25 and the 64-byte redundant area 26 is the 8-bit flash memory 2, the correction register R20 The correction data is written in units of 8 bits, and the column address of each written correction data corresponds to one of 0 to 2111.

図8は、訂正レジスタR20に書き込まれている訂正データ(訂正データ#0〜訂正データ#n−1)及びカラムアドレス(カラムアドレス#0〜カラムアドレスn−1)と、フラッシュメモリ2のデータ入出力バスに入力されるカラムアドレス及び訂正データの対応関係を示している。ここで、訂正データ#0〜訂正データ#n−1は、ページレジスタ22に保持されているデータに上書きされる1バイト(8ビット)のデータである。訂正データ#0〜訂正データ#n−1が上書きされるページレジスタ22内の位置は、カラムアドレス#0〜カラムアドレスn−1によって特定される。図8に示した例では、訂正データ#0にはカラムアドレス#0が対応し、訂正データ#1にはカラムアドレス#1が対応し、以下同様に、訂正データ#n−1にはカラムアドレスn−1が対応している。 FIG. 8 shows correction data (correction data # 0 to correction data # n-1) and column addresses (column address # 0 to column address n-1) written in the correction register R20 and data input to the flash memory 2. The correspondence relationship between the column address and correction data input to the output bus is shown. Here, the correction data # 0 to the correction data # n−1 are 1 byte (8 bits) data overwritten on the data held in the page register 22. The position in the page register 22 where the correction data # 0 to correction data # n-1 is overwritten is specified by the column address # 0 to the column address n-1. In the example shown in FIG. 8, the column address # 0 corresponds to the correction data # 0, the column address # 1 corresponds to the correction data # 1, and similarly, the column address # 1 corresponds to the correction data # n-1. n-1 corresponds.

次に、フラッシュメモリ2のデータ入出力バスに入力されるカラムアドレス及び訂正データについて説明する。最初の訂正データ(訂正データ#0)を入力するときは、データ入力コマンド(In−cmd)、カラムアドレス(C−add)、ロウアドレス(R−add)及び訂正データ(Data)がこの順番でデータ入出力バスに入力される。ページレジスタ22に保持されているデータの書き込み先のページ(転送先のページ)は、ここで与えるカラムアドレス(C−add)により特定される。この後の訂正データ(訂正データ#1〜訂正データ#n−1)を入力するときは、ランダムデータ入力コマンド(In−cmd’)、カラムアドレス(C−add)、ロウアドレス(R−add)及び訂正データ(Data)がこの順番でデータ入出力バスに入力される。   Next, the column address and correction data input to the data input / output bus of the flash memory 2 will be described. When inputting the first correction data (correction data # 0), the data input command (In-cmd), column address (C-add), row address (R-add), and correction data (Data) are in this order. Input to the data input / output bus. The page to which the data held in the page register 22 is written (transfer destination page) is specified by the column address (C-add) given here. When inputting the subsequent correction data (correction data # 1 to correction data # n-1), a random data input command (In-cmd '), a column address (C-add), and a row address (R-add) And correction data (Data) is input to the data input / output bus in this order.

図8に示したステップ#0では、カラムアドレス(C−add)としてカラムアドレス#0が入力され、訂正データ(Data)として訂正データ#0が入力される。ステップ#1では、カラムアドレス(C−add)としてカラムアドレス#1が入力され、訂正データ(Data)として訂正データ#1が入力される。例えば、カラムアドレス#0が256で、カラムアドレス#1が511の場合、カラムアドレスが256の1バイトのデータが訂正データ#0で置き換えられ、カラムアドレスが511の1バイトのデータが訂正データ#0で置き換えられる。   In step # 0 shown in FIG. 8, column address # 0 is input as the column address (C-add), and correction data # 0 is input as correction data (Data). In step # 1, column address # 1 is input as column address (C-add), and correction data # 1 is input as correction data (Data). For example, when column address # 0 is 256 and column address # 1 is 511, 1-byte data with column address 256 is replaced with correction data # 0, and 1-byte data with column address 511 is corrected data #. Replaced with 0.

以下同様に、訂正レジスタR20に書き込まれている訂正データとカラムアドレスが入力され、ステップ#n−1では、カラムアドレス(C−add)としてカラムアドレス#n−1が入力され、訂正データ(Data)として訂正データ#n−1が入力される。ステップ#n−1では、更に、書き込みコマンド(P−cmd)が入力され、この書き込みコマンド(P−cmd)に応答して、ページレジスタ22に保持されているデータが、ステップ#0で入力されたロウアドレス(R−add)に対応するメモリセルアレイ21内のページに書き込まれる(複写される)。 Similarly, the correction data and the column address written in the correction register R20 are input. In step # n-1, the column address # n-1 is input as the column address (C-add), and the correction data (Data ) Is input correction data # n-1. In step # n-1, a write command (P-cmd) is further input. In response to the write command (P-cmd), the data held in the page register 22 is input in step # 0. The data is written (copied) in the page in the memory cell array 21 corresponding to the row address (R-add).

上述のように、図8に示した例では、ページレジスタ22に保持されている2112バイトのデータのうちのnバイトのデータが、訂正レジスタR20に書き込まれている訂正データ#0〜訂正データ#n−1で置き換えられた後に、転送先のページに書き込まれる。つまり、この処理では、n個の訂正データ(nバイトの訂正データ)をフラッシュメモリ2に転送することにより、ページレジスタ22に保持されている2112バイトのデータに含まれる誤りが訂正される。ここで、ページレジスタ22に保持されている2112バイトのデータは、転送元のページに記憶されているデータなので、実質的には、n個の訂正データ(nバイトの訂正データ)により転送元のページに記憶されているデータに含まれる誤りが訂正されたことになる。   As described above, in the example illustrated in FIG. 8, n bytes of the 2112 bytes of data held in the page register 22 are corrected data # 0 to corrected data # written in the correction register R20. After being replaced with n-1, the data is written to the transfer destination page. In other words, in this process, n correction data (n-byte correction data) is transferred to the flash memory 2, whereby the error contained in the 2112-byte data held in the page register 22 is corrected. Here, the 2112-byte data held in the page register 22 is data stored in the transfer source page, and therefore, the transfer source is substantially determined by n correction data (n-byte correction data). An error included in the data stored in the page is corrected.

以上に説明したように、本発明に係る転送処理では、転送元のページから読み出されたデータはページレジスタ22に保持され、このデータに誤りがあるときは、ページレジスタ22に保持されているこのデータの一部(誤り部分)がメモリコントローラ側から与える訂正データで置き換えられ、この置き換えにより誤りが訂正されたデータが転送先のページに書き込まれる。従って、メモリコントローラ側から訂正データだけを与えることにより、転送元のページが記憶されているデータの誤りを訂正することができる。   As described above, in the transfer process according to the present invention, the data read from the transfer source page is held in the page register 22, and when this data has an error, it is held in the page register 22. A part (error part) of this data is replaced with the correction data given from the memory controller side, and the data whose error is corrected by this replacement is written to the transfer destination page. Therefore, by giving only correction data from the memory controller side, it is possible to correct an error in data in which the transfer source page is stored.

尚、上記実施の形態においては、エラーコレクションコードとしてリードソロモン符号を使用したが、エラーコレクションコードはBCH符号、ハミング符号等の他の符号化方式のエラーコレクションコードであってもよい。他の符号化方式のエラーコレクションコードの場合であっても、訂正されるビットを含むカラムアドレス単位(例えば、1バイト単位)の訂正データとそのカラムアドレスを訂正レジスタR20に書き込むようにすれば同様に実施することができる。   In the above embodiment, the Reed-Solomon code is used as the error collection code. However, the error collection code may be an error collection code of another encoding method such as a BCH code or a Hamming code. Even in the case of error correction codes of other encoding methods, the same applies if correction data in column address units (for example, in units of 1 byte) including the bits to be corrected and their column addresses are written in the correction register R20. Can be implemented.

本発明の実施の形態に係るフラッシュメモリシステムの構成を示すブロック図である。1 is a block diagram showing a configuration of a flash memory system according to an embodiment of the present invention. フラッシュメモリのアドレス空間の構造を示す図である。It is a figure which shows the structure of the address space of flash memory. ページの記憶領域の構成を説明する図である。It is a figure explaining the structure of the storage area of a page. ホストシステム側のアドレス空間とフラッシュメモリ側のアドレス空間の対応関係を示す図である。It is a figure which shows the correspondence of the address space on the host system side, and the address space on the flash memory side. ホストインターフェースブロックとフラッシュメモリインターフェースブロックの構成を示すブロック図である。It is a block diagram which shows the structure of a host interface block and a flash memory interface block. 従来の転送処理の手順を説明するための図である。It is a figure for demonstrating the procedure of the conventional transfer process. 本発明の実施の形態に係る転送処理の手順を説明するための図である。It is a figure for demonstrating the procedure of the transfer process which concerns on embodiment of this invention. 本発明の実施の形態に係る訂正データ及びカラムアドレスと、カラムアドレス及び訂正データの対応関係とを示した図である。It is the figure which showed the correction data and column address which concern on embodiment of this invention, and the correspondence of a column address and correction data.

符号の説明Explanation of symbols

1 フラッシュメモリシステム
2 フラッシュメモリ
3 フラッシュメモリコントローラ
4 ホストシステム
6 マイクロプロセッサ
7 ホストインターフェースブロック
8 ワークエリア
9 バッファ
10 フラッシュメモリインタフェースブロック
11 ECCブロック
21 メモリセルアレイ
22 ページレジスタ
1 Flash memory system 2 Flash memory 3 Flash memory controller 4 Host system 6 Microprocessor 7 Host interface block 8 Work area 9 Buffer 10 Flash memory interface block 11 ECC block 21 Memory cell array 22 Page register

Claims (5)

複数のページで構成されたメモリセルアレイと、該メモリセルアレイに書き込むデータ又は該メモリセルアレイから読み出したデータをページ単位で保持する内部レジスタとを備えるフラッシュメモリに対して、前記メモリセルアレイ内の第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する読み出し指示と、該読み出し指示に基づいて前記内部レジスタに読み出されたデータを前記第1のページとは異なる第2のページに書き込むことを指示する書き込み指示とを与えるデータ複写指示手段と、
前記第1のページに記憶されているデータを、前記フラッシュメモリのデータバスを介して前記フラッシュメモリから読み出す読み出し手段と、
前記読み出し手段により前記フラッシュメモリから読み出された前記第1のページに記憶されているデータに含まれる誤りの訂正値を求める誤り訂正手段と、
前記データバスのバス幅に対応するビット数単位で、前記訂正値を含む訂正データを保持する訂正データ保持手段と、
前記訂正データ保持手段に保持されている前記訂正データを、前記データバスを介して前記フラッシュメモリに転送し、前記内部レジスタに保持されているデータの一部を前記訂正データで置き換えるデータ置換手段とを備え、
前記データ複写指示手段は、前記第1のページに記憶されているデータに誤りが含まれている場合に、前記第1のページから前記内部レジスタに読み出されたデータの一部が前記訂正データで置き換えられた後に、前記第2のページに書き込むことを指示する書き込み指示を前記フラッシュメモリに与えることを特徴とするメモリコントローラ。
For a flash memory comprising a memory cell array composed of a plurality of pages and an internal register for holding data to be written to the memory cell array or data read from the memory cell array in units of pages, the first in the memory cell array A read instruction for instructing reading of data stored in a page to the internal register, and data read into the internal register based on the read instruction are transferred to a second page different from the first page Data copying instruction means for giving a writing instruction for instructing writing;
Reading means for reading data stored in the first page from the flash memory via the data bus of the flash memory;
Error correction means for obtaining a correction value of an error included in the data stored in the first page read from the flash memory by the reading means;
Correction data holding means for holding correction data including the correction value in units of bits corresponding to the bus width of the data bus;
Data replacement means for transferring the correction data held in the correction data holding means to the flash memory via the data bus and replacing a part of the data held in the internal register with the correction data; With
When the data stored in the first page includes an error, a part of the data read from the first page to the internal register is the correction data A memory controller, wherein after the replacement, the flash memory is provided with a write instruction for instructing writing to the second page.
前記訂正データ保持手段は、前記訂正データで置き換えられるデータの前記内部レジスタ内での位置を示す位置情報を保持し、前記データ置換手段は該位置情報に対応する部分のデータを前記訂正データで置き換えることを特徴とする請求項1に記載のメモリコントローラ。   The correction data holding unit holds position information indicating a position in the internal register of data to be replaced with the correction data, and the data replacement unit replaces a portion of data corresponding to the position information with the correction data. The memory controller according to claim 1. 請求項1又は2に記載のメモリコントローラと、
フラッシュメモリと、
を備えるフラッシュメモリシステム。
Memory controller according to claim 1 or 2,
Flash memory,
A flash memory system.
複数のページで構成されたメモリセルアレイと、該メモリセルアレイに書き込むデータ又は該メモリセルアレイから読み出したデータをページ単位で保持する内部レジスタとを備えるフラッシュメモリに対して、前記メモリセルアレイ内の第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する第1のステップと、
前記第1のステップで前記内部レジスタに読み出されたデータを、前記フラッシュメモリのデータバスを介して前記内部レジスタから読み出す第2のステップと、
前記第2のステップで読み出されたデータに含まれる誤りの訂正値を求める第3のステップと、
前記第3のステップで求められた前記訂正値を含む訂正データを、前記データバスのバス幅に対応するビット数単位で保持する第4のステップと、
前記第4のステップで保持された前記訂正データを、前記データバスを介して前記内部レジスタに転送し、前記内部レジスタに保持されているデータの一部を前記訂正データで置き換える第5のステップと、
前記第5のステップで前記内部レジスタに保持されているデータの一部が前記訂正データで置き換えられた後に、前記フラッシュメモリに対して、前記内部レジスタに保持されているデータを前記第1のページとは異なる第2のページに書き込むことを指示する第6のステップと、
を含むことを特徴とするフラッシュメモリの制御方法。
For a flash memory comprising a memory cell array composed of a plurality of pages and an internal register for holding data to be written to the memory cell array or data read from the memory cell array in units of pages, the first in the memory cell array A first step for instructing reading of data stored in a page to the internal register;
A second step of reading data read into the internal register in the first step from the internal register via a data bus of the flash memory;
A third step for obtaining a correction value of an error included in the data read in the second step;
A fourth step of holding correction data including the correction value obtained in the third step in units of bits corresponding to the bus width of the data bus;
A fifth step of transferring the correction data held in the fourth step to the internal register via the data bus, and replacing a part of the data held in the internal register with the correction data; ,
After a part of the data held in the internal register in the fifth step is replaced with the correction data, the data held in the internal register is transferred to the first page with respect to the flash memory. A sixth step for instructing to write to a second page different from
A method for controlling a flash memory, comprising:
複数のページで構成されたメモリセルアレイと、該メモリセルアレイに書き込むデータ又は該メモリセルアレイから読み出したデータをページ単位で保持する内部レジスタとを備えるフラッシュメモリに対して、前記メモリセルアレイ内の第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する第1のステップと、
前記第1のステップで前記内部レジスタに読み出されたデータを、前記フラッシュメモリのデータバスを介して前記内部レジスタから読み出す第2のステップと、
前記第2のステップで読み出されたデータに含まれる誤りの訂正値を求める第3のステップと、
前記第3のステップで求められた前記訂正値を含む訂正データを、前記データバスのバス幅に対応するビット数単位で保持する第4のステップと、
前記フラッシュメモリに対して、前記第1のページに記憶されているデータを前記内部レジスタに読み出すことを指示する第5のステップと、
前記第4のステップで保持された前記訂正データを、前記第5のステップで前記内部レジスタに読み出されたデータが保持されている前記内部レジスタに前記データバスを介して転送し、前記内部レジスタに保持されているデータの一部を前記訂正データで置き換える第6のステップと、
前記第6のステップで前記内部レジスタに保持されているデータの一部が前記訂正データで置き換えられた後に、前記フラッシュメモリに対して、前記内部レジスタに保持されているデータを前記第1のページとは異なる第2のページに書き込むことを指示する第7のステップと、
を含むことを特徴とするフラッシュメモリの制御方法。
For a flash memory comprising a memory cell array composed of a plurality of pages and an internal register for holding data to be written to the memory cell array or data read from the memory cell array in units of pages, the first in the memory cell array A first step for instructing reading of data stored in a page to the internal register;
A second step of reading data read into the internal register in the first step from the internal register via a data bus of the flash memory;
A third step for obtaining a correction value of an error included in the data read in the second step;
A fourth step of holding correction data including the correction value obtained in the third step in units of bits corresponding to the bus width of the data bus;
A fifth step for instructing the flash memory to read the data stored in the first page into the internal register;
The correction data held in the fourth step is transferred via the data bus to the internal register in which the data read in the internal register in the fifth step is held, and the internal register A sixth step of replacing a part of the data held in the data with the corrected data;
After a part of the data held in the internal register in the sixth step is replaced with the correction data, the data held in the internal register is transferred to the first page with respect to the flash memory. A seventh step for instructing to write to a second page different from
A method for controlling a flash memory, comprising:
JP2006348664A 2006-12-25 2006-12-25 Memory controller, flash memory system, and flash memory control method Expired - Fee Related JP4655034B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006348664A JP4655034B2 (en) 2006-12-25 2006-12-25 Memory controller, flash memory system, and flash memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006348664A JP4655034B2 (en) 2006-12-25 2006-12-25 Memory controller, flash memory system, and flash memory control method

Publications (2)

Publication Number Publication Date
JP2008158908A true JP2008158908A (en) 2008-07-10
JP4655034B2 JP4655034B2 (en) 2011-03-23

Family

ID=39659725

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006348664A Expired - Fee Related JP4655034B2 (en) 2006-12-25 2006-12-25 Memory controller, flash memory system, and flash memory control method

Country Status (1)

Country Link
JP (1) JP4655034B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010198592A (en) * 2009-01-29 2010-09-09 Nec Corp Mobile terminal apparatus, software update method, operation control method, and program
US8255643B2 (en) 2009-02-24 2012-08-28 Samsung Electronics Co., Ltd. Memory system and data processing method thereof
CN107195329A (en) * 2017-05-17 2017-09-22 西安紫光国芯半导体有限公司 The wrong method and DRAM of storage array in DRAM are corrected in read operation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10302485A (en) * 1997-04-28 1998-11-13 Hitachi Inf Technol:Kk Information processor having flash memory
JP2004311010A (en) * 2003-04-03 2004-11-04 Samsung Electronics Co Ltd Flash memory device with error correction function
JP2006244017A (en) * 2005-03-02 2006-09-14 Matsushita Electric Ind Co Ltd Data copy method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10302485A (en) * 1997-04-28 1998-11-13 Hitachi Inf Technol:Kk Information processor having flash memory
JP2004311010A (en) * 2003-04-03 2004-11-04 Samsung Electronics Co Ltd Flash memory device with error correction function
JP2006244017A (en) * 2005-03-02 2006-09-14 Matsushita Electric Ind Co Ltd Data copy method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010198592A (en) * 2009-01-29 2010-09-09 Nec Corp Mobile terminal apparatus, software update method, operation control method, and program
US8255643B2 (en) 2009-02-24 2012-08-28 Samsung Electronics Co., Ltd. Memory system and data processing method thereof
KR101563647B1 (en) 2009-02-24 2015-10-28 삼성전자주식회사 Memory system and data processing method thereof
CN107195329A (en) * 2017-05-17 2017-09-22 西安紫光国芯半导体有限公司 The wrong method and DRAM of storage array in DRAM are corrected in read operation
CN107195329B (en) * 2017-05-17 2024-04-02 西安紫光国芯半导体有限公司 Method for correcting errors of memory array in DRAM during read operation and DRAM

Also Published As

Publication number Publication date
JP4655034B2 (en) 2011-03-23

Similar Documents

Publication Publication Date Title
JP5592478B2 (en) Nonvolatile storage device and memory controller
JP4956230B2 (en) Memory controller
JP2007094639A (en) Memory controller and flash memory system
JP4655034B2 (en) Memory controller, flash memory system, and flash memory control method
JP4235646B2 (en) Memory controller and flash memory system
JP4501881B2 (en) Memory controller and flash memory system
JP2007094571A (en) Memory controller, flash memory system, and control method of flash memory
JP4513786B2 (en) Memory controller, memory system, and memory control method
JP4241741B2 (en) Memory controller and flash memory system
JP4582078B2 (en) Memory controller, flash memory system, and flash memory control method
JP4697146B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP3934659B1 (en) Memory controller and flash memory system
JP4692843B2 (en) Memory controller, flash memory system, and flash memory control method
JP2005292925A (en) Memory controller, flash memory system, and control method for flash memory
JP4254933B2 (en) Memory controller and flash memory system
JP2008251063A (en) Storage device
JP4000124B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2006244017A (en) Data copy method
JP4332108B2 (en) Memory controller, flash memory system, and flash memory control method
JP4304167B2 (en) Memory controller, flash memory system, and flash memory control method
JP4273109B2 (en) Memory controller and flash memory system
JP4366283B2 (en) Memory controller and flash memory system including the memory controller
JP2007066119A (en) Memory controller, flash memory system and control method of flash memory
JP4245594B2 (en) Memory controller and flash memory system
JP4227989B2 (en) Memory controller and flash memory system

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100526

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101116

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101124

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101207

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140107

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4655034

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees