JPH09114771A - Direct memory access device - Google Patents

Direct memory access device

Info

Publication number
JPH09114771A
JPH09114771A JP29616495A JP29616495A JPH09114771A JP H09114771 A JPH09114771 A JP H09114771A JP 29616495 A JP29616495 A JP 29616495A JP 29616495 A JP29616495 A JP 29616495A JP H09114771 A JPH09114771 A JP H09114771A
Authority
JP
Japan
Prior art keywords
data
memory access
direct memory
address
area
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
JP29616495A
Other languages
Japanese (ja)
Inventor
Shinichi Fukunaga
真一 福永
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP29616495A priority Critical patent/JPH09114771A/en
Publication of JPH09114771A publication Critical patent/JPH09114771A/en
Pending legal-status Critical Current

Links

Landscapes

  • Bus Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To perform direct memory access only in the case of data reception when direct memory access request signals are inputted. SOLUTION: At the time of receiving data sent from a communicating party 10, a chip 3 for communication asserts interruption signals 8 and the interruption signals 8 are inputted to the /DREQ terminal 13 of this DMA device 4 as the DMA request signals. The DMA device 4 obtains an address data bus 5, reads the contents of a status register 6 by using the address data bus 5, judges the contents of interruption by a status register judgement circuit 12 and performs the DMA only in the case of the data reception.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、CPU(中央処理
装置)を介さずにデータ入出力部とメモリとの間でデー
タの受渡しを行わせるダイレクトメモリアクセス装置に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a direct memory access device for transferring data between a data input / output unit and a memory without going through a CPU (central processing unit).

【0002】[0002]

【従来の技術】図5は、CPUおよびメモリを有し、外
部との間でデータの受渡しを行う電子機器の構成の一例
を示したものである。この電子機器は、CPU101
と、メモリ(ランダム・アクセス・メモリ)102と、
通信相手110との間でデータの入出力を行う通信用チ
ップ103と、タイミング生成回路104とを備えてい
る。
2. Description of the Related Art FIG. 5 shows an example of the configuration of an electronic device having a CPU and a memory for exchanging data with the outside. This electronic device is a CPU 101.
And a memory (random access memory) 102,
A communication chip 103 that inputs and outputs data to and from a communication partner 110 and a timing generation circuit 104 are provided.

【0003】CPU101、メモリ102および通信用
チップ103は互いにアドレス・データバス105によ
って接続されている。通信用チップ103はステータス
レジスタ106を有している。タイミング生成回路10
4は、CPU101、メモリ102および通信用チップ
103に接続され、メモリ102および通信用チップ1
03に制御信号107を送出するようになっている。通
信用チップ103はCPU101にインターラプト信号
108を送出するようになっている。
The CPU 101, the memory 102 and the communication chip 103 are connected to each other by an address / data bus 105. The communication chip 103 has a status register 106. Timing generation circuit 10
4 is connected to the CPU 101, the memory 102, and the communication chip 103, and the memory 102 and the communication chip 1
The control signal 107 is sent to the port 03. The communication chip 103 sends an interrupt signal 108 to the CPU 101.

【0004】図5に示した構成では、通信相手110と
通信する場合、通常は通信用チップ103は通信相手1
10からのデータを受信すると、インターラプト信号1
08をCPU101に送出する。CPU101は、イン
ターラプト信号108を入力すると、インターラプトル
ーチンの中でステータスレジスタ106を読み、読んだ
結果、データ受信のインターラプトであると分かった場
合にのみ、通信用チップ103内の図示しないデータレ
ジスタを読む。次に、CPU101は、受信したデータ
をメモリ102に書き込んで通信動作を終了する。この
ような動作の場合、データを1回受信する毎にインター
ラプトが発生し、CPU101がメモリ102にデータ
を移動させなければならず、CPU101の負荷が大き
くなるとともに時間がかかるという問題点がある。
In the configuration shown in FIG. 5, when communicating with the communication partner 110, the communication chip 103 is usually the communication partner 1
When the data from 10 is received, the interrupt signal 1
08 is sent to the CPU 101. When the CPU 101 receives the interrupt signal 108, the CPU 101 reads the status register 106 in the interrupt routine, and only when it is found that the result is an interrupt for data reception, data (not shown) in the communication chip 103 is read. Read the register. Next, the CPU 101 writes the received data in the memory 102 and ends the communication operation. In the case of such an operation, an interrupt occurs each time data is received, and the CPU 101 has to move the data to the memory 102, which increases the load on the CPU 101 and takes time. .

【0005】そこで、上記問題点を解決するために、図
6に示すように、ダイレクトメモリアクセス(以下、D
MAとも記す。)装置が用いられる。図6に示した電子
機器は、CPU101と、メモリ102と、通信用チッ
プ103と、DMA装置111とを備えている。また、
CPU101、メモリ102および通信用チップ103
は、互いにアドレス・データバス105によって接続さ
れている。通信用チップ103はステータスレジスタ1
06を有している。
Therefore, in order to solve the above problems, as shown in FIG. 6, direct memory access (hereinafter referred to as D
Also referred to as MA. ) A device is used. The electronic device shown in FIG. 6 includes a CPU 101, a memory 102, a communication chip 103, and a DMA device 111. Also,
CPU 101, memory 102, and communication chip 103
Are connected to each other by an address / data bus 105. Communication chip 103 is status register 1
06.

【0006】DMA装置111は、DMAリクエスト端
子(以下、/DREQ端子と記載する。)112を有
し、この/DREQ端子112に、DMAリクエスト信
号として、通信用チップ103からのインターラプト信
号108が入力されるようになっている。このDMA装
置111は、CPU101、メモリ102および通信用
チップ103に接続され、メモリ102および通信用チ
ップ103には制御信号107を送出するようになって
いる。図6に示した構成では、通信用チップ103は通
信相手110からのデータを受信すると、インターラプ
ト信号108をDMA装置111に送出し、DMA装置
111は通信用チップ103内の図示しないデータレジ
スタを読み、データをメモリ102に書き込む。
The DMA device 111 has a DMA request terminal (hereinafter referred to as a / DREQ terminal) 112, and the / DREQ terminal 112 receives an interrupt signal 108 from the communication chip 103 as a DMA request signal. It is supposed to be entered. The DMA device 111 is connected to the CPU 101, the memory 102 and the communication chip 103, and sends a control signal 107 to the memory 102 and the communication chip 103. In the configuration shown in FIG. 6, when the communication chip 103 receives data from the communication partner 110, it sends an interrupt signal 108 to the DMA device 111, and the DMA device 111 causes a data register (not shown) in the communication chip 103 to operate. Read and write data to memory 102.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、図6に
示した構成では、データ受信以外の要因でインターラプ
トがアサートされたときも、DMA装置111がデータ
レジスタを読みにいってしまうという不具合がある。と
ころで、通信相手110からのデータをメモリ102に
書き込む場合、通常は、メモリ102上に一定の大きさ
の領域を取り、この領域の最初から順に、通信相手11
0からのデータを書き込んでいき、領域の最後に達した
ら領域の最初に戻るという制御を行う。従来は、DMA
装置111で転送先の領域の大きさは指定できず、転送
先アドレスのインクリメントモード(転送先アドレスを
順次増加させるモード)と、デクリメントモード(転送
先アドレスを順次減少させるモード)しかなかったた
め、転送先アドレスが領域の最後(インクリメントモー
ドの場合は領域の最後のアドレス、デクリメントモード
の場合は領域の先頭のアドレス)に達した場合には、C
PU101でDMAの転送先アドレスを再設定する必要
があるという問題点があった。
However, the configuration shown in FIG. 6 has a problem that the DMA device 111 goes to read the data register even when the interrupt is asserted due to a factor other than the data reception. . By the way, when writing the data from the communication partner 110 to the memory 102, normally, an area of a certain size is taken in the memory 102, and the communication partner 11 is sequentially arranged from the beginning of this area.
The data is written from 0, and when the end of the area is reached, control is returned to the beginning of the area. Conventionally, DMA
Since the size of the transfer destination area cannot be specified by the device 111, there are only the transfer destination address increment mode (mode in which the transfer destination address is sequentially increased) and the decrement mode (mode in which the transfer destination address is sequentially decreased). If the destination address reaches the end of the area (the end address of the area in the increment mode, the start address of the area in the decrement mode), C
There is a problem that the PU 101 needs to reset the DMA transfer destination address.

【0008】また、従来は、データ転送元のデバイスが
8ビットデバイスであろうと16ビットデバイスであろ
と、DMAの動作としては、転送元のデータを1回読
み、転送先に1回書くという動作を行っていた。そのた
め、データバス巾が例えば32ビットの場合であって
も、一度に8ビットまたは16ビットのデータしか転送
することができず、データの転送回数が増大し、DMA
に時間がかかるという問題点があった。
Conventionally, whether the device of the data transfer source is an 8-bit device or a 16-bit device, the operation of the DMA is to read the data of the transfer source once and write it once to the transfer destination. Was going on. Therefore, even if the data bus width is, for example, 32 bits, only 8-bit or 16-bit data can be transferred at one time, and the number of times of data transfer increases, and the DMA
There was a problem that it took time.

【0009】そこで本発明の第1の目的は、ダイレクト
メモリアクセスリクエスト信号が入力されたときに、デ
ータ受信の場合にのみダイレクトメモリアクセスを行う
ことができるようにしたダイレクトメモリアクセス装置
を提供することにある。また、本発明の第2の目的は、
転送先アドレスを再設定することなく、メモリ内の一定
領域にデータを転送することができるようにしたダイレ
クトメモリアクセス装置を提供することにある。また、
本発明の第3の目的は、データの転送回数を少なくして
高速にダイレクトメモリアクセスを行うことができるよ
うにしたダイレクトメモリアクセス装置を提供すること
にある。
Therefore, a first object of the present invention is to provide a direct memory access device capable of performing direct memory access only when receiving data when a direct memory access request signal is input. It is in. A second object of the present invention is to
It is an object of the present invention to provide a direct memory access device capable of transferring data to a fixed area in a memory without resetting a transfer destination address. Also,
A third object of the present invention is to provide a direct memory access device capable of performing direct memory access at high speed by reducing the number of data transfers.

【0010】[0010]

【課題を解決するための手段】請求項1記載の発明で
は、データ入出力部とメモリとの間でダイレクトメモリ
アクセスを行うダイレクトメモリアクセス装置におい
て、データ入出力部から出力されるインターラプト信号
をダイレクトメモリアクセスリクエスト信号として入力
すると共に、ダイレクトメモリアクセスリクエスト信号
を入力したときに、データ入出力部内に保持されている
インターラプトの種類の情報を読み出し、その内容に応
じてダイレクトメモリアクセスを行うか否かを選択する
ように構成して、前記第1の目的を達成する。このダイ
レクトメモリアクセス装置では、データ入出力部から出
力されるインターラプト信号をダイレクトメモリアクセ
スリクエスト信号として入力したときに、データ入出力
部内に保持されているインターラプトの種類の情報を読
み出し、その内容に応じてダイレクトメモリアクセスを
行うか否かを選択するようになっている。
According to a first aspect of the present invention, in a direct memory access device for performing direct memory access between a data input / output unit and a memory, an interrupt signal output from the data input / output unit is transmitted. Whether to input the direct memory access request signal and read the interrupt type information held in the data input / output unit when the direct memory access request signal is input, and perform direct memory access according to the contents. It is configured to select whether or not to achieve the first object. In this direct memory access device, when the interrupt signal output from the data input / output unit is input as the direct memory access request signal, the information on the type of interrupt held in the data input / output unit is read and the contents thereof are read. Whether to perform direct memory access or not is selected according to.

【0011】請求項2記載の発明では、データ入出力部
とメモリとの間でダイレクトメモリアクセスを行うダイ
レクトメモリアクセス装置に、領域の大きさを含めてデ
ータ転送先の領域を指定する領域指定手段と、この領域
指定手段によって指定された領域内で昇順または降順に
データ転送先のアドレスを指定すると共に、データ転送
先のアドレスが領域の最後または最初に達したときにデ
ータ転送先のアドレスを領域の最初または最後に戻すデ
ータ転送先アドレス指定手段とを具備させて、前記第2
の目的を達成する。このダイレクトメモリアクセス装置
では、領域指定手段によって、領域の大きさを含めてデ
ータ転送先の領域が指定され、データ転送先アドレス指
定手段によって、領域指定手段によって指定された領域
内で昇順または降順にデータ転送先のアドレスが指定さ
れると共に、データ転送先のアドレスが領域の最後また
は最初に達したときにデータ転送先のアドレスが領域の
最初または最後に戻される。
According to the second aspect of the invention, the area designating means for designating the area of the data transfer destination including the size of the area in the direct memory access device for performing the direct memory access between the data input / output unit and the memory. And the address of the data transfer destination is specified in ascending or descending order within the area specified by the area specifying means, and when the address of the data transfer destination reaches the end or the beginning of the area, the address of the data transfer destination is set to the area. And a data transfer destination addressing means for returning to the beginning or end of the second
Achieve the objectives. In this direct memory access device, the area designation means designates the area of the data transfer destination including the size of the area, and the data transfer destination address designation means specifies the ascending or descending order within the area designated by the area designation means. The address of the data transfer destination is designated, and when the address of the data transfer destination reaches the end or the beginning of the area, the address of the data transfer destination is returned to the beginning or the end of the area.

【0012】請求項3記載の発明は、請求項2記載のダ
イレクトメモリアクセス装置において、領域指定手段に
よって指定された領域のうち転送されたデータをどのア
ドレスまで処理したかを示す処理終了アドレスを保持す
る処理終了アドレス保持手段を更に具備し、データ転送
先アドレスが処理終了アドレス保持手段によって保持さ
れた処理終了アドレスと一致したときには、処理終了ア
ドレスが変化するまでダイレクトメモリアクセスを行わ
ないように構成したものである。このダイレクトメモリ
アクセス装置では、処理終了アドレス保持手段によっ
て、領域指定手段によって指定された領域のうち、転送
されたデータをどのアドレスまで処理したかを示す処理
終了アドレスが保持され、データ転送先アドレスが処理
終了アドレス保持手段によって保持された処理終了アド
レスと一致したときには、処理終了アドレスが変化する
までダイレクトメモリアクセスを行わない。
According to a third aspect of the present invention, in the direct memory access device according to the second aspect, a processing end address is stored which indicates up to which address the transferred data in the area designated by the area designating unit has been processed. When the data transfer destination address matches the processing end address held by the processing end address holding means, direct memory access is not performed until the processing end address changes. It is a thing. In this direct memory access device, the processing end address holding means holds the processing end address indicating up to which address the transferred data has been processed in the area designated by the area designating means, and the data transfer destination address is When it coincides with the processing end address held by the processing end address holding means, direct memory access is not performed until the processing end address changes.

【0013】請求項4記載の発明では、データ入出力部
とメモリとの間でダイレクトメモリアクセスを行うダイ
レクトメモリアクセス装置において、転送データ巾の合
計がデータバス巾に一致するまでデータ入出力部よりデ
ータを読み出した後、これらのデータを1回の書き込み
動作でメモリに書き込むように構成して、前記第3の目
的を達成する。このダイレクトメモリアクセス装置で
は、転送データ巾の合計がデータバス巾に一致するまで
データ入出力部よりデータを読み出した後、これらのデ
ータを1回の書き込み動作でメモリに書き込む。
According to another aspect of the present invention, in a direct memory access device for performing direct memory access between a data input / output unit and a memory, data is transferred from the data input / output unit until the total transfer data width matches the data bus width. After the data is read, the data is written in the memory in one write operation to achieve the third object. In this direct memory access device, after reading the data from the data input / output unit until the total transfer data width matches the data bus width, these data are written in the memory by one write operation.

【0014】[0014]

【発明の実施の形態】以下、本発明のダイレクトメモリ
アクセス装置における好適な実施の形態について、図1
ないし図4を参照して詳細に説明する。図1は本発明の
第1の実施の形態に係るダイレクトメモリアクセス装置
(以下、DMA装置と記す。)を含む電子機器の構成を
示すブロック図である。この電子機器は、CPU1と、
受信バッファとなるメモリ(ランダム・アクセス・メモ
リ)2と、通信相手10との間でデータの入出力を行う
通信用チップ3と、DMA装置4とを具備している。
BEST MODE FOR CARRYING OUT THE INVENTION A preferred embodiment of a direct memory access device of the present invention will be described below with reference to FIG.
This will be described in detail with reference to FIG. FIG. 1 is a block diagram showing a configuration of an electronic device including a direct memory access device (hereinafter, referred to as a DMA device) according to a first embodiment of the present invention. This electronic device includes a CPU 1,
A memory (random access memory) 2 serving as a reception buffer, a communication chip 3 for inputting / outputting data to / from a communication partner 10, and a DMA device 4 are provided.

【0015】CPU1、メモリ2、通信用チップ3およ
びDMA装置4は互いにアドレス・データバス5によっ
て接続されている。通信用チップ3は、インターラプト
の種類の情報を含むステータス情報を保持するステータ
スレジスタ6および受信データを保持するデータレジス
タ11を有している。DMA装置4は、ステータスレジ
スタ6内のステータス情報の内容を判定するステータス
レジスタ判定回路12を有している。また、DMA装置
4は、DMAリクエスト端子(以下、/DREQ端子と
記す。)13を有し、この/DREQ端子13に、DM
Aリクエスト信号として、通信用チップ3からのインタ
ーラプト信号8が入力されるようになっている。また、
DMA装置4は、CPU1、メモリ2および通信用チッ
プ3に接続され、メモリ2および通信用チップ3には制
御信号7を送出し、CPU1にはインターラプト信号1
4およびバス制御信号15を送出するようになってい
る。
The CPU 1, memory 2, communication chip 3 and DMA device 4 are connected to each other by an address / data bus 5. The communication chip 3 has a status register 6 that holds status information including information on the type of interrupt, and a data register 11 that holds received data. The DMA device 4 has a status register determination circuit 12 that determines the contents of the status information in the status register 6. Further, the DMA device 4 has a DMA request terminal (hereinafter, referred to as a / DREQ terminal) 13, and a DM request terminal 13
As the A request signal, the interrupt signal 8 from the communication chip 3 is input. Also,
The DMA device 4 is connected to the CPU 1, the memory 2 and the communication chip 3, sends a control signal 7 to the memory 2 and the communication chip 3, and sends an interrupt signal 1 to the CPU 1.
4 and the bus control signal 15 are transmitted.

【0016】図2は、図1におけるステータスレジスタ
6の内容の一例を示す説明図である。この例では、ステ
ータスレジスタ6は8ビット構成であり、ビットb0が
“1”のとき通信エラーのインターラプトであることを
示し、ビットb1が“1”のときデータ受信のインター
ラプトであることを示すようになっている。
FIG. 2 is an explanatory diagram showing an example of the contents of the status register 6 in FIG. In this example, the status register 6 has an 8-bit configuration, and when the bit b0 is “1”, it indicates that the communication error has occurred, and when the bit b1 is “1”, it indicates that the data reception interrupt has occurred. As shown.

【0017】次に、本実施の形態に係るDMA装置4を
含む電子機器の動作について説明する。通信用チップ3
は、通信相手10から送られてきたデータを受信する
と、インターラプト信号8をアサートする。このインタ
ーラプト信号8は、DMAリクエスト信号として、DM
A装置4の/DREQ端子13に入力される。すると、
DMA装置4は、以下の手順の動作を行う。 1.まず、アドレス・データバス5を取得するために、
バス制御信号15によってCPU1にバスの開放を要求
する。 2.バスが取れたら、アドレス・データバス5を使って
ステータスレジスタ6の内容を読み出し、ステータスレ
ジスタ判定回路12によって、インターラプトの内容を
判定する。
Next, the operation of the electronic equipment including the DMA device 4 according to the present embodiment will be described. Communication chip 3
When receiving the data sent from the communication partner 10, asserts the interrupt signal 8. This interrupt signal 8 is DM request signal, DM
It is input to the / DREQ terminal 13 of the A device 4. Then
The DMA device 4 operates according to the following procedure. 1. First, in order to acquire the address / data bus 5,
The bus control signal 15 requests the CPU 1 to release the bus. 2. When the bus is taken, the contents of the status register 6 are read using the address / data bus 5, and the contents of the interrupt are judged by the status register judging circuit 12.

【0018】3.ビットb1が“1”であればデータ受
信のインターラプトであるので、DMA、すなわちデー
タレジスタ11からメモリ2への受信データの転送を行
う。 4.ビットb1が“0”であればデータ受信のインター
ラプトではないので、CPU1に対してインターラプト
信号14をアサートしエラー処理を行わせる。 5.バスを開放し、使用権をCPU1に戻す。
3. If the bit b1 is "1", it means that the data reception is interrupted. Therefore, the received data is transferred from the data register 11 to the memory 2 by DMA. 4. If the bit b1 is "0", the interrupt is not a data reception interrupt, and therefore the CPU 1 asserts the interrupt signal 14 to cause error processing. 5. The bus is released and the usage right is returned to the CPU1.

【0019】このように本実施の形態によれば、DMA
装置4がインターラプト信号8を入力したときに、デー
タ受信のインターラプトか否かを自動的に判定し、デー
タ受信の場合にのみDMAを行うようにしたので、デー
タ受信以外の要因でインターラプト信号8がアサートさ
れたときにDMA装置4がデータレジスタ11を読みに
いくという不具合がなくなる。また、CPU1は、DM
A装置4を用いたDMAを行わない場合においてCPU
1自身がデータをメモリ4に転送していた処理時間を他
の処理にまわすことができ、電子機器全体として性能が
向上する。
As described above, according to the present embodiment, the DMA
When the device 4 receives the interrupt signal 8, it automatically determines whether or not the interrupt is for data reception, and the DMA is performed only when data is received. The problem that the DMA device 4 goes to read the data register 11 when the signal 8 is asserted is eliminated. Also, the CPU 1 is DM
CPU when the DMA using the device A 4 is not performed
The processing time during which one itself has transferred the data to the memory 4 can be devoted to other processing, and the performance of the electronic device as a whole is improved.

【0020】次に、本発明の第2の実施の形態に係るD
MA装置について説明する。本実施の形態に係るDMA
装置4は、図3(a)〜(c)に示すように、それぞれ
例えば16ビット構成のDMA転送先設定レジスタ、D
MA転送アドレスカウンタおよびDMA転送アドレスカ
ウンタ有効ビット設定レジスタを有している。DMA転
送先設定レジスタには転送先アドレスが設定されるよう
になっている。DMA転送アドレスカウンタはデータを
転送する毎にインクリメントまたはデクリメントするよ
うになっている。
Next, D according to the second embodiment of the present invention
The MA device will be described. DMA according to the present embodiment
As shown in FIGS. 3A to 3C, the device 4 has a 16-bit DMA transfer destination setting register, D, respectively.
It has an MA transfer address counter and a DMA transfer address counter valid bit setting register. A transfer destination address is set in the DMA transfer destination setting register. The DMA transfer address counter increments or decrements each time data is transferred.

【0021】DMA転送アドレスカウンタ有効ビット設
定レジスタは、メモリ2内の受信バッファとなるデータ
転送先の領域の大きさを指定するようになっている。D
MA転送先設定レジスタおよびDMA転送アドレスカウ
ンタ有効ビット設定レジスタは本発明における領域指定
手段に対応し、DMA転送先設定レジスタおよびDMA
転送アドレスカウンタは本発明におけるデータ転送先ア
ドレス指定手段に対応する。
The DMA transfer address counter valid bit setting register is designed to specify the size of the area of the data transfer destination which becomes the receiving buffer in the memory 2. D
The MA transfer destination setting register and the DMA transfer address counter valid bit setting register correspond to the area designating means in the present invention.
The transfer address counter corresponds to the data transfer destination address designating means in the present invention.

【0022】本実施の形態では、DMA転送先設定レジ
スタに転送先アドレスを設定すると、DMA転送アドレ
スカウンタにも同じ内容がロードされる。DMA転送ア
ドレスカウンタは、データを転送する毎にインクリメン
トまたはデクリメントする。実際のDMA転送アドレス
は、図3(d)に示すように、DMA転送アドレスカウ
ンタ有効ビット設定レジスタにおいて“1”になってい
るビットと同じビットのDMA転送アドレスカウンタの
値(図3(b)において網掛け部で示す。)と、DMA
転送アドレスカウンタ有効ビット設定レジスタにおいて
“0”になっているビットと同じビットのDMA転送先
設定レジスタの値(図3(a)において網掛け部で示
す。)との合成になる。従って、データ転送先のアドレ
スがデータ転送先の領域の最後または最初に達したとき
には、データ転送先のアドレスはデータ転送先の領域の
最初または最後に戻されることになる。
In this embodiment, when the transfer destination address is set in the DMA transfer destination setting register, the same contents are loaded in the DMA transfer address counter. The DMA transfer address counter increments or decrements each time data is transferred. As shown in FIG. 3D, the actual DMA transfer address is the value of the DMA transfer address counter having the same bit as the bit set to “1” in the DMA transfer address counter valid bit setting register (FIG. 3B). , And the DMA is shown).
This is combined with the value of the DMA transfer destination setting register of the same bit as the bit set to "0" in the transfer address counter valid bit setting register (shown by the hatched portion in FIG. 3A). Therefore, when the address of the data transfer destination reaches the end or the beginning of the area of the data transfer destination, the address of the data transfer destination is returned to the beginning or the end of the area of the data transfer destination.

【0023】このように本実施の形態によれば、DMA
転送先の領域の大きさを決めることができ、且つデータ
転送先のアドレスがデータ転送先の領域の最後または最
初に達したときには、データ転送先のアドレスをデータ
転送先の領域の最初または最後に戻すことができるの
で、CPU1でデータ転送先のアドレスを再設定する必
要がなくなる。その他の構成、動作および効果は第1の
実施の形態の同様である。
As described above, according to the present embodiment, the DMA
The size of the transfer destination area can be determined, and when the data transfer destination address reaches the end or the beginning of the data transfer destination area, the data transfer destination address is set to the beginning or end of the data transfer destination area. Since the data can be returned, the CPU 1 does not need to reset the address of the data transfer destination. Other configurations, operations and effects are similar to those of the first embodiment.

【0024】次に、本発明の第3の実施の形態に係るD
MA装置について説明する。第2の実施の形態のように
受信バッファとなるデータ転送先の領域の大きさを決め
ると、CPU1が受信バッファのデータを処理する前に
受信バッファが一杯になって、データの上書きをしてし
まうおそれがある。そこで、本実施の形態では、データ
転送先の領域のうち、転送されたデータをどのアドレス
まで処理したかを示す処理終了アドレスを保持する処理
終了アドレスレジスタをDMA装置4に設けている。こ
の処理終了アドレスレジスタは、CPU1によって書き
込みが行われるようになっている。
Next, D according to the third embodiment of the present invention
The MA device will be described. When the size of the area of the data transfer destination serving as the reception buffer is determined as in the second embodiment, the reception buffer becomes full before the CPU 1 processes the data in the reception buffer, and the data is overwritten. There is a risk that Therefore, in the present embodiment, the DMA device 4 is provided with a processing end address register that holds a processing end address that indicates up to which address the transferred data has been processed in the data transfer destination area. The processing end address register is written by the CPU 1.

【0025】DMA装置4は、DMAを行ってメモリ2
に受信データを書き込む場合、処理終了アドレスレジス
タによって示されるアドレスまで書き込みを行う。デー
タ転送先のアドレスが既に処理終了アドレスレジスタに
よって示されるアドレスと同じ値になっているときに
は、CPU1の処理が進み、処理終了アドレスレジスタ
の内容が変化するまでデータ転送先のアドレスを変化さ
せず、DMAを実行せずに待つ。CPU1は、メモリ2
に転送されたデータの処理を行ったら、処理が終了した
量だけ処理終了アドレスを変化させて処理終了アドレス
レジスタに書き込む。このように本実施の形態によれ
ば、受信データを上書きしてしまってデータがなくなっ
てしまうことを防止することができる。その他の構成、
動作および効果は第2の実施の形態の同様である。
The DMA device 4 performs the DMA to execute the memory 2
When receiving data is written in, the data is written up to the address indicated by the processing end address register. When the address of the data transfer destination has already become the same value as the address indicated by the processing end address register, the processing of the CPU 1 proceeds, and the address of the data transfer destination is not changed until the content of the processing end address register changes, Wait without executing DMA. CPU1 is memory 2
After the processing of the data transferred to, the processing end address is changed by the amount by which the processing is completed and written in the processing end address register. Thus, according to the present embodiment, it is possible to prevent the received data from being overwritten and the data being lost. Other configurations,
The operation and effect are similar to those of the second embodiment.

【0026】次に、本発明の第4の実施の形態に係るD
MA装置について説明する。本実施の形態では、図4に
示すようなDMAバス巾レジスタをDMA装置4に設け
ている。このDMAバス巾レジスタは、例えば、8ビッ
ト構成であり、ビットb1,b0が“00”のときDM
Aデータ巾が8ビットであることを示し、ビットb1,
b0が“01”のときDMAデータ巾が16ビットであ
ることを示し、ビットb1,b0が“10”のときDM
Aデータ巾が32ビットであることを示し、ビットb
1,b0の“11”は設定禁止となっている。なお、本
実施の形態では、データバス巾は32ビットとなってい
る。また、DMAバス巾レジスタのビットb2は、
“0”のときBIG ENDIANに設定されているこ
とを示し、“1”のときLITTLE ENDIANに
設定されていることを示すようになっている。DMAバ
ス巾レジスタは、CPU1によって書き込みが行われる
ようになっている。
Next, D according to the fourth embodiment of the present invention.
The MA device will be described. In this embodiment, the DMA device 4 is provided with a DMA bus width register as shown in FIG. This DMA bus width register has, for example, an 8-bit configuration, and when bits b1 and b0 are "00", DM
Indicates that the A data width is 8 bits, and bit b1,
When b0 is "01", it indicates that the DMA data width is 16 bits, and when bits b1 and b0 are "10", it is DM.
Indicates that the A data width is 32 bits, and bit b
“11” of 1 and b0 is prohibited. In the present embodiment, the data bus width is 32 bits. Also, bit b2 of the DMA bus width register is
When it is "0", it indicates that it is set to BIG ENDIAN, and when it is "1", it indicates that it is set to LITTLE ENDIAN. The DMA bus width register is designed to be written by the CPU 1.

【0027】本実施の形態に係るDMA装置4は以下の
ような動作を行う。 1.DMA装置4がDMAを行う前に、CPU1によっ
て予めDMAバス巾レジスタが設定される。 2.DMAバス巾レジスタのビットb1,b0が“1
0”に設定された場合、すなわち、DMAデータ巾が3
2ビットに設定された場合は、DMA装置4は、1回の
読み出しに対して1回の書き込みを行う。 3.DMAバス巾レジスタのビットb1,b0が“0
1”に設定された場合、すなわち、DMAデータ巾が1
6ビットに設定された場合は、DMA装置4は、2回の
読み出しを行って32ビットのデータを作って1回の書
き込みを行う。この場合、DMAバス巾レジスタのビッ
トb2が“0”に設定されているとき、すなわち、BI
G ENDIANに設定されているときには、2回の読
み出しデータを上位16ビット、下位16ビットの順番
で並べて32ビットのデータを作り、DMAバス巾レジ
スタのビットb2が“1”に設定されているとき、すな
わち、LITTLE ENDIANに設定されていると
きには、2回の読み出しデータを下位16ビット、上位
16ビットの順番で並べて32ビットのデータを作る。
なお、32ビットのデータが揃うまではデータレジスタ
11にデータをラッチさせておく。
The DMA device 4 according to this embodiment operates as follows. 1. Before the DMA device 4 performs the DMA, the CPU 1 sets the DMA bus width register in advance. 2. Bits b1 and b0 of the DMA bus width register are "1"
When set to 0 ", that is, the DMA data width is 3
When it is set to 2 bits, the DMA device 4 writes once for each read. 3. Bits b1 and b0 of the DMA bus width register are "0"
When set to 1 ", that is, the DMA data width is 1
When set to 6 bits, the DMA device 4 performs two reads, creates 32-bit data, and performs one write. In this case, when bit b2 of the DMA bus width register is set to "0", that is, BI
When set to G ENDIAN, when the read data of two times are arranged in the order of upper 16 bits and lower 16 bits to make 32-bit data, and bit b2 of the DMA bus width register is set to "1" That is, when it is set to LITTLE ENDIAN, two read data are arranged in the order of lower 16 bits and upper 16 bits to form 32-bit data.
The data is latched in the data register 11 until the 32-bit data is collected.

【0028】4.DMAバス巾レジスタのビットb1,
b0が“00”に設定された場合、すなわち、DMAデ
ータ巾が8ビットに設定された場合は、DMA装置4
は、4回の読み出しを行って32ビットのデータを作っ
て1回の書き込みを行う。この場合、DMAバス巾レジ
スタのビットb2が“0”に設定されているとき、すな
わち、BIG ENDIANに設定されているときに
は、4回の読み出しデータを上位側から順に並べて32
ビットのデータを作り、DMAバス巾レジスタのビット
b2が“1”に設定されているとき、すなわち、LIT
TLE ENDIANに設定されているときには、4回
の読み出しデータを下位側から順に並べて32ビットの
データを作る。
4. Bit b1 of the DMA bus width register
When b0 is set to "00", that is, when the DMA data width is set to 8 bits, the DMA device 4
Reads out four times, creates 32-bit data, and writes once. In this case, when the bit b2 of the DMA bus width register is set to “0”, that is, when it is set to BIG ENDIAN, read data of four times are arranged in order from the upper side and 32
When bit data is created and bit b2 of the DMA bus width register is set to "1", that is, LIT
When set to TLE ENDIAN, read data of four times are arranged in order from the lower side to form 32-bit data.

【0029】このように本実施の形態によれば、データ
巾がデータバス巾よりも小さい場合に、データ巾の合計
がデータバス巾に一致するまでデータを読み出した後、
これらのデータを1回の書き込み動作でメモリ2に書き
込むようにしたので、データの転送回数を少なくでき、
高速にDMAを行うことができる。なお、本実施の形態
では、データバス巾を32ビットとしたが、これに限ら
れるものではない。その他の構成、動作および効果は第
1、第2または第3の実施の形態の同様である。
As described above, according to this embodiment, when the data width is smaller than the data bus width, the data is read until the total of the data widths matches the data bus width.
Since these data are written in the memory 2 by one writing operation, the number of times of data transfer can be reduced,
DMA can be performed at high speed. Although the data bus width is 32 bits in the present embodiment, it is not limited to this. Other configurations, operations and effects are similar to those of the first, second or third embodiment.

【0030】[0030]

【発明の効果】以上説明したように請求項1記載のダイ
レクトメモリアクセス装置によれば、データ入出力部か
ら出力されるインターラプト信号をダイレクトメモリア
クセスリクエスト信号として入力したときに、データ入
出力部内に保持されているインターラプトの種類の情報
を読み出し、その内容に応じてダイレクトメモリアクセ
スを行うか否かを選択するようにしたので、ダイレクト
メモリアクセスリクエスト信号が入力されたときに、デ
ータ受信の場合にのみダイレクトメモリアクセスを行う
ことができる。
As described above, according to the direct memory access device of the first aspect, when the interrupt signal output from the data input / output unit is input as the direct memory access request signal, Since the information of the interrupt type held in is read and whether or not direct memory access is performed is selected according to the contents, when the direct memory access request signal is input, the data reception Direct memory access can only be done if

【0031】また、請求項2記載のダイレクトメモリア
クセス装置によれば、領域指定手段によって、領域の大
きさを含めてデータ転送先の領域を指定し、データ転送
先アドレス指定手段によって、領域指定手段によって指
定された領域内で昇順または降順にデータ転送先のアド
レスを指定すると共に、データ転送先のアドレスが領域
の最後または最初に達したときにデータ転送先のアドレ
スを領域の最初または最後に戻すようにしたので、転送
先アドレスを再設定することなく、メモリ内の一定領域
にデータを転送することができる。
According to another aspect of the direct memory access device of the present invention, the area specifying means specifies the area of the data transfer destination including the size of the area, and the data transfer destination address specifying means causes the area specifying means. Specify the data transfer destination address in ascending or descending order within the area specified by, and return the data transfer destination address to the beginning or end of the area when the data transfer destination address reaches the end or beginning of the area. Since this is done, data can be transferred to a fixed area in the memory without resetting the transfer destination address.

【0032】また、請求項3記載のダイレクトメモリア
クセス装置によれば、処理終了アドレス保持手段によっ
て、領域指定手段によって指定された領域のうち転送さ
れたデータをどのアドレスまで処理したかを示す処理終
了アドレスを保持し、データ転送先アドレスが処理終了
アドレス保持手段によって保持された処理終了アドレス
と一致したときには、処理終了アドレスが変化するまで
ダイレクトメモリアクセスを行わないようにしたので、
上記請求項2記載のダイレクトメモリアクセス装置の効
果に加え、データ転送先の領域内でデータを上書きして
しまってデータがなくなってしまうことを防止すること
ができる。
According to another aspect of the direct memory access device of the present invention, the processing end address holding means indicates the end of processing which indicates up to which address the transferred data in the area designated by the area designating means has been processed. When the address is held and the data transfer destination address matches the processing end address held by the processing end address holding means, direct memory access is not performed until the processing end address changes.
In addition to the effect of the direct memory access device according to the second aspect, it is possible to prevent the data from being overwritten and lost in the area of the data transfer destination.

【0033】また、請求項4記載のダイレクトメモリア
クセス装置によれば、転送データ巾の合計がデータバス
巾に一致するまでデータ入出力部よりデータを読み出し
た後、これらのデータを1回の書き込み動作でメモリに
書き込むようにしたので、データの転送回数を少なくし
て高速にDMAを行うことができる。
According to another aspect of the direct memory access device of the present invention, after the data is read from the data input / output unit until the total transfer data width matches the data bus width, these data are written once. Since the data is written in the memory by the operation, the number of times of data transfer can be reduced and the DMA can be performed at high speed.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の第1の実施の形態に係るダイレクトメ
モリアクセス装置を含む電子機器の構成を示すブロック
図である。
FIG. 1 is a block diagram showing a configuration of an electronic device including a direct memory access device according to a first embodiment of the present invention.

【図2】図1におけるステータスレジスタの内容の一例
を示す説明図である。
FIG. 2 is an explanatory diagram showing an example of contents of a status register in FIG.

【図3】本発明の第2の実施の形態に係るダイレクトメ
モリアクセス装置の動作を説明するための説明図であ
る。
FIG. 3 is an explanatory diagram for explaining the operation of the direct memory access device according to the second embodiment of the present invention.

【図4】本発明の第4の実施の形態に係るダイレクトメ
モリアクセス装置におけるDMAバス巾レジスタの内容
を示す説明図である。
FIG. 4 is an explanatory diagram showing contents of a DMA bus width register in a direct memory access device according to a fourth embodiment of the present invention.

【図5】CPUを用いて受信データをメモリに転送する
従来の電子機器の構成を示すブロック図である。
FIG. 5 is a block diagram showing a configuration of a conventional electronic device that transfers received data to a memory using a CPU.

【図6】DMA装置によって受信データをメモリに転送
する従来の電子機器の構成を示すブロック図である。
FIG. 6 is a block diagram showing a configuration of a conventional electronic device that transfers received data to a memory by a DMA device.

【符号の説明】[Explanation of symbols]

1 CPU 2 メモリ 3 通信用チップ 4 DMA装置 5 アドレス・データバス 6 ステータスレジスタ 12 ステータスレジスタ判定回路 1 CPU 2 Memory 3 Communication Chip 4 DMA Device 5 Address / Data Bus 6 Status Register 12 Status Register Judgment Circuit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 データ入出力部とメモリとの間でダイレ
クトメモリアクセスを行うダイレクトメモリアクセス装
置であって、 データ入出力部から出力されるインターラプト信号をダ
イレクトメモリアクセスリクエスト信号として入力する
と共に、ダイレクトメモリアクセスリクエスト信号を入
力したときに、データ入出力部内に保持されているイン
ターラプトの種類の情報を読み出し、その内容に応じて
ダイレクトメモリアクセスを行うか否かを選択すること
を特徴とするダイレクトメモリアクセス装置。
1. A direct memory access device for performing direct memory access between a data input / output unit and a memory, wherein an interrupt signal output from the data input / output unit is input as a direct memory access request signal, and When the direct memory access request signal is input, the information of the interrupt type held in the data input / output unit is read, and whether to perform the direct memory access is selected according to the content. Direct memory access device.
【請求項2】 データ入出力部とメモリとの間でダイレ
クトメモリアクセスを行うダイレクトメモリアクセス装
置であって、 領域の大きさを含めてデータ転送先の領域を指定する領
域指定手段と、 この領域指定手段によって指定された領域内で昇順また
は降順にデータ転送先のアドレスを指定すると共に、デ
ータ転送先のアドレスが前記領域の最後または最初に達
したときにデータ転送先のアドレスを前記領域の最初ま
たは最後に戻すデータ転送先アドレス指定手段とを具備
することを特徴とするダイレクトメモリアクセス装置。
2. A direct memory access device for performing direct memory access between a data input / output unit and a memory, and area specifying means for specifying a data transfer destination area including the size of the area, and this area. The address of the data transfer destination is specified in ascending or descending order within the area specified by the specifying means, and when the address of the data transfer destination reaches the end or the beginning of the area, the address of the data transfer destination is set to the beginning of the area. Alternatively, the direct memory access device is provided with a data transfer destination address designating means for returning to the end.
【請求項3】 前記領域指定手段によって指定された領
域のうち転送されたデータをどのアドレスまで処理した
かを示す処理終了アドレスを保持する処理終了アドレス
保持手段を更に具備し、データ転送先アドレスが前記処
理終了アドレス保持手段によって保持された処理終了ア
ドレスと一致したときには、処理終了アドレスが変化す
るまでダイレクトメモリアクセスを行わないことを特徴
とする請求項2記載のダイレクトメモリアクセス装置。
3. The data transfer destination address is further provided with a processing end address holding means for holding a processing end address indicating up to which address the transferred data in the area designated by the area designating means has been processed. 3. The direct memory access device according to claim 2, wherein when the processing end address held by the processing end address holding unit matches, the direct memory access is not performed until the processing end address changes.
【請求項4】 データ入出力部とメモリとの間でダイレ
クトメモリアクセスを行うダイレクトメモリアクセス装
置であって、 転送データ巾の合計がデータバス巾に一致するまでデー
タ入出力部よりデータを読み出した後、これらのデータ
を1回の書き込み動作でメモリに書き込むことを特徴と
するダイレクトメモリアクセス装置。
4. A direct memory access device for performing direct memory access between a data input / output unit and a memory, wherein data is read from the data input / output unit until the total transfer data width matches the data bus width. After that, these data are written in the memory by one writing operation, a direct memory access device.
JP29616495A 1995-10-19 1995-10-19 Direct memory access device Pending JPH09114771A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29616495A JPH09114771A (en) 1995-10-19 1995-10-19 Direct memory access device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29616495A JPH09114771A (en) 1995-10-19 1995-10-19 Direct memory access device

Publications (1)

Publication Number Publication Date
JPH09114771A true JPH09114771A (en) 1997-05-02

Family

ID=17829992

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29616495A Pending JPH09114771A (en) 1995-10-19 1995-10-19 Direct memory access device

Country Status (1)

Country Link
JP (1) JPH09114771A (en)

Similar Documents

Publication Publication Date Title
EP0373291B1 (en) Digital signal processor
US5673396A (en) Adjustable depth/width FIFO buffer for variable width data transfers
US5537659A (en) Bus controller for adjusting port size communication between a bus master and bus slave using bus master information
JP2001142842A (en) Dma handshake protocol
US7165126B2 (en) Direct memory access device
US6330631B1 (en) Data alignment between buses
US20040225760A1 (en) Method and apparatus for transferring data at high speed using direct memory access in multi-processor environments
EP0757316B1 (en) External device selection unit for data processor
US6898659B2 (en) Interface device having variable data transfer mode and operation method thereof
GB2412767A (en) Processor with at least two buses between a read/write port and an associated memory with at least two portions
US7228367B2 (en) Direct memory access controller for carrying out data transfer by determining whether or not burst access can be utilized in an external bus and access control method thereof
US5889948A (en) Apparatus and method for inserting an address in a data stream through a FIFO buffer
JPH09114771A (en) Direct memory access device
US6292861B1 (en) Processor having interface with bus arbitration circuit
EP0410382A2 (en) Data transfer controller using direct memory access method
JPH06274462A (en) Asynchronous writing system for shared memory
JP2574821B2 (en) Direct memory access controller
JPS6014435B2 (en) Storage device
JPS6019816B2 (en) microprogram control adapter
JPS60205652A (en) Dma transfer system
JPH113274A (en) Memory access control system
JP2003150534A (en) Chain block transfer method and communication control device
JP2003281087A (en) Memory target device and data transfer system
JPH07319841A (en) Serial control device
JPS60195657A (en) Data processing system