A layout method and device for FPGA clock region legalization
By iteratively legalizing the clock area relationship diagram in the FPGA layout, it is transformed into a multi-commodity flow problem, and the problems of understanding space reduction and excessive constraints in traditional methods are solved, and better layout results and performance are achieved.
Patent Information
- Application Number
- CN202311824486.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2043-12-27
AI Technical Summary
The traditional FPGA clock area legalization method divides the netlist at the beginning of the layout, resulting in a shrinking understanding space and unable to find a better layout solution. The strong constraints may cause the layout result to be poor.
By modeling the relative positional relationship of the clock area, generating a clock area relationship diagram, collecting netlist information to obtain clock overflow points, and performing multiple iterations and legalizing processing, which is converted into multi-product flow problems, and clocking is performed during the end of the global layout or during the process. Regional legalization, optimize the path of clock overflow points.
It achieves better layout results, expands understanding space, reduces time complexity, supports heterogeneous architecture and scalability, and improves layout performance.
Smart Images

Figure CN118095169B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of FPGA layout technology, and in particular to a layout method and device for legalizing an FPGA clock region. Background Art
[0002] With the rapid development of information technology, modern field-programmable gate arrays (FPGAs) as a hardware programmable logic chip have been widely used. FPGA has a reprogrammable hardware structure, which enables it to adapt to a variety of application scenarios, making it the preferred solution in many fields, such as communications, image processing, industrial control, etc.
[0003] In FPGA design, layout and routing has always been a key step that affects FPGA utilization and performance, and the impact of layout on performance is very important. The constraints brought by the layout of clock signals, that is, the number of clock domains supported by each clock region is limited, make the legalization of clock regions a key issue in this field. At present, the traditional approach to legalizing clock regions is to divide the entire netlist according to clock domains at the beginning of layout, corresponding to the clock region resources on the hardware, and always abide by this division result in subsequent layout algorithms, which is similar to adding a physical constraint to each netlist element.
[0004] However, in the above solution, the scope of the solution space is narrowed, and a strong constraint is given to all netlist elements in advance, which may make it impossible to find a better solution for the layout result. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a layout method and device for legalizing an FPGA clock region, which considers the legalization of the clock region in the layout problem and makes the layout result better.
[0006] In a first aspect, the present application provides a layout method for legalizing an FPGA clock region, the method comprising:
[0007] According to the relative position relationship of the clock areas, the clock area modeling of the target chip is performed to generate a clock area relationship diagram;
[0008] Collecting netlist information designed by a user, and obtaining a clock overflow point in the clock region relationship diagram according to the netlist information;
[0009] The clock overflow point is subjected to multiple iterations of legalization processing to obtain an optimal legal path corresponding to each clock overflow point, and the clock overflow point is moved accordingly according to the optimal legal path.
[0010] According to the above technical means, the present application performs multiple iterative legalization processes on the clock overflow points to obtain the optimal legal path corresponding to each clock overflow point, and transforms the clock area legalization problem into a multi-commodity flow problem. The netlist division is no longer performed at the beginning of the layout, but the clock area legalization is performed after the global layout is completed or even during the global layout process. This can better converge to a solution with better performance.
[0011] In combination with the first aspect, in one implementation, the clock area modeling of the target chip according to the relative position relationship of the clock areas to generate a clock area relationship diagram includes:
[0012] Obtaining the relative position relationship of each clock area in the target chip;
[0013] Based on the relative position relationship, each clock region is regarded as a node, and multiple adjacent clock regions are formed into an edge;
[0014] The clock regions are modeled according to the formed edges to generate a clock region relationship graph.
[0015] According to the above technical means, the present application uses each clock area as a node and generates a clock area relationship diagram according to the relative position relationship to realize multi-commodity flow modeling.
[0016] In combination with the first aspect, in one implementation, collecting netlist information designed by a user and obtaining a clock overflow point in the clock region relationship diagram according to the netlist information includes:
[0017] Collecting netlist information designed by the user, and obtaining the number of clock domains of each clock area in the clock area relationship diagram according to the netlist information; the netlist information includes the coordinates and clock information of each netlist element;
[0018] According to the number of clock domains, the clock regions exceeding the capacity in the clock region relationship graph are acquired to collect clock overflow points in the clock region relationship graph.
[0019] In combination with the first aspect, in one implementation, performing multiple iterations of legalization processing on the clock overflow point to obtain an optimal legal path corresponding to each clock overflow point, and moving the clock overflow point accordingly according to the optimal legal path, includes:
[0020] Performing multiple iterations of legalization processing on the clock overflow point to obtain a legal path sequence corresponding to each clock overflow point;
[0021] The path priority of the legal path sequence is obtained, and the clock overflow point is moved accordingly starting from the optimal legal path according to the path priority.
[0022] In combination with the first aspect, in one implementation, performing multiple iterations of legalization processing on the clock overflow point to obtain a legal path sequence corresponding to each clock overflow point includes:
[0023] Obtain legal path constraints, and perform multiple iterative legalization processes on the clock overflow points according to the legal path constraints to obtain multiple augmented paths corresponding to each clock overflow point; the multiple augmented paths constitute the legal path sequence.
[0024] According to the above technical means, the present application uses multiple rounds of iterative legalization processing and a method of constraining the maximum moving distance of a single round, which is conducive to converging to a better solution.
[0025] In combination with the first aspect, in one implementation, the legal path constraint condition includes:
[0026] In the augmented path, the moving distance of each netlist element does not exceed the target constant value, and each source point in the augmented path has a clock domain that can be moved to the next point; the target constant value is positively correlated with the iteration round;
[0027] The clock region of the clock overflow point exceeds the capacity, and there is a margin in the clock region capacity of the end point of the augmented path, or the clock region capacity of the end point is equal to the maximum capacity of the end point after including the number of clock domains moved in and the number of clock domains of the waypoint.
[0028] In combination with the first aspect, in one implementation, obtaining the path priority of the legal path sequence and moving the clock overflow point accordingly starting from the optimal legal path according to the path priority includes:
[0029] Obtaining weights corresponding to different netlist element types, and calculating the total cost of each augmented path based on the moving distance of each netlist element and the weight;
[0030] Based on the total cost of each augmented path, the path priority of the legal path sequence is obtained, and the clock overflow point is moved accordingly starting from the optimal legal path.
[0031] According to the above technical means, the present application determines the total cost of each augmented path based on the moving distance and weight of each netlist element according to the clock domain moving distance, thereby selecting the optimal legal path; and different netlist element types in the present application can be set to correspond to different weights, which is scalable.
[0032] In a second aspect, the present application provides a layout device for legalizing an FPGA clock region, the device comprising:
[0033] A clock region relationship diagram generation module is used to perform clock region modeling on a target chip according to the relative position relationship of the clock regions to generate a clock region relationship diagram;
[0034] A clock overflow point acquisition module, used to collect netlist information designed by a user, and acquire clock overflow points in the clock region relationship diagram according to the netlist information;
[0035] The optimal legal path acquisition module is used to perform multiple iterative legalization processes on the clock overflow points of the target chip to obtain the optimal legal path corresponding to each clock overflow point, and move the clock overflow point accordingly according to the optimal legal path.
[0036] In a third aspect, the present application provides a computer device, comprising a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the above-mentioned layout method for legalizing an FPGA clock region.
[0037] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the above-mentioned layout method for legalizing an FPGA clock region.
[0038] The technical solution provided by this application may have the following beneficial effects:
[0039] First, the clock area of the target chip is modeled according to the relative position relationship of the clock area to generate a clock area relationship diagram; secondly, the netlist information designed by the user is collected, and the clock overflow point in the clock area relationship diagram is obtained according to the netlist information; then the clock overflow point is iterated and legalized multiple times, and the optimal legal path corresponding to each clock overflow point is determined from each legal path sequence, and the clock overflow point is moved accordingly according to the optimal legal path;
[0040] This application models the clock region legalization problem in FPGA layout as a multi-commodity flow problem, with single-round constraints and multiple iterative legalization processes, so that the cost of each legalization process can be as small as possible, so that the determined optimal legal path has less impact on the layout results, thereby maintaining the performance of the layout results. Compared with the traditional clock region legalization scheme based on netlist partitioning, this application can be carried out in any process of layout, such as cooperating with the iterative process of global layout, and a larger solution space can be explored. Furthermore, the cost in this application uses a custom heuristic equation to support netlist elements and hardware resources of heterogeneous architectures. Different netlist element types can be set to correspond to different weights, with good scalability and adaptability. In addition, through the above method, this application has low time complexity and low time consumption, and can obtain the optimal path quickly. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 The present invention is a flow chart of a method for layout of FPGA clock region legalization according to an exemplary embodiment.
[0043] Figure 2 The present invention is a flow chart of a method for layout of FPGA clock region legalization according to an exemplary embodiment.
[0044] Figure 3 The present invention is a flow chart of a method for layout of FPGA clock region legalization according to an exemplary embodiment.
[0045] Figure 4 The present invention is a structural block diagram of a layout device for legalizing FPGA clock regions according to an exemplary embodiment.
[0046] Figure 5 A structural block diagram of a computer device shown in an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION
[0047] The technical solution of the present application will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0048] It should be noted that the traditional clock area legalization scheme based on netlist partitioning narrows the scope of the solution space, and a strong constraint on all netlist elements in advance may make it impossible to find a better solution for the layout result. In order to solve this problem, the present application proposes a new scheme for clock area legalization. The basic idea is to build a map of the clock areas on the chip according to the position relationship, and then turn the legalization of the clock area into a multi-commodity network flow problem. Netlist partitioning is no longer performed at the beginning of layout, but clock area legalization is performed after the global layout is completed or even during the global layout, which can better converge to a solution with better performance.
[0049] In addition, the terms involved in the embodiments of the present application are explained as follows:
[0050] Clock region: A clock region refers to a physical region inside the FPGA that is assigned to a specific clock source. These regions are usually composed of the internal clock resources of the FPGA (such as triggers, synchronous RAM blocks, pipeline multipliers, etc.), which share the same clock source, that is, the main clock input to the FPGA. In FPGA design, clock regions are usually organized in a matrix form, and each region represents a logic function or module. By placing different logic functions or modules in different clock regions, timing and power consumption can be better managed.
[0051] Clock domain: A clock domain refers to a collection of logic functions or modules associated with a specific clock source. In FPGA design, each clock domain usually consists of one or more logic functions or modules that share the same clock source. Compared with clock regions, clock domains focus more on the combination of logic functions or modules rather than physical locations; in timing analysis, the division of clock domains is very important for determining the signal transmission path and timing relationship.
[0052] The connection between clock areas and clock domains: By placing different logic functions or modules in different clock areas, timing and power consumption can be better managed; at the same time, by combining related logic functions or modules into the same clock domain, timing analysis and optimization can be easier; therefore, in FPGA layout, one clock area can correspond to multiple clock domains.
[0053] Figure 1 FIG. 1 is a flow chart of a layout method for legalizing an FPGA clock region according to an exemplary embodiment. Figure 1 As shown, the method may include the following steps:
[0054] Step S101 : performing clock region modeling on a target chip according to the relative position relationship of the clock regions to generate a clock region relationship diagram.
[0055] In one possible implementation, when it is necessary to perform clock area legalization processing on the target chip, the clock area layout on the target chip is first obtained to obtain the relative position relationship between the various clock areas, and each clock area is taken as a node to obtain a clock area relationship diagram; the clock area relationship diagram is equivalent to the clock area topology diagram on the target chip, and the clock area layout on the target chip can be intuitively obtained based on the clock area relationship diagram.
[0056] Step S102: Collect the netlist information designed by the user, and obtain the clock overflow point in the clock region relationship diagram according to the netlist information.
[0057] In a possible implementation, this embodiment also collects netlist information designed by the user. A netlist is an intermediate representation of a logic design, which describes the logic function of a circuit. In the layout and routing stage, netlist information is usually used to describe the connection relationship between components. Collecting netlist information is an important step in the layout and routing process. The number of clock domains in each clock area can be obtained based on the netlist information, and then the clock overflow points in the clock area relationship diagram can be collected.
[0058] Step S103: perform multiple iterations of legalization processing on the clock overflow point to obtain an optimal legal path corresponding to each clock overflow point, and move the clock overflow point accordingly according to the optimal legal path.
[0059] In one possible implementation, this embodiment performs multiple iterative legalization processes on the collected clock overflow points until there are no clock overflow points in the clock region relationship diagram; when performing iterative legalization processes, for each clock overflow point, a legal path sequence corresponding to the clock overflow point can be obtained, and the clock overflow point is moved accordingly starting from the optimal legal path in the legal path sequence until the movement is completed.
[0060] In summary, firstly, the clock area modeling of the target chip is carried out according to the relative position relationship of the clock area to generate a clock area relationship diagram; secondly, the netlist information designed by the user is collected, and the clock overflow point in the clock area relationship diagram is obtained according to the netlist information; then, the clock overflow point is subjected to multiple iterations of legalization processing, and the optimal legal path corresponding to each clock overflow point is determined from each legal path sequence, and the clock overflow point is moved accordingly according to the optimal legal path;
[0061] This application models the clock region legalization problem in FPGA layout as a multi-commodity flow problem, with single-round constraints and multiple iterative legalization processes, so that the cost of each legalization process can be as small as possible, so that the determined optimal legal path has less impact on the layout results, thereby maintaining the performance of the layout results. Compared with the traditional clock region legalization scheme based on netlist partitioning, this application can be carried out in any process of layout, such as cooperating with the iterative process of global layout, and a larger solution space can be explored. Furthermore, the cost in this application uses a custom heuristic equation to support netlist elements and hardware resources of heterogeneous architectures. Different netlist element types can be set to correspond to different weights, with good scalability and adaptability. In addition, through the above method, this application has low time complexity and low time consumption, and can obtain the optimal path quickly.
[0062] Figure 2 FIG. 1 is a flow chart of a layout method for legalizing an FPGA clock region according to an exemplary embodiment. Figure 2 As shown, the method may include the following steps:
[0063] Step S201 : performing clock region modeling on a target chip according to the relative position relationship of the clock regions to generate a clock region relationship diagram.
[0064] In a possible implementation, step S201 includes:
[0065] Obtaining the relative position relationship of each clock region in the target chip;
[0066] Based on the relative position relationship, each clock region is regarded as a node, and multiple adjacent clock regions are formed into an edge;
[0067] The clock regions are modeled according to the formed edges to generate a clock region relationship graph.
[0068] For further information, please refer to Figure 3 A method flow chart of a layout method for legalizing FPGA clock areas is shown. The first step of this embodiment is to construct a graph based on the clock areas (i.e., the above-mentioned clock area relationship graph). The distribution of FPGA clock areas is often very regular and can be viewed as a matrix composed of rectangles. Therefore, the up, down, left, and right relationships of a certain clock area are also determined. Each area is taken as a node, and an edge is built for each group of adjacent clock areas to generate a clock area relationship graph.
[0069] That is, the clock region distribution of the FPGA can be viewed as a matrix composed of rectangles. This regularity can easily determine the up-down, down-down, left-right relationship of each clock region, thus simplifying the graph construction process. During the graph construction process, an edge is established between each group of adjacent clock regions. This edge represents the physical proximity and potential clock interaction between the two regions. In this way, it is easy to identify which regions are adjacent.
[0070] By constructing such a clock region-based diagram, designers can more intuitively understand the distribution and interrelationships of clock resources within the FPGA, thereby providing strong support for subsequent design and optimization work.
[0071] Step S202, collecting the netlist information designed by the user, and obtaining the number of clock domains of each clock area in the clock area relationship diagram according to the netlist information; the netlist information includes the coordinates of each netlist element and clock information.
[0072] In a possible implementation, step S202 includes:
[0073] Collecting netlist information designed by the user, and creating a mapping table based on the netlist information; the mapping table is used to associate the position of each netlist element with its corresponding clock domain;
[0074] According to the mapping table, the number of clock domains in each clock area in the clock area relationship diagram is obtained.
[0075] Furthermore, the second step of this embodiment is to collect netlist information. Regardless of whether it is in the global layout or after the layout is completed, each netlist element should have a coordinate. Therefore, this embodiment can build a Map (mapping table) to collect the clock information of all netlist elements, and count the number of clock domains in each clock area to see whether it exceeds the capacity of the clock area.
[0076] That is to say, during the global layout process, each netlist element is assigned a coordinate, which is not only used to determine the location of the element, but also used to establish a mapping of clock information; in order to better manage and optimize clock resources, this embodiment creates a Map to collect the clock information of all elements, and this Map associates the location of the element with its corresponding clock domain. In this way, the number of clock domains in each clock region can be counted, and it can be determined whether the capacity of the clock region is exceeded.
[0077] Step S203: According to the number of clock domains, the clock regions exceeding the capacity in the clock region relationship graph are obtained to collect clock overflow points in the clock region relationship graph.
[0078] Furthermore, each clock region has a certain capacity, so the clock regions that exceed the capacity can be collected to determine the clock overflow points in the clock region relationship diagram; each clock overflow point corresponds to a clock region.
[0079] Step S204: perform multiple iterations of legalization processing on the clock overflow point to obtain legal path sequences corresponding to each clock overflow point.
[0080] In a possible implementation, step S204 includes:
[0081] A legal path constraint condition is obtained, and according to the legal path constraint condition, the clock overflow point is subjected to multiple iterations of legalization processing to obtain multiple augmented paths corresponding to each clock overflow point; the multiple augmented paths constitute the legal path sequence.
[0082] In a possible implementation, the legal path constraint conditions include:
[0083] In the augmented path, the moving distance of each netlist element does not exceed the target value, and each source point in the augmented path has a clock domain to move to the next point; the target value is positively correlated with the iteration round;
[0084] The clock region of the clock overflow point exceeds the capacity, and there is margin in the clock region capacity of the end point of the augmented path, or the clock region capacity of the end point is equal to the maximum capacity of the end point after including the number of clock domains moved in and the number of clock domains of the waypoint.
[0085] Furthermore, the legal path constraint condition includes a first constraint condition, a second constraint condition and a third constraint condition;
[0086] The first constraint condition indicates that in the augmented path, the moving distance of each netlist element does not exceed a target value; the target value is positively correlated with the iteration round;
[0087] The second constraint indicates that under the first constraint, each source point in the augmented path has a clock domain movable to the next point;
[0088] The third constraint indicates that the clock region of the clock overflow point exceeds the capacity, and there is a margin in the clock region capacity of the end point of the augmented path, or the clock region capacity of the end point is equal to the maximum capacity of the end point after including the number of clock domains moved in and the number of clock domains of the path point.
[0089] Furthermore, the third step of this implementation is to perform multiple iterative legalization processes on the clock area. The purpose of multiple iterative legalization processes is to adjust the layout of the clock area to prevent the clock area from exceeding the capacity. Each iteration searches for multiple augmenting paths for the clock area that exceeds the capacity. Each augmenting path represents the transfer of all netlist elements contained in a clock signal along this augmenting path. An augmenting path refers to a path from a starting point to an end point, and all netlist elements on the path can be transferred along this path. The purpose of finding an augmenting path is to find a layout method that optimizes the capacity of the clock area. The way to find an augmenting path is to start from the clock overflow point, that is, the starting point, and do a variant BFS (breadth first search), that is, a breadth-first search, and use a variant BFS to find an augmenting path. BFS is a graph search algorithm that starts from the starting point and expands to adjacent nodes layer by layer until the target node is found. Each augmenting path needs to satisfy:
[0090] (1) The moving distance of each netlist element does not exceed a fixed value (i.e., the target fixed value mentioned above). This value is determined by a heuristic formula and is positively correlated with the iteration round. As the iteration proceeds, the allowed moving distance will gradually increase. The heuristic formula is as follows:
[0091] φ=((iter+1) 2 ω);
[0092] Among them, iter represents the number of iterations, ω represents the unit clock region height, and φ represents the constant value.
[0093] (2) Under the first constraint, each source point on the augmented path must have a clock domain to move to the next point, which means that on the path, each netlist element can only be moved to an adjacent clock domain.
[0094] (3) The clock region at the clock overflow point exceeds the capacity, and the clock region at the end point has a margin or is at the maximum capacity after including the clock domains moved in and the number of clock domains at the pass point. This means that the clock region at the starting point (i.e., the clock overflow point) needs to adjust the layout, while the capacity of the end point region can accommodate the clock domains moved in. Each round of iteration targets all clock overflow points until there are no clock overflow points, and the iteration ends.
[0095] Step S205: Obtain the path priority of the legal path sequence, and according to the path priority, move the clock overflow point accordingly starting from the optimal legal path.
[0096] In a possible implementation, step S205 includes:
[0097] Obtain the weights corresponding to different netlist element types, and calculate the total cost of each augmented path based on the moving distance of each netlist element and the weight;
[0098] Based on the total cost of each augmented path, the path priority of the legal path sequence is obtained, and the clock overflow point is moved accordingly starting from the optimal legal path.
[0099] Furthermore, multiple augmented paths will be searched for each clock overflow point, so the third step of this implementation is to prioritize these paths, and finally select the same number of paths as the clock region overflow amount for movement; in the process of prioritization, the clock domain that can move the least distance from each source point of the augmented path to the next point is taken as the basis, and different netlist element types can be set with different weights as different commodities. The total movement distance of the elements contained in the clock domain is accumulated and added, and then the cost of each path (i.e., the above-mentioned total cost) is accumulated. In other words, when calculating the total cost of the target augmented path, first determine the netlist elements that need to be moved for the target augmented path, calculate the distance from each netlist element to the next netlist element, and determine the weight represented by each netlist element, determine the product of the distance of the netlist element and the weight as the element cost of the netlist element, and accumulate the element costs represented by all the netlist elements that need to be moved for the target augmented path. The total cost of the target augmented path can be obtained, and the augmented path with the highest total cost is confirmed as the optimal legal path. Assuming that for a certain augmenting path, when moving through the augmenting path, n netlist elements need to be moved, then the total cost of the augmenting path is:
[0100]
[0101] Among them, weight i represents the weight of the i-th netlist element, distance i Represents the moving distance of the i-th netlist element.
[0102] This embodiment takes the clock domain that can move the least distance from each source point to the next point as the standard, which can ensure that the moving distance of each clock domain is the smallest during the moving process, thereby reducing the impact on other clock domains. Different types of netlist elements can be sorted according to their importance or weight. For example, if certain types of netlist elements have higher requirements for timing, their weights should be greater. Afterwards, the total cost of each augmented path can be calculated based on these weights and the moving distance, and then the augmented paths can be prioritized according to the total cost.
[0103] After the sorting is completed, the time complexity of this solution can be calculated by the following formula:
[0104] T=O(|V|·min(|V| 0.5 ,|Λ|)·|P| avg ·|C| avg );
[0105] Among them, |V| represents the number of clock regions, that is, the number of nodes after modeling, |Λ| represents the number of clock regions that exceed the capacity, that is, the number of nodes that need to be legalized, and |P| avg represents the average number of legalized paths found for each clock overflow point in each round of iterative legalization processing, |C| avg It represents the average number of netlist elements contained in the clock domain moved during legalization. It can be seen that this example has low time complexity and small time consumption, and can quickly obtain the optimal path.
[0106] In summary, firstly, the clock area modeling of the target chip is carried out according to the relative position relationship of the clock area to generate a clock area relationship diagram; secondly, the netlist information designed by the user is collected, and the clock overflow point in the clock area relationship diagram is obtained according to the netlist information; then, the clock overflow point is subjected to multiple iterations of legalization processing, and the optimal legal path corresponding to each clock overflow point is determined from each legal path sequence, and the clock overflow point is moved accordingly according to the optimal legal path;
[0107] This application models the clock region legalization problem in FPGA layout as a multi-commodity flow problem, with single-round constraints and multiple iterative legalization processes, so that the cost of each legalization process can be as small as possible, so that the determined optimal legal path has less impact on the layout results, thereby maintaining the performance of the layout results. Compared with the traditional clock region legalization scheme based on netlist partitioning, this application can be carried out in any process of layout, such as cooperating with the iterative process of global layout, and a larger solution space can be explored. Furthermore, the cost in this application uses a custom heuristic equation to support netlist elements and hardware resources of heterogeneous architectures. Different netlist element types can be set to correspond to different weights, with good scalability and adaptability. In addition, through the above method, this application has low time complexity and low time consumption, and can obtain the optimal path quickly.
[0108] Figure 4 This is a structural block diagram of a layout device for FPGA clock region legalization according to an exemplary embodiment. The device includes:
[0109] The clock region relationship diagram generation module 401 is used to perform clock region modeling on the target chip according to the relative position relationship of the clock regions to generate a clock region relationship diagram;
[0110] The clock overflow point acquisition module 402 is used to collect the netlist information designed by the user and acquire the clock overflow point in the clock region relationship diagram according to the netlist information;
[0111] The optimal legal path acquisition module 403 is used to perform multiple iterative legalization processes on the clock overflow points of the target chip to obtain the optimal legal path corresponding to each clock overflow point, and to move the clock overflow point accordingly according to the optimal legal path.
[0112] In a possible implementation manner, the clock region relationship diagram generating module 401 is further configured to:
[0113] Obtaining the relative position relationship of each clock region in the target chip;
[0114] Based on the relative position relationship, each clock region is regarded as a node, and multiple adjacent clock regions are formed into an edge;
[0115] The clock regions are modeled according to the formed edges to generate a clock region relationship graph.
[0116] In a possible implementation manner, the clock overflow point acquisition module 402 is further configured to:
[0117] Collecting netlist information designed by the user, and obtaining the number of clock domains of each clock area in the clock area relationship diagram according to the netlist information; the netlist information includes the coordinates and clock information of each netlist element;
[0118] According to the number of clock domains, the clock regions exceeding the capacity in the clock region relationship graph are obtained to collect clock overflow points in the clock region relationship graph.
[0119] In a possible implementation, the optimal legal path acquisition module 403 includes:
[0120] Perform multiple iterations of legalization processing on the clock overflow point to obtain a legal path sequence corresponding to each clock overflow point;
[0121] The path priority of the legal path sequence is obtained, and according to the path priority, the clock overflow point is moved accordingly starting from the optimal legal path.
[0122] In a possible implementation, the optimal legal path acquisition module 403 includes:
[0123] A legal path constraint condition is obtained, and according to the legal path constraint condition, the clock overflow point is subjected to multiple iterations of legalization processing to obtain multiple augmented paths corresponding to each clock overflow point; the multiple augmented paths constitute the legal path sequence.
[0124] In a possible implementation, the legal path constraint condition includes:
[0125] In the augmented path, the moving distance of each netlist element does not exceed the target value, and each source point in the augmented path has a clock domain to move to the next point; the target value is positively correlated with the iteration round;
[0126] The clock region of the clock overflow point exceeds the capacity, and there is margin in the clock region capacity of the end point of the augmented path, or the clock region capacity of the end point is equal to the maximum capacity of the end point after including the number of clock domains moved in and the number of clock domains of the waypoint.
[0127] In a possible implementation, the optimal legal path acquisition module 403 includes:
[0128] Obtain the weights corresponding to different netlist element types, and calculate the total cost of each augmented path based on the moving distance of each netlist element and the weight;
[0129] Based on the total cost of each augmented path, the path priority of the legal path sequence is obtained, and the clock overflow point is moved accordingly starting from the optimal legal path.
[0130] In summary, firstly, the clock area modeling of the target chip is carried out according to the relative position relationship of the clock area to generate a clock area relationship diagram; secondly, the netlist information designed by the user is collected, and the clock overflow point in the clock area relationship diagram is obtained according to the netlist information; then, the clock overflow point is subjected to multiple iterations of legalization processing, and the optimal legal path corresponding to each clock overflow point is determined from each legal path sequence, and the clock overflow point is moved accordingly according to the optimal legal path;
[0131] This application models the clock region legalization problem in FPGA layout as a multi-commodity flow problem, with single-round constraints and multiple iterative legalization processes, so that the cost of each legalization process can be as small as possible, so that the determined optimal legal path has less impact on the layout results, thereby maintaining the performance of the layout results. Compared with the traditional clock region legalization scheme based on netlist partitioning, this application can be carried out in any process of layout, such as cooperating with the iterative process of global layout, and a larger solution space can be explored. Furthermore, the cost in this application uses a custom heuristic equation to support netlist elements and hardware resources of heterogeneous architectures. Different netlist element types can be set to correspond to different weights, with good scalability and adaptability. In addition, through the above method, this application has low time complexity and low time consumption, and can obtain the optimal path quickly.
[0132] See also Figure 5, which is a schematic diagram of a computer device provided according to an exemplary embodiment of the present application, the computer device includes a memory and a processor, the memory is used to store a computer program, and when the computer program is executed by the processor, the above-mentioned layout method for legalizing the FPGA clock area is implemented.
[0133] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0134] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the implementation of the present application. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method implementation.
[0135] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor 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.
[0136] In an exemplary embodiment, a computer-readable storage medium is also provided, which is used to store at least one computer program, and the at least one computer program is loaded and executed by a processor to implement all or part of the steps in the above method. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0137] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0138] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A layout method for FPGA clock region legalization, characterized in that: The method comprises: According to the relative position relationship of the clock areas, the clock area modeling of the target chip is performed to generate a clock area relationship diagram; Collecting netlist information designed by a user, and obtaining a clock overflow point in the clock region relationship diagram according to the netlist information; Performing multiple iterations of legalization processing on the clock overflow point to obtain an optimal legal path corresponding to each clock overflow point, and moving the clock overflow point accordingly according to the optimal legal path; The performing multiple iterations of legalization processing on the clock overflow point to obtain an optimal legal path corresponding to each clock overflow point, and moving the clock overflow point accordingly according to the optimal legal path, includes: Performing multiple iterations of legalization processing on the clock overflow point to obtain a legal path sequence corresponding to each clock overflow point; Obtaining the path priority of the legal path sequence, and moving the clock overflow point accordingly starting from the optimal legal path according to the path priority; The performing multiple iterations of legalization processing on the clock overflow point to obtain a legal path sequence corresponding to each clock overflow point includes: Obtaining a legal path constraint condition, and performing multiple iterative legalization processes on the clock overflow point according to the legal path constraint condition, so as to obtain multiple augmented paths corresponding to each clock overflow point; the multiple augmented paths constitute the legal path sequence; The clock area modeling of the target chip is performed according to the relative position relationship of the clock areas to generate a clock area relationship diagram, including: Acquire the clock area layout on the target chip, obtain the relative position relationship between the clock areas, take each clock area as a node, build an edge with each group of adjacent clock areas, and obtain the clock area relationship graph; The obtaining of the path priority of the legal path sequence and correspondingly moving the clock overflow point starting from the optimal legal path according to the path priority includes: Obtaining weights corresponding to different netlist element types, and calculating the total cost of each augmenting path based on the moving distance of each netlist element and the weight; each augmenting path represents the transmission of all netlist elements included in a clock signal along the augmenting path; Based on the total cost of each augmented path, the path priority of the legal path sequence is obtained, and the clock overflow point is moved accordingly starting from the optimal legal path.
2. The method according to claim 1, characterized in that The clock area modeling of the target chip is performed according to the relative position relationship of the clock areas to generate a clock area relationship diagram, including: Obtaining the relative position relationship of each clock area in the target chip; Based on the relative position relationship, each clock region is regarded as a node, and multiple adjacent clock regions are formed into an edge; The clock regions are modeled according to the formed edges to generate a clock region relationship graph.
3. The method according to claim 1, characterized in that The collecting of netlist information designed by the user and obtaining the clock overflow point in the clock region relationship diagram according to the netlist information includes: Collecting netlist information designed by the user, and obtaining the number of clock domains of each clock area in the clock area relationship diagram according to the netlist information; the netlist information includes the coordinates and clock information of each netlist element; According to the number of clock domains, the clock regions exceeding the capacity in the clock region relationship graph are acquired to collect clock overflow points in the clock region relationship graph.
4. The method according to claim 1, characterized in that: The legal path constraints include: In the augmented path, the moving distance of each netlist element does not exceed the target constant value, and each source point in the augmented path has a clock domain that can be moved to the next point; the target constant value is positively correlated with the iteration round; The clock region of the clock overflow point exceeds the capacity, and there is a margin in the clock region capacity of the end point of the augmented path, or the clock region capacity of the end point is equal to the maximum capacity of the end point after including the number of clock domains moved in and the number of clock domains of the waypoint.
5. A layout device for FPGA clock region legalization, characterized in that: The device comprises: A clock region relationship diagram generation module is used to perform clock region modeling on a target chip according to the relative position relationship of the clock regions to generate a clock region relationship diagram; A clock overflow point acquisition module, used to collect netlist information designed by a user, and acquire clock overflow points in the clock region relationship diagram according to the netlist information; An optimal legal path acquisition module, used for performing multiple iterations of legalization processing on the clock overflow points of the target chip to obtain the optimal legal path corresponding to each clock overflow point, and moving the clock overflow point accordingly according to the optimal legal path; The optimal legal path acquisition module is also used for: Performing multiple iterations of legalization processing on the clock overflow point to obtain a legal path sequence corresponding to each clock overflow point; Obtaining the path priority of the legal path sequence, and moving the clock overflow point accordingly starting from the optimal legal path according to the path priority; The optimal legal path acquisition module is also used for: Obtaining a legal path constraint condition, and performing multiple iterative legalization processes on the clock overflow point according to the legal path constraint condition, so as to obtain multiple augmented paths corresponding to each clock overflow point; the multiple augmented paths constitute the legal path sequence; The clock region relationship diagram generating module is further used for: Acquire the clock area layout on the target chip, obtain the relative position relationship between the clock areas, take each clock area as a node, build an edge with each group of adjacent clock areas, and obtain the clock area relationship graph; The optimal legal path acquisition module is also used for: Obtaining weights corresponding to different netlist element types, and calculating the total cost of each augmenting path based on the moving distance of each netlist element and the weight; each augmenting path represents the transmission of all netlist elements included in a clock signal along the augmenting path; Based on the total cost of each augmented path, the path priority of the legal path sequence is obtained, and the clock overflow point is moved accordingly starting from the optimal legal path.
6. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a layout method for legalizing an FPGA clock region as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement a layout method for legalizing an FPGA clock region as described in any one of claims 1 to 4.
