Pruning method based on machine learning for circuit simulation partitioning technology
Through the pruning method based on machine learning, the pruning threshold of sub-circuits in circuit simulation is analyzed and predicted, and the problem of poor partitioning technology due to the density of the coupled circuit matrix is solved, and more efficient circuit simulation is achieved.
Patent Information
- Application Number
- CN202411713957.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-01
AI Technical Summary
In circuit simulation, the matrix generated by the coupling circuit is too dense, resulting in poor scalability of partitioning technology, limiting simulation efficiency and speed.
A machine learning-based pruning method is adopted to analyze the relationship between pruning threshold and simulation accuracy, extract relevant features, and train the machine learning model based on these features to predict the pruning threshold of each sub-circuit, thereby pruning the coupled circuit and reducing its density.
This method can significantly reduce the density of the coupling circuit while ensuring simulation accuracy, thereby improving the scalability of partitioning technology and improving simulation efficiency.
Smart Images

Figure CN119740528A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of integrated circuit design automation, and in particular relates to a pruning method based on machine learning for circuit simulation partitioning technology. Background Art
[0002] Transistor-level circuit simulation is an indispensable part in verifying the functions and performance of integrated circuits. However, the rapidly increasing circuit scale and complex parasitic effects in post-layout design limit the simulation efficiency, thereby delaying the time to market of chips. Considering that circuits usually have local characteristics, that is, nodes in the circuit are usually only strongly connected to nearby nodes, and large-scale circuit designs are usually hierarchical and structured, partitioning technology is widely used in circuit simulation to improve simulation efficiency. Partitioning technology, sometimes also called regional decomposition method, is based on a divide-and-conquer idea, dividing a circuit into multiple subcircuits and a coupling circuit. These subcircuits are independent of each other and can be solved simultaneously, while the coupling circuit containing the interactive information between subcircuits can only be solved serially. The advantage of partitioning technology is that not only can multiple subcircuits be solved in parallel, but each subcircuit can also be solved in parallel by mining its own sparse structure. In addition, combined with a distributed computing platform, partitioning technology can also alleviate the memory pressure of a single computer, which is very useful for large-scale circuit simulation.
[0003] Although partitioning technology has many advantages, the matrix generated by the coupled circuit is relatively dense, which makes the solution process time-consuming and limits the scalability of partitioning technology. Many studies at home and abroad have tried to reduce the computational cost of solving coupled circuits. One research direction is to optimize the circuit partitioning algorithm to reduce the size of the coupled circuit. Circuit partitioning is an NP-hard problem and has been widely studied. The technology is relatively mature. The circuit partitioning algorithm focuses on reducing the size of the coupled circuit rather than the density. Another research direction is to use the partitioning technology to solve an approximate circuit of the original circuit to obtain an approximate solution result, and then use the iterative method to refine the result until the accuracy requirement is met, thereby avoiding the calculation of dense coupled circuits. For example, the Schwarz method divides the circuit into several overlapping subcircuits without coupling circuits. These overlapping subcircuits can be solved simultaneously to obtain approximate results. Liu et al. introduced a graph sparsification technique to solve the Laplacian matrix of the original circuit to obtain an approximate result. Because the Laplacian matrix is much sparser than the original matrix, the coupling matrix generated by the partitioning technology becomes sparse, thereby improving scalability. Since the convergence and convergence speed of the iterative method are very sensitive to the matrix structure, this research direction is only applicable to circuit simulation scenarios with very regular structures and good condition numbers, such as DC analysis of integrated circuit power supply networks.
[0004] However, for most circuit simulation scenarios, complex topological structures can cause the circuit matrix to become irregular. Direct methods, such as LU decomposition, have good robustness for solving irregular or ill-conditioned matrices. Therefore, they are still the most widely used methods in circuit simulation. Although the partitioning technology based on LU decomposition cannot avoid solving coupled circuits, the pruning method can significantly reduce the density at the expense of slight accuracy, thereby improving the scalability of the partitioning technology. On the one hand, excessive pruning may remove necessary circuit connections or important parasitic effects, resulting in a sharp drop in accuracy. On the other hand, insufficient pruning cannot minimize the computational load and does not achieve optimal performance. Therefore, it is necessary to find a suitable pruning threshold so that the simulation accuracy can minimize the computational load while meeting user needs. Summary of the invention
[0005] The purpose of the present invention is to provide a pruning method based on machine learning for circuit simulation partitioning technology to solve the problem that the coupled circuits are too dense in circuit simulation, which leads to poor scalability of the partitioning technology. The method can accurately control the simulation accuracy while minimizing the density of the coupled circuits, thereby improving the scalability of the partitioning technology.
[0006] In order to achieve the above object, the present invention adopts the following technical solution: a pruning method based on machine learning for circuit simulation partitioning technology, comprising:
[0007] S01: Use the circuit simulation tool to perform simulation tasks on a given circuit netlist and calculate the simulation accuracy, and obtain a large number of samples by scanning the number of subcircuits and the pruning threshold of coupled circuits;
[0008] S02: Using the pruning threshold as the label of the sample, and preprocessing the sample label, the circuit simulation tool can maintain high simulation accuracy as much as possible under the premise of difficulty in improving performance;
[0009] S03: Extract relevant features by analyzing the relationship between pruning threshold and simulation accuracy;
[0010] S04: using the number of simulation steps, simulation accuracy, number of sub-circuits, and features extracted in step S03 as input features of the sample, and training the machine learning model based on the generated sample set;
[0011] S05: Embed the trained model into the circuit simulation tool, predict the pruning threshold of each sub-circuit according to the simulation accuracy given by the user, and prune the coupled circuit.
[0012] Furthermore, the number of sub-circuits in step S01 is equal to the parallelism of the circuit simulation and is specified by the user.
[0013] Furthermore, the pruning threshold acquisition step in step S01 includes:
[0014] Step S011: determining the upper limit of each sub-circuit pruning threshold and the number of samples required to be generated for each circuit netlist;
[0015] Step S012: equally divide the upper limit of each sub-circuit pruning threshold by the number of samples to obtain scanning points of each sub-circuit pruning threshold;
[0016] Step S013: using a constrained random scanning method to determine respective pruning thresholds for scanning points at the same position of each sub-circuit.
[0017] Furthermore, the pruning threshold of each subcircuit in step S02 needs to be equally scaled, so that the sample label includes a scaling factor and the pruning threshold before scaling.
[0018] Furthermore, the preprocessing process in step S02 involves modifying the labels of samples whose accuracy decreases rapidly and whose performance improves slowly into labels corresponding to samples at the starting point of the trend.
[0019] Furthermore, the features in step S03 are features extracted from the overall circuit matrix and the connected sub-circuit matrices, and mainly include sparsity, symmetry, bandwidth and coefficient of variation.
[0020] Furthermore, the machine learning model in step S04 is a multi-layer perceptron neural network comprising two hidden layers, wherein the two hidden layers are specifically:
[0021] The first hidden layer consists of three parts. The first part contains two neurons, which are connected to the two input features of simulation steps and simulation accuracy respectively. The second part contains N1 neurons, which are fully connected to the number of subcircuits and the features extracted for the overall matrix. The third part includes N2 neurons, which are fully connected to the features extracted for the subcircuits.
[0022] The second hidden layer contains N3 neurons, which are fully connected to all neurons in the first hidden layer;
[0023] Among them, N1, N2, and N3 are hyperparameters of the model architecture.
[0024] Furthermore, the activation function of all neurons of the machine learning model is a sigmoid() function, and the machine learning model training method is a back propagation algorithm.
[0025] Furthermore, in step S05, the pruning threshold of the model prediction needs to be reduced to 0.9 to 1.0 times of the original value to prevent the model prediction failure from causing the pruning threshold to be too large, thereby causing the simulation accuracy to fail to meet user requirements.
[0026] Beneficial effects:
[0027] 1. The intelligent pruning algorithm based on machine learning can model the complex nonlinear relationship between the pruning threshold and simulation accuracy with high precision, thereby ensuring that the simulation accuracy is effectively controlled while minimizing the density of the coupling circuit.
[0028] 2. The extracted features include the inherent features and custom features of the sparse matrix, which can effectively reflect the impact of the pruning threshold on the simulation accuracy, and thus help train high-precision machine learning models.
[0029] 3. The constrained random scanning method can avoid generating redundant samples while maintaining high coverage of the sample set.
[0030] 4. This method improves the scalability of partitioning technology without introducing an iterative method, and has good robustness and universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is an overall overview of the pruning method.
[0032] Figure 2 It is a flow chart for generating samples.
[0033] Figure 3 It is an illustration of the extracted features.
[0034] Figure 4 It is a diagram of the machine learning model architecture. DETAILED DESCRIPTION
[0035] The present invention will be further explained below in conjunction with the accompanying drawings.
[0036] like Figure 1 As shown, the present invention provides a pruning method based on machine learning for circuit simulation partitioning technology, comprising:
[0037] S01: Use the circuit simulation tool to perform simulation tasks on a given circuit netlist and calculate the simulation accuracy, and obtain a large number of samples by scanning the number of sub-circuits and the pruning threshold of the coupled circuits.
[0038] S02: Using the pruning threshold as a label for the sample and preprocessing the sample label enables the circuit simulation tool to maintain high simulation accuracy as much as possible without having to improve performance.
[0039] S03: Extract relevant features by analyzing the relationship between pruning threshold and simulation accuracy.
[0040] S04: The number of simulation steps, simulation accuracy, number of sub-circuits, and features extracted in step S03 are used as input features of the sample, and a machine learning model is trained based on the generated sample set.
[0041] S05: Embed the trained model into the circuit simulation tool, predict the pruning threshold of each sub-circuit according to the simulation accuracy given by the user, and prune the coupled circuit.
[0042] Partitioning techniques can be implemented at the circuit level or the matrix level. This invention focuses on the partitioning technique at the matrix level, where the matrix generated by the coupled circuit is called the Shure supplementary matrix. By modeling circuit elements and then applying improved node analysis, Newton's method, and numerical integration methods, a circuit simulation task is ultimately transformed into a task of solving a sparse linear system. The partitioning technique at the matrix level is introduced as follows. Given a sparse linear system:
[0043] Ax=b
[0044] The coefficient matrix A represents the sparse matrix of the connection relationship between each component in the circuit, b is the excitation of the circuit, and x is the node voltage or branch current to be calculated in the circuit. When the circuit partitioning algorithm is applied, the system is reconstructed into the following form:
[0045]
[0046] Among them A i represents a subcircuit, C i represents a coupled circuit or boundary, E i and F i describes the connection relationship between subcircuits and their respective boundaries, H ij Describes the connection relationship within the boundary, and m is the number of subcircuits. The node voltage or branch current (y i ) can be obtained by solving the following system:
[0047]
[0048] The coefficient matrix is the Schur complement matrix, and the diagonal block S i Obtained by calculating the following formula:
[0049]
[0050] The corresponding right-hand side also needs to be updated:
[0051]
[0052] When the coupled circuit is solved, the coupled circuit solution (y i ) back into the original system to obtain the voltage and current of the subcircuit:
[0053]
[0054] In step S01, given a circuit netlist file and a standard result file, the simulation tool calculates the simulation accuracy by scanning the pruning threshold and the number of sub-circuits to be divided, and then generates samples. The simulation tool contains a parser and a sparse linear system solver. It first reads and parses a netlist file, then uses the improved node analysis method to form ordinary differential equations, and then applies the numerical integration method to transform them into algebraic equations. By solving these algebraic equations, the simulation tool can obtain the transient response of the circuit netlist. If the standard result is given, the simulation tool will obtain the simulation accuracy by calculating the average error, such as Figure 2 shown.
[0055] The scanning method of the pruning threshold uses the constrained random scanning method. This method first determines the upper limit of the pruning threshold for each subcircuit in a circuit and the number of samples that need to be generated for the circuit, and then uses the equal division method to determine the scanning point. For each scanning point t i , select a i -t) to (t i +t) as the pruning threshold. The symbol t is an adjustable parameter representing the window size of random scanning.
[0056] In step S02, the sample label includes a scaling factor (s) and a pruning threshold (p i ), the final pruning threshold (P i ) is obtained by calculating the following formula:
[0057] P i =p i ×10 s i=1,2,…,m
[0058] In the samples generated in step S01, for some circuit structures, a phenomenon may occur: when pruning exceeds a certain threshold, further pruning will cause a significant decrease in simulation accuracy while the density of the Shure supplementary matrix is not significantly reduced. For these samples, their labels are modified and the pruning threshold is fixed at the starting point where this phenomenon occurs, so that the multi-layer perceptron neural network model can learn this feature and realize a circuit simulation tool that takes both high performance and high accuracy into account.
[0059] In step S03, the features are divided into two categories, one is the features extracted from the overall matrix, and the other is the features extracted from each sub-matrix and the related connection matrix, such as Figure 3The features extracted from the overall matrix are used to identify the circuit type, select an appropriate model, and determine the scaling factor for the pruning threshold for the circuit. The features extracted from the sub-matrices and their connection matrices refine the impact of the pruning threshold on accuracy by quantifying the average and maximum connection strength relationship between sub-circuits and boundaries. The average proportion of non-zero elements in a row or column of a sparse matrix ( Figure 3 The feature numbers 1, 4, 6, 8) extracted from the submatrix are mathematically equivalent to the sparsity of the matrix, as shown below:
[0060]
[0061] Where r and c represent the number of rows and columns of the matrix, nnz represents the total number of non-zero elements in the matrix, and nnz_i represents the number of non-zero elements in the i-th row or i-th column of the matrix.
[0062] In step S04, the machine learning model is composed of a multi-layer perceptron neural network including two hidden layers, such as Figure 4 As shown. The input features of the model include the number of simulation steps (Sim), simulation accuracy (Acc), the number of subcircuits (m), and the features extracted in step S03. The output of the model is the scaling factor and the pruning threshold of each subcircuit before scaling. The first hidden layer of the model consists of three parts. The first part contains two neurons, which are connected to the two input features of the number of simulation steps (Sim) and the simulation accuracy (Acc) respectively; the second part contains N1 neurons, which are fully connected to the number of subcircuits (m) and the features extracted for the overall matrix (F1~F6); the third part includes N2 neurons, which are fully connected to the features extracted for the subcircuit (F 11 ~F m9 ) is fully connected. The second hidden layer contains N3 neurons, which are fully connected to all neurons in the previous layer of the network. The output layer is fully connected to the second hidden layer. N1, N2, and N3 are hyperparameters of the model architecture. The activation function of all neurons is the sigmoid() function, and the model training method is the back propagation algorithm.
[0063] In step S05, the trained model is embedded in the circuit simulation tool, and the initial pruning threshold of each subcircuit is predicted according to the simulation accuracy given by the user. Then, in the post-processing process, the threshold is appropriately reduced to obtain the final pruning threshold to prevent the model prediction failure from causing the pruning threshold to be too large, thereby causing the simulation accuracy to not meet the user's requirements. Finally, the coupled circuit is pruned using the pruning threshold.
[0064] 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 principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A machine learning based pruning method for circuit simulation partitioning technology, characterized in that: include: S01: Use the circuit simulation tool to perform simulation tasks on a given circuit netlist and calculate the simulation accuracy, and obtain a large number of samples by scanning the number of subcircuits and the pruning threshold of coupled circuits; S02: Using the pruning threshold as the label of the sample, and preprocessing the sample label, the circuit simulation tool can maintain high simulation accuracy as much as possible under the premise of difficulty in improving performance; S03: Extract relevant features by analyzing the relationship between pruning threshold and simulation accuracy; S04: using the number of simulation steps, simulation accuracy, number of sub-circuits, and features extracted in step S03 as input features of the sample, and training the machine learning model based on the generated sample set; S05: Embed the trained model into the circuit simulation tool, predict the pruning threshold of each sub-circuit according to the simulation accuracy given by the user, and prune the coupled circuit.
2. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 1, characterized in that: The number of sub-circuits in step S01 is equal to the parallelism of the circuit simulation and is specified by the user.
3. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 1, characterized in that: The pruning threshold acquisition step in step S01 includes: Step S011: determining the upper limit of each sub-circuit pruning threshold and the number of samples required to be generated for each circuit netlist; Step S012: equally divide the upper limit of each sub-circuit pruning threshold by the number of samples to obtain scanning points of each sub-circuit pruning threshold; Step S013: using a constrained random scanning method to determine respective pruning thresholds for scanning points at the same position of each sub-circuit.
4. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 1, characterized in that: The pruning threshold of each subcircuit in step S02 needs to be equally scaled so that the sample label includes a scaling factor and the pruning threshold before scaling.
5. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 1, characterized in that: The preprocessing process in step S02 involves modifying the labels of samples whose accuracy decreases rapidly and whose performance improves slowly into labels corresponding to samples at the starting point of the trend.
6. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 1, characterized in that: The features in step S03 are features extracted from the overall circuit matrix and the connected sub-circuit matrices, and mainly include sparsity, symmetry, bandwidth and coefficient of variation.
7. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 1, characterized in that: The machine learning model in step S04 is a multi-layer perceptron neural network including two hidden layers, wherein the two hidden layers are specifically: The first hidden layer consists of three parts. The first part contains two neurons, which are connected to the two input features of simulation steps and simulation accuracy respectively. The second part contains N1 neurons, which are fully connected to the number of subcircuits and the features extracted for the overall matrix. The third part includes N2 neurons, which are fully connected to the features extracted for the subcircuits. The second hidden layer contains N3 neurons, which are fully connected to all neurons in the first hidden layer; Among them, N1, N2, and N3 are hyperparameters of the model architecture.
8. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 7, characterized in that: The activation function of all neurons in the machine learning model is the sigmoid() function, and the machine learning model training method is the back propagation algorithm.
9. The machine learning-based pruning method for circuit simulation partitioning technology according to claim 1, characterized in that: In step S05, the pruning threshold of the model prediction needs to be reduced to 0.9 to 1.0 times of the original value to prevent the model prediction failure from causing the pruning threshold to be too large, thereby causing the simulation accuracy to fail to meet user requirements.