A post-layout physical feature prediction method and system based on graph neural network
By converting the circuit netlist into a graph data structure and using a graph neural network to predict the physical characteristics after layout, the problem of missing physical information in the logic synthesis stage is solved, more accurate timing analysis and design optimization are achieved, and the chip design cycle is reduced.
Patent Information
- Application Number
- CN202411617471.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In existing technologies, the lack of physical information in the logic synthesis stage leads to inaccurate timing predictions, which increases the number of design iterations and prolongs the chip design cycle. In addition, ordinary machine learning models find it difficult to accurately predict physical characteristics before layout.
A graph neural network-based method is used to convert the circuit netlist into a graph data structure, construct an adjacency matrix and extract the feature matrix. The post-layout physical features, such as the semi-perimeter, are predicted through a graph attention neural network, and multi-layer GNN layers and fully connected layers are used for feature aggregation and prediction.
It improves the prediction accuracy of post-layout path delay, guides design optimization, reduces design iterations, and reduces chip design time costs.
Smart Images

Figure CN119358502B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a post-layout physical feature prediction method and system based on a graph neural network, belonging to the technical field of electronic design automation. Background Art
[0002] With advancements in integrated circuit process nodes, the issue of timing predictability in the early stages of design has become increasingly prominent. The logic synthesis stage only contains information about the design's logical layer, leaving the design's physical layer unknown. This lack of physical information leads to inaccurate timing estimates in the early stages of the design, resulting in significant discrepancies between post-synthesis and post-layout timing results. This necessitates multiple rounds of iteration to achieve the desired Quality of Results (QoR), extending the chip design cycle.
[0003] To improve design predictability, the electronic design automation field aims to achieve a close connection between different design stages by integrating downstream design engines into early design stages. In recent years, with the rapid development of machine learning, more and more research has begun to focus on using machine learning technology for cross-design guidance. However, conventional machine learning models can only learn local information about a network, making it difficult to distinguish similar networks within a design, resulting in poor prediction accuracy.
[0004] Physical characteristics are closely related to design timing. Physical characteristics are closely linked to line capacitance. Line capacitance introduces a certain amount of line delay. Furthermore, line capacitance affects cell load capacitance, which in turn affects cell delay, ultimately impacting post-layout path delay. Almost every step in the design process affects line length, but it's not until the layout stage, when cells are placed, that line length is clearly quantified. Therefore, to account for the impact of physical characteristics during the pre-layout design phase for more accurate timing analysis, fast and accurate pre-layout line length prediction is crucial.
[0005] Therefore, those skilled in the art need to solve the problem of limited accuracy of early timing prediction models caused by the lack of physical information before layout. Summary of the Invention
[0006] Purpose: To overcome the shortcomings of the existing technology, the present invention provides a post-layout physical feature prediction method and system based on graph neural network, which accurately and efficiently predicts post-layout physical features in the logic synthesis stage to assist in more accurate timing analysis, thereby effectively guiding circuit pre-layout design and optimization, which is of great significance for accelerating the digital integrated circuit design process.
[0007] Technical solution: To solve the above technical problems, the technical solution adopted by the present invention is:
[0008] In a first aspect, a method for predicting physical features after layout based on a graph neural network comprises the following steps:
[0009] Step 1: Obtain a circuit netlist and convert the interconnections between gate units and networks in the circuit netlist into a graph data structure.
[0010] Step 2: According to the graph data structure, obtain the adjacency matrix, obtain the characteristics of the central network itself and the characteristics of the neighboring networks of the central network based on the adjacency matrix, use the characteristics of the central network itself and the characteristics of the neighboring networks of the central network as the feature matrix, calculate the corresponding semi-perimeter of each network, use the corresponding semi-perimeter as the label to be learned, and use the adjacency matrix, feature matrix and label to be learned as the sample data set.
[0011] Step 3: Divide the sample data set into training set data and test set data, use the training set data to train the physical feature prediction network model to obtain the trained physical feature prediction network model, use the test set data to verify the prediction accuracy and efficiency of the trained physical feature prediction network model, and adjust the trained physical feature prediction network model based on the verification results to obtain the adjusted physical feature prediction network model.
[0012] Step 4: Input the circuit layout diagram to be predicted into the adjusted physical feature prediction network model to obtain the predicted value of the semi-perimeter of the network after layout.
[0013] As a preferred solution, the graph data structure acquisition method specifically includes:
[0014] The networks in the circuit netlist are regarded as nodes, and the cells connecting two networks are regarded as edges.
[0015] The circuit netlist is converted into a topological graph consisting of nodes and edges according to the connection relationship of the circuit netlist.
[0016] As a preferred solution, the values in the adjacency matrix reflect the connection relationship between nodes.
[0017] As a preferred solution, the characteristics of the central network include, but are not limited to, the area of the central network's driver unit and sink unit, and the number of neighboring networks of the central network. The characteristics of the neighboring networks of the central network include, but are not limited to, the number of fan-in networks, the number of fan-out networks, the area of the driver unit, the area of the sink unit, and / or the standard deviation of the sink unit area.
[0018] As a preferred solution, the semi-perimeter corresponding to each network is the sum of the length and width of the smallest rectangle containing the network drive pins and the load pins.
[0019] As a preferred solution, the physical feature prediction network model includes: an embedding layer, a multi-layer GNN layer, a merging layer, and a fully connected layer. The embedding layer and the multi-layer GNN layer are connected in series, and the output of each GNN layer is also connected to the input of the merging layer, and the output of the merging layer is connected to the input of the fully connected layer. The GNN layer includes a graph attention neural network, which is used to calculate attention coefficients and feature weighted aggregation, so as to better learn the impact of different types of neighbor networks on the central network and focus on the relationship between different types of networks in different attention heads.
[0020] As a preferred solution, the graph attention neural network has 3 layers, the dimensions of each layer are 32, 64 and 64 respectively, the number of attention heads is 2, and the node aggregation method is sum aggregation.
[0021] As a preferred solution, the training set data is 6 and the test set data is 3.
[0022] In a second aspect, a computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements a post-layout physical feature prediction method based on a graph neural network as described in any one of the first aspects.
[0023] According to a third aspect, a computer device includes:
[0024] Memory, used to store instructions.
[0025] A processor is used to execute the instructions so that the computer device performs the operations of a post-layout physical feature prediction method based on a graph neural network as described in any one of the first aspects.
[0026] Beneficial effects: The present invention provides a post-layout physical feature prediction method based on graph neural network, which converts the circuit netlist in the logic synthesis stage into a topological graph composed of nodes and edges, constructs an adjacency matrix according to the connection relationship between nodes, extracts the initial feature vector of each node to obtain a feature matrix, and inputs a graph neural network module composed of an embedding layer, a multi-layer GNN layer, a merging layer and a fully connected layer, aggregates the feature information of neighbor nodes and predicts the half perimeter wirelength (HPWL) of the network after layout.
[0027] The present invention introduces a physical feature prediction model based on graph neural networks to estimate the network line length after layout. The prediction result can be used as one of the features of the subsequent early timing prediction framework, significantly improving the prediction accuracy of the path delay after layout, thereby guiding designers or tools to optimize, reduce design iterations, and reduce the time cost of chip design.
[0028] The present invention can accurately and efficiently predict post-layout physical characteristics during the logic synthesis stage to assist in more accurate timing analysis, thereby effectively guiding circuit pre-layout design and optimization, which is of great significance for accelerating the digital integrated circuit design process. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 Schematic diagram of the process framework of the physical feature prediction method based on graph neural network.
[0030] Figure 2 Schematic diagram of the process of converting a circuit netlist into a graph data structure, where: Figure 2 (a) is a schematic diagram of the circuit network. Figure 2 (b) is a schematic diagram of the graph data structure.
[0031] Figure 3 is a schematic diagram of the construction process of the adjacency matrix, where Figure 3 (a) is a diagram of the graph data structure. Figure 3 (b) is a schematic diagram of the adjacency matrix.
[0032] Figure 4 Schematic diagram of HPWL (posterior half circumference).
[0033] Figure 5 Schematic diagram of the graph neural network module structure.
[0034] Figure 6 This is a schematic diagram of the implementation process of the GAT (Graph Attention Neural Network) layer, where: Figure 6 (a) is a schematic diagram of the attention coefficient calculation structure. Figure 6 (b) is a schematic diagram of the feature weighted aggregation structure. DETAILED DESCRIPTION
[0035] The following is a clear and complete description of the technical solutions in the examples of the present invention, in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.
[0036] The present invention will be further described below with reference to specific embodiments.
[0037] Example 1:
[0038] This embodiment introduces a post-layout physical feature prediction method based on a graph neural network. This method analyzes the circuit netlist structure and converts it into a graph to construct an adjacency matrix. Features related to the post-layout half perimeter wirelength (HPWL) are extracted from the circuit netlist and network-related reports to construct a feature matrix. To focus on more global information, a GNN (Graph Neural Network) model is built to aggregate network neighbor information, resulting in high-quality node representations for post-layout half perimeter wirelength prediction. The method includes the following steps:
[0039] Step S1: Convert the circuit netlist into a graph data structure. Consider the networks in the circuit netlist as nodes and the units connecting two networks as edges. Construct a graph data structure of nodes and edges, and obtain an adjacency matrix from the graph data structure. The values in the adjacency matrix reflect the connection relationships between nodes.
[0040] Step S2: Based on fundamental knowledge and related research in the field of line length prediction, we consider the characteristics of both the central network itself and its neighboring node networks, selecting features highly relevant to the prediction task as input to the subsequent prediction model. Based on the graph data structure, the attributes of the central network itself and its neighboring node networks are used as feature matrices. For each network, corresponding semi-perimeter labels are generated. These semi-perimeter labels are used as labels to be learned. The adjacency matrix, feature matrix, and labels to be learned serve as sample datasets for training the line length prediction model and estimating prediction accuracy.
[0041] Step S3: Build a physical feature prediction network based on a graph neural network. Use the adjacency matrix obtained in step S1, the feature matrix obtained in step S2, and the labels to be learned as input to train the physical feature prediction network model, obtaining a trained physical feature prediction network model.
[0042] Step S4: Train and verify the model built in step S3, divide the sample data prepared in step S2 into training set data and test set data, use the training set data to train the model, use the test set data to verify the model prediction accuracy and efficiency, and adjust the trained physical feature prediction network model based on the verification results to obtain the adjusted physical feature prediction network model.
[0043] Step S5: Inputting the circuit layout diagram to be predicted into the adjusted physical feature prediction network model to obtain a predicted value of the semi-perimeter of the network after layout.
[0044] Furthermore, in step S1, the interconnections between gate units and networks in the circuit netlist are converted into a graph. The physical feature prediction task of the present invention is to predict the physical features of the network after layout. The learning subject is the network rather than the unit. Therefore, each network in the circuit is represented as a node in the graph, and the units connecting each network to other adjacent networks are represented as edges between two nodes in the graph.
[0045] Furthermore, in step S2, the physical feature prediction task is to estimate the semi-perimeter after layout, using the semi-perimeter of the network as the label for model prediction. The layout stage completes the placement of standard cells but there are no actual connections between cells. The line length at this stage is different from the actual routing length after wiring, so the semi-perimeter is often used to represent the line length at this stage. To calculate the semi-perimeter, it is necessary to find the smallest rectangle containing the network drive pins and load pins. The sum of its length and width is the semi-perimeter of the network. The HPWL network is connected by a common unit, which is represented as an edge in the figure.
[0046] Furthermore, in step S2, for each circuit network to be estimated, its characteristics can be divided into two parts: the first part is the characteristics of the central network itself, which directly affect the network's semi-perimeter; the second part is the characteristics of the central network's neighboring networks, which influence the network's semi-perimeter through complex interactions within the circuit. Neighboring networks here refer to the central network's one-hop neighbors. For the basic characteristics of the central network itself, the areas of the central network's driver and sink units, and the number of its neighboring networks were selected. The area of a sink unit is related to line length. Generally speaking, a larger sink unit may have more input and output pins, which leads to more connections and longer line lengths. The number of neighboring networks of the central network reflects the distribution of networks surrounding the central network. Generally speaking, a greater number of surrounding networks indicates more wiring near the central network, resulting in longer line lengths. For the characteristics of the central network's neighboring networks, the number of fan-in networks, the number of fan-out networks, the sum of the driver unit area and the sink unit area, or the standard deviation of the sink unit area, was selected. Considering the mutual influence between unit placement during layout, this implies that adjacent networks also have mutual influence. Including the features of neighbor networks in the feature selection process can obtain the mutual influence relationship between networks at longer distances, enabling subsequent graph neural networks to learn higher-quality node representations.
[0047] Furthermore, in step S3, the constructed physical feature prediction module takes the adjacency matrix, the feature matrix and the generated semi-perimeter label as input, and is composed of an embedding layer, a multi-layer GNN layer, a merging layer and a fully connected layer. The semi-perimeter of the network is used as the label predicted by the model to estimate the semi-perimeter after layout.
[0048] Step S3 specifically includes the following steps:
[0049] S31: Build the embedding layer. The first embedding layer of the module transforms the node's feature vector into a dimensional space, providing the initial embedding vector for the subsequent GNN layer. The presence of the embedding layer ensures the consistency and standardization of the input data, which can improve the stability of model training.
[0050] S32: Building the GNN layer. The initial embedding vector obtained by the embedding layer is fed into a multi-layer GNN layer for learning. Assuming the number of GNN layers is M, the mth GNN layer can aggregate information from the central node's m-hop neighbors, allowing for more global netlist information to be learned. However, excessive network layers can cause node representations to tend to aggregate information from more neighbors, making them similar during the update process of each layer, leading to oversmoothing and reduced computational efficiency. Considering these factors, the graph neural network module of the present invention uses three GNN layers. The network's initial features contain relatively localized information from 2-hop neighbors, while the three GNN layers can aggregate information from 3-hop neighbors. Therefore, the semi-perimeter physical feature prediction model can focus on more global information from 5-hop neighbors, thereby obtaining higher-quality node embedding representations. Each GNN layer is composed of a Graph Attention Network (GAT) with the same implementation principle. The implementation of the GAT layer includes two processes: attention coefficient calculation and feature weighted aggregation.
[0051] For each network to be predicted, the GAT layer first calculates the attention coefficients of it and all one-hop neighbor networks. For net i and net j, assume that their feature vectors are h i and h j , the calculation of the attention coefficient between net i and net j is actually to learn the correlation between their feature vectors. Through the shared parameter W, the feature vectors of net i and net j are linearly mapped and then spliced together, and then mapped again by W aThe attention coefficient between the two networks is obtained, and then the attention coefficient is softmax-normalized to obtain the attention coefficient of net i on net j. This calculation assigns different weights to neighboring nodes based on their feature information, which are then used in the subsequent weighted aggregation process. This approach can describe the importance of different neighboring nodes. For example, fan-in and fan-out networks have different influences on the central network due to their different positions relative to it. The presence of the attention coefficient allows the GNN module to better learn the influence of different types of neighboring networks on the central network. Furthermore, to improve the generalization of the model, the GAT layer uses a two-headed attention mechanism, allowing the model to focus on the relationships between different types of networks in different attention heads, better adapting to unknown graph data.
[0052] S33: Build the merging and fully connected layers. The semi-perimeter physical feature prediction task aims to simultaneously learn the feature information of local one- and two-hop neighborhood networks, as well as the more global neighborhood network information of three or more hops. Therefore, after learning through three GNN layers, the physical feature prediction model uses a merging layer to concatenate the embedding vectors of each GNN layer to obtain an embedding vector containing information at different depths. The merged embedding vector is then input into the fully connected layer for dimensionality transformation to obtain the final node embedding vector for the entire GNN module.
[0053] Furthermore, the specific process for generating node embedding vectors for the GNN module in the semi-perimeter physical feature prediction model is as follows: First, the initial input vector of each network is passed through the embedding layer to obtain the initial embedding vector of the first GNN layer. For each attention head of the GNN layer, the initial embedding vector of the network is the same. Then, the attention coefficient of the node to its neighboring nodes is calculated, and the attention coefficient is used as the weight to perform weighted aggregation of the information of the neighboring nodes. The aggregated embedding vector is updated through the multi-layer perceptron. Based on the multi-head attention mechanism, the vectors learned under different attention levels are spliced to obtain the node embedding vector of a GNN layer. For multi-layer GNN layers, the vector output by the previous GNN layer is used as the input vector of this layer. Finally, the output of each GNN layer is spliced to obtain embedding vectors of different depths, which are sent to the multi-layer perceptron to obtain the final node embedding vector.
[0054] The node embedding vectors learned by the graph neural network module will be subsequently input into the multi-layer perceptron in the prediction module for learning, and finally the predicted value of the semi-perimeter of the network after layout is obtained.
[0055] Example 2:
[0056] This embodiment introduces a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements a post-layout physical feature prediction method based on a graph neural network as described in any one of the embodiments 1.
[0057] Example 3:
[0058] A computer device comprising:
[0059] Memory, used to store instructions.
[0060] A processor is used to execute the instructions so that the computer device performs the operations of a post-layout physical feature prediction method based on a graph neural network as described in any one of Example 1.
[0061] Example 4:
[0062] This example introduces a post-layout physical feature prediction method based on a graph neural network (GNN). This method analyzes the circuit netlist structure and converts it into a graph to construct an adjacency matrix. Features related to the post-layout half perimeter wirelength (HPWL) are extracted from the circuit netlist and network-related reports to construct a feature matrix. To focus on more global information, a GNN model is built to aggregate network neighbor information to obtain high-quality node representations for post-layout half perimeter wirelength prediction. Figure 1 The overall framework of the physical feature prediction model based on graph neural network is presented. The method includes the following steps:
[0063] S1: Convert the circuit netlist into a graph data structure. Figure 1 (a) The circuit netlist in the circuit netlist is regarded as a node, and the unit connecting two networks is regarded as an edge. According to the connection relationship of the netlist, the circuit netlist is converted into Figure 1 The topological graph (b) consists of nodes and edges. An adjacency matrix is constructed to represent the graph structure. The values in the matrix reflect the connectivity between nodes. The benchmark circuits used are from ISCAS'89 and OpenCores. Synthesis was performed using Synopsys' Design Compiler and physical design was performed using Synopsys' IC Compiler on a TSMC 22nm process. The layout report for the circuit was generated, and Python was used to extract network location information from the layout report to construct the required adjacency matrix.
[0064] S2: Based on fundamental knowledge and related research in the field of wire length prediction, we consider the characteristics of both the central network itself and its neighboring node networks, selecting features highly relevant to the prediction task as input to the subsequent prediction model. We generate corresponding semi-perimeter labels for each network, which serve as a sample dataset for training the wire length prediction model and estimating its accuracy. We use Python to extract network-related features from the synthesized circuit netlist, and calculate the network's semi-perimeter as a physical feature to obtain the model's label.
[0065] S3: Build a physical feature prediction network based on graph neural network. Take the adjacency matrix obtained in step S1, the feature matrix obtained in step S2 and the labels to be learned as input, and train the network composed of Figure 1 (c) The graph neural network module and Figure 1 (d) shows a physical feature prediction network model composed of fully connected layers to obtain the predicted value of the semi-perimeter of the network after layout. The physical feature acquisition model introduced in this paper was implemented using Python. Code was written using the PyTorch, TensorFlow, and Scikit-learn environments to implement the physical feature prediction model based on a graph neural network. The model was trained and inferred on a server equipped with 48 CPUs, 12 CPU cores, and one NVIDIA Tesla V100 GPU core with 32GB of video memory, to obtain the semi-perimeter of the network after layout. During training, the graph neural network (GAT) layer number was set to 3, with layer dimensions of 32, 64, and 64, respectively. The number of attention heads was set to 2, and the node aggregation method was sum aggregation.
[0066] S4: Train and validate the model built in step S3. Divide the sample circuits prepared in step S2 into six training circuits and three test circuits. Use the training data to train the model, and use the test data to verify the model's prediction accuracy and efficiency. The correlation coefficient (R) is used as an evaluation metric. Use Python to calculate physical characteristics to obtain the model's correlation coefficient and inference time.
[0067] In step S1, the interconnections between gate units and networks in the circuit netlist are converted into a graph.
[0068] A graph is composed of two parts: nodes and edges. Assuming V represents the set of all nodes in a graph and E represents the set of all edges in the graph, the graph can be represented as , represents any node in the graph, It represents the connection node and nodes The circuit netlist contains interconnections between gate units and networks, which can be converted into a graph. For different graph learning tasks, the selection of nodes and edges may be different. In graph learning tasks with gate units as the main body, units are usually regarded as nodes and the interconnections between units are regarded as edges. The physical feature prediction task of the present invention is to predict the semi-perimeter of the network after layout, and the learning subject is the network rather than the unit. Therefore, Figure 2 As shown, each network in the circuit is represented as a node in the graph, and each network is connected to its adjacent networks through a common unit, which is represented as an edge in the graph. For example, Figure 2 In (a), net4 is connected to net5, net6 and net7 through its sink units g, h and i respectively, and is connected to net1, net2 and net3 through its driver unit f. Through this process, the circuit netlist in the left figure is converted into Figure 2 (b) Graph data structure.
[0069] In order to send the graph structure data obtained by converting the circuit netlist to the graph neural network for learning, it is also necessary to represent it in a form that the graph neural network can recognize. , the present invention defines a size of The initial elements of the matrix are all 0. is the number of networks in the circuit netlist. Then all the networks are incremented from 1 to Numbering, Network nodes Indicates that each row and column of the adjacency matrix corresponds to each node. As the central node, the connection between the central node and other nodes is obtained by traversal. and nodes are connected by an edge, then the first Rank The value of the column is recorded as 1, otherwise it remains 0. The final adjacency matrix is a symmetric matrix with a diagonal of 1. This is because of the following two points: (1) In the semi-perimeter prediction problem of the present invention, the connection relationship between nodes is bidirectional, so the first column of the adjacency matrix is Rank The column value and Rank The values of the columns are the same, which makes the adjacency matrix symmetrical; (2) In order to enable the graph neural network to aggregate the information of the central node itself during aggregation, it is specified that the nodes themselves are connected when constructing the adjacency matrix, which makes the diagonals of the adjacency matrix all 1. Figure 3 The construction process of the above adjacency matrix is described. Figure 3In (a), the red nodes represent the central nodes, and the blue nodes represent the neighbor nodes. Figure 3 In (b), the red and blue positions represent connections between nodes, with element values of 1, and the element values of the white positions are 0.
[0070] In step S2, the physical feature prediction task involves estimating the post-layout semi-perimeter, using the network's semi-perimeter as the model's predicted label. While the layout phase completes the placement of standard cells, there are no actual connections between cells. The wire length at this stage differs from the actual routing length after routing, so the semi-perimeter is often used to represent the wire length at this stage. Figure 4 illustrates the semi-perimeter calculation process using net4 as an example.
[0071] Figure 4 In the example, the driver pin of net4 is A, and the load pins are B, C, and D. To calculate the semi-perimeter, we need to find the smallest rectangle that contains A, B, C, and D. Half of the perimeter of this smallest rectangle is the semi-perimeter of net4. For a network, assume that the coordinates of its driver pin are , the number of load pins is N, and the coordinates of the i-th load pin are expressed as , then the calculation process of the semi-perimeter of the network can be expressed by formula (1).
[0072] (1)
[0073] in and Represents the left and right boundaries of the smallest rectangle respectively. and Represent the lower and upper boundaries of the minimum rectangle width, respectively. Represents the length of the smallest rectangle, It represents the width of the smallest rectangle. The sum of the length and width gives the half perimeter HPWL of the network.
[0074] In step S2, the characteristics of each circuit network to be estimated can be divided into two parts: the first part is the characteristics of the central network itself, which have a direct impact on the network's semi-perimeter; the second part is the characteristics of the central network's neighboring networks, which influence the network's semi-perimeter through complex interactions within the circuit. Neighboring networks here refer to the one-hop neighbors of the central network. A hop represents the shortest distance between nodes in the graph.
[0075] by Figure 2 The circuit in Figure 1 is used as an example to define the relevant terms. For net4, it has a driver unit f and three sink units g, h, and i. The area of the driver unit of net4 is That is the area of unit f; the area of the sink unit of net4 It is the sum of the areas of units g, h, and i. The fan-in network of net4 is the network to which the input pins of the driver unit of net4 are connected, namely net1, net2, and net3. Therefore, the number of fan-in networks of net4 is The fan-out network of net4 is the network to which the output pin of the sink unit of net4 is connected, namely net5, net6 and net7. Therefore, the number of fan-out networks of net4 is ; net4's 1-hop neighbors include its fan-in network and fan-out network, so the number of net4's 1-hop neighbor networks is .
[0076] For the basic characteristics of the central network itself, we selected the area of the central network's driver unit and sink unit, as well as the number of neighboring networks of the central network. The area of the unit is related to the line length. Generally speaking, a unit with a larger area may have more input and output pins, which will lead to more connections and longer line lengths. Considering that the two types of units, driver and sink, may have different effects on the central network, the effect of area on line length is divided into two parts: the area of the driver unit and the area of the sink unit. The number of neighboring networks of the central network reflects the distribution of networks surrounding the central network. Generally speaking, more surrounding networks indicate more routing near the central network, and the line length will also be longer. For the same considerations as area, the effect of the number of neighboring networks on line length is divided into two parts: the number of fan-in networks and the number of fan-out networks.
[0077] For the features of the central network's neighboring networks, we selected the sum / standard deviation of the number of fan-in networks, the number of fan-out networks, the area of driver units, and the area of sink units. Considering the mutual influence between unit placement during layout, this implies that adjacent networks also influence each other. Including the features of neighboring networks in the feature selection process can capture the mutual influence relationships between more distant networks, enabling the subsequent graph neural network to learn higher-quality node representations. The sum of these basic features of the neighboring networks reflects their overall impact on the central network, while the standard deviation reflects the distribution of these basic features' influence around the central network. For the same reasons as for the basic features, these neighboring network features are also divided into fan-in and fan-out network components. As can be seen from the above description, the features selected by the present invention include information about the central network's own one-hop neighboring networks, and the features of the neighboring networks also include information about their one-hop neighbors. Therefore, for the initial features, two-hop neighboring information can be considered, which is relatively local information, while global information comes from information about more distant networks, which will be achieved through subsequent aggregation in the multi-layer GNN model.
[0078] In step S3, the constructed physical feature prediction module takes the adjacency matrix, feature matrix and generated semi-perimeter labels as input, and is composed of an embedding layer, a multi-layer GNN layer, a merging layer and a fully connected layer. The semi-perimeter of the network is used as the label predicted by the model to estimate the semi-perimeter after layout. The specific structure of the graph neural network module is as follows: Figure 5 shown.
[0079] Step S3 specifically includes the following steps:
[0080] S31: Build the embedding layer. The first embedding layer of the module transforms the node's feature vector into a dimensional space, providing the initial embedding vector for the subsequent GNN layer. The presence of the embedding layer ensures the consistency and standardization of the input data, which can improve the stability of model training.
[0081] S32: Build the GNN layer. The initial embedding vector obtained by the embedding layer is sent to the multi-layer GNN layer for learning. Assuming that the number of GNN layers is M, the m-th GNN layer can aggregate the information of the m-hop neighbors of the central node, so that more global netlist information can be learned. However, too many network layers may cause the representation of the node to tend to aggregate more neighbor information, making it tend to be similar in the update process of each layer, resulting in over-smoothing problems, and also reducing computational efficiency. Taking the above factors into consideration, the graph neural network module of the present invention uses three layers of GNN layers. The initial features of the network contain relatively local 2-hop neighbor information, while the three-layer GNN layer can aggregate the information of 3-hop neighbors. Therefore, the semi-perimeter physical feature prediction model can focus on more global information from 5-hop neighbors, thereby obtaining higher quality node embedding representations. Each GNN layer is composed of a graph attention neural network (GAT) with the same implementation principle, such as Figure 6 As shown in Figure 3, the implementation of the GAT layer includes two processes: attention coefficient calculation and feature weighted aggregation.
[0082] For each network to be predicted, the GAT layer first calculates the attention coefficients between it and all one-hop neighbor networks. Figure 6 In (a), for net i and net j, assume that their eigenvectors are h i and h j , the calculation of the attention coefficient between net i and net j is actually to learn the correlation between their feature vectors. Through the shared parameter W, the feature vectors of net i and net j are linearly mapped and then spliced together, and then mapped again by W aThe attention coefficient between the two networks is obtained, and then the attention coefficient is normalized by softmax to obtain the attention coefficient of net i to net j. Figure 6 The calculation of the attention coefficient in (b) assigns different weights to different neighboring nodes based on the feature information they contain. This weighting is then used in the subsequent weighted aggregation process. This approach can describe the importance of different neighboring nodes. For example, fan-in and fan-out networks have different influences on the central network due to their different positions relative to it. The presence of the attention coefficient allows the GNN module to better learn the influence of different types of neighboring networks on the central network. Furthermore, to improve the model's generalization, the GAT layer uses a two-headed attention mechanism, allowing the model to focus on the relationships between different types of networks in different attention heads, better adapting to unknown graph data.
[0083] S33: Build the merging and fully connected layers. The semi-perimeter physical feature prediction task aims to simultaneously learn the feature information of local one- and two-hop neighborhood networks, as well as the more global neighborhood network information of three or more hops. Therefore, after learning through three GNN layers, the physical feature prediction model uses a merging layer to concatenate the embedding vectors of each GNN layer to obtain an embedding vector containing information at different depths. The merged embedding vector is then input into the fully connected layer for dimensionality transformation to obtain the final node embedding vector for the entire GNN module.
[0084] The specific process for generating node embedding vectors for the GNN module in the semi-perimeter physical feature prediction model is as follows: First, the initial input vector of each network is passed through the embedding layer to obtain the initial embedding vector of the first GNN layer. The initial embedding vector of the network is the same for each attention head of the GNN layer. Then, the attention coefficient of the node to its neighboring nodes is calculated, and the attention coefficient is used as the weight to perform weighted aggregation of the information of the neighboring nodes. The aggregated embedding vector is updated through a multi-layer perceptron. Based on the multi-head attention mechanism, the vectors learned under different attention levels are spliced together to obtain the node embedding vector of a GNN layer. For multi-layer GNN layers, the output vector of the previous GNN layer is used as the input vector of the current layer. Finally, the output of each GNN layer is spliced together to obtain embedding vectors of different depths, which are then fed into the multi-layer perceptron to obtain the final node embedding vector.
[0085] The node embedding vectors learned by the graph neural network module will be subsequently input into the multi-layer perceptron in the prediction module for learning, and finally the predicted value of the semi-perimeter of the network after layout is obtained.
[0086] Example 5:
[0087] This embodiment introduces the use of the correlation coefficient R, a commonly used evaluation indicator in wire length estimation work, to describe the correlation between the predicted value of the semi-perimeter length of a network in a netlist and its label value.
[0088] The correlation coefficient of the semi-circumference physical feature prediction model introduced by this invention reaches an average value of 0.9443 for known circuits, and 0.9071 for unknown circuits. The correlation coefficient between the model's predictions and the true values is greater than 0.9 for both known and unknown circuits, indicating a strong positive correlation between the predicted and labeled values. This strong correlation allows the predicted values to reflect the true semi-circumference trend. When physical information is missing in the early stages of a design, the predicted line length can be used instead of the true value to provide the delay prediction model with on-line physical information, thereby improving its accuracy.
[0089] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A post-layout physical feature prediction method based on graph neural network, characterized by: The steps include: Step 1: Obtain the circuit netlist and convert the interconnections between gate units and networks in the circuit netlist into a graph data structure; Step 2: Based on the graph data structure, obtain the adjacency matrix. Based on the adjacency matrix, obtain the characteristics of the central network itself and the characteristics of the neighboring networks of the central network. Use the characteristics of the central network itself and the characteristics of the neighboring networks of the central network as the feature matrix, calculate the corresponding semi-perimeter of each network, use the corresponding semi-perimeter as the label to be learned, and use the adjacency matrix, feature matrix and labels to be learned as the sample data set; Step 3: Divide the sample data set into training set data and test set data, use the training set data to train the physical feature prediction network model to obtain a trained physical feature prediction network model, use the test set data to verify the prediction accuracy and efficiency of the trained physical feature prediction network model, and adjust the trained physical feature prediction network model based on the verification results to obtain an adjusted physical feature prediction network model; Step 4: Input the circuit layout to be predicted into the adjusted physical feature prediction network model to obtain the predicted value of the half-perimeter of the network after layout; The graph data structure acquisition method specifically includes: The networks in the circuit netlist are considered nodes, and the cells connecting two networks are considered edges; Converting the circuit netlist into a topological graph consisting of nodes and edges according to the connection relationship of the circuit netlist; The characteristics of the central network itself include but are not limited to: the area of the driving unit and sink unit of the central network and the number of neighboring networks of the central network; the characteristics of the neighboring networks of the central network include but are not limited to: the number of fan-in networks, the number of fan-out networks, the area of the driving unit, the area of the sink unit and / or the standard deviation of the sink unit area; The physical feature prediction network model includes: an embedding layer, a multi-layer GNN layer, a merging layer and a fully connected layer. The embedding layer is connected in series with the multi-layer GNN layer, and the output end of each GNN layer is also connected to the input end of the merging layer, and the output end of the merging layer is connected to the input end of the fully connected layer; the GNN layer includes a graph attention neural network, which is used to calculate the attention coefficient and feature weighted aggregation calculation, so as to better learn the influence of different types of neighbor networks on the central network and pay attention to the relationship between different types of networks in different attention heads.
2. The method for predicting physical features after layout based on graph neural network according to claim 1, characterized in that: The values in the adjacency matrix reflect the connection relationship between nodes.
3. The method for predicting physical features after layout based on graph neural network according to claim 1, characterized in that: The semi-perimeter corresponding to each network is the sum of the length and width of the smallest rectangle containing the network drive pins and the load pins.
4. The method for predicting physical features after layout based on graph neural network according to claim 1, characterized in that: The graph attention neural network has 3 layers, the dimensions of each layer are 32, 64 and 64 respectively, the number of attention heads is 2, and the node aggregation method is sum aggregation.
5. The method for predicting physical features after layout based on graph neural network according to claim 1, characterized in that: The training set data is 6 and the test set data is 3.
6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, it implements a post-layout physical feature prediction method based on a graph neural network as described in any one of claims 1 to 5.
7. A computer device, characterized in that: include: a memory for storing instructions; A processor is used to execute the instructions so that the computer device performs the operations of the post-layout physical feature prediction method based on graph neural network as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Analytic layout method based on graph neural network
CN115455899A
Path time sequence prediction method based on graph neural network
CN117709258A