JP2006133965A - Communication device - Google Patents

Communication device Download PDF

Info

Publication number
JP2006133965A
JP2006133965A JP2004320567A JP2004320567A JP2006133965A JP 2006133965 A JP2006133965 A JP 2006133965A JP 2004320567 A JP2004320567 A JP 2004320567A JP 2004320567 A JP2004320567 A JP 2004320567A JP 2006133965 A JP2006133965 A JP 2006133965A
Authority
JP
Japan
Prior art keywords
cpu
data
communication device
transmission
control device
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.)
Withdrawn
Application number
JP2004320567A
Other languages
Japanese (ja)
Inventor
Makoto 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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2004320567A priority Critical patent/JP2006133965A/en
Publication of JP2006133965A publication Critical patent/JP2006133965A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a transmission/reception process exclusive control means for sharing a general-purpose direct memory access function of one channel with reception data transfer and transmission data transfer when using only one channel of the general-purpose direct memory access function of a CPU on a communication device in the communication device. <P>SOLUTION: In this communication device, when transmission requirement is given from a controller loaded with the communication device, a register of the communication device is made to write the effect that the transmission requirement is given. The communication device checks the register at constant intervals, temporarily suspends the transfer of reception data when the transmission requirement is given, and performs transmission processing. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は通信装置に関し、より詳しくは汎用で使用できるDMAチャネルが一つしかない安価なCPUを用いて、一つのDMAチャネルを送信と受信で共用する装置に関するものである。   The present invention relates to a communication apparatus, and more particularly to an apparatus that shares a single DMA channel for transmission and reception using an inexpensive CPU having only one DMA channel that can be used for general purposes.

情報処理装置がイーサネット(登録商標)を介して、プリンタなどのデバイス装置にデータを転送しようとするとき、イーサネット(登録商標)上でデータを損失しないようにするため、一般にTCP/IPのTCPを用いて情報処理装置とデバイス装置の間で通信する。TCPでは通信データの損失を防ぐためのさまざまな処理を行う。一般にデバイス装置に内蔵されるCPUは高性能足りえないので、デバイス装置内のCPUでTCP処理を行った場合、デバイス装置内のCPUに多大な負荷をかけてしまう。   When an information processing apparatus tries to transfer data to a device device such as a printer via Ethernet (registered trademark), in order to prevent data loss on the Ethernet (registered trademark), TCP / IP TCP is generally used. Communication between the information processing device and the device device. TCP performs various processes to prevent loss of communication data. In general, since a CPU built in a device device is insufficient in performance, when the CPU in the device device performs TCP processing, a large load is applied to the CPU in the device device.

そこで通信装置にCPUやメモリを搭載して、通信装置上のCPUにプロトコル処理を行わせる方法がある。通信装置にCPUやメモリを搭載した場合、プロトコル処理を行わない通常の通信装置に比べて、価格はより高価となる。そこでプロトコル処理可能な通信装置を安価に構成するために、搭載するメモリの容量を少なくしたり、性能の低いCPUを搭載したりする。   Therefore, there is a method in which a CPU and a memory are mounted on the communication device, and the CPU on the communication device performs protocol processing. When a CPU or a memory is mounted on a communication device, the price is more expensive than a normal communication device that does not perform protocol processing. Therefore, in order to construct a communication apparatus capable of protocol processing at low cost, the capacity of the mounted memory is reduced or a CPU with low performance is mounted.

又、別の従来例としては、各チャネルの転送順序に起因する転送エラーを確実に検出して、転送順序に起因する転送エラーをCPUに通知するDMAコントローラ(例えば特許文献1参照)をあげることが出来る。
特開2000−267988号公報
Another conventional example is a DMA controller that reliably detects a transfer error due to the transfer order of each channel and notifies the CPU of the transfer error due to the transfer order (see, for example, Patent Document 1). I can do it.
JP 2000-267988

性能の低い安価なCPUは、利用できる機能が制限されることがあり、例えば汎用に利用できるDMAチャネルが1チャネルしかない、ということがある。DMAチャネルが1つしかないCPUをプロトコル処理可能な通信装置に搭載した場合、通信装置は送信時と受信時にデータをDMA転送するので、1つしかないDMAチャネルを送受信で共用しなければならない。送受信でDMAチャネルを共用するにあたり、受信データをデバイス装置へDMA転送途中にデバイス装置からデータ送信要求があり、DMACをデータ送信用に設定したとき、DMACは誤動作して受信データを損失してしまう。   Inexpensive CPUs with low performance may limit the functions that can be used. For example, there may be only one DMA channel that can be used for general purposes. When a CPU having only one DMA channel is mounted on a communication apparatus capable of protocol processing, the communication apparatus performs DMA transfer of data at the time of transmission and reception, so that only one DMA channel must be shared for transmission and reception. When sharing a DMA channel for transmission / reception, there is a data transmission request from the device device during DMA transfer of received data to the device device, and when the DMAC is set for data transmission, the DMAC malfunctions and the received data is lost. .

