JPH0736807A - Communication control method - Google Patents

Communication control method

Info

Publication number
JPH0736807A
JPH0736807A JP5202616A JP20261693A JPH0736807A JP H0736807 A JPH0736807 A JP H0736807A JP 5202616 A JP5202616 A JP 5202616A JP 20261693 A JP20261693 A JP 20261693A JP H0736807 A JPH0736807 A JP H0736807A
Authority
JP
Japan
Prior art keywords
data
transfer
dma
information
communication
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
JP5202616A
Other languages
Japanese (ja)
Inventor
Hideki Tanaka
英樹 田中
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP5202616A priority Critical patent/JPH0736807A/en
Publication of JPH0736807A publication Critical patent/JPH0736807A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

PURPOSE:To prevent the performance of a system from being reduced by adding length information to the head of communication data, and when the communication data are received, reading out the length information and judging information volume by a processor and then executing direct memory access(DMA) transfer to a succeeding storage part. CONSTITUTION:When a communication control circuit 72 receives receiving data, an interruption signal to a processor is generated from an interruption generating part at the reception of the initial byte (RX INT) and length information in a buffer is read out (RX READ). At the 2nd byte, the interruption generating part generates an interruption (RX INT) to read out the receiving data (RX READ). The number of transfer bytes is set up (DMA Enable) in a counter of a DMA control circuit 71 and succeeding data are DMA-transferred to a main storage device in the circuit 71. Since information volume is judged from length information to execute DMA transfer, the DMA transfer can be completed within a short time.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は受信した通信データをメ
モリ等の次格納部に転送する通信制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a communication control method for transferring received communication data to a next storage unit such as a memory.

【0002】[0002]

【従来の技術】通信制御における送信・受信のデータ転
送は、一般に、プログラム割込みにより実行する方法
と、DMA(ダイレクトメモリアクセス)制御を利用し
て実行する方法の2通りの方法がある。先ず、プログラ
ム割込みによるデータ転送では、通信プログラムを実行
するプロセッサが、データの送受信を行う通信制御部を
直接制御する。例えば、データを外部装置より受信した
場合、その受信を行う通信制御部からプロセッサに対し
て割込み信号を送出し、プロセッサは、この割込み信号
によって、受信データを通信制御部から次のデータ格納
部に対してデータ転送するよう制御を行う。即ち、プロ
グラム割込みによるデータ転送は、プロセッサが直接デ
ータ転送を行う方法である。
2. Description of the Related Art Generally, transmission / reception data transfer in communication control includes two methods: a method of executing by a program interrupt and a method of executing by utilizing DMA (Direct Memory Access) control. First, in data transfer by program interruption, a processor that executes a communication program directly controls a communication control unit that transmits and receives data. For example, when data is received from an external device, the communication control unit performing the reception sends an interrupt signal to the processor, and the processor causes the received data to be transferred from the communication control unit to the next data storage unit. Control is performed so that data is transferred. That is, the data transfer by the program interrupt is a method in which the processor directly transfers the data.

【0003】一方、DMA制御を利用してデータ転送を
行う方法は、DMA制御回路がデータ転送を行う方法で
あり、次にこれを説明する。図2は、このような通信制
御方法を説明するための通信制御部を主体とした情報処
理システムのブロック図である。図のシステムは、CP
U(プロセッサ)10、通信制御部20、主記憶装置3
0、バス40、外部装置50、通信回線60の構成を示
している。
On the other hand, a method of transferring data by utilizing DMA control is a method of transferring data by a DMA control circuit, which will be described below. FIG. 2 is a block diagram of an information processing system mainly including a communication control unit for explaining such a communication control method. The system shown is CP
U (processor) 10, communication control unit 20, main storage device 3
0, bus 40, external device 50, and communication line 60 are shown.

【0004】プロセッサ10は、通信制御等、各種の制
御を行う中央処理装置である。通信制御部20は、プロ
セッサ10からの指示により、外部装置40と主記憶装
置30等との間の通信データの送受信制御を行う装置で
あり、DMA制御回路21と、通信制御回路22とで構
成されている。DMA制御回路21は、DMA転送制御
を行う機能を有し、通信制御回路22は、外部装置50
からの通信データをバッファに受信し、DMA転送を行
う機能を有している。
The processor 10 is a central processing unit that performs various controls such as communication control. The communication control unit 20 is a device that controls transmission / reception of communication data between the external device 40 and the main storage device 30 or the like according to an instruction from the processor 10, and includes a DMA control circuit 21 and a communication control circuit 22. Has been done. The DMA control circuit 21 has a function of performing DMA transfer control, and the communication control circuit 22 includes an external device 50.
It has a function of receiving communication data from the buffer in the buffer and performing DMA transfer.

【0005】主記憶装置30は、プロセッサ10の実行
するプログラム等を格納すると共に、通信制御回路22
のバッファに一時格納された通信データを、バス40を
介して受け取り、これを格納する通信データの次格納部
を構成している。また、バス40は、プロセッサ10と
通信制御部20および主記憶装置30を接続し、これら
の間でデータ転送等を行うためのシステムバスである。
外部装置50は、パーソナルコンピュータやモデム等か
らなり、通信データを通信回線60を介して通信制御回
路22に送信したり、通信制御回路22から通信データ
を受信したりする機能を有している。また、通信回線6
0は、外部装置50と通信制御部20を接続するデータ
転送路であり、シリアルデータを転送するよう構成され
ている。
The main storage device 30 stores programs executed by the processor 10 and the like, and also has a communication control circuit 22.
The communication data temporarily stored in the buffer is received via the bus 40, and constitutes the next storage unit of the communication data for storing this. Further, the bus 40 is a system bus for connecting the processor 10, the communication control unit 20, and the main storage device 30, and performing data transfer and the like among them.
The external device 50 is composed of a personal computer, a modem, or the like, and has a function of transmitting communication data to the communication control circuit 22 via the communication line 60 and receiving communication data from the communication control circuit 22. In addition, communication line 6
Reference numeral 0 is a data transfer path that connects the external device 50 and the communication control unit 20, and is configured to transfer serial data.

【0006】次に、このように構成された情報処理シス
テムにおける通信制御動作を説明する。通信プログラム
を実行するプロセッサ10が、通信制御部20の通信制
御回路22をデータ転送可能な状態に設定し、この状態
でデータの転送要求が発生すると、通信制御回路22
は、データ転送要求信号REQ−2をDMA制御回路2
1に送出する。
Next, the communication control operation in the information processing system thus configured will be described. When the processor 10 that executes the communication program sets the communication control circuit 22 of the communication control unit 20 to a data transferable state and a data transfer request occurs in this state, the communication control circuit 22
Sends the data transfer request signal REQ-2 to the DMA control circuit 2
Send to 1.

【0007】DMA制御回路21は、このデータ転送要
求信号REQ−2を受けて、プロセッサ10に対し、デ
ータ転送要求信号REQ−1を送出する。プロセッサ1
0は、DMA転送が可能な場合は、応答信号ACK−1
を返し、DMA制御回路21は、この応答信号ACK−
1により、通信制御回路22に対し、応答信号ACK−
2を返す。このようなデータ転送のハンドシェークによ
り、通信制御回路22は、データ送信であれば、データ
転送元からのパラレルデータをバス40を介して受け取
り、これをシリアルデータとして外部装置50に送出
し、受信であれば、外部装置50からのデータをバス4
0を介してデータ転送先に送出する。
The DMA control circuit 21 receives the data transfer request signal REQ-2 and sends the data transfer request signal REQ-1 to the processor 10. Processor 1
0 is a response signal ACK-1 when DMA transfer is possible.
The DMA control circuit 21 returns the response signal ACK-
1 causes the communication control circuit 22 to send a response signal ACK-
Returns 2. With such a data transfer handshake, the communication control circuit 22 receives parallel data from the data transfer source via the bus 40 in the case of data transmission, sends this as serial data to the external device 50, and receives it. If there is, the data from the external device 50 is transferred to the bus 4
It is sent to the data transfer destination via 0.

【0008】[0008]

【発明が解決しようとする課題】ところで、今日では、
複数の外部装置50との通信制御、即ち通信制御の多重
化を行うことが行われている。このような場合、通信制
御部20がその多重化された数だけ備えられ、各自の通
信制御部20が自分の受け持つ通信制御を行っている。
しかしながら、このように通信制御部20が複数備えら
れていた場合に、上記のプログラム転送を行うことを考
えた場合、プロセッサ10への負担が大きく、通信処理
のオーバヘッドが生じ、その結果、通信制御以外の入出
力処理等への妨げとなることから、装置全体の性能低下
となってしまっていた。
By the way, today,
Communication control with a plurality of external devices 50, that is, multiplexing of communication control is performed. In such a case, the communication control units 20 are provided in the multiplexed number, and each communication control unit 20 controls the communication under its control.
However, in the case where a plurality of communication control units 20 are provided in this way, considering the above program transfer, the load on the processor 10 is heavy and communication processing overhead occurs. As a result, communication control is performed. Since it interferes with input / output processing other than the above, the performance of the entire device has deteriorated.

【0009】一方、DMA転送による方法では、受信動
作を実行している間は、相手先からのデータ量がどの程
度の大きさかを判断する手段がなく、従って、DMA転
送も無駄な余裕時間を必要とし、その結果、この方法で
も通信制御部の多重化は困難であった。
On the other hand, in the method by the DMA transfer, there is no means for judging how much the amount of data from the other party is while the receiving operation is being executed, so that the DMA transfer has a wasteful margin time. However, even with this method, it was difficult to multiplex the communication control units.

【0010】即ち、通常、外部装置50からのデータは
調歩同期方式で受信を行っており、この場合は、一般の
通信プロトコルでは転送の終結が不明である。そのた
め、従来の通信制御方法では、受信データを確実に受け
取れるよう、そのシステム毎に予めDMA転送時間を設
定し、この設定時間はDMA転送を行うよう構成してい
た。従って、通常はこの設定時間と実際のデータ転送時
間には本来は無断な余裕時間が存在する。そして、この
ようなDMA転送を行っている時間はバス40が占有さ
れるため、通信制御部20を多重化した場合、一つの通
信制御部20がDMA転送を行っている間は他の通信制
御部20や通信制御以外のアクセス元は処理を行うこと
ができない。その結果、システムとしての性能低下を招
き、上記のように、通信制御部の多重化を行うことは困
難であった。
That is, normally, the data from the external device 50 is received by the start-stop synchronization method, and in this case, the end of the transfer is unknown by the general communication protocol. Therefore, in the conventional communication control method, the DMA transfer time is set in advance for each system so that the received data can be reliably received, and the DMA transfer is performed during this set time. Therefore, normally, there is an unreserved margin time between the set time and the actual data transfer time. Since the bus 40 is occupied during the time when such DMA transfer is performed, when the communication control unit 20 is multiplexed, while one communication control unit 20 is performing the DMA transfer, another communication control is performed. Access sources other than the unit 20 and communication control cannot perform processing. As a result, the performance of the system is deteriorated, and it is difficult to multiplex the communication control units as described above.

【0011】本発明は、上記従来の問題点を解決するた
めになされたもので、通信制御部を多重化した場合のシ
ステムの性能低下を防止することのできる通信制御方法
を提供することを目的とする。
The present invention has been made in order to solve the above-mentioned conventional problems, and an object of the present invention is to provide a communication control method capable of preventing deterioration of the system performance when the communication control units are multiplexed. And

【0012】[0012]

【課題を解決するための手段】第1発明の通信制御方法
は、通信データの先頭に、当該通信データの情報量を示
す長さ情報を付加し、前記通信データを受信した場合、
先ず、前記長さ情報をプロセッサが読込んで、当該通信
データの情報量を判定し、その後は、前記判定した情報
量に基づき、前記通信データを、次格納部にダイレクト
メモリアクセス転送することを特徴とするものである。
According to the communication control method of the first invention, length information indicating the information amount of the communication data is added to the beginning of the communication data, and when the communication data is received,
First, the processor reads the length information, determines the information amount of the communication data, and thereafter, based on the determined information amount, transfers the communication data to the next storage unit by direct memory access. It is what

【0013】第2発明の通信制御方法は、通信データの
先頭に、当該通信データの情報量を示す長さ情報を付加
し、前記通信データを受信した場合、前記長さ情報デー
タを含む当該通信データの全てを前記受信部より次格納
部にダイレクトメモリアクセス転送すると共に、前記長
さ情報データを前記次格納部に格納した時点でプロセッ
サに対して割込みを発生する割込み発生回路を設け、前
記割込み発生回路から割込みが発生した場合、前記プロ
セッサは、次格納部より前記長さ情報データを読込むと
共に、当該通信データの情報量から前記割込み発生時よ
り前記通信データのダイレクトメモリアクセス転送終了
時までの転送時間を算出し、前記転送時間に基づき、前
記通信データのダイレクトメモリアクセス転送終了を判
定することを特徴とするものである。
According to the communication control method of the second invention, length information indicating the information amount of the communication data is added to the head of the communication data, and when the communication data is received, the communication including the length information data. All of the data is transferred from the receiving unit to the next storage unit by direct memory access, and an interrupt generation circuit for generating an interrupt to the processor when the length information data is stored in the next storage unit is provided. When an interrupt is generated from the generation circuit, the processor reads the length information data from the next storage unit and, from the information amount of the communication data, from the time when the interrupt occurs to the time when the direct memory access transfer of the communication data ends. The transfer time of the communication data is calculated, and the end of the direct memory access transfer of the communication data is determined based on the transfer time. It is intended to.

【0014】第3発明の通信制御方法は、第2発明にお
いて、長さ情報から算出した転送時間が経過した場合、
プロセッサは、当該長さ情報から読取った転送データの
情報量と、実際に転送した情報量とを照合し、前記長さ
情報から読取った転送データの情報量より実際に転送し
た情報量が不足する場合は、その不足分に対応した転送
時間を算出し、再度、この転送時間で不足分の転送デー
タをダイレクトメモリアクセス転送することを特徴とす
るものである。
In the communication control method of the third invention, in the second invention, when the transfer time calculated from the length information has elapsed,
The processor collates the information amount of the transfer data read from the length information with the information amount actually transferred, and the information amount actually transferred is less than the information amount of the transfer data read from the length information. In this case, the transfer time corresponding to the shortage is calculated, and the transfer data for the shortage is transferred again by the direct memory access with this transfer time.

【0015】[0015]

【作用】第1発明の通信制御方法においては、通信デー
タを外部装置より受信した場合、その受信データは通信
制御回路のバッファに一時格納される。そして、受信デ
ータの、例えば先頭の1バイト目で割込みを発生させ、
これによりプロセッサは割込みによるデータ転送を行
い、受信される通信データの情報量を判定し、その値を
DMA制御回路のカウンタにセットする。その後は、通
信制御回路が受信された通信データをDMA転送し、カ
ウンタが所定の値となった時点で転送終了と判断する。
In the communication control method of the first invention, when communication data is received from an external device, the received data is temporarily stored in the buffer of the communication control circuit. Then, an interrupt is generated at the first byte of the received data, for example,
As a result, the processor transfers data by interruption, determines the information amount of the received communication data, and sets the value in the counter of the DMA control circuit. After that, the communication control circuit DMA-transfers the received communication data, and when the counter reaches a predetermined value, it is determined that the transfer is completed.

【0016】また、第2発明の通信制御方法において
は、通信データを外部装置より受信した場合は、上記第
1発明と同様に、その受信データは通信制御回路のバッ
ファに一時格納される。そして、受信データは最初から
DMA転送されて主記憶装置等の次格納部に格納され
る。また、長さ情報が転送されて時点で割込み発生回路
から割込みが発生する。これにより、プロセッサは次格
納部をアクセスし、その長さ情報を読込むと共にソフト
タイマを起動する。そして、長さ情報に基づき転送時間
を算出し、この転送時間をソフトタイマで計測する。所
定の転送時間が経過すると、プロセッサは受信した通信
データのDMA転送が終了したと判断する。
Further, in the communication control method of the second invention, when the communication data is received from the external device, the received data is temporarily stored in the buffer of the communication control circuit as in the first invention. Then, the received data is DMA-transferred from the beginning and stored in the next storage unit such as the main storage device. An interrupt is generated from the interrupt generation circuit at the time when the length information is transferred. As a result, the processor accesses the next storage, reads the length information, and activates the soft timer. Then, the transfer time is calculated based on the length information, and this transfer time is measured by the soft timer. When the predetermined transfer time has elapsed, the processor determines that the DMA transfer of the received communication data is completed.

【0017】第3発明の通信制御方法においては、上記
第2発明でソフトタイマによる所定の転送時間が経過し
た場合、プロセッサは長さ情報から判定した情報量と、
実際に転送した情報量とを照合する。そして、この照合
で、実際に転送した情報量が不足した場合は、その不足
分に対応する転送時間を算出し、この転送時間に基づ
き、再度不足分の通信データのDMA転送を行う。
In the communication control method of the third invention, when the predetermined transfer time by the soft timer in the second invention has elapsed, the processor determines the information amount determined from the length information,
Check the amount of information actually transferred. Then, if the amount of information actually transferred is insufficient in this collation, the transfer time corresponding to the insufficient amount is calculated, and DMA transfer of the insufficient communication data is performed again based on this transfer time.

【0018】[0018]

【実施例】以下、本発明の実施例を図面を用いて詳細に
説明する。図1は本発明の通信制御方法を説明するため
のシーケンスチャートであるが、この説明に先立ち、本
発明の通信制御方法を適用する情報処理システムの説明
を行う。
Embodiments of the present invention will now be described in detail with reference to the drawings. FIG. 1 is a sequence chart for explaining the communication control method of the present invention. Prior to this explanation, an information processing system to which the communication control method of the present invention is applied will be described.

【0019】図3は、その情報処理システムのブロック
図である。図のシステムは、CPU(プロセッサ)1
0、主記憶装置30、バス40、外部装置50、通信回
線60、通信制御部70の構成を示しており、プロセッ
サ10〜通信回線60の構成は従来と同様であるため、
ここでの説明は省略する。通信制御部70は、従来と同
様に、DMA制御回路71と、通信制御回路72とで構
成されている。また、DMA制御回路71には、DMA
転送量をカウントするためのカウンタ71aが設けら
れ、通信制御回路72には、外部装置50からのデータ
を受信するためのバッファ72aと、後述する受信デー
タにおける長さ情報の受信時に割込みを発生させる割込
み発生部72bを備えている。
FIG. 3 is a block diagram of the information processing system. The system shown in the figure has a CPU (processor) 1
0, the main storage device 30, the bus 40, the external device 50, the communication line 60, and the communication control unit 70 are shown. Since the configurations of the processor 10 to the communication line 60 are the same as the conventional ones,
The description here is omitted. The communication control unit 70 is composed of a DMA control circuit 71 and a communication control circuit 72 as in the conventional case. In addition, the DMA control circuit 71 includes a DMA
A counter 71a for counting the transfer amount is provided, and the communication control circuit 72 generates a buffer 72a for receiving data from the external device 50 and an interrupt when receiving length information in received data described later. The interrupt generating unit 72b is provided.

【0020】次に、本実施例の通信制御方法の前提とな
る受信データのフォーマットを説明する。図4に、その
受信フォーマットを示す。即ち、本実施例では、外部装
置50から受信するデータには、予めその先頭の2バイ
トは、受信データの情報量を示す長さ情報を示すプロト
コルとなっている。尚、この長さ情報は、実際には、全
受信データから長さ情報の2バイトを引いた値のバイト
数が示されている。本実施例では、受信データはこのよ
うなプロトコルとなっており、このようなデータを受信
した場合の情報処理装置の動作を図1を参照して次に説
明する。
Next, the format of received data, which is a premise of the communication control method of this embodiment, will be described. FIG. 4 shows the reception format. That is, in the present embodiment, the data received from the external device 50 has a protocol in which the first two bytes are length information indicating the amount of information of the received data. Incidentally, the length information actually indicates the number of bytes of a value obtained by subtracting 2 bytes of the length information from all the received data. In this embodiment, the received data has such a protocol, and the operation of the information processing apparatus when receiving such data will be described below with reference to FIG.

【0021】先ず、プロセッサ10により、DMA制御
回路71を設定する。この設定は、システムの初期設定
動作であり、DMA転送モードか割込みによる転送モー
ドかを設定するといった処理を指している。ここでは、
DMA制御回路71に対してDMAモードを設定する。
但し、ここでは、まだDMA制御回路71から出力され
るリクエスト信号をマスクするよう設定し、プロセッサ
10へのDMAリクエストを禁止しておく。尚、この理
由は、ノイズ等によってDMA制御回路71が誤動作
し、その結果、DMAリクエストが開始されないように
するためである。
First, the processor 10 sets the DMA control circuit 71. This setting is an initial setting operation of the system, and indicates a process of setting the DMA transfer mode or the transfer mode by interruption. here,
The DMA mode is set for the DMA control circuit 71.
However, here, the request signal output from the DMA control circuit 71 is set to be masked, and the DMA request to the processor 10 is prohibited. The reason is to prevent the DMA control circuit 71 from malfunctioning due to noise or the like, and as a result, the DMA request is not started.

【0022】次に、プロセッサ10は通信制御回路72
の設定を行う。この設定もシステムとしての初期設定で
あり、ここでもモード設定はDMAモードに設定する。
また、プロセッサ10は、通信制御回路72を受信可能
とし(図1中、RX Enable)、更に、バッファ
72aに受信データが格納された場合、割込み発生部7
2bから最初の2バイト分は割込みを発生させ、3バイ
ト目以降は、DMA制御回路71に対してリクエスト信
号を発生させるよう設定する
Next, the processor 10 controls the communication control circuit 72.
Set. This setting is also the initial setting of the system, and the mode setting is set to the DMA mode here as well.
Further, the processor 10 enables the communication control circuit 72 (RX Enable in FIG. 1), and when the received data is stored in the buffer 72a, the interrupt generation unit 7
It is set so that an interrupt is generated for the first 2 bytes from 2b and a request signal is generated for the DMA control circuit 71 after the 3rd byte.

【0023】このような設定により、通信制御回路72
は、受信データを受けた場合、最初の1バイト受信で割
込み発生部72bからプロセッサ10に対して割込み信
号が発生し(RX INT)、プロセッサ10は、この
割込みに基づき、バッファ72aに格納されている長さ
情報の読込みを行う(RX READ)。そして、次の
2バイト目でも、割込み発生部72bは割込みを発生し
(RX INT)、これによりプロセッサ10は、上記
の場合と同様に、その受信データの読込みを行う(RX
READ)。尚、ここで、2バイトの長さ情報を1バ
イトずつ処理するのは、プロセッサ10の処理が1バイ
トずつ行われるからである。
With such settings, the communication control circuit 72
When receiving the received data, an interrupt signal is generated from the interrupt generator 72b to the processor 10 (RX INT) at the first 1-byte reception, and the processor 10 stores the received signal in the buffer 72a based on this interrupt. Read the length information (RX READ). Then, also in the next second byte, the interrupt generation unit 72b generates an interrupt (RX INT), which causes the processor 10 to read the received data (RX) in the same manner as in the above case.
READ). The reason why the 2-byte length information is processed byte by byte is that the processing of the processor 10 is performed byte by byte.

【0024】そして、プロセッサ10は、読み込んだ2
バイトの長さ情報から、それ以降のデータ量が判明する
ため、その転送バイト数をDMA制御回路71のカウン
タ71aにセットする。その後、プロセッサ10は、D
MA制御回路71のDMAリクエスト禁止を解除し(D
MA Enable)、DMA制御回路71は、通信制
御回路72からのリクエスト信号(REQ RX)に対
して、応答信号(ACK RX)を返し、それ以降のデ
ータを主記憶装置30に対してDMA転送する。
Then, the processor 10 reads the read 2
Since the amount of data after that is known from the byte length information, the number of bytes to be transferred is set in the counter 71a of the DMA control circuit 71. After that, the processor 10
The DMA request prohibition of the MA control circuit 71 is released (D
MA Enable), the DMA control circuit 71 returns a response signal (ACK RX) to the request signal (REQ RX) from the communication control circuit 72, and DMA-transfers subsequent data to the main storage device 30. .

【0025】また、DMA制御回路71のカウンタ71
aは、通信制御回路72からのリクエスト信号に基づ
き、セットされたカウント値からカウントダウンを行
い、カウント値が“0”になった時点で、通信制御回路
72に対してカウンタ割込みを発生させる(カウンタ
IPT)。通信制御回路72は、このカウンタ割込みに
より、DMAデータ転送を終了し、割込み発生部72b
は、プロセッサ10に対してDMA転送終了の割込みを
発生させる(INT)。これにより、プロセッサ10
は、通信制御回路72に対して受信禁止状態とする(R
X Disable)と共に、DMA制御回路71に対
しても、DMA動作禁止状態とする(DMA Disa
ble)。
Further, the counter 71 of the DMA control circuit 71
Based on the request signal from the communication control circuit 72, a counts down from the set count value, and when the count value becomes “0”, generates a counter interrupt to the communication control circuit 72 (counter
IPT). The communication control circuit 72 ends the DMA data transfer by this counter interrupt, and the interrupt generation unit 72b
Causes the processor 10 to generate a DMA transfer end interrupt (INT). As a result, the processor 10
Sets the communication control circuit 72 to a reception prohibited state (R
X Disable), the DMA control circuit 71 is also set to the DMA operation disabled state (DMA Disable).
ble).

【0026】このように、上記第1実施例では、受信デ
ータの先頭に含まれる長さ情報から受信されるデータの
情報量を判定し、その情報量に基づき、その後のデータ
をDMA転送するようにしたので、受信データのDMA
転送を無駄な余裕時間なしに、最短時間で終了させるこ
とができる。その結果、DMA転送によるバスの占有時
間を短くすることができるため、通信制御部70の多重
化も容易に達成することができる。
As described above, in the first embodiment, the information amount of the received data is determined from the length information included at the beginning of the received data, and the subsequent data is DMA-transferred based on the information amount. Since it is set to DMA of the received data
The transfer can be completed in the shortest time without wasting extra time. As a result, the bus occupation time for the DMA transfer can be shortened, so that the communication control unit 70 can be easily multiplexed.

【0027】次に、第2の実施例を説明する。図5は、
第2実施例の通信制御方法を実施するための情報処理シ
ステムのブロック図である。図のシステムは、CPU
(プロセッサ)10、主記憶装置30、バス40、外部
装置50、通信回線60、通信制御部80の構成を示し
ており、プロセッサ10〜通信回線60の構成は上記第
1の実施例および従来と同様であるため、ここでの説明
は省略する。
Next, a second embodiment will be described. Figure 5
It is a block diagram of an information processing system for implementing the communication control method of a 2nd example. The system shown is a CPU
The configuration of the (processor) 10, the main storage device 30, the bus 40, the external device 50, the communication line 60, and the communication control unit 80 is shown. The configurations of the processor 10 to the communication line 60 are the same as those of the first embodiment and the conventional example. Since it is the same, the description here is omitted.

【0028】通信制御部80は、DMA制御回路81
と、通信制御回路82と、割込み発生回路83とで構成
されている。また、DMA制御回路81には、DMA転
送量をカウントするためのカウンタ81aが設けられ、
通信制御回路82には、外部装置50からのデータを受
信するためのバッファ82aが設けられている。そし
て、割込み発生回路83は、受信データの先頭に位置す
る長さ情報を主記憶装置30に転送した時点で、プロセ
ッサ10に対して割込みを発生させる機能を備えてい
る。尚、この第2の実施例においても、その受信データ
の先頭の2バイトは長さ情報が位置するよう通信プロト
コルに設定されており、これは上記第1の実施例と同様
であるため、ここでの説明は省略する。
The communication control unit 80 includes a DMA control circuit 81.
And a communication control circuit 82 and an interrupt generation circuit 83. Further, the DMA control circuit 81 is provided with a counter 81a for counting the DMA transfer amount,
The communication control circuit 82 is provided with a buffer 82a for receiving data from the external device 50. The interrupt generation circuit 83 has a function of generating an interrupt to the processor 10 when the length information located at the head of the received data is transferred to the main storage device 30. Also in this second embodiment, the communication protocol is set so that the length information is located in the first 2 bytes of the received data. Since this is the same as in the first embodiment, here The description of is omitted.

【0029】更に、プロセッサ10は、割込み発生回路
83からの割込みを受け付けた場合に、タイマ動作を行
うためのソフトタイマ10aを備えている。尚、このソ
フトタイマ10aは、プログラム等で構成されているも
のである。
Further, the processor 10 is provided with a soft timer 10a for performing a timer operation when the interrupt from the interrupt generation circuit 83 is accepted. The soft timer 10a is composed of a program and the like.

【0030】次に、上記システムにおける通信制御方法
を説明する。図6は、そのシーケンスチャートである。
先ず、本実施例においても、その受信データは図4に示
すように、先頭の2バイトがデータ量を表す長さ情報と
なっている。
Next, a communication control method in the above system will be described. FIG. 6 is a sequence chart thereof.
First, also in the present embodiment, as shown in FIG. 4, the reception data has the first two bytes as length information indicating the data amount.

【0031】このようなデータを受信する場合、プロセ
ッサ10は、DMA制御回路81をDMAモードにセッ
トし、更に、カウンタ81aには、設定可能な最大カウ
ント数をセットする。そして、DMA制御回路81およ
び通信制御回路82をイネーブルとする。その後、通信
制御回路82は、DMA制御回路81に対してリクエス
ト信号を送出し(REQ RX)、DMA制御回路81
から応答信号が返されると(ACK RX)、バッファ
82aから主記憶装置30にDMA転送を開始する。
When receiving such data, the processor 10 sets the DMA control circuit 81 in the DMA mode, and further sets the maximum count number that can be set in the counter 81a. Then, the DMA control circuit 81 and the communication control circuit 82 are enabled. After that, the communication control circuit 82 sends a request signal to the DMA control circuit 81 (REQ RX), and the DMA control circuit 81
When a response signal is returned from (ACK RX), the DMA transfer from the buffer 82a to the main memory device 30 is started.

【0032】そして、受信データの長さ情報である2バ
イトが転送されると、カウンタ81aの値により、DM
A制御回路81は、割込み発生回路83に対して、割込
み信号を発生するよう指示し、割込み発生回路83は、
これに基づきプロセッサ10に対して割込み信号(IN
T)を送出する。尚、この時点でも、受信データのDM
A転送は継続して行われている。プロセッサ10は、こ
の割込み信号に基づき、主記憶装置30をアクセスして
転送されている受信データの長さ情報を読込み、そのデ
ータ内容に基づき、その後転送されるデータ量を判定
し、このデータ量と転送速度に基づいて転送終了までの
時間を算出し、この時間でソフトタイマ10aをセット
し、起動する。
Then, when 2 bytes, which is the length information of the received data, is transferred, the value of the counter 81a causes the DM
The A control circuit 81 instructs the interrupt generation circuit 83 to generate an interrupt signal, and the interrupt generation circuit 83
Based on this, an interrupt signal (IN
T) is transmitted. Even at this point, the received data DM
A transfer continues. Based on this interrupt signal, the processor 10 reads the length information of the received data which is transferred by accessing the main memory device 30, determines the amount of data to be transferred thereafter based on the data content, and determines the amount of this data. Then, the time until the end of the transfer is calculated based on the transfer rate and the soft timer 10a is set and activated at this time.

【0033】ソフトタイマ10aの設定時間が経過する
と(ステップS1)、プロセッサ10は、DMA転送が
終了したと判定し、DMA制御回路81のカウンタ81
aの値をリードし、転送前に設定した値より、示してい
る値を引き算し、実際に行われた転送バイト数を計算す
る(ステップS2)。そして、その計算結果の値と、最
初の長さ情報の値とを比較し(ステップS3)、一致し
ていた場合のみデータ転送終了とみなし、受信動作を終
了させる。即ち、通信制御回路82の受信動作を禁止す
る(RX Disable)と共に、DMA制御回路8
1に対してDMAモードを解除する。
When the set time of the soft timer 10a has elapsed (step S1), the processor 10 determines that the DMA transfer is completed, and the counter 81 of the DMA control circuit 81 is determined.
The value of a is read, and the value shown is subtracted from the value set before transfer to calculate the number of bytes actually transferred (step S2). Then, the value of the calculation result and the value of the first length information are compared (step S3), and if they match, it is considered that the data transfer has ended, and the reception operation is ended. That is, the reception operation of the communication control circuit 82 is prohibited (RX Disable), and the DMA control circuit 8
The DMA mode is canceled for 1.

【0034】一方、ステップS3において、長さ情報に
より算出したバイト数とカウンタ81aでのバイト数が
不足していた場合、プロセッサ10は、再度DMA転送
を行う(ステップS4)。即ち、上記の動作を繰り返
す。そして、ステップS2に戻って、再度実際の転送バ
イト数を算出し、データが一致するまで、この動作を繰
り返す。
On the other hand, in step S3, when the number of bytes calculated from the length information and the number of bytes in the counter 81a are insufficient, the processor 10 performs the DMA transfer again (step S4). That is, the above operation is repeated. Then, returning to step S2, the actual number of transfer bytes is calculated again, and this operation is repeated until the data match.

【0035】このように、上記第2の実施例では、受信
データを全てDMA転送し、かつ、その転送を行いなが
ら転送時間を算出し、この算出した転送時間に基づき転
送終了を判定するようにしたので、例えば、プロセッサ
10への割込みが発生した場合に、その割込み処理がリ
アルタイムに実行されないシステムでも適用可能であ
る。即ち、割込み処理が若干遅れた場合でも、その間受
信データの転送処理は行われているため、転送終了まで
の時間には影響がないものである。
As described above, in the second embodiment, all the received data are DMA-transferred, the transfer time is calculated while the transfer is performed, and the transfer end is determined based on the calculated transfer time. Therefore, for example, when an interrupt to the processor 10 occurs, it can be applied to a system in which the interrupt process is not executed in real time. That is, even if the interrupt processing is slightly delayed, the transfer processing of the received data is being performed during that time, so that the time until the transfer is completed is not affected.

【0036】尚、上記各実施例では、受信データの先頭
2バイトを長さ情報としたが、この値に限定されるもの
ではなく、受信データのデータ量を表せる値であれば、
そのバイト数には特に限定はないものである。また、上
記第2実施例では転送時間の計測にソフトタイマ10a
を用いたが、このタイマに限定されるものではなく、転
送時間の経過が判定できるものであれば、どんなもので
も適用可能である。更に、上記各実施例では、次格納部
として主記憶装置30の場合を説明したが、この他に
も、外部記憶装置等、種々の転送先であっても同様の効
果を奏する。
In each of the above embodiments, the first 2 bytes of the received data is used as the length information, but the present invention is not limited to this value, and any value that can represent the data amount of the received data can be used.
The number of bytes is not particularly limited. In the second embodiment, the soft timer 10a is used to measure the transfer time.
However, the timer is not limited to this timer, and any timer can be applied as long as it can judge the passage of the transfer time. Furthermore, in each of the above-described embodiments, the case where the main storage device 30 is used as the next storage unit has been described, but in addition to this, the same effect can be obtained even with various transfer destinations such as an external storage device.

【0037】[0037]

【発明の効果】以上説明したように、第1発明の通信制
御方法によれば、通信データの先頭に、その通信データ
の情報量を示す長さ情報を付加し、当該通信データを受
信した場合は、長さ情報を割込みによるデータ転送を行
って、転送する情報量を判定し、それ以降は判定した情
報量に基づきDMA転送を行うようにしたので、受信デ
ータの転送を最短時間で行うことができ、従って、プロ
セッサの負担も最小限抑えることができる。その結果、
通信制御部の多重化を容易に実現することができる。
As described above, according to the communication control method of the first invention, when the length information indicating the information amount of the communication data is added to the head of the communication data and the communication data is received. The data transfer is performed by interrupting the length information, the amount of information to be transferred is determined, and thereafter, the DMA transfer is performed based on the determined information amount. Therefore, the transfer of the received data should be performed in the shortest time. Therefore, the burden on the processor can be minimized. as a result,
Multiplexing of the communication control unit can be easily realized.

【0038】第2発明の通信制御方法によれば、通信デ
ータの先頭に、通信データの長さ情報を付加し、この通
信データを受信した場合、その全てのデータを次格納部
にDMA転送すると共に、長さ情報を転送した時点で割
込みを行い、プロセッサはその割込みに基づいて次格納
部から長さ情報を読込み、その情報量から転送時間を算
出し、この転送時間に基づきデータ転送終了を判定する
ようにしたので、上記第1発明と同様に、プロセッサの
負担を軽減し、通信制御部の多重化を容易に実現するこ
とができると共に、割込み処理がリアルタイムに行われ
ないシステムであっても適用可能である。
According to the communication control method of the second invention, the length information of the communication data is added to the beginning of the communication data, and when this communication data is received, all the data are DMA-transferred to the next storage unit. At the same time, an interrupt is issued when the length information is transferred, the processor reads the length information from the next storage unit based on the interrupt, calculates the transfer time from the information amount, and terminates the data transfer based on this transfer time. Since the determination is made, as in the first aspect of the invention, the load on the processor can be reduced, the communication control unit can be easily multiplexed, and the interrupt processing is not performed in real time. Is also applicable.

【0039】第3発明の通信制御方法によれば、上記第
2発明において、プロセッサは長さ情報から判定した情
報量と、実際に転送した情報量とを照合し、実際に転送
した情報量が不足した場合は、その不足分に対応する転
送時間を算出し、再度、不足分のDMA転送を行うよう
にしたので、上記第2発明の効果に加えて、何らかの原
因により算出した転送時間内にデータ転送が終了しなか
った場合等でも確実にデータ転送を行うことができる。
According to the communication control method of the third invention, in the second invention, the processor compares the information amount judged from the length information with the information amount actually transferred, and the information amount actually transferred is determined. When the shortage occurs, the transfer time corresponding to the shortage is calculated, and the shortage DMA transfer is performed again. Therefore, in addition to the effect of the second aspect of the invention, the transfer time is calculated within the transfer time calculated for some reason. Even if the data transfer is not completed, the data transfer can be surely performed.

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

【図1】本発明の通信制御方法における第1実施例のシ
ーケンスチャートである。
FIG. 1 is a sequence chart of a first embodiment of a communication control method of the present invention.

【図2】従来の通信制御方法を実施するための情報処理
システムの要部ブロック図である。
FIG. 2 is a block diagram of a main part of an information processing system for implementing a conventional communication control method.

【図3】本発明の通信制御方法における第1実施例を実
施するための情報処理システムの要部ブロック図であ
る。
FIG. 3 is a block diagram of a main part of an information processing system for implementing the first embodiment of the communication control method of the present invention.

【図4】本発明の通信制御方法における通信データの受
信フォーマットを示す説明図である。
FIG. 4 is an explanatory diagram showing a reception format of communication data in the communication control method of the present invention.

【図5】本発明の通信制御方法における第2実施例を実
施するための情報処理システムの要部ブロック図であ
る。
FIG. 5 is a block diagram of an essential part of an information processing system for implementing a second embodiment of the communication control method of the present invention.

【図6】本発明の通信制御方法における第2実施例のシ
ーケンスチャートである。
FIG. 6 is a sequence chart of a second embodiment of the communication control method of the present invention.

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

10 プロセッサ(CPU) 10a ソフトタイマ 71、81 DMA制御回路 72、82 通信制御回路 83 割込み発生回路 10 Processor (CPU) 10a Soft Timer 71, 81 DMA Control Circuit 72, 82 Communication Control Circuit 83 Interrupt Generation Circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 通信データの先頭に、当該通信データの
情報量を示す長さ情報を付加し、 前記通信データを受信した場合、先ず、前記長さ情報を
プロセッサが読込んで、当該通信データの情報量を判定
し、 その後は、前記判定した情報量に基づき、前記通信デー
タを、次格納部にダイレクトメモリアクセス転送するこ
とを特徴とする通信制御方法。
1. When length information indicating the amount of information of the communication data is added to the beginning of the communication data and the communication data is received, first, the processor reads the length information and A communication control method characterized in that the amount of information is determined, and thereafter, based on the determined amount of information, the communication data is transferred to the next storage unit by direct memory access.
【請求項2】 通信データの先頭に、当該通信データの
情報量を示す長さ情報を付加し、 前記通信データを受信した場合、前記長さ情報データを
含む当該通信データの全てを前記受信部より次格納部に
ダイレクトメモリアクセス転送すると共に、 前記長さ情報データを前記次格納部に格納した時点でプ
ロセッサに対して割込みを発生する割込み発生回路を設
け、 前記割込み発生回路から割込みが発生した場合、前記プ
ロセッサは、次格納部より前記長さ情報データを読込む
と共に、当該通信データの情報量から前記割込み発生時
より前記通信データのダイレクトメモリアクセス転送終
了時までの転送時間を算出し、 前記転送時間に基づき、前記通信データのダイレクトメ
モリアクセス転送終了を判定することを特徴とする通信
制御方法。
2. When the length information indicating the information amount of the communication data is added to the beginning of the communication data and the communication data is received, all of the communication data including the length information data is received by the receiving unit. Direct memory access transfer to the next storage unit, and an interrupt generation circuit for generating an interrupt to the processor when the length information data is stored in the next storage unit, and an interrupt is generated from the interrupt generation circuit. In this case, the processor reads the length information data from the next storage unit and calculates the transfer time from the occurrence of the interrupt to the end of the direct memory access transfer of the communication data from the information amount of the communication data, A communication control method characterized by determining the end of direct memory access transfer of the communication data based on the transfer time.
【請求項3】 長さ情報から算出した転送時間が経過し
た場合、プロセッサは、当該長さ情報から読取った転送
データの情報量と、実際に転送した情報量とを照合し、 前記長さ情報から読取った転送データの情報量より実際
に転送した情報量が不足する場合は、その不足分に対応
した転送時間を算出し、 再度、この転送時間で不足分の転送データをダイレクト
メモリアクセス転送することを特徴とする請求項2記載
の通信制御方法。
3. When the transfer time calculated from the length information has elapsed, the processor compares the information amount of transfer data read from the length information with the actually transferred information amount, and the length information If the amount of information actually transferred is less than the amount of information of the transfer data read from, the transfer time corresponding to that amount is calculated, and the transfer data for the insufficient amount is transferred again using this transfer time. The communication control method according to claim 2, wherein:
JP5202616A 1993-07-23 1993-07-23 Communication control method Pending JPH0736807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5202616A JPH0736807A (en) 1993-07-23 1993-07-23 Communication control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5202616A JPH0736807A (en) 1993-07-23 1993-07-23 Communication control method

Publications (1)

Publication Number Publication Date
JPH0736807A true JPH0736807A (en) 1995-02-07

Family

ID=16460338

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5202616A Pending JPH0736807A (en) 1993-07-23 1993-07-23 Communication control method

Country Status (1)

Country Link
JP (1) JPH0736807A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7062579B2 (en) 1997-02-14 2006-06-13 Canon Kabushiki Kaisha Data transmission apparatus, system and method, and image processing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7062579B2 (en) 1997-02-14 2006-06-13 Canon Kabushiki Kaisha Data transmission apparatus, system and method, and image processing apparatus

Similar Documents

Publication Publication Date Title
US6038607A (en) Method and apparatus in a computer system having plural computers which cause the initiation of functions in each other using information contained in packets transferred between the computers
JP3127523B2 (en) Communication control device and data transmission method
KR101001074B1 (en) Method for transmittng data on a bus
US5142628A (en) Microcomputer system for communication
JPH0736807A (en) Communication control method
JP3512278B2 (en) Serial communication processor
JP2560476B2 (en) Communication control device
JP3753622B2 (en) Packet transceiver
JP3489456B2 (en) Real-time communication device and system
JPH1049344A (en) Buffer busy control system
JPH02245860A (en) Data transfer sysem
JP2821053B2 (en) Network system
EP0829807A2 (en) Data transmission system for transmitting data between plural microcomputer application instruments
JPH10312360A (en) Method for reception processing and reception device
JP2002252667A (en) Processor device and method for calculating processor loading
JPS59161956A (en) Transmission controller
JPH10228442A (en) Data receiving device and method and recording medium using direct memory access
JPH11289357A (en) Reception data processing system
JP3146864B2 (en) Unidirectional loop transmission circuit
JP2841505B2 (en) Communication control device
JP3266789B2 (en) Communication control device
JP2842639B2 (en) Data transfer method
JPH0417492B2 (en)
JPS62250746A (en) Hdlc transmitting device
JPH0728730A (en) Communication controller