[go: up one dir, main page]

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 PDF

Info

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
Application number
JP2007282480A
Other languages
Japanese (ja)
Other versions
JP2009110314A (en
Inventor
直樹 向田
貴史 高橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TDK Corp
Original Assignee
TDK Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TDK Corp filed Critical TDK Corp
Priority to JP2007282480A priority Critical patent/JP4366420B2/en
Priority to US12/239,127 priority patent/US8239612B2/en
Publication of JP2009110314A publication Critical patent/JP2009110314A/en
Application granted granted Critical
Publication of JP4366420B2 publication Critical patent/JP4366420B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 Patent Document 1, in a memory system using a flash memory, wear leveling control is performed so that rewriting does not concentrate on a specific physical block. There are roughly two types of wear leveling control.

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, Patent Document 1 discloses passive wear depending on the frequency of rewriting data stored in the memory system (that is, depending on whether there are many or few physical blocks storing data that is not rewritten). It is described that the wear leveling control is performed in any one of the leveling control method, the active wear leveling control method, or the wear leveling control method combining these.

特開2007−133683号公報JP 2007-133683 A

しかしながら、メモリシステムに記憶されるデータの書き換え頻度に応じて、適切なウェアー・レベリング制御方式を選択することは、必ずしも容易でない。   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 Patent Document 1 described above, the user selects a wear leveling control method and sets conditions. At that time, the user needs to select an appropriate wear leveling control method and set the condition. These are burdens on the user. If the wear leveling control method is not selected properly, for example, it is unnecessary if the active wear leveling control method is selected when there are few physical blocks that store data that will not be rewritten. Data transfer is often performed.

そこで、本発明は、殆ど書き換えが行われないデータ(書き換え頻度が低いデータ)が記憶されている物理ブロックが存在するときだけ、その物理ブロックを含めたウェアー・レベリング制御が行われるメモリコントローラ、フラッシュメモリシステム、及びフラッシュメモリの制御方法を提供することを目的とする。   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 flash memory system 1 according to an embodiment of the present invention.

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

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

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

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

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

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

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

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

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

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

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

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

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

論理アドレス情報は、物理ブロックと論理ブロックの対応関係を判別するための情報である。従って、記憶データが消去された物理ブロックのような、対応する論理ブロックの無い物理ブロックについては、その物理ブロックの冗長領域に、論理アドレス情報は格納されていない。なお、以下の説明では、「物理ブロックの冗長領域」とは、物理ブロック内の一又は複数の物理ページが備える冗長領域(例えば、先頭物理ページの冗長領域)で構成された記憶領域を指す。   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 host system 4 writes a command code indicating a write command in the command register R1, writes the number of sectors of data to be written in the sector number register R2, and stores in the LBA register R3 The LBA corresponding to the top data to start writing is written. Based on the information written in the sector number register R2 and the LBA register R3, a logical access area that is an access target area is determined and given to the physical block corresponding to the logical block including the logical access area from the host system 4. Data is written.

セクタ数レジスタ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 host system 4 side is managed by an LBA (Logical Block Address) which is a serial number assigned to an area (hereinafter referred to as a logical sector area) divided in units of sectors (512 bytes). Also, a logical block composed of a plurality of logical sector areas is formed, and one or a plurality of physical blocks are assigned to the logical block.

この論理ブロックと物理ブロックの対応関係は、ゾーン単位で管理されることが多い。具体的には、複数個の論理ブロックで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 flash memory 2 and read from the flash memory 2. You can also. As a result, the address conversion table can be obtained in a shorter time than reading the logical address information from the redundant area of each physical block and creating the address conversion table. In particular, the address translation table is stored in the flash memory 2 when the logical blocks included in each logical zone can be associated with any physical block without configuring the physical zone as described above. It is better to keep it.

また、アドレス変換テーブルをフラッシュメモリ2に保存する場合は、突然の電源遮断に対応するため、常に最新のアドレス変換テーブルがフラッシュメモリ2に保存されているようにすることが好ましい。つまり、論理ブロックと物理ブロックとの対応関係が変化する毎に(つまりワークエリア8上でアドレス変換テーブルが更新される都度に)、最新のアドレス変換テーブルをフラッシュメモリ2に保存するようにすることが好ましい。このアドレス変換テーブルをフラッシュメモリ2に保存するためにかかる時間を考慮すれば、論理ゾーン単位でアドレス変換テーブルを保存(管理)し、各論理ゾーンに含まれる論理ブロックの数を少なくする方が好ましい。   When the address conversion table is stored in the flash memory 2, it is preferable that the latest address conversion table is always stored in the flash memory 2 in order to cope with a sudden power interruption. That is, each time the correspondence between the logical block and the physical block changes (that is, every time the address conversion table is updated on the work area 8), the latest address conversion table is stored in the flash memory 2. Is preferred. Considering the time taken to store the address conversion table in the flash memory 2, it is preferable to store (manage) the address conversion table in units of logical zones and reduce the number of logical blocks included in each logical zone. .

そこで、本実施形態では、図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 logical zone # 1. Each address conversion table (103-0 and 103-1) includes the LBN of the logical block and the physical block address of the physical block to which the logical block is assigned (for each logical block constituting the corresponding logical zone). PBA) is recorded. For this reason, the size of each address conversion table (address conversion table for each logical zone) is smaller than when all logical blocks are managed by one address conversion table. The address conversion table for each logical zone is stored in different physical blocks. In other words, two or more address translation tables corresponding to two or more logical zones are not simultaneously stored in the same physical lock. For example, the address conversion table 103-0 corresponding to the logical zone of LZN # 0 is stored in the physical block of PBA # 5, and the address conversion table 103-1 corresponding to the logical zone of LZN # 1 is stored in PBA # 1076. Stored in physical block. Hereinafter, the physical block where the address translation table is stored is referred to as a “table storage block”. Each time the address conversion table is updated on the work area 8, as shown in FIG. 3, an area in the physical block that is the table storage block (one or more free physical pages or free areas in the physical page) is stored. Saved. For example, if the address conversion table for each logical zone is set to a size that can be stored in one physical page, and the address conversion table is stored in order from the first physical page every time the address conversion table is updated, The table storage block can store 64 address conversion tables. When 64 address conversion tables are stored in this table storage block and there is no free area in which the address conversion table can be stored, another physical block is allocated as a table storage block. As shown in FIG. 3, the address conversion table 103-1 is stored up to the last physical page # 63 of the physical block of PBA # 1076 which is the table storage block of the address conversion table corresponding to the logical zone of LZN # 1. If there is, there is no empty area for storing the address translation table in the physical block of PBA # 1076. Therefore, if the address translation table 103-1 is updated thereafter, another physical block (empty physical block) is assigned as the table storage block of the address translation table 103-1, and the other physical block is assigned to the other physical block. The updated address conversion table 103-1 is stored. Hereinafter, such a process in which another physical block is allocated as a table storage block is referred to as “a table storage block change”.

また、本実施形態では、メモリコントローラ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 memory controller 3 manages information (hereinafter referred to as “table management information”) indicating in which physical block the address translation table corresponding to which logical zone is stored. In the example shown in FIG. 3, the table management information 101 includes information that can determine the correspondence between the LZN of each logical zone and the PBA of the table storage block of the address conversion table corresponding to the logical zone of the LZN. Yes. By referring to this table management information 101, for example, the table storage block of the address translation table 103-0 corresponding to the logical zone of LZN # 0 is a physical block of PBA # 5, or the logical block of LZN # 1 It can be seen that the table storage block of the address conversion table 103-1 corresponding to the zone is a physical block of PBA # 1076. The table management information 101 is stored in any one of two or more preset physical blocks for table management information (hereinafter referred to as “management information block candidates”). In this example, PBA # 0 and PBA # 1 physical blocks (that is, two physical blocks) are set as management information block candidates. Therefore, the table management information is stored in either the physical block of PBA # 0 or PBA # 1. Hereinafter, the physical block of the storage destination of the table management information selected from the management information block candidates (physical blocks of PBA # 0 and PBA # 1) is referred to as “management information block”. The table management information 101 is updated on the work area 8 when the table storage block of the address conversion table corresponding to any logical zone is changed. Each time the table management information 101 is updated on the work area 8, a free area (one or more free physical pages or physical pages in a physical block which is a management information block (for example, a physical block of PBA # 0)) is stored. Saved in free space). If there is no free area that can store the table management information in the physical block, another physical block (for example, a physical block of PBA # 1) of the two management information block candidates is used as the management information block. Assigned. That is, two predetermined physical blocks are alternately used as management information blocks. Hereinafter, this process is referred to as “management information block switching”.

図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 LBA # 0 to # 20479999 are allocated to a storage area on the flash memory 2 side composed of 8192 physical blocks.

図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 LBN # 0, and the 256 logical sector areas of LBA # 256- # 511 belong to the logical block of LBN # 1. Yes. As described above, the 2048,000 logical sector areas of LBA # 0 to # 20479999 belong to one of 8000 logical blocks of LBN # 0 to # 7999.

更に、この論理ブロックを複数個まとめたものを論理ゾーンとし、この論理ゾーンに前述した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 zones LZN # 0 to # 7 so that logical blocks having consecutive LBNs belong to different logical zones. For example, the logical block of LBN # 0 is in the logical zone of LZN # 0, the logical block of LBN # 1 is in the logical zone of LZN # 1, the logical block of LBN # 2 is in the logical zone of LZN # 2, and so on. Sort to logical zone # 7. Similarly, the LBN # 8 logical block is assigned to the LZN # 0 logical zone, the LBN # 9 logical block is assigned to the LZN # 1 logical zone, and the LBN # 10 logical block is assigned to the LZN # 2 logical zone. To go. By allocating in this way, it is possible to reduce the probability that logical blocks corresponding to logical access areas with a high rewrite frequency are concentrated in a specific logical zone. Therefore, it is possible to suppress the change frequency of the table storage block corresponding to a specific logical zone from becoming significantly higher than the change frequency of the table storage block corresponding to another logical zone.

フラッシュメモリ2は、8192個の物理ブロックで構成されている。8192個の物理ブロックには、固有の物理ブロックアドレス(PBA)が付されている。フラッシュメモリ2には、出荷時から不良である先天性の不良物理ブロックが存在することがある。更に、フラッシュメモリ2には、出荷時に良品の物理ブロックであっても、使用開始後に劣化して不良ブロックになる物理ブロック(後天性の不良ブロック)が存在することもある。   The flash memory 2 is composed of 8192 physical blocks. A unique physical block address (PBA) is assigned to 8192 physical blocks. The flash memory 2 may have a congenital defective physical block that is defective from the time of shipment. Further, the flash memory 2 may include a physical block (acquired defective block) that deteriorates after the start of use even if it is a good physical block at the time of shipment.

さて、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 flash memory 2. The physical block is searched. Then, a write destination logical block is allocated to the detected free physical block.

以上のように、物理ブロックに記憶されているデータの書き換えが行われる場合には、その物理ブロックとは別の物理ブロック(空きの物理ブロック)に、その物理ブロックと対応する論理ブロックが新たに割り当てられることになる。また、書込み先論理ブロックに対応する物理ブロックがない場合にも、空きの物理ブロックに論理ブロックが新たに割り当てられることになる。   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 memory controller 3 changes the rewrite mark to the first rewrite mark “55”, the second rewrite mark “5A”, the third rewrite mark, The rewrite mark “A5” and the fourth rewrite mark “AA” are updated in this order, and the next rewrite mark “AA” is updated to the first rewrite mark.

以下、図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 LBN # 41 is newly assigned to a physical block of PBA # 12 detected as an empty physical block, as shown in (4A), Since the time is within the first period, the LBN “# 41” of the newly allocated logical block and the first rewrite mark “55h” are stored in the redundant area 105 of the physical block of the PBA # 12. Written.

次に、(4B)に示すように、空きの物理ブロックとして検出されたPBA#18の物理ブロックに、LBN#42の論理ブロックが新たに割り当てられたとき、そのときも第1の期間内であるため、そのPBA#18の物理ブロックの冗長領域105には、新たに割り当てられた論理ブロックのLBN“#42”と、第1の書替マーク“55h”が書き込まれる。   Next, as shown in (4B), when a logical block of LBN # 42 is newly allocated to a physical block of PBA # 18 detected as an empty physical block, at that time also within the first period Therefore, the LBN “# 42” of the newly allocated logical block and the first rewrite mark “55h” are written in the redundant area 105 of the physical block of PBA # 18.

その後、(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 redundant area 105, the LBN of the newly allocated logical block and the first rewrite mark “55h” are written.

ここで、(4D)のとき、すなわち、新たにLBA#44の論理ブロックがPBA#27物理ブロックに割り当てられたとき、その割り当てに関連した処理の結果が所定の条件に合致したとする。この場合、書替マークが、第1の書替マーク“55”から第2の書替マーク“5A”に更新される。この時点で、第1の期間が終了し、第2の期間が開始する。   Here, in the case of (4D), that is, when a logical block of LBA # 44 is newly allocated to the PBA # 27 physical block, it is assumed that the result of processing related to the allocation matches a predetermined condition. In this case, the rewrite mark is updated from the first rewrite mark “55” to the second rewrite mark “5A”. At this point, the first period ends and the second period starts.

従って、その後、例えば(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 LBN # 45 is newly allocated to a physical block of PBA # 31 detected as an empty physical block, at that time, in the second period Therefore, the LBN “# 45” of the newly allocated logical block and the second rewrite mark “5Ah” are written in the redundant area 105 of the physical block of PBA # 31.

以上のように、どの期間内で、新たに論理ブロックが物理ブロックに割り当てられたかによって、物理ブロックの冗長領域に書き込まれる書替マークが異なる。   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 host system 4. At that time, empty blocks are sequentially searched from the first physical block toward the last physical block for all the physical blocks. In this way, for the physical blocks included in the range to be searched, the search for empty blocks in the order from the first physical block to the last physical block is repeatedly performed, so that data that is hardly rewritten (rewrite frequency is If there is no physical block in which (low data) is stored, the number of rewrites of the physical block included in the search target range is expected to be substantially equal.

さて、メモリコントローラ3は、所定のタイミングで(例えば、書替マークを更新したときに)、少なくとも1期間より長く書き替え(記憶されているデータを一旦消去した後の書込み)が行われていない物理ブロック、言い換えれば、現在割り当てられている論理ブロックの割り当てが行われてから少なくとも1期間よりも長い期間の経過した物理ブロックが検索される。   Now, the memory controller 3 has not been rewritten at a predetermined timing (for example, when the rewrite mark is updated) for at least one period (writing after the stored data is once erased). A physical block, in other words, a physical block that has passed a period longer than at least one period from the allocation of the currently allocated logical block is searched.

例えば、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 blocks PBA # 6, # 15, and # 16 are detected as physical blocks that have not been rewritten for longer than one period.

本実施形態では、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 memory controller 3 performs a free block search to detect another physical block (empty block), and a physical block that is considered to store data with a low rewrite frequency. Is transferred (copied) to another physical block. Furthermore, the memory controller 3 writes the current rewrite mark in the other physical block. Specifically, for example, as shown in (5A), (5B), and (5C) of FIG. 5, the data stored in the detected physical blocks of PBA # 6, # 15, and # 16 is empty. Transferred (copied) to the physical blocks PBA # 32, # 33 and # 34 detected by the block search. In addition, LBN # 6, # 15, and # 16 are written as logical address information in the redundant area 105, and the second rewrite mark “5Ah” that is the current rewrite mark is written as PBA # 32 as the rewrite mark. , # 33 and # 34 are written.

この転送処理が終了した後に、転送元の物理ブロックに記憶されているデータ消去される。具体的には、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 PBA # 6, # 15, and # 16 is sequentially given from the memory controller 3 to the flash memory 2, and the internal command In response, the flash memory 2 erases the data stored in the physical blocks of PBA # 6, # 15 and # 16.

尚、書き換え頻度の低いデータが記憶されている物理ブロックとみなす基準、つまり、何期間より長く書き換えが行われていない物理ブロックを書き換え頻度の低いデータが記憶されている物理ブロックとみなすかは、書替マークが一巡するまでの期間の数(及び/又は、一期間の長さ)などを考慮して、適宜設定することができる。   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 memory controller 3 searches for a physical block that has not been rewritten for longer than one period, and transfers (copies) data stored in the detected physical block to another physical block. It is necessary to complete the processing by the next time the rewrite mark is updated. In order to ensure this management, the memory controller 3 stores the data stored in the physical block in which data with low rewrite frequency is stored until there is no physical block that has not been rewritten for longer than one period. The transfer process may be prioritized so that commands from the host system 4 are not accepted.

また、現在の書替マークは、例えば、メモリコントローラ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 memory controller 3, for example, a work area 8 (a volatile memory such as SRAM). The rewrite mark stored in the work area 8 is copied (written) to the flash memory 2 at an appropriate time. When the power is turned off, the rewrite mark stored in the work area 8 is erased, but when the power is turned on, the rewrite mark stored in the flash memory 2 is read into the work area 8. Thereafter, the rewrite mark is used as the current rewrite mark. The memory controller 3 may be provided with a storage area composed of a nonvolatile RAM such as a FeRAM (Ferroelectric Random Access Memory) or MRAM (Magnetic Random Access Memory), and a rewrite mark may be held in this storage area. When the rewrite mark is held in such a nonvolatile RAM, the rewrite mark can be managed on the nonvolatile RAM, and it is not necessary to copy the rewrite mark to the flash memory 2.

また、書き換え頻度の低いデータが記憶されている物理ブロックとみなされた物理ブロックは、その物理ブロックに記憶されているデータが別の物理ブロックに転送(複写)された後に記憶データが消去され、空きの物理ブロックとされる。空きとされた物理ブロックは、それまでの書き換え回数が少ない可能性があるが、空きブロックになったことにより、この後の書き換え回数が多くなる可能性が高くなる。逆に、データの複写先となった物理ブロックは、それまでの書き換え回数が多い可能性があるが、書き換え頻度の低いデータが複写されたことにより、この後の書き換え回数が少なくなる可能性が高くなる。このような原理により、フラッシュメモリ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 flash memory 2 is equalized.

以下、本実施の形態で行われる処理の流れの概要を、図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 memory controller 3 sets the current rewrite mark.

初期設定の後、ホストシステム4から書込みコマンドを受信した場合、メモリコントローラ3は、その書込みコマンドで指定された論理アクセス領域が属する論理ブロックに対応させる物理ブロックを新たに設定する必要があるかどうかを判断する(ステップ102)。その必要がある場合は(ステップ102でYES)、空きブロックの検索が行われ、検出された空きブロックに、書込みコマンドで指定された論理アクセス領域が属する論理ブロックが割り当てられる(ステップ103)。具体的には、検出された空きブロック(物理ブロック)の冗長領域105に、書込みコマンドで指定された論理アクセス領域が属する論理ブロックのLBNと、現在の書替マークとが書き込まれる。論理ブロックが新たに物理ブロックに割り当てられることに関連した処理も、このステップ103において実行される。その処理の結果が、所定の条件に合致していれば、書替マークが更新され、所定の条件に合致していなければ、書替マークの変更は行われない。   When a write command is received from the host system 4 after the initial setting, the memory controller 3 needs to newly set a physical block corresponding to the logical block to which the logical access area specified by the write command belongs. Is determined (step 102). If it is necessary (YES in step 102), a free block search is performed, and a logical block to which the logical access area designated by the write command belongs is allocated to the detected free block (step 103). Specifically, the LBN of the logical block to which the logical access area designated by the write command and the current rewrite mark are written in the redundant area 105 of the detected empty block (physical block). The processing related to newly assigning a logical block to a physical block is also executed in this step 103. If the result of the process matches a predetermined condition, the rewrite mark is updated, and if the result does not match the predetermined condition, the rewrite mark is not changed.

メモリコントローラ3は、ステップ103において書替マークを更新したか否かを判断し(ステップ104)、更新した場合(ステップ104でYES)、書き換え頻度の低いデータが記憶されている物理ブロックの検索処理を行う。書き換え頻度の低いデータが記憶されている物理ブロックが検出された場合には、メモリコントローラ3は、検出された物理ブロックに記憶されているデータを別の物理ブロックに複写するデータ転送処理を行う(ステップ105)。具体的には、1期間より長く書き換えが行われていない物理ブロックが検索され、そのような物理ブロックが検出された場合には、検出された物理ブロックの記憶されているデータが別の物理ブロックに転送される。この転送が終了した後、検出された物理ブロックに記憶されているデータが消去される。   The memory controller 3 determines whether or not the rewrite mark has been updated in step 103 (step 104), and if it has been updated (YES in step 104), search processing of the physical block in which data with low rewrite frequency is stored I do. When a physical block storing data with low rewrite frequency is detected, the memory controller 3 performs a data transfer process for copying the data stored in the detected physical block to another physical block ( Step 105). Specifically, a physical block that has not been rewritten for a period longer than one period is searched, and when such a physical block is detected, the data stored in the detected physical block is another physical block. Forwarded to After this transfer is completed, the data stored in the detected physical block is erased.

以上の説明によれば、論理ブロックが新たに物理ブロックに割り当てられたときに、その物理ブロックに、書替マークが書き込まれる。書替マークは、論理ブロックが新たに物理ブロックに割り当てられたことに関連した処理の結果が所定の条件に合致したときに更新される版数情報である。更新後の書替マークよりも順番が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 flash memory 2 as shown in FIG. 7A. Existing physical blocks (hereinafter referred to as “data storage blocks”) and table storage blocks (physical blocks of PBA # 5 and PBA # 14) in which the address translation table is stored are mixed. If the rewrite mark and the change count value are set so as not to overlap, the physical block is a data storage block depending on whether the rewrite mark is written or the change count value is written. Or a table storage block. For the data storage block, information indicating that the data storage block is stored (information indicating which logical zone's address conversion table is stored) may be written instead of the logical address information.

この第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 memory controller 3 executes the process shown in FIG. 7B in S103 of FIG. In other words, when the address change table is updated by newly assigning a logical block to a physical block, the memory controller 3 can store the updated address conversion table in the physical block that is a table storage block. It is determined whether or not a physical page remains (S111).

残っていないとの判断結果であれば(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 memory controller 3 executes S112. That is, the memory controller 3 searches for another physical block (empty block) by searching for a free block, and uses the detected other physical block as a new table storage block (that is, changes the table storage block). Further, the memory controller 3 reads the change count value stored in the physical block that was the table storage block before the change from the physical block, and counts up (or counts down) the change count value. Then, the memory controller 3 writes the changed count value after the count-up (or after the count-down) and the updated address conversion table in the other physical block (empty block) that is the table storage block after the change. Further, the memory controller 3 updates the PBA corresponding to the LZN of the logical zone corresponding to the address conversion table in the table management information 101 (see FIG. 3) to the PBA of the changed table storage block.

その後、メモリコントローラ3は、カウントアップ(又はカウントダウン)後の変更カウント値が所定の値であるか否かを判断する(S113)。変更カウント値が所定の値であれば(S113:YES)、メモリコントローラ3は、書替マークを更新する(S114)。   Thereafter, the memory controller 3 determines whether or not the changed count value after counting up (or counting down) is a predetermined value (S113). If the change count value is a predetermined value (S113: YES), the memory controller 3 updates the rewrite mark (S114).

以上が、第1の例についての説明である。尚、現在の書替マークは、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。   The above is the description of the first example. The current rewrite mark is preferably stored in the flash memory 2 or the nonvolatile RAM.

<第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 blocks PBA # 0 and PBA # 1 are management information block candidates. Therefore, the physical block of PBA # 0 or PBA # 1 is used as the management information block. The current rewrite mark may be written in this management information block.

尚、この例では、PBA#0又はPBA#1の物理ブロックが、テーブル保存ブロック又はデータ保存ブロックに割り当てられることはない。また、テーブル保存ブロックに変更カウント値を書き込む必要はない。   In this example, the physical block of PBA # 0 or PBA # 1 is not assigned to the table storage block or the data storage block. Further, it is not necessary to write the change count value in the table storage block.

この第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 memory controller 3 executes the process shown in FIG. 8B in S103 of FIG. That is, when the memory controller 3 updates the table management information in accordance with the change of the table storage block, a free physical page that can store the updated table management information remains in the physical block that is the management information block. It is determined whether or not (S121).

残っていないとの判断結果であれば(S121:YES)、メモリコントローラ3は、S122を実行する。すなわち、メモリコントローラ3は、前述した2個の管理情報ブロック候補のうちの他方の物理ブロックを新たな管理情報ブロックとする(つまり管理情報ブロックを切替る)。また、メモリコントローラ3は、切替前の管理情報ブロックであった物理ブロックに記憶されている切替カウント値をその物理ブロックから読出し、その切替カウント値をカウントアップ(又はカウントダウン)する。そして、メモリコントローラ3は、切替後の管理情報ブロックである上記他方の物理ブロックに、カウントアップ後(又はカウントダウン後)の切替カウント値と、更新後のテーブル管理情報とを書き込む。   If it is a determination result that it does not remain (S121: YES), the memory controller 3 executes S122. That is, the memory controller 3 sets the other physical block of the two management information block candidates described above as a new management information block (that is, switches the management information block). Further, the memory controller 3 reads the switching count value stored in the physical block that was the management information block before switching from the physical block, and counts up (or counts down) the switching count value. Then, the memory controller 3 writes the switching count value after counting up (or after counting down) and the updated table management information in the other physical block that is the management information block after switching.

その後、メモリコントローラ3は、カウントアップ(又はカウントダウン)後の切替カウント値が所定の値であるか否かを判断する(S123)。切替カウント値が所定の値であれば(S123:YES)、メモリコントローラ3は、書替マークを更新する(S124)。   Thereafter, the memory controller 3 determines whether or not the switching count value after counting up (or counting down) is a predetermined value (S123). If the switching count value is a predetermined value (S123: YES), the memory controller 3 updates the rewrite mark (S124).

以上が、第2の例についての説明である。尚、現在の書替マークは、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。   The above is the description of the second example. The current rewrite mark is preferably stored in the flash memory 2 or the nonvolatile RAM.

<第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 memory controller 3 executes the process shown in FIG. 9A in S103 of FIG. That is, the memory controller 3 updates the rewrite mark (S132) when the search for the empty block is completed (S131: YES).

尚、現在の書替マークは、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。又、空きブロックの検索における検索開始ブロック(次回の検索を開始する物理ブロック)も、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。また、この第3の例では、空きブロックの検索が一巡したことを、所定の条件としているが、一巡に限らず、二回以上の所定回数巡回したことが、所定の条件であっても良い。この場合、ワークメモリ(SRAM)8上で、空きブロックの検索の巡回回数を表すカウント値が、空きブロックの検索が一巡する毎に、更新される。この巡回回数も、フラッシュメモリ2又は不揮発性RAMに保存しておくことが好ましい。   The current rewrite mark is preferably stored in the flash memory 2 or the nonvolatile RAM. Further, it is preferable that the search start block (physical block for starting the next search) in the search for the empty block is also stored in the flash memory 2 or the nonvolatile RAM. In the third example, the predetermined condition is that the search for the empty block has been completed. However, the predetermined condition is that the circulation is not limited to a single cycle, and the predetermined number of cycles may be two or more. . In this case, on the work memory (SRAM) 8, the count value indicating the number of cycles for searching for an empty block is updated every time an empty block search is completed. It is preferable that the number of circulations is also stored in the flash memory 2 or the nonvolatile RAM.

<第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 memory controller 3 executes the process shown in FIG. 9B in S103 of FIG. That is, when a logical block is newly allocated to a physical block, the memory controller 3 counts up (or counts down) the allocation count value, for example, on the work memory (SRAM) 8 (S141). Then, the memory controller 3 determines whether or not the assigned count value after counting up (or counting down) has reached a predetermined value (S142). If the allocation count value is a predetermined value (S142: YES), the memory controller 3 updates the rewrite mark (S143).

以上が、第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 flash memory 2 or the nonvolatile RAM. Further, the allocation count value may be written in a physical block to which a new logical block is allocated.

以上、上述した本発明の実施形態は、本発明の説明のための例示であり、本発明の範囲をそれらの実施形態にのみ限定する趣旨ではない。当業者は、本発明の要旨を逸脱することなしに、他の様々な態様で本発明を実施することができる。例えば、メモリコントローラ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 memory controller 3 may select one of the first to fourth examples and update the rewrite mark based on the selected example. Specifically, for example, the memory controller 3 has a first mode in which the rewrite mark is updated under conditions based on the first example, and a second mode in which the rewrite mark is updated under conditions based on the second example. And a third mode in which the rewrite mark is updated under the condition based on the third example, and a fourth mode in which the rewrite mark is updated under the condition based on the fourth example. May be selected from the first to fourth modes in accordance with an instruction from or a result of an event that has occurred, and the rewrite mark may be updated in accordance with the selected mode.

本発明の一実施形態に係るフラッシュメモリシステムの概略構成を示すブロック図である。1 is a block diagram showing a schematic configuration of a flash memory system according to an embodiment of the present invention. 論理ブロックと物理ブロックの対応関係を示す図である。It is a figure which shows the correspondence of a logical block and a physical block. テーブル管理情報及びアドレス変換テーブルとそれらの保存の仕方とを示す。Table management information and address conversion tables and how to store them are shown. 図4Aは、書替マークの変更規則を示す。図4Bは、物理ブロックに対して新たに論理ブロックが割り当てられた場合に行われる処理の説明図である。FIG. 4A shows a rewrite mark change rule. FIG. 4B is an explanatory diagram of processing performed when a logical block is newly assigned to a physical block. 書き換え頻度の低いデータが記憶されている物理ブロックが検出された場合に行われるデータ転送処理の説明図である。It is explanatory drawing of the data transfer process performed when the physical block in which the data with low rewriting frequency are memorize | stored is detected. 本発明の一実施形態で行われる処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the process performed by one Embodiment of this invention. 図7Aは、書替マークが記憶されている物理ブロックと変更カウント値が記憶されている物理ブロックとが混在するフラッシュメモリを示す。図7Bは、書替マークが更新される第1の例に関する処理の流れを示す。FIG. 7A shows a flash memory in which a physical block storing a rewrite mark and a physical block storing a change count value are mixed. FIG. 7B shows a process flow regarding the first example in which the rewrite mark is updated. 図8Aは、書替マークが記憶されている物理ブロックと切替カウント値が記憶されている物理ブロックとが混在するフラッシュメモリを示す。図8Bは、書替マークが更新される第2の例に関する処理の流れを示す。FIG. 8A shows a flash memory in which a physical block storing a rewrite mark and a physical block storing a switching count value are mixed. FIG. 8B shows the flow of processing relating to the second example in which the rewrite mark is updated. 図9Aは、書替マークが更新される第3の例に関する処理の流れを示す。図9Bは、書替マークが更新される第4の例に関する処理の流れを示す。FIG. 9A shows the flow of processing relating to the third example in which the rewrite mark is updated. FIG. 9B shows the flow of processing relating to the fourth example in which the rewrite mark is updated.

符号の説明Explanation of symbols

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

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.
前記版数情報は、所定の順序で循環する予め用意された少なくとも3種類の版数を示す情報であり、
前記肯定的な判断の対象の前記物理ブロックは、現在の前記版数情報より所定順番以上前の前記版数情報が記憶されている物理ブロックである、
請求項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.
請求項1乃至5のうちのいずれか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.
前記版数情報は、所定の順序で循環する予め用意された少なくとも3種類の版数を示す情報であり、
前記肯定的な判断の対象の前記物理ブロックは、現在の前記版数情報より所定順番以上前の前記版数情報が記憶されている物理ブロックである、
請求項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.
JP2007282480A 2007-09-27 2007-10-30 MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Active JP4366420B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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