JP4687720B2 - MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD - Google Patents

MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Download PDF

Info

Publication number
JP4687720B2
JP4687720B2 JP2008018614A JP2008018614A JP4687720B2 JP 4687720 B2 JP4687720 B2 JP 4687720B2 JP 2008018614 A JP2008018614 A JP 2008018614A JP 2008018614 A JP2008018614 A JP 2008018614A JP 4687720 B2 JP4687720 B2 JP 4687720B2
Authority
JP
Japan
Prior art keywords
physical
page
data
logical
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2008018614A
Other languages
Japanese (ja)
Other versions
JP2009181254A (en
Inventor
直樹 向田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TDK Corp
Original Assignee
TDK Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TDK Corp filed Critical TDK Corp
Priority to JP2008018614A priority Critical patent/JP4687720B2/en
Publication of JP2009181254A publication Critical patent/JP2009181254A/en
Application granted granted Critical
Publication of JP4687720B2 publication Critical patent/JP4687720B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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, data corresponding to each logical page given from the host system is not stored in the host system without fixing the correspondence between the logical page included in the logical block and the physical page included in the physical block corresponding to the logical block. There is known a method of writing to physical pages in a physical block in the order given by (see, for example, Patent Document 1). In such a writing method, since data given from the host system is written in order from the head to a page in which data in the physical block is not written, data can be easily rewritten. On the other hand, when data is read, since the correspondence between the logical page and the physical page is not fixed, it is necessary to grasp the correspondence between the logical page and the physical page.

特開2005−196736号公報JP 2005-196736

各物理ページの冗長領域に対応する論理ページ(又は論理セクタ領域)の番号等の論理ページ(又は論理セクタ領域)を特定する情報を書き込んでおけば、この情報に基づいて、論理ページ(又は論理セクタ領域)と物理ページ(又は物理セクタ領域)の対応関係を把握することができる。   If information specifying the logical page (or logical sector area) such as the number of the logical page (or logical sector area) corresponding to the redundant area of each physical page is written, the logical page (or logical page) is written based on this information. The correspondence relationship between the sector area) and the physical page (or physical sector area) can be grasped.

しかし、データが書き込まれている各物理ページから論理ページ(又は論理セクタ領域)を特定する情報を順次読み出して、論理ページ(又は論理セクタ領域)と物理ページ(又は物理セクタ領域)の対応関係を把握するのでは、処理効率が良くない。   However, the information specifying the logical page (or logical sector area) is sequentially read from each physical page where data is written, and the correspondence between the logical page (or logical sector area) and the physical page (or physical sector area) is determined. To grasp, processing efficiency is not good.

そこで、本発明は、効率的に論理ページ(又は論理セクタ領域)と物理ページ(又は物理セクタ領域)の対応関係を把握することができる論理ページ(又は論理セクタ領域)と物理ページ(又は物理セクタ領域)の対応関係の管理技術を提供することを目的とする。   Therefore, the present invention provides a logical page (or logical sector area) and a physical page (or physical sector) that can efficiently grasp the correspondence between the logical page (or logical sector area) and the physical page (or physical sector area). The purpose is to provide the management technology of the correspondence relationship of (region).

本発明の第一の側面に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、複数個の物理セクタ領域を含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
複数個の論理セクタ領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理セクタ領域の先頭を検索する空きセクタ領域検索手段と、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索手段によって検出されたデータが書き込まれていない先頭の前記物理セクタ領域から、末尾の前記物理セクタ領域に向かって順次書き込んでいくデータ書き込み手段と、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータの先頭データに対応する前記論理セクタ領域である第1の領域が、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理セクタ領域に記憶されているデータに対応する前記論理セクタ領域である第2の領域に後続する領域であるか否かを判断する判断手段と、
前記判断手段により前記第1の領域は前記第2の領域に後続する領域ではないと判断された場合に、前記データ書き込み手段により前記一連のデータが書き込まれた前記物理ブロック内の前記物理セクタ領域と、前記物理ブロックに対応する前記論理ブロック内の前記論理セクタ領域との対応関係を示すセクタ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理セクタ領域の次の前記物理セクタ領域に書き込むセクタ管理情報書き込み手段とを備える。前記判断手段は、前記末尾の前記物理セクタ領域に記憶されているデータが前記セクタ管理情報である場合、前記第1の領域は前記第2の領域に後続する領域ではないと判断する。
A memory controller according to a first aspect of 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 sector areas, based on an access instruction given from a host system. And
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;
Empty sector area search means for searching for the beginning of the physical sector area in which data in the physical block corresponding to the logical block to which the logical access area specified as the area to be accessed by the access instruction belongs is not written;
A series of data instructed to be written to the logical access area by the access instruction is transferred from the head physical sector area to which the data detected by the free sector area search means is not written, to the physical address at the end. Data writing means for sequentially writing toward the sector area;
The first area, which is the logical sector area corresponding to the head data of a series of data instructed to be written to the logical access area by the access instruction, corresponds to the logical block to which the logical access area belongs. Judgment means for judging whether it is an area following the second area which is the logical sector area corresponding to the data stored in the last physical sector area in which the data in the physical block is written When,
The physical sector area in the physical block in which the series of data has been written by the data writing means when the determining means determines that the first area is not an area following the second area And sector management information indicating a correspondence relationship with the logical sector area in the logical block corresponding to the physical block, the physical sector area next to the physical sector area in which the end data of the series of data is written And sector management information writing means. The determination unit determines that the first area is not an area subsequent to the second area when the data stored in the physical sector area at the end is the sector management information.

好適な実施形態では、前記論理ブロック内の前記論理セクタ領域に付けられた通し番号に基づいて前記第1の領域が前記第2の領域に後続する領域であるか否かを判断する判断手段であって、前記第1の領域に対応する通し番号が第2の領域に対応する通し番号の次の番号でないときに、前記第1の領域は前記第2の領域に後続する領域ではないと判断する。   In a preferred embodiment, the determination means determines whether or not the first area is an area following the second area based on a serial number assigned to the logical sector area in the logical block. When the serial number corresponding to the first area is not the next number of the serial number corresponding to the second area, it is determined that the first area is not an area subsequent to the second area.

好適な実施形態では、前記アクセス指示により指定された前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内の前記物理セクタ領域に記憶されているデータを、前記物理ブロック内のデータが書き込まれている末尾の前記物理セクタ領域に記憶されている前記セクタ管理情報に基づいて読み出すデータ読み出し手段を更に備える。   In a preferred embodiment, the data stored in the physical sector area in the physical block corresponding to the logical block to which the logical access area specified by the access instruction belongs is written into the data in the physical block. And a data reading means for reading out based on the sector management information stored in the last physical sector area.

好適な実施形態では、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内に前記セクタ管理情報が記憶されていないとき、前記物理ブロックに記憶されているデータは、前記物理ブロック内の先頭の前記物理セクタ領域に記憶されているデータに対応する前記論理セクタ領域以降の前記論理セクタ領域に対応するデータが前記論理セクタ領域の順番で書き込まれているとみなして、データの読出しを行う。   In a preferred embodiment, when the sector management information is not stored in the physical block corresponding to the logical block to which the logical access area belongs, the data stored in the physical block is stored in the physical block. The data corresponding to the logical sector area after the logical sector area corresponding to the data stored in the head physical sector area is regarded as being written in the order of the logical sector area, and data is read. .

本発明の第二の側面に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
複数個の論理ページで構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の論理ページとして指定された論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理ページの先頭を検索する空きページ検索手段と、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータを、前記空きページ検索手段によって検出されたデータが書き込まれていない先頭の前記物理ページから、末尾の前記物理ページに向かって順次書き込んでいくデータ書き込み手段と、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータの先頭データに対応する前記論理ページである第1のページが、前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理ページに記憶されているデータに対応する前記論理ページである第2のページに後続するページであるか否かを判断する判断手段と、
前記判断手段により前記第1のページは前記第2のページに後続するページではないと判断された場合に、前記データ書き込み手段により前記一連のデータが書き込まれた前記物理ブロック内の前記物理ページと、前記物理ブロックに対応する前記論理ブロック内の前記論理ページとの対応関係を示すページ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理ページの次の前記物理ページに書き込むページ管理情報書き込み手段とを備える。前記判断手段は、前記末尾の前記物理ページに記憶されているデータが前記ページ管理情報である場合、前記第1のページは前記第2のページに後続するページではないと判断する。
A memory controller according to a second aspect of the present invention is a memory controller that controls 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. ,
Block management means for managing a correspondence relationship between a logical block composed of a plurality of logical pages and the physical block;
Empty page search means for searching for the top of the physical page in which data in the physical block corresponding to the logical block to which the logical access page designated as the logical page to be accessed belongs by the access instruction belongs,
A series of data instructed to be written to the logical access page by the access instruction is transferred from the first physical page to which the data detected by the empty page search unit is not written to the last physical page. Data writing means for sequentially writing toward the
The first page which is the logical page corresponding to the first data of a series of data instructed to be written to the logical access page by the access instruction corresponds to the logical block to which the logical access page belongs. Determining means for determining whether the page is subsequent to the second page that is the logical page corresponding to the data stored in the last physical page in which data in the physical block is written;
When the determining means determines that the first page is not a page following the second page, the physical page in the physical block in which the series of data has been written by the data writing means Page management information for writing page management information indicating a correspondence relationship with the logical page in the logical block corresponding to the physical block to the physical page next to the physical page in which the end data of the series of data is written Information writing means. The determination unit determines that the first page is not a page subsequent to the second page when the data stored in the physical page at the end is the page management information.

好適な実施形態では、前記論理ブロック内の前記論理ページに付けられた通し番号に基づいて前記第1のページが前記第2のページに後続するページであるか否かを判断する判断手段であって、前記第1のページに対応する通し番号が第2のページに対応する通し番号の次の番号でないときに、前記第1のページは前記第2のページに後続するページではないと判断する。   In a preferred embodiment, the determination means determines whether the first page is a page subsequent to the second page based on a serial number assigned to the logical page in the logical block. When the serial number corresponding to the first page is not the next number of the serial number corresponding to the second page, it is determined that the first page is not a page subsequent to the second page.

好適な実施形態では、前記アクセス指示により指定された前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内の前記物理ページに記憶されているデータを、前記物理ブロック内のデータが書き込まれている末尾の前記物理ページに記憶されている前記ページ管理情報に基づいて読み出すデータ読み出し手段を更に備える。   In a preferred embodiment, data stored in the physical page in the physical block corresponding to the logical block to which the logical access page specified by the access instruction belongs is written into the data in the physical block. And a data reading means for reading based on the page management information stored in the last physical page.

好適な実施形態では、前記データ読み出し手段は、前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内に前記ページ管理情報が記憶されていないとき、前記物理ブロックに記憶されているデータは、前記物理ブロック内の先頭の前記物理ページに記憶されているデータに対応する前記論理ページ以降の前記論理ページに対応するデータが前記論理ページの順番で書き込まれているとみなして、データの読出しを行う。   In a preferred embodiment, when the page management information is not stored in the physical block corresponding to the logical block to which the logical access page belongs, the data reading means stores data stored in the physical block as follows: The data corresponding to the logical page after the logical page corresponding to the data stored in the first physical page in the physical block is regarded as being written in the order of the logical pages, and the data is read. I do.

本発明の第三の側面に従うフラッシュメモリシステムは、前記第一又は第二の側面に従うメモリコントローラと、前記メモリコントローラによってアクセスされるフラッシュメモリとを備える。   A flash memory system according to a third aspect of the present invention comprises a memory controller according to the first or second aspect and a flash memory accessed by the memory controller.

本発明の第四の側面に従うフラッシュメモリの制御方法は、複数個の物理セクタ領域を含む物理ブロック単位で消去が行われるフラッシュメモリの制御方法であって、
複数個の論理セクタ領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理セクタ領域の先頭を検索する空きセクタ領域検索ステップと、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索ステップによって検出されたデータが書き込まれていない先頭の前記物理セクタ領域から、末尾の前記物理セクタ領域に向かって順次書き込んでいくデータ書き込みステップと、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータの先頭データに対応する前記論理セクタ領域である第1の領域が、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理セクタ領域に記憶されているデータに対応する前記論理セクタ領域である第2の領域に後続する領域であるか否かを判断する判断ステップと、
前記判断ステップにより前記第1の領域は前記第2の領域に後続する領域ではないと判断された場合に、前記データ書き込みステップにより前記一連のデータが書き込まれた前記物理ブロック内の前記物理セクタ領域と、前記物理ブロックに対応する前記論理ブロック内の前記論理セクタ領域との対応関係を示すセクタ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理セクタ領域の次の前記物理セクタ領域に書き込むセクタ管理情報書き込みステップとを備える。前記判断ステップでは、前記末尾の前記物理セクタ領域に記憶されているデータが前記セクタ管理情報である場合、前記第1の領域は前記第2の領域に後続する領域ではないと判断する。
A flash memory control method according to a fourth aspect of the present invention is a flash memory control method in which erasure is performed in units of physical blocks including a plurality of physical sector areas,
A block management step for managing a correspondence relationship between a logical block composed of a plurality of logical sector areas and the physical block;
A free sector area search step for searching for the beginning of the physical sector area in which data in the physical block corresponding to the logical block to which the logical access area designated as the access target area by the access instruction belongs is not written;
A series of data instructed to be written to the logical access area by the access instruction is transferred from the first physical sector area to which the data detected by the free sector area search step is not written to the last physical sector. A data writing step of sequentially writing toward the sector area;
The first area, which is the logical sector area corresponding to the head data of a series of data instructed to be written to the logical access area by the access instruction, corresponds to the logical block to which the logical access area belongs. A determination step of determining whether or not it is an area following the second area which is the logical sector area corresponding to the data stored in the physical sector area at the end in which the data in the physical block is written When,
When the determination step determines that the first area is not an area following the second area, the physical sector area in the physical block in which the series of data has been written by the data write step And sector management information indicating a correspondence relationship with the logical sector area in the logical block corresponding to the physical block, the physical sector area next to the physical sector area in which the end data of the series of data is written A sector management information writing step. In the determining step, when the data stored in the physical sector area at the end is the sector management information, it is determined that the first area is not an area following the second area.

本発明の第五の側面に従うフラッシュメモリの制御方法は、ホストシステムから与えられるアクセス指示に基づいて、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリの制御方法であって、
複数個の論理ページで構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記アクセス指示によりアクセス対象の論理ページとして指定された論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理ページの先頭を検索する空きページ検索ステップと、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータを、前記空きページ検索ステップによって検出されたデータが書き込まれていない先頭の前記物理ページから、末尾の前記物理ページに向かって順次書き込んでいくデータ書き込みステップと、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータの先頭データに対応する前記論理ページである第1のページが、前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理ページに記憶されているデータに対応する前記論理ページである第2のページに後続するページであるか否かを判断する判断ステップと、
前記判断ステップにより前記第1のページは前記第2のページに後続するページではないと判断された場合に、前記データ書き込みステップにより前記一連のデータが書き込まれた前記物理ブロック内の前記物理ページと、前記物理ブロックに対応する前記論理ブロック内の前記論理ページとの対応関係を示すページ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理ページの次の前記物理ページに書き込むページ管理情報書き込みステップとを備える。前記判断ステップでは、前記末尾の前記物理ページに記憶されているデータが前記ページ管理情報である場合、前記第1のページは前記第2のページに後続するページではないと判断する。
A flash memory control method according to a fifth aspect of the present invention is a flash memory control method in which erasing is performed in units of physical blocks including a plurality of physical pages based on an access instruction given from a host system.
A block management step for managing a correspondence relationship between a logical block composed of a plurality of logical pages and the physical block;
A free page search step of searching for the top of the physical page in which data in the physical block corresponding to the logical block to which the logical access page designated as the logical page to be accessed by the access instruction belongs is not written;
A series of data instructed to be written to the logical access page by the access instruction is transferred from the first physical page to which the data detected by the empty page search step is not written to the last physical page. A data writing step of sequentially writing toward the
The first page which is the logical page corresponding to the first data of a series of data instructed to be written to the logical access page by the access instruction corresponds to the logical block to which the logical access page belongs. A determination step of determining whether or not the page is subsequent to the second page which is the logical page corresponding to the data stored in the last physical page in which data in the physical block is written;
When the determination step determines that the first page is not a page subsequent to the second page, the physical page in the physical block in which the series of data has been written by the data writing step Page management information for writing page management information indicating a correspondence relationship with the logical page in the logical block corresponding to the physical block to the physical page next to the physical page in which the end data of the series of data is written An information writing step. In the determination step, when the data stored in the physical page at the end is the page management information, it is determined that the first page is not a page subsequent to the second page.

効率的に論理ページ(又は論理セクタ領域)と物理ページ(又は物理セクタ領域)の対応関係を把握することができる論理ページ(又は論理セクタ領域)と物理ページ(又は物理セクタ領域)の対応関係の管理技術を提供することができる。   Correspondence between logical page (or logical sector area) and physical page (or physical sector area) that can efficiently grasp the correspondence between logical page (or logical sector area) and physical page (or physical sector area) Management technology can be provided.

以下、本発明の幾つかの実施の形態を、図面を参照しながら詳細に説明する。   Hereinafter, some embodiments of the present invention will be described in detail with reference to the drawings.

<第1の実施形態>   <First Embodiment>

図1は、本発明の第1の実施形態に係るフラッシュメモリシステム1を概略的に示すブロック図である。   FIG. 1 is a block diagram schematically showing a flash memory system 1 according to the first embodiment of the present invention.

図1に示すように、フラッシュメモリシステム1は、フラッシュメモリ2と、それを制御するメモリコントローラ3とで構成されている。   As shown in FIG. 1, the flash memory system 1 includes a flash memory 2 and a memory controller 3 that controls the flash memory 2.

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

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

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

ホストインターフェースブロック7は、コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3を備えている。コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3には、ホストシステム4から与えられる情報が書き込まれる。コマンドレジスタR1には、書き込みコマンド、読み出しコマンド等の外部コマンドが書き込まれる。セクタ数レジスタR2にはアクセス対象領域のセクタ数が書き込まれる。LBAレジスタR3には、アクセス対象領域の先頭のLBA(Logical Block Address)(後述)が書き込まれる。   The host interface block 7 includes a command register R1, a sector number register R2, and an LBA register R3. Information given from the host system 4 is written in the command register R1, the sector number register R2, and the LBA register R3. External commands such as a write command and a read command are written in the command register R1. The number of sectors in the access target area is written in the sector number register R2. LBA (Logical Block Address) (described later) of the access target area is written in the LBA register R3.

ワークエリア8は、フラッシュメモリ2の制御に必要なデータを一時的に格納する作業領域であり、複数のSRAM(Static Random Access Memory)セルによって構成されている。ワークエリア8には、例えば、論理ブロックと物理ブロックとの対応関係を示したアドレス変換テーブル(後述)等が記憶される。   The work area 8 is a work area for temporarily storing data necessary for controlling the flash memory 2, and is composed of a plurality of SRAM (Static Random Access Memory) cells. In the work area 8, for example, an address conversion table (described later) indicating the correspondence between logical blocks and physical blocks is stored.

バッファ9は、フラッシュメモリ2から読み出したデータを、ホストシステム4が受け取り可能な状態となるまで保持する。また、バッファ9は、フラッシュメモリ2に書き込むデータを、フラッシュメモリ2が書き込み可能な状態となるまで保持する。   The buffer 9 holds the data read from the flash memory 2 until the host system 4 can receive the data. The buffer 9 holds data to be written to the flash memory 2 until the flash memory 2 is in a writable state.

フラッシュメモリインターフェースブロック10は、内部バス14を介して、フラッシュメモリ2との間でデータ、アドレス情報、ステータス情報、内部コマンド等の授受を行う。ここで、内部コマンドとは、メモリコントローラ3がフラッシュメモリ2に処理の実行を指示するためのコマンドであり、フラッシュメモリ2は、メモリコントローラ3から与えられる内部コマンドに従って動作する。   The flash memory interface block 10 exchanges data, address information, status information, internal commands, and the like with the flash memory 2 via the internal bus 14. Here, the internal command is a command for the memory controller 3 to instruct the flash memory 2 to execute processing, and the flash memory 2 operates in accordance with the internal command given from the memory controller 3.

ECCブロック11は、フラッシュメモリ2に書き込むデータに付加される誤り訂正符号(ECC:Error Collection Code)を生成するとともに、読み出したデータに付加されている誤り訂正符号に基づいて、読み出したデータに含まれる誤りを検出・訂正する。   The ECC block 11 generates an error correction code (ECC) added to data to be written to the flash memory 2 and is included in the read data based on the error correction code added to the read data. Detect and correct errors.

ROM12は、マイクロプロセッサ6による処理の手順を定義するプログラムを格納する不揮発性の記憶素子である。例えば、アドレス変換テーブルの作成等の処理手順を定義するプログラムが格納されている。   The ROM 12 is a non-volatile storage element that stores a program that defines a processing procedure performed by the microprocessor 6. For example, a program that defines a processing procedure such as creation of an address conversion table is stored.

マイクロプロセッサ6は、ROM12に記憶されているプログラムに従って、メモリコントローラ3の全体の動作を制御する。例えば、マイクロプロセッサ6は、ROM12から読み出した各種処理を定義したコマンドセットに基づいてフラッシュメモリインターフェースブロック10に処理を実行させる。   The microprocessor 6 controls the overall operation of the memory controller 3 in accordance with a program stored in the ROM 12. For example, the microprocessor 6 causes the flash memory interface block 10 to execute processes based on a command set that defines various processes read from the ROM 12.

フラッシュメモリ2はNAND型フラッシュメモリからなる。NAND型フラッシュメモリは、レジスタと、複数のメモリセルが2次元的に配列されたメモリセルアレイを備えている。メモリセルアレイは、複数のメモリセル群と、ワード線とを備える。ここで、メモリセル群は、複数のメモリセルが直列に接続されたものである。各ワード線は、メモリセル群の特定のメモリセルを選択するためのものである。このワード線を介して選択されたメモリセルとレジスタとの間で、レジスタから選択されたメモリセルへのデータの書き込み又は選択されたメモリセルからレジスタへのデータの読み出しが行われる。   The flash memory 2 is a NAND flash memory. The NAND flash memory includes a register and a memory cell array in which a plurality of memory cells are two-dimensionally arranged. The memory cell array includes a plurality of memory cell groups and word lines. Here, the memory cell group is a group in which a plurality of memory cells are connected in series. Each word line is for selecting a specific memory cell in the memory cell group. Data is written from the register to the selected memory cell or data is read from the selected memory cell to the register between the selected memory cell and the register via the word line.

NAND型フラッシュメモリでは、データ読み出し動作及びデータ書き込み動作はページ(物理ページ)単位で行われ、データ消去動作はブロック(物理ブロック)単位で行われる。物理ブロックは、複数のページ(物理ページ)で構成される。例えば、1個の物理ページは、所定サイズ(例えば2048バイト)のユーザ領域と、所定サイズ(例えば64バイト)の冗長領域とで構成され、1個の物理ブロックが、所定個数(例えば64個)の物理ページで構成されている。ユーザ領域は、ホストシステム4から与えられるデータを記憶するための領域であり、所定個数(例えば4個)の物理セクタ領域(512バイト単位の記憶領域)で構成されている。冗長領域は、誤り訂正符号(ECC:Error Collection Code)、論理アドレス情報、ブロックステータス(フラグ)等の付加データを記憶するための領域である。   In the NAND flash memory, a data read operation and a data write operation are performed in units of pages (physical 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). For example, one physical page includes a user area of a predetermined size (for example, 2048 bytes) and a redundant area of a predetermined size (for example, 64 bytes), and one physical block has a predetermined number (for example, 64). It consists of physical pages. The user area is an area for storing data given from the host system 4, and is configured by a predetermined number (for example, four) of physical sector areas (storage areas in units of 512 bytes). The redundant area is an area for storing additional data such as an error correction code (ECC), logical address information, and a block status (flag).

図2は、本実施形態で用いるNAND型フラッシュメモリの1個の物理ページに含まれる記憶領域を示している。   FIG. 2 shows a storage area included in one physical page of the NAND flash memory used in this embodiment.

ユーザ領域25は、ホストシステム4から与えられるデータを記憶するための領域である。冗長領域26は、誤り訂正符号(ECC:Error Collection Code)、論理アドレス情報、ブロックステータス(フラグ)等の付加データを記憶するための領域である。   The user area 25 is an area for storing data given from the host system 4. The redundant area 26 is an area for storing additional data such as an error correction code (ECC), logical address information, and a block status (flag).

