JP2010067284A - Control method of memory system - Google Patents

Control method of memory system Download PDF

Info

Publication number
JP2010067284A
JP2010067284A JP2009296094A JP2009296094A JP2010067284A JP 2010067284 A JP2010067284 A JP 2010067284A JP 2009296094 A JP2009296094 A JP 2009296094A JP 2009296094 A JP2009296094 A JP 2009296094A JP 2010067284 A JP2010067284 A JP 2010067284A
Authority
JP
Japan
Prior art keywords
block
time
blocks
memory system
erase
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.)
Granted
Application number
JP2009296094A
Other languages
Japanese (ja)
Other versions
JP4703764B2 (en
Inventor
Shinichi Sugano
伸一 菅野
Hirokuni Yano
浩邦 矢野
Toshikatsu Hida
敏克 檜田
Kazuya Kitsunai
和也 橘内
Junji Yano
純二 矢野
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2009296094A priority Critical patent/JP4703764B2/en
Publication of JP2010067284A publication Critical patent/JP2010067284A/en
Application granted granted Critical
Publication of JP4703764B2 publication Critical patent/JP4703764B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a control method of a memory system by which a service life can be prolonged by suppressing a concentration of write in a certain specific region in a nonvolatile memory. <P>SOLUTION: The control method of a memory system 1 includes a nonvolatile memory 10 comprising a plurality of blocks as a unit of data erasure. The method includes steps of: measuring erasure timing in which data of each block were erased; creating, for each block, a block table 30B in which a status value indicating a free state or an occupant state is associated with the erasure timing; detecting the block in which write is concentrated on a short-term basis; selecting a first block whose erasure timing is stale in the free state on the basis of information in the block table; selecting a second block, whose erasure timing is stale in the occupant state on the basis of information in the block table; and moving data of the second block to the first block in the case that the first block is included in the detected blocks. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、メモリシステムの制御方法に係り、例えばNAND型フラッシュメモリを備えたメモリシステムの制御方法に関する。   The present invention relates to a method for controlling a memory system, for example, a method for controlling a memory system including a NAND flash memory.

近年、不揮発性半導体メモリは、大型コンピュータから、パーソナルコンピュータ、家電製品、携帯電話等、様々な用途で利用されている。この不揮発性半導体メモリの一種としては、電気的に書き換えが可能であり、不揮発性、大容量化、高集積化が可能なNAND型フラッシュメモリが知られている。近年では、このNAND型フラッシュメモリは、ハードディスクドライブ(HDD)の置き換えとしても考えられている。   In recent years, nonvolatile semiconductor memories have been used in various applications such as large computers, personal computers, home appliances, and mobile phones. As one type of the nonvolatile semiconductor memory, a NAND flash memory that is electrically rewritable and can be nonvolatile, has a large capacity, and is highly integrated is known. In recent years, this NAND flash memory is also considered as a replacement for a hard disk drive (HDD).

NAND型フラッシュメモリは、書き込みを行う前に消去処理が必要な不揮発性半導体メモリであり、その寿命は、書き換え回数に依存している。NAND型フラッシュメモリのデータの書き込み/消去は、基板−制御ゲート間に高電圧を印加することにより、電荷蓄積層(例えば、浮遊ゲート)に電子を注入/放出させる。これを多数回行うと浮遊ゲート周りのゲート酸化膜が劣化してしまい、浮遊ゲートに注入した電子が時間の経過とともに抜けていき、結果として、データが破壊されてしまう可能性がある。すなわち、書き換え回数が増えると、書き換えをしてからデータを保持(リテンション)できる期間が短くなってしまう(リテンション特性の低下)。   The NAND flash memory is a non-volatile semiconductor memory that needs to be erased before writing, and its lifetime depends on the number of rewrites. In writing / erasing data in the NAND flash memory, electrons are injected / released into / from a charge storage layer (for example, a floating gate) by applying a high voltage between the substrate and the control gate. If this is performed many times, the gate oxide film around the floating gate is deteriorated, and electrons injected into the floating gate are lost over time. As a result, data may be destroyed. That is, as the number of rewrites increases, the period during which data can be retained (retention) after rewriting is shortened (retention characteristics are degraded).

また、パーソナルコンピュータ等が記録するデータは、時間的局所性、及び領域的局所性を兼ね備えている(非特許文献1参照)。そのため、データを記録する際に外部から指定されたアドレスにそのまま記録していくと、特定の領域に短期間に書き換え、すなわち消去処理が集中し、消去回数の偏りが大きくなる。   In addition, data recorded by a personal computer or the like has both temporal locality and regional locality (see Non-Patent Document 1). For this reason, if data is recorded as it is at an address designated from the outside as it is, rewriting, that is, erasing processing concentrates in a specific area in a short time, and the bias of the number of erasures becomes large.

一方で、NAND型フラッシュメモリの寿命は、消去処理の間隔にも依存しており、その間隔が長いほどリテンション特性が良く、寿命が延びることが確認されている(非特許文献2参照)。これは、消去間隔が短いとリテンション特性が悪く、寿命が損なわれることも示している。また、短い間隔で書き込みを行ったとしても、相応の長期間消去処理を行わなければリテンション特性が回復することも確認されている(非特許文献3参照)。   On the other hand, the lifetime of the NAND flash memory also depends on the interval of the erasing process, and it has been confirmed that the longer the interval, the better the retention characteristics and the longer the lifetime (see Non-Patent Document 2). This also indicates that if the erasing interval is short, the retention characteristics are poor and the lifetime is impaired. It has also been confirmed that even if writing is performed at a short interval, the retention characteristic is restored unless an erasing process is performed for a corresponding long period of time (see Non-Patent Document 3).

David A. Patterson and John L. Hennessy, “Computer Organization and Design: The Hardware/Software Interface”, Morgan Kaufmann Pub, 2004/8/31David A. Patterson and John L. Hennessy, “Computer Organization and Design: The Hardware / Software Interface”, Morgan Kaufmann Pub, 31 August 2004 Neal Mielke et al., “Flash EEPROM Threshold Instabilities due to Charge Trapping During Program/Erase Cycling”, IEEE TRANSACTIONS ON DEVICE AND MATERIALS RELIABILITY, VOL. 4, NO. 3, SEPTEMBER 2004, PP.335-344Neal Mielke et al., “Flash EEPROM Threshold Instabilities due to Charge Trapping During Program / Erase Cycling”, IEEE TRANSACTIONS ON DEVICE AND MATERIALS RELIABILITY, VOL. 4, NO. 3, SEPTEMBER 2004, PP.335-344 Neal Mielke et al., “Recovery Effects in the Distributed Cycling of Flash Memories”, 44th Annual International Reliability Physics Symposium, San Jose, 2006, PP.29-35Neal Mielke et al., “Recovery Effects in the Distributed Cycling of Flash Memories”, 44th Annual International Reliability Physics Symposium, San Jose, 2006, PP.29-35

本発明は、不揮発性メモリのある特定領域に書き換えが集中するのを抑制することで、寿命を延ばすことが可能なメモリシステムの制御方法を提供する。   The present invention provides a control method of a memory system that can extend the lifetime by suppressing rewriting from being concentrated on a specific area of a nonvolatile memory.

本発明の一視点に係るメモリシステムの制御方法は、データ消去の単位であるブロックを複数個有する不揮発性メモリを含むメモリシステムの制御方法であって、各ブロックのデータが消去された消去時期を計測する工程と、ブロックごとに、空き状態或いは使用中状態を示す状態値と前記消去時期とを対応付けるブロックテーブルを作成する工程と、
短期的に書き換えが集中したブロックを検出する工程と、前記ブロックテーブルの情報に基づいて、空き状態かつ消去時期が古い第1のブロックを選択する工程と、前記ブロックテーブルの情報に基づいて、使用中状態かつ消去時期が古い第2のブロックを選択する工程と、前記第1のブロックが前記検出されたブロックに含まれる場合に、前記第2のブロックのデータを前記第1のブロックに移動する工程とを具備する。
A memory system control method according to an aspect of the present invention is a memory system control method including a nonvolatile memory having a plurality of blocks, which are data erasing units. A step of measuring, and a step of creating a block table for associating a state value indicating an empty state or an in-use state with the erasing time for each block;
A step of detecting a block in which rewriting is concentrated in the short term, a step of selecting a first block having an empty state and an erasure time based on the information of the block table, and a use based on the information of the block table A step of selecting a second block that is in an intermediate state and has an erasing time; and if the detected first block is included in the detected block, the data of the second block is moved to the first block. A process.

本発明によれば、不揮発性メモリのある特定領域に書き換えが集中するのを抑制することで、寿命を延ばすことが可能なメモリシステムの制御方法を提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the control method of the memory system which can extend a lifetime can be provided by suppressing that rewriting concentrates on a certain area | region of a non-volatile memory.

本発明の第1の実施形態に係るメモリシステム1を備えた計算機システムの一例を示す概略図。1 is a schematic diagram showing an example of a computer system including a memory system 1 according to a first embodiment of the present invention. 第1の実施形態に係るメモリシステム1の構成を示す概略図。1 is a schematic diagram showing a configuration of a memory system 1 according to a first embodiment. NAND型フラッシュメモリ10に含まれる1個のブロックの構成を示す回路図。1 is a circuit diagram showing a configuration of one block included in a NAND flash memory 10. FIG. NANDコントローラ11の構成の一例を示すブロック図。FIG. 2 is a block diagram showing an example of the configuration of a NAND controller 11. ブロック制御部30及び消去時期計測部31の構成を示すブロック図。The block diagram which shows the structure of the block control part 30 and the erasure | elimination time measurement part 31. FIG. NANDコントローラ11による一連の書き込み動作を示すフローチャート。5 is a flowchart showing a series of write operations by the NAND controller 11. NANDコントローラ11によるブロック解放処理を示すフローチャート。5 is a flowchart showing block release processing by the NAND controller 11. 割当ブロック選択部32の構成を示すブロック図。The block diagram which shows the structure of the allocation block selection part 32. FIG. 割当ブロック選択部32による割当ブロック選択処理を示すフローチャート。5 is a flowchart showing an allocation block selection process by an allocation block selection unit 32. NANDコントローラ11によるブロック割当処理を示すフローチャート。5 is a flowchart showing block allocation processing by the NAND controller 11. NANDコントローラ11によるブロック消去処理を示すフローチャート。7 is a flowchart showing block erase processing by the NAND controller 11; 短期書き換え検出部34の構成を示すブロック図。The block diagram which shows the structure of the short-term rewriting detection part 34. FIG. 短期書き換え検出部34による短期書き換え検出処理を示すフローチャート。The flowchart which shows the short-term rewriting detection process by the short-term rewriting detection part 34. FIG. 短期書き換え検出処理の具体例を説明する図。The figure explaining the specific example of a short-term rewriting detection process. 平準化部35の構成を示すブロック図。FIG. 3 is a block diagram showing a configuration of a leveling unit 35. NANDコントローラ11による平準化処理を示すフローチャート。5 is a flowchart showing leveling processing by the NAND controller 11. 入替元ブロック選択部33の構成を示すブロック図。The block diagram which shows the structure of the replacement | exchange source block selection part 33. FIG. 入替元ブロック選択部33による入替元ブロック選択処理を示すフローチャート。The flowchart which shows the replacement | exchange source block selection process by the replacement | exchange source block selection part 33. FIG. 本発明の第2の実施形態に係る割当ブロック選択部32の構成を示すブロック図。The block diagram which shows the structure of the allocation block selection part 32 which concerns on the 2nd Embodiment of this invention. 第2の実施形態に係る割当ブロック選択部32による割当ブロック選択処理を示すフローチャート。The flowchart which shows the allocation block selection process by the allocation block selection part 32 which concerns on 2nd Embodiment. 本発明の第3の実施形態に係る入替元ブロック選択部33の構成を示すブロック図。The block diagram which shows the structure of the replacement | exchange source block selection part 33 which concerns on the 3rd Embodiment of this invention. 第3の実施形態に係る入替元ブロック選択部33による入替元ブロック選択処理を示すフローチャート。The flowchart which shows the replacement | exchange source block selection process by the replacement | exchange source block selection part 33 which concerns on 3rd Embodiment. 本発明の第4の実施形態に係る短期書き換え検出部34の構成を示すブロック図。The block diagram which shows the structure of the short-term rewrite detection part 34 which concerns on the 4th Embodiment of this invention. 短期書き換え検出部34による短期書き換え検出処理を示すフローチャート。The flowchart which shows the short-term rewriting detection process by the short-term rewriting detection part 34. FIG. 図24に続く短期書き換え検出処理を示すフローチャート。The flowchart which shows the short-term rewrite detection process following FIG. 短期書き換え検出処理の具体例を説明する図。The figure explaining the specific example of a short-term rewriting detection process. 本発明の第5の実施形態に係るNANDコントローラ11の構成の一例を示すブロック図。The block diagram which shows an example of a structure of the NAND controller 11 which concerns on the 5th Embodiment of this invention. ブロック制御部30の構成を示すブロック図。FIG. 2 is a block diagram showing a configuration of a block control unit 30. NANDコントローラ11による読み出し動作を示すフローチャート。7 is a flowchart showing a read operation by the NAND controller 11. 入替元ブロック選択部33による入替元ブロック選択処理を示すフローチャート。The flowchart which shows the replacement | exchange source block selection process by the replacement | exchange source block selection part 33. FIG. 実施例に係るSSD1の構成を示すブロック図。The block diagram which shows the structure of SSD1 which concerns on an Example. ドライブ制御回路102の構成を示すブロック図。FIG. 3 is a block diagram showing a configuration of a drive control circuit 102. プロセッサ108の構成を示すブロック図。FIG. 2 is a block diagram showing a configuration of a processor 108. SSD100を搭載したポータブルコンピュータの一例を示す斜視図。The perspective view which shows an example of the portable computer carrying SSD100.

以下、本発明の実施の形態について図面を参照して説明する。なお、以下の説明において、同一の機能及び構成を有する要素については、同一符号を付し、重複説明は必要な場合にのみ行う。   Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, elements having the same function and configuration are denoted by the same reference numerals, and redundant description will be given only when necessary.

[第1の実施形態]
本実施形態のメモリシステムは、例えば、ホスト装置が実装されたプリント基板上に実装され、バスを介してホスト装置との間でデータの転送を行う。或いは、本実施形態のメモリシステムは、ホスト装置に対して着脱可能なように構成され、ホスト装置に接続された状態でバスを介してホスト装置との間でデータの転送を行う。図1は、本実施形態のメモリシステム1を備えた計算機システムの一例を示す概略図である。
[First Embodiment]
The memory system of this embodiment is mounted on, for example, a printed circuit board on which a host device is mounted, and transfers data to and from the host device via a bus. Alternatively, the memory system of this embodiment is configured to be detachable from the host device, and transfers data to and from the host device via the bus while being connected to the host device. FIG. 1 is a schematic diagram illustrating an example of a computer system including a memory system 1 according to the present embodiment.

計算機システムは、中央演算処理装置(CPU:central processing unit)2、DRAM(dynamic random access memory)等のメインメモリ3、メインメモリ3を制御するメモリコントローラ4、及び本実施形態のメモリシステム1を備えている。CPU2、メインメモリ3、及びメモリシステム1は、互いに、アドレスを扱うアドレスバス5、及びデータを扱うデータバス6を介して接続されている。   The computer system includes a central processing unit (CPU) 2, a main memory 3 such as a DRAM (dynamic random access memory), a memory controller 4 that controls the main memory 3, and the memory system 1 of the present embodiment. ing. The CPU 2, the main memory 3, and the memory system 1 are connected to each other via an address bus 5 that handles addresses and a data bus 6 that handles data.

このような計算機システムでは、CPU2からの転送要求(読出要求、或いは書込要求)に応じて、書込要求であればCPU2のデータ(外部から入力されたデータを含む)、或いはメインメモリ3のデータがメモリシステム1に転送され、読出要求であればメモリシステム1のデータがCPU2、或いはメインメモリ3に転送される。   In such a computer system, in response to a transfer request (read request or write request) from the CPU 2, if it is a write request, the data of the CPU 2 (including data input from the outside) or the main memory 3 Data is transferred to the memory system 1. If it is a read request, the data of the memory system 1 is transferred to the CPU 2 or the main memory 3.

メモリシステム1は、不揮発性半導体メモリの一種であるNAND型フラッシュメモリ10、及びこのNAND型フラッシュメモリ10を制御するNANDコントローラ11を備えている。以下に、メモリシステム1の構成の一例について説明する。   The memory system 1 includes a NAND flash memory 10 that is a kind of nonvolatile semiconductor memory, and a NAND controller 11 that controls the NAND flash memory 10. Hereinafter, an example of the configuration of the memory system 1 will be described.

[1.メモリシステム1の構成]
図2は、メモリシステム1の構成を示す概略図である。メモリシステム1は、NAND型フラッシュメモリ10、及びNANDコントローラ11を備えている。NANDコントローラ11は、ホストインターフェース回路(ホストI/F)21、演算処理装置(MPU:micro processing unit)22、ROM(read only memory)23、RAM(random access memory)24、及びNANDインターフェース回路(NAND I/F)25を備えている。
[1. Configuration of Memory System 1]
FIG. 2 is a schematic diagram showing the configuration of the memory system 1. The memory system 1 includes a NAND flash memory 10 and a NAND controller 11. The NAND controller 11 includes a host interface circuit (host I / F) 21, a processing unit (MPU: micro processing unit) 22, a ROM (read only memory) 23, a RAM (random access memory) 24, and a NAND interface circuit (NAND I / F) 25.

ホストインターフェース回路21は、所定のプロトコルに従って、NANDコントローラ11とホスト装置(CPU2、メインメモリ3)との間のインターフェース処理を行う。   The host interface circuit 21 performs interface processing between the NAND controller 11 and the host device (CPU 2, main memory 3) according to a predetermined protocol.

MPU22は、メモリシステム1全体の動作を制御する。MPU22は、例えば、メモリシステム1が電源供給を受けたときに、ROM23に格納されているファームウェア(制御プログラム)をRAM24上に読み出して所定の処理を実行することにより、各種のテーブルをRAM24上に作成する。また、MPU22は、ホスト装置から書込要求、読出要求、消去要求を受け、これらの要求に応じてNAND型フラッシュメモリ10に所定の処理を実行する。   The MPU 22 controls the operation of the entire memory system 1. For example, when the memory system 1 is supplied with power, the MPU 22 reads the firmware (control program) stored in the ROM 23 onto the RAM 24 and executes predetermined processing to store various tables on the RAM 24. create. In addition, the MPU 22 receives a write request, a read request, and an erase request from the host device, and executes predetermined processing on the NAND flash memory 10 in response to these requests.

ROM23は、MPU22により制御される制御プログラム等を格納する。RAM24は、MPU22の作業エリアとして使用され、ROM23からロードされた制御プログラムや各種テーブルを記憶する。NANDインターフェース回路25は、所定のプロトコルに従って、NANDコントローラ11とNAND型フラッシュメモリ10との間のインターフェース処理を行う。   The ROM 23 stores a control program and the like controlled by the MPU 22. The RAM 24 is used as a work area for the MPU 22 and stores control programs and various tables loaded from the ROM 23. The NAND interface circuit 25 performs interface processing between the NAND controller 11 and the NAND flash memory 10 according to a predetermined protocol.

NAND型フラッシュメモリ10は、データ消去の最小単位であるブロックを複数個配列して構成されている。図3は、NAND型フラッシュメモリ10に含まれる1個のブロックの構成を示す回路図である。各ブロックは、X方向に沿って順に配列された(m+1)個のNANDストリングを備えている(mは、0以上の整数)。(m+1)個のNANDストリングにそれぞれ含まれる選択トランジスタST1は、ドレインがビット線BL0〜BLmに接続され、ゲートが選択ゲート線SGDに共通接続されている。また、(m+1)個のNANDストリングにそれぞれ含まれる選択トランジスタST2は、ソースがソース線SLに共通接続され、ゲートが選択ゲート線SGSに共通接続されている。   The NAND flash memory 10 is configured by arranging a plurality of blocks which are the minimum unit of data erasure. FIG. 3 is a circuit diagram showing a configuration of one block included in the NAND flash memory 10. Each block includes (m + 1) NAND strings arranged in order along the X direction (m is an integer of 0 or more). The select transistors ST1 included in each of (m + 1) NAND strings have drains connected to the bit lines BL0 to BLm and gates commonly connected to the select gate line SGD. The selection transistors ST2 included in each of the (m + 1) NAND strings have a source commonly connected to the source line SL and a gate commonly connected to the selection gate line SGS.

各メモリセルトランジスタMTは、半導体基板上に形成された積層ゲート構造を備えたMOSFET(metal oxide semiconductor field effect transistor)から構成される。積層ゲート構造は、半導体基板上に、ゲート絶縁膜、電荷蓄積層(浮遊ゲート電極)、ゲート間絶縁膜、制御ゲート電極が順に積層されて構成されている。メモリセルトランジスタMTは、浮遊ゲート電極に蓄えられる電子の数に応じて閾値電圧が変化し、この閾値電圧の違いに応じてデータを記憶する。メモリセルトランジスタMTは、2値(1ビット)を記憶するように構成されていてもよいし、多値(2ビット以上のデータ)を記憶するように構成されていてもよい。   Each memory cell transistor MT is composed of a MOSFET (metal oxide semiconductor field effect transistor) having a stacked gate structure formed on a semiconductor substrate. The stacked gate structure is configured by sequentially stacking a gate insulating film, a charge storage layer (floating gate electrode), an inter-gate insulating film, and a control gate electrode on a semiconductor substrate. In the memory cell transistor MT, the threshold voltage changes according to the number of electrons stored in the floating gate electrode, and data is stored according to the difference in threshold voltage. The memory cell transistor MT may be configured to store a binary value (1 bit), or may be configured to store a multi-value (data of 2 bits or more).

また、メモリセルトランジスタMTは、浮遊ゲート電極を有する構造に限らず、MONOS(metal-oxide-nitride-oxide-silicon)型など、電荷蓄積層としての窒化膜界面に電子をトラップさせることで閾値調整可能な構造であってもよい。MONOS構造のメモリセルトランジスタMTについても同様に、1ビットを記憶するように構成されていてもよいし、多値(2ビット以上のデータ)を記憶するように構成されていてもよい。   In addition, the memory cell transistor MT is not limited to a structure having a floating gate electrode, and the threshold is adjusted by trapping electrons at the nitride film interface as a charge storage layer such as a MONOS (metal-oxide-nitride-oxide-silicon) type. Possible structures may be used. Similarly, the memory cell transistor MT having the MONOS structure may be configured to store 1 bit, or may be configured to store multiple values (data of 2 bits or more).

各NANDストリングにおいて、(n+1)個のメモリセルトランジスタMTは、選択トランジスタST1のソースと選択トランジスタST2のドレインとの間に、それぞれの電流経路が直列接続されるように配置されている(nは、0以上の整数)。すなわち、(n+1)個のメモリセルトランジスタMTは、隣接するもの同士で拡散領域(ソース領域若しくはドレイン領域)を共有するような形でY方向に直列接続される。   In each NAND string, (n + 1) memory cell transistors MT are arranged such that their current paths are connected in series between the source of the select transistor ST1 and the drain of the select transistor ST2 (n is , An integer greater than or equal to 0). That is, (n + 1) memory cell transistors MT are connected in series in the Y direction so that adjacent ones share a diffusion region (source region or drain region).

そして、最もドレイン側に位置するメモリセルトランジスタMTから順に、制御ゲート電極がワード線WL0〜WLnにそれぞれ接続されている。従って、ワード線WL0に接続されたメモリセルトランジスタMTのドレインは選択トランジスタST1のソースに接続され、ワード線WLnに接続されたメモリセルトランジスタMTのソースは選択トランジスタST2のドレインに接続されている。   The control gate electrodes are connected to the word lines WL0 to WLn in order from the memory cell transistor MT located closest to the drain side. Therefore, the drain of the memory cell transistor MT connected to the word line WL0 is connected to the source of the selection transistor ST1, and the source of the memory cell transistor MT connected to the word line WLn is connected to the drain of the selection transistor ST2.

ワード線WL0〜WLnは、ブロック内のNANDストリング間で、メモリセルトランジスタMTの制御ゲート電極を共通に接続している。つまり、ブロック内において同一行にあるメモリセルトランジスタMTの制御ゲート電極は、同一のワード線WLに接続される。この同一のワード線WLに接続される(m+1)個のメモリセルトランジスタMTは1ページとして取り扱われ、このページごとにデータの書き込み及びデータの読み出しが行われる。   The word lines WL0 to WLn connect the control gate electrodes of the memory cell transistors MT in common between the NAND strings in the block. That is, the control gate electrodes of the memory cell transistors MT in the same row in the block are connected to the same word line WL. The (m + 1) memory cell transistors MT connected to the same word line WL are handled as one page, and data writing and data reading are performed for each page.

また、ビット線BL0〜BLmは、ブロック間で、選択トランジスタST1のドレインを共通接続している。つまり、複数のブロック内において同一列にあるNANDストリングは、同一のビット線BLに接続される。   The bit lines BL0 to BLm commonly connect the drains of the selection transistors ST1 between the blocks. That is, NAND strings in the same column in a plurality of blocks are connected to the same bit line BL.

本発明の各実施形態における各機能ブロックは、ハードウェア、及びソフトウェアのいずれか、又は両者の組み合わせとして実現することができる。このため、各機能ブロックは、これらのいずれでもあることが明確となるように、概してそれらの機能の観点から以下に説明される。このような機能が、ハードウェアとして実現されるか、又はソフトウェアとして実現されるかは、具体的な実施態様、或いはシステム全体に課される設計制約に依存する。当業者は、具体的な実施態様ごとに、様々な方法でこれらの機能を実現し得るが、そのような実現を決定することは本発明の範疇に含まれる。   Each functional block in each embodiment of the present invention can be realized as either hardware or software, or a combination of both. For this reason, each functional block is generally described below in terms of their function so that it is clear that they are any of these. Whether such a function is realized as hardware or software depends on a specific embodiment or a design constraint imposed on the entire system. Those skilled in the art can implement these functions in various ways for each specific embodiment, and determining such implementation is within the scope of the invention.

以下に、NANDコントローラ11のより具体的な構成の一例について説明する。図4は、本実施形態におけるNANDコントローラ11の構成の一例を示すブロック図である。   Hereinafter, an example of a more specific configuration of the NAND controller 11 will be described. FIG. 4 is a block diagram showing an example of the configuration of the NAND controller 11 in the present embodiment.

NANDコントローラ11は、ブロック制御部30、消去時期計測部31、割当ブロック選択部32、入替元ブロック選択部33、短期書き換え検出部34、平準化部35、及びNANDインターフェース回路(NAND I/F)25を備えている。   The NAND controller 11 includes a block control unit 30, an erase time measurement unit 31, an allocation block selection unit 32, a replacement source block selection unit 33, a short-term rewrite detection unit 34, a leveling unit 35, and a NAND interface circuit (NAND I / F). 25.

消去時期計測部31は、NAND型フラッシュメモリ10に含まれる各ブロックのデータが消去されるごとに、当該ブロックの消去時期を計測する。そして、消去時期計測部31は、この計測した消去時期をブロック制御部30に送る。   Each time the data of each block included in the NAND flash memory 10 is erased, the erase time measuring unit 31 measures the erase time of the block. Then, the erase time measuring unit 31 sends the measured erase time to the block control unit 30.

ブロック制御部30は、ブロックごとに、消去回数や消去時期等を含む各種情報を管理する。また、ブロック制御部30は、CPU2からの転送要求に応じて、NAND型フラッシュメモリ10に対して書込要求、読出要求、及び消去要求を発行する。具体的には、ブロック制御部30は、後述するアドレステーブル30A、及びブロックテーブル30Bを備えており、これらのテーブルを利用して、NAND型フラッシュメモリ10に書込要求、読出要求、及び消去要求を発行する。   The block control unit 30 manages various types of information including the number of times of erasure and the erasure time for each block. The block control unit 30 issues a write request, a read request, and an erase request to the NAND flash memory 10 in response to a transfer request from the CPU 2. Specifically, the block control unit 30 includes an address table 30A and a block table 30B, which will be described later, and using these tables, a write request, a read request, and an erase request are sent to the NAND flash memory 10. Issue.

割当ブロック選択部32は、例えば外部(CPU2、或いはメインメモリ3等)から供給される新たなデータをNAND型フラッシュメモリ10に書き込む際に、この書き込みに割り当てるブロック(以下、割当ブロックという)を選択する。すなわち、割当ブロック選択部32は、ブロックテーブル30Bに記憶されている全ブロックの情報(全ブロック情報)をブロック制御部30から受け、所定の条件に従って割当ブロックを選択する。そして、割当ブロック選択部32は、この割当ブロックに対応するブロック番号(割当ブロック番号)をブロック制御部30に送る。また、割当ブロック選択部32は、全ブロック情報のうち割当ブロックに対応する情報(割当ブロック情報)を平準化部35に送る。なお、NAND型フラッシュメモリ10に書き込まれるデータとしては、メモリシステム1の外部から供給されるユーザデータの他に、メモリシステム1内部の管理に必要なシステムデータ等も存在する。   The allocation block selection unit 32 selects a block (hereinafter referred to as an allocation block) to be allocated for writing when new data supplied from the outside (CPU 2 or main memory 3 or the like) is written in the NAND flash memory 10, for example. To do. That is, the allocation block selection unit 32 receives information on all blocks (all block information) stored in the block table 30B from the block control unit 30, and selects an allocation block according to a predetermined condition. Then, the allocation block selection unit 32 sends a block number (allocation block number) corresponding to the allocation block to the block control unit 30. Also, the allocation block selection unit 32 sends information (allocation block information) corresponding to the allocation block among all block information to the leveling unit 35. The data written to the NAND flash memory 10 includes system data and the like necessary for management inside the memory system 1 in addition to user data supplied from the outside of the memory system 1.

平準化部35は、後述する平準化処理を実行する。そして、平準化部35は、この平準化処理に伴い、NAND型フラッシュメモリ10に対して書込要求、読出要求、及び消去要求を発行する。なお、平準化とは、ブロックの消去回数を揃えること(いわゆる、ウェアレベリング:wear leveling)を意味する。このように、ブロックの消去回数を揃えることで、一部のブロックへ消去処理が集中するのを防ぐことができるため、NAND型フラッシュメモリ10の寿命を延ばすことが可能となる。   The leveling unit 35 executes a leveling process to be described later. Then, the leveling unit 35 issues a write request, a read request, and an erase request to the NAND flash memory 10 in accordance with the leveling process. The leveling means that the number of block erasures is made uniform (so-called wear leveling). In this way, by aligning the number of block erases, it is possible to prevent the erase process from concentrating on a part of the blocks, so that the lifetime of the NAND flash memory 10 can be extended.

入替元ブロック選択部33は、平準化部35による平準化処理に使用される、データ入れ替え元のブロック(以下、入替元ブロックという)を選択する。すなわち、入替元ブロック選択部33は、全ブロック情報をブロック制御部30から受け、所定の条件に従って入替元ブロックを選択する。そして、入替元ブロック選択部33は、全ブロック情報のうち入替元ブロックに対応する情報(入替元ブロック情報)を平準化部35に送る。   The replacement source block selection unit 33 selects a data replacement source block (hereinafter referred to as a replacement source block) that is used in the leveling process by the leveling unit 35. That is, the replacement source block selection unit 33 receives all block information from the block control unit 30 and selects a replacement source block according to a predetermined condition. Then, the replacement source block selection unit 33 sends information corresponding to the replacement source block (replacement source block information) among all the block information to the leveling unit 35.

NANDインターフェース回路25は、ブロック制御部30及び平準化部35から、書込要求、読出要求、及び消去要求を受ける。そして、NANDインターフェース回路25は、これらの要求に応じて、NAND型フラッシュメモリ10に対してデータの書き込み、読み出し、及び消去を行うように指示する。   The NAND interface circuit 25 receives a write request, a read request, and an erase request from the block control unit 30 and the leveling unit 35. The NAND interface circuit 25 instructs the NAND flash memory 10 to write, read, and erase data in response to these requests.

短期書き換え検出部34は、頻繁に(短期間で)書き換えが行われているブロック(すなわち、消去間隔が短いブロック)を検出する。短期間で書き換えが行われているブロックはその消去時期が頻繁に更新される(消去時期が新しくなる)が、短期間で書き換えが行われていないブロックはその消去時期が古いままである。本実施形態では、これらの消去時期の差を利用して、短期間で書き換えが行われているブロックを検出する。このために、短期書き換え検出部34は、使用中状態のブロックを消去時期順に整列(ソート)し、ある探索対象ブロックと、この探索対象ブロックの次に消去時期が新しい比較対象ブロックとの消去時期の差を算出する。そして、この消去時期の差が所定の閾値を越えていた場合に、消去時期が比較対象ブロックより新しいブロックを、短期間で書き換えが行われているブロックであると判定する。この判定結果は、短期書き換え情報としてブロック制御部30に送られる。   The short-term rewrite detector 34 detects a block that is frequently rewritten (in a short period of time) (that is, a block with a short erase interval). The erasure time of blocks that have been rewritten in a short period is frequently updated (the erasure time becomes new), but the blocks that have not been rewritten in a short period of time remain old. In the present embodiment, a block in which rewriting is performed in a short period is detected using the difference between these erase times. For this reason, the short-term rewrite detection unit 34 sorts the blocks in use in order of the erasure time, and erases a certain search target block and a comparison target block having a new erasure time next to this search target block. Calculate the difference. If the difference in erase time exceeds a predetermined threshold, it is determined that the block whose erase time is newer than the comparison target block is a block that has been rewritten in a short period of time. This determination result is sent to the block control unit 30 as short-term rewrite information.

図5は、ブロック制御部30及び消去時期計測部31の構成を示すブロック図である。ブロック制御部30は、アドレステーブル30A、ブロックテーブル30B、及び演算部30Cを備えている。ブロック制御部30は、外部から供給されるアドレスや各種情報を受け、これらの情報に基づいてアドレステーブル30A及びブロックテーブル30Bを更新する。   FIG. 5 is a block diagram illustrating the configuration of the block control unit 30 and the erase time measurement unit 31. The block control unit 30 includes an address table 30A, a block table 30B, and a calculation unit 30C. The block control unit 30 receives an address and various information supplied from the outside, and updates the address table 30A and the block table 30B based on the information.

アドレステーブル30Aは、ホスト装置(CPU2)からアドレスバス5を介して送られるアドレスを含むアドレス領域(論理ブロックアドレス)と、このアドレス領域に対応する、NAND型フラッシュメモリ10内のブロックの番号(物理ブロックアドレス)との対応関係を示す。このアドレステーブル30Aを用いることで、ブロック制御部30は、ホスト装置から送られるアドレスを含むアドレス領域のデータがどのブロックに対応するかを特定することができる。このアドレステーブル30Aは、例えば、後述するブロック解放処理、ブロック割当処理に伴い更新される。   The address table 30A includes an address area (logical block address) including an address sent from the host device (CPU 2) via the address bus 5, and a block number (physical address) in the NAND flash memory 10 corresponding to the address area. Correspondence relationship with block address). By using this address table 30A, the block control unit 30 can specify which block the data in the address area including the address sent from the host device corresponds to. This address table 30A is updated, for example, with block release processing and block allocation processing described later.

ブロックテーブル30Bは、ブロック番号ごとに、アドレステーブル30Aにブロック番号が登録されていないか(空き状態であるか)、アドレステーブル30Aにブロック番号が登録されているか(使用中状態であるか)を示すブロックの状態と、データが消去された回数(消去回数)と、消去時期計測部31から送られる消去時期と、短期書き換え検出部34から送られる短期書き換え情報に対応した短期書き換えフラグ(図5には、単に「フラグ」と記載している)と、を情報として格納する。このブロックテーブル30Bは、例えば、後述するブロック解放処理、ブロック割当処理、ブロック消去処理、及び短期書き換え検出処理に伴い更新される。ブロックテーブル30Bに含まれる全ブロック情報は、割当ブロック選択部32、入替元ブロック選択部33、及び短期書き換え検出部34に送られる。   The block table 30B indicates, for each block number, whether the block number is registered in the address table 30A (whether it is empty) or whether the block number is registered in the address table 30A (whether it is in use). The state of the block shown, the number of times data has been erased (erase count), the erase time sent from the erase time measuring unit 31, and the short-term rewrite flag corresponding to the short-term rewrite information sent from the short-term rewrite detector 34 (FIG. 5) Is simply described as “flag”) as information. The block table 30B is updated with, for example, a block release process, a block allocation process, a block erase process, and a short-term rewrite detection process, which will be described later. All block information included in the block table 30B is sent to the allocation block selection unit 32, the replacement source block selection unit 33, and the short-term rewrite detection unit 34.

ブロックが空き状態であれば、NAND型フラッシュメモリ10内部で当該ブロックに対して実際に消去が行われたか否かに係わらず、当該ブロックに対応するアドレス領域は、ホスト装置から見ると、データが格納されていない空き領域であると認識される。一方、ブロックが使用中状態であれば、当該ブロックに対応するアドレス領域は、ホスト装置から見ると、データが格納されている使用中領域であると認識される。   If the block is in an empty state, the address area corresponding to the block is viewed from the host device regardless of whether the block is actually erased in the NAND flash memory 10 or not. Recognized as a free area that is not stored. On the other hand, if the block is in use, the address area corresponding to the block is recognized as a busy area in which data is stored when viewed from the host device.

なお、実際には、これらアドレステーブル30A及びブロックテーブル30Bは、RAM24、或いは、RAM24及びNAND型フラッシュメモリ10の両方に格納されている。但し、NAND型フラッシュメモリ10に不揮発に格納されたアドレステーブル30A及びブロックテーブル30Bは、必ずしもRAM24を更新した都度更新を行う必要はない。   In practice, the address table 30A and the block table 30B are stored in the RAM 24 or both the RAM 24 and the NAND flash memory 10. However, the address table 30A and the block table 30B stored in the NAND flash memory 10 in a nonvolatile manner are not necessarily updated every time the RAM 24 is updated.

演算部30Cは、NAND型フラッシュメモリ10のデータが消去されるごとに、ブロックテーブル30Bに含まれる、消去が行われたブロックの消去回数を1カウントアップする。なお、実際には、演算部30Cの処理は、MPU22により行われる。   Each time the data in the NAND flash memory 10 is erased, the arithmetic unit 30C increments the erase count of the erased block included in the block table 30B by one. In practice, the processing of the arithmetic unit 30C is performed by the MPU 22.

ブロック制御部30は、割当ブロック選択部32から割当ブロック番号を受ける。そして、この割当ブロック番号を用いて、アドレステーブル30Aのブロック番号を更新する。また、ブロック制御部30は、この割当ブロックに対する書込要求をNAND型フラッシュメモリ10に対して発行する。さらに、ブロック制御部30は、外部からのアドレスに応じた通常の読出要求、及び消去要求をNAND型フラッシュメモリ10に対して発行する。   The block control unit 30 receives an allocation block number from the allocation block selection unit 32. Then, the block number of the address table 30A is updated using the allocated block number. Further, the block control unit 30 issues a write request for this allocation block to the NAND flash memory 10. Further, the block control unit 30 issues a normal read request and an erase request corresponding to an external address to the NAND flash memory 10.

消去時期計測部31は、消去回数をカウントする消去回数カウンタ31A、及び消去回数カウンタ31Aのカウント値を更新する演算部31Bを備えている。消去時期計測部31は、NAND型フラッシュメモリ10内のブロックに対して消去処理が行われた回数を計測し、この計測された回数を消去時期として出力する。   The erase time measuring unit 31 includes an erase number counter 31A that counts the number of erases, and a calculation unit 31B that updates the count value of the erase number counter 31A. The erase time measuring unit 31 measures the number of times the erase process has been performed on the block in the NAND flash memory 10 and outputs the measured number as the erase time.

具体的には、演算部31Bは、いずれかのブロックが消去されるごとに、消去回数カウンタ31Aを1カウントアップする。消去回数カウンタ31Aのカウント値(消去番号)は、消去時期としてブロック制御部30(具体的には、ブロックテーブル30B)に送られる。この例の消去時期計測部31では、消去番号が小さいほど消去時期が古くなる。なお、実際には、演算部31Bの処理は、MPU22により行われる。   Specifically, every time any block is erased, the arithmetic unit 31B increments the erase count counter 31A by one. The count value (erase number) of the erase count counter 31A is sent to the block controller 30 (specifically, the block table 30B) as the erase time. In the erase time measuring unit 31 of this example, the erase time becomes older as the erase number is smaller. Actually, the processing of the calculation unit 31B is performed by the MPU 22.

消去時期としては、この他に、消去処理が行われた時刻(消去時刻)や、NANDコントローラ11の通電時間等を用いるようにしてもよい。消去時刻を消去時期として用いる場合は、消去時期計測部31が時計を備え、消去処理が行われるごとに、その時刻を消去時期として出力する。通電時間を消去時期として用いる場合は、消去時期計測部31がタイマーを備え、消去処理が行われるごとに、それまでの通電時間を計測し、その通電時間を消去時期として出力する。このように、消去時期として、消去回数、消去時刻、及び通電時間のいずれを用いるかは、任意に選択することが可能である。なお、消去時期が特定可能な情報であれば、上記3種類以外を用いることも可能である。   In addition to this, the time at which the erasing process is performed (erasing time), the energization time of the NAND controller 11 and the like may be used. When using the erasing time as the erasing time, the erasing time measuring unit 31 includes a clock and outputs the time as the erasing time every time the erasing process is performed. When the energizing time is used as the erasing time, the erasing time measuring unit 31 includes a timer, and whenever the erasing process is performed, the energizing time until then is measured and the energizing time is output as the erasing time. As described above, it is possible to arbitrarily select any one of the number of times of erasing, the erasing time, and the energizing time as the erasing time. Note that it is possible to use information other than the above three types as long as it is information that can specify the erasing time.

[2.NANDコントローラ11の書き込み動作]
次に、NANDコントローラ11の書き込み動作について説明する。図6は、NANDコントローラ11による一連の書き込み動作を示すフローチャートである。
[2. Write Operation of NAND Controller 11]
Next, the write operation of the NAND controller 11 will be described. FIG. 6 is a flowchart showing a series of write operations by the NAND controller 11.

まず、NANDコントローラ11は、CPU2から書込要求を受けることで、書き込み動作を開始する(ステップS10)。続いて、ブロック制御部30は、アドレステーブル30Aを用いて、書込要求のアドレスを含むアドレス領域に対して、ブロック番号が登録されている(ブロックが割り当てられている)か否かを判定する(ステップS11)。ブロック番号が登録されている(ブロックが割り当てられている)場合、このアドレス領域に対してデータの上書きを行う必要があるため、ブロック制御部30は、上記ブロック番号に対応するブロックを解放するブロック解放処理を実行する(ステップS12)。   First, the NAND controller 11 receives a write request from the CPU 2 and starts a write operation (step S10). Subsequently, the block control unit 30 uses the address table 30A to determine whether or not a block number is registered (a block is allocated) for the address area including the address of the write request. (Step S11). When a block number is registered (a block is allocated), it is necessary to overwrite data in this address area, so the block control unit 30 releases a block corresponding to the block number. A release process is executed (step S12).

ステップS11においてブロック番号が登録されていない(ブロックが割り当てられていない)と判定された場合、或いはステップS12においてブロック解放処理が実行された後、割当ブロック選択部32は、上記アドレス領域に割り当てるブロック(割当ブロック)を選択する割当ブロック選択処理を実行する(ステップS13)。   When it is determined in step S11 that the block number is not registered (block is not allocated), or after the block release process is executed in step S12, the allocation block selecting unit 32 allocates blocks to the address area. An allocation block selection process for selecting (allocation block) is executed (step S13).

続いて、平準化部35及び入替元ブロック選択部33は、平準化処理を実行する(ステップS14)。続いて、ブロック制御部30は、平準化処理において、割当ブロックの入れ替えを行ったか否かを判定する(ステップS15)。割当ブロックの入れ替えを行った場合、ステップS13に戻って、割当ブロック選択部32は、再度、割当ブロック選択処理を実行する。   Subsequently, the leveling unit 35 and the replacement source block selecting unit 33 execute a leveling process (step S14). Subsequently, the block control unit 30 determines whether or not the allocation block has been replaced in the leveling process (step S15). When the allocation block is exchanged, the process returns to step S13, and the allocation block selection unit 32 executes the allocation block selection process again.

ステップS15において割当ブロックの入れ替えを行っていないと判定された場合、ブロック制御部30は、割当ブロックに対応するブロック番号(割当ブロック番号)を用いて、アドレステーブル30A及びブロックテーブル30Bを更新するために、ブロック割当処理を実行する(ステップS16)。続いて、ブロック制御部30は、割当ブロックに対してブロック消去処理を実行する(ステップS17)。   When it is determined in step S15 that the allocation block has not been replaced, the block control unit 30 uses the block number (allocation block number) corresponding to the allocation block to update the address table 30A and the block table 30B. Next, block allocation processing is executed (step S16). Subsequently, the block control unit 30 executes block erasure processing on the allocated block (step S17).

続いて、ブロック制御部30は、データが消去された割当ブロックに、新たなデータを書き込む(ステップS18)。すなわち、ブロック制御部30は、NANDインターフェース回路25に書込要求を発行する。この書込要求に基づいて、NANDインターフェース回路25は、NAND型フラッシュメモリ10に、割当ブロックへ新たなデータを書き込むように指示する。   Subsequently, the block control unit 30 writes new data to the allocation block from which the data has been erased (step S18). That is, the block control unit 30 issues a write request to the NAND interface circuit 25. Based on this write request, the NAND interface circuit 25 instructs the NAND flash memory 10 to write new data to the allocation block.

続いて、短期書き換え検出部34は、短期書き換え検出処理を実行する(ステップS19)。そして、ブロック制御部30は、短期書き換え検出部34から送られる短期書き換え情報を用いて、ブロックテーブル30Bのフラグを更新する。このようにして、NANDコントローラ11によって一連の書き込み動作が実行される。   Subsequently, the short-term rewrite detection unit 34 executes a short-term rewrite detection process (step S19). Then, the block control unit 30 updates the flag of the block table 30B using the short-term rewrite information sent from the short-term rewrite detection unit 34. In this way, a series of write operations are executed by the NAND controller 11.

以下に、書き込み動作に含まれる各処理について具体的に説明する。
[2−1.ブロック解放処理]
図7は、NANDコントローラ11によるブロック解放処理を示すフローチャートである。ブロック制御部30は、アドレステーブル30Aに含まれる、書込要求のアドレスを含むアドレス領域に対応するブロック番号を、未割り当ての状態(未割当状態)に設定する(ステップS20)。続いて、ブロック制御部30は、ブロックテーブル30Bに含まれる、上記ブロック番号の状態を、空き状態に設定する(ステップS21)。ブロック解放処理において新たに空き状態に設定されたブロックを、以下、解放ブロックという。以後、NANDコントローラ11は、解放ブロックに新たなデータを書き込むことが可能となる。
Hereinafter, each process included in the write operation will be specifically described.
[2-1. Block release processing]
FIG. 7 is a flowchart showing block release processing by the NAND controller 11. The block control unit 30 sets the block number corresponding to the address area including the address of the write request included in the address table 30A to an unallocated state (unallocated state) (step S20). Subsequently, the block control unit 30 sets the state of the block number included in the block table 30B to an empty state (step S21). A block newly set in an empty state in the block release process is hereinafter referred to as a release block. Thereafter, the NAND controller 11 can write new data to the release block.

[2−2.割当ブロック選択処理]
図8は、割当ブロック選択部32の構成を示すブロック図である。図9は、割当ブロック選択部32による割当ブロック選択処理を示すフローチャートである。
[2-2. Allocation block selection process]
FIG. 8 is a block diagram illustrating a configuration of the allocation block selection unit 32. FIG. 9 is a flowchart showing allocation block selection processing by the allocation block selection unit 32.

割当ブロック選択部32は、2個のセレクタ32A及び32Bを備えている。割当ブロック選択部32は、ブロック制御部30から全ブロック情報を受ける(ステップS30)。この全ブロック情報は、セレクタ32Aに送られる。続いて、セレクタ32Aは、全ブロックの状態を確認し、全ブロックのうち空き状態のブロックを抽出する(ステップS31)。そして、セレクタ32Aは、空き状態のブロックに対応するブロック情報(空き状態ブロック情報)をセレクタ32Bに送る。   The allocation block selection unit 32 includes two selectors 32A and 32B. The allocation block selection unit 32 receives all block information from the block control unit 30 (step S30). This all block information is sent to the selector 32A. Subsequently, the selector 32A confirms the state of all blocks, and extracts an empty block from all blocks (step S31). Then, the selector 32A sends block information (empty state block information) corresponding to the free block to the selector 32B.

続いて、セレクタ32Bは、セレクタ32Aにより抽出されたブロックのうち、消去時期が最も古いブロックを割当ブロックとして選択する(ステップS32)。この割当ブロックに対応する割当ブロック番号は、ブロック制御部30に送られる。また、この割当ブロックに対応する割当ブロック情報は、平準化部35に送られる。   Subsequently, the selector 32B selects a block with the oldest erase time among the blocks extracted by the selector 32A as an allocation block (step S32). The allocation block number corresponding to this allocation block is sent to the block control unit 30. Also, the allocation block information corresponding to this allocation block is sent to the leveling unit 35.

[2−3.ブロック割当処理]
図10は、NANDコントローラ11によるブロック割当処理を示すフローチャートである。NANDコントローラ11は、割当ブロック選択部32により選択された割当ブロックに対して、アドレステーブル30A及びブロックテーブル30Bの情報を更新する。
[2-3. Block allocation process]
FIG. 10 is a flowchart showing block allocation processing by the NAND controller 11. The NAND controller 11 updates the information in the address table 30A and the block table 30B with respect to the allocation block selected by the allocation block selection unit 32.

まず、ブロック制御部30は、割当ブロック選択部32から割当ブロック番号を受ける(ステップS40)。続いて、ブロック制御部30は、アドレステーブル30Aに含まれる書込要求のアドレスを含むアドレス領域に対して、割当ブロックのブロック番号を設定する(ステップS41)。続いて、ブロック制御部30は、ブロックテーブル30Bに含まれる割当ブロックの状態を、使用中状態に設定する(ステップS42)。このようにして、割当ブロック選択部32により選択された割当ブロックが空き状態から使用中状態に設定変更される。   First, the block control unit 30 receives an allocation block number from the allocation block selection unit 32 (step S40). Subsequently, the block control unit 30 sets the block number of the allocation block for the address area including the address of the write request included in the address table 30A (step S41). Subsequently, the block control unit 30 sets the state of the allocation block included in the block table 30B to a busy state (step S42). In this way, the setting of the allocation block selected by the allocation block selection unit 32 is changed from the empty state to the in-use state.

[2−4.ブロック消去処理]
図11は、NANDコントローラ11によるブロック消去処理を示すフローチャートである。ブロック制御部30は、NANDインターフェース回路25に、割当ブロックに対する消去要求を発行する(ステップS50)。この消去要求に基づいて、NANDインターフェース回路25は、NAND型フラッシュメモリ10に、割当ブロックのデータを消去するように指示する(ステップS51)。続いて、消去時期計測部31(具体的には、演算部31B)は、消去回数カウンタ31Aのカウント値(消去番号)を1カウントアップする(ステップS52)。
[2-4. Block erase processing]
FIG. 11 is a flowchart showing block erase processing by the NAND controller 11. The block control unit 30 issues an erase request for the allocation block to the NAND interface circuit 25 (step S50). Based on this erase request, the NAND interface circuit 25 instructs the NAND flash memory 10 to erase the data in the allocation block (step S51). Subsequently, the erase time measurement unit 31 (specifically, the calculation unit 31B) increments the count value (erase number) of the erase count counter 31A by 1 (step S52).

続いて、ブロック制御部30は、ブロックテーブル30Bに含まれる、データが消去された割当ブロックに対応する消去回数及び消去時期を更新する(ステップS53)。具体的には、ブロック制御部30は、消去時期計測部31から送られる消去時期を用いて、ブロックテーブル30Bに含まれる、割当ブロックのブロック番号に対応する消去時期を更新する。また、演算部30Cは、ブロックテーブル30Bに含まれる、割当ブロックのブロック番号に対応する消去回数を1カウントアップする。   Subsequently, the block control unit 30 updates the number of times of erasure and the erasure time corresponding to the allocation block from which data has been erased, included in the block table 30B (step S53). Specifically, the block control unit 30 updates the erase time corresponding to the block number of the allocated block included in the block table 30B, using the erase time sent from the erase time measuring unit 31. The arithmetic unit 30C increments the number of erasures corresponding to the block number of the allocation block included in the block table 30B by one.

[2−5.短期書き換え検出処理]
図12は、短期書き換え検出部34の構成を示すブロック図である。短期書き換え検出部34は、セレクタ34A、整列部34B、探索リスト34C、判定部34D、消去時期間隔閾値を格納する記憶部34E、及び情報出力部34Fを備えている。
[2-5. Short-term rewrite detection process]
FIG. 12 is a block diagram illustrating a configuration of the short-term rewrite detection unit 34. The short-term rewrite detection unit 34 includes a selector 34A, an alignment unit 34B, a search list 34C, a determination unit 34D, a storage unit 34E that stores an erase time interval threshold, and an information output unit 34F.

セレクタ34Aは、ブロック制御部30から送られる全ブロック情報を用いて、全ブロックの状態を確認し、全ブロックのうち使用中状態のブロックを抽出する。整列部34Bは、使用中状態のブロックを消去時期順に整列(ソート)する。探索リスト34Cは、ソートされたブロック情報を一時的に格納する。なお、実際には、この探索リスト34Cは、RAM24に格納されている。   The selector 34A confirms the state of all blocks using all block information sent from the block control unit 30, and extracts a block in use from all blocks. The alignment unit 34B arranges (sorts) the blocks in use in order of erasure time. The search list 34C temporarily stores the sorted block information. In practice, the search list 34C is stored in the RAM 24.

判定部34Dは、探索リスト34Cの中で、消去時期が最も新しいブロックを「探索対象ブロック」、消去時期が探索対象ブロックの次に新しいブロックを「比較対象ブロック」として選択する。さらに、判定部34Dは、探索対象ブロックと比較対象ブロックとの消去時期の差を算出し、この差が消去時期間隔閾値を超えているか否かを判定する。そして、この判定結果に基づいて、消去時期が急激に変化する境界を探索する。   In the search list 34C, the determination unit 34D selects the block having the latest erase time as the “search target block” and the block having the newest erase time after the search target block as the “comparison target block”. Furthermore, the determination unit 34D calculates a difference in erase time between the search target block and the comparison target block, and determines whether or not this difference exceeds the erase time interval threshold. Based on this determination result, a boundary where the erasing time changes rapidly is searched.

情報出力部34Fは、判定部34Dから送られる判定結果(比較対象ブロックの番号)を用いて、全ブロックのうち比較対象ブロックより消去時期が新しいブロックの範囲を算出する。そして、情報出力部34Fは、上記範囲を短期書き換え情報としてブロック制御部30に送る。   The information output unit 34F uses the determination result (number of the comparison target block) sent from the determination unit 34D to calculate a range of blocks whose erasure time is newer than the comparison target block among all the blocks. And the information output part 34F sends the said range to the block control part 30 as short-term rewriting information.

記憶部34Eに格納される消去時期間隔閾値は、頻繁に書き換えが行われているブロックの範囲を特定するために使用され、また、NAND型フラッシュメモリ10の寿命(或いは、データリテンション期間)をどの程度延ばすかという基準に基づいて設定される。消去時期間隔閾値を低くすると短期書き換え検出の可能性が上がり、一方、消去時期間隔閾値を高くすると短期書き換え検出の可能性が下がる。すなわち、消去時期間隔閾値を低くすると平準化処理の回数が増え、一方、消去時期間隔閾値を高くすると平準化処理の回数が減ることになる。この平準化処理は、ブロックのデータ消去処理を伴う。   The erase time interval threshold value stored in the storage unit 34E is used to specify the range of blocks that are frequently rewritten, and also determines the life (or data retention period) of the NAND flash memory 10. It is set on the basis of whether to extend the extent. Lowering the erase time interval threshold increases the possibility of short-term rewrite detection, while increasing the erase time interval threshold decreases the possibility of short-term rewrite detection. That is, when the erase time interval threshold is lowered, the number of leveling processes increases, while when the erase time interval threshold is raised, the number of leveling processes decreases. This leveling process is accompanied by a block data erasing process.

データを消去するごとに、NAND型フラッシュメモリ10のリテンション特性は悪化する(すなわち、寿命が短くなる)。一方、消去間隔が長くなると、NAND型フラッシュメモリ10のリテンション特性が回復していく。すなわち、短い間隔で消去処理が連続して行われた場合には、リテンション特性の回復時間が確保できないため、NAND型フラッシュメモリ10の寿命が短くなってしまう。そこで、本実施形態では、頻繁に書き換えが行われているブロックに対して短期書き換えフラグを立てることで、これらのブロックを平準化の対象にしている。そして、消去間隔を所定時間長くすることでどの程度寿命が回復するかを示す、NAND型フラッシュメモリ10の特性を加味した上で、平準化処理の対象となるブロック、及び平準化の回数が最適化されるように、消去時期間隔閾値が決定される。   Each time data is erased, the retention characteristics of the NAND flash memory 10 deteriorate (that is, the lifetime becomes shorter). On the other hand, as the erase interval becomes longer, the retention characteristic of the NAND flash memory 10 is restored. That is, when the erasing process is continuously performed at a short interval, the recovery time of the retention characteristic cannot be secured, so that the life of the NAND flash memory 10 is shortened. Therefore, in the present embodiment, these blocks are targeted for leveling by setting a short-term rewrite flag for blocks that are frequently rewritten. Then, taking into account the characteristics of the NAND flash memory 10 indicating how long the lifetime is restored by extending the erase interval by a predetermined time, the block to be leveled and the number of times of leveling are optimal. The erasure time interval threshold is determined so that

図13は、短期書き換え検出部34による短期書き換え検出処理を示すフローチャートである。まず、短期書き換え検出部34は、ブロック制御部30から全ブロック情報を受ける(ステップS60)。この全ブロック情報は、セレクタ34Aに送られる。続いて、セレクタ34Aは、全ブロックの状態を確認し、全ブロックのうち使用中状態のブロックを抽出する(ステップS61)。そして、セレクタ34Aは、使用中状態のブロックに対応するブロック情報(使用中状態ブロック情報)を整列部34Bに送る。   FIG. 13 is a flowchart showing short-term rewrite detection processing by the short-term rewrite detection unit 34. First, the short-term rewrite detector 34 receives all block information from the block controller 30 (step S60). This all block information is sent to the selector 34A. Subsequently, the selector 34A confirms the state of all the blocks, and extracts a block in use among all the blocks (step S61). Then, the selector 34A sends block information (in-use state block information) corresponding to the in-use block to the alignment unit 34B.

続いて、整列部34Bは、使用中状態ブロック情報に含まれる消去時期を確認し、使用中状態のブロックを消去時期順にソートする(ステップS62)。そして、整列部34Bによりソートされたブロック情報は、探索リスト34Cに入れられる。   Subsequently, the aligning unit 34B confirms the erase time included in the in-use state block information, and sorts the in-use blocks in the order of the erase time (step S62). Then, the block information sorted by the sorting unit 34B is put in the search list 34C.

続いて、判定部34Dは、探索リスト34Cの中で、消去時期が最も新しいブロックを探索対象ブロック、消去時期が探索対象ブロックの次に新しいブロックを比較対象ブロックとして選択する(ステップS63)。   Subsequently, in the search list 34C, the determination unit 34D selects a block with the latest erase time as a search target block, and selects a block with the newest erase time after the search target block as a comparison target block (step S63).

続いて、判定部34Dは、探索対象ブロックと比較対象ブロックとの消去時期の差を算出する(ステップS64)。続いて、判定部34Dは、上記算出した消去時期の差が、消去時期間隔閾値を超えているか否かを判定する(ステップS65)。消去時期間隔閾値を超えていない場合、判定部34Dは、探索リスト34Cの中に2個以上のブロックが残っているか否かを判定する(ステップS66)。2個以上のブロックが残っている場合、判定部34Dは、探索対象ブロックを探索リスト34Cから除外し、ステップS63に戻って探索対象ブロック及び比較対象ブロックの選択をやり直す。   Subsequently, the determination unit 34D calculates the difference in erasure time between the search target block and the comparison target block (step S64). Subsequently, the determination unit 34D determines whether or not the difference between the calculated erase times exceeds an erase time interval threshold (step S65). If the erase time interval threshold is not exceeded, the determination unit 34D determines whether or not two or more blocks remain in the search list 34C (step S66). When two or more blocks remain, the determination unit 34D excludes the search target block from the search list 34C, returns to step S63, and reselects the search target block and the comparison target block.

ステップS65において消去時期間隔閾値を超えている場合、判定部34Dは、比較対象ブロック番号を情報出力部34Fに送る。情報出力部34Fは、この比較対象ブロック番号を用いて、全ブロックのうち比較対象ブロックより消去時期が新しいブロックの範囲を算出する(ステップS68)。そして、情報出力部34Fは、上記範囲を短期書き換え情報としてブロック制御部30に送る。短期書き換え情報を受けて、ブロック制御部30では、短期書き換え情報に含まれるブロックに対応する短期書き換えフラグを立て、その他のブロックに対応する短期書き換えフラグはクリアする。   When the erase time interval threshold is exceeded in step S65, the determination unit 34D sends the comparison target block number to the information output unit 34F. Using this comparison target block number, the information output unit 34F calculates a range of blocks that have a newer erasure time than the comparison target block among all the blocks (step S68). And the information output part 34F sends the said range to the block control part 30 as short-term rewriting information. Upon receipt of the short-term rewrite information, the block control unit 30 sets a short-term rewrite flag corresponding to the block included in the short-term rewrite information, and clears the short-term rewrite flag corresponding to the other blocks.

ステップS66において2個以上のブロックが残っていない場合、短期書き換えが行われたブロックを検出できないと判断し、短期書き換え検出処理を終了する。   If two or more blocks do not remain in step S66, it is determined that the short-term rewritten block cannot be detected, and the short-term rewrite detection process is terminated.

図14は、短期書き換え検出部34による短期書き換え検出処理の具体例を説明する図である。NAND型フラッシュメモリ10に含まれるブロックが12個(ブロック♯0〜11)であり、このうち、ブロック#0〜7が探索リスト34Cに含まれる使用中状態のブロックであり、ブロック#8〜11が空き状態であるものとする。ブロック#0〜7は、消去時期が新しい順にソートされている。ブロックごとの消去時期は、図に示した通りである。   FIG. 14 is a diagram illustrating a specific example of short-term rewrite detection processing by the short-term rewrite detection unit 34. There are 12 blocks (blocks # 0 to 11) included in the NAND flash memory 10. Of these, blocks # 0 to 7 are in-use blocks included in the search list 34C, and blocks # 8 to 11 are in use. Is empty. Blocks # 0 to # 7 are sorted in the order of erasure. The erase time for each block is as shown in the figure.

まず、探索リスト34Cの中で、消去時期が最も新しいブロック#0が探索対象ブロック、消去時期が次に新しいブロック#1が比較対象ブロックとして選択される。ブロック#0とブロック#1との消去時期の差は、“10”である。この差“10”は、消去時期間隔閾値(例えば、“100”)を超えていない。よって、探索対象ブロック#0は、探索リスト34Cから除外される。   First, in the search list 34C, the block # 0 with the newest erase time is selected as the search target block, and the block # 1 with the newest erase time is selected as the comparison target block. The difference in erase time between block # 0 and block # 1 is “10”. This difference “10” does not exceed the erase time interval threshold (for example, “100”). Therefore, the search target block # 0 is excluded from the search list 34C.

続いて、探索リスト34Cの中で、消去時期が最も新しいブロック#1が探索対象ブロック、消去時期が次に新しいブロック#2が比較対象ブロックとして選択される。ブロック#1とブロック#2との消去時期の差は、“110”である。この差“110”は、消去時期間隔閾値を超えている。よって、比較対象ブロック#2の番号が、判定部34Dから情報出力部34Fに送られる。   Subsequently, in the search list 34C, the block # 1 with the newest erase time is selected as the search target block, and the block # 2 with the newest erase time is selected as the comparison target block. The difference in erase time between block # 1 and block # 2 is “110”. This difference “110” exceeds the erase time interval threshold. Therefore, the number of the comparison target block # 2 is sent from the determination unit 34D to the information output unit 34F.

情報出力部34Fでは、空き状態ブロックを含む全ブロックのうち、消去時期が比較対象ブロック#2より新しいブロック#0、1、8〜11を算出する。そして、情報出力部34Fは、ブロック#0、1、8〜11を短期書き換え情報として、ブロック制御部30に送る。これに対し、ブロック制御部30では、ブロック#0、1、8〜11に対応する短期書き換えフラグを立て、その他のブロックに対応する短期書き換えフラグはクリアする。このようにして、ブロックテーブル30Bの情報が更新される。   The information output unit 34F calculates blocks # 0, 1, and 8 to 11 whose erasure time is newer than the comparison target block # 2 among all the blocks including the vacant state blocks. Then, the information output unit 34F sends the blocks # 0, 1, and 8 to 11 to the block control unit 30 as short-term rewrite information. On the other hand, the block control unit 30 sets short-term rewrite flags corresponding to the blocks # 0, 1, 8 to 11, and clears short-term rewrite flags corresponding to other blocks. In this way, the information in the block table 30B is updated.

[2−6.平準化処理]
NAND型フラッシュメモリ10の寿命を延長するには、各ブロックの消去回数を揃えることと、特定の領域に対して短期間に頻繁に書き換えを行うことを避けることとの両立が必要である。消去回数を揃えることにだけ着目してNAND型フラッシュメモリ10の寿命を延長しようとすると、書き込み状況によっては特定の領域が短期間に書き換えが進行してしまうことがある。短期間にこの修正(平準化)を頻繁に行うと、消去回数は揃い、短期間の特定の領域への書き込み集中を避けることができるが、修正に起因する消去処理が多くなり、結果として寿命を延長することができない。一方で、修正の間隔を延ばし過ぎると、特定の領域に間隔の短い消去処理が集中することになり、寿命が短くなってしまう。このような知見に基づいて、本実施形態の平準化処理では、平準化の回数を最適化し、かつブロックごとの消去回数を揃えるようにしている。
[2-6. Leveling process]
In order to extend the lifetime of the NAND flash memory 10, it is necessary to achieve both the equalization of the number of erases of each block and the avoidance of frequent rewriting in a short time in a specific area. If an attempt is made to extend the lifetime of the NAND flash memory 10 by paying attention only to equalizing the number of times of erasure, rewriting of a specific area may proceed in a short period of time depending on the write situation. If this correction (leveling) is frequently performed in a short period of time, the number of erasures is uniform, and writing concentration in a specific area in the short period can be avoided, but the number of erasing processes due to the correction increases, resulting in a long life. Can not be extended. On the other hand, if the correction interval is extended too much, erasure processing with a short interval will be concentrated in a specific area, and the lifetime will be shortened. Based on such knowledge, in the leveling process of this embodiment, the number of times of leveling is optimized and the number of times of erasing for each block is made uniform.

平準化処理は、平準化部35、及び入替元ブロック選択部33により実行される。図15は、平準化部35の構成を示すブロック図である。平準化部35は、平準化判定部35A、及び平準化閾値を格納する記憶部35Bを備えている。   The leveling process is executed by the leveling unit 35 and the replacement source block selecting unit 33. FIG. 15 is a block diagram illustrating a configuration of the leveling unit 35. The leveling unit 35 includes a leveling determination unit 35A and a storage unit 35B that stores a leveling threshold.

平準化判定部35Aは、平準化閾値、割当ブロック選択部32から送られる割当ブロック情報、及び入替元ブロック選択部33から送られる入替元ブロック情報を用いて、今回の書き込み動作時に平準化処理を行うか否かを判定する。そして、平準化処理を行う場合、平準化判定部35Aは、NANDインターフェース回路25に、平準化処理に伴う読出要求、消去要求、及び書込要求を発行する。   The leveling determination unit 35A uses the leveling threshold, the allocation block information sent from the allocation block selection unit 32, and the replacement source block information sent from the replacement source block selection unit 33 to perform the leveling process during the current write operation. Determine whether to do it. When the leveling process is performed, the leveling determination unit 35A issues a read request, an erase request, and a write request accompanying the leveling process to the NAND interface circuit 25.

図16は、NANDコントローラ11による平準化処理を示すフローチャートである。まず、入替元ブロック選択部33によって、入替元ブロック選択処理が実行される(ステップS70)。そして、この選択処理の結果として、入替元ブロック情報が、入替元ブロック選択部33から平準化部35へ送られる。   FIG. 16 is a flowchart showing the leveling process performed by the NAND controller 11. First, the replacement source block selection unit 33 performs replacement source block selection processing (step S70). As a result of this selection process, replacement source block information is sent from the replacement source block selection unit 33 to the leveling unit 35.

続いて、平準化判定部35Aは、割当ブロック選択部32から送られる割当ブロック情報を確認し、この割当ブロック情報に含まれる短期書き換えフラグが立っているか否かを判定する(ステップS71)。短期書き換えフラグが立っていない場合、すなわち、割当ブロックの書き換えが頻繁に行われていない場合、平準化判定部35Aは、入替元ブロックと割当ブロックとの消去回数の差が平準化閾値を越えているか否かを判定する(ステップS72)。平準化閾値を越えていない場合、平準化部35は、今回の書き込み動作において平準化を行わない。   Subsequently, the leveling determination unit 35A confirms the allocation block information sent from the allocation block selection unit 32, and determines whether or not the short-term rewrite flag included in the allocation block information is set (step S71). If the short-term rewrite flag is not set, that is, if the allocation block is not rewritten frequently, the leveling determination unit 35A determines that the difference in the number of erasures between the replacement source block and the allocation block exceeds the leveling threshold. It is determined whether or not there is (step S72). If the leveling threshold is not exceeded, the leveling unit 35 does not perform leveling in the current write operation.

この平準化閾値は、平準化処理を実行するか否かを判定するために使用され、また、NAND型フラッシュメモリ10の寿命(或いは、データリテンション期間)をどの程度延ばすかという基準に基づいて設定される。前述したように、消去回数を揃えることにだけ着目してNAND型フラッシュメモリ10の寿命を延長しようとすると、平準化に伴う消去処理が多発してしまい、結果として特定領域への消去回数が増えてしまう。従って、本実施形態では、入替元ブロックと割当ブロックとの消去回数の差が平準化閾値を越えている場合にのみ平準化処理を実行するようにしている。   This leveling threshold is used to determine whether or not to perform the leveling process, and is set based on a standard of how much the lifetime (or data retention period) of the NAND flash memory 10 is extended. Is done. As described above, if an attempt is made to extend the lifetime of the NAND flash memory 10 by focusing only on equalizing the number of times of erasing, erasing processing accompanying leveling frequently occurs, resulting in an increase in the number of times of erasing to a specific area. End up. Therefore, in the present embodiment, the leveling process is executed only when the difference in the number of erasures between the replacement source block and the allocation block exceeds the leveling threshold.

ステップS71において短期書き換えフラグが立っている場合、或いは、ステップS72において平準化閾値を越えている場合、ブロック制御部30は、入替元ブロックのブロック解放処理を実行する(ステップS73)。このブロック解放処理は、図7と同じである。   When the short-term rewrite flag is set in step S71 or when the leveling threshold is exceeded in step S72, the block control unit 30 executes block release processing for the replacement source block (step S73). This block release processing is the same as in FIG.

続いて、ブロック制御部30は、割当ブロック選択部32により選択された割当ブロックを、入替元ブロックのデータを移動するブロックとして割り当てるブロック割当処理を実行する(ステップS74)。このブロック割当処理は、図10と同じである。   Subsequently, the block control unit 30 executes a block allocation process for allocating the allocation block selected by the allocation block selection unit 32 as a block for moving the data of the replacement source block (step S74). This block allocation process is the same as in FIG.

続いて、NANDコントローラ11は、NAND型フラッシュメモリ10に含まれる入替元ブロックのデータを読み出す(ステップS75)。具体的には、平準化判定部35Aは、入替元ブロック選択部33から送られる入替元ブロック情報を用いて、NANDインターフェース回路25に読出要求を発行する。この読出要求に基づいて、NANDインターフェース回路25は、NAND型フラッシュメモリ10に、入替元ブロックからデータを読み出すように指示する。読み出されたデータは、RAM24等に一時的に格納される。   Subsequently, the NAND controller 11 reads the data of the replacement source block included in the NAND flash memory 10 (step S75). Specifically, the leveling determination unit 35A issues a read request to the NAND interface circuit 25 using the replacement source block information sent from the replacement source block selection unit 33. Based on this read request, the NAND interface circuit 25 instructs the NAND flash memory 10 to read data from the replacement source block. The read data is temporarily stored in the RAM 24 or the like.

続いて、NANDコントローラ11は、割当ブロックのデータを消去する(ステップS76)。具体的には、平準化判定部35Aは、割当ブロック選択部32から送られる割当ブロック情報を用いて、NANDインターフェース回路25に消去要求を発行する。この消去要求に基づいて、NANDインターフェース回路25は、NAND型フラッシュメモリ10に、割当ブロックのデータを消去するように指示する。この際、ブロック制御部30によって割当ブロックの消去回数及び消去時期が更新される(図11参照)。   Subsequently, the NAND controller 11 erases the data of the allocation block (step S76). Specifically, the leveling determination unit 35A issues an erasure request to the NAND interface circuit 25 using the allocation block information sent from the allocation block selection unit 32. Based on this erase request, the NAND interface circuit 25 instructs the NAND flash memory 10 to erase the data in the allocated block. At this time, the block control unit 30 updates the erase count and erase time of the allocated block (see FIG. 11).

続いて、NANDコントローラ11は、NAND型フラッシュメモリ10に含まれる割当ブロックに、入替元ブロックから読み出されたデータを書き込む(ステップS77)。具体的には、平準化判定部35Aは、割当ブロック情報を用いて、NANDインターフェース回路25に書込要求を発行する。この書込要求に基づいて、NANDインターフェース回路25は、NAND型フラッシュメモリ10に、割当ブロックへデータを書き込むように指示する。   Subsequently, the NAND controller 11 writes the data read from the replacement source block into the allocation block included in the NAND flash memory 10 (step S77). Specifically, the leveling determination unit 35A issues a write request to the NAND interface circuit 25 using the allocation block information. Based on this write request, the NAND interface circuit 25 instructs the NAND flash memory 10 to write data to the allocation block.

以上により、入替元ブロックのデータを割当ブロックに移し変え、入替元ブロックを空き状態にすることができるため、あまり書き換えが行われていないと考えられる入替元ブロックを、再度割当ブロックとして使用することが可能となる。また、あまり書き換えが行われないデータを、すでに消去回数が多くなっている割当ブロックに移すことで、今後、割当ブロックの消去回数が増えるのを防ぐことが可能となる。   As described above, since the data of the replacement source block can be transferred to the allocation block and the replacement source block can be made empty, the replacement source block that is considered not to be rewritten so much must be used again as the allocation block. Is possible. In addition, it is possible to prevent the number of erasures of the allocation block from increasing in the future by transferring the data that is not rewritten so much to the allocation block in which the number of erasures has already increased.

[2−6−1.入替元ブロック選択処理]
図17は、入替元ブロック選択部33の構成を示すブロック図である。図18は、入替元ブロック選択部33による入替元ブロック選択処理を示すフローチャートである。
[2-6-1. Replacement source block selection process]
FIG. 17 is a block diagram illustrating a configuration of the replacement source block selection unit 33. FIG. 18 is a flowchart showing replacement source block selection processing by the replacement source block selection unit 33.

入替元ブロック選択部33は、2個のセレクタ33A及び33Bを備えている。入替元ブロック選択部33は、ブロック制御部30から全ブロック情報を受ける(ステップS80)。この全ブロック情報は、セレクタ33Aに送られる。続いて、セレクタ33Aは、全ブロックの状態を確認し、全ブロックのうち使用中状態のブロックを抽出する(ステップS81)。そして、セレクタ33Aは、使用中状態のブロックに対応するブロック情報(使用中状態ブロック情報)をセレクタ33Bに送る。   The replacement source block selector 33 includes two selectors 33A and 33B. The replacement source block selector 33 receives all block information from the block controller 30 (step S80). This all block information is sent to the selector 33A. Subsequently, the selector 33A confirms the state of all the blocks, and extracts a block in use among all the blocks (step S81). Then, the selector 33A sends block information (in-use state block information) corresponding to the in-use block to the selector 33B.

続いて、セレクタ33Bは、セレクタ33Aにより抽出されたブロックのうち、消去時期が最も古いブロックを入替元ブロックとして選択する(ステップS82)。この入替元ブロックに対応する入替元ブロック情報は、平準化部35に送られる。このような入替元ブロック選択処理により、頻繁に書き換えられていないデータを格納した、リテンション特性の良いブロックを入替元ブロックとして選択することができる。   Subsequently, the selector 33B selects a block with the oldest erase time among the blocks extracted by the selector 33A as a replacement source block (step S82). The replacement source block information corresponding to the replacement source block is sent to the leveling unit 35. By such replacement source block selection processing, it is possible to select a block with good retention characteristics that stores data that has not been frequently rewritten as the replacement source block.

以上詳述したように本実施形態では、各ブロックが消去された消去時期を計測し、各ブロックと消去時期とを対応付けてブロックテーブル30Bに格納する。そして、外部から供給されたデータをNAND型フラッシュメモリ10に書き込む場合に、空き状態のブロックのうち消去時期が最も古いブロックを割当ブロックとして選択し、この割当ブロックに上記データを書き込むようにしている。   As described above in detail, in this embodiment, the erase time when each block is erased is measured, and each block and the erase time are associated with each other and stored in the block table 30B. When data supplied from the outside is written to the NAND flash memory 10, the block with the oldest erase time is selected as an allocation block among the free blocks, and the data is written to this allocation block. .

従って本実施形態によれば、各ブロックに対して消去間隔を長くすることができる。このため、消去間隔を長くすることでリテンション特性が回復するというメモリセルトランジスタの特性を利用して、各ブロックのリテンション特性の悪化を低減することができる。これにより、NAND型フラッシュメモリ10の寿命を長くすることが可能となる。   Therefore, according to the present embodiment, the erase interval can be extended for each block. For this reason, it is possible to reduce the deterioration of the retention characteristic of each block by utilizing the characteristic of the memory cell transistor that the retention characteristic is recovered by increasing the erase interval. As a result, the lifetime of the NAND flash memory 10 can be extended.

また、本実施形態では、短期書き換え検出部34によって頻繁に書き換えが行われているブロックを特定し、このブロックが割当ブロックとして選択された場合に、消去時期が古い入替元ブロックと割当ブロックとを入れ替えるようにしている。そして、入替元ブロックに格納されていた頻繁に書き換えられていないデータを割当ブロックに移すようにしている。これにより、一度書き込みで割り当てられたまま長い期間解放されない入替元ブロックも平準化処理により解放されるようになるため、あまり書き換えが行われていないと考えられる入替元ブロックを、再度割当ブロックとして使用することが可能となる。また、割当ブロックに対しては、頻繁に書き換えられていないデータを格納することになるため、以後のデータ消去回数を減らすことが可能となり、ひいては、割当ブロックのリテンション特性の悪化を低減することが可能となる。   Further, in the present embodiment, a block that is frequently rewritten by the short-term rewrite detection unit 34 is specified, and when this block is selected as an allocation block, a replacement source block and an allocation block having an erasure time old are determined. I try to replace it. Then, data that has been stored in the replacement source block and not frequently rewritten is transferred to the allocation block. As a result, the replacement source block that has been allocated once written and is not released for a long period of time is also released by the leveling process, so the replacement source block that is considered to have not been rewritten so much is used again as the allocation block It becomes possible to do. In addition, since data that has not been frequently rewritten is stored in the allocation block, it is possible to reduce the number of subsequent data erasures and, in turn, reduce deterioration of the retention characteristics of the allocation block. It becomes possible.

また、入替元ブロックと割当ブロックとの消去回数の差が閾値を超えている場合に、平準化処理を行うようにしている。これにより、平準化を頻繁に行わずに、平準化の回数を最適化でき、かつブロックごとの消去回数を揃えることが可能となる。この結果、一部のブロックの消去回数が増えることでNAND型フラッシュメモリ10全体の寿命が短くなるのを防ぐことができる。   Further, the leveling process is performed when the difference in the number of erasures between the replacement source block and the allocation block exceeds a threshold value. Thereby, it is possible to optimize the number of times of leveling without frequently performing leveling and to equalize the number of times of erasing for each block. As a result, it is possible to prevent the entire life of the NAND flash memory 10 from being shortened by increasing the number of times of erasure of some blocks.

[第2の実施形態]
第2の実施形態は、割当ブロック選択部32による割当ブロック選択処理の他の例について示しており、割当ブロックを選択する際に、消去時期が古く、かつ消去回数が少ないブロックを割当ブロックとして選択するようにしている。
[Second Embodiment]
The second embodiment shows another example of allocation block selection processing by the allocation block selection unit 32, and when an allocation block is selected, a block with an erasure time old and a small number of erasures is selected as the allocation block. Like to do.

図19は、第2の実施形態に係る割当ブロック選択部32の構成を示すブロック図である。図20は、割当ブロック選択部32による割当ブロック選択処理を示すフローチャートである。なお、NANDコントローラ11のうち割当ブロック選択部32以外の構成は、第1の実施形態と同じである。   FIG. 19 is a block diagram illustrating a configuration of the allocation block selection unit 32 according to the second embodiment. FIG. 20 is a flowchart showing allocation block selection processing by the allocation block selection unit 32. The configuration of the NAND controller 11 other than the allocation block selection unit 32 is the same as that of the first embodiment.

割当ブロック選択部32は、3個のセレクタ32A〜32C、及び割当ブロック設定値を格納する記憶部32Dを備えている。割当ブロック選択部32は、ブロック制御部30から全ブロック情報を受ける(ステップS90)。この全ブロック情報は、セレクタ32Aに送られる。続いて、セレクタ32Aは、全ブロックの状態を確認し、全ブロックのうち空き状態のブロックを抽出する(ステップS91)。そして、セレクタ32Aは、空き状態のブロックに対応するブロック情報(空き状態ブロック情報)をセレクタ32Bに送る。   The allocation block selection unit 32 includes three selectors 32A to 32C and a storage unit 32D that stores an allocation block setting value. The allocation block selection unit 32 receives all block information from the block control unit 30 (step S90). This all block information is sent to the selector 32A. Subsequently, the selector 32A confirms the state of all blocks, and extracts an empty block from all blocks (step S91). Then, the selector 32A sends block information (empty state block information) corresponding to the free block to the selector 32B.

続いて、セレクタ32Bは、空き状態ブロック情報のうち割当ブロック設定値により設定された条件のブロック情報を抽出する(ステップS92)。ここで、割当ブロック設定値には、
(A)消去時期の最も古い方から一定数のブロック
(B)消去時期の最も古い方から一定割合数のブロック
(C)消去時期が一定時期より古いブロック
のいずれかが設定されている。条件(A)〜(C)のいずれを割当ブロック設定値として使用するのかは、任意に選択することができる。例えば、割当ブロック設定値として条件(A)を用いる場合、セレクタ32Bは、空き状態のブロックのうち、消去時期の最も古い方から一定数のブロックを抽出する。そして、セレクタ32Bは、抽出したブロックに対応するブロック情報をセレクタ32Cに送る。
Subsequently, the selector 32B extracts block information of the condition set by the allocation block setting value from the free state block information (step S92). Here, the assigned block setting value includes
(A) A fixed number of blocks from the oldest erase time (B) A certain percentage of blocks from the oldest erase time (C) Any block whose erase time is older than the fixed time is set. Which of the conditions (A) to (C) is used as the allocation block set value can be arbitrarily selected. For example, when the condition (A) is used as the allocation block setting value, the selector 32B extracts a certain number of blocks from the oldest erased block among the empty blocks. Then, the selector 32B sends block information corresponding to the extracted block to the selector 32C.

条件(A)及び(B)は、空き状態のブロックを消去時期順にソートし、古い方から一定数/一定割合のブロックを探索する。従って、ステップS92において選択されるブロック数を多くすることができるため、ステップS93においてより消去回数が少ないブロックを選択する確率を高くすることが可能となる。条件(C)は、消去時期が一定時期を超えた空き状態のブロックのみをソートすればよいので、処理負荷が最も少ない。また、条件(A)及び(B)は、消去時期の古いほうから常に一定数/一定割合のブロックを抽出するのに対し、条件(C)では、消去時期が一定期間以上空いたブロックが抽出される。このため、条件(C)は、消去間隔を必ず一定間隔空けることができ、その分、消去回数の比較候補を少なくすることが可能となる。   Conditions (A) and (B) sort empty blocks in order of erasure time, and search for a certain number / constant ratio of blocks from the oldest one. Therefore, since the number of blocks selected in step S92 can be increased, it is possible to increase the probability of selecting a block with a smaller number of erases in step S93. The condition (C) has the least processing load because it is only necessary to sort free blocks whose erase time exceeds a certain time. In addition, conditions (A) and (B) always extract a fixed number / percentage of blocks from the oldest erase time, whereas in condition (C), blocks whose erase time is more than a certain period are extracted. Is done. For this reason, in the condition (C), the erasure interval can always be kept constant, and the number of erasure comparison candidates can be reduced accordingly.

続いて、セレクタ32Cは、セレクタ32Bにより抽出されたブロックのうち消去回数が最も少ないブロックを割当ブロックとして選択する(ステップS93)。この割当ブロックに対応する割当ブロック番号は、ブロック制御部30に送られる。また、この割当ブロックに対応する割当ブロック情報は、平準化部35に送られる。   Subsequently, the selector 32C selects, as an allocation block, a block having the smallest erase count among the blocks extracted by the selector 32B (step S93). The allocation block number corresponding to this allocation block is sent to the block control unit 30. Also, the allocation block information corresponding to this allocation block is sent to the leveling unit 35.

以上詳述したように本実施形態によれば、外部から供給されたデータを書き込む割当ブロックを選択する際に、空き状態のブロックのうちで、消去時期が古く、かつ消去回数が少ないブロックを割当ブロックとして選択することが可能となる。これにより、リテンション特性がより良いブロックに外部からのデータを書き込むことができるため、NAND型フラッシュメモリ10の寿命を長くすることが可能となる。   As described above in detail, according to the present embodiment, when selecting an allocation block for writing data supplied from the outside, among the blocks in the empty state, allocation is performed for blocks having an erasure time that is old and having a small number of erasures. It becomes possible to select as a block. As a result, data from the outside can be written in a block with better retention characteristics, so that the lifetime of the NAND flash memory 10 can be extended.

[第3の実施形態]
第3の実施形態は、入替元ブロック選択部33による入替元ブロック選択処理の他の例について示しており、入替元ブロックを選択する際に、消去時期が古く、かつ消去回数が少ないブロックを入替元ブロックとして選択するようにしている。
[Third Embodiment]
The third embodiment shows another example of replacement source block selection processing by the replacement source block selection unit 33. When a replacement source block is selected, a block whose erasure time is old and the number of erasures is small is replaced. The original block is selected.

図21は、第3の実施形態に係る入替元ブロック選択部33の構成を示すブロック図である。図22は、入替元ブロック選択部33による入替元ブロック選択処理を示すフローチャートである。   FIG. 21 is a block diagram illustrating a configuration of the replacement source block selection unit 33 according to the third embodiment. FIG. 22 is a flowchart showing replacement source block selection processing by the replacement source block selection unit 33.

入替元ブロック選択部33は、3個のセレクタ33A〜33C、及び入替元ブロック設定値を格納する記憶部33Dを備えている。入替元ブロック選択部33は、ブロック制御部30から全ブロック情報を受ける(ステップS100)。この全ブロック情報は、セレクタ33Aに送られる。続いて、セレクタ33Aは、全ブロックの状態を確認し、全ブロックのうち使用中状態のブロックを抽出する(ステップS101)。そして、セレクタ33Aは、使用中状態のブロックに対応するブロック情報(使用中状態ブロック情報)をセレクタ33Bに送る。   The replacement source block selection unit 33 includes three selectors 33A to 33C and a storage unit 33D that stores replacement source block setting values. The replacement source block selector 33 receives all block information from the block controller 30 (step S100). This all block information is sent to the selector 33A. Subsequently, the selector 33A confirms the state of all blocks, and extracts a block in use from all blocks (step S101). Then, the selector 33A sends block information (in-use state block information) corresponding to the in-use block to the selector 33B.

続いて、セレクタ33Bは、使用中状態ブロック情報のうち入替元ブロック設定値により設定された条件のブロック情報を抽出する(ステップS102)。ここで、入替元ブロック設定値には、
(A)消去時期の最も古い方から一定数のブロック
(B)消去時期の最も古い方から一定割合数のブロック
(C)消去時期が一定時期より古いブロック
のいずれかが設定されている。条件(A)〜(C)のいずれを入替元ブロック設定値として使用するのかは、任意に選択することができる。例えば、入替元ブロック設定値として条件(A)を用いる場合、セレクタ33Bは、使用中状態のブロックのうち、消去時期の最も古い方から一定数のブロックを抽出する。そして、セレクタ33Bは、抽出したブロックに対応するブロック情報をセレクタ33Cに送る。
Subsequently, the selector 33B extracts block information of the condition set by the replacement source block setting value from the in-use block information (step S102). Here, the replacement source block setting value includes
(A) A fixed number of blocks from the oldest erase time (B) A certain percentage of blocks from the oldest erase time (C) Any block whose erase time is older than the fixed time is set. Which of the conditions (A) to (C) is used as the replacement-source block setting value can be arbitrarily selected. For example, when the condition (A) is used as the replacement source block setting value, the selector 33B extracts a certain number of blocks from the oldest erased block among the blocks in use. Then, the selector 33B sends block information corresponding to the extracted block to the selector 33C.

条件(A)及び(B)は、空き状態のブロックを消去時期順にソートし、古い方から一定数/一定割合のブロックを探索する。従って、ステップS102において選択されるブロック数を多くすることができるため、ステップS103においてより消去回数が少ないブロックを選択する確率を高くすることが可能となる。条件(C)は、消去時期が一定時期を超えた空き状態のブロックのみをソートすればよいので、処理負荷が最も少ない。また、条件(A)及び(B)は、消去時期の古いほうから常に一定数/一定割合のブロックを抽出するのに対し、条件(C)では、消去時期が一定期間以上空いたブロックが抽出される。このため、条件(C)は、消去間隔を必ず一定間隔空けることができ、その分、消去回数の比較候補を少なくすることが可能となる。   Conditions (A) and (B) sort empty blocks in order of erasure time, and search for a certain number / constant ratio of blocks from the oldest one. Therefore, since the number of blocks selected in step S102 can be increased, it is possible to increase the probability of selecting a block with a smaller number of erases in step S103. The condition (C) has the least processing load because it is only necessary to sort free blocks whose erase time exceeds a certain time. In addition, conditions (A) and (B) always extract a fixed number / percentage of blocks from the oldest erase time, whereas in condition (C), blocks whose erase time is more than a certain period are extracted. Is done. For this reason, in the condition (C), the erasure interval can always be kept constant, and the number of erasure comparison candidates can be reduced accordingly.

続いて、セレクタ33Cは、セレクタ33Bにより抽出されたブロックのうち消去回数が最も少ないブロックを入替元ブロックとして選択する(ステップS103)。この入替元ブロックに対応する入替元ブロック情報は、平準化部35に送られる。   Subsequently, the selector 33C selects the block with the smallest erase count among the blocks extracted by the selector 33B as the replacement source block (step S103). The replacement source block information corresponding to the replacement source block is sent to the leveling unit 35.

以上詳述したように本実施形態によれば、平準化時に使用される入替元ブロックを選択する際に、使用中状態のブロックのうちで、消去時期が古く、かつ消去回数が少ないブロックを入替元ブロックとして選択することが可能となる。これにより、頻繁に書き換えられていないデータを格納した、リテンション特性の良いブロックを入替元ブロックとして選択することができるため、結果として、NAND型フラッシュメモリ10の寿命を長くすることが可能となる。   As described above in detail, according to the present embodiment, when selecting a replacement source block to be used at the time of leveling, among blocks in use, a block with an erasure time that is old and has a small number of erasures is replaced. The original block can be selected. As a result, a block having good retention characteristics storing data that has not been frequently rewritten can be selected as a replacement source block. As a result, the NAND flash memory 10 can have a long lifetime.

[第4の実施形態]
第4の実施形態は、短期書き換え検出処理の他の実施例について示しており、短期書き換え検出処理を二分探索法を用いて行うようにしている。
[Fourth Embodiment]
The fourth embodiment shows another example of short-term rewrite detection processing, and short-term rewrite detection processing is performed using a binary search method.

図23は、第4の実施形態に係る短期書き換え検出部34の構成を示すブロック図である。短期書き換え検出部34は、セレクタ34A、整列部34B、探索リスト34C、判定部34D、集中係数閾値を格納する記憶部34E、及び情報出力部34Fを備えている。   FIG. 23 is a block diagram illustrating a configuration of the short-term rewrite detection unit 34 according to the fourth embodiment. The short-term rewrite detection unit 34 includes a selector 34A, an alignment unit 34B, a search list 34C, a determination unit 34D, a storage unit 34E that stores a concentration factor threshold value, and an information output unit 34F.

判定部34Dは、探索リスト34Cの中で、二分探索法を用いて探索対象ブロックを選択する。そして、この探索対象ブロックに対して、短期書き換え検出に使用される集中係数を算出し、この集中係数が集中係数閾値を超えているか否かを判定する。この判定結果に基づいて探索リスト34Cからブロックを除外していき、探索リスト34Cの中のブロックを1個の探索対象ブロックに絞り込む。そして、最後に残った探索対象ブロックを用いて、消去時期が急激に変化する境界を探索する。   The determination unit 34D selects a search target block using the binary search method in the search list 34C. Then, a concentration factor used for short-term rewriting detection is calculated for this search target block, and it is determined whether or not this concentration factor exceeds a concentration factor threshold. Based on the determination result, blocks are excluded from the search list 34C, and the blocks in the search list 34C are narrowed down to one search target block. Then, using the last remaining search target block, a boundary where the erasure time changes rapidly is searched.

記憶部34Eに格納される集中係数閾値は、頻繁に書き換えが行われているブロックの範囲を特定するために使用され、また、NAND型フラッシュメモリ10の寿命(或いは、データリテンション期間)をどの程度延ばすかという基準に基づいて設定される。集中係数閾値を低くすると短期書き換え検出の可能性が上がり、一方、集中係数閾値を高くすると短期書き換え検出の可能性が下がる。   The concentration factor threshold value stored in the storage unit 34E is used to specify a range of blocks that are frequently rewritten, and how long the lifetime (or data retention period) of the NAND flash memory 10 is. It is set on the basis of whether to extend. Lowering the concentration factor threshold increases the possibility of short-term rewrite detection, while increasing the concentration factor threshold decreases the possibility of short-term rewrite detection.

図24及び図25は、短期書き換え検出部34による短期書き換え検出処理を示すフローチャートである。   24 and 25 are flowcharts showing the short-term rewrite detection process by the short-term rewrite detection unit 34.

まず、短期書き換え検出部34は、ブロック制御部30から全ブロック情報を受ける(ステップS110)。この全ブロック情報は、セレクタ34Aに送られる。続いて、セレクタ34Aは、全ブロックの状態を確認し、全ブロックのうち使用中状態のブロックを抽出する(ステップS111)。そして、セレクタ34Aは、使用中状態のブロックに対応するブロック情報(使用中状態ブロック情報)を整列部34Bに送る。   First, the short-term rewrite detector 34 receives all block information from the block controller 30 (step S110). This all block information is sent to the selector 34A. Subsequently, the selector 34A confirms the state of all the blocks, and extracts a block in use among all the blocks (step S111). Then, the selector 34A sends block information (in-use state block information) corresponding to the in-use block to the alignment unit 34B.

続いて、整列部34Bは、使用中状態ブロック情報に含まれる消去時期を確認し、使用中状態のブロックを消去時期順にソートする(ステップS112)。そして、整列部34Bによりソートされたブロック情報は、探索リスト34Cに入れられると共に、消去時期が新しいブロックから順にリスト番号が付与される。   Subsequently, the aligning unit 34B confirms the erase time included in the in-use state block information, and sorts the in-use blocks in the order of the erase time (step S112). Then, the block information sorted by the sorting unit 34B is put in the search list 34C, and a list number is given in order from the block with the newest erase time.

続いて、判定部34Dは、探索リスト34Cの中で、消去時期が最も新しいブロックを“start”、消去時期が最も古いブロックを“end”に設定する(ステップS113)。続いて、判定部34Dは、リスト番号が“(start+end)/2”であるブロックを探索対象ブロックとして選択する(ステップS114)。   Subsequently, the determination unit 34D sets “start” for the block with the newest erase time and “end” for the block with the oldest erase time in the search list 34C (step S113). Subsequently, the determination unit 34D selects a block whose list number is “(start + end) / 2” as a search target block (step S114).

続いて、判定部34Dは、探索対象ブロックに対して集中係数を算出する(ステップS115)。この集中係数は、次式で与えられる。
集中係数=現在時刻−リスト番号−消去時期
なお、集中係数の算出に使用される現在時刻は、例えば、消去時期計測部31から短期書き換え検出部34に供給される。現在時刻としては、例えば、消去回数カウンタ31Aのカウント値を用いればよい。
Subsequently, the determination unit 34D calculates a concentration factor for the search target block (step S115). This concentration factor is given by:
Concentration factor = Current time−List number−Erase time The current time used to calculate the concentration factor is supplied from the erase time measurement unit 31 to the short-term rewrite detection unit 34, for example. As the current time, for example, the count value of the erase count counter 31A may be used.

続いて、判定部34Dは、上記算出した集中係数が、集中係数閾値を超えているか否かを判定する(ステップS116)。集中係数閾値を超えている場合、判定部34Dは、検索対象ブロックを“end”に設定する(ステップS117)。続いて、判定部34Dは、“end”より消去時期が古いブロックを探索リスト34Cから除外する(ステップS117)。   Subsequently, the determination unit 34D determines whether or not the calculated concentration coefficient exceeds a concentration coefficient threshold value (step S116). If the concentration factor threshold value is exceeded, the determination unit 34D sets the search target block to “end” (step S117). Subsequently, the determination unit 34D excludes from the search list 34C blocks having an erasing time older than “end” (step S117).

一方、ステップS116において集中係数閾値を超えていないと判定された場合、判定部34Dは、検索対象ブロックの次に消去時期が古いブロックを“start”に設定する(ステップS119)。続いて、判定部34Dは、“start”より消去時期が新しいブロックを探索リスト34Cから除外する(ステップS120)。   On the other hand, when it is determined in step S116 that the concentration factor threshold value has not been exceeded, the determination unit 34D sets “start” as the block whose erasure time is next to the search target block (step S119). Subsequently, the determination unit 34D excludes from the search list 34C a block whose erase time is newer than “start” (step S120).

ステップS118或いはステップS120において探索リスト34Cから所定のブロックが除外された後、判定部34Dは、探索リスト34Cに2個以上のブロックが残っているか否かを判定する(ステップS121)。探索リスト34Cに2個以上のブロックが残っている場合、ステップS114に戻って、再度、探索対象ブロックの選択を行う。   After a predetermined block is excluded from the search list 34C in step S118 or step S120, the determination unit 34D determines whether two or more blocks remain in the search list 34C (step S121). When two or more blocks remain in the search list 34C, the process returns to step S114, and the search target block is selected again.

ステップS121において探索リスト34Cに2個以上のブロックが残っていないと判定された場合、判定部34Dは、探索リスト34Cに最後に残っているブロックを探索対象ブロックとして選択する。そして、この探索対象ブロックに対して集中係数(=現在時刻−リスト番号−消去時期)を算出する(ステップS122)。   When it is determined in step S121 that two or more blocks do not remain in the search list 34C, the determination unit 34D selects the last remaining block in the search list 34C as a search target block. Then, a concentration factor (= current time−list number−erasing time) is calculated for this search target block (step S122).

続いて、判定部34Dは、上記算出した集中係数が、集中係数閾値を超えているか否かを判定する(ステップS123)。集中係数閾値を超えている場合、判定部34Dは、探索対象ブロック番号を情報出力部34Fに送る。情報出力部34Fは、この探索対象ブロック番号を用いて、全ブロックのうち探索対象ブロックより消去時期が新しいブロックの範囲を算出する(ステップS124)。そして、情報出力部34Fは、上記範囲を短期書き換え情報としてブロック制御部30に送る。短期書き換え情報を受けて、ブロック制御部30では、短期書き換え情報に含まれるブロックに対応する短期書き換えフラグを立て、その他のブロックに対応する短期書き換えフラグはクリアする。   Subsequently, the determination unit 34D determines whether or not the calculated concentration factor exceeds a concentration factor threshold value (step S123). When the concentration factor threshold value is exceeded, the determination unit 34D sends the search target block number to the information output unit 34F. Using this search target block number, the information output unit 34F calculates a range of blocks that have a newer erase time than the search target block among all the blocks (step S124). And the information output part 34F sends the said range to the block control part 30 as short-term rewriting information. Upon receipt of the short-term rewrite information, the block control unit 30 sets a short-term rewrite flag corresponding to the block included in the short-term rewrite information, and clears the short-term rewrite flag corresponding to the other blocks.

ステップS123において集中係数閾値を超えていないと判定された場合、短期書き換えが行われたブロックを検出できないと判断し、短期書き換え検出処理を終了する。   If it is determined in step S123 that the concentration factor threshold is not exceeded, it is determined that the block subjected to the short-term rewrite cannot be detected, and the short-term rewrite detection process is terminated.

図26は、短期書き換え検出部34による短期書き換え検出処理の具体例を説明する図である。NAND型フラッシュメモリ10に含まれるブロックが12個(ブロック♯0〜11)であり、このうち、ブロック#0〜7が探索リスト34Cに含まれる使用中状態のブロックであり、ブロック#8〜11が空き状態であるものとする。ブロック#0〜7は、消去時期が新しい順にソートされている。ブロックごとの消去時期は、図に示した通りである。探索リスト34Cに含まれるブロック#0〜7は、消去時期の新しい方からリスト番号が付与されている。   FIG. 26 is a diagram for explaining a specific example of short-term rewrite detection processing by the short-term rewrite detection unit 34. There are 12 blocks (blocks # 0 to 11) included in the NAND flash memory 10. Of these, blocks # 0 to 7 are in-use blocks included in the search list 34C, and blocks # 8 to 11 are in use. Is empty. Blocks # 0 to # 7 are sorted in the order of erasure. The erase time for each block is as shown in the figure. The block numbers 0 to 7 included in the search list 34C are given list numbers from the newest erase time.

まず、探索リスト34Cの中で、消去時期が最も新しいブロック#0を“start”、消去時期が最も古いブロック#7を“end”に設定する。続いて、リスト番号が“(start+end)/2”であるブロック#3が探索対象ブロックとして選択され、探索対象ブロック#3に対して集中係数(=現在時刻−リスト番号−消去時期)を計算し、この集中係数が集中係数閾値を越えているか否かを判定する。ここで、現在時刻が“106”、集中係数閾値が“90”であるものとする。探索対象ブロック#3の集中係数は“97”であり、これは閾値を超えている。よって、探索対象ブロック#3が“end”に設定され、ブロック#3より消去時期が古いブロック#4〜7は、探索リスト34Cから除外される。   First, in the search list 34C, the block # 0 with the newest erase time is set to “start”, and the block # 7 with the oldest erase time is set to “end”. Subsequently, block # 3 whose list number is “(start + end) / 2” is selected as a search target block, and a concentration factor (= current time−list number−erasure time) is calculated for search target block # 3. Then, it is determined whether or not the concentration factor exceeds a concentration factor threshold value. Here, it is assumed that the current time is “106” and the concentration factor threshold is “90”. The concentration factor of the search target block # 3 is “97”, which exceeds the threshold value. Therefore, the search target block # 3 is set to “end”, and the blocks # 4 to # 7 whose erase time is older than the block # 3 are excluded from the search list 34C.

続いて、リスト番号が“(start+end)/2”であるブロック#1が探索対象ブロックとして選択され、探索対象ブロック#1に対して集中係数を計算する。探索対象ブロック#1の集中係数は“0”であり、これは閾値を超えていない。よって、探索対象ブロック#1の次に消去時期が古いブロック#2が“start”に設定され、ブロック#2より消去時期が新しいブロック#0、1は、探索リスト34Cから除外される。   Subsequently, the block # 1 whose list number is “(start + end) / 2” is selected as a search target block, and a concentration factor is calculated for the search target block # 1. The concentration factor of the search target block # 1 is “0”, which does not exceed the threshold value. Therefore, block # 2, which has the oldest erase time next to search target block # 1, is set to “start”, and blocks # 0, 1 whose erase time is newer than block # 2 are excluded from search list 34C.

続いて、リスト番号が“(start+end)/2”であるブロック#2が探索対象ブロックとして選択され、探索対象ブロック#2に対して集中係数を計算する。探索対象ブロック#2の集中係数は“97”であり、これは閾値を超えている。よって、探索対象ブロック#2が“end”に設定され、ブロック#2より消去時期が古いブロック#3は、探索リスト34Cから除外される。   Subsequently, the block # 2 whose list number is “(start + end) / 2” is selected as a search target block, and a concentration factor is calculated for the search target block # 2. The concentration factor of the search target block # 2 is “97”, which exceeds the threshold value. Therefore, the search target block # 2 is set to “end”, and the block # 3 having an erasure time older than the block # 2 is excluded from the search list 34C.

続いて、最後に探索リスト34Cに残ったブロック#2が探索対象ブロックとして選択され、探索対象ブロック#2に対して集中係数を計算する。探索対象ブロック#2の集中係数は閾値を超えている。よって、探索対象ブロック#2の番号が、判定部34Dから情報出力部34Fに送られる。   Subsequently, the block # 2 remaining last in the search list 34C is selected as a search target block, and a concentration factor is calculated for the search target block # 2. The concentration factor of search target block # 2 exceeds the threshold value. Therefore, the number of the search target block # 2 is sent from the determination unit 34D to the information output unit 34F.

情報出力部34Fでは、空き状態ブロックを含む全ブロックのうち、消去時期が探索対象ブロック#2より新しいブロック#0、1、8〜11を算出する。そして、情報出力部34Fは、ブロック#0、1、8〜11を短期書き換え情報として、ブロック制御部30に送る。これに対し、ブロック制御部30では、ブロック#0、1、8〜11に対応する短期書き換えフラグを立て、その他のブロックに対応する短期書き換えフラグはクリアする。このようにして、ブロックテーブル30Bの情報が更新される。   The information output unit 34F calculates blocks # 0, 1, and 8 to 11 whose erasure time is newer than the search target block # 2 among all the blocks including the empty state blocks. Then, the information output unit 34F sends the blocks # 0, 1, and 8 to 11 to the block control unit 30 as short-term rewrite information. On the other hand, the block control unit 30 sets short-term rewrite flags corresponding to the blocks # 0, 1, 8 to 11, and clears short-term rewrite flags corresponding to other blocks. In this way, the information in the block table 30B is updated.

以上詳述したように本実施形態によれば、短期書き換え検出部34によって頻繁に書き換えが行われているブロックを特定することができる。さらに、短期書き換え検出処理において、“logN”回の閾値チェックで探索が終わるため、短期書き換え検出の効率を向上させることができる。 As described above in detail, according to the present embodiment, it is possible to identify a block that is frequently rewritten by the short-term rewrite detection unit 34. Furthermore, in the short-term rewrite detection process, the search is completed with “log 2 N” threshold checks, so the efficiency of short-term rewrite detection can be improved.

[第5の実施形態]
第5の実施形態では、エラー訂正回路(ECC(Error Check and Correct)回路)をNANDコントローラ11が備え、データの読み出し時に、ECC回路によってエラーの検出及び訂正を行う。一般的に、誤り数は、データの書き込みから時間が経過するにつれて増加する傾向がある。よって、誤り数が多いブロックは、消去時期が古いブロックであるとも言える。そこで、本実施形態では、ECC回路による誤り数を入替元ブロック選択の指標にするようにしている。
[Fifth Embodiment]
In the fifth embodiment, the NAND controller 11 includes an error correction circuit (ECC (Error Check and Correct) circuit), and an error is detected and corrected by the ECC circuit when data is read. In general, the number of errors tends to increase as time elapses from data writing. Therefore, it can be said that a block with a large number of errors is a block whose erasure time is old. Therefore, in this embodiment, the number of errors by the ECC circuit is used as an index for selecting the replacement source block.

図27は、第5の実施形態に係るNANDコントローラ11の構成の一例を示すブロック図である。NANDコントローラ11は、ECC回路36を備えている。ECC回路36は、NAND型フラッシュメモリ10からデータを読み出す際に、エラーの検出及び訂正を行う。さらに、ECC回路36は、ブロックごとに、エラーの検出時に検出した誤り数をブロック制御部30に送る。   FIG. 27 is a block diagram illustrating an example of the configuration of the NAND controller 11 according to the fifth embodiment. The NAND controller 11 includes an ECC circuit 36. The ECC circuit 36 detects and corrects an error when reading data from the NAND flash memory 10. Further, the ECC circuit 36 sends the number of errors detected at the time of error detection to the block control unit 30 for each block.

図28は、ブロック制御部30の構成を示すブロック図である。ブロック制御部30に含まれるブロックテーブル30Bは、ブロック番号ごとに、誤り数を格納する。ブロックテーブル30Bに含まれる誤り数は、NAND型フラッシュメモリ10からのデータ読み出しごとに(ECC回路36によるエラー訂正ごとに)、更新される。   FIG. 28 is a block diagram illustrating a configuration of the block control unit 30. The block table 30B included in the block control unit 30 stores the number of errors for each block number. The number of errors included in the block table 30B is updated every time data is read from the NAND flash memory 10 (each time an error is corrected by the ECC circuit 36).

次に、NANDコントローラ11の読み出し動作について説明する。図29は、NANDコントローラ11による読み出し動作を示すフローチャートである。   Next, the read operation of the NAND controller 11 will be described. FIG. 29 is a flowchart showing a read operation by the NAND controller 11.

まず、NANDコントローラ11は、CPU2から読出要求を受けることで、読み出し動作を開始する(ステップS130)。続いて、ブロック制御部30は、アドレステーブル30Aを用いて、読出要求のアドレスを含むアドレス領域に対応するブロック番号を検索する(ステップS131)。   First, the NAND controller 11 starts a read operation by receiving a read request from the CPU 2 (step S130). Subsequently, the block control unit 30 searches the block number corresponding to the address area including the address of the read request using the address table 30A (step S131).

続いて、ブロック制御部30は、読出要求のブロックからデータを読み出す(ステップS132)。すなわち、ブロック制御部30は、NANDインターフェース回路25に読出要求を発行する。この読出要求に基づいて、NANDインターフェース回路25は、NAND型フラッシュメモリ10に、読出要求のブロックからデータを読み出すように指示する。   Subsequently, the block control unit 30 reads data from the block requested to be read (step S132). That is, the block control unit 30 issues a read request to the NAND interface circuit 25. Based on this read request, the NAND interface circuit 25 instructs the NAND flash memory 10 to read data from the read request block.

続いて、ECC回路36は、NAND型フラッシュメモリ10から読み出されたデータに対して、エラーの検出及び訂正を行う(ステップS133)。エラー訂正された読み出しデータは、データバス6を介してCPU2等に送られる。このエラー訂正の際、ECC回路36は、誤り数を算出し、この誤り数をブロック制御部30に送る。ECC回路36から誤り数を受けて、ブロック制御部30は、この誤り数をブロックテーブル30Bに記録する。このようにして、ブロックテーブル30Bに含まれる誤り数が更新される。   Subsequently, the ECC circuit 36 performs error detection and correction on the data read from the NAND flash memory 10 (step S133). The error-corrected read data is sent to the CPU 2 and the like via the data bus 6. At the time of this error correction, the ECC circuit 36 calculates the number of errors and sends this number of errors to the block control unit 30. Upon receiving the number of errors from the ECC circuit 36, the block control unit 30 records this number of errors in the block table 30B. In this way, the number of errors included in the block table 30B is updated.

次に、入替元ブロック選択部33による入替元ブロック選択処理について説明する。図30は、入替元ブロック選択部33による入替元ブロック選択処理を示すフローチャートである。なお、入替元ブロック選択部33の構成は、図21と同じである。   Next, replacement source block selection processing by the replacement source block selection unit 33 will be described. FIG. 30 is a flowchart showing replacement source block selection processing by the replacement source block selector 33. The configuration of the replacement source block selection unit 33 is the same as that in FIG.

入替元ブロック選択部33は、ブロック制御部30から全ブロック情報を受ける(ステップS140)。この全ブロック情報は、セレクタ33Aに送られる。続いて、セレクタ33Aは、全ブロックの状態を確認し、全ブロックのうち使用中状態のブロックを抽出する(ステップS141)。そして、セレクタ33Aは、使用中状態のブロックに対応するブロック情報(使用中状態ブロック情報)をセレクタ33Bに送る。   The replacement source block selector 33 receives all block information from the block controller 30 (step S140). This all block information is sent to the selector 33A. Subsequently, the selector 33A confirms the state of all the blocks, and extracts a block in use among all the blocks (step S141). Then, the selector 33A sends block information (in-use state block information) corresponding to the in-use block to the selector 33B.

続いて、セレクタ33Bは、使用中状態ブロック情報のうち入替元ブロック設定値により設定された条件のブロック情報を抽出する(ステップS142)。ここで、入替元ブロック設定値には、「誤り数が一定数より多いブロック」が設定されている。   Subsequently, the selector 33B extracts block information of the condition set by the replacement source block setting value from the in-use block information (step S142). Here, “blocks with more errors than a certain number” is set as the replacement source block setting value.

続いて、セレクタ33Cは、セレクタ33Bにより抽出されたブロックのうち消去回数が最も少ないブロックを入替元ブロックとして選択する(ステップS143)。この入替元ブロックに対応する入替元ブロック情報は、平準化部35に送られる。   Subsequently, the selector 33C selects the block with the smallest erase count among the blocks extracted by the selector 33B as the replacement source block (step S143). The replacement source block information corresponding to the replacement source block is sent to the leveling unit 35.

以上詳述したように本実施形態によれば、メモリシステム1の書き込み処理において、短期的に書き換えが集中したブロックを、一度書き込みで割り当られたまま長い期間解放されないブロックと入れ替えることができる。これにより、消去時期の間隔が短いことによるブロックの消耗を抑え、ブロックの消耗をNAND型フラッシュメモリ10全体で平均化することができる。   As described above in detail, according to the present embodiment, in the writing process of the memory system 1, it is possible to replace a block in which rewriting is concentrated in the short term with a block that has been allocated by writing and is not released for a long period of time. As a result, it is possible to suppress the block consumption due to the short interval of the erasing time and to average the block consumption over the entire NAND flash memory 10.

さらに、入替元ブロックとして、ECCによる誤り数が多いブロックが選択される。これにより、誤り数が多いブロックのデータが書き直されるため、平準化処理と同時にリフレッシュ処理(NAND型フラッシュメモリ10に記憶してあるデータを読み出してエラー訂正を行った後に、再びNAND型フラッシュメモリ10に書き戻す)を行うことにもなる。この結果、リフレッシュ処理の回数を低減することができるため、リフレッシュに伴うデータ書き込み量を削減する効果も得られる。   Furthermore, a block with a large number of errors due to ECC is selected as the replacement source block. As a result, the data of the block having a large number of errors is rewritten, so that the refresh processing (reading data stored in the NAND flash memory 10 and performing error correction at the same time as the leveling processing, and then again NAND flash memory 10 To write back.) As a result, since the number of refresh processes can be reduced, an effect of reducing the data write amount accompanying the refresh can be obtained.

[実施例]
上記各実施形態のメモリシステム1をSSD(Solid State Drive)として構成した場合の実施例について説明する。図31は、SSD100の構成を示すブロック図である。
[Example]
An example when the memory system 1 of each of the above embodiments is configured as an SSD (Solid State Drive) will be described. FIG. 31 is a block diagram showing the configuration of the SSD 100. As shown in FIG.

SSD100は、データ保存用の複数のNAND型フラッシュメモリ(NANDメモリ)10、データ転送用又は作業領域用のDRAM101、これらを制御するドライブ制御回路102、及び電源回路103を備えている。ドライブ制御回路102は、SSD100の外部に設けられる状態表示用LEDを制御するための制御信号を出力する。なお、DRAM101に代えて、FeRAM(ferroelectric random access memory)を用いてもよい。   The SSD 100 includes a plurality of NAND flash memories (NAND memories) 10 for data storage, a DRAM 101 for data transfer or work area, a drive control circuit 102 for controlling these, and a power supply circuit 103. The drive control circuit 102 outputs a control signal for controlling a status display LED provided outside the SSD 100. Instead of the DRAM 101, FeRAM (ferroelectric random access memory) may be used.

SSD100は、ATAインターフェース(ATA I/F)を介して、パーソナルコンピュータ等のホスト装置との間でデータを送受信する。また、SSD100は、RS232Cインターフェース(RS232C I/F)を介して、デバッグ用機器との間でデータを送受信する。   The SSD 100 transmits / receives data to / from a host device such as a personal computer via an ATA interface (ATA I / F). Further, the SSD 100 transmits / receives data to / from the debugging device via the RS232C interface (RS232C I / F).

電源回路103は、外部電源を受け、この外部電源を用いて複数の内部電源を生成する。これらの内部電源は、SSD100内の各部に供給される。また、電源回路103は、外部電源の立ち上がりを検知して、パワーオンリセット信号を生成する。パワーオンリセット信号は、ドライブ制御回路102に送られる。   The power supply circuit 103 receives an external power supply and generates a plurality of internal power supplies using the external power supply. These internal power supplies are supplied to each unit in the SSD 100. Further, the power supply circuit 103 detects the rise of the external power supply and generates a power-on reset signal. The power-on reset signal is sent to the drive control circuit 102.

図32は、ドライブ制御回路102の構成を示すブロック図である。ドライブ制御回路102は、データアクセス用バス104、第1の回路制御用バス105、及び第2の回路制御用バス106を備えている。   FIG. 32 is a block diagram showing a configuration of the drive control circuit 102. The drive control circuit 102 includes a data access bus 104, a first circuit control bus 105, and a second circuit control bus 106.

第1の回路制御用バス105には、ドライブ制御回路102全体を制御するプロセッサ107が接続されている。また、第1の回路制御用バス105には、各管理プログラム(FW:firmware)のブート用プログラムが格納されたブートROM108がROMコントローラ109を介して接続されている。また、第1の回路制御用バス105には、電源回路103からのパワーオンリセット信号を受けて、リセット信号及びクロック信号を各部に供給するクロックコントローラ110が接続されている。   A processor 107 that controls the entire drive control circuit 102 is connected to the first circuit control bus 105. A boot ROM 108 storing a boot program for each management program (FW: firmware) is connected to the first circuit control bus 105 via a ROM controller 109. The first circuit control bus 105 is connected to a clock controller 110 that receives a power-on reset signal from the power supply circuit 103 and supplies a reset signal and a clock signal to each unit.

第2の回路制御用バス106は、第1の回路制御用バス105に接続されている。第2の回路制御用バス106には、状態表示用LEDにステータス表示用信号を供給するパラレルIO(PIO)回路111、RS232Cインターフェースを制御するシリアルIO(SIO)回路112が接続されている。   The second circuit control bus 106 is connected to the first circuit control bus 105. Connected to the second circuit control bus 106 are a parallel IO (PIO) circuit 111 that supplies a status display signal to the status display LED and a serial IO (SIO) circuit 112 that controls the RS232C interface.

ATAインターフェースコントローラ(ATAコントローラ)113、第1のECC(Error Check and Correct)回路114、NANDコントローラ115、及びDRAMコントローラ119は、データアクセス用バス104と第1の回路制御用バス105との両方に接続されている。ATAコントローラ113は、ATAインターフェースを介してホスト装置との間でデータを送受信する。データアクセス用バス104には、データ作業領域として使用されるSRAM120がSRAMコントローラ121を介して接続されている。   An ATA interface controller (ATA controller) 113, a first ECC (Error Check and Correct) circuit 114, a NAND controller 115, and a DRAM controller 119 are provided on both the data access bus 104 and the first circuit control bus 105. It is connected. The ATA controller 113 transmits and receives data to and from the host device via the ATA interface. An SRAM 120 used as a data work area is connected to the data access bus 104 via an SRAM controller 121.

NANDコントローラ115は、4つのNANDメモリ10とのインターフェース処理を行うNANDインターフェース回路(NAND I/F)118、第2のECC回路117、及びNANDメモリ−DRAM間のアクセス制御を行うDMA転送制御用DMAコントローラ116を備えている。   The NAND controller 115 includes a NAND interface circuit (NAND I / F) 118 that performs interface processing with the four NAND memories 10, a second ECC circuit 117, and a DMA transfer control DMA that performs access control between the NAND memory and the DRAM. A controller 116 is provided.

図33は、プロセッサ107の構成を示すブロック図である。プロセッサ107は、データ管理部122、ATAコマンド処理部123、セキュリティ管理部124、ブートローダ125、初期化管理部126、デバッグサポート部127を備えている。   FIG. 33 is a block diagram illustrating a configuration of the processor 107. The processor 107 includes a data management unit 122, an ATA command processing unit 123, a security management unit 124, a boot loader 125, an initialization management unit 126, and a debug support unit 127.

データ管理部122は、NANDコントローラ115、第1のECC回路114を介して、NANDメモリ−DRAM間のデータ転送、NANDチップに関する各種機能を制御する。   The data management unit 122 controls data transfer between the NAND memory and the DRAM and various functions related to the NAND chip via the NAND controller 115 and the first ECC circuit 114.

ATAコマンド処理部123は、ATAコントローラ113、及びDRAMコントローラ119を介して、データ管理部122と協働してデータ転送処理を行う。セキュリティ管理部124は、データ管理部122及びATAコマンド処理部123と協働して各種のセキュリティ情報を管理する。ブートローダ125は、パワーオン時、各管理プログラム(FW)をNANDメモリ10からSRAM120にロードする。   The ATA command processing unit 123 performs data transfer processing in cooperation with the data management unit 122 via the ATA controller 113 and the DRAM controller 119. The security management unit 124 manages various types of security information in cooperation with the data management unit 122 and the ATA command processing unit 123. The boot loader 125 loads each management program (FW) from the NAND memory 10 to the SRAM 120 when the power is turned on.

初期化管理部126は、ドライブ制御回路102内の各コントローラ/回路の初期化を行う。デバッグサポート部127は、外部からRS232Cインターフェースを介して供給されたデバッグ用データを処理する。   The initialization manager 126 initializes each controller / circuit in the drive control circuit 102. The debug support unit 127 processes debug data supplied from the outside via the RS232C interface.

図34は、SSD100を搭載したポータブルコンピュータ200の一例を示す斜視図である。ポータブルコンピュータ200は、本体201、及び表示ユニット202を備えている。表示ユニット202は、ディスプレイハウジング203と、このディスプレイハウジング203に収容された表示装置204とを備えている。   FIG. 34 is a perspective view showing an example of a portable computer 200 on which the SSD 100 is mounted. The portable computer 200 includes a main body 201 and a display unit 202. The display unit 202 includes a display housing 203 and a display device 204 accommodated in the display housing 203.

本体201は、筐体205と、キーボード206と、ポインティングデバイスであるタッチパッド207とを備えている。筐体205内部には、メイン回路基板、ODD(optical disk device)ユニット、カードスロット、及びSSD100等が収容されている。   The main body 201 includes a housing 205, a keyboard 206, and a touch pad 207 that is a pointing device. The housing 205 accommodates a main circuit board, an ODD (optical disk device) unit, a card slot, an SSD 100, and the like.

カードスロットは、筐体205の周壁に隣接して設けられている。周壁には、カードスロットに対向する開口部208が設けられている。ユーザは、この開口部208を通じて筐体205の外部から追加デバイスをカードスロットに挿抜することが可能である。   The card slot is provided adjacent to the peripheral wall of the housing 205. An opening 208 facing the card slot is provided on the peripheral wall. The user can insert / remove an additional device into / from the card slot from the outside of the housing 205 through the opening 208.

SSD100は、従来のHDDの置き換えとして、ポータブルコンピュータ200内部に実装された状態として使用してもよいし、ポータブルコンピュータ200が備えるカードスロットに挿入した状態で、追加デバイスとして使用してもよい。   The SSD 100 may be used as a state of being mounted inside the portable computer 200 as a replacement for a conventional HDD, or may be used as an additional device while being inserted into a card slot included in the portable computer 200.

なお、上記各実施形態のメモリシステム1は、SSDに限らず、例えば、SDTMカードに代表されるメモリカードとして構成することも可能である。メモリシステム1をメモリカードとして構成する場合、ポータブルコンピュータに限らず、携帯電話、PDA、デジタルスチルカメラ、デジタルビデオカメラ等、各種電子機器に対して適用可能である。 The memory system 1 of the above embodiment is not limited to the SSD, for example, it can be configured as a memory card represented by SD TM card. When the memory system 1 is configured as a memory card, it is applicable not only to portable computers but also to various electronic devices such as mobile phones, PDAs, digital still cameras, and digital video cameras.

本発明は、上述した実施形態に限定されるものではなく、その要旨を逸脱しない範囲内で、構成要素を変形して具体化できる。また、実施形態に開示されている複数の構成要素の適宜な組み合わせにより種々の発明を構成することができる。例えば、実施形態に開示される全構成要素から幾つかの構成要素を削除してもよいし、異なる実施形態の構成要素を適宜組み合わせてもよい。   The present invention is not limited to the above-described embodiment, and can be embodied by modifying the components without departing from the scope of the invention. In addition, various inventions can be configured by appropriately combining a plurality of constituent elements disclosed in the embodiments. For example, some constituent elements may be deleted from all the constituent elements disclosed in the embodiments, or constituent elements of different embodiments may be appropriately combined.

1…メモリシステム、2…CPU、3…メインメモリ、4…メモリコントローラ、10…NAND型フラッシュメモリ、11…NANDコントローラ、21…ホストインターフェース回路、22…MPU、23…ROM、24…RAM、25…NANDインターフェース回路、30…ブロック制御部、30A…アドレステーブル、30B…ブロックテーブル、30C,31B…演算部、31…消去時期計測部、31A…消去回数カウンタ、32…割当ブロック選択部、32A〜32C,33A〜33C…セレクタ、32D,33D,34E,35B…記憶部、33…入替元ブロック選択部、34…短期書き換え検出部、34A…セレクタ、34B…整列部、34C…探索リスト、34D…判定部、34F…情報出力部、35…平準化部、35A…平準化判定部、36…ECC回路、100…SSD、101…DRAM、102…ドライブ制御回路、103…電源回路、104…データアクセス用バス、105…第1の回路制御用バス、106…第2の回路制御用バス、107…プロセッサ、108…ブートROM、109…ROMコントローラ、110…クロックコントローラ、111…PIO回路、112…SIO回路、113…ATAインターフェースコントローラ、114…第1のECC回路、115…NANDコントローラ、116…DMAコントローラ、117…第2のECC回路、118…NANDインターフェース回路、119…DRAMコントローラ、120…SRAM、121…SRAMコントローラ、122…データ管理部、123…ATAコマンド処理部、124…セキュリティ管理部、125…ブートローダ、126…初期化管理部、127…デバッグサポート部、200…ポータブルコンピュータ、201…本体、202…表示ユニット、203…ディスプレイハウジング、204…表示装置、205…筐体、206…キーボード、207…タッチパッド、208…開口部。   DESCRIPTION OF SYMBOLS 1 ... Memory system, 2 ... CPU, 3 ... Main memory, 4 ... Memory controller, 10 ... NAND type flash memory, 11 ... NAND controller, 21 ... Host interface circuit, 22 ... MPU, 23 ... ROM, 24 ... RAM, 25 ... NAND interface circuit, 30 ... Block control unit, 30A ... Address table, 30B ... Block table, 30C, 31B ... Calculation unit, 31 ... Erase time measurement unit, 31A ... Erase count counter, 32 ... Allocation block selection unit, 32A- 32C, 33A to 33C ... selector, 32D, 33D, 34E, 35B ... storage unit, 33 ... replacement source block selection unit, 34 ... short-term rewrite detection unit, 34A ... selector, 34B ... alignment unit, 34C ... search list, 34D ... Determination unit, 34F ... information output unit, 35 ... leveling unit, 35 Reference level determining unit 36: ECC circuit 100 ... SSD 101: DRAM 102 ... Drive control circuit 103 ... Power supply circuit 104 ... Data access bus 105 ... First circuit control bus 106 ... No. 2 circuit control buses 107: processor 108 boot ROM 109 ROM controller 110 clock controller 111 PIO circuit 112 SIO circuit 113 ATA interface controller 114 first ECC circuit DESCRIPTION OF SYMBOLS 115 ... NAND controller, 116 ... DMA controller, 117 ... 2nd ECC circuit, 118 ... NAND interface circuit, 119 ... DRAM controller, 120 ... SRAM, 121 ... SRAM controller, 122 ... Data management part, 123 ... ATA command processing part , 24: Security management unit, 125 ... Boot loader, 126 ... Initialization management unit, 127 ... Debug support unit, 200 ... Portable computer, 201 ... Main body, 202 ... Display unit, 203 ... Display housing, 204 ... Display device, 205 ... Housing Body, 206 ... keyboard, 207 ... touch pad, 208 ... opening.

Claims (22)

データ消去の単位であるブロックを複数個有する不揮発性メモリを含むメモリシステムの制御方法であって、
各ブロックのデータが消去された消去時期を計測する工程と、
ブロックごとに、空き状態或いは使用中状態を示す状態値と前記消去時期とを対応付けるブロックテーブルを作成する工程と、
短期的に書き換えが集中したブロックを検出する工程と、
前記ブロックテーブルの情報に基づいて、空き状態かつ消去時期が古い第1のブロックを選択する工程と、
前記ブロックテーブルの情報に基づいて、使用中状態かつ消去時期が古い第2のブロックを選択する工程と、
前記第1のブロックが前記検出されたブロックに含まれる場合に、前記第2のブロックのデータを前記第1のブロックに移動する工程と、
を具備することを特徴とするメモリシステムの制御方法。
A control method of a memory system including a non-volatile memory having a plurality of blocks as data erasing units,
A step of measuring the erase time when the data of each block was erased;
For each block, creating a block table that associates a state value indicating an empty state or a busy state with the erase time;
Detecting a block in which rewriting is concentrated in the short term;
Selecting a first block that is free and has an older erase time based on the information in the block table;
Selecting a second block that is in use and has an older erase time based on the information in the block table;
Moving the data of the second block to the first block when the first block is included in the detected block;
A method for controlling a memory system, comprising:
前記第1のブロックは、前記第2のブロックから前記第1のブロックへデータが移動された場合に、再度、選択されることを特徴とする請求項1に記載のメモリシステムの制御方法。   2. The method of controlling a memory system according to claim 1, wherein the first block is selected again when data is moved from the second block to the first block. 各ブロックの消去回数をカウントする工程をさらに具備し、
前記ブロックテーブルは、前記消去回数を格納することを特徴とする請求項1又は2に記載のメモリシステムの制御方法。
Further comprising the step of counting the number of times each block is erased,
3. The memory system control method according to claim 1, wherein the block table stores the number of times of erasure.
前記第1のブロックが前記検出されたブロックに含まれる場合、或いは前記第1のブロックと前記第2のブロックとの消去回数の差が閾値を超えた場合に、前記第2のブロックのデータを前記第1のブロックに移動することを特徴とする請求項3に記載のメモリシステムの制御方法。   When the first block is included in the detected block, or when the difference in the number of erasures between the first block and the second block exceeds a threshold, the data of the second block is 4. The method of controlling a memory system according to claim 3, wherein the memory system moves to the first block. 前記検出する工程は、ブロック間の消去時期の差が大きい境界を検出し、この境界より消去時期が新しいブロックを短期的に書き換えが集中したブロックとして検出することを特徴とする請求項1乃至4のいずれかに記載のメモリシステムの制御方法。   5. The detecting step detects a boundary having a large difference in erase time between blocks, and detects a block whose erase time is newer than the boundary as a block in which rewriting is concentrated in a short time. A method for controlling a memory system according to any one of the above. 前記ブロックテーブルは、短期的に書き換えが集中したブロックであるか否かを示すフラグを格納することを特徴とする請求項1乃至5のいずれかに記載のメモリシステムの制御方法。   6. The memory system control method according to claim 1, wherein the block table stores a flag indicating whether or not rewriting is concentrated in a short period of time. 前記検出する工程は、
使用中状態のブロックのうちで、任意の第3のブロックと、前記第3のブロックの次に消去時期が新しい第4のブロックとの消去時期の差を算出する工程と、
この差が所定間隔より大きい場合に、全ブロックのうちで前記第4のブロックより消去時期が新しいブロックを検出する工程とを含むことを特徴とする請求項1乃至6のいずれかに記載のメモリシステムの制御方法。
The detecting step includes
A step of calculating a difference in erase time between an arbitrary third block among the blocks in use and a fourth block having the next erase time after the third block;
7. The memory according to claim 1, further comprising a step of detecting a block whose erase time is newer than that of the fourth block among all the blocks when the difference is larger than a predetermined interval. How to control the system.
前記算出する工程は、使用中状態のブロックの情報を消去時期順に整列し、前記整列された情報に基づいて、前記第3のブロックと前記第4のブロックとの消去時期の差を算出することを特徴とする請求項7に記載のメモリシステムの制御方法。   The calculating step arranges information on blocks in use in order of erasing time, and calculates a difference in erasing time between the third block and the fourth block based on the arranged information. The method of controlling a memory system according to claim 7. 前記検出する工程は、
使用中状態のブロックに対して現在時刻と消去時期との差を算出する工程と、
この差が閾値を越えたブロックのうち消去時期が最も新しい第5のブロックを判定する工程と、
全ブロックのうちで前記第5のブロックより消去時期が新しいブロックを検出する工程とを含むことを特徴とする請求項1乃至6のいずれかに記載のメモリシステムの制御方法。
The detecting step includes
Calculating the difference between the current time and the erase time for a block in use;
Determining a fifth block having the latest erase time among the blocks in which the difference exceeds the threshold;
7. The method of controlling a memory system according to claim 1, further comprising a step of detecting a block whose erase time is newer than the fifth block among all blocks.
前記算出する工程は、使用中状態のブロックの情報を消去時期順に整列し、前記整列された情報に基づいて、現在時刻とブロックの消去時期との差が閾値を越えたか否かを判定することを特徴とする請求項9に記載のメモリシステムの制御方法。   The calculating step arranges information on blocks in use in order of erasure time, and determines whether a difference between the current time and the erasure time of the block exceeds a threshold based on the arranged information. The method of controlling a memory system according to claim 9. 前記第1のブロックは、空き状態かつ消去時期が最も古いことを特徴とする請求項1乃至10のいずれかに記載のメモリシステムの制御方法。   11. The memory system control method according to claim 1, wherein the first block is free and has the oldest erase time. 前記第1のブロックは、空き状態かつ消去時期が最も古い方から一定数のブロックのうちで、消去回数が最も少ないことを特徴とする請求項1乃至10のいずれかに記載のメモリシステムの制御方法。   11. The memory system control according to claim 1, wherein the first block has the smallest number of times of erasing among a predetermined number of blocks from the vacant state and the oldest erasing time. Method. 前記第1のブロックは、空き状態かつ消去時期が最も古い方から一定割合数のブロックのうちで、消去回数が最も少ないことを特徴とする請求項1乃至10のいずれかに記載のメモリシステムの制御方法。   11. The memory system according to claim 1, wherein the first block has the smallest number of times of erasure among a predetermined number of blocks from the vacant state and the oldest erase time. Control method. 前記第1のブロックは、空き状態かつ消去時期が一定時期より古いブロックのうちで、消去回数が最も少ないことを特徴とする請求項1乃至10のいずれかに記載のメモリシステムの制御方法。   11. The method of controlling a memory system according to claim 1, wherein the first block has the smallest number of times of erasure among blocks which are free and have an erase time older than a certain time. 前記第2のブロックは、使用中状態かつ消去時期が最も古いことを特徴とする請求項1乃至14のいずれかに記載のメモリシステムの制御方法。   15. The method according to claim 1, wherein the second block is in use and has the oldest erase time. 前記第2のブロックは、使用中状態かつ消去時期が最も古い方から一定数のブロックのうちで、消去回数が最も少ないことを特徴とする請求項1乃至14のいずれかに記載のメモリシステムの制御方法。   15. The memory system according to claim 1, wherein the second block has the smallest number of times of erasing among a predetermined number of blocks in the in-use state and the oldest erasing time. Control method. 前記第2のブロックは、使用中状態かつ消去時期が最も古い方から一定割合数のブロックのうちで、消去回数が最も少ないことを特徴とする請求項1乃至14のいずれかに記載のメモリシステムの制御方法。   15. The memory system according to claim 1, wherein the second block has the smallest number of times of erasure among a certain number of blocks from the one in use and the oldest erase time. Control method. 前記第2のブロックは、使用中状態かつ消去時期が一定時期より古いブロックのうちで、消去回数が最も少ないことを特徴とする請求項1乃至14のいずれかに記載のメモリシステムの制御方法。   15. The method of controlling a memory system according to claim 1, wherein the second block has the smallest erase count among blocks in use and whose erase time is older than a certain time. 前記不揮発性メモリから読み出されたデータの誤り数を算出する工程をさらに具備し、
前記ブロックテーブルは、ブロックごとに誤り数を格納し、
前記第2のブロックは、使用中状態かつ誤り数が一定数より多いブロックのうちで、消去回数が最も少ないことを特徴とする請求項1乃至14のいずれかに記載のメモリシステムの制御方法。
Further comprising calculating the number of errors in the data read from the non-volatile memory,
The block table stores the number of errors for each block;
15. The method of controlling a memory system according to claim 1, wherein the second block has the smallest number of erasures among blocks in use and having a larger number of errors than a certain number.
前記計測する工程は、全てのブロックにおいて実行される通算消去回数をカウントし、
前記消去時期は、前記通算消去回数に対応することを特徴とする請求項1乃至19のいずれかに記載のメモリシステムの制御方法。
The measuring step counts the total number of erasures executed in all blocks,
20. The method of controlling a memory system according to claim 1, wherein the erase time corresponds to the total number of erase times.
前記計測する工程は、各ブロックが消去された時刻を計測し、
前記消去時期は、前記時刻に対応することを特徴とする請求項1乃至19のいずれかに記載のメモリシステムの制御方法。
The step of measuring measures the time when each block was erased,
20. The memory system control method according to claim 1, wherein the erasing time corresponds to the time.
前記計測する工程は、各ブロックが消去されたときの当該メモリシステムの通電時間を計測し、
前記消去時期は、前記通電時間に対応することを特徴とする請求項1乃至19のいずれかに記載のメモリシステムの制御方法。
The measuring step measures the energization time of the memory system when each block is erased,
20. The memory system control method according to claim 1, wherein the erasing time corresponds to the energization time.
JP2009296094A 2009-12-25 2009-12-25 Memory system control method Expired - Fee Related JP4703764B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009296094A JP4703764B2 (en) 2009-12-25 2009-12-25 Memory system control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009296094A JP4703764B2 (en) 2009-12-25 2009-12-25 Memory system control method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2008114230A Division JP4439569B2 (en) 2008-04-24 2008-04-24 Memory system

Publications (2)

Publication Number Publication Date
JP2010067284A true JP2010067284A (en) 2010-03-25
JP4703764B2 JP4703764B2 (en) 2011-06-15

Family

ID=42192748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009296094A Expired - Fee Related JP4703764B2 (en) 2009-12-25 2009-12-25 Memory system control method

Country Status (1)

Country Link
JP (1) JP4703764B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013069859A1 (en) * 2011-11-09 2013-05-16 한양대학교 산학협력단 Device and method for controlling flash memory for storing mapping table of block to be erased
US8553467B2 (en) 2011-01-28 2013-10-08 Kabushiki Kaisha Toshiba Nonvolatile semiconductor memory device
JP2014512616A (en) * 2011-08-29 2014-05-22 株式会社日立製作所 Semiconductor memory device having electrically rewritable nonvolatile semiconductor memory
US9362000B2 (en) 2014-09-05 2016-06-07 Kabushiki Kaisha Toshiba Memory system and management method thereof
US9361201B2 (en) 2012-08-07 2016-06-07 Kabushiki Kaisha Toshiba Memory system and memory controller

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06250798A (en) * 1993-02-24 1994-09-09 Internatl Business Mach Corp <Ibm> Batch erasure type nonvolatile memory and semiconductor disk device using it
JPH0816482A (en) * 1994-06-29 1996-01-19 Hitachi Ltd Storage device using flash memory, and its storage control method
JPH1196779A (en) * 1997-09-17 1999-04-09 Victor Co Of Japan Ltd Flash type memory, its controlling method, storage device, and computer system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06250798A (en) * 1993-02-24 1994-09-09 Internatl Business Mach Corp <Ibm> Batch erasure type nonvolatile memory and semiconductor disk device using it
JPH0816482A (en) * 1994-06-29 1996-01-19 Hitachi Ltd Storage device using flash memory, and its storage control method
JPH1196779A (en) * 1997-09-17 1999-04-09 Victor Co Of Japan Ltd Flash type memory, its controlling method, storage device, and computer system

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8553467B2 (en) 2011-01-28 2013-10-08 Kabushiki Kaisha Toshiba Nonvolatile semiconductor memory device
JP2014512616A (en) * 2011-08-29 2014-05-22 株式会社日立製作所 Semiconductor memory device having electrically rewritable nonvolatile semiconductor memory
WO2013069859A1 (en) * 2011-11-09 2013-05-16 한양대학교 산학협력단 Device and method for controlling flash memory for storing mapping table of block to be erased
US9361201B2 (en) 2012-08-07 2016-06-07 Kabushiki Kaisha Toshiba Memory system and memory controller
US9362000B2 (en) 2014-09-05 2016-06-07 Kabushiki Kaisha Toshiba Memory system and management method thereof

Also Published As

Publication number Publication date
JP4703764B2 (en) 2011-06-15

Similar Documents

Publication Publication Date Title
JP4439569B2 (en) Memory system
JP4461170B2 (en) Memory system
JP2010108522A (en) Method of controlling memory system
JP4703764B2 (en) Memory system control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20091225

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20101124

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110124

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20110215

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110308

LAPS Cancellation because of no payment of annual fees