Control apparatus

The control device optimizes data transfer by activating DMA controllers post-storage, allowing parallel processing and reducing CPU involvement, thus enhancing arithmetic processing efficiency and control cycle speed.

JP2024144216APending Publication Date: 2024-10-11MITSUBISHI ELECTRIC CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024040185
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-28
Filing Date
2024-03-14
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing control devices face inefficiencies in data transfer between shared and cache memory, leading to extended CPU processing times due to the need for CPU involvement in activating DMA controllers, which hinders arithmetic processing.

Method used

A control device configuration that includes a processor, DMA controller, shared memory, and communication device, where the communication device activates the DMA controller after data storage, allowing the DMA controller to transfer data directly between shared and cache memory based on pre-configured settings, thereby reducing CPU involvement.

Benefits of technology

This configuration secures more time for the processor to perform arithmetic processing by parallelizing data transfer and reducing CPU overhead, enabling faster control cycles and improved responsiveness in feedback control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024144216000001_ABST
    Figure 2024144216000001_ABST
Patent Text Reader

Abstract

To provide a technique capable of ensuring as much time as possible for a processor to execute arithmetic processing using received data in a control apparatus for controlling a device to be controlled.SOLUTION: A control apparatus for controlling a device to be controlled comprises: a processor having a cache memory; a DMA controller having a descriptor; a shared memory; and a communication apparatus for communicating with the device to be controlled via a connection port. The communication apparatus stores a received frame that is received via the connection port in the shared memory, and then starts the DMA controller by transmitting a start signal to the DMA controller. The DMA controller selects a first entry corresponding to the received frame from among the plurality of entries included in the descriptor, and transfers the received frame from the shared memory to the cache memory based on setting information regarding DMA transfer included in the selected first entry.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present disclosure relates to a control device. [Background technology]

[0002] Programmable logic controllers (hereafter referred to as PLCs), computer numerical control (hereafter referred to as CNC) devices, etc. are connected to I / O devices, inverters, servo amplifiers, etc. via industrial networks. A communication cycle is set in the industrial network to stably control multiple devices, thereby ensuring real-time performance.

[0003] However, the control cycle may differ depending on the connected device, and there may be device control data and other data, etc. Therefore, in order for the CPU (Central Processing Unit) to process more important data, it is considered to transfer higher priority data to the shared memory first.

[0004] For example, a communication control device according to International Publication No. 2021 / 181874 (Patent Document 1) stores received data received from a network in one of a plurality of reception queues to which different priorities have been assigned in advance in order to transfer the received data to a main memory. The communication control device selects a reception queue in which to store the received data from among the plurality of reception queues according to a reference table. [Prior art documents] [Patent documents]

[0005] [Patent Document 1] International Publication No. 2021 / 181874 Summary of the Invention [Problem to be solved by the invention]

[0006] According to Patent Document 1, it is believed that more high-priority data can be transferred to the main memory. However, in order for the CPU to perform processing such as calculations using the data, the CPU needs to transfer (copy) the data between the shared memory and the cache memory, which consumes time for the CPU to perform processing such as calculations.

[0007] It is possible to shorten the data transfer time by having a DMA (Direct Memory Access) controller perform the data transfer process instead of the CPU. In this case, the CPU needs time to perform the setting process to start the DMA controller every time data is received from the network. This causes the execution time of other processes executed by the CPU to be extended, and the time that the CPU could have spent on calculations and other processes is consumed.

[0008] An object in one aspect of the present disclosure is to provide a technique that can ensure as much time as possible for a processor to execute arithmetic processing using received data in a control device that controls a controlled device. [Means for solving the problem]

[0009] According to one embodiment, a control device for controlling a controlled device is provided. The control device includes a processor having a cache memory, a DMA controller having a descriptor, a shared memory, and a communication device that communicates with the controlled device via a connection port. The communication device stores a received frame received via the connection port in the shared memory, and then starts the DMA controller by sending an activation signal to the DMA controller. The DMA controller selects a first entry corresponding to the received frame from among multiple entries included in the descriptor, and transfers the received frame from the shared memory to the cache memory based on setting information related to DMA transfer included in the selected first entry. Effect of the Invention

[0010] According to the present disclosure, in a control device that controls a controlled device, it is possible to ensure as much time as possible for a processor to execute arithmetic processing using received data. [Brief description of the drawings]

[0011] [Figure 1] 1 is a diagram showing an example of an overall configuration of a control system according to an embodiment of the present invention; [Diagram 2] 10 is a diagram for explaining an example of a method for generating a DMA execution number; [Diagram 3] 11 is a diagram for explaining an example of a method for selecting DMA setting information. FIG. [Figure 4] FIG. 1 is a diagram for explaining an example of a conventional data transfer method. [Diagram 5] 1 is a diagram for explaining an example of a data transfer method according to the present embodiment. FIG. [Figure 6] 11 is a diagram for explaining another example of a data transfer method according to the present embodiment. FIG. [Figure 7] 13 is a flowchart showing an example of a processing procedure of DMAC. [Figure 8] FIG. 11 is a diagram for explaining a data transfer method according to a modified example of the present embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0012] Hereinafter, an embodiment of the present disclosure will be described with reference to the drawings. In the following description, the same components are denoted by the same reference numerals. The names and functions of the components are also the same. Therefore, detailed description thereof will not be repeated.

[0013] <Overall composition> Fig. 1 is a diagram showing an example of an overall configuration of a control system according to the present embodiment. Referring to Fig. 1, a control system 1000 includes a control device 100 and a plurality of control-target devices 20_1 to 20_6 (hereinafter also collectively referred to as "control-target devices 20").

[0014] The control device 100 is, for example, an industrial controller such as a PLC. However, the control device 100 is not limited to an industrial controller and may be any control device. The controlled device 20 is an I / O device, an inverter, or the like.

[0015] The control device 100 is connected to each of the control target devices 20 via an industrial network, and transmits and receives data to and from each of the control target devices 20. For example, CC-Link IE TSN (registered trademark), EtherCAT (registered trademark), PROFINET (registered trademark), etc. are adopted as the industrial network. Note that in Fig. 1, the control device 100 and the control target devices 20 are connected in a topology called a line connection, but this is only an example and does not restrict the connection topology.

[0016] The control device 100 includes a processor 10, a shared memory 11, a communication device 12, and a DMA controller (hereinafter also referred to as "DMAC") 13. The control device 100 may also include other hardware. A part or all of the configuration of the control device 100 may be realized by a single component such as a SystemOnChip (hereinafter also referred to as "SoC"), or may be realized by individual components.

[0017] The processor 10 is composed of, for example, a CPU, a microprocessor unit (MPU), etc. The processor 10 reads various programs stored in a storage (not shown) and performs control according to the control target device 20. The processor 10 generates transmission data, sets the communication device 12, and executes other necessary processes in order to control the control target device 20. The storage is composed of, for example, a non-volatile storage device such as a hard disk drive (HDD) or a solid state drive (SSD).

[0018] The processor 10 also has a cache memory 101 for reducing the frequency of access to the shared memory 11, main memory, etc., to execute processing at high speed.

[0019] The shared memory 11 is a memory for sharing data between the processor 10 and peripheral devices other than the processor 10 (e.g., the communication device 12, etc.). The shared memory 11 is composed of, for example, a dynamic random access memory (DRAM), a static random access memory (SRAM), a memory in an SoC, etc. Also, a part of the main memory may be used as the shared memory 11, or the shared memory 11 may be provided separately from the main memory.

[0020] The communication device 12 communicates with each of the controlled devices 20 via the industrial network at a specified communication cycle. The communication device 12 has a plurality of connection ports 121, 122 connected to the industrial network. In the example of Fig. 1, the communication device 12 transmits and receives data to and from the controlled devices 20_1 to 20_4 via the connection port 121, and transmits and receives data to and from the controlled devices 20_5, 20_6 via the connection port 122. The number of connection ports is not limited to two, and may be one, or three or more.

[0021] The communication device 12 starts transmitting and receiving frames (data) to and from the controlled device 20 when the communication cycle is switched. Received frames received from the controlled device 20 and transmitted frames transmitted to the controlled device 20 are stored in the shared memory 11 that can be referenced by the processor 10. The storage locations in the shared memory 11 for the transmitted frames and received frames may be specified in advance, or may be specified by the processor 10 setting addresses in the communication device 12. The communication device 12 obtains the transmitted frames from the shared memory 11 and stores the received frames in the shared memory 11 according to the advance specification or address setting.

[0022] The communication device 12 executes an error check on the received frame in accordance with the protocol of the industrial network employed. When an industrial network based on Ethernet (registered trademark) is employed, the communication device 12 executes the error check using, for example, a Frame Check Sequence (FCS). When the communication device 12 determines that the received frame is normal based on the result of the error check, the communication device 12 stores the received frame in the shared memory 11. Next, the communication device 12 issues a start-up signal for starting the DMAC 13 (i.e., transmits a start-up signal to the DMAC 13), thereby starting the DMAC 13. Note that, when the received frame is abnormal, the communication device 12 does not store the received frame in the shared memory 11, and does not transmit a start-up signal to the DMAC 13.

[0023] The wake-up signal is, for example, a logic signal that connects the communication device 12 and the DMAC 13 one-to-one, and is notified by a pulse or a level. Note that the wake-up signal may be notified by a message using a bus, such as a Message Signaled Interrupt (MSI) of PCI Express (registered trademark).

[0024] After storing a received frame that is determined to be normal in shared memory 11, communication device 12 transmits a DMA execution number together with a start signal to DMAC 13. The DMA execution number is information for specifying DMA setting information corresponding to each received frame. The DMA setting information is setting information related to DMA transfer for data transfer processing by DMAC 13, and is stored in a descriptor of DMAC 13. As will be described later, the descriptor has multiple entries, and each entry is assigned a number. The descriptor stores multiple pieces of DMA setting information in multiple entries, respectively.

[0025] The DMA execution number is generated based on the prescribed information included in the received frame, the network connection port information, the communication cycle information, etc. The prescribed information is, for example, the source address, type, etc.

[0026] Fig. 2 is a diagram for explaining an example of a method for generating a DMA execution number. Here, a method for generating a DMA execution number based on prescribed information of a received frame will be explained. Referring to Fig. 2, a received frame includes a plurality of fields 31 to 35. Fields 31, 32, 33, 34, and 35 store a destination MAC address, a source MAC address, a type, a payload, and an FCS, respectively.

[0027] The communication device 12 extracts a value indicated by the prescribed information (e.g., source MAC address, type) of the received frame. For example, the communication device 12 extracts the type value of the field 33. If the field 33 is 2 bytes, the type value can be 0 to 65535.

[0028] The communication device 12 includes, as a DMA execution number generating function, a set value storage unit 50, a plurality of comparators 52_0 to 52_n, and a generator 54. The set value storage unit 50 stores set values ​​corresponding to entries of the descriptor of the DMAC 13. For example, a set value X0 is a set value corresponding to entry 0, a set value X1 is a set value corresponding to entry 1, and a set value Xn is a set value corresponding to entry n. The set values ​​corresponding to each entry are preset by the processor 10.

[0029] The comparator 52_0 compares the value of the stipulation information (here, the type value) with the setting value X0 corresponding to entry 0, and if they are the same, outputs "0", which is the number of entry 0. If they are not the same, the comparator 52_0 outputs a number indicating that they are not the same (however, a number other than 0 to n), or does not output anything. Similarly, the comparator 52_n compares the type value with the setting value Xn, and if they are the same, outputs "n", which is the number of entry n.

[0030] The generator 54 outputs one of the numbers 0 to n as the DMA execution number based on the output results of each of the comparators 52_0 to 52_n. For example, if the type value (e.g., 0) is the same as the value (e.g., 0) of the setting value X9 corresponding to the entry 9, the generator 54 generates the number of the entry corresponding to the setting value X9 (i.e., 9) as the DMA execution number.

[0031] As described above, the communication device 12 compares the multiple setting values ​​X0 to Xn corresponding to the multiple entries 0 to n, respectively, with the value indicated by the specification information included in the received frame (e.g., the type value), thereby determining the setting value corresponding to the specification information from among the multiple setting values ​​X0 to Xn (e.g., the same setting value as the type value), and transmits the number of the entry corresponding to the setting value (e.g., the DMA execution number) to the DMAC 13 together with a start signal.

[0032] In the example of Fig. 2, a configuration in which the value of the type is applied as the value of the stipulated information has been described, but the present invention is not limited to this configuration. For example, in addition to field values ​​included in the header such as the destination MAC address, source MAC address, and type, field values ​​such as subheaders in the payload prepared in the industrial network may be applied as the value of the stipulated information, and there is no need to restrict the field position.

[0033] Note that, if the order of received frames is fixed due to the system configuration or the like, communication device 12 does not need to notify the DMA execution number to DMAC 13. Typically, communication device 12 notifies DMAC 13 of the DMA execution number when the order of received frames is not fixed, or when the same frame is not necessarily received every cycle.

[0034] 1 again, DMAC 13 executes a DMA transfer process (hereinafter also simply referred to as a "transfer process") for directly transferring data between shared memory 11 and cache memory 101 without going through processor 10. When DMAC 13 receives a start signal and a DMA execution number from communication device 12, it selects an entry corresponding to a received frame from among a plurality of entries included in the descriptor, and transfers the received frame from shared memory 11 to cache memory 101 based on the DMA setting information included in the selected entry.

[0035] 3 is a diagram for explaining an example of a method for selecting DMA setting information. Referring to FIG. 3, DMAC 13 includes a descriptor 60 and a selector 61 as a function for selecting DMA setting information.

[0036] The descriptor 60 includes a plurality of entries 0 to n. The selector 61 compares the numbers of the plurality of entries 0 to n with the DMA execution number received from the communication device 12, selects an entry having the same number as the DMA execution number, and outputs the DMA setting information of the entry.

[0037] In this way, the DMAC 13 selects a desired entry from among the multiple entries based on the entry number corresponding to the DMA execution number. Specifically, the DMAC 13 selects an entry having the same number as the DMA execution number from among the multiple entries as the desired entry. Then, the DMAC 13 transfers the received frame from the shared memory 11 to the cache memory 101 based on the DMA setting information included in the selected entry.

[0038] Each of the entries 0 to n of the descriptor 60 includes, as DMA setting information, a transfer source address, a transfer destination address, size information of transfer data (for example, the amount of transfer data), a wait flag, and an end flag.

[0039] The source address is the address of the source of data when the DMAC 13 transfers data. The destination address is the address of the destination of data when the DMAC 13 transfers data. For example, when the shared memory 11 is set as the source of data and the cache memory 101 is set as the destination of data, the DMAC 13 transfers the received frame from the shared memory 11 to the cache memory 101 according to the source address, destination address, and amount of data to be transferred.

[0040] The wait flag is information that indicates whether or not DMAC13 will execute transfer processing based on the DMA setting information of another entry after completing transfer processing based on the DMA setting information of an entry (e.g., source address, destination address, and amount of transfer data).

[0041] For example, when the wait flag of the selected entry k is 0, the DMAC 13 executes a second transfer process based on the DMA setting information of another entry after completing a first transfer process based on the DMA setting information of the entry k. On the other hand, when the wait flag of the entry k is 1, the DMAC 13 transmits transfer completion information indicating the completion of the DMA transfer process to the communication device 12 after completing the first transfer process. In this case, the DMAC 13 waits until a new start signal is received from the communication device 12 without executing the second transfer process.

[0042] The end flag indicates whether an entry is the last entry or not. For example, when the end flag is 0, it indicates that the entry having the end flag is not the last entry, and when the end flag is 1, it indicates that the entry having the end flag is the last entry.

[0043] In the above, if the DMA execution number is not notified, the DMAC 13 may execute a transfer process based on the DMA setting information included in the first entry of the descriptor, for example.

[0044] Alternatively, each entry may be implemented as a memory. In this case, the DMAC 13 may perform read access to the memory using the DMA execution number as an address, and obtain the DMA setting information included in the entry as read data.

[0045] 1 again, DMAC 13 may have multiple channels (hereinafter referred to as "CH") of setting circuits having descriptors 60. As in the example of FIG. 1, when communication device 12 has two connection ports 121 and 122, DMAC 13 has multiple setting circuits (i.e., multiple descriptors 60), and therefore, even when the same type of frame is received, different DMA transfer settings can be made for each connection port. DMAC 13 can also execute DMA transfer processing for frames received from the two connection ports in parallel.

[0046] Furthermore, even when frames are sent and received using the same connection port, if the frames sent and received differ depending on the type of communication cycle (e.g., number), different DMA setting information can be used for each communication cycle by having a setting circuit for each communication cycle number.

[0047] The communication device 12 receives the transfer completion information of the DMA transfer process from the DMAC 13 the same number of times that the DMAC 13 is started (i.e., the number of times that the start signal is transmitted). Since there is usually a difference between the data rate at which frames are received from the industrial network and the data rate at which the DMA transfer process is performed, a queue or the like is used to manage the number of times that the DMAC 13 is started and the number of times that the transfer completion information is received.

[0048] When the communication device 12 ends communication cycle T1 and switches to communication cycle T2, and receives transfer completion information from the DMAC 13 for multiple received frames received during the communication cycle T1, the communication device 12 transmits cycle completion information to the processor 10 indicating the completion of the transfer process for each received frame during the communication cycle T1.

[0049] When the cycle completion information is transmitted, the transfer process of the received frame from the shared memory 11 to the cache memory 101 is completed. Therefore, the processor 10 can execute a calculation using the received frame stored in the cache memory 101 from the time when the cycle completion information is received from the communication device 12, and can utilize most of the time of the communication cycle for the calculation.

[0050] <Data transfer method> The data transfer method according to the present embodiment will be described below. First, in order to facilitate understanding of the effects of the present embodiment, a conventional data transfer method will be described.

[0051] Fig. 4 is a diagram for explaining an example of a conventional data transfer method. Referring to Fig. 4, a communication device is provided with two connection ports P1 and P2, and receives frames using each of the connection ports P1 and P2.

[0052] In a communication cycle T1, the communication device receives frames 1_1, 1_2, . . . , 1_N via a connection port P1, and receives frames 2_1, 2_2, . . . , 2_M via a connection port P2. The communication device stores the received frames 1_1 to 1_N and frames 2_1 to 2_M in a shared memory.

[0053] In a communication cycle T2, the communication device similarly receives each of the frames 1_1 to 1_N and the frames 2_1 to 2_M and stores them in the shared memory. The processor transfers each of the frames 1_1 to 1_N and the frames 2_1 to 2_M received in the communication cycle T1 from the shared memory to the cache memory. After the transfer is completed, the processor executes arithmetic processing and other processing using each of the received frames.

[0054] In this way, in the conventional data transfer method, the frames received in the communication cycle T1 are transferred from the shared memory to the cache memory by the processor after the communication cycle T1 is switched to the communication cycle T2. Therefore, in the communication cycle T2, the processor cannot secure sufficient time to perform processing such as calculations using each frame. The same is true for the communication cycle T3.

[0055] Fig. 5 is a diagram for explaining an example of a data transfer method according to the present embodiment. With reference to Fig. 5, communication device 12 receives frames using connection ports P1 and P2 (for example, ports 121 and 122 in Fig. 1). In the example of Fig. 5, it is assumed that the wait flags in the DMA setting information of each of frames 1_1 to 1_N and each of frames 2_1 to 2_M are "1".

[0056] In each communication cycle T1 to T3, communication device 12 receives frames 1_1 to 1_N via connection port P1 and receives frames 2_1 to 2_M via connection port P2, and stores these frames in shared memory 11, similar to the example of FIG.

[0057] In each of communication cycles T1 to T3, the communication device 12 according to the present embodiment stores each frame received in the shared memory 11 and transmits a start signal to the DMAC 13. In the example of Fig. 5, the DMAC 13 has setting circuits having descriptors 60 for two CHs (i.e., CH1 and CH2). For example, the descriptor 60 for CH1 is associated with the connection port P1, and the descriptor 60 for CH2 is associated with the connection port P2. Therefore, the descriptor 60 for CH1 stores DMA setting information for DMA transfer of each of the frames 1_1 to 1_N, and the descriptor 60 for CH2 stores DMA setting information for DMA transfer of each of the frames 2_1 to 2_M.

[0058] After storing frame 1_1 in the shared memory 11, the communication device 12 selects a DMA execution number based on the type of frame 1_1, and transmits the DMA execution number and an activation signal for activating the descriptor 60 for CH1 to the DMAC 13. The DMAC 13 selects an entry corresponding to the DMA execution number from a plurality of entries of the descriptor 60 for CH1, and transfers frame 1_1 from the shared memory 11 to the cache memory 101 according to the DMA setting information of the selected entry. The DMAC 13 transmits transfer completion information for frame 1_1 to the communication device 12 at time t2.

[0059] For each of the frames 1_2 to 1_N, the same process is executed by the communication device 12 and the DMAC 13. The DMAC 13 transmits transfer completion information for the frames 1_2 and 1_N to the communication device 12 at times t4 and t5, respectively.

[0060] Furthermore, after storing frame 2_1 in the shared memory 11, the communication device 12 transmits to the DMAC 13 a DMA execution number based on the type of frame 2_1 and an activation signal for activating the descriptor 60 for CH2. The DMAC 13 selects an entry corresponding to the DMA execution number from a plurality of entries of the descriptor 60 for CH2, and transfers frame 2_1 from the shared memory 11 to the cache memory 101 according to the DMA setting information of the selected entry. The DMAC 13 transmits transfer completion information for frame 2_1 to the communication device 12 at time t1.

[0061] For each of the frames 2_2 to 2_M, the same process is executed by the communication device 12 and the DMAC 13. Note that the DMAC 13 transmits transfer completion information for the frames 2_2 and 2_M to the communication device 12 at times t3 and t6, respectively.

[0062] When the communication device 12 receives the transfer completion information for all frames 1_1-1_N, 2_1-2_M from the DMAC 13 and determines that the communication cycle T1 has ended and switched to the communication cycle T2, the communication device 12 transmits cycle completion information indicating the completion of the transfer process in the communication cycle T1 to the processor 10. For example, the communication device 12 determines that it has received all the transfer completion information when it has received the transfer completion information the same number of times as the number of times the start-up signal was transmitted. In the example of FIG. 5, at time t6, the communication device 12 determines that it has received all the transfer completion information.

[0063] When the processor 10 receives the cycle completion information, the transfer of each of the frames 1_1 to 1_N and 2_1 to 2_M from the shared memory 11 to the cache memory 101 is completed. Therefore, the processor 10 can execute arithmetic processing and other processing using each frame immediately after receiving the cycle completion information (for example, at the beginning of the communication cycle T2). This allows the processor 10 to utilize a large amount of time for the arithmetic processing, etc.

[0064] Therefore, according to the present embodiment, it is possible to control more control target devices 20 in the same communication cycle than in the conventional example. Furthermore, if there is no difference in the number of control target devices 20, the present embodiment can shorten the communication cycle than the conventional example.

[0065] Furthermore, when feedback control is performed such that the transmission frame is changed based on the received frame from the communication cycle in which the received frame is received, the control cycle from reception to transmission can be shortened, and the responsiveness of the feedback control can be improved.

