FPGA routing method to improve routing efficiency by inserting routing relay points
By inserting winding relay points during FPGA wiring, the problem of low routing efficiency caused by resource sharing conflicts is solved, and a more efficient routing process and a lower failure rate is achieved.
Patent Information
- Application Number
- CN202111553434.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2041-12-17
AI Technical Summary
During the FPGA wiring process, the prior art is difficult to effectively resolve resource sharing conflicts, resulting in low wiring efficiency and long running time, which may lead to wiring failure.
By inserting the winding relay point, the wiring path of the wire network must pass through the relay point, thereby avoiding areas with high resource conflicts and bypassing to surrounding areas, reducing the demand for areas with high resource conflicts.
Effectively reduce the number of signals passing through high resource conflict areas, reduce the difficulty of conflict resolution, improve wiring efficiency, and ensure the successful completion of the wiring process.
Smart Images

Figure CN114297960B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of FPGA, and in particular to an FPGA wiring method for improving wiring efficiency by inserting a winding relay point. Background Art
[0002] FPGA routing is the process of connecting the occupied logic units using the device's programmable interconnection resources after the chip is laid out. When routing the FPGA, it is generally necessary to abstract the programmable logic resources on the FPGA, including the interconnection resources, into a wiring diagram. The wiring diagram has representations of all underlying modules, architectures, and interconnection resources. Then, a signal to be processed is selected in a predetermined order, and the source and destination module locations related to the signal are found according to the chip layout results. The wiring diagram is searched using a wiring algorithm such as a congestion negotiation algorithm to find unoccupied resources to obtain a routing path from the source to the destination. If no path with completely unoccupied resources is found, the routing path of this signal can be obtained by forcibly using resources that have been occupied by other signals. At this time, the resource is repeatedly occupied by multiple signals to form a conflict, and the conflict needs to be resolved later. The routing path used by this signal is recorded on the wiring diagram, and the corresponding resource is marked as occupied. The above process is repeated until all signals have a routing path, and then the signals with duplication or conflict are rerouted to resolve the conflict until there is no conflict in which the routing resources are reused by multiple signals to obtain the routing result.
[0003] The commonly used FPGA routing algorithm is the congestion negotiation algorithm, which is as follows. Please combine Figure 1 The process shown:
[0004] (1) Create a wiring diagram and read in the user design netlist and constraints.
[0005] (2) Select the network N in the user design netlist that does not have a connection tree or has a node in the existing connection tree that involves resource sharing conflicts. i If the line network N i If the tree is not connected yet, directly execute the following step (3). i If there is already a connection tree containing nodes involved in resource sharing conflicts, then the line network N i All existing connection trees are removed and cleared for rewiring, and then step (3) is executed.
[0006] (3) Set the wire network N i The source point i Put in connection tree RT i Middle pair connection tree RT i initialization.
[0007] (4) Initialize the priority queue PQ (PrioritQueue) and set it to the connection tree RT i , set the routing cost of all nodes in the priority queue PQ to 0. In the first cycle, the connection tree RT i There is only source point s i , so there is only source point s in the priority queue PQ i .
[0008] (5) Remove the node m with the lowest wiring cost from the priority queue PQ and check whether the node m is a node in the network N. i destination point.
[0009] (6) If node m is not a network N i The destination point t ij , traverse all fan-out nodes n of node m and add them to PQ, and determine the routing cost cost of each fan-out node n as cost = cn + Pim, where cn is the node cost of the fan-out node n and Pim is the source point s i The total cost to node m is expressed as the path cost of the fan-out node n. Re-execute step (4).
[0010] (7) If node m is a network N i The destination point t ij , then the destination point t ij (Point m) traces back to the source point s i , update the node cost cn of all nodes on the path, and add all nodes on the path to the network N i Connection Tree RT i Update the connection tree RT i , execute steps (3) to (4) again until the network N is found i When updating the node cost cn, it is generally updated based on the number of shared conflicts, the length of the routing resources, the timing redundancy, etc. of the node.
[0011] In the above method, the node cost cn of the node with resource sharing conflict increases cumulatively, so it is less likely to be selected as a path when searching for a new routing path, which can reduce the probability of resource sharing conflict. Repeat the above (2) to (7) to traverse each wire net in the user design netlist that has not been routed or has routing path conflicts, and iterate until the conflict is eliminated, all wire nets in the user design netlist are routed, and there is no resource sharing conflict between all connection trees. When the congestion is too high and the number of resource sharing conflicts is large, the wire nets involved in the resource sharing conflict may not be able to find unoccupied resources and are difficult to separate, and the conflict cannot be eliminated; or the congestion negotiation progresses slowly, causing the operation to time out or the number of iterations to reach the set threshold, which will lead to routing failure. Routing takes up a lot of running time in the FPGA application development process. The quality and efficiency of routing directly affect the application development efficiency and user experience. Summary of the invention
[0012] In view of the above problems and technical requirements, the inventors have proposed an FPGA wiring method for improving wiring efficiency by inserting a wiring relay point. The technical solution of the present invention is as follows:
[0013] An FPGA routing method for improving routing efficiency by inserting a routing relay point, the method comprising:
[0014] In the process of implementing routing for each net in the user input netlist using a preset routing algorithm, when the routing iteration process for the user input netlist reaches a predetermined condition, the number of resource conflicts for each region in the FPGA is determined according to the current connection tree of each net, each region includes a number of routing resource nodes, and the number of resource conflicts for the region reflects the situation that each routing resource node in the current region is shared by multiple nets to form a resource conflict;
[0015] Select the area to be processed with serious resource conflicts based on the number of resource conflicts in each area;
[0016] For the wire nets that occupy the wiring resource nodes with resource conflicts inside the to-be-processed area and are related to the to-be-processed area, the corresponding relay points are selected outside the to-be-processed area as newly added destination points and added to the wire nets, so that in the process of searching and routing the wire nets using the preset routing algorithm, the order of relay points is between the wire net endpoints at both ends of the edge that crosses the to-be-processed area in the wire net, and the relay points are unoccupied wiring resource nodes, wherein the wire net endpoints are the source points or destination points of the wire nets;
[0017] Based on the updated nets, the preset routing algorithm is continued to be used to iterate the routing of the user input netlist until the number of resource conflicts in all areas is 0.
[0018] A further technical solution is to select a corresponding relay point outside the area to be processed, including:
[0019] Determine a strip area outside the to-be-processed area that includes a predetermined number of rows and columns of wiring resource nodes as a candidate area;
[0020] From the unoccupied wiring resource nodes in the candidate area, wiring resource nodes whose connections with the wire network endpoints at both ends of the edge crossing the area to be processed in the wire network do not pass through the area to be processed are selected as corresponding relay points.
[0021] Its further technical solution is that if there are at least two unoccupied wiring resource nodes in the candidate area, both of which satisfy the condition that the lines connecting the wire network endpoints at both ends of the edge crossing the area to be processed do not pass through the area to be processed, then a wiring resource node whose sum of distances to the lines connecting the wire network endpoints at both ends of the edge crossing the area to be processed is the smallest is selected as the corresponding relay point.
[0022] A further technical solution is that the candidate regions corresponding to the various line meshes related to the area to be processed are all the same, or there are at least two line meshes corresponding to different candidate regions.
[0023] A further technical solution is that the relay point is an unoccupied input terminal of a switch box and a line segment connected thereto, or the relay point is an unoccupied output terminal of a switch box and a line segment connected thereto, or the relay point is an unoccupied output terminal of a lookup table.
[0024] A further technical solution is to insert corresponding relay points into all the wire nets related to the area to be processed, or to insert corresponding relay points into some of the wire nets.
[0025] A further technical solution is to search for relay points for all the wire nets related to the area to be processed in a predetermined order when there are at least two wire nets related to the area to be processed, or to search for relay points for some wire nets related to the area to be processed in a predetermined order.
[0026] A further technical solution is that the predetermined order is the order from largest to smallest number of destination points contained in the wire network.
[0027] A further technical solution is that the predetermined order is the order of the distances between the endpoints of the wire mesh at both ends of the edge that crosses the area to be processed in the wire mesh from large to small.
[0028] A further technical solution is to select areas with serious resource conflicts to be processed based on the number of resource conflicts in each area, including:
[0029] All regions whose resource conflicts reach the conflict number threshold are taken as regions to be processed, or several regions whose resource conflicts reach the conflict number threshold and are the largest are taken as regions to be processed.
[0030] Its further technical solution is that when the number of global iterations reaches a predetermined number of iterations, it is determined that the routing iteration process of the user input netlist has reached a predetermined condition, wherein one routing for a net in the user input netlist is a global iteration, and one routing for a net includes initial routing for the net, or removing the existing routing of the net and rewinding it.
[0031] The beneficial technical effects of the present invention are:
[0032] The present application discloses an FPGA wiring method for improving wiring efficiency by inserting a wiring relay point. The method adds an intervention step in the wiring iteration process, selects a portion of the wire network that passes through the area with high resource conflicts, and inserts a relay point at a specific position to force the wiring path of the wire network to pass through the relay point, thereby avoiding the area with high resource conflicts and bypassing the surrounding area. This approach can effectively reduce the number of signals passing through the area with high resource conflicts, reduce the demand for wiring resources in the area, make conflicts easier to resolve, thereby improving wiring efficiency, speeding up wiring completion, or enabling a wiring process that might have failed to successfully obtain wiring results. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flowchart of FPGA routing using the existing congestion negotiation algorithm.
[0034] Figure 2 It is a flowchart of the FPGA wiring method of the present application.
[0035] Figure 3 It is a schematic diagram of the relationship between the relay points selected in the candidate area and the line network endpoints at both ends of the edge across the area to be processed in the line network. DETAILED DESCRIPTION
[0036] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0037] This application discloses an FPGA wiring method for improving wiring efficiency by inserting a wiring relay point. Please refer to Figure 2As shown in the flowchart, before the FPGA is wired, the positions of all the endpoints of each original net can be determined based on the layout results of the FPGA. The net endpoints include a source point (Source) and several destination points (Target) connected to it. Then, based on the layout results and in combination with the wiring diagram, the preset wiring algorithm can be used to wire each net in the user-input netlist. The conventional practice is as described in the background technology section, and it is continuously iterated until the conflict is eliminated. The main difference between the present application and the conventional practice is that the iterative process of the conventional wiring is intervened by inserting a winding relay point in the net, so the wiring method of the present application is implemented based on the existing preset wiring algorithm, which can be considered as an improvement on the existing preset wiring algorithm. The existing preset wiring algorithms are relatively typical, including the congestion negotiation wiring algorithm and the Lee's maze wiring algorithm.
[0038] Regardless of the routing process using the preset routing algorithm, the FPGA routing method of the present application, in the process of routing each wire net in the user input netlist using the preset routing algorithm, when the routing iteration process of the user input netlist reaches a predetermined condition, triggers the operation of inserting a winding relay point and continues to iterate.
[0039] Among them, when the number of global iterations reaches the predetermined number of iterations, it is determined that the routing iteration process of the user input netlist has reached the predetermined condition, and the operation of inserting a winding relay point is triggered. In the present application, a global iteration is defined as a wiring implementation for a wire net in the user input netlist. A wiring implementation for a wire net includes the process of performing initial wiring on the wire net, or the process of removing the existing wiring of the wire net and rewinding the wire. When the number of global iterations reaches the predetermined number of iterations, at least the initial wiring of all wire nets has been completed. Since when wiring the FPGA, it is generally necessary to perform an initial wiring on all wire nets first, and then rewind the wire nets with conflicts, the predetermined number of iterations is at least the number of wire nets. There are three common situations: (1) The predetermined number of iterations is the number of wire nets, that is, after the initial wiring of all wire nets is completed, the operation of inserting a winding relay point is triggered in each subsequent global iteration process. (2) The predetermined number of iterations is greater than the number of wire nets but less than the predetermined iteration threshold. Generally, a predetermined iteration threshold is set during FPGA routing. If the conflict is still not resolved when the global iteration number reaches the iteration threshold, the iteration will not continue but the routing is determined to have failed. The predetermined number of iterations can be set to any suitable value that does not reach the predetermined iteration threshold, and the operation of inserting a wiring relay point is triggered in each subsequent global iteration process. (3) When the predetermined number of iterations is the predetermined iteration threshold, as in case (2), the conventional global iteration number reaches the predetermined iteration threshold and the wiring is still not completed, then the wiring is determined to have failed. However, in the present application, after the global iteration number reaches the predetermined iteration threshold, by triggering the operation of inserting a wiring relay point, it is possible to resolve the conflict later, thereby enabling successful routing. In this case, it can be considered that the subsequent process of triggering the operation of inserting a wiring relay point and iterating is a process after the end of the conventional routing process, and it is usually also necessary to set another threshold for the number of iterations.
[0040] Regardless of the specific triggering conditions, the operation of triggering the insertion of the winding relay point is as follows:
[0041] 1. Determine the number of resource conflicts in each area of the FPGA based on the current connection tree of each network. Each area contains a number of routing resource nodes. The FPGA is pre-divided into several areas, each area contains a number of programmable logic resources inside the FPGA, such as CLBs containing a number of rows and columns. The size of each area and the number and type of programmable logic resources contained can be the same or different.
[0042] As described in the background technology section, in the iterative routing process, after obtaining a connection tree of a wire net, the number of shared conflicts of the routing resource nodes (programmable logic resources) involved in the connection tree will be updated, so that the number of shared conflicts of each programmable logic resource is known. The number of resource conflicts of all programmable logic resources in a region can be used to determine the number of resource conflicts in the region. The number of resource conflicts in the region reflects the situation in which each routing resource node in the current region is shared by multiple wire nets and resource conflicts are formed. The larger the number of resource conflicts in the region and the more serious the resource conflicts in the region, the more difficult it is to resolve the conflicts through congestion negotiation. The sum of the number of shared conflicts of all programmable logic resources in a region is taken as the number of resource conflicts in the region, or the maximum value / average value / median value of the number of shared conflicts of all programmable logic resources in a region can be taken as the number of resource conflicts in the region.
[0043] 2. Select the areas to be processed with serious resource conflicts based on the number of resource conflicts in each area. All areas with resource conflicts reaching the conflict number threshold are taken as areas to be processed, or several areas with the largest number of resource conflicts reaching the conflict number threshold are taken as areas to be processed. That is, for example, if the number of resource conflicts in Ns areas reaches the conflict number threshold, all Ns areas can be taken as areas to be processed, or only the largest Nc areas can be selected as areas to be processed and the rest will not be processed, Nc<Ns.
[0044] For each of the selected areas to be processed, the following step 3 is executed. When multiple areas to be processed are selected, the areas to be processed can generally be processed in order from the largest to the smallest number of resource conflicts.
[0045] 3. Determine the wire nets that occupy the wiring resource nodes with resource conflicts within the area to be processed and are related to the area to be processed. In actual applications, there may be one or more wiring resource nodes with resource conflicts in an area to be processed, and each wiring resource node with resource conflicts may be occupied by one or more wire nets, which generally results in the existence of multiple wire nets related to the area to be processed.
[0046] When there are at least two wire nets related to the area to be processed, in one embodiment, all wire nets related to the area to be processed are processed starting from the following step 4 in a predetermined order. In another embodiment, some wire nets related to the area to be processed are processed starting from the following step 4 in a predetermined order. The predetermined order can be customized according to the actual wiring needs. In one embodiment, the predetermined order is the order of the number of destination points contained in each wire net from large to small, that is, the wire nets related to the area to be processed and containing more destination points are processed first. In another embodiment, the predetermined order is the order of the distance between the wire net endpoints at both ends of the edge across the area to be processed in the wire net from large to small. For example, the wire net endpoint A and the wire net endpoint B in the wire net are the two wire net endpoints located outside the area to be processed and closest to the area to be processed in the wire net. The path between the wire net endpoint A and the wire net endpoint B crosses the area to be processed and occupies the wiring resource nodes with resource conflicts in the area to be processed. Then the wire net endpoint A to the wire net endpoint B are the wire net endpoints at both ends of the edge across the area to be processed in the wire net.
[0047] 4. For a line network related to the area to be processed, select the corresponding relay point outside the area to be processed as a new destination point and add it to the line network. Specifically include:
[0048] (1) Determine a strip area outside the area to be processed that contains a predetermined number of rows and columns of wiring resource nodes as a candidate area, such as Figure 3 The shaded area is the candidate area. The candidate areas corresponding to the wire meshes related to the same area to be processed are the same, or at least two wire meshes correspond to different candidate areas. The candidate areas corresponding to the wire meshes related to different areas to be processed are the same or different.
[0049] (2) From the unoccupied wiring resource nodes in the candidate area, wiring resource nodes whose connections with the wire network endpoints at both ends of the edge crossing the area to be processed in the wire network do not pass through the area to be processed are selected as corresponding relay points.
[0050] In the above example, the network endpoint A to the network endpoint B are the network endpoints at both ends of the edge across the area to be processed. This step also requires selecting an unoccupied wiring resource node from the candidate area as the relay point C, so that the path from the network endpoint A to the relay point C does not pass through the area to be processed, and the path from the relay point C to the network endpoint B does not pass through the area to be processed. The network endpoints at both ends of the edge across the area to be processed have no specific relationship with the candidate area, and can be in the candidate area or outside the candidate area, for example Figure 3 Take the example where both the network endpoints A and B are outside the candidate area.
[0051] (3) Insert the relay point C as a newly added destination point into the destination point list of the wire network and add it to the wire network, so that in the process of searching and routing the wire network using the preset routing algorithm, the order of expanding the relay points is between the wire network endpoints at both ends of the edge of the wire network that crosses the area to be processed. For example, in the above example, the relay point C is inserted into the destination point list of the wire network and is located between the wire network endpoint A and the wire network endpoint B, so that when the search path is expanded for the wire network, the order of expansion is A, C, B, so that overall, a routing path from the wire network endpoint A to the wire network endpoint B is still formed, and the original routing path of the wire network is not affected.
[0052] However, due to the addition of relay point C, the path between the network endpoint A and the network endpoint B in the original connection tree, which passes through the area to be processed, can be changed to a path between the network endpoint A and the relay point C and the relay point C and the network endpoint B, which do not pass through the area to be processed. This forces the wiring path in the network to pass through the relay point and bypass the area to be processed to the candidate area, so as to reduce the number of signals passing through the area to be processed with serious resource conflicts, making it easier to resolve conflicts.
[0053] In the above process, the selected relay point is the unoccupied input end of the switch box and the line segment connected thereto, or the relay point is the unoccupied output end of the switch box and the line segment connected thereto, or the relay point is the unoccupied output end of the lookup table.
[0054] When selecting relay points for a network related to the area to be processed, there are several different situations:
[0055] (1) If there is only one unoccupied wiring resource node in the candidate area that satisfies the condition that the lines connecting the wiring network endpoints at both ends of the edge crossing the area to be processed in the wiring network do not pass through the area to be processed, then the wiring resource node that meets the condition is directly added to the wiring network as a relay point.
[0056] (2) There are at least two unoccupied wiring resource nodes in the candidate area that satisfy the condition that the lines connecting the wire net endpoints at both ends of the edge crossing the area to be processed in the wire net do not pass through the area to be processed, then a wiring resource node that minimizes the sum of the distances between the wire net endpoints at both ends of the edge crossing the area to be processed is selected as the corresponding relay point. For example, in the above example, for each wiring resource node that meets the conditions, the length of the path between the wire net endpoint A and the wiring resource node is determined to be Dist1, and the length of the path between the wiring resource node and the wire net endpoint B is determined to be Dist2, then the wiring resource node that minimizes Dist1+Dist2 is selected as the relay point C.
[0057] (3) If there is no unoccupied wiring resource node in the candidate area and the connection between the line network endpoints at both ends of the edge crossing the area to be processed in the line network does not pass through the area to be processed, the processing of the line network is completed and it is determined that there is no corresponding relay point in the line network.
[0058] Therefore, in the method of the present application, even if the operation of searching for relay points is performed on all the wire networks related to the area to be processed, it is not necessarily possible for each wire network to find the corresponding qualified relay point. Therefore, after the operation is completed for all the wire networks related to the area to be processed that need to perform the operation of searching for relay points, one situation is that the corresponding relay points can be inserted into all the wire networks related to the area to be processed respectively, or, another situation is that the corresponding relay points can only be inserted into some of the wire networks.
[0059] 5. After completing the operations of inserting corresponding relay points and adding destination points for all the wire nets that need to be processed within all the areas to be processed in the above steps 3 and 4, continue to perform global iterations, and continue to use the preset routing algorithm to iterate the routing of the user input netlist based on the updated wire nets. Repeat the above operations until the number of resource conflicts in all areas is 0.
Claims
1. An FPGA wiring method for improving wiring efficiency by inserting a wiring relay point, characterized in that: The method comprises: In the process of implementing routing for each wire net in the user input netlist using a preset routing algorithm, when the routing iteration process of the user input netlist reaches a predetermined condition, the number of resource conflicts for each region in the FPGA is determined according to the current connection tree of each wire net, each region includes a number of routing resource nodes, and the number of resource conflicts for the region reflects the situation that each routing resource node in the current region is shared by multiple wire nets to form a resource conflict; Select the area to be processed with serious resource conflicts based on the number of resource conflicts in each area; For the wire nets that occupy the wiring resource nodes with resource conflicts inside the to-be-processed area and are related to the to-be-processed area, the corresponding relay points are selected outside the to-be-processed area as newly added destination points and added to the wire nets, so that in the process of searching and routing the wire nets using the preset routing algorithm, the order of expanding the relay points is between the wire net endpoints at both ends of the edge of the to-be-processed area in the wire net, and the relay points are unoccupied wiring resource nodes, wherein the wire net endpoints are the source points or destination points of the wire nets; Based on the updated nets, continue to use the preset routing algorithm to iterate the routing of the user input netlist until the number of resource conflicts in all regions is 0; The selecting of the corresponding relay point outside the area to be processed comprises: determining a strip area outside the area to be processed that includes a predetermined number of rows and columns of wiring resource nodes as a candidate area; and selecting, from the unoccupied wiring resource nodes in the candidate area, wiring resource nodes whose connections with the wire network endpoints at both ends of the edge of the wire network crossing the area to be processed do not pass through the area to be processed as corresponding relay points.
2. The method according to claim 1, characterized in that If there are at least two unoccupied wiring resource nodes in the candidate area, both of which satisfy the condition that the lines connecting the wire network endpoints at both ends of the edge crossing the area to be processed in the wire network do not pass through the area to be processed, then a wiring resource node that has the smallest sum of distances to the lines connecting the wire network endpoints at both ends of the edge crossing the area to be processed is selected as the corresponding relay point.
3. The method according to claim 1, characterized in that The candidate regions corresponding to the line meshes related to the area to be processed are all the same, or there are at least two line meshes corresponding to different candidate regions.
4. The method according to claim 1, characterized in that: The relay point is an unoccupied input terminal of the switch box and the line segment connected thereto, or the relay point is an unoccupied output terminal of the switch box and the line segment connected thereto, or the relay point is an unoccupied output terminal of the lookup table.
5. The method according to claim 1, characterized in that Corresponding relay points are respectively inserted into all the wire nets related to the area to be processed, or corresponding relay points are inserted into some of the wire nets.
6. The method according to claim 1, characterized in that When there are at least two wire nets related to the area to be processed, relay points are searched for all wire nets related to the area to be processed in a predetermined order, or relay points are searched for part of the wire nets related to the area to be processed in a predetermined order.
7. The method according to claim 6, characterized in that The predetermined order is the order from largest to smallest number of destination points included in the wire net.
8. The method according to claim 6, characterized in that The predetermined order is the order of the distances between the endpoints of the wire mesh at both ends of the edge of the wire mesh crossing the area to be processed from large to small.
9. The method according to claim 1, characterized in that: The selecting of the area to be processed with serious resource conflicts based on the number of resource conflicts in each area includes: All regions whose resource conflicts reach the conflict number threshold are taken as regions to be processed, or several regions whose resource conflicts reach the conflict number threshold and are the largest are taken as regions to be processed.
10. The method according to claim 1, characterized in that When the number of global iterations reaches a predetermined number of iterations, it is determined that the routing iteration process of the user input netlist has reached a predetermined condition, wherein a routing operation for a net in the user input netlist is a global iteration, and a routing operation for a net includes initial routing for the net, or removing the existing routing for the net and rewinding the wiring.
Citation Information
Patent Citations
Rapid FPGA wire arrangement method
CN106682306A
FPGA wiring method and device
CN111062180A