Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7363344B2 - Memory control device and control method - Google Patents
[go: Go Back, main page]

JP7363344B2 - Memory control device and control method - Google Patents

Memory control device and control method Download PDF

Info

Publication number
JP7363344B2
JP7363344B2 JP2019188407A JP2019188407A JP7363344B2 JP 7363344 B2 JP7363344 B2 JP 7363344B2 JP 2019188407 A JP2019188407 A JP 2019188407A JP 2019188407 A JP2019188407 A JP 2019188407A JP 7363344 B2 JP7363344 B2 JP 7363344B2
Authority
JP
Japan
Prior art keywords
data
reception
identifier
descriptor
memory
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.)
Active
Application number
JP2019188407A
Other languages
Japanese (ja)
Other versions
JP2021064166A (en
Inventor
俊規 玉井
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.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP2019188407A priority Critical patent/JP7363344B2/en
Publication of JP2021064166A publication Critical patent/JP2021064166A/en
Application granted granted Critical
Publication of JP7363344B2 publication Critical patent/JP7363344B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Bus Control (AREA)
  • Information Transfer Systems (AREA)

Description

本発明はデバイスと通信するメモリ制御装置等に関する。 The present invention relates to a memory control device and the like that communicate with devices.

ソケット通信において、受信データをDMA(Direct Memory Access)方式でメモリに書き込む、NIC(Network Interface Card)等のメモリ制御装置が従来知られている。 2. Description of the Related Art In socket communication, memory control devices such as NICs (Network Interface Cards) that write received data into memory using a DMA (Direct Memory Access) method are conventionally known.

図9は、あるデバイスにおいてDMA機能を有する従来のNICを使用した場合の、受信データのメモリへの書き込みに係る処理を説明するための模式図である。図9で示すように、受信データの書き込みに係る処理は、1~6の番号順に実行される。なお、図9では、表記の簡略化のため、ディスクリプタのことを「Desc」と記載する。 FIG. 9 is a schematic diagram for explaining processing related to writing received data to memory when a conventional NIC having a DMA function is used in a certain device. As shown in FIG. 9, processing related to writing received data is executed in numerical order from 1 to 6. Note that in FIG. 9, the descriptor is written as "Desc" for the sake of simplicity.

まず始めに、デバイスのCPUは、自装置のメモリに対し、受信データのディスクリプタを予め設定しておく(1)。この設定は、ソケット通信を行う前等、データの受信前に行われることが望ましい。メモリにディスクリプタが設定されたことはNICに通知される、NICは通知を受けると、メモリに格納されているディスクリプタを予め読み込んでおく。ディスクリプタが複数存在する場合は、NICは、ディスクリプタを所定の順番で読み込む(2)。 First, the CPU of the device presets a descriptor for received data in its own memory (1). This setting is desirably performed before receiving data, such as before performing socket communication. The NIC is notified that the descriptor has been set in the memory. Upon receiving the notification, the NIC reads the descriptor stored in the memory in advance. If there are multiple descriptors, the NIC reads the descriptors in a predetermined order (2).

NICはデータを受信すると(3)、読み込んでおいたディスクリプタが示すメモリ上のアドレスに、受信データを書き込む(4)。ここで、受信データが書き込まれるアドレスは、CPUがデータ受信に係る処理を行うためにアクセスできる領域である。しかしながら、該アドレスは、CPUが実行するアプリケーションプログラム(以降、アプリと称する)が直接アクセスし、書き込む、および読み出すことはできない領域のアドレスである。NICは、受信データを書き込んだことを、CPUに通知する。 When the NIC receives the data (3), it writes the received data to the address on the memory indicated by the read descriptor (4). Here, the address to which the received data is written is an area that the CPU can access to perform processing related to data reception. However, this address is an address of an area that cannot be directly accessed, written to, or read by an application program (hereinafter referred to as an application) executed by the CPU. The NIC notifies the CPU that the received data has been written.

CPUは受信データが書き込まれた旨の通知を受けると、該受信データを読み出して、解析する(5)。ここでの「解析」とは、例えば、受信データの種別、サイズ、および受信データを使用するアプリケーションの種類の少なくともいずれかを特定するための解析である。CPUは解析が終了すると、該解析結果に応じて、受信データをメモリ上の別のアドレスに再度書き込む(6)。この、再書き込み先のアドレスは、CPUが実行するアプリが直接アクセス可能、すなわちアプリが使用可能な記憶領域内のアドレスである。 When the CPU receives notification that the received data has been written, it reads and analyzes the received data (5). The "analysis" here is, for example, analysis for identifying at least one of the type and size of received data, and the type of application that uses the received data. When the analysis is completed, the CPU writes the received data again to another address on the memory according to the analysis result (6). This rewrite destination address is directly accessible to the application executed by the CPU, that is, it is an address in a storage area that can be used by the application.

以上の処理によって、デバイスのCPUが実行するアプリにおいて、受信データを取り扱うことができる状態になる。 Through the above processing, the application executed by the CPU of the device becomes able to handle the received data.

特開2005-222469号公報Japanese Patent Application Publication No. 2005-222469 特開2009-065564号公報JP2009-065564A

図9に示すように、従来のNICは、受信データを、アプリが直接取り扱えない記憶領域に書き込んでいた。そのため、CPUが、NICの書き込んだ受信データの解析および移動を行う必要があった。これにより、CPUの負荷が増大していた。また、受信データの解析および移動に係る処理が、データ受信の律速要因となっていた。 As shown in FIG. 9, the conventional NIC writes received data to a storage area that cannot be directly handled by an application. Therefore, it was necessary for the CPU to analyze and move the received data written by the NIC. This increased the load on the CPU. Furthermore, processing related to analysis and movement of received data has been a rate-limiting factor in data reception.

これに対し、DMAでのデータ受信をより効率化することによって、データ受信をより高速化させる技術が開発されている。例えば、特許文献1には、受信データのデータサイズに応じて、適用するディスクリプタを変更することで、受信データの格納先アドレスを振り分ける技術が開発されている。しかしながら、データサイズに応じて受信データの格納先アドレスを振り分けただけでは、アプリで受信データを利用するために、さらに受信データを解析および移動する必要が生じる。 In response to this, technology has been developed to speed up data reception by making data reception using DMA more efficient. For example, in Patent Document 1, a technique has been developed that allocates storage addresses of received data by changing an applied descriptor according to the data size of the received data. However, if the storage address of the received data is simply allocated according to the data size, it becomes necessary to further analyze and move the received data in order to use the received data in an application.

本発明の一態様は、前述の問題点について鑑みたものである。本発明の一態様は、データ受信をより高速化させることが可能なメモリ制御装置等を実現することを目的とする。 One aspect of the present invention takes into account the above-mentioned problems. One aspect of the present invention aims to realize a memory control device and the like that can further speed up data reception.

前記の課題を解決するために、本発明の一態様に係るメモリ制御装置は、第1デバイスのメモリにDMA(Direct Memory Access)方式でアクセスしてデータを読み書きするメモリ制御装置であって、前記第1デバイス以外の第2デバイスから、1つの通信プロトコルにて複数のデータを受信するデータ受信部と、前記複数のデータそれぞれに対応する受信ディスクリプタを指定する識別子を取得する識別子取得部と、前記メモリに記憶された複数の受信ディスクリプタから、それぞれの前記識別子に対応する受信ディスクリプタを読み出す読出部と、前記複数のデータのそれぞれを、前記メモリの、前記読出部によって読み出された前記受信ディスクリプタそれぞれにより指定されるアドレスに書き込むデータ書込部と、を備え、前記アドレスは、前記第1デバイスにおいて実行される1つ以上のアプリケーションがアクセス可能な記憶領域を示す。 In order to solve the above problems, a memory control device according to one aspect of the present invention is a memory control device that accesses the memory of a first device using a DMA (Direct Memory Access) method to read and write data, a data reception unit that receives a plurality of data using one communication protocol from a second device other than the first device; an identifier acquisition unit that acquires an identifier specifying a reception descriptor corresponding to each of the plurality of data; a reading unit that reads a reception descriptor corresponding to each of the identifiers from a plurality of reception descriptors stored in a memory; and a reading unit that reads out a reception descriptor corresponding to each of the identifiers from a plurality of reception descriptors stored in a memory; a data writing unit that writes to an address specified by, the address indicating a storage area that can be accessed by one or more applications executed in the first device.

前記の課題を解決するために、本発明の一態様に係る制御方法は、第1デバイスのメモリにDMA(Direct Memory Access)方式でアクセスしてデータを読み書きするメモリ制御装置を制御するための制御方法であって、前記第1デバイス以外の第2デバイスから、1つの通信プロトコルにて複数のデータを受信するデータ受信ステップと、前記複数のデータそれぞれに対応する受信ディスクリプタを指定する識別子を取得する識別子取得ステップと、前記メモリに記憶された複数の受信ディスクリプタから、それぞれの前記識別子に対応する受信ディスクリプタを読み出す読出ステップと、前記複数のデータのそれぞれを、前記メモリの、前記読出ステップにおいて読み出された前記受信ディスクリプタそれぞれにより指定されるアドレスに書き込むデータ書込ステップと、を含み、前記アドレスは、前記第1デバイスにおいて実行される1つ以上のアプリケーションがアクセス可能な記憶領域を示す。 In order to solve the above problems, a control method according to one aspect of the present invention includes a control method for controlling a memory control device that accesses the memory of a first device using a DMA (Direct Memory Access) method to read and write data. The method includes a data receiving step of receiving a plurality of data using one communication protocol from a second device other than the first device, and obtaining an identifier specifying a reception descriptor corresponding to each of the plurality of data. an identifier acquisition step; a reading step of reading a reception descriptor corresponding to each of the identifiers from a plurality of reception descriptors stored in the memory; and a reading step of reading each of the plurality of data from the memory in the reading step. and writing data to an address specified by each of the received descriptors, the address indicating a storage area accessible by one or more applications executed on the first device.

前記の構成または処理によれば、メモリ制御装置は、メモリの、第1デバイスが実行するアプリケーションがアクセス可能な記憶領域に、直接データを書き込む。これにより、第1デバイスは、メモリに書き込まれたデータを移動させなくても、自装置が実行するアプリケーションにおいて該データを使用することができる。これにより、受信したデータの移動が不要になるため、データ受信をより高速に行うことができる。 According to the above configuration or process, the memory control device writes data directly to a storage area of the memory that is accessible to an application executed by the first device. Thereby, the first device can use the data written in the memory in the application executed by the first device without moving the data. This eliminates the need to move received data, so data can be received faster.

前記メモリ制御装置において、前記第1デバイスは複数のアプリケーションを実行し、前記メモリにはアプリケーション毎にアクセス可能な記憶領域が規定されており、前記識別子は、前記データを使用するアプリケーションを規定するアプリケーション情報を含んでおり、前記読出部は、前記アプリケーション情報が規定するアプリケーションがアクセス可能な記憶領域のアドレスを指定する受信ディスクリプタを、前記識別子に対応する受信ディスクリプタとして読み出すこととしてもよい。 In the memory control device, the first device executes a plurality of applications, a storage area is defined in the memory that can be accessed for each application, and the identifier is an application that defines an application that uses the data. The reading unit may read a reception descriptor that specifies an address of a storage area accessible by an application defined by the application information as a reception descriptor corresponding to the identifier.

前記の構成によれば、受信したデータがどのアプリケーションで使用されるデータであるかを識別子に基づき特定し、該データを使用するアプリケーションがアクセス可能な記憶領域内のアドレスを指定する受信ディスクリプタを読み出す。これにより、データを、該データを使用するアプリケーションがアクセス可能な記憶領域に直接書き込むことができる。したがって、受信したデータの移動が不要になるため、データ受信をより高速に行うことができる。 According to the above configuration, it is determined based on the identifier which application uses the received data, and the reception descriptor that specifies the address in the storage area that is accessible by the application that uses the data is read. . This allows data to be written directly to a storage area that is accessible to applications that use the data. Therefore, since there is no need to move the received data, data can be received faster.

前記メモリ制御装置において、前記メモリには、1つの識別子に対応する複数の受信ディスクリプタが記憶されていてもよく、前記複数の受信ディスクリプタは、前記1つの識別子のアプリケーション情報が示すアプリケーションがアクセス可能な記憶領域内の、それぞれ異なるアドレスを指定してもよく、前記読出部は、前記1つの識別子に対応する前記複数の受信ディスクリプタを、所定の順番で読み出してもよい。 In the memory control device, the memory may store a plurality of reception descriptors corresponding to one identifier, and the plurality of reception descriptors are accessible by an application indicated by application information of the one identifier. Different addresses within the storage area may be specified, and the reading unit may read out the plurality of reception descriptors corresponding to the one identifier in a predetermined order.

前記の構成によれば、データ書込部によるデータの書き込み処理が遅れて、データ受信部が次に書き込むべきデータを受信してしまった場合でも、各データを別の受信ディスクリプタが示す、別のアドレスに書き込むよう指定することができる。したがって、データの書き込み処理が遅れた場合でも、誤ってデータを上書きしてしまうことを防止できる。 According to the above configuration, even if the data writing process by the data writing unit is delayed and the data receiving unit receives the data to be written next, each data is transferred to another data indicated by a different reception descriptor. You can specify to write to an address. Therefore, even if the data writing process is delayed, it is possible to prevent data from being erroneously overwritten.

前記メモリ制御装置において、前記識別子取得部は、前記データ受信部が受信した前記データに含まれている前記識別子を取得してもよい。 In the memory control device, the identifier acquisition unit may acquire the identifier included in the data received by the data reception unit.

前記の構成によれば、データと識別子とを同時に受信することができる。これにより、受信したデータの移動が不要になるため、データ受信をより高速に行うことができる。 According to the above configuration, data and an identifier can be received at the same time. This eliminates the need to move received data, so data can be received faster.

前記メモリ制御装置において、前記識別子は、該識別子に対応する前記データを示す情報を含んでおり、前記識別子取得部は、前記識別子を前記データと別個に取得してもよい。 In the memory control device, the identifier may include information indicating the data corresponding to the identifier, and the identifier acquisition unit may acquire the identifier separately from the data.

前記の構成によれば、識別子を含んだデータ形式に変更せずとも、データと識別子とを個別に送信することで、前述のメモリ制御装置と同様の効果を得ることができる。 According to the above configuration, the same effect as the above-described memory control device can be obtained by transmitting the data and the identifier separately without changing the data format to include the identifier.

前記メモリ制御装置は、前記第2デバイスの第2メモリに記憶された送信ディスクリプタを読み出す第2読出部を備えていてもよく、前記データ受信部は、前記第2メモリの、前記第2読出部によって読み出された前記送信ディスクリプタによって指定されるアドレスから読み出されたデータを前記データとして取得し、前記識別子は、前記第2デバイスから前記第1デバイスにデータを送信する際の、前記送信ディスクリプタに応じて規定されていてもよい。 The memory control device may include a second reading unit that reads the transmission descriptor stored in the second memory of the second device, and the data receiving unit reads the second reading unit of the second memory. The data read from the address specified by the transmission descriptor read by is acquired as the data, and the identifier is the transmission descriptor when transmitting data from the second device to the first device. may be specified according to the

前記の構成によれば、データを送信する側の第2デバイスにおける送信ディスクリプタから識別子が規定される。すなわち、データ送信の際に必要な送信ディスクリプタから識別子を規定するため、識別子の規定のために別途情報を取得せずとも、適切に識別子を規定することができる。 According to the above configuration, the identifier is defined from the transmission descriptor in the second device that transmits data. That is, since the identifier is defined from the transmission descriptor required for data transmission, the identifier can be appropriately defined without acquiring additional information for defining the identifier.

本発明の一態様によれば、データ受信をより高速化させることができる。 According to one aspect of the present invention, data reception can be made faster.

本実施形態に係る第1デバイスに含まれる各部の、動作概要を示す図である。FIG. 3 is a diagram illustrating an outline of the operation of each unit included in the first device according to the present embodiment. 前記第1デバイスの要部構成の一例を示すブロック図である。FIG. 2 is a block diagram showing an example of a main part configuration of the first device. 前記第1デバイスのディスクリプタ制御部が実行するライトバック処理を、模式的に示したものである。This is a diagram schematically showing write-back processing executed by the descriptor control unit of the first device. 本実施形態に係るNICの処理の流れの一例を示すフローチャートである。3 is a flowchart illustrating an example of the flow of processing of the NIC according to the present embodiment. 受信ディスクリプタと、受信データ領域との対応関係について模式的に示した図である。FIG. 3 is a diagram schematically showing the correspondence between reception descriptors and reception data areas. 受信ディスクリプタの使用方法を模式的に示した図である。FIG. 3 is a diagram schematically showing how to use a reception descriptor. 本実施形態に係るメモリ管理システムの要部構成の一例を示すブロック図である。1 is a block diagram illustrating an example of a main configuration of a memory management system according to an embodiment. FIG. 本実施形態に係るFPGAの送信処理部と受信処理部の間のデータの流れを示すシーケンス図である。FIG. 2 is a sequence diagram showing the flow of data between a transmission processing section and a reception processing section of the FPGA according to the present embodiment. 従来のNICを使用した場合の、受信データのメモリへの書き込みに係る処理を説明する模式図である。FIG. 3 is a schematic diagram illustrating processing related to writing received data to memory when a conventional NIC is used.

以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。ただし、以下で説明する本実施形態は、あらゆる点において本発明の例示に過ぎない。本発明の範囲を逸脱することなく種々の改良や変形を行うことができることは言うまでもない。 DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment (hereinafter also referred to as "this embodiment") according to one aspect of the present invention will be described below based on the drawings. However, this embodiment described below is merely an illustration of the present invention in all respects. It goes without saying that various improvements and modifications can be made without departing from the scope of the invention.

〔実施形態1〕
§1.適用例
図1は、本実施形態に係る第1デバイス100に含まれる各部の、動作概要を示す図である。第1第1デバイス100は図示の通り、NIC(Network Interface Card)1と、メモリ2と、CPU3とを含む。なお、図1ではディスクリプタ(記述子)のことを「Desc」と記載する。以降の図においても、「Desc」はディスクリプタを意味することとする。
[Embodiment 1]
§1. Application Example FIG. 1 is a diagram showing an outline of the operation of each part included in the first device 100 according to the present embodiment. As illustrated, the first device 100 includes a NIC (Network Interface Card) 1, a memory 2, and a CPU 3. Note that in FIG. 1, the descriptor is written as "Desc". In the subsequent figures as well, "Desc" means a descriptor.

NIC(メモリ制御装置)1は、第1デバイス100における通信インタフェースである。NIC1は、他のデバイス(第2デバイス)から受信したデータをDMA(Direct Memory Access)方式でメモリ2に書き込む機能を有する。 The NIC (memory control device) 1 is a communication interface in the first device 100. The NIC 1 has a function of writing data received from another device (second device) into the memory 2 using a DMA (Direct Memory Access) method.

メモリ2は、第1デバイス100における記憶装置である。メモリ2の記憶領域はNIC1によって書き換えられる。また、メモリ2の記憶領域は、CPU3によって書き換えられる。詳細は後述するが、メモリ2は、受信ディスクリプタを記憶する記憶領域と、データを記憶する記憶領域とに分かれている。 The memory 2 is a storage device in the first device 100. The storage area of memory 2 is rewritten by NIC1. Further, the storage area of the memory 2 is rewritten by the CPU 3. Although details will be described later, the memory 2 is divided into a storage area for storing reception descriptors and a storage area for storing data.

ここで、「受信ディスクリプタ」とは、メモリ2に受信データを書き込む際に用いるディスクリプタである。受信ディスクリプタは、NIC1が受信したデータの、メモリ2上での格納先アドレスを示す情報である。以降、受信ディスクリプタを記憶する記憶領域を「ディスクリプタ領域」、データを記憶する記憶領域を「データ領域」と称する。 Here, the "reception descriptor" is a descriptor used when writing received data into the memory 2. The reception descriptor is information indicating the storage address on the memory 2 of the data received by the NIC 1. Hereinafter, the storage area for storing reception descriptors will be referred to as a "descriptor area", and the storage area for storing data will be referred to as a "data area".

CPU3は、第1デバイス100における演算装置および制御装置である。CPU3は、メモリ2に書き込まれたデータを読み出して処理する。また、CPU3は、メモリ2または他の記憶装置に記憶されたアプリケーション(アプリ)プログラムを読み出して実行する。これにより、第1デバイスにおいてアプリが動作する。CPU3は、受信するデータの書き込みの際に用いる受信ディスクリプタを規定し、該受信ディスクリプタをメモリ2のディスクリプタ領域に書き込む。CPU3は、複数のアプリに対応して複数の受信ディスクリプタをメモリ2に設定する。CPU3は、各受信ディスクリプタがいずれのアプリに対応するかを示す情報をNIC1に予め通知する。本実施形態に係る受信ディスクリプタは、第1デバイス100のCPU3において実行される、少なくとも1つのアプリがアクセス可能な記憶領域内のアドレスを示す。 The CPU 3 is a calculation device and a control device in the first device 100. The CPU 3 reads and processes the data written in the memory 2. Further, the CPU 3 reads and executes an application (app) program stored in the memory 2 or other storage device. As a result, the application operates on the first device. The CPU 3 defines a reception descriptor to be used when writing received data, and writes the reception descriptor into the descriptor area of the memory 2. The CPU 3 sets a plurality of reception descriptors in the memory 2 corresponding to the plurality of applications. The CPU 3 notifies the NIC 1 in advance of information indicating which application each reception descriptor corresponds to. The reception descriptor according to this embodiment indicates an address in a storage area that is accessible to at least one application executed by the CPU 3 of the first device 100.

図1に示すように、本実施形態に係る第1デバイス100において、受信データの書き込みに係る処理は、1~5の番号順に実行される。まず始めに、デバイスのCPUは、自装置のメモリに対し、受信ディスクリプタを予め設定しておく(1)。受信ディスクリプタの設定方法は特に限定されない。 As shown in FIG. 1, in the first device 100 according to the present embodiment, processes related to writing received data are executed in numerical order from 1 to 5. First, the CPU of the device presets a reception descriptor in its own memory (1). The method of setting the reception descriptor is not particularly limited.

本実施形態に係る第1デバイス100では、NIC1は、受信ディスクリプタが設定された時点ではなく、データを受信してから受信ディスクリプタを読み込む。具体的には、NICはデータを受信すると(2)、受信データに含まれている識別子を取得する。ここで、「識別子」とは、アプリに対応しており、受信データに対応する受信ディスクリプタを指定する情報である。識別子の具体的構成は特に限定されない。例えば、識別子は、受信データが第1デバイスに送信されて来た際の通信プロトコルを示す情報を含んでいてもよい。また例えば、識別子は、受信データを使用するアプリを規定するアプリケーション情報を含んでいてもよい。それゆえ、アプリケーション情報は、受信ディスクリプタに対応しているともいえる。なお、CPU3は、各受信ディスクリプタがいずれの識別子に対応するかを示す情報をNIC1に予め通知してもよい。
NIC1は識別子に応じて、メモリ2から読み込む受信ディスクリプタを選定する(3)。NIC1は、選定した受信ディスクリプタを、メモリ2から読み込む(4)。
In the first device 100 according to the present embodiment, the NIC 1 reads the reception descriptor after receiving data, not at the time when the reception descriptor is set. Specifically, when the NIC receives the data (2), it acquires the identifier included in the received data. Here, the "identifier" corresponds to an application and is information that specifies a reception descriptor corresponding to received data. The specific structure of the identifier is not particularly limited. For example, the identifier may include information indicating the communication protocol under which the received data was sent to the first device. Also, for example, the identifier may include application information that defines an application that uses the received data. Therefore, it can be said that the application information corresponds to the reception descriptor. Note that the CPU 3 may notify the NIC 1 in advance of information indicating which identifier each reception descriptor corresponds to.
The NIC 1 selects a reception descriptor to read from the memory 2 according to the identifier (3). The NIC 1 reads the selected reception descriptor from the memory 2 (4).

受信ディスクリプタを読み込んだNIC1は、該受信ディスクリプタが指定するアドレスに受信データを格納する(5)。前述のように、受信ディスクリプタは、CPU3において実行されるアプリがアクセス可能なアドレスを示している。したがって、第1デバイス100においてCPU3は、メモリ2に書き込まれたデータを移動させなくても、アプリにおいて受信データを使用することができる。これにより、受信データの移動が不要になるため、データ受信をより高速に行うことができるという効果を奏する。 The NIC 1 that has read the reception descriptor stores the reception data at the address specified by the reception descriptor (5). As described above, the reception descriptor indicates an address that can be accessed by an application executed on the CPU 3. Therefore, in the first device 100, the CPU 3 can use the received data in the application without moving the data written to the memory 2. This eliminates the need to move received data, resulting in the effect that data reception can be performed faster.

§2.構成例
図2は、本実施形態に係る第1デバイス100の要部構成の一例を示すブロック図である。第1デバイス100は、NIC1と、メモリ2と、CPU3とを含む。NIC1と、メモリ2と、CPU3とはそれぞれバスで接続されている。なお、バスには前述の装置以外に、入力装置、表示装置、ROM(Read Only Memory)、および音声出力装置等が接続されていてもよい。
§2. Configuration Example FIG. 2 is a block diagram showing an example of the main configuration of the first device 100 according to the present embodiment. The first device 100 includes a NIC 1, a memory 2, and a CPU 3. The NIC 1, the memory 2, and the CPU 3 are each connected by a bus. Note that in addition to the above-mentioned devices, an input device, a display device, a ROM (Read Only Memory), an audio output device, and the like may be connected to the bus.

第1デバイス100は、他のデバイスと、Ethernet(登録商標)等、ソケット通信を行う回線で接続している。なお、第1デバイス100は複数の他のデバイスと接続していてもよい。 The first device 100 is connected to other devices through a line for socket communication, such as Ethernet (registered trademark). Note that the first device 100 may be connected to a plurality of other devices.

(CPU3)
CPU3は、前述の通り、第1デバイス100における演算装置および制御装置であり、第1デバイス100を統括的に制御する。CPU3は、各種アプリを動作させる。CPU3は、第1デバイス100におけるデータ通信を行う前に、予め受信ディスクリプタを作成(規定)し、作成した受信ディスクリプタをメモリ2のディスクリプタ領域21に書き込んでおく。
(CPU3)
As described above, the CPU 3 is a calculation device and a control device in the first device 100, and controls the first device 100 in an integrated manner. The CPU 3 operates various applications. Before performing data communication in the first device 100, the CPU 3 creates (defines) a reception descriptor in advance and writes the created reception descriptor into the descriptor area 21 of the memory 2.

(メモリ2)
メモリ2は、各種データを記憶する記憶装置である。メモリ2は、ディスクリプタ領域21と、ライトバック領域22と、受信データ領域23との3つの記憶領域に分かれている。なお、本実施形態においてライトバック領域22は必須ではない。
(Memory 2)
The memory 2 is a storage device that stores various data. The memory 2 is divided into three storage areas: a descriptor area 21, a write-back area 22, and a received data area 23. Note that the write-back area 22 is not essential in this embodiment.

ディスクリプタ領域21は、受信ディスクリプタを格納するための記憶領域である。受信ディスクリプタは、CPU3によって設定される。ライトバック領域22は、受信ディスクリプタをライトバックするための記憶領域である。受信ディスクリプタのライトバックについては後述する。受信データ領域23は、受信データを格納するための記憶領域である。図2に示すように、受信データ領域23は、識別子毎に分割されていてもよい。例えば、受信データ領域23は、識別子が示す受信ディスクリプタに応じて分割されていてもよい。 The descriptor area 21 is a storage area for storing reception descriptors. The reception descriptor is set by the CPU 3. The write-back area 22 is a storage area for writing back the reception descriptor. Write-back of the receive descriptor will be described later. The received data area 23 is a storage area for storing received data. As shown in FIG. 2, the received data area 23 may be divided for each identifier. For example, the reception data area 23 may be divided according to the reception descriptor indicated by the identifier.

(NIC1)
NIC1は、他のデバイスから受信したデータを、メモリ2にDMA転送するための装置である。NIC1は、受信データ格納バッファ18と、受信データ処理部11とを含む。
(NIC1)
The NIC 1 is a device for DMA transfer of data received from another device to the memory 2. The NIC 1 includes a received data storage buffer 18 and a received data processing section 11.

受信データ格納バッファ18は、NIC1が他のデバイスから受信したデータを一時的に格納するバッファである。受信データ処理部11は、メモリ2における、受信データの適切な格納先アドレスを特定し、該アドレスに受信データをDMA転送する。 The received data storage buffer 18 is a buffer that temporarily stores data that the NIC 1 receives from other devices. The received data processing unit 11 identifies an appropriate storage address of the received data in the memory 2, and performs DMA transfer of the received data to the address.

受信データ処理部11は、データ受信部17と、アドレス計算部(識別子取得部)16と、ディスクリプタ制御部(読出部)14と、DMA制御部12と、受信データ制御部(データ書込部)13と、ディスクリプタ格納バッファ15と、を含む。 The received data processing section 11 includes a data receiving section 17, an address calculation section (identifier acquisition section) 16, a descriptor control section (reading section) 14, a DMA control section 12, and a received data control section (data writing section). 13 and a descriptor storage buffer 15.

データ受信部17は、他のデバイス(第2デバイス)からデータを受信し、該データを受信データ格納バッファ18に格納する。データ受信部17は、複数の通信プロトコルに対応していてもよい。例えば、データ受信部17は、サイクリック通信により送信されたデータ(サイクリックデータ)を受信してもよい。また、データ受信部17は、TCP-IP等の通信プロトコルによって送信されたデータを受信してもよい。データ受信部17は、受信したデータの通信プロトコルを受信データ制御部13に通知してもよい。 The data receiving unit 17 receives data from another device (second device) and stores the data in the received data storage buffer 18. The data receiving unit 17 may be compatible with multiple communication protocols. For example, the data receiving unit 17 may receive data (cyclic data) transmitted by cyclic communication. Further, the data receiving unit 17 may receive data transmitted using a communication protocol such as TCP-IP. The data receiving unit 17 may notify the received data control unit 13 of the communication protocol of the received data.

本実施形態では、特段の記載が無い限り、データ受信部17は、サイクリックデータを受信することとする。データ受信部17は、1つの通信プロトコル(例えばサイクリック通信のプロトコル)で、複数のデータを受信する。 In this embodiment, unless otherwise specified, the data receiving unit 17 receives cyclic data. The data receiving unit 17 receives a plurality of data using one communication protocol (for example, a cyclic communication protocol).

アドレス計算部16は、複数の受信データそれぞれに対応する識別子を取得する。本実施形態では、アドレス計算部16は、受信データ格納バッファに格納された受信データから、該データに含まれている識別子を抽出して取得する。 The address calculation unit 16 acquires an identifier corresponding to each of the plurality of received data. In this embodiment, the address calculation unit 16 extracts and obtains an identifier included in the received data stored in the received data storage buffer.

アドレス計算部16は、取得した識別子を解析することにより、各識別子に対応している受信ディスクリプタの、メモリ2における格納先アドレスを算出する。例えば、識別子がアプリ情報を含む場合、アドレス計算部16は、アプリ情報が規定するアプリがアクセス可能な記憶領域のアドレスを指定している受信ディスクリプタを選出してもよい。そして、アドレス計算部16は、該受信ディスクリプタのいずれかのアドレスを、識別子に対応する受信ディスクリプタのアドレスとして特定してもよい。アドレス計算部16は、受信ディスクリプタの格納先アドレスを、ディスクリプタ制御部14に出力する。 The address calculation unit 16 calculates the storage address in the memory 2 of the reception descriptor corresponding to each identifier by analyzing the obtained identifiers. For example, when the identifier includes application information, the address calculation unit 16 may select a reception descriptor that specifies the address of a storage area that can be accessed by the application specified by the application information. Then, the address calculation unit 16 may specify any address of the reception descriptor as the address of the reception descriptor corresponding to the identifier. The address calculation unit 16 outputs the storage address of the received descriptor to the descriptor control unit 14.

ディスクリプタ制御部14は、受信ディスクリプタの格納先アドレスが入力されると、該アドレスから受信ディスクリプタを読み出すよう、DMA制御部12に指示する。また、ディスクリプタ制御部14は、ディスクリプタ格納バッファ15に格納された受信ディスクリプタを読み出し、該受信ディスクリプタによって指定される、メモリ2上の格納先アドレスを特定する。ディスクリプタ制御部14は、特定した格納先アドレスを受信データ制御部13に出力する。 When the descriptor control unit 14 receives the storage address of the reception descriptor, it instructs the DMA control unit 12 to read the reception descriptor from the address. Further, the descriptor control unit 14 reads out the reception descriptor stored in the descriptor storage buffer 15 and specifies the storage destination address on the memory 2 specified by the reception descriptor. The descriptor control unit 14 outputs the specified storage address to the received data control unit 13.

DMA制御部12は、NIC1においてメモリ2にアクセスするインタフェースである。DMA制御部12は、受信データ処理部11の各部からの要求に応じてメモリ2にアクセスし、データの格納および取得を行う。 The DMA control unit 12 is an interface that accesses the memory 2 in the NIC 1. The DMA control section 12 accesses the memory 2 in response to requests from each section of the received data processing section 11 to store and acquire data.

受信データ制御部13は、メモリ2の、ディスクリプタ制御部14が読み出した受信ディスクリプタが指定する格納先アドレスに、受信データを格納する。具体的には、受信データ制御部13に、受信ディスクリプタが指定する格納先アドレスが入力されると、受信データ制御部13は、受信データ格納バッファ18から受信データを読み出す。受信データ制御部13は、読み出した受信データを、DMA制御部12を介してメモリ2の指定されたアドレスに格納(書き込み)する。 The received data control unit 13 stores the received data in the storage address of the memory 2 designated by the received descriptor read by the descriptor control unit 14 . Specifically, when the storage address specified by the reception descriptor is input to the reception data control unit 13, the reception data control unit 13 reads the reception data from the reception data storage buffer 18. The received data control unit 13 stores (writes) the read received data to a specified address in the memory 2 via the DMA control unit 12.

ディスクリプタ格納バッファ15は、DMA制御部12を介してNIC1が受信した受信ディスクリプタを一時的に格納しておくバッファである。ディスクリプタ格納バッファ15に格納された受信ディスクリプタは、ディスクリプタ制御部14によって読み出される。 The descriptor storage buffer 15 is a buffer that temporarily stores the reception descriptor received by the NIC 1 via the DMA control unit 12. The reception descriptor stored in the descriptor storage buffer 15 is read out by the descriptor control unit 14.

(ライトバック処理)
ディスクリプタ制御部14は、受信ディスクリプタのライトバック処理を実行してもよい。以降、受信ディスクリプタのライトバックのことを、単に「ライトバック」とも称する。本実施形態における「ライトバック」とは、受信ディスクリプタに情報を付加(すなわち、受信ディスクリプタを上書き)して、メモリ2のライトバック領域22に書き込むことを意味する。ここで言う「情報」とは、例えば、その受信ディスクリプタが指定するアドレスに書き込みした受信データのサイズ、および、受信データの書き込み完了を示す終了判定フラグ、の少なくとも一方を示す。
(Write back processing)
The descriptor control unit 14 may perform write-back processing of the received descriptor. Hereinafter, write-back of the reception descriptor will also be simply referred to as "write-back.""Writeback" in this embodiment means adding information to the reception descriptor (that is, overwriting the reception descriptor) and writing it into the write back area 22 of the memory 2. The "information" here indicates, for example, at least one of the size of the received data written to the address specified by the receive descriptor, and an end determination flag indicating completion of writing of the received data.

図3は、ディスクリプタ制御部14が実行するライトバック処理を模式的に示したものである。図中の矢印は、受信ディスクリプタと、該受信ディスクリプタを上書きしたディスクリプタ(上書済ディスクリプタ)との対応関係を示している。図示のように、受信ディスクリプタと、上書済ディスクリプタとは1対1に対応している。受信データ制御部13は、受信データの書込みが終了すると、書込み終了の旨をディスクリプタ制御部14に通知する。ディスクリプタ制御部14は、該通知を受けると、ライトバックを実行する。すなわち、ディスクリプタ制御部14は、使用した受信ディスクリプタを上書きし、ライトバック領域22の、該受信ディスクリプタに対応するアドレスに、上書済受信ディスクリプタを書き込む。 FIG. 3 schematically shows the write-back process executed by the descriptor control unit 14. The arrows in the figure indicate the correspondence between a reception descriptor and a descriptor that has overwritten the reception descriptor (an overwritten descriptor). As shown in the figure, there is a one-to-one correspondence between the reception descriptor and the overwritten descriptor. When the reception data control section 13 finishes writing the reception data, it notifies the descriptor control section 14 of the completion of the writing. Upon receiving the notification, the descriptor control unit 14 executes writeback. That is, the descriptor control unit 14 overwrites the used reception descriptor and writes the overwritten reception descriptor to the address corresponding to the reception descriptor in the write-back area 22.

ディスクリプタ領域21に格納されている受信ディスクリプタは、データ受信の度に順次使用される。したがって、ディスクリプタ領域21に格納されている受信ディスクリプタ自体に終了判定フラグ等を付加して上書きしてしまうと、該受信ディスクリプタの再利用が困難になる。前述のようにライトバック領域22を設け、該領域に上書きした受信ディスクリプタを書き込むことによって、ディスクリプタ領域21に格納されている受信ディスクリプタの再利用を可能にすることができる。また、これにより、データ受信の終了判定フラグ、および受信データのサイズの記録等を、残すことができる。 The reception descriptors stored in the descriptor area 21 are sequentially used each time data is received. Therefore, if the reception descriptor itself stored in the descriptor area 21 is overwritten by adding an end determination flag or the like, it becomes difficult to reuse the reception descriptor. By providing the write-back area 22 as described above and writing an overwritten reception descriptor into the write-back area 22, it is possible to reuse the reception descriptor stored in the descriptor area 21. Furthermore, this allows the data reception end determination flag and the record of the size of the received data to be left behind.

§3.処理の流れ
図4は、本実施形態に係るNIC1の処理の流れの一例を示すフローチャートである。NIC1のデータ受信部17は、他のデバイスから送信されたデータを受信する(S10)。データ受信部17は、受信データを受信データ格納バッファ18に格納する(S12)。受信データが格納されると、アドレス計算部16は、該受信データから識別子を取得して、解析する(S14)。例えば、アドレス計算部16は、識別子から、受信データの種別、および、受信データを使用するアプリを特定する。受信データの種別がサイクリックデータでない場合(S16でYES)、受信データ処理部11は、S18以降の処理を行わず、通常の受信処理を行う(S28)。通常の受信処理とは、例えば、DMA方式ではなく、通常のようにCPU3を経由してメモリ2にデータを書き込む処理であってよい。
§3. Flow of Processing FIG. 4 is a flowchart showing an example of the flow of processing of the NIC 1 according to the present embodiment. The data receiving unit 17 of the NIC 1 receives data transmitted from another device (S10). The data receiving unit 17 stores the received data in the received data storage buffer 18 (S12). When the received data is stored, the address calculation unit 16 acquires an identifier from the received data and analyzes it (S14). For example, the address calculation unit 16 identifies the type of received data and the application that uses the received data from the identifier. If the type of received data is not cyclic data (YES in S16), the received data processing unit 11 performs normal reception processing without performing the processing from S18 onwards (S28). The normal reception process may be, for example, a process of writing data into the memory 2 via the CPU 3 as usual, instead of using the DMA method.

一方、受信データの種別がサイクリックデータである場合(S16でYES)アドレス計算部16は、識別子からアドレスを算出する(S18)。アドレス計算部16は、算出したアドレスをディスクリプタ制御部14に出力する。ディスクリプタ制御部14は、アドレス計算部16から入力されたアドレスに割り当てられている受信ディスクリプタを、DMA制御部12を介して読み込み、ディスクリプタ格納バッファ15に格納させる(S20)。ディスクリプタ制御部14は、ディスクリプタ格納バッファ15に格納した受信ディスクリプタを読み出し、該受信ディスクリプタが示すメモリ2上のアドレス、すなわち、受信データの書き込み先のアドレスを特定する。ディスクリプタ制御部14は特定したアドレスを受信データ制御部13に出力する。 On the other hand, if the type of received data is cyclic data (YES in S16), the address calculation unit 16 calculates an address from the identifier (S18). The address calculation unit 16 outputs the calculated address to the descriptor control unit 14. The descriptor control unit 14 reads the reception descriptor assigned to the address input from the address calculation unit 16 via the DMA control unit 12, and stores it in the descriptor storage buffer 15 (S20). The descriptor control unit 14 reads the reception descriptor stored in the descriptor storage buffer 15, and specifies the address on the memory 2 indicated by the reception descriptor, that is, the address to which the reception data is to be written. The descriptor control unit 14 outputs the specified address to the received data control unit 13.

受信データ制御部13は、受信データを、メモリ2の、受信ディスクリプタが示すアドレスに書き込む(S22)。受信データ制御部13は、受信データの書込みが終了した旨をディスクリプタ制御部14に通知する。 The reception data control unit 13 writes the reception data to the address indicated by the reception descriptor in the memory 2 (S22). The received data control unit 13 notifies the descriptor control unit 14 that writing of the received data has been completed.

ディスクリプタ制御部14は、該通知を受けると、ライトバックを実行する。すなわち、ディスクリプタ制御部14は、メモリ2のライトバック領域22に、上書きした受信ディスクリプタを書き込む(S24)。 Upon receiving the notification, the descriptor control unit 14 executes writeback. That is, the descriptor control unit 14 writes the overwritten reception descriptor to the write-back area 22 of the memory 2 (S24).

以上の処理が終了すると、受信データ処理部11は、データの受信処理の完了をCPU3に通知する(S26)。 When the above processing is completed, the received data processing unit 11 notifies the CPU 3 of the completion of the data reception processing (S26).

なお、図4において、S16の判定処理、およびS28の処理は必須ではない。すなわち、S14の処理の後、S16の判定処理を経ずにS18の処理を実行してもよい。また、図4において、S24に示したライトバックに関する処理も必須ではない。 Note that in FIG. 4, the determination process of S16 and the process of S28 are not essential. That is, after the process of S14, the process of S18 may be executed without going through the determination process of S16. Further, in FIG. 4, the write-back process shown in S24 is not essential.

§4.受信ディスクリプタの使用管理
メモリ2のディスクリプタ領域21には、1つの識別子に対応する複数の受信ディスクリプタが記憶されていてもよい。また、複数の受信ディスクリプタは、1つの識別子のアプリ情報が示すアプリがアクセス可能な記憶領域内の、それぞれ異なるアドレスを指定していてもよい。そして、ディスクリプタ制御部14は、複数の受信ディスクリプタを所定の順番で読み出してもよい。なお、アプリと識別子とは、1対1に対応していてもよいし、1対多で対応していてもよい。すなわち、1つのアプリに対し割り当てられる識別子は1つであってもよいし、複数であってもよい。
§4. Usage Management of Reception Descriptors The descriptor area 21 of the memory 2 may store a plurality of reception descriptors corresponding to one identifier. Furthermore, the plurality of reception descriptors may specify different addresses within a storage area that can be accessed by the application indicated by the application information of one identifier. Then, the descriptor control unit 14 may read out the plurality of reception descriptors in a predetermined order. Note that an application and an identifier may have a one-to-one correspondence or a one-to-many correspondence. That is, one or more identifiers may be assigned to one application.

図5は、1つの識別子に対し複数の受信ディスクリプタが設定されている場合の、受信ディスクリプタと、受信データ領域23との対応関係について模式的に示した図である。なお、図5では、ディスクリプタ領域21と受信データ領域23とをそれぞれ別個に表記しているが、図2等に示す通り、この2領域は同じメモリ2内の記憶領域であってよい。 FIG. 5 is a diagram schematically showing the correspondence between the reception descriptor and the reception data area 23 when a plurality of reception descriptors are set for one identifier. Although the descriptor area 21 and the received data area 23 are shown separately in FIG. 5, these two areas may be storage areas in the same memory 2 as shown in FIG. 2 and the like.

なお、図5において、ディスクリプタ領域21内のディスクリプタはそれぞれハイフンで繋がれた2つの数字の組合せで識別される。図5の例では、ハイフンの左側の数字は識別子の識別番号を、右側の数字は受信ディスクリプタの識別番号をそれぞれ示している。つまり、図5の例では、識別番号「0」の識別子に対応する受信ディスクリプタとして、識別番号「0」、「1」、「2」、および「3」の計4つの受信ディスクリプタが設定されている。また、識別番号「1」の識別子に対応する受信ディスクリプタとして、識別番号「0」の受信ディスクリプタが設定されている。なお、図5では識別番号「0」の識別子と、識別番号「1」の識別子とは異なるアプリに対応する識別子であることとする。 In FIG. 5, each descriptor in the descriptor area 21 is identified by a combination of two numbers connected by a hyphen. In the example of FIG. 5, the number to the left of the hyphen indicates the identification number of the identifier, and the number to the right of the hyphen indicates the identification number of the reception descriptor. In other words, in the example of FIG. 5, a total of four reception descriptors with identification numbers "0", "1", "2", and "3" are set as reception descriptors corresponding to the identifier with identification number "0". There is. Furthermore, a reception descriptor with identification number "0" is set as a reception descriptor corresponding to the identifier with identification number "1". In FIG. 5, it is assumed that the identifier with the identification number "0" and the identifier with the identification number "1" correspond to different applications.

図5において、受信データ領域23内の「TAG0」および「TAG1」の数字はそれぞれ、前述のアプリの識別番号に対応している。また、「Buf0」~「Buf3」の数字はそれぞれ、前述の受信ディスクリプタの識別番号に対応している。 In FIG. 5, the numbers "TAG0" and "TAG1" in the received data area 23 each correspond to the aforementioned application identification number. Further, the numbers "Buf0" to "Buf3" each correspond to the identification number of the aforementioned reception descriptor.

図5に示す通り、同じ識別子に対応する受信ディスクリプタが複数ある場合、ディスクリプタ制御部14は、所定の順番で受信ディスクリプタを読み出し、読み出した受信ディスクリプタに対応するアドレスに、順次受信データを格納する(「TAG0:Buf0」~「TAG0:Buf3」)。一方、前述の通り、メモリ2においてアプリが使用可能な記憶領域は、該アプリ毎に異なっている。したがって、異なるアプリに対応する識別子を取得した場合、ディスクリプタ制御部14は、メモリ2上の異なる記憶領域にデータを格納する(「TAG1:Buf0」)。 As shown in FIG. 5, when there are multiple receive descriptors corresponding to the same identifier, the descriptor control unit 14 reads the receive descriptors in a predetermined order and sequentially stores the received data in the addresses corresponding to the read receive descriptors ( "TAG0:Buf0" to "TAG0:Buf3"). On the other hand, as described above, the storage area in the memory 2 that can be used by an application differs depending on the application. Therefore, when acquiring an identifier corresponding to a different application, the descriptor control unit 14 stores the data in a different storage area on the memory 2 ("TAG1:Buf0").

図6は、NIC1のディスクリプタ制御部14における、使用する受信ディスクリプタの管理方法を模式的に示した図である。ディスクリプタ制御部14は例えば、図6に示すように、各識別子に対応する複数の受信ディスクリプタのうち、次に使用する受信ディスクリプタを、使用フラグを用いて管理してもよい。 FIG. 6 is a diagram schematically showing a method of managing the reception descriptors to be used in the descriptor control unit 14 of the NIC 1. For example, as shown in FIG. 6, the descriptor control unit 14 may manage the reception descriptor to be used next among the plurality of reception descriptors corresponding to each identifier using a usage flag.

図6のディスクリプタ領域21には、計4つの受信ディスクリプタが設定されている。各受信ディスクリプタの識別番号は、図5に示した識別番号と同様の意味を持つ。つまり、図6の例では、識別番号「0」および「1」の識別子について、それぞれ対応する受信ディスクリプタがそれぞれ2つずつ設定されていることとする。 A total of four reception descriptors are set in the descriptor area 21 of FIG. 6. The identification number of each reception descriptor has the same meaning as the identification number shown in FIG. That is, in the example of FIG. 6, it is assumed that two corresponding reception descriptors are set for each of the identifiers with identification numbers "0" and "1".

図6に示すNIC1の「使用カウント」における欄内の数値は、各識別子(識別番号「0」および「1」の識別子)に対応する受信ディスクリプタのうち、次回のデータ受信の際に使用する受信ディスクリプタを示す数値である。図6に示す使用カウントの初期値は0であり、対応する受信ディスクリプタが使用される毎に1ずつカウントが増加する。また、カウントが設定されている受信ディスクリプタの数に達する場合、カウントは0に戻されることとする。 The numerical value in the "Usage count" column for NIC1 shown in FIG. A numerical value indicating a descriptor. The initial value of the usage count shown in FIG. 6 is 0, and the count increases by 1 each time the corresponding reception descriptor is used. Furthermore, when the count reaches the set number of receive descriptors, the count is reset to 0.

例えば、NIC1が識別番号「0」の識別子を含むデータを最初に受信した場合、使用カウントは0である。よって、ディスクリプタ制御部14は、識別番号「0」の識別子に対応する、識別番号「0」の受信ディスクリプタを使用する。ディスクリプタ制御部14は、受信ディスクリプタを読み出した後、識別番号「0」の識別子の使用カウントを1増加させる。 For example, when NIC1 first receives data including an identifier with identification number "0", the usage count is 0. Therefore, the descriptor control unit 14 uses the reception descriptor with the identification number "0" that corresponds to the identifier with the identification number "0". After reading the received descriptor, the descriptor control unit 14 increments the use count of the identifier with the identification number "0" by one.

次に、NIC1が識別番号「1」の識別子を含むデータを受信した場合、対応する使用カウントは0である。したがって、ディスクリプタ制御部14は、識別番号「1」の識別子に対応する、識別番号「0」の受信ディスクリプタを使用する。ディスクリプタ制御部14は、受信ディスクリプタを読み出した後、識別番号「1」の識別子の使用カウントを0に戻す。 Next, when NIC1 receives data including an identifier with identification number "1", the corresponding usage count is zero. Therefore, the descriptor control unit 14 uses the reception descriptor with the identification number "0" that corresponds to the identifier with the identification number "1". After reading the received descriptor, the descriptor control unit 14 returns the use count of the identifier with the identification number "1" to zero.

さらに、NIC1が識別番号「1」の識別子を含むデータを受信した場合、対応する使用カウントは1である。したがって、ディスクリプタ制御部14は、識別番号「1」の識別子に対応する、識別番号「1」の受信ディスクリプタを使用する。ディスクリプタ制御部14は、受信ディスクリプタを読み出した後、識別番号「1」の識別子の使用カウントを0に戻す。 Further, when the NIC 1 receives data including an identifier with an identification number "1", the corresponding usage count is one. Therefore, the descriptor control unit 14 uses the reception descriptor with the identification number "1" that corresponds to the identifier with the identification number "1". After reading the received descriptor, the descriptor control unit 14 returns the use count of the identifier with the identification number "1" to zero.

このように、使用カウントを用いることで、複数の受信ディスクリプタを順番で使用することができる。したがって、受信データの書き込み処理が遅れて、データ受信部17が次に書き込むべきデータをすでに受信してしまった場合でも、各データを別の受信ディスクリプタが示す、別のアドレスに書き込むよう指定することができる。したがって、データの書き込み処理が遅れた場合でも、誤ってデータを上書きしてしまうことを防止できる。 In this way, by using the usage count, multiple receive descriptors can be used in sequence. Therefore, even if the writing process of received data is delayed and the data receiving unit 17 has already received the data to be written next, each data can be specified to be written to a different address indicated by a different receive descriptor. I can do it. Therefore, even if the data writing process is delayed, it is possible to prevent data from being erroneously overwritten.

〔実施形態2〕
本発明の他の実施形態について、以下に説明する。なお、説明の便宜上、前記実施形態にて説明した部材と同じ機能を有する部材については、同じ符号を付記し、その説明を繰り返さない。
[Embodiment 2]
Other embodiments of the invention will be described below. For convenience of explanation, members having the same functions as those described in the embodiments above will be denoted by the same reference numerals, and the description thereof will not be repeated.

§1.構成例
図7は、本実施形態に係るメモリ管理システム500の要部構成の一例を示すブロック図である。メモリ管理システム500は、FPGA(Field-Programmable gate array)4と、送信側CPU7と、受信側CPU8と、送信側メモリ(第2メモリ)5と、受信側メモリ6と、を含む。
§1. Configuration Example FIG. 7 is a block diagram showing an example of the main configuration of the memory management system 500 according to the present embodiment. The memory management system 500 includes an FPGA (Field-Programmable Gate Array) 4, a transmitting CPU 7, a receiving CPU 8, a transmitting memory (second memory) 5, and a receiving memory 6.

(FPGA4)
FPGA4と、送信側CPU7と、送信側メモリ5はバスで接続されている。また、FPGA4と、受信側CPU8と、受信側メモリ6とは、バスで接続されている。バスの規格は特に限定しないが、例えばPCIe(Peripheral Component Interconnect Express)の規格に準拠したバスを採用することができる。それぞれのバスには、入力装置、表示装置、ROM、および音声出力装置等が接続されていてもよい。
(FPGA4)
The FPGA 4, the sending side CPU 7, and the sending side memory 5 are connected by a bus. Further, the FPGA 4, the receiving side CPU 8, and the receiving side memory 6 are connected by a bus. Although the standard of the bus is not particularly limited, for example, a bus compliant with the PCIe (Peripheral Component Interconnect Express) standard can be adopted. An input device, display device, ROM, audio output device, etc. may be connected to each bus.

FPGA4は、送信処理部41と受信処理部42とを含んでいる。送信処理部41は送信側メモリ5にDMA方式でアクセスする。また、受信処理部42は受信側メモリ6にDMA方式でアクセスする。本実施形態では、メモリ管理システム500のFPGA4の受信処理部42と、受信側CPU8と、受信側メモリ6とで、第1デバイスが実現される。また、本実施形態では、FPGA4の送信処理部41と、送信側CPU7と、送信側メモリ5とで、第2デバイスが実現される。第2デバイスは、第1デバイスにデータを送信する他のデバイスの一種である。 The FPGA 4 includes a transmission processing section 41 and a reception processing section 42. The transmission processing unit 41 accesses the transmission side memory 5 using the DMA method. Further, the reception processing unit 42 accesses the reception side memory 6 using a DMA method. In this embodiment, the first device is realized by the reception processing unit 42 of the FPGA 4 of the memory management system 500, the reception side CPU 8, and the reception side memory 6. Further, in this embodiment, the second device is realized by the transmission processing section 41 of the FPGA 4, the transmission side CPU 7, and the transmission side memory 5. The second device is a type of other device that sends data to the first device.

すなわち、FPGA4は、第1デバイスと第2デバイスとのデータの送受信を仲介する装置である。具体的には、FPGA4の送信処理部41は、第2デバイスにおける送信側メモリ5からのデータ読出しと、データ送信処理と、を制御する。また、FPGA4の受信処理部42は、第1デバイスにおけるデータ受信処理と、第1デバイスにおける受信側メモリ6へのデータ書き込みと、を制御する。送信処理部41と受信処理部42の詳細な構成は後述する。 That is, the FPGA 4 is a device that mediates data transmission and reception between the first device and the second device. Specifically, the transmission processing unit 41 of the FPGA 4 controls data reading from the transmission side memory 5 and data transmission processing in the second device. Further, the reception processing unit 42 of the FPGA 4 controls data reception processing in the first device and data writing to the reception side memory 6 in the first device. The detailed configuration of the transmission processing section 41 and the reception processing section 42 will be described later.

(受信側CPU8および受信側メモリ6)
受信側CPU8は、実施形態1に示すCPU3と同様の構成を有する。受信側メモリ6は、実施形態1に示すメモリ2と同様の構成を有する。
(Receiving side CPU 8 and receiving side memory 6)
The receiving side CPU 8 has the same configuration as the CPU 3 shown in the first embodiment. The receiving side memory 6 has the same configuration as the memory 2 shown in the first embodiment.

(送信側CPU7および送信側メモリ5)
送信側CPU7は、第2デバイスを統括的に制御する。送信側CPU7は、第2デバイスにおける各種アプリを動作させる。送信側CPU7は、第2デバイスにおけるデータ通信を行う前に、予め送信ディスクリプタを作成(規定)し、作成した送信ディスクリプタを送信側メモリ5の送信ディスクリプタ領域51に書き込んでおく。ここで、「送信ディスクリプタ」とは、送信処理部41が送信するデータの、送信側メモリ5での格納先アドレスを示す情報である。
(Sending side CPU 7 and sending side memory 5)
The transmitting side CPU 7 centrally controls the second device. The sending CPU 7 operates various applications in the second device. The sending CPU 7 creates (defines) a sending descriptor in advance and writes the created sending descriptor in the sending descriptor area 51 of the sending side memory 5 before performing data communication with the second device. Here, the "transmission descriptor" is information indicating the storage address in the transmission side memory 5 of the data transmitted by the transmission processing unit 41.

送信側メモリ5は、各種データを記憶する記憶装置である。送信側メモリ5は、送信ディスクリプタ領域51と、送信データ領域52との2つの記憶領域に分かれている。送信ディスクリプタ領域51は、送信ディスクリプタを格納するための記憶領域である。送信データ領域52は、送信データを格納するための記憶領域である。なお、送信側メモリ5は、送信ディスクリプタのライトバック処理に用いるライトバック領域を有していてもよい。 The transmitting side memory 5 is a storage device that stores various data. The sending side memory 5 is divided into two storage areas: a sending descriptor area 51 and a sending data area 52. The transmission descriptor area 51 is a storage area for storing transmission descriptors. The transmission data area 52 is a storage area for storing transmission data. Note that the transmitting side memory 5 may have a write-back area used for write-back processing of the transmit descriptor.

(送信処理部41)
送信処理部41は、第2デバイスから第1デバイスへのデータの送信を制御する。送信処理部41は、DMA制御部411と、送信ディスクリプタ格納バッファ412と、送信ディスクリプタ制御部(第2読出部)413と、送信データ制御部414と、送信データ格納バッファ415とを含む。
(Transmission processing unit 41)
The transmission processing unit 41 controls data transmission from the second device to the first device. The transmission processing section 41 includes a DMA control section 411 , a transmission descriptor storage buffer 412 , a transmission descriptor control section (second reading section) 413 , a transmission data control section 414 , and a transmission data storage buffer 415 .

DMA制御部411は、送信処理部41の各部からの要求に応じて、送信側メモリ5にアクセスし、データの格納および取得を行う。 The DMA control section 411 accesses the transmission side memory 5 in response to requests from each section of the transmission processing section 41 to store and acquire data.

送信ディスクリプタ格納バッファ412は、送信ディスクリプタを一時的に格納しておくバッファである。送信ディスクリプタ格納バッファ412に格納された送信ディスクリプタは、送信ディスクリプタ制御部413によって読み出される。 The transmission descriptor storage buffer 412 is a buffer that temporarily stores transmission descriptors. The transmission descriptor stored in the transmission descriptor storage buffer 412 is read out by the transmission descriptor control unit 413.

送信ディスクリプタ制御部413は、送信ディスクリプタを読み出して送信ディスクリプタ格納バッファ412に格納するよう、DMA制御部12に指示する。また、送信ディスクリプタ制御部413は、送信ディスクリプタ格納バッファ412に格納された送信ディスクリプタを読み出し、該送信ディスクリプタによって指定される、送信側メモリ5上の格納先アドレスを特定する。また、送信ディスクリプタ制御部413は、送信ディスクリプタから、送信データの識別子(すなわち、受信処理部42にとっての受信データの識別子)を生成する。送信ディスクリプタからの識別子の生成方法は特に限定されない。例えば、送信ディスクリプタ制御部413は、送信ディスクリプタに含まれる一部の情報を識別子としてもよい。また、送信ディスクリプタ制御部413は、送信ディスクリプタから、送信データの種類を示す情報、送信データを使用するアプリを特定する情報等を特定して、該情報を識別子としてもよい。送信ディスクリプタ制御部413は、特定した送信データの格納先アドレスと、識別子とを送信データ制御部414に出力する。 The transmission descriptor control unit 413 instructs the DMA control unit 12 to read the transmission descriptor and store it in the transmission descriptor storage buffer 412. Further, the transmission descriptor control unit 413 reads the transmission descriptor stored in the transmission descriptor storage buffer 412, and specifies the storage destination address on the transmission side memory 5 specified by the transmission descriptor. Furthermore, the transmission descriptor control unit 413 generates an identifier of the transmission data (that is, an identifier of the reception data for the reception processing unit 42) from the transmission descriptor. The method of generating an identifier from a transmission descriptor is not particularly limited. For example, the transmission descriptor control unit 413 may use part of the information included in the transmission descriptor as an identifier. Further, the transmission descriptor control unit 413 may specify information indicating the type of transmission data, information specifying an application that uses the transmission data, etc. from the transmission descriptor, and use the information as an identifier. The transmission descriptor control unit 413 outputs the specified storage address of the transmission data and the identifier to the transmission data control unit 414.

送信データ制御部414は、送信ディスクリプタが指定する格納先アドレスから送信データを読み出す。読み出した送信データは、一時的に送信データ格納バッファ415に格納してもよい。送信データ格納バッファ415は、送信データを一時的に格納するバッファである。送信データ制御部414は、読み出した送信データと、識別子とを対応付ける。送信データ制御部414は、送信データを受信処理部42の受信データ制御部425に、識別子をアドレス計算部423に出力する。 The transmission data control unit 414 reads the transmission data from the storage address specified by the transmission descriptor. The read transmission data may be temporarily stored in the transmission data storage buffer 415. The transmission data storage buffer 415 is a buffer that temporarily stores transmission data. The transmission data control unit 414 associates the read transmission data with an identifier. The transmission data control unit 414 outputs the transmission data to the reception data control unit 425 of the reception processing unit 42 and outputs the identifier to the address calculation unit 423.

(受信処理部42)
受信処理部42は、第1デバイスが受信したデータのメモリへの格納を制御する。受信処理部42は、DMA制御部421と、ディスクリプタ格納バッファ422と、ディスクリプタ制御部424と、アドレス計算部423と、受信データ制御部425と、を含む。
(Reception processing unit 42)
The reception processing unit 42 controls the storage of data received by the first device into the memory. The reception processing section 42 includes a DMA control section 421, a descriptor storage buffer 422, a descriptor control section 424, an address calculation section 423, and a reception data control section 425.

DMA制御部421は、実施形態1に係るDMA制御部12と同様の処理を実行する。ディスクリプタ格納バッファ422は、実施形態1に係るディスクリプタ格納バッファ422と同様の処理を実行する。ディスクリプタ制御部424は、実施形態1に係るディスクリプタ制御部14と同様の処理を実行する。 The DMA control unit 421 executes the same processing as the DMA control unit 12 according to the first embodiment. The descriptor storage buffer 422 performs the same processing as the descriptor storage buffer 422 according to the first embodiment. The descriptor control unit 424 executes the same processing as the descriptor control unit 14 according to the first embodiment.

アドレス計算部423は、受信処理部42が受信したデータ(受信データ)の識別子を、送信データ制御部414から。データとは別個に受信する。それ以外アドレス計算部423の処理は、実施形態1に係るアドレス計算部16と同様である。 The address calculation unit 423 receives the identifier of the data (received data) received by the reception processing unit 42 from the transmission data control unit 414. Receive separately from data. Other than that, the processing of the address calculation unit 423 is the same as that of the address calculation unit 16 according to the first embodiment.

受信データ制御部425は、実施形態1に係るデータ受信部17の機能と、受信データ制御部13の両方の機能を有する。具体的には、受信データ制御部425は、送信処理部41の送信データ制御部414から出力されたデータを受信する。 The received data control unit 425 has the functions of both the data receiving unit 17 and the received data control unit 13 according to the first embodiment. Specifically, the reception data control unit 425 receives data output from the transmission data control unit 414 of the transmission processing unit 41.

なお、受信処理部42には、実施形態1と同様に受信データ格納バッファが含まれていてもよい。受信データ格納バッファが在る場合、受信データ制御部425は、受信データ格納バッファに受信データを一時的に格納する。受信データ格納バッファが無い場合、受信データ制御部425は、受信データを自己で一時記憶する。受信データ制御部425はまた、メモリ2の、ディスクリプタ制御部424が読み出した受信ディスクリプタが指定する格納先アドレスに、受信データを格納する。 Note that the reception processing unit 42 may include a reception data storage buffer as in the first embodiment. If there is a received data storage buffer, the received data control unit 425 temporarily stores the received data in the received data storage buffer. If there is no received data storage buffer, the received data control unit 425 temporarily stores the received data by itself. The reception data control unit 425 also stores the reception data in the storage address specified by the reception descriptor read by the descriptor control unit 424 in the memory 2 .

§2.処理の流れ
図8は、本実施形態に係るFPGA4の送信処理部41と受信処理部42の間のデータの流れを示すシーケンス図である。なお、図8のS70~S82に示す処理は、図4のS16~S28に示した処理と同様であるため、繰り返し説明しない。
§2. Flow of Processing FIG. 8 is a sequence diagram showing the flow of data between the transmission processing section 41 and the reception processing section 42 of the FPGA 4 according to this embodiment. Note that the processes shown in S70 to S82 in FIG. 8 are similar to the processes shown in S16 to S28 in FIG. 4, and therefore will not be repeatedly described.

FPGA4の送信処理部41は、送信側CPUからデータの送信要求を受けるまで待機する(S50でNO)。データの送信要求を受けると(S50でYES)、送信ディスクリプタ制御部413は、DMA制御部411を介して、データ送信の実行回数分の送信ディスクリプタを読み込む(S52)。読み込んだ送信ディスクリプタは、一時的に送信ディスクリプタ格納バッファ412に格納してもよい。 The transmission processing unit 41 of the FPGA 4 waits until it receives a data transmission request from the transmission side CPU (NO in S50). When receiving a data transmission request (YES in S50), the transmission descriptor control unit 413 reads transmission descriptors corresponding to the number of data transmission executions via the DMA control unit 411 (S52). The read transmission descriptor may be temporarily stored in the transmission descriptor storage buffer 412.

送信ディスクリプタ制御部413は、読み出した送信ディスクリプタによって指定される、送信側メモリ5上の送信データの格納先アドレスを特定する。送信データ制御部414は、送信ディスクリプタが指定する格納先アドレスから送信データを読み込む(S54)。送信データ制御部414が読み込んだ送信データは、一時的に送信データ格納バッファ415に格納されてもよい。 The transmission descriptor control unit 413 identifies the storage destination address of the transmission data on the transmission side memory 5 specified by the read transmission descriptor. The transmission data control unit 414 reads the transmission data from the storage address specified by the transmission descriptor (S54). The transmission data read by the transmission data control unit 414 may be temporarily stored in the transmission data storage buffer 415.

送信ディスクリプタ制御部413はまた、送信ディスクリプタに応じて、送信データに対応する識別子を生成する。送信データ制御部414は、送信ディスクリプタ制御部413から識別子を受信し、該識別子を送信データと対応付けてから、受信処理部42のアドレス計算部423に送信する(S56)。 The transmission descriptor control unit 413 also generates an identifier corresponding to the transmission data according to the transmission descriptor. The transmission data control unit 414 receives the identifier from the transmission descriptor control unit 413, associates the identifier with the transmission data, and then transmits it to the address calculation unit 423 of the reception processing unit 42 (S56).

受信処理部42のアドレス計算部423はデータの識別子を受信すると(S58)、該識別子を解析することにより、(S60)、該データの受信ディスクリプタの、受信側メモリ6における格納先アドレスを特定する。 When the address calculation unit 423 of the reception processing unit 42 receives the data identifier (S58), it specifies the storage address in the reception side memory 6 of the reception descriptor of the data by analyzing the identifier (S60). .

一方、送信処理部41の送信データ制御部414は、識別子の送信とともに、または識別子の送信と前後して、受信処理部42の受信データ制御部425に対し、データを送信する(S62)。受信データ制御部425は該データを受信データとして受信する(S64)。 On the other hand, the transmission data control unit 414 of the transmission processing unit 41 transmits data to the reception data control unit 425 of the reception processing unit 42 at the same time as transmitting the identifier, or before or after transmitting the identifier (S62). The reception data control unit 425 receives the data as reception data (S64).

送信処理部41は、S62までの処理が終了すると、未実行の送信ディスクリプタがあるか否かを判定する(S66)。すなわち、送信処理部41は、S50において受けた送信要求のうち、まだ実行していないデータ送信があるか否かを判定する。未実行の送信ディスクリプタがある場合(S66でYES)、送信処理部41は、未実行の送信ディスクリプタとそれに対応する送信データについて、S54以降の処理を繰り返す。一方、未実行の送信ディスクリプタがない場合(S66でNO)、送信処理部41は、送信要求を受けての送信処理が終了したことを送信側CPU7に通知する(S68)。 After completing the processing up to S62, the transmission processing unit 41 determines whether or not there is an unexecuted transmission descriptor (S66). That is, the transmission processing unit 41 determines whether there is any data transmission that has not yet been executed among the transmission requests received in S50. If there is an unexecuted transmission descriptor (YES in S66), the transmission processing unit 41 repeats the processing from S54 onward for the unexecuted transmission descriptor and its corresponding transmission data. On the other hand, if there is no unexecuted transmission descriptor (NO in S66), the transmission processing unit 41 notifies the transmission side CPU 7 that the transmission processing in response to the transmission request has been completed (S68).

なお、図8において、S60の処理とS64の処理とは順不同で行われてよい。また、図8において、S70の判定処理、およびS82の処理は必須ではない。すなわち、S58~S64までの処理の後、S70の判定処理を経ずにS72の処理を実行してもよい。また、図8において、S78に示したライトバックに関する処理も必須ではない。 Note that in FIG. 8, the process of S60 and the process of S64 may be performed in random order. Further, in FIG. 8, the determination process of S70 and the process of S82 are not essential. That is, after the processing from S58 to S64, the processing at S72 may be executed without going through the determination processing at S70. Further, in FIG. 8, the write-back process shown in S78 is not essential.

〔ソフトウェアによる実現例〕
NIC1およびFPGA4の制御ブロックは、集積回路(ICチップ)等に形成された論理回路(ハードウェア)によって実現してもよいし、ソフトウェアによって実現してもよい。
[Example of implementation using software]
The control blocks of the NIC 1 and the FPGA 4 may be realized by a logic circuit (hardware) formed on an integrated circuit (IC chip) or the like, or may be realized by software.

後者の場合、NIC1およびFPGA4は、各機能を実現するソフトウェアであるプログラムの命令を実行するコンピュータを備えている。このコンピュータは、例えば1つ以上のプロセッサを備えていると共に、前記プログラムを記憶したコンピュータ読み取り可能な記録媒体を備えている。そして、前記コンピュータにおいて、前記プロセッサが前記プログラムを前記記録媒体から読み取って実行することにより、本発明の目的が達成される。前記プロセッサとしては、例えばCPU(Central Processing Unit)を用いることができる。前記記録媒体としては、「一時的でない有形の媒体」、例えば、ROM(Read Only Memory)等の他、テープ、ディスク、カード、半導体メモリ、プログラマブルな論理回路などを用いることができる。また、前記プログラムを展開するRAM(Random Access Memory)などをさらに備えていてもよい。また、前記プログラムは、該プログラムを伝送可能な任意の伝送媒体(通信ネットワークや放送波等)を介して前記コンピュータに供給されてもよい。なお、本発明の一態様は、前記プログラムが電子的な伝送によって具現化された、搬送波に埋め込まれたデータ信号の形態でも実現され得る。 In the latter case, the NIC 1 and FPGA 4 are equipped with a computer that executes instructions of a program that is software that implements each function. This computer includes, for example, one or more processors and a computer-readable recording medium storing the program. Then, in the computer, the processor reads the program from the recording medium and executes it, thereby achieving the object of the present invention. As the processor, for example, a CPU (Central Processing Unit) can be used. As the recording medium, in addition to "non-temporary tangible media" such as ROM (Read Only Memory), tapes, disks, cards, semiconductor memories, programmable logic circuits, etc. can be used. Further, the computer may further include a RAM (Random Access Memory) for expanding the program. Furthermore, the program may be supplied to the computer via any transmission medium (communication network, broadcast waves, etc.) that can transmit the program. Note that one aspect of the present invention can also be realized in the form of a data signal embedded in a carrier wave, in which the program is embodied by electronic transmission.

本発明は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。 The present invention is not limited to the embodiments described above, and various modifications can be made within the scope of the claims, and embodiments obtained by appropriately combining technical means disclosed in different embodiments. are also included within the technical scope of the present invention.

1 NIC(メモリ制御装置)
2 メモリ
5 送信側メモリ(第2メモリ)
6 受信側メモリ(メモリ)
3 CPU
4 FPGA(メモリ制御装置)
7 送信側CPU
8 受信側CPU
11 受信データ処理部
12、411、421 DMA制御部
13、425 受信データ制御部(データ書込部)
14、424 ディスクリプタ制御部(読出部)
15、422 ディスクリプタ格納バッファ
16、423 アドレス計算部(識別子取得部)
17 データ受信部
18 受信データ格納バッファ
21 ディスクリプタ領域
22 ライトバック領域
23 受信データ領域
41 送信処理部
42 受信処理部
51 送信ディスクリプタ領域
52 送信データ領域
100 第1デバイス
412 送信ディスクリプタ格納バッファ
413 送信ディスクリプタ制御部(第2読出部)
414 送信データ制御部
415 送信データ格納バッファ
500 メモリ管理システム
1 NIC (memory control device)
2 Memory 5 Sending side memory (second memory)
6 Receiving side memory (memory)
3 CPUs
4 FPGA (memory control device)
7 Sending side CPU
8 Receiving side CPU
11 Received data processing unit 12, 411, 421 DMA control unit 13, 425 Received data control unit (data writing unit)
14, 424 Descriptor control section (reading section)
15, 422 Descriptor storage buffer 16, 423 Address calculation unit (identifier acquisition unit)
17 Data receiving unit 18 Received data storage buffer 21 Descriptor area 22 Write back area 23 Reception data area 41 Transmission processing unit 42 Reception processing unit 51 Transmission descriptor area 52 Transmission data area 100 First device 412 Transmission descriptor storage buffer 413 Transmission descriptor control unit (Second reading section)
414 Transmission data control unit 415 Transmission data storage buffer 500 Memory management system

Claims (5)

第1デバイスのメモリにDMA(Direct Memory Access)方式でアクセスしてデータを読み書きするメモリ制御装置であって、
前記第1デバイス以外の第2デバイスから、1つの通信プロトコルにて複数のデータを受信するデータ受信部と、
前記複数のデータそれぞれに対応する受信ディスクリプタを指定する識別子を取得する識別子取得部と、
前記メモリに記憶された複数の受信ディスクリプタから、それぞれの前記識別子に対応する受信ディスクリプタを読み出す読出部と、
前記複数のデータのそれぞれを、前記メモリの、前記読出部によって読み出された前記受信ディスクリプタそれぞれにより指定されるアドレスに書き込むデータ書込部と、を備え、
前記アドレスは、前記第1デバイスにおいて実行される1つ以上のアプリケーションがアクセス可能な記憶領域を示し、
前記第1デバイスは複数のアプリケーションを実行し、
前記メモリには、アプリケーション毎にアクセス可能な記憶領域が規定されており、
前記識別子は、前記データを使用するアプリケーションを規定するアプリケーション情報を含んでおり、
前記読出部は、前記アプリケーション情報が規定するアプリケーションがアクセス可能な記憶領域のアドレスを指定する受信ディスクリプタを、前記識別子に対応する受信ディスクリプタとして読み出し、
前記メモリには、1つの識別子に対応する複数の受信ディスクリプタが記憶されており、
前記1つの識別子に対応する前記複数の受信ディスクリプタは、前記1つの識別子のアプリケーション情報が示すアプリケーションがアクセス可能な記憶領域内の、それぞれ異なるアドレスを指定しており、
前記読出部は、前記1つの識別子に対応する前記複数の受信ディスクリプタを、所定の順番で読み出す、メモリ制御装置。
A memory control device that accesses the memory of a first device using a DMA (Direct Memory Access) method to read and write data,
a data receiving unit that receives a plurality of data using one communication protocol from a second device other than the first device;
an identifier acquisition unit that acquires an identifier specifying a reception descriptor corresponding to each of the plurality of data;
a reading unit that reads a reception descriptor corresponding to each of the identifiers from a plurality of reception descriptors stored in the memory;
a data writing unit that writes each of the plurality of data to an address of the memory specified by each of the reception descriptors read by the reading unit,
the address indicates a storage area accessible by one or more applications executed on the first device;
the first device executes a plurality of applications;
In the memory, a storage area that can be accessed for each application is defined,
the identifier includes application information that defines an application that uses the data;
The reading unit reads a reception descriptor that specifies an address of a storage area accessible by an application defined by the application information as a reception descriptor corresponding to the identifier;
The memory stores a plurality of reception descriptors corresponding to one identifier,
The plurality of reception descriptors corresponding to the one identifier each specify a different address within a storage area accessible by the application indicated by the application information of the one identifier,
The reading unit is a memory control device that reads the plurality of reception descriptors corresponding to the one identifier in a predetermined order .
前記識別子取得部は、前記データ受信部が受信した前記データに含まれている前記識別子を取得する、請求項に記載のメモリ制御装置。 The memory control device according to claim 1 , wherein the identifier acquisition unit acquires the identifier included in the data received by the data reception unit. 前記識別子は、該識別子に対応する前記データを示す情報を含んでおり、
前記識別子取得部は、前記識別子を前記データと別個に取得する、請求項に記載のメモリ制御装置。
The identifier includes information indicating the data corresponding to the identifier,
The memory control device according to claim 1 , wherein the identifier acquisition unit acquires the identifier separately from the data.
前記第2デバイスの第2メモリに記憶された送信ディスクリプタを読み出す第2読出部を備え、
前記データ受信部は、前記第2メモリの、前記第2読出部によって読み出された前記送信ディスクリプタによって指定されるアドレスから読み出されたデータを前記データとして取得し、
前記識別子は、前記第2デバイスから前記第1デバイスにデータを送信する際の、前記送信ディスクリプタに応じて規定されている、請求項に記載のメモリ制御装置。
comprising a second reading unit that reads a transmission descriptor stored in a second memory of the second device,
The data receiving unit acquires, as the data, data read from the address specified by the transmission descriptor read by the second reading unit of the second memory,
4. The memory control device according to claim 3 , wherein the identifier is defined according to the transmission descriptor when transmitting data from the second device to the first device.
第1デバイスのメモリにDMA(Direct Memory Access)方式でアクセスしてデータを読み書きするメモリ制御装置を制御するための制御方法であって、
前記第1デバイス以外の第2デバイスから、1つの通信プロトコルにて複数のデータを受信するデータ受信ステップと、
前記複数のデータそれぞれに対応する受信ディスクリプタを指定する識別子を取得する識別子取得ステップと、
前記メモリに記憶された複数の受信ディスクリプタから、それぞれの前記識別子に対応する受信ディスクリプタを読み出す読出ステップと、
前記複数のデータのそれぞれを、前記メモリの、前記読出ステップにおいて読み出された前記受信ディスクリプタそれぞれにより指定されるアドレスに書き込むデータ書込ステップと、を含み、
前記アドレスは、前記第1デバイスにおいて実行される1つ以上のアプリケーションがアクセス可能な記憶領域を示
前記第1デバイスは複数のアプリケーションを実行し、
前記メモリには、アプリケーション毎にアクセス可能な記憶領域が規定されており、
前記識別子は、前記データを使用するアプリケーションを規定するアプリケーション情報を含んでおり、
前記読出ステップにおいて、前記アプリケーション情報が規定するアプリケーションがアクセス可能な記憶領域のアドレスを指定する受信ディスクリプタを、前記識別子に対応する受信ディスクリプタとして読み出し、
前記メモリには、1つの識別子に対応する複数の受信ディスクリプタが記憶されており、
前記1つの識別子に対応する前記複数の受信ディスクリプタは、前記1つの識別子のアプリケーション情報が示すアプリケーションがアクセス可能な記憶領域内の、それぞれ異なるアドレスを指定しており、
前記読出ステップにおいて、前記1つの識別子に対応する前記複数の受信ディスクリプタを、所定の順番で読み出す、制御方法。
A control method for controlling a memory control device that accesses a memory of a first device using a DMA (Direct Memory Access) method to read and write data, the method comprising:
a data receiving step of receiving a plurality of data using one communication protocol from a second device other than the first device;
an identifier obtaining step of obtaining an identifier specifying a reception descriptor corresponding to each of the plurality of data;
a reading step of reading a reception descriptor corresponding to each of the identifiers from a plurality of reception descriptors stored in the memory;
a data writing step of writing each of the plurality of data to an address of the memory specified by each of the reception descriptors read in the reading step,
the address indicates a storage area accessible by one or more applications executed on the first device;
the first device executes a plurality of applications;
In the memory, a storage area that can be accessed for each application is defined,
the identifier includes application information that defines an application that uses the data;
In the reading step, a reception descriptor specifying an address of a storage area accessible by the application defined by the application information is read as a reception descriptor corresponding to the identifier;
The memory stores a plurality of reception descriptors corresponding to one identifier,
The plurality of reception descriptors corresponding to the one identifier each specify a different address within a storage area accessible by the application indicated by the application information of the one identifier,
In the reading step, the plurality of reception descriptors corresponding to the one identifier are read in a predetermined order .
JP2019188407A 2019-10-15 2019-10-15 Memory control device and control method Active JP7363344B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019188407A JP7363344B2 (en) 2019-10-15 2019-10-15 Memory control device and control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019188407A JP7363344B2 (en) 2019-10-15 2019-10-15 Memory control device and control method

Publications (2)

Publication Number Publication Date
JP2021064166A JP2021064166A (en) 2021-04-22
JP7363344B2 true JP7363344B2 (en) 2023-10-18

Family

ID=75486521

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019188407A Active JP7363344B2 (en) 2019-10-15 2019-10-15 Memory control device and control method

Country Status (1)

Country Link
JP (1) JP7363344B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117312201B (en) * 2023-11-29 2024-02-13 苏州元脑智能科技有限公司 A data transmission method, device and accelerator equipment, host and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006285300A (en) 2005-03-31 2006-10-19 Toshiba Corp Signal transfer apparatus and signal transfer method
WO2007129482A1 (en) 2006-04-06 2007-11-15 Sony Corporation Bridge, processor unit, information processing apparatus and access control method
JP2015207288A (en) 2014-04-17 2015-11-19 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング interface unit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006285300A (en) 2005-03-31 2006-10-19 Toshiba Corp Signal transfer apparatus and signal transfer method
WO2007129482A1 (en) 2006-04-06 2007-11-15 Sony Corporation Bridge, processor unit, information processing apparatus and access control method
JP2015207288A (en) 2014-04-17 2015-11-19 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング interface unit

Also Published As

Publication number Publication date
JP2021064166A (en) 2021-04-22

Similar Documents

Publication Publication Date Title
CN112214240B (en) Host output input command execution device and method and computer readable storage medium
US10079916B2 (en) Register files for I/O packet compression
EP3470971B1 (en) Method, apparatus, and system for accessing memory device
CN110119304B (en) Interrupt processing method, device and server
US10585822B2 (en) Operation method of host system including storage device and operation method of storage device controller
JP6880402B2 (en) Memory access control device and its control method
JP2021515318A (en) NVMe-based data reading methods, equipment and systems
CN114662136A (en) A high-speed encryption and decryption system and method of multi-algorithm IP core based on PCIE channel
US7484030B2 (en) Storage controller and methods for using the same
JP2003296267A (en) Bus system and information processing system including bus system
KR102303424B1 (en) Direct memory access control device for at least one processing unit having a random access memory
US7783817B2 (en) Method and apparatus for conditional broadcast of barrier operations
JP7363344B2 (en) Memory control device and control method
CN102027424B (en) Method for controlling access to regions of a storage comprising a plurality of processes and communication module having a message storage for implementing the method
CN120416368A (en) Data transmission method, device, electronic device, readable storage medium and program product
US7451254B2 (en) System and method for adaptive buffer allocation in a memory device interface
US7409486B2 (en) Storage system, and storage control method
KR101260313B1 (en) Electric apparatus and data sending/receiving method thereof and slave apparatus and communication method between the plural number of apparatuses
JP2006119724A (en) CPU system, bus bridge, control method thereof, and computer system
US10459842B1 (en) Data storage system with configurable prefetch buffers
WO2017005009A1 (en) External device expansion card and data processing method for input/output external device
CN118363901B (en) PCIe device, electronic component and electronic device
TWI860846B (en) Electronic device and host device coupled to memory device
WO2021035609A1 (en) Interaction method, device and system, and readable storage medium
CN110489359B (en) Data transmission control method and system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220817

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20230630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20230725

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230825

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: 20230905

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230918

R150 Certificate of patent or registration of utility model

Ref document number: 7363344

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150