[0066] Also, in the conventional example, the duration of a communication cycle is determined by the longer of either the "time to communicate a frame" or the "total time of frame transfer time and processing time such as calculations to be performed in the next communication cycle." On the other hand, in the present embodiment, frame communication and frame transfer are performed in parallel. Therefore, the duration of a communication cycle is generally determined by the longer of either the "time to communicate a frame" or the "processing time such as calculations." Therefore, in the conventional example, if the above total time is longer than the time to communicate a frame, the communication cycle can be shortened by applying this embodiment.

[0067] Further, the communication device 12 transmits to the DMAC 13 an activation signal for activating a corresponding one of the multiple descriptors 60 based on the number (e.g., "1", "2") of the multiple connection ports P. In the example of FIG. 5, the communication device 12 transmits to the DMAC 13 a DMA execution number based on the type of a frame (e.g., frame 1_N) received via the connection port P1 and an activation signal for activating the descriptor 60 for CH1. The communication device 12 transmits to the DMAC 13 a DMA execution number based on the type of a frame (e.g., frame 2_N) received via the connection port P2 and an activation signal for activating the descriptor 60 for CH2. This allows the DMAC 13 to execute DMA transfer processing for each frame received via the multiple connection ports P1 and P2 in parallel.

[0068] FIG. 6 is a diagram for explaining another example of the data transfer method according to the present embodiment. Referring to FIG. 6, in a communication period T1, the communication device 12 receives frames 2_1 and 2_2 through a connection port P1, and receives frames 2_5 and 2_6 through a connection port P2. The communication device 12 transmits to the DMAC 13 a DMA execution number based on the type of the frames 2_1 and 2_2 received through the connection port P1, and an activation signal for activating the descriptor 60 for CH1. The communication device 12 also transmits to the DMAC 13 a DMA execution number based on the type of the frames 2_5 and 2_6 received through the connection port P2, and an activation signal for activating the descriptor 60 for CH2. The DMAC 13 executes a transfer process for the frames 2_1 and 2_2 based on the DMA setting information of the descriptor 60 for CH1, and executes a transfer process for the frames 2_5 and 2_6 based on the DMA setting information of the descriptor 60 for CH2.

[0069] Also, in a communication cycle T2, the communication device 12 receives frames 2_3 and 2_4 via the connection port P1, and receives frames 2_5 and 2_6 via the connection port P2. The communication device 12 transmits to the DMAC 13 a DMA execution number based on the type of the frames 2_3 and 2_4 received via the connection port P1, and an activation signal for activating the descriptor 60 for CH3. The communication device 12 also transmits to the DMAC 13 a DMA execution number based on the type of the frames 2_5 and 2_6 received via the connection port P2, and an activation signal for activating the descriptor 60 for CH2. The DMAC 13 executes a transfer process for the frames 2_3 and 2_4 based on the DMA setting information of the descriptor 60 for CH3, and executes a transfer process for the frames 2_5 and 2_6 based on the DMA setting information of the descriptor 60 for CH2.

[0070] In this way, the communication device 12 transmits to the DMAC 12 an activation signal for activating a corresponding one of the multiple descriptors 60 based on the number of the connection port P (e.g., “1” or “2”) and the number of the communication cycle T (e.g., “1” or “2”). For example, for the transfer process of the frame 2_1 received via the connection port P1 in the communication cycle T1, the communication device 12 transmits to the DMAC 12 an activation signal for activating the descriptor 60 for CH1. Also, for the transfer process of the frame 2_3 received via the connection port P1 in the communication cycle T2, the communication device 12 transmits to the DMAC 12 an activation signal for activating the descriptor 60 for CH3.

[0071] Frames 2-1 to 2_4 are received via the same connection port P1. For example, even if the DMA execution numbers corresponding to frames 2_1 and 2_3 are the same and the DMA execution numbers corresponding to frames 2_2 and 2_4 are the same, as in the example of Fig. 6, multiple CHs are provided in DMAC 13, and communication device 12 changes the CH to be activated according to the number of the communication cycle, thereby enabling DMA transfer corresponding to each frame to be performed. Note that, when there is only one connection port P, communication device 12 may transmit an activation signal to DMAC 12 for activating the corresponding descriptor 60 based only on the number of the communication cycle T.

[0072] As described above, the communication device 12 is configured to transmit, to the DMAC 12, an activation signal for activating the corresponding descriptor 60 based on at least one of the number of the connection port P and the number of the communication cycle T.

[0073] <Flowchart> 7 is a flowchart showing an example of a processing procedure of the DMAC. Referring to FIG. 7, the DMAC 13 judges whether or not a start signal (and a DMA execution number) is received from the communication device 12 (step S10). If the DMAC 13 has not received these (NO in step S10), the DMAC 13 repeats the processing of step S10.

[0074] When the DMAC 13 receives these (YES in step S10), it acquires the DMA setting information of the entry specified by the DMA execution number (step S12). Next, the DMAC 13 transfers the received frame from the shared memory 11 to the cache memory 101 according to the source address, destination address, and size information of the transfer data (hereinafter also simply referred to as "transfer data size") included in the DMA setting information (step S14).

[0075] The DMAC 13 determines whether the wait flag of the DMA setting information is valid (i.e., the wait flag is "1") (step S16). If the wait flag is valid (YES in step S16), the DMAC 13 returns to step S10. At this time, the DMAC 13 transmits transfer completion information of the received frame to the communication device 12.

[0076] If the wait flag is invalid (i.e., the wait flag is "0") (NO in step S16), the DMAC 13 determines whether the end flag is valid (i.e., the end flag is "1") (step S18). If the end flag is valid (YES in step S18), the DMAC 13 transmits transfer completion information for the received frame to the communication device 12 and ends the process.

[0077] If the end flag is invalid (i.e., the end flag is "0") (NO in step S18), DMAC 13 acquires the DMA setting information of the entry with the number next to the entry number specified in step S12 (step S20) and executes the process of step S14. Specifically, DMAC 13 transfers the received frame from shared memory 11 to cache memory 101 according to the source address, destination address, and transfer data size included in the DMA setting information of the entry with the next number.

[0078] According to the above flow chart, if the wait flag is valid, the DMAC 13 waits until a start signal is sent after the transfer process of the received frame is completed. On the other hand, if the wait flag is invalid and the end flag is invalid, the DMAC 13 selects the entry having the next number from among the multiple entries, and transfers the received frame from the shared memory 11 to the cache memory 101 based on the DMA setting information included in the selected entry. This is a transfer method that is applied when the size of the received frame is large and cannot be transferred by the transfer process based on the DMA setting information of one entry.

[0079] According to this embodiment, one received frame can be associated with one entry in the descriptor 60. For example, by setting the wait flag in the DMA setting information of each entry to "1", it is possible to manage the execution and completion of DMA transfer every time a frame is received.

[0080] When transmitting frames from the cache memory 101 to the shared memory 11 by DMA transfer, the processor 10 starts the DMAC 13 after generating all the transmitting frames. Therefore, continuous DMA transfer using multiple entries is possible by creating DMA setting information for entries corresponding to each transmitting frame, setting the end flag of the DMA setting information for the entry corresponding to the last transmitting frame to 1, and setting the wait flag and end flag of the DMA setting information for the other entries to "0".

[0081] Furthermore, if the DMAC 13 is provided with a descriptor 60 for receive frames and a descriptor 60 for transmit frames and the entries of the descriptor 60 are initialized, the processor 10 does not need to dynamically change the settings of the entries.

[0082] <Modification> Each time the communication device 12 according to the modified example receives data of a specified size (e.g., 8 Bytes, 64 Bytes, etc.) included in a received frame, it stores the data in the shared memory 11 and then transmits a wake-up signal to the DMAC 13. Each time the DMAC 13 receives the wake-up signal, it transfers the data from the shared memory 12 to the cache memory 101 based on the DMA setting information included in the entry corresponding to the received frame. Specific processing contents will be described below.

[0083] Fig. 8 is a diagram for explaining a data transfer method according to a modification of the present embodiment. In the data transfer method in Fig. 8, detailed description of the same parts as those in the data transfer method explained in Fig. 5 will not be repeated.

[0084] 8, the communication device 12 receives data D1 of the specified size Z in frame 1_1 in a communication cycle T1, and stores the data D1 in the shared memory 11. The communication device 12 transmits to the DMAC 13 a DMA execution number m based on the type of frame 1_1 and an activation signal for activating the descriptor 60 for CH1 (hereinafter also simply referred to as a "CH1 activation signal"). For ease of explanation, it is assumed below that the size of frame 1_1 is "24 Bytes" and the specified size Z is "8 Bytes".

[0085] The DMAC 13 receives the DMA execution number m and a CH1 start signal from the communication device 12, selects an entry corresponding to the DMA execution number m from a plurality of entries in the descriptor 60 for CH1, and transfers the data D1 from the shared memory 11 to the cache memory 101 according to the DMA setting information of the selected entry. After transferring the data D1, the DMAC 13 holds the remaining transfer data size (here, "YZ") obtained by subtracting the specified size Z from the transfer data size Y based on the DMA setting information. The transfer data size Y is set to be equal to or smaller than the size of the frame 1_1. Here, for ease of explanation, the transfer data size Y is assumed to be "24 Bytes", which is the same as the size of the frame 1_1. In this case, YZ=16 Bytes.

[0086] The communication device 12 receives the next data D2 of the specified size Z of the frame 1_1, stores the data D2 in the shared memory 11, and transmits the DMA execution number m and a CH1 start signal to the DMAC 13.

[0087] DMAC 13 receives DMA execution number m and a CH1 start signal from communication device 12, and transfers data D2 from shared memory 11 to cache memory 101 according to the DMA setting information of the entry corresponding to DMA execution number m. At this point, the remaining transfer data size is not 0, so DMAC 13 transfers data D2 according to the address (G+Z) and address (H+Z) rather than the source address G and destination address H themselves included in the DMA setting information. After transferring data D2, DMAC 13 holds the remaining transfer data size (here, "Y-2×Z"=8 bytes) updated by subtracting the specified size Z from the current remaining transfer data size.

[0088] The communication device 12 receives the next data D3 of the specified size Z of the frame 1_1, stores the data D3 in the shared memory 11, and transmits the DMA execution number m and a CH1 start signal to the DMAC 13.

[0089] Furthermore, the communication device 12 judges that the reception of all data of the 24-byte frame 1_1 is completed based on the reception of each of the 8-byte data D1 to D3. In this case, the communication device 12 judges whether the frame 1_1 is normal or not based on the result of the error check using the FCS. If the communication device 12 judges that the frame 1_1 is normal, it transmits to the DMAC 12 a reception completion signal indicating that the reception of the frame 1_1 is completed. On the other hand, if the communication device 12 judges that the frame 1_1 is abnormal, it transmits to the DMAC 13 a reception abnormality signal indicating that the received frame 1_1 is abnormal. In the following description, it is assumed that the transmission timing Ts1 of the DMA execution number m and the CH1 activation signal is the same as the transmission timing Ts2 of the reception completion signal or the reception abnormality signal. Note that the transmission timing Ts1 may be earlier than the transmission timing Ts2.

[0090] DMAC 13 receives DMA execution number m, a CH1 start signal, and a reception completion signal or a reception abnormality signal from communication device 12. If DMAC 13 receives a reception completion signal, it transfers data D3 from shared memory 11 to cache memory 101 in accordance with the DMA setting information of the entry corresponding to DMA execution number m. At this time, DMAC 13 subtracts specified size Z from the current remaining transfer data size (i.e., "Y-2×Z") and determines that the remaining transfer data size is 0.

[0091] Then, when the DMAC 13 receives the reception completion signal and the remaining transfer data size is 0, it completes the transfer process of frame 1_1 defined by the transfer data size Y, and transmits transfer completion information about frame 1_1 at time p2 to the communication device 12. Note that, when the DMAC 13 receives the reception abnormality signal, it interrupts the transfer process of frame 1_1 and waits until it receives the next start signal.

[0092] For each of the frames 1_2 to 1_N, the same transfer process as above is executed by the communication device 12 and the DMAC 13. The DMAC 13 transmits transfer completion information for the frames 1_2 and 1_N to the communication device 12 at times p4 and p5, respectively.

[0093] Furthermore, the same transfer process as above is performed by the communication device 12 and the DMAC 13 for each of the frames 2_2 to 2_N received via the connection port P2. The DMAC 13 transmits transfer completion information for the frames 2_1, 2_2, and 2_N to the communication device 12 at times p1, p3, and p6, respectively. Furthermore, at time p6, the communication device 12 determines that it has received all the transfer completion information.

[0094] Here, a case will be described in which the frame size and the transfer data size Y are not the same (i.e., 24 Bytes), but the frame size is larger than the transfer data size Y. For example, assume that the frame size is "24 Bytes", the transfer data size Y is "20 Bytes", and the specified size Z is "8 Bytes". In this case, after the transfer of data D1 and D2, the remaining transfer data size is "4 Bytes". Therefore, DMAC 13 transfers data of the remaining transfer data size "4 Bytes" of data D3, which has a size of "8 Bytes", from shared memory 11 to cache memory 101.

[0095] According to the data transfer method according to the modification shown in FIG. 8 described above, data of a specified size included in a frame is transferred from the shared memory 11 to the cache memory 101 at almost the same timing as the reception of the data. Therefore, for example, time p2, which is the transfer completion timing (i.e., the transmission timing of the transfer completion information) of frame 1_1 in FIG. 8, is earlier than time t2, which is the transfer completion timing in FIG. 5. The same is true for the other frames. And time p6, which is the timing at which the communication device 12 receives all the transfer completion information in FIG. 8, is also earlier than time t6, which is the timing in FIG. 5. Therefore, the processor 10 can utilize more time for arithmetic processing using each frame.

[0096] <Advantages> According to this embodiment, since processor 10 does not need to start DMAC 13, processor 10 does not need to switch processes such as stopping execution of other processing programs, saving necessary information, executing a DMAC startup program, restoring the saved information, restarting other processing programs, etc. Also, since processor 10 can access received frames stored in cache memory 101 at an early stage after switching of the communication cycle, it is possible to maximize the time for performing processing such as calculations using the received frames.

[0097] Other embodiments. The configurations exemplified as the above-mentioned embodiments are examples of the configurations of the present disclosure, and may be combined with other known technologies, or may be modified, such as by omitting some parts, without departing from the scope of the present disclosure. In addition, the above-mentioned embodiments may be implemented by appropriately adopting the processes and configurations described in other embodiments.

[0098] The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present disclosure is defined by the claims, not the above description, and is intended to include all modifications within the meaning and scope of the claims.

[0099] Various aspects of the present disclosure are summarized below as appendices. (Appendix 1) A control device for controlling a controlled device, comprising: a processor having a cache memory; a DMA controller having a descriptor; a shared memory; and a communication device that communicates with the controlled device via a connection port, wherein the communication device stores a received frame received via the connection port in the shared memory, and then starts the DMA controller by sending an activation signal to the DMA controller, and the DMA controller selects a first entry corresponding to the received frame from a plurality of entries included in the descriptor, and transfers the received frame from the shared memory to the cache memory based on setting information regarding DMA transfer included in the selected first entry.

[0100] (Appendix 2) The control device of Appendix 1, wherein the communications device determines one setting value from among the multiple setting values ​​that corresponds to the specified information by comparing multiple setting values ​​corresponding to the multiple entries with a value indicated by specified information included in the received frame, and transmits the entry number corresponding to the one setting value along with the start-up signal to the DMA controller, and the DMA controller selects the first entry from the multiple entries based on the entry number corresponding to the one setting value.

[0101] (Appendix 3) The control device described in Appendix 2, wherein the setting value of 1 is the same value as the value indicated by the specified information, and the DMA controller selects as the first entry an entry among the plurality of entries having a number that is the same as the number of the entry corresponding to the setting value of 1.

[0102] (Appendix 4) The control device according to any one of Supplementary Note 1 to Supplementary Note 3, wherein the setting information includes a source address, a destination address, and a size of the transfer data.

[0103] (Appendix 5) The control device according to any one of Supplementary Note 1 to Supplementary Note 4, wherein the stipulated information is a source address or a type included in the received frame.

[0104] (Appendix 6) The control device according to any one of Supplementary Notes 1 to 5, wherein the setting information included in the first entry further includes a first flag indicating whether or not the transfer processing based on the setting information included in another entry will be executed after the transfer processing of the received frame from the shared memory to the cache memory is completed, and if the first flag indicates that the transfer processing based on the setting information included in the other entry will not be executed, the DMA controller transmits first completion information indicating the completion to the communication device after the transfer processing based on the setting information included in the first entry is completed.

[0105] (Appendix 7) The control device of Appendix 6, wherein the communications device stores the received frame in the shared memory each time the received frame is received in a first communication cycle, and transmits the start-up signal to the DMA controller; when the first communication cycle ends and switches to a second communication cycle, and the first completion information for each received frame received in the first communication cycle is received from the DMA controller, the control device transmits second completion information to the processor indicating completion of the transfer processing in the first communication cycle.

[0106] (Appendix 8) The control device according to claim 6 or 7, wherein the setting information included in the first entry further includes a second flag indicating whether the first entry is the final entry or not, and when the first flag indicates that the transfer process is executed based on the setting information included in the other entries and the second flag indicates that the first entry is not the final entry, the DMA controller selects a second entry from the multiple entries having a number next to that of the first entry, and transfers the received frame from the shared memory to the cache memory based on the setting information included in the second entry.

[0107] (Appendix 9) The control device according to any one of Supplementary Note 1 to Supplementary Note 3, wherein the DMA controller has a plurality of the descriptors, and the communication device transmits the activation signal to the DMA controller for activating a corresponding one of the plurality of descriptors based on at least one of the number of the connection port and the number of a communication cycle of the communication device.

[0108] (Appendix 10) The control device according to any one of Supplementary Notes 1 to 3, wherein the communications device, each time it receives data of a specified size contained in the received frame, stores the data of the specified size in the shared memory, and then transmits the start-up signal to the DMA controller, and the DMA controller, each time it receives the start-up signal, transfers the data of the specified size from the shared memory to the cache memory based on the setting information contained in the first entry corresponding to the received frame.

[0109] (Appendix 11) The communication device includes: The control device described in Appendix 10, when all data of the received frame has been received, determines whether the received frame is normal or not, and if it determines that the received frame is normal, sends a reception completion signal to the DMA controller indicating that reception of the received frame has been completed, and if it determines that the received frame is abnormal, sends a reception abnormality signal to the DMA controller indicating that reception of the received frame is abnormal.

[0110] (Appendix 12) The control device described in Appendix 11, wherein the DMA controller, after transferring data of the specified size from the shared memory to the cache memory, holds a size obtained by subtracting the specified size from the size of the transfer data based on the setting information, and if the reception completion signal is received and the size after subtraction is 0, completes the transfer process of the received frame from the shared memory to the cache memory, and if the reception abnormality signal is received, interrupts the transfer process of the received frame. [Explanation of symbols]

[0111] 10 processor, 11 shared memory, 12 communication device, 20 controlled device, 31-35 fields, 50 setting value storage section, 52 comparator, 54 generator, 60 descriptor, 61 selector, 100 control device, 101 cache memory, 121, 122 connection ports, 1000 control system.

Claims

1. A control device for controlling a control target device, a processor having a cache memory; a DMA controller having a descriptor; Shared memory; a communication device that communicates with the controlled device via a connection port; the communication device stores a received frame received via the connection port in the shared memory, and then starts the DMA controller by transmitting a start signal to the DMA controller; The DMA controller selecting a first entry corresponding to the received frame from among a plurality of entries included in the descriptor; A control device that transfers the received frame from the shared memory to the cache memory based on setting information related to DMA transfer included in the selected first entry.

2. The communication device includes: determining one setting value corresponding to the stipulation information from among the plurality of setting values ​​by comparing a plurality of setting values ​​corresponding to the plurality of entries with a value indicated by stipulation information included in the received frame; Transmitting the entry number corresponding to the set value of 1 to the DMA controller together with the start signal; The control device according to claim 1 , wherein the DMA controller selects the first entry from among the plurality of entries based on an entry number corresponding to the set value of one.

3. The set value of 1 is the same value as the value indicated by the stipulation information, 3. The control device according to claim 2, wherein the DMA controller selects, from among the plurality of entries, an entry having a number that is the same as a number of the entry that corresponds to the setting value of one as the first entry.

4. 4. The control device according to claim 1, wherein the setting information includes a source address, a destination address, and a size of the transfer data.

5. The control device according to claim 3 , wherein the prescribed information is a source address or a type contained in the received frame.

6. the setting information included in the first entry further includes a first flag indicating whether or not the transfer process based on the setting information included in another entry is executed after the transfer process of the received frame from the shared memory to the cache memory is completed; A control device as described in any one of claims 1 to 3, wherein when the first flag indicates that the transfer processing based on the setting information included in the other entry is not executed, the DMA controller transmits first completion information indicating the completion to the communication device after the transfer processing based on the setting information included in the first entry is completed.

7. The communication device includes: storing the received frame in the shared memory every time the received frame is received in a first communication cycle, and transmitting the start signal to the DMA controller; 7. The control device according to claim 6, wherein when the first communication cycle ends and switches to a second communication cycle, and when the first completion information for each received frame received in the first communication cycle is received from the DMA controller, the control device transmits second completion information indicating completion of the transfer processing in the first communication cycle to the processor.

8. the setting information included in the first entry further includes a second flag indicating whether the first entry is a final entry; 7. The control device of claim 6, wherein when the first flag indicates that the transfer process is executed based on the setting information contained in the other entry and the second flag indicates that the first entry is not the final entry, the DMA controller selects a second entry from the multiple entries having a number next to the number of the first entry, and transfers the received frame from the shared memory to the cache memory based on the setting information contained in the second entry.

9. the DMA controller has a plurality of the descriptors, The control device according to any one of claims 1 to 3, wherein the communication device transmits the activation signal to the DMA controller for activating a corresponding one of the multiple descriptors based on at least one of the number of the connection port and the number of the communication cycle of the communication device.

10. the communication device stores the data of the specified size in the shared memory every time the communication device receives data of the specified size included in the received frame, and then transmits the start signal to the DMA controller; A control device as described in any one of claims 1 to 3, wherein the DMA controller transfers data of the specified size from the shared memory to the cache memory based on the setting information contained in the first entry corresponding to the received frame each time the start-up signal is received.

11. The communication device includes: When all data of the received frame is received, it is determined whether the received frame is normal or not; If it is determined that the received frame is normal, a reception completion signal indicating that reception of the received frame has been completed is sent to the DMA controller; 11. The control device according to claim 10, wherein, when it is determined that the received frame is abnormal, a reception abnormality signal indicating that reception of the received frame is abnormal is transmitted to the DMA controller.

12. The DMA controller After transferring data of the specified size from the shared memory to the cache memory, a size obtained by subtracting the specified size from a size of the transfer data based on the setting information is held; If the reception completion signal has been received and the size after the subtraction is 0, a transfer process of the received frame from the shared memory to the cache memory is completed; The control device according to claim 11, wherein the control device interrupts the transfer process of the received frame when the reception abnormality signal is received.

Citation Information

Patent Citations

  • Communication control device and method for controlling communication control device

    WO2021181874A1