JP3587204B2 - Storage device - Google Patents

Storage device Download PDF

Info

Publication number
JP3587204B2
JP3587204B2 JP2002320623A JP2002320623A JP3587204B2 JP 3587204 B2 JP3587204 B2 JP 3587204B2 JP 2002320623 A JP2002320623 A JP 2002320623A JP 2002320623 A JP2002320623 A JP 2002320623A JP 3587204 B2 JP3587204 B2 JP 3587204B2
Authority
JP
Japan
Prior art keywords
data
flash memory
physical sector
sector
memory
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
JP2002320623A
Other languages
Japanese (ja)
Other versions
JP2003203016A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2002320623A priority Critical patent/JP3587204B2/en
Publication of JP2003203016A publication Critical patent/JP2003203016A/en
Application granted granted Critical
Publication of JP3587204B2 publication Critical patent/JP3587204B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【産業上の利用分野】
本発明は携帯用の小型情報処理機器の補助記憶装置にかかり、特にフラッシュメモリを用いた半導体ファイル記憶装置及びそれを搭載する情報機器に関する。
【0002】
【従来の技術】
情報機器の補助記憶装置の従来技術としては磁気記憶装置が最も一般的であるが、磁気記憶装置では書き込むファイルをセクタと呼ぶ記憶単位に分割し、記憶媒体の物理的な位置に対応させて記憶する。すなわちあるファイルの書き換えにおいては基本的に同一位置に書き込みが行われ、書き込みデータが増えるとその分だけ新たなセクタへの書き込みを行う。これに対し別の補助記憶装置として光ディスク装置が挙げられる。現在一般的な光ディスクは、書き込みが一回だけ可能で消去は不可能である。従って一度書き込んだファイルの書き換え時は実際には書き換えを行わず、別の領域に書き込んで以前書き込んだデータは無効にして以後読み出さないようにする。つまり磁気ディスク装置と異なり、書き換えデータと記憶場所には全く関連性を持たせない、という方式で補助記憶装置の機能を果たしている。以上のようなディスクを回転させて大容量のデータを高速にアクセスし、補助記憶装置の機能を果たす記憶装置に対し、半導体メモリを用いて補助記憶装置とする半導体ファイル記憶装置が近年脚光を浴びている。特に電気的に書き換えが可能な不揮発性メモリ(以下EEPROMと記す)を用いたものが今後半導体ファイル記憶装置の主流になると考えられる。それを実現する一つの技術として特開平3−25798がある。これはEEPROMを用いた記憶装置であり、EEPROMの欠点である書き換え消去回数の制限を保護し、EEPROMを用いて実用的な記憶装置を実現する方式である。その概要を説明すると複数のメモリ素子を用意し、各素子の消去書き換え回数を記録して管理し、EEPROMの書き換え保証回数より小さなある規定回数に達したら用意してあったメモリ素子に切り替えて使用することにより、記憶データの保護を図るものである。
【0003】
【発明が解決しようとする課題】
フラッシュメモリは不揮発性のメモリであるため、当然のことながら非動作時には電源の供給を停止してもフラッシュメモリ内のデータが失われることはない。しかしながらいくらデータが保存されていても、テーブルの内容が失われると、どのセクタに何のデータが格納されているかがわからなくなり、フラッシュメモリ内のデータは正体不明の無意味なデータと化してしまう。そのためテーブルに格納されているデータも電源供給停止後に保存されている必要がある。ただしテーブル内の全てのデータを保存する必要はない。
【0004】
【課題を解決するための手段】
本発明の記憶装置は、フラッシュメモリが、物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報(例えば、物理セクタテーブル)を格納し、制御部が、システムの起動の際に、フラッシュメモリに格納された物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を用いて、論理セクタ番号のデータがフラッシュメモリのどこの物理セクタに記憶されているかを参照するための情報(例えば、論理セクタテーブル)を、揮発性メモリに作成し、さらに、制御部が、アクセス要求に応答して、揮発性メモリに作成された論理セクタ番号のデータがフラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、ホストシステムによって指定された論理セクタ番号に対応するフラッシュメモリの物理セクタを割り出し、割り出されたフラッシュメモリの物理セクタをアクセスする。
本発明の記憶装置は、フラッシュメモリが、物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報(例えば、物理セクタテーブル)を格納し、制御部が、電源供給が開始される際に、フラッシュメモリに格納された物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を用いて、論理セクタ番号のデータがフラッシュメモリのどこの物理セクタに記憶されているかを参照するための情報(例えば、論理セクタテーブル)を、揮発性メモリに作成し、さらに、制御部が、アクセス要求に応答して、揮発性メモリに作成された論理セクタ番号のデータがフラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、ホストシステムによって指定された論理セクタ番号のデータが記憶されたフラッシュメモリの物理セクタを割り出し、割り出されたフラッシュメモリの物理セクタをアクセスする。
本発明の記憶装置は、フラッシュメモリの各消去ブロックが、ホストシステムからのデータを格納するための第1の領域と、第1の領域の物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報(例えば、物理セクタテーブル)を格納するための第2の領域とを含み、制御部が、フラッシュメモリの各消去ブロックの第2の領域に格納された物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を用いて、論理セクタ番号のデータがフラッシュメモリのどこの物理セクタに記憶されているかを参照するための情報(例えば、論理セクタテーブル)を、揮発性メモリに作成し、制御部が、アクセス要求に応答して、揮発性メモリに作成された論理セクタ番号のデータがフラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、ホストシステムによって指定された論理セクタ番号のデータが記憶されたフラッシュメモリの物理セクタを割り出し、割り出されたフラッシュメモリの物理セクタをアクセスする
【作用】
上記手段によれば、物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報(例えば、物理セクタテーブル)をフラッシュメモリに記憶することから、電源の供給を停止しても、物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報が失われることがなく、それ故、フラッシュメモリ内のデータが正体不明の無意味なデータと化すのを防ぐことができる
【0005】
【実施例】
以下に本発明の実施例を述べる。まず第1の実施例を図1、図2、図3及び図4により説明する。図1は第1の実施例を実現するためのハードウエア構成であり、図2は本実施例に用いるフラッシュメモリチップの内部構成を示した図であり、図3は格納データ管理のメインルーチンのフローチャートであり、図4は消去管理ルーチンのフローチャートである。
【0006】
最初に図2によりフラッシュメモリの動作について述べる。図中11はメモリチップ全体、12はデータ書き込み単位、13はデータ消去の最小単位で消去ブロックと呼ぶこととする。フラッシュメモリは電気的消去可能なPROMであり、一種のEEPROMであるが、ノーマルなEEPROMがデータの書き込み単位と消去(書換え)単位が同一であるのに対し、フラッシュメモリは書き込み単位より消去単位が極めて大きく、一度書き込んだデータを書き換えるためには他の多くのデータも同時に消去しなければならない。その代りの利点としてノーマルなEEPROMより集積度を高くでき、大容量の記憶装置に適している。図2においてメモリチップ全体11が一つ以上の消去ブロック13に分割されており、書き込み単位12が1ワード(メモリにおけるワードでありメモリ構成に従う)であるのに対し、消去ブロック13はそれより大きい領域となる。フラッシュメモリを補助記憶装置として用いる際には、磁気ディスク装置の仕様に合わせ、512バイトを消去単位とすると使いやすくなる。
【0007】
次にこのメモリを用いた記憶装置の第1の実施例のシステム構成とその動作を図1及び図3、図4を用いて説明する。なお以下の説明ではファイルデータの記憶単位をセクタと呼ぶこととし、本実施例では1セクタが1消去ブロックと一致するものとする。図中、1はファイルデータの記憶をするフラッシュメモリチップ群、2はフラッシュメモリ1のアクセス信号を生成するアクセスコントローラ、3は記憶データやステータスデータを操作してフラッシュメモリによる外部記憶システムを構築するマイクロプロセッサ、4はプロセッサ3を動作させる制御プログラムを格納したプログラムメモリ、5はある論理アドレスで示されるセクタ(論理セクタ)のデータがフラッシュメモリ1上のどこにマッピングされているかを参照するための論理セクタテーブル、6はフラッシュメモリ1上の物理的なアドレスで示される物理セクタにマッピングされたファイルデータの論理セクタ番号を参照するための物理セクタテーブル、7は各物理セクタの消去回数の累計を記録する消去回数管理テーブル、8は各物理セクタのステータスを参照するステータステーブル、9はデータの書き込みを高速化するために書き込みデータを一時的に保存するライトバッファである。次に動作を説明する。本システムに対しデータのアクセス要求をするシステム(ホストシステム)よりデータのリードアクセス要求があると、プロセッサ3は論理セクタテーブル5を参照して該当する論理セクタが格納されている物理セクタを割り出し、その物理セクタをアクセスして要求されたデータをホストシステムに送出する。ホストシステムからのデータの書き込み要求に対しては、図3のフローチャートを用いて説明する。図3のフローチャートはプログラムメモリ4に格納されているプログラムのメインルーチンのフローチャートでありその流れを説明すると、まず、次のデータの書き込みをするセクタを示す書き込みポインタが設定されており、このポインタが示すセクタが書き込み可能な状態にあるかをステータステーブル8により判別する(a)。ステータステーブルでは消去回数が多くなり劣化して使いものにならなくなったことを示すフラグやすでにデータが書き込まれていることを示すフラグがあり、これらが立っていて書き込み不可能であれば次のセクタにポインタを移す(b)。そして書き込み可能であればそのセクタへのデータの書き込みを行う(c)。そして既に一度書き込んだことのある論理セクタの書き換えである場合は、前回書き込んだ当該論理セクタのデータはもはや不要であるため、論理セクタテーブルより不要になったデータが書き込まれている物理セクタを捜し出してこれを消去し、同時に前回の書き込みの際に書いた物理セクタテーブル6の内容を消去する(d)。セクタの消去が行われたら消去管理ルーチンへ飛ぶ。消去管理ルーチンについては後述する。そして論理セクタテーブル5に書き込みポインタの示す物理セクタ番号を、物理セクタテーブル6には書き込みポインタの示す場所に書き込んだ論理セクタ番号を書き込む(e)。なお(b)においてはデータが書き込まれているかの判断をステータステーブル8に書き込むことにしても良いし、物理セクタテーブル6により判断することもできる。物理セクタテーブル6は未書き込みセクタである場合には全ビットHにするかあるいはLにすれば判別が容易になる。次に先述の消去管理ルーチンについて図4を用いて説明する。まずデータを消去した物理セクタに対応する消去管理テーブルの消去回数カウンタを1インクリメントし(a)、消去回数が規定回数に達していなければメインルーチンに復帰し、規定回数に達していたら、データの入替えを行う(b)。データの入替えを行うためにはまず他の全セクタの消去管理テーブルを調べ、消去回数が最小でかつまだデータの入替えを行っていないセクタを捜しだす(c)。捜し当てた消去回数が最小のセクタに格納されているデータを、先程消去を行ったセクタに書き込む(d)。書き込みを行ったら両セクタのステータステーブルの入替えフラグを立てる(e)。この入替えフラグは、消去回数の少ない物理セクタが、本ルーチンにより消去が頻繁に起こるようになるのに、それを示す手段がないと再び消去回数が少ないセクタに選ばれてしまうことが考えられ、この時にデータを入れ替えた消去回数の多いセクタは、また消去が頻繁に起こるようになってしまう、ということが起こるのを防ぐものである。この入替えフラグを立てたら、該当する論理セクタテーブルの内容と物理セクタテーブルの内容を書き換える(f)。以上が終了したらメインルーチンに復帰する。なお消去回数が最小として選ばれたセクタは一度消去されることになるため、消去管理テーブルの消去回数カウンタをインクリメントする必要がある。また入替えフラグは全てのセクタのフラグが立ったらクリアされるか、あるいは論理の判断を反転する。つまり1のとき入替えが行われたと判断していたものを0になったら入替えが行われたことにする。また(b)の規定回数は、フラッシュメモリの書換え可能回数の保証値より小さな値の倍数とすべきで、例えば10000回の保証回数であれば、1000回の倍数回や、2000回、5000回の倍数回等が適当である。このルーチンにより、限られたブロックに消去が頻繁に起きたら消去回数の少ないブロックのデータと入替えをして、消去回数の多いブロックに消去があまり起きないセクタのデータを格納することにより、消去回数の平均化を図るものである。これは通常の補助記憶装置の格納データには大変効果があると考えられる。例えばオペレーションシステムプログラムを格納した領域ではデータの書換えは全く起きないが、アプリケーションプログラムのデータとなるグラフィックデータやテキストデータの領域では頻繁にデータの書換えが起きる。そのため消去回数の平均化を行わないと、システムプログラム領域のメモリはデータが変化しようがないため、消去回数の増加による劣化は全く起きないことになり、それ以外のデータ領域のメモリは限られたメモリ空間で頻繁に消去が行われ、消去回数を急増させることになる。つまり使用可能領域が少ない状態で特に大きな効果があるといえる。
【0008】
以上が第1の実施例の動作の説明である。本実施例によればプロセッサを搭載したことによりプログラムメモリの内容に従った細かな制御ができるようになり、またライトバッファにより書き込みの高速化が図れ、ステータステーブルを備えたことにより各セクタの状態を記録するのに拡張性がある。そしてフラッシュメモリの寿命を延ばすために、消去回数を管理した最適なファイル管理が行える効果がある。
【0009】
次に第2の実施例について図5、図6、図7、図8及び図9を用いて説明する。図5は第2の実施例におけるハードウエア構成であり、図6は本実施例におけるフラッシュメモリ内の記憶構成を示した図であり、図7はデータ書き込みのためのメインルーチンのフローチャート、図8は不必要なデータを格納したセクタを未書き込みセクタにするための整理ルーチンのフローチャート、図9は消去回数の管理をする消去管理ルーチンのフローチャートである。
【0010】
まず図6により本実施例におけるフラッシュメモリのチップとその使用法を説明する。図中、52は第1の実施例で用いたセクタと呼ぶファイルデータを記憶する記憶領域の単位である。53はデータ消去の最小単位で消去ブロックと呼び、複数のセクタ52により構成される。すなわち第1の実施例とは異なり消去ブロック53とセクタ52の記憶容量は異なるものとする。54はメモリチップ全体であり、図では複数の消去ブロックにより構成されているが、1チップに1消去ブロックであることも考えられる。本実施例ではセクタ単位にファイルデータの格納を行うが、そのファイルデータの書換えの要求があって消去するためには他のセクタも同時に消去されてしまうようなメモリチップに適応するものである。図5は本実施例のハードウエア構成で、図中、41は書き込みデータの記憶領域であるフラッシュメモリで一つ一つはメモリチップ54である。42はフラッシュメモリ41をアクセスするアクセスコントローラ、43は記憶データやステータスデータを操作するプロセッサ、44はプロセッサ3を動かすための制御プログラムが格納されているプログラムメモリ、45はフラッシュメモリ41の物理セクタ51が記憶している論理セクタ番号を参照するための物理セクタテーブル、46は記憶してある論理セクタ番号のデータがフラッシュメモリ1のどこの物理セクタに記憶されているかを参照するために物理セクタ番号が記録されている論理セクタテーブル、47は各ブロックの消去回数を記録する消去管理テーブル、48は各ブロックのステータスを記憶するステータステーブル、49は既書き込みセクタ数を参照するための書き込みセクタ数テーブル、50は書き込みの高速化を図るため、書き込みデータを一時的に保持するライトバッファ、51は整理ルーチンを行う際に用いる整理バッファである。
【0011】
次に動作を説明する。リードアクセス時は第1の実施例同様、論理セクタテーブル45と物理セクタテーブル46を参照して行う。一方ライトアクセスは、図7を用いて説明すると、まず書き込みポインタを設定し、その書き込みポインタで示されたブロックのステータステーブルを参照する(a)。すなわち本実施例における書き込みポインタはブロック単位のポインタである。そしてこわれていたら次のブロックにポインタを移す(b)。こわれていなければそのブロックの書き込みセクタ数テーブル49を参照する(c)。そして既にブロック内の全セクタが書き込み済であったら整理ルーチンに飛ぶ。整理ルーチンについては後述する。もし未書き込みセクタがあったらデータの書き込みを行い(d)、該当する書き込みセクタ数テーブルを1インクリメントする(e)。従って、例えば図6において一つ前の書き込みを第1ブロックの第3物理セクタに書き込んだ場合、次の書き込みは第1ブロックの第4物理セクタに書き込みを行うことになる。実際のライトアクセス制御はアクセスコントローラ2により行う。ここで書き込みを行ったブロックのセクタが全て書き込まれてしまったら整理ルーチンに飛ぶ(f)。そして書き込み後は物理セクタテーブルおよび論理セクタテーブルに書き込んだセクタ番号をそれぞれ記録する(g)。もし以前に書き込んでいる論理セクタの再書き込みであれば、以前物理セクタテーブルに書き込んだ論理セクタ番号を消去する。これはその物理セクタのデータは無効であることを示すための動作である。なお(f)の動作は整理時間短縮のために設けられておりフラッシュメモリの消去効率を高くするためには行うべきでない。次に整理ルーチンについて説明すると、整理ルーチンとは書き込みポインタの指し示すブロックがすでに全セクタ書き込まれており、書き込み不可能である時の動作ルーチンである。整理ルーチンが必要となる理由は、これまで説明した書き込み方法では同じファイルのデータの書き替えにおいて別の物理セクタへ書き込みを行う。すなわち書き換える前に書き込んだデータは不要となるがメモリ上には記憶されたままであり消去すべきデータである。しかし不要となるたびに消去していたのでは消去回数が有限であるフラッシュメモリにとっては寿命を短くすることになる。そこで整理ルーチンによって消去する。整理ルーチンはブロックが書き込みデータで一杯になったときに行う。整理の具体的な方法は、図8のフローチャートに従って行う。以下フローチャート内の各部の説明をする。整理ブロックの物理セクタテーブルを参照し、ブロック内に消去可能なセクタすなわち他の物理セクタに新たに書き換えられたため不必要となったセクタがないかをチェックする(a)。消去可能なセクタが一つもなかったらメインルーチンに復帰し、一つでもあったら整理を行う。まず整理するブロック内のデータを整理バッファ51に退避し(b)、整理するブロックの消去を行う(c)。消去を行ったら図9の消去管理ルーチンに飛ぶがこれについては後で説明する(d)。そして整理バッファの中で必要なセクタだけを整理するブロックに復帰させる(e)。復帰したときのセクタの位置は、元々の場所に復帰させれば論理セクタテーブル45や物理セクタテーブル46を書き換える必要がない。また復帰の際にはそのブロックの若いセクタ番号から埋めていく方法を取ると、次の新しいセクタの書き込みがし易くなるが、論理セクタテーブル45と物理セクタテーブル46を書き換える必要がある。いずれの場合も書き込みセクタ数テーブルは復帰したセクタ数に書き換えることになる(f)。次に消去管理ルーチンについて説明する。図9は消去管理ルーチンのフローチャートであり、基本的には第1の実施例で説明したものと同様であるが、消去の管理がセクタではなくブロック単位に行う点が異なる。まず消去が行われたブロックの消去回数が一定数に達したか、をチェックし(a)、もし達していなければこのルーチンを脱出。達していたら(b)全ブロックの消去回数を検索し、消去回数が最小のブロックを捜しだす(c)。整理を行ったブロックと消去回数が最小のブロックが一致していなければこの2つのブロックのデータを入れ替える(d)。入替えには図5の整理データバッファ51を利用する。そして入替えを行ったブロックの入替えフラグを立てる(e)。消去回数カウンタをインクリメントするとともに論理セクタテーブル及び物理セクタテーブルを書き換える(f)。以上が本実施例における消去管理ルーチンの動作である。第1の実施例同様このルーチンにより、限られたブロックに消去が頻繁に起きたら消去回数の少ないブロックのデータと入替えをして、消去回数の平均化を図るものである。
【0012】
以上が第2の実施例の動作説明である。本実施例によれば、消去ブロックが書き込むセクタの単位としては大き過ぎるときに、消去ブロックを分割して効率良く使える効果がある。
【0013】
次に第3の実施例を図10、図11及び図12を用いて説明する。本実施例においてはメモリチップは第1の実施例と同様の図2の消去ブロックとセクタの容量が一致するものとするが、使用時は図10に示す構成をとる。図中91は複数のセクタよりなるブロックである。本実施例ではセクタと消去ブロックの単位が同一であるため本実施例のブロック91は複数の消去ブロックで構成されることになる。既出の他の番号は図2あるいは図6と同様のものである。ハードウエア構成は図11に示したものであり図中101はブロック91ごとの消去回数を記録した消去管理テーブルであり、詳細は後述するが結果的にブロック91内の消去回数の累計を記憶することになる。他は図1、図5と同様のものである。図12は本実施例の消去管理ルーチンのフローチャートであり、メインルーチンは図3と同様である。メインルーチンの動作は第1の実施例の説明に従うとして、メインルーチンから消去管理ルーチンに飛んでからの動作を図12により説明する。まず消去を行ったセクタを含むブロックの消去管理テーブルの回数カウンタを1インクリメント(a)。消去回数が規定値に達したかを判別し(b)、達していたら前ブロックの消去回数を調べて回数が最小で、かつまだデータの入替えを行っていないブロックを割り出し(c)、2つのブロックのデータを入替える(d)。そして入替えフラグを立てるとともに(e)、各テーブルの内容を書き換える(f)。本実施例の特徴はセクタ単位の消去ができるメモリにおいて消去管理を複数のセクタで行うことにより、消去管理の簡便化を図って、大きなファイルの書換えにおける待ち時間の節約と、消去管理テーブルの削減ができるという効果が期待できる。従って大容量の記憶装置で、消去管理をセクタごとに行うことが困難な場合に適応する。
【0014】
ところでこれまで説明した実施例で構成要素となっていた論理セクタテーブル、物理セクタテーブルなどのテーブルについて説明を加える。フラッシュメモリは不揮発性のメモリであるため、当然のことながら本発明のシステムは非動作時には電源の供給を停止してもフラッシュメモリ内のデータが失われることはない。しかしながらいくらデータが保存されていても、テーブルの内容が失われると、どのセクタに何のデータが格納されているかがわからなくなり、フラッシュメモリ内のデータは正体不明の無意味なデータと化してしまう。そのためテーブルに格納されているデータも電源供給停止後に保存されている必要がある。ただしテーブル内の全てのデータを保存する必要はない。例えば論理セクタテーブルのデータは物理セクタテーブルのデータから容易に作成可能である。逆もまた可能であるのでつまりどちらか一方のデータが保存されていれば良いことになる。そこで物理セクタテーブルを電気的消去可能で書き込み可能な不揮発性メモリ(EEPROM)に記憶し、論理セクタテーブルは電源供給を開始するシステムの起動時に物理セクタテーブルより作成することとする。こうすると論理セクタテーブルは揮発性のメモリを使用できる。またこれと同様に各ブロックの使用セクタ数テーブルも物理セクタテーブルより作成可能であるため、システムの起動時に揮発性メモリに作成する。これらのテーブルはメインシステムの主メモリ上に展開することも可能である。その他のテーブルについては、消去管理テーブル、ステータステーブルがあるが、これらは他のテーブルからの作成は不可能であり、消去管理テーブルはデータが失われるべきでないためEEPROMに記憶する。ステータステーブルはもう一度書き込みや消去をしたときに得られるが、二度手間になるためEEPROMに記憶すべきである。しかしメモリの節約のため揮発性メモリに記憶することもできる。これらテーブルの記憶媒体としては同じメモリに格納してチップ数を減らすこともできる。例えば物理セクタテーブルと消去回数テーブルはどちらも不揮発性メモリに格納すべきであるため、同じEEPROMチップに格納してEEPROMは1チップだけにすることができる。またプロセッサをワンチップマイコンとした場合は、使用セクタ数テーブルなどの比較的小さなテーブルはワンチップマイコンに内蔵されているRAMコアに格納する。これらをまとめた第4の実施例の構成図を図13に示した。図中、111はRAM、ROMを内蔵したワンチップマイコン、112はワンチップマイコン内のRAMコア、113はワンチップマイコン内のROMコア、114はEEPROMチップ、115はSRAMまたはDRAM、以下既出の番号は、前述と同様のものである。RAMコア112には使用セクタ数テーブルを格納し、ROMコア113にはマイコンの制御プログラムを格納し、EEPROM114には物理セクタテーブル及び消去管理テーブルを格納し、RAM115には論理セクタテーブルを格納する。またRAM115の空き領域では図9で示した整理ルーチンを行う際の整理データバッファ、及び書き込みの高速化を図るライトバッファとしても用いることとする。このように本実施例によれば記憶媒体の特徴にあわせ、テーブル、バッファ類をまとめてチップ数の削減を図ることができる。これに対し、図24はEEPROMを省略した構成となる実施例である。これは第4の実施例で説明した不揮発性のテーブルデータをフラッシュメモリ1に格納することにより実現する。図中、116はフラッシュメモリ1内に設けたテーブル格納領域である。ただしフラッシュメモリはテーブルデータのような小さい単位のデータの更新には適さないため、フラッシュメモリ1にテーブルのデータを格納するのは電源遮断の直前とし、通常の使用状態においては揮発性のDRAMやSRAM115に格納するものとする。つまり本発明のシステムの電源を遮断する際に、RAM115の内容のうち必要なデータをフラッシュメモリ1に転送してから電源を遮断し、次に電源を投入した時にフラッシュメモリ1からRAM115にデータをロードしてから通常の動作を開始する。従ってフラッシュメモリにはテーブル格納用の記憶領域116を常に確保しておく必要がある。ただしこの格納位置を固定とする必要はない。固定としなかった場合はあらかじめテーブルを格納するアドレスを示す領域を設けておき、テーブルを格納したアドレスを常に記録しておくことにより、電源立ち上げ時にテーブルの位置をサーチする必要がなくなる。
【0015】
またさらにフラッシュメモリ自体の構成における実施例を図14、図15、図16及び図23に示した。図14はフラッシュメモリチップ内に消去ブロック単位にデータ領域と異なるテーブル用の記憶領域を持たせたものであり、これに各ブロックごとの物理セクタテーブルや消去回数を書き込むことによりEEPROMを省略できる。図中、131は消去ブロック、132は消去ブロック131ごとに付加されるテーブル用の記憶領域である。消去ブロック131に対応するテーブル132に格納されたデータは消去ブロック131と同一のアドレスでアクセス可能とし、信号線による選択やモードの選択によりファイルデータとテーブルのデータを出し分ける。このようにするとデータ領域とテーブル領域の寿命が一致し、データ領域131が使用可能なのに、テーブルがこわれて使用不能に陥るということがなくなる。データ領域とテーブル領域が接近していればその傾向がさらに強くなる。そして消去ブロックごとにテーブルを構成するためアドレスラインの共有化が簡単に実現する。テーブル用の記憶領域132の一例を図23(a)に示した。図中、133は消去単位1ブロック全体を表し、134はブロック内のファイルデータ領域、135はそのブロックの論理番号を格納する領域で8ビットの記憶容量を持つ。136はそのブロックの状態を示すステータステーブルで16ビットの容量である。ステータステーブル136の内容は、消去回数管理テーブル、使用不能フラグ、入替え済みフラグ、訂正フラグ等が挙げられる。このステータステーブル136で余ったビットをブロック番号格納に用いることもできる。図23(b)はさらにエラー訂正領域を持たせたテーブル領域132の一例であり、137はエラー訂正個所を示す領域である。これは訂正能力に応じて記憶容量を設定することとする。たとえば1ワード16ビットのワード構成で、消去ブロックが512Bの構成のメモリチップに対してエラー訂正領域が8ビットであれば、1ワード訂正能力を持つ。つまり不良ビットの存在するワード番号をここに書き込んでおき、訂正データを他の領域に書き込んでおけば、読み出しの際にそのワードのデータを置き換えてしまうことにより実現する。訂正データ領域をこのテーブル内に持たせてもよいし、他の記憶領域にまとめておく方法もある。前者ではデータ訂正をテーブル内で全てまかなうことができるが1ブロックごとに訂正データ領域を持つこととなるためチップ全体で冗長領域が大きくなってしまう。後者では訂正データが書き込まれている領域を示す手段が必要になり、また他の記憶領域をアクセスするためアクセス時間が大きくなってしまうが、訂正データ数に応じて冗長記憶領域を大きくも小さくも設定できる。なお訂正データが書き込まれている領域の指定はステータステーブル領域136の余りビットを使用すると良い。また訂正データ領域の一例として図15を用いて説明する。図15はデータの記憶領域とは別に1バイトや1ワード等の細かい単位で書き込み消去ができるEEPROMタイプの記憶領域138を持たせたものであり、この領域を訂正データテーブルとして、訂正データを書き込んでおき訂正すべき個所のデータの読み出しの際に指定された位置のデータを読み出して置き換えることによりデータ訂正が実現する。また図15は、テーブル領域の構成を、対応するデータ領域の消去ブロックの付近に構成せず、一まとめにして同様の効果を狙った実施例と考えることもできる。この場合図内の構成要素は図14と同様であり、メモリセルの構成がチップ内で一まとめになるため、図14のメモリセルの構成より簡略化される効果がある。
【0016】
また図16は別の構成のフラッシュメモリチップである。データの記憶領域141とは別に、データを一時的に保持するバッファ領域142をメモリチップ内に持たせたものであり、この部分は揮発性のメモリでもよい。143はクロック入力によりカウントアップするアドレスカウンタである。ライトアクセス時はライトデータをバッファ領域142に書き込み、アドレスを入力することにより複数のデータを一気にデータ領域141に転送し書き込めるようにする。このようなメモリを用いれば書き込みの高速化を図る外付けのライトバッファを省略できる。またリード時にも逆にデータ領域141からアドレスを入力することにより複数のデータを一度にバッファ領域142に転送できれば、リードアクセスも簡略化される。この場合バッファはシリアルアクセスメモリとして連続アドレスの入力が必要でなく、内部にアドレスカウンタ143を備え、クロックを入力すれば内部のアドレスカウンタがカウントアップし、連続した領域をアクセスしてデータを出力できるようにすればさらに使い勝手が良くなる。なおバッファ領域はセクタを1単位として構成するのが最も効果的であり、1単位分に限らず複数単位分構成するとバッファ効果を向上させることができる。例えば1セクタが消去ブロック単位であった場合、1セクタのデータを格納するバッファが1つ備えられていれば、1セクタの書き込み読み出しが一度に行われるようになるが、複数備わっていれば複数のセクタのデータの書き込みを受け入れることができ、また読み出しデータを用意することができる。そしてこのバッファを利用すれば外付けの整理バッファも省略できる効果がある。
【0017】
次にこれまでの実施例で説明してきたフラッシュメモリを用いた記憶装置を情報処理システムに応用する実施例について説明する。図17はフラッシュメモリを用いた記憶装置(以下、フラッシュファイルシステムと称す)を情報処理システム(以下ホストと称す)と接続するためのインタフェース回路を説明する図であり、図中201はホストの外部I/Oバスであり、標準的なバスとしてはISA、EISA、マイクロチャネル、SCSIなどのバスが挙げられる。202は標準バスを専用バスに変換するためのバスバッファあるいはバスコントローラであるが、これが省略されるシステムも考えられる。これらに接続されているのはホスト側が自システム内の主記憶装置あるいは拡張主記憶装置、表示記憶装置等の記憶装置に記憶しきれないデータや電源遮断後も保持したいデータなどを記憶するために設置している外部記憶装置あるいは補助記憶装置である。フロッピディスクドライブ203、ハードディスクドライブ204等が一般的であるが、それに加えフラッシュファイルシステム205が接続されている。なおこれら全ての補助記憶装置がホストシステムに接続される必要はなく、ユーザが適宜選択して接続するものである。フラッシュファイルシステム205にはインタフェース回路206が付加されており、207はインタフェースレジスタ群、208はインタフェースレジスタ群の中のレジスタの一つであるコマンドレジスタ、209はインタフェースレジスタ群のアドレスデコード回路、210はコマンド割込み信号である。以下既出の番号はこれまでの説明で述べてきたものと同様のものである。ただしプログラムメモリ4に格納されているプログラムはこれまでの説明で述べてきたファイルデータの制御、管理に加え、ホストからのアクセス要求を中心としたコマンドへの対応のプログラムが格納されている。ホストはホストバス201を通して補助記憶装置にコマンドを出す。これはインタフェース回路206内のインタフェースレジスタ群207の一つであるコマンドレジスタ208にコマンドコードを書き込むことによって行なわれる。インタフェースレジスタ群207は、ハードディスクドライブがインタフェースレジスタとして持つレジスタを全て備え、またレジスタの仕様も一致し、ホストからはハードディスクをアクセスするのと何ら変わらないようにしている。なおこのレジスタをフロッピディスクドライブや光ディスクドライブ等、他の補助記憶装置のインタフェースに合わせることも有効であると考える。あるいは複数の補助記憶装置のインタフェースを同時にサポートし、ホストからは別の補助記憶装置を利用しているようにみえるが、実際には1台のフラッシュファイルシステムでまかなうというのはスペース的に非常に有効である。さてコマンドレジスタ208はホストによりコマンドを書き込まれると割込み信号210をプロセッサ3に対して発し、これを受けたプロセッサ3は書き込まれたコマンドコードを解釈して、ホストのコマンド要求に応える。なおインタフェースレジスタ群207やコマンドは全てハードディスクドライブに対応するものであるが、記憶媒体が異なるものであるため、不必要なものや処理が異なるものもある。例えばフォーマットは磁気ディスク装置には不可欠のものであるが、半導体ディスクドライブでは不必要であるため、特に処理を行なわないようにしたり、単に規則的なデータに書き換えたりといった処理にする。以下、ファイルデータのリードライトに関してはこれまでの実施例で説明したものと同様の動作とする。なお図は第1の実施例を適用しているが、これまで説明したあるいはこの後説明する他の実施例にそのまま適用することも可能である。
【0018】
図18はフラッシュファイルシステムを補助記憶装置とするパーソナルコンピュータの一例の構成図である。図中、221は本情報機器のCPU、222はコプロセッサ、223は本実施例の情報処理システム内部に構築した標準I/Oバス、224は標準I/Oバス223を構築するバスユニット、225は主メモリや拡張メモリなど高速メモリをアクセスするメモリ制御ユニット、226は主メモリ、227は基本制御プログラムが格納されたBIOS ROM、228はキーボードコントローラでこの先にはキーボードが接続されているものとする。229は表示アダプタでこの先には何らかの表示装置が接続されているものとする。230は拡張メモリ、231はプリンタなどを接続するパラレルポートI/F、232はマウスやRS232CなどのシリアルポートI/F、233はフロッピディスクドライブ、234は標準I/Oバス223より標準のHDDI/Fに変換するバッファコントローラ、235はフラッシュファイルシステムである。このフラッシュファイルシステム235の内部は、これまでの実施例で示したものにより構成されており、236はファイルアクセスを受け付けてデータの受渡しを行なうI/Fユニットであり、図17におけるインタフェースレジスタ群207及びアドレスデコード209にあたる。237はフラッシュファイルシステム235内部のデータ管理や制御を行なうコントロールユニットであり、図17におけるプロセッサ3及びプログラムメモリ4、アクセスコントローラ2、ライトバッファ9よりなる。238はファイルデータを格納するフラッシュメモリアレイ、239はデータ及びメモリ管理のための情報を記憶するインフォメーションテーブルであり、図17におけるテーブル5、6、7、8を全て含むものである。次に動作を説明する。電源が投入されて動作を開始するとまずCPU221はBIOS ROM227を標準I/Oバス223を通してアクセスし、初期診断、初期設定を行なう。そして補助記憶装置からシステムプログラムを主メモリ226にロードする。本実施例では補助記憶装置としてフラッシュファイルシステム235を採用している。ただしCPU221は標準I/Oバス223を通してHDDコントローラ234にHDDをアクセスするものとして動作する。従ってフラッシュファイルシステム235は内部のI/Fユニット236によってHDD完全互換のI/F機能をサポートしている。システムプログラムのロードが終了すると、ユーザの処理要求に従い、処理を進めていく。なおユーザは標準I/Oバス223上のKBDC228や表示アダプタ229により処理の入出力を行ないながら作業を進める。そして必要に応じてパラレルI/F231、シリアルI/F232に接続された入出力装置を活用する。また本体上の主メモリ226では主記憶容量が不足する場合は、拡張RAM230により主記憶を補う。ユーザがファイルを読み書きしたい場合にはユーザはHDDが補助記憶装置であるものとして補助記憶装置へのアクセスを要求し、フラッシュファイルシステム235はそれを受けてファイルデータのアクセスを行なう。本実施例によれば標準的なパーソナルコンピュータの標準的なI/Oバス上に、現在最も一般的な補助記憶装置であるHDDを搭載しているかのように、フラッシュファイルシステムを採用している。従って新しい記憶媒体としてフラッシュファイルシステムを採用してもBIOS ROMやシステムプログラムをHDDを搭載していたものに対し変更を加えなくてもそのまま使用できる。なお上記実施例は標準的なパーソナルコンピュータを例にしており、主メモリや拡張メモリが標準I/Oバス上にあったり、コプロセッサやパラレルI/F、シリアルI/Fが存在しない構成の情報機器も考えられこれらに関しても本発明の適用が可能である。
【0019】
次にフラッシュメモリの不良発生に対処する実施例について図19を用いて説明する。フラッシュメモリは原理的に書き換え回数に限界があることはすでに述べているが、書き換えによる劣化が進むとデータ消去書き込みの消費時間が長くなり、またデータの保持信頼性に問題が出てくる。そこでメモリの劣化により使用すべきでない状態に達した、と判断されたときにはその記憶領域あるいはメモリチップの使用を中止すべきである。そしてそのような領域が増え、フラッシュファイルシステム全体の寿命が近づいたと判断されたときには、そのフラッシュファイルシステムの使用を中止すべきである。フラッシュメモリの劣化を検出する方法としては、消去を繰返し行っても規定回数以内で消去が完全にならない、あるいは消去時間がある規定時間以上かかってしまう、という消去不良から判断する方法。そして書き込みを繰返し行っても規定回数以内で書き込みが完全にならない、という書き込み不良から判断する方法。また消去回数を管理して規定回数以上に達してしまったことから判断する方法が考えられる。そして劣化して使用不能に陥った記憶容量がある規定値に達したところでフラッシュファイルシステムとしての寿命と判断する。図19はそれをユーザに警告するための手段を実現する一実施例であり、図中240はフラッシュファイルシステム235内のコントローラが自システムの使用限界を認識し、これをホストシステムに伝えるための割込み信号であり、241は使用限界に達したことを示すエラー報告レジスタである。ホストはHDDバッファ234を通して割込み信号240を受けるとフラッシュファイルシステム内のレジスタ241をアクセスして状況を把握し、適宜ユーザに報告する。図20はこの動作を実現するソフトウェアをフローチャートで示したものであり、(1)はフラッシュファイルシステム内でのチェックルーチンのフローチャート、(2)はホストシステムでのユーザへの警告プログラムのフローチャートである。図の説明を兼ねながら動作説明を行なう。フラッシュファイルシステムのコントローラは使用限界に達したと見られる記憶領域が検出できたらこのルーチンにジャンプしてくる。そして使用限界の記憶領域の容量を加算していく(a)。そしてある限界値に達した場合(b)には、自システム内のエラー報告レジスタにエラー内容として使用限界に達したことを示す値を書き込む(c)。そしてホストへの割込み信号を出力して(d)、本ルーチンを終了する。なお(a)の容量の加算値はフラッシュメモリ内あるいは他のメモリに保持しておく必要がある。また(b)の残り容量の限界値はシステムに応じて適宜設定するものとする。さて(d)による割込み信号を受けたホストシステムでは、区切りの良いところで処理を中断し(2)のフローチャートで示したルーチンに入り、まずフラッシュファイルシステム内のエラー報告レジスタをアクセスし割込みを受けた理由を判別し(e)、これがフラッシュファイルシステムの使用限界に達したための使用中止要求であったら(f)、それ以後のフラッシュファイルシステムのアクセスを禁止し(g)、ユーザに警告する(h)。警告の方法としては、情報機器の表示装置を利用したり警告インジケータを取り付けるなど視覚的に訴える方法と、警告音を発するなどの聴覚的に訴える方法が考えられる。また、書き込みアクセスだけを禁止しリードアクセスは許可するようにするとファイルデータのバックアップがとれるようになる。本実施例によればフラッシュファイルシステムが使用限界に達したらすぐにユーザに知らせることができ、データの信頼性を増すことができる。別の実施例として図18における割込み信号240は設けずに、ホストシステムがアクセスの度にエラー報告レジスタを読み出すこととして、図20(2)のルーチンを実行する。本実施例によればホストシステムのハードウェア構成を従来と全く変えずに、HDDをそのまま置き換えて、使用限界報告ができる。また別の実施例としては、定期的に保守プログラムをホストシステムで実行し、その際にエラー報告レジスタ241を読み出して、使用限界に達していないかをチェックすることにより、使用限界を認識する。本実施例によればホストシステムのBIOSプログラムやシステムプログラムに全く変更を加える必要がない。
【0020】
次に電源遮断時の処理に対応する実施例を示す。本発明のフラッシュファイルシステムは基本的に補助記憶装置であり、ホストシステムより電源を供給される構成が一般的である。しかし動作的にはホストとは非同期であるため、ホストが非動作中にもフラッシュファイルシステムが動作している場合もある。しかしホストを扱うユーザがそれを認識していないとホストの電源を落してしまい、動作中のフラッシュファイルシステムへの電源供給が停止してしまう、ということが起こり得る。そこでこれに対応する発明の実施例を図21に示す。図21はホストからの電源供給が停止した後も、フラッシュファイルシステムが動作を続けられるようバッテリでバックアップ電源を供給する構成のシステムの図であり、図中、251はホストとなるパーソナルコンピュータ等の情報機器、252はフラッシュファイルシステム、253はバックアップ用のバッテリ、254はホスト251の電源が遮断されたときに、バッテリ253の電力がホスト251に逆流しないための逆流遮断回路である。255はホスト251からの電源供給が絶たれたことを検出する検出回路、256はその出力である検出信号、257はバッテリ253のフラッシュファイルシステム252への電力供給を遮断する遮断回路、258はフラッシュファイルシステム252が処理途中であった処理を終了し、電源供給を必要としなくなったため遮断回路257を動作させる遮断信号である。ホスト251から電源が供給されている間は、ホスト251の電源によりフラッシュファイルシステムが駆動される。これはバッテリ253の出力電圧とホスト251の供給電圧をうまく調整することによりバッテリ253にトリクル充電を施すことができる。ただしバッテリ253が2次電池でない場合には流入防止のダイオードなどを付加する必要がある。そしてホスト251の電源が落されてフラッシュファイルシステム252への電力供給が停止されると、バッテリ253から電源が供給されてフラッシュファイルは動作を続けることができる。そして電源遮断検出回路255が電源遮断を検出すると、検出信号256によりフラッシュファイルシステムがこれを認識し、処理中の作業を完了させ、その後電源遮断処理を行う。電源遮断処理では最後に遮断信号258によりバッテリ遮断回路257を遮断させて、フラッシュファイルシステムの動作を終了する。なお逆流遮断回路254は逆流防止用ダイオードを用いる方法が挙げられる。本実施例によればホスト251はフラッシュファイルシステムと信号上は完全に分離しているため、ホストのアクセス要求によるデータのやりとりだけとなり、ホストの動作停止はホスト内で閉じることができる。つまりホストはフラッシュファイルシステムを接続したことによるハード上の変更の必要がない。
【0021】
図22はホストの電源遮断に対応する別の実施例である。ただし図22の例では実際にはホストの電源による供給を続ける方式である。図中、258はホスト251からフラッシュファイルシステム252に供給される電源ライン、259はフラッシュファイルシステム252が作業中であり、電源供給の必要があることを示す電源ビジー信号である。ホスト251の電源回路は電源スイッチがOFFになっても電源ビジー信号259がアクティブの間は電源供給を停止せずに、フラッシュファイルシステムの処理が全て終了して電源ビジー信号259がインアクティブになったら電源供給を停止する。つまりユーザにとってはホストの情報機器の電源スイッチを切り、電源を遮断してしまったものとした時でも実動作上は遮断されずに、フラッシュファイルシステム252の作業終了を待機する。本実施例によればフラッシュファイルシステムの動作終了をホストが認識して電源を制御することにより、バックアップ電源などが必要なくフラッシュファイルシステムの電源回路の構成がシンプルになる効果がある。
【0022】
次に本発明の第5の実施例を述べる。図25は本発明を実現するためのハードウエア構成であり、図26は本発明のフラッシュメモリ内の記憶構成を示した図であり、図27はデータ書き込みのためのフローチャートである。便宜上図26より説明する。図中、311は512バイト(4キロビット)を単位とする記憶領域で、実際にデータを書き込むセクタであるため物理セクタと呼ぶ。これに対し記憶データの供給側は、論理セクタと呼ぶ仮想のセクタによりデータを管理することとする。全ての物理セクタ311および論理セクタにはそれぞれ相関性の全くない番号を付す。312はデータを一括消去する単位となる消去ブロックであり、その容量はメモリにより異なる。例えば消去ブロック単位が16キロバイトであれば32物理セクタが1ブロックとなる。313はメモリチップであり、消去単位16キロバイトで4メガビットのチップであれば32ブロック1024セクタに区分けされる。チップ単位でしか消去できないものは1チップ1ブロック、物理セクタごとに消去できるものはブロック数と物理セクタ数は同一である。フラッシュメモリは消去が行われたブロックに対しては、そのブロック内においてランダムライトアクセスが可能である。ただし一回書き込んだら次の消去を行わなければ書き込みはできない。従って複数セクタを1ブロックとするメモリにおいては、各セクタが全て書き込まれてから消去すべきである。以下の説明においてはフラッシュメモリは4メガビットのチップで、消去ブロックが16キロバイト(128キロビット)のものを使用することとする。図26はまさにその構成のメモリを図示している。図25はこのメモリチップ313を用いた場合のハードウエア構成で、図中301は書き込みデータの記憶領域であるフラッシュメモリ、302はフラッシュメモリ301をアクセスするアクセスコントローラ、303は記憶データやステータスデータを操作するプロセッサ、304は記憶してある論理セクタ番号のデータがフラッシュメモリ301のどこの物理セクタに記憶されているかを参照するために物理セクタ番号が記録されている論理セクタテーブル、305はフラッシュメモリ301の物理セクタ311が記憶している論理セクタ番号を参照するための物理セクタテーブル、306は各ブロックのステータスを記憶するブロックテーブルで、そのブロックが使用可能であるか、あるいはそのブロックには何セクタ書き込まれているか、などが記録される。307はフラッシュメモリは書き込み速度が読みだしに比べ非常に遅いため、書き込みデータを一時的に保持してデータの供給側に速くバス権を復帰させるためのライトバッファである。308は後述の整理ルーチンにおいて整理データを一時的に保持する整理データバッファである。図27は図25の構成において書き込みを行うための図25のプロセッサ303の動作を説明するフローチャートである。以下このフローチャートに従って動作を説明する。書き込むデータを記憶する際は1セクタ=512バイト単位により行う。すなわち512バイトに満たないデータも512バイトの記憶領域に格納される。その1セクタ単位のデータに番号を付し、これを論理セクタ番号とする。データの供給側はこの論理セクタ番号だけを意識すればよいものとする。今、データ供給側が1セクタの書き込みを要求したとすると、このデータに、ある論理セクタ番号を付し、以後このデータは書替えが起こっても先の論理セクタ番号で扱われる。一方データの記憶側ではこのデータの格納場所を決定する。格納場所は書き込みポインタに指し示されたブロックの未書き込みの最初のセクタである。つまり一つ前の書き込みをした物理セクタの次のセクタである。例えば図26において一つ前の書き込みを第1ブロックの第3物理セクタに書き込んだ場合、次の書き込みは第1ブロックの第4物理セクタに書き込みを行うものとする。この際のデータの格納場所の判断をプロセッサ303がブロックテーブルをアクセスして行う。この作業がフロチャート内の(a)である。(b)は書き込みに問題ない場合はそのブロックの書き込みセクタ数をインクリメントしてデータを書き込む。実際のライトアクセス制御はアクセスコントローラ302により行う。そして書き込み後は物理セクタテーブルおよび論理セクタテーブルに書き込んだセクタ番号をそれぞれ記録する。また以前に書き込んでいる論理セクタの再書き込みであれば、物理セクタテーブルに以前書き込んだ論理セクタ番号を消去する。これはその物理セクタのデータは無効であることを示すための動作である。(c)の整理ルーチンとは書き込みポインタの指し示すブロックがすでに全セクタ書き込まれており、書き込み不可能である時の動作ルーチンである。これは後述の図28のフローチャートにより説明する。(d)はブロックがこわれていたり、整理ルーチンに入った場合には書き込みが不可能であるため、そのブロックへの書き込みを中止し、次のブロックへの書き込みを行うための動作である。一方リードアクセスの際は必要なデータが格納されている論理セクタ番号で論理セクタテーブルを参照し、物理セクタ番号を割り出して必要なデータを読み出す。次に整理ルーチンについて説明する。整理ルーチンが必要となる理由は、これまで説明した書き込み方法では同じファイルのデータの書き替えにおいて別の物理セクタへ書き込みを行う。すなわち書き替える前に書き込んだデータは不要となるがメモリ上には記憶されたままであり消去すべきデータである。しかし不要となるたびに消去していたのでは消去回数が有限であるフラッシュメモリにとっては寿命を短くすることになる。そこで整理ルーチンによって消去する。整理ルーチンはブロックが書き込みデータで一杯になったときに行う。整理の具体的な方法は、図28のフローチャートに従って行う。以下フローチャート内の各部の説明をする。(a)整理するブロック内の全データを一度図25の整理データバッファ308に退避する。(b)退避し消去可能になったところでそのブロックを消去する。(c)整理データバッファにある各セクタの物理セクタテーブルを参照して、データが必要か不必要かを判断する。(d)必要なデータであれば再びそのブロックに書き込む。以上が本発明の一実施例の動作説明である。本実施例によればフラッシュメモリの各消去ブロックの消去が一部に集中せずに順番に行われるため、寿命が延びるという効果が期待できる。また書き込みにおいてフラッシュメモリの書き込み速度が遅いという欠点を補う効果がある。また不必要なデータを効率的に消去するため、半導体ディスクとして常に記憶容量を保っていられる効果がある。
【0023】
次に他の実施例を説明する。図29はフラッシュメモリの劣化を判定する装置の1構成例であり、図中401はフラッシュメモリセル、402は消去制御の開始から終了するまでの時間を測定する消去時間測定タイマ、403はフラッシュメモリセル401に書き込まれているデータを消去するための制御を行う消去制御回路、404はフラッシュメモリセル401の劣化度を記憶する劣化度管理テーブル、405はこれらを統括制御するコントローラ、406は劣化管理コントローラ405が消去制御回路403に消去を開始させる際に消去時間測定タイマ402を同時に起動するための起動信号、407は消去制御回路403が消去処理の終了を消去時間測定タイマ402に知らせる終了信号、408は消去時間測定タイマが測定した測定データである。図30は図29のコントローラ405の動作を説明するフローチャートであり、フラッシュメモリの劣化の判定をこのフローチャートに従って行う。次に動作を図29、図30を用いて説明する。まずシステム全体の制御からあるメモリセル401に消去の動作が必要になったとき、コントローラ405が消去要求を受ける(図30a)。するとコントローラ405は消去制御回路403に消去箇所と消去動作の開始を指示する(図30b)。これを受けた消去制御回路403は該当するメモリセル401の消去動作を開始する(図30c)。これと同時にコントローラ405は消去時間測定タイマ402を起動する(図30d)。コントローラ405は消去終了まで待機し、メモリ制御回路403がメモリセル401の消去を完了すると、コントローラ405にそれを伝える(図30e)。コントローラ405は消去時間測定タイマ402を参照して消去に費やした時間を認識し、劣化の度合いを判別してそれに応じた番号をその記憶領域に付す。例えば劣化の度合いを8段階に分け、未使用状態と同様な消去時間であれば”0”、劣化が進んで使用不可能な状態を”7”としその間の段階を”1”から”6”の番号をあてる。そしてその記憶領域に付した番号を劣化度管理テーブル404に格納する(図30f)。劣化度を8段階にすることにより、一つの記憶領域を1バイトに割り当てられ、管理がし易くなる。各記憶領域の扱いは、この劣化度管理テーブルをもとにする。劣化度が一つ進んでしまった領域はその都度劣化の小さい領域のデータを転送して劣化の進行をとめ、全記憶領域の劣化の平均化を図る。また劣化が最終段階に達した領域は使用を禁止する。これは記憶システム全体を統括して制御するコントローラが行う処理である。この記憶システムのコントローラの動作フローを図31に示した。同図を追って順に説明すると、ホストシステムから記憶システムにライトアクセス要求があり、データの書き込みを行う際に記憶システムのコントローラが消去動作を必要とすると判断したら(図31a)、図29のコントローラ405に消去と劣化管理の要求を出す(図31b)。消去動作が終了すると、消去を行った記憶領域の劣化度を図29の劣化度管理テーブル404により参照し(図31b)、劣化が進んでいた場合は劣化が最も進んでおらず、かつ入替えをまだ行っていない領域を探し出して(図31c)、データを転送して入替えを行う(図31d)。この劣化が最も進んでおらず、かつ入替えをまだ行っていないという判断は、第1の実施例で説明した入換えフラグを利用した方が効率的である。これは一度上記入替え処理を行った領域は、格納されているデータが劣化の進まないデータ(書換えが起きにくいデータ)ではないため、劣化平均化の入換えに使用すべきではなく、入換えフラグを立てて明示する。なお本実施例では記憶システム全体の制御と劣化判定の装置における制御を分け、コントローラを別のものにしているが、コントローラ405を記憶システムのコントローラと共用しても良い。また消去時間測定タイマ402もハードウェアとして構成されているが、コントローラによるソフト制御による消去時間測定でもよい。記憶システムの部品点数削減を目指すならこれらはなすべきことである。本実施例によれば劣化管理のためのテーブルをこれまでの実施例で採用していた消去管理テーブルに変えることができ、使用する記憶領域を飛躍的に節約することができる。しかもメモリの劣化という判定においては消去回数よりも消去時間の方がより直接的な判定材料となるため、より正確な劣化度の把握と、劣化の平均化が図れる効果がある。
【0024】
次に図24の実施例を利用した消去回数管理の別の実施例を図32により説明する。これまでの実施例における消去回数管理の方法は、消去が行われると1回ずつカウントアップして消去回数を細かく把握していたが、本実施例では消去回数管理テーブルの記憶容量削減のため下位のビットを切り捨ててしまう。図24の実施例では通常の使用状態においては消去回数をSRAMやDRAMなどの揮発性メモリに最下位ビットまで格納し、電源遮断時にフラッシュメモリに転送することとしていたが、この転送時に下位のビットから1ビット以上を切り捨てる(図32a)。あるいは桁上げして転送する(図32b)。なお捨ててしまう下位のビットは、消去回数の把握による劣化の認識が確度を失わない程度として、フラッシュメモリの消去回数の制限値により最適値を考えるべきであり、ビット切捨てにより切り捨てられてしまう消去回数の最大値がフラッシュメモリの消去回数の保証値の1%を越えない程度とする。つまり消去回数の保証値が1万回であれば、100回を越えない6ビット(最大値63)を切捨ての限度とする。本実施例によれば消去回数の把握が正確でなくなるが、誤差はフラッシュメモリの消去回数の保証値の1%以下としたため、もともと保証値の確度が一桁程度の幅があることから、消去が起きる傾向が強いデータか否かを判断するものであると考えれば、本質的な問題とはならない。これにより消去回数の管理に使用するフラッシュメモリの容量を削減することができる効果は大きい。
【0025】
次にテーブル領域を削減するための他の実施例を説明する。図33はこれまでの実施例で説明している物理セクタテーブル及び論理セクタテーブルを省略した記憶システムの構成図である。ただしこれらの代わりになるアドレス変換テーブル411を備える。他の既出の番号はアドレス変換テーブル411は劣化度平均化のためのデータ入替えを行っていない記憶領域のアドレス入力に対しては変換を行わず、データ入替えを行っている記憶領域のアドレス入力に対しては、入れ替えた先のアドレスを出力するテーブルである。従って物理セクタテーブルや論理セクタテーブルを必要とせず、基本的にはシステムからアクセス要求のあったアドレスをそのままメモリ上の物理的なアドレスに対応してアクセスし、その領域の劣化が進んで劣化度の平均化のためのデータの入替えを行ったら、アドレス変換の対象となる。本実施例は第1に実施例のような、ファイルデータの記憶単位(セクタ)と消去単位が一致している場合にだけ適用できる。そしてアドレス変換テーブルの容量は変換可能にできる領域の容量に依存する。すなわちアドレス変換テーブルの容量を小さくすれば変換を行える記憶容量が小さくなり、大きな領域を確保すれば多くの領域のアドレスを変換できるようになる。これはシステムの寿命に直接関与する要因である。なお図33は第1の実施例に改良を加えた形となっているが、消去管理テーブル7の代わりに図29により説明した劣化度管理テーブルを備えた実施例にも適用できる。本実施例によれば、データ管理が簡素化され、またテーブル領域を大きく削減できる効果がある。
【0026】
次に動作中を示すインジケータを設ける実施例を説明する。図34は本実施例を示した内部構成例を示した図であり、図17をもとにしており既出の番号は図17と同様のものである。その他図中421はライトバッファ9からフラッシュメモリ1へのデータの転送中を示すプロセッサ3の出力ポート信号、422は出力ポート信号421により転送中であることを発光により示すインジケータである。インジケータとしては発光ダイオードが適当である。図35は本実施例の外観図であり、(1)はカード形状の全体図、(2)は使用中の例を示した図である。図中423は本発明の補助記憶装置であるICカード、424はコネクタ、425は発光ダイオード、426はホストパソコンである。図34において標準IOバス201によりホストのパソコンが補助記憶装置205に書き込みアクセス処理の要求をして来ると、プロセッサ3はライトデータをライトバッファ9に格納するよう処理する。そしてそれが完了すると標準バス201に書き込み完了を示す信号を出力する。その後、プロセッサ3はライトバッファ9に格納されたデータをフラッシュメモリ1に転送、格納する。この処理を行っている間プロセッサ3は出力ポート信号421をアクティブにしてインジケータ422を発光させる。そしてライトバッファ9からフラッシュメモリ1への転送が終了したらプロセッサ3は出力ポート421をインアクティブにしてインジケータ425の発光を停止する。図35(1)はICカード形状で適用した例で、コネクタとは反対側の側面にインジケータ425を取付け、パソコン本体に取り付けた状態でインジケータ425の点灯が確認できるようにしている。(2)はノート型パソコンに実際に挿入した様子を示しており、ユーザはインジケータ425の点灯、非点灯を確認しながら作業ができる。ただしユーザが点灯を確認しなければならないのは基本的に電源を遮断するときだけである。本実施例によれば、回路構成が比較的単純であり、またインジケータの視認性が良くユーザの誤操作が防げる効果がある。
【0027】
【発明の効果】
本発明によれば、電源の供給を停止しても、物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報が失われることがなく、それ故、フラッシュメモリ内のデータが正体不明の無意味なデータと化すのを防ぐことができる。
【図面の簡単な説明】
【図1】本発明における第1の実施例のハードウエア構成図。
【図2】本発明における第1の実施例のフラッシュメモリチップの記憶構成図。
【図3】本発明における第1の実施例の動作を示すメインルーチンのフローチャート
【図4】本発明における第1の実施例の消去管理動作を示す消去管理ルーチンのフローチャート
【図5】本発明における第2の実施例のハードウエア構成図。
【図6】本発明における第2の実施例のフラッシュメモリチップの記憶構成図。
【図7】本発明における第2の実施例の動作を示すメインルーチンのフローチャート
【図8】本発明における第2の実施例のセクタ整理動作を示す整理ルーチンのフローチャート
【図9】本発明における第2の実施例の消去管理動作を示す消去管理ルーチンのフローチャート
【図10】本発明における第3の実施例のハードウエア構成図。
【図11】本発明における第3の実施例のフラッシュメモリチップの記憶構成図。
【図12】本発明における第3の実施例の消去管理動作を示す消去管理ルーチンのフローチャート
【図13】本発明における第4の発明のハードウエア構成図
【図14】消去ブロックごとにテーブルを持たせたフラッシュメモリチップの構成図
【図15】データ領域とは別に情報を格納する領域を持たせたフラッシュメモリチップの構成図
【図16】データ領域とは別にバッファ領域をもたせたフラッシュメモリチップの構成図
【図17】本発明における第4の実施例のフラッシュファイルシステムのインターフェース部分のハードウエア構成図。
【図18】本発明における第4の実施例のフラッシュファイルシステムを補助記憶装置とする情報機器の構成図。
【図19】本発明における使用限界を報告する実施例の構成図
【図20】本発明における使用限界を報告する実施例のフローチャート
【図21】本発明におけるバックアップ電池を備えた実施例の構成図
【図22】本発明における電源制御信号を備えた実施例の構成図
【図23】データ領域とは別に情報格納領域をもたせたフラッシュメモリのデータ格納の実施例
【図24】図13に対しEEPROMを省略した実施例の構成図
【図25】本発明における第5の実施例のハードウエア構成図
【図26】本発明における第5の実施例のフラッシュメモリチップの記憶構成図
【図27】本発明における第5の実施例の動作を示すメインルーチンのフローチャート
【図28】本発明における第5の実施例のセクタ整理動作を示す整理ルーチンのフローチャート
【図29】時間による劣化の管理によりシステムの長寿命化を図る実施例の構成図
【図30】図29の実施例における劣化管理コントローラの動作フロー
【図31】図29の実施例における記憶システムコントローラの動作フロー
【図32】消去管理テーブルの記憶容量を節減する実施例の説明図
【図33】セクタの管理テーブルの記憶容量を節減するためにアドレス変換テーブルを採用した実施例の構成図
【図34】補助記憶装置の動作中を示すインジケータを設けた実施例の構成図
【図35】補助記憶装置の動作中を示すインジケータを設けた実施例の外観図
【符号の説明】
1…フラッシュメモリ、3…プロセッサ、5…論理セクタテーブル、6…物理セクタテーブル、7…消去回数管理テーブル、8…ステータステーブル、9…ライトバッファ、13…消去ブロック、49…書き込みセクタ数テーブル、51…整理バッファ、52…物理セクタ、111…ワンチップマイコン、112…RAMコア、113…ROMコア、114…EEPROM、115…DRAMまたはSRAM、116…テーブル領域、132…テーブル格納領域、142…バッファ領域、143…アドレスカウンタ、207…I/Fレジスタ群、227…BIOSROM、236…I/Fユニット、241…エラー報告レジスタ、253…バックアップバッテリ、259…電源ビジー信号、402…消去時間測定タイマ、404…劣化度管理テーブル、411…アドレス変換テーブル、421…出力ポート信号422…インジケータ、425…インジケータ(外観)。
[0001]
[Industrial applications]
The present invention relates to an auxiliary storage device of a portable small information processing device, and more particularly to a semiconductor file storage device using a flash memory and an information device having the same.
[0002]
[Prior art]
A magnetic storage device is the most common conventional auxiliary storage device for information equipment. In a magnetic storage device, a file to be written is divided into storage units called sectors, and the storage is performed in accordance with the physical position of a storage medium. I do. In other words, in rewriting a certain file, writing is basically performed at the same position, and when writing data increases, writing to a new sector is performed accordingly. On the other hand, another auxiliary storage device is an optical disk device. Currently, general optical disks can be written only once and cannot be erased. Therefore, when rewriting a file once written, actual rewriting is not performed, but data written in another area and previously written is invalidated so as not to be read thereafter. That is, unlike the magnetic disk device, the function of the auxiliary storage device is performed by a method in which the rewrite data and the storage location are not associated at all. In recent years, a semiconductor file storage device, which uses a semiconductor memory as an auxiliary storage device, has been in the spotlight as a storage device that functions as an auxiliary storage device by accessing a large amount of data at a high speed by rotating the disk as described above. ing. In particular, a memory using an electrically rewritable nonvolatile memory (hereinafter referred to as an EEPROM) is considered to be the mainstream of the semiconductor file storage device in the future. One technique for achieving this is disclosed in Japanese Patent Laid-Open Publication No. Hei 3-25798. This is a storage device using an EEPROM, which protects the limitation of the number of times of rewriting and erasing, which is a drawback of the EEPROM, and realizes a practical storage device using the EEPROM. In brief, a plurality of memory elements are prepared, the number of times of erasing and rewriting of each element is recorded and managed, and when a certain number of times less than the guaranteed number of times of rewriting of the EEPROM is reached, the prepared memory element is switched to use. By doing so, the stored data is protected.
[0003]
[Problems to be solved by the invention]
Since the flash memory is a non-volatile memory, data in the flash memory is not lost even when the supply of power is stopped during non-operation.However, no matter how much data is stored, if the contents of the table are lost, it becomes impossible to know what data is stored in which sector, and the data in the flash memory becomes unidentified meaningless data. . Therefore, the data stored in the table also needs to be stored after the power supply is stopped. However, it is not necessary to save all data in the table.
[0004]
[Means for Solving the Problems]
In the storage device of the present invention, the flash memory stores information (for example, a physical sector table) for referring to the logical sector number of the data mapped to the physical sector, and the control unit performs The information for referencing the logical sector number of the data mapped to the physical sector stored in the flash memory is used to refer to which physical sector of the flash memory the data of the logical sector number is stored in. The information (for example, a logical sector table) is created in the volatile memory, and the control unit responds to the access request and stores the data of the logical sector number created in the volatile memory in any physical sector of the flash memory. Corresponds to the logical sector number specified by the host system using the information for referring to Indexing the physical sector of the flash memory that, to access the physical sector of the flash memory that has been indexed.
In the storage device of the present invention, the flash memory stores information (for example, a physical sector table) for referring to the logical sector number of the data mapped to the physical sector, and the control unit starts power supply. Then, using the information for referencing the logical sector number of the data mapped to the physical sector stored in the flash memory, referring to which physical sector of the flash memory the data of the logical sector number is stored in (For example, a logical sector table) is created in the volatile memory, and the control unit responds to the access request to store the data of the logical sector number created in the volatile memory in the flash memory. Using the information for referring to whether or not it is described in the physical sector, the logical sector number specified by the host system is used. Indexing the physical sector of the flash memory over data is stored, accessing the physical sector of the flash memory is indexed.
In the storage device of the present invention, each erase block of the flash memory refers to a first area for storing data from the host system and a logical sector number of data mapped to a physical sector of the first area. And a second area for storing information (eg, a physical sector table) for storing data mapped to the physical sector stored in the second area of each erase block of the flash memory. Using the information for referencing the logical sector number, information (for example, a logical sector table) for referencing in which physical sector of the flash memory the data of the logical sector number is stored in the volatile memory. In response to the access request, the control unit, in response to the access request, stores the data of the logical sector number created in the volatile memory anywhere in the flash memory. Using the information for referring to whether the data is described in the sector, the physical sector of the flash memory in which the data of the logical sector number specified by the host system is stored, and the physical sector of the determined flash memory is accessed. Do.
[Action]
According to the above meansSince information for referencing a logical sector number of data mapped to a physical sector (for example, a physical sector table) is stored in a flash memory, even if power supply is stopped, data mapped to a physical sector is stored. The information for referring to the logical sector number of the flash memory is not lost, and therefore, it is possible to prevent the data in the flash memory from becoming unidentified and meaningless data..
[0005]
【Example】
Hereinafter, examples of the present invention will be described. First, a first embodiment will be described with reference to FIGS. 1, 2, 3, and 4. FIG. FIG. 1 shows a hardware configuration for realizing the first embodiment, FIG. 2 shows an internal configuration of a flash memory chip used in the present embodiment, and FIG. 3 shows a main routine of stored data management. FIG. 4 is a flowchart of the erase management routine.
[0006]
First, the operation of the flash memory will be described with reference to FIG. In the figure, reference numeral 11 denotes the entire memory chip, 12 denotes a data write unit, and 13 denotes a minimum unit of data erase, which is called an erase block. A flash memory is an electrically erasable PROM and is a kind of EEPROM. A normal EEPROM has the same data writing unit and erasing (rewriting) unit, whereas a flash memory has an erasing unit rather than a writing unit. It is extremely large, and in order to rewrite data that has been written once, many other data must also be erased at the same time. As an advantage instead, the degree of integration can be higher than that of a normal EEPROM, and it is suitable for a large-capacity storage device. In FIG. 2, the entire memory chip 11 is divided into one or more erase blocks 13, and the write unit 12 is one word (a word in the memory and according to the memory configuration), whereas the erase block 13 is larger. Area. When a flash memory is used as an auxiliary storage device, it is easier to use if 512 bytes are used as an erasing unit according to the specifications of the magnetic disk device.
[0007]
Next, the system configuration and operation of a first embodiment of a storage device using this memory will be described with reference to FIGS. 1, 3 and 4. FIG. In the following description, the storage unit of the file data is referred to as a sector, and in this embodiment, one sector corresponds to one erase block. In the figure, 1 is a group of flash memory chips for storing file data, 2 is an access controller for generating an access signal for the flash memory 1, and 3 is an external storage system using a flash memory by operating storage data and status data. A microprocessor 4 is a program memory storing a control program for operating the processor 3, and 5 is a logic for referencing where data of a sector (logical sector) indicated by a certain logical address is mapped on the flash memory 1. A sector table, 6 is a physical sector table for referring to a logical sector number of file data mapped to a physical sector indicated by a physical address on the flash memory 1, and 7 is a record of the total number of erasures of each physical sector. Erase count management table, The status table for referring to the status of each physical sector, 9 is a write buffer for temporarily storing write data to speed up the writing of data. Next, the operation will be described. When there is a data read access request from a system (host system) that makes a data access request to the present system, the processor 3 refers to the logical sector table 5 to determine a physical sector in which the relevant logical sector is stored, and It accesses the physical sector and sends the requested data to the host system. The data write request from the host system will be described with reference to the flowchart in FIG. The flowchart of FIG. 3 is a flowchart of the main routine of the program stored in the program memory 4. The flow will be described. First, a write pointer indicating a sector in which the next data is to be written is set. The status table 8 determines whether the indicated sector is in a writable state (a). In the status table, there are a flag indicating that the number of erasures has increased and the data has been degraded and is no longer usable, and a flag indicating that data has already been written. The pointer is moved (b). If writing is possible, the data is written to the sector (c). In the case of rewriting of a logical sector that has already been written once, since the data of the previously written logical sector is no longer necessary, the physical sector to which the unnecessary data is written is searched from the logical sector table. Then, the contents of the physical sector table 6 written at the time of the previous writing are deleted at the same time (d). When the sector is erased, the process jumps to the erase management routine. The erasure management routine will be described later. Then, the physical sector number indicated by the write pointer is written in the logical sector table 5, and the logical sector number written in the location indicated by the write pointer is written in the physical sector table 6 (e). In (b), the determination as to whether data has been written may be made in the status table 8 or the physical sector table 6 may be used. If the physical sector table 6 is an unwritten sector, it can be easily identified by setting all bits to H or L. Next, the aforementioned erase management routine will be described with reference to FIG. First, the erase counter of the erase management table corresponding to the physical sector from which the data has been erased is incremented by one (a). If the erase count has not reached the specified count, the process returns to the main routine. The replacement is performed (b). In order to replace the data, first, the erase management tables of all other sectors are checked, and the sector with the smallest number of erases and whose data has not yet been replaced is searched for (c). The data stored in the found sector having the smallest number of erasures is written to the previously erased sector (d). After the writing, the exchange flags in the status tables of both sectors are set (e). It is conceivable that this replacement flag may cause a physical sector with a small number of erasures to be selected as a sector with a small number of erasures again without means for indicating that the physical sector with a small number of erasures frequently occurs by this routine. At this time, the sector in which the data is replaced and the number of times of erasing is large prevents the erasure from occurring frequently. When the exchange flag is set, the contents of the corresponding logical sector table and the contents of the physical sector table are rewritten (f). Upon completion of the above, the process returns to the main routine. Since the sector selected as having the smallest number of erasures is erased once, it is necessary to increment the erasure number counter of the erasure management table. The replacement flag is cleared when the flags of all the sectors are set, or the logical judgment is inverted. That is, when it is determined that the exchange has been performed when the value is 1, the exchange is performed when the value becomes 0. Also, the specified number of times (b) should be a multiple of a value smaller than the guaranteed value of the number of rewritable times of the flash memory. For example, if the number of guaranteed times is 10,000, the number of times is 1000 times, 2,000 times, and 5,000 times. It is appropriate to use a multiple of the number. According to this routine, if erasure occurs frequently in a limited number of blocks, the data of a block having a small number of erasures is replaced by data of a block having a small number of erasures. Is to be averaged. This is considered to be very effective for data stored in a normal auxiliary storage device. For example, data is not rewritten at all in an area where an operation system program is stored, but data is frequently rewritten in an area of graphic data or text data which is data of an application program. Therefore, if the number of erasures is not averaged, the data in the memory of the system program area is unlikely to change, so that deterioration due to the increase in the number of erasures does not occur at all, and the memory of the other data area is limited. Erase is frequently performed in the memory space, and the number of times of erase is rapidly increased. In other words, it can be said that there is a particularly great effect when the usable area is small.
[0008]
The above is the description of the operation of the first embodiment. According to the present embodiment, a processor enables a fine control in accordance with the contents of the program memory, a write buffer speeds up writing, and a status table provides a status of each sector. It is extensible to record Then, in order to extend the life of the flash memory, there is an effect that optimum file management in which the number of erasures is managed can be performed.
[0009]
Next, a second embodiment will be described with reference to FIGS. 5, 6, 7, 8, and 9. FIG. FIG. 5 shows a hardware configuration in the second embodiment, FIG. 6 shows a storage configuration in a flash memory in the present embodiment, FIG. 7 is a flowchart of a main routine for writing data, and FIG. FIG. 9 is a flowchart of an organizing routine for changing a sector storing unnecessary data into an unwritten sector, and FIG. 9 is a flowchart of an erasing management routine for managing the number of erasures.
[0010]
First, the chip of the flash memory according to the present embodiment and its use will be described with reference to FIG. In the figure, reference numeral 52 denotes a unit of a storage area for storing file data called a sector used in the first embodiment. Reference numeral 53 denotes a minimum unit of data erasure, which is called an erase block, and is constituted by a plurality of sectors 52. That is, unlike the first embodiment, the storage capacities of the erase block 53 and the sector 52 are different. Numeral 54 denotes the entire memory chip, which is composed of a plurality of erase blocks in the figure, but it is also conceivable that one erase block per chip. In the present embodiment, file data is stored in sector units. However, the present invention is applicable to a memory chip in which other sectors are also erased at the same time when there is a request for rewriting the file data. FIG. 5 shows a hardware configuration of the present embodiment. In FIG. 5, reference numeral 41 denotes a flash memory which is a storage area for write data, and each denotes a memory chip 54. 42, an access controller for accessing the flash memory 41; 43, a processor for operating storage data and status data; 44, a program memory for storing a control program for operating the processor 3; 45, a physical sector 51 of the flash memory 41 Is a physical sector table for referencing the logical sector number stored therein, and 46 is a physical sector number for referencing in which physical sector of the flash memory 1 the data of the stored logical sector number is stored. , An erasure management table 47 for recording the number of erases of each block, a status table 48 for storing the status of each block, and a write sector number table 49 for referring to the number of already written sectors. , 50 is faster writing Aim for, write buffer for temporarily holding write data, 51 is a sort buffer used in performing organizing routine.
[0011]
Next, the operation will be described. At the time of read access, the logical sector table 45 and the physical sector table 46 are referred to as in the first embodiment. On the other hand, for the write access, referring to FIG. 7, a write pointer is first set, and the status table of the block indicated by the write pointer is referred to (a). That is, the write pointer in the present embodiment is a pointer in block units. If it is broken, the pointer is moved to the next block (b). If not broken, the write sector number table 49 of the block is referred to (c). Then, if all the sectors in the block have already been written, the process jumps to the organizing routine. The arrangement routine will be described later. If there is an unwritten sector, data is written (d), and the corresponding write sector number table is incremented by one (e). Therefore, for example, in FIG. 6, when the previous write is written to the third physical sector of the first block, the next write is performed to the fourth physical sector of the first block. Actual write access control is performed by the access controller 2. If all the sectors of the block to which the data has been written have been written, the process jumps to the organizing routine (f). Then, after writing, the written sector numbers are recorded in the physical sector table and the logical sector table, respectively (g). If the previously written logical sector is to be rewritten, the logical sector number previously written in the physical sector table is erased. This is an operation for indicating that the data of the physical sector is invalid. Note that the operation (f) is provided to reduce the sorting time, and should not be performed in order to increase the erasing efficiency of the flash memory. Next, the arranging routine will be described. The arranging routine is an operation routine when the block pointed to by the write pointer has already been written in all the sectors and cannot be written. The reason for the necessity of the rearrangement routine is that in the above-described writing method, data is written to another physical sector in rewriting data of the same file. That is, the data written before rewriting becomes unnecessary, but is data stored in the memory and should be erased. However, erasing the flash memory every time it becomes unnecessary shortens the life of the flash memory having a finite number of erasures. Therefore, the data is deleted by the rearranging routine. The pruning routine is performed when a block is full of write data. A specific method of organizing is performed according to the flowchart of FIG. Hereinafter, each part in the flowchart will be described. By referring to the physical sector table of the rearranged block, it is checked whether there is any erasable sector in the block, that is, whether there is an unnecessary sector because another physical sector has been newly rewritten (a). If there is no erasable sector, the process returns to the main routine. First, data in the block to be arranged is saved in the arrangement buffer 51 (b), and the block to be arranged is erased (c). After the erasure, the process jumps to the erasure management routine of FIG. 9, which will be described later (d). Then, it returns to a block in which only necessary sectors are arranged in the arrangement buffer (e). If the sector position at the time of the return is returned to the original position, there is no need to rewrite the logical sector table 45 and the physical sector table 46. If a method of filling the block starting from the lowest sector number is used at the time of restoration, writing of the next new sector becomes easier, but it is necessary to rewrite the logical sector table 45 and the physical sector table 46. In either case, the write sector number table is rewritten to the restored sector number (f). Next, the erase management routine will be described. FIG. 9 is a flowchart of the erasure management routine, which is basically the same as that described in the first embodiment, except that erasure management is performed in units of blocks instead of sectors. First, it is checked whether the number of erasures of the erased block has reached a certain number (a), and if not, the routine exits. If the number has reached (b), the number of erases of all blocks is searched, and the block with the smallest number of erases is searched (c). If the rearranged block and the block with the smallest number of erasures do not match, the data of these two blocks are replaced (d). The rearrangement data buffer 51 shown in FIG. 5 is used for the replacement. Then, the replacement flag of the replaced block is set (e). The erase counter is incremented and the logical sector table and the physical sector table are rewritten (f). The above is the operation of the erase management routine in this embodiment. As in the first embodiment, according to this routine, if erasure occurs frequently in a limited number of blocks, data in a block having a smaller number of erasures is replaced, and the number of erasures is averaged.
[0012]
The above is the description of the operation of the second embodiment. According to the present embodiment, when an erase block is too large as a unit of a sector to be written, the erase block is divided and can be used efficiently.
[0013]
Next, a third embodiment will be described with reference to FIGS. 10, 11 and 12. FIG. In the present embodiment, the memory chip is assumed to have the same capacity as the erase block of FIG. 2 and the sector as in the first embodiment, but has the configuration shown in FIG. 10 when used. In the figure, reference numeral 91 denotes a block including a plurality of sectors. In this embodiment, since the units of the sector and the erase block are the same, the block 91 of this embodiment is composed of a plurality of erase blocks. The other numbers already described are the same as those in FIG. 2 or FIG. The hardware configuration is shown in FIG. 11. In FIG. 11, reference numeral 101 denotes an erasure management table in which the number of erasures for each block 91 is recorded. Will be. Others are the same as FIG. 1 and FIG. FIG. 12 is a flowchart of the erasure management routine of this embodiment, and the main routine is the same as that of FIG. Assuming that the operation of the main routine follows the description of the first embodiment, the operation after jumping from the main routine to the erase management routine will be described with reference to FIG. First, the number counter of the erase management table of the block including the erased sector is incremented by one (a). It is determined whether the number of erasures has reached a specified value (b), and if so, the number of erasures of the previous block is checked to determine the block with the minimum number of times and data has not been replaced (c). The data of the block is replaced (d). Then, an exchange flag is set (e), and the contents of each table are rewritten (f). The feature of the present embodiment is that erasure management is performed in a plurality of sectors in a memory capable of erasing in sector units, thereby simplifying erasure management, saving waiting time in rewriting a large file, and reducing the erasure management table. The effect that can be expected can be expected. Therefore, it is suitable for a large-capacity storage device when it is difficult to perform erase management for each sector.
[0014]
By the way, tables such as a logical sector table and a physical sector table, which are constituent elements in the embodiments described so far, will be described. Since the flash memory is a non-volatile memory, the system of the present invention does not lose data in the flash memory even when the power supply is stopped during non-operation. However, no matter how much data is stored, if the contents of the table are lost, it becomes impossible to know what data is stored in which sector, and the data in the flash memory becomes unidentified meaningless data. . Therefore, the data stored in the table also needs to be stored after the power supply is stopped. However, it is not necessary to save all data in the table. For example, the data of the logical sector table can be easily created from the data of the physical sector table. The reverse is also possible, that is, it is only necessary that one of the data is stored. Therefore, the physical sector table is stored in an electrically erasable and writable non-volatile memory (EEPROM), and the logical sector table is stored when the power supply is started.PhysicsIt is created from the sector table. This allows the logical sector table to use volatile memory. Similarly, since the table of the number of used sectors of each block can be created from the physical sector table, it is created in the volatile memory when the system is started. These tables can be developed on the main memory of the main system. Other tables include an erasure management table and a status table, but these cannot be created from the other tables, and the erasure management table is stored in the EEPROM because data should not be lost. The status table is obtained when writing or erasing is performed again, but it must be stored in an EEPROM because it is troublesome twice. However, it can also be stored in volatile memory to save memory. These tables can be stored in the same memory as a storage medium to reduce the number of chips. For example, since both the physical sector table and the erase count table should be stored in the non-volatile memory, they can be stored in the same EEPROM chip and the EEPROM can be reduced to only one chip. When the processor is a one-chip microcomputer, a relatively small table such as a sector number table is stored in a RAM core built in the one-chip microcomputer. FIG. 13 shows a configuration diagram of the fourth embodiment in which these are summarized. In the figure, 111 is a one-chip microcomputer having a built-in RAM and ROM, 112 is a RAM core in the one-chip microcomputer, 113 is a ROM core in the one-chip microcomputer, 114 is an EEPROM chip, 115 is an SRAM or a DRAM, Is the same as described above. The RAM core 112 stores a used sector number table, the ROM core 113 stores a microcomputer control program, the EEPROM 114 stores a physical sector table and an erase management table, and the RAM 115 stores a logical sector table. The free space of the RAM 115 is also used as an organizing data buffer for performing the organizing routine shown in FIG. 9 and a write buffer for speeding up writing. As described above, according to the present embodiment, the number of chips can be reduced by combining tables and buffers according to the characteristics of the storage medium. On the other hand, FIG. 24 shows an embodiment in which the EEPROM is omitted. This is realized by storing the non-volatile table data described in the fourth embodiment in the flash memory 1. In the figure, reference numeral 116 denotes a table storage area provided in the flash memory 1. However, since the flash memory is not suitable for updating small data such as table data, the table data is stored in the flash memory 1 immediately before the power is turned off. It shall be stored in the SRAM 115. That is, when the power supply of the system of the present invention is turned off, necessary data in the contents of the RAM 115 is transferred to the flash memory 1 and then the power supply is turned off. When the power supply is turned on next, the data is transferred from the flash memory 1 to the RAM 115. Start normal operation after loading. Therefore, it is necessary to always reserve a storage area 116 for storing tables in the flash memory. However, the storage position does not need to be fixed. If not fixed, an area indicating the address for storing the table is provided in advance, and the address at which the table is stored is always recorded, so that it is not necessary to search the position of the table when the power is turned on.
[0015]
Further, FIGS. 14, 15, 16 and 23 show examples of the configuration of the flash memory itself. FIG. 14 shows a flash memory chip in which a storage area for a table different from a data area is provided for each erase block, and the EEPROM can be omitted by writing a physical sector table and the number of erases for each block. In the figure, reference numeral 131 denotes an erase block, and 132 denotes a table storage area added for each erase block 131. The data stored in the table 132 corresponding to the erase block 131 can be accessed at the same address as that of the erase block 131, and the file data and the table data are sorted out by selecting the signal line or selecting the mode. In this way, the lifespan of the data area and the table area match, and the data area 131 can be used, but the table is not broken and becomes unusable. If the data area and the table area are close to each other, the tendency is further increased. Since a table is configured for each erase block, sharing of address lines is easily realized. An example of the table storage area 132 is shown in FIG. In the figure, reference numeral 133 denotes an entire erasure unit block, reference numeral 134 denotes a file data area in the block, and reference numeral 135 denotes an area for storing the logical number of the block, which has an 8-bit storage capacity. Reference numeral 136 denotes a status table indicating the state of the block, which has a capacity of 16 bits. The contents of the status table 136 include an erasure count management table, an unusable flag, a replaced flag, and a correction flag. The surplus bits in the status table 136 can be used for storing the block number. FIG. 23B shows an example of a table area 132 further provided with an error correction area. Reference numeral 137 denotes an area indicating an error correction area. In this case, the storage capacity is set according to the correction capability. For example, if a memory chip having a word configuration of 16 bits per word and an erasure block of 512 B has an error correction area of 8 bits, it has a 1-word correction capability. That is, by writing the word number where the defective bit exists and writing the correction data in another area, the data of the word is replaced at the time of reading. The correction data area may be provided in this table, or there may be a method in which the correction data area is stored in another storage area. In the former case, all data corrections can be performed in the table, but since a correction data area is provided for each block, a redundant area becomes large in the entire chip. In the latter case, means for indicating the area in which the correction data is written is required, and the access time increases because another storage area is accessed. Can be set. It is preferable to use the remaining bits of the status table area 136 to specify the area where the correction data is written. An example of the correction data area will be described with reference to FIG. FIG. 15 shows an EEPROM type storage area 138 which can be written and erased in small units such as 1 byte or 1 word separately from the data storage area. This area is used as a correction data table to write correction data. The data correction is realized by reading and replacing the data at the designated position when reading the data at the location to be corrected. In addition, FIG. 15 does not configure the configuration of the table area in the vicinity of the erase block of the corresponding data area. In this case, the components in the figure are the same as those in FIG. 14, and since the configuration of the memory cells is integrated in the chip, there is an effect that the configuration is simplified as compared with the configuration of the memory cell in FIG.
[0016]
FIG. 16 shows a flash memory chip having another configuration. In addition to the data storage area 141, a buffer area 142 for temporarily storing data is provided in a memory chip, and this part may be a volatile memory. An address counter 143 counts up in response to a clock input. At the time of write access, write data is written to the buffer area 142, and by inputting an address, a plurality of data can be transferred and written to the data area 141 at once. If such a memory is used, an external write buffer for speeding up writing can be omitted. Conversely, if a plurality of data can be transferred to the buffer area 142 at once by inputting an address from the data area 141 at the time of reading, read access is also simplified. In this case, the buffer does not need to input a continuous address as a serial access memory, and has an internal address counter 143. When a clock is input, the internal address counter counts up and can access a continuous area to output data. By doing so, the usability is further improved. It is most effective to configure the buffer area as one unit. If the buffer area is configured not only for one unit but for a plurality of units, the buffer effect can be improved. For example, when one sector is an erase block unit, if one buffer for storing data of one sector is provided, writing and reading of one sector are performed at one time. The write of data in the sector can be accepted, and read data can be prepared. The use of this buffer has an effect that the external arrangement buffer can be omitted.
[0017]
Next, an embodiment in which the storage device using a flash memory described in the above embodiments is applied to an information processing system will be described. FIG. 17 is a diagram illustrating an interface circuit for connecting a storage device using a flash memory (hereinafter, referred to as a flash file system) to an information processing system (hereinafter, referred to as a host). This is an I / O bus, and standard buses include buses such as ISA, EISA, Micro Channel, and SCSI. Reference numeral 202 denotes a bus buffer or a bus controller for converting a standard bus into a dedicated bus, but a system in which this is omitted may be considered. These are connected so that the host can store data that cannot be stored in a storage device such as a main storage device, an extended main storage device, or a display storage device in its own system, or data that the host wants to retain even after power-off. The external storage device or auxiliary storage device installed. A floppy disk drive 203, a hard disk drive 204, and the like are common, and a flash file system 205 is connected to the floppy disk drive 203 and the hard disk drive 204. It is not necessary for all of these auxiliary storage devices to be connected to the host system, and the user selects and connects them appropriately. An interface circuit 206 is added to the flash file system 205, 207 is an interface register group, 208 is a command register which is one of the registers in the interface register group, 209 is an address decode circuit of the interface register group, 210 is This is a command interrupt signal. The above-mentioned numbers are the same as those described in the above description. However, the program stored in the program memory 4 stores a program corresponding to a command centered on an access request from the host, in addition to the control and management of the file data described in the above description. The host issues a command to the auxiliary storage device through the host bus 201. This is performed by writing a command code in a command register 208 which is one of the interface register group 207 in the interface circuit 206. The interface register group 207 includes all the registers that the hard disk drive has as interface registers, and also has the same register specifications, so that there is no difference from accessing the hard disk from the host. It is also considered effective to match this register with the interface of another auxiliary storage device such as a floppy disk drive or an optical disk drive. Or, it supports multiple auxiliary storage interfaces at the same time, and it seems that the host uses another auxiliary storage device. However, it is very space-saving that one flash file system can actually be used. It is valid. When a command is written by the host, the command register 208 issues an interrupt signal 210 to the processor 3, and upon receiving the command, the processor 3 interprets the written command code and responds to the host command request. The interface register group 207 and the commands all correspond to the hard disk drive. However, since the storage medium is different, there are some unnecessary and different processing. For example, a format is indispensable for a magnetic disk drive, but is unnecessary for a semiconductor disk drive. Therefore, processing is not performed or simply rewritten to regular data. Hereinafter, the operation for reading and writing the file data is the same as that described in the above embodiments. Although the first embodiment is applied to the drawing, it is also possible to apply the first embodiment as it is or to another embodiment described later.
[0018]
FIG. 18 is a configuration diagram of an example of a personal computer using a flash file system as an auxiliary storage device. In the figure, 221 is a CPU of the information device, 222 is a coprocessor, 223 is a standard I / O bus constructed inside the information processing system of this embodiment, 224 is a bus unit that constructs a standard I / O bus 223, 225 Is a memory control unit for accessing a high-speed memory such as a main memory or an extended memory, 226 is a main memory, 227 is a BIOS ROM in which a basic control program is stored, and 228 is a keyboard controller to which a keyboard is connected. . Reference numeral 229 denotes a display adapter to which a display device is connected. Reference numeral 230 denotes an expansion memory, 231 a parallel port I / F for connecting a printer or the like, 232 a serial port I / F such as a mouse or RS232C, 233 a floppy disk drive, 234 a standard HDD I / O from a standard I / O bus 223. The buffer controller 235 for converting to F is a flash file system. The inside of the flash file system 235 is configured by the components shown in the embodiments described above. Reference numeral 236 denotes an I / F unit which receives a file access and transfers data, and an interface register group 207 shown in FIG. And address decode 209. A control unit 237 performs data management and control in the flash file system 235, and includes the processor 3, the program memory 4, the access controller 2, and the write buffer 9 in FIG. Reference numeral 238 denotes a flash memory array for storing file data, and 239 denotes an information table for storing data and information for memory management, and includes all of the tables 5, 6, 7, and 8 in FIG. Next, the operation will be described. When the power is turned on and the operation is started, first, the CPU 221 accesses the BIOS ROM 227 through the standard I / O bus 223 to perform initial diagnosis and initial setting. Then, the system program is loaded into the main memory 226 from the auxiliary storage device. In this embodiment, a flash file system 235 is employed as an auxiliary storage device. However, the CPU 221 operates as accessing the HDD to the HDD controller 234 through the standard I / O bus 223. Therefore, the flash file system 235 supports an I / F function completely compatible with the HDD by the internal I / F unit 236. When the loading of the system program ends, the processing proceeds according to the processing request of the user. The user proceeds with inputting and outputting the process using the KBDC 228 and the display adapter 229 on the standard I / O bus 223. Then, input / output devices connected to the parallel I / F 231 and the serial I / F 232 are utilized as needed. When the main memory capacity of the main memory 226 on the main body is insufficient, the main memory is supplemented by the extended RAM 230. When the user wants to read and write a file, the user requests access to the auxiliary storage device assuming that the HDD is the auxiliary storage device, and the flash file system 235 receives the request and accesses the file data. According to the present embodiment, a flash file system is employed as if a HDD, which is the most common auxiliary storage device, is mounted on a standard I / O bus of a standard personal computer. . Therefore, even if a flash file system is adopted as a new storage medium, a BIOS ROM or a system program having an HDD mounted thereon can be used as it is without any change. In the above embodiment, a standard personal computer is used as an example, and the main memory and the extended memory are provided on a standard I / O bus, and information of a configuration in which a coprocessor, a parallel I / F, and a serial I / F do not exist. The present invention is also applicable to these devices.
[0019]
Next, an embodiment for coping with the occurrence of a defect in the flash memory will be described with reference to FIG. Although it has already been stated that the number of rewrites in a flash memory is limited in principle, as deterioration due to rewrite progresses, the time required for erasing and writing data increases, and there is a problem in data retention reliability. Therefore, when it is determined that a state that should not be used is reached due to deterioration of the memory, the use of the storage area or the memory chip should be stopped. Then, when it is determined that such an area increases and the life of the entire flash file system is approaching, the use of the flash file system should be stopped. As a method of detecting the deterioration of the flash memory, a method of judging from an erasing failure that the erasing is not completed within a specified number of times even if the erasing is repeated or the erasing time takes a certain time or more. A method of judging from a writing failure that writing is not completed within a specified number of times even if writing is repeatedly performed. In addition, a method is conceivable in which the number of erasures is managed and a judgment is made based on the fact that the number of erasures reaches a prescribed number or more. When the storage capacity that has deteriorated and becomes unusable reaches a certain specified value, it is determined that the life of the flash file system has expired. FIG. 19 shows an embodiment for realizing a means for alerting the user. In FIG. 19, reference numeral 240 denotes a controller in the flash file system 235 for recognizing the usage limit of the own system and transmitting this to the host system. An interrupt signal 241 is an error report register indicating that the usage limit has been reached. When the host receives the interrupt signal 240 through the HDD buffer 234, the host accesses the register 241 in the flash file system to grasp the situation, and reports to the user as appropriate. FIG. 20 is a flowchart showing software for realizing this operation. (1) is a flowchart of a check routine in the flash file system, and (2) is a flowchart of a warning program for a user in the host system. . The operation will be described while also explaining the drawings. The controller of the flash file system jumps to this routine when a storage area that is considered to have reached the usage limit is detected. Then, the capacity of the storage area at the usage limit is added (a). When a certain limit value is reached (b), a value indicating that the use limit has been reached is written as an error content in an error report register in the own system (c). Then, an interrupt signal to the host is output (d), and this routine ends. The added value of the capacity (a) needs to be stored in the flash memory or another memory. Also, the limit value of the remaining capacity in (b) is set appropriately according to the system. When the host system receives the interrupt signal of (d), the process is interrupted at a good break and the routine shown in the flowchart of (2) is entered. First, the error report register in the flash file system is accessed to receive the interrupt. The reason is determined (e), and if this is a use stop request due to the use limit of the flash file system being reached (f), access to the flash file system thereafter is prohibited (g), and the user is warned (h). ). As a warning method, a method of visually appealing such as using a display device of an information device or attaching a warning indicator, and a method of auditory appealing such as emitting a warning sound can be considered. If only write access is prohibited and read access is permitted, file data can be backed up. According to this embodiment, the user can be notified immediately when the flash file system reaches the usage limit, and the reliability of data can be increased. As another embodiment, the routine shown in FIG. 20 (2) is executed on the assumption that the host system reads the error report register every time access is made without providing the interrupt signal 240 in FIG. According to the present embodiment, the usage limit can be reported by replacing the HDD without changing the hardware configuration of the host system at all. In another embodiment, the maintenance program is periodically executed by the host system, and at that time, the error report register 241 is read to check whether the usage limit has been reached, thereby recognizing the usage limit. According to the present embodiment, there is no need to change the BIOS program or system program of the host system at all.
[0020]
Next, an embodiment corresponding to the processing at the time of power shutdown will be described. The flash file system of the present invention is basically an auxiliary storage device, and is generally configured to be supplied with power from a host system. However, since the operation is asynchronous with the host, the flash file system may operate even when the host is not operating. However, if the user handling the host does not recognize it, the power of the host may be turned off, and the power supply to the operating flash file system may be stopped. An embodiment of the invention corresponding to this is shown in FIG. FIG. 21 is a diagram of a system in which backup power is supplied by a battery so that the flash file system can continue to operate even after power supply from the host is stopped. In the figure, reference numeral 251 denotes a host computer such as a personal computer. An information device, 252 is a flash file system, 253 is a backup battery, and 254 is a backflow cutoff circuit for preventing the power of the battery 253 from flowing back to the host 251 when the power of the host 251 is cut off. Reference numeral 255 denotes a detection circuit for detecting that power supply from the host 251 has been cut off, reference numeral 256 denotes a detection signal as an output thereof, reference numeral 257 denotes a shutoff circuit for shutting off the power supply of the battery 253 to the flash file system 252, and reference numeral 258 denotes a flash. This is a cutoff signal for operating the cutoff circuit 257 because the file system 252 has completed the processing that was being performed and no longer requires power supply. While the power is supplied from the host 251, the flash file system is driven by the power of the host 251. This allows trickle charging of the battery 253 by properly adjusting the output voltage of the battery 253 and the supply voltage of the host 251. However, when the battery 253 is not a secondary battery, it is necessary to add a diode for preventing inflow. Then, when the power of the host 251 is turned off and the power supply to the flash file system 252 is stopped, the power is supplied from the battery 253 and the flash file can continue to operate. Then, when the power shutdown detection circuit 255 detects the power shutdown, the flash file system recognizes the power shutdown based on the detection signal 256, completes the operation under processing, and then performs the power shutdown process. In the power cutoff process, the battery cutoff circuit 257 is finally cut off by the cutoff signal 258, and the operation of the flash file system ends. Note that the backflow cutoff circuit 254 may employ a method using a backflow prevention diode. According to the present embodiment, the host 251 is completely separated from the flash file system in terms of signals, so that only the data is exchanged in response to the access request from the host, and the operation stop of the host can be closed within the host. In other words, the host does not need to make any hardware changes due to the connection of the flash file system.
[0021]
FIG. 22 shows another embodiment corresponding to the power-off of the host. However, in the example of FIG. 22, the system is actually a system that continues to supply power from the host. In the figure, reference numeral 258 denotes a power supply line supplied from the host 251 to the flash file system 252, and reference numeral 259 denotes a power supply busy signal indicating that the flash file system 252 is in operation and needs power supply. Even if the power switch is turned off, the power supply circuit of the host 251 does not stop the power supply while the power busy signal 259 is active, and all the processes of the flash file system are completed and the power busy signal 259 becomes inactive. Then stop the power supply. That is, for the user, even if the power switch of the host information device is turned off and the power is turned off, the user does not actually cut off the operation but waits for the end of the operation of the flash file system 252. According to this embodiment, since the host recognizes the end of the operation of the flash file system and controls the power supply, there is no need for a backup power supply and the like, and there is an effect that the configuration of the power supply circuit of the flash file system is simplified.
[0022]
Next, a fifth embodiment of the present invention will be described. FIG. 25 shows a hardware configuration for realizing the present invention, FIG. 26 shows a storage configuration in a flash memory of the present invention, and FIG. 27 is a flowchart for writing data. 26 will be described for convenience. In the figure, reference numeral 311 denotes a storage area in units of 512 bytes (4 kilobits), which is a sector in which data is actually written, and is called a physical sector. On the other hand, the storage data supply side manages data using virtual sectors called logical sectors. All physical sectors 311 and logical sectors are assigned numbers having no correlation. An erasing block 312 is a unit for erasing data all at once, and its capacity differs depending on the memory. For example, if the erase block unit is 16 kilobytes, 32 physical sectors are one block. Reference numeral 313 denotes a memory chip, which is divided into 32 blocks of 1024 sectors in the case of a chip of 16 megabytes and a 4 megabit chip. Those that can be erased only on a chip basis are one chip and one block, and those that can be erased for each physical sector have the same number of blocks and the same number of physical sectors. The flash memory can perform random write access to an erased block within the block. However, once writing is performed, writing cannot be performed unless the next erasure is performed. Therefore, in a memory having a plurality of sectors as one block, all the sectors must be written and then erased. In the following description, it is assumed that the flash memory is a 4-megabit chip and the erase block is 16 kilobytes (128 kilobits). FIG. 26 shows the memory of the very configuration. FIG. 25 shows a hardware configuration in which the memory chip 313 is used. In FIG. 25, reference numeral 301 denotes a flash memory as a storage area for write data, 302 denotes an access controller for accessing the flash memory 301, and 303 denotes storage data and status data. An operating processor 304 is a logical sector table in which a physical sector number is recorded in order to refer to which physical sector of the flash memory 301 the data of the stored logical sector number is stored in. A physical sector table for referencing the logical sector number stored in the physical sector 311 of 301, a block table 306 for storing the status of each block, and whether the block is usable or what Sector is written Or, and the like are recorded. Reference numeral 307 denotes a write buffer for temporarily storing write data and quickly returning the bus right to the data supply side because the write speed of the flash memory is much slower than that of reading. Reference numeral 308 denotes an organizing data buffer for temporarily storing organizing data in an organizing routine described later. FIG. 27 is a flowchart for explaining the operation of the processor 303 of FIG. 25 for performing writing in the configuration of FIG. The operation will be described below according to this flowchart. The storage of the data to be written is performed in units of one sector = 512 bytes. That is, data less than 512 bytes is also stored in the 512-byte storage area. A number is assigned to the data in units of one sector, and this is defined as a logical sector number. It is assumed that the data supply side only needs to be aware of this logical sector number. Assuming that the data supply side requests writing of one sector, this data is given a certain logical sector number, and this data is handled with the previous logical sector number even if rewriting occurs. On the other hand, the data storage side determines the storage location of this data. The storage location is the first unwritten sector of the block pointed to by the write pointer. That is, it is the sector next to the physical sector in which the previous write was performed. For example, in FIG. 26, when the previous write is written to the third physical sector of the first block, the next write is performed to the fourth physical sector of the first block. At this time, the processor 303 determines the storage location of the data by accessing the block table. This operation is (a) in the flowchart. In (b), when there is no problem in writing, the data is written by incrementing the number of write sectors of the block. Actual write access control is performed by the access controller 302. After the writing, the written sector numbers are recorded in the physical sector table and the logical sector table, respectively. When rewriting a previously written logical sector, the previously written logical sector number is erased from the physical sector table. This is an operation for indicating that the data of the physical sector is invalid. The arrangement routine (c) is an operation routine when the block pointed to by the write pointer has already been written in all the sectors and cannot be written. This will be described with reference to the flowchart of FIG. (D) is an operation for stopping writing to that block and writing to the next block, since writing is not possible if the block is broken or if the routine has been entered. On the other hand, at the time of read access, the logical sector table in which the necessary data is stored is referred to, the physical sector number is determined, and the necessary data is read. Next, the rearranging routine will be described. The reason for the necessity of the rearrangement routine is that in the above-described writing method, data is written to another physical sector in rewriting data of the same file. That is, the data written before rewriting becomes unnecessary, but remains stored in the memory and is data to be erased. However, erasing the flash memory every time it becomes unnecessary shortens the life of the flash memory having a finite number of erasures. Therefore, the data is deleted by the rearranging routine. The pruning routine is performed when a block is full of write data. A specific method of organizing is performed according to the flowchart of FIG. Hereinafter, each part in the flowchart will be described. (A) All data in the block to be arranged is once saved in the arranged data buffer 308 in FIG. (B) When the data is saved and erasable, the block is erased. (C) Referring to the physical sector table of each sector in the organizing data buffer, it is determined whether data is necessary or unnecessary. (D) If necessary data is written into the block again. The above is the description of the operation of the embodiment of the present invention. According to this embodiment, the erasure of each erase block of the flash memory is performed sequentially without concentrating on a part, so that an effect of extending the life can be expected. In addition, there is an effect of compensating for the disadvantage that the writing speed of the flash memory is slow in writing. In addition, since unnecessary data is efficiently erased, there is an effect that the storage capacity of the semiconductor disk can be always maintained.
[0023]
Next, another embodiment will be described. FIG. 29 shows an example of the configuration of an apparatus for judging deterioration of a flash memory. In the figure, reference numeral 401 denotes a flash memory cell; 402, an erase time measurement timer for measuring the time from the start to end of erase control; An erasure control circuit for performing control for erasing data written in the cell 401, a deterioration management table 404 for storing the deterioration of the flash memory cell 401, a controller 405 for controlling the flash memory cell 401, and a management 406 for deterioration An activation signal for simultaneously activating the erasure time measurement timer 402 when the controller 405 causes the erasure control circuit 403 to start erasure, an end signal 407 for the erasure control circuit 403 notifying the erasure time measurement timer 402 of the end of the erasure process, Reference numeral 408 denotes measurement data measured by the erase time measurement timer. FIG. 30 is a flowchart for explaining the operation of the controller 405 in FIG. 29, and the determination of the deterioration of the flash memory is performed according to this flowchart. Next, the operation will be described with reference to FIGS. First, when an erasing operation is required for a certain memory cell 401 from control of the entire system, the controller 405 receives an erasing request (FIG. 30A). Then, the controller 405 instructs the erase control circuit 403 to start an erase operation and an erase operation (FIG. 30B). Upon receiving this, the erase control circuit 403 starts the erase operation of the corresponding memory cell 401 (FIG. 30c). At the same time, the controller 405 starts the erase time measurement timer 402 (FIG. 30D). The controller 405 waits until the erasure is completed, and when the memory control circuit 403 completes the erasure of the memory cell 401, it informs the controller 405 of the completion (FIG. 30e). The controller 405 refers to the erasure time measurement timer 402, recognizes the time spent for erasure, determines the degree of deterioration, and assigns a number corresponding to the degree to the storage area. For example, the degree of deterioration is divided into eight stages. If the erasing time is the same as the unused state, "0" is set. If the deterioration is advanced and the unusable state is "7", the steps between "1" and "6" are performed. Number. Then, the number assigned to the storage area is stored in the deterioration degree management table 404 (FIG. 30f). By setting the degree of deterioration to eight levels, one storage area is allocated to one byte and management becomes easy. Each storage area is handled based on this deterioration degree management table. In each of the areas where the degree of deterioration has advanced by one, the data of the area with a small degree of deterioration is transferred each time to stop the progress of the deterioration, and the deterioration of all the storage areas is averaged. The use of the area where the deterioration has reached the final stage is prohibited. This is a process performed by a controller that controls the entire storage system. FIG. 31 shows the operation flow of the controller of this storage system. 29 will be described in order. If the host system issues a write access request to the storage system and the controller of the storage system determines that an erasing operation is required when writing data (FIG. 31A), the controller 405 in FIG. A request for erasure and deterioration management is issued (FIG. 31b). When the erasing operation is completed, the deterioration degree of the erased storage area is referred to in the deterioration degree management table 404 of FIG. 29 (FIG. 31B). If the deterioration has progressed, the deterioration has not progressed the most and the replacement is performed. An area that has not yet been searched is found (FIG. 31c), and data is transferred and replaced (FIG. 31d). It is more efficient to use the replacement flag described in the first embodiment to determine that the deterioration has not progressed the most and the replacement has not been performed yet. This is because an area that has been subjected to the above-described replacement processing should not be used for replacement of deterioration averaging because stored data is not data that does not progress deterioration (data that is unlikely to be rewritten). Stand up and specify. In this embodiment, the control of the entire storage system and the control of the device for judging deterioration are separated, and the controller is different. However, the controller 405 may be shared with the controller of the storage system. Although the erase time measurement timer 402 is also configured as hardware, the erase time measurement may be performed by software control by a controller. This is what you need to do if you want to reduce the number of components in your storage system. According to this embodiment, the table for deterioration management can be changed to the erasure management table used in the previous embodiments, and the storage area used can be drastically saved. In addition, since the erasing time is a more direct criterion for determining the deterioration of the memory than the number of times of erasing, it is possible to more accurately grasp the degree of deterioration and average the deterioration.
[0024]
Next, another embodiment of the management of the number of erasures using the embodiment of FIG. 24 will be described with reference to FIG. In the method of managing the number of erasures in the embodiments described above, the number of erasures is counted up one by one when erasure is performed, and the number of erasures is grasped in detail. Truncates the bits. In the embodiment of FIG. 24, in the normal use state, the number of erasures is stored up to the least significant bit in a volatile memory such as an SRAM or a DRAM, and is transferred to the flash memory when the power is turned off. Is truncated by one or more bits (FIG. 32a). Alternatively, the data is transferred with carry (FIG. 32B). For the lower bits to be discarded, the optimum value should be considered based on the limit value of the number of times of erasure of the flash memory as long as the recognition of the deterioration by grasping the number of erasures does not lose accuracy. It is assumed that the maximum value of the number of times does not exceed 1% of the guaranteed value of the number of times of erasing the flash memory. That is, if the guaranteed value of the number of times of erasure is 10,000 times, 6 bits (maximum value 63) not exceeding 100 times are set as the cutoff limit. According to this embodiment, the number of erasures is not accurately grasped. However, since the error is set to 1% or less of the guaranteed value of the number of erasures of the flash memory, the accuracy of the guaranteed value originally has a range of about one digit. This is not an essential problem if it is to judge whether or not the data has a strong tendency to occur. As a result, the effect of reducing the capacity of the flash memory used for managing the number of erasures is great.
[0025]
Next, another embodiment for reducing the table area will be described. FIG. 33 is a configuration diagram of a storage system in which the physical sector table and the logical sector table described in the above embodiments are omitted. However, an address conversion table 411 is provided instead of these. For the other numbers already described, the address conversion table 411 does not perform the conversion for the address input of the storage area in which the data replacement for averaging the deterioration degree is not performed, but uses the address input of the storage area in which the data replacement is performed. On the other hand, it is a table for outputting the replacement destination address. Therefore, there is no need for a physical sector table or a logical sector table. Basically, an address requested by the system to access is accessed as it is in accordance with a physical address on the memory, and the deterioration of the area proceeds, and the degree of deterioration increases. After the data is exchanged for averaging, the address is converted. The first embodiment can be applied only when the storage unit (sector) of the file data and the erasure unit match as in the first embodiment. The capacity of the address conversion table depends on the capacity of the area that can be converted. That is, if the capacity of the address conversion table is reduced, the storage capacity for performing the conversion is reduced, and if a large area is secured, addresses in many areas can be converted. This is a factor directly related to the life of the system. Although FIG. 33 is a modification of the first embodiment, the present invention can also be applied to an embodiment having the deterioration management table described with reference to FIG. According to the present embodiment, there is an effect that data management is simplified and a table area can be largely reduced.
[0026]
Next, an embodiment in which an indicator indicating the operation is provided will be described. FIG. 34 is a diagram showing an example of an internal configuration showing the present embodiment. The numbers already shown are the same as those in FIG. 17 based on FIG. In addition, reference numeral 421 in the figure denotes an output port signal of the processor 3 indicating that data is being transferred from the write buffer 9 to the flash memory 1, and reference numeral 422 denotes an indicator for emitting light indicating that the transfer is being performed by the output port signal 421. Light emitting diodes are suitable as indicators. FIG. 35 is an external view of this embodiment, in which (1) is an overall view of a card shape, and (2) is a diagram showing an example in use. In the figure, 423 is an IC card as an auxiliary storage device of the present invention, 424 is a connector, 425 is a light emitting diode, and 426 is a host personal computer. In FIG. 34, when the host personal computer issues a write access processing request to the auxiliary storage device 205 via the standard IO bus 201, the processor 3 performs processing to store the write data in the write buffer 9. Upon completion of this, a signal indicating completion of writing is output to the standard bus 201. Thereafter, the processor 3 transfers and stores the data stored in the write buffer 9 to the flash memory 1. While performing this process, the processor 3 activates the output port signal 421 to cause the indicator 422 to emit light. Then, when the transfer from the write buffer 9 to the flash memory 1 is completed, the processor 3 makes the output port 421 inactive and stops the light emission of the indicator 425. FIG. 35 (1) shows an example in which the present invention is applied in the form of an IC card. An indicator 425 is attached to the side opposite to the connector so that the lighting of the indicator 425 can be confirmed when the indicator 425 is attached to the personal computer. (2) shows a state in which the indicator 425 is actually inserted into the notebook computer, and the user can work while checking whether the indicator 425 is on or off. However, the user only needs to confirm the lighting when the power is turned off. According to this embodiment, there is an effect that the circuit configuration is relatively simple, the visibility of the indicator is good, and erroneous operation of the user can be prevented.
[0027]
【The invention's effect】
According to the present inventionEven if the power supply is stopped, information for referring to the logical sector number of the data mapped to the physical sector is not lost, and therefore, the data in the flash memory is unidentified meaningless data. To becomeCan be prevented.
[Brief description of the drawings]
FIG. 1 is a hardware configuration diagram of a first embodiment of the present invention.
FIG. 2 is a storage configuration diagram of a flash memory chip according to a first embodiment of the present invention.
FIG. 3 is a flowchart of a main routine showing an operation of the first embodiment of the present invention.
FIG. 4 is a flowchart of an erase management routine showing an erase management operation according to the first embodiment of the present invention;
FIG. 5 is a hardware configuration diagram of a second embodiment of the present invention.
FIG. 6 is a storage configuration diagram of a flash memory chip according to a second embodiment of the present invention.
FIG. 7 is a flowchart of a main routine showing the operation of the second embodiment of the present invention.
FIG. 8 is a flowchart of a rearranging routine showing a sector rearranging operation according to a second embodiment of the present invention;
FIG. 9 is a flowchart of an erase management routine showing an erase management operation according to a second embodiment of the present invention.
FIG. 10 is a hardware configuration diagram of a third embodiment of the present invention.
FIG. 11 is a storage configuration diagram of a flash memory chip according to a third embodiment of the present invention.
FIG. 12 is a flowchart of an erase management routine showing an erase management operation according to a third embodiment of the present invention.
FIG. 13 is a hardware configuration diagram of a fourth invention according to the present invention.
FIG. 14 is a configuration diagram of a flash memory chip having a table for each erase block.
FIG. 15 is a configuration diagram of a flash memory chip having an area for storing information separately from a data area;
FIG. 16 is a configuration diagram of a flash memory chip having a buffer area separately from a data area.
FIG. 17 is a hardware configuration diagram of an interface portion of a flash file system according to a fourth embodiment of the present invention.
FIG. 18 is a configuration diagram of an information device using a flash file system according to a fourth embodiment of the present invention as an auxiliary storage device.
FIG. 19 is a configuration diagram of an embodiment for reporting a usage limit in the present invention.
FIG. 20 is a flowchart of an embodiment for reporting usage limits in the present invention.
FIG. 21 is a configuration diagram of an embodiment including a backup battery according to the present invention.
FIG. 22 is a configuration diagram of an embodiment having a power control signal according to the present invention.
FIG. 23 shows an embodiment of data storage in a flash memory having an information storage area separately from a data area.
24 is a configuration diagram of an embodiment in which the EEPROM is omitted from FIG.
FIG. 25 is a hardware configuration diagram of a fifth embodiment of the present invention.
FIG. 26 is a storage configuration diagram of a flash memory chip according to a fifth embodiment of the present invention.
FIG. 27 is a flowchart of a main routine showing the operation of the fifth embodiment of the present invention.
FIG. 28 is a flowchart of an organizing routine showing a sector organizing operation according to a fifth embodiment of the present invention.
FIG. 29 is a configuration diagram of an embodiment for extending the life of the system by managing deterioration over time.
FIG. 30 is an operation flow of the deterioration management controller in the embodiment of FIG. 29;
FIG. 31 is an operation flow of the storage system controller in the embodiment of FIG. 29;
FIG. 32 is an explanatory diagram of an embodiment for reducing the storage capacity of the erasure management table.
FIG. 33 is a configuration diagram of an embodiment that employs an address conversion table to reduce the storage capacity of the sector management table.
FIG. 34 is a configuration diagram of an embodiment in which an indicator indicating that the auxiliary storage device is operating is provided.
FIG. 35 is an external view of an embodiment in which an indicator indicating that the auxiliary storage device is operating is provided.
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Flash memory, 3 ... Processor, 5 ... Logical sector table, 6 ... Physical sector table, 7 ... Erase count management table, 8 ... Status table, 9 ... Write buffer, 13 ... Erase block, 49 ... Write sector number table, 51: Organizing buffer, 52: Physical sector, 111: One-chip microcomputer, 112: RAM core, 113: ROM core, 114: EEPROM, 115: DRAM or SRAM, 116: Table area, 132: Table storage area, 142: Buffer Area 143 address counter 207 I / F register group 227 BIOSROM 236 I / F unit 241 error report register 253 backup battery 259 power busy signal 402 erase time measurement timer 404: Deterioration degree management Buru, 411 ... address conversion table, 421 ... output port signal 422 ... indicator, 425 ... indicator exterior.

Claims (11)

記憶装置であって、
複数の物理セクタを含むフラッシュメモリと、
揮発性メモリと、
外部のホストシステムからのアクセス要求に応答して、前記フラッシュメモリをアクセスするための制御部とを備え、
前記フラッシュメモリは、前記物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を格納し、
前記制御部は、システムの起動の際に、前記フラッシュメモリに格納された前記物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を用いて、前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記憶されているかを参照するための情報を、前記揮発性メモリに作成し、
前記制御部は、前記アクセス要求に応答して、前記揮発性メモリに作成された前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、前記ホストシステムによって指定された論理セクタ番号に対応する前記フラッシュメモリの物理セクタを割り出し、割り出された前記フラッシュメモリの物理セクタをアクセスすることを特徴とする記憶装置。
A storage device,
A flash memory including a plurality of physical sectors;
Volatile memory;
A control unit for accessing the flash memory in response to an access request from an external host system,
The flash memory stores information for referring to a logical sector number of data mapped to the physical sector,
The control unit uses the information for referencing the logical sector number of the data mapped to the physical sector stored in the flash memory at the time of system startup, and stores the data of the logical sector number in the flash memory. Create information in the volatile memory to refer to which physical sector of the memory is stored in the volatile memory,
The control unit, in response to the access request, using information for referring to which physical sector of the flash memory the data of the logical sector number created in the volatile memory is described A storage device for determining a physical sector of the flash memory corresponding to a logical sector number designated by the host system, and accessing the determined physical sector of the flash memory.
前記フラッシュメモリは、電気的に消去可能な単位である消去ブロックを複数含み、
各消去ブロックは、複数の物理セクタを含む請求項1に記載の記憶装置。
The flash memory includes a plurality of erase blocks that are electrically erasable units,
2. The storage device according to claim 1, wherein each erase block includes a plurality of physical sectors.
前記制御部は、前記揮発性メモリとしてのRAMコアを含む請求項1又は2に記載の記憶装置。The storage device according to claim 1, wherein the control unit includes a RAM core as the volatile memory. 前記制御部は、前記ホストシステムから過去の書き込み要求の論理セクタ番号と同一の論理セクタ番号への書き込み要求があった場合に、前記揮発性メモリに作成された前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、過去の物理セクタとは異なる別の物理セクタに、前記ホストシステムからの書き込み要求に伴うデータを書き込む請求項1〜3の何れかに記載の記憶装置。When the host system issues a write request to the same logical sector number as the logical sector number of the past write request, the controller writes the logical sector number data created in the volatile memory to the flash memory. Using information for referring to which physical sector is described in a memory, data accompanying a write request from the host system is written to another physical sector different from a past physical sector. 3. The storage device according to any one of 3. 記憶装置であって、
複数の物理セクタを含むフラッシュメモリと、
揮発性メモリと、
外部のホストシステムからのアクセス要求に応答して、前記フラッシュメモリをアクセスするための制御部とを備え、
前記フラッシュメモリは、前記物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を格納し、
前記制御部は、電源供給が開始される際に、前記フラッシュメモリに格納された前記物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を用いて、前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記憶されているかを参照するための情報を、前記揮発性メモリに作成し、
前記制御部は、前記アクセス要求に応答して、前記揮発性メモリに作成された前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、前記ホストシステムによって指定された論理セクタ番号のデータが記憶された前記フラッシュメモリの物理セクタを割り出し、割り出された前記フラッシュメモリの物理セクタをアクセスすることを特徴とする記憶装置。
A storage device,
A flash memory including a plurality of physical sectors;
Volatile memory;
A control unit for accessing the flash memory in response to an access request from an external host system,
The flash memory stores information for referring to a logical sector number of data mapped to the physical sector,
When the power supply is started, the control unit uses the information for referencing the logical sector number of the data mapped to the physical sector stored in the flash memory, and the data of the logical sector number is used. Creating information in the volatile memory to refer to which physical sector of the flash memory is stored,
The control unit responds to the access request by using information for referring to which physical sector of the flash memory the data of the logical sector number created in the volatile memory is described. A physical sector of the flash memory storing data of a logical sector number designated by the host system, and accessing the physical sector of the flash memory determined.
前記フラッシュメモリは、電気的に消去可能な単位である消去ブロックを複数含み、
各消去ブロックは、複数の物理セクタを含む請求項5に記載の記憶装置。
The flash memory includes a plurality of erase blocks that are electrically erasable units,
The storage device according to claim 5, wherein each erase block includes a plurality of physical sectors.
前記制御部は、前記揮発性メモリとしてのRAMコアを含む請求項5又は6に記載の記憶装置。The storage device according to claim 5, wherein the control unit includes a RAM core as the volatile memory. 前記制御部は、前記ホストシステムから過去の書き込み要求の論理セクタ番号と同一の論理セクタ番号への書き込み要求があった場合に、前記揮発性メモリに作成された前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、過去の物理セクタとは異なる別の物理セクタに、前記ホストシステムからの書き込み要求に伴うデータを書き込む請求項5〜7の何れかに記載の記憶装置。When the host system issues a write request to the same logical sector number as the logical sector number of the past write request, the controller writes the logical sector number data created in the volatile memory to the flash memory. Using information for referring to which physical sector of the memory is described, write data accompanying a write request from the host system to another physical sector different from the past physical sector. 8. The storage device according to any one of 7. 記憶装置であって、
電気的に消去可能な単位である消去ブロックを複数含むフラッシュメモリと、
揮発性メモリと、
外部のホストシステムからのアクセス要求に応答して、前記フラッシュメモリをアクセスするための制御部とを備え、
前記フラッシュメモリの各消去ブロックは、複数の物理セクタを含み、
前記各消去ブロックの前記複数の物理セクタは、前記ホストシステムからのデータを格納するための第1の領域と、前記第1の領域の物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を格納するための第2の領域とに分かれ
前記制御部は、電源供給が開始される際に、前記フラッシュメモリの各消去ブロックの第2の領域に格納された前記物理セクタにマッピングされたデータの論理セクタ番号を参照するための情報を用いて、前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記憶されているかを参照するための情報を、前記揮発性メモリに作成し、
前記制御部は、前記アクセス要求に応答して、前記揮発性メモリに作成された前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、前記ホストシステムによって指定された論理セクタ番号のデータが記憶された前記フラッシュメモリの物理セクタを割り出し、割り出された前記フラッシュメモリの物理セクタをアクセスすることを特徴とする記憶装置。
A storage device,
A flash memory including a plurality of erase blocks, which are electrically erasable units;
Volatile memory;
A control unit for accessing the flash memory in response to an access request from an external host system,
Each erase block of the flash memory includes a plurality of physical sectors,
The plurality of physical sectors in each of the erase blocks refer to a first area for storing data from the host system and a logical sector number of data mapped to a physical sector in the first area. Divided into a second area for storing information of
The control unit uses information for referring to a logical sector number of data mapped to the physical sector stored in the second area of each erase block of the flash memory when power supply is started. Creating, in the volatile memory, information for referencing in which physical sector of the flash memory the data of the logical sector number is stored;
The control unit responds to the access request by using information for referring to which physical sector of the flash memory the data of the logical sector number created in the volatile memory is described. A physical sector of the flash memory storing data of a logical sector number designated by the host system, and accessing the physical sector of the flash memory determined.
前記制御部は、前記揮発性メモリとしてのRAMコアを含む請求項9に記載の記憶装置。The storage device according to claim 9, wherein the control unit includes a RAM core as the volatile memory. 前記制御部は、前記ホストシステムから過去の書き込み要求の論理セクタ番号と同一の論理セクタ番号への書き込み要求があった場合に、前記揮発性メモリに作成された前記論理セクタ番号のデータが前記フラッシュメモリのどこの物理セクタに記載されているかを参照するための情報を用いて、過去の物理セクタとは異なる別の物理セクタに、前記ホストシステムからの書き込み要求に伴うデータを書き込む請求項9又は10に記載の記憶装置。When the host system issues a write request to the same logical sector number as the logical sector number of the past write request, the controller writes the logical sector number data created in the volatile memory to the flash memory. 10. The data according to a write request from the host system is written in another physical sector different from the past physical sector using information for referring to which physical sector in the memory is described. The storage device according to claim 10.
JP2002320623A 1991-11-28 2002-11-05 Storage device Expired - Fee Related JP3587204B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002320623A JP3587204B2 (en) 1991-11-28 2002-11-05 Storage device

Applications Claiming Priority (7)

Application Number Priority Date Filing Date Title
JP31429791 1991-11-28
JP3-314297 1991-11-28
JP4-31756 1992-02-19
JP3175692 1992-02-19
JP4-230914 1992-08-31
JP23091492 1992-08-31
JP2002320623A JP3587204B2 (en) 1991-11-28 2002-11-05 Storage device

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP31815992A Division JP3407317B2 (en) 1991-11-28 1992-11-27 Storage device using flash memory

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2003432025A Division JP3826936B2 (en) 1991-11-28 2003-12-26 Storage device

Publications (2)

Publication Number Publication Date
JP2003203016A JP2003203016A (en) 2003-07-18
JP3587204B2 true JP3587204B2 (en) 2004-11-10

Family

ID=27670842

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002320623A Expired - Fee Related JP3587204B2 (en) 1991-11-28 2002-11-05 Storage device

Country Status (1)

Country Link
JP (1) JP3587204B2 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4492218B2 (en) * 2004-06-07 2010-06-30 ソニー株式会社 Semiconductor memory device
EP1776699A1 (en) * 2004-08-02 2007-04-25 Koninklijke Philips Electronics N.V. Data storage and replay apparatus
JP2006107363A (en) * 2004-10-08 2006-04-20 Toshiba Corp Portable electronic device and memory access method used in the same
JP2008225576A (en) * 2007-03-08 2008-09-25 Ricoh Co Ltd Control device of nand flash memory
JPWO2008126226A1 (en) * 2007-03-29 2010-07-22 富士通株式会社 Storage device control device, storage device, storage device control program, and storage device control method
JP5124217B2 (en) * 2007-09-18 2013-01-23 株式会社日立製作所 Storage device
JP5100789B2 (en) * 2010-05-28 2012-12-19 株式会社東芝 Semiconductor memory device and method for controlling semiconductor memory device
JP5614337B2 (en) 2011-03-08 2014-10-29 富士通セミコンダクター株式会社 MEMORY CONTROL METHOD, MEMORY CONTROL CIRCUIT, STORAGE DEVICE, AND ELECTRONIC DEVICE
JP5715878B2 (en) * 2011-05-19 2015-05-13 シャープ株式会社 Electronic cash register

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2251323B (en) * 1990-12-31 1994-10-12 Intel Corp Disk emulation for a non-volatile semiconductor memory
JP2582487B2 (en) * 1991-07-12 1997-02-19 インターナショナル・ビジネス・マシーンズ・コーポレイション External storage system using semiconductor memory and control method thereof
JPH05151097A (en) * 1991-11-28 1993-06-18 Fujitsu Ltd Data control system for rewriting frequency limited type memory
JP3178909B2 (en) * 1992-01-10 2001-06-25 株式会社東芝 Semiconductor memory device
JP3251968B2 (en) * 1992-01-20 2002-01-28 富士通株式会社 Semiconductor storage device
US6256642B1 (en) * 1992-01-29 2001-07-03 Microsoft Corporation Method and system for file system management using a flash-erasable, programmable, read-only memory

Also Published As

Publication number Publication date
JP2003203016A (en) 2003-07-18

Similar Documents

Publication Publication Date Title
JP3407317B2 (en) Storage device using flash memory
KR960012360B1 (en) Storage device employing a flash memory
US8031536B2 (en) Storage device employing a flash memory
JP3587204B2 (en) Storage device
JP4086083B2 (en) Information equipment with flash memory
JP3938208B2 (en) Information equipment with flash memory
JP3826936B2 (en) Storage device
JP4442708B2 (en) Information equipment with flash memory
JP4396765B2 (en) Information equipment with flash memory
JP2004303278A (en) Information processing system

Legal Events

Date Code Title Description
A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20031226

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040127

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040202

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040309

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040601

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040623

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20040628

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040802

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

Free format text: PAYMENT UNTIL: 20070820

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090820

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100820

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100820

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110820

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120820

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees