CN112433931A - Floating point verification data generation method based on exponent constraint - Google Patents
Floating point verification data generation method based on exponent constraint Download PDFInfo
- Publication number
- CN112433931A CN112433931A CN201910789088.2A CN201910789088A CN112433931A CN 112433931 A CN112433931 A CN 112433931A CN 201910789088 A CN201910789088 A CN 201910789088A CN 112433931 A CN112433931 A CN 112433931A
- Authority
- CN
- China
- Prior art keywords
- floating point
- constraint
- exponent
- data
- constructing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3676—Test management for coverage analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/34—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
- G06F11/3409—Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/483—Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Computer Hardware Design (AREA)
- Computational Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Nonlinear Science (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention discloses a floating point verification data generation method based on exponent constraint, which comprises the following steps: s1, decomposing floating point data into sign bit sign, exponent part exponennt and mantissa part signed; s2, respectively constructing bit vector nodes corresponding to the sign bit, the exponent part and the mantissa part; s3, splicing the three bit vector nodes in the S2 into bit vector nodes with the length of 64 bits; s4, establishing equivalence relation constraint of the 64-bit vector and the double-precision floating point data obtained in the S3 on data storage; s5, constructing another floating-point operand of the floating-point operation; s6, constructing a constraint relation among indexes, S7, and constructing a synthetic CNF paradigm; and S8, taking the CNF paradigm obtained in S7 as input, solving by adopting a third-party solver, and S9, analyzing the solved result in S8 to form a group of floating point verification tuple data. The method solves the problem that the verification personnel can not restrain the exponent of the floating point operation due to the complexity of the constraint modeling among the operands in the floating point operation, and improves the coverage rate and the test efficiency of the floating point test.
Description
Technical Field
The invention relates to a floating point verification data generation method based on exponential constraint, and belongs to the technical field of computers.
Background
At present, technologies based on chip verification have been developed, a core technology in a large number of technologies is generation of a test program, and generation of test verification data is an important component of generation of the test program. The difference between the representation method of floating point data and the real world and the huge data space are important in the test and verification of the correctness of the floating point functional unit, and the floating point data becomes one of the determining factors of the quality of the floating point test program. Floating point data generation methods are various, but each data generation method has limitations and cannot cover all situations, and therefore development space is reserved for generation of test data.
In the process of verifying the correctness of the floating point operation unit, it is often necessary to test the condition that specific conditions are met between input data and output data for more comprehensive coverage of a data space, for example, the condition that an exponent of the output data and an exponent of the input data have a certain relationship. The floating point test data generation tool commonly used in the implementation of the verification scenario is difficult to construct, which will prevent the normal development of such test verification.
At present, in the process of verifying and testing the floating point operation function of a processor, the used floating point data usually focuses on the structural composition of the floating point data, mainly focuses on special data, boundary data and random verification data generated by a data dividing mode, and has less attention on the relationship among operands of a floating point operation. As is well known, the absolute value of floating-point data is determined by the exponent portion, and thus the relationship between floating-point operands is mainly focused on the exponent relationship between the operands. The process is very complex and not intuitive enough for general testers, and no mature method exists at present for completely covering the space of source operands and destination operands of various exponential relationships.
Disclosure of Invention
The invention aims to provide a floating point verification data generation method based on exponent constraint, which solves the problem that verifiers cannot constrain exponents of floating point operation due to the complexity of constraint modeling among operands in floating point operation, and improves the coverage rate and the test efficiency of floating point test.
In order to achieve the purpose, the invention adopts the technical scheme that: a floating point verification data generation method based on exponent constraint includes the following steps:
s1, decomposing floating point data into a sign bit sign, an exponent part exponennt and a mantissa part signed;
s2, respectively constructing bit vector nodes corresponding to a sign bit (1 bit), an exponent part (11 bits) and a mantissa part (52 bits);
s3, splicing the three bit vector nodes in the S2 into bit vector nodes with the length of 64 bits;
s4, establishing equivalence relation constraint of the 64-bit vector obtained in the S3 and double-precision floating point data on data storage, namely enabling the data obtained by node splicing in the S2 to be equivalent to the floating point data in the S1;
s5, constructing another floating point operand of the floating point operation according to the three steps of S2, S3 and S4, and establishing equivalence relation constraint of the floating point operand and the floating point data on data storage;
s6, constructing a constraint relation between exponents according to bit vector nodes corresponding to exponents of two floating point operands to obtain a constraint set clause, wherein if the constraint is an exponent constraint between input operations, the constraint is in the form of: x.exp = y.exp + diff, i.e. the exponent value of the input floating point number x differs from the exponent value of the input floating point number y by diff, which if an exponent constraint of the input and output operands is like: res.exp = max { x.exp, y.exp } + diff, i.e., the exponent value of the result operand differs from the maximum value of the input operand exponent by diff;
s7, constructing a synthetic CNF paradigm according to the constraint set clauses;
s8, taking the CNF paradigm obtained in S7 as input, adopting a third-party solver to solve, outputting a solving result if constraint is satisfied, otherwise, outputting the solving result if constraint is not satisfied;
and S9, analyzing the solution result in the S8 to form a group of floating point verification metadata.
The further improved scheme in the technical scheme is as follows:
1. in the above scheme, the third-party solver is a CVC4 solver or a Z3 solver.
Due to the application of the technical scheme, compared with the prior art, the invention has the following advantages:
the invention provides a floating point verification data generation method based on exponent constraint, and provides a universal modeling method, which is used for performing constraint modeling on exponents among all operands of a floating point, providing a data generation platform for specifying exponent constraint for testers, generating test data with exponent relations covering comprehensively, avoiding the problem of incomplete test coverage, greatly reducing the requirements on the testers, improving the quality of testing a floating point functional unit, solving the problem that the verifiers cannot constrain the exponents of the floating point operation due to the complexity of constraint modeling among all the operands of the floating point operation, and improving the coverage rate and the test efficiency of the floating point test.
Drawings
FIG. 1 is a flow diagram illustrating a floating point verification data generation method based on exponent constraint according to the present invention;
FIG. 2 is a flow chart of a floating point verification data generation method based on exponent constraint according to the present invention.
Detailed Description
Example (b): a floating point verification data generation method based on exponent constraint includes the following steps:
s1, decomposing floating point data into a sign bit sign, an exponent part exponennt and a mantissa part signed;
s2, respectively constructing bit vector nodes corresponding to a sign bit (1 bit), an exponent part (11 bits) and a mantissa part (52 bits);
s3, splicing the three bit vector nodes in the S2 into bit vector nodes with the length of 64 bits;
s4, establishing equivalence relation constraint of the 64-bit vector obtained in the S3 and double-precision floating point data on data storage, namely enabling the data obtained by node splicing in the S2 to be equivalent to the floating point data in the S1;
s5, constructing another floating point operand of the floating point operation according to the three steps of S2, S3 and S4, and establishing equivalence relation constraint of the floating point operand and the floating point data on data storage;
s6, constructing a constraint relation between exponents according to bit vector nodes corresponding to exponents of two floating point operands to obtain a constraint set clause, wherein if the constraint is an exponent constraint between input operations, the constraint is in the form of: x.exp = y.exp + diff, i.e. the exponent value of the input floating point number x differs from the exponent value of the input floating point number y by diff, which if an exponent constraint of the input and output operands is like: res.exp = max { x.exp, y.exp } + diff, i.e., the exponent value of the result operand differs from the maximum value of the input operand exponent by diff;
s7, constructing a synthetic CNF paradigm according to the constraint set clauses;
s8, taking the CNF paradigm obtained in S7 as input, adopting a third-party solver to solve, outputting a solving result if constraint is satisfied, otherwise, outputting the solving result if constraint is not satisfied;
and S9, analyzing the solution result in the S8 to form a group of floating point verification metadata.
The third-party solver is a CVC4 solver.
The examples are further explained below:
according to the composition characteristics of floating point data, a floating point operation exponent relation constraint model is extracted and provided, and floating point verification tuple data with exponent operand constraints of specified characteristics are generated by combining a third party mature solver.
In general, floating point data is considered as a whole in the operation process, and direct modeling description is inconvenient if the constraint needs to be separately applied to the exponent part of a floating point. Through research and analysis, the floating-point data can be decomposed into three parts, namely sign bit sign, exponent part exponent and mantissa part signed.
Variables are respectively constructed according to the three parts, then the three parts are spliced, and then the three parts are converted into floating point data. Therefore, the exponent exponents among the operands can be constrained, and the constraint solving among the floating point data exponents is indirectly realized.
The exponent constraint of floating point data can be largely divided into two cases:
(1) constraint relationship between input operand exponents: x.exp = y.exp + diff
(2) Constraint relationship between output operand exponent and input operand exponent: res.exp = max { x.exp, y.exp } + diff
Taking double-precision floating point (double) type addition as an example, the realization algorithm of the solution modeling of the corresponding exponential constraint is as follows:
the first step is as follows: respectively constructing bit vector nodes corresponding to a symbol (1 bit), an exponent (11 bit) and a mantissa (52 bit);
the second step is that: splicing the three nodes into bit vector nodes with the length of 64 bits;
the third step: establishing equivalence relation constraint of 64-bit vectors and double-precision floating point data on data storage;
the fourth step: constructing another floating point operand of the floating point addition according to the three steps, and establishing equivalence relation constraint of the another floating point operand on the data storage of the 64-bit vector and the floating point data;
the fifth step: according to the bit vector nodes corresponding to the exponents of the two floating point operands, constructing a constraint relation between the exponents:
if it is an exponential constraint between input operations then it is like: x.exp = y.exp + diff;
if the exponent constraint of the input and output operands is like: res.exp = max { x.exp, y.exp } + diff;
and a sixth step: constructing a synthetic CNF paradigm according to the constraint set clauses;
the seventh step: taking the CNF paradigm obtained in the fifth step as input, solving by adopting a third-party solver, and outputting a solving result if the constraint is met; otherwise, the output is not satisfied;
eighth step: and analyzing according to the solving result of the seventh step to form a group of floating point verification tuple data.
When the floating point verification data generation method based on the exponent constraint is adopted, a universal modeling method is provided, the exponent between each operand of the floating point is subjected to constraint modeling, a data generation platform with appointed exponent constraint is provided for testers, test data with comprehensive exponent relation coverage are generated, the problem of incomplete test coverage is avoided, the requirement on the testers is reduced to a great extent, the quality of testing the floating point functional unit is improved, the problem that the verifiers cannot constrain the exponent of the floating point operation due to the complexity of constraint modeling between the operands in the floating point operation is solved, and the coverage rate and the test efficiency of the floating point test are improved.
To facilitate a better understanding of the invention, the terms used herein will be briefly explained as follows:
floating point verification tuple data: i.e. a set of arrays containing floating point operations, rounding modes, input data, output results, etc., from which a tester can directly verify the correctness of the processor's floating point functions.
CNF paradigm: the conjunctive normal form is a standard form in propositional formulas. In this patent, we describe all constraints in the form of a convergent normal form, which is used for the solver to generate a solution result satisfying the condition.
The above embodiments are merely illustrative of the technical ideas and features of the present invention, and the purpose thereof is to enable those skilled in the art to understand the contents of the present invention and implement the present invention, and not to limit the protection scope of the present invention. All equivalent changes and modifications made according to the spirit of the present invention should be covered within the protection scope of the present invention.
Claims (2)
1. A floating point verification data generation method based on exponent constraint is characterized in that: the method comprises the following steps:
s1, decomposing floating point data into a sign bit sign, an exponent part exponennt and a mantissa part signed;
s2, respectively constructing bit vector nodes corresponding to a sign bit (1 bit), an exponent part (11 bits) and a mantissa part (52 bits);
s3, splicing the three bit vector nodes in the S2 into bit vector nodes with the length of 64 bits;
s4, establishing equivalence relation constraint of the 64-bit vector obtained in the S3 and double-precision floating point data on data storage, namely enabling the data obtained by node splicing in the S2 to be equivalent to the floating point data in the S1;
s5, constructing another floating point operand of the floating point operation according to the three steps of S2, S3 and S4, and establishing equivalence relation constraint of the floating point operand and the floating point data on data storage;
s6, constructing a constraint relation between exponents according to bit vector nodes corresponding to exponents of two floating point operands to obtain a constraint set clause, wherein if the constraint is an exponent constraint between input operations, the constraint is in the form of: x.exp = y.exp + diff, i.e. the exponent value of the input floating point number x differs from the exponent value of the input floating point number y by diff, which if an exponent constraint of the input and output operands is like: res.exp = max { x.exp, y.exp } + diff, i.e., the exponent value of the result operand differs from the maximum value of the input operand exponent by diff;
s7, constructing a synthetic CNF paradigm according to the constraint set clauses;
s8, taking the CNF paradigm obtained in S7 as input, adopting a third-party solver to solve, outputting a solving result if constraint is satisfied, otherwise, outputting the solving result if constraint is not satisfied;
and S9, analyzing the solution result in the S8 to form a group of floating point verification metadata.
2. The exponent constraint-based floating point verification data generation method of claim 1, wherein: the third-party solver is a CVC4 solver or a Z3 solver.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910789088.2A CN112433931A (en) | 2019-08-26 | 2019-08-26 | Floating point verification data generation method based on exponent constraint |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910789088.2A CN112433931A (en) | 2019-08-26 | 2019-08-26 | Floating point verification data generation method based on exponent constraint |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112433931A true CN112433931A (en) | 2021-03-02 |
Family
ID=74689794
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910789088.2A Withdrawn CN112433931A (en) | 2019-08-26 | 2019-08-26 | Floating point verification data generation method based on exponent constraint |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112433931A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114462350A (en) * | 2021-12-21 | 2022-05-10 | 北京百度网讯科技有限公司 | Integrated circuit chip verification method and device, electronic equipment and storage medium |
CN116070474A (en) * | 2023-04-07 | 2023-05-05 | 之江实验室 | Verification excitation generation method for AI floating point fusion operation unit |
-
2019
- 2019-08-26 CN CN201910789088.2A patent/CN112433931A/en not_active Withdrawn
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114462350A (en) * | 2021-12-21 | 2022-05-10 | 北京百度网讯科技有限公司 | Integrated circuit chip verification method and device, electronic equipment and storage medium |
CN114462350B (en) * | 2021-12-21 | 2022-11-15 | 北京百度网讯科技有限公司 | Integrated circuit chip verification method and device, electronic equipment and storage medium |
CN116070474A (en) * | 2023-04-07 | 2023-05-05 | 之江实验室 | Verification excitation generation method for AI floating point fusion operation unit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1706833B1 (en) | System and method for modeling, abstraction, and analysis of software | |
Jackson et al. | Clause form conversions for boolean circuits | |
US20100293530A1 (en) | Systems and methods for model checking the precision of programs employing floating-point operations | |
Soeken et al. | Encoding OCL data types for SAT-based verification of UML/OCL models | |
EP3208716A1 (en) | System and method for coverage-based automated test case augmentation for design models | |
Selvakkumaran et al. | Review of the use of system dynamics (SD) in scrutinizing local energy transitions | |
McAreavey et al. | Computational approaches to finding and measuring inconsistency in arbitrary knowledge bases | |
US10515169B1 (en) | System, method, and computer program product for computing formal coverage data compatible with dynamic verification | |
CN112433931A (en) | Floating point verification data generation method based on exponent constraint | |
Anastasakis et al. | A practical and efficient method for compare-point matching | |
Meng et al. | Components as coalgebras: The refinement dimension | |
CN113609008A (en) | Test result analysis method and device and electronic equipment | |
Leung et al. | Scalable semantic annotation using lattice-based ontologies | |
Abraham et al. | Type inference for spreadsheets | |
Malhotra et al. | Analyzing and evaluating security features in software requirements | |
Gebser et al. | Tableau calculi for logic programs under answer set semantics | |
CN118151998A (en) | Code annotation quality determining method, device, equipment and readable storage medium | |
US10073813B2 (en) | Generating a mixed integer linear programming matrix from an annotated entity-relationship data model and a symbolic matrix | |
Yang et al. | A rule‐based subset generation method for product data models | |
Michopoulos et al. | Bottom-up hierarchical and categorical metacomputing for automating composition and deployment of directly computable multiphysics models | |
CN107391872A (en) | The method and device that PDMS threedimensional models use in software | |
CN112433904A (en) | Floating point verification data generation method based on intermediate result constraint | |
Cabot et al. | UML/OCL verification in practice | |
Ciesielski et al. | Arithmetic bit-level verification using network flow model | |
Liu et al. | Automatic transformation from formal specifications to functional scenario forms for automatic test case generation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20210302 |