JP2009026062A - Memory controller, memory system, and memory control method - Google Patents

Memory controller, memory system, and memory control method Download PDF

Info

Publication number
JP2009026062A
JP2009026062A JP2007188457A JP2007188457A JP2009026062A JP 2009026062 A JP2009026062 A JP 2009026062A JP 2007188457 A JP2007188457 A JP 2007188457A JP 2007188457 A JP2007188457 A JP 2007188457A JP 2009026062 A JP2009026062 A JP 2009026062A
Authority
JP
Japan
Prior art keywords
data
logical
logical group
area
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007188457A
Other languages
Japanese (ja)
Inventor
Shunichi Hanabusa
俊一 花房
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TDK Corp
Original Assignee
TDK Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TDK Corp filed Critical TDK Corp
Priority to JP2007188457A priority Critical patent/JP2009026062A/en
Publication of JP2009026062A publication Critical patent/JP2009026062A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a memory controller, a memory system and a memory control method suitable for storing data whose rewrite frequency is high and data whose rewrite frequency is low in a flash memory and a nonvolatile memory whose random access is possible. <P>SOLUTION: A memory controller 1 controls access to a flash memory 2 and a nonvolatile RAM 3 on the basis of a logical address applied from a host system 4. A logical group including a plurality of sector regions and a logical block including one or more logical groups are formed. A plurality of logical group data storage areas are secured in the nonvolatile RAM 3. Also, the corresponding relation of the logical groups and the logical group data storage areas and the priority order of the data of each logical group data storage area are managed. Data from the host system 4 are written in the logical group data storage area corresponding to the data. The data of the logical group data storage area are transferred to a corresponding physical block in the flash memory 2. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、ホストシステムから与えられるセクタ単位の論理アドレスに基づいて、フラッシュメモリ及び不揮発性メモリに対するアクセスを制御するメモリコントローラ、メモリシステム及びメモリ制御方法に関する。   The present invention relates to a memory controller, a memory system, and a memory control method for controlling access to a flash memory and a nonvolatile memory based on a logical address in units of sectors given from a host system.

従来の記憶装置として、フラッシュメモリ(カード型メモリ)と、ランダムアクセスが可能な不揮発性メモリ(NVRAM)と、RAM(揮発性RAM)とを設けた記憶装置が知られている。この記憶装置では、電源断後も記憶している必要のあるデータは、不揮発性メモリとフラッシュメモリとに分散して保存される。すなわち、フラッシュメモリには更新前のシステムデータが保存されており、フラッシュメモリからRAMに読み出されたシステムデータを更新するときには、不揮発性メモリに更新情報(差分データ)が保存される。従って、RAMに記憶されている更新後のシステムデータの複製をフラッシュメモリに保存する前に電源断が発生した場合には、不揮発性メモリに保存された更新情報をフラッシュメモリから読み出された更新前のシステムデータに反映することにより、電源断前のシステムデータを再構成する(例えば、特許文献1参照。)。
特開2006−350572号公報
As a conventional storage device, a storage device provided with a flash memory (card type memory), a non-volatile memory (NVRAM) capable of random access, and a RAM (volatile RAM) is known. In this storage device, data that needs to be stored even after the power is turned off is distributed and stored in a nonvolatile memory and a flash memory. That is, system data before update is stored in the flash memory, and update information (difference data) is stored in the nonvolatile memory when the system data read from the flash memory to the RAM is updated. Therefore, if a power failure occurs before the updated system data copy stored in the RAM is stored in the flash memory, the update information stored in the nonvolatile memory is read out from the flash memory. By reflecting the previous system data, the system data before power-off is reconstructed (see, for example, Patent Document 1).
JP 2006-350572 A

上記の記憶装置では、実際に使用するシステムデータをフラッシュメモリから読み出してRAMに記憶し、RAMに記憶されているシステムデータを更新するときには、更新情報を不揮発性メモリ(NVRAM)に逐次記憶している。そして、不意の電源断が発生した場合には、再起動時にフラッシュメモリに保存されているシステムデータと不揮発性メモリに保存されている更新情報に基づいて最新(更新後)のシステムデータを復元する。しかしながら、この記憶装置では、不揮発性メモリに記憶するデータとして、特定のデータ(システムデータ)を対象としているため、データが電源遮断によって破壊されて使用できなくなったり、最新のデータを復元できなくなったりするのを回避することを主な目的としている。従って、それ以外のデータ(ユーザデータなど)で書き換え頻度が高いデータが存在する場合には適していない。   In the above storage device, the system data actually used is read from the flash memory and stored in the RAM, and when updating the system data stored in the RAM, the update information is sequentially stored in the nonvolatile memory (NVRAM). Yes. If an unexpected power failure occurs, the latest (updated) system data is restored based on the system data saved in the flash memory and the update information saved in the nonvolatile memory at the time of restart. . However, since this storage device targets specific data (system data) as data to be stored in the non-volatile memory, the data is destroyed due to power interruption and cannot be used or the latest data cannot be restored. The main purpose is to avoid doing this. Therefore, it is not suitable when there is data other than that (such as user data) that has a high rewrite frequency.

そこで本発明は、書き換え頻度が高いデータと低いデータをフラッシュメモリとランダムアクセスが可能な不揮発性メモリとに保存するときに好適なメモリコントローラ、メモリシステム及びメモリ制御方法を提供することを目的とする。   Accordingly, an object of the present invention is to provide a memory controller, a memory system, and a memory control method that are suitable for storing frequently rewritten data and low data in a flash memory and a random accessible nonvolatile memory. .

上記目的を達成するために、本発明は、ホストシステムから与えられるセクタ単位の論理アドレスに基づいて、物理ブロック単位で記憶データの消去が行われるフラッシュメモリとランダムアクセスが可能な不揮発性メモリとに対するアクセスを制御するメモリコントローラを提供している。該メモリコントローラは、前記論理アドレスが連続する複数セクタの領域を含む論理グループを形成する論理グループ形成手段と、前記不揮発性メモリに前記論理グループに対応するデータを格納するための論理グループデータ記憶領域を複数個確保し、前記論理グループと論理グループデータ記憶領域との対応関係を管理する第1の領域管理手段と、1個又は複数個の論理グループを含む論理ブロックを形成する論理ブロック形成手段と、前記論理ブロックと前記フラッシュメモリ内の物理ブロックとの対応関係を管理する第2の領域管理手段と、前記各論理グループデータ記憶領域に格納されているデータの優先順位を管理する優先順位管理手段と、前記ホストシステムから与えられたデータを、該データに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域に書き込む書き込み手段と、前記論理グループデータ記憶領域に格納されているデータを、該データに対応する前記論理グループが属する前記論理ブロックと対応関係にある前記フラッシュメモリ内の物理ブロックに転送するデータ転送手段とを備える。前記第1の領域管理手段は、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無いとき、前記ホストシステムから与えられたデータに対応する前記論理グループに対して、いずれの前記論理グループにも対応していない前記論理グループデータ記憶領域または前記データ転送手段によって格納されているデータが前記フラッシュメモリ内の物理ブロックに転送された前記論理グループデータ記憶領域を新たに割り当てる。前記データ転送手段は、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無く、かついずれの前記論理グループにも対応していない前記論理グループデータ記憶領域が無いときに、前記優先順位管理手段によって管理されている優先順位が最下位のデータを前記フラッシュメモリ内の物理ブロックに転送する。   In order to achieve the above object, the present invention relates to a flash memory in which stored data is erased in units of physical blocks and a non-volatile memory capable of random access based on logical addresses in units of sectors given from a host system. A memory controller for controlling access is provided. The memory controller includes: a logical group forming unit that forms a logical group including a plurality of sectors having consecutive logical addresses; and a logical group data storage area for storing data corresponding to the logical group in the nonvolatile memory A first area management means for managing a correspondence relationship between the logical group and the logical group data storage area, and a logical block forming means for forming a logical block including one or a plurality of logical groups Second area management means for managing the correspondence between the logical block and the physical block in the flash memory; and priority order management means for managing the priority order of data stored in each logical group data storage area And the data given from the host system, the logical group corresponding to the data Writing means for writing to the logical group data storage area in a flexible relationship, and data stored in the logical group data storage area for the flash corresponding to the logical block to which the logical group corresponding to the data belongs Data transfer means for transferring to a physical block in the memory. When there is no logical group data storage area corresponding to the logical group corresponding to the data given from the host system, the first area management means corresponds to the data given from the host system. The logical group data in which data stored by the logical group data storage area or the data transfer means not corresponding to any logical group is transferred to a physical block in the flash memory with respect to a logical group A new storage area is allocated. The data transfer means does not have the logical group data storage area corresponding to the logical group corresponding to the data given from the host system, and does not correspond to any logical group. When there is no storage area, the lowest priority data managed by the priority management means is transferred to the physical block in the flash memory.

上記のメモリコントローラにおいて、前記論理ブロックに含まれる論理グループの個数が2個(nは1以上の整数)であるのが好ましい。 In the above memory controller, the number of logical groups included in the logical block is preferably 2 n (n is an integer of 1 or more).

また本発明は、上記のメモリコントローラと、物理ブロック単位で記憶データの消去が行われるフラッシュメモリと、ランダムアクセスが可能な不揮発性メモリとを備えるメモリシステムを提供している。   The present invention also provides a memory system comprising the memory controller described above, a flash memory in which stored data is erased in units of physical blocks, and a non-volatile memory capable of random access.

さらに本発明は、ホストシステムから与えられるセクタ単位の論理アドレスに基づいて、物理ブロック単位で記憶データの消去が行われるフラッシュメモリとランダムアクセスが可能な不揮発性メモリとに対するアクセスを制御するメモリ制御方法を提供している。該メモリ制御方法は、前記論理アドレスが連続する複数セクタの領域を含む論理グループを形成する論理グループ形成ステップと、前記不揮発性メモリに前記論理グループに対応するデータを格納するための論理グループデータ記憶領域を複数個確保し、前記論理グループと論理グループデータ記憶領域との対応関係を管理する第1の領域管理ステップと、1個又は複数個の論理グループを含む論理ブロックを形成する論理ブロック形成ステップと、前記論理ブロックと前記フラッシュメモリ内の物理ブロックとの対応関係を管理する第2の領域管理ステップと、前記各論理グループデータ記憶領域に格納されているデータの優先順位を管理する優先順位管理ステップと、前記ホストシステムから与えられたデータを、該データに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域に書き込む書き込みステップと、前記論理グループデータ記憶領域に格納されているデータを、該データに対応する前記論理グループが属する前記論理ブロックと対応関係にある前記フラッシュメモリ内の物理ブロックに転送するデータ転送ステップとを備える。前記第1の領域管理ステップでは、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無いとき、前記ホストシステムから与えられたデータに対応する前記論理グループに対して、いずれの前記論理グループにも対応していない前記論理グループデータ記憶領域または前記データ転送ステップによって格納されているデータが前記フラッシュメモリ内の物理ブロックに転送された前記論理グループデータ記憶領域を新たに割り当てる。前記データ転送ステップでは、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無く、かついずれの前記論理グループにも対応していない前記論理グループデータ記憶領域が無いときに、前記優先順位管理ステップによって管理されている優先順位が最下位のデータを前記フラッシュメモリ内の物理ブロックに転送する。   Furthermore, the present invention provides a memory control method for controlling access to a flash memory in which stored data is erased in units of physical blocks and a non-volatile memory capable of random access, based on logical addresses in units of sectors given from a host system. Is provided. The memory control method includes: a logical group forming step for forming a logical group including a plurality of sector areas having consecutive logical addresses; and a logical group data storage for storing data corresponding to the logical group in the nonvolatile memory A first area management step for securing a plurality of areas and managing the correspondence between the logical group and the logical group data storage area, and a logical block formation step for forming a logical block including one or a plurality of logical groups A second area management step for managing the correspondence between the logical block and the physical block in the flash memory; and priority management for managing the priority of data stored in each logical group data storage area Step and data given by the host system before the corresponding data A write step for writing to the logical group data storage area corresponding to the logical group; and data stored in the logical group data storage area in correspondence with the logical block to which the logical group corresponding to the data belongs. A data transfer step of transferring to a physical block in the flash memory. In the first area management step, when there is no logical group data storage area corresponding to the logical group corresponding to the data given from the host system, the data corresponding to the data given from the host system is stored. The logical group data in which the logical group data storage area not corresponding to any logical group or the data stored by the data transfer step is transferred to a physical block in the flash memory with respect to the logical group A new storage area is allocated. In the data transfer step, the logical group data that does not correspond to any logical group and does not have the logical group data storage area corresponding to the logical group corresponding to the data given from the host system When there is no storage area, the data having the lowest priority managed by the priority management step is transferred to the physical block in the flash memory.

上記のメモリ制御方法において、1個の前記論理ブロックに複数個の前記フラッシュメモリ内の物理ブロックが割り当てられるときに、前記データ転送ステップでは、論理アドレスが連続するデータが異なる前記フラッシュメモリ内の物理ブロックに割り振られるようにデータの転送が行われるのが好ましい。   In the above memory control method, when a plurality of physical blocks in the flash memory are allocated to one logical block, the data transfer step includes physical data in the flash memory in which data having consecutive logical addresses are different. It is preferred that the data be transferred so that it is allocated to the block.

本発明によるメモリコントローラ、メモリシステム及びメモリ制御方法によれば、ホストシステムから与えられたデータは、一旦、ランダムアクセスが可能な不揮発性メモリに記憶される。そして、不揮発性メモリに記憶されているデータは、優先順位管理手段によって優先順位が管理され、不揮発性メモリに新たなデータを記憶することができなくなったときには、優先順位が最下位のデータがフラッシュメモリ内の物理ブロックに転送される。一方、頻繁に書き換えられるデータの優先順位は最下位になる可能性が低いため、フラッシュメモリに転送されずに不揮発性メモリに記憶されている可能性が高い。したがって、頻繁に書き換えられるデータについては、不揮発性メモリに記憶されているデータを書き換えることになり、フラッシュメモリに記憶されているデータを頻繁に書き換える必要がない。このため、フラッシュメモリに記憶されているデータの書き換え回数が減少し、フラッシュメモリの寿命を向上させることができる。   According to the memory controller, the memory system, and the memory control method according to the present invention, data given from the host system is temporarily stored in a non-volatile memory that can be randomly accessed. The priority of the data stored in the nonvolatile memory is managed by the priority management means. When new data cannot be stored in the nonvolatile memory, the data with the lowest priority is flashed. Transferred to physical block in memory. On the other hand, since the priority of data that is frequently rewritten is unlikely to be the lowest priority, it is highly likely that it is stored in the non-volatile memory without being transferred to the flash memory. Therefore, for data that is frequently rewritten, data stored in the nonvolatile memory is rewritten, and it is not necessary to frequently rewrite data stored in the flash memory. For this reason, the number of rewrites of data stored in the flash memory is reduced, and the life of the flash memory can be improved.

本発明の実施の形態によるメモリコントローラ、メモリシステム及びメモリ制御方法について図1乃至図10に基づき説明する。図1に示されるように、メモリシステム100は、フラッシュメモリ2と、不揮発性RAM3と、フラッシュメモリ2及び不揮発性RAM3を制御するメモリコントローラ1とで構成されている。   A memory controller, a memory system, and a memory control method according to an embodiment of the present invention will be described with reference to FIGS. As shown in FIG. 1, the memory system 100 includes a flash memory 2, a nonvolatile RAM 3, and a memory controller 1 that controls the flash memory 2 and the nonvolatile RAM 3.

メモリシステム100は、外部バス13を介してホストシステム4と接続されている。ホストシステム4は、ホストシステム4の全体の動作を制御するためのCPU(Central Processing Unit)、メモリシステム100との情報の授受を担うコンパニオンチップ等から構成されている。ホストシステム4は、例えば、文字、音声、あるいは画像情報等の種々の情報を処理するパーソナルコンピュータやデジタルスチルカメラをはじめとする各種情報処理装置である。   The memory system 100 is connected to the host system 4 via the external bus 13. The host system 4 includes a CPU (Central Processing Unit) for controlling the entire operation of the host system 4, a companion chip for transferring information to and from the memory system 100, and the like. The host system 4 is various information processing apparatuses such as a personal computer and a digital still camera that process various kinds of information such as characters, sounds, and image information.

メモリコントローラ1は、図1に示されるように、マイクロプロセッサ6と、ホストインタフェースブロック7と、ワークエリア8と、バッファ9と、フラッシュメモリインタフェースブロック10と、ECCブロック11と、ROM(Read Only Memory)12と、RAMインタフェースブロック16とを備える。メモリコントローラ1は、内部バス14,15を介してそれぞれフラッシュメモリ2、不揮発性RAM3と接続されている。これら機能ブロックによって構成されるメモリコントローラ1は、一つの半導体チップ上に集積される。以下、各機能ブロックについて説明する。   As shown in FIG. 1, the memory controller 1 includes a microprocessor 6, a host interface block 7, a work area 8, a buffer 9, a flash memory interface block 10, an ECC block 11, and a ROM (Read Only Memory). ) 12 and a RAM interface block 16. The memory controller 1 is connected to the flash memory 2 and the nonvolatile RAM 3 via internal buses 14 and 15, respectively. The memory controller 1 constituted by these functional blocks is integrated on one semiconductor chip. Hereinafter, each functional block will be described.

ホストインタフェースブロック7は、ホストシステム4との間でデータ、アドレス情報、ステータス情報、外部コマンド等の授受を行なう。外部コマンドとは、ホストシステム4がメモリシステム100に対して処理の実行を指示するためのコマンドである。ホストシステム4よりメモリシステム100に供給されるデータ等は、ホストインタフェースブロック7を入口としてメモリシステム100の内部(例えば、バッファ9)に取り込まれる。また、メモリシステム100からホストシステム4に供給されるデータ等は、ホストインタフェースブロック7を出口としてホストシステム4に供給される。   The host interface block 7 exchanges data, address information, status information, external commands, etc. with the host system 4. The external command is a command for the host system 4 to instruct the memory system 100 to execute processing. Data or the like supplied from the host system 4 to the memory system 100 is taken into the memory system 100 (for example, the buffer 9) using the host interface block 7 as an entrance. Data supplied from the memory system 100 to the host system 4 is supplied to the host system 4 through the host interface block 7 as an exit.

ワークエリア8は、フラッシュメモリ2の制御に必要なデータを一時的に保持する作業領域であり、複数のSRAM(Static Random Access Memory)セルによって構成されている。ワークエリア8には、例えば、論理ブロックと物理ブロックとの関係を示したアドレス変換テーブルなどが記憶される。   The work area 8 is a work area that temporarily holds data necessary for controlling the flash memory 2 and is configured by a plurality of SRAM (Static Random Access Memory) cells. The work area 8 stores, for example, an address conversion table indicating the relationship between logical blocks and physical blocks.

バッファ9は、フラッシュメモリ2又は不揮発性RAM3から読み出したデータを、ホストシステム4が受け取り可能な状態となるまで保持する。また、フラッシュメモリ2又は不揮発性RAM3に書き込むデータを、各メモリが書き込み可能な状態となるまで保持する。   The buffer 9 holds the data read from the flash memory 2 or the nonvolatile RAM 3 until the host system 4 can receive the data. Further, data to be written to the flash memory 2 or the nonvolatile RAM 3 is held until each memory is in a writable state.

フラッシュメモリインタフェースブロック10は、内部バス14を介して、フラッシュメモリ2との間でデータ、アドレス情報、ステータス情報、内部コマンド等の授受を行う。ここで、内部コマンドとは、メモリコントローラ1がフラッシュメモリ2に処理の実行を指示するためのコマンドである。フラッシュメモリ2及び不揮発性RAM3は、メモリコントローラ1から与えられる内部コマンドに従って動作する。RAMインタフェースブロック16は、内部バス15を介して不揮発性RAM3へのデータの書き込み又は不揮発性RAM3からのデータの読み出しを行う。この際、不揮発性RAM3には、内部バス15を介してアドレス信号及び各種制御信号が供給される。   The flash memory interface block 10 exchanges data, address information, status information, internal commands, and the like with the flash memory 2 via the internal bus 14. Here, the internal command is a command for the memory controller 1 to instruct the flash memory 2 to execute processing. The flash memory 2 and the nonvolatile RAM 3 operate in accordance with an internal command given from the memory controller 1. The RAM interface block 16 writes data to the nonvolatile RAM 3 or reads data from the nonvolatile RAM 3 via the internal bus 15. At this time, an address signal and various control signals are supplied to the nonvolatile RAM 3 via the internal bus 15.

