A constrained optimization method, device, computer equipment and storage medium

By parsing compilation logs to obtain constraint conflict information and using linear programming algorithms to optimize the maximum satisfaction domain, the problems of low constraint conflict identification efficiency and excessive redundant test data in chip design are solved. This achieves efficient constraint optimization and accurate test case generation, thereby improving chip verification efficiency.

CN119294348BActive Publication Date: 2025-11-21SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411284980.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2025-11-21
Estimated Expiration
2044-09-13

AI Technical Summary

Technical Problem

Existing randomized constraint verification methods suffer from low efficiency in constraint conflict identification and excessive redundant test data in chip design. Furthermore, manual inspection is time-consuming and prone to errors.

Method used

By parsing the compilation logs to obtain constraint conflict information, a linear programming algorithm is used to optimize the maximum satisfaction domain of conflict variables, and an availability assessment mechanism is introduced to automatically adjust the constraint file to reduce redundant data.

Benefits of technology

It significantly improves the efficiency and accuracy of constraint conflict identification, optimizes the accuracy of test cases, and thus improves the efficiency of chip verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119294348B_ABST
    Figure CN119294348B_ABST
Patent Text Reader

Abstract

The application relates to a constraint optimization method, device, computer equipment and storage medium. The method comprises the following steps: obtaining a compilation log of a randomization constraint file; parsing the compilation log to obtain constraint conflict information, wherein the constraint conflict information comprises a conflict variable and a conflict constraint expression; performing conflict optimization calculation according to the constraint conflict information to obtain a maximum satisfaction domain of the conflict variable; performing availability evaluation on the maximum satisfaction domain; in response to the availability evaluation result being unavailable, iteratively performing the conflict optimization calculation to update the maximum satisfaction domain; and in response to the availability evaluation result being available, adjusting the value range of the conflict variable based on the maximum satisfaction domain to update the randomization constraint file. The method can identify and solve constraint conflicts, reduce the generation of redundant test data, optimize the accuracy of test cases, and improve the efficiency of chip verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of chip testing technology, and in particular to a constraint optimization method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Verification is an indispensable part of the chip design process, ensuring that the chip design meets predetermined functional requirements and performance specifications. As chip design complexity continues to increase, the verification process becomes increasingly time-consuming and complex. Currently, the industry widely adopts the Constrained Randomized Testing (CTR) method, which improves verification efficiency by randomly generating test cases. The CTR method introduces randomization constraints to limit the range of test case generation, ensuring that the generated test stimuli are more effective and can cover more boundary scenarios and potential problems.

[0003] However, the design and implementation of randomized constraints also face many challenges. On the one hand, improper constraint design can generate a large amount of redundant test data, reducing verification efficiency. On the other hand, when multiple constraints coexist, constraint conflicts may occur, leading to errors and interruptions during simulation. Furthermore, when constraint conflicts occur, the compiler reports an error, requiring manual inspection of the simulation log (log file) to locate and modify the constraints. This process is time-consuming and error-prone, especially when the constraint file is large, as manual inspection may not be able to fully cover all potential constraint conflicts. Summary of the Invention

[0004] Therefore, it is necessary to provide a constraint optimization method, apparatus, computer equipment, and storage medium that can identify and resolve constraint conflicts, reduce the generation of redundant test data, optimize the accuracy of test cases, and thus improve the efficiency of chip verification, in order to address the above-mentioned technical problems.

[0005] On the one hand, a constrained optimization method is provided, the method comprising:

[0006] Obtain the compilation log of the randomization constraint file;

[0007] Parse the compilation log to obtain constraint conflict information, wherein the constraint conflict information includes conflicting variables and conflicting constraint expressions;

[0008] Based on the constraint conflict information, conflict optimization calculations are performed to obtain the maximum satisfaction domain of the conflict variables;

[0009] Availability assessment is performed on the maximum satisfaction domain; in response to the availability assessment result being unavailable, the conflict optimization calculation is iteratively performed, and the maximum satisfaction domain is updated;

[0010] In response to the availability assessment result being available, the range of values ​​for the conflict variables is adjusted based on the maximum satisfaction domain, and the randomization constraint file is updated.

[0011] In one embodiment, the compilation log is parsed to obtain constraint information, including constraint conflict information, including:

[0012] The randomized constraint file is obtained by integrating several constraint variables and several constraint expressions into the same file.

[0013] The randomized constraint file is compiled using a compiler-based simulation tool to obtain the compilation log;

[0014] Write regular expressions to match error patterns related to constraint conflicts in the compilation log;

[0015] By traversing the compilation log and applying the regular expression, the constraint conflict information is obtained.

[0016] In one embodiment, conflict optimization calculation is performed based on the constraint conflict information to obtain the maximum satisfaction domain of the conflict variable, including:

[0017] Parse the constraint conflict information to generate an abstract syntax tree;

[0018] Traverse the abstract syntax tree and extract all node information, wherein the node information includes the name of the conflicting variable and the related constraints;

[0019] The node information is transformed into a linear programming problem and solved. The maximum and minimum values ​​of the conflict variables when all constraints are satisfied are found, and the maximum satisfaction domain is obtained.

[0020] In one embodiment, the node information is transformed into a linear programming problem and solved to find the maximum and minimum values ​​of the conflict variables when all constraints are satisfied, thus obtaining the maximum satisfaction domain, including:

[0021] Determine the target variable, which is the conflicting variable, denoted as x1, x2, ..., x. n ;

[0022] Determine the objective function, define the objective to be optimized, denoted as f(x), where, Where, x i c is the i-th target variable. i These are the optimization coefficients of the i-th objective variable, wherein the objective function includes at least one of the following: maximizing the objective function and minimizing the objective function; the maximizing objective function is denoted as Max(x), and the minimizing objective function is denoted as Min(x);

[0023] The conflict constraint expression is transformed into a linear inequality or a linear equation to obtain the linear programming constraint condition. The conflict constraint expression includes the conflicting variables and their corresponding coefficients. The linear programming constraint condition is denoted as AX≤B, where A is a coefficient matrix composed of variable coefficients, X is a variable vector composed of objective variables, and B is a constant vector composed of constraint constants.

[0024] By combining the objective function with the linear programming constraints, a standard linear programming model is constructed, wherein the linear programming model includes at least one of the following: a maximization model and a minimization model;

[0025] Choose a linear programming algorithm or tool to solve the constructed standard linear programming model and obtain the optimal solution;

[0026] Obtain the optimal solution of the standard linear programming model, wherein the optimal solution includes the value of the objective variable and the corresponding variable range;

[0027] Check and verify whether the optimal solution is available. When it is available, the range of variables in the optimal solution is the maximum satisfaction domain of the conflicting variables.

[0028] In one embodiment, the usability assessment of the maximum satisfaction domain includes:

[0029] Perform a constraint satisfaction evaluation, check whether the maximum satisfaction domain satisfies all constraints, and obtain the satisfaction evaluation result;

[0030] A scale appropriateness assessment is performed to check whether the size of the maximum satisfaction domain is too large, and the appropriateness assessment result is obtained.

[0031] Based on the satisfaction assessment results and the appropriateness assessment results, an availability assessment is performed; when the maximum satisfaction domain satisfies all constraints and its size is not too large, the assessment passes and the maximum satisfaction domain is considered usable.

[0032] In one embodiment, in response to the availability assessment result being unavailable, the conflict optimization calculation is performed iteratively, and the maximum satisfaction domain is updated, including:

[0033] Obtain the results of the usability assessment, wherein the results of the usability assessment include the satisfaction assessment results and the appropriateness assessment results;

[0034] When the satisfaction evaluation result is unsuccessful, the conflict optimization calculation is optimized for satisfaction, wherein the satisfaction optimization includes at least one of the following: re-parse the compilation log, regenerate and traverse the abstract syntax tree, and re-extract the node information;

[0035] When the suitability assessment result is unsatisfactory, the conflict optimization calculation is subjected to suitability optimization, wherein the suitability optimization includes at least one of the following: redetermining the objective function and readjusting the constraints;

[0036] Repeat the satisfaction optimization and the appropriateness optimization until both the satisfaction evaluation result and the appropriateness evaluation result are passed. Then, the maximum satisfaction domain generated at this time is considered to be usable, and the original maximum satisfaction domain is replaced to realize the update of the maximum satisfaction domain.

[0037] In one embodiment, in response to the availability assessment result being available, the range of values ​​for the conflict variable is adjusted based on the maximum satisfaction domain, and the randomization constraint file is updated, including:

[0038] Based on the maximum satisfaction domain, adjust the value range of the conflicting variable so that the value range of the conflicting variable is not greater than the range shown by the maximum satisfaction domain;

[0039] Based on the adjusted conflicting variables, generate corresponding new constraint expressions;

[0040] The conflict constraint expression is queried in the randomization constraint file, wherein the conflict constraint expression contains the conflict variable;

[0041] The conflict constraint expression is replaced with the new constraint expression to update the randomized constraint file.

[0042] On the other hand, a constraint optimization apparatus is provided, the apparatus comprising:

[0043] The log acquisition module is used to acquire the compilation logs of the randomization constraint file;

[0044] The log parsing module is used to parse the compilation log to obtain constraint conflict information, wherein the constraint conflict information includes conflict variables and conflict constraint expressions;

[0045] The conflict optimization module is used to perform conflict optimization calculations based on the constraint conflict information to obtain the maximum satisfaction domain of the conflict variables.

[0046] A usability assessment module is used to assess the usability of the maximum satisfaction domain; in response to the usability assessment result being unavailable, the conflict optimization calculation is performed iteratively, and the maximum satisfaction domain is updated.

[0047] The constraint file update module, in response to the availability assessment result being available, adjusts the value range of the conflict variable based on the maximum satisfaction domain and updates the randomized constraint file.

[0048] In another aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0049] Obtain the compilation log of the randomization constraint file;

[0050] Parse the compilation log to obtain constraint conflict information, wherein the constraint conflict information includes conflicting variables and conflicting constraint expressions;

[0051] Based on the constraint conflict information, conflict optimization calculations are performed to obtain the maximum satisfaction domain of the conflict variables;

[0052] Availability assessment is performed on the maximum satisfaction domain; in response to the availability assessment result being unavailable, the conflict optimization calculation is iteratively performed, and the maximum satisfaction domain is updated;

[0053] In response to the availability assessment result being available, the range of values ​​for the conflict variables is adjusted based on the maximum satisfaction domain, and the randomization constraint file is updated.

[0054] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0055] Obtain the compilation log of the randomization constraint file;

[0056] Parse the compilation log to obtain constraint conflict information, wherein the constraint conflict information includes conflicting variables and conflicting constraint expressions;

[0057] Based on the constraint conflict information, conflict optimization calculations are performed to obtain the maximum satisfaction domain of the conflict variables;

[0058] Availability assessment is performed on the maximum satisfaction domain; in response to the availability assessment result being unavailable, the conflict optimization calculation is iteratively performed, and the maximum satisfaction domain is updated;

