Network-on-chip routing method and device, electronic equipment and storage medium
By using an adaptive routing algorithm in on-chip networks, the target routing direction is determined based on the coordinates of the target node and the current node, as well as port fault information. This solves the problem of low resource utilization in traditional on-chip networks and achieves port-level fault tolerance and resource optimization.
Patent Information
- Application Number
- CN202511052114.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-18
AI Technical Summary
Traditional on-chip networks have a fault tolerance granularity above the node level, resulting in low resource utilization and widespread shutdown of surrounding nodes when a node fails, causing a loss of computing and routing capabilities.
By using an adaptive routing algorithm, the coordinates of the target node and the current node are compared to determine alternative routing directions. Based on port fault information, the target routing direction is selected, thereby achieving adaptive and progressive routing of transmitted data and reducing fault tolerance granularity to the port level.
It improves the resource utilization of on-chip network, accurately isolates faulty nodes, reduces redundant energy consumption, realizes the subdivision of target routing direction at the port level, and optimizes resource utilization and functional consumption.
Smart Images

Figure CN120980007A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of integrated circuit chips, in particular to a routing method and device of a network on chip, an electronic device and a storage medium. BACKGROUND
[0002] With the integrated circuit technology entering the nanometer stage, it has become a reality to integrate hundreds of millions of transistors on a single chip. Under this background, the system on chip (SoC) technology supported by the intellectual property (IP) core reuse technology leads a revolutionary change in the field of microelectronics and its applications, and the emergence of multi-core system on chip further significantly enhances the computing power of the chip. However, the rapid expansion of on-chip resources also brings a rapid increase in data communication demand, which leads to a serious challenge to the traditional bus interconnection structure which takes processing speed as the design center.
[0003] In order to break through the bottleneck of the traditional bus structure in bandwidth, scalability and global synchronization, the research community transplants the packet routing mechanism of computer network to the chip-level communication to form the network on chip architecture. Its core is to build a distributed communication network through routers, links and network interfaces (NI), to replace bus arbitration with data packet exchange, and to realize parallel transmission between multiple cores. However, with the continuous expansion of chip size, a single chip may integrate hundreds or thousands of processor cores and routing nodes, which increases the chip failure probability in an invisible way. The network on chip (NoC) is particularly sensitive to faults, so fault tolerance becomes a key point in the design of NoC.
[0004] The fault tolerance granularity of the traditional network on chip is above the node, which greatly reduces the resource utilization of the network on chip. SUMMARY
[0005] The present application provides a routing method and device of a network on chip, an electronic device and a storage medium, to solve the defect of low resource utilization of the network on chip in the prior art, and to realize improving the resource utilization of the network on chip.
[0006] The present application provides a routing method of a network on chip, comprising: when transmitting data is routed to a current node in the network on chip, comparing the coordinates of a target node and the coordinates of the current node to determine at least one alternative routing direction of the transmitting data at the current node; determining a target routing direction based on the port fault information of the current node and the alternative routing direction, the port fault information including the fault condition of the current node in different output port directions; and routing the transmitting data to a next node along the target routing direction.
[0007] According to the routing method of the network-on-chip provided by the application, the coordinates include X-axis coordinates and Y-axis coordinates; the comparison of the coordinates of the target node and the coordinates of the current node determines at least one alternative routing direction of the transmission data at the current node, including: obtaining a first difference value of the X-axis coordinates of the target node and the X-axis coordinates of the current node; obtaining a second difference value of the Y-axis coordinates of the target node and the Y-axis coordinates of the current node; when the first difference value and the second difference value are both not zero, the X-axis direction of the current node close to the target node is taken as a first routing direction, and the Y-axis direction of the current node close to the target node is taken as a second routing direction; based on the first routing direction and the second routing direction, the alternative routing direction is determined.
[0008] According to the routing method of the network-on-chip provided by the application, the port failure information includes X-axis routing failure and Y-axis routing failure of the output port of the current node, and the X-axis routing failure and the Y-axis routing failure are determined based on the following manner: obtaining the waiting time of the data packet transferred from the input port of the current node to the output port of the current node; when the waiting time exceeds a set threshold value, it is determined that the current node has a failure; based on the relative position between the input port of the current node and the output port of the current node, the type of the failure is determined as the X-axis routing failure or the Y-axis routing failure.
[0009] According to the routing method of the network-on-chip provided by the application, the target routing direction is determined based on the port failure information of the current node and the alternative routing direction, including: when there is no X-axis routing failure in the first routing direction, the first routing direction is taken as the target routing direction; when there is X-axis routing failure in the first routing direction and there is no Y-axis routing failure in the second routing direction, the second routing direction is taken as the target routing direction; when the current node has X-axis routing failure or Y-axis routing failure in three output directions, the direction of the previous node is taken as the target routing direction to return the transmission data to the previous node.
[0010] According to the method for routing of the network on chip, after the second difference value of the Y-axis coordinate of the target node and the Y-axis coordinate of the current node is obtained, the method further comprises: when the first difference value is zero and the second difference value is not zero, taking the second routing direction as an alternative routing direction; determining the target routing direction based on the port failure information of the current node and the alternative routing direction, comprising: when there is no routing failure of the Y-axis in the second routing direction, taking the second routing direction as the target routing direction; when there is routing failure of the Y-axis in the second routing direction and there is no routing failure of the X-axis at the target end of the X-axis of the current node, taking the target end direction of the X-axis of the current node as the target routing direction, the target end of the X-axis comprising any one of the left and right ends of the X-axis; when there is routing failure of the Y-axis in the second routing direction and there is routing failure of the X-axis at both the left and right ends of the X-axis of the current node, taking the direction of the previous node as the target routing direction to return the transmission data to the previous node.
[0011] According to the method for routing of the network on chip, after the second difference value of the Y-axis coordinate of the target node and the Y-axis coordinate of the current node is obtained, the method further comprises: when the first difference value is zero and the second difference value is not zero, taking the second routing direction as an alternative routing direction; determining the target routing direction based on the port failure information of the current node and the alternative routing direction, comprising: when there is no routing failure of the Y-axis in the second routing direction, taking the second routing direction as the target routing direction; when there is routing failure of the Y-axis in the second routing direction and there is no routing failure of the X-axis at the target end of the X-axis of the current node, taking the target end direction of the X-axis of the current node as the target routing direction, the target end of the X-axis comprising any one of the left and right ends of the X-axis; when there is routing failure of the Y-axis in the second routing direction and there is routing failure of the X-axis at both the left and right ends of the X-axis of the current node, taking the direction of the previous node as the target routing direction to return the transmission data to the previous node.
[0012] According to the method for routing of the network on chip, after the second difference value of the Y-axis coordinate of the target node and the Y-axis coordinate of the current node is obtained, the method further comprises: when the first difference value is zero and the second difference value is not zero, taking the second routing direction as an alternative routing direction; determining the target routing direction based on the port failure information of the current node and the alternative routing direction, comprising: when there is no routing failure of the Y-axis in the second routing direction, taking the second routing direction as the target routing direction; when there is routing failure of the Y-axis in the second routing direction and there is no routing failure of the X-axis at the target end of the X-axis of the current node, taking the target end direction of the X-axis of the current node as the target routing direction, the target end of the X-axis comprising any one of the left and right ends of the X-axis; when there is routing failure of the Y-axis in the second routing direction and there is routing failure of the X-axis at both the left and right ends of the X-axis of the current node, taking the direction of the previous node as the target routing direction to return the transmission data to the previous node.
[0013] The application further provides a routing device of a network on a chip, comprising: a comparison module, configured to compare coordinates of a target node and coordinates of a current node when transmission data is routed to the current node in the network on a chip, and determine at least one alternative routing direction of the transmission data at the current node; a determination module, configured to determine a target routing direction based on port failure information of the current node and the alternative routing direction, the port failure information comprising failure conditions of the current node in different output port directions; and a routing module, configured to route the transmission data to a next node along the target routing direction.
[0014] The application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the routing method of the network on a chip as described above when executing the computer program.
[0015] The application further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and the computer program implements the routing method of the network on a chip as described above when executed by a processor.
[0016] The routing method of the network on a chip, the device, the electronic device, and the storage medium provided by the application compare coordinates of a target node and coordinates of a current node when transmission data is routed to the current node in the network on a chip, determine at least one alternative routing direction of the transmission data at the current node, determine a target routing direction based on port failure information of the current node and the alternative routing direction, the port failure information comprising failure conditions of the current node in different port directions, and route the transmission data to a next node along the target routing direction. The application compares coordinates of a target node and coordinates of a current node, determines a target routing direction, and realizes adaptive step-by-step routing of transmission data to the target node. The port failure information can identify failure of a node of the network on a chip at a port level, reduces the fault tolerance granularity of the network on a chip to the port level, is beneficial to improving resource utilization of a fault node of the network on a chip, can accurately isolate the fault node, and reduces redundant energy consumption. The application determines a target routing direction based on port failure information and an alternative routing direction, can avoid a fault path in real time, realizes subdivision of the target routing direction at a port level, improves resource utilization of a node of the network on a chip, and optimizes both resource utilization and function consumption in the network on a chip. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the application or the prior art, the following will briefly introduce the drawings needed in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative effort.
[0018] Figure 1 is one of flowcharts of the routing method of the network on chip provided by the present application.
[0019] Figure 2 is another one of flowcharts of the routing method of the network on chip provided by the present application.
[0020] Figure 3 is one of structural diagrams of the node of the network on chip provided by the present application.
[0021] Figure 4 is another one of structural diagrams of the node of the network on chip provided by the present application.
[0022] Figure 5 is a structural diagram of the routing device of the network on chip provided by the present application.
[0023] Figure 6 is a structural diagram of the electronic device provided by the present application. DETAILED DESCRIPTION
[0024] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely below with reference to the drawings in the present application. Obviously, the described embodiments are some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0025] The fault tolerance granularity of the conventional network on chip (NoC) is above the node. In the network on chip, only the partial port direction of the node often fails. If the nodes are simply divided into two categories of normal and failure according to the partial failure of the node in the network on chip, the normal nodes around the failed node will be disabled in a large area, the computing ability and routing ability of the network on chip are lost, and the resource utilization of the network on chip is reduced.
[0026] In order to solve the above problems, the present application provides a routing algorithm based on self-adaption (the routing method of the network on chip).
[0027] The routing method, device and electronic device of the network on chip of the present application will be described below. Figures 1-6
[0028] Figure 1 is one of flowcharts of the routing method of the network on chip provided by the present application, as shown in Figure 1 the routing method of the network on chip includes steps S100 to S300, and each step is specifically as follows.
[0029] S100: When the transmission data is routed to the current node in the network-on-chip, the coordinates of the target node and the coordinates of the current node are compared to determine at least one alternative routing direction of the transmission data at the current node.
[0030] The network-on-chip is a communication architecture used in the internal communication of complex integrated circuits such as multi-core processors and system-on-chips, which aims to replace the traditional bus structure and solve the communication bottleneck problem under high integration. The core idea is to introduce the layered communication concept of computer networks (such as routing, switching and protocols) into chip design, and to realize efficient and low-latency data transmission through distributed networks.
[0031] For example, as shown in Figure 2 The network-on-chip of the present application is a two-dimensional mesh topology, including 16 routers, which are regularly arranged in a 4x4 mesh. Each router (for example, R1,..., Ri,..., R16) as a node in the network-on-chip is directly connected to its east, south, west and north adjacent nodes, and the mesh topology supports seamless expansion. The nodes are connected by straight lines with arrows, and the data flow is clearly marked.
[0032] The transmission data includes the data packet transmitted in the network-on-chip. For each transmission data, it passes through a source node and several intermediate nodes, and finally reaches a destination node. The destination node is the end point of the transmission data. The current node includes the source node and the intermediate node. Each node includes a computing unit (routing control unit). For example, the PE of the R1 node in the network-on-chip sends a write request transaction data to the PE of the R10 node. As shown in Figure 4 The write request transaction data is divided into multiple flits (Flit) according to the wormhole routing algorithm, such as header flit (H), body flit (B) and tail flit (T). Among them, the header flit carries the coordinates of the destination node and other routing information, the body flit carries the main data information, and the tail flit carries the end information of the write request transaction. The header flit, body flit and tail flit are transmitted in the network-on-chip in turn. The transmission data includes the header flit, body flit or tail flit.
[0033] When the transmission data is routed to the current node in the network-on-chip, the computing unit of the current node compares the coordinates of the target node and the coordinates of the current node according to the adaptive routing algorithm to determine the position difference of the current node and the target node in different directions. At least one alternative routing direction of the current node is determined according to the position difference. The alternative routing direction includes the alternative direction of the transmission data transmitted from the current node to the next node.
[0034] S200: determining a target routing direction based on port failure information of the current node and the alternative routing direction, the port failure information including failure conditions of different output port directions of the current node.
[0035] As shown in Figure 4 The port failure information includes failure conditions of different port directions of the current node. For example, the current node includes an east direction (E) port, a south direction (S) port, a west direction (W) port and a north direction (N) port. The port failure information includes a failure condition of the E port (E direction), a failure condition of the S port (S direction), a failure condition of the W port (W direction) and a failure condition of the N port (N direction).
[0036] The computing unit (routing control unit) is responsible for processing transmission data and completing read-write responses between different nodes, while supporting real-time query of node failure levels and execution of fault diagnosis algorithms. When a node has a severe failure (3, all output ports are in a failure state), the node is reset and restarted, which is the core support unit of the intelligent response of the network on a chip. The horizontal / vertical grid background of the network on a chip strengthens the topology logic and builds a complete closed loop of "monitoring-circumvention / backoff-re-routing".
[0037] According to the port failure information, the alternative routing direction is screened or adjusted to obtain the target routing direction. For example, the transmission data is input from the west port of the current node, and the alternative routing direction is the east direction and the north direction. If the east direction port and the north direction port of the current node both fail, the south direction is taken as the target routing direction.
[0038] S300: routing the transmission data to the next node along the target routing direction.
[0039] The transmission data is transmitted to the next node through the port of the target routing direction.
[0040] The method for routing of the network-on-chip provided by the embodiment of the present application comprises the following steps: when transmitting data is routed to a current node in the network-on-chip, the coordinates of a target node and the coordinates of the current node are compared to determine at least one alternative routing direction of the transmitting data at the current node; the target routing direction is determined based on the port failure information of the current node and the alternative routing direction, wherein the port failure information comprises the failure conditions of the current node in different port directions; and the transmitting data is routed to a next node along the target routing direction. By comparing the coordinates of the target node and the coordinates of the current node, the target routing direction is determined, and the step-by-step routing of the transmitting data to the target node is realized. By the port failure information, the failure of the node of the network-on-chip in the port granularity can be identified, the fault tolerance granularity of the network-on-chip is reduced to the port level, the resource utilization rate of the fault node of the network-on-chip is improved, and meanwhile, the fault node can be accurately isolated, and the redundant energy consumption is reduced. According to the port failure information and the alternative routing direction, the target routing direction is determined, the fault path can be avoided in real time, and meanwhile, the target routing direction is subdivided at the port level, the resource utilization rate of the node of the network-on-chip is improved, and the dual optimization of the resource utilization and the function consumption in the network-on-chip is realized.
[0041] According to the above embodiment, the coordinates comprise an X-axis coordinate and a Y-axis coordinate; the coordinates of the target node and the coordinates of the current node are compared to determine at least one alternative routing direction of the transmitting data at the current node, which comprises the following steps: a first difference value of the X-axis coordinate of the target node and the X-axis coordinate of the current node is obtained; a second difference value of the Y-axis coordinate of the target node and the Y-axis coordinate of the current node is obtained; when the first difference value and the second difference value are both not zero, the X-axis direction of the current node close to the target node is taken as a first routing direction, and the Y-axis direction of the current node close to the target node is taken as a second routing direction; the alternative routing direction is determined based on the first routing direction and the second routing direction.
[0042] a first difference value of the X-axis coordinate of the target node and the X-axis coordinate of the current node is obtained; and a second difference value of the Y-axis coordinate of the target node and the Y-axis coordinate of the current node is obtained. For example, the calculation formula of the first difference value and the second difference value is as follows.
[0043] ; wherein, the first difference value is, the second difference value is, the X-axis coordinate of the target node is, the X-axis coordinate of the current node is, the Y-axis coordinate of the target node is, the Y-axis coordinate of the current node is.
[0044] When the first difference is greater than zero, it means the target node is to the east (right) of the current node. The X-axis direction of the current node closest to the target node is considered east (right) of the current node's X-axis direction. When the first difference is less than zero, it means the target node is to the west (left) of the current node. The X-axis direction of the current node closest to the target node is considered west (left) of the current node's X-axis direction.
[0045] When the second difference is greater than zero, it means the target node is north (above) of the current node. The Y-axis direction of the current node closest to the target node is north (above) of the current node's Y-axis direction. When the second difference is less than zero, it means the target node is south (below) of the current node. The Y-axis direction of the current node closest to the target node is south (below) of the current node's Y-axis direction.
[0046] When both the first and second differences are non-zero, the X-axis direction of the current node closest to the target node is taken as the first routing direction, and the Y-axis direction of the current node closest to the target node is taken as the second routing direction. For example, ... Figure 2 As shown, the target node is R10, and the current node is R3. Comparing the coordinates of the target node and the current node, we find that both the first and second differences are greater than zero. Therefore, the east of R3 is taken as the first routing direction, and the north of R3 is taken as the second routing direction.
[0047] Use the first and second route directions as alternative route directions. For example, use the east and north sides of R3 as the second route directions.
[0048] This invention determines alternative routing directions by using a first difference and a second difference, which helps to enable transmitted data to gradually approach the target node in different directions.
[0049] Based on the above embodiments, the port fault information includes the X-axis routing fault and the Y-axis routing fault of the current node's output port. The X-axis routing fault and the Y-axis routing fault are determined based on the following method: Get the waiting time for a data packet to be transferred from the input port of the current node to the output port of the current node; If the waiting time exceeds the set threshold, it is determined that the current node is faulty; Based on the relative position between the input port and the output port of the current node, determine whether the fault type is an X-axis routing fault or a Y-axis routing fault.
[0050] Furthermore, routing faults on the X-axis and Y-axis can be divided into direct-through faults and turning faults. Direct-through faults include first direct-through faults in the X-axis direction and second direct-through faults in the Y-axis direction. Turning faults include first turning faults when routing from the X-axis direction to the Y-axis direction, or second turning faults when routing from the Y-axis direction to the X-axis direction.
[0051] For example, the first straight-through fault includes transmission faults from east to west and from west to east. The second straight-through fault includes transmission faults from south to north and from north to south. The first turning fault includes transmission faults from west to north, from west to south, from east to north, and from east to south. The second turning fault includes transmission faults from north to west, from north to east, from south to west, and from south to east.
[0052] The routing faults on the X-axis include a first straight-through fault and a second turning fault. The routing faults on the Y-axis include a second straight-through fault and a first turning fault.
[0053] like Figure 4 As shown, port fault information includes a port fault information table. The port fault information table is indexed by direction (e.g., E, W, S, and N). The table includes direction counters (e.g., E-direction counter, W-direction counter, S-direction counter, and N-direction counter), a set threshold, port status, and the fault level of the current node. The direction counters are used to count the waiting (buffering) time of the port when transmitting data packets. If the port's waiting time exceeds a set threshold (e.g., a set threshold of 30T, where T is the period), the port status is faulty. The fault type is determined based on the relative position between the current node's input port and output port. For example, if the input port is W and the output port is E, and port E is faulty, the fault type is an X-axis routing fault (first straight-through fault). If the input port is W and the output port is N, and port N is faulty, the fault type is a Y-axis routing fault (first turning fault). If the input port is S and the output port is N, and port N is faulty, the fault type is a Y-axis routing fault (second straight-through fault). If the input port is port S and the output port is port E, and port E is in a fault state, then the fault type is a routing fault on the X-axis (second turn fault).
[0054] Further, according to the number of fault ports of the current node, the fault level of the current node is determined. For example, if the output port of the current node has no fault port, the fault level of the current node is none. If the output port of the current node has only one fault port, the fault level of the current node is light (light gray). If the output port of the current node has two fault ports, the fault level of the current node is moderate (medium gray). If the output port of the current node has three fault ports, the fault level of the current node is severe (dark gray).
[0055] The present application counts the fault conditions of the output port of the node. For example, as shown in FIG. 1, three output ports are in fault state. But four input ports have no fault, and the input port in the north direction and the input port in the south direction belong to the ready state, ready to receive data at any time. Figure 4
[0056] The present application accurately detects the fault port of the current node according to the waiting time. According to the relative position between the input port and the output port, the type of fault is determined, the fine division of the port fault is realized, and the resource utilization rate of the node is improved.
[0057] Based on the above embodiment, based on the port fault information of the current node and the alternative routing direction, the target routing direction is determined, including the following steps: When there is no X-axis routing fault in the first routing direction, the first routing direction is taken as the target routing direction; When there is X-axis routing fault in the first routing direction, and there is no Y-axis routing fault in the second routing direction, the second routing direction is taken as the target routing direction; When the current node has X-axis routing fault or Y-axis routing fault in three output directions, the direction of the previous node is taken as the target routing direction, so as to return the transmission data to the previous node.
[0058] In the embodiment, the alternative routing direction includes the first routing direction (the X-axis direction of the current node close to the target node) and the second routing direction (the Y-axis direction of the current node close to the target node).
[0059] When there is no X-axis routing fault in the first routing direction, the first routing direction is preferred as the target routing direction. As shown in FIG. 2, the current node is R1, and the target node is R10. The first routing direction is the east direction of R1, and the second routing direction is the north direction of R1. The port in the east direction of R1 has no fault, so the east direction is taken as the target routing direction. Further, the transmission data is transmitted to the next node R2 through the port in the east direction. Figure 2
[0060] When there is a routing failure of the X axis in the first routing direction and there is no routing failure of the Y axis in the second routing direction, the second routing direction is taken as the target routing direction. For example, as shown in FIG. 15, the current node is R2 and the target node is R10. The first routing direction is the east direction of R2 and the second routing direction is the north direction of R2. If the port in the east direction of R2 is faulty, the north direction is taken as the target routing direction. Further, the transmission data is transmitted to the next node R3 through the port in the north direction. Figure 2
[0061] When there is a routing failure of the X axis in all three output directions of the current node or a routing failure of the Y axis, the direction of the previous node is taken as the target routing direction to return the transmission data to the previous node. As shown in FIG. 16, R4 is the current node and R10 is the target node. The three output directions of the current node include the north direction of R10, the south direction of R10 and the east direction of R10. If the ports in the north direction of R10, the south direction of R10 and the east direction of R10 are faulty, the west direction of R3 is taken as the target routing direction. Further, the transmission data is returned to the previous node R3 through the port in the west direction. At this time, the first routing direction (the east direction of R3) is no longer taken as the alternative routing direction and the target routing direction. Instead, the second routing direction (the north direction of R3) is taken as the alternative routing direction and the target routing direction for subsequent routing of the transmission data. Figure 2
[0062] According to the port failure information and the alternative routing direction, the target routing direction is determined, the transmission data can be routed even if there is a partial failure of the node, and the resource utilization of the node is improved.
[0063] Based on the above embodiment, after the second difference value of the Y axis coordinate of the target node and the Y axis coordinate of the current node is obtained, the second routing direction is taken as the alternative routing direction when the first difference value is zero and the second difference value is not zero.
[0064] Based on the port failure information of the current node and the alternative routing direction, the target routing direction is determined, including the following steps: When there is no routing failure of the Y axis in the second routing direction, the second routing direction is taken as the target routing direction; When there is a routing failure of the Y axis in the second routing direction and there is no routing failure of the X axis in the target end of the X axis of the current node, the target end direction of the X axis of the current node is taken as the target routing direction. The target end of the X axis includes any one of the left end and the right end of the X axis. When the second route direction has no route failure of the Y axis, the second route direction is taken as the target route direction.
[0065] When the first difference is zero and the second difference is not zero, it indicates that the X axis coordinates of the current node and the target node are the same, and the Y axis coordinates of the current node and the target node are different. At this time, the transmission data only needs to be moved along the Y axis direction to the target node, and therefore the second route direction of the current node is taken as the alternative route direction. For example, as shown in FIG. 8, R8 is the current node, and R10 is the target node. At this time, the first difference is zero, and the second difference is less than zero. The second route direction (the Y axis direction close to the target node) of the current node is the south direction of R8. The south direction of R8 is taken as the alternative route direction. Figure 2
[0066] When the second route direction has no route failure of the Y axis, the second route direction is taken as the target route direction.
[0067] When the second route direction has route failure of the Y axis, and the target end of the X axis of the current node has no route failure of the X axis, the target end direction of the X axis of the current node is taken as the target route direction. For example, as shown in FIG. 9, R8 is the current node, and R10 is the target node. The second route direction of the current node is the south direction of R8. The target end of the X axis of the current node includes the left end and the right end of R8. At this time, the south direction of R8 has failure (the connection line is marked as ×), and the left end (the target end) of R8 has no route failure of the X axis. The left end direction of R8 is taken as the target route direction. Figure 2
[0068] When the second route direction has route failure of the Y axis, and both the left end and the right end of the X axis of the current node have route failure of the X axis (at this time, the current node has route failure of the X axis or route failure of the Y axis in three output directions), the direction of the previous node is taken as the target route direction to return the transmission data to the previous node.
[0069] According to the port failure information and the alternative route direction, the target route direction is determined in the present application, the transmission data can be routed even if there is partial failure, and the resource utilization rate of the node is improved.
[0070] Based on the above embodiment, after the second difference of the Y axis coordinates of the target node and the Y axis coordinates of the current node is obtained, the first route direction is taken as the alternative route direction when the first difference is not zero and the second difference is zero.
[0071] Determine the target routing direction based on the port failure information of the current node and the alternative routing direction, comprising the following steps: When there is no X-axis routing failure in the first routing direction, the first routing direction is taken as the target routing direction. When there is X-axis routing failure in the first routing direction, and there is no Y-axis routing failure in the target end of the Y-axis of the current node, the target end of the Y-axis of the current node is taken as the target routing direction, and the target end of the Y-axis includes any one of the upper and lower ends of the Y-axis. When there is X-axis routing failure in the first routing direction, and there is Y-axis routing failure in both the upper and lower ends of the Y-axis of the current node, the direction of the previous node is taken as the target routing direction to return the transmission data to the previous node.
[0072] When the first difference is not zero and the second difference is zero, it means that the X-axis coordinates of the current node and the target node are different, and the Y-axis coordinates of the current node and the target node are the same. At this time, the transmission data only needs to be moved along the X-axis direction to the target node. Therefore, the first routing direction of the current node is taken as the alternative routing direction. For example, as shown in Figure 2 , R5 is the current node, and R10 is the target node. The first routing direction of the current node (the X-axis direction close to the target node) is the east direction of R5. The east direction of R5 is taken as the alternative routing direction.
[0073] When there is no X-axis routing failure in the first routing direction, the first routing direction is taken as the target routing direction.
[0074] When there is X-axis routing failure in the first routing direction, and there is no Y-axis routing failure in the target end of the Y-axis of the current node, the target end of the Y-axis of the current node is taken as the target routing direction. For example, as shown in Figure 2 , R5 is the current node, and R10 is the target node. The first routing direction of the current node is the east direction of R5. The target end of the Y-axis of the current node includes the upper end and the lower end of R5. At this time, there is no Y-axis routing failure in the upper end of R5, and the upper end of R5 is taken as the target routing direction. Although, at this time, there is also no Y-axis routing failure in the lower end of R5, the lower end of R5 is the input end, and the current R5 does not meet the condition that all three output ends have failures, so the lower end of R5 is not taken as the target routing direction.
[0075] When there is X-axis routing failure in the first routing direction, and there is Y-axis routing failure in both the upper and lower ends of the Y-axis of the current node (at this time, the current node has X-axis routing failure or Y-axis routing failure in all three output directions), the direction of the previous node is taken as the target routing direction to return the transmission data to the previous node.
[0076] This invention determines the target route direction based on port fault information and alternative route directions, enabling nodes to still transmit data even when there are partial faults, thereby improving the resource utilization of nodes.
[0077] Based on the above embodiments, after routing the transmitted data to the next node along the target routing direction, the following steps are also included: Use the next node as the current node to obtain the updated current node; Compare the coordinates of the target node with the updated coordinates of the current node to update the alternative route directions; Based on the updated port failure information of the current node, the updated alternative route directions are filtered to obtain the updated target route direction; Based on the updated target routing direction, the route transmits data until the data is transmitted to the target node.
[0078] After the data is transmitted to the next node, the next node is used as the current node to obtain the updated current node. For example, ... Figure 2 As shown, after data is transmitted from R2 (current node) to R3 (next node), the next node R3 is used as the updated current node. Step S100 is executed to obtain the updated alternative routing directions. Step S200 is executed to filter the updated alternative routing directions based on the updated port fault information of the current node, obtaining the updated target routing direction. Step S300 is executed to continue routing data based on the updated target routing direction. When both the first difference and the second difference are zero, it is determined that the transmitted data has been transmitted to the target node.
[0079] During the data transmission routing process, for each current node, the target routing direction is determined based on the port failure information and alternative routing directions of the current node. This enables the optimization of the target routing direction based on the port failure status at each routing step, ensuring that the node can still be used even when some ports are faulty, thereby improving the utilization rate of nodes in the on-chip network.
[0080] The routing device for a network-on-a-chip (NIC) provided by the present invention will be described below. The routing device for a NIC described below can be referred to in correspondence with the routing method for a NIC described above.
[0081] like Figure 5 As shown, a routing device for an on-chip network includes a comparison module 501, a determination module 502, and a routing module 503.
[0082] The comparison module 501 is configured to compare the coordinates of the target node and the coordinates of the current node when the transmission data is routed to the current node in the network-on-chip, and determine at least one alternative routing direction of the transmission data at the current node.
[0083] The determination module 502 is configured to determine a target routing direction based on the port failure information of the current node and the alternative routing direction, wherein the port failure information comprises failure conditions of the current node in different output port directions.
[0084] The routing module 503 is configured to route the transmission data to a next node along the target routing direction.
[0085] The routing device of the network-on-chip provided by the embodiment of the present application compares the coordinates of the target node and the coordinates of the current node when the transmission data is routed to the current node in the network-on-chip, and determines at least one alternative routing direction of the transmission data at the current node; determines a target routing direction based on the port failure information of the current node and the alternative routing direction, wherein the port failure information comprises failure conditions of the current node in different port directions; and routes the transmission data to a next node along the target routing direction. The present application compares the coordinates of the target node and the coordinates of the current node to determine the target routing direction, and realizes the adaptive step-by-step routing of the transmission data to the target node. The port failure information can identify the failure of the node of the network-on-chip at the port level, and reduces the fault tolerance granularity of the network-on-chip to the port level, which is beneficial to improve the resource utilization of the fault node of the network-on-chip, and can also accurately isolate the fault node and reduce the redundant energy consumption. The present application determines the target routing direction according to the port failure information and the alternative routing direction, can avoid the fault path in real time, and also realizes the subdivision of the target routing direction at the port level, improves the resource utilization of the node of the network-on-chip, and realizes the double optimization of resource utilization and function consumption in the network-on-chip.
[0086] In one embodiment, the coordinates comprise an X-axis coordinate and a Y-axis coordinate. The comparison module 501 is configured to: obtain a first difference value of the X-axis coordinate of the target node and the X-axis coordinate of the current node; obtain a second difference value of the Y-axis coordinate of the target node and the Y-axis coordinate of the current node; when the first difference value and the second difference value are both not zero, take the X-axis direction of the current node close to the target node as a first routing direction, and take the Y-axis direction of the current node close to the target node as a second routing direction; and determine the alternative routing direction based on the first routing direction and the second routing direction.
[0087] In one embodiment, the port fault information comprises an X-axis routing fault and a Y-axis routing fault of an output port of the current node, and the determining module 502 is further configured to: acquire a waiting time for a data packet to transfer from an input port of the current node to an output port of the current node; determine that the current node has a fault when the waiting time exceeds a set threshold; and determine that the type of the fault is the X-axis routing fault or the Y-axis routing fault based on a relative position between the input port of the current node and the output port of the current node.
[0088] In one embodiment, the determining module 502 is configured to: take the first routing direction as a target routing direction when there is no X-axis routing fault in the first routing direction; take the second routing direction as the target routing direction when there is an X-axis routing fault in the first routing direction and there is no Y-axis routing fault in the second routing direction; and take a direction of a previous node as the target routing direction to return the transmission data to the previous node when the current node has an X-axis routing fault or a Y-axis routing fault in all three output directions.
[0089] In one embodiment, the comparing module 501 is further configured to: take the second routing direction as an alternative routing direction when the first difference is zero and the second difference is not zero. The determining module 502 is further configured to: take the second routing direction as the target routing direction when there is no Y-axis routing fault in the second routing direction; take a target end of an X-axis of the current node as the target routing direction when there is a Y-axis routing fault in the second routing direction and there is no X-axis routing fault in the target end of the X-axis of the current node, the target end of the X-axis comprising any one of left and right ends of the X-axis; and take a direction of a previous node as the target routing direction to return the transmission data to the previous node when there is a Y-axis routing fault in the second routing direction and there are X-axis routing faults in both left and right ends of the X-axis of the current node.
[0090] In one embodiment, the comparing module 501 is further configured to: take the first routing direction as an alternative routing direction when the first difference is not zero and the second difference is zero. The determining module 502 is further configured to: take the first routing direction as the target routing direction when there is no X-axis routing fault in the first routing direction; take a target end of a Y-axis of the current node as the target routing direction when there is an X-axis routing fault in the first routing direction and there is no Y-axis routing fault in the target end of the Y-axis of the current node, the target end of the Y-axis comprising any one of upper and lower ends of the Y-axis; and take a direction of a previous node as the target routing direction to return the transmission data to the previous node when there is an X-axis routing fault in the first routing direction and there are Y-axis routing faults in both upper and lower ends of the Y-axis of the current node.
[0091] In one embodiment, the routing device of the network-on-chip further comprises an updating module configured to: take the next node as the current node, and obtain an updated current node. The comparison module 501 is further configured to: compare the coordinates of the target node and the coordinates of the updated current node, to update the candidate routing direction. The determination module 502 is further configured to: filter the updated candidate routing direction based on the port failure information of the updated current node, to obtain an updated target routing direction. The routing module 503 is further configured to: route the transmission data based on the updated target routing direction, until the transmission data is transmitted to the target node.
[0092] Figure 6 An example of a schematic diagram of a physical structure of an electronic device is shown in Figure 6 The electronic device can include a processor 610, a communications interface 620, a memory 630, and a communications bus 640, wherein the processor 610, the communications interface 620, and the memory 630 communicate with each other through the communications bus 640. The processor 610 can invoke a logical instruction in the memory 630 to execute a routing method of a network-on-chip, the method comprising: when transmission data is routed to a current node in a network-on-chip, comparing coordinates of a target node and coordinates of the current node, determining at least one candidate routing direction of the transmission data at the current node; determining a target routing direction based on port failure information of the current node and the candidate routing direction, the port failure information including failure conditions of the current node in different output port directions; and routing the transmission data to a next node along the target routing direction.
[0093] In addition, the logical instruction in the memory 630 described above can be implemented in the form of a software functional unit and sold or used as an independent product, which can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various storage media that can store program codes.
[0094] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the routing method of the network-on-chip provided by any of the above methods, and the method comprises: when transmitting data is routed to a current node in the network-on-chip, comparing the coordinates of the target node and the coordinates of the current node, and determining at least one alternative routing direction of the transmitting data at the current node; determining a target routing direction based on the port failure information of the current node and the alternative routing direction, the port failure information comprising the failure conditions of the current node in different output port directions; and routing the transmitting data to a next node along the target routing direction.
[0095] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.
[0096] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and the necessary general hardware platform, and of course, can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0097] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A routing method for an on-chip network, characterized in that, include: When data is routed to the current node in the on-chip network, the coordinates of the target node and the coordinates of the current node are compared to determine at least one alternative routing direction for the data at the current node. Based on the port fault information of the current node and the alternative route directions, the target route direction is determined. The port fault information includes the fault status of the current node in different output port directions. The transmitted data is routed to the next node along the target route direction.
2. The routing method for on-chip networks according to claim 1, characterized in that, The coordinates include X-axis coordinates and Y-axis coordinates; The step of comparing the coordinates of the target node and the coordinates of the current node to determine at least one alternative route for transmitting data at the current node includes: Get the first difference between the X-axis coordinate of the target node and the X-axis coordinate of the current node; Obtain the second difference between the Y-axis coordinate of the target node and the Y-axis coordinate of the current node; When both the first difference and the second difference are not zero, the X-axis direction of the current node closest to the target node is taken as the first routing direction, and the Y-axis direction of the current node closest to the target node is taken as the second routing direction. The alternative route direction is determined based on the first route direction and the second route direction.
3. The routing method for on-chip networks according to claim 1, characterized in that, The port fault information includes routing faults on the X-axis and Y-axis of the current node's output port. The routing faults on the X-axis and the Y-axis are determined based on the following method: Get the waiting time for the data packet to be transferred from the input port of the current node to the output port of the current node; When the waiting time exceeds a set threshold, it is determined that the current node is faulty; Based on the relative position between the input port and the output port of the current node, the type of the fault is determined to be either a routing fault on the X-axis or a routing fault on the Y-axis.
4. The routing method for on-chip networks according to claim 2, characterized in that, The process of determining the target route direction based on the port fault information of the current node and the alternative route directions includes: When there is no routing fault on the X-axis in the first routing direction, the first routing direction is taken as the target routing direction; When there is a routing fault along the X-axis in the first routing direction and no routing fault along the Y-axis in the second routing direction, the second routing direction shall be taken as the target routing direction. When the current node has a routing failure on the X-axis or the Y-axis in all three output directions, the direction from the current node to the previous node is taken as the target routing direction, so that the transmitted data is returned to the previous node.
5. The routing method for an on-chip network according to claim 2, characterized in that, After obtaining the second difference between the Y-axis coordinate of the target node and the Y-axis coordinate of the current node, the method further includes: When the first difference is zero and the second difference is not zero, the second routing direction is taken as the alternative routing direction. The process of determining the target route direction based on the port fault information of the current node and the alternative route directions includes: When there is no routing failure along the Y-axis in the second routing direction, the second routing direction shall be used as the target routing direction; When there is a routing fault on the Y-axis in the second routing direction, and there is no routing fault on the X-axis at the target end of the current node, the target end direction of the current node's X-axis is taken as the target routing direction, and the target end of the X-axis includes either the left or right end of the X-axis. When there is a routing fault on the Y-axis in the second routing direction, and there are routing faults on both the left and right ends of the X-axis of the current node, the direction from the current node to the previous node is taken as the target routing direction, so as to return the transmitted data to the previous node.
6. The routing method for an on-chip network according to claim 2, characterized in that, After obtaining the second difference between the Y-axis coordinate of the target node and the Y-axis coordinate of the current node, the method further includes: When the first difference is not zero and the second difference is zero, the first routing direction is taken as the alternative routing direction; The process of determining the target route direction based on the port fault information of the current node and the alternative route directions includes: When there is no routing fault on the X-axis in the first routing direction, the first routing direction is taken as the target routing direction; When there is a routing fault on the X-axis in the first routing direction, and there is no routing fault on the Y-axis at the target end of the current node, the target end of the Y-axis of the current node is taken as the target routing direction, and the target end of the Y-axis includes either the upper or lower end of the Y-axis. When there is a routing fault on the X-axis in the first routing direction, and there are routing faults on the Y-axis at both the upper and lower ends of the current node, the direction from the current node to the previous node is taken as the target routing direction, so as to return the transmitted data to the previous node.
7. The routing method for an on-chip network according to claim 1, characterized in that, After routing the transmitted data to the next node along the target route direction, the method further includes: The next node is used as the current node to obtain the updated current node; The coordinates of the target node are compared with the updated coordinates of the current node to update the alternative route directions; Based on the updated port fault information of the current node, the updated alternative route directions are filtered to obtain the updated target route direction; Based on the updated target routing direction, the transmission data is routed until the transmission data is transmitted to the target node.
8. A routing device for an on-chip network, characterized in that, include: The comparison module is used to compare the coordinates of the target node and the coordinates of the current node when the transmitted data is routed to the current node in the on-chip network, and to determine at least one alternative routing direction of the transmitted data at the current node. The determination module is used to determine the target route direction based on the port fault information of the current node and the alternative route directions. The port fault information includes the fault status of the current node in different output port directions. The routing module is used to route the transmitted data to the next node along the target routing direction.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the routing method of the on-chip network as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the routing method of the on-chip network as described in any one of claims 1 to 7.