そこで本発明では、イーサネット(登録商標)等のネットワークからのパケット受信処理やイーサネット(登録商標)等のネットワークへのパケット送信処理を行うネットワーク(イーサネット(登録商標))コントローラを有し、ネットワークプロトコル処理を行い、ダイレクトメモリアクセスコントローラによりパケットデータを転送する機能を有するCPUと、該CPUが受信パケットおよび送信パケットのパケットデータを格納するメモリと、通信装置を搭載する制御装置上のバスに接続するための処理および該CPUのダイレクトメモリアクセス機能により順次データを制御装置上のバスに転送する機能および該CPUのダイレクトメモリアクセス機能を制御するためのレジスタを有するバスインタフェースとを備えた通信装置において、該CPUはデータを直接転送させることができるダイレクトメモリアクセス機能をネットワークコントローラ用に2チャンネル、汎用に2チャンネル有し、通信装置全体のシステム制限により汎用ダイレクトメモリアクセス機能を1チャネルしか使用できない場合、受信データ転送と送信データ転送で1チャネルの汎用ダイレクトメモリアクセス機能を共用するために、該レジスタに該通信装置を搭載した制御装置からのデータ転送要求を検知してダイレクトメモリアクセス機能の使用に関して排他制御を行う手段を有する通信装置を使用することで、汎用で使用できるDMAチャネルが一つしかない安価なCPUを用いて、一つのDMAチャネルを送信と受信で共用するために、データを一定量受信したとき、または受信データがないときに、デバイス装置からの送信要求を処理することができ、安価なCPUを搭載して、プロトコル処理機能搭載の通信装置を提供することができる。   Therefore, the present invention includes a network (Ethernet (registered trademark)) controller that performs packet reception processing from a network such as Ethernet (registered trademark) and packet transmission processing to a network such as Ethernet (registered trademark), and performs network protocol processing. A CPU having a function of transferring packet data by the direct memory access controller, a memory for storing the packet data of the received packet and the transmitted packet, and a bus on the control device on which the communication device is mounted. And a bus interface having a register for controlling the direct memory access function of the CPU and a function of sequentially transferring data to the bus on the control device by the CPU's direct memory access function The CPU has a direct memory access function capable of transferring data directly for the network controller, two channels for the general purpose, and two channels for the general purpose. Only one channel of the general purpose direct memory access function can be used due to the system limitation of the entire communication device. In this case, in order to share the general-purpose direct memory access function of one channel for the received data transfer and the transmitted data transfer, use of the direct memory access function is detected by detecting the data transfer request from the control device equipped with the communication device in the register. In order to share one DMA channel for transmission and reception using an inexpensive CPU having only one DMA channel that can be used for general purpose, a communication device having means for performing exclusive control with respect to the data is used. When a certain amount of data is received or the received data is The Itoki, can process the transmission request from the device unit, equipped with a low-cost CPU, it is possible to provide a communication device protocol processing featured.

以上説明したように、本発明に係る発明によれば、ネットワークからのパケット受信処理やネットワークへのパケット送信処理を行うネットワークコントローラを有し、ネットワークプロトコル処理を行い、ダイレクトメモリアクセスコントローラによりパケットデータを転送する機能を有するCPUと、該CPUが受信パケットおよび送信パケットのパケットデータを格納するメモリと、通信装置を搭載する制御装置上のバスに接続するための処理および該CPUのダイレクトメモリアクセス機能により順次データを制御装置上のバスに転送する機能および該CPUのダイレクトメモリアクセス機能を制御するためのレジスタを有するバスインタフェースとを備えた通信装置において、該CPUはデータを直接転送させることができるダイレクトメモリアクセス機能をネットワークコントローラ用に2チャンネル、汎用に2チャンネル有し、通信装置全体のシステム制限により汎用ダイレクトメモリアクセス機能を1チャネルしか使用できない場合、受信データ転送と送信データ転送で1チャネルの汎用ダイレクトメモリアクセス機能を共用するために、該レジスタに該通信装置を搭載した制御装置からのデータ転送要求を検知してダイレクトメモリアクセス機能の使用に関して排他制御を行うことで、プロトコル処理機能搭載の安価な通信装置を提供することができる。   As described above, according to the invention of the present invention, it has a network controller that performs packet reception processing from the network and packet transmission processing to the network, performs network protocol processing, and transmits packet data by the direct memory access controller. A CPU having a transfer function, a memory in which the CPU stores packet data of received packets and transmitted packets, a process for connecting to a bus on a control device on which a communication device is mounted, and a direct memory access function of the CPU In a communication device having a function of sequentially transferring data to a bus on a control device and a bus interface having a register for controlling the direct memory access function of the CPU, the CPU can directly transfer data. If the general memory access function has two channels for the network controller and two general-purpose channels, and only one channel of the general-purpose direct memory access function can be used due to the system limitation of the entire communication device, one channel for the reception data transmission and transmission data transfer. In order to share the general-purpose direct memory access function, the data transfer request from the control device equipped with the communication device is detected in the register and exclusive control is performed regarding the use of the direct memory access function. An inexpensive communication device can be provided.

