JP4242245B2 - Flash ROM control device - Google Patents

Flash ROM control device Download PDF

Info

Publication number
JP4242245B2
JP4242245B2 JP2003347469A JP2003347469A JP4242245B2 JP 4242245 B2 JP4242245 B2 JP 4242245B2 JP 2003347469 A JP2003347469 A JP 2003347469A JP 2003347469 A JP2003347469 A JP 2003347469A JP 4242245 B2 JP4242245 B2 JP 4242245B2
Authority
JP
Japan
Prior art keywords
flash rom
physical
cluster
block
data
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.)
Expired - Fee Related
Application number
JP2003347469A
Other languages
Japanese (ja)
Other versions
JP2005115561A (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.)
Media Logic Corp
Original Assignee
Media Logic 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 Media Logic Corp filed Critical Media Logic Corp
Priority to JP2003347469A priority Critical patent/JP4242245B2/en
Publication of JP2005115561A publication Critical patent/JP2005115561A/en
Application granted granted Critical
Publication of JP4242245B2 publication Critical patent/JP4242245B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • For Increasing The Reliability Of Semiconductor Memories (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)
  • Read Only Memory (AREA)

Description

本発明は、NAND型フラッシュROM等のフラッシュROMとコンピュータシステム(以下、PCという)との間に配置されるフラッシュROM制御装置に関する。   The present invention relates to a flash ROM control device disposed between a flash ROM such as a NAND flash ROM and a computer system (hereinafter referred to as a PC).

NAND型フラッシュROMは、データの上書きが不可能であって、データ書換えの際にはブロックと呼ばれる単位で一括消去した上で、変更したデータを再度書き込みしなければならないという特徴がある。このようなブロック消去型のフラッシュROMでは、さらに消去保証回数の制限があり、一般には、10の4乗回〜10の5乗回程度の消去を行うと不良ブロック化する。そこで、これを解決してフラッシュROMの長寿命化を図る方法として、FATファイルシステムを採用することが考えられる。このFATファイルシステムでは、データ領域に対するデータの書換えを防ぐことが可能であるが、ファイル管理領域等ある特定の領域に対する書換えが頻繁に発生するために、この部分での消去回数が極端に増え、製品全体としての寿命が短くなってしまう不都合がある。また、ブロック消去には非常に長い処理時間が必要であるために、データの変更ごとにブロック消去を実行してしまうと、書換えに要する処理速度が非常に遅くなってしまう問題がある。   The NAND flash ROM has a feature that data cannot be overwritten, and when data is rewritten, the changed data must be rewritten after being erased in a unit called a block. In such a block erase type flash ROM, there is a further limit on the guaranteed number of erasures. In general, if erasing is performed from the fourth power of 10 to the fifth power of 10, it becomes a defective block. Therefore, it is conceivable to employ a FAT file system as a method for solving this problem and extending the life of the flash ROM. In this FAT file system, it is possible to prevent rewriting of data in the data area. However, since rewriting of a specific area such as a file management area frequently occurs, the number of times of erasure in this part increases extremely. There is an inconvenience that the life of the entire product is shortened. In addition, since a very long processing time is required for block erasure, if block erasure is executed every time data is changed, there is a problem that the processing speed required for rewriting becomes very slow.

そこで、ホストとフラッシュROM間にフラッシュROM制御装置を配置し、この制御装置に論理アドレスと物理アドレスを変換するための論理→物理変換テーブルを設けるとともに、適当なタイミングでガーベージコレクションを行う方法が提案されている。この方法では、フラッシュROM制御装置内に配置される論理→物理変換テーブルによって、同一論理アドレスに対するデータの書換えが発生した場合に、その発生の度に物理アドレスを変えていくことができ、これにより高速化と消去回数の減少を図り、さらに適宜行われるガーベージコレクションによってフラッシュROM内の不要なデータを一定のタイミングで消去することができる(たとえば、特許文献1参照)。
特開2002−32256号公報
Therefore, a method is proposed in which a flash ROM control device is arranged between the host and the flash ROM, and a logical-to-physical conversion table for converting a logical address and a physical address is provided in this control device, and garbage collection is performed at an appropriate timing. Has been. In this method, when data rewrite to the same logical address occurs by the logical-to-physical conversion table arranged in the flash ROM control device, the physical address can be changed every time it occurs. It is possible to increase the speed and reduce the number of times of erasure, and furthermore, unnecessary data in the flash ROM can be erased at a certain timing by appropriate garbage collection (see, for example, Patent Document 1).
JP 2002-32256 A

上記の様に、FATファイルシステムに変えて論理→物理変換テーブルをフラッシュROM制御装置に設けることにより、書換え発生時に空き領域にデータを書き込むことができる。しかしながら、その後に生じる不必要なデータを消去するのにガーベージコレクションを用いているため、その処理のために長時間を要してしまう不都合がある。一般に、ガーベージコレクションは、不必要なデータを探索しながら消去するとともに、データのセクタ間転送を行う処理とテーブルの更新操作を含むために、フラッシュROM全体を対象とするこれらの処理を短時間にすることはほとんど不可能である。また、ガーベージコレクションを起動するタイミングも難しく、ガーベージコレクションを行う間隔が長すぎると空きセクタがなくなってしまって書換えができなくなる可能性があり、また、その間隔が短すぎると全体のスループットが著しく低下してしまう問題がある。   As described above, by providing a logical-to-physical conversion table in the flash ROM control device instead of the FAT file system, data can be written in an empty area when rewriting occurs. However, since garbage collection is used to erase unnecessary data generated thereafter, there is a disadvantage that it takes a long time for the processing. In general, garbage collection erases unnecessary data while searching for it, and includes processing for transferring data between sectors and table update operation. Therefore, these processing for the entire flash ROM can be performed in a short time. It is almost impossible to do. Also, the timing of starting garbage collection is difficult, and if the interval for garbage collection is too long, there is a possibility that empty sectors will be lost and rewriting will not be possible, and if the interval is too short, the overall throughput will be significantly reduced. There is a problem.

そこで、本発明は、同一論理アドレスに対する書換え回数を世代番号で管理することによって、処理の高速化とフラッシュROMの製品寿命を長くすることのできるフラッシュROM制御装置を提供することを目的とする。   SUMMARY OF THE INVENTION An object of the present invention is to provide a flash ROM control device that can increase the processing speed and extend the product life of a flash ROM by managing the number of rewrites to the same logical address by generation number.

本発明のフラッシュROM制御装置は、同一論理アドレスに対する書換え発生回数を世代番号で管理する。すなわち、同一論理アドレスに対する書換えが発生すると、同一論理アドレスに対する物理アドレスが変更され、これが論理→物理変換テーブルに反映されるが、この時の物理アドレスの変更回数を世代番号として記録しておく。   The flash ROM control device of the present invention manages the number of rewrite occurrences for the same logical address with a generation number. That is, when rewriting to the same logical address occurs, the physical address for the same logical address is changed, and this is reflected in the logical → physical conversion table. The number of changes of the physical address at this time is recorded as a generation number.

本発明では、この世代番号管理のために、上記論理→物理変換テーブルに加えて、物理→論理変換テーブルを設ける。この物理→論理変換テーブルは、同一物理アドレスに対する論理アドレスを記憶しており、物理アドレスを論理アドレスに変換するためのテーブルである。   In the present invention, in order to manage this generation number, a physical → logical conversion table is provided in addition to the logical → physical conversion table. This physical-to-logical conversion table stores logical addresses for the same physical address, and is a table for converting physical addresses into logical addresses.

本発明の世代番号管理では、上記世代番号が所定の最大値になった時に、物理→論理変換テーブルを参照して当該論理アドレスに対応する全ての物理アドレスを抽出して、この物理アドレスを無効化する処理を行う。また、その無効化処理の結果、有効エリアの無くなったブロックを見つけるとそのブロックを消去する処理を行う。   In the generation number management of the present invention, when the generation number reaches a predetermined maximum value, all physical addresses corresponding to the logical address are extracted by referring to the physical-to-logical conversion table, and the physical address is invalidated. Perform processing. As a result of the invalidation process, when a block having no valid area is found, the block is erased.

本発明では、このように、論理→物理変換テーブルと物理→論理変換テーブルを設け、また、制御部がこれらのテーブルを参照して世代番号管理を行い、且つ有効エリアの無くなったブロックを見つけた時にそのブロックを消去する処理を行うため、データの書き込み時の高速化を実現でき、且つ、ブロック消去をデータの書換えタイミングとは無関係に適当に行っていくことによりガーベージコレクション処理を頻繁に行う必要がなくなり、これによりフラッシュROMのスループットの向上と長寿命化を図ることができる。   In the present invention, a logical → physical conversion table and a physical → logical conversion table are provided in this way, and the control unit refers to these tables to perform generation number management and find a block with no effective area. Since the process of erasing the block is sometimes performed, it is possible to increase the speed at the time of data writing, and it is necessary to frequently perform the garbage collection process by appropriately performing the block erasure irrespective of the data rewrite timing. As a result, the throughput of the flash ROM can be improved and the life of the flash ROM can be extended.

世代番号は論理アドレスごとに初期値を異ならせることにより、各論理アドレスに対する世代番号が同時に最大値に達するのを防ぐことができる。これにより、一時的な著しいスループットの低下を防ぐことになり、システムの安定性が確保される。   By making the initial value of the generation number different for each logical address, it is possible to prevent the generation number for each logical address from reaching the maximum value at the same time. This prevents a temporary significant decrease in throughput and ensures system stability.

世代番号が最大値になって、その世代番号の論理アドレスに対応する全ての物理アドレスに対する無効化処理が行われると、世代番号を初期値に戻す世代交代処理を行う。こうすることで、世代番号が最大値に達した論理アドレスを初期値から再び使用可能となる。   When the generation number reaches the maximum value and all the physical addresses corresponding to the logical address of the generation number are invalidated, generation change processing is performed to return the generation number to the initial value. By doing so, the logical address whose generation number has reached the maximum value can be used again from the initial value.

本発明によれば、データ書き込み前にブロック消去等の処理を行う必要がなく、未使用エリアへの逐次書き込みができるために書き込みの高速化とフラッシュROMの長寿命化を図ることができる。また、物理→論理変換テーブルを設けて世代番号管理を行うことによって、ガーベージコレクションではない無効化処理による空き領域確保を行うことができるために、システムのスループットを向上することができる。   According to the present invention, it is not necessary to perform processing such as block erasure before data writing, and sequential writing to an unused area can be performed, so that high-speed writing and long life of the flash ROM can be achieved. Also, by providing a physical-to-logical conversion table and performing generation number management, it is possible to secure a free area by invalidation processing that is not garbage collection, thereby improving the system throughput.

図1は、本発明の実施形態であるフラッシュROM制御装置の構成図である。   FIG. 1 is a configuration diagram of a flash ROM control apparatus according to an embodiment of the present invention.

フラッシュROM制御装置1は、ホストI/F10を介してホストに(パーソナルコンピュータ)2と接続され、ホスト2からの要求に応じてフラッシュROM3に対するデータの読み書きを行う。   The flash ROM control device 1 is connected to a host (personal computer) 2 via a host I / F 10 and reads / writes data from / to the flash ROM 3 in response to a request from the host 2.

フラッシュROM制御装置1は、フラッシュROMI/F11を介して、1つ以上のフラッシュROM3と接続されている。このフラッシュROM制御装置1では、フラッシュROM3との接続ラインにおいて、データバスを共有し、制御信号の全て、もしくは一部を、それぞれのフラッシュROMに別々に接続することによって、複数のフラッシュROMと接続することが可能である。   The flash ROM control device 1 is connected to one or more flash ROMs 3 via a flash ROM I / F 11. In this flash ROM control device 1, the data bus is shared in the connection line with the flash ROM 3, and all or part of the control signals are separately connected to each flash ROM, thereby connecting to a plurality of flash ROMs. Is possible.

