Network-on-chip data processing method and device, computer equipment and storage medium

By setting up a queue of messages to be transmitted in the on-chip network and selecting messages to be transmitted according to preset priority, the deadlock and efficiency reduction caused by multiple messages competing for resources on the same output port are solved, and efficient Message transmission and system stability.

CN119449743AActive Publication Date: 2025-02-14PENG CHENG LAB

Patent Information

Application Number
CN202411548050.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

In an on-chip network, multiple messages compete for the same output port resource, resulting in deadlock and reducing message transmission efficiency.

Method used

By setting the queue of messages to be transmitted in the target device, the target messages to be transmitted are selected according to the preset arbitration priority according to the output port status and propagation direction of each message to be transmitted until all candidate messages to be transmitted The output port status is not idle.

Benefits of technology

It effectively avoids the occurrence of deadlocks, improves the efficiency of message transmission and the overall throughput of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119449743A_ABST
    Figure CN119449743A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a network-on-chip data processing method and device, computer equipment and a storage medium. The method comprises the following steps: when at least one message to be transmitted is detected, adding the message to a message queue to be transmitted; when to-be-transmitted messages in multiple propagation directions exist in the to-be-transmitted message queue, determining the state of an output port pointed by each to-be-transmitted message; when the candidate to-be-transmitted messages of which the pointing output port state is an idle state exist, selecting a target to-be-transmitted message from a plurality of candidate to-be-transmitted messages according to a preset arbitration priority for transmission; repeatedly executing the step of selecting a target to-be-transmitted message from the plurality of candidate to-be-transmitted messages according to the preset arbitration priority and transmitting the target to-be-transmitted message until the candidate to-be-transmitted message of which the pointing output port state is an idle state does not exist in the to-be-transmitted message queue; and when the to-be-transmitted message queue does not contain the to-be-transmitted message, stopping processing the to-be-transmitted message queue. Therefore, the transmission efficiency can be improved, and deadlock can be prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, device, computer equipment and storage medium for processing network-on-chip data. Background Art

[0002] With the increasing computing demand in the field of artificial intelligence, single-processor architecture can no longer meet the demand. Multiprocessors are widely used in various fields such as high-end servers and smartphones. Therefore, on-chip networks have become an important and growing research field. On-chip networks of high-performance multiprocessors must provide sufficient bandwidth and maintain a fast enough transmission rate. The goal of the routing algorithm is to distribute network traffic as evenly as possible in the network topology to reduce network latency and increase throughput. When there are requirements for latency and throughput, there are certain challenges in the design of routers.

[0003] In the related art, in a router, there is a situation where messages from multiple input ports are transmitted from one output port, that is, multiple messages compete for the same output port resources. At the same time, there is a situation where messages from one input port need to be transmitted from multiple output ports, that is, on-chip network multicast. Under normal circumstances, an output port can only be occupied by one message transmission, and there are situations where unicast and multicast exist at the same time. If the arbitration scheduling mechanism is not designed properly, a circular waiting chain will be formed. For example, if each port is waiting for another input port to release resources, all ports will be unable to continue to send data, which will lead to the occurrence of deadlock and reduce the transmission efficiency of messages. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to provide a network-on-chip data processing method, apparatus, computer equipment and storage medium, which can improve the efficiency of message transmission while preventing the occurrence of deadlock.

[0005] To achieve the above object, a first aspect of an embodiment of the present application provides an on-chip network data processing method, the method is applied to a target device, the target device includes a plurality of input ports and a plurality of output ports, the method includes:

[0006] When it is detected that any input port receives at least one message to be transmitted, the message to be transmitted is added to the queue of messages to be transmitted;

[0007] When the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points;

[0008] When it is detected that there are messages to be transmitted with the propagation directions of multiple propagation directions in the message queue to be transmitted, determining the state of the output port to which each message to be transmitted points;

[0009] When there are a plurality of candidate messages to be transmitted whose output port is in an idle state 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;

[0010] Repeat the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission until there is no candidate message to be transmitted whose output port is in an idle state in the message queue to be transmitted;

[0011] When the queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the queue of messages to be transmitted is stopped.

[0012] Accordingly, a second aspect of an embodiment of the present application provides an on-chip network data processing device, the device comprising:

[0013] An adding module, configured to add the message to be transmitted to a queue of messages to be transmitted when it is detected that any input port receives at least one message to be transmitted;

[0014] A determination module, used for determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points when the message to be transmitted queue contains messages to be transmitted;

[0015] A detection module, configured to determine the state of an output port to which each message to be transmitted points when detecting that there are messages to be transmitted with multiple propagation directions in the message queue to be transmitted;

[0016] A selection module, configured to select a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority when there are a plurality of candidate messages to be transmitted whose output port is in an idle state in the message to be transmitted queue;

[0017] a processing module, configured to repeatedly execute the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority until no candidate message to be transmitted whose output port is in an idle state exists in the message queue to be transmitted;

[0018] The stopping module is used to stop processing the queue of messages to be transmitted when the queue of messages to be transmitted does not contain any messages to be transmitted.

[0019] In some implementations, the on-chip network data processing device further includes an allocation module, configured to:

[0020] When it is detected that there are no messages to be transmitted in multiple propagation directions in the message queue to be transmitted, determining a first message to be transmitted whose propagation direction is a single propagation direction from the message queue to be transmitted;

[0021] Determine the output port to which each first message to be transmitted points, and the message distributor corresponding to each of the output ports;

[0022] Determining the transmission order of each first message to be transmitted according to a preset arbitration priority by the message distributor;

[0023] Each first message to be transmitted is transmitted to the corresponding output port in sequence based on the transmission order.

[0024] In some implementations, the selection module is further used to:

[0025] When there are a plurality of candidate messages to be transmitted whose output ports are in an idle state in the message queue to be transmitted, determining a receiving time corresponding to each candidate message to be transmitted according to a preset arbitration priority;

[0026] Obtaining the available load of the current system, and determining the current message transmission quantity based on the available load;

[0027] According to the receiving time corresponding to each candidate message to be transmitted, target messages to be transmitted with the current message transmission quantity are selected from the multiple candidate messages to be transmitted for transmission; wherein the output ports between any two target messages to be transmitted do not overlap.

[0028] In some implementations, the on-chip network data processing device further includes a screening module, configured to:

[0029] Filtering out the paused processing message whose state of the output port pointed to is busy from the multiple messages to be transmitted in the message queue to be transmitted;

[0030] In the queue of messages to be transmitted, the processing of the suspended processing message is suspended until the output port completes the transmission of any one of the target messages to be transmitted, and the suspended processing message is restored to a message to be transmitted.

[0031] In some implementations, the on-chip network data processing device further includes an update module, configured to:

[0032] When the output port completes transmission of any one of the target messages to be transmitted, updating the queue of messages to be transmitted;

[0033] Restoring the suspended processing message in the transmission message queue to a message to be transmitted;

[0034] When the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points;

[0035] When it is detected that there are messages to be transmitted with the propagation directions of multiple propagation directions in the message queue to be transmitted, determining the state of the output port to which each message to be transmitted points;

[0036] When there are multiple candidate messages to be transmitted whose output port is in an idle state in the updated message queue to be transmitted, a target message to be transmitted is selected from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission;

[0037] Repeat the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority until there is no candidate message to be transmitted whose output port is in an idle state in the updated message queue to be transmitted;

[0038] When the updated queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the updated queue of messages to be transmitted is stopped.

[0039] In some implementations, the on-chip network data processing device further includes a transmission module, configured to:

[0040] When at least one of the to-be-transmitted messages is added to any of the input ports, updating the to-be-transmitted message queue;

[0041] When the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points;

[0042] When it is detected that there are messages to be transmitted with the propagation directions of multiple propagation directions in the message queue to be transmitted, determining the state of the output port to which each message to be transmitted points;

[0043] When there are multiple candidate messages to be transmitted whose output port is in an idle state in the updated message queue to be transmitted, a target message to be transmitted is selected from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission;

[0044] Repeat the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority until there is no candidate message to be transmitted whose output port is in an idle state in the updated message queue to be transmitted;

[0045] When the updated queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the updated queue of messages to be transmitted is stopped.

[0046] In some embodiments, the detection module is further used for:

[0047] When it is detected that there are messages to be transmitted with the propagation directions being multiple propagation directions, determining an output port to which each message to be transmitted points;

[0048] Obtain the first output port corresponding to the message currently being transmitted, and when the output port pointed to coincide with the first output port, determine that the state of the output port pointed to by the corresponding message to be transmitted is a busy state; or, when the output port pointed to coincide with the first output port, determine that the state of the output port pointed to by the corresponding message to be transmitted is an idle state.

[0049] Correspondingly, the third aspect of the embodiments of the present application proposes a computer device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the on-chip network data processing method described in any one of the embodiments of the first aspect of the present application when executing the computer program.

[0050] Correspondingly, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the on-chip network data processing method described in any one of the embodiments of the first aspect of the present application.

[0051] The embodiment of the present application adds the message to be transmitted to the queue of messages to be transmitted when it is detected that any input port receives at least one message to be transmitted; when the queue of messages to be transmitted contains messages to be transmitted, determines the propagation direction of each message to be transmitted according to the output port pointed to by each message to be transmitted; when it is detected that there are messages to be transmitted with multiple propagation directions in the queue of messages to be transmitted, determines the state of the output port pointed to by each message to be transmitted; when there are multiple candidate messages to be transmitted in the queue of messages to be transmitted whose output ports are in an idle state, selects a target message to be transmitted from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission; repeats the step of selecting a target message to be transmitted from the multiple candidate messages to be transmitted according to the preset arbitration priority for transmission until there are no candidate messages to be transmitted whose output ports are in an idle state in the queue of messages to be transmitted; when the queue of messages to be transmitted does not contain any messages to be transmitted, stops processing the queue of messages to be transmitted. In this way, only the to-be-transmitted messages that do not conflict with the messages being transmitted can be processed each time, ensuring that only the messages that point to the idle output port can be used as candidate to-be-transmitted messages, avoiding the situation where multiple messages compete for the same resource at the same time, thereby avoiding the problem of deadlock and long waiting. At the same time, messages that do not conflict with the currently transmitted messages can be selected for transmission in turn, which improves the overall throughput of the system and thereby improves the efficiency of message transmission. In summary, the present application can prevent the occurrence of deadlock while improving the efficiency of message transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 It is a schematic diagram of the architecture of the on-chip network data processing system provided by an embodiment of the present application;

[0053] Figure 2 is a flow chart of a method for processing network-on-chip data provided by an embodiment of the present application;

[0054] Figure 3 It is a schematic diagram of the network on chip architecture provided by an embodiment of the present application;

[0055] Figure 4 This is a processing diagram when multicast and unicast messages exist simultaneously, as provided in an embodiment of the present application;

[0056] Figure 5 It is a schematic diagram of message processing for unicast transmission provided in an embodiment of the present application;

[0057] Figure 6 It is a schematic diagram of message processing for multicast transmission provided in an embodiment of the present application;

[0058] Figure 7 It is a functional module diagram of the on-chip network data processing device provided by an embodiment of the present application;

[0059] Figure 8 It is a schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0063] With the increasing computing demand in the field of artificial intelligence, single-processor architecture can no longer meet the demand. Multiprocessors are widely used in various fields such as high-end servers and smartphones. Therefore, on-chip networks have become an important and growing research field. On-chip networks of high-performance multiprocessors must provide sufficient bandwidth and maintain a fast enough transmission rate. The goal of the routing algorithm is to distribute network traffic as evenly as possible in the network topology to reduce network latency and increase throughput. When there are requirements for latency and throughput, there are certain challenges in the design of routers.

[0064] In the related art, in a router, there is a situation where messages from multiple input ports are transmitted from one output port, that is, multiple messages compete for the same output port resources. At the same time, there is a situation where messages from one input port need to be transmitted from multiple output ports, that is, on-chip network multicast. Under normal circumstances, an output port can only be occupied by one message transmission, and there are situations where unicast and multicast exist at the same time. If the arbitration scheduling mechanism is not designed properly, a circular waiting chain will be formed. For example, if each port is waiting for another input port to release resources, all ports will be unable to continue to send data, which will lead to the occurrence of deadlock and reduce the transmission efficiency of messages.

[0065] Based on this, the embodiments of the present application provide a network-on-chip data processing method, apparatus, computer equipment and storage medium, which can improve the efficiency of message transmission while preventing the occurrence of deadlock.

[0066] The on-chip network data processing method, apparatus, computer equipment and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the on-chip network data processing system in the embodiments of the present application is described.

[0067] Please refer to Figure 1 In some implementations, an embodiment of the present application provides a network-on-chip data processing system, which may include a terminal 11 and a server 12 .

[0068] Exemplarily, terminal 11 may be an external device or system connected to the on-chip network, such as a smart phone, a tablet computer, a personal computer, an embedded device, etc. Terminal 11 may be responsible for processing direct input and output of the user, such as running applications, displaying a graphical interface, etc. Alternatively, the various modules inside terminal 11 may also perform high-speed, low-latency data exchange through the on-chip network, thereby improving overall performance.

[0069] Furthermore, the server 12 may be a core processing unit in the on-chip network, such as a multi-core processor, a high-performance server, a cloud computing platform, etc., responsible for responding to requests from the terminal 11 and processing data. In addition, the server may schedule data flows through the on-chip network to process the message queue to be transmitted.

[0070] Please refer to Figure 2 , Figure 2 This is an example diagram of a network-on-chip (NOC) interconnection structure, which has multiple routers connected to each other to form a grid-like topology. Each router has multiple interfaces (in actual applications, the number of interfaces and the direction of message reception are not limited). The router can receive messages from multiple directions and forward messages to multiple directions. It should be noted that this application does not limit the number of input ports and output ports. In actual applications, the number of ports can be less than 5 or more than 5 ports, such as 4, 10, etc.

[0071] Specifically, Figure 2In the structure shown, each local accelerator (Local) can communicate with each other through the on-chip network and the router. When a router receives at least one new message to be transmitted, it will update the queue of messages to be transmitted according to the on-chip network data processing method proposed in this application, and determine the propagation direction according to the output port pointed to by the message to be transmitted. If there are messages with multiple output ports pointed to (i.e., multicast messages), at least one global arbiter is required for further processing to avoid conflicts and deadlocks. At the same time, the system will also select the next message to be transmitted based on the state of the output port to achieve efficient resource utilization while avoiding deadlocks.

[0072] The on-chip network data processing method in the embodiment of the present application can be illustrated by the following embodiment.

[0073] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first. Moreover, the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or separate consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or separate consent, the necessary user-related data for enabling the normal operation of the embodiment of the present application will be obtained.

[0074] In some embodiments, the on-chip network data processing method is applied to a target device, the target device includes multiple input ports and multiple output ports, and the target device can be a router or switch used in an on-chip network environment, responsible for the transmission and scheduling of data packets between different modules inside a multi-core processor. Furthermore, data transmission on the on-chip network supports unicast, multicast, and coexistence of unicast and multicast, and there can be multiple input ports and output ports. This application does not limit the specific number of ports.

[0075] In the embodiments of the present application, the on-chip network data processing device will be described from the perspective of the on-chip network data processing device, which can be specifically integrated into a computer device. Figure 3 , Figure 3 This is a flowchart of the steps of the on-chip network data processing method provided in an embodiment of the present application. In the embodiment of the present application, the on-chip network data processing device is specifically integrated in a terminal or a server as an example. When the processor on the terminal or the server executes the program instructions corresponding to the on-chip network data processing method, the specific process is as follows:

[0076] Step 101: When it is detected that any input port receives at least one message to be transmitted, the message to be transmitted is added to a queue of messages to be transmitted.

[0077] In some embodiments, in order to centrally manage and schedule messages received by the target device, when it is detected that at least one input port of the target device has received at least one message to be transmitted, the message to be transmitted can be added to a queue of messages to be transmitted to ensure efficient use of resources and orderly processing of messages.

[0078] The input port may be a physical interface in an on-chip network router or switch, used to receive data packets from other modules or devices.

[0079] The message to be transmitted may be a data message that has arrived at the input port but has not yet been sent to the output port.

[0080] The queue of messages to be transmitted may be a storage structure for temporarily storing all messages to be transmitted, waiting for scheduling and transmission. In some implementations, the queue of messages to be transmitted may be stored in a global arbiter, and the queue of messages to be transmitted may be processed by the global arbiter.

[0081] Exemplarily, there can be multiple input ports and output ports, and the present application does not limit the specific number. Furthermore, each input port can receive messages to be transmitted in different directions respectively. For example, input port R1 can receive messages in the east direction, input port R2 can receive messages in the south direction, input port R3 can receive messages in the west direction, input port R4 can receive messages in the north direction, and input port R5 can receive messages in the local direction. Similarly, different output ports can also send messages in different directions respectively. Specifically, output port S1 can send messages in the east direction, output port S2 can send messages in the south direction, output port S3 can send messages in the west direction, output port S4 can send messages in the north direction, output port S5 can send messages in the local direction, etc. It can be understood that the present application does not limit the direction of each port corresponding to the received message.

[0082] Furthermore, the message to be transmitted may be composed of several words or bytes and include control information for data transmission and actual payload data. The type of the message to be transmitted depends on the application scenario and the network protocol. For example, the message to be transmitted may be a data message, a control message, and the like.

[0083] For example, in the queue of messages to be transmitted, the messages to be transmitted may be stored in chronological order, or may be stored according to message type, or may be stored according to a pre-calibrated degree of importance. The present application does not limit the specific storage method.

[0084] Through the above method, efficient management and scheduling of the messages to be transmitted can be achieved, packet loss and transmission errors can be effectively reduced, and subsequent processing of the message queue to be transmitted can be facilitated.

[0085] Step 102: When the queue of messages to be transmitted contains messages to be transmitted, the propagation direction of each message to be transmitted is determined according to the output port to which each message to be transmitted points.

[0086] In some implementations, in order to facilitate the on-chip network to more effectively manage and schedule data packets, the propagation direction of each packet to be transmitted may be determined to ensure efficient communication and data transmission.

[0087] The output port to which the message to be transmitted points may be one or more physical output interfaces to which the message to be transmitted needs to be sent during the transmission process. The output port is a physical port in the on-chip network router, which is used to send the output port from the current node to the next node.

[0088] The propagation direction of the message to be transmitted may be the directionality of the output port to which the message to be transmitted needs to be sent during the transmission process.

[0089] Specifically, when the message to be transmitted points to (needs to be sent to) multiple output ports, that is, when the message to be transmitted has multiple propagation directions, the message to be transmitted is multicast transmission; when the message to be transmitted points to (needs to be sent to) a single output port, that is, when the message to be transmitted has a single propagation direction, the message to be transmitted is unicast transmission.

[0090] Exemplarily, when the output ports to which the message A points are S1 and S2, the message A is multicast transmission. When the output port to which the message A points is S3, the message A is unicast transmission.

[0091] By clarifying the output port and propagation direction of the message to be transmitted, the on-chip network can more effectively manage and schedule data messages, ensuring efficient communication and data transmission.

[0092] Step 103: when it is detected that there are messages to be transmitted with multiple propagation directions in the message queue to be transmitted, the state of the output port to which each message to be transmitted points is determined.

[0093] In some implementations, there are messages to be transmitted with multiple propagation directions (i.e., multicast messages) involving multiple output ports. In the case of unicast and multicast, or multicast and multicast coexisting, the network delay is high and the throughput is low, and there is a risk of deadlock. Therefore, in order to find conflicting messages in time, the status of the output ports pointed to by each message to be transmitted can be detected in advance, so as to effectively avoid the occurrence of deadlock by detecting and processing conflicting messages in advance.

[0094] The state of the output port pointed to by the message to be transmitted may be whether the output port can currently receive a new message for transmission, that is, whether the output port pointed to by the message to be transmitted has other messages being transmitted at the current moment.

[0095] Specifically, if at the current moment, the output port pointed to by the message to be transmitted has other messages being transmitted, it indicates that the state of the output port pointed to by the message to be transmitted is busy (the message to be transmitted conflicts with the message being transmitted); if at the current moment, the output port pointed to by the message to be transmitted has no other messages being transmitted, it indicates that the state of the output port pointed to by the message to be transmitted is idle (the message to be transmitted does not conflict with the message being transmitted).

[0096] Through the above method, busy output ports can be detected and processed in advance to avoid message conflicts during transmission and effectively avoid deadlock.

[0097] In some implementations, in order to effectively detect and resolve conflicts and optimize resource utilization, the state of the output port to which the message to be transmitted points may be determined so that the on-chip network can more efficiently manage and schedule data messages and ensure efficient communication and data transmission. For example, step 103 may include:

[0098] (103.1) When it is detected that there are messages to be transmitted with multiple propagation directions, determine the output port to which each message to be transmitted points;

[0099] (103.2) Obtain the first output port corresponding to the message currently being transmitted, and when the output port pointed to coincides with the first output port, determine that the state of the output port pointed to by the corresponding message to be transmitted is a busy state; or, when the output port pointed to coincides with the first output port, determine that the state of the output port pointed to by the corresponding message to be transmitted is an idle state.

[0100] The first output port may be an output port used by the message currently being transmitted.

[0101] The busy state may be the state of the output port when the corresponding output port is currently transmitting a message.

[0102] The idle state may be the state of an output port when the corresponding output port has no message currently being transmitted.

[0103] Exemplarily, if the output ports to which the message a to be transmitted points at the current moment are 1 and 2, and the message b is being transmitted at the output port 1, then the state of the output port to which the message to be transmitted points is a busy state. If the output ports to which the message c to be transmitted points at the current moment are 2 and 3, and no message is being transmitted at the output ports 2 and 3, then the state of the output port to which the message to be transmitted points is an idle state. It is understandable that as long as one of the output ports to which the message to be transmitted points is a busy state, then the state of the output port to which the message to be transmitted points is a busy state.

[0104] For example, if the messages to be transmitted include message a, message b, and message c, where the propagation direction of message a is multiple propagation directions, then it can be determined that the output ports pointed to by message a are S1 and S2, the output port pointed to by message b is S2, and the output port pointed to by message c is S3. At this time, in order to determine the message to be transmitted that needs to be transmitted at the next moment, the status of the output ports pointed to by messages a, message b, and message c can be determined.

