JP2010287185A - Device and method for controlling dma transfer - Google Patents
Device and method for controlling dma transfer Download PDFInfo
- Publication number
- JP2010287185A JP2010287185A JP2009142665A JP2009142665A JP2010287185A JP 2010287185 A JP2010287185 A JP 2010287185A JP 2009142665 A JP2009142665 A JP 2009142665A JP 2009142665 A JP2009142665 A JP 2009142665A JP 2010287185 A JP2010287185 A JP 2010287185A
- Authority
- JP
- Japan
- Prior art keywords
- transfer
- data
- dma
- ram
- dma transfer
- 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
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Bus Control (AREA)
- Information Transfer Systems (AREA)
Abstract
Description
本発明は、デバイス間でデータを転送するDMA転送制御装置およびDMA転送制御方法に関する。 The present invention relates to a DMA transfer control device and a DMA transfer control method for transferring data between devices.
DMA(Direct Memory Access)転送は、CPUを経由せずデバイス間でデータを転送する技術であり、メモリ、周辺機器などのデバイス間で直接データを転送する場合に広く使用されている。 DMA (Direct Memory Access) transfer is a technique for transferring data between devices without going through a CPU, and is widely used when transferring data directly between devices such as memory and peripheral devices.
一般的なDMA転送では、転送元および転送先のアドレスや転送データサイズなどデータ転送に必要な情報をDMA転送制御装置のレジスタなどに設定し、その後CPUなどが転送開始を制御することにより転送が開始される。 In general DMA transfer, information necessary for data transfer such as transfer source and transfer destination addresses and transfer data size is set in a register of the DMA transfer control device, and then the transfer is performed by the CPU or the like controlling transfer start. Be started.
DMA転送中には、CPUによる転送制御を必要としないため、CPUを経由する場合に比べて高速に転送を行うことが可能であり、CPUの負担を低減できる。 Since transfer control by the CPU is not required during DMA transfer, it is possible to perform transfer at a higher speed than when passing through the CPU, and the burden on the CPU can be reduced.
DMA転送によるデータの転送は、指定されたサイズ単位で行われる。上記のように、DMA転送制御装置は、CPUによる制御に応じてDMA転送を開始し、指定されたサイズのDMA転送終了後、レジスタなどに設定された設定によりDMA転送終了割り込みをアサートする。 Data transfer by DMA transfer is performed in a specified size unit. As described above, the DMA transfer control device starts DMA transfer according to the control by the CPU, and asserts a DMA transfer end interrupt according to the setting set in the register or the like after completion of the DMA transfer of the designated size.
CPUは、DMA転送終了割り込みを検出すると、DMA転送制御装置のレジスタの値(ポインタ)を読み込んで、DMA転送の結果やステータス情報を得る。そして、CPUは、これらの情報に基づいて、引き続きDMA処理を行う、DMA処理の終了などの次の処理に移行する。 When detecting the DMA transfer end interrupt, the CPU reads the value (pointer) of the register of the DMA transfer control device to obtain the DMA transfer result and status information. Then, based on these pieces of information, the CPU proceeds to the next processing such as the end of the DMA processing that continues the DMA processing.
図1の(A)は、DMA転送制御装置を含む一般的なコンピュータシステムの構成例を示す図であり、図1の(B)はDMA転送制御装置によるDMA転送を説明する図である。 FIG. 1A is a diagram illustrating a configuration example of a general computer system including a DMA transfer control device, and FIG. 1B is a diagram illustrating DMA transfer by the DMA transfer control device.
図1の(A)に示すように、図示のコンピュータシステムでは、CPU1、デバイス2A、デバイス2B、…、デバイス2N、DMA転送制御装置3が、システムバス5を介して接続され、CPU1と通信することが可能である。また、デバイス2A、デバイス2B、…、デバイス2N、DMA転送制御装置3は、DMAバス6を介して相互に接続されており、デバイス2A、デバイス2B、…、デバイス2Nは、DMA転送制御装置3を介してデバイス間でDMA転送を行うことが可能である。DMA転送制御装置3にはRAM4が接続されている。RAM4は、一般的にはSRAMなどが使用され、DMA転送制御装置3内に設けることもあるが、ここではDMA転送制御装置3に外付けで接続される例を示している。
As shown in FIG. 1A, in the illustrated computer system, a
図1の(B)に示すように、DMAバス6は、2系統のDMAバス6AおよびDMAバス6Bを備える。DMA転送制御装置3は、DMAバス6Aに接続される入力制御部11と、RAM情報管理部12と、DMAバス6Bに接続される出力制御部13と、を備える。入力制御部11、RAM情報管理部12および出力制御部13は、システムバス5を介してそれぞれCPUと通信可能である。
As shown in FIG. 1B, the
入力制御部11に入力された転送データは、RAM情報管理部12を介してRAM4に書き込まれ、一時的に保持される。RAM4から読み出された転送データは、RAM情報管理部12を介して出力制御部13に送られ、転送先のデバイスに出力される。RAM4は、データを書き込まれた順に出力するFIFO(First-In-First-Out)メモリとして動作する。FIFOメモリは、書き込んだデータの先頭位置(アドレス)を示す書込ポインタWPと、読み出したデータの後尾位置(アドレス)を示す読出ポインタRPと、を設け、書込動作および読出動作をWPとRPの示すアドレスで制御することにより、実現できる。書込ポインタWPおよび読出ポインタRPは、RAMの最大アドレスになると最小アドレスに戻る循環動作を繰り返す。RAM情報管理部12は、RAM4をFIFOメモリとして使用するため、書込ポインタWP14と、読出ポインタRP15と、を備える。
The transfer data input to the
したがって、転送元のデバイス2Pから転送先のデバイス2Qにデータを転送する場合の経路は、図1の(B)において破線で示す経路になる。すなわち、転送データは、転送元のデバイス2PからDMAバス6Aに出力され、入力制御部11に入力され、RAM情報管理部12を介してRAM4に書き込まれる。RAM4に書き込まれた転送データは、読み出されて、RAM情報管理部12を介して出力制御部13に送られ、出力制御部13からDMAバス6Bに出力され、転送先のデバイス2Qに入力されて、転送が完了する。
Therefore, the path for transferring data from the
上記のように、DMAバス6は、DMAバス6AおよびDMAバス6Bの2系統バスを備えており、RAM4へのデータ書込およびRAM4からのデータ読出は独立に行えるようになっている。これにより、転送元のデバイス2Pから出力された転送データのRAM4への書込と、RAM4からの転送データの読出は、独立に行える。RAM4への転送データの書込と読出が独立して行う時、RAM4が転送データで一杯になるオーバーフローと、RAM4に読み出す転送データが存在しないアンダーフローと、が発生する場合が生じる。オーバーフローまたはアンダーフローが発生すると、バスやデバイスが長時間待機状態になり効率が低下する。そこで、転送元のデバイスからRAM4にデータを転送する処理では、RAM4に転送するデータ量以上の空き領域があるかを確認した後転送を指示することにより、オーバーフローを防止する。また、RAM4から転送先のデバイスにデータを転送する処理では、RAM4に転送するデータ量以上のデータが蓄積されているかを確認した後転送を指示することにより、アンダーフローを防止する。
As described above, the
上記のように、RAM4へのデータ書込およびRAM4からのデータ読出は独立に行えるようになっており、オーバーフローおよびアンダーフローの防止も独立に制御される。以下の説明では、RAM4からのデータ読出処理を例として説明を行う。一般に、転送元のデバイスからDMA制御装置を経由して転送先のデバイスにデータを送る一連の動作を転送動作と称するが、ここでは、RAM4から読み出したデータを転送先のデバイスに出力する動作も、転送動作と称する。さらに、転送元のデバイスからのデータをRAM4に書き込む動作も転送動作と称する場合がある。
As described above, data writing to the
図2は、DMA転送処理を示すフローチャートであり、RAM4からのデータ転送処理に関係する。
FIG. 2 is a flowchart showing the DMA transfer process, which is related to the data transfer process from the
ステップ101では、CPU1が、転送先のアドレス、DMA転送のサイズなどのDMA転送に必要な情報を、RAM情報管理部12および出力制御部13内のレジスタに設定する。
In
上記のように、RAM4へのデータ転送(書込)は独立して行われており、書込ポインタWP14は順次増加する。しかし、RAM4からのデータ転送(読出)は行われていないので、読出ポインタRP15は変化しない。
As described above, data transfer (writing) to the
ステップ102では、RAM情報管理部12が、書込ポインタWP14と読出ポインタRP15の差が、指定サイズに到達したかを判定する。この差はRAM4に蓄積されている転送データ量を示しており、この差が指定サイズより少ない場合には、RAM4から転送する転送データが準備できていないことを意味する。そこで、この差が指定サイズに到達に到達していなければ待機し、到達していればCPU1に対して指定サイズ到達の割り込みを発生し、ステップ103に進む。
In
ステップ103では、CPU1が、RAM4から転送先のデバイス2Qへのデータ転送の開始を指示する。これに応じて、RAM4からデータを読み出し、出力制御部13を介して転送先のデバイス2Qにデータを転送する。したがって、読出ポインタRP15は順次増加する。
In
ステップ104では、RAM情報管理部12が、読出処理が完了したか、すなわちRAM4に書き込まれた指定されたサイズの転送データがすべて読み出されたかを判定し、完了していなければ待機し、完了していればCPU1に対して読出完了の割り込みを発生し、ステップ105に進む。
In
ステップ105では、CPU1が、次のDMA要求が残っているかを判定し、あればステップ102に戻り、なければDMA処理を終了する。例えば、16バイトのデータを4バイトずつ転送する場合には、以上の転送処理を4回繰り返すことになる。
In
図3は、上記のDMA転送処理を説明する図である。図において、WPが書込ポインタの示すアドレス位置を、RPが読出ポインタの示すアドレス位置を、Xが指定サイズを示す。図3において、(a)のように、CPUが前回のRAM4からの転送処理が終了しているかを確認する。そして、DMA情報管理部12は、WP−RP≧Xになって1番目のデータAがRAM4に蓄積されているかを確認する。そして、蓄積されていれば指定サイズ到達の割り込みをCPUに対して発生し、CPUの指示に応じてデータAのRAM4からの読出処理を開始する。これにより、(b)のように、RPが増加する。この読出処理の間もRAM4へのデータの書込は並行して独立に行われるので、WPも独立して増加する。ここで、(b)のようにWPの方がRPより速く増加する場合、(c)のように、2番目のデータBのRAM4への書込が終了しても、データAのRAM4からの読出は終了していないことになる。この場合、データAのRAM4からの読出が終了するまでデータBのRAM4からの読出は行わず待機する。
FIG. 3 is a diagram for explaining the DMA transfer process. In the figure, WP indicates the address position indicated by the write pointer, RP indicates the address position indicated by the read pointer, and X indicates the specified size. In FIG. 3, as shown in (a), the CPU confirms whether the previous transfer process from the
そして、(d)のように、CPUがデータAのRAM4からの読出が終了していることを確認する。そして、DMA情報管理部12は、WP−RP≧Xになって2番目のデータBがRAM4に蓄積されていることを確認すると、CPUに対して指定サイズ到達の割り込みを発生し、CPUの指示に応じてデータBのRAM4からの転送処理を開始する。この間、RAM4へのデータの書込は並行して独立に行われるので、WPは独立して増加している。
Then, as shown in (d), the CPU confirms that the reading of data A from the
以上説明したように、上記のDMA転送の例では、前回のRAM4からの転送処理が完了し且つ設定されたサイズ分の転送データがRAM4に書き込まれたことを確認した後、DMA転送のRAM4からの次の転送処理を開始していた。そのため、転送先のデバイスにアクセスする時のレイテンシーが大きい場合には、アクセスのための遅延が大きくなり、転送効率が向上しないという問題が生じていた。
As described above, in the above DMA transfer example, after confirming that the transfer processing from the
そこで、CPUが、転送元のアドレス、転送先のアドレス、DMA転送のサイズなどのDMA転送に必要な情報をDMA転送制御装置のレジスタに書き込むDMA転送指示を、先行して発行することが提案されている。この場合、DMA転送指示を先行して発行する時にも、アンダーフローおよびオーバーフローが発生しないようにする必要がある。そこで、先行して発行した転送指示によるデータ転送量を考慮してアンダーフローおよびオーバーフローが発生しないように制御することが提案されている。具体的には、RAM4に書き込まれているデータ量を示すカウンタと、先行して発行した転送指示により転送される予定のデータ量から既に転送完了したデータ量を減じた未転送データ量を示すカウンタを設ける。そして、2個のカウンタの差に基づいてアンダーフローが発生しないと判定した場合に、たとえ前回の転送処理が完了していなくても次の転送指示を発行する。また、転送元のデバイスからの転送データをRAM4に書き込む場合についても、先行して発行した転送(書込)指示によるデータ転送量を考慮してオーバーフローが発生しないように制御することが提案されている。この場合にも、カウンタを使用する。
Therefore, it is proposed that the CPU issues a DMA transfer instruction in advance to write information necessary for DMA transfer, such as a transfer source address, a transfer destination address, and a DMA transfer size, to a register of the DMA transfer control device. ing. In this case, it is necessary to prevent underflow and overflow even when the DMA transfer instruction is issued in advance. In view of this, it has been proposed to perform control so that underflow and overflow do not occur in consideration of the amount of data transferred by a transfer instruction issued in advance. Specifically, a counter indicating the amount of data written in the
上記のような複数のカウンタを設ける場合、回路規模が大きくなりコスト増加という問題を生じる。また、これらのカウンタは、RAM4でのデータの書込および読出が行われるたびに加算および減算が行われカウント値が変化する。そのため、カウンタの状態は頻繁に変化することになり、それに伴って消費電力が大きくなるという問題があった。
When a plurality of counters as described above are provided, the circuit scale becomes large, causing a problem of cost increase. These counters are added and subtracted each time data is written to and read from the
開示の実施形態では、DMA転送指示を先行して発行しても、アンダーフローおよびオーバーフローの発生を防止できるDMA転送制御装置および方法が、小さな回路規模で且つ低消費電力で実現される。 In the disclosed embodiment, a DMA transfer control apparatus and method that can prevent occurrence of underflow and overflow even if a DMA transfer instruction is issued in advance is realized with a small circuit scale and low power consumption.
実施形態の第1の態様は、転送元からの転送データを一時的にメモリに書き込み、メモリに書き込まれた転送データを、転送指示に応じて読み出して転送先に出力するDMA転送制御装置である。第1の態様のDMA転送制御装置は、書き込まれた転送データのメモリにおける先頭位置を示すライトポインタと、転送指示で指示済みの転送データのメモリにおける位置を示す指示済リードポインタと、を備え、ライトポインタと指示済リードポインタの差分と、転送サイズとを比較し、差分が転送サイズ以上の時に、読出指示を発行する。 A first aspect of the embodiment is a DMA transfer control device that temporarily writes transfer data from a transfer source to a memory, reads the transfer data written to the memory in accordance with a transfer instruction, and outputs the read data to a transfer destination. . The DMA transfer control device according to the first aspect includes a write pointer indicating a start position in the memory of the written transfer data, and an instructed read pointer indicating a position in the memory of the transfer data instructed by the transfer instruction, The difference between the write pointer and the instructed read pointer is compared with the transfer size. When the difference is equal to or larger than the transfer size, a read instruction is issued.
実施形態のDMA転送制御装置および方法によれば、ポインタを1個追加することで、CPUの負荷を増加させることなくDMA転送効率を向上することができる。また、実施形態のDMA転送制御装置および方法は、低消費電力および小規模回路で実現可能である。 According to the DMA transfer control device and method of the embodiment, by adding one pointer, DMA transfer efficiency can be improved without increasing the load on the CPU. Further, the DMA transfer control device and method of the embodiment can be realized with low power consumption and a small circuit.
図4は、第1実施形態のコンピュータシステムの構成を示す図である。 FIG. 4 is a diagram illustrating a configuration of the computer system according to the first embodiment.
図4に示すように、第1実施形態のコンピュータシステムは、CPU1と、転送元のデバイス2Pと、転送先のデバイス2Qと、DMA転送制御装置3と、DMA転送制御装置3に接続されたFIFOメモリを形成するためのRAM4と、システムバス5と、DMAバス6A、6Bと、を備える。RAM4は、SRAMなどが使用され、DMA転送制御装置3内に設けることも可能である。コンピュータシステムには、他にも各種のデバイスが接続されるが、ここではDMA転送に関係する部分のみを示している。
As shown in FIG. 4, the computer system according to the first embodiment includes a
第1実施形態のコンピュータシステムでは、DMA転送指示は、前のDMA転送動作が完了する前に先行して発行することが可能であり、2つ以上のDMA転送指示を先行して発行することが可能である。 In the computer system of the first embodiment, the DMA transfer instruction can be issued in advance before the previous DMA transfer operation is completed, and two or more DMA transfer instructions can be issued in advance. Is possible.
転送元のデバイス2Pおよび転送先のデバイス2Qは、メモリコントローラおよびそれに接続されたメモリや、磁気ディスク装置などの外部記憶装置や、通信インターフェースなどの各種のデバイスである。CPU1、転送元のデバイス2P、転送先のデバイス2Q、DMA転送制御装置3およびRAM4は、それぞれ1チップの半導体装置として形成し、システムバス5とおよびDMAバス6を形成したプリント基板上に搭載することが可能である。また、CPU1、DMA転送制御装置3およびシステムバス5に、転送元のデバイス2Pおよび転送先のデバイス2Q、他のデバイスおよびDMAバス6A、6Bの一部またはすべて、さらにRAM4などを1チップに搭載することも可能である。
The
図4に示すように、CPU1、転送元のデバイス2P、転送先のデバイス2QおよびDMA転送制御装置3は、システムバス5を介して接続され、相互にデータを通信することが可能である。また、転送元のデバイス2P、転送先のデバイス2QおよびDMA転送制御装置3は、DMAバス6A、6Bを介して相互に接続されている。これにより、転送元のデバイス2Pと転送先のデバイス2Qは、DMA転送制御装置3を介してデバイス間でDMA転送を行うことが可能である。
As shown in FIG. 4, the
DMAバス6Aは、転送元のデバイス2Pのデータを、DMA転送制御装置3を介してRAM4にDMA転送するのに使用される。DMAバス6Bは、RAM4に書き込まれたデータを、DMA転送制御装置3を介して転送先のデバイス2QにDMA転送するのに使用される。2つのDMAバス6AおよびDMAバス6Bが設けられているので、転送元のデバイス2Pから出力された転送データのRAM4への書込と、RAM4からの転送データの読出は、独立に行える。
The
また、RAM4への転送データの書込と読出が独立して行うため、オーバーフローおよびアンダーフローの防止も独立して制御される。ここでは、RAM4から転送先のデバイス2QへのDMA転送、すなわちRAM4からのデータ読出処理を例として説明を行う。しかし、転送元のデバイス2PからRAM4へのDMA転送、すなわちRAM4へのデータ書込処理についても開示の技術が同様に適用できることは、当業者には容易に理解できることである。
Further, since writing and reading of transfer data to and from
DMA転送制御装置3は、DMAバス6Aに接続される入力制御部11と、RAM情報管理部12と、DMAバス6Bに接続される出力制御部13と、を備える。入力制御部11、RAM情報管理部12および出力制御部13は、システムバス5を介してそれぞれCPU1と通信可能である。
The DMA
RAM情報管理部12は、RAM4をFIFOメモリとして動作させるために、RAM4において、書き込んだデータの先頭位置(アドレス)を示す書込ポインタWP14と、読み出したデータの後尾位置(アドレス)を示す読出ポインタRP15と、備える。RAM情報管理部12は、直前に発行したDMA転送指示で既に読出指示を行ったデータの位置(アドレス)を示す読出指示済ポインタRAP16を更に備える。
In order to operate the
図5は、RAM情報管理部12のより詳細な構成を示す図である。図5に示すように、RAM情報管理部12は、CPUインターフェース(CPU I/F)20と、入力制御部I/F31と、出力制御部I/F32と、RAMI/F33と、を備える。また、CPUインターフェース20は、レジスタ群21と、書込ポインタWPの値から読出指示済ポインタRAPを減じた値が指定サイズX以上であるかを判定して条件を満たした時にレジスタに指定サイズ到達を示す値の書込を行う演算器22と、レジスタ制御部23と、を備える。レジスタ群21は、RAM4へ書き込まれた転送データの先頭位置を示す書込ポインタWPと、CPU1から指示されたDMA転送の指定サイズXと、RAM4に書き込まれた転送データの後尾位置を示す読出ポインタRPと、読出指示済ポインタRAPと、を記憶するレジスタを含む。レジスタ群21は、さらに指定サイズ到達割り込みの発生を示すレジスタを備える。書込ポインタWPは、入力制御部11を介して入力された転送データをRAM4に書き込むたびに更新される。読出ポインタRPは、RAM4から記憶された転送データを読み出すたびに更新される。読出指示済ポインタRAPは、CPU1が転送指示を発行する時に、その時点の読出指示済ポインタRAPに指定サイズXを加えた値に更新される。レジスタ制御部23は、CPU1から指示された指定サイズXをレジスタに記憶し、書込ポインタWP、読出ポインタRPおよび読出指示済ポインタRAPを更新する。また、指定サイズ到達割り込みの発生を示すレジスタに指定サイズ到達を示す値が設定されると、CPU1に対して指定サイズ到達割り込みが発生する。
FIG. 5 is a diagram showing a more detailed configuration of the RAM
図6は、第1実施形態におけるDMA転送処理を示すフローチャートであり、RAM4からのデータ読出処理に関係するフローチャートである。
FIG. 6 is a flowchart showing the DMA transfer process in the first embodiment, and is a flowchart related to the data reading process from the
ステップ201では、CPU1が、転送先のアドレス、DMA転送のサイズなどのDMA転送に必要な情報を、RAM情報管理部12および出力制御部13内のレジスタに設定する。
In
上記のように、RAM4へのデータ書込は独立して行われており、書込ポインタWP14は順次増加する。
As described above, data writing to the
ステップ202では、書込ポインタWP14から指示済読出ポインタRAPを減じた値が、指定サイズX以上であるかを判定する。この判定は、演算器22で行われ、条件を満たさない時には待機し、条件を満たした時にはレジスタへの書き込みが行われ、それに応じてCPU1に対して指定サイズ到達割り込みが発生する。この条件が満たされた時は、RAM4に書き込まれた転送データのうちで、転送(読出)がされていないデータの量が指定サイズ以上であり、アンダーフローを生じないで転送が行えることを意味する。指定サイズ到達割り込みが発生すると、ステップ203に進む。
In
ステップ203では、CPU1は、指定サイズ到達の割り込みを受けると、DMA制御装置3に対して、RAM3から転送先のデバイスへのDMA転送指示を発行し、ステップ204に進む。DMA転送指示を受けると、RAM制御情報管理部12のレジスタ制御部23は、その時点の読出指示済ポインタRAPの値に指定サイズXを加えた値を、新たに読出指示済ポインタRAPとして記憶する。この時に発行されたDMA転送指示が1回目の指示であれば、RAM4からのデータの転送はただちに開始され、2回目以降の指示であれば、前のDMA転送が終了した直後に開始される。
In
ステップ204では、CPU1は、RAM4から転送先のデバイスにDMA転送する処理が残っているかを判定し、残っていればステップ202に戻り、残っていなければDMA転送を終了する。
In
図7は、第1実施形態のDMA転送処理を説明する図である。図において、WPが書込ポインタの示すアドレス位置を、RPが読出ポインタの示すアドレス位置を、Xが指定サイズを示す。図7において、(a)のように、RAM4からのDMA転送のための読出が行われていない状態では、読出ポインタRPおよび読出指示済ポインタRAPは同じ位置(アドレス)を示している。RAM4へのデータの書き込みは独立に行われており、書込ポインタWPは随時変化している。DMA情報管理部12は、WP−RAP≧Xになって、DMA転送指示を発行していない1番目のデータAがRAM4に蓄積されているかを確認する。そして、蓄積されていれば、DMA情報管理部12は、指定サイズ到達の割り込みをCPUに対して発生し、RAPをその時点のRAPにXを加えた値に変化させた後、CPUの指示に応じてデータAのRAM4からの読出処理を開始する。これにより、(b)のように、RAPがXだけ増加する。そして、読出処理に伴ってRPが変化する。
FIG. 7 is a diagram for explaining DMA transfer processing according to the first embodiment. In the figure, WP indicates the address position indicated by the write pointer, RP indicates the address position indicated by the read pointer, and X indicates the specified size. In FIG. 7, as shown in FIG. 7A, in the state where reading for DMA transfer from the
この読出処理の間もRAM4へのデータの書込は並行して独立に行われるので、WPは独立して増加する。ここで、(b)のようにWPの方がRPより速く増加する場合、(c)のように、2番目のデータBのRAM4への書込が終了しても、データAのRAM4からの転送は終了していないことになる。
Since the data writing to the
ここで、2番目のデータBのRAM4への転送(書込)が終了すると、WP−RAP≧Xを満たす。そのため、指定サイズ到達の割り込みがCPUに対して発生し、RAPをその時点のRAPにXを加えた値に変化させた後、CPUはデータBのRAM4からの転送指示を発行する。これにより、RAPはデータBの先頭位置を示す値になるが、上記のように、データBのRAM4からの転送指示が発行されても、データAのRAM4からの読出が終了していないので、そのままデータAのRAM4からの転送が行われる。そして、データAのRAM4からの転送が終了すると、(d)のように、RPはデータBの後尾位置になる。この時、WPは更に先に進んでいる。データBの転送指示はすでに発行されているので、データBの転送が引き続いて行われる。
Here, when the transfer (writing) of the second data B to the
図7に示すように、第1実施形態では、前データの転送処理が終了する前に次のデータの転送指示が発行されるため、その分無駄な時間を消費することがなくなり、転送効率の高いDMA転送が実現できる。 As shown in FIG. 7, in the first embodiment, since the next data transfer instruction is issued before the previous data transfer process is completed, unnecessary time is not consumed and transfer efficiency is improved. High DMA transfer can be realized.
なお、WP−RAP≧Xの条件が満たされるならば、2つ以上の転送指示を先行して発行することが可能である。例えば、16バイトのデータを1回のDMA転送で4バイトずつ転送する場合、16バイトのデータがRAM4に既に書き込まれている場合には、特に何もなければ転送指示が4回続けて発行されることになる。これにより、最初の4バイトのデータが転送されている時に、すでに3つの転送指示が発行済みである。
If the condition of WP-RAP ≧ X is satisfied, two or more transfer instructions can be issued in advance. For example, when transferring 16 bytes of
図8は、第1実施形態におけるRAMからのDMA転送の動作例を示すタイムチャートであり、(A)が図1から図3で説明した背景技術における動作例を、(B)が第1実施形態における動作例を示す。図8の動作例では、読出処理はすべて1サイクルで行う。また、この動作例では、指定サイズは4バイトで、DMA転送処理における3回の読出動作を示す。 FIG. 8 is a time chart showing an operation example of DMA transfer from the RAM according to the first embodiment. FIG. 8A shows an operation example in the background art described in FIGS. 1 to 3, and FIG. 8B shows the first embodiment. The operation example in a form is shown. In the operation example of FIG. 8, all reading processes are performed in one cycle. In this operation example, the designated size is 4 bytes, and three read operations in the DMA transfer process are shown.
図8の(A)に示すように、背景技術では、1回のDMA転送動作の完了後、次のDMA転送動作に関して転送可能かどうかの判定を行い、転送可能であればDMA転送指示を発行する。この判定動作および転送指示動作は、図8の(A)において、2番目のデータについてはクロック(CLK)11から13で、3番目のデータについてはCLK17から19で、行われる。
As shown in FIG. 8A, in the background art, after completion of one DMA transfer operation, it is determined whether transfer is possible for the next DMA transfer operation, and if transfer is possible, a DMA transfer instruction is issued. To do. In FIG. 8A, this determination operation and transfer instruction operation are performed at clocks (CLK) 11 to 13 for the second data and at
これに対して、図8の(B)に示すように、第1実施形態では、1回のDMA転送動作の完了を待たずに、次のDMA転送動作に関して転送可能かどうかの判定を行い、転送可能であればDMA転送指示を発行する。この転送指示動作は、図8の(B)において、2番目のデータについてはCLK11で、3番目のデータについてはCLK15で、行われる。 On the other hand, as shown in FIG. 8B, in the first embodiment, it is determined whether transfer is possible for the next DMA transfer operation without waiting for the completion of one DMA transfer operation. If transfer is possible, a DMA transfer instruction is issued. This transfer instruction operation is performed at CLK11 for the second data and at CLK15 for the third data in FIG. 8B.
図8の(A)と(B)を比較して明らかなように、3回のDMA転送動作が、背景技術ではCLK23で終了しているのに対して、第1実施形態ではCLK19で終了しており、4クロック早く完了している。 As is clear from comparison between FIGS. 8A and 8B, the three DMA transfer operations end at CLK23 in the background art, but end at CLK19 in the first embodiment. And completed 4 clocks earlier.
図9は、第1実施形態におけるRAMからの読出に関するDMA転送の別の動作例を示すタイムチャートであり、(A)が図1から図3で説明した背景技術における動作例を、(B)が第1実施形態における動作例を示す。図9の(A)では、読出処理を、RPの値が偶数の場合は1サイクルで行い、奇数の場合は2サイクルで行う。同様に、図9の(B)では、読出処理を、RAPの値が偶数の場合は1サイクルで行い、奇数の場合は2サイクルで行う。また、この動作例では、指定サイズは4バイトで、DMA転送処理における3回の読出動作を示す。 FIG. 9 is a time chart showing another operation example of DMA transfer related to reading from the RAM according to the first embodiment. FIG. 9A shows an operation example in the background art described with reference to FIGS. Shows an operation example in the first embodiment. In FIG. 9A, the reading process is performed in one cycle when the value of RP is an even number, and in two cycles when the value of RP is an odd number. Similarly, in FIG. 9B, the reading process is performed in one cycle when the value of RAP is an even number, and in two cycles when the value of RAP is an odd number. In this operation example, the designated size is 4 bytes, and three read operations in the DMA transfer process are shown.
図9の(A)に示すように、背景技術では、1回のDMA転送動作の完了後、次のDMA転送動作に関して転送可能かどうかの判定を行い、転送可能であればDMA転送指示を発行する。この判定動作および転送指示動作は、図9の(A)において、2番目のデータについてはクロック(CLK)13から15で、3番目のデータについてはCLK21から23で、行われる。
As shown in FIG. 9A, in the background art, after completion of one DMA transfer operation, it is determined whether transfer is possible for the next DMA transfer operation, and if transfer is possible, a DMA transfer instruction is issued. To do. In FIG. 9A, the determination operation and the transfer instruction operation are performed at clocks (CLK) 13 to 15 for the second data and at
これに対して、図9の(B)に示すように、第1実施形態では、RAMに指定サイズ以上のデータが書き込まれた状態で、1回のDMA転送動作の完了を待たずに、次のDMA転送指示を発行する。この転送指示動作は、図9の(B)において、2番目のデータについてはCLK11で、3番目のデータについてはCLK15で、行われる。 On the other hand, as shown in FIG. 9B, in the first embodiment, without waiting for completion of one DMA transfer operation in a state where data of a specified size or more is written in the RAM, The DMA transfer instruction is issued. This transfer instruction operation is performed at CLK11 for the second data and at CLK15 for the third data in FIG. 9B.
図9の(A)と(B)を比較して明らかなように、3回目のDMA転送動作が、背景技術ではCLK24で開始されるのに対して、第1実施形態ではCLK20で開始されており、4クロック早く開始している。 As is clear from comparison between FIGS. 9A and 9B, the third DMA transfer operation is started at CLK24 in the background art, whereas it is started at CLK20 in the first embodiment. It starts 4 clocks earlier.
図8の(B)および図9の(B)では、RAPが所定の値になった時に1回分のDMAが開始されていることが分かる。 8B and 9B, it can be seen that one DMA is started when RAP reaches a predetermined value.
このことは、転送可能なDMAを複数個先行発行することが可能なため、転送予定のDMA転送指示の発行を早い段階で完了することができ、CPUは別の処理に移行することができるようになり、結果としてCPUの処理効率を向上することができることを示している。 This is because a plurality of transferable DMAs can be issued in advance, so that the transfer of a DMA transfer instruction to be transferred can be completed at an early stage, and the CPU can shift to another process. As a result, the processing efficiency of the CPU can be improved.
以上説明したように、第1実施形態では、DMA転送制御装置3にポインタを1個追加するだけで、CPUの負荷を増加させることなくDMA転送効率を向上することができる。また、第1実施形態のDMA転送制御装置3は、ポインタを1個追加しただけなので、低消費電力および小規模回路で実現可能である。
As described above, in the first embodiment, the DMA transfer efficiency can be improved without increasing the load on the CPU only by adding one pointer to the DMA
図10は、第2実施形態のコンピュータシステムの構成を示す図であり、図4に対応する図である。図4と比較して明らかなように、第2実施形態のDMA制御装置3は、第1実施形態のDMA制御装置3のRAM情報管理部12に、書込指示済ポインタWAP17を更に設けたことが異なる。書込指示済ポインタWAP17は、直前に発行した転送元のデバイスからRAM4へのDMA転送指示で既に書込指示を行ったデータの位置(アドレス)を示す。
FIG. 10 is a diagram illustrating a configuration of a computer system according to the second embodiment, and corresponds to FIG. 4. As apparent from the comparison with FIG. 4, the
第2実施形態では、転送元のデバイスからRAM4への転送指示を、先行して発行することが可能になり、転送元のデバイスからRAM4への転送動作で、第1実施形態と同様の効果が更に得られる。なお、当業者であれば、第2実施形態の動作について、第1実施形態の説明により容易に理解できるので、詳しい説明は省略する。
In the second embodiment, a transfer instruction from the transfer source device to the
ここに記載したすべての例や条件は、発明および技術に適用する発明の概念の理解を助ける目的で記載されたものであり、特に記載された例や条件は発明の範囲を制限することを意図するものではなく、明細書のそのような例の構成は発明の利点および欠点を示すものではない。発明の実施形態を詳細に記載したが、各種の変更、置き換え、変形が発明の精神および範囲を逸脱することなく行えることが理解されるべきである。 All examples and conditions described herein are set forth for the purpose of assisting understanding of the inventive concept applied to the invention and technology, and the examples and conditions specifically described are intended to limit the scope of the invention. Rather, the configuration of such examples in the specification is not indicative of the advantages and disadvantages of the invention. Although embodiments of the invention have been described in detail, it should be understood that various changes, substitutions and modifications can be made without departing from the spirit and scope of the invention.
1 CPU
2A、2B、2N デバイス
2P 転送元デバイス
2Q 転送先デバイス
3 DMA転送制御装置
4 RAM
5 システムバス
6、6A、6B DMAバス
11 入力制御部
12 RAM情報管理部
13 出力制御部
14 書込ポインタ(WP)
15 読出ポインタ(RP)
16 指示済読出ポインタ(RAP)
17 指示済書込ポインタ(WAP)
1 CPU
2A, 2B,
5
15 Read pointer (RP)
16 Pointed read pointer (RAP)
17 Instructed write pointer (WAP)
Claims (5)
書き込まれた前記転送データの前記メモリにおける先頭位置を示すライトポインタと、
前記転送指示で指示済みの前記転送データの前記メモリにおける位置を示す指示済リードポインタと、を備え、
前記ライトポインタと前記指示済リードポインタの差分と、転送サイズとを比較し、前記差分が前記転送サイズ以上の時に、前記転送指示を発行することを特徴とするDMA転送制御装置。 A DMA transfer control device that temporarily writes transfer data from a transfer source to a memory, reads the transfer data written to the memory in accordance with a transfer instruction, and outputs the read data to a transfer destination.
A write pointer indicating the start position in the memory of the written transfer data;
An instructed read pointer indicating a position in the memory of the transfer data that has been instructed by the transfer instruction, and
A DMA transfer control apparatus, comprising: comparing a difference between the write pointer and the instructed read pointer and a transfer size, and issuing the transfer instruction when the difference is equal to or larger than the transfer size.
書き込まれた前記転送データの前記メモリにおける先頭位置を示すライトポインタの値を検出し、
前記転送指示で指示済みの前記転送データの前記メモリにおける位置を示す指示済リードポインタの値を検出し、
前記ライトポインタと前記指示済リードポインタの差分と、転送サイズとを比較し、
前記差分が前記転送サイズ以上の時に、前記転送指示を発行する、ことを特徴とするDMA転送制御方法。 A DMA transfer control method for temporarily writing transfer data from a transfer source into a memory, reading the transfer data written in the memory in accordance with a transfer instruction, and outputting the read data to a transfer destination,
Detect the value of the write pointer indicating the start position in the memory of the written transfer data,
Detecting a value of an instructed read pointer indicating a position in the memory of the transfer data instructed by the transfer instruction;
Comparing the difference between the write pointer and the instructed read pointer and the transfer size;
The DMA transfer control method, wherein the transfer instruction is issued when the difference is equal to or larger than the transfer size.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009142665A JP5387155B2 (en) | 2009-06-15 | 2009-06-15 | DMA transfer control device and DMA transfer control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009142665A JP5387155B2 (en) | 2009-06-15 | 2009-06-15 | DMA transfer control device and DMA transfer control method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010287185A true JP2010287185A (en) | 2010-12-24 |
JP5387155B2 JP5387155B2 (en) | 2014-01-15 |
Family
ID=43542813
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009142665A Expired - Fee Related JP5387155B2 (en) | 2009-06-15 | 2009-06-15 | DMA transfer control device and DMA transfer control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5387155B2 (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07114510A (en) * | 1993-10-19 | 1995-05-02 | Hitachi Ltd | Control system for fifo threshold value control dma |
JPH0830544A (en) * | 1994-07-15 | 1996-02-02 | Nec Corp | Dma transfer device and its method |
JP2007323467A (en) * | 2006-06-02 | 2007-12-13 | Fujitsu Ltd | Dma circuit and data transfer method |
JP2008083911A (en) * | 2006-09-27 | 2008-04-10 | Matsushita Electric Ind Co Ltd | Dma transfer control device and semiconductor integrated circuit device |
-
2009
- 2009-06-15 JP JP2009142665A patent/JP5387155B2/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07114510A (en) * | 1993-10-19 | 1995-05-02 | Hitachi Ltd | Control system for fifo threshold value control dma |
JPH0830544A (en) * | 1994-07-15 | 1996-02-02 | Nec Corp | Dma transfer device and its method |
JP2007323467A (en) * | 2006-06-02 | 2007-12-13 | Fujitsu Ltd | Dma circuit and data transfer method |
JP2008083911A (en) * | 2006-09-27 | 2008-04-10 | Matsushita Electric Ind Co Ltd | Dma transfer control device and semiconductor integrated circuit device |
Also Published As
Publication number | Publication date |
---|---|
JP5387155B2 (en) | 2014-01-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6602579B2 (en) | Semiconductor device and system | |
JP2006195714A (en) | Resource management device | |
JP2007034392A (en) | Information processor and data processing method | |
CN113900974A (en) | Storage device, data storage method and related equipment | |
JP2006293927A (en) | Direct memory access controller and system lsi including direct memory access controller | |
JP4373255B2 (en) | Direct memory access control apparatus and method | |
JP2008033721A (en) | Dma transfer control device | |
JP2006113689A (en) | Bus bridge device and data transfer method | |
US7913013B2 (en) | Semiconductor integrated circuit | |
JP5387155B2 (en) | DMA transfer control device and DMA transfer control method | |
JP5404294B2 (en) | Data arithmetic device control circuit and data arithmetic device | |
JP5360594B2 (en) | DMA transfer apparatus and method | |
KR100606163B1 (en) | Direct memory access device, system and method for transmitting and receiving data through direct memory access device | |
US10853123B2 (en) | Memory module | |
JP2009059276A (en) | Data processing apparatus and program | |
JP2009163531A (en) | Interruption management mechanism and microcomputer | |
JP2009271610A (en) | Buffer control circuit, buffer circuit and data processor | |
JP4696003B2 (en) | Data transfer circuit | |
JP6416488B2 (en) | Semiconductor device | |
JP2006004340A (en) | Dma transfer controller | |
JP5218225B2 (en) | MEMORY ACCESS DEVICE, MEMORY ACCESS SYSTEM, AND MEMORY ACCESS DEVICE PROCESSING METHOD | |
JP2011118744A (en) | Information processor | |
JP2002278753A (en) | Data processing system | |
JP2007257169A (en) | Access control method and information processor | |
JP2007334600A (en) | Semiconductor integrated circuit device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20120307 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130206 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130212 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130415 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130528 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130725 |
|
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: 20130910 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130923 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
LAPS | Cancellation because of no payment of annual fees |