JP2004145593A - Direct memory access device, bus arbitration controller, and control method for the same - Google Patents

Direct memory access device, bus arbitration controller, and control method for the same Download PDF

Info

Publication number
JP2004145593A
JP2004145593A JP2002309126A JP2002309126A JP2004145593A JP 2004145593 A JP2004145593 A JP 2004145593A JP 2002309126 A JP2002309126 A JP 2002309126A JP 2002309126 A JP2002309126 A JP 2002309126A JP 2004145593 A JP2004145593 A JP 2004145593A
Authority
JP
Japan
Prior art keywords
bus
transfer
data
cpu
memory access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002309126A
Other languages
Japanese (ja)
Inventor
Makoto Uchida
打田 真
Koichi Kawamura
河村 弘一
Koji Suzuki
鈴木 孝治
Satoshi Akui
阿久井 聡
Takeshi Shimoyama
下山 健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2002309126A priority Critical patent/JP2004145593A/en
Publication of JP2004145593A publication Critical patent/JP2004145593A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a direct memory access (DMA) device that controls transfer of data between devices sharing a bus independently of a CPU, a bus arbitration controller that determines a default bus master from a plurality of bus masters in dependence on bus transfer requests, and a control method therefor. <P>SOLUTION: The DMA device has data buffers 31 of, for example, 16 bytes mounted on input/output devices 14 (14-1/14-2), and data buffers 32 of, for example, 16 bytes mounted on DMA controllers 12 (12-1/12-2). A data size in a source device (the input/output device 14 in this example) and a data size in a destination device (a main memory 13 in this example) are independently controllable, so that the application of different memory access controls to the respective source device and destination device effectively uses a bus band. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、バスを共有するデバイス相互間でのデータの転送を、CPUを介さずに制御するダイレクトメモリアクセス(DMA)装置および複数のバスマスタの各々からバス転送要求に基づいてデフォルトバスマスタを決めるバスアービトレーション制御装置、ならびにそれらの制御方法に関する。
【0002】
【従来の技術】
組み込みシステム(コンピュータシステム)では、大量のデータを入出力装置との間で転送する場合に、CPU(プロセッサ)の負荷を軽減するためや、必要とされるデータ転送速度を保証するためにDMA(ダイレクトメモリアクセス)が用いられる。このDMAの制御を司るコントローラ(以下、DMAコントローラと記す)は、入出力装置と主記憶装置(メインメモリ)との間や1次メモリと2次メモリとの間のデータ転送において、CPUとは独立に、即ちCPUを介さずに直接データのやり取り(受け渡し)を行うことによってCPUの負荷の軽減を図っている。
【0003】
DMAは、ハードディスク装置などバンド幅の大きな入出力装置との間で大きなデータ転送数を転送処理ために用いられている。このほかにも組み込みシステムにおいては、そのリアルタイム性を確保するためにDMAを利用することができる。近年はLSIの高機能化に伴い、システム内でのCPUの負荷が高まっているのに加えて、USB(Universal Serial Bus)など転送速度の速い入出力装置に対応するため、また従来から搭載されているUART(Universal Asynchronous Receiver/Transmitter)デバイスなども高速化されているため、それら入出力装置とのデータ転送にはDMAコントローラが使われている。
【0004】
組み込みシステムには、複数のDMAコントローラが実装されている場合がほとんどである。そして、それぞれのDMAコントローラが独立にデータ転送を行う。また、組み込みシステムの場合は、そのリアルタイム性を確保するために、それぞれのDMAコントローラ(バスマスタ)がデータバスを占有する時間を極力短くすることが必要とされる。
【0005】
従来、DMAコントローラでは、転送元デバイスへのアクセス方法と転送先デバイスへのアクセス方法とをそれぞれ独立に制御できない方式が採用されていた(例えば、特許文献1)。このようなDMAコントローラでは、1回のバスアクセスで転送可能なデータサイズ(バス幅)が転送元もしくは転送先デバイスのデータサイズ(バス幅)に設定され、また転送方式もそのデバイスの特性に合わせて設定されていた。
【0006】
【特許文献1】
特許第320601号明細書
【0007】
【発明が解決しようとする課題】
しかしながら、転送元デバイスへのアクセス方法と転送先デバイスへのアクセス方法とをそれぞれ独立に制御できない方式を採る従来のDMAコントローラでは、バス帯域の利用が制限されてしまうことや、転送元もしくは転送先のデバイスのデータ転送特性を引き出せないなどの理由により、十分なデータ転送速度を保証できない場合がある。
【0008】
また、転送先もしくは転送元のデバイスによって転送バス幅(データサイズ)が限定されてしまうことにより、DMAコントローラにおけるデータ転送(バスアクセス)の回数も増加する。この結果、システム内のバスを占有する時間が増大し、高速入出力装置からのデータ転送要求に対する応答性を十分に確保できなかったり、あるいはCPUもしくは他のDMAデバイスにおけるリアルタイム性にも影響を与えてしまうことになる。
【0009】
本発明は、上記課題に鑑みてなされたものであり、その目的とするところは、十分なデータ転送速度を保証できるとともに、システムバスの占有時間の削減を可能としたダイレクトメモリアクセス装置および複数のバスマスタの各々からバス転送要求に基づいてデフォルトバスマスタを決めるバスアービトレーション制御装置、ならびにそれらの制御方法を提供することにある。
【0010】
【課題を解決するための手段】
上記目的を達成するために、本願の第1発明では、バスを共有するデバイス相互間でのデータの転送を、CPUを介さずに制御するダイレクトメモリアクセス装置において、ダイレクトメモリアクセス(DMA)の対象となる転送元デバイスのデータサイズと転送先デバイスのデータサイズとを独立に制御可能なデータ転送方式を採用することを特徴としている。
【0011】
このデータ転送方式を採ることにより、転送元デバイスと転送先デバイスとに対してそれぞれ異なったメモリアクセス制御を適用してバス帯域を有効に利用することができるため、一つのDMAコントローラがバスを占有する時間を大幅に減少させることができる。その結果、他のバスマスタがバス認可される機会が増加する。これはシステムバス全体の効率が向上したことを意味する。
【0012】
本願の第2発明では、バスを共有するメモリと特定の転送ブロックサイズを持つ周辺デバイスとの間でのデータの転送を、CPUを介さずに制御するDMAコントローラを備えたダイレクトメモリアクセス装置において、上記転送ブロックサイズで繰り返しデータ転送を行う際のハンドシェイク操作をDMAコントローラによって行うことを特徴としている。
【0013】
ブロックサイズDMA転送において、CPUの割り込みに相当するハンドシェイク操作をDMAコントローラ側で行うことで、DMA転送を行う際のCPUの負荷を軽減できるため、アプリケーションを動作させる際にシステム全体の高速化を図ることができ、またCPUは他の処理に専念できることになる。
【0014】
本願の第3発明では、複数のバスインターフェイスを持つCPUを含む複数のバスマスタと、これら複数のバスマスタが共通に接続された共有バスとを備え、複数のバスマスタの各々からバス転送要求に基づいてデフォルトバスマスタを決める複数のバスマスタの各々からバス転送要求に基づいてデフォルトバスマスタを決めるバスアービトレーション制御装置において、複数のバスマスタの全てからバス転送要求がない期間ではCPUの複数のバスインターフェイスの中で最も最近にバス転送を行ったバスインターフェイスをデフォルトバスマスタに決定することを特徴としている。
【0015】
CPUが決められた期間になるべく多くの仕事をこなすことを考慮し、全てのバスマスタからのバス転送要求がない期間、即ちアイドル状態の期間では、CPUのバスインターフェイスの中で最も最近にバス転送を行ったバスインターフェイスをデフォルトバスマスタに決定することで、即座にバス転送を開始できるため、アービトレーションによるハンドオーバーサイクルが発生しない。
【0016】
【発明の実施の形態】
以下、本発明の実施の形態について図面を参照して詳細に説明する。図1は、本発明が適用される組み込みシステム(コンピュータシステム)の構成例を示すブロック図である。
【0017】
図1から明らかなように、本構成例に係る組み込みシステムは、1つのCPU(マイクロプロセッサ)11、複数個(例えば、2個)のDMAコントローラ12A,12B、オンチップのメインメモリ13、DMAコントローラ12−1,12−2に対応した2つの入出力(I/O)デバイス14−1,14−2および外部バスインターフェイス(I/F)15がシステムバス16を介して相互に接続されてなる回路ブロック10と、この回路ブロック10のチップ外において外部バス21を介して外部バスインターフェイス15に接続されたDRAM21およびフラッシュ(FLASH)メモリ22を有する構成となっている。
【0018】
上記構成の組み込みシステムにおいて、システムバス16の幅を例えば32ビットする。このシステムバス16に対して入出力デバイス14−1,14−2は8ビット幅で接続されている。CPU11はシステム全体の制御を司る。DMAコントローラ12−1,12−2は、入出力デバイス14−1,14−2とメインメモリ12との間や、DRAM22とフラッシュメモリ23との間のデータ転送において、CPU11を介在させないことによって当該CPU11の負荷を軽減する働きをする。
【0019】
通常、DMAコントローラ12−1,12−2は、CPU11など他のバスマスタとシステムバス16を共有する。そのシステムバス16の占有権は、バスアービタ(バスアービトレーション制御装置)17によって決定される。このバスアービタ17の具体的な機能については後で詳細に説明する。入出力デバイス14−1,14−2の各々からはDMAコントローラ12−1,12−2の各々に対して独立にデータ転送要求のための制御信号Reqが送られ、逆にDMAコントローラ12−1,12−2の各々からは入出力デバイス14−1,14−2の各々に対して独立に制御信号Reqに対する応答のための制御信号Ackが返される。
【0020】
DMAコントローラ12−1,12−2は、CPU11または各入出力デバイス14−1,14−2からのデータ転送要求に対して、バスアービタ17にバス占有権の問い合わせ(Request)を行い、それが認可(Grant)されることにより、システムバス16を通じてデータ転送を行う。DMAコントローラ12−1,12−2によるデータ転送は、まず転送元デバイスからデータを受け取り(データリード)、この受け取ったデータを転送先デバイスへ送る(データライト)ことによって行われる。本構成例のように、転送元および転送先となるデバイスが同一のバス階層に存在する場合は、基本的に、DMAコントローラ12−1,12−2は、図2に示すように、データリードとデータライトを順番に行うことによってデータ転送を完了する。
【0021】
なお、本構成例に係る組み込みシステムにおいては、2個の入出力デバイス14−1,14−2に対応して2個のDMAコントローラ12−1,12−2を実装した例を挙げたが、これは一例に過ぎず、3個以上の入出力デバイスに対応して3個以上のDMAコントローラを実装しても良いことは勿論である。近年、LSIの高機能化に伴い、10個程度、あるいはそれ以上DMAコントローラを実装しているのが現状である。
【0022】
このように、10個程度、あるいはそれ以上DMAコントローラを実装した組み込みシステムを内蔵するシングルチップマイクロコンピュータ(LSI)は、例えばPDA(Personal Digital Assistants)に代表される携帯情報端末に搭載されて用いられる。携帯情報端末に搭載して用いた場合、複数のDMAコントローラに対応した複数の入出力デバイスにはその周辺機器としてメモリスティックやUSBなどが接続されることになる。
【0023】
ところで、最近の入出力デバイスは、外部通信装置との間でのデータ転送速度を向上させるために、データバッファをデバイス内に実装している場合が多い。このような入出力デバイスとのデータ転送を効率的に行うためには、DMAコントローラ12−1,12−2は、それぞれの装置の特性を考慮したデータアクセスを行うことが重要である。そのため、DMAコントローラ12−1,12−2の各々は、必要なサイズのデータバッファを実装している。DMAコントローラ12−1,12−2に実装するデータバッファが大きいほどデータ転送速度を向上できる効果もある。また、データバッファのサイズを決定するときは領域に対するインパクトもあわせて考慮する必要がある。
【0024】
本構成例に係る組み込みシステムでは、図3に示すように、入出力デバイス14(14−1/14−2)側に例えば16バイトのデータバッファ31を、DMAコントローラ12(12−1/12−2)に例えば16バイトのデータバッファ32をそれぞれ実装しているものとする。そして、ここでは、例えば入出力デバイス14からメインメモリ13へデータ転送を行うことを前提とする。なお、DMAコントローラ12はデータバッファ32の他に、転送コントロール回路33およびバスI/F34を内蔵している。
【0025】
このシステム構成では、入出力デバイス14として、例えばUART(16C550など)デバイスが用いられる。入出力デバイス14は、適切なデータ転送要求をDMAコントローラ12に通知することにより、最大16バイト単位のバースト転送に対応可能となる。ここに、バースト転送とは、バスサイクルの連続使用で、複数のバイトデータをまとめて転送することである。DMAコントローラ12側にも同様に16バイトのデータバッファ32が実装されているため、データ転送の際に16バイト単位でバースト転送を行うことができる。
【0026】
ここで、入出力デバイス14側のデータサイズが8ビット幅であるのに対してシステムバス16のバス幅は32ビットであることから、このデータ転送ではデータライト時にバス幅が十分活用されないことになる。また、従来のDMAコントローラの場合には、転送元デバイスのデータサイズ(リードデータサイズ)と転送先デバイスのデータサイズ(ライトデータサイズ)とをそれぞれ独立に制御できない転送方式であるため、図4(A)に示すように、システムバス上にデータリード、データライト合わせて32回のデータ転送サイクルが発生することになる。
【0027】
[第1実施形態]
これらの点に鑑みてなされたのが、以下に説明する本発明の第1実施形態に係るDMA装置である。
【0028】
本実施形態に係るDMA装置においては、転送元デバイス(本例では、入出力デバイス14)のデータサイズと、転送先デバイス(本例では、メインメモリ13)のデータサイズとをそれぞれ独立に制御可能なデータ転送方式を採用するようにしたことを特徴としている。このデータ転送方式を採用することにより、転送元デバイスと転送先デバイスとに対してそれぞれ異なったメモリアクセス制御を適用してバス帯域を有効に利用することができるため、一つのDMAコントローラがシステムバス16を占有する時間を大幅に減少させることができる。
【0029】
このデータ転送方式は、DMAコントローラ12のバス制御情報を、転送元アクセスと転送先アクセスとに分割してソフトウエアで設定できるようにすることによって実現できる。一例として、転送元デバイスのデータサイズを8ビット、転送先デバイスへのデータ転送(ライトデータ)サイズを32ビットに設定することにより、図4(B)に示すように、書き込み転送のために生じるシステムバス16の占有時間を8DMA転送サイクル分だけ削減できるため、データライト時のバスアクセスを大幅に減少させることができる(データの統合化)。
【0030】
このように、転送元デバイスのデータサイズと転送先デバイスのデータサイズとを独立に制御できる転送方式を採用することにより、一つのDMAコントローラがシステムバスを占有する時間が減少するため、他のバスマスタ(CPU、DMAコントローラ等)がバス認可される機会が増加する。これはシステムバス全体の効率が向上したことを意味する。データサイズの設定は柔軟に行うことができ、転送元デバイスのデータサイズと転送先デバイスのデータサイズは、DMAコントローラ12に実装するデータバッファ32のサイズ(本例では、16バイト)に収まる条件で設定が可能となる。
【0031】
データ転送においては、データサイズだけではなくデータの転送タイプも考慮することによりその効率の向上を図ることができる。組み込みシステム内にはさまざまなバススレーブデバイスが接続されている。さらに、外部には外部バスインターフェイス15を介してDRAM22やフラッシュメモリ23などのメモリデバイスが接続されている。これらメモリデバイスの中にも、データ転送速度を確保するためにバースト転送を採用するものが多くある。
【0032】
また、デバイス内部にもDRAMなどを実装し、一部データバス幅を広げるなどしてデータ転送レートの向上を図る場合がある。これらのデバイスに対してはそれぞれの特性に合わせた転送タイプのデータ転送、即ちバースト転送を適切に行うことによりデータ転送効率の向上を図ることが可能である。また、バス幅が狭いデバイスに対しても、図5に示すように、バースト転送を複数回に分割して実行することが可能な仕様としている。このようなバースト転送の分割についても、設定された転送データサイズの組み合わせによってDMAコントローラ12内部で自動的に処理を行うようにしている(データの分散化)。
【0033】
このようなデータの分散化による転送方式を採用した場合は、総データ転送数(転送ブロックの総データサイズ)によっては転送タイプ、データサイズの組み合わせによって転送の終わり(転送ブロックの終わり)にデータの余り(端数)が生じることもある。そのような場合には、可能な限りは設定転送タイプでのデータ転送を継続し、最終的に余り(端数)のみ最小データサイズ(本例では、8bit)および最小転送タイプ(単一データ転送)に自動的に切り替えて最終データまでの転送を完了させるようにする。
【0034】
具体的には、図6に示すように、データサイズ32bit、4バースト転送、最終データブロック15バイト(端数3バイト)の場合を例に挙げると、端数分の3バイトの転送は自動的にデータサイズ8bitに切り替えて転送を完了させるようにする。このような端数分の処理に関してソフトウエアで特別な意識を必要としない設計となっている。
【0035】
この他にも転送元と転送先で異なるバイト配列(エンディアン)が用いられている場合でも、転送元および転送先にバイト配列の情報を付加して制御を行うことにより対応が可能である。
【0036】
上述したように、第1実施形態に係るDMA装置では、組み込みシステムの限られたバス帯域を有効に利用して、DMAによるデータ転送の効率を高めるために、従来のデータ転送の方式を見直し、転送元データ転送(データリード)と転送先データ転送(データライト)との制御において、転送データサイズおよび転送タイプを独立に設定可能とし、転送元デバイスと転送先デバイスとにそれぞれ異なったメモリアクセス制御を適用することにより、同一システム内でバス幅の異なる入出力デバイス間のデータ転送(例えば、UART−メインメモリなど)においてシステムバス16の利用効率を高めることが可能になる。
【0037】
これは即、DMAコントローラ12によるデータ転送効率、即ちデータ転送速度の向上につながる。また、DMAコントローラ12によるバス占有の要求回数が減少するため、システム内のバスアービタ17によるバス調停の回数も減少する。このことはシステムバス16の信号変化の抑制につながり、それに伴って消費電力の低減を図ることも可能になる。
【0038】
多くのDMAコントローラおよび他のバスマスタが実装されるシステムにおいては、一つのバスマスタが要求するシステムバスの占有時間は他のバスマスタの応答性にも影響を与えることになる。特に、組み込みシステムの場合はリアルタイム性が重要視されており、DMAコントローラなどによるシステムバスの占有時間の削減はそのシステム(CPU)のリアルタイム性を悪化させないという効果もある。
【0039】
また、総転送データ数と転送タイプの組み合わせによって転送の終わりに生じるデータの余り(端数)についても、最小データサイズ(本例では、8bit)および最小転送タイプに自動的に切り替えて最終データまでの転送を完了することにより、データの余り(端数)に対してソフトウエアによる特別な注意は不要となるため、CPU11の負荷の削減にもつながる。
【0040】
ところで、特定の転送ブロックサイズ(例えば、バッファメモリサイズやパケットサイズなど)を持つ周辺デバイス(ここでは、入出力デバイス14−1,14−2を例に挙げる)14とメインメモリ13との間でDMA転送を行う際、周辺デバイス14の転送ブロックサイズに相当するデータの転送が完了する度に、DMAコントローラ12は停止する。このとき、CPU11に対して割り込みが発生し、CPU11はこの割り込みを受け、適切な対処を行って再びDMA転送を開始する指示を出すなど、CPU11側のソフトウエア処理によるハンドシェイクが必要である。
【0041】
具体的には、図7に示すように、周辺デバイス14からの転送要求信号に応じてCPU11に転送終了の割り込みが発生し、この割り込みを受けてCPU11は、DMAコントローラ12に対してDMA転送の再開処理、即ち転送開始指示を送る。このように、CPU11は割り込みルーチンにてDMAコントローラ12の転送再開処理を行うことにより、全データの転送に時間がかかるばかりでなく、CPU11が実行する他の処理を圧迫し、結果として、アプリケーション全体の速度低下を招くことになる。
【0042】
また、ブロックサイズ転送を繰り返し、所望のデータ量の転送が完了した後、再び前回設定したメインメモリ13の転送元先頭アドレスから、同様のDMA転送を行いたい場合がある。この場合、DMAコントローラ12に対して、CPU11からアドレスなどの条件を再設定する必要である。
【0043】
[第2実施形態]
これらの点に鑑みてなされたのが、以下に説明する本発明の第2実施形態に係るDMA装置である。
【0044】
図8は、本実施形態に係るDMA装置のシステムの構成例を示すブロック図であり、図中、図1と同等部分には同一符号を付して示している。ここでは、図1の入出力デバイス14−1,14−2を周辺デバイス14として示している。
【0045】
図8において、DMAコントローラ12は、データの転送量を数える計数手段である例えばカウンタ41、周辺デバイス14の転送ブロックサイズのデータを保存する記憶手段(領域)である例えばレジスタ42、ソースアドレスポインタ43およびデスティネーションアドレスポインタ44を内蔵している。そして、本実施形態に係るDMA装置では、周辺デバイス14からの転送要求信号をDMAコントローラ12に対して直接与える構成を採っている。
【0046】
次に、上記構成の第2実施形態に係るDMA装置におけるデータ転送(DMA転送)について説明する。
【0047】
(周辺デバイスとのハンドシェイク)
まず、CPU11からDMAコントローラ12に対して、周辺デバイス14の転送ブロックサイズを通知する。すると、DMAコントローラ12は、通知された転送ブロックサイズをレジスタ42などの記憶装置に保存する。なお、この周辺デバイス14の転送ブロックサイズについては、固定値としてDMAコントローラ12があらかじめ知っておく、即ちレジスタ42などの記憶装置にその値をあらかじめ格納しておくようにしても良い。
【0048】
CPU11から転送開始指示があると、これを受けてDMAコントローラ12は、システムバス16などのデータ経路を通して、周辺デバイス14とメインメモリ13との間でデータの転送を開始する。そして、データ転送の期間では、DMAコントローラ12は、カウンタ41で転送データ数をカウントし、そのカウントした転送データ数をレジスタ42の格納値、即ち転送ブロックサイズと比較する。そして、比較結果が一致、即ち周辺デバイス14の転送ブロックサイズ分のデータの転送が完了したことを知ると、DMAコントローラ12は自動的に転送を一旦中止し、周辺デバイス14からの転送要求を待つ。
【0049】
周辺デバイス14側で再び転送可能な状態になると、周辺デバイス14はDMAコントローラ12に対して転送要求信号を出す。これを受けてDMAコントローラ12は、カウンタ41をクリアしてデータの転送を再開する。この動作を繰り返すことで、DMAコントローラ12はCPU11を介在させることなく、すべてのデータの転送を完了することができる。
【0050】
(アドレスのループ)
図9は、メインメモリ13から周辺デバイス14へデータ転送を行う場合における転送アドレスポインタ内容の変化の一例を示す図である。この例では、メインメモリ13から周辺デバイス14へのデータ転送であるので、図8のDMAコントローラ12において、メインメモリ13の転送アドレスがソースアドレスポインタ43で、周辺デバイス14の転送アドレスがデスティネーションアドレスポインタ44でそれぞれ管理されることになる。
【0051】
ここでは、周辺デバイス14の転送サイズを0x100としている。メインメモリ13側の転送アドレスポインタ、即ちソースアドレスポインタ43は0x1000から始まって0x10ffまで進み、周辺デバイス14の転送アドレスポインタ、即ちデスティネーションアドレスポインタ44は0x8000から0x80ffまで進み、このメモリ領域のデータが順次、DMAコントローラ12によってメインメモリ13から読み出され、周辺デバイス14に書き込まれる。
【0052】
転送ブロックサイズ分(0x100)のデータの転送が終わると、メインメモリ13側のソースアドレスポインタ43は0x1100であるが、周辺デバイス14側は再び0x8000から使用するため、周辺デバイス14側のデスティネーションアドレスポインタ44を0x8000に戻す。転送量が周辺デバイス14の転送ブロックサイズに達すると、DMAコントローラ12はデータの転送を一時停止し、周辺デバイス14が再び転送可能になったことをDMAコントローラ12に通知するための転送要求信号を、DMAコントローラ12が周辺デバイス14から受け取るまで待機する。
【0053】
転送要求信号を受け取ったら、DMAコントローラ12において、メインメモリ13側のソースアドレスポインタ43は0x1100から、周辺デバイス14側のデスティネーションアドレスポインタ44は0x8000からデータの転送を再開する。つまり、メインメモリ13側はソースアドレスポインタ43を連続して増加させるが、周辺デバイス14側はデスティネーションアドレスポインタ44をループさせる。以降、アプリケーションが要求する全てのデータの転送が完了するまで、上述した一連の処理を繰り返す。
【0054】
このように、DMAコントローラ12は、周辺デバイス14側の転送アドレスポインタ、即ちデスティネーションアドレスポインタ44を転送サイズ(本例では、0x8000〜0x80ff)でループさせるとともに、ブロックサイズの転送が完了する度に自動的に転送再開を待機することにより、CPU11を介在させることなくすべてのデータの転送を完了することができる。
【0055】
図10は、周辺デバイス14からメインメモリ13へデータ転送を行う場合における転送アドレスポインタ内容の変化の一例を示す図である。この場合も基本的に、メインメモリ13から周辺デバイス14へデータ転送を行う場合(図9を参照)における動作と同様の動作となる。
【0056】
なお、周辺デバイス14の仕様によっては、DMAコントローラ12が読み書きするアドレスは固定であり、1つのアドレスに対して転送ブロックサイズ分のデータを読み書きすることで、上記の例と同様のデータ転送を行うことができる場合もある。この場合には、周辺デバイス14側の転送アドレスポインタはループではなく固定で構わない。
【0057】
(リロード機能)
上述した一連のブロックサイズ転送を繰り返し、所望のデータ量の転送が完了した後、再び先に設定したメインメモリ13の転送元先頭アドレスから、同様のDMA転送を行いたい場合がある。そこで、本実施形態に係るDMA装置では、DMA転送の際のCPU11からの一連の設定を再現するリロード機能をDMAコントローラ12に対して持たせた構成を採っている。
【0058】
このように、DMAコントローラ12にリロード機能を持たせることにより、CPU11からDMAコントローラ12に対して単純な再設定の指示を与えるだけで、前回設定した設定値を復元することができるため、CPU11の負荷を軽減できる。このリロード機能については、DMAコントローラ12において、特定のアドレスにマッピングされたレジスタを設け、当該レジスタの特定のビットをCPU11から操作するなどの方法によって実現できる。CPU11からの明示的な指示でリロードされるため、リロードするか否かはCPU11のユーザプログラムにより動的に決定可能である。
【0059】
上述したように、第2実施形態に係るDMA装置では、周辺デバイス14が特定の転送ブロックサイズ(例えば、バッファメモリサイズやパケットサイズ)を持ち、その転送ブロックサイズで繰り返してデータ転送を行う際に、CPU11によるハンドシェイク操作を、周辺デバイス14の転送ブロックサイズを保存するための記憶領域(レジスタ42)と、転送量を数えるカウンタ41とを持つDMAコントローラ12側で行うことで、従来CPU11が行っていたソフトウエア処理を、DMAコントローラ12によってハードウェアにて自動的に処理できる。これにより、DMA転送を行う際のCPU11の負荷を軽減できるため、アプリケーションを動作させる際にシステム全体の高速化を図ることができる。
【0060】
図11は、従来のDMAコントローラを備えたDMA装置と、本実施形態によるブロックDMA転送機能を有するDMAコントローラを備えたDMA装置について、一定の量のデータを転送するのに要する時間(DMA転送の速度)の比較結果を示す模式図である。
【0061】
従来のDMA転送では、周辺デバイス14からの転送要求信号に応じてCPU11に割り込みが発生し、この割り込みによってCPU11は割り込みルーチンにてDMAコントローラ12の転送再開処理を行うため、全データの転送に時間がかかるばかりでなく、CPU11が実行する他の処理を圧迫し、結果として、アプリケーション全体の速度低下を招くことになっていた。これに対して、ブロックサイズDMA転送では、CPU11の割り込みに相当する処理をDMAコントローラ12側でハードウェアにて処理するため、ブロックサイズ単位のオーバーヘッドもなく、CPU11も他の処理に専念できることになる。
【0062】
また、アプリケーションの動作中に、CPU11が一連の設定を行うモジュール(本例では、DMAコントローラ12)に対して、CPU11から繰り返して同様の設定を行う必要がある場合、例えば動作中に設定値が変化する場合、二度目以降は一度目と同様に設定を再現する機能、即ちリロード機能を当該モジュール側が備えることで、CPU11による再設定の手順を省き、CPU11からは単純な指示を当該モジュールへ与えるだけで済むため、CPU11の負荷を軽減できる。例えば、データ転送の完了後に、DMAコントローラ12に対してアドレスなどの再設定が必要な場合においても、DMAコントローラ12がリロード機能を持つことで、簡単な操作で設定を復元でき、または復元せずにその時点のアドレス値から継続してデータを転送することも可能である。
【0063】
ここまでは、DMA装置について2つの実施形態を例に挙げて説明してきた。以下では、共有バスであるシステムバス16に対する複数のバスマスタ(CPU11やDMAコントローラ12−1,12−2など)のアービトレーションを行うバスアービタ(バスアービトレーション制御装置)17について説明する。
【0064】
アービトレーション方法として、各バスマスタに優先順位を付け、バス転送を要求しているバスマスタの中で最も優先順位の高いバスマスタにバス使用権(バス占有権)を与える方法がある。また、どのバスマスタからもバス使用要求がないとき(アイドル状態のとき)は、決められた1つのデフォルトバスマスタにバス使用権を与えるようにしている。
【0065】
デフォルトバスマスタを選択する際には、最もバス転送要求をするであろうバスマスタをデフォルトバスマスタに選択するのが有利である。その理由は、共有バスがアイドル状態であるときにバスマスタがバス転送要求をした際に、そのバスマスタがデフォルトバスマスタであればバスアービタ17におけるオーバーヘッドが低減され、結果的にバス効率が増すからである。
【0066】
デフォルトバスマスタの決定方法としては、
▲1▼共有バスがアイドル状態になる直前にバス転送を行ったバスマスタをデフォルトバスマスタにする方法(例えば、特開平5−250311号公報参照)
▲2▼共有バス上で過去数回のバス転送のうち最も多くのバス転送を行ったバスマスタをデフォルトバスマスタにする方法(例えば、特開2000−35443号公報参照)
などがある。
【0067】
しかしながら、決定方法▲1▼では、アイドル状態直前にバス転送を行ったバスマスタがバス転送要求頻度の低いバスマスタである場合、次にバス転送要求頻度の高い別のバスマスタが転送要求を行う可能性が高い。また、決定方法▲2▼では、CPU11、DMAコントローラ12−1,12−2など、すべてのバスマスタを対象として過去の数回の転送履歴を記憶しておき、その転送履歴を基に判断することになるので、多くのバスマスタを含む組み込みシステムにおいては論理の複雑化が予想される。
【0068】
[第3実施形態]
これらの点に鑑みてなされたのが、以下に説明する本発明の第3実施形態に係るバスアービトレーションアーキテクチャである。
【0069】
図12は、本実施形態に係るバスアービトレーションアーキテクチャが適用されるDMA装置のシステムの構成例を示すブロック図であり、図中、図1と同等部分には同一符号を付して示している。ここでは、複数のバスマスタとして、CPU(マイクロプロセッサ)11および2つのDMAコントローラ12−1,12−2を例に挙げ、DMAコントローラ12−1,12−2についてはバスマスタ12−1,12−2として示している。
【0070】
図12に示すように、CPU11はバスマスタとなる複数のバスインターフェイス、例えば2つのバスインターフェイス111,112を持っている。したがって、本構成例に係る組み込みシステムにおいては、2つのバスインターフェイス111,112と、その他のバスマスタ、例えば2つのDMAコントローラ12−1,12−2との合計4つのバスマスタが1つのシステムバス16を共有することになる。
【0071】
バスアービタ17は、システムバス(共有バス)16でのデータ衝突が起こらないように、バス転送を行うバスマスタが常に1つであるように制御(バスアービトレーション)を行う。すなわち、バスマスタの各々がバスアービタ17に対してバス転送要求REQを出し、これを受けてバスアービタ17が各バスマスタに対してバス転送許可GRNTを与える、というアービトレーションハンドオーバーがバスインターフェイス111,112およびバスマスタ12−1,12−2の各々とバスアービタ17との間で起こる。
【0072】
図13は、バスアービタ17の具体的な構成例を示すブロック図である。図13から明らかなように、本構成例に係るバスアービタ17は、バスマスタの各々から入力されるバス転送要求REQ#1〜#4によって優先順位を決め、バス転送許可GRNT#1〜#4を出力するラウンドロビン制御回路171と、バス転送許可GRNT#1,#2に基づいてデフォルトバスマスタを決定するプリグラント制御回路172とを有する構成となっている。
【0073】
上記構成のバスアービタ17において、バスマスタの各々からラウンドロビン制御回路171にバス転送要求REQ#1〜#4が入力され、当該バス転送要求REQ#1〜#4によってラウンドロビン制御回路171で優先順位が決められると、その優先順位により適応するバス転送許可GRNT#1〜#4がアクティブとなる。このとき、バス転送許可GRNT#1〜#4のうち、CPU11のバスインターフェイス111,112のバス転送許可GRANT#1,#2の値のみをプリグラント制御回路172に入力する。
【0074】
ここで、バス転送許可GRNT#1〜#4のうち、バス転送許可GRANT#1,#2の値のみをプリグラント制御回路172に入力するということは、CPU11のバスインターフェイス111,112を他のバスマスタに優先してデフォルトバスマスタとして決定することを意味する。これは、CPU11が決められた期間になるべく多くの仕事をこなすことを考えた上でのことである。バス転送許可GRANT#1,#2がプリグラント制御回路172に入力されると、当該プリグラント制御回路172では、バス転送許可GRANT#1,#2の値から、バスインターフェイス111とバスインターフェイス112のどちらがデフォルトバスマスタとなるか決定される。
【0075】
図14は、プリグラント制御回路172の具体的な構成例を示すブロック図である。図14から明らかなように、本構成例に係るプリグラント制御回路172は、バス転送許可GRANT#1,#2の値からバスインターフェイス111,112のどちらがバス転送を行うかを判断するバス転送判断回路1711と、このバス転送判断回路1711の判断結果を次にどちらかのバス転送が起こるまで記憶保持する記憶回路1722とを有する構成となっている。
【0076】
上記構成のプリグラント制御回路172において、バス転送判断回路1711は、ラウンドロビン制御回路171で決められた優先順位に対応したバス転送許可GRNT#1,#2の値から、バスインターフェイス111とバスインターフェイス112のどちらでバス転送を行うかを判断する。この判断結果は、次にバスインターフェイス111,112のどちらかのバス転送が起こるまで記憶回路1722に記憶される。その結果、記憶回路1722に記憶保持されている判断結果に対応するバスマスタが最も最近にバス転送を行ったバスマスタとなる。
【0077】
ここで、CPU11のバスインターフェイス111,112の中で最も最近にバス転送を行ったものをデフォルトバスマスタに決定するのは、最も最近にバス転送を行った方がまたバス転送要求を行うであろうという予測の上にたってのことである。そして、記憶回路1722に記憶保持された判断結果は、デフォルトバスマスタ情報DEFとしてラウンドロビン制御回路171に供給される。すると、ラウンドロビン制御回路171は、バスインターフェイス111,112のうちのデフォルトバスマスタ情報DEFで指定されたバスマスタ、即ち最も最近にバス転送を行ったバスマスタをデフォルトバスマスタに決定する。
【0078】
次のバス転送を要求するバスマスタがいなくアイドル状態の期間、即ち全てのバスマスタからのバス転送要求がない期間では、記憶回路1722に記憶保持されている判断結果(デフォルトバスマスタ情報DEF)に対応するバス転送許可GRNTがアクティブとなる。その後、最初にバス転送を要求するバスマスタがデフォルトバスマスタである場合、バス転送許可GRNTがアクティブであるため即座にバス転送を開始でき、アービトレーションによるハンドオーバーサイクルは発生しない。
【0079】
上述したように、第3実施形態に係るバスアービタ17においては、CPU11が決められた期間になるべく多くの仕事をこなすことを考慮し、全てのバスマスタからのバス転送要求がない期間では、CPU11のバスインターフェイス111,112の中で最も最近にバス転送を行ったバスインターフェイスをデフォルトバスマスタに決定することにより、即座にバス転送を開始できるため、アービトレーションによるハンドオーバーサイクルが発生せず、CPU11のバス転送要求時のバスハンドオーバーサイクルを低減できる。
【0080】
また、CPU11がバスマスタとなるバスインターフェイスを複数個(本例では、2つ)持っている場合のデフォルトバスマスタ決定アーキテクチャによって次バスマスタを予測することにより、即座にバス転送を開始できるため、アービトレーションによるハンドオーバーサイクルが発生せず、CPU11のバス転送時のバスハンドオーバーサイクルを低減できる。
【0081】
【発明の効果】
以上説明したように、本発明によれば、DMAの対象となる転送元デバイスのデータサイズと転送先デバイスのデータサイズとを独立に制御可能なデータ転送方式を採用することにより、転送元デバイスと転送先デバイスとに対してそれぞれ異なったメモリアクセス制御を適用してバス帯域を有効に利用することができるため、十分なデータ転送速度を保証できるとともに、システムバスの占有時間を削減できる。
【0082】
また、ブロックサイズDMA転送において、CPUの割り込みに相当するハンドシェイク操作をDMAコントローラ側で行うことで、DMA転送を行う際のCPUの負荷を軽減できるため、アプリケーションを動作させる際にシステム全体の高速化を図ることができる。さらに、全てのバスマスタからのバス転送要求がない期間では、CPUのバスインターフェイスの中で最も最近にバス転送を行ったバスインターフェイスをデフォルトバスマスタに決定することにより、即座にバス転送を開始できるため、CPUのバス転送要求時のバスハンドオーバーサイクルを低減できる。
【図面の簡単な説明】
【図1】本発明が適用される組み込みシステム(コンピュータシステム)の構成例を示すブロック図である。
【図2】DMAコントローラの基本転送のサイクルを示す図である。
【図3】本発明の第1実施形態に係るDMA装置における要部の構成例を示すブロック図である。
【図4】データリードサイクルおよびデータライトサイクルを示す図であり、(A)は転送元データサイズと転送先データサイズとを独立に制御できない転送方式の場合を、(B)は独立に制御できる転送方式の場合をそれぞれ示している。
【図5】データの分散化による転送方式の概念図である。
【図6】データ端数の自動処理の概念図である。
【図7】一般的なDMA転送のシステムの構成例を示すブロック図である。
【図8】本発明の第2実施形態に係るDMA装置のシステムの構成例を示すブロック図である。
【図9】メインメモリから周辺デバイスへデータ転送を行う場合における転送アドレスポインタ内容の変化の一例を示す図である。
【図10】周辺デバイスからメインメモリへデータ転送を行う場合における転送アドレスポインタ内容の変化の一例を示す図である。
【図11】従来のDMA転送とブロックDMA転送とによって一定の量のデータを転送するのに要する時間の比較結果を示す模式図である。
【図12】本発明の第3実施形態に係るバスアービトレーションアーキテクチャが適用されるDMA装置のシステムの構成例を示すブロック図である。
【図13】バスアービタの具体的な構成例を示すブロック図である。
【図14】プリグラント制御回路の具体的な構成例を示すブロック図である。
【符号の説明】
11…CPU、12,12−1,12−2…DMAコントローラ、13…メインメモリ、14,14−1,14−2…入出力デバイス(周辺デバイス)、16…システムバス(共有バス)、17…バスアービタ(バスアービトレーション制御装置)
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention provides a direct memory access (DMA) device that controls data transfer between devices sharing a bus without using a CPU, and a bus that determines a default bus master based on a bus transfer request from each of a plurality of bus masters. The present invention relates to an arbitration control device and a control method thereof.
[0002]
[Prior art]
In a built-in system (computer system), when transferring a large amount of data to / from an input / output device, a DMA (DMA) is used to reduce the load on a CPU (processor) and to guarantee a required data transfer speed. Direct memory access) is used. A controller that controls the DMA (hereinafter, referred to as a DMA controller) communicates with the CPU in data transfer between an input / output device and a main storage device (main memory) or between a primary memory and a secondary memory. The load on the CPU is reduced by exchanging (transferring) data independently, that is, directly without passing through the CPU.
[0003]
The DMA is used to transfer a large number of data transfers with an input / output device having a large bandwidth such as a hard disk device. In addition, in an embedded system, DMA can be used to ensure the real-time property. In recent years, as the functions of LSI have become more sophisticated, the load on the CPU in the system has increased, and in addition to supporting high-speed input / output devices such as USB (Universal Serial Bus), it has been installed in the past. Since the speed of UART (Universal Asynchronous Receiver / Transmitter) devices and the like is also increasing, a DMA controller is used for data transfer with these input / output devices.
[0004]
In most cases, a plurality of DMA controllers are mounted in an embedded system. Then, each DMA controller performs data transfer independently. In the case of an embedded system, it is necessary to minimize the time during which each DMA controller (bus master) occupies the data bus in order to ensure its real-time performance.
[0005]
Conventionally, a method has been adopted in which a DMA controller cannot independently control a method of accessing a transfer source device and a method of accessing a transfer destination device (for example, Patent Document 1). In such a DMA controller, the data size (bus width) that can be transferred by one bus access is set to the data size (bus width) of the transfer source or transfer destination device, and the transfer method also matches the characteristics of the device. Was set.
[0006]
[Patent Document 1]
Japanese Patent No. 320601
[0007]
[Problems to be solved by the invention]
However, in a conventional DMA controller that adopts a method in which the access method to the transfer source device and the access method to the transfer destination device cannot be independently controlled, the use of the bus band is limited, In some cases, it may not be possible to guarantee a sufficient data transfer speed because the data transfer characteristics of the device cannot be derived.
[0008]
Further, since the transfer bus width (data size) is limited by the transfer destination or transfer source device, the number of data transfers (bus access) in the DMA controller also increases. As a result, the time required to occupy the bus in the system increases, and the response to the data transfer request from the high-speed input / output device cannot be sufficiently ensured, or the real-time performance in the CPU or other DMA devices is affected. Will be.
[0009]
The present invention has been made in view of the above-described problems, and has as its object to provide a direct memory access device and a plurality of direct memory access devices that can guarantee a sufficient data transfer speed and reduce the occupation time of a system bus. It is an object of the present invention to provide a bus arbitration control device that determines a default bus master based on a bus transfer request from each of the bus masters, and a control method thereof.
[0010]
[Means for Solving the Problems]
In order to achieve the above object, according to a first aspect of the present invention, a direct memory access (DMA) object is provided in a direct memory access device that controls data transfer between devices sharing a bus without using a CPU. And a data transfer method capable of independently controlling the data size of the transfer source device and the data size of the transfer destination device.
[0011]
By adopting this data transfer method, different memory access control can be applied to the transfer source device and the transfer destination device, and the bus bandwidth can be used effectively, so that one DMA controller occupies the bus. Time can be greatly reduced. As a result, the chances of other bus masters being granted a bus increase. This means that the efficiency of the entire system bus has been improved.
[0012]
According to a second aspect of the present invention, there is provided a direct memory access apparatus including a DMA controller that controls data transfer between a memory sharing a bus and a peripheral device having a specific transfer block size without using a CPU. A handshake operation for repeatedly performing data transfer with the transfer block size is performed by a DMA controller.
[0013]
In the block size DMA transfer, by performing a handshake operation corresponding to an interrupt of the CPU on the DMA controller side, the load on the CPU when performing the DMA transfer can be reduced, so that the speed of the entire system can be increased when operating the application. And the CPU can concentrate on other processing.
[0014]
According to a third aspect of the present invention, a plurality of bus masters including a CPU having a plurality of bus interfaces, and a shared bus to which the plurality of bus masters are commonly connected are provided, and a default is provided based on a bus transfer request from each of the plurality of bus masters. In a bus arbitration control device that determines a default bus master based on a bus transfer request from each of a plurality of bus masters that determine a bus master, in a period in which there is no bus transfer request from all of the plurality of bus masters, the most recent among the plurality of bus interfaces of the CPU. The bus interface that has performed the bus transfer is determined as a default bus master.
[0015]
Considering that the CPU performs as much work as possible in the determined period, during the period when there is no bus transfer request from all bus masters, that is, during the idle state, the most recent bus transfer among the bus interfaces of the CPU is performed. By determining the performed bus interface as the default bus master, the bus transfer can be started immediately, so that a handover cycle due to arbitration does not occur.
[0016]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a block diagram showing a configuration example of an embedded system (computer system) to which the present invention is applied.
[0017]
As is clear from FIG. 1, the embedded system according to this configuration example includes one CPU (microprocessor) 11, a plurality (for example, two) of DMA controllers 12A and 12B, an on-chip main memory 13, and a DMA controller. Two input / output (I / O) devices 14-1 and 14-2 corresponding to 12-1 and 12-2 and an external bus interface (I / F) 15 are interconnected via a system bus 16. The circuit block 10 includes a DRAM 21 and a flash (FLASH) memory 22 connected to an external bus interface 15 via an external bus 21 outside the chip of the circuit block 10.
[0018]
In the embedded system having the above configuration, the width of the system bus 16 is set to, for example, 32 bits. The input / output devices 14-1 and 14-2 are connected to the system bus 16 with an 8-bit width. The CPU 11 controls the entire system. The DMA controllers 12-1 and 12-2 perform the data transfer between the input / output devices 14-1 and 14-2 and the main memory 12, or between the DRAM 22 and the flash memory 23 without the intervention of the CPU 11. It functions to reduce the load on the CPU 11.
[0019]
Normally, the DMA controllers 12-1 and 12-2 share the system bus 16 with another bus master such as the CPU 11. The occupation right of the system bus 16 is determined by a bus arbiter (bus arbitration control device) 17. Specific functions of the bus arbiter 17 will be described later in detail. A control signal Req for a data transfer request is sent from each of the input / output devices 14-1 and 14-2 to each of the DMA controllers 12-1 and 12-2 independently. , 12-2 returns a control signal Ack for responding to control signal Req independently to each of input / output devices 14-1, 14-2.
[0020]
In response to a data transfer request from the CPU 11 or each of the input / output devices 14-1 and 14-2, the DMA controllers 12-1 and 12-2 make an inquiry (Request) to the bus arbiter 17 for a bus occupation right, and the bus arbiter 17 is authorized. (Grant), the data is transferred through the system bus 16. Data transfer by the DMA controllers 12-1 and 12-2 is performed by first receiving data from a transfer source device (data read) and sending the received data to a transfer destination device (data write). When the transfer source and transfer destination devices are in the same bus hierarchy as in the present configuration example, basically, the DMA controllers 12-1 and 12-2 perform the data read as shown in FIG. And data write are performed in order to complete the data transfer.
[0021]
In the embedded system according to this configuration example, an example is described in which two DMA controllers 12-1 and 12-2 are mounted corresponding to the two input / output devices 14-1 and 14-2. This is merely an example, and it goes without saying that three or more DMA controllers may be mounted corresponding to three or more input / output devices. In recent years, at present, about ten or more DMA controllers are mounted in accordance with the sophistication of LSIs.
[0022]
As described above, a single-chip microcomputer (LSI) incorporating an embedded system in which about ten or more DMA controllers are mounted is used by being mounted on a portable information terminal represented by, for example, a PDA (Personal Digital Assistants). . When used by being mounted on a portable information terminal, a memory stick or USB is connected as a peripheral device to a plurality of input / output devices corresponding to a plurality of DMA controllers.
[0023]
By the way, recent input / output devices often have a data buffer mounted in the device in order to improve a data transfer speed with an external communication device. In order to efficiently perform data transfer with such an input / output device, it is important that the DMA controllers 12-1 and 12-2 perform data access in consideration of the characteristics of each device. Therefore, each of the DMA controllers 12-1 and 12-2 has a data buffer of a required size. The larger the data buffer mounted on the DMA controllers 12-1 and 12-2, the higher the data transfer speed. When determining the size of the data buffer, it is necessary to consider the impact on the area.
[0024]
In the embedded system according to this configuration example, as shown in FIG. 3, a data buffer 31 of, for example, 16 bytes is provided on the input / output device 14 (14-1 / 14-2) side and the DMA controller 12 (12-1 / 12-). It is assumed that a data buffer 32 of, for example, 16 bytes is mounted in 2). Here, it is assumed that data is transferred from the input / output device 14 to the main memory 13, for example. The DMA controller 12 includes a transfer control circuit 33 and a bus I / F 34 in addition to the data buffer 32.
[0025]
In this system configuration, for example, a UART (16C550 or the like) device is used as the input / output device 14. By notifying the DMA controller 12 of an appropriate data transfer request, the input / output device 14 can handle burst transfer in units of up to 16 bytes. Here, the burst transfer means transferring a plurality of byte data collectively by continuous use of a bus cycle. Since a 16-byte data buffer 32 is similarly mounted on the DMA controller 12 side, burst transfer can be performed in units of 16 bytes at the time of data transfer.
[0026]
Here, since the bus size of the system bus 16 is 32 bits while the data size of the input / output device 14 is 8 bits, the bus width is not sufficiently utilized at the time of data writing in this data transfer. Become. Further, in the case of the conventional DMA controller, since the data size (read data size) of the transfer source device and the data size (write data size) of the transfer destination device cannot be independently controlled, FIG. As shown in (A), 32 data transfer cycles occur on the system bus, including data read and data write.
[0027]
[First Embodiment]
In view of these points, a DMA device according to the first embodiment of the present invention described below is provided.
[0028]
In the DMA device according to the present embodiment, the data size of the transfer source device (the input / output device 14 in this example) and the data size of the transfer destination device (the main memory 13 in the present example) can be independently controlled. It is characterized by adopting a simple data transfer method. By adopting this data transfer method, different memory access controls can be applied to the transfer source device and the transfer destination device to effectively use the bus band. The time occupying 16 can be greatly reduced.
[0029]
This data transfer method can be realized by dividing the bus control information of the DMA controller 12 into transfer source access and transfer destination access so that the data can be set by software. As an example, by setting the data size of the transfer source device to 8 bits and the data transfer (write data) size to the transfer destination device to 32 bits, a write transfer occurs as shown in FIG. 4B. Since the occupation time of the system bus 16 can be reduced by 8 DMA transfer cycles, bus access at the time of data writing can be greatly reduced (data integration).
[0030]
As described above, by adopting the transfer method in which the data size of the transfer source device and the data size of the transfer destination device can be independently controlled, the time for which one DMA controller occupies the system bus is reduced, and the other bus master is used. (CPUs, DMA controllers, etc.) are more likely to be authorized for the bus. This means that the efficiency of the entire system bus has been improved. The data size can be flexibly set, and the data size of the transfer source device and the data size of the transfer destination device are set under conditions that fit within the size of the data buffer 32 mounted in the DMA controller 12 (16 bytes in this example). Settings can be made.
[0031]
In data transfer, the efficiency can be improved by considering not only the data size but also the data transfer type. Various bus slave devices are connected in the embedded system. Further, a memory device such as a DRAM 22 or a flash memory 23 is connected to the outside via an external bus interface 15. Many of these memory devices employ burst transfer in order to secure a data transfer speed.
[0032]
In some cases, a DRAM or the like is mounted inside the device to improve the data transfer rate by partially expanding the data bus width. For these devices, it is possible to improve the data transfer efficiency by appropriately performing a data transfer of a transfer type suited to each characteristic, that is, a burst transfer. Also, as shown in FIG. 5, the specification is such that a burst transfer can be divided into a plurality of times and executed even for a device having a narrow bus width. The division of the burst transfer is also automatically processed in the DMA controller 12 according to the combination of the set transfer data sizes (data distribution).
[0033]
When such a transfer method based on data distribution is adopted, depending on the total number of data transfers (total data size of the transfer block) and the combination of the transfer type and data size, the transfer of data at the end of transfer (end of transfer block) is performed. The remainder (fraction) may occur. In such a case, the data transfer of the set transfer type is continued as much as possible, and finally only the remainder (fraction) has the minimum data size (8 bits in this example) and the minimum transfer type (single data transfer). Automatically to complete the transfer up to the final data.
[0034]
Specifically, as shown in FIG. 6, for example, in the case of a data size of 32 bits, 4-burst transfer, and a final data block of 15 bytes (fraction of 3 bytes), the transfer of a fractional 3 bytes is automatically performed as data. The transfer is completed by switching to the size of 8 bits. The design is such that special awareness is not required in software for such fractional processing.
[0035]
In addition, even when different byte arrays (endian) are used between the transfer source and the transfer destination, it is possible to cope by adding the information of the byte array to the transfer source and the transfer destination and performing control.
[0036]
As described above, in the DMA device according to the first embodiment, the conventional data transfer method is reviewed in order to effectively utilize the limited bus bandwidth of the embedded system and to increase the efficiency of data transfer by DMA. In the control of the source data transfer (data read) and the destination data transfer (data write), the transfer data size and the transfer type can be set independently, and different memory access control is performed for the source device and the destination device, respectively. The use efficiency of the system bus 16 can be improved in data transfer between input / output devices having different bus widths (for example, UART-main memory) in the same system.
[0037]
This immediately leads to an improvement in the data transfer efficiency of the DMA controller 12, that is, the data transfer speed. Further, since the number of bus occupation requests by the DMA controller 12 decreases, the number of bus arbitrations by the bus arbiter 17 in the system also decreases. This leads to suppression of a signal change of the system bus 16, and accordingly, it is possible to reduce power consumption.
[0038]
In a system in which many DMA controllers and other bus masters are implemented, the occupation time of the system bus requested by one bus master also affects the responsiveness of another bus master. Particularly, in the case of an embedded system, real-time performance is regarded as important, and the reduction of the occupation time of the system bus by the DMA controller or the like also has the effect of not deteriorating the real-time performance of the system (CPU).
[0039]
Also, the remainder (fraction) of data generated at the end of the transfer due to the combination of the total transfer data number and the transfer type is automatically switched to the minimum data size (8 bits in this example) and the minimum transfer type, and the data up to the final data is obtained. Completion of the transfer eliminates the need for software to pay special attention to the remainder (fraction) of the data, thereby reducing the load on the CPU 11.
[0040]
By the way, between the peripheral device (here, the input / output devices 14-1 and 14-2 are exemplified) 14 having a specific transfer block size (for example, a buffer memory size and a packet size) and the main memory 13. When performing the DMA transfer, the DMA controller 12 stops every time the transfer of data corresponding to the transfer block size of the peripheral device 14 is completed. At this time, an interrupt is generated for the CPU 11, and the CPU 11 receives the interrupt, performs an appropriate countermeasure, issues an instruction to start the DMA transfer again, and requires a handshake by software processing on the CPU 11 side.
[0041]
Specifically, as shown in FIG. 7, a transfer end interrupt is generated in the CPU 11 in response to a transfer request signal from the peripheral device 14, and upon receiving this interrupt, the CPU 11 transmits a DMA transfer to the DMA controller 12. Resume processing, that is, a transfer start instruction is sent. As described above, the CPU 11 performs the transfer resuming process of the DMA controller 12 in the interrupt routine, so that not only the transfer of all data takes time but also the other processes executed by the CPU 11 are suppressed, and as a result, the entire application is executed. Will be reduced.
[0042]
Further, after the block size transfer is repeated and the transfer of the desired data amount is completed, there is a case where the same DMA transfer is desired to be performed again from the transfer source top address of the main memory 13 which was previously set. In this case, it is necessary to reset the conditions such as the address from the CPU 11 for the DMA controller 12.
[0043]
[Second embodiment]
What has been made in view of these points is a DMA device according to a second embodiment of the present invention described below.
[0044]
FIG. 8 is a block diagram showing a configuration example of the system of the DMA device according to the present embodiment. In the drawing, the same parts as those in FIG. 1 are denoted by the same reference numerals. Here, the input / output devices 14-1 and 14-2 of FIG.
[0045]
8, the DMA controller 12 includes, for example, a counter 41 as counting means for counting a data transfer amount, a register 42 as storage means (area) for storing data of a transfer block size of the peripheral device 14, and a source address pointer 43. And a destination address pointer 44. The DMA device according to the present embodiment has a configuration in which a transfer request signal from the peripheral device 14 is directly supplied to the DMA controller 12.
[0046]
Next, data transfer (DMA transfer) in the DMA device according to the second embodiment having the above configuration will be described.
[0047]
(Handshake with peripheral devices)
First, the CPU 11 notifies the DMA controller 12 of the transfer block size of the peripheral device 14. Then, the DMA controller 12 stores the notified transfer block size in a storage device such as the register 42. The transfer block size of the peripheral device 14 may be known in advance by the DMA controller 12 as a fixed value, that is, the value may be stored in a storage device such as the register 42 in advance.
[0048]
Upon receiving a transfer start instruction from the CPU 11, the DMA controller 12 starts transferring data between the peripheral device 14 and the main memory 13 through a data path such as the system bus 16. During the data transfer period, the DMA controller 12 counts the number of transfer data with the counter 41 and compares the counted number of transfer data with the value stored in the register 42, that is, the transfer block size. Then, when the DMA controller 12 knows that the comparison results match, that is, that the transfer of data of the transfer block size of the peripheral device 14 has been completed, the DMA controller 12 automatically temporarily stops the transfer and waits for a transfer request from the peripheral device 14. .
[0049]
When the peripheral device 14 becomes ready to transfer data again, the peripheral device 14 issues a transfer request signal to the DMA controller 12. In response to this, the DMA controller 12 clears the counter 41 and restarts the data transfer. By repeating this operation, the DMA controller 12 can complete the transfer of all data without the intervention of the CPU 11.
[0050]
(Address loop)
FIG. 9 is a diagram showing an example of a change in the contents of the transfer address pointer when data is transferred from the main memory 13 to the peripheral device 14. In this example, since the data is transferred from the main memory 13 to the peripheral device 14, the transfer address of the main memory 13 is the source address pointer 43 and the transfer address of the peripheral device 14 is the destination address in the DMA controller 12 of FIG. Each is managed by the pointer 44.
[0051]
Here, the transfer size of the peripheral device 14 is 0x100. The transfer address pointer of the main memory 13, that is, the source address pointer 43 starts from 0x1000 and advances to 0x10ff, and the transfer address pointer of the peripheral device 14, that is, the destination address pointer 44 advances from 0x8000 to 0x80ff, and the data in this memory area is The data is sequentially read from the main memory 13 by the DMA controller 12 and written to the peripheral device 14.
[0052]
When the transfer of data of the transfer block size (0x100) is completed, the source address pointer 43 on the main memory 13 side is 0x1100, but the peripheral device 14 uses the destination address on the peripheral device 14 side again from 0x8000. Return the pointer 44 to 0x8000. When the transfer amount reaches the transfer block size of the peripheral device 14, the DMA controller 12 suspends the data transfer, and sends a transfer request signal for notifying the DMA controller 12 that the peripheral device 14 is ready to transfer again. , And waits until the DMA controller 12 receives it from the peripheral device 14.
[0053]
Upon receiving the transfer request signal, the DMA controller 12 restarts the data transfer from the source address pointer 43 on the main memory 13 side from 0x1100 and the destination address pointer 44 on the peripheral device 14 side from 0x8000. That is, the source address pointer 43 is continuously increased on the main memory 13 side, while the destination address pointer 44 is looped on the peripheral device 14 side. Thereafter, the above-described series of processing is repeated until transfer of all data requested by the application is completed.
[0054]
In this manner, the DMA controller 12 loops the transfer address pointer on the peripheral device 14 side, that is, the destination address pointer 44, with the transfer size (0x8000 to 0x80ff in this example), and every time the transfer of the block size is completed. By automatically waiting for the transfer to be resumed, the transfer of all data can be completed without the intervention of the CPU 11.
[0055]
FIG. 10 is a diagram showing an example of a change in the contents of the transfer address pointer when data is transferred from the peripheral device 14 to the main memory 13. In this case, basically, the operation is the same as the operation when data is transferred from the main memory 13 to the peripheral device 14 (see FIG. 9).
[0056]
Note that, depending on the specifications of the peripheral device 14, the address read / written by the DMA controller 12 is fixed, and the same data transfer as in the above example is performed by reading / writing data of the transfer block size for one address. Sometimes you can. In this case, the transfer address pointer on the peripheral device 14 side may be fixed instead of a loop.
[0057]
(Reload function)
After a series of block size transfer described above is repeated and transfer of a desired amount of data is completed, there is a case where a similar DMA transfer is desired to be performed again from the transfer source start address of the main memory 13 previously set. Therefore, the DMA device according to the present embodiment employs a configuration in which the DMA controller 12 has a reload function of reproducing a series of settings from the CPU 11 at the time of DMA transfer.
[0058]
By providing the DMA controller 12 with the reload function in this way, the CPU 11 can restore the previously set values only by giving a simple reset instruction to the DMA controller 12. The load can be reduced. This reload function can be realized by a method in which a register mapped to a specific address is provided in the DMA controller 12 and a specific bit of the register is operated from the CPU 11. Since reloading is performed by an explicit instruction from the CPU 11, whether or not to reload can be dynamically determined by a user program of the CPU 11.
[0059]
As described above, in the DMA device according to the second embodiment, when the peripheral device 14 has a specific transfer block size (for example, a buffer memory size or a packet size) and repeatedly performs data transfer with the transfer block size. The conventional CPU 11 performs a handshake operation by the CPU 11 on the side of the DMA controller 12 having a storage area (register 42) for storing the transfer block size of the peripheral device 14 and a counter 41 for counting the transfer amount. The software processing that has been performed can be automatically processed by hardware by the DMA controller 12. As a result, the load on the CPU 11 when performing the DMA transfer can be reduced, so that the speed of the entire system can be increased when the application is operated.
[0060]
FIG. 11 shows the time required to transfer a fixed amount of data (DMA transfer time) between a DMA device having a conventional DMA controller and a DMA device having a DMA controller having a block DMA transfer function according to the present embodiment. It is a schematic diagram which shows the comparison result of (speed).
[0061]
In the conventional DMA transfer, an interrupt occurs in the CPU 11 in response to a transfer request signal from the peripheral device 14, and this interrupt causes the CPU 11 to perform the transfer restart processing of the DMA controller 12 in an interrupt routine. In addition to this, the other processes executed by the CPU 11 are pressed down, and as a result, the speed of the entire application is reduced. On the other hand, in the block size DMA transfer, a process corresponding to an interrupt of the CPU 11 is processed by hardware on the side of the DMA controller 12, so that there is no overhead per block size and the CPU 11 can concentrate on other processes. .
[0062]
Further, when the CPU 11 needs to repeatedly perform the same setting for the module (in this example, the DMA controller 12) for which the CPU 11 performs a series of settings during the operation of the application, for example, the setting value is changed during the operation. In the case of a change, the module is provided with a function of reproducing the setting in the same manner as the first time, that is, a reload function, so that the procedure of resetting by the CPU 11 is omitted, and a simple instruction is given from the CPU 11 to the module. Thus, the load on the CPU 11 can be reduced. For example, even if it is necessary to reset the address or the like to the DMA controller 12 after the completion of the data transfer, the DMA controller 12 has a reload function, and the setting can be restored by a simple operation, or the setting can not be restored. It is also possible to transfer data continuously from the address value at that time.
[0063]
Up to this point, two embodiments of the DMA device have been described. Hereinafter, a bus arbiter (bus arbitration control device) 17 that arbitrates a plurality of bus masters (the CPU 11, the DMA controllers 12-1, 12-2, and the like) with respect to the system bus 16, which is a shared bus, will be described.
[0064]
As an arbitration method, there is a method in which priorities are assigned to the respective bus masters, and a bus use right (bus occupation right) is given to the bus master having the highest priority among the bus masters requesting the bus transfer. When there is no bus use request from any bus master (idle state), the bus use right is given to one determined default bus master.
[0065]
When selecting the default bus master, it is advantageous to select the bus master that will make the bus transfer request most as the default bus master. The reason is that when the bus master issues a bus transfer request while the shared bus is in the idle state, if the bus master is the default bus master, the overhead in the bus arbiter 17 is reduced, resulting in an increase in bus efficiency.
[0066]
To determine the default bus master,
{Circle around (1)} A method in which the bus master that has performed the bus transfer immediately before the shared bus enters the idle state becomes the default bus master (for example, see Japanese Patent Application Laid-Open No. 5-250311)
{Circle over (2)} A method of setting the bus master that has performed the most bus transfer among the past several bus transfers on the shared bus as the default bus master (for example, refer to JP-A-2000-35443)
and so on.
[0067]
However, according to the determination method (1), if the bus master that has performed the bus transfer immediately before the idle state is the bus master with the lowest bus transfer request frequency, there is a possibility that another bus master with the next highest bus transfer request makes the transfer request. high. In the determination method (2), several past transfer histories are stored for all the bus masters such as the CPU 11 and the DMA controllers 12-1 and 12-2, and the determination is made based on the transfer histories. Therefore, in an embedded system including many bus masters, logic complexity is expected.
[0068]
[Third embodiment]
In view of these points, a bus arbitration architecture according to a third embodiment of the present invention described below has been made.
[0069]
FIG. 12 is a block diagram showing a configuration example of a system of a DMA device to which the bus arbitration architecture according to the present embodiment is applied. In the drawing, the same parts as those in FIG. 1 are denoted by the same reference numerals. Here, a CPU (microprocessor) 11 and two DMA controllers 12-1 and 12-2 are exemplified as a plurality of bus masters, and the DMA controllers 12-1 and 12-2 are bus masters 12-1 and 12-2. As shown.
[0070]
As shown in FIG. 12, the CPU 11 has a plurality of bus interfaces serving as bus masters, for example, two bus interfaces 111 and 112. Therefore, in the embedded system according to this configuration example, a total of four bus masters including two bus interfaces 111 and 112 and other bus masters, for example, two DMA controllers 12-1 and 12-2, share one system bus 16. Will share.
[0071]
The bus arbiter 17 performs control (bus arbitration) so that there is always one bus master performing bus transfer so that data collision does not occur in the system bus (shared bus) 16. That is, arbitration handover in which each bus master issues a bus transfer request REQ to the bus arbiter 17 and the bus arbiter 17 gives a bus transfer permission GRNT to each bus master in response to the request REQ is performed. -1, 12-2 and the bus arbiter 17.
[0072]
FIG. 13 is a block diagram illustrating a specific configuration example of the bus arbiter 17. As is clear from FIG. 13, the bus arbiter 17 according to the present configuration example determines the priority order according to the bus transfer requests REQ # 1 to # 4 input from each of the bus masters and outputs the bus transfer permission GRNT # 1 to GRNT # 4. And a pre-grant control circuit 172 that determines a default bus master based on the bus transfer permission GRNT # 1 and GRNT # 2.
[0073]
In the bus arbiter 17 configured as described above, the bus transfer requests REQ # 1 to REQ # 4 are input to the round robin control circuit 171 from each of the bus masters, and the bus transfer requests REQ # 1 to # 4 change the priority in the round robin control circuit 171. When determined, the bus transfer permission GRNT # 1 to # 4 that is adapted according to the priority becomes active. At this time, of the bus transfer permission GRNTs # 1 to # 4, only the values of the bus transfer permission GRANT # 1 and # 2 of the bus interfaces 111 and 112 of the CPU 11 are input to the pregrant control circuit 172.
[0074]
Here, inputting only the value of the bus transfer permission GRANT # 1, # 2 among the bus transfer permission GRNT # 1 to # 4 to the pregrant control circuit 172 means that the bus interface 111, 112 of the CPU 11 is connected to another bus interface 111, 112. This means that the bus master is determined as the default bus master in preference to the bus master. This is in consideration of the fact that the CPU 11 performs as much work as possible during a predetermined period. When the bus transfer grants GRANT # 1 and # 2 are input to the pre-grant control circuit 172, the pre-grant control circuit 172 determines the bus interface 111 and the bus interface 112 based on the values of the bus transfer allowances GRANT # 1 and # 2. Which is the default bus master is determined.
[0075]
FIG. 14 is a block diagram illustrating a specific configuration example of the pregrant control circuit 172. As apparent from FIG. 14, the pregrant control circuit 172 according to the present configuration example determines which of the bus interfaces 111 and 112 performs the bus transfer from the value of the bus transfer permission GRANT # 1 and GRANT # 2. The circuit 1711 has a configuration including a circuit 1711 and a storage circuit 1722 that stores the determination result of the bus transfer determination circuit 1711 until one of the bus transfers occurs next.
[0076]
In the pregrant control circuit 172 having the above configuration, the bus transfer determination circuit 1711 determines the bus interface 111 and the bus interface from the values of the bus transfer permission GRNT # 1 and # 2 corresponding to the priority determined by the round robin control circuit 171. It is determined which of 112 is to perform the bus transfer. This determination result is stored in the storage circuit 1722 until the next bus transfer of one of the bus interfaces 111 and 112 occurs. As a result, the bus master corresponding to the determination result stored and held in the storage circuit 1722 becomes the bus master that has performed the bus transfer most recently.
[0077]
Here, the bus interface that has performed the most recent bus transfer among the bus interfaces 111 and 112 of the CPU 11 is determined as the default bus master. The bus transfer that has been performed most recently will make another bus transfer request. It is based on that prediction. Then, the determination result stored and held in the storage circuit 1722 is supplied to the round robin control circuit 171 as default bus master information DEF. Then, the round robin control circuit 171 determines the bus master specified by the default bus master information DEF of the bus interfaces 111 and 112, that is, the bus master that has performed the most recent bus transfer, as the default bus master.
[0078]
In an idle period when there is no bus master requesting the next bus transfer, that is, in a period when there is no bus transfer request from all bus masters, the bus corresponding to the determination result (default bus master information DEF) stored in the storage circuit 1722. The transfer permission GRNT becomes active. Thereafter, when the bus master that first requests the bus transfer is the default bus master, the bus transfer can be started immediately because the bus transfer permission GRNT is active, and a handover cycle due to arbitration does not occur.
[0079]
As described above, in the bus arbiter 17 according to the third embodiment, in consideration of the fact that the CPU 11 performs as much work as possible during a predetermined period, the bus arbiter 17 of the CPU 11 does not perform a bus transfer request from all bus masters. By determining the bus interface that has performed the bus transfer most recently among the interfaces 111 and 112 as the default bus master, the bus transfer can be started immediately. Therefore, a handover cycle due to arbitration does not occur, and the bus transfer request of the CPU 11 is not generated. Bus handover cycle at the time can be reduced.
[0080]
Further, by predicting the next bus master by the default bus master determination architecture when the CPU 11 has a plurality of bus interfaces (two in this example) serving as bus masters, the bus transfer can be started immediately, so that the handover by arbitration is performed. An overcycle does not occur, and the bus handover cycle during the bus transfer of the CPU 11 can be reduced.
[0081]
【The invention's effect】
As described above, according to the present invention, by adopting a data transfer method capable of independently controlling the data size of the transfer source device and the data size of the transfer destination device to be subjected to DMA, Since different buses can be used effectively by applying different memory access controls to the transfer destination device, a sufficient data transfer speed can be guaranteed and the occupation time of the system bus can be reduced.
[0082]
In addition, by performing a handshake operation corresponding to an interrupt of the CPU in the block size DMA transfer on the DMA controller side, the load on the CPU in performing the DMA transfer can be reduced. Can be achieved. Further, during a period in which there is no bus transfer request from all the bus masters, the bus interface that has performed the most recent bus transfer among the CPU bus interfaces can be determined as the default bus master, so that the bus transfer can be started immediately. The bus handover cycle at the time of a bus transfer request of the CPU can be reduced.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration example of an embedded system (computer system) to which the present invention is applied.
FIG. 2 is a diagram showing a cycle of a basic transfer of a DMA controller.
FIG. 3 is a block diagram illustrating a configuration example of a main part in the DMA device according to the first embodiment of the present invention.
4A and 4B are diagrams showing a data read cycle and a data write cycle. FIG. 4A shows a case where the transfer source data size and the transfer destination data size cannot be controlled independently, and FIG. Each case of the transfer method is shown.
FIG. 5 is a conceptual diagram of a transfer method based on data distribution.
FIG. 6 is a conceptual diagram of automatic processing of a data fraction.
FIG. 7 is a block diagram illustrating a configuration example of a general DMA transfer system.
FIG. 8 is a block diagram illustrating a configuration example of a system of a DMA device according to a second embodiment of the present invention.
FIG. 9 is a diagram showing an example of a change in the contents of a transfer address pointer when data is transferred from a main memory to a peripheral device.
FIG. 10 is a diagram showing an example of a change in the contents of a transfer address pointer when data is transferred from a peripheral device to a main memory.
FIG. 11 is a schematic diagram showing a comparison result of a time required to transfer a certain amount of data by a conventional DMA transfer and a block DMA transfer.
FIG. 12 is a block diagram illustrating a configuration example of a system of a DMA device to which a bus arbitration architecture according to a third embodiment of the present invention is applied.
FIG. 13 is a block diagram illustrating a specific configuration example of a bus arbiter.
FIG. 14 is a block diagram illustrating a specific configuration example of a pre-grant control circuit.
[Explanation of symbols]
11 CPU, 12, 12-1, 12-2 DMA controller, 13 main memory, 14, 14-1, 14-2 input / output device (peripheral device), 16 system bus (shared bus), 17 … Bus arbiter (bus arbitration control device)

Claims (14)

バスを共有するデバイス相互間でのデータの転送を、CPUを介さずに制御するダイレクトメモリアクセス装置であって、
ダイレクトメモリアクセス(DMA)の対象となる転送元デバイスのデータサイズと転送先デバイスのデータサイズとを独立に制御可能なDMAコントローラ
を備えたことを特徴とするダイレクトメモリアクセス装置。
A direct memory access device for controlling data transfer between devices sharing a bus without using a CPU,
A direct memory access device comprising a DMA controller capable of independently controlling a data size of a transfer source device and a data size of a transfer destination device to be subjected to direct memory access (DMA).
前記DMAコントローラは、前記転送元デバイスおよび前記転送先デバイスのそれぞれの特性に合わせたデータの転送タイプを設定する
ことを特徴とする請求項1に記載のダイレクトメモリアクセス装置。
2. The direct memory access device according to claim 1, wherein the DMA controller sets a data transfer type according to respective characteristics of the transfer source device and the transfer destination device.
前記転送タイプがバースト転送である
ことを特徴とする請求項2記載のダイレクトメモリアクセス装置。
3. The direct memory access device according to claim 2, wherein the transfer type is a burst transfer.
前記DMAコントローラは、バス幅が狭いデバイスに対してバースト転送を複数回に分割して実行する
ことを特徴とする請求項3に記載のダイレクトメモリアクセス装置。
4. The direct memory access device according to claim 3, wherein the DMA controller executes burst transfer for a device having a narrow bus width in a plurality of times.
前記DMAコントローラは、設定した転送タイプによって総データ転送数に対して転送の終わりにデータの余りが生じた場合は、その余り転送数を自動的に判断して最小データサイズの転送に切り替える
ことを特徴とする請求項2に記載のダイレクトメモリアクセス装置。
When there is a data remainder at the end of the transfer with respect to the total data transfer number due to the set transfer type, the DMA controller automatically determines the remaining transfer number and switches to the transfer with the minimum data size. 3. The direct memory access device according to claim 2, wherein:
前記設定した転送タイプが、複数回に分割されて実行されるバースト転送である
ことを特徴とする請求項5に記載のダイレクトメモリアクセス装置。
6. The direct memory access device according to claim 5, wherein the set transfer type is a burst transfer that is executed by being divided into a plurality of times.
バスを共有するメモリと特定の転送ブロックサイズを持つ周辺デバイスとの間でのデータの転送を、CPUを介さずに制御するDMAコントローラを備えたダイレクトメモリアクセス装置であって、
前記DMAコントローラは、前記転送ブロックサイズのデータを保存する記憶手段と、前記転送元デバイスと前記転送先デバイスとの間でのデータの転送量を数える計数手段とを有し、前記転送ブロックサイズで繰り返しデータ転送を行う際のハンドシェイク操作を行う
ことを特徴とするダイレクトメモリアクセス装置。
A direct memory access device including a DMA controller for controlling data transfer between a memory sharing a bus and a peripheral device having a specific transfer block size without using a CPU,
The DMA controller has storage means for storing data of the transfer block size, and counting means for counting the amount of data transferred between the transfer source device and the transfer destination device, A direct memory access device that performs a handshake operation when repeatedly performing data transfer.
前記DMAコントローラは、DMA転送の際のCPUからの一連の設定を再現する機能を備え、CPUから再設定の指示が与えられるだけで前記一連の設定を再現する
ことを特徴とする請求項7に記載のダイレクトメモリアクセス装置。
8. The method according to claim 7, wherein the DMA controller has a function of reproducing a series of settings from the CPU at the time of DMA transfer, and reproduces the series of settings only by receiving a reset instruction from the CPU. A direct memory access device as described.
複数のバスインターフェイスを持つCPUを含む複数のバスマスタと、
前記複数のバスマスタが共通に接続された共有バスとを備え、
前記複数のバスマスタの各々からバス転送要求に基づいてデフォルトバスマスタを決めるバスアービトレーション制御装置であって、
前記複数のバスマスタの全てからバス転送要求がない期間では前記CPUの前記複数のバスインターフェイスの中で最も最近にバス転送を行ったバスインターフェイスをデフォルトバスマスタに決定する
ことを特徴とするバスアービトレーション制御装置。
A plurality of bus masters including a CPU having a plurality of bus interfaces;
A shared bus to which the plurality of bus masters are connected in common,
A bus arbitration control device that determines a default bus master based on a bus transfer request from each of the plurality of bus masters,
A bus arbitration control device, wherein a bus interface that has recently performed a bus transfer among the plurality of bus interfaces of the CPU is determined as a default bus master during a period in which there is no bus transfer request from all of the plurality of bus masters. .
前記複数のバスマスタの各々からのバス転送要求によって優先順位を決めバス転送許可を前記複数のバスマスタの各々に対して出力する制御回路と、
前記複数のバスインターフェイスに対する前記バス転送許可の値からこれらバスインターフェイスの中の何れがバス転送を行うかを判断するバス転送判断回路と、
前記バス転送判断回路の判断結果を次に何れかのバス転送が起こるまで記憶保持する記憶回路とを有し、
前記複数のバスマスタの全てからバス転送要求がない期間では前記記憶回路に記憶保持されている判断結果に対応する前記バス転送許可をアクティブにする
ことを特徴とする請求項9に記載のバスアービトレーション制御装置。
A control circuit that determines a priority order according to a bus transfer request from each of the plurality of bus masters and outputs a bus transfer permission to each of the plurality of bus masters;
A bus transfer determination circuit that determines which of the bus interfaces performs a bus transfer from a value of the bus transfer permission for the plurality of bus interfaces;
A storage circuit for storing and holding the determination result of the bus transfer determination circuit until the next bus transfer occurs,
10. The bus arbitration control according to claim 9, wherein the bus transfer permission corresponding to the determination result stored in the storage circuit is activated during a period in which there is no bus transfer request from all of the plurality of bus masters. apparatus.
バスを共有するデバイス相互間でのデータの転送を、CPUを介さずに制御するダイレクトメモリアクセス装置の制御方法であって、
ダイレクトメモリアクセス(DMA)の対象となる転送元デバイスのデータサイズと転送先デバイスのデータサイズとを独立に制御する
ことを特徴とするダイレクトメモリアクセス装置の制御方法。
A method of controlling a direct memory access device that controls data transfer between devices sharing a bus without using a CPU,
A method for controlling a direct memory access device, wherein the data size of a transfer source device and the data size of a transfer destination device to be subjected to direct memory access (DMA) are independently controlled.
前記転送元デバイスおよび前記転送先デバイスのそれぞれの特性に合わせたデータの転送タイプを設定する
ことを特徴とする請求項11に記載のダイレクトメモリアクセス装置の制御方法。
The method of controlling a direct memory access device according to claim 11, wherein a data transfer type is set according to each characteristic of the transfer source device and the transfer destination device.
バスを共有するメモリと特定の転送ブロックサイズを持つ周辺デバイスとの間でのデータの転送を、CPUを介さずに制御するDMAコントローラを備えたダイレクトメモリアクセス装置の制御方法であって、
前記転送ブロックサイズで繰り返しデータ転送を行う際のハンドシェイク操作を前記DMAコントローラによって行う
ことを特徴とするダイレクトメモリアクセス装置の制御方法。
A method for controlling a direct memory access device including a DMA controller that controls data transfer between a memory sharing a bus and a peripheral device having a specific transfer block size without using a CPU,
A method of controlling a direct memory access device, wherein a handshake operation when repeatedly performing data transfer with the transfer block size is performed by the DMA controller.
複数のバスインターフェイスを持つCPUを含む複数のバスマスタと、
前記複数のバスマスタが共通に接続された共有バスとを備え、
前記複数のバスマスタの各々からバス転送要求に基づいてデフォルトバスマスタを決めるバスアービトレーション制御装置の制御方法であって、
前記複数のバスマスタの全てからバス転送要求がない期間では前記CPUの前記複数のバスインターフェイスの中で最も最近にバス転送を行ったバスインターフェイスをデフォルトバスマスタに決定する
ことを特徴とするバスアービトレーション制御装置の制御方法。
A plurality of bus masters including a CPU having a plurality of bus interfaces;
A shared bus to which the plurality of bus masters are connected in common,
A control method of a bus arbitration control device that determines a default bus master based on a bus transfer request from each of the plurality of bus masters,
A bus arbitration control device, wherein a bus interface that has recently performed a bus transfer among the plurality of bus interfaces of the CPU is determined as a default bus master during a period in which there is no bus transfer request from all of the plurality of bus masters. Control method.
JP2002309126A 2002-10-24 2002-10-24 Direct memory access device, bus arbitration controller, and control method for the same Pending JP2004145593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002309126A JP2004145593A (en) 2002-10-24 2002-10-24 Direct memory access device, bus arbitration controller, and control method for the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002309126A JP2004145593A (en) 2002-10-24 2002-10-24 Direct memory access device, bus arbitration controller, and control method for the same

Publications (1)

Publication Number Publication Date
JP2004145593A true JP2004145593A (en) 2004-05-20

Family

ID=32455038

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002309126A Pending JP2004145593A (en) 2002-10-24 2002-10-24 Direct memory access device, bus arbitration controller, and control method for the same

Country Status (1)

Country Link
JP (1) JP2004145593A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021108219A1 (en) * 2019-11-26 2021-06-03 Micron Technology, Inc. Hardware management granularity for mixed media memory sub-systems
CN114968863A (en) * 2022-05-26 2022-08-30 无锡华大国奇科技有限公司 Data transmission method based on DMA controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021108219A1 (en) * 2019-11-26 2021-06-03 Micron Technology, Inc. Hardware management granularity for mixed media memory sub-systems
CN114968863A (en) * 2022-05-26 2022-08-30 无锡华大国奇科技有限公司 Data transmission method based on DMA controller

Similar Documents

Publication Publication Date Title
US6775727B2 (en) System and method for controlling bus arbitration during cache memory burst cycles
US7171526B2 (en) Memory controller useable in a data processing system
JP4847036B2 (en) Control device for arbitrating bus access and control method for data processing device
KR20000053380A (en) A port manager controller for connecting various function modules
US7213084B2 (en) System and method for allocating memory allocation bandwidth by assigning fixed priority of access to DMA machines and programmable priority to processing unit
JPH076122A (en) Method and apparatus for request of data
US7310717B2 (en) Data transfer control unit with selectable transfer unit size
US20060218313A1 (en) DMA circuit and computer system
US7240129B2 (en) DMA controller having programmable channel priority
US20060155893A1 (en) Methods and apparatus for sharing memory bandwidth
JP2004145593A (en) Direct memory access device, bus arbitration controller, and control method for the same
US20020108004A1 (en) Enhancement of transaction order queue
US8135878B1 (en) Method and apparatus for improving throughput on a common bus
JP5058116B2 (en) DMAC issue mechanism by streaming ID method
JP4151362B2 (en) Bus arbitration method, data transfer device, and bus arbitration method
EP1125191A1 (en) Controlling access to a primary memory
JP2006079394A (en) Data processor
JP2005165508A (en) Direct memory access controller
EP3238085B1 (en) Virtual legacy wire
WO2002093392A1 (en) Data processor
JP3206656B2 (en) Prefetch device and prefetch method on bus
JP4847615B2 (en) Control device and method for arbitrating bus access
JPH06131294A (en) Data transfer device
JP2003345649A (en) Data processor and data recording medium
JP2003281077A (en) Semiconductor integrated circuit device