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 PDFInfo
- 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
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.
各物理ページの冗長領域に対応する論理ページ(又は論理セクタ領域)の番号等の論理ページ(又は論理セクタ領域)を特定する情報を書き込んでおけば、この情報に基づいて、論理ページ(又は論理セクタ領域)と物理ページ(又は物理セクタ領域)の対応関係を把握することができる。 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
図1に示すように、フラッシュメモリシステム1は、フラッシュメモリ2と、それを制御するメモリコントローラ3とで構成されている。
As shown in FIG. 1, the
フラッシュメモリシステム1は、外部バス13を介してホストシステム4と接続されている。ホストシステム4は、ホストシステム4の全体の動作を制御するためのCPU(Central Processing Unit)、フラッシュメモリシステム1との情報の授受を担うコンパニオンチップ等から構成されている。ホストシステム4は、例えば、文字、音声、あるいは画像情報等の種々の情報を処理するパーソナルコンピュータやデジタルスチルカメラをはじめとする各種情報処理装置であってもよい。
The
メモリコントローラ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
ホストインターフェースブロック7は、ホストシステム4との間でデータ、アドレス情報、ステータス情報、外部コマンド等の授受を行なう。外部コマンドとは、ホストシステム4がフラッシュメモリシステム1に対して処理の実行を指示するためのコマンドである。ホストシステム4よりフラッシュメモリシステム1に供給されるデータ等は、ホストインターフェースブロック7を入口としてフラッシュメモリシステム1の内部(例えば、バッファ9)に取り込まれる。また、フラッシュメモリシステム1からホストシステム4に供給されるデータ等は、ホストインターフェースブロック7を出口としてホストシステム4に供給される。
The
ホストインターフェースブロック7は、コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3を備えている。コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3には、ホストシステム4から与えられる情報が書き込まれる。コマンドレジスタR1には、書き込みコマンド、読み出しコマンド等の外部コマンドが書き込まれる。セクタ数レジスタR2にはアクセス対象領域のセクタ数が書き込まれる。LBAレジスタR3には、アクセス対象領域の先頭のLBA(Logical Block Address)(後述)が書き込まれる。
The
ワークエリア8は、フラッシュメモリ2の制御に必要なデータを一時的に格納する作業領域であり、複数のSRAM(Static Random Access Memory)セルによって構成されている。ワークエリア8には、例えば、論理ブロックと物理ブロックとの対応関係を示したアドレス変換テーブル(後述)等が記憶される。
The
バッファ9は、フラッシュメモリ2から読み出したデータを、ホストシステム4が受け取り可能な状態となるまで保持する。また、バッファ9は、フラッシュメモリ2に書き込むデータを、フラッシュメモリ2が書き込み可能な状態となるまで保持する。
The
フラッシュメモリインターフェースブロック10は、内部バス14を介して、フラッシュメモリ2との間でデータ、アドレス情報、ステータス情報、内部コマンド等の授受を行う。ここで、内部コマンドとは、メモリコントローラ3がフラッシュメモリ2に処理の実行を指示するためのコマンドであり、フラッシュメモリ2は、メモリコントローラ3から与えられる内部コマンドに従って動作する。
The flash
ECCブロック11は、フラッシュメモリ2に書き込むデータに付加される誤り訂正符号(ECC:Error Collection Code)を生成するとともに、読み出したデータに付加されている誤り訂正符号に基づいて、読み出したデータに含まれる誤りを検出・訂正する。
The
ROM12は、マイクロプロセッサ6による処理の手順を定義するプログラムを格納する不揮発性の記憶素子である。例えば、アドレス変換テーブルの作成等の処理手順を定義するプログラムが格納されている。
The
マイクロプロセッサ6は、ROM12に記憶されているプログラムに従って、メモリコントローラ3の全体の動作を制御する。例えば、マイクロプロセッサ6は、ROM12から読み出した各種処理を定義したコマンドセットに基づいてフラッシュメモリインターフェースブロック10に処理を実行させる。
The
フラッシュメモリ2はNAND型フラッシュメモリからなる。NAND型フラッシュメモリは、レジスタと、複数のメモリセルが2次元的に配列されたメモリセルアレイを備えている。メモリセルアレイは、複数のメモリセル群と、ワード線とを備える。ここで、メモリセル群は、複数のメモリセルが直列に接続されたものである。各ワード線は、メモリセル群の特定のメモリセルを選択するためのものである。このワード線を介して選択されたメモリセルとレジスタとの間で、レジスタから選択されたメモリセルへのデータの書き込み又は選択されたメモリセルからレジスタへのデータの読み出しが行われる。
The
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
図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
本実施形態では、図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
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
このように、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
ブロックステータス(フラグ)は、物理ブロックの良否を示すフラグである。尚、初期不良の物理ブロックについては、不良ブロック(正常にデータの書き込み等を行うことができない物理ブロック)であることを示すブロックステータス(フラグ)が製造メーカによって書き込まれている。また、この初期不良の物理ブロックを示すブロックステータス(フラグ)を、ユーザ領域に書き込んでいる製造メーカもある。 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
本実施形態では、図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
更に、この論理ブロックを複数個まとめた論理グループが形成されている。以下、論理グループに付けられた通し番号を論理グループ番号(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
この論理グループは単なるアドレス変換テーブルの作成単位であり、どの論理ブロックがどの物理ブロックに割り当てられても良い。 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
尚、フラッシュメモリ内の物理ブロックには、出荷時から不良である先天性の不良ブロックが含まれている。更に、出荷時に良品の物理ブロックであっても、使用開始後に劣化して不良ブロックになる物理ブロック(後天性の不良ブロック)もある。従って、本実施形態では、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
第1の実施形態の書き込み処理では、ホストシステム4によって、コマンドレジスタR1に、書き込みコマンドを示すコマンドコードが書き込まれ、セクタ数レジスタR2に、書き込むデータのセクタ数が書き込まれ、LBAレジスタR3には、書き込みを開始する先頭データに対応するLBAが書き込まれる。セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて、アクセス対象の領域である論理アクセス領域が判別され、その論理アクセス領域が含まれる論理ブロックに対応する物理ブロック内のデータが書き込まれていない物理セクタ領域60の先頭から、ホストシステム4から与えられるデータが書き込まれる。
In the write processing of the first embodiment, the
セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別される論理アクセス領域が複数個の論理ブロックに跨っている場合は、データの書き込み先になる物理ブロックも複数個になる。従って、論理アクセス領域が複数個の論理ブロックに跨っている場合は、論理アクセス領域が属する論理ブロック毎に領域を分割してデータの書き込み処理が行われる。例えば、論理アクセス領域が2個の論理ブロック(第1の論理ブロックと第2の論理ブロック)に跨っている場合は、第1の論理ブロックに対応する物理ブロックに対する書き込み処理と、第2の論理ブロックに対応する物理ブロックに対する書き込み処理とが行われる。第1の論理ブロックに属する論理アクセス領域に対して書き込むことが指示されたデータについては、第1の論理ブロックに対応する物理ブロック内のデータが書き込まれていない物理セクタ領域60に書き込まれる。第2の論理ブロックに属する論理アクセス領域に対して書き込むことが指示されたデータについては、第2の論理ブロックに対応する物理ブロック内のデータが書き込まれていない物理セクタ領域60に書き込まれる。
When the logical access area determined based on the information written in the sector number register R2 and the LBA register R3 extends over a plurality of logical blocks, there are a plurality of physical blocks to which data is written. Therefore, when the logical access area extends over a plurality of logical blocks, the area is divided for each logical block to which the logical access area belongs, and data write processing is performed. For example, when the logical access area extends over two logical blocks (the first logical block and the second logical block), the write processing for the physical block corresponding to the first logical block and the second logical block Write processing is performed on the physical block corresponding to the block. Data instructed to be written to the logical access area belonging to the first logical block is written to the
以下の説明で、ホストシステム4から与えられる情報(つまり、コマンドレジスタR1、セクタ数レジスタR2及びLBAレジスタR3に書き込まれる情報)に基づいて実行される1セクタ又は複数セクタのデータの書き込み処理において、書き込まれるデータを、「一連のデータ」と言う。例えば、セクタ数レジスタR2に書き込まれた値がnの場合(nは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
ホストシステム4は、書き込むデータのアドレス又は読み出すデータのアドレスをLBAで指示する。つまり、セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別されるLBA(セクタ数レジスタR2に書き込まれた値が1の場合)、又は、LBAが連続する範囲(セクタ数レジスタR2に書き込まれた値が2以上の場合)が、書き込むデータの書き込み先を指示するアドレス又は読み出すデータの読み出し元を指示するアドレスになる。
The
ここで、1個の論理ブロックに含まれる論理セクタ領域の個数が2i個(例えば、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
以下、本実施形態での書き込みの概要を説明する。 Hereinafter, an outline of writing in this embodiment will be described.
メモリコントローラ3は、ホストシステム4から与えられる書き込み指示(書き込みコマンド及び書き込み先のアドレス)に従って、この書き込み指示と共に与えられる一連のデータを、フラッシュメモリ2に書き込む。この書き込み処理では、書き込み先の論理セクタ領域が属する論理ブロックが特定され、その論理ブロックに対応する物理ブロック(又は、この論理ブロックに対して新たに割り当てた物理ブロック)に、一連のデータが書き込まれる。物理ブロック内の物理セクタ領域60には、先頭から順番に(つまりPSNが小さいほうから順番に)一連のデータが書き込まれていく。従って、メモリコントローラ3が一連のデータを書き込むときには、物理ブロック内のデータが書き込まれている物理セクタ領域の末尾の検索が行われる。そして、その末尾の物理セクタ領域60の次の物理セクタ領域60から一連のデータが順次書き込まれていく。言い換えれば、物理ブロック内のデータが書き込まれていない先頭の物理セクタ領域から一連のデータが順次書き込まれていく。
The
本実施形態では、一連のデータの末尾データが書き込まれた物理セクタ領域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
本実施形態では、一連のデータを書き込む際に、その一連のデータを書き込む物理ブロック内の物理セクタ領域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
従って、セクタ管理情報を書き込まれていない物理ブロックの場合、その物理ブロック内の先頭の物理セクタ領域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
例えば、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60がPSN#63の物理セクタ領域60であり、物理ブロック内のPSN#0〜#63の物理セクタ領域60にLSN#8〜#71の論理セクタ領域に対応するデータがLSNの順番で書き込まれているような場合には、その物理ブロックにセクタ管理情報が書き込まれていない。
For example, the last
実際の書き込み処理では、一連のデータを書き込む際に次の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
次に、末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報でない場合には、末尾の物理セクタ領域60の次の物理セクタ領域60に書き込まれるデータ(今回の書き込み処理で書き込む一連のデータの先頭データ)に対応する論理セクタ領域のLSNが、末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNの次の番号であるか否かの判断が行われる。末尾の物理セクタ領域60に記憶されているデータがセクタ管理情報でない場合、既に書き込まれているデータについては、「LSNが連続する論理セクタ領域が割り当てられている状態」になっているので、今回の書き込み処理で一連のデータ書き込んだときに、その状態が維持できるか否かが問題になる。ここで、今回の書き込み処理で書き込む一連のデータの先頭データに対応する論理セクタ領域のLSNが、データが書き込まれている末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNの次の番号であれば、この一連のデータを書き込んだ後も、「LSNが連続する論理セクタ領域が割り当てられている状態」が維持される。従って、今回の書き込み処理で書き込む一連のデータの先頭データに対応する論理セクタ領域のLSNが、データが書き込まれている末尾の物理セクタ領域60に記憶されているデータに対応する論理セクタ領域のLSNの次の番号であれば、セクタ管理情報の書き込みは行われない。
Next, if the data stored in the last
本実施の形態では、物理セクタ領域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
上記判断を行う際には、先頭の物理セクタ領域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
本実施形態では、書き込み処理が電源遮断等により書き込み途中で終了した場合を検知するため、一連のデータの末尾データが書き込まれた物理セクタ領域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
尚、「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
また、同一の物理ブロックに複数の一連のデータが連続的に書き込まれるような場合、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域60からセクタ管理情報を読み出さずに、ワークエリア8に保持されているセクタ管理情報が、そのまま使用されるようにしてもよい。
Further, when a plurality of series of data is continuously written in the same physical block, the
ホストシステム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
尚、一連のデータを書き込む際に、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
以下、図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
第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
次に、ホストシステム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
この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域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 (
この書き込み処理では、「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 (
図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
次に、ホストシステム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
この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域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 (
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
メモリコントローラ3は、作成したセクタ管理情報#0を、第5の一連のデータの末尾データが書き込まれた物理セクタ領域60(PSN#127の物理セクタ領域60)の次の物理セクタ領域60(PSN#128の物理セクタ領域60)に書き込む。また、セクタ管理情報#0が書き込まれた物理セクタ領域60(PSN#128の物理セクタ領域60)に対応した分割冗長領域70に、図示しない管理フラグと、前述した終了マークとが書き込まれる(図4(B)参照)。
The
尚、一度でもセクタ管理情報が書き込まれた物理ブロックについては、その物理ブロックに一連のデータが書き込まれる毎にセクタ管理情報が書き込まれる。なぜなら、一度でもセクタ管理情報が書き込まれた物理ブロックは、「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
この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理セクタ領域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 (
従って、第6の一連のデータの書き込みが終了したときの物理セクタ領域60と論理セクタ領域との対応関係を示すセクタ管理情報#1が作成される。このセクタ管理情報#1は、セクタ管理情報#0に基づいて作成される。つまり、この作成処理では、第6の一連のデータに対応する部分について、セクタ管理情報#0の内容が更新される。尚、ワークエリア8上にセクタ管理情報#0が保持されていない場合には、セクタ管理情報#1を作成するために、セクタ管理情報#0がPSN#128の物理セクタ領域60からワークエリア8に読み出される。
Therefore, sector
具体的には、図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
以後、同様にして、ホストシステム4から与えられる第7及び第8の書き込み指示にそれぞれ対応する第7及び第8の一連のデータ並びにセクタ管理情報#2及び#3がそれぞれ同一の物理ブロックに書き込まれる。
Thereafter, similarly, the seventh and eighth series of data and the sector
すなわち、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 (
次に、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 (
さて、この後、物理ブロックから各物理セクタ領域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
尚、第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
以上が、第一の実施形態の説明である。 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
例えば、図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
この変形例では、論理セクタ領域と物理セクタ領域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
例えば、セクタ管理情報#3´に基づいて、図5(D)に示したようなテーブルが作成される。このテーブル作成処理では、それぞれの一連のデータに対応する論理セクタ領域と物理セクタ領域60の対応関係に基づいて、各レコードに物理セクタ番号(PSN)が書き込まれていく。この物理セクタ番号(PSN)の書き込みは、先に書き込まれた一連のデータに対応する方から順番に行われ、書き込み先のレコードに既に物理セクタ番号(PSN)が書き込まれていても、後から物理セクタ番号(PSN)が上書きされる。従って、後から書き込まれた一連のデータに対応する論理セクタ領域と物理セクタ領域60の対応関係を優先したテーブルが作成される。
For example, a table as shown in FIG. 5D is created based on the sector
<第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
本実施形態では、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
また、各論理ページには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
第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
以下、本実施形態での書き込みの概要を説明する。 Hereinafter, an outline of writing in this embodiment will be described.
メモリコントローラ3は、ホストシステム4から与えられる書き込み指示(書き込みコマンド及び書き込み先のアドレス)に従って、この書き込み指示と共に与えられる一連のデータを、フラッシュメモリ2に書き込む。この書き込み処理では、書き込み先の論理ページが属する論理ブロックが特定され、その論理ブロックに対応する物理ブロック(又は、この論理ブロックに対して新たに割り当てた物理ブロック)に、一連のデータが書き込まれる。物理ブロック内の物理ページには、先頭から順番に(つまりPPNが小さいほうから順番に)一連のデータが書き込まれていく。従って、メモリコントローラ3が一連のデータを書き込むときには、物理ブロック内のデータが書き込まれている物理ページの末尾の検索が行われる。そして、その末尾の物理ページの次の物理ページから一連のデータが順次書き込まれていく。言い換えれば、物理ブロック内のデータが書き込まれていない先頭の物理ページから一連のデータが順次書き込まれていく。
The
本実施形態では、一連のデータの末尾データが書き込まれた物理ページの次の物理ページに、論理ページと物理ページの対応関係を示す情報(以下、「ページ管理情報」と言う)、例えば、論理ページと物理ページの対応関係を示すテーブルが書き込まれる。つまり、ページ管理情報は、ホストシステム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
本実施形態では、一連のデータを書き込む際に、その一連のデータを書き込む物理ブロック内の物理ページにページ管理情報を書き込むか否かを決定するために、一連のデータの先頭データに対応する論理ページ(以下、「第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
従って、ページ管理情報を書き込まれていない物理ブロックの場合、その物理ブロック内の先頭の物理ページからデータが書き込まれている末尾の物理ページまでの複数個の物理ページに対して、先頭の物理ページに記憶されているデータに対応する論理ページ以降の論理ページが、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
実際の書き込み処理では、一連のデータを書き込む際に次の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
上記判断を行う際には、先頭の物理ページに書き込まれているデータに対応する論理ページの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
本実施形態では、書き込み処理が電源遮断等により書き込み途中で終了した場合を検知するために、一連のデータの末尾データが書き込まれた物理ページに対応する共通冗長領域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
尚、「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
また、同一の物理ブロックに複数の一連のデータが連続的に書き込まれるような場合、物理ブロック内のデータが書き込まれている末尾の物理ページからページ管理情報を読み出さずに、ワークエリア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
ホストシステム4から書き込み指示と共に与えられるデータの容量が、書き込み先の物理ブロック(1個目の物理ブロック)内の空きページの容量より大きい場合、メモリコントローラ3は、その物理ブロック内の最後尾の物理ページの1ページ前の物理ページまで、ホストシステム4から与えられるデータを書き込み、最後尾の物理ページには、その時点での論理ページと物理ページの対応関係を示すページ管理情報を書き込む。残りのデータについては、新たに割り当てられた別の物理ブロック(2個目の物理ブロック)内の物理ページに書き込まれる。つまり、1個目の物理ブロックの先頭の物理ページから最後尾の物理ページまで、論理ブロック内の各論理ページに対応するデータが全てLPNの順番で書き込まれる場合(先頭の論理ページに対応するデータからLPNの順番で書き込まれる場合)を除き、最後尾の物理ページにはページ管理情報が書き込まれる。
When the capacity of the data given from the
尚、一連のデータを書き込む際に、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
以下、図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
まず、ホストシステム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
第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 (
次に、ホストシステム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
この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(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
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
図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
次に、ホストシステム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
この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(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
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
メモリコントローラ3は、作成したページ管理情報#0を、第5の一連のデータの末尾データが書き込まれた物理ページ(PPN#55の物理ページ)の次の物理ページ(PPN#56の物理ページ)に書き込む。また、ページ管理情報#0が書き込まれた物理ページ(PPN#56の物理ページ)に対応した共通冗長領域50に、図示しない管理フラグと、前述した終了マークとが書き込まれる(図7(A)参照)。
The
尚、一度でもページ管理情報が書き込まれた物理ブロックについては、その物理ブロックに一連のデータが書き込まれる毎にページ管理情報が書き込まれる。なぜなら、一度でもページ管理情報が書き込まれた物理ブロックは、「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
しかし、PBA#7の物理ブロック内の空きページはPPN#57−#63の7個の物理ページだけなので、メモリコントローラ3は、ホストシステム4から与えられた第6の書き込み指示に基づく8個の論理ページに対応するデータを、全てPBA#7の物理ブロック内の空きページに書き込むことができない。
However, since the free pages in the physical block of
また、物理ブロック内のデータが書き込まれている末尾の物理ページ(PSN#56の物理ページ)に記憶されているデータはページ管理情報なので、既に、「LPNが連続する論理ページが割り当てられている状態」が維持されていない。従って、メモリコントローラ3は、物理ブロック内の最後尾の物理ページにページ管理情報を書き込まなければならない。
Further, since the data stored in the last physical page (
このため、第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 (
次に、第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
この結果、ホストシステム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
尚、メモリコントローラ3は、上述のようにPBA#7の物理ブロック内の空きページに、ホストシステム4から書き込み指示と共に与えられる全てのデータを書き込むことができない場合、その全てのデータを新たに割り当てたPBA#16の物理ブロックに書き込むようにしてもよい。
If the
また、ホストシステム4から与えられる書き込み指示で指定される書き込み先の論理ページの個数が、書き込み先の物理ブロック内のデータが書き込まれていない物理ページの個数以上の場合、物理ブロック内の最後尾の物理ページにはホストシステム4から与えられるデータではなくページ管理情報が書き込まれる。最後尾の物理ページに記憶されているデータがページ管理情報でない場合、物理ブロックの先頭の物理ページから最後尾の物理ページまで、論理ブロック内の各論理ページに対応するデータが全てLPNの順番で書き込まれている(先頭の論理ページに対応するデータからLPNの順番で書き込まれている)と判断されるからである。
In addition, when the number of write destination logical pages specified by the write instruction given from the
従って、物理ブロック内の最後尾の物理ページまでホストシステム4から与えられるデータ(一連のデータ)を書き込んでも、「LPNが連続する論理ページが割り当てられている状態」が維持される場合には、最後尾の物理ページにページ管理情報ではなくホストシステム4から与えられるデータ(一連のデータ)が書き込まれる。
Therefore, even if the data (a series of data) given from the
また、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
すなわち、第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
なお、前述したように、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
次に、ホストシステム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
この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(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
次に、ホストシステム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
この書き込み処理を開始するときに、物理ブロック内のデータが書き込まれている末尾の物理ページ(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
従って、第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
第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
旧ブロックフラグは、各レコードに書き込まれている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#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
さて、この後、同じ論理ブロックに割り当てられた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
尚、第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
また、第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
以上が、第二の実施形態の説明である。 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
この変形例では、論理ページと物理ページの最新の対応関係を示すテーブルは、最新のページ管理情報に基づいて作成される。この作成処理では、後から書き込まれた一連のデータに対応する論理ページと物理ページの対応関係が優先されるようにして、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)
例えば、ページ管理情報#2´に基づいて、図9に示したようなテーブルが作成される。このテーブル作成処理では、それぞれの一連のデータに対応する論理ページと物理ページの対応関係に基づいて、各レコードに物理ページ番号(PPN)が書き込まれていく。この物理ページ番号(PPN)の書き込みは、先に書き込まれた一連のデータに対応する方から順番に行われ、書き込み先のレコードに既に物理ページ番号(PPN)が書き込まれていても、後から物理ページ番号(PPN)が上書きされる。従って、後から書き込まれた一連のデータに対応する論理ページと物理ページの対応関係を優先したテーブルが作成される。
For example, a table as shown in FIG. 9 is created based on the page
以上、本発明の幾つかの実施形態を説明したが、これらは本発明の説明のための例示であって、本発明の範囲をこれらの実施形態にのみ限定する趣旨ではない。本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。 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
つまり、セクタ管理情報(又はページ管理情報)が書き込まれない場合にだけ、一連のデータの末尾データが書き込まれた物理セクタ領域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…フラッシュメモリシステム、2…フラッシュメモリ、3…メモリコントローラ、6…マイクロプロセッサ
DESCRIPTION OF
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記載のメモリコントローラ。 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.
ことを特徴とする請求項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.
前記メモリコントローラによってアクセスされるフラッシュメモリと
を備えるフラッシュメモリシステム。 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.
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)
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)
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 |
-
2008
- 2008-01-30 JP JP2008018614A patent/JP4687720B2/en active Active
Patent Citations (2)
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 |