ECCブロック11は、フラッシュメモリ2に書き込むデータに対するエラーコレクションコードを生成するとともに、フラッシュメモリから読み出されたデータに付加されているエラーコレクションコードに基づいて、読み出されたデータに含まれる誤りを検出・訂正する。   The ECC block 11 generates an error correction code for the data to be written to the flash memory 2 and detects an error included in the read data based on the error correction code added to the data read from the flash memory. Detect and correct.

ROM12は、マイクロプロセッサ6による処理の手順を規定するプログラムが記憶される不揮発性の記憶素子である。例えば、ホストシステム4から与えられたユーザデータに不揮発性RAM3の領域を割り当てる処理(後述)の手順を規定するプログラムが格納されている。   The ROM 12 is a non-volatile storage element that stores a program that defines a processing procedure by the microprocessor 6. For example, a program that defines a procedure of processing (described later) for allocating an area of the nonvolatile RAM 3 to user data given from the host system 4 is stored.

マイクロプロセッサ6は、ROM12に記憶されているプログラムに従って、メモリコントローラ1の全体の動作を制御する。例えば、マイクロプロセッサ6は、各種処理を定義したコマンドセットをROM12から読み出して、フラッシュメモリインタフェースブロック10に各種処理を実行させる。   The microprocessor 6 controls the overall operation of the memory controller 1 in accordance with a program stored in the ROM 12. For example, the microprocessor 6 reads a command set defining various processes from the ROM 12 and causes the flash memory interface block 10 to execute various processes.

フラッシュメモリ2はNAND型フラッシュメモリからなる。NAND型フラッシュメモリは、不揮発性メモリであり、レジスタと複数のメモリセルからなるメモリセルアレイとを備えている。メモリセルアレイは、複数のメモリセル群と、ワード線とを備える。ここで、メモリセル群は、複数のメモリセルが直列に接続されたものである。各ワード線は、メモリセル群の特定のメモリセルを選択するためのものである。このワード線を介して選択されたメモリセルとレジスタとの間で、データの書き込み又は読み出し、即ち、レジスタから選択されたメモリセルへのデータの書き込み又は選択されたメモリセルからレジスタへのデータの読み出しが行われる。即ち、フラッシュメモリ2に入力されたデータは、レジスタを介してメモリセルに書き込まれ、メモリセルから読み出されたデータは、レジスタを介してフラッシュメモリ2から出力される。   The flash memory 2 is a NAND flash memory. The NAND flash memory is a non-volatile memory, and includes a register and a memory cell array composed of a plurality of memory cells. The memory cell array includes a plurality of memory cell groups and word lines. Here, the memory cell group is a group in which a plurality of memory cells are connected in series. Each word line is for selecting a specific memory cell in the memory cell group. Data is written or read between the selected memory cell and the register via the word line, that is, data is written from the register to the selected memory cell or data is transferred from the selected memory cell to the register. Reading is performed. That is, data input to the flash memory 2 is written to the memory cell via the register, and data read from the memory cell is output from the flash memory 2 via the register.

NAND型フラッシュメモリでは、データ読み出し動作及びデータ書き込み動作はページ単位で行われ、データ消去動作はブロック(物理ブロック)単位でおこなわれる。図2に示されるように、物理ブロックは、複数のページで構成される。フラッシュメモリの物理ブロックの構成は、フラッシュメモリの大容量化に伴い変化している。本実施の形態では、1個のページが4セクタ(2048バイト)のユーザ領域21と64バイトの冗長領域22とで構成され、1個の物理ブロック(図2のブロック0、ブロック1、...)が64個のページで構成されているフラッシュメモリを用いる。本実施の形態では用いないが、1個のページが1セクタ(512バイト)のユーザ領域21と16バイトの冗長領域22とで構成され、1個の物理ブロックが32個のページで構成されているフラッシュメモリも知られている。   In the NAND flash memory, a data read operation and a data write operation are performed in units of pages, and a data erase operation is performed in units of blocks (physical blocks). As shown in FIG. 2, the physical block is composed of a plurality of pages. The configuration of the physical block of the flash memory has changed as the capacity of the flash memory has increased. In this embodiment, one page is composed of a user area 21 of 4 sectors (2048 bytes) and a redundant area 22 of 64 bytes, and one physical block (block 0, block 1,. .) Uses a flash memory composed of 64 pages. Although not used in this embodiment, one page is composed of one sector (512 bytes) user area 21 and 16 bytes of redundant area 22, and one physical block is composed of 32 pages. There are also known flash memories.

ユーザ領域21はホストシステム4から与えられるデータを記憶するための領域である。冗長領域22は、誤り訂正符号(ECC:Error Correcting Code)、論理アドレス情報、ブロックステータス(フラグ)等の付加データを記憶するための領域である。   The user area 21 is an area for storing data given from the host system 4. The redundant area 22 is an area for storing additional data such as an error correcting code (ECC), logical address information, and a block status (flag).

論理アドレス情報は、その論理アドレス情報が書き込まれている物理ブロックと対応関係にある論理ブロックを特定するための情報である。いずれの論理ブロックにも関連付けられていない物理ブロック、つまり、対応する論理ブロックがない物理ブロックについては、そのブロックの冗長領域22に、論理アドレス情報が書き込まれていない。したがって、冗長領域22に論理アドレス情報が格納されているか否かを判定することにより、その冗長領域22が含まれている物理ブロックが空きブロックであるか否かを判定することができる。   The logical address information is information for specifying a logical block corresponding to the physical block in which the logical address information is written. For a physical block that is not associated with any logical block, that is, a physical block that does not have a corresponding logical block, no logical address information is written in the redundant area 22 of the block. Therefore, by determining whether or not the logical address information is stored in the redundant area 22, it is possible to determine whether or not the physical block including the redundant area 22 is an empty block.

尚、論理ブロックと物理ブロックとの対応関係は通常、アドレス変換テーブル(第2の領域管理手段)によって管理される。このアドレス変換テーブルは、各物理ブロックの冗長領域22に記憶されている論理アドレス情報に基づいて作成される。   The correspondence relationship between the logical block and the physical block is usually managed by an address conversion table (second area management means). This address conversion table is created based on the logical address information stored in the redundant area 22 of each physical block.

ブロックステータス(フラグ)は、ブロックの良否を示すフラグである。正常にデータの書き込み等を行うことができないブロックは、不良ブロックと判別され、冗長領域22には、不良ブロックであることを示すブロックステータス(フラグ)が書き込まれる。尚、初期不良の不良ブロックには、不良ブロックであることを示すブロックステータス(フラグ)が出荷前に書き込まれる。   The block status (flag) is a flag indicating whether the block is good or bad. A block in which data cannot be normally written is determined as a defective block, and a block status (flag) indicating a defective block is written in the redundant area 22. Note that a block status (flag) indicating a defective block is written in the defective block with an initial defect before shipment.

不揮発性RAM3は、電源の供給が遮断されても記憶内容を保持することが可能なメモリであって、且つ、ランダムな書き込み及び読み出し可能なメモリ(Random Access Memory)である。また、不揮発性RAM3は、データの上書きが可能なので、フラッシュメモリのようにデータの書き込みと消去を別々に行う必要が無い。一般的には、不揮発性RAM3の容量はフラッシュメモリ2と比較すると小さい。不揮発性RAM3の例として、FRAM(登録商標)とも称されるFeRAM(Ferroelectric Random Access Memory)、MRAM(Magnetic Random Access Memory)が挙げられる。   The non-volatile RAM 3 is a memory that can retain stored contents even when power supply is interrupted, and is a memory that can be randomly written and read (Random Access Memory). In addition, since the nonvolatile RAM 3 can overwrite data, it is not necessary to perform data writing and erasing separately as in a flash memory. In general, the capacity of the nonvolatile RAM 3 is smaller than that of the flash memory 2. Examples of the nonvolatile RAM 3 include FeRAM (Ferroelectric Random Access Memory) also called FRAM (registered trademark), and MRAM (Magnetic Random Access Memory).

次に、不揮発性RAM3の構成について図3を参照しながら説明する。図3に示されるように、本実施の形態による不揮発性RAM3は、管理領域31(第1の領域管理手段、優先順位管理手段)と論理グループデータ記憶領域32とを備える。管理領域31は、論理グループデータ記憶領域32に記憶されたデータの論理グループと優先順位を管理するための領域である。管理領域31は、優先順位が最高位の領域を記憶する最高位記憶領域31Aと、論理グループデータ記憶領域32に記憶されているデータの論理グループと優先順位などを管理するためのテーブルを記憶するテーブル記憶領域31Bとを有する。   Next, the configuration of the nonvolatile RAM 3 will be described with reference to FIG. As shown in FIG. 3, the nonvolatile RAM 3 according to the present embodiment includes a management area 31 (first area management means, priority order management means) and a logical group data storage area 32. The management area 31 is an area for managing logical groups and priorities of data stored in the logical group data storage area 32. The management area 31 stores a highest-order storage area 31A for storing the highest-priority area, and a table for managing logical groups and priorities of data stored in the logical group data storage area 32. And a table storage area 31B.

論理グループデータ記憶領域32は、ホストシステム4から与えられたデータを記憶するための領域である。本実施の形態では、論理グループデータ記憶領域32を、領域番号#0〜#15が付された16個の領域に分割して使用する。各領域は32kB(キロバイト)の容量を有する。各記憶領域には、1個の論理グループに属するデータが保存される。   The logical group data storage area 32 is an area for storing data given from the host system 4. In this embodiment, the logical group data storage area 32 is divided into 16 areas assigned with area numbers # 0 to # 15. Each area has a capacity of 32 kB (kilobytes). Each storage area stores data belonging to one logical group.

次に、論理セクタ、論理グループ及び論理ブロックの関係について、図4を参照しながら説明する。ホストシステム4側のアドレス空間(論理アドレス空間)は、セクタ(512バイト)単位で分割した領域に付けた通し番号であるLBA(Logical Block Address)41によって管理されている。   Next, the relationship between logical sectors, logical groups, and logical blocks will be described with reference to FIG. The address space (logical address space) on the host system 4 side is managed by an LBA (Logical Block Address) 41 that is a serial number assigned to an area divided in units of sectors (512 bytes).

本実施の形態では、LBAが連続する64セクタの領域を論理グループとして管理し、各論理グループに論理グループ番号(LGN)42を付している。例えば、図4に示されるように、LBA#0〜#63の64セクタの領域はLGN#0の論理グループに属し、LBA#64〜#127の64セクタの領域はLGN#1の論理グループに属している。LBA#128以降の領域についても同様に64セクタの領域が論理グループとして管理される。1個の論理グループに含まれる領域は、32kBの容量を有する(論理グループ形成手段)。   In the present embodiment, a 64-sector area with continuous LBAs is managed as a logical group, and a logical group number (LGN) 42 is assigned to each logical group. For example, as shown in FIG. 4, the 64 sector area of LBA # 0 to # 63 belongs to the logical group of LGN # 0, and the 64 sector area of LBA # 64 to # 127 belongs to the logical group of LGN # 1. belong to. Similarly, for the areas after LBA # 128, an area of 64 sectors is managed as a logical group. An area included in one logical group has a capacity of 32 kB (logical group forming means).

また本実施形態では、LBAが連続する256セクタの領域を論理ブロックとして管理し、この論理ブロックに論理ブロック番号(LBN)43を付している。例えば、LBA#0〜#255の256セクタの領域はLBN#0の論理ブロックに属し、LBA#256〜#511の256セクタの領域はLBN#1の論理ブロックに属している。LBA#512以下の領域についても同様に256セクタの領域が論理ブロックとして管理される(論理ブロック形成手段)。   In this embodiment, an area of 256 sectors in which LBAs are continuous is managed as a logical block, and a logical block number (LBN) 43 is assigned to this logical block. For example, the 256 sector area of LBA # 0 to # 255 belongs to the logical block of LBN # 0, and the 256 sector area of LBA # 256 to # 511 belongs to the logical block of LBN # 1. Similarly for the area below LBA # 512, the area of 256 sectors is managed as a logical block (logical block forming means).

以上より、LBN#0の論理ブロックはLGN#0〜#3の論理グループから構成され、LBN#1の論理ブロックはLGN#4〜#7の論理グループから構成されている。すなわち、1個の論理ブロックは4個の論理グループに対応している。   As described above, the logical block of LBN # 0 is composed of logical groups of LGN # 0 to # 3, and the logical block of LBN # 1 is composed of logical groups of LGN # 4 to # 7. That is, one logical block corresponds to four logical groups.

図5は、ビット表示(2進数表示)されたLBA、論理グループ番号(LGN)、論理ブロック番号(LBN)等を示している。記号「*」は各ビットを表している。図示の便宜上、上位4ビット及び下位12ビットのみ表示しており、その中間のビットは省略されている。図5において、ビット列全体がLBA41を表している。また、下位8ビットを除いたビット列が論理ブロック番号(LBN)43を表し、下位6ビットを除いたビット列が論理グループ番号(LGN)42を表している。また、下位8ビットは各論理ブロックにおけるセクタ単位の通し番号である論理セクタ番号(LSN)44を表す。論理セクタ番号(LSN)44は#0〜#255の値をとる。また、論理グループ番号(LGN)42の下位2ビット(LBAの最下位ビット側から数えて7、8ビット目の2ビット)は、各論理ブロック内でのグループ番号である論理ブロック内グループ番号(LBIGN)45を表す。論理ブロック内グループ番号(LBIGN)45は#0〜#3の値をとる。   FIG. 5 shows an LBA, a logical group number (LGN), a logical block number (LBN), and the like that are displayed in bits (binary number). The symbol “*” represents each bit. For convenience of illustration, only the upper 4 bits and the lower 12 bits are shown, and the intermediate bits are omitted. In FIG. 5, the entire bit string represents LBA 41. The bit string excluding the lower 8 bits represents the logical block number (LBN) 43, and the bit string excluding the lower 6 bits represents the logical group number (LGN) 42. The lower 8 bits represent a logical sector number (LSN) 44 that is a serial number of each sector in each logical block. The logical sector number (LSN) 44 takes values from # 0 to # 255. Further, the lower 2 bits of the logical group number (LGN) 42 (2 bits of the 7th and 8th bits counted from the least significant bit side of the LBA) are the group numbers in the logical block (group numbers within the logical block). LBIGN) 45. The logical block group number (LBIGN) 45 takes values of # 0 to # 3.

上述のように本実施の形態では、1つの論理ブロックに含まれる論理グループの個数を2個(nは1以上の整数、上述の例ではn=2)に設定している。2は2のべき乗を表す。このように設定すると、LBAをビット表示(2進数表示)したときの一部のビットの値に基づいて、論理ブロック内グループ番号(LBIGN)を判別することができる。尚、論理ブロック内の領域を複数個の論理グループに分割せずに、論理グループと論理ブロックを同じLBAの範囲の領域に割り当ててもよい。 As described above, in the present embodiment, the number of logical groups included in one logical block is set to 2 n (n is an integer of 1 or more, and n = 2 in the above example). 2 n represents a power of 2. With this setting, it is possible to determine the logical block group number (LBIGN) based on the values of some of the bits when the LBA is displayed in bits (binary display). Note that the logical group and the logical block may be allocated to an area in the same LBA range without dividing the area in the logical block into a plurality of logical groups.

次に、本実施の形態で用いられる論理アドレスについて説明する。   Next, the logical address used in this embodiment will be described.

一般的なフラッシュメモリシステムでは、1つの論理ブロックに割り当てられた物理ブロックにおいて、#0〜#255の物理セクタ番号(PSN)が割り当てられている256個の物理セクタ領域に、LBAが連続する当該論理ブロックのデータが順番に保存されている。言い換えれば、物理セクタ領域に保存されているデータの論理セクタ番号(LSN)44の値は、当該物理セクタ領域の物理セクタ番号(PSN)の値と一致している。実際には、ページ単位で書き込みが行われるため、論理ページ番号(LPN)と物理ページ番号(PPN)が一致しているとも言える。なお、各ページには4個の物理セクタ領域が含まれる。従って、論理ページ番号(LPN)と物理ページ番号(PPN)は#0〜#63の値をとる。   In a general flash memory system, in a physical block assigned to one logical block, LBAs are continuous in 256 physical sector areas to which physical sector numbers (PSNs) # 0 to # 255 are assigned. The logical block data is stored in order. In other words, the value of the logical sector number (LSN) 44 of the data stored in the physical sector area matches the value of the physical sector number (PSN) of the physical sector area. Actually, since writing is performed in units of pages, it can be said that the logical page number (LPN) matches the physical page number (PPN). Each page includes four physical sector areas. Accordingly, the logical page number (LPN) and the physical page number (PPN) take values from # 0 to # 63.

一方、本実施の形態では、論理グループ単位で物理ブロックに書き込むデータの順番を変更可能である。つまり、物理セクタ領域に保存されているデータの論理セクタ番号(LSN)と、当該物理セクタ領域の物理セクタ番号(PSN)との値は必ずしも一致しない。実際には、ページ単位で書き込みが行われるため、論理ページ番号(LPN)と物理ページ番号(PPN)が必ずしも一致しないとも言える。より具体的には、図6に示されるように、LBN#0内のLGN#0(LSN#0〜#63)に属するデータはPBA#0内のPSN#128〜#191に記憶されている。また、LBN#0内のLGN#1(LSN#64〜#127)に属するデータはPBA#0内のPSN#192〜#255に記憶されている。ただし、同一のLBNに属する論理グループのデータは、当該LBNの論理ブロックに対応するPBAの物理ブロックに保存される。   On the other hand, in this embodiment, it is possible to change the order of data written to the physical block in units of logical groups. That is, the values of the logical sector number (LSN) of data stored in the physical sector area and the physical sector number (PSN) of the physical sector area do not necessarily match. Actually, since writing is performed in units of pages, it can be said that the logical page number (LPN) and the physical page number (PPN) do not always match. More specifically, as shown in FIG. 6, data belonging to LGN # 0 (LSN # 0 to # 63) in LBN # 0 is stored in PSN # 128 to # 191 in PBA # 0. . Data belonging to LGN # 1 (LSN # 64 to # 127) in LBN # 0 is stored in PSN # 192 to # 255 in PBA # 0. However, data of logical groups belonging to the same LBN is stored in a PBA physical block corresponding to the logical block of the LBN.

このため、フラッシュメモリ2においては、論理グループと物理グループの対応関係を示す情報を各物理グループ内の先頭ページ又は各ページの冗長領域22に書き込むことにより、データの論理アドレスと当該データが記憶された物理アドレスとの対応関係が分かる。例えば、各物理グループ内の先頭ページ又は各ページの冗長領域22に論理ブロック内グループ番号(LBIGN)を書き込めばよい。ここで、物理グループは、論理ブロックに含まれる論理グループと同じ数の領域に分割した物理ブロック内の領域であり、本実施の形態では、PPN#0〜#15の物理ページ、PPN#16〜#31の物理ページ、PPN#32〜#47の物理ページ及びPPN#48〜#63の物理ページがそれぞれ物理グループとして管理される。   Therefore, in the flash memory 2, the logical address of the data and the data are stored by writing the information indicating the correspondence relationship between the logical group and the physical group in the first page in each physical group or the redundant area 22 of each page. You can see the correspondence with the physical address. For example, the intra-logical block group number (LBIGN) may be written in the first page in each physical group or the redundant area 22 of each page. Here, the physical group is an area in the physical block divided into the same number of areas as the logical group included in the logical block. In this embodiment, the physical pages of PPN # 0 to # 15, PPN # 16 to The physical page # 31, the physical pages PPP # 32 to # 47, and the physical pages PPP # 48 to # 63 are managed as physical groups, respectively.

次に、ホストシステム4からのコマンドに基づくデータの読み出し及び書き込み処理の概要について説明する。   Next, an overview of data read and write processing based on commands from the host system 4 will be described.

