Data Packet Sending Method, Device, Electronic Device and Readable Storage Medium

By selecting the appropriate channel to send data packets according to the channel status in the on-chip network, the delay problem caused by packet blockage is solved, and more efficient packet transmission is achieved.

CN118748654BActive Publication Date: 2025-06-20BEIJING INSTITUTE OF OPEN SOURCE CHIP
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In an on-chip network, packet blockage is prone to occur in the method of sending data packets based on the transmission channel, resulting in a large delay in data transmission.

Method used

By checking the status of the same type of channel in the target routing direction, if it is an idle state, it is determined as the target channel; if it is a non-idle state, other channels are selected as the target channel based on the status of other transmission channels, and data packets to be sent to adjacent nodes in the target routing direction are sent through the target channel.

Benefits of technology

By selecting other idle channels to send data packets when the same type of channel is in a non-idle state, the data packets to be sent can be sent as soon as possible, reducing the probability of packet blocking in the routing node, reducing packet transmission delay, and improving packet transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118748654B_ABST
    Figure CN118748654B_ABST
Patent Text Reader

Abstract

An 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 this method, for any data packet to be sent, if the channel state of the same-type channel in the target routing direction is the idle state, the same-type channel is determined as the target channel, and the same-type channel is a sending channel whose channel type matches the packet type of the data packet to be sent. If the channel state of the same-type channel is the non-idle state, based on the channel states of other sending channels in the target routing direction, other sending channels are selected as the target channels. Based on the target channel, the data packet to be sent is sent to the adjacent node in the target routing direction. In this way, the probability that the data packet is blocked at the routing node can be reduced, the data packet transmission delay can be reduced, the problem of system performance degradation caused by data packet blocking can be avoided, and the data packet transmission efficiency can be improved.
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 method, apparatus, electronic device, and readable storage medium for sending data packets. Background Art

[0002] Currently, in order to facilitate data transmission between processing units integrated in a system on a chip, the processing units are often connected through a network topology to form a network on a chip. The network on a chip may include multiple routing nodes, each routing node is connected to at least one processing unit, the routing nodes are connected to each other, and the routing nodes may be responsible for forwarding data packets generated by the processing units. Specifically, the routing node has multiple sending channels, and the routing node may forward the data packets generated by the processing unit based on the sending channels. In this way, after the data packets are sent by the routing nodes in the network on a chip, they can finally be sent to the destination processing unit indicated by the data packets.

[0003] In the related art, in the method of sending data packets based on the sending channels, there is a problem that data packet congestion is likely to occur, resulting in a large data transmission delay. Summary of the Invention

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

[0005] To solve the above problems, embodiments of the present invention disclose a method for sending data packets, the method includes:

[0006] For any data packet to be sent, if the channel state of the same-type channels in the target routing direction is an idle state, then determine the same-type channels as the target channels; the same-type channels are sending channels whose channel types match the packet types of the data packets to be sent;

[0007] If the channel state of the same-type channels is a non-idle state, then select other sending channels as the target channels based on the channel states of other sending channels in the target routing direction;

[0008] Send the data packet to be sent to the adjacent node in the target routing direction based on the target channels.

[0009] On the other hand, embodiments of the present invention disclose a data packet sending apparatus, the apparatus includes:

[0010] A first determination module, configured to, for any data packet to be sent, if the channel state of the same-type channels in the target routing direction is an idle state, then determine the same-type channels as the target channels; the same-type channels are sending channels whose channel types match the packet types of the data packets to be sent;

[0011] A selection module, configured to, if the channel state of the same-type channels is a non-idle state, select other sending channels as the target channel based on the channel states of other sending channels in the target routing direction;

[0012] A sending module, configured to send the packet to be sent to an adjacent node in the target routing direction based on the target channel.

[0013] In another aspect, an embodiment of the present invention further discloses an electronic device, which includes a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute the foregoing packet sending method.

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

[0015] The embodiments of the present invention have the following advantages: In the packet sending method provided by the embodiments of the present invention, for any packet to be sent, if the channel state of the same-type channels in the target routing direction is an idle state, the same-type channels are determined as the target channels, and the same-type channels are sending channels whose channel types match the packet types of the packets to be sent. If the channel state of the same-type channels is a non-idle state, other sending channels are selected as the target channels based on the channel states of other sending channels in the target routing direction. Based on the target channels, the packets to be sent are sent to adjacent nodes in the target routing direction. In this way, when the same-type channels are in a non-idle state, other sending channels are directly selected as the target channels based on the channel states of other sending channels in the target routing direction, and the packets to be sent are sent to adjacent nodes in the target routing direction through the target channels. To a certain extent, the packets to be sent can be sent out as soon as possible, the probability of the packets being blocked at the routing nodes is reduced, and to a certain extent, the packet transmission delay can be reduced, avoiding the problem of system performance degradation caused by packet blocking, and improving the packet transmission efficiency.

[0016] At the same time, by reusing other sending channels, the traffic between the sending channels can be more balanced to a certain extent, and the overall utilization rate of the sending channels can be improved, thereby improving the overall transmission efficiency. Further, by reusing other sending channels, the packets to be sent can continue to be sent in the target routing direction, and the operation of changing the target routing direction for the packets to be sent can be omitted, thereby saving processing resources to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0018] Figure 1 It is a schematic diagram of a transmission channel shown in an embodiment of the present invention;

[0019] Figure 2 It is a flowchart of the steps of an embodiment of a data packet sending method of the present invention;

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

[0021] Figure 4 It is a schematic diagram of the structure of a network-on-chip shown in an embodiment of the present invention;

[0022] Figure 5 It is a block diagram of the structure of a data packet sending device of the present invention;

[0023] Figure 6 It is a block diagram of the structure of an electronic device for data packet sending provided by an example of the present invention. Detailed implementation manners

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0025] The terms "first", "second", etc. in the description and claims of the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and do not limit the number of objects. For example, the first object can be one or more. In addition, the term "and / or" in the description 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 simultaneously, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. In the embodiments of the present invention, the term "a plurality of" means two or more, and other quantifiers are similar thereto.

[0026] The data packet sending method provided by the embodiments of the present invention can be applied to a network on chip. Currently, with the progress of semiconductor processes, more and more processing units are integrated in a system on chip (SoC). Among them, the processing unit can also be referred to as a peripheral, and the processing unit can include a processor core, a core of a graphics processor, a memory controller, a memory, and a dedicated function module, etc. The traditional bus structure cannot meet the large data transmission requirements. Therefore, the application of a network on chip (NoC) in SoC is becoming more and more widespread. The NoC interconnects each processing unit through a network topology, improving the data transmission bandwidth and parallel processing capabilities. In one implementation, when building a NoC for a multi-core processor system, the coherent hub interconnect (CHI) protocol can be used for building. Among them, the CHI protocol is designed for high-performance cache coherence, and it provides an efficient data transmission and coherence management mechanism. Since building a NoC using the CHI protocol has advantages such as cache coherence 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 the 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 a NoC based on the CHI protocol, the mesh topology structure (MESH) is used as an available network topology structure and has been widely used due to its regularity and scalability. Among them, the MESH structure is a multi-core interconnected topology structure, and each routing node in the MESH structure is connected to the surrounding routing nodes to form a mesh-like interconnected structure. The network on chip using the MESH structure can be called a MESH network. In the MESH network based on the CHI protocol, the routing node can follow the CHI protocol.

[0027] Specifically, each routing node in the MESH network is connected to adjacent routing nodes to form a mesh-like structure, and data is sent and received between the routing nodes and then sent to the destination routing node. Finally, the destination routing node can send the 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. Correspondingly, the MESH network in the embodiments of the present invention can be a 2D-MESH network or a 3D-MESH network. In the 2D-MESH network, the routing nodes are arranged in rows (X-axis dimension) and columns (Y-axis dimension), and each routing node is connected to the nodes adjacent to it above, below, left, and right. In the 3D-MESH network, the routing nodes are arranged in rows (X-axis dimension), columns (Y-axis dimension), and depth (Z-axis dimension), and each routing node is connected to the nodes adjacent to it above, below, left, right, front, and back.

[0028] In the MESH network based on the CHI protocol, a large amount of data interaction is often required between adjacent routing nodes. In one application scenario, the data packets transmitted in the MESH network can include: Request message data packets, Response message data packets, Data message data packets, and Snoop message data packets. For a routing node, the types of data packets to be transmitted can be divided into: Request type, Response type, Data type, and Snoop type. Correspondingly, on each routing direction of the routing node, transmission channels corresponding to these several packet types can be configured. Among them, the transmission channel can also be called a message channel. Specifically, the channel types of the transmission channel can be divided into: REQ type, RESP type, DATA type, and SNP type. Among them, the transmission channels of the REQ type, RESP type, DATA type, and SNP type, as the transmission channels in the CHI protocol, the packet types respectively corresponding to them can be: Request type, Response type, Data type, and Snoop type.

[0029] Further, the transmission channels of each channel type can be further divided into two types: transmit TX and receive RX according to the transmission type. That is, the transmit channels can include 4 types: REQ type, RESP type, DATA type, and SNP type, and the receive channels can also include 4 types: REQ type, RESP type, DATA type, and SNP type. There can be 8 channels between two adjacent routing nodes in the MESH network: TXREQ channel, TXRESP channel, TXDATA channel, TXSNP channel, RXREQ channel, RXRESP channel, RXDATA channel, and RXSNP channel. Among them, the TXREQ channel, TXRESP channel, TXDATA channel, and TXSNP channel can be referred to as the transmit channels of the routing node, and the RXREQ channel, RXRESP channel, RXDATA channel, and RXSNP channel can be referred to as the receive channels.

[0030] Exemplarily, Figure 1 is a schematic diagram of a transmission channel shown in an embodiment of the present invention. As Figure 1 shown, for the SXP on the left, there are 8 transmission channels in the east direction of the SXP on the left: TXREQ, TXRESP, TXSNP, TXDATA, RXREQ, RXRESP, RXSNP, and RXDATA. When sending data packets to the SXP on the right along the target routing direction with the east direction as the target routing direction for the SXP on the left, the transmit channels such as TXREQ, TXRESP, TXSNP, and TXDATA can be used for sending. The data packets received by the SXP on the left from the SXP on the right can be sent by the SXP on the right based on Figure 1 the receive channels such as RXREQ, RXRESP, RXSNP, and RXDATA. That is to say, for the SXP on the right, Figure 1 the TXREQ, TXRESP, TXSNP, and TXDATA shown in Figure 1 are the receive channels of the SXP on the right, and

[0031] Referring to Figure 2 , a flowchart of the steps of an embodiment of a data packet sending method of the present invention is shown. This method can be applied to any routing node in the on-chip network. The method can specifically include the following steps:

[0032] Step 101, for any data packet to be sent, if the channel state of the same type of channel in the target routing direction is in an idle state, then determine the same type of channel as the target channel; the same type of channel is a transmit channel whose channel type matches the packet type of the data packet to be sent.

[0033] Step 102: If the channel state of the same type of channel is in a non-idle state, then based on the channel states of other sending channels in the target routing direction, select other sending channels as the target channels.

[0034] Step 103: Based on the target channels, send the data packet to be sent to the adjacent node in the target routing direction.

[0035] In the embodiments of the present invention, a reference coordinate system can be pre-constructed in the on-chip network to determine a coordinate of each routing node in the on-chip network in this reference coordinate system. In the case where the on-chip network is a two-dimensional MESH network, the reference coordinate system can include the X-axis and the Y-axis. In the case where the on-chip network is a three-dimensional MESH network, the reference coordinate system can include the X-axis, the Y-axis, and the 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. Correspondingly, the coordinate of this routing node in this reference coordinate system is (0, 0). Correspondingly, for any coordinate axis, starting from the routing node at the origin, for any other routing node, which routing node the other routing node is in the direction of this coordinate axis, that is the value of this other routing node corresponding to this coordinate axis.

[0036] Exemplarily, taking the on-chip network as a two-dimensional MESH network as an example, Figure 3 is a schematic diagram of the connection directions of a routing node shown in the embodiments of the present invention. As Figure 3 shown, the routing node can include six routing directions: east (E), south (S), west (W), north (N), P0, and P1. Among them, routing can refer to the transmission process of a data packet from a source processing unit to a destination processing unit. The source processing unit can be the starting position of this data packet. For example, this data packet can be generated by the source processing unit. The destination processing unit can be the end position of this data packet, that is, finally, this data packet needs to be transmitted to the destination processing unit. The routing direction refers to the available data transmission directions during the transmission process of the data packet from the source processing unit to the destination processing unit.

[0037] Further, taking there being 16 routing nodes: SXP0 - SXP15, adopting a 4×4 MESH topology structure, each of the P0 and P1 directions of each routing node is connected to 1 processing unit, and the on-chip network includes processing units: RN-F, HN-F, RN-I, SN-F as an example. Figure 4It is a schematic structural diagram of a network-on-chip shown in an embodiment of the present invention. As Figure 4 shown, for SXP0 - SXP15 in this network, when there are adjacent routing nodes in the east, south, west, and north directions, they are all directly connected to the adjacent routing nodes in these directions. For example, the east direction of SXP0 is connected to the west direction of SXP1. The P0 direction and P1 direction of SXP0 are respectively connected to two peripherals, HN - F and RN - I. Further, assuming SXP0 is used as the origin, then the coordinate point of SXP0 in the reference coordinate system is (0, 0). The X - axis is established along the row direction in the network - on - chip, and the Y - axis is established along the column direction in the network - on - chip. SXP1 is the first routing node in the X - axis coordinate direction and the 0th routing node in the Y - axis coordinate direction, and 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). After the entire MESH network is built, the routing of data packets begins. Each SXP may receive data packets sent from peripherals or other SXPs, and the SXP can send the received data packets.

[0038] The routing node can determine the available routing direction that can be used this time for the data packet to be sent from the available data sending directions based on the coordinates of the destination routing node carried in the data packet to be sent (denoted as the target coordinates) and the own coordinates of this routing node. Among them, the destination routing node can be the routing node connected to the destination processing unit of the data packet to be sent, and the first specified bit value 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 stipulated in the CHI protocol, and the bit width of Tgtid can be 7bit. Among them, bits [6:5] represent the X coordinate, bits [4:3] represent the Y coordinate. Correspondingly, the first specified bits can be bits [6:5] and bits [4:3], that is, Tgtid[6:5] represents the X coordinate, and Tgtid[4:3] represents the Y coordinate.

[0039] The data packet to be sent can be a data packet whose destination routing node is not this routing node. Correspondingly, an available routing direction can be selected for the data packet to be sent from the directions connected to other routing nodes. Specifically, the target coordinates can be compared with its own coordinates to determine the direction that makes the data packet to be sent closer to the destination routing node as the available routing direction. Exemplarily, if the X coordinate value in the target coordinates is greater than the X coordinate value in its own coordinates, the east direction is selected; if the Y coordinate value in the target coordinates is greater than the Y coordinate value in its own coordinates, the north direction is selected; if the X coordinate value in the target coordinates is less than the X coordinate value in its own coordinates, the west direction is selected; if the Y coordinate value in the target coordinates is less than the Y coordinate value in its own coordinates, the south direction is selected. The target coordinates and its own coordinates may satisfy multiple of the above conditions. Therefore, the available routing direction can be multiple selected directions. For example, if both the X coordinate value and the Y coordinate value in the target coordinates are greater than the X coordinate value and the Y coordinate value in its own coordinates, the east direction and the north direction can be selected as the available routing directions. Or, if both the X coordinate value and the Y coordinate value in the target coordinates are less than the X coordinate value and the Y coordinate value in its own coordinates, the west direction and the south direction can be selected as the available routing directions. It can be understood that if there is an equality in a certain coordinate value between the target coordinates and its own coordinates, the available routing direction includes 1 direction. It should be noted that the direction in which the data packet to be sent is closer to the destination routing node may have a load exceeding the load threshold. In some implementation manners, in this case, a direction away from the destination routing node can also be selected as the available routing node, that is, a path with a lighter current load is dynamically selected to balance the load in the network and reduce the waiting time at the same time. Correspondingly, each time the target direction is selected, for the two available routing directions with the highest priority for the directions of the respective coordinate axes, the available routing direction closer to the destination routing node can be preferentially selected, and then the available routing direction away from the destination routing node can be selected.

[0040] Accordingly, the target routing direction can be the routing direction used this time selected from the available routing directions. The specific selection method can be set according to actual requirements. Exemplarily, an available routing direction can be randomly selected as the target routing direction. Or, selection can be made according to a preset selection rule. For example, selection can be made in the order of the priority of the coordinate axis directions from high to low. The embodiments of the present invention do not limit this. It should be noted that for a data packet whose destination routing node is this routing node, the routing node currently acting as the execution subject can extract the value of the second specified bit in the Tgtid of the data packet, and use the processing unit corresponding to the value of the second specified bit in the processing units connected to this routing node as the destination processing unit for this data packet. Send this data packet to the destination processing unit. Among them, the second specified 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 in 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 insufficient to represent coordinates or new information needs to be added.

[0041] Further, after determining the target routing direction, based on the packet type of the data packet to be sent, the channel state of the transmission channel matching the packet type on the target routing direction can be determined. That is, the channel state of the same type of channel is determined. Exemplarily, when the packet type of the data packet to be sent is of the Request type, the same type of channel can be the TXREQ channel. When the packet type of the data packet to be sent is of the Response type, the same type of channel can be the TXRESP channel. When the packet type of the data packet to be sent is of the Data type, the same type of channel can be the TXDATA channel. When the packet type of the data packet to be sent is of the Snoop type, the same type of channel can be the TXSNP channel.

[0042] If the channel status of this type of channel is the idle state, it indicates that currently, along the target routing direction, this type of channel can be used to send the data packet to be sent. Correspondingly, in this case, this type of channel can be determined as the target channel. On the contrary, if the channel status of this type of channel is the non-idle state, it can be determined that this type of channel is currently occupied by other data packets, and currently, this type of channel cannot be used to send the data packet to be sent along the target routing direction. In this case, the sending can be further performed based on other sending channels in the target routing direction. Specifically, the other sending channels can be all or part of the sending channels in the target routing direction except for the type of channel. Since other sending channels may be in the idle state when the type of channel is occupied. Therefore, based on the channel status of other sending channels, other sending channels can be selected as the target channel.

[0043] In the embodiments of the present invention, a routing node may receive multiple data packets from different routing directions at the same time. Correspondingly, among these multiple data packets, there may be data packets with the same target routing direction, and there may be competition in the target routing direction. That is to say, for any sending channel in the target routing direction, due to the existence of multiple data packets to be sent, a sending blockage may occur. In specific implementation, routing arbitration can be performed on these multiple data packets to be sent, and the data packet that succeeds in arbitration will obtain the right to use this sending channel this time. Among them, the specific arbitration method of routing arbitration can be set as needed, and the embodiments of the present invention do not limit this.

[0044] Correspondingly, the routing node can use this sending channel to send the data packet that succeeds in arbitration. In this case, for the data packet that fails in arbitration, its type of channel is occupied by the data packet that succeeds in arbitration, and its type of channel is in the non-idle state. Specifically, for the type of channel in the target routing direction, when the data packet to be sent fails in arbitration, it can be determined that the type of channel in the target routing direction is occupied by other data packets participating in routing arbitration together with this data packet to be sent, and then it can be determined that the type of channel in the target routing direction is in the non-idle state. On the contrary, when the data packet to be sent succeeds in arbitration, or when there are no competing data packets for the type of channel in the target routing direction, that is, when only this data packet to be sent needs to be sent through this type of channel at the current moment, it is determined that the channel status of this type of channel is the idle state.

[0045] Alternatively, in a scenario, the sending channel may also be occupied by a data packet received by the routing node before. For the current data packet to be sent, the same type of channel in the target routing direction may be occupied by other data packets received at a previous time. Accordingly, in the embodiments of the present invention, when the number of specified data packets corresponding to the same type of channel is greater than a preset number threshold, it is determined that the same type of channel is in a non-idle state. Otherwise, it is determined that the same type of channel is in an idle state. Wherein, the specified data packet may be a data packet whose sending priority corresponding to the same type of channel is higher than that of the data packet to be sent, and the preset number threshold can be set according to actual requirements. For example, the preset number threshold may be 1, or the preset number threshold may be 3. The embodiments of the present invention do not limit this.

[0046] Further, after determining the target channel, the data packet to be sent can be directly sent based on the target channel. Since the target channel is the sending channel connecting adjacent nodes in the target routing direction, sending using this target channel can achieve sending the data packet to be sent to the adjacent node in the target routing direction.

[0047] Compared with the method of only using a sending channel whose channel type matches the packet type of the data packet when sending the data packet. For example, for 4 types of data packets, namely Request type, Response type, Data type, and Snoop type, the respective matching sending channels: TXREQ, TXRESP, TXDATA, and TXSNP are used for sending. In this method, when the matching sending channel is occupied, it will keep waiting until it is sent using this sending channel. In this way, the data packet will be blocked in the routing node, resulting in a large delay in data packet transmission and low data packet transmission efficiency, and the performance of the entire system will decline.

[0048] In summary, in the data packet sending method provided by the embodiments of the present invention, for any data packet to be sent, if the channel state of the same-type channels in the target routing direction is the idle state, the same-type channels are determined as the target channels, and the same-type channels are sending channels whose channel types match the packet types of the data packets to be sent. If the channel state of the same-type channels is the non-idle state, based on the channel states of other sending channels in the target routing direction, other sending channels are selected as the target channels. Based on the target channels, the data packets to be sent are sent to the adjacent nodes in the target routing direction. In this way, when the same-type channels are in the non-idle state, by directly selecting other sending channels as the target channels based on the channel states of other sending channels in the target routing direction, and sending the data packets to be sent to the adjacent nodes in the target routing direction through the target channels, to a certain extent, the data packets to be sent can be sent out as soon as possible, the probability of data packets being blocked at the routing nodes is reduced, and thus to a certain extent, the data packet transmission delay can be reduced, the problem of system performance degradation caused by data packet blocking can be avoided, and the data packet transmission efficiency can be improved.

[0049] Meanwhile, by reusing other sending channels, to a certain extent, the traffic between the sending channels can be made more balanced, and the overall utilization rate of the sending channels can be improved, thereby improving the overall transmission efficiency. Further, by reusing other sending channels, the data packets to be sent can continue to be sent in the target routing direction, and the operation of changing the target routing direction for the data packets to be sent can be omitted, and thus to a certain extent, the processing resources can be saved.

[0050] Optionally, in some embodiments, the step of selecting other sending channels as the target channels based on the channel states of other sending channels in the target routing direction may specifically include:

[0051] Step 1021: Determine the channel bit widths of the other sending channels.

[0052] Step 1022: Determine the other sending channels with channel bit widths not less than the target bit width as the first candidate channels; the target bit width is the channel bit width of the same-type channels.

[0053] Step 1023: Select the target channels from the first candidate channels based on the channel states of the first candidate channels.

[0054] In the embodiments of the present invention, the channel widths of all other transmission channels can be determined based on a preset correspondence between transmission channels and channel widths. Exemplarily, for the four types of channels involved in data packet transmission between adjacent nodes, the widths of the transmission channels of different channel types are different. The preset correspondence between transmission channels and channel widths may include: TXDATA corresponds to [405:0], that is, the channel width of the TXDATA channel is 406 bits; TXREQ corresponds to [130:0], that is, the channel width of the TXREQ channel is 131 bits; TXSNP corresponds to [91:0], that is, the channel width of the TXSNP channel is 92 bits; TXRESP corresponds to [64:0], that is, the channel width of the TXRESP channel is 65 bits.

[0055] Assume that the packet type of the data packet to be sent is the Snoop type, and the same type of channel can be the TXSNP channel. Accordingly, the channel width of the TXSNP channel can be determined based on the correspondence between the transmission channel and the channel width as the target width. Exemplarily, the target width can be 92 bits. Further, based on the correspondence between the transmission channel and the channel width, the channel widths of the other transmission channels except the TXSNP channel can be determined, and the channel widths of the other transmission channels: the TXDATA channel, the TXREQ channel, and the TXRESP channel can be obtained: 406 bits, 131 bits, and 65 bits. Since 406 bits is not less than 92 bits and 131 bits is not less than 92 bits, the TXDATA channel and the TXREQ channel can be determined as the first candidate channels. Finally, the target channel can be selected from the TXDATA channel and the TXREQ channel based on the channel states of the TXDATA channel and the TXREQ channel. That is, in the embodiments of the present invention, when using an idle channel, the data packets of the low-width channel can use the high-width transmission channel, and the data packets of the high-width channel cannot use the low-width transmission channel. In this way, the probability that the data packets of the high-width channel are transmitted using the same type of channel can be increased, and thus, while ensuring the flexible use of channel resources, the priority transmission right of the high-width transmission channel can be guaranteed.

[0056] If the channel bit width of the sending channel used is less than the channel bit width of the same type of channel of the data packet to be sent, then when sending the data packet to be sent, it is necessary to unpack the data packet to be sent to adapt to the channel bit width of the sending channel used. In this way, the additional unpacking operation will cause resource waste and increase the sending delay of the data packet. In the embodiments of the present invention, by determining the channel bit width of each other sending channel, the other sending channels whose channel bit widths are not less than the channel bit width of the same type of channel are determined as the first candidate channels, and the target channel is selected from the first candidate channels. In this way, it can be ensured that the channel bit width of the finally selected target channel is not less than the channel bit width of the same type of channel of the data packet to be sent, avoiding the unpacking operation caused by the smaller channel bit width of the target channel, and avoiding the problems of wasting resources and increasing the sending delay, thereby reducing the delay in the routing process and improving the routing efficiency of the data packet.

[0057] Optionally, in some embodiments, the step of selecting the target channel from the first candidate channels based on the channel status of the first candidate channels may specifically include:

[0058] Step 1023a: Select one of the first candidate channels as the second candidate channel according to the selection order from the smallest to the largest channel bit width.

[0059] Step 1023b: Determine the channel status of the second candidate channel.

[0060] Step 1023c: If the channel status of the second candidate channel is the idle state, then determine the second candidate channel as the target channel.

[0061] Step 1023d: If the channel status of the second candidate channel is the non-idle state, then re-select one of the first candidate channels as the second candidate channel according to the selection order, and enter the step of determining the channel status of the second candidate channel.

[0062] Selecting the second candidate channel according to the selection order from the smallest to the largest channel bit width can make the first candidate channel with the smallest channel bit width in the first candidate channels be selected first. When the current second candidate channel is in the non-idle state, that is, when the current second candidate channel is occupied, a new second candidate channel can be re-selected from the first candidate channels. Specifically, a new second candidate channel can be selected from the remaining first candidate channels again according to the selection order from the smallest to the largest channel bit width. Correspondingly, when selecting again according to the selection order from the smallest to the largest channel bit width, the selected first candidate channel is the first candidate channel with the smallest channel bit width among the remaining first candidate channels. Among them, the remaining first candidate channels can be the first candidate channels that have not been selected in the current processing flow.

[0063] For any selected second candidate channel, when the second candidate channel is occupied, that is, there is a data packet being sent on the second candidate channel, it can be determined that the channel state of the second candidate channel is a non-idle state. Conversely, it can be determined that the channel state of the second candidate channel is an idle state. If the channel state of the second candidate channel is an idle state, it indicates that the second candidate channel is an idle channel. Therefore, the second candidate channel can be determined as the target channel to facilitate sending the data packet to be sent using the second candidate channel. If the channel state of the second candidate channel is not an idle state, it indicates that the second candidate channel is not an idle channel. Therefore, a new second candidate channel can be reselected and the process returns to step 1023b, and the subsequent operations are performed again starting from step 1023b. It should be noted that when there are no remaining first candidate channels, the next round of processing can be started, that is, return to step 101 and start executing the data packet sending method provided by the embodiment of the present invention again, or wait on the same type of channel until the right to use the same type of channel is obtained, and determine the same type of channel as the target channel.

[0064] In the embodiment of the present invention, a first candidate channel is first selected as the second candidate channel, and the channel state of the second candidate channel is determined. When the channel state of the second candidate channel is an idle state, the second candidate channel is used as the target channel, and no new second candidate channel is selected. When the channel state of the second candidate channel is a non-idle state, a first candidate channel is reselected as the new second candidate channel, and the subsequent operations are performed again. In this way, while realizing the selection of the target channel, unnecessary operations can be avoided, thereby saving processing resources and efficiently realizing channel selection.

[0065] Moreover, in the embodiment of the present invention, the selection is performed in the order of increasing channel bit width, so that the first candidate channel with a smaller channel bit width is preferentially selected. Furthermore, while ensuring that the channel bit width of the finally selected target channel is not less than the target bit width, the problem of excessive channel bit width of the selected target channel and wasting transmission resources can be avoided.

[0066] Optionally, when the routing node is the starting routing node of the data packet to be sent, the embodiment of the present invention may further include:

[0067] Step S21: Based on the channel type of the receiving channel that receives the data packet to be sent, determine the packet type of the data packet to be sent as the target packet type; the starting routing node is the routing node connected to the source processing unit of the data packet to be sent.

[0068] Step S22: Set the type flag bit in the data packet to be sent to a value used to represent the target packet type.

[0069] Step S23: Determine the sending channel whose channel type matches the target packet type as the same-type channel, and determine the channel status of the same-type channel.

[0070] In the embodiment of the present invention, specifically, the above steps S21 - S23 may be executed before the above step 101. For the sender of the packet to be sent, the receiving channel of the current routing node for receiving the packet to be sent is a sending channel of the sender. Correspondingly, the channel type of this receiving channel may be of the RESP type, SNP type, REQ type, or DATA type. When the routing node is the starting routing node for the packet to be sent, the packet to be sent may be sent by a certain processing unit connected to the routing node. Specifically, the processing unit that sends the packet to be sent is the source processing unit of the packet to be sent, and the packet to be sent may be generated by the source processing unit.

[0071] Since when a processing unit transmits a packet to a routing node, according to the transmission protocol, a sending channel that matches the packet type of the packet to be sent is used for transmission. Therefore, for the starting routing node, the packet type corresponding to the channel type of the receiving channel for receiving the packet to be sent is the type of the packet to be sent. Correspondingly, the starting routing node can detect the channel type of the receiving channel of the packet to be sent, and use the packet type corresponding to the channel type of the receiving channel as the target packet type. For example, when the channel type of the receiving channel is of the REQ type, determine that the target packet type is the Request type; when the channel type of the receiving channel is of the SNP type, determine that the target packet type is the Snoop type; when the channel type of the receiving channel is of the RESP type, determine that the target packet type is the Response type; when the channel type of the receiving channel is of the DATA type, determine that the target packet type is the Data type.

[0072] Further, in the embodiments of the present invention, when routing nodes send data packets to be sent, they will share channels. That is, when the same type of channel for the data packet to be sent is in a non-idle state, other types of sending channels will be used for sending. That is to say, the routing nodes of the network-on-chip may not use the same type of channel to send the data packet to be sent. Therefore, a type flag bit can be added to the data packet to be sent so that the routing nodes participating in the transmission can know the packet type of the data packet to be sent. Among them, the type flag bit can be used to represent the packet type of the data packet. Different values of the type flag bit can represent different packet types. Taking the type flag bit as two bits as an example, when the value of the type flag bit is 2'b11, it can represent that the packet type is Request type. When the value of the type flag bit is 2'b10, it can represent that the packet type is Response type. When the value of the type flag bit is 2'b01, it can represent that the packet type is Snoop type. When the value of the type flag bit is 2'b00, it can represent that the packet type is Data type.

[0073] The starting routing node can also, after determining the target packet type, use the sending channel whose packet type corresponding to the channel type in the target routing direction is the target packet type as the same type of channel for the data packet to be sent, and determine the channel state of this same type of channel. For example, detect whether the same type of channel in the target routing direction is occupied. If it is occupied, it is determined that the channel state of this same type of channel is non-idle, otherwise, it can be determined that the channel state of this same type of channel is idle. It should be noted that the execution order between the above step S22 and step S23 is not unique. These two steps can be executed simultaneously or successively. For example, step S23 is executed first and then step S22. The embodiments of the present invention do not limit this.

[0074] In the embodiments of the present invention, when the routing node is the starting routing node of the data packet to be sent, based on the channel type of the receiving channel for receiving the data packet to be sent, determine the packet type of the data packet to be sent as the target packet type. And set the type flag bit of the data packet to be sent to the value used to represent the target packet type. This enables subsequent other routing nodes to conveniently determine the packet type of the data packet to be sent based on this type flag bit, thereby improving the processing efficiency of other routing nodes.

[0075] Optionally, when the routing node is the intermediate routing node of the data packet to be sent, the embodiments of the present invention may further include:

[0076] Step S31: Based on the type flag bit of the data packet to be sent, determine the packet type of the data packet to be sent as the target packet type; the type flag bit is set for the data packet to be sent by the starting routing node of the data packet to be sent;

[0077] Step S32: Determine the sending channel whose channel type matches the target packet type as the same-type channel, and determine the channel status of the same-type channel.

[0078] In the embodiment of the present invention, specifically, the above steps S31 - S32 may be executed before the above step 101. Specifically, the specific value of the type flag bit of the data packet to be sent can be extracted. Based on the preset correspondence between the value of the type flag bit and the packet type, the packet type corresponding to this specific value is searched for as the target packet type. Exemplarily, the preset correspondence between the value of the type flag bit and the packet type may include: 2’b11 corresponds to the Request type, 2’b10 corresponds to the Response type, 2’b01 corresponds to the Snoop type, and 2’b00 corresponds to the Data type. After determining the target packet type, the intermediate routing node may use the sending channel whose packet type corresponding to the channel type in the target routing direction is the target packet type as the same-type channel for the data packet to be sent, and determine the channel status of the same-type channel.

[0079] When the routing node is the intermediate routing node of the data packet to be sent, the intermediate routing node may receive the data packet to be sent through a non-same-type channel, that is, the sender of the data packet to be sent may use other sending channels as the target channel to send the data packet to be sent to this intermediate routing node. Therefore, the intermediate routing node cannot determine the packet type of the data packet to be sent based on the type of the receiving channel. In the embodiment of the present invention, the data packet to be sent includes a type flag bit set by the starting routing node for the data packet to be sent. In this way, the intermediate routing node determines the packet type of the data packet to be sent based on this type flag bit as the target packet type. Based on this target packet type, the same-type channel of the data packet to be sent is determined, and the channel status of the same-type channel is determined. It can ensure that the same-type channel for the data packet to be sent can be accurately determined, thereby ensuring that subsequent operations can proceed normally.

[0080] Optionally, in some embodiments, the data packet to be sent includes a channel flag bit, and the channel flag bit is used to indicate whether the specified receiving channel matches the packet type of the data packet to be sent, and the specified receiving channel is the receiving channel through which the routing node receives the data packet to be sent.

[0081] Correspondingly, the embodiment of the present invention may further include: Step S41: If the channel flag bit is the first preset value, then determine the sending channel with the same channel type as the specified receiving channel as the same-type channel, and determine the channel status of the same-type channel; the first preset value is a value indicating a match.

[0082] The step of determining the type of the data packet to be sent based on the type flag bit of the data packet to be sent may specifically include: Step S311, if the channel flag bit is a second preset value, determine the type of the data packet to be sent based on the type flag bit of the data packet to be sent; the second preset value is a value representing non - matching.

[0083] In an embodiment of the present invention, the channel flag bit may be a flag bit added to the data packet to be sent in advance. Exemplarily, the channel flag bit may be added to the data packet to be sent by the starting routing node of the data packet to be sent. By adding the channel flag bit, when the data packet to be sent circulates between routing nodes, the routing node can conveniently determine the channel usage of the data packet to be sent. Among them, the value of the channel flag bit may include two types: a first preset value and a second preset value. The first preset value may be used to represent that the data packet is transmitted based on the same - type channel, that is, it represents that the designated receiving channel matches the type of the data packet to be sent, that is, the channel type of the designated receiving channel matches the packet type of the data packet to be sent. The second preset value may be used to represent that the data packet is transmitted based on a non - same - type channel, that is, it represents that the designated receiving channel does not match the type of the data packet to be sent, that is, the channel type of the designated receiving channel does not match the packet type of the data packet to be sent. Specifically, if the channel flag bit of the data packet to be sent is the first preset value, it means that the sender of the data packet to be sent uses the same - type channel of the data packet to be sent to send it to the current intermediate routing node, that is, the channel type of the designated receiving channel is the corresponding matching channel type of the data packet to be sent, and the data packet to be sent is data that conforms to the channel type of the receiving channel. Therefore, when the channel flag bit of the data packet to be sent is the first preset value, the sending channel with the same channel type as the designated receiving channel can be directly determined as the same - type channel of the data packet to be sent, and the channel state of the same - type channel of the data packet to be sent can be determined.

[0084] If the channel flag bit of the data packet to be sent is the second preset value, it indicates that the sender of the data packet to be sent uses a non - same - type channel to send to the current intermediate routing node, that is, the channel type of the specified receiving channel is not the matching channel type corresponding to the data packet to be sent. The data packet to be sent is data of a shared channel and does not conform to the channel type of the receiving channel. Therefore, when the channel flag bit of the data packet to be sent is the second preset value, the packet type of the data packet to be sent can be further determined based on the type flag bit of the data packet to be sent. Compared with the method of directly reading the type flag bit each time and determining the packet type of the data packet to be sent based on the type flag bit, in the embodiments of the present invention, the operation of determining the packet type of the data packet to be sent based on the type flag bit of the data packet to be sent is only performed when the channel flag bit is the second preset value. In this way, to a certain extent, processing resources can be saved and processing efficiency can be improved.

[0085] Optionally, in some embodiments, before the step of sending the data packet to be sent to the adjacent node in the target routing direction based on the target channel, the following steps may further be included:

[0086] Step S51: When the target channel is the same - type channel, set the channel flag bit to the first preset value.

[0087] Step S52: When the target channel is the other sending channel, set the channel flag bit to the second preset value.

[0088] In the embodiments of the present invention, if the target channel currently adopted by the current routing node is the same - type channel of the data packet to be sent, the channel flag bit can be set to the first preset value. Specifically, if the current value of the channel flag bit is itself the first preset value, the channel flag bit can be left unchanged to achieve setting the channel flag bit to the first preset value. On the contrary, if the current value of the channel flag bit is itself the second preset value, a modification operation can be performed to achieve setting the channel flag bit to the first preset value. If the target channel currently adopted by the current routing node is the other sending channel, that is, not the same - type channel of the data packet to be sent, the channel flag bit can be set to the second preset value. Specifically, if the current value of the channel flag bit is itself the second preset value, the channel flag bit can be left unchanged to achieve setting the channel flag bit to the second preset value. On the contrary, if the current value of the channel flag bit is itself the first preset value, a modification operation can be performed to achieve setting the channel flag bit to the second preset value. Among them, the specific values of the first preset value and the second preset value can be set according to actual situations. For example, 0 can be used as the first preset value and 1 can be used as the second preset value, or 1 can be used as the first preset value and 0 can be used as the second preset value. The embodiments of the present invention do not limit this.

[0089] In an embodiment of the present invention, after a routing node determines a target channel and before sending a data packet to be sent to an adjacent node in the target routing direction based on the target channel, when the target channel is a same-type channel, the channel flag bit is set to a first preset value. When the target channel is another sending channel, the channel flag bit is set to a second preset value. In this way, by dynamically maintaining the channel flag bit, the channel flag bit can accurately represent whether the used sending channel matches the packet type of the data packet to be sent, thereby facilitating subsequent processing by the routing node.

[0090] In an embodiment of the present invention, taking the channel flag bit including 1 bit and the type flag bit including 2 bits as an example, when transmitting data packets between routing nodes, 3 flag bits can be added to each data packet: flag bit 0, flag bit 1, and flag bit 2. Among them, the first bit (flag bit 0) can be used as the channel flag bit, and the second and third bits (flag bit 1 and flag bit 2) can represent the type flag bit. Optionally, in some embodiments, the channel flag bit and the type flag bit in the data packet to be sent can be cleared before the data packet to be sent is sent by the destination routing node to the destination processing unit. In this way, by clearing the channel flag bit and the type flag bit, the data packet to be sent finally received by the destination processing unit does not include the channel flag bit and the type flag bit, and the data packet to be sent can include unnecessary information, thereby improving the transmission efficiency.

[0091] In an embodiment of the present invention, during the transmission between the routing node and the processing unit, only the same-type channels of the data packet can be used for transmission to ensure that the data transmission complies with the original protocol specification. In this way, there is no need to modify the protocol between the routing node and the processing unit, ensuring that the processing unit can normally process in the manner specified by the protocol. Specifically, when the data packet to be sent is sent to the destination routing node, the destination routing node can clear the channel flag bit and the type flag bit in the data packet to be sent. Exemplarily, when the destination routing node of the data packet to be sent is the current routing node, the current routing node can execute: if the channel flag bit is the first preset value, use a sending channel with the same channel type as the specified receiving channel to directly send the data packet to be sent to the destination processing unit; if the channel flag bit is the second preset value, determine the packet type of the data packet to be sent as the target packet type based on the type flag bit of the data packet to be sent; use a sending channel with a channel type matching the target packet type to send the data packet to be sent to the destination processing unit. Correspondingly, when the destination routing node of the data packet to be sent is not the current routing node, the current routing node can start executing from the above step 101.

[0092] The following is an illustration with an example. TakingFigure 4 Take the example that the peripheral HN-F of SXP0 in Figure 4 sends the data packet A to the peripheral RN-F of SXP5. Assume that the packet type of the data packet A is the Snoop type. Correspondingly, the sending channel whose channel type matches the packet type of the data packet A is the TXSNP channel. The peripheral HN-F of SXP0 can send the data packet A to SXP0 based on the TXSNP channel between SXP0. After SXP0 receives the data packet A, it can determine the target routing direction of the data packet A based on the preset routing algorithm. Assume that the determined target routing direction is the north direction. Then, the TXSNP channel in the north direction of SXP0 can be determined as the same type channel of the data packet A.

[0093]

[0094]

[0095] If there are other data packets in SXP0 that need to use the TXSNP channel in the north direction in addition to the data packet A, then arbitration can be performed on these data packets. The data packets that succeed in arbitration can obtain the right to use the TXSNP channel in the north direction this time. Assume that the data packet A fails in arbitration. Then, the channel state of the same type channel of the data packet A will be in a non-idle state. At this time, the same type channel of the data packet A cannot be used as the target channel. Therefore, other sending channels with a channel width not less than that of the TXSNP channel can be selected: the TXDATA channel and the TXREQ channel. Specifically, since the channel width of the TXREQ channel is smaller, the channel state of the TXREQ channel can be determined first. If the TXREQ channel in the north direction is in an idle state, the TXREQ channel in the north direction is used as the target channel. If the TXREQ channel in the north direction is in a non-idle state, the channel state of the TXDATA channel in the north direction is further determined. Take the example that the TXREQ channel in the north direction is in an idle state. SXP0 can use the TXREQ channel in the north direction to send the data packet A to SXP4. At the same time, before sending, a type flag bit = 2'b01 and a channel flag bit = 1 can be set for the data packet A to indicate that the used sending channel is not the same type channel of the data packet A, and the Snoop type data packet A is temporarily transmitted in the TXREQ type channel. Among them, in this example, 0 is used to indicate sending using the same type channel, and 1 is used to indicate transmission using a non-same type channel.After SXP4 receives data packet A, it can determine the target routing direction based on its own coordinates and the target coordinates of data packet A. Exemplarily, the target routing direction determined by SXP4 can be the east direction. Since the channel flag bit in data packet A is 1 at this time, SXP4 can determine the same-type channel matching data packet A based on the type flag bit in data packet A. Exemplarily, it can be determined that the same-type channel matching data packet A is the TXSNP channel. Accordingly, if the TXSNP channel in the east direction is idle, the TXSNP channel can be used as the target channel to transfer data packet A to the TXSNP channel. At this time, the channel flag bit is modified to 0, and the type flag bit remains unchanged. Finally, data packet A can be sent to SXP5 through the TXSNP channel in the east direction.

[0096] If the TXSNP channel in the east direction is not idle, the channel status of the TXREQ channel in the east direction can be determined first. If the TXREQ channel in the east direction is idle, the TXREQ channel in the east direction is used as the target channel. If the TXREQ channel in the east direction is not idle, the channel status of the TXDATA channel in the east direction is further determined. Taking the example that the TXREQ channel in the east direction is also not idle and the TXDATA channel in the east direction is idle, SXP4 can use the TXDATA channel in the east direction to send data packet A to SXP5. At the same time, since the sending channel used for this transmission is also a non-same-type channel of the data packet, the channel flag bit can remain unchanged.

[0097] After SXP5 receives data packet A, it can determine that the target processing unit is the connected RN-F based on the value of Tgtid[0] in data packet A, and then after clearing the type flag bit and the channel flag bit of data packet A, send data packet A to RN-F through the TXSNP channel between it and RN-F.

[0098] During data packet transmission, the data packet traffic of different channels is often unbalanced. For example, during data transmission between adjacent SXP, data packets may be blocked on the TXREQ channel, while there is no data packet transmission on the TXDATA channel. In the embodiments of the present invention, in the case where the same-type channel of the data packet is not idle, by transferring the data packet to other idle channels for transmission, it is possible to avoid the data packet waiting for a long time in a single channel, avoid waste of bus resources, improve bus utilization rate, reduce data transmission delay, and improve routing efficiency.

[0099] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences 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 essential for the embodiments of the present invention.

[0100] Device embodiments

[0101] Referring to Figure 5 , a structural block diagram of a data packet sending device according to the present invention is shown. Specifically, the system may include:

[0102] A first determination module 201, configured to, for any data packet to be sent, if the channel state of the same-type channel in the target routing direction is an idle state, determine the same-type channel as the target channel; the same-type channel is a sending channel whose channel type matches the packet type of the data packet to be sent;

[0103] A selection module 202, configured to, if the channel state of the same-type channel is a non-idle state, select another sending channel as the target channel based on the channel states of other sending channels in the target routing direction;

[0104] A sending module 203, configured to send the data packet to be sent to an adjacent node in the target routing direction based on the target channel.

[0105] Optionally, the selection module 202 is specifically configured to:

[0106] Determine the channel bit widths of the other sending channels;

[0107] Determine the other sending channels with channel bit widths not less than the target bit width as the first candidate channels; the target bit width is the channel bit width of the same-type channel;

[0108] Select the target channel from the first candidate channels based on the channel states of the first candidate channels.

[0109] Optionally, the selection module 202 is further specifically configured to:

[0110] Select one of the first candidate channels as the second candidate channel according to the selection order of channel bit widths from small to large;

[0111] Determine the channel state of the second candidate channel;

[0112] If the channel state of the second candidate channel is an idle state, determine the second candidate channel as the target channel;

[0113] If the channel state of the second candidate channel is a non-idle state, then according to the selection order, reselect one of the first candidate channels as the second candidate channel, and enter the step of determining the channel state of the second candidate channel.

[0114] Optionally, when the routing node is the starting routing node of the data packet to be sent, the apparatus further includes:

[0115] A second determination module, configured to determine the packet type of the data packet to be sent as a target packet type based on the channel type of the receiving channel that receives the data packet to be sent; the starting routing node is the routing node connected to the source processing unit of the data packet to be sent;

[0116] A first setting module, configured to set the type flag bit in the data packet to be sent to a value used to represent the target packet type;

[0117] A second sending module, configured to determine a sending channel whose channel type matches the target packet type as the same type channel, and determine the channel state of the same type channel.

[0118] Optionally, when the routing node is an intermediate routing node of the data packet to be sent, the apparatus further includes:

[0119] A third determination module, configured to determine the packet type of the data packet to be sent as a target packet type based on the type flag bit of the data packet to be sent; the type flag bit is set for the data packet to be sent by the starting routing node of the data packet to be sent;

[0120] A fourth determination module, configured to determine a sending channel whose channel type matches the target packet type as the same type channel, and determine the channel state of the same type channel.

[0121] Optionally, the data packet to be sent includes a channel flag bit, where the channel flag bit is used to represent whether a specified receiving channel matches the packet type of the data packet to be sent, and the specified receiving channel is the receiving channel through which the routing node receives the data packet to be sent; the apparatus further includes:

[0122] A fifth determination module, configured to, if the channel flag bit is a first preset value, determine a sending channel having the same channel type as the specified receiving channel as the same type channel, and determine the channel state of the same type channel; the first preset value is a value representing a match;

[0123] The third determination module is specifically configured to:

[0124] If the channel flag bit is the second preset value, determine the packet type of the packet to be sent based on the type flag bit of the packet to be sent; the second preset value is a value indicating non - matching.

[0125] Optionally, before sending the packet to be sent to the adjacent node in the target routing direction based on the target channel, the device further includes:

[0126] A second setting module, configured to set the channel flag bit to the first preset value when the target channel is the same - type channel;

[0127] A third setting module, configured to set the channel flag bit to the second preset value when the target channel is the other sending channel.

[0128] Optionally, the channel flag bit and the type flag bit in the packet to be sent are cleared before the packet to be sent is sent to the destination processing unit.

[0129] In summary, in a packet sending device provided by an embodiment of the present invention, for any packet to be sent, if the channel state of the same - type channel in the target routing direction is the idle state, the same - type channel is determined as the target channel, where the same - type channel is a sending channel whose channel type matches the packet type of the packet to be sent. If the channel state of the same - type channel is the non - idle state, based on the channel states of other sending channels in the target routing direction, select an other sending channel as the target channel. Based on the target channel, send the packet to be sent to the adjacent node in the target routing direction. In this way, when the same - type channel is in the non - idle state, directly based on the channel states of other sending channels in the target routing direction, select an other sending channel as the target channel, and send the packet to be sent to the adjacent node in the target routing direction through this target channel. To a certain extent, it can make the packet to be sent be sent out as soon as possible, reduce the probability that the packet is blocked at the routing node, and then to a certain extent, it can reduce the packet transmission delay, avoid the problem of system performance degradation caused by packet blocking, and improve the packet transmission efficiency.

[0130] At the same time, by multiplexing other sending channels, to a certain extent, it can make the traffic between each sending channel more balanced, and improve the overall utilization rate of the sending channels, and then improve the overall transmission efficiency. Further, by multiplexing other sending channels, it can make the packet to be sent continue to be sent in the target routing direction, and the operation of changing the target routing direction for the packet to be sent can be omitted, and then to a certain extent, it can save processing resources.

[0131] For the device embodiments, since they are basically similar to the method embodiments, they are described relatively simply. For the relevant parts, please refer to the corresponding descriptions in the method embodiments.

[0132] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.

[0133] Regarding the processor in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.

[0134] Refer to Figure 6 , which is a structural block diagram of an electronic device for packet sending provided by an embodiment of the present invention. As Figure 6 shown, the electronic device includes: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface complete communication with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions cause the processor to execute the packet sending method in the foregoing embodiments.

[0135] 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 programmable devices, transistor logic devices, hardware components, or any combination thereof. The processor may also be a combination for implementing computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0136] 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 the sake of representation, Figure 4 only one line is shown in , but it does not mean that there is only one bus or one type of bus.

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

[0138] Embodiments of the present invention also provide 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 is enabled to execute Figure 1 the data packet sending method shown.

[0139] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.

[0140] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention can 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 code.

[0141] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of 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 can be implemented by computer program instructions, and the combination of processes and / or blocks in the flowchart and / or block diagram can also be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0142] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a predictive manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device that implements the functions specified in one or more processes and / or blocks Figure 1 in one or more processes and / or blocks Figure 1 specified in one or more blocks or multiple blocks.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are performed on the computer or other programmable terminal device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes and / or blocks Figure 1 in one or more processes and / or blocks Figure 1 specified in one or more blocks or multiple blocks.

[0144] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.

[0145] Finally, it should also be noted that in this article, relational terms such as first and second 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 term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or terminal device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising the element.

[0146] The above has introduced in detail 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 elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to 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, if the channel state of the same type of channel in the target routing direction is idle, the same type of channel is determined as the target channel; the same type of channel is a sending channel whose channel type matches the packet type of the data packet to be sent; If the channel state of the same type of channel is a non-idle state, determining the channel bit width of each other sending channel; Determine other transmission channels whose channel width is not less than the target width as the first candidate channels; the target width is the channel width of the same type of channels; Selecting the target channel from the first candidate channels based on the channel status of the first candidate channels; Based on the target channel, sending the to-be-sent data packet to adjacent nodes in the target routing direction; The routing direction is an optional data transmission direction during the transmission of the to-be-sent data packet from the source processing unit to the destination processing unit.

2. The method according to claim 1, characterized in that The selecting the target channel from the first candidate channels based on the channel status of the first candidate channels includes: According to the selection order of channel width from small to large, selecting one of the first candidate channels as the second candidate channel; Determining the channel state of the second channel to be selected; If the channel state of the second channel to be selected is an idle state, determining the second channel to be selected as the target channel; If the channel state of the second candidate channel is not idle, then according to the selection order, one of the first candidate channels is reselected as the second candidate channel, and the step of determining the channel state of the second candidate channel is entered.

3. The method according to claim 1, characterized in that In the case where the routing node is the starting routing node of the data packet to be sent, the method further includes: Based on the channel type of the receiving channel through which the data packet to be sent is received, the packet type of the data packet to be sent is determined as the target packet type; the starting routing node is the routing node to which the source processing unit of the data packet to be sent is connected; Setting the type flag in the data packet to be sent to a value used to characterize the type of the target packet; A sending channel whose channel type matches the target packet type is determined as the same-type channel, and a channel state of the same-type channel is determined.

4. The method according to claim 1, characterized in that: In the case where the routing node is an intermediate routing node of the data packet to be sent, the method further includes: Based on the type flag of the data packet to be sent, determine the packet type of the data packet to be sent as the target packet type; the type flag is set by the starting routing node of the data packet to be sent for the data packet to be sent; A sending channel whose channel type matches the target packet type is determined as the same-type channel, and a channel state of the same-type channel is determined.

5. The method according to claim 4, characterized in that The data packet to be sent includes a channel flag, and the channel flag is used to indicate whether the designated receiving channel matches the packet type of the data packet to be sent, and the designated receiving channel is the receiving channel through which the routing node receives the data packet to be sent; The method further comprises: If the channel flag is a first preset value, a sending channel of the same channel type as the designated receiving channel is determined as the same type of channel, and a channel state of the same type of channel is determined; the first preset value is a value indicating a match; The determining the type of the data packet to be sent based on the type flag of the data packet to be sent includes: If the channel flag is a second preset value, the packet type of the data packet to be sent is determined based on the type flag of the data packet to be sent; the second preset value is a value that indicates a mismatch.

6. The method according to claim 5, characterized in that Before sending the data packet to be sent to the adjacent node in the target routing direction based on the target channel, the method further includes: When the target channel is the same type of channel, setting the channel flag bit to the first preset value; When the target channel is the other sending channel, the channel flag is set to a second preset value.

7. The method according to claim 5, characterized in that The channel flag bit and the type flag bit in the data packet to be sent are cleared before the data packet to be sent is sent to the destination processing unit.

8. A data packet sending device, characterized in that: The device comprises: A first determination module is used for, for any data packet to be sent, if the channel state of the same type of channel in the target routing direction is idle, determining the same type of channel as the target channel; the same type of channel is a sending channel whose channel type matches the packet type of the data packet to be sent; A selection module is configured to determine the channel width of each other transmission channel if the channel state of the same type of channel is a non-idle state; determine other transmission channels whose channel width is not less than the target bit width as first channels to be selected; the target bit width is the channel width of the same type of channel; and select the target channel from the first channels to be selected based on the channel state of the first channels to be selected; A sending module, configured to send the data packet to be sent to adjacent nodes in the target routing direction based on the target channel; The routing direction is an optional data transmission direction during the transmission of the to-be-sent data packet from the source processing unit to the destination processing unit.

9. 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 7.

10. 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 7.

Citation Information

Patent Citations

  • Multiple passage internal bus external interface device and its data transmission method

    CN101169771A

  • Communication mechanism of wireless network-on-chip based on two-dimensional grid

    CN106804048A

  • Routing path determination method and device, control equipment and storage medium

    CN112003787A