[0059] In response to the availability assessment result being available, the range of values ​​for the conflict variables is adjusted based on the maximum satisfaction domain, and the randomization constraint file is updated.

[0060] The aforementioned constraint optimization method, apparatus, computer device, and storage medium significantly improve the efficiency and accuracy of constraint conflict identification by automatically extracting constraint conflict information from the compilation log, thus avoiding the tedious process of manually checking the log. Simultaneously, it utilizes a linear programming algorithm to optimize the extracted constraint conflict information, automatically identifying the maximum satisfaction domain of the conflict variables and achieving automatic resolution of constraint conflicts. Furthermore, it introduces a usability evaluation mechanism to iteratively optimize the derived maximum satisfaction domain, ensuring that the generated test cases satisfy all constraints while avoiding excessive size, thereby reducing the generation of redundant test data, optimizing the accuracy of test cases, and ultimately improving the efficiency of chip verification. Attached Figure Description

[0061] Figure 1 This is a diagram illustrating the application environment of a constraint optimization method in one embodiment.

[0062] Figure 2 This is a flowchart illustrating a constraint optimization method in one embodiment;

[0063] Figure 3 This is a structural block diagram of a constraint optimization device in one embodiment;

[0064] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0065] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0066] This application provides a constrained optimization method that can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. Terminal 102 sends a chip verification request and a randomized constraint file to server 104. Server 104 receives the chip verification request, optimizes the randomized constraint file, and then uses the optimized randomized constraint file for subsequent chip verification. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. Server 104 can be a standalone server or a server cluster consisting of multiple servers.

[0067] In one embodiment, such as Figure 2 As shown, a constrained optimization method is provided, which is applied to... Figure 1 Taking the terminal in the example, the explanation includes the following steps:

[0068] Step 201: Obtain the compilation log of the randomization constraint file.

[0069] Among them, the randomization constraint file is a compileable file, and the compilation log is the simulation log file generated during the compilation process.

[0070] Specifically, several constraint variables and several constraint expressions are integrated into the same file to obtain a randomized constraint file; the randomized constraint file is then compiled using a compiler-based simulation tool to obtain a compilation log.

[0071] Step 202: Parse the compilation log to obtain constraint conflict information, which includes conflicting variables and conflicting constraint expressions.

[0072] Specifically, constraint conflict information is obtained by traversing the compilation log based on regular expressions.

[0073] Step 203: Based on the constraint conflict information, perform conflict optimization calculations to obtain the maximum satisfaction domain of the conflict variables.

[0074] The maximum satisfaction domain is the range of values ​​that the conflicting variable can take when all constraints are satisfied.

[0075] Specifically, based on the abstract syntax tree, constraint conflict information is parsed to obtain node information, which includes the names of conflicting variables and related constraints. The node information is then transformed into a linear programming problem and solved to obtain the optimal solution, i.e., the maximum satisfaction domain.

[0076] Step 204: Perform availability assessment on the maximum satisfaction domain; if the availability assessment result is unavailable, iteratively perform conflict optimization calculation and update the maximum satisfaction domain.

[0077] Specifically, availability assessment includes constraint satisfaction assessment and size appropriateness assessment. If the maximum satisfaction domain satisfies all constraints and its size is not excessive, the assessment passes, and the maximum satisfaction domain is considered usable. Conversely, if it does not, it is considered unusable. Based on the availability assessment results, corresponding adjustments and optimizations are performed, iteratively calculating conflicts until the availability assessment result of the maximum satisfaction domain is deemed usable.

[0078] Step 205: In response to the availability assessment result being available, adjust the value range of the conflict variables based on the maximum satisfaction domain and update the randomization constraint file.

[0079] Specifically, based on the maximum satisfaction domain, the range of values ​​for conflicting variables is adjusted so that the range of values ​​for conflicting variables is no greater than the range of the maximum satisfaction domain; based on the adjusted conflicting variables, corresponding new constraint expressions are generated to replace the constraint expressions in the original randomization constraint file.

[0080] In the aforementioned constraint optimization method, constraint conflict information is automatically extracted from the compilation log, avoiding the tedious process of manually checking the log and significantly improving the efficiency and accuracy of constraint conflict identification. Simultaneously, a linear programming algorithm is used to optimize the extracted constraint conflict information, automatically finding the maximum satisfaction domain of the conflict variables and achieving automatic resolution of constraint conflicts. Furthermore, a usability evaluation mechanism is introduced to iteratively optimize the obtained maximum satisfaction domain, ensuring that the generated test cases satisfy all constraints while avoiding excessive size, thereby reducing the generation of redundant test data, optimizing the accuracy of test cases, and ultimately improving the efficiency of chip verification.

[0081] In one embodiment, the compilation log is parsed to obtain constraint information, including constraint conflict information, including:

[0082] By integrating several constraint variables and several constraint expressions into the same file, a randomized constraint file is obtained.

[0083] The randomized constraint file is compiled using a compile-based simulation tool to obtain the compilation log;

[0084] Write regular expressions to match error patterns related to constraint conflicts in the build log;

[0085] Traverse the compilation log and apply regular expressions to obtain constraint conflict information.

[0086] Specifically, this embodiment integrates constraint variables and expressions into the same file, which facilitates compilation, management, and maintenance, and achieves standardized management. At the same time, by matching constraint conflict information in the compilation log with regular expressions, problems can be quickly and accurately located, achieving efficient identification of constraint conflict information. In addition, by automating the identification of constraint conflict information, errors caused by human factors are reduced, and the reliability of conflict information identification is improved.

[0087] In one embodiment, conflict optimization calculations are performed based on constraint conflict information to obtain the maximum satisfaction domain of the conflict variables, including:

[0088] Parse constraint conflict information and generate an abstract syntax tree;

[0089] Traverse the abstract syntax tree and extract all node information, including the names of conflicting variables and related constraints.

[0090] The node information is transformed into a linear programming problem and solved. The maximum and minimum values ​​of the conflicting variables when all constraints are satisfied are found, and the maximum satisfaction domain is obtained.

[0091] Specifically, this embodiment analyzes constraint conflict information and generates an abstract syntax tree (AST), which accurately reflects the syntactic structure of the code, thereby gaining a deeper understanding of the relationships between constraints and providing a solid foundation for subsequent linear programming solutions. At the same time, by transforming complex constraint problems into standard linear programming problems and using mature linear programming algorithms for solving them, the optimal solution for all constraints can be found efficiently, which not only improves the solution efficiency but also ensures the accuracy and reliability of the solution results.

[0092] In one embodiment, the node information is transformed into a linear programming problem and solved to find the maximum and minimum values ​​of the conflict variables when all constraints are satisfied, thus obtaining the maximum satisfaction domain, including:

[0093] Define the target variables, where the target variables are conflict variables, denoted as x1, x2, ..., x. n ;

[0094] Determine the objective function, define the objective to be optimized, denoted as f(x), where, Where, x i c is the i-th target variable. i These are the optimization coefficients of the i-th objective variable, where the objective function includes at least one of the following: maximizing the objective function and minimizing the objective function; the maximizing objective function is denoted as Max(x), and the minimizing objective function is denoted as Min(x);

[0095] Transform the conflict constraint expression into a linear inequality or linear equation to obtain the linear programming constraint condition. The conflict constraint expression includes conflict variables and their corresponding variable coefficients. The linear programming constraint condition is denoted as AX≤B, where A is the coefficient matrix composed of variable coefficients, X is the variable vector composed of objective variables, and B is the constant vector composed of constraint constants.

[0096] By combining the objective function with linear programming constraints, a standard linear programming model is constructed. The linear programming model includes at least one of the following: a maximization model and a minimization model.

[0097] Choose a linear programming algorithm or tool to solve the constructed standard linear programming model and obtain the optimal solution. The linear programming algorithm should include at least one of the following: simplex method or interior point method. The linear programming tool should include at least one of the following: SciPy.optimize.linprog or CVXOPT.

[0098] Obtain the optimal solution of the standard linear programming model, where the optimal solution includes the value of the objective variable and the corresponding range of variables;

[0099] Check and verify whether the optimal solution is available. When it is available, the range of variables in the optimal solution is the maximum satisfaction domain of the conflicting variables.

[0100] Specifically, this embodiment achieves flexible modeling by supporting the setting of multiple objective functions and optimization coefficients, making the method more flexible to be applied to different verification needs; at the same time, by using a standard linear programming model and an efficient solution algorithm, the accuracy and reliability of the solution results can be ensured; furthermore, it supports different linear programming solution tools, which facilitates integration with existing verification environments and improves scalability.

[0101] In one embodiment, the availability assessment of the maximum satisfaction domain includes:

[0102] Perform a constraint satisfaction evaluation, check whether the maximum satisfaction domain satisfies all constraints, and obtain the satisfaction evaluation results;

[0103] Perform a size appropriateness assessment to check whether the size of the maximum satisfaction domain is too large, and obtain the appropriateness assessment results;

[0104] Based on the results of the satisfaction assessment and the appropriateness assessment, a usability assessment is conducted. If the maximum satisfaction domain satisfies all constraints and its size is not too large, the assessment is passed and the maximum satisfaction domain is considered usable.

[0105] It is worth noting that constraint satisfaction evaluation is performed to verify whether the obtained maximum satisfaction domain satisfies all constraints, including:

[0106] For each constraint, iterate through the data and check whether each point in the maximum satisfaction domain satisfies the constraint.

[0107] The maximum satisfaction domain is considered to satisfy all constraints if and only if any point in the maximum satisfaction domain satisfies the constraint under any given constraint, and the constraint satisfaction evaluation result is passed. Conversely, if there exists a constraint such that any point in the maximum satisfaction domain does not satisfy the constraint, the constraint satisfaction evaluation result is failed, the maximum satisfaction domain is unusable, and it needs to be re-optimized.

[0108] It is worth noting that a scalability assessment is performed to ensure that the maximum satisfaction domain is not too large, thus avoiding the generation of too many redundant test cases. This includes:

[0109] Based on the maximum satisfaction domain of each conflicting variable, the maximum associative domain is obtained, where the maximum associative domain is composed of the maximum satisfaction domains of all conflicting variables.

[0110] Calculate the volume of the largest binding domain based on the formula: in, and Let V represent the maximum and minimum values ​​in the maximum satisfaction domain of the i-th conflict variable, respectively. max The maximal associative domain is mathematically considered as the volume of a polyhedron in a multidimensional space;

[0111] Based on testing requirements and system resources, a threshold is set, denoted as V. threshold ;

[0112] Based on the appropriateness function, an appropriateness assessment is performed, where the appropriateness function is:

[0113]

[0114] G(V) max ) = 1 indicates that the maximum associative domain is moderate, G(V) max ) = 0 indicates that the maximum associative domain is too large;

[0115] When the maximum assimilation domain is moderate, it indicates that the maximum satisfaction domain of each conflicting variable is of moderate size, and the generated test case size is moderate; however, when the maximum assimilation domain is too large, it indicates that there are conflicting variables with excessively large maximum satisfaction domains, and optimization needs to be performed again.

[0116] Specifically, this embodiment comprehensively evaluates the maximum satisfaction domain from two aspects: constraint satisfaction and scale appropriateness. This ensures that the final generated test cases not only satisfy all constraints but also avoid excessive size, thereby reducing the generation of redundant test cases. This improves the efficiency of subsequent chip verification and enhances the quality and reliability of the verification process.

[0117] In one embodiment, in response to an availability assessment result of unavailability, conflict optimization calculations are iteratively performed, and the maximum satisfaction domain is updated, including:

[0118] Obtain the results of the usability assessment, which include the results of the satisfaction assessment and the results of the appropriateness assessment;

[0119] When the satisfaction evaluation result is unsatisfactory, the conflict optimization calculation is optimized for satisfaction. The satisfaction optimization includes at least one of the following: re-parse the compilation log, regenerate and traverse the abstract syntax tree, and re-extract node information.

[0120] When the suitability assessment result is unsatisfactory, the conflict optimization calculation is performed on the suitability optimization, which includes at least one of the following: redefining the objective function and readjusting the constraints;

[0121] Repeat the satisfaction optimization and adequacy optimization until both the satisfaction evaluation result and the adequacy evaluation result are passed. Then, the maximum satisfaction domain generated at this time is considered to be usable, and the original maximum satisfaction domain is replaced to realize the update of the maximum satisfaction domain.

[0122] Specifically, this embodiment can continuously adjust and improve the solution results through iterative optimization calculations, ensuring that the final generated solution is optimal and usable. At the same time, it can find the most suitable solution through multiple optimization calculations for different constraints and verification requirements, improving the availability of the maximum satisfaction domain and thus improving the efficiency of subsequent chip testing. In addition, it can avoid the repeated occurrence of the same constraint conflict problem during the compilation process, further improving work efficiency.

[0123] In one embodiment, in response to an availability assessment result indicating availability, the range of values ​​for conflict variables is adjusted based on the maximum satisfaction domain, and the randomized constraint file is updated, including:

[0124] Based on the maximum satisfaction domain, adjust the range of values ​​for conflicting variables so that the range of values ​​for conflicting variables is no greater than the range of the maximum satisfaction domain.

[0125] Based on the adjusted conflict variables, generate corresponding new constraint expressions;

[0126] Search for conflict constraint expressions in the randomization constraint file, where the conflict constraint expressions contain conflict variables;

[0127] The conflicting constraint expression is replaced with the new constraint expression to update the randomized constraint file.

[0128] Specifically, this embodiment adjusts the range of conflict variables in real time based on the availability assessment results, enabling rapid updates of the randomized constraint file, thereby reducing constraint conflict issues in subsequent verification processes and improving overall verification efficiency. In addition, it realizes a closed-loop verification process from problem identification to problem resolution, improving the systematicness and completeness of the verification process.

[0129] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0130] In one embodiment, such as Figure 3As shown, a constraint optimization device is provided, including: a log acquisition module, a log parsing module, a conflict optimization module, an availability assessment module, and a constraint file update module, wherein:

[0131] The log acquisition module is used to acquire the compilation logs of the randomization constraint file;

[0132] The log parsing module is used to parse the compilation log to obtain constraint conflict information, which includes conflicting variables and conflicting constraint expressions.

[0133] The conflict optimization module is used to perform conflict optimization calculations based on constraint conflict information to obtain the maximum satisfaction domain of conflict variables.

[0134] The availability assessment module is used to assess the availability of the maximum satisfaction domain; in response to the availability assessment result being unavailable, it iterative conflict optimization calculation is performed to update the maximum satisfaction domain;

[0135] The constraint file update module is used to update the randomized constraint file in response to an availability assessment result that the file is available, based on the maximum satisfaction domain, by adjusting the range of values ​​for conflict variables.

[0136] This log acquisition module is also used to integrate several constraint variables and several constraint expressions into the same file to obtain a randomized constraint file; the randomized constraint file is then compiled using a compile-based simulation tool to obtain a compilation log.

[0137] This log parsing module is also used to write regular expressions to match error patterns related to constraint conflicts in the compilation log; it iterates through the compilation log, applies regular expressions, and obtains constraint conflict information.

[0138] This conflict optimization module is also used to parse constraint conflict information, generate an abstract syntax tree; traverse the abstract syntax tree to extract all node information; transform the node information into a linear programming problem and solve it to find the maximum and minimum values ​​of the conflict variables when all constraints are satisfied, thus obtaining the maximum satisfaction domain.

[0139] This availability assessment module is also used to perform constraint satisfaction assessment, checking whether the maximum satisfaction domain satisfies all constraints and obtaining a satisfaction assessment result; to perform size appropriateness assessment, checking whether the size of the maximum satisfaction domain is too large and obtaining an appropriateness assessment result; and to perform availability assessment based on the satisfaction assessment result and the appropriateness assessment result; when the maximum satisfaction domain satisfies all constraints and its size is not too large, the assessment passes and the maximum satisfaction domain is considered available.

[0140] The usability assessment module is also used to obtain the usability assessment results, which include satisfaction assessment results and appropriateness assessment results. When the satisfaction assessment result is unsatisfactory, satisfaction optimization is performed on the conflict optimization calculation, which includes at least one of the following: re-parsing the compilation log, regenerating and traversing the abstract syntax tree, and re-extracting node information. When the appropriateness assessment result is unsatisfactory, appropriateness optimization is performed on the conflict optimization calculation, which includes at least one of the following: redefining the objective function and readjusting the constraints. The satisfaction optimization and appropriateness optimization are repeated until both the satisfaction assessment result and the appropriateness assessment result are satisfactory. At this point, the generated maximum satisfaction domain is considered usable, and the original maximum satisfaction domain is replaced, thus updating the maximum satisfaction domain.

[0141] The constraint file update module is also used to adjust the range of values ​​of conflicting variables according to the maximum satisfaction domain, so that the range of values ​​of conflicting variables is not greater than the range of the maximum satisfaction domain; generate corresponding new constraint expressions based on the adjusted conflicting variables; query the conflicting constraint expressions in the randomized constraint file, where the conflicting constraint expressions contain conflicting variables; and replace the conflicting constraint expressions with the new constraint expressions to realize the update of the randomized constraint file.

[0142] For specific limitations regarding a constraint optimization device, please refer to the limitations regarding a constraint optimization method above, which will not be repeated here. Each module in the aforementioned constraint optimization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0143] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores compilation log data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a constraint optimization method.

[0144] Those skilled in the art will understand that Figure 4The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0145] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0146] Obtain the compilation log of the randomization constraint file;

[0147] Parse the compilation log to obtain constraint conflict information, which includes conflicting variables and conflicting constraint expressions;

[0148] Based on the constraint conflict information, conflict optimization calculations are performed to obtain the maximum satisfaction domain of the conflict variables;

[0149] Perform availability assessment on the maximum satisfaction domain; if the availability assessment result is unavailable, iteratively perform conflict optimization calculation and update the maximum satisfaction domain;

[0150] In response to the availability assessment result being available, the range of values ​​for conflict variables is adjusted based on the maximum satisfaction domain, and the randomization constraint file is updated.

[0151] In one embodiment, when the processor executes the computer program, it further performs the following steps: parsing the compilation log to obtain constraint information and constraint conflict information, including:

[0152] By integrating several constraint variables and several constraint expressions into the same file, a randomized constraint file is obtained.

[0153] The randomized constraint file is compiled using a compile-based simulation tool to obtain the compilation log;

[0154] Write regular expressions to match error patterns related to constraint conflicts in the build log;

[0155] Traverse the compilation log and apply regular expressions to obtain constraint conflict information.

[0156] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0157] Parse constraint conflict information and generate an abstract syntax tree;

[0158] Traverse the abstract syntax tree and extract all node information, including the names of conflicting variables and related constraints.

[0159] Transform the node information into a linear programming problem and solve it to find the maximum and minimum values ​​of the conflicting variables when all constraints are satisfied, thus obtaining the maximum satisfaction domain.

[0160] This also includes:

[0161] Define the target variables, where the target variables are conflict variables, denoted as x1, x2, ..., x. n ;

[0162] Determine the objective function, define the objective to be optimized, denoted as f(x), where, Where, x i c is the i-th target variable. i These are the optimization coefficients of the i-th objective variable. The objective function includes at least one of the following: maximizing the objective function and minimizing the objective function. The maximizing objective function is denoted as Max(x), and the minimizing objective function is denoted as Min(x).

[0163] Transform the conflict constraint expression into a linear inequality or linear equation to obtain the linear programming constraint condition. The conflict constraint expression includes conflict variables and their corresponding variable coefficients. The linear programming constraint condition is denoted as AX≤B, where A is the coefficient matrix composed of variable coefficients, X is the variable vector composed of objective variables, and B is the constant vector composed of constraint constants.

[0164] By combining the objective function with linear programming constraints, a standard linear programming model is constructed. The linear programming model includes at least one of the following: a maximization model and a minimization model.

[0165] Choose a linear programming algorithm or tool to solve the constructed standard linear programming model and obtain the optimal solution. The linear programming algorithm should include at least one of the following: simplex method or interior point method. The linear programming tool should include at least one of the following: SciPy.optimize.linprog or CVXOPT.

[0166] Obtain the optimal solution of the standard linear programming model, where the optimal solution includes the value of the objective variable and the corresponding range of variables;

[0167] Check and verify whether the optimal solution is available. When it is available, the range of variables in the optimal solution is the maximum satisfaction domain of the conflicting variables.

[0168] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0169] Perform a constraint satisfaction evaluation, check whether the maximum satisfaction domain satisfies all constraints, and obtain the satisfaction evaluation result;

[0170] Perform a size appropriateness assessment to check whether the size of the maximum satisfaction domain is too large, and obtain the appropriateness assessment results;

[0171] Based on the results of the satisfaction assessment and the appropriateness assessment, a usability assessment is conducted. If the maximum satisfaction domain satisfies all constraints and its size is not too large, the assessment is passed and the maximum satisfaction domain is considered usable.

[0172] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0173] Obtain the results of the usability assessment, which include the results of the satisfaction assessment and the results of the appropriateness assessment;

[0174] When the satisfaction evaluation result is unsatisfactory, the conflict optimization calculation is optimized for satisfaction. The satisfaction optimization includes at least one of the following: re-parse the compilation log, regenerate and traverse the abstract syntax tree, and re-extract node information.

[0175] When the suitability assessment result is unsatisfactory, the conflict optimization calculation is performed on the suitability optimization, which includes at least one of the following: redefining the objective function and readjusting the constraints;

[0176] Repeat the satisfaction optimization and adequacy optimization until both the satisfaction evaluation result and the adequacy evaluation result are passed. Then, the maximum satisfaction domain generated at this time is considered to be usable, and the original maximum satisfaction domain is replaced to realize the update of the maximum satisfaction domain.

[0177] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0178] Based on the maximum satisfaction domain, adjust the range of values ​​for conflicting variables so that the range of values ​​for conflicting variables is no greater than the range of the maximum satisfaction domain.

[0179] Based on the adjusted conflict variables, generate corresponding new constraint expressions;

[0180] Search for conflict constraint expressions in the randomization constraint file, where the conflict constraint expressions contain conflict variables;

[0181] The conflicting constraint expression is replaced with the new constraint expression to update the randomized constraint file.

[0182] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0183] Obtain the compilation log of the randomization constraint file;

[0184] Parse the compilation log to obtain constraint conflict information, which includes conflicting variables and conflicting constraint expressions;

[0185] Based on the constraint conflict information, conflict optimization calculations are performed to obtain the maximum satisfaction domain of the conflict variables;

[0186] Perform availability assessment on the maximum satisfaction domain; if the availability assessment result is unavailable, iteratively perform conflict optimization calculation and update the maximum satisfaction domain;

[0187] In response to the availability assessment result being available, the range of values ​​for conflict variables is adjusted based on the maximum satisfaction domain, and the randomization constraint file is updated.

[0188] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0189] Parsing the compilation log reveals constraint information, including constraint conflict information, which includes:

[0190] By integrating several constraint variables and several constraint expressions into the same file, a randomized constraint file is obtained.

[0191] The randomized constraint file is compiled using a compile-based simulation tool to obtain the compilation log;

[0192] Write regular expressions to match error patterns related to constraint conflicts in the build log;

[0193] Traverse the compilation log and apply regular expressions to obtain constraint conflict information.

[0194] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0195] Parse constraint conflict information and generate an abstract syntax tree;

[0196] Traverse the abstract syntax tree and extract all node information, including the names of conflicting variables and related constraints.

[0197] Transform the node information into a linear programming problem and solve it to find the maximum and minimum values ​​of the conflicting variables when all constraints are satisfied, thus obtaining the maximum satisfaction domain.

[0198] This also includes:

[0199] Define the target variables, where the target variables are conflict variables, denoted as x1, x2, ..., x. n ;

[0200] Determine the objective function, define the objective to be optimized, denoted as f(x), where, Where, xi c is the i-th target variable. i These are the optimization coefficients of the i-th objective variable. The objective function includes at least one of the following: maximizing the objective function and minimizing the objective function. The maximizing objective function is denoted as Max(x), and the minimizing objective function is denoted as Min(x).

[0201] Transform the conflict constraint expression into a linear inequality or a linear equation to obtain the linear programming constraint conditions. The conflict constraint expression includes the conflicting variables and their corresponding coefficients.

[0202] In this context, the linear programming constraint is denoted as AX≤B, where A is the coefficient matrix composed of variable coefficients, X is the variable vector composed of objective variables, and B is the constant vector composed of constraint constants.

[0203] By combining the objective function with linear programming constraints, a standard linear programming model is constructed. The linear programming model includes at least one of the following: a maximization model and a minimization model.

[0204] Choose a linear programming algorithm or tool to solve the constructed standard linear programming model and obtain the optimal solution. The linear programming algorithm should include at least one of the following: simplex method or interior point method; the linear programming tool should include at least one of the following: SciPy.optimize.linprog or CVXOPT.

[0205] Obtain the optimal solution of the standard linear programming model, where the optimal solution includes the value of the objective variable and the corresponding range of variables;

[0206] Check and verify whether the optimal solution is available. When it is available, the range of variables in the optimal solution is the maximum satisfaction domain of the conflicting variables.

[0207] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0208] Perform a constraint satisfaction evaluation, check whether the maximum satisfaction domain satisfies all constraints, and obtain the satisfaction evaluation results;

[0209] Perform a size appropriateness assessment to check whether the size of the maximum satisfaction domain is too large, and obtain the appropriateness assessment results;

[0210] Based on the satisfaction assessment results and the appropriateness assessment results, a usability assessment is conducted. If the maximum satisfaction domain satisfies all constraints and its size is not too large, the assessment is passed and the maximum satisfaction domain is considered usable.

[0211] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0212] Obtain the results of the usability assessment, which include the results of the satisfaction assessment and the results of the appropriateness assessment;

[0213] When the satisfaction evaluation result is unsatisfactory, the conflict optimization calculation is optimized for satisfaction. The satisfaction optimization includes at least one of the following: re-parse the compilation log, regenerate and traverse the abstract syntax tree, and re-extract node information.

[0214] When the suitability assessment result is unsatisfactory, the conflict optimization calculation is performed on the suitability optimization, which includes at least one of the following: redefining the objective function and readjusting the constraints;

[0215] Repeat the satisfaction optimization and adequacy optimization until both the satisfaction evaluation result and the adequacy evaluation result are passed. Then, the maximum satisfaction domain generated at this time is considered to be usable, and the original maximum satisfaction domain is replaced to realize the update of the maximum satisfaction domain.

[0216] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0217] Based on the maximum satisfaction domain, adjust the range of values ​​for conflicting variables so that the range of values ​​for conflicting variables is no greater than the range of the maximum satisfaction domain.

[0218] Based on the adjusted conflict variables, generate corresponding new constraint expressions;

[0219] Search for conflict constraint expressions in the randomization constraint file, where the conflict constraint expressions contain conflict variables;

[0220] The conflicting constraint expression is replaced with the new constraint expression to update the randomized constraint file.

[0221] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0222] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0223] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A constrained optimization method, characterized in that, include: Obtain the compilation log of the randomization constraint file; Parse the compilation log to obtain constraint conflict information, wherein the constraint conflict information includes conflicting variables and conflicting constraint expressions; Based on the constraint conflict information, conflict optimization calculations are performed to obtain the maximum satisfaction domain of the conflict variables; Availability assessment is performed on the maximum satisfaction domain; in response to the availability assessment result being unavailable, the conflict optimization calculation is iteratively performed to update the maximum satisfaction domain, including: parsing the constraint conflict information and generating an abstract syntax tree; traversing the abstract syntax tree and extracting all node information, wherein the node information includes the name of the conflict variable and related constraints; transforming the node information into a linear programming problem and solving it; finding the maximum and minimum values ​​of the conflict variable when all constraints are satisfied, thereby obtaining the maximum satisfaction domain; wherein obtaining the maximum satisfaction domain further includes: determining the target variable, wherein the target variable is the conflict variable, denoted as x1, x2, ..., x n Determine the objective function, define the objective to be optimized, denoted as f(x), where, , where x i c is the i-th target variable. i The optimization coefficients of the i-th objective variable are given. The objective function includes at least one of the following: maximizing the objective function and minimizing the objective function, denoted as Max(x) and Min(x). The conflict constraint expression is transformed into a linear inequality or linear equation to obtain linear programming constraints. The conflict constraint expression includes the conflicting variables and their corresponding coefficients. The linear programming constraints are denoted as AX≤B, where A is a coefficient matrix composed of variable coefficients, X is a variable vector composed of objective variables, and B is a constant vector composed of constraint constants. The objective function is combined with the linear programming constraints to construct a standard linear programming model. A linear programming algorithm or tool is selected to solve the constructed standard linear programming model to obtain the optimal solution. The optimal solution of the standard linear programming model is obtained, where the optimal solution includes the value of the objective variable and its corresponding range. The availability of the optimal solution is checked and verified. When available, the range of variables in the optimal solution is the maximum satisfaction domain of the conflicting variables. In response to the availability assessment result being available, the range of values ​​for the conflict variables is adjusted based on the maximum satisfaction domain, and the randomization constraint file is updated.

2. The constrained optimization method according to claim 1, characterized in that, Parsing the compilation log yields constraint information and constraint conflict information, including: The randomized constraint file is obtained by integrating several constraint variables and several constraint expressions into the same file. The randomized constraint file is compiled using a compiler-based simulation tool to obtain the compilation log; Write regular expressions to match error patterns related to constraint conflicts in the compilation log; By traversing the compilation log and applying the regular expression, the constraint conflict information is obtained.

3. The constrained optimization method according to claim 1, characterized in that, Availability assessment of the maximum satisfaction domain includes: Perform a constraint satisfaction evaluation, check whether the maximum satisfaction domain satisfies all the constraints, and obtain the satisfaction evaluation result; A scale appropriateness assessment is performed to check whether the size of the maximum satisfaction domain is too large, and the appropriateness assessment result is obtained. Based on the satisfaction assessment results and the appropriateness assessment results, an availability assessment is performed; if the maximum satisfaction domain satisfies all the constraints and its size is not too large, the assessment is passed and the maximum satisfaction domain is considered usable.

4. The constrained optimization method according to claim 3, characterized in that, In response to the availability assessment result being unavailable, the conflict optimization calculation is performed iteratively, and the maximum satisfaction domain is updated, including: Obtain the results of the usability assessment, wherein the results of the usability assessment include the satisfaction assessment results and the appropriateness assessment results; When the satisfaction evaluation result is unsatisfactory, the conflict optimization calculation is optimized for satisfaction. When the appropriateness assessment result is unsatisfactory, the conflict optimization calculation is optimized for appropriateness. Repeat the satisfaction optimization and the appropriateness optimization until both the satisfaction evaluation result and the appropriateness evaluation result are passed. Then, the maximum satisfaction domain generated at this time is considered to be usable, and the original maximum satisfaction domain is replaced to realize the update of the maximum satisfaction domain.

5. The constrained optimization method according to claim 1, characterized in that: In response to the availability assessment result being available, based on the maximum satisfaction domain, the value range of the conflict variable is adjusted, and the randomization constraint file is updated, including: Based on the maximum satisfaction domain, adjust the value range of the conflicting variable so that the value range of the conflicting variable is not greater than the range shown by the maximum satisfaction domain; Based on the adjusted conflicting variables, generate corresponding new constraint expressions; The conflict constraint expression is queried in the randomization constraint file, wherein the conflict constraint expression contains the conflict variable; The conflict constraint expression is replaced with the new constraint expression to update the randomized constraint file.

6. A constrained optimization device, characterized in that, The apparatus is used to perform the constraint optimization method according to any one of claims 1-5, comprising: The log acquisition module is used to acquire the compilation logs of the randomization constraint file; The log parsing module is used to parse the compilation log to obtain constraint conflict information, wherein the constraint conflict information includes conflict variables and conflict constraint expressions; The conflict optimization module is used to perform conflict optimization calculations based on the constraint conflict information to obtain the maximum satisfaction domain of the conflict variables. A usability assessment module is used to assess the usability of the maximum satisfaction domain; in response to the usability assessment result being unavailable, the conflict optimization calculation is performed iteratively, and the maximum satisfaction domain is updated. The constraint file update module is used to update the randomized constraint file in response to the availability assessment result being available, based on the maximum satisfaction domain, by adjusting the value range of the conflict variable.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Digital chip layout wiring global optimization method and system

    CN116341480A

  • Method and system for optimizing an objective having discrete constraints

    US20210224351A1