JP4183550B2 - MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD - Google Patents

MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Download PDF

Info

Publication number
JP4183550B2
JP4183550B2 JP2003122224A JP2003122224A JP4183550B2 JP 4183550 B2 JP4183550 B2 JP 4183550B2 JP 2003122224 A JP2003122224 A JP 2003122224A JP 2003122224 A JP2003122224 A JP 2003122224A JP 4183550 B2 JP4183550 B2 JP 4183550B2
Authority
JP
Japan
Prior art keywords
flash memory
data
block
buffer
written
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
JP2003122224A
Other languages
Japanese (ja)
Other versions
JP2004326574A (en
Inventor
直樹 向田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TDK Corp
Original Assignee
TDK Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TDK Corp filed Critical TDK Corp
Priority to JP2003122224A priority Critical patent/JP4183550B2/en
Publication of JP2004326574A publication Critical patent/JP2004326574A/en
Application granted granted Critical
Publication of JP4183550B2 publication Critical patent/JP4183550B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【産業上の利用分野】
本発明は、メモリコントローラ及びメモリコントローラを備えるフラッシュメモリシステム、並びに、フラッシュメモリの制御方法に関する。
【従来の技術】
近年、メモリカードやシリコンディスクなどのフラッシュメモリシステムに用いられる半導体メモリとして、フラッシュメモリが用いられることが多い。このフラッシュメモリは不揮発性メモリの一種であり、電源が投入されているか否かに関わらず、データが保持されるていることが要求される。
ところで、上記のような装置に特に用いられることが多いNAND型フラッシュメモリは、メモリセルを消去状態(論理値=1)から書込状態(論理値=0)に変化させる場合には、メモリセル単位で行うことができるが、メモリセルを書込状態(0)から消去状態(1)に変化させる場合には、メモリセル単位で行うことができず、複数のメモリセルからなる所定の消去単位(ブロック)でしかこれを行うことができない。かかる一括消去動作は、一般的に「ブロック消去」と呼ばれている。
上記のような特性により、NAND型フラッシュメモリ用いた装置では、デ―タを書き込む際に、ブロック消去された領域領域を検索し、検出された空き領域に対して新たなデータを書込んでいる。又、消去単位であるブロックは複数のページ(例えば、32枚のページ)で構成されているため、1枚のページのデータだけを書き変える場合であっても、そのページが含まれるブロックの他のページの全データを、ブロック消去されている領域に再度書込まなければならない。従って、NAND型フラッシュメモリ用いた装置では、データが書込まれているブロックのデータを、別のブロックに再度書込みするブロック間転送処理が頻繁に発生する。
【発明が解決しようとする課題】
上記ブロック間転送処理と、フラッシュメモリシステムが装着されるホストコンピュータからの指示によるデータの書込み処理は、別々に処理した方が処理の効率は良いが、途中で不意に電源が切断される場合等を考慮すれば、ホストコンピュータからの指示によるデータの書込み処理の途中にブロック間転送処理を割込ませなければならない場合がある。
そこで、本発明は、ブロック間転送処理やデータの書込み処理の効率の低下を抑えつつ、データの書込み処理の途中にブロック間転送処理を割込ませることができるメモリコントローラ及びメモリコントローラを備えるフラッシュメモリシステム、並びに、フラッシュメモリの制御方法を提供することを目的とする。
【課題を解決するための手段】
本発明にかかる目的は、フラッシュメモリに書込むデータ、又はフラッシュメモリから読出すデータを保持する複数のバッファと、
前記バッファのフル又はエンプティの状態を検知する第1の検知機能と、
ブロック間転送処理の要求を検知する第2の検知機能とを備え、
前記第2の検知機能によりブロック間転送処理の要求を検知したときに、
前記バッファから前記フラッシュメモリへの書込み処理を停止し、
更に、前記第1の検知機能により、前記バッファが全てフルの状態であることを検知したときに、
前記フラッシュメモリに書込むデータを前記バッファに取込む処理を停止すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始し、
更に、前記第1の検知機能により、前記バッファが全てエンプティの状態であることを検知したときに、
前記バッファを使用してブロック間転送処理を実行すると共に、
前記ブロック間転送処理で使用されない前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始するように構成されていることを特徴とするメモリコントローラ及びメモリコントローラを備えるフラッシュメモリシステムによって達成される。
更に、前記ブロック間転送処理の終了を検知する第3の検知機能とを備え、
前記第3の検知機能によりブロック間転送処理の終了を検知したときに、
前記ブロック間転送処理で使用されていた前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始するように構成されていることを特徴とすることにより、より良い効果(処理効率の低下抑制)を得ることができる。
本発明にかかる目的は、ブロック間転送処理の要求を検知したときに、
フラッシュメモリに書込むデータ、又はフラッシュメモリから読出すデータを保持する複数のバッファから前記フラッシュメモリへの書込み処理を停止し、
更に、前記バッファが全てフルの状態であることを検知したときに、
前記フラッシュメモリに書込むデータを前記バッファに取込む処理を停止すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始し、
更に、前記バッファが全てエンプティの状態であることを検知したときに、
前記バッファを使用してブロック間転送処理を実行すると共に、
前記ブロック間転送処理で使用されない前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始することを特徴とするフラッシュメモリの制御方法によって達成される。
更に、前記ブロック間転送処理の終了を検知したときに、
前記ブロック間転送処理で使用されていた前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始することを特徴とすることにより、より良い効果(処理効率の低下抑制)を得ることができる。
【発明の実施の形態】
以下、図面に基づき、本発明の実施の形態について詳細に説明する。
[フラッシュメモリシステム1の説明]
図1は、本発明にかかるフラッシュメモリシステム1を概略的に示すブロック図であり、このフラッシュメモリシステム1は一般的にはPCカードやコンパクトフラッシュ(サンディスク社の登録標)等に収められている。又、同図に示したようにフラッシュメモリシステム1は、フラッシュメモリ2と、コントローラ3で構成されている。
尚、上記PCカードはPCMCIA(Personal Computer Memory Card International Association)の規格に準拠しており、上記コンパクトフラッシュはCFA(CompactFlash Association)の規格に準拠している。又、本発明はSSFDC Forumの「SmartMedia((株)東芝の登録商標)」、MultiMedia Card Associationの提唱する「MMC(MultiMedia Card)」、ソニー株式会社が提唱する「メモリースティック(ソニー(株)の商標)」などに本発明を適用することも可能である。
又、フラッシュメモリシステム1が収められたPCカードやコンパクトフラッシュは、通常ホストコンピュータ4に着脱可能に装着されて使用され、ホストコンピュータ4に対に対して一種の外部記憶装置として用いられる。ホストコンピュータ4としては、文字、音声、あるいは画像情報等の種々の情報を処理するパーソナルコンピュータやデジタルスチルカメラをはじめとする各種情報処理装置が挙げられる。
図1に示したフラッシュメモリ2は、ページ単位で読出し又は書込みを、ブロック単位で消去を実行するデバイスであり、例えば、1ブロックは32ページで構成され、1ページは512バイトのユーザ領域と16バイトの冗長領域で構成され、ホストコンピュータ4側から見た場合1ページは512バイトで構成されている。
[コントローラ3の説明]
図1のコントローラ3は、ホストインターフェース制御ブロック5と、マイクロプロセッサ6と、ホストインターフェースブロック7と、ワークエリア8と、バッファ9と、フラッシュメモリインターフェースブロック10と、ECC(エラー・コレクション・コード)ブロック11と、フラッシュシーケンサブロック12とから構成される。これら機能ブロックによって構成されるコントローラ3は、一つの半導体チップ上に集積されている。以下に各ブロックの機能を説明する。
マイクロプロセッサ6は、コントローラ3を構成する各機能ブロック全体の動作を制御する機能ブロックである。
ホストインターフェース制御ブロック5は、ホストインターフェースブロック7の動作を制御する機能ブロックである。ここで、ホストインターフェース制御ブロック5は、ホストインターフェースブロック7の動作を設定する動作設定レジスタ(図示せず)を備えており、この動作設定レジスタに基づきホストインターフェースブロック7は動作する。
ホストインターフェースブロック7は、マイクロプロセッサ6による制御のもと、ホストコンピュータ4とデータ、アドレス情報、ステータス情報及び外部コマンド情報の授受を行なう機能ブロックである。
すなわち、フラッシュメモリシステム1がホストコンピュータ4に装着されると、フラッシュメモリシステム1とホストコンピュータ4とは、外部バス13を介して相互に接続され、かかる状態において、ホストコンピュータ4よりフラッシュメモリシステム1に供給されるデータ等は、ホストインタ―フェースブロック7を入口としてコントローラ3の内部に取り込まれ、フラッシュメモリシステム1からホストコンピュータ4に供給されるデータ等は、ホストインターフェースブロック7を出口としてホストコンピュータ4に供給される。
さらに、ホストインターフェースブロック7は、ホストコンピュータ4より供給されるホストアドレス及び外部コマンドを一時的に格納するタスクファイルレジスタ(図示せず)及びエラーが発生した場合にセットされるエラーレジスタ(図示せず)等を有している。
ワークエリア8は、フラッシュメモリ2の制御に必要なデータが一時的に格納される作業領域であり、複数のSRAMセルによって構成される機能ブロックである。
バッファ9は、フラッシュメモリ2から読み出されたデータ及びフラッシュメモリ2に書き込むべきデータを一時的に蓄積する機能ブロックである。すなわち、フラッシュメモリ2から読み出された
データは、ホストコンピュータ4が受け取り可能な状態となるまでバッファ9に保持され、フラッシュメモリ2に書き込むべきデータは、フラッシュメモリ2が書き込み可能な状態となるまでバッファ9に保持される。
ここで、バッファ9はFIFO(ファーストインファーストアウト)構造バッファを2個備えており(以下、一方のFIFO構造バッファをFIFO−A、他方をFIFO−Bと言う。)、これらのFIFO構造バッファを交互に使用することにより、フラッシュメモリ2へのデータ書込み、又はフラッシュメモリ2からのデータ読出しに要する時間を短縮している。
例えば、フラッシュメモリ2へのデータ書込む場合、ホストコンピュータ4から送られてくるデータはホストインターフェースブロック7を介して、FIFO−AとFIFO−Bに順次取込まれる。
ここでは、先にエンプティ(以下、FIFO構造バッファが空の状態をエンプティと言う。)になった方のFIFO構造バッファに優先的にデータが取り込まれる。一方、FIFO−AとFIFO−Bに取込まれたデータは、フラッシュメモリインターフェースブロック10を介して、順次フラッシュメモリ2に送られる。ここでは、先にフル(以下、FIFO構造バッファに容量一杯までデータが取込まれている状態をフルと言う。)なった方のFIFO構造バッファのデータが優先的にフラッシュメモリ2に送られる。
又、FIFO構造バッファがフルになるまでデータを取込んだときに、その状態を示すフラグレジスタ(図示せず)にフルフラグがセットされる。又、FIFO構造バッファに取込まれているデータを全て送出し、FIFO構造バッファがエンプティになったときに、フラグレジスタ(図示せず)にエンプティフラグがセットされる。
フラッシュメモリインターフェースブロック10は、内部バス14を介して、フラッシュメモリ2とデータ、アドレス情報、ステータス情報及び内部コマンド情報の授受を行う機能ブロックである。ここで、「内部コマンド」とは、コントローラ3からフラッシュメモリ2に与えられるコマンドであり、ホストコンピュータ4からフラッシュメモリシステム1に与えられるコマンドである「外部コマンド」と区別される。
ECCブロック11は、フラッシュメモリ2に書き込むデ―タに付加すべきエラーコレクションコードを生成するとともに、読み出しデータに付加されたエラーコレクションコードに基づいて、読み出したデータに含まれる誤りを検出・訂正する機能ブロックである。
フラッシュシーケンサブロック12は、内部コマンドに基づくフラッシュメモリ2の動作を制御する機能ブロックである。フラッシュシーケンサブロック12は、複数のレジスタ(図示せず)を備え、この複数のレジスタに内部コマンドを実行する際に必要な情報が、マイクロプロセッサ6による制御のもとに設定される。この複数のレジスタに内部コマンドを実行する際に必要な情報が設定されると、フラッシュシーケンサブロック12は、その情報に基づいて内部コマンドを実行する。
[メモリセルの説明]
次に、図2及び3参照して図1に示したフラッシュメモリ2を構成するメモリセル16の具体的な構造について説明する。
図2は、フラッシュメモリ2を構成するメモリセル16の構造を概略的に示す断面図である。同図に示したように、メモリセル16は、P型半導体基板17に形成されたN型のソース拡散領域18及びドレイン拡散領域19と、ソース拡散領域18とドレイン拡散領域19との間のP型半導体基板17を覆って形成されたトンネル酸化膜20と、トンネル酸化膜20上に形成されたフローティングゲ―ト電極21と、フローティングゲート電極21上に形成された絶縁膜22と、絶縁膜22上に形成されたコントロールゲ―ト電極23とから構成される。このような構成を有するメモリセル16が、メモリセルアレイ7内で複数個直列に接続されている。
メモリセル16は、フローティングゲート電極21に電子が注入されているか否かによって、「消去状態(電子が蓄積されていない状態)」と「書込状態(電子が蓄積されている状態)」のいずれかの状態が示される。ここで、1つのメモリセル16は1ビットのデータに対応し、メモリセル16の「消去状態」が論理値の「1」のデータに対応し、メモリセル16の「書込状態」が論理値の「0」のデータに対応する。
「消去状態」においては、フローティングゲート電極21に電子が蓄積されていないため、コントロールゲート電極23に読み出し電圧が印加されていないときには、ソース拡散領域18とドレイン拡散領域19との間のP型半導体基板17の表面にチャネルが形成されず、ソース拡散領域18とドレイン拡散領域19は電気的に絶縁される。一方、コントロールゲート電極23に読み出し電圧が印加されると、ソース拡散領域18とドレイン拡散領域19との間のP型半導体基板17の表面にチャネル(図示せず)が形成され、ソース拡散領域18とドレイン拡散領域19は、このチャネルによって電気的に接続される。
すなわち、「消去状態」においてはコントロールゲート電極23に読み出し電圧が印加されていない状態では、ソース拡散領域18とドレイン拡散領域19とは電気的に絶縁され、コントロールゲート電極23に読み出し電圧が印加された状態では、ソース拡散領域18とドレイン拡散領域19とは電気的に接続される。
図3は、「書込状態」であるメモリセル16を概略的に示す断面図である。同図に示したように、「書込状態」とは、フローティングゲート電極21に電子が蓄積されている状態を指す。フローティングゲート電極21はトンネル酸化膜20及び絶縁膜22に挟まれているため、一旦、フローティングゲート電極21に注入された電子は、きわめて長時間フローティングゲート電極21内にとどまる。この「書込状態」においては、フローティングゲート電極21に電子が蓄積されているので、コントロールゲート電極23に読み出し電圧が印加されているか否かに関わらず、ソース拡散領域18とドレイン拡散領域19との間のP型半導体基板17の表面にはチャネル24が形成される。したがって、「書込状態」においてはソース拡散領域18とドレイン拡散領域19とは、コントロ―ルゲート電極23に読み出し電圧が印加されているか否かに関わらず、チャネル24によって常に電気的に接続状態となる。
又、上記メモリセル16が消去状態であるか書込状態であるかは、次のようにして読み出すことができる。メモリセル16はメモリセルアレイ7内で複数個直列に接続されている。この直列体の中で選択するメモリセル16に低レベル電圧を印加し、それ以外のメモリセル16のコントロールゲート電極23に高レベル電圧が印加する。この状態でメモリセル16の直列体が導通状態であるか否かの検出が行われる。その結果、この直列体が導通状態でれば、選択されたメモリセル16は書込状態であると判断され、絶縁状態であれば、選択されたフラッシュメモリセル16は消去状態であると判断される。このようにして、直列体に含まれる任意のメモリセル16に保持されたデータが「0」であるのか「1」であるのかを読み出すことができる。
又、消去状態であるメモリセル16を書込状態に変化させる場合は、コントロールゲート電極23が高電位側となる高電圧が印加し、トンネル酸化膜20を介してフローティングゲート電極21へ電子を注入する。この際、FN(ファウラ―ノルトハイム)トンネル電流が流れフロ―ティングゲート電極21に電子が注入される。一方、書込状態であるフラッシュメモリセル16を消去状態に変化させる場合は、コントロールゲート電極23が低電位側となる高電圧が印加し、トンネル酸化膜20を介してフローティングゲート電極21に蓄積された電子を排出する。
[フラッシュメモリのメモリ構造の説明]
次に、フラッシュメモリ2のメモリ構造を説明する。図4は、フラッシュメモリ2のメモリ構造を概略的に示す図である。図4に示したように、フラッシュメモリ2はデータの読み出し及び書き込みにおけるアクセス単位である「ページ」と、データの消去単位である「ブロック」で構成されている。
上記「ページ」は512バイトのユーザ領域25と16バイトの冗長領域26によって構成される。ユーザ領域25は、ホストコンピュータ4より供給されるユーザデ―タが格納される領域であり、冗長領域26は、ECCブロック11によって生成されたエラーコレクションコード等の付加情報が格納される領域である。エラ―コレクションコードは、対応するユーザ領域25に格納されたデータに含まれる誤りを訂正するための付加情報であり、ユーザ領域25に格納されたデータに含まれる誤りが所定数以下であれば、これを訂正し、正しいデータとするために用いられる。
上記冗長領域26には、エラーコレクションコードの他に、「消去フラグ」と「対応論理ブロックアドレス」が格納されている。「消去フラグ」は、そのブロックが消去済みブロックであるか否かを示すフラグであり、「対応論理ブロックアドレス」は、そのブロックにデータが格納されている場合に、そのブロックがどの論理ブロックアドレスに対応するかを示している。尚、「消去フラグ」を設けずに、「対応論理ブロックアドレス」が格納されているか否かで、そのブロックが消去済みブロックであるか否かを判断(「対応論理ブロックアドレス」が格納されていない場合は消去済みブロックであると判断する。)する場合もある。
又、上記「ブロック」は32枚の「ページ」で構成されている。ここでフラッシュメモリはデータの上書きができないため、1枚の「ページ」のデータだけを書き変える場合であっても、その「ページ」が含まれる「ブロック」の32枚の「ページ」の全データを、全ての「ページ」のデータが消去されている「ブロック」に再度書込まなければならない。
ここで、特定の「ページ」をアクセスする場合、ホストアドレスのうち、下位5ビット(「ブロック」が32枚の「ページ」で構成されている場合)をページアドレス、残りの上位ビットをブロックアドレスとすれば、ブロックアドレスは「ブロック」を特定するために用いられ、ページアドレスは特定された「ブロック」に含まれる「ページ」(ページ0〜ページ31)を特定するために用いられる。
[論理ブロックアドレスと物理ブロックアドレスの説明]
上述のとおり、フラッシュメモリはデータの上書きができないため、既にデータの書き込まれた「ページ」に対し、これと異なる新しいデータを書き込むためには、一旦、既に書き込まれているデータを消去した後に新しいデータを書き込むという処理が必要となる。この際、消去はブロック単位で処理されるため、新しいデータを書き込む「ページ」のデータを消去しようとすると、その「ページ」が含まれる「ブロック」の全ての「ページ」のデータが消去されてしまう。したがって、ある「ページ」に既に書き込まれているデータを書替える場合、書替える「ページ」が含まれる「ブロック」の他の全ページのデータについても、書替える「ページ」のデータを書込む他の消去済ブロックに移動させるという処理が必要となる。
上記のようにデータを書替える場合、書替えの後のデータは書替え前の「ブロック」と異なる「ブロック」に書込まれるため、ホストアドレスに基づくブロックアドレス(以下、ホストアドレスに基づくブロックアドレスを論理ブロックアドレスと言う。)と、この論理ブロックアドレスに対応するフラッシュメモリ2内でのブロックアドレス(以下、フラッシュメモリ2内でのブロックアドレスを物理ブロックアドレスと言う。)との対応関係は、データを書替える毎に動的に変化する。このため、論理ブロックアドレスと物理ブロックアドレスの対応関係が書込まれたアドレス変換テーブルが必要となる。
上記「アドレス変換テーブル」は、「論理ブロックアドレス」と「物理ブロックアドレス」の対応関係を示したテーブルであり、図1に示したワークエリア8に格納されている。そして、この「アドレス変換テーブル」は、上述のような理由により、フラッシュメモリ2に書込まれているデータが書替えられる毎に、その書替えに関わった部分の対応関係が更新される。
[書き込みキューの説明]
図5は、図1に示したワークエリア8に格納されている書き込みキュー28のデータ構造を示す概略図である。
図5に示したように、書き込みキュー28は、キュー0〜キュー7からなる8つのキューによって構成されており、各キューには物理ブロックアドレスが格納されている。ここで、各キューには、それぞれ消去済みブロックの物理ブロックアドレスが格納される。したがって、書き込みキュー28は、最大8つの消去済みブロックの物理ブロックアドレスを保持することができる。この書き込みキュー28は、図4に示した冗長領域26に格納されている「消去フラグ」又は「対応論理ブロックアドレス」を参照して消去済みブロック検出し、検出したブロックの物理ブロックアドレスをキュー0〜キュー7に格納する。
[初期設定動作]
図1に示したフラッシュメモリシステム1の初期設定動作について説明する。この初期設定動作は、フラッシュメモリシステム1がホストコンピュータ4に装着された時や、ホストコンピュータ4によりリセットが指示された際に実行される。
この初期設定動作では、マイクロプロセッサ6による制御のもと、アドレス変換テーブルや図5に示した書き込みキュー28の作成が開始され、その作成が完了すると初期設定動作は終了する。
尚、フラッシュメモリシステム1の初期設定動作が行われている間は、コントローラ3はビジー状態となり、ホストコンピュータ4からのデータの読み出しや書き込みの指示は拒否される。かかるビジー状態は、フラッシュメモリシステム1の初期設定動作が終了すると解除される。
[本発明に係る処理の説明]
以下、本発明に係る処理のフローチャートを示す図6を参照しながら、その処理について説明する。
下記の処理では、ホストコンピュータ4からのデータの書込み指示に従って、複数のページにデータの書込む処理の途中に、ブロック間転送の処理を割り込ませる場合の処理の流れについて説明する。ここで、ブロック間転送とは、特定のブロックのページに書込まれているデータを、他の消去済みブロックの対応するページに複写する処理である。この処理では、特定のブロックのページに書込まれているデータを、一旦FIFO構造バッファ(FIFO−A又はFIFO−B)に読出し、読み出したデータを、他の消去済みブロックの対応するページに書込んでいる。
尚、図6に示すフローチャートの開始時点では、ホストインターフェース制御ブロック5が備える動作設定レジスタには、FIFO−AとFIFO−Bに順次(先にエンプティになったFIFO構造バッファが優先される。以下、この順番をFO順と言う。)データを取込む動作モード(以下、FIFO−AとFIFO−BにFO順でデータを取込む動作モードを2バッファモードと言う。)が設定されている。一方、マイクロプロセッサ6による制御のもと、フラッシュシーケンサブロック12が有するレジスタ(図示せず)に対して後述する書込み用シーケンサが順次設定され、この設定に基づきFIFO−AとFIFO−Bに取込まれているデータが順次(先にフルになったFIFO構造バッファが優先される。以下、この順番をFI順と言う。)フラッシュメモリ2に書込まれている。
ステップ1:
現在実行している処理(フラッシュメモリ2に対するデータ書込み処理)の終了後に、フラッシュシーケンサブロック12が有するレジスタ(図示せず)に対して、新たな設定を行なわない。従って、現在実行している処理の終了後に新たな内部コマンドは実行されない。
ステップ2:
現在実行している処理の終了後に、FIFO−A及びFIFO−Bがフルになるのを待ち、つまりフルフラグが設定されるのを待ち、フルフラグが設定された後にステップ3に進む。ここで、ホストインターフェースブロック7は2バッファモードで動作しているので、ホストコンピュータ4から送られてくるデータは、FO順でFIFO−AとFIFO−Bに取込まれる。従って、現在実行している処理の終了後に、FIFO−A及びFIFO−Bがフルになり、バッファ9のフラグレジスタ(図示せず)にフルフラグがセットされる。
ステップ3:
ホストインターフェース制御ブロック5が備える動作設定レジスタに、FIFO−A及びFIFO−Bにデータを取込む処理を停止する動作モード(以下、FIFO−A及びFIFO−Bにデータを取込む処理を停止する動作モードを停止モードと言う。)が設定される。
ステップ4:
マイクロプロセッサ6による制御のもと、フラッシュシーケンサブロック12が有するレジスタ(図示せず)に対して以下のような書込み用シーケンサが設定される。
1)内部コマンドとして内部書込みコマンドがフラッシュシーケンサブロック12内の所定のレジスタ(図示せず)に設定される。
2)書込み先のページに対応する物理アドレスと、書込むページ数がフラッシュシ―ケンサブロック12内の所定のレジスタ(図示せず)に設定される。ここで、書込み先のページに対応する物理アドレスは、図5に示した書き込みキュー28から読み出した消去済みブロックの物理ブロックアドレスに、論理アドレスのページアドレス部分を付加して生成する。又、フラッシュメモリ2に書込むデータは、FIFO−A及びFIFO−Bに既に取込まれているデータなので、ページ数は2が設定される。
次に、フラッシュシーケンサブロック12が、上記書込み用シーケンサの設定に基づいて内部コマンドを実行する。この内部コマンドを実行すると、フラッシュメモリインターフェースブロック10から、内部バス14を介してフラッシュメモリ2に内部コマンドを実行するための情報が供給される。その結果、FIFO−A及びFIFO−Bに取込まれていたデータがFI順でフラッシュメモリ2に書込まれる。尚、書込み先の物理アドレスは、書込むページ数に応じて、自動的にインクリメント(ページ分の加算処理)されるので、先に書込まれるデータの書込み先物理アドレスをA0とすれば、後から書込まれるデータの書込み先物理アドレスはA0+1になる。ページ数が3以上の場合も同様に処理される。
ステップ5:
FIFO−A及びFIFO−Bがエンプティになるのを待ち、つまりエンプティフラグが設定されるのを待ち、エンプティフラグが設定された後にステップ6に進む。ここで、ホストインターフェースブロック7は停止モードになっているので、FIFO−AとFIFO−Bに新たなデータは取込まれない。従って、現在実行している処理の終了後に、FIFO−A及びFIFO−Bはエンプティになり、バッファ9のフラグレジスタ(図示せず)にエンプティフラグがセットされる。尚、ステップ4で、処理が完了したときにFIFO−A及びFIFO−Bがエンプティになるように書込み用シーケンサを設定して、処理の終了後にステップ6に進んでもよい。ここで、データ書込み処理が終了するとフラッシュシーケンサブロック12が有するレジスタ(図示せず)に、処理が終了したことを示すフラグが設定される。従って、このフラグによりデータ書込み処理が終了したことを検知することができる。
ステップ6:
フラッシュシーケンサブロック12が有するレジスタ(図示せず)に対して、新たな書込み用シーケンサの設定を行なわない。従って、ステップ4の書込み処理終了後は、新たな内部書込みコマンドは実行されない。
ステップ7:
マイクロプロセッサ6による制御のもと、フラッシュシーケンサブロック12が有するレジスタ(図示せず)に対して以下のような転送用シーケンサが設定される。
1)内部コマンドとして内部転送コマンドがフラッシュシーケンサブロック12内の所定のレジスタ(図示せず)に設定される。
2)転送元及び転送先の物理アドレスと、転送するページ数がフラッシュシ―ケンサブロック12内の所定のレジスタ(図示せず)に設定される。ここで、転送先の物理アドレスは、図5に示した書き込みキュー28から読み出した消去済みブロックの物理ブロックアドレスに、転送元の物理アドレスのページアドレス部分を付加して生成する。又、ブロック間転送に使用するFIFO構造バッファとしてFIFO−Bを選択する。ここで、ブロック間転送に使用するFIFO構造バッファは特に限定されない。
次に、フラッシュシーケンサブロック12が、上記書込み用シーケンサの設定に基づいて内部コマンドを実行する。この内部コマンドを実行すると、フラッシュメモリインターフェースブロック10から、内部バス14を介してフラッシュメモリ2に内部コマンドを実行するための情報が供給される。その結果、転送元のページに書込まれているデータがFIFO−Bに取込まれ、続いてFIFO−Bに取込まれたデータが転送先のページに書込まれる。
尚、転送元及び転送先の物理アドレスは、転送するページ数に応じて、自動的にインクリメント(ページ分の加算処理)されるので、最初に転送される転送元の物理アドレスをA1、転送先の物理アドレスをA2とすれば、2番目に転送される転送元の物理アドレスはA1+1、転送先の物理アドレスはA2+1になる。ページ数が3以上の場合も同様に処理される。
ステップ8:
ステップ7のブロック間転送処理を開始した後に、ホストインターフェース制御ブロック5が備える動作設定レジスタに、FIFO−Aだけにデータを取込む動作モード(以下、FIFO−Aだけにデータを取込む動作モードを1バッファモードと言う。)が設定される。その結果、ホストインターフェースブロック7の動作モードは停止モードから1バッファモードに切替わり、ホストコンピュータ4から送られてくるデータは、FIFO−Aに取込まれるようになる。尚、この1バッファモードへの切替えはステップ7のブロック間転送処理を開始する前に行なってもよい。
ステップ9:
ステップ7の転送処理が終了するのを待ち、転送処理の終了後に、ステップ10に進む。ここで、転送処理が終了するとフラッシュシーケンサブロック12が有するレジスタ(図示せず)に、処理が終了したことを示すフラグが設定される。従って、このフラグにより転送処理が終了したことを検知することができる。
ステップ10:
ホストインターフェース制御ブロック5が備える動作設定レジスタに、2バッファモードが設定される。その結果、ホストインターフェースブロック7の動作モードは1バッファモードから2バッファモードに切替わり、ホストコンピュータ4から送られてくるデータは、FIFO−AとFIFO−BにFO順で取込まれるようになる。
ステップ11:
マイクロプロセッサ6による制御のもと、フラッシュシーケンサブロック12が有するレジスタ(図示せず)に対して以下のような書込み用シーケンサが設定される。
1)内部コマンドとして内部書込みコマンドがフラッシュシーケンサブロック12内の所定のレジスタ(図示せず)に設定される。
2)書込み先のページに対応する物理アドレスと、書込むページ数がフラッシュシ―ケンサブロック12内の所定のレジスタ(図示せず)に設定される。ここで、書込み先のページに対応する物理アドレスは、図5に示した書き込みキュー28から読み出した消去済みブロックの物理ブロックアドレスに、論理アドレスのページアドレス部分を付加して生成する。
次に、フラッシュシーケンサブロック12が、上記書込み用シーケンサの設定に基づいて内部コマンドを実行する。この内部コマンドを実行すると、フラッシュメモリインターフェースブロック10から、内部バス14を介してフラッシュメモリ2に内部コマンドを実行するための情報が供給される。その結果、FIFO−A及びFIFO−Bに取込まれたデータが、書込むページ数に応じてFI順でフラッシュメモリ2に書込まれる。尚、書込み先の物理アドレスは、上述のように書込むページ数に応じて、自動的にインクリメント(ページ分の加算処理)される。
尚、以上の説明では、バッファ9がFIFO構造バッファを2個備えている場合について述べたが、3以上のバッファを備えている場合でも同様に実施するすることができる。例えば、n個のFIFO構造バッファを備えている場合は、ステップ7のときにホストインターフェースブロック7は、n−1個のFIFO構造バッファにデータを取込む動作モードになり、つまり、ブロック間転送処理に使用しないFIFO構造バッファにだけデータを取込む動作モードになり、ブロック間転送処理を行なわないとき(上記で2バッファモードのとき)は、n個のFIFO構造バッファにデータを取込む動作モードになる。又、n個のFIFO構造バッファを備えている場合であっても、FO順でFIFO構造バッファにデータが取込まれ、FI順でFIFO構造バッファのデータが送出される。
【発明の効果】
以上説明したように、本発明によれば、ブロック間転送処理やデータの書込み処理の効率の低下を抑えつつ、データの書込み処理の途中にブロック間転送処理を割込ませることができる。
【図面の簡単な説明】
【図1】図1は、本発明に係るフラッシュメモリシステム1を概略的に示すブロック図である。
【図2】図2は、フラッシュメモリ2を構成するメモリセル16の構造を概略的に示す断面図である。
【図3】図3は、書込状態であるメモリセル16を概略的に示す断面図である。
【図4】図4は、フラッシュメモリ2のアドレス空間の構造を概略的に示す図である。
【図5】図5は、ワークエリア8に格納される書き込みキュー28のデータ構造を示す概略図である。
【図6】図6は、本発明に係るフラッシュメモリシステム1の動作を示すフロ―チャートである。
【符号の説明】
1 フラッシュメモリシステム
2 フラッシュメモリ
3 コントローラ
4 ホストコンピュータ
5 ホストインターフェース制御ブロック
6 マイクロプロセッサ
7 ホストインターフェースブロック
8 ワークエリア
9 バッファ
10 フラッシュメモリインターフェースブロック
11 ECCブロック
12 フラッシュシーケンサブロック
13 外部バス
14 内部バス
16 メモリセル
17 P型半導体基板
18 ソース拡散領域
19 ドレイン拡散領域
20 トンネル酸化膜
21 フローティングゲート電極
22 絶縁膜
23 コントロールゲート電極
24 チャネル
25 ユーザ領域
26 冗長領域
28 書き込みキュー
[Industrial application fields]
The present invention relates to a memory controller, a flash memory system including the memory controller, and a flash memory control method.
[Prior art]
In recent years, flash memories are often used as semiconductor memories used in flash memory systems such as memory cards and silicon disks. This flash memory is a kind of non-volatile memory, and is required to retain data regardless of whether power is turned on.
By the way, a NAND flash memory that is often used in the above-described device is a memory cell when a memory cell is changed from an erased state (logic value = 1) to a written state (logic value = 0). However, when the memory cell is changed from the written state (0) to the erased state (1), it cannot be performed in units of the memory cell, and a predetermined erase unit composed of a plurality of memory cells. This can only be done in (block). Such a batch erase operation is generally called “block erase”.
Due to the above characteristics, in a device using a NAND flash memory, when data is written, a block erased area is searched and new data is written in the detected empty area. . In addition, since the block which is an erasure unit is composed of a plurality of pages (for example, 32 pages), even when only the data of one page is rewritten, other blocks including the page are included. All the data of the page must be written again in the area where the block is erased. Therefore, in an apparatus using a NAND flash memory, an inter-block transfer process in which data of a block in which data is written is rewritten to another block frequently occurs.
[Problems to be solved by the invention]
The above block transfer process and the data write process in response to an instruction from the host computer to which the flash memory system is installed are more efficient when processed separately, but the power is unexpectedly cut off, etc. In consideration of this, there is a case where the inter-block transfer process must be interrupted during the data write process in accordance with an instruction from the host computer.
Accordingly, the present invention provides a memory controller capable of interrupting inter-block transfer processing in the middle of data write processing while suppressing a decrease in efficiency of inter-block transfer processing and data write processing, and a flash memory including the memory controller It is an object of the present invention to provide a system and a flash memory control method.
[Means for Solving the Problems]
An object of the present invention is to provide a plurality of buffers for holding data to be written to the flash memory or data to be read from the flash memory,
A first detection function for detecting a full or empty state of the buffer;
A second detection function for detecting a request for inter-block transfer processing,
When a request for inter-block transfer processing is detected by the second detection function,
Stop the writing process from the buffer to the flash memory,
Furthermore, when it is detected by the first detection function that the buffers are all full,
While stopping the process of taking the data to be written into the flash memory into the buffer,
Start the writing process from the buffer to the flash memory,
Furthermore, when it is detected by the first detection function that all the buffers are in an empty state,
While performing an inter-block transfer process using the buffer,
It is achieved by a flash memory system comprising a memory controller and a memory controller configured to start a process of fetching data to be written to a flash memory in the buffer that is not used in the inter-block transfer process .
And a third detection function for detecting the end of the inter-block transfer process.
When the end of inter-block transfer processing is detected by the third detection function,
While starting the process of taking data to be written to the flash memory into the buffer used in the inter-block transfer process,
By being configured to start the writing process from the buffer to the flash memory, it is possible to obtain a better effect (suppression of a decrease in processing efficiency).
The purpose of the present invention is to detect a request for interblock transfer processing.
Stop writing to the flash memory from a plurality of buffers holding data to be written to the flash memory or data to be read from the flash memory,
Furthermore, when it is detected that all the buffers are full,
While stopping the process of taking the data to be written into the flash memory into the buffer,
Start the writing process from the buffer to the flash memory,
Furthermore, when it is detected that all the buffers are empty,
While performing an inter-block transfer process using the buffer,
This is achieved by a flash memory control method which starts a process of fetching data to be written into the flash memory into the buffer which is not used in the inter-block transfer process.
Furthermore, when the end of the inter-block transfer process is detected,
While starting the process of taking data to be written to the flash memory into the buffer used in the inter-block transfer process,
By starting the writing process from the buffer to the flash memory, it is possible to obtain a better effect (suppression of a decrease in processing efficiency).
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[Description of flash memory system 1]
FIG. 1 is a block diagram schematically showing a flash memory system 1 according to the present invention. This flash memory system 1 is generally stored in a PC card, a compact flash (registered trademark of SanDisk Corporation), or the like. Yes. As shown in the figure, the flash memory system 1 includes a flash memory 2 and a controller 3.
The PC card conforms to the PCMCIA (Personal Computer Memory Card Association) standard, and the compact flash conforms to the CFA (Compact Flash Association) standard. The present invention also includes "SmartMedia (registered trademark of Toshiba Corporation)" of SSFDC Forum, "MMC (MultiMedia Card)" proposed by MultiMedia Card Association, and "Memory Stick (trademark of Sony Corporation)" proposed by Sony Corporation. It is also possible to apply the present invention to "
The PC card or compact flash in which the flash memory system 1 is housed is normally used by being detachably attached to the host computer 4 and used as a kind of external storage device for the host computer 4 as a pair. Examples of the host computer 4 include various information processing apparatuses such as a personal computer and a digital still camera that process various information such as characters, sounds, and image information.
The flash memory 2 shown in FIG. 1 is a device that executes reading or writing in units of pages and erasing in units of blocks. For example, one block consists of 32 pages, and one page consists of a 512-byte user area and 16 pages. Each page is composed of 512 bytes when viewed from the host computer 4 side.
[Description of controller 3]
1 includes a host interface control block 5, a microprocessor 6, a host interface block 7, a work area 8, a buffer 9, a flash memory interface block 10, and an ECC (error collection code) block. 11 and a flash sequencer block 12. The controller 3 constituted by these functional blocks is integrated on one semiconductor chip. The function of each block will be described below.
The microprocessor 6 is a functional block that controls the operation of the entire functional blocks constituting the controller 3.
The host interface control block 5 is a functional block that controls the operation of the host interface block 7. Here, the host interface control block 5 includes an operation setting register (not shown) for setting the operation of the host interface block 7, and the host interface block 7 operates based on the operation setting register.
The host interface block 7 is a functional block that exchanges data, address information, status information, and external command information with the host computer 4 under the control of the microprocessor 6.
In other words, when the flash memory system 1 is mounted on the host computer 4, the flash memory system 1 and the host computer 4 are connected to each other via the external bus 13. Data supplied to the host computer is taken into the controller 3 through the host interface block 7 as an entrance, and data etc. supplied from the flash memory system 1 to the host computer 4 through the host interface block 7 as an exit 4 is supplied.
The host interface block 7 further includes a task file register (not shown) for temporarily storing a host address and an external command supplied from the host computer 4 and an error register (not shown) set when an error occurs. ) Etc.
The work area 8 is a work area in which data necessary for controlling the flash memory 2 is temporarily stored, and is a functional block including a plurality of SRAM cells.
The buffer 9 is a functional block that temporarily accumulates data read from the flash memory 2 and data to be written to the flash memory 2. That is, read from the flash memory 2
Data is held in the buffer 9 until the host computer 4 can receive data, and data to be written to the flash memory 2 is held in the buffer 9 until the flash memory 2 becomes writable.
Here, the buffer 9 includes two FIFO (first-in first-out) structure buffers (hereinafter, one FIFO structure buffer is referred to as FIFO-A, and the other is referred to as FIFO-B). By using them alternately, the time required for writing data to the flash memory 2 or reading data from the flash memory 2 is shortened.
For example, when data is written to the flash memory 2, data sent from the host computer 4 is sequentially taken into the FIFO-A and FIFO-B via the host interface block 7.
Here, data is preferentially taken into the FIFO structure buffer that has become empty first (hereinafter, the empty FIFO structure buffer is called empty). On the other hand, the data taken into the FIFO-A and FIFO-B is sequentially sent to the flash memory 2 via the flash memory interface block 10. Here, the data in the FIFO structure buffer that has been full first (hereinafter, the state in which the FIFO structure buffer is fully loaded with data) is preferentially sent to the flash memory 2.
When data is fetched until the FIFO structure buffer becomes full, a full flag is set in a flag register (not shown) indicating the state. Also, when all the data fetched in the FIFO structure buffer is sent and the FIFO structure buffer becomes empty, an empty flag is set in a flag register (not shown).
The flash memory interface block 10 is a functional block that exchanges data, address information, status information, and internal command information with the flash memory 2 via the internal bus 14. Here, the “internal command” is a command given from the controller 3 to the flash memory 2 and is distinguished from an “external command” which is a command given from the host computer 4 to the flash memory system 1.
The ECC block 11 generates an error correction code to be added to data to be written in the flash memory 2, and detects and corrects an error included in the read data based on the error correction code added to the read data. It is a functional block.
The flash sequencer block 12 is a functional block that controls the operation of the flash memory 2 based on an internal command. The flash sequencer block 12 includes a plurality of registers (not shown), and information necessary for executing internal commands in the plurality of registers is set under the control of the microprocessor 6. When information necessary for executing the internal command is set in the plurality of registers, the flash sequencer block 12 executes the internal command based on the information.
[Description of memory cell]
Next, a specific structure of the memory cell 16 constituting the flash memory 2 shown in FIG. 1 will be described with reference to FIGS.
FIG. 2 is a cross-sectional view schematically showing the structure of the memory cell 16 constituting the flash memory 2. As shown in the figure, the memory cell 16 includes an N-type source diffusion region 18 and a drain diffusion region 19 formed in the P-type semiconductor substrate 17, and a P between the source diffusion region 18 and the drain diffusion region 19. Tunnel oxide film 20 formed to cover type semiconductor substrate 17, floating gate electrode 21 formed on tunnel oxide film 20, insulating film 22 formed on floating gate electrode 21, and insulating film 22 The control gate electrode 23 is formed on the top. A plurality of memory cells 16 having such a configuration are connected in series within the memory cell array 7.
The memory cell 16 has either an “erased state (a state where no electrons are accumulated)” or a “written state (a state where electrons are accumulated)” depending on whether electrons are injected into the floating gate electrode 21 or not. Is shown. Here, one memory cell 16 corresponds to 1-bit data, the “erased state” of the memory cell 16 corresponds to data of “1” of the logical value, and the “written state” of the memory cell 16 corresponds to the logical value. Corresponds to “0” data.
In the “erased state”, since electrons are not accumulated in the floating gate electrode 21, the P-type semiconductor between the source diffusion region 18 and the drain diffusion region 19 when the read voltage is not applied to the control gate electrode 23. A channel is not formed on the surface of the substrate 17, and the source diffusion region 18 and the drain diffusion region 19 are electrically insulated. On the other hand, when a read voltage is applied to the control gate electrode 23, a channel (not shown) is formed on the surface of the P-type semiconductor substrate 17 between the source diffusion region 18 and the drain diffusion region 19. And the drain diffusion region 19 are electrically connected by this channel.
That is, in the “erased state”, when no read voltage is applied to the control gate electrode 23, the source diffusion region 18 and the drain diffusion region 19 are electrically insulated, and the read voltage is applied to the control gate electrode 23. In this state, the source diffusion region 18 and the drain diffusion region 19 are electrically connected.
FIG. 3 is a cross-sectional view schematically showing the memory cell 16 in the “written state”. As shown in the figure, the “written state” refers to a state in which electrons are accumulated in the floating gate electrode 21. Since the floating gate electrode 21 is sandwiched between the tunnel oxide film 20 and the insulating film 22, the electrons once injected into the floating gate electrode 21 stay in the floating gate electrode 21 for a very long time. In this “write state”, since electrons are accumulated in the floating gate electrode 21, the source diffusion region 18, the drain diffusion region 19, and the like regardless of whether or not the read voltage is applied to the control gate electrode 23. A channel 24 is formed on the surface of the P-type semiconductor substrate 17 therebetween. Therefore, in the “write state”, the source diffusion region 18 and the drain diffusion region 19 are always electrically connected by the channel 24 regardless of whether or not the read voltage is applied to the control gate electrode 23. Become.
Whether the memory cell 16 is in an erased state or a written state can be read as follows. A plurality of memory cells 16 are connected in series in the memory cell array 7. A low level voltage is applied to the memory cell 16 selected in the series body, and a high level voltage is applied to the control gate electrode 23 of the other memory cells 16. In this state, it is detected whether or not the serial body of the memory cells 16 is in a conductive state. As a result, if this serial body is in a conductive state, it is determined that the selected memory cell 16 is in a written state, and if it is in an isolated state, it is determined that the selected flash memory cell 16 is in an erased state. The In this way, it is possible to read out whether the data held in any memory cell 16 included in the serial body is “0” or “1”.
When the memory cell 16 in the erased state is changed to the written state, a high voltage is applied so that the control gate electrode 23 is on the high potential side, and electrons are injected into the floating gate electrode 21 through the tunnel oxide film 20. To do. At this time, an FN (Fowler-Nordheim) tunnel current flows and electrons are injected into the floating gate electrode 21. On the other hand, when the flash memory cell 16 in the written state is changed to the erased state, a high voltage that causes the control gate electrode 23 to be on the low potential side is applied and accumulated in the floating gate electrode 21 via the tunnel oxide film 20. Discharge electrons.
[Description of flash memory structure]
Next, the memory structure of the flash memory 2 will be described. FIG. 4 is a diagram schematically showing the memory structure of the flash memory 2. As shown in FIG. 4, the flash memory 2 includes “pages” that are access units for reading and writing data and “blocks” that are data erasing units.
The “page” is composed of a 512-byte user area 25 and a 16-byte redundant area 26. The user area 25 is an area for storing user data supplied from the host computer 4, and the redundant area 26 is an area for storing additional information such as an error correction code generated by the ECC block 11. The error collection code is additional information for correcting an error included in the data stored in the corresponding user area 25. If the error included in the data stored in the user area 25 is equal to or less than a predetermined number, It is used to correct this and obtain correct data.
In the redundant area 26, “erase flag” and “corresponding logical block address” are stored in addition to the error correction code. The “erase flag” is a flag indicating whether or not the block is an erased block. The “corresponding logical block address” is the logical block address of the block when data is stored in the block. It shows whether it corresponds to. Whether or not the “corresponding logical block address” is stored without providing the “erase flag” determines whether or not the block is an erased block (the “corresponding logical block address” is stored). If not, it is determined that the block is an erased block).
The “block” is composed of 32 “pages”. Here, since the flash memory cannot overwrite data, even when only the data of one “page” is rewritten, all the data of 32 “pages” of “block” including the “page” is written. Must be written again to the “block” where all the “page” data has been erased.
Here, when accessing a specific “page”, the lower 5 bits (when “block” is composed of 32 “pages”) of the host address, the page address, and the remaining higher bits are the block address Then, the block address is used to specify “block”, and the page address is used to specify “page” (page 0 to page 31) included in the specified “block”.
[Description of logical block address and physical block address]
As described above, since the flash memory cannot overwrite data, in order to write new data different from this to a “page” in which data has already been written, once the already written data is erased, a new data is written. A process of writing data is required. At this time, since the erasure is processed in units of blocks, when trying to erase the data of the “page” to which new data is written, all the “page” data of the “block” including the “page” is erased. End up. Therefore, when rewriting data that has already been written to a certain "page", the data for all the other pages of the "block" that contains the "page" to be rewritten is also written to the "page" to be rewritten. It is necessary to move to the erased block.
When rewriting data as described above, the data after rewriting is written in a “block” that is different from the “block” before rewriting. Therefore, the block address based on the host address (hereinafter, the block address based on the host address is logically expressed). And the block address in the flash memory 2 corresponding to the logical block address (hereinafter, the block address in the flash memory 2 is referred to as a physical block address). It changes dynamically every time it is rewritten. For this reason, an address conversion table in which the correspondence between the logical block address and the physical block address is written is required.
The “address conversion table” is a table showing the correspondence between “logical block address” and “physical block address”, and is stored in the work area 8 shown in FIG. In the “address conversion table”, for each of the reasons described above, each time the data written in the flash memory 2 is rewritten, the correspondence relationship of the portion related to the rewrite is updated.
[Description of write queue]
FIG. 5 is a schematic diagram showing a data structure of the write queue 28 stored in the work area 8 shown in FIG.
As shown in FIG. 5, the write queue 28 includes eight queues including queue 0 to queue 7, and physical block addresses are stored in each queue. Here, the physical block address of the erased block is stored in each queue. Therefore, the write queue 28 can hold physical block addresses of up to eight erased blocks. The write queue 28 detects an erased block with reference to the “erase flag” or “corresponding logical block address” stored in the redundant area 26 shown in FIG. 4, and stores the physical block address of the detected block in the queue 0. Store in queue 7
[Initial setting operation]
An initial setting operation of the flash memory system 1 shown in FIG. 1 will be described. This initial setting operation is executed when the flash memory system 1 is mounted on the host computer 4 or when a reset instruction is issued by the host computer 4.
In this initial setting operation, creation of the address conversion table and the write queue 28 shown in FIG. 5 is started under the control of the microprocessor 6, and when the creation is completed, the initial setting operation ends.
Note that while the initial setting operation of the flash memory system 1 is being performed, the controller 3 is in a busy state, and an instruction to read or write data from the host computer 4 is rejected. The busy state is canceled when the initial setting operation of the flash memory system 1 is completed.
[Description of processing according to the present invention]
Hereinafter, the process will be described with reference to FIG. 6 showing a flowchart of the process according to the present invention.
In the following processing, the flow of processing when interrupt processing between blocks is interrupted during the processing of writing data to a plurality of pages in accordance with the data writing instruction from the host computer 4 will be described. Here, inter-block transfer is a process of copying data written in a page of a specific block to a corresponding page of another erased block. In this process, data written in a page of a specific block is once read into a FIFO structure buffer (FIFO-A or FIFO-B), and the read data is written into a corresponding page in another erased block. It is crowded.
Note that, at the start of the flowchart shown in FIG. 6, the operation setting register included in the host interface control block 5 is given priority to FIFO-A and FIFO-B sequentially (FIFO structure buffer that is empty first). This order is referred to as FO order.) An operation mode for fetching data (hereinafter, an operation mode for fetching data in FIFO order in FIFO-A and FIFO-B is referred to as a 2-buffer mode) is set. On the other hand, under the control of the microprocessor 6, a write sequencer (to be described later) is sequentially set to a register (not shown) included in the flash sequencer block 12, and taken into FIFO-A and FIFO-B based on this setting. The data stored in the flash memory 2 is sequentially written (priority is given to the FIFO structure buffer that has become full first. This order is hereinafter referred to as FI order).
Step 1:
After completion of the currently executed process (data writing process to the flash memory 2), no new setting is performed for a register (not shown) included in the flash sequencer block 12. Accordingly, a new internal command is not executed after the currently executed process is completed.
Step 2:
After completion of the currently executed process, the process waits for FIFO-A and FIFO-B to become full, that is, waits for the full flag to be set, and proceeds to step 3 after the full flag is set. Here, since the host interface block 7 operates in the 2-buffer mode, data sent from the host computer 4 is taken into the FIFO-A and FIFO-B in the FO order. Therefore, after completion of the currently executed process, FIFO-A and FIFO-B become full, and a full flag is set in a flag register (not shown) of the buffer 9.
Step 3:
An operation mode for stopping the process of fetching data into the FIFO-A and FIFO-B in the operation setting register of the host interface control block 5 (hereinafter, the process of stopping the process of fetching data into the FIFO-A and FIFO-B) Mode is called stop mode).
Step 4:
Under the control of the microprocessor 6, the following write sequencer is set for a register (not shown) of the flash sequencer block 12.
1) An internal write command is set in a predetermined register (not shown) in the flash sequencer block 12 as an internal command.
2) The physical address corresponding to the write destination page and the number of pages to be written are set in a predetermined register (not shown) in the flash sequencer block 12. Here, the physical address corresponding to the write destination page is generated by adding the page address portion of the logical address to the physical block address of the erased block read from the write queue 28 shown in FIG. Further, since the data to be written into the flash memory 2 is data already taken into the FIFO-A and FIFO-B, 2 is set as the number of pages.
Next, the flash sequencer block 12 executes an internal command based on the setting of the write sequencer. When this internal command is executed, information for executing the internal command is supplied from the flash memory interface block 10 to the flash memory 2 via the internal bus 14. As a result, the data taken into FIFO-A and FIFO-B is written into the flash memory 2 in the FI order. The physical address of the write destination is automatically incremented (addition process for the page) according to the number of pages to be written. Therefore, if the write destination physical address of the data to be written first is A0, The write destination physical address of the data to be written from is A0 + 1. The same processing is performed when the number of pages is 3 or more.
Step 5:
The process waits for FIFO-A and FIFO-B to become empty, that is, waits for the empty flag to be set, and proceeds to step 6 after the empty flag is set. Here, since the host interface block 7 is in the stop mode, new data is not taken into the FIFO-A and FIFO-B. Therefore, FIFO-A and FIFO-B become empty after the processing currently being executed, and an empty flag is set in a flag register (not shown) of buffer 9. In step 4, the write sequencer may be set so that FIFO-A and FIFO-B become empty when the process is completed, and the process may proceed to step 6 after the process is completed. Here, when the data writing process is completed, a flag indicating that the process is completed is set in a register (not shown) of the flash sequencer block 12. Therefore, it is possible to detect the completion of the data writing process with this flag.
Step 6:
A new sequencer for writing is not set for a register (not shown) included in the flash sequencer block 12. Therefore, after the write process in step 4 is completed, a new internal write command is not executed.
Step 7:
Under the control of the microprocessor 6, the following transfer sequencer is set in a register (not shown) of the flash sequencer block 12.
1) An internal transfer command is set in a predetermined register (not shown) in the flash sequencer block 12 as an internal command.
2) The physical addresses of the transfer source and transfer destination and the number of pages to be transferred are set in a predetermined register (not shown) in the flash sequencer block 12. Here, the transfer destination physical address is generated by adding the page address portion of the transfer source physical address to the physical block address of the erased block read from the write queue 28 shown in FIG. Also, FIFO-B is selected as the FIFO structure buffer used for inter-block transfer. Here, the FIFO structure buffer used for inter-block transfer is not particularly limited.
Next, the flash sequencer block 12 executes an internal command based on the setting of the write sequencer. When this internal command is executed, information for executing the internal command is supplied from the flash memory interface block 10 to the flash memory 2 via the internal bus 14. As a result, the data written in the transfer source page is taken into the FIFO-B, and then the data taken into the FIFO-B is written into the transfer destination page.
The physical addresses of the transfer source and transfer destination are automatically incremented (addition process for pages) according to the number of pages to be transferred. Therefore, the physical address of the transfer source that is transferred first is A1, the transfer destination The physical address of the transfer source that is transferred second is A1 + 1, and the physical address of the transfer destination is A2 + 1. The same processing is performed when the number of pages is 3 or more.
Step 8:
After starting the inter-block transfer process in step 7, the operation setting register provided in the host interface control block 5 is an operation mode in which data is fetched only in FIFO-A (hereinafter referred to as an operation mode in which data is fetched only in FIFO-A). 1 buffer mode) is set. As a result, the operation mode of the host interface block 7 is switched from the stop mode to the 1 buffer mode, and the data sent from the host computer 4 is taken into the FIFO-A. The switching to the 1-buffer mode may be performed before the interblock transfer process in step 7 is started.
Step 9:
The process waits for the transfer process in step 7 to end, and proceeds to step 10 after the transfer process ends. Here, when the transfer process is completed, a flag indicating that the process is completed is set in a register (not shown) of the flash sequencer block 12. Therefore, it is possible to detect the end of the transfer process with this flag.
Step 10:
The 2-buffer mode is set in the operation setting register included in the host interface control block 5. As a result, the operation mode of the host interface block 7 is switched from the 1 buffer mode to the 2 buffer mode, and the data sent from the host computer 4 is taken into the FIFO-A and the FIFO-B in the FO order. .
Step 11:
Under the control of the microprocessor 6, the following write sequencer is set for a register (not shown) of the flash sequencer block 12.
1) An internal write command is set in a predetermined register (not shown) in the flash sequencer block 12 as an internal command.
2) The physical address corresponding to the write destination page and the number of pages to be written are set in a predetermined register (not shown) in the flash sequencer block 12. Here, the physical address corresponding to the write destination page is generated by adding the page address portion of the logical address to the physical block address of the erased block read from the write queue 28 shown in FIG.
Next, the flash sequencer block 12 executes an internal command based on the setting of the write sequencer. When this internal command is executed, information for executing the internal command is supplied from the flash memory interface block 10 to the flash memory 2 via the internal bus 14. As a result, the data taken into FIFO-A and FIFO-B is written into the flash memory 2 in the FI order according to the number of pages to be written. The physical address of the write destination is automatically incremented (addition process for pages) according to the number of pages to be written as described above.
In the above description, the case where the buffer 9 includes two FIFO structure buffers has been described. However, the present invention can be similarly implemented even when the buffer 9 includes three or more buffers. For example, in the case where n FIFO structure buffers are provided, the host interface block 7 is in an operation mode in which data is taken into n-1 FIFO structure buffers at step 7, that is, interblock transfer processing. In the operation mode in which data is fetched only into the FIFO structure buffer not used in the above-described case, and when the inter-block transfer processing is not performed (in the above-described two-buffer mode), the operation mode in which data is fetched into n FIFO structure buffers Become. Even when n FIFO structure buffers are provided, the data is taken into the FIFO structure buffer in the FO order, and the data in the FIFO structure buffer is sent out in the FI order.
【The invention's effect】
As described above, according to the present invention, it is possible to interrupt the inter-block transfer process in the middle of the data write process while suppressing a decrease in the efficiency of the inter-block transfer process and the data write process.
[Brief description of the drawings]
FIG. 1 is a block diagram schematically showing a flash memory system 1 according to the present invention.
FIG. 2 is a cross-sectional view schematically showing a structure of a memory cell 16 constituting the flash memory 2. FIG.
FIG. 3 is a cross-sectional view schematically showing a memory cell 16 in a write state.
FIG. 4 is a diagram schematically showing the structure of the address space of the flash memory 2;
FIG. 5 is a schematic diagram showing a data structure of a write queue 28 stored in the work area 8;
FIG. 6 is a flowchart showing the operation of the flash memory system 1 according to the present invention.
[Explanation of symbols]
1 Flash memory system
2 Flash memory
3 Controller
4 Host computer
5 Host interface control block
6 Microprocessor
7 Host interface block
8 Work area
9 buffers
10 Flash memory interface block
11 ECC block
12 Flash sequencer block
13 External bus
14 Internal bus
16 memory cells
17 P-type semiconductor substrate
18 Source diffusion region
19 Drain diffusion region
20 Tunnel oxide film
21 Floating gate electrode
22 Insulating film
23 Control gate electrode
24 channels
25 User area
26 Redundant area
28 Write queue

