CN-119449743-B - Network-on-chip data processing method, device, computer equipment and storage medium
Abstract
The embodiment of the application provides a network-on-chip data processing method, a device, computer equipment and a storage medium. The method comprises the steps of adding at least one message to be transmitted to a message queue to be transmitted when the message to be transmitted is detected, determining the state of an output port pointed by each message to be transmitted when the message to be transmitted in a plurality of transmission directions exists in the message queue to be transmitted, selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority when the candidate message to be transmitted pointed to the output port state is in an idle state exists, repeatedly executing the step of selecting the target message to be transmitted from the plurality of candidate messages to be transmitted according to the preset arbitration priority to transmit until the message queue to be transmitted does not exist the candidate message to be transmitted pointed to the output port state is in the idle state, and stopping processing the message queue to be transmitted when the message to be transmitted does not contain the message to be transmitted in the message queue to be transmitted. With this, transmission efficiency can be improved and deadlock can be prevented.
Inventors
- ZHOU HUIHUI
- QUAN PULI
- TIAN YONGHONG
Assignees
- 鹏城实验室
Dates
- Publication Date
- 20260505
- Application Date
- 20241031
Claims (8)
- 1. A network-on-chip data processing method, the method being applied to a target device, the target device comprising a plurality of input ports and a plurality of output ports, the method comprising: When any one input port is detected to receive at least one message to be transmitted, adding the message to be transmitted to a message queue to be transmitted; when the message to be transmitted queue contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port pointed by each message to be transmitted; When detecting that the message to be transmitted with the propagation directions being a plurality of propagation directions exists in the message queue to be transmitted, determining the state of an output port pointed by each message to be transmitted; When a plurality of candidate to-be-transmitted messages with the pointed output port in an idle state exist in the to-be-transmitted message queue, selecting a target to-be-transmitted message from the plurality of candidate to-be-transmitted messages according to a preset arbitration priority for transmission, wherein when the plurality of candidate to-be-transmitted messages with the pointed output port in an idle state exist in the to-be-transmitted message queue, the receiving time corresponding to each candidate to-be-transmitted message is determined according to the preset arbitration priority; Selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission, and screening out a pause message with the busy state of the pointed output port from the plurality of messages to be transmitted in the message queue to be transmitted; suspending processing of the suspended processing message in the message queue to be transmitted until the output port finishes transmitting any one target message to be transmitted, and restoring the suspended processing message into the message to be transmitted; repeatedly executing the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to the preset arbitration priority, until no candidate message to be transmitted with the pointed output port in an idle state exists in the message to be transmitted queue; and stopping processing the message queue to be transmitted when the message queue to be transmitted does not contain the message to be transmitted.
- 2. The network-on-chip data processing method of claim 1, wherein the method further comprises: When detecting that the message to be transmitted with a plurality of propagation directions does not exist in the message to be transmitted queue, determining a first message to be transmitted with the propagation direction being a single propagation direction from the message to be transmitted queue; Determining an output port pointed by each first message to be transmitted and a message distributor corresponding to each output port; determining the transmission sequence of each first message to be transmitted according to a preset arbitration priority through the message distributor; and transmitting each first message to be transmitted to a corresponding output port in sequence based on the transmission sequence.
- 3. The network-on-chip data processing method of claim 1, wherein the method further comprises: When the output port finishes transmitting any target message to be transmitted, updating the message queue to be transmitted; Restoring the pause processing message in the transmission message queue into a message to be transmitted; when the message to be transmitted queue contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port pointed by each message to be transmitted; When detecting that the message to be transmitted with the propagation directions being a plurality of propagation directions exists in the message queue to be transmitted, determining the state of an output port pointed by each message to be transmitted; when a plurality of candidate messages to be transmitted with the pointed output port state being in an idle state exist in the updated message to be transmitted queue, selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission; Repeatedly executing the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to the preset arbitration priority, until the candidate message to be transmitted with the pointed output port state as an idle state does not exist in the updated message to be transmitted queue; and stopping processing the updated message queue to be transmitted when the updated message queue to be transmitted does not contain the message to be transmitted.
- 4. The network-on-chip data processing method of claim 1, wherein the method further comprises: when any input port increases at least one message to be transmitted, updating the message queue to be transmitted; when the message to be transmitted queue contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port pointed by each message to be transmitted; When detecting that the message to be transmitted with the propagation directions being a plurality of propagation directions exists in the message queue to be transmitted, determining the state of an output port pointed by each message to be transmitted; when a plurality of candidate messages to be transmitted with the pointed output port state being in an idle state exist in the updated message to be transmitted queue, selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission; Repeatedly executing the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to the preset arbitration priority, until the candidate message to be transmitted with the pointed output port state as an idle state does not exist in the updated message to be transmitted queue; and stopping processing the updated message queue to be transmitted when the updated message queue to be transmitted does not contain the message to be transmitted.
- 5. The network-on-chip data processing method according to claim 1, wherein when detecting that there are messages to be transmitted in the message queue to be transmitted, the determining the state of the output port to which each message to be transmitted points, includes: When detecting that the message to be transmitted with the propagation directions being a plurality of propagation directions exists, determining an output port pointed by each message to be transmitted; and acquiring a first output port corresponding to the message currently being transmitted, and determining that the state of the output port pointed by the corresponding message to be transmitted is a busy state when the pointed output port is overlapped with the first output port, or determining that the state of the output port pointed by the corresponding message to be transmitted is an idle state when the pointed output port is not overlapped with the first output port.
- 6. A network-on-chip data processing apparatus, the apparatus comprising: the adding module is used for adding the message to be transmitted to a message queue to be transmitted when detecting that any one input port receives at least one message to be transmitted; the determining module is used for determining the propagation direction of each message to be transmitted according to the output port pointed by each message to be transmitted when the message to be transmitted is contained in the message queue to be transmitted; the detection module is used for determining the state of an output port pointed by each message to be transmitted when detecting that the message to be transmitted with the propagation directions being a plurality of propagation directions exists in the message queue to be transmitted; The selecting module is used for selecting target to-be-transmitted messages from the plurality of candidate to-be-transmitted messages according to a preset arbitration priority when the plurality of candidate to-be-transmitted messages with the pointed output port in an idle state exist in the to-be-transmitted message queue, determining the receiving time corresponding to each candidate to-be-transmitted message according to the preset arbitration priority when the plurality of candidate to-be-transmitted messages with the pointed output port in the idle state exist in the to-be-transmitted message queue; Selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission, and screening out a pause message with the busy state of the pointed output port from the plurality of messages to be transmitted in the message queue to be transmitted; suspending processing of the suspended processing message in the message queue to be transmitted until the output port finishes transmitting any one target message to be transmitted, and restoring the suspended processing message into the message to be transmitted; The processing module is used for repeatedly executing the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to the preset arbitration priority to transmit until the candidate message to be transmitted with the pointed output port in an idle state does not exist in the message to be transmitted queue; and the stopping module is used for stopping processing the message queue to be transmitted when the message queue to be transmitted does not contain the message to be transmitted.
- 7. A computer device, characterized in that it comprises a memory storing a computer program and a processor implementing the network-on-chip data processing method according to any of claims 1 to 5 when the computer program is executed by the processor.
- 8. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the network-on-chip data processing method of any one of claims 1 to 5.
Description
Network-on-chip data processing method, device, computer equipment and storage medium Technical Field The present application relates to the field of communications technologies, and in particular, to a method and apparatus for processing network on chip data, a computer device, and a storage medium. Background With the increasing computing demands in the field of artificial intelligence, single processor architectures are no longer able to meet demand. Multiprocessor is widely used in various fields such as high-end servers and smart phones. Network-on-chip has become an important and evolving area of research. The network on chip of the high performance multiprocessor must provide sufficient bandwidth and maintain a sufficiently fast transmission rate. The goal of the routing algorithm is to distribute network traffic as evenly as possible across the network topology to reduce network delay and improve throughput. When there is a demand for delay and throughput, the design of routers presents a certain challenge. In the related art, in a router, there are cases where messages from multiple input ports are transmitted from one output port, that is, multiple messages compete for the same output port resource. There are also situations where a message from one input port needs to be transmitted from multiple output ports, i.e. network-on-chip multicasting. In a normal case, an output port can only be occupied by one message transmission, and unicast and multicast exist simultaneously, if the arbitration scheduling mechanism is improperly designed, a cyclic waiting chain is formed. For example, each port waits for another input port to release resources, which causes that all ports cannot continue to send data, and further causes deadlock, and reduces the transmission efficiency of the message. Disclosure of Invention The embodiment of the application mainly aims to provide a network-on-chip data processing method, a device, computer equipment and a storage medium, which can improve the message transmission efficiency and prevent deadlock. To achieve the above object, a first aspect of an embodiment of the present application proposes a network-on-chip data processing method, which is applied to a target device, the target device including a plurality of input ports and a plurality of output ports, the method including: When any one input port is detected to receive at least one message to be transmitted, adding the message to be transmitted to a message queue to be transmitted; when the message to be transmitted queue contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port pointed by each message to be transmitted; When detecting that the message to be transmitted with the propagation directions being a plurality of propagation directions exists in the message queue to be transmitted, determining the state of an output port pointed by each message to be transmitted; When a plurality of candidate messages to be transmitted with the pointed output port in an idle state exist in the message queue to be transmitted, selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission; repeatedly executing the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to the preset arbitration priority, until no candidate message to be transmitted with the pointed output port in an idle state exists in the message to be transmitted queue; and stopping processing the message queue to be transmitted when the message queue to be transmitted does not contain the message to be transmitted. Accordingly, a second aspect of an embodiment of the present application proposes a network-on-chip data processing apparatus, the apparatus comprising: the adding module is used for adding the message to be transmitted to a message queue to be transmitted when detecting that any one input port receives at least one message to be transmitted; the determining module is used for determining the propagation direction of each message to be transmitted according to the output port pointed by each message to be transmitted when the message to be transmitted is contained in the message queue to be transmitted; the detection module is used for determining the state of an output port pointed by each message to be transmitted when detecting that the message to be transmitted with the propagation directions being a plurality of propagation directions exists in the message queue to be transmitted; the selecting module is used for selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority when the plurality of candidate messages to be transmitted with the pointed output port in an idle state exist in the message queue to be