JP2015222487A - DMA controller - Google Patents
DMA controller Download PDFInfo
- Publication number
- JP2015222487A JP2015222487A JP2014106365A JP2014106365A JP2015222487A JP 2015222487 A JP2015222487 A JP 2015222487A JP 2014106365 A JP2014106365 A JP 2014106365A JP 2014106365 A JP2014106365 A JP 2014106365A JP 2015222487 A JP2015222487 A JP 2015222487A
- Authority
- JP
- Japan
- Prior art keywords
- bus
- transfer
- dma
- master port
- data
- 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
Landscapes
- Bus Control (AREA)
- Information Transfer Systems (AREA)
Abstract
Description
本発明は、DMA(Direct Memory Access)方式によりデータを転送するDMAコントローラに関する。 The present invention relates to a DMA controller that transfers data by a DMA (Direct Memory Access) method.
例えばバスマスタとしてのCPU(Central Processing Unit)と、様々な機能を提供する複数のバススレーブとでシステムを構築する場合、これらが単一のバスで接続されることはない。この主な理由は、データの転送性能がバススレーブ毎に異なるためである。このため、転送性能の高いバススレーブや、CPU、DMAコントローラを高速バスに接続するとともに、転送性能の低いバススレーブを低速バスに接続して、高速バスおよび低速バス同士をバスブリッジで接続する構成が一般的である。 For example, when a system is constructed by a CPU (Central Processing Unit) as a bus master and a plurality of bus slaves that provide various functions, they are not connected by a single bus. The main reason is that the data transfer performance differs for each bus slave. For this reason, a bus slave with high transfer performance, a CPU and a DMA controller are connected to a high-speed bus, a bus slave with low transfer performance is connected to a low-speed bus, and the high-speed bus and low-speed bus are connected by a bus bridge. Is common.
この構成において、データがDMA転送される場合、当該転送が低速バスで完結するにもかかわらず、DMA転送が高速バスを介して制御されるので、DMAコントローラによって高速バスが占有される。このため、CPUによるデータ転送が実行できず、高速バスの利用効率が低下する。
そこで、DMA転送が低速バスで完結する場合には、高速バスを切り離すとともに、DMAコントローラにおける処理をバスブリッジに移行させる技術が知られている(特許文献1参照)。この技術では、低速バスで完結するデータ転送をバスブリッジに実行させる。これにより、DMAコントローラは、別の転送処理を実行するので、高速バスの利用効率の低下が防止される。
In this configuration, when data is DMA-transferred, the DMA controller occupies the high-speed bus because DMA transfer is controlled via the high-speed bus even though the transfer is completed by the low-speed bus. For this reason, data transfer by the CPU cannot be executed, and the utilization efficiency of the high-speed bus is reduced.
Therefore, a technique is known in which when the DMA transfer is completed with a low-speed bus, the high-speed bus is disconnected and the processing in the DMA controller is transferred to the bus bridge (see Patent Document 1). In this technology, the data transfer that is completed by the low-speed bus is executed by the bus bridge. As a result, the DMA controller executes another transfer process, thereby preventing a reduction in the utilization efficiency of the high-speed bus.
しかしながら、上記技術において、バスブリッジを介して高速バスおよび低速バスの双方を使用したデータ転送は、低速バスの転送性能に律速されてしまう。すなわち、高速バスでは、より高速なデータ転送が可能であるにもかかわらず、低速バスの転送性能以上でデータを転送することができないのである。このため、高速バスの占有時間が長くなり、システム全体でみたときの効率が低下する、という問題があった。 However, in the above technique, data transfer using both the high-speed bus and the low-speed bus via the bus bridge is limited by the transfer performance of the low-speed bus. In other words, the high-speed bus cannot transfer data at a speed higher than that of the low-speed bus, although it can transfer data at a higher speed. For this reason, the occupation time of the high-speed bus becomes long, and there is a problem that the efficiency when viewed in the whole system is lowered.
一方、近年では、1つの半導体チップに必要とされる一連の機能(モジュールとしてのバススレーブ)を複数集積して、特定の用途に特化したSoC(System on Chip)が知られている。SoCで必要とされるバススレーブの転送性能は、非常に多岐にわたり、複数種類のバスを用いたデータ転送の効率化が要求されている。このため、バスとして、多数の3つ以上のバスを用意しなければならないが、上記技術では、そもそも2種類のバスしか想定されていない。 On the other hand, in recent years, SoC (System on Chip) specialized for a specific application by integrating a plurality of functions (bus slave as a module) required for one semiconductor chip is known. The transfer performance of bus slaves required for SoC is very diverse, and it is required to improve the efficiency of data transfer using a plurality of types of buses. For this reason, a large number of three or more buses must be prepared as buses. However, in the above technique, only two types of buses are assumed in the first place.
本発明は、このような事情に鑑みてなされたものであり、その目的の一つは、転送性能の異なる3つ以上のバスを有する構成において、データの転送効率の改善を図ったDMAコントローラを提供することにある。 The present invention has been made in view of such circumstances, and one of its purposes is to provide a DMA controller that improves data transfer efficiency in a configuration having three or more buses having different transfer performances. It is to provide.
上記目的を達成するために、本発明の一態様に係るDMAコントローラは、ソースアドレスからディスティネーションアドレスにデータを転送するDMAコントローラであって、少なくとも3つ以上のバスに対応して設けられ、それぞれが対応するバスに接続されるマスターポートと、前記バスに接続されたモジュールのアドレスを、当該接続されたバスに対応付けて記憶するアドレステーブルと、当該ソースアドレスのモジュールが属する転送元バスと、当該ディスティネーションアドレスのモジュールが属する転送先バスとを、前記アドレステーブルを参照して特定する特定部と、前記ソースアドレスから前記ディスティネーションアドレスにデータを転送する経路を、前記転送元バス、前記転送元バスに接続されたマスターポート、前記転送先バスに接続されたマスターポート、および、前記転送先バスに設定する転送制御部と、を具備することを特徴とする。 In order to achieve the above object, a DMA controller according to an aspect of the present invention is a DMA controller that transfers data from a source address to a destination address, and is provided corresponding to at least three buses, A master port connected to the corresponding bus, an address table that stores the address of the module connected to the bus in association with the connected bus, a transfer source bus to which the module of the source address belongs, A specifying unit that specifies a transfer destination bus to which the module of the destination address belongs by referring to the address table, a path for transferring data from the source address to the destination address, the transfer source bus, the transfer Master port connected to former bus, front Connected master port to the destination bus, and characterized by comprising a transfer control unit for setting the transfer destination bus.
上記一態様に係るDMAコントローラによれば、ソースアドレスからディスティネーションアドレスへのデータが、転送元バスから転送先バスにダイレクトに転送される。このため、上記一態様によれば、3つ以上のバスを有する構成において、転送元バスおよび転送先バスの間にあるバスや、バス間のバスブリッジを経由させずに、最短経路でデータが転送されるので、テータの転送速度を改善することができる。 According to the DMA controller according to the above aspect, data from the source address to the destination address is directly transferred from the transfer source bus to the transfer destination bus. Therefore, according to the above aspect, in a configuration having three or more buses, data can be transmitted in the shortest path without passing through a bus between the transfer source bus and the transfer destination bus or a bus bridge between the buses. Since the data is transferred, the data transfer speed can be improved.
上記一態様において、前記3つ以上のバスに対応して設けられたマスターポートのうち、少なくとも2つ以上は、互いに異なる転送帯域で、それぞれに対応するバスにデータ転送する構成が好ましい。ここで、転送帯域とは、単位時間において実際に転送可能なデータ量をいい、主にバス幅、動作周波数、レイテンシ(遅延)によって定まる。
また、上記一態様において、前記3つ以上のバスが、バスブリッジを介して直列に接続される構成としても良い。
ここでいう直列に接続される、とは、例えば第1バスから第4バスまでの4つを有するのであれば、第1バスと第2バスとの間にバスブリッジが、第2バスと第3バスとの間にバスブリッジが、第3バスと第4バスとの間にバスブリッジが、それぞれ設けられて、バス間同士のデータ転送が可能な構成をいう。
In the one aspect, it is preferable that at least two or more master ports provided corresponding to the three or more buses are configured to transfer data to buses corresponding to the master ports in different transfer bands. Here, the transfer band refers to the amount of data that can actually be transferred in a unit time, and is mainly determined by the bus width, operating frequency, and latency (delay).
In the above aspect, the three or more buses may be connected in series via a bus bridge.
Here, for example, if there are four buses from the first bus to the fourth bus, the bus bridge is connected between the first bus and the second bus, and the second bus and the second bus. A bus bridge is provided between the three buses and a bus bridge is provided between the third bus and the fourth bus, respectively, so that data can be transferred between the buses.
上記一態様において、前記マスターポートは、リードマスターポートおよびライトマスターポートの組である構成が好ましい。この構成によれば、同じバスにおいてリードマスターポートを介したリード転送と、ライトマスターポートを介したライト転送とが実行可能であるので、DMAコントローラを含むシステム全体の効率を向上させることができる。 In the one aspect, it is preferable that the master port is a set of a read master port and a write master port. According to this configuration, read transfer via the read master port and write transfer via the write master port can be executed on the same bus, so that the efficiency of the entire system including the DMA controller can be improved.
上記一態様において、前記転送元バスおよび転送先バスが同一である場合、当該転送元バスのリードマスターポートを介してリード転送されたデータが、当該転送先バスのライトマスターポートを介してライト転送される構成としても良い。
また、前記3つ以上のバスが、それぞれバスブリッジを介して直列に接続され、前記転送先バスが、前記転送元バスに前記バスブリッジを介して接続されたバスである場合、当該転送元バスまたは当該転送先バスのいずれかに対応するマスターポートと、当該バスブリッジとを介してデータが転送される構成としても良い。
In the above aspect, when the transfer source bus and the transfer destination bus are the same, the data read-transferred through the read master port of the transfer source bus is write-transferred through the write master port of the transfer destination bus. It is good also as a structure made.
When the three or more buses are connected in series via a bus bridge, and the transfer destination bus is a bus connected to the transfer source bus via the bus bridge, the transfer source bus Alternatively, data may be transferred via a master port corresponding to one of the transfer destination buses and the bus bridge.
上記一態様において、前記転送制御部によってデータ転送の機能が割り当てられる転送チャネルを複数有し、前記転送制御部は、前記複数の転送チャネルのうち、一の転送チャネルに、一のソースアドレスから一のディスティネーションアドレスへのデータ転送を割り当てた場合に、当該一のソースアドレスのモジュールが属する転送元バスに接続されたリードマスターポートと、当該一のディスティネーションアドレスのモジュールが属する転送先バスに接続されたライトマスターポートとを、他の転送チャネルによるデータ転送の経路に設定していなければ、当該一の転送チャネルに、割り当てたデータ転送を許可する構成としても良い。
この構成によれば、データ転送が割り当てられた一の転送チャネルは、リードマスターポートとライトマスターポートとが他の転送チャネルに使用されていない限り、データ転送を実行する。
In the above aspect, the transfer control unit has a plurality of transfer channels to which a function of data transfer is assigned, and the transfer control unit assigns one transfer channel to one transfer channel from one source address. When data transfer to the destination address is assigned, the read master port connected to the transfer source bus to which the module with the one source address belongs and the transfer destination bus to which the module with the one destination address belongs If the assigned write master port is not set as a data transfer path by another transfer channel, the assigned data transfer may be permitted to the one transfer channel.
According to this configuration, one transfer channel to which data transfer is assigned performs data transfer unless the read master port and the write master port are used for other transfer channels.
以下、本発明の実施形態について図面を参照して説明する。 Embodiments of the present invention will be described below with reference to the drawings.
図1は、実施形態に係るDMAコントローラ50を含むシステム1の全体の構成を示すブロック図である。
この図に示されるように、システム1は、バス(A)110、バス(B)120、バス(C)130およびバス(D)140と、これらのバスの各々に接続されたDMAコントローラ50と、バス同士を接続するバスブリッジ12、23、34とを含み、各バスには、1または複数のモジュールが次のように接続されている。
FIG. 1 is a block diagram showing an overall configuration of a
As shown in this figure, the
すなわち、バス(A)110には、CPU112、動画デコーダ114、描画エンジン116およびSRAM(Static Random Access Memory)118が接続され、バス(B)120には、DRAM(Dynamic Random Access Memory)122、および、電源が遮断されても、記憶したデータを保持する不揮発性のメモリ124が接続される。また、バス(C)130には、サウンド回路(音源)132が接続され、バス(D)140には、SPI(Serial Peripheral Interface)142、I2C(Inter-Integrated Circuit)144、GPIO(General Purpose Input/Output)146、および、ROM(Read Only Memory)148が接続される。
That is, a
DMAコントローラ50の詳細については後述するが、バスの各々に対応したマスターポートP1〜P4を有し、マスターポートP1〜P4の各々は、「R」と表記されたリードマスターポートと、「W」と表記されたライトマスターポートとの組をそれぞれ有する。マスターポートP1〜P4のうち、マスターポートP1は、バス(A)110に対応し、同様に、マスターポートP2、P3、P4は、バス(B)120、バス(C)130、バス(D)140に対応する。
Although details of the
一方、バス(A)110、バス(B)120、バス(C)130、バス(D)140の各々は、指定されたアドレス(ソースアドレス)のモジュールから読み出されたデータを転送するリードバスと、指定されたアドレス(ディスティネーションアドレス)に書き込むデータを転送するライトバスと、の独立した2つの単方向バスをそれぞれ有する。
なお、各バスにおける動作周波数(転送速度)は、互いに異なっている。図の例では、バスの転送速度は、速い順に、
バス(B)120>バス(A)110>バス(C)130>バス(D)140
となっている。
On the other hand, each of the bus (A) 110, the bus (B) 120, the bus (C) 130, and the bus (D) 140 is a read bus that transfers data read from a module at a specified address (source address). And two independent unidirectional buses each having a write bus for transferring data to be written to a designated address (destination address).
Note that the operating frequencies (transfer rates) in each bus are different from each other. In the example in the figure, the bus transfer speed is ascending order.
Bus (B) 120> Bus (A) 110> Bus (C) 130> Bus (D) 140
It has become.
バス(A)110、バス(B)120、バス(C)130、バス(D)140の各々には、DMAコントローラ50にアクセスするためのポイントApがそれぞれ2つずつ設けられる。2つのポイントApの一方は、対応するマスターポートのリードマスターポートに接続され、他方は、ライトマスターポートに接続される。
Each of the bus (A) 110, the bus (B) 120, the bus (C) 130, and the bus (D) 140 is provided with two points Ap for accessing the
バスブリッジ12は、バス(A)110およびバス(B)120の間において、バスアクセスを双方向に変換する。同様に、バスブリッジ23はバス(B)120およびバス(C)130の間において、また、バスブリッジ34はバス(C)130およびバス(D)140の間において、それぞれバスアクセスを双方向に変換する。このようにして、バス(A)110、バス(B)120、バス(C)130およびバス(D)140は、バスブリッジを介して直列に接続される。
The
図2は、DMAコントローラ50の構成を示すブロック図である。
図に示されるように、DMAコントローラ50は、上述したマスターポートP1〜P4のほか、転送制御部502、選択部504、特定部512、アドレステーブル514、および、DMAチャネル(転送チャネル)Ch0〜Ch15を含む。
FIG. 2 is a block diagram showing a configuration of the
As shown in the figure, in addition to the master ports P1 to P4 described above, the
転送制御部502は、CPU112からDMA転送命令を受け取ったとき、後述する処理を実行して、DMAコントローラ50の各部を制御したり、各部を設定したりする。
DMAチャネルCh0〜Ch15の各々は、それぞれ転送制御部502による制御にしたがって、ソースアドレスから読み出したデータを、図示省略したFIFO(Fast In Fast Out)メモリにバッファリングした上で、ディスティネーションアドレスに転送する。このとき、リードマスターポートからDMAチャネルの入力端までの経路、および、DMAチャネルの出力端からライトマスターポートまでの経路は、それぞれ転送制御部502の制御にしたがって選択部504で設定される。
When the
Each of the DMA channels Ch0 to Ch15 buffers the data read from the source address in a FIFO (Fast In Fast Out) memory (not shown) and transfers it to the destination address according to the control by the
選択部504は、DMAチャネルCh0〜Ch15の各々における入出力端と、マスターポートP1〜P4におけるリードマスターポートとライトマスターポートとを接続して、DMAコントローラ50での経路を設定する。なお、転送制御部502が経路を設定するために必要な情報を記憶する構成がアドレステーブル514であり、当該アドレステーブル514から必要な情報を特定し、転送制御部502に通知する構成が特定部512である。
The
図3は、アドレステーブル514の内容の一例を示す図である。この図に示されるように、アドレステーブル514では、バス(A)110、バス(B)120、バス(C)130、バス(D)140毎に、接続されたモジュールのアドレス範囲が対応付けられて記憶されている。このため、特定部512が、アドレステーブル514を参照することで、指定されたアドレスのモジュールがどのバスに接続されているのかを特定できるようになっている。
なお、CPU112については、DMA転送を命令するモジュールであり、CPU112自身はDMA転送の対象にならないので、アドレステーブル514の記載対象外となっている。
FIG. 3 is a diagram illustrating an example of the contents of the address table 514. As shown in this figure, in the address table 514, the address range of the connected module is associated with each of the bus (A) 110, the bus (B) 120, the bus (C) 130, and the bus (D) 140. Is remembered. For this reason, the identifying
Note that the
次に、DMAコントローラ50の動作について、図面を参照して説明する。
Next, the operation of the
図4は、DMAコントローラ50における転送制御部502の制御内容を示すフローチャートである。
まず、転送制御部502は、DMA転送命令を受け取ったとき、DMAチャネルCh0〜Ch15のうち、未割当のチャネル(空きチャネル)、すなわち、DMA転送に関与していないDMAチャネルがあるか否かを判別する(ステップSa11)。転送制御部502は、空きチャネルがないと判別すれば(ステップSa11の判別結果が「No」であれば)、処理手順をステップSa11に戻す。このため、空きチャネルが発生するまで、転送制御部502は、当該DMA転送命令をステップSa11で待機(キュー)させることになる。
なお、DMA転送を完了したDMAチャネルは、後述するように割当が解除されるので、DMA転送命令を受け取ったときに空きチャネルがなく、判別結果が当初「No」であっても、ステップSa11で待機していれば、やがて「Yes」に転じることになる。
FIG. 4 is a flowchart showing the control contents of the
First, when receiving a DMA transfer instruction, the
Since the DMA channel that has completed the DMA transfer is deallocated as described later, even if there is no empty channel when the DMA transfer command is received and the determination result is initially “No”, in step Sa11 If you are waiting, you will eventually turn to “Yes”.
転送制御部502は、空きチャネルがあると判別すれば(ステップSa11の判別結果が「Yes」であれば)、当該空きチャネルの1つを、当該DMA転送命令を実行させるチャネルとして割り当てる(ステップSa12)。
If the
次に、転送制御部502は、特定部512に対し、当該DMA転送命令に係るソースアドレスとディスティネーションアドレスとを通知して、転送元バスと転送先バスとの特定を指示する(ステップSa13)。この指示によって特定部512は、アドレステーブル514を参照して、ソースアドレスに対応するバスを転送元バスと特定し、ディスティネーションアドレスに対応するバスを転送先バスと特定して、転送制御部502に返送する。
Next, the
転送制御部502は、割り当てたDMAチャネルが特定部512によって特定された転送元バスおよび転送先バスを用いてDMA転送が可能であるか否かを判別する(ステップSa14)。
詳細には、転送制御部502は、転送元バスのリードマスターポートと転送先バスのライトマスターポートとの少なくとも一方が割り当てたDMAチャネル以外の他のDMAチャネルによってDMA転送に使用されていれば、割り当てたDMAチャネルによるDMA転送を不可と判別し(ステップSa14の判別結果を「No」とし)、処理手順をステップSa14に戻す。なお、DMA転送が不可と判別されても、他のDMAチャネルによるDMA転送の完了によって、リードマスターポート、ライトマスターポートが使用されなくなる。このため、ステップSa14の判別結果が当初「No」であっても、当該ステップSa14で待機していれば、やがて「Yes」に転じることになる。
The
Specifically, if the
転送制御部502は、割り当てたDMAチャネルによるDMA転送が可能であると判別すれば(ステップSa14の判別結果が「Yes」であれば)、選択部504に対して次のような経路を設定させる(ステップSa15)。
すなわち、転送制御部502は、割り当てたDMAチャネルの入力端と転送元バスのリードマスターポートとを接続する経路と、当該DMAチャネルの出力端と転送先バスのライトマスターポートとを接続する経路と、を選択部504に設定するように制御する。選択部504は、この制御にしたがった経路を設定する。
If the
That is, the
転送制御部502は、選択部504に対して経路を設定させると、割り当てたDMAチャネルに対してDMA転送を指示する(ステップSa16)。これにより、当該DMAチャネルがDMA転送命令に係るデータのDMA転送を開始する。
When the
転送制御部502は、割り当てたDMAチャネルによるDMA転送が終了したか否かを判別する(ステップSa17)。
転送制御部502は、割り当てたDMAチャネルによるDMA転送が進行中であると判別すれば(ステップSa17の判別結果が「No」であれば)、処理手順をステップSa17に戻す。すなわち、当該DMA転送が終了するまで、転送制御部502は、ステップSa17で待機する。
一方、割り当てたDMAチャネルによるDMA転送が終了したと判別すれば(ステップSa17の判別結果が「Yes」であれば)、転送制御部502は、当該DMAチャネルの割り当てを解除する(ステップSa18)。これにより、次のDMA転送命令を受け取ったときに、当該DMAチャネルを割り当てて、次のDMA転送を実行させることができる。
The
If the
On the other hand, if it is determined that the DMA transfer by the allocated DMA channel has been completed (if the determination result of step Sa17 is “Yes”), the
ステップSa18の後、転送制御部502において、DMA転送命令を受け取ったときの処理が終了する。転送制御部502は、DMA転送命令を受け取る毎に、図4に示した処理を実行する。
After step Sa18, the
次に、DMA転送の具体例について説明する。図5は、DMA転送によるデータの経路の一例を示す図であり、次のような条件を想定して設定される。詳細には、この例では、当該DMA転送命令において、DMAチャネルCh0が未割当であるために(ステップSa11)、当該DMAチャネルCh0にDMA転送が割り当てられた場合(ステップSa12)を想定している。
また、当該DMA転送命令において、ソースアドレスで示されるモジュール(転送元)がROM148であり、ディスティネーションアドレスで示されるモジュール(転送先)がSRAM118である場合を想定している。この場合、特定部512は、アドレステーブル514を参照して、ソースアドレスに対応する転送元バスがバス(D)140であることを特定し、ディスティネーションアドレスに対応する転送先バスがバス(A)110であることを特定する(ステップSa13)。
Next, a specific example of DMA transfer will be described. FIG. 5 is a diagram showing an example of a data path by DMA transfer, and is set assuming the following conditions. Specifically, in this example, it is assumed that DMA transfer is assigned to the DMA channel Ch0 (step Sa12) because the DMA channel Ch0 is not assigned in the DMA transfer instruction (step Sa11). .
In the DMA transfer instruction, it is assumed that the module (transfer source) indicated by the source address is the
ここで、マスターポートP4のリードマスターポートと、マスターポートP1のライトマスターポートと、の双方が他のDMAチャネルで使用されていなければ(ステップSa14の判別結果が「Yes」であれば)、図6に示されるように、DMAチャネルCh0の入力端がマスターポートP4のリードマスターポートに接続され、DMAチャネルCh0の出力端がマスターポートP1のライトマスターポートに接続されて、DMAコントローラ50内における転送経路が設定される(ステップSa15)。
Here, if both the read master port of the master port P4 and the write master port of the master port P1 are not used in other DMA channels (if the determination result in step Sa14 is “Yes”), FIG. 6, the input end of the DMA channel Ch0 is connected to the read master port of the master port P4, the output end of the DMA channel Ch0 is connected to the write master port of the master port P1, and the transfer in the
このように転送経路が設定された状態においてDMAチャネルCh0に転送指示がなされると、当該DMAチャネルCh0は、図5および図6に示されるように、ROM148から読み出したデータを、ROM148→バス(D)140→マスターポートP4のリードマスターポート→DMAチャネルCh0(FIFOメモリ)という経路でリード転送して、一旦、FIFOメモリに蓄積する。このため、DMA転送のうち、ROM148からの読み出しについていえば、ROM148の読出速度またはバス(D)140の転送速度で決定され、他のバスの転送速度の影響を受けない。
一方、蓄積後、DMAチャネルCh0は、FIFOメモリから読み出したデータを、DMAチャネルCh0(FIFOメモリ)→マスターポートP1のライトマスターポート→バス(A)110→SRAM118という経路で、データを転送する。このため、当該DMA転送のうち、SRAM118への書き込みについていえば、SRAM118の書込速度またはバス(A)110の転送速度で決定され、他のバスの転送速度の影響を受けない。
When a transfer instruction is given to the DMA channel Ch0 in the state where the transfer path is set in this way, the DMA channel Ch0 sends the data read from the
On the other hand, after accumulation, the DMA channel Ch0 transfers the data read from the FIFO memory through a path of DMA channel Ch0 (FIFO memory) → write master port of the master port P1 → bus (A) 110 →
そして、このような経路によるDMA転送が完了すると(ステップSa17の判別結果が「Yes」になると)、DMAチャネルCh0の割当が解除される(ステップSa18)。これにより、他のDMA転送命令が発行されたとき、DMAチャネルCh0が割当可能となる。 When the DMA transfer through such a path is completed (when the determination result at step Sa17 is “Yes”), the assignment of the DMA channel Ch0 is released (step Sa18). Thereby, when another DMA transfer instruction is issued, the DMA channel Ch0 can be allocated.
次に、本実施形態に係るDMAコントローラ50の優位性について、従来のDMAコントローラと比較して説明する。
Next, the superiority of the
図12は、比較例に係るDMAコントローラを含むシステムの構成を示す図である。図に示されるように、比較例に係るDMAコントローラ52は、1つのバス、この図の例では、バス(C)130のみに接続された構成となっている。このような構成において、DMAコントーラ52を基準とした場合、転送元のバススレーブの位置が遠ければ、それだけリードレイテンシ(遅延)が増加するので、読み出しに係るバスの占有時間が長くなる。同様に、転送先(書込先)のモジュールの位置が遠ければ、それだけライトレイテンシが増加するので、書き込みに係るバスの占有時間が長くなる。バスの占有時間が長くなると、他のバスマスタ(CPU112)のアクセスレイテンシも増加するので、システム全体の効率が低下してしまう。
FIG. 12 is a diagram illustrating a configuration of a system including a DMA controller according to a comparative example. As shown in the figure, the
また、リードの転送性能は、転送元のバススレーブの読出性能と、当該バススレーブが接続されたバスと、DMAコントーラ52が接続されたバスと、途中を経由するバスとのうち、転送性能が最も低いバスに律速されてしまう。同様に、ライトの転送性能は、転送先のバススレーブの書込性能と、当該バススレーブが接続されたバスと、DMAコントーラ52が接続されたバスと、途中を経由するバスとのうち、転送性能が最も低いバスに律速されてしまう。
The read transfer performance includes the read performance of the transfer source bus slave, the transfer performance of the bus to which the bus slave is connected, the bus to which the
例えば、この比較例では、DMAコントローラ52が、ROM148からSRAM118にDMA転送する場合、ROM148(リードポート)→バス(D)140→バスブリッジ34→バス(C)130(→DMAコントローラ52)という経路でデータを読み出す。この経路でのリードの転送性能は、ROM148の読出性能が十分に速い場合、バス(C)130の転送性能が高くても、低い方のバス(D)140の転送性能に律速されてしまう。
同様に、DMAコントローラ52は、(DMAコントローラ52→)バス(C)130→バスブリッジ23→バス(B)120→バスブリッジ12→バス(A)110→SRAM118(ライトポート)という経路で、データを書き込む。この経路でのライトの転送性能は、SRAM118の書込性能が十分に速い場合、バス(A)110、バス(B)120の転送性能が高くても、低い方のバス(C)130の転送性能に律速されてしまう。
For example, in this comparative example, when the
Similarly, the
これに対して、本実施形態に係るDMAコントローラ50は、データの読出経路としては転送元バスのみが用いられ、データの書込経路としては転送先バスのみが用いられるので、リードの転送性能においても、ライトの転送性能においても、他のバスの転送性能に律速されることはない。
これについて、図5で示した経路のDMA転送で説明すると、データの読出経路としては転送元のバス(D)140のみが用いられる。このため、リードの転送性能において、他のバスの転送性能に律速されることはないので、転送元となるバススレーブの転送性能(読出性能)を最大限に引き出すことができる。
同様に、データの書込経路としては転送先のバス(A)110のみが用いられる。このため、ライトの転送性能において、他のバスの転送性能に律速されることはないので、転送先となるバススレーブの転送性能(書込性能)を最大限に引き出すことができる。
このように、本実施形態に係るDMAコントローラ50によれば、4つのバスを有する構成において、転送元バスから転送先バスに最短経路でデータがDMA転送されるので、テータの転送速度を改善することができる。
On the other hand, in the
This will be explained with reference to the DMA transfer of the path shown in FIG. 5. Only the transfer source bus (D) 140 is used as the data read path. Therefore, the read transfer performance is not limited by the transfer performance of other buses, so that the transfer performance (read performance) of the bus slave that is the transfer source can be maximized.
Similarly, only the transfer destination bus (A) 110 is used as a data write path. For this reason, the write transfer performance is not limited by the transfer performance of other buses, so that the transfer performance (write performance) of the bus slave as the transfer destination can be maximized.
As described above, according to the
また、本実施形態に係るDMAコントローラ50では、DMAチャネルCh0〜Ch15を有し、DMA転送に割り当てられた各チャネルにおいてDMA転送が可能であれば(ステップSa14の判別結果が「Yes」であれば)、同時並行してDMA転送が実行される。
In addition, the
例えば、DMAチャネルCh0がROM148からSRAM118にDMA転送している状態において(図5参照)、DMAチャネルCh1に対してメモリ124からSPI142へのDMA転送命令が割り当てられたとき、転送元バスのバス(B)120に接続されたマスターポートP2のリードマスターポートと、転送先バスのバス(D)140に接続されたマスターポートP4のライトマスターポートとがいずれもDMAチャネルCh0によって使用されていないので、当該DMAチャネルCh1に対しては転送指示がなされる。
さらに、DMAチャネルCh0、Ch1がDMA転送している状態において、DMAチャネルCh15に対してサウンド回路132からDRAM122へのDMA転送命令が割り当てられたとき、転送元バスのバス(C)130に接続されたマスターポートP3のリードマスターポートと、転送先バスのバス(B)120に接続されたマスターポートP2のライトマスターポートとがいずれも、DMAチャネルCh0、Ch1によって使用されていないので、当該DMAチャネルCh15に対しては転送指示がなされる。
For example, in a state where the DMA channel Ch0 performs DMA transfer from the
Further, when a DMA transfer command from the
図7は、このようにしてDMAチャネルCh0、Ch1、Ch15がDMA転送している場合におけるデータの転送経路を示す図であり、図8は、DMAコントローラ50におおて設定された転送経路を示す図である。
この図に示されるように、本実施形態では、3つのDMA転送が同時並行で実行されるので、システム全体でみたときの効率を、さらに向上させることができる。
また、図7、図8で示されるように、マスターポートP1のリードマスターポートと、マスターポートP3のライトマスターポートとはいずれも使用されていない。このため、転送元バスをバス(A)110とし、転送先バスをバス(C)130とするDMA転送が他のDMAチャネルによって可能となっている。
FIG. 7 is a diagram showing a data transfer path when DMA channels Ch0, Ch1, and Ch15 are DMA-transferred in this way, and FIG. 8 shows a transfer path set in the
As shown in this figure, in this embodiment, since three DMA transfers are executed simultaneously in parallel, the efficiency as viewed in the entire system can be further improved.
Further, as shown in FIGS. 7 and 8, neither the read master port of the master port P1 nor the write master port of the master port P3 is used. For this reason, DMA transfer using the transfer source bus as the bus (A) 110 and the transfer destination bus as the bus (C) 130 is enabled by other DMA channels.
DMAコントローラ50において、転送元バスと転送先バスとが同一であっても良いのはもちろんである。
図9は、DMAコントローラ50が、転送元バスと転送先バスとが同じバス(D)140である場合におけるデータの転送経路の一例を示す図である。この図の例では、いずれかのDMAチャネルが、ROM148からI2C144にDMA転送する場合に、ROM148(リードポート)→バス(D)140(→DMAコントローラ50)という経路でデータを読み出す一方、(DMAコントローラ50→)バス(D)140→バス(D)140→I2C114(ライトポート)という経路でデータを書き込む。
Of course, in the
FIG. 9 is a diagram illustrating an example of a data transfer path when the
また、DMAコントローラ50において、いずれかのバスブリッジを介して接続された2つのバスのうち、一方のバスのモジュールから、他方のバスのモジュールにDMA転送する場合、当該バスブリッジを介しても良い。
図10は、バスブリッジ23を介して接続されたバス(B)120、バス(C)130において、バス(C)130に属するサウンド回路132から、バス(B)120に属するメモリ122にDMA転送する場合におけるデータの転送経路を示す図である。この図の例では、いずれかのDMAチャネルが、サウンド回路132(リードポート)→バス(C)130→バスブリッジ23→バス(B)120(→DMAコントローラ50)という経路でデータを読み出す一方、(DMAコントローラ50→)バス(B)130→メモリ122(ライトポート)という経路でデータを書き込む。
In addition, in the
FIG. 10 shows DMA transfer from the
なお、この場合に、DMAコントローラ50のマスターポートP2ではなく、図11に示されるように、マスターポートP3を用いても良い。詳細には、同図に示されるように、いずれかのDMAチャネルが、サウンド回路132(リードポート)→バス(C)130(→DMAコントローラ50)という経路でデータを読み出す一方、(DMAコントローラ50→)バス(C)130→バスブリッジ23→バス(B)120→メモリ122(ライトポート)という経路でデータを書き込む。
このように、本説明において、最短経路でデータの転送には、隣り合うバスにわたってバスブリッジを経由する転送を含み得る。
In this case, instead of the master port P2 of the
Thus, in this description, the transfer of data through the shortest path can include a transfer via a bus bridge across adjacent buses.
本発明は、上述した実施形態に限定されるものではなく、例えば次に述べるような各種の応用・変形が可能である。また、次に述べる応用・変形の態様は、任意に選択された一または複数を適宜に組み合わせることもできる。 The present invention is not limited to the above-described embodiments, and various applications and modifications as described below are possible, for example. In addition, one or more arbitrarily selected aspects of application / deformation described below can be appropriately combined.
上述した実施形態では、バス幅については言及していなかったが、バス(A)110、バス(B)120、バス(C)130およびバス(D)140のバス幅については、互いに異なっていても良い。なお、バス幅が異なっている場合のバス幅変換については、DMAコントローラ50(またはバスブリッジ12、23、34)が実行することになる。
また、実施形態では、DMAコントローラ50に接続されたバス数(およびマスターポート数)を「4」としたが、「3」以上であれば良い。3つ以上のバスにおいて、少なくとも2つのバスの転送帯域が異なっていれば良い。
In the above-described embodiment, the bus width is not mentioned, but the bus widths of the bus (A) 110, the bus (B) 120, the bus (C) 130, and the bus (D) 140 are different from each other. Also good. Note that the DMA controller 50 (or the
In the embodiment, the number of buses (and the number of master ports) connected to the
50…DMAコントローラ、110…バス(A)、112…CPU、120…バス(B)、122…DRAM、124…メモリ、130…バス(C)、132…サウンド回路、140…バス(D)、142…SPI、148…ROM、502…転送制御部、504…選択部、512…特定部、514…アドレステーブル。
50 ... DMA controller, 110 ... bus (A), 112 ... CPU, 120 ... bus (B), 122 ... DRAM, 124 ... memory, 130 ... bus (C), 132 ... sound circuit, 140 ... bus (D), 142 ... SPI, 148 ... ROM, 502 ... transfer control unit, 504 ... selection unit, 512 ... identification unit, 514 ... address table.
Claims (7)
少なくとも3つ以上のバスに対応して設けられ、それぞれが対応するバスに接続されるマスターポートと、
前記バスに接続されたモジュールのアドレスを、当該接続されたバスに対応付けて記憶するアドレステーブルと、
当該ソースアドレスのモジュールが属する転送元バスと、当該ディスティネーションアドレスのモジュールが属する転送先バスとを、前記アドレステーブルを参照して特定する特定部と、
前記ソースアドレスから前記ディスティネーションアドレスにデータを転送する経路を、前記転送元バス、前記転送元バスに接続されたマスターポート、前記転送先バスに接続されたマスターポート、および、前記転送先バスに設定する転送制御部と、
を具備することを特徴とするDMAコントローラ。 A DMA controller for transferring data from a source address to a destination address,
A master port provided corresponding to at least three or more buses, each connected to a corresponding bus;
An address table for storing addresses of modules connected to the bus in association with the connected bus;
A specifying unit that specifies a transfer source bus to which the module of the source address belongs and a transfer destination bus to which the module of the destination address belongs by referring to the address table;
A path for transferring data from the source address to the destination address is transferred to the transfer source bus, a master port connected to the transfer source bus, a master port connected to the transfer destination bus, and the transfer destination bus. A transfer control unit to be set;
A DMA controller comprising:
ことを特徴とする請求項1に記載のDMAコントローラ。 2. The master port provided corresponding to the three or more buses, at least two or more of them transfer data to the buses corresponding to each of them in different transfer bands. DMA controller.
ことを特徴とする請求項1または2に記載のDMAコントローラ。 The DMA controller according to claim 1, wherein the three or more buses are connected in series via a bus bridge.
リードマスターポートおよびライトマスターポートの組である、
ことを特徴とする請求項1または2に記載のDMAコントローラ。 The master port is
A set of read master port and write master port,
The DMA controller according to claim 1 or 2, characterized in that
当該転送元バスのリードマスターポートを介してリード転送されたデータが、当該転送先バスのライトマスターポートを介してライト転送される、
ことを特徴とする請求項4に記載のDMAコントローラ。 When the transfer source bus and the transfer destination bus are the same,
Data read-transferred through the read master port of the transfer source bus is write-transferred through the write master port of the transfer destination bus.
The DMA controller according to claim 4.
前記転送先バスが、前記転送元バスに前記バスブリッジを介して接続されたバスである場合、当該転送元バスまたは当該転送先バスのいずれかに対応するマスターポートと、当該バスブリッジとを介してデータが転送される、
ことを特徴とする請求項4に記載のDMAコントローラ。 The three or more buses are connected in series via a bus bridge,
When the transfer destination bus is a bus connected to the transfer source bus via the bus bridge, a master port corresponding to either the transfer source bus or the transfer destination bus and the bus bridge Data is transferred,
The DMA controller according to claim 4.
前記転送制御部は、
前記複数の転送チャネルのうち、一の転送チャネルに、一のソースアドレスから一のディスティネーションアドレスへのデータ転送を割り当てた場合に、
当該一のソースアドレスのモジュールが属する転送元バスに接続されたリードマスターポートと、当該一のディスティネーションアドレスのモジュールが属する転送先バスに接続されたライトマスターポートとを、他の転送チャネルによるデータ転送の経路に設定していなければ、
当該一の転送チャネルに、割り当てたデータ転送を許可する、
ことを特徴とする請求項4、5または6に記載のDMAコントローラ。
A plurality of transfer channels to which data transfer functions are assigned by the transfer control unit;
The transfer control unit
When data transfer from one source address to one destination address is assigned to one transfer channel among the plurality of transfer channels,
Data by another transfer channel is transmitted between the read master port connected to the transfer source bus to which the module with the one source address belongs and the write master port connected to the transfer destination bus to which the module with the one destination address belongs. If it is not set as the transfer route,
Allow the assigned data transfer to the one transfer channel,
The DMA controller according to claim 4, 5 or 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014106365A JP6364951B2 (en) | 2014-05-22 | 2014-05-22 | DMA controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014106365A JP6364951B2 (en) | 2014-05-22 | 2014-05-22 | DMA controller |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015222487A true JP2015222487A (en) | 2015-12-10 |
JP6364951B2 JP6364951B2 (en) | 2018-08-01 |
Family
ID=54785458
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014106365A Expired - Fee Related JP6364951B2 (en) | 2014-05-22 | 2014-05-22 | DMA controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6364951B2 (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11232212A (en) * | 1998-02-09 | 1999-08-27 | Mitsubishi Electric Corp | Bus system |
JP2004213142A (en) * | 2002-12-27 | 2004-07-29 | Renesas Technology Corp | Semiconductor integrated circuit device |
JP2006318139A (en) * | 2005-05-11 | 2006-11-24 | Matsushita Electric Ind Co Ltd | Data transfer device, data transfer method and program |
JP2007299237A (en) * | 2006-04-28 | 2007-11-15 | Toshiba Corp | Information transfer device, and information transfer method |
JP2008165463A (en) * | 2006-12-28 | 2008-07-17 | Sharp Corp | Bus controller |
US20090125648A1 (en) * | 2007-11-14 | 2009-05-14 | Yin-Hsi Huang | Direct memory access system and method |
-
2014
- 2014-05-22 JP JP2014106365A patent/JP6364951B2/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11232212A (en) * | 1998-02-09 | 1999-08-27 | Mitsubishi Electric Corp | Bus system |
JP2004213142A (en) * | 2002-12-27 | 2004-07-29 | Renesas Technology Corp | Semiconductor integrated circuit device |
JP2006318139A (en) * | 2005-05-11 | 2006-11-24 | Matsushita Electric Ind Co Ltd | Data transfer device, data transfer method and program |
JP2007299237A (en) * | 2006-04-28 | 2007-11-15 | Toshiba Corp | Information transfer device, and information transfer method |
JP2008165463A (en) * | 2006-12-28 | 2008-07-17 | Sharp Corp | Bus controller |
US20090125648A1 (en) * | 2007-11-14 | 2009-05-14 | Yin-Hsi Huang | Direct memory access system and method |
Also Published As
Publication number | Publication date |
---|---|
JP6364951B2 (en) | 2018-08-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9426099B2 (en) | Router, method for controlling router, and program | |
JP6880402B2 (en) | Memory access control device and its control method | |
JP2006318139A (en) | Data transfer device, data transfer method and program | |
US9961005B2 (en) | Bus system and computer program | |
US9471521B2 (en) | Communication system for interfacing a plurality of transmission circuits with an interconnection network, and corresponding integrated circuit | |
JP6146128B2 (en) | Data processing device | |
KR20130106392A (en) | Allocation of memory buffers in computing system with multiple memory channels | |
KR20120040535A (en) | Bus system and operating method thereof | |
TWI704488B (en) | Network device, memory system for the network device, and method for operating the network device | |
KR20180030985A (en) | Method and system for USB 2.0 bandwidth reservation | |
JP2016173798A (en) | Semiconductor device | |
US8495268B2 (en) | Card host LSI and set device including the same | |
US9146693B2 (en) | Storage control device, storage system, and storage control method | |
US20120198173A1 (en) | Router and many-core system | |
JP2005084907A (en) | Memory band control unit | |
JP6364951B2 (en) | DMA controller | |
JP4789269B2 (en) | Vector processing apparatus and vector processing method | |
JP2009116702A (en) | Semiconductor integrated circuit | |
JP6611011B2 (en) | Communication input / output device | |
WO2013062109A1 (en) | I/o device control system and method for controlling i/o device | |
KR20110127707A (en) | Memory control device and method for controlling same | |
KR20140076839A (en) | Semiconductor memory system and operating method thereof | |
US9747231B2 (en) | Bus access arbiter and method of bus arbitration | |
JP6978670B2 (en) | Arithmetic processing unit and control method of arithmetic processing unit | |
US7519848B2 (en) | Data transfer apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20170324 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20180209 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20180227 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20180417 |
|
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: 20180605 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20180618 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6364951 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
LAPS | Cancellation because of no payment of annual fees |