Claims (6)

フラッシュメモリに書込むデータ、又はフラッシュメモリから読出すデータを保持する複数のバッファと、
前記バッファのフル又はエンプティの状態を検知する第1の検知機能と、
ブロック間転送処理の要求を検知する第2の検知機能とを備え、
前記第2の検知機能によりブロック間転送処理の要求を検知したときに、
前記バッファから前記フラッシュメモリへの書込み処理を停止し、
更に、前記第1の検知機能により、前記バッファが全てフルの状態であることを検知したときに、
前記フラッシュメモリに書込むデータを前記バッファに取込む処理を停止すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始し、
更に、前記第1の検知機能により、前記バッファが全てエンプティの状態であることを検知したときに、
前記バッファを使用してブロック間転送処理を実行すると共に、
前記ブロック間転送処理で使用されない前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始するように構成されていることを特徴とするメモリコントローラ。
A plurality of buffers for holding data to be written to the flash memory or data to be read from the flash memory;
A first detection function for detecting a full or empty state of the buffer;
A second detection function for detecting a request for inter-block transfer processing,
When a request for inter-block transfer processing is detected by the second detection function,
Stop the writing process from the buffer to the flash memory,
Furthermore, when it is detected by the first detection function that the buffers are all full,
While stopping the process of taking the data to be written into the flash memory into the buffer,
Start the writing process from the buffer to the flash memory,
Furthermore, when it is detected by the first detection function that all the buffers are in an empty state,
While performing an inter-block transfer process using the buffer,
A memory controller configured to start a process of fetching data to be written to a flash memory in the buffer that is not used in the inter-block transfer process.
前記ブロック間転送処理の終了を検知する第3の検知機能とを備え、
前記第3の検知機能によりブロック間転送処理の終了を検知したときに、
前記ブロック間転送処理で使用されていた前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始するように構成されていることを特徴とする請求項1記載のメモリコントローラ。
A third detection function for detecting the end of the inter-block transfer process,
When the end of inter-block transfer processing is detected by the third detection function,
While starting the process of taking data to be written to the flash memory into the buffer used in the inter-block transfer process,
The memory controller according to claim 1, wherein the memory controller is configured to start a writing process from the buffer to the flash memory.
フラッシュメモリに書込むデータ、又はフラッシュメモリから読出すデータを保持する複数のバッファと、
前記バッファのフル又はエンプティの状態を検知する第1の検知機能と、
ブロック間転送処理の要求を検知する第2の検知機能とを備え、
前記第2の検知機能によりブロック間転送処理の要求を検知したときに、
前記バッファから前記フラッシュメモリへの書込み処理を停止し、
更に、前記第1の検知機能により、前記バッファが全てフルの状態であることを検知したときに、
前記フラッシュメモリに書込むデータを前記バッファに取込む処理を停止すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始し、
更に、前記第1の検知機能により、前記バッファが全てエンプティの状態であることを検知したときに、
前記バッファを使用してブロック間転送処理を実行すると共に、
前記ブロック間転送処理で使用されない前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始するように構成されていることを特徴とするメモリコントローラを備えるフラッシュメモリシステム。
A plurality of buffers for holding data to be written to the flash memory or data to be read from the flash memory;
A first detection function for detecting a full or empty state of the buffer;
A second detection function for detecting a request for inter-block transfer processing,
When a request for inter-block transfer processing is detected by the second detection function,
Stop the writing process from the buffer to the flash memory,
Furthermore, when it is detected by the first detection function that the buffers are all full,
While stopping the process of taking the data to be written into the flash memory into the buffer,
Start the writing process from the buffer to the flash memory,
Furthermore, when it is detected by the first detection function that all the buffers are in an empty state,
While performing an inter-block transfer process using the buffer,
A flash memory system comprising a memory controller configured to start a process of fetching data to be written to a flash memory in the buffer that is not used in the inter-block transfer process.
前記ブロック間転送処理の終了を検知する第3の検知機能とを備え、
前記第3の検知機能によりブロック間転送処理の終了を検知したときに、
前記ブロック間転送処理で使用されていた前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始するように構成されていることを特徴とする請求項3記載のメモリコントローラを備えるフラッシュメモリシステム。
A third detection function for detecting the end of the inter-block transfer process,
When the end of inter-block transfer processing is detected by the third detection function,
While starting the process of taking data to be written to the flash memory into the buffer used in the inter-block transfer process,
4. A flash memory system comprising a memory controller according to claim 3, wherein a write process from the buffer to the flash memory is started.
ブロック間転送処理の要求を検知したときに、
フラッシュメモリに書込むデータ、又はフラッシュメモリから読出すデータを保持する複数のバッファから前記フラッシュメモリへの書込み処理を停止し、
更に、前記バッファが全てフルの状態であることを検知したときに、
前記フラッシュメモリに書込むデータを前記バッファに取込む処理を停止すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始し、
更に、前記バッファが全てエンプティの状態であることを検知したときに、
前記バッファを使用してブロック間転送処理を実行すると共に、
前記ブロック間転送処理で使用されない前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始することを特徴とするフラッシュメモリの制御方法。
When a request for block transfer processing is detected,
Stop writing to the flash memory from a plurality of buffers holding data to be written to the flash memory or data to be read from the flash memory,
Furthermore, when it is detected that all the buffers are full,
While stopping the process of taking the data to be written into the flash memory into the buffer,
Start the writing process from the buffer to the flash memory,
Furthermore, when it is detected that all the buffers are empty,
While performing an inter-block transfer process using the buffer,
A method of controlling a flash memory, comprising starting a process of fetching data to be written into a flash memory into the buffer that is not used in the inter-block transfer process.
前記ブロック間転送処理の終了を検知したときに、
前記ブロック間転送処理で使用されていた前記バッファに、フラッシュメモリに書込むデータを取込む処理を開始すると共に、
前記バッファから前記フラッシュメモリへの書込み処理を開始することを特徴とする請求項5記載のフラッシュメモリの制御方法。
When detecting the end of the inter-block transfer process,
While starting the process of taking data to be written to the flash memory into the buffer used in the inter-block transfer process,
6. The flash memory control method according to claim 5, wherein a write process from the buffer to the flash memory is started.
JP2003122224A 2003-04-25 2003-04-25 MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD Expired - Fee Related JP4183550B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003122224A JP4183550B2 (en) 2003-04-25 2003-04-25 MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003122224A JP4183550B2 (en) 2003-04-25 2003-04-25 MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Publications (2)

Publication Number Publication Date
JP2004326574A JP2004326574A (en) 2004-11-18
JP4183550B2 true JP4183550B2 (en) 2008-11-19

Family

ID=33500532

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003122224A Expired - Fee Related JP4183550B2 (en) 2003-04-25 2003-04-25 MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Country Status (1)

Country Link
JP (1) JP4183550B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102080542B1 (en) 2013-06-27 2020-02-25 삼성전자 주식회사 Nonvolatile memory device using variable resistive element and driving method thereof

Also Published As

Publication number Publication date
JP2004326574A (en) 2004-11-18

Similar Documents

Publication Publication Date Title
JP4834676B2 (en) System and method using on-chip non-volatile memory write cache
JP3921174B2 (en) Memory controller, flash memory system, and flash memory control method
JP4256600B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
EP2115594B1 (en) Memory system
JP2011107851A (en) Memory system
JP2008152464A (en) Storage device
JP4236485B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4173410B2 (en) Memory controller and flash memory system including the memory controller
JP4183550B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
US20040255076A1 (en) Flash memory controller, memory control circuit, flash memory system, and method for controlling data exchange between host computer and flash memory
JP4233213B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4316824B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4177292B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM, AND FLASH MEMORY CONTROL METHOD
JP4213053B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP3999564B2 (en) Memory controller, flash memory system, and flash memory control method
JP4282410B2 (en) Flash memory control circuit, and memory controller and flash memory system provided with the control circuit
JP4042898B2 (en) Memory controller, memory system including the same, and flash memory control method
JP4177301B2 (en) Memory controller, flash memory system, and flash memory control method
JP2005107599A (en) Memory controller, flash memory system equipped with memory controller, and control method of flash memory
JP4561110B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4282401B2 (en) Flash memory control circuit, and memory controller and flash memory system provided with the control circuit
JP4222879B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP4304167B2 (en) Memory controller, flash memory system, and flash memory control method
JP4194473B2 (en) Memory controller and flash memory system including the memory controller
JP4251950B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060303

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080820

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080902

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

Free format text: PAYMENT UNTIL: 20110912

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120912

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees