JP2008276371A - Memory controller, flash memory system with memory controller and control method for flash memory - Google Patents
Memory controller, flash memory system with memory controller and control method for flash memory Download PDFInfo
- Publication number
- JP2008276371A JP2008276371A JP2007116884A JP2007116884A JP2008276371A JP 2008276371 A JP2008276371 A JP 2008276371A JP 2007116884 A JP2007116884 A JP 2007116884A JP 2007116884 A JP2007116884 A JP 2007116884A JP 2008276371 A JP2008276371 A JP 2008276371A
- Authority
- JP
- Japan
- Prior art keywords
- logical
- data
- area
- physical
- written
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Abstract
Description
本発明は、メモリコントローラ、メモリコントローラを備えるフラッシュメモリシステム、並びにフラッシュメモリの制御方法に関する。 The present invention relates to a memory controller, a flash memory system including the memory controller, and a flash memory control method.
従来、対応関係にある論理ブロックと物理ブロックとの間で、論理ブロックに含まれる論理ページと物理ブロックに含まれる物理ページとの対応関係を固定せずにホストシステムから与えられたデータを、フラッシュメモリに保存する方法が知られている(例えば、特許文献1参照)。かかる保存方法では、アクセス対象の物理ブロック内にデータが書き込まれていない物理ページ(空きページ)があれば、その物理ブロック内の空きページにホストシステムから与えられたデータを保存することができる。従って、同じ物理ブロック内に、同一の論理ページに対応するデータを複数回書き込むことも可能になるため、データの書き換えを容易に行うことができる。 Conventionally, the data given from the host system is flushed without fixing the correspondence between the logical page contained in the logical block and the physical page contained in the physical block between the logical block and the physical block in the correspondence relationship. A method of storing in a memory is known (for example, see Patent Document 1). In this storage method, if there is a physical page (empty page) in which data is not written in the physical block to be accessed, data given from the host system can be stored in the empty page in the physical block. Therefore, data corresponding to the same logical page can be written a plurality of times in the same physical block, so that data can be easily rewritten.
上述のデータの保存方法では、データの書き込み及び読み込み単位である物理ページ(又は、物理セクタ領域)と、その物理ページ(又は、物理セクタ領域)に保存されているデータに対応する論理ページ(又は、論理セクタ領域)との対応関係を管理しなければならない。この物理ページ(又は、物理セクタ領域)と論理ページ(又は、論理セクタ領域)の対応関係を管理するため、特許文献1では、物理ページ(又は、物理セクタ領域)の冗長領域に対応関係にある論理ページ(又は、論理セクタ領域)に付けられた論理ページ番号(又は、論理セクタ番号)を書き込んでいる。
そして、論理ページと物理ページとの対応関係(又は、論理セクタ領域と物理セクタ領域との対応関係)を判別するときには、冗長領域に書き込まれている論理ページ番号(又は、論理セクタ番号)に基づいて論理ページと物理ページとの対応関係(論理セクタ領域と物理セクタ領域との関係)を記述したアドレス変換テーブルを作成する。このアドレス変換テーブルは、例えば、アクセス対象となった論理ブロックについて、その都度作成する。又、起動時に全ての論理ブロックに対するアドレス変換テーブルを作成することもできる。
このアドレス変換テーブルを都度作成する場合は、その作成時間によりアクセス速度が低下する。又、起動時に全ての論理ブロックに対するアドレス変換テーブルを作成する場合は、起動時間が長くなるだけでなく、作成したアドレス変換テーブルを保持しておくためのRAM(Random Access Memory)が必要になり、コストが増大する。
In the data storage method described above, a physical page (or physical sector area) that is a unit for writing and reading data, and a logical page (or a data corresponding to data stored in the physical page (or physical sector area)) The logical sector area) must be managed. In order to manage the correspondence between the physical page (or physical sector area) and the logical page (or logical sector area), in
When determining the correspondence between the logical page and the physical page (or the correspondence between the logical sector area and the physical sector area), it is based on the logical page number (or logical sector number) written in the redundant area. Thus, an address conversion table describing the correspondence between logical pages and physical pages (relation between logical sector areas and physical sector areas) is created. This address conversion table is created each time, for example, for a logical block to be accessed. It is also possible to create an address conversion table for all logical blocks at startup.
When this address conversion table is created each time, the access speed decreases depending on the creation time. Also, when creating an address translation table for all logical blocks at startup, not only the startup time is lengthened, but also a RAM (Random Access Memory) for holding the created address translation table is required. Cost increases.
また、上記アドレス変換テーブルをアクセス時又は起動時に作成するのではなく強誘電体メモリ等の重ね書き可能な不揮発性メモリに記憶するようにしてもよいが、このような不揮発性メモリは高価なので、コストが非常に増大する。 Further, the address conversion table may be stored in a rewritable non-volatile memory such as a ferroelectric memory instead of being created at the time of access or activation, but such a non-volatile memory is expensive. The cost is greatly increased.
かかる実情に鑑み、本発明は、論理ページと物理ページとの対応関係又は論理セクタ領域と物理セクタ領域との対応関係を効率的に判別することができるフラッシュメモリコントローラ及びメモリコントローラを備えるフラッシュメモリシステム、並びにフラッシュメモリの制御方法を提供するものである。
上記目的を達成するために、本発明による第1のメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、複数個の物理セクタ領域を含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、複数個の論理セクタ領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、該論理ブロックに属する前記論理アクセス領域のセクタ数とを判別する論理アクセス領域判別手段と、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない物理セクタ領域の先頭を検索する空きセクタ領域検索手段と、前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索手段によって検出されたデータが書き込まれていない先頭の物理セクタ領域から、末尾の物理セクタ領域に向かって順次書き込んでいくデータ書き込み手段と、前記データ書き込み手段により前記一連のデータが書き込まれた物理セクタ領域に対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報を書き込む論理セクタ情報書き込み手段とを備えたことを特徴とする。 In order to achieve the above object, a first memory controller according to the present invention performs access to a flash memory that is erased in units of physical blocks including a plurality of physical sector areas based on an access instruction given from a host system. A memory controller for controlling, a block management means for managing a correspondence relationship between a logical block composed of a plurality of logical sector areas and the physical block; and a logical access designated as an access target area by the access instruction Logical access area determination means for determining the logical block to which the area belongs, the logical sector area corresponding to the head area of the logical access area belonging to the logical block, and the number of sectors of the logical access area belonging to the logical block; , The logical block to which the logical access area belongs Empty sector area search means for searching for the beginning of a physical sector area in which data in the physical block corresponding to the disk is not written, and a series of data instructed to be written to the logical access area by the access instruction Are sequentially written from the first physical sector area where the data detected by the empty sector area searching means is not written to the last physical sector area, and the series of data is written by the data writing means. In the redundant area corresponding to the physical sector area in which data is written, the logical sector area corresponding to the head area of the logical access area belonging to the logical block and the number of sectors in the logical access area belonging to the logical block are determined. Logical sector information writing means for writing information for It is characterized in.
この第1のメモリコントローラでは、一連のデータが書き込まれた物理セクタ領域に対応する冗長領域に、この一連のデータと対応関係にある論理アクセス領域の先頭領域に対応する論理セクタ領域を判別するための情報と、この一連のデータと対応関係にある論理アクセス領域のセクタ数を判別するための情報を書き込むようにしたので、これらの情報に基づいて論理ブロックに含まれる論理セクタ領域と物理ブロックに含まれる物理セクタ領域との対応関係を容易に把握することができる。
また、この第1のメモリコントローラは、1又は複数個の前記一連のデータが書き込まれている前記物理ブロック内の物理セクタ領域と、該物理ブロックに対応する前記論理ブロック内の論理セクタ領域との対応関係を判別するセクタ領域管理手段を備え、該セクタ領域管理手段は、前記一連のデータの先頭データが書き込まれている各物理セクタ領域に対応する冗長領域から、前記論理セクタ情報書き込み手段によって書き込まれた前記情報を読み出し、読み出した該情報に基づいて前記物理ブロック内の物理セクタ領域と、該物理ブロックに対応する前記論理ブロック内の論理セクタ領域との対応関係を判別するように構成されていることが好ましい。
In the first memory controller, in order to determine the logical sector area corresponding to the head area of the logical access area corresponding to the series of data in the redundant area corresponding to the physical sector area in which the series of data is written. Information and information for determining the number of sectors in the logical access area corresponding to this series of data are written. Therefore, based on this information, the logical sector area and the physical block included in the logical block are written. The correspondence with the included physical sector area can be easily grasped.
The first memory controller includes a physical sector area in the physical block in which one or a plurality of the series of data is written, and a logical sector area in the logical block corresponding to the physical block. Sector area management means for determining the correspondence relationship, the sector area management means is written by the logical sector information writing means from the redundant area corresponding to each physical sector area in which the head data of the series of data is written The information is read, and based on the read information, the correspondence between the physical sector area in the physical block and the logical sector area in the logical block corresponding to the physical block is determined. Preferably it is.
このようなセクタ領域管理手段を備えることにより、各一連のデータに対して設定された情報に基づいて一連のデータ単位で論理ブロックに含まれる論理セクタ領域と物理ブロックに含まれる物理セクタ領域との対応関係を把握することができる。 By providing such a sector area management means, a logical sector area included in a logical block and a physical sector area included in a physical block in a series of data units based on information set for each series of data. The correspondence can be grasped.
また、前記セクタ領域管理手段は、前記一連のデータの先頭データが書き込まれている物理セクタ領域に対応する冗長領域と該一連のデータの末尾データが書き込まれている物理セクタ領域に対応する冗長領域から、前記論理セクタ情報書き込み手段によって書き込まれた前記情報を読み出し、双方の冗長領域から読み出された該情報が一致するときに、該一連のデータが正常に書き込まれていると判断するように構成されていることが好ましい。 Further, the sector area management means includes a redundant area corresponding to a physical sector area in which head data of the series of data is written and a redundant area corresponding to a physical sector area in which tail data of the series of data is written. From the above, the information written by the logical sector information writing means is read, and when the information read from both redundant areas matches, it is determined that the series of data has been written normally. It is preferable to be configured.
このようにセクタ領域管理手段が、一連のデータの先頭データが書き込まれている物理セクタ領域に対応する冗長領域と、この一連のデータの末尾データが書き込まれている物理セクタ領域に対応する冗長領域に書き込まれている情報を比較し、その比較結果に基づいて一連のデータが正常に書き込まれていると判断するようにすれば、正常に書き込まれていない一連のデータを容易に検出することができる。 In this way, the sector area management means has a redundant area corresponding to the physical sector area where the head data of the series of data is written, and a redundant area corresponding to the physical sector area where the end data of the series of data is written. By comparing the information written in and determining that a series of data is written normally based on the comparison result, it is possible to easily detect a series of data not written normally. it can.
また、本発明による第2のメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、複数個の論理ページで構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数とを判別する論理アクセス領域判別手段と、前記論理アクセス領域が属する前記物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索手段と、前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きページ検索手段によって検出されたデータが書き込まれていない先頭の物理ページから、末尾の物理ページに向かって順次書き込んでいくデータ書き込み手段と、前記データ書き込み手段により前記一連のデータが書き込まれた物理ページに対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、前記論理ブロックに含まれる前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数を判別するための情報を書き込む論理ページ情報書き込み手段とを備えたことを特徴とする。 A second memory controller according to the present invention is a memory controller that controls access to a flash memory that is erased in units of physical blocks including a plurality of physical pages, based on an access instruction given from a host system. A block management means for managing a correspondence relationship between a logical block composed of a plurality of logical pages and the physical block, and the logical block to which a logical access area designated as an access target area by the access instruction belongs, A logical page corresponding to the top area of the logical access area belonging to the logical block, and a number of pages from the logical page corresponding to the top area of the logical access area belonging to the logical block to the logical page corresponding to the end area. A logical access area discriminating means for discriminating; Free page search means for searching for the beginning of a physical page in which data in the physical block to which the access area belongs is not written, and a series of data instructed to be written to the logical access area by the access instruction, The data detected by the empty page search means is written sequentially from the first physical page to which the data is not written to the last physical page, and the series of data is written by the data writing means. In the redundant area corresponding to the physical page, the logical page corresponding to the top area of the logical access area belonging to the logical block, and the logical page corresponding to the top area of the logical access area included in the logical block from the logical area to the end area. To determine the number of pages to the corresponding logical page Characterized in that a logical page information writing means for writing the multi-address.
この第2のメモリコントローラでは、一連のデータが書き込まれた物理ページに対応する冗長領域に、この一連のデータと対応関係にある論理アクセス領域の先頭領域に対応する論理ページを判別するための情報と、この一連のデータと対応関係にある論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数を判別するための情報を書き込むようにしたので、これらの情報に基づいて論理ブロックに含まれる論理ページと物理ブロックに含まれる物理ページとの対応関係を容易に把握することができる。
また、この第2のメモリコントローラは、1又は複数個の前記一連のデータが書き込まれている前記物理ブロック内の物理ページと、該物理ブロックに対応する前記論理ブロック内の論理ページとの対応関係を判別するページ管理手段を備え、該ページ管理手段は、前記一連のデータの先頭データが書き込まれている各物理ページに対応する冗長領域から、前記論理ページ情報書き込み手段によって書き込まれた前記情報を読み出し、読み出した該情報に基づいて前記物理ブロック内の物理ページと、該物理ブロックに対応する前記論理ブロック内の論理ページとの対応関係を判別するように構成されていることが好ましい。
In the second memory controller, information for discriminating a logical page corresponding to the first area of the logical access area corresponding to the series of data in the redundant area corresponding to the physical page in which the series of data is written. And the information for determining the number of pages from the logical page corresponding to the top area of the logical access area corresponding to this series of data to the logical page corresponding to the end area. Based on the above, it is possible to easily grasp the correspondence between the logical page included in the logical block and the physical page included in the physical block.
The second memory controller also has a correspondence relationship between a physical page in the physical block in which one or a plurality of the series of data is written and a logical page in the logical block corresponding to the physical block. Page management means for determining the information written by the logical page information writing means from a redundant area corresponding to each physical page in which the first data of the series of data is written. It is preferable that the correspondence between the physical page in the physical block and the logical page in the logical block corresponding to the physical block is determined based on the read and read information.
このようなページ領域管理手段を備えることにより、各一連のデータに対して設定された情報に基づいて一連のデータ単位で論理ブロックに含まれる論理ページと物理ブロックに含まれる物理ページとの対応関係を把握することができる。 By providing such a page area management means, the correspondence between the logical page included in the logical block and the physical page included in the physical block in a series of data units based on information set for each series of data Can be grasped.
また、前記ページ管理手段は、前記一連のデータの先頭データが書き込まれている物理ページに対応する冗長領域と該一連のデータの末尾データが書き込まれている物理ページに対応する冗長領域から、前記論理ページ情報書き込み手段によって書き込まれた前記情報を読み出し、双方の冗長領域から読み出された該情報が一致するときに、該一連のデータが正常に書き込まれていると判断するように構成されていることが好ましい。 Further, the page management means includes the redundant area corresponding to the physical page in which the first data of the series of data is written and the redundant area corresponding to the physical page in which the end data of the series of data is written. It is configured to read the information written by the logical page information writing means, and to determine that the series of data is normally written when the information read from both redundant areas match. Preferably it is.
このようにページ管理手段が、一連のデータの先頭データが書き込まれている物理ページに対応する冗長領域と、この一連のデータの末尾データが書き込まれている物理ページに対応する冗長領域に書き込まれている情報を比較し、その比較結果に基づいて一連のデータが正常に書き込まれていると判断するようにすれば、正常に書き込まれていない一連のデータを容易に検出することができる。 As described above, the page management unit writes data in the redundant area corresponding to the physical page in which the first data of the series of data is written and the redundant area corresponding to the physical page in which the last data of the series of data is written. If it is determined that a series of data is normally written based on the comparison result, a series of data that is not normally written can be easily detected.
また、本発明によるフラッシュメモリシステムは、前記何れかのメモリコントローラと、前記メモリコントローラによってアクセスされるフラッシュメモリとを備える。 A flash memory system according to the present invention includes any one of the memory controllers and a flash memory accessed by the memory controller.
また、本発明による第1のフラッシュメモリの制御方法は、ホストシステムから与えられるアクセス指示に基づいて、複数個の物理セクタ領域を含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、複数個の論理セクタ領域で構成された論理ブロックを形成し、前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、該論理ブロックに属する前記論理アクセス領域のセクタ数とを判別する論理アクセス領域判別ステップと、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロックを判別する物理ブロック判別ステップと、前記物理ブロック判別ステップで判別された前記物理ブロック内のデータが書き込まれていない物理セクタ領域の先頭を検索する空きセクタ領域検索ステップと、前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索ステップで検出されたデータが書き込まれていない先頭の物理セクタ領域から、末尾の物理セクタ領域に向かって順次書き込んでいくデータ書き込みステップと、前記データ書き込みステップで前記一連のデータが書き込まれた物理セクタ領域に対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報を書き込む論理セクタ情報書き込みステップとを有することを特徴とする。 The first flash memory control method according to the present invention is a flash that controls access to a flash memory that is erased in units of physical blocks including a plurality of physical sector areas based on an access instruction given from a host system. A method of controlling a memory, wherein a logical block composed of a plurality of logical sector areas is formed, the logical block to which a logical access area designated as an access target area by the access instruction belongs, and the logical block A logical access area determining step for determining a logical sector area corresponding to a head area of the logical access area to which the logical access area belongs, and a number of sectors of the logical access area belonging to the logical block; and corresponding to the logical block to which the logical access area belongs Physical block to determine the physical block to be A determination step, a free sector area search step for searching for the beginning of a physical sector area in which data in the physical block determined in the physical block determination step is not written, and the logical access area by the access instruction A data writing step of sequentially writing a series of data instructed to be written from the first physical sector area where the data detected in the empty sector area searching step is not written toward the last physical sector area; A redundant area corresponding to the physical sector area in which the series of data is written in the data writing step, a logical sector area corresponding to a head area of the logical access area belonging to the logical block, and the logical block belonging to the logical block. To determine the number of sectors in the logical access area And having a logical sector information writing step of writing information.
この第1のフラッシュメモリの制御方法では、一連のデータが書き込まれた物理セクタ領域に対応する冗長領域に、この一連のデータと対応関係にある論理アクセス領域の先頭領域に対応する論理セクタ領域を判別するための情報と、この一連のデータと対応関係にある論理アクセス領域のセクタ数を判別するための情報を書き込むようにしたので、これらの情報に基づいて論理ブロックに含まれる論理セクタ領域と物理ブロックに含まれる物理セクタ領域との対応関係を容易に把握することができる。 In this first flash memory control method, a logical sector area corresponding to the head area of the logical access area corresponding to the series of data is provided in the redundant area corresponding to the physical sector area in which the series of data is written. Since the information for determining and the information for determining the number of sectors in the logical access area corresponding to this series of data are written, the logical sector area included in the logical block based on these information and The correspondence relationship with the physical sector area included in the physical block can be easily grasped.
また、この第1のフラッシュメモリの制御方法は、前記一連のデータの先頭データが書き込まれている物理セクタ領域に対応する冗長領域から、前記論理セクタ情報書き込みステップで書き込まれた前記情報を読み出す第1の論理セクタ情報読み出しステップ、前記第1の論理セクタ情報読み出しステップで読み出された情報に基づいて前記物理ブロック内の物理セクタ領域と、該物理ブロックに対応する前記論理ブロック内の論理セクタ領域との対応関係を判別する論理セクタ領域判別ステップとを有することが好ましい。 Further, the first flash memory control method reads the information written in the logical sector information writing step from a redundant area corresponding to a physical sector area in which head data of the series of data is written. 1 logical sector information reading step, a physical sector area in the physical block based on the information read in the first logical sector information reading step, and a logical sector area in the logical block corresponding to the physical block It is preferable to include a logical sector region determination step for determining the correspondence relationship between
このような第1の論理セクタ情報読み出しステップと論理セクタ領域判別ステップとを有することにより、一連のデータ単位で各一連のデータに対して設定された情報を読み出し、読み出した情報に基づいて一連のデータ単位で論理ブロックに含まれる論理セクタ領域と物理ブロックに含まれる物理セクタ領域との対応関係を把握することができる。 By having such a first logical sector information reading step and a logical sector region determination step, information set for each series of data in a series of data units is read out, and a series of series based on the read information It is possible to grasp the correspondence between the logical sector area included in the logical block and the physical sector area included in the physical block in data units.
また、この第1のフラッシュメモリの制御方法は、前記一連のデータの末尾データが書き込まれている物理セクタ領域に対応する冗長領域から、前記論理セクタ情報書き込みステップで書き込まれた前記情報を読み出す第2の論理セクタ情報読み出しステップ、前記一連のデータの先頭データが書き込まれている物理セクタ領域に対応する冗長領域と該一連のデータの末尾データが書き込まれている物理セクタ領域に対応する冗長領域から読み出した前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報が一致するときに該一連のデータが正常に書き込まれていると判断する判断ステップとを有することが好ましい。 Further, the first flash memory control method reads the information written in the logical sector information writing step from a redundant area corresponding to a physical sector area in which end data of the series of data is written. 2 logical sector information reading step, a redundant area corresponding to the physical sector area where the head data of the series of data is written, and a redundant area corresponding to the physical sector area where the end data of the series of data is written When the information for determining the number of sectors in the logical access area belonging to the logical block matches the logical sector area corresponding to the head area of the logical access area belonging to the read logical block, the series of data is normal It is preferable to have a determination step for determining that the data has been written to.
このような第2の論理セクタ情報読み出しステップと判断ステップとを有することにより、一連のデータの先頭データが書き込まれている物理セクタ領域に対応する冗長領域と、この一連のデータの末尾データが書き込まれている物理セクタ領域に対応する冗長領域に書き込まれている情報との比較結果に基づいて、正常に書き込まれていない一連のデータを容易に検出することができる。 By having such a second logical sector information reading step and a determining step, the redundant area corresponding to the physical sector area where the head data of the series of data is written, and the end data of this series of data are written. A series of data that is not normally written can be easily detected based on the comparison result with the information written in the redundant area corresponding to the physical sector area.
また、本発明による第2のフラッシュメモリの制御方法は、ホストシステムから与えられるアクセス指示に基づいて、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、複数個の論理ページで構成された論理ブロックを形成し、前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数とを判別する論理アクセス領域判別ステップと、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロックを判別する物理ブロック判別ステップと、前記物理ブロック判別ステップで判別された前記物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索ステップと、前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きページ検索ステップで検出されたデータが書き込まれていない先頭の物理ページから、末尾の物理ページに向かって順次書き込んでいくデータ書き込みステップと、 前記データ書き込みステップで前記一連のデータが書き込まれた物理ページに対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数を判別するための情報を書き込む論理ページ情報書き込みステップとを有することを特徴とする。 The second flash memory control method according to the present invention controls the access to a flash memory that is erased in units of physical blocks including a plurality of physical pages, based on an access instruction given from a host system. A logical block composed of a plurality of logical pages, the logical block to which a logical access area designated as an access target area by the access instruction belongs, and the logical block belonging to the logical block Logical access area determination that determines the logical page corresponding to the top area of the logical access area and the number of pages from the logical page corresponding to the top area of the logical access area belonging to the logical block to the logical page corresponding to the end area Step and the logical to which the logical access area belongs A physical block determination step for determining the physical block corresponding to the lock; a free page search step for searching for the beginning of a physical page in which data in the physical block determined in the physical block determination step is not written; A series of data instructed to be written to the logical access area by the access instruction is sequentially performed from the first physical page in which the data detected in the empty page search step is not written toward the last physical page. A data writing step for writing, a redundant area corresponding to a physical page in which the series of data is written in the data writing step, a logical page corresponding to a head area of the logical access area belonging to the logical block, and The logical access area belonging to the logical block A logical page information writing step for writing information for determining the number of pages from the logical page corresponding to the head area of the area to the logical page corresponding to the end area.
この第2のフラッシュメモリの制御方法では、一連のデータが書き込まれた物理ページに対応する冗長領域に、この一連のデータと対応関係にある論理アクセス領域の先頭領域に対応する論理ページを判別するための情報と、この一連のデータと対応関係にある論理アクセス領域のセクタ数を判別するための情報を書き込むようにしたので、これらの情報に基づいて論理ブロックに含まれる論理ページと物理ブロックに含まれる物理ページとの対応関係を容易に把握することができる。 In the second flash memory control method, a logical page corresponding to the first area of the logical access area having a correspondence relationship with the series of data is determined in the redundant area corresponding to the physical page in which the series of data is written. Information and information for determining the number of sectors in the logical access area corresponding to the series of data are written to the logical page and physical block included in the logical block based on the information. The correspondence relationship with the included physical page can be easily grasped.
また、この第2のフラッシュメモリの制御方法は、前記一連のデータの先頭データが書き込まれている物理ページに対応する冗長領域から、前記論理ページ情報書き込みステップで書き込まれた前記情報を読み出す第1の論理ページ情報読み出しステップ、前記第1の論理ページ情報読み出しステップで読み出された情報に基づいて前記物理ブロック内の物理ページと、該物理ブロックに対応する前記論理ブロック内の論理ページとの対応関係を判別する論理ページ判別ステップとを有することが好ましい。 In the second flash memory control method, the information written in the logical page information writing step is read from the redundant area corresponding to the physical page in which the first data of the series of data is written. Correspondence between a physical page in the physical block and a logical page in the logical block corresponding to the physical block based on the information read in the logical page information read step and the first logical page information read step It is preferable to have a logical page determination step for determining the relationship.
このような第1の論理ページ情報読み出しステップと論理ページ判別ステップとを有することにより、一連のデータ単位で各一連のデータに対して設定された情報を読み出し、読み出した情報に基づいて一連のデータ単位で論理ブロックに含まれる論理ページと物理ブロックに含まれる物理ページとの対応関係を把握することができる。 By having such a first logical page information reading step and a logical page determining step, information set for each series of data is read in a series of data units, and a series of data is based on the read information. The correspondence between the logical page included in the logical block and the physical page included in the physical block can be grasped in units.
また、この第2のフラッシュメモリの制御方法は、前記一連のデータの末尾データが書き込まれている物理ページに対応する冗長領域から、前記論理ページ情報書き込みステップで書き込まれた前記情報を読み出す第2の論理ページ情報読み出しステップ、前記一連のデータの先頭データが書き込まれている物理ページに対応する冗長領域と該一連のデータの末尾データが書き込まれている物理ページに対応する冗長領域から読み出した前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報が一致するときに該一連のデータが正常に書き込まれていると判断する判断ステップとを有することが好ましい。 In the second flash memory control method, the information written in the logical page information writing step is read from a redundant area corresponding to a physical page in which tail data of the series of data is written. The logical page information reading step, the redundant area corresponding to the physical page where the first data of the series of data is written and the redundant area corresponding to the physical page where the end data of the series of data is written When the logical page corresponding to the head area of the logical access area belonging to the logical block matches the information for determining the number of sectors in the logical access area belonging to the logical block, the series of data is normally written. It is preferable to have a determination step of determining that
このような第2の論理ページ情報読み出しステップと判断ステップとを有することにより、一連のデータの先頭データが書き込まれている物理ページに対応する冗長領域と、この一連のデータの末尾データが書き込まれている物理ページに対応する冗長領域に書き込まれている情報との比較結果に基づいて、正常に書き込まれていない一連のデータを容易に検出することができる。 By including the second logical page information reading step and the determination step, the redundant area corresponding to the physical page in which the first data of the series of data is written and the end data of the series of data are written. A series of data that is not normally written can be easily detected based on the comparison result with the information written in the redundant area corresponding to the physical page.
本発明のフラッシュメモリ、フラッシュメモリシステム、並びにフラッシュメモリの制御方法によれば、一連のデータが書き込まれた物理セクタ領域に対応する冗長領域に、この一連のデータの先頭データに対応する論理セクタ領域を判別するための情報と、この一連のデータに含まれるデータのセクタ数を判別するための情報を書き込むようにしたので、これらの情報に基づいて論理セクタ領域と物理セクタ領域との対応関係を効率的に判別することができる。又、一連のデータが書き込まれた物理ページの冗長領域に、この一連のデータの先頭データに対応する論理ページを判別するための情報と、この一連のデータに含まれる先頭データに対応する論理ページから末尾データに対応する論理ページまでのページ数を判別するための情報を書き込むようにした場合には、これらの情報に基づいて論理ページと物理ページとの対応関係を効率的に判別することができる。 According to the flash memory, the flash memory system, and the flash memory control method of the present invention, the logical sector area corresponding to the head data of the series of data is added to the redundant area corresponding to the physical sector area where the series of data is written. Information and the information for determining the number of sectors of data included in this series of data are written, so the correspondence between the logical sector area and the physical sector area is determined based on these information. It can be determined efficiently. In addition, information for determining the logical page corresponding to the first data of the series of data and the logical page corresponding to the first data included in the series of data in the redundant area of the physical page in which the series of data is written When the information for determining the number of pages from the first to the logical page corresponding to the end data is written, it is possible to efficiently determine the correspondence between the logical page and the physical page based on the information. it can.
以下、本発明の実施の形態を、図面を参照しながら説明する。図1は、本発明に係るフラッシュメモリシステム1を概略的に示すブロック図である。図1に示すように、フラッシュメモリシステム1は、フラッシュメモリ2と、それを制御するメモリコントローラ3とで構成されている。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram schematically showing a
フラッシュメモリシステム1は、外部バス13を介してホストシステム4と接続されている。ホストシステム4は、ホストシステム4の全体の動作を制御するためのCPU(Central Processing Unit)、フラッシュメモリシステム1との情報の授受を担うコンパニオンチップ等から構成されている。ホストシステム4は、例えば、文字、音声、あるいは画像情報等の種々の情報を処理するパーソナルコンピュータやデジタルスチルカメラをはじめとする各種情報処理装置であってもよい。
The
メモリコントローラ3は、図1に示すように、マイクロプロセッサ6と、ホストインターフェースブロック7と、ワークエリア8と、バッファ9と、フラッシュメモリインターフェースブロック10と、ECC(Error Correcting Code)ブロック11と、ROM(Read Only Memory)12とから構成される。メモリコントローラ3は、内部バス14を介してフラッシュメモリ2と接続されている。これら機能ブロックによって構成されるメモリコントローラ3は、一つの半導体チップ上に集積される。以下、各機能ブロックについて説明する。
As shown in FIG. 1, the
ホストインターフェースブロック7は、ホストシステム4との間でデータ、アドレス情報、ステータス情報、外部コマンド等の授受を行なう。外部コマンドとは、ホストシステム4がフラッシュメモリシステム1に対して処理の実行を指示するためのコマンドである。ホストシステム4よりフラッシュメモリシステム1に供給されるデータ等は、ホストインターフェースブロック7を入口としてフラッシュメモリシステム1の内部(例えば、バッファ9)に取り込まれる。また、フラッシュメモリシステム1からホストシステム4に供給されるデータ等は、ホストインターフェースブロック7を出口としてホストシステム4に供給される。
The
ホストインターフェースブロック7は、コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3を備えている。コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3には、ホストシステム4から与えられる情報が書き込まれる。コマンドレジスタR1には、書き込みコマンド、読み出しコマンド等の外部コマンドが書き込まれる。セクタ数レジスタR2にはアクセス対象領域のセクタ数が書き込まれる。LBAレジスタR3には、アクセス対象領域の先頭のLBA(Logical Block Address)が書き込まれる。
The
ワークエリア8は、フラッシュメモリ2の制御に必要なデータを一時的に格納する作業領域であり、複数のSRAM(Static Random Access Memory)セルによって構成されている。ワークエリア8には、例えば、論理ブロックと物理ブロックとの対応関係や、論理ページと物理ページとの対応関係等を示したアドレス変換テーブル(後述)又は空きブロックを検索するための空ブロック検索テーブル等が記憶される。
The
バッファ9は、フラッシュメモリ2から読み出したデータを、ホストシステム4が受け取り可能な状態となるまで保持する。また、フラッシュメモリ2に書き込むデータを、フラッシュメモリ2が書き込み可能な状態となるまで保持する。
The
フラッシュメモリインターフェースブロック10は、内部バス14を介して、フラッシュメモリ2との間でデータ、アドレス情報、ステータス情報、内部コマンド等の授受を行う。ここで、内部コマンドとは、メモリコントローラ3がフラッシュメモリ2に処理の実行を指示するためのコマンドであり、フラッシュメモリ2は、メモリコントローラ3から与えられる内部コマンドに従って動作する。
The flash
ECCブロック11は、フラッシュメモリ2に書き込むデータに付加される誤り訂正符号(ECC:Error Correcting Code)を生成するとともに、読み出したデータに付加されている誤り訂正符号に基づいて、読み出したデータに含まれる誤りを検出・訂正する。
The
ROM12は、マイクロプロセッサ6による処理の手順を定義するプログラムを格納する不揮発性の記憶素子である。例えば、アドレス変換テーブルの作成等の処理手順を定義するプログラムが格納されている。
The
マイクロプロセッサ6は、ROM12に記憶されているプログラムに従って、メモリコントローラ3の全体の動作を制御する。例えば、マイクロプロセッサ6は、ROM12から読み出した各種処理を定義したコマンドセットに基づいてフラッシュメモリインターフェースブロック10に処理を実行させる。
The
フラッシュメモリ2はNAND型フラッシュメモリからなる。NAND型フラッシュメモリは、不揮発性メモリでありレジスタと、複数のメモリセルが2次元的に配列されたメモリセルアレイを備えている。メモリセルアレイは、複数のメモリセル群と、ワード線とを備える。ここで、メモリセル群は、複数のメモリセルが直列に接続されたものである。各ワード線は、メモリセル群の特定のメモリセルを選択するためのものである。このワード線を介して選択されたメモリセルとレジスタとの間で、レジスタから選択されたメモリセルへのデータの書き込み又は選択されたメモリセルからレジスタへのデータの読み出しが行われる。
The
NAND型フラッシュメモリでは、データ読み出し動作及びデータ書き込み動作はページ単位で行われ、データ消去動作はブロック(物理ブロック)単位でおこなわれる。物理ブロックは、複数のページ(物理ページ)で構成される。本実施の形態では、1個の物理ページが4セクタ(2048バイト)のユーザ領域と64バイトの冗長領域で構成され、1個の物理ブロックが64個の物理ページで構成されているNAND型フラッシュメモリを用いる。 In the NAND flash memory, a data read operation and a data write operation are performed in units of pages, and a data erase operation is performed in units of blocks (physical blocks). A physical block is composed of a plurality of pages (physical pages). In this embodiment, one physical page is composed of a 4-sector (2048-byte) user area and a 64-byte redundant area, and one physical block is composed of 64 physical pages. Use memory.
図2は、本実施の形態で用いるNAND型フラッシュメモリの1個の物理ページに含まれる記憶領域を示している。ユーザ領域25はホストシステム4から与えられるデータを記憶するための領域である。冗長領域26は、誤り訂正符号(ECC:Error Correcting Code)、論理アドレス情報、ブロックステータス(フラグ)等の付加データを記憶するための領域である。
FIG. 2 shows a storage area included in one physical page of the NAND flash memory used in the present embodiment. The
図2に示すようにユーザ領域25は、1セクタ(512バイト)の物理セクタ領域60(60a−60d)に分割して使用される。冗長領域26は、8バイトの共通冗長領域50と、14バイトの分割冗長領域70(70a−70d)に分割して使用される。各物理ブロックの先頭物理ページの共通冗長領域50には、論理アドレス情報、ブロックステータス(フラグ)等の物理ブロック毎で管理される情報が書き込まれる。更に、後述する第2の実施の形態では、各物理ページの共通冗長領域50に、論理ページと物理ページとの対応関係を管理するための情報が書き込まれる。
As shown in FIG. 2, the
4個の物理セクタ領域60a−60dと4個の分割冗長領域70a−70dは、1対1の対応関係が予め設定されている。本実施の形態では、物理セクタ領域60aが分割冗長領域70aに、物理セクタ領域60bが分割冗長領域70bに、物理セクタ領域60cが分割冗長領域70cに、物理セクタ領域60dが分割冗長領域70dに、それぞれ対応している。分割冗長領域70a−70dには、対応関係にある物理セクタ領域60a−60dに記憶されるデータに付加される誤り訂正符号等の物理セクタ領域60(60a−60d)毎で管理される情報が書き込まれる。後述する第1の実施の形態では、分割冗長領域70に、論理セクタ領域と物理セクタ領域との対応関係を管理するための情報が書き込まれる。
The four
このように、1個の物理ページがmセクタのユーザ領域で構成され、1個の物理ブロックがn個の物理ページで構成されているNAND型フラッシュメモリでは、1個の物理ブロックは、m×n個の物理セクタ領域(1セクタ単位の領域)で構成されているNAND型フラッシュメモリとして取り扱うこともできる。つまり、本実施の形態で用いたNAND型フラッシュメモリの場合には、256個の物理セクタ領域(1セクタ単位の領域)で構成されているNAND型フラッシュメモリとして取り扱うことができる。以下の説明で、物理ブロック内の物理セクタ領域に付けた通し番号を物理セクタ番号(PSN)と言う。例えば、1個の物理ブロックが256個の物理セクタ領域で構成されている場合、各物理ブロック内の256個の物理セクタ領域には、PSNとして#0−#255が付与される。 As described above, in a NAND flash memory in which one physical page is configured by a user area of m sectors and one physical block is configured by n physical pages, one physical block is m × It can also be handled as a NAND flash memory composed of n physical sector areas (areas per sector). In other words, the NAND flash memory used in the present embodiment can be handled as a NAND flash memory composed of 256 physical sector areas (areas of one sector unit). In the following description, a serial number assigned to a physical sector area in a physical block is referred to as a physical sector number (PSN). For example, when one physical block is composed of 256 physical sector areas, # 0 to # 255 are assigned as PSNs to 256 physical sector areas in each physical block.
論理アドレス情報は、物理ブロックと論理ブロックの対応関係を判別するための情報である。従って、記憶データが消去された物理ブロックのような対応する論理ブロックの無い物理ブロックについては、その冗長領域25に(先頭物理ページの共通冗長領域50に)、論理アドレス情報は格納されていない。
The logical address information is information for determining the correspondence between physical blocks and logical blocks. Therefore, for a physical block having no corresponding logical block, such as a physical block from which stored data has been erased, logical address information is not stored in the redundant area 25 (in the common
ブロックステータス(フラグ)は、物理ブロックの良否を示すフラグである。尚、初期不良の物理ブロックについては、不良ブロック(正常にデータの書き込み等を行うことができない物理ブロック)であることを示すブロックステータス(フラグ)が製造メーカによって書き込まれている。 The block status (flag) is a flag indicating pass / fail of the physical block. For the initial defective physical block, a block status (flag) indicating a defective block (physical block in which data cannot be normally written) is written by the manufacturer.
ホストシステム4側のアドレス空間は、セクタ(512バイト)単位で分割した領域(以下、論理セクタ領域と言う)に付けた通番であるLBA(Logical Block Address)で管理されている。又、複数個の論理セクタ領域で構成された論理ブロックを形成し、この論理ブロックに対して、1個又は複数個の物理ブロックが割り当てられる。この論理ブロックと物理ブロックの対応関係は、ゾーン単位で管理されることが多い。図3は、8個の論理ゾーンと8個の物理ゾーンを形成し、対応関係にある論理ゾーンと物理ゾーンの組毎に、論理ブロックと物理ブロックの対応関係を管理する場合の例を示している。この例では、LBA#0−#2047999からなる2048000個の論理セクタ領域を、8192個の物理ブロックからなるフラッシュメモリ2側の記憶領域に割り当てている。
アドレスが連続する256個の論理セクタ領域をまとめたものを論理ブロックとし、この論理ブロックに通し番号を付している。以下、論理ブロックに付した通し番号を論理ブロック番号(LBN)と言う。例えば、LBA#0−#255の256個の論理セクタ領域は、LBN#0の論理ブロックに属し、LBA#256−#511の256個の論理セクタ領域はLBN#1の論理ブロックに属している。このように、LBA#0−#2047999の2048000個の論理セクタ領域は、LBN#0−#7999の8000個の論理ブロックのいずれかに属している。
The address space on the
A group of 256 logical sector areas with consecutive addresses is defined as a logical block, and a serial number is assigned to this logical block. Hereinafter, a serial number assigned to a logical block is referred to as a logical block number (LBN). For example, the 256 logical sector areas of LBA # 0- # 255 belong to the logical block of
更に、この論理ブロックを複数個まとめたものを論理ゾーンとし、この論理ゾーンに通し番号を付している。以下、論理ゾーンに付した通し番号を論理ゾーン番号(LZN)と言う。この例では、8個の論理ゾーン(LZN#0−#7)が形成され、それぞれの論理ゾーンは、LBNが連続する1000個の論理ブロックから構成されている。尚、LBNが連続する論理ブロックを、異なる論理ゾーンに順次振り分けるようにして論理ゾーンを形成してもよい。例えば、LBN#0の論理ブロックはLZN#0の論理ゾーンに、LBN#1の論理ブロックはLZN#1の論理ゾーンに、LBN#2の論理ブロックはLZN#2の論理ゾーンにという順番でLZN#7の論理ゾーンまで振り分けていく。以下同様に、LBN#8の論理ブロックをLZN#0の論理ゾーンに、LBN#9の論理ブロックをLZN#1の論理ゾーンに、LBN#10の論理ブロックをLZN#2の論理ゾーンに振り分けていく。
Further, a logical zone is formed by collecting a plurality of logical blocks, and serial numbers are assigned to the logical zones. Hereinafter, the serial number assigned to the logical zone is referred to as a logical zone number (LZN). In this example, eight logical zones (LZN # 0- # 7) are formed, and each logical zone is composed of 1000 logical blocks with continuous LBN. Note that logical zones may be formed by sequentially assigning logical blocks having consecutive LBNs to different logical zones. For example, the logical block of
一方、フラッシュメモリ2側は、8192個の物理ブロックにより、8個の物理ゾーンが形成されている。8192個の物理ブロックには、固有の物理ブロックアドレス(PBA)が付されている。又、8個の物理ゾーンには、通し番号を付されている。以下、物理ゾーンに付された通し番号を、物理ゾーン番号(PZN)と言う。各物理ゾーンは、PBAが連続する物理ブロックが1024個で構成されている。尚、PBAが連続しない物理ブロックで物理ゾーンを形成するようにしてもよい。
On the other hand, on the
論理ゾーンと物理ゾーンの対応関係については、物理ゾーンのPZNと、当該PZNと同じ値のLZNを有する論理ゾーンとを対応させている。つまり、PZN#0の物理ゾーンに対してLZN#0の論理ゾーンが対応し、PZN#1の物理ゾーンに対してLZN#1の論理ゾーンが対応する。
Regarding the correspondence relationship between the logical zone and the physical zone, the PZN of the physical zone is associated with the logical zone having the same LZN value as the PZN. That is, the logical zone of
尚、論理ブロックと物理ブロックとの対応関係は通常、アドレス変換テーブルによって管理される。このアドレス変換テーブルは、論理ブロックと物理ブロックとの対応関係を記述したテーブルであり、各物理ブロックの冗長領域25に記憶されている論理アドレス情報に基づいて作成される。このアドレス変換テーブルを作成するときは、作成対象の物理ゾーンに含まれる物理ブロックの冗長領域25から論理アドレス情報が順次読み出され、読み出された論理アドレス情報に基づいて論理ブロックと物理ブロックとの対応関係が順次記述される。また、対応関係にある論理ブロック内の領域と物理ブロック内の領域を管理するために、論理セクタ領域と物理セクタ領域60の対応関係を示したセクタ情報テーブル(第1の実施の形態)又は論理ページ(後述)と物理ページの対応関係を示したページ情報テーブル(第2の実施の形態)も作成される。
The correspondence relationship between the logical block and the physical block is usually managed by an address conversion table. This address conversion table is a table describing the correspondence between logical blocks and physical blocks, and is created based on logical address information stored in the
尚、フラッシュメモリ内の物理ブロックには、出荷時から不良である先天性の不良ブロックが含まれている。更に、出荷時に良品の物理ブロックであっても、使用開始後に劣化して不良ブロックになる物理ブロック(後天性の不良ブロック)もある。従って、本実施の形態では、論理ゾーンに含まれる論理ブロックの数は1000個であるのに対し、物理ゾーンに含まれる物理ブロックの数は1024個としている。
<第1の実施の形態>
Note that the physical blocks in the flash memory include innate defective blocks that are defective from the time of shipment. Furthermore, even if a physical block is a non-defective product at the time of shipment, there is a physical block (acquired defective block) that deteriorates after use and becomes a defective block. Therefore, in this embodiment, the number of logical blocks included in the logical zone is 1000, whereas the number of physical blocks included in the physical zone is 1024.
<First Embodiment>
第1の実施の形態では、論理ブロックに含まれる256個の論理セクタ領域と物理ブロックに含まれる256個の物理セクタ領域60との対応関係をセクタ単位で管理している。尚、1個の物理ページに複数個の物理セクタ領域60が含まれている場合に、この複数個の物理セクタ領域60に対するデータの書き込みを複数回に分けて実行することができないNAND型フラッシュメモリの場合には、後述するページ単位(1個の物理ページに含まれるユーザ領域25のセクタ数単位)で論理ブロックに含まれる256個の論理セクタ領域と物理ブロックに含まれる256個の物理セクタ領域60との対応関係を管理する。つまり、第1の実施の形態は、各物理ページに対するデータの書き込みを物理セクタ領域60毎に分けて実行することのできるNAND型フラッシュメモリの場合に適用することができる。例えば、図2に示したように1個の物理ページに4個の物理セクタ領域60が含まれている場合には、この物理ページに対するデータの書き込みを4回に分けて実行することができるNAND型フラッシュメモリであれば、第1の実施の形態を適用することができる。
In the first embodiment, the correspondence between 256 logical sector areas included in a logical block and 256
本実施の形態の書き込み処理では、ホストシステム4によって、コマンドレジスタR1に書き込みコマンドを示すコマンドコードが書き込まれ、セクタ数レジスタR2に書き込むデータのセクタ数が書き込まれ、LBAレジスタR3には書き込みを開始する先頭データに対応するLBAが書き込まれる。ホストシステム4から与えられるデータ、セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別されるアクセス対象の領域である論理アクセス領域が含まれる論理ブロックに対応する物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭から書き込まれる。
In the write processing of the present embodiment, the
セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別される論理アクセス領域が複数個の論理ブロックに跨っている場合は、データの書き込み先になる物理ブロックも複数個になる。従って、論理アクセス領域が複数個の論理ブロックに跨っている場合は、論理アクセス領域が属する論理ブロック毎に領域を分割してデータの書き込み処理が行われる。例えば、論理アクセス領域が2個の論理ブロック(第1の論理ブロックと第2の論理ブロック)に跨っている場合は、第1の論理ブロックに対応する物理ブロックに対する書き込み処理と、第2の論理ブロックに対応する物理ブロックに対する書き込み処理とが行われる。第1の論理ブロックに属する論理アクセス領域に対して書き込むことが指示されたデータについては、第1の論理ブロックに対応する物理ブロック内のデータが書き込まれていない物理セクタ領域60に書き込まれる。第2の論理ブロックに属する論理アクセス領域に対して書き込むことが指示されたデータについては、第2の論理ブロックに対応する物理ブロック内のデータが書き込まれていない物理セクタ領域60に書き込まれる。
When the logical access area determined based on the information written in the sector number register R2 and the LBA register R3 extends over a plurality of logical blocks, there are a plurality of physical blocks to which data is written. Therefore, when the logical access area extends over a plurality of logical blocks, the area is divided for each logical block to which the logical access area belongs, and data write processing is performed. For example, when the logical access area extends over two logical blocks (the first logical block and the second logical block), the write processing for the physical block corresponding to the first logical block and the second logical block Write processing is performed on the physical block corresponding to the block. Data instructed to be written to the logical access area belonging to the first logical block is written to the
以下の説明で、ホストシステム4から与えられる情報、つまり、コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3に書き込まれる情報に基づいて実行される1セクタ又は複数セクタのデータの書き込み処理において、書き込まれるデータを一連のデータと言う。例えば、セクタ数レジスタR2に書き込まれた値がnの場合、nセクタ分の論理アドレスが連続するデータが一連のデータに対応する。尚、論理アクセス領域が複数個の論理ブロックに跨っている場合は、論理ブロック毎に一連のデータは分割される。例えば、論理アクセス領域が2個の論理ブロック(第1の論理ブロックと第2の論理ブロック)に跨っている場合に、第1の論理ブロックに属する論理アクセス領域のセクタ数がpセクタで、第2の論理ブロックに属する論理アクセス領域のセクタ数がqセクタであれば、セクタ数レジスタR2に書き込まれた値がn(n=p+q)であっても、一連のデータはpセクタの一連のデータとqセクタの一連のデータとに分割される。
In the following description, in the write process of data of one sector or a plurality of sectors executed based on information given from the
ホストシステム4は、書き込むデータのアドレス又は読み出すデータのアドレスをLBAで指示する。つまり、セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別されるLBA(セクタ数レジスタR2に書き込まれた値が1の場合)又はLBAが連続する範囲(セクタ数レジスタR2に書き込まれた値が2以上の場合)が書き込むデータの書き込み先を指示するアドレス又は読み出すデータの読み出し元を指示するアドレスになる。
The
ここで、1個の論理ブロックに含まれる論理セクタ領域の個数が2i個(例えば、i=8のときは256個)の場合、LBAの下位iビット(例えば、i=8のときは下位8ビット)が論理ブロック内の論理セクタ領域に付けた通し番号に対応する。以下、論理ブロック内の論理セクタ領域に付けた通し番号を論理セクタ番号(LSN)と言う。又、LBAの下位iビット(例えば、i=8のときは下位8ビット)を除いた、LBAの上位側のビットがLBNに対応する。従って、セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別されるLBAが連続する範囲において、LBAのLBNに対応する部分のビットが示す値が同一であれば、論理アクセス領域は複数個の論理ブロックに跨っていない。 Here, when the number of logical sector areas included in one logical block is 2 i (for example, 256 when i = 8), the lower i bits of the LBA (for example, lower when i = 8) 8 bits) corresponds to the serial number assigned to the logical sector area in the logical block. Hereinafter, the serial number assigned to the logical sector area in the logical block is referred to as a logical sector number (LSN). Further, the upper bits of the LBA, excluding the lower i bits of the LBA (for example, the lower 8 bits when i = 8) correspond to the LBN. Therefore, if the value indicated by the bit of the portion corresponding to the LBN of the LBA is the same in the range where the LBA determined based on the information written in the sector number register R2 and the LBA register R3 is continuous, the logical access area is It does not straddle multiple logical blocks.
次に、論理ブロックに含まれる256個の論理セクタ領域と物理ブロックに含まれる256個の物理セクタ領域60との対応関係をセクタ単位で管理するために、各物理セクタ領域60に対応する分割冗長領域70に書き込まれる情報について、図4を参照して説明する。図4は、PSN#0−#255の物理セクタ領域60に書き込まれているデータのLSNと、分割冗長領域70に書き込まれているスタートポインタ(SP)、スタート論理セクタ番号(SLSN)及びセクタカウント(SCNT)との対応関係を示している。スタートポインタ(SP)、スタート論理セクタ番号(SLSN)及びセクタカウント(SCNT)は、一連のデータ毎に設定され、その一連のデータが書き込まれた物理セクタ領域60に対応する分割冗長領域70に書き込まれる。
Next, in order to manage the correspondence between the 256 logical sector areas included in the logical block and the 256
SPは、次の一連のデータの書き込みが開始される物理セクタ領域60の物理セクタ番号(PSN)を表す情報である。つまり、SPは、一連のデータの末尾データが書き込まれる物理セクタ領域60の物理セクタ番号(PSN)の次の番号に対応する。尚、物理ブロック内の末尾の物理セクタ領域60まで一連のデータが書き込まれる場合は、#0がSPとして書き込まれる。SLSNは、一連のデータの先頭データに対応する論理セクタ番号(LSN)を表す情報である。SCNTは、一連のデータのセクタ数を表す情報である。スタートポインタ(SP)、スタート論理セクタ番号(SLSN)及びセクタカウント(SCNT)は、論理セクタ領域と物理セクタ領域60の対応関係を示したセクタ情報テーブルを作成するときに利用される。
The SP is information indicating the physical sector number (PSN) of the
尚、一連のデータは、物理ブロック内のPSNが小さい方の物理セクタ領域60から順番に書き込まれる。例えば、図4に示したように、最初の一連のデータのセクタ数が10セクタで、2番目の一連のデータのセクタ数が3セクタで、3番目の一連のデータのセクタ数が5セクタで、4番目の一連のデータのセクタ数が8セクタの場合、最初の一連のデータはPSN#0−#9の物理セクタ領域60に書き込まれ、2番目の一連のデータはPSN#10−#12の物理セクタ領域60に書き込まれ、3番目の一連のデータはPSN#13−#17の物理セクタ領域60に書き込まれ、4番目の一連のデータはPSN#18−#25の物理セクタ領域60に書き込まれる。
A series of data is written in order from the
尚、各物理ブロックの先頭の物理セクタ領域60から書き込みが開始される最初の一連のデータに付与されるSPとSCNTは同じ値になる。又、2番目以降の一連のデータに付与されるSPは、その一連のデータまでの各一連のデータに付与されるSCNTの総和に対応する。例えば、3番目の一連のデータに付与されるSPは、最初の一連のデータに付与されるSCNT、2番目の一連のデータに付与されるSCNT及び3番目の一連のデータに付与されるSCNTの総和に対応する。
It should be noted that SP and SCNT given to the first series of data starting to be written from the top
又、2番目以降の一連のデータに付与されるSCNTは、その一連のデータに付与されるSPと、その一連のデータの1つ前の一連のデータに付与されるSPとの差に対応する。例えば、3番目の一連のデータに付与されるSCNTは、3番目の一連のデータに付与されるSPと、2番目の一連のデータに付与されるSPとの差に対応する。 The SCNT given to the second and subsequent series of data corresponds to the difference between the SP given to the series of data and the SP given to the series of data immediately before the series of data. . For example, the SCNT assigned to the third series of data corresponds to the difference between the SP assigned to the third series of data and the SP assigned to the second series of data.
このように、SPとSCNTに関しては、いずれか一方の情報に基づいて他方の情報を求めることができる。従って、分割冗長領域70には、SPとSLSNの組合せ又はSCNTとSLSNの組合せを書き込むようにしてもよい。
Thus, regarding SP and SCNT, the other information can be obtained based on either one of the information. Therefore, a combination of SP and SLSN or a combination of SCNT and SLSN may be written in the divided
尚、一連のデータの書き込み処理で、論理アクセス領域が属する論理ブロックに対応する物理ブロックが無い場合、又は論理アクセス領域が属する論理ブロックに対応する物理ブロックに一連のデータを書き込むことができない場合は、空きブロック(データが書き込まれていない物理ブロック)の検索が行われ、検出された空きブロックに一連のデータが書き込まれる。論理アクセス領域が属する論理ブロックに対応する物理ブロックに一連のデータを書き込むことができない場合としては、空き領域(データが書き込まれていない物理セクタ領域60)が無い場合や、空き領域のセクタ数が一連のデータのセクタ数より少ない場合などが挙げられる。
When there is no physical block corresponding to the logical block to which the logical access area belongs in the series of data write processing, or when a series of data cannot be written to the physical block corresponding to the logical block to which the logical access area belongs. A search for empty blocks (physical blocks in which no data is written) is performed, and a series of data is written in the detected empty blocks. As a case where a series of data cannot be written to the physical block corresponding to the logical block to which the logical access area belongs, there is no empty area (
図4に示した例では、PBA#7の物理ブロックに4つの一連のデータが保存されている。この4つの一連のデータの書き込み処理について具体的に説明をする。尚、図4に示した例で、D#nは、LSN#nの論理セクタ領域と対応するデータを示している。例えば、D#3は、LSN#3の論理セクタ領域と対応するデータを示している。
(最初の一連のデータの書き込み処理)
In the example shown in FIG. 4, four series of data are stored in the physical block of
(First data write process)
まず、ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に3が、セクタ数レジスタR2に10が書き込まれる。メモリコントローラ3は、LBAレジスタR3に書き込まれたLBA#3とセクタ数レジスタR2に書き込まれた値10とから、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#3−#12であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、複数の論理ブロックに跨っていないと判断する。即ち、この一連のデータは単一の物理ブロックに書き込まれると判断する。
First, the
LBN#0の論理ブロックは、LZN#0の論理ゾーンに属し、LZN#0の論理ゾーンはPZN#0の物理ゾーンに割り当てられている。メモリコントローラ3は、LBN#0の論理ブロックに対応する物理ブロックが無いため、PZN#0の物理ゾーンから空ブロックを検索し、例えば、空きブロックとしてPBA#7の物理ブロックを検出する。尚、LBN#0の論理ブロックのデータが物理ブロックに既に保存されており、当該物理ブロックに10セクタ分のデータを書き込む領域が存在する場合には、空きブロック検索は行なわず、当該物理ブロックのデータが書き込まれていない物理セクタ領域60に、この一連のデータが書き込まれる。
The logical block of
次に、この一連のデータを物理セクタ領域60に書き込む際に、分割冗長領域70に書き込むスタートポインタ(SP)、スタート論理セクタ番号(SLSN)及びセクタカウント(SCNT)について説明する。まず、LBAレジスタR3に書き込まれたLBAの下位8ビットから、SLSNに対応する値#3が求められ、セクタ数レジスタR2に書き込まれた値から、SCNTに対応する値10が求められる。更に、この一連のデータの書き込みを開始する物理セクタ領域60(つまり、この一連のデータの先頭データが書き込まれる物理セクタ領域60)のPSNである#0とSCNTの値10からSPに対応する#10が求められる。
メモリコントローラ3は、PBA#7の物理ブロック内のPSN#0の物理セクタ領域60から一連のデータの書き込みを開始する。LBA#3−#12の論理アクセス領域に書き込むことが指示された一連のデータは、PSN#0−#9の物理セクタ領域60に書き込まれる。この際、PSN#0−#9の物理セクタ領域60に対応する全ての分割冗長領域70には、SP#10、SLSN#3、SCNT10が書き込まれる。
(2番目の一連のデータの書き込み処理)
Next, a start pointer (SP), a start logical sector number (SLSN), and a sector count (SCNT) that are written in the divided
The
(Second series of data write processing)
ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に0が、セクタ数レジスタR2に3が書き込まれる。メモリコントローラ3は、LBAレジスタR3に書き込まれたLBA#0とセクタ数レジスタR2に書き込まれた値3とから、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#0−#2であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、複数の論理ブロックに跨っていないと判断する。また、論理ブロックと物理ブロックの対応関係を記述したアドレス変換テーブルに基づいて、LBN#0の論理ブロックがPBA#7の物理ブロックに対応していることを判別する。
The
続いて、PBA#7の物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭を検索する空きセクタ領域検索が行われる。この空きセクタ領域検索の終了後、メモリコントローラ3は、物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭であるPSN#10の物理セクタ領域60から一連のデータの書き込みを開始する。従って、LBA#0−#2の論理アクセス領域に書き込むことが指示された一連のデータは、PBA#7の物理ブロックのPSN#10−#12の物理セクタ領域60に書き込まれる。
Subsequently, a free sector area search is performed to search the top of the
この一連のデータを物理セクタ領域60に書き込む際に、分割冗長領域70に書き込む情報については、LBAレジスタR3に書き込まれたLBAの下位8ビットから、SLSNに対応する値#0が求められ、セクタ数レジスタR2に書き込まれた値から、SCNTに対応する値3が求められる。更に、この一連のデータの書き込みを開始する物理セクタ領域60(つまり、この一連のデータの先頭データが書き込まれる物理セクタ領域60)のPSNである#10とSCNTの値3からSPに対応する#13が求められる。これらの情報は、PBA#7の物理ブロック内のPSN#10−#12の物理セクタ領域60に一連のデータを書き込む際に、PSN#10−#12の物理セクタ領域60に対応する全ての分割冗長領域70に書き込まれる。つまり、PSN#10−#12の物理セクタ領域60に対応する全ての分割冗長領域70に、SP#13、SLSN#0、SCNT3が書き込まれる。
(3番目の一連のデータの書き込み処理)
When writing this series of data to the
(3rd data write process)
ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に5が、セクタ数レジスタR2に5が書き込まれる。メモリコントローラ3は、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#5−#9であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、LBN#0の論理ブロックがPBA#7の物理ブロックに対応していることを判別する。
The
続いて、PBA#7の物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭を検索する空きセクタ領域検索が行われる。この空きセクタ領域検索の終了後、メモリコントローラ3は、LBA#5−#9の論理アクセス領域に書き込むことが指示された一連のデータを、PBA#7の物理ブロックのPSN#13−#17の物理セクタ領域60に書き込む。
Subsequently, a free sector area search is performed to search the top of the
この一連のデータをPBA#7の物理ブロック内のPSN#13−#17の物理セクタ領域60に書き込む際に、PSN#13−#17の物理セクタ領域60に対応する全ての分割冗長領域70には、SP#18、SLSN#5、SCNT5が書き込まれる。尚、SP、SLSN及びSCNTについては、LBAレジスタR3とセクタ数レジスタR2に書き込まれた情報及び一連のデータの先頭データが書き込まれる物理セクタ領域60のPSNに基づいて求められる。
(4番目の一連のデータの書き込み処理)
When this series of data is written to the
(4th data write process)
ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に10が、セクタ数レジスタR2に8が書き込まれる。メモリコントローラ3は、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#10−#17であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、LBN#0の論理ブロックがPBA#7の物理ブロックに対応していることを判別する。
The
続いて、PBA#7の物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭を検索する空きセクタ領域検索が行われる。この空きセクタ領域検索の終了後、メモリコントローラ3は、LBA#10−#17の論理アクセス領域に書き込むことが指示された一連のデータを、PBA#7の物理ブロックのPSN#18−#25の物理セクタ領域60に書き込む。
Subsequently, a free sector area search is performed to search the top of the
この一連のデータをPBA#7の物理ブロック内のPSN#18−#25の物理セクタ領域60に書き込む際に、PSN#18−#25の物理セクタ領域60に対応する全ての分割冗長領域70には、SP#26、SLSN#10、SCNT8が書き込まれる。尚、SP、SLSN及びSCNTについては、LBAレジスタR3とセクタ数レジスタR2に書き込まれた情報及び一連のデータの先頭データが書き込まれる物理セクタ領域60のPSNに基づいて求められる。
When this series of data is written to the
次に、物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭を検索する空きセクタ領域検索について説明する。この空きセクタ領域検索は、分割冗長領域70に書き込まれているSP又はSCNTに基づいて行うことができる。例えば、物理ブロック内の先頭の物理セクタ領域60(PSN#0の物理セクタ領域60)に対応する分割冗長領域70に書き込まれているSPに基づいて、2番目の一連のデータの書き込みが開始される物理セクタ領域60(最初の一連のデータの末尾データが書き込まれている物理セクタ領域60の次の物理セクタ領域60)が分かる。2番目の一連のデータが書き込まれていない場合は、この2番目の一連のデータの書き込みが開始される物理セクタ領域60に対応する分割冗長領域70にSPが書き込まれていないが、2番目の一連のデータが書き込まれている場合は、この2番目の一連のデータの書き込みが開始される物理セクタ領域60に対応する分割冗長領域70にSPが書き込まれている。
Next, a free sector area search for searching for the head of the
更に、この2番目の一連のデータの書き込みが開始される物理セクタ領域60に対応する分割冗長領域70に書き込まれているSPに基づいて、3番目の一連のデータの書き込みが開始される物理セクタ領域60が分かる。このようにして、次の一連のデータの書き込み開始される物理セクタ領域60に対応する分割冗長領域70に書き込まれているSPを順次読み出していき、SPが書き込まれていないときは、その物理セクタ領域60がデータが書き込まれていない物理セクタ領域60の先頭であると判断する。
<セクタ情報テーブルの作成処理>
Further, based on the SP written in the divided
<Sector information table creation processing>
各物理ブロックに記憶されているデータを読み出す場合、ホストシステム4により、コマンドレジスタR1に読み出しコマンドのコマンドコードが書き込まれ、LBAレジスタR3及びセクタ数レジスタR2に、読み出すデータに対応する論理アクセス領域を指示する情報が書き込まれる。つまり、読み出し処理の場合も、ホストシステム4により、アクセス対象の論理アクセス領域が指示される。
When reading the data stored in each physical block, the
コマンドレジスタR1に読み出しコマンドのコマンドコードが書き込まれたとき、メモリコントローラ3は、LBAレジスタR3及びセクタ数レジスタR2に書き込まれた情報に基づいて論理アクセス領域を判別する。つまり、アクセス対象の論理ブロック及び論理セクタ領域を判別する。更に、メモリコントローラ3は、アクセス対象の論理ブロックに対応する物理ブロックと、アクセス対象の論理セクタ領域に対応する物理セクタ領域60を判別しなければならない。
論理ブロックと物理ブロックの対応関係については、上述のアドレス変換テーブルに基づいて判別することができる。論理セクタ領域と物理セクタ領域60の対応関係については、分割冗長領域70に書き込まれているSLSN及びSCNTに基づいて、論理セクタ領域と物理セクタ領域60の対応関係を記述したセクタ情報テーブルを作成し、このセクタ情報テーブルに基づいて論理セクタ領域と物理セクタ領域60の対応関係を判別する。
When the command code of the read command is written in the command register R1, the
The correspondence between the logical block and the physical block can be determined based on the above-described address conversion table. Regarding the correspondence relationship between the logical sector region and the
次に、このセクタ情報テーブルの作成処理について説明する。セクタ情報テーブルの作成処理では、メモリコントローラ3は、一連のデータの先頭データが記憶されている物理セクタ領域60に対応する分割冗長領域70からSLSN及びSCNTを読み出し、一連のデータ単位で論理セクタ領域と物理セクタ領域60との対応関係を判別し、判別された論理セクタ領域と物理セクタ領域60との対応関係をセクタ情報テーブル上に書き込んでいく。
Next, the sector information table creation process will be described. In the creation process of the sector information table, the
尚、このセクタ情報テーブルの作成処理では、SLSN及びSCNTと共にSPも読み出され、読み出されたSPに基づいて、次の一連のデータの先頭データが記憶されている物理セクタ領域60が判別される。尚、SPを用いずにSCNTの値に基づいて、次の一連のデータの先頭データが記憶されている物理セクタ領域60を判別するようにしてもよい。
In this sector information table creation process, the SP is read together with the SLSN and SCNT, and the
また、一連のデータが末尾データまで正常に書き込まれているかどうかを確認するため、一連のデータの先頭データが記憶されている物理セクタ領域60に対応する分割冗長領域70に記憶されているSP、SLSN及びSCNTと、末尾データが記憶されている物理セクタ領域60に対応する分割冗長領域70に記憶されているSP、SLSN及びSCNTとが一致するかどうかを確認する。一連のデータが末尾データまで正常に書き込まれていない場合、例えば、末尾データを書き込む前に電源遮断が起こった場合、末尾データが書き込まれているべき物理セクタ領域60に対応する分割冗長領域70には、SP、SLSN及びSCNTが書き込まれていないので、双方の分割冗長領域70から読み出されたSP、SLSN及びSCNTは一致しない。このような場合、その一連のデータは正常に書き込まれていないと判断される。従って、一連のデータの先頭データが記憶されている物理セクタ領域60に対応する分割冗長領域70に記憶されているSP、SLSN及びSCNTと、末尾データが記憶されている物理セクタ領域60に対応する分割冗長領域70に記憶されているSP、SLSN及びSCNTとが一致しなかった場合、その一連のデータに対応する論理セクタ領域と物理セクタ領域との対応関係をセクタ情報テーブルに反映させずに、セクタ情報テーブルの作成処理を終了する。
Further, in order to check whether a series of data is normally written up to the end data, the SP stored in the divided
次に、図4のように、PBA#7の物理ブロックに4つの一連のデータが保存されている場合のセクタ情報テーブルの作成処理を図5を参照して説明する。尚、このセクタ情報テーブルを作成するときは、ワークエリア8にLSN#0−#255に対応するPSNを書き込む領域(以下、セクタ情報テーブル作成領域と言う。)が確保される。
Next, as shown in FIG. 4, a process of creating a sector information table when four series of data are stored in the physical block of
セクタ情報テーブルの作成処理では、初めに、PBA#7の物理ブロックのPSN#0の物理セクタ領域60に対応する分割冗長領域70からSP、SLSN及びSCNTが読み出される。PSN#0の物理セクタ領域60に対応する分割冗長領域70から読み出されたSPから、最初の一連のデータの末尾データの保存先が判断される。続いて、最初の一連のデータが末尾データまで正常に保存されているかどうかを確認するため、末尾データの保存先であるPSN#9の物理セクタ領域60に対応する分割冗長領域70からSP、SLSN及びSCNTが読み出される。PSN#0の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTの値と、PSN#9の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTの値が等しいかどうかが判断される。両者の値が等しいとき、最初の一連のデータの書き込みが正常に終了していると判断され、最初の一連のデータに関する情報がセクタ情報テーブルに反映される。
この反映処理では、SLSN及びSCNTの値(SLSN#3、SCNT10)からLSN#3−#12の論理セクタ領域が、PSN#0−#9の物理セクタ領域60に対応していると判断され、図5の(A)に示すように、セクタ情報テーブル作成領域のLSN#3−#12に対応する領域にPSNの値である#0−#9が書き込まれる。つまり、LSN#3に対応する領域にPSNの値として#0が書き込まれ、LSN#4に対応する領域にPSNの値として#1が書き込まれ、LSN#5に対応する領域にPSNの値として#2が書き込まれ、以下同様にPSNが書き込まれていき、LSN#12に対応する領域にPSNの値として#9が書き込まれる。尚、2番目の一連のデータの先頭データの保存先については、SPの値からPSN#10の物理セクタ領域60であると判断される。
In the creation process of the sector information table, first, SP, SLSN, and SCNT are read from the divided
In this reflection process, it is determined from the values of SLSN and SCNT (
次に、2番目の一連のデータの先頭データの保存先であるPSN#10の物理セクタ領域60に対応する分割冗長領域70から、SP、SLSN及びSCNTが読み出される。また、読み出されたSPの値が#13であるため、2番目の一連のデータの末尾データの保存先は、PSN#12の物理セクタ領域60であると判断され、PSN#12の物理セクタ領域60に対応する分割冗長領域70に書き込まれているSP、SLSN及びSCNTの値が読み出される。PSN#10の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTと、PSN#12の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTの値が等しいとき、2番目の一連のデータの書き込みが正常に終了していると判断され、2番目の一連のデータに関する情報がセクタ情報テーブルに反映される。
Next, SP, SLSN, and SCNT are read from the divided
この反映処理では、SLSN及びSCNTの値(SLSN#0、SCNT3)からLSN#0−#2の論理セクタ領域が、PSN#10−#12の物理セクタ領域60に対応していると判断され、図5の(B)に示すように、セクタ情報テーブル作成領域のLSN#0−#2に対応する領域にPSNの値である#10−#12が書き込まれる。つまり、LSN#0に対応する領域にPSNの値として#10が書き込まれ、LSN#1に対応する領域にPSNの値として#11が書き込まれ、LSN#2に対応する領域にPSNの値として#12が書き込まれる。尚、3番目の一連のデータの先頭データの保存先については、SPの値からPSN#13の物理セクタ領域60であると判断される。
In this reflection process, it is determined from the values of SLSN and SCNT (
次に、3番目の一連のデータの先頭データの保存先であるPSN#13の物理セクタ領域60に対応する分割冗長領域70から、SP、SLSN及びSCNTが読み出される。また、読み出されたSPの値が#18であるため、3番目の一連のデータの末尾データの保存先は、PSN#17の物理セクタ領域60であると判断され、PSN#17の物理セクタ領域60に対応する分割冗長領域70に書き込まれているSP、SLSN及びSCNTの値が読み出される。PSN#13の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTと、PSN#17の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTの値が等しいとき、3番目の一連のデータの書き込みが正常に終了していると判断され、3番目の一連のデータに関する情報がセクタ情報テーブルに反映される。
Next, SP, SLSN, and SCNT are read from the divided
この反映処理では、SLSN及びSCNTの値(SLSN#5、SCNT5)からLSN#5−#9の論理セクタ領域が、PSN#13−#17の物理セクタ領域60に対応していると判断され、図5の(C)に示すように、セクタ情報テーブル作成領域のLSN#5−#9に対応する領域にPSNの値である#13−#17が書き込まれる。この際、セクタ情報テーブル作成領域のLSN#5−#9に対応する領域に書き込まれていた#2−#6が、#13−#17に書き替えられる。このように、セクタ情報テーブルの作成処理では、後から書き込まれた一連のデータに関する情報が優先される。尚、4番目の一連のデータの先頭データの保存先については、SPの値からPSN#18の物理セクタ領域60であると判断される。
In this reflection process, it is determined from the values of SLSN and SCNT (
次に、4番目の一連のデータの先頭データの保存先であるPSN#18の物理セクタ領域60に対応する分割冗長領域70から、SP、SLSN及びSCNTが読み出される。また、読み出されたSPの値が#26であるため、4番目の一連のデータの末尾データの保存先は、PSN#25の物理セクタ領域60であると判断され、PSN#25の物理セクタ領域60に対応する分割冗長領域70に書き込まれているSP、SLSN及びSCNTの値が読み出される。PSN#18の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTと、PSN#25の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTの値が等しいとき、4番目の一連のデータの書き込みが正常に終了していると判断され、4番目の一連のデータに関する情報がセクタ情報テーブルに反映される。
Next, SP, SLSN, and SCNT are read from the divided
この反映処理では、SLSN及びSCNTの値(SLSN#10、SCNT8)からLSN#10−#17の論理セクタ領域が、PSN#18−#25の物理セクタ領域60に対応していると判断され、図5の(D)に示すように、セクタ情報テーブル作成領域のLSN#10−#17に対応する領域にPSNの値である#18−#25が書き込まれる。この際、セクタ情報テーブル作成領域のLSN#10−#12に対応する領域に書き込まれていた#7−#9が、#18−#20に書き替えられる。尚、5番目の一連のデータの先頭データの保存先については、SPの値からPSN#26の物理セクタ領域60であると判断される。
In this reflection process, it is determined from the SLSN and SCNT values (
次に、5番目の一連のデータの先頭データの保存先であるPSN#26の物理セクタ領域60に対応する分割冗長領域70からのSP、SLSN及びSCNTの読み出しが行われるが、SP、SLSN及びSCNTが書き込まれていないためセクタ情報テーブルの作成処理を終了する。
<異常終了に関する処理>
Next, SP, SLSN, and SCNT are read from the divided
<Processing related to abnormal termination>
図6は、図4に示した4つの一連のデータの書き込みにおいて、4番目の一連のデータの書き込みが正常に終了しなかった場合を示している。このような異常終了の原因としては、例えば、フラッシュメモリシステム1への電力供給が遮断されることが挙げられる。4番目の一連のデータの書き込みは、PSN#18−#22の物理セクタ領域60にデータが書き込まれた状態で終了し、PSN#23−#25の物理セクタ領域60には、データが保存されていない。以下では、このような異常終了が発生した物理ブロックにおけるセクタ情報テーブルの作成処理を説明する。
FIG. 6 shows a case where the writing of the fourth series of data does not end normally in the writing of the four series of data shown in FIG. As a cause of such abnormal termination, for example, power supply to the
最初の一連のデータ、2番目の一連のデータ及び3番目の一連のデータの書き込みは正常に終了しているので、これらの一連のデータに関する情報はセクタ情報テーブルに反映される。しかし、4番目の一連のデータに関する反映処理では、PSN#18の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTと、PSN#25の物理セクタ領域60に対応する分割冗長領域70から読み出されたSP、SLSN及びSCNTの値が等しくないため、4番目の一連のデータの書き込みが正常に終了していないと判断され、4番目の一連のデータに関する情報はセクタ情報テーブルに反映ない。従って、最初の一連のデータ、2番目の一連のデータ及び3番目の一連のデータに関する情報が反映されたセクタ情報テーブル(図5の(C)に示したセクタ情報テーブル)が、この物理ブロックにおけるセクタ情報テーブルとして使用される。
Since the writing of the first series of data, the second series of data, and the third series of data has been normally completed, information regarding these series of data is reflected in the sector information table. However, in the reflection process regarding the fourth series of data, it corresponds to the SP, SLSN and SCNT read from the divided
このような一部の一連のデータが正常に書き込まれていない物理ブロックが見つかったときには、その物理ブロックに保存されている有効なデータが、別の物理ブロックに転送される。つまり、正常に書き込まれている一連のデータのうち、後の一連のデータで書き替えられていないデータが、別の物理ブロックに転送される。 When a physical block in which such a partial series of data is not normally written is found, valid data stored in the physical block is transferred to another physical block. In other words, data that has not been rewritten by a subsequent series of data among a series of data that has been normally written is transferred to another physical block.
次に、この転送処理について説明する。この転送処理は、正常に書き込まれている一連のデータ情報が反映されたセクタ情報テーブルに基づいて行われる。つまり、セクタ情報テーブル作成領域に書き込まれているPSNに対応する物理セクタ領域60に保存されているデータが、別の物理ブロックに転送される。図6に示したように、4番目の一連のデータの書き込みが正常に終了しなかった場合、図5の(C)に示した最初の一連のデータ、2番目の一連のデータ及び3番目の一連のデータに関する情報が反映されたセクタ情報テーブルに基づいて転送処理が行われる。
Next, this transfer process will be described. This transfer process is performed based on a sector information table in which a series of data information written normally is reflected. That is, data stored in the
図5の(C)に示したセクタ情報テーブルに基づいた転送処理を、図7を参照して説明する。図7に示した例で、D#nは、LSN#nの論理セクタと対応するデータを示している。尚、この転送処理では、転送先の物理ブロック(空きブロック)の検索がされる。ここでは、PZN#1の物理ゾーン内の空きブロックが検索され、空ブロックとしてPBA#15の物理ブロックが検出されたとする。このPBA#15の物理ブロックに、PBA#7の物理ブロックに保存されているデータを転送するときには、図5の(C)のセクタ情報テーブルに基づいて、LSNの値の小さい方から順番に転送される。つまり、セクタ情報テーブル作成領域に書き込まれているPSNに対応する物理セクタ領域60に保存されているデータは、そのPSNに対応するLSNの値が小さい方から順番に転送される。
A transfer process based on the sector information table shown in FIG. 5C will be described with reference to FIG. In the example shown in FIG. 7, D # n indicates data corresponding to the logical sector of LSN # n. In this transfer process, a search is made for a transfer destination physical block (empty block). Here, it is assumed that an empty block in the physical zone of
図5の(C)のセクタ情報テーブルの場合、LSN#0−#12に対応するPSNだけがセクタ情報テーブル作成領域に書き込まれている。従って、PBA#7の物理ブロックに保存されているデータのうち、セクタ情報テーブル作成領域のLSN#0−#12に対応する領域に書き込まれているPSNに対応する物理セクタ領域60に記憶されているデータだけが、PBA#15の物理ブロックに転送される。
In the case of the sector information table in FIG. 5C, only PSNs corresponding to
まず、図5の(C)に示すセクタ情報テーブルでは、LSN#0にPSN#10が対応しているので、PBA#7の物理ブロックのPSN#10の物理セクタ領域60に保存されているデータが、PBA#15の物理ブロックのPSN#0の物理セクタ領域60に転送される。次に、LSN#1にPSN#11が対応しているので、PBA#7の物理ブロックのPSN#11の物理セクタ領域60に保存されているデータが、PBA#15のPSN#1の物理セクタ領域60に転送される。同様の処理がLSNの順番で行われていき、PBA#7の物理ブロックのPSN#9の物理セクタ領域60に保存されているデータが、PBA#15の物理ブロックのPSN#12の物理セクタ領域60に転送されて、この転送処理が終了する。
First, in the sector information table shown in FIG. 5C, since
次に、この転送処理の際に、分割冗長領域70に書き込まれるSP、SLSN及びSCNTについて説明する。この転送処理では、PBA#7の物理ブロックからPBA#15の物理ブロックに転送される全てのデータのLSNが連続しているため、全てのデータが「一連のデータ」としてPBA#15の物理ブロックに書き込まれたと見なしたSP、SLSN及びSCNTが設定される。つまり、この転送処理が終了したときに、PBA#15の物理ブロックブロック内のデータが書き込まれていない物理セクタ領域60の先頭に対応するPSNである#13が、SPの値になる。この一連のデータの先頭データに対応するLSNである#0が、SLSNの値になる。この一連のデータに含まれるデータのセクタ数である13が、SCNTの値になる。
Next, SP, SLSN, and SCNT that are written in the divided
このように、異常終了した物理ブロックのデータを転送する際には、LSNが連続する論理セクタ領域に対応するデータを一連のデータと見なして、転送処理が行われる。従って、SP、SLSN及びSCNTは、LSNが連続する論理セクタ領域に対応するデータを一連のデータと見なして設定される。つまり、LSNが連続する論理セクタ領域の先頭の論理セクタ領域のLSNがSLSNになり、LSNが連続する論理セクタ領域の数がSCNTになる。SPの値は、LSNが連続する論理セクタ領域の先頭の論理セクタ領域に対応するデータを書き込む物理セクタ領域60のPSNの値にSCNTの値を足した値になる。
As described above, when data of a physical block that has ended abnormally is transferred, data corresponding to logical sector areas in which LSNs are continuous is regarded as a series of data, and transfer processing is performed. Therefore, SP, SLSN, and SCNT are set by regarding data corresponding to logical sector areas in which LSNs are continuous as a series of data. That is, the LSN of the first logical sector area of the logical sector area where the LSN is continuous becomes SLSN, and the number of logical sector areas where the LSN is continuous becomes SCNT. The SP value is a value obtained by adding the SCNT value to the PSN value of the
上記第1の実施の形態のフラッシュメモリシステム1によれば、一連のデータの保存先の物理セクタ領域60に対応する分割冗長領域70に、この一連のデータに関するSP、SLSN及びSCNTを書き込んでいる。また、この一連のデータに関する論理セクタ領域と物理セクタ領域60との対応関係は、この一連のデータに関するSLSN及びSCNTに基づいて把握することができる。従って、一連のデータの先頭データが保存されている物理セクタ領域60に対応する分割冗長領域70に書き込まれているSLSN及びSCNTを読み出し、読み出したSLSN及びSCNTに基づいて把握された論理セクタ領域と物理セクタ領域60との対応関係をセクタ情報テーブルに反映させていくことにより、セクタ情報テーブルを完成させることができる。
According to the
尚、各一連のデータに関する論理セクタ領域と物理セクタ領域60との対応関係は、後から書き込まれた一連のデータに関する方が優先されるため、各一連のデータに関する論理セクタ領域と物理セクタ領域60との対応関係は、一連のデータが書き込まれた順番でセクタ情報テーブルに反映される。
The correspondence between the logical sector area and the
又、各一連のデータの先頭データが保存されている物理セクタ領域60のPSNは、1つ前の一連のデータに関するSPに基づいて把握することができる。SPを分割冗長領域70に書き込まない場合には、SCNTに基づいて各一連のデータの先頭データが保存されている物理セクタ領域60のPSNを把握することもできる。
Further, the PSN of the
又、一連のデータの先頭データが保存されている物理セクタ領域60に対応する分割冗長領域70に書き込まれているSP、SLSN及びSCNTと、その一連のデータの末尾データが保存されている物理セクタ領域60に対応する分割冗長領域70に書き込まれているSP、SLSN及びSCNTが一致しているか否かにより、その一連のデータが正常に書き込まれているか否かを判別することができる。従って、正常に書き込まれた一連のデータに関する論理セクタ領域と物理セクタ領域60との対応関係だけが、セクタ情報テーブルに反映される。
<第2の実施の形態>
Also, the SP, SLSN and SCNT written in the divided
<Second Embodiment>
第2の実施の形態では、ページ単位(1個の物理ページに含まれるユーザ領域25のセクタ数単位)で論理ブロックに含まれる論理セクタ領域と物理ブロックに含まれる物理セクタ領域との対応関係を管理する。従って、各物理ページに対してデータの書き込みを行うことのできる回数が1回だけのNAND型フラッシュメモリを用いる場合にも実施することができる。尚、フラッシュメモリシステム1の構成は第1の実施の形態と同じであるため、説明を省略する。
In the second embodiment, the correspondence between the logical sector area included in the logical block and the physical sector area included in the physical block in page units (in units of the number of sectors of the
図8は、LBN#0の論理ブロックと対応関係にあるPBA#24の物理ブロックに保存されている一連のデータ並びにこの一連のデータに関するスタートポインタ(SP)、スタート論理ページ番号(SLPN)及びページカウンタ(PCNT)を示している。以下の説明で、各物理ブロック内の物理ページに付けた通し番号を物理ページ番号(PPN)と言う。又、各論理ブロック内の論理セクタ領域を1個の物理ページに含まれるユーザ領域25のセクタ数単位でまとめたものを論理ページとし、この論理ページに付けた通し番号を論理ページ番号(LPN)と言う。
FIG. 8 shows a series of data stored in the physical block of
本実施の形態では、1個の物理ページが4セクタ(2048バイト)のユーザ領域25で構成され(1個の物理ページに4個の物理セクタ領域60含まれ)、1個の物理ブロックが64個の物理ページで構成されているNAND型フラッシュメモリを用いる。尚、図2に示したように、各物理ページに含まれる4個の物理セクタ領域60については、先頭から順番に(カラムアドレスが小さい方から順番に)、第1物理セクタ領域60a、第2物理セクタ領域60b、第3物理セクタ領域60c、第4物理セクタ領域60dと言う。尚、本実施の形態では、スタートポインタ(SP)、スタート論理ページ番号(SLPN)及びページカウンタ(PCNT)が共通冗長領域50に書き込まれるため、共通冗長領域50を8バイトから16バイトに変更し、分割冗長領域70を14バイトから12バイトに変更する。
In the present embodiment, one physical page is configured by the
第2の実施の形態で共通冗長領域50に書き込まれるスタートポインタ(SP)は、次の一連のデータの書き込みが開始される物理ページの物理ページ番号(PPN)を表す情報である。つまり、スタートポインタ(SP)は、一連のデータの末尾データが書き込まれる物理ページの物理ページ番号(PPN)の次の番号に対応する。尚、物理ブロック内の末尾の物理ページまで一連のデータが書き込まれる場合は、#0がSPとして書き込まれる。スタート論理ページ番号(SLPN)は、一連のデータの先頭データに対応する論理セクタ領域が属する論理ページの論理ページ番号(LPN)を表す情報である。ページカウンタ(PCNT)は、一連のデータの先頭データに対応する論理セクタ領域が属する論理ページから、その一連のデータの末尾データに対応する論理セクタ領域が属する論理ページまでのページ数を表す情報である。スタートポインタ(SP)、スタート論理セクタ番号(SLSN)及びページカウント(PCNT)は、論理ページと物理ページの対応関係を示したページ情報テーブルを作成するときに利用される。
第2の実施の形態では、論理ページと物理ページとの対応関係は変化するが、物理ページ内の4個の物理セクタ領域60と論理ページ内の4個の論理セクタ領域の相対的な関係は変化しない。従って、第2の実施の形態では、ページ単位で論理ブロックに含まれる256個の論理セクタ領域と物理ブロックに含まれる256個の物理セクタ領域60との対応関係を管理する。つまり、本実施の形態のように、1個の物理ページに4個の物理セクタ領域60が含まれる場合であれば、PSNの下位2ビットとLSNの下位2ビットは常に一致するように物理セクタ領域60と論理セクタ領域との対応関係が決められる。即ち、下位2ビットが00のLSNに対応したデータは、第1物理セクタ60aに保存され、下位2ビットが01のLSNに対応したデータは第2物理セクタ60bに保存され、下位2ビットが10のLSNに対応したデータは第3物理セクタに保存され、下位2ビットが11のLSNに対応したデータは第4物理セクタに保存される。尚、論理ページ番号(LPN)は、8ビットのLSNの上位6ビットに対応し、物理ページ番号は8ビットのPSNの上位6ビットに対応する。
The start pointer (SP) written in the common
In the second embodiment, the correspondence between the logical page and the physical page changes, but the relative relationship between the four
次に、スタートポインタ(SP)、スタート論理セクタ番号(SLSN)及びページカウント(PCNT)の求め方を説明する。本実施の形態で用いたNAND型フラッシュメモリでは、LBAレジスタR3に書き込まれたLBAの下位8ビットが、一連のデータの先頭データに対応する論理セクタ領域のLSNに対応する。更に、このLSNの上位6ビットの値が、一連のデータの先頭データに対応する論理セクタ領域が属する論理ページのLPNであるSLPNの値に対応する。つまり、一連のデータの先頭データに対応する論理セクタ領域が属する論理ページのLPNがSLPNに対応する。 Next, how to obtain the start pointer (SP), the start logical sector number (SLSN), and the page count (PCNT) will be described. In the NAND flash memory used in the present embodiment, the lower 8 bits of the LBA written in the LBA register R3 correspond to the LSN of the logical sector area corresponding to the head data of a series of data. Further, the value of the upper 6 bits of this LSN corresponds to the value of SLPN which is the LPN of the logical page to which the logical sector area corresponding to the head data of the series of data belongs. That is, the LPN of the logical page to which the logical sector area corresponding to the head data of a series of data corresponds to SLPN.
また、一連のデータの末尾データに対応する論理セクタ領域のLSNは、LBAの下位8ビットに対応するLSNにセクタ数レジスタR2に書き込まれたセクタ数の値を足し、1を引いた値に対応する。この値が255以下であれば、一連のデータは1個の物理ブロックに属している。更に、この8ビットの値の上位6ビットの値が一連のデータの末尾データに対応する論理セクタ領域が属する論理ページのLPNであるエンド論理ページ番号(ELPN)に対応する。つまり、一連のデータの末尾データに対応する論理セクタ領域が属する論理ページのLPNがELPNに対応する。このELPNからSLPNを引き、1を足すことによってPCNTが求められる。 The LSN of the logical sector area corresponding to the end data of a series of data corresponds to a value obtained by adding the value of the number of sectors written in the sector number register R2 to the LSN corresponding to the lower 8 bits of the LBA and subtracting one. To do. If this value is 255 or less, a series of data belongs to one physical block. Further, the upper 6 bits of the 8-bit value correspond to the end logical page number (ELPN) which is the LPN of the logical page to which the logical sector area corresponding to the end data of the series of data belongs. That is, the LPN of the logical page to which the logical sector area corresponding to the end data of a series of data corresponds to ELPN. By subtracting SLPN from this ELPN and adding one, PCNT is obtained.
尚、LSNにセクタ数レジスタR2に書き込まれたセクタ数の値を足し、1を引いた値が256以上の場合、論理アクセス領域が複数個の論理ブロックに跨っているため、この論理アクセス領域は複数の一連のデータに対応し、最初の一連のデータのエンド論理ページ番号(ELPN)は、論理ブロック内の末尾の論理ページのLPNである#63に対応する。 If the value of the number of sectors written in the sector number register R2 is added to the LSN and the value obtained by subtracting 1 is 256 or more, the logical access area spans a plurality of logical blocks. The end logical page number (ELPN) of the first series of data corresponds to # 63 which is the LPN of the last logical page in the logical block.
SPは、一連のデータの先頭データに対応する論理セクタ領域が属する論理ページに対応するデータが保存される物理ページのPPNの値に、この一連のデータに関するPCNTの値を足した値に対応する。あるいは、既に保存されている一連のデータに関するPCNTの値の総和をSPとしてもよい。 The SP corresponds to a value obtained by adding the PPN value of the physical page in which the data corresponding to the logical page to which the logical sector area corresponding to the first data of the series of data belongs is added to the PCNT value related to the series of data. . Or it is good also considering SP as the sum total of the value of PCNT regarding a series of data already preserve | saved.
第2の実施の形態においても、共通冗長領域50には、SP、SLPN及びPCNTが保存されているが、SP及びSLPNのみを書き込むようにしてもよい。この場合には、連続する2つの一連のデータに関するSPの差からPCNTを適宜求めればよい。あるいは、SLPN及びPCNTだけを共通冗長領域50に書き込み、既に保存されている一連のデータに関するPCNTを累積的に加算していくことによりSPを適宜求めるようにしてもよい。
Also in the second embodiment, SP, SLPN, and PCNT are stored in the common
論理アクセス領域が属する論理ブロックのLBNは、LBAレジスタR3に書き込まれたLBAからLSNを示すビット(本実施の形態では下位8ビット)を除いた上位側のビットの値に対応する。尚、論理アクセス領域が2個の論理ブロックに跨っている場合は、LBAからLSNを示すビットを除いた上位側のビットによって与えられる値に、1を足して得られた値が、2個目の論理ブロックのLBNに対応する。 The LBN of the logical block to which the logical access area belongs corresponds to the value of the upper bit excluding the bit indicating the LSN (the lower 8 bits in this embodiment) from the LBA written in the LBA register R3. When the logical access area extends over two logical blocks, the value obtained by adding 1 to the value given by the higher-order bits excluding the bit indicating LSN from LBA is the second value. Corresponds to the LBN of the logical block.
LBAレジスタR3に書き込まれたLBAに基づいて求められたLBNに対応するPBAは、アドレス変換テーブルを用いて求められる。一連のデータの書き込みは、求めたPBAに対応する物理ブロック内のデータが書き込まれていない先頭の物理ページから開始される。 The PBA corresponding to the LBN obtained based on the LBA written in the LBA register R3 is obtained using the address conversion table. A series of data writing is started from the first physical page in which data in the physical block corresponding to the obtained PBA is not written.
尚、以下の2つのいずれかに該当する場合には、空きブロック検索が行われ、空きブロック検索で求められた物理ブロックに一連のデータが書き込まれる。
(1)求めたLBNの論理ブロックに対応する物理ブロックがない場合。
(2)求めたLBNの論理ブロックに対応する物理ブロックは存在するが、当該論理ブロック内にデータを書き込むために十分な空き領域(データが書き込まれていない物理ページ)が無い場合。
If either of the following two cases is satisfied, a free block search is performed, and a series of data is written in the physical block obtained by the free block search.
(1) When there is no physical block corresponding to the obtained logical block of LBN.
(2) A physical block corresponding to the obtained logical block of LBN exists, but there is not enough free space (physical page in which no data is written) to write data in the logical block.
一連のデータは、物理ブロック内の先頭側の物理ページから末尾側の物理ページに向かって順次書き込まれていく。即ち、メモリコントローラ3は、PPNの値の小さい物理ページから順に一連のデータを書き込んでいく。
A series of data is sequentially written from the first physical page to the last physical page in the physical block. That is, the
また、一連のデータが書き込まれた物理ページの共通冗長領域50には、その一連のデータに関するSP、SLPN及びPCNTの値が書き込まれる。
In addition, SP, SLPN, and PCNT values relating to the series of data are written in the common
図8に示した例では、PBA#24の物理ブロックに4つの一連のデータが保存されている。この4つの一連のデータの書き込み処理について具体的に説明をする。尚、図8に示した例で、D#nは、LSN#nの論理セクタ領域と対応するデータを示している。例えば、D#4は、LSN#4の論理セクタ領域と対応するデータを示している。
(最初の一連のデータの書き込み処理)
In the example shown in FIG. 8, four series of data are stored in the physical block of
(First data write process)
まず、ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に4が、セクタ数レジスタR2に24が書き込まれる。メモリコントローラ3は、LBAレジスタR3に書き込まれたLBA#4とセクタ数レジスタR2に書き込まれた値24とから、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#4−#27であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、複数の論理ブロックに跨っていないと判断する。即ち、一連のデータは単一の物理ブロックに保存されると判断する。
First, the
LBN#0の論理ブロックは、LZN#0の論理ゾーンに属し、LZN#0の論理ゾーンはPZN#0の物理ゾーンに割り当てられている。メモリコントローラ3は、LBN#0の論理ブロックに対応する物理ブロックが無いため、PZN#0の物理ゾーンから空ブロックを検索し、例えば、空きブロックとしてPBA#24の物理ブロックを検出する。尚、LBN#0の論理ブロックに対応するデータが保存されている物理ブロックが既にあり、この物理ブロックに、この一連のデータを書き込むことができる場合には、空きブロック検索は行なわず、この物理ブロックのデータが書き込まれていない物理ページに、この一連のデータが書き込まれる。
The logical block of
次に、この一連のデータが書き込まれる物理ページの共通冗長領域50に書き込まれるSP、SLPN及びPCNTについて説明する。LBAレジスタR3に書き込まれたLBAの下位8ビットの値と、このLBAの下位8ビットにセクタ数レジスタR2に書き込まれた値を足し、1を引いた値とから、この一連のデータがLSN#4−#27の論理セクタ領域に対応することが分かる。ここで、この8ビットのLSNの上位6ビットがLPNに対応するので、LSN#4の論理セクタ領域が属する論理ページのLPNが#1であり、LSN#27の論理セクタ領域が属する論理ページのLPNが#6であることが分かる。従って、この一連のデータに関するSLPNに対応する値として#1が求められ、PCNTに対応する値として6が求められる。この一連のデータの書き込みを開始する物理ページのPPNである#0とPCNTの値6からSPに対応する値として#6が求められる。
メモリコントローラ3は、PBA#24の物理ブロックのPPN#0の物理ページから一連のデータの書き込みを開始し、LBA#4−#27の論理アクセス領域に書き込むことが指示された一連のデータは、PPN#0−#5の物理ページに書き込まれる。この際、PPN#0−#5の物理ページに対応する全ての共通冗長領域50には、SP#6、SLSN#1、SCNT6が書き込まれる。
(2番目の一連のデータの書き込み処理)
Next, SP, SLPN, and PCNT written to the common
The
(Second series of data write processing)
まず、ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に0が、セクタ数レジスタR2に12が書き込まれる。メモリコントローラ3は、LBAレジスタR3に書き込まれたLBA#0とセクタ数レジスタR2に書き込まれた値12とから、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#0−#11であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、複数の論理ブロックに跨っていないと判断する。即ち、一連のデータは単一の物理ブロックに保存されると判断する。
First, the
また、メモリコントローラ3は、論理ブロックと物理ブロックの対応関係を記述したアドレス変換テーブルに基づいて、LBN#0の論理ブロックがPBA#24の物理ブロックに対応していることを判別する。続いて、PBA#24の物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索が行われる。空きページ検索の終了後、物理ブロック内のデータが書き込まれていない物理ページの先頭であるPPN#6の物理ページから、この一連のデータの書き込みが開始される。
Further, the
次に、この一連のデータが書き込まれる物理ページに対応する共通冗長領域50に書き込まれるSP、SLPN及びPCNTについて説明する。LBAレジスタR3に書き込まれたLBAの下位8ビットの値と、このLBAの下位8ビットにセクタ数レジスタR2に書き込まれた値を足し、1を引いた値とから、この一連のデータがLSN#0−#11の論理セクタ領域に対応することが分かる。ここで、この8ビットのLSNの上位6ビットがLPNに対応するので、LSN#0の論理セクタ領域が属する論理ページのLPNが#0であり、LSN#11の論理セクタ領域が属する論理ページのLPNが#2であることが分かる。従って、この一連のデータに関するSLPNに対応する値として#0が求められ、PCNTに対応する値として3が求められる。この一連のデータの書き込みを開始する物理ページのPPNである#6とPCNTの値3からSPに対応する値として#9が求められる。
Next, SP, SLPN, and PCNT written in the common
従って、LBA#0−#11の論理アクセス領域に書き込むことが指示された一連のデータは、PPN#6−#8の物理ページに書き込まれる。この際、PPN#6−#8の物理ページに対応する全ての共通冗長領域50には、SP#9、SLSN#0、SCNT3が書き込まれる。
(3番目の一連のデータの書き込み処理)
Therefore, a series of data instructed to be written to the logical access areas of
(3rd data write process)
まず、ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に14が、セクタ数レジスタR2に14が書き込まれる。メモリコントローラ3は、LBAレジスタR3に書き込まれたLBA#14とセクタ数レジスタR2に書き込まれた値14とから、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#14−#27であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、複数の論理ブロックに跨っていないと判断する。即ち、一連のデータは単一の物理ブロックに保存されると判断する。
First, the
また、メモリコントローラ3は、論理ブロックと物理ブロックの対応関係を記述したアドレス変換テーブルに基づいて、LBN#0の論理ブロックがPBA#24の物理ブロックに対応していることを判別する。続いて、PBA#24の物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索が行われる。空きページ検索の終了後、物理ブロック内のデータが書き込まれていない物理ページの先頭であるPPN#9の物理ページから、この一連のデータの書き込みが開始される。
Further, the
次に、この一連のデータが書き込まれる物理ページに対応する共通冗長領域50に書き込まれるSP、SLPN及びPCNTについて説明する。LBAレジスタR3に書き込まれたLBAの下位8ビットの値と、このLBAの下位8ビットにセクタ数レジスタR2に書き込まれた値を足し、1を引いた値とから、この一連のデータがLSN#14−#27の論理セクタ領域に対応することが分かる。ここで、この8ビットのLSNの上位6ビットがLPNに対応するので、LSN#14の論理セクタ領域が属する論理ページのLPNが#3であり、LSN#27の論理セクタ領域が属する論理ページのLPNが#6であることが分かる。従って、この一連のデータに関するSLPNに対応する値として#3が求められ、PCNTに対応する値として4が求められる。この一連のデータの書き込みを開始する物理ページのPPNである#9とPCNTの値4からSPに対応する値として#13が求められる。
Next, SP, SLPN, and PCNT written in the common
従って、LBA#14−#27の論理アクセス領域に書き込むことが指示された一連のデータは、PPN#9−#12の物理ページに書き込まれる。この際、PPN#9−#12の物理ページに対応する全ての共通冗長領域50には、SP#13、SLSN#3、SCNT4が書き込まれる。
Therefore, a series of data instructed to be written to the logical access areas of
尚、この一連のデータの先頭データに対応する論理セクタ領域のLSNは#14なので、LSN#14の論理セクタ領域が属するLPN#3の論理ページのLSN#12−#13の論理セクタ領域と対応するデータは、この一連のデータに含まれていない。このような場合は、この一連のデータより前に書き込まれた一連のデータに含まれているLSN#12−#13の論理セクタ領域と対応するデータが、PPN#9の物理ページの第1の物理セクタ領域60aと第2の物理セクタ領域60bに複写される。図8に示した例では、LPN#3の論理ページ対応するデータがPPN#2の物理ページに書き込まれているので、PPN#2の物理ページの第1の物理セクタ領域60aと第2の物理セクタ領域60bに書き込まれているデータが、PPN#9の物理ページの第1の物理セクタ領域60aと第2の物理セクタ領域60bにそれぞれ複写される。
また、このように一連のデータの先頭データ又は末尾データが書き込まれる物理ページに、この一連のデータより前に書き込まれた一連のデータに含まれているデータを複写する場合、複写するデータが書き込まれている物理ページのPPNは、後述するページ情報テーブルを参照することにより求められる。
(4番目の一連のデータの書き込み処理)
Since the LSN of the logical sector area corresponding to the head data of this series of data is # 14, it corresponds to the logical sector area of LSN # 12- # 13 of the logical page of
In addition, when data included in a series of data written before this series of data is copied to a physical page in which the beginning data or end data of the series of data is written, the data to be copied is written. The PPN of the physical page being obtained is obtained by referring to a page information table described later.
(4th data write process)
まず、ホストシステム4により、コマンドレジスタR1に書き込みコマンドのコマンドコードが、LBAレジスタR3に0が、セクタ数レジスタR2に14が書き込まれる。メモリコントローラ3は、LBAレジスタR3に書き込まれたLBA#0とセクタ数レジスタR2に書き込まれた値14とから、この一連のデータの書き込み先として指示された論理アクセス領域のLBAが#0−#13であり、この論理アクセス領域がLBN#0の論理ブロックに含まれ、複数の論理ブロックに跨っていないと判断する。即ち、一連のデータは単一の物理ブロックに保存されると判断する。
First, the
また、メモリコントローラ3は、論理ブロックと物理ブロックの対応関係を記述したアドレス変換テーブルに基づいて、LBN#0の論理ブロックがPBA#24の物理ブロックに対応していることを判別する。続いて、PBA#24の物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索が行われる。空きページ検索の終了後、物理ブロック内のデータが書き込まれていない物理ページの先頭であるPPN#13の物理ページから、この一連のデータの書き込みが開始される。
Further, the
次に、この一連のデータが書き込まれる物理ページに対応する共通冗長領域50に書き込まれるSP、SLPN及びSCNTについて説明する。LBAレジスタR3に書き込まれたLBAの下位8ビットの値と、このLBAの下位8ビットにセクタ数レジスタR2に書き込まれた値を足し、1を引いた値とから、この一連のデータがLSN#0−#13の論理セクタ領域に対応することが分かる。ここで、この8ビットのLSNの上位6ビットがLPNに対応するので、LSN#0の論理セクタ領域が属する論理ページのLPNが#0であり、LSN#13の論理セクタ領域が属する論理ページのLPNが#3であることが分かる。従って、この一連のデータに関するSLPNに対応する値として#0が求められ、PCNTに対応する値として4が求められる。この一連のデータの書き込みを開始する物理ページのPPNである#13とPCNTの値4からSPに対応する値として#17が求められる。
Next, SP, SLPN, and SCNT written in the common
従って、LBA#0−#13の論理アクセス領域に書き込むことが指示された一連のデータは、PPN#13−#16の物理ページに書き込まれる。この際、PPN#13−#16の物理ページに対応する全ての共通冗長領域50には、SP#17、SLSN#0、SCNT4が書き込まれる。
Therefore, a series of data instructed to be written to the logical access areas of
尚、この一連のデータの末尾データに対応する論理セクタ領域のLSNは#13なので、LSN#13の論理セクタ領域が属するLPN#3の論理ページのLSN#14−#15の論理セクタ領域と対応するデータは、この一連のデータに含まれていない。このような場合は、この一連のデータより前に書き込まれた一連のデータに含まれているLSN#14−#15の論理セクタ領域と対応するデータが、PPN#16の物理ページの第3の物理セクタ領域60cと第4の物理セクタ領域60dに複写される。図8に示した例では、LPN#3の論理ページに対応する新しい方のデータがPPN#9の物理ページに書き込まれているので、PPN#9の物理ページの第3の物理セクタ領域60cと第4の物理セクタ領域60dに書き込まれているデータが、PPN#16の物理ページの第3の物理セクタ領域60cと第4の物理セクタ領域60dにそれぞれ複写される。
Since the LSN of the logical sector area corresponding to the end data of this series of data is # 13, it corresponds to the logical sector area of LSN # 14- # 15 of the logical page of
また、LPN#3の論理ページ対応するデータは、PPN#2の物理ページとPPN#9の物理ページに書き込まれているが、後述するページ情報テーブルを参照して、LPN#3の論理ページに対応するデータが書き込まれる物理ページのPPNを求めれば、LPN#3の論理ページに対応する新しい方のデータが書き込まれている物理ページのPPNが求められる。
The data corresponding to the logical page of
次に、物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索について説明する。この空きページ検索は、共通冗長領域50に書き込まれているSP又はPCNTに基づいて行うことができる。また、第2の実施の形態では、書き込みの際にも後述するページ情報テーブルを作成しなければならない場合(例えば、既に書き込まれているデータを複写する場合)があるため、この空きページ検索と後述するページ情報テーブルの作成処理を並行して行うことが好ましい。
Next, a free page search for searching for the top of a physical page in which data in a physical block is not written will be described. This empty page search can be performed based on SP or PCNT written in the common
例えば、物理ブロック内の先頭の物理ページ(PPN#0の物理ページ)の共通冗長領域50に書き込まれているSPに基づいて、2番目の一連のデータの書き込みが開始される物理ページ(最初の一連のデータの末尾データが書き込まれているページの次の物理ページ)が分かる。2番目の一連のデータが書き込まれていない場合は、この2番目の一連のデータの書き込みが開始される物理ページの共通冗長領域50にSPが書き込まれていないが、2番目の一連のデータが書き込まれている場合は、この2番目の一連のデータの書き込みが開始される物理ページの共通冗長領域50にSPが書き込まれている。
For example, based on the SP written in the common
更に、この2番目の一連のデータの書き込みが開始される物理ページの共通冗長領域50に書き込まれているSPに基づいて、3番目の一連のデータの書き込みが開始される物理ページが分かる。このようにして、次の一連のデータの書き込み開始される物理ページの共通冗長領域50に書き込まれているSPを順次読み出していき、SPが書き込まれていないときは、その物理ページがデータが書き込まれていない物理ページの先頭であると判断する。
<ページ情報テーブルの作成処理>
Further, based on the SP written in the common
<Page information table creation process>
各物理ブロックにアクセスするときには、物理ブロックに含まれる物理ページとこの物理ブロックと対応する論理ブロックに含まれる論理ページとの対応関係を示すページ情報テーブルが作成される。例えば、コマンドレジスタR1に読み出しコマンドのコマンドコードが書き込まれたとき、メモリコントローラ3は、LBAレジスタR3及びセクタ数レジスタR2に書き込まれた情報に基づいて論理アクセス領域を判別する。つまり、アクセス対象の論理ブロック及び論理ページを判別する。更に、メモリコントローラ3は、アクセス対象の論理ブロックに対応する物理ブロックをアドレス変換テーブルに基づいて判別し、更に、アクセス対象の論理ページに対応する物理ページをページ情報テーブルに基づいて判別する。
When accessing each physical block, a page information table indicating the correspondence between the physical page included in the physical block and the logical page included in the logical block corresponding to the physical block is created. For example, when the command code of the read command is written in the command register R1, the
次に、このページ情報テーブルの作成処理について説明する。ページ情報テーブルの作成処理では、メモリコントローラ3は、一連のデータの先頭データが記憶されている物理ページの共通冗長領域50からSLPN及びPCNTを読み出し、一連のデータ単位で論理ページと物理ページとの対応関係を判別し、判別された論理ページと物理ページとの対応関係をページ情報テーブル上に書き込んでいく。
Next, the page information table creation process will be described. In the process of creating the page information table, the
このページ情報テーブルの作成処理では、SLPN及びPCNTと共にSPも読み出され、読み出されたSPに基づいて、次の一連のデータの先頭データが保存されている物理ページが判別される。尚、SPを用いずにPCNTの値に基づいて、次の一連のデータの先頭データが記憶されている物理ページを判別するようにしてもよい。 In this page information table creation process, the SP is read together with SLPN and PCNT, and the physical page in which the first data of the next series of data is stored is determined based on the read SP. Note that the physical page in which the first data of the next series of data is stored may be determined based on the value of PCNT without using SP.
また、一連のデータが末尾データまで正常に書き込まれているかどうかを確認するため、一連のデータの先頭データが記憶されている物理ページの共通冗長領域50に記憶されているSP、SLPN及びPCNTと、末尾データが記憶されている物理ページの共通冗長領域50に記憶されているSP、SLPN及びPCNTとが一致するかどうかが確認される。一連のデータが末尾データまで正常に書き込まれていない場合、例えば、末尾データを書き込む前に電源遮断が起こった場合、末尾データが書き込まれているべき物理ページの共通冗長領域50には、SP、SLPN及びPCNTが書き込まれていないので、双方の共通冗長領域50から読み出されたSP、SLPN及びPCNTは一致しない。このような場合、その一連のデータは正常に書き込まれていないと判断される。従って、一連のデータの先頭データが記憶されている物理ページの共通冗長領域50に記憶されているSP、SLPN及びPCNTと、末尾データが記憶されている物理ページの共通冗長領域50に記憶されているSP、SLPN及びPCNTとが一致しなかった場合、その一連のデータに対応する論理ページと物理ページとの対応関係をページ情報テーブルに反映させずに、ページ情報テーブルの作成処理を終了する。
Further, in order to confirm whether a series of data is normally written up to the end data, SP, SLPN, and PCNT stored in the common
次に、図8のように、PBA#24の物理ブロックに4つの一連のデータが保存されている場合に関して、ページ情報テーブルを作成する例を図9を参照して説明する。尚、このページ情報テーブルを作成するときは、ワークエリア8にLPN#0−#63に対応するPPNを書き込む領域(以下、ページ情報テーブル作成領域と言う。)が確保される。
Next, with reference to FIG. 9, an example of creating a page information table will be described with respect to the case where four series of data is stored in the physical block of
まず、PBA#24の物理ブロックのPPN#0の物理ページの共通冗長領域50からSP、SLPN及びPCNTが読み出される。PPN#0の物理ページの共通冗長領域50から読み出されたSPから、最初の一連のデータの末尾データの保存先が判断される。続いて、最初の一連のデータが末尾データまで正常に保存されているかどうかを確認するため、末尾データの保存先であるPPN#5の物理ページの共通冗長領域50からSP、SLPN及びPCNTが読み出される。
First, SP, SLPN, and PCNT are read from the common
PPN#0の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTの値と、PPN#5の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTの値が等しいかどうかが判断される。両者の値が等しいとき、最初の一連のデータの書き込みが正常に終了していると判断され、最初の一連のデータに関する情報がページ情報テーブルに反映される。
この反映処理では、SLPN及びPCNTの値(SLPN#1、PCNT6)からLPN#1−#6の論理ページが、PPN#0−#5の物理ページに対応していると判断され、図9の(A)に示すように、ページ情報テーブル作成領域のLPN#1−#6に対応する領域にPPNの値である#0−#5が書き込まれる。つまり、LPN#1に対応する領域にPPNの値として#0が書き込まれ、LPN#2に対応する領域にPPNの値として#1が書き込まれ、LPN#3に対応する領域にPPNの値として#2が書き込まれ、以下同様にPPNが書き込まれていき、LPN#6に対応する領域にPPNの値として#5が書き込まれる。尚、2番目の一連のデータの先頭データの保存先については、SPの値からPPN#6の物理ページであると判断される。
The values of SP, SLPN, and PCNT read from the common
In this reflection process, it is determined from the SLPN and PCNT values (
次に、2番目の一連のデータの先頭データの保存先であるPPN#6の物理ページの共通冗長領域50から、SP、SLPN及びPCNTが読み出される。また、読み出されたSPの値が#9であるため、2番目の一連のデータの末尾データの保存先は、PPN#8の物理ページであると判断され、PPN#8の物理ページの共通冗長領域50に書き込まれているSP、SLPN及びPCNTの値が読み出される。PPN#6の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTと、PPN#8の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTの値が等しいとき、2番目の一連のデータの書き込みが正常に終了していると判断され、2番目の一連のデータに関する情報がページ情報テーブルに反映される。
Next, SP, SLPN, and PCNT are read from the common
この反映処理では、SLPN及びPCNTの値(SLPN#0、SCNT3)からLPN#0−#2の論理ページが、PPN#6−#8の物理ページに対応していると判断され、図9の(B)に示すように、セクタ情報テーブル作成領域のLPN#0−#2に対応する領域にPPNの値である#6−#8が書き込まれる。つまり、LPN#0に対応する領域にPPNの値として#6が書き込まれ、LPN#1に対応する領域にPPNの値として#7が書き込まれ、LPN#2に対応する領域にPPNの値として#8が書き込まれる。尚、3番目の一連のデータの先頭データの保存先については、SPの値からPPN#9の物理ページであると判断される。
In this reflection process, it is determined from the SLPN and PCNT values (
次に、3番目の一連のデータの先頭データの保存先であるPPN#9の物理ページの共通冗長領域50から、SP、SLPN及びPCNTが読み出される。また、読み出されたSPの値が#13であるため、3番目の一連のデータの末尾データの保存先は、PPN#12の物理ページであると判断され、PPN#12の物理ページの共通冗長領域50に書き込まれているSP、SLPN及びPCNTの値が読み出される。PPN#9の物理ページの共通冗長領域50から読み出されたSP、SLSN及びSCNTと、PPN#12の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTの値が等しいとき、3番目の一連のデータの書き込みが正常に終了していると判断され、3番目の一連のデータに関する情報がページ情報テーブルに反映される。
Next, SP, SLPN, and PCNT are read from the common
この反映処理では、SLPN及びPCNTの値(SLPN#3、PCNT4)からLPN#3−#6の論理ページが、PPN#9−#12の物理ページに対応していると判断され、図9の(C)に示すように、ページ情報テーブル作成領域のLPN#3−#6に対応する領域にPPNの値である#9−#12が書き込まれる。この際、ページ情報テーブル作成領域のLPN#3−#6に対応する領域に書き込まれていた#2−#5が、#9−#12に書き替えられる。このように、ページ情報テーブルの作成処理では、後から書き込まれた一連のデータに関する情報が優先される。尚、4番目の一連のデータの先頭データの保存先については、SPの値からPSN#13の物理ページであると判断される。
In this reflection processing, it is determined from the values of SLPN and PCNT (
次に、4番目の一連のデータの先頭データの保存先であるPPN#13の物理ページの共通冗長領域50から、SP、SLPN及びPCNTが読み出される。また、読み出されたSPの値が#17であるため、4番目の一連のデータの末尾データの保存先は、PPN#16の物理ページであると判断され、PSN#16の物理ページの共通冗長領域50に書き込まれているSP、SLPN及びPCNTの値が読み出される。PPN#13の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTと、PSN#16の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTの値が等しいとき、4番目の一連のデータの書き込みが正常に終了していると判断され、4番目の一連のデータに関する情報がページ情報テーブルに反映される。
Next, SP, SLPN, and PCNT are read from the common
この反映処理では、SLPN及びPCNTの値(SLSN#0、SCNT4)からLPN#0−#3の論理ページが、PSN#13−#16の物理ページに対応していると判断され、図9の(D)に示すように、ページ情報テーブル作成領域のLPN#0−#3に対応する領域にPPNの値である#13−#16が書き込まれる。この際、セクタ情報テーブル作成領域のLSN#0−#3に対応する領域に書き込まれていた#6−#9が、#13−#16に書き替えられる。尚、5番目の一連のデータの先頭データの保存先については、SPの値からPPN#17の物理ページであると判断される。
In this reflection process, it is determined from the SLPN and PCNT values (
次に、5番目の一連のデータの先頭データの保存先であるPSN#17の物理ページの共通冗長領域50からのSP、SLPN及びPCNTの読み出しが行われるが、SP、SLPN及びPCNTが書き込まれていないためページ情報テーブルの作成処理を終了する。
<異常終了に関する処理>
Next, the SP, SLPN, and PCNT are read from the common
<Processing related to abnormal termination>
図10は、図8に示した4つの一連のデータの書き込みにおいて、4番目の一連のデータの書き込みが正常に終了しなかった場合を示している。4番目の一連のデータの書き込みは、PPN#13−#14の物理ページにデータが書き込まれた状態で終了し、PPN#15−#16の物理ページには、データが保存されていない。以下では、このような異常終了が発生した物理ブロックにおけるページ情報テーブルの作成処理を説明する。 FIG. 10 shows a case where the writing of the fourth series of data does not end normally in the writing of the four series of data shown in FIG. The writing of the fourth series of data ends in a state where the data is written in the physical pages of PPN # 13- # 14, and no data is stored in the physical pages of PPN # 15- # 16. In the following, a process for creating a page information table in a physical block in which such abnormal termination has occurred will be described.
最初の一連のデータ、2番目の一連のデータ及び3番目の一連のデータの書き込みは正常に終了しているので、これらの一連のデータに関する情報はセクタ情報テーブルに反映される。しかし、4番目の一連のデータに関する反映処理では、PPN#13の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTと、PSN#16の物理ページの共通冗長領域50から読み出されたSP、SLPN及びPCNTの値が等しくないため、4番目の一連のデータの書き込みが正常に終了していないと判断され、4番目の一連のデータに関する情報はセクタ情報テーブルに反映されない。従って、最初の一連のデータ、2番目の一連のデータ及び3番目の一連のデータに関する情報が反映されたページ情報テーブル(図9の(C)に示したページ情報テーブル)が、この物理ブロックにおけるページ情報テーブルとして使用される。
Since the writing of the first series of data, the second series of data, and the third series of data has been normally completed, information regarding these series of data is reflected in the sector information table. However, in the reflection process for the fourth series of data, the SP, SLPN, and PCNT read from the common
このような一部の一連のデータが正常に書き込まれていない物理ブロックが見つかったときには、その物理ブロックに保存されている有効なデータが、別の物理ブロックに転送される。つまり、正常に書き込まれている一連のデータのうち、後の一連のデータで書き替えられていないデータが、別の物理ブロックに転送される。 When a physical block in which such a partial series of data is not normally written is found, valid data stored in the physical block is transferred to another physical block. In other words, data that has not been rewritten by a subsequent series of data among a series of data that has been normally written is transferred to another physical block.
次に、この転送処理について説明する。この転送処理は、正常に書き込まれている一連のデータに関する情報が反映されたページ情報テーブルに基づいて行われる。つまり、ページ情報テーブル作成領域に書き込まれているPPNに対応する物理ページに保存されているデータが、別の物理ブロックに転送される。図10に示したように、4番目の一連のデータの書き込みが正常に終了しなかった場合、図9の(C)に示した最初の一連のデータ、2番目の一連のデータ及び3番目の一連のデータに関する情報が反映されたページ情報テーブルに基づいて転送処理が行われる。 Next, this transfer process will be described. This transfer process is performed based on a page information table in which information about a series of data written normally is reflected. That is, data stored in the physical page corresponding to the PPN written in the page information table creation area is transferred to another physical block. As shown in FIG. 10, when the writing of the fourth series of data is not normally completed, the first series of data, the second series of data, and the third series shown in FIG. Transfer processing is performed based on a page information table reflecting information related to a series of data.
図9の(C)に示したページ情報テーブルに基づいた転送処理について説明する。尚、この転送処理では、転送先の物理ブロック(空きブロック)の検索がされる。ここでは、PZN#1の物理ゾーン内の空きブロックが検索され、空ブロックとしてPBA#10の物理ブロックが検出されたとする。このPBA#10の物理ブロックに、PBA#24の物理ブロックに保存されているデータを転送するときには、図9の(C)のページ情報テーブルに基づいて、LPNの値の小さい方から順番にデータの転送が行われる。つまり、ページ情報テーブル作成領域に書き込まれているPPNに対応する物理ページに保存されているデータは、そのPPNに対応するLPNの値が小さい方から順番に転送される。
A transfer process based on the page information table shown in FIG. 9C will be described. In this transfer process, a search is made for a transfer destination physical block (empty block). Here, it is assumed that an empty block in the physical zone of
図9の(C)のページ情報テーブルの場合、LPN#0−#6に対応するPPNだけがページ情報テーブル作成領域に書き込まれている。従って、PBA#24の物理ブロックに保存されているデータのうち、ページ情報テーブル作成領域のLSN#0−#6に対応する領域に書き込まれているPPNに対応する物理ページに記憶されているデータだけが、PBA#10の物理ブロックに転送される。
In the case of the page information table of FIG. 9C, only the PPN corresponding to LPN # 0- # 6 is written in the page information table creation area. Therefore, among the data stored in the physical block of
次に、図9の(C)に示すページ情報テーブルを参照した転送処理を、図11を参照して説明する。図11に示した例で、D#nは、LPN#nと対応するデータを示している。まず、図9の(C)のページ情報テーブルでは、LPN#0にPPN#6が対応しているので、PBA#24の物理ブロックのPPN#6の物理ページに記憶されているデータが、PBA#10の物理ブロックのPPN#0の物理ページに転送される。次に、LPN#1にPPN#7が対応しているので、PBA#24の物理ブロックのPPN#7の物理ページに記憶されているデータが、PBA#10のPPN#1の物理ページに転送される。同様の処理がLPNの順番で行われていき、PBA#24の物理ブロックのPPN#12の物理ページに記憶されているデータが、PBA#10の物理ブロックのPPN#6の物理ページに転送されて、この転送処理が終了する。
Next, transfer processing with reference to the page information table shown in FIG. 9C will be described with reference to FIG. In the example illustrated in FIG. 11, D # n indicates data corresponding to LPN # n. First, in the page information table of FIG. 9C, since
次に、この転送処理の際に、共通冗長領域50に書き込まれるSP、SLPN及びPCNTについて説明する。この転送処理では、PBA#24の物理ブロックからPBA#10の物理ブロックに転送される全てのデータのLPNが連続しているため、全てのデータが「一連のデータ」としてPBA#10の物理ブロックに書き込まれたと見なしたSP、SLPN及びPCNTが設定される。つまり、この転送処理が終了したときに、PBA#10の物理ブロックブロック内のデータが書き込まれていない物理ページの先頭に対応するPPNである#7が、SPの値になる。この一連のデータの先頭データに対応するLPNである#0が、SLPNの値になる。この一連のデータに含まれるデータのページ数である7が、PCNTの値になる。
Next, SP, SLPN, and PCNT written in the common
このように、異常終了した物理ブロックのデータを転送する際には、LPNが連続する論理ページに対応するデータを一連のデータと見なして、転送処理が行われる。従って、SP、SLPN及びPCNTは、LPNが連続する論理セクタ領域に対応するデータを一連のデータと見なして設定される。つまり、LPNが連続する論理ページの先頭の論理ページのLPNがSLPNになり、LPNが連続する論理ページの数がPCNTになる。SPの値は、LPNが連続する論理ページの先頭の論理ページに対応するデータを書き込む物理ページのPPNの値にPCNTの値を足した値になる。 In this way, when transferring data of a physical block that has ended abnormally, transfer processing is performed by regarding data corresponding to logical pages with continuous LPNs as a series of data. Therefore, SP, SLPN, and PCNT are set by regarding data corresponding to logical sector areas in which LPNs are continuous as a series of data. That is, the LPN of the first logical page of the logical pages with continuous LPN becomes SLPN, and the number of logical pages with continuous LPN becomes PCNT. The value of SP is a value obtained by adding the value of PCNT to the value of PPN of the physical page to which data corresponding to the first logical page of the logical pages with continuous LPNs is written.
上記第2の実施の形態のフラッシュメモリシステム1によれば、一連のデータの保存先の物理ページに対応する共通冗長領域50に、この一連のデータに関するSP、SLPN及びPCNTを書き込んでいる。また、この一連のデータに関する論理ページと物理ページとの対応関係は、この一連のデータに関するSLPN及びPCNTに基づいて把握することができる。従って、一連のデータの先頭データが保存されている物理ページの共通冗長領域50に書き込まれているSLPN及びPCNTを読み出し、読み出したSLPN及びPCNTに基づいて把握された論理ページと物理ページとの対応関係をページ情報テーブルに反映させていくことにより、ページ情報テーブルを完成させることができる。
According to the
尚、各一連のデータに関する論理ページと物理ページとの対応関係は、後から書き込まれた一連のデータに関する方が優先されるため、各一連のデータに関する論理ページと物理ページとの対応関係は、一連のデータが書き込まれた順番でページ情報テーブルに反映される。 The correspondence between the logical page and the physical page related to each series of data is given priority over the series of data written later, so the correspondence between the logical page and the physical page related to each series of data is It is reflected in the page information table in the order in which a series of data is written.
又、各一連のデータの先頭データが保存されている物理ページのPPNは、1つ前の一連のデータに関するSPに基づいて把握することができる。SPを共通冗長領域50に書き込まない場合には、PCNTに基づいて各一連のデータの先頭データが保存されている物理ページのPPNを把握することもできる。
Further, the PPN of the physical page in which the head data of each series of data is stored can be grasped based on the SP related to the previous series of data. When the SP is not written in the common
又、一連のデータの先頭データが保存されている物理ページの共通冗長領域50に書き込まれているSP、SLPN及びPCNTと、その一連のデータの末尾データが保存されている物理ページに対応する共通冗長領域50に書き込まれているSP、SLPN及びPCNTが一致しているか否かにより、その一連のデータが正常に書き込まれているか否かを判別することができる。従って、正常に書き込まれた一連のデータに関する論理ページと物理ページとの対応関係だけが、ページ情報テーブルに反映される。
Further, the SP, SLPN, and PCNT written in the common
尚、本発明のフラッシュメモリシステムは、上記した実施の形態に限定されるものではなく、本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。 It should be noted that the flash memory system of the present invention is not limited to the above-described embodiment, and it is needless to say that various modifications can be made without departing from the gist of the present invention.
例えば、上記の実施の形態では、論理ブロックに含まれる論理セクタ領域と物理ブロックとに含まれる物理セクタ領域の数は一致していた。しかしながら、論理ブロックに含まれる論理セクタ領域の数を物理ブロックに含まれる物理セクタ領域の数より少なくしてもよい。こうすることで、論理ブロックに含まれる全ての論理セクタ領域に対応するデータを物理ブロックに保存した後であっても、そのデータの書き替えデータを、当該物理ブロックの空き領域(データが書き込まれていない物理セクタ領域又は物理ページ)にデータを保存することができる。これにより効率的なデータの書き換えが可能となる。例えば、論理ブロックに含まれる論理セクタ領域の数と、物理ブロックに含まれる物理セクタ領域の数を、共に2のべき乗で与えられる数にする場合には、論理ブロックに含まれる論理セクタ領域の数を128とし、物理ブロックに含まれる物理セクタ領域の数を256とする。 For example, in the above embodiment, the number of physical sector areas included in the logical block area and the physical block included in the logical block are the same. However, the number of logical sector areas included in the logical block may be smaller than the number of physical sector areas included in the physical block. In this way, even after data corresponding to all logical sector areas included in the logical block is stored in the physical block, the rewrite data of the data is changed to the empty area (data is written in the physical block). The data can be stored in a physical sector area or physical page that is not present. This makes it possible to efficiently rewrite data. For example, when the number of logical sector areas included in the logical block and the number of physical sector areas included in the physical block are both given by powers of 2, the number of logical sector areas included in the logical block Is 128, and the number of physical sector areas included in the physical block is 256.
1 フラッシュメモリシステム
2 フラッシュメモリ
3 メモリコントローラ
6 マイクロプロセッサ
1
Claims (13)
複数個の論理セクタ領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、該論理ブロックに属する前記論理アクセス領域のセクタ数とを判別する論理アクセス領域判別手段と、
前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない物理セクタ領域の先頭を検索する空きセクタ領域検索手段と、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索手段によって検出されたデータが書き込まれていない先頭の物理セクタ領域から、末尾の物理セクタ領域に向かって順次書き込んでいくデータ書き込み手段と、
前記データ書き込み手段により前記一連のデータが書き込まれた物理セクタ領域に対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報を書き込む論理セクタ情報書き込み手段とを備えたことを特徴とするメモリコントローラ。 A memory controller that controls access to a flash memory that is erased in units of physical blocks including a plurality of physical sector areas, based on an access instruction given from a host system,
A block management means for managing a correspondence relationship between a logical block composed of a plurality of logical sector areas and the physical block;
The logical block to which the logical access area designated as the access target area by the access instruction belongs, the logical sector area corresponding to the head area of the logical access area belonging to the logical block, and the logical access belonging to the logical block Logical access area determining means for determining the number of sectors in the area;
Empty sector area search means for searching for the beginning of a physical sector area in which data in the physical block corresponding to the logical block to which the logical access area belongs is not written;
A series of data instructed to be written to the logical access area by the access instruction is changed from the first physical sector area to which the data detected by the free sector area search means is not written to the last physical sector area. Data writing means for sequentially writing toward the
The redundant area corresponding to the physical sector area in which the series of data is written by the data writing means, the logical sector area corresponding to the head area of the logical access area belonging to the logical block, and the logical area belonging to the logical block A memory controller comprising logical sector information writing means for writing information for determining the number of sectors in an access area.
該セクタ領域管理手段は、前記一連のデータの先頭データが書き込まれている各物理セクタ領域に対応する冗長領域から、前記論理セクタ情報書き込み手段によって書き込まれた前記情報を読み出し、読み出した該情報に基づいて前記物理ブロック内の物理セクタ領域と、該物理ブロックに対応する前記論理ブロック内の論理セクタ領域との対応関係を判別する請求項1に記載のメモリコントローラ。 Sector area management means for determining a correspondence relationship between a physical sector area in the physical block in which one or a plurality of the series of data is written and a logical sector area in the logical block corresponding to the physical block; Prepared,
The sector area management means reads the information written by the logical sector information writing means from the redundant area corresponding to each physical sector area in which the first data of the series of data is written, and reads the information into the read information. 2. The memory controller according to claim 1, wherein a correspondence relationship between a physical sector area in the physical block and a logical sector area in the logical block corresponding to the physical block is determined based on the basis.
複数個の論理ページで構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数とを判別する論理アクセス領域判別手段と、
前記論理アクセス領域が属する前記物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索手段と、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きページ検索手段によって検出されたデータが書き込まれていない先頭の物理ページから、末尾の物理ページに向かって順次書き込んでいくデータ書き込み手段と、
前記データ書き込み手段により前記一連のデータが書き込まれた物理ページに対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、前記論理ブロックに含まれる前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数を判別するための情報を書き込む論理ページ情報書き込み手段とを備えたことを特徴とするメモリコントローラ。 A memory controller that controls access to a flash memory that is erased in units of physical blocks including a plurality of physical pages, based on an access instruction given from a host system,
Block management means for managing a correspondence relationship between a logical block composed of a plurality of logical pages and the physical block;
The logical block to which the logical access area specified as the access target area by the access instruction belongs, the logical page corresponding to the head area of the logical access area belonging to the logical block, and the logical access area belonging to the logical block Logical access area determination means for determining the number of pages from the logical page corresponding to the head area to the logical page corresponding to the end area;
Empty page search means for searching for the beginning of a physical page in which data in the physical block to which the logical access area belongs is not written;
A series of data instructed to be written to the logical access area by the access instruction is directed from the first physical page to which the data detected by the empty page search means is not written to the last physical page. Data writing means for sequentially writing;
A logical area corresponding to a head area of the logical access area belonging to the logical block, a logical page included in the logical block A memory controller, comprising: logical page information writing means for writing information for determining the number of pages from a logical page corresponding to the top area to a logical page corresponding to the end area.
該ページ管理手段は、前記一連のデータの先頭データが書き込まれている各物理ページに対応する冗長領域から、前記論理ページ情報書き込み手段によって書き込まれた前記情報を読み出し、読み出した該情報に基づいて前記物理ブロック内の物理ページと、該物理ブロックに対応する前記論理ブロック内の論理ページとの対応関係を判別する請求項4に記載のメモリコントローラ。 Page management means for determining a correspondence relationship between a physical page in the physical block in which one or a plurality of the series of data is written and a logical page in the logical block corresponding to the physical block;
The page management means reads the information written by the logical page information writing means from the redundant area corresponding to each physical page in which the first data of the series of data is written, and based on the read information The memory controller according to claim 4, wherein a correspondence relationship between a physical page in the physical block and a logical page in the logical block corresponding to the physical block is determined.
前記メモリコントローラによってアクセスされるフラッシュメモリとを備えるフラッシュメモリシステム。 A memory controller according to claim 1;
And a flash memory system accessed by the memory controller.
複数個の論理セクタ領域で構成された論理ブロックを形成し、前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、該論理ブロックに属する前記論理アクセス領域のセクタ数とを判別する論理アクセス領域判別ステップと、
前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロックを判別する物理ブロック判別ステップと、
前記物理ブロック判別ステップで判別された前記物理ブロック内のデータが書き込まれていない物理セクタ領域の先頭を検索する空きセクタ領域検索ステップと、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索ステップで検出されたデータが書き込まれていない先頭の物理セクタ領域から、末尾の物理セクタ領域に向かって順次書き込んでいくデータ書き込みステップと、
前記データ書き込みステップで前記一連のデータが書き込まれた物理セクタ領域に対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と、前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報を書き込む論理セクタ情報書き込みステップとを有することを特徴とするフラッシュメモリの制御方法。 A flash memory control method for controlling access to a flash memory to be erased in units of physical blocks including a plurality of physical sector areas based on an access instruction given from a host system,
Forming a logical block composed of a plurality of logical sector areas, the logical block to which the logical access area designated as the access target area by the access instruction belongs, and the leading area of the logical access area belonging to the logical block A logical access area determination step for determining a logical sector area corresponding to the number of sectors of the logical access area belonging to the logical block;
A physical block determining step for determining the physical block corresponding to the logical block to which the logical access area belongs;
A free sector area search step for searching for the beginning of a physical sector area in which data in the physical block determined in the physical block determination step is not written;
A series of data instructed to be written to the logical access area by the access instruction is changed from the first physical sector area to which the data detected in the empty sector area search step is not written to the last physical sector area. A data writing step of sequentially writing toward the
In a redundant area corresponding to the physical sector area in which the series of data is written in the data writing step, a logical sector area corresponding to a head area of the logical access area belonging to the logical block, and the logical area belonging to the logical block And a logical sector information writing step for writing information for determining the number of sectors in the access area.
前記第1の論理セクタ情報読み出しステップで読み出された情報に基づいて前記物理ブロック内の物理セクタ領域と、該物理ブロックに対応する前記論理ブロック内の論理セクタ領域との対応関係を判別する論理セクタ領域判別ステップとを有することを特徴とする請求項8に記載のフラッシュメモリの制御方法。 A first logical sector information reading step for reading out the information written in the logical sector information writing step from a redundant area corresponding to a physical sector area in which head data of the series of data is written;
Logic that determines the correspondence between the physical sector area in the physical block and the logical sector area in the logical block corresponding to the physical block based on the information read in the first logical sector information reading step The flash memory control method according to claim 8, further comprising a sector area determination step.
前記一連のデータの先頭データが書き込まれている物理セクタ領域に対応する冗長領域と該一連のデータの末尾データが書き込まれている物理セクタ領域に対応する冗長領域から読み出した前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理セクタ領域と前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報が一致するときに該一連のデータが正常に書き込まれていると判断する判断ステップとを有することを特徴とする請求項9に記載のフラッシュメモリの制御方法。 A second logical sector information reading step for reading the information written in the logical sector information writing step from a redundant area corresponding to a physical sector area in which tail data of the series of data is written;
The redundant area corresponding to the physical sector area where the first data of the series of data is written and the logical block read from the redundant area corresponding to the physical sector area where the end data of the series of data is written When the information for determining the number of sectors in the logical access area belonging to the logical block coincides with the logical sector area corresponding to the head area of the logical access area, it is determined that the series of data is normally written. 10. The flash memory control method according to claim 9, further comprising a determination step.
複数個の論理ページで構成された論理ブロックを形成し、前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、該論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数とを判別する論理アクセス領域判別ステップと、
前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロックを判別する物理ブロック判別ステップと、
前記物理ブロック判別ステップで判別された前記物理ブロック内のデータが書き込まれていない物理ページの先頭を検索する空きページ検索ステップと、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きページ検索ステップで検出されたデータが書き込まれていない先頭の物理ページから、末尾の物理ページに向かって順次書き込んでいくデータ書き込みステップと、
前記データ書き込みステップで前記一連のデータが書き込まれた物理ページに対応する冗長領域に、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと、前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページから末尾領域に対応する論理ページまでのページ数を判別するための情報を書き込む論理ページ情報書き込みステップとを有することを特徴とするフラッシュメモリの制御方法。 A flash memory control method for controlling access to a flash memory to be erased in units of physical blocks including a plurality of physical pages, based on an access instruction given from a host system,
A logical block composed of a plurality of logical pages is formed, and the logical block to which the logical access area designated as the access target area by the access instruction belongs, and the top area of the logical access area belonging to the logical block A logical access area determination step for determining a corresponding logical page and the number of pages from the logical page corresponding to the top area of the logical access area belonging to the logical block to the logical page corresponding to the end area;
A physical block determining step for determining the physical block corresponding to the logical block to which the logical access area belongs;
A free page search step for searching for the beginning of a physical page in which data in the physical block determined in the physical block determination step is not written;
A series of data instructed to be written to the logical access area by the access instruction is directed from the first physical page to which the data detected in the empty page search step is not written to the last physical page. A data writing step of sequentially writing;
In the redundant area corresponding to the physical page in which the series of data is written in the data writing step, the logical page corresponding to the head area of the logical access area belonging to the logical block, and the logical access area belonging to the logical block And a logical page information writing step for writing information for determining the number of pages from the logical page corresponding to the first area to the logical page corresponding to the end area.
前記第1の論理ページ情報読み出しステップで読み出された情報に基づいて前記物理ブロック内の物理ページと、該物理ブロックに対応する前記論理ブロック内の論理ページとの対応関係を判別する論理ページ判別ステップとを有することを特徴とする請求項11に記載のフラッシュメモリの制御方法。 A first logical page information reading step for reading the information written in the logical page information writing step from a redundant area corresponding to a physical page in which the first data of the series of data is written;
Logical page determination for determining the correspondence between the physical page in the physical block and the logical page in the logical block corresponding to the physical block based on the information read in the first logical page information reading step 12. The flash memory control method according to claim 11, further comprising: a step.
前記一連のデータの先頭データが書き込まれている物理ページに対応する冗長領域と該一連のデータの末尾データが書き込まれている物理ページに対応する冗長領域から読み出した前記論理ブロックに属する前記論理アクセス領域の先頭領域に対応する論理ページと前記論理ブロックに属する前記論理アクセス領域のセクタ数を判別するための情報が一致するときに該一連のデータが正常に書き込まれていると判断する判断ステップとを有することを特徴とする請求項12に記載のフラッシュメモリの制御方法。 A second logical page information reading step for reading the information written in the logical page information writing step from a redundant area corresponding to a physical page in which tail data of the series of data is written;
The logical access belonging to the logical block read from the redundant area corresponding to the physical page to which the first data of the series of data is written and the redundant area corresponding to the physical page to which the end data of the series of data is written A determination step of determining that the series of data is normally written when the information for determining the number of sectors in the logical access area belonging to the logical block matches the logical page corresponding to the first area of the area; The flash memory control method according to claim 12, comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007116884A JP4702703B2 (en) | 2007-04-26 | 2007-04-26 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007116884A JP4702703B2 (en) | 2007-04-26 | 2007-04-26 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2008276371A true JP2008276371A (en) | 2008-11-13 |
JP4702703B2 JP4702703B2 (en) | 2011-06-15 |
Family
ID=40054272
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007116884A Active JP4702703B2 (en) | 2007-04-26 | 2007-04-26 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4702703B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010015007A (en) * | 2008-07-04 | 2010-01-21 | Fujinon Corp | Imaging lens and imaging apparatus using the same |
JP2013174970A (en) * | 2012-02-23 | 2013-09-05 | Toshiba Corp | Management information generation method and memory system |
US8924636B2 (en) | 2012-02-23 | 2014-12-30 | Kabushiki Kaisha Toshiba | Management information generating method, logical block constructing method, and semiconductor memory device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002196977A (en) * | 2000-12-27 | 2002-07-12 | Tdk Corp | Memory controller, flash memory system with memory controller, and control method for flash memory |
JP2004533029A (en) * | 2001-01-19 | 2004-10-28 | サンディスク コーポレイション | Programming operation and reading operation of partial block data in nonvolatile memory |
JP2005292926A (en) * | 2004-03-31 | 2005-10-20 | Tdk Corp | Memory controller, flash memory system, and control method for flash memory |
-
2007
- 2007-04-26 JP JP2007116884A patent/JP4702703B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2002196977A (en) * | 2000-12-27 | 2002-07-12 | Tdk Corp | Memory controller, flash memory system with memory controller, and control method for flash memory |
JP2004533029A (en) * | 2001-01-19 | 2004-10-28 | サンディスク コーポレイション | Programming operation and reading operation of partial block data in nonvolatile memory |
JP2005292926A (en) * | 2004-03-31 | 2005-10-20 | Tdk Corp | Memory controller, flash memory system, and control method for flash memory |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010015007A (en) * | 2008-07-04 | 2010-01-21 | Fujinon Corp | Imaging lens and imaging apparatus using the same |
JP2013174970A (en) * | 2012-02-23 | 2013-09-05 | Toshiba Corp | Management information generation method and memory system |
US8924636B2 (en) | 2012-02-23 | 2014-12-30 | Kabushiki Kaisha Toshiba | Management information generating method, logical block constructing method, and semiconductor memory device |
Also Published As
Publication number | Publication date |
---|---|
JP4702703B2 (en) | 2011-06-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4844639B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
US20060013048A1 (en) | Memory systems including defective block management and related methods | |
US8214579B2 (en) | Memory controller, flash memory system with memory controller, and method of controlling flash memory | |
JP2005196634A (en) | External memory unit | |
JP5093294B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4702387B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4034947B2 (en) | Nonvolatile storage system | |
JP2010182268A (en) | Memory controller, flash memory system equipped with the same, and control method of flash memory | |
JP4702703B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4743185B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4488048B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4501881B2 (en) | Memory controller and flash memory system | |
JP4687720B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4710918B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4153535B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4655034B2 (en) | Memory controller, flash memory system, and flash memory control method | |
US8200890B2 (en) | Memory controller, flash memory system with memory controller, and method of controlling flash memory | |
JP4641034B2 (en) | Nonvolatile storage system | |
JP4241741B2 (en) | Memory controller and flash memory system | |
JP4760826B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4636046B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP2005242903A (en) | Memory device, and memory control method and device | |
JP2012068764A (en) | Memory controller, nonvolatile memory system with memory controller, and control method of nonvolatile memory | |
JP4569554B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP2004145964A (en) | Semiconductor memory, semiconductor memory manufacturing method, memory card, and method of controlling semiconductor memory |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20101221 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110113 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110125 |
|
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: 20110214 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110227 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4702703 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |