JP2004013395A - Dma controller - Google Patents
Dma controller Download PDFInfo
- Publication number
- JP2004013395A JP2004013395A JP2002164153A JP2002164153A JP2004013395A JP 2004013395 A JP2004013395 A JP 2004013395A JP 2002164153 A JP2002164153 A JP 2002164153A JP 2002164153 A JP2002164153 A JP 2002164153A JP 2004013395 A JP2004013395 A JP 2004013395A
- Authority
- JP
- Japan
- Prior art keywords
- transfer
- input
- data
- dma
- output module
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
- Bus Control (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、例えばマイクロコンピュータシステムのメモリと入出力モジュール間におけるデータのDMA転送を制御するDMAコントローラに関する。
【0002】
【従来の技術】
例えばマイクロコンピュータシステムにおいては、従来よりメモリと外部入出力モジュールとの間でDMA(Direct Memory Accessの略)転送と呼ばれる高速データ転送が広く採用されている。これはデータがCPUを経由せず、メモリと入出力モジュールとの間で直接転送される方式で、このデータ転送を制御する回路はDMAコントローラと呼ばれる。
【0003】
図5は、このようなDMAコントローラ100の内部構成例を示すブロック図であり、図6はこのDMAコントローラ100を用いたDMA転送回路の構成例である。DMA転送回路はCPU200、メモリ300、DMAコントローラ100、バスアービタ400、バス500、入出力モジュール600、700等で構成されている。入出力モジュール600、700は、例えばシリアル通信装置で、図示しない外部機器との間でシリアル通信によりデータの送受信を行なう。図6は入出力モジュールが2式の場合を例示している。
【0004】
また、DMA転送を制御するDMAコントローラ100は、DMA転送要求/許可判定回路101、バス権要求/許可判定回路102、起動制御回路103、アドレスカウンタ104、転送回数制御回路105、バスインターフェイス106等で構成されている。
【0005】
このような回路構成の下でのDMA転送の動作を、入出力モジュール600からメモリ300にデータを転送する場合を例に説明する。
まずCPU200は、メモリ300内に転送データを受け取るための書込領域を準備する。そして、その書込領域の先頭アドレスをDMAコントローラ100内のアドレスカウンタ104に、転送データ数を転送回数制御回路105に設定し、続いて転送方向や転送元、転送許可等の転送制御情報を起動制御回路103に設定する。
【0006】
これらの転送に必要な制御情報が設定されると、DMAコントローラ100は、入出力モジュール600からのDMA転送要求信号DREQ0の入力待ち状態となる。次いでCPU200は、入出力モジュール600に対して受信開始の許可信号をバス500経由で送る。バス500は、アドレスバス、データバス、制御信号線で構成されている。
【0007】
この受信開始の許可信号を受け取った入出力モジュール600は、図示しない外部機器からのデータの受信を開始し、受信した最初のデータを内部の出力レジスタにセットする。その上で、メモリ300へのDMA転送を開始してもらうべくDMA転送要求信号DREQ0をDMAコントローラ100内のDMA転送要求/許可判定回路101に出力する。DREQ0信号を受け取ったDMA転送要求/許可判定回路101は、受け取ったDREQ信号が先にCPUより転送制御情報の設定を受けた転送元からの要求信号であることを確認をする。
【0008】
確認後、DMA転送要求/許可判定回路101は、バス権を獲得するためにバス権要求/許可判定回路102を通して、バス権要求信号BREQをバスアービタ400に出力する。ここでバス権の獲得とは、通常、バス500を使用しているCPU200から、バス500の使用許可を得る(図6のスイッチ800をCPU200側からDMAコントローラ100側に切り換え、バス500をDMAコントローラ100に接続する)ことで、その調停(スイッチ800の制御)を行うのがバスアービタ400である。
【0009】
バス権要求信号BREQを受け取ったバスアービタ400は、CPU200に対してバス500の使用要求があったことを通報する。そして、予め決められた調停ロジックによりバス権をDMAコントローラ100に渡し(スイッチ800をDMAコントローラ100側に切り換え、バス500をDMAコントローラ100に接続する)、そのことを知らせるためにバス権許可信号BACKをDMAコントローラ100内のバス権要求/許可判定回路102に出力する。
【0010】
バス権許可信号BACKを受け取ったバス権要求/許可判定回路102は、それをDMA転送要求/許可判定回路101に通報し、通報を受けたDMA転送要求/許可判定回路101は、入出力モジュール600に対しDMA転送許可信号DACK0を出力する。
【0011】
入出力モジュール600は、DACK0信号を受けて内部の出力レジスタに準備していた最初の転送データを、バス500内のデータバス上に出力する。するとDMAコントローラ100は、バスインターフェース106を介してバス500内のアドレスバスと制御線を操作し、データバス500上に出力された転送データをアドレスカウンタ104に設定されていたメモリ300内書込領域の先頭アドレスに書き込む。
【0012】
こうして最初のデータの転送が終わると、アドレスカウンタ104内の先頭アドレスは+1され、転送回数制御回路105内の転送データ数は−1される。続いて、入出力モジュール600は、二番目に受信したデータを内部の出力レジスタにセットした上、次のDMA転送を開始してもらうべくDMA転送要求信号DREQ0を、再びDMAコントローラ100内のDMA転送要求/許可判定回路101に出力する。
【0013】
以下、前述と同じ一連の動作が繰り返し行なわれ、転送回数制御回路105の内容がゼロになった時点、即ち、最初に設定された転送データ数だけのデータ転送が終わった時点で、一連のDMA転送が終了する。以上の説明から分かるようにDMA転送では、CPU200はDMAコントローラ100と入出力モジュール600にDMA転送に必要な制御情報を設定して起動をかけるだけである。それ以降、指定データ数の転送が終了するまでの一連のデータ転送は、DMAコントローラ100の制御の下で行なわれる。そのデータ転送はCPU200を介さないで、メモリ300と入出力モジュール600との間の直接転送で行なわれるため、DMA転送によるデータ転送は転送速度が極めて速く、またCPU200の負荷が軽くなる利点がある。
【0014】
【発明が解決しようとする課題】
しかし、こうした高速に行なわれるDMA転送の際に、データの転送エラーが生ずることがある。その一つに、入力モジュール600、700におけるオーバーランエラーの発生による転送エラーがある。これは上述の例で言えば、入出力モジュール600の出力レジスタに準備されたデータの転送が完了する前に、入出力モジュール600が次のデータの受信を完了し、そのデータで出力レジスタの内容を更新しまう場合に生ずる転送エラーである。
【0015】
これを図3、図4のタイミングチャートを参照して説明する。入出力モジュール600は、最初に受信したデータAを内部の出力レジスタにセットする。それと同時にDMAコントローラ100に対してDMA転送要求信号DREQ0を出力し、自身は次のデータBの受信を始める。DMAコントローラ100は、バス権を獲得してDMA転送許可信号DACK0を“ High ”レベルにして入出力モジュールに出力する。DACK0信号を受けた入出力モジュール600が、出力レジスタ内のデータAをバス500に乗せると、DMAコントローラ100がバス500内のアドレスバスと制御線を操作してデータAをメモリ300に書き込む。書き込み終了でDMAコントローラ100は、DACK0信号を“ Low ”レベルに戻す。
【0016】
ここで、入出力モジュール600が次のデータBを受信するのにかかる時間をT1とし、DREQ0信号の“ High ”の立ち上がりからDACK0信号が“ Low ”に戻るまでの時間をT2とする。図3に示すように、T1>T2 であれば、DACK0信号が“ High ”レベルの期間中、出力レジスタ内にはデータAが保持されているため、そのデータAがメモリ300に正常に書き込まれる。
【0017】
しかし、DMA転送要求信号DREQ0が出力され、DMAコントローラ100がバスアービタ400にBREQ信号を出力してバス権を要求した時に、バス500の負荷が高かったとする。するとバスアービタ400がバス権許可信号BACKを直ぐには返せないことが起こる。こうした場合には図4に示すように、DACK0信号が出力されるタイミングが遅れて、T1<T2となる場合が生じ得る。
【0018】
このようなことが生ずると、DACK0が“ High ”レベルとなる前、あるいは“ High ”レベルの期間中に出力レジスタの内容が、次に送られるべきデータBに置き換わってしまう。すると、先に転送されるべきであったデータAはメモリ300に転送されずに消えてしまい、次のデータBがメモリ300に誤って転送されてしまうことになる。これがオーバーランエラーの発生による転送エラーである。
【0019】
入出力モジュール600が受信データBを出力レジスタにセットする際に、前のデータAのDMA転送が完了していることを確認する。即ち、前のデータAに対応するDACK0信号が一度“ High ”レベルとなった上で“ Low ”に戻ったことを確認する。それが確認できない場合にはオーバーランエラーの発生と判定してCPU200に割込み信号を送って知らせる。このようになっていれば、CPU200は、それに対応した処置をとることができる。しかし、数ある入出力モジュールの中には、回路の簡素化、コスト低減のためにこのような機能を持たないものがある。その場合には、CPU200がオーバーランの発生を認知することができず、誤った転送データに基づいてその後の処理を続けるという不具合が生ずる。
【0020】
本発明はこのような不具合に対処するためになされたもので、上述のようなオーバーランエラーの発生を入出力モジュールに代わって検出し、CPUに通報する機能を有するDMAコントローラを提供することを課題としている。
【0021】
【課題を解決するための手段】
上記目的を達成するために、本発明のDMAコントローラにおいては、入出力モジュールが次の転送データを準備するために必要な最短時間を設定する最短時間設定レジスタと、入出力モジュールからのDMA転送要求信号の受信からの経過時間を計測するカウンタタイマと、該カウンタタイマの計測時間と前記最短時間とを比較する比較回路とを設けた。そしてカウンタタイマの計測時間が前記最短時間を超えた時にCPUに割込み信号を送るように構成した。
【0022】
これにより、転送データの消失というオーバーランエラーが高い確率で発生しうる状態が生じたことをCPUが認識できるようになる。従ってCPUがオーバーランエラーの発生に気づかず、誤った転送データに基づいてその後の処理を進めてしまうという異常事態を回避することが可能になる。
【0023】
また、好ましくは、前記カウンタタイマは、入出力モジュールからのDMA転送要求信号を受けて、該カウンタタイマを一旦リセットする。そして直ちに計時用クロックパルスの計数を開始し、DMAコントローラから入出力モジュールへの1データのDMA転送終了により計数を停止すると良い。
【0024】
このように、計時用クロックパルスの計数開始直前にカウンタタイマをリセットすれば、前回のカウント数がリセットされて正確な計時が可能になる。また、DMA転送終了後の計数は、意味がないので計数を停止するのが好ましい。
【0025】
また、好ましくは前記カウンタタイマの内容をCPUに読み込めるように構成するとよい。
このように構成すれば、DMA転送要求開始から1データのDMA転送終了までに要した時間をCPUが認識できる効果がある。
【0026】
【発明の実施の形態】
本発明の実施の形態を実施例にもとづき図1、図2を参照して説明する。
図1は、本発明のDMAコントローラ1の内部回路構成の一例である。DMAコントローラ1は、DMA転送要求/許可判定回路2、バス権要求/許可判定回路3、起動制御回路4、アドレスカウンタ5、転送回数制御回路6、バスインターフェース7、オーバーラン検出回路8を備えている。オーバーラン検出回路8は、最短時間設定レジスタ8a、カウンタタイマ8b、比較回路8cを備えている。
【0027】
図2は、このDMAコントローラ1を用いたDMA転送回路の構成例である。このDMA転送回路は、図6の場合と同様に、DMAコントローラ1、CPU10、メモリ11、バスアービタ12、バス13、入出力モジュール14、15等で構成されている。ここで入出力モジュール14、15は、シリアル通信装置、フロッピーディスク装置等の外部入出力装置で、図2は入出力モジュールが2式の場合を例示している。
【0028】
以下、このような回路構成の下で、入出力モジュール14が受信(準備)したデータをメモリ11にDMA転送する場合の動作を説明する。
まずCPU10は、転送データを受け取るための書込領域をメモリ11内に準備する。そして、その書込領域の先頭アドレスをDMAコントローラ1内のアドレスカウンタ5に、転送データ数を転送回数制御回路6に、転送方向や転送元、転送許可等の制御情報を起動制御回路4に設定する。
【0029】
続いてCPU10は、入出力モジュール14が転送データを受信(準備)するのにかかると予測される最短時間(例えば、入出力モジュール14がシリアル通信モジュールの場合には、外部装置より1データを受信するのに要する最短時間)T1minを、オーバーラン検出回路8内の最短時間設定レジスタ8aに設定する。最短時間T1minは、図3に示すタイミングチャートで言えば、データB受信時間T1の予想される最小値である。その値は、各入出力モジュール毎に予めメモリ11に記憶させておく。
【0030】
これらの各制御情報が設定されると、DMAコントローラ1は、入出力モジュール14からのDMA転送要求信号DREQ0の入力待ち状態となる。次いでCPU10は、入出力モジュール14に対して受信開始の許可信号をバス13経由で送る。バス13は、アドレスバス、データバス、制御信号線で構成されている。
【0031】
この受信開始の許可信号を受け取った入出力モジュール14は、外部装置よりデータの受信を開始し、受信した最初のデータを内部の出力レジスタにセットする。そしてメモリ11へのDMA転送を開始してもらうべく、DMA転送要求信号DREQ0をDMAコントローラ1内のDMA転送要求/許可判定回路2に出力する。その後、入出力モジュール14は、次に転送するデータの受信(準備)を開始する。
【0032】
DREQ0信号を受け取ったDMA転送要求/許可判定回路2は、CPU10からバス権を獲得するためにバス権要求/許可判定回路3を通して、バス権要求信号BREQをバスアービタ12に出力する。
【0033】
これと同時にDMA転送要求/許可判定回路2は、カウンタタイマ8bに転送要求受付信号を送り、オーバーラン検出回路8内のカウンタタイマ8bを一旦リセットしてゼロにさせた上で、計数を開始させる。カウンタタイマ8は、計時用クロックパルス(図示しない)を計数し、計数開始からの経過時間、すなわち入出力モジュール14がDREQ0信号を出力してからの経過時間Telを計測する。
【0034】
このカウンタタイマ8bで計測された経過時間Telは、先に最短時間設定レジスタ8aに設定された最短時間T1minと比較回路8cにて比較される。そして
Tel≧T1min (1)式
と判定された時に、比較回路8cよりバスインターフェース7とバス13内の制御線を通じてCPU10に割込み信号が送られるようになっている。
なお、カウンタタイマ8bの内容は、CPU10に読み込めるようにしておくと良い。
【0035】
これに続く動作は、最初のデータのDMA転送中に、上記(1)式の条件が成立する場合と成立しない場合とで分かれる。まず上記(1)式の条件が転送途中で成立しない場合の動作について説明する。
バス権要求信号BREQを受け取ったバスアービタ12は、CPU10に対してバス13の使用要求があったことを通報する。そして、予め決められた調停ロジックによりバス権をDMAコントローラ1に渡し(スイッチ16をDMAコントローラ1側に切り換え、バス13をDMAコントローラ1に接続する)、そのことを知らせるためにバス権許可信号BACKをバス権要求/判定回路3に出力する。
【0036】
バス権許可信号BACKを受け取ったバス権要求/許可判定回路3は、それをDMA転送要求/許可判定回路2に通報する。通報を受けたDMA転送要求/許可判定回路2は、入出力モジュール14に対しDMA転送許可信号DACK0を出力する。
【0037】
入出力モジュール14は、DACK0信号を受けて内部の出力レジスタに準備していた最初の転送データをバス13内のデータバス上に出力する。するとDMAコントローラ1は、バスインターフェース7を介してバス13内のアドレスバスと制御線を操作し、データバス上に出力された転送データをアドレスカウンタ5に設定されていた書込領域の先頭アドレスに書き込む。
書き込みが終了すると、DMA転送要求/許可判定回路2は、DACK0信号を“ Low ”レベルに戻す。それと同時、すなわち最初のデータの転送終了と同時にカウンタタイマ8bに転送許可終了信号を送って計数を停止させる。
【0038】
こうして最初のデータの転送が完了すると、アドレスカウンタ5内の先頭アドレスは+1され、転送回数制御回路6内の転送データ数は−1される。入出力モジュール14は、次に転送するデータを内部の出力レジスタに準備し、次のDMA転送を開始してもらうべくDMA転送要求信号DREQ0を、再びDMAコントローラ1内のDMA転送要求/許可判定回路2に出力する。以上の一連の動作タイミングは、前述した図3に示すものと同じである。
以下、このような一連の動作の繰り返しにより、転送回数制御回路6に最初に設定された転送データ数だけのデータ転送が行なわれ、一連のDMA転送が終了する。
【0039】
次に、前記(1)式の条件が転送途中で成立する場合の動作について説明する。これは図4に示したタイミングチャートに相当する場合である。
入出力モジュール14は、最初の転送データを内部の出力レジスタに設定する。そしてDMA転送を開始してもらうべくDMA転送要求信号DREQ0をDMAコントローラ1内のDMA転送要求/許可判定回路2に出力する。その後、入出力モジュール14は、次に転送するデータの受信(準備)を開始する。
【0040】
DREQ0信号を受けたDMA転送要求/許可判定回路2は、CPU10からバス権を獲得するためにバス権要求/許可判定回路3を通して、バス権要求信号BREQをバスアービタ12に送る。そしてバス権を得て、DACK0信号を入出力モジュール14に返す。しかし、本ケースの場合は、DACK0信号が出力し終えるまで、すなわちDACK0信号が一旦“ High ”レベルになった後、“ Low ”レベルに戻る前に前記(1)式の条件が成立する。
【0041】
前記(1)式の条件が成立した場合に、そのまま動作が継続されたとする。すると図4のタイミングチャートに示すように、DACK0信号によりメモリ11にデータが書き込まれる瞬間には、入出力モジュール14の出力レジスタの内容は、本来転送されるべきデータAではなく、次に転送されるべきデータBに置き換わっている可能性が高い(設定時間T1minは、T1の予想最短時間であるので、経過時間TelがT1minを超えても、出力レジスタ内にデータAが残っている場合もあり得る)。
【0042】
(1)式の条件が成立すると、直ちに比較回路8cより割込み信号がCPU10に送られる。これにより、CPU10は異常転送よるデータの消失、すなわちオーバーランエラーが高い確率で生じる状態が発生したことを認識することができる。
【0043】
CPU10がこのような状態の発生を認識せずに、その後の処理を進めれば、誤った転送データに基づく処理がなされて取り返しのつかない事態が発生し得る。しかし本発明の構成によれば、CPU10は、このような事態の発生を事前に認識することができる。従って、その後の処理を中止したり、あるいは転送データを破棄して入出力モジュール14に再度転送要求を発生させるなどの対策を採ることができ、取り返しのつかない事態を回避することが可能となる。
【図面の簡単な説明】
【図1】本発明のDMAコントローラの構成ブロック図である。
【図2】本発明のDMAコントローラを用いたDMA転送回路の構成例である。
【図3】DMA転送が正常に行われる場合のタイミングチャートである。
【図4】DMA転送にオーバーランエラーが発生する場合のタイミングチャートである。
【図5】従来技術を示す図1相当図である。
【図6】従来技術を示す図2相当図である。
【符号の説明】
図面中、1はDMAコントローラ、8はオーバーラン検出回路、8aは最短時間設定レジスタ、8bはカウンタタイマ、8cは比較回路、10はCPU、11はメモリ、12はバスアービタ、14、15は入出力モジュールである。[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a DMA controller which controls DMA transfer of data between a memory and an input / output module of a microcomputer system, for example.
[0002]
[Prior art]
For example, in a microcomputer system, high-speed data transfer called DMA (abbreviation of Direct Memory Access) transfer between a memory and an external input / output module has been widely adopted. This is a method in which data is directly transferred between a memory and an input / output module without passing through a CPU. A circuit that controls this data transfer is called a DMA controller.
[0003]
FIG. 5 is a block diagram showing an example of the internal configuration of such a
[0004]
The
[0005]
The operation of the DMA transfer under such a circuit configuration will be described by taking as an example a case where data is transferred from the input /
First, the
[0006]
When the control information necessary for these transfers is set, the
[0007]
The input /
[0008]
After the confirmation, the DMA transfer request /
[0009]
The
[0010]
The bus right request /
[0011]
The input /
[0012]
When the transfer of the first data is completed, the top address in the
[0013]
Thereafter, the same series of operations as described above are repeatedly performed, and when the contents of the transfer
[0014]
[Problems to be solved by the invention]
However, during such a high-speed DMA transfer, a data transfer error may occur. One of them is a transfer error due to occurrence of an overrun error in the
[0015]
This will be described with reference to the timing charts of FIGS. The input /
[0016]
Here, the time required for the input /
[0017]
However, it is assumed that when the DMA transfer request signal DREQ0 is output and the
[0018]
When such a situation occurs, the contents of the output register are replaced with data B to be transmitted next before DACK0 goes to the “High” level or during the period of the “High” level. Then, the data A, which should have been transferred earlier, disappears without being transferred to the
[0019]
When the input /
[0020]
SUMMARY OF THE INVENTION The present invention has been made in order to cope with such a problem, and it is an object of the present invention to provide a DMA controller having a function of detecting the occurrence of the overrun error as described above in place of the input / output module and reporting the occurrence to the CPU. It is an issue.
[0021]
[Means for Solving the Problems]
In order to achieve the above object, in the DMA controller of the present invention, a minimum time setting register for setting a minimum time required for the input / output module to prepare the next transfer data, a DMA transfer request from the input / output module. A counter timer for measuring an elapsed time from the reception of the signal and a comparison circuit for comparing the measured time of the counter timer with the shortest time are provided. Then, an interrupt signal is sent to the CPU when the measurement time of the counter timer exceeds the minimum time.
[0022]
As a result, the CPU can recognize that a state has occurred in which an overrun error of loss of transfer data can occur with a high probability. Therefore, it is possible to avoid an abnormal situation in which the CPU does not notice the occurrence of the overrun error and proceeds with subsequent processing based on erroneous transfer data.
[0023]
Preferably, the counter timer resets the counter timer once upon receiving a DMA transfer request signal from the input / output module. Then, the counting of the clock pulse is started immediately, and the counting is preferably stopped when the DMA transfer of one data from the DMA controller to the input / output module is completed.
[0024]
As described above, if the counter timer is reset immediately before the counting of the clock pulse for clocking is started, the previous count number is reset and accurate clocking can be performed. The counting after the end of the DMA transfer is meaningless, so it is preferable to stop counting.
[0025]
Preferably, the contents of the counter timer may be read into the CPU.
With this configuration, the CPU can recognize the time required from the start of the DMA transfer request to the end of the DMA transfer of one data.
[0026]
BEST MODE FOR CARRYING OUT THE INVENTION
An embodiment of the present invention will be described based on an example with reference to FIGS.
FIG. 1 is an example of an internal circuit configuration of a DMA controller 1 according to the present invention. The DMA controller 1 includes a DMA transfer request / permission determination circuit 2, a bus right request / permission determination circuit 3, an activation control circuit 4, an address counter 5, a transfer count control circuit 6, a bus interface 7, and an overrun detection circuit 8. I have. The overrun detection circuit 8 includes a shortest time setting register 8a, a counter timer 8b, and a
[0027]
FIG. 2 shows a configuration example of a DMA transfer circuit using the DMA controller 1. This DMA transfer circuit includes a DMA controller 1, a
[0028]
Hereinafter, an operation when the input / output module 14 performs DMA transfer of the data received (prepared) to the memory 11 under such a circuit configuration will be described.
First, the
[0029]
Subsequently, the
[0030]
When these pieces of control information are set, the DMA controller 1 waits for the input of the DMA transfer request signal DREQ0 from the input / output module 14. Next, the
[0031]
The input / output module 14, which has received the reception start permission signal, starts receiving data from an external device, and sets the first received data in an internal output register. Then, a DMA transfer request signal DREQ0 is output to the DMA transfer request / permission determination circuit 2 in the DMA controller 1 so that the DMA transfer to the memory 11 is started. Thereafter, the input / output module 14 starts receiving (preparing) the next data to be transferred.
[0032]
The DMA transfer request / permission determination circuit 2 that has received the DREQ0 signal outputs the bus right request signal BREQ to the
[0033]
At the same time, the DMA transfer request / permission determination circuit 2 sends a transfer request acceptance signal to the counter timer 8b, resets the counter timer 8b in the overrun detection circuit 8 once to zero, and starts counting. . The counter timer 8 counts a clock pulse (not shown) for counting a time, and measures an elapsed time from the start of counting, that is, an elapsed time Tel from when the input / output module 14 outputs the DREQ0 signal.
[0034]
The elapsed time Tel measured by the counter timer 8b is compared with the shortest time T1min previously set in the shortest time setting register 8a by the
It is preferable that the contents of the counter timer 8b can be read by the
[0035]
Subsequent operations are divided into a case where the condition of the above expression (1) is satisfied and a case where the condition is not satisfied during the first data DMA transfer. First, the operation when the condition of the above equation (1) is not satisfied during transfer will be described.
The
[0036]
The bus right request / permission determination circuit 3 that has received the bus right permission signal BACK reports this to the DMA transfer request / permission determination circuit 2. The DMA transfer request / permission determination circuit 2 that has received the notification outputs the DMA transfer permission signal DACK0 to the input / output module 14.
[0037]
The input / output module 14 receives the DACK0 signal and outputs the first transfer data prepared in the internal output register onto the data bus in the bus 13. Then, the DMA controller 1 operates the address bus and the control line in the bus 13 via the bus interface 7 to transfer the transfer data output on the data bus to the head address of the write area set in the address counter 5. Write.
When the writing is completed, the DMA transfer request / permission determination circuit 2 returns the DACK0 signal to the “Low” level. At the same time, that is, simultaneously with the end of the transfer of the first data, a transfer permission end signal is sent to the counter timer 8b to stop counting.
[0038]
When the transfer of the first data is completed in this way, the top address in the address counter 5 is incremented by one, and the number of transfer data in the transfer number control circuit 6 is decremented by one. The input / output module 14 prepares data to be transferred next in an internal output register, and sends a DMA transfer request signal DREQ0 again to start the next DMA transfer, to the DMA transfer request / permission determination circuit in the DMA controller 1. Output to 2. The above series of operation timings are the same as those shown in FIG. 3 described above.
Thereafter, by repeating such a series of operations, data transfer is performed for the number of transfer data initially set in the transfer number control circuit 6, and a series of DMA transfer ends.
[0039]
Next, the operation when the condition of the above equation (1) is satisfied during the transfer will be described. This is a case corresponding to the timing chart shown in FIG.
The input / output module 14 sets the first transfer data in an internal output register. Then, a DMA transfer request signal DREQ0 is output to the DMA transfer request / permission determination circuit 2 in the DMA controller 1 so as to start the DMA transfer. Thereafter, the input / output module 14 starts receiving (preparing) the next data to be transferred.
[0040]
The DMA transfer request / permission determination circuit 2 that has received the DREQ0 signal sends the bus right request signal BREQ to the
[0041]
It is assumed that the operation is continued as it is when the condition of the expression (1) is satisfied. Then, as shown in the timing chart of FIG. 4, at the moment when the data is written to the memory 11 by the DACK0 signal, the contents of the output register of the input / output module 14 are not the data A to be transferred but the data to be transferred next. There is a high possibility that the data A has been replaced with the data B to be set. (Since the set time T1min is the shortest expected time of T1, the data A may remain in the output register even if the elapsed time Tel exceeds T1min. obtain).
[0042]
As soon as the condition of the expression (1) is satisfied, an interrupt signal is sent to the
[0043]
If the
[Brief description of the drawings]
FIG. 1 is a configuration block diagram of a DMA controller of the present invention.
FIG. 2 is a configuration example of a DMA transfer circuit using a DMA controller of the present invention.
FIG. 3 is a timing chart when DMA transfer is performed normally.
FIG. 4 is a timing chart when an overrun error occurs in a DMA transfer.
FIG. 5 is a diagram corresponding to FIG. 1 showing a conventional technique.
FIG. 6 is a diagram corresponding to FIG. 2, showing a conventional technique.
[Explanation of symbols]
In the drawing, 1 is a DMA controller, 8 is an overrun detection circuit, 8a is a shortest time setting register, 8b is a counter timer, 8c is a comparison circuit, 10 is a CPU, 11 is a memory, 12 is a bus arbiter, and 14 and 15 are input / output. Module.
Claims (3)
前記入出力モジュールが次の転送データを準備するために必要な最短時間を設定する最短時間設定レジスタと、
前記入出力モジュールからのDMA転送要求信号の受信からの経過時間を計測するカウンタタイマと、
前記カウンタタイマの計測時間と前記最短時間とを比較して前記計測時間が前記最短時間を超えた時にCPUに割込み信号を送る比較回路と、
を備えたことを特徴とするDMAコントローラ。A DMA controller for controlling DMA transfer of data between an input / output module and a memory,
A minimum time setting register that sets the minimum time required for the input / output module to prepare the next transfer data;
A counter timer for measuring an elapsed time since receiving the DMA transfer request signal from the input / output module;
A comparison circuit that compares the measurement time of the counter timer with the minimum time and sends an interrupt signal to the CPU when the measurement time exceeds the minimum time;
A DMA controller comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002164153A JP2004013395A (en) | 2002-06-05 | 2002-06-05 | Dma controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002164153A JP2004013395A (en) | 2002-06-05 | 2002-06-05 | Dma controller |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2004013395A true JP2004013395A (en) | 2004-01-15 |
Family
ID=30432379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002164153A Pending JP2004013395A (en) | 2002-06-05 | 2002-06-05 | Dma controller |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2004013395A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007003986A1 (en) | 2005-06-30 | 2007-01-11 | Freescale Semiconductor, Inc. | Device and method for controlling an execution of a dma task |
US7930444B2 (en) | 2005-06-30 | 2011-04-19 | Freescale Semiconductor, Inc. | Device and method for controlling multiple DMA tasks |
US8239587B2 (en) | 2006-01-18 | 2012-08-07 | Freescale Semiconductor, Inc. | Device having data sharing capabilities and a method for sharing data |
US8572296B2 (en) | 2005-06-30 | 2013-10-29 | Freescale Semiconductor, Inc. | Device and method for arbitrating between direct memory access task requests |
-
2002
- 2002-06-05 JP JP2002164153A patent/JP2004013395A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2007003986A1 (en) | 2005-06-30 | 2007-01-11 | Freescale Semiconductor, Inc. | Device and method for controlling an execution of a dma task |
US7930444B2 (en) | 2005-06-30 | 2011-04-19 | Freescale Semiconductor, Inc. | Device and method for controlling multiple DMA tasks |
US8001430B2 (en) | 2005-06-30 | 2011-08-16 | Freescale Semiconductor, Inc. | Device and method for controlling an execution of a DMA task |
US8572296B2 (en) | 2005-06-30 | 2013-10-29 | Freescale Semiconductor, Inc. | Device and method for arbitrating between direct memory access task requests |
US8239587B2 (en) | 2006-01-18 | 2012-08-07 | Freescale Semiconductor, Inc. | Device having data sharing capabilities and a method for sharing data |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3604398B2 (en) | High-speed parallel packetized module arbitration control and data bus | |
US7702841B2 (en) | Semiconductor integrated circuit and image processing apparatus having the same | |
KR100267130B1 (en) | Pci bus system | |
JP4063529B2 (en) | Bus system and retry method | |
US7124232B2 (en) | Bus connection circuit and bus connection system having plural request queues, a bus interface portion outputting request signals, an arbiter performing arbitration of plural requests and a bus interface portion outputting a request signal indicating allocation of pre-fetch buffers corresponding to arbitrated requests | |
KR930002787B1 (en) | Universal peripheral controller self-configuring bootloadable ramware | |
US4120029A (en) | Method and apparatus for recovering a signal transferred over a common bus in a data processing system | |
US6697904B1 (en) | Preventing starvation of agents on a bus bridge | |
JP2004013395A (en) | Dma controller | |
US5694586A (en) | Controller using time-domain filter connected to a signal line to control a time at which signal line is sampled for receipt of information transfer signal | |
US20010004749A1 (en) | Arbitration of control chipsets in bus transaction | |
JPS6043546B2 (en) | Data transfer error handling method | |
US5377334A (en) | Fast asynchronous resource master-slave combination | |
US7043595B2 (en) | Data transfer control device | |
US5664213A (en) | Input/output (I/O) holdoff mechanism for use in a system where I/O device inputs are fed through a latency introducing bus | |
JP2002269032A (en) | Bus arbiter | |
US10983927B2 (en) | Electronic device for recovering from buffer overrun in a bus system | |
JPS5818727A (en) | Method and apparatus for self-control of dispersion type priority competition | |
US6408353B1 (en) | Microcomputer having sampling function of retry requesting signal in syncronization with strobe signal | |
CN114884768B (en) | Detection device, system and detection method for bus idle state | |
US11775037B2 (en) | Method of resetting a master device of a system on chip and corresponding system on chip | |
JP3300016B2 (en) | Communication interface, recording device, and communication control method | |
JP2012182721A (en) | Image forming apparatus and control method thereof | |
JP2007095089A (en) | Bus arbiter | |
JP4152387B2 (en) | Bus system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040708 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20061024 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20061107 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20061221 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20070130 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20070731 |