Method and device for determining routing direction, storage medium and electronic device
By dynamically selecting the routing direction, combined with the coordinate difference and output port occupancy, the problem of path uniqueness and network congestion caused by the deterministic routing algorithm in the two-dimensional grid topology on-chip network is solved, and the diversity and reliability of the routing path are achieved. sex.
Patent Information
- Application Number
- CN202410686692.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-30
AI Technical Summary
The use of deterministic routing algorithms in on-chip networks with a two-dimensional grid topology results in path uniqueness, resulting in serious network congestion that has not been effectively solved.
By responding to the routing request, determine the coordinate difference between the target routing node and the current routing node, and select the target routing direction from at least two routing directions based on the relationship between the coordinate differences, taking into account the abscissa and ordinate differences, and combine the output Port occupancy status, dynamic selection of routing paths to avoid deadlocks and congestion.
It realizes the selectivity of the routing direction from the current routing node to the target routing node, reduces the probability of network congestion, avoids problems such as deadlock and starvation, and improves the reliability and efficiency of the network.
Smart Images

Figure CN118264605B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of wireless communications, and more specifically, to a method and device for determining a routing direction, a storage medium, and an electronic device. Background Art
[0002] In general, the research on on-chip networks is still in its infancy, and the relevant theories and technologies are not very mature. However, following the development trend from single machines to networks, on-chip networks will develop into a key technology in the future and be widely used. Therefore, it is necessary to conduct relevant research on on-chip networks.
[0003] Routing algorithm is one of the key research topics for network on chip (NoC) researchers. After determining the network topology, the routing algorithm determines the path for message packets to be transmitted in the network. It selects the intermediate nodes that need to be routed based on the source node and the target node. Therefore, the routing algorithm is to select the intermediate nodes and transmit the message packets to the target node after selecting the appropriate nodes. The purpose of this is to ensure that the network delay of the data packet, the power consumption required during the delivery process, the data throughput rate and the reliability can all meet the set indicators. A good routing algorithm can optimize the performance of the chip, while a bad routing algorithm will greatly reduce the performance of the chip. At the same time, a good routing algorithm can effectively avoid deadlock, livelock and starvation, which are problems that reduce chip performance.
[0004] For a two-dimensional grid topology network on chip, each router has a coordinate (x, y) that uniquely corresponds to it. In related technologies, a deterministic routing algorithm is used to select the direction of message packet propagation in the network on chip. However, the use of a deterministic routing algorithm generally means that for a pair of destination nodes and source nodes, the routing algorithm can only provide one routing path, and the uniqueness of the path leads to serious network congestion.
[0005] In the prior art, a two-dimensional grid topology network-on-chip adopts a deterministic routing algorithm, and the routing path obtained is unique, which leads to serious network congestion and has not yet been effectively solved. Summary of the invention
[0006] The embodiments of the present application provide a method and device for determining a routing direction, a storage medium, and an electronic device, so as to at least solve the problem in the prior art that a two-dimensional grid topology network-on-chip adopts a deterministic routing algorithm, and the routing path obtained is unique, which leads to serious network congestion.
[0007] According to one embodiment of the present application, a method for determining a routing direction is provided, comprising: determining, in response to a routing request, a coordinate difference between a first coordinate of a target routing node and a second coordinate of a current routing node, wherein the routing request is used to request that a message packet to be sent be sent from the current routing node to the target routing node; obtaining a size relationship between the coordinate difference and the target value; and determining, according to the size relationship, a target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node.
[0008] In an exemplary embodiment, a target routing direction from the current routing node to the next routing node is determined from at least two routing directions corresponding to the current routing node according to the size relationship, including: when the size relationship indicates that the horizontal coordinate difference is greater than the target value, or the vertical coordinate difference is greater than the target value, determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node, wherein the coordinate difference includes: a horizontal coordinate difference and a vertical coordinate difference; when the size relationship indicates that the horizontal coordinate difference is less than the target value, or the vertical coordinate difference is less than the target value, determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node.
[0009] In an exemplary embodiment, a target routing direction from the current routing node to the next routing node is determined from at least two routing directions corresponding to the current routing node, including: when the horizontal coordinate difference is greater than the target value, determining the positive direction of the horizontal axis as the first routing direction; determining the positive direction of the vertical axis or the negative direction of the vertical axis as the second routing direction according to the relationship between the vertical coordinate difference and the target value; determining the port occupancy of the first output port and the second output port, wherein the first output port is the output port of the current routing node in the first routing direction, and the second output port is the output port of the current routing node in the second routing direction; determining the target routing direction according to the port occupancy.
[0010] In an exemplary embodiment, the positive direction of the longitudinal axis or the negative direction of the longitudinal axis is determined as the second routing direction based on the size relationship between the longitudinal coordinate difference and the target value, including: calculating the size relationship between the longitudinal coordinate difference and the target value; when the size relationship indicates that the longitudinal coordinate difference is greater than the target value, determining the positive direction of the longitudinal axis as the second routing direction; when the size relationship indicates that the longitudinal coordinate difference is less than the target value, determining the negative direction of the longitudinal axis as the second routing direction.
[0011] In an exemplary embodiment, determining the port occupancy of the first output port and the second output port includes one of the following methods: sending a first test data packet to a first routing node through the first output port, and sending a second test data packet to a second routing node through the second output port; determining the port occupancy of the first output port and the second output port according to a first response of the first routing node to the first test data packet and a second response of the second routing node to the second test data packet, wherein the first routing node is a routing node with the smallest coordinate distance from the current routing node in the first routing direction, and the second routing node is a routing node with the smallest coordinate distance from the current routing node in the second routing direction; querying the status information of the first output port and the second output port in a routing table, and determining the port occupancy according to the status information; querying the first node status of the first routing node and the second node status of the second routing node, and determining the port occupancy according to the first node status and the second node status, wherein the first routing node is a routing node with the smallest coordinate distance from the current routing node in the first routing direction, and the second routing node is a routing node with the smallest coordinate distance from the current routing node in the second routing direction.
[0012] In an exemplary embodiment, determining the target routing direction according to the port occupancy status includes: when the port occupancy status indicates that the first output port is occupied and the second output port is not occupied, determining the second routing direction as the target routing direction; when the port occupancy status indicates that the first output port is not occupied and the second output port is occupied, determining the first routing direction as the target routing direction; when the port occupancy status indicates that both the first output port and the second output port are not occupied, determining the routing direction included in the preset priority routing direction as the target routing direction, or determining the first routing direction or the second routing direction as the target routing direction.
[0013] In an exemplary embodiment, after determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method further includes: sending the message packet to be sent to the next routing node according to the target routing direction; when it is determined that the next routing node has successfully received the message packet to be sent, updating the next routing node to the current routing node, and continuing to determine a new target routing direction.
[0014] In an exemplary embodiment, after determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method further includes: obtaining the traffic load condition of the on-chip network at a first time; when the traffic load condition at the first time is greater than a preset threshold, re-determining the target routing direction from the current routing node to the next routing node from the at least two routing directions; and determining the re-determined target routing direction as the routing direction of the on-chip network from the current routing node to the next routing node at a second time, wherein the second time is later than the first time.
[0015] In an exemplary embodiment, after determining a target routing direction from the current routing node to a next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method further includes: determining multiple routing paths from the current routing node to the target routing node in the target routing direction; and determining a target routing path without a risk of congestion among the multiple routing paths.
[0016] In an exemplary embodiment, determining a target routing path without a risk of congestion among the multiple routing paths includes: determining a time window required for the message packet to be sent from the current routing node to the target routing node; determining a passable routing path among the multiple routing paths within the time window, wherein the passable routing path is a routing path without a risk of congestion; and determining the target routing path from the passable routing paths.
[0017] In an exemplary embodiment, determining the time window required for the message packet to be sent from the current routing node to the target routing node includes: determining the number of nodes that the message packet to be sent passes through in the process of sending the message packet to be sent from the current routing node to the target routing node according to the routing request, and determining the sending time required for each hop of the message packet to be sent, wherein the passed nodes include: intermediate nodes and the target routing node; and determining the product of the sending time and the number of nodes as the time window.
[0018] In an exemplary embodiment, determining a traversable routing path among the multiple routing paths within the time window includes: for each routing path among the multiple routing paths: obtaining a node broadcast message of the multiple routing nodes included on each routing path, wherein the node broadcast message includes at least: routing node occupancy information, and an occupied time window corresponding to the routing node occupancy information; determining a sub-time window corresponding to each routing node among the multiple routing nodes in the time window, wherein the number of the multiple routing nodes is the same as the number of sub-time windows included in the time window; and determining each routing path as a traversable routing path when the occupied time window of each routing node does not overlap with the sub-time window.
[0019] In an exemplary embodiment, determining the target routing path from the passable routing paths includes: determining the target routing path from the passable routing paths in one of the following ways: selecting any passable routing path from the passable paths as the target routing path; obtaining third coordinates of multiple nodes included in each of the passable paths, determining the number of coordinates in which the horizontal coordinate is greater than the vertical coordinate among the multiple third coordinates, and determining the passable routing path whose number of coordinates meets a preset rule as the target routing path.
[0020] In an exemplary embodiment, determining the number of nodes that the message packet to be sent passes through in the process of sending the message packet to be sent from the current routing node to the target routing node according to the routing request includes: obtaining the sum of the first horizontal coordinate and the first vertical coordinate of the first coordinate to obtain a first value, and obtaining the sum of the first horizontal coordinate and the second vertical coordinate of the second coordinate to obtain a second value; and determining the difference between the first value and the second value as the number of nodes.
[0021] In an exemplary embodiment, determining the sending time required for each hop of the message packet to be sent includes one of the following: reading the historical sending time recorded in the historical sending log, and determining the historical sending time as the sending time; monitoring the on-chip network through a network monitoring tool to determine the real-time sending time of the message packet being sent on the on-chip network, and determining the real-time sending time as the sending time; obtaining the historical sending time, and obtaining the real-time sending time; determining the larger value between the historical sending time and the real-time sending time; determining the larger value as the sending time, wherein the historical sending time is the historical sending time recorded in the historical sending log, and the real-time sending time is the real-time sending time obtained by monitoring the message packet being sent on the on-chip network through a network monitoring tool.
[0022] According to another embodiment of the present application, a device for determining a routing direction is provided, comprising: a response module, for determining a coordinate difference between a first coordinate of a target routing node and a second coordinate of a current routing node in response to a routing request, wherein the routing request is used to request that a message packet to be sent be sent from the current routing node to the target routing node; an acquisition module, for obtaining a size relationship between the coordinate difference and the target value; and a determination module, for determining a target routing direction from the current routing node to a next routing node from at least two routing directions corresponding to the current routing node according to the size relationship.
[0023] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.
[0024] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0025] Through the present application, in response to a routing request, the coordinate difference between the first coordinate of the target routing node and the second coordinate of the current routing node is determined, wherein the routing request is used to request that the message packet to be sent be sent from the current routing node to the target routing node; the size relationship between the coordinate difference and the target value is obtained; and the target routing direction from the current routing node to the next routing node is determined from at least two routing directions corresponding to the current routing node according to the size relationship. Therefore, the problem that the on-chip network with a two-dimensional grid topology structure adopts a deterministic routing algorithm in the prior art, and the path obtained by routing is unique, which leads to serious network congestion can be solved. The routing direction from the current routing node to the target routing node is selectable, and the resulting routing path is not unique, which reduces the probability of network congestion. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for determining a routing direction according to an embodiment of the present application;
[0027] Figure 2 is a flow chart of a method for determining a routing direction according to an embodiment of the present application;
[0028] Figure 3 is a schematic diagram (I) of a path planning method for determining a routing direction according to an embodiment of the present application;
[0029] Figure 4is a schematic diagram of a two-dimensional mesh network topology structure according to a method for determining a routing direction according to an embodiment of the present application;
[0030] Figure 5 It is a schematic diagram of the coordinates of each routing node in a two-dimensional mesh network according to the method for determining the routing direction of an embodiment of the present application;
[0031] Figure 6 is a clockwise deadlock schematic diagram of a method for determining a routing direction according to an embodiment of the present application;
[0032] Figure 7 is a counterclockwise deadlock schematic diagram of a method for determining a routing direction according to an embodiment of the present application;
[0033] Figure 8 is a schematic diagram of avoiding deadlock according to a method for determining a routing direction according to an embodiment of the present application;
[0034] Fig. 9 is a schematic diagram of a traditional routing path planning according to an embodiment of the present application (I);
[0035] Fig.10 is a schematic diagram of a traditional routing path planning according to an embodiment of the present application (II);
[0036] Fig.11 is a schematic diagram (II) of a path planning method for determining a routing direction according to an embodiment of the present application;
[0037] Fig.12 is a schematic diagram of the placement of routing nodes according to the method for determining the routing direction of an embodiment of the present application;
[0038] Fig.13 It is a structural block diagram of a device for determining a routing direction according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0040] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0041] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a computer terminal of a method for determining a routing direction according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0042] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for allocating load resources in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0043] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0044] Figure 2 is a flow chart of a method for determining a routing direction according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0045] Step S202, in response to a routing request, determining a coordinate difference between a first coordinate of a target routing node and a second coordinate of a current routing node, wherein the routing request is used to request that a message packet to be sent be sent from the current routing node to the target routing node;
[0046] Step S204, obtaining the magnitude relationship between the coordinate difference value and the target value;
[0047] It should be noted that the target value can be selected as 0.
[0048] Step S206: determining a target routing direction from the current routing node to a next routing node from at least two routing directions corresponding to the current routing node according to the size relationship.
[0049] Through the above steps, in response to a routing request, the coordinate difference between the first coordinate of the target routing node and the second coordinate of the current routing node is determined, wherein the routing request is used to request that the message packet to be sent be sent from the current routing node to the target routing node; the size relationship between the coordinate difference and the target value is obtained; and the target routing direction from the current routing node to the next routing node is determined from at least two routing directions corresponding to the current routing node according to the size relationship. Therefore, the problem in the prior art that the on-chip network with a two-dimensional grid topology structure adopts a deterministic routing algorithm, and the routing path obtained is unique, which leads to serious network congestion, can be solved. The routing direction from the current routing node to the target routing node is selectable, and the routing path obtained is not unique, which reduces the probability of network congestion.
[0050] The above step S202 can be implemented by the following method, including: determining the first horizontal coordinate and the first vertical coordinate included in the first coordinate; and determining the second horizontal coordinate and the second vertical coordinate included in the second coordinate; calculating the horizontal coordinate difference between the first horizontal coordinate and the second horizontal coordinate, and calculating the vertical coordinate difference between the first vertical coordinate and the second vertical coordinate; determining the horizontal coordinate difference and the vertical coordinate difference as the coordinate difference.
[0051] Assume that the coordinates of the current routing node where the message packet to be sent is The coordinates of the target routing node By comparison, the coordinate difference can be calculated :
[0052]
[0053] For example, the current routing node coordinates are (2,2) and the target routing node coordinates are (3,3), then the coordinate difference is (1,1), where the horizontal coordinate difference is 1 and the vertical coordinate difference is 1.
[0054] For the above-mentioned step S206, determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, including: when the size relationship indicates that the horizontal coordinate difference is greater than the target value, or the vertical coordinate difference is greater than the target value, determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node, wherein the coordinate difference includes: the horizontal coordinate difference and the vertical coordinate difference; when the size relationship indicates that the horizontal coordinate difference is less than the target value, or the vertical coordinate difference is less than the target value, determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node.
[0055] Further, in an embodiment of the present application, a target routing direction from the current routing node to the next routing node is determined from at least two routing directions corresponding to the current routing node. The specific implementation scheme is as follows:
[0056] Solution 1: When the horizontal coordinate difference is greater than the target value, the positive direction of the horizontal axis is determined as the first routing direction; according to the relationship between the vertical coordinate difference and the target value, the positive direction of the vertical axis or the negative direction of the vertical axis is determined as the second routing direction; the port occupancy of the first output port and the second output port is determined, wherein the first output port is the output port of the current routing node in the first routing direction, and the second output port is the output port of the current routing node in the second routing direction; the target routing direction is determined according to the port occupancy.
[0057] Solution 2: When the vertical coordinate difference is greater than the target value, the positive direction of the vertical axis is determined as the third routing direction; according to the relationship between the horizontal coordinate difference and the target value, the positive direction of the horizontal axis or the negative direction of the horizontal axis is determined as the fourth routing direction; the port occupancy of the third output port and the fourth output port is determined, wherein the third output port is the output port of the current routing node in the third routing direction, and the fourth output port is the output port of the current routing node in the fourth routing direction; the target routing direction is determined according to the port occupancy of the third output port and the fourth output port.
[0058] Solution three: When the horizontal coordinate difference is less than the target value, the negative direction of the horizontal axis is determined as the fifth routing direction; according to the relationship between the vertical coordinate difference and the target value, the positive direction of the vertical axis or the negative direction of the vertical axis is determined as the sixth routing direction; the port occupancy of the fifth output port and the sixth output port is determined, wherein the fifth output port is the output port of the current routing node in the fifth routing direction, and the sixth output port is the output port of the current routing node in the sixth routing direction; the target routing direction is determined according to the port occupancy of the fifth output port and the sixth output port.
[0059] In scheme 4, when the vertical coordinate difference is less than the target value, the negative direction of the vertical axis is determined as the seventh routing direction; according to the relationship between the horizontal coordinate difference and the target value, the positive direction of the horizontal axis or the negative direction of the horizontal axis is determined as the eighth routing direction; the port occupancy of the seventh output port and the eighth output port is determined, wherein the seventh output port is the output port of the current routing node in the seventh routing direction, and the eighth output port is the output port of the current routing node in the eighth routing direction; the target routing direction is determined according to the port occupancy of the seventh output port and the eighth output port.
[0060] Optionally, the above-mentioned schemes 1 to 4 are routing direction selection schemes suitable for different scenarios, and can be selected for implementation according to specific scenarios. Optionally, the routing direction selection scheme to be adopted can be selected according to the placement of routing nodes in the on-chip network. For example, if the horizontal coordinate of the placement position of the routing node that frequently sends message packets is smaller, and the horizontal coordinate of the placement position of the routing node that frequently receives message packets is larger, then the above-mentioned scheme 1 can be selected for execution; otherwise, the above-mentioned scheme 3 can be selected for execution. If the vertical coordinate of the placement position of the routing node that frequently sends message packets is smaller, and the vertical coordinate of the placement position of the routing node that frequently receives message packets is larger, then the above-mentioned scheme 2 can be selected for execution; otherwise, the above-mentioned scheme 4 can be selected for execution. It should be noted that the frequency of sending and receiving the above-mentioned message packets can also be the actual sending and receiving of message packets by each routing node re-determined after the on-chip network has been running for a period of time.
[0061] It should be noted that, in order to ensure that adverse situations such as deadlock do not occur, taking Scheme 1 as an example, Scheme 1 records the situation that "the size relationship indicates that the horizontal coordinate difference is greater than the target value", then under the premise that the entire on-chip network adopts Scheme 1 to route the message packet to be sent: if the horizontal coordinate difference corresponding to any routing request is less than the target value, a deterministic routing method should be adopted, that is, first route the message packet to be sent in any routing request according to the horizontal axis direction indicated by "the horizontal coordinate difference is less than the target value" (generally the negative direction of the horizontal axis) (here a single-hop routing method is adopted, when the message packet to be sent is sent to the next routing node, the next routing node will be updated to the current routing node), until the latest horizontal coordinate of the message packet to be sent is the same as the first horizontal coordinate of the target routing node; then continue to select the target routing direction and route the message packet to be sent according to the vertical coordinate difference. It should also be noted that when Scheme 2, Scheme 3 or Scheme 4 are adopted throughout the on-chip network, the scheme for avoiding adverse situations such as deadlock is similar to Scheme 1, and the embodiments of this application will not be repeated here.
[0062] The embodiment of the present application determines a specific routing direction selection scheme based on different routing distribution scenarios, and through the specific routing direction selection scheme, selects a target routing direction from at least two directions in which the message packet to be sent can be sent in the current situation, thereby making the routing selection scheme non-unique.
[0063] For the scheme 1 in the above step S206, the positive direction of the vertical axis or the negative direction of the vertical axis is determined as the second routing direction according to the size relationship between the vertical coordinate difference and the target value, including: calculating the size relationship between the vertical coordinate difference and the target value; when the size relationship (the vertical coordinate difference and the target value) indicates that the vertical coordinate difference is greater than the target value, the positive direction of the vertical axis is determined as the second routing direction; when the size relationship (the vertical coordinate difference and the target value) indicates that the vertical coordinate difference is less than the target value, the negative direction of the vertical axis is determined as the second routing direction. It should be noted that the determination schemes of the fourth, sixth, and eighth routing directions in the above schemes 2 to 4 are similar to those in this embodiment and will not be repeated here.
[0064] Further, determining the port occupancy of the first output port and the second output port includes one of the following methods: sending a first test data packet to the first routing node through the first output port, and sending a second test data packet to the second routing node through the second output port; determining the port occupancy of the first output port and the second output port according to a first response of the first routing node to the first test data packet and a second response of the second routing node to the second test data packet, wherein the first routing node is the routing node with the smallest coordinate distance from the current routing node in the first routing direction, and the second routing node is the routing node with the smallest coordinate distance from the current routing node in the second routing direction; querying the status information of the first output port and the second output port in the routing table, and determining the port occupancy according to the status information; querying the first node status of the first routing node and the second node status of the second routing node, and determining the port occupancy according to the first node status and the second node status, wherein the first routing node is the routing node with the smallest coordinate distance from the current routing node in the first routing direction, and the second routing node is the routing node with the smallest coordinate distance from the current routing node in the second routing direction.
[0065] Optionally, to determine the port occupancy of the first output port and the second output port, at least one of the above three methods can be selected, that is, all three methods are adopted, any two of the above three methods are adopted, etc. The port occupancy can be determined more accurately through a combination.
[0066] It is understandable that the first response situation and the second response situation both include: response, no response, and sending failure. If the sending fails or there is no response, the corresponding port is considered to be occupied; if there is a response, the corresponding port is considered to be unoccupied. The response can be a response electrical signal, a response message, etc. It should be noted that the test data packet and the response should not affect the sending of the message packet to be sent.
[0067] Further, determining the target routing direction according to the port occupancy status includes: when the port occupancy status indicates that the first output port is occupied and the second output port is not occupied, determining the second routing direction as the target routing direction; when the port occupancy status indicates that the first output port is not occupied and the second output port is occupied, determining the first routing direction as the target routing direction; when the port occupancy status indicates that both the first output port and the second output port are not occupied, determining the routing direction included in the preset priority routing direction as the target routing direction, or determining the first routing direction or the second routing direction as the target routing direction.
[0068] It should be noted that if one output port is already occupied, only the routing direction of the other output port can be selected as the target routing direction. If both output ports are not occupied, the routing direction of any one of the ports can be selected as the target routing direction; or, a priority routing direction can be preset, for example, the priority routing direction can be set to the routing direction that coincides with the horizontal axis as the priority routing direction; that is, if the first routing direction points to the positive direction of the horizontal axis, and the second routing direction points to the positive direction of the vertical axis, and the output ports of the two routing directions are not occupied, the first routing direction will be determined as the target routing direction as the priority routing direction.
[0069] The embodiment of the present application can ensure that the target routing direction selected for the message packet to be sent is unobstructed by determining the output port occupancy in the target routing direction, thereby avoiding problems such as deadlock, livelock and starvation during the message packet sending process.
[0070] Furthermore, after determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method also includes: sending the message packet to be sent to the next routing node according to the target routing direction; when it is determined that the next routing node has successfully received the message packet to be sent, updating the next routing node to the current routing node, and continuing to determine the new target routing direction.
[0071] It is understandable that in the embodiment of the present application, after selecting the target routing direction, the message packet to be sent can be directly sent to the next routing node in the target routing direction, and the next routing node can be used as the current routing node to calculate the next target routing direction.
[0072] Optionally, after determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method further includes: obtaining the traffic load condition of the on-chip network at a first time; when the traffic load condition at the first time is greater than a preset threshold, re-determining the target routing direction from the current routing node to the next routing node from the at least two routing directions; and determining the re-determined target routing direction as the routing direction of the on-chip network from the current routing node to the next routing node at a second time, wherein the second time is later than the first time.
[0073] It is understandable that, under special circumstances, there may be multiple tasks of sending and receiving message packets in the on-chip network at the same time. If the on-chip network traffic load is detected to be too high in the first time, the target routing direction can be re-planned and sent for the message packet to be sent at a second time after the first time. Optionally, if the output ports in the first routing direction and the second routing direction are both occupied when selecting the target routing direction, the target routing direction can also be re-planned at the second time.
[0074] The embodiment of the present application provides a delay planning scheme for the target routing direction. Through delay planning, it avoids the output ports in the plannable direction being occupied and the current network traffic load of the on-chip network being too much, which may cause the loss of message packets and incomplete message packet data transmission. The protection of the data in the message packet is achieved.
[0075] Optionally, an embodiment of the present application may choose to directly transmit the message packet to be sent to the next routing node in the target routing direction after determining the target routing direction, but an embodiment of the present application may also choose to plan a target routing path from the current routing direction to the target routing direction, and then send the message packet to be sent directly to the target routing node through the target routing path.
[0076] Furthermore, in an exemplary embodiment, after determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method also includes: determining multiple routing paths from the current routing node to the target routing node in the target routing direction; and determining a target routing path without congestion risk among the multiple routing paths.
[0077] The embodiment of the present application can directly plan a target routing path to reach a target routing node at the current routing node, and can send the message packet to be sent to the target routing node as quickly as possible from the global perspective of the on-chip network, thereby reducing the time consumption that may be caused by step-by-step planning.
[0078] Specifically, determining a target routing path without a risk of congestion among the multiple routing paths includes: determining a time window required for the message packet to be sent from the current routing node to the target routing node; determining a passable routing path among the multiple routing paths within the time window, wherein the passable routing path is a routing path without a risk of congestion; and determining the target routing path from the passable routing paths.
[0079] Furthermore, determining the time window required for the message packet to be sent from the current routing node to the target routing node includes: determining the number of nodes that the message packet to be sent passes through in the process of sending the message packet to be sent from the current routing node to the target routing node according to the routing request, and determining the sending time required for each hop of the message packet to be sent, wherein the passed nodes include: intermediate nodes and the target routing node; and determining the product of the sending time and the number of nodes as the time window.
[0080] It should be noted that the intermediate node is a node between the target routing node and the current routing node. For example, if the current routing node coordinates are (0,0) and the target routing node coordinates are (2,2), there are three intermediate nodes between (0,0) and (2,2) in the plane rectangular coordinate system; thus, the number of nodes described in the embodiment of the present application is 4.
[0081] Furthermore, determining a traversable routing path among the multiple routing paths within the time window includes: for each routing path among the multiple routing paths: obtaining a node broadcast message of the multiple routing nodes included on each routing path, wherein the node broadcast message includes at least: routing node occupancy information, and an occupied time window corresponding to the routing node occupancy information; determining a sub-time window corresponding to each routing node among the multiple routing nodes in the time window, wherein the number of the multiple routing nodes is the same as the number of sub-time windows included in the time window; and determining each routing path as a traversable routing path when the occupied time window of each routing node does not overlap with the sub-time window.
[0082] For example, Figure 3 As shown in the figure, if the current routing node coordinates are (0,0) and the target routing node coordinates are (2,2), there are 6 paths between these two coordinates (such as Figure 3 As shown by the arrow in the middle, take one of the paths: (0.0)-(1,0)-(1,1)-(1,2)-(2,2) as an example, (1,0), (1,1), (1,2), (2,2) correspond to the first sub-time window, the second sub-time window, the third sub-time window, and the fourth sub-time window in the time window respectively: then obtain the broadcast messages of nodes (1,0), (1,1), (1,2), (2,2), if it is determined based on the broadcast messages of these four nodes that these four nodes are not occupied in the corresponding sub-time windows, then this path is a passable routing path; on the contrary, if any of the four nodes is occupied in the corresponding sub-time window, for example, the broadcast message of (1,1) indicates that the node is occupied in the first sub-time window, then this routing path is not a passable routing path.
[0083] In an exemplary embodiment, determining the target routing path from the passable routing paths includes: determining the target routing path from the passable routing paths in one of the following ways: selecting any passable routing path from the passable paths as the target routing path; obtaining third coordinates of multiple nodes included in each of the passable paths, determining the number of coordinates in which the horizontal coordinate is greater than the vertical coordinate among the multiple third coordinates, and determining the passable routing path whose number of coordinates meets a preset rule as the target routing path.
[0084] That is, you can select any one of the passable paths as the target routing path; you can also select the path that goes in the X-axis direction first as the target routing path.
[0085] Optionally, determining the number of nodes that the message packet to be sent passes through in the process of sending the message packet to be sent from the current routing node to the target routing node according to the routing request includes: obtaining the sum of the first horizontal coordinate and the first vertical coordinate of the first coordinate to obtain a first value, and obtaining the sum of the first horizontal coordinate and the second vertical coordinate of the second coordinate to obtain a second value; and determining the difference between the first value and the second value as the number of nodes.
[0086] Optionally, determining the sending time required for each hop of the message packet to be sent includes one of the following: reading the historical sending time recorded in the historical sending log, and determining the historical sending time as the sending time; monitoring the on-chip network through a network monitoring tool to determine the real-time sending time of the message packet being sent on the on-chip network, and determining the real-time sending time as the sending time; obtaining the historical sending time, and obtaining the real-time sending time; determining the larger value between the historical sending time and the real-time sending time; determining the larger value as the sending time, wherein the historical sending time is the historical sending time recorded in the historical sending log, and the real-time sending time is the real-time sending time obtained by monitoring the message packet being sent on the on-chip network through a network monitoring tool.
[0087] It should be noted that after obtaining the historical sending time and / or the real-time sending time, the time value corresponding to the historical sending time and / or the real-time sending time can be appropriately increased to reserve sufficient sending time for each hop of the message packet to be sent, so as to avoid sending congestion caused by network fluctuations, etc. Among them, the appropriate increase amount can be selected as 1 / 10 of the historical sending time and / or the real-time sending time, that is, sending time = historical sending time or real-time sending time + (historical sending time or real-time sending time) * 1 / 10.
[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0089] In order to better understand the process of the above-mentioned method for determining the routing direction, the implementation process of the above-mentioned method for determining the routing direction is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.
[0090] For a two-dimensional grid topology network on chip, each router has a coordinate (x, y) that uniquely corresponds to it. XY routing is a classic deterministic routing algorithm. First, the message packet will compare the X-axis coordinate of the source node where it is located with the X-axis coordinate of the destination node. If the X-axis coordinate of the source node (equivalent to the current routing node in the above embodiment) is smaller than the X-axis coordinate of the destination node (equivalent to the target routing node in the above embodiment), it will be routed to the east. If the X-axis coordinate of the source node is greater than the X-axis coordinate of the destination node, it will be routed to the west. When the message packet is routed to the same X-axis coordinate as the destination node, it will be transmitted to the Y axis. At this time, if the Y-axis coordinate of the message packet is smaller than the Y-axis coordinate of the target node, the message packet will choose to continue to be transmitted to the north. If the Y-axis coordinate of the message packet is greater than the Y-axis coordinate of the destination node, the message packet will choose to be transmitted to the south. This routing algorithm has a small delay and can prevent possible problems such as deadlock, livelock and starvation.
[0091] The hardware implementation of the XY routing algorithm is simple, but it is a deterministic routing algorithm, which means that for a pair of destination nodes and source nodes, the routing algorithm can only provide one routing path. The uniqueness of the path leads to serious network congestion.
[0092] To this end, the optional embodiment of the present application improves on the basis of the XY routing algorithm and proposes an adaptive XY routing algorithm, which improves the uniqueness of the XY routing path, can effectively avoid deadlock, and the hardware implementation of the algorithm is simple.
[0093] The following uses a two-dimensional Mesh topology structure as an example to illustrate the adaptive XY routing algorithm provided in an optional embodiment of the present application.
[0094] like Figure 4 As shown in the figure, it is a 4×4 two-dimensional mesh network-on-chip topology. In the figure, R (Router) represents the router, which arbitrates the flow of data and determines the transmission path of the data packet in the routing network; IP (Internet Protocol) represents the resource node, which can send and receive data. The lines in the figure are all bidirectional lines, that is, full-duplex. The routing algorithm generally refers to the transmission of data between routers R, so the optional embodiment of this application only considers the transmission of data between routers R.
[0095] Furthermore, the coordinates of each routing node in the 4*4 2D mesh network are as follows: Figure 5 shown.
[0096] Assume that the coordinates of the routing node where the message packet is currently located are The coordinates of the destination node Compare and calculate the coordinate difference :
[0097] ;
[0098] Based on the above coordinate differences, the message packets to be sent in the on-chip network are routed according to the following conventions, specifically:
[0099] Agreement 1: When When , the X-axis direction can only go eastward (equivalent to the positive direction of the horizontal axis in the above embodiment). When , the X-axis direction can only go westward (equivalent to the negative direction of the horizontal axis in the above embodiment); when When , the Y-axis direction can only go north (equivalent to the positive direction of the longitudinal axis in the above embodiment). When the Y axis is in the south direction (equivalent to the negative direction of the vertical axis in the above embodiment), it can be ensured that the routing is always towards the destination node regardless of the X axis or the Y axis, and there is no routing that deviates from the destination node, that is, the shortest path is always followed.
[0100] Convention 2: To avoid deadlock, further constraints are required on the routing path: When the X direction is completed, the Y direction can only be completed if the agreement 1 is met.
[0101] It is understandable that for a two-dimensional mesh network with a ring topology, deadlock is easy to occur. For example, suppose there are four routing requests at the same time: Request 1: routing node (2,2) to routing node (3,3); Request 2: routing node (2,3) to routing node (3,2); Request 3: routing node (3,3) to routing node (2,2); Request 4: routing node (3,2) to routing node (2,3). When these four routing requests need to pass through a routing node and all choose clockwise routing, and all have occupied the middle routing node, a deadlock occurs, as shown in Figure 1. Figure 6 On the contrary, if both choose counterclockwise routing and both have occupied the middle routing node, a deadlock will also occur, such as Figure 7 shown.
[0102] However, if the above convention 2 is adopted, then no matter for clockwise or counterclockwise, there is a kind of routing that is impossible to occur, and a closed loop cannot be formed, that is, a deadlock cannot be formed, such as Figure 8 shown.
[0103] Convention 3. To increase the diversity of paths: when When , as long as agreement 1 is met, you can freely choose to go along the X-axis or Y-axis according to the current routing node situation; and when agreement 3 is met, when The diversity of routing paths is greatly increased. The diversity of routing paths in the optional embodiments of the present application is specifically explained below through two examples.
[0104] Example 1: Assume that there is a routing request from routing node (0,0) to routing node (2,2). If the traditional XY routing algorithm is used, the routing path is as follows: Fig. 9 As shown, it is fixed and unique. If the routing algorithm provided by the optional embodiment of the present application is: According to agreement 3, under the premise of meeting agreement 1, you can freely choose to go along the X-axis or Y-axis according to the current routing node situation. The routing path is as follows Figure 3 As shown, the paths are more diverse compared with the traditional XY algorithm.
[0105] Example 2: Assume that there is a routing request from routing node (0,2) to routing node (2,0). If the traditional XY routing algorithm is used, the routing path is as follows: Fig.10 As shown, it is fixed and unique. If the routing algorithm of the present invention is used, According to agreement 3, under the premise of meeting agreement 1, you can freely choose to go along the X-axis or Y-axis according to the current routing node situation. The routing path is as follows Fig.11 As shown, the paths are more diverse compared with the traditional XY algorithm.
[0106] It should be noted that, according to convention 3, placing routing nodes according to the following scenarios can better reflect the effect of the routing algorithm provided by the optional embodiment of the present application: the X coordinate of the routing node that frequently sends data packets (equivalent to the message packets in the above embodiment) is as small as possible, and the X coordinate of the routing node that frequently receives data packets is as large as possible, such as Fig.12 shown.
[0107] Agreement 4: When When , routing is performed in the Y-axis direction while meeting convention 1.
[0108] The adaptive XY routing algorithm provided in the optional embodiment of the present application is further explained below through specific implementation steps.
[0109] Step 1: Set a coordinate for each router in the XY coordinate system ,like Figure 5 As shown;
[0110] Step 2: For each routing request, assume that the coordinates of the routing node where the message packet is currently located are The coordinates of the destination node Compare and calculate the difference ;when When , execute step 3; when When , execute step 4; when When , execute step 5;
[0111] Step 3: , execute agreement 2; under the premise of meeting agreement 1, you can only walk in the X direction first and then walk in the Y direction;
[0112] Step 4: , execute agreement 3; however, for whether to go in the X direction or the Y direction, the output port is selected according to the output port of the current routing node; when and hour:
[0113] When the output port in the X-axis direction is not occupied, the X-axis direction is preferred, that is, the XY routing algorithm is followed;
[0114] When the output port in the X-axis direction is occupied, the Y-direction is chosen under the premise of following convention 1;
[0115] Step 5: , execute agreement 4;
[0116] Step 6: Update the coordinates of the routing node where the message packet is currently located.
[0117] In summary, although the hardware implementation of the XY routing algorithm is simple, it is a deterministic routing algorithm, which means that for a pair of destination nodes and source nodes, the routing algorithm can only provide one routing path, and the uniqueness of the path leads to serious network congestion. The optional embodiment of the present application has been improved on the basis of the XY routing algorithm, and an adaptive XY routing algorithm has been proposed, which improves the uniqueness of the XY routing path, can effectively avoid deadlock, and the hardware implementation of the algorithm is simple. It should be noted that the adaptive XY routing algorithm, routing node placement scheme, and hardware and software implementation methods based on the algorithm provided by the optional embodiment of the present application are all within the protection scope of the embodiments of the present application.
[0118] In the present embodiment, a device for determining a routing direction is also provided, and the device is used to implement the above-mentioned embodiment and the preferred implementation mode, and the description thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0119] Fig.13 is a structural block diagram of a device for determining a routing direction according to an embodiment of the present application, such as Fig.13 As shown, the device comprises:
[0120] A response module 1302 is used to determine a coordinate difference between a first coordinate of a target routing node and a second coordinate of a current routing node in response to a routing request, wherein the routing request is used to request that a message packet to be sent be sent from the current routing node to the target routing node;
[0121] An acquisition module 1304 is used to acquire the magnitude relationship between the coordinate difference value and the target value;
[0122] The determination module 1306 is configured to determine a target routing direction from the current routing node to a next routing node from the at least two routing directions corresponding to the current routing node according to the size relationship.
[0123] Through the above-mentioned device, in response to a routing request, the coordinate difference between the first coordinate of the target routing node and the second coordinate of the current routing node is determined, wherein the routing request is used to request that the message packet to be sent be sent from the current routing node to the target routing node; the size relationship between the coordinate difference and the target value is obtained; and the target routing direction from the current routing node to the next routing node is determined from at least two routing directions corresponding to the current routing node according to the size relationship. Therefore, the problem in the prior art that the on-chip network with a two-dimensional grid topology structure adopts a deterministic routing algorithm, and the routing path obtained is unique, which leads to serious network congestion, can be solved. The routing direction from the current routing node to the target routing node is selectable, and the resulting routing path is not unique, which reduces the probability of network congestion.
[0124] In an exemplary embodiment, the determination module 1306 is also used to determine the target routing direction from the current routing node to the next routing node from the at least two routing directions corresponding to the current routing node when the size relationship indicates that the horizontal coordinate difference is greater than the target value, or the vertical coordinate difference is greater than the target value, wherein the coordinate difference includes: the horizontal coordinate difference and the vertical coordinate difference; when the size relationship indicates that the horizontal coordinate difference is less than the target value, or the vertical coordinate difference is less than the target value, determine the target routing direction from the current routing node to the next routing node from the at least two routing directions corresponding to the current routing node.
[0125] In an exemplary embodiment, the response module 1302 is further used to determine a first horizontal coordinate and a first vertical coordinate included in the first coordinate; and to determine a second horizontal coordinate and a second vertical coordinate included in the second coordinate; calculate the horizontal coordinate difference between the first horizontal coordinate and the second horizontal coordinate, and calculate the vertical coordinate difference between the first vertical coordinate and the second vertical coordinate; and determine the horizontal coordinate difference and the vertical coordinate difference as the coordinate difference.
[0126] In an exemplary embodiment, the determination module 1306 is also used to determine the positive direction of the horizontal axis as the first routing direction when the horizontal coordinate difference is greater than the target value; determine the positive direction of the vertical axis or the negative direction of the vertical axis as the second routing direction according to the relationship between the vertical coordinate difference and the target value; determine the port occupancy of the first output port and the second output port, wherein the first output port is the output port of the current routing node in the first routing direction, and the second output port is the output port of the current routing node in the second routing direction; determine the target routing direction according to the port occupancy.
[0127] In an exemplary embodiment, the determination module 1306 is also used to calculate the size relationship between the vertical coordinate difference and the target value; when the size relationship indicates that the vertical coordinate difference is greater than the target value, the positive direction of the vertical axis is determined as the second routing direction; when the size relationship indicates that the vertical coordinate difference is less than the target value, the negative direction of the vertical axis is determined as the second routing direction.
[0128] In an exemplary embodiment, the determination module 1306 is further used to determine the port occupancy of the first output port and the second output port in one of the following ways: sending a first test data packet to the first routing node through the first output port, and sending a second test data packet to the second routing node through the second output port; determining the port occupancy of the first output port and the second output port according to a first response of the first routing node to the first test data packet and a second response of the second routing node to the second test data packet, wherein the first routing node is the routing node with the smallest coordinate distance from the current routing node in the first routing direction, and the second routing node is the routing node with the smallest coordinate distance from the current routing node in the second routing direction; querying the status information of the first output port and the second output port in the routing table, and determining the port occupancy according to the status information; querying the first node status of the first routing node and the second node status of the second routing node, and determining the port occupancy according to the first node status and the second node status, wherein the first routing node is the routing node with the smallest coordinate distance from the current routing node in the first routing direction, and the second routing node is the routing node with the smallest coordinate distance from the current routing node in the second routing direction.
[0129] In an exemplary embodiment, the determination module 1306 is further used to determine the second routing direction as the target routing direction when the port occupancy status indicates that the first output port is occupied and the second output port is not occupied; determine the first routing direction as the target routing direction when the port occupancy status indicates that the first output port is not occupied and the second output port is occupied; and determine the routing direction included in the preset priority routing direction as the target routing direction, or determine the first routing direction or the second routing direction as the target routing direction, when the port occupancy status indicates that both the first output port and the second output port are not occupied.
[0130] In an exemplary embodiment, the device also includes an update module for sending the message packet to be sent to the next routing node according to the target routing direction; when it is determined that the next routing node has successfully received the message packet to be sent, the next routing node is updated to the current routing node, and the new target routing direction is continued to be determined.
[0131] In an exemplary embodiment, the determination module 1306 is also used to obtain the traffic load condition of the on-chip network at a first time; when the traffic load condition at the first time is greater than a preset threshold, the target routing direction from the current routing node to the next routing node is re-determined from the at least two routing directions; the re-determined target routing direction is determined as the routing direction of the on-chip network from the current routing node to the next routing node at a second time, wherein the second time is later than the first time.
[0132] In an exemplary embodiment, the determination module 1306 is further configured to determine a plurality of routing paths from the current routing node to the target routing node in the target routing direction; and determine a target routing path without a risk of congestion among the plurality of routing paths.
[0133] In an exemplary embodiment, the determination module 1306 is also used to determine the time window required for the message packet to be sent from the current routing node to the target routing node; determine a passable routing path among the multiple routing paths within the time window, wherein the passable routing path is a routing path without congestion risk; and determine the target routing path from the passable routing paths.
[0134] In an exemplary embodiment, the determination module 1306 is also used to determine the number of nodes that the message packet to be sent passes through in the process of sending the message packet to be sent from the current routing node to the target routing node according to the routing request, and determine the sending time required for each hop of the message packet to be sent, wherein the passed nodes include: intermediate nodes and the target routing node; the product of the sending time and the number of nodes is determined as the time window.
[0135] In an exemplary embodiment, the determination module 1306 is also used to: for each routing path in the multiple routing paths: obtain node broadcast messages of multiple routing nodes included on each routing path, wherein the node broadcast message at least includes: routing node occupancy information, and an occupancy time window corresponding to the routing node occupancy information; determine a sub-time window corresponding to the time window for each routing node in the multiple routing nodes, wherein the number of the multiple routing nodes is the same as the number of sub-time windows included in the time window; and determine that each routing path is a passable routing path when the occupancy time window of each routing node does not overlap with the sub-time window.
[0136] In an exemplary embodiment, the determination module 1306 is further used to determine the target routing path from the passable routing paths in one of the following ways: selecting any passable routing path among the passable paths as the target routing path; obtaining third coordinates of multiple nodes included in each of the passable paths, determining the number of coordinates in which the horizontal coordinate is greater than the vertical coordinate among the multiple third coordinates, and determining the passable routing path whose coordinate number meets the preset rule as the target routing path.
[0137] In an exemplary embodiment, the determination module 1306 is also used to obtain the sum of the first horizontal coordinate and the first vertical coordinate of the first coordinate to obtain a first value, and to obtain the sum of the first horizontal coordinate and the second vertical coordinate of the second coordinate to obtain a second value; and determine the difference between the first value and the second value as the number of nodes.
[0138] In an exemplary embodiment, the determination module 1306 is also used to perform one of the following: reading the historical sending time recorded in the historical sending log, and determining the historical sending time as the sending time; monitoring the on-chip network through a network monitoring tool to determine the real-time sending time of the message packet being sent on the on-chip network, and determining the real-time sending time as the sending time; obtaining the historical sending time, and obtaining the real-time sending time; determining the larger value between the historical sending time and the real-time sending time; determining the larger value as the sending time, wherein the historical sending time is the historical sending time recorded in the historical sending log, and the real-time sending time is the real-time sending time obtained by monitoring the message packet being sent on the on-chip network through the network monitoring tool.
[0139] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0140] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0141] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0142] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0143] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0144] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0145] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining a routing direction, characterized in that: include: In response to a routing request, determining a coordinate difference between a first coordinate of a target routing node and a second coordinate of a current routing node, wherein the routing request is used to request that a message packet to be sent be sent from the current routing node to the target routing node; Obtaining the magnitude relationship between the coordinate difference value and the target value; According to the size relationship, a target routing direction from the current routing node to the next routing node is determined from at least two routing directions corresponding to the current routing node, wherein: Determining a target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship includes: when the size relationship indicates that the horizontal coordinate difference is greater than the target value, determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node, wherein the coordinate difference includes: a horizontal coordinate difference; wherein, In the case where the horizontal coordinate of the position of the routing node that frequently sends message packets is smaller and the horizontal coordinate of the position of the routing node that frequently receives message packets is larger, determining the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node includes: When the horizontal coordinate difference is greater than the target value, the positive direction of the horizontal axis is determined as the first routing direction; Determining the positive direction of the longitudinal axis or the negative direction of the longitudinal axis as the second routing direction according to the magnitude relationship between the longitudinal coordinate difference and the target value; Determine port occupancy of a first output port and a second output port, wherein the first output port is an output port of the current routing node in the first routing direction, and the second output port is an output port of the current routing node in the second routing direction; The target routing direction is determined according to the port occupancy, wherein: When the horizontal coordinate difference is less than the target value, a deterministic routing method is used to determine the target routing direction.
2. The method according to claim 1, characterized in that Determining the positive direction of the longitudinal axis or the negative direction of the longitudinal axis as the second routing direction according to the magnitude relationship between the longitudinal coordinate difference and the target value includes: Calculate the magnitude relationship between the ordinate difference and the target value; In a case where the magnitude relationship indicates that the longitudinal coordinate difference is greater than the target value, determining the positive direction of the longitudinal axis as the second routing direction; In a case where the magnitude relationship indicates that the longitudinal coordinate difference is smaller than the target value, the negative direction of the longitudinal axis is determined as the second routing direction.
3. The method according to claim 1, characterized in that Determining the port occupancy of the first output port and the second output port includes one of the following methods: Sending a first test data packet to a first routing node through the first output port, and sending a second test data packet to a second routing node through the second output port; determining port occupancy of the first output port and the second output port according to a first response of the first routing node to the first test data packet and a second response of the second routing node to the second test data packet, wherein the first routing node is a routing node with the smallest coordinate distance to the current routing node in the first routing direction, and the second routing node is a routing node with the smallest coordinate distance to the current routing node in the second routing direction; Querying the state information of the first output port and the second output port in the routing table, and determining the port occupancy status according to the state information; Query the first node status of the first routing node and the second node status of the second routing node, and determine the port occupancy status according to the first node status and the second node status, wherein the first routing node is the routing node with the smallest coordinate distance to the current routing node in the first routing direction, and the second routing node is the routing node with the smallest coordinate distance to the current routing node in the second routing direction.
4. The method according to claim 1, characterized in that: Determining the target routing direction according to the port occupancy condition includes: When the port occupancy status indicates that the first output port is occupied and the second output port is not occupied, determining the second routing direction as the target routing direction; When the port occupancy status indicates that: the first output port is not occupied, and the second output port is occupied, determining the first routing direction as the target routing direction; When the port occupancy status indicates that neither the first output port nor the second output port is occupied, a routing direction included in a preset priority routing direction is determined as the target routing direction, or the first routing direction or the second routing direction is determined as the target routing direction.
5. The method according to claim 1, characterized in that: After determining a target routing direction from the current routing node to a next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method further includes: Sending the message packet to be sent to the next routing node according to the target routing direction; When it is determined that the next routing node has successfully received the message packet to be sent, the next routing node is updated as the current routing node, and a new target routing direction is continued to be determined.
6. The method according to claim 1, characterized in that After determining a target routing direction from the current routing node to a next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method further includes: Obtain the traffic load of the on-chip network in the first place; When the traffic load at the first time is greater than a preset threshold, re-determining a target routing direction from the current routing node to a next routing node from the at least two routing directions; The re-determined target routing direction is determined as a routing direction of the on-chip network from the current routing node to the next routing node at a second time, wherein the second time is later than the first time.
7. The method according to claim 1, characterized in that After determining a target routing direction from the current routing node to a next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, the method further includes: Determining a plurality of routing paths from the current routing node to the target routing node in the target routing direction; A target routing path without a risk of congestion is determined among the multiple routing paths.
8. The method according to claim 7, characterized in that Determining a target routing path without a risk of congestion among the plurality of routing paths includes: Determine a time window required for the to-be-sent message packet to be sent from the current routing node to the target routing node; Determining a traversable routing path among the plurality of routing paths within the time window, wherein the traversable routing path is a routing path without a risk of congestion; The target routing path is determined from the available routing paths.
9. The method according to claim 8, characterized in that Determining a time window required for the to-be-sent message packet to be sent from the current routing node to the target routing node includes: Determine, according to the routing request, the number of nodes that the message packet to be sent passes through in the process of sending the message packet from the current routing node to the target routing node, and determine the sending time required for each hop of the message packet to be sent, wherein the passed nodes include: intermediate nodes and the target routing node; The product of the sending time and the number of nodes is determined as the time window.
10. The method according to claim 8, characterized in that Determining a navigable routing path among the plurality of routing paths within the time window includes: For each routing path in the plurality of routing paths: Acquire node broadcast messages of multiple routing nodes included in each routing path, wherein the node broadcast message at least includes: routing node occupancy information, and an occupancy time window corresponding to the routing node occupancy information; Determine a sub-time window corresponding to each routing node in the time window, wherein the number of the multiple routing nodes is the same as the number of sub-time windows included in the time window; In a case where the occupied time window of each routing node does not overlap with the sub-time window, each routing path is determined to be a passable routing path.
11. The method according to claim 8, characterized in that Determining the target routing path from the passable routing paths includes: Determine the target routing path from the available routing paths by one of the following methods: Select any traversable routing path among the traversable paths as the target routing path; The third coordinates of the multiple nodes included in each of the passable paths are obtained, the number of coordinates whose horizontal coordinates are greater than the vertical coordinates in the multiple third coordinates is determined, and the passable routing path whose number of coordinates meets the preset rule is determined as the target routing path.
12. The method according to claim 9, characterized in that Determining, according to the routing request, the number of nodes through which the message packet to be sent passes in the process of sending the message packet to be sent from the current routing node to the target routing node, includes: Obtaining the sum of the first abscissa and the first ordinate of the first coordinate to obtain a first value, and obtaining the sum of the first abscissa and the second ordinate of the second coordinate to obtain a second value; The difference between the first value and the second value is determined as the number of nodes.
13. The method according to claim 9, characterized in that Determining the sending time required for each hop of the message packet to be sent includes one of the following: Read the historical sending time recorded in the historical sending log, and determine the historical sending time as the sending time; Monitoring the on-chip network by a network monitoring tool to determine the real-time sending time of the message packet being sent on the on-chip network, and determining the real-time sending time as the sending time; Get historical sending time and real-time sending time; Determine the larger value between the historical sending time and the real-time sending time; determine the larger value as the sending time, wherein the historical sending time is the historical sending time recorded in the historical sending log, and the real-time sending time is the real-time sending time obtained by monitoring the message packets being sent on the on-chip network through a network monitoring tool.
14. A device for determining a routing direction, characterized in that: include: A response module, configured to determine a coordinate difference between a first coordinate of a target routing node and a second coordinate of a current routing node in response to a routing request, wherein the routing request is used to request that a message packet to be sent be sent from the current routing node to the target routing node; An acquisition module, used for acquiring the magnitude relationship between the coordinate difference value and the target value; A determination module is used to determine a target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node according to the size relationship, wherein: The determination module is further used to determine the target routing direction from the current routing node to the next routing node from at least two routing directions corresponding to the current routing node when the magnitude relationship indicates that the horizontal coordinate difference is greater than the target value, wherein the coordinate difference includes: the horizontal coordinate difference; wherein, When the horizontal coordinate of the position of the routing node that frequently sends message packets is smaller, and the horizontal coordinate of the position of the routing node that frequently receives message packets is larger, the determination module is further used to determine the positive direction of the horizontal axis as the first routing direction when the horizontal coordinate difference is greater than the target value; Determining the positive direction of the longitudinal axis or the negative direction of the longitudinal axis as the second routing direction according to the magnitude relationship between the longitudinal coordinate difference and the target value; Determine port occupancy of a first output port and a second output port, wherein the first output port is an output port of the current routing node in the first routing direction, and the second output port is an output port of the current routing node in the second routing direction; The target routing direction is determined according to the port occupancy, wherein: When the horizontal coordinate difference is less than the target value, a deterministic routing method is used to determine the target routing direction.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 13 when executed by a processor.
16. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
Packet-circuit exchanging on-chip router oriented rollback steering routing algorithm and router used thereby
CN101834789A
Routing path determination method and device, control equipment and storage medium
CN112003787A
Data packet routing method, processor and readable storage medium
CN116915708A
Routing method and device for dual-path wireless mesh network, equipment and storage medium
CN117395746A
