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

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

Info

Publication number
JP4661497B2
JP4661497B2 JP2005280561A JP2005280561A JP4661497B2 JP 4661497 B2 JP4661497 B2 JP 4661497B2 JP 2005280561 A JP2005280561 A JP 2005280561A JP 2005280561 A JP2005280561 A JP 2005280561A JP 4661497 B2 JP4661497 B2 JP 4661497B2
Authority
JP
Japan
Prior art keywords
block
page
logical address
logical
data
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.)
Active
Application number
JP2005280561A
Other languages
Japanese (ja)
Other versions
JP2007094571A (en
Inventor
俊一 花房
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 JP2005280561A priority Critical patent/JP4661497B2/en
Publication of JP2007094571A publication Critical patent/JP2007094571A/en
Application granted granted Critical
Publication of JP4661497B2 publication Critical patent/JP4661497B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Description

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

近年、メモリーカードやシリコンディスク等の形態でメモリシステムに使用される半導体メモリに、フラッシュメモリが広く採用されている。フラッシュメモリに格納されたデータは、電力が供給されていないときでも保持されていることが要求される。
NAND型フラッシュメモリは、上記のメモリシステムで特に多く用いられるフラッシュメモリである。
NAND型フラッシュメモリに含まれている複数のメモリセルのそれぞれは、消去状態のときに論理値“1”を示し、書き込状態の時に“0”を示す。そして、複数のメモリセルは、他のメモリセルとは独立して消去状態から書き込状態へと変化することができる。
In recent years, flash memories have been widely adopted as semiconductor memories used in memory systems in the form of memory cards, silicon disks, and the like. Data stored in the flash memory is required to be retained even when power is not supplied.
The NAND flash memory is a flash memory that is particularly frequently used in the above memory system.
Each of the plurality of memory cells included in the NAND flash memory indicates a logical value “1” when in an erased state and indicates “0” when in a written state. The plurality of memory cells can change from the erased state to the written state independently of the other memory cells.

これとは対照的に、書き込状態から消去状態へと変化するときには、各メモリセルは他のメモリセルと独立して変化することができない。このときには、ブロックと称される予め定められた所定数のメモリセルが、全て同時に消去状態になる。この一括消去動作は、一般的に、「ブロック消去」と称されている。NAND型フラッシュメモリに対する書き込み処理若しくは読み出し処理は、ページと称される予め定められた数のメモリセル単位に処理が行われる。消去処理の単位であるブロックは複数のページで構成されている。   In contrast, when changing from a write state to an erase state, each memory cell cannot change independently of the other memory cells. At this time, all of a predetermined number of memory cells called blocks are simultaneously erased. This collective erasure operation is generally called “block erase”. The write process or read process for the NAND flash memory is performed in units of a predetermined number of memory cells called pages. A block which is a unit of erasure processing is composed of a plurality of pages.

NAND型フラッシュメモリでは、上記のようにブロック単位で消去処理が行われるため、通常、ホストシステム側から与えられるアドレスとフラッシュメモリ内でのアドレスとの対応関係を、ブロック単位で管理している。例えば、下記特許文献1では、ホストシステム側から与えられるアドレスに基づく論理ブロックアドレスと、フラッシュメモリ内でのブロックアドレスである物理ブロックアドレスとを1対1に対応させ、その変換を行っている。
特開2003−76605号公報
In the NAND flash memory, the erase process is performed in units of blocks as described above. Therefore, the correspondence between the addresses given from the host system side and the addresses in the flash memory is usually managed in units of blocks. For example, in Patent Document 1 below, a logical block address based on an address given from the host system side and a physical block address, which is a block address in a flash memory, are associated with each other in a one-to-one correspondence.
JP 2003-76605 A

NAND型フラッシュメモリは、このような特徴を有するため、通常、データの書き替を行なう場合には、ブロック消去されている消去済ブロックに新たなデータ(書き替え後のデータ)を書き込み、古いデータ(書き替え前のデータ)が書き込まれていたブロックを消去するという処理を行なっている。
フラッシュメモリの任意の物理ブロックに記憶された元のユーザデータを新たなユーザデータに書き替える場合、その書き替え対象の元のユーザデータの書き込まれたページのみを書き替えることができず、物理ブロック全体の書き替えを行う。即ち、書き替える場合には、書き替えが発生した物理ブロックの代わりに、すべてのユーザデータが消去されている消去済み物理ブロックに、その新たなユーザデータを書き込むと共に、書き替えが発生した物理ブロックの書き替え対象以外の元のユーザデータを書き込む必要がある。
このように、フラッシュメモリにすでに書き込まれているユーザデータを書き替える場合には、そのユーザデータが物理ブロックのごく一部に書き込まれているデータであっても、2つの物理ブロックに対して処理を行わなくてはならず、能率が悪く、且つ処理時間も必要以上にかかっていた。さらに、書き替えが頻繁に行われる場合には、物理ブロックの書き替え回数が増加し、書き替え可能回数の限界を超える物理ブロックが増加する危険性もあった。
Since the NAND flash memory has such characteristics, normally, when data is rewritten, new data (data after rewriting) is written to the erased block that has been erased, and old data is written. A process of erasing a block in which (data before rewriting) has been written is performed.
When rewriting the original user data stored in any physical block of the flash memory to new user data, it is not possible to rewrite only the page where the original user data to be rewritten is written. Rewrite the whole. That is, when rewriting, instead of the physical block that has been rewritten, the new user data is written to the erased physical block from which all user data has been erased, and the physical block that has been rewritten It is necessary to write original user data other than the rewriting target.
As described above, when rewriting user data already written in the flash memory, even if the user data is data written in a small part of the physical block, the processing is performed on two physical blocks. The efficiency was low and the processing time was longer than necessary. Furthermore, when rewriting is performed frequently, the number of times of rewriting the physical block increases, and there is a risk that the number of physical blocks exceeding the limit of the number of rewriteable times will increase.

本発明は、このような課題を解決し、書き替えが発生するごとに物理ブロック全体のデータの書き替える必要のない、メモリコントローラ、フラッシュメモリシステム及びフラッシュメモリの制御方法を提供することを目的とする。   An object of the present invention is to solve such problems and to provide a memory controller, a flash memory system, and a flash memory control method that do not require rewriting of data of the entire physical block every time rewriting occurs. To do.

上記目的を達成するために、本発明の第1の観点に係るメモリコントローラは、
複数ページからなる物理ブロックが複数含まれる記憶領域を有し、データの消去が物理ブロック単位で行われデータの書き込みがページ単位で行われるフラッシュメモリに接続され、該フラッシュメモリに対するアクセスを制御するメモリコントローラであって、
ホストシステムから与えられる論理アドレスが割り当てられたセクタ単位の領域を複数個含む論理ブロックを形成する論理ブロック形成手段と、
前記論理ブロックを物理ブロックに割り当てると共に、当該論理ブロックと当該物理ブロックの対応関係を管理するブロック管理手段と、
前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページに、当該論理アドレスに対応するデータを書き込むデータ書き込み手段とを備え
前記論理ブロックが割り当てられた物理ブロック内の記憶領域は、
当該論理ブロックに含まれる領域と等しい容量を持ち、当該論理ブロックに含まれるセクタ単位の領域と対応関係が予め定められているページで構成されたオリジナルデータ記憶領域と、
前記論理ブロックに含まれるセクタ単位の領域を自由に割り当てることができるページで構成された更新データ記憶領域とに分割して使用され、
前記データ書き込み手段は、
前記ホストシステムから与えられた論理アドレスに基づいて特定された前記オリジナルデータ記憶領域内のページが空きページである場合、当該論理アドレスに対応するデータを当該特定されたページに書き込み、
当該特定されたページが空きページでない場合、当該論理アドレスに対応するデータと当該論理アドレスを特定するための情報を前記更新データ記憶領域内の空きページのユーザ領域と冗長領域にそれぞれ書き込む、
ことを特徴とする。
In order to achieve the above object, a memory controller according to the first aspect of the present invention provides:
Has a storage area including a plurality of pages physical blocks contains multiple, erasure of data is performed in units of physical blocks, writing of data is connected to the flash memory is performed in units of pages, against the person the flash memory Rua A memory controller for controlling access,
Logical block forming means for forming a logical block including a plurality of sector unit areas to which a logical address given by the host system is assigned;
Block management means for allocating the logical block to a physical block and managing the correspondence between the logical block and the physical block;
Based on the logical address given from the host system, the page in the physical block corresponding to the logical block to which the logical address belongs, and a write Mude over data writing means to write data corresponding to the logical address ,
The storage area in the physical block to which the logical block is allocated is
An original data storage area having a capacity equal to that of the area included in the logical block, and configured by pages having a predetermined relationship with the area of the sector unit included in the logical block;
It is used by being divided into an update data storage area composed of pages that can be freely assigned a sector unit area included in the logical block,
The data writing means includes
When the page in the original data storage area specified based on the logical address given from the host system is an empty page, the data corresponding to the logical address is written to the specified page,
If the specified page is not a free page, data corresponding to the logical address and information for specifying the logical address are written in the user area and the redundant area of the empty page in the update data storage area, respectively.
It is characterized by that.

尚、前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページから当該論理アドレスに対応するデータを読み出す読み出し手段を更に備え、
前記読み出し手段は、
前記更新データ記憶領域内に、前記ホストシステムから与えられた論理アドレスと対応する情報が冗長領域に書き込まれているページがある場合、当該更新データ記憶領域内のページから当該論理アドレスに対応するデータを読み出し、
前記更新データ記憶領域内に、当該論理アドレスと対応する情報が冗長領域に書き込まれているページがない場合、前記オリジナルデータ記憶領域内の当該論理アドレスに対応するページから当該論理アドレスに対応するデータを読み出してもよい。
In addition, based on the logical address given from the host system, further comprising a reading means for reading data corresponding to the logical address from the page in the physical block corresponding to the logical block to which the logical address belongs,
The reading means includes
If there is a page in the update data storage area in which information corresponding to the logical address given from the host system is written in the redundant area, the data corresponding to the logical address from the page in the update data storage area Read
If there is no page in the update data storage area in which information corresponding to the logical address is written in the redundant area, data corresponding to the logical address from the page corresponding to the logical address in the original data storage area May be read out .

また、前記データ書き込み手段は、前記更新データ記憶領域内の空きページの冗長領域に、前記論理アドレスを特定するための情報と共に、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のそれぞれのページに格納されているデータが有効か否かを示す情報を書き込んでもよい。 In addition, the data writing means includes information for identifying the logical address in the redundant area of the empty page in the update data storage area and each physical block in the physical block corresponding to the logical block to which the logical address belongs. Information indicating whether or not the data stored in the page is valid may be written.

上記目的を達成するために、本発明の第2の観点に係るフラッシュメモリシステムは、本発明の第1の観点に係るいずれかのメモリコントローラと、このメモリコントローラにより制御されるフラッシュメモリとを備えることを特徴とする。 To achieve the above object, a flash memory system according to a second aspect of the present invention includes any one of the memory controllers according to the first aspect of the present invention and a flash memory controlled by the memory controller. It is characterized by that.

上記目的を達成するために、本発明の第3の観点に係るフラッシュメモリの制御方法は、
複数ページからなる物理ブロックが複数含まれる記憶領域を有し、データの消去が物理ブロック単位で行われデータの書き込みがページ単位で行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、
ホストシステムから与えられる論理アドレスが割り当てられたセクタ単位の領域を複数個含む論理ブロックを形成する論理ブロック形成処理と、
前記論理ブロックを物理ブロックに割り当てると共に、当該論理ブロックと当該物理ブロックの対応関係を管理するブロック管理処理と、
前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページに、当該論理アドレスに対応するデータを書き込むータ書き込み処理とをみ、
前記論理ブロックが割り当てられた物理ブロック内の記憶領域は、
当該論理ブロックに含まれる領域と等しい容量を持ち、当該論理ブロックに含まれるセクタ単位の領域と対応関係が予め定められているページで構成されたオリジナルデータ記憶領域と、
前記論理ブロックに含まれるセクタ単位の領域を自由に割り当てることができるページで構成された更新データ記憶領域とに分割して使用され、
前記データ書き込み処理では、
前記ホストシステムから与えられた論理アドレスに基づいて特定された前記オリジナルデータ記憶領域内のページが空きページである場合、当該論理アドレスに対応するデータを当該特定されたページに書き込み、
当該特定されたページが空きページでない場合、当該論理アドレスに対応するデータと当該論理アドレスを特定するための情報を前記更新データ記憶領域内の空きページのユーザ領域と冗長領域にそれぞれ書き込む、
ことを特徴とする。
In order to achieve the above object, a flash memory control method according to a third aspect of the present invention includes:
Has a storage area including a plurality of pages physical blocks contains multiple, erasure of data is performed in units of physical blocks, the control method of the flash memory to control access to write data against the flash memory is performed in units of pages Because
A logical block forming process for forming a logical block including a plurality of sector unit areas to which a logical address given by the host system is assigned;
A block management process for allocating the logical block to a physical block and managing a correspondence between the logical block and the physical block;
On the basis of the logical address given from the host system, the page in the physical block corresponding to the logical block to which the logical address belongs, seen including a data writing process of writing data corresponding to the logical address,
The storage area in the physical block to which the logical block is allocated is
An original data storage area having a capacity equal to that of the area included in the logical block, and configured by pages having a predetermined relationship with the area of the sector unit included in the logical block;
It is used by being divided into an update data storage area composed of pages that can be freely assigned a sector unit area included in the logical block,
In the data writing process,
When the page in the original data storage area specified based on the logical address given from the host system is an empty page, the data corresponding to the logical address is written to the specified page,
If the specified page is not a free page, data corresponding to the logical address and information for specifying the logical address are written in the user area and the redundant area of the empty page in the update data storage area, respectively.
It is characterized by that.

尚、前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページから当該論理アドレスに対応するデータを読み出す読み出し手段を更に備え、
前記読み出し手段は、
前記更新データ記憶領域内に、前記ホストシステムから与えられた論理アドレスと対応する情報が冗長領域に書き込まれているページがある場合、当該更新データ記憶領域内のページから当該論理アドレスに対応するデータを読み出し、
前記更新データ記憶領域内に、当該論理アドレスと対応する情報が冗長領域に書き込まれているページがない場合、前記オリジナルデータ記憶領域内の当該論理アドレスに対応するページから当該論理アドレスに対応するデータを読み出してもよい。
In addition, based on the logical address given from the host system, further comprising a reading means for reading data corresponding to the logical address from the page in the physical block corresponding to the logical block to which the logical address belongs,
The reading means includes
If there is a page in the update data storage area in which information corresponding to the logical address given from the host system is written in the redundant area, the data corresponding to the logical address from the page in the update data storage area Read
If there is no page in the update data storage area in which information corresponding to the logical address is written in the redundant area, data corresponding to the logical address from the page corresponding to the logical address in the original data storage area May be read out .

また、前記データ書き込み処理では、前記更新データ記憶領域内の空きページの冗長領域に、前記論理アドレスを特定するための情報と共に、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のそれぞれのページに格納されているデータが有効か否かを示す情報を書き込んでもよい。 Further, in the data write process, information for specifying the logical address in the redundant area of the empty page in the update data storage area and each physical block in the physical block corresponding to the logical block to which the logical address belongs Information indicating whether or not the data stored in the page is valid may be written.

本発明によれば、書き替えが発生するごとに物理ブロック全体のデータの書き替える必要のないフラッシュメモリシステムを実現できる。   According to the present invention, it is possible to realize a flash memory system that does not require rewriting of data of the entire physical block every time rewriting occurs.

以下、図面に基づき、本発明の実施の形態について詳細に説明する。
[第1の実施形態]
図1は、本発明の第1の実施形態に係るフラッシュメモリシステム1の概要を示す構成図である。
図1に示したように、フラッシュメモリシステム1は、フラッシュメモリ2と、それを制御するメモリコントローラ3で構成されている。このフラッシュメモリシステム1は、通常、ホストシステム4に着脱可能に装着され、ホストシステム4に対して、一種の外部記憶装置として用いられる。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[First Embodiment]
FIG. 1 is a configuration diagram showing an outline of a flash memory system 1 according to the first embodiment of the present invention.
As shown in FIG. 1, the flash memory system 1 includes a flash memory 2 and a memory controller 3 that controls the flash memory 2. The flash memory system 1 is normally detachably attached to the host system 4 and is used as a kind of external storage device for the host system 4.

尚、ホストシステム4としては、文字、音声、あるいは画像情報等の種々の情報を処理するパーソナルコンピュータやデジタルスチルカメラをはじめとする各種情報処理装置が挙げられる。
以下に、フラッシュメモリ2及びメモリコントローラ3の詳細を説明する。
Examples of the host system 4 include various information processing apparatuses such as a personal computer and a digital still camera that process various information such as characters, sounds, and image information.
Details of the flash memory 2 and the memory controller 3 will be described below.

[フラッシュメモリ2の説明]
このフラッシュメモリシステム1において、データが記憶されるフラッシュメモリ2は、NAND型フラッシュメモリで構成されている。NAND型フラッシュメモリは、ストレージデバイスへの用途として(ハードディスクの代わりになるものとして)開発された不揮発性メモリである。このNAND型フラッシュメモリは、ランダムアクセスを行なうことができず、書き込みと読み出しはページ単位で、消去は複数ページからなる物理ブロック単位で行なわれる。又、フラッシュメモリ2のデータの上書きができないので、データを書き込むときは、消去されている領域にデータの書き込みが行なわれる。
[Description of flash memory 2]
In this flash memory system 1, a flash memory 2 in which data is stored is composed of a NAND flash memory. The NAND flash memory is a non-volatile memory developed for use as a storage device (as an alternative to a hard disk). This NAND flash memory cannot perform random access, writing and reading are performed in units of pages, and erasing is performed in units of physical blocks composed of a plurality of pages. Since data in the flash memory 2 cannot be overwritten, data is written into the erased area when data is written.

このような特徴を有するフラッシュメモリ2では、ホストシステム4側から与えられる論理アドレスと、フラッシュメモリ2内での物理アドレスとの対応関係は、動的に変化する。従って、フラッシュメモリ2にアクセスするときには、通常、ホストシステム4で用いる論理アドレスとフラッシュメモリ2の物理アドレスとの対応関係を示したアドレス変換テーブルが作成され、このアドレス変換テーブルを用いて、フラッシュメモリ2に対するアクセスが行なわれる。   In the flash memory 2 having such characteristics, the correspondence between the logical address given from the host system 4 side and the physical address in the flash memory 2 dynamically changes. Therefore, when accessing the flash memory 2, an address conversion table showing the correspondence between the logical address used in the host system 4 and the physical address of the flash memory 2 is usually created, and the flash memory is used by using this address conversion table. 2 is accessed.

図2は、ブロックとページの関係を示す説明図である。
上記ブロックとページの構成は、フラッシュメモリ2の仕様によって異なるが、一般的なフラッシュメモリ2では、図2(a)に示したように、1物理ブロックが32ページ(P0〜P31)で構成され、各ページが512バイトのユーザ領域と16バイトの冗長領域で構成されている。近年では、容量の増加に伴い、1物理ブロックが64ページ(P0〜P63)で構成され、各ページが2048バイトのユーザ領域と64バイトの冗長領域で構成されているものもある。本実施形態のフラッシュメモリ2は、1物理ブロックが32ページ(P0〜P31)で構成され、各ページが512バイトのユーザ領域と16バイトの冗長領域で構成されているものとする。
FIG. 2 is an explanatory diagram showing the relationship between blocks and pages.
The configuration of the block and page differs depending on the specifications of the flash memory 2, but in the general flash memory 2, as shown in FIG. 2A, one physical block is configured with 32 pages (P0 to P31). Each page is composed of a 512-byte user area and a 16-byte redundant area. In recent years, as the capacity increases, one physical block is composed of 64 pages (P0 to P63), and each page is composed of a 2048-byte user area and a 64-byte redundant area. In the flash memory 2 of the present embodiment, one physical block is composed of 32 pages (P0 to P31), and each page is composed of a 512-byte user area and a 16-byte redundant area.

物理ブロックの各ページのユーザ領域は、主に、ホストシステム4から供給されるユーザデ―タやその書き替えデータが記憶される領域であり、冗長領域は、誤り訂正符号、対応論理アドレス情報及びブロックステータス等の付加データが記憶される領域である。誤り訂正符号は、ユーザ領域に記憶されているデータに含まれる誤りを検出、訂正するための付加データであり、後述するECCブロックによって生成される。   The user area of each page of the physical block is an area mainly storing user data supplied from the host system 4 and its rewrite data, and the redundant area is an error correction code, corresponding logical address information, and a block. This is an area for storing additional data such as status. The error correction code is additional data for detecting and correcting an error included in the data stored in the user area, and is generated by an ECC block described later.

本実施形態のフラッシュメモリシステム1では、フラッシュメモリ2の各物理ブロックに、書き替え前のユーザデータ(オリジナルデータ)を書き込むオリジナルデータ記憶部と、オリジナルデータ記憶部に書き込まれたオリジナルデータの書き替えデータを書き込む更新データ記憶部とを設定する。   In the flash memory system 1 of the present embodiment, an original data storage unit for writing user data (original data) before rewriting to each physical block of the flash memory 2 and rewriting of the original data written in the original data storage unit An update data storage unit for writing data is set.

具体的には、フラッシュメモリ2の各物理ブロックのページP0〜P15の16ページを、オリジナルデータを書き込むためのオリジナルデータ記憶部とし、ページP16〜P31を書き替え用のデータを書き込むための更新データ記憶部とする。そして、オリジナルデータ記憶部のページと更新データ記憶部のページとを一対一に対応させ、オリジナルデータ記憶部内でのページの番号と更新データ記憶部内でのページ番号とを対応させている。即ち、ページP0に書き込まれたユーザデータの書き替えデータは、ページP16に書き込まれる。ページP1に書き込まれたユーザデータの書き替えデータは、ページP17に書き込まれる。以下、同様に、若番側から各ページP2,P3,…,P15に書き込まれたユーザデータの書き替えデータは、ページP18,P19,…,P31にそれぞれ書き込まれる。   Specifically, 16 pages of pages P0 to P15 of each physical block of the flash memory 2 are used as an original data storage unit for writing original data, and update data for writing data for rewriting pages P16 to P31. The storage unit. The pages of the original data storage unit and the pages of the update data storage unit are made to correspond one-to-one, and the page numbers in the original data storage unit are associated with the page numbers in the update data storage unit. That is, the rewrite data of the user data written on the page P0 is written on the page P16. The rewrite data of the user data written on the page P1 is written on the page P17. Similarly, the rewrite data of the user data written to the pages P2, P3,..., P15 from the younger side is written to the pages P18, P19,.

前述の対応論理アドレス情報は、物理ブロックのユーザデータが書き込まれているページの冗長領域に書き込まれ、その物理ブロックに記憶されているユーザデータの論理ブロックのアドレスに関する情報を示している。尚、物理ブロックにユーザデータが記憶されていない場合は、対応論理アドレス情報がいずれのページにも書き込まれないので、対応論理アドレス情報が書き込まれているか否かで、そのブロックが消去済ブロックであるか否かを判断することができる。つまり、対応論理ブロックアドレスが書き込まれていない場合は、消去済ブロックであると判断される。   The above-described corresponding logical address information indicates information related to the logical block address of the user data written in the redundant area of the page in which the physical block user data is written and stored in the physical block. If no user data is stored in the physical block, the corresponding logical address information is not written to any page, so that the block is an erased block depending on whether the corresponding logical address information is written. It can be determined whether or not there is. That is, if the corresponding logical block address is not written, it is determined that the block is an erased block.

ブロックステータスは、その物理ブロックが不良ブロック(正常にデータの書き込み等を行なうことができない物理ブロック)であるか否かを示すフラグであり、その物理ブロックが不良ブロックであると判断された場合には、不良ブロックであることを示すフラグが設定される。   The block status is a flag indicating whether or not the physical block is a bad block (a physical block in which data cannot be normally written). When it is determined that the physical block is a bad block Is set with a flag indicating that it is a bad block.

次に、フラッシュメモリ2の回路構成について説明する。
一般的なNAND型フラッシュメモリは、書き込みデータ若しくは読み出しデータを保持するためのレジスタと、データを記憶するメモリセルアレイによって構成されている。メモリセルアレイは、複数のメモリセルが直列に接続されたメモリセル群を複数備えており、ワード線によって、メモリセル群の特定のメモリセルが選択される。このワード線によって選択されたメモリセルとレジスタの間で、データの複写(レジスタからメモリセルへの複写、若しくはメモリセルからレジスタへの複写)が行なわれる。
Next, the circuit configuration of the flash memory 2 will be described.
A general NAND flash memory includes a register for holding write data or read data and a memory cell array for storing data. The memory cell array includes a plurality of memory cell groups in which a plurality of memory cells are connected in series, and a specific memory cell in the memory cell group is selected by a word line. Data copying (copying from the register to the memory cell or copying from the memory cell to the register) is performed between the memory cell selected by the word line and the register.

メモリセルアレイを構成するメモリセルは、2つのゲートを備えたMOSトランジスタで構成されている。ここで、上側のゲートはコントロールゲートと、下側のゲートはフローティングゲートと呼ばれており、フローティングゲートに電荷(電子)を注入したり、フローティングゲートから電荷(電子)を排出したりすることによって、データの書き込みや消去を行っている。   A memory cell constituting the memory cell array is composed of a MOS transistor having two gates. Here, the upper gate is called a control gate, and the lower gate is called a floating gate. By injecting charges (electrons) into the floating gate and discharging charges (electrons) from the floating gate, Data is written or erased.

フローティングゲートは、周囲を絶縁体で囲まれているので、注入された電子は長期間にわたって保持される。フローティングゲートに電子を注入するときは、コントロールゲートが高電位側となる高電圧を印加して電子を注入し、フローティングゲートから電子を排出するときは、コントロールゲートが低電位側となる高電圧を印加して電子を排出する。フローティングゲートに電子が注入されている状態(書き込状態)が、論理値"0"のデータに対応し、フローティングゲートから電子が排出されている状態(消去状態)が、論理値"1"のデータに対応する。   Since the floating gate is surrounded by an insulator, the injected electrons are held for a long period of time. When injecting electrons into the floating gate, a high voltage is applied so that the control gate is at the high potential side. When electrons are injected from the floating gate, a high voltage at which the control gate is at the low potential side is applied. Applied to discharge electrons. The state in which electrons are injected into the floating gate (write state) corresponds to data of logical value “0”, and the state in which electrons are discharged from the floating gate (erased state) is logical value “1”. Corresponds to data.

[メモリコントローラ3の説明]
メモリコントローラ3は、ホストインターフェース制御ブロック5と、マイクロプロセッサ6と、ホストインターフェースブロック7と、ワークエリア8と、バッファ9と、フラッシュメモリインターフェースブロック10と、ECC(エラー・コレクション・コード)ブロック11と、フラッシュメモリシーケンサブロック12とから構成される。これら機能ブロックによって構成されるメモリコントローラ3は、一つの半導体チップ上に集積されている。
[Description of Memory Controller 3]
The memory controller 3 includes a host interface control block 5, 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 flash memory sequencer block 12. The memory controller 3 constituted by these functional blocks is integrated on one semiconductor chip.

ホストインターフェースブロック7が外部バス13を介してホストシステム4と接続され、フラッシュメモリインターフェースブロック10が、フラッシュメモリ2と内部バス14で接続されている。
以下に、各機能ブロックの機能を説明する。
The host interface block 7 is connected to the host system 4 via the external bus 13, and the flash memory interface block 10 is connected to the flash memory 2 via the internal bus 14.
Hereinafter, the function of each functional block will be described.

マイクロプロセッサ6は、カウンター等を内蔵し、メモリコントローラ3を構成する各機能ブロック全体の、動作を制御する機能ブロックである。
ホストインターフェース制御ブロック5は、ホストインターフェースブロック7の動作を制御する機能ブロックである。ここで、ホストインターフェース制御ブロック5は、ホストインターフェースブロック7の動作を設定する動作設定レジスタ(図示せず)を備えており、この動作設定レジスタに基づいて、ホストインターフェースブロック7は動作する。
The microprocessor 6 is a functional block that incorporates a counter or the like and controls the operation of the entire functional blocks constituting the memory controller 3.
The host interface control block 5 is a functional block that controls the operation of the host interface block 7. Here, the host interface control block 5 includes an operation setting register (not shown) for setting the operation of the host interface block 7, and the host interface block 7 operates based on the operation setting register.

ホストインターフェースブロック7は、ホストシステム4とデータ、アドレス情報、ステータス情報及び外部コマンド情報の授受を行なう機能ブロックである。すなわち、フラッシュメモリシステム1がホストシステム4に装着されると、フラッシュメモリシステム1とホストシステム4は、外部バス13を介して相互に接続される。かかる状態において、ホストシステム4よりフラッシュメモリシステム1に供給されるデータ等は、ホストインターフェースブロック7を入口として、フラッシュメモリシステム1の内部に取り込まれ、フラッシュメモリシステム1からホストシステム4に供給されるデータ等は、ホストインターフェースブロック7を出口として、ホストシステム4に供給される。   The host interface block 7 is a functional block that exchanges data, address information, status information, and external command information with the host system 4. That is, when the flash memory system 1 is attached to the host system 4, the flash memory system 1 and the host system 4 are connected to each other via the external bus 13. In such a state, data or the like supplied from the host system 4 to the flash memory system 1 is taken into the flash memory system 1 through the host interface block 7 and is supplied from the flash memory system 1 to the host system 4. Data and the like are supplied to the host system 4 through the host interface block 7 as an exit.

さらに、ホストインターフェースブロック7は、ホストシステム4より供給される論理アドレス、セクタ数及び外部コマンドを保持するレジスタや、エラーが発生した場合にセットされるエラーレジスタ(図示せず)等を有している。   Further, the host interface block 7 has a register for holding a logical address, a sector number and an external command supplied from the host system 4, an error register (not shown) set when an error occurs, and the like. Yes.

ワークエリア8は、フラッシュメモリ2の制御に必要なデータが一時的に格納される作業領域であり、複数のSRAM(Static Random Access Memory)セルによって構成されている。   The work area 8 is a work area in which data necessary for controlling the flash memory 2 is temporarily stored, and is composed of a plurality of SRAM (Static Random Access Memory) cells.

バッファ9は、フラッシュメモリ2から読み出したデータ及びフラッシュメモリ2に書き込むデータを、一時的に保持する機能ブロックである。すなわち、フラッシュメモリ2から読み出したデータは、ホストシステム4の受取準備ができるまで、バッファ9に保持され、フラッシュメモリ2に書き込むデータは、フラッシュメモリ2の書き込準備ができるまで、バッファ9に保持される。   The buffer 9 is a functional block that temporarily holds data read from the flash memory 2 and data to be written to the flash memory 2. That is, data read from the flash memory 2 is held in the buffer 9 until the host system 4 is ready to receive data, and data to be written to the flash memory 2 is held in the buffer 9 until the flash memory 2 is ready for writing. Is done.

フラッシュメモリシーケンサブロック12は、フラッシュメモリ2に対するアクセスを制御する機能ブロックである。フラッシュメモリシーケンサブロック12は、複数のレジスタ(図示せず)を備え、この複数のレジスタに、フラッシュメモリ2に対するアクセス処理を実行する際に必要な情報が、マイクロプロセッサ6によって設定される。この複数のレジスタに設定された情報に基づいて、内部コマンド、アドレス情報等が、フラッシュメモリ2に供給される。   The flash memory sequencer block 12 is a functional block that controls access to the flash memory 2. The flash memory sequencer block 12 includes a plurality of registers (not shown), and information necessary for executing an access process to the flash memory 2 is set by the microprocessor 6 in the plurality of registers. Based on the information set in the plurality of registers, internal commands, address information, and the like are supplied to the flash memory 2.

ここで、「内部コマンド」とは、メモリコントローラ3からフラッシュメモリ2に与えられるコマンドであり、ホストシステム4からフラッシュメモリシステム1に与えられるコマンドである「外部コマンド」と区別される。
フラッシュメモリインターフェースブロック10は、内部バス14を介して、フラッシュメモリ2とデータ、アドレス情報、ステータス情報、内部コマンド情報及びデバイスID情報等の授受を行なう機能ブロックである。
Here, the “internal command” is a command given from the memory controller 3 to the flash memory 2 and is distinguished from an “external command” which is a command given from the host system 4 to the flash memory system 1.
The flash memory interface block 10 is a functional block that exchanges data, address information, status information, internal command information, device ID information, and the like with the flash memory 2 via the internal bus 14.

ECCブロック11は、フラッシュメモリ2に書き込むデ―タに付加されるエラーコレクションコードを生成するとともに、読み出しデータに付加されているエラーコレクションコードに基づいて、読み出したデータに含まれる誤りを検出・訂正する機能ブロックである。   The ECC block 11 generates an error correction code added to data to be written to the flash memory 2 and detects and corrects an error included in the read data based on the error correction code added to the read data. Function block.

[フラッシュメモリ2に対するアクセスの説明]
次に、フラッシュメモリ2に対するアクセスを行う場合のフラッシュメモリシステム1の動作を、図面を参照して説明する。
[Description of Access to Flash Memory 2]
Next, the operation of the flash memory system 1 when accessing the flash memory 2 will be described with reference to the drawings.

図3は、論理アドレス空間と物理アドレス空間を示す説明図である。
ホストシステム4は、記憶領域の位置を指定するために論理アドレスを用いる。図3には、論理アドレスで表される論理アドレス空間が、セクタ単位で付けた連番であるLBA(Logical Block Address)で、示されている。
FIG. 3 is an explanatory diagram showing a logical address space and a physical address space.
The host system 4 uses a logical address to specify the location of the storage area. In FIG. 3, a logical address space represented by a logical address is indicated by LBA (Logical Block Address), which is a serial number assigned in units of sectors.

フラッシュメモリ2の記憶領域は、それぞれ複数のページ(P0〜P31)からなる物理ブロック(♯0,♯1,…)群で構成されている。各ページには、論理アドレス空間の1セクタ分のユーザデータが書き込まれる。ここで、本実施形態では、各物理ブロックのページP0〜P15の16ページをオリジナルデータ領域とし、ページP16〜P31の16ページを更新データ領域とし、各物理ブロック♯0,♯1,…には、論理アドレス空間の16セクタ分のユーザデータとその書き替えデータとが書き込まれる。従って、一括消去単位の各物理ブロック♯0,♯1,…に対応する論理ブロックは、16セクタで構成される。   The storage area of the flash memory 2 is composed of a group of physical blocks (# 0, # 1,...) Each composed of a plurality of pages (P0 to P31). Each page is written with user data for one sector of the logical address space. In this embodiment, 16 pages of pages P0 to P15 of each physical block are set as original data areas, and 16 pages of pages P16 to P31 are set as update data areas, and each physical block # 0, # 1,. User data for 16 sectors in the logical address space and its rewrite data are written. Therefore, the logical block corresponding to each physical block # 0, # 1,... In the batch erase unit is composed of 16 sectors.

メモリコントローラ3は、論理ブロックLB0,LB1,…と物理ブロック♯0,♯1,…との対応関係を示したアドレス変換テーブルを作成し、このアドレス変換テーブルを用いてアクセスするページのアドレスを求める。アドレス変換テーブルは、各物理ブロック♯0,♯1,…の冗長領域に書き込まれている対応論理アドレス情報に関する情報(その物理ブロックに書き込まれているユーザデータに対応する論理ブロックを示す情報)に基づいて作成される。   The memory controller 3 creates an address conversion table showing the correspondence between the logical blocks LB0, LB1,... And the physical blocks # 0, # 1,..., And obtains the address of the page to be accessed using this address conversion table. . The address conversion table contains information on the corresponding logical address information written in the redundant area of each physical block # 0, # 1,... (Information indicating the logical block corresponding to the user data written in the physical block). Created based on.

例えば、物理ブロック♯0,♯1,…にユーザデータを書き込んだときに、そのユーザデータを書き込んだ論理ブロックの連番LB0,LB1,…を対応論理アドレス情報として物理ブロック♯0,1,…のページの冗長領域に書き込んでおき、この連番LB0,LB1,…を順次読み出すことにより、アドレス変換テーブルを作成することができる。尚、アドレス変換テーブルは、ワークエリア8上に作成され、論理ブロックLB0,LB1,…と物理ブロック♯0,♯1,…との対応関係が変化したときには、書き替えられる。アドレス変換テーブルを利用した書き込み処理を図4及び図5を参照して説明する。   For example, when user data is written to the physical blocks # 0, # 1,..., The physical blocks # 0, 1,... With the serial numbers LB0, LB1,. The address conversion table can be created by sequentially writing these serial numbers LB0, LB1,. The address conversion table is created on the work area 8 and is rewritten when the correspondence between the logical blocks LB0, LB1,... And the physical blocks # 0, # 1,. Write processing using the address conversion table will be described with reference to FIGS.

図4及び図5は、書き込み処理を示すフローチャートである。
フラッシュメモリ2にアクセスする場合、ホストシステム4は、書き込みコマンド或いは読み出しみコマンドをメモリコントローラ3に供給すると共に、アクセス対象を指定する。対象の指定は、論理アドレス空間上の位置を示す論理アドレス情報で示される。
4 and 5 are flowcharts showing the writing process.
When accessing the flash memory 2, the host system 4 supplies a write command or a read command to the memory controller 3 and designates an access target. The designation of the target is indicated by logical address information indicating a position in the logical address space.

論理アドレス情報は、所定のビット幅を有する2進数であり、上位側が論理ブロックLB0,LB1,…を示し、下位側の4ビットが各論理ブロックLB0,LB1,…におけるセクタ番号となると共に、各物理ブロック♯0,♯1,…におけるページ番号となる。つまり、論理アドレス情報の下位側の4ビットは、各物理ブロックのオリジナルデータ記憶部内のページ番号或いは更新データ記憶部内のページ番号を示すことになる。
連続するセクタをアクセス対象とする場合、ホストシステム4は、論理アドレス情報によってアクセス対象の先頭のセクタを示すと共に、アクセス対象となるセクタの数を指定する。この場合、メモリコントローラ3のマイクロプロセッサ6が、ホストシステム4の指定する各アクセス対象のセクタに対応する論理アドレス情報を順次生成する。
The logical address information is a binary number having a predetermined bit width, the upper side indicates the logical blocks LB0, LB1,..., The lower 4 bits are the sector numbers in the logical blocks LB0, LB1,. This is the page number in the physical block # 0, # 1,. That is, the lower 4 bits of the logical address information indicate the page number in the original data storage unit or the page number in the update data storage unit of each physical block.
When consecutive sectors are to be accessed, the host system 4 indicates the top sector to be accessed by logical address information and specifies the number of sectors to be accessed. In this case, the microprocessor 6 of the memory controller 3 sequentially generates logical address information corresponding to each access target sector designated by the host system 4.

メモリコントローラ3のマイクロプロセッサ6は、ホストシステム4から書き込みコマンド及び論理アドレス情報とセクタ数が与えられると、そのセクタ数を内蔵するカウンタに設定し、書き込みを行うごとに設定したセクタ数をデクリメントすると共に、次に書き込みを行う論理アドレス情報を作成する。カウンタに設定されているセクタ数が0になると、次に書き込みを行うユーザデータがないと判断し(ステップS1:NO)、マイクロプロセッサ6は、論理アドレス情報を生成せず、書き込み処理を終了する。   When a write command, logical address information, and the number of sectors are given from the host system 4, the microprocessor 6 of the memory controller 3 sets the number of sectors in a built-in counter and decrements the set number of sectors every time writing is performed. At the same time, logical address information to be written next is created. When the number of sectors set in the counter becomes 0, it is determined that there is no user data to be written next (step S1: NO), and the microprocessor 6 does not generate logical address information and ends the writing process. .

メモリコントローラ3は、マイクロプロセッサ6が次に書き込みを行うユーザデータがあると判断し、論理アドレス情報を生成した場合(ステップS1:YES)、論理アドレス情報の上位側で指定される論理ブロックに対応する物理ブロックを、対象ブロックとしてアドレス変換テーブルから検索する(ステップS2)。   When the memory controller 3 determines that there is user data to be written next by the microprocessor 6 and generates logical address information (step S1: YES), the memory controller 3 corresponds to the logical block specified on the upper side of the logical address information. The physical block to be searched is searched from the address conversion table as a target block (step S2).

ステップS2の検索の結果、ホストシステム4が指定する論理ブロックに対応する対象ブロックがアドレス変換テーブルから求められない場合(ステップS3:NO)、消去済の1つの物理ブロックを対象ブロックとし、論理アドレスの下位側が示す論理ブロック内のセクタ番号を、その対象ブロックのアクセス対象ページの番号とする。   If the target block corresponding to the logical block designated by the host system 4 is not obtained from the address conversion table as a result of the search in step S2 (step S3: NO), one erased physical block is set as the target block, and the logical address The sector number in the logical block indicated by the lower side is the number of the access target page of the target block.

メモリコントローラ3は、フラッシュメモリ2の対象ブロックとなった消去済ブロックのアクセス対象ページのユーザ領域に、ユーザデータを書き込むと共にそのアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS4)。   The memory controller 3 writes user data in the user area of the access target page of the erased block that is the target block of the flash memory 2 and writes the logical block address as the corresponding logical address information in the redundant area of the access target page. Additional data such as error correction code and block status is written (step S4).

さらに、メモリコントローラ3は、アドレス変換テーブルに、対象ブロックとなった物理ブロックの番号と、その物理ブロックに対応する論理ブロックの番号を対応させて書き込む(ステップS5)。即ち、アドレス変換テーブルを更新する。   Further, the memory controller 3 writes the number of the physical block that is the target block in the address conversion table in association with the number of the logical block corresponding to the physical block (step S5). That is, the address conversion table is updated.

ステップS2の検索で、対象ブロックとなる物理ブロックが検出された場合(ステップS3:YES)、そのフラッシュメモリ2の対象ブロックの冗長領域を調べ、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号をアクセス対象ページの番号とし、そのアクセス対象ページにユーザデータが書き込まれていないか書き込まれているかを判定する(ステップS6)。   When the physical block that is the target block is detected in the search in step S2 (step S3: YES), the redundant area of the target block in the flash memory 2 is checked, and the sector number in the logical block indicated by the lower side of the logical address is set. The equal number is set as the access target page number, and it is determined whether or not user data is written in the access target page (step S6).

ステップS6の判定の結果、アクセス対象ページにユーザデータが書き込まれていないことが判定されたとき(ステップS6:YES)、アクセス対象ページに、ホストシステム4から与えられたユーザデータを書き込む(ステップS7)。このとき、メモリコントローラ3は、新たにユーザデータを書き込んだアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む。ステップS7により、オリジナルデータ記憶部にユーザデータがオリジナルデータとして書き込まれる。   As a result of the determination in step S6, when it is determined that user data has not been written on the access target page (step S6: YES), the user data given from the host system 4 is written on the access target page (step S7). ). At this time, the memory controller 3 writes additional data such as the logical block address, error correction code, and block status as the corresponding logical address information in the redundant area of the access target page in which the user data is newly written. In step S7, user data is written as original data in the original data storage unit.

ステップS6の判定の結果、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号のページに、すでにユーザデータが書き込まれていると判定された場合(ステップS6:NO)、メモリコントローラ3は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に、16(物理ブロックのオリジナルデータ記憶部のページ数に相当)を加算し、この16を加算した番号を対象ブロックの新たなアクセス対象ページとする。即ち、更新データ記憶部に新たなアクセス対象ページが移されたことになる。メモリコントローラ3は、対象ブロック冗長領域を調べ、その対象ブロックの新たなアクセス対象ページに、すでにユーザデータが書き込まれているか、否かを判定する(ステップS8)。   As a result of the determination in step S6, when it is determined that user data has already been written in a page having a number equal to the sector number in the logical block indicated by the lower side of the logical address (step S6: NO), the memory controller 3 , 16 (corresponding to the number of pages in the original data storage unit of the physical block) is added to the sector number in the logical block indicated by the lower side of the logical address, and the number obtained by adding 16 is used as a new access target page of the target block. To do. That is, a new access target page is moved to the update data storage unit. The memory controller 3 checks the target block redundant area, and determines whether user data has already been written in the new access target page of the target block (step S8).

ステップS8の判定の結果、対象ブロックの新たなアクセス対象ページに、ユーザデータが書き込まれていないことが判定されたとき(ステップS8:YES)、メモリコントローラ3は、対象ブロックの新たなアクセス対象ページにユーザデータを書き込む(ステップS9)。メモリコントローラ3は、これと同時に、ユーザデータを書き込んだ対象ブロックのページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む。このステップS9により、更新データ記憶部に、オリジナルデータの書き替えデータが書き込まれる。   As a result of the determination in step S8, when it is determined that no user data is written in the new access target page of the target block (step S8: YES), the memory controller 3 determines that the new access target page of the target block User data is written in (Step S9). At the same time, the memory controller 3 writes additional data such as the logical block address, error correction code, and block status as the corresponding logical address information in the redundant area of the page of the target block in which the user data is written. By this step S9, the rewrite data of the original data is written in the update data storage unit.

ステップS8の判定の結果、対象ブロックの新たなアクセス対象ページに、ユーザデータが書き込まれていることが判定されたとき(ステップS8:NO)、メモリコントローラ3は、消去済の1つの物理ブロックを新たな対象ブロックとし、論理アドレスの下位側が示す論理ブロック内のセクタ番号を、その新たな対象ブロックのアクセス対象ページの番号とする。   As a result of the determination in step S8, when it is determined that user data is written in a new access target page of the target block (step S8: NO), the memory controller 3 selects one erased physical block. As a new target block, the sector number in the logical block indicated by the lower side of the logical address is set as the access target page number of the new target block.

メモリコントローラ3は、フラッシュメモリ2の新たな対象ブロックとなった消去済ブロックのアクセス対象ページのユーザ領域に、ユーザデータを書き込むと共にそのアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS10)。   The memory controller 3 writes user data to the user area of the access target page of the erased block that has become a new target block of the flash memory 2 and also stores the logical block as corresponding logical address information in the redundant area of the access target page. Additional data such as the address, error correction code, block status, etc. are written (step S10).

また、メモリコントローラ3は、アドレス変換テーブルに、新たな対象ブロックとなった物理ブロックの番号と、その物理ブロックに対応する論理ブロックの番号を対応させて書き込む(ステップS11)。即ち、アドレス変換テーブルを更新する。   Further, the memory controller 3 writes the number of the physical block that has become the new target block and the number of the logical block corresponding to the physical block in the address conversion table (step S11). That is, the address conversion table is updated.

さらに、メモリコントローラ3は、新たな対象ブロックのアクセス対象ページ以外のページに、元の対象ブロック(ステップS8の判定を行った物理ブロック)の対応するページに書き込まれているユーザデータ、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS12)。この際、アクセス対象ページよりページ番号の小さいページについては、アクセス対象ページへの書き込みの前に、ユーザデータ等の転写をする。   Further, the memory controller 3 sets the user data and the corresponding logical address written in the page corresponding to the original target block (the physical block determined in step S8) on the page other than the access target page of the new target block. Additional data such as the logical block address, error correction code, and block status is written as information (step S12). At this time, for a page having a page number smaller than that of the access target page, user data or the like is transferred before writing to the access target page.

このとき、オリジナルデータ記憶領部、更新データ記憶部の両方に同じセクタに対応して書き込まれているユーザデータがあれば、更新データ記憶部に書き込まれているユーザデータを、新たな対象ブロックのオリジナルデータ記憶部の対応するページに書き込む。
そして、元の対象ブロックのすべてのページを一括消去(ブロック消去)し、消去済ブロックにする(ステップS13)。
At this time, if there is user data written corresponding to the same sector in both the original data storage section and the update data storage section, the user data written in the update data storage section is transferred to the new target block. Write to the corresponding page in the original data storage.
Then, all the pages of the original target block are erased at once (block erase) to make an erased block (step S13).

次に、フラッシュメモリ2に対する読み出し処理の動作を、図6を用いて説明する。
図6は、読み出し処理を示すフローチャートである。
Next, the read processing operation for the flash memory 2 will be described with reference to FIG.
FIG. 6 is a flowchart showing the reading process.

フラッシュメモリ2からユーザデータを読み出す場合、メモリコントローラ3のマイクロプロセッサ6は、ホストシステム4から読み出しコマンド及び論理アドレス情報とセクタ数が与えられると、そのセクタ数を内蔵するカウンタに設定し、読み出しを行うごとに設定したセクタ数をデクリメントすると共に、次に読み出しを行う論理アドレス情報を作成する。カウンタに設定されているセクタ数が0になると、次に読み出しを行うユーザデータがないと判断し(ステップS31:NO)、マイクロプロセッサ6は、論理アドレス情報を生成せず、読み出し処理を終了する。   When reading user data from the flash memory 2, the microprocessor 6 of the memory controller 3, when given a read command, logical address information, and the number of sectors from the host system 4, sets the number of sectors in a built-in counter and performs reading. Each time it is performed, the set number of sectors is decremented and logical address information to be read next is created. When the number of sectors set in the counter becomes 0, it is determined that there is no user data to be read next (step S31: NO), and the microprocessor 6 does not generate logical address information and ends the reading process. .

メモリコントローラ3は、マイクロプロセッサ6が次に読み出しを行うユーザデータがあると判断し、論理アドレス情報を生成した場合(ステップS31:YES)、論理アドレス情報の上位側で指定される論理ブロックに対応する物理ブロックを対象ブロックとしてアドレス変換テーブルから検索する(ステップS32)。   When the memory controller 3 determines that there is user data to be read next by the microprocessor 6 and generates logical address information (step S31: YES), the memory controller 3 corresponds to the logical block specified on the upper side of the logical address information. The physical block to be searched is searched from the address conversion table as a target block (step S32).

メモリコントローラ3は、論理アドレス情報の下位側で指定される論理ブロックのセクタ番号に16(物理ブロックのオリジナルデータ記憶部のページ数に相当)を加算し、これをアクセス対象ページを示す番号とし、ステップS32で検出された対象ブロックのアクセス対象ページを示す物理アドレスを作成し、その物理アドレスで示されるページの冗長領域を調べ、対象ブロックのアクセス対象ページにユーザデータが書き込まれているか否かを判定する(ステップS33)。   The memory controller 3 adds 16 (corresponding to the number of pages of the original data storage unit of the physical block) to the sector number of the logical block specified on the lower side of the logical address information, and sets this as the number indicating the access target page. A physical address indicating an access target page of the target block detected in step S32 is created, a redundant area of the page indicated by the physical address is checked, and whether or not user data is written in the access target page of the target block is determined. Determination is made (step S33).

対象ブロックのアクセス対象ページにユーザデータが書き込まれていると判定した場合(ステップS33:YES)、メモリコントローラ3は、対象ブロックのアクセス対象ページのユーザ領域に書き込まれていたユーザデータを読み出す(ステップS34)。このとき、冗長領域に記憶されている誤り訂正符号により、ユーザデータの誤りが検出された時には、読み出したユーザデータの訂正を行う。   When it is determined that user data is written in the access target page of the target block (step S33: YES), the memory controller 3 reads the user data written in the user area of the access target page of the target block (step S33). S34). At this time, when an error of the user data is detected by the error correction code stored in the redundant area, the read user data is corrected.

一方、対象ブロックのアクセス対象ページにユーザデータが書き込まれていないと判定した場合(ステップS33:NO)、メモリコントローラ3は、論理アドレス情報の下位側で指定される論理ブロックのセクタ番号を新たなアクセス対象ページを示す番号とし、ステップS32で検出された対象ブロックの新たなアクセス対象ページを示す物理アドレスを作成し、対象ブロックの新たなアクセス対象ページのユーザ領域に書き込まれていたユーザデータを読み出す(ステップS35)。このとき、冗長領域に記憶されている誤り訂正符号により、ユーザデータの誤りが検出された時には、読み出したユーザデータの訂正を行う。   On the other hand, when it is determined that no user data is written in the access target page of the target block (step S33: NO), the memory controller 3 sets the sector number of the logical block specified on the lower side of the logical address information to a new one. A physical address indicating a new access target page of the target block detected in step S32 is created with the number indicating the access target page, and the user data written in the user area of the new access target page of the target block is read out. (Step S35). At this time, when an error of the user data is detected by the error correction code stored in the redundant area, the read user data is corrected.

以上のように、本実施形態のフラッシュメモリシステムは、物理ブロックが複数ページP0〜P31で構成されたフラッシュメモリ2を用いた場合に、ページP0〜P15をオリジナルデータ記憶部としてユーザデータを書き込み、オリジナルデータ記憶部に記憶されたユーザデータに書き替えが発生したときにその物理ブロックのページP16〜P32に書き替えデータを書き込むようにしている。そのため、消去済みブロックに書き替えが発生した物理ブロックのユーザデータ等を転写する処理や、不要になった物理ブロックを消去する処理を従来よりも減じることができる。   As described above, in the flash memory system of the present embodiment, when the flash memory 2 having a physical block composed of a plurality of pages P0 to P31 is used, user data is written using the pages P0 to P15 as the original data storage unit, When the user data stored in the original data storage unit is rewritten, the rewritten data is written to the pages P16 to P32 of the physical block. For this reason, it is possible to reduce processing for transferring user data and the like of a physical block that has been rewritten to an erased block and processing for deleting a physical block that is no longer needed.

また、各物理ブロックにおいて、オリジナルデータ記憶部の各ページP0〜P15と更新データ記憶部のページP16〜P32とをそれぞれ対応させ、論理アドレス空間における同じセクタのユーザデータを書き込む構成にしたので、アドレスの管理が簡単で、アクセス先が短時間で求められる。   In each physical block, the pages P0 to P15 of the original data storage unit and the pages P16 to P32 of the update data storage unit are associated with each other, and the user data of the same sector in the logical address space is written. Management is easy and the access destination is required in a short time.

[第2の実施形態]
図7は、本発明の第2の実施形態に係るフラッシュメモリシステム21の概要を示す構成図である。
図7に示したように、フラッシュメモリシステム21は、フラッシュメモリ22と、それを制御するメモリコントローラ23で構成され、ホストシステム24に着脱可能に装着される。
[Second Embodiment]
FIG. 7 is a configuration diagram showing an overview of a flash memory system 21 according to the second embodiment of the present invention.
As shown in FIG. 7, the flash memory system 21 includes a flash memory 22 and a memory controller 23 that controls the flash memory 22, and is detachably attached to the host system 24.

[フラッシュメモリ22の説明]
このフラッシュメモリシステム21において、データが記憶されるフラッシュメモリ22は、NAND型フラッシュメモリで構成され、第1の実施形態のフラッシュメモリ2と同様に、1物理ブロックが32ページ(P0〜P31)で構成され、各ページが512バイトのユーザ領域と16バイトの冗長領域で構成されている。物理ブロックの各ページのユーザ領域は、ユーザデ―タやその書き替えデータが記憶される領域であり、冗長領域は、誤り訂正符号、対応論理アドレス情報及びブロックステータス等の付加データが記憶される領域である。
[Description of flash memory 22]
In the flash memory system 21, the flash memory 22 in which data is stored is configured by a NAND flash memory. Like the flash memory 2 of the first embodiment, one physical block has 32 pages (P0 to P31). Each page consists of a 512-byte user area and a 16-byte redundant area. The user area of each page of the physical block is an area for storing user data and its rewrite data, and the redundant area is an area for storing additional data such as error correction code, corresponding logical address information, and block status. It is.

前述の第1の実施形態のフラッシュメモリシステム1では、フラッシュメモリ2の各物理ブロックをオリジナルデータ記憶部と更新データ記憶部の2つに分割して利用したが、二以上に分割してもよい(図8参照)。   In the flash memory system 1 of the first embodiment described above, each physical block of the flash memory 2 is divided into two parts, an original data storage unit and an update data storage unit, but may be divided into two or more. (See FIG. 8).

図8は、本実施形態のフラッシュメモリ22の構成を示す図である。
本実施形態のフラッシュメモリシステム21では、フラッシュメモリ22の各物理ブロックを、書き替え前のユーザデータを書き込むオリジナルデータ記憶部と、オリジナル記憶部に書き込まれたユーザデータの書き替えデータを書き込む第1の更新データ記憶部と、第1の更新データ記憶部に書き込まれたデータの書き替えデータを書き込む第2の更新データ記憶部と、第1の更新データ記憶部に書き込まれたデータの書き替えデータを書き込む第2の更新データ記憶部と、に分割している。
FIG. 8 is a diagram showing a configuration of the flash memory 22 of the present embodiment.
In the flash memory system 21 of the present embodiment, each physical block of the flash memory 22 has an original data storage unit that writes user data before rewriting and a first data that writes rewrite data of user data written to the original storage unit. Update data storage unit, a second update data storage unit that writes rewrite data of data written in the first update data storage unit, and rewrite data of data written in the first update data storage unit And a second update data storage unit for writing.

具体的には、物理ブロックのページP0〜P7の8ページを、新規のユーザデータを書き込むためのオリジナルデータ記憶部とし、ページP8〜P15を、第1の更新データ記憶部とし、ページP16〜P23を第2の更新データ記憶部とし、ページP24〜P31を第3の更新データ記憶部とする。そして、オリジナルデータ記憶部の各ページと第1の更新データ記憶部の各ページと第2の更新データ記憶部の各ページと第3の更新データ記憶部の各ページとを対応させ、オリジナルデータ記憶部内でのページ番号と第1の更新データ記憶部内のページ番号と、第2の更新データ記憶部内のページ番号と、第3の更新データ記憶部内のページ番号とを対応させている。   Specifically, eight pages P0 to P7 of the physical block are used as original data storage units for writing new user data, pages P8 to P15 are used as first update data storage units, and pages P16 to P23 are used. Is the second update data storage unit, and pages P24 to P31 are the third update data storage unit. Then, each page of the original data storage unit, each page of the first update data storage unit, each page of the second update data storage unit, and each page of the third update data storage unit are associated with each other to store the original data The page number in the section, the page number in the first update data storage section, the page number in the second update data storage section, and the page number in the third update data storage section are associated with each other.

即ち、ページP0に書き込まれたユーザデータの書き替えデータはページP8に書き込まれ、ページP8に書き込まれたユーザデータの書き替えデータはページP16に書き込まれ、ページP16に書き込まれたユーザデータの書き替えデータは、ページP24に書き込まれる。また、ページP1に書き込まれたユーザデータの書き替えデータはページP9に書き込まれ、ページP9に書き込まれたユーザデータの書き替えデータはページP17に書き込まれ、ページP17に書き込まれたユーザデータの書き替えデータは、ページP25に書き込まれる。以下、同様に、各ページP2,P3,…P7に書き込まれたユーザデータの書き替えデータはページP10,P11,…P15にそれぞれ書き込まれ、ページP10,P11,…P15に書き込まれたユーザデータの書き替えデータはP18,P19,…P23にそれぞれ書き込まれ、ページP18,P19,…P23に書き込まれたユーザデータの書き替えデータは、ページP26,P27,…P31に書き込まれる。   That is, the rewrite data of the user data written in the page P0 is written in the page P8, the rewrite data of the user data written in the page P8 is written in the page P16, and the rewrite of the user data written in the page P16 The replacement data is written to page P24. In addition, rewrite data of user data written in page P1 is written in page P9, rewrite data of user data written in page P9 is written in page P17, and rewrite of user data written in page P17 The replacement data is written to page P25. Similarly, the rewrite data of the user data written in each page P2, P3,... P7 is written in pages P10, P11,... P15, and the user data written in pages P10, P11,. Rewrite data is written to P18, P19,... P23, respectively, and rewrite data of user data written to pages P18, P19,... P23 is written to pages P26, P27,.

[メモリコントローラ23の説明]
メモリコントローラ23は、ホストインターフェース制御ブロック25と、マイクロプロセッサ26と、ホストインターフェースブロック27と、ワークエリア28と、バッファ29と、フラッシュメモリインターフェースブロック30と、ECC(エラー・コレクション・コード)ブロック31と、フラッシュメモリシーケンサブロック32とから構成される。これら機能ブロックによって構成されるメモリコントローラ23は、一つの半導体チップ上に集積されている。ホストシステム24とホストインターフェースブロック27とが外部バス33で接続され、フラッシュメモリ22とフラッシュメモリインターフェースブロック30とが、内部バス34で接続されている。
[Description of Memory Controller 23]
The memory controller 23 includes a host interface control block 25, a microprocessor 26, a host interface block 27, a work area 28, a buffer 29, a flash memory interface block 30, and an ECC (error collection code) block 31. And a flash memory sequencer block 32. The memory controller 23 constituted by these functional blocks is integrated on one semiconductor chip. The host system 24 and the host interface block 27 are connected by an external bus 33, and the flash memory 22 and the flash memory interface block 30 are connected by an internal bus 34.

マイクロプロセッサ26は、メモリコントローラ23を構成する各機能ブロック全体の動作を制御する機能ブロックである。フラッシュメモリシーケンサーブロック32は、フラッシュメモリ22に対するアクセスを制御する機能ブロックであり、内蔵する複数のレジスタに、フラッシュメモリ22に対するアクセス処理を実行する際に必要な情報が、マイクロプロセッサ26によって設定される。この複数のレジスタに設定された情報に基づいて、内部コマンド、アドレス情報等がフラッシュメモリ22に供給される。   The microprocessor 26 is a functional block that controls the operation of the entire functional blocks constituting the memory controller 23. The flash memory sequencer block 32 is a functional block that controls access to the flash memory 22, and information necessary for executing access processing to the flash memory 22 is set by a microprocessor 26 in a plurality of built-in registers. . Based on the information set in the plurality of registers, internal commands, address information, and the like are supplied to the flash memory 22.

ホストインターフェース制御ブロック25、ホストインターフェースブロック27、ワークエリア28、バッファ29、フラッシュメモリインターフェースブロック30、及びECCブロック31は、第1の実施形態のホストインターフェース制御ブロック5、ホストインターフェースブロック7、ワークエリア8、バッファ9、フラッシュメモリインターフェースブロック10、及びECCブロック11と同等のものである。   The host interface control block 25, the host interface block 27, the work area 28, the buffer 29, the flash memory interface block 30, and the ECC block 31 are the host interface control block 5, the host interface block 7, and the work area 8 of the first embodiment. , The buffer 9, the flash memory interface block 10, and the ECC block 11.

[フラッシュメモリ22に対するアクセスの説明]
次に、フラッシュメモリ22に対するアクセスを行う場合のフラッシュメモリシステム21の動作を、図面を参照して説明する。
[Description of Access to Flash Memory 22]
Next, the operation of the flash memory system 21 when the flash memory 22 is accessed will be described with reference to the drawings.

フラッシュメモリ22の記憶領域は、それぞれ複数のページ(P0〜P31)からなる物理ブロック(♯0,♯1,…)群で構成されている。各ページには、論理アドレス空間の1セクタ分のユーザデータが書き込まれる。ここで、本実施形態では、各物理ブロックのページP0〜P7の8ページをオリジナルデータ領域とし、ページP8〜P15の8ページを第1の更新データ領域とし、ページP16〜P23の8ページを第2の更新データ領域とし、ページP24〜P31の8ページを第3の更新データ領域とし、各物理ブロック♯0,♯1,…には、論理アドレス空間の8セクタ分のユーザデータとその書き替えデータとが書き込まれる。従って、一括消去単位の各物理ブロック♯0,♯1,…に対応する論理ブロックは、8セクタで構成される。   The storage area of the flash memory 22 is composed of a group of physical blocks (# 0, # 1,...) Each composed of a plurality of pages (P0 to P31). Each page is written with user data for one sector of the logical address space. Here, in this embodiment, 8 pages of pages P0 to P7 of each physical block are set as the original data area, 8 pages of pages P8 to P15 are set as the first update data area, and 8 pages of pages P16 to P23 are set as the first page. 2 update data areas, 8 pages P24 to P31 are the third update data areas, and each physical block # 0, # 1,... Has user data for 8 sectors in the logical address space and its rewrite. Data is written. Therefore, the logical block corresponding to each physical block # 0, # 1,... In the batch erase unit is composed of 8 sectors.

メモリコントローラ23は、論理ブロックLB0,LB1,…と物理ブロック♯0,♯1,…との対応関係を示したアドレス変換テーブルを作成し、このアドレス変換テーブルを用いてアクセスするページのアドレスを求める。
アドレス変換テーブルを利用した書き込み処理を図9及び図10を参照して説明する。
The memory controller 23 creates an address conversion table showing the correspondence between the logical blocks LB0, LB1,... And the physical blocks # 0, # 1,..., And obtains the address of the page to be accessed using this address conversion table. .
Write processing using the address conversion table will be described with reference to FIGS.

図9及び図10は、書き込み処理を示すフローチャートである。
フラッシュメモリ22にユーザデータを書き込む場合、ホストシステム24は、書き込みコマンドとユーザデータと論理アドレス情報とをメモリコントローラ23に与える。対象の指定は、論理アドレス空間上の位置を示す論理アドレス情報で示される。
9 and 10 are flowcharts showing the writing process.
When writing user data to the flash memory 22, the host system 24 gives a write command, user data, and logical address information to the memory controller 23. The designation of the target is indicated by logical address information indicating a position in the logical address space.

論理アドレス情報は、所定のビット幅を有する2進数であり、上位側が論理ブロックLB0,LB1,…を示し、下位側の3ビットが各論理ブロックLB0,LB1,…におけるセクタ番号を示す。また、論理アドレス情報の下位側3ビットは、オリジナルデータ記憶部、第1の更新データ記憶部、第2の更新データ記憶部及び第3の更新データ記憶部内のページ番号を表す。
連続するセクタをアクセス対象とする場合、ホストシステム24は、論理アドレス情報によってアクセス対象の先頭のセクタを示すと共に、アクセス対象となるセクタの数を指定する。この場合、メモリコントローラ23のマイクロプロセッサ26が、ホストシステム24が指定する各アクセス対象のセクタに対応する論理アドレス情報を順次生成する。
The logical address information is a binary number having a predetermined bit width, the upper side indicates the logical blocks LB0, LB1,..., And the lower 3 bits indicate the sector numbers in the logical blocks LB0, LB1,. The lower 3 bits of the logical address information represent page numbers in the original data storage unit, the first update data storage unit, the second update data storage unit, and the third update data storage unit.
When making consecutive sectors to be accessed, the host system 24 indicates the head sector to be accessed by the logical address information and specifies the number of sectors to be accessed. In this case, the microprocessor 26 of the memory controller 23 sequentially generates logical address information corresponding to each access target sector designated by the host system 24.

メモリコントローラ23のマイクロプロセッサ26は、ホストシステム24から書き込みコマンド及び論理アドレス情報とセクタ数が与えられると、そのセクタ数を内蔵するカウンタに設定し、書き込みを行うごとに設定したセクタ数をデクリメントすると共に、次に書き込みを行う論理アドレス情報を作成する。カウンタに設定されているセクタ数が0になると、次に書き込みを行うユーザデータがないと判断し、マイクロプロセッサ26は、論理アドレス情報を生成せず、書き込み処理を終了する(ステップS41:NO)。   When a write command, logical address information, and the number of sectors are given from the host system 24, the microprocessor 26 of the memory controller 23 sets the number of sectors in a built-in counter, and decrements the set number of sectors every time writing is performed. At the same time, logical address information to be written next is created. When the number of sectors set in the counter becomes 0, it is determined that there is no user data to be written next, and the microprocessor 26 does not generate logical address information and ends the writing process (step S41: NO). .

メモリコントローラ23は、マイクロプロセッサ26が次に書き込みを行うユーザデータがあると判断し、論理アドレス情報を生成した場合(ステップS41:YES)、論理アドレス情報の上位側で指定される論理ブロックに対応する物理ブロックを対象ブロックとしてアドレス変換テーブルから検索する(ステップS42)。   When the memory controller 23 determines that there is user data to be written next by the microprocessor 26 and generates logical address information (step S41: YES), the memory controller 23 corresponds to the logical block specified on the upper side of the logical address information. The physical block to be searched is searched from the address conversion table as a target block (step S42).

ステップS42の検索の結果、ホストシステム24が指定する論理ブロックに対応する物理ブロックがアドレス変換テーブルから求められない場合(ステップS43:NO)、消去済の1つの物理ブロックを対象ブロックとし、論理アドレスの下位側が示す論理ブロック内のセクタ番号を、その対象ブロックのアクセス対象ページの番号とする。   If the physical block corresponding to the logical block designated by the host system 24 is not obtained from the address conversion table as a result of the search in step S42 (step S43: NO), one erased physical block is set as the target block, and the logical address The sector number in the logical block indicated by the lower side is the number of the access target page of the target block.

メモリコントローラ23は、フラッシュメモリ22の対象ブロックとなった消去済ブロックのアクセス対象ページのユーザ領域に、ユーザデータを書き込むと共にそのアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS44)。   The memory controller 23 writes the user data to the user area of the access target page of the erased block that is the target block of the flash memory 22 and stores the logical block address as the corresponding logical address information in the redundant area of the access target page. Additional data such as error correction code and block status is written (step S44).

さらに、メモリコントローラ23は、アドレス変換テーブルに、対象ブロックとなった物理ブロックの番号と、その物理ブロックに対応する論理ブロックの番号を対応させて書き込む(ステップS45)。即ち、アドレス変換テーブルを更新する。   Further, the memory controller 23 writes the number of the physical block that is the target block and the number of the logical block corresponding to the physical block in the address conversion table (step S45). That is, the address conversion table is updated.

ステップS42の検索で、対象ブロックとなる物理ブロックが検出された場合(ステップS43:YES)、そのフラッシュメモリ22の対象ブロックの冗長領域を調べ、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号をアクセス対象ページの番号とし、そのアクセス対象ページにユーザデータが書き込まれていないか書き込まれているか否かを判定する(ステップS46)。   When the physical block that is the target block is detected in the search in step S42 (step S43: YES), the redundant area of the target block in the flash memory 22 is checked, and the sector number in the logical block indicated by the lower side of the logical address is set. The equal number is set as the access target page number, and it is determined whether or not user data is written in the access target page (step S46).

ステップS46の判定の結果、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号のページに、ユーザデータが書き込まれていないことが判定されたとき(ステップS46:YES)、メモリコントローラ23は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号のページをアクセス対象のページとし、ホストシステム24から与えられたユーザデータを書き込む(ステップS47)。このとき、メモリコントローラ23は、新たにユーザデータを書き込んだアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む。   As a result of the determination in step S46, when it is determined that the user data is not written in the page having the number equal to the sector number in the logical block indicated by the lower side of the logical address (step S46: YES), the memory controller 23 The page having the number equal to the sector number in the logical block indicated by the lower side of the logical address is set as the page to be accessed, and the user data given from the host system 24 is written (step S47). At this time, the memory controller 23 writes additional data such as the logical block address, error correction code, and block status as the corresponding logical address information in the redundant area of the access target page in which the user data is newly written.

ステップS46の判定の結果、論理アドレス情報の下位側が示す論理ブロック内のセクタ番号に等しい番号のページに、すでにユーザデータが書き込まれていると判定された場合(ステップS46:NO)、メモリコントローラ23は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に、8(物理ブロックのオリジナルデータ記憶部のページ数に相当)を加算し、この8を加算した番号を対象ブロックの新たなアクセス対象ページとする。即ち、第1の更新データ記憶部に新たなアクセス対象ページか移されたことになる。メモリコントローラ23は、対象ブロック冗長領域を調べ、その対象ブロックの新たなアクセス対象ページに、すでにユーザデータが書き込まれているか、否かを判定する(ステップS48)。   As a result of the determination in step S46, when it is determined that the user data has already been written in the page having the same number as the sector number in the logical block indicated by the lower side of the logical address information (step S46: NO), the memory controller 23 Adds 8 (equivalent to the number of pages in the original data storage section of the physical block) to the sector number in the logical block indicated by the lower side of the logical address, and adds the number obtained by adding 8 to the new access target page of the target block And That is, the new access target page is moved to the first update data storage unit. The memory controller 23 checks the target block redundant area, and determines whether or not user data has already been written in the new access target page of the target block (step S48).

ステップS48の判定の結果、論理アドレス情報の下位側が示す論理ブロック内のセクタ番号に8を加算した値に等しい番号のページに、ユーザデータが書き込まれていないことが判定されたとき(ステップS48:YES)、メモリコントローラ23は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に8を加算した番号のページを新たなアクセス対象ページとし、ホストシステム24から与えられたユーザデータを書き込む(ステップS49)。このとき、メモリコントローラ23は、新たにユーザデータを書き込んだアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む。   As a result of the determination in step S48, when it is determined that user data is not written in a page having a number equal to the value obtained by adding 8 to the sector number in the logical block indicated by the lower side of the logical address information (step S48: YES), the memory controller 23 writes the user data given from the host system 24 with the page having a number obtained by adding 8 to the sector number in the logical block indicated by the lower side of the logical address as a new access target page (step S49). ). At this time, the memory controller 23 writes additional data such as the logical block address, error correction code, and block status as the corresponding logical address information in the redundant area of the access target page in which the user data is newly written.

ステップS48の判定の結果、論理アドレス情報の下位側が示す論理ブロック内のセクタ番号に8を加算した番号のページに、すでにユーザデータが書き込まれていると判定された場合(ステップS48:NO)、メモリコントローラ23は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に、16(物理ブロックのオリジナルデータ記憶部及び第1の更新データ記憶部のページ数に相当)を加算し、この16を加算した番号を対象ブロックの新たなアクセス対象ページとする。即ち、第2の更新データ記憶部に新たなアクセス対象ページが移されたことになる。メモリコントローラ23は、対象ブロック冗長領域を調べ、その対象ブロックの新たなアクセス対象ページに、すでにユーザデータが書き込まれているか、否かを判定する(ステップS50)。   As a result of the determination in step S48, when it is determined that user data has already been written in the page of the number obtained by adding 8 to the sector number in the logical block indicated by the lower side of the logical address information (step S48: NO) The memory controller 23 adds 16 (corresponding to the number of pages of the original data storage unit and the first update data storage unit of the physical block) to the sector number in the logical block indicated by the lower side of the logical address, and adds this 16 This number is set as a new access target page of the target block. That is, a new access target page is moved to the second update data storage unit. The memory controller 23 checks the target block redundant area, and determines whether user data has already been written in the new access target page of the target block (step S50).

ステップS50の判定の結果、論理アドレス情報の下位側が示す論理ブロック内のセクタ番号に16を加算した値に等しい番号のページに、ユーザデータが書き込まれていないことが判定されたとき(ステップS50:YES)、メモリコントローラ23は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に16を加算した番号のページを新たなアクセス対象のページとし、ホストシステム24から与えられたユーザデータを書き込む(ステップS51)。このとき、メモリコントローラ23は、新たにユーザデータを書き込んだアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む。   As a result of the determination in step S50, when it is determined that no user data is written in a page having a number equal to the value obtained by adding 16 to the sector number in the logical block indicated by the lower side of the logical address information (step S50: YES), the memory controller 23 sets the page of the number obtained by adding 16 to the sector number in the logical block indicated by the lower side of the logical address as a new page to be accessed, and writes the user data given from the host system 24 (step) S51). At this time, the memory controller 23 writes additional data such as the logical block address, error correction code, and block status as the corresponding logical address information in the redundant area of the access target page in which the user data is newly written.

ステップS50の判定の結果、論理アドレス情報の下位側が示す論理ブロック内のセクタ番号に16を加算した番号のページに、すでにユーザデータが書き込まれていると判定された場合(ステップS50:NO)、メモリコントローラ23は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に、24(物理ブロックのオリジナルデータ記憶部、第1の更新データ記憶部及び第2の更新データ記憶部のページ数に相当)を加算し、この24を加算した番号を対象ブロックの新たなアクセス対象ページとする。即ち、第3の更新データ記憶部に新たなアクセス対象ページが移されたことになる。メモリコントローラ23は、対象ブロック冗長領域を調べ、その対象ブロックの新たなアクセス対象ページに、すでにユーザデータが書き込まれているか、否かを判定する(ステップS52)。   As a result of the determination in step S50, when it is determined that user data has already been written in the page having a number obtained by adding 16 to the sector number in the logical block indicated by the lower side of the logical address information (step S50: NO) The memory controller 23 sets the sector number in the logical block indicated by the lower side of the logical address to 24 (corresponding to the number of pages of the original data storage unit, the first update data storage unit, and the second update data storage unit of the physical block). And the number obtained by adding 24 is set as a new access target page of the target block. That is, a new access target page is moved to the third update data storage unit. The memory controller 23 checks the target block redundant area, and determines whether or not user data has already been written in the new access target page of the target block (step S52).

ステップS52の判定の結果、対象ブロックの新たなアクセス対象ページに、ユーザデータが書き込まれていないことが判定されたとき(ステップS52:YES)、メモリコントローラ23は、対象ブロックの新たなアクセス対象ページにユーザデータを書き込む(ステップS53)。メモリコントローラ23は、これと同時に、ユーザデータを書き込んだアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む。   As a result of the determination in step S52, when it is determined that no user data is written in the new access target page of the target block (step S52: YES), the memory controller 23 determines that the new access target page of the target block. User data is written in (step S53). At the same time, the memory controller 23 writes additional data such as the logical block address, error correction code, and block status as the corresponding logical address information in the redundant area of the access target page in which the user data is written.

ステップS52の判定の結果、対象ブロックの新たなアクセス対象ページに、ユーザデータが書き込まれていることが判定されたとき(ステップS52:YES)、メモリコントローラ23は、消去済の1つの物理ブロックを新たな対象ブロックとし、論理アドレスの下位側が示す論理ブロック内のセクタ番号を、その新たな対象ブロックのアクセス対象ページの番号とする。   As a result of the determination in step S52, when it is determined that user data has been written in the new access target page of the target block (step S52: YES), the memory controller 23 stores one erased physical block. As a new target block, the sector number in the logical block indicated by the lower side of the logical address is set as the access target page number of the new target block.

メモリコントローラ23は、フラッシュメモリ22の新たな対象ブロックとなった消去済ブロックのアクセス対象ページのユーザ領域に、ユーザデータを書き込むと共にそのアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS54)。   The memory controller 23 writes user data to the user area of the access target page of the erased block that has become the new target block of the flash memory 22, and stores the logical block as the corresponding logical address information in the redundant area of the access target page The additional data such as the address, error correction code, block status, etc. is written (step S54).

また、メモリコントローラ23は、アドレス変換テーブルに、新たな対象ブロックとなった物理ブロックの番号と、その物理ブロックに対応する論理ブロックの番号を対応させて書き込む(ステップS55)。即ち、アドレス変換テーブルを更新する。   Further, the memory controller 23 writes the number of the physical block that became the new target block in the address conversion table in association with the number of the logical block corresponding to the physical block (step S55). That is, the address conversion table is updated.

さらに、メモリコントローラ23は、新たな対象ブロックのアクセス対象ページ以外のページに、元の対象ブロック(ステップS46で判定を行った物理ブロック)の対応するページに書き込まれているユーザデータ、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS56)。この際、アクセス対象ページよりページ番号の小さいページについては、アクセス対象ページへの書き込みの前に、ユーザデータ等を転写する。   Further, the memory controller 23 sets the user data and the corresponding logical address written in the page corresponding to the original target block (the physical block determined in step S46) on the page other than the access target page of the new target block. Additional data such as the logical block address, error correction code, and block status is written as information (step S56). At this time, for a page having a page number smaller than that of the access target page, user data or the like is transferred before writing to the access target page.

このとき、元の対象ブロックのオリジナルデータ記憶領部、第1の更新データ記憶部、第2の更新データ記憶部及び第3の更新データ記憶部の4カ所に同じセクタに対応して書き込まれているユーザデータ及び付加データがあれば、第3の更新データ記憶部に書き込まれているユーザデータ及び付加データを、新たな対象ブロックのオリジナルデータ記憶部に書き込む。   At this time, it is written corresponding to the same sector in four locations of the original data storage area, the first update data storage section, the second update data storage section, and the third update data storage section of the original target block. If there is user data and additional data, the user data and additional data written in the third update data storage unit are written in the original data storage unit of the new target block.

また、オリジナルデータ記憶部、第1の更新データ記憶部、第2の更新データ記憶部の3カ所に同じセクタに対応して書き込まれているユーザデータ及び付加データがあれば、第2の更新データ記憶部に書き込まれているユーザデータ及び付加データを、新たな対象ブロックのオリジナルデータ記憶部の対応するページに書き込む。オリジナルデータ記憶部及び第1の更新データ記憶部の2カ所に同じセクタに対応して書き込まれているユーザデータ及び付加データがあれば、第1の更新データ記憶部に書き込まれているユーザデータ及び付加データを、新たな対象ブロックのオリジナルデータ記憶部の対応するページに書き込む。つまり、第3の更新データ記憶部、第2の更新データ記憶部、第1の更新データ記憶部、オリジナルデータ記憶部の優先順位で、ユーザデータの転写を行う。
そして、元の対象ブロックのすべてのページを一括消去し、消去済ブロックにする(ステップS57)。
In addition, if there is user data and additional data written corresponding to the same sector at three locations of the original data storage unit, the first update data storage unit, and the second update data storage unit, the second update data The user data and additional data written in the storage unit are written in the corresponding pages of the original data storage unit of the new target block. If there is user data and additional data written corresponding to the same sector in two places of the original data storage unit and the first update data storage unit, the user data written in the first update data storage unit and The additional data is written in the corresponding page of the original data storage unit of the new target block. That is, the user data is transferred in the priority order of the third update data storage unit, the second update data storage unit, the first update data storage unit, and the original data storage unit.
Then, all the pages of the original target block are erased at once to make an erased block (step S57).

[フラッシュメモリ22に対する読み出し処理]
次に、フラッシュメモリ22に対する読み出し処理の動作を、図11を参照して説明する。
図11は、読み出し処理を示すフローチャートである。
[Reading process to the flash memory 22]
Next, the read processing operation for the flash memory 22 will be described with reference to FIG.
FIG. 11 is a flowchart showing the reading process.

フラッシュメモリ22からユーザデータを読み出す場合、メモリコントローラ23のマイクロプロセッサ26は、ホストシステム24から読み出しコマンド及び論理アドレス情報とセクタ数が与えられると、そのセクタ数を内蔵するカウンタに設定し、読み出しを行うごとに、カウンタに設定されたセクタ数をデクリメントする。そして、カウンタに設定されたセクタ数が0以外のときに、次に読み出すユーザデータが有ると判断して次に読み出すユーザデータの論理アドレス情報を生成する、カウンタに設定されているセクタ数が0のときには、次に読み出しを行うユーザデータがないと判断し(ステップS61:NO)、マイクロプロセッサ26は、論理アドレス情報を生成せず、読み出し処理を終了する。   When reading user data from the flash memory 22, the microprocessor 26 of the memory controller 23, when given a read command, logical address information, and the number of sectors from the host system 24, sets the number of sectors in a built-in counter and performs reading. Each time it is done, the number of sectors set in the counter is decremented. When the number of sectors set in the counter is other than 0, it is determined that there is user data to be read next, and logical address information of the user data to be read next is generated. The number of sectors set in the counter is 0 In this case, it is determined that there is no user data to be read next (step S61: NO), and the microprocessor 26 does not generate logical address information and ends the reading process.

メモリコントローラ23は、マイクロプロセッサ26が次に読み出しを行うユーザデータがあると判断して論理アドレス情報を生成した場合(ステップS61:YES)、論理アドレス情報の上位側で指定される論理ブロックに対応する物理ブロックを、対象ブロックとしてアドレス変換テーブルから検索する(ステップS62)。   When the memory controller 23 determines that there is user data to be read next by the microprocessor 26 and generates logical address information (step S61: YES), the memory controller 23 corresponds to the logical block specified on the upper side of the logical address information. The physical block to be searched is searched from the address conversion table as a target block (step S62).

メモリコントローラ23は、論理アドレス情報の下位側で指定される論理ブロックのセクタ番号に24(物理ブロックのオリジナルデータ記憶部、第1の更新データ記憶部及び第2の更新データ記憶部のページ数に相当)を加算し、これをアクセス対象ページを示す番号とし、ステップS62で検出された対象ブロックのアクセス対象ページを示す物理アドレスを作成し、その物理アドレスで示されるページの冗長領域を調べ、対象ブロックのアクセス対象ページにユーザデータが書き込まれているか否かを判定する(ステップS63)。即ち、第3の更新データ記憶部にアクセス対象のユーザデータが有るか否かを判定している。   The memory controller 23 sets the sector number of the logical block specified on the lower side of the logical address information to 24 (the number of pages of the original data storage unit, the first update data storage unit, and the second update data storage unit of the physical block). The physical address indicating the access target page of the target block detected in step S62 is created, the redundant area of the page indicated by the physical address is examined, and the target It is determined whether or not user data is written in the access target page of the block (step S63). That is, it is determined whether there is user data to be accessed in the third update data storage unit.

対象ブロックのアクセス対象ページにユーザデータが書き込まれていると判定した場合(ステップS63:YES)、メモリコントローラ23は、対象ブロックのアクセス対象ページのユーザ領域に書き込まれていたユーザデータを読み出す(ステップS64)。このとき、冗長領域に記憶されている誤り訂正符号により、ユーザデータの誤りが検出された時には、読み出したユーザデータの訂正を行う。   If it is determined that user data is written in the access target page of the target block (step S63: YES), the memory controller 23 reads the user data written in the user area of the access target page of the target block (step S63). S64). At this time, when an error of the user data is detected by the error correction code stored in the redundant area, the read user data is corrected.

ステップS63の判定で、対象ブロックのアクセス対象ページにユーザデータが書き込まれていないと判定した場合(ステップS63:NO)、メモリコントローラ23は、論理アドレス情報の下位側で指定される論理ブロックのセクタ番号に16(物理ブロックのオリジナルデータ記憶部及び第1の更新データ記憶部のページ数に相当)を加算し、これを新たなアクセス対象ページを示す番号とし、ステップS62で検出された対象ブロックのアクセス対象ページを示す新たな物理アドレスを作成し、その新たな物理アドレスで示されるページの冗長領域を調べ、新たな対象ブロックのアクセス対象ページにユーザデータが書き込まれているか否かを判定する(ステップS65)。即ち、第2の更新データ記憶部にアクセス対象のユーザデータが有るか否かを判定している。   If it is determined in step S63 that user data is not written in the access target page of the target block (step S63: NO), the memory controller 23 determines the sector of the logical block specified on the lower side of the logical address information. 16 is added to the number (corresponding to the number of pages in the original data storage unit and the first update data storage unit of the physical block), and this is used as the number indicating the new access target page, and the target block detected in step S62 A new physical address indicating the access target page is created, the redundant area of the page indicated by the new physical address is checked, and it is determined whether or not user data is written in the access target page of the new target block ( Step S65). That is, it is determined whether there is user data to be accessed in the second update data storage unit.

ステップS65で新たな対象ブロックのアクセス対象ページにユーザデータが書き込まれていると判定した場合(ステップS65:YES)、メモリコントローラ23は、対象ブロックのアクセス対象ページのユーザ領域に書き込まれていたユーザデータを読み出す(ステップS66)。このとき、冗長領域に記憶されている誤り訂正符号により、ユーザデータの誤りが検出された時には、読み出したユーザデータの訂正を行う。   If it is determined in step S65 that user data has been written to the access target page of the new target block (step S65: YES), the memory controller 23 has written the user data in the user area of the access target page of the target block. Data is read (step S66). At this time, when an error of the user data is detected by the error correction code stored in the redundant area, the read user data is corrected.

ステップS65の判定で、対象ブロックのアクセス対象ページにユーザデータが書き込まれていないと判定した場合(ステップS65:NO)、メモリコントローラ23は、論理アドレス情報の下位側で指定される論理ブロックのセクタ番号に8(物理ブロックのオリジナルデータ記憶部のページ数に相当)を加算し、これを新たなアクセス対象ページを示す番号とし、ステップS62で検出された対象ブロックのアクセス対象ページを示す新たな物理アドレスを作成し、その新たな物理アドレスで示されるページの冗長領域を調べ、新たな対象ブロックのアクセス対象ページにユーザデータが書き込まれているか否かを判定する(ステップS67)。即ち、第1の更新データ記憶部にアクセス対象のユーザデータが有るか否かを判定する。   If it is determined in step S65 that no user data is written in the access target page of the target block (step S65: NO), the memory controller 23 determines the sector of the logical block specified on the lower side of the logical address information. 8 (corresponding to the number of pages in the original data storage unit of the physical block) is added to the number, and this is used as the number indicating the new access target page, and the new physical indicating the access target page of the target block detected in step S62 An address is created, the redundant area of the page indicated by the new physical address is checked, and it is determined whether user data has been written to the access target page of the new target block (step S67). That is, it is determined whether there is user data to be accessed in the first update data storage unit.

ステップS67で新たな対象ブロックのアクセス対象ページにユーザデータが書き込まれていると判定した場合(ステップS67:YES)、メモリコントローラ23は、対象ブロックのアクセス対象ページのユーザ領域に書き込まれていたユーザデータを読み出す(ステップS68)。このとき、冗長領域に記憶されている誤り訂正符号により、ユーザデータの誤りが検出された時には、読み出したユーザデータの訂正を行う。   If it is determined in step S67 that user data has been written to the access target page of the new target block (step S67: YES), the memory controller 23 has written the user data in the user area of the access target page of the target block. Data is read (step S68). At this time, when an error of the user data is detected by the error correction code stored in the redundant area, the read user data is corrected.

ステップS67の判定で、対象ブロックのアクセス対象ページにユーザデータが書き込まれていないと判定した場合(ステップS67:NO)、メモリコントローラ23は、論理アドレス情報の下位側で指定される論理ブロックのセクタ番号を新たなアクセス対象ページを示す番号とし、ステップS62で検出された対象ブロックの新たなアクセス対象ページを示す物理アドレスを作成し、対象ブロックの新たなアクセス対象ページのユーザ領域に書き込まれていたユーザデータを読み出す(ステップS69)。このとき、冗長領域に記憶されている誤り訂正符号により、ユーザデータの誤りが検出された時には、読み出したユーザデータの訂正を行う。   If it is determined in step S67 that no user data is written in the access target page of the target block (step S67: NO), the memory controller 23 determines the sector of the logical block specified on the lower side of the logical address information. The physical address indicating the new access target page of the target block detected in step S62 is created with the number indicating the new access target page, and is written in the user area of the new access target page of the target block User data is read (step S69). At this time, when an error of the user data is detected by the error correction code stored in the redundant area, the read user data is corrected.

以上のように、本実施形態のフラッシュメモリシステムは、フラッシュメモリ22の各物理ブロックを、書き替え前のユーザデータを書き込むオリジナルデータ記憶部と、オリジナル記憶部に書き込まれたユーザデータの書き替えデータを書き込む第1の更新データ記憶部と、第1の更新データ記憶部に書き込まれたデータの書き替えデータを書き込む第2の更新データ記憶部と、第2の更新データ記憶部に書き込まれたデータの書き替えデータを書き込む第3の更新データ記憶部とに分割している。これにより、第1の実施形態と同様、消去済みブロックに書き替えが発生した物理ブロックのユーザデータ等を転写する処理や、不要になった物理ブロックを消去する処理を、従来よりも減じることができる。   As described above, in the flash memory system of the present embodiment, each physical block of the flash memory 22 has an original data storage unit that writes user data before rewriting, and rewrite data of user data written in the original storage unit. The first update data storage unit for writing the data, the second update data storage unit for writing the rewrite data of the data written in the first update data storage unit, and the data written in the second update data storage unit Are divided into a third update data storage unit for writing the rewrite data. As a result, as in the first embodiment, the process of transferring user data or the like of a physical block that has been rewritten to an erased block, or the process of erasing a physical block that is no longer needed can be reduced compared to the prior art. it can.

その上、同じセクタのユーザデータを3回書き替えても、他のユーザデータの転写や、不要になった物理ブロックの消去を行わなくて済むので、第1の実施形態よりも能率的である。   In addition, even if the user data in the same sector is rewritten three times, it is not necessary to transfer other user data or erase physical blocks that are no longer needed, which is more efficient than the first embodiment. .

[第3の実施形態]
図12は、本発明の第3の実施形態に係るフラッシュメモリシステム41の概要を示す構成図である。
[Third Embodiment]
FIG. 12 is a configuration diagram showing an outline of a flash memory system 41 according to the third embodiment of the present invention.

図12に示したように、フラッシュメモリシステム41は、フラッシュメモリ42と、それを制御するメモリコントローラ43で構成され、ホストシステム44に着脱可能に装着される。   As shown in FIG. 12, the flash memory system 41 includes a flash memory 42 and a memory controller 43 that controls the flash memory 42, and is detachably attached to the host system 44.

[フラッシュメモリ42の説明]
このフラッシュメモリシステム41において、データが記憶されるフラッシュメモリ42は、NAND型フラッシュメモリで構成され、第1の実施形態のフラッシュメモリ2と同様に、1物理ブロックが32ページ(P0〜P31)で構成され、各ページが512バイトのユーザ領域と16バイトの冗長領域で構成されている。物理ブロックの各ページのユーザ領域は、ユーザデ―タやその書き替えデータが記憶される領域であり、冗長領域は、誤り訂正符号、対応論理アドレス情報及びブロックステータス等の付加データが記憶される領域である。
[Description of flash memory 42]
In the flash memory system 41, the flash memory 42 in which data is stored is composed of a NAND flash memory. Like the flash memory 2 of the first embodiment, one physical block is 32 pages (P0 to P31). Each page consists of a 512-byte user area and a 16-byte redundant area. The user area of each page of the physical block is an area for storing user data and its rewrite data, and the redundant area is an area for storing additional data such as error correction code, corresponding logical address information, and block status. It is.

図13は、フラッシュメモリ42の構成を示す図である。
本実施形態のフラッシュメモリシステム41では、フラッシュメモリ42の各物理ブロックを、書き替え前のユーザデータを書き込むオリジナルデータ記憶部と、オリジナル記憶部に書き込まれたユーザデータの書き替えデータを書き込む更新データ記憶部とに分割している。具体的には、フラッシュメモリ42の各物理ブロックのページP0〜P15の16ページを、書き替え前のデータ(オリジナルデータ)を書き込むためのオリジナルデータ記憶部とし、ページP16〜P31を書き替えデータを書き込むための更新データ記憶部とする。
FIG. 13 is a diagram showing a configuration of the flash memory 42.
In the flash memory system 41 of the present embodiment, each physical block of the flash memory 42 has an original data storage unit that writes user data before rewriting, and update data that writes rewrite data of user data written to the original storage unit. It is divided into a storage unit. Specifically, 16 pages of pages P0 to P15 of each physical block of the flash memory 42 are used as an original data storage unit for writing data (original data) before rewriting, and pages P16 to P31 are used as rewriting data. An update data storage unit for writing is used.

各物理ブロックにおけるオリジナルデータ記憶部と更新データ記憶部の容量は第1の実施形態と同様であるが、第1の実施形態とは異なり、これらのオリジナルデータ記憶部のページと更新データ記憶部のページとが一対一に対応しない。   The capacities of the original data storage unit and the update data storage unit in each physical block are the same as in the first embodiment, but unlike the first embodiment, the pages of these original data storage units and the update data storage unit There is no one-to-one correspondence with pages.

オリジナルデータ記憶部のページ或いは更新データ記憶部のページにすでに書き込まれているデータに書き替えが発生すると、その書き替えデータを、更新データ記憶部の未書き込みの空いているページの若番側から順次書き込むように、更新データ記憶部を使用する。   When rewriting occurs in the data already written in the page of the original data storage unit or the page of the update data storage unit, the rewriting data is transferred from the younger side of the unwritten empty page in the update data storage unit. The update data storage unit is used so as to write sequentially.

[メモリコントローラ43の説明]
メモリコントローラ43は、ホストインターフェース制御ブロック45と、マイクロプロセッサ46と、ホストインターフェースブロック47と、ワークエリア48と、バッファ49と、フラッシュメモリインターフェースブロック50と、ECC(エラー・コレクション・コード)ブロック51と、フラッシュメモリシーケンサブロック52とから構成される。これら機能ブロックによって構成されるメモリコントローラ43は、一つの半導体チップ上に集積されている。ホストシステム44とホストインターフェースブロック47とが外部バス53で接続され、フラッシュメモリ42とフラッシュメモリインターフェースブロック50とが、内部バス54で接続されている。
[Description of Memory Controller 43]
The memory controller 43 includes a host interface control block 45, a microprocessor 46, a host interface block 47, a work area 48, a buffer 49, a flash memory interface block 50, and an ECC (Error Collection Code) block 51. And a flash memory sequencer block 52. The memory controller 43 constituted by these functional blocks is integrated on one semiconductor chip. The host system 44 and the host interface block 47 are connected by an external bus 53, and the flash memory 42 and the flash memory interface block 50 are connected by an internal bus 54.

マイクロプロセッサ46は、メモリコントローラ43を構成する各機能ブロック全体の、動作を制御する機能ブロックである。フラッシュメモリシーケンサーブロック52は、フラッシュメモリ42に対するアクセスを制御する機能ブロックであり、内蔵する複数のレジスタに、フラッシュメモリ42に対するアクセス処理を実行する際に必要な情報が、マイクロプロセッサ46によって設定される。この複数のレジスタに設定された情報に基づいて、内部コマンド、アドレス情報等がフラッシュメモリ42に供給される。   The microprocessor 46 is a functional block that controls the operation of all the functional blocks constituting the memory controller 43. The flash memory sequencer block 52 is a functional block that controls access to the flash memory 42, and information necessary for executing access processing to the flash memory 42 is set by a microprocessor 46 in a plurality of built-in registers. . Based on the information set in the plurality of registers, internal commands, address information, and the like are supplied to the flash memory 42.

ホストインターフェース制御ブロック45、ホストインターフェースブロック47、ワークエリア48、バッファ49、フラッシュメモリインターフェースブロック50、及びECCブロック51は、第1の実施形態のホストインターフェース制御ブロック5、ホストインターフェースブロック7、ワークエリア8、バッファ9、フラッシュメモリインターフェースブロック10、及びECCブロック11と同等のものである。   The host interface control block 45, host interface block 47, work area 48, buffer 49, flash memory interface block 50, and ECC block 51 are the host interface control block 5, host interface block 7, work area 8 of the first embodiment. , The buffer 9, the flash memory interface block 10, and the ECC block 11.

[フラッシュメモリ42に対するアクセスの説明]
次に、フラッシュメモリ42に対するアクセスを行う場合のフラッシュメモリシステム41の動作を、図面を参照して説明する。
[Description of Access to Flash Memory 42]
Next, the operation of the flash memory system 41 when accessing the flash memory 42 will be described with reference to the drawings.

図14は、論理アドレス空間と物理アドレス空間を示す説明図であり、論理アドレスで表される論理アドレス空間が、セクタ単位で付けた連番であるLBAで、示している。   FIG. 14 is an explanatory diagram showing a logical address space and a physical address space. The logical address space represented by the logical address is indicated by LBA, which is a serial number assigned in units of sectors.

フラッシュメモリ42の記憶領域は、それぞれ複数のページ(P0〜P31)からなる物理ブロック(♯0,♯1,…)群で構成されている。各ページには、論理アドレス空間の1セクタ分のユーザデータが書き込まれる。ここで、本実施形態では、各物理ブロックのページP0〜P15の16ページをオリジナルデータ記憶部とし、ページP16〜P31の16ページを更新データ記憶部としている。各物理ブロック♯0,♯1,…には、論理アドレス空間の16セクタ分のユーザデータとその書き替えデータとが書き込まれる。従って、一括消去単位の各物理ブロック♯0,♯1,…に対応する論理ブロックは、16セクタで構成される。   The storage area of the flash memory 42 includes a group of physical blocks (# 0, # 1,...) Each composed of a plurality of pages (P0 to P31). Each page is written with user data for one sector of the logical address space. Here, in this embodiment, 16 pages of pages P0 to P15 of each physical block are used as the original data storage unit, and 16 pages of pages P16 to P31 are used as the update data storage unit. In each physical block # 0, # 1,..., User data for 16 sectors in the logical address space and its rewrite data are written. Therefore, the logical block corresponding to each physical block # 0, # 1,... In the batch erase unit is composed of 16 sectors.

メモリコントローラ43は、論理ブロックLB0,LB1,…と物理ブロック♯0,♯1,…との対応関係を示したアドレス変換テーブルを作成し、このアドレス変換テーブルを用いてアクセスするページのアドレスを求める。
アドレス変換テーブルを利用した書き込み処理を図15及び図16を参照して説明する。
The memory controller 43 creates an address conversion table showing the correspondence between the logical blocks LB0, LB1,... And the physical blocks # 0, # 1,..., And obtains the address of the page to be accessed using this address conversion table. .
Write processing using the address conversion table will be described with reference to FIGS.

図15及び図16は、書込み処理を示すフローチャートである。
フラッシュメモリ42にユーザデータを書き込む場合、ホストシステム44は、書き込みコマンドとユーザデータと論理アドレス情報とをメモリコントローラ43に与える。対象の指定は、論理アドレス空間上の位置を示す論理アドレス情報で示す。
15 and 16 are flowcharts showing the writing process.
When writing user data to the flash memory 42, the host system 44 gives a write command, user data, and logical address information to the memory controller 43. The target designation is indicated by logical address information indicating a position in the logical address space.

論理アドレス情報は、所定のビット幅を有する2進数であり、上位側が論理ブロックLB0,LB1,…を示し、下位側の4ビットが各論理ブロックLB0,LB1,…におけるセクタ番号を示す。また、論理アドレス情報の下位側の4ビットは、オリジナルデータ記憶部内或いは更新データ記憶部内のページの番号を示す。   The logical address information is a binary number having a predetermined bit width, the upper side indicates the logical blocks LB0, LB1,..., And the lower 4 bits indicate the sector numbers in the logical blocks LB0, LB1,. The lower 4 bits of the logical address information indicate the page number in the original data storage unit or the update data storage unit.

連続するセクタをアクセス対象とする場合、ホストシステム44は、論理アドレス情報によってアクセス対象の先頭のセクタを示すと共に、アクセス対象となるセクタの数を指定する。この場合、メモリコントローラ43のマイクロプロセッサ46が、ホストシステム44が指定する各アクセス対象のセクタに対応する論理アドレス情報を順次生成する。   When consecutive sectors are to be accessed, the host system 44 indicates the top sector to be accessed by the logical address information and designates the number of sectors to be accessed. In this case, the microprocessor 46 of the memory controller 43 sequentially generates logical address information corresponding to each access target sector designated by the host system 44.

メモリコントローラ43のマイクロプロセッサ46は、ホストシステム44から書き込みコマンド及び論理アドレス情報とセクタ数が与えられると、そのセクタ数を内蔵するカウンタに設定し、書き込みを行うごとに設定したセクタ数をデクリメントすると共に、次に書き込みを行う論理アドレス情報を作成する。カウンタに設定されているセクタ数が0になると、次に書き込みを行うユーザデータがないと判断し(ステップS81:NO)、マイクロプロセッサ46は、論理アドレス情報を生成せず、書き込み処理を終了する。   When a write command, logical address information and the number of sectors are given from the host system 44, the microprocessor 46 of the memory controller 43 sets the number of sectors in a built-in counter and decrements the set number of sectors every time writing is performed. At the same time, logical address information to be written next is created. When the number of sectors set in the counter reaches 0, it is determined that there is no user data to be written next (step S81: NO), and the microprocessor 46 ends the write process without generating logical address information. .

メモリコントローラ43は、マイクロプロセッサ46が次に書き込みを行うユーザデータがあると判断し、論理アドレス情報を生成した場合(ステップS81:YES)、論理アドレス情報の上位側で指定される論理ブロックに対応する物理ブロックを対象ブロックとしてアドレス変換テーブルから検索する(ステップS82)。   When the memory controller 43 determines that there is user data to be written next by the microprocessor 46 and generates logical address information (step S81: YES), the memory controller 43 corresponds to the logical block specified on the upper side of the logical address information. The physical block to be searched is searched from the address conversion table as a target block (step S82).

ステップS82の検索の結果、ホストシステム44が指定する論理ブロックに対応する物理ブロックがアドレス変換テーブルから求められない場合(ステップS83:NO)、消去済の1つの物理ブロックを対象ブロックとし、論理アドレスの下位側が示す論理ブロック内のセクタ番号を、その対象ブロックのアクセス対象ページの番号とする。   If the physical block corresponding to the logical block designated by the host system 44 is not obtained from the address conversion table as a result of the search in step S82 (step S83: NO), one erased physical block is set as the target block, and the logical address The sector number in the logical block indicated by the lower side is the number of the access target page of the target block.

メモリコントローラ43は、フラッシュメモリ42の対象ブロックとなった消去済ブロックのアクセス対象ページのユーザ領域に、ユーザデータを書き込むと共にそのアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS84)。これにより、オリジナルデータとなるユーザデータが、オリジナルデータ記憶部に書き込まれたことになる。   The memory controller 43 writes the user data in the user area of the access target page of the erased block that is the target block of the flash memory 42 and addresses the logical block as corresponding logical address information in the redundant area of the access target page. Additional data such as error correction code and block status is written (step S84). As a result, the user data as the original data is written in the original data storage unit.

さらに、メモリコントローラ43は、アドレス変換テーブルに、対象ブロックとなった物理ブロックの番号と、その物理ブロックに対応する論理ブロックの番号を対応させて書き込む(ステップS85)。即ち、アドレス変換テーブルを更新する。   Further, the memory controller 43 writes the number of the physical block that is the target block in the address conversion table in association with the number of the logical block corresponding to the physical block (step S85). That is, the address conversion table is updated.

ステップS82の検索で、対象ブロックとなる物理ブロックが検出された場合(ステップS83:YES)、そのフラッシュメモリ42の対象ブロックの冗長領域を調べ、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号をアクセス対象ページの番号とし、そのアクセス対象ページにユーザデータが書き込まれていないか書き込まれているか否かを判定する(ステップS86)。   When the physical block that is the target block is detected in the search in step S82 (step S83: YES), the redundant area of the target block in the flash memory 42 is checked, and the sector number in the logical block indicated by the lower side of the logical address is set. The equal number is set as the access target page number, and it is determined whether or not user data is written in the access target page (step S86).

ステップS86の判定の結果、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号のページに、ユーザデータが書き込まれていないと判定されたとき(ステップS86:YES)、メモリコントローラ43は、論理アドレスの下位側が示す論理ブロック内のセクタ番号に等しい番号のページをアクセス対象のページとし、ホストシステム44から与えられたユーザデータを書き込む(ステップS87)。このとき、メモリコントローラ43は、新たにユーザデータを書き込んだアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む。これにより、オリジナルデータとなるユーザデータが、オリジナルデータ記憶部に書き込まれたことになる。   As a result of the determination in step S86, when it is determined that user data is not written in a page having a number equal to the sector number in the logical block indicated by the lower side of the logical address (step S86: YES), the memory controller 43 The page with the number equal to the sector number in the logical block indicated by the lower side of the logical address is set as the page to be accessed, and the user data given from the host system 44 is written (step S87). At this time, the memory controller 43 writes additional data such as the logical block address, error correction code, and block status as the corresponding logical address information in the redundant area of the access target page in which the user data is newly written. As a result, the user data as the original data is written in the original data storage unit.

ステップS86の判定の結果、論理アドレス情報の下位側が示す論理ブロック内のセクタ番号に等しい番号のページに、すでにユーザデータが書き込まれていると判定された場合(ステップS86:NO)、その論理ブロックに対応する物理ブロックの更新データ記憶部の冗長領域を調べ、ユーザデータの書き込まれていない空きページの有無を確認する(ステップS88)。
ステップS88で空きページがあると確認できた場合(ステップS88:YES)、空きページのうちの最も若番のページに、ホストシステム44から与えられたユーザデータを書き込む(ステップS89)。これにより、更新データ記憶部に書き替え後のデータが書き込まれたことになる。
As a result of the determination in step S86, when it is determined that user data has already been written in the page having the number equal to the sector number in the logical block indicated by the lower side of the logical address information (step S86: NO), the logical block The redundant area of the update data storage unit of the physical block corresponding to is checked, and it is confirmed whether there is an empty page in which user data is not written (step S88).
If it is confirmed in step S88 that there is a free page (step S88: YES), the user data given from the host system 44 is written to the youngest page among the free pages (step S89). As a result, the rewritten data is written in the update data storage unit.

このとき、メモリコントローラ43は、ステップS89でユーザデータが書き込まれたページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータを書き込むとともに、ユーザデータの論理ブロックにおけるセクタ番号を書き込んでおく。また、このときに、さらに、物理ブロック内のどのページに記憶されているデータが未書き替えで有効であるか否かを示す情報を冗長領域に書き込んでおいてもよい。   At this time, the memory controller 43 writes the logical block address, the error correction code, and the block status as the corresponding logical address information in the redundant area of the page in which the user data is written in step S89, and in the logical block of the user data. Write the sector number. Further, at this time, information indicating whether or not the data stored in which page in the physical block is valid after being rewritten may be written in the redundant area.

ステップS88の確認で、空きページがないと確認された場合(ステップS88:NO)、更新データ記憶部にはすでに書き替えデータで満たされたことになるので、メモリコントローラ43は、消去済の1つの物理ブロックを新たな対象ブロックとし、論理アドレスの下位側が示す論理ブロック内のセクタ番号を、その新たな対象ブロックのアクセス対象ページの番号とする。   When it is confirmed in step S88 that there is no empty page (step S88: NO), the update data storage unit is already filled with the rewritten data, so the memory controller 43 determines that the erased 1 One physical block is set as a new target block, and the sector number in the logical block indicated by the lower side of the logical address is set as the access target page number of the new target block.

メモリコントローラ43は、フラッシュメモリ42の新たな対象ブロックとなった消去済ブロックのアクセス対象ページのユーザ領域に、ユーザデータを書き込むと共にそのアクセス対象ページの冗長領域に、対応論理アドレス情報としての論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データを書き込む(ステップS90)。   The memory controller 43 writes the user data to the user area of the access target page of the erased block that has become the new target block of the flash memory 42, and stores the logical block as the corresponding logical address information in the redundant area of the access target page. Additional data such as the address, error correction code, and block status are written (step S90).

また、メモリコントローラ43は、アドレス変換テーブルに、新たな対象ブロックとなった物理ブロックの番号と、その物理ブロックに対応する論理ブロックの番号を対応させて書き込む(ステップS91)。即ち、アドレス変換テーブルを更新する。   Further, the memory controller 43 writes the number of the physical block that has become the new target block in association with the number of the logical block corresponding to the physical block in the address conversion table (step S91). That is, the address conversion table is updated.

さらに、メモリコントローラ43は、新たな対象ブロックのアクセス対象ページ以外のページに、元の対象ブロック(ステップS83で判定を行った物理ブロック)において、最新の有効なものとして記憶されているユーザデータに対応するセクタ番号を、冗長領域に書き込まれている付加情報から求め、そのユーザデータを、論理ブロックのアドレス、誤り訂正符号、ブロックステータス等の付加データと共に新たな対象ブロックのオリジナルデータ記憶部に書き込む(ステップS92)。そして、元の対象ブロックのすべてのページを一括消去し、消去済ブロックにする(ステップS93)。この際、アクセス対象ページよりページ番号が小さいページについては、アクセス対象ページへの書き込みの前に、ユーザデータ等の転写を行う。   Furthermore, the memory controller 43 adds the latest valid data to the user data stored in the original target block (the physical block determined in step S83) on the page other than the access target page of the new target block. The corresponding sector number is obtained from the additional information written in the redundant area, and the user data is written in the original data storage unit of the new target block together with additional data such as the logical block address, error correction code, and block status. (Step S92). Then, all the pages of the original target block are erased at once to make an erased block (step S93). At this time, with respect to a page having a page number smaller than that of the access target page, user data and the like are transferred before writing to the access target page.

[フラッシュメモリ42に対する読み出し処理]
次に、フラッシュメモリ42に対する読み出し処理の動作を、図17を用いて説明する。
図17は、読み出し処理を示すフローチャートである。
[Reading process to the flash memory 42]
Next, the read processing operation for the flash memory 42 will be described with reference to FIG.
FIG. 17 is a flowchart showing the reading process.

フラッシュメモリ42からユーザデータを読み出す場合、メモリコントローラ43のマイクロプロセッサ46は、ホストシステム44から読み出しコマンド及び論理アドレス情報とセクタ数が与えられると、そのセクタ数を内蔵するカウンタに設定し、読み出しを行うごとに、カウンタに設定されたセクタ数をデクリメントする。そして、カウンタに設定されたセクタ数が0以外のときに、次に読み出すユーザデータが有ると判断して次に読み出すユーザデータの論理アドレス情報を生成する、カウンタに設定されているセクタ数が0のときには、次に読み出しを行うユーザデータがないと判断し(ステップS101:NO)、マイクロプロセッサ46は、論理アドレス情報を生成せず、読み出し処理を終了する。   When reading user data from the flash memory 42, the microprocessor 46 of the memory controller 43, when given a read command, logical address information and the number of sectors from the host system 44, sets the number of sectors in a built-in counter and reads the data. Each time it is done, the number of sectors set in the counter is decremented. When the number of sectors set in the counter is other than 0, it is determined that there is user data to be read next, and logical address information of the user data to be read next is generated. The number of sectors set in the counter is 0 In this case, it is determined that there is no user data to be read next (step S101: NO), and the microprocessor 46 ends the reading process without generating logical address information.

メモリコントローラ43は、マイクロプロセッサ46が次に読み出しを行うユーザデータがあると判断して論理アドレス情報を生成した場合(ステップS101:YES)、論理アドレス情報の上位側で指定される論理ブロックに対応する物理ブロックを、対象ブロックとしてアドレス変換テーブルから検索する(ステップS102)。   When the memory controller 43 determines that there is user data to be read next by the microprocessor 46 and generates logical address information (step S101: YES), the memory controller 43 corresponds to the logical block specified on the upper side of the logical address information. The physical block to be searched is searched from the address conversion table as a target block (step S102).

メモリコントローラ43は、対象ブロックとなる物理ブロックの更新データ記憶部の冗長領域の書き込み内容を物理ブロックのページの老番側から調べ、アクセス対象となるセクタ番号が記載されたページを検出する(ステップS103)。アクセス対象となるセクタ番号が冗長領域に記載されているページが検出できた場合(ステップS103:YES)、そのページが最新のユーザデータが書き込まれているページであり、メモリコントローラや43は、そのページのユーザ領域に書き込まれているユーザデータを、ホストシステム44から論理アドレス情報で指定されたユーザデータとして読み出す(ステップS104)。
ステップS103で、アクセス対象となるセクタ番号が記載されたページが更新データ記憶部から検出できなかった場合(ステップS103:NO)、オリジナルデータの書き替えが発生しなかったことになるので、メモリコントローラ43は、そのセクタ番号に対応するページ(オリジナルデータ記憶部)のユーザ領域に書き込まれているユーザデータを、ホストシステム44から論理アドレス情報で指定されたユーザデータとして読み出す(ステップS105)。
以上のように、本実施形態では、各物理ブロックの更新データ記憶部のページを、オリジナルデータ記憶部のページに対応させず、書き替えが発生したページのユーザデータを順次書き込む構成にしたので、空きブロックへのデータの転写やブロック消去の発生回数を第1及び第2の実施形態よりも、大幅に減ずることができる。
The memory controller 43 checks the contents written in the redundant area of the update data storage unit of the physical block that is the target block from the old number side of the page of the physical block, and detects the page in which the sector number to be accessed is described (step) S103). When a page in which the sector number to be accessed is described in the redundant area can be detected (step S103: YES), the page is the page in which the latest user data is written. The user data written in the user area of the page is read from the host system 44 as user data specified by the logical address information (step S104).
In step S103, when the page in which the sector number to be accessed is described cannot be detected from the update data storage unit (step S103: NO), the rewriting of the original data has not occurred. 43 reads the user data written in the user area of the page (original data storage unit) corresponding to the sector number from the host system 44 as the user data specified by the logical address information (step S105).
As described above, in the present embodiment, since the page of the update data storage unit of each physical block is not associated with the page of the original data storage unit, the user data of the page that has been rewritten is sequentially written. The number of occurrences of data transfer and block erasure to an empty block can be greatly reduced as compared with the first and second embodiments.

尚、本発明は、上記実施形態に限定されず、種々の変形が可能である。
例えば、第1〜第3の実施形態では、フラッシュメモリ2,22,42を図2(a)の各ページが512バイトのユーザー領域と16バイトの冗長領域で構成されているものとしたが、図2(b)に示したように、1物理ブロックが64ページ(P0〜P63)で構成され、各ページが2048バイトのユーザー領域と64バイトの冗長領域で構成されているものも使用できる。この場合には、物理ブロックの各ページに、4セクタ分のユーザデータを書き込めるようにしてもよい。各物理ページの個々のユーザデータの書き込みや書き替えは、消去済ブロックを利用し、必要なデータを消去済ブロックに書き込んでおき、その消去済ブロックに書き込んだデータ群を物理ブロックの所定位置に書き込めばよい。
In addition, this invention is not limited to the said embodiment, A various deformation | transformation is possible.
For example, in the first to third embodiments, the flash memories 2, 22, and 42 are configured such that each page in FIG. 2A is configured with a 512-byte user area and a 16-byte redundant area. As shown in FIG. 2B, one physical block is composed of 64 pages (P0 to P63), and each page is composed of a 2048-byte user area and a 64-byte redundant area. In this case, user data for four sectors may be written in each page of the physical block. Individual user data on each physical page is written or rewritten using an erased block, the necessary data is written to the erased block, and the data group written to the erased block is placed at a predetermined position in the physical block. Just write in.

第1の実施形態に係るフラッシュメモリシステムの概要を示す構成図である。1 is a configuration diagram showing an overview of a flash memory system according to a first embodiment. ブロックとページの関係を示す説明図である。It is explanatory drawing which shows the relationship between a block and a page. 論理アドレス空間と物理アドレス空間を示す説明図である。It is explanatory drawing which shows a logical address space and a physical address space. 書き込み処理を示すフローチャートである。It is a flowchart which shows write-in processing. 書き込み処理を示すフローチャートである。It is a flowchart which shows write-in processing. 読み出し処理を示すフローチャートである。It is a flowchart which shows a read-out process. 本発明の第2の実施形態に係るフラッシュメモリシステムの概要を示す構成図である。It is a block diagram which shows the outline | summary of the flash memory system which concerns on the 2nd Embodiment of this invention. 本実施形態のフラッシュメモリの構成を示す図である。It is a figure which shows the structure of the flash memory of this embodiment. 書き込み処理を示すフローチャートである。It is a flowchart which shows write-in processing. 書き込み処理を示すフローチャートである。It is a flowchart which shows write-in processing. 読み出し処理を示すフローチャートである。It is a flowchart which shows a read-out process. 本発明の第3の実施形態に係るフラッシュメモリシステムの概要を示す構成図である。It is a block diagram which shows the outline | summary of the flash memory system which concerns on the 3rd Embodiment of this invention. フラッシュメモリの構成を示す図である。It is a figure which shows the structure of flash memory. 論理アドレス空間と物理アドレス空間を示す説明図である。It is explanatory drawing which shows a logical address space and a physical address space. 書き込み処理を示すフローチャートである。It is a flowchart which shows write-in processing. 書き込み処理を示すフローチャートである。It is a flowchart which shows write-in processing. 読み出し処理を示すフローチャートである。。It is a flowchart which shows a read-out process. .

符号の説明Explanation of symbols

1,21,41 フラッシュメモリシステム
2,22,42 フラッシュメモリ
3,23,43 メモリコントローラ
4,24,44 ホストシステム
5,25,45 ホストインターフェース制御ブロック
6,26,46 マイクロプロセッサ
7,27,47 ホストインターフェースブロック
8,28,48 ワークエリア
9,29,49 バッファ
10,30,50 フラッシュメモリインターフェースブロック
11,31,51 ECCブロック
12,32,52 フラッシュメモリシーケンサブロック
1, 21, 41 Flash memory system 2, 22, 42 Flash memory 3, 23, 43 Memory controller 4, 24, 44 Host system 5, 25, 45 Host interface control block 6, 26, 46 Microprocessor 7, 27, 47 Host interface block 8, 28, 48 Work area 9, 29, 49 Buffer 10, 30, 50 Flash memory interface block 11, 31, 51 ECC block 12, 32, 52 Flash memory sequencer block

Claims (7)

複数ページからなる物理ブロックが複数含まれる記憶領域を有し、データの消去が物理ブロック単位で行われデータの書き込みがページ単位で行われるフラッシュメモリに接続され、該フラッシュメモリに対するアクセスを制御するメモリコントローラであって、
ホストシステムから与えられる論理アドレスが割り当てられたセクタ単位の領域を複数個含む論理ブロックを形成する論理ブロック形成手段と、
前記論理ブロックを物理ブロックに割り当てると共に、当該論理ブロックと当該物理ブロックの対応関係を管理するブロック管理手段と、
前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページに、当該論理アドレスに対応するデータを書き込むデータ書き込み手段とを備え
前記論理ブロックが割り当てられた物理ブロック内の記憶領域は、
当該論理ブロックに含まれる領域と等しい容量を持ち、当該論理ブロックに含まれるセクタ単位の領域と対応関係が予め定められているページで構成されたオリジナルデータ記憶領域と、
前記論理ブロックに含まれるセクタ単位の領域を自由に割り当てることができるページで構成された更新データ記憶領域とに分割して使用され、
前記データ書き込み手段は、
前記ホストシステムから与えられた論理アドレスに基づいて特定された前記オリジナルデータ記憶領域内のページが空きページである場合、当該論理アドレスに対応するデータを当該特定されたページに書き込み、
当該特定されたページが空きページでない場合、当該論理アドレスに対応するデータと当該論理アドレスを特定するための情報を前記更新データ記憶領域内の空きページのユーザ領域と冗長領域にそれぞれ書き込む、
ことを特徴とするメモリコントローラ。
Has a storage area including a plurality of pages physical blocks contains multiple, erasure of data is performed in units of physical blocks, writing of data is connected to the flash memory is performed in units of pages, against the person the flash memory Rua A memory controller for controlling access,
Logical block forming means for forming a logical block including a plurality of sector unit areas to which a logical address given by the host system is assigned;
Block management means for allocating the logical block to a physical block and managing the correspondence between the logical block and the physical block;
Based on the logical address given from the host system, the page in the physical block corresponding to the logical block to which the logical address belongs, and a write Mude over data writing means to write data corresponding to the logical address ,
The storage area in the physical block to which the logical block is allocated is
An original data storage area having a capacity equal to that of the area included in the logical block, and configured by pages having a predetermined relationship with the area of the sector unit included in the logical block;
It is used by being divided into an update data storage area composed of pages that can be freely assigned a sector unit area included in the logical block,
The data writing means includes
When the page in the original data storage area specified based on the logical address given from the host system is an empty page, the data corresponding to the logical address is written to the specified page,
If the specified page is not a free page, data corresponding to the logical address and information for specifying the logical address are written in the user area and the redundant area of the empty page in the update data storage area, respectively.
A memory controller characterized by that.
前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページから当該論理アドレスに対応するデータを読み出す読み出し手段を更に備え、
前記読み出し手段は、
前記更新データ記憶領域内に、前記ホストシステムから与えられた論理アドレスと対応する情報が冗長領域に書き込まれているページがある場合、当該更新データ記憶領域内のページから当該論理アドレスに対応するデータを読み出し、
前記更新データ記憶領域内に、当該論理アドレスと対応する情報が冗長領域に書き込まれているページがない場合、前記オリジナルデータ記憶領域内の当該論理アドレスに対応するページから当該論理アドレスに対応するデータを読み出す、
ことを特徴とする請求項1に記載のメモリコントローラ。
Based on the logical address given from the host system, further comprises a reading means for reading data corresponding to the logical address from the page in the physical block corresponding to the logical block to which the logical address belongs,
The reading means includes
If there is a page in the update data storage area in which information corresponding to the logical address given from the host system is written in the redundant area, the data corresponding to the logical address from the page in the update data storage area Read
If there is no page in the update data storage area in which information corresponding to the logical address is written in the redundant area, data corresponding to the logical address from the page corresponding to the logical address in the original data storage area Read out,
The memory controller according to claim 1.
前記データ書き込み手段は、前記更新データ記憶領域内の空きページの冗長領域に、前記論理アドレスを特定するための情報と共に、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のそれぞれのページに格納されているデータが有効か否かを示す情報を書き込む、
ことを特徴とする請求項1又は2に記載のメモリコントローラ。
The data writing means includes information for specifying the logical address in a redundant area of an empty page in the update data storage area and each page in a physical block corresponding to the logical block to which the logical address belongs. Write information indicating whether the stored data is valid,
The memory controller according to claim 1 or 2, characterized in that.
請求項1乃至のいずれか1項に記載のメモリコントローラと、このメモリコントローラにより制御されるフラッシュメモリとを備えることを特徴とするフラッシュメモリシステム。 Flash memory system comprising: the memory controller; and a flash memory which is controlled by the memory controller to any one of claims 1 to 3. 複数ページからなる物理ブロックが複数含まれる記憶領域を有し、データの消去が物理ブロック単位で行われデータの書き込みがページ単位で行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、
ホストシステムから与えられる論理アドレスが割り当てられたセクタ単位の領域を複数個含む論理ブロックを形成する論理ブロック形成処理と、
前記論理ブロックを物理ブロックに割り当てると共に、当該論理ブロックと当該物理ブロックの対応関係を管理するブロック管理処理と、
前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページに、当該論理アドレスに対応するデータを書き込むデータ書き込み処理とみ、
前記論理ブロックが割り当てられた物理ブロック内の記憶領域は、
当該論理ブロックに含まれる領域と等しい容量を持ち、当該論理ブロックに含まれるセクタ単位の領域と対応関係が予め定められているページで構成されたオリジナルデータ記憶領域と、
前記論理ブロックに含まれるセクタ単位の領域を自由に割り当てることができるページで構成された更新データ記憶領域とに分割して使用され、
前記データ書き込み処理では、
前記ホストシステムから与えられた論理アドレスに基づいて特定された前記オリジナルデータ記憶領域内のページが空きページである場合、当該論理アドレスに対応するデータを当該特定されたページに書き込み、
当該特定されたページが空きページでない場合、当該論理アドレスに対応するデータと当該論理アドレスを特定するための情報を前記更新データ記憶領域内の空きページのユーザ領域と冗長領域にそれぞれ書き込む、
ことを特徴とするフラッシュメモリの制御方法。
Has a storage area including a plurality of pages physical blocks contains multiple, erasure of data is performed in units of physical blocks, the control method of the flash memory to control access to write data against the flash memory is performed in units of pages Because
A logical block forming process for forming a logical block including a plurality of sector unit areas to which a logical address given by the host system is assigned;
A block management process for allocating the logical block to a physical block and managing a correspondence between the logical block and the physical block;
Based on the logical address given from the host system, including a page in a physical block corresponding to the logical block to which the logical address belongs, and a write Mude over data writing process to write the data corresponding to the logical address See
The storage area in the physical block to which the logical block is allocated is
An original data storage area having a capacity equal to that of the area included in the logical block, and configured by pages having a predetermined relationship with the area of the sector unit included in the logical block;
It is used by being divided into an update data storage area composed of pages that can be freely assigned a sector unit area included in the logical block,
In the data writing process,
When the page in the original data storage area specified based on the logical address given from the host system is an empty page, the data corresponding to the logical address is written to the specified page,
If the specified page is not a free page, data corresponding to the logical address and information for specifying the logical address are written in the user area and the redundant area of the empty page in the update data storage area, respectively.
A method for controlling a flash memory.
前記ホストシステムから与えられた論理アドレスに基づいて、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のページから当該論理アドレスに対応するデータを読み出す読み出し処理を更に含み、
前記読み出し処理では、
前記更新データ記憶領域内に、前記ホストシステムから与えられた論理アドレスと対応する情報が冗長領域に書き込まれているページがある場合、当該更新データ記憶領域内のページから当該論理アドレスに対応するデータを読み出し、
前記更新データ記憶領域内に、当該論理アドレスと対応する情報が冗長領域に書き込まれているページがない場合、前記オリジナルデータ記憶領域内の当該論理アドレスに対応するページから当該論理アドレスに対応するデータを読み出す、
ことを特徴とする請求項に記載のフラッシュメモリの制御方法。
Based on the logical address given from the host system, further includes a read process of reading data corresponding to the logical address from a page in a physical block corresponding to the logical block to which the logical address belongs,
In the reading process,
If there is a page in the update data storage area in which information corresponding to the logical address given from the host system is written in the redundant area, the data corresponding to the logical address from the page in the update data storage area Read
If there is no page in the update data storage area in which information corresponding to the logical address is written in the redundant area, data corresponding to the logical address from the page corresponding to the logical address in the original data storage area Read out,
6. The method of controlling a flash memory according to claim 5 , wherein
前記データ書き込み処理では、前記更新データ記憶領域内の空きページの冗長領域に、前記論理アドレスを特定するための情報と共に、当該論理アドレスが属する前記論理ブロックと対応する物理ブロック内のそれぞれのページに格納されているデータが有効か否かを示す情報を書き込む、
ことを特徴とする請求項5又は6に記載のフラッシュメモリの制御方法。
In the data write process, information for identifying the logical address is stored in the redundant area of the empty page in the update data storage area, and each page in the physical block corresponding to the logical block to which the logical address belongs. Write information indicating whether the stored data is valid,
The method of controlling a flash memory according to claim 5 or 6 ,
JP2005280561A 2005-09-27 2005-09-27 Memory controller, flash memory system, and flash memory control method Active JP4661497B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005280561A JP4661497B2 (en) 2005-09-27 2005-09-27 Memory controller, flash memory system, and flash memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005280561A JP4661497B2 (en) 2005-09-27 2005-09-27 Memory controller, flash memory system, and flash memory control method

Publications (2)

Publication Number Publication Date
JP2007094571A JP2007094571A (en) 2007-04-12
JP4661497B2 true JP4661497B2 (en) 2011-03-30

Family

ID=37980251

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005280561A Active JP4661497B2 (en) 2005-09-27 2005-09-27 Memory controller, flash memory system, and flash memory control method

Country Status (1)

Country Link
JP (1) JP4661497B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5087347B2 (en) * 2007-09-06 2012-12-05 株式会社日立製作所 Semiconductor memory device and method for controlling semiconductor memory device
JP4829202B2 (en) * 2007-11-02 2011-12-07 株式会社日立製作所 Storage device and memory control method
WO2015008338A1 (en) * 2013-07-16 2015-01-22 富士通株式会社 Information processing device, control circuit, control program, and control method
JP7153435B2 (en) * 2017-10-12 2022-10-14 ラピスセミコンダクタ株式会社 Data rewriting method for non-volatile memory and semiconductor device
JP7143232B2 (en) * 2019-01-29 2022-09-28 キオクシア株式会社 Memory system and control method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004078907A (en) * 2002-06-20 2004-03-11 Tokyo Electron Device Ltd Storage device, memory management method, and program thereof
JP2004164633A (en) * 2002-10-28 2004-06-10 Sandisk Corp Method and device for effectively enabling out-of-sequence writing process in nonvolatile memory system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06222985A (en) * 1993-01-26 1994-08-12 Oki Electric Ind Co Ltd Memory controller
JPH0997206A (en) * 1995-09-28 1997-04-08 Canon Inc Method, device for managing flash rom and computer control equipment
JPH0997207A (en) * 1995-09-28 1997-04-08 Canon Inc Method, device for managing flash rom and computer control equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004078907A (en) * 2002-06-20 2004-03-11 Tokyo Electron Device Ltd Storage device, memory management method, and program thereof
JP2004164633A (en) * 2002-10-28 2004-06-10 Sandisk Corp Method and device for effectively enabling out-of-sequence writing process in nonvolatile memory system

Also Published As

Publication number Publication date
JP2007094571A (en) 2007-04-12

Similar Documents

Publication Publication Date Title
JP4373943B2 (en) Memory controller, flash memory system, and flash memory control method
JP4661497B2 (en) Memory controller, flash memory system, and flash memory control method
JP4235646B2 (en) Memory controller and flash memory system
JP4636005B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4661191B2 (en) Memory controller, flash memory system, and flash memory control method
JP4241741B2 (en) Memory controller and flash memory system
JP4177292B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM, AND FLASH MEMORY CONTROL METHOD
JP4609406B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4697146B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4661748B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP3934659B1 (en) Memory controller and flash memory system
JP2005292925A (en) Memory controller, flash memory system, and control method for flash memory
JP4000124B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4177301B2 (en) Memory controller, flash memory system, and flash memory control method
JP4254933B2 (en) Memory controller and flash memory system
JP4235595B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4273106B2 (en) Memory controller, flash memory system, and flash memory control method
JP4273109B2 (en) Memory controller and flash memory system
JP4194518B2 (en) Memory controller, flash memory system, and flash memory control method
JP4254930B2 (en) Memory controller, flash memory system, and flash memory control method
JP4569554B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4366283B2 (en) Memory controller and flash memory system including the memory controller
JP4304167B2 (en) Memory controller, flash memory system, and flash memory control method
JP4332108B2 (en) Memory controller, flash memory system, and flash memory control method
JP2005293177A (en) Memory controller and flash memory system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070312

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100524

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100526

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100629

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100825

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: 20101207

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: 20101220

R150 Certificate of patent or registration of utility model

Ref document number: 4661497

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140114

Year of fee payment: 3