本実施形態では、図2に示すようにユーザ領域25は、1セクタ(例えば512バイト)の物理セクタ領域60(60a−60d)に分割して使用される。冗長領域26は、所定サイズ(例えば8バイト)の共通冗長領域50と、所定サイズ(例えば14バイト)の分割冗長領域70(70a−70d)に分割して使用される。各物理ブロックの先頭物理ページに対応した共通冗長領域50には、論理アドレス情報、ブロックステータス(フラグ)等の物理ブロック毎で管理される情報が書き込まれる。   In the present embodiment, as shown in FIG. 2, the user area 25 is used by being divided into one sector (for example, 512 bytes) physical sector area 60 (60a-60d). The redundant area 26 is divided into a common redundant area 50 having a predetermined size (for example, 8 bytes) and a divided redundant area 70 (70a to 70d) having a predetermined size (for example, 14 bytes). Information managed for each physical block such as logical address information and block status (flag) is written in the common redundant area 50 corresponding to the first physical page of each physical block.

4個の物理セクタ領域60a−60dと4個の分割冗長領域70a−70dは、1対1の対応関係が予め設定されている。本実施形態では、物理セクタ領域60aが分割冗長領域70aに、物理セクタ領域60bが分割冗長領域70bに、物理セクタ領域60cが分割冗長領域70cに、物理セクタ領域60dが分割冗長領域70dに、それぞれ対応している。分割冗長領域70a−70dには、対応関係にある物理セクタ領域60a−60dに記憶されるデータに付加される誤り訂正符号等の物理セクタ領域60(60a−60d)毎で管理される情報が書き込まれる。   The four physical sector areas 60a-60d and the four divided redundant areas 70a-70d have a one-to-one correspondence set in advance. In this embodiment, the physical sector area 60a is the divided redundant area 70a, the physical sector area 60b is the divided redundant area 70b, the physical sector area 60c is the divided redundant area 70c, and the physical sector area 60d is the divided redundant area 70d. It corresponds. In the divided redundant areas 70a to 70d, information managed for each physical sector area 60 (60a to 60d) such as an error correction code added to data stored in the corresponding physical sector areas 60a to 60d is written. It is.

このように、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). That is, 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.

論理アドレス情報は、物理ブロックと論理ブロックの対応関係を判別するための情報である。従って、記憶データが消去された物理ブロックのような、対応する論理ブロックの無い物理ブロックについては、その冗長領域26に(先頭物理ページに対応した共通冗長領域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 stored in the redundant area 26 (in the common redundant area 50 corresponding to the first physical page). Not.

ブロックステータス(フラグ)は、物理ブロックの良否を示すフラグである。尚、初期不良の物理ブロックについては、不良ブロック(正常にデータの書き込み等を行うことができない物理ブロック)であることを示すブロックステータス(フラグ)が製造メーカによって書き込まれている。また、この初期不良の物理ブロックを示すブロックステータス(フラグ)を、ユーザ領域に書き込んでいる製造メーカもある。   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. Some manufacturers also write a block status (flag) indicating the initial defective physical block in the user area.

ホストシステム4側のアドレス空間は、セクタ(512バイト)単位で分割した領域(以下、論理セクタ領域と言う)に付けた通番であるLBA(Logical Block Address)で管理されている。又、メモリコントローラ内で行われるアドレス管理では、複数個の論理セクタ領域で論理ブロックが形成され、この論理ブロックに対して、1個又は複数個の物理ブロックが割り当てられる。   The address space on the host system 4 side is managed by an LBA (Logical Block Address) which is a serial number assigned to an area (hereinafter referred to as a logical sector area) divided in units of sectors (512 bytes). In the address management performed in the memory controller, a logical block is formed by a plurality of logical sector areas, and one or a plurality of physical blocks are allocated to the logical block.

本実施形態では、図3に示したようにLBAが連続する256個の論理セクタ領域をまとめたものを論理ブロックとし、この論理ブロックに通し番号を付している。以下、論理ブロックに付した通し番号を論理ブロック番号(LBN)と言う。例えば、LBA#0−#255の256個の論理セクタ領域は、LBN#0の論理ブロックに属し、LBA#256−#511の256個の論理セクタ領域はLBN#1の論理ブロックに属している。このように、LBA#0−#2047999の2048000個の論理セクタ領域は、LBN#0−#7999の8000個の論理ブロックのいずれかに属している。   In the present embodiment, as shown in FIG. 3, a group of 256 logical sector areas with continuous LBAs 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 LBN # 0, and the 256 logical sector areas of LBA # 256- # 511 belong to the logical block of LBN # 1. . As described above, the 2048,000 logical sector areas of LBA # 0 to # 20479999 belong to one of 8000 logical blocks of LBN # 0 to # 7999.

更に、この論理ブロックを複数個まとめた論理グループが形成されている。以下、論理グループに付けられた通し番号を論理グループ番号(LGN)と言う。図3の例では、LBNが連続する論理ブロックを、異なる論理グループに順次振り分けるようにして論理グループを形成する。例えば、LBN#0の論理ブロックはLGN#0の論理グループに、LBN#1の論理ブロックはLGN#1の論理グループに、LBN#2の論理ブロックはLGN#2の論理グループにという順番でLGN#7の論理グループまで振り分けていく。以下同様に、LBN#8の論理ブロックをLGN#0の論理グループに、LBN#9の論理ブロックをLGN#1の論理グループに、LBN#10の論理ブロックをLGN#2の論理グループに振り分けていく。このようにして、1000個の論理ブロックからなる8個の論理グループが形成される。   Further, a logical group in which a plurality of logical blocks are collected is formed. Hereinafter, a serial number assigned to a logical group is referred to as a logical group number (LGN). In the example of FIG. 3, logical groups are formed by sequentially allocating logical blocks having consecutive LBNs to different logical groups. For example, the logical block of LBN # 0 is the logical group of LGN # 0, the logical block of LBN # 1 is the logical group of LGN # 1, the logical block of LBN # 2 is the logical group of LGN # 2, and so on. Sort to # 7 logical group. Similarly, the logical block of LBN # 8 is assigned to the logical group of LGN # 0, the logical block of LBN # 9 is assigned to the logical group of LGN # 1, and the logical block of LBN # 10 is assigned to the logical group of LGN # 2. Go. In this way, 8 logical groups consisting of 1000 logical blocks are formed.

この論理グループは単なるアドレス変換テーブルの作成単位であり、どの論理ブロックがどの物理ブロックに割り当てられても良い。   This logical group is simply a unit for creating an address translation table, and any logical block may be assigned to any physical block.

このアドレス変換テーブルは、論理ブロックと物理ブロックとの対応関係を記述したテーブルであり、全ての論理ブロックと物理ブロックとの対応関係を含むテーブルであってもよいが、本実施形態では、論理グループ単位でテーブルが作成される。このアドレス変換テーブルは、フラッシュメモリ2内に保存される。また、対応関係にある論理ブロック内の領域と物理ブロック内の領域を管理するために、論理セクタ領域と物理セクタ領域60の対応関係が後述する方法によって把握される(なお、後述の第2の実施形態では、論理ページ(後述)と物理ページの対応関係が把握される)。   This address conversion table is a table describing the correspondence between logical blocks and physical blocks, and may be a table including the correspondence between all logical blocks and physical blocks. In this embodiment, a logical group A table is created in units. This address conversion table is stored in the flash memory 2. In addition, in order to manage the area in the logical block and the area in the physical block that have a correspondence relationship, the correspondence relation between the logical sector area and the physical sector area 60 is grasped by a method described later (note that the second sector described later) In the embodiment, the correspondence between a logical page (described later) and a physical page is grasped).

尚、フラッシュメモリ内の物理ブロックには、出荷時から不良である先天性の不良ブロックが含まれている。更に、出荷時に良品の物理ブロックであっても、使用開始後に劣化して不良ブロックになる物理ブロック(後天性の不良ブロック)もある。従って、本実施形態では、8000個の論理ブロックに対し、8192個の物理ブロックを割り当てている。   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, 8192 physical blocks are assigned to 8000 logical blocks.

第1の実施形態では、論理ブロックに含まれる256個の論理セクタ領域と物理ブロックに含まれる256個の物理セクタ領域60との対応関係をセクタ単位で管理している。1個の物理ページに4個の物理セクタ領域60が含まれている。第1の実施形態におけるNAND型フラッシュメモリは、各物理ページに対するデータの書き込みを物理セクタ領域60毎に分けて実行することのできるNAND型フラッシュメモリである。つまり、1個の物理ページに含まれる4個の物理セクタ領域60に対するデータの書き込みを4回に分けて実行することができる。   In the first embodiment, the correspondence between 256 logical sector areas included in a logical block and 256 physical sector areas 60 included in a physical block is managed in units of sectors. One physical page includes four physical sector areas 60. The NAND flash memory according to the first embodiment is a NAND flash memory that can execute data writing for each physical page separately for each physical sector area 60. That is, data writing to the four physical sector areas 60 included in one physical page can be executed four times.

第1の実施形態の書き込み処理では、ホストシステム4によって、コマンドレジスタR1に、書き込みコマンドを示すコマンドコードが書き込まれ、セクタ数レジスタR2に、書き込むデータのセクタ数が書き込まれ、LBAレジスタR3には、書き込みを開始する先頭データに対応するLBAが書き込まれる。セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて、アクセス対象の領域である論理アクセス領域が判別され、その論理アクセス領域が含まれる論理ブロックに対応する物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭から、ホストシステム4から与えられるデータが書き込まれる。   In the write processing of the first embodiment, the host system 4 writes a command code indicating a write command to the command register R1, writes the number of sectors of data to be written to the sector number register R2, and writes to the LBA register R3. The LBA corresponding to the top data for starting writing is written. Based on the information written in the sector number register R2 and the LBA register R3, the logical access area that is the access target area is determined, and the data in the physical block corresponding to the logical block including the logical access area is written. Data given from the host system 4 is written from the head of the physical sector area 60 that is not.

セクタ数レジスタ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 physical sector area 60 in which data in the physical block corresponding to the first logical block is not written. The data instructed to be written to the logical access area belonging to the second logical block is written to the physical sector area 60 where data in the physical block corresponding to the second logical block is not written.

以下の説明で、ホストシステム4から与えられる情報(つまり、コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3に書き込まれる情報)に基づいて実行される1セクタ又は複数セクタのデータの書き込み処理において、書き込まれるデータを、「一連のデータ」と言う。例えば、セクタ数レジスタR2に書き込まれた値がnの場合(nは1以上の整数)、nセクタ分のLBAが連続するデータが、一連のデータに対応する。尚、論理アクセス領域が複数個の論理ブロックに跨っている場合は、論理ブロック毎に一連のデータは分割される。例えば、論理アクセス領域が2個の論理ブロック(第1の論理ブロックと第2の論理ブロック)に跨っている場合に、第1の論理ブロックに属する論理アクセス領域のセクタ数がpセクタで、第2の論理ブロックに属する論理アクセス領域のセクタ数がqセクタであれば、セクタ数レジスタR2に書き込まれた値がn(n=p+q)であっても、一連のデータは、pセクタの一連のデータとqセクタの一連のデータとに分割される。   In the following description, in the data writing process of one sector or a plurality of sectors executed based on information given from the host system 4 (that is, information written in the command register R1, the sector number register R2, and the LBA register R3), The data to be written is called “a series of data”. For example, when the value written in the sector number register R2 is n (n is an integer of 1 or more), data in which LBAs for n sectors are continuous corresponds to a series of data. When the logical access area extends over a plurality of logical blocks, a series of data is divided for each logical block. For example, when the logical access area extends over two logical blocks (the first logical block and the second logical block), the number of sectors in the logical access area belonging to the first logical block is p sectors, If the number of sectors in the logical access area belonging to the logical block 2 is q sectors, even if the value written in the sector number register R2 is n (n = p + q), the series of data is a series of p sectors. The data is divided into a series of data of q sectors.

ホストシステム4は、書き込むデータのアドレス又は読み出すデータのアドレスをLBAで指示する。つまり、セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別されるLBA(セクタ数レジスタR2に書き込まれた値が1の場合)、又は、LBAが連続する範囲(セクタ数レジスタR2に書き込まれた値が2以上の場合)が、書き込むデータの書き込み先を指示するアドレス又は読み出すデータの読み出し元を指示するアドレスになる。   The host system 4 indicates the address of the data to be written or the address of the data to be read by LBA. That is, the LBA discriminated based on the information written in the sector number register R2 and the LBA register R3 (when the value written in the sector number register R2 is 1), or the range where the LBA is continuous (sector number register R2 When the value written in (2) is 2 or more), the address indicating the write destination of the data to be written or the address indicating the read source of the data to be read is obtained.

ここで、1個の論理ブロックに含まれる論理セクタ領域の個数が2個(例えば、i=8のときは256個)の場合、LBAの下位iビット(例えば、i=8のときは下位8ビット)が、論理ブロック内の論理セクタ領域に付けた通し番号に対応する。以下、論理ブロック内の論理セクタ領域に付けた通し番号を、「論理セクタ番号(LSN)」と言う。それに対し、物理ブロック内の物理セクタ領域60に付けた通し番号を、「物理セクタ番号(PSN)」と言う。又、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 “logical sector number (LSN)”. On the other hand, the serial number assigned to the physical sector area 60 in the physical block is referred to as “physical sector number (PSN)”. 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 (logical block number) described above. Therefore, it corresponds to the LBN of the LBA of the first logical sector area and the last logical sector area in the logical access area (range where the LBA continues) determined based on the information written in the sector number register R2 and the LBA register R3. If the value indicated by the bit of the part to be processed is the same, the logical access area does not extend over a plurality of logical blocks.

以下、本実施形態での書き込みの概要を説明する。   Hereinafter, an outline of writing in this embodiment will be described.

メモリコントローラ3は、ホストシステム4から与えられる書き込み指示(書き込みコマンド及び書き込み先のアドレス)に従って、この書き込み指示と共に与えられる一連のデータを、フラッシュメモリ2に書き込む。この書き込み処理では、書き込み先の論理セクタ領域が属する論理ブロックが特定され、その論理ブロックに対応する物理ブロック(又は、この論理ブロックに対して新たに割り当てた物理ブロック)に、一連のデータが書き込まれる。物理ブロック内の物理セクタ領域60には、先頭から順番に(つまりPSNが小さいほうから順番に)一連のデータが書き込まれていく。従って、メモリコントローラ3が一連のデータを書き込むときには、物理ブロック内のデータが書き込まれている物理セクタ領域の末尾の検索が行われる。そして、その末尾の物理セクタ領域60の次の物理セクタ領域60から一連のデータが順次書き込まれていく。言い換えれば、物理ブロック内のデータが書き込まれていない先頭の物理セクタ領域から一連のデータが順次書き込まれていく。   The memory controller 3 writes a series of data given together with the write instruction to the flash memory 2 in accordance with a write instruction (write command and write destination address) given from the host system 4. In this write process, a logical block to which a write-destination logical sector area belongs is specified, and a series of data is written to a physical block corresponding to the logical block (or a physical block newly allocated to the logical block). It is. A series of data is written in the physical sector area 60 in the physical block in order from the top (that is, in order from the smallest PSN). Therefore, when the memory controller 3 writes a series of data, the end of the physical sector area in which the data in the physical block is written is searched. Then, a series of data is sequentially written from the physical sector area 60 next to the last physical sector area 60. In other words, a series of data is sequentially written from the top physical sector area in which data in the physical block is not written.

本実施形態では、一連のデータの末尾データが書き込まれた物理セクタ領域60の次の物理セクタ領域60に、論理セクタ領域と物理セクタ領域60の対応関係を示す情報(以下、「セクタ管理情報」と言う)、例えば、論理セクタ領域と物理セクタ領域60の対応関係を示すテーブルが書き込まれる。つまり、セクタ管理情報は、ホストシステム4から書き込み指示と共に与えられる一連のデータと同様に、ユーザ領域25(物理セクタ領域60)に書き込まれる。従って、物理ブロック内のデータが書き込まれている物理セクタ領域60の末尾を検索し、その物理セクタ領域60からセクタ管理情報を読み出すことにより、メモリコントローラ3は論理セクタ領域と物理セクタ領域60の対応関係を把握することができる。本実施形態におけるセクタ管理情報は、例えば、256個の論理セクタ領域の論理セクタ番号にそれぞれ対応する256個のレコードを有するテーブルである(例えば、後述の図5(A)参照)。   In the present embodiment, information indicating the correspondence between the logical sector area and the physical sector area 60 (hereinafter, “sector management information”) is stored in the physical sector area 60 next to the physical sector area 60 in which the end data of a series of data is written. For example, a table indicating the correspondence between the logical sector area and the physical sector area 60 is written. That is, the sector management information is written in the user area 25 (physical sector area 60) in the same manner as a series of data given from the host system 4 together with a write instruction. Accordingly, the memory controller 3 retrieves the end of the physical sector area 60 in which data in the physical block is written, and reads the sector management information from the physical sector area 60, so that the memory controller 3 associates the logical sector area with the physical sector area 60. You can understand the relationship. The sector management information in this embodiment is, for example, a table having 256 records corresponding to the logical sector numbers of 256 logical sector areas (see, for example, FIG. 5A described later).

本実施形態では、一連のデータを書き込む際に、その一連のデータを書き込む物理ブロック内の物理セクタ領域60にセクタ管理情報を書き込むか否かを決定するために、一連のデータの先頭データに対応する論理セクタ領域(以下、「第1の論理セクタ領域」と言う)が、その一連のデータを書き込む物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域(以下、「第2の論理セクタ領域」と言う)に後続する領域であるか否かが判断される。この判断で、第1の論理セクタ領域が第2の論理セクタ領域に後続する領域であると判断された場合は、セクタ管理情報の書き込みが行われない。一方、第1の論理セクタ領域が第2の論理セクタ領域に後続する領域ではないと判断された場合は、セクタ管理情報の書き込みが行われる。つまり、第1の論理セクタ領域のLSNが第2の論理セクタ領域のLSNの次の番号であれば、セクタ管理情報の書き込みが行われない。一方、第1の論理セクタ領域のLSNが第2の論理セクタ領域のLSNの次の番号でなければ、セクタ管理情報の書き込みが行われる。尚、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報の場合には、上記の判断を行わず、セクタ管理情報の書き込みが行われる。   In this embodiment, when writing a series of data, in order to determine whether or not to write sector management information in the physical sector area 60 in the physical block to which the series of data is written, the first data of the series of data is supported. The logical sector area (hereinafter referred to as “first logical sector area”) corresponds to the data stored in the last physical sector area 60 in which the data in the physical block to which the series of data is written is written. It is determined whether it is an area following the logical sector area to be performed (hereinafter referred to as “second logical sector area”). If it is determined by this determination that the first logical sector area is an area subsequent to the second logical sector area, the sector management information is not written. On the other hand, when it is determined that the first logical sector area is not an area subsequent to the second logical sector area, the sector management information is written. That is, if the LSN in the first logical sector area is the next number after the LSN in the second logical sector area, the sector management information is not written. On the other hand, if the LSN of the first logical sector area is not the next number of the LSN of the second logical sector area, the sector management information is written. If the data stored in the last physical sector area 60 where the data in the physical block is written is sector management information, the sector management information is written without making the above determination.

従って、セクタ管理情報を書き込まれていない物理ブロックの場合、その物理ブロック内の先頭の物理セクタ領域60からデータが書き込まれている末尾の物理セクタ領域60までの複数個の物理セクタ領域60に対して、先頭の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域以降の論理セクタ領域が、LSNの順番で割り当てられている(以下、このような状態を「LSNが連続する論理セクタ領域が割り当てられている状態」と言う)。   Therefore, in the case of a physical block in which sector management information is not written, a plurality of physical sector areas 60 from the first physical sector area 60 to the last physical sector area 60 in which data is written are included in the physical block. Thus, logical sector areas subsequent to the logical sector area corresponding to the data stored in the head physical sector area 60 are allocated in the LSN order (hereinafter, such a state is referred to as a logical sector having consecutive LSNs. Say "space is allocated").

例えば、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60がPSN#63の物理セクタ領域60であり、物理ブロック内のPSN#0〜#63の物理セクタ領域60にLSN#8〜#71の論理セクタ領域に対応するデータがLSNの順番で書き込まれているような場合には、その物理ブロックにセクタ管理情報が書き込まれていない。   For example, the last physical sector area 60 in which data in the physical block is written is the physical sector area 60 of PSN # 63, and the physical sector area 60 of PSN # 0 to # 63 in the physical block has LSN # 8 ~. When the data corresponding to the logical sector area of # 71 is written in the LSN order, the sector management information is not written in the physical block.

実際の書き込み処理では、一連のデータを書き込む際に次の2つの判断が行われる。   In the actual writing process, the following two determinations are made when writing a series of data.

まず、書き込み先の物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60に記憶されているデータが、一連のデータとして書き込まれたデータであるか又はセクタ管理情報として書き込まれたデータであるかの判断が行われる。ここで、末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報である場合には、既に「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されていないため、次の判断は行われない。   First, the data stored in the last physical sector area 60 where the data in the physical block of the write destination is written is data written as a series of data or data written as sector management information. A determination is made whether there is. Here, when the data stored in the physical sector area 60 at the end is sector management information, the “state in which a logical sector area having continuous LSNs is already allocated” has not been maintained, so No judgment is made.

次に、末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報でない場合には、末尾の物理セクタ領域60の次の物理セクタ領域60に書き込まれるデータ(今回の書き込み処理で書き込む一連のデータの先頭データ)に対応する論理セクタ領域のLSNが、末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNの次の番号であるか否かの判断が行われる。末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報でない場合、既に書き込まれているデータについては、「LSNが連続する論理セクタ領域が割り当てられている状態」になっているので、今回の書き込み処理で一連のデータ書き込んだときに、その状態が維持できるか否かが問題になる。ここで、今回の書き込み処理で書き込む一連のデータの先頭データに対応する論理セクタ領域のLSNが、データが書き込まれている末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNの次の番号であれば、この一連のデータを書き込んだ後も、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持される。従って、今回の書き込み処理で書き込む一連のデータの先頭データに対応する論理セクタ領域のLSNが、データが書き込まれている末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNの次の番号であれば、セクタ管理情報の書き込みは行われない。   Next, if the data stored in the last physical sector area 60 is not sector management information, the data written in the physical sector area 60 next to the last physical sector area 60 (a series of data written in the current writing process). It is determined whether the LSN of the logical sector area corresponding to the first data of the data is the next number of the LSN of the logical sector area corresponding to the data stored in the last physical sector area 60. If the data stored in the last physical sector area 60 is not sector management information, the already written data is in a “state in which a logical sector area with continuous LSN is allocated”. Whether a state can be maintained when a series of data is written in the writing process is a problem. Here, the LSN of the logical sector area corresponding to the head data of the series of data written in the current writing process is the logical sector area corresponding to the data stored in the last physical sector area 60 where the data is written. If it is the number next to the LSN, even after writing this series of data, the “state in which logical sector areas with continuous LSNs are allocated” is maintained. Therefore, the LSN of the logical sector area corresponding to the head data of the series of data written in the current writing process is the LSN of the logical sector area corresponding to the data stored in the last physical sector area 60 where the data is written. If it is the next number, sector management information is not written.

本実施の形態では、物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNを判別するために、図4に示したように一連のデータの先頭データを書き込んだ物理セクタ領域60に対応する分割冗長領域70に、その先頭データに対応する論理セクタ領域のLSNを書き込むようにしている。従って、少なくとも物理ブロック内の先頭の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNについては、先頭の物理セクタ領域60に対応する分割冗長領域70に書き込まれている。   In the present embodiment, in order to determine the LSN of the logical sector area corresponding to the data stored in the physical sector area 60, as shown in FIG. The LSN of the logical sector area corresponding to the head data is written into the divided redundant area 70 corresponding to. Accordingly, at least the LSN of the logical sector area corresponding to the data stored in the head physical sector area 60 in the physical block is written in the divided redundant area 70 corresponding to the head physical sector area 60.

上記判断を行う際には、先頭の物理セクタ領域60に書き込まれているデータに対応する論理セクタ領域のLSNとデータが書き込まれている末尾の物理セクタ領域60のPSNに基づいて、データが書き込まれている末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNが求められる。具体的には、例えば、先頭の物理セクタ領域60に書き込まれてデータに対応する論理セクタ領域のLSNの値に、データが書き込まれている末尾の物理セクタ領域のPSNの値を加えることにより、データが書き込まれている末尾の物理セクタ領域に記憶されているデータに対応する論理セクタ領域のLSNが求められる。尚、メモリコントローラ3が、一連のデータの末尾データを書き込んだ物理セクタ領域60に対応する分割冗長領域70に、その物理セクタ領域60に書き込まれたデータに対応する論理セクタ領域のLSNを書き込むようにしてもよい。   When making the above determination, data is written based on the LSN of the logical sector area corresponding to the data written in the top physical sector area 60 and the PSN of the last physical sector area 60 in which the data is written. The LSN of the logical sector area corresponding to the data stored in the last physical sector area 60 is obtained. Specifically, for example, by adding the PSN value of the last physical sector area where data is written to the LSN value of the logical sector area written to the top physical sector area 60 and corresponding to the data, The LSN of the logical sector area corresponding to the data stored in the last physical sector area where data is written is obtained. The memory controller 3 writes the LSN of the logical sector area corresponding to the data written in the physical sector area 60 in the divided redundant area 70 corresponding to the physical sector area 60 in which the end data of the series of data is written. It may be.

本実施形態では、書き込み処理が電源遮断等により書き込み途中で終了した場合を検知するため、一連のデータの末尾データが書き込まれた物理セクタ領域60に対応する分割冗長領域70に、書き込み処理が正常に終了したことを示す情報である終了マークが書き込まれる。但し、セクタ管理情報が書き込まれる場合には、セクタ管理情報が書き込まれた物理セクタ領域60に対応する分割冗長領域70、つまり、一連のデータの末尾データが書き込まれた物理セクタ領域60の次の物理セクタ領域60に対応した分割冗長領域70に、終了マークが書き込まれる。このようにすることにより、一連のデータの書き込みが終了した後、電源遮断等によりセクタ管理情報を書き込む前に書き込み処理が終了してしまったような場合に、メモリコントローラ3がセクタ管理情報を書き込まない場合に該当していると誤認することを回避することができる。   In the present embodiment, in order to detect a case where the writing process is terminated in the middle of the writing due to power interruption or the like, the writing process is normal in the divided redundant area 70 corresponding to the physical sector area 60 in which the end data of the series of data is written. An end mark, which is information indicating the end, is written. However, when the sector management information is written, the divided redundant area 70 corresponding to the physical sector area 60 in which the sector management information is written, that is, the next to the physical sector area 60 in which the end data of a series of data is written. An end mark is written in the divided redundant area 70 corresponding to the physical sector area 60. By doing so, the memory controller 3 writes the sector management information when the write processing is completed after the series of data has been written and before the sector management information is written due to power interruption or the like. Misunderstanding that this is the case can be avoided.

尚、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されていない場合、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60に記憶されているデータは、論理セクタ領域と物理セクタ領域60の対応関係に関する最新のセクタ管理情報でなければならない。従って、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されていない物理ブロックに対して一連のデータを書き込む際には、セクタ管理情報の更新が行われる。更新されたセクタ管理情報は、その一連のデータの末尾データが書き込まれた物理セクタ領域60の次の物理セクタ領域60に書き込まれる。このセクタ管理情報の更新では、書き込む一連のデータに対応する部分について、セクタ管理情報の内容が更新される。尚、本実施形態では、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報であるか否かを判別可能にするために、セクタ管理情報が書き込まれた物理セクタ領域60に対応する分割冗長領域70に、セクタ管理情報が書き込まれたことを意味するフラグ(以下、「管理フラグ」と言う)が書き込まれる。これにより、メモリコントローラ3は、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60に対応した分割冗長領域70に、管理フラグが記憶されているか否かにより、その末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報であるか否かを判断することができる。   If the “state where logical sector areas with continuous LSN are allocated” is not maintained, the data stored in the physical sector area 60 at the end where the data in the physical block is written is the logical sector. It must be the latest sector management information regarding the correspondence between the area and the physical sector area 60. Accordingly, when a series of data is written to a physical block that does not maintain the “state in which logical sector regions having continuous LSNs are allocated”, the sector management information is updated. The updated sector management information is written in the physical sector area 60 next to the physical sector area 60 in which the end data of the series of data is written. In updating the sector management information, the contents of the sector management information are updated for a portion corresponding to a series of data to be written. In this embodiment, in order to be able to determine whether or not the data stored in the last physical sector area 60 in which the data in the physical block is written is sector management information, the sector management information is A flag (hereinafter referred to as “management flag”) indicating that the sector management information has been written is written in the divided redundant area 70 corresponding to the written physical sector area 60. As a result, the memory controller 3 determines whether or not the last physical sector area depends on whether or not the management flag is stored in the divided redundant area 70 corresponding to the last physical sector area 60 in which data in the physical block is written. Whether the data stored in 60 is sector management information or not can be determined.

また、同一の物理ブロックに複数の一連のデータが連続的に書き込まれるような場合、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60からセクタ管理情報を読み出さずに、ワークエリア8に保持されているセクタ管理情報が、そのまま使用されるようにしてもよい。   Further, when a plurality of series of data is continuously written in the same physical block, the work area 8 is not read out from the last physical sector area 60 in which the data in the physical block is written. The sector management information held in the file may be used as it is.

ホストシステム4から書き込み指示と共に与えられるデータの容量が、書き込み先の物理ブロック(1個目の物理ブロック)内の空きセクタ領域の容量より大きい場合、メモリコントローラ3は、その物理ブロック内の最後尾の物理セクタ領域60の1セクタ前の物理セクタ領域60まで、ホストシステム4から与えられるデータを書き込み、最後尾の物理セクタ領域60には、その時点での論理セクタ領域と物理セクタ領域60の対応関係を示すセクタ管理情報を書き込む。残りのデータについては、新たに割り当てられた別の物理ブロック(2個目の物理ブロック)内の物理セクタ領域60に書き込まれる。つまり、1個目の物理ブロックの先頭の物理セクタ領域60から最後尾の物理セクタ領域60まで、論理ブロック内の各論理セクタ領域に対応するデータが全てLSNの順番で書き込まれる場合(先頭の論理セクタ領域に対応するデータからLSNの順番で書き込まれる場合)を除き、最後尾の物理セクタ領域60にはセクタ管理情報が書き込まれる。   When the capacity of data given from the host system 4 together with the write instruction is larger than the capacity of the empty sector area in the write destination physical block (first physical block), the memory controller 3 determines the end of the physical block. The data given from the host system 4 is written up to the physical sector area 60 one sector before the physical sector area 60, and the correspondence between the logical sector area and the physical sector area 60 at that time is written in the last physical sector area 60 Write sector management information indicating the relationship. The remaining data is written to the physical sector area 60 in another newly allocated physical block (second physical block). That is, when all the data corresponding to each logical sector area in the logical block from the first physical sector area 60 to the last physical sector area 60 in the first physical block is written in LSN order (first logical block Sector management information is written in the last physical sector area 60 (except when data is written in the order of LSN from the data corresponding to the sector area).

尚、一連のデータを書き込む際に、1個目の物理ブロック内の空きセクタ領域が最後尾の物理セクタ領域60だけの場合、その最後尾の物理セクタ領域60には一連のデータが書き込まれず、2個目の物理ブロックの先頭の物理セクタ領域60から一連のデータの書き込みが開始される。   When writing a series of data, if the empty sector area in the first physical block is only the last physical sector area 60, the series of data is not written in the last physical sector area 60. Writing of a series of data is started from the top physical sector area 60 of the second physical block.

以下、図4及び図5を参照して、本実施形態での書き込み処理の具体例を説明する。なお、一連のデータは、前述したように、PSNが小さい方から順番に書き込まれる。以下の説明では、n番目(nは自然数)に書き込まれる一連のデータを「第nの一連のデータ」と言う。   Hereinafter, a specific example of the writing process in the present embodiment will be described with reference to FIGS. 4 and 5. As described above, a series of data is written in order from the smallest PSN. In the following description, a series of data written in the nth (n is a natural number) is referred to as an “nth series of data”.

まず、ホストシステム4から与えられる第1の書き込み指示に基づいて、論理アクセス領域として、LBA#16−#31の16個の論理セクタ領域(LBN#0の論理ブロック内のLSN#16−#31の論理セクタ領域)が特定される。また、この論理アクセス領域が属する論理ブロックと対応する物理ブロックが無いため、この論理ブロックに対して新たな物理ブロックが割り当てられる。この物理ブロックには未だデータが書き込まれていないため、物理ブロック内のデータが書き込まれていない先頭の物理セクタ領域60として、物理ブロック内の先頭の物理セクタ領域60(PSN#0の物理セクタ領域60)が特定される。この先頭の物理セクタ領域60(PSN#0の物理セクタ領域60)から、第1の書き込み指示に対応する第1の一連のデータの書き込み処理が開始される。この結果、LSN#16−#31の16個の論理セクタ領域に対応する第1の一連のデータが、PSN#0−#15の16個の物理セクタ領域60に書き込まれる。また、第1の一連のデータの先頭データが書き込まれた物理セクタ領域60(PSN#0の物理セクタ領域60)に対応した分割冗長領域70に、その先頭データに対応する論理セクタ領域のLSN(LSN#16−#31の16個の論理セクタ領域のうちの先頭の論理セクタ領域のLSN)の値“#16”が書き込まれる(図4(A)参照)。   First, based on the first write instruction given from the host system 4, 16 logical sector areas of LBA # 16- # 31 (LSN # 16- # 31 in the logical block of LBN # 0) are used as logical access areas. Are determined). Since there is no physical block corresponding to the logical block to which this logical access area belongs, a new physical block is assigned to this logical block. Since no data has been written yet in this physical block, the first physical sector area 60 (PSN # 0 physical sector area) in the physical block is used as the first physical sector area 60 in which no data in the physical block is written. 60) is specified. From this top physical sector area 60 (PSN # 0 physical sector area 60), a first series of data write processing corresponding to the first write instruction is started. As a result, the first series of data corresponding to the 16 logical sector areas of LSN # 16- # 31 is written to the 16 physical sector areas 60 of PSN # 0- # 15. In addition, in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 0 physical sector area 60) where the first data of the first series of data is written, the LSN ( The value “# 16” of the LSN of the first logical sector area among the 16 logical sector areas of LSN # 16- # 31 is written (see FIG. 4A).

第1の一連のデータは、この物理ブロックに書き込まれる最初の一連のデータであるため、第1の一連のデータが書き込まれた段階では、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されている。このため、第1の一連のデータの末尾データが書き込まれた物理セクタ領域60(PSN#15の物理セクタ領域60)の次の物理セクタ領域60に、セクタ管理情報は書き込まれず、PSN#15の物理セクタ領域60に対応した分割冗長領域70に、終了マーク(EM(End Mark))が書き込まれる。   Since the first series of data is the first series of data to be written to this physical block, at the stage where the first series of data is written, “the logical sector area where the LSN is continuous is allocated. Is maintained. For this reason, sector management information is not written in the physical sector area 60 next to the physical sector area 60 (PSN # 15 physical sector area 60) in which the end data of the first series of data is written, and the PSN # 15 An end mark (EM (End Mark)) is written in the divided redundant area 70 corresponding to the physical sector area 60.

次に、ホストシステム4から与えられる第2の書き込み指示に基づいて、論理アクセス領域として、LBA#32−#47の16個の論理セクタ領域(LBN#0の論理ブロック内のLSN#32−#47の論理セクタ領域)が特定される。また、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60として、PSN#15の物理セクタ領域60が特定される。特定された末尾の物理セクタ領域60(PSN#15の物理セクタ領域60)の次の物理セクタ領域60(PSN#16の物理セクタ領域60)から、第2の書き込み指示に対応する第2の一連のデータの書き込みが開始される。この結果、LSN#32−#47の16個の論理セクタ領域に対応する第2の一連のデータが、PSN#16−#31の16個の物理セクタ領域60に書き込まれる。また、第2の一連のデータの先頭データが書き込まれている物理セクタ領域60(PSN#16の物理セクタ領域60)に対応した分割冗長領域70に、その先頭データに対応する論理セクタ領域のLSN(LSN#32−#47の16個の論理セクタ領域のうちの先頭の論理セクタ領域のLSN)の値“#32”が書き込まれる(図4(A)参照)。   Next, based on the second write instruction given from the host system 4, 16 logical sector areas LBA # 32- # 47 (LSN # 32- # in the logical block of LBN # 0) are used as logical access areas. 47 logical sector areas) are identified. Further, the physical sector area 60 of PSN # 15 is specified as the last physical sector area 60 in which data in the physical block is written. A second series corresponding to the second write instruction from the physical sector area 60 (PSN # 16 physical sector area 60) next to the identified end physical sector area 60 (PSN # 15 physical sector area 60). Writing of data is started. As a result, the second series of data corresponding to the 16 logical sector areas of LSN # 32- # 47 is written into the 16 physical sector areas 60 of PSN # 16- # 31. Also, the LSN of the logical sector area corresponding to the head data is added to the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 16 physical sector area 60) in which the head data of the second series of data is written. The value “# 32” of (the LSN of the first logical sector area among the 16 logical sector areas of LSN # 32- # 47) is written (see FIG. 4A).

この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60(PSN#15の物理セクタ領域60)に記憶されているデータがセクタ管理情報であるか否かが判断される。PSN#15の物理セクタ領域60に記憶されているデータはセクタ管理情報でないため、第1の論理セクタ領域(第2の一連のデータの先頭データに対応する論理セクタ領域)のLSNが、第2の論理セクタ領域(データが書き込まれている末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域)のLSNの次の番号であるか否かが判断される。具体的には、先頭の物理セクタ領域60に対応した分割冗長領域70に書き込まれているLSNの値“#16”に、データが書き込まれている末尾の物理セクタ領域60のPPNの値“#15”を加えた値である“#31”が、第2の論理セクタ領域のLSN として求められる。一方、第1の論理セクタ領域のLSNは“#32”なので、第1の論理セクタ領域のLSNは第2の論理セクタ領域のLSNの次の番号であると判断される。このように第1の論理セクタ領域のLSNが第2の論理セクタ領域のLSNの次の番号である場合、一連のデータを書き込んだ後も、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持される。   Whether or not the data stored in the last physical sector area 60 (physical sector area 60 of PSN # 15) in which data in the physical block is written is sector management information when the writing process is started Is judged. Since the data stored in the physical sector area 60 of PSN # 15 is not sector management information, the LSN of the first logical sector area (the logical sector area corresponding to the first data of the second series of data) is the second It is determined whether it is the next number of the LSN of the logical sector area (the logical sector area corresponding to the data stored in the last physical sector area 60 where the data is written). More specifically, the LSN value “# 16” written in the divided redundant area 70 corresponding to the top physical sector area 60 is added to the PPN value “#” of the last physical sector area 60 in which data is written. “# 31”, which is a value obtained by adding “15”, is obtained as the LSN of the second logical sector area. On the other hand, since the LSN of the first logical sector area is “# 32”, it is determined that the LSN of the first logical sector area is the next number after the LSN of the second logical sector area. As described above, when the LSN of the first logical sector area is the next number of the LSN of the second logical sector area, even after writing a series of data, “the logical sector area where the LSN continues is allocated. "State" is maintained.

この書き込み処理では、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されるため、第2の一連のデータの末尾データが書き込まれた物理セクタ領域60(PSN#31の物理セクタ領域60)の次の物理セクタ領域60にセクタ管理情報は書き込まれず、PSN#31の物理セクタ領域60に対応した分割冗長領域70に、終了マークが書き込まれる。   In this writing process, the “state in which logical sector areas having continuous LSNs are allocated” is maintained, so that the physical sector area 60 (PSN # 31 physical sector) in which the tail data of the second series of data is written is maintained. Sector management information is not written in the physical sector area 60 next to the area 60), and an end mark is written in the divided redundant area 70 corresponding to the physical sector area 60 of PSN # 31.

図4(A)に示すように、ホストシステム4から与えられる第3の書き込み指示と第4の書き込み指示にそれぞれ対応する第3の一連のデータと第4の一連のデータについても、第2の一連のデータと同様の書き込み処理が実行される。   As shown in FIG. 4A, the second series of data and the fourth series of data respectively corresponding to the third write instruction and the fourth write instruction given from the host system 4 are also the second A writing process similar to a series of data is executed.

次に、ホストシステム4から与えられる第5の書き込み指示に基づいて、論理アクセス領域として、LBA#0−#31の32個の論理セクタ領域(LBN#0の論理ブロック内のLSN#0−#31の論理セクタ領域)が特定される。また、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60として、PSN#95の物理セクタ領域60が特定される。特定された末尾の物理セクタ領域60(PSN#95の物理セクタ領域60)の次の物理セクタ領域60(PSN#96の物理セクタ領域60)から、第5の書き込み指示に対応する第5の一連のデータの書き込みが開始される。この結果、LSN#0−#31の32個の論理セクタ領域に対応する第5の一連のデータが、PSN#96−#127の32個の物理セクタ領域60に書き込まれる。また、第5の一連のデータの先頭データが書き込まれた物理セクタ領域60(PSN#96の物理セクタ領域60)に対応した分割冗長領域70に、その先頭データに対応する論理セクタ領域のLSN(LSN#96−#127の32個の論理セクタ領域のうちの先頭の論理セクタ領域のLSN)の値“#96”が書き込まれる(図4(A)参照)。   Next, based on the fifth write instruction given from the host system 4, 32 logical sector areas LBA # 0- # 31 (LSN # 0- # in the logical block of LBN # 0) are used as logical access areas. 31 logical sector areas) are identified. Further, the physical sector area 60 of PSN # 95 is specified as the last physical sector area 60 in which data in the physical block is written. The fifth series corresponding to the fifth write instruction from the physical sector area 60 (PSN # 96 physical sector area 60) next to the identified end physical sector area 60 (PSN # 95 physical sector area 60). Writing of data is started. As a result, the fifth series of data corresponding to the 32 logical sector areas of LSN # 0 to # 31 is written to the 32 physical sector areas 60 of PSN # 96 to # 127. In addition, in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 96 physical sector area 60) in which the top data of the fifth series of data is written, the LSN ( The value “# 96” of the LSN of the leading logical sector area among the 32 logical sector areas of LSN # 96- # 127 is written (see FIG. 4A).

この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60(PSN#31の物理セクタ領域60)に記憶されているデータがセクタ管理情報であるか否かが判断される。PSN#31の物理セクタ領域60に記憶されているデータはセクタ管理情報でないため、第1の論理セクタ領域(第5の一連のデータの先頭データに対応する論理セクタ領域)のLSNが、第2の論理セクタ領域(データが書き込まれている末尾の物理セクタ領域60に記憶されているデータ対応する論理セクタ領域)のLSNの次の番号であるか否かが判断される。具体的には、先頭の物理セクタ領域60に対応した分割冗長領域70に書き込まれているLSNの値“#16”に、データが書き込まれている末尾の物理セクタ領域のPPNの値“#95”を加えた値である“#111”が、第2の論理セクタ領域のLSNとして求められる。一方、第1の論理セクタ領域のLSN
は“#0”なので、第1の論理セクタ領域のLSNは第2の論理セクタ領域のLSNの次の番号でないと判断される。このように第1の論理セクタ領域のLSNが第2の論理セクタ領域のLSNの次の番号でない場合、一連のデータを書き込んだ後は、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されない。
Whether or not the data stored in the last physical sector area 60 (physical sector area 60 of PSN # 31) where the data in the physical block is written is sector management information when the writing process is started Is judged. Since the data stored in the physical sector area 60 of PSN # 31 is not sector management information, the LSN of the first logical sector area (the logical sector area corresponding to the first data of the fifth series of data) is the second It is determined whether it is the next number of the LSN of the logical sector area (the logical sector area corresponding to the data stored in the last physical sector area 60 where the data is written). Specifically, the LSN value “# 16” written in the divided redundant area 70 corresponding to the top physical sector area 60 is added to the PPN value “# 95” in the last physical sector area where data is written. “# 111” that is a value obtained by adding “” is obtained as the LSN of the second logical sector area. On the other hand, the LSN of the first logical sector area
Since “# 0”, it is determined that the LSN of the first logical sector area is not the next number of the LSN of the second logical sector area. As described above, when the LSN of the first logical sector area is not the next number of the LSN of the second logical sector area, after writing a series of data, “the logical sector area where the LSN continues is allocated. Is not maintained.

この書き込み処理では、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されないため、メモリコントローラ3は、第5の一連のデータの書き込みが終了したときに物理ブロックに記憶されている有効なデータに関する物理セクタ領域60と論理セクタ領域との対応関係を示すセクタ管理情報#0を作成する。ここでは、第5の一連のデータを書き込む前のデータが書き込まれている末尾の物理セクタ領域60(PSN#95の物理セクタ領域60)に記憶されているデータはセクタ管理情報でないため(PSN#95の物理セクタ領域60に対応した分割冗長領域70に管理フラグが書き込まれていないため)、新規にセクタ管理情報が作成される。具体的には、ワークエリア8上にLSN#0−255にそれぞれ対応する256個のレコードを有するテーブル作成領域が確保され、このテーブル作成領域の各レコードにPSNが書き込まれる。図5(A)に示したようなセクタ管理情報#0を作成する場合には、まず、第1〜4の一連のデータとしてPSN#0−#95の物理セクタ領域60に書き込まれたLSN#16−#111の論理セクタ領域に対応するデータに関するPSNの書き込みが行われる。つまり、LSN#16−#111に対応したレコードに、#0−#95の番号(PSNの値)が書き込まれる。次に、第5の一連のデータとしてPSN#96−#127の物理セクタ領域60に書き込まれるLSN#0−31の論理セクタ領域に対応するデータに関するPSNの書き込みが行われる。つまり、LSN#0−31に対応したレコードに#96−#127の番号(PSNの値)が書き込まれる。この際、LSN#16−31に対応したレコードには、#112−#127の番号(PSNの値)が上書きされ、有効なデータに関する物理セクタ領域60と論理セクタ領域との対応関係だけが残る。つまり、無効なデータに関する物理セクタ領域60と論理セクタ領域との対応関係は、有効なデータに関する物理セクタ領域60と論理セクタ領域との対応関係で上書きされる。これにより、図5(A)に示したようなセクタ管理情報#0の作成処理が完了する。   In this writing process, the “state in which logical sector areas with continuous LSNs are allocated” is not maintained, so that the memory controller 3 is stored in the physical block when the fifth series of data writing is completed. Sector management information # 0 indicating the correspondence between the physical sector area 60 and the logical sector area related to valid data is created. Here, since the data stored in the last physical sector area 60 (the physical sector area 60 of PSN # 95) in which the data before the fifth series of data is written is not sector management information (PSN #) Since the management flag is not written in the divided redundant area 70 corresponding to 95 physical sector areas 60), new sector management information is created. Specifically, a table creation area having 256 records respectively corresponding to LSN # 0-255 is secured on the work area 8, and a PSN is written in each record of this table creation area. When the sector management information # 0 as shown in FIG. 5A is created, first, the LSN # written in the physical sector area 60 of PSN # 0 to # 95 as the first to fourth series of data. The PSN for data corresponding to the 16- # 111 logical sector area is written. That is, # 0- # 95 numbers (PSN values) are written in records corresponding to LSN # 16- # 111. Next, the PSN is written for the data corresponding to the logical sector area of LSN # 0-31 written to the physical sector area 60 of PSN # 96- # 127 as the fifth series of data. That is, the numbers # 96 to # 127 (PSN values) are written in the records corresponding to LSN # 0 to 31. At this time, the record corresponding to LSN # 16-31 is overwritten with the number (PSN value) of # 112- # 127, and only the correspondence between the physical sector area 60 and the logical sector area relating to valid data remains. . That is, the correspondence between the physical sector area 60 and the logical sector area related to invalid data is overwritten by the correspondence between the physical sector area 60 and the logical sector area related to valid data. Thereby, the creation process of the sector management information # 0 as shown in FIG.

メモリコントローラ3は、作成したセクタ管理情報#0を、第5の一連のデータの末尾データが書き込まれた物理セクタ領域60(PSN#127の物理セクタ領域60)の次の物理セクタ領域60(PSN#128の物理セクタ領域60)に書き込む。また、セクタ管理情報#0が書き込まれた物理セクタ領域60(PSN#128の物理セクタ領域60)に対応した分割冗長領域70に、図示しない管理フラグと、前述した終了マークとが書き込まれる(図4(B)参照)。   The memory controller 3 uses the created sector management information # 0 as the physical sector area 60 (PSN) next to the physical sector area 60 (physical sector area 60 of PSN # 127) in which the end data of the fifth series of data is written. Write to the physical sector area 60) of # 128. In addition, a management flag (not shown) and the above-described end mark are written in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 128 physical sector area 60) in which the sector management information # 0 is written (see FIG. 4 (B)).

尚、一度でもセクタ管理情報が書き込まれた物理ブロックについては、その物理ブロックに一連のデータが書き込まれる毎にセクタ管理情報が書き込まれる。なぜなら、一度でもセクタ管理情報が書き込まれた物理ブロックは、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されていないからである。   For a physical block in which sector management information has been written even once, the sector management information is written each time a series of data is written to the physical block. This is because the physical block in which the sector management information is written even once does not maintain the “state in which logical sector areas with continuous LSN are allocated”.

次に、ホストシステム4から与えられる第6の書き込み指示に基づいて、論理アクセス領域として、LBA#16−#31の16個の論理セクタ領域(LBN#0の論理ブロック内のLSN#16−#31の論理セクタ領域)が特定される。また、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60として、PSN#128の物理セクタ領域60が特定される。特定された末尾の物理セクタ領域60(PSN#128の物理セクタ領域60)の次の物理セクタ領域60(PSN#129の物理セクタ領域60)から、第6の書き込み指示に対応する第6の一連のデータの書き込みが開始される。この結果、LSN#16−#31の16個の論理セクタ領域に対応する第6の一連のデータが、PSN#129−#144の16個の物理セクタ領域60に書き込まれる。また、第6の一連のデータの先頭データが書き込まれた物理セクタ領域60(PSN#129の物理セクタ領域60)に対応した分割冗長領域70に、その先頭データに対応する論理セクタ領域のLSN(LSN#16−#31の16個の論理セクタ領域のうちの先頭の論理セクタ領域のLSN)の値“#31”が書き込まれる(図4(B)参照)。   Next, based on the sixth write instruction given from the host system 4, 16 logical sector areas LBA # 16- # 31 (LSN # 16- # in the logical block of LBN # 0) are used as logical access areas. 31 logical sector areas) are identified. Further, the physical sector area 60 of PSN # 128 is specified as the last physical sector area 60 in which data in the physical block is written. A sixth series corresponding to the sixth write instruction from the physical sector area 60 (physical sector area 60 of PSN # 129) next to the identified last physical sector area 60 (physical sector area 60 of PSN # 128). Writing of data is started. As a result, the sixth series of data corresponding to the 16 logical sector areas of LSN # 16- # 31 is written to the 16 physical sector areas 60 of PSN # 129- # 144. In addition, the LSN (in the logical sector area corresponding to the head data is added to the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 129 physical sector area 60) in which the head data of the sixth series of data is written. The value “# 31” of the LSN of the first logical sector area among the 16 logical sector areas of LSN # 16- # 31 is written (see FIG. 4B).

この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60(PSN#128の物理セクタ領域60)に記憶されているデータがセクタ管理情報であるか否かが判断される。PSN#128の物理セクタ領域60に対応した分割冗長領域70に管理フラグが書き込まれているため、PSN#128の物理セクタ領域60に記憶されているデータがセクタ管理情報であると判断される。この判断は、この時点で、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持されていないことを意味する。   Whether or not the data stored in the last physical sector area 60 (physical sector area 60 of PSN # 128) in which data in the physical block is written is the sector management information when starting the writing process Is judged. Since the management flag is written in the divided redundant area 70 corresponding to the physical sector area 60 of PSN # 128, it is determined that the data stored in the physical sector area 60 of PSN # 128 is sector management information. This determination means that, at this point, the “state in which logical sector regions having continuous LSNs are allocated” is not maintained.

従って、第6の一連のデータの書き込みが終了したときの物理セクタ領域60と論理セクタ領域との対応関係を示すセクタ管理情報#1が作成される。このセクタ管理情報#1は、セクタ管理情報#0に基づいて作成される。つまり、この作成処理では、第6の一連のデータに対応する部分について、セクタ管理情報#0の内容が更新される。尚、ワークエリア8上にセクタ管理情報#0が保持されていない場合には、セクタ管理情報#1を作成するために、セクタ管理情報#0がPSN#128の物理セクタ領域60からワークエリア8に読み出される。   Therefore, sector management information # 1 indicating the correspondence between the physical sector area 60 and the logical sector area when the writing of the sixth series of data is completed is created. The sector management information # 1 is created based on the sector management information # 0. That is, in this creation process, the contents of sector management information # 0 are updated for the portion corresponding to the sixth series of data. If the sector management information # 0 is not held on the work area 8, the sector management information # 0 is transferred from the physical sector area 60 of the PSN # 128 to the work area 8 in order to create the sector management information # 1. Is read out.

具体的には、図5(B)に示すように、セクタ管理情報#0における、LSN#16−#31に対応するレコードに、第6の一連のデータが書き込まれた16個の物理セクタ領域60に対応したPSNが書き込まれる。つまり、セクタ管理情報#1の作成処理では、セクタ管理情報#0のLSN#16−#31に対応するレコードに、#129−#144の番号(PSNの値)が上書きされる。作成されたセクタ管理情報#1は、第6の一連のデータの末尾データが書き込まれた物理セクタ領域60(PSN#144の物理セクタ領域60)の次の物理セクタ領域60(PSN#145の物理セクタ領域60)に書き込まれる。また、セクタ管理情報#1が書き込まれた物理セクタ領域60(PSN#145の物理セクタ領域60)に対応した分割冗長領域70に、図示しない管理フラグと前述した終了フラグとが書き込まれる。   Specifically, as shown in FIG. 5B, 16 physical sector areas in which a sixth series of data is written in records corresponding to LSN # 16- # 31 in sector management information # 0. PSN corresponding to 60 is written. That is, in the process of creating sector management information # 1, the number (PSN value) of # 129- # 144 is overwritten on the record corresponding to LSN # 16- # 31 of sector management information # 0. The created sector management information # 1 is the physical sector area 60 (PSN # 145 physical) next to the physical sector area 60 (PSN # 144 physical sector area 60) in which the end data of the sixth series of data is written. It is written in the sector area 60). Further, a management flag (not shown) and the above-described end flag are written in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 145 physical sector area 60) in which the sector management information # 1 is written.

以後、同様にして、ホストシステム4から与えられる第7及び第8の書き込み指示にそれぞれ対応する第7及び第8の一連のデータ並びにセクタ管理情報#2及び#3がそれぞれ同一の物理ブロックに書き込まれる。   Thereafter, similarly, the seventh and eighth series of data and the sector management information # 2 and # 3 respectively corresponding to the seventh and eighth write instructions given from the host system 4 are written in the same physical block. It is.

すなわち、LBA#80−#95の16個の論理セクタ領域(LBN#0の論理ブロック内のLSN#80−#95の論理セクタ領域)に対応する第7の一連のデータが、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60(PSN#145の物理セクタ領域60)の次の物理セクタ領域60(PSN#146の物理セクタ領域60)以降の16個の物理セクタ領域60(PSN#146−161の物理セクタ領域60)に書き込まれる(図4(B)参照)。また、第7の一連のデータの先頭データが書き込まれた物理セクタ領域60(PSN#146の物理セクタ領域60)に対応した分割冗長領域70に、その先頭データに対応する論理セクタ領域のLSN(LSN#80−#95の16個の論理セクタ領域のうちの先頭の論理セクタ領域のLSN)の値“#80”が書き込まれる。また、第7の一連のデータが書き込まれる前のデータが書き込まれている末尾の物理セクタ領域60(PSN#145の物理セクタ領域60)に記憶されているセクタ管理情報#1に基づいて、セクタ管理情報#2が作成される。具体的には、図5(C)に示すように、セクタ管理情報#1における、LSN#80−#95に対応するレコードに、第7の一連のデータが書き込まれた16個の物理セクタ領域60に対応したPSNである#146−161が上書きされる。このようにして作成されたセクタ管理情報#2は、第7の一連のデータの末尾データが書き込まれた物理セクタ領域60(PSN#161の物理セクタ領域60)の次の物理セクタ領域60(PSN#162の物理セクタ領域60)に書き込まれる。また、セクタ管理情報#2が書き込まれた物理セクタ領域60(PSN#162の物理セクタ領域60)に対応した分割冗長領域70に、図示しない管理フラグと前述した終了フラグとが書き込まれる。   That is, the seventh series of data corresponding to the 16 logical sector areas of LBA # 80- # 95 (the logical sector area of LSN # 80- # 95 in the logical block of LBN # 0) is stored in the physical block. Sixteen physical sector areas 60 (PSN) after the physical sector area 60 (PSN # 146 physical sector area 60) following the last physical sector area 60 (PSN # 145 physical sector area 60) in which data is written Is written in the physical sector area 60 of # 146-161 (see FIG. 4B). In addition, in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 146 physical sector area 60) in which the top data of the seventh series of data is written, the LSN ( A value “# 80” of the LSN of the first logical sector area among the 16 logical sector areas of LSN # 80- # 95 is written. Further, based on the sector management information # 1 stored in the last physical sector area 60 (the physical sector area 60 of PSN # 145) where the data before the seventh series of data is written, Management information # 2 is created. Specifically, as shown in FIG. 5C, 16 physical sector areas in which a seventh series of data is written in records corresponding to LSN # 80- # 95 in the sector management information # 1. # 146-161 which is PSN corresponding to 60 is overwritten. The sector management information # 2 created in this way is the physical sector area 60 (PSN) next to the physical sector area 60 (PSN # 161 physical sector area 60) in which the end data of the seventh series of data is written. It is written in the physical sector area 60) of # 162. In addition, a management flag (not shown) and the above-described end flag are written in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 162 physical sector area 60) in which the sector management information # 2 is written.

次に、LBA#96−#127の32個の論理セクタ領域(LBN#0の論理ブロック内のLSN#96−#127の論理セクタ領域)に対応した第8の一連のデータが、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60(PSN#162の物理セクタ領域60)の次の物理セクタ領域60(PSN#163の物理セクタ領域60)以降の32個の物理セクタ領域60(PSN#163−194の物理セクタ領域60)に書き込まれる(図4(B)参照)。また、第8の一連のデータの先頭データが書き込まれた物理セクタ領域60(PSN#163の物理セクタ領域60)に対応した分割冗長領域70に、その先頭データに対応する論理セクタ領域のLSN(LSN#96−#127の32個の論理セクタ領域のうちの先頭の論理セクタ領域のLSN)の値“#96”が書き込まれる。また、第8の一連のデータが書き込まれる前のデータが書き込まれている末尾の物理セクタ領域60(PSN#162の物理セクタ領域60)に記憶されているセクタ管理情報#2に基づいて、セクタ管理情報#3が作成される。具体的には、図5(D)に示すように、セクタ管理情報#2における、LSN#96−#127に対応するレコードに、第8の一連のデータが書き込まれた32個の物理セクタ領域60に対応したPSNである#163−194が上書きされる。このようにして作成されたセクタ管理情報#3は、第8の一連のデータの末尾データが書き込まれた物理セクタ領域60(PSN#194の物理セクタ領域60)の次の物理セクタ領域60(PSN#195の物理セクタ領域60)に書き込まれる。また、セクタ管理情報#3が書き込まれた物理セクタ領域60(PSN#195の物理セクタ領域60)に対応した分割冗長領域70に、図示しない管理フラグと前述した終了フラグとが書き込まれる。   Next, an eighth series of data corresponding to the 32 logical sector areas of LBA # 96- # 127 (the logical sector area of LSN # 96- # 127 in the logical block of LBN # 0) is stored in the physical block. 32 physical sector areas 60 (after the physical sector area 60 (PSN # 163 physical sector area 60)) following the physical sector area 60 (PSN # 162 physical sector area 60) to which the last data is written. It is written in the physical sector area 60) of PSN # 163-194 (see FIG. 4B). In addition, in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 163 physical sector area 60) in which the top data of the eighth series of data is written, the LSN ( A value “# 96” of the LSN of the first logical sector area among the 32 logical sector areas of LSN # 96- # 127 is written. Further, based on the sector management information # 2 stored in the last physical sector area 60 (the physical sector area 60 of PSN # 162) where the data before the eighth series of data is written is written Management information # 3 is created. Specifically, as shown in FIG. 5D, 32 physical sector areas in which an eighth series of data is written in records corresponding to LSN # 96- # 127 in the sector management information # 2. # 163-194 which is PSN corresponding to 60 is overwritten. The sector management information # 3 created in this way is the physical sector area 60 (PSN) next to the physical sector area 60 (PSN # 194 physical sector area 60) in which the tail data of the eighth series of data is written. It is written in the physical sector area # 195). Further, a management flag (not shown) and the above-described end flag are written in the divided redundant area 70 corresponding to the physical sector area 60 (PSN # 195 physical sector area 60) in which the sector management information # 3 is written.

さて、この後、物理ブロックから各物理セクタ領域60に格納されているデータを読み出すときには、メモリコントローラ3は、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60(PSN#195の物理セクタ領域60)からセクタ管理情報#3を読み出し、このセクタ管理情報#3に基づいて論理セクタ領域と物理セクタ領域60の対応関係を把握する。ここでは、PSN#195の物理セクタ領域60に書き込まれているセクタ管理情報#3が、論理セクタ領域と物理セクタ領域60の最新の対応関係を示しているため、メモリコントローラ3は、そのセクタ管理情報#5を参照するだけで、論理セクタ領域と物理セクタ領域60の最新の対応関係を把握することができる。つまり、本実施形態によれば、効率的に、論理セクタ領域と物理セクタ領域60の対応関係を把握することができる。   After that, when data stored in each physical sector area 60 is read from the physical block, the memory controller 3 reads the physical sector area 60 (PSN # 195 physical data) at the end where the data in the physical block is written. The sector management information # 3 is read from the sector area 60), and the correspondence between the logical sector area and the physical sector area 60 is grasped based on the sector management information # 3. Here, since the sector management information # 3 written in the physical sector area 60 of PSN # 195 indicates the latest correspondence relationship between the logical sector area and the physical sector area 60, the memory controller 3 performs the sector management. The latest correspondence between the logical sector area and the physical sector area 60 can be grasped only by referring to the information # 5. That is, according to the present embodiment, the correspondence relationship between the logical sector area and the physical sector area 60 can be grasped efficiently.

尚、第1の一連のデータが書き込まれてから第5の一連のデータが書き込まれる前までの間に(つまりセクタ管理情報が全く書き込まれていない場合に)、物理ブロックからデータを読み出すときには、メモリコントローラ3は、物理ブロック内の先頭の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域(LSN#16の論理セクタ領域)以降の論理セクタ領域に対応するデータがLSNの順番で、この物理ブロック内の物理セクタ領域60に書き込まれていると判断して、論理セクタ領域と物理セクタ領域60の対応関係を把握する。また、物理ブロック内の先頭の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNについては、先頭の物理セクタ領域60に対応した分割冗長領域70に書き込まれているLSNにより把握される。   When data is read from the physical block between the time when the first series of data is written and before the time when the fifth series of data is written (that is, when no sector management information is written) The memory controller 3 reads the data corresponding to the logical sector area after the logical sector area (LSN # 16 logical sector area) corresponding to the data stored in the first physical sector area 60 in the physical block in the order of LSN. Therefore, it is determined that the data is written in the physical sector area 60 in the physical block, and the correspondence between the logical sector area and the physical sector area 60 is grasped. Further, the LSN of the logical sector area corresponding to the data stored in the head physical sector area 60 in the physical block is grasped by the LSN written in the divided redundant area 70 corresponding to the head physical sector area 60. Is done.

以上が、第一の実施形態の説明である。   The above is the description of the first embodiment.

なお、セクタ管理情報は、前述したような、論理セクタ領域と物理セクタ領域60の対応関係を示すテーブルであることが好ましいが、一変形例として、物理ブロックに書き込まれているそれぞれの一連のデータの先頭データに対応する論理セクタ領域の論理セクタ番号であるスタート論理セクタ番号(以下、「SLSN」と言う)と、その先頭データが書き込まれている物理セクタ領域60の物理セクタ番号であるスタート物理セクタ番号(以下、「SPSN」と言う)と、その一連のデータのセクタ数(以下、「SCNT」と言う)とを示す情報であってもよい。このような情報が書き込まれている場合には、この情報に基づいて、論理セクタ領域と物理セクタ領域60の対応関係を示すテーブルが作成される。   The sector management information is preferably a table indicating the correspondence between the logical sector area and the physical sector area 60 as described above, but as a modification, each series of data written in the physical block The start logical sector number (hereinafter referred to as “SLSN”) that is the logical sector number of the logical sector area corresponding to the top data of the start data and the start physical sector that is the physical sector number of the physical sector area 60 in which the top data is written Information indicating a sector number (hereinafter referred to as “SPSN”) and the number of sectors of the series of data (hereinafter referred to as “SCNT”) may be used. When such information is written, a table showing the correspondence between the logical sector area and the physical sector area 60 is created based on this information.

例えば、図6(A)〜(D)は、セクタ管理情報#0〜#3のそれぞれの変形例であるセクタ管理情報#0´〜#3´をそれぞれ示している。セクタ管理情報#0´〜#3´において、第nのSLSN、SPSN及びSCNTの組は、第nの一連のデータに対応する。尚、物理ブロック内の先頭の物理セクタ領域60からLSNの順番でデータが書き込まれている部分については、複数個の一連のデータに対応する部分が、1つの情報としてまとめられてもよい。例えば、第1乃至第4の一連のデータに対応する部分が、SLSNが#16、SPSNが#0、SCNTが96というような1つの情報にまとめられてもよい。   For example, FIGS. 6A to 6D show sector management information # 0 ′ to # 3 ′, which are modifications of the sector management information # 0 to # 3, respectively. In the sector management information # 0 ′ to # 3 ′, the set of the nth SLSN, SPSN, and SCNT corresponds to the nth series of data. As for a portion where data is written in the order of LSN from the first physical sector region 60 in the physical block, a portion corresponding to a plurality of series of data may be collected as one piece of information. For example, the portions corresponding to the first to fourth series of data may be combined into one piece of information such as SLSN # 16, SPSN # 0, and SCNT 96.

この変形例では、論理セクタ領域と物理セクタ領域60の最新の対応関係を示すテーブルは、最新のセクタ管理情報に基づいて作成される。この作成処理では、後から書き込まれた一連のデータに対応する論理セクタ領域と物理セクタ領域60の対応関係が優先されるようにして、LSN#0−#255の256個の論理セクタ番号に対応したレコードに物理セクタ番号(PSN)が書き込まれていく。つまり、各レコードに書き込まれる物理セクタ番号(PSN)については、後から書き込まれた一連のデータに対応する物理セクタ番号(PSN)の方が上書きされるようにすればよい。尚、論理セクタ領域と物理セクタ領域60の対応関係は、SLSN、SPSN及びSCNTの組に基づいて把握される。   In this modification, a table indicating the latest correspondence relationship between the logical sector area and the physical sector area 60 is created based on the latest sector management information. In this creation process, priority is given to the correspondence relationship between the logical sector area corresponding to a series of data written later and the physical sector area 60, and it corresponds to 256 logical sector numbers LSN # 0 to # 255. The physical sector number (PSN) is written in the recorded record. In other words, the physical sector number (PSN) written in each record may be overwritten with the physical sector number (PSN) corresponding to a series of data written later. The correspondence relationship between the logical sector area and the physical sector area 60 is grasped based on a set of SLSN, SPSN, and SCNT.

例えば、セクタ管理情報#3´に基づいて、図5(D)に示したようなテーブルが作成される。このテーブル作成処理では、それぞれの一連のデータに対応する論理セクタ領域と物理セクタ領域60の対応関係に基づいて、各レコードに物理セクタ番号(PSN)が書き込まれていく。この物理セクタ番号(PSN)の書き込みは、先に書き込まれた一連のデータに対応する方から順番に行われ、書き込み先のレコードに既に物理セクタ番号(PSN)が書き込まれていても、後から物理セクタ番号(PSN)が上書きされる。従って、後から書き込まれた一連のデータに対応する論理セクタ領域と物理セクタ領域60の対応関係を優先したテーブルが作成される。   For example, a table as shown in FIG. 5D is created based on the sector management information # 3 ′. In this table creation process, a physical sector number (PSN) is written in each record based on the correspondence between the logical sector area and the physical sector area 60 corresponding to each series of data. The writing of the physical sector number (PSN) is performed in order from the one corresponding to the previously written series of data. Even if the physical sector number (PSN) has already been written in the write destination record, The physical sector number (PSN) is overwritten. Accordingly, a table is created in which the correspondence between the logical sector area and the physical sector area 60 corresponding to a series of data written later is prioritized.

<第2の実施形態>   <Second Embodiment>

以下、本発明の第2の実施形態を説明する。その際、第1の実施形態との相違点を主に説明し、第1の実施形態との共通点については説明を省略或いは簡略する。   Hereinafter, a second embodiment of the present invention will be described. In that case, the difference from the first embodiment will be mainly described, and the description of the common points with the first embodiment will be omitted or simplified.

第2の実施形態では、論理ブロック内の論理セクタ領域を先頭から順番に1個の物理ページ60に含まれるユーザ領域25の容量と等しいセクタ数単位でまとめたものを論理ページとして取り扱い、ページ単位(1個の物理ページに含まれるユーザ領域25の容量と等しいセクタ数単位)で論理ブロックに含まれる論理ページと物理ブロックに含まれる物理ページとの対応関係を管理する。以下の説明で、各物理ブロック内の物理ページに付けた通し番号を物理ページ番号(PPN)と言う。又、各論理ブロック内の論理ページに付けた通し番号を論理ページ番号(LPN)と言う。尚、複数個の物理ブロックを集めたグループを構成し、このグループに対して1個の論理ブロックを割り当てるような場合には、複数個の物理ページに対して1個の論理ページを割り当てるようにしてもよい。この場合、論理ページの容量は、複数個の物理ページに含まれるユーザ領域25の容量と等しくなる。   In the second embodiment, logical sector areas in a logical block, which are grouped in units of sectors equal to the capacity of the user area 25 included in one physical page 60 in order from the top, are treated as logical pages, The correspondence relationship between the logical page included in the logical block and the physical page included in the physical block is managed in units of sectors equal to the capacity of the user area 25 included in one physical page. In the following description, a serial number assigned to a physical page in each physical block is referred to as a physical page number (PPN). A serial number assigned to a logical page in each logical block is called a logical page number (LPN). When a group is formed by collecting a plurality of physical blocks and one logical block is allocated to this group, one logical page is allocated to a plurality of physical pages. May be. In this case, the capacity of the logical page is equal to the capacity of the user area 25 included in a plurality of physical pages.

本実施形態では、1個の物理ページが4セクタ(2048バイト)のユーザ領域25で構成され(1個の物理ページに4個の物理セクタ領域60含まれ)、1個の物理ブロックが64個の物理ページで構成されているNAND型フラッシュメモリを用いる。尚、図2に示したように、各物理ページに含まれる4個の物理セクタ領域60については、先頭から順番に(カラムアドレスが小さい方から順番に)、第1物理セクタ領域60a、第2物理セクタ領域60b、第3物理セクタ領域60c、第4物理セクタ領域60dと言う。ここで、PPN#0の物理ページに含まれる第1物理セクタ領域60aがPSN#0の物理セクタ領域に対応し、PPN#0の物理ページに含まれる第2物理セクタ領域60bがPSN#1の物理セクタ領域に対応し、PPN#0の物理ページに含まれる第3物理セクタ領域60cがPSN#2の物理セクタ領域に対応し、PPN#0の物理ページに含まれる第4物理セクタ領域60dがPSN#3の物理セクタ領域に対応する。PPN#1の物理ページに含まれる第1物理セクタ領域60a、第2物理セクタ領域60b、第3物理セクタ領域60c及び第4物理セクタ領域60dには、PSN#4−#7の物理セクタ領域がそれぞれ対応し、以下同様の対応関係で、PPN#63の物理ページに含まれる第1物理セクタ領域60a、第2物理セクタ領域60b、第3物理セクタ領域60c及び第4物理セクタ領域60dには、PSN#252−#255の物理セクタ領域がそれぞれ対応する。   In the present embodiment, one physical page is configured by the user area 25 of 4 sectors (2048 bytes) (4 physical sector areas 60 are included in one physical page), and 64 physical blocks are included. NAND type flash memory composed of physical pages is used. As shown in FIG. 2, with respect to the four physical sector areas 60 included in each physical page, the first physical sector area 60a, the second physical sector area 60a, and the second physical sector area 60a are arranged in order from the top (in order from the smallest column address). They are referred to as a physical sector area 60b, a third physical sector area 60c, and a fourth physical sector area 60d. Here, the first physical sector area 60a included in the physical page of PPN # 0 corresponds to the physical sector area of PSN # 0, and the second physical sector area 60b included in the physical page of PPN # 0 is PSN # 1. Corresponding to the physical sector area, the third physical sector area 60c included in the physical page of PPN # 0 corresponds to the physical sector area of PSN # 2, and the fourth physical sector area 60d included in the physical page of PPN # 0 is included. This corresponds to the physical sector area of PSN # 3. The first physical sector area 60a, the second physical sector area 60b, the third physical sector area 60c, and the fourth physical sector area 60d included in the physical page of the PPN # 1 include the physical sector areas of PSN # 4- # 7. The first physical sector area 60a, the second physical sector area 60b, the third physical sector area 60c, and the fourth physical sector area 60d included in the physical page of the PPN # 63 have the same corresponding relationship. The physical sector areas of PSN # 252- # 255 correspond to each other.

また、各論理ページには4個の論理セクタ領域が含まれる。LPN#0の論理ページには、LSN#0−#3の論理セクタ領域が含まれ、LPN#1の論理ページには、LSN#4−#7の論理セクタ領域が含まれ、以下同様に順次割り当てられ、LPN#63の論理ページには、LSN#252−#255の論理セクタ領域が含まれる。各論理ページに含まれる4個の論理セクタ領域は、各物理ページに含まれる4個の物理セクタ領域(第1物理セクタ領域60a、第2物理セクタ領域60b、第3物理セクタ領域60c及び第4物理セクタ領域60d)に対して、LSNが小さい方から順番に割り当てられる。   Each logical page includes four logical sector areas. The LPN # 0 logical page includes LSN # 0- # 3 logical sector areas, the LPN # 1 logical page includes LSN # 4- # 7 logical sector areas, and so on. The allocated logical page of LPN # 63 includes the logical sector area of LSN # 252- # 255. The four logical sector areas included in each logical page are divided into four physical sector areas (first physical sector area 60a, second physical sector area 60b, third physical sector area 60c, and fourth physical area included in each physical page. The physical sector area 60d) is assigned in order from the smallest LSN.

第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ビットに対応する。   In the second embodiment, the correspondence relationship between the logical page and the physical page changes, but the relative relationship between the four physical sector areas 60 in the physical page and the four logical sector areas in the logical page changes. do not do. Therefore, in the second embodiment, by managing the correspondence between logical pages and physical pages, 256 logical sector areas included in the logical block and 256 physical sector areas 60 included in the physical block are Correspondence can be managed. That is, as in the present embodiment, if four physical sector areas 60 are included in one physical page, the physical sector area so that the lower 2 bits of the PSN and the lower 2 bits of the LSN always match. Correspondence between 60 and the logical sector area is defined. That is, the data corresponding to the LSN whose lower 2 bits are 00 is stored in the first physical sector 60a, the data corresponding to the LSN whose lower 2 bits are 01 is stored in the second physical sector 60b, and the lower 2 bits are 10 The data corresponding to the LSN is stored in the third physical sector, and the data corresponding to the LSN having the lower 2 bits of 11 is stored in the fourth physical sector. The logical page number (LPN) corresponds to the upper 6 bits of the 8-bit LSN, and the physical page number corresponds to the upper 6 bits of the 8-bit PSN.

以下、本実施形態での書き込みの概要を説明する。   Hereinafter, an outline of writing in this embodiment will be described.

メモリコントローラ3は、ホストシステム4から与えられる書き込み指示(書き込みコマンド及び書き込み先のアドレス)に従って、この書き込み指示と共に与えられる一連のデータを、フラッシュメモリ2に書き込む。この書き込み処理では、書き込み先の論理ページが属する論理ブロックが特定され、その論理ブロックに対応する物理ブロック(又は、この論理ブロックに対して新たに割り当てた物理ブロック)に、一連のデータが書き込まれる。物理ブロック内の物理ページには、先頭から順番に(つまりPPNが小さいほうから順番に)一連のデータが書き込まれていく。従って、メモリコントローラ3が一連のデータを書き込むときには、物理ブロック内のデータが書き込まれている物理ページの末尾の検索が行われる。そして、その末尾の物理ページの次の物理ページから一連のデータが順次書き込まれていく。言い換えれば、物理ブロック内のデータが書き込まれていない先頭の物理ページから一連のデータが順次書き込まれていく。   The memory controller 3 writes a series of data given together with the write instruction to the flash memory 2 in accordance with a write instruction (write command and write destination address) given from the host system 4. In this writing process, the logical block to which the logical page to be written belongs is specified, and a series of data is written to the physical block corresponding to the logical block (or a physical block newly assigned to the logical block). . A series of data is written to the physical pages in the physical block in order from the top (that is, in order from the smallest PPN). Therefore, when the memory controller 3 writes a series of data, the end of the physical page in which the data in the physical block is written is searched. Then, a series of data is sequentially written from the physical page next to the last physical page. In other words, a series of data is sequentially written from the first physical page in which data in the physical block is not written.

本実施形態では、一連のデータの末尾データが書き込まれた物理ページの次の物理ページに、論理ページと物理ページの対応関係を示す情報(以下、「ページ管理情報」と言う)、例えば、論理ページと物理ページの対応関係を示すテーブルが書き込まれる。つまり、ページ管理情報は、ホストシステム4から書き込み指示と共に与えられる一連のデータと同様に、物理ページのユーザ領域25に書き込まれる。従って、物理ブロック内のデータが書き込まれている物理ページの末尾の検索し、その物理ページからページ管理情報を読み出すことにより、メモリコントローラ3は、論理ページと物理ページの対応関係を把握することができる。本実施形態におけるページ管理情報は、例えば、64個の論理ページの論理ページ番号にそれぞれ対応する64個のレコードを有するテーブルである(例えば、後述の図8(A)参照)。   In the present embodiment, information indicating the correspondence between a logical page and a physical page (hereinafter referred to as “page management information”), such as logical A table indicating the correspondence between pages and physical pages is written. That is, the page management information is written in the user area 25 of the physical page, like the series of data given from the host system 4 together with the write instruction. Therefore, the memory controller 3 can grasp the correspondence between the logical page and the physical page by searching the end of the physical page in which data in the physical block is written and reading the page management information from the physical page. it can. The page management information in this embodiment is, for example, a table having 64 records respectively corresponding to the logical page numbers of 64 logical pages (see, for example, FIG. 8A described later).

本実施形態では、一連のデータを書き込む際に、その一連のデータを書き込む物理ブロック内の物理ページにページ管理情報を書き込むか否かを決定するために、一連のデータの先頭データに対応する論理ページ(以下、「第1の論理ページ」と言う)が、その一連のデータを書き込む物理ブロック内のデータが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページ(以下、「第2の論理ページ」と言う)に後続する領域であるか否かが判断される。この判断で、第1の論理ページが第2の論理ページに後続する領域であると判断された場合は、ページ管理情報の書き込みが行われない。一方、第1の論理ページが第2の論理ページに後続する領域ではないと判断された場合は、ページ管理情報の書き込みが行われる。つまり、第1の論理ページのLPNが第2の論理ページのLPNの次の番号であれば、ページ管理情報の書き込みは行われない。一方、第1の論理ページのLPNが第2の論理ページのLPNの次の番号でなければ、ページ管理情報の書き込みが行われる。尚、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60に記憶されているデータがページ管理情報の場合には、上記の判断を行わず、ページ管理情報の書き込みが行われる。   In the present embodiment, when writing a series of data, in order to determine whether or not to write page management information to a physical page in a physical block to which the series of data is written, a logic corresponding to the head data of the series of data is determined. A page (hereinafter referred to as “first logical page”) corresponds to a logical page (hereinafter, referred to as data stored in the last physical page in which data in a physical block in which the series of data is written is written. It is determined whether or not it is an area subsequent to “second logical page”. If it is determined by this determination that the first logical page is an area following the second logical page, the page management information is not written. On the other hand, if it is determined that the first logical page is not an area following the second logical page, page management information is written. That is, if the LPN of the first logical page is the next number of the LPN of the second logical page, the page management information is not written. On the other hand, if the LPN of the first logical page is not the next number of the LPN of the second logical page, page management information is written. If the data stored in the last physical sector area 60 where the data in the physical block is written is the page management information, the page management information is written without making the above determination.

従って、ページ管理情報を書き込まれていない物理ブロックの場合、その物理ブロック内の先頭の物理ページからデータが書き込まれている末尾の物理ページまでの複数個の物理ページに対して、先頭の物理ページに記憶されているデータに対応する論理ページ以降の論理ページが、LPNの順番で割り当てられている(以下、このような状態を「LPNが連続する論理ページが割り当てられている状態」と言う)。   Therefore, in the case of a physical block in which no page management information is written, the first physical page is compared with a plurality of physical pages from the first physical page in the physical block to the last physical page in which data is written. Logical pages subsequent to the logical page corresponding to the data stored in are assigned in the order of LPN (hereinafter, such a state is referred to as “a state in which logical pages having continuous LPNs are assigned”). .

例えば、物理ブロック内のデータが書き込まれている末尾の物理ページがPPN#42の物理ページであり、物理ブロック内のPPN#0〜#42の物理ページにLPN#8〜#50の論理ページに対応するデータがLPNの順番で書き込まれているような場合には、その物理ブロックにページ管理情報が書き込まれていない。   For example, the last physical page in which the data in the physical block is written is the physical page of PPN # 42, the physical page of PPN # 0 to # 42 in the physical block is the logical page of LPN # 8 to # 50 When the corresponding data is written in the LPN order, the page management information is not written in the physical block.

実際の書き込み処理では、一連のデータを書き込む際に次の2つの判断が行われる。   In the actual writing process, the following two determinations are made when writing a series of data.

まず、書き込み先の物理ブロック内のデータが書き込まれている末尾の物理ページに記憶されているデータが、一連のデータとして書き込まれたデータであるか又はページ管理情報として書き込まれたデータであるかの判断が行われる。ここで、末尾の物理ページに記憶されているデータがページ管理情報である場合には、既に「LPNが連続する論理ページが割り当てられている状態」が維持されていないため、次の判断は行われない。   First, whether the data stored in the last physical page where the data in the physical block of the write destination is written is data written as a series of data or data written as page management information Is made. Here, if the data stored in the last physical page is page management information, the state where “a logical page with continuous LPNs is already allocated” has not been maintained, so the next determination is made. I will not.

次に、末尾の物理ページに記憶されているデータがページ管理情報でない場合には、末尾の物理ページの次の物理ページに書き込まれるデータ(今回の書き込み処理で書き込む一連のデータの先頭データ)に対応する論理ページのLPNが、末尾の物理ページに記憶されているデータに対応する論理ページのLPNの次の番号であるか否かの判断が行われる。末尾の物理ページに記憶されているデータがページ管理情報でない場合、既に書き込まれているデータについては、「LPNが連続する論理ページが割り当てられている状態」になっているので、今回の書き込み処理で一連のデータ書き込んだときに、その状態が維持できるか否かが問題になる。ここで、今回の書き込み処理で書き込む一連のデータの先頭データに対応する論理ページのLPNが、データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページのLPNの次の番号であれば、この一連のデータを書き込んだ後も、「LPNが連続する論理ページが割り当てられている状態」が維持される。従って、今回の書き込み処理で書き込む一連のデータの先頭データに対応する論理ページのLPNが、データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページのLPNの次の番号であれば、ページ管理情報の書き込みは行われない。   Next, if the data stored in the last physical page is not page management information, the data written to the physical page next to the last physical page (the first data of a series of data written in the current writing process) It is determined whether the LPN of the corresponding logical page is the next number of the LPN of the logical page corresponding to the data stored in the last physical page. If the data stored in the last physical page is not page management information, the already written data is in a state in which a logical page with continuous LPNs is allocated. When writing a series of data, it becomes a problem whether or not the state can be maintained. Here, the LPN of the logical page corresponding to the first data of the series of data written in the current writing process is the next to the LPN of the logical page corresponding to the data stored in the last physical page in which the data is written. If it is a number, even after writing this series of data, the “state where logical pages with continuous LPNs are allocated” is maintained. Therefore, the LPN of the logical page corresponding to the first data of the series of data written in the current writing process is the next number of the LPN of the logical page corresponding to the data stored in the last physical page in which the data is written. If so, the page management information is not written.

本実施の形態では、物理ページに記憶されているデータに対応する論理ページのLPNを判別するために、図7に示したように一連のデータの先頭データを書き込んだ物理ページに対応する共通冗長領域50に、その先頭データに対応する論理ページのLPNを書き込むようにしている。従って、少なくとも物理ブロック内の先頭の物理ページに記憶されているデータに対応する論理ページのLPNについては、先頭の物理ページに対応する共通冗長領域50に書き込まれている。   In this embodiment, in order to determine the LPN of the logical page corresponding to the data stored in the physical page, as shown in FIG. 7, the common redundancy corresponding to the physical page in which the first data of a series of data is written. The LPN of the logical page corresponding to the head data is written in the area 50. Therefore, at least the LPN of the logical page corresponding to the data stored in the first physical page in the physical block is written in the common redundant area 50 corresponding to the first physical page.

上記判断を行う際には、先頭の物理ページに書き込まれているデータに対応する論理ページのLPNとデータが書き込まれている末尾の物理ページのPPNに基づいて、データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページのLPNが求められる。具体的には、例えば、先頭の物理ページに書き込まれてデータに対応する論理ページのLPNの値に、データが書き込まれている末尾の物理ページのPPNの値を加えることにより、データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページのLPNが求められ。尚、メモリコントローラ3が一連のデータの末尾データを書き込んだ物理ページに対応する共通冗長領域50に、その物理ページに記憶されているデータに対応する論理ページのLPNを書き込むようにしてもよい。   When the above determination is made, the last page where data is written is based on the LPN of the logical page corresponding to the data written to the first physical page and the PPN of the last physical page where data is written. The LPN of the logical page corresponding to the data stored in the physical page is obtained. Specifically, for example, data is written by adding the PPN value of the last physical page where data is written to the LPN value of the logical page corresponding to the data written to the first physical page. The LPN of the logical page corresponding to the data stored in the last physical page is obtained. Note that the LPN of the logical page corresponding to the data stored in the physical page may be written in the common redundant area 50 corresponding to the physical page in which the end data of the series of data is written by the memory controller 3.

本実施形態では、書き込み処理が電源遮断等により書き込み途中で終了した場合を検知するために、一連のデータの末尾データが書き込まれた物理ページに対応する共通冗長領域50に、書き込み処理が正常に終了したことを示す情報である終了マークが書き込まれる。但し、ページ管理情報が書き込まれる場合には、ページ管理情報が書き込まれた物理ページに対応する共通冗長領域50、つまり、一連のデータの末尾データが書き込まれた物理ページの次の物理ページに対応した共通冗長領域50に、終了マークが書き込まれる。このようにすることにより、一連のデータの書き込みが終了した後、電源遮断等によりページ管理情報を書き込む前に書き込み処理が終了してしまったような場合に、メモリコントローラ3がページ管理情報を書き込まない場合に該当していると誤認することを回避することができる。   In the present embodiment, in order to detect a case where the writing process is terminated in the middle of writing due to a power shutdown or the like, the writing process is normally performed in the common redundant area 50 corresponding to the physical page in which the end data of the series of data is written. An end mark which is information indicating the end is written. However, when page management information is written, it corresponds to the common redundant area 50 corresponding to the physical page in which the page management information is written, that is, the physical page next to the physical page in which the end data of a series of data is written. An end mark is written in the common redundant area 50. By doing so, the memory controller 3 writes the page management information after the series of data has been written and the writing process is finished before the page management information is written due to power interruption or the like. Misunderstanding that this is the case can be avoided.

尚、「LPNが連続する論理ページが割り当てられている状態」が維持されていない場合、物理ブロック内のデータが書き込まれている末尾の物理ページに記憶されているデータは、論理ページと物理ページの対応関係に関する最新のページ管理情報でなければならない。従って、「LPNが連続する論理ページが割り当てられている状態」が維持されていない物理ブロックに対して一連のデータを書き込む際には、ページ管理情報の更新が行われる。更新されたページ管理情報は、その一連のデータの末尾データが書き込まれた物理ページの次の物理ページに書き込まれる。このページ管理情報の更新では、書き込む一連のデータに対応する部分について、ページ管理情報の内容が更新される。尚、本実施形態では、物理ブロック内のデータが書き込まれている末尾の物理ページに記憶されているデータがページ管理情報であるか否かを判別可能にするために、ページ管理情報が書き込まれた物理ページに対応した共通冗長領域50に、ページ管理情報が書き込まれたことを意味するフラグ(以下、「管理フラグ」と言う)が書き込まれる。これにより、メモリコントローラ3は、物理ブロック内のデータが書き込まれている末尾の物理ページに対応した共通冗長領域50に、管理フラグが記憶されているか否かにより、その末尾の物理ページに記憶されているデータがページ管理情報であるか否かを判断することができる。   Note that if the “state where logical pages with consecutive LPNs are allocated” is not maintained, the data stored in the last physical page in which the data in the physical block is written is the logical page and the physical page. It must be the latest page management information regarding the correspondence relationship. Therefore, when a series of data is written to a physical block that does not maintain the “state where logical pages with continuous LPNs are allocated”, the page management information is updated. The updated page management information is written in the physical page next to the physical page in which the tail data of the series of data is written. In updating the page management information, the contents of the page management information are updated for a portion corresponding to a series of data to be written. In this embodiment, page management information is written in order to make it possible to determine whether or not the data stored in the last physical page in which data in the physical block is written is page management information. A flag (hereinafter referred to as “management flag”) indicating that page management information has been written is written in the common redundant area 50 corresponding to the physical page. Thus, the memory controller 3 stores the management flag in the last physical page depending on whether or not the management flag is stored in the common redundant area 50 corresponding to the last physical page in which data in the physical block is written. It can be determined whether the stored data is page management information.

また、同一の物理ブロックに複数の一連のデータが連続的に書き込まれるような場合、物理ブロック内のデータが書き込まれている末尾の物理ページからページ管理情報を読み出さずに、ワークエリア8に保持されているページ管理情報が、そのまま使用されるようにしてもよい。   In addition, when a plurality of series of data is continuously written in the same physical block, the page management information is not read from the last physical page in which the data in the physical block is written, and is held in the work area 8 The page management information being used may be used as it is.

ホストシステム4から書き込み指示と共に与えられるデータの容量が、書き込み先の物理ブロック(1個目の物理ブロック)内の空きページの容量より大きい場合、メモリコントローラ3は、その物理ブロック内の最後尾の物理ページの1ページ前の物理ページまで、ホストシステム4から与えられるデータを書き込み、最後尾の物理ページには、その時点での論理ページと物理ページの対応関係を示すページ管理情報を書き込む。残りのデータについては、新たに割り当てられた別の物理ブロック(2個目の物理ブロック)内の物理ページに書き込まれる。つまり、1個目の物理ブロックの先頭の物理ページから最後尾の物理ページまで、論理ブロック内の各論理ページに対応するデータが全てLPNの順番で書き込まれる場合(先頭の論理ページに対応するデータからLPNの順番で書き込まれる場合)を除き、最後尾の物理ページにはページ管理情報が書き込まれる。   When the capacity of the data given from the host system 4 together with the write instruction is larger than the capacity of the empty page in the write destination physical block (first physical block), the memory controller 3 determines the end of the physical block. Data given from the host system 4 is written up to the physical page one page before the physical page, and page management information indicating the correspondence between the logical page and the physical page at that time is written to the last physical page. The remaining data is written to a physical page in another newly allocated physical block (second physical block). That is, when all the data corresponding to each logical page in the logical block is written in the order of LPN from the first physical page of the first physical block to the last physical page (data corresponding to the first logical page) Page management information is written to the last physical page (except when written in the order of LPN to LPN).

尚、一連のデータを書き込む際に、1個目の物理ブロック内の空きページが最後尾の物理ページだけの場合、その最後尾の物理ページには一連のデータが書き込まれず、2個目の物理ブロックの先頭の物理ページから一連のデータの書き込が開始される。   When writing a series of data, if the empty page in the first physical block is only the last physical page, the series of data is not written to the last physical page, and the second physical page is not written. Writing of a series of data is started from the first physical page of the block.

物理ブロックから各物理ページに格納されているデータを読み出すときに、メモリコントローラ3は、物理ブロック内のデータが書き込まれている末尾の物理ページからページ管理情報を読み出し、このページ管理情報に基づいて論理ページと物理ページの対応関係を把握する。   When reading the data stored in each physical page from the physical block, the memory controller 3 reads the page management information from the last physical page in which the data in the physical block is written, and based on this page management information Understand the correspondence between logical pages and physical pages.

以下、図7乃至図9を参照して、本実施形態での書き込み処理の具体例を説明する。なお、一連のデータは、前述したように、PPNが小さい方から順番に書き込まれる。以下の説明では、n番目(nは自然数)に書き込まれる一連のデータを「第nの一連のデータ」と言う。また、アクセス対象の論理ページ(一連のデータの先頭データに対応する論理セクタ領域が属する論理ページから一連のデータの末尾データに対応する論理セクタ領域が属する論理ページまでの1個または複数個の論理ページ)を「論理アクセスページ」と言う。また、この具体例では、図7(A)に示すように、LBN#0の論理ブロックに対してPBA#7の物理ブロックが割り当てられる。   Hereinafter, a specific example of the writing process according to the present embodiment will be described with reference to FIGS. As described above, a series of data is written in order from the smallest PPN. In the following description, a series of data written in the nth (n is a natural number) is referred to as an “nth series of data”. Also, the logical page to be accessed (one or more logical pages from the logical page to which the logical sector area corresponding to the first data of a series of data belongs to the logical page to which the logical sector area corresponding to the last data of the series belongs) Page) is called "logical access page". In this specific example, as shown in FIG. 7A, a physical block of PBA # 7 is allocated to a logical block of LBN # 0.

まず、ホストシステム4から与えられる第1の書き込み指示に基づいて、論理アクセスページとして、LBN#0の論理ブロック内のLPN#8−#15の8個の論理ページが特定される。また、LBN#0の論理ブロックに対応する物理ブロックが無いため、LBN#0の論理ブロックに対してPBA#7の物理ブロックが割り当てられる。この物理ブロックには未だデータが書き込まれていないため、物理ブロック内のデータが書き込まれていない先頭の物理ページとして、PBA#7の物理ブロック内の先頭の物理ページ(PPN#0の物理ページ)が特定される。この先頭の物理ページ(PPN#0の物理ページ)から、第1の書き込み指示に対応する第1の一連のデータの書き込み処理が開始される。この結果、LPN#8−#15の8個の論理ページに対応する第1の一連のデータが、PPN#0−#7の8個の物理ページに書き込まれる。また、第1の一連のデータの先頭データが書き込まれた物理ページ(PPN#0の物理ページ)に対応した共通冗長領域50に、その先頭データに対応する論理ページのLPN(LPN#8−#15の8個の論理ページのうちの先頭の論理ページのLPN)の値“#8”が書き込まれる(図7(A)参照)。   First, based on the first write instruction given from the host system 4, eight logical pages LPN # 8- # 15 in the logical block of LBN # 0 are specified as logical access pages. Further, since there is no physical block corresponding to the logical block of LBN # 0, the physical block of PBA # 7 is assigned to the logical block of LBN # 0. Since data is not yet written in this physical block, the first physical page in the physical block of PBA # 7 (physical page of PPN # 0) is the first physical page in which no data in the physical block is written. Is identified. The first series of data write processing corresponding to the first write instruction is started from the first physical page (physical page of PPN # 0). As a result, the first series of data corresponding to the eight logical pages of LPN # 8- # 15 is written to the eight physical pages of PPN # 0- # 7. Also, the LPN (LPN # 8- #) of the logical page corresponding to the head data is stored in the common redundant area 50 corresponding to the physical page (PPN # 0 physical page) in which the head data of the first series of data is written. The value “# 8” of the LPN of the first logical page among the 15 eight logical pages is written (see FIG. 7A).

第1の一連のデータは、この物理ブロックに書き込まれる最初の一連のデータであるため、第1の一連のデータが書き込まれた段階では、「LPNが連続する論理ページが割り当てられている状態」が維持されている。このため、第1の一連のデータの末尾データが書き込まれた物理ページ(PPN#7の物理ページ)の次の物理ページにページ管理情報は書き込まれず、PPN#7の物理ページに対応する共通冗長領域50に、終了マーク(EM(End Mark))が書き込まれる。   Since the first series of data is the first series of data written to the physical block, at the stage where the first series of data is written, “a state where logical pages with continuous LPNs are allocated” Is maintained. For this reason, the page management information is not written to the physical page next to the physical page (PPN # 7 physical page) in which the tail data of the first series of data is written, and the common redundancy corresponding to the physical page of PPN # 7. An end mark (EM (End Mark)) is written in the area 50.

次に、ホストシステム4から与えられる第2の書き込み指示に基づいて、論理アクセスページとして、LBN#0の論理ブロック内のLPN#16−#23の8個の論理ページが特定される。また、LBN#0の論理ブロックと対応するPBA#7の物理ブロック内のデータが書き込まれている末尾の物理ページとして、PPN#7の物理ページが特定される。特定された末尾の物理ページ(PPN#7の物理ページ)の次の物理ページ(PPN#8の物理ページ)から、第2の書き込み指示に対応する第2の一連のデータの書き込が開始される。この結果、LPN#16−#23の8個の論理ページに対応する第2の一連のデータが、PPN#8−#15の8個の物理ページに書き込まれる。また、第2の一連のデータの先頭データが書き込まれている物理ページ(PPN#8の物理ページ)に対応した共通冗長領域50に、その先頭データに対応する論理ページのLPN(LPN#16−#23の8個の論理ページのうちの先頭の論理ページのLPN)の値“#16”が書き込まれる(図7(A)参照)。   Next, based on the second write instruction given from the host system 4, eight logical pages LPN # 16- # 23 in the logical block of LBN # 0 are specified as logical access pages. Further, the physical page of PPN # 7 is specified as the last physical page in which data in the physical block of PBA # 7 corresponding to the logical block of LBN # 0 is written. The writing of the second series of data corresponding to the second write instruction is started from the physical page (physical page of PPN # 8) next to the identified last physical page (physical page of PPN # 7). The As a result, the second series of data corresponding to the eight logical pages of LPN # 16- # 23 is written to the eight physical pages of PPN # 8- # 15. Also, the LPN (LPN # 16− of the logical page corresponding to the head data is stored in the common redundant area 50 corresponding to the physical page (PPN # 8 physical page) in which the head data of the second series of data is written. The value “# 16” of the LPN of the first logical page among the eight logical pages of # 23 is written (see FIG. 7A).

この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(PPN#7の物理ページ)に記憶されているデータがページ管理情報であるか否かが判断される。PPN#7の物理ページに記憶されているデータはページ管理情報でないため、第1の論理ページ(第2の一連のデータの先頭データに対応する論理ページ)のLPNが、第2の論理ページ(データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページ)のLPNの次の番号であるか否かが判断される。具体的には、先頭の物理ページに対応した共通冗長領域50に書き込まれているLPNの値“#8”に、データが書き込まれている末尾の物理ページのPPNの値“#7”を加えた値である“#15”が第2の論理ページのLPNとして求められる。一方、第1の論理ページのLPN
は“#16”なので、第1の論理ページのLPNは第2の論理ページのLPNの次の番号であると判断される。このように第1の論理ページのLPNが第2の論理ページのLPNの次の番号である場合、一連のデータを書き込んだ後も、「LPNが連続する論理ページが割り当てられている状態」が維持される。
When this writing process is started, it is determined whether or not the data stored in the last physical page (physical page of PPN # 7) in which data in the physical block is written is page management information. . Since the data stored in the physical page of PPN # 7 is not page management information, the LPN of the first logical page (the logical page corresponding to the first data of the second series of data) is the second logical page ( It is determined whether or not it is the number next to the LPN of the logical page corresponding to the data stored in the last physical page in which the data is written. Specifically, the PPN value “# 7” of the last physical page in which data is written is added to the LPN value “# 8” written in the common redundant area 50 corresponding to the first physical page. The value “# 15” is obtained as the LPN of the second logical page. Meanwhile, LPN of the first logical page
Since “# 16”, the LPN of the first logical page is determined to be the next number of the LPN of the second logical page. In this way, when the LPN of the first logical page is the next number of the LPN of the second logical page, even after a series of data is written, the “state where logical pages with continuous LPNs are allocated” remains. Maintained.

この書き込み処理では、「LPNが連続する論理ページが割り当てられている状態」が維持されるため、第2の一連のデータの末尾データが書き込まれた物理ページ(PPN#15の物理ページ)の次の物理ページにページ管理情報は書き込まれず、PPN#15の物理ページに対応した共通冗長領域50に、終了マークが書き込まれる。   In this writing process, the “state in which logical pages with continuous LPNs are allocated” is maintained, so that the physical page (the physical page of PPN # 15) where the tail data of the second series of data is written is next. The page management information is not written in the physical page, and the end mark is written in the common redundant area 50 corresponding to the physical page of PPN # 15.

図7(A)に示すように、ホストシステム4から与えられる第3の書き込み指示と第4の書き込み指示にそれぞれ対応する第3の一連のデータと第4の一連のデータについても、第2の一連のデータと同様の書き込み処理が実行される。   As shown in FIG. 7A, the second series of data and the fourth series of data respectively corresponding to the third write instruction and the fourth write instruction given from the host system 4 are also the second A writing process similar to a series of data is executed.

次に、ホストシステム4から与えられる第5の書き込み指示に基づいて、論理アクセスページとして、LBN#0の論理ブロック内のLPN#0−#7の8個の論理ページが特定される。また、LBN#0の論理ブロックと対応するPBA#7の物理ブロック内のデータが書き込まれている末尾の物理ページとして、PPN#47の物理ページが特定される。特定された末尾の物理ページ(PPN#47の物理ページ)の次の物理ページ(PPN#48の物理ページ)から、第5の書き込み指示に対応する第5の一連のデータの書き込みが開始される。この結果、LPN#0−#7の8個の論理ページに対応する第5の一連のデータが、PPN#48−#55の8個の物理ページに書き込まれる。また、第5の一連のデータの先頭データが書き込まれた物理ページ(PPN#48の物理ページ)に対応した共通冗長領域50に、その先頭データに対応する論理ページのLPN(LPN#0−#7の8個の論理ページのうちの先頭の論理ページのLPN)の値“#0”が書き込まれる(図7(A)参照)。   Next, eight logical pages LPN # 0- # 7 in the logical block of LBN # 0 are specified as logical access pages based on the fifth write instruction given from the host system 4. Also, the physical page of PPN # 47 is specified as the last physical page in which data in the physical block of PBA # 7 corresponding to the logical block of LBN # 0 is written. Writing of the fifth series of data corresponding to the fifth write instruction is started from the physical page (physical page of PPN # 48) next to the identified last physical page (physical page of PPN # 47). . As a result, the fifth series of data corresponding to the eight logical pages of LPN # 0 to # 7 is written to the eight physical pages of PPN # 48 to # 55. Further, the LPN (LPN # 0- #) of the logical page corresponding to the head data is stored in the common redundant area 50 corresponding to the physical page (physical page of PPN # 48) in which the head data of the fifth series of data is written. 7 is written, the value “# 0” of the first logical page among the eight logical pages (see FIG. 7A).

この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(PPN#47の物理ページ)に記憶されているデータがページ管理情報であるか否かが判断される。PPN#47の物理ページに記憶されているデータはページ管理情報でないため、第1の論理ページ(第5の一連のデータの先頭データに対応する論理ページ)のLPNが、第2の論理ページ(データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページ)のLPNの次の番号であるか否かが判断される。具体的には、先頭の物理ページに対応した共通冗長領域50に書き込まれているLPNの値“#8”に、末尾の物理ページのPPNの値“#47”を加えた値である“#55”が第2の論理ページのLPNとして求められる。一方、第1の論理ページのLPN
は“#0なので、第1の論理ページのLPNは第2の論理ページのLPNの次の番号でないと判断される。このように第1の論理ページのLPNが第2の論理ページのLPNの次の番号でない場合、一連のデータを書き込んだ後は、「LPNが連続する論理ページが割り当てられている状態」が維持されない。
When this writing process is started, it is determined whether or not the data stored in the last physical page in which data in the physical block is written (physical page of PPN # 47) is page management information. . Since the data stored in the physical page of PPN # 47 is not page management information, the LPN of the first logical page (the logical page corresponding to the first data of the fifth series of data) is the second logical page ( It is determined whether or not it is the number next to the LPN of the logical page corresponding to the data stored in the last physical page in which the data is written. Specifically, “# 8” is the value obtained by adding the PPN value “# 47” of the last physical page to the LPN value “# 8” written in the common redundant area 50 corresponding to the first physical page. 55 ″ is determined as the LPN of the second logical page. Meanwhile, LPN of the first logical page
Is “# 0, it is determined that the LPN of the first logical page is not the next number of the LPN of the second logical page. In this way, the LPN of the first logical page is the LPN of the second logical page. If it is not the next number, after writing a series of data, the “state where logical pages with continuous LPNs are allocated” is not maintained.

この書き込み処理では、「LPNが連続する論理ページが割り当てられている状態」が維持されないため、メモリコントローラ3は、第5の一連のデータの書き込みが終了したときに物理ブロックに記憶されている有効なデータに関する物理ページ(PPN#0−#55の物理ページ)と論理ページとの対応関係を示すページ管理情報#0を作成する。ここでは、第5の一連のデータを書き込む前のデータが書き込まれている末尾の物理ページ(PPN#47の物理ページ)に記憶されているデータはページ管理情報でないため(PPN#47の物理ページに対応した共通冗長領域50に管理フラグが書き込まれていないため)、新規にページ管理情報が作成される。具体的には、ワークエリア8上にLPN#0−#63にそれぞれ対応する64個のレコードを有するテーブル作成領域が確保され、このテーブル作成領域の各レコードにPPNが書き込まれる。図8(A)に示したようなページ管理情報#0を作成する場合には、まず、第1〜4の一連のデータとしてPPN#0−#47の物理ページに書き込まれたLPN#8−#55の論理ページに対応するデータに関するPPNの書き込みが行われる。つまり、LPN#8−#55に対応したレコードに、PPN#0−#47の番号(PPNの値)が書き込まれる。次に、第5の一連のデータとしてPPN#48−#54の物理ページに書き込まれるLPN#0−#7の論理ページに対応するデータに関するPPNの書き込みが行われる。つまり、LPN#0−#7に対応したレコードに、PPN#48−#54の番号(PPNの値)が書き込まれる。これにより、図8(A)に示したようなページ管理情報#0の作成処理が完了する。   In this writing process, the “state where logical pages with consecutive LPNs are allocated” is not maintained, so that the memory controller 3 stores the valid data stored in the physical block when the fifth series of data has been written. Page management information # 0 indicating the correspondence between the physical page (PPN # 0- # 55 physical page) related to the correct data and the logical page is created. Here, since the data stored in the last physical page (the physical page of PPN # 47) in which the data before the fifth series of data is written is not page management information (the physical page of PPN # 47) Since the management flag is not written in the common redundant area 50 corresponding to the above, the page management information is newly created. Specifically, a table creation area having 64 records respectively corresponding to LPN # 0 to # 63 is secured on the work area 8, and PPN is written in each record of this table creation area. When creating the page management information # 0 as shown in FIG. 8A, first, LPN # 8- written to the physical pages of PPN # 0- # 47 as a series of first to fourth data. PPN writing relating to data corresponding to the logical page # 55 is performed. That is, the numbers (PPN values) of PPN # 0- # 47 are written in the records corresponding to LPN # 8- # 55. Next, the PPN is written for the data corresponding to the logical pages LPN # 0- # 7 written to the physical pages PPN # 48- # 54 as the fifth series of data. That is, the numbers (PPN values) of PPN # 48- # 54 are written in the records corresponding to LPN # 0- # 7. Thereby, the creation processing of the page management information # 0 as shown in FIG.

メモリコントローラ3は、作成したページ管理情報#0を、第5の一連のデータの末尾データが書き込まれた物理ページ(PPN#55の物理ページ)の次の物理ページ(PPN#56の物理ページ)に書き込む。また、ページ管理情報#0が書き込まれた物理ページ(PPN#56の物理ページ)に対応した共通冗長領域50に、図示しない管理フラグと、前述した終了マークとが書き込まれる(図7(A)参照)。   The memory controller 3 uses the created page management information # 0 as the physical page (physical page of PPN # 56) next to the physical page (physical page of PPN # 55) in which the tail data of the fifth series of data is written. Write to. In addition, a management flag (not shown) and the above-described end mark are written in the common redundant area 50 corresponding to the physical page in which page management information # 0 is written (physical page of PPN # 56) (FIG. 7A). reference).

尚、一度でもページ管理情報が書き込まれた物理ブロックについては、その物理ブロックに一連のデータが書き込まれる毎にページ管理情報が書き込まれる。なぜなら、一度でもページ管理情報が書き込まれた物理ブロックは、「LPNが連続する論理ページが割り当てられている状態」が維持されていないからである。   For a physical block in which page management information has been written even once, page management information is written each time a series of data is written to the physical block. This is because the physical block in which the page management information has been written even once does not maintain the “state in which logical pages with continuous LPNs are allocated”.

次に、ホストシステム4から与えられる第6の書き込み指示に基づいて、論理アクセスページとして、LBN#0の論理ブロック内のLPN#8−#15の8個の論理ページが特定される。また、LBN#0の論理ブロックに対応するPBA#7の物理ブロック内のデータが書き込まれている末尾の物理ページとして、PPN#56の物理ページが特定される。   Next, based on the sixth write instruction given from the host system 4, eight logical pages LPN # 8- # 15 in the logical block of LBN # 0 are specified as logical access pages. Also, the physical page of PPN # 56 is specified as the last physical page in which data in the physical block of PBA # 7 corresponding to the logical block of LBN # 0 is written.

しかし、PBA#7の物理ブロック内の空きページはPPN#57−#63の7個の物理ページだけなので、メモリコントローラ3は、ホストシステム4から与えられた第6の書き込み指示に基づく8個の論理ページに対応するデータを、全てPBA#7の物理ブロック内の空きページに書き込むことができない。   However, since the free pages in the physical block of PBA # 7 are only seven physical pages of PPN # 57- # 63, the memory controller 3 performs the eight pages based on the sixth write instruction given from the host system 4. All data corresponding to the logical page cannot be written to an empty page in the physical block of PBA # 7.

また、物理ブロック内のデータが書き込まれている末尾の物理ページ(PSN#56の物理ページ)に記憶されているデータはページ管理情報なので、既に、「LPNが連続する論理ページが割り当てられている状態」が維持されていない。従って、メモリコントローラ3は、物理ブロック内の最後尾の物理ページにページ管理情報を書き込まなければならない。   Further, since the data stored in the last physical page (PSN # 56 physical page) in which the data in the physical block is written is the page management information, “a logical page with continuous LPN has already been allocated. "State" is not maintained. Therefore, the memory controller 3 must write page management information to the last physical page in the physical block.

このため、第6の書き込み指示に基づく8個の論理ページに対応するデータは、6個の論理ページに対応するデータを含む第6の一連のデータと2個の論理ページに対応するデータを含む第7の一連のデータに分割される。   Therefore, the data corresponding to the eight logical pages based on the sixth write instruction includes the sixth series of data including the data corresponding to the six logical pages and the data corresponding to the two logical pages. Divided into a seventh series of data.

まず、第6の一連のデータの書き込み処理について説明する。第6の一連のデータは、PBA#7の物理ブロック内のデータが書き込まれている末尾の物理ページ(PSN#56の物理ページ)の次の物理ページ(PSN#56の物理ページ)から、最後尾の物理ページ(PPN#63の物理ページ)の1ページ前の物理ページ(PPN#62の物理ページ)までの6個の物理ページに書き込まれる。PBA#7の物理ブロック内の最後尾の物理ページ(PPN#63の物理ページ)には、第6の一連のデータの書き込みが終了した時点での論理ページと物理ページの対応関係を示すページ管理情報#1が書き込まれる。また、ページ管理情報#1が書き込まれた最後尾の物理ページ(PPN#63の物理ページ)に対応した共通冗長領域50には、図示しない管理フラグと、前述した終了マークとが書き込まれる。   First, a sixth series of data write processing will be described. The sixth series of data starts from the physical page (PSN # 56 physical page) next to the last physical page (PSN # 56 physical page) in which data in the physical block of PBA # 7 is written. The data is written in six physical pages up to the physical page (physical page of PPN # 62) one page before the tail physical page (physical page of PPN # 63). Page management indicating the correspondence between the logical page and the physical page at the time when writing of the sixth series of data is completed in the last physical page (physical page of PPN # 63) in the physical block of PBA # 7 Information # 1 is written. In addition, a management flag (not shown) and the above-described end mark are written in the common redundant area 50 corresponding to the last physical page (PPN # 63 physical page) in which the page management information # 1 is written.

次に、第7の一連のデータの書き込み処理について説明する。図7(B)に示すように、LBN#0の論理ブロックに別の物理ブロック(PBA#16の物理ブロック)が新たに割り当てられ、そのPBA#16の物理ブロック内の先頭の物理ページ(PPN#0の物理ページ)から第7の一連のデータが書き込まれる。また、第7の一連のデータの末尾データが書き込まれた物理ページ(PPN#1の物理ページ)に対応した共通冗長領域50には、終了マークが書き込まれる。   Next, a seventh series of data writing processing will be described. As shown in FIG. 7B, another physical block (physical block of PBA # 16) is newly allocated to the logical block of LBN # 0, and the first physical page (PPN) in the physical block of PBA # 16 is allocated. The seventh series of data is written from the physical page # 0. In addition, the end mark is written in the common redundant area 50 corresponding to the physical page (PPN # 1 physical page) in which the end data of the seventh series of data is written.

この結果、ホストシステム4から与えられた8個の論理ページに対応するデータのうち、先頭から6個目までの論理ページに対応するデータは、PBA#7の物理ブロック内のPPN#57−#62の物理ページに第6の一連のデータとして書き込まれ(図7(A)参照)、残りの2個の論理ページに対応するデータは、PBA#16の物理ブロック内のPPN#0−#1の物理ページに第7の一連のデータとして書き込まれる(図7(B)参照)。   As a result, among the data corresponding to the eight logical pages given from the host system 4, the data corresponding to the sixth logical page from the head is PPN # 57- # in the physical block of PBA # 7. 62 is written as a sixth series of data (see FIG. 7A), and the data corresponding to the remaining two logical pages are PPN # 0- # 1 in the physical block of PBA # 16. Are written as a seventh series of data in the physical page (see FIG. 7B).

尚、メモリコントローラ3は、上述のようにPBA#7の物理ブロック内の空きページに、ホストシステム4から書き込み指示と共に与えられる全てのデータを書き込むことができない場合、その全てのデータを新たに割り当てたPBA#16の物理ブロックに書き込むようにしてもよい。   If the memory controller 3 cannot write all the data given together with the write instruction from the host system 4 to the empty page in the physical block of PBA # 7 as described above, the memory controller 3 newly allocates all the data. Alternatively, it may be written in the physical block of PBA # 16.

また、ホストシステム4から与えられる書き込み指示で指定される書き込み先の論理ページの個数が、書き込み先の物理ブロック内のデータが書き込まれていない物理ページの個数以上の場合、物理ブロック内の最後尾の物理ページにはホストシステム4から与えられるデータではなくページ管理情報が書き込まれる。最後尾の物理ページに記憶されているデータがページ管理情報でない場合、物理ブロックの先頭の物理ページから最後尾の物理ページまで、論理ブロック内の各論理ページに対応するデータが全てLPNの順番で書き込まれている(先頭の論理ページに対応するデータからLPNの順番で書き込まれている)と判断されるからである。   In addition, when the number of write destination logical pages specified by the write instruction given from the host system 4 is equal to or greater than the number of physical pages in which data in the write destination physical block is not written, the last page in the physical block In this physical page, page management information is written instead of data given from the host system 4. If the data stored in the last physical page is not page management information, the data corresponding to each logical page in the logical block from the first physical page to the last physical page in the physical block is all in the LPN order. This is because it is determined that data is written (written in the order of LPN from the data corresponding to the first logical page).

従って、物理ブロック内の最後尾の物理ページまでホストシステム4から与えられるデータ(一連のデータ)を書き込んでも、「LPNが連続する論理ページが割り当てられている状態」が維持される場合には、最後尾の物理ページにページ管理情報ではなくホストシステム4から与えられるデータ(一連のデータ)が書き込まれる。   Therefore, even if the data (a series of data) given from the host system 4 is written up to the last physical page in the physical block, the “state where logical pages with continuous LPNs are allocated” is maintained. Not the page management information but data (a series of data) given from the host system 4 is written to the last physical page.

また、1個の論理ブロックに2個の物理ブロックが割り当てられている場合、2個目の物理ブロックには、1個目の物理ブロックと2個目の物理ブロックを合わせたページ管理情報が保存されていることが好ましい。但し、2個目の物理ブロック内で、「LPNが連続する論理ページが割り当てられている状態」が維持されていれば、2個目の物理ブロックにページ管理情報が保存されていなくてもよい。2個目の物理ブロックにページ管理情報が保存されていない場合には、1個目の物理ブロックに関するページ管理情報に基づいて、1個目の物理ブロックと2個目の物理ブロックを合わせたページ管理情報が作成される。   When two physical blocks are assigned to one logical block, page management information including the first physical block and the second physical block is stored in the second physical block. It is preferable that However, the page management information does not have to be stored in the second physical block as long as “a state in which logical pages with continuous LPNs are allocated” is maintained in the second physical block. . If page management information is not stored in the second physical block, a page combining the first physical block and the second physical block based on the page management information related to the first physical block Management information is created.

前述したページ管理情報#1は、以下のようにして作成される。   The above-described page management information # 1 is created as follows.

すなわち、第6の一連のデータが書き込まれる前のデータが書き込まれている末尾の物理ページ(PPN#56の物理ページ)に、ページ管理情報#0が書き込まれているため(データが書き込まれている末尾の物理ページに対応した共通冗長領域50に管理フラグが書き込まれているため)、ワークエリア8にページ管理情報#0が保持されていない場合には、PPN#56の物理ページからページ管理情報#0が読み出される。ページ管理情報#1は、読み出されたページ管理情報#0に基づいて作成される。この作成処理では、図8(B)に示すように、ページ管理情報#0における、LPN#8−#13に対応するレコードに、第6の一連のデータが書き込まれる6個の物理ページ60に対応したPPN#57−#62が上書きされる。   That is, because page management information # 0 is written to the last physical page (physical page of PPN # 56) in which data before the sixth series of data is written (data is written). If the page management information # 0 is not held in the work area 8, the page management is started from the physical page of PPN # 56. Information # 0 is read out. The page management information # 1 is created based on the read page management information # 0. In this creation process, as shown in FIG. 8B, in the six physical pages 60 in which the sixth series of data is written in the record corresponding to LPN # 8- # 13 in the page management information # 0. The corresponding PPN # 57- # 62 is overwritten.

なお、前述したように、PBA#16の物理ブロックには、2ページ分のデータである第7の一連のデータが書き込まれるが、このPBA#16の物理ブロックには、初めて一連のデータが書き込まれたため、第7の一連のデータの末尾データが書き込まれた物理ページ(PPN#1の物理ページ)の次の物理ページにページ管理情報を書込まないと判断し、PPN#1の物理ページに対応した共通冗長領域50に、終了マークを書込む。   As described above, the seventh series of data, which is data for two pages, is written in the physical block of PBA # 16, but the first series of data is written in the physical block of PBA # 16 for the first time. Therefore, it is determined that the page management information is not written in the physical page next to the physical page (the physical page of PPN # 1) in which the tail data of the seventh series of data is written, and the physical page of PPN # 1 is determined. An end mark is written in the corresponding common redundant area 50.

次に、ホストシステム4から与えられる第7の書き込み指示に基づいて、論理アクセスページとして、LBN#0の論理ブロック内のLPN#16−#23の8個の論理ページが特定される。また、LBN#0の論理ブロックと対応するPBA#16の物理ブロック内のデータが書き込まれている末尾の物理ページとして、PPN#1の物理ページが特定される。特定された末尾の物理ページ(PPN#1の物理ページ)の次の物理ページ(PPN#2の物理ページ)から、第7の書き込み指示に対応する第8の一連のデータの書き込み処理が開始される。この結果、LPN#16−#23の8個の論理ページに対応する第8の一連のデータが、PPN#2−#9の8個の物理ページに書き込まれる。また、第8の一連のデータの先頭データが書き込まれた物理ページ(PPN#2の物理ページ)に対応した共通冗長領域50に、その先頭データに対応する論理ページのLPN(LPN#16−#23の8個の論理ページのうちの先頭の論理ページのLPN)の値“#16”が書き込まれる(図7(B)参照)。   Next, based on the seventh write instruction given from the host system 4, eight logical pages LPN # 16- # 23 in the logical block of LBN # 0 are specified as logical access pages. Further, the physical page of PPN # 1 is specified as the last physical page in which data in the physical block of PBA # 16 corresponding to the logical block of LBN # 0 is written. The eighth series of data write processing corresponding to the seventh write instruction is started from the physical page (PPN # 2 physical page) next to the identified last physical page (PPN # 1 physical page). The As a result, the eighth series of data corresponding to the eight logical pages of LPN # 16- # 23 is written to the eight physical pages of PPN # 2- # 9. Also, the LPN (LPN # 16- #) of the logical page corresponding to the head data is stored in the common redundant area 50 corresponding to the physical page (the physical page of PPN # 2) in which the head data of the eighth series of data is written. 23, the value “# 16” of the LPN of the first logical page among the eight logical pages is written (see FIG. 7B).

この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(PPN#1の物理ページ)に記憶されているデータがページ管理情報であるか否かが判断される。PPN#1の物理ページに記憶されているデータはページ管理情報でないため、第1の論理ページ(第8の一連のデータの先頭データに対応する論理ページ)のLPNが、第2の論理ページ(データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページ)のLPNの次の番号であるか否かが判断される。ここで、第1の論理ページのLPNの値は“#16”であり、第2の論理ページのLPNの値は“#15”であるため、第1の論理ページのLPNは第2の論理ページのLPNの次の番号であると判断される。このため、第8の一連のデータの末尾データが書き込まれた物理ページ(PPN#9の物理ページ)の次の物理ページにページ管理情報は書き込まれず、PPN#9の物理ページに対応した共通冗長領域50に、終了マークが書き込まれる。   When this writing process is started, it is determined whether or not the data stored in the last physical page (physical page of PPN # 1) in which data in the physical block is written is page management information. . Since the data stored in the physical page of PPN # 1 is not page management information, the LPN of the first logical page (the logical page corresponding to the first data of the eighth series of data) is the second logical page ( It is determined whether or not it is the number next to the LPN of the logical page corresponding to the data stored in the last physical page in which the data is written. Here, since the LPN value of the first logical page is “# 16” and the LPN value of the second logical page is “# 15”, the LPN of the first logical page is the second logical page. It is determined that it is the next number of the LPN of the page. Therefore, the page management information is not written to the physical page next to the physical page (PPN # 9 physical page) in which the tail data of the eighth series of data is written, and the common redundancy corresponding to the physical page of PPN # 9 is used. An end mark is written in area 50.

次に、ホストシステム4から与えられる第8の書き込み指示に基づいて、論理アクセスページとして、LBN#0の論理ブロック内のLPN#0−#7の8個の論理ページが特定される。また、LBN#0の論理ブロックと対応するPBA#16の物理ブロック内のデータが書き込まれている末尾の物理ページとして、PPN#9の物理ページが特定される。特定された末尾の物理ページ(PPN#9の物理ページ)の次の物理ページ(PPN#10の物理ページ)から、第8の書き込み指示に対応する第9の一連のデータの書き込みが開始される。ここでは、図7(B)に示したように、LPN#0−#7の8個の論理ページに対応する第9の一連のデータが、PPN#10−#17の8個の物理ページに書き込まれる。また、第9の一連のデータの先頭データが書き込まれている物理ページ(PPN#10の物理ページ)に対応した共通冗長領域50に、その先頭データに対応する論理ページのLPN(LPN#0−#7の8個の論理ページのうちの先頭の論理ページのLPN)の値“#0”が書き込まれる(図7(B)参照)。   Next, eight logical pages LPN # 0 to # 7 in the logical block of LBN # 0 are specified as logical access pages based on the eighth write instruction given from the host system 4. Also, the physical page of PPN # 9 is specified as the last physical page in which data in the physical block of PBA # 16 corresponding to the logical block of LBN # 0 is written. Writing of the ninth series of data corresponding to the eighth write instruction is started from the physical page (physical page of PPN # 10) next to the identified last physical page (physical page of PPN # 9). . Here, as shown in FIG. 7B, the ninth series of data corresponding to the eight logical pages of LPN # 0 to # 7 is transferred to the eight physical pages of PPN # 10 to # 17. Written. In addition, in the common redundant area 50 corresponding to the physical page (PPN # 10 physical page) in which the top data of the ninth series of data is written, the LPN (LPN # 0−) of the logical page corresponding to the top data is stored. The value “# 0” of the LPN of the first logical page among the eight logical pages of # 7 is written (see FIG. 7B).

この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(PPN#9の物理ページ)に記憶されているデータがページ管理情報であるか否かが判断される。PPN#9の物理ページに記憶されているデータはページ管理情報でないため、第1の論理ページ(第9の一連のデータの先頭データに対応する論理ページ)のLPNが、第2の論理ページ(データが書き込まれている末尾の物理ページに記憶されているデータに対応する論理ページ)のLPNの次の番号であるか否かが判断される。ここで、第1の論理ページのLPNの値は“#0”であり、第2の論理ページのLPNの値“は#23”であるため、第1の論理ページのLPNは第2の論理ページのLPNの次の番号ではないと判断される。   When starting the writing process, it is determined whether or not the data stored in the last physical page (physical page of PPN # 9) in which the data in the physical block is written is page management information. . Since the data stored in the physical page of PPN # 9 is not page management information, the LPN of the first logical page (the logical page corresponding to the head data of the ninth series of data) is the second logical page ( It is determined whether or not it is the number next to the LPN of the logical page corresponding to the data stored in the last physical page in which the data is written. Here, since the LPN value of the first logical page is “# 0” and the LPN value of the second logical page is “# 23”, the LPN of the first logical page is the second logical page. It is determined that it is not the next number of the LPN of the page.

従って、第9の一連のデータの書き込み処理では、「LPNが連続する論理ページが割り当てられている状態」が維持されないため、メモリコントローラ3は、ページ管理情報#2を作成する。PBA#16の物理ブロックは、LBN#0の論理ブロックに対応する2個目の物理ブロックである。そのため、メモリコントローラ3は、1個目の物理ブロックの最後尾の物理ページに書き込まれているページ管理情報#1に基づいて、ページ管理情報#2を作成する。   Therefore, in the ninth series of data write processing, the “state where logical pages with continuous LPNs are allocated” is not maintained, so the memory controller 3 creates page management information # 2. The physical block of PBA # 16 is the second physical block corresponding to the logical block of LBN # 0. Therefore, the memory controller 3 creates page management information # 2 based on the page management information # 1 written in the last physical page of the first physical block.

第9の一連のデータを書き込む際に作成されるページ管理情報#2の作成処理を、図9を参照して説明する。ページ管理情報#2の基礎となるページ管理情報#1の各レコードに記載されているPPNは、1個目の物理ブロック内の物理ブロックに対応するPPNであるため、PPNが書き込まれている各レコードに、1個目の物理ブロックであることを示す情報である旧ブロックフラグ(図では、「旧ブロックF」と記載する)が書き込まれる。次に、第7及び8の一連のデータとしてPPN#0−#9の物理ページに書き込まれたLPN#14−#23の論理ページに対応するデータに関して、ページ管理情報#1の内容が更新される。つまり、LPN#14−#23に対応したレコードに、PPN#0−#9の番号(PPNの値)が上書きされ、番号(PPNの値)が上書きされたレコードに記載されている旧ブロックフラグは消去される。次に、第9の一連のデータとしてPPN#10−#17の物理ページに書き込まれるLPN#0−#7の論理ページに対応するデータに関して、ページ管理情報#1の内容が更新される。つまり、LPN#0−#7に対応したレコードに、PPN#10−#17の番号(PPNの値)が上書きされ、番号(PPNの値)が上書きされたレコードに記載されている旧ブロックフラグは消去される。   A process for creating the page management information # 2 created when the ninth series of data is written will be described with reference to FIG. Since the PPN described in each record of the page management information # 1 which is the basis of the page management information # 2 is a PPN corresponding to the physical block in the first physical block, each PPN is written. An old block flag (described as “old block F” in the figure), which is information indicating the first physical block, is written in the record. Next, the contents of the page management information # 1 are updated with respect to the data corresponding to the logical pages LPN # 14- # 23 written to the physical pages PPN # 0- # 9 as the seventh and eighth series of data. The That is, the record corresponding to LPN # 14- # 23 is overwritten with the number of PPN # 0- # 9 (PPN value), and the old block flag described in the record with the number (PPN value) overwritten. Is erased. Next, the contents of the page management information # 1 are updated for the data corresponding to the logical pages of LPN # 0 to # 7 written to the physical pages of PPN # 10 to # 17 as the ninth series of data. That is, the record corresponding to LPN # 0- # 7 is overwritten with the number (PPN value) of PPN # 10- # 17, and the old block flag described in the record with the number (PPN value) overwritten. Is erased.

旧ブロックフラグは、各レコードに書き込まれているPPNが、1個目の物理ブロック(本具体例ではPBA#7の物理ブロック)内の物理ページのPPNであるか、又は2個目の物理ブロック(本具体例ではPBA#16の物理ブロック)内の物理ページのPPNであるかを判断するための情報である。つまり、旧ブロックフラグが書き込まれているレコードに書き込まれているPPNは、1個目の物理ブロック(本具体例ではPBA#7の物理ブロック)内の物理ページのPPNであると判断される。つまり、ページ管理情報#2を参照することで、LPN#0−#7及びLPN#14−#23の論理ページに対応するデータは、2個目の物理ブロック(本具体例ではPBA#16の物理ブロック)に書き込まれているが、他の論理ページに対応するデータは、2個目の物理ブロックに書き込まれていることがわかる。尚、以上のようにして作成されたページ管理情報#2は、第9の一連のデータの末尾データが書き込まれた物理ページ(2個目の物理ブロック内のPPN#17の物理ページ)の次の物理ページ(2個目の物理ブロック内のPPN#18の物理ページ)に書き込まれ、ページ管理情報#2が書き込まれた物理ページ(2個目の物理ブロック内のPPN#18の物理ページ)に対応した共通冗長領域50には、図示しない管理フラグと前述した終了マークが書き込まれる。   The old block flag indicates that the PPN written in each record is the PPN of the physical page in the first physical block (in this specific example, the physical block of PBA # 7), or the second physical block This is information for determining whether it is a PPN of a physical page in (physical block of PBA # 16 in this specific example). That is, the PPN written in the record in which the old block flag is written is determined to be the PPN of the physical page in the first physical block (physical block of PBA # 7 in this specific example). That is, by referring to the page management information # 2, the data corresponding to the logical pages of LPN # 0- # 7 and LPN # 14- # 23 is stored in the second physical block (in this specific example, PBA # 16 It can be seen that data corresponding to another logical page is written in the second physical block. The page management information # 2 created as described above is the next to the physical page (the physical page of PPN # 17 in the second physical block) in which the end data of the ninth series of data is written. Physical page (physical page of PPN # 18 in the second physical block) and physical page written with page management information # 2 (physical page of PPN # 18 in the second physical block) A management flag (not shown) and the end mark described above are written in the common redundant area 50 corresponding to.

尚、本具体例において、PBA#7の物理ブロック(1個目の物理ブロック)とPBA#16の物理ブロック(2個目の物理ブロック)が同一の論理ブロック(LBN#0の論理ブロック)に対応することは、これらの物理ブロックに書き込まれている論理アドレス情報を参照することにより判断することができる。また、これらの物理ブロックの新旧関係を判断(1個目の物理ブロックか2個目の物理ブロックを判断)するために、メモリコントローラ3が、先頭物理ページに対応した共通冗長領域50に新旧関係を判断するためシリアル番号を書き込むようにすることが好ましい。また、新ブロック(2個目の物理ブロック)の先頭物理ページに対応した共通冗長領域50や、ページ管理情報が書き込まれた物理ページに対応した共通冗長領域50に、メモリコントローラ3が、旧ブロック(1個目の物理ブロック)のPBAを書き込むようにしてもよい。このようにすれば、それらの共通冗長領域50を参照することにより、旧ブロック(1個目の物理ブロック)のPBAを把握することができる。   In this specific example, the physical block of PBA # 7 (first physical block) and the physical block of PBA # 16 (second physical block) are the same logical block (logical block of LBN # 0). Correspondence can be determined by referring to the logical address information written in these physical blocks. In addition, in order to determine the new / old relationship of these physical blocks (determine the first physical block or the second physical block), the memory controller 3 sets the new / old relationship in the common redundant area 50 corresponding to the first physical page. It is preferable to write a serial number to determine the above. In addition, the memory controller 3 in the common redundant area 50 corresponding to the first physical page of the new block (second physical block) or the common redundant area 50 corresponding to the physical page in which the page management information is written is stored in the old block. The PBA of (first physical block) may be written. In this way, the PBA of the old block (first physical block) can be grasped by referring to those common redundant areas 50.

さて、この後、同じ論理ブロックに割り当てられた1個目の物理ブロック又は2個目の物理ブロックからデータを読み出すときには、メモリコントローラ3は、2個目の物理ブロック内のデータが書き込まれている末尾の物理ページ(PPN#18の物理ページ)からページ管理情報#2を読み出し、このページ管理情報#2に基づいて論理ページと物理ページの対応関係を把握する。ここでは、新ブロック内のPPN#18の物理ページに書き込まれているページ管理情報#2が、論理ページと物理ページの最新の対応関係を示しているため、そのページ管理情報#2を参照するだけで、論理ページと物理ページの最新の対応関係を把握することができる。具体的には、LPN#0−#7及びLPN#14−#23の論理ページに対応したデータは、2個目の物理ブロックに書き込まれており、他の論理ページに対応したデータは、1個目の物理ブロックに書き込まれていることが把握される。つまり、本実施形態によれば、効率的に、論理ページと物理ページの対応関係を把握することができる。   After that, when data is read from the first physical block or the second physical block assigned to the same logical block, the memory controller 3 is written with data in the second physical block. The page management information # 2 is read from the last physical page (PPN # 18 physical page), and the correspondence between the logical page and the physical page is grasped based on the page management information # 2. Here, since the page management information # 2 written in the physical page of the PPN # 18 in the new block indicates the latest correspondence between the logical page and the physical page, the page management information # 2 is referred to. Only the latest correspondence relationship between the logical page and the physical page can be grasped. Specifically, the data corresponding to the logical pages of LPN # 0- # 7 and LPN # 14- # 23 is written in the second physical block, and the data corresponding to the other logical pages is 1 It is understood that data is written in the physical block. That is, according to the present embodiment, it is possible to efficiently grasp the correspondence between the logical page and the physical page.

尚、第1の一連のデータが書き込まれてから第5の一連のデータが書き込まれる前までの間に(つまりページ管理情報が全く書き込まれていない場合に)、物理ブロックからデータを読み出すときには、メモリコントローラ3は、物理ブロック内の先頭の物理ページに記憶されているデータに対応する論理ページ(LPN#8の論理ページ)以降の論理ページに対応するデータがLPNの順番で書き込まれていると判断して、論理ページと物理ページの対応関係を把握する。また、物理ブロック内の先頭の物理ページに記憶されているデータに対応する論理ページのLSNについては、先頭の物理ページに対応した共通冗長領域50に書き込まれているLSNにより把握される。   When data is read from a physical block between the time when the first series of data is written and before the time when the fifth series of data is written (that is, when no page management information is written), When the memory controller 3 writes the data corresponding to the logical pages after the logical page (LPN # 8 logical page) corresponding to the data stored in the first physical page in the physical block in the LPN order. Judgment is made to grasp the correspondence between the logical page and the physical page. Further, the LSN of the logical page corresponding to the data stored in the first physical page in the physical block is grasped by the LSN written in the common redundant area 50 corresponding to the first physical page.

また、第7の一連のデータが書き込まれてから第9の一連のデータが書き込まれる前までの間に(つまり、1個目の物理ブロックにページ管理情報が書き込まれているが2個目の物理ブロックにページ管理情報が全く書き込まれていない場合に)、物理ブロック(1個目の物理ブロック又は2個目の物理ブロック)からデータを読み出すときには、メモリコントローラ3は、1個目の物理ブロックに書き込まれているページ管理情報に基づいて、1個目の物理ブロックと2個目の物理ブロックを合わせたページ管理情報を作成する。この作成処理では、2個目ブロックに記憶されているデータに対応する部分について、1個目の物理ブロックに書き込まれているページ管理情報の内容が更新される。この際、2個目ブロックブロックに関しては、LPN14の論理ページに対応するデータからLPNの順番でデータが格納されていると判断して、論理ページと物理ページの対応関係を把握される。   In addition, the page management information is written in the first physical block after the seventh series of data is written and before the ninth series of data is written. When data is not read from the physical block (first physical block or second physical block) when no page management information is written in the physical block, the memory controller 3 reads the first physical block. Is created based on the page management information written in the first physical block and the second physical block. In this creation process, the content of the page management information written in the first physical block is updated for the portion corresponding to the data stored in the second block. At this time, regarding the second block block, it is determined that the data is stored in the order of LPN from the data corresponding to the logical page of LPN 14, and the correspondence between the logical page and the physical page is grasped.

以上が、第二の実施形態の説明である。   The above is the description of the second embodiment.

なお、ページ管理情報は、前述したような、論理ページと物理ページの対応関係を示すテーブルであることが好ましいが、一変形例として、物理ブロックに書き込まれているそれぞれの一連のデータの先頭データに対応する論理ページの論理ページ番号であるスタート論理ページ番号(以下、「SLPN」と言う)と、その先頭データが書き込まれている物理ページの物理ページ番号であるスタート物理ページ番号(以下、「SPPN」と言う)と、その一連のデータが書き込まれるページ数(先頭データが属する論理ページから末尾データが属する論理ページまでの論理ページの個数であるページカウント値、以下、「PCNT」と言う)と、その一連のデータが書き込まれる物理ブロックを示す情報(1個目の物理ブロック又は2個目の物理ブロックを示す情報)であってもよい。このような情報が書き込まれている場合には、この情報に基づいて、論理ページと物理ページの対応関係を示すテーブルが作成される。   The page management information is preferably a table indicating the correspondence between logical pages and physical pages as described above, but as a modification, the top data of each series of data written in the physical block And a start logical page number (hereinafter referred to as “SLPN”) that is a logical page number of the logical page corresponding to, and a start physical page number (hereinafter referred to as “SLPN”). SPPN ”) and the number of pages to which the series of data is written (a page count value that is the number of logical pages from the logical page to which the first data belongs to the logical page to which the last data belongs, hereinafter referred to as“ PCNT ”) And information indicating a physical block in which the series of data is written (first physical block or second physical block) Physical block may be information) indicating. When such information is written, a table indicating the correspondence between logical pages and physical pages is created based on this information.

例えば、図10(A)〜(C)は、ページ管理情報#0〜#2のそれぞれの変形例であるページ管理情報#0´〜#2´をそれぞれ示している。ページ管理情報#0´〜#2´において、第nのSLPN、SPPN及びPCNTの組は、第nの一連のデータに対応する。また、2個目の物理ブロックに書き込まれたページ管理情報#2´において、2個目の物理ブロックに書き込まれている一連のデータに対応するSLPN、SPPN及びPCNTの組には、旧ブロックフラグが関連付けられる。尚、物理ブロック内の先頭の物理ページからLPNの順番でデータが書き込まれている部分については、複数個の一連のデータに対応する部分が、1つの情報としてまとめられてもよい。例えば、第1乃至第4の一連のデータに対応する部分が、SLPNが#8、SPPNが#0、PCNTが48というような1つの情報にまとめられてもよい。   For example, FIGS. 10A to 10C show page management information # 0 ′ to # 2 ′, which are modified examples of the page management information # 0 to # 2. In the page management information # 0 ′ to # 2 ′, the nth SLPN, SPPN, and PCNT set corresponds to the nth series of data. In the page management information # 2 ′ written in the second physical block, the old block flag is included in the set of SLPN, SPPN and PCNT corresponding to a series of data written in the second physical block. Are associated. As for a portion where data is written in the order of LPN from the first physical page in the physical block, portions corresponding to a plurality of series of data may be collected as one piece of information. For example, portions corresponding to the first to fourth series of data may be combined into one piece of information such as # 8 for SLPN, # 0 for SPPN, and 48 for PCNT.

この変形例では、論理ページと物理ページの最新の対応関係を示すテーブルは、最新のページ管理情報に基づいて作成される。この作成処理では、後から書き込まれた一連のデータに対応する論理ページと物理ページの対応関係が優先されるようにして、LPN#0−#63の64個の論理ページ番号(LPN)に対応したレコードに物理ページ番号(PPN)が書き込まれていく。つまり、各レコードに書き込まれる物理ページ番号(PPN)については、後から書き込まれた一連のデータに対応する物理ページ番号(PPN)の方が上書きされるようにすればよい。尚、論理ページと物理ページの対応関係は、SLPN、SPPN及びPCNTの組に基づいて把握される。   In this modification, a table indicating the latest correspondence between logical pages and physical pages is created based on the latest page management information. In this creation process, the correspondence between logical pages and physical pages corresponding to a series of data written later is prioritized, and 64 logical page numbers (LPN) LPN # 0 to # 63 are supported. The physical page number (PPN) is written in the recorded record. That is, the physical page number (PPN) written in each record may be overwritten with the physical page number (PPN) corresponding to a series of data written later. The correspondence relationship between the logical page and the physical page is grasped based on the set of SLPN, SPPN, and PCNT.

例えば、ページ管理情報#2´に基づいて、図9に示したようなテーブルが作成される。このテーブル作成処理では、それぞれの一連のデータに対応する論理ページと物理ページの対応関係に基づいて、各レコードに物理ページ番号(PPN)が書き込まれていく。この物理ページ番号(PPN)の書き込みは、先に書き込まれた一連のデータに対応する方から順番に行われ、書き込み先のレコードに既に物理ページ番号(PPN)が書き込まれていても、後から物理ページ番号(PPN)が上書きされる。従って、後から書き込まれた一連のデータに対応する論理ページと物理ページの対応関係を優先したテーブルが作成される。   For example, a table as shown in FIG. 9 is created based on the page management information # 2 ′. In this table creation process, a physical page number (PPN) is written in each record based on the correspondence between the logical page and physical page corresponding to each series of data. The writing of the physical page number (PPN) is performed in order from the one corresponding to the previously written series of data. Even if the physical page number (PPN) is already written in the write destination record, the physical page number (PPN) is written later. The physical page number (PPN) is overwritten. Therefore, a table is created that prioritizes the correspondence between logical pages and physical pages corresponding to a series of data written later.

以上、本発明の幾つかの実施形態を説明したが、これらは本発明の説明のための例示であって、本発明の範囲をこれらの実施形態にのみ限定する趣旨ではない。本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。   As mentioned above, although several embodiment of this invention was described, these are the illustrations for description of this invention, Comprising: It is not the meaning which limits the scope of the present invention only to these embodiment. Of course, various modifications can be made without departing from the scope 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 is 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). Not stored in a physical sector area or physical page). 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.

また、上記の実施の形態では、書き込み処理が正常に終了したことを示す終了マークが分割冗長領域70又は共通冗長領域50に書き込まれていたが、管理フラグ、論理セクタ番号又は論理ページ番号にこの終了マークの役割をさせるようにしてもよい。   In the above embodiment, the end mark indicating that the writing process has been normally completed is written in the divided redundant area 70 or the common redundant area 50. However, the management flag, logical sector number, or logical page number It may be made to serve as an end mark.

つまり、セクタ管理情報(又はページ管理情報)が書き込まれない場合にだけ、一連のデータの末尾データが書き込まれた物理セクタ領域60(又は物理ページ)に対応する分割冗長領域70(又は共通冗長領域50)に、その末尾データに対応する論理セクタ領域(又は論理ページ)の論理セクタ番号(又は論理ページ番号)が書き込まれるようにすればよい。セクタ管理情報(又はページ管理情報)が書き込まれる場合には、一連のデータの末尾データが書き込まれた物理セクタ領域60(又は物理ページ)に対応する分割冗長領域70(又は共通冗長領域50)に論理セクタ番号(又は論理ページ番号)が書き込まれず、セクタ管理情報(又はページ管理情報)が書き込まれた物理セクタ領域60(又は物理ページ)に対応する分割冗長領域70(又は共通冗長領域50)に管理フラグが書き込まれる。このようにすれば、書き込み処理が正常に終了したときにだけ、分割冗長領域70(又は共通冗長領域50)に管理フラグ又は論理セクタ番号(又は論理ページ番号)が書き込まれる。また、セクタ管理情報(又はページ管理情報)が書き込まれない場合には、データが書き込まれている末尾の物理セクタ領域60(又は物理ページ)に記憶されているデータに対応する論理セクタ領域(又は論理ページ)の論理セクタ番号(又は論理ページ番号)が、データが書き込まれている末尾の物理セクタ領域60(又は物理ページ)に対応する分割冗長領域70(又は共通冗長領域50)に記憶されているため、第2の論理セクタ領域の論理セクタ番号を容易に求めることができる。尚、このようにした場合には、一連のデータの先頭データが書き込まれた物理セクタ領域60(又は物理ページ)に対応する分割冗長領域70(又は共通冗長領域50)に、その先頭データに対応する論理セクタ領域(又は論理ページ)の論理セクタ番号(又は論理ページ番号)は書き込まれる必要がなくなるため、その先頭データに対応する論理セクタ領域(又は論理ページ)の論理セクタ番号(又は論理ページ番号)は書き込まれない。   That is, only when the sector management information (or page management information) is not written, the divided redundant area 70 (or common redundant area) corresponding to the physical sector area 60 (or physical page) in which the end data of the series of data is written. 50), the logical sector number (or logical page number) of the logical sector area (or logical page) corresponding to the tail data may be written. When the sector management information (or page management information) is written, the divided redundant area 70 (or common redundant area 50) corresponding to the physical sector area 60 (or physical page) in which the end data of a series of data is written is written. The logical sector number (or logical page number) is not written and the divided redundant area 70 (or common redundant area 50) corresponding to the physical sector area 60 (or physical page) in which the sector management information (or page management information) is written is written. Management flag is written. In this way, the management flag or the logical sector number (or logical page number) is written into the divided redundant area 70 (or the common redundant area 50) only when the writing process is normally completed. Further, when sector management information (or page management information) is not written, a logical sector area (or corresponding to data stored in the last physical sector area 60 (or physical page) in which data is written). The logical sector number (or logical page number) of the logical page is stored in the divided redundant area 70 (or common redundant area 50) corresponding to the last physical sector area 60 (or physical page) in which data is written. Therefore, the logical sector number of the second logical sector area can be easily obtained. In this case, the divided redundant area 70 (or common redundant area 50) corresponding to the physical sector area 60 (or physical page) in which the first data of a series of data is written corresponds to the first data. Since it is not necessary to write the logical sector number (or logical page number) of the logical sector area (or logical page) to be executed, the logical sector number (or logical page number) of the logical sector area (or logical page) corresponding to the head data is eliminated. ) Is not written.

本発明の第1の実施形態によるフラッシュメモリシステムの概略構成を示すブロック図である。1 is a block diagram showing a schematic configuration of a flash memory system according to a first embodiment of the present invention. フラッシュメモリの物理ページの構成を示す図である。It is a figure which shows the structure of the physical page of flash memory. 論理ブロックと物理ブロックの対応関係を示す図である。It is a figure which shows the correspondence of a logical block and a physical block. 図4(A)は、物理ブロック内の256個の物理セクタ領域のうちの前半部分に対する書き込みの結果の一例を示す。図4(B)は、物理ブロック内の256個の物理セクタ領域のうちの後半部分に対する書き込みの結果の一例を示す。FIG. 4A shows an example of a result of writing to the first half portion of 256 physical sector areas in the physical block. FIG. 4B shows an example of the result of writing to the latter half of the 256 physical sector areas in the physical block. 図5(A)は、図4(A)に示したセクタ管理情報#0の中身を示す。図5(B)は、図4(A)に示したセクタ管理情報#1の中身を示す。図5(C)は、図4(B)に示したセクタ管理情報#2の中身を示す。図5(D)は、図4(B)に示したセクタ管理情報#3の中身を示す。FIG. 5A shows the contents of sector management information # 0 shown in FIG. FIG. 5B shows the contents of sector management information # 1 shown in FIG. FIG. 5C shows the contents of the sector management information # 2 shown in FIG. FIG. 5D shows the contents of the sector management information # 3 shown in FIG. 図6(A)は、図5(A)に示したセクタ管理情報#0の変形例を示す。図6(B)は、図5(B)に示したセクタ管理情報#1の変形例を示す。図6(C)は、図5(C)に示したセクタ管理情報#2の変形例を示す。図6(D)は、図5(D)に示したセクタ管理情報#3の変形例を示す。FIG. 6A shows a modification of the sector management information # 0 shown in FIG. FIG. 6B shows a modification of the sector management information # 1 shown in FIG. FIG. 6C shows a modification of the sector management information # 2 shown in FIG. FIG. 6D shows a modification of the sector management information # 3 shown in FIG. 図7(A)は、同一の論理ブロックに割り当てられた一方の物理ブロックPBA#7に対する書き込みの結果の一例を示す。図7(B)は、同一の論理ブロックに割り当てられた他方の物理ブロックPBA#16に対する書き込みの結果の一例を示す。FIG. 7A shows an example of a result of writing to one physical block PBA # 7 assigned to the same logical block. FIG. 7B shows an example of a result of writing to the other physical block PBA # 16 assigned to the same logical block. 図8(A)は、図7(A)に示したページ管理情報#0の中身を示す。図8(B)は、図7(A)に示したページ管理情報#1の中身を示す。FIG. 8A shows the contents of the page management information # 0 shown in FIG. FIG. 8B shows the contents of the page management information # 1 shown in FIG. 図9は、図7(B)に示したページ管理情報#2の中身を示す。FIG. 9 shows the contents of the page management information # 2 shown in FIG. 図10(A)は、図8(A)に示したページ管理情報#0の変形例を示す。図10(B)は、図8(B)に示したページ管理情報#1の変形例を示す。図10(C)は、図9に示したページ管理情報#2の変形例を示す。FIG. 10A shows a modification of the page management information # 0 shown in FIG. FIG. 10B shows a modification of the page management information # 1 shown in FIG. FIG. 10C shows a modification of the page management information # 2 shown in FIG.

符号の説明Explanation of symbols

1…フラッシュメモリシステム、2…フラッシュメモリ、3…メモリコントローラ、6…マイクロプロセッサ DESCRIPTION OF SYMBOLS 1 ... Flash memory system, 2 ... Flash memory, 3 ... Memory controller, 6 ... Microprocessor

Claims (11)

ホストシステムから与えられるアクセス指示に基づいて、複数個の物理セクタ領域を含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
複数個の論理セクタ領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理セクタ領域の先頭を検索する空きセクタ領域検索手段と、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索手段によって検出されたデータが書き込まれていない先頭の前記物理セクタ領域から、末尾の前記物理セクタ領域に向かって順次書き込んでいくデータ書き込み手段と、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータの先頭データに対応する前記論理セクタ領域である第1の領域が、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理セクタ領域に記憶されているデータに対応する前記論理セクタ領域である第2の領域に後続する領域であるか否かを判断する判断手段と、
前記判断手段により前記第1の領域は前記第2の領域に後続する領域ではないと判断された場合に、前記データ書き込み手段により前記一連のデータが書き込まれた前記物理ブロック内の前記物理セクタ領域と、前記物理ブロックに対応する前記論理ブロック内の前記論理セクタ領域との対応関係を示すセクタ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理セクタ領域の次の前記物理セクタ領域に書き込むセクタ管理情報書き込み手段と、
を備え、
前記判断手段は、前記末尾の前記物理セクタ領域に記憶されているデータが前記セクタ管理情報である場合、前記第1の領域は前記第2の領域に後続する領域ではないと判断する、
ことを特徴とするメモリコントローラ。
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;
Empty sector area search means for searching for the beginning of the physical sector area in which data in the physical block corresponding to the logical block to which the logical access area specified as the area to be accessed by the access instruction belongs is not written;
A series of data instructed to be written to the logical access area by the access instruction is transferred from the head physical sector area to which the data detected by the free sector area search means is not written, to the physical address at the end. Data writing means for sequentially writing toward the sector area;
The first area, which is the logical sector area corresponding to the head data of a series of data instructed to be written to the logical access area by the access instruction, corresponds to the logical block to which the logical access area belongs. Judgment means for judging whether it is an area following the second area which is the logical sector area corresponding to the data stored in the last physical sector area in which the data in the physical block is written When,
The physical sector area in the physical block in which the series of data has been written by the data writing means when the determining means determines that the first area is not an area following the second area And sector management information indicating a correspondence relationship with the logical sector area in the logical block corresponding to the physical block, the physical sector area next to the physical sector area in which the end data of the series of data is written Sector management information writing means for writing to
With
The determination means determines that the first area is not an area following the second area when the data stored in the physical sector area at the end is the sector management information.
A memory controller characterized by that.
前記判断手段は、前記論理ブロック内の前記論理セクタ領域に付けられた通し番号に基づいて前記第1の領域が前記第2の領域に後続する領域であるか否かを判断する判断手段であって、前記第1の領域に対応する通し番号が第2の領域に対応する通し番号の次の番号でないときに、前記第1の領域は前記第2の領域に後続する領域ではないと判断する、
ことを特徴とする請求項1記載のメモリコントローラ。
The determination means is a determination means for determining whether or not the first area is an area following the second area based on a serial number assigned to the logical sector area in the logical block. Determining that the first area is not an area following the second area when the serial number corresponding to the first area is not the next number of the serial number corresponding to the second area;
The memory controller according to claim 1.
前記アクセス指示により指定された前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内の前記物理セクタ領域に記憶されているデータを、前記物理ブロック内のデータが書き込まれている末尾の前記物理セクタ領域に記憶されている前記セクタ管理情報に基づいて読み出すデータ読み出し手段を更に備える、
ことを特徴とする請求項1又は2に記載のメモリコントローラ。
The data stored in the physical sector area in the physical block corresponding to the logical block to which the logical access area specified by the access instruction belongs is changed to the end of the data in which the data in the physical block is written. Further comprising data reading means for reading based on the sector management information stored in the physical sector area,
The memory controller according to claim 1, wherein the memory controller is a memory controller.
前記データ読み出し手段は、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内に前記セクタ管理情報が記憶されていないとき、前記物理ブロックに記憶されているデータは、前記物理ブロック内の先頭の前記物理セクタ領域に記憶されているデータに対応する前記論理セクタ領域以降の前記論理セクタ領域に対応するデータが前記論理セクタ領域の順番で書き込まれているとみなして、データの読出しを行う、
ことを特徴とする請求項3に記載のメモリコントローラ。
When the sector management information is not stored in the physical block corresponding to the logical block to which the logical access area belongs, the data read means stores the data stored in the physical block in the physical block. The data corresponding to the logical sector area after the logical sector area corresponding to the data stored in the head physical sector area is regarded as being written in the order of the logical sector area, and data is read. ,
The memory controller according to claim 3.
ホストシステムから与えられるアクセス指示に基づいて、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
複数個の論理ページで構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記アクセス指示によりアクセス対象の論理ページとして指定された論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理ページの先頭を検索する空きページ検索手段と、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータを、前記空きページ検索手段によって検出されたデータが書き込まれていない先頭の前記物理ページから、末尾の前記物理ページに向かって順次書き込んでいくデータ書き込み手段と、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータの先頭データに対応する前記論理ページである第1のページが、前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理ページに記憶されているデータに対応する前記論理ページである第2のページに後続するページであるか否かを判断する判断手段と、
前記判断手段により前記第1のページは前記第2のページに後続するページではないと判断された場合に、前記データ書き込み手段により前記一連のデータが書き込まれた前記物理ブロック内の前記物理ページと、前記物理ブロックに対応する前記論理ブロック内の前記論理ページとの対応関係を示すページ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理ページの次の前記物理ページに書き込むページ管理情報書き込み手段と、
を備え、
前記判断手段は、前記末尾の前記物理ページに記憶されているデータが前記ページ管理情報である場合、前記第1のページは前記第2のページに後続するページではないと判断する、
ことを特徴とするメモリコントローラ。
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;
Empty page search means for searching for the top of the physical page in which data in the physical block corresponding to the logical block to which the logical access page designated as the logical page to be accessed belongs by the access instruction belongs,
A series of data instructed to be written to the logical access page by the access instruction is transferred from the first physical page to which the data detected by the empty page search unit is not written to the last physical page. Data writing means for sequentially writing toward the
The first page which is the logical page corresponding to the first data of a series of data instructed to be written to the logical access page by the access instruction corresponds to the logical block to which the logical access page belongs. Determining means for determining whether the page is subsequent to the second page that is the logical page corresponding to the data stored in the last physical page in which data in the physical block is written;
When the determining means determines that the first page is not a page following the second page, the physical page in the physical block in which the series of data has been written by the data writing means Page management information for writing page management information indicating a correspondence relationship with the logical page in the logical block corresponding to the physical block to the physical page next to the physical page in which the end data of the series of data is written Information writing means;
With
The determination unit determines that the first page is not a page following the second page when the data stored in the physical page at the end is the page management information;
A memory controller characterized by that.
前記判断手段は、前記論理ブロック内の前記論理ページに付けられた通し番号に基づいて前記第1のページが前記第2のページに後続するページであるか否かを判断する判断手段であって、前記第1のページに対応する通し番号が第2のページに対応する通し番号の次の番号でないときに、前記第1のページは前記第2のページに後続するページではないと判断する、
ことを特徴とする請求項5記載のメモリコントローラ。
The determination means is a determination means for determining whether the first page is a page following the second page based on a serial number assigned to the logical page in the logical block, Determining that the first page is not a page following the second page when the serial number corresponding to the first page is not the next number of the serial number corresponding to the second page;
The memory controller according to claim 5.
前記アクセス指示により指定された前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内の前記物理ページに記憶されているデータを、前記物理ブロック内のデータが書き込まれている末尾の前記物理ページに記憶されている前記ページ管理情報に基づいて読み出すデータ読み出し手段を更に備える、
ことを特徴とする請求項5又は6に記載のメモリコントローラ。
The data stored in the physical page in the physical block corresponding to the logical block to which the logical access page specified by the access instruction belongs is changed to the last physical in which the data in the physical block is written. Data reading means for reading based on the page management information stored in the page;
The memory controller according to claim 5, wherein the memory controller is a memory controller.
前記データ読み出し手段は、前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内に前記ページ管理情報が記憶されていないとき、前記物理ブロックに記憶されているデータは、前記物理ブロック内の先頭の前記物理ページに記憶されているデータに対応する前記論理ページ以降の前記論理ページに対応するデータが前記論理ページの順番で書き込まれているとみなして、データの読出しを行う、
ことを特徴とする請求項7に記載のメモリコントローラ。
When the page management information is not stored in the physical block corresponding to the logical block to which the logical access page belongs, the data read means stores the data stored in the physical block in the physical block. The data corresponding to the logical pages after the logical page corresponding to the data stored in the first physical page is regarded as being written in the order of the logical pages, and data is read.
The memory controller according to claim 7.
請求項1乃至8のうちのいずれか1項に記載のメモリコントローラと、
前記メモリコントローラによってアクセスされるフラッシュメモリと
を備えるフラッシュメモリシステム。
A memory controller according to any one of claims 1 to 8,
And a flash memory system accessed by the memory controller.
ホストシステムから与えられるアクセス指示に基づいて、複数個の物理セクタ領域を含む物理ブロック単位で消去が行われるフラッシュメモリの制御方法であって、
複数個の論理セクタ領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記アクセス指示によりアクセス対象の領域として指定された論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理セクタ領域の先頭を検索する空きセクタ領域検索ステップと、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータを、前記空きセクタ領域検索ステップによって検出されたデータが書き込まれていない先頭の前記物理セクタ領域から、末尾の前記物理セクタ領域に向かって順次書き込んでいくデータ書き込みステップと、
前記アクセス指示により前記論理アクセス領域に対して書き込むことが指示された一連のデータの先頭データに対応する前記論理セクタ領域である第1の領域が、前記論理アクセス領域が属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理セクタ領域に記憶されているデータに対応する前記論理セクタ領域である第2の領域に後続する領域であるか否かを判断する判断ステップと、
前記判断ステップにより前記第1の領域は前記第2の領域に後続する領域ではないと判断された場合に、前記データ書き込みステップにより前記一連のデータが書き込まれた前記物理ブロック内の前記物理セクタ領域と、前記物理ブロックに対応する前記論理ブロック内の前記論理セクタ領域との対応関係を示すセクタ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理セクタ領域の次の前記物理セクタ領域に書き込むセクタ管理情報書き込みステップと、
を備え、
前記判断ステップでは、前記末尾の前記物理セクタ領域に記憶されているデータが前記セクタ管理情報である場合、前記第1の領域は前記第2の領域に後続する領域ではないと判断する、
ことを特徴とするフラッシュメモリの制御方法。
A flash memory control method in which erasure is performed 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 step for managing a correspondence relationship between a logical block composed of a plurality of logical sector areas and the physical block;
A free sector area search step for searching for the beginning of the physical sector area in which data in the physical block corresponding to the logical block to which the logical access area designated as the access target area by the access instruction belongs is not written;
A series of data instructed to be written to the logical access area by the access instruction is transferred from the first physical sector area to which the data detected by the free sector area search step is not written to the last physical sector. A data writing step of sequentially writing toward the sector area;
The first area, which is the logical sector area corresponding to the head data of a series of data instructed to be written to the logical access area by the access instruction, corresponds to the logical block to which the logical access area belongs. A determination step of determining whether or not it is an area following the second area which is the logical sector area corresponding to the data stored in the physical sector area at the end in which the data in the physical block is written When,
When the determination step determines that the first area is not an area following the second area, the physical sector area in the physical block in which the series of data has been written by the data write step And sector management information indicating a correspondence relationship with the logical sector area in the logical block corresponding to the physical block, the physical sector area next to the physical sector area in which the end data of the series of data is written Sector management information writing step to write to,
With
In the determination step, when the data stored in the physical sector area at the end is the sector management information, it is determined that the first area is not an area subsequent to the second area.
A method for controlling a flash memory.
ホストシステムから与えられるアクセス指示に基づいて、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリの制御方法であって、
複数個の論理ページで構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記アクセス指示によりアクセス対象の論理ページとして指定された論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれていない前記物理ページの先頭を検索する空きページ検索ステップと、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータを、前記空きページ検索ステップによって検出されたデータが書き込まれていない先頭の前記物理ページから、末尾の前記物理ページに向かって順次書き込んでいくデータ書き込みステップと、
前記アクセス指示により前記論理アクセスページに対して書き込むことが指示された一連のデータの先頭データに対応する前記論理ページである第1のページが、前記論理アクセスページが属する前記論理ブロックと対応する前記物理ブロック内のデータが書き込まれている末尾の前記物理ページに記憶されているデータに対応する前記論理ページである第2のページに後続するページであるか否かを判断する判断ステップと、
前記判断ステップにより前記第1のページは前記第2のページに後続するページではないと判断された場合に、前記データ書き込みステップにより前記一連のデータが書き込まれた前記物理ブロック内の前記物理ページと、前記物理ブロックに対応する前記論理ブロック内の前記論理ページとの対応関係を示すページ管理情報を、前記一連のデータの末尾データが書き込まれた前記物理ページの次の前記物理ページに書き込むページ管理情報書き込みステップと、
を備え、
前記判断ステップでは、前記末尾の前記物理ページに記憶されているデータが前記ページ管理情報である場合、前記第1のページは前記第2のページに後続するページではないと判断する、
ことを特徴とするフラッシュメモリの制御方法。
A flash memory control method in which erasure is performed in units of physical blocks including a plurality of physical pages based on an access instruction given from a host system,
A block management step for managing a correspondence relationship between a logical block composed of a plurality of logical pages and the physical block;
A free page search step of searching for the top of the physical page in which data in the physical block corresponding to the logical block to which the logical access page designated as the logical page to be accessed by the access instruction belongs is not written;
A series of data instructed to be written to the logical access page by the access instruction is transferred from the first physical page to which the data detected by the empty page search step is not written to the last physical page. A data writing step of sequentially writing toward the
The first page which is the logical page corresponding to the first data of a series of data instructed to be written to the logical access page by the access instruction corresponds to the logical block to which the logical access page belongs. A determination step of determining whether or not the page is subsequent to the second page which is the logical page corresponding to the data stored in the last physical page in which data in the physical block is written;
When the determination step determines that the first page is not a page subsequent to the second page, the physical page in the physical block in which the series of data has been written by the data writing step Page management information for writing page management information indicating a correspondence relationship with the logical page in the logical block corresponding to the physical block to the physical page next to the physical page in which the end data of the series of data is written An information writing step;
With
In the determination step, when the data stored in the physical page at the end is the page management information, it is determined that the first page is not a page subsequent to the second page.
A method for controlling a flash memory.
JP2008018614A 2008-01-30 2008-01-30 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Active JP4687720B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008018614A JP4687720B2 (en) 2008-01-30 2008-01-30 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008018614A JP4687720B2 (en) 2008-01-30 2008-01-30 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Publications (2)

Publication Number Publication Date
JP2009181254A JP2009181254A (en) 2009-08-13
JP4687720B2 true JP4687720B2 (en) 2011-05-25

Family

ID=41035209

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008018614A Active JP4687720B2 (en) 2008-01-30 2008-01-30 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Country Status (1)

Country Link
JP (1) JP4687720B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5093294B2 (en) * 2010-05-14 2012-12-12 Tdk株式会社 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP5949122B2 (en) * 2012-05-11 2016-07-06 ソニー株式会社 Control device, storage device, and storage control method
US20200151119A1 (en) * 2018-11-08 2020-05-14 Silicon Motion, Inc. Method and apparatus for performing access control between host device and memory device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003208352A (en) * 2002-01-17 2003-07-25 Fujitsu Ltd Flash memory enabling restriction of writing frequency and ware levelling
JP2007280108A (en) * 2006-04-07 2007-10-25 Sony Corp Storage medium controller, storage medium control method, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003208352A (en) * 2002-01-17 2003-07-25 Fujitsu Ltd Flash memory enabling restriction of writing frequency and ware levelling
JP2007280108A (en) * 2006-04-07 2007-10-25 Sony Corp Storage medium controller, storage medium control method, and program

Also Published As

Publication number Publication date
JP2009181254A (en) 2009-08-13

Similar Documents

Publication Publication Date Title
JP5087347B2 (en) Semiconductor memory device and method for controlling semiconductor memory device
JP4844639B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4666080B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JPWO2007000862A1 (en) MEMORY CONTROLLER, NONVOLATILE MEMORY DEVICE, NONVOLATILE MEMORY SYSTEM, AND DATA WRITE METHOD
JP4666081B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
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
JP4687720B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4737223B2 (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
JP4661497B2 (en) Memory controller, flash memory system, and flash memory control method
JP4235646B2 (en) Memory controller and flash memory system
JP4743185B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4702703B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4760826B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4241741B2 (en) Memory controller and flash memory system
JP2012068765A (en) Memory controller, flash memory system with memory controller, and control method of flash memory
JP4710918B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2008123241A (en) Memory controller, flash memory system equipped with memory controller, and method for controlling flash memory
JP4513786B2 (en) Memory controller, memory system, and memory control method
JP4636046B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2012068764A (en) Memory controller, nonvolatile memory system with memory controller, and control method of nonvolatile memory
JP4952741B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4952742B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4641034B2 (en) Nonvolatile storage system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101221

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

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110131

R150 Certificate of patent or registration of utility model

Ref document number: 4687720

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140225

Year of fee payment: 3