A method, electronic device and storage medium for processing random constraint problems
By splitting and optimizing the random constraint problem, generating sub-problems of different types of variables, the problem of insufficient solution efficiency and precision in the existing technology is solved, and the ability to efficiently handle the random constraint problem of multiple types of variables is realized.
Patent Information
- Application Number
- CN202410571291.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-05-10
AI Technical Summary
The existing random constraint problem solver can only handle one variable in a single way and cannot effectively deal with the random constraint problem of multiple types of variables, resulting in insufficient solution efficiency and accuracy in complex chip verification environments.
By splitting the random constraint problem, sub-problems including different variables are obtained and then solved separately. The specific steps include obtaining a description of the random constraint problem, splitting the original constraint relationship into the first constraint relationship and the second constraint relationship, determining the solution priority of the integer variable in the first constraint relationship based on the second constraint relationship, and generating solutions of the first constraint relationship and the second constraint relationship.
This method simplifies the complexity of the random constraint problem, retains the characteristics of different types of variables, improves the efficiency and accuracy of the solution process, and can effectively deal with random constraint problems including multiple types of variables.
Smart Images

Figure CN118428312B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer software technology, and in particular to a method, an electronic device and a storage medium for processing random constraint problems. Background Art
[0002] In the field of integrated circuit verification, simulation can refer to compiling a logical system design and then running it using simulation tools to simulate and test various functions of the design. The design can be, for example, an application-specific integrated circuit (ASIC) or a system-on-chip (SOC). Therefore, the design tested or verified in simulation can also be called the design under test (DUT).
[0003] As the process of integrated circuits becomes more advanced, the design scale becomes more and more complex. The increase in scale and complexity makes functional verification a huge bottleneck in digital chip design. Random verification, as a fast and efficient verification method, is an indispensable and efficient verification method in processor core-level verification. The characteristics of random verification are: on the one hand, a large number of random test vectors can be quickly generated, reducing time and labor costs; on the other hand, since random stimuli are randomly generated, the combination of stimuli is more diverse, which will produce many unexpected results and may cover some defects that engineers cannot predict.
[0004] In verification, random excitations need to be generated under constraints to drive the design. Among them, the constraints can be continuously adjusted based on, for example, coverage. However, with the increasing complexity of chip functions, higher requirements are placed on the verification environment. More and more floating-point random constraint expressions appear in the verification environment, which places higher requirements on high-performance random constraint solvers. Currently, the widely used solvers for random constraint problems can only handle one type of variable, such as integer random constraint solvers or floating-point random constraint solvers. Summary of the invention
[0005] The first aspect of the present application provides a method for processing a random constraint problem, comprising: obtaining a description of the random constraint problem, the description comprising multiple variables and original constraint relationships between the multiple variables, the multiple variables comprising at least one integer variable and at least one floating-point variable; splitting the original constraint relationship to obtain a first constraint relationship and a second constraint relationship, the first constraint relationship comprising the at least one integer variable, the second constraint relationship comprising the at least one integer variable and the at least one floating-point variable; determining, according to the second constraint relationship, a solution priority for the at least one integer variable in the first constraint relationship; generating a solution to the first constraint relationship according to the solution priority; and generating a solution to the second constraint relationship according to the solution to the first constraint relationship.
[0006] A second aspect of the present application provides an electronic device, comprising: a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions so that the electronic device performs the method as described in the first aspect.
[0007] A third aspect of the present application provides a non-transitory computer-readable storage medium, which stores a set of instructions for a computer, and the set of instructions is used to cause the computer to perform the method as described in the first aspect when executed.
[0008] The present application provides a method for processing a random constraint problem, which is to split the random constraint problem into sub-problems including different variables and then solve them. In this way, the complexity of the random constraint problem is simplified, while the characteristics of different variables are guaranteed, making the solution process more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0010] Figure 1 A schematic structural diagram of an exemplary electronic device according to an embodiment of the present application is shown.
[0011] Figure 2 A schematic diagram of an exemplary simulation system according to an embodiment of the present application is shown.
[0012] Figure 3 A schematic diagram of an exemplary compiler according to an embodiment of the present application is shown.
[0013] Figure 4A schematic diagram of an exemplary random constraint problem according to an embodiment of the present application is shown.
[0014] Figure 5 A schematic diagram of an exemplary method for processing a random constraint problem according to an embodiment of the present application is shown.
[0015] Figure 6 A flowchart of an exemplary method for processing a random constraint problem according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0016] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0017] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in this application should be understood by people with ordinary skills in the field to which this application belongs. The words "first", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0018] In the chip verification model built for UVM, random constraints need to be used to generate incentives to verify the correctness of the chip design function. As the complexity of chip functions increases, higher requirements are placed on the verification environment. More and more floating-point random constraint expressions appear in the verification environment, which places higher requirements on high-performance random constraint solvers. Currently, the widely used solvers for random constraint problems can only handle a single variable, such as integer or floating-point variables.
[0019] The present application provides a method for processing random constraint problems, which splits the random constraint problems and then solves them separately, which not only retains the characteristics of different types of variables, but also solves the problems of difficult modeling and solving of multi-variable solvers, making the solution efficiency and accuracy of random constraint problems including multiple types of variables (for example, integer variables and floating-point variables) higher.
[0020] Figure 1 FIG. 1 is a schematic diagram showing the structure of an electronic device 100 according to an embodiment of the present application. The electronic device 100 may be an electronic device for running a simulation system. Figure 1As shown, the electronic device 100 may include: a processor 102, a memory 104, a network interface 106, a peripheral interface 108 and a bus 110. The processor 102, the memory 104, the network interface 106 and the peripheral interface 108 are connected to each other through the bus 110 in the electronic device.
[0021] Processor 102 may be a central processing unit (CPU), an image processor, a neural network processor (NPU), a microcontroller (MCU), a programmable logic device, a digital signal processor (DSP), an application specific integrated circuit (ASIC), or one or more integrated circuits. Processor 102 may be used to perform functions related to the technology described in this application. In some embodiments, processor 102 may also include multiple processors integrated into a single logical component. Figure 1 As shown, the processor 102 may include a plurality of processors 102a, 102b, and 102c.
[0022] The memory 104 may be configured to store data (eg, instruction sets, computer codes, intermediate data, etc.). In some embodiments, the simulation test system for simulation test design may be a computer program stored in the memory 104. Figure 1 As shown, the data stored in the memory may include program instructions (e.g., program instructions for implementing the random constraint problem of the present application) and data to be processed (e.g., the memory may store temporary codes generated during the compilation process). The processor 102 may also access the program instructions and data stored in the memory, and execute the program instructions to operate on the data to be processed. The memory 104 may include a volatile storage device or a non-volatile storage device. In some embodiments, the memory 104 may include a random access memory (RAM), a read-only memory (ROM), an optical disk, a magnetic disk, a hard disk, a solid-state drive (SSD), a flash memory, a memory stick, etc.
[0023] The network interface 106 can be configured to provide the electronic device 100 with communication with other external devices via a network. The network can be any wired or wireless network capable of transmitting and receiving data. For example, the network can be a wired network, a local wireless network (e.g., Bluetooth, WiFi, near field communication (NFC), etc.), a cellular network, the Internet, or a combination thereof. It is understood that the type of network is not limited to the above specific examples. In some embodiments, the network interface 106 can include any number of network interface controllers (NICs), radio frequency modules, transceivers, modems, routers, gateways, adapters, cellular network chips, etc., in any combination.
[0024] The peripheral interface 108 can be configured to connect the electronic device 100 to one or more peripheral devices to achieve information input and output. For example, the peripheral devices can include input devices such as a keyboard, a mouse, a touch pad, a touch screen, a microphone, and various sensors, and output devices such as a display, a speaker, a vibrator, and an indicator light.
[0025] The bus 110 may be configured to transmit information between various components of the electronic device 100 (e.g., the processor 102, the memory 104, the network interface 106, and the peripheral interface 108), such as an internal bus (e.g., a processor-memory bus), an external bus (USB port, PCI-E bus), etc.
[0026] It should be noted that, although the above electronic device architecture only shows the processor 102, the memory 104, the network interface 106, the peripheral interface 108 and the bus 110, in the specific implementation process, the electronic device architecture may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above electronic device architecture may also only include the components necessary for implementing the embodiment of the present application, and does not necessarily include all the components shown in the figure.
[0027] Figure 2 FIG. 2 is a schematic diagram of an exemplary simulation tool 200 according to an embodiment of the present disclosure. The simulation tool 200 may be a computer program running on the electronic device 100 .
[0028] In the field of chip design, a design can usually be simulated using a simulation tool, such as the GalaxSim simulation tool produced by Xinhuazhang Technology Co., Ltd. Figure 2 The exemplary simulation tool 200 shown may include a compiler 210 and a simulator 220. The compiler 210 may receive source code 204 (e.g., a hardware description language such as VHDL, Verilog, SystemVerilog, etc.) and compile it into an executable code 206 (e.g., machine code, assembly code, software code, etc.). It is understood that the description of the logic system design may be described in a hardware description language (HDL), a register transfer level (RTL) language, binary code, assembly code, or machine code, etc. The simulator 220 may perform simulation according to the executable code 206 and output the simulation result 208. For example, the simulation tool 200 may output the simulation result 208 via Figure 1 The peripheral interface 108 outputs the data to an output device (eg, displayed on a display).
[0029] Figure 3FIG. 2 is a schematic diagram of an exemplary compiler 210 according to an embodiment of the present application. Figure 3 As shown, compiler 210 may include a front end 212 , a middle end 214 , and a back end 216 .
[0030] The front end 212 may be used to analyze the lexical, grammatical, and semantic aspects of the source code according to a specific source language.
[0031] After the lexical, grammatical and semantic analysis of the source code is completed, the middle end 214 can convert the source code into an intermediate representation (or intermediate code) and can optimize the intermediate representation. The intermediate language (intermediate code) is a syntax-oriented, equivalent internal representation code of the source code that is easy to translate into the target program. Its comprehensibility and the degree of easy generation of execution code are between the source code and the execution code. Commonly used intermediate codes include reverse Polish notation, quadruple, ternary and tree representation. For example, the middle end 214 can remove useless code, remove inaccessible code, clear unused variables, etc. Optimization can include machine-related optimization and machine-independent optimization. Among them, machine-related optimization, for example, can be the optimization of the test platform (Testbench, TB), and some test platform characteristics can be used to help optimize. Machine-independent optimization, for example, can be the optimization of the design under test (Design Under Test, DUT). The optimized intermediate representation can be passed to the back end 126 for further processing.
[0032] The back end 216 can be configured based on the target processor (e.g., Figure 1 The intermediate representation is further optimized according to the architecture of the processor 102, and an execution code is generated. Usually, the execution code is a machine code.
[0033] It is understood that the structure of the compiler is not limited to Figure 3 For example, front end 212 and middle end 214 may be collectively referred to as a front end of a compiler.
[0034] The compiler 210 can generate an execution code based on the computer code to be compiled. The computer code to be compiled can also be called source code, such as a written logic system design. Usually, the source language for writing the source code is a high-level programming language. The high-level programming language can be the above-mentioned software programming language or hardware programming language. The execution code can be, for example, assembly code, machine code, etc. Usually, the compiler 210 can be stored in Figure 1 The compiler 210 is stored in the memory 104 shown in the figure and is executed by the processor 102 to compile the logic system design into execution code. The compiler 210 can convert the description of the logic system design from a high-level language description (e.g., HDL language) into a lower-level description (e.g., RTL language or binary code) so that the underlying hardware can run the logic system design.
[0035] As mentioned above, with the increasing complexity of chip functions, more and more floating-point random constraint expressions appear in the verification environment, which puts higher requirements on high-performance random constraint solvers. However, the currently widely used solvers for random constraint problems can only handle one type of variable, such as integer random constraint solvers or floating-point random constraint solvers.
[0036] In view of this, the present application proposes a method for processing random constraint problems, which can quickly process random constraint problems including at least two variables.
[0037] Figure 4 A schematic diagram of an exemplary random constraint problem according to an embodiment of the present application is shown.
[0038] The simulation tool 200 may obtain a description of a random constraint problem 400. The random constraint problem 400, hereinafter referred to as the problem 400, may include integer variables and floating point variables.
[0039] An example of a random constraint problem 400 is shown below.
[0040] int e=1; ......
[0041] rand int a;
[0042] rand int b;
[0043] rand real c;
[0044] rand int d;
[0045] rand real g;
[0046] rand real f;
[0047] b==1;
[0048] a+(b*4)+c+e<10;
[0049] a+ g>9;
[0050] a+b+d>20;
[0051] d+f<40;
[0052] In problem 400, integer variables may include, for example, int 401-402 (eg, int a, d), and floating point variables may include, for example, float 411-413 (eg, real c, g, f).
[0053] In some embodiments, problem 400 may also include constants or state variables, such as const 421 (eg, a random variable b that takes the value of 1). or state 422 (eg, a variable e that takes the value of 1).
[0054] It can be understood that the description of the random constraint problem 400 also includes the constraint relationship between the above-mentioned integer variables, floating-point variables, constants and state variables.
[0055] Generally, the currently widely used solvers include three categories. The first category is the solver that only solves integer random constraints (for example, RSat solver), which cannot solve floating-point random constraint problems. The second category is the solver that only solves floating-point random constraints (for example, Ibex solver), which cannot obtain integer solutions for integer random variables, and cannot handle integer-specific constraint expressions, such as bit operations and modulo operations. The third category is the random constraint solver that can handle both integer and floating-point types (for example, smt solver), which needs to take into account the implicit conversion between integer and floating-point types, and cannot take into account both the accuracy of the solution space of integer random variables and the characteristics of integer random constraint problems.
[0056] Therefore, how to take into account the characteristics of multiple variables and solve the random constraints that include both integer variables and floating-point variables is an urgent problem that needs to be solved.
[0057] Figure 5 A schematic diagram of an exemplary method for processing a random constraint problem according to an embodiment of the present application is shown.
[0058] In some embodiments, the random constraint problem 400 may include a constant const 421 (eg, a random variable b that takes the value of 1) and a state variable state 422 (eg, a variable e that takes the value of 1).
[0059] like Figure 5 As shown, according to the description of the random constraint problem 400, the simulation tool 200 can optimize the constant const 421 and the state variable state 422 in the original random constraint problem 400 to obtain a random constraint problem 500, hereinafter referred to as problem 500. Optimization includes constant optimization and inequality simplification. Constant optimization can be to replace constants and state variables with corresponding values. Inequality simplification can be to transform complex inequalities into a simple, easy-to-understand inequality through a series of basic operations. Figure 5 As shown, the process of optimizing problem 400 to problem 500 may include replacing the constant e with 1, replacing the state variable b with 1, and simplifying the inequality of problem 400.
[0060] An example of a random constraint problem 500 is shown below.
[0061] b==1;
[0062] e=1;
[0063] a+c<5;
[0064] a+g>9;
[0065] a+d>19;
[0066] d+f<40;
[0067] The simulation tool 200 can also determine the value ranges of the integer variables int 401-402 and the value ranges of the floating-point variables float 411-413 according to the description of the original random constraint problem 400. The value range is the value range of the variable. For example, in the above example problem 400, the value ranges of each variable are as follows.
[0068] aϵ[-2147483648,2147483648)];
[0069] b=1;
[0070] cϵ[-1.8E308,1.8E308];
[0071] dϵ[-2147483648,2147483648];
[0072] e=1;
[0073] fϵ[-2147483648,2147483648];
[0074] gϵ[-1.8E308,1.8E308];
[0075] Then, the simulation tool 200 may split the random constraint problem 500 into a first constraint relationship 510 and a second constraint relationship 520. For example, splitting the problem 500 may include dividing all constraint relationships including floating-point variables in the problem 500 into the second constraint relationship 520, and dividing the remaining constraint relationships not including floating-point variables into the first constraint relationship 510.
[0076] In some embodiments, Figure 5 As shown, the floating-point variables in the problem 500 include variables c, g, and f. The simulation tool 200 divides all expressions containing the above variables c, g, and f into the second constraint relationship 520. A specific example of the second constraint relationship 520 is given below.
[0077] a+c<5;
[0078] a+g>9;
[0079] d+f<40;
[0080] The second constraint relationship 520 may include at least one integer variable in the problem 500 , such as int401 , and all floating-point variables in the random constraint problem 500 , such as float 411 -float 413 .
[0081] All expressions except the second constraint relationship 520 in the problem 500 are classified into the first constraint relationship 510. A specific example of the first constraint relationship 510 is given below.
[0082] b==1;
[0083] e=1;
[0084] a+d>19;
[0085] Among them, the first constraint relationship 510 may include at least one integer variable in the above problem 500, such as int401-402. It can be understood that the constant "e=1" and the state variable "b==1" in the first constraint relationship 510 may not need to be processed by the subsequent integer random constraint solver, and the solutions of the constant and the state variable can be directly stored in the corresponding memory by the simulation tool 200. The embodiment shown in this application puts "b==1" and "e=1" in the first constraint relationship 510 only for the convenience of readers to understand.
[0086] The simulation tool 200 may determine the solving priority of at least one integer variable (eg, int 401 and int 402) in the first constraint relationship 510 according to the second constraint relationship 520. Generally, the integer variable with the largest number in the second constraint relationship may be set as the highest solving priority.
[0087] like Figure 5 As shown, the second constraint relationship 520 includes integer variables int 401 and int 402, but the number of int 401 and int 402 is different. Figure 5 It can be seen that in the second constraint relationship 520, the number of integer variables a is 2. In other words, the second constraint relationship 520 contains 2 integer variables a. However, in the second constraint relationship 520, the number of integer variables d is 1. Therefore, according to Figure 5 For the second constraint relationship 520 shown, the simulation tool may determine that the highest solution priority is the integer variable a.
[0088] The simulation tool 200 can generate a solution to the first constraint relationship 510 using an integer random constraint solver according to the highest solution priority, and generate a solution to the second constraint relationship 520 using a floating-point random constraint solver according to the solution to the first constraint relationship 510 .
[0089] In the above embodiment, the first constraint 510 has variable a as the highest priority for solving.
[0090] According to the above value range and solution priority, the simulation tool 200 can obtain the solution of the first constraint relationship 510 through the integer random constraint solver. For example, the solution of the first constraint relationship 510 can be:
[0091] a=1;
[0092] b=1;
[0093] d=20;
[0094] e=1;
[0095] It can be understood that the solution to the first constraint relationship 510 is not unique.
[0096] According to the solution of the first constraint relationship 510, the second constraint relationship 520 is solved using a floating-point random constraint solver. The solution of the second constraint relationship 520 may be:
[0097] a=1;
[0098] d=20;
[0099] c=3.14;
[0100] g=10.22;
[0101] f=3.33;
[0102] It can be understood that the solution to the second constraint relationship 520 is also not unique.
[0103] In summary, the solution of the original random constraint relationship 400 can be:
[0104] a=1;
[0105] b=1;
[0106] c=3.14;
[0107] d=20;
[0108] e=1;
[0109] g=10.22;
[0110] f=3.33;
[0111] It can be understood that the solution of the original random constraint relationship 400 is not unique.
[0112] It can be understood that the solution of the first constraint relationship 510 is a combination of integer variables that satisfy the first constraint relationship 510, and the solution of the second constraint relationship 520 is a combination of floating-point variables and integer variables that satisfy the second constraint relationship 520. And the combination of all the above variables is not unique and falls within the corresponding value range. The value range can be determined according to the original random constraint problem 400.
[0113] In some embodiments, if a set of solutions to the first constraint relationship cannot provide a solution to the second constraint relationship, the simulation tool may traverse all solutions to the first constraint relationship and attempt to solve the second constraint relationship.
[0114] In some other embodiments, therefore, the second constraint relationship may include a plurality of integer variables of the largest number and the same. Therefore, according to the second constraint relationship, the simulation tool 200 may determine at least two solution priorities, including a first solution priority and a second solution priority.
[0115] The simulation tool 200 may generate a solution to the first constraint relationship using an integer random constraint solver according to the first solution priority, and generate a solution to the second constraint relationship using a floating-point random constraint solver according to the solution to the first constraint relationship.
[0116] If the solution to the second constraint relationship cannot be finally obtained according to the first solution priority, the simulation tool can regenerate the solution to the first constraint relationship according to the second solution priority, and then generate the solution to the second constraint relationship according to the solution to the first constraint relationship.
[0117] The present application provides a method for processing a random constraint problem, which optimizes and splits the random constraint problem according to the types of variables contained in the random constraint problem to obtain multiple random constraint sub-problems. By using random constraint solvers with different types of variables, multiple random constraint sub-problems are solved separately, and the solution of the random constraint problem is obtained while retaining the characteristics of different variables.
[0118] Figure 6 FIG. 6 is a flowchart of an exemplary method 600 for processing a random constraint problem according to an embodiment of the present application. The method 600 may be Figure 1 The electronic device 100 shown is implemented, more specifically, by a compiler / simulation system (e.g., Figure 2 or Figure 3 Compiler 210 / Figure 2 The method 600 may include the following steps.
[0119] In step 601, the simulation tool 200 may obtain a description of the random constraint problem (eg, Figure 4400 in the description), the description includes a plurality of variables and original constraint relationships between the plurality of variables, the plurality of variables including at least one integer variable (eg, Figure 4 or variables a, d in 5) and at least one floating-point variable (e.g. Figure 4 or variables c, g, f in 5).
[0120] Wherein, the plurality of variables further includes at least one third variable (for example, Figure 6 The constant e and state variable b in the at least one third variable includes a constant or a state variable, and the method further includes: optimizing the third variable in the original constraint relationship according to the description.
[0121] In step 602, the simulation tool 200 may split the original constraint relationship to obtain a first constraint relationship (eg, Figure 5 510) and a second constraint relationship (eg, Figure 5 As described in 520), the first constraint relationship includes the at least one integer variable, and the second constraint relationship includes the at least one integer variable and the at least one floating-point variable.
[0122] Each of the first constraint relationships includes at least one of the at least one integer variable, and each of the second constraint relationships includes at least one of the at least one floating-point variable.
[0123] In step 603, the simulation tool 200 may determine the solution priority of the at least one integer variable in the first constraint relationship according to the second constraint relationship (for example, Figure 5 a is the highest solving priority).
[0124] Determining the solution priority of multiple variables in the first constraint relationship according to the second constraint relationship further includes: obtaining the number of the at least one integer variable included in the second constraint relationship; and in response to the target variable among the at least one integer variable having the largest number, setting the target variable to the highest solution priority.
[0125] The expression of the second constraint relationship includes at least two of the at least one integer variables of the largest and equal number, and the method further includes: setting at least the first of the at least one integer variable as the highest solution priority to obtain a first solution priority; or, setting at least the second of the at least one integer variable as the highest solution priority to obtain a second solution priority.
[0126] In step 604, the simulation tool 200 may generate a solution to the first constraint relationship according to the solution priority.
[0127] In step 605, the simulation tool 200 may generate a solution to the second constraint relationship according to the solution to the first constraint relationship.
[0128] The method further includes: determining a first value range of the at least one integer variable and a second value range of the at least one floating-point variable according to the original constraint relationship; generating a solution to the first constraint relationship according to the solution priority and the first value range; and generating a solution to the second constraint relationship according to the solution to the first constraint relationship and the second value range.
[0129] The solution priority includes a first solution priority and a second solution priority, and the method further includes: generating a first solution to the first constraint relationship according to the first solution priority; in response to the failure to generate a solution to the second constraint relationship according to the first solution to the first constraint relationship, replacing the first solution priority with the second solution priority; generating a second solution to the first constraint relationship according to the second solution priority; and generating a solution to the second constraint relationship according to the second solution to the first constraint relationship.
[0130] The solution to the first constraint relationship includes a combination of the at least one integer variable that satisfies the first constraint relationship, and the solution to the second constraint relationship includes a combination of the at least one integer variable and the at least one floating-point variable that satisfies the second constraint relationship.
[0131] The present application also provides an electronic device. The electronic device may be Figure 1 The electronic device 100 may include a memory for storing a set of instructions; and at least one processor configured to execute the set of instructions so that the electronic device performs the method 600.
[0132] The embodiment of the present application further provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores a set of computer instructions, and the set of instructions is used to enable the electronic device to perform method 600 when executed.
[0133] Some embodiments of the present application are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0134] A person skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the present application as described above, which are not provided in detail for the sake of simplicity.
[0135] Although the present application has been described in conjunction with specific embodiments of the present application, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the discussed embodiments.
[0136] This application is intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this application should be included in the scope of protection of this application.
Claims
1. A method for handling random constraint problems, applied to simulation tools, comprising: Obtaining a description of the random constraint problem in the chip verification model, the description comprising a plurality of variables and original constraint relationships between the plurality of variables, the plurality of variables comprising at least one integer variable and at least one floating-point variable; Splitting the original constraint relationship to obtain a first constraint relationship and a second constraint relationship, wherein the first constraint relationship includes the at least one integer variable, and the second constraint relationship includes the at least one integer variable and the at least one floating-point variable; Determining, according to the second constraint relationship, a solving priority of the at least one integer variable in the first constraint relationship; generating a solution to the first constraint relationship according to the solution priority; generating a solution to the second constraint relationship according to the solution to the first constraint relationship; as well as Generate a stimulus based on a solution of the first constraint relationship and a solution of the second constraint relationship to verify the chip design; The splitting of the original constraint relationship to obtain the first constraint relationship and the second constraint relationship includes: The constraint relation expressions including the floating-point variables in the original constraint relation are divided into the second constraint relation, and the constraint relation expressions not including the floating-point variables in the original constraint relation are divided into the first constraint relation.
2. The method of claim 1, wherein the plurality of variables further comprises at least one third variable, wherein the at least one third variable comprises a constant or a state variable, and the method further comprises: According to the description, the third variable in the original constraint relationship is optimized.
3. The method of claim 1, further comprising: Determine a first value range of the at least one integer variable and a second value range of the at least one floating-point variable according to the original constraint relationship; Generate a solution to the first constraint relationship according to the solution priority and the first value range; as well as A solution to the second constraint relationship is generated according to the solution to the first constraint relationship and the second value range.
4. The method of claim 1, wherein each of the first constraint relationships includes at least one of the at least one integer variable, and each of the second constraint relationships includes at least one of the at least one floating-point variable.
5. The method according to claim 1, further comprising: determining the solution priority of the plurality of variables in the first constraint relationship according to the second constraint relationship; Obtaining the number of the at least one integer variable included in the second constraint relationship; as well as In response to a target variable among the at least one integer variable having the largest number, the target variable is set to have the highest solving priority.
6. The method according to claim 1, wherein the solution priority comprises a first solution priority and a second solution priority, and the method further comprises: generating a first solution to the first constraint relationship according to the first solution priority; In response to the failure to generate a solution to the second constraint relationship according to the first solution to the first constraint relationship, replacing the first solution priority with the second solution priority; generating a second solution to the first constraint relationship according to the second solution priority; as well as A solution to the second constraint relationship is generated according to the second solution to the first constraint relationship.
7. The method according to claim 1 or 6, wherein the expression of the second constraint relationship includes at least two of the at least one integer variables of the largest number and the same number, and the method further comprises: Setting at least a first one of the at least one integer variable to a highest solution priority to obtain a first solution priority; Alternatively, at least a second one of the at least one integer variable is set as the highest solution priority to obtain a second solution priority.
8. The method of claim 1, wherein the solution to the first constraint relationship includes a combination of the at least one integer variable that satisfies the first constraint relationship, and the solution to the second constraint relationship includes a combination of the at least one integer variable and the at least one floating-point variable that satisfies the second constraint relationship.
9. An electronic device comprising a memory for storing a set of instructions; and At least one processor is configured to execute the set of instructions so that the electronic device performs the method according to any one of claims 1-8.
10. A non-transitory computer-readable storage medium storing a set of instructions for a computer, the set of instructions being used to cause the computer to perform the method according to any one of claims 1 to 8 when executed.
Citation Information
Patent Citations
Simulation method for logic system design, electronic equipment and storage medium
CN116911219A
Managing Floating Point Variables in Constraint Satisfaction Problems
US20100198901A1