以下、添付図面に従って本発明にかかる実施形態を詳細に説明する。   DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.

図1は本発明の実施の形態に係る通信装置101を含むシステム全体のブロック図を示したものである。101は本発明の通信装置である。通信装置101はデバイス装置102内の制御装置106に接続されており、イーサケーブル103、ネットワーク104を介して情報処理装置105から出力されたパケットを受信する。通信装置101はCPUやメモリを搭載しており、LPRやFTPなどのプロトコルを処理することができる。   FIG. 1 shows a block diagram of an entire system including a communication apparatus 101 according to an embodiment of the present invention. Reference numeral 101 denotes a communication apparatus according to the present invention. The communication apparatus 101 is connected to a control apparatus 106 in the device apparatus 102 and receives a packet output from the information processing apparatus 105 via the Ethernet cable 103 and the network 104. The communication device 101 includes a CPU and a memory, and can process protocols such as LPR and FTP.

図2は本発明の実施の形態にかかる通信装置101および、通信装置101を搭載した制御装置106のブロック図を示したものである。通信装置101はパケットを受信すると、CPU202内部にある受信パケット用メモリにパケットを格納する。そしてCPU202は受信パケットのパケットヘッダを取り除き、パケットデータをメモリ203へ書き込む。パケットデータが制御装置106に転送する必要がある場合、CPU202は、先ず制御装置106に割り込みを上げて受信データがあることを知らせ、次に内蔵のDMACを用いてASIC204を介して制御装置のメモリ205へメモリ203上の受信パケットデータをDMA転送する。受信パケットデータをDMA転送する前に、CPU202内のDMACを受信用に設定する必要がある。受信時はDMA転送元をメモリ203に、DMA転送先を制御装置のメモリ205に、DMA転送サイズをASIC204内のデータ入出力用レジスタ2041で設定される受信データ転送単位302にそれぞれ設定する。受信データ転送単位302は、制御装置106が設定する。設定値は、受信パケットデータ用に確保できるメモリ203上の容量やデバイス装置102のデータ送受信の割合で決定する。例えばデバイス装置102を印刷装置と仮定すると、受信データが圧倒的に多いので、メモリ203に確保できる容量をDMA転送サイズとする。ASIC204は制御装置106上のバスに接続するためのインタフェース、およびDMA転送制御用のレジスタである。ASIC205を安価なものにするため、ASICにはDMAチャネルを搭載しない。次に制御装置106からのデータ送信について説明する。制御装置106は送信データを制御装置のメモリ205に用意し終えたら、ASIC204内のデータ入出力用レジスタ2041にある送信要求ビット301を有効にする。このとき通信装置101は、CPU202内蔵のDMACを用いて受信パケットデータを制御装置のメモリ205へ転送している途中であれば、制御装置のメモリ205にある送信データの転送を直に行わない。受信データ転送単位分受信データを制御装置のメモリ205へ転送し終えたとき、送信要求ビット301が有効であれば、CPU202は内蔵のDMACをデータ送信用に設定し、制御装置のメモリ205の送信データをメモリ203へDMA転送する。送信データをDMA転送する前に、CPU202内蔵のDMACを送信用に設定する必要がある。送信時はDMA転送元を制御装置のメモリ205に、DMA転送先をメモリ203に、DMA転送サイズを送信データサイズにそれぞれ設定する。送信データをDMA転送し終えたら、CPU202は送信要求ビット301をクリアして、制御装置106に対して送信データ転送完了を知らせる割り込みを上げる。CPU202は送信データをメモリ203へDMA転送し終えたら、送信データにパケットヘッダを負荷し、送信パケットをネットワークへ転送する。   FIG. 2 shows a block diagram of the communication apparatus 101 according to the embodiment of the present invention and the control apparatus 106 in which the communication apparatus 101 is mounted. When the communication apparatus 101 receives the packet, the communication apparatus 101 stores the packet in a reception packet memory inside the CPU 202. Then, the CPU 202 removes the packet header of the received packet and writes the packet data to the memory 203. When packet data needs to be transferred to the control device 106, the CPU 202 first raises an interrupt to inform the control device 106 that there is received data, and then uses the built-in DMAC to control the memory of the control device via the ASIC 204. The received packet data on the memory 203 is DMA-transferred to 205. Before DMA transfer of received packet data, it is necessary to set the DMAC in the CPU 202 for reception. At the time of reception, the DMA transfer source is set in the memory 203, the DMA transfer destination is set in the memory 205 of the control device, and the DMA transfer size is set in the received data transfer unit 302 set in the data input / output register 2041 in the ASIC 204. The control unit 106 sets the reception data transfer unit 302. The setting value is determined by the capacity on the memory 203 that can be secured for received packet data and the data transmission / reception ratio of the device apparatus 102. For example, assuming that the device apparatus 102 is a printing apparatus, the amount of received data is overwhelmingly large. Therefore, the capacity that can be secured in the memory 203 is set as the DMA transfer size. The ASIC 204 is an interface for connecting to the bus on the control device 106 and a register for DMA transfer control. In order to make the ASIC 205 inexpensive, the ASIC is not equipped with a DMA channel. Next, data transmission from the control device 106 will be described. When the control device 106 finishes preparing the transmission data in the memory 205 of the control device, the control device 106 validates the transmission request bit 301 in the data input / output register 2041 in the ASIC 204. At this time, the communication device 101 does not directly transfer the transmission data in the memory 205 of the control device if the received packet data is being transferred to the memory 205 of the control device using the DMAC built in the CPU 202. If the transmission request bit 301 is valid when the reception data for the received data transfer unit has been transferred to the memory 205 of the control device, the CPU 202 sets the built-in DMAC for data transmission and transmits the data in the memory 205 of the control device. Data is DMA transferred to the memory 203. Before DMA transmission of transmission data, it is necessary to set the DMAC built in the CPU 202 for transmission. At the time of transmission, the DMA transfer source is set in the memory 205 of the control device, the DMA transfer destination is set in the memory 203, and the DMA transfer size is set as the transmission data size. When the DMA transfer of the transmission data is completed, the CPU 202 clears the transmission request bit 301 and raises an interrupt notifying the controller 106 of the completion of the transmission data transfer. After completing the DMA transfer of the transmission data to the memory 203, the CPU 202 loads a packet header on the transmission data and transfers the transmission packet to the network.

図3はCPU202内蔵のDMAを制御するためのレジスタである。送信要求ビット301は、制御装置106がセットし、通信装置101がクリアするビットである。制御装置106が、送信データを制御装置のメモリ205に準備し終えたら、通信装置101にデータ送信の要求があることを知らせるために送信要求ビット301をセットする。送信要求ビット301がセットされると、通信装置101は制御装置のメモリ205からメモリ203へ送信データをDMA転送し、DMA転送を完了すると送信要求ビット301をクリアする。受信データ転送単位302は制御装置106が設定するフィールドである。通信装置101は、メモリ203から制御装置のメモリ205へDMA転送するとき、転送サイズを受信データ転送単位302に設定された値とし、DMA転送終了毎に送信要求ビット301をチェックする。   FIG. 3 shows a register for controlling the DMA built in the CPU 202. The transmission request bit 301 is a bit that is set by the control device 106 and cleared by the communication device 101. When the control device 106 finishes preparing the transmission data in the memory 205 of the control device, the transmission request bit 301 is set to notify the communication device 101 that there is a data transmission request. When the transmission request bit 301 is set, the communication apparatus 101 performs DMA transfer of transmission data from the memory 205 of the control apparatus to the memory 203, and clears the transmission request bit 301 when the DMA transfer is completed. The received data transfer unit 302 is a field set by the control device 106. When the DMA transfer from the memory 203 to the memory 205 of the control device is performed, the communication device 101 sets the transfer size to the value set in the received data transfer unit 302, and checks the transmission request bit 301 every time DMA transfer ends.

図4は本発明の特徴となる、CPU202内蔵のただひとつのDMAチャネルを送信と受信で共用するためのCPU202側の排他制御処理を示すフローチャートである。CPU202側の排他制御の方法をステップ毎に説明する。   FIG. 4 is a flowchart showing exclusive control processing on the CPU 202 side for sharing a single DMA channel built in the CPU 202 for transmission and reception, which is a feature of the present invention. The exclusive control method on the CPU 202 side will be described step by step.

S401:受信パケットがCPU202に到達したかどうかをチェックする。受信パケットがあればステップS402へ進む。受信パケットがなければステップS405へ進む。   S401: It is checked whether or not the received packet has reached the CPU 202. If there is a received packet, the process proceeds to step S402. If there is no received packet, the process proceeds to step S405.

S402:CPU202に到達した受信パケットのパケットヘッダを取り除き受信パケットのデータをメモリ203へ格納する。   S 402: The packet header of the received packet that has reached the CPU 202 is removed, and the data of the received packet is stored in the memory 203.

S403:受信パケットデータを制御装置のメモリ205へDMA転送するために、CPU202内蔵のDMACをデータ受信用に設定する。DMACへの設定項目は、データ転送方向、転送元アドレス、転送先アドレスおよび転送サイズである。データ転送方向はメモリ203から制御装置のメモリ205への方向である。転送元アドレスはメモリ203のアドレスである。転送先.アドレスは制御装置のメモリ205のアドレスである。転送サイズは、受信データ転送単位302に設定された値である。   S403: In order to DMA transfer the received packet data to the memory 205 of the control device, the DMAC built in the CPU 202 is set for data reception. The setting items for the DMAC are a data transfer direction, a transfer source address, a transfer destination address, and a transfer size. The data transfer direction is the direction from the memory 203 to the memory 205 of the control device. The transfer source address is an address in the memory 203. Forwarding destination. The address is the address of the memory 205 of the control device. The transfer size is a value set in the received data transfer unit 302.

S404:CPU202内蔵のDMACに転送要求して、受信データをメモリ203から制御装置のメモリ205へDMA転送させる。   S404: A transfer request is made to the DMAC built in the CPU 202, and the received data is DMA-transferred from the memory 203 to the memory 205 of the control device.

S405:ASIC204内のレジスタ2041に設定される送信要求ビット301が有効であるかどうかをチェックする。有効であればS406へ進む。有効でなければS401へ進む。   S405: It is checked whether or not the transmission request bit 301 set in the register 2041 in the ASIC 204 is valid. If valid, the process proceeds to S406. If not valid, the process proceeds to S401.

S406:制御装置のメモリ205に格納されている送信データをメモリ203へDMA転送するために、CPU202内蔵のDMACをデータ送信用に設定する。DMACへの設定項目は、データ転送方向、転送元アドレス、転送先アドレスおよび転送サイズである。データ転送方向は制御装置のメモリ205からメモリ203への方向である。転送先アドレスはメモリ203のアドレスである。転送元アドレスは制御装置のメモリ205のアドレスである。転送サイズは、制御装置のメモリ205に格納された送信データサイズである。   S406: In order to DMA transfer the transmission data stored in the memory 205 of the control device to the memory 203, the DMAC built in the CPU 202 is set for data transmission. The setting items for the DMAC are a data transfer direction, a transfer source address, a transfer destination address, and a transfer size. The data transfer direction is the direction from the memory 205 to the memory 203 of the control device. The transfer destination address is an address in the memory 203. The transfer source address is an address in the memory 205 of the control device. The transfer size is a transmission data size stored in the memory 205 of the control device.

S407:CPU202内蔵のDMACに転送要求して、送信データを制御装置のメモリ205からメモリ203へDMA転送させる。   S407: A transfer request is made to the DMAC built in the CPU 202, and the transmission data is DMA-transferred from the memory 205 of the control device to the memory 203.

S408:ASIC204内にあるレジスタ2041の送信要求ビット301をリセットする。   S408: The transmission request bit 301 of the register 2041 in the ASIC 204 is reset.

S409:メモリ203上の送信データにパケットヘッダを付加し、送信パケットをネットワークに出力する。   S409: A packet header is added to the transmission data on the memory 203, and the transmission packet is output to the network.

S410:送信パケットを全て送信し終えたら、制御装置106に対してパケット送信完了割り込みを上げる。   S410: When all transmission packets have been transmitted, a packet transmission completion interrupt is raised to the control device 106.

図5は本発明の特徴となる、デバイス装置側のデータ送信処理を示すフローチャートである。デバイス側の処理方法をステップ毎に説明する。   FIG. 5 is a flowchart showing data transmission processing on the device apparatus side, which is a feature of the present invention. The processing method on the device side will be described step by step.

S501:制御装置106に送信したいデータがあり、全送信データを制御装置のメモリ205へ格納し終えたならステップS502へ進む。全送信データを準備し終えていないならステップS501へ進む。   S501: If there is data to be transmitted to the control device 106 and all the transmission data has been stored in the memory 205 of the control device, the process proceeds to step S502. If all the transmission data has not been prepared, the process proceeds to step S501.

S502:制御装置106は、送信データを格納した制御装置のメモリ205上の先頭アドレスと、送信データサイズを通信装置101に通知する。通知方法は、例えばASIC204内にアドレスとデータサイズを格納するレジスタを用意し、そのレジスタに書き込むことで通信装置101に知らせる、という方法が考えられる。   S502: The control device 106 notifies the communication device 101 of the start address on the memory 205 of the control device storing the transmission data and the transmission data size. As a notification method, for example, a method of preparing a register for storing an address and a data size in the ASIC 204 and informing the communication apparatus 101 by writing to the register can be considered.

S503:デバイス装置が、送信要求ビット301を有効にする。本ビットを有効にすることで、通信装置101は、受信データ転送中であればデータ転送終了後、アイドル状態であればただちに制御装置のメモリ205上の送信データをメモリ203へDMA転送する。   S503: The device apparatus validates the transmission request bit 301. By enabling this bit, the communication apparatus 101 DMA-transfers the transmission data on the memory 205 of the control apparatus to the memory 203 immediately after completion of the data transfer if the received data is being transferred and immediately in the idle state.

S504:制御装置106は、通信装置101からの送信完了割込みが上がるまで待つ。   S504: The control device 106 waits until a transmission completion interrupt from the communication device 101 rises.

実施例1では、制御装置106からのデータ送信要求があった場合、通信装置101上のCPU202は受信データ転送単位ごとに送信要求ビット301をポーリングして送信データがあるかどうかを調べて排他制御する方法を述べた。実施例2では、制御装置106にデータ送信要求があるとき、制御装置106上のCPUが通信装置101上のCPU202に対して割り込みを上げて要求を知らせる方法について述べる。一般にCPUにはプログラマブルI/Oと呼ばれる、プログラムで変更可能なポートがある。制御装置106上のCPUのプログラマブルI/OポートをCPU202の割込みポートに接続することで、割り込みを上げて要求を知らせることが容易に実装できる。   In the first embodiment, when there is a data transmission request from the control device 106, the CPU 202 on the communication device 101 polls the transmission request bit 301 for each received data transfer unit to check whether there is transmission data and performs exclusive control. Said how to do. In the second embodiment, a method in which the CPU on the control device 106 notifies the request by raising an interrupt to the CPU 202 on the communication device 101 when there is a data transmission request in the control device 106 will be described. Generally, a CPU has a port called a programmable I / O that can be changed by a program. By connecting the programmable I / O port of the CPU on the control device 106 to the interrupt port of the CPU 202, it is possible to easily implement an interrupt to notify a request.

図6は本発明の特徴となる、CPU202内蔵のただひとつのDMAチャネルを送信と受信で共用するためのCPU202側の排他制御処理を示すフローチャートである。CPU202側の排他制御の方法をステップ毎に説明する。   FIG. 6 is a flowchart showing exclusive control processing on the CPU 202 side for sharing a single DMA channel built in the CPU 202 for transmission and reception, which is a feature of the present invention. The exclusive control method on the CPU 202 side will be described step by step.

S601:受信パケットがCPU202に到達したかどうかをチェックする。受信パケットがあればステップS602へ進む。受信パケットがなければステップS601へ進む。   S601: It is checked whether the received packet has reached the CPU 202 or not. If there is a received packet, the process proceeds to step S602. If there is no received packet, the process proceeds to step S601.

S602:CPU202に到達した受信パケットのパケットヘッダを取り除き受信パケットのデータをメモリ203へ格納する。   S602: The packet header of the received packet that has reached the CPU 202 is removed, and the received packet data is stored in the memory 203.

S603:受信パケットデータを制御装置のメモリ205へDMA転送するために、CPU202内蔵のDMACをデータ受信用に設定する。DMACへの設定項目は、データ転送方向、転送元アドレス、転送先アドレスおよび転送サイズである。データ転送方向はメモリ203から制御装置のメモリ205への方向である。転送元アドレスはメモリ203のアドレスである。転送先.アドレスは制御装置のメモリ205のアドレスである。転送サイズは、受信データ転送単位302に設定された値である。   S603: In order to DMA transfer the received packet data to the memory 205 of the control device, the DMAC built in the CPU 202 is set for data reception. The setting items for the DMAC are a data transfer direction, a transfer source address, a transfer destination address, and a transfer size. The data transfer direction is the direction from the memory 203 to the memory 205 of the control device. The transfer source address is an address in the memory 203. Forwarding destination. The address is the address of the memory 205 of the control device. The transfer size is a value set in the received data transfer unit 302.

S604:CPU202内蔵のDMACに転送要求して、受信データをメモリ203から制御装置のメモリ205へDMA転送させる。   S604: A transfer request is made to the DMAC built in the CPU 202, and the received data is DMA-transferred from the memory 203 to the memory 205 of the control device.

以下、制御装置106上のCPUから送信要求割込みが上がった場合の処理をステップごとに説明する。   Hereinafter, processing when a transmission request interrupt is raised from the CPU on the control device 106 will be described step by step.

S605:CPU202は、受信パケットデータをメモリ203から制御装置のメモリ205へDMA転送中であるかどうかを調べる。DMA転送中であればS605へ進む。DMA転送中でなければS606へ進む。   S605: The CPU 202 checks whether or not the received packet data is being DMA-transferred from the memory 203 to the memory 205 of the control device. If DMA transfer is in progress, the process advances to step S605. If DMA transfer is not in progress, the process proceeds to S606.

S606:制御装置のメモリ205に格納されている送信データをメモリ203へDMA転送するために、CPU202内蔵のDMACをデータ送信用に設定する。DMACへの設定項目は、データ転送方向、転送元アドレス、転送先アドレスおよび転送サイズである。データ転送方向は制御装置のメモリ205からメモリ203への方向である。転送先アドレスはメモリ203のアドレスである。転送元アドレスは制御装置のメモリ205のアドレスである。転送サイズは、制御装置のメモリ205に格納された送信データサイズである。   S606: In order to DMA transfer the transmission data stored in the memory 205 of the control device to the memory 203, the DMAC built in the CPU 202 is set for data transmission. The setting items for the DMAC are a data transfer direction, a transfer source address, a transfer destination address, and a transfer size. The data transfer direction is the direction from the memory 205 to the memory 203 of the control device. The transfer destination address is an address in the memory 203. The transfer source address is an address in the memory 205 of the control device. The transfer size is a transmission data size stored in the memory 205 of the control device.

S607:CPU202内蔵のDMACに転送要求して、送信データを制御装置のメモリ205からメモリ203へDMA転送させる。   S607: A transfer request is made to the DMAC built in the CPU 202, and the transmission data is DMA-transferred from the memory 205 of the control device to the memory 203.

S608:メモリ203上の送信データにパケットヘッダを付加し、送信パケットをネットワークに出力する。   S608: A packet header is added to the transmission data on the memory 203, and the transmission packet is output to the network.

S609:送信パケットを全て送信し終えたら、制御装置106に対してパケット送信完了割り込みを上げる。   S609: When all transmission packets have been transmitted, a packet transmission completion interrupt is raised to the control device 106.

図7は本発明の特徴となる、制御装置106側のデータ送信処理を示すフローチャートである。制御装置106側の処理方法をステップ毎に説明する。   FIG. 7 is a flowchart showing data transmission processing on the control device 106 side, which is a feature of the present invention. A processing method on the control device 106 side will be described step by step.

S701:制御装置106に送信したいデータがあり、全送信データを制御装置のメモリ205へ格納し終えたならステップS702へ進む。全送信データを準備し終えていないならステップS701へ進む。   S701: If there is data to be transmitted to the control device 106 and all the transmission data has been stored in the memory 205 of the control device, the process proceeds to step S702. If all the transmission data has not been prepared, the process proceeds to step S701.

S702:制御装置106は、送信データを格納した制御装置のメモリ205上の先頭アドレスと、送信データサイズを通信装置101に通知する。通知方法は、例えばASIC204内にアドレスとデータサイズを格納するレジスタを用意し、そのレジスタに書き込むことで通信装置101に知らせる、という方法が考えられる。   S702: The control device 106 notifies the communication device 101 of the start address on the memory 205 of the control device storing the transmission data and the transmission data size. As a notification method, for example, a method of preparing a register for storing an address and a data size in the ASIC 204 and informing the communication apparatus 101 by writing to the register can be considered.

S703:CPU202の割り込みポートに接続された、制御装置 106上のCPUのプログラマぶるI/Oポートをイネーブルにする。CPU202は、受信データDMA転送中であればDMA転送終了後に、DMA転送してなければすぐに送信処理を開始する。   S703: The CPU programmer I / O port connected to the CPU 202 interrupt port is enabled. The CPU 202 starts the transmission process immediately after the DMA transfer ends if the DMA transfer is not being performed if the received data DMA transfer is being performed.

S504:制御装置106は、通信装置101からの送信完了割込みが上がるまで待つ。   S504: The control device 106 waits until a transmission completion interrupt from the communication device 101 rises.

発明に係る通信装置を含むシステム全体の構成図である。It is a block diagram of the whole system containing the communication apparatus which concerns on invention. 発明に係る通信装置と、通信装置を搭載した制御装置のブロック図である。It is a block diagram of the communication apparatus which concerns on invention, and the control apparatus carrying a communication apparatus. 発明の排他制御処理に使用する通信装置内のレジスタのブロック図である。It is a block diagram of the register in the communication apparatus used for the exclusive control process of invention. 発明の特徴となるポーリングを用いた排他制御処理の通信装置側の処理フローである。It is the processing flow by the side of the communication apparatus of the exclusive control process using the polling which is the characteristics of invention. 発明の特徴となるポーリングを用いた排他制御処理の制御装置側の処理フローである。It is the processing flow by the side of the control apparatus of the exclusive control process using the polling which is the characteristics of invention. 発明の特徴となる割込み信号を用いた排他制御処理の通信装置側の処理フローである。It is the processing flow by the side of the communication apparatus of the exclusive control process using the interruption signal used as the characteristic of invention. 発明の特徴となる割込み信号を用いた排他制御処理の制御装置側の処理フローである。It is the processing flow by the side of the control apparatus of the exclusive control process using the interruption signal used as the characteristic of invention.

符号の説明Explanation of symbols

101 通信装置
102 デバイス装置
103 イーサケーブル
104 ネットワーク
105 情報処理装置
106 制御装置
202 CPU
203 メモリ
204 ASIC(バスインタフェース)
2041 データ入出力用レジスタ
205 制御装置のメモリ
301 送信要求ビット
302 受信データ転送単位
DESCRIPTION OF SYMBOLS 101 Communication apparatus 102 Device apparatus 103 Ether cable 104 Network 105 Information processing apparatus 106 Control apparatus 202 CPU
203 Memory 204 ASIC (Bus Interface)
2041 Data input / output register 205 Memory of control device 301 Transmission request bit 302 Received data transfer unit

Claims (3)

ネットワークからのパケット受信処理やネットワークへのパケット送信処理を行うネットワークコントローラを有し、ネットワークプロトコル処理を行い、ダイレクトメモリアクセスコントローラによりパケットデータを転送する機能を有するCPUと、該CPUが受信パケットおよび送信パケットのパケットデータを格納するメモリと、通信装置を搭載する制御装置上のバスに接続するための処理および該CPUのダイレクトメモリアクセス機能により順次データを制御装置上のバスに転送する機能および該CPUのダイレクトメモリアクセス機能を制御するためのレジスタを有するバスインタフェースとを備えた通信装置において、該CPUはデータを直接転送させることができるダイレクトメモリアクセス機能をネットワークコントローラ用に2チャンネル、汎用に2チャンネル有し、通信装置全体のシステム制限により汎用ダイレクトメモリアクセス機能を1チャネルしか使用できない場合、受信データ転送と送信データ転送で1チャネルの汎用ダイレクトメモリアクセス機能を共用するために、該レジスタに該通信装置を搭載した制御装置からのデータ転送要求を検知してダイレクトメモリアクセス機能の使用に関して排他制御を行う手段を有する通信装置。   A CPU having a network controller for performing packet reception processing from the network and packet transmission processing to the network, performing network protocol processing, and transferring packet data by the direct memory access controller, and the CPU receiving and transmitting packets Memory for storing packet data of packets, processing for connecting to a bus on a control device equipped with a communication device, and function for sequentially transferring data to the bus on the control device by the direct memory access function of the CPU, and the CPU And a bus interface having a register for controlling the direct memory access function of the CPU, the CPU has a direct memory access function capable of transferring data directly to the network controller. 2 channels for general use and 2 channels for general use. If only one general purpose direct memory access function can be used due to system limitations of the entire communication device, the general purpose direct memory access function for one channel can be used for receiving data transmission and transmission data transmission. A communication device having means for performing exclusive control regarding use of the direct memory access function by detecting a data transfer request from a control device having the communication device mounted in the register for sharing. 請求項1に記載の通信装置の排他制御手段において、該通信装置を搭載した制御装置がバスインタフェースのダイレクトメモリアクセス制御用レジスタに送信データ転送要求がある旨を書き込み、該通信装置はいくつかの受信データ転送終了毎に該レジスタをチェックし、送信データ転送要求があれば該制御装置のメモリから該通信装置のメモリへダイレクトメモリアクセス機能を用いて全送信データを転送する方法を用いてダイレクトメモリアクセス機能の使用に関して排他制御を行う手段を有する通信装置。   2. The exclusive control means of the communication device according to claim 1, wherein the control device equipped with the communication device writes that there is a transmission data transfer request in the direct memory access control register of the bus interface. The direct memory using a method of checking the register at the end of every transfer of received data and transferring all transmission data from the memory of the control device to the memory of the communication device if there is a transmission data transfer request. A communication apparatus having means for performing exclusive control regarding use of an access function. 請求項1に記載の通信装置の排他制御手段において、該通信装置上のCPUに対して、該通信装置を搭載した制御装置上のCPUが直接割り込み信号を発してデータ転送要求する手段を用いてダイレクトメモリアクセス機能の使用に関して排他制御を行う手段を有する請求項1に記載の通信装置。   2. The exclusive control means of the communication device according to claim 1, wherein the CPU on the control device on which the communication device is mounted directly issues an interrupt signal to the CPU on the communication device to request data transfer. The communication apparatus according to claim 1, further comprising a unit that performs exclusive control regarding use of the direct memory access function.
JP2004320567A 2004-11-04 2004-11-04 Communication device Withdrawn JP2006133965A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004320567A JP2006133965A (en) 2004-11-04 2004-11-04 Communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004320567A JP2006133965A (en) 2004-11-04 2004-11-04 Communication device

Publications (1)

Publication Number Publication Date
JP2006133965A true JP2006133965A (en) 2006-05-25

Family

ID=36727478

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004320567A Withdrawn JP2006133965A (en) 2004-11-04 2004-11-04 Communication device

Country Status (1)

Country Link
JP (1) JP2006133965A (en)

Similar Documents

Publication Publication Date Title
US11182317B2 (en) Dual-driver interface
US6925512B2 (en) Communication between two embedded processors
JP6433146B2 (en) Information processing apparatus, system, information processing method, computer program
KR101207280B1 (en) Image forming apparatus and control method thereof, and interface apparatus
JP6627571B2 (en) Programmable controller, programmable controller control method, and programmable controller control program
JP2003316712A5 (en)
WO2011137648A1 (en) Download method and system based on management data input/output interface
US20060184708A1 (en) Host controller device and method
JP2011040895A (en) Information processing apparatus, control method thereof and program
CN107291641B (en) Direct memory access control device for a computing unit and method for operating the same
CN101814011A (en) Usb host controller and the control method that is used for usb host controller
JP2006133965A (en) Communication device
KR102136184B1 (en) Communication controlling apparatus
JP2004253900A (en) Communication assisting apparatus and communication system employing apparatus
JP4329188B2 (en) Data transfer control device
KR102669925B1 (en) Peripheral component interconnect express interface device and operating method thereof
KR101206961B1 (en) Image forming apparatus and control method thereof, and interface apparatus
TWI486783B (en) Method and system for accessing data
JP7312022B2 (en) Communication device and communication method
EP4283468A1 (en) Data transmission system and related device
JP2006195607A (en) Method and circuit for determining bulk-out transfer end
JP5756738B2 (en) COMMUNICATION SYSTEM, COMMUNICATION DEVICE, AND COMMUNICATION METHOD
CN115437984A (en) High-speed peripheral component interconnection interface device and operation method thereof
JP2658931B2 (en) Printer controller
JP4791341B2 (en) Data transfer system

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080108