Data packet sending method, device, electronic device and readable storage medium

By implementing dynamic routing arbitration and re-selecting packet sending methods on the routing nodes of the on-chip network, the delay problem caused by packet blockage is solved, and data transmission efficiency and system performance are improved.

CN118748653BActive Publication Date: 2025-03-04BEIJING INSTITUTE OF OPEN SOURCE CHIP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410742972.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2025-03-04
Estimated Expiration
2044-06-07

AI Technical Summary

Technical Problem

The routing nodes in the on-chip network are prone to packet blockage when sending data packets, resulting in a large delay in data transmission.

Method used

By implementing the packet sending method on the routing node, the target direction is selected according to the preset direction priority, and directly send it when there is no contention packet in the target direction; when there is a contention packet, routing arbitration is performed, and if the arbitration fails, the routing direction is selected again.

Benefits of technology

It effectively avoids long-term blocking of data packets, reduces the data transmission delay in the entire network, and reduces the execution frequency of routing arbitration, thereby reducing the consumption of processing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118748653B_ABST
    Figure CN118748653B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a data packet sending method, device, electronic device and readable storage medium, which are applied to the field of computer technology. In the method, for any data packet to be sent, a target direction is selected from the available routing directions of the data packet to be sent according to a preset direction priority. In the case where there is no competing data packet to be sent in the target direction, the data packet to be sent is sent to the adjacent node in the target direction. In the case where there is a competing data packet to be sent in the target direction, routing arbitration is performed on the data packet to be sent and the competing data packet based on a preset arbitration rule. In the case where the arbitration result of the data packet to be sent is an arbitration failure, a target direction is reselected from the remaining available routing directions according to the direction priority, so as to send the data packet to be sent based on the reselected target direction. In this way, it is possible to avoid the data packet being blocked in the routing node for a long time, thereby reducing the data transmission delay in the entire network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data packet sending method, device, electronic device and readable storage medium. Background Art

[0002] At present, in order to facilitate data transmission between processing units integrated in the system on chip, each processing unit is often connected through a network topology structure to form an on-chip network. The on-chip network may include multiple routing nodes, each routing node is connected to at least one processing unit, and the routing nodes are connected to each other. The routing nodes can be responsible for forwarding data packets generated by the processing unit. In this way, the data packet is sent through the routing nodes in the on-chip network and can eventually be sent to the destination processing unit indicated by the data packet.

[0003] In the related art, there is a problem that data packets are easily blocked in the way that routing nodes in the on-chip network send data packets, resulting in a large delay in data transmission. Summary of the invention

[0004] The embodiments of the present invention provide a method and device for sending a data packet, an electronic device and a readable storage medium, which can solve the problems in the related art.

[0005] In order to solve the above problem, an embodiment of the present invention discloses a method for sending a data packet, the method comprising:

[0006] For any data packet to be sent, selecting a target direction from available routing directions of the data packet to be sent according to a preset direction priority;

[0007] When there is no competing data packet to be sent in the target direction, sending the data packet to be sent to the adjacent node in the target direction;

[0008] In the case where the competing data packet exists in the target direction, routing arbitration is performed on the to-be-sent data packet and the competing data packet based on a preset arbitration rule;

[0009] When the arbitration result of the data packet to be sent is arbitration failure, a target direction is reselected from the remaining available routing directions according to the direction priority, so as to send the data packet to be sent based on the reselected target direction.

[0010] On the other hand, an embodiment of the present invention discloses a data packet sending device, the device comprising:

[0011] A first selection module, configured to select, for any data packet to be sent, a target direction from available routing directions of the data packet to be sent according to a preset direction priority;

[0012] A first generating module, configured to send the data packet to be sent to the adjacent nodes in the target direction when there is no competing data packet to be sent in the target direction;

[0013] An arbitration module, configured to perform routing arbitration on the data packets to be sent and the competing data packets based on preset arbitration rules when there are competing data packets to be sent in the target direction;

[0014] The second selection module is used to reselect a target direction from the remaining available routing directions according to the direction priority when the arbitration result of the data packet to be sent is arbitration failure, so as to send the data packet to be sent based on the reselected target direction.

[0015] On the other hand, an embodiment of the present invention further discloses an electronic device, which includes a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the aforementioned data packet sending method.

[0016] The embodiment of the present invention further discloses a readable storage medium. When instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the aforementioned data packet sending method.

[0017] The embodiment of the present invention has the following advantages: In a data packet sending method provided by the embodiment of the present invention, for any data packet to be sent, the routing node selects a target direction from the available routing directions of the data packet to be sent according to a preset direction priority. In the case where there is no competing data packet to be sent in the target direction, the data packet to be sent is sent to the adjacent node in the target direction. In the case where there is a competing data packet to be sent in the target direction, routing arbitration is performed on the data packet to be sent and the competing data packet based on a preset arbitration rule. In the case where the arbitration result of the data packet to be sent is arbitration failure, a target direction is reselected from the remaining available routing directions according to the direction priority, so as to send the data packet to be sent based on the reselected target direction. Compared with the method of waiting in the case of competition in the target direction until the destination in the target direction is sent and then sending along other directions, in the embodiment of the present invention, dynamic arbitration is performed in the case of competition in the target direction, and in the case of arbitration failure of the data packet to be sent, an available routing direction is replaced as the new target direction, so as to send it based on the reselected target direction. In this way, it is possible to avoid the data packet being blocked in the routing node for a long time, and reduce the data transmission delay in the entire network.

[0018] In the embodiment of the present invention, only when there is competition in the target direction, routing arbitration is performed on these data packets based on the preset arbitration rules. In this way, the execution frequency of routing arbitration can be reduced to a certain extent, thereby reducing the processing resources consumed. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0020] Figure 1 is a flow chart of steps of an embodiment of a method for sending a data packet of the present invention;

[0021] Figure 2 is a schematic diagram of a connection direction of a routing node shown in an embodiment of the present invention;

[0022] Figure 3 is a schematic diagram of the structure of a network on chip shown in an embodiment of the present invention;

[0023] Figure 4 It is a structural block diagram of a data packet sending device of the present invention;

[0024] Figure 5 It is a structural block diagram of an electronic device for sending data packets provided by an example of the present invention. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.

[0027] The data packet sending method provided in the embodiment of the present invention can be applied to an on-chip network. At present, with the advancement of semiconductor technology, more and more processing units are integrated in the system on chip (System on Chip, SoC). Among them, the processing unit can also be called a peripheral, and the processing unit can include a processor core, a graphics processor core, a memory controller, a memory, and a dedicated function module, etc. The traditional bus structure cannot meet the needs of a large number of data transmissions. Therefore, the application of setting up a network on chip (Network on Chip, NoC) in SoC is becoming more and more extensive. NoC interconnects each processing unit through a network topology structure, which improves the bandwidth and parallel processing capability of data transmission. In one implementation method, when building a NoC for a multi-core processor system, a coherent hub interconnect (Coherent Hub Interconnect, CHI) protocol can be used for construction. Among them, the CHI protocol is designed for high-performance cache consistency, which provides an efficient data transmission and consistency management mechanism. Since the use of CHI protocol to build NoC has the advantages of cache consistency support, high performance, scalability, flexible topology, quality of service (QoS) support and modular design, the CHI protocol has been widely used and recognized. With the continuous development of system-on-chip, the CHI protocol also plays an important role in high-performance computing, heterogeneous computing and large-scale multi-core systems. When building NoC based on the CHI protocol, the mesh topology (MESH) is widely used as an available network topology due to its regularity and scalability. Among them, the MESH structure is a multi-core interconnected topology. Each routing node in the MESH structure is connected to the surrounding routing nodes to form a mesh interconnection structure. The network on chip using the MESH structure can be called a MESH network. In the MESH network built based on the CHI protocol, the routing nodes can follow the CHI protocol.