[0105] Furthermore, the first output port corresponding to all currently transmitted messages can be obtained. For example, output port S1 is transmitting message d, and the current output port S3 is transmitting message e. Then, it can be determined that output ports S1 and S3 are the first output ports. It can be seen that the output port pointed to by message a coincides with message d, that is, it coincides with the first output port S1, and the output port pointed to by message c coincides with message e, that is, it coincides with the first output port S3. The status of the output ports pointed to by messages a and c is busy; the output port pointed to by message b does not coincide with the first output port, and the status of the output port it points to is idle.

[0106] Exemplarily, the state of the corresponding output port can also be determined by querying the output port pointed to by the message to be transmitted. For example, the output port pointed to by the message to be transmitted f is S5. By querying S5, it is determined that S5 is currently transmitting other messages. Therefore, the state of the output port pointed to by the message to be transmitted f is busy.

[0107] By checking the status of the output port to which each message to be transmitted points, potential conflicts can be discovered in a timely manner, thereby improving the overall throughput of the system and effectively preventing the occurrence of deadlock.

[0108] Step 104 : when there are multiple candidate messages to be transmitted whose output ports are in an idle state in the message queue to be transmitted, a target message to be transmitted is selected from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission.

[0109] In some implementations, in order to optimize resource utilization and avoid deadlock problems, a candidate message to be transmitted whose output port is in an idle state can be selected, and a target message to be transmitted can be selected from the candidate messages to be transmitted according to a preset arbitration priority for transmission, thereby avoiding the formation of a circular waiting chain.

[0110] The candidate messages to be transmitted may be those messages in the queue of messages to be transmitted whose output ports are in an idle state at the current moment.

[0111] The preset arbitration priority may be a transmission order set for candidate messages to be transmitted of different types or from different sources in the on-chip network. Candidate messages to be transmitted with higher priorities will be given priority in obtaining transmission opportunities when network resources are limited.

[0112] The target message to be transmitted may be at least one candidate message to be transmitted selected from a plurality of candidate messages to be transmitted according to a preset arbitration priority at the current moment.

[0113] Exemplarily, the preset arbitration priority can be a priority determined according to the type of message. For example, control messages (such as messages related to routing updates, configuration information, etc.) have the highest priority, real-time data messages (such as messages related to audio streams, video streams, sensor data, etc.) have the second priority, ordinary messages (such as messages related to file transfers, regular data packets, etc.) have the third priority, log data messages and backup data messages have the fourth priority, and so on.

[0114] Exemplarily, the preset arbitration priority can be a priority determined according to the source of the message. For example, mission-critical applications (such as messages related to security monitoring systems, medical equipment, etc.) have a first priority, high-priority applications (such as messages related to real-time control systems, multimedia applications, etc.) have a second priority, general applications (such as messages related to office applications, routine computing tasks, etc.) have a third priority, and so on.

[0115] Exemplarily, the preset arbitration priority may be a priority determined according to the time sequence of the messages, for example, the message that arrives first has the highest transmission priority, the message that arrives last has the lowest priority, and so on.

[0116] Exemplarily, the preset arbitration priority may be a priority determined according to the time sensitivity of the message, for example, a first priority is assigned to messages with high real-time requirements, a second priority is assigned to messages with medium real-time requirements, a third priority is assigned to non-real-time messages, and so on.

[0117] In some implementations, the preset arbitration priority may also be a priority determined according to a message length or a service quality requirement. The specific priority adopted is determined according to actual needs and will not be described in detail here.

[0118] It should be noted that there may be no candidate messages to be transmitted. At this time, it indicates that the output ports pointed to by the messages to be transmitted in the current message queue to be transmitted are all in a busy state. If the messages to be transmitted continue to be transmitted, a deadlock problem may occur. Therefore, the processing of the message queue to be transmitted can be stopped until a new message to be transmitted is added to the message queue to be transmitted, or an output port has completed the transmission of the message, and then the processing of the message queue to be transmitted can be restarted.

[0119] Exemplarily, there may be only one candidate message to be transmitted. At this time, it indicates that there is only one message to be transmitted in the current message queue to be transmitted that does not conflict with the message being transmitted. The processing of other messages to be transmitted in the message queue to be transmitted can be stopped, and the candidate message to be transmitted can be directly transmitted until a new message to be transmitted is added to the message queue to be transmitted, or there is an output port that completes the transmission of the message, and then the processing of the message queue to be transmitted can be restarted.

[0120] Exemplarily, when there are multiple candidate messages to be transmitted, it means that there are multiple messages to be transmitted in the current queue of messages to be transmitted that do not conflict with the message being transmitted. At this time, since there may be conflicts between the candidate messages (the corresponding output ports overlap), a target message to be transmitted can be selected from multiple candidate messages to be transmitted for transmission through a global arbitrator according to a preset arbitration priority. Exemplarily, if the preset arbitration priority is a priority determined according to the time sequence of the messages, the candidate messages to be transmitted include message a and message b, and the time when the input port R1 receives message a is earlier than the time when the input port R3 receives message b, at this time, the global arbitrator can select message a as the target message to be transmitted for transmission, and message b stops being processed, or is transmitted after message a.

[0121] Exemplarily, candidate messages to be transmitted that do not conflict with each other between output ports can also be selected as target messages to be transmitted for transmission according to the current available network load. For example, if the current available network load indicates that there are 2 target messages to be transmitted that can be transmitted at present. If the candidate messages to be transmitted include message a, which points to output port S1; message b, which points to output ports S1 and S2; message c, which points to output port S3; message d, which points to output ports S4 and S5. At this time, the output ports between message a, message c and message d do not conflict with each other, or the output ports between message b, message c and message d do not conflict with each other, and two candidate messages to be transmitted can be arbitrarily selected from message a, message c and message d, or from message b, message c and message d as target messages to be transmitted. For example, message c and message d can be selected as target messages to be transmitted for transmission. Furthermore, the available network load at different times is different, and the target messages to be transmitted that can be transmitted are also different, which is determined according to the actual situation.

[0122] Furthermore, when the number of candidate messages to be transmitted that do not conflict with each other is less than the number of target messages to be transmitted that can be transmitted currently, the messages can be transmitted according to the actual number. For example, if the number of candidate messages to be transmitted that do not conflict with each other is 2 and the number of target messages to be transmitted that can be transmitted currently is 3, then the two candidate messages to be transmitted can be transmitted as target messages to be transmitted.

[0123] Through the above method, the to-be-transmitted message whose status is idle at the output port can be selected as the candidate to-be-transmitted message, that is, the to-be-transmitted message that does not conflict with the message currently being transmitted can be selected as the candidate to-be-transmitted message, and at least one target to-be-transmitted message can be selected for transmission, thereby avoiding the situation where multiple messages wait for each other to release resources, preventing the occurrence of deadlock, and also improving resource utilization.

[0124] In some implementations, in order to optimize the utilization of system resources, the current number of message transmissions may be determined based on the available load of the current system, and target messages to be transmitted of the current number of message transmissions may be selected for transmission, so as to ensure effective utilization of system resources while transmitting as many messages as possible and avoid deadlock between output ports. For example, step 104 may include:

[0125] (104.1) When there are multiple candidate messages to be transmitted whose output ports are in an idle state in the message queue to be transmitted, determine the receiving time corresponding to each candidate message to be transmitted according to a preset arbitration priority;

[0126] (104.2) Obtaining the available load of the current system, and determining the current number of message transmissions based on the available load;

[0127] (104.3) Select the target messages to be transmitted with the current message transmission quantity from multiple candidate messages to be transmitted according to the reception time corresponding to each candidate message to be transmitted; among them, the output ports between any two target messages to be transmitted do not overlap.

[0128] Among them, the reception time can be the specific time when the candidate message to be transmitted is received at the corresponding input port.

[0129] Among them, the available payload can be the maximum data transmission quantity that the current system can bear. Monitoring the available payload can optimize the selection of message transmission, ensure that the network will not be overloaded, and improve the resource utilization efficiency at the same time.

[0130] Among them, the current message transmission quantity can be the quantity of messages to be transmitted that can be selected according to the available payload of the system at the current moment. The current message transmission quantity at different moments is determined according to the available payload at the corresponding moments.

[0131] Exemplarily, when the preset arbitration priority is the priority determined according to the time sequence of messages, when each input port receives a message to be transmitted, the reception time of the message can be recorded by the system clock or timer, and after determining the candidate messages to be transmitted, at least one target message to be transmitted can be determined according to the reception time of each candidate message to be transmitted.

[0132] Exemplarily, in order to avoid conflicts as much as possible, it can be set to select one target message to be transmitted with the earliest corresponding reception time from the candidate messages to be transmitted each time. For example, if the candidate messages to be transmitted include message a with a reception time of 12:00 and message b with a reception time of 12:01, then message a can be selected as the target message to be transmitted for transmission.

[0133] Exemplarily, the current message quantity that can be transmitted at the current moment can also be dynamically determined according to the available payload of the current system. Specifically, different load thresholds can be set corresponding to different message transmission quantities. For example, when the available payload < 30%, the current message quantity that can be transmitted is N1; when 30% ≤ available payload < 60%, the current message quantity that can be transmitted is N2; when 60% ≤ available payload < 90%, the current message quantity that can be transmitted is N3; when the available payload ≥ 90%, the current message quantity that can be transmitted is N4. Among them, N1, N2, N3, and N4 are positive integers set according to system design and actual requirements, and N1 < N2 < N3 < N4. Further, the current message transmission quantity can be dynamically adjusted according to the real-time monitored available payload of the system. For example, if the available payload of the current system is 50%, then N2 is selected as the current message transmission quantity.

[0134] Furthermore, when the number of target messages to be transmitted that meet the conditions is less than the current number of messages to be transmitted, the target messages to be transmitted that meet the conditions can be transmitted. When selecting target messages to be transmitted, they are selected in order of priority. For example, if the current number of messages to be transmitted is 2, and the priority is determined according to the time sequence of the messages, then the two candidate messages to be transmitted that are transmitted first and whose output ports do not conflict with each other can be selected as target messages to be transmitted according to the time sequence.

[0135] In some implementations, a comprehensive weighted evaluation can be performed from multiple dimensions to obtain an overall available load corresponding to the system. For example, bandwidth utilization accounts for 50% of the overall available load, processor load accounts for 30% of the overall available load, and buffer occupancy accounts for 20% of the overall available load, thereby calculating a comprehensive available load. Exemplarily, the dimension of each dimension accounting for the overall available load can be adjusted according to actual conditions.

[0136] In some embodiments, the above-mentioned priority may be a priority determined according to the time sequence of the message, or a priority determined according to the source of the message, or a priority determined according to the time sequence of the message, or a priority determined according to the time sensitivity of the message, or a priority determined according to the message length or service quality requirements. Different priorities may also be applicable to the above-mentioned schemes, which will not be elaborated here one by one.

[0137] Furthermore, in order to avoid conflicts between target messages to be transmitted, target messages to be transmitted that meet the priority requirements can be selected based on the output port pointed to by each candidate message to be transmitted. For example, the current number of message transmissions is 2, the preset arbitration priority is the priority determined according to the time sequence of the messages (it can also be other priorities), and the candidate messages to be transmitted include message a with a receiving time of 12:00, corresponding to output port S1; message b with a receiving time of 12:01, corresponding to output ports S1 and S2; message c with a receiving time of 12:03, corresponding to output port S2; message d with a receiving time of 12:04, corresponding to output ports S1, S2 and 5; message e with a receiving time of 12:05, corresponding to output port S1. Then, according to the priority and the current number of message transmissions, message a and message b can be determined first. However, since message b conflicts with the output port of message a, the candidate message to be transmitted at the subsequent time of message b is selected, that is, message c. Since the output ports pointed to by message a and message c do not conflict, message a and message c can be transmitted as target messages to be transmitted.

[0138] Through the above methods, deadlock can be effectively avoided while optimizing system resource utilization and improving system stability and performance.

[0139] In some implementations, in order to avoid deadlock and waste of resources, after each transmission of a new target to-be-transmitted message, the to-be-transmitted message that conflicts with the output port pointed to by the message being transmitted can be suspended in the to-be-transmitted message queue to ensure efficient operation of the on-chip network. For example, after "selecting a target to-be-transmitted message from multiple candidate to-be-transmitted messages for transmission according to a preset arbitration priority" in step 104, it may also include:

[0140] (A.1) Filtering out, from a plurality of messages to be transmitted in the message queue to be transmitted, a suspended processing message whose output port is in a busy state;

[0141] (A.2) In the queue of messages to be transmitted, the processing of the suspended processing message is suspended until the output port completes the transmission of any target message to be transmitted, and the suspended processing message is restored to the message to be transmitted.

[0142] The suspended processing message may be a to-be-transmitted message in the to-be-transmitted message queue that conflicts with the output port pointed to by the message being transmitted, and the suspended processing message is suspended in the to-be-transmitted message queue.

[0143] Exemplarily, if the target device is provided with multiple levels of global arbiters, each level of global arbiters corresponds to the selection of a target message to be transmitted, and is used to select the corresponding target message to be transmitted according to the preset arbitration priority. For example, when the queue to be transmitted performs the first selection of the target message to be transmitted, the first-level global arbiter is used to determine the target message to be transmitted. If at this time, there are still messages to be transmitted in the queue to be transmitted, the second-level global arbiter is used to determine the target message to be transmitted, and so on.

[0144] Please refer to Figure 4 , exemplarily, Router represents a router, that is, a target device, wherein R1-R5 represent input ports for receiving messages to be transmitted from five directions, and correspond one-to-one to the five input directions, and similarly S1-S5 represent output ports for sending determined target messages to be transmitted to five directions, and correspond one-to-one to the five output directions, glb_rr1 represents a first-level global arbitrator, glb_rr2 represents a second-level global arbitrator, arb_1, arb_2, arb_3, arb_4, and arb_5 correspond to the respective arbitrators of each output port, and the representations in all the figures of the embodiments of the present application can refer to Figure 4The introduction of (in actual situations, the number of input ports and output ports may be different) can be referred to here later, and will not be repeated one by one. Further, the arbiter is used to determine the candidate messages to be transmitted and the target messages to be transmitted. When there is at least one message that needs to be multicast transmitted in the queue of messages to be transmitted, the global arbiter is used to select the target message to be transmitted according to the preset arbitration priority; when there is no message that needs to be multicast transmitted, the arbiter of each output port is used to determine the transmission order of each message to be transmitted.

[0145] exist Figure 4 In the figure, the target device receives the to-be-transmitted messages in the directions of E, S, W, N, and L through R1, R2, R3, R4, and R5 respectively. The E direction corresponds to message a, and the output ports it points to are S2 and S3; the S direction corresponds to message b, and the output ports it points to are S1 and S3; the W direction corresponds to message c, and the output ports it points to are S1 and S2; the N direction corresponds to message d, and the output port it points to is S4; the L direction corresponds to message e, and the output port it points to is S4. It can be seen that there are to-be-transmitted messages with multiple propagation directions in the to-be-transmitted message queue, and the global arbiter is used to select candidate to-be-transmitted messages and target to-be-transmitted messages.

[0146] Further, through the first-level global arbiter rr1, it can be determined that the message a from the E direction is authorized, and the message a can be transmitted as the target message to be transmitted. At this time, the output ports S2 and S3 corresponding to the message a can be locked. Since the message b from the S direction and the message c from the W direction conflict with the output port of the message a, that is, the output ports of the message b and the message c are in a busy state, the message b and the message c can be determined as suspended processing messages, and the processing of the message b and the message c is suspended (the message b and the message c are marked). At this time, the message d from the N direction and the message e from the L direction remain in the queue of messages to be transmitted. Since the output ports pointed to by the message d and the message e are both only one, they are unicast transmission messages. The message d and the message e are directly input to the local arbiter arb_4 corresponding to the output port S4 for arbitration. The message e is authorized and the message e is transmitted. Since the message d has a lower priority, the processing can be suspended first to ensure that the message e is transmitted first.

[0147] In some embodiments, after the output port completes the transmission of any target message to be transmitted, the message that may conflict with the suspended processing message has been transmitted, and the corresponding output port is in an idle state. At this time, the suspended processing message can be restored to the message to be transmitted in the queue of messages to be transmitted, and the message to be transmitted can be processed again in the queue of messages to be transmitted. Exemplarily, if message a is selected as the target message to be transmitted for transmission, the output ports corresponding to message a are S1 and S4, and the output port corresponding to the candidate message to be transmitted b is S1, and the output port corresponding to the candidate message to be transmitted c is S4, then the candidate message to be transmitted b and the candidate message to be transmitted c are determined as suspended processing messages. When message a is transmitted, the output ports pointed to by the candidate message to be transmitted b and the candidate message to be transmitted c are in an idle state again. At this time, the candidate message to be transmitted b and the candidate message to be transmitted c can be restored to the message to be transmitted, and the processing of the candidate message to be transmitted b and the candidate message to be transmitted c can be started in the queue of messages to be transmitted.

[0148] Through the above method, it is possible to avoid deadlock and ensure that all messages have the opportunity to be transmitted, thereby ensuring the efficient operation of the on-chip network.

[0149] Step 105 , repeatedly executing the step of selecting a target message to be transmitted from a plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority, until there is no candidate message to be transmitted whose output port is in an idle state in the message queue to be transmitted.

[0150] Step 106: When the queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the queue of messages to be transmitted is stopped.

[0151] In some embodiments, in order to avoid invalid operations, when there is no candidate message to be transmitted in the message queue to be transmitted and the output port to which it points is in an idle state, or when the message queue to be transmitted does not contain any message to be transmitted, the processing of the message queue to be transmitted may be stopped to use system resources for other tasks and improve overall efficiency.

[0152] Exemplarily, when there are messages a and b remaining in the queue to be transmitted, the output port pointed to by message a is S2, and the output port pointed to by message b is S6, and at the current moment, S2 and S6 are both transmitting other messages, that is, S2 and S6 are both in a busy state. At this time, there is no candidate message to be transmitted in the queue to be transmitted whose output port is in an idle state. Therefore, in order to save resources, the processing of the queue to be transmitted can be stopped.

[0153] In some implementations, if there are still candidate messages to be transmitted whose output ports are in an idle state in the queue of messages to be transmitted, the queue of messages to be transmitted should continue to be processed. For example, if after selecting the target message to be transmitted a for transmission, there are still candidate messages to be transmitted b and candidate messages to be transmitted c in the queue of messages to be transmitted, then if at least one of the candidate messages to be transmitted b and the candidate messages to be transmitted c needs to be multicast transmitted, the target message to be transmitted can continue to be selected from the candidate messages to be transmitted b and the candidate messages to be transmitted c for transmission according to the preset arbitration priority.

[0154] Exemplarily, if a new message to be transmitted is added to the queue of messages to be transmitted, the newly added message to be transmitted should continue to be processed in the queue of messages to be transmitted. For example, if the newly added message to be transmitted is message f, it can be further determined whether the output port pointed to by message f is in an idle state. If the output port pointed to by message f is in an idle state, message f can be transmitted as the target message to be transmitted.

[0155] The embodiment of the present application adds the message to be transmitted to the queue of messages to be transmitted when it is detected that any input port receives at least one message to be transmitted; when the queue of messages to be transmitted contains messages to be transmitted, determines the propagation direction of each message to be transmitted according to the output port pointed to by each message to be transmitted; when it is detected that there are messages to be transmitted with multiple propagation directions in the queue of messages to be transmitted, determines the state of the output port pointed to by each message to be transmitted; when there are multiple candidate messages to be transmitted in the queue of messages to be transmitted whose output ports are in an idle state, selects a target message to be transmitted from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission; repeats the step of selecting a target message to be transmitted from the multiple candidate messages to be transmitted according to the preset arbitration priority for transmission until there are no candidate messages to be transmitted whose output ports are in an idle state in the queue of messages to be transmitted; when the queue of messages to be transmitted does not contain any messages to be transmitted, stops processing the queue of messages to be transmitted. In this way, only the to-be-transmitted messages that do not conflict with the messages being transmitted can be processed each time, ensuring that only the messages that point to the idle output port can be used as candidate to-be-transmitted messages, avoiding the situation where multiple messages compete for the same resource at the same time, thereby avoiding the problem of deadlock and long waiting. At the same time, messages that do not conflict with the currently transmitted messages can be selected for transmission in turn, which improves the overall throughput of the system and thereby improves the efficiency of message transmission. In summary, the present application can prevent the occurrence of deadlock while improving the efficiency of message transmission.

[0156] In some implementations, in order to simplify the scheduling process, when only the to-be-transmitted messages that need to be unicasted are left in the to-be-transmitted message queue, each to-be-transmitted message can be sent to the message distributor (i.e., arbitrator) of the corresponding output port for distribution, thereby improving the response speed of the system. Exemplarily, the on-chip network data processing method also includes:

[0157] (B.1) when it is detected that there are no to-be-transmitted messages with multiple propagation directions in the to-be-transmitted message queue, determining a first to-be-transmitted message with a single propagation direction from the to-be-transmitted message queue;

[0158] (B.2) determining the output port to which each first message to be transmitted points, and the message distributor corresponding to each output port;

[0159] (B.3) determining, by a message distributor, a transmission order of each first message to be transmitted according to a preset arbitration priority;

[0160] (B.4) Transmitting each first message to be transmitted to the corresponding output port in sequence based on the transmission order.

[0161] The first message to be transmitted may refer to a message in the queue of messages to be transmitted, the propagation direction of which is a single propagation direction (ie, unicast).

[0162] The message distributor is also called an arbitrator, which may be a functional entity, and is used to determine the transmission order of the first to-be-transmitted messages that need to be sent according to a preset arbitration priority.

[0163] The transmission order may be the order in which each first message to be transmitted is transmitted to the corresponding output port determined by the message distributor.

[0164] In some embodiments, if the queue of messages to be transmitted initially contains all messages to be transmitted with a single propagation direction (i.e., unicast), or, after at least one screening of the target messages to be transmitted, the remaining messages in the queue of messages to be transmitted are all messages to be transmitted with a single propagation direction, these messages to be transmitted can be directly transmitted to the message distributor of the corresponding transmission output port for distribution, such as polling distribution, preset arbitration priority distribution, etc.

[0165] Please refer to Figure 5For example, if R1 receives message a from the E direction, the corresponding output port is S2; R2 receives message b from the S direction, the corresponding output port is S1; R3 receives message c from the W direction, the corresponding output port is S1; R4 receives message d from the N direction, the corresponding output port is S4; R5 receives message e from the L direction, the corresponding output port is S4. At this time, there is no message that needs to be multicasted in the message, and there is no need to globally arbitrate messages a, b, c, d, and e. All messages a, b, c, d, and e need to be transmitted to the message distributor of the corresponding output port, that is, the local arbitrator for separate distribution. Further, message a is input into the local arbitrator arb_2 for arbitration, message b and message c are input into the local arbitrator arb_1 for arbitration, message d and message e are input into the local arbitrator arb_4 for arbitration, and message a, message c and message e are respectively authorized. At this time, the output ports pointed to by the remaining messages b and d in the queue of messages to be transmitted are in a busy state, and the processing of the messages to be transmitted is suspended.

[0166] Please refer to Figure 6 For example, if R1 receives message a from the E direction, the corresponding output ports are S2 and S3; R2 receives message b from the S direction, and the corresponding output ports are S1 and S3; R3 receives message c from the W direction, and the corresponding output ports are S1 and S2; R4 receives message d from the N direction, and the corresponding output ports are S1 and S5; R5 receives message e from the L direction, and the corresponding output ports are S1 and S4. At this time, due to the existence of multicast transmitted messages, the target message to be transmitted is selected from messages a, b, c, d, and e. Specifically, the final target message to be transmitted can be determined by a first-level global message distributor (i.e., a first-level global arbiter glb_rr1). If message a is finally determined to be the target message to be transmitted, the output ports S2 and S3 corresponding to the transmission of message a can be locked. Then, since messages b and c that conflict with message a conflict with the output port of message a, b and message c are marked as suspended messages. At this time, the remaining messages to be transmitted in the queue to be transmitted are message d and message e. Message d and message e are sent to the secondary global arbiter glb_rr2 as candidate messages to be transmitted. If message d is determined to be the target message to be transmitted, the output ports S1 and S5 corresponding to message d are locked as busy. Since the remaining message e conflicts with the locked output port S1, message e is marked as a suspended message. At this time, the processing of the queue to be transmitted can be stopped.

[0167] Through the above method, the scheduling process of unicast messages is effectively simplified, the response speed and transmission efficiency of the system are improved, resource conflicts are avoided, and the flexibility and adaptability of the system are enhanced.

[0168] In some implementations, in order to avoid deadlock and ensure effective use of network resources, when the output port completes transmission of any target message to be transmitted, the queue of messages to be transmitted can be updated, and the previously suspended message processing due to message conflict can be restored to the message to be transmitted, and normal processing can be performed in the queue of messages to be transmitted, so as to ensure effective use of network resources, avoid deadlock, and improve the response speed of the system and the transmission efficiency of messages. For example, the on-chip network data processing method can also include:

[0169] (C.1) When the output port completes the transmission of any target message to be transmitted, the queue of messages to be transmitted is updated;

[0170] (C.2) restoring the suspended message in the transmission message queue to a message to be transmitted;

[0171] (C.3) when the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points;

[0172] (C.4) when it is detected that there are to-be-transmitted messages with multiple propagation directions in the to-be-transmitted message queue, determining the state of the output port to which each to-be-transmitted message points;

[0173] (C.5) when there are multiple candidate messages to be transmitted whose output ports are in an idle state in the updated message queue to be transmitted, a target message to be transmitted is selected from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission;

[0174] (C.6) Repeat the step of selecting a target message to be transmitted from a plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission until there is no candidate message to be transmitted whose output port is in an idle state in the updated message queue to be transmitted;

[0175] (C.7) When the updated queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the updated queue of messages to be transmitted is stopped.

[0176] Exemplarily, after the output port has completed the transmission of any target message to be transmitted, the message that may conflict with the suspended processing message has been transmitted, and the corresponding output port is in an idle state. At this time, the suspended processing message can be restored to the message to be transmitted in the queue of messages to be transmitted, and the message to be transmitted can be processed again in the queue of messages to be transmitted. Exemplarily, if message a is selected as the target message to be transmitted for transmission, the output ports corresponding to message a are S1 and S4, and the output port corresponding to the candidate message to be transmitted b is S1, and the output port corresponding to the candidate message to be transmitted c is S4, then the candidate message to be transmitted b and the candidate message to be transmitted c are determined as suspended processing messages. When message a is transmitted, the output ports pointed to by the candidate message to be transmitted b and the candidate message to be transmitted c are in an idle state again. At this time, the candidate message to be transmitted b and the candidate message to be transmitted c can be restored to the message to be transmitted, and the processing of the candidate message to be transmitted b and the candidate message to be transmitted c can be started in the queue of messages to be transmitted.

[0177] It should be noted that the process of re-treating the transmission message queue can refer to the above example, and the specific implementation example has been expanded above and will not be repeated here.

[0178] Through the above method, the efficiency of message transmission can be ensured while avoiding deadlock.

[0179] In some implementations, in order to avoid deadlock and ensure the effective use of network resources, when a new message to be transmitted is received through any input port, the queue of messages to be transmitted can be updated, and the message that was previously suspended due to message conflict can be restored to the message to be transmitted, and the queue of messages to be transmitted can be processed normally to avoid deadlock and improve the response speed of the system and the transmission efficiency of messages. For example, the on-chip network data processing method can also include:

[0180] (D.1) When at least one message to be transmitted is added to any input port, the queue of messages to be transmitted is updated;

[0181] (D.2) when the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points;

[0182] (D.3) when it is detected that there are to-be-transmitted messages with multiple propagation directions in the to-be-transmitted message queue, determining the state of the output port to which each to-be-transmitted message points;

[0183] (D.4) when there are multiple candidate messages to be transmitted whose output ports are in an idle state in the updated message queue to be transmitted, a target message to be transmitted is selected from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission;

[0184] (D.5) Repeat 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 for transmission until there is no candidate message to be transmitted whose output port is in an idle state in the updated message queue to be transmitted;

[0185] (D.6) When the updated queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the updated queue of messages to be transmitted is stopped.

[0186] Through the above method, the queue of messages to be transmitted can be updated in time, the consistency and real-time of the system state can be maintained, and the updated queue of messages to be transmitted can continue to be processed after the queue of messages to be transmitted is updated, so that when the output port pointed to by the new message to be transmitted is in an idle state, the new message to be transmitted can be transmitted immediately. In this way, the efficiency of resource transmission can be improved while avoiding deadlock.

[0187] See also Figure 7 The embodiment of the present application further provides an on-chip network data processing device, which can implement the above-mentioned on-chip network data processing method, and the on-chip network data processing device includes:

[0188] An adding module 71, configured to add the message to be transmitted to a queue of messages to be transmitted when it is detected that any input port receives at least one message to be transmitted;

[0189] A determination module 72, configured to determine a propagation direction of each message to be transmitted according to an output port to which each message to be transmitted points when the message to be transmitted queue contains messages to be transmitted;

[0190] The detection module 73 is used to determine the state of the output port pointed to by each to-be-transmitted message when it is detected that there are to-be-transmitted messages with the propagation directions of multiple propagation directions in the to-be-transmitted message queue;

[0191] A selection module 74 is used for selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority when there are a plurality of candidate messages to be transmitted whose output port is in an idle state in the message queue to be transmitted;

[0192] The processing module 75 is used to repeatedly execute the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority until there is no candidate message to be transmitted whose output port is in an idle state in the message queue to be transmitted;

[0193] The stopping module 76 is used to stop processing the queue of messages to be transmitted when the queue of messages to be transmitted does not contain any messages to be transmitted.

[0194] The specific implementation of the on-chip network data processing device is basically the same as the specific implementation of the on-chip network data processing method described above, and will not be repeated here. On the premise of meeting the requirements of the embodiment of the present application, the on-chip network data processing device can also be provided with other functional modules to implement the on-chip network data processing method in the above embodiment.

[0195] The embodiment of the present application also provides a computer device, the computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned on-chip network data processing method when executing the computer program. The computer device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0196] See also Figure 8 , Figure 8 The hardware structure of a computer device according to another embodiment is shown, and the computer device includes:

[0197] The processor 81 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0198] The memory 82 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 82 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 82, and the processor 81 calls and executes the on-chip network data processing method of the embodiment of this application;

[0199] Input / output interface 83, used to implement information input and output;

[0200] Communication interface 84, used to realize communication interaction between the device and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.);

[0201] A bus 85 that transmits information between the various components of the device (e.g., the processor 81, the memory 82, the input / output interface 83, and the communication interface 84);

[0202] The processor 81 , the memory 82 , the input / output interface 83 and the communication interface 84 are connected to each other in communication within the device via a bus 85 .

[0203] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned on-chip network data processing method is implemented.

[0204] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0205] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0206] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0207] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0208] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0209] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0210] It should be understood that in the present application, "at least one (item)" and "several" refer to one or more, and "plurality" refers to two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0211] In the several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0212] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0213] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0214] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0215] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A method for processing network-on-chip data, characterized in that: The method is applied to a target device, the target device includes a plurality of input ports and a plurality of output ports, and the method includes: When it is detected that any input port receives at least one message to be transmitted, the message to be transmitted is added to the queue of messages to be transmitted; When the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points; When it is detected that there are messages to be transmitted with the propagation directions of multiple propagation directions in the message queue to be transmitted, determining the state of the output port to which each message to be transmitted points; When there are a plurality of candidate messages to be transmitted whose output port is in an idle state 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; Repeat the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to a preset arbitration priority for transmission until there is no candidate message to be transmitted whose output port is in an idle state in the message queue to be transmitted; When the queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the queue of messages to be transmitted is stopped.

2. The on-chip network data processing method according to claim 1, characterized in that: The method further comprises: When it is detected that there are no messages to be transmitted in multiple propagation directions in the message queue to be transmitted, determining a first message to be transmitted whose propagation direction is a single propagation direction from the message queue to be transmitted; Determine the output port to which each first message to be transmitted points, and the message distributor corresponding to each of the output ports; Determining the transmission order of each first message to be transmitted according to a preset arbitration priority by the message distributor; Each first message to be transmitted is transmitted to the corresponding output port in sequence based on the transmission order.

3. The on-chip network data processing method according to claim 1, characterized in that: When there are a plurality of candidate messages to be transmitted whose output port is in an idle state 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, comprising: When there are a plurality of candidate messages to be transmitted whose output ports are in an idle state in the message queue to be transmitted, determining a receiving time corresponding to each candidate message to be transmitted according to a preset arbitration priority; Obtaining the available load of the current system, and determining the current message transmission quantity based on the available load; According to the receiving time corresponding to each candidate message to be transmitted, target messages to be transmitted with the current message transmission quantity are selected from the multiple candidate messages to be transmitted for transmission; wherein the output ports between any two target messages to be transmitted do not overlap.

4. The on-chip network data processing method according to claim 1, characterized in that: After selecting a target message to be transmitted from the plurality of candidate messages to be transmitted according to the preset arbitration priority for transmission, the method further includes: Filtering out the paused processing message whose state of the output port pointed to is busy from the multiple messages to be transmitted in the message queue to be transmitted; In the queue of messages to be transmitted, the processing of the suspended processing message is suspended until the output port completes the transmission of any one of the target messages to be transmitted, and the suspended processing message is restored to a message to be transmitted.

5. The on-chip network data processing method according to claim 1, characterized in that: The method further comprises: When the output port completes transmission of any one of the target messages to be transmitted, updating the queue of messages to be transmitted; Restoring the suspended processing message in the transmission message queue to a message to be transmitted; When the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points; When it is detected that there are messages to be transmitted with the propagation directions of multiple propagation directions in the message queue to be transmitted, determining the state of the output port to which each message to be transmitted points; When there are multiple candidate messages to be transmitted whose output port is in an idle state in the updated message queue to be transmitted, a target message to be transmitted is selected from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission; Repeat the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority until there is no candidate message to be transmitted whose output port is in an idle state in the updated message queue to be transmitted; When the updated queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the updated queue of messages to be transmitted is stopped.

6. The on-chip network data processing method according to claim 1, characterized in that: The method further comprises: When at least one of the to-be-transmitted messages is added to any of the input ports, updating the to-be-transmitted message queue; When the queue of messages to be transmitted contains messages to be transmitted, determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points; When it is detected that there are messages to be transmitted with the propagation directions of multiple propagation directions in the message queue to be transmitted, determining the state of the output port to which each message to be transmitted points; When there are multiple candidate messages to be transmitted whose output port is in an idle state in the updated message queue to be transmitted, a target message to be transmitted is selected from the multiple candidate messages to be transmitted according to a preset arbitration priority for transmission; Repeat the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority until there is no candidate message to be transmitted whose output port is in an idle state in the updated message queue to be transmitted; When the updated queue of messages to be transmitted does not contain any messages to be transmitted, the processing of the updated queue of messages to be transmitted is stopped.

7. The on-chip network data processing method according to claim 1, characterized in that: When it is detected that there are messages to be transmitted in the message queue to be transmitted whose propagation directions are multiple propagation directions, determining the state of the output port to which each message to be transmitted points includes: When it is detected that there are messages to be transmitted with the propagation directions being multiple propagation directions, determining an output port to which each message to be transmitted points; Obtain the first output port corresponding to the message currently being transmitted, and when the output port pointed to coincide with the first output port, determine that the state of the output port pointed to by the corresponding message to be transmitted is a busy state; or, when the output port pointed to coincide with the first output port, determine that the state of the output port pointed to by the corresponding message to be transmitted is an idle state.

8. A network-on-chip data processing device, characterized in that: The device comprises: An adding module, configured to add the message to be transmitted to a queue of messages to be transmitted when it is detected that any input port receives at least one message to be transmitted; A determination module, used for determining the propagation direction of each message to be transmitted according to the output port to which each message to be transmitted points when the message to be transmitted queue contains messages to be transmitted; A detection module, configured to determine the state of an output port to which each message to be transmitted points when detecting that there are messages to be transmitted with multiple propagation directions in the message queue to be transmitted; A selection module, configured to select a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority when there are a plurality of candidate messages to be transmitted whose output port is in an idle state in the message to be transmitted queue; a processing module, configured to repeatedly execute the step of selecting a target message to be transmitted from the plurality of candidate messages to be transmitted for transmission according to a preset arbitration priority until no candidate message to be transmitted whose output port is in an idle state exists in the message queue to be transmitted; The stopping module is used to stop processing the message queue to be transmitted when the message queue to be transmitted does not contain any message to be transmitted.

9. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the on-chip network data processing method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the on-chip network data processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Message arbitration method and device

    CN104104617A

  • Multicast message scheduling method and device

    CN104104618A

  • Network-on-chip and method for processing multicast flow deadlock problem

    CN112468392A

  • Multi-port arbitration method, device and equipment and computer readable storage medium

    CN114567607A

  • Scheduling and arbitration scheme for network processing device

    US6963576B1

Cited By

  • On-chip network transmission information arbitration method and related equipment

    CN120263759A

  • Routing node, routing network system and routing method

    CN120743838A