JP4366420B2 - 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
- JP4366420B2 JP4366420B2 JP2007282480A JP2007282480A JP4366420B2 JP 4366420 B2 JP4366420 B2 JP 4366420B2 JP 2007282480 A JP2007282480 A JP 2007282480A JP 2007282480 A JP2007282480 A JP 2007282480A JP 4366420 B2 JP4366420 B2 JP 4366420B2
- Authority
- JP
- Japan
- Prior art keywords
- block
- physical block
- logical
- physical
- version number
- 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
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Read Only Memory (AREA)
Description
本発明は、メモリコントローラ、メモリコントローラを備えるフラッシュメモリシステム、並びにフラッシュメモリの制御方法に関する。 The present invention relates to a memory controller, a flash memory system including the memory controller, and a flash memory control method.
例えば、特許文献1に開示されているように、フラッシュメモリを用いたメモリシステムでは、特定の物理ブロックに書き換えが集中しないようにウェアー・レベリング(Wear-leveling)制御が行われている。このウェアー・レベリング制御には、大きくは2つの方式がある。
For example, as disclosed in
1つは、書き換えが行われないデータが記憶されている物理ブロックを放置しておき、それ以外の物理ブロックの書き換え回数が平均化されるように制御するウェアー・レベリング制御(パッシブ・ウェアー・レベリング(Passive-wear-leveling)制御方式)である。もう一つは、書き換えが行われないデータが記憶されている物理ブロックを含めて、全ての物理ブロックの書き換え回数が平均化されるように制御するウェアー・レベリング制御(アクティブ・ウェアー・レベリング(Active-wear-leveling)制御方式)である。 The first is wear leveling control (passive wear leveling) that controls the number of rewrites of other physical blocks to be averaged, leaving the physical blocks in which data that is not rewritten is stored. (Passive-wear-leveling) control method). The other is wear leveling control (active wear leveling (Active wear leveling)) that controls the number of rewrites of all physical blocks, including physical blocks that store data that will not be rewritten. -wear-leveling) control method).
ここで、書き換えが行わないデータが記憶されている物理ブロックが少ない場合は、パッシブ・ウェアー・レベリング制御方式が適している。しかし、書き換えが行われないデータが記憶されている物理ブロックが多い場合は、アクティブ・ウェアー・レベリング制御方式が適している。従って、特許文献1には、メモリシステムに記憶されるデータの書き換え頻度に応じて(つまり、書き換えが行われないデータが記憶されている物理ブロックが多いか少ないかに応じて)、パッシブ・ウェアー・レベリング制御方式、アクティブ・ウェアー・レベリング制御方式又はこれらを組み合わせたウェアー・レベリング制御方式のうちのいずれかのウェアー・レベリング制御を行うことが記載されている。
Here, when there are few physical blocks in which data that is not rewritten is stored, the passive wear leveling control method is suitable. However, when there are many physical blocks in which data that is not rewritten is stored, the active wear leveling control method is suitable. Accordingly,
しかしながら、メモリシステムに記憶されるデータの書き換え頻度に応じて、適切なウェアー・レベリング制御方式を選択することは、必ずしも容易でない。 However, it is not always easy to select an appropriate wear leveling control method according to the frequency of rewriting data stored in the memory system.
また、上述した特許文献1では、ウェアー・レベリング制御方式の選択や条件設定を、ユーザが行うようになっている。その際、ユーザは、適切なウェアー・レベリング制御方式を選択し、その条件設定を行う必要がある。これらは、ユーザにとって負担である。そして、ウェアー・レベリング制御方式の選択が適切でなかった場合、例えば、書き換えが行われないデータが記憶されている物理ブロックが少ないときにアクティブ・ウェアー・レベリング制御方式が選択されると、不必要なデータ転送が行われることが多くなる。
In
そこで、本発明は、殆ど書き換えが行われないデータ(書き換え頻度が低いデータ)が記憶されている物理ブロックが存在するときだけ、その物理ブロックを含めたウェアー・レベリング制御が行われるメモリコントローラ、フラッシュメモリシステム、及びフラッシュメモリの制御方法を提供することを目的とする。 Therefore, the present invention provides a memory controller, a flash, and the like that perform wear leveling control including a physical block only when there is a physical block in which data that is hardly rewritten (data with low rewrite frequency) is stored. An object of the present invention is to provide a memory system and a flash memory control method.
本発明の第一の側面に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当て手段と、
前記論理ブロック割り当て手段によって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理手段と、
前記アドレス変換テーブル管理手段によって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存手段と、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理手段と、
前記テーブル保存ブロック管理手段によって、新たな前記テーブル保存ブロックの割り当てが行われたときに、空き領域が無くなった前記テーブル保存ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記テーブル保存ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込み手段と、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定手段と、
前記版数情報決定手段によって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備える。
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 based on an access instruction given from a host system,
Logical block allocating means for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
Address translation table management means for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation means;
Table storage that is the physical block that is the storage destination of the address conversion table when the correspondence relationship between at least some of the logical blocks and the physical block in the address conversion table is changed by the address conversion table management unit Address conversion table storage means for storing the address conversion table in a block;
A table storage block management means for newly allocating another physical block as the table storage block when there is no more free space for storing the address conversion table in the table storage block;
When the table storage block management means assigns a new table storage block, the previous count value that is the count value that matches the count value stored in the table storage block that has no free space Count information writing means for writing the latest count value, which is the updated count value, into the physical block newly assigned as the table storage block;
Version number information determining means for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
Version number information writing means for writing the version number information determined by the version number information determining means into the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
Is provided.
本発明の第二の側面に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当て手段と、
前記論理ブロック割り当て手段によって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理手段と、
前記アドレス変換テーブル管理手段によって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存手段と、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理手段と、
前記テーブル保存ブロックとして割り当てられている前記物理ブロックが変わったときに、前記テーブル保存ブロックとして割り当てられている前記物理ブロックを示す管理情報を、前記管理情報の保存先の前記物理ブロックである管理情報ブロックに保存する管理情報保存手段と、
前記管理情報ブロックに、前記管理情報を保存するための空き領域が無くなったとき、別の前記物理ブロックを前記管理情報ブロックとして新たに割り当てる管理情報ブロック管理手段と、
前記管理情報ブロック管理手段によって、新たな前記管理情報ブロックの割り当てが行われたときに、空き領域が無くなった前記管理情報ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記管理情報ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込み手段と、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定手段と、
前記版数情報決定手段によって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備える。
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 based on an access instruction given from a host system,
Logical block allocating means for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
Address translation table management means for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation means;
Table storage that is the physical block that is the storage destination of the address conversion table when the correspondence relationship between at least some of the logical blocks and the physical block in the address conversion table is changed by the address conversion table management unit Address conversion table storage means for storing the address conversion table in a block;
A table storage block management means for newly allocating another physical block as the table storage block when there is no more free space for storing the address conversion table in the table storage block;
When the physical block allocated as the table storage block changes, the management information indicating the physical block allocated as the table storage block is the management information that is the physical block of the storage destination of the management information Management information storage means to be stored in the block;
Management information block management means for newly allocating another physical block as the management information block when there is no free space for storing the management information in the management information block;
When the management information block management means assigns a new management information block, the count value immediately before is a count value that matches the count value stored in the management information block that has no free space. Count information writing means for writing the latest count value, which is the updated count value, into the physical block newly assigned as the management information block;
Version number information determining means for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
Version number information writing means for writing the version number information determined by the version number information determining means into the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
Is provided.
本発明の第三の側面に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記フラッシュメモリ内の消去状態の前記物理ブロックを検索する手段であって、前記フラッシュメモリ内の前記物理ブロックが消去状態であるか否かを所定の順番で判断していく空きブロック検索手段と、
前記空きブロック検索手段で検出された消去状態の前記物理ブロックに対して前記論理ブロックを割り当てる論理ブロック割り当て手段と、
前記空きブロック検索手段における所定の順番の検索が所定回数巡回する毎に、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理手段と、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備える。
A memory controller according to a third aspect of the present invention is a memory controller that controls access to a flash memory that is erased in units of physical blocks, 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 sectors in the logical address space on the host system side and the physical block;
Means for searching for the physical block in the erased state in the flash memory, the free block searching means for determining in a predetermined order whether or not the physical block in the flash memory is in an erased state;
Logical block allocation means for allocating the logical block to the physical block in the erased state detected by the free block search means;
Version number information management means for updating the version number information to be written in the physical block to which the logical block is assigned each time the search in the predetermined order in the empty block search means circulates a predetermined number of times,
Version number information writing means for writing the version number information to the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
Is provided.
本発明の第四の側面に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記物理ブロックに対して前記論理ブロックが新たに割り当てられる毎にカウント値を更新するカウント手段と
前記カウント値が所定の値に達したときに、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理手段と、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備える。
A memory controller according to a fourth aspect of the present invention is a memory controller that controls access to a flash memory that is erased in physical block units 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 sectors in the logical address space on the host system side and the physical block;
Count means for updating the count value each time the logical block is newly assigned to the physical block, and version number information to be written to the physical block to which the logical block is assigned when the count value reaches a predetermined value Version information management means for updating
Version number information writing means for writing the version number information to the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
Is provided.
好適な実施形態では、前記版数情報は、所定の順序で循環する予め用意された少なくとも3種類の版数を示す情報である。前記肯定的な判断の対象の前記物理ブロックは、現在の前記版数情報より所定順番以上前の前記版数情報が記憶されている物理ブロックである。 In a preferred embodiment, the version number information is information indicating at least three types of version numbers prepared in advance that circulate in a predetermined order. The physical block that is the object of the positive determination is a physical block that stores the version number information that is more than a predetermined order before the current version number information.
本発明の第五の側面に従うフラッシュメモリシステムは、
本発明の第一乃至第四の側面のうちのいずれかの側面に従うメモリコントローラと、
前記メモリコントローラによってアクセスされるフラッシュメモリと、
を備える。
A flash memory system according to the fifth aspect of the present invention provides:
A memory controller according to any one of the first to fourth aspects of the present invention;
Flash memory accessed by the memory controller;
Is provided.
本発明の第六の側面に従うフラッシュメモリの制御方法は、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当てステップと、
前記論理ブロック割り当てステップによって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理ステップと、
前記アドレス変換テーブル管理ステップによって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存ステップと、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理ステップと、
前記テーブル保存ブロック管理ステップによって、新たな前記テーブル保存ブロックの割り当てが行われたときに、空き領域が無くなった前記テーブル保存ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記テーブル保存ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込みステップと、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定ステップと、
前記版数情報決定ステップによって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備える。
A flash memory control method according to a sixth aspect of the present invention is a flash memory control method for controlling access to a flash memory to be erased in units of physical blocks based on an access instruction given from a host system,
A logical block allocation step for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
An address translation table management step for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation step;
When the address translation table management step changes the correspondence between at least some of the logical blocks and the physical block in the address translation table, the table is the physical block that is the destination of the address translation table. An address conversion table storage step for storing the address conversion table in a block;
A table storage block management step for newly allocating another physical block as the table storage block when there is no more free space in the table storage block for storing the address conversion table;
When a new table storage block is allocated by the table storage block management step, the count value immediately before is a count value that matches the count value stored in the table storage block that has no free space. A count information writing step of writing the latest count value, which is the updated count value, into the physical block newly assigned as the table storage block;
A version number information determining step for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
A version number information writing step of writing the version number information determined in the version number information determination step into the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
Is provided.
本発明の第七の側面に従うフラッシュメモリの制御方法は、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当てステップと、
前記論理ブロック割り当てステップによって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理ステップと、
前記アドレス変換テーブル管理ステップによって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存ステップと、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理ステップと、
前記テーブル保存ブロックとして割り当てられている前記物理ブロックが変わったときに、前記テーブル保存ブロックとして割り当てられている前記物理ブロックを示す管理情報を、前記管理情報の保存先の前記物理ブロックである管理情報ブロックに保存する管理情報保存ステップと、
前記管理情報ブロックに、前記管理情報を保存するための空き領域が無くなったとき、別の前記物理ブロックを前記管理情報ブロックとして新たに割り当てる管理情報ブロック管理ステップと、
前記管理情報ブロック管理ステップによって、新たな前記管理情報ブロックの割り当てが行われたとき、空き領域が無くなった前記管理情報ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記管理情報ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込みステップと、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定ステップと、
前記版数情報決定ステップによって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備える。
A flash memory control method according to a seventh aspect of the present invention is a flash memory control method for controlling access to a flash memory that is erased in units of physical blocks based on an access instruction given from a host system,
A logical block allocation step for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
An address translation table management step for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation step;
When the address translation table management step changes the correspondence between at least some of the logical blocks and the physical block in the address translation table, the table is the physical block that is the destination of the address translation table. An address conversion table storage step for storing the address conversion table in a block;
A table storage block management step for newly allocating another physical block as the table storage block when there is no more free space in the table storage block for storing the address conversion table;
When the physical block allocated as the table storage block changes, the management information indicating the physical block allocated as the table storage block is the management information that is the physical block of the storage destination of the management information A management information storage step to be stored in the block;
A management information block management step for newly assigning another physical block as the management information block when there is no more free space in the management information block for storing the management information;
When a new management information block is allocated by the management information block management step, a count value immediately before that is a count value that matches a count value stored in the management information block that has no free space A count information writing step of updating and writing the latest count value, which is the updated count value, to the physical block newly assigned as the management information block;
A version number information determining step for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
A version number information writing step of writing the version number information determined in the version number information determination step into the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
Is provided.
本発明の第八の側面に従うフラッシュメモリの制御方法は、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記フラッシュメモリ内の消去状態の前記物理ブロックを検索するステップであって、前記フラッシュメモリ内の前記物理ブロックが消去状態であるか否かを所定の順番で判断していく空きブロック検索ステップと、
前記空きブロック検索ステップで検出された消去状態の前記物理ブロックに対して前記論理ブロックを割り当てる論理ブロック割り当てステップと、
前記空きブロック検索ステップにおける所定の順番の検索が所定回数巡回する毎に、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理ステップと、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備える。
A flash memory control method according to an eighth aspect of the present invention is a flash memory control method for controlling access to a flash memory to be erased in units of physical blocks based on an access instruction given from a host system,
A block management step for managing the correspondence between a logical block composed of a plurality of sectors in the logical address space on the host system side and the physical block;
A search for the physical block in the erased state in the flash memory, and a free block search step for determining in a predetermined order whether or not the physical block in the flash memory is in an erased state;
A logical block allocation step of allocating the logical block to the physical block in the erased state detected in the empty block search step;
A version number information management step for updating version number information to be written in the physical block to which the logical block is allocated each time the search in the predetermined order in the empty block search step circulates a predetermined number of times,
A version number information writing step for writing the version number information to the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
Is provided.
本発明の第九の側面に従うフラッシュメモリの制御方法は、ホストシステムから与えられるアクセス指示に基づいて、物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するフラッシュメモリの制御方法であって、
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記物理ブロックに対して前記論理ブロックが新たに割り当てられる毎にカウント値を更新するカウントステップと
前記カウント値が所定の値に達したときに、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理ステップと、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備える。
A flash memory control method according to a ninth aspect of the present invention is a flash memory control method for controlling access to a flash memory to be erased in units of physical blocks based on an access instruction given from a host system,
A block management step for managing the correspondence between a logical block composed of a plurality of sectors in the logical address space on the host system side and the physical block;
A count step of updating a count value each time the logical block is newly assigned to the physical block, and version number information to be written to the physical block to which the logical block is assigned when the count value reaches a predetermined value Version number information management step to update,
A version number information writing step for writing the version number information to the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
Is provided.
殆ど書き換えが行われないデータ(書き換え頻度が低いデータ)が記憶されている物理ブロックが存在するときだけ、その物理ブロックを含めたウェアー・レベリング制御が行われるメモリコントローラ、フラッシュメモリシステム、及びフラッシュメモリの制御方法を提供することができる。 Memory controller, flash memory system, and flash memory in which wear leveling control including physical blocks is performed only when there is a physical block that stores data that is hardly rewritten (data that is rewritten less frequently) A control method can be provided.
以下、本発明の実施の形態を、図面を参照しながら詳細に説明する。 Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
図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, 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
論理アドレス情報は、物理ブロックと論理ブロックの対応関係を判別するための情報である。従って、記憶データが消去された物理ブロックのような、対応する論理ブロックの無い物理ブロックについては、その物理ブロックの冗長領域に、論理アドレス情報は格納されていない。なお、以下の説明では、「物理ブロックの冗長領域」とは、物理ブロック内の一又は複数の物理ページが備える冗長領域(例えば、先頭物理ページの冗長領域)で構成された記憶領域を指す。 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, no logical address information is stored in the redundant area of the physical block. In the following description, the “redundant area of the physical block” refers to a storage area configured by a redundant area (for example, a redundant area of the first physical page) included in one or more physical pages in the physical block.
ブロックステータス(フラグ)は、物理ブロックの良否を示すフラグである。尚、初期不良の物理ブロックについては、不良ブロック(正常にデータの書き込み等を行うことができない物理ブロック)であることを示すブロックステータス(フラグ)が製造メーカによって書き込まれている。また、この初期不良の物理ブロックを示すブロックステータス(フラグ)を、ユーザ領域に書き込んでいる製造メーカもある。 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によって、コマンドレジスタR1に、書き込みコマンドを示すコマンドコードが書き込まれ、セクタ数レジスタR2に、書き込むデータのセクタ数が書き込まれ、LBAレジスタR3には、書き込みを開始する先頭データに対応するLBAが書き込まれる。セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて、アクセス対象の領域である論理アクセス領域が判別され、その論理アクセス領域が含まれる論理ブロックに対応する物理ブロックにホストシステム4から与えられるデータが書き込まれる。
In the writing process of the present embodiment, the
セクタ数レジスタR2及びLBAレジスタR3に書き込まれた情報に基づいて判別される論理アクセス領域が複数個の論理ブロックに跨っている場合は、データの書き込み先になる物理ブロックも複数個になる。従って、論理アクセス領域が複数個の論理ブロックに跨っている場合は、論理アクセス領域が属する論理ブロック毎に領域を分割してデータの書き込み処理が行われる。例えば、論理アクセス領域が2個の論理ブロック(第1の論理ブロックと第2の論理ブロック)に跨っている場合は、第1の論理ブロックに対応する物理ブロックに対する書き込み処理と、第2の論理ブロックに対応する物理ブロックに対する書き込み処理とが行われる。第1の論理ブロックに属する論理アクセス領域に対して書き込むことが指示されたデータは、第1の論理ブロックに対応する物理に書き込まれる。第2の論理ブロックに属する論理アクセス領域に対して書き込むことが指示されたデータは、第2の論理ブロックに対応する物理ブロック内に書き込まれる。 When the logical access area determined based on the information written in the sector number register R2 and the LBA register R3 extends over a plurality of logical blocks, there are a plurality of physical blocks to which data is written. Therefore, when the logical access area extends over a plurality of logical blocks, the area is divided for each logical block to which the logical access area belongs, and data write processing is performed. For example, when the logical access area extends over two logical blocks (the first logical block and the second logical block), the write processing for the physical block corresponding to the first logical block and the second logical block Write processing is performed on the physical block corresponding to the block. Data instructed to be written to the logical access area belonging to the first logical block is written to the physical corresponding to the first logical block. Data instructed to be written to the logical access area belonging to the second logical block is written into the physical block corresponding to the second logical block.
ホストシステム4側のアドレス空間は、セクタ(512バイト)単位で分割した領域(以下、論理セクタ領域と言う)に付けた通番であるLBA(Logical Block Address)で管理されている。又、複数個の論理セクタ領域で構成された論理ブロックが形成され、この論理ブロックに対して、1個又は複数個の物理ブロックが割り当てられる。
The address space on the
この論理ブロックと物理ブロックの対応関係は、ゾーン単位で管理されることが多い。具体的には、複数個の論理ブロックで1個の論理ゾーンが構成され、複数個の物理ブロックで1個の物理ゾーンが構成され、論理ゾーンが物理ゾーンに対応付けられて管理されることが多い。 The correspondence between logical blocks and physical blocks is often managed on a zone basis. Specifically, one logical zone is composed of a plurality of logical blocks, one physical zone is composed of a plurality of physical blocks, and the logical zone is managed in association with the physical zone. Many.
しかし、その場合、特定の論理ゾーンにアクセスが集中した場合、アクセスが集中した論理ゾーンに対応する物理ゾーンに含まれる物理ブロックの書き換え回数が、他の物理ゾーンに含まれる物理ブロックの書き換え回数よりも多くなってしまい好ましくない。 However, in this case, when access is concentrated in a specific logical zone, the number of rewrites of physical blocks included in the physical zone corresponding to the logical zone where access is concentrated is greater than the number of rewrites of physical blocks included in other physical zones. Is also undesirable.
この問題を解決する方法としては、論理ブロックに付した通し番号である論理ブロック番号(LBN)が連続する論理ブロックを各論理ゾーンに振り分ける方法がある。 As a method for solving this problem, there is a method in which logical blocks having consecutive logical block numbers (LBNs), which are serial numbers assigned to the logical blocks, are allocated to each logical zone.
但し、特定の論理ブロックにアクセスが集中した場合(アクセスが集中する範囲が複数個の論理ブロックに跨っていない場合)には、その論理ブロックが含まれる論理ゾーンに対応する物理ゾーンに含まれる物理ブロックの書き換え回数が、他の物理ゾーンに含まれる物理ブロックの書き換え回数よりも多くなってしまう。このような場合は、各論理ゾーンに含まれる論理ブロックに対応させることができる物理ブロックを、制限しない方が好ましい。つまり、物理ゾーンを構成せずに、各論理ゾーンに含まれる論理ブロックをいずれの物理ブロックにも対応させることができるようにすることが好ましい。 However, when access concentrates on a specific logical block (when the access concentration range does not extend over a plurality of logical blocks), the physical included in the physical zone corresponding to the logical zone including the logical block The number of block rewrites is larger than the number of rewrites of physical blocks included in other physical zones. In such a case, it is preferable not to limit the physical blocks that can be associated with the logical blocks included in each logical zone. In other words, it is preferable that a logical block included in each logical zone can correspond to any physical block without forming a physical zone.
また、論理ブロックと物理ブロックとの対応関係は、通常、論理ブロックと物理ブロックとの対応関係を記述したテーブルであるアドレス変換テーブルによって管理される。論理ブロックと物理ブロックの対応関係が変化したときには、ワークエリア(SRAM)8上で、アドレス変換テーブルの更新処理が行われる。アドレス変換テーブルは、一般に、起動時又はアクセス時に、各物理ブロックの冗長領域に記憶されている論理アドレス情報に基づいて作成されるが、フラッシュメモリ2に保存しておき、フラッシュメモリ2から読み出すこともできる。これにより、各物理ブロックの冗長領域から論理アドレス情報を読み出してアドレス変換テーブルを作成することに比べて、短時間で、アドレス変換テーブルを得ることができる。特に、上述のように物理ゾーンを構成せずに、各論理ゾーンに含まれる論理ブロックをいずれの物理ブロックにも対応させることができるようにする場合には、アドレス変換テーブルをフラッシュメモリ2に保存しておく方が好ましい。
The correspondence between logical blocks and physical blocks is usually managed by an address conversion table that is a table describing the correspondence between logical blocks and physical blocks. When the correspondence between the logical block and the physical block changes, the address conversion table is updated in the work area (SRAM) 8. The address conversion table is generally created based on logical address information stored in the redundant area of each physical block at the time of startup or access, but is stored in the
また、アドレス変換テーブルをフラッシュメモリ2に保存する場合は、突然の電源遮断に対応するため、常に最新のアドレス変換テーブルがフラッシュメモリ2に保存されているようにすることが好ましい。つまり、論理ブロックと物理ブロックとの対応関係が変化する毎に(つまりワークエリア8上でアドレス変換テーブルが更新される都度に)、最新のアドレス変換テーブルをフラッシュメモリ2に保存するようにすることが好ましい。このアドレス変換テーブルをフラッシュメモリ2に保存するためにかかる時間を考慮すれば、論理ゾーン単位でアドレス変換テーブルを保存(管理)し、各論理ゾーンに含まれる論理ブロックの数を少なくする方が好ましい。
When the address conversion table is stored in the
そこで、本実施形態では、図2に示すように、論理ゾーンは形成するが、物理ゾーンは形成しない。そして、どの論理ゾーンであるかに関わらず、各論理ゾーンに対して、全範囲の物理ブロックを割り当てている。従って、どの論理ブロックがどの物理ブロックに割り当てられても良い。 Therefore, in this embodiment, as shown in FIG. 2, a logical zone is formed, but a physical zone is not formed. Regardless of which logical zone, the entire range of physical blocks is assigned to each logical zone. Accordingly, any logical block may be assigned to any physical block.
また、本実施形態では、アドレス変換テーブルが、図3に示すように、論理ゾーン毎に用意される。各アドレス変換テーブルは、対応する論理ゾーンを構成する各論理ブロックについてのみ、どの論理ブロックがどの物理ブロックに対応しているかを管理する。図3では、参照符号103−0は、論理ゾーンに付した通し番号である論理ゾーン番号(LZN)が#0である論理ゾーンに対応したアドレス変換テーブルであり、参照符号103−1は、LZNが#1である論理ゾーンに対応したアドレス変換テーブルである。各アドレス変換テーブル(103−0及び103−1)には、対応する論理ゾーンを構成する各論理ブロックについてのみ、論理ブロックのLBNと、その論理ブロックが割り当てられている物理ブロックの物理ブロックアドレス(PBA)とが記録される。このため、それぞれのアドレス変換テーブル(論理ゾーン毎のアドレス変換テーブル)のサイズは、全ての論理ブロックを一つのアドレス変換テーブルで管理する場合に比べて小さい。論理ゾーン毎のアドレス変換テーブルは、異なる物理ブロックに保存される。言い換えれば、二以上の論理ゾーンに対応する二以上のアドレス変換テーブルが、同時に同一の物理ロックに保存されることはない。例えば、LZN#0の論理ゾーンに対応したアドレス変換テーブル103−0は、PBA#5の物理ブロックに保存され、LZN#1の論理ゾーンに対応したアドレス変換テーブル103−1は、PBA#1076の物理ブロックに保存される。以下、アドレス変換テーブルの保存先の物理ブロックを、「テーブル保存ブロック」と言う。アドレス変換テーブルは、ワークエリア8上で更新される都度に、図3に示すように、テーブル保存ブロックである物理ブロック内の領域(一以上の空きの物理ページ又は物理ページ内の空き領域)に保存される。例えば、論理ゾーン毎のアドレス変換テーブルを、1つの物理ページに保存できるサイズに設定し、アドレス変換テーブルが更新される毎に先頭の物理ページから順番にアドレス変換テーブルを保存していった場合、テーブル保存ブロックには64個のアドレス変換テーブルを保存することができる。このテーブル保存ブロックに64個のアドレス変換テーブルが保存され、アドレス変換テーブルを保存可能な空きの領域が存在しない場合には、別の物理ブロックがテーブル保存ブロックとして割り当てられる。図3に示すように、LZN#1の論理ゾーンに対応したアドレス変換テーブルのテーブル保存ブロックであるPBA#1076の物理ブロックの最後尾の物理ページ#63までアドレス変換テーブル103−1が保存されている場合、PBA#1076の物理ブロック内にはアドレス変換テーブルを保存するための空きの領域が存在しない。従って、この後に、アドレス変換テーブル103−1が更新されたならば、アドレス変換テーブル103−1のテーブル保存ブロックとして、別の物理ブロック(空きの物理ブロック)が割り当てられ、その別の物理ブロックに、更新後のアドレス変換テーブル103−1が保存される。以下、このような、テーブル保存ブロックとして別の物理ブロックが割り当てられる処理を、「テーブル保存ブロックの変更」と言う。
In the present embodiment, an address conversion table is prepared for each logical zone as shown in FIG. Each address conversion table manages which logical block corresponds to which physical block only for each logical block constituting the corresponding logical zone. In FIG. 3, reference numeral 103-0 is an address conversion table corresponding to a logical zone whose logical zone number (LZN), which is a serial number assigned to the logical zone, is # 0. It is an address conversion table corresponding to the
また、本実施形態では、メモリコントローラ3が、どの論理ゾーンに対応したアドレス変換テーブルがどの物理ブロックに保存されているかを示す情報(以下、「テーブル管理情報」と言う)を管理している。図3に示した例では、テーブル管理情報101に、各論理ゾーンのLZNと、そのLZNの論理ゾーンに対応したアドレス変換テーブルのテーブル保存ブロックのPBAとの対応関係が判別できる情報が含まれている。このテーブル管理情報101を参照することにより、例えば、LZN#0の論理ゾーンに対応したアドレス変換テーブル103−0のテーブル保存ブロックが、PBA#5の物理ブロックであることや、LZN#1の論理ゾーンに対応したアドレス変換テーブル103−1のテーブル保存ブロックが、PBA#1076の物理ブロックであることがわかる。テーブル管理情報101は、予め設定されている2個以上のテーブル管理情報用の物理ブロック(以下、「管理情報ブロック候補」と言う)のうちのいずれかの物理ブロックに保存される。この例では、PBA#0とPBA#1の物理ブロック(つまり2個の物理ブロック)が、管理情報ブロック候補として設定されている。従って、テーブル管理情報は、PBA#0又はPBA#1のいずれかの物理ブロックに保存される。以下、この管理情報ブロック候補(PBA#0とPBA#1の物理ブロック)から選択された、テーブル管理情報の保存先の物理ブロックを、「管理情報ブロック」と言う。テーブル管理情報101は、いずれかの論理ゾーンに対応したアドレス変換テーブルのテーブル保存ブロックが変更されたときに、ワークエリア8上で更新される。テーブル管理情報101は、ワークエリア8上で更新される都度に、管理情報ブロックである物理ブロック(例えばPBA#0の物理ブロック)内の空き領域(一以上の空きの物理ページ又は物理ページ内の空き領域)に保存される。その物理ブロックに、テーブル管理情報を保存可能な空き領域が存在しない場合には、2個の管理情報ブロック候補のうちの別の物理ブロック(例えばPBA#1の物理ブロック)が、管理情報ブロックとして割り当てられる。つまり、予め定められた2個の物理ブロックが、交互に、管理情報ブロックとして使用される。以下、この処理を、「管理情報ブロックの切替え」と言う。
In this embodiment, the
図2を参照して、論理ブロックと物理ブロックの対応関係を説明する。 With reference to FIG. 2, the correspondence between the logical block and the physical block will be described.
本実施形態では、図2に示すように、LBA#0−#2047999からなる2048000個の論理セクタ領域が、8192個の物理ブロックからなるフラッシュメモリ2側の記憶領域に割り当てられている。
In the present embodiment, as shown in FIG. 2, 2048000 logical sector areas composed of
図2では、アドレス(LBA)が連続する256個の論理セクタ領域をまとめたものを論理ブロックとし、この論理ブロックに、前述したLBNを付している。例えば、LBA#0−#255の256個の論理セクタ領域は、LBN#0の論理ブロックに属し、LBA#256−#511の256個の論理セクタ領域は、LBN#1の論理ブロックに属している。このように、LBA#0−#2047999の2048000個の論理セクタ領域は、LBN#0−#7999の8000個の論理ブロックのいずれかに属している。
In FIG. 2, a group of 256 logical sector areas having consecutive addresses (LBA) is defined as a logical block, and the LBN described above is attached to this logical block. For example, the 256 logical sector areas of LBA # 0- # 255 belong to the logical block of
更に、この論理ブロックを複数個まとめたものを論理ゾーンとし、この論理ゾーンに前述したLZNを付している。図2では、LBNが連続する論理ブロックが、異なる論理ゾーンに属するように、各論理ブロックをLZN#0−#7の8個の論理ゾーンに対して順次振り分けている。例えば、LBN#0の論理ブロックはLZN#0の論理ゾーンに、LBN#1の論理ブロックはLZN#1の論理ゾーンに、LBN#2の論理ブロックはLZN#2の論理ゾーンにという順番でLZN#7の論理ゾーンまで振り分けていく。以下、同様に、LBN#8の論理ブロックをLZN#0の論理ゾーンに、LBN#9の論理ブロックをLZN#1の論理ゾーンに、LBN#10の論理ブロックをLZN#2の論理ゾーンに振り分けていく。このように振り分けることにより、書き換え頻度の高い論理アクセス領域に対応する論理ブロックが特定の論理ゾーンに集中する確率を低くすることができる。従って、特定の論理ゾーンに対応したテーブル保存ブロックの変更頻度が、他の論理ゾーンに対応したテーブル保存ブロックの変更頻度よりも、著しく高くなってしまうことを抑制することができる。
Further, a plurality of logical blocks are combined into a logical zone, and the above-described LZN is added to the logical zone. In FIG. 2, each logical block is sequentially allocated to eight logical
フラッシュメモリ2は、8192個の物理ブロックで構成されている。8192個の物理ブロックには、固有の物理ブロックアドレス(PBA)が付されている。フラッシュメモリ2には、出荷時から不良である先天性の不良物理ブロックが存在することがある。更に、フラッシュメモリ2には、出荷時に良品の物理ブロックであっても、使用開始後に劣化して不良ブロックになる物理ブロック(後天性の不良ブロック)が存在することもある。
The
さて、NAND型フラッシュメモリでは、データ読み出し動作及びデータ書き込み動作はページ単位で行われ、データ消去動作は物理ブロック単位で行われる。データ消去動作は、論理アクセス領域が属する論理ブロック(以下、「書込み先論理ブロック」と言う)に対応した物理ブロックに記憶されているデータ又はそのデータに対応する最新データが別の物理ブロックに書き込まれ、その物理ブロックに記憶されているデータが全て別の物理ブロックに書き込まれたデータで置き換えられたときに行われる。すなわち、書込み先論理ブロックに対応した物理ブロックに記憶されているデータが、全て別の物理ブロックに書き込まれたデータで置き換えられた場合には、その物理ブロックに記憶されているデータが消去され、前述したアドレス変換テーブル(論理ブロックと物理ブロックとの対応関係を記述したテーブル)に記述されている論理ブロックと物理ブロックとの対応関係が更新される。また、書込み先論理ブロックを新たに割り当てる空きの物理ブロック(論理ブロックが未割当ての物理ブロック)を検索するときには、例えば、フラッシュメモリ2内の先頭の物理ブロックから末尾の物理ブロックへと順次に空きの物理ブロックの検索が行われる。そして、検出された空きの物理ブロックに、書込み先論理ブロックが割り当てられる。
In the NAND flash memory, a data read operation and a data write operation are performed in units of pages, and a data erase operation is performed in units of physical blocks. In the data erasure operation, the data stored in the physical block corresponding to the logical block to which the logical access area belongs (hereinafter referred to as “write destination logical block”) or the latest data corresponding to the data is written in another physical block. This is performed when all the data stored in the physical block is replaced with data written in another physical block. That is, when the data stored in the physical block corresponding to the write destination logical block is all replaced with the data written in another physical block, the data stored in the physical block is erased, The correspondence relationship between the logical block and the physical block described in the address conversion table (the table describing the correspondence relationship between the logical block and the physical block) is updated. When searching for a free physical block to which a write destination logical block is newly assigned (a physical block to which no logical block is assigned) is searched, for example, a free space is sequentially provided from the first physical block to the last physical block in the
以上のように、物理ブロックに記憶されているデータの書き換えが行われる場合には、その物理ブロックとは別の物理ブロック(空きの物理ブロック)に、その物理ブロックと対応する論理ブロックが新たに割り当てられることになる。また、書込み先論理ブロックに対応する物理ブロックがない場合にも、空きの物理ブロックに論理ブロックが新たに割り当てられることになる。 As described above, when data stored in a physical block is rewritten, a logical block corresponding to the physical block is newly added to a physical block (empty physical block) different from the physical block. Will be assigned. Further, even when there is no physical block corresponding to the write destination logical block, a logical block is newly allocated to an empty physical block.
本実施の形態では、論理ブロックが新たに物理ブロックに割り当てられたときに、その物理ブロックの冗長領域に、その新たに割り当てられた論理ブロックを示す論理アドレス情報に加えて、書替マークが書き込まれる。本実施形態で言う「書替マーク」とは、論理ブロックが新たに物理ブロックに割り当てられることに関連した処理の結果が所定の条件に合致したときに更新される版数情報である。「論理ブロックが新たに物理ブロックに割り当てられることに関連した処理」と「所定の条件」については、後に幾つかの例を詳細に説明する。 In this embodiment, when a logical block is newly assigned to a physical block, a rewrite mark is written in the redundant area of the physical block in addition to the logical address information indicating the newly assigned logical block. It is. The “rewrite mark” referred to in the present embodiment is version number information that is updated when a result of processing related to a logical block being newly assigned to a physical block matches a predetermined condition. With respect to “processing related to the logical block being newly assigned to the physical block” and “predetermined condition”, some examples will be described in detail later.
書替マークは、所定の順序で循環する少なくとも3種類の情報である。つまり、この書替マークは、所定の順序で更新され(遷移し)、最終の書替マークになった後は、最初の書替マークに更新される(戻る)。例えば、図4Aに示すように、所定の条件に合致する毎に、メモリコントローラ3によって、書替マークが、第1の書替マーク“55”、第2の書替マーク“5A”、第3の書替マーク“A5”、第4の書替マーク“AA”という順番で更新され、第4の書替マーク“AA”の次は、第1の書替マークに更新される。
The rewrite marks are at least three types of information that circulate in a predetermined order. That is, the rewrite mark is updated (transitioned) in a predetermined order, and after the last rewrite mark is reached, it is updated (returned) to the first rewrite mark. For example, as shown in FIG. 4A, every time a predetermined condition is met, the
以下、図4Aを参照して説明した規則で書替マークが更新されることを例に採り、図4B及び図5を参照して、本実施形態で行われる処理を説明する。その際、書替マークが第1の書替マーク“55”であった期間を、「第1の期間」と言い、書替マークが第2の書替マーク“5A”であった期間を「第2の期間」、と言い、書替マークが第3の書替マーク“A5”であった期間を「第3の期間」と言い、書替マークが第4の書替マーク“AA”であった期間を「第4の期間」と言う。書替マークが循環するので、期間も循環する。 Hereinafter, the process performed in the present embodiment will be described with reference to FIGS. 4B and 5, taking as an example that the rewrite mark is updated according to the rule described with reference to FIG. 4A. At this time, a period in which the rewrite mark is the first rewrite mark “55” is referred to as “first period”, and a period in which the rewrite mark is the second rewrite mark “5A” The second period ”, the period when the rewrite mark was the third rewrite mark“ A5 ”is referred to as the“ third period ”, and the rewrite mark is the fourth rewrite mark“ AA ”. This period is called “fourth period”. Since the rewrite mark circulates, the period also circulates.
第1の書替マーク“55”が書き込まれている物理ブロックは、第1の期間に論理ブロックが新たに割り当てられた物理ブロックであり、第2の書替マーク“5A”が書き込まれている物理ブロックは、第2の期間に論理ブロックが新たに割り当てられた物理ブロックであり、第3の書替マーク“A5”が書き込まれている物理ブロックは、第3の期間に論理ブロックが新たに割り当てられた物理ブロックであり、第4の書替マーク“AA”が書き込まれている物理ブロックは、第4の期間に論理ブロックが新たに割り当てられた物理ブロックである。 The physical block in which the first rewrite mark “55” is written is a physical block to which a logical block is newly allocated in the first period, and the second rewrite mark “5A” is written therein. The physical block is a physical block to which a logical block is newly assigned in the second period, and a physical block in which the third rewrite mark “A5” is written is newly added in the third period. The physical block to which the fourth rewrite mark “AA” is written is a physical block to which a logical block is newly allocated in the fourth period.
具体的には、例えば、図4Bにおいて、(4A)に示すように、空きの物理ブロックとして検出されたPBA#12の物理ブロックに、LBN#41の論理ブロックが新たに割り当てられたとき、そのときは第1の期間内であるため、そのPBA#12の物理ブロックの冗長領域105には、新たに割り当てられた論理ブロックのLBN“#41”と、第1の書替マーク“55h”が書き込まれる。
Specifically, for example, in FIG. 4B, when a logical block of
次に、(4B)に示すように、空きの物理ブロックとして検出されたPBA#18の物理ブロックに、LBN#42の論理ブロックが新たに割り当てられたとき、そのときも第1の期間内であるため、そのPBA#18の物理ブロックの冗長領域105には、新たに割り当てられた論理ブロックのLBN“#42”と、第1の書替マーク“55h”が書き込まれる。
Next, as shown in (4B), when a logical block of
その後、(4C)及び(4D)に示すように、新たに論理ブロックが物理ブロックに割り当てられるが、いずれのときも、第1の期間内であるため、新たに論理ブロックが割り当てられた物理ブロックの冗長領域105には、新たに割り当てられた論理ブロックのLBNと、第1の書替マーク“55h”が書き込まれる。
After that, as shown in (4C) and (4D), a new logical block is allocated to the physical block. However, since both are within the first period, the physical block to which the new logical block is allocated In the
ここで、(4D)のとき、すなわち、新たにLBA#44の論理ブロックがPBA#27物理ブロックに割り当てられたとき、その割り当てに関連した処理の結果が所定の条件に合致したとする。この場合、書替マークが、第1の書替マーク“55”から第2の書替マーク“5A”に更新される。この時点で、第1の期間が終了し、第2の期間が開始する。
Here, in the case of (4D), that is, when a logical block of
従って、その後、例えば(4E)に示すように、空きの物理ブロックとして検出されたPBA#31の物理ブロックに、LBN#45の論理ブロックが新たに割り当てられたとき、そのときは第2の期間内であるので、そのPBA#31の物理ブロックの冗長領域105には、新たに割り当てられた論理ブロックのLBN“#45”と、第2の書替マーク“5Ah”が書き込まれる。
Therefore, after that, for example, as shown in (4E), when a logical block of
以上のように、どの期間内で、新たに論理ブロックが物理ブロックに割り当てられたかによって、物理ブロックの冗長領域に書き込まれる書替マークが異なる。 As described above, the rewrite mark written in the redundant area of the physical block differs depending on in which period the logical block is newly allocated to the physical block.
尚、新たに論理ブロックが割り当てられる物理ブロックを検索するための空きブロック検索は、ホストシステム4の記憶領域として用いられる全ての物理ブロックを対象にして行われる。その際、それら全ての物理ブロックについて先頭の物理ブロックから末尾の物理ブロックに向かって、順次、空きブロックの検索が行われる。このように、検索対象の範囲に含まれる物理ブロックについて、先頭の物理ブロックから末尾の物理ブロックに向かう順番の空きブロックの検索が繰り返し行われることにより、殆ど書き換えが行われないデータ(書き換え頻度が低いデータ)が記憶されている物理ブロックがなければ、検索対象の範囲に含まれる物理ブロックの書き換え回数は、ほぼ均等になることが期待される。
The free block search for searching for a physical block to which a new logical block is newly assigned is performed for all physical blocks used as a storage area of the
さて、メモリコントローラ3は、所定のタイミングで(例えば、書替マークを更新したときに)、少なくとも1期間より長く書き替え(記憶されているデータを一旦消去した後の書込み)が行われていない物理ブロック、言い換えれば、現在割り当てられている論理ブロックの割り当てが行われてから少なくとも1期間よりも長い期間の経過した物理ブロックが検索される。
Now, the
例えば、1期間より長く書き替えが行われていない物理ブロックが検索される。この場合、現在の期間よりも2期間以上前の期間に対応する書替マークが記憶されている物理ブロックが検索される。図5に示すように、現在の書替マークが第2の書替マーク“5Ah”であれば、現在は第2の期間である。故に、第4の書替マーク“AAh”又は第3の書替マーク“A5”が記憶されている物理ブロックは、この第2の期間より1期間前である第1の期間において、データの書き替えが行われていない物理ブロックである。従って、現在の書替マークが第2の書替マーク“5Ah”であれば、第1の書替マーク“55”よりも順番が前である第4の書替マーク“AAh”又は第3の書替マーク“A5”が記憶されている物理ブロックが検索される。つまり、図5の例で言えば、1期間より長く書き替えが行われていない物理ブロックとして、PBA#6、#15及び#16の物理ブロックが検出される。
For example, a physical block that has not been rewritten for longer than one period is searched. In this case, a physical block in which a rewrite mark corresponding to a period two or more periods before the current period is stored is searched. As shown in FIG. 5, if the current rewrite mark is the second rewrite mark “5Ah”, the current period is the second period. Therefore, the physical block in which the fourth rewrite mark “AAh” or the third rewrite mark “A5” is stored is written in the first period, which is one period before the second period. It is a physical block that has not been replaced. Therefore, if the current rewrite mark is the second rewrite mark “5Ah”, the fourth rewrite mark “AAh” or the third rewrite mark that is in the order before the first rewrite mark “55”. The physical block in which the rewrite mark “A5” is stored is searched. In other words, in the example of FIG. 5, physical
本実施形態では、1期間より長く書き換えが行われていない物理ブロックが、書き換え頻度の低いデータが記憶されている物理ブロックとみなされる。このような物理ブロックが検出されたときには、メモリコントローラ3は、空きブロック検索を行って別の物理ブロック(空きブロック)を検出し、書き換え頻度の低いデータが記憶されているとみなされた物理ブロックに記憶されているデータを、その別の物理ブロックに転送(複写)する。更に、メモリコントローラ3は、その別の物理ブロックに、現在の書替マークを書込む。具体的には、例えば、図5の(5A)、(5B)及び(5C)に示すように、検出されたPBA#6、#15及び#16の物理ブロックに記憶されているデータが、空きブロック検索により検出されたPBA#32、#33及び#34の物理ブロックにそれぞれ転送(複写)される。また、冗長領域105には、論理アドレス情報としてLBN#6、#15及び#16が書き込まれ、書替マークとして現在の書替マークである第2の書替マーク“5Ah”が、PBA#32、#33及び#34が書き込まれる。
In the present embodiment, a physical block that has not been rewritten for a period longer than one period is regarded as a physical block in which data with a low rewrite frequency is stored. When such a physical block is detected, the
この転送処理が終了した後に、転送元の物理ブロックに記憶されているデータ消去される。具体的には、PBA#6、#15及び#16の物理ブロックに記憶されているデータを消去することを指示する内部コマンドが、メモリコントローラ3からフラッシュメモリ2に順次与えられ、この内部コマンドに応答してフラッシュメモリ2は、PBA#6、#15及び#16の物理ブロックに記憶されているデータを消去する。
After this transfer process is completed, the data stored in the transfer source physical block is erased. Specifically, an internal command instructing to erase data stored in the physical blocks of
尚、書き換え頻度の低いデータが記憶されている物理ブロックとみなす基準、つまり、何期間より長く書き換えが行われていない物理ブロックを書き換え頻度の低いデータが記憶されている物理ブロックとみなすかは、書替マークが一巡するまでの期間の数(及び/又は、一期間の長さ)などを考慮して、適宜設定することができる。 It should be noted that the criteria for considering data with low rewrite frequency as stored physical blocks, that is, for how long a physical block that has not been rewritten for longer than that is considered as a physical block with low rewrite frequency stored, It can be set as appropriate in consideration of the number of periods (and / or the length of one period) until the rewrite mark is completed.
また、書替マークが一巡するまでの期間の数が少ない場合には、書替マークを更新したときに、変更後の書替マークと同じ書替マークを、一巡前の期間で書き込んだ物理ブロックが残っていることのないように注意する必要がある。具体的には、メモリコントローラ3は、1期間より長く書き換えが行われていない物理ブロックを検索する処理や、検出された物理ブロックに記憶されているデータを別の物理ブロックに転送(複写)する処理を、次に書替マークの更新が行われるときまでに全て終了させる必要がある。メモリコントローラ3は、この管理を確実に行うために、1期間より長く書き換えが行われていない物理ブロックが無くなるまでは、書き換え頻度の低いデータが記憶されている物理ブロックに記憶されているデータの転送処理を優先し、ホストシステム4からのコマンドを受け付けないようにしてもよい。
In addition, when the number of periods until the rewrite mark is completed is small, when the rewrite mark is updated, the physical block in which the same rewrite mark as the changed rewrite mark is written in the period before the rewrite mark Care must be taken that there is no remaining. Specifically, the
また、現在の書替マークは、例えば、メモリコントローラ3内の記憶領域、例えばワークエリア8(SRAM等の揮発性メモリ)に記憶される。ワークエリア8に記憶されている書替マークは、適時に、フラッシュメモリ2に複写される(書き込まれる)。電源が遮断されると、ワークエリア8に記憶されている書替マークは消去されるが、電源が投入されたときに、フラッシュメモリ2に記憶されている書替マークがワークエリア8に読み出され、以後、その書替マークが、現在の書替マークとして用いられる。メモリコントローラ3内に、FeRAM(Ferroelectric Random Access Memory)、MRAM(Magnetic Random Access Memory)等の不揮発性RAMからなる記憶領域を設け、この記憶領域に書替マークを保持するようにしてもよい。このような不揮発性RAMに書替マークを保持するようにした場合、不揮発性RAM上で書替マークを管理することができ、書替マークをフラッシュメモリ2に複写する必要がなくなる。
The current rewrite mark is stored in, for example, a storage area in the
また、書き換え頻度の低いデータが記憶されている物理ブロックとみなされた物理ブロックは、その物理ブロックに記憶されているデータが別の物理ブロックに転送(複写)された後に記憶データが消去され、空きの物理ブロックとされる。空きとされた物理ブロックは、それまでの書き換え回数が少ない可能性があるが、空きブロックになったことにより、この後の書き換え回数が多くなる可能性が高くなる。逆に、データの複写先となった物理ブロックは、それまでの書き換え回数が多い可能性があるが、書き換え頻度の低いデータが複写されたことにより、この後の書き換え回数が少なくなる可能性が高くなる。このような原理により、フラッシュメモリ2における複数の物理ブロックの書き換え回数が均等化されることが期待できる。
In addition, a physical block regarded as a physical block in which data with low rewrite frequency is stored is erased after the data stored in the physical block is transferred (copied) to another physical block, It is considered as an empty physical block. There is a possibility that the physical block that has been made empty has a small number of rewrites up to that point. However, since it becomes an empty block, the possibility that the number of rewrites thereafter will increase is high. Conversely, the physical block that is the data copy destination may have a large number of rewrites up to that point, but the data with a low rewrite frequency may be copied, which may reduce the number of subsequent rewrites. Get higher. Based on such a principle, it can be expected that the number of rewrites of a plurality of physical blocks in the
以下、本実施の形態で行われる処理の流れの概要を、図6を参照して説明する。 The outline of the flow of processing performed in the present embodiment will be described below with reference to FIG.
まず、初期設定が行われる(ステップ101)。例えば、メモリコントローラ3が、現在の書替マークを設定する。
First, initial setting is performed (step 101). For example, the
初期設定の後、ホストシステム4から書込みコマンドを受信した場合、メモリコントローラ3は、その書込みコマンドで指定された論理アクセス領域が属する論理ブロックに対応させる物理ブロックを新たに設定する必要があるかどうかを判断する(ステップ102)。その必要がある場合は(ステップ102でYES)、空きブロックの検索が行われ、検出された空きブロックに、書込みコマンドで指定された論理アクセス領域が属する論理ブロックが割り当てられる(ステップ103)。具体的には、検出された空きブロック(物理ブロック)の冗長領域105に、書込みコマンドで指定された論理アクセス領域が属する論理ブロックのLBNと、現在の書替マークとが書き込まれる。論理ブロックが新たに物理ブロックに割り当てられることに関連した処理も、このステップ103において実行される。その処理の結果が、所定の条件に合致していれば、書替マークが更新され、所定の条件に合致していなければ、書替マークの変更は行われない。
When a write command is received from the
メモリコントローラ3は、ステップ103において書替マークを更新したか否かを判断し(ステップ104)、更新した場合(ステップ104でYES)、書き換え頻度の低いデータが記憶されている物理ブロックの検索処理を行う。書き換え頻度の低いデータが記憶されている物理ブロックが検出された場合には、メモリコントローラ3は、検出された物理ブロックに記憶されているデータを別の物理ブロックに複写するデータ転送処理を行う(ステップ105)。具体的には、1期間より長く書き換えが行われていない物理ブロックが検索され、そのような物理ブロックが検出された場合には、検出された物理ブロックの記憶されているデータが別の物理ブロックに転送される。この転送が終了した後、検出された物理ブロックに記憶されているデータが消去される。
The
以上の説明によれば、論理ブロックが新たに物理ブロックに割り当てられたときに、その物理ブロックに、書替マークが書き込まれる。書替マークは、論理ブロックが新たに物理ブロックに割り当てられたことに関連した処理の結果が所定の条件に合致したときに更新される版数情報である。更新後の書替マークよりも順番が2つ以上前の書替マークが記憶されている物理ブロックが、書き換え頻度の低いデータが記憶されている物理ブロックとみなされる。そして、そのような書き換え頻度の低いデータが記憶されている物理ブロックが存在するときだけ、その物理ブロックを含めたウェアー・レベリング制御が行われる。 According to the above description, when a logical block is newly assigned to a physical block, a rewrite mark is written to the physical block. The rewrite mark is version number information that is updated when a result of processing related to a logical block newly assigned to a physical block matches a predetermined condition. A physical block in which a rewrite mark two or more orders before the rewritten mark after the update is stored is regarded as a physical block in which data with a low rewrite frequency is stored. The wear leveling control including the physical block is performed only when there is a physical block storing such data with low rewrite frequency.
さて、上述したように、書替マークは、論理ブロックが新たに物理ブロックに割り当てられることに関連した処理の結果が所定の条件に合致したときに更新される版数情報である。論理ブロックが新たに物理ブロックに割り当てられることに関連した処理や、所定の条件としては、以下の第1の例乃至第4の例のうちのいずれかの例を採用することができる。以下、それぞれの例について、詳細に説明する。 As described above, the rewrite mark is version number information that is updated when a result of processing related to a new allocation of a logical block to a physical block matches a predetermined condition. Any of the following first to fourth examples can be adopted as a process related to a new allocation of a logical block to a physical block and a predetermined condition. Hereinafter, each example will be described in detail.
<第1の例>。 <First example>.
第1の例では、「論理ブロックが新たに物理ブロックに割り当てられることに関連した処理」とは、アドレス変換テーブルの保存先の物理ブロック(テーブル保存ブロック)の変更回数を表すカウント値(以下、「変更カウント値」と言う)がカウントアップ(又はカウントダウン)されることであり、「所定の条件」とは、変更カウント値が所定の値になることである。 In the first example, “a process related to a logical block being newly assigned to a physical block” means a count value (hereinafter, referred to as the number of changes of the physical block (table storage block) of the storage destination of the address translation table). (Referred to as “change count value”) is counted up (or counted down), and “predetermined condition” is that the change count value becomes a predetermined value.
変更カウント値は、テーブル保存ブロックが変更される都度に、カウントアップ(又はカウントダウン)される。カウントアップ後(又はカウントダウン後)の変更カウント値は、テーブル保存ブロックに書き込まれる。これにより、テーブル保存ブロックに記憶されている変更カウント値から、テーブル保存ブロックの変更が何回行われたかを把握することができる。なお、前述したように、テーブル保存ブロックには、書替マークではなく変更カウント値が書き込まれるため、図7Aに示すように、フラッシュメモリ2には、ホストシステムから与えられたデータが記憶されている物理ブロック(以下、「データ保存ブロック」と言う)と、アドレス変換テーブルが記憶されているテーブル保存ブロック(PBA#5やPBA#14の物理ブロック)が混在することになる。尚、書替マークと変更カウント値が重複することがないように設定すれば、書替マークが書き込まれているか、又は変更カウント値が書き込まれているかにより、その物理ブロックがデータ保存ブロックであるか、又はテーブル保存ブロックであるかを判別することができる。また、データ保存ブロックについては、論理アドレス情報の代わりに、データ保存ブロックであることを示す情報(どの論理ゾーンのアドレス変換テーブルが保存されているかを示す情報)を書き込むようにしてもよい。
The change count value is counted up (or counted down) every time the table storage block is changed. The changed count value after counting up (or after counting down) is written to the table storage block. Thereby, it is possible to grasp how many times the table storage block has been changed from the change count value stored in the table storage block. As described above, since the change count value is written in the table storage block instead of the rewrite mark, the data provided from the host system is stored in the
この第1の例では、テーブル保存ブロックの変更が何回行われたときに書替マークを更新するかが予め決められている。つまり、変更カウント値についての所定の値が予め設定されている。テーブル保存ブロックが変更された場合に、変更カウント値がカウントアップ(又はカウントダウン)され、カウントアップ(又はカウントダウン)後の変更カウント値が、所定の値になったならば、書替マークが更新される。例えば、所定の値を15(0Fh)とした場合、新たに割り当てたテーブル保存ブロックに変更カウント値として15(0Fh)を書き込んだ際に、書替マークを更新する。また、本実施の形態の場合には、変更カウント値を15(0Fh)の次に0(00h)に戻すようにすれば、書替マークと変更カウント値が重複することがない。 In this first example, it is determined in advance how many times the table storage block is changed to update the rewrite mark. That is, a predetermined value for the change count value is set in advance. When the table storage block is changed, the change count value is counted up (or counted down). When the changed count value after the count up (or count down) reaches a predetermined value, the rewrite mark is updated. The For example, when the predetermined value is 15 (0Fh), the rewrite mark is updated when 15 (0Fh) is written as the change count value in the newly allocated table storage block. In the case of the present embodiment, if the change count value is returned to 15 (0Fh) and then 0 (00h), the rewrite mark and the change count value will not overlap.
尚、どの論理ゾーンのアドレス変換テーブルが記憶されているテーブル保存ブロックの変更カウント値に基づいて書替マークを更新するかは適宜設定することができる。また、現在の書替マークは、テーブル保存ブロックに保存しておくようにしてもよい。 Note that it is possible to appropriately set which logical zone's address conversion table is to be updated based on the change count value of the table storage block in which the address conversion table is stored. Further, the current rewrite mark may be stored in the table storage block.
以下、この第1の例に関する処理の流れを説明する。 Hereinafter, the flow of processing relating to the first example will be described.
メモリコントローラ3は、例えば、図6のS103において、図7Bに示す処理を実行する。すなわち、メモリコントローラ3は、新たに論理ブロックを物理ブロックに割り当てたことによりアドレス変更テーブルを更新した場合、テーブル保存ブロックである物理ブロックに、更新後のアドレス変換テーブルを記憶することが可能な空き物理ページが残っているか否かを判断する(S111)。
For example, the
残っていないとの判断結果であれば(S111:YES)、メモリコントローラ3は、S112を実行する。すなわち、メモリコントローラ3は、空きブロック検索により別の物理ブロック(空きブロック)を検索し、検出された別の物理ブロックを新たなテーブル保存ブロックとする(つまりテーブル保存ブロックを変更する)。また、メモリコントローラ3は、変更前のテーブル保存ブロックであった物理ブロックに記憶されている変更カウント値をその物理ブロックから読出し、その変更カウント値をカウントアップ(又はカウントダウン)する。そして、メモリコントローラ3は、変更後のテーブル保存ブロックである上記別の物理ブロック(空きブロック)に、カウントアップ後(又はカウントダウン後)の変更カウント値と、更新後のアドレス変換テーブルとを書き込む。さらに、メモリコントローラ3は、テーブル管理情報101(図3参照)における、そのアドレス変換テーブルに対応する論理ゾーンのLZNに対応したPBAを、変更後のテーブル保存ブロックのPBAに更新する。
If it is a determination result that it does not remain (S111: YES), the
その後、メモリコントローラ3は、カウントアップ(又はカウントダウン)後の変更カウント値が所定の値であるか否かを判断する(S113)。変更カウント値が所定の値であれば(S113:YES)、メモリコントローラ3は、書替マークを更新する(S114)。
Thereafter, the
以上が、第1の例についての説明である。尚、現在の書替マークは、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。
The above is the description of the first example. The current rewrite mark is preferably stored in the
<第2の例>。 <Second example>.
第2の例では、「論理ブロックが新たに物理ブロックに割り当てられることに関連した処理」とは、テーブル管理情報の保存先の物理ブロック(管理情報ブロック)の切替回数を表すカウント値(以下、「切替カウント値」と言う)がカウントアップ(又はカウントダウン)されることであり、「所定の条件」は、切替カウント値が所定の値になることである。 In the second example, “processing related to a logical block being newly assigned to a physical block” is a count value (hereinafter, referred to as the number of times of switching of a physical block (management information block) as a storage destination of table management information. (Referred to as “switch count value”) is counted up (or counted down), and “predetermined condition” is that the switch count value becomes a predetermined value.
切替カウント値は、管理情報ブロックが変更される都度に、カウントアップ(又はカウントダウン)される。切替カウント値は、管理情報ブロックに書き込まれる。これにより、管理情報ブロックに記憶されている切替カウント値から、管理情報ブロックの切替えが何回行われたかを把握することができる。 The switching count value is counted up (or counted down) every time the management information block is changed. The switching count value is written in the management information block. Thereby, it is possible to grasp how many times the management information block is switched from the switching count value stored in the management information block.
管理情報ブロックは、管理情報ブロック候補の中から選択される。図8Aに示した例では、PBA#0とPBA#1の物理ブロックが管理情報ブロック候補としている。従って、PBA#0又はPBA#1の物理ブロックが管理情報ブロックとして使用される。この管理情報ブロックに、現在の書替マークを書き込んでおくようにしてもよい。
The management information block is selected from management information block candidates. In the example shown in FIG. 8A, physical
尚、この例では、PBA#0又はPBA#1の物理ブロックが、テーブル保存ブロック又はデータ保存ブロックに割り当てられることはない。また、テーブル保存ブロックに変更カウント値を書き込む必要はない。
In this example, the physical block of
この第2の例では、管理情報ブロックの切替が何回行われたときに書替マークを更新するかが予め決められている。つまり、切替カウント値についての所定の値が予め設定されている。管理情報ブロックが切替えられた場合に、切替カウント値がカウントアップ(又はカウントダウン)され、カウントアップ(又はカウントダウン)後の切替カウント値が、所定の値になったならば、書替マークが更新される。所定の値は、1個でも良いし、複数個(例えば或る自然数の倍数)であっても良い。 In this second example, it is determined in advance how many times the management information block is switched to update the rewrite mark. That is, a predetermined value for the switching count value is set in advance. When the management information block is switched, the switching count value is counted up (or counted down). When the switching count value after counting up (or counting down) reaches a predetermined value, the rewrite mark is updated. The The predetermined value may be one or plural (for example, a multiple of a certain natural number).
以下、この第2の例に関する処理の流れを説明する。 Hereinafter, the flow of processing relating to the second example will be described.
メモリコントローラ3は、例えば、図6のS103において、図8Bに示す処理を実行する。すなわち、メモリコントローラ3は、テーブル保存ブロックの変更に伴ってテーブル管理情報を更新した場合、管理情報ブロックである物理ブロックに、更新後のテーブル管理情報を記憶することが可能な空き物理ページが残っているか否かを判断する(S121)。
For example, the
残っていないとの判断結果であれば(S121:YES)、メモリコントローラ3は、S122を実行する。すなわち、メモリコントローラ3は、前述した2個の管理情報ブロック候補のうちの他方の物理ブロックを新たな管理情報ブロックとする(つまり管理情報ブロックを切替る)。また、メモリコントローラ3は、切替前の管理情報ブロックであった物理ブロックに記憶されている切替カウント値をその物理ブロックから読出し、その切替カウント値をカウントアップ(又はカウントダウン)する。そして、メモリコントローラ3は、切替後の管理情報ブロックである上記他方の物理ブロックに、カウントアップ後(又はカウントダウン後)の切替カウント値と、更新後のテーブル管理情報とを書き込む。
If it is a determination result that it does not remain (S121: YES), the
その後、メモリコントローラ3は、カウントアップ(又はカウントダウン)後の切替カウント値が所定の値であるか否かを判断する(S123)。切替カウント値が所定の値であれば(S123:YES)、メモリコントローラ3は、書替マークを更新する(S124)。
Thereafter, the
以上が、第2の例についての説明である。尚、現在の書替マークは、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。
The above is the description of the second example. The current rewrite mark is preferably stored in the
<第3の例>。 <Third example>.
第3の例では、「論理ブロックが新たに物理ブロックに割り当てられることに関連した処理」とは、先頭の物理ブロックから末尾の物理ブロックに向かう順番で行われる空きブロックの検索であり、「所定の条件」は、空きブロックの検索が一巡したことである。空きブロック検索が一巡するとは、先頭の物理ブロックから開始した空きブロックの検索が末尾の物理ブロックまでいって先頭の物理ブロックに戻ったことである。 In the third example, “a process related to a logical block being newly assigned to a physical block” is a search for a free block performed in the order from the first physical block to the last physical block. The “condition” is that the search for empty blocks has been completed. A free block search is a complete search for a free block that starts from the first physical block and goes back to the last physical block.
メモリコントローラ3は、例えば、図6のS103において、図9Aに示す処理を実行する。すなわち、メモリコントローラ3は、空きブロックの検索が一巡したならば(S131:YES)、書替マークを更新する(S132)。
For example, the
尚、現在の書替マークは、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。又、空きブロックの検索における検索開始ブロック(次回の検索を開始する物理ブロック)も、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。また、この第3の例では、空きブロックの検索が一巡したことを、所定の条件としているが、一巡に限らず、二回以上の所定回数巡回したことが、所定の条件であっても良い。この場合、ワークメモリ(SRAM)8上で、空きブロックの検索の巡回回数を表すカウント値が、空きブロックの検索が一巡する毎に、更新される。この巡回回数も、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。
The current rewrite mark is preferably stored in the
<第4の例>。 <Fourth example>.
第4の例では、「論理ブロックが新たに物理ブロックに割り当てられることに関連した処理」とは、物理ブロックに対して論理ブロックを新たに割り当てた回数を表すカウント値(以下、「割当カウント値」と言う)がカウントアップ(又はカウントダウン)されることであり、「所定の条件」は、割当カウント値が所定の値になることである。 In the fourth example, “processing related to a logical block being newly assigned to a physical block” means a count value indicating the number of times a logical block is newly assigned to a physical block (hereinafter referred to as “allocation count value”). ”) Is counted up (or counted down), and the“ predetermined condition ”is that the assigned count value becomes a predetermined value.
割当カウント値は、物理ブロックに対して論理ブロックを新たに割り当てられる都度に、カウントアップ(又はカウントダウン)される。従って、割当カウント値から、物理ブロックに対して新たに論理ブロックが何回割り当てられたかを把握することができる。 The allocation count value is counted up (or counted down) every time a logical block is newly allocated to a physical block. Therefore, it is possible to grasp how many times a logical block is newly allocated to the physical block from the allocation count value.
この第4の例では、論理ブロックが新たに物理ブロックに何回割り当てられたときに書替マークを更新するかが予め決められている。つまり、割当カウント値についての所定の値が予め設定されている。所定の値は、1個でも良いし、複数個(例えば或る自然数の倍数)であっても良い。 In the fourth example, it is determined in advance how many times a logical block is newly assigned to a physical block when the rewrite mark is updated. That is, a predetermined value for the allocation count value is set in advance. The predetermined value may be one or plural (for example, a multiple of a certain natural number).
メモリコントローラ3は、例えば、図6のS103において、図9Bに示す処理を実行する。すなわち、メモリコントローラ3は、論理ブロックが新たに物理ブロックに割り当てられた場合に、例えばワークメモリ(SRAM)8上で、割当カウント値をカウントアップ(又はカウントダウン)する(S141)。そして、メモリコントローラ3は、カウントアップ(又はカウントダウン)後の割当カウント値が、所定の値になったか否かを判断する(S142)。割当カウント値が所定の値であれば(S142:YES)、メモリコントローラ3は、書替マークを更新する(S143)。
For example, the
以上が、第4の例についての説明である。尚、現在の書替マーク及び割当カウント値は、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。また、割当カウント値は、新たに論理ブロックが割り当てられた物理ブロックに書き込まれても良い。
The above is the description of the fourth example. The current rewrite mark and the assigned count value are preferably stored in the
以上、上述した本発明の実施形態は、本発明の説明のための例示であり、本発明の範囲をそれらの実施形態にのみ限定する趣旨ではない。当業者は、本発明の要旨を逸脱することなしに、他の様々な態様で本発明を実施することができる。例えば、メモリコントローラ3は、第1の例乃至第4の例のうちのいずれかを選択し、選択した例に基づいて書替マークを更新しても良い。具体的には、例えば、メモリコントローラ3は、第1の例に基づく条件で書替マークを更新する第1のモードと、第2の例に基づく条件で書替マークを更新する第2のモードと、第3の例に基づく条件で書替マークを更新する第3のモードと、第4の例に基づく条件で書替マークを更新する第4のモードとを有しており、ホストシステム4からの指示又は発生したイベントの結果に従って、第1乃至第4のモードからいずれかのモードを選択し、選択したモードに従って、書替マークを更新するようにしても良い。
As mentioned above, embodiment of this invention mentioned above is an illustration for description of this invention, and is not the meaning which limits the scope of the present invention only to those embodiment. Those skilled in the art can implement the present invention in various other modes without departing from the gist of the present invention. For example, the
1…フラッシュメモリシステム、2…フラッシュメモリ、3…メモリコントローラ、6…マイクロプロセッサ
DESCRIPTION OF
Claims (11)
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当て手段と、
前記論理ブロック割り当て手段によって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理手段と、
前記アドレス変換テーブル管理手段によって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存手段と、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理手段と、
前記テーブル保存ブロック管理手段によって、新たな前記テーブル保存ブロックの割り当てが行われたときに、空き領域が無くなった前記テーブル保存ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記テーブル保存ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込み手段と、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定手段と、
前記版数情報決定手段によって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備えるメモリコントローラ。 A memory controller that controls access to a flash memory that is erased in units of physical blocks based on an access instruction given from a host system,
Logical block allocating means for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
Address translation table management means for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation means;
Table storage that is the physical block that is the storage destination of the address conversion table when the correspondence relationship between at least some of the logical blocks and the physical block in the address conversion table is changed by the address conversion table management unit Address conversion table storage means for storing the address conversion table in a block;
A table storage block management means for newly allocating another physical block as the table storage block when there is no more free space for storing the address conversion table in the table storage block;
When the table storage block management means assigns a new table storage block, the previous count value that is the count value that matches the count value stored in the table storage block that has no free space Count information writing means for writing the latest count value, which is the updated count value, into the physical block newly assigned as the table storage block;
Version number information determining means for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
Version number information writing means for writing the version number information determined by the version number information determining means into the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
A memory controller.
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当て手段と、
前記論理ブロック割り当て手段によって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理手段と、
前記アドレス変換テーブル管理手段によって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存手段と、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理手段と、
前記テーブル保存ブロックとして割り当てられている前記物理ブロックが変わったときに、前記テーブル保存ブロックとして割り当てられている前記物理ブロックを示す管理情報を、前記管理情報の保存先の前記物理ブロックである管理情報ブロックに保存する管理情報保存手段と、
前記管理情報ブロックに、前記管理情報を保存するための空き領域が無くなったとき、別の前記物理ブロックを前記管理情報ブロックとして新たに割り当てる管理情報ブロック管理手段と、
前記管理情報ブロック管理手段によって、新たな前記管理情報ブロックの割り当てが行われたときに、空き領域が無くなった前記管理情報ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記管理情報ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込み手段と、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定手段と、
前記版数情報決定手段によって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備えるメモリコントローラ。 A memory controller that controls access to a flash memory that is erased in units of physical blocks based on an access instruction given from a host system,
Logical block allocating means for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
Address translation table management means for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation means;
Table storage that is the physical block that is the storage destination of the address conversion table when the correspondence relationship between at least some of the logical blocks and the physical block in the address conversion table is changed by the address conversion table management unit Address conversion table storage means for storing the address conversion table in a block;
A table storage block management means for newly allocating another physical block as the table storage block when there is no more free space for storing the address conversion table in the table storage block;
When the physical block allocated as the table storage block changes, the management information indicating the physical block allocated as the table storage block is the management information that is the physical block of the storage destination of the management information Management information storage means to be stored in the block;
Management information block management means for newly allocating another physical block as the management information block when there is no free space for storing the management information in the management information block;
When the management information block management means assigns a new management information block, the count value immediately before is a count value that matches the count value stored in the management information block that has no free space. Count information writing means for writing the latest count value, which is the updated count value, into the physical block newly assigned as the management information block;
Version number information determining means for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
Version number information writing means for writing the version number information determined by the version number information determining means into the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
A memory controller.
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記フラッシュメモリ内の消去状態の前記物理ブロックを検索する手段であって、前記フラッシュメモリ内の前記物理ブロックが消去状態であるか否かを所定の順番で判断していく空きブロック検索手段と、
前記空きブロック検索手段で検出された消去状態の前記物理ブロックに対して前記論理ブロックを割り当てる論理ブロック割り当て手段と、
前記空きブロック検索手段における所定の順番の検索が所定回数巡回する毎に、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理手段と、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備えるメモリコントローラ。 A memory controller that controls access to a flash memory that is erased in units of physical blocks 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 sectors in the logical address space on the host system side and the physical block;
Means for searching for the physical block in the erased state in the flash memory, the free block searching means for determining in a predetermined order whether or not the physical block in the flash memory is in an erased state;
Logical block allocation means for allocating the logical block to the physical block in the erased state detected by the free block search means;
Version number information management means for updating the version number information to be written in the physical block to which the logical block is assigned each time the search in the predetermined order in the empty block search means circulates a predetermined number of times,
Version number information writing means for writing the version number information to the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
A memory controller.
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理手段と、
前記物理ブロックに対して前記論理ブロックが新たに割り当てられる毎にカウント値を更新するカウント手段と
前記カウント値が所定の値に達したときに、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理手段と、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込み手段と、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断手段と、
前記判断手段によって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送手段と、
を備えるメモリコントローラ。 A memory controller that controls access to a flash memory that is erased in units of physical blocks 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 sectors in the logical address space on the host system side and the physical block;
Count means for updating the count value each time the logical block is newly assigned to the physical block, and version number information to be written to the physical block to which the logical block is assigned when the count value reaches a predetermined value Version information management means for updating
Version number information writing means for writing the version number information to the physical block to which the logical block is newly assigned;
Determining means for determining whether to transfer the data stored in the physical block to another physical block based on the version number information written in the physical block;
Data transfer means for transferring data stored in the physical block that is the object of the positive determination to another physical block when a positive determination is made by the determination means;
A memory controller.
前記肯定的な判断の対象の前記物理ブロックは、現在の前記版数情報より所定順番以上前の前記版数情報が記憶されている物理ブロックである、
請求項1乃至4のうちのいずれか1項に記載のメモリコントローラ。 The version number information is information indicating at least three types of version numbers prepared in advance that circulate in a predetermined order;
The physical block to be affirmatively determined is a physical block in which the version number information that is a predetermined order or more before the current version number information is stored.
The memory controller according to claim 1.
前記メモリコントローラによってアクセスされるフラッシュメモリと、
を備えるフラッシュメモリシステム。 A memory controller according to any one of claims 1 to 5;
Flash memory accessed by the memory controller;
A flash memory system.
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当てステップと、
前記論理ブロック割り当てステップによって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理ステップと、
前記アドレス変換テーブル管理ステップによって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存ステップと、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理ステップと、
前記テーブル保存ブロック管理ステップによって、新たな前記テーブル保存ブロックの割り当てが行われたときに、空き領域が無くなった前記テーブル保存ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記テーブル保存ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込みステップと、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定ステップと、
前記版数情報決定ステップによって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備えるフラッシュメモリの制御方法。 A flash memory control method for controlling access to a flash memory that is erased in units of physical blocks based on an access instruction given from a host system,
A logical block allocation step for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
An address translation table management step for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation step;
When the address translation table management step changes the correspondence between at least some of the logical blocks and the physical block in the address translation table, the table is the physical block that is the destination of the address translation table. An address conversion table storage step for storing the address conversion table in a block;
A table storage block management step for newly allocating another physical block as the table storage block when there is no more free space in the table storage block for storing the address conversion table;
When a new table storage block is allocated by the table storage block management step, the count value immediately before is a count value that matches the count value stored in the table storage block that has no free space. A count information writing step of writing the latest count value, which is the updated count value, into the physical block newly assigned as the table storage block;
A version number information determining step for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
A version number information writing step of writing the version number information determined in the version number information determination step into the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
A method for controlling a flash memory.
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックを前記物理ブロックに割り当てる論理ブロック割り当てステップと、
前記論理ブロック割り当てステップによって設定された前記論理ブロックと前記物理ブロックとの対応関係を示すアドレス変換テーブルを管理するアドレス変換テーブル管理ステップと、
前記アドレス変換テーブル管理ステップによって、前記アドレス変換テーブルの少なくとも一部の前記論理ブロックと前記物理ブロックとの対応関係が変更されたときに、前記アドレス変換テーブルの保存先の前記物理ブロックであるテーブル保存ブロックに、前記アドレス変換テーブルを保存するアドレス変換テーブル保存ステップと、
前記テーブル保存ブロックに、前記アドレス変換テーブルを保存するための空き領域が無くなったとき、別の前記物理ブロックを前記テーブル保存ブロックとして新たに割り当てるテーブル保存ブロック管理ステップと、
前記テーブル保存ブロックとして割り当てられている前記物理ブロックが変わったときに、前記テーブル保存ブロックとして割り当てられている前記物理ブロックを示す管理情報を、前記管理情報の保存先の前記物理ブロックである管理情報ブロックに保存する管理情報保存ステップと、
前記管理情報ブロックに、前記管理情報を保存するための空き領域が無くなったとき、別の前記物理ブロックを前記管理情報ブロックとして新たに割り当てる管理情報ブロック管理ステップと、
前記管理情報ブロック管理ステップによって、新たな前記管理情報ブロックの割り当てが行われたとき、空き領域が無くなった前記管理情報ブロックに記憶されているカウント値と一致するカウント値である直前のカウント値を更新し、更新後のカウント値である最新のカウント値を、新たに前記管理情報ブロックとして割り当てられた前記物理ブロックに書き込むカウント情報書き込みステップと、
前記最新のカウント値に基づいて、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報を決定する版数情報決定ステップと、
前記版数情報決定ステップによって決定された前記版数情報を、前記論理ブロックが新たに割り当てられた前記物理ブロックに書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備えるフラッシュメモリの制御方法。 A flash memory control method for controlling access to a flash memory that is erased in units of physical blocks based on an access instruction given from a host system,
A logical block allocation step for allocating a logical block composed of a plurality of sectors in the logical address space on the host system side to the physical block;
An address translation table management step for managing an address translation table indicating a correspondence relationship between the logical block and the physical block set by the logical block allocation step;
When the address translation table management step changes the correspondence between at least some of the logical blocks and the physical block in the address translation table, the table is the physical block that is the destination of the address translation table. An address conversion table storage step for storing the address conversion table in a block;
A table storage block management step for newly allocating another physical block as the table storage block when there is no more free space in the table storage block for storing the address conversion table;
When the physical block allocated as the table storage block changes, the management information indicating the physical block allocated as the table storage block is the management information that is the physical block of the storage destination of the management information A management information storage step to be stored in the block;
A management information block management step for newly assigning another physical block as the management information block when there is no more free space in the management information block for storing the management information;
When a new management information block is allocated by the management information block management step, a count value immediately before that is a count value that matches a count value stored in the management information block that has no free space A count information writing step of updating and writing the latest count value, which is the updated count value, to the physical block newly assigned as the management information block;
A version number information determining step for determining version number information to be written in the physical block to which the logical block is newly allocated based on the latest count value;
A version number information writing step of writing the version number information determined in the version number information determination step into the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
A method for controlling a flash memory.
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記フラッシュメモリ内の消去状態の前記物理ブロックを検索するステップであって、前記フラッシュメモリ内の前記物理ブロックが消去状態であるか否かを所定の順番で判断していく空きブロック検索ステップと、
前記空きブロック検索ステップで検出された消去状態の前記物理ブロックに対して前記論理ブロックを割り当てる論理ブロック割り当てステップと、
前記空きブロック検索ステップにおける所定の順番の検索が所定回数巡回する毎に、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理ステップと、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備えるフラッシュメモリの制御方法。 A flash memory control method for controlling access to a flash memory that is erased in units of physical blocks based on an access instruction given from a host system,
A block management step for managing the correspondence between a logical block composed of a plurality of sectors in the logical address space on the host system side and the physical block;
A search for the physical block in the erased state in the flash memory, and a free block search step for determining in a predetermined order whether or not the physical block in the flash memory is in an erased state;
A logical block allocation step of allocating the logical block to the physical block in the erased state detected in the empty block search step;
A version number information management step for updating version number information to be written in the physical block to which the logical block is allocated each time the search in the predetermined order in the empty block search step circulates a predetermined number of times,
A version number information writing step for writing the version number information to the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
A method for controlling a flash memory.
ホストシステム側の論理アドレス空間における複数セクタの領域で構成された論理ブロックと前記物理ブロックとの対応関係を管理するブロック管理ステップと、
前記物理ブロックに対して前記論理ブロックが新たに割り当てられる毎にカウント値を更新するカウントステップと
前記カウント値が所定の値に達したときに、前記論理ブロックを割り当てた物理ブロックに書き込む版数情報を更新する版数情報管理ステップと、
前記論理ブロックが新たに割り当てられた前記物理ブロックに、前記版数情報を書き込む版数情報書き込みステップと、
前記物理ブロックに書き込まれている前記版数情報に基づいて、前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するか否かを判断する判断ステップと、
前記判断ステップによって肯定的な判断がなされたときに、前記肯定的な判断の対象の前記物理ブロックに記憶されているデータを別の前記物理ブロックに転送するデータ転送ステップと、
を備えるフラッシュメモリの制御方法。 A flash memory control method for controlling access to a flash memory that is erased in units of physical blocks based on an access instruction given from a host system,
A block management step for managing the correspondence between a logical block composed of a plurality of sectors in the logical address space on the host system side and the physical block;
A count step of updating a count value each time the logical block is newly assigned to the physical block, and version number information to be written to the physical block to which the logical block is assigned when the count value reaches a predetermined value Version number information management step to update,
A version number information writing step for writing the version number information to the physical block to which the logical block is newly assigned;
A determination step of determining whether or not to transfer data stored in the physical block to another physical block based on the version number information written in the physical block;
A data transfer step of transferring data stored in the physical block to be subjected to the positive determination to another physical block when a positive determination is made by the determination step;
A method for controlling a flash memory.
前記肯定的な判断の対象の前記物理ブロックは、現在の前記版数情報より所定順番以上前の前記版数情報が記憶されている物理ブロックである、
請求項7乃至10のうちのいずれか1項に記載のフラッシュメモリの制御方法。 The version number information is information indicating at least three types of version numbers prepared in advance that circulate in a predetermined order;
The physical block to be affirmatively determined is a physical block in which the version number information that is a predetermined order or more before the current version number information is stored.
The method for controlling a flash memory according to claim 7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007282480A JP4366420B2 (en) | 2007-10-30 | 2007-10-30 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
US12/239,127 US8239612B2 (en) | 2007-09-27 | 2008-09-26 | Memory controller, flash memory system with memory controller, and control method of flash memory |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007282480A JP4366420B2 (en) | 2007-10-30 | 2007-10-30 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2009110314A JP2009110314A (en) | 2009-05-21 |
JP4366420B2 true JP4366420B2 (en) | 2009-11-18 |
Family
ID=40785407
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007282480A Active JP4366420B2 (en) | 2007-09-27 | 2007-10-30 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4366420B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4821845B2 (en) * | 2008-12-22 | 2011-11-24 | Tdk株式会社 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
JP4821844B2 (en) * | 2008-12-22 | 2011-11-24 | Tdk株式会社 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
JP4952740B2 (en) * | 2009-04-13 | 2012-06-13 | Tdk株式会社 | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD |
KR102003930B1 (en) | 2012-07-31 | 2019-07-25 | 삼성전자주식회사 | method of controlling data writing in non volatile memory device and memory controller having wearleveling control function |
JP6167646B2 (en) * | 2013-04-30 | 2017-07-26 | 富士通株式会社 | Information processing apparatus, control circuit, control program, and control method |
-
2007
- 2007-10-30 JP JP2007282480A patent/JP4366420B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2009110314A (en) | 2009-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4844639B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
US8239612B2 (en) | Memory controller, flash memory system with memory controller, and control method of flash memory | |
JP4666080B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
US8214579B2 (en) | Memory controller, flash memory system with memory controller, and method of controlling flash memory | |
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 | |
JP2010287049A (en) | Memory system and memory system management method | |
JP4366420B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4952740B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4821845B2 (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 | |
JP2021068129A (en) | Memory controller and flash memory system | |
JP4153535B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
US8200890B2 (en) | Memory controller, flash memory system with memory controller, and method of controlling flash memory | |
JP4821844B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4434171B2 (en) | Memory controller and flash memory system | |
JP4241741B2 (en) | Memory controller and flash memory system | |
JP2006155335A (en) | Memory controller, flash memory system, and control method thereof | |
JP4952742B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4952741B2 (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 | |
JP5520880B2 (en) | Flash memory device | |
JP4569554B2 (en) | MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD | |
JP4213166B2 (en) | Memory controller and flash memory system | |
JP4227989B2 (en) | Memory controller and flash memory system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20090811 |
|
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: 20090818 |
|
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: 20090824 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120828 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4366420 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: 20130828 Year of fee payment: 4 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |