JP2012118895A - Communication device, data transfer method of communication device, and communication program - Google Patents

Communication device, data transfer method of communication device, and communication program Download PDF

Info

Publication number
JP2012118895A
JP2012118895A JP2010269971A JP2010269971A JP2012118895A JP 2012118895 A JP2012118895 A JP 2012118895A JP 2010269971 A JP2010269971 A JP 2010269971A JP 2010269971 A JP2010269971 A JP 2010269971A JP 2012118895 A JP2012118895 A JP 2012118895A
Authority
JP
Japan
Prior art keywords
data
communication
transfer
memory
buffer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2010269971A
Other languages
Japanese (ja)
Other versions
JP5586442B2 (en
Inventor
Tatsunori Tsujimura
達徳 辻村
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2010269971A priority Critical patent/JP5586442B2/en
Publication of JP2012118895A publication Critical patent/JP2012118895A/en
Application granted granted Critical
Publication of JP5586442B2 publication Critical patent/JP5586442B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To complete DMA transfer early in fixed-period communication.SOLUTION: A block size setting part 222 sets a plurality of block sizes in the decreasing order. A data communication part 210 stores received data as partial data of period data 110 in a buffer 211 until reception of the period data 110 is completed. A transfer control circuit 223 transfers partial data stored in the buffer 211 as first block data to a memory 230 a communication time, needed to receive partial data by a first block size, after the data communication part 210 starts the communication. Further, the transfer control circuit 223 transfers partial data stored in the buffer 211 as new block data a transfer time, needed to transfer the partial data by a last block size, after the last block data begins to be transferred.

Description

本発明は、例えば、通信データをDMA(Direct Memory Access)で転送する通信装置、通信装置のデータ転送方法および通信プログラムに関するものである。   The present invention relates to, for example, a communication device that transfers communication data by DMA (Direct Memory Access), a data transfer method of the communication device, and a communication program.

従来、伝送装置(通信装置)のCPU(Central Processing Unit)は、通信バッファにアクセスし、通信バッファからメモリに受信データを転送し、受信データに対する応答データを生成していた。
しかし、CPUの処理速度が高速になったことに伴い、CPUの性能を有効的に活用するため、通信バッファとメモリとの間のデータ転送をCPUとは別の仕組みによって行うようになった。この仕組みを「DMA転送」という。
Conventionally, a CPU (Central Processing Unit) of a transmission device (communication device) accesses a communication buffer, transfers received data from the communication buffer to a memory, and generates response data for the received data.
However, as the processing speed of the CPU has increased, data transfer between the communication buffer and the memory is performed by a mechanism different from the CPU in order to effectively utilize the CPU performance. This mechanism is called “DMA transfer”.

例えば、複数の伝送装置が一定周期内で順番に送信を行う「定周期通信」において、伝送装置は、一定周期の通信が終了したときにDMA転送を開始する。
そして、伝送装置のCPUは、DMA転送が終了した後に、受信データに対する応答データを生成する。生成された応答データは次の送信タイミング時に送信される。
For example, in “fixed cycle communication” in which a plurality of transmission devices transmit in order within a fixed cycle, the transfer device starts DMA transfer when the fixed cycle communication ends.
Then, the CPU of the transmission apparatus generates response data for the received data after the DMA transfer is completed. The generated response data is transmitted at the next transmission timing.

DMA転送を早く完了させる方法として、特許文献1には以下のような方法が開示されている。   As a method for completing DMA transfer early, Patent Document 1 discloses the following method.

特許文献1に記載の方法は、一定周期に受信したデータを一定周期の通信が終了したときにまとめてDMA転送するのではなく、データを一定のブロックサイズだけ受信する度にDMA転送を行うものである。   The method described in Patent Document 1 performs DMA transfer every time data is received by a certain block size, instead of collectively transferring data received at a certain period when communication at a certain period is completed. It is.

しかし、特許文献1に記載の方法では、ブロックサイズが大きい場合、一定周期の通信が終了した後にブロックサイズ分の大きな受信データをDMA転送しなければいけない。この場合、DMA転送が完了する時刻はあまり早くならない。
また、ブロックサイズが小さい場合、通信バッファやメモリにアクセスする回数が増え、通信バッファやメモリにアクセスするためのオーバーヘッドが大きくなってしまう。この場合、DMA転送に要する時間を短縮できず、DMA転送を早く完了させることができない。
However, in the method described in Patent Document 1, when the block size is large, large received data corresponding to the block size must be DMA-transferred after communication of a certain period is completed. In this case, the time at which the DMA transfer is completed is not so early.
In addition, when the block size is small, the number of times of accessing the communication buffer and memory increases, and the overhead for accessing the communication buffer and memory increases. In this case, the time required for the DMA transfer cannot be shortened, and the DMA transfer cannot be completed quickly.

また、従来のDMA転送はDMA転送が完了した後にCPUへの通知を行い、CPUは受信データを処理する割り込みハンドラをDMA転送が完了してから起動していた。
このため、DMA転送が完了しても割り込みハンドラの起動処理が完了するまでは受信データを処理することができなかった。
In the conventional DMA transfer, the CPU is notified after the DMA transfer is completed, and the CPU starts an interrupt handler for processing received data after the DMA transfer is completed.
For this reason, even if the DMA transfer is completed, the received data cannot be processed until the interrupt handler activation process is completed.

特開2006−079332号公報JP 2006-079332 A

本発明は、例えば、定周期通信においてDMA転送を早く完了できるようにすることを目的とする。   An object of the present invention is to enable a DMA transfer to be completed quickly in, for example, fixed-cycle communication.

本発明の通信装置は、
データを記憶するメモリと、
通信データを記憶する通信バッファと、
ネットワークを介して通信データを通信するデータ通信部であって、通信データを受信し始めてから通信データを受信し終わるまで、受信したデータを通信データの部分データとして前記通信バッファに記憶するデータ通信部と、
前記データ通信部が通信を始めたときから予め順番が定められた複数のブロックサイズのうち一つ目のブロックサイズだけ部分データを受信するために要する通信時間が経過したときに、前記通信バッファに記憶されている部分データを一つ目のブロックデータとして前記メモリに転送し、一つ前のブロックデータの転送を始めたときから一つ前のブロックサイズだけ部分データを転送するために要する転送時間が経過したときに、前記通信バッファに記憶されている部分データを新たなブロックデータとして前記メモリに転送するデータ転送部とを備える。
The communication device of the present invention
A memory for storing data;
A communication buffer for storing communication data;
A data communication unit that communicates communication data via a network and stores the received data in the communication buffer as partial data of the communication data from the start of receiving the communication data until the end of receiving the communication data When,
When the communication time required for receiving the partial data by the first block size out of a plurality of block sizes determined in advance from the time when the data communication unit starts communication is stored in the communication buffer. The transfer time required for transferring the stored partial data to the memory as the first block data and transferring the partial data by the previous block size from the start of the transfer of the previous block data. A data transfer unit that transfers the partial data stored in the communication buffer to the memory as new block data.

本発明によれば、例えば、定周期通信においてDMA転送を早く完了させることができる。   According to the present invention, for example, DMA transfer can be completed early in fixed-cycle communication.

実施の形態1における通信システム100の構成図。1 is a configuration diagram of a communication system 100 according to Embodiment 1. FIG. 実施の形態1における伝送装置200の機能構成図。2 is a functional configuration diagram of a transmission apparatus 200 according to Embodiment 1. FIG. 実施の形態1における周期データ110の一例を示す図。FIG. 6 shows an example of periodic data 110 in the first embodiment. 実施の形態1における周期データ110の一例を示す図。FIG. 6 shows an example of periodic data 110 in the first embodiment. 実施の形態1における通信処理方法の概要を示すフローチャート。3 is a flowchart illustrating an overview of a communication processing method according to the first embodiment. 実施の形態1における転送制御回路223のデータ転送処理(S130)を示すフローチャート。9 is a flowchart showing data transfer processing (S130) of the transfer control circuit 223 according to the first embodiment. 実施の形態1における割込制御回路224のデータ転送処理(S130)を示すフローチャート。5 is a flowchart showing data transfer processing (S130) of the interrupt control circuit 224 according to the first embodiment. 実施の形態1におけるデータ転送方法を示す概要図。FIG. 3 is a schematic diagram illustrating a data transfer method according to the first embodiment. 実施の形態1におけるデータ転送方法(割り込み通知、転送完了通知)を示す概要図。FIG. 3 is a schematic diagram showing a data transfer method (interrupt notification, transfer completion notification) in the first embodiment. 従来のデータ転送方法を示す概要図。Schematic diagram showing a conventional data transfer method. 従来のデータ転送方法を示す概要図。Schematic diagram showing a conventional data transfer method. 実施の形態1における伝送装置200のハードウェア資源の一例を示す図。FIG. 3 is a diagram illustrating an example of hardware resources of the transmission apparatus 200 according to the first embodiment.

実施の形態1.
通信速度と転送速度とに基づいて転送待ち時間を決定し、転送待ち時間が経過する度に受信データを通信バッファからメモリにDMA(Direct Memory Access)転送する形態について説明する。
Embodiment 1 FIG.
A mode in which the transfer waiting time is determined based on the communication speed and the transfer speed, and received data is transferred from the communication buffer to the memory by DMA (Direct Memory Access) each time the transfer waiting time elapses will be described.

図1は、実施の形態1における通信システム100の構成図である。
実施の形態1における通信システム100の構成について、図1に基づいて説明する。
FIG. 1 is a configuration diagram of a communication system 100 according to the first embodiment.
The configuration of communication system 100 in the first embodiment will be described with reference to FIG.

通信システム100は、バス型のネットワーク101とネットワーク101に接続する複数の伝送装置200(通信装置の一例)とを有する。   The communication system 100 includes a bus-type network 101 and a plurality of transmission apparatuses 200 (an example of communication apparatuses) connected to the network 101.

各伝送装置200は、バス型のネットワーク101を介して定周期通信(例えば、時分割通信)を行う。
つまり、各伝送装置200は、所定の通信周期毎に他の伝送装置200にパケット111を送信する。また、各伝送装置200の送信順序が決められ、各伝送装置200は送信順序に従ってパケット111を送信する。各伝送装置200によって送信されたパケット111は、他の全ての伝送装置200によって受信される。
例えば、一回の通信周期が複数の単位時間に分割され、各伝送装置200に単位時間が割り当てられる。そして、各伝送装置200は、割り当てられた単位時間にのみパケット111を送信する。
Each transmission apparatus 200 performs fixed-cycle communication (for example, time division communication) via the bus-type network 101.
That is, each transmission device 200 transmits the packet 111 to another transmission device 200 at a predetermined communication cycle. Further, the transmission order of each transmission apparatus 200 is determined, and each transmission apparatus 200 transmits the packet 111 according to the transmission order. The packet 111 transmitted by each transmission device 200 is received by all other transmission devices 200.
For example, one communication cycle is divided into a plurality of unit times, and a unit time is assigned to each transmission apparatus 200. Each transmission device 200 transmits the packet 111 only in the allocated unit time.

通信システム100のネットワーク101は、バス型以外のネットワーク(スター型、リング型など)であっても構わない。   The network 101 of the communication system 100 may be a network other than the bus type (star type, ring type, etc.).

図2は、実施の形態1における伝送装置200の機能構成図である。
実施の形態1における伝送装置200の機能構成について、図2に基づいて説明する。
FIG. 2 is a functional configuration diagram of the transmission apparatus 200 according to the first embodiment.
A functional configuration of transmission apparatus 200 according to Embodiment 1 will be described with reference to FIG.

伝送装置200(通信装置の一例)は、データ通信部210、DMA転送部220、メモリ230およびCPU240を備える。また、データ通信部210は、バッファ211(通信バッファの一例)を備える。   The transmission device 200 (an example of a communication device) includes a data communication unit 210, a DMA transfer unit 220, a memory 230, and a CPU 240. The data communication unit 210 includes a buffer 211 (an example of a communication buffer).

CPU240(Central Processing Unit)は、メモリ230に記憶されたデータを処理する。   A CPU 240 (Central Processing Unit) processes data stored in the memory 230.

データ通信部210は、ネットワーク101を介して周期データ110(通信データの一例)を通信する。
そして、データ通信部210は、周期データ110を受信し始めてから周期データ110を受信し終わるまで、受信したデータを周期データ110の部分データとしてバッファ211に記憶する。
周期データ110とは、通信周期内に受信する複数のパケット111を含んだデータのことである。周期データ110については別途説明する。
The data communication unit 210 communicates periodic data 110 (an example of communication data) via the network 101.
The data communication unit 210 stores the received data in the buffer 211 as partial data of the periodic data 110 from the start of receiving the periodic data 110 until the reception of the periodic data 110 is completed.
The period data 110 is data including a plurality of packets 111 received within the communication period. The period data 110 will be described separately.

DMA転送部220は、制御レジスタ221、ブロックサイズ設定部222、転送制御回路223および割込制御回路224を備える。   The DMA transfer unit 220 includes a control register 221, a block size setting unit 222, a transfer control circuit 223, and an interrupt control circuit 224.

制御レジスタ221は、DMA転送の制御情報を記憶する。DMA転送の制御情報については別途説明する。   The control register 221 stores DMA transfer control information. The DMA transfer control information will be described separately.

ブロックサイズ設定部222は、制御レジスタ221に記憶された制御情報に基づいて後述するブロックサイズや転送待ち時間を算出する。
ブロックサイズ設定部222の詳細については別途説明する。
The block size setting unit 222 calculates a block size and a transfer waiting time described later based on the control information stored in the control register 221.
Details of the block size setting unit 222 will be described separately.

転送制御回路223(データ転送部の一例)は、データ通信部210が通信を始めたときから予め順番が定められた複数のブロックサイズのうち一つ目のブロックサイズだけ部分データを受信するために要する通信時間が経過したときに、バッファ211に記憶されている部分データを一つ目のブロックデータとしてメモリ230に転送する。
さらに、転送制御回路223は、一つ前のブロックデータの転送を始めたときから一つ前のブロックサイズだけ部分データを転送するために要する転送時間が経過したときに、バッファ211に記憶されている部分データを新たなブロックデータとしてメモリ230に転送する。
The transfer control circuit 223 (an example of a data transfer unit) receives partial data by the first block size out of a plurality of block sizes determined in advance since the data communication unit 210 started communication. When the required communication time has elapsed, the partial data stored in the buffer 211 is transferred to the memory 230 as the first block data.
Further, the transfer control circuit 223 stores the data stored in the buffer 211 when the transfer time required to transfer the partial data by the previous block size has elapsed since the start of the transfer of the previous block data. The existing partial data is transferred to the memory 230 as new block data.

ブロックサイズに相当する通信時間および転送時間を転送待ち時間と言い換えた場合、転送制御回路223の上記説明は以下の通りである。
転送制御回路223は、データ通信部210が通信を始めたときから所定の初回の転送待ち時間が経過したときに、バッファ211に記憶されている部分データを初回のブロックデータとしてメモリ230に転送する。
さらに、転送制御回路223は、前回のブロックデータの転送を始めたときから今回の転送待ち時間が経過したときに、バッファ211に記憶されている部分データを今回のブロックデータとしてメモリ230に転送する。今回の転送待ち時間とは、前回の転送待ち時間にネットワーク101の通信速度を乗算して得られるデータサイズ(後述するブロックサイズ)だけ部分データを転送するための時間である。
When the communication time and the transfer time corresponding to the block size are rephrased as the transfer waiting time, the above description of the transfer control circuit 223 is as follows.
The transfer control circuit 223 transfers the partial data stored in the buffer 211 to the memory 230 as the first block data when a predetermined first transfer waiting time elapses from when the data communication unit 210 starts communication. .
Further, the transfer control circuit 223 transfers the partial data stored in the buffer 211 to the memory 230 as the current block data when the current transfer waiting time has elapsed since the start of the previous block data transfer. . The current transfer waiting time is a time for transferring partial data by a data size (a block size described later) obtained by multiplying the communication speed of the network 101 by the previous transfer waiting time.

また、転送制御回路223(転送完了通知部の一例)は、全ての部分データをメモリ230に転送し終えたときに、CPU240に転送完了通知を通知する。
CPU240は、割り込みハンドラの起動処理が完了して転送完了通知を検出したときに、メモリ230に転送された部分データにより構成される周期データ110を割り込みハンドラによって処理する。割り込みハンドラとは、周期データ110を処理するための機能である。
The transfer control circuit 223 (an example of a transfer completion notification unit) notifies the CPU 240 of a transfer completion notification when all the partial data has been transferred to the memory 230.
When the interrupt handler activation process is completed and the transfer completion notification is detected, the CPU 240 processes the periodic data 110 constituted by the partial data transferred to the memory 230 by the interrupt handler. The interrupt handler is a function for processing the periodic data 110.

割込制御回路224(割り込み通知部の一例)は、転送制御回路223がCPU240に転送完了通知を通知する前に、CPU240に割り込み通知を通知する。CPU240は、割込制御回路224から通知された割り込み通知を検出したときに割り込みハンドラの起動処理を開始する。   The interrupt control circuit 224 (an example of an interrupt notification unit) notifies the CPU 240 of an interrupt notification before the transfer control circuit 223 notifies the CPU 240 of a transfer completion notification. The CPU 240 starts the interrupt handler activation process when detecting the interrupt notification notified from the interrupt control circuit 224.

周期データ110は、ネットワーク101を介して通信され、バス201を介してバッファ211からメモリ230に転送される。
ネットワーク101は外部の通信路(または通信ケーブル、信号線)であり、バス201は内部の通信路(または信号線)である。
The periodic data 110 is communicated via the network 101 and transferred from the buffer 211 to the memory 230 via the bus 201.
The network 101 is an external communication path (or communication cable, signal line), and the bus 201 is an internal communication path (or signal line).

図3、図4は、実施の形態1における周期データ110の一例を示す図である。
実施の形態1における周期データ110について、図3および図4に基づいて説明する。
3 and 4 are diagrams illustrating an example of the periodic data 110 according to the first embodiment.
The period data 110 in the first embodiment will be described with reference to FIGS. 3 and 4.

図3に示すように、周期データ110とは、各伝送装置200から一回の通信周期に送信された複数のパケット111を含んだデータである。
但し、各伝送装置200が受信する周期データ110には自己の送信パケットを含まない。例えば、伝送装置200Cが受信する周期データ110には、伝送装置200Cが送信するパケット111Cを含まない。
As illustrated in FIG. 3, the period data 110 is data including a plurality of packets 111 transmitted from each transmission device 200 in one communication period.
However, the periodic data 110 received by each transmission apparatus 200 does not include its own transmission packet. For example, the periodic data 110 received by the transmission apparatus 200C does not include the packet 111C transmitted by the transmission apparatus 200C.

図4において、網掛け部分は自己の送信パケットに相当する部分を示している。
各伝送装置200によって受信された周期データ110は、複数のブロックデータBDに分けてDMA転送される。
また、ブロックデータBDのサイズ(ブロックサイズ)は徐々に小さくなり、最後のブロックデータBDのサイズが最も小さい。但し、ブロックサイズには自己の送信パケットに相当する部分のサイズを含めるものとする。つまり、先頭のブロックデータBDのブロックサイズは自己の送信パケットのサイズ(網掛け部分)を含めると最も大きい。
In FIG. 4, the shaded portion indicates a portion corresponding to its own transmission packet.
Periodic data 110 received by each transmission apparatus 200 is divided into a plurality of block data BDs and DMA-transferred.
Further, the size (block size) of the block data BD gradually decreases, and the size of the last block data BD is the smallest. However, the block size includes the size of the portion corresponding to its own transmission packet. That is, the block size of the head block data BD 1 is the largest when including the size of the transmission packet (shaded part).

図5は、実施の形態1における通信処理方法の概要を示すフローチャートである。
実施の形態1における通信処理方法の概要について、図5に基づいて説明する。
FIG. 5 is a flowchart showing an outline of the communication processing method according to the first embodiment.
An outline of the communication processing method in the first embodiment will be described with reference to FIG.

制御情報設定処理(S110)において、ブロックサイズ設定部222は、ブロックサイズや転送待ち時間などの制御情報を算出し、算出した制御情報を制御レジスタ221に設定する。
S110の詳細については別途説明する。
In the control information setting process (S110), the block size setting unit 222 calculates control information such as a block size and a transfer waiting time, and sets the calculated control information in the control register 221.
Details of S110 will be described separately.

データ通信処理(S120)において、データ通信部210は、定周期通信を行う。
定周期通信の周期毎に、特定の伝送装置200のデータ通信部210は同期信号を送信し、他の伝送装置200のデータ通信部210は同期信号を受信する。そして、各伝送装置200のデータ通信部210は同期信号の送受信時に通信を開始する。これにより、各伝送装置200が周期毎に同期して通信を行うことができる。
データ通信部210は、周期データ110を受信し始めてから周期データ110を受信し終わるまで、受信しているデータ(周期データ110の部分データ)をバッファ211に順次記憶する。
In the data communication process (S120), the data communication unit 210 performs fixed cycle communication.
At each periodic communication cycle, the data communication unit 210 of a specific transmission device 200 transmits a synchronization signal, and the data communication units 210 of other transmission devices 200 receive the synchronization signal. And the data communication part 210 of each transmission apparatus 200 starts communication at the time of transmission / reception of a synchronizing signal. Thereby, each transmission apparatus 200 can communicate in synchronization every period.
The data communication unit 210 sequentially stores the received data (partial data of the periodic data 110) in the buffer 211 from the start of receiving the periodic data 110 until the reception of the periodic data 110 is completed.

データ転送処理(S130)において、DMA転送部220は、S110で設定された制御情報に従って、バッファ211に記憶される周期データ110を複数回に分けてバッファ211からメモリ230に転送する。
S130の詳細については別途説明する。
In the data transfer process (S130), the DMA transfer unit 220 transfers the periodic data 110 stored in the buffer 211 from the buffer 211 to the memory 230 in a plurality of times according to the control information set in S110.
Details of S130 will be described separately.

データ処理(S140)において、CPU240は、メモリ230に転送された周期データ110に対して所定の処理を行う。
例えば、CPU240は、周期データ110に含まれるパケット111に対して応答パケットを生成し、生成した応答パケットをメモリ230に記憶する。
次に、DMA転送部220は、メモリ230に記憶された応答パケットをバッファ211に転送する。
そして、データ通信部210は、自分の送信の順番になったときに応答パケットをネットワーク101に送信する。
In the data processing (S140), the CPU 240 performs predetermined processing on the periodic data 110 transferred to the memory 230.
For example, the CPU 240 generates a response packet for the packet 111 included in the periodic data 110 and stores the generated response packet in the memory 230.
Next, the DMA transfer unit 220 transfers the response packet stored in the memory 230 to the buffer 211.
Then, the data communication unit 210 transmits a response packet to the network 101 when its own transmission order is reached.

S120からS140の処理は、通信周期毎に繰り返し実行される。   The processing from S120 to S140 is repeatedly executed every communication cycle.

次に、制御情報設定処理(図5、S110)について説明する。   Next, the control information setting process (S110 in FIG. 5) will be described.

利用者は、周期データ110(受信パケットと送信パケットとを含む)のデータサイズTD、ネットワーク101の通信速度TNおよびバス201の転送速度TBを制御レジスタ221に設定する。
また、利用者は、バッファ211のオーバーヘッドOH、メモリ230のオーバーヘッドOHおよび最終ブロックデータのブロックサイズRD(または先頭ブロックデータのブロックサイズRD)を制御レジスタ221に設定する。
また、利用者は、割り込み通知の通知時間NTと転送完了通知の通知時間NTとを制御レジスタ221に設定する。
The user sets the data size TD of the periodic data 110 (including the received packet and the transmitted packet), the communication speed TN of the network 101, and the transfer speed TB of the bus 201 in the control register 221.
Also, the user sets the overhead OH B, overhead OH M and last block Block Size RD N control register 221 (or first block block size RD 1 data) of the data in the memory 230 of the buffer 211.
In addition, the user sets an interrupt notification notification time NT I and a transfer completion notification notification time NT E in the control register 221.

バッファ211のオーバーヘッドとは、バッファ211のアクセスに要する時間(例えば、バッファ211からブロックデータを読み出すための時間)である。
メモリ230のオーバーヘッドとは、メモリ230のアクセスに要する時間(例えば、メモリ230にブロックデータを書き込むための時間)である。
割り込み通知の通知時間NTとは、割り込み通知をCPU240に通知するために必要な時間(例えば、割込制御回路224が割り込み通知を生成して送信し、CPU240が割り込み通知を検出するための時間)である。
転送完了通知NTとは、転送制御回路223が転送完了通知を生成して送信し、CPU240が転送完了通知を検出するための時間)である。
The overhead of the buffer 211 is a time required for accessing the buffer 211 (for example, a time for reading block data from the buffer 211).
The overhead of the memory 230 is a time required for accessing the memory 230 (for example, a time for writing block data to the memory 230).
Interrupts The alert notification time NT I, time needed to notify the interrupt notification to the CPU 240 (e.g., sends an interrupt control circuit 224 generates an interrupt notification, the time for CPU 240 detects the interrupt notification ).
A transfer completion notification NT E, the transfer control circuit 223 generates and transmits a completion notification transfer, CPU 240 is a time) for detecting a completion notification transfer.

ブロックサイズ設定部222は、上記の値を用いて以下の関係式(1−1)を計算する。
関係式(1−1)の左辺は、データをi番目のブロックサイズRDだけ受信するために必要な通信時間を意味する。
また、関係式(1−1)の右辺は、データをi−1番目のブロックサイズRDi−1だけ転送するために必要な転送時間を意味する。
The block size setting unit 222 calculates the following relational expression (1-1) using the above values.
The left side of the relational expression (1-1) means a communication time necessary for receiving data by the i-th block size RD i .
Further, the right side of the relational expression (1-1) means a transfer time necessary for transferring data by the (i-1) th block size RD i-1 .

ブロックサイズ設定部222は、関係式(1−1)を計算することにより、1番目からN番目(最後)のブロックサイズを算出する。
但し、ブロックサイズ設定部222は、関係式(1−2)を満たすように、つまり、ブロックサイズの合計(左辺)と周期データ110のデータサイズTD(右辺)とが一致するように、ブロックサイズRDを調整する。例えば、次のブロックサイズを加えるとブロックサイズの合計が周期データ110のデータサイズTDを超えてしまう場合、余ったデータサイズを一つ前に算出したブロックサイズに加える。また例えば、越えた分のデータサイズを一つ前に算出したブロックサイズから差し引く。
The block size setting unit 222 calculates the first to Nth (last) block size by calculating the relational expression (1-1).
However, the block size setting unit 222 satisfies the relational expression (1-2), that is, the block size so that the total block size (left side) matches the data size TD (right side) of the period data 110. Adjust RD i . For example, when the next block size is added and the total block size exceeds the data size TD of the period data 110, the surplus data size is added to the block size calculated immediately before. Also, for example, the excess data size is subtracted from the previously calculated block size.

Figure 2012118895
Figure 2012118895

さらに、ブロックサイズ設定部222は、1番目のブロックサイズRDを用いて以下の式(2−1)を計算し、1番目の転送待ち時間WTを算出する。1番目の転送待ち時間WTは、1番目のブロックサイズRDを受信するために必要な通信時間である。
また、ブロックサイズ設定部222は、以下の式(2−2)を計算し、2番目以降の転送待ち時間WTを算出する。i(≠1)番目の転送待ち時間WTは、i−1番目のブロックサイズRDi−1を転送するために必要な時間である。i−1番目のブロックサイズRDi−1は、i−1番目の転送待ち時間WTi−1に通信速度TNを乗じた値に等しい。
Further, the block size setting unit 222 calculates the following equation (2-1) using the first block size RD 1 to calculate the first transfer waiting time WT 1 . The first transfer waiting time WT 1 is a communication time necessary for receiving the first block size RD 1 .
Further, the block size setting unit 222 calculates the following equation (2-2), and calculates the second and subsequent transfer wait times WT. The i (≠ 1) -th transfer waiting time WT i is a time required for transferring the (i−1) -th block size RD i−1 . The (i-1) th block size RD i-1 is equal to a value obtained by multiplying the (i-1) th transfer waiting time WT i-1 by the communication speed TN.

Figure 2012118895
Figure 2012118895

ブロックサイズ設定部222は、算出したブロックサイズRDおよび転送待ち時間WTを制御レジスタ221に設定する。   The block size setting unit 222 sets the calculated block size RD and transfer waiting time WT in the control register 221.

図6は、実施の形態1における転送制御回路223のデータ転送処理(S130)を示すフローチャートである。
実施の形態1における転送制御回路223のデータ転送処理(図5、S130)(データ転送処理、転送完了通知処理の一例)について、図6に基づいて説明する。
FIG. 6 is a flowchart showing the data transfer process (S130) of the transfer control circuit 223 in the first embodiment.
Data transfer processing (FIG. 5, S130) (an example of data transfer processing and transfer completion notification processing) of the transfer control circuit 223 in the first embodiment will be described with reference to FIG.

S210において、データ通信部210は同期信号を受信した場合、同期信号の受信(当該周期の通信開始)を転送制御回路223に通知する。
転送制御回路223は、制御レジスタ221を参照し、最初(1番目)の転送待ち時間WTを設定した転送待ちタイマを起動する。
転送待ちタイマは、起動してから設定時間が経過したときにタイムアウトを通知する機能である。
つまり、最初の転送待ち時間WTが設定された転送待ちタイマは、データ通信部210が当該周期の通信を始めたときから周期データ110の部分データを1番目のブロックサイズRDだけ受信するために必要な通信時間(最初の転送待ち時間WT)が経過したときにタイムアウトする。
S210の後、S220に進む。
In S210, when the data communication unit 210 receives the synchronization signal, the data communication unit 210 notifies the transfer control circuit 223 of the reception of the synchronization signal (communication start in the period).
The transfer control circuit 223 refers to the control register 221 and starts a transfer waiting timer in which the first (first) transfer waiting time WT 1 is set.
The transfer wait timer is a function for notifying a timeout when a set time has elapsed since activation.
That is, the transfer waiting timer in which the first transfer waiting time WT 1 is set receives partial data of the period data 110 by the first block size RD 1 from when the data communication unit 210 starts communication in the period. Timeout occurs when the communication time (first transfer waiting time WT 1 ) necessary for the elapse of time elapses.
It progresses to S220 after S210.

S220において、転送制御回路223は、転送待ちタイマがタイムアウトするまで待機する。
転送待ちタイマがタイムアウトした場合(YES)、S230に進む。
In S220, the transfer control circuit 223 waits until the transfer waiting timer times out.
When the transfer waiting timer times out (YES), the process proceeds to S230.

S230において、転送制御回路223は、制御レジスタ221を参照し、タイムアウトした転送待ちタイマに設定した転送待ち時間WTが最後(N番目)の転送待ち時間WTであるか否かを判定する。
転送待ちタイマに設定した転送待ち時間WTが最後の転送待ち時間WTである場合(YES)、S260に進む。
転送待ちタイマに設定した転送待ち時間WTが最後の転送待ち時間WTでない場合(NO)、S240に進む。
In S230, the transfer control circuit 223 refers to the control register 221, and determines whether or not the transfer waiting time WT i set in the transfer waiting timer that has timed out is the last (Nth) transfer waiting time WT N.
When the transfer waiting time WT i set in the transfer waiting timer is the last transfer waiting time WT N (YES), the process proceeds to S260.
When the transfer waiting time WT i set in the transfer waiting timer is not the last transfer waiting time WT N (NO), the process proceeds to S240.

S240において、転送制御回路223は、次の転送待ち時間WTを設定した転送待ちタイマを起動する。
i番目の転送待ち時間WTが設定された転送待ちタイマは、周期データ110の部分データをi−1番目のブロックサイズRDi−1だけバッファ211からメモリ230に転送するために必要な転送時間(i番目の転送待ち時間WT)が経過したときにタイムアウトする。
S240の後、S250に進む。
In S240, the transfer control circuit 223 starts a transfer waiting timer in which the next transfer waiting time WT i is set.
The transfer waiting timer in which the i-th transfer waiting time WT i is set is the transfer time required for transferring the partial data of the period data 110 from the buffer 211 to the memory 230 by the i−1th block size RD i−1. A timeout occurs when (i-th transfer waiting time WT i ) has elapsed.
It progresses to S250 after S240.

S250において、転送制御回路223は、バッファ211とメモリ230とにアクセスし、バッファ211に記憶されている周期データ110の部分データをi番目のブロックデータDとしてメモリ230に転送する。メモリ230に転送されたブロックデータDはバッファ211から削除される。
S250の後、S220に戻る。
In S250, the transfer control circuit 223 accesses the buffer 211 and the memory 230, and transfers the partial data of the period data 110 stored in the buffer 211 in the memory 230 as the i-th block data D i. Block data D i transferred to the memory 230 is deleted from the buffer 211.
After S250, the process returns to S220.

S260において、転送制御回路223は、バッファ211とメモリ230とにアクセスし、バッファ211に記憶されている周期データ110の部分データを最後(N番目)のブロックデータDとしてメモリ230に転送する。メモリ230に転送されたブロックデータDはバッファ211から削除される。
S260の後、S270に進む。
In S260, the transfer control circuit 223 accesses the buffer 211 and the memory 230, and transfers the partial data of the period data 110 stored in the buffer 211 in the memory 230 as the block data D N of the last (N th). Block data D N, which is transferred to the memory 230 is deleted from the buffer 211.
It progresses to S270 after S260.

S270において、転送制御回路223は、周期データ110の転送が完了したことを示す転送完了通知をCPU240に通知する。転送完了通知には、メモリ230内の周期データ110にアクセスするために、メモリ230内の転送先アドレス、周期データ110のデータサイズTDなどの情報を設定する。これらの情報は制御レジスタ221を用いて管理する。
CPU240は、転送完了通知を検出したとき又はその直後に所定の割り込みハンドラの起動処理を完了する。割り込みハンドラの起動については別途説明する。
CPU240は、割り込みハンドラの起動処理を完了して転送完了通知を検出したときに割り込みハンドラを動作させる。割り込みハンドラはメモリ230にアクセスし、メモリ230に記憶されている周期データ110に対して所定のデータ処理を行う(図5、S140)。
S270により、転送制御回路223のデータ転送処理(S130)は終了する。
In S270, the transfer control circuit 223 notifies the CPU 240 of a transfer completion notification indicating that the transfer of the periodic data 110 has been completed. In the transfer completion notification, information such as a transfer destination address in the memory 230 and a data size TD of the periodic data 110 is set in order to access the periodic data 110 in the memory 230. These pieces of information are managed using the control register 221.
The CPU 240 completes the predetermined interrupt handler activation process when the transfer completion notification is detected or immediately thereafter. The activation of the interrupt handler will be explained separately.
The CPU 240 operates the interrupt handler when the interrupt handler activation process is completed and a transfer completion notification is detected. The interrupt handler accesses the memory 230 and performs predetermined data processing on the periodic data 110 stored in the memory 230 (S140 in FIG. 5).
By S270, the data transfer process (S130) of the transfer control circuit 223 ends.

図7は、実施の形態1における割込制御回路224のデータ転送処理(S130)を示すフローチャートである。
実施の形態1における割込制御回路224のデータ転送処理(図5、S130)(割り込み通知処理の一例)について、図7に基づいて説明する。
FIG. 7 is a flowchart showing the data transfer process (S130) of the interrupt control circuit 224 in the first embodiment.
Data transfer processing (FIG. 5, S130) (an example of interrupt notification processing) of the interrupt control circuit 224 in the first embodiment will be described with reference to FIG.

S310において、割込制御回路224は、転送制御回路223によるブロックデータDの転送が終了するまで待機する。
例えば、転送制御回路223は、ブロックデータDの転送(図6、S250、S260)が終了したときにブロックデータDの転送終了を割込制御回路224に通知する。
ブロックデータDの転送が終了した場合(YES)、S320に進む。
In S310, the interrupt control circuit 224 waits by the transfer control circuit 223 until the transfer of the block data D i is completed.
For example, the transfer control circuit 223 notifies the interrupt control circuit 224 of the completion of the transfer of the block data D i when the transfer of the block data D i (FIG. 6, S250, S260) is completed.
If the transfer of the block data D i is completed (YES), the process proceeds to S320.

S320において、割込制御回路224は、制御レジスタ221を参照し、転送済みブロックサイズTDを算出する。i番目のブロックデータDの転送が終了した場合、1番目のi番目までのブロックサイズRD〜RDの合計値が転送済みブロックサイズTDである。
S320の後、S330に進む。
In S320, the interrupt control circuit 224 refers to the control register 221, and calculates the transferred block size TD E. If the transfer of the i-th block data D i is completed, the total value of the block size RD 1 ~ Rd i until the first i th is already transferred block size TD E.
It progresses to S330 after S320.

S330において、割込制御回路224は、転送済みブロックサイズTDを以下の割り込み通知条件式(3)に代入し、割り込み通知条件式(3)を満たすか否かを計算する。
割り込み通知条件式(3)において、「周期データ110のデータサイズTD−転送済みブロックサイズTD」は残りのブロックサイズRDの合計値に等しい。
S330の後、S340に進む。
In S330, the interrupt control circuit 224, the transferred block size TD E is substituted into the following interrupt notification condition (3), to calculate whether satisfied interrupt notification conditional expression (3).
In the interrupt notification conditional expression (3), “data size TD of periodic data 110−transferred block size TD E ” is equal to the total value of the remaining block sizes RD.
It progresses to S340 after S330.

Figure 2012118895
Figure 2012118895

S340において、割り込み通知条件式(3)を満たす場合(YES)、S350に進む。
割り込み通知条件式(3)を満たさない場合(NO)、S310に戻る。
If the interrupt notification conditional expression (3) is satisfied in S340 (YES), the process proceeds to S350.
If the interrupt notification conditional expression (3) is not satisfied (NO), the process returns to S310.

S350において、割込制御回路224は、割り込みハンドラの起動契機であることを通知する割り込み通知をCPU240に通知する。
CPU240は、割り込み通知を検出したときに割り込みハンドラの起動処理を開始する。
S350により、割込制御回路224のデータ転送処理(S130)は終了する。
In S350, the interrupt control circuit 224 notifies the CPU 240 of an interrupt notification for notifying that the interrupt handler is triggered.
The CPU 240 starts an interrupt handler activation process when detecting an interrupt notification.
By S350, the data transfer process (S130) of the interrupt control circuit 224 ends.

図8は、実施の形態1におけるデータ転送方法を示す概要図である。
実施の形態1におけるデータ転送方法について、図8に基づいて説明する。
FIG. 8 is a schematic diagram showing a data transfer method according to the first embodiment.
A data transfer method according to the first embodiment will be described with reference to FIG.

周期データ110は、6回に分けてバッファ211からメモリ230に転送されるものとする。
バッファ211のアクセスに要する時間を「OH」とし、メモリ230のアクセスに要する時間を「OH」とする。
また、伝送装置200に割り当てられた送信時間帯を網掛けで示す。網掛け以外の時間帯は、他の伝送装置200から周期データ110の部分データを受信する時間帯である。
It is assumed that the periodic data 110 is transferred from the buffer 211 to the memory 230 in six steps.
The time required for accessing the buffer 211 is “OH B ”, and the time required for accessing the memory 230 is “OH M ”.
Further, the transmission time zone assigned to the transmission apparatus 200 is indicated by shading. The time zone other than the shaded time is a time zone for receiving partial data of the periodic data 110 from the other transmission apparatus 200.

一周期の始めに同期信号120が通信される。   A synchronization signal 120 is communicated at the beginning of a cycle.

同期信号120を通信してから初回(1番目)の転送待ち時間WTが経過するまでにバッファ211に記憶されたデータが初回のブロックデータBDである。初回の転送待ち時間WTは、周期データ110の部分データを初回のブロックサイズRDだけ受信するために必要な時間である。
DMA転送部220の転送制御回路223は、初回の転送待ち時間WTが経過したときに初回のブロックデータBDをバッファ211からメモリ230に転送する。
The data stored in the buffer 211 until the first (first) transfer waiting time WT 1 elapses after communication of the synchronization signal 120 is the first block data BD 1 . The first transfer waiting time WT 1 is a time required for receiving the partial data of the period data 110 by the initial block size RD 1 .
The transfer control circuit 223 of the DMA transfer unit 220 transfers the first block data BD 1 from the buffer 211 to the memory 230 when the first transfer waiting time WT 1 has elapsed.

初回のブロックデータBDの転送を始めてから2回目(2番目)の転送待ち時間WTが経過するまでにバッファ211に記憶されたデータが2回目のブロックデータBDである。2回目の転送待ち時間WTは、周期データ110の部分データを初回のブロックサイズRDだけ転送するために必要な時間である。
DMA転送部220の転送制御回路223は、2回目の転送待ち時間WTが経過したときに2回目のブロックデータBDをバッファ211からメモリ230に転送する。
The data stored in the buffer 211 from the start of the transfer of the first block data BD 1 until the second (second) transfer waiting time WT 2 elapses is the second block data BD 2 . The second transfer waiting time WT 2 is a time required for transferring the partial data of the periodic data 110 by the initial block size RD 1 .
The transfer control circuit 223 of the DMA transfer unit 220 transfers the second block data BD 2 from the buffer 211 to the memory 230 when the second transfer waiting time WT 2 has elapsed.

以後、最後(6番目)のブロックデータBDを転送するまで処理を繰り返す。
つまり、前回のブロックデータBDi−1の転送を始めてから今回の転送待ち時間WTが経過するまでにバッファ211に記憶されたデータが今回のブロックデータBDである。今回の転送待ち時間WTは、周期データ110の部分データを前回のブロックサイズRDi−1だけ転送するために必要な時間である。
DMA転送部220の転送制御回路223は、今回の転送待ち時間WTが経過したときに今回のブロックデータBDをバッファ211からメモリ230に転送する。
Thereafter, the processing is repeated until the last (sixth) block data BD 6 is transferred.
That is, the data stored in the buffer 211 from the start of the transfer of the previous block data BD i-1 until the current transfer waiting time WT i elapses is the current block data BD i . The current transfer waiting time WT i is a time required to transfer the partial data of the period data 110 by the previous block size RD i−1 .
The transfer control circuit 223 of the DMA transfer unit 220 transfers the current block data BD i from the buffer 211 to the memory 230 when the current transfer waiting time WT i has elapsed.

図9は、実施の形態1におけるデータ転送方法(割り込み通知、転送完了通知)を示す概要図であり、図8のうちブロックデータBDを転送している時間帯を拡大した図である。
割り込み通知時および転送完了通知時について、図9に基づいて説明する。
FIG. 9 is a schematic diagram showing the data transfer method (interrupt notification, transfer completion notification) in the first embodiment, and is an enlarged view of the time zone during which the block data BD 6 is transferred in FIG.
The interrupt notification time and transfer completion notification time will be described with reference to FIG.

DMA転送部220の割込制御回路224は、ブロックデータBDの転送が終了したときにCPU240に割り込み通知を通知する。但し、ブロックデータBDの転送が終了したときに前記割り込み通知条件式(3)を満たすものとする。
つまり、残りのブロックデータBDの受信に要する通信時間RD/TBに転送完了通知の通知時間TNを加えた時間は、割り込み通知の通知時間NTに割り込みハンドラの起動処理に要する処理時間BTを加えた時間に等しい時間またはより短い時間である。
The interrupt control circuit 224 of the DMA transfer unit 220 notifies the CPU 240 of an interrupt notification when the transfer of the block data BD 5 is completed. However, the interrupt notification conditional expression (3) is satisfied when the transfer of the block data BD 5 is completed.
In other words, the time is the addition notification time TN E transfer completion notification to the communication time required for reception of the remaining block data BD 6 RD 6 / TB, the interrupt notification reminder time NT I to interrupt the startup process to take the processing time of the handler It is equal to or shorter than the time of adding BT.

割り込み通知を検出したCPU240は、割り込みハンドラの起動処理を開始する。   The CPU 240 that has detected the interrupt notification starts an interrupt handler activation process.

DMA転送部220の転送制御回路223は、最後のブロックデータBDの転送が終了したときに、CPU240に転送完了通知を通知する。
割り込みハンドラの起動処理は、CPU240が転送完了通知を検出したとき又はそのすぐ後に完了する。
The transfer control circuit 223 of the DMA transfer unit 220 notifies the CPU 240 of a transfer completion notification when the transfer of the last block data BD 6 is completed.
The interrupt handler activation process is completed when the CPU 240 detects a transfer completion notification or immediately thereafter.

転送完了通知を検出したCPU240は割り込みハンドラを動作させ、割り込みハンドラはメモリ230に転送された周期データ110に対して所定のデータ処理を行う。
例えば、割り込みハンドラは、周期データ110に含まれる各パケット111に対する応答パケットを生成し、生成した応答パケットをメモリ230に記憶する。この場合、DMA転送部220は、メモリ230に記憶された応答パケットをバッファ211に転送し、データ通信部210はバッファ211に転送された応答パケットを次周期の送信時間帯に送信する。
The CPU 240 detecting the transfer completion notification operates the interrupt handler, and the interrupt handler performs predetermined data processing on the periodic data 110 transferred to the memory 230.
For example, the interrupt handler generates a response packet for each packet 111 included in the periodic data 110 and stores the generated response packet in the memory 230. In this case, the DMA transfer unit 220 transfers the response packet stored in the memory 230 to the buffer 211, and the data communication unit 210 transmits the response packet transferred to the buffer 211 in the next transmission period.

図10、図11は、従来のデータ転送方法を示す概要図である。
図10に示すように従来のデータ転送方法では、周期データを全て受信した後に周期データの転送を行い、周期データの転送が全て終わった後に割り込み通知および転送完了通知を行っていた。
また、図11に示すように従来の別のデータ転送方法(特許文献1参照)では、周期データを単一の大きなブロックサイズBD毎に転送し、全てのブロックデータBDの転送が終わった後に割り込み通知および転送完了通知を行っていた。
一方、実施の形態1におけるデータ転送方法(図8、9参照)では、周期データを徐々に小さくなるブロックサイズBD毎に転送し、全てのブロックデータBDの転送が終わる前に割り込み通知を行う。
このため、実施の形態1におけるデータ転送方法は、周期データのDMA転送を従来のデータ転送方法よりも早く完了することができる。
10 and 11 are schematic diagrams showing a conventional data transfer method.
As shown in FIG. 10, in the conventional data transfer method, the periodic data is transferred after all the periodic data is received, and the interrupt notification and the transfer completion notification are performed after all the periodic data transfer is completed.
Further, as shown in FIG. 11, in another conventional data transfer method (see Patent Document 1), periodic data is transferred for each single large block size BD, and interrupted after all block data BDs have been transferred. Notification and transfer completion notification were performed.
On the other hand, in the data transfer method according to the first embodiment (see FIGS. 8 and 9), the periodic data is transferred for each gradually decreasing block size BD, and an interrupt notification is made before the transfer of all the block data BD is completed.
For this reason, the data transfer method according to the first embodiment can complete the DMA transfer of periodic data earlier than the conventional data transfer method.

図12は、実施の形態1における伝送装置200のハードウェア資源の一例を示す図である。
図12において、伝送装置200は、CPU240を備えている。CPU240は、バス201を介してROM903、RAM904(メモリ230の一例)、通信ボード905(データ通信部210の一例)、ディスプレイ装置911、キーボード912、マウス913、ドライブ装置914、磁気ディスク装置920と接続され、これらのハードウェアデバイスを制御する。ドライブ装置914は、FD(Flexible Disk Drive)、CD(Compact Disc)、DVD(Digital Versatile Disc)などの記憶媒体を読み書きする装置である。
FIG. 12 is a diagram illustrating an example of hardware resources of the transmission apparatus 200 according to the first embodiment.
In FIG. 12, the transmission apparatus 200 includes a CPU 240. The CPU 240 is connected to the ROM 903, the RAM 904 (an example of the memory 230), the communication board 905 (an example of the data communication unit 210), the display device 911, the keyboard 912, the mouse 913, the drive device 914, and the magnetic disk device 920 via the bus 201. And control these hardware devices. The drive device 914 is a device that reads and writes a storage medium such as an FD (Flexible Disk Drive), a CD (Compact Disc), and a DVD (Digital Versatile Disc).

通信ボード905は、有線または無線で、LAN(Local Area Network)、インターネット、電話回線などの通信網に接続している。   The communication board 905 is wired or wirelessly connected to a communication network such as a LAN (Local Area Network), the Internet, or a telephone line.

磁気ディスク装置920には、OS921(オペレーティングシステム)、プログラム群922、ファイル群923が記憶されている。   The magnetic disk device 920 stores an OS 921 (operating system), a program group 922, and a file group 923.

プログラム群922には、実施の形態において「〜部」または「〜ハンドラ」として説明する機能を実行するプログラムが含まれる。プログラムは、CPU240により読み出され実行される。すなわち、プログラムは、「〜部」または「〜ハンドラ」としてコンピュータを機能させるものであり、また「〜部」「〜ハンドラ」の手順や方法をコンピュータに実行させるものである。   The program group 922 includes programs that execute functions described as “˜unit” or “˜handler” in the embodiment. The program is read and executed by the CPU 240. In other words, the program causes the computer to function as “˜unit” or “˜handler”, and causes the computer to execute the procedures and methods of “˜unit” and “˜handler”.

ファイル群923には、実施の形態において説明する「〜部」「〜ハンドラ」で使用される各種データ(入力、出力、判定結果、計算結果、処理結果など)が含まれる。   The file group 923 includes various data (input, output, determination result, calculation result, processing result, etc.) used in “˜part” and “˜handler” described in the embodiment.

実施の形態において構成図およびフローチャートに含まれている矢印は主としてデータや信号の入出力を示す。   In the embodiment, arrows included in the configuration diagrams and flowcharts mainly indicate input and output of data and signals.

実施の形態において「〜部」として説明するものは「〜回路」、「〜装置」、「〜機器」であってもよく、また「〜ステップ」、「〜手順」、「〜処理」であってもよい。すなわち、「〜部」として説明するものは、ファームウェア、ソフトウェア、ハードウェアまたはこれらの組み合わせのいずれで実装されても構わない。   In the embodiment, what is described as “to part” may be “to circuit”, “to apparatus”, and “to device”, and “to step”, “to procedure”, and “to processing”. May be. That is, what is described as “to part” may be implemented by any of firmware, software, hardware, or a combination thereof.

実施の形態1において、例えば、以下のような通信システム100について説明した。
通信システム100は、外部バス(ネットワーク101)に接続された複数の伝送装置200を備え、伝送装置200間で一定の周期で通信を行う。
In the first embodiment, for example, the following communication system 100 has been described.
The communication system 100 includes a plurality of transmission devices 200 connected to an external bus (network 101), and performs communication between the transmission devices 200 at a constant cycle.

伝送装置200は、バッファ211、CPU240、メモリ230およびDMA転送部220を備える。
バッファ211はデータを送受信する際にデータを保持し、CPU240は演算を行い、メモリ230はCPU240に使用される。
DMA転送部220は、制御レジスタ221、ブロックサイズ設定部222、転送制御回路223および割込制御回路224を備える。以下、カッコ内に対応する記号または符号を記す。
制御レジスタ221は、転送元アドレス、転送先アドレス、転送データサイズ(TD)、転送データを分割したブロックデータサイズ(RD)、アドレスオフセット、周期、外部バスの転送速度(TN)、内部バスの転送速度(TB)、バッファ211のオーバーヘッド(OH)、CPU240の割込ハンドラの遅延値(BT)を格納したレジスタで構成される。
ブロックサイズ設定部222は、転送データサイズと外部・内部バスの転送速度に基づいてブロックデータサイズを算出する。
転送制御回路223は、制御レジスタ221の値に基づいて転送データ(周期データ110)を複数のブロック(BD)に分割し、ブロック単位でDMA転送を行う。
割込制御回路224は、CPU240に割込通知を行う。
The transmission apparatus 200 includes a buffer 211, a CPU 240, a memory 230, and a DMA transfer unit 220.
The buffer 211 holds data when data is transmitted and received, the CPU 240 performs calculations, and the memory 230 is used by the CPU 240.
The DMA transfer unit 220 includes a control register 221, a block size setting unit 222, a transfer control circuit 223, and an interrupt control circuit 224. In the following, the corresponding symbols or symbols are shown in parentheses.
The control register 221 includes a transfer source address, a transfer destination address, a transfer data size (TD), a block data size (RD) obtained by dividing the transfer data, an address offset, a cycle, an external bus transfer speed (TN), and an internal bus transfer. It consists of registers storing the speed (TB), the overhead of the buffer 211 (OH B ), and the delay value (BT) of the interrupt handler of the CPU 240.
The block size setting unit 222 calculates the block data size based on the transfer data size and the transfer speed of the external / internal bus.
The transfer control circuit 223 divides the transfer data (period data 110) into a plurality of blocks (BD) based on the value of the control register 221, and performs DMA transfer in units of blocks.
The interrupt control circuit 224 notifies the CPU 240 of an interrupt.

ブロックサイズ設定部222は、通信開始前に、外部バスの転送速度、内部バスの転送速度、バッファ211のオーバーヘッドおよび転送データサイズに基づいて、ブロックサイズ分の転送データをバッファ211に受信する間に1つ前にリードしたデータの転送を完了しているようなブロックデータサイズを制御レジスタ221に設定する。
転送制御回路223は、制御レジスタ221の値に従ってバッファ211からブロックデータサイズのデータを逐次リードして、メモリ230にDMA転送する。
The block size setting unit 222 receives the transfer data for the block size based on the transfer speed of the external bus, the transfer speed of the internal bus, the overhead of the buffer 211 and the transfer data size before starting communication. A block data size that completes the transfer of the data read immediately before is set in the control register 221.
The transfer control circuit 223 sequentially reads block data size data from the buffer 211 according to the value of the control register 221 and DMA-transfers the data to the memory 230.

割込制御回路224は、残りの転送データサイズの転送時間((TD−TD)/TB)と割込情報転送時間(NT)との和が、割込通知時間(NT)と割込ハンドラの遅延値(BT)との和に等しくなると、割り込み要因(割り込み通知)をCPU240に通知する。 The interrupt control circuit 224 determines that the sum of the transfer time ((TD−TD E ) / TB) of the remaining transfer data size and the interrupt information transfer time (NT E ) and the interrupt notification time (NT I ) When it becomes equal to the sum of the delay value (BT) of the interrupt handler, the CPU 240 is notified of an interrupt factor (interrupt notification).

つまり、DMA転送部220は、リードする転送データのブロックサイズを段階的に小さくすることで、転送データの分割数(ブロック数)を抑えながら、最後に送信するブロックデータのサイズを小さくする。
さらに、DMA転送部220はDMA転送の実行中に割込通知をCPU240に予め通知し、DMA転送を完了したときに割込情報(転送完了通知)を通知する。そして、CPU240は割込情報の通知を受けると直ちに動作する。
これにより、DMA転送部220は、従来技術よりもDMA転送を早く完了させることができる。
That is, the DMA transfer unit 220 gradually reduces the block size of the transfer data to be read, thereby reducing the size of the block data to be transmitted last while suppressing the division number (number of blocks) of the transfer data.
Further, the DMA transfer unit 220 notifies the CPU 240 in advance of an interrupt notification during execution of the DMA transfer, and notifies interrupt information (transfer completion notification) when the DMA transfer is completed. And CPU240 will operate | move immediately, if the notification of interruption information is received.
Thereby, the DMA transfer unit 220 can complete the DMA transfer earlier than the conventional technique.

実施の形態1における伝送装置200は、以下のような形態であっても構わない。   The transmission apparatus 200 in Embodiment 1 may have the following form.

利用者がブロックサイズや転送待ち時間を算出し、算出したブロックサイズや転送待ち時間を伝送装置200に入力してもよい。ブロックサイズ設定部222は入力されたブロックサイズや転送待ち時間を制御レジスタ221に設定する。   The user may calculate the block size and the transfer waiting time, and input the calculated block size and the transfer waiting time to the transmission apparatus 200. The block size setting unit 222 sets the input block size and transfer waiting time in the control register 221.

ブロックサイズ設定部222は、一定周期毎にまたは一つのブロックデータの転送が終了する度に、ブロックサイズおよび転送待ち時間を更新しても構わない。
例えば、伝送装置200は、データ通信部210が単位時間当たりに通信したデータサイズに基づいてネットワーク101の通信速度を算出する通信速度算出部を備える。また、伝送装置200は、転送制御回路223が単位時間当たりに転送したデータサイズに基づいてバス201の転送速度を算出する転送速度算出部を備える。そして、ブロックサイズ設定部222は、通信速度算出部により算出された通信速度と転送速度算出部により算出された転送速度とを用いて新たなブロックサイズおよび新たな転送待ち時間を算出する。
The block size setting unit 222 may update the block size and the transfer waiting time at regular intervals or whenever transfer of one block data is completed.
For example, the transmission apparatus 200 includes a communication speed calculation unit that calculates the communication speed of the network 101 based on the data size that the data communication unit 210 communicates per unit time. The transmission apparatus 200 also includes a transfer rate calculation unit that calculates the transfer rate of the bus 201 based on the data size transferred per unit time by the transfer control circuit 223. Then, the block size setting unit 222 calculates a new block size and a new transfer waiting time by using the communication speed calculated by the communication speed calculation unit and the transfer speed calculated by the transfer rate calculation unit.

CPU240により生成されたデータ(例えば、応答パケット)をメモリ230からバッファ211にDMA転送する際に、実施の形態1で説明したデータ転送方法を用いても構わない。   When the data (for example, response packet) generated by the CPU 240 is DMA-transferred from the memory 230 to the buffer 211, the data transfer method described in the first embodiment may be used.

転送制御回路223は、転送待ち時間が経過したときではなく、周期データ110の部分データがブロックサイズだけバッファ211に記憶されたときに、バッファ211からメモリ230に部分データを転送しても構わない。
つまり、転送制御回路223は、データ通信部210が通信を始めてから予め順番が定められた複数のブロックサイズのうち一つ目のブロックサイズだけ部分データがバッファ211に記憶されたときに、バッファ211に記憶された部分データをメモリ230に転送する。さらに、転送制御回路223は、次のブロックサイズだけ部分データがバッファ211に記憶されたときに、バッファ211に記憶された部分データをメモリ230に転送する。
例えば、転送制御回路223は定期的にバッファ211にアクセスし、バッファ211に記憶されている部分データのデータサイズを参照し、参照したデータサイズと所定のブロックサイズとを比較して部分データを転送するか否かを判定する。
The transfer control circuit 223 may transfer the partial data from the buffer 211 to the memory 230 when the partial data of the period data 110 is stored in the buffer 211 by the block size, not when the transfer waiting time has elapsed. .
That is, when the partial data is stored in the buffer 211 by the first block size among a plurality of block sizes whose order is determined in advance after the data communication unit 210 starts communication, the transfer control circuit 223 receives the buffer 211. The partial data stored in is transferred to the memory 230. Further, the transfer control circuit 223 transfers the partial data stored in the buffer 211 to the memory 230 when the partial data is stored in the buffer 211 by the next block size.
For example, the transfer control circuit 223 periodically accesses the buffer 211, refers to the data size of the partial data stored in the buffer 211, compares the referenced data size with a predetermined block size, and transfers the partial data. It is determined whether or not to do.

100 通信システム、101 ネットワーク、110 周期データ、111 パケット、200 伝送装置、201 バス、210 データ通信部、211 バッファ、220 DMA転送部、221 制御レジスタ、222 ブロックサイズ設定部、223 転送制御回路、224 割込制御回路、230 メモリ、240 CPU、903 ROM、904 RAM、905 通信ボード、911 ディスプレイ装置、912 キーボード、913 マウス、914 ドライブ装置、920 磁気ディスク装置、921 OS、922 プログラム群、923 ファイル群。   100 communication system, 101 network, 110 period data, 111 packet, 200 transmission device, 201 bus, 210 data communication unit, 211 buffer, 220 DMA transfer unit, 221 control register, 222 block size setting unit, 223 transfer control circuit, 224 Interrupt control circuit, 230 memory, 240 CPU, 903 ROM, 904 RAM, 905 communication board, 911 display device, 912 keyboard, 913 mouse, 914 drive device, 920 magnetic disk device, 921 OS, 922 program group, 923 file group .

Claims (6)

データを記憶するメモリと、
通信データを記憶する通信バッファと、
ネットワークを介して通信データを通信するデータ通信部であって、通信データを受信し始めてから通信データを受信し終わるまで、受信したデータを通信データの部分データとして前記通信バッファに記憶するデータ通信部と、
前記データ通信部が通信を始めたときから予め順番が定められた複数のブロックサイズのうち一つ目のブロックサイズだけ部分データを受信するために要する通信時間が経過したときに、前記通信バッファに記憶されている部分データを一つ目のブロックデータとして前記メモリに転送し、一つ前のブロックデータの転送を始めたときから一つ前のブロックサイズだけ部分データを転送するために要する転送時間が経過したときに、前記通信バッファに記憶されている部分データを新たなブロックデータとして前記メモリに転送するデータ転送部と
を備えたことを特徴とする通信装置。
A memory for storing data;
A communication buffer for storing communication data;
A data communication unit that communicates communication data via a network and stores the received data in the communication buffer as partial data of the communication data from the start of receiving the communication data until the end of receiving the communication data When,
When the communication time required for receiving the partial data by the first block size out of a plurality of block sizes determined in advance from the time when the data communication unit starts communication is stored in the communication buffer. The transfer time required for transferring the stored partial data to the memory as the first block data and transferring the partial data by the previous block size from the start of the transfer of the previous block data. And a data transfer unit that transfers the partial data stored in the communication buffer as new block data to the memory when the time elapses.
複数のブロックサイズが以下の関係式(A)を満たすことを特徴とする請求項1記載の通信装置。
Figure 2012118895
The communication apparatus according to claim 1, wherein the plurality of block sizes satisfy the following relational expression (A).
Figure 2012118895
前記通信装置は、さらに、
データを処理するCPU(Central Processing Unit)と、
前記データ転送部が全ての部分データを前記メモリに転送し終えたときに、前記CPUに転送完了通知を通知する転送完了通知部と、
前記転送完了通知部が前記CPUに転送完了通知を通知する前に、前記CPUに割り込み通知を通知する割り込み通知部とを備え、
前記CPUは、通信データを処理する割り込みハンドラの起動処理を前記割り込み通知を検出したときに開始し、
前記CPUは、前記割り込みハンドラの起動処理が完了して前記転送完了通知を検出したときに、前記メモリに転送された部分データにより構成される通信データを前記割り込みハンドラによって処理する
ことを特徴とする請求項1または請求項2記載の通信装置。
The communication device further includes:
CPU (Central Processing Unit) for processing data;
A transfer completion notification unit for notifying the CPU of a transfer completion notification when the data transfer unit has transferred all the partial data to the memory;
An interrupt notification unit that notifies the CPU of an interrupt notification before the transfer completion notification unit notifies the CPU of a transfer completion notification;
The CPU starts an interrupt handler process for processing communication data when the interrupt notification is detected,
The CPU processes the communication data constituted by the partial data transferred to the memory by the interrupt handler when the activation processing of the interrupt handler is completed and the transfer completion notification is detected. The communication apparatus according to claim 1 or 2.
前記割り込み通知部は、部分データが前記メモリに以下の関係式(B)を満たす転送済みサイズだけ転送されたときに、前記CPUに割り込み通知を通知する
ことを特徴とする請求項3記載の通信装置。
Figure 2012118895
4. The communication according to claim 3, wherein the interrupt notification unit notifies the CPU of an interrupt notification when the partial data is transferred to the memory by a transfer size that satisfies the following relational expression (B). apparatus.
Figure 2012118895
データを記憶するメモリと、通信データを記憶する通信バッファと、ネットワークを介して通信データを通信するデータ通信部と、前記通信バッファに記憶された通信データを前記メモリに転送するデータ転送部とを備える通信装置のデータ転送方法において、
前記データ通信部が、通信データを受信し始めてから通信データを受信し終わるまで、受信したデータを通信データの部分データとして前記通信バッファに記憶し、
前記データ転送部が、前記データ通信部が通信を始めたときから所定の初回の転送待ち時間が経過したときに、前記通信バッファに記憶されている部分データを初回のブロックデータとして前記メモリに転送し、前回の転送待ち時間に前記ネットワークの通信速度を乗算して得られるデータサイズだけ部分データを転送するための時間を今回の転送待ち時間として、前回のブロックデータの転送を始めたときから今回の転送待ち時間が経過したときに、前記通信バッファに記憶されている部分データを今回のブロックデータとして前記メモリに転送する
ことを特徴とする通信装置のデータ転送方法。
A memory for storing data, a communication buffer for storing communication data, a data communication unit for communicating communication data via a network, and a data transfer unit for transferring communication data stored in the communication buffer to the memory In a data transfer method for a communication device comprising:
The data communication unit stores the received data in the communication buffer as partial data of the communication data until the reception of the communication data after the reception of the communication data is completed.
The data transfer unit transfers the partial data stored in the communication buffer to the memory as initial block data when a predetermined initial transfer waiting time has elapsed since the data communication unit started communication. The time for transferring partial data by the data size obtained by multiplying the previous transfer waiting time by the network communication speed is used as the current transfer waiting time. A data transfer method for a communication apparatus, comprising: transferring the partial data stored in the communication buffer to the memory as current block data when a transfer waiting time elapses.
ネットワークを介して通信データを通信するデータ通信処理であって、通信データを受信し始めてから通信データを受信し終わるまで、受信したデータを通信データの部分データとして通信バッファに記憶するデータ通信処理と、
前記データ通信処理が通信を始めたときから所定の初回の転送待ち時間が経過したときに、前記通信バッファに記憶されている部分データを初回のブロックデータとしてメモリに転送し、前回の転送待ち時間に前記ネットワークの通信速度を乗算して得られるデータサイズだけ部分データを転送するための時間を今回の転送待ち時間として、前回のブロックデータの転送を始めたときから今回の転送待ち時間が経過したときに、前記通信バッファに記憶されている部分データを今回のブロックデータとして前記メモリに転送するデータ転送処理と
をコンピュータに実行させることを特徴とする通信プログラム。
Data communication processing for communicating communication data via a network, the data communication processing for storing the received data in the communication buffer as partial data of the communication data from the start of receiving the communication data until the end of receiving the communication data; ,
When a predetermined first transfer waiting time has elapsed since the start of communication in the data communication process, the partial data stored in the communication buffer is transferred to the memory as first block data, and the previous transfer waiting time The time for transferring partial data by the data size obtained by multiplying the communication speed of the network with this transfer waiting time is the current transfer waiting time, and this transfer waiting time has elapsed since the start of the previous block data transfer. In some cases, the communication program causes the computer to execute data transfer processing for transferring the partial data stored in the communication buffer to the memory as current block data.
JP2010269971A 2010-12-03 2010-12-03 COMMUNICATION DEVICE, COMMUNICATION DEVICE DATA TRANSFER METHOD, AND COMMUNICATION PROGRAM Expired - Fee Related JP5586442B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010269971A JP5586442B2 (en) 2010-12-03 2010-12-03 COMMUNICATION DEVICE, COMMUNICATION DEVICE DATA TRANSFER METHOD, AND COMMUNICATION PROGRAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010269971A JP5586442B2 (en) 2010-12-03 2010-12-03 COMMUNICATION DEVICE, COMMUNICATION DEVICE DATA TRANSFER METHOD, AND COMMUNICATION PROGRAM

Publications (2)

Publication Number Publication Date
JP2012118895A true JP2012118895A (en) 2012-06-21
JP5586442B2 JP5586442B2 (en) 2014-09-10

Family

ID=46501608

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010269971A Expired - Fee Related JP5586442B2 (en) 2010-12-03 2010-12-03 COMMUNICATION DEVICE, COMMUNICATION DEVICE DATA TRANSFER METHOD, AND COMMUNICATION PROGRAM

Country Status (1)

Country Link
JP (1) JP5586442B2 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07210500A (en) * 1994-01-25 1995-08-11 Fujitsu Ltd Data transfer controller
JPH0981497A (en) * 1995-09-12 1997-03-28 Toshiba Corp Real-time stream server, storing method for real-time stream data and transfer method therefor
JP2000069430A (en) * 1998-08-20 2000-03-03 Matsushita Electric Ind Co Ltd Video server system and its data transfer control method
JP2003303168A (en) * 2002-04-10 2003-10-24 Hitachi Ltd Semiconductor integrated circuit for communication control
JP2006252015A (en) * 2005-03-09 2006-09-21 Nec Engineering Ltd Data transfer controller

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07210500A (en) * 1994-01-25 1995-08-11 Fujitsu Ltd Data transfer controller
JPH0981497A (en) * 1995-09-12 1997-03-28 Toshiba Corp Real-time stream server, storing method for real-time stream data and transfer method therefor
JP2000069430A (en) * 1998-08-20 2000-03-03 Matsushita Electric Ind Co Ltd Video server system and its data transfer control method
JP2003303168A (en) * 2002-04-10 2003-10-24 Hitachi Ltd Semiconductor integrated circuit for communication control
JP2006252015A (en) * 2005-03-09 2006-09-21 Nec Engineering Ltd Data transfer controller

Also Published As

Publication number Publication date
JP5586442B2 (en) 2014-09-10

Similar Documents

Publication Publication Date Title
JP2011150397A (en) Bus arbitration device
US20170329632A1 (en) Device scheduling method, task manager and storage medium
US8838862B2 (en) Data transfer device, method of transferring data, and image forming apparatus
JP5460156B2 (en) Data processing device
JP2021119386A (en) Device and method for transferring data
JP2019053591A (en) Notification control device, notification control method and program
JP5586442B2 (en) COMMUNICATION DEVICE, COMMUNICATION DEVICE DATA TRANSFER METHOD, AND COMMUNICATION PROGRAM
JP6402576B2 (en) COMMUNICATION DEVICE, INFORMATION PROCESSING DEVICE, INFORMATION PROCESSING SYSTEM, AND COMMUNICATION DEVICE CONTROL METHOD
JP2008146541A (en) Dma transfer system, dma controller and dma transfer method
JP2009188508A (en) Data transmission and reception device
KR20140042420A (en) Semiconductor device and operating method thereof
JP5334173B2 (en) Data transfer system and retry control method
JP5374543B2 (en) DMA control apparatus, image forming apparatus, and DMA control method
JP2009048298A (en) Information processor, information processing method, program for implementing this information processing method, medium for recording this program, dma controller, dma transfer method, program for implementing this dma transfer method, and medium for recording this program
JP2005267294A (en) Network interrupt control method, information processing apparatus and image forming apparatus
JP2009187313A (en) Descriptor control method, direct memory transfer device, and program
CN113934671B (en) Interface control chip and network equipment
JP6213003B2 (en) Communication control device, image processing device, communication control program
JP2006195607A (en) Method and circuit for determining bulk-out transfer end
JP2007219925A (en) Bus controller, bus control program and recording medium
CN113711192A (en) Information processing apparatus
JP6213029B2 (en) Communication device and communication system
JP2005182505A (en) Data transfer controller and image forming apparatus
JP2010154329A (en) Ieee1394 communication lsi and asynchronous transmission method
JP4151449B2 (en) Channel control device, data transfer device, and channel control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130905

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140423

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140507

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140527

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140624

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20140722

R150 Certificate of patent or registration of utility model

Ref document number: 5586442

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees