WO2021181875A1 - 通信制御機器および通信制御機器の制御方法 - Google Patents
通信制御機器および通信制御機器の制御方法 Download PDFInfo
- Publication number
- WO2021181875A1 WO2021181875A1 PCT/JP2021/001404 JP2021001404W WO2021181875A1 WO 2021181875 A1 WO2021181875 A1 WO 2021181875A1 JP 2021001404 W JP2021001404 W JP 2021001404W WO 2021181875 A1 WO2021181875 A1 WO 2021181875A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- descriptor
- transmission
- time
- data
- priority
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Program-control systems
- G05B19/02—Program-control systems electric
- G05B19/04—Program control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
Definitions
- the present invention relates to a communication control device or the like that transfers data from a main memory to a transmission buffer according to a read descriptor and transmits the data transferred to the transmission buffer.
- Patent Document 1 includes a processor composed of a plurality of cores, a plurality of queues, and a plurality of communication ports, associates each queue with each core, and displays the processing result in each core in each core.
- the controller to be stored in each queue corresponding to is disclosed.
- the same number of queues as the number of cores is provided, and the same number of communication ports as the number of queues are provided, and each queue corresponding to each core outputs the processing result in each core, etc.
- One aspect of the present invention is to realize a communication control device capable of reducing the processing load of software (processor) while suppressing the mounting size.
- the communication control device transfers data from the main memory to the transmission buffer according to the read descriptor, and transmits the data transferred to the transmission buffer.
- a selection unit that is a control device and selects a descriptor to be read from a plurality of the descriptors based on at least one of a scheduled transmission time and an execution priority defined in each of the plurality of descriptors, and the above-mentioned It includes a reading unit that reads the descriptor selected by the selection unit.
- control method is a communication control in which data is transferred from the main memory to a transmission buffer according to a read descriptor and the data transferred to the transmission buffer is transmitted.
- FIG. 6 is a diagram showing a specific processing example when the flow illustrated in FIG. 6 is executed in Case 1.
- FIG. 6 is a diagram showing a specific processing example when the flow illustrated in FIG. 6 is executed in Case 2. It is a table which organized the information used when the communication controller which concerns on Embodiment 1 of this invention calculates the transfer time of a certain transmission data. It is a figure explaining the situation which occurs when the determination time is not provided in case 3.
- FIG. 3 is a diagram showing a specific processing example realized in the case 3 when the communication controller according to the first embodiment of the present invention is provided with a determination time.
- FIG. 5 is a flow chart showing an example of the update process illustrated in FIG. 15 when the priority of the target descriptor is the same as the current priority and when the former is higher than the latter.
- FIG. 5 is a flow chart showing an example in which the priority of the target descriptor is lower than the current priority in the update process illustrated in FIG. 15.
- n may indicate an integer of “1” or more
- buffer may be abbreviated as “BUF”
- descriptor memory for storing a transmission descriptor may be abbreviated as TX. ..
- the first buffer 162 (0) is abbreviated as “BUF0”
- the second buffer 162 (1) is abbreviated as “BUF1”
- the nth buffer 162 (n-1) is abbreviated as "BUFn-1”.
- Buffer 162 or "BUF”.
- the first descriptor memory 14 (0) is abbreviated as "TX0”
- the second descriptor memory 14 (1) is abbreviated as “TX1”
- the nth descriptor memory 14 (n-1) is abbreviated as "TXn-1”. May be abbreviated as.
- FIG. 2 is a diagram showing an outline of the control system 0.
- the control system 0 includes a PLC 1, a network hub 2, and networks 3 (1) and 3 (2), each of which is connected to the PLC 1 via the network hub 2.
- networks 3 (1) and 3 (2) each of which is connected to the PLC 1 via the network hub 2.
- network 3 includes one or more network devices.
- control system 0 illustrated in FIG. 2, a plurality of networks 3 are connected to the PLC 1 via the network hub 2.
- a giga band may be used for communication in control system 0.
- the PLC 1 is a control device that controls the entire control system 0, and the network hub 2 is a network hub or network switch that manages communication between the PLC 1 and a plurality of networks 3.
- a plurality of networks 3 for example, networks 3 (1) and 3 (2), are used for one network port of PLC1 (that is, transmission port 18 in FIG. 1). Existing.
- both networks 3 (1) and 3 (2) may be control networks, that is, all networks 3 communicating with PLC1 may be control networks. Further, either one of the networks 3 (1) and 3 (2) may be a control network and the other may be a data network. That is, with respect to the network 3 communicating with the PLC 1, the control network and the data network may be used. It may be mixed.
- the PLC 1 is a control device that controls the input device and the output device in the production equipment, and the network device is, for example, an input device and an output device in the production equipment.
- the PLC1 and the network device transmit and receive IN data and OUT data (hereinafter referred to as "IO data") by cyclically communicating with each other via the network 3, and the PLC1 controls the entire production equipment. .. That is, when the network 3 is a control network, the control system 0 can be regarded as a master-slave control system in which the PLC1 is a master device (master device that manages data transmission) and the network device is a slave device.
- the network 3 When the network 3 is a control network, the network 3 may conform to an Industrial Ethernet (registered trademark) standard such as an EtherCAT (Ethernet for Control Automation Technology: registered trademark) standard. If the network 3 is a control network, the network 3 may be compliant with the EtherNet / IP® standard.
- an Industrial Ethernet registered trademark
- EtherCAT Ethernet for Control Automation Technology: registered trademark
- network communication communication between PLC1 and a network device in FIG. 2
- network communication also referred to as “network communication”
- PCIe Peripheral Component Interconnect Express
- FIG. 2 illustrates a control system 0 in which a plurality of networks 3 are connected to the PLC 1 via the network hub 2.
- the plurality of networks 3 are connected to the PLC 1 via the network hub 2. It is not essential to connect with.
- one network 3 (particularly one control network) may be connected to the PLC 1 without going through the network hub 2.
- the PLC1 which is a master device and one or more network devices, each of which is a slave device, may be communicably connected in a one-stroke format.
- the communication controller 10 when the communication controller 10 receives a plurality of transmission requests (that is, execution requests of a plurality of transmission descriptors) from the software (that is, the CPU 30) substantially at the same time, the descriptor execution management unit 13 of the communication controller 10 executes the selection process. ..
- the descriptor execution management unit 13 sets the "transmission time TT" and the "priority P specified by the software" for each of the plurality of transmission descriptors (descriptors) to be executed. get. Then, the descriptor execution management unit 13 selects the descriptor to be executed, that is, the descriptor to be read, using the acquired "transmission time TT and priority P of each of the plurality of descriptors". Although the details will be described later, the descriptor execution management unit 13 may use "the data size (that is, the data transfer size) of each of the plurality of descriptors" when selecting the descriptor to be read.
- the NIC or the like configured by the logic circuit by the hardware manages the "transmission order and the actual transmission time (actual transmission time RTT) of the transmission data".
- the "actual transmission time RTT" is the time when the transmission data is actually transmitted, and the transmission in which the actual transmission time RTT matches the transmission time TT is also referred to as "time transmission”.
- the transmission queue that manages "transmission order and actual transmission time RTT of transmission data” is a DMAC (Direct Memory Access Controller). And has a transmit BUF. Then, in an example of such a NIC, a "transmission queue including DMAC and transmission BUF" is provided for each communication network for which "transmission order and actual transmission time RTT of transmission data" should be managed. ..
- the NIC is provided with a "transmission queue equipped with DMAC and transmission BUF" for each communication network for which "transmission order and actual transmission time RTT of transmission data" should be managed, the following problems occur. .. That is, as the number of communication networks to be managed increases, the number of "transmission queues including DMAC and transmission BUF” also increases, so that the mounting size of the NIC increases.
- the communication controller 10 does not need to include a plurality of "transmission queues including DMAC and transmission BUF" by executing the above-mentioned selection processing (particularly, selection processing of the descriptor to be read).
- the communication controller 10 illustrated in FIG. 1 includes "two" buffers 162 for temporarily holding the transmission data read from the main memory 20 before transmission, but the communication controller 10 includes the communication controller 10.
- the number of buffers 162 provided may be "one". That is, since the communication controller 10 executes the plurality of descriptors to be executed one by one in a desired order, the communication controller 10 temporarily holds the buffer 162 for transmitting data by "one". All you have to do is prepare. However, by providing "two" or more buffers 162, the communication controller 10 corresponds to another descriptor when another descriptor having a higher priority P is executed after executing a certain descriptor. Data can be sent with priority.
- the configuration in which the communication controller 10 includes "two" or more buffers 162 will be described in detail later.
- the communication controller 10 can execute a plurality of descriptors to be executed one by one in a desired order, data exchange between the main memory 20 and the buffer 162 is realized. It is sufficient that "one" DMAC12 is provided.
- the communication controller 10 does not need to include a plurality of "transmission queues including the DMAC and the transmission BUF", so that the mounting size can be reduced.
- the communication controller 10 can suppress an increase in the mounting size.
- the communication controller 10 includes "one" transmission port 18 and “one” DMAC12.
- the communication controller 10 is provided with a plurality of transmission queues for managing "transmission order and actual transmission time RTT of transmission data" for "one" transmission port 18 and "one” DMAC12. .
- the communication controller 10 includes a plurality of descriptor memories 14 and a plurality of requesters 15, and a descriptor execution management unit 13 for executing a plurality of descriptors to be executed one by one in a desired order is provided. "One" is provided.
- the communication controller 10 includes a plurality of transmission queues for managing "transmission order and actual transmission time RTT of transmission data" by a plurality of descriptor memories 14, a plurality of requesters 15, and a descriptor execution management unit 13. Achieve the same effect as. Therefore, the communication controller 10 can manage the "transmission order and actual transmission time RTT of the transmission data" in the same manner as having a plurality of transmission queues while suppressing the mounting size.
- the communication controller 10 is composed of a logic circuit made of hardware such as FPGA (Field-Programmable gate array) or ASIC (Application Specific Integrated Circuit).
- the software that is, the CPU 30
- the communication controller 10 can handle the communication controller 10 as hardware having a plurality of transmission queues for managing "transmission order and actual transmission time RTT of transmission data". Therefore, by configuring the communication controller 10 with a logic circuit by hardware, the communication controller 10 that manages the "transmission order and actual transmission time RTT of the transmission data" reduces the processing load of the software (that is, the CPU 30). can do.
- the communication controller 10 can be organized as follows. That is, the communication controller 10 (communication control device) transfers data (transmission data) from the main memory 20 to the buffer 162 (transmission buffer) according to the read transmission descriptor, and transmits the transferred data to the buffer 162. It is a device.
- the communication controller 10 includes a selection unit 131 and a reading unit 132.
- the selection unit 131 of the plurality of transmission descriptors is based on at least one of the "transmission time TT (scheduled transmission time)" and the "priority P (execution priority)" defined in each of the plurality of transmission descriptors. Select the transmit descriptor to read from the list. That is, the selection unit 131 selects a transmission descriptor to be executed from the plurality of transmission descriptors based on "at least one of the transmission time TT and the priority P" defined in each of the plurality of transmission descriptors. .. Further, the reading unit 132 reads the transmission descriptor selected by the selection unit 131, that is, executes the transmission descriptor selected by the selection unit 131.
- the communication controller 10 selects a descriptor to be read from the plurality of transmission descriptors based on at least one of the transmission time TT and the priority P defined in each of the plurality of transmission descriptors. do. Then, the communication controller 10 reads the selected transmission descriptor and transfers the transmission data from the main memory 20 to the buffer 162 according to the read transmission descriptor. That is, the communication controller 10 selects one descriptor to be read from the plurality of transmission descriptors based on at least one of the transmission time TT and the priority P of each of the plurality of transmission descriptors.
- the communication controller 10 does not need to include a plurality of transmission queues, each including a DMAC and a transmission buffer, and the mounting size can be reduced.
- the communication controller 10 controls the reading order of the plurality of transmission descriptors to output the output of the processing result by the software (processor, that is, the CPU 30), specifically, "the transmission order and the actual transmission data of the transmission data". Controls "transmission time RTT". That is, the software can treat the communication controller 10 as one piece of hardware including a plurality of transmission queues for managing "transmission order and actual transmission time RTT of transmission data”. Therefore, the communication controller 10 can reduce the processing load of the software related to the output control of the processing result (for example, management of "transmission order of transmission data and actual transmission time RTT").
- the communication controller 10 has the effect of being able to reduce the processing load of the software while suppressing the mounting size.
- the buffer 162 is roughly classified into a normal transmission buffer and a special transmission buffer.
- the normal transmission buffer data corresponding to the transmission descriptor is stored in the order of the transmission descriptors read by the reading unit 132.
- the special transmission buffer the data corresponding to the "descriptor that satisfies both of the following two conditions" is stored.
- Condition 1 is a descriptor read by the reading unit 132 during “from the selection of the transmission descriptor corresponding to the data normally stored in the transmission buffer to the transmission of the data”.
- Condition 2 is "higher priority P than the transmit descriptor corresponding to the data normally stored in the transmit buffer".
- At least one of the first buffer 162 (0), the second buffer 162 (1), ..., The nth buffer 162 (n-1) is used as a special transmission buffer, and the other buffers 162 are normally transmitted. It may be used as a buffer.
- the communication controller 10 includes a buffer 162 including the normal transmission buffer and the special transmission buffer. Then, the communication controller 10 normally stores the data corresponding to the read transmission descriptor in the order of the read transmission descriptor in the normal transmission buffer.
- the communication controller 10 reads a new descriptor during "from the selection of the transmission descriptor corresponding to the data stored in the normal transmission buffer to the transmission of the data stored in the normal transmission buffer". And, the following judgment is executed. That is, the communication controller 10 determines whether the priority P of the new descriptor is higher than the priority P of the transmission descriptor corresponding to the data stored in the normal transmission buffer.
- the communication controller 10 stores the data corresponding to the new descriptor in the special transmission buffer.
- the communication controller 10 stores the data corresponding to the new descriptor in the normal transmission buffer. do.
- the reading unit 132 may read. In such a case, if there was only one transmit buffer, the data corresponding to that other descriptor would have to be stored in the only transmit buffer after the data corresponding to that one transmit descriptor. No. As a result, it becomes impossible to transmit the data corresponding to the other descriptor before the data corresponding to the one transmission descriptor.
- the communication controller 10 includes a buffer 162 including the normal transmission buffer and the special transmission buffer. Then, as described above, when new data to be transmitted is generated with priority over the data stored in the normal transmission buffer, the communication controller 10 stores such data in the special transmission buffer.
- the communication controller 10 gives priority to the data to be transmitted with priority over the data corresponding to the certain transmission descriptor generated until the data corresponding to the certain transmission descriptor is transmitted after the selection of the certain transmission descriptor. It has the effect of being able to send.
- FIG. 1 is a diagram showing a configuration example of PLC1.
- the PLC 1 includes a communication controller 10, a main memory 20, and a CPU 30 as a hardware configuration.
- the PLC1 may further include a non-volatile memory (not shown), a USB connector for connecting an external device and the PLC1, and the like.
- the communication controller 10, the main memory 20, the CPU 30, and the non-volatile memory are respectively coupled via various buses (internal buses).
- the CPU 30 is typically configured according to a general-purpose computer architecture, and sequentially interprets and executes instruction codes according to an internal clock.
- the CPU 30 includes one or more CPU cores and a network control unit as a hardware configuration.
- the CPU 30 executes various arithmetic processes and stores the data generated as the execution result in the main memory 20 as transmission data. Further, with respect to the data stored in the main memory 20 as transmission data, the CPU 30 transmits the descriptor data that defines the priority P of the transmission data, the transmission time TT, the address in the main memory 20, the data size, and the like to the main memory 20. Store.
- the descriptor data that defines the priority P of the transmission data, the transmission time TT, the address in the main memory 20, the data size, and the like may be abbreviated as "transmission descriptor" or simply "descriptor".
- the "transmission time TT" of the transmission data is given by the CPU 30 and indicates the time when the communication controller 10 transmits the transmission data to the network 3, that is, the transmission data should be transmitted to the network 3. Indicates the scheduled transmission time. Further, the "priority P" of the transmission data is given by the CPU 30, and indicates the high necessity of “transmitting the transmission data at the" transmission time TT "". For example, “the transmission data is transmitted with a transmission cycle”. It shows the high need to "maintain and periodically transmit to network 3".
- an industrial controller such as PLC1 and a device (for example, the “network device” in FIG. 2) exchange data at regular intervals.
- a device for example, the “network device” in FIG. 2
- one or more data exchange cycles and a communication priority CP of the unit group may be set for the unit group including the one or more network devices.
- the communication priority CP and the priority P may be associated with each other.
- the communication priority CP of a certain unit group eg, unit group U1 is higher than the communication priority CP of another unit group (eg, unit group U2), that is, the communication cycle of the certain unit group. It may mean that the need to maintain is higher than that of the other unit group.
- the fact that the communication priority CP of a certain unit group (eg, unit group U1) is higher than the communication priority CP of another unit group (eg, unit group U2) means that the communication cycle of the certain unit group However, it may mean that it is earlier (shorter) than the communication cycle of the other unit group.
- periodic communication performed by PLC1 is more than “periodic communication performed by PLC1 with another network device”. It may be necessary to maintain the communication cycle.
- the communication priority CP of "periodic communication executed with the certain network device” is the communication of "periodic communication executed with the other network device”. Higher than priority CP.
- periodic communication executed by PLC1 (particularly, the communication controller 10) with a certain network device” is more than “periodic communication executed by PLC1 with another network device”.
- the communication cycle may be short (fast).
- the communication priority CP of "periodic communication executed with the certain network device” is the communication of "periodic communication executed with the other network device”. Higher than priority CP.
- the CPU 30 gives priority P to the transmitted data as follows. That is, the CPU 30 assigns the "transmission data destined for the certain network device” a priority P higher than the priority P assigned to the "transmission data destined for the other network device".
- the main memory 20 is a storage means for the PLC 1, and for example, data (transmission data) transmitted by the PLC 1 (particularly, the communication controller 10) to the network 3 is stored.
- the main memory 20 is a volatile storage area (RAM), and in addition to storing transmission data "generated by various arithmetic processes by the CPU 30 and transmitted to the network 3", the CPU 30 is used after the power is turned on to the PLC 1. Holds various programs to be executed.
- the main memory 20 is also used as a working memory when the CPU 30 executes various programs.
- DRAM Dynamic Random Access Memory
- SRAM Static Random Access Memory
- the main memory 20 illustrated in FIG. 1 stores the descriptor data (transmission descriptor) corresponding to the transmission data together with the transmission data.
- the transmission descriptor includes information indicating the transmission time TT, priority P, data size, and the like of the corresponding transmission data.
- the PLC1 may include a non-volatile memory that non-volatilely holds data such as various programs and parameters. These data stored in the non-volatile memory are copied to the main memory 20 so that the CPU 30 can access them, if necessary.
- a non-volatile memory a semiconductor memory such as a flash memory can be used.
- a magnetic recording medium such as a hard disk drive, an optical recording medium such as a DVD-RAM (Digital Versatile Disk Random Access Memory), or the like can be used.
- the communication controller 10 is a communication control device that transmits data (transmission data) stored in the main memory 20 to the network 3, and is realized as, for example, a NIC (Network Interface Card).
- the communication controller 10 is typically composed of a logic circuit made of hardware such as an FPGA (Field-Programmable gate array) or an ASIC (Application Specific Integrated Circuit).
- the communication controller 10 is configured to be capable of transmitting and receiving data to and from each of the main memory 20 and the CPU 30.
- the communication controller 10 is connected to the network 3 via the transmission port 18 and controls the exchange of data with the network 3, and in particular, controls the transmission of transmission data, for example, "transmission order and actual transmission of transmission data”. Control the "time RTT".
- the communication controller 10 provides, for example, the functions of the physical layer and the data link layer in the network 3. That is, the communication controller 10 controls the transmission of the transmission data and the reception of the received data in accordance with the standard to which the network 3 conforms. Specifically, the communication controller 10 transfers the data (transmission data) stored in the main memory 20 to the buffer 162 in the own device, and the transmission data stored in the buffer 162 is connected to the network 3. Send to your network device.
- the communication controller 10 transmits transmission data according to the contents specified in the transmission descriptor, and for example, transmits the transmission data corresponding to the transmission descriptor at the transmission time TT specified in the transmission descriptor.
- the fact that the communication controller 10 transmits the transmission data at the transmission time TT set for the transmission data is also referred to as "time transmission”. Refer to.
- the communication controller 10 controls the transmission order of the plurality of transmission data by the order of storing the plurality of transmission data in the buffer 162, and specifically, of a plurality of descriptors corresponding to the plurality of transmission data. Control the read order (execution order). In particular, the communication controller 10 preferentially selects a transmission descriptor to be read based on at least one of the transmission time TT and the priority P defined in each of the plurality of transmission descriptors.
- the data (transmission data) stored in the main memory 20 is transmitted to the network 3 and the actual transmission by the communication controller 10 configured by the logic circuit by the hardware instead of the CPU 30. Control the time RTT. Therefore, the PLC 1 can control the transmission order of the transmission data to the network 3 and the actual transmission time RTT by the communication controller 10 configured by the logic circuit by the hardware without increasing the processing load of the CPU 30. Play the effect of.
- the communication controller 10 illustrated in FIG. 1 has IF11, DMAC12, descriptor execution management unit 13, two or more descriptor memories 14, two or more requesters 15, BUF management unit 16, arbitration unit 17, and the arbitration unit 17, as functional blocks.
- a transmission port 18 is provided.
- the IF 11 is an interface for the communication controller 10 (particularly, the DMAC 12) to communicate with each of the main memory 20 and the CPU 30.
- the DMAC 12 executes data exchange between the main memory 20 and each of the descriptor memory 14 and the buffer 162. For example, the DMAC 12 reads the descriptor data (transmission descriptor) set in the main memory 20 by the CPU 30 and stores it in the descriptor memory 14.
- the DMAC 12 reads the descriptor data (transmission descriptor) set in the main memory 20 by the CPU 30 and stores it in the descriptor memory 14.
- the DMAC 12 transfers the transmission data from the main memory 20 to the buffer 162 according to the contents specified in the transmission descriptor, that is, acquires the data stored in the main memory 20 and buffers the acquired data. Store in 162. For example, the DMAC 12 acquires the transmission data specified by the “address of the main memory 20” and the “data size of the transmission data” defined in the transmission descriptor from the main memory 20. The DMAC 12 transfers the transmission data corresponding to the transmission descriptor to the buffer 162 together with the “transmission time TT” defined in the transmission descriptor.
- the DMAC 12 transfers transmission data from the main memory 20 to the buffer 162 according to "a transmission descriptor stored in the descriptor memory 14 and a transmission descriptor read (executed) by the descriptor execution management unit 13". do.
- the descriptor execution management unit 13 When the descriptor execution management unit 13 receives a transmission request from the CPU 30, the descriptor execution management unit 13 transfers the transmission data from the main memory 20 to the buffer 162 in accordance with the transmission request. Specifically, when the requester 15 notifies that "there is a transmit descriptor to be executed (read)", the descriptor execution management unit 13 reads (executes) the transmit descriptor with reference to the descriptor memory 14. ). Then, the descriptor execution management unit 13 sets the contents specified in the read transmission descriptor in the DMAC 12, and causes the DMAC 12 to transfer the transmission data from the main memory 20 to the buffer 162 according to the read transmission descriptor.
- the descriptor execution management unit 13 includes a selection unit 131 and a reading unit 132.
- the selection unit 131 When the requester 15 notifies that "there is a transmit descriptor to be executed (read)", the selection unit 131 refers to the descriptor memory 14 corresponding to the requester 15 and transmits the descriptor memory 14. Get the descriptor. For example, when the selection unit 131 is notified by the first requester 15 (0) that "there is a transmission descriptor to be read", the selection unit 131 stores it in the first descriptor memory 14 (0) corresponding to the first requester 15 (0). Get the transmit descriptor that has been created.
- the selection unit 131 is notified by the nth requester 15 (n-1) that "there is a transmission descriptor to be read"
- the nth descriptor memory 14 corresponding to the nth requester 15 (n-1) Acquire the transmission descriptor stored in (n-1).
- the selection unit 131 acquires a transmission descriptor from the descriptor memory 14 corresponding to the requester 15 in response to the notification from the requester 15 that "there is a transmission descriptor to be read", and notifies the reading unit 132 of the acquired transmission descriptor. do.
- the selection unit 131 determines the order of the transmission descriptors to be read (executed), that is, the transmission descriptor to be read preferentially. Select one by one. Then, the selection unit 131 notifies the reading unit 132 of the selected transmission descriptor.
- the selection unit 131 when the selection unit 131 is notified by each of the plurality of requesters 15 that "there is a transmission descriptor to be read" at substantially the same time, the selection unit 131 refers to the descriptor memory 14 corresponding to each of the plurality of requesters 15. Then, the selection unit 131 acquires the transmission descriptor stored in each of the plurality of descriptor memories 14 "each corresponding to each of the plurality of requesters 15".
- the selection unit 131 acquires "at least one of the transmission time TT and the priority P" of each of the plurality of transmission descriptors "each of which is stored in each of the plurality of descriptor memories 14". Then, the selection unit 131 determines the reading order of the plurality of transmission descriptors based on "at least one of the transmission time TT and the priority P" of each of the plurality of transmission descriptors, that is, of the plurality of transmission descriptors. Determine the execution order. Specifically, the selection unit 131 preferentially (that is, earlier) from among the plurality of transmission descriptors based on "at least one of the transmission time TT and the priority P" of each of the plurality of transmission descriptors. ) Select the transmit descriptors to read one by one.
- the selection unit 131 executes the following processing. .. That is, the selection unit 131 refers to the first descriptor memory 14 (0) corresponding to the first requester 15 (0), and refers to the transmission descriptor (for example, the descriptor A) stored in the first descriptor memory 14 (0). ) Is obtained. Similarly, the selection unit 131 refers to the second descriptor memory 14 (1) corresponding to the second requester 15 (1), and refers to the transmission descriptor (for example, the descriptor) stored in the second descriptor memory 14 (1). B) is acquired.
- the selection unit 131 acquires "at least one of the transmission time TT and the priority P" of each of the descriptor A and the descriptor B. Then, the selection unit 131 determines the reading order of the descriptor A and the descriptor B based on "at least one of the transmission time TT and the priority P" of each of the descriptor A and the descriptor B.
- the selection unit 131 selects the transmission descriptor to be read first from the descriptor A and the descriptor B based on "at least one of the transmission time TT and the priority P" of the descriptor A and the descriptor B, respectively. .. Then, the selection unit 131 notifies the reading unit 132 of the selected transmission descriptor.
- the selection unit 131 selects the descriptor A as the transmission descriptor to be read first among the descriptor A and the descriptor B
- the selection unit 131 notifies the reading unit 132 of the descriptor A.
- the selection unit 131 selects the descriptor B as the transmission descriptor to be read first among the descriptor A and the descriptor B
- the selection unit 131 notifies the reading unit 132 of the descriptor B.
- the reading unit 132 When the selection unit 131 notifies the transmission descriptor, the reading unit 132 reads the notified transmission descriptor, that is, executes the transmission descriptor notified by the selection unit 131.
- the reading unit 132 sets the contents specified in the read transmission descriptor in the DMAC 12, that is, notifies the DMAC 12 of the contents specified in the read transmission descriptor. Then, the reading unit 132 causes the DMAC 12 to execute the transfer process according to the contents specified in the read transmission descriptor, that is, the DMAC 12 transfers the transmission data from the main memory 20 to the buffer 162 according to the read transmission descriptor. Transfer.
- the transmit descriptor (descriptor data) is stored in the descriptor memory 14 in a FIFO (first in, first out, first in, first out) method.
- the communication controller 10 reads the descriptor data from the main memory 20 and stores it in the descriptor memory 14. ..
- the requester 15 includes a request register, and when a transmission descriptor is stored in the corresponding descriptor memory 14, "1" is stored in the request register of the requester 15. While “1" is stored in the request register, the requester 15 continues to notify the descriptor execution management unit 13 (particularly, the selection unit 131) that "there is a transmit descriptor to be executed (read)".
- the requester 15 further includes a setting register 151.
- the "execution number” and “execution number” notified from the CPU 30 to the communication controller 10 are stored in the setting register 151. Details of the "number of executions" and the “execution number” will be described later.
- the BUF management unit 16 controls the transmission order of the transmission data and the actual transmission time RTT, and specifically transmits the transmission data to the network 3 at the transmission time TT set for the transmission data, or , Try to send.
- the BUF management unit 16 includes a time designation transmission management unit 161 and a buffer 162.
- the time-designated transmission management unit 161 transmits the transmission data stored in the buffer 162 at the transmission time TT set for the transmission data, that is, the transmission specified by the transmission descriptor corresponding to the transmission data. Send at time TT. Specifically, when the data (transmission data) is stored in the buffer 162, the time designation transmission management unit 161 confirms the transmission time TT specified by the transmission descriptor corresponding to the transmission data. Then, the time-designated transmission management unit 161 outputs a transmission request to the arbitration unit 17 when the transmission time TT confirmed by the current time CT is reached. The time-designated transmission management unit 161 transmits the transmission data to the network 3 as a response from the arbitration unit 17 that has received the transmission request, if there is an access permission.
- the buffer 162 temporarily holds the transmission data (received data) in order to transmit the data (transmission data) stored in the main memory 20 to the network 3.
- the transmission data transmitted to the network 3 is stored in the buffer 162 by the DMAC 12 in a FIFO (first in, first out) method.
- the arbitration unit 17 adjusts a plurality of transmission requests to the network 3, that is, when the transmission times TT of the transmission data stored in each of the plurality of buffers 162 are substantially the same, the transmission data of any of the transmission data. Decide whether time transmission should be prioritized. In other words, when the arbitration unit 17 receives the transmission requests related to the transmission data stored in each of the plurality of buffers 162 at substantially the same time, the arbitration unit 17 selects the transmission request to which the access permission is given.
- the buffer 162 is roughly divided into a normal transmission buffer and a special transmission buffer, and when the transmission request related to the transmission data stored in each of the normal transmission buffer and the special transmission buffer is received substantially at the same time, the arbitration unit 17 receives. , Execute the following processing. That is, the arbitration unit 17 gives priority to the transmission request related to the transmission data stored in the special transmission buffer over the transmission request related to the transmission data stored in the normal transmission buffer. That is, the arbitration unit 17 grants access permission to the transmission request related to the transmission data stored in the special transmission buffer.
- FIG. 3 is a flow chart illustrating an outline of processing executed by the communication controller 10.
- the descriptor execution management unit 13 acquires at least one of the transmission time TT and the priority P defined in each of the plurality of descriptors (S10). ..
- the selection unit 131 selects a descriptor to be read from the plurality of descriptors based on the acquired "at least one of the transmission time TT and the priority P of each of the plurality of descriptors" (S20).
- the selection unit 131 selects a descriptor to be read, the selection unit 131 notifies the reading unit 132 of the selected descriptor.
- the reading unit 132 reads the descriptor selected by the selection unit 131 (S30).
- the reading unit 132 sets the address (storage destination address in the main memory 20), the data size of the transmission data, and the like specified in the read descriptor in the DMAC 12 (S40).
- the DMAC 12 transfers the transmission data stored in the main memory 20 to the buffer 162 (that is, stores the transmission data in the buffer 162) according to the contents set in S40 (S50). Then, the BUF management unit 16 transmits the transmission data stored in the buffer 162 (S60).
- the processes executed by the communication controller 10 described with reference to FIG. 3 can be organized as follows. That is, the process (control method) executed by the communication controller 10 is a communication control device that transfers data (transmission data) from the main memory 20 to the buffer 162 according to the read transmission descriptor and transmits the transferred data to the buffer 162. It is a control method of.
- the control method executed by the communication controller 10 includes a selection step (S20) and a read step (S30).
- the selection step is a process of selecting a descriptor to be read from a plurality of transmission descriptors based on at least one of "transmission time TT" and "priority P" defined in each of the plurality of transmission descriptors. .. That is, the selection step is a process of selecting a transmission descriptor to be executed from a plurality of transmission descriptors based on "at least one of the transmission time TT and the priority P" defined in each of the plurality of transmission descriptors.
- the read step is a process of reading the transmission descriptor selected in the selection step, that is, a process of executing the transmission descriptor selected in the selection step.
- the control method executed by the communication controller 10 is selected from among the plurality of transmission descriptors based on at least one of the transmission time TT and the priority P defined in each of the plurality of transmission descriptors. , Select the descriptor to read. Then, the control method executed by the communication controller 10 reads the selected transmission descriptor and transfers the transmission data from the main memory 20 to the buffer 162 according to the read transmission descriptor. That is, the control method executed by the communication controller 10 selects the descriptor to be read from the plurality of transmission descriptors one by one based on at least one of the transmission time TT and the priority P of each of the plurality of transmission descriptors. do.
- the communication controller 10 that executes the control method does not need to include a plurality of transmission queues, each including a DMAC and a transmission buffer, and the mounting size of the communication controller 10 can be reduced.
- control method controls the reading order of the plurality of transmission descriptors to output the processing result output by the software (processor). Control the order of data transmission. That is, the software can treat the communication controller 10 that executes the control method as one piece of hardware including a plurality of transmission queues that manage "transmission order and actual transmission time RTT of transmission data". Therefore, the control method can reduce the processing load of software related to output control of processing results (for example, management of "transmission order of transmission data and actual transmission time RTT").
- control method executed by the communication controller 10 has the effect of reducing the processing load of the software while suppressing the mounting size of the communication controller 10.
- the communication controller 10 selects the descriptor to be read (that is, the descriptor to be executed) by using at least one of the transmission time TT and the priority P, that is, the read order (execution order) of the plurality of descriptors. To control. Therefore, the communication controller 10 reduces the processing load of the software (that is, the CPU 30), particularly the processing load related to the management of the "transmission order and actual transmission time RTT of the transmission data", while suppressing the mounting size. be able to.
- the developer of the communication controller 10 further assumes the following cases 1, 2, and 3, and preferably selects a descriptor to be read even when the communication controller 10 faces these three cases. I devised so that I could select it. The details will be described below.
- FIG. 4 is a diagram illustrating a situation that occurs when a descriptor to be executed first (that is, to be read first) is selected based only on the priority P in the descriptor in Case 1.
- the transmission time TT (low priority) specified by the descriptor set with the low priority P is earlier than the transmission time TT (high priority) specified by the descriptor set with the high priority P.
- the time interval between the transmission times TT of both is large.
- a descriptor having a low priority P set may be referred to as a "low priority descriptor”
- a descriptor having a high priority P set may be referred to as a "high priority descriptor”.
- the communication controller 10 is abbreviated as "NIC (Network Interface Card)".
- TX0 that is, the first descriptor memory 14 (0) is defined as “9:05” as the transmission time TT (0) of the transmission data D (0), and the transmission data D is defined.
- a descriptor in which "1" is specified as the priority P of (0) is stored.
- TX1 that is, the second descriptor memory 14 (1), “9:00” is defined as the transmission time TT (1) of the transmission data D (1), and the priority P of the transmission data D (1) is defined.
- the descriptor that defines "2" is stored.
- the high priority descriptor is stored in TX0, and the low priority descriptor is stored in TX1.
- the “transmission time TT (0)” of the transmission data D (0) specified by the high-priority descriptor stored in TX0 is “9:05", and is specified by the low-priority descriptor stored in TX1.
- the “transmission time TT (1)” of the transmission data D (1) is “9:00”.
- the transmission time TT (1): “9:00” specified by the low priority descriptor is earlier than the transmission time TT (0): "9:05” specified by the high priority descriptor.
- the time interval between the transmission time TT (1): “9:00" of the transmission data D (1) and the transmission time TT (0): “9:05” of the transmission data D (0) is ". 5 ”, and the time interval between the transmission times TT of both is large. That is, the transmission time TT (low priority) specified by the low priority descriptor is earlier than the transmission time TT (high priority) specified by the high priority descriptor, and the transmission time TT (low priority) and the transmission time TT (high priority). ) Is large in time interval.
- the data D (0) corresponding to the high-priority descriptor is buffered 162 (BUF) before the data D (1) corresponding to the low-priority descriptor. ) Is stored.
- the data D (1) is stored in BUF1, that is, the second buffer 162 (1).
- BUF0 that is, the first buffer 162 (0)
- the data D (1) is stored in BUF1
- BUF1 that is, the second buffer 162 (1).
- the data D (0) and the data D (1) may be stored in the same buffer 162 in the order in which the corresponding descriptors are executed (read).
- the data D (0) is stored in the BUF 0 so that it is easy to understand that the data D (0) is stored in the buffer 162 (BUF) before the data D (1). Only an example of storing D (1) in BUF1 is shown.
- the data D (1) Since the data D (0) is stored in the buffer 162 before the data D (1), the data D (1) is transmitted to the network 3 and the data D (0) is transmitted to the network 3. Will be executed later. That is, after the transmission data D (0) is transmitted to the network 3 at the transmission time TT (0): "9:05", the data D (1) is transmitted to the network 3. Therefore, the transmission data D (1) cannot be transmitted to the network 3 at the transmission time TT (1) of "9:00".
- FIG. 5 is a diagram illustrating a situation that occurs when a descriptor to be executed first (that is, to be read first) is selected based only on the transmission time TT in the descriptor in Case 2.
- the transmission time TT (low priority) specified by the low priority descriptor is earlier than the transmission time TT (high priority) specified by the high priority descriptor, and the transmission time TT (low priority) and the transmission time TT (high priority) are set.
- the time interval between (priority) and is small.
- the communication controller 10 is abbreviated as "NIC".
- TX0 defines “9:01” as the “transmission time TT (0)” of the transmission data D (0), and “priority P” of the transmission data D (0).
- the descriptor that defines “1” is stored. Further, in TX1, “9:00” is specified as the “transmission time TT (1)” of the transmission data D (1), and “2” is specified as the "priority P” of the transmission data D (1). The descriptor is stored.
- the high priority descriptor is stored in TX0, and the low priority descriptor is stored in TX1.
- the “transmission time TT (0)” of the transmission data D (0) specified by the high-priority descriptor stored in TX0 is “9:01”, and is specified by the low-priority descriptor stored in TX1.
- the “transmission time TT (1)” of the transmission data D (1) is “9:00”.
- the transmission time TT (0): “9:00” specified by the low priority descriptor is earlier than the transmission time TT (1): "9:00" specified by the high priority descriptor.
- the time interval between the transmission time TT (1) of the transmission data D (1): “9:00" and the transmission time TT (0) of the transmission data D (0): “9:01” is "1".
- the time interval between the transmission time TT (1) and the transmission time TT (0) is small. That is, the transmission time TT (low priority) specified by the low priority descriptor is earlier than the transmission time TT (high priority) specified by the high priority descriptor, and the transmission time TT (low priority) and the transmission time TT (high priority). ) Is small in time interval.
- the data D (1) corresponding to the low-priority descriptor is buffered 162 (BUF) before the data D (0) corresponding to the high-priority descriptor. ) Is stored.
- the data D (0) is stored in BUF0, that is, the first buffer 162 (0).
- BUF0 the buffer 162 that stores the data D (1)
- the data D (0) and the data D (1) may be stored in the same buffer 162 in the order in which the corresponding descriptors are executed (read).
- the data D (0) is stored in the BUF 0 so that it is easy to understand that the data D (1) is stored in the buffer 162 (BUF) before the data D (0). Only an example of storing D (1) in BUF1 is shown.
- the data D (1) Since the data D (1) is stored in the buffer 162 before the data D (0), the data D (1) is transmitted to the network 3 when the data D (0) is transmitted to the network 3. Will be executed later. That is, after the transmission data D (1) is transmitted to the network 3 at the transmission time TT (1): "9:00", the data D (0) is transmitted to the network 3. Therefore, the transmission data D (0) cannot be transmitted to the network 3 at the transmission time TT (0) of "9:01".
- the “transfer time RT” is a time (period) required to transfer a certain data (a certain transmission data) from the main memory 20 to the buffer 162.
- the communication controller 10 compares the calculated total scheduled time ERT with the transmission time TT (high priority) of the high priority data.
- the communication controller 10 when the scheduled total time ERT is larger (slower) than the transmission time TT (high priority), the communication controller 10 sends the high priority data to the buffer 162 even after transferring the low priority data to the buffer 162.
- the transfer can be made in time for the transmission time TT (high priority). That is, when the scheduled total time ERT is later than the transmission time TT (high priority), the communication controller 10 has high priority before the transmission time TT (high priority) even after transferring the low priority data to the buffer 162. Data can be transferred to buffer 162.
- the communication controller 10 selects the low priority descriptor, executes (reads) the low priority descriptor, and then executes (reads) the high priority descriptor. ).
- the communication controller 10 transmits the transfer of the high priority data to the buffer 162 after transferring the low priority data to the buffer 162. It is not possible to make it in time for the time TT (high priority). That is, when the scheduled total time ERT is earlier than the transmission time TT (high priority), the communication controller 10 buffers the high priority data after transferring the low priority data to the buffer 162 and before the transmission time TT (high priority). Cannot transfer to 162.
- the communication controller 10 selects the high priority descriptor, executes (reads) the high priority descriptor, and then executes (reads) the low priority descriptor. ).
- FIG. 6 is a flow chart showing an example of a selection process (a process of selecting a descriptor to be read, that is, a descriptor to be executed) executed by the selection unit 131 in consideration of both the priority P and the transmission time TT. Is. Specifically, FIG. 6 shows the process of "selecting which descriptor of the high-priority descriptor and the low-priority descriptor should be executed first (should be read first)" executed by the selection unit 131. It is a flow figure explaining the details.
- the selection unit 131 determines whether the transmission time TT (low priority) of the low priority descriptor is earlier than the transmission time TT (high priority) of the high priority descriptor (S110). ). When "the transmission time TT (high priority) is earlier than the transmission time TT (low priority), or both are the same" (NO in S110), the selection unit 131 includes the high priority descriptor and the low priority descriptor. Among them, the high priority descriptor is selected (S140).
- the selection unit 131 calculates the scheduled total time ERT (S120). As described above, the scheduled total time ERT adds the data transfer time RT (low priority) corresponding to the low priority descriptor and the data transfer time RT (high priority) corresponding to the high priority descriptor to the current time CT. Time.
- the selection unit 131 determines "whether the scheduled total time ERT is larger than the transmission time TT (high priority) specified in the high priority descriptor (the scheduled total time ERT is later)" (S130). When “the scheduled total time ERT is later than the transmission time TT (high priority)" (YES in S130), the selection unit 131 selects the high priority descriptor from the high priority descriptor and the low priority descriptor (S140). ..
- the selection unit 131 is the low priority descriptor of the high priority descriptor and the low priority descriptor. Is selected (S140).
- FIG. 7 is a diagram illustrating a descriptor selected by the selection unit 131 by executing the flow illustrated in FIG. 6 by the selection unit 131.
- the transfer time RT (high priority) required for transferring the data (high priority data) corresponding to the high priority descriptor from the main memory 20 to the buffer 162 is “2".
- the transfer time RT (low priority) required for transferring the data corresponding to the low priority descriptor (low priority data) from the main memory 20 to the buffer 162 is "2".
- the current time CT is "08:58”. Therefore, when the high priority descriptor is executed after the low priority descriptor is executed, the time when the transfer of the high priority data from the main memory 20 to the buffer 162 is completed (that is, the scheduled total time ERT) is "09:02". ".
- the selection unit 131 selects a low priority descriptor (a descriptor stored in TX1) from the high priority descriptor and the low priority descriptor, and the communication controller 10 first executes (reads) the low priority descriptor. ..
- the transfer time RT (high priority) required for transferring the data (high priority data) corresponding to the high priority descriptor from the main memory 20 to the buffer 162 is “2".
- the transfer time RT (low priority) required for transferring the data corresponding to the low priority descriptor (low priority data) from the main memory 20 to the buffer 162 is "2".
- the current time CT is "08:58”. Therefore, when the high priority descriptor is executed after the low priority descriptor is executed, the time when the transfer of the high priority data from the main memory 20 to the buffer 162 is completed (that is, the scheduled total time ERT) is "09:02". ".
- the selection unit 131 selects a high-priority descriptor (descriptor stored in TX0) from the high-priority descriptor and the low-priority descriptor, and the communication controller 10 first executes (reads) the high-priority descriptor. ..
- FIG. 8 is a diagram showing a specific processing example when the flow illustrated in FIG. 6 is executed in case 1.
- the time at which the transfer of the high-priority data from the main memory 20 to the buffer 162 is completed (that is, the scheduled total time ERT) is set to "09". : 02 ".
- the scheduled total time ERT "09:02" is earlier than the transmission time TT (high priority): "9:05" specified in the high priority descriptor in Case 1.
- the selection unit 131 selects a low-priority descriptor (descriptor stored in TX1) from the high-priority descriptor and the low-priority descriptor, and the communication controller 10 first executes (reads) the low-priority descriptor. ..
- the data D (1) corresponding to the low-priority descriptor is buffered 162 (BUF) before the data D (0) corresponding to the high-priority descriptor. ) Is stored.
- the communication controller 10 converts the data D (1) previously stored in the buffer 162 into the “transmission time TT (1)” of the transmission data D (1). It is transmitted at "9:00". Then, the communication controller 10 (particularly, the time designation transmission management unit 161) transmits the data D (0) stored in the buffer 162 after the data D (1) after the data D (1) is transmitted. The data is transmitted at "9:05" which is the "transmission time TT (0)" of (0).
- the communication controller 10 transmits low-priority data according to the transmission time TT (low priority) of the low-priority descriptor, and has high priority according to the transmission time TT (high priority) of the high-priority descriptor. Data can be sent.
- FIG. 9 is a diagram showing a specific processing example when the flow illustrated in FIG. 6 is executed in case 2.
- the time at which the transfer of the high-priority data from the main memory 20 to the buffer 162 is completed (that is, the scheduled total time ERT) is set to "09". : 02 ".
- the scheduled total time ERT "09:02" is later than the transmission time TT (high priority): "9:01" specified in the high priority descriptor in Case 2.
- the selection unit 131 selects a high-priority descriptor (descriptor stored in TX0) from the high-priority descriptor and the low-priority descriptor, and the communication controller 10 first executes (reads) the high-priority descriptor. ..
- the data D (0) corresponding to the high-priority descriptor is buffered 162 (BUF) before the data D (1) corresponding to the low-priority descriptor. ) Is stored.
- the communication controller 10 converts the data D (0) previously stored in the buffer 162 into the “transmission time TT (0)” of the transmission data D (0). It is transmitted at "9:01". Then, the communication controller 10 (particularly, the time designation transmission management unit 161) sets the data D (1) stored in the buffer 162 after the data D (0) at the earliest possible timing after the data D (0) is transmitted. And send it.
- the communication controller 10 can transmit high-priority data according to the transmission time TT (high-priority) of the high-priority descriptor, and can also transmit low-priority data at the earliest possible time.
- the selection unit 131 executes the following processing.
- the selection unit 131 is the scheduled total time, which is "the time obtained by adding the data transfer time RT corresponding to the certain transmission descriptor and the data transfer time RT corresponding to the other descriptor to the current time CT".
- the transfer time RT is the time required to transfer the data (transmission data) from the main memory 20 to the buffer 162.
- the selection unit 131 compares the calculated total scheduled time ERT with the transmission time TT of a certain transmission descriptor.
- the selection unit 131 selects the other descriptor in preference to the certain transmission descriptor. If the transmission time TT of the certain transmission descriptor is before the scheduled total time ERT, the selection unit 131 selects the certain transmission descriptor in preference to the other descriptor.
- the communication controller 10 determines the scheduled total time ERT and the transmission time TT of the certain transmission descriptor. To compare. Then, when the transmission time TT of the certain transmission descriptor is later than the scheduled total time ERT (later), the communication controller 10 selects the other descriptor in preference to the certain transmission descriptor. Further, if the transmission time TT of the certain transmission descriptor is before the scheduled total time ERT, the communication controller 10 selects the certain transmission descriptor in preference to the other descriptor.
- the descriptor having the lower priority P is always read after the descriptor having the higher priority P. Will be (executed).
- the descriptor reading order is determined only according to the priority P. Is not always appropriate.
- the transmission data corresponding to the certain transmission descriptor is mainly transmitted before the transmission time TT of the certain transmission descriptor. It may be possible to transfer to the memory 20. In such a case, the other descriptor should be read (executed) and then the certain descriptor should be read, that is, the other descriptor should be read before the certain transmit descriptor.
- the descriptor to be read is selected based only on the transmission time TT specified in each of the plurality of descriptors, the descriptor having the late transmission time TT is always read after the descriptor having the early transmission time TT. become.
- the transmission data corresponding to the other descriptor is transferred to the main memory 20 after the transmission data corresponding to the other descriptor is transferred to the main memory 20, the transmission data corresponding to the certain transmission descriptor is sent to the main memory 20 before the transmission time TT of the certain transmission descriptor. It may not be possible to transfer to. In such a case, the one descriptor must be read before reading (running) the other descriptor, that is, the one descriptor should be read before the other transmit descriptor. be.
- the communication controller 10 compensates for the above-mentioned deficiencies of each of the determination of the descriptor reading order according to the priority P only and the determination of the descriptor reading order according only to the transmission time TT. That is, when the priority P of a certain transmission descriptor among a plurality of transmission descriptors is higher than the priority P of another descriptor, the communication controller 10 sets the scheduled total time ERT and the transmission time TT of a certain transmission descriptor. To compare. Then, the communication controller 10 selects the descriptor to be read, that is, the descriptor to be executed, based on the comparison result between the scheduled total time ERT and the transmission time TT of a certain transmission descriptor.
- the communication controller 10 has an effect that the descriptor to be read can be appropriately selected as compared with the method of selecting the descriptor to be read according to only one of the priority P and the transmission time TT.
- FIG. 10 is a table in which information used by the communication controller 10 for calculating the transfer time RT of a certain transmission data is organized.
- the communication controller 10 (particularly, the selection unit 131) has a data size of a certain transmission data and "a transfer rate when the communication controller 10 transfers data from the main memory 20 to the buffer 162". From, the transfer time RT of a certain transmission data is calculated.
- the communication controller 10 acquires the theoretical value speed (transfer rate) related to data transfer between the main memory 20 and the communication controller 10 (particularly, the buffer 162) at the time of starting the PLC 1 (particularly at the time of establishing the protocol). Can be done. For example, when the main memory 20 and the communication controller 10 are connected by PCIe (Peripheral Component Interconnect Express), the communication controller 10 confirms the rate (theoretical value) guaranteed by the PCIe standard by referring to the register. ..
- PCIe Peripheral Component Interconnect Express
- each of “execution rate” and “overhead” is prepared in advance for each rate (theoretical value). Specifically, the “execution rate” is tuned for each rate (theoretical value) at the time of production (development) of the communication controller 10. The “execution rate” may be set by software (that is, CPU 30) at the time of starting PLC1. Similarly, the “overhead” is tuned for each rate (theoretical value) at the time of production (development) of the communication controller 10.
- the communication controller 10 acquires the "execution rate” corresponding to the confirmed rate (theoretical value), and calculates the "transfer speed” from the rate (theoretical value) and the execution rate. Further, the communication controller 10 uses the "overhead" prepared in advance for each rate (theoretical value) to calculate the transfer time RT of a certain data.
- the communication controller 10 can acquire the transfer size of the transmission data each time the transmission descriptor is read.
- the communication controller 10 uses the following equations from the transfer size of the acquired transmission data and the “transfer speed” and “overhead” for each rate (theoretical value) to transmit the transmission data.
- FIG. 11 is a diagram illustrating a situation that occurs when the determination time JT (details will be described later) is not provided in Case 3.
- a descriptor defines a time separated from the current time CT by a predetermined time or more as a "transmission time TT”.
- the communication controller 10 is abbreviated as "NIC".
- TX0 defines “9:10” as the “transmission time TT (0)” of the transmission data D (0), and “priority P” of the transmission data D (0).
- the descriptor that defines “1” is stored.
- TX1 “9:00” is specified as the “transmission time TT (1)” of the transmission data D (1)
- "1” is specified as the "priority P” of the transmission data D (1).
- the descriptor is stored.
- TX2 that is, the third descriptor memory 14 (2)
- “9:00” is defined as the “transmission time TT (2)” of the transmission data D (2), and the transmission data D (2) “ A descriptor in which "2" is specified as "priority P” is stored.
- the high priority data D (0) corresponding to the "high priority descriptor stored in TX0" is stored at the beginning of the buffer 162. NS.
- the "high priority descriptor stored in TX1" is executed after the "high priority descriptor stored in TX0". Therefore, the high priority data D (1) corresponding to the "high priority descriptor stored in TX1" is stored in the buffer 162 after the high priority data D (0).
- the high-priority data D (0) Since the high-priority data D (0) is stored before the high-priority data D (1) in the buffer 162, the high-priority data D (0) must be transmitted to the network 3 before the high-priority data D (0) is transmitted. Data D (1) cannot be transmitted to network 3.
- the transmission time TT (1)" of the transmission data D (1) is “9:00", whereas the “transmission time TT (0)" of the transmission data D (0). Is “9:10". Therefore, the transmission data D (1) cannot be transmitted to the network 3 at "9:00", and the transmission data D (1) can be transmitted to the network 3 at the timing when the transmission data D (0) is “9:”. After transmitting to network 3 in "10".
- a descriptor (eg, “Transmission time TT”) that defines a time (for example, transmission time TT (0)) separated from the current time CT by a predetermined time or more is defined as “transmission time TT” (eg, “Transmission time TT”). "High priority descriptor stored in TX0”) has occurred.
- the “transmission time TT closer to the current time CT than the transmission time TT (0) (eg, the transmission time TT (1)) ) Is specified as "transmission time TT”.
- the developer of the communication controller 10 has further devised the following device for the communication controller 10 so that the descriptor to be read by the communication controller 10 can be preferably selected even in the above case 3.
- the communication controller 10 is provided with a determination time JT in advance, and the communication controller 10 adjusts the timing of executing (reading) the descriptor using the determination time JT. Specifically, the communication controller 10 reads (executes) the descriptor after the "time that goes back from the transmission time TT specified by the descriptor to the determination time JT".
- the period obtained by subtracting the "current time CT” from the "transmission time TT specified by the descriptor” is larger than the judgment time JT, that is, "(transmission time TT-current time CT)> judgment time JT". If, then the descriptor is not executed. In the communication controller 10, when the period obtained by subtracting the "current time CT” from the "transmission time TT specified by the descriptor” is less than or equal to the judgment time JT, that is, "(transmission time TT-current time CT) ⁇ judgment time JT". Then, the descriptor is executed.
- FIG. 12 is a diagram showing a specific processing example realized by the communication controller 10 provided with the determination time JT for the case 3.
- “9:10” is defined as the “transmission time TT (0)” of the transmission data D (0), and as the “priority P” of the transmission data D (0).
- the descriptor that defines “1” is stored.
- TX1 "9:00” is specified as the "transmission time TT (1)" of the transmission data D (1)
- “1” is specified as the "priority P” of the transmission data D (1).
- the descriptor is stored.
- TX2 “9:00” is specified as the "transmission time TT (2)" of the transmission data D (2)
- “2" is specified as the "priority P” of the transmission data D (2).
- the descriptor is stored.
- the communication controller 10 sets the descriptor in which "9:10" is defined as the “transmission time TT (0)" of the transmission data D (0) until the descriptor reaches "the time retroactive from the determination time JT from" 9:10 "". , Do not run. That is, while “the time (period) obtained by subtracting the current time CT from the transmission time TT is larger than the determination time JT", the communication controller 10 does not read (do not execute) the descriptor that defines the transmission time TT.
- the communication controller 10 sets the descriptor in which "9:00" is defined as the “transmission time TT (1)" of the transmission data D (1), and the “period obtained by subtracting the current time CT from” 9:00 "".
- the judgment time is JT or less
- the data is executed. That is, when "the time obtained by subtracting the current time CT from the transmission time TT is equal to or less than the determination time JT", the communication controller 10 regards the descriptor defining the transmission time TT as the descriptor to be read, in other words, the selection unit 131. It is the target of the selection process by.
- the communication controller 10 executes the "high priority descriptor stored in TX1" before the "high priority descriptor stored in TX0". Therefore, the communication controller 10 stores the high-priority data D (1) corresponding to the “high-priority descriptor stored in the TX1” in the buffer 162 before the high-priority data D (0).
- the communication controller 10 Since the high priority data D (1) is stored before the high priority data D (0) in the buffer 162, the communication controller 10 sends the high priority data D (0) to the network 3 before transmitting the high priority data D (0) to the network 3.
- the transmission high priority data D (1) can be transmitted to the network 3. Specifically, the communication controller 10 transmits the transmission height priority data D (1) to the network 3 at the transmission time TT (1): "9:00", and then transmits the transmission height priority data D (0). Transmission time TT (0): Transmission to network 3 at "9:10".
- the determination time JT is set in advance in the communication controller 10, and the reading unit 132 reads the transmission descriptor after the determination time JT is set back from the transmission time TT of the transmission descriptor.
- the communication controller 10 reads the transmission descriptor after the time is set back from the transmission time TT of the transmission descriptor to the determination time JT.
- the data stored in the buffer 162 is transmitted in the order in which they are stored. That is, if the data corresponding to a certain transmit descriptor is stored before the data corresponding to another descriptor, the data corresponding to the certain transmit descriptor must be transmitted before the data corresponding to the other descriptor is transmitted. No data is sent. Then, the data corresponding to the certain transmission descriptor is not transmitted unless the transmission time TT of the certain transmission descriptor is reached. However, since the transmission time TT of the certain transmit descriptor is later than the transmission time TT of the other descriptor, the data corresponding to the other descriptor is transmitted at the transmission time TT of the other descriptor. Can't.
- the communication controller 10 suppresses the possibility that the above-mentioned problem occurs by reading the transmission descriptor after the determination time JT is set back from the transmission time TT of the transmission descriptor. That is, the communication controller 10 is described above so that the certain transmission descriptor is not read before reading another descriptor whose transmission time TT is closer to the current time CT than the transmission time TT of a certain transmission descriptor. Perform the adjustment. In other words, the communication controller 10 adjusts the read time (execution time) of the certain transmission descriptor, and specifically, after the time is set back from the transmission time TT of the certain transmission descriptor to the determination time JT. , Read (execute) that certain transmit descriptor.
- FIG. 13 is a flow chart showing a processing example executed by the CPU 30 and the requester 15.
- FIG. 13A shows a processing example executed by the CPU 30, and
- FIG. 13B shows the processing example executed by the requester 15. An example of processing to be executed is shown.
- the CPU 30 sets the transmission data in the main memory 20 (S210), that is, stores the transmission data in the main memory 20. Further, the CPU 30 sets the transmission descriptor in the main memory 20 (S220), that is, stores the transmission descriptor in the main memory 20. Then, the CPU 30 outputs a transmission request to the communication controller 10 (S230), and specifically notifies the communication controller 10 of the execution number and the number of executions of the transmission descriptor.
- the "execution number” is the number of transmission data that the CPU 30 requests the communication controller 10 to execute transmission, in other words, the number of transmission descriptors to be executed by the communication controller 10. Further, the “execution number” indicates the number of the requester 15 and the number of the descriptor memory 14. For example, when the number of executions is "n", the communication controller 10 is notified of "0" to "n-1" as execution numbers. The execution number and the number of executions are stored (set) in, for example, the setting register 151 of the requester 15.
- the communication controller 10 executes the transmission process, the process to be executed by the CPU 30 ends in S230. If there is a separate transmission request, the CPU 30 may execute the processes from S210 to S230 each time.
- the requester 15 determines whether there is a transmission request from the CPU 30 (S310). If there is no transmission request from the CPU 30 (NO in S310), the requester 15 waits until there is a transmission request from the CPU 30.
- the communication controller 10 executes the following processing. That is, the communication controller 10 that has received the transmission request from the CPU 30 acquires the descriptor stored in the main memory 20 according to the received transmission request, and stores the acquired descriptor in the descriptor memory 14. Specifically, the descriptor to be acquired from the main memory 20 is specified based on the "number of executions" set in the setting register 151 of the requester 15 by the CPU 30, and the specified descriptor is acquired from the main memory 20.
- the communication controller 10 stores the acquired descriptor in the "descriptor memory 14 (area of the descriptor memory 14) corresponding to the" execution number "set in the setting register 151 of the requester 15". do.
- the "n" descriptors acquired from the main memory 20 are the first descriptor memory 14 (0) to the nth descriptor memory 14 (n-) in the descriptor memory 14. It is stored in each of 1).
- the communication controller 10 that has received the transmission request from the CPU 30 stores "1" in the request register of the requester 15 corresponding to the descriptor memory 14 that stores the descriptor according to the received transmission request. For example, when the communication controller 10 stores the descriptor A acquired according to the transmission request in the first descriptor memory 14 (0), the communication controller 10 puts "in the request register of the first requester 15 (0) corresponding to the first descriptor memory 14 (0). 1 ”is stored. Further, when the communication controller 10 stores the descriptor B acquired according to the transmission request in the second descriptor memory 14 (1), the communication controller 10 puts "in the request register of the second requester 15 (1) corresponding to the second descriptor memory 14 (1)". 1 ”is stored.
- the requester 15 waits until the transfer completion notification is received from the descriptor execution management unit 13.
- FIG. 14 is a flow diagram showing a processing example executed by the descriptor execution management unit 13 and the BUF management unit 16, and in particular, FIG. 14A shows a processing example executed by the descriptor execution management unit 13. , FIG. 14B shows an example of processing executed by the requester 15.
- the descriptor execution management unit 13 executes a selection process for selecting a transmission descriptor to be executed (that is, a transmission descriptor to be read) (S420). Details of the selection process will be described later with reference to FIGS. 15 to 17.
- the descriptor execution management unit 13 executes the transmission descriptor selected in the selection process of S420, that is, reads the selected transmission descriptor. Then, the descriptor execution management unit 13 outputs a transfer request to the DMAC 12 according to the contents specified in the read transmit descriptor (S430).
- the transfer request is a transfer instruction to the DMAC 12, and specifically, "acquires transmission data from the main memory 20 according to the contents specified in the read transmission descriptor, and transfers the acquired transmission data to the buffer 162. Instruct DMAC12 to "do".
- the descriptor execution management unit 13 determines from the DMAC 12 whether or not there is a transfer completion report indicating that "the transfer process of the transmission data corresponding to the transfer request has been completed by the DMAC 12" (S440). If there is no transfer completion report from the DMAC 12 (NO in S440), the descriptor execution management unit 13 waits until there is a transfer completion report from the DMAC 12.
- the descriptor execution management unit 13 issues a transfer completion notification to the requester 15 (S450).
- the "transfer completion notification” is information indicating that "the transfer processing of the transmission data from the main memory 20 to the buffer 162 has been completed according to the contents specified in the transmission descriptor".
- the BUF management unit 16 determines whether or not there is transmission data in the buffer 162 (S510). If there is no transmission data in the buffer 162 (NO in S510), the BUF management unit 16 waits until the transmission data exists in the buffer 162.
- the time designation transmission management unit 161 determines "whether the current time CT is the transmission time TT of the transmission data existing in the buffer 162" (S520). If the current time CT is not the transmission time TT of the transmission data existing in the buffer 162 (NO in S520), the time designation transmission management unit 161 waits until the current time CT becomes the transmission time TT of the transmission data existing in the buffer 162. I will do it.
- the time designation transmission management unit 161 issues a transmission request to the arbitration unit 17 (S530).
- the "transmission request” is information that "instructs the arbitration unit 17 to transmit the transmission data existing in the buffer 162".
- the arbitration unit 17 confirms "whether the transmission of other transmission data is being executed", and when it is confirmed that the transmission of other transmission data is not being executed, outputs the access permission to the time-designated transmission management unit 161. do.
- the arbitration unit 17 does not output the access permission to the time designation transmission management unit 161 when the transmission of other transmission data is being executed.
- the time designation transmission management unit 161 determines whether or not there is an access permission from the arbitration unit 17 (S540). If there is no access permission from the arbitration unit 17 (NO in S540), the time designation transmission management unit 161 (BUF management unit 16) waits until the access permission from the arbitration unit 17 is obtained.
- the time-designated transmission management unit 161 (BUF management unit 16) executes transmission of transmission data existing in the buffer 162 (S550).
- FIG. 15 is a flow chart showing an example of the selection process (S420) illustrated in FIG. 14A.
- the descriptor execution management unit 13 determines the execution order for one or more transmission descriptors to be executed (read), and for example, selects a transmission descriptor to be executed from a plurality of transmission descriptors to be executed. Select one by one (selection process). The details of this selection process executed by the descriptor execution management unit 13 will be described below with reference to FIGS. 15 to 17.
- the descriptor execution management unit 13 sets "0" in each of the three variables of, for example, the current transmission time CST, the current priority CPR, and the current transfer time CRT (S1100).
- the current transmission time CST, the current priority CPR, and the current transfer time CRT may be collectively referred to as a “current variable”.
- the "one or more descriptors each corresponding to the transmission request" is the "descriptor for which the transmission request was made (YES in S310) in (B) of FIG. 13".
- the "transmission time TT" specified by the target descriptor is abbreviated as "NST”
- the "priority P” specified by the target descriptor is abbreviated as "NPR” to correspond to the target descriptor.
- the “transfer time RT" of the transmitted data is abbreviated as “NRT”.
- the transmission data corresponding to the target descriptor may be abbreviated as “target data”.
- the descriptor that defines the contents corresponding to the current transmission time CST, the current priority CPR, and the current transfer time CRT is abbreviated as "current descriptor”
- the transmission data corresponding to the current descriptor is abbreviated as "current”. I have something to do.
- the descriptor execution management unit 13 determines "whether the" time (period) obtained by subtracting the current time CT from the transmission time NST of the target descriptor "is equal to or less than the determination time JT" (S1300). If the time obtained by subtracting the current time CT from the transmission time NST of the target descriptor is larger than the determination time JT (NO in S1300), the descriptor execution management unit 13 confirms "whether all the descriptors for which transmission requests have been determined have been determined". (S1600).
- the descriptor execution management unit 13 compares the current priority CPR with the priority NPR of the target descriptor. (S1400).
- the communication controller 10 reads (executes) the descriptor after" the time when the determination time JT is traced back from the transmission time TT specified by the descriptor ". ”)”.
- the descriptor execution management unit 13 determines the certain descriptor in the current time CT. Exclude from the selection process.
- the descriptor execution management unit 13 executes the selection process for the certain descriptor in the current time CT. Do not read that particular descriptor.
- the descriptor execution management unit 13 selects the certain descriptor in the current time CT. Target of processing.
- the descriptor execution management unit 13 performs selection processing for the certain descriptor in the current time CT. Run.
- the descriptor execution management unit 13 that compares the current priority CPR and the priority NPR of the target descriptor in S1400 executes an update process for each relationship between the current priority CPR and the priority NPR of the target descriptor (S1500). Specifically, the descriptor execution management unit 13 determines that the priority NPR of the target descriptor is (1) the same as the current priority CPR, (2) higher than the current priority CPR, and (3) the current priority CPR. Update processing is executed for each of the low cases. The update process executed by the descriptor execution management unit 13 for each relationship between the current priority CPR and the priority NPR of the target descriptor will be described in detail with reference to FIGS. 16 and 17.
- the descriptor execution management unit 13 After executing the update process of S1500, the descriptor execution management unit 13 confirms "whether all the descriptors for which transmission requests have been determined have been determined" (S1600). For example, the descriptor execution management unit 13 confirms "whether the processes from S1200 (or S1700) to S1500 have been executed for all the descriptors for which transmission requests have been made”.
- the descriptor execution management unit 13 selects one of the undetermined descriptors as the "target descriptor" from the descriptors that have been requested to be transmitted. do. Then, the descriptor execution management unit 13 acquires the priority NPR, the transmission time NST, and the like of the selected target descriptor (S1700). Then, the descriptor execution management unit 13 executes the processing after S1300.
- the descriptor execution management unit 13 confirms whether or not there is a descriptor in the descriptor for which the transmission request has not been executed from S1200 (or S1700) to S1500. If there is a descriptor that has not executed the processes from S1200 (or S1700) to S1500, the descriptor execution management unit 13 executes the processes from S1700 to S1500 for the descriptor.
- the descriptor execution management unit 13 selects the descriptor corresponding to the current transmission time CST, the current priority CPR, and the current transfer time CRT as the descriptor to be executed (read) at the current time CT (S1800).
- FIG. 16 shows an example of the update process (S1500) illustrated in FIG. 15 when the priority NPR of the target descriptor is the same as the current priority CPR and when the priority NPR of the target descriptor is higher than the current priority CPR. It is a flow chart which shows.
- the descriptor execution management unit 13 executes the update process illustrated in FIG. 16A. That is, the descriptor execution management unit 13 first determines "whether the transmission time NST of the target descriptor is earlier than the current transmission time CST" (S1511).
- the descriptor execution management unit 13 updates each value of the current transmission time CST, the current priority CPR, and the current transfer time CRT. (S1512). Specifically, the descriptor execution management unit 13 updates the value of the current transmission time CST according to the value of the transmission time NST of the target descriptor. Further, the descriptor execution management unit 13 updates the value of the current priority CPR according to the value of the priority NPR of the target descriptor. Further, the descriptor execution management unit 13 updates the value of the current transfer time CRT with the value of the transfer time NRT of the transmission data corresponding to the target descriptor.
- the descriptor execution management unit 13 ends the update process. do.
- the descriptor execution management unit 13 executes the update process illustrated in FIG. 16B. That is, the descriptor execution management unit 13 first determines "whether the transmission time NST of the target descriptor is earlier than the current transmission time CST, or whether the current transmission time CST and the transmission time NST of the target descriptor are the same". (S1521).
- the descriptor execution management unit 13 updates the current variable (S1525). Specifically, the descriptor execution management unit 13 updates the value of the current transmission time CST according to the value of the transmission time NST of the target descriptor. Further, the descriptor execution management unit 13 updates the value of the current priority CPR according to the value of the priority NPR of the target descriptor. Further, the descriptor execution management unit 13 updates the value of the current transfer time CRT with the value of the transfer time NRT of the transmission data corresponding to the target descriptor.
- the descriptor execution management unit 13 determines whether "the transmission time NST of the target descriptor ⁇ scheduled total time ERT", that is, "whether the transmission time NST of the target descriptor is smaller (earlier) than the scheduled total time ERT". (S1524).
- the descriptor execution management unit 13 updates the current variable (S1525).
- the transmission time NST of the target descriptor is the same as the scheduled total time ERT, or the transmission time NST of the target descriptor is larger (later) than the scheduled total time ERT (NO in S1524), the descriptor execution management unit 13 ends the update process. do.
- the target descriptor corresponds to the “high priority descriptor of FIG. 6” and the current descriptor corresponds to the “low priority of FIG. 6”. Corresponds to "descriptor”.
- the transmission time NST corresponds to the “transmission time TT (high priority) defined by the high priority descriptor” in FIG.
- S1524 in FIG. 16B makes the same determination as in S130 in FIG. That is, if YES in S1524, the descriptor execution management unit 13 updates the current descriptor so that the target descriptor corresponding to the high priority descriptor is selected as the descriptor to be executed at the current time CT.
- the descriptor execution management unit 13 does not update the current descriptor so that the current descriptor corresponding to the low priority descriptor is selected as the descriptor to be executed at the current time CT.
- FIG. 17 is a flow chart showing an example of the update process (S1500) illustrated in FIG. 15 when the priority NPR of the target descriptor is lower than the current priority CPR.
- the descriptor execution management unit 13 first determines "whether the transmission time NST of the target descriptor is earlier than the current transmission time CST" (S1531).
- the descriptor execution management unit 13 determines whether "current transmission time CST ⁇ scheduled total time ERT", that is, "whether the current transmission time CST is smaller (earlier) than the scheduled total time ERT" (S1533). .. When the current transmission time CST is earlier than the scheduled total time ERT (YES in S1533), the descriptor execution management unit 13 ends the update process.
- the descriptor execution management unit 13 updates the current variable (S1534). ..
- the target descriptor corresponds to the “low priority descriptor of FIG. 6” and the current descriptor corresponds to the “high priority descriptor of FIG. 6”. do. Further, in FIG. 17, the current transmission time CST corresponds to the “transmission time TT (high priority) defined by the high priority descriptor” in FIG.
- S1533 in FIG. 17 makes the same determination as S130 in FIG. That is, if YES in S1533, the descriptor execution management unit 13 does not update the current descriptor so that the current descriptor corresponding to the high priority descriptor is selected as the descriptor to be executed at the current time CT.
- the descriptor execution management unit 13 updates the current descriptor so that the target descriptor corresponding to the low priority descriptor is selected as the descriptor to be executed at the current time CT.
- Modification example (about network configuration example)
- a plurality of networks 3 are connected to the PLC 1 via the network hub 2.
- one network 3 is connected to PLC1 without going through a network hub 2, and for example, PLC1 and one or more network devices are communicably connected to each other in a one-stroke format. You may.
- the communication control device is a communication control device that transfers data from the main memory to a transmission buffer according to a read descriptor and transmits the data transferred to the transmission buffer, and is a plurality of the above-mentioned communication control devices.
- a selection unit that selects a descriptor to be read from a plurality of the descriptors based on at least one of the scheduled transmission time and the execution priority specified in each descriptor, and the descriptor selected by the selection unit are selected. It has a reading unit to read.
- the communication control device reads a descriptor from the plurality of descriptors based on at least one of the scheduled transmission time and the execution priority defined in each of the plurality of descriptors. select. Then, the communication control device reads the selected descriptor and transfers the data from the main memory to the transmission buffer according to the read descriptor. That is, the communication control device selects one descriptor from the plurality of descriptors to be read based on at least one of the scheduled transmission time and the execution priority of each of the plurality of descriptors.
- the communication control device does not need to have a plurality of transmission queues, each including a DMAC (Direct Memory Access Controller) and a transmission buffer, and the mounting size can be reduced.
- DMAC Direct Memory Access Controller
- the communication control device controls the output of the processing result by the software (processor), specifically, the transmission order of the data by controlling the reading order of the plurality of descriptors. That is, the software can treat the communication control device as one hardware having a plurality of transmission queues for managing "transmission order and actual transmission time (actual transmission time) of transmission data". Therefore, the communication control device can reduce the processing load of software related to output control of processing results (for example, management of "transmission order and actual transmission time of transmission data").
- the communication control device has the effect of being able to reduce the processing load of the software while suppressing the mounting size.
- the selection unit when the execution priority of one descriptor among a plurality of descriptors is higher than the execution priority of another descriptor, the selection unit is (A). At the current time, the transfer time required to transfer the data corresponding to the certain descriptor from the main memory to the transmission buffer and the data corresponding to the other descriptor are transferred from the main memory to the transmission buffer.
- the scheduled total time which is the time obtained by adding the transfer time required for the data, is compared with (B) the scheduled transmission time of the descriptor, and the scheduled transmission time of the descriptor is the scheduled total time.
- the other descriptor is selected in preference to the certain descriptor, and when the scheduled transmission time of the certain descriptor is before the scheduled total time, the descriptor is given priority over the other descriptor. Certain descriptors may be selected.
- the communication control device when the execution priority of the certain transmission descriptor is higher than the execution priority of the other descriptor, the communication control device has the scheduled total time and the transmission schedule of the certain descriptor. Compare with time. Then, when the scheduled transmission time of the certain descriptor is later than the scheduled total time, the communication control device selects the other descriptor in preference to the certain descriptor. Further, when the scheduled transmission time of the certain descriptor is before the scheduled total time, the communication control device selects the certain descriptor in preference to the other descriptor.
- the descriptor to be read is selected based only on the execution priority specified in each of the plurality of descriptors, the descriptor having the lower execution priority is always read after the descriptor having the higher execution priority. Will be.
- the descriptor read order is determined only according to the execution priority. Is not always appropriate.
- the transmission data corresponding to the certain transmission descriptor is transmitted before the scheduled transmission time of the certain transmission descriptor. It may be possible to transfer to the main memory.
- the certain descriptor may be read after the other descriptor is read (executed), that is, the other descriptor should be read before the certain transmission descriptor.
- the descriptor having the late scheduled transmission time is always read after the descriptor having the early scheduled transmission time. It will be.
- the descriptor reading order is determined only according to the scheduled transmission time. Is not always appropriate.
- the transmission data corresponding to the certain transmission descriptor is sent to the main memory before the scheduled transmission time of the certain transmission descriptor. It may not be possible to transfer to. In such a case, the certain descriptor must be read before the other descriptor is read (executed), that is, the certain descriptor should be read before the other transmit descriptor. be.
- the communication control device compensates for the above-mentioned deficiencies of each of the determination of the descriptor reading order according to the execution priority only and the determination of the descriptor reading order according only to the scheduled transmission time. That is, when the execution priority of a certain descriptor among the plurality of descriptors is higher than the execution priority of another descriptor, the communication control device performs the scheduled total time and the transmission of the certain descriptor. Compare with the scheduled time. Then, the communication control device selects a descriptor to be read based on a comparison result between the scheduled total time and the scheduled transmission time of the certain descriptor.
- the communication control device has an effect that the descriptor to be read can be appropriately selected as compared with the method of selecting the descriptor to be read according to only one of the execution priority and the scheduled transmission time.
- the determination time is set in advance, and the reading unit may read the descriptor after the determination time is set back from the scheduled transmission time of the descriptor. good.
- the communication control device reads the descriptor after the time is set back from the scheduled transmission time of the descriptor to the determination time.
- the data stored in the transmission buffer is transmitted in the order in which they are stored. That is, if the data corresponding to the certain descriptor is stored before the data corresponding to the other descriptor, the data corresponding to the certain descriptor must be transmitted before the data corresponding to the other descriptor is transmitted. No data is sent. Then, the data corresponding to the certain descriptor is not transmitted until the scheduled transmission time of the certain descriptor is reached. However, since the scheduled transmission time of the certain descriptor is later than the scheduled transmission time of the other descriptor, it is not possible to transmit the data corresponding to the other descriptor at the scheduled transmission time of the other descriptor. Can not.
- the communication control device suppresses the possibility that the above-mentioned problem will occur by reading the descriptor after the time is set back from the scheduled transmission time of the descriptor to the determination time. That is, the communication control device is said so that the certain descriptor is not read before reading the other descriptor whose scheduled transmission time is closer to the current time than the scheduled transmission time of the certain descriptor. Adjust the read time of a descriptor. Specifically, the communication control device reads the descriptor after the time is set back from the scheduled transmission time of the descriptor to the determination time.
- the communication control device can prevent the descriptor from being read before reading the other descriptor whose scheduled transmission time is closer to the current time than the scheduled transmission time of the descriptor. It has the effect of.
- the transmission buffer is stored in the normal transmission buffer in which the data corresponding to the descriptor is stored and the normal transmission buffer in the order of the descriptor read by the reading unit. It is a descriptor read by the reading unit between the time when the selecting unit selects the descriptor corresponding to the data being stored and the time when the data stored in the normal transmission buffer is transmitted. It may include a special transmit buffer in which the data corresponding to the descriptor having a higher execution priority than the descriptor corresponding to the data stored in the normal transmit buffer is stored.
- the communication control device includes the transmission buffer including the normal transmission buffer and the special transmission buffer. Then, the communication control device usually stores the data corresponding to the read descriptor in the order of the read descriptor in the normal transmission buffer.
- the communication control device is new during "from the selection of the descriptor corresponding to the data stored in the normal transmission buffer to the transmission of the data stored in the normal transmission buffer".
- the descriptor is read, the following judgment is executed. That is, the communication control device determines whether the execution priority of the new descriptor is higher than the execution priority of the descriptor corresponding to the data stored in the normal transmission buffer.
- the communication control device stores the data corresponding to the new descriptor in the special transmission buffer.
- the communication control device stores the data corresponding to the new descriptor in the normal transmission buffer.
- the communication control device includes the transmission buffer including the normal transmission buffer and the special transmission buffer. Then, as described above, when new data to be transmitted is generated with priority over the data stored in the normal transmission buffer, the communication control device stores such data in the special transmission buffer.
- the communication control device preferentially transmits data to be transmitted over the data corresponding to the descriptor, which is generated from the selection of the descriptor to the transmission of the data corresponding to the descriptor. It has the effect of being able to send with priority.
- a control method is a control method for a communication control device that transfers data from a main memory to a transmission buffer according to a read descriptor and transmits the data transferred to the transmission buffer.
- the control method selects a descriptor to be read from a plurality of the descriptors based on at least one of a scheduled transmission time and an execution priority defined in each of the plurality of descriptors. do. Then, the control method reads the selected descriptor and transfers the data from the main memory to the transmission buffer according to the read descriptor. That is, the control method selects one descriptor from the plurality of descriptors to be read based on at least one of the scheduled transmission time and the execution priority of each of the plurality of descriptors.
- the communication control device that executes the control method does not need to include a plurality of transmission queues, each including a DMAC and a transmission buffer, and the mounting size of the communication control device that executes the control method can be reduced. ..
- control method controls the output of the processing result by the software (processor), specifically, the transmission order of the data by controlling the reading order of the plurality of descriptors. That is, the software can treat the communication control device as one hardware having a plurality of transmission queues for managing "transmission order and actual transmission time of transmission data". Therefore, the communication control device can reduce the processing load of software related to output control of processing results (for example, management of "transmission order and actual transmission time of transmission data").
- control method has an effect that the processing load of the software can be reduced while suppressing the mounting size of the communication control device that executes the control method.
- Communication controller (communication control device) 20 Main memory 162 buffer (transmission buffer) 131 Selection section 132 Reading section CT Current time ERT Scheduled total time JT Judgment time P Priority (execution priority) RT transfer time S20 selection step S30 read step TT transmission time (scheduled transmission time)
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Communication Control (AREA)
Abstract
実装サイズを抑制しつつ、プロセッサの処理負荷を低減する。通信コントローラ(10)は、複数の送信ディスクリプタの各々において規定されている、送信時刻(TT)および優先度(P)の少なくとも一方に基づいて、優先的に読み込む送信ディスクリプタを選択する。
Description
本発明は、読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器等に関する。
従来、PLC(Programmable Logic Controller;以下、PLCとも称す)などの産業用制御装置について、プロセッサの負荷を分散させるための各種の試みが知られている。例えば、下掲の特許文献1には、複数のコアからなるプロセッサと、複数のキューと、複数の通信ポートとを備え、各キューを各コアに対応付け、各コアにおける処理結果を、各コアに対応する各キューに格納するコントローラが開示されている。特許文献1のコントローラでは、コアの数と同数のキューが設けられ、また、キューの数と同数の通信ポートが設けられて、各コアに対応する各キューが、各コアにおける処理結果の出力等を制御することによって、プロセッサの負担を軽減しようとしている。
しかしながら、上述のような従来技術は、ネットワークセグメントごとに送信キューを分けるため、ネットワークセグメントが多くなると、それに合わせて送信キューが複数必要になり、実現が困難になるとの問題がある。すなわち、ネットワーク・インターフェイス・カード(Network Interface Card、NIC)の半導体、FPGA(Field-programmable gate array)のゲート使用量などを考慮すると、増やすことができる送信キューの個数には限界がある。
本発明の一態様は、実装サイズを抑制しつつ、ソフトウェア(プロセッサ)の処理負荷を低減することのできる通信制御機器を実現することを目的とする。
上記の課題を解決するために、本発明の一態様に係る通信制御機器は、読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器であって、複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する選択部と、前記選択部によって選択された前記ディスクリプタを読み込む読込部と、を備えている。
上記の課題を解決するために、本発明の一態様に係る制御方法は、読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器の制御方法であって、複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する選択ステップと、前記選択ステップにて選択された前記ディスクリプタを読み込む読込ステップと、を含んでいる。
本発明の一態様によれば、実装サイズを抑制しつつ、ソフトウェア(プロセッサ)の処理負荷を低減することができるとの効果を奏する。
〔実施形態1〕
以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰返さない。本実施の形態においては、機械および設備等の制御対象を制御するPLC(プログラマブル・ロジック・コントローラ、Programmable Logic Controller)1の備える通信コントローラ10を通信制御機器の典型例として説明を行なう。
以下、本発明の一側面に係る実施の形態(以下、「本実施形態」とも表記する)を、図面に基づいて説明する。なお、図中同一または相当部分には同一符号を付してその説明は繰返さない。本実施の形態においては、機械および設備等の制御対象を制御するPLC(プログラマブル・ロジック・コントローラ、Programmable Logic Controller)1の備える通信コントローラ10を通信制御機器の典型例として説明を行なう。
以下の説明において、「n」は「1」以上の整数を示すものとし、また、「バッファ」を「BUF」と略記し、送信ディスクリプタを格納する「ディスクリプタメモリ」をTXと略記することがある。例えば、第一バッファ162(0)を「BUF0」と略記し、第二バッファ162(1)を「BUF1」と略記し、第nバッファ162(n-1)を「BUFn-1」と略記することがある。第一バッファ162(0)、第二バッファ162(1)、第nバッファ162(n-1)の各々を特に区別する必要がない場合には、単に「バッファ162」または「BUF」とすることがある。
同様に、第一ディスクリプタメモリ14(0)を「TX0」と略記し、第二ディスクリプタメモリ14(1)を「TX1」と略記し、第nディスクリプタメモリ14(n-1)を「TXn-1」と略記することがある。第一ディスクリプタメモリ14(0)、第二ディスクリプタメモリ14(1)、第nディスクリプタメモリ14(n-1)の各々を特に区別する必要がない場合には、単に「ディスクリプタメモリ14」または「TX」とすることがある。
さらに、第一リクエスタ15(0)、第二リクエスタ15(1)、第nリクエスタ15(n-1)の各々を特に区別する必要がない場合には、単に「リクエスタ15」とすることがある。
§1.適用例
本発明の一態様に係る通信コントローラ10(通信制御機器)についての理解を容易にするため、先ず、本発明が適用される場面の一例について、具体的には、通信コントローラ10を備えるPLC1を含む制御システム0の概要について、図2を用いて説明する。
本発明の一態様に係る通信コントローラ10(通信制御機器)についての理解を容易にするため、先ず、本発明が適用される場面の一例について、具体的には、通信コントローラ10を備えるPLC1を含む制御システム0の概要について、図2を用いて説明する。
(制御システムの概要)
図2は、制御システム0の概要を示す図である。制御システム0は、PLC1と、ネットワークハブ2と、各々がネットワークハブ2を介してPLC1に接続されているネットワーク3(1)および3(2)とを含んでいる。以下、ネットワーク3(1)と、ネットワーク3(2)とを特に区別する必要がない場合には、単に「ネットワーク3」と称することがある。ネットワーク3は、1つ以上のネットワークデバイスを含んでいる。
図2は、制御システム0の概要を示す図である。制御システム0は、PLC1と、ネットワークハブ2と、各々がネットワークハブ2を介してPLC1に接続されているネットワーク3(1)および3(2)とを含んでいる。以下、ネットワーク3(1)と、ネットワーク3(2)とを特に区別する必要がない場合には、単に「ネットワーク3」と称することがある。ネットワーク3は、1つ以上のネットワークデバイスを含んでいる。
図2に例示する制御システム0においては、ネットワークハブ2を介して、複数のネットワーク3が、PLC1に接続している。制御システム0における通信には、ギガ帯域が使用されてもよい。
PLC1は、制御システム0の全体を制御する制御装置であり、ネットワークハブ2は、PLC1と複数のネットワーク3との間の通信を管理するネットワークハブまたはネットワークスイッチである。図2に示す制御システム0においては、PLC1の1つのネットワークポート(すなわち、図1の送信ポート18)に対して、複数のネットワーク3が、例えば、ネットワーク3(1)および3(2)が、存在している。
ここで、ネットワーク3(1)および3(2)のいずれもが制御ネットワークであってもよいし、すなわち、PLC1と通信を行う全てのネットワーク3が制御ネットワークであってもよい。また、ネットワーク3(1)および3(2)のいずれか一方が制御ネットワークであり、他方がデータネットワークであってもよく、つまり、PLC1と通信を行うネットワーク3について、制御ネットワークとデータネットワークとが混在していてもよい。
例えば、ネットワーク3が制御ネットワークである場合、PLC1は、生産設備内の入力機器及び出力機器の制御を司る制御装置であり、また、ネットワークデバイスは、例えば、生産設備内の入力機器及び出力機器である。PLC1とネットワークデバイスとは、ネットワーク3を介してサイクリックに通信を行なうことで、INデータ及びOUTデータ(以下、「IOデータ」という)の送受信を行ない、PLC1は、生産設備の全体を制御する。すなわち、ネットワーク3が制御ネットワークである場合、制御システム0は、PLC1をマスタ装置(データ伝送を管理するマスタ装置)とし、ネットワークデバイスをスレーブ装置とするマスタ・スレーブ制御システムと捉えることができる。
ネットワーク3が制御ネットワークである場合、ネットワーク3は、EtherCAT(Ethernet for Control Automation Technology:登録商標)規格等の産業用イーサネット(登録商標)規格に準拠するものであってもよい。ネットワーク3が制御ネットワークである場合、ネットワーク3は、EtherNet/IP(登録商標)規格に準拠するものであってもよい。
以下では、図2におけるPLC1とネットワークデバイスとの間の通信(以下、「ネットワーク通信」とも称する)がEthernet規格に準拠する例について説明する。また、CPU30と通信コントローラ10とは、PCIe(Peripheral Component Interconnect Express)によって通信可能に接続されているものとする。
なお、図2には、ネットワークハブ2を介して、複数のネットワーク3が、PLC1に接続する制御システム0を例示したが、制御システム0において、PLC1に、複数のネットワーク3がネットワークハブ2を介して接続することは必須ではない。制御システム0において、1つのネットワーク3(特に、1つの制御ネットワーク)が、ネットワークハブ2を介さずに、PLC1に接続してもよい。例えば、マスタ・スレーブ制御システムである制御システム0において、マスタ装置であるPLC1と、各々がスレーブ装置である1つ以上のネットワークデバイスとを、一筆書きの形式で通信可能に接続してもよい。
(本実施形態に係る通信コントローラが実行する処理の概要)
以下に図1等を用いて詳細を説明していく通信コントローラ10について、その理解を容易にするため、通信コントローラ10が実行する処理を、以下のように整理しておく。
以下に図1等を用いて詳細を説明していく通信コントローラ10について、その理解を容易にするため、通信コントローラ10が実行する処理を、以下のように整理しておく。
すなわち、通信コントローラ10がソフトウェア(つまり、CPU30)から複数の送信要求(つまり、複数の送信ディスクリプタの実行要求)を略同時に受け付けると、通信コントローラ10のディスクリプタ実行管理部13は、選択処理を実行する。
選択処理において、先ず、ディスクリプタ実行管理部13(特に、選択部131)は、実行すべき複数の送信ディスクリプタ(ディスクリプタ)の各々について、「送信時刻TT」および「ソフトウェアが指定する優先度P」を取得する。そして、ディスクリプタ実行管理部13は、取得した「複数のディスクリプタの各々の、送信時刻TTおよび優先度P」を用いて、実行するディスクリプタを選択し、つまり、読み込むディスクリプタを選択する。詳細は後述するが、ディスクリプタ実行管理部13は、読み込むディスクリプタを選択する際に、「複数のディスクリプタの各々の、データサイズ(つまり、データ転送サイズ)」を利用してもよい。
ここで、CPUの処理負荷を軽減するため、ハードウェアによる論理回路で構成したNIC等によって、「送信データの、送信順序および実際の送信時刻(実送信時刻RTT)」の管理を行う構成が知られている。「実送信時刻RTT」とは、その送信データが実際に送信される時刻であり、実送信時刻RTTを送信時刻TTに一致させる送信を「時刻送信」とも称する。
「送信データの、送信順序および実送信時刻RTT」の管理を行うNICの一例において、「送信データの、送信順序および実送信時刻RTT」の管理を行う送信キューは、DMAC(Direct Memory Access Controller)および送信BUFを備えている。そして、そのようなNICの一例においては、「送信データの、送信順序および実送信時刻RTT」の管理を行うべき通信ネットワークごとに、「DMACおよび送信BUFを備える、送信キュー」が設けられている。
ただし、「送信データの、送信順序および実送信時刻RTT」の管理を行うべき通信ネットワークごとに、「DMACおよび送信BUFを備える、送信キュー」をNICに設けようとすると、以下の問題が発生する。すなわち、上述の管理を行うべき通信ネットワークの数が増えるにしたがって、「DMACおよび送信BUFを含む、送信キュー」の数も増えるため、NICの実装サイズが大きくなってしまう。
これに対して、通信コントローラ10は、上述の選択処理(特に、読み込むディスクリプタの選択処理)を実行することにより、「DMACおよび送信BUFを含む、送信キュー」を複数備える必要がない。
例えば、図1に例示する通信コントローラ10は、メインメモリ20から読み出した送信データを送信する前に一時的に保持しておくためのバッファ162を「2つ」備えているが、通信コントローラ10が備えるバッファ162は、「1つ」であってもよい。すなわち、通信コントローラ10は、実行すべき複数のディスクリプタを、望ましい順序で1つずつ実行するので、通信コントローラ10は、送信データを一時的に保持しておくためのバッファ162を、「1つ」備えていればよい。ただし、バッファ162を「2つ」以上備えることにより、通信コントローラ10は、或るディスクリプタを実行後に、それよりも優先度Pの高い別のディスクリプタを実行した場合に、その別のディスクリプタに対応するデータを優先して送信することができる。通信コントローラ10がバッファ162を「2つ」以上備える構成について、詳細は後述する。
また、図1に例示するように、通信コントローラ10は、実行すべき複数のディスクリプタを、望ましい順序で1つずつ実行することができるので、メインメモリ20とバッファ162との間のデータ交換を実現するDMAC12を、「1つ」備えていればよい。
したがって、通信コントローラ10は、「DMACおよび送信BUFを含む、送信キュー」を複数備える必要がないため、実装サイズを小さくすることができる。特に、「送信データの、送信順序および実送信時刻RTT」の管理を行うべき通信ネットワーク(ネットワーク3)の数が増えても、通信コントローラ10は、実装サイズの拡大を抑制することができる。
詳細は図1を用いて後述するが、通信コントローラ10は、「1つ」の送信ポート18、「1つ」のDMAC12を備えている。そして、通信コントローラ10は、「1つ」の送信ポート18、「1つ」のDMAC12に対して、「送信データの、送信順序および実送信時刻RTT」の管理を行う送信キューを複数備えている。具体的には、通信コントローラ10は、ディスクリプタメモリ14およびリクエスタ15の各々を、複数備え、また、実行すべき複数のディスクリプタを、望ましい順序で1つずつ実行するためのディスクリプタ実行管理部13を「1つ」備えている。通信コントローラ10は、複数のディスクリプタメモリ14と、複数のリクエスタ15と、ディスクリプタ実行管理部13とによって、「送信データの、送信順序および実送信時刻RTT」の管理を行う送信キューを複数備えているのと同様の効果を実現する。したがって、通信コントローラ10は、実装サイズを抑制しつつ、送信キューを複数備えているのと同様に、「送信データの、送信順序および実送信時刻RTT」を管理することができる。
例えば、通信コントローラ10は、FPGA(Field-Programmable gate array)またはASIC(Application Specific Integrated Circuit)等のハードウェアによる論理回路で構成される。その場合、ソフトウェア(つまり、CPU30)は、通信コントローラ10を、「送信データの、送信順序および実送信時刻RTT」を管理する送信キューを複数備えたハードウェアとして取り扱うことができる。したがって、通信コントローラ10をハードウェアによる論理回路で構成することにより、「送信データの、送信順序および実送信時刻RTT」の管理を行う通信コントローラ10は、ソフトウェア(つまり、CPU30)の処理負荷を低減することができる。
したがって、通信コントローラ10は以下のように整理することができる。すなわち、通信コントローラ10(通信制御機器)は、読み込んだ送信ディスクリプタに従ってメインメモリ20からバッファ162(送信バッファ)へとデータ(送信データ)を転送し、バッファ162に転送されたデータを送信する通信制御機器である。
通信コントローラ10は、選択部131および読込部132を備えている。選択部131は、複数の送信ディスクリプタの各々において規定されている、「送信時刻TT(送信予定時刻)」および「優先度P(実行優先度)」の少なくとも一方に基づいて、複数の送信ディスクリプタの中から、読み込む送信ディスクリプタを選択する。すなわち、選択部131は、複数の送信ディスクリプタの各々において規定されている、「送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、複数の送信ディスクリプタの中から、実行する送信ディスクリプタを選択する。また、読込部132は、選択部131によって選択された送信ディスクリプタを読み込み、つまり、選択部131によって選択された送信ディスクリプタを実行する。
前記の構成によれば、通信コントローラ10は、複数の送信ディスクリプタの各々において規定されている、送信時刻TTおよび優先度Pの少なくとも一方に基づいて、複数の送信ディスクリプタの中から、読み込むディスクリプタを選択する。そして、通信コントローラ10は、選択した送信ディスクリプタを読み込み、読み込んだ送信ディスクリプタに従って、メインメモリ20からバッファ162へと送信データを転送する。つまり、通信コントローラ10は、複数の送信ディスクリプタの中から、読み込むべきディスクリプタを、複数の送信ディスクリプタの各々の送信時刻TTおよび優先度Pの少なくとも一方に基づいて、1つずつ選択する。
そのため、通信コントローラ10は、各々がDMACおよび送信バッファを含む、複数の送信キューを備える必要がなく、実装サイズを小さくすることができる。
また、通信コントローラ10は、複数の送信ディスクリプタの読込順序を制御することによって、ソフトウェア(プロセッサ、つまり、CPU30)による処理結果の出力等を、具体的には、「送信データの、送信順序および実送信時刻RTT」を制御する。つまり、ソフトウェアは、通信コントローラ10を、「送信データの、送信順序および実送信時刻RTT」の管理を行う送信キューを複数備えた、1つのハードウェアとして扱うことができる。そのため、通信コントローラ10は、処理結果の出力制御(例えば、「送信データの、送信順序および実送信時刻RTT」の管理)等に係るソフトウェアの処理負荷を低減することができる。
したがって、通信コントローラ10は、実装サイズを抑制しつつ、ソフトウェアの処理負荷を低減することができるとの効果を奏する。
通信コントローラ10において、バッファ162は、通常送信バッファと特別送信バッファとに大別される。通常送信バッファには、読込部132が読み込んだ送信ディスクリプタの順に、送信ディスクリプタに対応するデータが格納される。特別送信バッファには、「以下の2つの条件を共に満たすディスクリプタ」に対応するデータが格納される。条件1は、「『通常送信バッファに格納されているデータに対応する送信ディスクリプタを選択部131が選択してから、そのデータが送信されるまで』の間に、読込部132が読み込んだディスクリプタであること」である。条件2は、「通常送信バッファに格納されているデータに対応する送信ディスクリプタよりも、優先度Pが高い」である。
第一バッファ162(0)、第二バッファ162(1)、・・・、第nバッファ162(n-1)のうち、少なくとも1つを特別送信バッファとし、それ以外のバッファ162を、通常送信バッファとしてもよい。
前記の構成によれば、通信コントローラ10は、前記通常送信バッファと前記特別送信バッファとを含むバッファ162を備えている。そして、通信コントローラ10は、通常は、読み込んだ送信ディスクリプタの順に、読み込んだ送信ディスクリプタに対応するデータを、前記通常送信バッファに格納する。
通信コントローラ10は、「前記通常送信バッファに格納されているデータに対応する送信ディスクリプタを選択してから、前記通常送信バッファに格納されているデータを送信するまで」の間に新たなディスクリプタを読み込むと、以下の判定を実行する。すなわち、通信コントローラ10は、その新たなディスクリプタの優先度Pが、前記通常送信バッファに格納されているデータに対応する送信ディスクリプタの優先度Pよりも高いかを判定する。
そして、その新たなディスクリプタの優先度Pの方が高い場合、通信コントローラ10は、その新たなディスクリプタに対応するデータを、前記特別送信バッファに格納する。これに対して、その新たなディスクリプタの優先度Pの方が低い、または、両者の優先度Pが同じ場合、通信コントローラ10は、その新たなディスクリプタに対応するデータを、前記普通送信バッファに格納する。
ここで、選択部131が或る送信ディスクリプタを選択してから、その或る送信ディスクリプタに対応するデータが送信されるまでの間に、その或る送信ディスクリプタより優先度Pが高い別のディスクリプタを読込部132が読み込む可能性がある。そのような場合、送信バッファが1つしかなかったとしたら、その別のディスクリプタに対応するデータは、1つしかない送信バッファに、その或る送信ディスクリプタに対応するデータよりも後に格納されざるを得ない。その結果、その別のディスクリプタに対応するデータを、その或る送信ディスクリプタに対応するデータよりも先に送信することは不可能となる。
これに対して、通信コントローラ10は、前記通常送信バッファと前記特別送信バッファとを含むバッファ162を備えている。そして、通信コントローラ10は、上述の通り、前記通常送信バッファに格納されているデータよりも優先して送信すべきデータが新たに発生すると、そのようなデータを前記特別送信バッファに格納する。
したがって、通信コントローラ10は、或る送信ディスクリプタの選択後、その或る送信ディスクリプタに対応するデータを送信するまでに発生した、その或る送信ディスクリプタに対応するデータより優先送信すべきデータを、優先送信できるとの効果を奏する。
§2.構成例
これまでに概要を説明してきた通信コントローラ10、および、通信コントローラ10を含むPLC1について、次に、図1を用いてその詳細を説明していく。
これまでに概要を説明してきた通信コントローラ10、および、通信コントローラ10を含むPLC1について、次に、図1を用いてその詳細を説明していく。
図1は、PLC1の構成例を示す図である。図1に例示する通り、PLC1は、ハードウェア構成として、通信コントローラ10と、メインメモリ20と、CPU30とを含む。PLC1は、さらに、不図示の不揮発性メモリ、および、外部装置とPLC1とを接続するためのUSBコネクタなどを含んでもよい。通信コントローラ10と、メインメモリ20と、CPU30と、不揮発性メモリとの間は、各種のバス(内部バス)を介してそれぞれ結合されている。
CPU30は、典型的には、汎用的なコンピュータアーキテクチャに準じて構成され、内部クロックに従って順次命令コードを解釈して実行する。CPU30は、ハードウェア構成としては、1つ以上のCPUコアと、ネットワーク制御部とを含んでいる。
CPU30は、各種の演算処理を実行し、実行結果として生成したデータを、送信データとしてメインメモリ20に格納する。また、CPU30は、送信データとしてメインメモリ20に格納したデータについて、その送信データの優先度P、送信時刻TT、メインメモリ20中のアドレス、データサイズ等を規定したディスクリプタデータを、メインメモリ20に格納する。送信データの優先度P、送信時刻TT、メインメモリ20中のアドレス、データサイズ等を規定したディスクリプタデータは、「送信ディスクリプタ」、または、単に「ディスクリプタ」と略記することがある。
送信データの「送信時刻TT」は、CPU30によって付与され、通信コントローラ10がその送信データをネットワーク3へと送信する時刻を示しており、つまり、その送信データがネットワーク3へと送信されるべき、送信予定時刻を示している。また、送信データの「優先度P」は、CPU30によって付与され、「その送信データを『送信時刻TT』に送信する」必要性の高さを示し、例えば、「その送信データを、送信周期を維持して、ネットワーク3へと周期的に送信する」必要性の高さを示している。
ここで、一般的に、PLC1などの産業用コントローラとデバイス(例えば、図2の「ネットワークデバイス」)とは、一定周期でデータ交換を実行する。制御システム0においては、1つ以上のネットワークデバイスを含むユニット群について、1つ以上のデータ交換周期、および、そのユニット群の通信優先度CPが設定されていてもよい。
そして、通信優先度CPと優先度Pとは対応付けられていてもよい。また、或るユニット群(例、ユニット群U1)の通信優先度CPが、別のユニット群(例、ユニット群U2)の通信優先度CPよりも高いことは、その或るユニット群の通信周期を維持する必要が、その別のユニット群より高いことを意味してもよい。さらに、或るユニット群(例、ユニット群U1)の通信優先度CPが、別のユニット群(例、ユニット群U2)の通信優先度CPよりも高いことは、その或るユニット群の通信周期が、その別のユニット群の通信周期よりも早い(短い)ことを意味してもよい。
例えば、「PLC1(特に、通信コントローラ10)が或るネットワークデバイスとの間で実行する周期的な通信」は、「PLC1が別のネットワークデバイスとの間で実行する周期的な通信」よりも、通信周期を維持する必要が高いことがある。そのような場合には、「その或るネットワークデバイスとの間で実行する周期的な通信」の通信優先度CPは、「その別のネットワークデバイスとの間で実行する周期的な通信」の通信優先度CPよりも高い。
また、「PLC1(特に、通信コントローラ10)が或るネットワークデバイスとの間で実行する周期的な通信」は、「PLC1が別のネットワークデバイスとの間で実行する周期的な通信」よりも、通信周期が短い(早い)ことがある。そのような場合には、「その或るネットワークデバイスとの間で実行する周期的な通信」の通信優先度CPは、「その別のネットワークデバイスとの間で実行する周期的な通信」の通信優先度CPよりも高い。
そして、「或るネットワークデバイスとの間で実行する周期的な通信」の通信優先度CPが「別のネットワークデバイスとの間で実行する周期的な通信」の通信優先度CPより高い場合、CPU30は、送信データに対し、以下のように優先度Pを付与する。すなわち、CPU30は、「その或るネットワークデバイスを宛先とする送信データ」には、「その別のネットワークデバイスを宛先とする送信データ」に付与する優先度Pよりも高い優先度Pを付与する。
メインメモリ20は、PLC1の記憶手段であり、例えば、PLC1(特に、通信コントローラ10)がネットワーク3へと送信するデータ(送信データ)が格納される。メインメモリ20は、揮発性の記憶領域(RAM)であり、「CPU30による各種の演算処理によって生成され、ネットワーク3へと送信される」送信データの格納に加えて、PLC1へ電源投入後にCPU30で実行されるべき各種プログラムを保持する。また、メインメモリ20は、CPU30による各種プログラムの実行時の作業用メモリとしても使用される。このようなメインメモリ20として、例えば、DRAM(Dynamic Random Access Memory)、SRAM(Static Random Access Memory)等を用いることができる。
図1に例示するメインメモリ20には、送信データと共に、送信データに対応するディスクリプタデータ(送信ディスクリプタ)が格納されている。送信ディスクリプタは、対応する送信データの送信時刻TT、優先度P、および、データサイズ等を示す情報を含んでいる。
PLC1は、各種のプログラムおよびパラメータなどのデータを不揮発的に保持する不揮発性メモリを備えていてもよい。不揮発性メモリに格納されるこれらのデータは、必要に応じて、CPU30がアクセスできるようにメインメモリ20にコピーされる。このような不揮発性メモリは、フラッシュメモリのような半導体メモリを用いることができる。あるいは、ハードディスクドライブのような磁気記録媒体、DVD-RAM(Digital Versatile Disk Random Access Memory)のような光学記録媒体などを用いることもできる。
通信コントローラ10は、メインメモリ20に格納されているデータ(送信データ)をネットワーク3へと送信する通信制御機器であり、例えば、NIC(Network Interface Card、ネットワーク・インターフェイス・カード)として実現される。通信コントローラ10は、典型的には、FPGA(Field-Programmable gate array)またはASIC(Application Specific Integrated Circuit)等のハードウェアによる論理回路で構成される。通信コントローラ10は、メインメモリ20およびCPU30の各々と、データの送受信が可能に構成されている。
通信コントローラ10は、送信ポート18を介してネットワーク3と接続され、ネットワーク3とのデータの遣り取りを制御し、特に、送信データの送信を制御し、例えば、「送信データの、送信順序および実送信時刻RTT」を制御する。通信コントローラ10は、例えば、ネットワーク3における物理層およびデータリンク層の機能を提供する。すなわち、通信コントローラ10は、ネットワーク3の準拠する規格に従い、送信データの送信および受信データの受信を制御する。具体的には、通信コントローラ10は、メインメモリ20に格納されているデータ(送信データ)を自装置内のバッファ162へと転送し、バッファ162に格納した送信データを、ネットワーク3に接続されているネットワークデバイスへと送信する。
通信コントローラ10は、送信ディスクリプタに規定されている内容に従って送信データを送信し、例えば、送信ディスクリプタに規定されている送信時刻TTに、その送信ディスクリプタに対応する送信データを送信する。通信コントローラ10が、送信データを、その送信データについて設定されている送信時刻TT(つまり、その送信データに対応する送信ディスクリプタで規定されている送信時刻TT)で送信することを「時刻送信」とも称する。
ここで、通信コントローラ10は、複数の送信データの送信順序を、それら複数の送信データをバッファ162に格納する順序によって制御し、具体的には、それら複数の送信データに対応する複数のディスクリプタの読込順序(実行順序)を制御する。特に、通信コントローラ10は、複数の送信ディスクリプタの各々において規定されている、送信時刻TTおよび優先度Pの少なくとも一方に基づいて、優先的に読み込む送信ディスクリプタを選択する。
詳細は後述するが、PLC1は、CPU30ではなく、ハードウェアによる論理回路で構成した通信コントローラ10によって、メインメモリ20に格納されているデータ(送信データ)の、ネットワーク3への送信順序および実送信時刻RTTを制御する。したがって、PLC1は、CPU30の処理負荷を増大させることなく、ハードウェアによる論理回路で構成した通信コントローラ10によって、送信データの、ネットワーク3への送信順序および実送信時刻RTTを制御することができるとの効果を奏する。
図1に例示する通信コントローラ10は、機能ブロックとして、IF11、DMAC12、ディスクリプタ実行管理部13、2つ以上のディスクリプタメモリ14、2つ以上のリクエスタ15、BUF管理部16、調停部17、および、送信ポート18を備える。
IF11は、通信コントローラ10(特に、DMAC12)が、メインメモリ20およびCPU30の各々と通信するためのインターフェースである。
DMAC12は、メインメモリ20と、ディスクリプタメモリ14およびバッファ162の各々との間のデータ交換を実行する。例えば、DMAC12は、CPU30によってメインメモリ20に設定されたディスクリプタデータ(送信ディスクリプタ)を読み出して、ディスクリプタメモリ14に格納する。
また、DMAC12は、送信ディスクリプタに規定されている内容に従って、メインメモリ20からバッファ162へと送信データを転送し、つまり、メインメモリ20に格納されているデータを取得して、取得したデータをバッファ162に格納する。例えば、DMAC12は、送信ディスクリプタに規定されている、「メインメモリ20のアドレス」および「送信データのデータサイズ」によって特定される送信データを、メインメモリ20から取得する。DMAC12は、送信ディスクリプタに対応する送信データを、その送信ディスクリプタに規定されている「送信時刻TT」と共に、バッファ162へと転送する。
DMAC12は、「ディスクリプタメモリ14に格納されている送信ディスクリプタであって、ディスクリプタ実行管理部13によって読み出された(実行された)送信ディスクリプタ」に従って、メインメモリ20からバッファ162へと送信データを転送する。
ディスクリプタ実行管理部13は、CPU30からの送信要求があると、その送信要求に従って、メインメモリ20からバッファ162へと送信データを転送する。具体的には、ディスクリプタ実行管理部13は、リクエスタ15から「実行すべき(読み込むべき)送信ディスクリプタがある」ことを通知されると、ディスクリプタメモリ14を参照して、送信ディスクリプタを読み込む(実行する)。そして、ディスクリプタ実行管理部13は、読み込んだ送信ディスクリプタに規定されている内容をDMAC12に設定し、読み込んだ送信ディスクリプタに従って、DMAC12に、送信データをメインメモリ20からバッファ162へと転送させる。ディスクリプタ実行管理部13は、選択部131および読込部132を含んでいる。
選択部131は、リクエスタ15から「実行すべき(読み込むべき)送信ディスクリプタがある」旨を通知されると、そのリクエスタ15に対応するディスクリプタメモリ14を参照し、ディスクリプタメモリ14に格納されている送信ディスクリプタを取得する。例えば、選択部131は、第一リクエスタ15(0)から「読み込むべき送信ディスクリプタがある」ことを通知されると、第一リクエスタ15(0)に対応する第一ディスクリプタメモリ14(0)に格納されている送信ディスクリプタを取得する。同様に、選択部131は、第nリクエスタ15(n-1)から「読み込むべき送信ディスクリプタがある」ことを通知されると、第nリクエスタ15(n-1)に対応する第nディスクリプタメモリ14(n-1)に格納されている送信ディスクリプタを取得する。
選択部131は、リクエスタ15からの「読み込むべき送信ディスクリプタがある」旨の通知に応じて、そのリクエスタ15に対応するディスクリプタメモリ14から送信ディスクリプタを取得し、取得した送信ディスクリプタを読込部132に通知する。
選択部131は、複数のリクエスタ15の各々から略同時に「読み込むべき送信ディスクリプタがある」ことを通知されると、読み込む(実行する)送信ディスクリプタの順序を決定し、つまり、優先的に読み込む送信ディスクリプタを1つずつ選択する。そして、選択部131は、選択した送信ディスクリプタを読込部132に通知する。
具体的には、選択部131は、複数のリクエスタ15の各々から略同時に「読み込むべき送信ディスクリプタがある」ことを通知されると、複数のリクエスタ15の各々に対応するディスクリプタメモリ14を参照する。そして、選択部131は、「各々が、複数のリクエスタ15の各々に対応する」複数のディスクリプタメモリ14の各々に格納されている送信ディスクリプタを取得する。
選択部131は、「各々が、複数のディスクリプタメモリ14の各々に格納されている」複数の送信ディスクリプタの各々の、「送信時刻TTおよび優先度Pの少なくとも一方」を取得する。そして、選択部131は、複数の送信ディスクリプタの各々の「送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、それら複数の送信ディスクリプタの読込順序を決定し、つまり、それら複数の送信ディスクリプタの実行順序を決定する。具体的には、選択部131は、複数の送信ディスクリプタの各々の「送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、それら複数の送信ディスクリプタの中から、優先的に(つまり、より早く)読み込む送信ディスクリプタを1つずつ選択する。
例えば、選択部131は、第一リクエスタ15(0)および第二リクエスタ15(1)の各々から、略同時に、「読み込むべき送信ディスクリプタがある」ことを通知されると、以下の処理を実行する。すなわち、選択部131は、第一リクエスタ15(0)に対応する第一ディスクリプタメモリ14(0)を参照して、第一ディスクリプタメモリ14(0)に格納されている送信ディスクリプタ(例えば、ディスクリプタA)を取得する。同様に、選択部131は、第二リクエスタ15(1)に対応する第二ディスクリプタメモリ14(1)を参照して、第二ディスクリプタメモリ14(1)に格納されている送信ディスクリプタ(例えば、ディスクリプタB)を取得する。
選択部131は、ディスクリプタAおよびディスクリプタBの各々の「送信時刻TTおよび優先度Pの少なくとも一方」を取得する。そして、選択部131は、ディスクリプタAおよびディスクリプタBの各々の「送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、ディスクリプタAおよびディスクリプタBの読込順序を決定する。
具体的には、選択部131は、ディスクリプタAおよびディスクリプタBの各々の「送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、ディスクリプタAおよびディスクリプタBのうち、先に読み込む送信ディスクリプタを選択する。そして、選択部131は、選択した送信ディスクリプタを読込部132に通知する。選択部131は、ディスクリプタAおよびディスクリプタBのうち、先に読み込む送信ディスクリプタとしてディスクリプタAを選択すると、ディスクリプタAを読込部132に通知する。また、選択部131は、ディスクリプタAおよびディスクリプタBのうち、先に読み込む送信ディスクリプタとしてディスクリプタBを選択すると、ディスクリプタBを読込部132に通知する。
読込部132は、選択部131から送信ディスクリプタを通知されると、通知された送信ディスクリプタを読み込み、つまり、選択部131から通知された送信ディスクリプタを実行する。読込部132は、読み込んだ送信ディスクリプタに規定されている内容をDMAC12に設定し、つまり、読み込んだ送信ディスクリプタに規定されている内容をDMAC12に通知する。そして、読込部132は、DMAC12に、読み込んだ送信ディスクリプタに規定されている内容に従った転送処理を実行させ、つまり、DMAC12に、読み込んだ送信ディスクリプタに従って送信データをメインメモリ20からバッファ162へと転送させる。
ディスクリプタメモリ14には、送信ディスクリプタ(ディスクリプタデータ)が、FIFO(first in, first out、先入れ先出し)方式で格納される。CPU30が、ディスクリプタデータのメインメモリ20への設定(格納)を完了して、通信コントローラ10に送信要求を発行すると、通信コントローラ10は、メインメモリ20からディスクリプタデータを読み出してディスクリプタメモリ14に格納する。
リクエスタ15は、要求レジスタを含んでおり、対応するディスクリプタメモリ14に送信ディスクリプタが格納されると、リクエスタ15の要求レジスタには「1」が格納される。要求レジスタに「1」が格納されている間、リクエスタ15は、ディスクリプタ実行管理部13(特に、選択部131)に、「実行すべき(読み込むべき)送信ディスクリプタがある」ことを通知し続ける。
また、対応するディスクリプタメモリ14に格納されている送信ディスクリプタが読み込まれ、その送信ディスクリプタに対応するデータのバッファ162への転送が完了すると、リクエスタ15の要求レジスタには「0」が格納される。要求レジスタに「0」が格納されている間、リクエスタ15は、ディスクリプタ実行管理部13(特に、選択部131)に、「実行すべき送信ディスクリプタがない」ことを通知し、または、「実行すべき送信ディスクリプタがある」ことを通知しない。
例えば、ディスクリプタAが第一ディスクリプタメモリ14(0)に格納されると、第一ディスクリプタメモリ14(0)に対応する第一リクエスタ15(0)の要求レジスタには「1」が格納される。そして、ディスクリプタAが読み込まれ、ディスクリプタAに対応するデータのバッファ162への転送が完了すると、第一ディスクリプタメモリ14(0)の要求レジスタには「0」が格納される。
同様に、ディスクリプタBが第二ディスクリプタメモリ14(1)に格納されると、第二ディスクリプタメモリ14(1)に対応する第二リクエスタ15(1)の要求レジスタには「1」が格納される。そして、ディスクリプタBが読み込まれ、ディスクリプタBに対応するデータのバッファ162への転送が完了すると、第二ディスクリプタメモリ14(1)の要求レジスタには「0」が格納される。
リクエスタ15はさらに、設定レジスタ151を含んでいる。設定レジスタ151には、CPU30から通信コントローラ10へと通知される、「実行個数」および「実行番号」が格納される。「実行個数」および「実行番号」について、詳細は後述する。
BUF管理部16は、送信データの送信順序および実送信時刻RTTを制御し、具体的には、送信データを、その送信データについて設定されている送信時刻TTに、ネットワーク3へと送信し、または、送信しようとする。BUF管理部16は、時刻指定送信管理部161およびバッファ162を含んでいる。
時刻指定送信管理部161は、バッファ162に格納されている送信データを、その送信データについて設定されている送信時刻TTで送信し、つまり、その送信データに対応する送信ディスクリプタで規定されている送信時刻TTで送信する。具体的には、時刻指定送信管理部161は、データ(送信データ)がバッファ162に格納されていると、その送信データに対応する送信ディスクリプタで規定されている送信時刻TTを確認する。そして、時刻指定送信管理部161は、現在時刻CTが確認した送信時刻TTになると、送信リクエストを調停部17に出力する。時刻指定送信管理部161は、送信リクエストを受け付けた調停部17からのレスポンスとして、アクセス許可があると、その送信データをネットワーク3に送信する。
バッファ162は、メインメモリ20に格納されているデータ(送信データ)をネットワーク3へと送信するために、送信データ(受信データ)を一時的に保持しておく。バッファ162には、ネットワーク3へと送信される送信データが、DMAC12によってFIFO(first in, first out、先入れ先出し)方式で格納される。
調停部17は、ネットワーク3への複数の送信リクエストを調整し、つまり、複数のバッファ162の各々に格納されている送信データの送信時刻TTが略同時となった場合に、いずれの送信データの時刻送信を優先すべきかを決定する。言い換えれば、調停部17は、複数のバッファ162の各々に格納されている送信データに係る送信リクエストを略同時に受け付けると、アクセス許可を与える送信リクエストを選択する。
ここで、バッファ162が、通常送信バッファと特別送信バッファとに大別され、通常送信バッファおよび特別送信バッファの各々に格納されている送信データに係る送信リクエストを略同時に受け付けると、調停部17は、以下の処理を実行する。すなわち、調停部17は、特別送信バッファに格納されている送信データに係る送信リクエストを、通常送信バッファに格納されている送信データに係る送信リクエストよりも優先する。つまり、調停部17は、特別送信バッファに格納されている送信データに係る送信リクエストにアクセス許可を与える。
§3.動作例
(通信コントローラによって実行される処理の全体概要)
図3は、通信コントローラ10の実行する処理の概要を説明するフロー図である。図3に示すように、先ず、ディスクリプタ実行管理部13(特に、選択部131)は、複数のディスクリプタの各々において規定されている、送信時刻TTおよび優先度Pの少なくとも一方を取得する(S10)。そして、選択部131は、取得した「複数のディスクリプタの各々の、送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、複数のディスクリプタの中から、読み込むディスクリプタを選択する(S20)。選択部131は、読み込むディスクリプタを選択すると、選択したディスクリプタを、読込部132に通知する。
(通信コントローラによって実行される処理の全体概要)
図3は、通信コントローラ10の実行する処理の概要を説明するフロー図である。図3に示すように、先ず、ディスクリプタ実行管理部13(特に、選択部131)は、複数のディスクリプタの各々において規定されている、送信時刻TTおよび優先度Pの少なくとも一方を取得する(S10)。そして、選択部131は、取得した「複数のディスクリプタの各々の、送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、複数のディスクリプタの中から、読み込むディスクリプタを選択する(S20)。選択部131は、読み込むディスクリプタを選択すると、選択したディスクリプタを、読込部132に通知する。
読込部132は、選択部131によって選択されたディスクリプタを読み込む(S30)。読込部132は、読み込んだディスクリプタに規定されているアドレス(メインメモリ20における格納先アドレス)、送信データのデータサイズ等を、DMAC12に設定する(S40)。
DMAC12は、S40において設定された内容に従って、メインメモリ20に格納されている送信データをバッファ162へと転送する(すなわち、送信データをバッファ162に格納する)(S50)。そして、BUF管理部16は、バッファ162に格納されている送信データを送信する(S60)。
これまで図3を用いて説明してきた通信コントローラ10の実行する処理は、以下のように整理することができる。すなわち、通信コントローラ10の実行する処理(制御方法)は、読み込んだ送信ディスクリプタに従ってメインメモリ20からバッファ162へとデータ(送信データ)を転送し、バッファ162に転送されたデータを送信する通信制御機器の制御方法である。
通信コントローラ10の実行する制御方法は、選択ステップ(S20)と、読込ステップ(S30)と、を含んでいる。選択ステップは、複数の送信ディスクリプタの各々において規定されている、「送信時刻TT」および「優先度P」の少なくとも一方に基づいて、複数の送信ディスクリプタの中から、読み込むディスクリプタを選択する処理である。すなわち、選択ステップは、複数の送信ディスクリプタの各々において規定されている、「送信時刻TTおよび優先度Pの少なくとも一方」に基づいて、複数の送信ディスクリプタの中から、実行する送信ディスクリプタを選択する処理である。また、読込ステップは、選択ステップにて選択された送信ディスクリプタを読み込む処理であり、つまり、選択ステップにて選択された送信ディスクリプタを実行する処理である。
前記の構成によれば、通信コントローラ10の実行する制御方法は、複数の送信ディスクリプタの各々において規定されている、送信時刻TTおよび優先度Pの少なくとも一方に基づいて、複数の送信ディスクリプタの中から、読み込むディスクリプタを選択する。そして、通信コントローラ10の実行する制御方法は、選択した送信ディスクリプタを読み込み、読み込んだ送信ディスクリプタに従って、メインメモリ20からバッファ162へと送信データを転送する。つまり、通信コントローラ10の実行する制御方法は、複数の送信ディスクリプタの中から、読み込むべきディスクリプタを、複数の送信ディスクリプタの各々の送信時刻TTおよび優先度Pの少なくとも一方に基づいて、1つずつ選択する。
そのため、前記制御方法を実行する通信コントローラ10は、各々がDMACおよび送信バッファを含む、複数の送信キューを備える必要がなく、通信コントローラ10の実装サイズを小さくすることができる。
また、前記制御方法(つまり、通信コントローラ10の実行する制御方法)は、複数の送信ディスクリプタの読込順序を制御することによって、ソフトウェア(プロセッサ)による処理結果の出力等を、具体的には、前記データの送信順序を制御する。つまり、ソフトウェアは、前記制御方法を実行する通信コントローラ10を、「送信データの、送信順序および実送信時刻RTT」の管理を行う送信キューを複数備えた、1つのハードウェアとして扱うことができる。そのため、前記制御方法は、処理結果の出力制御(例えば、「送信データの、送信順序および実送信時刻RTT」の管理)等に係るソフトウェアの処理負荷を低減することができる。
したがって、通信コントローラ10の実行する制御方法は、通信コントローラ10の実装サイズを抑制しつつ、ソフトウェアの処理負荷を低減することができるとの効果を奏する。
上述の通り、通信コントローラ10は、送信時刻TTおよび優先度Pの少なくとも一方を用いて、読み込むべきディスクリプタ(つまり、実行すべきディスクリプタ)を選択し、つまり、複数のディスクリプタの読込順序(実行順序)を制御する。したがって、通信コントローラ10は、実装サイズを抑制しつつ、ソフトウェア(つまり、CPU30)の処理負荷を、特に、「送信データの、送信順序および実送信時刻RTT」の管理に係る処理負荷を、低減することができる。
ここで、通信コントローラ10の開発者はさらに、以下のケース1、ケース2、および、ケース3を想定して、通信コントローラ10がこれら3つのケースに直面した場合にも、読み込むべきディスクリプタを好適に選択できるように工夫した。以下、詳細を説明する。
(ケース1において、優先度のみでディスクリプタを選択した場合について)
図4は、ケース1において、ディスクリプタ中の優先度Pのみに基づいて、先に実行すべき(つまり、先に読み込むべき)ディスクリプタを選択した場合に発生する状況を説明する図である。ケース1では、低い優先度Pが設定されているディスクリプタの規定する送信時刻TT(低優先)が、高い優先度Pが設定されているディスクリプタの規定する送信時刻TT(高優先)より早く、かつ、両者の送信時刻TTの間の時間間隔が大きい。以下では、低い優先度Pが設定されているディスクリプタを「低優先ディスクリプタ」と称し、また、高い優先度Pが設定されているディスクリプタを「高優先ディスクリプタ」と称することがある。図4において、通信コントローラ10は、「NIC(Network Interface Card、ネットワーク・インターフェイス・カード)」と略記されている。
図4は、ケース1において、ディスクリプタ中の優先度Pのみに基づいて、先に実行すべき(つまり、先に読み込むべき)ディスクリプタを選択した場合に発生する状況を説明する図である。ケース1では、低い優先度Pが設定されているディスクリプタの規定する送信時刻TT(低優先)が、高い優先度Pが設定されているディスクリプタの規定する送信時刻TT(高優先)より早く、かつ、両者の送信時刻TTの間の時間間隔が大きい。以下では、低い優先度Pが設定されているディスクリプタを「低優先ディスクリプタ」と称し、また、高い優先度Pが設定されているディスクリプタを「高優先ディスクリプタ」と称することがある。図4において、通信コントローラ10は、「NIC(Network Interface Card、ネットワーク・インターフェイス・カード)」と略記されている。
図4に例示するケース1において、TX0、つまり、第一ディスクリプタメモリ14(0)には、送信データD(0)の送信時刻TT(0)として「9:05」を規定し、送信データD(0)の優先度Pとして「1」を規定したディスクリプタが格納されている。また、TX1、つまり、第二ディスクリプタメモリ14(1)には、送信データD(1)の送信時刻TT(1)として「9:00」を規定し、送信データD(1)の優先度Pとして「2」を規定したディスクリプタが格納されている。
つまり、ケース1において、TX0には高優先ディスクリプタが格納され、TX1には低優先ディスクリプタが格納されている。TX0に格納されている高優先ディスクリプタが規定する、送信データD(0)の「送信時刻TT(0)」は「9:05」であり、TX1に格納されている低優先ディスクリプタが規定する、送信データD(1)の「送信時刻TT(1)」は「9:00」である。低優先ディスクリプタの規定する送信時刻TT(1):「9:00」は、高優先ディスクリプタの規定する送信時刻TT(0):「9:05」より早い。また、送信データD(1)の送信時刻TT(1):「9:00」と、送信データD(0)の送信時刻TT(0):「9:05」との間の時間間隔は「5」であり、両者の送信時刻TTの間の時間間隔は大きい。つまり、低優先ディスクリプタの規定する送信時刻TT(低優先)が、高優先ディスクリプタの規定する送信時刻TT(高優先)よりも早く、かつ、送信時刻TT(低優先)と送信時刻TT(高優先)との間の時間間隔が大きい。
ケース1において、ディスクリプタの規定する「優先度P」だけで、先に実行するディスクリプトを選択した場合、TX0に格納されている高優先ディスクリプタが、TX1に格納されている低優先ディスクリプタよりも先に実行される。
低優先ディスクリプタよりも先に高優先ディスクリプタが実行されることで、高優先ディスクリプタに対応するデータD(0)は、低優先ディスクリプタに対応するデータD(1)よりも先に、バッファ162(BUF)に格納される。
図4に示す例では、データD(0)がBUF0、つまり、第一バッファ162(0)に格納された後に、データD(1)は、BUF1、つまり、第二バッファ162(1)に格納されている。なお、データD(0)を格納するバッファ162と、データD(1)を格納するバッファ162とを分けることは必須ではなく、両者は同じバッファ162に格納されてもよい。例えば、データD(0)とデータD(1)とは、各々に対応するディスクリプタが実行された(読み込まれた)順で、同じバッファ162に格納されてもよい。図4では、データD(0)が、データD(1)よりも先に、バッファ162(BUF)に格納されることを理解しやすいように、データD(0)をBUF0に格納し、データD(1)をBUF1に格納する例を示したに過ぎない。
データD(1)よりも先にデータD(0)がバッファ162に格納されることで、データD(1)のネットワーク3への送信は、データD(0)がネットワーク3へと送信された後に実行される。つまり、送信データD(0)が、その送信時刻TT(0):「9:05」にネットワーク3へと送信された後に、データD(1)のネットワーク3への送信が実行される。そのため、送信データD(1)を、その送信時刻TT(1)である「9:00」に、ネットワーク3へと送信することはできない。
(ケース2において、送信時刻のみでディスクリプタを選択した場合について)
図5は、ケース2において、ディスクリプタ中の送信時刻TTのみに基づいて、先に実行すべき(つまり、先に読み込むべき)ディスクリプタを選択した場合に発生する状況を説明する図である。ケース2では、低優先ディスクリプタの規定する送信時刻TT(低優先)が、高優先ディスクリプタの規定する送信時刻TT(高優先)より早く、かつ、送信時刻TT(低優先)と送信時刻TT(高優先)との間の時間間隔が小さい。図5において、通信コントローラ10は、「NIC」と略記されている。
図5は、ケース2において、ディスクリプタ中の送信時刻TTのみに基づいて、先に実行すべき(つまり、先に読み込むべき)ディスクリプタを選択した場合に発生する状況を説明する図である。ケース2では、低優先ディスクリプタの規定する送信時刻TT(低優先)が、高優先ディスクリプタの規定する送信時刻TT(高優先)より早く、かつ、送信時刻TT(低優先)と送信時刻TT(高優先)との間の時間間隔が小さい。図5において、通信コントローラ10は、「NIC」と略記されている。
図5に例示するケース2において、TX0には、送信データD(0)の「送信時刻TT(0)」として「9:01」を規定し、送信データD(0)の「優先度P」として「1」を規定したディスクリプタが格納されている。また、TX1には、送信データD(1)の「送信時刻TT(1)」として「9:00」を規定し、送信データD(1)の「優先度P」として「2」を規定したディスクリプタが格納されている。
つまり、ケース2において、TX0には高優先ディスクリプタが格納され、TX1には低優先ディスクリプタが格納されている。TX0に格納されている高優先ディスクリプタが規定する、送信データD(0)の「送信時刻TT(0)」は「9:01」であり、TX1に格納されている低優先ディスクリプタが規定する、送信データD(1)の「送信時刻TT(1)」は「9:00」である。低優先ディスクリプタの規定する送信時刻TT(0):「9:00」は、高優先ディスクリプタの規定する送信時刻TT(1):「9:01」より早い。また、送信データD(1)の送信時刻TT(1):「9:00」と送信データD(0)の送信時刻TT(0):「9:01」との間の時間間隔は「1」であり、送信時刻TT(1)と送信時刻TT(0)との間の時間間隔は小さい。つまり、低優先ディスクリプタの規定する送信時刻TT(低優先)が、高優先ディスクリプタの規定する送信時刻TT(高優先)よりも早く、かつ、送信時刻TT(低優先)と送信時刻TT(高優先)との間の時間間隔が小さい。
ケース2において、ディスクリプタの規定する「送信時刻TT」だけで、実行するディスクリプトを選択した場合、TX1に格納されている低優先ディスクリプタが、TX0に格納されている高優先ディスクリプタよりも先に実行される。
高優先ディスクリプタよりも先に低優先ディスクリプタが実行されることで、低優先ディスクリプタに対応するデータD(1)は、高優先ディスクリプタに対応するデータD(0)よりも先に、バッファ162(BUF)に格納される。
図5に示す例では、データD(1)がBUF1、つまり、第二バッファ162(1)に格納された後に、データD(0)は、BUF0、つまり、第一バッファ162(0)に格納されている。なお、データD(0)を格納するバッファ162と、データD(1)を格納するバッファ162とを分けることは必須ではなく、両者は同じバッファ162に格納されてもよい。例えば、データD(0)とデータD(1)とは、各々に対応するディスクリプタが実行された(読み込まれた)順で、同じバッファ162に格納されてもよい。図5では、データD(1)が、データD(0)よりも先に、バッファ162(BUF)に格納されることを理解しやすいように、データD(0)をBUF0に格納し、データD(1)をBUF1に格納する例を示したに過ぎない。
データD(0)よりも先にデータD(1)がバッファ162に格納されることで、データD(0)のネットワーク3への送信は、データD(1)がネットワーク3へと送信された後に実行される。つまり、送信データD(1)が、その送信時刻TT(1):「9:00」にネットワーク3へと送信された後に、データD(0)のネットワーク3への送信が実行される。そのため、送信データD(0)を、その送信時刻TT(0)である「9:01」に、ネットワーク3へと送信することはできない。
(ケース1およびケース2を想定した工夫)
通信コントローラ10の開発者は、上述のケース1およびケース2のいずれにおいても、通信コントローラ10が読み込むべきディスクリプタを好適に選択できるように、通信コントローラ10について、更なる工夫を施した。
通信コントローラ10の開発者は、上述のケース1およびケース2のいずれにおいても、通信コントローラ10が読み込むべきディスクリプタを好適に選択できるように、通信コントローラ10について、更なる工夫を施した。
具体的には、通信コントローラ10は、「低優先ディスクリプタの規定する送信時刻TT(低優先)が、高優先ディスクリプタの規定する送信時刻TT(高優先)より早い」場合、以下の処理を実行する。すなわち、通信コントローラ10は、現在時刻CTに、高優先ディスクリプタに対応するデータ(高優先データ)の転送時間RTと、低優先ディスクリプタに対応するデータ(低優先データ)の転送時間RTとを加えた時刻(予定合計時刻ERT)を算出する。言い換えれば、通信コントローラ10は、「予定合計時刻ERT = 現在時刻CT +高優先データの転送時間RT + 低優先データの転送時間RT」を算出する。「転送時間RT」とは、或るデータ(或る送信データ)を、メインメモリ20からバッファ162へと転送するのに要する時間(期間)である。
次に、通信コントローラ10は、算出した予定合計時刻ERTと、高優先データの送信時刻TT(高優先)とを比較する。
ここで、予定合計時刻ERTが送信時刻TT(高優先)より大きい(遅い)場合、通信コントローラ10は、低優先データをバッファ162へ転送した後であっても、高優先データのバッファ162への転送を、送信時刻TT(高優先)に間に合わせられる。つまり、予定合計時刻ERTが送信時刻TT(高優先)より遅い場合、通信コントローラ10は、低優先データをバッファ162へ転送した後であっても、送信時刻TT(高優先)前に、高優先データをバッファ162へ転送することができる。
したがって、予定合計時刻ERTが送信時刻TT(高優先)より遅い場合、通信コントローラ10は、低優先ディスクリプタを選択して低優先ディスクリプタを実行した(読み込んだ)後、高優先ディスクリプタを実行する(読み込む)。
また、予定合計時刻ERTが送信時刻TT(高優先)より小さい(早い)場合、通信コントローラ10は、低優先データをバッファ162へ転送した後では、高優先データのバッファ162への転送を、送信時刻TT(高優先)に間に合わせることができない。つまり、予定合計時刻ERTが送信時刻TT(高優先)より早い場合、通信コントローラ10は、低優先データをバッファ162へ転送した後では、送信時刻TT(高優先)前に、高優先データをバッファ162へ転送することができない。
したがって、予定合計時刻ERTが送信時刻TT(高優先)より早い場合、通信コントローラ10は、高優先ディスクリプタを選択して高優先ディスクリプタを実行した(読み込んだ)後、低優先ディスクリプタを実行する(読み込む)。
図6は、選択部131が優先度Pと送信時刻TTとの双方を考慮して実行する選択処理(読み込むべきディスクリプタを、つまり、実行すべきディスクリプタを、選択する処理)の一例を示すフロー図である。具体的には、図6は、選択部131の実行する、「高優先ディスクリプタと低優先ディスクリプタとのうち、どちらのディスクリプタを先に実行すべきか(先に読み込むべきか)を選択する」処理の詳細を説明するフロー図である。
図6に示すように、先ず、選択部131は、高優先ディスクリプタの送信時刻TT(高優先)と比べて、低優先ディスクリプタの送信時刻TT(低優先)の方が早いかを判定する(S110)。「送信時刻TT(高優先)の方が、送信時刻TT(低優先)よりも早い、または、両者が同じ」場合(S110でNO)、選択部131は、高優先ディスクリプタと低優先ディスクリプタとのうち、高優先ディスクリプタを選択する(S140)。
「送信時刻TT(低優先)の方が、送信時刻TT(高優先)よりも早い」場合(S110でYES)、選択部131は予定合計時刻ERTを算出する(S120)。前述の通り、予定合計時刻ERTは、現在時刻CTに、低優先ディスクリプタに対応するデータの転送時間RT(低優先)と、高優先ディスクリプタに対応するデータの転送時間RT(高優先)とを加えた時刻である。
そして、選択部131は、「高優先ディスクリプタに規定されている送信時刻TT(高優先)よりも、予定合計時刻ERTが大きいか(予定合計時刻ERTが遅い)」を判定する(S130)。「送信時刻TT(高優先)よりも、予定合計時刻ERTが遅い」場合(S130でYES)、選択部131は、高優先ディスクリプタと低優先ディスクリプタとのうち、高優先ディスクリプタを選択する(S140)。
「送信時刻TT(高優先)よりも、予定合計時刻ERTが早い、または、両者が同じ」場合(S130でNO)、選択部131は、高優先ディスクリプタと低優先ディスクリプタとのうち、低優先ディスクリプタを選択する(S140)。
(ケース1およびケース2について、本実施形態に係る通信コントローラの選択結果)
図7は、選択部131が図6に例示したフローを実行することにより、選択部131によって選択されるディスクリプタを説明する図である。
図7は、選択部131が図6に例示したフローを実行することにより、選択部131によって選択されるディスクリプタを説明する図である。
前述の通り、ケース1において、TX0には、送信データD(0)の「送信時刻TT(0)」として「9:05」を規定し、送信データD(0)の「優先度P」として「1」を規定した高優先ディスクリプタが格納されている。また、TX1には、送信データD(1)の「送信時刻TT(1)」として「9:00」を規定し、送信データD(1)の「優先度P」として「2」を規定した低優先ディスクリプタが格納されている。
ここで、高優先ディスクリプタに対応するデータ(高優先データ)の、メインメモリ20からバッファ162への転送に要する転送時間RT(高優先)は、「2」である。また、低優先ディスクリプタに対応するデータ(低優先データ)の、メインメモリ20からバッファ162への転送に要する転送時間RT(低優先)は、「2」である。そして、現在時刻CTは「08:58」である。そのため、低優先ディスクリプタを実行した後に高優先ディスクリプタを実行した場合に、高優先データの、メインメモリ20からバッファ162への転送が完了する時刻(すなわち、予定合計時刻ERT)は、「09:02」となる。
ここで、予定合計時刻ERT「09:02」は、送信時刻TT(高優先):「9:05」よりも早い。したがって、選択部131は、高優先ディスクリプタと低優先ディスクリプタとのうち、低優先ディスクリプタ(TX1に格納されているディスクリプタ)を選択し、通信コントローラ10は、先ず、低優先ディスクリプタを実行する(読み込む)。
前述の通り、ケース2において、TX0には、送信データD(0)の「送信時刻TT(0)」として「9:01」を規定し、送信データD(0)の「優先度P」として「1」を規定した高優先ディスクリプタが格納されている。また、TX1には、送信データD(1)の「送信時刻TT(1)」として「9:00」を規定し、送信データD(1)の「優先度P」として「2」を規定した低優先ディスクリプタが格納されている。
ここで、高優先ディスクリプタに対応するデータ(高優先データ)の、メインメモリ20からバッファ162への転送に要する転送時間RT(高優先)は、「2」である。また、低優先ディスクリプタに対応するデータ(低優先データ)の、メインメモリ20からバッファ162への転送に要する転送時間RT(低優先)は、「2」である。そして、現在時刻CTは「08:58」である。そのため、低優先ディスクリプタを実行した後に高優先ディスクリプタを実行した場合に、高優先データの、メインメモリ20からバッファ162への転送が完了する時刻(すなわち、予定合計時刻ERT)は、「09:02」となる。
ここで、予定合計時刻ERT「09:02」は、送信時刻TT(高優先):「9:01」よりも遅い。したがって、選択部131は、高優先ディスクリプタと低優先ディスクリプタとのうち、高優先ディスクリプタ(TX0に格納されているディスクリプタ)を選択し、通信コントローラ10は、先ず、高優先ディスクリプタを実行する(読み込む)。
(ケース1について、優先度と送信時刻とを考慮してディスクリプタを選択した場合)
図8は、ケース1について、図6に例示したフローを実行した場合の具体的処理例を示す図である。前述の通り、低優先ディスクリプタを実行した後に高優先ディスクリプタを実行した場合に、高優先データの、メインメモリ20からバッファ162への転送が完了する時刻(すなわち、予定合計時刻ERT)は、「09:02」となる。そして、予定合計時刻ERT「09:02」は、ケース1において高優先ディスクリプタに規定されている送信時刻TT(高優先):「9:05」よりも早い。
図8は、ケース1について、図6に例示したフローを実行した場合の具体的処理例を示す図である。前述の通り、低優先ディスクリプタを実行した後に高優先ディスクリプタを実行した場合に、高優先データの、メインメモリ20からバッファ162への転送が完了する時刻(すなわち、予定合計時刻ERT)は、「09:02」となる。そして、予定合計時刻ERT「09:02」は、ケース1において高優先ディスクリプタに規定されている送信時刻TT(高優先):「9:05」よりも早い。
したがって、選択部131は、高優先ディスクリプタと低優先ディスクリプタとのうち、低優先ディスクリプタ(TX1に格納されているディスクリプタ)を選択し、通信コントローラ10は、先ず、低優先ディスクリプタを実行する(読み込む)。
高優先ディスクリプタよりも先に低優先ディスクリプタが実行されることで、低優先ディスクリプタに対応するデータD(1)は、高優先ディスクリプタに対応するデータD(0)よりも先に、バッファ162(BUF)に格納される。
したがって、バッファ162に先に格納されたデータD(1)が送信された後に、データD(1)よりも後にバッファ162に格納されたデータD(0)が送信される。具体的には、通信コントローラ10(特に、時刻指定送信管理部161)は、バッファ162に先に格納されたデータD(1)を、送信データD(1)の「送信時刻TT(1)」である「9:00」に、送信する。そして、通信コントローラ10(特に、時刻指定送信管理部161)は、データD(1)の送信後、データD(1)よりも後にバッファ162に格納されたデータD(0)を、送信データD(0)の「送信時刻TT(0)」である「9:05」に、送信する。
したがって、ケース1において、通信コントローラ10は、低優先ディスクリプタの送信時刻TT(低優先)通りに、低優先データを送信し、かつ、高優先ディスクリプタの送信時刻TT(高優先)通りに、高優先データを送信することができる。
(ケース2について、優先度と送信時刻とを考慮してディスクリプタを選択した場合)
図9は、ケース2について、図6に例示したフローを実行した場合の具体的処理例を示す図である。前述の通り、低優先ディスクリプタを実行した後に高優先ディスクリプタを実行した場合に、高優先データの、メインメモリ20からバッファ162への転送が完了する時刻(すなわち、予定合計時刻ERT)は、「09:02」となる。そして、予定合計時刻ERT「09:02」は、ケース2において高優先ディスクリプタに規定されている送信時刻TT(高優先):「9:01」よりも遅い。
図9は、ケース2について、図6に例示したフローを実行した場合の具体的処理例を示す図である。前述の通り、低優先ディスクリプタを実行した後に高優先ディスクリプタを実行した場合に、高優先データの、メインメモリ20からバッファ162への転送が完了する時刻(すなわち、予定合計時刻ERT)は、「09:02」となる。そして、予定合計時刻ERT「09:02」は、ケース2において高優先ディスクリプタに規定されている送信時刻TT(高優先):「9:01」よりも遅い。
したがって、選択部131は、高優先ディスクリプタと低優先ディスクリプタとのうち、高優先ディスクリプタ(TX0に格納されているディスクリプタ)を選択し、通信コントローラ10は、先ず、高優先ディスクリプタを実行する(読み込む)。
低優先ディスクリプタよりも先に高優先ディスクリプタが実行されることで、高優先ディスクリプタに対応するデータD(0)は、低優先ディスクリプタに対応するデータD(1)よりも先に、バッファ162(BUF)に格納される。
したがって、バッファ162に先に格納されたデータD(0)が送信された後に、データD(0)よりも後にバッファ162に格納されたデータD(1)が送信される。具体的には、通信コントローラ10(特に、時刻指定送信管理部161)は、バッファ162に先に格納されたデータD(0)を、送信データD(0)の「送信時刻TT(0)」である「9:01」に、送信する。そして、通信コントローラ10(特に、時刻指定送信管理部161)は、データD(0)の送信後、データD(0)よりも後にバッファ162に格納されたデータD(1)を、できるだけ早いタイミングで、送信する。
したがって、ケース2において、通信コントローラ10は、高優先ディスクリプタの送信時刻TT(高優先)通りに、高優先データを送信し、また、低優先データについても、できるだけ早い時間に送信することができる。
これまで図4から図9を用いて説明してきた内容は、以下のように整理することができる。すなわち、通信コントローラ10について、複数の送信ディスクリプタの中の或る送信ディスクリプタの優先度Pが、別のディスクリプタの優先度Pよりも高い場合、選択部131は、以下の処理を実行する。先ず選択部131は、「現在時刻CTに、その或る送信ディスクリプタに対応するデータの転送時間RTと、その別のディスクリプタに対応するデータの転送時間RTとを加えた時刻」である予定合計時刻ERTを算出する。転送時間RTとは、データ(送信データ)をメインメモリ20からバッファ162へと転送するのに要する時間である。そして、選択部131は、算出した予定合計時刻ERTと、その或る送信ディスクリプタの送信時刻TTとを比較する。
その或る送信ディスクリプタの送信時刻TTが、予定合計時刻ERTよりも後だと(遅いと)、選択部131は、その或る送信ディスクリプタに優先して、その別のディスクリプタを選択する。また、その或る送信ディスクリプタの送信時刻TTが、予定合計時刻ERT以前だと、選択部131は、その別のディスクリプタに優先して、その或る送信ディスクリプタを選択する。
前記の構成によれば、通信コントローラ10は、或る送信ディスクリプタの優先度Pが、別のディスクリプタの優先度Pよりも高いと、予定合計時刻ERTと、その或る送信ディスクリプタの送信時刻TTとを比較する。そして、その或る送信ディスクリプタの送信時刻TTが、予定合計時刻ERTよりも後だと(遅いと)、通信コントローラ10は、その或る送信ディスクリプタに優先して、その別のディスクリプタを選択する。また、その或る送信ディスクリプタの送信時刻TTが、予定合計時刻ERT以前だと、通信コントローラ10は、その別のディスクリプタに優先して、その或る送信ディスクリプタを選択する。
ここで、複数の送信ディスクリプタの各々において規定されている優先度Pのみに基づいて読み込むべきディスクリプタを選択した場合、優先度Pが低いディスクリプタは、常に、優先度Pが高いディスクリプタよりも後に読み込まれる(実行される)ことになる。
しかし、或る送信ディスクリプタより優先度Pが低い別のディスクリプタの送信時刻TTが、その或る送信ディスクリプタの送信時刻TTよりも十分に早い場合、優先度Pのみに従ってディスクリプタの読込順序を決定することは、必ずしも適切ではない。
例えば、その別のディスクリプタに対応する送信データをメインメモリに転送した後であっても、その或る送信ディスクリプタに対応する送信データを、その或る送信ディスクリプタの送信時刻TTよりも前に、メインメモリ20へと転送できる場合がある。そのような場合、その別のディスクリプタを読み込んだ(実行した)後に、その或るディスクリプタを読み込めばよく、つまり、その別のディスクリプタを、その或る送信ディスクリプタよりも先に読み込むべきである。
また、複数のディスクリプタの各々において規定されている送信時刻TTのみに基づいて、読み込むべきディスクリプタを選択した場合、送信時刻TTが遅いディスクリプタは、常に、送信時刻TTが早いディスクリプタよりも後に読み込まれることになる。
しかし、或るディスクリプタよりも優先度Pが低い別のディスクリプタの送信時刻TTが、その或るディスクリプタの送信時刻TTの直前である場合、送信時刻TTのみに従ってディスクリプタの読込順序を決定することは、必ずしも適切ではない。
例えば、その別のディスクリプタに対応する送信データをメインメモリ20に転送した後では、その或る送信ディスクリプタに対応する送信データを、その或る送信ディスクリプタの送信時刻TTよりも前に、メインメモリ20へと転送できない場合がある。そのような場合、その別のディスクリプタを読み込む(実行する)前に、その或るディスクリプタを読み込まなくてはならず、つまり、その或るディスクリプタを、その別の送信ディスクリプタよりも先に読み込むべきである。
通信コントローラ10は、優先度Pのみに従ったディスクリプタの読込順序の決定、および、送信時刻TTのみに従ったディスクリプタの読込順序の決定の各々が有する上述の不備を補う。すなわち、複数の送信ディスクリプタの中の或る送信ディスクリプタの優先度Pが、別のディスクリプタの優先度Pよりも高い場合、通信コントローラ10は、予定合計時刻ERTと或る送信ディスクリプタの送信時刻TTとを比較する。そして、通信コントローラ10は、予定合計時刻ERTと或る送信ディスクリプタの送信時刻TTとの比較結果に基づいて、読み込むべきディスクリプタを選択し、つまり、実行するディスクリプタを選択する。
したがって、通信コントローラ10は、優先度Pおよび送信時刻TTのいずれか一方にのみ従って読み込むべきディスクリプタを選択する方法に比べて、読み込むべきディスクリプタを適切に選択することができるとの効果を奏する。
(転送時間の算出例)
図10は、通信コントローラ10が、或る送信データについて、その転送時間RTを算出する際に用いる情報を整理した表である。具体的には、通信コントローラ10(特に、選択部131)は、或る送信データのデータサイズと、「通信コントローラ10が、データを、メインメモリ20からバッファ162へと転送する際の転送速度」とから、或る送信データの転送時間RTを計算する。
図10は、通信コントローラ10が、或る送信データについて、その転送時間RTを算出する際に用いる情報を整理した表である。具体的には、通信コントローラ10(特に、選択部131)は、或る送信データのデータサイズと、「通信コントローラ10が、データを、メインメモリ20からバッファ162へと転送する際の転送速度」とから、或る送信データの転送時間RTを計算する。
通信コントローラ10は、メインメモリ20と通信コントローラ10(特に、バッファ162)との間のデータ転送に係る理論値速度(転送レート)を、PLC1の起動時(特に、プロトコル確立時)に取得することができる。例えば、メインメモリ20と通信コントローラ10とがPCIe(Peripheral Component Interconnect Express)で接続する場合、通信コントローラ10は、PCIeの規格で保証されているレート(理論値)を、レジスタを参照して確認する。
ここで、「実行率」および「オーバーヘッド」の各々は、レート(理論値)ごとに、予め準備されている。具体的には、「実行率」は、通信コントローラ10の生産時(開発時)に、レート(理論値)ごとにチューニングされている。「実行率」は、PLC1の起動時に、ソフトウェア(つまり、CPU30)によって設定されてもよい。同様に、「オーバーヘッド」は、通信コントローラ10の生産時(開発時)に、レート(理論値)ごとにチューニングされている。
通信コントローラ10は、確認したレート(理論値)に対応する「実行率」を取得し、レート(理論値)と実行率とから「転送速度」を算出する。また、通信コントローラ10は、レート(理論値)ごとに予め準備しておいた「オーバーヘッド」を、或るデータの転送時間RTを算出するのに利用する。
送信データのデータサイズ(転送サイズ)は、送信ディスクリプタに記載されているため、通信コントローラ10は、送信ディスクリプタを読み出すごとに、送信データの転送サイズを取得することができる。
通信コントローラ10(特に、選択部131)は、取得した送信データの転送サイズと、レート(理論値)ごとの、「転送速度」および「オーバーヘッド」とから、以下の式を用いて、その送信データの転送時間RTを算出する。すなわち、通信コントローラ10は、「転送時間RT = {オーバーヘッド + (転送サイズ / 転送速度)}」から、送信データの転送時間RTを算出する。
(ケース3について)
図11は、ケース3において、判定時間JT(詳細は後述する)を設けない場合に発生する状況を説明する図である。ケース3において、或るディスクリプタは、現在時刻CTから所定時間以上離れた時刻を「送信時刻TT」として規定している。図11において、通信コントローラ10は、「NIC」と略記されている。
図11は、ケース3において、判定時間JT(詳細は後述する)を設けない場合に発生する状況を説明する図である。ケース3において、或るディスクリプタは、現在時刻CTから所定時間以上離れた時刻を「送信時刻TT」として規定している。図11において、通信コントローラ10は、「NIC」と略記されている。
図11に例示するケース3において、TX0には、送信データD(0)の「送信時刻TT(0)」として「9:10」を規定し、送信データD(0)の「優先度P」として「1」を規定したディスクリプタが格納されている。また、TX1には、送信データD(1)の「送信時刻TT(1)」として「9:00」を規定し、送信データD(1)の「優先度P」として「1」を規定したディスクリプタが格納されている。さらに、TX2、つまり、第三ディスクリプタメモリ14(2)には、送信データD(2)の「送信時刻TT(2)」として「9:00」を規定し、送信データD(2)の「優先度P」として「2」を規定したディスクリプタが格納されている。
ここで、「TX0に格納されている高優先ディスクリプタ」を実行した(読み込んだ)後に、「TX1に格納されている高優先ディスクリプタ」および「TX2に格納されている低優先ディスクリプタ」の各々を実行すると、図11に示す状況が発生する。なお、「TX0に格納されている高優先ディスクリプタ」を実行した後に実行されるのは、「TX1に格納されている高優先ディスクリプタ」が先でも、「TX2に格納されている低優先ディスクリプタ」が先でもよい。
すなわち、「TX0に格納されている高優先ディスクリプタ」を最初に実行した場合、「TX0に格納されている高優先ディスクリプタ」に対応する高優先データD(0)が、バッファ162の最初に格納される。
そして、「TX1に格納されている高優先ディスクリプタ」は、「TX0に格納されている高優先ディスクリプタ」よりも後に実行される。そのため、「TX1に格納されている高優先ディスクリプタ」に対応する高優先データD(1)は、高優先データD(0)よりも後に、バッファ162に格納される。
バッファ162には、高優先データD(1)の前に高優先データD(0)が格納されているため、高優先データD(0)をネットワーク3に送信してからでないと、送信高優先データD(1)をネットワーク3に送信することはできない。
ここで、前述の通り、送信データD(1)の「送信時刻TT(1)」は「9:00」であるのに対して、送信データD(0)の「送信時刻TT(0)」は「9:10」である。そのため、「9:00」に送信データD(1)をネットワーク3に送信することはできず、送信データD(1)をネットワーク3に送信できるタイミングは、送信データD(0)を「9:10」にネットワーク3に送信した後になる。
図11に示すように、ケース3においては、現在時刻CTから所定時間以上離れた時刻(例えば、送信時刻TT(0))を、「送信時刻TT」として規定するディスクリプタ(例、図11の「TX0に格納されている高優先ディスクリプタ」)が発生している。ケース3では、さらに、送信時刻TT(0)を「送信時刻TT」として規定するディスクリプタの後に、「送信時刻TT(0)より現在時刻CTに近い送信時刻TT(例、送信時刻TT(1))を、『送信時刻TT』として規定する」ディスクリプタが発生している。
ケース3において、先に発生した「送信時刻TT(0)を『送信時刻TT』として規定するディスクリプタ」を、「送信時刻TT(1)を、『送信時刻TT』として規定するディスクリプタ」よりも先に実行した場合、図11に示す状況が生じてしまいう。すなわち、「送信時刻TT(0)を、『送信時刻TT』として規定するディスクリプタ」に対応するデータが邪魔となって、「送信時刻TT(1)を、『送信時刻TT』として規定するディスクリプタ」に対応するデータを、送信時刻TT(1)に送信できない。
(ケース3を想定した工夫)
通信コントローラ10の開発者は、上述のケース3においても、通信コントローラ10が読み込むべきディスクリプタを好適に選択できるように、通信コントローラ10について、更に以下の工夫を施した。
通信コントローラ10の開発者は、上述のケース3においても、通信コントローラ10が読み込むべきディスクリプタを好適に選択できるように、通信コントローラ10について、更に以下の工夫を施した。
すなわち、通信コントローラ10には、予め判定時間JTが設けられており、通信コントローラ10は、判定時間JTを用いて、ディスクリプタを実行する(読み込む)タイミングを調整する。具体的には、通信コントローラ10は、「ディスクリプタで規定された送信時刻TTから、判定時間JTを遡った時刻」になってから、そのディスクリプタを読み込む(実行する)。
通信コントローラ10は、「ディスクリプタで規定された送信時刻TT」から「現在時刻CT」を差し引いた期間が判定時間JTよりも大きいと、つまり、「(送信時刻TT - 現在時刻CT) > 判定時間JT」なら、そのディスクリプタを実行しない。通信コントローラ10は、「ディスクリプタで規定された送信時刻TT」から「現在時刻CT」を差し引いた期間が判定時間JT以下となると、つまり、「(送信時刻TT - 現在時刻CT) ≦ 判定時間JT」となると、そのディスクリプタを実行する。
図12は、ケース3について、判定時間JTを設けた通信コントローラ10によって実現される具体的な処理例を示す図である。前述の通り、ケース3において、TX0には、送信データD(0)の「送信時刻TT(0)」として「9:10」を規定し、送信データD(0)の「優先度P」として「1」を規定したディスクリプタが格納されている。また、TX1には、送信データD(1)の「送信時刻TT(1)」として「9:00」を規定し、送信データD(1)の「優先度P」として「1」を規定したディスクリプタが格納されている。さらに、TX2には、送信データD(2)の「送信時刻TT(2)」として「9:00」を規定し、送信データD(2)の「優先度P」として「2」を規定したディスクリプタが格納されている。
通信コントローラ10は、送信データD(0)の「送信時刻TT(0)」として「9:10」を規定したディスクリプタを、「『9:10』から判定時間JTを遡った時刻」になるまで、実行しない。つまり、「送信時刻TTから現在時刻CTを差し引いた時間(期間)が、判定時間JTよりも大きい」間は、通信コントローラ10は、送信時刻TTを規定するディスクリプタを読み込まない(実行しない)。
そして、通信コントローラ10は、送信データD(1)の「送信時刻TT(1)」として「9:00」を規定したディスクリプタを、「『9:00』から現在時刻CTを差し引いた期間」が判定時間JT以下となると、実行する。つまり、「送信時刻TTから現在時刻CTを差し引いた時間が、判定時間JT以下」となると、通信コントローラ10は、送信時刻TTを規定するディスクリプタを、読み込むべきディスクリプタとみなし、言い換えれば、選択部131による選択処理の対象とする。
そのため、通信コントローラ10は、「TX1に格納されている高優先ディスクリプタ」を、「TX0に格納されている高優先ディスクリプタ」よりも先に実行する。したがって、通信コントローラ10は、「TX1に格納されている高優先ディスクリプタ」に対応する高優先データD(1)を、高優先データD(0)よりも先に、バッファ162に格納する。
バッファ162には、高優先データD(0)の前に高優先データD(1)が格納されているため、通信コントローラ10は、高優先データD(0)をネットワーク3に送信する前に、送信高優先データD(1)をネットワーク3に送信することができる。具体的には、通信コントローラ10は、送信高優先データD(1)を、送信時刻TT(1):「9:00」にネットワーク3に送信した後、送信高優先データD(0)を、送信時刻TT(0):「9:10」にネットワーク3に送信する。
これまで図11および図12を用いて説明してきた内容は、以下のように整理することができる。すなわち、通信コントローラ10において、判定時間JTが予め設定されており、読込部132は、送信ディスクリプタの送信時刻TTから判定時間JTを遡った時刻になってから、送信ディスクリプタを読み込む。
前記の構成によれば、通信コントローラ10は、送信ディスクリプタの送信時刻TTから判定時間JTを遡った時刻になってから、その送信ディスクリプタを読み込む。
ここで、或る送信ディスクリプタを読み込んだ後に、その或る送信ディスクリプタの送信時刻TTよりも現在時刻CTに近い時刻を送信時刻TTとする別のディスクリプタが生成された場合、以下の問題が発生する。すなわち、その或る送信ディスクリプタに対応するデータが障害となって、その別のディスクリプタに対応するデータを、その別のディスクリプタの送信時刻TTで送信することができないという問題が発生する。
これは、バッファ162に格納されたデータは、格納された順で送信されるからである。つまり、或る送信ディスクリプタに対応するデータが別のディスクリプタに対応するデータより先に格納されたなら、その或る送信ディスクリプタに対応するデータが送信されてからでないと、その別のディスクリプタに対応するデータは送信されない。そして、その或る送信ディスクリプタに対応するデータは、その或る送信ディスクリプタの送信時刻TTにならなければ送信されない。しかしながら、その或る送信ディスクリプタの送信時刻TTは、その別のディスクリプタの送信時刻TTよりも後であるから、その別のディスクリプタに対応するデータを、その別のディスクリプタの送信時刻TTで送信することはできない。
そこで、通信コントローラ10は、送信ディスクリプタの送信時刻TTから判定時間JTを遡った時刻になってから、その送信ディスクリプタを読み込むことによって、上述の問題が発生する可能性を抑制する。すなわち、或る送信ディスクリプタの送信時刻TTより現在時刻CTに近い時刻を送信時刻TTとする別のディスクリプタを読み込む前に、その或る送信ディスクリプタを読み込むことがないよう、通信コントローラ10は、上述の調整を実行する。言い換えれば、通信コントローラ10は、その或る送信ディスクリプタの読込時刻(実行時刻)を調整し、具体的には、その或る送信ディスクリプタの送信時刻TTから判定時間JTを遡った時刻になってから、その或る送信ディスクリプタを読み込む(実行する)。
したがって、通信コントローラ10は、或る送信ディスクリプタの送信時刻TTよりも現在時刻CTに近い時刻を送信時刻TTとする別のディスクリプタを読み込む前に、その或る送信ディスクリプタを読み込むことを防ぐことができるとの効果を奏する。
(ケース1、2、および、3に対応する通信コントローラの実行する処理について)
これまで、ケース1、ケース2、および、ケース3の各々において、通信コントローラ10が、実行すべき複数のディスクリプタについて、望ましい順序、望ましいタイミングで実行する(読み込む)ことができることを説明してきた。このような通信コントローラ10が実行する処理について、以下、図13から図17を参照して説明していく。
これまで、ケース1、ケース2、および、ケース3の各々において、通信コントローラ10が、実行すべき複数のディスクリプタについて、望ましい順序、望ましいタイミングで実行する(読み込む)ことができることを説明してきた。このような通信コントローラ10が実行する処理について、以下、図13から図17を参照して説明していく。
(CPUおよびリクエスタが実行する処理例)
図13は、CPU30およびリクエスタ15が実行する処理例を示すフロー図であり、特に、図13の(A)はCPU30が実行する処理例を示しており、図13の(B)はリクエスタ15が実行する処理例を示している。
図13は、CPU30およびリクエスタ15が実行する処理例を示すフロー図であり、特に、図13の(A)はCPU30が実行する処理例を示しており、図13の(B)はリクエスタ15が実行する処理例を示している。
図13の(A)に示すように、送信要求があると、CPU30は、送信データをメインメモリ20に設定し(S210)、つまり、送信データをメインメモリ20に格納する。また、CPU30は、送信ディスクリプタをメインメモリ20に設定し(S220)、つまり、送信ディスクリプタをメインメモリ20に格納する。そして、CPU30は、通信コントローラ10に送信要求を出力し(S230)、具体的には、送信ディスクリプタの実行番号および実行個数を、通信コントローラ10に通知する。
「実行個数」は、CPU30が通信コントローラ10に送信の実行を要求する送信データの個数であり、言い換えれば、通信コントローラ10によって実行されるべき送信ディスクリプタの個数である。また、「実行番号」は、リクエスタ15の番号を示しており、また、ディスクリプタメモリ14の番号を示している。例えば、実行個数が「n」であると、実行番号として、「0」から「n-1」が通信コントローラ10に通知される。実行番号および実行個数は、例えば、リクエスタ15の設定レジスタ151に格納される(設定される)。
送信処理は通信コントローラ10が実行するので、CPU30が実行すべき処理は、S230で終了する。送信要求が別途あれば、CPU30は、S210からS230までの処理を都度実行してもよい。
図13の(B)に示すように、先ず、リクエスタ15は、CPU30からの送信要求があるかを判定する(S310)。CPU30からの送信要求がないと(S310でNO)、リクエスタ15は、CPU30からの送信要求があるまで待機しておく。
CPU30からの送信要求があると(S310でYES)、通信コントローラ10(特に、リクエスタ15)は、以下の処理を実行する。すなわち、CPU30からの送信要求を受け付けた通信コントローラ10は、受け付けた送信要求に従って、メインメモリ20に格納されているディスクリプタを取得し、取得したディスクリプタをディスクリプタメモリ14に格納する。具体的には、CPU30によってリクエスタ15の設定レジスタ151に設定された「実行個数」に基づいて、メインメモリ20から取得すべきディスクリプタを特定し、特定したディスクリプタをメインメモリ20から取得する。そして、通信コントローラ10(特に、リクエスタ15)は、取得したディスクリプタを、「リクエスタ15の設定レジスタ151に設定された『実行番号』に対応する、ディスクリプタメモリ14(ディスクリプタメモリ14の領域)」に格納する。例えば、実行個数が「n」であると、メインメモリ20から取得された「n」個のディスクリプタは、ディスクリプタメモリ14中の、第一ディスクリプタメモリ14(0)から第nディスクリプタメモリ14(n-1)の各々に格納される。
また、CPU30からの送信要求を受け付けた通信コントローラ10は、受け付けた送信要求に従ってディスクリプタを格納したディスクリプタメモリ14に対応するリクエスタ15の要求レジスタに「1」を格納する。例えば、通信コントローラ10は、送信要求に従って取得したディスクリプタAを第一ディスクリプタメモリ14(0)に格納すると、第一ディスクリプタメモリ14(0)に対応する第一リクエスタ15(0)の要求レジスタに「1」を格納する。また、通信コントローラ10は、送信要求に従って取得したディスクリプタBを第二ディスクリプタメモリ14(1)に格納すると、第二ディスクリプタメモリ14(1)に対応する第二リクエスタ15(1)の要求レジスタに「1」を格納する。
要求レジスタに「1」が格納されたリクエスタ15は、ディスクリプタ実行管理部13に、「実行すべき(読み込むべき)送信ディスクリプタがある」ことを通知する「要求信号=1」を出力する(S320)。そして、リクエスタ15は、ディスクリプタ実行管理部13から、転送完了通知があるかを判定する(S330)。
ディスクリプタ実行管理部13からの転送完了通知がないと(S330でNO)、リクエスタ15は、ディスクリプタ実行管理部13からの転送完了通知があるまで待機しておく。
ディスクリプタ実行管理部13からの転送完了通知があると(S330でYES)、リクエスタ15は、要求レジスタに「0」を格納し、また、ディスクリプタ実行管理部13に「要求信号=0」を出力する(S340)。「要求信号=0」は、「実行すべきディスクリプタがない」ことをディスクリプタ実行管理部13に通知する信号である。
(ディスクリプタ実行管理部およびBUF管理部等が実行する処理例)
図14は、ディスクリプタ実行管理部13およびBUF管理部16等が実行する処理例を示すフロー図であり、特に、図14の(A)はディスクリプタ実行管理部13が実行する処理例を示しており、図14の(B)はリクエスタ15が実行する処理例を示している。
図14は、ディスクリプタ実行管理部13およびBUF管理部16等が実行する処理例を示すフロー図であり、特に、図14の(A)はディスクリプタ実行管理部13が実行する処理例を示しており、図14の(B)はリクエスタ15が実行する処理例を示している。
図14の(A)に示すように、ディスクリプタ実行管理部13は、リクエスタ15からの要求(「要求信号=1」。具体的には、送信ディスクリプタの実行要求(読込要求))があるかを判定する(S410)。リクエスタ15からの要求がないと(S410でNO)、ディスクリプタ実行管理部13は、リクエスタ15からの要求があるまで待機しておく。
リクエスタ15からの要求があると(S410でYES)、ディスクリプタ実行管理部13は、実行すべき送信ディスクリプタ(つまり、読み込むべき送信ディスクリプタ)を選択する選択処理を実行する(S420)。選択処理の詳細については、図15から図17を参照して、後述する。
ディスクリプタ実行管理部13は、S420の選択処理で選択した送信ディスクリプタを実行し、つまり、選択した送信ディスクリプタを読み込む。そして、ディスクリプタ実行管理部13は、読み込んだ送信ディスクリプタに規定されている内容に従って、DMAC12に転送リクエストを出力する(S430)。転送リクエストは、DMAC12への転送指示であり、具体的には、「読み込んだ送信ディスクリプタに規定されている内容に従ってメインメモリ20から送信データを取得し、取得した送信データを、バッファ162へと転送する」ことをDMAC12に指示する。
ディスクリプタ実行管理部13は、DMAC12から、「転送リクエストに対応する送信データの転送処理を、DMAC12が完了した」ことを示す転送完了報告があるかを判定する(S440)。DMAC12からの転送完了報告がないと(S440でNO)、ディスクリプタ実行管理部13は、DMAC12からの転送完了報告があるまで待機しておく。
DMAC12からの転送完了報告があると(S440でYES)、ディスクリプタ実行管理部13は、リクエスタ15に、転送完了通知を発行する(S450)。「転送完了通知」は、「送信ディスクリプタに規定されている内容に従って、メインメモリ20からバッファ162への送信データの転送処理が完了した」ことを示す情報である。
図14の(B)に示すように、先ず、BUF管理部16は、バッファ162に送信データがあるかを判定する(S510)。バッファ162に送信データがないと(S510でNO)、BUF管理部16は、バッファ162に送信データが存在するようになるまで待機しておく。
バッファ162に送信データがあると(S510でYES)、時刻指定送信管理部161は、「現在時刻CTが、バッファ162に存在する送信データの送信時刻TTであるか」を判定する(S520)。現在時刻CTがバッファ162に存在する送信データの送信時刻TTでないと(S520でNO)、時刻指定送信管理部161は、現在時刻CTがバッファ162に存在する送信データの送信時刻TTになるまで待機しておく。
現在時刻CTがバッファ162に存在する送信データの送信時刻TTになると(S520でYES)、時刻指定送信管理部161は、送信リクエストを、調停部17に発行する(S530)。「送信リクエスト」は、「バッファ162に存在する送信データの送信を、調停部17に指示する」情報である。
調停部17は、「他の送信データの送信を実行中ではないか」を確認し、他の送信データの送信を実行中ではないことを確認すると、時刻指定送信管理部161にアクセス許可を出力する。調停部17は、他の送信データの送信を実行中だと、時刻指定送信管理部161にアクセス許可を出力しない。
時刻指定送信管理部161は、調停部17からのアクセス許可があるかを判定する(S540)。調停部17からのアクセス許可がないと(S540でNO)、時刻指定送信管理部161(BUF管理部16)は、調停部17からのアクセス許可があるまで待機しておく。
調停部17からのアクセス許可があると(S540でYES)、時刻指定送信管理部161(BUF管理部16)は、バッファ162に存在する送信データの送信を実行する(S550)。
(選択処理の詳細例)
図15は、図14の(A)に例示した選択処理(S420)の一例を示すフロー図である。前述の通り、ディスクリプタ実行管理部13は、実行すべき(読み込むべき)、1つ以上の送信ディスクリプタについて実行順序を決定し、例えば、実行すべき複数の送信ディスクリプタの中から、実行する送信ディスクリプタを1つ1つ選択していく(選択処理)。ディスクリプタ実行管理部13の実行する、この選択処理について、以下、図15から図17を参照して、その詳細を説明していく。
図15は、図14の(A)に例示した選択処理(S420)の一例を示すフロー図である。前述の通り、ディスクリプタ実行管理部13は、実行すべき(読み込むべき)、1つ以上の送信ディスクリプタについて実行順序を決定し、例えば、実行すべき複数の送信ディスクリプタの中から、実行する送信ディスクリプタを1つ1つ選択していく(選択処理)。ディスクリプタ実行管理部13の実行する、この選択処理について、以下、図15から図17を参照して、その詳細を説明していく。
図15に示すように、ディスクリプタ実行管理部13は、例えば、カレント送信時刻CST、カレント優先度CPR、カレント転送時間CRTの3つの変数の各々に、「0」を設定する(S1100)。以下、カレント送信時刻CST、カレント優先度CPR、および、カレント転送時間CRTを総称して、「カレント変数」と称することがある。
次に、ディスクリプタ実行管理部13は、各々が送信要求に対応する、1つ以上のディスクリプタの中から、任意のディスクリプタ(=対象ディスクリプタ)を1つ選択し、その対象ディスクリプタの優先度P、送信時刻TT等を取得する(S1200)。「各々が送信要求に対応する、1つ以上のディスクリプタ」とは、「図13の(B)において、送信要求のあった(S310でYES)ディスクリプタ」である。
以下の説明において、対象ディスクリプタの規定している「送信時刻TT」を「NST」と略記し、対象ディスクリプタの規定している「優先度P」を「NPR」と略記し、対象ディスクリプタに対応する送信データの「転送時間RT」を「NRT」と略記する。また、対象ディスクリプタに対応する送信データを「対象データ」と略記することがある。同様に、カレント送信時刻CST、カレント優先度CPR、カレント転送時間CRTに対応する内容を規定しているディスクリプタを、「カレントディスクリプタ」と略記し、カレントディスクリプタに対応する送信データを「カレント」と略記することがある。
そして、ディスクリプタ実行管理部13は、「『対象ディスクリプタの送信時刻NSTから現在時刻CTを差し引いた時間(期間)』が、判定時間JT以下であるか」を判定する(S1300)。対象ディスクリプタの送信時刻NSTから現在時刻CTを差し引いた時間が、判定時間JTより大きいと(S1300でNO)、ディスクリプタ実行管理部13は、「送信要求のあったディスクリプタを全て判定したか」を確認する(S1600)。対象ディスクリプタの送信時刻NSTから現在時刻CTを差し引いた時間が、判定時間JT以下であると(S1300でYES)、ディスクリプタ実行管理部13は、カレント優先度CPRと対象ディスクリプタの優先度NPRとを比較する(S1400)。
ここで、S1300の処理は、図12を用いて説明した、「通信コントローラ10は、『ディスクリプタで規定された送信時刻TTから、判定時間JTを遡った時刻』以降に、そのディスクリプタを読み込む(実行する)」との処理に対応する。
つまり、S1300において、現在時刻CTが「或るディスクリプタの規定する送信時刻TTから、判定時間JTを差し引いた時間」より小さいと、ディスクリプタ実行管理部13は、現在時刻CTでは、その或るディスクリプタを選択処理の対象から除外する。現在時刻CTが「或るディスクリプタの規定する送信時刻TTから、判定時間JTを遡った時刻」より早いと、ディスクリプタ実行管理部13は、現在時刻CTでは、その或るディスクリプタに対し選択処理を実行せず、その或るディスクリプタを読み込まない。
S1300において、現在時刻CTが「或るディスクリプタの規定する送信時刻TTから、判定時間JTを差し引いた時間」以上であると、ディスクリプタ実行管理部13は、現在時刻CTにおいて、その或るディスクリプタを選択処理の対象とする。現在時刻CTが「或るディスクリプタの規定する送信時刻TTから、判定時間JTを遡った時刻」以降であると、ディスクリプタ実行管理部13は、現在時刻CTにおいて、その或るディスクリプタに対し選択処理を実行する。
S1400においてカレント優先度CPRと対象ディスクリプタの優先度NPRとを比較したディスクリプタ実行管理部13は、カレント優先度CPRと対象ディスクリプタの優先度NPRとの関係ごとに、更新処理を実行する(S1500)。具体的には、ディスクリプタ実行管理部13は、対象ディスクリプタの優先度NPRが、(1)カレント優先度CPRと同じ場合、(2)カレント優先度CPRより高い場合、(3)カレント優先度CPRより低い場合の各々について、更新処理を実行する。カレント優先度CPRと対象ディスクリプタの優先度NPRとの関係ごとに、ディスクリプタ実行管理部13が実行する更新処理について、その詳細は、図16および図17を参照して説明する。
S1500の更新処理を実行後、ディスクリプタ実行管理部13は、「送信要求のあったディスクリプタを全て判定したか」を確認する(S1600)。例えば、ディスクリプタ実行管理部13は、「送信要求のあったディスクリプタを全てについて、S1200(またはS1700)からS1500までの処理を実行したか」を確認する。
送信要求のあったディスクリプタを全て判定していないと(S1600でNO)、ディスクリプタ実行管理部13は、送信要求のあったディスクリプタの中から、未判定のディスクリプタの1つを「対象ディスクリプタ」として選択する。そして、ディスクリプタ実行管理部13は、選択した対象ディスクリプタの優先度NPR、送信時刻NST等を取得する(S1700)。そして、ディスクリプタ実行管理部13は、S1300以降の処理を実行する。
つまり、ディスクリプタ実行管理部13は、送信要求のあったディスクリプタの中に、S1200(またはS1700)からS1500までの処理を実行していないディスクリプタがないかを確認する。S1200(またはS1700)からS1500までの処理を実行していないディスクリプタがあると、ディスクリプタ実行管理部13は、そのディスクリプタについて、S1700からS1500までの処理を実行する。
最後に、ディスクリプタ実行管理部13は、カレント送信時刻CST、カレント優先度CPR、カレント転送時間CRTに対応するディスクリプタを、現在時刻CTにおいて実行する(読み込む)ディスクリプタとして、選択する(S1800)。
(更新処理の詳細例)
図16は、図15に例示した更新処理(S1500)について、対象ディスクリプタの優先度NPRがカレント優先度CPRと同じ場合、および、対象ディスクリプタの優先度NPRがカレント優先度CPRより高い場合の例を示すフロー図である。
図16は、図15に例示した更新処理(S1500)について、対象ディスクリプタの優先度NPRがカレント優先度CPRと同じ場合、および、対象ディスクリプタの優先度NPRがカレント優先度CPRより高い場合の例を示すフロー図である。
(対象ディスクリプタの優先度がカレント優先度と同じ場合の更新処理例)
対象ディスクリプタの優先度NPRがカレント優先度CPRと同じ場合、ディスクリプタ実行管理部13は、図16の(A)に例示する更新処理を実行する。すなわち、ディスクリプタ実行管理部13は先ず、「カレント送信時刻CSTより、対象ディスクリプタの送信時刻NSTの方が早いか」を判定する(S1511)。
対象ディスクリプタの優先度NPRがカレント優先度CPRと同じ場合、ディスクリプタ実行管理部13は、図16の(A)に例示する更新処理を実行する。すなわち、ディスクリプタ実行管理部13は先ず、「カレント送信時刻CSTより、対象ディスクリプタの送信時刻NSTの方が早いか」を判定する(S1511)。
カレント送信時刻CSTより対象ディスクリプタの送信時刻NSTの方が早いと(S1511でYES)、ディスクリプタ実行管理部13は、カレント送信時刻CST、カレント優先度CPR、カレント転送時間CRTの各々の値を更新する(S1512)。具体的には、ディスクリプタ実行管理部13は、カレント送信時刻CSTの値を、対象ディスクリプタの送信時刻NSTの値によって更新する。また、ディスクリプタ実行管理部13は、カレント優先度CPRの値を、対象ディスクリプタの優先度NPRの値によって更新する。さらに、ディスクリプタ実行管理部13は、カレント転送時間CRTの値を、対象ディスクリプタに対応する送信データの転送時間NRTの値によって更新する。
S1511の判定において、「カレント送信時刻CST=0」の場合、ディスクリプタ実行管理部13は、「S1511でYES」であるとして次の処理へ遷移し、つまり、S1512を実行する。
カレント送信時刻CSTより対象ディスクリプタの送信時刻NSTの方が遅い、または、カレント送信時刻CSTと対象ディスクリプタの送信時刻NSTとが同じ場合(S1511でNO)、ディスクリプタ実行管理部13は、更新処理を終了する。
(対象ディスクリプタの優先度がカレント優先度より高い場合の更新処理例)
対象ディスクリプタの優先度NPRがカレント優先度CPRより高い場合、ディスクリプタ実行管理部13は、図16の(B)に例示する更新処理を実行する。すなわち、ディスクリプタ実行管理部13は先ず、「カレント送信時刻CSTより、対象ディスクリプタの送信時刻NSTの方が早いか、または、カレント送信時刻CSTと対象ディスクリプタの送信時刻NSTとが同じか」を判定する(S1521)。
対象ディスクリプタの優先度NPRがカレント優先度CPRより高い場合、ディスクリプタ実行管理部13は、図16の(B)に例示する更新処理を実行する。すなわち、ディスクリプタ実行管理部13は先ず、「カレント送信時刻CSTより、対象ディスクリプタの送信時刻NSTの方が早いか、または、カレント送信時刻CSTと対象ディスクリプタの送信時刻NSTとが同じか」を判定する(S1521)。
カレント送信時刻CSTより対象ディスクリプタの送信時刻NSTの方が早い、または、両者が同じであると(S1521でYES)、ディスクリプタ実行管理部13は、カレント変数を更新する(S1525)。具体的には、ディスクリプタ実行管理部13は、カレント送信時刻CSTの値を、対象ディスクリプタの送信時刻NSTの値によって更新する。また、ディスクリプタ実行管理部13は、カレント優先度CPRの値を、対象ディスクリプタの優先度NPRの値によって更新する。さらに、ディスクリプタ実行管理部13は、カレント転送時間CRTの値を、対象ディスクリプタに対応する送信データの転送時間NRTの値によって更新する。
S1521の判定において、「カレント送信時刻CST=0」の場合、ディスクリプタ実行管理部13は、「S1521でYES」であるとして次の処理へ遷移し、つまり、S1525を実行する。
カレント送信時刻CSTより対象ディスクリプタの送信時刻NSTの方が遅いと(S1521でNO)、ディスクリプタ実行管理部13は、カレントの転送実行後に対象データを転送した場合の終了時刻(つまり、予定合計時刻ERT)を計算する(S1523)。すなわち、ディスクリプタ実行管理部13は、「予定合計時刻ERT = 現在時刻CT +カレント転送時間CRT + 対象ディスクリプタの転送時間NRT」を算出する。
ディスクリプタ実行管理部13は、「対象ディスクリプタの送信時刻NST < 予定合計時刻ERT」であるかを判定し、つまり、「対象ディスクリプタの送信時刻NSTが予定合計時刻ERTより小さい(早い)か」を判定する(S1524)。
対象ディスクリプタの送信時刻NSTが予定合計時刻ERTより早い場合(S1524でYES)、ディスクリプタ実行管理部13は、カレント変数を更新する(S1525)。対象ディスクリプタの送信時刻NSTが予定合計時刻ERTと同じ、または、対象ディスクリプタの送信時刻NSTが予定合計時刻ERTより大きい(遅い)場合(S1524でNO)、ディスクリプタ実行管理部13は、更新処理を終了する。
ここで、図16の(B)では、対象ディスクリプタの優先度NPRがカレント優先度CPRより高いから、対象ディスクリプタは「図6の高優先ディスクリプタ」に対応し、カレントディスクリプタは「図6の低優先ディスクリプタ」に対応する。また、図16の(B)において、送信時刻NSTは、図6の「高優先ディスクリプタの規定する送信時刻TT(高優先)」に対応する。
したがって、図16の(B)のS1524は、図6のS130と同様の判定を行っている。すなわち、S1524でYESだと、ディスクリプタ実行管理部13は、高優先ディスクリプタに対応する対象ディスクリプタが、現在時刻CTにおいて実行されるディスクリプタとして選択されるように、カレントディスクリプタを更新する。
また、S1524でNOだと、ディスクリプタ実行管理部13は、低優先ディスクリプタに対応するカレントディスクリプタが、現在時刻CTにおいて実行されるディスクリプタとして選択されるように、カレントディスクリプタの更新を実行しない。
(対象ディスクリプタの優先度がカレント優先度より低い場合の更新処理例)
図17は、図15に例示した更新処理(S1500)について、対象ディスクリプタの優先度NPRがカレント優先度CPRより低い場合の例を示すフロー図である。図17に示すように、ディスクリプタ実行管理部13は先ず、「カレント送信時刻CSTより、対象ディスクリプタの送信時刻NSTの方が早いか」を判定する(S1531)。
図17は、図15に例示した更新処理(S1500)について、対象ディスクリプタの優先度NPRがカレント優先度CPRより低い場合の例を示すフロー図である。図17に示すように、ディスクリプタ実行管理部13は先ず、「カレント送信時刻CSTより、対象ディスクリプタの送信時刻NSTの方が早いか」を判定する(S1531)。
カレント送信時刻CSTより対象ディスクリプタの送信時刻NSTの方が早いと(S1531でYES)、ディスクリプタ実行管理部13は、カレントの転送実行後に対象データを転送した場合の終了時刻(つまり、予定合計時刻ERT)を計算する(S1523)。すなわち、ディスクリプタ実行管理部13は、「予定合計時刻ERT = 現在時刻CT +カレント転送時間CRT + 対象ディスクリプタの転送時間NRT」を算出する。
ディスクリプタ実行管理部13は、「カレント送信時刻CST < 予定合計時刻ERT」であるかを判定し、つまり、「カレント送信時刻CSTが予定合計時刻ERTより小さい(早い)か」を判定する(S1533)。カレント送信時刻CSTが予定合計時刻ERTより早い場合(S1533でYES)、ディスクリプタ実行管理部13は、更新処理を終了する。
カレント送信時刻CSTが予定合計時刻ERTと同じ、または、カレント送信時刻CSTが予定合計時刻ERTより大きい(遅い)場合(S1533でNO)、ディスクリプタ実行管理部13は、カレント変数を更新する(S1534)。
ここで、図17では、対象ディスクリプタの優先度NPRがカレント優先度CPRより低いから、対象ディスクリプタは「図6の低優先ディスクリプタ」に対応し、カレントディスクリプタは「図6の高優先ディスクリプタ」に対応する。また、図17において、カレント送信時刻CSTは、図6の「高優先ディスクリプタの規定する送信時刻TT(高優先)」に対応する。
したがって、図17のS1533は、図6のS130と同様の判定を行っている。すなわち、S1533でYESだと、ディスクリプタ実行管理部13は、高優先ディスクリプタに対応するカレントディスクリプタが、現在時刻CTにおいて実行されるディスクリプタとして選択されるように、カレントディスクリプタの更新を実行しない。
また、S1533でNOだと、ディスクリプタ実行管理部13は、低優先ディスクリプタに対応する対象ディスクリプタが、現在時刻CTにおいて実行されるディスクリプタとして選択されるように、カレントディスクリプタを更新する。
§4.変形例
(ネットワーク構成例について)
図2に例示した制御システム0において、複数のネットワーク3が、ネットワークハブ2を介して、PLC1に接続している。しかしながら、制御システム0において、1つのネットワーク3がネットワークハブ2を介さずにPLC1に接続し、例えば、PLC1と、1つ以上のネットワークデバイスとが、一筆書きの形式で互いに通信可能に接続されていてもよい。
(ネットワーク構成例について)
図2に例示した制御システム0において、複数のネットワーク3が、ネットワークハブ2を介して、PLC1に接続している。しかしながら、制御システム0において、1つのネットワーク3がネットワークハブ2を介さずにPLC1に接続し、例えば、PLC1と、1つ以上のネットワークデバイスとが、一筆書きの形式で互いに通信可能に接続されていてもよい。
(付記事項)
本発明の一態様に係る通信制御機器は、読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器であって、複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する選択部と、前記選択部によって選択された前記ディスクリプタを読み込む読込部と、を備えている。
本発明の一態様に係る通信制御機器は、読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器であって、複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する選択部と、前記選択部によって選択された前記ディスクリプタを読み込む読込部と、を備えている。
前記の構成によれば、前記通信制御機器は、複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する。そして、前記通信制御機器は、選択した前記ディスクリプタを読み込み、読み込んだ前記ディスクリプタに従って、前記メインメモリから前記送信バッファへと前記データを転送する。つまり、前記通信制御機器は、複数の前記ディスクリプタの中から、読み込むべきディスクリプタを、複数の前記ディスクリプタの各々の送信予定時刻および実行優先度の少なくとも一方に基づいて、1つずつ選択する。
そのため、前記通信制御機器は、各々がDMAC(Direct Memory Access Controller)および送信バッファを含む、複数の送信キューを備える必要がなく、実装サイズを小さくすることができる。
また、前記通信制御機器は、複数の前記ディスクリプタの読込順序を制御することによって、ソフトウェア(プロセッサ)による処理結果の出力等を、具体的には、前記データの送信順序を制御する。つまり、ソフトウェアは、前記通信制御機器を、「送信データの、送信順序および実際の送信時刻(実送信時刻)」の管理を行う送信キューを複数備えた、1つのハードウェアとして扱うことができる。そのため、前記通信制御機器は、処理結果の出力制御(例えば、「送信データの、送信順序および実送信時刻」の管理)等に係るソフトウェアの処理負荷を低減することができる。
したがって、前記通信制御機器は、実装サイズを抑制しつつ、ソフトウェアの処理負荷を低減することができるとの効果を奏する。
本発明の一態様に係る通信制御機器について、複数の前記ディスクリプタの中の或るディスクリプタの前記実行優先度が、別のディスクリプタの前記実行優先度よりも高い場合、前記選択部は、(A)現在時刻に、前記或るディスクリプタに対応するデータを前記メインメモリから前記送信バッファへと転送するのに要する転送時間と、前記別のディスクリプタに対応するデータを前記メインメモリから前記送信バッファへと転送するのに要する転送時間とを加えた時刻である予定合計時刻と、(B)前記或るディスクリプタの前記送信予定時刻とを比較し、前記或るディスクリプタの前記送信予定時刻が、前記予定合計時刻よりも後だと、前記或るディスクリプタに優先して前記別のディスクリプタを選択し、前記或るディスクリプタの前記送信予定時刻が、前記予定合計時刻以前だと、前記別のディスクリプタに優先して前記或るディスクリプタを選択してもよい。
前記の構成によれば、前記通信制御機器は、前記或る送信ディスクリプタの実行優先度が、前記別のディスクリプタの実行優先度よりも高いと、前記予定合計時刻と前記或るディスクリプタの前記送信予定時刻とを比較する。そして、前記或るディスクリプタの前記送信予定時刻が、前記予定合計時刻よりも後だと、前記通信制御機器は、前記或るディスクリプタに優先して前記別のディスクリプタを選択する。また、前記或るディスクリプタの前記送信予定時刻が、前記予定合計時刻以前だと、前記通信制御機器は、前記別のディスクリプタに優先して前記或るディスクリプタを選択する。
ここで、複数の前記ディスクリプタの各々において規定されている実行優先度のみに基づいて、読み込むべきディスクリプタを選択した場合、実行優先度が低いディスクリプタは、常に、実行優先度が高いディスクリプタよりも後に読み込まれることになる。
しかし、前記或るディスクリプタより実行優先度が低い前記別のディスクリプタの送信予定時刻が、前記或るディスクリプタの送信予定時刻よりも十分に早い場合、実行優先度のみに従ってディスクリプタの読込順序を決定することは、必ずしも適切ではない。
例えば、前記別のディスクリプタに対応する送信データを前記メインメモリに転送した後であっても、前記或る送信ディスクリプタに対応する送信データを、前記或る送信ディスクリプタの送信予定時刻よりも前に、前記メインメモリへと転送できる場合がある。そのような場合、前記別のディスクリプタを読み込んだ(実行した)後に、前記或るディスクリプタを読み込めばよく、つまり、前記別のディスクリプタを、前記或る送信ディスクリプタよりも先に読み込むべきである。
また、複数の前記ディスクリプタの各々において規定されている送信予定時刻のみに基づいて、読み込むべきディスクリプタを選択した場合、送信予定時刻が遅いディスクリプタは、常に、送信予定時刻が早いディスクリプタよりも後に読み込まれることになる。
しかし、前記或るディスクリプタよりも実行優先度が低い前記別のディスクリプタの送信予定時刻が、前記或るディスクリプタの送信予定時刻の直前である場合、送信予定時刻のみに従ってディスクリプタの読込順序を決定することは、必ずしも適切ではない。
例えば、前記別のディスクリプタに対応する送信データを前記メインメモリに転送した後では、前記或る送信ディスクリプタに対応する送信データを、前記或る送信ディスクリプタの送信予定時刻よりも前に、前記メインメモリへと転送できない場合がある。そのような場合、前記別のディスクリプタを読み込む(実行する)前に、前記或るディスクリプタを読み込まなくてはならず、つまり、前記或るディスクリプタを、前記別の送信ディスクリプタよりも先に読み込むべきである。
前記通信制御機器は、実行優先度のみに従ったディスクリプタの読込順序の決定、および、送信予定時刻のみに従ったディスクリプタの読込順序の決定の各々が有する上述の不備を補う。すなわち、複数の前記ディスクリプタの中の或るディスクリプタの前記実行優先度が、別のディスクリプタの前記実行優先度よりも高い場合、前記通信制御機器は、前記予定合計時刻と前記或るディスクリプタの前記送信予定時刻とを比較する。そして、前記通信制御機器は、前記予定合計時刻と前記或るディスクリプタの前記送信予定時刻との比較結果に基づいて、読み込むべきディスクリプタを選択する。
したがって、前記通信制御機器は、実行優先度および送信予定時刻のいずれか一方にのみ従って読み込むべきディスクリプタを選択する方法に比べて、読み込むべきディスクリプタを適切に選択することができるとの効果を奏する。
本発明の一態様に係る通信制御機器において、判定時間が予め設定されており、前記読込部は、前記ディスクリプタの送信予定時刻から前記判定時間を遡った時刻になってから、前記ディスクリプタを読み込んでもよい。
前記の構成によれば、前記通信制御機器は、前記ディスクリプタの送信予定時刻から前記判定時間を遡った時刻になってから、前記ディスクリプタを読み込む。
ここで、或るディスクリプタを読み込んだ後に、前記或るディスクリプタの送信予定時刻よりも現在時刻に近い時刻を送信予定時刻とする別のディスクリプタが生成された場合、以下の問題が発生する。すなわち、前記或るディスクリプタに対応するデータが障害となって、前記別のディスクリプタに対応するデータを、前記別のディスクリプタの送信予定時刻で送信することができないという問題が発生する。
これは、前記送信バッファに格納されたデータは、格納された順で送信されるからである。つまり、前記或るディスクリプタに対応するデータが前記別のディスクリプタに対応するデータより先に格納されたなら、前記或るディスクリプタに対応するデータが送信されてからでないと、前記別のディスクリプタに対応するデータは送信されない。そして、前記或るディスクリプタに対応するデータは、前記或るディスクリプタの送信予定時刻にならなければ送信されない。しかしながら、前記或るディスクリプタの送信予定時刻は、前記別のディスクリプタの送信予定時刻よりも後であるから、前記別のディスクリプタに対応するデータを、前記別のディスクリプタの送信予定時刻で送信することはできない。
そこで、前記通信制御機器は、前記ディスクリプタの送信予定時刻から前記判定時間を遡った時刻になってから、前記ディスクリプタを読み込むことによって、上述の問題が発生する可能性を抑制する。すなわち、前記或るディスクリプタの送信予定時刻よりも現在時刻に近い時刻を送信予定時刻とする前記別のディスクリプタを読み込む前に、前記或るディスクリプタを読み込むことがないよう、前記通信制御機器は、前記或るディスクリプタの読込時刻を調整する。具体的には、前記通信制御機器は、前記或るディスクリプタの送信予定時刻から前記判定時間を遡った時刻になってから、前記或るディスクリプタを読み込む。
したがって、前記通信制御機器は、前記或るディスクリプタの送信予定時刻よりも現在時刻に近い時刻を送信予定時刻とする前記別のディスクリプタを読み込む前に、前記或るディスクリプタを読み込むことを防ぐことができるとの効果を奏する。
本発明の一態様に係る通信制御機器において、前記送信バッファは、前記読込部が読み込んだ前記ディスクリプタの順に、前記ディスクリプタに対応する前記データが格納される通常送信バッファと、前記通常送信バッファに格納されている前記データに対応する前記ディスクリプタを前記選択部が選択してから、前記通常送信バッファに格納されている前記データが送信されるまでの間に前記読込部が読み込んだディスクリプタであって、前記通常送信バッファに格納されている前記データに対応する前記ディスクリプタよりも前記実行優先度が高いディスクリプタに対応する前記データが格納される特別送信バッファと、を含んでもよい。
前記の構成によれば、前記通信制御機器は、前記通常送信バッファと前記特別送信バッファとを含む前記送信バッファを備えている。そして、前記通信制御機器は、通常は、読み込んだ前記ディスクリプタの順に、読み込んだ前記ディスクリプタに対応するデータを、前記通常送信バッファに格納する。
前記通信制御機器は、「前記通常送信バッファに格納されている前記データに対応する前記ディスクリプタを選択してから、前記通常送信バッファに格納されている前記データを送信するまで」の間に新たなディスクリプタを読み込むと、以下の判定を実行する。すなわち、前記通信制御機器は、前記新たなディスクリプタの前記実行優先度が、前記通常送信バッファに格納されている前記データに対応する前記ディスクリプタの前記実行優先度よりも高いかを判定する。
そして、前記新たなディスクリプタの前記実行優先度の方が高い場合、前記通信制御機器は、前記新たなディスクリプタに対応するデータを、前記特別送信バッファに格納する。前記新たなディスクリプタの前記実行優先度の方が低い、または、前記実行優先度が同じ場合、前記通信制御機器は、前記新たなディスクリプタに対応するデータを、前記普通送信バッファに格納する。
ここで、前記選択部が或るディスクリプタを選択してから、前記或るディスクリプタに対応するデータが送信されるまでの間に、前記或るディスクリプタより前記実行優先度が高い別のディスクリプタを前記読込部が読み込む可能性がある。そのような場合、送信バッファが1つしかなかったとしたら、前記別のディスクリプタに対応するデータは、1つしかない送信バッファに、前記或るディスクリプタに対応するデータよりも後に格納されざるを得ない。その結果、前記別のディスクリプタに対応するデータを、前記或るディスクリプタに対応するデータよりも先に送信することは不可能となる。
これに対して、前記通信制御機器は、前記通常送信バッファと前記特別送信バッファとを含む前記送信バッファを備えている。そして、前記通信制御機器は、上述の通り、前記通常送信バッファに格納されているデータよりも優先して送信すべきデータが新たに発生すると、そのようなデータを前記特別送信バッファに格納する。
したがって、前記通信制御機器は、前記或るディスクリプタを選択してから、前記或るディスクリプタに対応するデータを送信するまでに発生した、前記或るディスクリプタに対応するデータより優先送信すべきデータを、優先送信できるとの効果を奏する。
本発明の一態様に係る制御方法は、読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器の制御方法であって、複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する選択ステップと、前記選択ステップにて選択された前記ディスクリプタを読み込む読込ステップと、を含んでいる。
前記の構成によれば、前記制御方法は、複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する。そして、前記制御方法は、選択した前記ディスクリプタを読み込み、読み込んだ前記ディスクリプタに従って、前記メインメモリから前記送信バッファへと前記データを転送する。つまり、前記制御方法は、複数の前記ディスクリプタの中から、読み込むべきディスクリプタを、複数の前記ディスクリプタの各々の送信予定時刻および実行優先度の少なくとも一方に基づいて、1つずつ選択する。
そのため、前記制御方法を実行する通信制御機器は、各々がDMACおよび送信バッファを含む、複数の送信キューを備える必要がなく、前記制御方法を実行する通信制御機器の実装サイズを小さくすることができる。
また、前記制御方法は、複数の前記ディスクリプタの読込順序を制御することによって、ソフトウェア(プロセッサ)による処理結果の出力等を、具体的には、前記データの送信順序を制御する。つまり、ソフトウェアは、前記通信制御機器を、「送信データの、送信順序および実送信時刻」の管理を行う送信キューを複数備えた、1つのハードウェアとして扱うことができる。そのため、前記通信制御機器は、処理結果の出力制御(例えば、「送信データの、送信順序および実送信時刻」の管理)等に係るソフトウェアの処理負荷を低減することができる。
したがって、前記制御方法は、前記制御方法を実行する通信制御機器の実装サイズを抑制しつつ、ソフトウェアの処理負荷を低減することができるとの効果を奏する。
本発明は上述した各実施形態に限定されるものではなく、請求項に示した範囲で種々の変更が可能であり、異なる実施形態にそれぞれ開示された技術的手段を適宜組み合わせて得られる実施形態についても本発明の技術的範囲に含まれる。
10 通信コントローラ(通信制御機器)
20 メインメモリ
162 バッファ(送信バッファ)
131 選択部
132 読込部
CT 現在時刻
ERT 予定合計時刻
JT 判定時間
P 優先度(実行優先度)
RT 転送時間
S20 選択ステップ
S30 読込ステップ
TT 送信時刻(送信予定時刻)
20 メインメモリ
162 バッファ(送信バッファ)
131 選択部
132 読込部
CT 現在時刻
ERT 予定合計時刻
JT 判定時間
P 優先度(実行優先度)
RT 転送時間
S20 選択ステップ
S30 読込ステップ
TT 送信時刻(送信予定時刻)
Claims (5)
- 読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器であって、
複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する選択部と、
前記選択部によって選択された前記ディスクリプタを読み込む読込部と
を備える通信制御機器。 - 複数の前記ディスクリプタの中の或るディスクリプタの前記実行優先度が、別のディスクリプタの前記実行優先度よりも高い場合、前記選択部は、
(A)現在時刻に、前記或るディスクリプタに対応するデータを前記メインメモリから前記送信バッファへと転送するのに要する転送時間と、前記別のディスクリプタに対応するデータを前記メインメモリから前記送信バッファへと転送するのに要する転送時間とを加えた時刻である予定合計時刻と、(B)前記或るディスクリプタの前記送信予定時刻とを比較し、
前記或るディスクリプタの前記送信予定時刻が、前記予定合計時刻よりも後だと、前記或るディスクリプタに優先して前記別のディスクリプタを選択し、
前記或るディスクリプタの前記送信予定時刻が、前記予定合計時刻以前だと、前記別のディスクリプタに優先して前記或るディスクリプタを選択する
請求項1に記載の通信制御機器。 - 判定時間が予め設定されており、
前記読込部は、前記ディスクリプタの送信予定時刻から前記判定時間を遡った時刻になってから、前記ディスクリプタを読み込む
請求項1または2に記載の通信制御機器。 - 前記送信バッファは、
前記読込部が読み込んだ前記ディスクリプタの順に、前記ディスクリプタに対応する前記データが格納される通常送信バッファと、
前記通常送信バッファに格納されている前記データに対応する前記ディスクリプタを前記選択部が選択してから、前記通常送信バッファに格納されている前記データが送信されるまでの間に前記読込部が読み込んだディスクリプタであって、前記通常送信バッファに格納されている前記データに対応する前記ディスクリプタよりも前記実行優先度が高いディスクリプタに対応する前記データが格納される特別送信バッファと
を含む
請求項1から3のいずれか1項に記載の通信制御機器。 - 読み込んだディスクリプタに従ってメインメモリから送信バッファへとデータを転送し、前記送信バッファに転送された前記データを送信する通信制御機器の制御方法であって、
複数の前記ディスクリプタの各々において規定されている、送信予定時刻および実行優先度の少なくとも一方に基づいて、複数の前記ディスクリプタの中から、読み込むディスクリプタを選択する選択ステップと、
前記選択ステップにて選択された前記ディスクリプタを読み込む読込ステップと
を含む制御方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2020039984A JP7419889B2 (ja) | 2020-03-09 | 2020-03-09 | 通信制御機器および通信制御機器の制御方法 |
| JP2020-039984 | 2020-03-09 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021181875A1 true WO2021181875A1 (ja) | 2021-09-16 |
Family
ID=77669693
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/JP2021/001404 Ceased WO2021181875A1 (ja) | 2020-03-09 | 2021-01-18 | 通信制御機器および通信制御機器の制御方法 |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP7419889B2 (ja) |
| WO (1) | WO2021181875A1 (ja) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004343734A (ja) * | 2003-04-23 | 2004-12-02 | Sumitomo Electric Ind Ltd | 光加入者線端局装置およびフレームスケジューリング方法 |
| JP2005258509A (ja) * | 2004-03-09 | 2005-09-22 | Fujitsu Ltd | ストレージ装置 |
| WO2018146899A1 (ja) * | 2017-02-07 | 2018-08-16 | オムロン株式会社 | 制御装置および通信装置 |
-
2020
- 2020-03-09 JP JP2020039984A patent/JP7419889B2/ja active Active
-
2021
- 2021-01-18 WO PCT/JP2021/001404 patent/WO2021181875A1/ja not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2004343734A (ja) * | 2003-04-23 | 2004-12-02 | Sumitomo Electric Ind Ltd | 光加入者線端局装置およびフレームスケジューリング方法 |
| JP2005258509A (ja) * | 2004-03-09 | 2005-09-22 | Fujitsu Ltd | ストレージ装置 |
| WO2018146899A1 (ja) * | 2017-02-07 | 2018-08-16 | オムロン株式会社 | 制御装置および通信装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2021141537A (ja) | 2021-09-16 |
| JP7419889B2 (ja) | 2024-01-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP3607445B1 (en) | System and method for timely and uniform distribution for real-time packet transmission | |
| EP4152166B1 (en) | Memory access technology and computer system | |
| EP3457644B1 (en) | Transfer device, transfer method, and computer-readable medium | |
| JP7354361B2 (ja) | 処理装置、処理方法及びプログラム | |
| JP2011505037A (ja) | 読出しデータバッファリングのシステム及び方法 | |
| JP7000088B2 (ja) | 通知制御装置、通知制御方法及びプログラム | |
| US9703736B2 (en) | Data transmission apparatus, communication control method, and communication control program | |
| CN101218567B (zh) | 访问控制装置、访问控制集成电路以及访问控制方法 | |
| KR20020008955A (ko) | 버스 시스템 및 그 실행 순서 조정방법 | |
| CN120972800A (zh) | 工业控制方法及系统、介质、设备和程序产品 | |
| US6728834B2 (en) | System and method for effectively implementing isochronous processor cache | |
| JP2021141537A (ja) | 通信制御機器および通信制御機器の制御方法 | |
| CN118175111B (zh) | 一种数据传输方法、dma控制器、设备及存储介质 | |
| JP2018129613A (ja) | 制御装置および通信装置 | |
| JP2006217494A (ja) | 通信システム及び通信方法 | |
| JP2008146357A (ja) | プログラマブルコントローラ、及びその支援装置 | |
| WO2022185581A1 (ja) | 制御装置およびデータ転送方法 | |
| JP2007018400A (ja) | バス・システム、バス管理装置、ノード装置、およびバス管理装置用のプログラム | |
| US6438633B1 (en) | System for providing deterministic performance from a non-deterministic device | |
| US6847650B1 (en) | System and method for utilizing a memory device to support isochronous processes | |
| JP7494494B2 (ja) | 通信制御機器および通信制御機器の制御方法 | |
| JP7844296B2 (ja) | コントローラ | |
| US9405719B2 (en) | Circuitry to generate and/or use at least one transmission time in at least one descriptor | |
| Bartolini et al. | Using priority inheritance techniques to override the size limit of CAN messages | |
| CN121681039A (zh) | 基于Linux设备树的SPI消息调度方法和系统 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21767880 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21767880 Country of ref document: EP Kind code of ref document: A1 |