JP2008159013A - Semiconductor memory device - Google Patents

Semiconductor memory device Download PDF

Info

Publication number
JP2008159013A
JP2008159013A JP2007036236A JP2007036236A JP2008159013A JP 2008159013 A JP2008159013 A JP 2008159013A JP 2007036236 A JP2007036236 A JP 2007036236A JP 2007036236 A JP2007036236 A JP 2007036236A JP 2008159013 A JP2008159013 A JP 2008159013A
Authority
JP
Japan
Prior art keywords
data
page
request
address
snapshot
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
JP2007036236A
Other languages
Japanese (ja)
Other versions
JP5137413B2 (en
Inventor
Eiga Mizushima
永雅 水島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2007036236A priority Critical patent/JP5137413B2/en
Priority to US11/783,364 priority patent/US8151060B2/en
Priority to EP20070252686 priority patent/EP1927920B1/en
Priority to DE200760009916 priority patent/DE602007009916D1/en
Publication of JP2008159013A publication Critical patent/JP2008159013A/en
Priority to US13/422,644 priority patent/US8417896B2/en
Application granted granted Critical
Publication of JP5137413B2 publication Critical patent/JP5137413B2/en
Priority to US13/788,438 priority patent/US8683141B2/en
Priority to US14/188,039 priority patent/US9021212B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Read Only Memory (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To enable back up of data in a semiconductor memory device equipped with a flash memory. <P>SOLUTION: The semiconductor memory device includes an address conversion table for detecting physical addresses of at least two pages storing data written by designating a logical address from one of logical addresses to be designated by a reading request. The semiconductor memory device includes a page status register for detecting one page status allocated to each page, and page statuses to be detected include the at least following four statuses: (1) a latest data storage status, (2) a non latest data storage status, (3) an invalid data storage status, and (4) an unwritten status. By using the address conversion table and the page status register, at least two data (latest data and past data) can be read for one designated logical address from a host computer. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、電気的に書き換え可能な不揮発性メモリを使用した半導体記憶装置に関し、特に不揮発性メモリとしてフラッシュメモリを用いた記憶装置において、メモリ内容のスナップショット機能の実装方法に関する。   The present invention relates to a semiconductor memory device using an electrically rewritable nonvolatile memory, and more particularly to a method for mounting a snapshot function of memory contents in a memory device using a flash memory as a nonvolatile memory.

フラッシュメモリを搭載し、そこに格納されたデータが変更されるたびに消去サイクルを行うことを回避するメモリ制御機能を有する半導体記憶装置が知られている(例えば、特許文献1)。ここで、消去サイクルとは消去すべきブロック内のメモリセルを完全にプログラム(データの書込)してから消去することである。本記憶装置は、ハードディスクのように変更対象のデータ自身を更新データで上書きせずに、更新データをメモリブロックの未書込部分にプログラムすることによって、消去サイクルを回避する。ただし、プログラム済みのメモリブロックは定期的にクリーンアップされる。以上の処理を行うために、本記憶装置は、各メモリブロック内のセクタが未使用/使用中/無効であることを示すフラグや、外部から与えられる論理アドレスとメモリブロックの物理アドレスとを直接対応付けるマップを搭載する。
米国特許第5,479,638号明細書
2. Description of the Related Art A semiconductor memory device is known that has a flash memory and a memory control function that avoids performing an erase cycle every time data stored therein is changed (for example, Patent Document 1). Here, the erase cycle means that the memory cells in the block to be erased are completely programmed (data writing) and then erased. This storage device avoids the erase cycle by programming the update data in the unwritten portion of the memory block without overwriting the data to be changed with the update data as in the hard disk. However, programmed memory blocks are periodically cleaned up. In order to perform the above processing, the storage device directly receives a flag indicating that a sector in each memory block is unused / in use / invalid, a logical address given from the outside, and a physical address of the memory block. The map to associate is installed.
US Pat. No. 5,479,638

ストレージシステムに搭載されているバックアップ機能の1つとしてスナップショット機能がある。このスナップショットにより、ユーザは過去のデータファイルの内容を保存することで、後にそれを復元することが可能となる。特許文献1のような従来の半導体記憶装置は、変更対象のデータを上書きせずに更新データを書込むため、更新前後のデータがメモリ上に一時的に共存するという特徴を持つ。これは、過去のデータファイルの内容を保存することになる。しかし、従来の半導体記憶装置は、更新前のデータを格納しているメモリ部分を無効として扱い、記憶装置外部からアクセスできないように制御する。よって、ユーザが過去のデータファイルを復元したくなったとしても、上記従来例では該当するデータファイルが半導体記憶装置内のどこかに残っているにも拘わらず、ユーザは更新前のデータにアクセスすることができず、有効に利用できない、という問題があった。   One of the backup functions installed in the storage system is a snapshot function. This snapshot allows the user to save the contents of past data files and later restore them. A conventional semiconductor memory device such as Patent Document 1 has a feature that data before and after the update temporarily coexists on the memory because the update data is written without overwriting the data to be changed. This saves the contents of the past data file. However, the conventional semiconductor memory device treats the memory portion storing the data before update as invalid and performs control so that it cannot be accessed from outside the memory device. Therefore, even if the user wants to restore the past data file, in the above conventional example, the user can access the data before the update even though the corresponding data file remains somewhere in the semiconductor memory device. There is a problem that it cannot be used effectively.

また、ハードディスクを記録媒体として用いるストレージシステムにおいてスナップショット機能を実現する場合、記録媒体制御装置(コントローラ)が、データファイルの過去の内容および現在の内容(または過去の内容からの差分)をハードディスク上の別々の論理アドレスに書き込んで、これらのアドレスを管理する必要がある。このため最新のデータとスナップショットによる過去のデータへアクセスする際には、複数の論理アドレスを変換する必要があり、このアドレス変換のために記録媒体制御装置の負荷が増大する、という問題がある。   Also, when realizing a snapshot function in a storage system using a hard disk as a recording medium, the recording medium control device (controller) displays the past contents and the current contents (or differences from the past contents) of the data file on the hard disk. It is necessary to manage these addresses by writing to separate logical addresses. For this reason, when accessing the latest data and past data by snapshots, it is necessary to convert a plurality of logical addresses, and the load of the recording medium control device increases due to the address conversion. .

そこで、本発明は上記問題点に鑑みてなされたもので、フラッシュメモリを備えた半導体記憶装置において、データのバックアップを利用可能にし、さらにコントローラの負荷を低減することを目的とする。   Therefore, the present invention has been made in view of the above problems, and an object of the present invention is to make it possible to use data backup in a semiconductor memory device having a flash memory and to further reduce the load on the controller.

本発明は、ホストのデータを読み書きする記憶装置として、第1の論理アドレスを指定したホストからの書込要求に応じて第1のデータを格納した後、第1の論理アドレスを指定したホストからの書込要求に応じて第2のデータを格納し、第1のデータと第2のデータを格納した後、第1の論理アドレスを指定したホストからの読み出し要求に応じて、第2のデータか第1のデータのいずれかを選択的に出力可能であることを特徴とする記憶装置を提供する。   According to the present invention, as a storage device for reading and writing host data, after storing first data in response to a write request from a host that designates the first logical address, the host that designates the first logical address The second data is stored in response to the write request, the first data and the second data are stored, and then the second data is received in response to the read request from the host designating the first logical address. There is provided a storage device that can selectively output either of the first data and the first data.

また、本発明は、フラッシュメモリとメモリコントローラとを備え、メモリコントローラはフラッシュメモリを制御するためにフラッシュメモリに接続され、フラッシュメモリはメモリコントローラが一括消去可能なブロックを複数含み、ブロックは前記メモリコントローラが書込単位とする複数のページに分割され、第1のデータおよび第2のデータを異なるページに格納することを特徴とする記憶装置を提供する。   The present invention also includes a flash memory and a memory controller, the memory controller is connected to the flash memory to control the flash memory, and the flash memory includes a plurality of blocks that can be collectively erased by the memory controller. A storage device is provided in which a controller is divided into a plurality of pages as write units, and the first data and the second data are stored in different pages.

また、本発明は、前記記憶装置内において、読み出し要求で指定可能な論理アドレスの1つから、その論理アドレスを指定して書込まれたデータを格納している少なくとも2つのページの物理アドレスを格納するためのアドレス変換テーブルを、不揮発性の記憶手段に保持することを特徴とする記憶装置を提供する。   According to the present invention, the physical address of at least two pages storing data written by designating the logical address is selected from one of the logical addresses that can be designated by the read request in the storage device. There is provided a storage device characterized in that an address conversion table for storage is held in a nonvolatile storage means.

また、本発明は、前記記憶装置内において、各ページに割当てられた1つのページ状態を格納するページ状態レジスタを、不揮発性の記憶手段に保持し、メモリコントローラが検知しうるページ状態には、少なくとも(1)対応する論理アドレスを指定して最後に書込まれたデータを格納した状態、(2)対応する論理アドレスを指定して書込まれた非最新データを格納した状態、(3)もはや記憶する必要のない無効データを格納した状態、(4)消去されて以来データが未書込の状態、の4つが含まれることを特徴とする記憶装置を提供する。   Further, according to the present invention, in the storage device, a page state register that stores one page state assigned to each page is held in a nonvolatile storage unit, and the page state that can be detected by the memory controller includes: At least (1) the state in which the corresponding logical address is designated and the last written data is stored, (2) the state in which the non-latest data written by designating the corresponding logical address is stored, and (3) The present invention provides a storage device characterized in that it includes four states: a state in which invalid data that no longer needs to be stored is stored; and (4) a state in which data has not been written since it has been erased.

また、一括消去可能な複数のブロックと、前記ブロックを複数の領域に分割した複数のページとを備えてデータを格納するフラッシュメモリと、前記フラッシュメモリへの書き込みまたは読み出しを前記ページ単位で制御し、前記ブロック単位で一括消去を制御するメモリコントローラと、を備え、前記メモリコントローラは、ホストから受信した要求に含まれる論理アドレスに基づいて前記メモリチップのデータを読み書きする半導体記憶装置であって、前記メモリコントローラは、前記受信した要求が書き込み要求のときには、最新データの書き込み要求とスナップショット取得要求または解放要求の何れであるかを判定し、前記受信した要求が読み出し要求のときには、前記最新データの読み出し要求とスナップショットの読み出し要求の何れであるかを判定する要求判定部と、前記要求に含まれる論理アドレスに対応する前記ページの物理アドレスを管理するアドレス変換部と、前記各ブロックの前記各ページ毎に、格納されているデータが有効または無効あるいは未書き込みのいずれであるかを管理するページ状態設定部と、前記スナップショット取得要求または読み出し要求あるいは解放要求があったときに、スナップショットの世代を管理するスナップショット管理部と、前記要求判定部が判定した前記要求に含まれる論理アドレスから、前記アドレス変換部とページ状態設定部及びスナップショット管理部を参照して、前記要求に応じたアクセスを行うページの物理アドレスを決定するアクセス先決定部と、前記決定したページに対して前記要求に応じたアクセスを行うアクセス制御部と、を備え、前記アドレス変換部は、前記最新のデータを格納するページの物理アドレスを論理アドレス毎に格納する第1物理アドレスグループと、前記スナップショットを格納するページの物理アドレスを論理アドレス毎に格納し、かつスナップショットの世代毎に物理アドレスを格納する第2物理アドレスグループと、を有し、前記スナップショット管理部は、前記前記第2物理アドレスグループを構成するスナップショットの世代毎のアドレスグループの有効または無効を設定する。   Also, a flash memory that stores a plurality of blocks that can be collectively erased and a plurality of pages obtained by dividing the block into a plurality of areas, and controls writing or reading to the flash memory in units of pages. A memory controller that controls batch erase in units of blocks, the memory controller reading and writing data of the memory chip based on a logical address included in a request received from a host, When the received request is a write request, the memory controller determines whether the request is a latest data write request and a snapshot acquisition request or a release request, and when the received request is a read request, the latest data Read request and snapshot read required Stored in each of the pages of each block, a request determination unit that determines which one of the blocks, an address conversion unit that manages the physical address of the page corresponding to the logical address included in the request, and A page status setting unit that manages whether data is valid, invalid, or unwritten, and a snapshot management unit that manages the generation of a snapshot when the snapshot acquisition request, read request, or release request is made And referring to the address conversion unit, the page state setting unit, and the snapshot management unit from the logical address included in the request determined by the request determination unit, the physical address of the page to be accessed according to the request Access destination determination unit to determine and access to the determined page according to the request A first physical address group that stores, for each logical address, a physical address of a page that stores the latest data, and a physical address of a page that stores the snapshot. And a second physical address group that stores a physical address for each snapshot generation, and the snapshot management unit includes a snapshot that constitutes the second physical address group. Enable / Disable address group for each generation.

本発明によれば、記録媒体制御装置(メモリコントローラ)からの要求に従って任意の時点でのデータの内容を半導体記憶装置内に保存させることができるため、ひとつの論理アドレスで更新後のデータと更新前のデータとを利用することができる。さらに、半導体記憶装置を記録媒体として用いるストレージシステムにおいてスナップショット機能を実現する際には、記録媒体制御装置への負荷が低減されるという効果を奏する。   According to the present invention, the contents of data at an arbitrary time can be stored in the semiconductor memory device in accordance with a request from the recording medium control device (memory controller). The previous data can be used. Furthermore, when a snapshot function is realized in a storage system that uses a semiconductor storage device as a recording medium, the load on the recording medium control device is reduced.

また、半導体記憶装置に書き込んだデータが更新される度に、スナップショットの世代を更新することができ、半導体記憶装置の可用性を向上させることができる。   In addition, every time the data written in the semiconductor memory device is updated, the snapshot generation can be updated, and the availability of the semiconductor memory device can be improved.

以下、本発明の実施の形態を図面を参照して説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、第1の実施形態を示し、本発明を適用した半導体記憶装置1000の内部構成を簡単に表したものである。半導体記憶装置1000は、ディスクインタフェース1010、メモリコントローラ1020、フラッシュメモリ1040、不揮発性RAM1030で構成される。   FIG. 1 shows the first embodiment and simply shows the internal configuration of a semiconductor memory device 1000 to which the present invention is applied. The semiconductor memory device 1000 includes a disk interface 1010, a memory controller 1020, a flash memory 1040, and a nonvolatile RAM 1030.

ここで、フラッシュメモリ1040は半導体記憶装置1000の記憶容量に応じて、十分な容量を持つ1個以上のメモリチップ1041〜1043から構成される。また、不揮発性RAM1030は、バイト単位でデータの読み書きが可能な半導体メモリで、例えば磁気抵抗メモリや相変化メモリなどである。これは、フラッシュメモリ1040よりも書き換え寿命が長い不揮発性記憶媒体が好ましい。   Here, the flash memory 1040 includes one or more memory chips 1041 to 1043 having a sufficient capacity according to the storage capacity of the semiconductor storage device 1000. The nonvolatile RAM 1030 is a semiconductor memory that can read and write data in byte units, and is, for example, a magnetoresistive memory or a phase change memory. This is preferably a nonvolatile storage medium having a longer rewrite life than the flash memory 1040.

ディスクインタフェース1010は、外部のホスト装置1100と接続されるインタフェース機構であり、ホスト装置1100から受信したリード/ライトコマンドに応答して、半導体記憶装置1000に記憶されたリードデータをホスト装置1100に送信したり、半導体記憶装置1000に記憶すべきライトデータをホスト装置1100から受信する。なお、ホスト装置1100は、リード/ライトを要求するデータの格納先を論理アドレスによって指定する。この論理アドレスはフラッシュメモリ1040を直接アクセスする時に用いる物理アドレスとは異なる仮想的なアドレスである。   The disk interface 1010 is an interface mechanism connected to an external host device 1100, and transmits read data stored in the semiconductor storage device 1000 to the host device 1100 in response to a read / write command received from the host device 1100. Or write data to be stored in the semiconductor memory device 1000 is received from the host device 1100. Note that the host device 1100 designates a storage location of data for which read / write is requested by a logical address. This logical address is a virtual address different from the physical address used when the flash memory 1040 is directly accessed.

ディスクインタフェース1010の機構およびコマンドやデータの送受信のプロトコルについては、標準的なハードディスク装置と互換性のあるインタフェース仕様(例えば、パラレルATA、シリアルATA、SCSI)に準拠することが好ましい。   The mechanism of the disk interface 1010 and the protocol for sending and receiving commands and data are preferably compliant with interface specifications (for example, parallel ATA, serial ATA, SCSI) compatible with standard hard disk devices.

フラッシュメモリ1040の各メモリチップ1041〜1043は、いずれもページを単位として書き込まれ、複数のページからなるブロックを単位として消去される構造を持った不揮発性半導体メモリである。各チップには複数のブロックが含まれている。   Each of the memory chips 1041 to 1043 of the flash memory 1040 is a nonvolatile semiconductor memory having a structure in which data is written in units of pages and erased in units of blocks composed of a plurality of pages. Each chip includes a plurality of blocks.

メモリコントローラ1020は、ディスクインタフェース1010、フラッシュメモリ1040、不揮発性RAM1030と接続され、それらを制御するマイクロプロセッサである。メモリコントローラ1020は、ディスクインタフェース1010を介してホスト装置1100から受信したコマンド(上述のリード/ライトコマンドなど)の解釈や、ディスクインタフェース1010を介してのホスト装置1100との間のデータ送受信や、不揮発性RAM1030へのアクセス(リード/ライト)、各メモリチップ1041〜1043へのアクセス(リード/ライト/消去)を実行する。   The memory controller 1020 is a microprocessor that is connected to and controls the disk interface 1010, the flash memory 1040, and the nonvolatile RAM 1030. The memory controller 1020 interprets commands (such as the above-described read / write commands) received from the host device 1100 via the disk interface 1010, transmits / receives data to / from the host device 1100 via the disk interface 1010, Access (read / write) to the random access memory 1030 and access (read / write / erase) to the memory chips 1041 to 1043 are executed.

メモリコントローラ1020が解釈可能な5種類のコマンドとその機能を以下に示す。
・リードコマンド…論理アドレスで指定された位置に最後に格納されたデータを読み出す。
・ライトコマンド…論理アドレスで指定された位置にデータを書き込む。
・スナップショットコマンド…その時点での各論理アドレス位置に格納されているデータを、後に読み出しできるようにする。
・リカバリリードコマンド…論理アドレスで指定された位置に、スナップショットコマンドを受信した時点で格納されていたデータを読み出す。
・通常動作開始コマンド…各論理アドレス位置において、最後に格納されたデータのみを読み出しできるようにする。
The five types of commands that can be interpreted by the memory controller 1020 and their functions are shown below.
Read command: Reads the data stored last at the position specified by the logical address.
• Write command: Writes data to the location specified by the logical address.
Snapshot command: The data stored at each logical address position at that time can be read later.
Recovery read command: Reads data stored at the time specified by the logical address when the snapshot command is received.
Normal operation start command: Only the last stored data can be read at each logical address position.

メモリコントローラ1020は、ホスト装置1100から指定された論理アドレスに対応するデータが、どのメモリチップ内のどの物理アドレスのページに格納されているかを管理するために、論理アドレスと物理アドレスとの対応付けをリストにしたアドレス変換テーブル1031を使用する。   The memory controller 1020 associates the logical address with the physical address in order to manage the data corresponding to the logical address designated from the host device 1100 in the page of which physical address in which memory chip. Is used as an address conversion table 1031.

このアドレス変換テーブル1031では、1つの論理アドレスに対して2つの物理アドレス(以降、第1物理アドレス、第2物理アドレスと呼ぶ)を対応付ける。第1物理アドレスは、その論理アドレスに最後に書かれたデータの格納位置を示す。第2物理アドレスは、ホスト装置1100がスナップショットを指示した時点で、その論理アドレスに書かれていたデータの格納位置を示す。   In this address conversion table 1031, two physical addresses (hereinafter referred to as a first physical address and a second physical address) are associated with one logical address. The first physical address indicates the storage location of the data written last to the logical address. The second physical address indicates the storage position of the data written in the logical address when the host device 1100 instructs the snapshot.

アドレス変換テーブル1031は不揮発性RAM1030に格納され、メモリコントローラ1020が、論理アドレスと物理アドレスの対応付けの変化に応じてその内容を書き換える。ただし、アドレス変換テーブル1031の格納先はフラッシュメモリ1040の一部でもよい。   The address conversion table 1031 is stored in the nonvolatile RAM 1030, and the memory controller 1020 rewrites the contents in accordance with the change in the correspondence between the logical address and the physical address. However, the storage destination of the address conversion table 1031 may be a part of the flash memory 1040.

メモリコントローラ1020は、各メモリチップ内に含まれるページがそれぞれどのような状態にあるかを管理するために、ページ状態レジスタ1032を使用する。このページ状態レジスタ1032は、予め定義されたページ状態を所定のビット数(例えば4ビット)の値で符号化した状態値を格納する。ページ状態を示す状態値としては、例えば、以下の4通りを定義する。なお、各状態値は16進数表記である。
・状態値=0…当該ページに対応付けられた論理アドレスに向けて書込まれたデータのうち最新のものが格納されている状態
・状態値=1…当該ページに対応付けられた論理アドレスに向けて書込まれたデータのうち最新ではないもの(更新前のデータ)が格納されている状態
・状態値=8…もはや必要のない無効データが格納されている状態
・状態値=F…当該ページを含むブロックが消去されて以来、データが未書込である状態
ページ状態レジスタ1032はブロック単位で上記状態値を保持する。例えば、あるブロックのページ状態値が“880F”のとき、その第1・第2ページは無効データを含み、第3ページはある論理アドレスに対応する最新データを含み、第4ページは未書込であることを意味する。なお、上記ではページの状態値のビット数を、4ビットで表現する例を示したが、状態値の種類に応じたビット数であればよく、3ビットや2ビットなど、より少ないビット数で状態値を示すようにしても良い。
The memory controller 1020 uses the page status register 1032 in order to manage the state of each page included in each memory chip. The page status register 1032 stores a status value obtained by encoding a predefined page status with a value of a predetermined number of bits (for example, 4 bits). As status values indicating the page status, for example, the following four types are defined. Each state value is expressed in hexadecimal.
State value = 0: State in which the latest data among the data written to the logical address associated with the page is stored State state = 1: The logical address associated with the page State / state value in which data that is not the latest (data before update) is stored is stored. State value = 8. State / state value in which invalid data is no longer needed is stored. A state in which data has not been written since the block including the page is erased. The page state register 1032 holds the state value in units of blocks. For example, when the page status value of a block is “880F”, the first and second pages include invalid data, the third page includes the latest data corresponding to a certain logical address, and the fourth page is unwritten. It means that. In the above, an example is shown in which the number of bits of the page state value is represented by 4 bits. However, the number of bits corresponding to the type of the state value may be used, and a smaller number of bits such as 3 bits or 2 bits may be used. You may make it show a state value.

ページ状態レジスタ1032は不揮発性RAM1030に格納され、メモリコントローラ1020が、ページ状態の変化に応じてその内容を書き換える。ただし、ページ状態レジスタ1032の格納先はフラッシュメモリ1040の一部でもよい。   The page status register 1032 is stored in the non-volatile RAM 1030, and the memory controller 1020 rewrites the contents according to the change in the page status. However, the page state register 1032 may be stored in a part of the flash memory 1040.

メモリコントローラ1020は、ホスト装置1100が半導体記憶装置1000のスナップショット機能を利用中であるかどうかの状態を管理するために、スナップショットフラグ1033を使用する。このスナップショットフラグ1033は不揮発性RAM1030に格納され、メモリコントローラ1020が、利用状態の変化に応じてその内容を書き換える。ただし、スナップショットフラグ1033の格納先はフラッシュメモリ1040の一部でもよい。   The memory controller 1020 uses the snapshot flag 1033 in order to manage the status of whether or not the host device 1100 is using the snapshot function of the semiconductor storage device 1000. The snapshot flag 1033 is stored in the non-volatile RAM 1030, and the memory controller 1020 rewrites the contents according to the change in the usage state. However, the storage destination of the snapshot flag 1033 may be a part of the flash memory 1040.

図2および図3は、本発明を適用した半導体記憶装置1000においてスナップショット機能を利用するときに、メモリコントローラ1020が行うメモリ管理処理を説明するため、フラッシュメモリ1040内の格納データと、不揮発性RAM1030内のアドレス変換テーブル1031と、ページ状態レジスタ1032及びスナップショットフラグ1033について、それぞれの内容の変化の一例を順に示したものである。フラッシュメモリ1040内と不揮発性RAM1030内のデータなどの変化の様子を図2(a)〜図3(d)に示し、図2(a)から始まり、図2(b)、図2(c)、図2(d)、図3(a)、図3(b)、図3(c)と遷移して、図3(d)で終わる。   FIGS. 2 and 3 illustrate the memory management process performed by the memory controller 1020 when the snapshot function is used in the semiconductor storage device 1000 to which the present invention is applied. The address conversion table 1031 in the RAM 1030, the page status register 1032, and the snapshot flag 1033 are sequentially shown as examples of changes in their contents. Changes in data in the flash memory 1040 and in the nonvolatile RAM 1030 are shown in FIGS. 2A to 3D, starting from FIG. 2A, FIGS. 2B and 2C. 2 (d), FIG. 3 (a), FIG. 3 (b), and FIG. 3 (c), and ends with FIG. 3 (d).

図示の例では説明を簡単化するため、ホスト装置1100から指定可能な論理アドレスはセクタ単位(1セクタ=512バイト)として、その範囲を0〜3の4セクタ分に限定する。また、データの読み書きにはメモリチップ内の3個のブロック(ブロックX2000、ブロックY2010、ブロックZ2020)のみを使用することとする。さらに、メモリチップ内の各ブロックは4つのページで構成され、各ページのサイズは512バイト(1セクタ)であるものとする。各ページは0〜3の数字で表し、各ページの絶対的な物理アドレスをX3、Y0、Z1のように略記する。なお、図2(a)で示すように、アドレス変換テーブル1031において、LAは論理アドレス、第1PAは第1物理アドレス、第2PAは第2物理アドレスを意味する。なお、第1物理アドレスは、複数の論理アドレス毎に対応するページの物理アドレスをそれぞれ格納するもので、各物理アドレスは最新データを格納したページを示す。また、第2物理アドレスは、複数の論理アドレス毎に対応するページの物理アドレスをそれぞれ格納するもので、各物理アドレスは更新前(スナップショット)のデータを格納したページを示す。   In the illustrated example, in order to simplify the explanation, the logical address that can be specified from the host device 1100 is assumed to be a sector unit (1 sector = 512 bytes), and the range is limited to 4 sectors of 0 to 3. In addition, only three blocks (block X2000, block Y2010, and block Z2020) in the memory chip are used for reading and writing data. Furthermore, each block in the memory chip is composed of four pages, and the size of each page is 512 bytes (one sector). Each page is represented by a number from 0 to 3, and the absolute physical address of each page is abbreviated as X3, Y0, or Z1. As shown in FIG. 2A, in the address conversion table 1031, LA means a logical address, the first PA means a first physical address, and the second PA means a second physical address. The first physical address stores a physical address of a page corresponding to each of a plurality of logical addresses, and each physical address indicates a page storing the latest data. The second physical address stores a physical address of a page corresponding to each of a plurality of logical addresses, and each physical address indicates a page storing data before update (snapshot).

はじめに、スナップショット機能は無効であるとし、図2(a)のように、ブロックX2000には、物理ページアドレスのX0、X1、X2、X3が設定され、それぞれ論理アドレス0、1、2、3に対応するデータA、B、C、Dが既に格納されているものとする。なお、論理アドレス0,1,2,3は、メモリコントローラによって割り当てられたものである。また、ブロックY2010およびブロックZ2020は消去済みで、どのページもデータが未書込とする。   First, it is assumed that the snapshot function is invalid, and as shown in FIG. 2A, physical page addresses X0, X1, X2, and X3 are set in the block X2000, and logical addresses 0, 1, 2, 3, respectively. It is assumed that data A, B, C, and D corresponding to are already stored. The logical addresses 0, 1, 2, and 3 are assigned by the memory controller. Further, the block Y2010 and the block Z2020 have been erased, and no data is written in any page.

このとき、アドレス変換テーブル1031において論理アドレスLA=nの各第1物理アドレスにはXn(n=0〜3)が設定され、どの論理アドレスも第2物理アドレスが未設定である。また、ページ状態レジスタ1032におけるブロックX、Y、Zのページ状態値はそれぞれ“0000”、“FFFF”、“FFFF”に設定され、スナップショットフラグ1033はOFFに設定されている。つまり、図2(a)の状態では、アドレス変換テーブル1031において、論理アドレスLA=0がブロックX2000を指す第1物理アドレス=X0に対応付けられており、論理アドレスLA=1が同じくブロックX2000を指す第1物理アドレス=X1に、論理アドレスLA=2が同じくブロックX2000を指す第1物理アドレス=X2に、論理アドレスLA=3が同じくブロックX2000を指す第1物理アドレス=X3に対応付けられている。そして、ブロックX2000の第1〜第4ページは、ページ状態レジスタ1032の「X」のように各ページの状態値は「0」であり、最新のデータが格納されていることを示す。   At this time, in the address conversion table 1031, Xn (n = 0 to 3) is set for each first physical address of the logical address LA = n, and no second physical address is set for any logical address. The page status values of the blocks X, Y, and Z in the page status register 1032 are set to “0000”, “FFFF”, and “FFFF”, respectively, and the snapshot flag 1033 is set to OFF. That is, in the state of FIG. 2A, in the address translation table 1031, the logical address LA = 0 is associated with the first physical address = X0 indicating the block X2000, and the logical address LA = 1 is the same as the block X2000. The first physical address to be pointed to = X1, the logical address LA = 2 is also associated with the first physical address to be the same as block X2000 = X2, and the logical address LA = 3 is also associated to the first physical address to be the same as block X2000 = X3. Yes. In the first to fourth pages of the block X2000, the status value of each page is “0” like “X” in the page status register 1032, indicating that the latest data is stored.

この状態から、ホスト装置1100が以下の順で半導体記憶装置1000にコマンドを発行することとする。
(1)論理アドレスLA=0、1にそれぞれデータA’、B’を書くライトコマンド
(2)スナップショットコマンド
(3)論理アドレスLA=2、3にそれぞれデータC’、D’を書くライトコマンド
(4)論理アドレスLA=3にデータD”を書くライトコマンド
(5)論理アドレスLA=0〜3のデータを読むリードコマンド
(6)論理アドレスLA=0〜3のデータを読むリカバリリードコマンド
(7)通常動作開始(スナップショット機能の解除)コマンド
(8)論理アドレスLA=1にデータB”を書くライトコマンド
(9)論理アドレスLA=2にデータC”を書くライトコマンド
図2(b)は上記(1)のコマンドを受信して処理を実行した直後のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示したものである。ライトコマンド(1)を受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、論理アドレスLA=0、1に対応するブロックX2000のページが状態値=0となっており、既に最新のデータが書き込まれているので、同一の論理アドレスLAに対応する次のブロックであるブロックY2010のページ状態レジスタ1032を参照し、状態値=F(未書込)である2つのページY0、Y1を選択し、これらのページにそれぞれデータA’、B’を書き込む。
From this state, the host device 1100 issues commands to the semiconductor memory device 1000 in the following order.
(1) Write command for writing data A ′ and B ′ at logical addresses LA = 0 and 1 respectively (2) Snapshot command (3) Write command for writing data C ′ and D ′ at logical addresses LA = 2 and 3 respectively (4) Write command to write data D ″ at logical address LA = 3 (5) Read command to read data at logical address LA = 0 to 3 (6) Recovery read command to read data at logical address LA = 0 to 3 ( 7) Normal operation start (cancellation of snapshot function) command (8) Write command for writing data B ″ at logical address LA = 1 (9) Write command for writing data C ″ at logical address LA = 2 FIG. Indicates the internal state of the flash memory 1040 and the non-volatile RAM 1030 immediately after receiving the command (1) and executing the process. When the write command (1) is received, the memory controller 1020 refers to the page status register 1032 and the page of the block X2000 corresponding to the logical address LA = 0, 1 has the status value = 0, and has already been Since the latest data is written, the page status register 1032 of the block Y2010, which is the next block corresponding to the same logical address LA, is referred to, and two pages Y0 with the status value = F (unwritten), Y1 is selected, and data A ′ and B ′ are written into these pages, respectively.

なお、各ブロックへのデータの書き込みは、各ブロック内の空きセクタへ所定の順序で行うもので、例えば、図2(b)では各ブロックの空きページの順に書き込む。   Note that data writing to each block is performed in a predetermined order to empty sectors in each block. For example, in FIG. 2B, data is written in the order of empty pages in each block.

次に、メモリコントローラ1020は、アドレス変換テーブル1031から論理アドレスLA=0、1に対応する各第1物理アドレスであるX0、X1を検知し、これらのブロックX2000のページ1、2は既に最新のデータが書き込まれたので、ページ状態レジスタ1032のX0、X1のページ状態値を8(無効データ)に設定する。そして、メモリコントローラ1020はアドレス変換テーブル1031の論理アドレスLA=0、1に対応する各第1物理アドレスのアドレスに最新のデータを書き込んだブロックY2010の物理アドレスY0、Y1を設定し、ページ状態レジスタ1032のY0、Y1に対応するページ状態値を0(最新データ)に設定する。   Next, the memory controller 1020 detects the first physical addresses X0 and X1 corresponding to the logical addresses LA = 0 and 1 from the address conversion table 1031, and the pages 1 and 2 of these blocks X2000 are already the latest. Since the data has been written, the page status values of X0 and X1 of the page status register 1032 are set to 8 (invalid data). Then, the memory controller 1020 sets the physical addresses Y0 and Y1 of the block Y2010 in which the latest data is written to the addresses of the first physical addresses corresponding to the logical addresses LA = 0 and 1 of the address conversion table 1031, and the page status register The page state value corresponding to Y0 and Y1 of 1032 is set to 0 (latest data).

スナップショット機能が無効のときには、メモリコントローラ1020は各ブロックの空きページへ順次新たなデータを書き込み、過去のデータは無効なデータとしてページ状態レジスタ1032の値を「8」に設定し、また、アドレス変換テーブル1031は第1物理アドレスのみを使用して、最新のデータを書き込んだブロックの物理アドレスを第1物理アドレスに設定していく。   When the snapshot function is invalid, the memory controller 1020 sequentially writes new data to an empty page of each block, sets the value of the page status register 1032 to “8” as past data is invalid, and addresses The conversion table 1031 uses only the first physical address, and sets the physical address of the block in which the latest data is written as the first physical address.

次に、上記(2)のスナップショットコマンドを受信すると、メモリコントローラ1020は、スナップショットフラグ1033にONを設定する。これ以降のライトコマンドは、この時点での格納データが失われないように以下のようにスナップショット機能を有効にして処理が行われる。   Next, when the snapshot command (2) is received, the memory controller 1020 sets the snapshot flag 1033 to ON. The subsequent write commands are processed with the snapshot function enabled as follows so that the stored data at this point is not lost.

図2(c)は上記(3)のライトコマンドを実行した直後の内部状態を示したものである。コマンド(3)を受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、状態値=F(未書込)である2つのページY2、Y3を選択し、これらのページY2,Y3にそれぞれデータC’、D’を書く。   FIG. 2 (c) shows the internal state immediately after the execution of the write command (3). When the command (3) is received, the memory controller 1020 refers to the page status register 1032 and selects two pages Y2 and Y3 whose status value = F (unwritten), and assigns these pages Y2 and Y3 to these pages Y2 and Y3. Write data C 'and D' respectively.

次に、メモリコントローラ1020はアドレス変換テーブル1031から論理アドレスLA=2、3に対応する各第1物理アドレスであるX2、X3を検知し、それぞれの第2物理アドレスの欄にX2、X3を設定する。さらに、メモリコントローラ1020は、ページ状態レジスタ1032のX2、X3のページ状態値を「1」(スナップショットデータ)に設定する。これにより、ブロックX2000のページ状態レジスタ1032の状態値は、「8811」となる。また、メモリコントローラ1020は、アドレス変換テーブル1031の論理アドレスLA=2、3に対応する最新のデータの物理アドレスを各第1物理アドレスにY2、Y3を設定し、ページ状態レジスタ1032のY2、Y3のページ状態値を0(最新データ)に設定する。これにより、ブロックY2010のページ状態レジスタ1032の値は「0000」となる。   Next, the memory controller 1020 detects the first physical addresses X2 and X3 corresponding to the logical addresses LA = 2 and 3 from the address conversion table 1031 and sets X2 and X3 in the respective second physical address columns. To do. Further, the memory controller 1020 sets the page status values of X2 and X3 of the page status register 1032 to “1” (snapshot data). As a result, the status value of the page status register 1032 of the block X2000 becomes “8811”. Further, the memory controller 1020 sets the physical address of the latest data corresponding to the logical addresses LA = 2 and 3 of the address conversion table 1031 to Y1 and Y3 in the first physical addresses, and Y2 and Y3 of the page status register 1032. Is set to 0 (latest data). As a result, the value of the page status register 1032 of the block Y2010 becomes “0000”.

アドレス変換テーブル1031は、図2(c)で示すように、論理アドレスLA=2,3では、「A’、B’」の最新のデータを格納したブロックY2010の物理アドレス「Y2、Y3」が第1物理アドレスに設定され、不要となった直前のデータ「A,B」を格納したブロックX2000の物理アドレス「X2、X3」が第2物理アドレスに設定される。ひとつの論理アドレスに対して2つの物理アドレス関連付けることで、ホスト装置1100は最新のデータとスナップショットのデータにアクセスすることが可能となる。   In the address conversion table 1031, as shown in FIG. 2C, when the logical addresses LA = 2 and 3, the physical address “Y2, Y3” of the block Y2010 storing the latest data of “A ′, B ′” is stored. The physical address “X2, X3” of the block X2000 that stores the data “A, B” immediately before being set as the first physical address and becomes unnecessary is set as the second physical address. By associating two physical addresses with one logical address, the host device 1100 can access the latest data and snapshot data.

図2(d)、図3(a)は上記(4)のコマンドを処理中のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示し、図3(b)は上記(4)のコマンドが実行完了した直後のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示したものである。論理アドレスLA=3のデータ「D”」のライトコマンド(4)を受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、状態値=F(未書込)である1つのページZ0を選択し、当該ページZ0にデータ「D”」を書く。   2D and 3A show the internal states of the flash memory 1040 and the nonvolatile RAM 1030 that are processing the command of the above (4), and FIG. 3B shows the completion of execution of the command of the above (4). The internal states of the flash memory 1040 and the nonvolatile RAM 1030 immediately after the operation are shown. When receiving the write command (4) of the data “D” ”of the logical address LA = 3, the memory controller 1020 refers to the page status register 1032 and one page Z0 whose status value = F (unwritten). And data “D” ”is written in the page Z0.

次に、メモリコントローラ1020は、アドレス変換テーブル1031から論理アドレスLA=3の第1物理アドレスであるY3を検知し、更新されたデータ「D’」に対応するページ状態レジスタ1032のY3のページ状態値を8(無効データ)に設定する。そして、アドレス変換テーブル1031の論理アドレスLA=3の第1物理アドレスに新たに書き込んだデータ「D”」に対応する物理アドレスZ0を設定し、ページ状態レジスタ1032のZ0のページ状態値を0(最新データ)に設定する。図2(d)は、データD”を書き込んだ時点のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示している。これにより、ブロックY2010のページ状態レジスタ1032の状態値は「0008」となり、ブロックZ2020のページ状態レジスタ1032の状態値は「0FFF」となる。   Next, the memory controller 1020 detects Y3 which is the first physical address of the logical address LA = 3 from the address conversion table 1031 and the page state of Y3 of the page state register 1032 corresponding to the updated data “D ′”. Set the value to 8 (invalid data). Then, the physical address Z0 corresponding to the newly written data “D” ”is set to the first physical address of the logical address LA = 3 in the address conversion table 1031 and the page status value of Z0 of the page status register 1032 is set to 0 ( Set to (Latest data). FIG. 2D shows the internal state of the flash memory 1040 and the nonvolatile RAM 1030 when the data D ″ is written. As a result, the state value of the page state register 1032 of the block Y2010 becomes “0008”. The status value of the page status register 1032 of Z2020 is “0FFF”.

さて、ここでメモリコントローラ1020は、データが未書込のページの総数が所定数(例えば、ブロックX〜Zの未書き込みの総ページ数が3個)以下になったことを契機として、論理アドレスLA=0〜3の未書き込みページの総数を増やすため、以下のようなブロッククリーンアップ処理を行う。この処理では、フラッシュメモリ1040の特性により、データの消去を行う際にはブロック単位で消去を行うため、最新のデータまたはスナップショットとして保存するデータがブロック内にある場合は、これらのデータを他のブロックに退避させてから当該ブロックの消去を実行する。   Here, the memory controller 1020 uses the logical address as a trigger when the total number of unwritten pages has become equal to or less than a predetermined number (for example, the total number of unwritten pages in the blocks X to Z is three). In order to increase the total number of unwritten pages with LA = 0-3, the following block cleanup process is performed. In this processing, due to the characteristics of the flash memory 1040, when erasing data, the data is erased in units of blocks. If the latest data or data to be saved as a snapshot is in the block, these data are The block is erased after evacuating to that block.

まず、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、ページ状態値=8(無効データ)のページを最も多く含むブロックX2000を選択する。そして、メモリコントローラ1020は消去対象のブロックX2000内で保存が必要なデータを格納したページ、つまりページ状態値=0(最新のデータ)または1(スナップショットのデータ)の何れかである2つのページX2、X3を退避すべきページとして検出する。   First, the memory controller 1020 refers to the page status register 1032 and selects the block X2000 including the most pages with page status value = 8 (invalid data). Then, the memory controller 1020 stores the page storing data that needs to be saved in the block X2000 to be erased, that is, two pages with either the page status value = 0 (latest data) or 1 (snapshot data). X2 and X3 are detected as pages to be saved.

次に、メモリコントローラ1020は、退避対象のページの各格納データC、Dを、今回は消去しないブロックZ2020のページ状態値=F(未書込)のページZ1、Z2にコピーする。そして、コピーが完了するとページ状態レジスタ1032のX2、X3のページ状態値をそれぞれZ1、Z2のページ状態値にコピーし、X2、X3のページ状態値を8(無効データ)に設定する。   Next, the memory controller 1020 copies the stored data C and D of the page to be saved to the pages Z1 and Z2 of the page state value = F (unwritten) of the block Z2020 that is not erased this time. When the copying is completed, the page status values X2 and X3 of the page status register 1032 are copied to the page status values Z1 and Z2, respectively, and the page status values X2 and X3 are set to 8 (invalid data).

そして、メモリコントローラ1020はアドレス変換テーブル1031で、ブロックX2000からブロックZ2020へ退避したデータのブロックX2000における物理アドレスX2、X3が設定されている2つの欄を検索し、それぞれの欄に新たな格納先であるブロックZ2020の物理アドレスZ1、Z2を設定する。   Then, the memory controller 1020 searches the address conversion table 1031 for two columns in which physical addresses X2 and X3 in the block X2000 of the data saved from the block X2000 to the block Z2020 are set, and a new storage destination is stored in each column. The physical addresses Z1 and Z2 of the block Z2020 are set.

これにより、消去対象のブロックX2000のページ状態値は、「8888」となって全てのページが無効データとなり、退避先のブロックZ2020のページ状態値は「011F」となってスナップショットのデータをページ2、3に含むブロックとなる。   As a result, the page status value of the block X2000 to be erased becomes “8888”, all pages become invalid data, the page status value of the save destination block Z2020 becomes “011F”, and the snapshot data is paged. It becomes a block included in 2 and 3.

図3(a)はブロックX2000のスナップショットをブロックZ2020へ移動した後のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示している。   FIG. 3A shows an internal state of the flash memory 1040 and the nonvolatile RAM 1030 after the snapshot of the block X2000 is moved to the block Z2020.

次に、メモリコントローラ1020はブロックX2000を消去し、ブロックX2000のページ状態値=FFFFに設定する。図3(b)はブロックX2000を消去が完了した時点のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示している。以上がブロッククリーンアップ処理である。これにより、データが未書込のページの総数は3個から5個に増える。   Next, the memory controller 1020 erases the block X2000 and sets the page state value of the block X2000 = FFFF. FIG. 3B shows the internal state of the flash memory 1040 and the nonvolatile RAM 1030 when the erasure of the block X2000 is completed. The above is the block cleanup process. As a result, the total number of unwritten pages increases from 3 to 5.

次に、上記(5)に示したリードコマンドを受信すると、メモリコントローラ1020は、要求された論理アドレスLA0〜3を参照するため、図3(b)のアドレス変換テーブル1031から論理アドレスLA=0、1、2、3に対応する第1物理アドレスのページY0、Y1、Y2、Z0を検出し、これらの物理アドレスY0、Y1、Y2、Z0が指し示すページに格納されたデータA’、B’、C’、D”を読み出し、ホスト装置1100に送信する。これらは、各論理アドレスに最後に格納されたデータとなる。   Next, when receiving the read command shown in (5) above, the memory controller 1020 refers to the requested logical addresses LA0 to LA3, so that the logical address LA = 0 from the address conversion table 1031 of FIG. , 1, 2 and 3 are detected, and the data A ′, B ′ stored in the pages indicated by these physical addresses Y0, Y1, Y2, Z0 are detected. , C ′, D ″ are read and transmitted to the host device 1100. These are the data stored last at each logical address.

次に上記(6)に示した論理アドレスLA=0〜3のリカバリコマンドを受信すると、メモリコントローラ1020は、図3(b)に示したアドレス変換テーブル1031から論理アドレスLA=0、1に対応する第1物理アドレスのページY0、Y1を検出し、さらに、論理アドレスLA=2、3に対応する第2物理アドレスのページZ1、Z2を検出し、これらの検出した物理アドレスが指すページに格納されたデータA’、B’、C、Dを読み出し、ホスト装置1100に送信する。これらは、スナップショットコマンドを受信した時点で各論理アドレスLAに格納されていたデータとなる。なお、論理アドレスLA=0、1のデータA’、B’はスナップショットコマンドを受信して以来更新されていないため、論理アドレスLA=0、1の第2物理アドレスは未設定であるため、第1物理アドレスのページを参照する。   Next, when receiving the recovery command of the logical address LA = 0-3 shown in (6) above, the memory controller 1020 corresponds to the logical address LA = 0, 1 from the address conversion table 1031 shown in FIG. Pages Y0 and Y1 of the first physical address to be detected, and pages Z1 and Z2 of the second physical address corresponding to the logical addresses LA = 2 and 3 are detected, and stored in the page indicated by these detected physical addresses. The read data A ′, B ′, C, and D are read and transmitted to the host device 1100. These are the data stored in each logical address LA when the snapshot command is received. Since the data A ′ and B ′ of the logical address LA = 0 and 1 have not been updated since the reception of the snapshot command, the second physical address of the logical address LA = 0 and 1 is not set. Refer to the page of the first physical address.

次に、上記(7)のスナップショット機能の解除コマンドを受信すると、メモリコントローラ1020は、スナップショットフラグ1033にOFFを設定する。これ以降のリードコマンドでは、各論理アドレスに最後に格納されたデータのみが読み出し可能になる。すなわち、アドレス変換テーブル1031の第1物理アドレスのみを参照し、第2物理アドレスを無効として、スナップショットデータの参照を禁止する。   Next, when the snapshot function cancel command (7) is received, the memory controller 1020 sets the snapshot flag 1033 to OFF. In subsequent read commands, only the data stored last at each logical address can be read. That is, only the first physical address in the address conversion table 1031 is referred to, the second physical address is invalidated, and reference to the snapshot data is prohibited.

図3(c)は上記(8)に示したデータB”のライトコマンドを実行した直後のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示したものである。論理アドレスLA=1に対するデータ「B”」のライトコマンドを受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、ページ状態値=F(未書込)である1つのページZ3を選択し、このブロックZ2020のページ3にデータB”を書く。次に、メモリコントローラ1020は、アドレス変換テーブル1031から論理アドレスLA=1の第1物理アドレスであるY1を検知し、ページ状態レジスタ1032のY1のページ状態値を8(無効データ)に設定する。そして、アドレス変換テーブル1031の論理アドレスLA=1の第1物理アドレスに今回書き込みを行ったページの物理アドレス=Z3を設定し、ページ状態レジスタ1032のZ3のページ状態値を0(最新データ)に設定する。   3C shows the internal state of the flash memory 1040 and the nonvolatile RAM 1030 immediately after the execution of the write command for the data B ″ shown in (8) above. The data “B” for the logical address LA = 1. When the write command “” is received, the memory controller 1020 refers to the page status register 1032 to select one page Z3 with page status value = F (unwritten), and to page 3 of this block Z2020. Next, the memory controller 1020 detects Y1 which is the first physical address of the logical address LA = 1 from the address conversion table 1031 and sets the page status value of Y1 in the page status register 1032 to 8 (invalid Data) and the logical address LA = 1 in the address conversion table 1031 Set the physical address = Z3 of a page into a physical address this has been written, a page status value of Z3 of the page status register 1032 is set to 0 (latest data).

メモリコントローラ1020の書き込み処理は、ブロックの物理アドレスの先頭から末尾に向けて順次書き込みを行い、該当ブロックに空きページが無くなると、隣のブロックに書き込みを行う。このため、メモリコントローラ1020は、ブロックX2000は全てのページが書き込み可能ではあるが、現在書き込み中のブロックZ2020の空きページを消費する。   In the writing process of the memory controller 1020, writing is sequentially performed from the beginning to the end of the physical address of the block, and when there is no empty page in the corresponding block, writing is performed on the adjacent block. Therefore, the memory controller 1020 consumes an empty page of the block Z2020 currently being written, although all pages can be written in the block X2000.

図3(d)は上記(9)に示した論理アドレスLA=2へデータC”のライトコマンドを実行した直後のフラッシュメモリ1040及び不揮発性RAM1030の内部状態を示したものである。論理アドレスLA=2へのライトコマンドを受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、ページ状態値=F(未書込)である1つのページX0を選択し、このページX0にデータC”を書く。メモリコントローラ1020は、前回書き込みを行ったブロックZ2020に空きページが無いことから、次のブロックであるX2000のページ状態レジスタ1032を参照する。メモリコントローラ1020は、論理アドレスLA=0〜3に割り当てられたブロックX2000〜Z2020の空きページを循環して順次使用していくため、ブロックZ2020に空きページがなければ次のブロックX2000を参照する。   3D shows the internal state of the flash memory 1040 and the non-volatile RAM 1030 immediately after executing the write command of the data C ″ to the logical address LA = 2 shown in the above (9). When the write command to = 2 is received, the memory controller 1020 refers to the page status register 1032 to select one page X0 with the page status value = F (unwritten), and stores data C in this page X0. "write. The memory controller 1020 refers to the page status register 1032 of the next block X2000 because there is no empty page in the previously written block Z2020. Since the memory controller 1020 circulates and sequentially uses the empty pages of the blocks X2000 to Z2020 assigned to the logical addresses LA = 0 to 3, if there is no empty page in the block Z2020, the memory controller 1020 refers to the next block X2000.

次に、メモリコントローラ1020は、アドレス変換テーブル1031から論理アドレスLA=2の第1物理アドレス、第2物理アドレスであるY2、Z1を検知し、ページ状態レジスタ1032のY2、Z1のページ状態値を8(無効データ)に設定する。そして、アドレス変換テーブル1031の論理アドレスLA=2の第1物理アドレスに、新たに書き込んだデータC”の物理アドレス=X0を設定し、第2物理アドレスをクリアする。最後に、メモリコントローラ1020は、新たにデータC”を書き込んだページ状態レジスタ1032のX0のページ状態値を0(最新データ)に設定する。   Next, the memory controller 1020 detects the Y2 and Z1 which are the first physical address and the second physical address of the logical address LA = 2 from the address conversion table 1031, and sets the page status values of Y2 and Z1 of the page status register 1032. Set to 8 (invalid data). Then, the physical address = X0 of the newly written data C ″ is set in the first physical address of the logical address LA = 2 in the address conversion table 1031 to clear the second physical address. Finally, the memory controller 1020 Then, the page status value X0 of the page status register 1032 to which data C ″ is newly written is set to 0 (latest data).

これにより、スナップショット機能を解除した後には更新直前のデータC’だけでなく、スナップショットデータDも無効化される。   As a result, not only the data C ′ immediately before the update but also the snapshot data D are invalidated after the snapshot function is canceled.

図4は、ホスト装置1100から受信したコマンドについて、メモリコントローラ1020が実行する処理手順を示すフローチャートである。以下、その手順を説明する。   FIG. 4 is a flowchart showing a processing procedure executed by the memory controller 1020 for a command received from the host device 1100. The procedure will be described below.

まず、受信したコマンドが何であるかを判定する(4010)。   First, it is determined what the received command is (4010).

上記4010のコマンド判定結果がスナップショットコマンドならばスナップショットフラグ1033をONに設定し(4020)、コマンド処理を終える。   If the command determination result in 4010 is a snapshot command, the snapshot flag 1033 is set to ON (4020), and the command processing ends.

上記4010のコマンド判定結果が通常動作開始コマンドならばスナップショットフラグ1033をOFFに設定し(4030)、コマンド処理を終える。   If the command determination result in 4010 is a normal operation start command, the snapshot flag 1033 is set to OFF (4030), and the command processing ends.

書き込んだコマンド判定結果がライトコマンドならば、ホスト装置1100からライトするためのデータを受信し(4040)、ページ状態値=Fのページを選択し、そのページに受信したデータを書く(4050)。このとき、未書き込みのページ状態値「F」の検索は、前回の書き込みの次のページから上記ブロックX2000〜Z2020へ向けて順次実行する。   If the written command determination result is a write command, data for writing from the host device 1100 is received (4040), a page with a page state value = F is selected, and the received data is written on that page (4050). At this time, the search for the unwritten page status value “F” is sequentially executed from the next page after the previous writing toward the blocks X2000 to Z2020.

次に、スナップショットフラグ1033がONか調べ(4060)、結果が真(ON)ならばアドレス変換テーブル1031において書き込み先に指定された論理アドレスに対応する第2物理アドレスが未設定か否かを調べ(4070)、結果が真(未設定)ならばその論理アドレスに対応する第1物理アドレスの値を、この論理アドレスLAに対応する第2物理アドレスの欄にコピーする(4080)。そして、ページ状態レジスタ1032において上記第2物理アドレスが指すページのページ状態値を1に設定し、スナップショットであることを示す(4090)。次に、アドレス変換テーブル1031におけるこの論理アドレスに対応する第1物理アドレスの欄には、ステップ4050で受信データを書き込んだページの物理アドレスを設定し(4100)、ページ状態レジスタ1032においてこの論理アドレスLAの第1物理アドレスが指すページのページ状態値を0に設定する(4110)。この後、ブロッククリーンアップ処理を行い(4120)、コマンド処理を終える。   Next, it is checked whether the snapshot flag 1033 is ON (4060). If the result is true (ON), whether or not the second physical address corresponding to the logical address designated as the write destination in the address conversion table 1031 is not set. Check (4070). If the result is true (not set), the value of the first physical address corresponding to the logical address is copied to the column of the second physical address corresponding to the logical address LA (4080). Then, the page status value of the page pointed to by the second physical address is set to 1 in the page status register 1032 to indicate that it is a snapshot (4090). Next, the physical address of the page to which the received data is written in step 4050 is set in the column of the first physical address corresponding to this logical address in the address conversion table 1031 (4100), and this logical address is set in the page status register 1032. The page state value of the page pointed to by the first physical address of LA is set to 0 (4110). Thereafter, block cleanup processing is performed (4120), and the command processing is completed.

一方、上記ステップ4060のスナップショット機能の判定結果が偽(OFF)、またはステップ4070の判定結果(スナップショットの設定の有無)が偽(設定済)ならば、ページ状態レジスタ1032において書き込み先の論理アドレスに対応する第1物理アドレスが指すページのページ状態値を8に設定する(4130)。そして、スナップショットフラグ1033がONか調べ(4140)、結果が真(ON)ならばステップ4100に遷移し、偽(OFF)ならばステップ4150に遷移する。   On the other hand, if the determination result of the snapshot function in step 4060 is false (OFF) or the determination result in step 4070 (whether or not snapshot is set) is false (set), the page state register 1032 indicates the logic of the write destination. The page state value of the page indicated by the first physical address corresponding to the address is set to 8 (4130). Whether the snapshot flag 1033 is ON is checked (4140). If the result is true (ON), the process proceeds to step 4100, and if it is false (OFF), the process proceeds to step 4150.

スナップショット機能が無効の場合のステップ4150では、アドレス変換テーブル1031において書き込み先論理アドレスに対応する第2物理アドレスが未設定かを調べ、結果が真(未設定)ならばステップ4100に遷移し、偽(設定済)ならばページ状態レジスタ1032においてその第2物理アドレスが指すページのページ状態値を8(無効データ)に設定し(4160)、アドレス変換テーブル1031における書き込み先論理アドレスに対応する第2物理アドレスの欄を未設定状態へとクリアする(4170)。   In step 4150 when the snapshot function is disabled, it is checked whether the second physical address corresponding to the write destination logical address is not set in the address conversion table 1031. If the result is true (not set), the process proceeds to step 4100. If false (set), the page status value of the page pointed to by the second physical address in the page status register 1032 is set to 8 (invalid data) (4160), and the page corresponding to the write destination logical address in the address conversion table 1031 is set. The column of 2 physical addresses is cleared to the unset state (4170).

ステップ4170の後は、ステップ4100に遷移する。なお、ライトコマンドで書き込みたい論理アドレスの範囲が複数セクタに渡る場合は、ステップ4060以降の処理は各セクタ毎に行う。   After step 4170, the process proceeds to step 4100. When the range of logical addresses to be written by the write command is over a plurality of sectors, the processing after step 4060 is performed for each sector.

ステップ4010のコマンド判定結果がリードコマンドならば、アドレス変換テーブル1031において本コマンドで指定された論理アドレスに対応する第1物理アドレスを検知し、そのアドレスが指すページからデータをリードする(4180)。そして、そのデータをホストへ送信し(4190)、コマンド処理を終える。   If the command determination result in step 4010 is a read command, the first physical address corresponding to the logical address specified by this command is detected in the address conversion table 1031 and data is read from the page pointed to by that address (4180). Then, the data is transmitted to the host (4190), and the command processing is finished.

ステップ4010のコマンド判定結果がリカバリリードコマンドならば、スナップショットフラグ1033がONか調べ(4200)、結果が真(ON)ならばアドレス変換テーブル1031において本コマンドで指定された論理アドレスに対応する第2物理アドレスが未設定かを調べ(4210)、結果が偽(設定済)ならばその第2物理アドレスが指すページからデータをリードする(4220)。そして、そのデータをホストへ送信し(4190)、コマンド処理を終える。一方、ステップ4200の結果が偽(OFF)ならばホスト装置1100が要求するデータは送信不可能であるため、エラーとしてコマンド処理を終える。ステップ4210の結果が真(未設定)ならばステップ4180に遷移する。すなわち、通常のリードコマンドのように処理される。なお、リカバリリードコマンドで読み出したい論理アドレスの範囲が複数セクタに渡る場合は、ステップ4200以降の処理は各セクタ毎に行う。   If the command determination result in step 4010 is the recovery read command, it is checked whether the snapshot flag 1033 is ON (4200). If the result is true (ON), the first address corresponding to the logical address specified by this command in the address conversion table 1031 is checked. Whether the two physical addresses are not set is checked (4210). If the result is false (set), data is read from the page indicated by the second physical address (4220). Then, the data is transmitted to the host (4190), and the command processing is finished. On the other hand, if the result of step 4200 is false (OFF), the data requested by the host device 1100 cannot be transmitted, and the command processing is terminated as an error. If the result of step 4210 is true (not set), the process proceeds to step 4180. That is, it is processed like a normal read command. If the range of logical addresses to be read by the recovery read command extends over a plurality of sectors, the processing after step 4200 is performed for each sector.

図5は、図4における4120に示したブロッククリーンアップ処理4120の詳細な処理手順を示すフローチャートである。以下、その手順を説明する。   FIG. 5 is a flowchart showing a detailed processing procedure of the block cleanup process 4120 shown at 4120 in FIG. The procedure will be described below.

まず、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、ページ状態値=F(未書込)のページの総数が所定の値(例えば、3)以下になったかを調べる(5010)。結果が偽(所定値より大きい)ならば何もせずにそのまま処理を終える。一方、結果が真(所定値以下)ならば、ページ状態値=8(無効データ)であるページを最も多く含むブロックを1つ選択し、消去対象ブロックとする。選択した消去対象ブロック中にあるページ状態値=0(最新データ)またはページ状態値=1(スナップショットデータ)であるページを全て検出する(5020)。ここで検出したページ数をNとし、退避対象ページとする。そして、選択した消去対象ブロック以外のブロック上にあるページ状態値=Fの未書込ページをN個選択し、ステップ5020で検出した退避対象ページに格納されたデータを、それぞれ未書込ページの1つにコピー(退避)する(5030)。次に、ページ状態レジスタ1032において、ステップ5020で検出した各退避対象ページのページ状態値(0または1)を、ステップ5030で実行したデータのコピー先ページのページ状態値へコピーする(5040)。そして、ステップ5020で検出したページのページ状態値を全て8(無効データ)に設定する(5050)。次に、アドレス変換テーブル1031上に設定された全ての第1・第2物理アドレスの中から上記ステップ5020で検出した対象対象ページのアドレスを検索することにより、そのアドレスが設定された欄を検出し、検出した欄にステップ5030でコピーを実行したコピー先ページの物理アドレスを移動する(5060)。つまり、アドレス変換テーブル1031で、コピー元の論理アドレスLAに対応する第1物理アドレスと第2物理アドレスを、コピー先の論理アドレスLAに対応する第1物理アドレスと第2物理アドレスへ移動して、コピー元の物理アドレスの値を消去する。これにより、ステップ5020で選択した消去対象ブロック内の全ページが無効化され、当該ブロックに格納されていた保存すべきページデータの退避も完了する。   First, the memory controller 1020 refers to the page status register 1032 and checks whether the total number of pages with page status value = F (unwritten) has become a predetermined value (for example, 3) or less (5010). If the result is false (greater than a predetermined value), the process is terminated without doing anything. On the other hand, if the result is true (below the predetermined value), one block including the most pages with the page state value = 8 (invalid data) is selected and set as an erase target block. All pages with page status value = 0 (latest data) or page status value = 1 (snapshot data) in the selected block to be erased are detected (5020). The number of pages detected here is N, and is a save target page. Then, N unwritten pages with page state value = F on the blocks other than the selected block to be erased are selected, and the data stored in the save target page detected at step 5020 is stored in each of the unwritten pages. It is copied (saved) to one (5030). Next, the page status register 1032 copies the page status value (0 or 1) of each save target page detected in step 5020 to the page status value of the data copy destination page executed in step 5030 (5040). Then, all the page status values of the pages detected in step 5020 are set to 8 (invalid data) (5050). Next, by searching the address of the target target page detected in step 5020 from all the first and second physical addresses set on the address conversion table 1031, the column in which the address is set is detected. Then, the physical address of the copy destination page for which copying was executed in step 5030 is moved to the detected field (5060). That is, in the address conversion table 1031, the first physical address and the second physical address corresponding to the copy source logical address LA are moved to the first physical address and the second physical address corresponding to the copy destination logical address LA. Delete the value of the physical address of the copy source. As a result, all pages in the block to be erased selected in step 5020 are invalidated, and the saving of page data to be saved stored in the block is completed.

次に、ステップ5020で選択したブロックを消去する(5070)。なお、この消去は、ブロック内の全ページに所定値を書き込むことである。そして、ページ状態レジスタ1032において、消去対象ブロック内の全ページのページ状態値をF(未書込)に設定し(5080)、処理を終える。   Next, the block selected in step 5020 is erased (5070). This erasing is to write a predetermined value to all pages in the block. Then, the page status register 1032 sets the page status value of all pages in the block to be erased to F (unwritten) (5080), and the processing is completed.

ここで、上記のアドレス変換テーブル1031の詳細な実装方法について言及する。アドレス変換テーブル1031上の第2物理アドレスの欄は、論理アドレスLAにより「設定済」であったり「未設定」であったりする。不揮発性RAM1030を用いてアドレス変換テーブル1031を実装するとき、第2物理アドレスの欄に相当する格納位置に何も値を書かないことは無論不可能である。そこで、「未設定」を意味する特別な値を定義し、その値を不揮発性RAM1030に書くことで、各第2物理アドレスが未設定であることを表現する。例えば、半導体記憶装置1000内のページを識別するのに必要な物理アドレスの範囲が31ビットの値で表現可能ならば、32ビットの値“FFFFFFFF(16進数)”を「未設定」を意味する値として定義する。以上により、第2物理アドレスの欄に相当する格納位置にこの値が設定されていたら、メモリコントローラ1020は「第2物理アドレスが未設定」と判断する。また、メモリコントローラ1020が第2物理アドレスの欄に相当する格納位置にこの値を設定することは、「第2物理アドレスをクリアする」ことを意味する。   Here, a detailed mounting method of the address conversion table 1031 will be described. The column of the second physical address on the address conversion table 1031 is “set” or “not set” depending on the logical address LA. When mounting the address conversion table 1031 using the nonvolatile RAM 1030, it is of course impossible to write any value in the storage position corresponding to the column of the second physical address. Therefore, a special value meaning “not set” is defined, and the value is written in the nonvolatile RAM 1030 to express that each second physical address is not set. For example, if the range of physical addresses necessary to identify a page in the semiconductor memory device 1000 can be expressed by a 31-bit value, the 32-bit value “FFFFFFFF (hexadecimal number)” means “not set”. Define as a value. As described above, if this value is set in the storage position corresponding to the column of the second physical address, the memory controller 1020 determines that “the second physical address is not set”. Further, setting this value at the storage position corresponding to the column of the second physical address by the memory controller 1020 means “clearing the second physical address”.

以上、本発明の実施形態の一つを説明したが、アドレス変換テーブル1031を拡張することによってスナップショット機能の高機能化も可能である。例えば、アドレス変換テーブル1031に第3〜第5物理アドレスの欄を追加すれば、最大4世代のスナップショットデータを管理することができる。その場合、リカバリリードコマンドを、世代を表すパラメータを与えられるように機能拡張して、ホスト装置1100が所望の世代のスナップショットデータを読み出しできるようにすることが好ましい。   Although one embodiment of the present invention has been described above, the snapshot function can be enhanced by extending the address conversion table 1031. For example, if a third to fifth physical address column is added to the address conversion table 1031, it is possible to manage a maximum of four generations of snapshot data. In this case, it is preferable to extend the function of the recovery read command so that a parameter indicating the generation is given so that the host device 1100 can read snapshot data of a desired generation.

さらに、本発明を適用した半導体記憶装置1000で行われるブロッククリーンアップ処理について、消去するブロックの決定条件は上記の「含まれる無効ページの数が最大であること」だけに限らない。フラッシュメモリの各ブロックが消去された回数をカウントして「消去回数が最小であること」を条件にしてもよく、様々な条件を適用することが可能である。   Furthermore, in the block cleanup process performed in the semiconductor memory device 1000 to which the present invention is applied, the determination condition of the block to be erased is not limited to the above “the number of invalid pages included is the maximum”. The number of times each block of the flash memory is erased may be counted to make the condition that “the number of times of erasure is minimum”, and various conditions can be applied.

さらに、上に述べたスナップショット機能の開始を指示するのはホスト装置1100からのコマンドによるものに限らない。半導体記憶装置1000自身が自らの判断で開始することも可能である。例えば、フラッシュメモリの各ブロックの消去回数が非常に多くなることで記憶装置としての残り寿命がもはや短いとメモリコントローラ1020が判断したときに、スナップショットフラグ1033を自動的にONにしてもよい。   Further, the start of the snapshot function described above is not limited to a command from the host device 1100. It is also possible for the semiconductor memory device 1000 itself to start with its own judgment. For example, the snapshot flag 1033 may be automatically turned on when the memory controller 1020 determines that the remaining life of the storage device is no longer short because the number of erases of each block of the flash memory is very large.

さらに、上記第1の実施形態では、ホスト装置1100が最新データとスナップショットデータをそれぞれ読み出すために、リードコマンドとリカバリリードコマンドの2種類が備えられていたが、この方式に限らない。例えば、通常のリードコマンドとリードデータ選択コマンドの2種類を用いる方式も可能である。その場合、リードデータ選択コマンドで読みたいデータを最新またはスナップショットの2つから1つ選択した後、通常のリードコマンドでそれを読む。   Further, in the first embodiment, two types of read command and recovery read command are provided in order for the host device 1100 to read the latest data and snapshot data, respectively, but this is not restrictive. For example, a method using two types of a normal read command and a read data selection command is also possible. In that case, after selecting one of the latest or snapshot data to be read by the read data selection command, the data is read by a normal read command.

<第2実施形態>
本第2実施形態は最大3世代のスナップショットデータを管理することができる半導体記憶装置を開示する。第1の実施形態でも複数世代のスナップショットデータが管理できることについて言及したが、本第2実施形態ではアドレス変換テーブル1031、ページ状態レジスタ1032、スナップショットフラグ1033の構成や使用方法を第1の実施形態に対して変更し、また、メモリコントローラ1020は取得した複数のスナップショットのうち指定した世代番号のものを個別に解放するためのコマンドを解釈する点が前記第1実施形態と異なる。その他の構成は、前記第1実施形態である。
<Second Embodiment>
The second embodiment discloses a semiconductor memory device that can manage snapshot data of up to three generations. In the first embodiment, it has been mentioned that snapshot data of a plurality of generations can be managed. In the second embodiment, the configuration and usage of the address translation table 1031, the page status register 1032 and the snapshot flag 1033 are described in the first embodiment. The memory controller 1020 is different from the first embodiment in that the memory controller 1020 interprets a command for individually releasing a specified generation number among a plurality of acquired snapshots. The other configuration is the first embodiment.

本発明を適用した半導体記憶装置の簡単な内部構成は、第1の実施形態と同じく図1で表される。以下、第1の実施形態とは異なる部分について説明する。   A simple internal configuration of a semiconductor memory device to which the present invention is applied is shown in FIG. 1 as in the first embodiment. Hereinafter, a different part from 1st Embodiment is demonstrated.

本第2の実施形態におけるメモリコントローラ1020が解釈可能な5種類のコマンドとその機能を以下に示す。   The five types of commands that can be interpreted by the memory controller 1020 in the second embodiment and their functions are shown below.

・リードデータ選択コマンド…リードコマンドで読み出すデータの種類(世代)を、最新/第N世代スナップショット(N=0〜3)の中から選択する。ただし、世代番号Nの大小は世代の新旧とは必ずしも一致しない。   Read data selection command: Selects the type (generation) of data read by the read command from the latest / Nth generation snapshots (N = 0 to 3). However, the generation number N is not necessarily the same as the generation.

・リードコマンド…指定した論理アドレスにこれまでに格納されてきたデータのうち、リードデータ選択コマンドで選択している種類のものを読み出す。   Read command: Reads data of the type selected by the read data selection command from the data stored so far at the specified logical address.

・ライトコマンド…指定した論理アドレスに最新のデータを書き込む。   • Write command: Writes the latest data to the specified logical address.

・スナップショット取得コマンド…その時点での各論理アドレスに格納されているデータを、後で読み出しできるようにする。スナップショットの取得に成功した場合にはリードデータ選択コマンドやスナップショット解放コマンドで用いる世代番号を返す。   Snapshot acquisition command: The data stored at each logical address at that time can be read later. If the snapshot acquisition is successful, the generation number used in the read data selection command and snapshot release command is returned.

・スナップショット解放コマンド…指定した世代番号のスナップショットデータを廃棄し、それ以降読み出せないようにする。   -Snapshot release command: Discards the snapshot data of the specified generation number so that it can no longer be read.

第2の実施形態におけるアドレス変換テーブル1031では、1つの論理アドレスに対して4つの物理アドレス(以降、第1物理アドレス、第2物理アドレス、第3物理アドレス、第4物理アドレスと呼ぶ)を対応付ける。第1物理アドレスは、その論理アドレスに最後に書かれたデータ(最新データ)の格納位置(物理アドレス)を格納する。第2〜4物理アドレスは、ホスト装置1100がスナップショット取得コマンドを受信した時点における各論理アドレスに格納されていた最新のデータの格納位置を世代毎に格納する。本第2実施形態では、メモリコントローラ1020が管理するスナップショットの世代は、最大3世代まで示すことができるものとする。   In the address conversion table 1031 in the second embodiment, four physical addresses (hereinafter referred to as a first physical address, a second physical address, a third physical address, and a fourth physical address) are associated with one logical address. . The first physical address stores a storage position (physical address) of data (latest data) written last in the logical address. The second to fourth physical addresses store the storage positions of the latest data stored in the respective logical addresses at the time when the host device 1100 receives the snapshot acquisition command for each generation. In the second embodiment, it is assumed that the maximum number of snapshot generations managed by the memory controller 1020 can be indicated.

第2の実施形態におけるページ状態レジスタ1032が格納するページ状態としては以下の4通りを定義する。なお、各状態値は16進数表記である。   The following four types of page states stored in the page state register 1032 in the second embodiment are defined. Each state value is expressed in hexadecimal.

・状態値=0…ホスト装置1100が読み出し可能な有効データが格納されている状態
・状態値=8…もはや必要のない無効データが格納されている状態
・状態値=F…そのページを含むブロックが消去されて以来、データが未書込である状態
第2の実施形態におけるスナップショットフラグ1033は、スナップショットの世代番号(1〜3)毎にその世代が取得済み(ON)か解放済み(OFF)かを3世代分管理する。
State value = 0: State in which valid data that can be read by the host device 1100 is stored. State value = 8: State in which invalid data that is no longer necessary is stored. State value = F: Block including the page In a state where data has not been written since erasure of the snapshot flag 1033 in the second embodiment, the generation has been acquired (ON) or released for each snapshot generation number (1-3) ( OFF) for 3 generations.

さらに、第2の実施形態のメモリコントローラ1020は揮発性RAMを搭載し、ホスト装置1100がリードデータ選択コマンドで選択した種類(世代:N=0〜3)を一時的にその揮発性RAMの一部の領域に保持する。以下、揮発性RAMのその領域をリードデータ選択レジスタと呼ぶ。リードデータ選択レジスタが格納する種類値(世代の指定値)としては以下の4通りを定義する。なお、リードデータ選択レジスタは半導体記憶装置1000の電源投入直後は種類値=0に初期化される。
・種類値=0…最新データ(初期値)
・種類値=1…第1世代スナップショットデータ
・種類値=2…第2世代スナップショットデータ
・種類値=3…第3世代スナップショットデータ
図6および図7は、本発明を適用した半導体記憶装置1000においてスナップショット機能を利用するときに、メモリコントローラ1020が行うメモリ管理方法を説明するため、フラッシュメモリ1040内の格納データ、アドレス変換テーブル1031、ページ状態レジスタ1032、スナップショットフラグ1033、それぞれの内容の変化の一例を示したものである。図6(a)から始まり、図6(b)、図6(c)、図6(d)、図6(e)、図7(a)、図7(b)、図7(c)、図7(d)と遷移して、図7(e)で終わる。
Furthermore, the memory controller 1020 of the second embodiment is equipped with a volatile RAM, and the type (generation: N = 0 to 3) selected by the host device 1100 with the read data selection command is temporarily stored in the volatile RAM. Hold in the area of the part. Hereinafter, the area of the volatile RAM is referred to as a read data selection register. The following four types are defined as the kind values (generation specified values) stored in the read data selection register. The read data selection register is initialized to type value = 0 immediately after the semiconductor memory device 1000 is powered on.
・ Type value = 0 ... Latest data (initial value)
Type value = 1: 1st generation snapshot data Type value = 2: 2nd generation snapshot data Type value = 3: 3rd generation snapshot data FIGS. 6 and 7 show semiconductor memory to which the present invention is applied. In order to explain the memory management method performed by the memory controller 1020 when the snapshot function is used in the apparatus 1000, the storage data in the flash memory 1040, the address conversion table 1031, the page status register 1032, the snapshot flag 1033, An example of the change of the content is shown. Starting from Fig. 6 (a), Fig. 6 (b), Fig. 6 (c), Fig. 6 (d), Fig. 6 (e), Fig. 7 (a), Fig. 7 (b), Fig. 7 (c), Transition to FIG. 7D ends with FIG.

図示の例では、説明を簡単化するため、ホスト装置1100から指定可能な論理アドレスはセクタ単位(1セクタ=512バイト)として、その範囲を0〜3の4セクタ分に限定する。また、データの読み書きにメモリチップ1041〜1043内の3個のブロック(ブロックX2000、ブロックY2010、ブロックZ2020)のみを使用することとする。さらに、メモリチップ内の各ブロック2000〜2020は、それぞれ4つのページで構成され、各ページのサイズは512バイト(1セクタ)であるものとする。各ページは0〜3の数字で表し、ページの絶対的な物理アドレスをX3、Y0、Z1のように略記する。なお、アドレス変換テーブル1031において、LAは論理アドレス、第1PAは第1物理アドレス、第2PAは第2物理アドレス、第3PAは第3物理アドレスを意味する。なお、第4PA(第4物理アドレス)は存在するが本説明に用いないため図示を省略する。   In the illustrated example, in order to simplify the explanation, the logical address that can be specified from the host device 1100 is limited to four sectors of 0 to 3 as a sector unit (1 sector = 512 bytes). Further, only three blocks (block X2000, block Y2010, block Z2020) in the memory chips 1041 to 1043 are used for reading and writing data. Further, each block 2000 to 2020 in the memory chip is composed of four pages, and the size of each page is 512 bytes (one sector). Each page is represented by a number from 0 to 3, and the absolute physical address of the page is abbreviated as X3, Y0, or Z1. In the address conversion table 1031, LA means a logical address, first PA means a first physical address, second PA means a second physical address, and third PA means a third physical address. Although there is a fourth PA (fourth physical address), it is not used in the present description, and is not shown.

なお、第1物理アドレスは、複数の論理アドレス毎に対応するページの物理アドレスをそれぞれ格納するもので、各物理アドレスは最新データを格納したページを示す。また、第2物理アドレスは、複数の論理アドレス毎に対応するページの物理アドレスをそれぞれ格納するもので、各物理アドレスは第1世代のスナップショットを格納したページを示す。また、第3物理アドレスは、複数の論理アドレス毎に対応するページの物理アドレスをそれぞれ格納するもので、各物理アドレスは第2世代のスナップショットを格納したページを示す。また、第4物理アドレスは、複数の論理アドレス毎に対応するページの物理アドレスをそれぞれ格納するもので、各物理アドレスは第4世代のスナップショットを格納したページを示す。なお、第1物理アドレスが最新データのページの物理アドレスを角のする第1物理アドレスグループとなり、第2〜第4物理アドレスがスナップショットの物理アドレスを世代毎に格納する第2物理アドレスグループとなる。   The first physical address stores a physical address of a page corresponding to each of a plurality of logical addresses, and each physical address indicates a page storing the latest data. The second physical address stores a physical address of a page corresponding to each of a plurality of logical addresses, and each physical address indicates a page storing a first generation snapshot. The third physical address stores a physical address of a page corresponding to each of a plurality of logical addresses, and each physical address indicates a page storing a second generation snapshot. The fourth physical address stores a physical address of a page corresponding to each of a plurality of logical addresses, and each physical address indicates a page storing a fourth generation snapshot. The first physical address is a first physical address group that corners the physical address of the page of the latest data, and the second to fourth physical addresses are a second physical address group that stores the physical address of the snapshot for each generation. Become.

はじめに、スナップショットは全く未取得であるとし、図6(a)のように、物理ページアドレスのX0、X1、X2、X3の位置に、それぞれ論理アドレス0、1、2、3に対応するデータA、B、C、Dが既に格納されているものとする。なお、論理アドレス0,1,2,3は、メモリコントローラ1020によって割り当てられたものである。また、ブロックY2010およびブロックZ2020は消去済みで、どのページもデータが未書込とする。   First, it is assumed that no snapshot has been acquired, and data corresponding to logical addresses 0, 1, 2, and 3 at the physical page addresses X0, X1, X2, and X3, respectively, as shown in FIG. 6A. Assume that A, B, C, and D are already stored. The logical addresses 0, 1, 2, and 3 are assigned by the memory controller 1020. Further, the block Y2010 and the block Z2020 have been erased, and no data is written in any page.

このとき、アドレス変換テーブル1031において論理アドレスLA=nの各第1物理アドレズにはXn(n=0〜3)が設定され、どの論理アドレスも第2〜4物理アドレスが未設定であり、ページ状態レジスタ1032におけるブロックX、Y、Zのページ状態値はそれぞれ“0000”、“FFFF”、“FFFF”に設定され、スナップショットフラグ1033は3世代ともOFFに設定されている。   At this time, Xn (n = 0 to 3) is set to each first physical address of the logical address LA = n in the address conversion table 1031, the second to fourth physical addresses are not set for any logical address, and the page The page status values of the blocks X, Y, and Z in the status register 1032 are set to “0000”, “FFFF”, and “FFFF”, respectively, and the snapshot flag 1033 is set to OFF for all three generations.

また、リードデータ選択レジスタには「最新」を意味する種類値=0が設定されている。これは、リードコマンドで最新のデータが読み出し可能な状態である。   The read data selection register is set with a type value = 0 indicating “latest”. This is a state in which the latest data can be read by the read command.

この状態から、ホスト装置1100から以下の順で半導体記憶装置1000にコマンドを発行することとする。   From this state, the host device 1100 issues commands to the semiconductor memory device 1000 in the following order.

(1)論理アドレスLA=0、1にそれぞれデータA’、B’を書くライトコマンド
(2)スナップショット取得コマンド(第1世代)
(3)論理アドレスLA=2、3にそれぞれデータC’、D’を書くライトコマンド
(4)スナップショット取得コマンド(第2世代)
(5)論理アドレスLA=3にデータD’’を書くライトコマンド
(6)第1世代スナップショットを選択するリードデータ選択コマンド
(7)論理アドレスLA=0〜3のデータを読むリードコマンド
(8)第2世代スナップショットを選択するリードデータ選択コマンド
(9)論理アドレスLA=0〜3のデータを読むリードコマンド
(10)最新データを選択するリードデータ選択コマンド
(11)論理アドレスLA=0〜3のデータを読むリードコマンド
(12)第2世代を解放するスナップショット解放コマンド
(13)論理アドレスLA=2にデータC’’を書くライトコマンド
(14)第1世代を解放するスナップショット解放コマンド
(15)論理アドレスLA=3にデータD’’’を書くライトコマンド
図6(b)は上記(1)のライトコマンドを受信して処理を実行した直後のフラッシュメモリ1040及び不揮発性メモリ1030の内部状態を示したものである。ライトコマンド(1)を受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、論理アドレスLA=0、1に対応するブロックX2000のページが状態値=0となっており、既に最新のデータが書き込まれているので、同一の論理アドレスLAに対応する次のブロックであるブロックY2010のページ状態レジスタ1032を参照し、状態値=F(未書込)である2つのページY0、Y1を選択し、そこにそれぞれデータA’、B’を書き込む。なお、各ブロックへのデータの書き込みは、前記第1実施形態と同様に、各ブロック内の空きセクタへ所定の順序で行うもので、例えば、図6(b)では各ブロックの空きページの順に書き込む。
(1) Write command for writing data A ′ and B ′ at logical addresses LA = 0 and 1 respectively (2) Snapshot acquisition command (first generation)
(3) Write command for writing data C ′ and D ′ at logical addresses LA = 2 and 3 respectively (4) Snapshot acquisition command (second generation)
(5) Write command for writing data D ″ at logical address LA = 3 (6) Read data selection command for selecting first generation snapshot (7) Read command for reading data at logical address LA = 0-3 (8) ) Read data selection command for selecting second generation snapshot (9) Read command for reading data at logical address LA = 0 to 3 (10) Read data selection command for selecting latest data (11) Logical address LA = 0 to 0 3. Read command for reading 3 data (12) Snapshot release command for releasing second generation (13) Write command for writing data C ″ to logical address LA = 2 (14) Snapshot release command for releasing first generation (15) Write command for writing data D ′ ″ at logical address LA = 3 FIG. ) Is a write command shows the internal state of the flash memory 1040 and nonvolatile memory 1030 immediately after execution of the received and processed. When the write command (1) is received, the memory controller 1020 refers to the page status register 1032 and the page of the block X2000 corresponding to the logical address LA = 0, 1 has the status value = 0, and has already been updated. Since the data is written, the page status register 1032 of the block Y2010, which is the next block corresponding to the same logical address LA, is referred to, and the two pages Y0 and Y1 whose status value = F (unwritten) are Select and write data A ′ and B ′ respectively. Note that data writing to each block is performed in a predetermined order to empty sectors in each block as in the first embodiment. For example, in FIG. Write.

次に、メモリコントローラ1020は、アドレス変換テーブル1031から論理アドレスLA=0、1の各第1物理アドレスであるX0、X1を検知し、これらのブロックX2000のページ1、2は既に最新のデータが書き込まれたので、ページ状態レジスタ1032のX0、X1のページ状態値を8(無効データ)に設定する。そして、メモリコントローラ1020はアドレス変換テーブル1031の論理アドレスLA=0、1に対応する各第1物理アドレスに最新のデータを書き込んだブロックY2010の物理アドレスにY0、Y1を設定し、ページ状態レジスタ1032のY0、Y1に対応するページ状態値を0(有効データ)に設定する。   Next, the memory controller 1020 detects the first physical addresses X0 and X1 of the logical address LA = 0 and 1 from the address conversion table 1031, and the pages 1 and 2 of these blocks X2000 already have the latest data. Since it has been written, the page status values X0 and X1 of the page status register 1032 are set to 8 (invalid data). Then, the memory controller 1020 sets Y0 and Y1 to the physical address of the block Y2010 in which the latest data is written in each first physical address corresponding to the logical address LA = 0 and 1 in the address conversion table 1031, and the page status register 1032 The page state values corresponding to Y0 and Y1 are set to 0 (valid data).

次に、上記(2)のスナップショット取得コマンドを受信すると、メモリコントローラ1020は、アドレス変換テーブル1031の全論理アドレスLAについて、各論理アドレスLAの第1物理アドレスの内容をその第2物理アドレスの欄に複写する。その結果、これら第2物理アドレスは第1世代のスナップショットデータの格納先を示す。そして、メモリコントローラ1020は、スナップショットフラグ1033の世代1をONに設定し、世代番号「1」をホスト装置1100に返す。   Next, when the snapshot acquisition command (2) is received, the memory controller 1020 obtains the contents of the first physical address of each logical address LA for all the logical addresses LA in the address conversion table 1031 in the second physical address. Copy in the column. As a result, these second physical addresses indicate the storage destination of the first generation snapshot data. Then, the memory controller 1020 sets the generation 1 of the snapshot flag 1033 to ON, and returns the generation number “1” to the host device 1100.

図6(c)は上記(3)のライトコマンドを実行した直後の内部状態を示したものである。スナップショット取得コマンドを受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、状態値=F(未書込)である2つのページY2、Y3を選択し、これらのページY2,Y3にそれぞれデータC’、D’を書く。なお、第2物理アドレスには、上記(2)のスナップショット取得コマンドによる、第1物理アドレスの値が第1世代のスナップショットとして格納されている。   FIG. 6C shows the internal state immediately after the execution of the write command (3). When the snapshot acquisition command is received, the memory controller 1020 refers to the page status register 1032 and selects two pages Y2 and Y3 whose status value = F (unwritten), and sets these pages Y2 and Y3. Write data C 'and D' respectively. The second physical address stores the value of the first physical address by the snapshot acquisition command (2) as a first generation snapshot.

次に、メモリコントローラ1020は、アドレス変換テーブル1031で、論理アドレスLA=2、3の各第1物理アドレスの欄にあるX2、X3がそれぞれ第1世代のスナップショットデータを格納していることを第2物理アドレスから検出する。よって、メモリコントローラ1020は、第2物理アドレスのX2、X3のページ状態値は0(有効データ)のままにする。そして、アドレス変換テーブル1031の論理アドレスLA=2、3に対応する各第1物理アドレスに上記(3)のライトコマンドで書き込んだC’,D’に対応するY2、Y3を設定し、ページ状態レジスタ1032のY2、Y3のページ状態値を0(有効データ)に設定する。   Next, the memory controller 1020 indicates that X2 and X3 in the first physical address columns of the logical addresses LA = 2 and 3 respectively store the first generation snapshot data in the address conversion table 1031. Detect from the second physical address. Therefore, the memory controller 1020 keeps the page state values X2 and X3 of the second physical address as 0 (valid data). Then, Y2 and Y3 corresponding to C ′ and D ′ written by the write command of (3) are set in the first physical addresses corresponding to the logical addresses LA = 2 and 3 of the address conversion table 1031, and the page state The page status values of Y2 and Y3 of the register 1032 are set to 0 (valid data).

次に、上記(4)のスナップショット取得コマンドを受信すると、メモリコントローラ1020は、アドレス変換テーブル1031の全論理アドレスLAについて、各論理アドレスLAの第1物理アドレスの内容を第3物理アドレスの欄に複写する。その結果、これら第3物理アドレスは第2世代スナップショットデータの格納先を示す。そして、メモリコントローラ1020は、スナップショットフラグ1033の世代2をONに設定し、世代番号=2をホスト装置1100に返す。   Next, when receiving the snapshot acquisition command (4) above, the memory controller 1020 displays the contents of the first physical address of each logical address LA in the third physical address column for all logical addresses LA in the address conversion table 1031. Copy to. As a result, these third physical addresses indicate the storage destination of the second generation snapshot data. Then, the memory controller 1020 sets generation 2 of the snapshot flag 1033 to ON, and returns generation number = 2 to the host device 1100.

次に、上記(5)のライトコマンドを受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照し、状態値=F(未書込)であるページZ0を選択し、このページZ0にデータD’’を書く。次に、メモリコントローラ1020は、アドレス変換テーブル1031を参照し、論理アドレスLA=3の第1物理アドレスの欄にあるY3が第2世代スナップショットデータを格納していることを第3物理アドレスのLA=3にY3があることから検出する。よって、メモリコントローラ1020は、ページ状態レジスタ1033のY3のページ状態値は0(有効データ)のままにする。そして、メモリコントローラ1020はアドレス変換テーブル1031の論理アドレスLA=3の第1物理アドレスにZ0を設定し、ページ状態レジスタ1032のZ0のページ状態値を0(有効データ)に設定する。図6(d)は、上記(5)のライトコマンドを実行した直後の内部状態を示している。なお、図6(d)で第3物理アドレスには、上記(4)のスナップショット取得コマンドによって書き込まれた第2世代のスナップショットのページが格納され、スナップショットフラグ1033は、第2世代がONに設定される。   Next, when the write command (5) is received, the memory controller 1020 refers to the page status register 1032, selects the page Z0 whose status value = F (unwritten), and stores data D in this page Z0. ''write. Next, the memory controller 1020 refers to the address conversion table 1031 and confirms that Y3 in the column of the first physical address of the logical address LA = 3 stores the second generation snapshot data. It is detected because Y3 exists at LA = 3. Therefore, the memory controller 1020 keeps the page status value of Y3 of the page status register 1033 at 0 (valid data). Then, the memory controller 1020 sets Z0 to the first physical address of the logical address LA = 3 in the address conversion table 1031 and sets the page status value of Z0 of the page status register 1032 to 0 (valid data). FIG. 6D shows the internal state immediately after execution of the write command (5). In FIG. 6D, the second physical snapshot page written by the snapshot acquisition command in (4) above is stored in the third physical address, and the snapshot flag 1033 indicates that the second generation Set to ON.

さて、ここでメモリコントローラ1020は、データが未書込のページの総数が所定数(例えば、3個)以下になったことを契機として、未書込のページの総数を増やすため、以下のようなブロッククリーンアップ処理を行う。   Now, the memory controller 1020 increases the total number of unwritten pages when the total number of unwritten pages has reached a predetermined number (for example, 3) or less. Perform a clean block cleanup process.

まず、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、ページ状態値=8(無効データ)のページを最も多く含むブロックXを選択し、そのブロックX内で保存が必要なデータを格納したページをアドレス変更テーブル1031から検索し、ページ状態値=0である2つのページX2、X3を第2物理アドレスから検出する。次に、メモリコントローラ1020はページX2,X3の各格納データC、Dをページ状態値=F(未書込)のページZ1、Z2にコピーし、Z1、Z2のページ状態値を0(有効データ)に設定し、X2、X3のページ状態値を8(無効データ)に設定する。   First, the memory controller 1020 refers to the page status register 1032 to select a block X that includes the most pages with page status value = 8 (invalid data), and stores data that needs to be saved in the block X. The page is searched from the address change table 1031 and two pages X2 and X3 with page state value = 0 are detected from the second physical address. Next, the memory controller 1020 copies the stored data C and D of the pages X2 and X3 to the pages Z1 and Z2 of the page state value = F (unwritten), and sets the page state values of Z1 and Z2 to 0 (valid data). ) And the page status values of X2 and X3 are set to 8 (invalid data).

そして、メモリコントローラ1020はアドレス変換テーブル1031でX2、X3が設定されている2つの欄を検索し、第2物理アドレスの該当欄に移動したデータC、DのページZ1、Z2を設定する。   Then, the memory controller 1020 searches the two columns in which X2 and X3 are set in the address conversion table 1031 and sets the pages Z1 and Z2 of the data C and D moved to the corresponding column of the second physical address.

これにより、ブロックX2000は、保存が必要な格納データが別ブロックに退避され、全ページに無効データが格納された状態になる。図6(e)は、上記ブロッククリーンアップ処理によるデータの移動が完了した時点の内部状態を示している。   As a result, in the block X2000, storage data that needs to be saved is saved in another block, and invalid data is stored in all pages. FIG. 6E shows the internal state at the time when the data movement by the block cleanup process is completed.

次に、メモリコントローラ1020は、全てが無効データとなったブロックXの内容を消去し、ブロックXのページ状態値=FFFFに設定する。図7(a)はブロッククリーンアップ処理が完了した時点の内部状態を示している。以上がブロッククリーンアップ処理である。これにより、データが未書込のページの総数は図6(d)の3個から5個に増える。   Next, the memory controller 1020 erases the contents of the block X, all of which become invalid data, and sets the page state value of the block X to FFFF. FIG. 7A shows the internal state when the block cleanup process is completed. The above is the block cleanup process. As a result, the total number of unwritten pages increases from 3 to 5 in FIG.

次に、上記(6)の第1世代のスナップショットを選択するリードデータ選択コマンドを受信すると、メモリコントローラ1020は、リードデータ選択レジスタに種類値=1を設定する。   Next, when the read data selection command for selecting the first generation snapshot of (6) is received, the memory controller 1020 sets the type value = 1 in the read data selection register.

次に、上記(7)の論理アドレスLA=0〜3に対するリードコマンドを受信すると、メモリコントローラ1020は、リードデータ選択レジスタに設定された種類値が1であることからアドレス変換テーブル1031より論理アドレスLA=0、1、2、3に対応する第1世代のスナップショットを指し示す第2PAのページY0、Y1、Z1、Z2を検出し、これらのページに格納されたデータA’、B’、C、Dを読み出し、ホスト装置1100に送信する。これらは、図6(b)の時点で各論理アドレスLA=0〜3に格納されていたデータのスナップショットである。   Next, when the read command for the logical address LA = 0 to 3 in (7) is received, the memory controller 1020 determines that the type value set in the read data selection register is 1, so that the logical address is read from the address conversion table 1031. The second PA pages Y0, Y1, Z1, Z2 indicating the first generation snapshots corresponding to LA = 0, 1, 2, 3 are detected, and the data A ′, B ′, C stored in these pages are detected. , D are read out and transmitted to the host device 1100. These are snapshots of data stored in the logical addresses LA = 0 to 3 at the time of FIG.

次に、上記(8)の第2世代のスナップショットを選択するリードデータ選択コマンドを受信すると、メモリコントローラ1020は、リードデータ選択レジスタに種類値=2を設定する。   Next, when the read data selection command for selecting the second generation snapshot of (8) is received, the memory controller 1020 sets the type value = 2 in the read data selection register.

次に、上記(9)の論理アドレスLA=0〜3に対するリードを受信すると、メモリコントローラ1020は、リードデータ選択レジスタに設定された種類値=2であることからアドレス変換テーブル1031より論理アドレスLA=0、1、2、3の第2世代のスナップショットに対応する第3物理アドレスのページY0、Y1、Y2、Y3を検出し、それらのページに格納されたデータA’、B’、C’、D’を読み出し、ホスト装置1100に送信する。これらは、図6(c)時点で各論理アドレスに格納されていたデータのスナップショットである。   Next, when the read for the logical address LA = 0 to 3 in (9) is received, the memory controller 1020 has the logical value LA from the address conversion table 1031 because the type value set in the read data selection register = 2. Detect pages Y0, Y1, Y2, and Y3 of the third physical address corresponding to the second generation snapshots of 0, 1, 2, and 3 and data A ′, B ′, and C stored in those pages ', D' is read and transmitted to the host device 1100. These are snapshots of the data stored at each logical address as of FIG. 6 (c).

次に、上記(10)の最新のデータを選択するリードデータ選択コマンドを受信すると、メモリコントローラ1020は、リードデータ選択レジスタに種類値=0を設定する。   Next, when the read data selection command for selecting the latest data of (10) is received, the memory controller 1020 sets the type value = 0 in the read data selection register.

そして、上記(11)の論理アドレスLA=0〜3に対するリードコマンドを受信すると、メモリコントローラ1020は、リードデータ選択レジスタに設定された種類値が0であるので、アドレス変換テーブル1031から論理アドレスLA=0、1、2、3の最新データに対応する第1PAのページY0、Y1、Y2、Z0を検出し、それらのページに格納されたデータA’、B’、C’、D’’を読み出し、ホスト装置1100に送信する。これらは、各論理アドレスに格納されている最新データである。   When the memory controller 1020 receives the read command for the logical address LA = 0 to 3 in (11) above, the type value set in the read data selection register is 0, so the memory controller 1020 reads the logical address LA from the address conversion table 1031. = 0, 1, 2, 3 The first PA pages Y0, Y1, Y2, Z0 corresponding to the latest data are detected, and the data A ′, B ′, C ′, D ″ stored in those pages are detected. Read and transmit to the host device 1100. These are the latest data stored in each logical address.

図7(b)は上記(12)の第2世代のスナップショットを解放するスナップショット解放コマンドを実行した直後の内部状態を示したものである。上記(12)でスナップショット解放コマンドを受信すると、メモリコントローラ1020は、第2世代スナップショットデータを格納しているページを検出するため、アドレス変換テーブル1031から論理アドレスLA=0、1、2、3の第2世代のスナップショットに対応する第3物理アドレスのページY0、Y1、Y2、Y3を図7(a)の状態から取得する。第3物理アドレスのうちページY3以外は第1物理アドレスまたは第2物理アドレスにも登録されており、最新または第1世代スナップショットデータを格納しているため、無効ページにはならない。よってメモリコントローラ1020は、Y3だけを無効ページにするべく、ページ状態レジスタ1032のY3のページ状態を8(無効データ)に設定する。次に、メモリコントローラ1020はアドレス変換テーブル1031の全ての論理アドレスLAについて第3物理アドレスの欄をクリアする。最後に、メモリコントローラ1020は、スナップショットフラグ1033の世代=2をOFFに設定する。   FIG. 7B shows the internal state immediately after the execution of the snapshot release command for releasing the second generation snapshot of (12) above. When the snapshot release command is received in (12) above, the memory controller 1020 detects the page storing the second generation snapshot data, so that the logical address LA = 0, 1, 2,. The pages Y0, Y1, Y2, and Y3 of the third physical address corresponding to the third second-generation snapshot are acquired from the state of FIG. Of the third physical address, pages other than page Y3 are also registered in the first physical address or the second physical address, and since the latest or first generation snapshot data is stored, the page does not become an invalid page. Therefore, the memory controller 1020 sets the page status of Y3 in the page status register 1032 to 8 (invalid data) so that only Y3 is an invalid page. Next, the memory controller 1020 clears the third physical address column for all logical addresses LA in the address conversion table 1031. Finally, the memory controller 1020 sets the snapshot flag 1033 generation = 2 to OFF.

図7(c)は上記(13)の論理アドレスLA=2にデータC”を書き込むライトコマンドを実行した直後の内部状態を示したものである。上記(13)のライトコマンドを受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、状態値=F(未書込)であるページZ3を選択し、そこにデータC”を書き込む。次に、メモリコントローラ1020は、アドレス変換テーブル1031を検索して、論理アドレスLA=2の第1物理アドレスの欄にあるY2(図7(b)参照)がどの世代のスナップショットデータも格納していないことを検出する。よって、メモリコントローラ1020はページ状態レジスタ1032のY2のページ状態値を8(無効データ)に設定する。そして、アドレス変換テーブル1031のLA=2の第1物理アドレスにZ3を設定し、Z3のページ状態値を0(有効データ)に設定する。   FIG. 7C shows the internal state immediately after executing the write command for writing the data C ″ to the logical address LA = 2 in (13). When the write command in (13) is received, the memory The controller 1020 refers to the page status register 1032 to select the page Z3 whose status value = F (unwritten) and writes the data C ″ therein. Next, the memory controller 1020 searches the address conversion table 1031 and stores any generation of snapshot data in which Y2 (see FIG. 7B) in the first physical address column of the logical address LA = 2. Detect not. Therefore, the memory controller 1020 sets the page status value of Y2 of the page status register 1032 to 8 (invalid data). Then, Z3 is set to the first physical address of LA = 2 in the address conversion table 1031 and the page state value of Z3 is set to 0 (valid data).

図7(d)は上記(14)の第1世代のスナップショットを解放するスナップショット解放コマンドを実行した直後の内部状態を示したものである。上記(14)のスナップショット解放コマンドを受信すると、メモリコントローラ1020は、第1世代スナップショットデータを格納しているページを検知するため、アドレス変換テーブル1031から論理アドレスLA=0、1、2、3に対応する第2物理アドレスのページY0、Y1、Z1、Z2を検出する。このうちページY0とY1は第1物理アドレスにも登録されており、第1物理アドレスでは最新データを格納しているため、無効ページにはならない。よって第2物理アドレスのページZ1とZ2を無効ページにするべく、ページ状態レジスタ1032のZ1とZ2のページ状態を8(無効データ)に設定する。次に、メモリコントローラ1020は、アドレス変換テーブル1031の全ての論理アドレスLAについて第2物理アドレスの欄をクリアする。最後に、メモリコントローラ1020はスナップショットフラグ1033の世代=1をOFFに設定する。   FIG. 7D shows the internal state immediately after executing the snapshot release command for releasing the first generation snapshot of (14) above. When the snapshot release command (14) is received, the memory controller 1020 detects the page storing the first generation snapshot data, so that the logical address LA = 0, 1, 2,. The pages Y0, Y1, Z1, and Z2 of the second physical address corresponding to 3 are detected. Of these, pages Y0 and Y1 are also registered in the first physical address, and the latest data is stored in the first physical address. Therefore, the page states of Z1 and Z2 of the page state register 1032 are set to 8 (invalid data) in order to make the pages Z1 and Z2 of the second physical address invalid pages. Next, the memory controller 1020 clears the second physical address column for all logical addresses LA in the address conversion table 1031. Finally, the memory controller 1020 sets generation = 1 of the snapshot flag 1033 to OFF.

図7(e)は上記(15)の論理アドレスLA=3にデータD”’を書き込むライトコマンドを実行した直後の内部状態を示したものである。上記(15)のライトコマンドを受信すると、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、状態値=F(未書込)であるページX0を選択し、このページX0にデータD”’を書き込む。次に、メモリコントローラ1020はアドレス変換テーブル1031を参照し、論理アドレスLA=3の第1物理アドレスでの欄にあるページZ0がどの世代のスナップショットデータも格納していないことを検出する(図7(d)の状態)。よって、メモリコントローラ1020はページ状態レジスタ1032のZ0のページ状態値を8(無効データ)に設定する。そして、アドレス変換テーブル1031の論理アドレスLA=3の第1物理アドレスにページX0を設定し、X0のページ状態値を0(有効データ)に設定する。   FIG. 7E shows the internal state immediately after executing the write command for writing the data D ″ ′ to the logical address LA = 3 in (15). When the write command in (15) is received, The memory controller 1020 refers to the page status register 1032 and selects the page X0 whose status value = F (unwritten), and writes the data D ″ ′ to the page X0. Next, the memory controller 1020 refers to the address conversion table 1031 and detects that the page Z0 in the column of the first physical address of the logical address LA = 3 does not store any generation of snapshot data (see FIG. 7 (d) state). Therefore, the memory controller 1020 sets the page status value of Z0 of the page status register 1032 to 8 (invalid data). Then, the page X0 is set to the first physical address of the logical address LA = 3 in the address conversion table 1031 and the page status value of X0 is set to 0 (valid data).

図8は、ホスト装置1100から受信したコマンドについて、メモリコントローラ1020が実行する処理手順を示すフローチャートである。以下、その手順を説明する。   FIG. 8 is a flowchart showing a processing procedure executed by the memory controller 1020 for a command received from the host device 1100. The procedure will be described below.

まず、メモリコントローラ1020は受信したコマンドが何であるかを判定する(8010)。   First, the memory controller 1020 determines what the received command is (8010).

上記のコマンド判定結果がスナップショット取得コマンドならば、メモリコントローラ1020はスナップショットフラグ1033からOFF状態のエントリを検索する(8110)。ステップ8120でOFF状態のフラグが存在しないならば、スナップショットの許容回数を超えたとして、ホスト装置1100に取得失敗のエラーを返してコマンド処理を終える。   If the command determination result is a snapshot acquisition command, the memory controller 1020 searches the snapshot flag 1033 for an entry in the OFF state (8110). If there is no OFF flag in step 8120, it is determined that the allowable number of snapshots has been exceeded, an acquisition failure error is returned to the host device 1100, and the command processing is terminated.

一方、OFF状態のフラグ(第Mとする)が存在するならば、アドレス変換テーブル1031の全ての論理アドレスLAについて、第1物理アドレスの内容を第(M+1)物理アドレスの欄にコピーする(8130)。そして、スナップショットフラグ1033の世代MをONに設定し(8140)、このたび取得したスナップショットに割り当てられた世代番号Mをホスト装置1100に返し(8150)、コマンド処理を終える。   On the other hand, if there is an OFF flag (M-th), the contents of the first physical address are copied to the (M + 1) th physical address column for all logical addresses LA in the address conversion table 1031 (8130). ). Then, the generation M of the snapshot flag 1033 is set to ON (8140), the generation number M assigned to the acquired snapshot is returned to the host device 1100 (8150), and the command processing is completed.

ステップ8010でコマンド判定結果がスナップショット解放コマンドならば、そのコマンドに付加されたパラメータ(種類値)からホスト装置1100が解放したい世代番号(Mとする)を抽出する。ステップ8210でスナップショットフラグ1033の世代MがOFFに設定されていれば(つまり解放済みならば)ホスト装置1100に解放失敗のエラーを返してコマンド処理を終える。一方、スナップショットフラグ1033の世代MがONに設定されていれば、アドレス変換テーブル1031の全ての論理アドレスLAについて、次の処理を行う(8220)。   If the command determination result in step 8010 is a snapshot release command, the generation number (M) that the host device 1100 wants to release is extracted from the parameter (type value) added to the command. If the generation M of the snapshot flag 1033 is set to OFF in step 8210 (that is, if it has been released), a release failure error is returned to the host device 1100 and the command processing is completed. On the other hand, if the generation M of the snapshot flag 1033 is set to ON, the following processing is performed for all logical addresses LA in the address conversion table 1031 (8220).

メモリコントローラ1020は、「各論理アドレスLAに対応する全ての物理アドレスにおいて、第(M+1)物理アドレスの値が、それ以外のどの物理アドレスの値とも重複しないならば、第(M+1)物理アドレスのページ状態をページ状態レジスタ1032において8(無効データ)に設定する。」
次に、アドレス変換テーブル1031の全ての論理アドレスLAについて、第(M+1)物理アドレスの欄をクリアする(8230)。最後に、スナップショットフラグ1033の世代MをOFFに設定し(8240)、コマンド処理を終える。
The memory controller 1020 reads: “If the value of the (M + 1) th physical address does not overlap with the value of any other physical address in all the physical addresses corresponding to each logical address LA, The page state is set to 8 (invalid data) in the page state register 1032. "
Next, the column of the (M + 1) th physical address is cleared for all logical addresses LA in the address conversion table 1031 (8230). Finally, the generation M of the snapshot flag 1033 is set to OFF (8240), and the command processing ends.

ステップ8010でコマンド判定結果がライトコマンドならば、ライト処理8310(詳細は図9(a)参照)を行い、コマンド処理を終える。   If the command determination result in step 8010 is a write command, write processing 8310 (refer to FIG. 9A for details) is performed, and the command processing ends.

ステップ8010でコマンド判定結果がリードデータ選択コマンドならば、そのコマンドに付加されたパラメータ(種類値)からホスト装置1100がリードコマンドで要求するリードデータの種類(最新または第1〜3世代スナップショットのいずれか)を取得する(8410)。そして、その種類を識別する種類値をリードデータ選択レジスタに設定し(8420)、コマンド処理を終える。   If the command determination result in step 8010 is a read data selection command, the type of read data requested by the host device 1100 using the read command from the parameter (type value) added to the command (the latest or first to third generation snapshots). Either) is acquired (8410). Then, a type value for identifying the type is set in the read data selection register (8420), and the command processing is completed.

ステップ8010でコマンド判定結果がリードコマンドならば、リード処理8510(詳細は図9(b)参照)を行い、コマンド処理を終える。   If the command determination result in step 8010 is a read command, read processing 8510 (see FIG. 9B for details) is performed, and the command processing is completed.

図9(a)は、メモリコントローラ1020が上記図8のライト処理8310で実行する処理手順を示すフローチャートである。以下、その手順を説明する。   FIG. 9A is a flowchart showing a processing procedure executed by the memory controller 1020 in the write processing 8310 of FIG. The procedure will be described below.

まず、ホスト装置1100からライトデータを受信し(9010)、ページ状態レジスタ1032でページ状態値=Fのページを選択し、そのページに前記受信したデータをライトする(9020)。   First, write data is received from the host device 1100 (9010), a page with a page status value = F is selected by the page status register 1032 and the received data is written to that page (9020).

次に、アドレス変換テーブル1031において、本ライトコマンドで指定された論理アドレスに対応する全ての物理アドレスを検出し、そのうち第1物理アドレスでの値(更新前のデータを格納したページのアドレス)がそれ以外のどの物理アドレスの値とも重複しないか(つまりスナップショットデータになっていないか)を検索する(9030)。この検索結果が偽(重複する)ならばステップ9050に移る。一方、検索結果が真(重複しない)ならば、ページ状態レジスタ1032において、指定された論理アドレスに対応する第1物理アドレスのページ状態を8(無効データ)に設定する(9040)。次に、アドレス変換テーブル1031において、指定された論理アドレスに対応する第1物理アドレスの欄にステップ9020でライトしたページのアドレス(更新後のデータを格納したページのアドレス)を設定する(9050)。そして、ページ状態レジスタ1032において、その新しい第1物理アドレスが示すページのページ状態を0(有効データ)に設定する。最後にブロッククリーンアップ処理9070(詳細は図10参照)を実行する。   Next, in the address conversion table 1031, all physical addresses corresponding to the logical address specified by this write command are detected, and the value at the first physical address (the address of the page storing the data before update) is detected. A search is made as to whether any other physical address value does not overlap (that is, whether it is snapshot data) (9030). If this search result is false (duplicate), the process proceeds to step 9050. On the other hand, if the search result is true (not duplicated), the page status of the first physical address corresponding to the designated logical address is set to 8 (invalid data) in the page status register 1032 (9040). Next, in the address conversion table 1031, the address of the page written in step 9020 (the address of the page storing the updated data) is set in the first physical address column corresponding to the designated logical address (9050). . Then, the page status register 1032 sets the page status of the page indicated by the new first physical address to 0 (valid data). Finally, block cleanup processing 9070 (see FIG. 10 for details) is executed.

図9(b)は、メモリコントローラ1020が図8のリード処理8510で実行する処理手順を示すフローチャートである。以下、その手順を説明する。   FIG. 9B is a flowchart showing a processing procedure executed by the memory controller 1020 in the read processing 8510 of FIG. The procedure will be described below.

まず、リードデータ選択レジスタに設定された種類値が「最新」(=0)を示しているかを調べ(9110)、結果が真(最新)ならば、アドレス変換テーブル1031において、本リードコマンドで指定された論理アドレスに対応する第1物理アドレスに格納されたデータをリードし(9150)、ホスト装置1100へリードデータを送信する(9140)。一方、結果が偽(スナップショット)ならば、選択された世代番号(Nとする)について、スナップショットフラグ1033の世代NがONか(スナップショットが取得済みか)を調べる(9120)。スナップショットフラグ1033の世代NがOFFならばホスト装置1100にリードエラーを返してリード処理を終える。スナップショットフラグ1033の世代NがONならば、指定された論理アドレスに対応する第(N+1)PAに格納されたデータをリードし(9130)、ホスト装置1100へリードデータを送信する(9140)。   First, it is checked whether or not the type value set in the read data selection register indicates “latest” (= 0) (9110). If the result is true (latest), it is designated by this read command in the address conversion table 1031. The data stored in the first physical address corresponding to the logical address thus read is read (9150), and the read data is transmitted to the host device 1100 (9140). On the other hand, if the result is false (snapshot), it is checked whether the generation N of the snapshot flag 1033 is ON (snapshot has been acquired) for the selected generation number (N) (9120). If the generation N of the snapshot flag 1033 is OFF, a read error is returned to the host device 1100 and the read process is terminated. If the generation N of the snapshot flag 1033 is ON, the data stored in the (N + 1) -th PA corresponding to the designated logical address is read (9130), and the read data is transmitted to the host device 1100 (9140).

図10は、上記図9(a)におけるブロッククリーンアップ処理9070の詳細な処理手順を示すフローチャートである。以下、その手順を説明する。   FIG. 10 is a flowchart showing a detailed processing procedure of the block cleanup process 9070 in FIG. The procedure will be described below.

まず、メモリコントローラ1020は、ページ状態レジスタ1032を参照して、ページ状態値=F(未書込)のページの総数が所定の値以下になったかを判定する(10010)。判定結果が偽(所定値より大きい)ならば何もせずにそのまま処理を終える。一方、判定結果が真(所定値以下)ならば、ページ状態値=8(無効データ)であるページを最も多く含むブロックを1つ選択し、その中にあるページ状態値=0(有効データ)である有効ページを全て検出する(10020)。検出した有効ページ数をPとする。そして、選択したブロック以外のブロック上にあるページ状態値=Fの未書込ページをP個選択し、上記ステップ10020で検出した有効ページに格納されたデータを、それぞれ未書込ページの1つにコピー(退避)する(10030)。次に、ページ状態レジスタ1032において、ステップ10030でのそれぞれのコピー先ページのページ状態値を0に設定する(10040)。そして、ステップ10020で検出した有効ページのページ状態値を全て8(無効データ)に設定する(10050)。そして、アドレス変換テーブル1031上に設定された全ての物理アドレスの中からステップ10020で検出した有効ページのアドレスを検索することにより、そのアドレスが設定された欄を特定し、これらの特定された欄に上記ステップ10030でのそれぞれのコピー先ページの物理アドレスをコピーする(10060)。これにより、ステップ10020で選択したブロック内の全ページが無効化され、そこに格納されていた保存すべきページデータの退避も完了する。   First, the memory controller 1020 refers to the page status register 1032 to determine whether the total number of pages with page status value = F (unwritten) has become equal to or smaller than a predetermined value (10010). If the determination result is false (greater than a predetermined value), the process is terminated without doing anything. On the other hand, if the determination result is true (below a predetermined value), one block including the most pages with page state value = 8 (invalid data) is selected, and the page state value = 0 (valid data) among them is selected. All valid pages that are are detected (10020). Let P be the number of detected valid pages. Then, P unwritten pages with a page state value = F on a block other than the selected block are selected, and the data stored in the valid page detected in step 10020 is stored as one unwritten page. Is copied (saved) to (10030). Next, the page status register 1032 sets the page status value of each copy destination page in step 10030 to 0 (10040). Then, all the page state values of the valid pages detected in step 10020 are set to 8 (invalid data) (10050). Then, by searching for the address of the valid page detected in step 10020 from all the physical addresses set on the address conversion table 1031, the column in which the address is set is specified, and these specified columns The physical address of each copy destination page in step 10030 is copied (10060). As a result, all pages in the block selected in step 10020 are invalidated, and the saving of the page data to be saved stored therein is also completed.

次に、ステップ10020で選択したブロックを消去する(10070)。そして、ページ状態レジスタ1032において、そのブロック内の全ページのページ状態値をF(未書込)に設定し(10080)、処理を終える。   Next, the block selected in step 10020 is erased (10070). Then, in the page status register 1032, the page status value of all pages in the block is set to F (unwritten) (10080), and the processing ends.

ここで、上記のアドレス変換テーブル1031の詳細な実装方法について言及する。アドレス変換テーブル1031上の第2〜4物理アドレスの欄は、スナップショットの解放により「未設定」状態になるが、第1の実施形態と同様に「未設定」を意味する特別な値(“FFFFFFFF(16進数)”など)を定義し、その値を不揮発性RAM1030に書き込んで「未設定」状態にしてもよいが、スナップショットフラグ1033のある世代Nが解放済み(OFF)ならば、第(N+1)物理アドレスは「未設定」状態であることが判断できるため、アドレス変換テーブル1031で「未設定」状態を明示する必要はなく、書かれている無用なアドレス値をそのまま放置してもよい。すなわち図8のステップ8230は省略してもよい。ただし、その場合はアドレス変換テーブル1031での各アドレス検索処理(図8の8220、図9の9030、図10の10060)において、その無用アドレス値を検索対象から除外する。   Here, a detailed mounting method of the address conversion table 1031 will be described. The fields of the second to fourth physical addresses on the address conversion table 1031 are set to the “unset” state by releasing the snapshot, but as in the first embodiment, a special value (“ FFFFFFFF (hexadecimal number) ”and the like may be defined and written to the nonvolatile RAM 1030 to be in an“ unset ”state. However, if the generation N with the snapshot flag 1033 has been released (OFF), Since it is possible to determine that the (N + 1) physical address is in the “unset” state, it is not necessary to clearly indicate the “unset” state in the address conversion table 1031, and even if the written unnecessary address value is left as it is. Good. That is, step 8230 in FIG. 8 may be omitted. However, in that case, in each address search process (8220 in FIG. 8, 9030 in FIG. 9, 10060 in FIG. 10) in the address conversion table 1031, the useless address value is excluded from the search target.

以上が本発明の第2の実施形態である。   The above is the second embodiment of the present invention.

以上の第1および第2の実施形態の説明において、いずれの半導体記憶装置1000も1つの論理アドレスに対して複数の物理アドレスを割り当てるため、ホスト装置1100がスナップショット取得後にライトコマンドで多くのデータを書き込むと、備えられたフラッシュメモリ1040の全容量で必要な物理ページ数をまかないきれない可能性がある。その場合はスナップショットを解放して空き物理ページを確保すること(これは第1の実施形態では通常動作開始コマンド処理の実行に相当する。以下、スナップショットの解放という表現で統一する。)が必要である。そこで、コマンド処理中に有効データ格納ページ(状態=0または1のページ)の総数が所定の上限値を超えることが判明したら、ディスク容量オーバを意味するエラーを返すようにして、ホスト装置1100にスナップショットの解放を促してもよい。   In the above description of the first and second embodiments, since each semiconductor storage device 1000 assigns a plurality of physical addresses to one logical address, the host device 1100 uses a write command to obtain a large amount of data after taking a snapshot. Is written, there is a possibility that the required number of physical pages cannot be covered with the entire capacity of the provided flash memory 1040. In that case, releasing the snapshot to secure a free physical page (this corresponds to the execution of the normal operation start command processing in the first embodiment. Hereinafter, it is unified by the expression of releasing the snapshot). is necessary. Therefore, if it is found that the total number of valid data storage pages (pages with status = 0 or 1) exceeds a predetermined upper limit during command processing, an error indicating disk capacity over is returned to the host device 1100. You may be prompted to release the snapshot.

さらに、半導体記憶装置1000が自ら自動的にスナップショットの解放を実施してもよい。このとき、例えば最も古いスナップショットを優先的に解放する。スナップショットフラグ1033を拡張して取得時にシーケンス番号も記録するようにして、シーケンス番号が最小のものを最も古いスナップショットとして検出できるようにする。   Further, the semiconductor memory device 1000 may automatically release the snapshot itself. At this time, for example, the oldest snapshot is preferentially released. The snapshot flag 1033 is expanded so that the sequence number is recorded at the time of acquisition so that the one with the smallest sequence number can be detected as the oldest snapshot.

さらに、この自動解放を有効化/無効化するための設定コマンドを新規に定義してもよい。このとき、半導体記憶装置1000がそのコマンドを解釈してこの自動解放を事前に有効化/無効化する。あるいは、スナップショット取得コマンドのパラメータにこの自動解放を「許可する/許可しない」を意味するフラグを追加し、ホスト装置1100が予め自動解放を個別に承認できるようにしてもよい。このとき、半導体記憶装置1000がそのフラグを解釈し、(拡張した)スナップショットフラグ1033にその情報を記録しておく。その後、自動解放が必要になった時にそれを見て、「許可する」になっているスナップショットの中で最も古いスナップショットを優先的に解放する。   Furthermore, a setting command for enabling / disabling this automatic release may be newly defined. At this time, the semiconductor memory device 1000 interprets the command and enables / disables this automatic release in advance. Alternatively, a flag indicating “permitted / not permitted” may be added to the parameter of the snapshot acquisition command so that the host device 1100 can individually approve the automatic release individually. At this time, the semiconductor memory device 1000 interprets the flag and records the information in the (extended) snapshot flag 1033. After that, when it becomes necessary to release automatically, the oldest snapshot among the “permitted” snapshots is released preferentially.

半導体記憶装置1000が自ら自動的にスナップショットの解放を実施する契機は、上記のような容量不足に限らず半導体記憶装置1000が検知可能な様々なイベントを適用してよい。例えば、半導体記憶装置1000に現在時刻を知るための手段を備え、スナップショット取得時に取得時刻も(拡張した)スナップショットフラグ1033に記録しておく。そして、現在時刻とその取得時刻の差が所定値(例えば3年)を超えたら、自動的にそのスナップショットの解放を実施する。   The trigger for the semiconductor storage device 1000 to automatically release the snapshot itself is not limited to the capacity shortage as described above, and various events that can be detected by the semiconductor storage device 1000 may be applied. For example, the semiconductor memory device 1000 includes a means for knowing the current time, and the acquisition time is recorded in the (extended) snapshot flag 1033 when the snapshot is acquired. When the difference between the current time and the acquisition time exceeds a predetermined value (for example, 3 years), the snapshot is automatically released.

さらに、半導体記憶装置1000は自ら自動的にスナップショットの解放を実施するだけでなく、自動的にスナップショットの取得(これは第1の実施形態ではスナップショットコマンド処理の実行に相当する。以下、スナップショットの取得という表現で統一する。)を実施してもよい。その実施の契機は半導体記憶装置1000が検知可能な様々なイベントを適用してよい。   Furthermore, the semiconductor memory device 1000 not only automatically releases a snapshot itself, but also automatically acquires a snapshot (this corresponds to execution of a snapshot command process in the first embodiment. (It is also possible to unify with the expression snapshot acquisition). Various events that can be detected by the semiconductor memory device 1000 may be applied as the trigger for the implementation.

例えば、半導体記憶装置1000に現在時刻を知るための手段を備え、所定の時刻になると自動的にスナップショットの取得を実施する。この所定時刻を設定するコマンドを新規に定義してもよい。すなわち、半導体記憶装置1000がそのコマンドを解釈してこの所定時刻を事前に内部(例えば不揮発性RAM1030)に登録する。   For example, the semiconductor memory device 1000 is provided with means for knowing the current time, and automatically acquires a snapshot when a predetermined time comes. A command for setting the predetermined time may be newly defined. That is, the semiconductor memory device 1000 interprets the command and registers this predetermined time in advance (for example, the nonvolatile RAM 1030).

もう一例として、ホスト装置1100からの電源遮断による格納データ破壊を防止するために補助電源(大容量キャパシタなど)を搭載した半導体記憶装置1000を考える。半導体記憶装置1000は補助電源が使用されたことを検出してその通算使用回数または通算使用時間を不揮発性RAM1030に記録する。それらが所定の上限値を超えたら、外部の電源環境が悪化していると判断して、自動的にスナップショットの取得を実施する。   As another example, consider a semiconductor memory device 1000 equipped with an auxiliary power source (such as a large-capacity capacitor) in order to prevent stored data destruction due to power-off from the host device 1100. The semiconductor memory device 1000 detects that the auxiliary power source has been used, and records the total number of times used or the total time used in the nonvolatile RAM 1030. If they exceed a predetermined upper limit value, it is determined that the external power supply environment has deteriorated, and snapshot acquisition is automatically performed.

さらにもう一例として、フラッシュメモリ1040のブロック消去回数の合計、平均または最大値が所定の上限値を超えたり、フラッシュメモリ1040のライトや消去のエラー発生回数の合計が所定の上限値を超えたりしたら、記憶装置としての信頼性が悪化していると判断して、自動的にスナップショットの取得を実施してもよい。   As another example, if the total, average or maximum number of block erases in the flash memory 1040 exceeds a predetermined upper limit value, or the total number of write / erase errors in the flash memory 1040 exceeds a predetermined upper limit value. Alternatively, it may be determined that the reliability of the storage device has deteriorated, and snapshot acquisition may be performed automatically.

以上の説明において、スナップショット取得/解放コマンド、リードデータ選択コマンドなど新規に定義したコマンドには、従来の半導体記憶装置でベンダユニークに定義可能なコマンドコードを割り当て、リード/ライトコマンドには従来の半導体記憶装置のリード/ライトコマンドと同じ標準的なコマンドコードを割り当て、記憶装置としての上位互換性を図るのが好ましい。   In the above description, a command code that can be uniquely defined by a vendor in a conventional semiconductor memory device is assigned to a newly defined command such as a snapshot acquisition / release command or a read data selection command. It is preferable to assign the same standard command code as the read / write command of the semiconductor memory device to achieve upward compatibility as the memory device.

以上の説明において、スナップショットの世代番号やスナップショット機能に関する諸々のエラーをホスト装置1100に返す手段としては、従来の半導体記憶装置が標準的に持つステータスリードコマンドを拡張して実現してもよい。すなわち、本コマンドでリードされるステータス情報内の未使用部分に世代番号を埋め込む。また、標準規格で未使用のエラーコードをスナップショット機能に関する諸々のエラーに割り当て、そのコードをステータス情報内のエラー情報部分に設定する。   In the above description, the means for returning various errors related to the snapshot generation number and the snapshot function to the host device 1100 may be realized by extending the standard status read command of the conventional semiconductor memory device. . That is, the generation number is embedded in the unused portion in the status information read by this command. In addition, an error code not used in the standard is assigned to various errors related to the snapshot function, and the code is set in the error information portion in the status information.

また、ホスト装置1100の便利のために、本発明の半導体記憶装置1000で取得可能なスナップショット世代数の上限値、または取得済みのスナップショット世代番号のリストを、上記と同様にステータス情報の未使用部分に埋め込んでもよい。   Further, for the convenience of the host device 1100, the upper limit value of the number of snapshot generations that can be acquired by the semiconductor storage device 1000 of the present invention or the list of acquired snapshot generation numbers is displayed in the same manner as described above. It may be embedded in the used part.

また、上記第2実施形態では、メモリコントローラ1020は、リードデータ選択コマンドでスナップショットの世代または最新データを指定してから、所望の論理アドレスに対するリードコマンドを受け付ける構成としたが、リードコマンドに種類値を付加して、一回の指令で読み出すデータの種類と論理アドレスの指定を行うようにしても良い。   In the second embodiment, the memory controller 1020 is configured to accept a read command for a desired logical address after designating a snapshot generation or latest data with a read data selection command. A value may be added to specify the type of data to be read and the logical address with a single command.

<補足>
一括消去可能な複数のブロックと、前記ブロックを複数の領域に分割した複数のページとを備えてデータを格納するフラッシュメモリと、
前記フラッシュメモリへの書き込みまたは読み出しを前記ページ単位で制御し、前記ブロック単位で一括消去を制御するメモリコントローラと、を備え、
前記メモリコントローラは、ホストから受信した要求に含まれる論理アドレスに基づいて前記メモリチップのデータを読み書きする半導体記憶装置であって、
前記メモリコントローラは、
前記受信した要求が書き込み要求のときには、最新データの書き込み要求とスナップショット取得要求または解放要求の何れであるかを判定し、前記受信した要求が読み出し要求のときには、前記最新データの読み出し要求とスナップショットの読み出し要求の何れであるかを判定する要求判定部と、
前記要求に含まれる論理アドレスに対応する前記ページの物理アドレスを管理するアドレス変換部と、
前記各ブロックの前記各ページ毎に、格納されているデータが有効または無効あるいは未書き込みのいずれであるかを管理するページ状態設定部と、
前記スナップショット取得要求または読み出し要求あるいは解放要求があったときに、スナップショットの世代を管理するスナップショット管理部と、
前記要求判定部が判定した前記要求に含まれる論理アドレスから、前記アドレス変換部とページ状態設定部及びスナップショット管理部を参照して、前記要求に応じたアクセスを行うページの物理アドレスを決定するアクセス先決定部と、
前記決定したページに対して前記要求に応じたアクセスを行うアクセス制御部と、
を備え、
前記アドレス変換部は、
前記最新のデータを格納するページの物理アドレスを論理アドレス毎に格納する第1物理アドレスグループと、
前記スナップショットを格納するページの物理アドレスを論理アドレス毎に格納する第2物理アドレスグループと、を有し、
前記スナップショット管理部は、
前記スナップショットの有効または無効を設定することを特徴とする半導体記憶装置。
<Supplement>
A flash memory for storing data comprising a plurality of blocks that can be collectively erased, and a plurality of pages obtained by dividing the block into a plurality of areas;
A memory controller that controls writing to or reading from the flash memory in units of pages and controls batch erasure in units of blocks, and
The memory controller is a semiconductor memory device that reads and writes data of the memory chip based on a logical address included in a request received from a host,
The memory controller is
When the received request is a write request, it is determined whether it is a latest data write request, a snapshot acquisition request, or a release request. When the received request is a read request, the latest data read request and snap request are determined. A request determination unit that determines which of the shot read requests is,
An address conversion unit that manages the physical address of the page corresponding to the logical address included in the request;
A page state setting unit that manages whether the stored data is valid, invalid, or unwritten for each page of each block;
A snapshot management unit that manages the generation of the snapshot when the snapshot acquisition request or the read request or the release request is made;
From the logical address included in the request determined by the request determination unit, the physical address of the page to be accessed according to the request is determined with reference to the address conversion unit, the page state setting unit, and the snapshot management unit An access destination determination unit;
An access control unit that accesses the determined page according to the request;
With
The address conversion unit
A first physical address group storing a physical address of a page storing the latest data for each logical address;
A second physical address group storing a physical address of a page storing the snapshot for each logical address;
The snapshot management unit
A semiconductor memory device, wherein the validity or invalidity of the snapshot is set.

本発明の第1の実施形態における半導体記憶装置を示す図である。1 is a diagram showing a semiconductor memory device according to a first embodiment of the present invention. 第1の実施形態における半導体記憶装置の内部状態(ブロックX〜Zとアドレス変換テーブルとページ状態レジスタ及びスナップショットフラグの状態)変化の一例の前半を示し、(a)は4つのデータを格納した初期状態を示し、(b)はデータA’、B’のライトコマンドを実行した後の状態を示し、(c)はスナップショットコマンドを実行し、データC’,D’のライトコマンドを実行した後の状態を示し、(d)はデータD”のライトコマンドを実行した後の状態を示す図である。The first half of an example of a change in the internal state (block X to Z, address conversion table, page state register, and snapshot flag state) of the semiconductor memory device according to the first embodiment is shown, and (a) stores four data. The initial state is shown, (b) shows the state after executing the write command for data A ′ and B ′, (c) shows the snapshot command, and executed the write command for data C ′ and D ′. (D) is a diagram illustrating a state after a write command for data D ″ is executed. 第1の実施形態における半導体記憶装置の内部状態(ブロックX〜Zとアドレス変換テーブルとページ状態レジスタ及びスナップショットフラグの状態)変化の一例の後半を示し、(a)はブロッククリーンアップ処理を示し、(b)はブロッククリーンアップ処理後の状態を示し、(c)はデータB”のライトコマンドを実行した後の状態を示し、(d)はデータC”のライトコマンドを実行した後の状態を示す図である。The second half of an example of changes in the internal state (blocks X to Z, the address translation table, the page state register, and the snapshot flag) of the semiconductor memory device according to the first embodiment is shown, and (a) shows a block cleanup process. (B) shows the state after the block cleanup process, (c) shows the state after executing the write command for data B ", and (d) shows the state after executing the write command for data C". FIG. 第1の実施形態におけるホスト装置から受信したコマンドについて、メモリコントローラが実行する処理手順を示すフローチャートである。It is a flowchart which shows the process sequence which a memory controller performs about the command received from the host apparatus in 1st Embodiment. 第1の実施形態におけるメモリコントローラによるブロッククリーンアップ処理を示すフローチャートである。It is a flowchart which shows the block cleanup process by the memory controller in 1st Embodiment. 本発明の第2の実施形態における半導体記憶装置の内部状態変化の一例の前半を示し、(a)は4つのデータを格納した初期状態を示し、(b)はデータA’、B’のライトコマンドを実行した後の状態を示し、(c)は第1世代のスナップショット取得コマンドを実行し、データC’,D’のライトコマンドを実行した後の状態を示し、(d)は第2世代のスナップショット取得コマンドを実行し、データD”のライトコマンドを実行した後の状態を示し、(e)は、ブロッククリーンアップ処理によるデータの退避が完了した時点をす図である。The first half of an example of the internal state change of the semiconductor memory device according to the second embodiment of the present invention is shown, (a) shows the initial state in which four data are stored, and (b) shows the write of data A ′ and B ′. The state after the command is executed is shown. (C) shows the state after the first generation snapshot acquisition command is executed and the write command for the data C ′ and D ′ is executed. (D) shows the second state. The state after the generation snapshot acquisition command is executed and the write command of the data D ″ is executed is shown, and (e) is a diagram showing the time point when the data saving by the block cleanup process is completed. 本発明の第2の実施形態における半導体記憶装置の内部状態変化の一例の後半を示し、(a)はブロッククリーンアップ処理が完了した状態を示し、(b)は第2世代のスナップショットを解放するスナップショット解放コマンドを実行した直後の後の状態を示し、(c)はデータC”のライトコマンドを実行した後の状態を示し、(d)は第1世代のスナップショットを解放するスナップショット解放コマンドを実行した後の状態を示し、(e)は、データD”’を書き込むライトコマンドを実行した直後の内部状態を示す図である。The latter half of an example of the internal state change of the semiconductor memory device in the second embodiment of the present invention is shown, (a) shows the state where the block cleanup process is completed, and (b) releases the second generation snapshot. (C) shows the state after executing the write command for data C ″, and (d) shows the snapshot for releasing the first generation snapshot. The state after executing the release command is shown, and (e) is a diagram showing the internal state immediately after executing the write command for writing the data D ″ ′. 本発明の第2の実施形態におけるメモリコントローラが、ホスト装置から受信したコマンドについて実行する処理手順を示すフローチャートである。It is a flowchart which shows the process sequence which the memory controller in the 2nd Embodiment of this invention performs about the command received from the host apparatus. 本発明の第2の実施形態におけるメモリコントローラによるライト処理およびリード処理を示すフローチャートである。It is a flowchart which shows the write process and read process by the memory controller in the 2nd Embodiment of this invention. 本発明の第2の実施形態におけるメモリコントローラによるブロッククリーンアップ処理を示すフローチャートである。It is a flowchart which shows the block cleanup process by the memory controller in the 2nd Embodiment of this invention.

符号の説明Explanation of symbols

1000 半導体記憶装置
1020 メモリコントローラ
1030 不揮発性RAM
1040 フラッシュメモリ
1000 Semiconductor memory device 1020 Memory controller 1030 Nonvolatile RAM
1040 flash memory

Claims (17)

データを格納するメモリチップと、前記メモリチップを制御するメモリコントローラと、を備えて、
前記メモリコントローラは、読み出し要求または書き込み要求を受信し、前記読み出し要求または書き込み要求に含まれる論理アドレスに基づいて前記メモリチップのデータを読み書きする半導体記憶装置であって、
前記メモリコントローラは、前記メモリチップに格納された第1のデータが第1の論理アドレスへの読み出し要求により出力可能であるときに、前記第1の論理アドレスへの書込要求で第2のデータが入力された後、前記第1の論理アドレスへの読み出し要求を受信したときに前記第1のデータまたは前記第2のデータのいずれかを選択的に出力することを特徴とする半導体記憶装置。
A memory chip for storing data, and a memory controller for controlling the memory chip,
The memory controller is a semiconductor memory device that receives a read request or a write request and reads / writes data of the memory chip based on a logical address included in the read request or the write request,
When the first data stored in the memory chip can be output by a read request to the first logical address, the memory controller outputs the second data by a write request to the first logical address. A semiconductor memory device that selectively outputs either the first data or the second data when a read request to the first logical address is received after.
データを格納するメモリチップと、前記メモリチップを制御するメモリコントローラと、を備えて、
前記メモリコントローラは、ホストから読み出し要求または書き込み要求を受信し、前記読み出し要求または書き込み要求に含まれる論理アドレスに基づいて前記メモリチップのデータを読み書きする半導体記憶装置であって、
前記メモリコントローラは、第1の論理アドレスを指定したホストからの書込要求に応じて第1のデータを格納し、
前記第1のデータを格納した後に、前記第1の論理アドレスを指定したホストからの書込要求に応じて第2のデータを格納し、
前記第1のデータと第2のデータを格納した後に、前記第1の論理アドレスを指定したホストからの読み出し要求に応じて、前記メモリコントローラが前記第1のデータと前記第2のデータのいずれかを選択的に出力することを特徴とする半導体記憶装置。
A memory chip for storing data, and a memory controller for controlling the memory chip,
The memory controller is a semiconductor memory device that receives a read request or a write request from a host and reads / writes data of the memory chip based on a logical address included in the read request or the write request,
The memory controller stores first data in response to a write request from a host that has designated a first logical address,
After storing the first data, store the second data in response to a write request from the host that has designated the first logical address;
After storing the first data and the second data, the memory controller determines which of the first data and the second data in response to a read request from the host that has designated the first logical address. A semiconductor memory device characterized by selectively outputting the above.
請求項1または請求項2に記載の半導体記憶装置であって、
前記メモリチップはフラッシュメモリで構成され、
前記メモリコントローラは、前記フラッシュメモリを制御するために前記フラッシュメモリに接続され、
前記フラッシュメモリは、前記メモリコントローラが一括消去可能なブロックを複数含み、
前記ブロックは、前記メモリコントローラが書込単位とする複数のページに分割され、
前記メモリコントローラは、前記第1のデータおよび前記第2のデータを異なるページに格納することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 1, wherein:
The memory chip is composed of flash memory,
The memory controller is connected to the flash memory to control the flash memory;
The flash memory includes a plurality of blocks that can be collectively erased by the memory controller,
The block is divided into a plurality of pages that the memory controller uses as a writing unit,
The semiconductor memory device, wherein the memory controller stores the first data and the second data in different pages.
請求項3に記載の半導体記憶装置であって、
前記メモリコントローラは、
前記書き込み要求と読み出し要求として、少なくとも1種類の書込要求と、少なくとも2種類の読み出し要求とを受け付けて、
前記メモリコントローラは、前記第1の論理アドレスを指定した前記書込要求に応じて入力された第1のデータを第1のページに格納し、
前記第1のデータを格納した後、前記メモリコントローラは、前記第1の論理アドレスを指定した前記書込要求に応じて入力された第2のデータを第2のページに格納し、
前記第1のデータと第2のデータを格納した後、前記メモリコントローラは、前記第1の論理アドレスを指定した第1の読み出し要求に応じて、前記第1のデータを前記第1のページから読み出し、
前記第1の論理アドレスを指定した第2の読み出し要求に応じて、前記第2のデータを前記第2のページから読み出すことを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 3,
The memory controller is
As the write request and the read request, at least one type of write request and at least two types of read requests are accepted,
The memory controller stores, in a first page, first data input in response to the write request designating the first logical address,
After storing the first data, the memory controller stores the second data input in response to the write request designating the first logical address in a second page;
After storing the first data and the second data, the memory controller receives the first data from the first page in response to a first read request designating the first logical address. reading,
A semiconductor memory device, wherein the second data is read from the second page in response to a second read request designating the first logical address.
請求項3に記載の半導体記憶装置であって、
前記メモリコントローラは、
前記書き込み要求と読み出し要求として、少なくとも1種類の書込要求と、少なくとも2種類の読み出し要求とを受け付けて、
前記メモリコントローラは、前記第1の論理アドレスを指定した前記書込要求に応じて入力された第1のデータを、少なくとも1つのページに格納し、
前記第1のデータを格納した後、前記メモリコントローラは、前記第1の論理アドレスを指定した前記書込要求に応じて入力された第2のデータを、少なくとも1つの前記ページに格納し、
前記第1のデータと第2のデータを格納した後、前記メモリコントローラは、前記第1の論理アドレスを指定した第1の読み出し要求に応じて、前記第1のデータを格納した少なくとも1つの前記ページからデータを読み出し、
前記第1の論理アドレスを指定した第2の読み出し要求に応じて、前記第2のデータを格納した少なくとも1つの前記ページから読み出すことを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 3,
The memory controller is
As the write request and the read request, at least one type of write request and at least two types of read requests are accepted,
The memory controller stores the first data input in response to the write request designating the first logical address in at least one page;
After storing the first data, the memory controller stores the second data input in response to the write request designating the first logical address in at least one page,
After storing the first data and the second data, the memory controller, in response to a first read request designating the first logical address, stores at least one of the first data stored in the first data. Read data from the page,
In accordance with a second read request designating the first logical address, the semiconductor memory device is read from at least one of the pages storing the second data.
請求項5に記載の半導体記憶装置であって、
前記読み出し要求で指定された論理アドレスの1つから、当該論理アドレスに対応して書込まれたデータを格納している少なくとも2つの前記ページを識別するための物理アドレスを格納したアドレス変換テーブルを、不揮発性の記憶手段に保持することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 5,
An address conversion table storing physical addresses for identifying at least two pages storing data written corresponding to the logical address from one of the logical addresses specified by the read request. And a non-volatile storage means.
請求項5に記載の半導体記憶装置であって、
前記ページに割当てられた1つのページ状態を格納したページ状態レジスタを、不揮発性の記憶手段に保持し、
前記メモリコントローラは、前記ページ状態として、少なくとも、
(1)当該ページに対応する前記論理アドレスを指定して最後に書込まれたデータを格納した状態、
(2)当該ページに対応する前記論理アドレスを指定して書込まれたデータのうち最後のものでない1つを格納した状態、
(3)無効データを格納した状態、
(4)当該ページを含む前記ブロックが消去されて以来、データが未書込の状態、
のいずれかひとつを設定することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 5,
A page status register storing one page status assigned to the page is held in a nonvolatile storage means,
The memory controller is at least as the page state,
(1) A state in which the last written data is stored by designating the logical address corresponding to the page,
(2) A state in which one of the data written by designating the logical address corresponding to the page is not the last one is stored,
(3) State in which invalid data is stored,
(4) Data has not been written since the block including the page has been erased.
A semiconductor memory device characterized by setting any one of the above.
請求項6に記載の半導体記憶装置であって、
前記不揮発性記憶手段が、前記フラッシュメモリであることを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 6,
A semiconductor memory device, wherein the nonvolatile memory means is the flash memory.
請求項6に記載の半導体記憶装置であって、
前記アドレス変換テーブルは、ひとつの論理アドレスについて、最後に書き込まれたデータの格納位置を指し示す第1の物理アドレスと、更新前のデータを指し示す第2の物理アドレスとを含むことを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 6,
The address conversion table includes, for one logical address, a first physical address indicating a storage position of data written last and a second physical address indicating data before update. Storage device.
一括消去可能な複数のブロックと、前記ブロックを複数の領域に分割した複数のページとを備えてデータを格納するフラッシュメモリと、
前記フラッシュメモリへの書き込みまたは読み出しを前記ページ単位で制御し、前記ブロック単位で一括消去を制御するメモリコントローラと、を備え、
前記メモリコントローラは、ホストから受信した要求に含まれる論理アドレスに基づいて前記メモリチップのデータを読み書きする半導体記憶装置であって、
前記メモリコントローラは、
前記受信した要求が書き込み要求のときには、最新データの書き込み要求とスナップショット取得要求または解放要求の何れであるかを判定し、前記受信した要求が読み出し要求のときには、前記最新データの読み出し要求とスナップショットの読み出し要求の何れであるかを判定する要求判定部と、
前記要求に含まれる論理アドレスに対応する前記ページの物理アドレスを管理するアドレス変換部と、
前記各ブロックの前記各ページ毎に、格納されているデータが有効または無効あるいは未書き込みのいずれであるかを管理するページ状態設定部と、
前記スナップショット取得要求または読み出し要求あるいは解放要求があったときに、スナップショットの世代を管理するスナップショット管理部と、
前記要求判定部が判定した前記要求に含まれる論理アドレスから、前記アドレス変換部とページ状態設定部及びスナップショット管理部を参照して、前記要求に応じたアクセスを行うページの物理アドレスを決定するアクセス先決定部と、
前記決定したページに対して前記要求に応じたアクセスを行うアクセス制御部と、
を備え、
前記アドレス変換部は、
前記最新のデータを格納するページの物理アドレスを論理アドレス毎に格納する第1物理アドレスグループと、
前記スナップショットを格納するページの物理アドレスを論理アドレス毎に格納し、かつスナップショットの世代毎に物理アドレスを格納する第2物理アドレスグループと、を有し、
前記スナップショット管理部は、
前記前記第2物理アドレスグループを構成するスナップショットの世代毎のアドレスグループの有効または無効を設定することを特徴とする半導体記憶装置。
A flash memory for storing data comprising a plurality of blocks that can be collectively erased, and a plurality of pages obtained by dividing the block into a plurality of areas;
A memory controller that controls writing to or reading from the flash memory in units of pages and controls batch erasure in units of blocks, and
The memory controller is a semiconductor memory device that reads and writes data of the memory chip based on a logical address included in a request received from a host,
The memory controller is
When the received request is a write request, it is determined whether it is a latest data write request, a snapshot acquisition request, or a release request. When the received request is a read request, the latest data read request and snap request are determined. A request determination unit that determines which of the shot read requests is,
An address conversion unit that manages the physical address of the page corresponding to the logical address included in the request;
A page state setting unit that manages whether the stored data is valid, invalid, or unwritten for each page of each block;
A snapshot management unit that manages the generation of the snapshot when the snapshot acquisition request or the read request or the release request is made;
From the logical address included in the request determined by the request determination unit, the physical address of the page to be accessed according to the request is determined with reference to the address conversion unit, the page state setting unit, and the snapshot management unit An access destination determination unit;
An access control unit that accesses the determined page according to the request;
With
The address conversion unit
A first physical address group storing a physical address of a page storing the latest data for each logical address;
A physical address of a page storing the snapshot for each logical address, and a second physical address group for storing a physical address for each generation of snapshots,
The snapshot management unit
A semiconductor memory device, wherein validity or invalidity of an address group for each snapshot generation constituting the second physical address group is set.
請求項10に記載の半導体記憶装置であって、
前記アクセス先決定部は、
前記要求が最新データの書き込み要求のときには、前記ページ状態設定部を参照して未書き込みのページの物理アドレスを前記要求に含まれる論理アドレスのアクセス先として選択し、当該ページに書き込んだ後に前記アドレス変換部の前記論理アドレスに対応する第1物理アドレスグループを前記選択したページの物理アドレスで更新し、前記ページ状態設定部の当該ページの状態を有効に設定し、更新前の当該論理アドレスに対応する第1物理アドレスグループの物理アドレスに対応するページ状態設定部の当該ページの状態を無効に設定することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 10,
The access destination determination unit
When the request is a write request for the latest data, the physical state of an unwritten page is selected as an access destination of a logical address included in the request by referring to the page state setting unit, and the address is written after writing to the page. The first physical address group corresponding to the logical address of the conversion unit is updated with the physical address of the selected page, the state of the page of the page state setting unit is set to be valid, and the logical address before the update is supported A semiconductor memory device, wherein the page state setting unit corresponding to the physical address of the first physical address group is set to invalid.
請求項10に記載の半導体記憶装置であって、
前記アクセス先決定部は、
前記要求がスナップショット取得要求のときには、前記ホストから指令された世代に対応する第2物理アドレスグループのアドレスグループに、前記第1物理アドレスグループの値を複写し、前記スナップショット管理部の前記世代を有効として設定することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 10,
The access destination determination unit
When the request is a snapshot acquisition request, the value of the first physical address group is copied to the address group of the second physical address group corresponding to the generation commanded by the host, and the generation of the snapshot management unit Is set as valid, a semiconductor memory device.
請求項10に記載の半導体記憶装置であって、
前記アクセス先決定部は、
前記要求が最新データの読み出し要求のときには、前記第1物理アドレスグループから前記要求に含まれる論理アドレスに対応するページに格納された物理アドレスをアクセス先として選択することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 10,
The access destination determination unit
When the request is a request for reading the latest data, the semiconductor memory device selects a physical address stored in a page corresponding to a logical address included in the request from the first physical address group as an access destination.
請求項10に記載の半導体記憶装置であって、
前記アクセス先決定部は、
前記要求がスナップショットの読み出し要求のときには、前記ホストから指令された世代に対応する第2物理アドレスグループのアドレスグループから、前記要求に含まれる論理アドレスに対応するページに格納された物理アドレスをアクセス先として選択することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 10,
The access destination determination unit
When the request is a snapshot read request, the physical address stored in the page corresponding to the logical address included in the request is accessed from the address group of the second physical address group corresponding to the generation commanded by the host A semiconductor memory device, wherein the semiconductor memory device is selected as the destination.
請求項10に記載の半導体記憶装置であって、
前記アクセス先決定部は、
前記要求がスナップショット解放要求のときには、前記ホストから指令された世代に対応する第2物理アドレスグループのアドレスグループを構成するページの物理アドレスが他のアドレスグループに存在するか否かを判定し、他のアドレスグループに前記ページの物理アドレスが存在しない場合には、当該ページに対応する前記ページ状態設定部の値を無効として設定し、前記世代に対応する第2物理アドレスグループのアドレスグループの値を消去し、当該世代に対応する前記スナップショット管理部の値を無効として設定することを特徴とする記憶装置。
The semiconductor memory device according to claim 10,
The access destination determination unit
When the request is a snapshot release request, it is determined whether or not the physical address of the page constituting the address group of the second physical address group corresponding to the generation commanded by the host exists in another address group, When the physical address of the page does not exist in another address group, the value of the page state setting unit corresponding to the page is set as invalid, and the value of the address group of the second physical address group corresponding to the generation Is deleted, and the value of the snapshot management unit corresponding to the generation is set as invalid.
請求項10に記載の半導体記憶装置であって、
前記メモリコントローラは、
前記未書き込みのページが予め設定した値未満となったことを監視する空きブロック監視部と、
前記未書き込みのページが予め設定した値未満となったときには、前記ページ状態設定部を参照して前記複数のブロックから無効のページが最も多いブロックを選択し、当該ブロックを一括消去し、当該ブロックに対応するページ状態設定部を未書き込みに設定するクリーンアップ処理部と、を有することを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 10,
The memory controller is
An empty block monitoring unit for monitoring that the unwritten page is less than a preset value;
When the unwritten page is less than a preset value, the block having the largest number of invalid pages is selected from the plurality of blocks with reference to the page state setting unit, and the block is erased at once. And a cleanup processing unit that sets the page state setting unit corresponding to the unwritten state to the semiconductor memory device.
請求項15に記載の半導体記憶装置であって、
前記クリーンアップ処理部は、前記一括消去の対象として選択されたブロックについて、前記ページ状態設定部から有効なページを検索し、有効なページがある場合には、前記ページ状態設定部から他のブロックの未書き込みのページを選択し、前記有効なページのデータを前記未書き込みのページへ書き込んで退避させることを特徴とする半導体記憶装置。
The semiconductor memory device according to claim 15,
The cleanup processing unit searches the page status setting unit for a valid page for the block selected as the batch erasure target, and if there is a valid page, the page status setting unit selects another block. A non-written page is selected, and the data of the valid page is written and saved in the unwritten page.
JP2007036236A 2006-11-28 2007-02-16 Semiconductor memory device Expired - Fee Related JP5137413B2 (en)

Priority Applications (7)

Application Number Priority Date Filing Date Title
JP2007036236A JP5137413B2 (en) 2006-11-28 2007-02-16 Semiconductor memory device
US11/783,364 US8151060B2 (en) 2006-11-28 2007-04-09 Semiconductor memory system having a snapshot function
DE200760009916 DE602007009916D1 (en) 2006-11-28 2007-07-04 Semiconductor memory system with snapshot function
EP20070252686 EP1927920B1 (en) 2006-11-28 2007-07-04 Semiconductor memory system having a snapshot function
US13/422,644 US8417896B2 (en) 2006-11-28 2012-03-16 Semiconductor memory system having a snapshot function
US13/788,438 US8683141B2 (en) 2006-11-28 2013-03-07 Semiconductor memory system having a snapshot function
US14/188,039 US9021212B2 (en) 2006-11-28 2014-02-24 Semiconductor memory system having a snapshot function

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2006320240 2006-11-28
JP2006320240 2006-11-28
JP2007036236A JP5137413B2 (en) 2006-11-28 2007-02-16 Semiconductor memory device

Publications (2)

Publication Number Publication Date
JP2008159013A true JP2008159013A (en) 2008-07-10
JP5137413B2 JP5137413B2 (en) 2013-02-06

Family

ID=39659817

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007036236A Expired - Fee Related JP5137413B2 (en) 2006-11-28 2007-02-16 Semiconductor memory device

Country Status (2)

Country Link
JP (1) JP5137413B2 (en)
DE (1) DE602007009916D1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012104909A1 (en) 2011-02-02 2012-08-09 Hitachi, Ltd. Storage system and data control method therefor
US8626987B2 (en) 2009-10-27 2014-01-07 Samsung Electronics Co., Ltd. Flash memory system and defragmentation method
JP2014206982A (en) * 2014-05-07 2014-10-30 株式会社日立製作所 Storage system and data control method therefor
JP2015501960A (en) * 2012-03-13 2015-01-19 株式会社日立製作所 Storage system having nonvolatile semiconductor memory device including nonvolatile semiconductor memory
JP2015158797A (en) * 2014-02-24 2015-09-03 株式会社東芝 Storage device and data management method
JP2016194928A (en) * 2016-05-11 2016-11-17 株式会社日立製作所 Storage system
US9792070B2 (en) 2013-03-18 2017-10-17 Fujitsu Ten Limited Data storage device, method of storing data, and on-vehicle control apparatus
US10019326B2 (en) 2015-07-15 2018-07-10 Toshiba Memory Corporation Memory system
CN111258500A (en) * 2014-09-30 2020-06-09 株式会社日立制作所 Distributed storage system and data control method
JP7467088B2 (en) 2019-12-03 2024-04-15 キヤノン株式会社 Information processing device, processing method and program for information processing device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0527924A (en) * 1991-07-12 1993-02-05 Internatl Business Mach Corp <Ibm> External storage system using semiconductor memory and control method thereof
JPH11134117A (en) * 1997-10-31 1999-05-21 Toshiba Corp Computer system
JP2002108722A (en) * 2001-07-30 2002-04-12 Sony Corp Storage device
JP2003004351A (en) * 2001-06-25 2003-01-08 Nisshin Seifun Group Inc Cooling system of grains
JP2004511030A (en) * 2000-07-07 2004-04-08 レクサー メディア,インク. Memory architecture for host compatible multi-flash memory banks that can be programmed simultaneously
JP2005115561A (en) * 2003-10-06 2005-04-28 Media Logic:Kk Flash rom controller
JP2006048585A (en) * 2004-08-09 2006-02-16 Fujitsu Ltd Access method of flash memory

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0527924A (en) * 1991-07-12 1993-02-05 Internatl Business Mach Corp <Ibm> External storage system using semiconductor memory and control method thereof
JPH11134117A (en) * 1997-10-31 1999-05-21 Toshiba Corp Computer system
JP2004511030A (en) * 2000-07-07 2004-04-08 レクサー メディア,インク. Memory architecture for host compatible multi-flash memory banks that can be programmed simultaneously
JP2003004351A (en) * 2001-06-25 2003-01-08 Nisshin Seifun Group Inc Cooling system of grains
JP2002108722A (en) * 2001-07-30 2002-04-12 Sony Corp Storage device
JP2005115561A (en) * 2003-10-06 2005-04-28 Media Logic:Kk Flash rom controller
JP2006048585A (en) * 2004-08-09 2006-02-16 Fujitsu Ltd Access method of flash memory

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8626987B2 (en) 2009-10-27 2014-01-07 Samsung Electronics Co., Ltd. Flash memory system and defragmentation method
US9189391B2 (en) 2011-02-02 2015-11-17 Hitachi, Ltd. Storage system and data control method therefor
JP2013541743A (en) * 2011-02-02 2013-11-14 株式会社日立製作所 Storage system and data control method thereof
US8886869B2 (en) 2011-02-02 2014-11-11 Hitachi, Ltd. Storage system and data control method therefor
WO2012104909A1 (en) 2011-02-02 2012-08-09 Hitachi, Ltd. Storage system and data control method therefor
JP2015501960A (en) * 2012-03-13 2015-01-19 株式会社日立製作所 Storage system having nonvolatile semiconductor memory device including nonvolatile semiconductor memory
US9116622B2 (en) 2012-03-13 2015-08-25 Hitachi, Ltd. Storage system having nonvolatile semiconductor storage device with nonvolatile semiconductor memory
US9792070B2 (en) 2013-03-18 2017-10-17 Fujitsu Ten Limited Data storage device, method of storing data, and on-vehicle control apparatus
JP2015158797A (en) * 2014-02-24 2015-09-03 株式会社東芝 Storage device and data management method
JP2014206982A (en) * 2014-05-07 2014-10-30 株式会社日立製作所 Storage system and data control method therefor
CN111258500A (en) * 2014-09-30 2020-06-09 株式会社日立制作所 Distributed storage system and data control method
JP2021089764A (en) * 2014-09-30 2021-06-10 株式会社日立製作所 Dispersion-type storage system
US11487619B2 (en) 2014-09-30 2022-11-01 Hitachi, Ltd. Distributed storage system
CN111258500B (en) * 2014-09-30 2023-05-09 株式会社日立制作所 Distributed storage system and data control method
JP7374939B2 (en) 2014-09-30 2023-11-07 株式会社日立製作所 distributed storage system
US11886294B2 (en) 2014-09-30 2024-01-30 Hitachi, Ltd. Distributed storage system
US10019326B2 (en) 2015-07-15 2018-07-10 Toshiba Memory Corporation Memory system
JP2016194928A (en) * 2016-05-11 2016-11-17 株式会社日立製作所 Storage system
JP7467088B2 (en) 2019-12-03 2024-04-15 キヤノン株式会社 Information processing device, processing method and program for information processing device

Also Published As

Publication number Publication date
DE602007009916D1 (en) 2010-12-02
JP5137413B2 (en) 2013-02-06

Similar Documents

Publication Publication Date Title
US8683141B2 (en) Semiconductor memory system having a snapshot function
JP5137413B2 (en) Semiconductor memory device
US9367451B2 (en) Storage device management device and method for managing storage device
US8051258B2 (en) Apparatus and methods using invalidity indicators for buffered memory
JP4931810B2 (en) FAT analysis for optimized sequential cluster management
US8898541B2 (en) Storage controller, storage device, information processing system, and storage controlling method
US9183132B2 (en) Storage device, computer system, and storage system
US8489854B1 (en) Non-volatile semiconductor memory storing an inverse map for rebuilding a translation table
US8838875B2 (en) Systems, methods and computer program products for operating a data processing system in which a file delete command is sent to an external storage device for invalidating data thereon
JP2018073040A (en) Memory system
US11301331B2 (en) Storage device and operating method of storage device
JP2013061799A (en) Memory device, control method for memory device and controller
JPWO2005103903A1 (en) Nonvolatile storage system
JP2007193883A (en) Data recording device and method, data reproducing device and method, and data recording and reproducing device and method
US9389998B2 (en) Memory formatting method, memory controller, and memory storage apparatus
US20100318726A1 (en) Memory system and memory system managing method
JP4242245B2 (en) Flash ROM control device
CN115774681A (en) Information processing apparatus
JP2010086009A (en) Storage device and memory control method
JP2009116465A (en) Storage device and memory control method
JP2005115562A (en) Flash rom controller
JP4245021B2 (en) Storage device, storage system, and storage device control method
US20130036257A1 (en) Memory system which can avoid unavailability due to operation error by user
KR20110041843A (en) Hybrid storage device and operating method for the same
JP5180726B2 (en) Storage device and data write control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090617

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20111216

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20111220

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120220

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120309

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120821

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20121011

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20121106

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20121113

R150 Certificate of patent or registration of utility model

Ref document number: 5137413

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20151122

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees