A printed circuit board wiring method, device, medium and computer program product
By using the first coefficient to update the congestion evaluation parameters of the wiring model in the printed circuit board wiring method, the problem of the wiring model being unable to converge is solved, and the wiring efficiency and calculation speed are improved.
Patent Information
- Application Number
- CN202411678519.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-11-22
AI Technical Summary
When wiring printed circuit boards, the prior art faces the problem that the wiring model cannot converge, which results in a long calculation time and requires engineers to manually adjust the wiring.
A printed circuit board wiring method is adopted to obtain the task parameters of the target wiring task, perform iterative calculations, and during the iterative calculation process, a first coefficient is generated based on the target wiring resources in the task parameters and the global wiring position calculated by the previous iteration, and the first coefficient is used to calculate the congestion evaluation parameters corresponding to the global wiring position calculated by the previous iteration, and the wiring model is called for the wiring calculation, and the global wiring position calculated by the current iteration is output.
By updating the first coefficient of the coefficient using the historical congestion attenuation factor and/or the current round of congestion cost coefficient, and updating the congestion evaluation parameters used in the iterative calculation of the wiring model, the problem of congestion in the wiring model evaluating global wiring positions is solved, the convergence rate of the model calculation is accelerated, and the efficiency of generating recommended global wiring positions is improved.
Smart Images

Figure CN119167871B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of printed circuit board design, and in particular to a printed circuit board wiring method, equipment, medium and computer program product. Background Art
[0002] Printed Circuit Board (PCB) is used to carry various electronic components to realize circuit functions. The design of printed circuit boards is mainly divided into three stages: schematic design, component layout, and wiring. Among them, the wiring quality of the printed circuit board directly affects the operating frequency of the circuit on the printed circuit board.
[0003] At present, the schemes for PCB wiring are mainly divided into manual wiring and automatic wiring. Among them, manual wiring is time-consuming and labor-intensive. Although there are schemes for automatic wiring using wiring models in related fields, as the circuits on PCBs become increasingly dense, the wiring model often fails to converge. Not only does the calculation take a long time, but engineers are often required to manually adjust the wiring.
[0004] How to improve the wiring efficiency of printed circuit boards is a technical problem that those skilled in the art need to solve. Summary of the invention
[0005] The object of the present invention is to provide a printed circuit board wiring method, device, medium and computer program product for improving the wiring efficiency of the printed circuit board.
[0006] In order to solve the above technical problems, the present invention provides a printed circuit board wiring method, comprising:
[0007] Get the task parameters of the target wiring task;
[0008] Iterative calculation is performed according to the task parameters, and during the iterative calculation process, a first coefficient is generated according to the target wiring resources in the task parameters and the global wiring position obtained in the previous round of iterative calculation, the congestion evaluation parameter corresponding to the global wiring position obtained in the previous round of iterative calculation is calculated using the first coefficient, the wiring model is called to perform wiring calculation according to the task parameters, the global wiring position obtained in the previous round of iterative calculation, and the corresponding congestion evaluation parameter, and the global wiring position obtained in the current round of iterative calculation is output;
[0009] If the iteration end condition is met and a global routing position that satisfies routing is obtained, it is output as a recommended global routing position for the target routing task;
[0010] The first coefficient includes a historical congestion attenuation factor and / or a current round congestion cost coefficient update coefficient; and the routing is that each wire net in the task parameters can be successfully connected on the target routing resource.
[0011] On the one hand, the congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation is calculated using the historical congestion attenuation factor, including:
[0012] For each edge of the target routing resource, the historical congestion cost corresponding to the edge in the current round is calculated according to the historical congestion attenuation factor corresponding to the edge in the current round, the historical congestion cost of the edge input in the previous round of iterative calculation, and the number of nets occupying the edge in the global routing position obtained in the previous round of iterative calculation;
[0013] Calculate the congestion cost of the edge in the current round of iterative calculation according to the historical congestion cost corresponding to the edge in the current round, the current round congestion cost of the edge, and the communication delay of the edge;
[0014] The congestion cost of each edge in the current round of iterative calculation is used as the congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation;
[0015] The edge is a copper wire between two grid points.
[0016] On the other hand, the congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation is calculated by using the current round of congestion cost coefficient update coefficient, including:
[0017] For each edge of the target routing resource, the current round congestion cost coefficient of the edge is calculated according to the current round congestion cost coefficient update coefficient corresponding to the edge in the current round and the current round congestion cost coefficient of the edge input in the previous round of iterative calculation;
[0018] The current round congestion cost of the edge is calculated according to the current round congestion cost coefficient of the edge and the real-time congestion cost evaluation parameter of the edge;
[0019] Calculate the congestion cost of the edge in the current iterative calculation according to the current round congestion cost coefficient of the edge, the historical congestion cost corresponding to the edge in the current round, and the communication delay of the edge;
[0020] The congestion cost of each edge in the current round of iterative calculation is used as the congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation;
[0021] The edge is a copper wire between two grid points.
[0022] On the other hand, generating a first coefficient according to the target routing resource and the global routing position obtained by the previous round of iterative calculation includes:
[0023] The task objective of the target wiring task, the wiring control parameters input into the wiring model in the previous round of iterative calculation, and the global wiring position obtained in the previous round of iterative calculation are input into a diffusion model, so as to use the diffusion model to perform denoising calculation for a first preset number of steps and output the first coefficient of the current round of iterative calculation.
[0024] On the other hand, the task target of the target routing task, the routing control parameters input into the routing model in the previous round of iterative calculation, and the global routing position obtained in the previous round of iterative calculation are input into the diffusion model, so as to use the diffusion model to perform denoising calculation for a first preset number of steps, and output the first coefficient of the current round of iterative calculation, including:
[0025] Gaussian noise sampled from a standard normal distribution;
[0026] Using the score network in the diffusion model and the classification network in the diffusion model, according to the task objective of the target routing task, the routing control parameters input into the routing model in the previous round of iterative calculation, the global routing position obtained in the previous round of iterative calculation, and the Gaussian noise, a denoising calculation for the first preset number of steps is performed to obtain a denoising vector;
[0027] The denoised vector obtained by the last denoising calculation is subjected to inverse quantization calculation to obtain the first coefficient of the current round of iterative calculation.
[0028] On the other hand, using the score network in the diffusion model and the classification network in the diffusion model, according to the task target of the target routing task, the routing control parameters input into the routing model in the previous round of iterative calculation, the global routing position obtained in the previous round of iterative calculation, and the Gaussian noise, the denoising calculation of the first preset number of steps is performed to obtain a denoising vector, including:
[0029] Before the number of denoising steps reaches the first preset number of steps, in the current denoising calculation, the following calculation is performed:
[0030] Input the denoising vector obtained by the previous denoising calculation, the implicit guide vector obtained by the previous denoising calculation, the remaining denoising steps corresponding to the previous denoising calculation, the global routing position obtained by the previous round of iterative calculation, and the target routing resource into the fractional network to obtain a fractional network calculation result;
[0031] Utilizing the classification network to calculate the denoised vector obtained from the previous denoising calculation, the implicit guide vector obtained from the previous denoising calculation, the number of remaining denoising steps corresponding to the previous denoising calculation, the global routing position obtained from the previous round of iterations, and the gradient data of the target routing resource compared to the task target;
[0032] The denoising vector corresponding to the denoising calculation in the current step is calculated based on the denoising vector obtained by the previous denoising calculation, the noise obtained by sampling, the score network calculation result, and the gradient data;
[0033] Wherein, in the first denoising calculation, the denoising vector obtained by the previous denoising calculation is the Gaussian noise;
[0034] The implicit guidance vector is generated by adding noise to the routing control parameters corresponding to the global routing position calculated in the previous round of iterations.
[0035] On the other hand, the calculation step of the score network includes:
[0036] Constructing the edges in the target routing resource and the nodes in the global routing position into an association relationship graph;
[0037] Extracting the implicit representation of the edge according to the association graph using a graph convolutional network;
[0038] Calculate the score network output result based on the implicit representation;
[0039] The edge is a copper wire between two grid points.
[0040] On the other hand, the calculation steps of the classification network include:
[0041] Determine the expected progress value of each round of iterative calculation towards the task goal according to the task goal;
[0042] Performing vectorization processing according to the expected progress value to obtain an embedding vector corresponding to the task target;
[0043] Calculate the matrix representation corresponding to the association relationship graph according to the implicit representation;
[0044] A probability value is calculated based on the embedding vector corresponding to the task target and the matrix representation corresponding to the association relationship graph;
[0045] The probability value is output.
[0046] On the other hand, the training step of the diffusion model includes:
[0047] Acquire a diffusion model training data set, wherein the diffusion model training data set includes a plurality of sample routing tasks, and sample task parameters of each of the sample routing tasks include sample routing resources, communication delays of edges in the sample routing resources, and a sample netlist to be routed;
[0048] Sampling diffusion model training samples from the diffusion model training data set to construct a diffusion model training sample pool, wherein sample parameters of the diffusion model training samples include the sample wiring resources, wiring control parameters input into the wiring model, a global wiring position calculated using the wiring model, and the first coefficient calculated accordingly;
[0049] The score network and the classification network are trained using the diffusion model training sample pool.
[0050] On the other hand, sampling the diffusion model training samples from the diffusion model training data set includes:
[0051] Initialize the diffusion model training sample pool to be empty and the sample parameter queue to be empty;
[0052] Sampling a sample wiring task from the diffusion model training data set, calling the wiring model to perform wiring calculation according to the sample task parameters and initialization parameters of the sample wiring task, and adding the sample task parameters, the wiring control parameters input into the wiring model, the global wiring position output by the wiring model, and the corresponding calculated wiring evaluation parameters as a group of candidate sample parameters into the sample parameter queue;
[0053] If the number of samples in the diffusion model training sample pool is less than the preset number of samples, the following steps are performed:
[0054] Sampling the candidate sample parameters from the sample parameter queue, and updating the congestion evaluation parameters in the candidate sample parameters using the randomly sampled first coefficients, calling the routing model to perform routing calculations according to the sample task parameters, the delay evaluation parameters, and the updated congestion evaluation parameters in the candidate sample parameters, to obtain an updated global routing position and the corresponding calculated routing evaluation parameters;
[0055] Adding the sample task parameters, the updated global wiring position and the corresponding calculated wiring control parameters in the candidate sample parameters to the sample parameter queue;
[0056] The sample wiring resources in the candidate sample parameters, the corresponding wiring control parameters input into the wiring model, the sample task objectives in the candidate sample parameters, the global wiring position before updating, and the randomly sampled first coefficient are added to the diffusion model training sample pool as the sample parameters of the diffusion model training sample.
[0057] On the other hand, using the diffusion model training sample pool to train the score network includes:
[0058] Sampling a first preset number of the diffusion model training samples from the diffusion model training sample pool, and performing the following steps on each of the diffusion model training samples obtained by sampling:
[0059] After vectorizing the wiring control parameters of the wiring model corresponding to the diffusion model training samples, adding noise to the wiring control parameters of the wiring model corresponding to the diffusion model training samples according to the noise adding step obtained by random sampling to obtain an implicit guidance vector corresponding to the diffusion model training samples;
[0060] Adding noise to the denoised vector calculated according to the first coefficient randomly sampled from the diffusion model training sample to obtain a noisy vector corresponding to the diffusion model training sample;
[0061] According to the implicit guidance vector corresponding to the diffusion model training sample and the noise vector corresponding to the diffusion model training sample, the network parameters of the score network are updated by using the gradient descent method.
[0062] On the other hand, using the diffusion model training sample pool to train the classification network includes:
[0063] Sampling a second preset number of the diffusion model training samples from the diffusion model training sample pool, and performing the following steps on each of the diffusion model training samples obtained by sampling:
[0064] After vectorizing the wiring control parameters of the wiring model corresponding to the diffusion model training samples, adding noise to the wiring control parameters of the wiring model corresponding to the diffusion model training samples according to the noise adding step obtained by random sampling to obtain an implicit guidance vector corresponding to the diffusion model training samples;
[0065] Adding noise to the denoised vector calculated according to the first coefficient randomly sampled from the diffusion model training sample to obtain a noisy vector corresponding to the diffusion model training sample;
[0066] According to the implicit guidance vector corresponding to the diffusion model training sample and the noise vector corresponding to the diffusion model training sample, the network parameters of the classification network are updated by using the gradient ascent method.
[0067] In order to solve the above technical problems, the present invention also provides a printed circuit board wiring device, comprising:
[0068] Memory for storing computer programs;
[0069] A processor is used to execute the computer program, and when the computer program is executed by the processor, the steps of the printed circuit board wiring method as described in any one of the above items are implemented.
[0070] In order to solve the above technical problems, the present invention also provides a non-volatile storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the printed circuit board wiring method as described in any one of the above items are implemented.
[0071] In order to solve the above technical problems, the present invention also provides a computer program product, including a computer program, which implements the steps of any one of the above printed circuit board wiring methods when executed by a processor.
[0072] The printed circuit board wiring method provided by the present invention has the beneficial effect that in the process of using the wiring model to perform wiring calculation according to the task parameters of the target wiring task and the congestion evaluation parameters to avoid congestion and reduce delay to obtain the global wiring position, a first coefficient including the historical congestion attenuation factor and / or the current round congestion cost coefficient update coefficient is used to update the congestion evaluation parameter used in the iterative calculation of the wiring model, and the first coefficient is generated according to the target wiring resources and the global wiring position obtained by the previous round of iterative calculation, thereby solving the problem that the congestion situation of the global wiring position evaluated by the wiring model is relatively rigid, and can accelerate the convergence rate of the model calculation, thereby improving the efficiency of generating the recommended global wiring position.
[0073] The printed circuit board wiring device, non-volatile storage medium and computer program product provided by the present invention have the above-mentioned beneficial effects, which will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0075] Figure 1 A schematic diagram of routing resources for a target;
[0076] Figure 2 It is a schematic diagram of the structure of a wire network;
[0077] Figure 3 A flowchart of a printed circuit board wiring method provided by an embodiment of the present invention;
[0078] Figure 4 A schematic diagram of the structure of a printed circuit board wiring system provided by an embodiment of the present invention;
[0079] Figure 5 A flow chart of another printed circuit board wiring method provided by an embodiment of the present invention;
[0080] Figure 6 A schematic structural diagram of a printed circuit board wiring device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0081] The core of the present invention is to provide a printed circuit board wiring method, device, medium and computer program product for improving the wiring efficiency of the printed circuit board.
[0082] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0083] To facilitate understanding of the technical solution provided by the embodiment of the present invention, some key terms used in the embodiment of the present invention are first explained here.
[0084] Printed Circuit Board (PCB) is used to carry various electronic components, so as to realize the circuit function. The design of printed circuit board is mainly divided into three stages: schematic design, component layout, and wiring.
[0085] When wiring a printed circuit board, the netlist generated based on the schematic designed by the engineer can determine the connection information of all components in the circuit to ensure that the electrical connection of the circuit is correctly implemented on the printed circuit board.
[0086] Layout refers to the physical placement of circuit components during the design process of a printed circuit board. In some concepts, layout is defined as the entire process including component layout and wiring. In an embodiment of the present invention, the target wiring task to be performed is based on the component layout that has been determined on the target board as one of the wiring bases.
[0087] As mentioned above, the netlist describes the electrical connection relationship between components and devices on the printed circuit board. In order to realize automatic routing based on line negotiation, the related technical field adopts determining the line net from the netlist to transform the printed circuit board routing problem into a negotiated routing problem of multiple line nets on a given routing resource, specifically optimizing the routing target under the condition of satisfying resource constraints.
[0088] Figure 1 A schematic diagram of routing resources for a target; Figure 2 A schematic diagram of the structure of a wire network.
[0089] In the embodiment of the present invention, the target wiring resource refers to a collection of hardware resources used for wiring the nets in the netlist, and may specifically include copper wires and vias (if any) on the target board.
[0090] The target routing resources can be expressed as Figure 1 The wiring resource diagram is shown in the form of Figure 1 As shown in Figure 1, in a multilayer printed circuit board, the wiring resource diagram can be represented as a three-dimensional grid. The grid density is determined by the production process, and the edges between the grid points represent copper wires. Figure 1 A schematic diagram of adjacent layers connected by through holes is also given in the figure, and a wire net is identified, which can be represented as Figure 2 The netlist consists of multiple nets, each of which consists of a drive point and one or more load points (such as Figure 2 The grid is composed of load points 1 and 2 as shown in the figure. Both the driving point and the load point are located on the grid. In the circuit of the printed circuit board, the driving point is the source of the signal, which is responsible for driving the signal to be transmitted to other nodes through the network; the load point is the receiver of the signal, which can be the input of other logic gates, resistors, capacitors, inductors and other components, which consume the signal energy provided by the driving point. Both the load point and the driving point are regarded as part of the wire net, but they have different roles and functions. For a certain component, there may be multiple driving points or multiple load points on it, and the component as a driving point may also be a load point in other wire nets. Resource constraint means that each copper wire can only be allocated to one wire net for use. When multiple wire nets compete for the same copper wire, congestion will occur, causing some wire nets to have to detour, thereby increasing system delay; the more serious consequence is that the routing cannot be achieved, that is, some wire nets cannot obtain the required routing resources. Therefore, establishing an effective congestion avoidance mechanism is crucial for the routing algorithm.
[0091] In the wiring task of printed circuit boards, the "wiring tree" refers to the network of wires used to connect various nodes in the circuit (such as the pins of components), which is similar to a tree structure, in which each node is connected to the root node through one and only one path. In actual printed circuit board wiring, the construction of the wiring tree also needs to consider the electrical characteristics of the circuit, such as impedance matching, signal integrity, and electromagnetic compatibility. In addition, the construction of the wiring tree may also involve obstacle avoidance, that is, obstacles on the circuit board, such as other components or fixed structures of the circuit board, need to be avoided during wiring.
[0092] In the design of printed circuit boards, "routing through" is the most basic requirement in the entire printed circuit board wiring process, that is, all lines must be successfully connected without any breakpoints or discontinuities. If the lines are not routed through, there are broken lines or flying wires are required to connect, then the printed circuit board is unqualified because it cannot work properly.
[0093] In the actual printed circuit board routing process, engineers can use automatic routing tools to generate global routing positions based on the designed netlist and component layout on the target board, and perform manual intervention to complete the remaining signal routing when necessary.
[0094] The embodiment of the present invention adopts a wiring model for wiring calculation. The wiring method of the wiring model adopted is to "negotiate" between various lines during the wiring process to avoid congestion and reduce delay. The algorithm evaluates the congestion of different paths and dynamically adjusts the lines to achieve the effect of overall optimization. This method makes the wiring results more stable and predictable, and also reduces the congestion problem during the wiring process.
[0095] In each iteration of automatic routing calculation, the routing model removes and reroutes all wire nets until there is no congestion or the predetermined number of iterations is reached. Since each edge in the routing resources only allows one wire net to pass through, when an edge is used by multiple wire nets (in the embodiment of the invention, it can be regarded as the utilization rate of the edge being greater than 1), it indicates that there is congestion on the edge. However, it has been observed that the congestion evaluation parameters used in the calculation process of the routing model cannot well evaluate the congestion of each edge on a given routing resource, which often requires many rounds of iterative calculations or even the problem that the model cannot converge. This situation becomes more serious as the circuits on printed circuit boards become increasingly dense, resulting in reliance on engineers to manually adjust the routing.
[0096] To solve this problem, a printed circuit board wiring method provided by an embodiment of the present invention uses a first coefficient including a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient to update the congestion evaluation parameter used in the iterative calculation of the wiring model in the process of using the wiring model to perform wiring calculation according to the task parameters of the target wiring task and the congestion evaluation parameters to avoid congestion and reduce delay to obtain the global wiring position. The first coefficient is generated according to the target wiring resources and the global wiring position obtained by the previous round of iterative calculation, thereby solving the problem that the congestion situation of the global wiring position evaluated by the wiring model is relatively rigid, and can accelerate the convergence rate of the model calculation, thereby improving the efficiency of generating the recommended global wiring position.
[0097] Based on the above architecture, the printed circuit board wiring method provided by the embodiment of the present invention is described below with reference to the accompanying drawings.
[0098] Figure 3 A flowchart of a printed circuit board wiring method provided by an embodiment of the present invention; Figure 4 A schematic structural diagram of a printed circuit board wiring system provided by an embodiment of the present invention.
[0099] like Figure 3 As shown, the printed circuit board wiring method provided by the embodiment of the present invention includes:
[0100] S31: Obtaining task parameters of the target wiring task;
[0101] S32: performing iterative calculation according to the task parameters, and generating a first coefficient according to the target wiring resources in the task parameters and the global wiring position obtained by the previous round of iterative calculation during the iterative calculation process, calculating the congestion evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation using the first coefficient, calling the wiring model to perform wiring calculation according to the task parameters, the global wiring position obtained by the previous round of iterative calculation, and the corresponding congestion evaluation parameter, and outputting the global wiring position obtained by the current round of iterative calculation;
[0102] S33: If the iteration end condition is met and a global routing position that satisfies routing is obtained, it is output as a recommended global routing position for the target routing task.
[0103] The first coefficient includes a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient; and the routing is when each wire net in the task parameter can be successfully connected on the target routing resource.
[0104] In a specific implementation, the printed circuit board wiring method provided by the embodiment of the present invention can be applied to Figure 4 The printed circuit board wiring system shown may include one or more computing devices 401. The storage space for storing wiring calculation related parameters (task parameters of the target wiring task, model parameters of the wiring model, etc.) may be provided by the computing device 401 or the storage device 402. All calculation parameters may be stored in the storage device 402, and the parameters required for the current calculation may be moved to the memory or cache of the computing device 401.
[0105] For S31, the task parameters of the target wiring task are obtained, that is, according to the information of the printed circuit board wiring system, the reading and writing positions of the wiring calculation related parameters are determined, and the computing resources and storage resources for iterative calculation are obtained, so as to carry out the transfer of the wiring calculation related parameters and call the thread that executes the calculation task.
[0106] The target board is the printed circuit board that needs to be wired. In the target wiring task, the prerequisite is that the netlist and the component layout on the target board have been determined. At this time, the extraction method in the relevant field can be used to extract the wire net to be wired from the netlist.
[0107] In the embodiment of the present invention, the task parameters of the target routing task may include the target routing resources provided by the target board, the component layout on the target board, and the wire nets to be routed.
[0108] For S32, the embodiment of the present invention uses the routing model to perform iterative calculations, and outputs a global routing position in each iterative calculation, which includes the routing trees corresponding to each wire net of the target routing task. Each wire net is continuously removed and rerouted in the iterative calculation until there is no congestion or the predetermined number of iterations is reached. To avoid congestion, the routing model uses the usage cost of the "hotspot" edge to guide the signal to use the "non-hotspot" edge.
[0109] Specifically, in the In the round iteration, the edge The congestion cost is as follows:
[0110] ;
[0111] in, Indicates that in the current round (i.e. Round) Iterative calculation of the edge Congestion evaluation, Represents edge The communication delay on Indicates in front Round iterative calculation of edges The historical congestion cost of Indicates that in the current round (i.e. Round) Iterative calculation of the edge Real-time congestion cost.
[0112] By the front Round iterative calculation of edges Historical congestion costs and in At the end of the round of iterations, the edge Number of wire nets Sure:
[0113] .
[0114] The update formula is as follows:
[0115] ;
[0116] in, Indicates that in the current round (i.e. Round) Iterative calculation of the edge The real-time congestion cost evaluation parameter is updated every time a network is wired. Indicates that in the current round (i.e. The congestion cost coefficient of the current round in the iterative calculation of rounds, , Indicates that in the previous round (i.e. The congestion cost coefficient of the current round in the iterative calculation of rounds, It is an empirical value, usually 1.3.
[0117] Although this type of wiring model is widely used in practice, it has the problem that the update of congestion evaluation parameters is too rigid, which is reflected in: historical congestion cost The update is too "aggressive". Even if an edge with severe historical congestion is not congested in recent rounds, it will still have a high historical congestion cost, thus hindering the network from making reasonable use of it. The current round congestion cost coefficient Depends on experience And its adjustment lacks flexibility, and the manual setting This is usually suboptimal. In addition, all edges share the same monotonically increasing congestion cost coefficient, which will make it impossible to deal with the specific conditions of different edges and the real-time congestion cost evaluation parameters in the current round of iterative calculations. over-adjustment.
[0118] To this end, the printed circuit board wiring method provided by the embodiment of the present invention improves the calculation method of the congestion evaluation parameter of the wiring model, and adds a first coefficient, which can be a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient. As the name implies, the historical congestion attenuation factor, that is, the update process of the historical congestion cost, is not only determined by the continuous accumulation of the number of wire nets that have used the edge in the historical iterative calculation, but also adaptively attenuates the congestion situation in the historical iterative calculation through the historical congestion attenuation factor, and weakens the impact of historical congestion that is relatively long. The current round of congestion cost coefficient update coefficient is calculated by changing the fixed coefficient that depends on the experience value into the form of the first coefficient to obtain the current round of congestion cost coefficient used to calculate the real-time congestion cost, thereby increasing the flexibility of increasing or decreasing the current round of congestion cost coefficient.
[0119] It can be understood that the added first coefficient can be one or both of the historical congestion attenuation factor and the current round congestion cost coefficient update coefficient, both of which can achieve the effect of more flexible calculation of congestion evaluation parameters compared with the current wiring model.
[0120] In some optional implementations of the embodiments of the present invention, the use of the historical congestion attenuation factor in S32 to calculate the congestion evaluation parameter corresponding to the global routing position obtained in the previous round of iterative calculation may include: for each edge of the target routing resource, according to the historical congestion attenuation factor corresponding to the edge in the current round, the historical congestion cost of the edge input in the previous round of iterative calculation, and the number of wire nets occupying the edge in the global routing position obtained in the previous round of iterative calculation, calculate the historical congestion cost corresponding to the edge in the current round; calculate the congestion cost of the edge in the current round of iterative calculation according to the historical congestion cost corresponding to the edge in the current round, the current round congestion cost of the edge, and the communication delay of the edge; use the congestion cost of each edge in the current round of iterative calculation as the congestion evaluation parameter corresponding to the global routing position obtained in the previous round of iterative calculation. Wherein, the edge is a copper wire between two grid points. The historical congestion cost in the above steps can be calculated by the following formula:
[0121] ;
[0122] in, Indicates in front Round iterative calculation of edges The historical congestion cost of Indicates in front Round iterative calculation of edges The historical congestion cost of Indicated in At the end of the round of iterations, the edge The number of wire nets, Indicates the corresponding Round iterative calculation of edges The historical congestion attenuation factor of the historical congestion cost can be .
[0123] In S32, the congestion evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation is calculated using the current round congestion cost coefficient update coefficient, which may include: for each edge of the target wiring resource, the current round congestion cost coefficient of the edge is calculated based on the current round congestion cost coefficient corresponding to the edge and the current round congestion cost coefficient of the edge input in the previous round of iterative calculation; the current round congestion cost of the edge is calculated based on the current round congestion cost coefficient of the edge and the real-time congestion cost evaluation parameter of the edge; the congestion cost of the edge in the current iterative calculation is calculated based on the current round congestion cost coefficient of the edge, the historical congestion cost corresponding to the edge in the current round, and the communication delay of the edge; the congestion cost of each edge in the current round of iterative calculation is used as the congestion evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation. Wherein, the edge is a copper wire between two grid points. The current round congestion cost coefficient in the above steps can be calculated by the following formula:
[0124] ;
[0125] in, Indicates that in the current round (i.e. Round) Iterative calculation of the edge The current round congestion cost coefficient, Indicates that in the previous round (i.e. Round) Iterative calculation of the edge The current round congestion cost coefficient, Indicates the current round (i.e. Round) Iterative calculation of the edge The current round congestion cost coefficient update coefficient.
[0126] It can be understood that if the two first coefficients, the historical congestion attenuation factor and the current round congestion cost coefficient update coefficient, are added to the calculation of the congestion evaluation parameter, the historical congestion cost and the real-time congestion cost are calculated according to the above two formulas respectively, and then substituted into Calculate the current round (i.e. Round) Iterative calculation of the edge The congestion evaluation of each edge in the current round of iterative calculation is used as the congestion evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation, and then the congestion evaluation parameter and the delay evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation are used as the current round (i.e. The input of the wiring model in the iterative calculation of round (round).
[0127] It should be noted that the specific formulas for the subsequent calculations of the two first coefficients, the historical congestion attenuation factor and the current round congestion cost coefficient update coefficient, recorded in the above implementation are only an enumeration of a preferred implementation method, and are not the only formula form protected by the embodiments of the present invention. That is, the formula for calculating the congestion evaluation parameter based on the first coefficient can also adopt other calculation methods, which all fall within the protection scope of the embodiments of the present invention.
[0128] It should be noted that in the above process of calculating the congestion evaluation parameters of the current round of iterative calculation, the current round is recorded as The corner mark used for the real-time congestion cost is , the superscript used for the historical congestion cost is , indicating that the historical congestion cost comes from the previous The historical congestion cost accumulated in the round of iterative calculations, but it is different from the superscript The real-time congestion costs are used to calculate the congestion evaluation parameters required to be input into the wiring model in the current round of iterative calculation. is the historical congestion attenuation factor corresponding to the edge in the current round, called is the historical congestion cost corresponding to the edge in the current round.
[0129] In each round of iterative calculation, a first coefficient is generated according to the target routing resources and the global routing position obtained by the previous round of iterative calculation, and the congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation is calculated using the first coefficient. The method for calculating the delay evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation can refer to the calculation scheme of the traditional routing model, and the congestion evaluation parameter and the delay evaluation parameter are used as the routing evaluation parameters. The task parameters, the global routing position obtained by the previous round of iterative calculation, and the corresponding routing evaluation parameters are input into the routing model for routing calculation, and the global routing position obtained by the current round of iterative calculation is output.
[0130] The input of the wiring model in the first round of iterative calculation may be target wiring resources and initialization parameters, and the initialization parameters include an initialized global wiring position and corresponding wiring evaluation parameters.
[0131] In various embodiments of the present invention, the intermediate parameter used to calculate the wiring evaluation parameter in combination with the first coefficient is defined as the wiring control parameter. For example, the wiring control parameter may include the historical congestion cost 、Current round congestion cost coefficient , real-time congestion cost , Use Edge Number of wire nets One or more of .
[0132] In various embodiments of the present invention, the congestion evaluation parameter in the wiring evaluation parameter may adopt the congestion cost introduced in the above steps. , the delay evaluation parameter in the wiring evaluation parameter can use the margin ratio. The margin ratio means that for each load point, the remaining margin ratio is the ratio of the delay from the driving point to the load point to the system delay.
[0133] It should be noted that, in each embodiment of the present invention, , , , etc. wiring control parameters and the first coefficient , All are high-dimensional parameters , , , , , the subscript indicates the edge set corresponding to the target routing resource All edges in , for aspect description, omitting the superscript, for example Abbreviated as or .
[0134] For S32 and S33, before starting to execute the target routing task, the maximum number of iterative calculation rounds is determined.
[0135] In addition to routing, the task objectives of the routing model may also include minimizing system delay. In the embodiment of the present invention, "net delay" may be defined as the maximum delay from the driving point in the network to all load points after routing using the global routing position, and "system delay" may be defined as the maximum delay of all network delays after routing using the global routing position. It is understandable that the system delay may also be calculated using other methods, such as the average value, median value, etc. of all network delays.
[0136] The iteration end condition may be obtaining a global routing position that is routed through, or reaching a maximum number of iteration calculation rounds.
[0137] In some optional implementations of the embodiments of the present invention, S33 may include: before the maximum number of iterative calculation rounds is exceeded, if a global routing position that satisfies routing is obtained, it is output as a recommended global routing position for the target routing task and the iterative calculation is terminated.
[0138] In some other optional implementations of the embodiments of the present invention, in order to obtain a better global routing position, S33 may also include: if a global routing position has been obtained before the maximum number of iterative calculation rounds is reached, then the iterative calculation is continued on the basis of keeping the global routing position routed to optimize the system delay until the maximum number of iterative calculation rounds is reached, and the corresponding global routing position is output as the recommended global routing position output for the target routing task and the iterative calculation is terminated.
[0139] It should be noted that the recommended global routing position is the global routing position with the best routing evaluation parameters in each round of iterative calculation, and is not necessarily the global routing position output by the last round of iterative calculation.
[0140] The printed circuit board wiring method provided by the embodiment of the present invention uses a first coefficient including a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient to update the congestion evaluation parameter used in the iterative calculation of the wiring model in the process of using the wiring model to perform wiring calculation according to the task parameters of the target wiring task and the congestion evaluation parameter to avoid congestion and reduce delay to obtain the global wiring position. The first coefficient is generated according to the target wiring resources and the global wiring position obtained by the previous round of iterative calculation, thereby solving the problem that the congestion situation of the global wiring position evaluated by the wiring model is relatively rigid, and can accelerate the convergence rate of the model calculation, thereby improving the efficiency of generating the recommended global wiring position.
[0141] Based on the above embodiment, the wiring parameters of the target wiring task can be recorded as , Represents the task parameters, represents the target routing resource, Indicates the communication delay of each edge on the target routing resource, Represents the netlist. The above task parameters are detailed as follows:
[0142] Wiring Resource Diagram ,in is the grid point set, The set of all edges in the target routing resource, without loss of generality, ,in is the number of edges.
[0143] Communication delay : Represents edge The communication delay (on the physical line).
[0144] Netlist : It consists of several wire meshes, each of which contains a driving point , one or more load points .
[0145] Under the premise of satisfying the constraint condition (each edge can only be assigned to at most one net), find the global routing position (routing tree of each net). The task objectives are as follows:
[0146] (1) Routing: Ensure that all network connections are successful, that is, all driver points and load points of all network connections can be connected through the physical lines in the target routing resources.
[0147] (2) Minimize system delay: Minimize system delay while ensuring deployment.
[0148] Figure 5 A flow chart of another printed circuit board wiring method provided by an embodiment of the present invention.
[0149] On the basis of the above-mentioned embodiments, in the printed circuit board wiring method provided by the embodiments of the present invention, S32 may include: in the first round of iterative calculation, calling the wiring model to perform wiring calculation according to the task parameters and the initialization parameters, if the obtained initial global wiring position satisfies the wiring, then terminating the iterative calculation and outputting the initial global wiring position as the recommended global wiring position; in the second and subsequent iterative calculations, generating a first coefficient according to the target wiring resources and the global wiring position obtained by the previous round of iterative calculation, using the first coefficient to calculate the congestion evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation, calling the wiring model to perform wiring calculation according to the task parameters, the global wiring position obtained by the previous round of iterative calculation and the corresponding wiring evaluation parameters, and outputting the global wiring position obtained by the current round of iterative calculation.
[0150] The initialization parameters include the initialized global wiring position and the corresponding wiring evaluation parameters.
[0151] That is to say, in the first round of iterative calculations for executing the target wiring task, a round of wiring calculations can be performed using the wiring calculation method of the traditional wiring model. It is understandable that when the target wiring resources are relatively sufficient, the initial global wiring position obtained by the first round of iterative calculations may be the global wiring position that satisfies the wiring. At this time, the iterative calculations can be terminated directly to save computing resources. When the target wiring resources are not sufficient, the initial global wiring position obtained by the first round of iterative calculations may not satisfy the wiring. At this time, the congestion evaluation parameter is calculated by the first coefficient provided by the embodiment of the present invention, and then the wiring model is called to perform wiring calculations according to the task parameters, the global wiring position obtained by the previous round of iterative calculations, and the corresponding wiring evaluation parameters.
[0152] like Figure 5 As shown, another printed circuit board wiring method provided by an embodiment of the present invention may include:
[0153] S31: Obtaining task parameters of a target routing task, where the task parameters include target routing resources provided by a target board, component layout on the target board, and wire nets to be routed;
[0154] S51: calling the wiring model to perform wiring calculation according to the task parameters and initialization parameters, and outputting the initial global wiring position;
[0155] S52: Determine whether the initial global routing position satisfies routing; if yes, proceed to S58; if no, proceed to S53;
[0156] S53: Determine whether the maximum number of iterative calculation rounds has been reached; if yes, proceed to S58; if no, proceed to S54;
[0157] S54: generating a first coefficient according to the target routing resource and the global routing position obtained by the previous round of iterative calculation, and calculating a congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation using the first coefficient;
[0158] S55: calling the wiring model to perform wiring calculation according to the task parameters, the global wiring position obtained by the previous round of iterative calculation, and the corresponding wiring evaluation parameters, and outputting the global wiring position obtained by the current round of iterative calculation;
[0159] S56: Determine whether the global routing position satisfies routing; if yes, proceed to S57; if no, proceed to S53;
[0160] S57: On the premise of maintaining the connection, minimize the system delay as the task goal and enter S53;
[0161] S58: End the iterative calculation.
[0162] In a specific implementation, the overall process of the printed circuit board wiring method provided by the embodiment of the present invention corresponds to the following inputs and outputs:
[0163] enter: , the maximum number of iterations .
[0164] in, Indicates task parameters Includes target routing resources , the communication delay of each edge on the target routing resource and netlist .
[0165] Set the expected progress value of each round of iterative calculation of the target routing task. Since the task objectives include routing and minimizing system delay, the types of expected progress values can include expected progress value for congestion and expected progress value for system delay. The expected progress value for congestion can be the reduction ratio of the edge utilization of the target routing resource after each round of iterative calculation. The expected progress value for system delay can be the reduction ratio of the system delay after each round of iterative calculation. Then the target value of each round of iterative calculation can be recorded as , where the input It represents the expected reduction ratio of the edge utilization of the target routing resource after each round of iterative calculation; Indicates the expected reduction ratio of system delay after each round of iterative calculation.
[0166] It should be noted that, in order to avoid bias caused by different dimensions, the expected improvement value of congestion and the expected improvement value of system delay are normalized in the embodiment of the present invention to ensure that the value range of the two is (-1, 1). By inputting a value greater than zero, the expected gain is reduced.
[0167] Output: global routing position (routing tree of all nets), task evaluation parameters.
[0168] In an embodiment of the present invention, corresponding to the task objectives (reducing congestion and reducing delay), the task evaluation parameters may include a task congestion evaluation parameter and a task delay evaluation parameter. Among them, the task congestion evaluation parameter may be the utilization of the edge of the target wiring resource after adopting the global wiring position. The task delay evaluation parameter may adopt the system delay. In an embodiment of the present invention, the utilization of the edge of the target wiring resource may be expressed in three forms: (1) the maximum value of the utilization of all edges in the target wiring resource may be used to represent the utilization of the edge of the target wiring resource in the current round of iterative calculation; (2) the average utilization of all edges in the target wiring resource may be used to represent the utilization of the edge of the target wiring resource in the current round of iterative calculation, and the average utilization = the sum of the utilization of all edges / the number of edges, where the edges not occupied by the wire network are not included in the denominator.
[0169] In some optional implementations of the embodiments of the present invention, calling the wiring model in S51 to perform wiring calculation according to the task parameters and the initialization parameters and outputting the initial global wiring position may include the following steps S61-S62.
[0170] S61: For all driving points and load point , initialize the margin ratio ; For the wiring resource diagram All the edges , initialize the historical congestion cost , initialize the current round congestion cost coefficient .
[0171] S62: Calling the wiring model to perform the first round of iterative calculation according to the task parameters and initialization parameters. This process can be expressed as: .
[0172] in, Represents a wiring model; Indicates line network The wiring tree obtained in the first round of iterative calculation; Indicates the average utilization rate of the edge of the target routing resource corresponding to the global routing position calculated in the first round of iteration; Indicates the system delay corresponding to the global routing position calculated in the first round of iteration; Indicates the edge corresponding to the global routing position calculated in the first round of iteration Utilization rate; Indicates the margin ratio corresponding to the global routing position obtained in the first round of iterative calculation, which will be used in the second round of iterative calculation.
[0173] S52 may include the following steps S63~S64.
[0174] S63: If the result of the first round of iterative calculation has satisfied the resource constraints, , output the initial global routing position And the corresponding task evaluation parameters , .
[0175] S64: If the result of the first round of iterative calculation does not meet the resource constraint, record , , , and perform the second and subsequent iterative calculations. Among them, represents the current optimal average utilization rate, represents the current optimal system delay, Indicates the current optimal global routing position.
[0176] The second round and subsequent iterative calculations of S53 to S58 may include the following steps S65 to S67.
[0177] S65: Order .
[0178] S66: If , then a first coefficient is generated according to the target wiring resources and the global wiring position obtained by the previous round of iterative calculation, and the first coefficient is used to calculate the congestion evaluation parameter of the global wiring position obtained by the previous round of iterative calculation, and the delay evaluation parameter of the global wiring position obtained by the previous round of iterative calculation is calculated. The process may include the following steps S661~S667.
[0179] S661: Call the first coefficient generation script to generate the first coefficient. The first coefficient generation script will be introduced in the following embodiment. The generation process of the first coefficient generation script can be expressed as PathDiffuser ,in, Indicates the corresponding Round iterative calculation of edges The historical congestion attenuation factor set of the historical congestion cost, Indicates the current round (i.e. Round) Iterative calculation of the edge The current round of congestion cost coefficient update coefficient set, PathDiffuser represents the algorithm used to generate the first coefficient, Represents the wiring resource diagram, Indicates in front Round iterative calculation of edges The historical congestion cost set of Indicated in At the end of the round of iterations, the edge The number of network sets, Indicates that in the previous round (i.e. Round) Iterative calculation of the edge The current round congestion cost coefficient set, Indicates that in the previous round (i.e. The global wiring position obtained in the iterative calculation of rounds, Indicates the task objective.
[0180] S662: For all edges , update the historical congestion cost: .
[0181] S663: For all edges , set the current round congestion cost coefficient for calculating the current round congestion cost: .
[0182] S664: calling the routing model to perform routing calculation according to the task parameters, the global routing position obtained by the previous round of iterative calculation, and the corresponding routing control parameters. This process can be expressed as: .
[0183] S665: Record the best result obtained during the iterative calculation process. and Then update: That is to say, if the current round (i.e. The average utilization of the edge of the target routing resource corresponding to the global routing position iteratively calculated in the current round (i.e., the first round) is less than or equal to the optimal average utilization, and If the system delay corresponding to the global routing position calculated iteratively in the current round (i.e. the first round) is less than or equal to the optimal system delay, then the current round (i.e. the first round) is used to The two parameters calculated iteratively (round) update the current optimal average utilization and the current optimal system delay .
[0184] S666: If the global routing position obtained by the current round of iterative calculation has avoided congestion, that is, it has satisfied the routing, then the congestion avoidance state can be maintained in the subsequent steps. The corresponding setting is: , then set .
[0185] S667: Order for .
[0186] S67: Output the optimal global routing position in each round of iterative calculation , the corresponding optimal average utilization and optimal system delay .
[0187] Based on the above embodiment, the embodiment of the present invention further illustrates the steps of performing wiring calculation using a wiring model.
[0188] The routing model is responsible for performing a round of routing calculations for all nets based on specific parameters. Its input and output include:
[0189] enter: 、Historical congestion cost , the coefficient of the current round of congestion cost , margin ratio ;
[0190] Output: global routing position (routing tree of all wire nets), average utilization of edges of target routing resources, system delay, congestion level of all edges of target routing resources (which can be expressed by the number of wire nets using the edge), and updated margin ratio.
[0191] In S51 and S55 , the wiring model is called to perform wiring calculation, which may specifically include the following steps S71 to S77 .
[0192] S71: sort the netlist by the number of driving points from large to small Without loss of generality, let the ordered list be The wire network in .
[0193] S72: For each line network Initialize the wiring tree : Set the root node to The driving point Points in the 3D grid ; For each edge , initialized through the edge The number of wire nets is .
[0194] S73: For , perform the following steps S731 to S733. Among them, Indicates the total number of network lines.
[0195] S731: According to the margin ratio from large to small Sort the pins by The sorted pin list is ,in for The number of pins in the The node in the wiring resource graph is .
[0196] S732: For , execute the following calculation steps S7321~S7325.
[0197] S7321: Initialize small root heap Is empty.
[0198] S7322: Initialize the hash table that maps nodes to their parent nodes .
[0199] S7323: Traversal , for each node in the wiring tree , perform the following calculation steps:
[0200] like It is the driving point If the node is located, set Otherwise, if It is a pin If the node is located, set ,in for arrive delay; if exist Medium to The path is: , then calculate : ;in, Represents edge The communication delay between join in .
[0201] S7324: Repeat the following calculation steps S73241~S73243 until the pin is found .
[0202] S73241: From Out of the pile .
[0203] S73242: Determine whether If yes, then end; if no, then go to S73243.
[0204] S73243: Traversal In the wiring resource diagram Neighbor nodes in , perform the following steps:
[0205] like Never added to In, then:
[0206] Calculate the edge in the current round of iteration calculation Real-time congestion cost: ;
[0207] Calculate the edge in the current round of iteration calculation The congestion cost is: ;
[0208] Compute Node Weight: ;
[0209] set up ; and join in , returns S73241.
[0210] in, Indicates that the edge is used in the current round of iterative calculation The number of wire nets, Indicates that in the current round of iterative calculation, the edge The current round congestion cost coefficient, Represents edge The communication delay, Indicates the edge corresponding to the current round of iterative calculation The historical congestion cost.
[0211] S7325: Update the routing tree to obtain the global routing position obtained by the current round of iterative calculation, specifically including:
[0212] Construct a list: [ ],in: , , For this list, the first Nodes in
[0213] right , and As The child node is added middle;
[0214] right , and Updated to .
[0215] S733: Update the congestion level of each edge in the target routing resource according to the global routing position calculated by the current round of iteration, including: Each edge in ,renew .
[0216] S74: Calculate the average utilization rate corresponding to the global routing position obtained by the current round of iterative calculation: .in, Indicates the number of edges whose utilization is not 0.
[0217] S75: Calculate the system delay corresponding to the global routing position obtained by the current round of iterative calculation: ,in Indicates line network delay.
[0218] S76: Calculate the margin ratio corresponding to the global routing position obtained by the current round of iteration, including: , for each of its pins ,renew ,in, for Driving point The corresponding nodes in the three-dimensional grid diagram are for The corresponding node in the 3D grid graph.
[0219] S77: Return , the updated margin ratio .
[0220] Based on the above embodiment, the embodiment of the present invention further illustrates the step of generating the first coefficient.
[0221] In the embodiment of the present invention, the first coefficient is generated according to the target wiring resource and the global wiring position obtained by the previous round of iterative calculation in S32, and the generation model can be used for generation. The generation model can be a variational autoencoder, a diffusion model, etc.
[0222] Taking the variational autoencoder as an example, generating the first coefficient according to the target wiring resources and the global wiring position obtained by the previous round of iterative calculation in S32 may include: inputting the task target of the target wiring task, the wiring control parameters of the wiring model input by the previous round of iterative calculation, and the global wiring position obtained by the previous round of iterative calculation into the variational autoencoder, so as to generate the first coefficient using the variational autoencoder.
[0223] Among them, the task target of the target wiring task, the wiring control parameters of the wiring model input in the previous round of iterative calculation, and the global wiring position obtained in the previous round of iterative calculation are input into the variational autoencoder to generate the first coefficient using the variational autoencoder, which can include: using the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, sampling the first candidate latent vector from the first conditional probability distribution of the given control information, sampling the target latent vector from the second conditional probability distribution of the given control information and the first candidate latent vector, and decoding the target latent vector to obtain the first coefficient. This process can be implemented using a trained variational autoencoder, and the generation process of the variational autoencoder can also be described as: using a variational autoencoder For the ideal target latent vector Model the distribution of . Variational Autoencoder To achieve and Two parts. From variational autoencoder The target latent vector is sampled from Only two steps are needed: From Sampling ,from The target latent vector is sampled from . and are all modeled as Gaussian distributions. Indicates control information. represents the first conditional probability distribution, represents the first candidate latent vector, represents the second conditional probability distribution, Represents the actually sampled target latent vector, which can be decoded to obtain the first coefficient.
[0224] Taking the diffusion model as an example, generating the first coefficient according to the target wiring resources and the global wiring position obtained by the previous round of iterative calculation in S32 may include: inputting the task target of the target wiring task, the wiring control parameters of the wiring model input in the previous round of iterative calculation, and the global wiring position obtained by the previous round of iterative calculation into the diffusion model, so as to use the diffusion model to perform denoising calculation for a first preset number of steps, and output the first coefficient of the current round of iterative calculation.
[0225] Among them, the task objective of the target wiring task, the wiring control parameters of the wiring model input in the previous round of iterative calculation, and the global wiring position obtained by the previous round of iterative calculation are input into the diffusion model, so as to use the diffusion model to perform denoising calculation for a first preset number of steps, and output the first coefficient of the current round of iterative calculation, which may include: Gaussian noise obtained by sampling from a standard normal distribution; using a fractional network in the diffusion model and a classification network in the diffusion model, according to the task objective of the target wiring task, the wiring control parameters of the wiring model input in the previous round of iterative calculation, the global wiring position obtained by the previous round of iterative calculation, and Gaussian noise, performing denoising calculation for a first preset number of steps to obtain a denoised vector; and performing inverse quantization calculation on the denoised vector obtained by the last step of denoising calculation to obtain the first coefficient of the current round of iterative calculation.
[0226] That is to say, the diffusion model generates the first coefficient by using the task target of the target wiring task, the wiring control parameters of the wiring model input in the previous round of iterative calculation, and the global wiring position guidance obtained in the previous round of iterative calculation. First, the input parameters are vectorized, and a random noise is initialized as the starting point of the generation process. The vectorized parameters and the noise are input into the diffusion model together for reverse diffusion, that is, the noise is gradually removed and the first coefficient is generated. In each step of denoising calculation, the diffusion model predicts the noise component in the current noise, and performs denoising on the current noise, thereby gradually recovering the first coefficient.
[0227] In some optional implementations of the embodiments of the present invention, using the score network in the diffusion model and the classification network in the diffusion model, performing denoising calculation for a first preset number of steps according to the task target of the target routing task, the routing control parameters of the input routing model in the previous round of iterative calculation, the global routing position obtained in the previous round of iterative calculation, and Gaussian noise to obtain the denoising vector may include:
[0228] Before the number of denoising steps reaches the first preset number of steps, the following calculation is performed in the current denoising calculation:
[0229] The denoising vector obtained by the previous denoising calculation, the implicit guide vector obtained by the previous denoising calculation, the remaining denoising steps corresponding to the previous denoising calculation, the global routing position and the target routing resource obtained by the previous round of iteration calculation are input into the fractional network to obtain the fractional network calculation result;
[0230] The classification network is used to calculate the denoising vector obtained from the previous denoising calculation, the implicit guidance vector obtained from the previous denoising calculation, the remaining denoising steps corresponding to the previous denoising calculation, the global routing position obtained from the previous iteration, and the gradient data of the target routing resource compared to the task target;
[0231] According to the denoising vector obtained by the previous denoising calculation, the noise obtained by sampling, the score network calculation result, and the gradient data, the denoising vector corresponding to the current denoising calculation is calculated.
[0232] Among them, in the first denoising calculation, the denoising vector obtained by the previous denoising calculation is Gaussian noise; the implicit guidance vector is generated by adding noise to the wiring control parameters corresponding to the global wiring position obtained by the previous round of iterative calculation.
[0233] That is, the diffusion model is based on the mission objectives 、Historical congestion cost , edge utilization , the current round congestion cost coefficient , global routing location , Wiring Resource Diagram Generate historical congestion reduction factors and the current round congestion cost coefficient update coefficient .
[0234] Among them, the mission objectives The expected improvement value of congestion situation (such as the reduction ratio of average utilization) and the expected improvement value of system delay (such as the reduction ratio of system delay) can be used.
[0235] Then the input and output of the diffusion model can be set as:
[0236] Input: Front Historical congestion cost of round , No. Utilization rate of wheel center edge , No. The congestion cost coefficient of the current round used by the round , the target value vector , No. Wheel wiring results .
[0237] Output: and .
[0238] On this basis, the algorithm implementation of generating the first coefficient using the diffusion model may include the following steps S81 to S85.
[0239] S81: Sampling from a standard normal distribution ;in represents the sampled Gaussian noise, The dimension is ; is a hyperparameter representing the number of denoising steps.
[0240] S82: Vectorize the historical congestion cost, the utilization of the edge in the target routing resource, and the current round congestion cost coefficient. This process can be expressed as ;in, Represents the high-dimensional control information generated according to the routing evaluation parameters corresponding to the global routing position calculated in the previous round of iterations, Represents vectorized processing, Represents vector concatenation processing.
[0241] In the embodiment of the present invention, vectorization processing The meaning is: Assume that the edge set of the target routing resource The edges in have a certain order. , then for the set , converting it into a column vector , ,in for No. A quantity.
[0242] Vector stitching processing The meaning is to vertically connect the input column vector to get a new column vector.
[0243] S83: Yes , execute the following steps S831~S832.
[0244] S831: Controlling high-dimensional information Add noise to generate implicit guidance vectors : .in, is the noise obtained by sampling, where , represents the intermediate variable, is a hyperparameter.
[0245] S832: Perform denoising calculation: .
[0246] in, represents the denoising vector obtained by the denoising calculation of the current step, represents the denoised vector obtained by the previous denoising calculation, Indicates the hyperparameters corresponding to the current denoising calculation, represents the fractional network in the diffusion model, represents the implicit guidance vector corresponding to the current step denoising calculation, represents the remaining denoising steps, Indicates the last round ( The global wiring position is calculated iteratively (round), Represents the wiring resource diagram, represents the classification network in the diffusion model, represents the derivative calculation, It can be calculated by feedforward Then, the automatic derivation mechanism is used to calculate: Indicates the task objective, From the standard normal distribution The noise of the sampling.
[0247] It should be noted that the above denoising calculation formula includes a solution for generating the first coefficient of a hybrid guided diffusion model provided by an embodiment of the present invention, wherein: The display guidance process defined in the embodiment of the present invention is to solve , , , , Compared to the mission objectives The gradient data is used to guide the diffusion model to perform denoising calculations. As described in the above embodiment of the present invention, the task goal of the current round of iterative calculations is It may include the reduction ratio of average utilization and the reduction ratio of system delay, which is a low-dimensional control information. The gradient calculation process is relatively simple, and the diffusion model can be directly guided to generate the first coefficient by calculating the gradient.
[0248] and The implicit guidance process defined in the embodiment of the present invention means that the high-dimensional control information Add noise as the input of the denoising network because the high-dimensional control information The wiring control parameters in are all high-dimensional parameters. In addition to the specific wiring control parameters, they also include the dimension of the iterative calculation round and the dimension of the edge index. If the gradient descent optimization is performed directly by using the gradient data to guide the diffusion model, it may cause the classification network in the diffusion model to be difficult to solve the classification result. The implicit guidance scheme provided by the embodiment of the present invention converts the high-dimensional control information into Adding noise as the input of the denoising network will not cause the denoising network to be difficult to optimize, so it can speed up the denoising calculation of the diffusion model.
[0249] It can be understood that in some other optional implementations of the embodiment of the present invention, the task goal can also be and high-dimensional control information Both use an explicit guidance method, that is, guiding the denoising calculation of the diffusion model by finding the gradient.
[0250] S84: Perform inverse quantization calculation on the denoised vector obtained by the last step of denoising calculation to obtain the first coefficient. This process can be expressed as the following formula:
[0251] ;
[0252] ;
[0253] in, Represents the set of historical congestion attenuation factors required for the current round of iterative calculation, Represents the set of update coefficients of the current round of congestion cost coefficients required for the current round of iterative calculation, represents the inverse quantization process, represents the Sigmoid function, represents the denoised vector obtained by the last denoising step, express No. dimensional components, express No. dimensional components, represents the hyperbolic tangent function.
[0254] In the embodiment of the present invention, the inverse quantization process The meaning of is to convert a vector into a set. For example, Dimensional vector , converting it into a set ,in .
[0255] S85: Output the set of historical congestion attenuation factors required for the current round of iterative calculation , the current round of congestion cost coefficient update coefficient set required for the current round of iterative calculation .
[0256] The score network is a key component of the diffusion model, which is used to guide the denoising in the generation process, thereby generating the first coefficient. The score network includes a representation layer and an output layer. In an embodiment of the present invention, the representation layer of the score network is designed to extract the implicit representation of the edge, and the output layer is used to map the implicit representation of each edge into a two-dimensional vector.
[0257] In an embodiment of the present invention, the calculation step of the score network may include: constructing an edge in the target wiring resource and a node in the global wiring position into an association relationship graph; extracting an implicit representation of the edge according to the association relationship graph using a graph convolutional network; and obtaining a score network output result based on the implicit representation calculation. Wherein, an edge is a copper wire between two grid points.
[0258] In the representation layer of the score network, in order to extract the implicit representation of the edge, we first need to characterize the relationship between the edges. and edge , adjust the edge The coefficient opposite to The greater the impact, the closer the relationship between the two. and edge The more wire nets there are, the closer the relationship between the two is. Therefore, in the backbone network, the association relationship graph between the edges is first extracted according to the input global wiring position. , and then use the association diagram To extract the implicit representation of the edge.
[0259] The input and output of the representation layer of the score network can be:
[0260] Input: Denoised vector , high-dimensional control information , denoising time step , global routing location , Wiring Resource Diagram ;
[0261] Output: latent representation of each edge.
[0262] Based on this, the calculation process of the score network may include the following steps S91 to S96.
[0263] S91: Constructing an association diagram , specifically may include the following steps S911~S914.
[0264] S911: For all edges in the target routing resource ,initialization ,in All the edges passing through A set of pin pairs, Represents the empty set.
[0265] S912: Yes , execute the following steps S9121~S9122.
[0266] S9121: Note The root node is .
[0267] S9122: Yes Each leaf node of , for arrive Each edge on the path ,Will Updated to .
[0268] S913: For each edge Create a Node .
[0269] S914: For each pair of edges and ,like , then in and Add an edge between them. The weight of the edge is calculated by the following formula:
[0270] ;
[0271] in, Representation Node and The weight of the edge between Represents all the edges passing through A collection of pin pairs.
[0272] S92: Generate association diagram The characteristic matrix of the vertices in is: .in, represents the feature matrix, represents vector stacking processing, represents the denoised vector obtained by the previous denoising calculation, express No. dimensional components, express No. dimensional components, Representing high-dimensional control information No. dimensional components, express No. dimensional components, express No. dimensional components, represents the remaining denoising steps, express dimensional all-1 vector, .
[0273] S93: Remember the association diagram The weighted adjacency matrix of , where the elements for:
[0274] .
[0275] in, Representation Node and The weight of the edge between .
[0276] S94: From the wiring resource map The adjacency relationship between the extracted edges is:
[0277] ;
[0278] in, Represents edge and edge adjacency relationship.
[0279] S95: Passed Layer graph convolutional networks extract implicit representations of edges: .in, . is the learnable parameter matrix. ,other is a hyperparameter. The graph convolutional network The hidden representation calculated by the layer.
[0280] S96: Perform output layer calculation of the score network, which may include: ,according to calculate .in, represents the first column of the resulting matrix, represents the second column of the resulting matrix. is a learnable parameter. and The vector obtained after splicing The network outputs the result as a score.
[0281] Classification networks exploit low-dimensional information Specifically, after a round of routing through the generated global routing positions, it is expected that the average utilization of the target routing resources will be relatively reduced compared to the global routing positions of the previous round. And the system delay is relatively reduced .
[0282] In an embodiment of the present invention, the calculation steps of the classification network may include: determining the expected progress value of each round of iterative calculation toward the task goal according to the task goal; performing vectorization processing according to the expected progress value to obtain an embedding vector corresponding to the task goal; calculating the matrix representation corresponding to the association relationship graph according to the latent representation; calculating the probability value according to the embedding vector corresponding to the task goal and the matrix representation corresponding to the association relationship graph; and outputting the probability value.
[0283] The input and output of the representation layer of the classification network can be:
[0284] Input: Denoised vector , high-dimensional control information , denoising time step , global routing location , Wiring Resource Diagram , Mission Objectives ;
[0285] Output: probability value .
[0286] Based on this, the calculation process of the classification network may include the following steps S101 to S104.
[0287] S101: Mission Target The embedding may specifically include the following steps S1011 to S1014.
[0288] S1011: The interval Discretize into ,in is a hyperparameter, which indicates the step size of discretization.
[0289] S1012: Each element in Both correspond to two learnable embedding vectors and . Representation Elements The corresponding congestion embedding vector, Representation Elements The corresponding delay embedding vector.
[0290] S1013: Note Medium distance The most recent number is ,Pick Similarly, remember Middle distance The most recent number is ,Pick .in, is the intermediate variable, Representation Elements The corresponding congestion embedding vector, is the intermediate variable, Representation Elements The corresponding delay embedding vector.
[0291] S1014: Take As The embedding vector of . Represents vector concatenation processing.
[0292] S102: Using the representation layer to remove noise vector , high-dimensional control information , denoising time step , global routing location , Wiring Resource Diagram Extracting implicit representations of edges , the specific steps can refer to S91~S95, that is, the representation layer of the classification network can reuse the representation layer of the score network.
[0293] S103: Based on implicit representation , calculate the association graph Representation : .in, Representation Matrix No. OK.
[0294] S104: Calculate probability value:
[0295] ;
[0296] in, express The transpose of represents a dummy variable, Represents exponential operation.
[0297] Based on the above embodiment, the embodiment of the present invention describes the training steps of the diffusion model for generating the first coefficient.
[0298] In an embodiment of the present invention, the training step of the diffusion model may include: obtaining a diffusion model training data set, the diffusion model training data set includes multiple sample wiring tasks, and the sample task parameters of each sample wiring task include sample wiring resources, the communication delay of the edge in the sample wiring resources, and the sample netlist to be wired; sampling diffusion model training samples from the diffusion model training data set to construct a diffusion model training sample pool, the sample parameters of the diffusion model training samples include sample wiring resources, wiring control parameters of the input wiring model, the global wiring position calculated using the wiring model, and the first coefficient calculated accordingly; using the diffusion model training sample pool to train the score network and the classification network.
[0299] The diffusion model training samples obtained by sampling from the diffusion model training data set may include:
[0300] Initialize the diffusion model training sample pool to be empty and the sample parameter queue to be empty;
[0301] A sample routing task is sampled from the self-diffusion model training data set, and the routing model is called to perform routing calculation according to the sample task parameters and initialization parameters of the sample routing task. The sample task parameters, the routing control parameters input to the routing model, the global routing position output by the routing model, and the corresponding calculated routing evaluation parameters are added to the sample parameter queue as a set of candidate sample parameters;
[0302] If the number of samples in the diffusion model training sample pool is less than the preset number of samples, perform the following steps:
[0303] Sampling candidate sample parameters from the sample parameter queue, and updating the congestion evaluation parameters in the candidate sample parameters using the first coefficient of random sampling, calling the routing model to perform routing calculation according to the sample task parameters, delay evaluation parameters and updated congestion evaluation parameters in the candidate sample parameters, and obtaining an updated global routing position and the corresponding calculated routing evaluation parameters;
[0304] Adding the sample task parameters, the updated global wiring position and the corresponding calculated wiring evaluation parameters in the candidate sample parameters to the sample parameter queue;
[0305] The sample wiring resources in the candidate sample parameters, the wiring control parameters of the corresponding input wiring model, the sample task objectives in the candidate sample parameters, the global wiring position before updating, and the first coefficient of random sampling are added to the diffusion model training sample pool as the sample parameters of a diffusion model training sample.
[0306] The input and output of the algorithm of the above process are:
[0307] Input: Diffusion model training dataset , preset sample size ;
[0308] Output: Diffusion model training sample pool .
[0309] The algorithm steps may include the following steps S111 to S114.
[0310] S111: Initialize the diffusion model training sample pool for , sample parameter queue for .
[0311] S112: Sample a ,right Each network in , and its driving point is , for each load point of the network , initialize the margin ratio For all edges in the three-dimensional grid , initialize the historical congestion cost , the current round congestion cost coefficient .
[0312] S113: Calculate the initial global routing position using the routing model according to the task parameters, historical congestion cost, current round congestion cost coefficient and margin ratio And the corresponding wiring control parameters, the process can be expressed as . Set the sample parameters Add sample parameter queue ,in . Indicates the system delay of the current round.
[0313] S114: If the number of samples in the diffusion model training sample pool Less than the preset sample size , then execute the following steps S1141~S1146.
[0314] S1141: From the sample parameter queue Randomly sample a candidate sample parameter .
[0315] S1142: Random sampling , .
[0316] S1143: For all edges ,set up , .
[0317] S1144: Using the routing model, the global routing position of the current round of iterative calculation and the corresponding routing evaluation parameters are calculated according to the task parameters, the historical congestion cost, the current round of congestion cost coefficient and the margin ratio. This process can be expressed as: . Indicates The system delay of the wheel.
[0318] S1145: Add the wiring evaluation parameters and task evaluation parameters obtained in S1144 to the sample parameter queue , that is, a sample parameter includes ,in .
[0319] S1146: Diffusion model training samples Add diffusion model training sample pool .
[0320] In order to avoid the bias caused by different dimensions, the embodiment of the present invention normalizes the reduction of average utilization and the reduction of system delay to ensure that the value range of the two is within middle:
[0321] ;
[0322] in, Indicates the number of wire nets, Indicates The system delay of the wheel, Indicates the delay of the edge with the largest delay in the routing resource graph.
[0323] In the training process of the diffusion model provided by the embodiment of the present invention, using the diffusion model training sample pool to train the score network may include:
[0324] Sampling a first preset number of diffusion model training samples from the diffusion model training sample pool, and performing the following steps on each diffusion model training sample obtained by sampling:
[0325] After vectorizing the wiring control parameters of the input wiring model corresponding to the diffusion model training sample, adding noise to the wiring control parameters of the input wiring model corresponding to the diffusion model training sample according to the noise adding step obtained by random sampling to obtain an implicit guidance vector corresponding to the diffusion model training sample;
[0326] Adding noise to a denoised vector calculated according to a first coefficient randomly sampled from a diffusion model training sample to obtain a noisy vector corresponding to the diffusion model training sample;
[0327] According to the implicit guidance vector corresponding to the diffusion model training samples and the noise vector corresponding to the diffusion model training samples, the gradient descent method is used to update the network parameters of the score network.
[0328] The input and output of the algorithm of the above process are:
[0329] Input: Diffusion model training sample pool , number of training steps , learning rate ;
[0330] Output: trained score network .
[0331] The algorithm steps may include the following steps S121~S122.
[0332] S121: Random Initialization . Represents the initial model parameters of the score network.
[0333] S122: Yes , execute the following steps S1221~S1222.
[0334] S1221: Training sample pool from diffusion model Sampling Diffusion model training samples.
[0335] S1222: For each diffusion model training sample , execute the following steps S12221~S12226.
[0336] S12221: Record diffusion model training samples for .
[0337] S12222: Yes After vectorization, vector concatenation is performed to obtain high-dimensional control information. :
[0338] .
[0339] S12223: From A noise step is sampled from .
[0340] S12224: Controlling high-dimensional information Add noise: .in, represents the high-dimensional control information after noise addition, Indicates from The noise obtained by sampling is , is the intermediate variable, , is a hyperparameter.
[0341] S12225: Yes Add noise: ,in, Represents diffusion model training samples The denoising vector used to generate the first coefficient in Represents diffusion model training samples The corresponding noise vector is, Indicates from The noise obtained by sampling is .
[0342] S12226: Update the network parameters of the score network using the gradient descent method:
[0343] ;
[0344] in, represents the network parameters of the updated score network, represents the network parameters of the score network obtained from the previous round of iterative training, represents the learning rate, Represents derivative calculation.
[0345] In the training process of the diffusion model provided by the embodiment of the present invention, using the diffusion model training sample pool to train the classification network may include:
[0346] Sampling a second preset number of diffusion model training samples from the diffusion model training sample pool, and performing the following steps on each diffusion model training sample obtained by sampling:
[0347] After vectorizing the wiring control parameters of the input wiring model corresponding to the diffusion model training sample, adding noise to the wiring control parameters of the input wiring model corresponding to the diffusion model training sample according to the noise adding step obtained by random sampling to obtain an implicit guidance vector corresponding to the diffusion model training sample;
[0348] Adding noise to a denoised vector calculated according to a first coefficient randomly sampled from a diffusion model training sample to obtain a noisy vector corresponding to the diffusion model training sample;
[0349] According to the implicit guidance vector corresponding to the diffusion model training samples and the noise vector corresponding to the diffusion model training samples, the gradient ascent method is used to update the network parameters of the classification network.
[0350] The input and output of the algorithm of the above process are:
[0351] Input: Diffusion model training sample pool , number of training steps , learning rate ;
[0352] Output: trained score network .
[0353] The algorithm steps may include the following steps S131~S132.
[0354] S131: Random Initialization . Represents the initialization model parameters of the classification network.
[0355] S132: Yes , execute the following steps S1321~S1322.
[0356] S1321: Training sample pool from diffusion model Sampling Diffusion model training samples.
[0357] S1322: For each diffusion model training sample , execute the following steps S13221~S13226.
[0358] S13221: Record diffusion model training samples for .
[0359] S13222: Yes After vectorization, vector concatenation is performed to obtain high-dimensional control information. :
[0360] .
[0361] S13223: From A noise step is sampled from .
[0362] S13224: Controlling high-dimensional information Add noise: .in, represents the high-dimensional control information after noise addition, Indicates from The noise obtained by sampling is , is the intermediate variable, , is a hyperparameter.
[0363] S13225: Vector Add noise: ,in, Represents diffusion model training samples The denoising vector used to generate the first coefficient in Represents diffusion model training samples The corresponding noise vector is, Indicates from The noise obtained by sampling is .
[0364] S13226: Update the network parameters of the classification network using the gradient descent method:
[0365] ;
[0366] in, represents the updated network parameters of the classification network, represents the network parameters of the classification network obtained from the previous round of iterative training, represents the learning rate, represents the derivative calculation, represents the number of diffusion model training samples sampled, Represents diffusion model training samples mission objectives.
[0367] It should be noted that in the embodiments of the printed circuit board wiring method of the present invention, some of the steps or features can be ignored or not executed. The hardware or software functional modules divided for the convenience of explanation are not the only implementation form of the printed circuit board wiring method provided by the embodiment of the present invention.
[0368] The above describes in detail various embodiments corresponding to the printed circuit board wiring method. On this basis, the present invention also discloses a printed circuit board wiring device, equipment, non-volatile storage medium and computer program product corresponding to the above method.
[0369] The printed circuit board wiring device provided by the embodiment of the present invention may include:
[0370] An acquisition unit, used for acquiring task parameters of a target wiring task;
[0371] A wiring calculation unit is used to perform iterative calculation according to task parameters, and during the iterative calculation process, generate a first coefficient according to the target wiring resources in the task parameters and the global wiring position obtained by the previous round of iterative calculation, use the first coefficient to calculate the congestion evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation, call the wiring model to perform wiring calculation according to the task parameters, the global wiring position obtained by the previous round of iterative calculation, and the corresponding congestion evaluation parameter, and output the global wiring position obtained by the current round of iterative calculation; if the iteration end condition is met and a global wiring position that satisfies the routing is obtained, it is output as a recommended global wiring position for the target wiring task.
[0372] The first coefficient includes a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient; and the routing is when each wire net in the task parameter can be successfully connected on the target routing resource.
[0373] The printed circuit board wiring device provided in the embodiment of the present invention may further include:
[0374] A training unit is used to train a diffusion model, which is used to perform a denoising calculation for a first preset number of steps according to the task objective of the target wiring task, the wiring evaluation parameters of the wiring model input in the previous round of iterative calculation, and the global wiring position obtained in the previous round of iterative calculation, and output a first coefficient of the current round of iterative calculation.
[0375] It should be noted that in each implementation of the printed circuit board wiring device provided by the embodiment of the present invention, the division of units is only a logical functional division, and other division methods can be used. The connection method between different units can be electrical, mechanical or other connection methods. The separated units can be located in the same physical location or distributed on multiple network nodes. Each unit can be implemented in the form of hardware or in the form of a software functional unit. That is, part or all of the units provided in the embodiment of the present invention can be selected according to actual needs and the corresponding connection method or integration method can be adopted to achieve the purpose of the embodiment of the present invention.
[0376] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0377] Figure 6 A schematic structural diagram of a printed circuit board wiring device provided by an embodiment of the present invention.
[0378] like Figure 6 As shown, the printed circuit board wiring device provided in an embodiment of the present invention includes: a memory 610, used to store a computer program 611; a processor 620, used to execute the computer program 611, and when the computer program 611 is executed by the processor 620, the steps of the printed circuit board wiring method provided in any one of the above embodiments are implemented.
[0379] Among them, the processor 620 may include one or more processing cores, such as a 3-core processor, an 8-core processor, etc. The processor 620 may be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 620 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 620 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 620 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0380] The memory 610 may include one or more non-volatile storage media, which may be non-transitory. The memory 610 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 610 is at least used to store the following computer program 611, wherein the computer program 611, after being loaded and executed by the processor 620, can implement the relevant steps in the printed circuit board wiring method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 610 may also include an operating system 612 and data 613, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 612 may be Windows or other types of operating systems. The data 613 may include but is not limited to the data involved in the above method.
[0381] In some embodiments, the printed circuit board wiring device may further include a display screen 630 , a power supply 640 , a communication interface 650 , an input / output interface 660 , a sensor 670 , and a communication bus 680 .
[0382] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation of the printed circuit board wiring device, and may include more or fewer components than shown.
[0383] The printed circuit board wiring device provided in the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the steps of the printed circuit board wiring method provided in the above embodiment, and the effect is the same as above.
[0384] An embodiment of the present invention provides a non-volatile storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the printed circuit board wiring method provided in any one of the above embodiments can be implemented.
[0385] The non-volatile storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0386] For the introduction of the non-volatile storage medium provided in the embodiment of the present invention, please refer to the above method embodiment, and the effect thereof is the same as the printed circuit board wiring method provided in the embodiment of the present invention, and the present invention will not be elaborated here.
[0387] An embodiment of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the printed circuit board wiring method provided in any one of the above embodiments are implemented.
[0388] For an introduction to the computer program product provided by the embodiment of the present invention, please refer to the above method embodiment, and the effect thereof is the same as the printed circuit board wiring method provided by the embodiment of the present invention, and the present invention will not elaborate on it here.
[0389] The above is a detailed introduction to a printed circuit board wiring method, device, medium and computer program product provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the devices, equipment, non-volatile storage media and computer program products disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified in a number of ways, and these improvements and modifications also fall within the scope of protection of the present invention.
[0390] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A printed circuit board wiring method, characterized in that: include: Get the task parameters of the target wiring task; Iterative calculation is performed according to the task parameters, and during the iterative calculation process, a first coefficient is generated according to the target wiring resources in the task parameters and the global wiring position obtained in the previous round of iterative calculation, the congestion evaluation parameter corresponding to the global wiring position obtained in the previous round of iterative calculation is calculated using the first coefficient, the wiring model is called to perform wiring calculation according to the task parameters, the global wiring position obtained in the previous round of iterative calculation, and the corresponding congestion evaluation parameter, and the global wiring position obtained in the current round of iterative calculation is output; If the iteration end condition is met and a global routing position that satisfies routing is obtained, it is output as a recommended global routing position for the target routing task; Wherein, the first coefficient includes a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient; the routing is that each wire net in the task parameter can be successfully connected on the target routing resource; Generating a first coefficient according to the target routing resource and the global routing position obtained by the previous round of iterative calculation, including: inputting the task target of the target routing task, the routing control parameter input into the routing model by the previous round of iterative calculation, and the global routing position obtained by the previous round of iterative calculation into a diffusion model, so as to perform a denoising calculation for a first preset number of steps by using the diffusion model, and outputting the first coefficient of the current round of iterative calculation; The task objective of the target routing task, the routing control parameters input into the routing model in the previous round of iterative calculation, and the global routing position obtained in the previous round of iterative calculation are input into a diffusion model, so as to use the diffusion model to perform denoising calculation for a first preset number of steps, and output the first coefficient of the current round of iterative calculation, including: Gaussian noise sampled from a standard normal distribution; using a fractional network in the diffusion model and a classification network in the diffusion model, according to the task objective of the target routing task, the routing control parameters input into the routing model in the previous round of iterative calculation, the global routing position obtained in the previous round of iterative calculation, and the Gaussian noise, perform denoising calculation for the first preset number of steps to obtain a denoised vector; and perform inverse quantization calculation on the denoised vector obtained in the last step of denoising calculation to obtain the first coefficient of the current round of iterative calculation.
2. The printed circuit board wiring method according to claim 1, characterized in that: The congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation is calculated using the historical congestion attenuation factor, including: For each edge of the target routing resource, the historical congestion cost corresponding to the edge in the current round is calculated according to the historical congestion attenuation factor corresponding to the edge in the current round, the historical congestion cost of the edge input in the previous round of iterative calculation, and the number of nets occupying the edge in the global routing position obtained in the previous round of iterative calculation; Calculate the congestion cost of the edge in the current round of iterative calculation according to the historical congestion cost corresponding to the edge in the current round, the current round congestion cost of the edge, and the communication delay of the edge; The congestion cost of each edge in the current round of iterative calculation is used as the congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation; Wherein, the edge is a copper wire between two grid points.
3. The printed circuit board wiring method according to claim 1, characterized in that: The congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation is calculated using the current round of congestion cost coefficient update coefficient, including: For each edge of the target routing resource, the current round congestion cost coefficient of the edge is calculated according to the current round congestion cost coefficient update coefficient corresponding to the edge in the current round and the current round congestion cost coefficient of the edge input in the previous round of iterative calculation; The current round congestion cost of the edge is calculated according to the current round congestion cost coefficient of the edge and the real-time congestion cost evaluation parameter of the edge; Calculate the congestion cost of the edge in the current iterative calculation according to the current round congestion cost coefficient of the edge, the historical congestion cost corresponding to the edge in the current round, and the communication delay of the edge; The congestion cost of each edge in the current round of iterative calculation is used as the congestion evaluation parameter corresponding to the global routing position obtained by the previous round of iterative calculation; Wherein, the edge is a copper wire between two grid points.
4. The printed circuit board wiring method according to claim 1, characterized in that: Utilizing the score network in the diffusion model and the classification network in the diffusion model, performing denoising calculation for the first preset number of steps according to the task objective of the target routing task, the routing control parameters input into the routing model in the previous round of iterative calculation, the global routing position obtained in the previous round of iterative calculation, and the Gaussian noise, to obtain a denoising vector, including: Before the number of denoising steps reaches the first preset number of steps, in the current denoising calculation, the following calculation is performed: Input the denoising vector obtained by the previous denoising calculation, the implicit guide vector obtained by the previous denoising calculation, the remaining denoising steps corresponding to the previous denoising calculation, the global routing position obtained by the previous round of iterative calculation, and the target routing resource into the fractional network to obtain a fractional network calculation result; Utilizing the classification network to calculate the denoised vector obtained from the previous denoising calculation, the implicit guide vector obtained from the previous denoising calculation, the number of remaining denoising steps corresponding to the previous denoising calculation, the global routing position obtained from the previous round of iterations, and the gradient data of the target routing resource compared to the task target; The denoising vector corresponding to the denoising calculation in the current step is calculated based on the denoising vector obtained by the previous denoising calculation, the noise obtained by sampling, the score network calculation result, and the gradient data; Wherein, in the first denoising calculation, the denoising vector obtained by the previous denoising calculation is the Gaussian noise; The implicit guidance vector is generated by adding noise to the routing control parameters corresponding to the global routing position calculated in the previous round of iterations.
5. The printed circuit board wiring method according to claim 1, characterized in that: The calculation steps of the score network include: Constructing the edges in the target routing resource and the nodes in the global routing position into an association relationship graph; Extracting the implicit representation of the edge according to the association graph using a graph convolutional network; Calculate the score network output result based on the implicit representation; Wherein, the edge is a copper wire between two grid points.
6. The printed circuit board wiring method according to claim 5, characterized in that: The calculation steps of the classification network include: Determine the expected progress value of each round of iterative calculation towards the task goal according to the task goal; Performing vectorization processing according to the expected progress value to obtain an embedding vector corresponding to the task target; Calculate the matrix representation corresponding to the association relationship graph according to the implicit representation; A probability value is calculated based on the embedding vector corresponding to the task target and the matrix representation corresponding to the association relationship graph; The probability value is output.
7. The printed circuit board wiring method according to claim 1, characterized in that: The training steps of the diffusion model include: Acquire a diffusion model training data set, wherein the diffusion model training data set includes a plurality of sample routing tasks, and sample task parameters of each of the sample routing tasks include sample routing resources, communication delays of edges in the sample routing resources, and a sample netlist to be routed; Sampling diffusion model training samples from the diffusion model training data set to construct a diffusion model training sample pool, wherein sample parameters of the diffusion model training samples include the sample wiring resources, wiring control parameters input into the wiring model, a global wiring position calculated using the wiring model, and the first coefficient calculated accordingly; The score network and the classification network are trained using the diffusion model training sample pool.
8. The printed circuit board wiring method according to claim 7, characterized in that: Sampling the diffusion model training data set to obtain a diffusion model training sample includes: Initialize the diffusion model training sample pool to be empty and the sample parameter queue to be empty; Sampling a sample wiring task from the diffusion model training data set, calling the wiring model to perform wiring calculation according to the sample task parameters and initialization parameters of the sample wiring task, and adding the sample task parameters, the wiring control parameters input into the wiring model, the global wiring position output by the wiring model, and the corresponding calculated wiring evaluation parameters as a group of candidate sample parameters into the sample parameter queue; If the number of samples in the diffusion model training sample pool is less than the preset number of samples, the following steps are performed: Sampling the candidate sample parameters from the sample parameter queue, and updating the congestion evaluation parameters in the candidate sample parameters using the randomly sampled first coefficients, calling the routing model to perform routing calculations according to the sample task parameters, the delay evaluation parameters, and the updated congestion evaluation parameters in the candidate sample parameters, to obtain an updated global routing position and the corresponding calculated routing evaluation parameters; Adding the sample task parameters, the updated global wiring position and the corresponding calculated wiring control parameters in the candidate sample parameters to the sample parameter queue; The sample wiring resources in the candidate sample parameters, the corresponding wiring control parameters input into the wiring model, the sample task objectives in the candidate sample parameters, the global wiring position before updating, and the randomly sampled first coefficient are added to the diffusion model training sample pool as the sample parameters of the diffusion model training sample.
9. The printed circuit board wiring method according to claim 7, characterized in that: Using the diffusion model training sample pool to train the score network includes: Sampling a first preset number of the diffusion model training samples from the diffusion model training sample pool, and performing the following steps on each of the diffusion model training samples obtained by sampling: After vectorizing the wiring control parameters of the wiring model corresponding to the diffusion model training samples, adding noise to the wiring control parameters of the wiring model corresponding to the diffusion model training samples according to the noise adding step obtained by random sampling to obtain an implicit guidance vector corresponding to the diffusion model training samples; Adding noise to the denoised vector calculated according to the first coefficient randomly sampled from the diffusion model training sample to obtain a noisy vector corresponding to the diffusion model training sample; According to the implicit guidance vector corresponding to the diffusion model training sample and the noise vector corresponding to the diffusion model training sample, the network parameters of the score network are updated by using the gradient descent method.
10. The printed circuit board wiring method according to claim 7, characterized in that: Using the diffusion model training sample pool to train the classification network includes: Sampling a second preset number of the diffusion model training samples from the diffusion model training sample pool, and performing the following steps on each of the diffusion model training samples obtained by sampling: After vectorizing the wiring control parameters of the wiring model corresponding to the diffusion model training samples, adding noise to the wiring control parameters of the wiring model corresponding to the diffusion model training samples according to the noise adding step obtained by random sampling to obtain an implicit guidance vector corresponding to the diffusion model training samples; Adding noise to the denoised vector calculated according to the first coefficient randomly sampled from the diffusion model training sample to obtain a noisy vector corresponding to the diffusion model training sample; According to the implicit guidance vector corresponding to the diffusion model training sample and the noise vector corresponding to the diffusion model training sample, the network parameters of the classification network are updated by using the gradient ascent method.
11. A printed circuit board wiring device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program, and when the computer program is executed by the processor, the steps of the printed circuit board wiring method as claimed in any one of claims 1 to 10 are implemented.
12. A non-volatile storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the printed circuit board wiring method according to any one of claims 1 to 10 are implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the printed circuit board wiring method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Digital chip layout wiring global optimization method and system
CN116341480A
Circuit board automatic wiring planning method based on full-page global optimization
CN117829088A