JP2006018419A - Storage device - Google Patents
Storage device Download PDFInfo
- Publication number
- JP2006018419A JP2006018419A JP2004193680A JP2004193680A JP2006018419A JP 2006018419 A JP2006018419 A JP 2006018419A JP 2004193680 A JP2004193680 A JP 2004193680A JP 2004193680 A JP2004193680 A JP 2004193680A JP 2006018419 A JP2006018419 A JP 2006018419A
- Authority
- JP
- Japan
- Prior art keywords
- transfer
- data
- memory
- card
- sector
- 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
Links
Images
Abstract
Description
本発明は、メモリカード、ハードディスク等の記憶手段を複数使用した、ホスト機器に対しては単一のドライブとしてインターフェースする記憶装置に関する。 The present invention relates to a storage device that uses a plurality of storage means such as a memory card and a hard disk and interfaces with a host device as a single drive.
フラッシュメモリを用いたカード型の記録媒体であるメモリカードとしては、コンパクトフラッシュ(登録商標)、SDメモリーカード等が開発されている。メモリカードは、他の記録媒体と比較して小型、低消費電力、ランダムアクセス可能等の特長があり、このため、デジタルスチルカメラ、携帯電話等の携帯機器に広く利用されている。 As a memory card which is a card type recording medium using a flash memory, a compact flash (registered trademark), an SD memory card, and the like have been developed. The memory card has features such as small size, low power consumption, and random access as compared with other recording media, and is therefore widely used in portable devices such as digital still cameras and mobile phones.
しかしながら、例えばメモリカードに映像情報のような大容量のデータをリアルタイムに記録しようとした場合には、メモリカードで実現できるデータ転送レートと記憶容量によって、記録する画面の解像度、フレームレート、圧縮率、記録可能時間等が制限され、その応用範囲が限られる。例えば、メモリカードを記録媒体とするビデオカメラであれば、磁気テープを記録媒体とするVTRと同等の高画質、長時間記録を実現することは困難である。 However, when recording a large amount of data such as video information in a memory card in real time, for example, the resolution, frame rate, and compression rate of the screen to be recorded depends on the data transfer rate and storage capacity that can be realized by the memory card. The recordable time is limited, and its application range is limited. For example, in a video camera using a memory card as a recording medium, it is difficult to realize high image quality and long-time recording equivalent to a VTR using a magnetic tape as a recording medium.
このようなメモリカードの短所を補うため、装置内に複数のメモリカードを装着し、ストライピングによって大容量、高転送レートを持つ単一のディスク装置(RAID 0:Redundant Arrays of Inexpensive Disks 0)を実現する方式が、特許文献1に開示されている。
To compensate for the shortcomings of such memory cards, a single disk device (RAID 0: Redundant Arrays of Inexpensive Disks 0) with a large capacity and high transfer rate is realized by installing multiple memory cards in the device and striping. A method to do this is disclosed in
また特許文献2には、512バイトのブロック単位でアクセスできる複数の半導体メモリ装置をブロック単位でストライピングし、1Mバイトのデータ転送バッファと複数の半導体メモリ装置との間で並列にデータ転送を行うことによってデータ転送バッファ上でデータをまとめ、データ転送バッファとホスト機器との間で単一のSCSIインターフェースを介してデータ転送するような、記憶装置が開示されている。
In
ここで、現在コンピュータシステムやコンピュータを組み込んだシステムにおいて一般的に用いられているバス(ホストバス)について、PCIバスを例に挙げて説明する。PCIバスはクロック周波数33MHz、データ幅32ビットのバスであり、1クロックで4バイトのデータ転送を行うことができる。このとき、転送先のアドレスはデータと同じ32ビットのバスを時分割して示される。すなわち、PCIバスにおける1回の転送は、転送先のアドレスおよび転送コマンドを示すクロックサイクル(アドレスフェーズ)と、それに続く複数の転送データを示す複数のクロックサイクル(データフェーズ)から成り、アドレスフェーズで示されたアドレスを先頭アドレスとし、連続するデータ数をメモリサイズとするメモリ領域のデータを連続転送することができる。したがって、PCIバスの瞬間的な最大転送レートは132MB/sとなる。 Here, a bus (host bus) generally used in a computer system or a system incorporating a computer will be described by taking a PCI bus as an example. The PCI bus is a bus having a clock frequency of 33 MHz and a data width of 32 bits, and can transfer 4-byte data in one clock. At this time, the transfer destination address is shown by time-sharing a 32-bit bus that is the same as the data. That is, one transfer on the PCI bus consists of a clock cycle (address phase) indicating a transfer destination address and a transfer command, and a plurality of clock cycles (data phase) indicating a plurality of transfer data subsequent thereto. Data in the memory area having the indicated address as the head address and the number of continuous data as the memory size can be transferred continuously. Therefore, the instantaneous maximum transfer rate of the PCI bus is 132 MB / s.
一方、例えばSDメモリーカードでは、50MHzクロックで4ビット幅のバスによるデータ転送が規定されており、最大25MB/sのデータ転送が可能である。このように、SDメモリーカードの最大データ転送レートは、PCIバスの最大データ転送レートよりずっと小さいので、SDメモリーカードとシステムのメインメモリとの間でPCIバスを介してデータ転送を行う場合には、データ転送バッファメモリが必要になる。 On the other hand, for example, in an SD memory card, data transfer using a 4-bit bus with a 50 MHz clock is defined, and data transfer of a maximum of 25 MB / s is possible. Thus, since the maximum data transfer rate of the SD memory card is much smaller than the maximum data transfer rate of the PCI bus, when data is transferred between the SD memory card and the main memory of the system via the PCI bus. Data transfer buffer memory is required.
特に、複数のSDメモリーカードに対するデータ転送を、1つのPCIバス上で時分割で切り替えて行う場合、切り替えの方法によっては大きなデータ転送バッファメモリが必要になるので注意が必要である。 In particular, when data transfer to a plurality of SD memory cards is performed by switching in a time division manner on one PCI bus, it should be noted that a large data transfer buffer memory is required depending on the switching method.
例えば特許文献2のように、512バイトのブロック毎に、すなわちストライピング単位を512バイトとして8つのメモリカードにストライピングしている場合、各メモリカードにはメインメモリ上で連続したアドレスのデータが1ブロック(512バイト)単位で記録されることになる。そして各メモリカード〜データ転送バッファ間ではほぼ同時並列に低速でデータ転送を行う一方、ホストバスを介してデータ転送バッファ〜メインメモリ間ではアドレス順に高速転送する。1つのメモリカードのデータをホストバス上で転送している間、他のメモリカードは、データ転送バッファへのデータ転送を並行して行わなければ全体として高速なデータ転送が実現できないので、少なくとも512バイトのブロックサイズのメモリカード枚数分、すなわちここでは8倍のデータ転送バッファが必要になる。
For example, as in
ところで、各メモリカードのアクセス単位である512バイトのブロックサイズは、ソフトウエアから見たドライブの互換性を高めるために、従来のハードディスクにおけるアクセス単位(セクタ)と同じに設定されたものである。これに対して、メモリカードで使用されているフラッシュメモリの消去単位・書き込み単位は、内部メモリのセル構造に応じて最適に選ばれ、メモリ容量が大きくなるに従って512バイトよりも大きくなる傾向がある。そのような場合でも、ホスト機器のソフトウエア上の互換性を考慮して512バイト単位のアクセスを実現するためには、転送バッファを使っていわゆるリード・モデファイ・ライト処理を行うことが必要となる。例えば、フラッシュメモリの消去単位が2Kバイトであるときに512バイトのみの書き込みを行うと、メモリカード内部では書き替える512バイトを含む2Kバイトをいったん転送バッファへ読み出し、そのうちの512バイトを転送バッファ上で書き替え、書き替えられた転送バッファの内容2Kバイトをフラッシュメモリ上の消去済の消去単位ブロックへ書き込む処理を行う。 By the way, the 512-byte block size, which is the access unit of each memory card, is set to be the same as the access unit (sector) in the conventional hard disk in order to improve drive compatibility as viewed from the software. On the other hand, the erase unit / write unit of the flash memory used in the memory card is optimally selected according to the cell structure of the internal memory, and tends to become larger than 512 bytes as the memory capacity increases. . Even in such a case, it is necessary to perform a so-called read-modify-write process using a transfer buffer in order to realize 512-byte access in consideration of the software compatibility of the host device. . For example, when only 512 bytes are written when the erase unit of the flash memory is 2 Kbytes, 2 Kbytes including 512 bytes to be rewritten inside the memory card are once read to the transfer buffer, and 512 bytes of them are stored on the transfer buffer. The process of writing the 2K bytes of the rewritten transfer buffer contents into the erased erase unit block in the flash memory is performed.
このため、フラッシュメモリの消去単位より小さいブロックのみの書き込み性能は、そのフラッシュメモリの最大書き込み性能よりも低くなる。このとき、ストライピング単位が消去単位よりも小さいと、全てのメモリカードに対してリード・モデファイ・ライトが必要になるので、書き込みが遅いセクタ数の範囲が大きくなってしまう。したがって、より高い転送レートを実現するためには、ストライピング単位をフラッシュメモリの消去単位と同じか、その整数倍のサイズとすることが望ましい。
しかしながらこのような従来の記憶装置の場合、データ転送バッファに必要な容量は、ストライピング単位(フラッシュメモリの消去単位またはその整数倍)とメモリカード数の積になるので、さらに大きな容量のバッファが必要になるという問題点があった。 However, in the case of such a conventional storage device, the capacity required for the data transfer buffer is the product of the striping unit (flash memory erase unit or an integral multiple thereof) and the number of memory cards, so a buffer with a larger capacity is required. There was a problem of becoming.
またストライピングを行う場合には、データ転送開始時に最初にアクセスするデータブロックについて、メモリカードとデータ転送バッファとの間でデータ転送が完了するまでの待ち時間が生じる。そして、ストライピング単位が大きくなると上述のようにデータ転送バッファサイズが大きくなるためにこの時間が長くなることにつながる。その結果、一連のデータ転送の開始時におけるレイテンシが増加するという問題点があった。 In the case of performing striping, there is a waiting time until the data transfer is completed between the memory card and the data transfer buffer for the data block to be accessed first at the start of data transfer. When the striping unit is increased, the data transfer buffer size is increased as described above, and this time is increased. As a result, there is a problem that latency at the start of a series of data transfer increases.
本発明は上記の問題点に鑑み、複数メモリカードの並列動作によるストライピングを使用した高レートデータ転送を、小容量の転送バッファを用いて実現可能とする記憶装置を提供することを目的とする。 In view of the above problems, an object of the present invention is to provide a storage device that can realize high-rate data transfer using striping by parallel operation of a plurality of memory cards using a small-capacity transfer buffer.
本発明は上記の問題点を解決するために、
ホストインタフェースを介してホスト機器との間で入出力されるデータを所定のストライピング単位で複数の記憶媒体にストライピング記録および再生を行う記憶装置であって、前記複数の記憶媒体のそれぞれに対して入出力されるデータを一時的に記憶する複数の転送バッファメモリと、対応する前記複数の記憶媒体と前記複数の転送バッファメモリとの間のデータ転送を制御する複数の記憶媒体制御手段と、前記ホストインタフェースと前記複数の転送バッファメモリとの間のデータ転送経路を切り替える切替手段と、前記ストライピング単位よりも小さいブロック単位で前記複数の転送バッファメモリを切り替えながら転送データを前記ホストインタフェースと前記複数の転送バッファメモリとの間でデータ転送するとともに、ストライピング単位で連続して前記複数の転送バッファメモリと前記複数の記憶手段との間でデータ転送するように、前記切替手段と前記複数の記憶媒体制御手段とを制御する制御手段とを有する構成としたものである。
In order to solve the above problems, the present invention
A storage device that records and reproduces data input / output to / from a host device via a host interface in a plurality of storage media in a predetermined striping unit, and is input to each of the storage media. A plurality of transfer buffer memories for temporarily storing output data; a plurality of storage medium control means for controlling data transfer between the corresponding plurality of storage media and the plurality of transfer buffer memories; and the host Switching means for switching a data transfer path between the interface and the plurality of transfer buffer memories; and transferring data to the host interface and the plurality of transfers while switching the plurality of transfer buffer memories in units of blocks smaller than the striping unit. In addition to transferring data to and from the buffer memory, A control means for controlling the switching means and the plurality of storage medium control means so as to transfer data between the plurality of transfer buffer memories and the plurality of storage means continuously in a ping unit; It is a thing.
上記のように本発明によれば、記憶装置を構成する複数の低速な記憶媒体の特性によって決まるストライピング単位が比較的大きい場合でも、ストライピング単位とは無関係でより小さい所定のデータ数毎に、ホスト機器との間のデータ転送を切り替えることができるので、ホスト機器から見たデータアクセスの待ち時間を小さくできるという利点がある。また、データ転送の単位を小さくできるので、データFIFOの容量を小さくでき、装置規模の増加を抑制することができる。 As described above, according to the present invention, even when the striping unit determined by the characteristics of a plurality of low-speed storage media constituting the storage device is relatively large, the host is separated for each predetermined number of smaller data regardless of the striping unit. Since data transfer to and from the device can be switched, there is an advantage that the data access waiting time seen from the host device can be reduced. In addition, since the data transfer unit can be reduced, the capacity of the data FIFO can be reduced, and an increase in the device scale can be suppressed.
以下、図面を参照しながら本発明の実施形態について説明する。本発明の実施形態では、記憶媒体として4枚のSDメモリーカードを用いて、論理的に1つのRAIDドライブを構成した記憶装置について説明する。なお、記憶媒体としてはコンパクトフラッシュ(登録商標)等の他のメモリカードでもよいし、光ディスク、ハードディスク等でもよい。また、その数についても4つ以外に2つ、8つ等でも構わない。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the embodiment of the present invention, a storage device that logically configures one RAID drive using four SD memory cards as storage media will be described. The storage medium may be another memory card such as a compact flash (registered trademark), an optical disk, a hard disk, or the like. Also, the number may be two, eight, etc. in addition to four.
(実施の形態1)
まず、本発明の基本構成を実施の形態1として、説明を簡略化するために次のような仮定の下で説明する。すなわち、ホスト機器がメインメモリ上に転送用バッファとして確保するメモリ領域は、物理的または論理的に連続した一つの領域であるということである。しかしながら、実施の形態2で後述するように、メモリ領域が複数の領域に分かれた場合であっても基本的な構成は共通である。
(Embodiment 1)
First, the basic configuration of the present invention will be described as the first embodiment under the following assumptions in order to simplify the description. In other words, the memory area secured as a transfer buffer on the main memory by the host device is one area that is physically or logically continuous. However, as will be described later in
図1は、本実施形態における記憶装置とホスト機器の構成を示すブロック図である。
本発明のRAIDドライブ101は、ホストインタフェース133を介してホスト機器102との間で入出力されるデータを所定のストライピング単位で複数の記憶媒体にストライピング記録および再生を行う記憶装置である。RAIDドライブ101は、RAIDドライブ101にデータを読み書きするホスト機器102と、ホストインタフェース133を介して接続されている。ホスト機器102の例としては、ビデオカメラやビデオレコーダ等の映像機器のほかに、PC等が挙げられる。ホスト機器102とRAIDドライブ101とは、一体に構成されていてもよいし、ケーブル等で接続される構成でもよい。RAIDドライブ101は、複数の記憶媒体として4つのSDメモリーカード110、111、112、113を内蔵し、これらをホスト機器102に対して論理的に単一のディスクドライブとしてアクセスできるようにしている(RAID 0)。複数の転送バッファメモリとしての4つのデータFIFO117、118、119、120は、4つのSDメモリーカード110、111、112、113それぞれに対して入出力されるデータを一時的に記憶するバッファメモリである。複数の記憶媒体制御手段としての4つのメモリカード制御回路121、122、123、124は、それぞれSDメモリーカードとデータFIFOとの間でのデータ転送を制御する。制御手段134は、ホストインタフェース133経由でホスト機器102から入力されたコマンドと転送データのアドレスとに基づいて、切替回路125および複数のメモリカード制御回路を制御する。切替手段としての切替回路125は、制御手段134からの制御信号に基づいて4つのデータFIFO117、118、119、120とホストインタフェース133との間の転送経路を切り替える。
FIG. 1 is a block diagram illustrating a configuration of a storage device and a host device in the present embodiment.
The
本実施形態において、ホスト機器102からのデータアクセスの最小単位は1セクタ(512バイト)とする。一方、4つのデータFIFO117、118、119、120は、それぞれセクタサイズよりも小さい128バイトずつの容量を持ち、ホストインタフェース133と4つのデータFIFOとの間のデータ転送は、切替回路125にて128バイト単位で切り替えて行うものとする。
In this embodiment, the minimum unit of data access from the
上記のような構成のRAIDドライブ101において、ホスト機器102から見たRAIDドライブ内データの論理的なアドレスと、4つのSDメモリーカード110、111、112、113それぞれの、メモリカード制御回路121、122、123、124から見たカード内データのアドレスの関係を図2に示す。各SDメモリーカード110、111、112、113は、SDメモリーカード規格上の最小アクセス単位である512バイトのブロック単位でアクセスできる。このブロックをセクタと呼び、図2では小さい四角形で表している。図2で、4つの縦に並んだセクタ列が、それぞれ4つのSDメモリーカード110、111、112、113の記憶領域を表している。各セクタにはSDメモリーカード内での通し番号であるSDメモリーカード内セクタ番号が与えられている。この番号が各SDメモリーカード内でセクタを指定するアドレスになり、メモリカード制御回路121、122、123、124から見たカード内データのアドレスとなる。
In the
同様に、RAIDドライブ101内の全データを通して各セクタに通し番号であるRAIDドライブ内セクタ番号が与えられている。このRAIDドライブ内セクタ番号が、ホスト機器102から見た論理的アドレスとなる。図2で各セクタを表わす四角形内に、これら2種類のセクタ番号を16進数で表示している。左側の数字がRAIDドライブ内セクタ番号、右側の数字がSDメモリーカード内セクタ番号を表す。また各SDメモリーカード110、111、112、113には、それぞれメモリカード番号#0、#1、#2、#3を割り当てて区別することにする。
Similarly, a sector number in the RAID drive that is a serial number is given to each sector through all data in the
図2に示したように、本実施形態のRAIDドライブ101は、2Kバイト(=4セクタ)をストライピング単位としてストライピングを行うため、RAIDドライブ内セクタ番号は、順番に1つのSDメモリーカードの連続する4セクタに割り当てられ、その続きが次のSDメモリーカードの連続する4セクタに割り当てられるというように、4セクタ毎に4つのメモリカードを巡回するように割り当てられる。なお、SDメモリーカード110、111、112、113の消去単位もストライピング単位と同じ2Kバイトとする。すなわち、各SDメモリーカードへのデータ転送がストライピング単位である2Kバイトのブロック単位で行われる限り、リード・モデファイ・ライトは発生せず、これによる書き込み性能の低下はない。
As shown in FIG. 2, since the
一方、SDメモリーカード内セクタ番号は、図2に示したように、SDメモリーカード内の先頭セクタから縦に並んだセクタの順番に与えられる。 On the other hand, the sector numbers in the SD memory card are given in the order of the sectors arranged vertically from the head sector in the SD memory card, as shown in FIG.
上記構成のRAIDドライブ101の基本的な動作について、図3、図4を参照して説明する。ここでは、ホスト機器102からRAIDドライブ101へデータを転送する場合について説明するが、RAIDドライブ101からホスト機器102へのデータ転送の場合についても同様である。RAIDドライブ101へのデータ転送の場合、ホスト機器102は、まず転送するデータをメインメモリ108上に確保されるホスト側バッファに格納し、次にRAIDドライブ101に対してデータ転送のコマンドを送る。これに対してRAIDドライブ101はコマンド解釈を行い、ホスト側バッファからRAIDドライブ内のSDメモリーカード110、111、112、113へデータを転送する。
The basic operation of the
データ転送の概要は次の通りである。制御手段134が、2Kバイトのストライピング単位よりも小さいデータFIFOサイズである128バイトのブロック単位で、データFIFOを切り替えながら、ホストインタフェースとデータFIFOとの間でデータ転送するように、切替回路125を制御する。すなわち、転送データについて、4つのSDメモリーカードに対応する各ストライピング単位から順番に、1ブロックずつを選択して対応するデータFIFOに転送する。そして制御手段134はこれと並行して、メモリカード制御回路を制御することにより、各データFIFOに蓄積されるデータをSDメモリーカードに対して転送し、結果として、ストライピング単位で連続してSDメモリーカードに対してデータ転送を行う。
The outline of data transfer is as follows. The
図3は、ホスト機器102のホスト側バッファの概念図である。図中の数字(16進数)はバッファ中のブロック番号を示しており、データFIFOのサイズである128バイトのブロックごとにこの番号が割り当てられている。バッファ上には転送すべきデータがアドレス順に並んでいる。バッファ上のデータは2Kバイトのストライピング単位毎にストライピングされて各SDメモリーカードに転送される。すなわち、その転送先はストライピング単位0がSDメモリーカード#0、ストライピング単位1がSDメモリーカード#1となり、そしてストライピング単位4が再びSDメモリーカード#0と、巡回するように割り当てられる。しかしながら、このバッファ上のデータが直接転送されるデータFIFOのサイズはそれぞれ128バイトであるため、データFIFOへの転送は各ストライピング単位を巡回して先頭から1ブロック(128バイト)ずつ、対応するデータFIFO117、118、119、120に対して行われる。すなわち、ホスト側バッファからのデータ転送順をブロック番号で示すと、00、10、20、30、01、11、21、31、…、0F、1F、2F、3F、40、50、60、70、41、…というようになる。
FIG. 3 is a conceptual diagram of the host side buffer of the
図4は、ホスト機器102からRAIDドライブ101へのデータ転送をおこなったときのタイミング図である。図4において、横軸は経過時間を表している。説明の便宜上、図中には時刻として0から68までの時刻を付してある。また、図中に記載されている数字は図3で示したホスト側バッファのブロック番号であり、ホスト側バッファ上のどのデータを転送または蓄積しているかを示している。(a)および(f)〜(i)は、各メモリからの読み出しおよび書き込み動作を示し、(b)〜(e)は、データFIFOでのデータ蓄積状況を示し、縦軸がデータ蓄積量を表している。また、本実施形態では便宜上、ホスト側バッファとデータFIFOとの間の転送速度は、データFIFOとSDメモリーカードとの間の転送速度のちょうど4倍であるとする。
FIG. 4 is a timing chart when data transfer from the
以下、図4を用いてRAIDドライブ101のデータ転送について説明する。RAIDドライブ101がホスト機器102からデータ転送のコマンドを受け取り、実際にホスト機器102からのデータ転送が開始されると、まず時刻0においてホスト側バッファのブロック番号00から128バイトのデータがRAIDドライブ101に対して転送される。ブロック番号00は、SDメモリーカード#0に転送されるストライピング単位0の先頭ブロックである。制御手段134は、RAIDドライブ101に対して送られたデータ転送コマンドが示すRAIDドライブ内先頭セクタ番号にもとづいて、対応するメモリカード番号と先頭セクタのストライピング単位内でのオフセットを図2を参照して求め、この情報からブロック番号00のデータをデータFIFO117に転送すると決定し、切替回路125を制御する。これにより、ブロック番号00からのデータはデータFIFO117に転送され、蓄積される。転送は時刻1に完了し、(b)の時刻1で示されるようにデータFIFO117にはブロック番号00のデータ128バイト分が蓄積されている。
Hereinafter, data transfer of the
次に時刻1において、直前に転送したブロック番号00が属するストライピング単位0の次のストライピング単位1の先頭ブロックである、ブロック番号10のデータがRAIDドライブ101に対して転送される。制御手段134は、直前のブロック番号00の転送時に得たメモリカード番号と先頭セクタのストライピング単位内でのオフセットに基づいて、ブロック番号10がSDメモリーカード#1に転送される先頭ブロックであることを知ることができる。制御手段134はこれに基づきブロック番号10のデータをデータFIFO118に転送すると決定し、切替回路125を制御する。これにより、ブロック番号10のデータはデータFIFO118に転送され、蓄積される。転送は時刻2に完了し、(c)の時刻2で示されるようにデータFIFO118にはブロック番号10のデータ128バイト分が蓄積されている。
Next, at
同様に、ブロック番号20、ブロック番号30のデータがデータFIFO119、120にそれぞれ転送される((d)の時刻3、(e)の時刻4)。
Similarly, the data of the
一方、制御手段134は時刻1において、データFIFO117にデータが蓄積されたので、次にメモリカード制御回路121を制御してデータFIFO117のデータをSDメモリーカード110に転送する。データFIFOからSDメモリーカードへの転送はホスト機器からデータFIFOへの転送よりも時間を要する(本実施形態では便宜上4倍)ため、(f)のように時刻1で転送を開始すると、時刻5で転送を完了する。
On the other hand, since the data is stored in the
同様に、データFIFO118、119、120のデータはSDメモリーカード111、112、113に転送される。
Similarly, the data in the
次に、SDメモリーカード110への転送に注目して説明する。(b)の時刻4のように、ホスト側バッファのブロック番号01のデータがデータFIFO117に対して転送開始される。このとき、データFIFO117にはまだブロック番号00のデータが1/4残っているが、時刻5においてブロック番号00のデータはすべてSDメモリーカード110への転送を完了し、それと同時にブロック番号01のデータがデータFIFO117への蓄積を完了するため、バッファがオーバーフローすることはない。そして(f)の時刻5において、メモリカード制御回路121はブロック番号01のデータをSDメモリーカード110へ転送開始する。ブロック番号00とブロック番号01のデータは連続したデータなので、データFIFO117からSDメモリーカード110へのデータ転送はブロック番号00、01と連続して行われることになる。
Next, the transfer to the
同様に、時刻8においてブロック番号02のデータが、時刻12においてブロック番号03のデータがデータFIFO117に転送開始され、時刻9、時刻13においてこれらのデータがデータFIFO117からSDメモリーカード110へ転送開始される。これが繰り返され、最終的にはストライピング単位0の2Kバイト分のデータ、すなわちブロック番号00〜0Fのデータが時間的に連続してSDメモリーカード110に転送される。その結果、SDメモリーカード110には1消去単位分のデータが連続して記録されるので、リードモディファイライドは発生せず、書き込み性能の低下はおこらない。
Similarly, transfer of data of
他のSDメモリーカードについても同様の転送が行われるため、データFIFOの容量が消去単位やセクタサイズよりも小さいにもかかわらず、SDメモリーカードの書き込み性能を低下させることなくRAIDドライブ101へのデータ転送を実現することができる。なお、ストライピング単位4以降のデータについても引き続き連続して転送が行われ、ホスト機器102からのコマンドで要求された転送サイズのデータ転送を完了する。
Since the same transfer is performed for other SD memory cards, the data to the
(実施の形態2)
次に第2の実施の形態として、本発明における記憶装置のより一般化された状況での動作について詳細に説明する。
(Embodiment 2)
Next, as a second embodiment, the operation of the storage device according to the present invention in a more generalized situation will be described in detail.
図5は、本実施形態における記憶装置とホスト機器の構成を示すブロック図である。なお、実施の形態1と同様の構成要素については同じ番号を付し、説明を省略する。図5において、RAIDドライブ101はPCカード規格に従う形状を持ち、ホスト機器102との電気的インターフェースにPCカード規格で定められたカードバス103を用いている。このカードバス規格におけるデータ転送は前述のPCIバスと同じであり、カードバス103の信号は、PCIバスブリッジと同様に働くカードバスブリッジ104によって、ホスト機器102のPCIバス105に中継される。また、PCIバス105の信号は、ホストブリッジ106によってホストCPU107とメインメモリ108をつなぐメモリバス109に中継される。
FIG. 5 is a block diagram showing the configuration of the storage device and the host device in the present embodiment. In addition, the same number is attached | subjected about the component similar to
カードバス制御回路116は、カードバス規格の制御手順に従ってカードバス103と内部レジスタバス114および内部DMAバス115の間のデータ転送を行う。切替回路125は、転送制御回路128からの制御信号に基づいて4つのデータFIFO117、118、119、120および転送制御回路128とカードバス制御回路116の間のDMA転送信号を切り替える。コマンドレジスタ126は、カードバス103を通したホスト機器102からのデータ転送コマンドが書き込まれる。コマンド制御回路127は、コマンドレジスタ126に書き込まれたRAIDドライブ101に対するコマンドを解釈し、4つのSDメモリーカード110、111、112、113に対するコマンドを求め、4つのメモリカード制御回路121、122、123、124に対して、それぞれのコマンドを送出する。転送制御回路128は、コマンド制御回路127からのコマンドに基づいて、メインメモリ108上に確保されているホスト側バッファを、4つのSDメモリーカード110、111、112、113に対応する領域に分割し、切り替え回路125を制御して、4つのデータFIFO 117、118、119、120のデータを正しいメモリ領域に転送する。テーブルカウンタ129は、転送制御回路128の制御処理において、メモリ領域ディスクリプタテーブルの読み取りアドレスを保持する。メモリ領域ディスクリプタバッファ130は、4つのSDメモリーカード110、111、112、113に対応するメモリ領域のディスクリプタを保持する。転送カウンタ131は、4つのデータFIFO117、118、119、120の転送データ数などを保持する。
The card
この実施形態においても、ホスト機器からのデータアクセスの最小単位は1セクタ(512バイト)、4つのデータFIFO117、118、119、120のサイズは128バイト、ホストバスであるカードバス上では、128バイト単位で4つのカードのデータ転送を切り替えるものとする。
Also in this embodiment, the minimum unit of data access from the host device is 1 sector (512 bytes), the size of the four
なお、カードバス制御回路116およびコマンドレジスタ126がホストインタフェースに相当する。また、コマンド制御回路127、転送制御回路128、メモリ領域ディスクリプタバッファ130、テーブルカウンタ129および転送カウンタ131が制御手段に相当する。
The card
本実施形態においても、ホスト機器102から見たドライブ内データの論理的なアドレスと、4つのSDメモリーカード110、111、112、113それぞれの、メモリカード制御回路121、122、123、124から見たカード内データのアドレスの関係は図2の通りである。
Also in this embodiment, the logical address of the in-drive data viewed from the
以上で説明したようなアドレスマッピングを前提として、以下に本実施形態のRAIDドライブ101の動作を説明する。図6は、RAIDドライブ101とホスト機器102の間でのデータ転送コマンド処理の概略フローチャートである。同図において左側のフローチャートはホスト機器102の処理手順を、右側のフローチャートはRAIDドライブ101の処理手順を表している。
Based on the address mapping as described above, the operation of the
データ転送の開始にあたって、ホスト機器102は、まず前準備301を行う。前準備301では、メインメモリ108上にホスト側バッファを確保し、(このホスト側バッファを示す)後述のメモリ領域ディスクリプタテーブルと呼ばれる情報を、やはりメインメモリ108上に格納する。また、転送方向がRAIDドライブ101へのデータ書き込みの場合には、転送するデータを、確保したホスト側バッファに格納する。
At the start of data transfer, the
次に、ホスト機器102は、コマンド書き込み302において、カードバス103上のプロトコルに従って、コマンドレジスタ126へデータ転送コマンドを書き込み、RAIDドライブ101からのコマンド終了通知待ち状態303に入る。一方、カードバス103からのコマンドレジスタ126へのコマンド書き込みは、カードバス制御回路116によってカードバスプロトコルに従って処理され、得られたデータ転送コマンドはコマンドレジスタ126に格納される。コマンドレジスタ126からコマンドの書き込み通知を受けたコマンド制御回路127は、コマンド書き込み待ち状態305を抜けて、コマンド処理306に移る。
Next, the
コマンド処理306では、コマンドレジスタ126に格納されたデータ転送コマンドに対応して、4つのSDメモリーカード110、111、112、113とメインメモリ108上に確保されたホスト側バッファとの間で、カードバス103を通してデータ転送を行う。このコマンド処理の詳細については後述する。
In the
書き込まれたコマンドに対応する全てのデータ転送が終了したら、コマンド制御回路127はコマンド終了通知307に移り、割り込み信号線132によって、ホスト機器102にコマンド処理の終了を通知する。コマンド処理の終了通知を受けたホスト機器102は、必要であれば後処理304を行う。
When all data transfer corresponding to the written command is completed, the
以上のように、ホスト機器102からのコマンド書き込みをトリガとして、RAIDドライブ101とホスト機器102の間でコマンド単位のハンドシェイクが行われる。このとき、上記の前準備301で、ホスト機器102がメインメモリ108に確保するメモリ領域には、転送しようとするデータ数以上の領域を確保する必要があるが、メインメモリは通常ホスト機器上で実行している全ての処理(プログラム)で共有されているので、転送データ数以上の連続する領域が確保できない場合があり得る。そこで、転送データ数以上の連続メモリ領域が確保できない場合には、それ以下の領域を複数確保し、それら複数の領域のサイズの合計が転送データ数以上になるようになされる。
As described above, handshaking in units of commands is performed between the
一般に1つのメモリ領域は先頭アドレスとサイズによって特定できるので、先頭アドレスと領域サイズの値から成る、メモリ領域ディスクリプタと呼ばれるデータ構造を定義し、上記のように確保された複数のメモリ領域に対応する、複数のメモリ領域ディスクリプタの配列で、全体のバッファメモリ領域を特定する。この配列はメモリ領域ディスクリプタテーブルと呼ばれ、前述のようにメインメモリ108上に確保される。図7に、本発明の実施形態におけるメモリ領域ディスクリプタテーブルの例を示す。
In general, since one memory area can be specified by the start address and size, a data structure called a memory area descriptor consisting of the value of the start address and area size is defined, and it corresponds to a plurality of memory areas secured as described above. The entire buffer memory area is specified by an array of a plurality of memory area descriptors. This arrangement is called a memory area descriptor table and is secured on the
図7では、ホスト側バッファは、アドレス0から2000(16進数)バイト、アドレス4800(16進数)からA00(16進数)バイト、アドレス8000(16進数)から2000(16進数)バイトの3つのメモリ領域から構成される合計サイズ18944バイト(37セクタ)のメモリ領域であり、メモリ領域ディスクリプタテーブル401は、各区分領域をあらわす上記先頭アドレスとサイズの値が記憶された3つのメモリ領域ディスクリプタ401、403、404で構成されている。なお、図7でサイズの左側の0および1は、それぞれ次のディスクリプタが有ることと、無いことを示すEOTフラグである。3つめのディスクリプタ404にEOTフラグ1が立っていることは、ホスト側バッファが、3つめの領域で終了していることを表している。
In FIG. 7, the host-side buffer has three memories of
また、上記コマンド書き込み302において、ホスト機器102がコマンドレジスタ126に書き込むコマンドのデータ構造の例を図8に示す。同図に示したように、コマンドは、データの転送方向(書き込みまたは読み出し)を表すコマンドコード501、転送すべきデータのRAIDドライブ101内先頭セクタ番号502、転送すべきセクタ数503、およびメモリ領域ディスクリプタテーブル401のメインメモリ108における先頭アドレス504で構成される。
FIG. 8 shows an example of the data structure of a command that the
次に、コマンド処理306の詳細を説明する。コマンドの書き込みを検知したRAIDドライブ101では、コマンド処理306において、コマンド制御回路127が、コマンドレジスタ126の内容を図8に示したデータ構造に従って解釈し、メモリカード制御回路121、122、123、124と、転送制御回路128に必要な転送パラメータと転送開始トリガを送る。
Next, details of the
図9に、このときのコマンド制御回路127における上記コマンド処理306の詳細フローチャートを、転送制御回路128の制御フローチャートとともに示す。図9においてコマンド制御回路127は、まずパラメータ計算601で、メモリカード制御回路121、122、123、124と、転送制御回路128に送る転送パラメータを求める。
FIG. 9 shows a detailed flowchart of the
メモリカード制御回路121、122、123、124に送る転送パラメータは、4つのSDメモリーカード110、111、112、113それぞれにおいて転送すべきデータの、SDメモリーカード内先頭セクタ番号と転送セクタ数である。
The transfer parameters sent to the memory
これ等の転送パラメータの値を図10の例で説明する。図10は、先頭セクタ番号502の値が6で、転送セクタ数503の値が37(10進。以下特に明記なき場合は10進表記とする。)の場合の、RAIDドライブ101内のセクタ番号と、4つのSDメモリーカード内のセクタ番号の関係を示している。図2と同様に実線の四角形が転送対象のセクタを表し、その中に書いた16進数字の左側がRAIDドライブ101内のセクタ番号を、右側が各メモリカード内のセクタ番号を表している。
These transfer parameter values will be described with reference to the example of FIG. FIG. 10 shows the sector number in the
コマンドの先頭セクタ番号502の値は6、転送セクタ数の値は37であるから、RAIDドライブ内セクタ番号6の先頭セクタ702から、RAIDドライブ内セクタ番号42(16進数で2A)の末尾セクタ708までの37セクタが転送対象のセクタである。
Since the value of the
図に示したように、求める転送パラメータは、SDメモリーカード毎に、カード番号0に対しては先頭セクタ701のセクタ番号4と転送セクタ数8、カード番号1に対しては先頭セクタ702のセクタ番号2と転送セクタ数10、カード番号2に対しては先頭セクタ703のセクタ番号0と転送セクタ数11、カード番号3に対しては先頭セクタ704のセクタ番号0と転送セクタ数8となる。
As shown in the figure, for each SD memory card, the required transfer parameters are the
これらの転送パラメータを以下のようにして求める。コマンドの先頭セクタ702のセクタ番号、転送セクタ数をそれぞれ、
S=6、Z=37
とし、ストライピング単位セクタ数を
U=4
メモリカード数を
N=4
とする。余りを切り捨てる整数の除算を「/」、剰余演算を「%」で表すと、先頭セクタ702を含むメモリカード番号CSは、
CS=(S/U)%N
を計算することにより求められ、
CS=(6/4)%4=1
である。
These transfer parameters are obtained as follows. The sector number of the
S = 6, Z = 37
And the number of striping unit sectors is U = 4
The number of memory cards is N = 4
And When integer division for rounding off the remainder is represented by “/” and the remainder operation is represented by “%”, the memory card number CS including the
CS = (S / U)% N
Is calculated by calculating
CS = (6/4)% 4 = 1
It is.
一般に、各メモリカード内の先頭セクタのセクタ番号は、
先頭セクタを含むメモリカード番号CSより小さい番号のメモリカードについては
(S/(U×N)+1)×U
として、先頭セクタを含むメモリカードについては
(S/(U×N))×U+(S%U)
として、先頭セクタを含むメモリカード番号CSより大きい番号のメモリカードについては
(S/(U×N))×U
として求められる。
Generally, the sector number of the first sector in each memory card is
(S / (U × N) +1) × U for a memory card with a number smaller than the memory card number CS including the first sector
As for a memory card including the first sector, (S / (U × N)) × U + (S% U)
For a memory card with a number greater than the memory card number CS including the first sector, (S / (U × N)) × U
As required.
図10の例では、CS=1なので、メモリカード0の先頭セクタ701のメモリカード内セクタ番号は、
S0=(6/(4×4)+1)×4=4
メモリカード1の先頭セクタ702のメモリカード内セクタ番号は、
S1=(6/(4×4))×4+(6%4)=2
メモリカード2および3の先頭セクタ703、704のメモリカード内セクタ番号は、
S2=(6/(4×4))×4=0
S3=(6/(4×4))×4=0
と求められる。
In the example of FIG. 10, since CS = 1, the sector number in the memory card of the
S0 = (6 / (4 × 4) +1) × 4 = 4
The sector number in the memory card of the
S1 = (6 / (4 × 4)) × 4 + (6% 4) = 2
The sector numbers in the memory card of the
S2 = (6 / (4 × 4)) × 4 = 0
S3 = (6 / (4 × 4)) × 4 = 0
Is required.
次に、転送対象末尾セクタの直後のセクタのRAIDドライブ内セクタ番号は
E=S+Z
として求められ、上式と同様に、末尾直後セクタを含むメモリカード番号CEは、
CE=(E/U)%N
各メモリカード内の末尾直後セクタのメモリカード内セクタ番号は、メモリカード番号CEより小さい番号のメモリカードについては
(E/(U×N)+1)×U
として、メモリカード番号CEのメモリカードについては
(E/(U×N))×U+(E%U)
として、メモリカード番号CEより大きい番号のメモリカードについては
(E/(U×N))×U
として求められる。
Next, the sector number in the RAID drive of the sector immediately after the last sector to be transferred is E = S + Z
As in the above equation, the memory card number CE including the sector immediately after the end is
CE = (E / U)% N
The sector number in the memory card of the sector immediately after the end in each memory card is smaller than the memory card number CE.
(E / (U × N) +1) × U
As for the memory card with the memory card number CE, (E / (U × N)) × U + (E% U)
For a memory card with a number greater than the memory card number CE, (E / (U × N)) × U
As required.
図10の例では、転送対象末尾セクタ708の直後のセクタ707のRAIDドライブ内セクタ番号は
E=S+Z=43
末尾直後セクタ707を含むメモリカード番号CEは、
CE=(E/U)%N=(43/4)%4=2
となるので、メモリカード0および1の末尾直後セクタ705、706のメモリカード内セクタ番号は
E0=(43/(4×4)+1)×4=12
E1=(43/(4×4)+1)×4=12
メモリカード2の末尾直後セクタ707のメモリカード内セクタ番号は
E2=(43/(4×4))×4+(43%4)=11
メモリカード3の末尾直後セクタ709のメモリカード内セクタ番号は
E3=(43/(4×4))×4=8
と求められる。
In the example of FIG. 10, the sector number in the RAID drive of the
The memory card number CE including the
CE = (E / U)% N = (43/4)% 4 = 2
Therefore, the sector numbers in the memory card of the
E1 = (43 / (4 × 4) +1) × 4 = 12
The sector number in the memory card of the
The sector number in the memory card of the
Is required.
したがって、各メモリカード毎の転送セクタ数Z0、Z1、Z2、Z3は、
Z0=E0−S0=12−4=8
Z1=E1−S1=12−2=10
Z2=E2−S2=11−0=11
Z3=E3−S3=8−0=8
と求められる。
Therefore, the number of transfer sectors Z0, Z1, Z2, and Z3 for each memory card is
Z0 = E0-S0 = 12-4 = 8
Z1 = E1-S1 = 12-2 = 10
Z2 = E2-S2 = 11-0 = 11
Z3 = E3-S3 = 8-0 = 8
Is required.
このようにして、各SDメモリーカードの転送パラメータであるSDメモリーカードの転送対象セクタの先頭アドレスS0、S1、S2、S3と転送セクタ数Z0、Z1、Z2、Z3が求められる。上記の計算は、U、Nが2の巾乗の場合には、大部分ビットの組み換えで実現できる。 In this way, the leading addresses S0, S1, S2, S3 of the transfer target sector of the SD memory card and the transfer sector numbers Z0, Z1, Z2, Z3, which are transfer parameters of each SD memory card, are obtained. The above calculation can be realized by recombination of most bits when U and N are powers of 2.
次に図9に戻り、上記のように転送パラメータを求めたコマンド制御回路127は、データ転送起動処理602において、4つのSDメモリーカードに対する転送パラメータを、それぞれメモリカード制御回路121、122、123、124に送るともに、転送開始のトリガ信号をメモリカード制御回路121、122、123、124に送る。これにより、SDメモリーカード110、111、112、113とデータFIFO117、118、119、120の間で、4つの並列データ転送が開始される。
Next, returning to FIG. 9, the
また、コマンド制御回路127は、パラメータ計算601において、転送制御回路128への転送パラメータも同時に求める。転送制御回路128への転送パラメータは、先頭セクタ702が含まれるSDメモリーカードのカード番号CS、先頭セクタ702のストライピング境界から数えたセクタ数(以下オフセット値と呼ぶ)OS、各SDメモリーカードの総転送セクタ数Z0、Z1、Z2、Z3、およびメモリ領域ディスクリプタテーブルの先頭アドレスDASである。
The
これらのうちCS、Z0、Z1、Z2、Z3は既に前述の式で求められている。また、メモリ領域ディスクリプタテーブルの先頭アドレスDASは、コマンドレジスタ126に書き込まれた先頭アドレスフィールド504の値である。
Among these, CS, Z0, Z1, Z2, and Z3 have already been obtained by the above-described equations. The start address DAS of the memory area descriptor table is the value of the
先頭セクタ702のストライピング境界からのオフセット値OSは、
OS = S % U
として求められ、図10の例では
OS = 6 % 4 = 2
である。
The offset value OS from the striping boundary of the
OS = S% U
In the example of FIG. 10, OS = 6% 4 = 2
It is.
パラメータ計算601においてこれ等の転送パラメータを求めたコマンド制御回路127は、データ転送起動602において転送パラメータとともに転送開始トリガを転送制御回路128に送る。これにより、メインメモリ108上のホスト側バッファと4つのデータFIFOとの間のDMA転送処理が開始される。
The
トリガ待ち状態607で待機していた転送制御回路128は、コマンド制御回路127からの上記転送開始とリガを受けて、巡回DMA転送処理605に入り、与えられたパラメータに基づくカードバス上のDMA転送を制御する。
The
この巡回DMA転送処理について説明するために、まず、バッファ用メモリ領域と4つのメモリカードのセクタとの対応関係を図11に示す。図11は、図10と同じ先頭セクタ番号S、転送セクタ数Zに対して、図7のディスクリプタテーブルで示されるバッファ用メモリ領域を当てはめた場合を表わしている。 In order to explain this cyclic DMA transfer process, first, the correspondence between the buffer memory area and the sectors of the four memory cards is shown in FIG. FIG. 11 shows a case where the buffer memory area shown in the descriptor table of FIG. 7 is applied to the same head sector number S and transfer sector number Z as in FIG.
図10と同じく実線の四角形が転送対象のセクタを表しており、その中に書かれた左側の数字は、図10と同じRAIDドライブ内セクタ番号を表す。一方、()内の16進数字は、そのセクタに対応するバッファ用メモリ領域のアドレス範囲を16進数で示している。 As in FIG. 10, the solid square represents the sector to be transferred, and the number on the left side written therein represents the same sector number in the RAID drive as in FIG. 10. On the other hand, the hexadecimal number in parentheses indicates the address range of the buffer memory area corresponding to the sector in hexadecimal.
図に示したように先頭セクタ702から順番に512バイトずつのメモリ領域を、RAIDドライブ内セクタ番号順に対応させる。したがって、セクタ702から801までで1つめのディスクリプタ402が示すバッファ用メモリ領域(0000から1FFFまで)が終了し、次のセクタ802からは2つめのディスクリプタ403が示すメモリ領域(4800から51FF)が図のように対応する。同様に、セクタ803から最後のセクタ708までは、3つめのディスクリプタ404が示すメモリ領域(8000から9FFF)が対応する。
As shown in the figure, the 512-byte memory areas in order from the
図12は、転送制御回路128における巡回DMA転送処理605のさらなる詳細フローチャートである。以下、このフローチャートを参照しながら、巡回DMA転送処理605の詳細を説明する。転送制御回路128は、巡回DMA転送処理605において、制御変数として、転送カウンタ131、テーブルカウンタ129、メモリ領域ディスクリプタバッファ130を使用する。
FIG. 12 is a further detailed flowchart of the cyclic
転送カウンタ131は、データ転送対象のカード番号カウンタTC、各SDメモリーカードに対応した総転送数カウンタTZ0、TZ1、TZ2、TZ3、転送先メモリアドレスカウンタTA0、TA1、TA2、TA3、1メモリ領域内の転送数カウンタTS0、TS1、TS2、TS3、ストライピング境界からのオフセットカウンタTO0、TO1、TO2、TO3によって構成される。また、テーブルカウンタ129は、メモリ領域ディスクリプタテーブルのアドレスカウンタDTA、メモリ領域ディスクリプタテーブル終了フラグレジスタEOT、メモリブロックの先頭バイトに対応するカード番号レジスタBCS、メモリブロックの先頭バイトのオフセットBOSによって、メモリ領域ディスクリプタバッファ130は、各SDメモリーカードに対応するメモリ領域の先頭アドレスレジスタBA0、BA1、BA2、BA3、転送サイズレジスタBS0、BS1、BS2、BS3によって構成されている。
The
まず、図12の初期化ステップ901において、各カウンタ、バッファを下記のように初期化する。
First, in the
TC=CS=先頭セクタのカード番号
TO(CS)=OS×512=先頭セクタのオフセット(バイト単位)
TO(CS以外)=0
TS0=TS1=TS2=TS3=0
TZ0=Z0×512=カード0の総転送バイト数
TZ1=Z1×512=カード1の総転送バイト数
TZ2=Z2×512=カード2の総転送バイト数
TZ3=Z3×512=カード3の総転送バイト数
DTA=メモリ領域ディスクリプタテーブルの先頭アドレス
EOT=0
BCS=CS=先頭セクタのカード番号
BOS=OS×512=先頭セクタのオフセット(バイト単位)
BS0=BS1=BS2=BS3=0
次に、転送開始判断902において、メモリ領域ディスクリプタの処理903を行うか否かを判定する。すなわち、レジスタEOTが0(未処理のメモリ領域ディスクリプタが残っていることを意味する)で、かつ、レジスタBS0、BS1、BS2、BS3が全て0(レジスタBS0、BS1、BS2、BS3が空きであることを意味する)であるとき、メモリ領域ディスクリプタの処理903に進む。そうでないとき、データ転送終了判定905へ進む。
TC = CS = first sector card number TO (CS) = OS × 512 = first sector offset (byte unit)
TO (except CS) = 0
TS0 = TS1 = TS2 = TS3 = 0
TZ0 = Z0 × 512 = total transfer byte number of
BCS = CS = first sector card number BOS = OS × 512 = first sector offset (in bytes)
BS0 = BS1 = BS2 = BS3 = 0
Next, in the
メモリ領域ディスクリプタ処理903では、切替回路125、カードバス制御回路116を制御して、メモリ領域ディスクリプタテーブルのアドレスカウンタDTAが指しているメインメモリ108上の領域から、1つのメモリ領域ディスクリプタを読み取る。読み取ったメモリ領域ディスクリプタの先頭アドレス値をBMA、領域サイズ値をBMSとし、テーブル終了フラグの値をEOTに記憶する。
In the memory
まず、BMA、BMSが示す1つのメモリ領域内で、各メモリカードの先頭のバイトに対応するメモリアドレスを、下記式のように求める。すなわち、メモリ領域内の先頭バイトを含むメモリカードの番号BCSよりも小さい番号Csmlのメモリカードについては、
BA(Csml)=U×(N+Csml−BCS)×512−BOS+BMA
先頭バイトを含むメモリカードについては、
BA(BCS)=BMA
先頭バイトを含むメモリカードの番号BCSよりも大きい番号Cbigのメモリカードについては
BA(Cbig)=U×(Cbig−BCS)×512−BOS+BMA
とする。
First, in one memory area indicated by BMA and BMS, a memory address corresponding to the first byte of each memory card is obtained as follows. That is, for a memory card with a number Csml smaller than the number BCS of the memory card including the first byte in the memory area,
BA (Csml) = U × (N + Csml−BCS) × 512−BOS + BMA
For memory cards that include the first byte,
BA (BCS) = BMA
For a memory card with a number Cbig greater than the number BCS of the memory card including the first byte, BA (Cbig) = U × (Cbig−BCS) × 512−BOS + BMA
And
例えば図11の例で、最初のメモリ領域ディスクリプタ402について数値を代入すると、下記のようになる。 For example, in the example of FIG. 11, when a numerical value is substituted for the first memory area descriptor 402, the result is as follows.
BA0=4×(4+0−1)×512−1024+0=5120
BA1=0
BA2=4×(2−1)×512−1024+0=1024
BA3=4×(3−1)×512−1024+0=3072
これらは、図11のセクタ701、702、703、704の先頭アドレス1400(16進)、0000、0400(16進)、0C00(16進)を表わしている。
BA0 = 4 × (4 + 0-1) × 512-1024 + 0 = 5120
BA1 = 0
BA2 = 4 × (2-1) × 512-1024 + 0 = 1024
BA3 = 4 × (3-1) × 512-1024 + 0 = 3072
These represent the top addresses 1400 (hexadecimal), 0000, 0400 (hexadecimal), and 0C00 (hexadecimal) of the
次に、カード番号0のSDメモリのストライピング境界(図11の例の1つめのメモリ領域ではセクタ804の先頭に相当)から、メモリ領域内の最後バイトに対応するバイトまでのサイズαを次式のように求める。
Next, the size α from the striping boundary of the SD memory with the card number 0 (corresponding to the top of the
α=U×BCS×512+BOS+BMS
すると、メモリ領域内の最終バイトの次のバイトが含まれるSDメモリーカード番号BCEと、そのバイトのオフセットBOEが次の式で求められる。
α = U × BCS × 512 + BOS + BMS
Then, the SD memory card number BCE including the byte next to the last byte in the memory area and the offset BOE of the byte are obtained by the following formula.
BCE=(α/(U×512))%N
BOE = α % (U × 512)
各メモリカードのメモリ領域内のバイト数は、
β=(α/(U×N×512))×(U×512)
に対して、
CSより小さい番号のメモリカードについてはU×512を引き、
CSと等しい番号のメモリカードについてはBOSを引き、
かつ、
BCEよりも小さい番号のメモリカードについてはU×512を加え、
BCEと等しい番号のメモリカードについてはBOEを加える
ことにより求められる。
BCE = (α / (U × 512))% N
BOE = α% (U × 512)
The number of bytes in the memory area of each memory card is
β = (α / (U × N × 512)) × (U × 512)
Against
For memory cards with numbers less than CS, subtract Ux512,
Subtract BOS for memory cards with the same number as CS,
And,
For memory cards with numbers smaller than BCE, add Ux512,
The memory card having the same number as the BCE is obtained by adding BOE.
図11の1つめのディスクリプタ402によって示されるメモリ領域の例では、
α=4×1×512+1024+8192=11264
BCE=(11264/(4×512))%4=1
BOE=11264%(4×512)=1024
β=(11264/(4×4×512))×(4×512)=2048
BS0=2048−4×512+4×512=2048
BS1=2048−1024+1024=2048
BS2=2048
BS3=2048
と求められる。
In the example of the memory area indicated by the first descriptor 402 in FIG.
α = 4 × 1 × 512 + 1024 + 8192 = 11264
BCE = (11264 / (4 × 512))% 4 = 1
BOE = 11264% (4 × 512) = 1024
β = (11264 / (4 × 4 × 512)) × (4 × 512) = 2048
BS0 = 2048-4 × 512 + 4 × 512 = 2048
BS1 = 2048−1024 + 1024 = 2048
BS2 = 2048
BS3 = 2048
Is required.
以上のように、1つのメモリ領域について、各カード毎の先頭メモリアドレスBA0、BA1、BA2、BA3と転送サイズBS0、BS1、BS2、BS3を求めたら、テーブルカウンタ更新904において下記のようにカウンタを更新し、転送開始判定902に戻る。
As described above, when the top memory addresses BA0, BA1, BA2, BA3 and transfer sizes BS0, BS1, BS2, BS3 for each card are obtained for one memory area, the counter is updated in the
DTA=次のディスクリプタのアドレス
BCS=BCE
BOS=BOE
上記のように転送開始判断902に戻って来ると、BS0、BS1、BS2、BS3が全て0ではないので、データ転送終了判定905へ進む。
DTA = address of next descriptor BCS = BCE
BOS = BOE
When returning to the
全データ転送終了判定905では、各カード毎の総データ転送数カウンタTZ0、TZ1、TZ2、TZ3が全て0の場合に、全てのデータ転送が終了したものと判断し、巡回DMA転送処理605を終了する。そうでない場合には、メモリ領域内転送終了判定906へ進む。当然、最初の処理では、総データ転送数カウンタが全て0ではないので、領域内転送終了判定906へ進む。
In the all data transfer
領域内転送終了判定906では、現在の転送対象カード番号TCのメモリ領域内の転送数カウンタTS(TC)が0である場合、そのメモリ領域内の転送は終了したものと判定して、次のディスクリプタ判定907に進む。そうでない場合、データ転送処理909に進む。最初の処理では、転送数カウンタTS(TC)は0に初期化されているので、次のディスクリプタ判定907に進む。
In the intra-area
次のディスクリプタ判定907では、現在の転送対象カード番号TCについて、次のディスクリプタが、メモリ領域ディスクリプタバッファ130に保存されているかどうかを判定する。すなわち、転送サイズカウンタBS(TC)が0の場合、次のディスクリプタは保存されていないものと判定し、転送カード番号更新910へ進む。そうでない場合は、ディスクリプタロード908へ進む。
In the next descriptor determination 907, it is determined whether or not the next descriptor is stored in the memory
ディスクリプタロード908では、メモリ領域ディスクリプタバッファ130から、現在の転送対象カード番号TCのディスクリプタBA(TC)、BS(TC)を読み取り、転送先アドレスカウンタTA(TC)、領域内転送数カウンタTS(TC)に下記のように設定する。
In the
TA(TC)=BA(TC)
TS(TC)=BS(TC)
さらに、BS(TC)を0に設定して、このレジスタ値を無効とし、データ転送処理909へ進む。
TA (TC) = BA (TC)
TS (TC) = BS (TC)
Further, BS (TC) is set to 0 to invalidate this register value, and the process proceeds to
データ転送処理909では、まず、1回のDMA転送における連続転送データ数TSbstを下記のように決める。
In the
TSbst=min(TZ(TC)、TS(TC)、(U×512−TO(TC))、128)
ここで、min()は最小値を表している。すなわち、TZ(TC)はカード番号TCの残りの全データ数、TS(TC)は同じバッファ用メモリ領域内のカード番号TCの残りデータ数、(U×512−TO(TC))は同じバッファ用メモリ領域内のアドレス不連続点までの残りデータ数、128は1つのSDメモリーカードの最大連続転送数を表しており、これらのうちの最小値を転送データ数とする。
TSbst = min (TZ (TC), TS (TC), (U × 512-TO (TC)), 128)
Here, min () represents the minimum value. That is, TZ (TC) is the total number of remaining data of the card number TC, TS (TC) is the number of remaining data of the card number TC in the same buffer memory area, and (U × 512-TO (TC)) is the same buffer. The number of remaining data up to the address discontinuity point in the memory area, 128 represents the maximum continuous transfer number of one SD memory card, and the minimum value of these is the transfer data number.
次に、転送制御回路128は、切り替え回路125を制御して、カード番号TCに対応するデータFIFOのデータをカードバス制御回路116に接続し、切り替え回路125を通して、カードバス制御回路116に、先頭アドレスがTA(TC)で、転送データ数がTSbstであるような、バスマスタDMA転送コマンドを発行する。 これを受けたカードバス制御回路116は、メインメモリ108のアドレスTA(TC)からTSbstバイトのデータを、切り替え制御回路125によって選択されたデータFIFOとの間で、カードバスプロトコルに従って転送する。
Next, the
上記のDMA転送が終了したら、転送制御回路128は、転送カウンタ更新910において、下記のようにDMA転送を制御するカウンタを更新する。
When the DMA transfer is completed, the
TZ(TC)=TZ(TC)−TSbst
TA(TC)=TA(TC)+TSbst
TS(TC)=TS(TC)−TSbst
さらに、
TO(TC)+TSbst≧U×512
のとき
TA(TC)=TA(TC)+(N−1)×U×512
TO(TC)=0
とし、
TO(TC)+TSbst<U×512
のとき
TO(TC)=TO(TC)+TSbst
とし、
TC=TC+1
として、転送開始判定902に戻る。
TZ (TC) = TZ (TC) -TSbst
TA (TC) = TA (TC) + TSbst
TS (TC) = TS (TC) -TSbst
further,
TO (TC) + TSbst ≧ U × 512
When TA (TC) = TA (TC) + (N−1) × U × 512
TO (TC) = 0
age,
TO (TC) + TSbst <U × 512
When TO (TC) = TO (TC) + TSbst
age,
TC = TC + 1
Then, the process returns to the
以上のように、巡回DMA転送処理605での全てのデータ転送が終了したら(全データ転送終了判定905でTZ0、TZ1、TZ2、TZ3が全て0と判定したら)、転送制御回路128はデータ転送終了通知606に進み、全てのデータ転送の終了をコマンド制御回路127に通知する。データ転送の終了通知を受けたコマンド制御回路127は、コマンド終了通知606に進み、割り込み信号132によってホスト機器102にコマンド処理の終了を通知する。
As described above, when all data transfer in the cyclic
以上説明した動作により、RAIDドライブ101における、RAIDドライブ101からホスト102へのデータ読み出し時のデータ転送順を図13に示す。図13に示したように、SDメモリーカード110、111、112、113においては、同時並列でデータ読み出しが行われ、一方カードバス103においては、4つのSDメモリーカードのデータを128バイトごとに巡回しながら転送される。
FIG. 13 shows the data transfer order in the
また、RAIDドライブ101における、ホスト102からRAIDドライブ101へのデータ書き込み時のデータ転送順を図14に示す。図14に示したように、カードバス103において4つのSDメモリーカードに対応するデータを128バイトごとに巡回しながら転送されたデータは、SDメモリーカード110、111、112、113においては、同時並列で書き込まれる。
FIG. 14 shows the data transfer order when writing data from the
以上のように4つのSDメモリーカードに対応するデータを128バイトごとに分割して連続転送するので、各カードに対応するFIFO117、118、119、120は128バイトあれば十分である。したがって、本発明によれば複数の低速メモリカードにおけるブロック単位の並列転送をブロックサイズよりも小さなバッファメモリを用いて実現することができる。
As described above, the data corresponding to the four SD memory cards is divided into 128 bytes and continuously transferred. Therefore, it is sufficient that the
上記のように構成された本発明の記憶装置は、ビデオカメラ等におけるリムーバブルメディアとしても、PCベースのノンリニア編集機におけるメディアとしても、多数のハードディスクを用いたPCI−RAIDボードとしても利用できる。 The storage device of the present invention configured as described above can be used as a removable medium in a video camera or the like, a medium in a PC-based nonlinear editing machine, or a PCI-RAID board using a large number of hard disks.
101 RAIDドライブ
102 ホスト機器
108 メインメモリ
110、111、112、113 SDメモリーカード
117、118、119、120 データFIFO
121、122、123、124 メモリカード制御回路
125 切替回路
128 転送制御回路
129 テーブルカウンタ
130 メモリ領域ディスクリプタバッファ
131 転送カウンタ
133 ホストインタフェース
134 制御手段
101
121, 122, 123, 124 Memory
Claims (2)
前記複数の記憶媒体のそれぞれに対して入出力されるデータを一時的に記憶する複数の転送バッファメモリと、
対応する前記複数の記憶媒体と前記複数の転送バッファメモリとの間のデータ転送を制御する複数の記憶媒体制御手段と、
前記ホストインタフェースと前記複数の転送バッファメモリとの間のデータ転送経路を切り替える切替手段と、
前記ストライピング単位よりも小さいブロック単位で前記複数の転送バッファメモリを切り替えながら前記ホストインタフェースと前記複数の転送バッファメモリとの間でデータ転送するとともに、ストライピング単位で連続して前記複数の転送バッファメモリと前記複数の記憶手段との間でデータ転送するように、前記切替手段と前記複数の記憶媒体制御手段とを制御する制御手段とを有する記憶装置。 A storage device that performs striping recording and reproduction of data input / output with a host device via a host interface in a plurality of storage media in a predetermined striping unit,
A plurality of transfer buffer memories for temporarily storing data input / output to / from each of the plurality of storage media;
A plurality of storage medium control means for controlling data transfer between the plurality of corresponding storage media and the plurality of transfer buffer memories;
Switching means for switching a data transfer path between the host interface and the plurality of transfer buffer memories;
Data is transferred between the host interface and the plurality of transfer buffer memories while switching the plurality of transfer buffer memories in units of blocks smaller than the striping unit, and the plurality of transfer buffer memories in succession in striping units A storage device comprising: a control unit that controls the switching unit and the plurality of storage medium control units so as to transfer data to and from the plurality of storage units.
前記制御手段は、前記記憶領域と前記転送バッファメモリとの間のデータ転送の切り替え時に更新する転送カウンタを有し、
前記転送カウンタの更新時に、前記記憶媒体に対応する前記記憶領域のストライピング単位の境界の有無を判定して前記記憶媒体に対応する次のストライピング単位の先頭アドレスまで前記転送カウンタを補正する請求項1記載の記録装置。 The host device stores a head address of an untransferred area corresponding to each of the plurality of storage media in a storage area of the host device;
The control means has a transfer counter that is updated when switching data transfer between the storage area and the transfer buffer memory,
2. When the transfer counter is updated, it is determined whether or not there is a boundary between striping units of the storage area corresponding to the storage medium, and the transfer counter is corrected to the start address of the next striping unit corresponding to the storage medium. The recording device described.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004193680A JP4311288B2 (en) | 2004-06-30 | 2004-06-30 | Storage device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004193680A JP4311288B2 (en) | 2004-06-30 | 2004-06-30 | Storage device |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008113557A Division JP4609522B2 (en) | 2008-04-24 | 2008-04-24 | Storage device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006018419A true JP2006018419A (en) | 2006-01-19 |
JP4311288B2 JP4311288B2 (en) | 2009-08-12 |
Family
ID=35792662
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004193680A Expired - Fee Related JP4311288B2 (en) | 2004-06-30 | 2004-06-30 | Storage device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4311288B2 (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007241588A (en) * | 2006-03-08 | 2007-09-20 | Kyocera Mita Corp | Data transfer device and image forming apparatus |
JP2007323224A (en) * | 2006-05-31 | 2007-12-13 | Hitachi Ltd | Flash memory storage system |
JP2008009635A (en) * | 2006-06-28 | 2008-01-17 | Hitachi Ltd | Storage system and its data protection method |
JP2010009548A (en) * | 2008-06-30 | 2010-01-14 | Toshiba Corp | Storage device, control device, storage system, and storage method |
JP2010026592A (en) * | 2008-07-15 | 2010-02-04 | Panasonic Corp | Memory device and memory device control device |
JP2010044750A (en) * | 2008-07-15 | 2010-02-25 | Panasonic Corp | Memory device and memory device controlling apparatus |
JP2010531494A (en) * | 2007-06-28 | 2010-09-24 | メモライト メモリテック (シェンチェン) カンパニー リミテッド | Logic strip control method based on multi-channel non-volatile solid-state memory |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103729147A (en) * | 2013-12-30 | 2014-04-16 | 华澜微电子有限公司 | Redundant array of independent module |
-
2004
- 2004-06-30 JP JP2004193680A patent/JP4311288B2/en not_active Expired - Fee Related
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8924637B2 (en) | 2001-01-21 | 2014-12-30 | Hitachi, Ltd. | Flash memory storage system |
JP2007241588A (en) * | 2006-03-08 | 2007-09-20 | Kyocera Mita Corp | Data transfer device and image forming apparatus |
JP2007323224A (en) * | 2006-05-31 | 2007-12-13 | Hitachi Ltd | Flash memory storage system |
US8166235B2 (en) | 2006-05-31 | 2012-04-24 | Hitachi, Ltd. | Flash memory storage system |
US8359426B2 (en) | 2006-05-31 | 2013-01-22 | Hitachi, Ltd. | Flash memory storage system |
JP2008009635A (en) * | 2006-06-28 | 2008-01-17 | Hitachi Ltd | Storage system and its data protection method |
JP2010531494A (en) * | 2007-06-28 | 2010-09-24 | メモライト メモリテック (シェンチェン) カンパニー リミテッド | Logic strip control method based on multi-channel non-volatile solid-state memory |
TWI417718B (en) * | 2007-06-28 | 2013-12-01 | Memoright Memoritech Corp | Control Method of Logical Strip Based on Multi - channel Flash Memory Device |
JP2010009548A (en) * | 2008-06-30 | 2010-01-14 | Toshiba Corp | Storage device, control device, storage system, and storage method |
JP2010026592A (en) * | 2008-07-15 | 2010-02-04 | Panasonic Corp | Memory device and memory device control device |
JP2010044750A (en) * | 2008-07-15 | 2010-02-25 | Panasonic Corp | Memory device and memory device controlling apparatus |
US10565137B2 (en) | 2008-07-15 | 2020-02-18 | Panasonic Intellectual Property Management Co., Ltd. | Non-volatile memory device and controlling apparatus, having extension activating and control parts, where memory device can be operated in an optimum operation mode |
Also Published As
Publication number | Publication date |
---|---|
JP4311288B2 (en) | 2009-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3825465B2 (en) | Memory card and memory card system | |
US9043541B2 (en) | Storage control device, storage device, and control method for controlling storage control device | |
CN100524273C (en) | Memory card controller, memory card drive device, and computer program | |
JPH0877066A (en) | Flash memory controller | |
US20070168605A1 (en) | Information storage device and its control method | |
US6684026B2 (en) | Information recording method and apparatus and information recording medium | |
JP4311288B2 (en) | Storage device | |
JP4609522B2 (en) | Storage device | |
JPH11242563A (en) | Disk medium access interface device and its access method and disk drive device | |
KR20060017816A (en) | Method and device for transferring data between a main memory and a storage device | |
EP2183663B1 (en) | Mass storage system with improved usage of buffer capacity | |
KR100659915B1 (en) | Method and apparatus for transferring data | |
US8769167B2 (en) | Channel device, information processing system and data transfer method | |
CN111045961B (en) | Data processing method and memory controller using the same | |
US6496311B1 (en) | Data recording/reproducing unit, data recording method, data reproducing method, data recording/reproducing method, hard disk controller, and AV-data recording/reproducing method | |
JP4323476B2 (en) | Memory card controller, memory card drive device, and program | |
JP2852935B2 (en) | Information playback device | |
JPH0143332B2 (en) | ||
JPH02278417A (en) | Sector address converting circuit | |
JP2005057460A (en) | Video and audio signal recording device | |
JPH10340533A (en) | Data recording device and its method | |
JPH0541037A (en) | Digital data recording and reproducing device | |
JP2008262469A (en) | Storage device | |
JPS6135570B2 (en) | ||
JPH064221A (en) | Buffer control circuit and rotary storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20070927 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20071009 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071121 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20080226 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080424 |
|
A911 | Transfer of reconsideration by examiner before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20080502 |
|
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: 20090421 |
|
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: 20090504 |
|
FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120522 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120522 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130522 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130522 Year of fee payment: 4 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |