A printed circuit board wiring method, device, medium and computer program product
Through iterative calculation and hidden vector sampling, dynamic adjustment of printed circuit board wiring parameters is solved, and the wiring efficiency and model convergence rate are improved.
Patent Information
- Application Number
- CN202411678539.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-22
AI Technical Summary
When faced with intensive circuit layout, existing printed circuit board wiring methods often encounter problems that the wiring model cannot converge, which results in long calculations and requires manual adjustment.
A printed circuit board wiring method is adopted, through iterative calculation and hidden vector sampling, the wiring parameters are dynamically adjusted to avoid congestion, and the congestion evaluation parameters are optimized using historical congestion decay factor and current round congestion cost coefficient update coefficient.
It improves the wiring efficiency of printed circuit boards, shortens the calculation time, reduces the need for manual adjustment, and enhances the convergence rate of the wiring model.
Smart Images

Figure CN119167872B_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] Receive task parameters of the target wiring task;
[0008] Iterative calculation is performed according to the task parameters, and in each round of iterative calculation, a first candidate latent vector is sampled from a first conditional probability distribution given the control information using the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, a target latent vector is sampled from a second conditional probability distribution given the control information and the first candidate latent vector, and the target latent vector is decoded to obtain a first coefficient; a congestion evaluation parameter corresponding to the global wiring position obtained in the previous round of iterative calculation is calculated using the first coefficient, and a wiring model is called to calculate the global wiring position according to the congestion evaluation parameter;
[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 of congestion cost coefficient update coefficient.
[0011] On the one hand, taking the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, sampling from a first conditional probability distribution given the control information to obtain a first candidate latent vector, including:
[0012] Vectorizing the control information to obtain an implicit representation of the control information;
[0013] Embedding the task target of the target wiring task into the implicit representation of the control information to obtain a first input parameter;
[0014] Using a pre-trained first decoding module for implementing the first conditional probability distribution to perform a prediction calculation according to the first input parameter to obtain a first mean and a first variance;
[0015] The first candidate latent vector is obtained by calculating the first mean and the first variance.
[0016] On the other hand, sampling a target latent vector from a second conditional probability distribution given the control information and the first candidate latent vector comprises:
[0017] Embedding the first candidate latent vector into the first input parameter to obtain a second input parameter;
[0018] Using a pre-trained second decoding module for implementing the second conditional probability distribution to perform a prediction calculation according to the second input parameter to obtain a second mean and a second variance;
[0019] The target latent vector is obtained according to the second mean and the second variance.
[0020] On the other hand, vectorizing the control information to obtain an implicit representation of the control information includes:
[0021] According to the routing control parameters input by the previous round of iterative calculation, the edges in the target routing resources and the nodes in the global routing positions are constructed into an association relationship graph;
[0022] Extracting the implicit representation of the edge according to the association graph using a graph convolutional network;
[0023] Using the implicit representation of each edge as the implicit representation of the control information;
[0024] The edge is a copper wire between two grid points.
[0025] On the other hand, taking the target wiring resource in the task parameter and the wiring parameter in the previous round of iterative calculation as control information, sampling a first candidate latent vector from a first conditional probability distribution given the control information, and sampling a target latent vector from a second conditional probability distribution given the control information and the first candidate latent vector, including:
[0026] Inputting the control information into a variational autoencoder to sample the first candidate latent vector from the first conditional probability distribution, and sampling the target latent vector from the second conditional probability distribution;
[0027] The training steps of the variational autoencoder include:
[0028] Constructing a variational autoencoder training sample pool, wherein the variational autoencoder training sample pool includes a plurality of variational autoencoder training samples, and sample parameters of the variational autoencoder training samples include at least sample wiring resources, wiring control parameters input into the wiring model, a global wiring position calculated using the wiring model, and a sample task target;
[0029] The variational autoencoder training sample pool is used to train a decoder of the variational autoencoder to construct the first conditional probability distribution and the second conditional probability distribution.
[0030] On the other hand, the sample parameters of the variational autoencoder training sample also include a preferred latent vector;
[0031] The step of generating the optimal latent vector comprises:
[0032] Get sample wiring tasks;
[0033] Generate a global wiring position according to the sample task parameters of the sample wiring task and the initialization wiring control parameters using the wiring model, calculate the corresponding wiring evaluation parameters, and use the sample task parameters of the sample wiring task, the wiring control parameters input into the wiring model, the global wiring position calculated by the wiring model, and the corresponding wiring evaluation parameters as a candidate sample parameter;
[0034] Perform multiple denoising calculations according to the candidate sample parameters using a pre-trained diffusion model, and output a denoising vector for decoding to obtain the first coefficient;
[0035] Collect multiple denoised vectors generated in the denoising calculation of the diffusion model, decode the denoised vectors to obtain the corresponding first coefficients, and determine the degree of proximity between each denoised vector and the sample task target of the sample wiring task based on the corresponding calculated wiring evaluation parameters, so as to determine the preferred latent vector corresponding to the candidate sample parameter based on the degree of proximity.
[0036] On the other hand, decoding the denoised vector to obtain the corresponding first coefficient, and determining the proximity of each denoised vector to the sample task target of the sample wiring task according to the corresponding calculated wiring evaluation parameter, so as to determine the preferred latent vector corresponding to the candidate sample parameter according to the proximity, including:
[0037] Input the sample task parameters in the candidate sample parameters, the wiring control parameters input into the wiring model, the global wiring position calculated by the wiring model, the task target of the sample wiring task, and the corresponding sample task target into the pre-trained guidance model to generate the latent vector weight coefficient corresponding to each of the denoised vectors;
[0038] The denoised vector is weightedly calculated using the latent vector weight coefficient to obtain the preferred latent vector.
[0039] On the other hand, the training step of the guidance model includes:
[0040] Constructing a guided model training sample pool, wherein the guided model training sample pool includes a plurality of guided model training samples, and sample parameters of the guided model training samples include at least sample wiring resources, wiring control parameters input into the wiring model, global wiring positions calculated using the wiring model, sample task objectives, and corresponding optimal denoising steps;
[0041] Inputting sample wiring resources in the training sample of the guidance model, wiring control parameters input into the wiring model, global wiring positions calculated using the wiring model, and sample task targets into the guidance model, and outputting a first preset number of intermediate latent vector weight coefficients through feedforward calculation;
[0042] Calculating the training loss of the guided model according to the intermediate latent vector weight coefficient and the corresponding optimal denoising step, and updating the model parameters of the guided model using the training loss of the guided model;
[0043] Among them, the step of determining the optimal denoising step includes: among the denoising vectors obtained by performing multiple denoising calculations based on the candidate sample parameters using the diffusion model, selecting the denoising step corresponding to the denoising vector whose corresponding wiring evaluation parameter is closest to the task target of the sample wiring task as the optimal denoising step.
[0044] On the other hand, using the variational autoencoder training sample pool to train the decoder of the variational autoencoder to construct the first conditional probability distribution and the second conditional probability distribution, including:
[0045] Sampling the variational autoencoder training sample from the variational autoencoder training sample pool, inputting the sample wiring resources, the wiring control parameters input into the wiring model, the global wiring position calculated using the wiring model, and the sample task target into the variational autoencoder, and outputting an intermediate latent vector for generating the first coefficient;
[0046] Determine a reconstruction loss according to a difference between the intermediate latent vector and a preferred latent vector in a training sample of the variational autoencoder, determine a relative entropy according to a difference between the first conditional probability distribution generated by the variational autoencoder and a latent variable distribution, obtain a training loss of the variational autoencoder according to the reconstruction loss and the relative entropy, and update a model parameter of the variational autoencoder using the training loss of the variational autoencoder;
[0047] Among them, the latent variable distribution is the conditional probability distribution of given sample control information and the preferred latent vector, and the given sample control information includes the sample wiring resources in the variational autoencoder training sample, the wiring control parameters input into the wiring model, the global wiring position calculated using the wiring model, and the sample task objectives.
[0048] On the other hand, using the variational autoencoder training sample pool to train the decoder of the variational autoencoder to construct the first conditional probability distribution and the second conditional probability distribution, including:
[0049] Inputting the sample parameters of the variational autoencoder training sample into the encoder of the variational autoencoder to vectorize the global wiring position calculated by using the wiring model according to the sample wiring resources, the wiring control parameters of the wiring model, and embedding the sample task target of the variational autoencoder training sample to obtain a third input parameter;
[0050] Perform prediction calculation according to the third input parameter to obtain a third mean and a third difference;
[0051] Obtain a third candidate latent vector according to the third mean and the third difference;
[0052] The third candidate latent vector is input into the decoder of the variational autoencoder, and the decoder of the variational autoencoder is trained by loss optimization to construct the first conditional probability distribution and the second conditional probability distribution.
[0053] On the other 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:
[0054] 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;
[0055] 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;
[0056] 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;
[0057] The edge is a copper wire between two grid points.
[0058] 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:
[0059] 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;
[0060] 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;
[0061] 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;
[0062] 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;
[0063] The edge is a copper wire between two grid points.
[0064] In order to solve the above technical problems, the present invention also provides a printed circuit board wiring device, comprising:
[0065] Memory for storing computer programs;
[0066] 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.
[0067] 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.
[0068] 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.
[0069] 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 wiring parameters of the target wiring task and the congestion evaluation parameters to avoid congestion to obtain the global wiring position, the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation are used as control information to sample the first candidate latent vector from the first conditional probability distribution of the given control information, the target latent vector is sampled from the second conditional probability distribution of the given control information and the first candidate latent vector, and the target latent vector is decoded and output, so as to efficiently obtain the first coefficient including the historical congestion attenuation factor and / or the current round congestion cost coefficient update coefficient, and the first coefficient is used to update the congestion evaluation parameter used in the iterative calculation of the wiring model, so as to solve the problem that the congestion situation of the wiring model evaluating the global wiring position is relatively rigid, and the convergence rate of the model calculation can be accelerated, thereby improving the efficiency of generating the recommended global wiring position.
[0070] 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
[0071] 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.
[0072] Figure 1 A schematic diagram of routing resources for a target;
[0073] Figure 2 It is a schematic diagram of the structure of a wire network;
[0074] Figure 3 A flowchart of a printed circuit board wiring method provided by an embodiment of the present invention;
[0075] Figure 4 A schematic diagram of the structure of a printed circuit board wiring system provided by an embodiment of the present invention;
[0076] Figure 5 A flow chart of another printed circuit board wiring method provided by an embodiment of the present invention;
[0077] Figure 6 A schematic structural diagram of a printed circuit board wiring device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0078] 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.
[0079] 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.
[0080] 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.
[0081] 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.
[0082] 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.
[0083] 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.
[0084] 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.
[0085] Figure 1 A schematic diagram of routing resources for a target; Figure 2 A schematic diagram of the structure of a wire network.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] To solve this problem, a printed circuit board wiring method provided by an embodiment of the present invention uses a wiring model to perform wiring calculation according to wiring parameters of a target wiring task and congestion evaluation parameters to avoid congestion to obtain a global wiring position. The first candidate latent vector is sampled from a first conditional probability distribution of given control information using target wiring resources in the task parameters and wiring parameters in a previous round of iterative calculation as control information. The target latent vector is sampled from a second conditional probability distribution of given control information and the first candidate latent vector, and the target latent vector is outputted by decoding, thereby efficiently obtaining a first coefficient including a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient. The first coefficient is used to update the congestion evaluation parameter used in the iterative calculation of the wiring model, thereby solving the problem that the wiring model evaluates the congestion situation of the global wiring position in a relatively rigid manner, and can accelerate the convergence rate of the model calculation, thereby improving the efficiency of generating a recommended global wiring position.
[0094] 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.
[0095] 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.
[0096] like Figure 3 As shown, the printed circuit board wiring method provided by the embodiment of the present invention includes:
[0097] S31: receiving task parameters of a target wiring task;
[0098] S32: performing iterative calculation according to the task parameters, and in each round of iterative calculation, taking the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, sampling from the first conditional probability distribution of the given control information to obtain a first candidate latent vector, sampling from the second conditional probability distribution of the given control information and the first candidate latent vector to obtain a target latent vector, decoding the target latent vector to obtain a first coefficient; using the first coefficient to calculate the congestion evaluation parameter corresponding to the global wiring position obtained in the previous round of iterative calculation, calling the wiring model to calculate the global wiring position according to the congestion evaluation parameter;
[0099] 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.
[0100] The first coefficient includes a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient.
[0101] 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.
[0102] For S31, the task parameters of the target wiring task are obtained, and the reading and writing locations of the wiring calculation related parameters are determined according to the information of the printed circuit board wiring system, 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 computing task.
[0103] 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. The target board is the printed circuit board to be routed. In the target routing task, the precondition 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 nets to be routed from the netlist.
[0104] For S32, the global routing position includes the routing trees corresponding to all the wire nets to be routed. The routing evaluation parameters are used to evaluate the quality of the global routing position obtained by the previous round of iterative calculations to determine whether the task objectives of the target routing task are met. The global routing position, that is, the routing of all routing trees, is the most basic task objective, that is, each wire net can be successfully connected on the target routing resource.
[0105] In addition to the congestion evaluation parameters, the wiring evaluation parameters may also include delay evaluation parameters, which are used to evaluate the delay of each line in the target wiring task after wiring is performed according to the global wiring position. Correspondingly, the task objectives of the target wiring task may also include minimizing the system delay. In an embodiment of the present invention, "line network delay" can be defined as the maximum delay from the driving point to all load points in the line network after wiring is performed using the global wiring position, and "system delay" can be defined as the maximum delay of all line network delays after wiring is performed using the global wiring position. It can be understood that the system delay can also be calculated in other ways, such as the average value, median value, etc. of all line network delays.
[0106] The embodiment of the present invention uses a routing model to perform iterative calculations, and outputs a global routing position in each iterative calculation, which includes a routing tree 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 a 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.
[0107] Specifically, in the In the round iteration, the edge The congestion cost is as follows:
[0108] ;
[0109] 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 The real-time congestion cost.
[0110] 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:
[0111] .
[0112] The update formula is as follows:
[0113] ;
[0114] 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.
[0115] Although this 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.
[0116] 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.
[0117] 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.
[0118] 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:
[0119] ;
[0120] 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 .
[0121] 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:
[0122] ;
[0123] 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.
[0124] 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).
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] It can be seen from the above formula that in order to flexibly generate congestion evaluation parameters, the first coefficient is a high-dimensional data including the dimension of the iterative calculation round, the dimension of the edge index and the dimension of the corresponding first coefficient, which cannot be simply generated by loss optimization. Therefore, in practical applications, a generative model is required to generate the first coefficient. The generative model can adopt a variational autoencoder, a diffusion model, etc. Since the generation process of the diffusion model requires multi-step denoising calculations, it will prolong the time to execute the target wiring task. Therefore, in an embodiment of the present invention, a variational autoencoder is used to generate the first coefficient. Since the variational autoencoder only requires a two-step sampling process to generate high-dimensional data, the first coefficient can be efficiently generated.
[0130] 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 .
[0131] 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.
[0132] 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 .
[0133] As recorded in S32, the target wiring resource in the task parameter and the wiring parameter in the previous round of iterative calculation are used as control information to sample the first candidate latent vector from the first conditional probability distribution of the given control information, the target latent vector is sampled from the second conditional probability distribution of the given control information and the first candidate latent vector, and the target latent vector is decoded to obtain the first coefficient. The generation process of the variational autoencoder can also be described as: using the 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.
[0134] The routing parameters may include one or more of: target routing resources, routing control parameters of an input routing model, a global routing position calculated by the routing model, and a task objective of a target routing task.
[0135] For S32 and S33, before starting to execute the target routing task, the maximum number of iterative calculation rounds is determined.
[0136] The iteration end condition may be obtaining a global routing position that is routed successfully, or reaching a maximum number of iteration calculation rounds.
[0137] In the embodiment of the present invention, routing can be successful in that each net in the routing task can be successfully connected on the target routing resource.
[0138] 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.
[0139] 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.
[0140] 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.
[0141] The printed circuit board wiring method provided by the embodiment of the present invention uses the wiring model to perform wiring calculation according to the wiring parameters of the target wiring task and the congestion evaluation parameters to avoid congestion to obtain the global wiring position. The first candidate latent vector is sampled from the first conditional probability distribution of the given control information using the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, the target latent vector is sampled from the second conditional probability distribution of the given control information and the first candidate latent vector, and the target latent vector is decoded and output, so as to efficiently obtain the first coefficient including the historical congestion attenuation factor and / or the current round congestion cost coefficient update coefficient, and the first coefficient is used to update the congestion evaluation parameter used in the iterative calculation of the wiring model, so as to solve the problem that the congestion situation of the global wiring position evaluated by the wiring model is relatively rigid, and the convergence rate of the model calculation can be accelerated, thereby improving the efficiency of generating the recommended global wiring position.
[0142] 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:
[0143] 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.
[0144] Communication delay : Represents edge Communication delay (on the physical line).
[0145] Netlist : It consists of several wire meshes, each of which contains a driving point , one or more load points .
[0146] 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:
[0147] (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.
[0148] (2) Minimize system delay: Minimize system delay while ensuring deployment.
[0149] Figure 5 A flow chart of another printed circuit board wiring method provided by an embodiment of the present invention.
[0150] 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.
[0151] The initialization parameters include the initialized global wiring position and the corresponding wiring evaluation parameters.
[0152] 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.
[0153] like Figure 5 As shown, another printed circuit board wiring method provided by an embodiment of the present invention may include:
[0154] S31: receiving task parameters of a target wiring task;
[0155] S51: calling the wiring model to perform wiring calculation according to the task parameters and initialization parameters, and outputting the initial global wiring position;
[0156] S52: Determine whether the initial global routing position satisfies routing; if yes, proceed to S58; if no, proceed to S53;
[0157] S53: Determine whether the maximum number of iterative calculation rounds has been reached; if yes, proceed to S58; if no, proceed to S54;
[0158] S54: performing iterative calculation according to the task parameters, and in each round of iterative calculation, taking the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, sampling from the first conditional probability distribution of the given control information to obtain a first candidate latent vector, sampling from the second conditional probability distribution of the given control information and the first candidate latent vector to obtain a target latent vector, decoding the target latent vector to obtain a first coefficient; using the first coefficient to calculate a congestion evaluation parameter corresponding to the global wiring position obtained in the previous round of iterative calculation;
[0159] 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;
[0160] S56: Determine whether the global routing position satisfies routing; if yes, proceed to S57; if no, proceed to S53;
[0161] S57: On the premise of maintaining the connection, minimize the system delay as the task goal and enter S53;
[0162] S58: End the iterative calculation.
[0163] 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:
[0164] enter: , the maximum number of iterations .
[0165] in, Indicates task parameters Includes target routing resources , the communication delay of each edge on the target routing resource and netlist .
[0166] 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.
[0167] 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.
[0168] Output: global routing position (routing tree of all nets), edge utilization of target routing resources, and system delay task evaluation parameters.
[0169] 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. The task congestion evaluation parameter may be the utilization rate of the edge of the target routing resource after adopting the global routing position. The task delay evaluation parameter may adopt the system delay.
[0170] In an embodiment of the present invention, the utilization of the edges of the target wiring resources can be expressed in three forms: (1) the maximum value of the utilization of all edges in the target wiring resources can be used to represent the utilization of the edges of the target wiring resources in the current round of iterative calculation; (2) the average utilization of all edges in the target wiring resources can be used to represent the utilization of the edges of the target wiring resources in the current round of iterative calculation, where 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.
[0171] 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.
[0172] S61: For all driving points and load point , initialize the margin ratio ; For the wiring resource diagram All the edges in , initialize the historical congestion cost , initialize the current round congestion cost coefficient .
[0173] 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: .
[0174] 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.
[0175] S52 may include the following steps S63~S64.
[0176] 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 , .
[0177] 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.
[0178] The second round and subsequent iterative calculations of S53 to S58 may include the following steps S65 to S67.
[0179] S65: Order .
[0180] S66: If , then iterative calculation is performed according to the task parameters, and in each round of iterative calculation, the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation are used as control information to sample the first candidate latent vector from the first conditional probability distribution of the given control information, and the target latent vector is sampled from the second conditional probability distribution of the given control information and the first candidate latent vector, the target latent vector is decoded to obtain the first coefficient, and the first coefficient is used to calculate the congestion evaluation parameter of the global wiring position obtained in the previous round of iterative calculation, and the delay evaluation parameter of the global wiring position obtained in the previous round of iterative calculation is calculated. The process may include the following steps S661~S668.
[0181] S661: A variational autoencoder is used to generate a target latent vector for decoding to obtain the first coefficient. The generation process can be expressed as: ,in, represents the target latent vector, Represents a variational autoencoder. The parameters after | in brackets represent given conditions. Represents the wiring resource diagram, Indicates in front Round iterative calculation of edges The historical congestion cost set, 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.
[0182] S662: From the target hidden vector Decoded , , the decoding process is as follows:
[0183] ;
[0184] ;
[0185] 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 congestion cost coefficient update coefficient set, represents the inverse quantization process, represents the sigmoid function, Represents the target latent vector No. dimensional components, represents the hyperbolic tangent function, Represents the target latent vector No. dimensional components.
[0186] S663: For all edges , update the historical congestion cost: .
[0187] S664: For all edges , set the current round congestion cost coefficient for calculating the current round congestion cost: .
[0188] S665: 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 control parameters. This process can be expressed as: .
[0189] S666: 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 .
[0190] S667: If the global routing position calculated by the current round of iterations has avoided congestion, that is, it has satisfied routing, then the congestion avoidance state can be maintained in the subsequent steps. The corresponding setting is: , then set .
[0191] S668: Order for .
[0192] S67: Output the optimal global routing position in each round of iterative calculation , the corresponding optimal average utilization and optimal system delay .
[0193] Based on the above embodiment, the embodiment of the present invention further illustrates the steps of performing wiring calculation using a wiring model.
[0194] The routing model is responsible for performing a round of routing calculations for all nets based on specific parameters. Its input and output include:
[0195] enter: 、Historical congestion cost , the coefficient of the current round of congestion cost , margin ratio ;
[0196] 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.
[0197] In S51 and S55 , the wiring model is called to perform wiring calculation, which may specifically include the following steps S71 to S77 .
[0198] 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 .
[0199] 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 .
[0200] S73: For , perform the following steps S731 to S733. Among them, Indicates the total number of network lines.
[0201] 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 .
[0202] S732: For , execute the following calculation steps S7321~S7325.
[0203] S7321: Initialize small root heap Is empty.
[0204] S7322: Initialize the hash table that maps nodes to their parent nodes .
[0205] S7323: Traversal , for each node in the wiring tree , perform the following calculation steps:
[0206] 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 .
[0207] S7324: Repeat the following calculation steps S73241~S73243.
[0208] S73241: From Out of the pile .
[0209] S73242: Determine whether If yes, then end; if no, then go to S73243.
[0210] S73243: Traversal In the wiring resource diagram Neighbor nodes in , perform the following steps:
[0211] like Never added to In, then:
[0212] Calculate the edge in the current round of iteration calculation Real-time congestion cost: ;
[0213] Calculate the edge in the current round of iteration calculation The congestion cost is: ;
[0214] Compute Node Weight: ;
[0215] set up ; and join in , returns S73241.
[0216] 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.
[0217] S7325: Update the routing tree to obtain the global routing position obtained by the current round of iterative calculation, specifically including:
[0218] Construct a list: [ ],in: , , For this list, the first Nodes in
[0219] right , and As The child node is added middle;
[0220] right , and Updated to .
[0221] S733: updating the real-time congestion cost evaluation parameters 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 .
[0222] 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.
[0223] S75: Calculate the system delay corresponding to the global routing position obtained by the current round of iterative calculation: ,in Indicates line network delay.
[0224] S76: Calculating the margin ratio corresponding to the global routing position obtained by the current round of iterative calculation, including:
[0225] For all lines , for each of its pins ,renew ,in, for The driving point The corresponding nodes in the three-dimensional grid diagram are for The corresponding node in the 3D grid graph.
[0226] S77: Return , the updated margin ratio .
[0227] Based on the above embodiment, the embodiment of the present invention further illustrates the step of generating the first coefficient by using a variational autoencoder.
[0228] In an embodiment of the present invention, in S32, the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation are used as control information to sample the first candidate latent vector from the first conditional probability distribution of the given control information, which may include: vectorizing the control information to obtain an implicit representation of the control information; embedding the task target of the target wiring task into the implicit representation of the control information to obtain a first input parameter; using a pre-trained first decoding module for implementing the first conditional probability distribution to perform a predictive calculation based on the first input parameter to obtain a first mean and a first variance; and calculating the first candidate latent vector based on the first mean and the first variance.
[0229] Record control information , the sampling process of the variational autoencoder includes:
[0230] sampling ;
[0231] sampling .
[0232] You can set the sampling The input and output of the process are:
[0233] enter: ;
[0234] Output: .
[0235] On this basis, the sampling The process may include the following steps S81~S87.
[0236] S81: Extract the implicit representation of the input parameters through the representation layer. This process can be described as: ,in, , Indicates input control information The implicit representation of The calculation of the representation layer is described below.
[0237] S82: Mission Target The embedding may specifically include the following steps S811 to S813.
[0238] S811: The interval Discretize into ,in is a hyperparameter, which indicates the step size of discretization. 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.
[0239] S812: 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.
[0240] S813: Take As The embedding vector of . Represents vector concatenation processing.
[0241] S83: Extract the latent representation Converted to a matrix, the process can be expressed as: ;in, represents the first column of the resulting matrix, represents the second column of the resulting matrix. are learnable parameters.
[0242] S84: Fusion Mission Objectives The process can be expressed as: , ;in, , is a learnable matrix, represents the first column of the fused representation matrix, Represents the second column of the fused representation matrix.
[0243] S85: Predict the first mean and the first variance. This process can be expressed as:
[0244] ;
[0245] ;
[0246] ;
[0247] in, represents the first mean, The matrix representing the first variance, Represents vector concatenation processing, and They are all single-layer fully connected neural networks with nonlinear activation functions. The input is dimensional vector, the output is dimensional vector; The input is dimensional vector, the output is dimensional vector. Represented by vector The 0th element to the The column vector is composed of elements. Finally, vector stacking is used to generate , represents the matrix used to construct the covariance matrix.
[0248] In the embodiment of the present invention, vector splicing processing The meaning is to vertically connect the input column vector to get a new column vector. Vector stacking processing The meaning is to stack multiple input column vectors into a matrix. Specifically, the first column vector input will become the first column of the matrix, the second column vector will become the second column of the matrix, and so on, until all the input column vectors are arranged.
[0249] S86: Processing , which may specifically include steps S861~S862.
[0250] S861: Elements above the diagonal are set to 0, and elements on and below the diagonal remain unchanged.
[0251] S862: Yes ,set up .
[0252] S87: Passed The calculation samples the first candidate latent vector , returns the first candidate latent vector .
[0253] In an embodiment of the present invention, sampling a target latent vector from a second conditional probability distribution of given control information and a first candidate latent vector may include: embedding the first candidate latent vector into a first input parameter to obtain a second input parameter; using a pre-trained second decoding module for implementing the second conditional probability distribution to perform a prediction calculation based on the second input parameter to obtain a second mean and a second variance; and obtaining the target latent vector based on the second mean and the second variance.
[0254] Sampling can be set The input and output of the process are:
[0255] enter: ;
[0256] Output: .
[0257] On this basis, the sampling The process may include the following steps S91~S97.
[0258] S91: Adoption and The shared representation layer extracts the latent representation of the input parameters .
[0259] S92: Adoption and The shared embedding layer gets The embedding vector .
[0260] S93: Extract the latent representation Converted to a matrix, the process can be expressed as: ;in, represents the first column of the resulting matrix, represents the second column of the resulting matrix. are learnable parameters.
[0261] S94: Fusion Mission Objectives The process can be expressed as: , .
[0262] in, , For Shared learnable matrix, represents the first column of the fused representation matrix, represents the second column of the fused representation matrix, , Indicates no Shared learnable matrix.
[0263] S95: Predict the second mean and the second variance. This process can be expressed as:
[0264] ;
[0265] ;
[0266] ;
[0267] in, represents the second mean, The matrix representing the second variance, Represents vector concatenation processing, and They are all single-layer fully connected neural networks with nonlinear activation functions. The input is dimensional vector, the output is dimensional vector; The input is dimensional vector, the output is dimensional vector. Represented by vector The 0th element to the The column vector is composed of elements. Finally, vector stacking is used to generate , represents the matrix used to construct the covariance matrix.
[0268] S96: Processing , which may specifically include steps S961~S962.
[0269] S961: Elements above the diagonal are set to 0, and elements on and below the diagonal remain unchanged.
[0270] S962: Yes ,set up .
[0271] S97: Passed The target latent vector is sampled by calculation , returns the target latent vector .
[0272] In the above implementation, the control information is vectorized to obtain an implicit representation of the control information, which may include: constructing an association graph of edges in the target wiring resources and nodes in the global wiring position according to the wiring control parameters input by the previous round of iterative calculation; extracting an implicit representation of the edge according to the association graph using a graph convolutional network; and using the implicit representation of each edge as an implicit representation of the control information; wherein an edge is a copper wire between two grid points.
[0273] This step is implemented by the representation layer introduced in the above implementation mode, and its input and output can be:
[0274] enter: , , , , ;
[0275] Output: Hidden Representation .
[0276] The calculation steps of the representation layer may include the following S101~S106.
[0277] S101: After the input parameters are vectorized, vector concatenation is performed. The process can be expressed as: .in, It is high-dimensional control information.
[0278] S102: Constructing an association diagram , specifically may include the following steps S1021~S1024.
[0279] S1021: For all edges in the target routing resource ,initialization ,in All the edges passing through A set of pin pairs, Represents the empty set.
[0280] S1022: Yes , execute the following steps S10221~S10222.
[0281] S10221: Note The root node is .
[0282] S10222: Yes Each leaf node of , for arrive Each edge on the path ,Will Updated to .
[0283] S1023: For each edge Create a Node .
[0284] S1024: 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:
[0285] ;
[0286] in, Representation Node and The weight of the edge between Represents all the edges passing through A collection of pin pairs.
[0287] S103: Generate association graph The characteristic matrix of the vertices in is: .in, represents the feature matrix, represents vector stacking processing, Representing high-dimensional control information No. dimensional components, Representing high-dimensional control information No. dimensional components, Representing high-dimensional control information No. dimensional components.
[0288] S104: Remember the association diagram The weighted adjacency matrix of , where the elements for:
[0289] .
[0290] in, Representation Node and The weight of the edge between .
[0291] S105: From the wiring resource map The adjacency relationship between the extracted edges is:
[0292] ;
[0293] in, Represents edge and edge adjacency relationship.
[0294] S106: Passed Layer graph convolutional networks extract implicit representations of edges: .in, . is the learnable parameter matrix. ,other is a hyperparameter.
[0295] Based on the above embodiment, the embodiment of the present invention further illustrates the training steps of the variational autoencoder.
[0296] In the above embodiment, the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation are used as control information to sample the first candidate latent vector from the first conditional probability distribution of the given control information, and to sample the target latent vector from the second conditional probability distribution of the given control information and the first candidate latent vector. This may include: inputting the control information into the variational autoencoder to sample the first candidate latent vector from the first conditional probability distribution, and to sample the target latent vector from the second conditional probability distribution.
[0297] Then in this embodiment of the present invention, the training steps of the variational autoencoder may include:
[0298] S111: constructing a variational autoencoder training sample pool, the variational autoencoder training sample pool including a plurality of variational autoencoder training samples, the sample parameters of the variational autoencoder training samples at least including sample wiring resources, wiring control parameters of an input wiring model, a global wiring position calculated using the wiring model, and a sample task target;
[0299] S112: Train the decoder of the variational autoencoder using the variational autoencoder training sample pool to construct a first conditional probability distribution and a second conditional probability distribution.
[0300] In a specific implementation, sample wiring tasks can be collected, and after using a wiring model to perform simulated wiring, relevant parameters can be collected to construct variational autoencoder training samples.
[0301] It should be noted that the embodiment of the present invention uses a variational autoencoder to generate the first coefficient, which is faster than the generation method such as the diffusion model, but the generation effect is poor. In order to alleviate the performance loss caused by the variational autoencoder, a distillation diffusion model can be used to train the variational autoencoder, which is specifically embodied in that a diffusion model is used to help the variational autoencoder select a preferred latent vector. The role of the preferred latent vector is to perform wiring calculations on the parameters decoded from the latent vector and the task goal. The closest, thus as a training sample of the variational autoencoder, can significantly improve the performance of the variational autoencoder in generating the first coefficient.
[0302] Then the sample parameters of the variational autoencoder training sample also include a preferred latent vector. The step of generating the preferred latent vector may include: obtaining a sample wiring task; using a wiring model to generate a global wiring position according to the sample task parameters of the sample wiring task and the initialization wiring control parameters, and calculating the corresponding wiring evaluation parameters, using the sample task parameters of the sample wiring task, the wiring control parameters of the input wiring model, the global wiring position calculated by the wiring model, and the corresponding wiring evaluation parameters as a candidate sample parameter; using a pre-trained diffusion model to perform multiple denoising calculations according to the candidate sample parameters, and outputting a denoising vector for decoding to obtain a first coefficient; collecting multiple denoising vectors generated in the denoising calculation of the diffusion model, decoding the denoising vector to obtain the corresponding first coefficient, and determining the degree of proximity of each denoising vector to the sample task target of the sample wiring task according to the corresponding calculated wiring evaluation parameters, so as to determine the preferred latent vector corresponding to the candidate sample parameter according to the degree of proximity.
[0303] In the above steps, it can be seen that in the process of determining the quality of the latent vector, it is also necessary to use a wiring model to perform wiring calculations. In order to avoid the time overhead caused by multiple solutions to the wiring problem and improve the distillation efficiency, an embodiment of the present invention provides a method of using a guided model to directly predict parameters for evaluating the quality of the latent vector to improve the efficiency of the distillation diffusion model.
[0304] The denoised vector is decoded to obtain the corresponding first coefficient, and the proximity of each denoised vector to the sample task target of the sample wiring task is determined according to the corresponding calculated wiring evaluation parameter, so as to determine the preferred latent vector corresponding to the candidate sample parameter according to the proximity, which may include: inputting the sample task parameters in the candidate sample parameters, the wiring control parameters of the input wiring model, the global wiring position calculated by the wiring model, the task target of the sample wiring task, and the corresponding sample task target into the pre-trained guidance model to generate the latent vector weight coefficient corresponding to each denoised vector; using the latent vector weight coefficient to perform weighted calculation on the denoised vector to obtain the preferred latent vector.
[0305] In the embodiment of the present invention, the input and output of the guidance model may be respectively:
[0306] enter: , , , , , ;
[0307] Output: Hidden vector weight coefficient weight .
[0308] The reasoning steps of the guided model may be shown in the following steps S121 to S123.
[0309] S121: Extract the implicit representation of the input parameters through the representation layer. This process can be described as: . This representation layer can share the representation layer in the variational autoencoder.
[0310] S122: Based on implicit representation , aggregate the implicit representations of all edges: ;in, Representation Matrix No. The row vector corresponding to the rows.
[0311] S123: Calculate a first preset number of latent vector weight coefficients:
[0312] ;
[0313] in, is a learnable matrix.
[0314] To implement the guidance model, the embodiment of the present invention also provides that the training step of the guidance model may include: constructing a guidance model training sample pool, the guidance model training sample pool includes multiple guidance model training samples, and the sample parameters of the guidance model training samples at least include sample wiring resources, wiring control parameters of the input wiring model, global wiring positions calculated using the wiring model, sample task targets, and corresponding optimal denoising steps; inputting the sample wiring resources, wiring control parameters of the input wiring model, global wiring positions calculated using the wiring model, and sample task targets in the guidance model training samples into the guidance model, and outputting a first preset number of intermediate latent vector weight coefficients through feedforward calculation; calculating the training loss of the guidance model according to the intermediate latent vector weight coefficient and the corresponding optimal denoising step, and updating the model parameters of the guidance model using the training loss of the guidance model. Among them, the step of determining the optimal denoising step may include: selecting the denoising step corresponding to the denoising vector whose corresponding wiring evaluation parameter is closest to the task target of the sample wiring task from the denoising vectors obtained by multiple denoising calculations based on the candidate sample parameters using the diffusion model as the optimal denoising step.
[0315] In the above steps, the steps of constructing the guided model training samples may be as shown in S131 to S134 below.
[0316] Input: Sample Task Set , preset sample size , pre-trained diffusion models (including score networks and classification network ).
[0317] Output: Guided model training sample pool .
[0318] S131: Initialize the boot model training sample pool to be empty , the sample parameter queue is empty: .
[0319] S132: Sample a ,right Each line 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 .
[0320] S133: 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 evaluation parameters, the process can be expressed as: . Set the sample parameters Add sample parameter queue ,in . Indicates the system delay of the current round.
[0321] S134: If the number of samples in the guided model training sample pool Less than the preset sample size , then execute the following steps S1341~S1347.
[0322] S1341: From the sample parameter queue Randomly sample a candidate sample parameter .
[0323] S1342: From The average utilization reduction ratio after each iteration is sampled , the reduction ratio of system delay after each iteration .make .
[0324] S1343: Sampling from the standard normal distribution ,in The dimension is , is a hyperparameter representing the number of denoising steps.
[0325] S1344: vectorize the historical congestion cost, the utilization of the edges in the target routing resources, 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 control parameters corresponding to the global routing position calculated in the previous round of iterations. Represents vectorized processing, Represents vector concatenation processing.
[0326] 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. Components. Vector splicing processing The meaning is to vertically connect the input column vector to get a new column vector.
[0327] S1345: Yes , execute the following steps S13451~S13452.
[0328] S13451: Controlling high-dimensional information Add noise to generate implicit guidance vectors : .in, is the noise obtained by sampling, where , is an intermediate variable is a hyperparameter.
[0329] S13452: Perform denoising calculations: .
[0330] 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, Represents the standard normal distribution The noise of the sampling.
[0331] 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.
[0332] and The implicit guidance process defined in the embodiment of the present invention means converting 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.
[0333] 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.
[0334] S1346: Calculate the gap between the routing evaluation parameter of the global routing position obtained by the current round of iterative calculation and the task target, which may specifically include the following steps S13461 to S13463.
[0335] S13461: Initialize the gap evaluation coefficients of the current optimal global routing position from the task target to infinity: , .in, represents the congestion evaluation parameter gap, Indicates the delay evaluation parameter gap.
[0336] S13462: Evaluate the global routing position calculated by the current round of iterations, and obtain , . represents the average utilization evaluation value, Indicates the system delay evaluation value.
[0337] S13463: Yes , perform the following steps:
[0338] (a) .
[0339] (b) .
[0340] (c) For all edges ,set up , After that, a round of wiring calculation is performed: .
[0341] (d) Add sample parameter queue .
[0342] (e) Calculation:
[0343] ;
[0344] ;
[0345] in, Indicates the average utilization improvement value corresponding to the global routing position calculated by the current iteration, Indicates the system delay improvement value corresponding to the global routing position calculated by the current iteration.
[0346] (f) If and ,but , , That is to say, if the difference between the average utilization improvement value of the current global routing position and the expected improvement value of the congestion situation is better than the global routing position calculated by historical iterations, and the difference between the system delay improvement value of the current global routing position and the expected improvement value of the system delay is better than the global routing position calculated by historical iterations, then the denoising step corresponding to the denoising vector corresponding to the current iteration calculation is the optimal denoising step. , the optimal denoising step The parameters indicating the preferred latent vector are added to guide the model training samples.
[0347] S1347: Guide model training samples Join the boot model training sample pool .
[0348] Then the training steps of the guided model may include:
[0349] Input: Guide model training sample pool , number of training steps ;
[0350] Output: trained bootstrap model .
[0351] Bootstrapping the model with random initialization The model parameters of Execute the following steps S141~S143.
[0352] S141: Training a sample pool from a bootstrap model Sampling out Guided model training samples .
[0353] S142: For each guided model training sample , execute the following S1421~S1423.
[0354] S1421: Extract input parameters from sample parameters of the guided model training samples: .
[0355] S1422: Calculate the intermediate latent vector weight coefficient by feedforward: .
[0356] S1423: Calculate training loss: .
[0357] S143: Back propagation update gradient: .in, is the learning rate, Indicates gradient calculation.
[0358] In the above pre-trained diffusion model, the implicit representation of the input parameters is obtained by using the representation layer After that, the output layer calculation of the score network includes: based on the implicit representation ,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.
[0359] In the above pre-trained diffusion model, the implicit representation of the input parameters is obtained by using the representation layer After that, the output layer calculation of the classification network includes: Calculate the probability value:
[0360] ;
[0361] in, express The transpose of is a dummy variable, Represents an exponential function.
[0362] On this basis, the training steps of the diffusion model may include: obtaining a diffusion model training data set, the diffusion model training data set includes multiple sample routing tasks, and the sample task parameters of each sample routing task include sample routing resources, the communication delay of the edges in the sample routing resources, and the 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, the sample parameters of the diffusion model training samples include sample routing resources, routing control parameters of the input routing model, the global routing position calculated using the routing model, and the first coefficient calculated accordingly; using the diffusion model training sample pool to train the score network and the classification network.
[0363] The diffusion model training samples obtained by sampling from the diffusion model training data set may include:
[0364] Initialize the diffusion model training sample pool to be empty and the sample parameter queue to be empty;
[0365] 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;
[0366] If the number of samples in the diffusion model training sample pool is less than the preset number of samples, perform the following steps:
[0367] 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;
[0368] 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;
[0369] 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.
[0370] The input and output of the algorithm of the above process are:
[0371] Input: Diffusion model training dataset , preset sample size ;
[0372] Output: Diffusion model training sample pool .
[0373] The algorithm steps may include the following steps S151~S154.
[0374] S151: Initialize the diffusion model training sample pool for , sample parameter queue for .
[0375] S152: Sample a ,right Each line 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 .
[0376] S153: 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.
[0377] S154: If the number of samples in the diffusion model training sample pool Less than the preset sample size , then execute the following steps S1541~S1546.
[0378] S1541: From the sample parameter queue Randomly sample a candidate sample parameter .
[0379] S1542: Random sampling , .
[0380] S1543: For all edges ,set up , .
[0381] S1544: 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.
[0382] S1545: Add the wiring evaluation parameters and task evaluation parameters obtained in S1544 to the sample parameter queue , that is, a sample parameter includes ,in .
[0383] S1546: Diffusion model training samples Add diffusion model training sample pool .
[0384] 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:
[0385] ;
[0386] 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.
[0387] Using the diffusion model training sample pool to train the score network can include:
[0388] 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:
[0389] 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;
[0390] 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;
[0391] 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.
[0392] The input and output of the algorithm of the above process are:
[0393] Input: Diffusion model training sample pool , number of training steps , learning rate ;
[0394] Output: trained score network .
[0395] The algorithm steps may include the following steps S161~S162.
[0396] S161: Random Initialization . Represents the initial model parameters of the score network.
[0397] S162: Yes , execute the following steps S1621~S1622.
[0398] S1621: Training sample pool from diffusion model Sampling Diffusion model training samples.
[0399] S1622: For each diffusion model training sample , execute the following steps S16221~S16226.
[0400] S16221: Record diffusion model training samples for .
[0401] S16222: Yes After vectorization, vector concatenation is performed to obtain high-dimensional control information. :
[0402] .
[0403] S16223: From A noise step is sampled from .
[0404] S16224: 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.
[0405] S16225: 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 .
[0406] S16226: Update the network parameters of the score network using the gradient descent method:
[0407] ;
[0408] 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.
[0409] Using the diffusion model training sample pool to train the classification network can include:
[0410] 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:
[0411] 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;
[0412] 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;
[0413] 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.
[0414] The input and output of the algorithm of the above process are:
[0415] Input: Diffusion model training sample pool , number of training steps , learning rate ;
[0416] Output: trained score network .
[0417] The algorithm steps may include the following steps S171~S172.
[0418] S171: Random Initialization . Represents the initialization model parameters of the classification network.
[0419] S172: Yes , execute the following steps S1721~S1722.
[0420] S1721: Training a sample pool from a diffusion model Sampling Diffusion model training samples.
[0421] S1722: For each diffusion model training sample , execute the following steps S13221~S13226.
[0422] S17221: Record diffusion model training samples for .
[0423] S17222: Yes After vectorization, vector concatenation is performed to obtain high-dimensional control information. : .
[0424] S17223: From A noise step is sampled from .
[0425] S17224: 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.
[0426] S17225: 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 .
[0427] S17226: Update the network parameters of the classification network using the gradient descent method:
[0428] ;
[0429] 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.
[0430] On this basis, a variational autoencoder training sample can include ,in represents the target latent vector.
[0431] In order to collect samples with more complete coverage of the sample space and high quality, the input and output of the construction of the variational autoencoder training samples can be:
[0432] Input: Variational autoencoder training dataset , preset sample size , the pre-trained diffusion model (consists of two parts: score network and classification network );
[0433] Output: Variational Autoencoder training sample pool .
[0434] The step of constructing the variational autoencoder training sample may include the following steps S181 to S184.
[0435] S181: Initialize the variational autoencoder training sample pool to be empty , the sample parameter queue is empty: .
[0436] S182: Sample a ,right Each line 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 .
[0437] S183: Using the routing model to calculate the initial global routing position based on the task parameters, historical congestion cost, current round congestion cost coefficient and margin ratio As well as the corresponding wiring evaluation parameters and task evaluation parameters, the process can be expressed as: . Set the sample parameters Add sample parameter queue ,in . Indicates the system delay of the current round.
[0438] S184: If the number of samples in the variational autoencoder training sample pool Less than the preset sample size , then execute the following steps S1841~S1845.
[0439] S1841: From the sample parameter queue Randomly sample a candidate sample parameter .
[0440] S1842: From The average utilization reduction ratio after each iteration is sampled , the reduction ratio of system delay after each iteration .make .
[0441] S1843: Sampling from the standard normal distribution ,in The dimension is , is a hyperparameter representing the number of denoising steps.
[0442] S1844: 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 control parameters corresponding to the global routing position calculated in the previous round of iterations. Represents vectorized processing, Represents vector concatenation processing.
[0443] S1845: Yes , execute the following steps S18451~S18455.
[0444] S18451: Controlling high-dimensional information Add noise to generate implicit guidance vectors : .in, is the noise obtained by sampling, where , is the intermediate variable, is a hyperparameter.
[0445] S18452: Perform denoising calculations: .
[0446] 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 routing 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.
[0447] S18453: Generate weight coefficients for each decoding step of the diffusion model: .
[0448] S18454: Aggregate the latent vectors of each decoding step: .in, That is the selected optimal latent vector.
[0449] S18455: Variational Autoencoder Training Samples Add variational autoencoder training sample pool .
[0450] It should be noted that in the embodiment of the present invention, in the process of obtaining the denoised vector by the denoising calculation of the diffusion model, not all denoised vectors are checked. This is because if all denoised vectors are checked, the amount of calculation is large, and the denoised vector obtained in the step of starting the denoising calculation of the diffusion model may be difficult to decode to obtain the first coefficient due to the large noise. Therefore, the embodiment of the present invention selects the preferred latent vector from the denoised vector with a high signal-to-noise ratio of the diffusion model as the variational autoencoder training sample, and uses the guided model to directly predict the latent vector weight coefficient to express the quality of the denoised vector obtained in the denoising step of the diffusion model, avoiding the time overhead caused by solving the wiring problem multiple times, improving the distillation efficiency, and improving the efficiency of generating variational autoencoder training samples.
[0451] On the basis of the above embodiment, using the variational autoencoder training sample pool to train the decoder of the variational autoencoder to construct the first conditional probability distribution and the second conditional probability distribution may include:
[0452] The variational autoencoder training sample pool samples the variational autoencoder training sample, inputs the sample wiring resources, the wiring control parameters of the input wiring model, the global wiring position calculated by the wiring model, and the sample task target into the variational autoencoder, and outputs an intermediate latent vector for generating a first coefficient;
[0453] A reconstruction loss is determined according to a difference between an intermediate latent vector and a preferred latent vector in a variational autoencoder training sample, a relative entropy is determined according to a difference between a first conditional probability distribution generated by the variational autoencoder and a latent variable distribution, a training loss of the variational autoencoder is obtained according to the reconstruction loss and the relative entropy, and the model parameters of the variational autoencoder are updated using the training loss of the variational autoencoder.
[0454] Among them, the latent variable distribution is the conditional probability distribution of given sample control information and preferred latent vectors. The given sample control information includes sample wiring resources in the variational autoencoder training sample, wiring control parameters of the input wiring model, the global wiring position calculated using the wiring model, and the sample task objectives.
[0455] The input and output of the above steps are:
[0456] Input: Variational Autoencoder Sample Pool , number of training steps ;
[0457] Output: Trained variational autoencoder .
[0458] The above steps may include the following S191~S192.
[0459] S191: Random Initialization , The parameters in are and . Randomly initialize the encoder The parameters in the conditional probability distribution of are . To assist training and , and its sampling process is described later.
[0460] S192: Yes , execute the following steps S1921~S1923.
[0461] S1921: Training a sample pool from a variational autoencoder Sampling out Variational Autoencoder training samples .
[0462] S1922: For each variational autoencoder training sample , execute the following S19221~S19223.
[0463] S19221: Extract input parameters from sample parameters of variational autoencoder training samples: .
[0464] S19222: Calculate training loss:
[0465] remember ,
[0466] Then the training loss of the variational autoencoder is:
[0467] .
[0468] S1923: Update the model parameters of the variational autoencoder:
[0469] ;
[0470] ;
[0471] ;
[0472] in, is the learning rate.
[0473] Training the decoder of a variational autoencoder using a variational autoencoder training sample pool to construct a first conditional probability distribution and a second conditional probability distribution can include: inputting sample parameters of the variational autoencoder training sample into the encoder of the variational autoencoder to vectorize and embed the sample task objectives of the variational autoencoder training sample according to sample wiring resources, wiring control parameters of an input wiring model, and a global wiring position calculated using a wiring model to obtain a third input parameter; performing a predictive calculation based on the third input parameter to obtain a third mean and a third difference; calculating a third candidate latent vector based on the third mean and the third difference; inputting the third candidate latent vector into the decoder of the variational autoencoder, and training the decoder of the variational autoencoder through loss optimization to construct the first conditional probability distribution and the second conditional probability distribution.
[0474] During the training process of the variational autoencoder, the input and output of the variational autoencoder are:
[0475] enter: ;
[0476] Output: .
[0477] The calculation steps of the encoder of the variational autoencoder may include the following S201~S207.
[0478] S201: Adoption and Shared presentation layer computing : .
[0479] S202: Adoption and The shared embedding layer in The embedding vector .
[0480] S203: Adoption and Shared in get ;in, represents the first column of the resulting matrix, represents the second column of the resulting matrix. are learnable parameters.
[0481] S204: Fusion Mission Objectives The process can be expressed as: , ;in, , For Shared learnable matrix, represents the first column of the fused representation matrix, represents the second column of the fused representation matrix, , Indicates no Shared learnable matrix.
[0482] S205: Predict the third mean and the third difference. This process can be expressed as:
[0483] ;
[0484] ;
[0485] ;
[0486] in, represents the third mean, The matrix representing the third party difference, Represents vector concatenation processing, and They are all single-layer fully connected neural networks with nonlinear activation functions. The input is dimensional vector, the output is dimensional vector; The input is dimensional vector, the output is dimensional vector. Represented by vector The 0th element to the A column vector consisting of elements.
[0487] Finally, vector stacking is used to generate , represents the matrix of third party differences.
[0488] S206: Processing , which may specifically include steps S2061~S2062.
[0489] S2061: Elements above the diagonal are set to 0, and elements on and below the diagonal remain unchanged.
[0490] S2062: Yes ,set up .
[0491] S207: Passed The calculation samples the second candidate latent vector , returns the second candidate latent vector .
[0492] 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.
[0493] 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.
[0494] The printed circuit board wiring device provided by the embodiment of the present invention may include:
[0495] A receiving unit, used for receiving task parameters of a target wiring task;
[0496] A wiring calculation unit is used to perform iterative calculation according to the task parameters, and in each round of iterative calculation, the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation are used as control information to sample a first candidate latent vector from a first conditional probability distribution of the given control information, sample a target latent vector from a second conditional probability distribution of the given control information and the first candidate latent vector, and decode the target latent vector to obtain a first coefficient; use the first coefficient to calculate a congestion evaluation parameter corresponding to the global wiring position obtained in the previous round of iterative calculation, and call the wiring model to calculate the global wiring position according to the congestion evaluation parameter;
[0497] The output unit is used to output the recommended global routing position for the target routing task if the iteration end condition is met and a global routing position that satisfies routing is obtained.
[0498] The first coefficient includes a historical congestion attenuation factor and / or a current round of congestion cost coefficient update coefficient.
[0499] The printed circuit board wiring device provided in the embodiment of the present invention may further include:
[0500] The first training unit is used to train the variational autoencoder. The diffusion model is used to sample the first candidate latent vector from the first conditional probability distribution of the given control information with the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, sample the target latent vector from the second conditional probability distribution of the given control information and the first candidate latent vector, and decode the target latent vector to obtain the first coefficient.
[0501] 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.
[0502] 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.
[0503] Figure 6 A schematic structural diagram of a printed circuit board wiring device provided by an embodiment of the present invention.
[0504] 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.
[0505] 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.
[0506] 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.
[0507] 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 .
[0508] 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.
[0509] 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.
[0510] 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.
[0511] 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.
[0512] 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.
[0513] 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.
[0514] 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.
[0515] 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.
[0516] 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: Receive task parameters of a target wiring task; Iterative calculation is performed according to the task parameters, and in each round of iterative calculation, a first candidate latent vector is sampled from a first conditional probability distribution given the control information using the target wiring resources in the task parameters and the wiring parameters in the previous round of iterative calculation as control information, a target latent vector is sampled from a second conditional probability distribution given the control information and the first candidate latent vector, and the target latent vector is decoded to obtain a first coefficient; a congestion evaluation parameter corresponding to the global wiring position obtained in the previous round of iterative calculation is calculated using the first coefficient, and a wiring model is called to calculate the global wiring position according to the congestion evaluation parameter; 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; Among them, the step of determining the congestion evaluation parameter includes: calculating 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 target wiring resource in the current round, the current round congestion cost of the edge and the communication delay of the edge; taking the congestion cost of each edge in the current round of iterative calculation as the congestion evaluation parameter corresponding to the global wiring position obtained by the previous round of iterative calculation; the first coefficient includes a historical congestion attenuation factor and / or a current round congestion cost coefficient update coefficient; the historical congestion attenuation factor is used to attenuate the historical congestion cost corresponding to the edge in the current round; the current round congestion cost coefficient update coefficient is used to replace the empirical value in the calculation formula of the current round congestion cost coefficient, and the current round congestion cost coefficient is used to calculate the current round congestion cost of the edge; the edge is a copper wire between two grid points.
2. The printed circuit board wiring method according to claim 1, characterized in that: The first candidate latent vector is obtained by sampling from a first conditional probability distribution given the control information using the target wiring resource in the task parameter and the wiring parameter in the previous round of iterative calculation as control information, including: Vectorizing the control information to obtain an implicit representation of the control information; Embedding the task target of the target wiring task into the implicit representation of the control information to obtain a first input parameter; Using a pre-trained first decoding module for implementing the first conditional probability distribution to perform a prediction calculation according to the first input parameter to obtain a first mean and a first variance; The first candidate latent vector is obtained by calculating according to the first mean and the first variance.
3. The printed circuit board wiring method according to claim 2, characterized in that: Sampling a target latent vector from a second conditional probability distribution given the control information and the first candidate latent vector comprises: Embedding the first candidate latent vector into the first input parameter to obtain a second input parameter; Using a pre-trained second decoding module for implementing the second conditional probability distribution to perform a prediction calculation according to the second input parameter to obtain a second mean and a second variance; The target latent vector is obtained according to the second mean and the second variance.
4. The printed circuit board wiring method according to claim 2, characterized in that: Vectorizing the control information to obtain an implicit representation of the control information includes: According to the routing control parameters inputted by the previous round of iterative calculation, the edges in the target routing resources and the nodes in the global routing positions are constructed into an association relationship graph; Extracting the implicit representation of the edge according to the association graph using a graph convolutional network; Using the implicit representation of each edge as the implicit representation of the control information; The edge is a copper wire between two grid points.
5. The printed circuit board wiring method according to claim 1, characterized in that: Taking the target wiring resource in the task parameter and the wiring parameter in the previous round of iterative calculation as control information, sampling a first candidate latent vector from a first conditional probability distribution given the control information, and sampling a target latent vector from a second conditional probability distribution given the control information and the first candidate latent vector, including: Inputting the control information into a variational autoencoder to sample the first candidate latent vector from the first conditional probability distribution, and sampling the target latent vector from the second conditional probability distribution; The training steps of the variational autoencoder include: Constructing a variational autoencoder training sample pool, wherein the variational autoencoder training sample pool includes a plurality of variational autoencoder training samples, and sample parameters of the variational autoencoder training samples include at least sample wiring resources, wiring control parameters input into the wiring model, a global wiring position calculated using the wiring model, and a sample task target; The variational autoencoder training sample pool is used to train a decoder of the variational autoencoder to construct the first conditional probability distribution and the second conditional probability distribution.
6. The printed circuit board wiring method according to claim 5, characterized in that: The sample parameters of the variational autoencoder training sample also include a preferred latent vector; The step of generating the optimal latent vector comprises: Get a sample wiring task; Generate a global wiring position according to the sample task parameters of the sample wiring task and the initialization wiring control parameters using the wiring model, calculate the corresponding wiring evaluation parameters, and use the sample task parameters of the sample wiring task, the wiring control parameters input into the wiring model, the global wiring position calculated by the wiring model, and the corresponding wiring evaluation parameters as a candidate sample parameter; Perform multiple denoising calculations according to the candidate sample parameters using a pre-trained diffusion model, and output a denoising vector for decoding to obtain the first coefficient; Collect multiple denoised vectors generated in the denoising calculation of the diffusion model, decode the denoised vectors to obtain the corresponding first coefficients, and determine the degree of proximity between each denoised vector and the sample task target of the sample wiring task based on the corresponding calculated wiring evaluation parameters, so as to determine the preferred latent vector corresponding to the candidate sample parameter based on the degree of proximity.
7. The printed circuit board wiring method according to claim 6, characterized in that: Decoding the denoised vector to obtain the corresponding first coefficient, and determining the proximity of each denoised vector to the sample task target of the sample wiring task according to the corresponding calculated wiring evaluation parameter, so as to determine the preferred latent vector corresponding to the candidate sample parameter according to the proximity, including: Input the sample task parameters in the candidate sample parameters, the wiring control parameters input into the wiring model, the global wiring position calculated by the wiring model, the task target of the sample wiring task, and the corresponding sample task target into the pre-trained guidance model to generate the latent vector weight coefficient corresponding to each of the denoised vectors; The denoised vector is weightedly calculated using the latent vector weight coefficient to obtain the preferred latent vector.
8. The printed circuit board wiring method according to claim 7, characterized in that: The training steps of the guided model include: Constructing a guided model training sample pool, wherein the guided model training sample pool includes a plurality of guided model training samples, and sample parameters of the guided model training samples include at least sample wiring resources, wiring control parameters input into the wiring model, global wiring positions calculated using the wiring model, sample task objectives, and corresponding optimal denoising steps; Inputting sample wiring resources in the training sample of the guidance model, wiring control parameters input into the wiring model, global wiring positions calculated using the wiring model, and sample task targets into the guidance model, and outputting a first preset number of intermediate latent vector weight coefficients through feedforward calculation; Calculating the training loss of the guided model according to the intermediate latent vector weight coefficient and the corresponding optimal denoising step, and updating the model parameters of the guided model using the training loss of the guided model; Among them, the step of determining the optimal denoising step includes: among the denoising vectors obtained by performing multiple denoising calculations based on the candidate sample parameters using the diffusion model, selecting the denoising step corresponding to the denoising vector whose corresponding wiring evaluation parameter is closest to the task target of the sample wiring task as the optimal denoising step.
9. The printed circuit board wiring method according to claim 6, characterized in that: Using the variational autoencoder training sample pool to train the decoder of the variational autoencoder to construct the first conditional probability distribution and the second conditional probability distribution, comprising: Sampling the variational autoencoder training sample from the variational autoencoder training sample pool, inputting the sample wiring resources, the wiring control parameters input into the wiring model, the global wiring position calculated using the wiring model, and the sample task target into the variational autoencoder, and outputting an intermediate latent vector for generating the first coefficient; Determine a reconstruction loss according to a difference between the intermediate latent vector and a preferred latent vector in a training sample of the variational autoencoder, determine a relative entropy according to a difference between the first conditional probability distribution generated by the variational autoencoder and a latent variable distribution, obtain a training loss of the variational autoencoder according to the reconstruction loss and the relative entropy, and update a model parameter of the variational autoencoder using the training loss of the variational autoencoder; Among them, the latent variable distribution is the conditional probability distribution of given sample control information and the preferred latent vector, and the given sample control information includes the sample wiring resources in the variational autoencoder training sample, the wiring control parameters input into the wiring model, the global wiring position calculated using the wiring model, and the sample task objectives.
10. The printed circuit board wiring method according to claim 5, characterized in that: Using the variational autoencoder training sample pool to train the decoder of the variational autoencoder to construct the first conditional probability distribution and the second conditional probability distribution, comprising: Inputting the sample parameters of the variational autoencoder training sample into the encoder of the variational autoencoder to vectorize the global wiring position calculated by using the wiring model according to the sample wiring resources, the wiring control parameters of the wiring model, and embedding the sample task target of the variational autoencoder training sample to obtain a third input parameter; Perform prediction calculation according to the third input parameter to obtain a third mean and a third difference; Obtain a third candidate latent vector according to the third mean and the third difference; The third candidate latent vector is input into the decoder of the variational autoencoder, and the decoder of the variational autoencoder is trained by loss optimization to construct the first conditional probability distribution and the second conditional probability distribution.
11. 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; The edge is a copper wire between two grid points.
12. 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 of the edges 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; The edge is a copper wire between two grid points.
13. 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 12 are implemented.
14. 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 12 are implemented.
15. 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 12 are implemented.
Citation Information
Patent Citations
Circuit board automatic wiring planning method based on full-page global optimization
CN117829088A