メモリシステム100からデータを読み出す際には、ホストシステム4から所望のデータの論理アドレス(より具体的には読み出すデータに対応するLBA若しくはLBAの範囲)を指定した読み出しコマンドがメモリコントローラ1に与えられる。マイクロプロセッサ6は、ホストインタフェースブロック7を介してこのコマンドを受け取り、指定されたLBAからアクセス対象の領域が含まれる論理グループのLGNを判別する。マイクロプロセッサ6は、まず不揮発性RAM3に当該LGNに対応するデータが記憶されているか否かを調べ、もし記憶されていればこのデータを、RAMインタフェースブロック16を介してバッファ9に読み出す。もし当該LGNに対応するデータが不揮発性RAM3に記憶されていなければ、フラッシュメモリ2に記憶されているデータを、フラッシュメモリインタフェースブロック10を介してバッファ9に読み出す。読み出されたデータは、ホストインタフェースブロック7を介してホストシステム4へ提供される。つまり、同一のLBA(LGN)に対応するデータがフラッシュメモリ2と不揮発性RAM3との両方に保存されていて、かつ、フラッシュメモリ2と不揮発性RAM3とでデータの内容が異なる場合がある。この場合は、後述するように不揮発性RAM3のデータがより新しいデータであるから、不揮発性RAM3のデータを優先して読み出す。なお、ECCブロック11は、フラッシュメモリ2からデータを読み出す場合には、読み出されたデータに付加されているエラーコレクションコード(冗長領域22に書き込まれているエラーコレクションコード)に基づいて当該データに含まれる誤りを検出・訂正する。   When reading data from the memory system 100, a read command designating a logical address of the desired data (more specifically, an LBA or LBA range corresponding to the read data) is given to the memory controller 1 from the host system 4. . The microprocessor 6 receives this command via the host interface block 7 and determines the LGN of the logical group including the area to be accessed from the designated LBA. The microprocessor 6 first checks whether or not the data corresponding to the LGN is stored in the nonvolatile RAM 3, and if it is stored, reads this data to the buffer 9 via the RAM interface block 16. If the data corresponding to the LGN is not stored in the nonvolatile RAM 3, the data stored in the flash memory 2 is read into the buffer 9 via the flash memory interface block 10. The read data is provided to the host system 4 via the host interface block 7. That is, data corresponding to the same LBA (LGN) may be stored in both the flash memory 2 and the nonvolatile RAM 3, and the data contents may be different between the flash memory 2 and the nonvolatile RAM 3. In this case, as will be described later, since the data in the nonvolatile RAM 3 is newer, the data in the nonvolatile RAM 3 is read preferentially. Note that when the ECC block 11 reads data from the flash memory 2, the ECC block 11 stores the data based on the error correction code added to the read data (the error correction code written in the redundant area 22). Detect and correct contained errors.

一方、メモリシステム100にデータを書き込む際には、ホストシステム4から書き込もうとするデータ及びその論理アドレス(より具体的には書き込み先を指示するLBA若しくはLBAの範囲)を指定した書き込みコマンドがメモリコントローラ1に与えられる。ホストシステム4から与えられたデータは、一旦バッファ9に保持される。マイクロプロセッサ6は、ホストインタフェースブロック7を介してこのコマンドを受け取り、指定されたLBAからアクセス対象の領域が含まれる論理グループのLGNを判別する。マイクロプロセッサ6は、後述するように、このLGNに対応する領域が不揮発性RAM3内に割り当てられている場合は、その領域に当該データを書き込み、割り当てられていない場合は、このLGNに対応する領域を新たに割り当て、新たに割り当てた領域に当該データを書き込む。この書き込み処理については、図7〜図10を参照して以下でより詳細に説明する。   On the other hand, when data is written to the memory system 100, a write command designating the data to be written from the host system 4 and its logical address (more specifically, the LBA or LBA range indicating the write destination) is sent to the memory controller. Is given to 1. The data given from the host system 4 is once held in the buffer 9. The microprocessor 6 receives this command via the host interface block 7 and determines the LGN of the logical group including the area to be accessed from the designated LBA. As will be described later, when an area corresponding to this LGN is allocated in the nonvolatile RAM 3, the microprocessor 6 writes the data in that area, and when not allocated, an area corresponding to this LGN. Is newly allocated and the data is written in the newly allocated area. This writing process will be described in more detail below with reference to FIGS.

図7〜図9は、不揮発性RAM3(論理グループデータ記憶領域32)内の各領域と論理グループとの対応関係、及び各領域に記憶されているデータの優先順位を管理するための管理テーブル50を示している。管理テーブル50は、論理グループデータ記憶領域32内の各領域の領域番号51(#0〜#15)と、各領域に割り当てられている論理グループのLGN52と、各領域に記憶されているデータの優先リンク53との対応関係を示すテーブルであり、テーブル記憶領域31Bに保存されている。   7 to 9 show a management table 50 for managing the correspondence between each area in the nonvolatile RAM 3 (logical group data storage area 32) and the logical group, and the priority order of data stored in each area. Is shown. The management table 50 includes the area number 51 (# 0 to # 15) of each area in the logical group data storage area 32, the LGN 52 of the logical group assigned to each area, and the data stored in each area. It is a table showing the correspondence with the priority link 53, and is stored in the table storage area 31B.

優先リンク53は、各領域に記憶されたデータの優先順位を示すためのものである。優先リンク53の値は、当該優先リンクに対応する領域の次に高い優先順位となる領域の領域番号を示している。また、管理テーブル50とは別に、最も優先順位が高い(最高位)データを保存する領域の領域番号が不揮発性RAM3の最高位記憶領域31Aに記憶されている。一方、最も優先順位が低い(最下位)データは、優先リンクの値がNULLである領域番号に対応するデータである。   The priority link 53 is used to indicate the priority order of data stored in each area. The value of the priority link 53 indicates the area number of the area having the next highest priority after the area corresponding to the priority link. In addition to the management table 50, the area number of the area where the highest priority (highest) data is stored is stored in the highest storage area 31A of the nonvolatile RAM 3. On the other hand, the data with the lowest priority (lowest order) is data corresponding to the area number whose priority link value is NULL.

例えば、図7の状態では、最高位記憶領域31Aに最高位の領域番号である#3が記憶されている。最高位の領域番号#3の優先リンクは#6を示している。したがって、第2位の領域は領域番号#6の領域である。同様に、第3位の領域は、第2位の領域番号#6の優先リンクが示す領域番号#10の領域である。以下同様に、第4位から最下位までが指示される。最下位の領域(領域番号#9)の優先リンクは、指示すべき領域が無いので、NULL値となっている。   For example, in the state of FIG. 7, # 3, which is the highest area number, is stored in the highest storage area 31A. The priority link of the highest region number # 3 indicates # 6. Therefore, the second area is the area of area number # 6. Similarly, the third area is the area of the area number # 10 indicated by the priority link of the second area number # 6. In the same manner, the fourth to the lowest order are instructed. The priority link of the lowest area (area number # 9) has a NULL value because there is no area to be indicated.

不揮発性RAM3内の論理グループデータ記憶領域32に新たな論理グループを割り当てる場合の処理について、図7、8及び10を参照して説明する。不揮発性RAM3の領域が図7のような状態になっていると仮定し、この状態でLGN#33の論理グループに含まれる領域(当該論理グループの全領域又は一部の領域に相当する領域)に対するデータの書き込みを指示するコマンドがホストシステムから与えられたとする。図10のフローチャートに示したように、まず、LGN#33の論理グループに対応する領域が不揮発性RAM3(論理グループデータ記憶領域32)内に割り当てられているか否かを判断する。図7の状態では、領域番号#0〜#15のいずれの領域にもLGN#33の論理グループは割り当てられていない(S10:No)。また、いずれの論理グループにも対応していない領域(空き領域)は存在しない(S20:No)。なお、ステップを「S」と省略する。   Processing when a new logical group is allocated to the logical group data storage area 32 in the nonvolatile RAM 3 will be described with reference to FIGS. Assuming that the area of the non-volatile RAM 3 is in the state as shown in FIG. 7, in this state, the area included in the logical group of LGN # 33 (area corresponding to all or part of the logical group) Suppose that the host system gives a command for instructing the writing of data. As shown in the flowchart of FIG. 10, first, it is determined whether or not an area corresponding to the logical group of LGN # 33 is allocated in the nonvolatile RAM 3 (logical group data storage area 32). In the state of FIG. 7, the logical group of LGN # 33 is not assigned to any of the area numbers # 0 to # 15 (S10: No). Further, there is no area (empty area) that does not correspond to any logical group (S20: No). The step is abbreviated as “S”.

このため、まず図7で優先順位最下位の領域である領域番号#9のデータ(LGN#155の論理グループに対応するデータ)を、バッファ9を経由してフラッシュメモリ2内の物理ブロックへ転送する(S30、データ転送手段)。つまり、領域番号#9の領域に記憶されているデータをバッファ9に読み出し、バッファ9に読み出したデータをLGN#155の論理グループが属する論理ブロックのデータとしてフラッシュメモリ2内の物理ブロックに書き込む。より具体的には、マイクロプロセッサ6は、まずデータのLGNの下位2ビットを除いた上位のビットから当該LGN#155の論理グループが属する論理ブロックのLBNを判別する(図5)。次に、求めたLBNの論理ブロックに対応する物理ブロックがフラッシュメモリ2内に存在するか否かを判断する。当該LBNの論理ブロックに対応する物理ブロックが存在し、その物理ブロックに1グループのデータ(1個の論理グループに対応する32kBのデータ)を書き込む空き領域があれば、空き領域にデータを書き込む。空き領域が無い場合や、上記LBNの論理ブロックに対応する物理ブロックが存在しない場合には、空きブロックを検索し、空きブロックにデータを書き込む。なお、ECCブロック11は、書き込まれるデータに対するエラーコレクションコードを生成する。生成されたエラーコレクションコードは冗長領域22に書き込まれる。又、物理ブロックと論理ブロックの対応関係を示す論理アドレス情報と、各物理ブロック内の物理グループと論理グループの対応関係を示す情報も冗長領域22に書き込まれる。   Therefore, first, the data of area number # 9 (data corresponding to the logical group of LGN # 155) which is the lowest priority area in FIG. 7 is transferred to the physical block in the flash memory 2 via the buffer 9. (S30, data transfer means). That is, the data stored in the area of area number # 9 is read to the buffer 9, and the data read to the buffer 9 is written to the physical block in the flash memory 2 as the data of the logical block to which the logical group of LGN # 155 belongs. More specifically, the microprocessor 6 first determines the LBN of the logical block to which the logical group of the LGN # 155 belongs from the upper bits excluding the lower 2 bits of the LGN of the data (FIG. 5). Next, it is determined whether or not a physical block corresponding to the obtained logical block of LBN exists in the flash memory 2. If there is a physical block corresponding to the logical block of the LBN and there is a free area in which one group of data (32 kB data corresponding to one logical group) is written in the physical block, the data is written in the free area. When there is no empty area or when there is no physical block corresponding to the logical block of the LBN, the empty block is searched and data is written into the empty block. The ECC block 11 generates an error correction code for the data to be written. The generated error collection code is written in the redundant area 22. Also, logical address information indicating the correspondence between physical blocks and logical blocks, and information indicating the correspondence between physical groups and logical groups in each physical block are also written in the redundant area 22.

次に、上述のようにデータがフラッシュメモリ2に転送された領域番号#9の領域にLGN#33の論理グループを新たに割り当てる(S40)。図8は、当該論理グループが新たに割り当てられた状態を示している。より具体的には、領域番号#9に対応するLGNの値として#33、優先リンクの値として#3を上書きする。この優先リンクの値#3は、最高位記憶領域31A(図7)に記憶されていた最高位の領域番号である。最高位記憶領域31Aには、LGN#33の論理グループが割り当てられた領域の領域番号#9が上書きされる。このとき、新たな論理グループLGN#33が割り当てられたことに伴う優先リンクの変更を行う。図7では、優先順位が最下位より一つ上の領域は、優先リンクが最下位領域番号#9を示している領域、すなわち領域番号#12の領域である。図7における最下位の領域番号#9の領域に新たな論理グループLGN#33が割り当てられたため、図8に示されるように領域番号#12の領域が優先順位最下位の領域となる。従って、領域番号#12に対応する優先リンクをNULLとする。   Next, a logical group of LGN # 33 is newly allocated to the area of area number # 9 where the data has been transferred to the flash memory 2 as described above (S40). FIG. 8 shows a state in which the logical group is newly assigned. More specifically, the LGN value corresponding to the area number # 9 is overwritten with # 33 and the priority link value is overwritten with # 3. This priority link value # 3 is the highest area number stored in the highest storage area 31A (FIG. 7). The highest storage area 31A is overwritten with the area number # 9 of the area to which the logical group of LGN # 33 is assigned. At this time, the priority link is changed when a new logical group LGN # 33 is assigned. In FIG. 7, the area whose priority is one level higher than the lowest is the area where the priority link indicates the lowest area number # 9, that is, the area of area number # 12. Since the new logical group LGN # 33 is assigned to the area of the lowest area number # 9 in FIG. 7, the area of the area number # 12 becomes the lowest priority area as shown in FIG. Therefore, the priority link corresponding to the area number # 12 is set to NULL.

次いで、LGN#33の論理グループに対応するデータがフラッシュメモリ2に記憶されているか否かを判断し、記憶されている場合は(S50:Yes)、フラッシュメモリ2に記憶されているLGN#33に対応するデータが、バッファ9を経由して、不揮発性RAM3(論理グループデータ記憶領域32)内の領域番号#9の領域に転送される(S60)。このとき、フラッシュメモリ2に記憶されているLGN#33に対応するデータの全部を不揮発性RAM3に転送してもよいし、書き換え対象でないデータのみを不揮発性RAM3に転送するようにしてもよい。書き換え対象であるデータは、ホストシステム4から与えられるからである。このように、新たに割り当てられた論理グループに対応するデータの全部又は一部をフラッシュメモリ2から不揮発性RAM3に転送するため、不揮発性RAM3の各領域には対応する論理グループに属するデータの全体が記憶されることになる。このため、ある論理グループの一部のみが更新され、残りの一部は更新されていないような状態における差分データ(更新済みデータ又は未更新データ)の管理をする必要が無く、データの取扱いを単純化できる。   Next, it is determined whether or not data corresponding to the logical group of LGN # 33 is stored in the flash memory 2, and if stored (S50: Yes), LGN # 33 stored in the flash memory 2 is stored. Is transferred to the area of area number # 9 in the nonvolatile RAM 3 (logical group data storage area 32) via the buffer 9 (S60). At this time, all of the data corresponding to LGN # 33 stored in the flash memory 2 may be transferred to the nonvolatile RAM 3, or only the data that is not to be rewritten may be transferred to the nonvolatile RAM 3. This is because the data to be rewritten is given from the host system 4. In this way, all or part of the data corresponding to the newly assigned logical group is transferred from the flash memory 2 to the nonvolatile RAM 3, so that the entire data belonging to the corresponding logical group is stored in each area of the nonvolatile RAM 3. Will be memorized. For this reason, it is not necessary to manage differential data (updated data or unupdated data) in a state where only a part of a certain logical group is updated and the remaining part is not updated. It can be simplified.

一方、LGN#33の論理グループに対応するデータがフラッシュメモリ2に記憶されていない場合は(S50:No)、S60の処理はスキップされる。この際、領域番号#9の領域内のホストシステム4から与えられるデータが書き込まれない領域には、フラッシュメモリの消去状態に対応するデータが書き込まれる。   On the other hand, when the data corresponding to the logical group of LGN # 33 is not stored in the flash memory 2 (S50: No), the process of S60 is skipped. At this time, data corresponding to the erased state of the flash memory is written in an area in which data given from the host system 4 in the area of area number # 9 is not written.

そして、不揮発性RAM3の領域番号#9の領域には、ホストシステム4から与えられるデータが書き込まれる。つまり、LGN#33の論理グループに含まれる領域に書き込むことを指示されたデータが論理グループデータ記憶領域32内の領域番号#9の領域に書き込まれる(S70、書き込み手段)。   Data given from the host system 4 is written in the area of area number # 9 of the nonvolatile RAM 3. That is, the data instructed to be written in the area included in the logical group of LGN # 33 is written in the area of area number # 9 in the logical group data storage area 32 (S70, writing means).

一方、ホストシステム4から書き込み先として指示された領域が含まれる論理グループが不揮発性RAM3(論理グループデータ記憶領域32)内何れかの領域に既に割り当てられている場合の処理は以下のようになる。図8〜10を参照しながら説明する。ここでは例として、図8の状態において領域番号#0の領域に割り当てられているLGN#0の論理グループのデータが更新される場合について説明する。   On the other hand, the processing when the logical group including the area designated as the write destination by the host system 4 has already been assigned to any area in the nonvolatile RAM 3 (logical group data storage area 32) is as follows. . This will be described with reference to FIGS. Here, as an example, a case will be described in which the data of the logical group of LGN # 0 assigned to the area of area number # 0 is updated in the state of FIG.

図8の状態において、ホストシステム4からLGN#0の論理グループに含まれる領域(当該論理グループの全領域又は一部の領域に相当する領域)をデータの書き込み先として指示したコマンドが与えられた場合、LGN#0の論理グループが領域番号#0の領域に割り当てられているため(S10:Yes)、ホストシステム4から与えられるデータは領域番号#0の領域に書き込まれ、この領域番号#0の領域へのデータの書き込みによって、領域番号#0の領域に記憶されているデータの優先順位が最高位になる。従って、管理テーブル50及び最高位記憶領域31Aに保持されている優先リンク関する情報が変更される。まず、図9に示されるように、最高位記憶領域31Aには、LGN#0の論理グループが割り当てられている領域の領域番号#0が書き込まれる。また、管理テーブル50については、領域番号#0に対応する優先リンクの値として、図8で最高位であった領域の領域番号#9が書き込まれる。図8の状態では、領域番号#12の領域の優先リンクがNULLであり、領域番号#0の領域の優先リンクが#12であり、領域番号#13の領域の優先リンクが#0である。よって、#13→#0→#12(領域番号)の順で優先順位が設定されていたと判断できる。しかし、図9では領域番号#0は優先順位最高位となるため、#13→#12(領域番号)の優先順位となる。この変更を反映させるため、領域番号#13の優先リンクを#12に書き換える(S80)。   In the state shown in FIG. 8, the host system 4 gives a command instructing an area included in the logical group of LGN # 0 (an area corresponding to all or part of the logical group) as a data write destination. In this case, since the logical group of LGN # 0 is assigned to the area of area number # 0 (S10: Yes), the data given from the host system 4 is written to the area of area number # 0, and this area number # 0 By writing data to the area, the priority of the data stored in the area of area number # 0 becomes the highest. Accordingly, the information regarding the priority link held in the management table 50 and the highest-level storage area 31A is changed. First, as shown in FIG. 9, the area number # 0 of the area to which the logical group of LGN # 0 is assigned is written in the highest-order storage area 31A. In the management table 50, the area number # 9 of the area that is the highest in FIG. 8 is written as the value of the priority link corresponding to the area number # 0. In the state of FIG. 8, the priority link of the area of area number # 12 is NULL, the priority link of the area of area number # 0 is # 12, and the priority link of the area of area number # 13 is # 0. Therefore, it can be determined that the priorities are set in the order of # 13 → # 0 → # 12 (area number). However, since region number # 0 is the highest priority in FIG. 9, the priority is # 13 → # 12 (region number). In order to reflect this change, the priority link of area number # 13 is rewritten to # 12 (S80).

その後、不揮発性RAM3(論理グループデータ記憶領域32)内の領域番号#0の領域に、ホストシステム4から与えられたデータ(LGN#0の論理グループに含まれる領域を書き込み先として指示されたデータ)が実際に書き込まれる(S90、書き込み手段)。この際、ホストシステム4から与えられたデータは、領域番号#0の領域に記憶されていたデータに対して上書きされる。   Thereafter, in the area of area number # 0 in the nonvolatile RAM 3 (logical group data storage area 32), the data given from the host system 4 (data instructed with the area included in the logical group of LGN # 0 as the write destination) ) Is actually written (S90, writing means). At this time, the data given from the host system 4 is overwritten on the data stored in the area of area number # 0.

一方、ホストシステム4からデータの書き込み先として指示された領域が含まれる論理グループが不揮発性RAM3(論理グループデータ記憶領域32)内の領域に割り当てられていない場合であって(S10:No)、不揮発性RAM3の論理グループデータ記憶領域32にいずれの論理グループにも対応していない(割り当てられていない)領域(空き領域)がある場合には(S20:Yes)、以下のような処理を行う。すなわち、ホストシステム4から書き込み先として指示された領域が含まれる論理グループに対して、上記空き領域を割り当て、この領域に記憶されるデータの優先順位が最高位になるように、管理テーブル50及び最高位記憶領域31Aに保持されている優先リンクに関する情報を変更する(S100)。優先リンクに関する情報を変更する処理は上記と同様である。そして、割り当てた領域にホストシステム4から与えられるデータを書き込む(S110)。   On the other hand, the logical group including the area instructed by the host system 4 as the data write destination is not assigned to an area in the nonvolatile RAM 3 (logical group data storage area 32) (S10: No). If the logical group data storage area 32 of the nonvolatile RAM 3 includes an area (empty area) that does not correspond to any logical group (not allocated) (S20: Yes), the following processing is performed. . That is, the free space is allocated to the logical group including the area designated as the write destination by the host system 4, and the management table 50 and the data stored in this area have the highest priority. The information on the priority link held in the highest level storage area 31A is changed (S100). The process for changing the information about the priority link is the same as described above. Then, data given from the host system 4 is written in the allocated area (S110).

以上説明した実施の形態によるメモリコントローラ、メモリシステム及びメモリ制御方法によれば、優先順位管理手段によって管理されている優先順位が最下位のデータをフラッシュメモリ内の物理ブロックに転送する。一方、頻繁に書き換えを行うデータの優先順位が最下位になる可能性は低いから、頻繁に書き換えを行うデータは不揮発性メモリ(不揮発性RAM)に記憶されている可能性が高い。したがって、頻繁に書き換えられるデータについては、不揮発性メモリ(不揮発性RAM)に記憶されている場合が多いため、不揮発性メモリ(不揮発性RAM)上でデータの書き換えが行われることが多くなる。従って、フラッシュメモリ内のデータを頻繁に書き換える必要が減少し、フラッシュメモリの寿命を向上させることができる。   According to the memory controller, the memory system, and the memory control method according to the above-described embodiments, the lowest priority data managed by the priority management means is transferred to the physical block in the flash memory. On the other hand, since the priority of data that is frequently rewritten is unlikely to be the lowest priority, the data that is frequently rewritten is highly likely to be stored in a nonvolatile memory (nonvolatile RAM). Therefore, data that is frequently rewritten is often stored in a non-volatile memory (non-volatile RAM), so that data is often rewritten on the non-volatile memory (non-volatile RAM). Therefore, the necessity for frequently rewriting data in the flash memory is reduced, and the life of the flash memory can be improved.

また、不揮発性メモリ(不揮発性RAM)では、データの上書きが可能なので、フラッシュメモリのようにデータの書き込みと消去を別々に行う必要が無く、効率的にデータの書き換えを行うことができる。   In addition, since data can be overwritten in a nonvolatile memory (nonvolatile RAM), it is not necessary to separately write and erase data as in a flash memory, and data can be rewritten efficiently.

本発明によるメモリコントローラ、メモリシステム及びメモリ制御方法は上述した実施の形態に限定されず、特許請求の範囲に記載した範囲で種々の変形や改良が可能である。例えば、上述した実施の形態では、論理(物理)グループ内の論理(物理)セクタ領域の個数は64個であったが、この個数に限られることはなく、例えば32個でもよい。   The memory controller, the memory system, and the memory control method according to the present invention are not limited to the above-described embodiments, and various modifications and improvements can be made within the scope described in the claims. For example, in the above-described embodiment, the number of logical (physical) sector areas in the logical (physical) group is 64, but the number is not limited to this number, and may be 32, for example.

また、上述した実施の形態では、メモリシステム100はフラッシュメモリを1個のみ備えていたが、フラッシュメモリを複数個備えたメモリシステムを用いてもよい。この例では、1個の論理ブロックに対して、複数個のフラッシュメモリの各々から物理ブロックが割り当てられる。つまり、1個の論理ブロックに対して、複数個の物理ブロックが割り当てられる。かかる構成において、不揮発性RAMからフラッシュメモリへデータを転送する際には、論理アドレスが連続するデータが前記複数個の物理ブロックに順次割り振られる。このようにすると、異なるフラッシュメモリに並行してアクセスすることができるので、アクセス速度を高速化できる。   In the above-described embodiment, the memory system 100 includes only one flash memory. However, a memory system including a plurality of flash memories may be used. In this example, a physical block is allocated from each of a plurality of flash memories to one logical block. That is, a plurality of physical blocks are assigned to one logical block. In such a configuration, when data is transferred from the nonvolatile RAM to the flash memory, data having consecutive logical addresses is sequentially allocated to the plurality of physical blocks. In this way, since different flash memories can be accessed in parallel, the access speed can be increased.

本発明の実施の形態によるメモリシステムを概略的に示すブロック図。1 is a block diagram schematically showing a memory system according to an embodiment of the present invention. 本実施の形態で用いられるフラッシュメモリの記憶領域を概念的に示す説明図。Explanatory drawing which shows notionally the storage area of the flash memory used by this Embodiment. 本実施の形態で用いられる不揮発性RAMの記憶領域を概念的に示す説明図。Explanatory drawing which shows notionally the memory area of the non-volatile RAM used by this Embodiment. 論理セクタ、論理グループ及び論理ブロックの関係を示す説明図。Explanatory drawing which shows the relationship between a logical sector, a logical group, and a logical block. ビット表示(2進数表示)されたLBA、論理グループ番号、論理ブロック番号等を示す説明図。Explanatory drawing which shows LBA, the logical group number, the logical block number, etc. which were bit-displayed (binary number display). 物理セクタ番号と論理セクタ番号とが論理グループ単位で入れ替わった状態で、データが物理ブロックに書き込まれる状況を示す説明図。Explanatory drawing which shows the condition where data are written in a physical block in the state in which the physical sector number and the logical sector number were switched in a logical group unit. 不揮発性RAM内の各領域と論理グループとの対応関係、及び各領域に記憶されているデータの優先順位を管理するためのテーブルを示す説明図。Explanatory drawing which shows the table for managing the correspondence of each area | region in a non-volatile RAM, and a logical group, and the priority of the data memorize | stored in each area | region. 図7のテーブルにおいて、優先順位が最下位のデータが記憶されている領域に新たな論理グループを割り当てた状態を示す説明図。FIG. 8 is an explanatory diagram illustrating a state in which a new logical group is assigned to an area in which data with the lowest priority is stored in the table of FIG. 7. 図8のテーブルにおいて、領域番号#0に割り当てられている論理グループ番号#0に対応するデータの書き替えを行った状態を示す説明図。FIG. 9 is an explanatory diagram showing a state in which data corresponding to a logical group number # 0 assigned to an area number # 0 is rewritten in the table of FIG. データの書き込み処理を示すフローチャート。10 is a flowchart showing data writing processing.

符号の説明Explanation of symbols

1・・・メモリコントローラ、 2・・・フラッシュメモリ、 3・・・不揮発性RAM、 4・・・ホストシステム、 6・・・マイクロプロセッサ、 7・・・ホストインタフェースブロック、 8・・・ワークエリア、 9・・・バッファ、 10・・・フラッシュメモリインタフェースブロック、 11・・・ECCブロック、 12・・・ROM、 13・・・外部バス、 14,15・・・内部バス、 16・・・RAMインタフェースブロック、 21・・・ユーザ領域、 22・・・冗長領域、 31・・・管理領域、 31A・・・最高位記憶領域、 31B・・・テーブル記憶領域、 32・・・論理グループデータ記憶領域、 41・・・LBA、 42・・・LGN、 43・・・LBN、 44・・・LSN、 45・・・LBIGN、 50・・・管理テーブル、 51・・・領域番号、 52・・・LGN、 53・・・優先リンク、 100・・・メモリシステム。   DESCRIPTION OF SYMBOLS 1 ... Memory controller, 2 ... Flash memory, 3 ... Nonvolatile RAM, 4 ... Host system, 6 ... Microprocessor, 7 ... Host interface block, 8 ... Work area 9 ... Buffer, 10 ... Flash memory interface block, 11 ... ECC block, 12 ... ROM, 13 ... External bus, 14, 15 ... Internal bus, 16 ... RAM Interface block 21 ... User area 22 ... Redundant area 31 ... Management area 31A ... Highest storage area 31B ... Table storage area 32 ... Logical group data storage area 41 ... LBA, 42 ... LGN, 43 ... LBN, 44 ·· LSN, 45 ··· LBIGN, 50 ··· management table, 51 ... region number, 52 ... LGN, 53 ... priority link, 100 ... memory system.

Claims (5)

ホストシステムから与えられるセクタ単位の論理アドレスに基づいて、物理ブロック単位で記憶データの消去が行われるフラッシュメモリとランダムアクセスが可能な不揮発性メモリとに対するアクセスを制御するメモリコントローラであって、
前記論理アドレスが連続する複数セクタの領域を含む論理グループを形成する論理グループ形成手段と、
前記不揮発性メモリに前記論理グループに対応するデータを格納するための論理グループデータ記憶領域を複数個確保し、前記論理グループと論理グループデータ記憶領域との対応関係を管理する第1の領域管理手段と、
1個又は複数個の論理グループを含む論理ブロックを形成する論理ブロック形成手段と、
前記論理ブロックと前記フラッシュメモリ内の物理ブロックとの対応関係を管理する第2の領域管理手段と、
前記各論理グループデータ記憶領域に格納されているデータの優先順位を管理する優先順位管理手段と、
前記ホストシステムから与えられたデータを、該データに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域に書き込む書き込み手段と、
前記論理グループデータ記憶領域に格納されているデータを、該データに対応する前記論理グループが属する前記論理ブロックと対応関係にある前記フラッシュメモリ内の物理ブロックに転送するデータ転送手段とを備え、
前記第1の領域管理手段は、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無いとき、前記ホストシステムから与えられたデータに対応する前記論理グループに対して、いずれの前記論理グループにも対応していない前記論理グループデータ記憶領域または前記データ転送手段によって格納されているデータが前記フラッシュメモリ内の物理ブロックに転送された前記論理グループデータ記憶領域を新たに割り当て、
前記データ転送手段は、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無く、かついずれの前記論理グループにも対応していない前記論理グループデータ記憶領域が無いときに、前記優先順位管理手段によって管理されている優先順位が最下位のデータを前記フラッシュメモリ内の物理ブロックに転送することを特徴とするメモリコントローラ。
A memory controller for controlling access to a flash memory in which stored data is erased in units of physical blocks and a non-volatile memory capable of random access based on a logical address in units of sectors given from a host system,
Logical group forming means for forming a logical group including areas of a plurality of sectors in which the logical addresses are continuous;
First area management means for securing a plurality of logical group data storage areas for storing data corresponding to the logical groups in the nonvolatile memory and managing the correspondence between the logical groups and the logical group data storage areas When,
Logical block forming means for forming a logical block including one or a plurality of logical groups;
Second area management means for managing the correspondence between the logical block and the physical block in the flash memory;
Priority management means for managing the priority of data stored in each logical group data storage area;
Writing means for writing data given from the host system to the logical group data storage area in a correspondence relationship with the logical group corresponding to the data;
Data transfer means for transferring data stored in the logical group data storage area to a physical block in the flash memory corresponding to the logical block to which the logical group corresponding to the data belongs;
When there is no logical group data storage area corresponding to the logical group corresponding to the data given from the host system, the first area management means corresponds to the data given from the host system. The logical group data in which data stored by the logical group data storage area or the data transfer means not corresponding to any logical group is transferred to a physical block in the flash memory with respect to a logical group Allocate new storage space,
The data transfer means does not have the logical group data storage area corresponding to the logical group corresponding to the data given from the host system, and does not correspond to any logical group. A memory controller for transferring data having the lowest priority managed by the priority management means to a physical block in the flash memory when there is no storage area.
前記論理ブロックに含まれる論理グループの個数が2個(nは1以上の整数)であることを特徴とする請求項1に記載のメモリコントローラ。 The memory controller according to claim 1, wherein the number of logical groups included in the logical block is 2 n (n is an integer of 1 or more). 請求項1又は2に記載されたメモリコントローラと、物理ブロック単位で記憶データの消去が行われるフラッシュメモリと、ランダムアクセスが可能な不揮発性メモリとを備えることを特徴とするメモリシステム。   A memory system comprising: the memory controller according to claim 1; a flash memory in which stored data is erased in units of physical blocks; and a non-volatile memory capable of random access. ホストシステムから与えられるセクタ単位の論理アドレスに基づいて、物理ブロック単位で記憶データの消去が行われるフラッシュメモリとランダムアクセスが可能な不揮発性メモリとに対するアクセスを制御するメモリ制御方法であって、
前記論理アドレスが連続する複数セクタの領域を含む論理グループを形成する論理グループ形成ステップと、
前記不揮発性メモリに前記論理グループに対応するデータを格納するための論理グループデータ記憶領域を複数個確保し、前記論理グループと論理グループデータ記憶領域との対応関係を管理する第1の領域管理ステップと、
1個又は複数個の論理グループを含む論理ブロックを形成する論理ブロック形成ステップと、
前記論理ブロックと前記フラッシュメモリ内の物理ブロックとの対応関係を管理する第2の領域管理ステップと、
前記各論理グループデータ記憶領域に格納されているデータの優先順位を管理する優先順位管理ステップと、
前記ホストシステムから与えられたデータを、該データに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域に書き込む書き込みステップと、
前記論理グループデータ記憶領域に格納されているデータを、該データに対応する前記論理グループが属する前記論理ブロックと対応関係にある前記フラッシュメモリ内の物理ブロックに転送するデータ転送ステップとを備え、
前記第1の領域管理ステップでは、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無いとき、前記ホストシステムから与えられたデータに対応する前記論理グループに対して、いずれの前記論理グループにも対応していない前記論理グループデータ記憶領域または前記データ転送ステップによって格納されているデータが前記フラッシュメモリ内の物理ブロックに転送された前記論理グループデータ記憶領域を新たに割り当て、
前記データ転送ステップでは、前記ホストシステムから与えられたデータに対応する前記論理グループと対応関係にある前記論理グループデータ記憶領域が無く、かついずれの前記論理グループにも対応していない前記論理グループデータ記憶領域が無いときに、前記優先順位管理ステップによって管理されている優先順位が最下位のデータを前記フラッシュメモリ内の物理ブロックに転送することを特徴とするメモリ制御方法。
A memory control method for controlling access to a flash memory in which stored data is erased in units of physical blocks and a non-volatile memory capable of random access, based on a logical address in units of sectors given from a host system,
A logical group forming step of forming a logical group including a plurality of sector areas in which the logical addresses are continuous;
A first area management step for securing a plurality of logical group data storage areas for storing data corresponding to the logical groups in the nonvolatile memory and managing a correspondence relationship between the logical groups and the logical group data storage areas When,
A logical block forming step of forming a logical block including one or a plurality of logical groups;
A second area management step for managing the correspondence between the logical block and the physical block in the flash memory;
A priority management step for managing the priority of data stored in each logical group data storage area;
A step of writing data given from the host system to the logical group data storage area corresponding to the logical group corresponding to the data;
A data transfer step of transferring data stored in the logical group data storage area to a physical block in the flash memory corresponding to the logical block to which the logical group corresponding to the data belongs;
In the first area management step, when there is no logical group data storage area corresponding to the logical group corresponding to the data given from the host system, the data corresponding to the data given from the host system is stored. The logical group data in which the logical group data storage area not corresponding to any logical group or the data stored by the data transfer step is transferred to a physical block in the flash memory with respect to the logical group Allocate new storage space,
In the data transfer step, there is no logical group data storage area corresponding to the logical group corresponding to the data given from the host system, and the logical group data does not correspond to any logical group A memory control method comprising: transferring data having the lowest priority managed by the priority management step to a physical block in the flash memory when there is no storage area.
1個の前記論理ブロックに複数個の前記フラッシュメモリ内の物理ブロックが割り当てられるときに、
前記データ転送ステップでは、論理アドレスが連続するデータが異なる前記フラッシュメモリ内の物理ブロックに割り振られるようにデータの転送が行われることを特徴とする請求項4に記載のメモリ制御方法。
When a plurality of physical blocks in the flash memory are allocated to one logical block,
5. The memory control method according to claim 4, wherein in the data transfer step, data transfer is performed such that data having consecutive logical addresses are allocated to physical blocks in the flash memory different from each other.
JP2007188457A 2007-07-19 2007-07-19 Memory controller, memory system, and memory control method Pending JP2009026062A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007188457A JP2009026062A (en) 2007-07-19 2007-07-19 Memory controller, memory system, and memory control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007188457A JP2009026062A (en) 2007-07-19 2007-07-19 Memory controller, memory system, and memory control method

Publications (1)

Publication Number Publication Date
JP2009026062A true JP2009026062A (en) 2009-02-05

Family

ID=40397818

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007188457A Pending JP2009026062A (en) 2007-07-19 2007-07-19 Memory controller, memory system, and memory control method

Country Status (1)

Country Link
JP (1) JP2009026062A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09185551A (en) * 1996-01-08 1997-07-15 Mitsubishi Electric Corp Semiconductor memory device
JP2001109658A (en) * 1999-10-13 2001-04-20 Sony Corp Device and method for storing data
JP2005301591A (en) * 2004-04-09 2005-10-27 Toshiba Corp Device with nonvolatile memory, and memory controller
JP2006236304A (en) * 2004-10-27 2006-09-07 Sony Corp Storage device and information processing system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09185551A (en) * 1996-01-08 1997-07-15 Mitsubishi Electric Corp Semiconductor memory device
JP2001109658A (en) * 1999-10-13 2001-04-20 Sony Corp Device and method for storing data
JP2005301591A (en) * 2004-04-09 2005-10-27 Toshiba Corp Device with nonvolatile memory, and memory controller
JP2006236304A (en) * 2004-10-27 2006-09-07 Sony Corp Storage device and information processing system

Similar Documents

Publication Publication Date Title
JP4844639B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP3906825B2 (en) Computer system, computer system activation method and program
US8037232B2 (en) Data protection method for power failure and controller using the same
US6865658B2 (en) Nonvolatile data management system using data segments and link information
US7877562B2 (en) Memory controller, flash memory system, and control method of flash memory
JP4828816B2 (en) Memory card, semiconductor device, and memory card control method
US8214579B2 (en) Memory controller, flash memory system with memory controller, and method of controlling flash memory
US20090100290A1 (en) Memory controller, nonvolatile memory device, nonvolatile memory system, and data writing method
US8219742B2 (en) Memory controller, flash memory system with memory controller, and method of controlling flash memory
US8200891B2 (en) Memory controller, memory system with memory controller, and method of controlling flash memory
WO2007000862A1 (en) Memory controller, nonvolatile storage device, nonvolatile storage system, and data writing method
US8200892B2 (en) Memory controller, memory system with memory controller, and method of controlling flash memory
JPWO2007105688A1 (en) MEMORY CONTROLLER, NONVOLATILE STORAGE DEVICE, AND NONVOLATILE STORAGE SYSTEM
JP2012058770A (en) Memory controller, flash memory system equipped with memory controller and control method of flash memory
JP4488048B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM HAVING MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP2012068765A (en) Memory controller, flash memory system with memory controller, and control method of flash memory
JP5066894B2 (en) Storage medium control device
US8200890B2 (en) Memory controller, flash memory system with memory controller, and method of controlling flash memory
JP4655034B2 (en) Memory controller, flash memory system, and flash memory control method
JP2004326523A (en) Storage device with rewritable nonvolatile memory, and control method of nonvolatile memory for storage device
JP2012068764A (en) Memory controller, nonvolatile memory system with memory controller, and control method of nonvolatile memory
JP4000124B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JP3670151B2 (en) Flash memory access method, system including driver for accessing flash memory, and flash memory
JP3934659B1 (en) Memory controller and flash memory system
JP2009026062A (en) Memory controller, memory system, and memory control method

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101221

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110120

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110318

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110726