[0028] Specifically, each routing node in the MESH network is connected to an adjacent routing node to form a grid-like structure, and data is sent and received between routing nodes, and finally the data is sent to the destination routing node. Finally, the destination routing node can send data to the connected destination processing unit. Among them, the routing node can be a routing point control unit, and the routing node can also be called an SXP (Simple Cross point) node. The MESH structure can be a two-dimensional MESH structure or a three-dimensional MESH structure. Accordingly, the MESH network in the embodiment of the present invention can be a 2D-MESH network or a 3D-MESH network. In a 2D-MESH network, routing nodes are arranged in rows (X-axis dimensions) and columns (Y-axis dimensions), and each routing node is connected to its upper, lower, left, and right adjacent nodes. In a 3D-MESH network, routing nodes are arranged in rows (X-axis dimensions), columns (Y-axis dimensions), and depth (Z-axis dimensions), and each routing node is connected to its upper, lower, left, right, front, and rear adjacent nodes.

[0029] In a MESH network based on the CHI protocol, a large amount of data interaction is often required between adjacent routing nodes. In the method of using static routing, that is, the routing path is fixed, and each time it is sent in one direction by default, after sending to the destination in that direction, that is, reaching the same position as the destination routing node in that direction, it is sent along other directions. In this way, if the currently used direction does not reach the destination, but there is data packet competition in that direction, it will always wait in that direction. In this way, the data packet will be blocked in the routing node for a long time, causing a large data transmission delay in the entire network, resulting in a decrease in the performance of the entire system. If the direction is not fixed, each time it is defaulted to dynamically select the adjacent node in which direction to send the data packet according to the current state of the network (for example, congestion, fault node status, etc.), which will lead to frequent selection of calculation operations, state updates and other operations, which will increase the data transmission delay and increase the processing power consumption, and the processing resource consumption is large. To this end, an embodiment of the present invention provides a data packet sending method, and the data packet sending method is described in detail below.

[0030] Method Embodiment

[0031] Reference Figure 1 , shows a flowchart of a method for sending a data packet according to an embodiment of the present invention, the method can be applied to any routing node in a network on chip, and the method can specifically include the following steps:

[0032] Step 101: For any data packet to be sent, a target direction is selected from available routing directions of the data packet to be sent according to a preset direction priority.

[0033] In an embodiment of the present invention, a reference coordinate system can be constructed in advance in the on-chip network, and a coordinate in the reference coordinate system is determined for each routing node of the on-chip network. In the case where the on-chip network is a two-dimensional MESH network, the reference coordinate system may include an X-axis and a Y-axis, and in the case where the on-chip network is a three-dimensional MESH network, the reference coordinate system may include an X-axis, a Y-axis, and a Z-axis. Among them, the specific directions corresponding to the X-axis, the Y-axis, and the Z-axis, and the origin position of the reference coordinate system can be set according to actual needs, for example, the X-axis is established along the row direction in the on-chip network, the Y-axis is established along the column direction in the on-chip network, and the Z-axis is established along the depth direction in the on-chip network. Select a point from the vertices in the MESH network as the origin, for example, select the routing node in the lower left corner as the origin, and accordingly, the coordinate of the routing node in the reference coordinate system is (0,0), and accordingly, for any coordinate axis, starting from the routing node at the origin, for any other routing node, the other routing node is the routing node in the direction of the coordinate axis, that is, the value of the other routing node corresponding to the coordinate axis. For example, taking the on-chip network as a two-dimensional MESH network,

[0034] Figure 2 FIG. 1 is a schematic diagram of a connection direction of a routing node shown in an embodiment of the present invention. Figure 2 As shown, the routing node may include six routing directions: East (E), South (S), West (W), North (N), P0 and P1. Among them, routing may refer to the transmission process of a data packet from a source processing unit to a destination processing unit. The source processing unit may be the starting position of the data packet, for example, the data packet may be generated by the source processing unit, and the destination processing unit may be the end position of the data packet, that is, the data packet needs to be transmitted to the destination processing unit in the end. The routing direction refers to the optional data transmission direction during the transmission of the data packet from the source processing unit to the destination processing unit. Further, there are 16 routing nodes: SXP0-SXP15, a 4×4 MESH topology is adopted, and each routing node is connected to a processing unit in the P0 and P1 directions respectively, and the on-chip network includes processing units: RN-F, HN-F, RN-I, SN-F as an example. Figure 3 is a schematic diagram of a structure of a network on chip shown in an embodiment of the present invention, such as Figure 4As shown, SXP0-SXP15 in the network are directly connected to adjacent routing nodes in the east, south, west, and north directions when there are adjacent routing nodes in these directions. Assuming that SXP0 is taken as the origin, the coordinate point of SXP0 in the reference coordinate system is (0, 0), the X axis is established along the row direction of the on-chip network, and the Y axis is established along the column direction of the on-chip network. SXP1 is the first routing node in the X coordinate axis direction and the 0th routing node in the Y coordinate axis direction. The coordinate point of SXP1 in the reference coordinate system is (1, 0). Similarly, the coordinate point of SXP2 in the reference coordinate system is (2, 0), the coordinate point of SXP3 in the reference coordinate system is (3, 0), the coordinate point of SXP4 in the reference coordinate system is (0, 1), and the coordinate point of SXP5 in the reference coordinate system is (1, 1).

[0035] Accordingly, the routing node can determine the available routing direction that can be used for the data packet to be sent from the selectable data sending directions based on the coordinates of the destination routing node carried in the data packet to be sent (recorded as the target coordinates) and the coordinates of the routing node itself. Among them, the destination routing node can be the routing node to which the destination processing unit of the data packet to be sent is connected, and the value of the first designated bit in the target identifier (Target Identifier, Tgtid) of the data packet to be sent can be extracted to obtain the coordinates of the destination routing node. Exemplarily, Tgtid is a field of Filt specified in the CHI protocol, and the bit width of Tgtid can be 7 bits, wherein the [6:5]th bit represents the X coordinate, and the [4:3]th bit represents the Y coordinate. Accordingly, the first designated bit can be the [6:5]th bit and the [4:3]th bit, that is, Tgtid[6:5] represents the X coordinate, and Tgtid[4:3] represents the Y coordinate.

[0036] The data packet to be sent may be a data packet whose destination routing node is not the routing node. Accordingly, an available routing direction can be selected for the data packet to be sent from the directions connected to other routing nodes. The target coordinates can be compared with the own coordinates to determine the direction that makes the data packet to be sent close to the destination routing node as an available routing direction. Exemplarily, if the X coordinate value in the target coordinates is greater than the X coordinate value in the own coordinates, the east direction is selected, if the Y coordinate value in the target coordinates is greater than the Y coordinate value in the own coordinates, the north direction is selected, if the X coordinate value in the target coordinates is less than the X coordinate value in the own coordinates, the west direction is selected, and if the Y coordinate value in the target coordinates is less than the Y coordinate value in the own coordinates, the south direction is selected. The target coordinates and the own coordinates may meet the above multiple situations, so the available routing directions can be multiple selected directions. For example, the X coordinate value and the Y coordinate value in the target coordinates are both greater than the X coordinate value and the Y coordinate value in the own coordinates, and the east direction and the north direction can be selected as available routing directions. Alternatively, the X coordinate value and the Y coordinate value in the target coordinates are both less than the X coordinate value and the Y coordinate value in the own coordinates, and the west direction and the south direction can be selected as available routing directions. It can be understood that if a certain coordinate value of the target coordinates is equal to that of the own coordinates, the available routing directions include 1 direction.

[0037] It should be noted that, for a received data packet whose destination routing node is the routing node, the value of the second designated bit in the Tgtid of the data packet can be extracted, and the processing unit corresponding to the value of the second designated bit in the processing unit connected to the routing node is selected as the destination processing unit of the data packet. The data packet is sent to the destination processing unit. Among them, the second designated bit can be the 0th bit, that is, the value of Tgtid[0] indicates the destination processing unit. For example, different values ​​of Tgtid[0] can represent different peripheral directions, and the processing unit connected to the peripheral direction indicated by the value of Tgtid[0] can be used as the destination processing unit. For example, when the value of Tgtid[0] is 0, it can indicate the P0 peripheral direction, and when the value of Tgtid[0] is 1, it can indicate the P1 peripheral direction. It should be noted that the unused bits in Tgtid can be used as reserved bits, and these reserved bits can be used later when the original bits are not enough to represent the coordinates or when new information needs to be added.

[0038] Further, the preset direction priority may be set according to actual needs, and the preset direction priority may be used to indicate which direction is used first, wherein the higher the direction priority, the more preferentially it is used. Exemplarily, the preset direction priority may include: X-axis direction priority I, Y-axis direction priority II, and Z-axis priority III. Among them, the X-axis direction priority is higher than the Y-axis direction priority, and the Y-axis direction priority is higher than the Z-axis direction priority. Accordingly, according to the preset direction priority, the available routing direction with the highest priority can be selected from the available routing directions of the data packet to be sent as the target direction. Specifically, the available routing direction with the highest priority in the coordinate axis direction can be selected as the target direction. The coordinate axis direction can be the direction of the coordinate axis parallel to the available routing direction. For example, for the east and west directions, the coordinate axis direction can be the X-axis direction, for the south and north directions, the coordinate axis direction can be the Y-axis direction, and for the front and rear directions, the coordinate axis direction can be the Z-axis direction. Assuming that the available routing directions of the data packet to be sent include the east direction and the north direction, the east direction can be selected as the target direction first. Among them, the current target direction is the east direction.

[0039] It should be noted that the direction of the data packet to be sent close to the destination routing node may have a load exceeding the load threshold. In some implementations, in this case, the direction away from the destination routing node can also be selected as an available routing node, that is, the path with the current lighter load is dynamically selected to balance the load in the network and reduce the waiting time. Accordingly, each time the target direction is selected, the two available routing directions with the highest priority for the direction of the coordinate axis to which it belongs can be selected first, and the available routing direction away from the destination routing node can be selected secondly.

[0040] Step 102: When there is no competing data packet to be sent in the target direction, send the data packet to be sent to the adjacent nodes in the target direction.

[0041] Among them, the competing data packet may be other data packets that need to be sent in the current target direction. Specifically, there are competing data packets to be sent in the current target direction, which may be other data packets to be sent on the sending channel in the target direction that matches the type of the data packet to be sent. Specifically, if there is no competing data packet to be sent in the current target direction, it means that the sending channel in the current target direction is in an idle state. Therefore, the current target direction can be used to send the data packet to be sent to the adjacent node in the current target direction. Taking the current routing node as SXP0 with coordinates (0, 0), the target coordinates of the data packet to be sent are (2, 2), that is, the destination routing node of the data packet to be sent is SXP10 as an example, the available routing directions of the data packet to be sent may include the east direction and the north direction. Accordingly, the current target direction may be the east direction. If there is no data packet competition in the east direction, that is, there is no competing data packet to be sent in the east direction, SXP0 can send the data packet to be sent along the east direction (that is, along the X-axis) to the adjacent node in the east direction: SXP1. In this way, it is equivalent to achieving the priority of sending along the X-axis as much as possible.

[0042] Step 103: When the competing data packet exists in the target direction, routing arbitration is performed on the to-be-sent data packet and the competing data packet based on a preset arbitration rule.

[0043] Furthermore, the preset arbitration rule may be one or more arbitration rules pre-set according to actual conditions. Accordingly, in the case where the preset arbitration rule is multiple arbitration rules, routing arbitration based on the preset arbitration rule may be multi-level arbitration based on the multiple arbitration rules, and the specific arbitration process will be described in detail later. Furthermore, routing arbitration is performed on the data packet to be sent and the competing data packet, which may be used to determine which data packet can be sent along the target direction this time. Specifically, for any data packet in the data packet to be sent and the competing data packet, routing arbitration may determine whether the arbitration of the data packet succeeds or fails.

[0044] Step 104: When the arbitration result of the data packet to be sent is arbitration failure, reselect a target direction from the remaining available routing directions according to the direction priority, so as to send the data packet to be sent based on the reselected target direction.

[0045] In an embodiment of the present invention, if the arbitration result of the data packet to be sent is arbitration failure, it means that the data packet that can be sent along the target direction this time is a competing data packet. Accordingly, in this case, an available routing direction can be reselected as a new target direction according to the direction priority, and the above judgment process for the target direction can be repeated to send the data packet to be sent based on the new target direction. Optionally, the above step of reselecting a target direction from the remaining available routing directions according to the direction priority to send the data packet to be sent based on the reselected target direction can specifically include: selecting the available routing direction with the highest priority from the remaining available routing directions according to the direction priority as the new target direction. When re-entering the step of performing routing arbitration on the data packet to be sent and the competing data packet based on the preset arbitration rule when there is a competing data packet to be sent in the target direction. Specifically, the available routing direction with the highest priority in the direction of the coordinate axis can be selected from the remaining available routing directions according to the direction priority as the new target direction. That is, in an embodiment of the present invention, the target direction can be selected in order from high to low direction priorities. The remaining available routing directions can be available routing directions that have not been selected in this processing flow. Then, the process can return to step 102, and the subsequent operations can be performed again from step 102. Taking the above-mentioned current routing node as SXP0 with coordinates (0, 0), and the destination routing node of the data packet to be sent as SXP10 as an example, the target direction selected for the first time can be the east direction in the X-axis direction. If there is a competing data packet to be sent in the east direction, and the arbitration result of the data packet to be sent is arbitration failure, the reselected target direction can be the north direction in the Y-axis direction. Accordingly, by re-entering the above step 102, the processing method for each selected target direction is the same. Exemplarily, it can be realized that for the new target direction: north direction, it is determined whether there is a competing data packet to be sent in the north direction. If not, the data packet to be sent is sent to the adjacent node in the north direction. If it exists, based on the preset arbitration rules, the data packet to be sent and the competing data packet in the north direction are routed for arbitration. If the arbitration is successful, the data packet to be sent is sent to the adjacent node in the north direction. On the contrary, a new target direction can be selected for processing again. In this way, if the competition in the current target direction fails, a new target direction can be selected and processing can be continued. Data packets can be allowed to choose different paths for transmission, so that the data packets to be sent can be sent as soon as possible, and the best routing path can be selected for the data packets as much as possible. The data packets are dispersed to different paths, reducing the risk of data packet congestion, thereby avoiding the congestion problem of a single path to a certain extent.

[0046] It should be noted that when there are no remaining available routing directions, that is, each available routing direction has been selected as the target direction, a new processing flow can be started, that is, execution starts again from the above step 101 until the data packet to be sent is sent.

[0047] Optionally, the embodiment of the present invention may further include: when the arbitration result of the data packet to be sent is arbitration success, the data packet to be sent is sent to the adjacent nodes in the target direction. Specifically, if the arbitration result of the data packet to be sent is arbitration success, it means that the data packet that can be sent along the target direction this time is the data packet to be sent. Accordingly, when the arbitration of the data packet to be sent is successful, the data packet to be sent is sent to the adjacent nodes along the target direction, so that the data packet can be sent as much as possible in the direction specified by the preset direction priority.

[0048] In an embodiment of the present invention, the target direction is selected each time according to the same direction priority, so that the routing node can send in the direction specified by the preset direction priority as much as possible. Specifically, the target direction is selected in sequence according to the preset direction priority and sent based on the target direction, that is, the higher the direction priority of the coordinate axis, the more priority it is used. So that each time a data packet to be sent is sent, it is sent along a certain coordinate axis direction as much as possible. If there is competition in the coordinate axis direction, routing arbitration is performed. If the arbitration of the data packet to be sent fails, another coordinate axis direction is replaced as the target direction for sending. Specifically, the processing process for another coordinate axis direction is similar to the aforementioned processing process, that is, if there is no competition, use this direction for sending. If there is competition, routing arbitration is performed. Assume that the priority of the X-axis direction is greater than that of the Y-axis direction, and the priority of the Y-axis direction is greater than that of the Z-axis direction. Then, during the routing process, the available routing direction belonging to the X-axis direction may be preferentially selected as the target direction, and the data packet may be sent along the X-axis direction. If the data packet cannot be sent along the X-axis direction, that is, there is competition in the X-axis direction and the arbitration of the data packet to be sent fails, the available routing direction belonging to the Y-axis direction may be selected as the target direction, and the data packet may be sent along the Y-axis direction. If the data packet cannot be sent along the Y-axis direction, that is, there is competition in the Y-axis direction and the arbitration of the data packet to be sent fails, the data packet may be sent along the Z-axis direction.

[0049] In summary, in a data packet sending method provided by an embodiment of the present invention, for any data packet to be sent, the routing node selects a target direction from the available routing directions of the data packet to be sent according to a preset direction priority. In the case where there is no competing data packet to be sent in the target direction, the data packet to be sent is sent to the adjacent node in the target direction. In the case where there is a competing data packet to be sent in the target direction, routing arbitration is performed on the data packet to be sent and the competing data packet based on a preset arbitration rule. In the case where the arbitration result of the data packet to be sent is arbitration failure, a target direction is reselected from the remaining available routing directions according to the direction priority to send the data packet to be sent based on the reselected target direction. Compared with the method of waiting in the case of competition in the target direction until the destination in the target direction is sent, and then sending along other directions, in the embodiment of the present invention, dynamic arbitration is performed in the case of competition in the target direction, and in the case of arbitration failure of the data packet to be sent, an available routing direction is replaced as the new target direction to send it based on the reselected target direction. In this way, it is possible to avoid the data packet being blocked in the routing node for a long time and reduce the data transmission delay in the entire network.

[0050] In the embodiment of the present invention, only when there is competition in the target direction, routing arbitration is performed on these data packets based on the preset arbitration rules. In this way, the execution frequency of routing arbitration can be reduced to a certain extent, thereby reducing the processing resources consumed.

[0051] Optionally, in some embodiments, the following steps may also be included:

[0052] Step S21: Detecting the number of arbitration failures corresponding to the data packet to be sent.

[0053] Step S22: When the competing data packet exists in the target direction, if the number of arbitration failures is not less than a preset number threshold, the to-be-sent data packet is sent to an adjacent node in the target direction.

[0054] Correspondingly, the above-mentioned routing arbitration of the to-be-sent data packet and the competing data packet based on the preset arbitration rules may specifically include: when the number of arbitration failures is less than the preset number threshold, routing arbitration of the to-be-sent data packet and the competing data packet based on the preset arbitration rules.

[0055] In an embodiment of the present invention, a data packet to be sent may participate in multiple routing arbitrations. For example, for the above example, the data packet to be sent may participate in routing arbitration in the east direction in the X-axis direction, and in the north direction in the Y-axis direction. The number of arbitration failures corresponding to the data packet to be sent may be a number parameter maintained for the data packet to be sent. After the data packet to be sent is sent, the number of arbitration failures corresponding to the data packet to be sent may be cleared. Accordingly, for any data packet to be sent, the routing node may increase the number of arbitration failures corresponding to the data packet to be sent by 1 each time the data packet to be sent fails in arbitration. In this way, the number of arbitration failures may represent the number of arbitration failures of the data packet to be sent in the current routing node.

[0056] Among them, the preset number threshold can be set according to actual conditions. For example, the preset number threshold can be 2, or the preset number threshold can be 3, which is not limited in the embodiment of the present invention. Accordingly, in the case where there is a competing data packet to be sent in the target direction, the specific value of the number parameter can be read first. If the specific value is less than the preset number threshold, then based on the preset arbitration rule, the data packet to be sent and the competing data packet are routed for arbitration. On the contrary, if the specific value is not less than the preset number threshold, it can be explained to a certain extent that the data packet to be sent has not competed for the sending right for many times and stays in the current routing node for a long time. Then routing arbitration can be omitted this time, and the data packet to be sent does not need to participate in arbitration this time, and the data packet to be sent can be sent to the adjacent node along the target direction. In this way, when the number of arbitration failures is less than the preset number threshold, routing arbitration is performed on the data packet to be sent and the competing data packet based on the preset arbitration rule. When the number of arbitration failures is not less than the preset number threshold, the data packet to be sent is sent first, which can avoid the problems of increased delay, reduced network performance and reduced service quality caused by the failure of the data packet to be processed in time.

[0057] Optionally, in some embodiments, the arbitration result may include arbitration success and arbitration failure; the step of performing routing arbitration on the to-be-sent data packet and the competing data packet based on the preset arbitration rule may specifically include:

[0058] Step 1031: Select a rule from the preset arbitration rules as the target rule according to the selection order of rule priority from high to low;

[0059] Step 1032: Determine the number of data packets that meet the target rule among the data packets to be sent and the competing data packets.

[0060] Step 1033: If the number is less than 2, determine that the data packets that meet the target rule have been successfully arbitrated, and determine that other data packets have failed to arbitrate.

[0061] Step 1034: If the number is not less than 2, reselect a rule from the remaining preset arbitration rules as a new target rule according to the selection order, and enter the step of determining the number of data packets that meet the target rule in the to-be-sent data packets and the competing data packets.

[0062] An embodiment of the present invention may be a case where at least two arbitration rules are preset as arbitration rules, and multi-level arbitration is performed based on the at least two arbitration rules. Among them, using one arbitration rule to perform an arbitration can be regarded as a first-level arbitration. Specifically, the rule priority can be set in advance for the preset arbitration rule. Selecting the target rule in the order of rule priority from high to low can make the arbitration rule with the highest priority be used first, and accordingly, the arbitration rule with a higher priority is used earlier. In the case where the current target rule cannot determine which data packet among the to-be-sent data packet and the competing data packet can be sent along the target direction this time, a new arbitration rule can be selected as the new target rule.

[0063] It should be noted that, when the current target rule is a reselected target rule, the number of data packets that meet the target rule in the data packets to be sent and the competing data packets can be determined by, among the data packets to be sent and the competing data packets that meet the previous target rule, determining the number of data packets that meet the current target rule. That is, the data packets participating in the arbitration at this level are the data packets that meet the target rule in the arbitration at the previous level. When the current target rule is not a reselected target rule, that is, the current target rule is a target rule selected for the first time, the number of data packets that meet the current target rule can be determined among the data packets to be sent and the competing data packets.

[0064] Specifically, a new target rule may be selected from the remaining preset arbitration rules in the order of rule priority from high to low. Accordingly, the selected arbitration rule is the arbitration rule with the highest priority among the remaining preset arbitration rules. The remaining preset arbitration rules may be arbitration rules that have not been selected.

[0065] For any selected target rule, if the number of data packets that meet the target rule is less than 2, it means that there are no multiple data packets that meet the target rule among the data packets to be sent and the competing data packets. Based on the target rule, a data packet can be uniquely determined, that is, the current target rule can be used to determine which data packet can be sent along the target direction this time. Therefore, it can be determined that the data packets that meet the target rule are successfully arbitrated, and it can be determined that other data packets fail to arbitrate, that is, an arbitration result of successful arbitration is generated for the data packets that meet the target rule, and an arbitration result of failed arbitration is generated for other data packets.

[0066] If the number of data packets that meet the target rule is not less than 2, it means that there are at least two data packets in the data packets to be sent and the competing data packets that meet the target rule, and the current target rule cannot determine which data packet can be sent along the target direction this time. Therefore, a new target rule can be reselected, and the process returns to step 1032, and subsequent operations are performed again from step 1032, that is, a new level of arbitration is performed using the new target rule. In the embodiment of the present invention, a preset arbitration rule is first selected as the target rule, and the number of data packets that meet the target rule is determined. When the number of data packets that meet the target rule is less than 2, that is, the current target rule is sufficient to determine which data packet can be sent along the target direction this time, a new target rule is no longer selected, that is, a new level of arbitration is not performed. When the number of data packets that meet the target rule is not less than 2, that is, the current target rule cannot determine which data packet can be sent along the target direction this time, a preset arbitration rule is reselected as the new target rule to perform a new level of arbitration. In this way, while ensuring the completion of routing arbitration, unnecessary processing operations can be avoided, thereby saving processing resources and efficiently realizing routing arbitration.

[0067] It should be noted that, in the absence of any remaining preset arbitration rules, a data packet may be selected from the data packets that meet the current target rule, for example, randomly selected, and the arbitration of the data packet is determined to be successful, and the arbitration of other data packets is determined to be unsuccessful. Alternatively, a rule that cannot be met by at least two data packets at the same time may be set as the preset arbitration rule with the lowest priority, so as to ensure that after multiple levels of arbitration, a data packet that succeeds in arbitration can be uniquely determined.

[0068] Furthermore, in the case where the preset arbitration rule is one arbitration rule, the number of data packets that meet the arbitration rule among the data packets to be sent and the competing data packets can be directly determined. If the number is less than 2, it is determined that the data packets that meet the arbitration rule are successfully arbitrated, and it is determined that the other data packets fail to arbitrate. If the number is not less than 2, a data packet is selected from the data packets that meet the arbitration rule, for example, randomly selected. And it is determined that the data packet is successfully arbitrated, and it is determined that the other data packets fail to arbitrate. In this way, the routing arbitration efficiency can be improved to a certain extent, and the time consumption of the overall processing flow can be shortened.

[0069] Optionally, the preset arbitration rules may include a first arbitration rule, a second arbitration rule, and a third arbitration rule. The first arbitration rule may be the highest service level, the second arbitration rule may be the minimum number of routing times, and the third arbitration rule may be the highest priority in the source direction. The first arbitration rule has a higher priority than the second arbitration rule, and the second arbitration rule has a higher priority than the third arbitration rule.

[0070] Exemplarily, for the data packets that are in contention: the data packets to be sent and the competing data packets, arbitration is first performed in the service level dimension. If there is only one data packet with the highest service level, the data packet with the highest service level is preferentially routed to the current target direction. If there are at least two data packets with the same service level dimension, arbitration is performed in the routing number dimension. If there is only one data packet with the smallest routing number, the data packet with the smallest routing number is preferentially routed to the current target direction. If there are at least two data packets with the same service level dimension and the same routing number, arbitration is performed in the source direction dimension.

[0071] Specifically, for the first arbitration rule, when the first arbitration rule is used as the target rule, if the number of data packets that meet the target rule is not less than 2, it means that among the multiple data packets, the data packets to be sent and the competing data packets, there are at least two data packets with the same service level, and the service level is the highest among the multiple data packets. If the number of data packets that meet the target rule is less than 2, it means that there is no data packet with the highest service level in parallel among the multiple data packets, and there is only one data packet with the highest service level. The service level can be determined based on the (Qos field of the data packet. Specifically, the specific value of the Qos field can be used as the service level of the data packet.

[0072] Among them, the Qos field is a field of Filt specified in the CHI protocol. The larger the specific value of the Qos field is, the higher the service level corresponding to the data packet is, and the higher the priority of the service corresponding to the data packet is. Accordingly, the data packet has a higher priority in the arbitration of the service level. That is, the first arbitration rule is adopted. For the arbitration of the service level, for the data packets participating in the arbitration at this level, the higher the service level is, the higher the priority of the data packet is, and the data packet with the highest service level can be selected for sending. Accordingly, in the embodiment of the present invention, the first arbitration rule is set to have the highest rule priority, so that when routing competition occurs, the data packet with the highest service level can be sent as much as possible, thereby ensuring that the high-priority service can be processed in time, minimizing the delay of the high-priority service as much as possible, and improving the service quality.

[0073] For the second arbitration rule, when the second arbitration rule is used as the target rule, if the number of data packets that meet the target rule is not less than 2, it means that among the multiple data packets of the to-be-sent data packets and the competing data packets, there are at least two data packets with the same routing times, and the routing times are the smallest among these multiple data packets. If the number of data packets that meet the target rule is less than 2, it means that there are no parallel data packets with the smallest routing times among these multiple data packets, and there is only one data packet with the smallest routing times. The routing times can be calculated based on the own coordinates and the target coordinates. For example, the sum of the absolute values ​​of the differences between the own coordinates and the coordinate values ​​of the target coordinates in the data packet can be used as the current routing times of the data packet. For example, assuming that the own coordinates are (0, 0) and the target coordinates are (2, 3), the routing times are 5 times.

[0074] In specific implementation, the source routing node of the data packet can calculate the routing number based on its own coordinates and the target coordinates of the data packet. And maintain the routing number between routing nodes. Specifically, for other routing nodes other than the source routing node, when receiving the data packet, the routing number can be reduced by 1. Correspondingly, for other routing nodes, the current routing number of the data packet can be directly read. Among them, the routing number can be carried in the data packet, and as the data packet flows in the on-chip network. When the second arbitration rule is adopted, for the arbitration of the routing number level, for the data packets participating in the arbitration at this level, the fewer the routing number, the higher the priority of the data packet. By setting the second arbitration rule to the minimum routing number, the second arbitration rule can be adopted, and in the arbitration of the routing number level, the data packet with the minimum routing number can be selected for transmission. In this way, when the service level is the same, the routing number is further compared, so that the data packet with fewer routing numbers can be sent first, thereby ensuring that the data packet with the shortest remaining transmission path is given priority, thereby improving the transmission efficiency.

[0075] For the third arbitration rule, when the third arbitration rule is used as the target rule, if the number of data packets that meet the target rule is not less than 2, it means that among the multiple data packets of the to-be-sent data packets and the competing data packets, there are at least two data packets with the same source direction, and the source direction is the data packet with the highest priority among the multiple data packets. However, for the routing nodes in the MESH network, since the routing nodes receive data packets from each source direction at most at the same time, correspondingly, there are several source directions, and the routing nodes can receive several data packets at most at the same time. That is, the to-be-sent data packets and the competing data packets can include at most data packets received from each source direction at the same time, and correspondingly, the source directions of each data packet in the to-be-sent data packets and the competing data packets are different. Therefore, by setting the third arbitration rule as the highest priority for the source direction, the third arbitration rule can be prevented from being met by at least two data packets at the same time, and further by setting the priority of the first arbitration rule higher than the second arbitration rule, and the priority of the second arbitration rule higher than the third arbitration rule, it can be ensured that the data packets that can be sent along the target direction this time can be determined from the to-be-sent data packets and the competing data packets based on these multiple arbitration rules, thereby ensuring that routing arbitration can be achieved.

[0076] Among them, the source direction may include the routing direction configured by the routing node, that is, the optional routing method. The third arbitration rule may define the priority of the source direction, for example, east direction> south direction> west direction> north direction. Among them, the priority of the source direction can be pre-set according to actual needs, or the priority of the source direction can be set dynamically. For example, a higher priority is set for the source direction with less competition, so as to give priority to the direction with no competition or less competition. In this way, the routing path can be further optimized and the routing delay can be reduced to a certain extent.

[0077] In the embodiment of the present invention, when there is competition in the target direction, multi-level arbitration in the dimensions of service level, routing times and source direction is performed based on the first arbitration rule, the second arbitration rule and the third arbitration rule, which can effectively avoid path blocking, optimize routing selection and improve the transmission efficiency of data packets. Through the comprehensive evaluation of service level, routing times and source direction, dynamic selection can be performed to arbitrate data packets that can be sent along the target direction, reduce routing delays, and improve bus utilization and overall system performance.

[0078] Optionally, in some embodiments, the following steps may also be included:

[0079] Step S31, detecting the number of credits corresponding to the target direction; wherein the number of credits is used to characterize the ability of the routing node to send data packets in the target direction.

[0080] Correspondingly, the sending of the to-be-sent data packet to the adjacent node in the target direction may specifically include: sending the to-be-sent data packet to the adjacent node when the credit quantity is greater than a preset numerical threshold.

[0081] Specifically, the number of credits corresponding to the target direction may be the number of credits of the routing node in the target direction. In an embodiment of the present invention, a number of credits may be allocated in advance for each routing direction of the routing node. The more credits there are, the more data packets the routing node is allowed to send in the routing direction, and accordingly, the stronger the ability of the routing node to send data packets in the routing direction. Conversely, the fewer credits there are, the fewer data packets the routing node is allowed to send in the routing direction, and accordingly, the weaker the ability of the routing node to send data packets in the routing direction. Exemplarily, a flow control technology is added to each routing direction of each SXP node in the MESH network, that is, a number of credits is allocated in each routing direction. In this way, a credit quantity mechanism can be conveniently introduced to control the data packet transmission flow through the credit quantity, and ensure that the data packet flow in each routing direction is controlled. Each routing direction may be allocated the same number of credits, or a different number of credits may be allocated, and the embodiment of the present invention does not limit this.

[0082] Each routing node can maintain a parameter representing the number of credits for each routing direction. Accordingly, the specific value of the parameter representing the number of credits maintained for the target direction can be detected as the number of credits corresponding to the target direction. If the number of credits is greater than the preset numerical threshold, the number of data packets that the routing node is currently allowed to send in the target direction is sufficient, and the ability of the routing node to send data packets in the target direction is sufficient, so the operation of sending the data packet to be sent to the adjacent node can be performed. Among them, the preset numerical threshold can be set according to actual needs, for example, the preset numerical threshold can be 0, or the preset numerical threshold is 1, etc., and the embodiment of the present invention does not limit this. Taking the preset numerical threshold as 0 as an example, if the number of credits is not greater than the preset numerical threshold, it means that more data packets have been sent to the adjacent node, and the data packet cannot be sent to the adjacent node at present. In this way, the adjacent node will not receive the data packet, which can avoid the problem of data packets being blocked in the adjacent node to a certain extent, resulting in the problem that too many resources are consumed in the adjacent node to store the blocked data packets.

[0083] In the embodiment of the present invention, by detecting the number of credits corresponding to the target direction, the number of credits is used to characterize the ability of the routing node to send data packets in the target direction. The data packet to be sent is sent to the adjacent node only when the number of credits is greater than the preset numerical threshold. In this way, the flow between the routing node and the adjacent node in the target direction can be controlled to prevent the routing node from sending data packets to the adjacent node indiscriminately in the target direction, prevent network congestion, improve data packet transmission efficiency, and thus improve the overall transmission efficiency of the network, as well as improve system stability.

[0084] For example, for the aforementioned Figure 3 , Figure 3 Each SXP in the MESH network can dynamically determine the routing path for the data packet based on the Tgtid, QoS field, current routing times, and source direction to ensure that the data packet reaches the designated processing unit of the target routing node efficiently and reliably. Figure 3 In the example, SXP0 routes data packet A to the processing unit in the P0 direction of SXP10 with coordinates (2, 2) for explanation. SXP0 can first calculate the number of routes based on its own coordinates and the destination coordinates carried by Tgtid in data packet A. In this example, the number of routes from SXP0 to SXP10 is 4. In this example, the available routing directions of data packet A can include the east direction and the north direction. Since the priority of the X-axis direction is higher than that of the Y-axis direction, SXP0 can give priority to the east direction, that is, the east direction is first used as the target direction. If there is no data packet competition in the east direction, SXP0 performs the operation of sending data packet A to SXP1 when the credit value in the east direction is not 0. Accordingly, SXP1 can reduce the number of routes recorded by data packet A by 1, and the number of routes recorded by SXP1 is 3. Next, for SXP1, SXP1 can check the east direction, and if there is competition in the east direction, SXP1 arbitrates based on the preset arbitration rules. For example, it is assumed that data packet A has the highest QoS value among the data packets participating in arbitration, and there is no data packet with the same QoS value as data packet A among the data packets participating in arbitration. Then data packet A arbitrates successfully, and data packet A is sent preferentially in the east direction. If other data packets arbitrate successfully, that is, data packet A fails to arbitrate, the north direction is taken as the new target direction and the north direction is checked. If there is no competition in the north direction, SXP1 sends data packet A to SXP5 when the credit value in the north direction is not 0, and the number of routes recorded in data packet A is reduced by 1, and the number of routes recorded in SXP5 is 2.

[0085] For SXP5, SXP5 can check the east direction. If there is competition in the east direction, SXP5 will arbitrate based on the preset arbitration rules. Assume that data packet A has the highest QoS value among the data packets participating in the arbitration, but there is a data packet with the same QoS value as data packet A among the data packets participating in the arbitration. Then arbitration is further performed based on the number of routes. If the number of routes of data packet A is the least, SXP5 will send data packet A to SXP6 if the credit value in the east direction is not 0. Accordingly, SXP6 can reduce the number of routes of data packet A by 1.

[0086] For SXP6, SXP6 can send data packet A northward to SXP10. Exemplarily, the data packet A can be sent when the credit value in the north direction is not 0, or different credit values ​​can be controlled during the transmission between the routing node and the processing unit, which is not limited by the embodiment of the present invention. After arriving at SXP10, SXP10, as the target routing node of data packet A, can check the lowest bit Tgtid[0] of Tgtid of data packet A. If the bit is 0, data packet A is sent to the processing unit connected in the P0 direction. If the bit is 1, data packet A is sent to the processing unit connected in the P1 direction.

[0087] Optionally, in some embodiments, the following steps may also be included:

[0088] Step S41: For any routing direction, when a data packet is sent along the routing direction, the number of credits corresponding to the routing direction is reduced by a preset value.

[0089] Step S42: After the data packet sent along the routing direction is processed by the receiving party, the credit quantity corresponding to the routing direction is increased by the preset value.

[0090] In an embodiment of the present invention, a credit number is maintained for each routing direction, and a credit value mechanism may be used to control traffic in each routing direction. Specifically, when a data packet is sent using the routing direction, the credit number may be consumed, that is, the credit number corresponding to the routing direction may be reduced by a preset value. After the data packet sent along the routing direction is processed by the receiving party, the credit number is returned, that is, the credit number corresponding to the routing direction may be increased by a preset value. The preset value may be pre-set, for example, the preset value may be 1.

[0091] During specific implementation, the receiver of the data packet sent along the routing direction may be an adjacent node in the routing direction. Accordingly, the data packet being processed by the receiver may refer to the data packet being sent by the adjacent node. Alternatively, the receiver may also be a processing unit in the routing direction. Accordingly, the data packet being processed by the receiver may refer to: the data packet being processed by the processing unit. Exemplarily, the receiver may return a specified signal after completing the processing. Accordingly, when the specified signal is received, it may be determined that the data packet sent along the routing direction has been processed by the receiver. Therefore, the credit of the routing direction may be increased by one, thereby realizing the credit return. Alternatively, it is also possible to wait for the default time length before the default data packet is processed by the receiver, and accordingly, the credit of the routing direction may be increased by one.

[0092] In the embodiment of the present invention, when managing credit, when a data packet is sent along the routing direction, the number of credits corresponding to the routing direction is reduced by a preset value, and after the data packet sent along the routing direction is processed by the receiving party, the number of credits corresponding to the routing direction is increased by a preset value. In this way, by dynamically increasing and decreasing the number of credits, the flow of data packets in the on-chip network can be effectively managed, and to a certain extent, it can be ensured that each routing node has a sufficient number of credits in the entire process, and that each routing node has corresponding resources when sending data packets, and the orderliness and reliability of data packet transmission can be ensured, which can more effectively prevent network congestion and resource exhaustion. And the credit number is returned in time after the receiving party completes the processing of the data packet, which to a certain extent can maintain the stability and efficiency of the network, and ensure that each routing node in the on-chip network can efficiently and reliably transmit data.

[0093] Exemplarily, when sending a data packet to be sent to an adjacent node in a target direction, if the number of credits corresponding to the target direction is greater than a preset numerical threshold, the data packet to be sent can be directly sent to the adjacent node. If the number of credits corresponding to the target direction is not greater than the preset numerical threshold, the data packet can be sent after waiting for the number of credits corresponding to the target direction to be greater than the preset numerical threshold. For example, wait for the number of credits to be returned to the target direction, so that the number of credits corresponding to the target direction is greater than the preset numerical threshold.

[0094] Optionally, in some embodiments, when the receiver receives the data packet, the number of credits corresponding to the routing direction of the receiver is increased by the preset value; after the data packet is processed by the receiver, the number of credits corresponding to the routing direction of the receiver is reduced by the preset value. In the embodiment of the present invention, the receiver may be other routing nodes in the network, that is, in the embodiment of the present invention, each routing node may increase the number of credits corresponding to the routing direction of the received data packet by a preset value when receiving the data packet. After completing the processing of the data packet, the number of credits corresponding to the routing direction of the received data packet is subtracted by a preset value, and accordingly, the routing node that sent the data packet increases the number of credits corresponding to the routing direction by a preset value, that is, after the receiver completes the processing of the data packet, 1 credit is returned.

[0095] Taking the preset value equal to 1 as an example, in the embodiment of the present invention, a credit count can be maintained for each routing direction. For any routing direction, when a data packet is sent using the routing direction, 1 credit is consumed. When a data packet is received using the routing direction, 1 credit is added. When the received data packet is successfully forwarded, 1 credit is returned to the node that sent the data packet, that is, the number of credits in the routing direction is reduced by 1, and the number of credits of the sending node in the routing direction is increased by 1. In this way, the number of credits of the receiving party in the routing direction can be increased accordingly during the process of the receiving party processing the data packet. To a certain extent, the number of credits can reflect the receiving capacity in the routing direction, ensure the accuracy of the number of credits, and ensure that the receiving party has sufficient number of credits. It should be noted that in the embodiment of the present invention, each routing node can also detect the number of credits corresponding to the receiving party and the target direction used for this transmission before sending, and send when the number of credits of the receiving party does not exceed the preset upper limit, so as to avoid the problem of data packet congestion in the target direction of the receiving party to a greater extent.

[0096] For example, Figure 3SXP0 and SXP1 in FIG. 1 are used to illustrate. The east direction of SXP0 is connected to the west direction of SXP1. When SXP0 sends a data packet to SXP1, the east direction of SXP0 will consume a credit, and the credit value of the east direction of SXP0 will decrease by 1. At the same time, when the west direction of SXP1 receives the data packet, the credit value of the west direction increases by 1. Accordingly, SXP1 now holds the data packet and performs corresponding processing. When SXP1 processes the data packet and is ready to send it to the next node, it can use a certain routing direction of SXP1 to forward the data packet, and this operation will consume the credit of SXP1 in the routing direction. After sending using the routing direction, the credit value of the routing direction used by SXP1 decreases by 1. Furthermore, after SXP1 successfully sends the data packet, it can return a credit to the east direction of SXP0 through the west direction. In this way, the credit number of SXP0 increases by 1, that is, the credit number of SXP0 is restored to the original value before sending the data packet, and SXP0 can prepare for the next data transmission.

[0097] Optionally, in some embodiments, the following steps may also be included:

[0098] Step S51: in the initialization phase of the on-chip network, obtaining an initial credit value pre-configured for each routing direction.

[0099] Step S52: After the initialization phase is completed, the credit quantity corresponding to each routing direction is set to the initial credit value corresponding to each routing direction.

[0100] In the embodiment of the present invention, the initial credit value may be pre-set according to actual needs, and the embodiment of the present invention does not limit this. For example, based on the estimated value of the data packets that the routing node needs to transmit in the network, an experience value is generated, and the initial credit value is set based on the experience value. Specifically, the initial credit value may be pre-configured for each routing direction of each routing node in the on-chip network. Exemplarily, the initial credit value corresponding to the routing node in each routing direction may be stored in each routing node. Accordingly, the pre-stored initial credit value corresponding to each routing direction may be read. Then, after the initialization link is completed, that is, after the system is initialized, the credit quantity corresponding to each routing direction is set to the initial credit value corresponding to each routing direction. Alternatively, each routing node, as a receiver, may store the initial credit value of each routing direction, and the initial credit value of each routing direction of the routing node may be used as the initial credit value of the routing node of the sender corresponding to each routing direction. For the routing node as the sender, the initial credit value may be set to the credit quantity corresponding to the routing direction, which is equivalent to the receiver sending all credits to the sender after the system is initialized. For a certain routing direction, as data packets are sent, the number of credits corresponding to the routing direction may fluctuate in the range of [0, the initial credit value corresponding to the routing direction].

[0101] In an embodiment of the present invention, by first obtaining the initial credit value corresponding to each routing direction, and then setting the corresponding credit quantity for each routing direction according to the initial credit value after completing the initialization, it is possible to avoid the routing node from sending data packets during the initialization phase, thereby ensuring the operational efficiency of the initialization operation.

[0102] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0103] Device Embodiment

[0104] Reference Figure 4 , shows a structural block diagram of a data packet sending device of the present invention, and the system may specifically include:

[0105] The first selection module 201 is used to select a target direction from available routing directions of any data packet to be sent according to a preset direction priority;

[0106] A first sending module 202, configured to send the data packet to be sent to the adjacent nodes in the target direction when there is no competing data packet to be sent in the target direction;

[0107] The arbitration module 203 is used to perform routing arbitration on the to-be-sent data packets and the competing data packets based on a preset arbitration rule when there are competing data packets to be sent in the target direction;

[0108] The second selection module 204 is used to reselect a target direction from the remaining available routing directions according to the direction priority when the arbitration result of the data packet to be sent is arbitration failure, so as to send the data packet to be sent based on the reselected target direction.

[0109] Optionally, the device further comprises:

[0110] A second sending module is used to send the data packet to be sent to the adjacent node in the target direction when the arbitration result of the data packet to be sent is successful arbitration;

[0111] The second selection module 204 is specifically configured to:

[0112] According to the direction priority, selecting an available routing direction with the highest priority from the remaining available routing directions as a new target direction;

[0113] Re-entering the step of performing routing arbitration on the data packets to be sent and the competing data packets based on preset arbitration rules when there are competing data packets to be sent in the target direction.

[0114] Optionally, the device further comprises:

[0115] A first detection module, used to detect the number of arbitration failures corresponding to the data packet to be sent;

[0116] A third sending module is used to send the to-be-sent data packet to the adjacent node in the target direction if the competing data packet exists in the target direction and the number of arbitration failures is not less than a preset number threshold;

[0117] The arbitration module 203 is specifically used for:

[0118] When the number of arbitration failures is less than the preset number threshold, routing arbitration is performed on the to-be-sent data packet and the competing data packet based on a preset arbitration rule.

[0119] Optionally, the arbitration result includes arbitration success and arbitration failure; the arbitration module 203 is specifically used to:

[0120] Selecting a rule from the preset arbitration rules as the target rule according to the order of rule priority from high to low;

[0121] Determine the number of data packets that meet the target rule among the data packets to be sent and the competing data packets;

[0122] If the number is less than 2, then determining that the data packets that meet the target rule have been successfully arbitrated, and determining that the other data packets have failed to arbitrate;

[0123] If the number is not less than 2, a rule is reselected from the remaining preset arbitration rules as a new target rule according to the selection order, and the step of determining the number of data packets that meet the target rule in the to-be-sent data packets and the competing data packets is entered.

[0124] Optionally, the preset arbitration rules include first arbitration rules, second arbitration rules and third arbitration rules;

[0125] Among them, the first arbitration rule is the highest business level;

[0126] The second arbitration rule is that the number of routing times is minimum;

[0127] The third arbitration rule is that the source direction has the highest priority;

[0128] The first arbitration rule has a higher priority than the second arbitration rule, and the second arbitration rule has a higher priority than the third arbitration rule.

[0129] Optionally, the device further comprises:

[0130] A second detection module, configured to detect the number of credits corresponding to the target direction; wherein the number of credits is used to characterize the ability of the routing node to send data packets in the target direction;

[0131] The first sending module 202 is specifically configured to send the to-be-sent data packet to the adjacent node when the credit quantity is greater than a preset numerical threshold.

[0132] Optionally, the device further comprises:

[0133] A reduction module, for reducing the number of credits corresponding to any routing direction by a preset value when a data packet is sent along the routing direction;

[0134] The increasing module is used to increase the credit quantity corresponding to the routing direction by the preset value after the data packet sent along the routing direction is processed by the receiving party.

[0135] Optionally, when the receiving party receives the data packet, the number of credits of the receiving party corresponding to the routing direction is increased by the preset value;

[0136] After the data packet is processed by the receiver, the number of credits of the receiver corresponding to the routing direction is reduced by the preset value.

[0137] Optionally, the device further comprises:

[0138] An acquisition module, used for acquiring an initial credit value pre-configured for each routing direction during the initialization phase of the on-chip network;

[0139] The setting module is used to set the credit quantity corresponding to each routing direction as the initial credit value corresponding to each routing direction after the initialization phase is completed.

[0140] In summary, in a data packet sending device provided by an embodiment of the present invention, for any data packet to be sent, the routing node selects a target direction from the available routing directions of the data packet to be sent according to a preset direction priority. In the case where there is no competing data packet to be sent in the target direction, the data packet to be sent is sent to the adjacent node in the target direction. In the case where there is a competing data packet to be sent in the target direction, routing arbitration is performed on the data packet to be sent and the competing data packet based on a preset arbitration rule. In the case where the arbitration result of the data packet to be sent is arbitration failure, a target direction is reselected from the remaining available routing directions according to the direction priority to send the data packet to be sent based on the reselected target direction. Compared with the method of waiting in the case of competition in the target direction until the destination in the target direction is sent, and then sending along other directions, in the embodiment of the present invention, dynamic arbitration is performed in the case of competition in the target direction, and in the case of arbitration failure of the data packet to be sent, an available routing direction is replaced as the new target direction to send it based on the reselected target direction. In this way, it is possible to avoid the data packet being blocked in the routing node for a long time and reduce the data transmission delay in the entire network.

[0141] In the embodiment of the present invention, only when there is competition in the target direction, routing arbitration is performed on these data packets based on the preset arbitration rules. In this way, the execution frequency of routing arbitration can be reduced to a certain extent, thereby reducing the processing resources consumed.

[0142] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0143] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0144] Regarding the processor in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0145] Reference Figure 5 , is a structural block diagram of an electronic device for sending data packets provided by an embodiment of the present invention. Figure 5 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the data packet sending method of the aforementioned embodiment.

[0146] The processor may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other editable devices, transistor logic devices, hardware components or any combination thereof. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0147] The communication bus may include a path for transmitting information between the memory and the communication interface. The communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.

[0148] The memory may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0149] The embodiment of the present invention also provides a non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor can execute Figure 1 The packet sending method shown.

[0150] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0151] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0152] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0156] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0157] The above is a detailed introduction to a data packet sending method, device, electronic device and readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for a person skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for sending a data packet, characterized in that: Applied to any routing node in a network on chip, the method comprises: For any data packet to be sent, selecting a target direction from available routing directions of the data packet to be sent according to a preset direction priority; In the case where there is no competing data packet to be sent in the target direction, sending the data packet to be sent to the adjacent node in the target direction, where the competing data packet is other data packets that need to be sent in the current target direction; In the case where the competing data packet exists in the target direction, routing arbitration is performed on the data packet to be sent and the competing data packet based on a preset arbitration rule; In the case where the arbitration result of the data packet to be sent is arbitration failure, reselecting a target direction from the remaining available routing directions according to the direction priority to send the data packet to be sent based on the reselected target direction; The preset arbitration rules include the first arbitration rules, the second arbitration rules and the third arbitration rules; Among them, the first arbitration rule is the highest business level; The second arbitration rule is that the routing times are the smallest, and the sum of the absolute values ​​of the differences between the coordinates of the own coordinates and the target coordinates in the data packet is used as the current routing times of the data packet to ensure that the data packet with the shortest remaining transmission path is given priority; The third arbitration rule is that the source direction has the highest priority, and the source direction includes: the source direction of the data packet configured by the routing node, and the source direction of the data packet with less competition is set with a higher priority; The first arbitration rule has a higher priority than the second arbitration rule, and the second arbitration rule has a higher priority than the third arbitration rule.

2. The method according to claim 1, characterized in that The method further comprises: When the arbitration result of the data packet to be sent is successful, sending the data packet to be sent to the adjacent nodes in the target direction; The step of reselecting a target direction from the remaining available routing directions according to the direction priority, so as to send the data packet to be sent based on the reselected target direction, comprises: According to the direction priority, selecting an available routing direction with the highest priority from the remaining available routing directions as a new target direction; Re-entering the step of performing routing arbitration on the data packets to be sent and the competing data packets based on preset arbitration rules when there are competing data packets to be sent in the target direction.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Detecting the number of arbitration failures corresponding to the data packet to be sent; In the case where the competing data packet exists in the target direction, if the number of arbitration failures is not less than a preset number threshold, sending the to-be-sent data packet to the adjacent node in the target direction; The performing routing arbitration on the to-be-sent data packet and the competing data packet based on a preset arbitration rule includes: When the number of arbitration failures is less than the preset number threshold, routing arbitration is performed on the to-be-sent data packet and the competing data packet based on a preset arbitration rule.

4. The method according to claim 1, characterized in that: The arbitration results include arbitration success and arbitration failure; The performing routing arbitration on the to-be-sent data packet and the competing data packet based on a preset arbitration rule includes: Selecting a rule from the preset arbitration rules as the target rule according to the order of rule priority from high to low; Determine the number of data packets that meet the target rule among the data packets to be sent and the competing data packets; If the number is less than 2, then determining that the data packets that meet the target rule have been successfully arbitrated, and determining that the other data packets have failed to arbitrate; If the number is not less than 2, a rule is reselected from the remaining preset arbitration rules as a new target rule according to the selection order, and the step of determining the number of data packets that meet the target rule in the to-be-sent data packets and the competing data packets is entered.

5. The method according to claim 1, characterized in that The method further comprises: Detecting the number of credits corresponding to the target direction; wherein the number of credits is used to characterize the ability of the routing node to send data packets in the target direction; The sending the data packet to be sent to the adjacent node in the target direction includes: sending the data packet to be sent to the adjacent node when the credit quantity is greater than a preset numerical threshold.

6. The method according to claim 5, characterized in that The method further comprises: For any routing direction, when a data packet is sent along the routing direction, the number of credits corresponding to the routing direction is reduced by a preset value; After the data packet sent along the routing direction is processed by the receiver, the credit quantity corresponding to the routing direction is increased by the preset value.

7. The method according to claim 5, characterized in that In the case where the receiving party receives the data packet, the number of credits of the receiving party corresponding to the routing direction is increased by a preset value; After the data packet is processed by the receiver, the number of credits of the receiver corresponding to the routing direction is reduced by the preset value.

8. The method according to any one of claims 5 to 7, characterized in that: The method further comprises: In the initialization phase of the network on chip, obtaining an initial credit value pre-configured for each routing direction; After the initialization phase is completed, the credit quantity corresponding to each of the routing directions is set as the initial credit value corresponding to each of the routing directions.

9. A data packet sending device, characterized in that: The device comprises: A first selection module, configured to select, for any data packet to be sent, a target direction from available routing directions of the data packet to be sent according to a preset direction priority; A first generating module is used to send the data packet to be sent to the adjacent nodes in the target direction when there is no competing data packet to be sent in the target direction, and the competing data packet is other data packets that need to be sent in the current target direction; An arbitration module, configured to perform routing arbitration on the data packets to be sent and the competing data packets based on preset arbitration rules when there are competing data packets to be sent in the target direction; A second selection module is used for reselecting a target direction from the remaining available routing directions according to the direction priority when the arbitration result of the data packet to be sent is arbitration failure, so as to send the data packet to be sent based on the reselected target direction; The preset arbitration rules include the first arbitration rules, the second arbitration rules and the third arbitration rules; Among them, the first arbitration rule is the highest business level; The second arbitration rule is to minimize the number of routing times, and the sum of the absolute values ​​of the differences between the coordinates of the own coordinates and the target coordinates in the data packet is used as the current routing number of the data packet to ensure that the data packet with the shortest remaining transmission path is given priority; The third arbitration rule is that the source direction has the highest priority, and the source direction includes: the source direction of the data packet configured by the routing node, and the source direction of the data packet with less competition is set with a higher priority; The first arbitration rule has a higher priority than the second arbitration rule, and the second arbitration rule has a higher priority than the third arbitration rule.

10. An electronic device, characterized in that: The electronic device includes a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the data packet sending method as described in any one of claims 1 to 8.

11. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the processor is enabled to execute the data packet sending method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Efficient data stream transmission communication structure suitable for on chip network and operating method thereof

    CN102158403A

  • Time-sensitive network control protocol design method based on MLVDS bus

    CN116094867A

  • Flow control method and device

    CN117793010A