JP2004234473A - Nonvolatile storage device - Google Patents
Nonvolatile storage device Download PDFInfo
- Publication number
- JP2004234473A JP2004234473A JP2003024121A JP2003024121A JP2004234473A JP 2004234473 A JP2004234473 A JP 2004234473A JP 2003024121 A JP2003024121 A JP 2003024121A JP 2003024121 A JP2003024121 A JP 2003024121A JP 2004234473 A JP2004234473 A JP 2004234473A
- Authority
- JP
- Japan
- Prior art keywords
- physical
- block
- reserved
- blocks
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、書換え可能な不揮発性メモリを有する記憶装置に関し、特に不揮発性メモリへの書き込みを管理する技術に関する。
【0002】
【従来の技術】
近年、コンピュータ等の電子機器で用いられるデータを記憶させておく外部記憶装置として、主としてカード状の記憶装置の使用が広がっている。このような記憶装置には、書換え可能な不揮発性半導体メモリが用いられている。
【0003】
代表的な書き換え可能な不揮発性半導体メモリとして、フラッシュメモリがある。フラッシュメモリでは、格納されるデータはブロック(物理ブロック)単位で管理されており、データの消去はブロック単位で行われる。また各ブロックは複数のページを有している。ページは、フラッシュメモリにおけるデータの読み出し・書き込みの最小単位である。一般にフラッシュメモリにおいては、消去とは、全ビットを“1”とする処理を示し、書き込みとは、指定されたビットを“0”とする処理を示す。
【0004】
各ページは、データを格納する領域とは別に冗長部を有しており、当該ページに割り当てられている論理アドレスに関した情報や、データの訂正符号がこの冗長部に格納される。各ページにはフラッシュメモリ内で一意な物理アドレスが割り当てられており、フラッシュメモリの制御装置は、フラッシュメモリにコマンドを送る際に、物理アドレスを指定することによって処理を制御する。
【0005】
一方、コンピュータ等のホストから記憶装置に対しデータアクセスを行う際、ホストはセクタと呼ばれるデータサイズを単位としてデータを取り扱う。また、ホストは、フラッシュメモリ上で格納されるデータを、物理ブロックと同じサイズを有する論理ブロックを単位として管理する。論理ブロックは、一般に複数のセクタから構成されている。各セクタには論理的な順番である論理アドレスが付加されており、ホストは、記憶装置に論理アドレスを指定することによって処理を制御する。
【0006】
図14は、一般的な不揮発性記憶装置におけるデータ管理についての説明図である。図14は、論理データ構成と物理データ構成との間の対応関係を示している。論理データ構成は、ホストから指定されるデータの構成であり、物理データ構成は、不揮発性メモリに格納されているデータの構成である。
【0007】
書き込み済みの論理ブロックは、フラッシュメモリ内の物理ブロックと1対1に対応付けられ、管理されている(未書き込みの論理ブロックには、対応する物理ブロックは存在しない)。Q+1個(Qは0以上の整数)の論理ブロックが1つの論理セグメントを構成する。また、P+1個(Pは0以上の整数)の物理ブロックが1つの物理セグメントを構成する。
【0008】
ここで、各論理セグメントはそれぞれ、対応する1つの物理セグメントに割り当てられている。ある論理セグメントを構成する論理データは、特定の物理セグメントとして管理される領域に格納される(物理ブロックには不良ブロックも存在するため、一般にQ<Pである)。したがって、フラッシュメモリが格納する、論理ブロックと物理ブロックとの間の対応情報であるアドレス変換情報(以下では、ATと称する。論物変換情報とも呼ばれる。)は、物理セグメント単位で管理されることになる。
【0009】
図15は、従来の不揮発性記憶装置の構成の例を示すブロック図である。図15の不揮発性記憶装置900は、ホストインタフェース910と、コントローラ920と、揮発性メモリであるRAM(random access memory)930と、不揮発性メモリ940とを備えている。ホストインタフェース910は、ホスト902からコマンド等を受け、コントローラ920に伝える。コントローラ920は、ホストインタフェース910、RAM930及び不揮発性メモリ940の間の調停、並びにこれらに対する制御を行う。
【0010】
不揮発性メモリ940は、書き換え可能な不揮発性メモリであって、管理領域942とデータ領域944とを有している。管理領域942にはアドレス変換情報が格納され、データ領域944にはホスト902が読み書きを行うデータが格納される。
【0011】
管理領域942は、ATIP952と、ATI954と、AT956とを有している。データ領域944は、4個の物理セグメントを有している。AT956には、各物理セグメントに対応するテーブルである。ATI954は、各テーブルの物理アドレスを格納する。
【0012】
RAM930は、ATI954を読み出した後にこれを格納するためのATIRAM932と、AT956のテーブルのいずれか1つを読み出した後にこれを格納するためのATRAM934とを有している。
【0013】
図16は、図15の不揮発性メモリ940の管理領域942におけるデータ構造を示す説明図である。ATIP952は、特定ブロック(例えば先頭ブロック)に割り当てられており、ATI954の物理アドレスを格納する。ATI954は、AT956の各テーブル(AT0,AT1,AT2,AT3)の物理アドレスを格納する。テーブルAT0からAT3は、4個の物理セグメントのそれぞれのアドレス変換情報を示している。
【0014】
図17は、図15の不揮発性記憶装置の書き込み時における処理の例を示すフローチャートである。
【0015】
不揮発性記憶装置900にホスト902からデータの書き込み命令が送られると、ステップS902において、不揮発性記憶装置900は、ホスト902から指定された書き込み対象の論理アドレスから、書き込み対象の物理ブロックが割り当てられている物理セグメントを求める。
【0016】
ステップS904では、ステップS902で求められた物理セグメントのATデータが既にATRAM934に読み出されているか否かを判断する。ATデータが読み出されていない場合には、ステップS906に進む。既にATデータが読み込まれている場合には、ステップS908に進む。
【0017】
ステップS906では、ATIRAM932を参照して、求められた物理セグメントに対応するATデータをATRAM934に読み出す。ステップS908では、ATRAM934を参照して、ホスト902から指定された論理アドレスに対応する物理ブロックを求める。
【0018】
ステップS910では、対応する物理ブロックが存在するか否かを判断する。対応物理ブロックが存在する場合には、ステップS916に進む。対応物理ブロックが存在しない場合には、対応物理ブロックを指定しなければならないので、ステップS912に進む。
【0019】
ステップS912では、ATRAM934を参照して、当該物理セグメント内を探索して、まだ論理ブロックに割り当てられていない物理ブロックを選択する。ステップS914では、ATRAM934と、ATデータを書き換えることによって、選択された物理ブロックを指定された論理ブロックに対応付ける。以上の処理により、ホスト902から指定された論理アドレスに対応する物理ブロックが割り当てられる。
【0020】
続いて、割り当てられた物理ブロックへデータを書き込む。不揮発性メモリは、物理ブロック単位でデータの消去を行うので、既にデータが書き込まれたページにデータを上書きする際には、まずブロック全体のデータを消去する必要がある。このため、ステップS916では、上書き対象の物理ブロック内のデータであって更新されない領域のデータを読み出して、一時的にRAM930内に待避させる。このようなデータを、再度書き込む必要があるからである。
【0021】
ステップS918では、上書き対象の物理ブロックのデータを消去後、ステップS916において待避させたデータと、ホスト902から送られたデータとを併せて書き込む。ステップS920では、ステップS918における消去及び書き込みが正常に終了したか否かを判断する。正常に終了した場合には書き込み処理を終了する。正常に終了しなかった場合には、ステップS922に進む。
【0022】
ステップS920で正常に終了しなかったと判断された場合には、その物理ブロックは不良ブロックになったということであるので、指定された論理アドレスに対応する物理ブロックを変更する必要がある。そこで、ステップS922では、ステップS912と同様に、当該物理セグメント内を探索して、まだ論理ブロックに割り当てられていない物理ブロックを選択し、ステップS924では、ステップS914と同様に、選択された物理ブロックを論理ブロックと対応付けてATRAM934とATデータとを更新する。更に、ステップS926では、ステップS916及びS918と同様に、データの待避、消去、及び書き込みを行う。その後、再びステップS920の処理を行う。
【0023】
これに関連する技術が、例えば特許文献1に開示されている。
【0024】
【特許文献1】
特開2001−142774号公報
【0025】
【発明が解決しようとする課題】
フラッシュメモリの特徴として、各ブロックの書き込み頻度にバラつきがあると、書き込み頻度の高いブロックから破壊されていく可能性が高まるということがある。このため、フラッシュメモリを使用する際には、各ブロックの書き込み/消去頻度ができるだけ均等となるようにデータの書き込みを行うとともに、破壊されたブロックに対して書き込み・消去等のアクセスを行わないように管理する必要がある。
【0026】
また、書き込み・消去に要する処理時間が長いので、特に電源が不安定な携帯機器で使用される可能性の高いメモリカードのような不揮発性記憶装置では、書き込みや消去の処理中に電源遮断が生じた場合であってもフラッシュメモリ内のデータの整合性を確保するための対策が必要である。
【0027】
しかし、従来の技術においては、例えばFAT(file allocation table)情報が書き込まれる論理ブロックのように、特定の論理ブロックが常に同一の物理ブロックにのみ書き込まれることがあった。このため、例えばFAT情報の更新等のように、同一論理ブロックを何度も書き換えるような処理をホストが行った場合には、同一物理セグメント内に未使用の物理ブロックがあるにも関わらず、特定の物理ブロックの書き込み回数のみが増加し、フラッシュメモリの寿命を縮めるという問題があった。
【0028】
また、従来は、データの書き換え(特にATデータ)の際にホストからの電源電圧の供給が遮断された場合には、不揮発性メモリ内部で格納されているデータの論理的な不整合が生じることになり、ホストにデータが正しく読み出せなかったり、その後のアクセスによりデータの破壊が生じたりする可能性が高いという問題があった。
【0029】
本発明は、不揮発性メモリの故障を防ぎ、これを用いる不揮発性記憶装置の寿命を伸ばすことを目的とする。また、不揮発性記憶装置において、供給電圧が低下しても、格納されている論理データの破壊が生じないようにすることを目的とする。
【0030】
【課題を解決するための手段】
前記課題を解決するため、請求項1の発明が講じた手段は、不揮発性記憶装置として、複数の物理ブロックを有する不揮発性メモリと、コントローラとを備え、前記コントローラは、前記不揮発性メモリから前記物理ブロックを第1の予約ブロックとして複数選択し、入力された論理アドレスと前記不揮発性メモリの物理アドレスとの対応関係を示す第1のテーブルを前記第1の予約ブロックのうちのいずれか1つに格納させ、前記複数の第1の予約ブロックの物理アドレスを示す第2のテーブルを前記不揮発性メモリに格納させ、かつ、前記不揮発性メモリに書き込みを行う場合には、前記第1のテーブルを書き換え、前記第1の予約ブロックのうち、書き換え前の前記第1のテーブルが格納されていたものとは異なるものに、書き換え後の前記第1のテーブルを格納させるものである。
【0031】
請求項1の発明によると、書き換えの頻度が高い第1のテーブルを、更新する毎に同一の物理ブロックに書き込み続けることがないので、不揮発性メモリの各物理ブロックの書き込み頻度を均等に近づけることができる。このため、不揮発性記憶装置の故障確率を小さくすることができる。
【0032】
また、請求項2の発明では、請求項1に記載の不揮発性記憶装置において、前記コントローラは、前記第1の予約ブロックのいずれにも書き込みが所定の回数以上行われると、前記不揮発性メモリから前記物理ブロックを複数選択して、新たな前記第1の予約ブロックとして用いるものである。
【0033】
請求項2の発明によると、第1の予約ブロックを所定の回数ずつ使った後に、新たな第1の予約ブロックを用いるので、第1の予約ブロックの書き込み頻度をほぼ等しくし、第2のテーブルの書き込み頻度を低くすることができる。
【0034】
また、請求項3の発明では、請求項2に記載の不揮発性記憶装置において、前記コントローラは、前記不揮発性メモリから前記物理ブロックを第2の予約ブロックとして複数選択し、前記第2のテーブルを前記第2の予約ブロックのうちのいずれか1つに格納させ、前記複数の第2の予約ブロックの物理アドレスを示す第3のテーブルを前記不揮発性メモリの所定のアドレスに格納させ、かつ、新たな前記第1の予約ブロックを用いる場合には、前記第2のテーブルを書き換え、前記第2の予約ブロックのうち、書き換え前の前記第2のテーブルが格納されていたものとは異なるものに、書き換え後の前記第2のテーブルを格納させるものである。
【0035】
請求項3の発明によると、第2のテーブルを、更新する毎に同一の物理ブロックに書き込み続けることがないので、不揮発性メモリの各物理ブロックの書き込み頻度をより均等に近づけることができる。
【0036】
また、請求項4の発明では、請求項3に記載の不揮発性記憶装置において、前記コントローラは、前記第2の予約ブロックのいずれにも書き込みが所定の回数以上行われると、前記不揮発性メモリから前記物理ブロックを複数選択して、新たな前記第2の予約ブロックとして用いるものである。
【0037】
請求項4の発明によると、第2の予約ブロックを所定の回数ずつ使った後に、新たな第2の予約ブロックを用いるので、第2の予約ブロックの書き込み頻度をほぼ等しくし、所定のアドレスに格納される第3のテーブルの書き込み頻度を低くすることができる。
【0038】
また、請求項5の発明では、請求項3に記載の不揮発性記憶装置において、前記コントローラは、前記第3のテーブルに、前記第1及び第2のテーブルを加えて、前記不揮発性メモリの前記所定のアドレスに格納させるものである。
【0039】
請求項5の発明によると、更新頻度は少ないが重要なデータを格納した物理ブロックに、第1のテーブルの記述に基づいて直接アクセスすることができるので、初期化時等に簡便な処理でデータを取得することが可能となり、初期化時間の短縮等を行うことができる。
【0040】
【発明の実施の形態】
以下、本発明の実施の形態について、図面を参照しながら説明する。
【0041】
(第1の実施形態)
図1は、本発明の第1の実施形態に係る不揮発性記憶装置のブロック図である。図1の不揮発性記憶装置100は、ホストインタフェース10と、コントローラ20と、RAM30と、不揮発性半導体メモリ40とを備えている。ホスト2は、例えばコンピュータやオーディオプレーヤである。不揮発性記憶装置100は、例えばメモリカードである。
【0042】
ホストインタフェース10は、ホスト2からコマンドを受け取り、これをレジスタ情報に変換する等の必要な処理を行い、コントローラ20に出力する。また、ホストインタフェース10は、ホスト2が出力した不揮発性メモリ40への書き込みデータをコントローラ20に出力し、不揮発性メモリ40からの読み出しデータをホスト2に出力する。コントローラ20は、ホストインタフェース10、RAM30、及び不揮発性メモリ40の動作を制御する。
【0043】
不揮発性メモリ40は、書き換え可能なものであって、例えばフラッシュメモリである。不揮発性メモリ40は、ホスト2から送られたデータを格納するデータ領域44と、データ領域44に格納されたデータの論理的なつながりを管理するためのデータを格納する管理領域42とを有している。
【0044】
データ領域44は、N+1個(Nは0以上の整数)の物理セグメントを有している。各物理セグメントは、ホストから送られたデータを格納する物理ブロックと、複数のAT予約ブロック(第1の予約ブロック)とを有する。AT予約ブロックは、その物理セグメント内の物理ブロックと論理ブロックとの対応関係を示す、第1のテーブルとしてのアドレス変換テーブル(アロケーションテーブルともいう。以下では、ATと称する。)を格納するために予約された物理ブロックである。AT予約ブロックのうちの1つが、現在有効なATを保持するために用いられる。
【0045】
また、管理領域42は、各物理セグメントのAT予約ブロックのアドレスを示す第2のテーブルとしてのATI54を格納する物理ブロックと、この物理ブロックの物理アドレスを示すポインタをATIP52として格納する物理ブロックとを有する。特に、ATIP52を格納する物理ブロックは、特定の物理アドレスを有しており、例えば先頭物理ブロックである。ATI54は、一定のアドレスに格納されていてもよいし、格納されるアドレスを管理領域42内において必要に応じて変えるようにしてもよい。
【0046】
RAM30は、ATI54のデータを格納するATIRAM32と、現在有効なATを格納するATRAM34と、現在有効なATを持つ物理ブロックを示すポインタを示すデータを格納するATI_Point36とを有する。
【0047】
コントローラ20は、不揮発性記憶装置100の初期化時において、ATI54のATIRAM32への読み出し、AT予約ブロックのうち有効なATを持つ物理ブロックの判断、及び、有効と判断された物理ブロックを示すポインタを示すデータのATI_Point36への読み出しを行う。
【0048】
図2は、図1の不揮発性メモリ40が格納するデータの構成についての説明図である。ATIP52は、ATI54の物理アドレスを有している。各物理セグメントでは、その物理セグメントのATを格納するためのブロックとして、M+1個(Mは自然数)の物理ブロックがAT予約ブロックとして予約されている。図2の場合には、AT70に示されているように、物理セグメント0においては物理ブロック1,物理ブロック3等が、それぞれAT予約ブロック82a,82b等として予約されている。予約は、例えば出荷時に行われる。予約されたブロックに対しては、論理ブロックとの対応付けは行われない。AT予約ブロックのうちのいずれかに、現在有効なAT70が格納される。
【0049】
ATI54は、各物理セグメントに対してM+1個のAT予約ブロックの物理アドレスを格納している。図2では、AT予約ブロック82aを示すためのポインタと、このポインタが示す物理アドレスとの関係等が、ATI54に示されている。
【0050】
図3は、図1の不揮発性記憶装置の書き込み時における処理の例を示すフローチャートである。図3の各ステップについて説明する。
【0051】
ステップS2において、コントローラ20は、ホスト2からデータの書き込み命令を受けると、ホスト2によって指定された論理アドレスから、データを書き込む物理セグメントを求める。
【0052】
ステップS4では、コントローラ20は、ステップS2で求めた物理セグメントのATがATRAM34に読み出し済みであるか否かを判断する。読み出し済みである場合には、ステップS8に進み、その他の場合には、ステップS6に進む。
【0053】
ステップS6では、コントローラ20は、ATI_Point36が格納する、現在有効なATを示すポインタについてのデータを用いて、ATIRAM32が格納するATI54のデータから当該物理セグメントのATが格納された物理ブロックの物理アドレスを求め、現在有効なATをATRAM34に読み出す。
【0054】
その後、ステップS8では、コントローラ20は、ATRAM34を参照して、当該物理セグメント内を探索し、AT予約ブロック以外であってまだ論理ブロックとは対応付けられていない未割り当て物理ブロックを選択する。ここで、コントローラ20は、未割り当て物理ブロックの中から、例えば乱数を用いてランダムに物理ブロックを選択する。また、各物理ブロックに、それまでにその物理ブロックに対して行われた書き込みの回数が記録されるようにしておき、コントローラ20は、未割り当て物理ブロックの中で、特に書き込みが行われた回数が少ない物理ブロックを求めるようにしてもよい。
【0055】
ステップS10では、コントローラ20は、ホスト2から送られたデータを選択された物理ブロックに書き込む。
【0056】
ステップS12では、コントローラ20は、書き込みが正常に終了したか否かを判断する。書き込みが正常に終了した場合には、ステップS14に進み、正常に終了しなかった場合には、ステップS8に戻り、再び未割り当て物理ブロックを探す。
【0057】
ステップS14では、コントローラ20は、ATRAM34を参照して、ホスト2から指定された論理アドレスに対応する物理ブロックを求める。
【0058】
ステップS16では、コントローラ20は、対応する物理ブロックが存在するか否かを判断する。対応する物理ブロックが存在する場合には、ステップS18に進み、存在しない場合には、ステップS22に進む。
【0059】
ステップS18では、コントローラ20は、ホスト2からデータが送られておらず、書き込みを行っていない領域に対応するデータを、ステップS14で求められた対応する物理ブロックから読み出して、ステップS8で選択された物理ブロックに書き込む。
【0060】
ステップS20では、コントローラ20は、ステップS18での書き込みが正常に終了したか否かを判断する。正常に終了した場合には、ステップS22に進み、正常に終了しなかった場合には、ステップS8に戻る。以上で、ホスト2から送られたデータを不揮発性メモリ40に格納する処理が終了する。続いて当該物理セグメントのAT情報の更新を行う。
【0061】
ステップS22では、コントローラ20は、選択された物理ブロックをホスト2から指定された論理アドレス示された論理ブロックに対応するように、ATRAM34のデータを更新する。
【0062】
ステップS30では、コントローラ20は、ATの更新を行い、書き込み処理を終了する。
【0063】
図4は、図3のATを更新するステップS30における処理の例を示すフローチャートである。
【0064】
まず、ステップS32では、コントローラ20は、更新可能なAT予約ブロックが存在するか否かを判断する。すなわち、コントローラ20は、ATI_Point36のデータに基づき、全てのAT予約ブロックに所定の回数(例えば1回)以上の書き込みが行われていることがわかった場合には、更新可能なブロックは存在しないと判断し、ステップS34に進む。その他の場合には、更新可能なブロックは存在すると判断し、ステップS40に進む。
【0065】
所定回数以上の書き込みが行われていた場合、この物理セグメントの全体の書き込み頻度を均等に近づけるために、新たにATを格納するためのAT予約ブロックを設定する。そこで、ステップS34では、コントローラ20は、この物理セグメント内を探索して、AT予約ブロック以外であり、かつ、まだ論理ブロックと対応付けられていない未割り当て物理ブロックを選択する。ステップS34における処理は、物理ブロックをM+1個選択する点の他は、ステップS8における処理と同様である。選択された未割り当て物理ブロックは、新たなAT予約ブロックとして扱われる。
【0066】
ステップS36では、コントローラ20は、選択されたAT予約ブロックの物理アドレスでATIRAM32とATRAM34とを更新する。
【0067】
ステップS38では、コントローラ20は、ATIRAM32のデータを管理領域42内にATI54のデータとして書き込む。
【0068】
その後、ステップS40では、コントローラ20は、この物理ブロックについてのATI54のテーブルにおいて、ATI_Point36が、現在示すポインタの次のポインタを示すように、そのデータを更新する。その後、ATIRAM32及びATI_Point36のデータに基づいて、更新可能なAT予約ブロックに、ATRAM34のデータを書き込む。
【0069】
ステップS42では、コントローラ20は、ステップS40の処理が正常終了したか否かを判断する。正常終了した場合は、AT更新処理を終了する。正常終了しなかった場合は、ステップS32に戻る。
【0070】
このように、第1の実施形態の不揮発性記憶装置によると、不揮発性メモリにおいて、ATのデータを書き込むための予約ブロックを複数用いる。また、予約ブロックとして、書き込み頻度の少ない物理ブロックを選択する。書き換え頻度が大きいATのデータを、特定の物理ブロックにのみ書き込み続けることがないので、不揮発性メモリの各物理ブロックの書き込み頻度を均等に近づけることが可能となる。そして、不揮発性記憶装置の故障確率を小さくし、寿命を延ばすことができる。
【0071】
また、第1の実施形態の不揮発性記憶装置は、ホストから物理ブロックへのデータの書き込み時には、書き込みが正常に終了した後に物理ブロックと論理ブロックとの間のアドレス変換テーブルを更新する。このため、書き込み処理中に供給電圧が低下したり、電源が遮断されても書き込み前のデータは有効であり、データの喪失を防ぐことができる。したがって、この不揮発性記憶装置を用いて安定したシステムを構築することができる。
【0072】
(第2の実施形態)
第2の実施形態では、ATのみではなく、ATIをも複数の予約ブロックのうちのいずれかに格納させるようにした場合について説明する。
【0073】
図5は、本発明の第2の実施形態に係る不揮発性記憶装置のブロック図である。図5の不揮発性記憶装置200は、ホストインタフェース210と、コントローラ220と、RAM230と、不揮発性半導体メモリ240とを備えている。図5において、ホストインタフェース210は、図1のホストインタフェース10と同様のものである。
【0074】
不揮発性メモリ240は、図1の不揮発性メモリ40とほぼ同様のものであって、管理領域242と、データ領域244とを有している。
【0075】
データ領域244は、N+1個の物理セグメントを有している。各物理セグメントは、ホストから送られたデータを格納する物理ブロックと、その物理セグメント内の物理ブロックと論理ブロックとの対応関係を示すATを格納するために予約された複数のAT予約ブロックと、その物理セグメントについてのAT予約ブロックのアドレスを示すテーブルであるATIを格納するために予約された複数のATI予約ブロック(第2の予約ブロック)とを有する。第1の実施形態の場合と同様に、AT予約ブロックのうちの1つが、現在有効なATを保持するために用いられる。更に、ATI予約ブロックのうちの1つが、現在有効なATIを保持するために用いられる。
【0076】
また、管理領域242は、各物理セグメントのATI予約ブロックのアドレスを示す第3のテーブルとしてのATIP252を格納する物理ブロックを有する。ATIP252を格納する物理ブロックは、特定の物理アドレスを有しており、例えば先頭物理ブロックである。すなわち、ATIP252は、一定のアドレスに格納されている。
【0077】
RAM230は、現在有効なATIを格納するATIRAM232と、現在有効なATを格納するATRAM234と、現在有効なATを持つ物理ブロックを示すポインタを示すデータを格納するATI_Point236と、現在有効なATIを持つ物理ブロックを示すポインタを示すデータを格納するATIP_Point238とを有する。
【0078】
コントローラ220は、不揮発性記憶装置200の初期化時において、ATIのATIRAM232への読み出し、AT予約ブロックのうち有効なATを持つ物理ブロックの判断、有効と判断された物理ブロックを示すポインタを示すデータのATI_Point236への読み出し、ATI予約ブロックのうち有効なATIを持つ物理ブロックの判断、及びこの際に有効と判断された物理ブロックを示すポインタを示すデータのATIP_Point238への読み出しを行う。
【0079】
図6は、図5の不揮発性メモリ240が格納するデータの構成についての説明図である。ATIP252は、各物理セグメントのATI予約ブロックのアドレスを示すテーブルを有している。
【0080】
各物理セグメントでは、その物理セグメントのATを格納するためのブロックとして、M+1個の物理ブロックがAT予約ブロックとして予約され、その物理セグメントのATIを格納するためのブロックとして、L+1個(Lは自然数)の物理ブロックがATI予約ブロックとして予約されている。
【0081】
図6の場合には、テーブル270に示されているように、物理セグメント0においては物理ブロック1,物理ブロック3等が、それぞれAT予約ブロック282a,282b等として予約されている。更に、この物理セグメントにおいては物理ブロック2等が、ATI予約ブロック284a等として予約されている。予約は、例えば出荷時に行われる。予約されたブロックに対しては、論理ブロックとの対応付けは行われない。
【0082】
各ATIは、各物理セグメントについて、M+1個のAT予約ブロックの物理アドレスを格納している。ATIP252は、N+1個の物理セグメントのそれぞれについてL+1個のATI予約ブロックの物理アドレスを格納している。図6では、ATI予約ブロック284aを示すためのポインタと、このポインタが示す物理アドレスとの関係等が、ATIP252に示されている。また、AT予約ブロック282a,282bを示すためのポインタと、これらのポインタがそれぞれ示す物理アドレスとの関係等が、ATI予約ブロック284aに格納されたATI254に示されている。
【0083】
図5の不揮発性記憶装置の書き込み時における処理について説明する。主な処理の流れは、図3を参照して説明したものと同様であるが、AT更新を行うステップにおける処理が異なる。
【0084】
図7は、図5の不揮発性記憶装置の書き込み時におけるATを更新するステップの処理の例を示すフローチャートである。図7において、ステップS32,S34,S36,S40,S42の処理は、図4を参照して説明したものと同じであるので、その説明を省略する。ステップS150では、コントローラ220は、データ領域244に格納されたATIの更新を行う。
【0085】
図8は、図7のATIの更新を行うステップS150における処理の例を示すフローチャートである。
【0086】
ステップS152では、ステップS32と同様に、コントローラ220は、更新可能なATI予約ブロックが存在するか否かを判断する。すなわち、コントローラ220は、ATIP_Point238のデータに基づき、全てのATI予約ブロックに所定の回数(例えば1回)以上の書き込みが行われていれば、更新可能なブロックは存在しないと判断し、ステップS154に進む。そうでなければ、更新可能なブロックは存在すると判断し、ステップS160に進む。
【0087】
所定回数以上の書き込みが行われていた場合、この物理セグメントの全体の書き込み頻度を均等に近づけるために、新たにATを格納するためのAT予約ブロックを設定する。そこで、ステップS154では、コントローラ220は、この物理セグメント内において、AT予約ブロック及びATI予約ブロック以外であり、かつ、まだ論理ブロックと対応付けられていない未割り当て物理ブロックを選択する。ステップS154における処理は、物理ブロックをL+1個選択する点の他は、ステップS34における処理と同様である。選択した未割り当て物理ブロックは、新たなATI予約ブロックとして扱われる。
【0088】
ステップS156では、コントローラ220は、選択されたATI予約ブロックの物理アドレスでATRAM234を更新する。
【0089】
ステップS158では、コントローラ220は、管理領域242内のATIP252を更新する。
【0090】
その後、ステップS160では、コントローラ220は、ATIP_Point238のデータに基づいて、更新すべきATI予約ブロックに、ATIRAM232のデータを書き込む。
【0091】
ステップS162では、コントローラ220は、ステップS160の処理が正常終了したか否かを判断する。正常終了した場合は、ATI更新処理を終了する。正常終了しなかった場合は、ステップS152に戻る。
【0092】
このように、書き込まれる物理ブロックが固定されたATIP252が書き換えられるのは、全てのATI予約ブロックを少なくとも1回ずつ使い終える毎であり、ATIP252の書き換え頻度を大幅に低減させることができる。
【0093】
第2の実施形態の不揮発性記憶装置では、不揮発性メモリにおいて、AT予約ブロックだけではなく、ATIのデータを書き込むためのATI予約ブロックを複数用いる。また、予約ブロックとして、書き込み頻度の少ない物理ブロックを選択する。書き換え頻度が大きいAT及びATIのデータを、それぞれ特定の物理ブロックにのみ書き込み続けることがないので、不揮発性メモリの各物理ブロックの書き込み頻度をより均等に近づけることが可能となる。そして、不揮発性記憶装置の故障確率を小さくし、寿命を延ばすことができる。
【0094】
(第3の実施形態)
第3の実施形態では、複数の種類のポインタを用いる場合について説明する。
【0095】
図9は、本発明の第3の実施形態に係る不揮発性記憶装置のブロック図である。図9の不揮発性記憶装置300は、ホストインタフェース310と、コントローラ320と、RAM330と、不揮発性半導体メモリ340とを備えている。図9において、ホストインタフェース310は、図1のホストインタフェース10と同様のものである。RAM330は、図5のRAM230と同様のものである。
【0096】
不揮発性メモリ340は、図1の不揮発性メモリ40とほぼ同様のものであって、管理領域342と、データ領域344とを有している。データ領域344は、図5のデータ領域244と同様に、複数のAT予約ブロックと、複数のATI予約ブロックとを有している。
【0097】
管理領域342は、ATIP352を格納する物理ブロックを有している。この物理ブロックは、特定の物理アドレスを有しており、例えば先頭物理ブロックである。
【0098】
コントローラ320は、不揮発性記憶装置300の初期化時において、図5のコントローラ220と同様に、ATIのATIRAM332への読み出し、AT予約ブロックのうち有効なATを持つ物理ブロックの判断、有効と判断された物理ブロックを示すポインタを示すデータのATI_Point336への読み出し、ATI予約ブロックのうち有効なATIを持つ物理ブロックの判断、及びこの際に有効と判断された物理ブロックを示すポインタを示すデータのATIP_Point338への読み出しを行う。
【0099】
図10は、図9の不揮発性メモリ340が格納するデータの構成についての説明図である。ATIP352は、各物理セグメントのATI予約ブロックのアドレスを示すテーブルと、物理セグメントについてのAT予約ブロックのアドレスを示すテーブルであるATIと、物理セグメント内の物理ブロックと論理ブロックとの対応関係を示すテーブルであるATとを有している。
【0100】
各物理セグメントでは、その物理セグメントのATを格納するためのブロックとして、M+1個の物理ブロックがAT予約ブロックとして予約され、その物理セグメントのATIを格納するためのブロックとして、L+1個の物理ブロックがATI予約ブロックとして予約されている。
【0101】
図10の場合には、テーブル371に示されているように、物理セグメント1においては物理ブロック1,物理ブロック3等が、それぞれAT予約ブロック382a,382b等として予約されている。更に、この物理セグメントにおいては物理ブロック2等が、ATI予約ブロック384a等として予約されている。予約は、例えば出荷時に行われる。予約されたブロックに対しては、論理ブロックとの対応付けは行われない。
【0102】
各物理セグメントのATIは、M+1個のAT予約ブロックの物理アドレスを格納している。図10の場合、ATIP352は、N+1個の物理セグメントのそれぞれについてL+1個、すなわち、(N+1)(L+1)個のATI予約ブロックの物理アドレスと、1個の物理セグメントについてのM+1個のAT予約ブロックの物理アドレスと、1個の論理ブロックに対応した物理アドレスとを格納している。図10では、ATI予約ブロック384aにはATI354が格納されている。
【0103】
ATIP352は3種類のテーブルを有している。すなわち、物理ブロックと論理ブロックとの対応関係を示す第1のテーブルにおいては、論理ブロックと物理ブロックとが直接対応付けられており、論理ブロックそのものを0段ポインタと称することとする。AT予約ブロックのアドレスを示す第2のテーブルにおいては、ポインタとAT予約ブロックのアドレスとが対応付けられており、このポインタを1段ポインタと称することとする。ATI予約ブロックのアドレスを示す第3のテーブルにおいては、ポインタとATI予約ブロックのアドレスとが対応付けられており、このポインタを2段ポインタと称することとする。
【0104】
通常のデータを格納する論理ブロックに対応した物理ブロックにアクセスするためには、2段ポインタが用いられる。例えば、図10の場合に、物理セグメント1の物理ブロックにアクセスする際には、ATIP352において、例えばATI1_0と表記された2段ポインタに対応した物理ブロック2を参照してATIを読み出す。このATIにおいて、例えばAT1_0と表記されたポインタに対応した物理ブロック1を参照して、これに格納されたAT371を読み出す。このAT371は、物理セグメント1の現在有効なATであるので、これを参照すると、論理ブロックに対応した物理ブロックにアクセスすることができる。
【0105】
図11は、図10のデータを用いた1段ポインタによるアクセスについての説明図である。デバイス情報のように、比較的データの更新回数が少ない論理ブロックにアクセスするために、1段ポインタが用いられる。
【0106】
例えば、図11の場合に、物理セグメント0の物理ブロックにアクセスする際には、ATIP352において、例えばAT0_0と表記された1段ポインタに対応した物理ブロック1を参照して、これに格納されたAT370を読み出す。このAT370は、物理セグメント0の現在有効なATであるので、これを参照すると、論理ブロックに対応した物理ブロックにアクセスすることができる。
【0107】
図12は、図10のデータを用いた0段ポインタによるアクセスについての説明図である。ファームウェアデータのように、更新されることは少ないが、重要なデータを格納する論理ブロックにアクセスするために、0段ポインタが用いられる。
【0108】
例えば、図11の場合に、論理ブロック0にアクセスする際には、ATIP352において、例えば0段ポインタとして示された論理ブロック0に対応したセグメント1の物理ブロック4に直接アクセスすることができる。
【0109】
なお、0段ポインタで管理されている論理ブロックは、2段ポインタ又は1段ポインタを用いて参照されるATによっても管理される。これは、論理ブロックと対応していない物理ブロックの管理を物理セグメント単位で管理しているからである。
【0110】
図9の不揮発性記憶装置の書き込み時における処理について説明する。主な処理の流れは、図3を参照して説明したものと同様であるが、AT更新を行うステップにおける処理が異なる。
【0111】
図13は、図9の不揮発性記憶装置の書き込み時におけるATを更新するステップの処理の例を示すフローチャートである。図13において、ステップS32,S34,S40の処理は、図4を参照して説明したものと同じであり、ステップS150の処理は、図8を参照して説明したものと同じであるので、その説明を省略する。
【0112】
ステップS272では、コントローラ320は、書き込みを行う論理ブロックが1段ポインタで管理されている論理ブロック(1段ポインタブロック)であるか否かを判断する。1段ポインタで管理されている場合には、ステップS276に進み、その他の場合には、ステップS274に進む。
【0113】
ステップS274では、コントローラ320は、選択されたAT予約ブロックの物理アドレスでATIRAM332を更新する。
【0114】
ステップS276では、コントローラ320は、ステップS34で選択したAT予約ブロックの物理アドレスに応じてATIP352を更新する。
【0115】
ステップS278では、コントローラ320は、ステップS40の処理が正常終了したか否かを判断する。正常終了した場合は、ステップS280に進み、正常終了しなかった場合は、ステップS32に戻る。
【0116】
ステップS280では、コントローラ320は、書き込みを行う論理ブロックが0段ポインタで管理されている論理ブロック(0段ポインタブロック)であるか否かを判断する。0段ポインタで管理されている場合には、ステップS282に進み、その他の場合には、処理を終了する。
【0117】
ステップS282では、コントローラ320は、ATIP352の更新を行い、処理を終了する。
【0118】
このように、第3の実施形態の不揮発性記憶装置では、保持するデータの重要性や書き込み頻度に応じて、管理領域から物理ブロックへのリンク構成を変更することができる。すなわち、書き込み頻度の少ない論理セグメントを1段ポインタを用いて管理するので、第2の実施形態の場合に比べて、ATI予約ブロック数を減らすことが可能となる。また、更新頻度が少ないが重要なデータを0段ポインタを用いて管理するので、初期化時等に簡便な処理でデータを取得することが可能となり、開発工数の削減、初期化に要する時間の短縮を図ることができる。
【0119】
【発明の効果】
以上のように、本発明によると、不揮発性メモリの各物理ブロックに対する書き込み頻度を均等なものに近づけることができるので、不揮発性メモリの故障を防ぎ、これを用いる不揮発性記憶装置の寿命を伸ばすことができる。
【0120】
また、不揮発性メモリ内に論理データを管理するブロックが常に存在するので、供給される電源の電圧が低下しても論理データは破壊されないようにすることができる。
【図面の簡単な説明】
【図1】本発明の第1の実施形態に係る不揮発性記憶装置のブロック図である。
【図2】図1の不揮発性メモリが格納するデータの構成についての説明図である。
【図3】図1の不揮発性記憶装置の書き込み時における処理の例を示すフローチャートである。
【図4】図3のATを更新するステップにおける処理の例を示すフローチャートである。
【図5】本発明の第2の実施形態に係る不揮発性記憶装置のブロック図である。
【図6】図5の不揮発性メモリが格納するデータの構成についての説明図である。
【図7】図5の不揮発性記憶装置の書き込み時におけるATを更新するステップの処理の例を示すフローチャートである。
【図8】図7のATIの更新を行うステップにおける処理の例を示すフローチャートである。
【図9】本発明の第3の実施形態に係る不揮発性記憶装置のブロック図である。
【図10】図9の不揮発性メモリが格納するデータの構成についての説明図である。
【図11】図10のデータを用いた1段ポインタによるアクセスについての説明図である。
【図12】図10のデータを用いた0段ポインタによるアクセスについての説明図である。
【図13】図9の不揮発性記憶装置の書き込み時におけるATを更新するステップの処理の例を示すフローチャートである。
【図14】一般的な不揮発性記憶装置におけるデータ管理についての説明図である。
【図15】従来の不揮発性記憶装置の構成の例を示すブロック図である。
【図16】図15の不揮発性メモリの管理領域におけるデータ構造を示す説明図である。
【図17】図15の不揮発性記憶装置の書き込み時における処理の例を示すフローチャートである。
【符号の説明】
20,220,320 コントローラ
40,240,340 不揮発性メモリ
52,252,352 ATIP(第3のテーブル)
54,254,354 ATI(第2のテーブル)
70,270,370,371 AT(第1のテーブル)
82a,82b,282a,282b,382a,382b AT予約ブロック(第1の予約ブロック)
284a,384a ATI予約ブロック(第2の予約ブロック)[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a storage device having a rewritable nonvolatile memory, and more particularly to a technique for managing writing to the nonvolatile memory.
[0002]
[Prior art]
2. Description of the Related Art In recent years, as an external storage device for storing data used in an electronic device such as a computer, mainly a card-shaped storage device has been widely used. In such a storage device, a rewritable nonvolatile semiconductor memory is used.
[0003]
A flash memory is a typical rewritable nonvolatile semiconductor memory. In a flash memory, stored data is managed in units of blocks (physical blocks), and data is erased in units of blocks. Each block has a plurality of pages. A page is the minimum unit for reading and writing data in the flash memory. Generally, in a flash memory, erasing refers to a process of setting all bits to “1”, and writing refers to a process of setting a designated bit to “0”.
[0004]
Each page has a redundant portion separately from an area for storing data, and information relating to a logical address assigned to the page and a data correction code are stored in the redundant portion. Each page is assigned a unique physical address in the flash memory, and the control device of the flash memory controls processing by sending a command to the flash memory by designating the physical address.
[0005]
On the other hand, when a host such as a computer accesses data in a storage device, the host handles data in units of a data size called a sector. The host manages data stored in the flash memory in units of logical blocks having the same size as physical blocks. A logical block is generally composed of a plurality of sectors. A logical address, which is a logical order, is added to each sector, and the host controls processing by designating the logical address in the storage device.
[0006]
FIG. 14 is an explanatory diagram of data management in a general nonvolatile storage device. FIG. 14 shows the correspondence between the logical data configuration and the physical data configuration. The logical data configuration is a configuration of data specified by the host, and the physical data configuration is a configuration of data stored in the nonvolatile memory.
[0007]
The written logical block is managed in a one-to-one correspondence with the physical block in the flash memory (the unwritten logical block has no corresponding physical block). Q + 1 (Q is an integer of 0 or more) logical blocks constitute one logical segment. In addition, P + 1 physical blocks (P is an integer of 0 or more) constitute one physical segment.
[0008]
Here, each logical segment is assigned to one corresponding physical segment. Logical data constituting a certain logical segment is stored in an area managed as a specific physical segment (in general, Q <P because a physical block also has a bad block). Therefore, address translation information (hereinafter, referred to as AT; also referred to as logical-physical translation information) stored in the flash memory, which is correspondence information between logical blocks and physical blocks, is managed in physical segment units. become.
[0009]
FIG. 15 is a block diagram illustrating an example of a configuration of a conventional nonvolatile storage device. 15 includes a
[0010]
The
[0011]
The
[0012]
The
[0013]
FIG. 16 is an explanatory diagram showing a data structure in the
[0014]
FIG. 17 is a flowchart illustrating an example of processing at the time of writing in the nonvolatile storage device of FIG.
[0015]
When a data write command is sent from the
[0016]
In step S904, it is determined whether or not the AT data of the physical segment obtained in step S902 has already been read into the ATRAM 934. If the AT data has not been read, the process proceeds to step S906. If the AT data has already been read, the process proceeds to step S908.
[0017]
In step S906, the AT data corresponding to the obtained physical segment is read out to the
[0018]
In step S910, it is determined whether a corresponding physical block exists. If a corresponding physical block exists, the process proceeds to step S916. If there is no corresponding physical block, the process proceeds to step S912 because the corresponding physical block must be specified.
[0019]
In step S912, referring to the
[0020]
Subsequently, data is written to the allocated physical block. Since the non-volatile memory erases data in units of physical blocks, when overwriting data on a page to which data has already been written, it is necessary to first erase the data of the entire block. For this reason, in step S916, the data in the non-updated area in the physical block to be overwritten is read and temporarily saved in the
[0021]
In step S918, after erasing the data of the physical block to be overwritten, the data saved in step S916 and the data sent from the
[0022]
If it is determined in step S920 that the physical block has not been completed normally, it means that the physical block has become a bad block, and it is necessary to change the physical block corresponding to the specified logical address. Therefore, in step S922, similarly to step S912, the physical segment is searched to select a physical block that has not yet been assigned to a logical block. In step S924, the selected physical block is selected, as in step S914. Is associated with the logical block, and the
[0023]
A related technique is disclosed in, for example, Patent Document 1.
[0024]
[Patent Document 1]
JP 2001-142774 A
[0025]
[Problems to be solved by the invention]
As a feature of the flash memory, if the writing frequency of each block varies, the possibility that the block with the highest writing frequency will be destroyed increases. For this reason, when using the flash memory, data is written so that the writing / erasing frequency of each block is as even as possible, and access such as writing / erasing is not performed on the destroyed block. Need to be managed.
[0026]
In addition, since the processing time required for writing and erasing is long, the power supply is cut off during the writing or erasing processing, especially in a non-volatile storage device such as a memory card which is likely to be used in a portable device having an unstable power supply. Even if it occurs, measures must be taken to ensure data consistency in the flash memory.
[0027]
However, in the related art, a specific logical block may always be written only to the same physical block, such as a logical block to which FAT (file allocation table) information is written. Therefore, when the host performs a process of rewriting the same logical block many times, for example, updating the FAT information, etc., even though there is an unused physical block in the same physical segment, There has been a problem that only the number of times of writing of a specific physical block increases and the life of the flash memory is shortened.
[0028]
Conventionally, when the supply of the power supply voltage from the host is interrupted at the time of rewriting data (particularly, AT data), logical inconsistency of data stored in the nonvolatile memory occurs. Therefore, there is a high possibility that data cannot be correctly read out by the host, or data is destroyed by subsequent access.
[0029]
An object of the present invention is to prevent a failure of a nonvolatile memory and extend the life of a nonvolatile memory device using the same. It is another object of the present invention to prevent stored logic data from being destroyed even when a supply voltage is reduced in a nonvolatile memory device.
[0030]
[Means for Solving the Problems]
In order to solve the above-described problem, a unit implemented by the invention of claim 1 includes, as a nonvolatile storage device, a nonvolatile memory having a plurality of physical blocks, and a controller. A plurality of physical blocks are selected as first reserved blocks, and a first table showing a correspondence relationship between an input logical address and a physical address of the non-volatile memory is selected from one of the first reserved blocks. In the case where the second table indicating the physical addresses of the plurality of first reserved blocks is stored in the non-volatile memory and writing is performed in the non-volatile memory, the first table is stored in the non-volatile memory. After the rewriting, the first reserved block is replaced with a block different from the one storing the first table before the rewriting. It is intended to store the first table.
[0031]
According to the first aspect of the present invention, the first table that is frequently rewritten is not continuously written in the same physical block every time it is updated. Can be. Therefore, the failure probability of the nonvolatile memory device can be reduced.
[0032]
Further, in the invention according to
[0033]
According to the invention of
[0034]
According to a third aspect of the present invention, in the nonvolatile storage device according to the second aspect, the controller selects a plurality of the physical blocks as the second reserved blocks from the nonvolatile memory and stores the second table in the second table. Storing a third table indicating physical addresses of the plurality of second reserved blocks at a predetermined address in the nonvolatile memory; When the first reserved block is used, the second table is rewritten, and the second reserved block is different from the one in which the second table before rewriting is stored. The second table after rewriting is stored.
[0035]
According to the third aspect of the present invention, since the second table is not continuously written in the same physical block every time it is updated, the writing frequency of each physical block in the non-volatile memory can be made more uniform.
[0036]
According to a fourth aspect of the present invention, in the nonvolatile storage device according to the third aspect, the controller reads from the nonvolatile memory when writing to any of the second reserved blocks is performed a predetermined number of times or more. A plurality of the physical blocks are selected and used as a new second reserved block.
[0037]
According to the invention of claim 4, after the second reserved block is used a predetermined number of times, a new second reserved block is used. Therefore, the write frequency of the second reserved block is made substantially equal, and the second reserved block is written at a predetermined address. The writing frequency of the stored third table can be reduced.
[0038]
According to a fifth aspect of the present invention, in the nonvolatile storage device according to the third aspect, the controller adds the first and second tables to the third table, and It is stored at a predetermined address.
[0039]
According to the fifth aspect of the present invention, since the physical block storing the important data with a low update frequency can be directly accessed based on the description in the first table, the data can be easily processed at the time of initialization or the like. Thus, it is possible to shorten the initialization time.
[0040]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0041]
(1st Embodiment)
FIG. 1 is a block diagram of the nonvolatile memory device according to the first embodiment of the present invention. The
[0042]
The
[0043]
The
[0044]
The
[0045]
The
[0046]
The
[0047]
When initializing the
[0048]
FIG. 2 is an explanatory diagram of the configuration of data stored in the
[0049]
The
[0050]
FIG. 3 is a flowchart illustrating an example of processing at the time of writing in the nonvolatile storage device of FIG. 1. Each step in FIG. 3 will be described.
[0051]
In step S2, upon receiving a data write command from the
[0052]
In step S4, the
[0053]
In step S6, the
[0054]
Thereafter, in step S8, the
[0055]
In step S10, the
[0056]
In step S12, the
[0057]
In step S14, the
[0058]
In step S16, the
[0059]
In step S18, the
[0060]
In step S20, the
[0061]
In step S22, the
[0062]
In step S30, the
[0063]
FIG. 4 is a flowchart illustrating an example of the process in step S30 of updating the AT in FIG.
[0064]
First, in step S32, the
[0065]
If writing has been performed a predetermined number of times or more, an AT reserved block for storing an AT is newly set in order to make the writing frequency of the entire physical segment evenly close. Therefore, in step S34, the
[0066]
In step S36, the
[0067]
In step S38, the
[0068]
After that, in step S40, the
[0069]
In step S42, the
[0070]
As described above, according to the nonvolatile storage device of the first embodiment, a plurality of reserved blocks for writing AT data are used in the nonvolatile memory. Also, a physical block with a low writing frequency is selected as a reserved block. Since the data of the AT having a high rewriting frequency is not continuously written only in a specific physical block, the writing frequency of each physical block in the nonvolatile memory can be made closer to even. Further, the failure probability of the nonvolatile memory device can be reduced, and the life can be extended.
[0071]
In addition, when writing data from a host to a physical block, the nonvolatile storage device of the first embodiment updates the address translation table between the physical block and the logical block after the writing ends normally. For this reason, even if the supply voltage is reduced during the writing process or the power is cut off, the data before writing is valid, and data loss can be prevented. Therefore, a stable system can be constructed using this nonvolatile storage device.
[0072]
(Second embodiment)
In the second embodiment, a case will be described in which not only the AT but also the ATI is stored in any of a plurality of reserved blocks.
[0073]
FIG. 5 is a block diagram of the nonvolatile memory device according to the second embodiment of the present invention. The
[0074]
The
[0075]
The
[0076]
The
[0077]
The
[0078]
The
[0079]
FIG. 6 is an explanatory diagram of the configuration of data stored in the
[0080]
In each physical segment, M + 1 physical blocks are reserved as AT reserved blocks as blocks for storing the AT of the physical segment, and L + 1 (L is a natural number) a block for storing the ATI of the physical segment. ) Are reserved as ATI reserved blocks.
[0081]
In the case of FIG. 6, as shown in the table 270, in the
[0082]
Each ATI stores the physical addresses of M + 1 AT reserved blocks for each physical segment. The
[0083]
The processing at the time of writing in the nonvolatile memory device of FIG. 5 will be described. The main processing flow is the same as that described with reference to FIG. 3, but the processing in the step of performing the AT update is different.
[0084]
FIG. 7 is a flowchart illustrating an example of processing of a step of updating the AT at the time of writing in the nonvolatile storage device of FIG. In FIG. 7, the processing of steps S32, S34, S36, S40, and S42 is the same as that described with reference to FIG. In step S150, the
[0085]
FIG. 8 is a flowchart illustrating an example of the process in step S150 of updating the ATI in FIG.
[0086]
In step S152, as in step S32, the
[0087]
If writing has been performed a predetermined number of times or more, an AT reserved block for storing an AT is newly set in order to make the writing frequency of the entire physical segment evenly close. Therefore, in step S154, the
[0088]
In step S156, the
[0089]
In step S158, the
[0090]
Then, in step S160, the
[0091]
In step S162, the
[0092]
The
[0093]
In the nonvolatile memory device according to the second embodiment, not only the AT reserved block but also a plurality of ATI reserved blocks for writing ATI data are used in the nonvolatile memory. Also, a physical block with a low writing frequency is selected as a reserved block. Since the AT and ATI data with a high rewrite frequency are not continuously written only to specific physical blocks, the write frequency of each physical block of the non-volatile memory can be made closer to even. Further, the failure probability of the nonvolatile memory device can be reduced, and the life can be extended.
[0094]
(Third embodiment)
In the third embodiment, a case where a plurality of types of pointers are used will be described.
[0095]
FIG. 9 is a block diagram of a nonvolatile memory device according to the third embodiment of the present invention. 9 includes a
[0096]
The
[0097]
The
[0098]
When the
[0099]
FIG. 10 is an explanatory diagram of the configuration of data stored in the
[0100]
In each physical segment, M + 1 physical blocks are reserved as AT reserved blocks as blocks for storing the AT of the physical segment, and L + 1 physical blocks are stored as blocks for storing the ATI of the physical segment. It is reserved as an ATI reserved block.
[0101]
In the case of FIG. 10, as shown in the table 371, in the physical segment 1, the physical block 1, the physical block 3, and the like are reserved as AT reserved
[0102]
The ATI of each physical segment stores the physical addresses of M + 1 AT reserved blocks. In the case of FIG. 10, the
[0103]
[0104]
In order to access a physical block corresponding to a logical block that stores ordinary data, a two-stage pointer is used. For example, in the case of FIG. 10, when accessing the physical block of the physical segment 1, the
[0105]
FIG. 11 is an explanatory diagram of an access by a one-stage pointer using the data of FIG. A one-stage pointer is used to access a logical block in which the number of data updates is relatively small, such as device information.
[0106]
For example, in the case of FIG. 11, when accessing the physical block of the
[0107]
FIG. 12 is an explanatory diagram of an access by the 0-stage pointer using the data of FIG. A zero-stage pointer is used to access a logical block storing important data, which is rarely updated like firmware data.
[0108]
For example, in the case of FIG. 11, when accessing the
[0109]
Note that the logical block managed by the 0-stage pointer is also managed by the AT referenced using the 2-stage pointer or the 1-stage pointer. This is because the management of physical blocks that do not correspond to logical blocks is managed on a physical segment basis.
[0110]
The processing at the time of writing in the nonvolatile memory device of FIG. 9 will be described. The main processing flow is the same as that described with reference to FIG. 3, but the processing in the step of performing the AT update is different.
[0111]
FIG. 13 is a flowchart illustrating an example of processing of a step of updating the AT at the time of writing in the nonvolatile storage device of FIG. 9. In FIG. 13, the processing of steps S32, S34, and S40 is the same as that described with reference to FIG. 4, and the processing of step S150 is the same as that described with reference to FIG. Description is omitted.
[0112]
In step S272, the
[0113]
In step S274, the
[0114]
In step S276, the
[0115]
In step S278, the
[0116]
In step S280, the
[0117]
In step S282,
[0118]
As described above, in the nonvolatile storage device according to the third embodiment, the link configuration from the management area to the physical blocks can be changed in accordance with the importance of the retained data and the writing frequency. That is, since the logical segment with a low writing frequency is managed by using the one-stage pointer, the number of ATI reserved blocks can be reduced as compared with the second embodiment. In addition, important data that is updated infrequently but is managed using the 0-stage pointer can be obtained by simple processing at the time of initialization, etc., reducing development man-hours and reducing the time required for initialization. Shortening can be achieved.
[0119]
【The invention's effect】
As described above, according to the present invention, the frequency of writing to each physical block in the nonvolatile memory can be made closer to an equal value, so that the failure of the nonvolatile memory is prevented and the life of the nonvolatile memory device using the same is extended. be able to.
[0120]
Further, since there is always a block for managing logical data in the nonvolatile memory, it is possible to prevent the logical data from being destroyed even if the voltage of the supplied power decreases.
[Brief description of the drawings]
FIG. 1 is a block diagram of a nonvolatile memory device according to a first embodiment of the present invention.
FIG. 2 is an explanatory diagram illustrating a configuration of data stored in a nonvolatile memory of FIG. 1;
FIG. 3 is a flowchart illustrating an example of a process at the time of writing in the nonvolatile storage device of FIG.
FIG. 4 is a flowchart illustrating an example of a process in a step of updating an AT in FIG. 3;
FIG. 5 is a block diagram of a nonvolatile memory device according to a second embodiment of the present invention.
FIG. 6 is an explanatory diagram illustrating a configuration of data stored in a nonvolatile memory in FIG. 5;
FIG. 7 is a flowchart illustrating an example of processing of a step of updating an AT at the time of writing in the nonvolatile storage device of FIG. 5;
FIG. 8 is a flowchart illustrating an example of a process in a step of updating an ATI in FIG. 7;
FIG. 9 is a block diagram of a nonvolatile memory device according to a third embodiment of the present invention.
FIG. 10 is an explanatory diagram illustrating a configuration of data stored in a nonvolatile memory in FIG. 9;
FIG. 11 is an explanatory diagram of access by a one-stage pointer using the data of FIG. 10;
FIG. 12 is an explanatory diagram of an access by a 0-stage pointer using the data of FIG. 10;
13 is a flowchart illustrating an example of processing of a step of updating an AT at the time of writing in the nonvolatile storage device of FIG. 9;
FIG. 14 is an explanatory diagram of data management in a general nonvolatile storage device.
FIG. 15 is a block diagram illustrating an example of a configuration of a conventional nonvolatile storage device.
16 is an explanatory diagram showing a data structure in a management area of the nonvolatile memory in FIG.
FIG. 17 is a flowchart illustrating an example of a process at the time of writing in the nonvolatile storage device of FIG. 15;
[Explanation of symbols]
20, 220, 320 controller
40,240,340 Non-volatile memory
52,252,352 ATIP (third table)
54,254,354 ATI (second table)
70, 270, 370, 371 AT (first table)
82a, 82b, 282a, 282b, 382a, 382b AT reserved block (first reserved block)
284a, 384a ATI reserved block (second reserved block)
Claims (5)
コントローラとを備え、
前記コントローラは、
前記不揮発性メモリから前記物理ブロックを第1の予約ブロックとして複数選択し、入力された論理アドレスと前記不揮発性メモリの物理アドレスとの対応関係を示す第1のテーブルを前記第1の予約ブロックのうちのいずれか1つに格納させ、前記複数の第1の予約ブロックの物理アドレスを示す第2のテーブルを前記不揮発性メモリに格納させ、かつ、前記不揮発性メモリに書き込みを行う場合には、前記第1のテーブルを書き換え、前記第1の予約ブロックのうち、書き換え前の前記第1のテーブルが格納されていたものとは異なるものに、書き換え後の前記第1のテーブルを格納させるものである
不揮発性記憶装置。A non-volatile memory having a plurality of physical blocks,
With a controller,
The controller is
A plurality of physical blocks are selected from the nonvolatile memory as first reserved blocks, and a first table showing a correspondence between an input logical address and a physical address of the nonvolatile memory is stored in the first reserved block. When storing in any one of them, the second table indicating the physical addresses of the plurality of first reserved blocks is stored in the non-volatile memory, and writing to the non-volatile memory is performed, Rewriting the first table, and storing the rewritten first table in a different one of the first reserved blocks from the one storing the first table before rewriting. A non-volatile storage device.
前記コントローラは、
前記第1の予約ブロックのいずれにも書き込みが所定の回数以上行われると、前記不揮発性メモリから前記物理ブロックを複数選択して、新たな前記第1の予約ブロックとして用いるものである
ことを特徴とする不揮発性記憶装置。The nonvolatile storage device according to claim 1,
The controller is
When writing to any of the first reserved blocks is performed a predetermined number of times or more, a plurality of the physical blocks are selected from the nonvolatile memory and used as the new first reserved blocks. Nonvolatile storage device.
前記コントローラは、
前記不揮発性メモリから前記物理ブロックを第2の予約ブロックとして複数選択し、前記第2のテーブルを前記第2の予約ブロックのうちのいずれか1つに格納させ、前記複数の第2の予約ブロックの物理アドレスを示す第3のテーブルを前記不揮発性メモリの所定のアドレスに格納させ、かつ、新たな前記第1の予約ブロックを用いる場合には、前記第2のテーブルを書き換え、前記第2の予約ブロックのうち、書き換え前の前記第2のテーブルが格納されていたものとは異なるものに、書き換え後の前記第2のテーブルを格納させるものである
ことを特徴とする不揮発性記憶装置。The nonvolatile storage device according to claim 2,
The controller is
Selecting a plurality of the physical blocks from the nonvolatile memory as second reserved blocks, storing the second table in any one of the second reserved blocks, and selecting the plurality of second reserved blocks; In the case where a third table indicating the physical address of the non-volatile memory is stored at a predetermined address in the nonvolatile memory, and the new first reserved block is used, the second table is rewritten and the second table is rewritten. A non-volatile memory device, wherein a reserved block stores the second table after rewriting in a block different from the one in which the second table before rewriting is stored.
前記コントローラは、
前記第2の予約ブロックのいずれにも書き込みが所定の回数以上行われると、前記不揮発性メモリから前記物理ブロックを複数選択して、新たな前記第2の予約ブロックとして用いるものである
ことを特徴とする不揮発性記憶装置。The nonvolatile storage device according to claim 3,
The controller is
When writing to any of the second reserved blocks is performed a predetermined number of times or more, a plurality of the physical blocks are selected from the nonvolatile memory and used as a new second reserved block. Nonvolatile storage device.
前記コントローラは、
前記第3のテーブルに、前記第1及び第2のテーブルを加えて、前記不揮発性メモリの前記所定のアドレスに格納させるものである
ことを特徴とする不揮発性記憶装置。The nonvolatile storage device according to claim 3,
The controller is
The nonvolatile storage device according to claim 1, wherein the first table and the second table are added to the third table and stored at the predetermined address of the nonvolatile memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003024121A JP2004234473A (en) | 2003-01-31 | 2003-01-31 | Nonvolatile storage device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2003024121A JP2004234473A (en) | 2003-01-31 | 2003-01-31 | Nonvolatile storage device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004234473A true JP2004234473A (en) | 2004-08-19 |
Family
ID=32952745
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2003024121A Pending JP2004234473A (en) | 2003-01-31 | 2003-01-31 | Nonvolatile storage device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004234473A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006072441A (en) * | 2004-08-31 | 2006-03-16 | Sony Corp | Memory device and control method of nonvolatile memory |
JP2006209608A (en) * | 2005-01-31 | 2006-08-10 | Sony Corp | Memory control device, memory control method, and program |
JP2008009636A (en) * | 2006-06-28 | 2008-01-17 | Toshiba Microelectronics Corp | Storage device |
CN100425817C (en) * | 2004-08-31 | 2008-10-15 | 三菱电机株式会社 | On-vehicle electronic control unit |
JP2016071447A (en) * | 2014-09-26 | 2016-05-09 | ラピスセミコンダクタ株式会社 | Nonvolatile storage and control method thereof |
US9442843B2 (en) | 2012-11-29 | 2016-09-13 | Canon Kabushiki Kaisha | Information processing apparatus, method of controlling the same, and storage medium |
US9852746B2 (en) | 2014-02-17 | 2017-12-26 | Canon Kabushiki Kaisha | Information processing apparatus, method of controlling the same, program and storage medium |
-
2003
- 2003-01-31 JP JP2003024121A patent/JP2004234473A/en active Pending
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006072441A (en) * | 2004-08-31 | 2006-03-16 | Sony Corp | Memory device and control method of nonvolatile memory |
CN100425817C (en) * | 2004-08-31 | 2008-10-15 | 三菱电机株式会社 | On-vehicle electronic control unit |
JP4561246B2 (en) * | 2004-08-31 | 2010-10-13 | ソニー株式会社 | Memory device |
JP2006209608A (en) * | 2005-01-31 | 2006-08-10 | Sony Corp | Memory control device, memory control method, and program |
JP4665539B2 (en) * | 2005-01-31 | 2011-04-06 | ソニー株式会社 | MEMORY CONTROL DEVICE, MEMORY CONTROL METHOD, PROGRAM |
JP2008009636A (en) * | 2006-06-28 | 2008-01-17 | Toshiba Microelectronics Corp | Storage device |
US9442843B2 (en) | 2012-11-29 | 2016-09-13 | Canon Kabushiki Kaisha | Information processing apparatus, method of controlling the same, and storage medium |
US9852746B2 (en) | 2014-02-17 | 2017-12-26 | Canon Kabushiki Kaisha | Information processing apparatus, method of controlling the same, program and storage medium |
JP2016071447A (en) * | 2014-09-26 | 2016-05-09 | ラピスセミコンダクタ株式会社 | Nonvolatile storage and control method thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6477616B1 (en) | Storage device, storage system, memory management method, recording medium, and computer data signal | |
US5717886A (en) | Semiconductor disk device and memory management method | |
JP5440883B2 (en) | Moving sectors in blocks in flash memory | |
CN111414315B (en) | Method for managing a memory device and related memory device | |
US8478796B2 (en) | Uncorrectable error handling schemes for non-volatile memories | |
KR100843135B1 (en) | Apparatus and method for managing nonvolatile memory | |
US8312554B2 (en) | Method of hiding file at data protecting mode for non-volatile memory module, memory controller and portable memory storage apparatus | |
US9058296B2 (en) | Data processing method, memory storage device and memory control circuit unit | |
US20110231597A1 (en) | Data access method, memory controller and memory storage system | |
KR100608602B1 (en) | Flash memory, Mapping controlling apparatus and method for the same | |
JP2006048893A (en) | Flash memory device with defective block managing function and defective block managing method of the same | |
JP2005196736A (en) | Address mapping method of flash memory, mapping information management method, and flash memory using same methods | |
WO1999044113A9 (en) | Increasing the memory performance of flash memory devices by writing sectors simultaneously to multiple flash memory devices | |
JP3421581B2 (en) | Storage device using nonvolatile semiconductor memory | |
JP2004234473A (en) | Nonvolatile storage device | |
JPH07153284A (en) | Non-volatile semiconductor memory and its control method | |
US7899974B2 (en) | Nonvolatile memory, mapping control apparatus and method of the same | |
JP3976764B2 (en) | Semiconductor disk device | |
US10559359B2 (en) | Method for rewriting data in nonvolatile memory and semiconductor device | |
JP5491201B2 (en) | Semiconductor recording apparatus and semiconductor recording system | |
JP2008299455A (en) | Data storage device and data management method | |
KR20050009045A (en) | Memory device and error correction method using flash memory | |
CN111596859B (en) | Data storage device and data processing method | |
US7996598B2 (en) | Memory management module | |
JP2005339450A (en) | Data management method for flash memory |