JP2009301491A - Memory controller, flash memory system equipped with memory controller, and control method for flash memory - Google Patents

Memory controller, flash memory system equipped with memory controller, and control method for flash memory Download PDF

Info

Publication number
JP2009301491A
JP2009301491A JP2008158120A JP2008158120A JP2009301491A JP 2009301491 A JP2009301491 A JP 2009301491A JP 2008158120 A JP2008158120 A JP 2008158120A JP 2008158120 A JP2008158120 A JP 2008158120A JP 2009301491 A JP2009301491 A JP 2009301491A
Authority
JP
Japan
Prior art keywords
logical
block
data
logical block
physical
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.)
Pending
Application number
JP2008158120A
Other languages
Japanese (ja)
Inventor
Norikazu Okako
典和 岡固
Katsuo Sarashina
克雄 晒科
Shun Furukawa
俊 古川
Takeshi Kamono
武志 鴨野
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 JP2008158120A priority Critical patent/JP2009301491A/en
Publication of JP2009301491A publication Critical patent/JP2009301491A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a management technique for a storage area capable of enhancing an efficiency of data rewriting, while restraining a burden concerned in management of a correspondence between a logical page and a physical page. <P>SOLUTION: Each logical block is applied with the management of the storage area fixed in the correspondence between the logical page and the physical page, and the management of the storage area not fixed in the correspondence between the logical page and the physical page. The management of the storage area in the logical area is changed to the management of the storage area not fixed in the correspondence between the logical page and the physical page, when data writing assigned with an area of capacity smaller than a prescribed sector number is indicated by a prescribed frequency or more, in the logical block applied with the management of the storage area not fixed in the correspondence between the logical page and the physical page. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、メモリコントローラ、メモリコントローラを備えるフラッシュメモリシステム、並びにフラッシュメモリの制御方法に関する。   The present invention relates to a memory controller, a flash memory system including the memory controller, and a flash memory control method.

コンピュータ等の情報処理装置(ホストシステム)では、各種のファイルデータを保存するためにフラッシュメモリを記憶媒体として用いたCF(Compact Flash)カード、SSD(Solid State Drive)等の情報記憶装置(フラッシュメモリシステム)が使われることが多くなっている。このようなフラッシュメモリシステムでは、ホストシステムから与えられるアクセス指示に基づいて、フラッシュメモリに対するアクセスが行われる。また、ホストシステムから与えられるアクセス指示では、セクタ(512バイト)単位の領域に付けられたアドレスでアクセス対象の領域が指示される。   In an information processing device (host system) such as a computer, an information storage device (flash memory) such as a CF (Compact Flash) card or SSD (Solid State Drive) using a flash memory as a storage medium for storing various file data System) is increasingly used. In such a flash memory system, access to the flash memory is performed based on an access instruction given from the host system. Further, in the access instruction given from the host system, the access target area is instructed by the address given to the area of sector (512 bytes) unit.

このようなフラッシュメモリシステムの記憶媒体として一般的に使用されているNAND型フラッシュメモリでは、ページ(物理ページ)単位でデータの書き込みが行われ、複数の物理ページを含む物理ブロック単位で記憶データの消去が行われる。   In a NAND flash memory generally used as a storage medium of such a flash memory system, data is written in units of pages (physical pages), and stored data is stored in units of physical blocks including a plurality of physical pages. Erasing is performed.

NAND型フラッシュメモリを用いたフラッシュメモリシステムでは、ホストシステム側で管理されているアドレスが付けられたセクタ単位の領域を1個又は複数個集めた論理ページを物理ページに割り当てている。この論理ページと物理ページの対応関係の管理が煩雑になることを回避するため、複数個の論理ページを集めた論理ブロックを形成し、ブロック単位で論理ブロックと物理ブロックの対応関係を管理している。尚、論理ブロックに含まれる論理ページと、その論理ブロックと対応する物理ブロックに含まれる物理ページの対応関係については、固定されている場合と固定されていない場合がある。   In a flash memory system using a NAND flash memory, a logical page obtained by collecting one or a plurality of sector-by-sector areas with addresses managed on the host system side is assigned to a physical page. To avoid complicated management of the correspondence between logical pages and physical pages, a logical block is formed by collecting a plurality of logical pages, and the correspondence between logical blocks and physical blocks is managed in units of blocks. Yes. Note that the correspondence between a logical page included in a logical block and a physical page included in a physical block corresponding to the logical block may or may not be fixed.

論理ブロックに含まれる論理ページと、その論理ブロックに対応する物理ブロックに含まれる物理ページとの対応関係が固定された記憶領域の管理方式(以下、「ページ対応関係固定方式」と言う)は、例えば、特許文献1に記載されている。このページ対応関係固定方式では、ホストシステムからのアクセス指示に従ってデータを書き込むときに、そのアクセス指示により指定された書き込み先の論理ページを含んだ論理ブロックに対応する物理ブロック内に、データが書き込まれていない物理ページがあっても、上記書き込み先の論理ページに対応する物理ページにデータが書き込まれていれば、上記書き込み先の論理ページを含んだ論理ブロックに別の物理ブロックが新たに割り当てられ、その物理ブロックにデータが書き込まれる。従って、ページ対応関係固定方式では、ホストシステムから与えられる新たなデータをフラッシュメモリに書き込むときに、フラッシュメモリに記憶されているデータが別の物理ブロックに転送される頻度が高くなる。   A storage area management method in which the correspondence between a logical page included in a logical block and a physical page included in a physical block corresponding to the logical block is fixed (hereinafter referred to as “page correspondence relationship fixing method”) is For example, it is described in Patent Document 1. In this page correspondence fixed method, when data is written according to the access instruction from the host system, the data is written into the physical block corresponding to the logical block including the logical page of the write destination specified by the access instruction. Even if there is a physical page that has not been written, if data has been written to the physical page corresponding to the logical page of the write destination, another physical block is newly allocated to the logical block including the logical page of the write destination. Data is written to the physical block. Therefore, in the page correspondence fixed method, when new data given from the host system is written to the flash memory, the frequency at which the data stored in the flash memory is transferred to another physical block increases.

論理ブロックに含まれる論理ページと、その論理ブロックに対応する物理ブロックに含まれる物理ページとの対応関係が固定されていない記憶領域の管理方式(以下、「ページ対応関係可変方式」と言う)は、例えば、特許文献2に記載されている。このページ対応関係可変方式では、ホストシステムから与えられる各論理ページに対応するデータが、物理ブロック内のデータが書き込まれていない先頭の物理ページから順番に書き込まれていく。従って、ページ対応関係可変方式では、上記のようなデータ転送の頻度は低くなるが、論理ページと物理ページの対応関係を管理する必要が生じる。   The storage area management method in which the correspondence between the logical page included in the logical block and the physical page included in the physical block corresponding to the logical block is not fixed (hereinafter referred to as “page correspondence variable variable method”) For example, it is described in Patent Document 2. In this page correspondence variable method, data corresponding to each logical page given from the host system is written in order from the first physical page in which data in the physical block is not written. Therefore, in the page correspondence variable method, the frequency of data transfer as described above is low, but it is necessary to manage the correspondence between logical pages and physical pages.

フラッシュメモリシステムに保存されるファイルデータは、通常、FAT(File Allocation Table)ファイルシステム・NTファイルシステム等のファイルシステムで管理されている。従って、フラッシュメモリシステムには、ファイルデータだけでなく、ファイルデータを管理するための情報も保存される。例えば、FATファイルシステムの場合には、ルートディレクトリを含む情報や、ファイルが使用するクラスタの番号の情報が保存される。NTファイルシステムの場合にも、ファイル名やインデックスを含む情報が保存される。   File data stored in the flash memory system is normally managed by a file system such as a FAT (File Allocation Table) file system or NT file system. Therefore, not only file data but also information for managing file data is stored in the flash memory system. For example, in the case of the FAT file system, information including the root directory and information on the cluster number used by the file are stored. Also in the case of the NT file system, information including a file name and an index is stored.

また、FATファイルシステム・NTファイルシステム等で管理されるファイルデータは、所定のクラスタサイズのデータに分割され、分割されたデータがフラッシュメモリに保存される。このクラスタサイズは、フラッシュメモリシステムの記憶容量が大きくなるにつれて512バイト・1kバイト・2kバイト・4kバイトというように段階的に大きくなっていく。そして、ホストシステムから与えられる書き込み指示に基づいて書き込まれるデータがファイルデータの場合、このクラスタ単位でデータの書き込みが指示される。つまり、書き込まれるデータがファイルデータの場合は、このクラスタサイズよりも小さい単位で、データの書き込みが指示されることがない。一方、書き込まれるデータがファイルデータを管理するための情報の場合は、このクラスタサイズよりも小さい単位(例えばセクタ単位)で、データの書き込みが指示されることがある。   Also, file data managed by the FAT file system / NT file system or the like is divided into data of a predetermined cluster size, and the divided data is stored in the flash memory. As the storage capacity of the flash memory system increases, the cluster size increases in stages, such as 512 bytes, 1 kbyte, 2 kbytes, and 4 kbytes. If the data to be written based on the write instruction given from the host system is file data, the data write is instructed in this cluster unit. That is, when the data to be written is file data, the data writing is not instructed in a unit smaller than the cluster size. On the other hand, if the data to be written is information for managing file data, data writing may be instructed in units smaller than the cluster size (for example, sector units).

この小さい容量でデータの書き込みが指示される領域(以下、「小容量アクセス領域」と言う)としては、例えば、FATファイルシステムやNTファイルシステムにおけるファイルデータを管理するための情報が保存される領域が挙げられる。FATファイルシステムであれば、ファイル名やルートディレクトリを含む情報が保存されるディレクトリ領域や、クラスタの番号の情報が保存されるFAT領域が、小容量アクセス領域に該当する。NTファイルシステムであれば、ファイル名やインデックスを含む情報が保存されるMFT(Master File Table)領域(管理レコードに割り当てられた領域)が、小容量アクセス領域に該当する。   As an area in which data writing is instructed with this small capacity (hereinafter referred to as “small capacity access area”), for example, an area in which information for managing file data in the FAT file system or NT file system is stored Is mentioned. In the case of a FAT file system, a directory area in which information including a file name and a root directory is stored, and a FAT area in which information on a cluster number is stored correspond to a small capacity access area. In the case of the NT file system, an MFT (Master File Table) area (area allocated to a management record) in which information including a file name and an index is stored corresponds to a small capacity access area.

このようなファイルデータを管理するための情報は書き換えられる頻度が高いため、小容量アクセス領域に対応するデータは書き換え頻度が高い場合が多い。従って、小容量アクセス領域が属する論理ブロックについては、論理ブロックに含まれる論理ページと、その論理ブロックに対応する物理ブロックに含まれる物理ページとの対応関係が固定されていない方が好ましい。つまり、小容量アクセス領域が属する論理ブロックについては、ページ対応関係可変方式で論理ページと物理ページの対応関係が管理されることが好ましい。   Since information for managing such file data is frequently rewritten, data corresponding to the small-capacity access area is often rewritten frequently. Therefore, for the logical block to which the small capacity access area belongs, it is preferable that the correspondence relationship between the logical page included in the logical block and the physical page included in the physical block corresponding to the logical block is not fixed. That is, for the logical block to which the small-capacity access area belongs, it is preferable that the correspondence between the logical page and the physical page is managed by the page correspondence variable method.

特開平11−110283号公報Japanese Patent Laid-Open No. 11-110283 特開2005−196736号公報JP 2005-196736

ホストシステムに電気的に接続されるフラッシュメモリシステムは、ホストシステムから与えられるアクセス指示に基づいてフラッシュメモリシステム内のフラッシュメモリにアクセスする。このホストシステムから与えられるアクセス指示には、書き込みや読み出しを指示するコマンドと、アクセス対象の領域を指定する論理アドレスとが含まれている。フラッシュメモリシステムは、ホストシステムから与えられる論理アドレスと、フラッシュメモリ内の記憶領域に割り当てられている物理アドレスとの対応関係を管理し、この対応関係に基づいて、ホストシステムから与えられるデータをフラッシュメモリに書き込んだり、フラッシュメモリに記憶されているデータをフラッシュメモリから読み出したりする。   The flash memory system electrically connected to the host system accesses the flash memory in the flash memory system based on an access instruction given from the host system. The access instruction given from the host system includes a command for instructing writing or reading and a logical address for designating an area to be accessed. The flash memory system manages the correspondence between the logical address given by the host system and the physical address assigned to the storage area in the flash memory, and the data given from the host system is flashed based on this correspondence. Write to the memory or read data stored in the flash memory from the flash memory.

このようなアクセス処理において、ホストシステムから与えられる論理アドレスが、上述のディレクトリ領域、FAT領域及びMFT領域等の小容量アクセス領域に割り当てられた論理アドレスであるか否かを、フラッシュメモリシステム側で判断することはできない。   In such access processing, whether or not the logical address given from the host system is a logical address assigned to the above-mentioned small capacity access area such as the directory area, FAT area, and MFT area is determined on the flash memory system side. It cannot be judged.

つまり、フラッシュメモリシステム側では、小容量アクセス領域が属する論理ブロックを判別することができない。従って、ページ対応関係可変方式による論理ページと物理ページの対応関係の管理が、小容量アクセス領域が属する論理ブロックだけに適用されるようにすることもできない。また、ページ対応関係可変方式による論理ページと物理ページの対応関係の管理が、全ての論理ブロックに適用されるようにした場合、データ書き換えの効率は向上するが、論理ページと物理ページの対応関係の管理に係る負担が大きくなる。   That is, on the flash memory system side, the logical block to which the small capacity access area belongs cannot be determined. Therefore, the management of the correspondence between the logical page and the physical page by the page correspondence variable method cannot be applied only to the logical block to which the small capacity access area belongs. In addition, when the management of the correspondence between logical pages and physical pages using the page correspondence variable method is applied to all logical blocks, the efficiency of data rewriting improves, but the correspondence between logical pages and physical pages. The burden related to the management becomes large.

そこで、本発明は、論理ページと物理ページの対応関係の管理に係る負担の増加を抑えつつ、データ書き換えの効率を向上させることのできる記憶領域の管理技術を提供することを目的とする。   Accordingly, an object of the present invention is to provide a storage area management technique capable of improving the efficiency of data rewriting while suppressing an increase in the burden associated with managing the correspondence between logical pages and physical pages.

本発明の第一の側面に従うメモリコントローラは、ホストシステムから与えられるアクセス指示に従って、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
前記アクセス指示により指定される論理アドレスが割り当てられているセクタ単位の領域が複数個含まれる所定セクタ数の領域を論理ブロックとして管理する論理ブロック管理手段と、
前記論理ブロックに対して、前記フラッシュメモリ内の所定個数の物理ブロックを割り当てる記憶領域割り当て手段と、
それぞれの前記論理ブロック内の領域に対する所定セクタ数より少ない容量の領域を指定したデータの書き込みが前記アクセス指示により指示される回数に基づいて、前記論理ブロックの種別を判断する論理ブロック種別判断手段と、
前記アクセス指示により指定された書き込み先の領域が属する前記論理ブロックに対応する物理ブロックにデータを書き込むデータ書き込み手段と
を備え、
前記論理ブロック種別判断手段が、前記回数が所定回数未満の前記論理ブロックを第1の論理ブロックと判断し、前記回数が所定回数以上の前記論理ブロックを第2の論理ブロックと判断し、
前記データ書き込み手段は、前記第1の論理ブロックと判断された前記論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番でデータを書き込み、前記第2の論理ブロックと判断された論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番に依存せずにデータを書き込む
ことを特徴とする。
A memory controller according to a first aspect of the present invention is a memory controller that controls access to a flash memory to be erased in units of physical blocks including a plurality of physical pages, in accordance with an access instruction given from a host system.
Logical block management means for managing, as a logical block, an area having a predetermined number of sectors including a plurality of areas in sector units to which a logical address designated by the access instruction is assigned;
Storage area allocating means for allocating a predetermined number of physical blocks in the flash memory to the logical block;
Logical block type determination means for determining the type of the logical block based on the number of times data write specifying a region having a capacity smaller than a predetermined number of sectors with respect to the region in each logical block is instructed by the access instruction; ,
Data writing means for writing data to a physical block corresponding to the logical block to which the write destination area designated by the access instruction belongs,
The logical block type determining means determines the logical block whose number is less than a predetermined number as a first logical block, and determines the logical block whose number is a predetermined number or more as a second logical block,
The data writing means writes data in the order of the logical addresses to the physical block corresponding to the logical block determined to be the first logical block, and the logical block determined to be the second logical block. Data is written to the physical block corresponding to the block without depending on the order of the logical addresses.

好適な実施形態では、前記メモリコントローラが、前記論理アドレスの順番でデータが書き込まれていない物理ブロック内の記憶データを、別の物理ブロックに前記論理アドレスの順番で書き写すデータ複写手段を更に備える。前記回数が所定回数以上になったいずれかの前記論理ブロック内の領域に対して、前記所定セクタ数より少ない容量の領域を指定したデータの書き込みが所定期間指示されなかったときに、前記論理ブロック種別判断手段は、前記いずれかの前記論理ブロックを第1の論理ブロックと判断し、前記データ複写手段は、前記いずれかの前記論理ブロックに対応する物理ブロック内の記憶データを、別の物理ブロックに前記論理アドレスの順番で書き写す。   In a preferred embodiment, the memory controller further includes data copying means for copying storage data in a physical block in which data is not written in the order of the logical addresses to another physical block in the order of the logical addresses. When writing of data designating an area having a capacity smaller than the predetermined number of sectors is not instructed for a predetermined period of time in any of the logical blocks in which the number of times is equal to or greater than the predetermined number, the logical block The type determining unit determines that any one of the logical blocks is a first logical block, and the data copying unit determines that the storage data in the physical block corresponding to the one logical block is another physical block. Are copied in the order of the logical addresses.

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

本発明の第三の側面に従う方法は、ホストシステムから与えられるアクセス指示に従って、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリの制御方法であって、
前記アクセス指示により指定される論理アドレスが割り当てられているセクタ単位の領域が複数個含まれる所定セクタ数の領域を論理ブロックとして管理する論理ブロック管理ステップと、
前記論理ブロックに対して、前記フラッシュメモリ内の所定個数の物理ブロックを割り当てる記憶領域割り当てステップと、
それぞれの前記論理ブロック内の領域に対する所定セクタ数より少ない容量の領域を指定したデータの書き込みが前記アクセス指示により指示される回数に基づいて、前記論理ブロックの種別を判断する論理ブロック種別判断ステップと、
前記アクセス指示により指定された書き込み先の領域が属する前記論理ブロックに対応する物理ブロックにデータを書き込むデータ書き込みステップと
を有し、
前記書き込み方式判断ステップでは、前記回数が所定回数未満の前記論理ブロックを第1の論理ブロックと判断し、前記回数が所定回数以上の前記論理ブロックを第2の論理ブロックと判断し、
前記データ書き込みステップでは、前記第1の論理ブロックと判断された前記論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番でデータを書き込み、前記第2の論理ブロックと判断された論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番に依存せずにデータを書き込む
ことを特徴とする。
A method according to a third aspect of the present invention is a flash memory control method in which erasing is performed in units of physical blocks including a plurality of physical pages in accordance with an access instruction given from a host system.
A logical block management step of managing, as a logical block, an area having a predetermined number of sectors including a plurality of areas in units of sectors to which a logical address designated by the access instruction is assigned;
A storage area allocation step for allocating a predetermined number of physical blocks in the flash memory to the logical block;
A logical block type determination step for determining a type of the logical block based on the number of times data write specifying a region having a capacity smaller than a predetermined number of sectors to the region in each logical block is instructed by the access instruction; ,
A data writing step of writing data to a physical block corresponding to the logical block to which the write destination area designated by the access instruction belongs,
In the writing method determining step, the logical block having the number of times less than a predetermined number is determined as a first logical block, and the logical block having the number of times being a predetermined number or more is determined as a second logical block,
In the data writing step, data is written in the order of the logical addresses to the physical block corresponding to the logical block determined as the first logical block, and the logical block determined as the second logical block Data is written to the physical block corresponding to the block without depending on the order of the logical addresses.

好適な実施形態では、前記論理アドレスの順番でデータが書き込まれていない物理ブロック内の記憶データを、別の物理ブロックに前記論理アドレスの順番で書き写すデータ複写ステップが更に備えられる。前記回数が所定回数以上になったいずれかの前記論理ブロック内の領域に対して、前記所定セクタ数より少ない容量の領域を指定したデータの書き込みが所定期間指示されなかったときに、前記書き込み方式判断ステップにより、前記いずれかの前記論理ブロックが第1の論理ブロックと判断され、前記データ複写ステップにより、前記いずれかの前記論理ブロックに対応する物理ブロック内の記憶データが、別の物理ブロックに前記論理アドレスの順番で書き写される。   In a preferred embodiment, there is further provided a data copying step of copying storage data in a physical block in which data is not written in the order of the logical addresses to another physical block in the order of the logical addresses. When the writing of data designating an area having a capacity smaller than the predetermined number of sectors is not instructed for a predetermined period with respect to an area in any of the logical blocks in which the number of times is equal to or greater than the predetermined number, the writing method In the determination step, any one of the logical blocks is determined as a first logical block, and in the data copying step, storage data in a physical block corresponding to the any one of the logical blocks is transferred to another physical block. It is copied in the order of the logical addresses.

ホストシステムからの指示に基づいて動作するフラッシュメモリシステムにおいて、本発明にかかる記憶領域の管理を適用すれば、論理ページと物理ページの対応関係の管理に係る負担の増加を抑えつつ、データ書き換えの効率を向上させることができる。また、この記憶領域の管理では、論理ページと物理ページの対応関係が固定された領域の管理が適用される領域と、論理ページと物理ページの対応関係が固定されていない領域の管理が適用される領域とが予め設定されている必要がない。   If the storage area management according to the present invention is applied to a flash memory system that operates based on an instruction from a host system, data rewriting can be performed while suppressing an increase in the burden associated with managing the correspondence between logical pages and physical pages. Efficiency can be improved. In addition, in the management of this storage area, the management of the area where the correspondence between the logical page and the physical page is fixed and the management of the area where the correspondence between the logical page and the physical page is not fixed are applied. There is no need to set a predetermined area.

図1は、本発明の一実施形態に係るフラッシュメモリシステム1の構成を概略的に示すブロック図である。図1に示すように、フラッシュメモリシステム1は、フラッシュメモリ2と、それを制御するメモリコントローラ3とで構成されている。メモリコントローラ3とフラッシュメモリ2は、内部バス14を介して接続されている。   FIG. 1 is a block diagram schematically showing a configuration of a flash memory system 1 according to an embodiment of the present invention. 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. The memory controller 3 and the flash memory 2 are connected via an internal bus 14.

フラッシュメモリシステム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.

図1に示したように、メモリコントローラ3は、マイクロプロセッサ6と、ホストインターフェースブロック7と、SRAM8と、バッファ9と、フラッシュメモリインターフェースブロック10と、ECC(Error Correcting Code)ブロック11と、ROM(Read Only Memory)12とから構成される。これら機能ブロックによって構成されるメモリコントローラ3は、一つの半導体チップ上に集積される。以下、各機能ブロックについて説明する。   As shown in FIG. 1, the memory controller 3 includes a microprocessor 6, a host interface block 7, an SRAM 8, a buffer 9, a flash memory interface block 10, an ECC (Error Correcting Code) block 11, and a ROM ( Read Only Memory) 12. 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に供給されるデータ等は、ホストインターフェースブロック7を入口としてフラッシュメモリシステム1の内部(例えば、バッファ9)に取り込まれる。また、フラッシュメモリシステム1からホストシステム4に供給されるデータ等は、ホストインターフェースブロック7を出口としてホストシステム4に供給される。   The host interface block 7 exchanges data, address information, status information, commands, and the like with the host system 4. 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.

SRAM(Static Random Access Memory)8は、揮発性の記憶素子であり、その記憶領域にはフラッシュメモリ2の制御に必要な情報が一時的に保持される。例えば、アドレス変換テーブルや空きブロック検索テーブル等が保持される。ここで、アドレス変換テーブルは、論理ブロックと物理ブロックとの対応関係を示したテーブルであり、空きブロック検索テーブルは、消去状態の物理ブロック(又は、有効なデータが保存されていない物理ブロック)を検索するためのテーブルである。   An SRAM (Static Random Access Memory) 8 is a volatile storage element, and information necessary for controlling the flash memory 2 is temporarily stored in the storage area. For example, an address conversion table, an empty block search table, etc. are held. Here, the address conversion table is a table showing the correspondence between logical blocks and physical blocks, and the free block search table is an erased physical block (or a physical block in which valid data is not stored). This is a table for searching.

ROM12は、不揮発性の記憶素子であり、メモリコントローラ3が動作するために必要なファームウェアが保存される。   The ROM 12 is a nonvolatile storage element, and stores firmware necessary for the memory controller 3 to operate.

バッファ9は、ホストシステム4から与えられたデータやフラッシュメモリ2から読み出されたデータを一時的に保持する。例えば、フラッシュメモリ2に書き込まれるデータは、フラッシュメモリ2が書き込み可能な状態になるまでバッファ9に保持される。また、フラッシュメモリ2から読み出されたデータは、ホストシステム4が受け取り可能な状態になるまでバッファ9に保持される。   The buffer 9 temporarily holds data given from the host system 4 or data read from the flash memory 2. For example, data written to the flash memory 2 is held in the buffer 9 until the flash memory 2 is in a writable state. The data read from the flash memory 2 is held in the buffer 9 until the host system 4 can receive the data.

フラッシュメモリインターフェースブロック10は、フラッシュメモリ2に対する各種の処理を実行する。この処理では、フラッシュメモリインターフェースブロック10とフラッシュメモリ2との間で、データ、アドレス情報、ステータス情報、コマンド等の授受が、内部バス14を介して行なわれる。   The flash memory interface block 10 executes various processes for the flash memory 2. In this process, data, address information, status information, commands, etc. are exchanged between the flash memory interface block 10 and the flash memory 2 via the internal bus 14.

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

マイクロプロセッサ6は、ROM12から読み込んだプログラムコードに従って、メモリコントローラ3の全体の動作を制御する。   The microprocessor 6 controls the overall operation of the memory controller 3 in accordance with the program code read from the ROM 12.

以上の機能ブロックで構成されたメモリコントローラ3は、ホストシステム4から与えられるアクセス指示に従って動作する。このアクセス指示には、書き込み、読み出し又は消去等の動作を指示するコマンド(以下、ホストシステム4から与えられるコマンドを「外部コマンド」と言う)が含まれている。更に、書き込み又は読み出しを指示する外部コマンドがホストシステム4から与えられるときには、この外部コマンドと共に、アクセス対象の領域を指示するアドレス情報がホストシステム4から与えられる。このアドレス情報には、アクセス対象の領域の先頭アドレスと容量(セクタ数)を示す情報が含まれている。   The memory controller 3 composed of the above functional blocks operates according to an access instruction given from the host system 4. This access instruction includes a command for instructing an operation such as writing, reading or erasing (hereinafter, a command given from the host system 4 is referred to as an “external command”). Further, when an external command for instructing writing or reading is given from the host system 4, address information for instructing an area to be accessed is given from the host system 4 together with this external command. This address information includes information indicating the start address and capacity (number of sectors) of the area to be accessed.

メモリコントローラ3は、ホストシステム4から与えられるアクセス指示に基づいて、フラッシュメモリ2に、書き込み、読み出し又は消去等の動作を指示するコマンド(以下、メモリコントローラ3がフラッシュメモリ2に与えられるコマンドを「内部コマンド」と言う)を与える。メモリコントローラ3がフラッシュメモリ2に書き込み又は読み出しを指示する内部コマンドを与えるときには、その内部コマンドと共にフラッシュメモリ2内の記憶領域を指示する物理アドレスがフラッシュメモリ2に与えられる。   Based on the access instruction given from the host system 4, the memory controller 3 instructs the flash memory 2 to perform an operation such as writing, reading or erasing (hereinafter, the command given by the memory controller 3 to the flash memory 2 is “ Internal command). When the memory controller 3 gives an internal command for instructing writing or reading to the flash memory 2, a physical address for instructing a storage area in the flash memory 2 is given to the flash memory 2 together with the internal command.

フラッシュメモリ2は、NAND型フラッシュメモリであり、レジスタと、複数のメモリセルから構成されたメモリセルアレイを備えている。メモリセルアレイは、複数のメモリセル群と、ワード線とを備える。メモリセル群は、複数のメモリセルが直列に接続されたものである。各ワード線は、メモリセル群の特定のメモリセルを選択するためのものである。このワード線を介して選択された各メモリセル群の中のメモリセルとレジスタとの間で、レジスタからメモリセルへのデータの書き込み又はメモリセルからレジスタへのデータの読み出しが行われる。   The flash memory 2 is a NAND type flash memory, and includes a register and a memory cell array composed of a plurality of memory cells. The memory cell array includes a plurality of memory cell groups and word lines. In the memory cell group, 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 memory cell or read from the memory cell to the register between the memory cell and the register in each memory cell group selected via the word line.

NAND型フラッシュメモリでは、データの読み出し及び書き込みはページ(物理ページ)単位で行われ、データの消去はブロック(物理ブロック)単位で行われる。物理ブロックは、複数の物理ページで構成される。例えば、1個の物理ページは、2048バイトの記憶領域であるユーザー領域と、64バイトの記憶領域である冗長領域とで構成され、1個の物理ブロックは、64個の物理ページで構成されている。冗長領域は、誤り訂正符号(ECC:Error Correcting Code)、論理アドレス情報、ブロックステータス(フラグ)等の付加データが記憶される領域である。尚、論理アドレス情報は、その物理ブロックと対応する論理ブロックを示す情報である。ブロックステータス(フラグ)は、その物理ブロックの良否を示す情報である。   In the NAND flash memory, data reading and writing are performed in units of pages (physical pages), and data erasing is performed in units of blocks (physical blocks). A physical block is composed of a plurality of physical pages. For example, one physical page is composed of a user area which is a 2048-byte storage area and a redundant area which is a 64-byte storage area, and one physical block is composed of 64 physical pages. Yes. The redundant area is an area in which additional data such as an error correcting code (ECC), logical address information, and a block status (flag) is stored. The logical address information is information indicating a logical block corresponding to the physical block. The block status (flag) is information indicating pass / fail of the physical block.

ホストシステム4側のアドレス空間は、セクタ(512バイト)単位で分割した領域(以下、論理セクタ領域と言う)に付けられた通し番号であるLBA(Logical Block Address)で管理されている。メモリコントローラ3は、複数個の論理セクタ領域からなる領域を論理ブロックとして取り扱い、この論理ブロックに対して、1個又は複数個の物理ブロックを割り当てる。この論理ブロックと物理ブロックの対応関係は、アドレス変換テーブルで管理されている。このアドレス変換テーブルでは、論理ブロックに付けられた論理ブロック番号(LBN)に対して物理ブロックに付けられた物理ブロックアドレス(PBA)を関連付けることにより論理ブロックと物理ブロックの対応関係を管理している。   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). The memory controller 3 handles an area composed of a plurality of logical sector areas as a logical block, and allocates one or a plurality of physical blocks to the logical block. The correspondence between the logical block and the physical block is managed by an address conversion table. In this address conversion table, the correspondence between the logical block and the physical block is managed by associating the physical block address (PBA) attached to the physical block with the logical block number (LBN) attached to the logical block. .

本実施形態では、図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 the present embodiment, as shown in FIG. 2, a logical block is formed by combining 256 logical sector areas having consecutive LBAs, and a logical block number (LBN) is assigned to this logical block. For example, the 256 logical sector areas of LBA # 0 to # 255 belong to the logical block of LBN # 0, and the 256 logical sector areas of LBA # 256 to # 511 belong to the logical block of LBN # 1. . As described above, the 2048,000 logical sector areas of LBA # 0 to # 20479999 belong to one of 8000 logical blocks of LBN # 0 to # 7999.

更に、アドレス変換テーブルを管理するための便宜として、メモリコントローラ3は、複数個の論理ブロックをまとめたものを論理グループとして取り扱い、この論理グループ単位でアドレス変換テーブルを管理している。以下、論理グループに付けられた通し番号を論理グループ番号(LGN)と言う。また、図2に示した例では、LBNが連続する論理ブロックが、異なる論理グループに順次振り分けられるようにして論理グループが形成されている。ここでは、LBN#0の論理ブロックはLGN#0の論理グループに、LBN#1の論理ブロックはLGN#1の論理グループに、LBN#2の論理ブロックはLGN#2の論理グループにという順番でLGN#0〜#7の各論理グループにLBN#0〜#7999の8000個の論理ブロックが1000個ずつ振り分けられている。各論理グループに含まれる論理ブロックの個数は、適宜設定することができるが、アドレス変換テーブルが保存されるフラッシュメモリ2の物理ページの記憶容量を考慮して設定することが好ましい。つまり、各論理グループに対応するアドレス変換テーブルは、1個の物理ページに保存できる容量であることが好ましい。   Further, as a convenience for managing the address conversion table, the memory controller 3 treats a group of a plurality of logical blocks as a logical group, and manages the address conversion table in units of the logical group. Hereinafter, a serial number assigned to a logical group is referred to as a logical group number (LGN). In the example shown in FIG. 2, logical groups are formed such that logical blocks having consecutive LBNs are sequentially distributed to different logical groups. Here, the logical block of LBN # 0 is in the logical group of LGN # 0, the logical block of LBN # 1 is in the logical group of LGN # 1, and the logical block of LBN # 2 is in the logical group of LGN # 2. 1000 logical blocks of LBN # 0 to # 7999 are allocated to each logical group of LGN # 0 to # 7. The number of logical blocks included in each logical group can be set as appropriate, but is preferably set in consideration of the storage capacity of the physical page of the flash memory 2 in which the address translation table is stored. That is, the address conversion table corresponding to each logical group preferably has a capacity that can be stored in one physical page.

次に、本実施形態の特徴の一つである論理ページと物理ページの対応関係の管理について説明する。本実施形態では図3(a)に示したように4個の論理セクタ領域で論理ページを形成している。従って、256個の論理セクタ領域が含まれる論理ブロック内には#0〜#63の論理ページ番号(LPN)が付けられた64個の論理ページが形成される。この論理ページを何個の論理セクタ領域で形成するか、つまり、論理ページの容量を何セクタにするかは、物理ページの記憶容量等を考慮して適宜設定することができる。   Next, management of the correspondence between logical pages and physical pages, which is one of the features of this embodiment, will be described. In this embodiment, as shown in FIG. 3A, a logical page is formed by four logical sector areas. Accordingly, 64 logical pages with logical page numbers (LPN) # 0 to # 63 are formed in a logical block including 256 logical sector areas. The number of logical sector regions in which this logical page is formed, that is, how many sectors the logical page capacity is to be set can be appropriately set in consideration of the storage capacity of the physical page.

図3(a)に示したように論理ブロックに含まれる265個の論理セクタ領域に対して、LBNの順番で#0〜#256のセクタ番号(SN)を付けた場合、SN#0〜#3の論理セクタ領域はLPN#0の論理ページに属し、SN#4〜#7の論理セクタ領域はLPN#1の論理ページに属し、以下同様にして、SN#252〜#255の論理セクタ領域はLPN#63の論理ページに属する。   When the sector numbers (SN) of # 0 to # 256 are assigned to the 265 logical sector areas included in the logical block as shown in FIG. 3 belongs to the logical page of LPN # 0, the logical sector areas of SN # 4 to # 7 belong to the logical page of LPN # 1, and the logical sector areas of SN # 252 to # 255 in the same manner. Belongs to the logical page of LPN # 63.

本実施形態では、64個の論理ページを含む論理ブロックを64個の物理ページで構成された物理ブロックに割り当てている。従って、論理ブロック内のそれぞれの論理ページに対応するデータは、その論理ブロックに割り当てられた物理ブロック内のいずれかの物理ページに書き込まれる。メモリコントローラ3は、この論理ページと物理ページの対応関係を固定するか否かを論理ブロック単位で管理している。   In the present embodiment, a logical block including 64 logical pages is allocated to a physical block composed of 64 physical pages. Therefore, the data corresponding to each logical page in the logical block is written to any physical page in the physical block assigned to the logical block. The memory controller 3 manages whether or not the correspondence between the logical page and the physical page is fixed in units of logical blocks.

図3(b)は論理ページと物理ページの対応関係が固定されている場合を示し、図3(c)は論理ページと物理ページの対応関係が固定されていない場合を示している。図3(b)及び図3(c)では、物理ブロックを構成する64個の物理ページに、#0〜#63の物理番号(PPN)が付けられている。論理ページと物理ページの対応関係が固定されている場合は、図3(b)に示したようにLPN#0の論理ページがPPN#0の物理ページに対応し、LPN#1の論理ページがPPN#1の物理ページに対応し、以下同様にしてLPN#63の論理ページがPPN#63の物理ページに対応している。従って、論理ページと物理ページの対応関係が固定されている場合、例えば、LPN#0の論理ページに対応するデータはPPN#0の物理ページにだけ書き込まれ、他の物理ページに書き込まれない。一方、論理ページと物理ページの対応関係が固定されていない場合は、論理ページと物理ページの対応関係を自由に変更することができる。例えば、図3(c)は論理ページと物理ページの対応関係が固定されていない場合の論理ページと物理ページの対応関係の1例であり、LPN#4の論理ページがPPN#0の物理ページに対応し、LPN#6の論理ページがPPN#1の物理ページに対応し、LPN#0の論理ページがPPN#2の物理ページに対応している。この対応関係では、PPN#0の物理ページにLPN#4の論理ページに対応するデータが書き込まれるが、PPN#0の物理ページに書き込まれるデータは、LPN#0〜#63のいずれの論理ページに対応するデータであってもよい。   FIG. 3B shows a case where the correspondence between the logical page and the physical page is fixed, and FIG. 3C shows a case where the correspondence between the logical page and the physical page is not fixed. In FIG. 3B and FIG. 3C, the physical numbers (PPNs) # 0 to # 63 are attached to the 64 physical pages constituting the physical block. When the correspondence between the logical page and the physical page is fixed, as shown in FIG. 3B, the LPN # 0 logical page corresponds to the PPN # 0 physical page, and the LPN # 1 logical page The logical page of LPN # 63 corresponds to the physical page of PPN # 63. Therefore, when the correspondence between the logical page and the physical page is fixed, for example, data corresponding to the logical page of LPN # 0 is written only to the physical page of PPN # 0 and not written to other physical pages. On the other hand, when the correspondence between the logical page and the physical page is not fixed, the correspondence between the logical page and the physical page can be freely changed. For example, FIG. 3C is an example of the correspondence between the logical page and the physical page when the correspondence between the logical page and the physical page is not fixed, and the logical page of LPN # 4 is the physical page of PPN # 0. The logical page of LPN # 6 corresponds to the physical page of PPN # 1, and the logical page of LPN # 0 corresponds to the physical page of PPN # 2. In this correspondence, data corresponding to the logical page of LPN # 4 is written to the physical page of PPN # 0, but the data written to the physical page of PPN # 0 is any logical page of LPN # 0 to # 63. It may be data corresponding to.

論理ページと物理ページの対応関係を固定した記憶領域の管理を適用する論理ブロック(以下、「第1の領域管理ブロック」と言う)と、論理ページと物理ページの対応関係を固定しない記憶領域の管理を適用する論理ブロック(以下、「第2の領域管理ブロック」と言う)についてはメモリコントローラ3によって決定される。次に、この決定方法について説明する。   A logical block (hereinafter referred to as “first area management block”) to which management of a storage area in which the correspondence between the logical page and the physical page is fixed, and a storage area in which the correspondence between the logical page and the physical page is not fixed. The logical block to which the management is applied (hereinafter referred to as “second area management block”) is determined by the memory controller 3. Next, this determination method will be described.

ホストシステム4がフラッシュメモリシステム1に対してデータの書き込みを指示するときには、フラッシュメモリシステム1には、ホストシステム4から、書き込みを指示する外部コマンドと書き込み先の領域を指示するアドレス情報とが与えられる。このアドレス情報には、書き込み先の領域のセクタ数を示す情報が含まれている。ここで、書き込むデータがファイルデータであれば、クラスタ単位でデータの書き込みが行われるため、書き込み先の領域のセクタ数はクラスタのサイズ(セクタ数)より小さくなることがない。一方、書き込むデータがファイルデータを管理するための情報であれば、書き込み先の領域のセクタ数はクラスタのサイズ(セクタ数)より小さくなることがある。   When the host system 4 instructs the flash memory system 1 to write data, the host system 4 is given an external command for instructing writing and address information for instructing a write destination area. It is done. This address information includes information indicating the number of sectors in the write destination area. Here, if the data to be written is file data, the data is written in units of clusters, so the number of sectors in the write destination area does not become smaller than the cluster size (sector number). On the other hand, if the data to be written is information for managing file data, the number of sectors in the write destination area may be smaller than the size of the cluster (number of sectors).

従って、特定範囲のLBAに対応した領域に対して、クラスタのサイズ(セクタ数)より小さい単位での書き込みが指示されるような場合には、その領域がファイルデータを管理するための情報の保存先に割り当てられている可能性が高い。例えば、ホストシステム4が、FATファイルシステムを採用している場合には、ファイル名やファイルのルートディレクトリを含む情報が保存されるディレクトリ領域や、クラスタの番号の情報が保存されるFAT領域が割り当てられているLBAの範囲が、クラスタのサイズ(セクタ数)より小さい単位での書き込みが指示される可能性が高い。また、NTファイルシステムであれば、ファイル名やインデックスを含む情報が保存されるMFT(Master File Table)領域(管理レコードに割り当てられた領域)が、クラスタのサイズ(セクタ数)より小さい単位での書き込みが指示される可能性が高い。   Therefore, in the case where writing in a unit smaller than the cluster size (number of sectors) is instructed to an area corresponding to a specific range of LBA, the area stores information for managing file data. It is likely that it is assigned first. For example, when the host system 4 employs a FAT file system, a directory area in which information including the file name and the root directory of the file is stored, and a FAT area in which cluster number information is stored are allocated. There is a high possibility that an instruction to write in a unit whose LBA range is smaller than the cluster size (number of sectors) is given. In the NT file system, the MFT (Master File Table) area (area allocated to the management record) in which information including the file name and index is stored is smaller than the cluster size (number of sectors). There is a high possibility that writing is instructed.

従って、メモリコントローラ3は、ホストシステム4から与えられるアドレス情報に含まれる書き込み先の領域のセクタ数に基づいて、ディレクトリ領域、FAT領域又はMFT(Master File Table)領域等のファイルデータを管理するための情報が保存される領域(以下、「ファイル管理領域」と言う)が含まれる論理ブロックの特定を行っている。更に、メモリコントローラ3は、ファイル管理領域が含まれる論理ブロックとして特定された論理ブロックだけに、論理ページと物理ページの対応関係を固定しない記憶領域の管理を適用する。つまり、ファイル管理領域が含まれる論理ブロックとして特定された論理ブロックだけが、第1の領域管理ブロックから第2の領域管理ブロックという設定に変更され、ファイル管理領域が含まれる論理ブロックとして特定されなかった論理ブロックは、第1の領域管理ブロックとして設定されている。   Therefore, the memory controller 3 manages file data such as a directory area, FAT area, or MFT (Master File Table) area based on the number of sectors in the write destination area included in the address information given from the host system 4. The logical block including the area (hereinafter referred to as “file management area”) in which the above information is stored is specified. Further, the memory controller 3 applies storage area management that does not fix the correspondence between the logical page and the physical page only to the logical block specified as the logical block including the file management area. That is, only the logical block specified as the logical block including the file management area is changed from the first area management block to the setting of the second area management block, and is not specified as the logical block including the file management area. The logical block is set as the first area management block.

従って、ファイル管理領域が含まれる論理ブロックとして特定された論理ブロックについては、書き換え効率が向上するが、論理ページと物理ページの対応関係を管理する必要が生じる。次に、ファイル管理領域が含まれる論理ブロックとして特定された論理ブロック、つまり、第2の領域管理ブロックとして設定された論理ブロックにおける論理ページと物理ページの対応関係を管理について説明する。   Therefore, although the rewriting efficiency is improved for the logical block specified as the logical block including the file management area, it is necessary to manage the correspondence between the logical page and the physical page. Next, the management of the correspondence between the logical page and the physical page in the logical block specified as the logical block including the file management area, that is, the logical block set as the second area management block will be described.

メモリコントローラ3は、例えば、第2の領域管理ブロックとして設定された論理ブロックに割り当てられた物理ブロックの冗長領域に論理ページと物理ページの対応関係を示す情報(以下、「ページ管理情報」と言う)を書き込むことにより、第2の領域管理ブロックとして設定された論理ブロックにおける論理ページと物理ページの対応関係を管理する。メモリコントローラ3は、このページ管理情報を読み出し、読み出したページ管理情報に基づいて論理ページと物理ページの対応関係を判断する。   For example, the memory controller 3 has information (hereinafter referred to as “page management information”) indicating the correspondence between the logical page and the physical page in the redundant area of the physical block allocated to the logical block set as the second area management block. ) Is managed, the correspondence between the logical page and the physical page in the logical block set as the second area management block is managed. The memory controller 3 reads this page management information and determines the correspondence between the logical page and the physical page based on the read page management information.

第2の領域管理ブロックとして設定された論理ブロックに割り当てられた物理ブロック内の物理ページにデータが書き込まれたときに、このデータに対応する論理ページのLPNが冗長領域に書き込まれるようにした場合、冗長領域に書き込まれているLPNに基づいて論理ページと物理ページの対応関係が判断される。   When data is written to the physical page in the physical block assigned to the logical block set as the second area management block, the LPN of the logical page corresponding to this data is written to the redundant area The correspondence between the logical page and the physical page is determined based on the LPN written in the redundant area.

第2の領域管理ブロックとして設定された論理ブロックに割り当てられた物理ブロック内の物理ページにデータが書き込まれたときに、末尾のデータが書き込まれた物理ページの次のページ(ユーザー領域)に、LPN#0〜#63のそれぞれ論理ページに対応する物理ページを示すテーブル(以下、「ページ管理テーブル」と言う)が書き込まれるようにしてもよい。この場合、メモリコントローラ3は、最新のページ管理テーブルを読み出すことにより、全ての論理ページについて、論理ページと物理ページの対応関係を把握することができる。   When data is written to the physical page in the physical block assigned to the logical block set as the second area management block, the next page (user area) of the physical page to which the last data is written, A table (hereinafter referred to as “page management table”) indicating physical pages corresponding to the logical pages of LPN # 0 to # 63 may be written. In this case, the memory controller 3 can grasp the correspondence between the logical page and the physical page for all logical pages by reading the latest page management table.

尚、第2の領域管理ブロックとして設定された論理ブロックについては、2個の物理ブロックを割り当てられるようにすることが好ましい。つまり、第2の領域管理ブロックとして設定された論理ブロックについては、第1の領域管理ブロックとして設定されている論理ブロックよりも多い個数の物理ブロックを割り当てられるようにすることが好ましい。このようにすれば、それぞれ論理ページに対して割り当てることができる物理ページが増加するため、データの書き換え効率が更に向上する。また、ページ管理テーブルがユーザー領域に書き込まれる場合には、ページ管理テーブルの書き込み先として使用される物理ページが十分に確保される。   Note that it is preferable that two physical blocks be assigned to the logical block set as the second area management block. That is, it is preferable that a larger number of physical blocks be assigned to the logical block set as the second area management block than the logical block set as the first area management block. In this way, the number of physical pages that can be allocated to each logical page increases, so that the data rewriting efficiency is further improved. Further, when the page management table is written in the user area, a sufficient physical page is secured as the page management table write destination.

以下、本実施の形態におけるメモリコントローラ3の動作について説明する。   Hereinafter, the operation of the memory controller 3 in the present embodiment will be described.

まず、メモリコントローラ3が、ファイル管理領域が含まれる論理ブロックを特定する動作について説明する。   First, an operation in which the memory controller 3 specifies a logical block including a file management area will be described.

メモリコントローラ3のホストインターフェースブロック7は、ホストシステム4からアクセス可能な各種のレジスタ(以下、「ホストインターフェースレジスタ」と言う)を備えている。ホストシステム4からメモリコントローラ3に与えられるアクセス指示は、このホストインターフェースレジスタに書き込まれる。ホストシステム4がメモリコントローラ3に対してデータの書き込みを指示する場合には、「データの書き込みを指示する外部コマンド」、「先頭データの書き込みを指示するLBA」及び「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」がホストインターフェースレジスタに書き込まれる。   The host interface block 7 of the memory controller 3 includes various registers accessible from the host system 4 (hereinafter referred to as “host interface registers”). An access instruction given from the host system 4 to the memory controller 3 is written in the host interface register. When the host system 4 instructs the memory controller 3 to write data, “external command for instructing data writing”, “LBA for instructing writing of head data”, and “number of sectors in the data writing area” (The number of sectors corresponding to the capacity of data to be written) "is written to the host interface register.

本実施の形態では、ホストインターフェースレジスタに書き込まれる「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」に基づいて、書き込むデータがファイルデータであるか、又はファイルデータを管理するための情報であるかが判別される。この判別を行うため、ホストインターフェースレジスタに書き込まれる「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」に対して閾値(以下、「セクタ数設定値」と言う)を設定される。メモリコントローラ3は、「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」がセクタ数設定値以上の場合には、書き込むデータがファイルデータであると判断し、セクタ数設定値より小さい場合には、書き込むデータがファイルデータを管理するための情報であると判断する。   In this embodiment, the data to be written is file data or the file data is managed based on “the number of sectors in the data writing area (the number of sectors corresponding to the capacity of the data to be written)” written in the host interface register. It is determined whether the information is for use. In order to make this determination, a threshold value (hereinafter referred to as “sector number setting value”) is set for “the number of sectors in the data writing area (the number of sectors corresponding to the capacity of the data to be written)” written in the host interface register. Is done. The memory controller 3 determines that the data to be written is file data when “the number of sectors in the data writing area (the number of sectors corresponding to the capacity of the data to be written)” is equal to or larger than the sector number setting value. If it is smaller than the value, it is determined that the data to be written is information for managing the file data.

尚、既に説明したように、書き込むデータがファイルデータあれば、クラスタ単位でデータの書き込みが行われるため、セクタ数設定値はクラスタのセクタ数に合わせて設定されることが好ましい。但し、セクタ数設定値がクラスタのセクタ数よりも小さくても構わない。例えば、クラスタのセクタ数が8セクタの場合に、セクタ数設定値が“4”であっても構わない。   As already described, if the data to be written is file data, the data is written in units of clusters. Therefore, the sector number setting value is preferably set in accordance with the number of sectors in the cluster. However, the sector number setting value may be smaller than the number of sectors in the cluster. For example, when the number of sectors in the cluster is 8, the sector number setting value may be “4”.

次に、ファイル管理領域が含まれる論理ブロックを特定するために使用されるテーブル(以下、「小容量書き込み管理テーブル」と言う)について図4を参照して説明する。図4に示した小容量書き込み管理テーブルには、それぞれの論理ブロックが第1の領域管理ブロックとして設定されているか又は第2の領域管理ブロックとして設定されているかを示す書き込み設定フラグと、セクタ数設定値より小さいセクタ数のデータの書き込みが指示された回数(以下、「小容量書き込み指示回数」と言う)とが書き込まれる。小容量書き込み管理テーブルに書き込まれる書き込み設定フラグと小容量書き込み指示回数は、各LBNに関連付けられている。書き込み設定フラグの“0”は、その論理ブロックが第1の領域管理ブロックとして設定されていることを示し、書き込み設定フラグの“1”は、その論理ブロックが第2の領域管理ブロックとして設定されていることを示している。この小容量書き込み管理テーブルは、SRAM8上で更新され、フラッシュメモリ2に保存される。この小容量書き込み管理テーブルがフラッシュメモリ2に保存されていないときには、書き込み設定フラグが“0”に設定され小容量書き込み指示回数が“0”に設定された小容量書き込み管理テーブル(図4(a)参照)が、SRAM8上に作成され、作成された小容量書き込み管理テーブルは、フラッシュメモリ2に保存される。   Next, a table used for specifying a logical block including a file management area (hereinafter referred to as “small capacity write management table”) will be described with reference to FIG. In the small capacity write management table shown in FIG. 4, a write setting flag indicating whether each logical block is set as the first area management block or the second area management block, and the number of sectors The number of times of writing data with the number of sectors smaller than the set value (hereinafter referred to as “the number of small capacity writing instructions”) is written. The write setting flag written in the small capacity write management table and the small capacity write instruction count are associated with each LBN. The write setting flag “0” indicates that the logical block is set as the first area management block, and the write setting flag “1” indicates that the logical block is set as the second area management block. It shows that. This small capacity write management table is updated on the SRAM 8 and stored in the flash memory 2. When this small-capacity write management table is not stored in the flash memory 2, the small-capacity write management table in which the write setting flag is set to “0” and the small-capacity write instruction count is set to “0” (FIG. 4A )) Is created on the SRAM 8, and the created small-capacity write management table is stored in the flash memory 2.

ホストシステム4から書き込みを指示するアクセス指示が与えられたとき、つまり、ホストインターフェースレジスタに「データの書き込みを指示する外部コマンド」が書き込まれたとき、メモリコントローラ3は、その外部コマンドと共にホストインターフェースレジスタに書き込まれた「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」がセクタ数設定値より小さいか否かを判断する。セクタ数設定値より小さいと判断した場合、メモリコントローラ3は、更に、その外部コマンドに対応するデータの書き込み先の領域が属する論理ブロックを特定する。つまり、この処理では、セクタ数設定値より小さいセクタ数のデータの書き込みが指示された領域が属する論理ブロックが特定される。例えば、セクタ数設定値が“4”の場合に、ホストインターフェースレジスタにデータの書き込みを指示する外部コマンドと共に、先頭データの書き込みを指示するLBAとして“512”が、データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)として“1”が書き込まれたときは、LBN#2の論理ブロックがセクタ数設定値より小さいセクタ数のデータの書き込みが指示された領域が属する論理ブロックとして特定される。   When an access instruction for instructing writing is given from the host system 4, that is, when an "external command for instructing data writing" is written in the host interface register, the memory controller 3 sends the host interface register together with the external command. It is determined whether or not “the number of sectors in the area in which data is written (the number of sectors corresponding to the capacity of the data to be written)” written in is smaller than the sector number setting value. If it is determined that the value is smaller than the sector number setting value, the memory controller 3 further specifies the logical block to which the data write destination area corresponding to the external command belongs. That is, in this process, the logical block to which the area instructed to write the data having the sector number smaller than the sector number setting value belongs is specified. For example, when the sector number setting value is “4”, “512” is set as the LBA for instructing the writing of the head data together with the external command for instructing the host interface register to write the data. When “1” is written as the number of sectors corresponding to the capacity of the data to be written), the logical block of LBN # 2 is the logical block to which the area instructed to write the data with the sector number smaller than the sector number setting value belongs. Identified.

小容量書き込み管理テーブルは、セクタ数設定値より小さいセクタ数のデータの書き込みが指示された領域が属する論理ブロックが特定されたときに更新される。この更新処理では、小容量書き込み管理テーブル上の、セクタ数設定値より小さいセクタ数のデータの書き込みが指示された領域が属する論理ブロックのLBNに関連付けられている小容量書き込み指示回数が1回増やされる。例えば、セクタ数設定値より小さいセクタ数のデータの書き込みが指示された領域が属する論理ブロックがLBN#2の論理ブロックである場合に、小容量書き込み管理テーブル上のLBN#2に関連付けられている小容量書き込み指示回数が“10”であったとすれば、その小容量書き込み指示回数が“11”に書き換えられる。   The small-capacity write management table is updated when a logical block to which an area instructed to write data having a sector number smaller than the sector number set value belongs is specified. In this update process, the small-capacity write instruction count associated with the LBN of the logical block to which the area instructed to write data having a sector number smaller than the sector count setting value on the small-capacity write management table is increased by one. It is. For example, when the logical block to which the area for which the writing of data with the number of sectors smaller than the sector number setting value belongs is the logical block of LBN # 2, it is associated with LBN # 2 on the small capacity write management table. If the small capacity write instruction count is “10”, the small capacity write instruction count is rewritten to “11”.

本実施の形態では、小容量書き込み管理テーブル上の小容量書き込み指示回数に対しても閾値(以下、「書き込み回数設定値」と言う)が設けられている。そして、小容量書き込み管理テーブル上のいずれかの小容量書き込み指示回数が書き込み回数設定値以上になったときには、その小容量書き込み指示回数に関連付けられているLBNの論理ブロックの設定が、第1の領域管理ブロックから第2の領域管理ブロックに変更される。また、その論理ブロックのLBNに関連付けられている書き込み設定フラグが“0”から“1”に書き換えられる。例えば、書き込み回数設定値が“128”に設定されている場合に、LBN#2に関連付けられている小容量書き込み指示回数が“128”に達したときには、LBN#2の論理ブロックの設定が第1の領域管理ブロックから第2の領域管理ブロックに変更される。また、LBN#2に関連付けられている書き込み設定フラグが“0”から“1”に書き換えられる(図4(b)参照)。   In the present embodiment, a threshold (hereinafter referred to as “write count setting value”) is also provided for the small-capacity write instruction count on the small-capacity write management table. When any of the small-capacity write instruction counts on the small-capacity write management table is equal to or greater than the write count setting value, the setting of the logical block of the LBN associated with the small-capacity write instruction count is the first The area management block is changed to the second area management block. Further, the write setting flag associated with the LBN of the logical block is rewritten from “0” to “1”. For example, when the write count setting value is set to “128” and the small-capacity write instruction count associated with LBN # 2 reaches “128”, the logical block setting of LBN # 2 is set to the first. The first area management block is changed to the second area management block. Further, the write setting flag associated with LBN # 2 is rewritten from “0” to “1” (see FIG. 4B).

次に、ファイル管理領域に割り当てられたLBAの範囲が、ホストシステム4側で変更された場合について説明する。このような変更が行われた場合、ファイル管理領域に割り当てられたLBAの範囲に対応する論理セクタ領域を含んでいた論理ブロックが、そのLBAの範囲に対応する論理セクタ領域を含まない論理ブロックになってしまうことがある。つまり、ファイル管理領域に割り当てられたLBAの範囲が変更された場合には、セクタ数設定値より小さいセクタ数のデータの書き込みが指示される領域が属する論理ブロックが変わってしまうことがある。このような場合、第2の領域管理ブロックに設定されている論理ブロックに対応する物理ブロック対して、クラスタのサイズ(セクタ数)より小さい単位でのデータの書き込みが行われなくなる。一方、第1の領域管理ブロックに設定されている論理ブロックに対応する物理ブロック対して、クラスタのサイズ(セクタ数)より小さい単位でのデータの書き込みが行われるようになる。   Next, a case where the LBA range assigned to the file management area is changed on the host system 4 side will be described. When such a change is made, a logical block that includes a logical sector area corresponding to the LBA range allocated to the file management area becomes a logical block that does not include a logical sector area corresponding to the LBA range. It may become. That is, when the LBA range assigned to the file management area is changed, the logical block to which the area instructed to write data having a sector number smaller than the sector number setting value may change. In such a case, data is not written in units smaller than the cluster size (number of sectors) for the physical block corresponding to the logical block set in the second area management block. On the other hand, data is written in units smaller than the cluster size (number of sectors) to the physical block corresponding to the logical block set in the first area management block.

ファイル管理領域に割り当てられたLBAの範囲が変更されたことにより、そのLBAの範囲に対応する論理セクタ領域を含まなくなってしまった論理ブロックについては、第1の領域管理ブロックから第2の領域管理ブロックに設定が変更される必要がある。例えば、ファイル管理領域に割り当てられたLBAの範囲が、#512〜#767の範囲から#768〜#1023の範囲に変更された場合、LBN#2の論理ブロックの設定が第2の領域管理ブロックから第1の領域管理ブロックに変更される必要がある。   For logical blocks that no longer include a logical sector area corresponding to the LBA range due to a change in the LBA range assigned to the file management area, the first area management block to the second area management block Settings need to be changed to block. For example, when the range of the LBA allocated to the file management area is changed from the range of # 512 to # 767 to the range of # 768 to # 1023, the logical block setting of LBN # 2 is set to the second area management block Need to be changed to the first area management block.

従って、メモリコントローラ3は、ファイル管理領域に割り当てられたLBAの範囲に対応する論理セクタ領域を含まなくなってしまった論理ブロックを特定し、その論理ブロックの設定を、第2の領域管理ブロックから第1の領域管理ブロックに変更する。そして、メモリコントローラ3は、論理ブロックの設定を第2の領域管理ブロックから第1の領域管理ブロックに変更した場合は、その論理ブロックに対応する物理ブロックに記憶されているデータを、別の物理ブロック内の物理ページにLPNの順番で再度書き込む(コピーする)。つまり、論理ページと物理ページの対応関係が固定されている場合のLPNとPPNの対応関係(図3(b)参照)を満たすように、その論理ブロックに対応するデータが別の物理ブロックに再度書き込まれる。なお、その別の物理ブロック(コピー先の物理ブロック)は、その論理ブロックに対応していた物理ブロック(コピー元の物理ブロック)に代えて、その論理ブロックに割り当てられる。   Therefore, the memory controller 3 identifies the logical block that no longer includes the logical sector area corresponding to the range of the LBA assigned to the file management area, and sets the logical block from the second area management block to the second area management block. Change to 1 area management block. Then, when the setting of the logical block is changed from the second area management block to the first area management block, the memory controller 3 transfers the data stored in the physical block corresponding to the logical block to another physical block. Rewrite (copy) the physical pages in the block in the order of LPN. That is, the data corresponding to the logical block is transferred again to another physical block so as to satisfy the correspondence between LPN and PPN (see FIG. 3B) when the correspondence between the logical page and the physical page is fixed. Written. The other physical block (copy destination physical block) is assigned to the logical block instead of the physical block corresponding to the logical block (copy source physical block).

次に、図4に示したような小容量書き込み管理テーブルを用いて、メモリコントローラ3が、ファイル管理領域に割り当てられたLBAの範囲に対応する論理セクタ領域を含まなくなってしまった論理ブロックを特定し、その論理ブロックの設定を第2の領域管理ブロックから第1の領域管理ブロックに変更する動作について説明する。この例では、メモリコントローラ3が、所定期間毎(例えば、ホストシステムからデータの書き込み指示を所定回数与えられる毎)に、小容量書き込み管理テーブル上の全ての小容量書き込み指示回数を“0”に戻すリセット処理を実行する(図4(c)参照)。このリセット処理を実行する際に、それぞれLBNに関連付けられている小容量書き込み指示回数は、所定期間中にセクタ数設定値より小さいセクタ数のデータの書き込みが指示され回数に対応するため、リセット処理を実行する際に小容量書き込み指示回数が“0”であった場合は、所定期間中にセクタ数設定値より小さいセクタ数のデータの書き込みが指示されていなかったことになる。   Next, using the small capacity write management table as shown in FIG. 4, the memory controller 3 identifies the logical block that no longer includes the logical sector area corresponding to the LBA range allocated to the file management area. An operation for changing the setting of the logical block from the second area management block to the first area management block will be described. In this example, the memory controller 3 sets all the small-capacity write instruction counts on the small-capacity write management table to “0” every predetermined period (for example, every time a data write instruction is given from the host system). A reset process for returning is executed (see FIG. 4C). When executing this reset process, the number of small-capacity write instructions associated with each LBN corresponds to the number of data write instructions with a sector number smaller than the sector number set value during a predetermined period. When the small capacity write instruction count is “0” when executing the above, it means that the writing of data having a sector number smaller than the sector number set value has not been instructed during the predetermined period.

メモリコントローラ3は、このリセット処理を実行する際に、書き込み設定フラグが“1”に設定されているLBNに関連付けられている小容量書き込み指示回数を参照し、小容量書き込み指示回数が“0”であった場合は、そのLBNの書き込み設定フラグを“0”に変更する。メモリコントローラ3がこのように動作することにより、第2の領域管理ブロックに設定されているいずれかの論理ブロックについて、所定期間中にセクタ数設定値より小さいセクタ数のデータの書き込みが指示されなかったときに、その論理ブロックの設定が、第2の領域管理ブロックから第1の領域管理ブロックに変更される。   When executing the reset process, the memory controller 3 refers to the small-capacity write instruction count associated with the LBN whose write setting flag is set to “1”, and the small-capacity write instruction count is “0”. If it is, the write setting flag of the LBN is changed to “0”. As a result of the memory controller 3 operating in this way, any logical block set in the second area management block is not instructed to write data having a sector number smaller than the sector number set value during a predetermined period. The setting of the logical block is changed from the second area management block to the first area management block.

尚、リセット処理を実行する際に、書き込み設定フラグが“1”に設定されているLBNに関連付けられている小容量書き込み指示回数が、予め定められていた回数より少なかった場合に、そのLBNの書き込み設定フラグが“0”に変更されるようにしてもよい。このようにした場合には、第2の領域管理ブロックに設定されているいずれかの論理ブロックについて、所定期間中にセクタ数設定値より小さいセクタ数のデータの書き込みが指示された回数が所定回数より少なかったときに、その論理ブロックの設定が、第2の領域管理ブロックから第1の領域管理ブロックに変更される。論理ブロックの設定が第2の領域管理ブロックから第1の領域管理ブロックに変更されたときには、その論理ブロックに対応するデータが、論理ページと物理ページの対応関係が固定されている場合のLPNとPPNの対応関係を順番で(本実施の形態では、LPNの順番で)、その論理ブロックに割り当てられた物理ブロックに書き込まれる。   When the reset process is executed, if the number of small-capacity write instructions associated with the LBN for which the write setting flag is set to “1” is less than the predetermined number, the LBN The write setting flag may be changed to “0”. In this case, for any one of the logical blocks set in the second area management block, the number of times that writing of data with a sector number smaller than the sector number set value is instructed during the predetermined period is the predetermined number of times. When the number is smaller, the setting of the logical block is changed from the second area management block to the first area management block. When the setting of the logical block is changed from the second area management block to the first area management block, the data corresponding to the logical block includes the LPN when the correspondence between the logical page and the physical page is fixed. The correspondence relationship of the PPN is written in order (in this embodiment, in the order of LPN) to the physical block assigned to the logical block.

尚、いずれかの論理ブロックが割り当てられている物理ブロック内の冗長領域には、その物理ブロックに対応する論理ブロックに関する書き込み設定フラグ及び小容量書き込み指示回数が書き込まれることが好ましい。ここで、本実施の形態を説明するために必要な範囲で、この冗長領域及びこの冗長領域に書き込まれる情報について説明する。物理ブロックに含まれる各物理ページは、通常、ホストシステムから与えられるデータが書き込まれるユーザー領域とその他のデータが書き込まれる冗長領域に分けて使用される。ユーザー領域に記憶されるデータは、通常、セクタ単位で誤り訂正符号(ECC:Error Correcting Code)が生成され、その誤り訂正符号は冗長領域に書き込まれる。従って、図5に示したように冗長領域20は、物理ブロック全体に関する情報又は各物理ページに関する情報が書き込まれる共通冗長領域21と、ユーザー領域のセクタ単位の領域にそれぞれ割り当てられている分割冗長領域22に分けて使用される。上記の書き込み設定フラグは物理ブロック内の先頭物理ページの共通冗長領域21又は各物理ページの共通冗長領域21に書き込まれることが好ましい。小容量書き込み指示回数については、各物理ページの共通冗長領域21又は分割冗長領域22に書き込まれることが好ましい。   In addition, it is preferable that a write setting flag and a small-capacity write instruction count regarding the logical block corresponding to the physical block are written in the redundant area in the physical block to which any logical block is allocated. Here, the redundant area and the information written in the redundant area will be described to the extent necessary for explaining the present embodiment. Each physical page included in the physical block is normally used by being divided into a user area in which data given from the host system is written and a redundant area in which other data is written. For data stored in the user area, an error correcting code (ECC) is usually generated for each sector, and the error correcting code is written in the redundant area. Therefore, as shown in FIG. 5, the redundant area 20 includes a common redundant area 21 in which information on the entire physical block or information on each physical page is written, and a divided redundant area allocated to each sector area of the user area. 22 are used. The write setting flag is preferably written in the common redundant area 21 of the first physical page in the physical block or the common redundant area 21 of each physical page. The number of small capacity write instructions is preferably written in the common redundant area 21 or the divided redundant area 22 of each physical page.

次に、本実施の形態におけるメモリコントローラ3の動作を、図6のフローチャートを参照して説明する。   Next, the operation of the memory controller 3 in the present embodiment will be described with reference to the flowchart of FIG.

ステップ1(S1):
メモリコントローラ3は、ホストシステムからアクセス指示を与えられえたときに、そのアクセス指示が、書き込みの指示であるか否かを判断する。つまり、ホストシステムから与えられた外部コマンドが書き込みコマンドであるか否かを判断する。ホストシステムから与えられた外部コマンドが書き込みコマンドである場合(S1:Yes)は、ステップ2(S2)に進む。
Step 1 (S1):
When an access instruction can be given from the host system, the memory controller 3 determines whether the access instruction is a write instruction. That is, it is determined whether or not the external command given from the host system is a write command. If the external command given from the host system is a write command (S1: Yes), the process proceeds to step 2 (S2).

ステップ2(S2):
メモリコントローラ3は、セクタ数設定値kより小さいセクタ数のデータの書き込みが指示されたか否かを判断する。つまり、ホストシステムから書き込みコマンドと共に与えられる「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」の値がk未満であるか否かを判断する。「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」の値がk未満である場合(S2:Yes)は、ステップ3(S3)に進む。
Step 2 (S2):
The memory controller 3 determines whether or not an instruction to write data having a sector number smaller than the sector number setting value k is instructed. That is, it is determined whether or not the value of “the number of sectors in the data writing area (the number of sectors corresponding to the capacity of the data to be written)” given together with the write command from the host system is less than k. When the value of “the number of sectors in the data writing area (the number of sectors corresponding to the capacity of the data to be written)” is less than k (S2: Yes), the process proceeds to step 3 (S3).

ステップ3(S3):
メモリコントローラ3は、ホストシステムからの書き込みの指示で指定された、データの書き込み先の領域が属する論理ブロックを特定する。つまり、メモリコントローラ3は、ホストシステムから書き込みコマンドと共に与えられる「先頭データの書き込みを指示するLBA」及び「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」に基づいて、データの書き込み先の領域に対応するLBAの範囲を求める。そして、このLBAの範囲の論理セクタ領域が含まれる論理ブロックを特定する。
Step 3 (S3):
The memory controller 3 specifies the logical block to which the data write destination area specified by the write instruction from the host system belongs. That is, the memory controller 3 is based on the “LBA instructing writing of head data” and “the number of sectors in the area to write data (the number of sectors corresponding to the capacity of the data to be written)” given together with the write command from the host system. The LBA range corresponding to the data write destination area is obtained. Then, a logical block including a logical sector area in the LBA range is specified.

ステップ4(S4):
メモリコントローラ3は、小容量書き込み管理テーブルを更新する。つまり、メモリコントローラ3は、ステップ3(S3)で特定された論理ブロックのLBNに関連付けられている小容量書き込み指示回数の値を1増加させる。
Step 4 (S4):
The memory controller 3 updates the small capacity write management table. That is, the memory controller 3 increases the value of the small-capacity write instruction count associated with the LBN of the logical block specified in step 3 (S3) by one.

ステップ5(S5):
メモリコントローラ3は、ステップ3(S3)で特定された論理ブロック内の領域に対するセクタ数設定値k(kは自然数)より小さいセクタ数のデータの書き込み指示回数が、書き込み回数設定値n(nは自然数)に達したか否かを判断する。つまり、メモリコントローラ3は、ステップ4(S4)で小容量書き込み管理テーブルを更新したことにより、ステップ3(S3)で特定された論理ブロックのLBNに関連付けられている小容量書き込み指示回数の値がnに達したか否かを判断する。ステップ3(S3)で特定された論理ブロックのLBNに関連付けられている小容量書き込み指示回数の値がnに達している場合(S5:Yes)は、ステップ6(S6)に進む。
Step 5 (S5):
The memory controller 3 determines that the number of write instructions for the sector number smaller than the sector number setting value k (k is a natural number) for the area in the logical block specified in step 3 (S3) is the write number setting value n (n is It is determined whether or not the natural number has been reached. In other words, the memory controller 3 updates the small capacity write management table in step 4 (S4), so that the value of the small capacity write instruction count associated with the LBN of the logical block specified in step 3 (S3) is changed. It is determined whether or not n has been reached. When the value of the small capacity write instruction count associated with the LBN of the logical block identified in step 3 (S3) has reached n (S5: Yes), the process proceeds to step 6 (S6).

ステップ6(S6):
メモリコントローラ3は、ステップ3(S3)で特定された論理ブロックに対応する書き込み設定フラグが“0”から“1”に変更される。つまり、ステップ3(S3)で特定された論理ブロックの設定が、第1の領域管理ブロックから第2の領域管理ブロックに変更される。
Step 6 (S6):
In the memory controller 3, the write setting flag corresponding to the logical block specified in step 3 (S3) is changed from “0” to “1”. That is, the setting of the logical block specified in step 3 (S3) is changed from the first area management block to the second area management block.

以上が、本実施の形態におけるメモリコントローラ3の動作の説明である。   The above is the description of the operation of the memory controller 3 in the present embodiment.

尚、図6には格別示していないが、S2:Noであれば、データの書き込み先の領域を含んだ論理ブロックは、第1の領域管理ブロックとして設定されている論理ブロックであるため、書込み対象のデータが、LPNに依存しない順番で、その論理ブロックに対応した物理ブロックに書き込まれる。また、S5:Noの場合、S3で特定された論理ブロックが、第1の領域管理ブロックとして設定されている論理ブロックであれば、書込み対象のデータが、LPNに依存しない順番で、その論理ブロックに対応した物理ブロックに書き込まれ、一方、S3で特定された論理ブロックが、第2の領域管理ブロックとして設定されている論理ブロックであれば、書込み対象のデータが、LPNの順番で、その論理ブロックに対応した物理ブロックに書き込まれる。   Although not specifically shown in FIG. 6, if S2: No, the logical block including the data write destination area is the logical block set as the first area management block, and thus the write operation is performed. The target data is written to the physical block corresponding to the logical block in an order that does not depend on the LPN. In the case of S5: No, if the logical block specified in S3 is a logical block set as the first area management block, the logical block is written in the order in which the data to be written does not depend on the LPN. On the other hand, if the logical block specified in S3 is the logical block set as the second area management block, the data to be written is the logical block in the LPN order. It is written in the physical block corresponding to the block.

また、セクタ数設定値kの値、書き込み回数設定値nの値、論理ブロックに含まれる領域の容量及び各論理ブロックに割り当てる物理ブロックの個数等は適宜設定することができる。また、上述のように、所定期間毎(例えば、ホストシステム4からデータの書き込み指示を所定回数与えられる毎)に小容量書き込み管理テーブル上の全ての小容量書き込み指示回数が“0”に戻されるようにしたい場合には、ホストシステム4からデータの書き込み指示される毎にカウントアップされるカウンタを設け、そのカウント値が所定の値に達したときに小容量書き込み管理テーブル上の全ての小容量書き込み指示回数が“0”に戻されるようにすればよい。   Further, the value of the sector number setting value k, the value of the write count setting value n, the capacity of the area included in the logical block, the number of physical blocks allocated to each logical block, and the like can be set as appropriate. Further, as described above, every small capacity write instruction count on the small capacity write management table is returned to “0” every predetermined period (for example, every time a data write instruction is given from the host system 4 a predetermined number of times). In order to do so, a counter that is counted up every time the host system 4 is instructed to write data is provided, and when the count value reaches a predetermined value, all the small capacities on the small capacity write management table are provided. The number of write instructions may be returned to “0”.

以上、本発明の実施の形態を説明したが、これは本発明を説明するための例示であって、本発明の範囲をこの実施の形態にのみ限定する趣旨ではない。本発明の要旨を逸脱しない範囲内において種々変更を加え得ることは勿論である。   Although the embodiment of the present invention has been described above, this is an example for explaining the present invention, and the scope of the present invention is not limited to this embodiment. Of course, various modifications can be made without departing from the scope of the present invention.

例えば、上述の実施の形態では、小容量書き込み管理テーブルを用いて小容量書き込み指示回数(セクタ数設定値より小さいセクタ数のデータの書き込みが指示された回数)を管理していたが、他の方法でこの小容量書き込み指示回数が管理されてもよい。例えば、メモリコントローラ3は、各物理ブロックに対してデータの書き込みを行う毎に、その物理ブロックの冗長領域に最新の小容量書き込み指示回数を書き込むようにすれば、物理ブロックの冗長領域に書き込まれている小容量書き込み指示回数に基づいて、セクタ数設定値より少ない領域を指定したデータの書き込みが所定回数指示された論理ブロックが特定される。   For example, in the above-described embodiment, the small-capacity write management table is used to manage the small-capacity write instruction count (the number of times the data write of the sector number smaller than the sector number setting value is instructed). The number of small capacity write instructions may be managed by a method. For example, each time data is written to each physical block, if the memory controller 3 writes the latest small-capacity write instruction count in the redundant area of the physical block, the data is written in the redundant area of the physical block. Based on the small-capacity write instruction count, the logical block that is instructed to write data specifying an area smaller than the sector number set value a predetermined number of times is specified.

また、セクタ数設定値より小さいセクタ数のデータの書き込みが指示される毎に、その指示に対応する「先頭データの書き込みを指示するLBA」及び「データを書き込む領域のセクタ数(書き込むデータの容量に対応するセクタ数)」のデータを累積的に記録してき、このデータが所定回数分蓄えられたときに、このデータを集計し、セクタ数設定値より少ない領域を指定したデータの書き込みが所定回数指示された論理ブロックが特定されるようにしてもよい。   In addition, every time an instruction to write data with a sector number smaller than the sector number setting value is given, the “LBA instructing the writing of head data” and “the number of sectors in the data writing area (capacity of data to be written) corresponding to the instruction are written. Data is cumulatively recorded, and when this data is accumulated a predetermined number of times, this data is aggregated, and data is written a specified number of times specifying an area smaller than the sector number setting value. The instructed logical block may be specified.

また、実施の形態では、小容量アクセス領域(セクタ数設定値より小さいセクタ数のデータの書き込みが指示される領域)が、ディレクトリ領域、FAT領域又はMFT(Master File Table)領域等のファイル管理領域であるものとして説明したが、小容量領域がファイル管理領域でなくても本発明を適用することができる。   In the embodiment, the small-capacity access area (the area instructed to write data with the number of sectors smaller than the sector number setting value) is a file management area such as a directory area, FAT area, or MFT (Master File Table) area. However, the present invention can be applied even if the small capacity area is not the file management area.

本発明の実施の形態によるフラッシュメモリシステムの概略構成を示すブロック図である。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 for demonstrating the correspondence of the address space by the side of a host system, and the address space in flash memory. 論理ページと物理ページとの対応関係を説明するための図である。It is a figure for demonstrating the correspondence of a logical page and a physical page. 小容量書き込み管理テーブルを説明するための図である。It is a figure for demonstrating a small capacity write management table. 冗長領域に書き込まれる情報を説明するための図である。It is a figure for demonstrating the information written in a redundant area. 本発明の実施の形態によるメモリコントローラの動作を説明するためのフローチャートである。4 is a flowchart for explaining an operation of the memory controller according to the embodiment of the present invention.

符号の説明Explanation of symbols

1…フラッシュメモリシステム、2…フラッシュメモリ、3…メモリコントローラ 1 ... flash memory system, 2 ... flash memory, 3 ... memory controller

Claims (5)

ホストシステムから与えられるアクセス指示に従って、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリに対するアクセスを制御するメモリコントローラであって、
前記アクセス指示により指定される論理アドレスが割り当てられているセクタ単位の領域が複数個含まれる所定セクタ数の領域を論理ブロックとして管理する論理ブロック管理手段と、
前記論理ブロックに対して、前記フラッシュメモリ内の所定個数の物理ブロックを割り当てる記憶領域割り当て手段と、
それぞれの前記論理ブロック内の領域に対する所定セクタ数より少ない容量の領域を指定したデータの書き込みが前記アクセス指示により指示される回数に基づいて、前記論理ブロックの種別を判断する論理ブロック種別判断手段と、
前記アクセス指示により指定された書き込み先の領域が属する前記論理ブロックに対応する物理ブロックにデータを書き込むデータ書き込み手段と
を備え、
前記論理ブロック種別判断手段が、前記回数が所定回数未満の前記論理ブロックを第1の論理ブロックと判断し、前記回数が所定回数以上の前記論理ブロックを第2の論理ブロックと判断し、
前記データ書き込み手段は、前記第1の論理ブロックと判断された前記論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番でデータを書き込み、前記第2の論理ブロックと判断された論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番に依存せずにデータを書き込む
ことを特徴とするメモリコントローラ。
A memory controller that controls access to a flash memory that is erased in units of physical blocks including a plurality of physical pages in accordance with an access instruction given from a host system,
Logical block management means for managing, as a logical block, an area having a predetermined number of sectors including a plurality of areas in sector units to which a logical address designated by the access instruction is assigned;
Storage area allocating means for allocating a predetermined number of physical blocks in the flash memory to the logical block;
Logical block type determination means for determining the type of the logical block based on the number of times data write specifying a region having a capacity smaller than a predetermined number of sectors with respect to the region in each logical block is instructed by the access instruction; ,
Data writing means for writing data to a physical block corresponding to the logical block to which the write destination area designated by the access instruction belongs,
The logical block type determining means determines the logical block whose number is less than a predetermined number as a first logical block, and determines the logical block whose number is a predetermined number or more as a second logical block,
The data writing means writes data in the order of the logical addresses to the physical block corresponding to the logical block determined to be the first logical block, and the logical block determined to be the second logical block. A memory controller, wherein data is written to a physical block corresponding to a block without depending on the order of the logical addresses.
前記論理アドレスの順番でデータが書き込まれていない物理ブロック内の記憶データを、別の物理ブロックに前記論理アドレスの順番で書き写すデータ複写手段を更に備え
前記回数が所定回数以上になったいずれかの前記論理ブロック内の領域に対して、前記所定セクタ数より少ない容量の領域を指定したデータの書き込みが所定期間指示されなかったときに、前記論理ブロック種別判断手段は、前記いずれかの前記論理ブロックを第1の論理ブロックと判断し、前記データ複写手段は、前記いずれかの前記論理ブロックに対応する物理ブロック内の記憶データを、別の物理ブロックに前記論理アドレスの順番で書き写す
ことを特徴とする請求項1に記載のメモリコントローラ。
Data copy means for copying storage data in a physical block in which data is not written in the order of the logical addresses to another physical block in the order of the logical addresses is further provided. The logical block type determining means, when no writing of data designating an area having a capacity smaller than the predetermined number of sectors is instructed for a predetermined period of time in the logical block, And the data copying means writes the storage data in the physical block corresponding to any one of the logical blocks to another physical block in the order of the logical addresses. The memory controller according to claim 1.
請求項1又は2に記載のメモリコントローラと、
前記メモリコントローラによってアクセスされるフラッシュメモリと
を備えるフラッシュメモリシステム。
A memory controller according to claim 1 or 2,
And a flash memory system accessed by the memory controller.
ホストシステムから与えられるアクセス指示に従って、複数個の物理ページを含む物理ブロック単位で消去が行われるフラッシュメモリの制御方法であって、
前記アクセス指示により指定される論理アドレスが割り当てられているセクタ単位の領域が複数個含まれる所定セクタ数の領域を論理ブロックとして管理する論理ブロック管理ステップと、
前記論理ブロックに対して、前記フラッシュメモリ内の所定個数の物理ブロックを割り当てる記憶領域割り当てステップと、
それぞれの前記論理ブロック内の領域に対する所定セクタ数より少ない容量の領域を指定したデータの書き込みが前記アクセス指示により指示される回数に基づいて、前記論理ブロックの種別を判断する論理ブロック種別判断ステップと、
前記アクセス指示により指定された書き込み先の領域が属する前記論理ブロックに対応する物理ブロックにデータを書き込むデータ書き込みステップと
を有し、
前記書き込み方式判断ステップでは、前記回数が所定回数未満の前記論理ブロックを第1の論理ブロックと判断し、前記回数が所定回数以上の前記論理ブロックを第2の論理ブロックと判断し、
前記データ書き込みステップでは、前記第1の論理ブロックと判断された前記論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番でデータを書き込み、前記第2の論理ブロックと判断された論理ブロックに対応する物理ブロックに対しては、前記論理アドレスの順番に依存せずにデータを書き込む
ことを特徴とするフラッシュメモリの制御方法。
A flash memory control method in which erasing is performed in units of physical blocks including a plurality of physical pages in accordance with an access instruction given from a host system,
A logical block management step of managing, as a logical block, an area having a predetermined number of sectors including a plurality of areas in units of sectors to which a logical address designated by the access instruction is assigned;
A storage area allocation step for allocating a predetermined number of physical blocks in the flash memory to the logical block;
A logical block type determination step for determining a type of the logical block based on the number of times data write specifying a region having a capacity smaller than a predetermined number of sectors to the region in each logical block is instructed by the access instruction; ,
A data writing step of writing data to a physical block corresponding to the logical block to which the write destination area designated by the access instruction belongs,
In the writing method determining step, the logical block having the number of times less than a predetermined number is determined as a first logical block, and the logical block having the number of times being a predetermined number or more is determined as a second logical block,
In the data write step, data is written to the physical block corresponding to the logical block determined as the first logical block in the order of the logical addresses, and the logical block determined as the second logical block A flash memory control method, wherein data is written to a physical block corresponding to a block without depending on the order of the logical addresses.
前記論理アドレスの順番でデータが書き込まれていない物理ブロック内の記憶データを、別の物理ブロックに前記論理アドレスの順番で書き写すデータ複写ステップを更に備え
前記回数が所定回数以上になったいずれかの前記論理ブロック内の領域に対して、前記所定セクタ数より少ない容量の領域を指定したデータの書き込みが所定期間指示されなかったときに、前記書き込み方式判断ステップにより、前記いずれかの前記論理ブロックが第1の論理ブロックと判断され、前記データ複写ステップにより、前記いずれかの前記論理ブロックに対応する物理ブロック内の記憶データが、別の物理ブロックに前記論理アドレスの順番で書き写される
ことを特徴とする請求項4に記載のフラッシュメモリの制御方法。
A data copying step of copying storage data in a physical block in which data is not written in the logical address order to another physical block in the logical address order; When writing of data designating an area having a capacity smaller than the predetermined number of sectors is not instructed for a predetermined period of time in the logical block, the write method determination step causes any one of the logical blocks to be It is determined that the logical block is a first logical block, and the data copying step causes the storage data in the physical block corresponding to any one of the logical blocks to be copied to another physical block in the order of the logical addresses. 5. The method of controlling a flash memory according to claim 4,
JP2008158120A 2008-06-17 2008-06-17 Memory controller, flash memory system equipped with memory controller, and control method for flash memory Pending JP2009301491A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008158120A JP2009301491A (en) 2008-06-17 2008-06-17 Memory controller, flash memory system equipped with memory controller, and control method for flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008158120A JP2009301491A (en) 2008-06-17 2008-06-17 Memory controller, flash memory system equipped with memory controller, and control method for flash memory

Publications (1)

Publication Number Publication Date
JP2009301491A true JP2009301491A (en) 2009-12-24

Family

ID=41548292

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008158120A Pending JP2009301491A (en) 2008-06-17 2008-06-17 Memory controller, flash memory system equipped with memory controller, and control method for flash memory

Country Status (1)

Country Link
JP (1) JP2009301491A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014147768A1 (en) * 2013-03-19 2014-09-25 富士通株式会社 Control device, control program, and control method

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006221627A (en) * 2005-02-07 2006-08-24 Samsung Electronics Co Ltd Adaptive flash memory control device adopting a plurality of mapping techniques, and flash memory system including the same

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006221627A (en) * 2005-02-07 2006-08-24 Samsung Electronics Co Ltd Adaptive flash memory control device adopting a plurality of mapping techniques, and flash memory system including the same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2014147768A1 (en) * 2013-03-19 2014-09-25 富士通株式会社 Control device, control program, and control method
JPWO2014147768A1 (en) * 2013-03-19 2017-02-16 富士通株式会社 Control device, control program, and control method

Similar Documents

Publication Publication Date Title
JP4844639B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP5087347B2 (en) Semiconductor memory device and method for controlling semiconductor memory device
JP5480913B2 (en) Storage device and memory controller
US20100011154A1 (en) Data accessing method for flash memory and storage system and controller using the same
JP4666080B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4666081B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP5093294B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2018160189A (en) Memory system
JP4743174B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4737223B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2012058770A (en) Memory controller, flash memory system equipped with memory controller and control method of flash memory
JP4488048B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4636005B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4840415B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2012068765A (en) Memory controller, flash memory system with memory controller, and control method of flash memory
JP4513786B2 (en) Memory controller, memory system, and memory control method
JP2005115562A (en) Flash rom controller
JP4434171B2 (en) Memory controller and flash memory system
JP4241741B2 (en) Memory controller and flash memory system
JP2007323159A (en) Memory controller, flash memory system therewith, and method for controlling flash memory
JP2012068764A (en) Memory controller, nonvolatile memory system with memory controller, and control method of nonvolatile memory
JP2009301491A (en) Memory controller, flash memory system equipped with memory controller, and control method for flash memory
JP2021068129A (en) Memory controller and flash memory system
JP3934659B1 (en) Memory controller and flash memory system
JP4636046B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110530

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110607

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110727

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110913