フラッシュROM制御装置1は、上記I/Fの他、CPU、ROM、RAM、データ転送バッファ、シーケンサ及びECC付加/訂正の各要素を備えている。   In addition to the I / F, the flash ROM control device 1 includes a CPU, a ROM, a RAM, a data transfer buffer, a sequencer, and ECC addition / correction elements.

フラッシュROM3は、ブロック消去型のNAND型フラッシュROMで構成され、データの消去をブロック単位で行う。また、バイトもしくはワード単位でアクセスするランダムアクセス方式ではなく、ページ単位でアクセスするシーケンシャルアクセス方式を採用したものである。   The flash ROM 3 is composed of a block erase type NAND flash ROM, and erases data in units of blocks. In addition, a sequential access method in which access is made in units of pages is adopted instead of a random access method in which access is made in units of bytes or words.

フラッシュROM3の読み込み時には、以下の動作を行うものとする。   The following operations are performed when reading the flash ROM 3.

図2に示すように、最初のコマンド発行時に、リードコマンド(1)を発行し、ページアドレス、カラムアドレスを指定して、リードコマンド(2)を発行する。すると、フラッシュROMはBUSY状態となり、ここで待ち時間が発生する。BUSY状態が解除されると、フラッシュROM内のバッファにページデータが準備されているので、本装置によってこのデータを読み込む。   As shown in FIG. 2, when a first command is issued, a read command (1) is issued, a page address and a column address are designated, and a read command (2) is issued. Then, the flash ROM enters a BUSY state, and a waiting time occurs here. When the BUSY state is released, page data is prepared in the buffer in the flash ROM, and this data is read by this apparatus.

フラッシュROM3への書き込み時には、以下の動作をするものとする。   When writing to the flash ROM 3, the following operation is performed.

図3に示すように、最初のコマンド発行時に、データ入力コマンドを発行し、続いてページアドレス、カラムアドレスを指定する。次に書き込むページデータをフラッシュROMへ転送し、図中のAでプログラムコマンドを発行する。するとフラッシュROMはBUSY状態となり、ここで待ち時間が発生する。フラッシュROM内での書き込み動作が終了すると、BUSY状態が解除され、本装置では図中のBでリードステータスコマンドを発行し、書き込み結果(図中のステータス)を読み込み、エラー判定を行う。   As shown in FIG. 3, when a first command is issued, a data input command is issued, and then a page address and a column address are designated. Next, the page data to be written is transferred to the flash ROM, and a program command is issued at A in the figure. Then, the flash ROM enters the BUSY state, and a waiting time occurs here. When the writing operation in the flash ROM is completed, the BUSY state is released, and the apparatus issues a read status command at B in the drawing, reads the writing result (status in the drawing), and performs error determination.

フラッシュROM3は、消去単位であるブロック単位、及びブロック単位よりも小さな単位(管理単位)であるクラスタ単位、及びフラッシュROMへのコマンドごとの読み書きや書き込み単位であるページ単位、及びホストからの要求のある論理アドレス(LBA)の単位であるセクタ単位で、制御と管理が行われる。これらの単位についての関係は以下の通りである。   The flash ROM 3 is a block unit which is an erase unit, a cluster unit which is a unit (management unit) smaller than the block unit, a page unit which is a read / write or write unit for each command to the flash ROM, and a request from the host. Control and management are performed in units of sectors which are units of a certain logical address (LBA). The relationship between these units is as follows.

単一もしくは複数のセクタによりページが構成される。   A page is composed of a single sector or a plurality of sectors.

単一もしくは複数のページによりクラスタが構成される。   A cluster is composed of a single page or a plurality of pages.

単一もしくは複数のクラスタによりブロックが構成される。   A block is composed of a single cluster or a plurality of clusters.

単一もしくは複数のブロックによりフラッシュROM3が構成される。   The flash ROM 3 is composed of a single block or a plurality of blocks.

セクタは、512バイトのデータと16バイトの冗長部とで構成される。   The sector is composed of 512-byte data and a 16-byte redundant part.

セクタは、2つのECC単位と冗長部で構成される。ECC単位とは、256バイトのデータと、そのデータに対してランダムな1ビットのエラー訂正可能な4バイトのECC情報の集合体である。したがって、1セクタ当たり(それぞれのECC単位において)2ビットまでのランダムエラーを訂正できる。冗長部には、クラスタ情報等の管理情報が含まれている。   The sector is composed of two ECC units and a redundant part. The ECC unit is a collection of 256-byte data and 4-byte ECC information that can be subjected to random 1-bit error correction for the data. Therefore, random errors of up to 2 bits per sector (in each ECC unit) can be corrected. The redundant part includes management information such as cluster information.

通常、クラスタ内には複数のセクタが存在するため、複数の管理情報が含まれている。そのため、多重化された管理情報を取得するため、高信頼性のある管理情報を得ることができる。   Usually, since there are a plurality of sectors in a cluster, a plurality of management information is included. Therefore, since the multiplexed management information is acquired, highly reliable management information can be obtained.

セクタ内の冗長部に書き込むデータは、前記の通り多重化してあるために、同じデータを何度も書き込むことになる。本装置では、ハードウェアのレジスタに一度設定するだけで、フラッシュROMへの転送時に自動的に付加することによって、ソフトウェアのオーバーヘッドを減少させ、高速化している。   Since the data to be written to the redundant part in the sector is multiplexed as described above, the same data is written many times. In this apparatus, the software overhead is reduced and speeded up by setting the hardware register once and automatically adding it to the flash ROM.

本装置では、フラッシュROMへのデータ転送時にECC情報を付加し、フラッシュROMからのデータ転送時にECC情報を読み込み自動的にエラー訂正を行うことによって高信頼性を確保している。   In this apparatus, ECC information is added at the time of data transfer to the flash ROM, and ECC information is read at the time of data transfer from the flash ROM and error correction is automatically performed to ensure high reliability.

本装置では、データ読み込み時において、データ部とECCの組を本装置側に転送する時、図5に示す処理を行う。同図は、従来のデータ転送のタイムチャートと本装置でのデータ転送のタイムチャートを示している。   In the present apparatus, the processing shown in FIG. 5 is performed when transferring the data part and ECC pair to the present apparatus side at the time of data reading. The figure shows a time chart of conventional data transfer and a time chart of data transfer in this apparatus.

すなわち、従来の方式では、512バイトのデータと冗長部を完全に分離して記憶されていたために、512バイトのデータに対するECC情報は、512バイトのデータを読み込んだ後に取得され、その後、ECCによるエラーの判別/訂正が行われ、さらにその後に、ホストへのデータ転送が行われていた。   That is, in the conventional method, 512-byte data and the redundant part are stored in a completely separated manner, so that the ECC information for the 512-byte data is obtained after reading the 512-byte data, and then by ECC. Error determination / correction was performed, and then data transfer to the host was performed.

これに対し、本装置では、256バイトごとにECC情報を書き込んでいるために、Data1と、それに組になって記憶されるECC情報1とを読み込んだ後、そのECCによるエラーの判別/訂正を行い、ホストへのデータ転送を行う。そして、Data1のデータ転送を行っている時に、次のデータであるData2とECC情報2の読み込みを同時に行う。これにより、データの高速な読み込みが可能になる。   On the other hand, since this apparatus writes ECC information every 256 bytes, after reading Data 1 and ECC information 1 stored as a pair with the data, error discrimination / correction based on the ECC is performed. And transfer data to the host. When data 1 is being transferred, the next data Data 2 and ECC information 2 are simultaneously read. This makes it possible to read data at high speed.

本装置では、RAM内に、論理クラスタアドレス(本発明の論理アドレス)からフラッシュROM内の物理クラスタ番号(本発明の物理アドレス)に変換するための論理→物理変換テーブルを備えている。ホスト2からの読み込み要求があった場合に、このテーブルを参照して物理クラスタ番号を獲得する。ホスト2からの書込み要求があった場合には、後述の未使用物理クラスタ番号テーブルを参照して未使用物理クラスタ番号を獲得し、この物理クラスタに対してクラスタデータを書き込む。そして、各テーブルの更新を行う。なお、本装置では、ブロック消去型のフラッシュROMを使用しているが、書き込みを行う前にブロック消去を行うシーケンスは必要ない。上記論理→物理変換テーブルを使用することによって、ホスト2から書き込み対象となるセクタ単位のLBAを含む論理クラスタアドレスに対応する物理クラスタ番号を決定し、この物理クラスタ番号に対する書き込みを行い、同時に論理→物理変換テーブルを更新する。なお、書き込み対象となる物理クラスタ番号は、フラッシュROM内の空きクラスタ領域である。   In the present apparatus, a logical-to-physical conversion table for converting a logical cluster address (logical address of the present invention) into a physical cluster number (physical address of the present invention) in a flash ROM is provided in the RAM. When there is a read request from the host 2, the physical cluster number is obtained by referring to this table. When there is a write request from the host 2, an unused physical cluster number is obtained by referring to an unused physical cluster number table, which will be described later, and cluster data is written to this physical cluster. Then, each table is updated. In this apparatus, a block erase type flash ROM is used, but a sequence for performing block erase before writing is not necessary. By using the logical-to-physical conversion table, the physical cluster number corresponding to the logical cluster address including the LBA for each sector to be written is determined from the host 2, and writing to this physical cluster number is performed simultaneously. Update the physical conversion table. The physical cluster number to be written is an empty cluster area in the flash ROM.

本装置では、世代番号管理(後述)等を行うための物理→論理変換テーブルを備えている。この物理→論理変換テーブルは、フラッシュROM3の物理アドレス(物理クラスタ番号)を論理クラスタアドレス(論理アドレス)に変換するためのテーブルである。   This apparatus includes a physical → logical conversion table for performing generation number management (described later) and the like. This physical → logical conversion table is a table for converting a physical address (physical cluster number) of the flash ROM 3 into a logical cluster address (logical address).

図6は、上記のテーブルを示している。   FIG. 6 shows the above table.

図6において、論理→物理変換テーブルT1は、論理クラスタアドレスをフラッシュROM3の物理クラスタ番号に変換し、物理→論理変換テーブルT2は、上記物理クラスタ番号を論理クラスタアドレスに変換する。   In FIG. 6, a logical-to-physical conversion table T1 converts a logical cluster address into a physical cluster number of the flash ROM 3, and a physical-to-logical conversion table T2 converts the physical cluster number into a logical cluster address.

本装置では、さらにブロックステータステーブル(BST)T3を備えている。このブロックステータステーブルT3は、ブロック内の有効クラスタ(本発明の有効エリアに相当)の数、不良ブロック状態、消去状態を保持している。   This apparatus further includes a block status table (BST) T3. This block status table T3 holds the number of valid clusters (corresponding to the valid area of the present invention), defective block status, and erase status in the block.

図7は、各テーブルの記憶内容について説明する図であり、説明を分かりやすくするために非常に単純化されたものとしている。   FIG. 7 is a diagram for explaining the stored contents of each table, which is very simplified for easy understanding.

本装置は、ホストからの問い合わせに対してフラッシュROMの物理的な最大容量よりも少ない容量を報告する。図7では、フラッシュROMの最大物理クラスタ番号(番地)が7であるため、これよりも小さい値をホスト側に報告する。図では、ホスト側に対して、最大番地が5であることを知らせる。すなわち、論理→物理変換テーブルT1には0〜5のアドレスが用意され、これにより、ホスト側には0〜5のアドレス空間が準備される。また、物理→論理変換テーブルT2は、フラッシュROMと同じアドレス空間を持つものが用意される。ブロックステータステーブルT3は、フラッシュROMのブロック数分だけ用意される。ブロック数は、ここでは4(0〜3)であり、各ブロックは2つのクラスタで構成されている。   This apparatus reports a capacity smaller than the physical maximum capacity of the flash ROM in response to an inquiry from the host. In FIG. 7, since the maximum physical cluster number (address) of the flash ROM is 7, a value smaller than this is reported to the host side. In the figure, the host side is informed that the maximum address is 5. That is, 0 to 5 addresses are prepared in the logical-to-physical conversion table T1, and thereby, an address space of 0 to 5 is prepared on the host side. A physical-to-logical conversion table T2 having the same address space as the flash ROM is prepared. As many block status tables T3 as the number of blocks in the flash ROM are prepared. Here, the number of blocks is 4 (0 to 3), and each block is composed of two clusters.

図7において、最初に、ホスト側でアドレス0に「A」を書き込むコマンドを発行すると、論理→物理変換テーブルT1ではフラッシュROMの空きクラスタ番地である0と対応づけ、さらに、世代番号が初期値1であることを記憶する。この結果、論理→物理変換テーブルT1のアドレス0には「0:1」(0はフラッシュROMの物理クラスタ番号0を示し、1は世代番号の初期値を示す)が記憶される。また、同時に、物理→論理変換テーブルT2のアドレス0には論理クラスタアドレス0が記憶される。さらに、フラッシュROMの物理クラスタ番地0には、データAが書き込まれるとともに、冗長部に「0:1」も記憶される。   In FIG. 7, when a command for writing “A” at address 0 is first issued on the host side, the logical → physical conversion table T1 is associated with 0 which is an empty cluster address of the flash ROM, and the generation number is an initial value. Remember that it is 1. As a result, “0: 1” (0 indicates the physical cluster number 0 of the flash ROM and 1 indicates the initial value of the generation number) is stored in the address 0 of the logical → physical conversion table T1. At the same time, the logical cluster address 0 is stored in the address 0 of the physical → logical conversion table T2. Further, data A is written to the physical cluster address 0 of the flash ROM, and “0: 1” is also stored in the redundant portion.

次に、ホスト側において、ホスト側メモリのアドレス3にデータ「B」が書き込まれて書き込みコマンドが発行されると、フラッシュROMのクラスタ番号1にはデータ「B」が書き込まれるとともに、論理→物理変換テーブルT1の論理クラスタアドレス3には「1:1」(左側の1はフラッシュROMの物理クラスタ番号1を示し、右側の1世代番号の初期値を示す)が記憶される。また、物理→論理変換テーブルT2のアドレス1には論理クラスタアドレスの3が記憶される。また、フラッシュROMの物理クラスタ番号1には、上記データ「B」とともに、冗長部に「3:1」(3は論理クラスタアドレス、1は世代番号の初期値)が書き込まれる。   Next, on the host side, when data “B” is written to address 3 of the host side memory and a write command is issued, data “B” is written to cluster number 1 of the flash ROM, and logical → physical The logical cluster address 3 of the conversion table T1 stores “1: 1” (1 on the left side indicates the physical cluster number 1 of the flash ROM, and the initial value of the 1 generation number on the right side). Further, the logical cluster address 3 is stored in the address 1 of the physical → logical conversion table T2. In addition, in the physical cluster number 1 of the flash ROM, “3: 1” (3 is the logical cluster address and 1 is the initial value of the generation number) is written in the redundant portion together with the data “B”.

続いて、ホスト側においてアドレス0のデータを「C」に書き換える書き込みコマンドが発行されると、フラッシュROMの空き物理クラスタ番号2のエリアにデータ「C」が書き込まれる。また、論理→物理変換テーブルT1の論理クラスタアドレス0は、「2:2」(最初の2は物理クラスタ番号、後ろの2は1つ増えた世代番号)に更新される。また、物理→論理変換テーブルT2のアドレス2には論理クラスタアドレスである0が記憶される。さらに、フラッシュROMの物理クラスタ番号2の冗長部には、「0:2」(0は論理クラスタアドレス、2は世代番号)が書き込まれる。   Subsequently, when a write command for rewriting the data at address 0 to “C” is issued on the host side, the data “C” is written to the area of the free physical cluster number 2 in the flash ROM. In addition, the logical cluster address 0 of the logical → physical conversion table T1 is updated to “2: 2” (the first 2 is the physical cluster number and the last 2 is the generation number increased by one). In addition, 0 which is a logical cluster address is stored in address 2 of the physical → logical conversion table T2. Further, “0: 2” (0 is the logical cluster address and 2 is the generation number) is written in the redundant part of the physical cluster number 2 of the flash ROM.

ブロックステータステーブルT3には、0〜3の4ブロック分のステータスが記憶されている。ステータスは、有効クラスタ数(FFh、FEh以外)、不良ブロック状態(そのブロックが不良であるかどうかを示す:FEh)、消去状態(そのブロックが消去されて未使用状態にあるかどうか:FFh)を含んでいる。最初は、ブロックステータステーブルT3の各アドレスにはFFhが記憶され、消去状態(未使用状態)のステータスとなっている。データ「A」がブロック0の物理クラスタ番号0に書き込まれると、アドレス0には「1」(有効クラスタ数が1であることを示す)が記憶される。次に、データ「B」がブロック0の物理クラスタ番号1に書き込まれると、「1」→「2」(有効クラスタ数が1から2に変わったことを示す)となる。さらに、データ「C」がブロック1の物理クラスタ番号2に書き込まれると、「2」→「1」(有効クラスタ数が1になったことを示す)となる。ブロックステータステーブルT3のアドレス1では、データ「C」がブロック1の物理クラスタ番号2に書き込まれると、「1」となり有効クラスタ数が1になったことが記憶される。後述のように、物理クラスタを無効化するための無効化処理が行われる時に、同時に有効クラスタのないブロックも検出されて、そのブロックに対する消去処理が行われるが、この検出のためにブロックステータステーブルT3の有効クラスタ数が参照される。なお、この時にブロックに対する消去処理が行われると、そのブロックに対応するエリアにはFFhが記憶されて消去状態(未使用状態)に設定される。また、書込みエラー発生時等、ブロックが不良になった時には不良ブロックであるステータスFEhが記憶される。   In the block status table T3, statuses for four blocks 0 to 3 are stored. The status includes the number of valid clusters (other than FFh and FEh), a defective block state (indicating whether or not the block is defective: FEh), and an erased state (whether or not the block is erased and in an unused state: FFh) Is included. Initially, FFh is stored in each address of the block status table T3, and the status is in the erased state (unused state). When data “A” is written to physical cluster number 0 of block 0, “1” (indicating that the number of valid clusters is 1) is stored at address 0. Next, when data “B” is written to physical cluster number 1 of block 0, “1” → “2” (indicating that the number of valid clusters has changed from 1 to 2). Further, when the data “C” is written to the physical cluster number 2 of the block 1, “2” → “1” (indicating that the number of valid clusters is 1) is obtained. In the address 1 of the block status table T3, when the data “C” is written to the physical cluster number 2 of the block 1, “1” is obtained and the fact that the number of valid clusters is 1 is stored. As will be described later, when an invalidation process for invalidating a physical cluster is performed, a block without a valid cluster is also detected at the same time, and an erasure process is performed on the block. Reference is made to the number of valid clusters in T3. If an erasure process is performed on the block at this time, FFh is stored in the area corresponding to the block and the erasure state (unused state) is set. Also, when a block becomes defective, such as when a write error occurs, status FEh, which is a defective block, is stored.

図7に示すように、本装置では、フラッシュROMの物理的な最大容量よりも小さな容量を事前にホスト側に通知しているために、常に書き込み可能な(消去済の)ブロックを確保するようにしている。この空きブロックを論理的な空きブロック数という。   As shown in FIG. 7, in this apparatus, since the host side is notified in advance of a capacity smaller than the physical maximum capacity of the flash ROM, it is possible to always secure a writable (erased) block. I have to. This empty block is called a logical empty block number.

次に、世代番号管理について説明する。   Next, generation number management will be described.

本装置において世代番号管理とは、論理クラスタアドレスに対するデータの更新が行われるたびに、その論理クラスタアドレスに対する物理クラスタ番号の変更回数を世代番号として割り振ることをいう。また、この割り振った世代番号が所定の最大値になった時に当該論理クラスタアドレスに対応する全ての物理クラスタ番号を無効化することをいう。   In this apparatus, generation number management means that each time data is updated for a logical cluster address, the number of changes of the physical cluster number for that logical cluster address is assigned as a generation number. Further, it means that all physical cluster numbers corresponding to the logical cluster address are invalidated when the assigned generation number reaches a predetermined maximum value.

世代番号は、図7に示すように、論理→物理変換テーブルT1に記憶されるとともに、フラッシュROMの対応物理クラスタ番号エリアにも記憶される。そして、データの書換えを行う時の世代番号が前記最大値になった時に行われる無効化処理では、当該論理クラスタに対応する全ての物理クラスタ(当該論理クラスタアドレスに対応する全ての物理クラスタ番号のクラスタデータ)を無効にし、新たに、世代番号の最小値を割り振る。この処理を世代交代動作と称する。   As shown in FIG. 7, the generation number is stored in the logical-to-physical conversion table T1, and is also stored in the corresponding physical cluster number area of the flash ROM. In the invalidation processing performed when the generation number when data is rewritten reaches the maximum value, all physical clusters corresponding to the logical cluster (all physical cluster numbers corresponding to the logical cluster address) (Cluster data) is invalidated and a new minimum generation number is allocated. This process is called a generation change operation.

世代番号の初期値は、各論理クラスタアドレス毎に同一の初期値であってもよいが、この初期値を適当に異ならせておくことによって、各クラスタの世代番号が同時に最大値に達するのを防ぐことができる。これにより、一時的な著しいスループットの低下を防ぐことができて、システムの安定性を確保できる。   The initial value of the generation number may be the same initial value for each logical cluster address, but by appropriately varying this initial value, the generation number of each cluster can simultaneously reach the maximum value. Can be prevented. As a result, a temporary significant decrease in throughput can be prevented, and the stability of the system can be ensured.

図7において、フラッシュROMの冗長部に「×」が記憶されると、その物理クラスタは上記無効化処理によって無効になったことを示す。この無効化された物理クラスタに対しては、当然データが書き込まれることはなく、将来、その無効物理クラスタが含まれるブロック内の全てのクラスタが有効でなくなった時に、そのブロックが消去されて初期状態にされる。   In FIG. 7, when “x” is stored in the redundant part of the flash ROM, it indicates that the physical cluster is invalidated by the invalidation process. Of course, no data is written to the invalid physical cluster, and when all clusters in the block containing the invalid physical cluster become invalid in the future, the block is erased and initialized. Put into a state.

以上の世代番号管理によって、データを書き込む前にブロックを消去する必要がなく、また、消去対象のブロックが分散化されることによって未使用クラスタへの逐次書き込みが可能となって高速化と長寿命化が実現できる。すなわち、従来の方法では、まず、ブロックを消去してからデータの書き込み処理に移るが、本装置ではデータの書き込みの前にブロックを消去しておく必要がないから、ブロック消去の完了を待つことなくホストからの要求を終了できることになり、これによりシステム全体としてのスループットが著しく向上する。また、空き領域の確保は、物理クラスタの無効化と有効クラスタがなくなった時の消去処理によって行われるために、ガーベージコレクション等の従来の空き領域確保のための処理に対し、処理時間が分散化され、且つ短時間で行うことが可能である。   With the above generation number management, there is no need to erase blocks before writing data, and the blocks to be erased are distributed to enable sequential writing to unused clusters, resulting in higher speed and longer life. Can be realized. That is, in the conventional method, first, the block is erased and then the data writing process is started. However, in this apparatus, it is not necessary to erase the block before the data is written. Therefore, the request from the host can be terminated without any problem, and the throughput of the entire system is remarkably improved. In addition, since the free space is secured by invalidating the physical cluster and erasing when there is no valid cluster, the processing time is distributed over conventional free space secure processing such as garbage collection. And can be performed in a short time.

上記図7を参照しての説明では、説明を単純化するために、データを書き込む時の物理クラスタの選択を、クラスタ番号の小さい方から順に選ぶようにしている。そして、選択した物理クラスタが無効の時(×が記憶されている。)に、次の番号のクラスタを選択する。しかし、実際にはこのような方法では、無効化処理を繰り返すことによって選択される物理クラスタが歪なものになってしまう。すなわち、同一論理クラスタアドレスに対応する物理クラスタ番号は同一のブロック内に存在することが望ましいといえるが、書き込みのための空き物理クラスタを単に番号の小さいものから順に選んでいくだけでは、無効化処理を繰り返した時に同一論理クラスタアドレスに対応する物理クラスタが複数のブロック間に股がって歪に存在することになりうる。   In the description with reference to FIG. 7 above, in order to simplify the description, the selection of physical clusters at the time of writing data is selected in order from the smallest cluster number. When the selected physical cluster is invalid (x is stored), the cluster with the next number is selected. However, in practice, in such a method, the physical cluster selected by repeating the invalidation process becomes distorted. In other words, it can be said that the physical cluster number corresponding to the same logical cluster address should be in the same block, but it is invalidated simply by selecting the free physical cluster for writing from the smallest number in order. When the process is repeated, a physical cluster corresponding to the same logical cluster address may be distorted between a plurality of blocks.

そこで、本装置では、図7に示すように、未使用物理クラスタ番号テーブルT4を設けている。このテーブルT4は、未使用物理クラスタのあるブロック番号と、そのブロック番号に対する未使用クラスタ番号を示している。図7に示す例では、ブロック1については物理クラスタ番号3が未使用物理クラスタであることを示し、ブロック2については、物理クラスタ番号4及び5が未使用物理クラスタであることを示している。このテーブルT4は、フラッシュROMに対するデータの書き込み処理及び消去処理が行われた時に更新される。このテーブルT4を使用して、新たにデータを書き込む時の物理クラスタを選択すれば、同一論理クラスタアドレスに対応する物理クラスタ番号をなるべく多く同一ブロックに割り当てることが可能になる。   Therefore, in this apparatus, as shown in FIG. 7, an unused physical cluster number table T4 is provided. This table T4 shows a block number with an unused physical cluster and an unused cluster number for the block number. In the example shown in FIG. 7, for the block 1, the physical cluster number 3 indicates an unused physical cluster, and for the block 2, the physical cluster numbers 4 and 5 indicate an unused physical cluster. The table T4 is updated when data writing processing and erasing processing are performed on the flash ROM. By using this table T4 and selecting a physical cluster when data is newly written, it is possible to assign as many physical cluster numbers corresponding to the same logical cluster address as possible to the same block.

本装置においては、上述のようにフラッシュROMの管理単位を、消去単位であるブロック単位よりも小さく、且つ、フラッシュROMへの読み込み又は書き込み単位であるページ単位よりも大きいクラスタ単位としている(勿論、ホストからのコマンド発行時の単位であるセクタ単位よりも大きい)。このように、クラスタ単位で管理すると、ブロック単位で管理した時の書換え時のオーバーヘッドが大きくなりすぎるのを防ぐことができ、反対に、ページ単位で管理した時の管理の煩雑さを避けることができる。すなわち、全体のスループットを向上するための丁度よい大きさがクラスタ単位である。   In this apparatus, as described above, the flash ROM management unit is a cluster unit that is smaller than the block unit that is the erase unit and larger than the page unit that is the read or write unit to the flash ROM (of course, (It is larger than the sector unit, which is the unit when a command is issued from the host). In this way, if managed in cluster units, the overhead during rewriting when managed in block units can be prevented from becoming too large, and conversely management complexity when managed in page units can be avoided. it can. That is, a cluster unit is just right for improving the overall throughput.

さらに、クラスタは、通常のコンピュータシステムで使用されるFATファイルシステムへの適合性が良くなる。すなわち、FATファイルシステムでは、通常、データ領域はクラスタ単位でアクセスすることが知られているために、データ領域の開始セクタが、本装置のクラスタ境界と一致するようにし、また、本装置のクラスタサイズとファイルシステムにおけるクラスタサイズを一致するようにフォーマットを行えば、FATファイルシステムとフラッシュROMの適合性が極めて良くなり、効率的なアクセスが可能となって高速化が可能となる。   In addition, the cluster is more adaptable to the FAT file system used in normal computer systems. That is, in the FAT file system, since it is known that the data area is normally accessed in cluster units, the start sector of the data area is made to coincide with the cluster boundary of the apparatus, and the cluster of the apparatus is set. If the format is performed so that the size matches the cluster size in the file system, the compatibility of the FAT file system and the flash ROM becomes extremely good, and efficient access is possible and speeding up is possible.

図8は、このように境界位置及びサイズを一致させた状態を示している。すなわち、フラッシュROMにおけるクラスタmから、ファイルシステムにおけるデータクラスタが開始されるようにフォーマットパラメータを調整する。なお、図8においては、図中の管理領域が一般にクラスタサイズ以下のアクセスが発生するために、クラスタ0〜クラスタm−1については、本装置において更に小さいサイズでの管理を行うようにすると、高速化を更に促進できる。   FIG. 8 shows a state where the boundary position and size are matched in this way. That is, the format parameter is adjusted so that the data cluster in the file system is started from the cluster m in the flash ROM. In FIG. 8, since the management area in the figure generally has an access smaller than the cluster size, if the cluster 0 to cluster m-1 are managed at a smaller size in this apparatus, Speeding up can be further promoted.

図9は、本装置での書き込み時の高速化が実現される理由を示している。   FIG. 9 shows the reason why high speed at the time of writing is realized in this apparatus.

ブロック管理を行う従来の方式では、図示のようにフラッシュROMから既存のブロックデータを読み込んだ後そのブロックの消去を行い、さらにそのブロックに対して新しいブロックデータの書き込みを行い書き込み完了待ちを行って終了する。   In the conventional method for block management, as shown in the figure, after reading the existing block data from the flash ROM, the block is erased, new block data is written to the block, and writing is waited for. finish.

従来のブロック管理を行う方式では、最初にブロック消去を行う必要があるために書き込み時間が長時間になるのを避けることができない。そこで、ブロック消去をしなくてもよいように、論理→物理変換テーブルを使用し、且つクラスタ管理を行う方針が考えられる。このクラスタ管理では、最初にフラッシュROM内の既存のクラスタデータを読み込んで新しいクラスタデータに更新した後書き込み、書き込みの完了を待ってから当該クラスタを無効化するための書き込みを行い、さらにその書き込み完了を待つ。しかしこの方式でも、既存のクラスタを無効化するための書き込み時間が必要である。これに対して、世代管理を行う本装置では、新しいクラスタデータを書き込み、その書き込み完了を待つか、又は必要な場合にフラッシュROM内から既存のクラスタデータを読み込んだ後、新しいクラスタデータを書き込み、その書き込み完了を待つだけでよい。この世代管理を行うことによってデータの書き込みごとに既存クラスタの無効化処理を行う必要がなくなるため、書き込み時間が非常に高速化する。   In the conventional method of performing block management, it is necessary to erase the block first, so that a long writing time cannot be avoided. In view of this, it is conceivable to use a logical-to-physical conversion table and perform cluster management so that block erasure is not necessary. In this cluster management, the existing cluster data in the flash ROM is first read and updated to new cluster data, and then writing is performed after waiting for completion of writing to invalidate the cluster. Wait for. However, even in this method, a write time for invalidating the existing cluster is required. On the other hand, in this device that performs generation management, write new cluster data, wait for the completion of writing, or read existing cluster data from the flash ROM if necessary, then write new cluster data, It is only necessary to wait for the completion of the writing. By performing this generation management, it is not necessary to invalidate the existing cluster each time data is written, so the writing time is greatly increased.

次に、本装置の実施例について説明する。   Next, an embodiment of the present apparatus will be described.

図10は第1の実施例の構成図である。この実施例では、フラッシュROM1、及びフラッシュROM2の2つをフラッシュROM制御装置1に接続する。接続は、データバスを共通化し、R/W Strobe信号をそれぞれのフラッシュROMに接続する。また、Chip Enable信号が共通の制御信号として各フラッシュROMに接続されている。ここでは、フラッシュROM1をグループ1、フラッシュROM2をグループ2とする。また、図11に示すように、フラッシュROM制御装置1からのアクセス単位であるページごとに各グループを交互に割りつける。図11のように割りつけることにより、物理クラスタ0のアクセス順序は、グループ1のページ0→グループ2のページ0→グループ1のページ1→グループ2のページ1というふうになる。なお、図11において、反転クラスタとは、詳細については後述するように、グループ間のデータ転送を行った時に読出しの際にデータの順番が反転しないようにするための情報(反転クラスタ情報)が付加されたクラスタをいう。これについては後述する。   FIG. 10 is a block diagram of the first embodiment. In this embodiment, the flash ROM 1 and the flash ROM 2 are connected to the flash ROM control device 1. For the connection, the data bus is shared, and the R / W Strobe signal is connected to each flash ROM. In addition, a Chip Enable signal is connected to each flash ROM as a common control signal. Here, the flash ROM 1 is group 1 and the flash ROM 2 is group 2. Further, as shown in FIG. 11, each group is alternately allocated for each page which is an access unit from the flash ROM control device 1. By allocating as shown in FIG. 11, the access order of the physical cluster 0 is as follows: page 0 of group 1 → page 0 of group 2 → page 1 of group 1 → page 1 of group 2. In FIG. 11, the inverted cluster is information (inverted cluster information) for preventing the data order from being inverted when reading data when transferring data between groups, as will be described in detail later. Refers to the added cluster. This will be described later.

したがって、図11において物理クラスタ0が反転クラスタの場合、アクセス順序は、グループ2のページ0→グループ1のページ0→グループ2のページ1→グループ1のページ1となる。   Therefore, when the physical cluster 0 is an inverted cluster in FIG. 11, the access order is page 0 of group 2 → page 0 of group 1 → page 1 of group 2 → page 1 of group 1.

本装置では、読み込み時においては以下の例のように、2つのグループを交互に転送することによって、一方のフラッシュROMの待ち時間の間に他方のフラッシュROMのデータを転送させる制御を行う。   In this apparatus, at the time of reading, as shown in the following example, two groups are transferred alternately, thereby performing control to transfer the data of the other flash ROM during the waiting time of one flash ROM.

(1)グループ1にリードコマンドを発行する。   (1) Issue a read command to group 1.

(2)グループ2にリードコマンドを発行する。   (2) Issue a read command to group 2.

(3)グループ1のデータをホストに転送する。転送終了後、グループ1に次のリードコマンドを発行する。   (3) Transfer group 1 data to the host. After the transfer is completed, the next read command is issued to group 1.

(4)グループ2のデータをホストに転送する。転送終了後、グループ2に次のリードコマンドを発行する。   (4) Transfer group 2 data to the host. After the transfer is completed, the next read command is issued to group 2.

(5)(3)に戻る。   (5) Return to (3).

書き込み時においては、以下の例のように2つのグループを交互に転送することによって、一方のフラッシュROMの待ち時間の間に他方のフラッシュROMのデータを転送する制御を行う。   At the time of writing, control is performed to transfer the data of the other flash ROM during the waiting time of one flash ROM by transferring the two groups alternately as in the following example.

(1)グループ1にデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (1) Issue a data input command to group 1, transfer write data, and issue a write command.

(2)グループ2にデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (2) A data input command is issued to group 2, write data is transferred, and a write command is issued.

(3)グループ1の書き込み完了待ちをし、エラー判定を行う。正常に書き込みが完了すれば、データ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (3) Wait for the completion of group 1 writing and perform error determination. If writing is completed normally, a data input command is issued, write data is transferred, and a write command is issued.

(4)グループ2の書き込み完了待ちをし、エラー判定を行う。正常に書き込みが完了すれば、データ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (4) Wait for the completion of group 2 writing and perform error determination. If writing is completed normally, a data input command is issued, write data is transferred, and a write command is issued.

(5)(3)に戻る。   (5) Return to (3).

ガーベージコレクション時のクラスタデータの転送時には、従来の方式では、クラスタデータを一旦RAM等の記憶部に読み込んでから再び書き込む必要があった。本装置では、R/W Strobe信号を両方のグループに同時に送り、一方をリード、他方をライトで動作させることによって、1回の動作で読み込みと書き込みを同時に行うことができる。これにより、グループ間のデータ転送を高速化することが可能である。ただし、先に述べたように、データの転送に際してはクラスタデータが反転クラスタかどうかによって読出しの順番を変えることが必要になる。すなわち、グループ間のデータ転送時においては、グループ1→グループ2、もしくはグループ2→グループ1の転送を行うので、コピーしたクラスタデータは、コピー元のクラスタデータに対してページごとに順番が反転してしまう。そこで、転送時には、反転クラスタであることを示すクラスタ情報を記録し、読出しの際にはグループの選択時に他方のグループを選択するようにする。   When transferring cluster data at the time of garbage collection, in the conventional method, it is necessary to once read the cluster data into a storage unit such as a RAM and then write it again. In this apparatus, an R / W Strobe signal is sent to both groups at the same time, and one is read and the other is operated by writing, so that reading and writing can be performed simultaneously in one operation. Thereby, it is possible to speed up data transfer between groups. However, as described above, when data is transferred, it is necessary to change the reading order depending on whether the cluster data is an inverted cluster or not. In other words, when transferring data between groups, group 1 → group 2 or group 2 → group 1 is transferred, and the order of the copied cluster data is reversed for each page with respect to the copy source cluster data. End up. Therefore, cluster information indicating an inverted cluster is recorded at the time of transfer, and the other group is selected at the time of group selection at the time of reading.

なお、グループ1とグループ2の両方のブロックを消去する際においては、ほぼ同時にコマンドを発行できるために、1回の消去コマンドの実行時間で2つのブロックを同時に消去することが可能である。   When erasing both the group 1 and group 2 blocks, the commands can be issued almost simultaneously, so it is possible to simultaneously erase two blocks within the execution time of one erase command.

次に、フラッシュROM制御装置1の具体的な動作について図12以下を参照して説明する。   Next, a specific operation of the flash ROM control device 1 will be described with reference to FIG.

図12は、ホストからリードコマンドが発行された時の動作を示している。ステップ100→・・・→ステップ107と進み、ステップ107において、コマンド発行に該当するグループを選択し、フラッシュROMへ該当ページ番号を伴ったリードコマンドを発行する。また、ステップ108においてデータ転送を行うためにデータ転送セクタ数を保存しておく。ただし、クラスタ内転送セクタ数分のコマンドを発行した場合にはここではコマンド発行を行わない。   FIG. 12 shows an operation when a read command is issued from the host. The process proceeds from step 100 to step 107. In step 107, a group corresponding to command issue is selected, and a read command with the corresponding page number is issued to the flash ROM. In step 108, the number of data transfer sectors is stored for data transfer. However, when the command for the number of transfer sectors in the cluster is issued, the command is not issued here.

ステップ108において、データ転送に該当するグループを選択し、装置内のシーケンサを起動してフラッシュROMからのデータをホストI/Fを介してホストに転送する。ただし、このデータ転送に該当するグループは、前記のコマンド発行に該当するグループとは異なるもう一方のグループである。なお、フラッシュROMへのコマンドが発行されてないグループであればデータ転送は行わない。フラッシュROMへのコマンドが発行されているかどうかは、ステップ107で保存したデータ転送セクタ数を参照して判断する。   In step 108, the group corresponding to the data transfer is selected, the sequencer in the apparatus is activated, and the data from the flash ROM is transferred to the host via the host I / F. However, the group corresponding to the data transfer is another group different from the group corresponding to the command issuance. If the command is not issued to the flash ROM, data transfer is not performed. Whether or not a command to the flash ROM has been issued is determined by referring to the number of data transfer sectors stored in step 107.

ステップ112では、ページ番号のインクリメント、及びグループ番号の切り換えを次のように行う。   In step 112, the page number is incremented and the group number is switched as follows.

グループ番号が1であれば2に変える。   If the group number is 1, it is changed to 2.

グループ番号が2であれば1に変える。   If the group number is 2, change it to 1.

ステップ113では、クラスタ内の転送が一度終了したので、次の転送からはクラスタの先頭からの転送であると判断し、クラスタ内オフセットページ数、クラスタ内オフセットセクタ数、ページ内オフセットセクタ数を0にしておく。   In step 113, since the transfer within the cluster is once completed, it is determined that the next transfer is from the beginning of the cluster, and the number of offset pages in the cluster, the number of offset sectors in the cluster, and the number of offset sectors in the page are set to 0. Keep it.

ステップ107〜112にて、グループ毎に処理を行うことにより、一方のフラッシュROMがBusy状態であっても、他方のフラッシュROMを制御できるため、高速に読み込むことができる。   By performing processing for each group in steps 107 to 112, even if one flash ROM is in a busy state, the other flash ROM can be controlled, so that it can be read at high speed.

図13はホストからライトコマンドが発行された時の動作を示す。   FIG. 13 shows the operation when a write command is issued from the host.

ステップ202において、ステップ200で算出したクラスタ内オフセットページ数、クラスタ内オフセットセクタ数、ページ内オフセットセクタ数、総転送セクタ数から、これから書き込もうとするデータが該当するクラスタ全体を書き換えるかどうかを判断する。   In step 202, it is determined from the number of offset pages in the cluster, the number of offset sectors in the cluster, the number of offset sectors in the page, and the total number of transfer sectors calculated in step 200 whether or not the data to be written will be rewritten in the entire cluster. .

ステップ204〜209は、クラスタ内の一部を書き換える際に本装置内のRAMにデータを退避する手順、もしくはダミーデータを作成する手順と、RAM内で更新したデータを再びフラッシュROM内に書き込む手順を示している。なお、ステップ205でソースクラスタのクラスタデータをRAMへ保存する時に、読み込み完了待ちの時に別のページのフラッシュROMに対して書き込みコマンドを発行しておき、RAM上で更新されたデータをそのコマンド発行したページのフラッシュROMに書き込むことにより、高速の書き込みが可能となる。   Steps 204 to 209 are a procedure for saving data to the RAM in the apparatus when rewriting a part in the cluster, or a procedure for creating dummy data, and a procedure for writing the data updated in the RAM into the flash ROM again. Is shown. When the cluster data of the source cluster is stored in the RAM in step 205, a write command is issued to the flash ROM of another page when waiting for completion of reading, and the data updated on the RAM is issued to the command. Writing to the flash ROM of the selected page enables high-speed writing.

ステップ213ではソースブロックの有効クラスタ数が1かどうかを判定し、有効クラスタ数が1であれば当該ソースブロックに対するブロック消去処理を行い、ブロックステータステーブル及び物理→論理変換テーブルの更新を行う。また、ソースブロックの有効クラスタ数が1以外であれば、ステップ215においてブロックステータステーブル及び物理→論理変換テーブルの更新を行う。   In step 213, it is determined whether the number of valid clusters in the source block is 1. If the number of valid clusters is 1, block erasure processing is performed for the source block, and the block status table and physical → logical conversion table are updated. If the number of valid clusters in the source block is other than 1, the block status table and physical → logical conversion table are updated in step 215.

図14は、図13のステップ211の動作を示すフローチャートである。ホストI/FからフラッシュROMへのクラスタデータの書き込みを行う時は、図13のステップ202に示すように、書き込むデータがクラスタ全体を書き換えるデータの場合である。   FIG. 14 is a flowchart showing the operation of step 211 in FIG. When the cluster data is written from the host I / F to the flash ROM, as shown in step 202 of FIG. 13, the data to be written is data that rewrites the entire cluster.

ステップ302において、これから書き込もうとするクラスタに割り当てられているクラスタの世代番号に1を加算した値を書き込みクラスタに割り当てる。しかし、その前にステップ300において、世代番号が最大値に達しているかどうかを判断し、最大値に達する場合にはステップ301において世代交代処理を行う。   In step 302, a value obtained by adding 1 to the generation number of the cluster assigned to the cluster to be written is assigned to the write cluster. However, before that, in step 300, it is determined whether or not the generation number has reached the maximum value. If the generation number reaches the maximum value, generation change processing is performed in step 301.

世代交代処理とは、これから書き込もうとする論理クラスタアドレスに割り当てられている物理クラスタを全て消去もしくは廃棄する処理である。この処理を行うことによって、これから書き込もうとするクラスタには、世代番号の初期値が割り当てられることになる。   The generation change process is a process of erasing or discarding all physical clusters assigned to the logical cluster address to be written. By performing this processing, the initial value of the generation number is assigned to the cluster to be written.

ステップ306においては、これから書き込もうとするグループに対してReady状態になっていることを確認する。Ready状態になっていなければReady状態になるまで待機する。   In step 306, it is confirmed that the group to be written is ready. If not ready, it waits until it becomes ready.

ステップ307においては、これから書き込もうとするグループに対してデータ入力コマンドを送出し、シーケンサによりホストI/FからフラッシュROMへデータを転送する。転送し終われば、フラッシュROMへプログラムコマンドを発行する。ステップ309では、ステップ306で選択されているグループを切り換える。この実施例では、フラッシュROMが2つであるために、グループ番号2であればステップ307で発行するデータ入力コマンドに伴って発行されるページアドレスをインクリメントする。   In step 307, a data input command is sent to the group to be written, and data is transferred from the host I / F to the flash ROM by the sequencer. When the transfer is completed, a program command is issued to the flash ROM. In step 309, the group selected in step 306 is switched. In this embodiment, since there are two flash ROMs, if the group number is 2, the page address issued along with the data input command issued in step 307 is incremented.

ステップ306〜309での一連の処理にてグループごとに処理を行うことにより、一方のフラッシュROMがBusy状態の時でも、他方のフラッシュROMを制御することができる。このため書き込みを高速化することができる。   By performing processing for each group in a series of processing in steps 306 to 309, even when one flash ROM is in the Busy state, the other flash ROM can be controlled. For this reason, writing can be speeded up.

図15は、RAMからフラッシュROMへのクラスタデータの書き込み手順を示すフローチャートである。この動作は、図13のステップ209で行われ、書き込むデータがクラスタの一部に書き換える場合に選択される。   FIG. 15 is a flowchart showing a procedure for writing cluster data from the RAM to the flash ROM. This operation is performed in step 209 in FIG. 13 and is selected when the data to be written is rewritten into a part of the cluster.

ステップ402において、これから書き込もうとするクラスタに割り当てられているクラスタの世代番号に1を加算した値を書き込みクラスタに割り当てる。しかし、その前にステップ400において、最大値に達するかどうかを判断し、最大値に達する場合にはステップ401において世代交代処理を行う。   In step 402, a value obtained by adding 1 to the generation number of the cluster assigned to the cluster to be written is assigned to the write cluster. However, before that, in step 400, it is determined whether or not the maximum value is reached. If the maximum value is reached, generation change processing is performed in step 401.

世代交代処理については前述した通りである。   The generation change process is as described above.

ステップ406では、これから書き込もうとするグループに対してReady状態になっていることを確認する。Ready状態になっていなければReady状態になるまで待機する。   In step 406, it is confirmed that the group to be written is ready. If not ready, it waits until it becomes ready.

ステップ407では、これから書き込もうとするグループに対して、データ入力コマンドを送出し、シーケンサによりRAMからフラッシュROMへデータを転送する。転送し終わればフラッシュROMへプログラムコマンドを発行する。   In step 407, a data input command is sent to the group to be written, and data is transferred from the RAM to the flash ROM by the sequencer. When transfer is completed, a program command is issued to the flash ROM.

ステップ409では、ステップ406で選択されているグループを切り換える。この実施例では、フラッシュROMが2つであるためにグループ番号2であれば、ステップ407で発行するデータ入力コマンドに伴って発行されるページアドレスをインクリメントする。   In step 409, the group selected in step 406 is switched. In this embodiment, since there are two flash ROMs, if the group number is 2, the page address issued along with the data input command issued in step 407 is incremented.

ステップ406〜409での一連の処理にて、グループごとに処理を行うことにより、一方のフラッシュROMがBusy状態の時でも、他方のフラッシュROMを制御することができる。このため、書き込みの高速化を図ることができる。   By performing processing for each group in a series of processing in steps 406 to 409, even when one flash ROM is in the Busy state, the other flash ROM can be controlled. For this reason, it is possible to increase the writing speed.

図16は、ソースクラスタのデータをRAMに保存する手順を示すフローチャートである。この動作は、図13のステップ205で実行される。   FIG. 16 is a flowchart showing a procedure for storing data of the source cluster in the RAM. This operation is executed in step 205 in FIG.

ソースクラスタのデータ(クラスタデータ)を一旦RAMに保存するのは、RAMに保存した後クラスタデータを更新して再びフラッシュROMへ書き込むためである。   The reason why the data of the source cluster (cluster data) is temporarily stored in the RAM is to update the cluster data after the data is stored in the RAM and write it again into the flash ROM.

ステップ502において、算出されたページアドレスを伴うリードコマンドを、ステップ503にて発行しておく。   In step 502, a read command with the calculated page address is issued in step 503.

ステップ505にてデータ転送中であればデータ転送完了を待つ。この時に、データ転送エラーもしくはデータエラー(ECCにより誤り訂正不可能なエラー)が発生した場合は、ステップ592へ移行しエラー終了する。   If data transfer is in progress at step 505, the completion of data transfer is awaited. At this time, if a data transfer error or a data error (an error that cannot be corrected by ECC) occurs, the process proceeds to step 592 and the error ends.

ステップ505にて、まずグループaを選択しシーケンサを起動してデータ転送を行う。   In step 505, the group a is first selected, the sequencer is activated, and data transfer is performed.

グループaのフラッシュROMは、ステップ503もしくは前回のステップ505にて既にリードコマンドが発行されているために、シーケンサがReady状態になるのを待った後データ転送を行う。   Since the read command has already been issued in step 503 or the previous step 505, the flash ROM in group a performs data transfer after waiting for the sequencer to become ready.

次にステップ506にて、グループbを選択し、シーケンサを起動してデータ転送を行う。   In step 506, group b is selected, the sequencer is activated, and data transfer is performed.

グループbのフラッシュROMは、ステップ503もしくは前回のステップ506において既にリードコマンドが発行されているために、シーケンサがReady状態になるのを待った後データ転送を行う。   Since the read command has already been issued in step 503 or the previous step 506, the flash ROM in group b performs data transfer after waiting for the sequencer to become ready.

ステップ503〜508の一連の処理にて、グループごとに処理を行うことによって、一方のフラッシュROMがBusy状態の時でも、他方のフラッシュROMを制御することができる。これによって高速処理が可能になる。   By performing processing for each group in a series of processing in steps 503 to 508, even when one flash ROM is in the Busy state, the other flash ROM can be controlled. This enables high-speed processing.

図17は、書き込みエラー処理を示すフローチャートである。この書き込みエラー処理は、図13のステップ219で行われる処理である。   FIG. 17 is a flowchart showing the write error process. This write error process is a process performed in step 219 of FIG.

ステップ602〜604において、未使用クラスタ番号を取得するが、この未使用クラスタ番号を取得するのは図7に示す未使用物理クラスタ番号テーブルT4からである。ステップ602の未使用クラスタ番号リストは、このテーブルT4を示している。   In steps 602 to 604, an unused cluster number is acquired. The unused cluster number is acquired from the unused physical cluster number table T4 shown in FIG. The unused cluster number list in step 602 indicates this table T4.

もし、未使用クラスタ番号が見つからない場合には、本装置を読み込み専用モードに切り換え、これ以上書き込みが出来ないようにするとともに、読み込みを許可するモードとする。また、ホストからの書き込み要求の処理中であれば、ホストに対しては書き込みエラーを報告する。   If an unused cluster number is not found, the apparatus is switched to a read-only mode so that no further writing can be performed and a read-permitted mode is set. If a write request from the host is being processed, a write error is reported to the host.

ステップ607においては、本装置のフラッシュROM間のコピー機能を使用し、書き込みエラーの発生したブロック内の有効クラスタの内容を正常な未使用ブロックにコピーする。既に述べたように、このコピーはフラッシュROM間で直接行われるために非常に高速である。   In step 607, the content of the valid cluster in the block in which the write error has occurred is copied to a normal unused block using the copy function between the flash ROMs of this apparatus. As already mentioned, this copy is very fast because it takes place directly between the flash ROMs.

図18は、新しい書き込みクラスタ番号を取得する動作を示すフローチャートである。この動作は、図13のステップ216で実行される。   FIG. 18 is a flowchart showing an operation of acquiring a new write cluster number. This operation is executed in step 216 of FIG.

ステップ700において、まず、未使用物理クラスタ番号テーブルT4(未使用クラスタ番号リスト)から、新しい書き込みクラスタ番号を取得するように試みる。こうすることにより、その都度、ブロックステータステーブルT3を検索しなくても良くなるために処理の高速化が図れる。   In step 700, first, an attempt is made to obtain a new write cluster number from the unused physical cluster number table T4 (unused cluster number list). By doing so, it is not necessary to search the block status table T3 each time, so that the processing speed can be increased.

ステップ700〜701において、未使用クラスタ番号が取得できなければ、ブロックステータステーブルT3において消去済みブロックを検索する。   If an unused cluster number cannot be acquired in steps 700 to 701, an erased block is searched in the block status table T3.

ステップ702〜703において、消去済みブロックが検索できない、もしくは規定未満の消去済みブロックしかなければ、後述のガーベージコレクション処理を行う。   In steps 702 to 703, if an erased block cannot be searched or there is only an erased block that is less than the standard, a garbage collection process described later is performed.

ステップ706において、これまでの処理で未使用クラスタが見つからなければ、本装置を読み込み専用モードに切り換え、これ以上書き込みができないようにするとともに、読み込みを許可する。この場合、ホストからの書き込み要求の処理中であれば、ホストに対しては書き込みエラーを報告する。   In step 706, if an unused cluster is not found in the processing so far, the apparatus is switched to the read-only mode so that no further writing is possible and reading is permitted. In this case, if a write request from the host is being processed, a write error is reported to the host.

図19は世代交代処理を示す。   FIG. 19 shows the generation change process.

世代交代処理は物理→論理テーブルT2を利用する。すなわち、ステップ900において、ブロックステータステーブルT3より、ブロック内の有効クラスタ数もしくはブロックステータスを取得する。なお、ブロックステータステーブルT3には、通常ブロックの場合有効クラスタ数が格納され、特殊ブロック(未使用ブロック、不良ブロック等)の場合、ブロックステータスが格納されている。 次に、ステップ901において、特殊ブロックかどうかを判定し、特殊ブロックの場合はステップ901→907に進んで、次のブロックに対する処理を行う。   The generation change process uses the physical → logical table T2. That is, in step 900, the number of valid clusters in the block or the block status is obtained from the block status table T3. In the block status table T3, the number of valid clusters is stored in the case of a normal block, and the block status is stored in the case of a special block (unused block, defective block, etc.). Next, in step 901, it is determined whether or not the block is a special block. If the block is a special block, the process proceeds to step 901 → 907 to perform processing for the next block.

ステップ901において、通常ブロックと判定したときは、ステップ902においてブロック内に有効クラスタがあるかどうかを判定する。有効クラスタがあれば、ステップ904において、該当ブロックについて、物理→論理変換テーブルT2により、指定された論理クラスタアドレスに割り当てられている物理クラスタ番号を検索する。そして、割り当てられている物理クラスタ番号が見つかれば、ブロック内のその物理クラスタ番号を記憶しておく。   If it is determined in step 901 that the block is a normal block, it is determined in step 902 whether there is a valid cluster in the block. If there is a valid cluster, in step 904, the physical cluster number assigned to the designated logical cluster address is searched for the corresponding block by using the physical-to-logical conversion table T2. If the assigned physical cluster number is found, the physical cluster number in the block is stored.

ステップ902においてブロック内に有効クラスタがなければ、ステップ903においてブロック消去を行う。   If there is no valid cluster in the block in step 902, block erasure is performed in step 903.

ステップ904の処理の後にステップ905に進み、該当物理クラスタが1つ以上見つかったどうかを判定する。1つ以上見つかった場合は、ステップ906において、ステップ904で記憶しておいた物理クラスタに対し無効であることを示すマークを記憶する。ステップ905において該当物理クラスタが見つからなかった場合は、ステップ907に進む。   After the processing in step 904, the process proceeds to step 905, where it is determined whether one or more corresponding physical clusters have been found. If one or more are found, in step 906, a mark indicating that the physical cluster stored in step 904 is invalid is stored. If no corresponding physical cluster is found in step 905, the process proceeds to step 907.

以上のステップ900以下をすべてのブロックに対して行う(ステップ907)。   The above steps 900 and thereafter are performed for all blocks (step 907).

以上の世代交代処理を行うと、指定された論理クラスタアドレスに割り当てられたクラスタが存在しなくなるために、この処理の後に、世代番号の初期値を割り当ててクラスタへの書き込みを行うことができる。   When the generation change process described above is performed, there is no cluster assigned to the designated logical cluster address. Therefore, after this process, the initial value of the generation number can be assigned and data can be written to the cluster.

本装置では、通常の状態では上記のような無効化処理を行って未使用ブロック(有効ブロック)を確保していくが、未使用ブロックが少なくなってくると、無効化処理では対応できなくなる可能性がある。そこで、ブロックの消去処理をしても有効ブロック数が一定以上にならないときには、ガーベージコレクションを行って新しい未使用クラスタを確保する。ガーベージコレクションは,ブロックステータステーブルT3を参照して行い、最も有効クラスタ数の少ないブロックを対象にする。こうすることによって、クラスタデータの転送回数を少なくでき、それにより高速化が期待できる。   In this device, invalidation processing as described above is performed in the normal state to secure unused blocks (valid blocks). However, when there are fewer unused blocks, invalidation processing may not be possible. There is sex. Therefore, if the number of valid blocks does not exceed a certain level even after block erasing processing, garbage collection is performed to secure a new unused cluster. Garbage collection is performed by referring to the block status table T3 and targets the block with the smallest number of valid clusters. By doing so, the number of times of transfer of the cluster data can be reduced, and thereby high speed can be expected.

ガーベージコレクションはこのようにして検索された有効クラスタ数の少ないブロックを対象とし、これにより、有効クラスタの内容を未使用クラスタへコピーする時間を短縮するとともに、その後の未使用クラスタも最大限に確保できるようにする。   Garbage collection targets blocks with a small number of valid clusters searched in this way, thereby reducing the time to copy the contents of valid clusters to unused clusters and maximizing the remaining unused clusters. It can be so.

図21は、ガーベージコレクションの対象を有効クラスタ数の少ないブロックとした場合の利点について説明する図である。同図に示すように、ブロック内の有効クラスタ数が少ない場合には、このブロックをガーベージコレクションの処理対象とすることによって、未使用クラスタに対して有効クラスタをコピーする場合のコピー回数が少なくなり、且つ確保できる未使用クラスタ数が多くなる。これに対して、ガーベージコレクションの処理対象を有効クラスタ数の多いブロックとした場合、または何も考慮することなくガーベージコレクションを行う場合には、コピーする有効クラスタ数が多くなり、且つ確保できる未使用クラスタ数が少なくなる。   FIG. 21 is a diagram for explaining an advantage when the target of garbage collection is a block with a small number of effective clusters. As shown in the figure, when the number of valid clusters in a block is small, the number of copies when valid clusters are copied to unused clusters is reduced by making this block the target of garbage collection. And the number of unused clusters that can be secured increases. On the other hand, if the target of garbage collection is a block with a large number of valid clusters, or if garbage collection is performed without considering anything, the number of valid clusters to be copied increases and can be secured. The number of clusters is reduced.

したがって、ガーベージコレクションの処理対象を有効クラスタ数の少ないブロックとすることにより、コピー時間を短縮することができるとともに未使用クラスタ数も最大限に確保できる。したがって、ガーベージコレクション処理の発生頻度も抑えることができる。   Therefore, by making the garbage collection processing target a block with a small number of valid clusters, the copy time can be shortened and the number of unused clusters can be secured to the maximum. Therefore, the occurrence frequency of the garbage collection process can also be suppressed.

図20は、ガーベージコレクションの動作を示すフローチャートである。   FIG. 20 is a flowchart showing the operation of garbage collection.

ステップ801においては、論理→物理変換テーブルT1及び物理→論理変換テーブルT2によりソースブロック内の有効クラスタのクラスタ情報を取得する。   In step 801, cluster information of valid clusters in the source block is acquired from the logical → physical conversion table T1 and physical → logical conversion table T2.

ステップ802において、未使用物理クラスタ番号テーブルT4(未使用クラスタ番号リスト)から新しい書き込みクラスタ番号を取得する。ここで、未使用クラスタ番号が取得されなけばエラー終了する。   In step 802, a new write cluster number is obtained from the unused physical cluster number table T4 (unused cluster number list). If an unused cluster number is not acquired, the process ends in error.

ステップ805では、本装置のフラッシュROM間コピー機能を使用して高速にコピーする。すなわちシーケンサを起動して、グループ1のフラッシュROMに対してはリードモードに設定し、グループ2のフラッシュROMにはライトモードに設定し、それぞれにR/W Strobe信号を出すことによってグループ1 のフラッシュROMのページデータをグループ2のフラッシュROMに直接転送する。   In step 805, copying is performed at high speed using the flash ROM copy function of the apparatus. That is, when the sequencer is activated, the group 1 flash ROM is set to the read mode, the group 2 flash ROM is set to the write mode, and the R / W Strobe signal is output to each group 1 flash. The ROM page data is directly transferred to the group 2 flash ROM.

ステップ803〜812において、クラスタの片方のグループのページのみコピーし、ステップ813〜814において判断し、グループを切り換えてステップ803に戻り、もう一方のグループのページをコピーする。このように、片方のグループごとにコピーすることにより、クラスタの内容はページごとに反転するが、本装置のフラッシュROM間コピーを利用することができる。図22はこの様子を示している。   In steps 803 to 812, only the page of one group of the cluster is copied, and in steps 813 to 814, the group is switched and the process returns to step 803 to copy the page of the other group. As described above, by copying for each group, the contents of the cluster are inverted for each page, but the inter-flash ROM copy of this apparatus can be used. FIG. 22 shows this state.

図23は、本発明の第2の実施例の構成図を示している。   FIG. 23 shows a block diagram of the second embodiment of the present invention.

図10に示す第1の実施例と相違する点は、フラッシュROM制御装置1に対してフラッシュROMを4つ接続し、フラッシュROM1、2でグループ1を構成し、フラッシュROM3、4でグループ2を構成している点である。グループ内の2つのフラッシュROMを選択するために、2つのChip Enable信号をグループ内のそれぞれのフラッシュROMに接続する。これにより、別々の制御が可能になる。図24は、ページの割りつけ方法を示している。物理クラスタ0のアクセス順序は、同図に示してある通りである。物理クラスタ1、物理クラスタ2についても同様である。   10 is different from the first embodiment shown in FIG. 10 in that four flash ROMs are connected to the flash ROM control device 1, the flash ROMs 1 and 2 form a group 1, and the flash ROMs 3 and 4 form a group 2. It is the point which constitutes. In order to select the two flash ROMs in the group, two Chip Enable signals are connected to each flash ROM in the group. Thereby, separate control becomes possible. FIG. 24 shows a page allocation method. The access order of the physical cluster 0 is as shown in FIG. The same applies to the physical cluster 1 and the physical cluster 2.

読み込み時においては、次のように4つのフラッシュROMを順番に転送することによって一方のフラッシュROMの待ち時間の間に他方のフラッシュROMのデータを転送することとなり、高速化することができる。   At the time of reading, the data of the other flash ROM is transferred during the waiting time of one flash ROM by sequentially transferring the four flash ROMs as follows, and the speed can be increased.

(1)フラッシュROM1にリードコマンドを発行する。   (1) A read command is issued to the flash ROM 1.

(2)フラッシュROM2にリードコマンドを発行する。   (2) A read command is issued to the flash ROM 2.

(3)フラッシュROM3にリードコマンドを発行する。   (3) A read command is issued to the flash ROM 3.

(4)フラッシュROM4にリードコマンドを発行する。   (4) A read command is issued to the flash ROM 4.

(5)フラッシュROM1のデータをホストに転送する。転送終了後、フラッシュROM1に次のリードコマンドを発行する。   (5) Transfer the data in the flash ROM 1 to the host. After the transfer is completed, the next read command is issued to the flash ROM 1.

(6)フラッシュROM2のデータをホストに転送する。転送終了後、フラッシュROM2に次のリードコマンドを発行する。   (6) Transfer the data in the flash ROM 2 to the host. After the transfer is completed, the next read command is issued to the flash ROM 2.

(7)フラッシュROM3のデータをホストに転送する。転送終了後、フラッシュROM3に次のリードコマンドを発行する。   (7) Transfer the data in the flash ROM 3 to the host. After the transfer is completed, the next read command is issued to the flash ROM 3.

(8)フラッシュROM4のデータをホストに転送する。転送終了後、フラッシュROM4に次のリードコマンドを発行する。   (8) Transfer the data in the flash ROM 4 to the host. After the transfer is completed, the next read command is issued to the flash ROM 4.

(9)(5)に戻る。
書き込み時には、次のように4つのフラッシュROMを順番に転送することにより、フラッシュROMの待ち時間の間に他のデータを転送することになり、高速化することができる。
(9) Return to (5).
At the time of writing, by sequentially transferring the four flash ROMs as follows, other data is transferred during the waiting time of the flash ROM, and the speed can be increased.

(1)フラッシュROM1にデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (1) A data input command is issued to the flash ROM 1, write data is transferred, and a write command is issued.

(2)フラッシュROM2にデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (2) A data input command is issued to the flash ROM 2, write data is transferred, and a write command is issued.

(3)フラッシュROM3にデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (3) A data input command is issued to the flash ROM 3, write data is transferred, and a write command is issued.

(4)フラッシュROM4にデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (4) A data input command is issued to the flash ROM 4, write data is transferred, and a write command is issued.

(5)フラッシュROM1の書き込み完了待ちをし、エラー判定を行う。正常に書き込みが完了すればデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (5) Wait for completion of writing in the flash ROM 1 and perform error determination. If writing is completed normally, a data input command is issued, write data is transferred, and a write command is issued.

(6)フラッシュROM2の書き込み完了待ちをし、エラー判定を行う。正常に書き込みが完了すればデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (6) Wait for completion of writing in the flash ROM 2 and perform error determination. If writing is completed normally, a data input command is issued, write data is transferred, and a write command is issued.

(7)フラッシュROM3の書き込み完了待ちをし、エラー判定を行う。正常に書き込みが完了すればデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (7) Wait for completion of writing in the flash ROM 3 and determine an error. If writing is completed normally, a data input command is issued, write data is transferred, and a write command is issued.

(8)フラッシュROM4の書き込み完了待ちをし、エラー判定を行う。正常に書き込みが完了すればデータ入力コマンドを発行し、書き込みデータを転送し、書き込みコマンドを発行する。   (8) Wait for completion of writing in the flash ROM 4 and perform error determination. If writing is completed normally, a data input command is issued, write data is transferred, and a write command is issued.

(9)(5)に戻る。   (9) Return to (5).

ガーベージコレクション時のクラスタデータの転送時には、従来は、クラスタデータを一旦RAM等の記憶部に読み込んでから書き込む必要があった。本装置では、R/W Strobe信号を両方のグループに同時に出すことによって、1回の動作で読み込みと書き込みを同時に行うことができる。これにより、グループ間のデータ転送を高速に行うことができる。ブロックを消去する際にも、ほぼ同時にコマンドを発行するために、1回の実行時間で4つのブロックを消去できる。   Conventionally, when transferring cluster data during garbage collection, it has been necessary to read the cluster data once into a storage unit such as a RAM. In this apparatus, by simultaneously outputting R / W Strobe signals to both groups, reading and writing can be performed simultaneously in one operation. Thereby, data transfer between groups can be performed at high speed. Even when erasing a block, four commands can be erased in one execution time in order to issue commands almost simultaneously.

本装置では、ECC単位内に含まれるECC情報は、ランダムな2ビットのエラー検出、1ビットのエラー訂正可能な3バイトのECC情報である。したがって、1セクタ当たり(それぞれのECC単位において)4ビットまでのエラー検出、2ビットまでのランダムエラーを訂正できる。この他にも、Read−Solomon符号等のより多くのビットのエラー検出/訂正ができるECCを使用すれば、より高信頼性を確保できる。。   In this apparatus, the ECC information included in the ECC unit is 3-byte ECC information capable of random 2-bit error detection and 1-bit error correction. Therefore, error detection of up to 4 bits per sector (in each ECC unit), and random errors of up to 2 bits can be corrected. In addition to this, higher reliability can be ensured by using an ECC such as a Read-Solomon code that can detect and correct errors in more bits. .

外部記憶用フラッシュROMが接続されるディジタルカメラ等、大容量のフラッシュROM接続対応電子機器に適用可能である。   The present invention can be applied to a large-capacity flash ROM connection compatible electronic device such as a digital camera to which an external storage flash ROM is connected.

本発明の実施形態であるフラッシュROM制御装置の構成図1 is a configuration diagram of a flash ROM control device according to an embodiment of the present invention. フラッシュROMのリード時のタイミングチャートTiming chart for reading flash ROM フラッシュROMのライト時のタイミングチャートTiming chart when writing to flash ROM 単位エリアの関係を示す図Diagram showing the relationship between unit areas ホストからの読み込み要求に対する従来装置と本装置のデータの読み込み方式を示す図The figure which shows the data reading method of the conventional device and this device with respect to the read request from the host テーブル構成図Table structure テーブル記憶内容を示す図Figure showing table storage contents FATファイルシステムとフラッシュROMとのデータ領域の対比図Comparison of data area between FAT file system and flash ROM 従来装置に対して本装置の書き込み方式が高速である理由を示す図Diagram showing the reason why the writing method of this device is faster than the conventional device 本発明の第1の実施例の構成図Configuration diagram of first embodiment of the present invention 物理クラスタへのアクセス順序を示す図Diagram showing access order to physical cluster リードコマンド発行時の動作を示すフローチャートFlow chart showing the operation when issuing a read command ライトコマンド発行時の動作を示すフローチャートFlow chart showing operation when write command is issued ホストI/FからフラッシュROMへのクラスタデータの書き込み手順を示すフローチャートFlow chart showing a procedure for writing cluster data from the host I / F to the flash ROM RAMからフラッシュROMへのクラスタデータの書き込み手順を示すフローチャートFlowchart showing a procedure for writing cluster data from RAM to flash ROM ソースクラスタデータをRAMへ保存する動作を示すフローチャートFlow chart showing operation for saving source cluster data to RAM 書き込みエラー処理を示すフローチャートFlow chart showing write error processing 新しい書き込みクラスタ番号を取得する時の動作を示すフローチャートFlow chart showing the operation when a new write cluster number is acquired 世代交代処理を示すフローチャートFlow chart showing generation change processing ガーベージコレクションの動作を示すフローチャートFlow chart showing garbage collection operations 本装置のガーベージコレクションの優位性を示す図Diagram showing the superiority of garbage collection of this device ガーベージコレクション時のフラッシュROM間コピーについて説明するための図Illustration for explaining flash ROM copy at the time of garbage collection 本発明の第2の実施例の構成図Configuration diagram of the second embodiment of the present invention 物理クラスタへのアクセス順序を示す図Diagram showing access order to physical cluster

Claims (8)

フラッシュROMの消去単位がブロック単位であるフラッシュROMとホストとの間に接続されるフラッシュROM制御装置において、
前記ブロック単位よりも小さい所定単位当たりの論理アドレスを物理アドレスに変換するための論理→物理変換テーブルと、
前記所定単位以下の物理アドレスを論理アドレスに変換するための物理→論理変換テーブルと、
ホストからの書込み要求時に、フラッシュROMの未使用単位エリアに書き込むとともに、前記論理→物理変換テーブルと物理→論理変換テーブルの更新を行う制御部とを備え、
前記制御部は、前記論理→物理変換テーブルの更新時に、同一論理アドレスに対する物理アドレスの変更回数を世代番号として前記論理→物理変換テーブルに記憶する処理と、世代番号が所定の最大値になると該最大値になった世代番号の論理アドレスに対応する全ての物理アドレスを前記物理→論理変換テーブルを参照することで抽出してこれを無効化する処理と、前記無効化処理を行ったときに、有効エリアのなくなったブロックを見つけると、そのブロックを消去する処理とを行うことを特徴とするフラッシュROM制御装置。
In a flash ROM control device connected between a flash ROM whose flash ROM erase unit is a block unit and a host,
A logical to physical conversion table for converting a logical address per predetermined unit smaller than the block unit into a physical address; and
A physical-to-logical conversion table for converting physical addresses below the predetermined unit into logical addresses;
A controller that writes to the unused unit area of the flash ROM at the time of a write request from the host and updates the logical → physical conversion table and physical → logical conversion table,
The control unit, when updating the logical → physical conversion table, stores the number of physical address changes for the same logical address in the logical → physical conversion table as a generation number, and when the generation number reaches a predetermined maximum value, When all physical addresses corresponding to the logical address of the generation number that has reached the maximum value are extracted by referring to the physical-to-logical conversion table and invalidated, and when the invalidation processing is performed, A flash ROM control device, wherein when a block having no effective area is found, a process of erasing the block is performed.
前記各ブロックの有効エリア数、不良有無を記憶するブロックステータステーブルをさらに備え、
前記制御部は、前記ブロックステータステーブルを参照して有効エリアのなくなったブロックを見つけることを特徴とする請求項1記載のラッシュROM制御装置。
A block status table for storing the number of valid areas of each block and the presence or absence of defects;
Wherein the control unit, flash ROM control apparatus according to claim 1, wherein the finding the block that are no longer effective area by referring to the block status table.
前記世代番号は、論理アドレス毎に初期値を異ならせたことを特徴とする請求項1記載のフラッシュROM制御装置。 2. The flash ROM control device according to claim 1, wherein the generation number has a different initial value for each logical address. 前記制御部は、前記世代番号が前記最大値以上になって前記無効化処理が行われると、世代番号を初期値に戻す世代交代処理を行うこと特徴とする請求項1に記載のフラッシュROM制御装置。 2. The flash ROM control according to claim 1, wherein when the generation number becomes equal to or greater than the maximum value and the invalidation process is performed, the control unit performs a generation change process for returning the generation number to an initial value. apparatus. 前記論理→物理変換テーブルは前記物理→論理変換テーブルよりも小さく設定され、ホストに対し、アクセス可能な物理アドレスの大きさを実際の大きさよりも小さくみせることを特徴とする請求項1記載のフラッシュROM制御装置。 2. The flash according to claim 1, wherein the logical-to-physical conversion table is set to be smaller than the physical-to-logical conversion table, and the size of an accessible physical address is made smaller than an actual size to the host. ROM control device. フラッシュROMへの書込み又は読み込み単位が前記ブロック単位よりも小さなページ単位であり、
前記所定単位は、前記ブロック単位以下で且つ前記ページ単位以上の大きさのクラスタ単位である、請求項1に記載のフラッシュROM制御装置。
The unit of writing or reading to the flash ROM is a page unit smaller than the block unit,
The flash ROM control device according to claim 1, wherein the predetermined unit is a cluster unit having a size equal to or smaller than the block unit and equal to or larger than the page unit.
ホストからの読み込み又は書込み単位が前記ページ単位以下のセクタ単位であり、前記セクタは、フラッシュROM内において複数のデータ部と各データ部に対応したエラー訂正コードであるECCを含み、
前記セクタは、フラッシュROM内においてデータ部と該データ部に対応するECCとを組にして組毎に記憶され、
前記制御部は、読み込み時において、データ部とECCの組を読み込むときに、同時にそれまでに読み込んでいた他の組のデータ部をホストに転送する制御を行い、これにより高速化することを特徴とする請求項6に記載のフラッシュROM制御装置。
The read or write unit from the host is a sector unit equal to or less than the page unit, and the sector includes a plurality of data portions and ECC that is an error correction code corresponding to each data portion in the flash ROM,
The sector is stored for each set of a data portion and an ECC corresponding to the data portion in the flash ROM.
The control unit performs a control to transfer another set of data units read up to that time to the host at the same time when reading a set of the data unit and the ECC at the time of reading, thereby speeding up. The flash ROM control device according to claim 6.
前記制御部は、前記有効エリアのなくなったときに行うブロックの消去処理をしても未使用ブロック数が一定以上にならないときに、ガーベージコレクション処理を行うことを特徴とする請求項1記載のフラッシュROM制御装置。 2. The flash according to claim 1, wherein the control unit performs a garbage collection process when the number of unused blocks does not exceed a predetermined value even if a block erasing process is performed when the effective area runs out. 3. ROM control device.
JP2003347469A 2003-10-06 2003-10-06 Flash ROM control device Expired - Fee Related JP4242245B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003347469A JP4242245B2 (en) 2003-10-06 2003-10-06 Flash ROM control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003347469A JP4242245B2 (en) 2003-10-06 2003-10-06 Flash ROM control device

Publications (2)

Publication Number Publication Date
JP2005115561A JP2005115561A (en) 2005-04-28
JP4242245B2 true JP4242245B2 (en) 2009-03-25

Family

ID=34540033

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003347469A Expired - Fee Related JP4242245B2 (en) 2003-10-06 2003-10-06 Flash ROM control device

Country Status (1)

Country Link
JP (1) JP4242245B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106104009A (en) * 2014-06-24 2016-11-09 株式会社新柯隆 Oil diffusion pump and the oil vapour generator for this oil diffusion pump

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8341371B2 (en) * 2005-01-31 2012-12-25 Sandisk Il Ltd Method of managing copy operations in flash memories
JP5130646B2 (en) * 2005-06-06 2013-01-30 ソニー株式会社 Storage device
JP2007048184A (en) * 2005-08-12 2007-02-22 Renesas Technology Corp Memory card
KR100789406B1 (en) 2006-11-03 2007-12-28 삼성전자주식회사 Flash memory system and garbage collection method therof
JP5137413B2 (en) * 2006-11-28 2013-02-06 株式会社日立製作所 Semiconductor memory device
JP4535117B2 (en) * 2007-11-06 2010-09-01 ソニー株式会社 MEMORY DEVICE, MEMORY MANAGEMENT METHOD, AND PROGRAM
JP4643671B2 (en) * 2008-03-11 2011-03-02 株式会社東芝 Memory system
JP2009252255A (en) * 2008-04-01 2009-10-29 Renesas Technology Corp Nonvolatile semiconductor memory device
KR20130019795A (en) * 2011-08-18 2013-02-27 영남대학교 산학협력단 Electronic device for storing data on pram and memory control method thereof
JP2013174972A (en) * 2012-02-23 2013-09-05 Toshiba Corp Memory system, controller and control method for memory system
KR102316198B1 (en) * 2015-06-12 2021-10-25 삼성전자주식회사 Method for accessing file, computer, and executable software product stored on computer-readable medium
JP6414852B2 (en) * 2015-12-14 2018-10-31 東芝メモリ株式会社 Memory system and control method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106104009A (en) * 2014-06-24 2016-11-09 株式会社新柯隆 Oil diffusion pump and the oil vapour generator for this oil diffusion pump
CN106104009B (en) * 2014-06-24 2017-09-08 株式会社新柯隆 Oil diffusion pump and the oil vapour generator for the oil diffusion pump

Also Published As

Publication number Publication date
JP2005115561A (en) 2005-04-28

Similar Documents

Publication Publication Date Title
CN109144888B (en) Memory system
JP4524309B2 (en) Memory controller for flash memory
US10909030B2 (en) Enhanced trim command support for solid state drives
JP4079506B2 (en) Method for controlling nonvolatile semiconductor memory system
USRE45222E1 (en) Method of writing of writing to a flash memory including data blocks and log blocks, using a logical address having a block address portion and page identifying portion, a block address table and a page table
US8051258B2 (en) Apparatus and methods using invalidity indicators for buffered memory
US8219776B2 (en) Logical-to-physical address translation for solid state disks
US8166233B2 (en) Garbage collection for solid state disks
JP3692313B2 (en) Nonvolatile memory control method
JP4633802B2 (en) Nonvolatile storage device, data read method, and management table creation method
US20080120488A1 (en) Apparatus and method of managing nonvolatile memory
JP2005516264A (en) Method and apparatus for reducing block write operation time performed on non-volatile memory
JP5137413B2 (en) Semiconductor memory device
US10310764B2 (en) Semiconductor memory device and storage apparatus comprising semiconductor memory device
TW200527433A (en) Memory card and semiconductor device
WO2000002126A1 (en) Method and apparatus for performing erase operations transparent to a solid state storage system
CN110321065B (en) Storage device and computer system
WO2006098212A1 (en) Memory controller, nonvolatile storage device, nonvolatile storage system and data write method
US9389998B2 (en) Memory formatting method, memory controller, and memory storage apparatus
JP4242245B2 (en) Flash ROM control device
US20100318726A1 (en) Memory system and memory system managing method
JPH10124384A (en) Method for controlling non-volatile semiconductor memory
JP4460967B2 (en) MEMORY CARD, NONVOLATILE SEMICONDUCTOR MEMORY, AND SEMICONDUCTOR MEMORY CONTROL METHOD
JP2007293917A (en) Method for controlling memory system
JP2005115562A (en) Flash rom controller

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20060403

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20060403

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060721

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080918

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080930

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081030

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

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

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313532

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20120109

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20150109

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees