The circuit design verification and the error diagnosis method that comprise black box
Technical field
The present invention relates to the design verification and the error diagnosis technical field of very lagre scale integrated circuit (VLSIC), proposed a kind of circuit design verification and error diagnosis method that effectively comprises black box.This method is used for verifying the circuit design that comprises black box in conjunction with logic simulation and boolean's satisfiability algorithm, and its computational complexity is low more than traditional algorithm, and has stronger error detection capability, can further strengthen designer's confidence.This method can also directly apply to the accuracy that improves error diagnosis.
Background technology
Along with the increase day by day of VLSI (very large scale integrated circuit) designs functional complexity, become more and more popular based on the method for designing of IP (intellectual property).Because it is protection of Intellectual Property Rights, unknown often from third-party its internal structure of IP module or function.In addition, during the design, certain module function or its inner specific implementation the unknown are often arranged.Such as, the different piece of a design or module may be finished stage by stage by different designers, and for specific designer, in certain stage before whole design is finished, the function of certain module is unknown.For stage in early days guarantees the function correctness of design often to need this circuit that comprises unknown modules of checking, at this moment can handle the module of this unknown as black box.The verification method that contains black box is also often used in the design verification of stratification, for example, we can verify at first that standard is that function is consistent with the corresponding submodule of design, the module of having verified then is set to black box, verify the function correctness of top-level module again, thereby improve the efficient and the disposal ability of verification tool.In addition, this method can extract the part of some the difficult checking in the design, as memory module, makes checking to finish smoothly under limited internal memory condition; The black box verification method can also improve the accuracy of design mistake diagnosis, helps very much the debugging that designs.For example, if the error diagnosis instrument has provided the hypothesis about zone errors, black box can be inserted in this zone, be that function is correct if the outside of black box is verified, the hypothesis of these zone errors is correct so, not exclusively is included in the zone of hypothesis otherwise explanation is wrong.
The method that checking at present contains the black box design mainly is divided into two classes.First kind method uses y-bend decision diagram (BDD) as basic data structure, and depends on symbolic simulation.These class methods are calculated the characteristic function of realization by the original input of black box output as realization, contain thereby can make function about black box.For the design that contains black box, the calculated characteristics function can extract function as much as possible, but because when using BDD representation feature function, it supports variable and not only comprises original input, also comprises original output.Therefore the space complexity of these class methods is very high, might cause the internal memory blast, so be unsuitable for verifying bigger circuit.Second class methods are the boolean's satisfiability problems that contain unknown constraint by solution, and need to revise circuit structure.This class methods use two 0,1, X encodes and represents to be subjected to the circuit node of unknown effect of constraint value, causes duplicating of circuit signal, makes SAT formula scale become big easily.Therefore time complexity is higher, but can handle bigger circuit.
The present invention proposes a kind of black box verification method, do not need to revise circuit structure, also can not cause duplicating of circuit signal in conjunction with logic simulation and SAT.This method has mainly absorbed the thought of following document:
“Testing,Verification,and?Diagnosis?in?the?Presence?ofUnknowns,”A.Jain,V.Boppana,R.Mukherjee,J.Jain,M.Fujita,and?M.Hsiao,In?proceedings?of?18
th?VLSI?Test?Symposium,pp.263~269,2000.
“Verification?of?Designs?Containing?Black?Boxes,”WolfgangGunther,Nicole?Drechsler,Rolf?Drechsler?and?Bernd?Becker,Inproceedings?of?IEE?EUROMICRO?Conference,100~105,2000.
“Modeling?the?Unknown!Towards?Model-Independent?Fault?andError?Diagnosis,”V.Boppana?and?M.Fujita,In?Proceedings?ofInternational?Test?Conference,pp.1094-1101,1998.
Because the limitation of BDD algorithm inherence is unsuitable for verifying large-scale design.The method that the present invention proposes is based on the algorithm that logic simulation combines with SAT, at first use the test vector of stuck-at fault to contain the logic simulation of X value, detect mistake as much as possible, use the function correctness that contains the black box design based on SAT boolean comparatively validate then.Compare with two traditional class methods, this method has been saved a large amount of memory costs, and has improved arithmetic speed, and experiment shows that for the reference circuit of most of current international practices, this method is than fast 1 to 2 order of magnitude of aforesaid two class methods.In addition, this method can also directly apply to the accuracy that improves the design mistake diagnosis, and realizes simple.Along with the increase of integrated circuit (IC) design functional complexity, IP based design and stratification verification method increased popularity are carried out error diagnosis in early days in design and can greatly be saved cost.Therefore the method for the present invention's proposition has broad application prospects.
Summary of the invention
The present invention proposes a kind of circuit design verification and error diagnosis method that comprises black box.The prerequisite of method is to have one-to-one relationship respectively between known specifications and original input that realizes circuit and the original output.This method is at first made Parallel Simulation with the realization circuit that the stuck-at fault test vector set pair of standard circuit contains black box, to detect design mistake as much as possible.Use then based on the algorithm of satisfiability standard and realization are done to contain the unknown boolean who retrains relatively (Boolean comparison).In order to illustrate our method, introduce basic concepts earlier.Satisfiability problem (SAT) is meant and finds a variable assignments to make that given Boolean function is satiable, or proves that such assignment does not exist.In order to solve conveniently, the SAT problem is usually used conjunctive normal form (CNF) formula.The set that the CNF formula is made up of some clauses, each clause in the set is extracting by some variablees or their negative (being called literal) formation.The CNF formula of logical circuit is the set that the CNF formula of each constitutes, and the CNF formula of each is easy to derive.As one and a door a=bc, can be expressed as
It comprises three clauses.Black box is meant certain functional module in the circuit, its inner realization or Unknown Function.The design that checking contains black box refers to the realization of black box outside in the checking design, and whether function is correct.The main thought of method that the present invention proposes is based on following theorem:
A given circuit design and a corresponding design specifications that contains black box, if have an input vector and an original output, feasible institute for black box might realize that the response of standard and realization is respectively 0 (1) and 1 (0), and necessarily there is design mistake in the outside of black box in the design so.
In order to represent all possible realization of black box, can use the X value to represent the output of all black boxs.If certain vector is changed under the situation of X value in black box output, there is certain original output, make standard and the response that contains the design of black box be respectively 0 (1) and 1 (0), so the mistake of the black box perimeter of this vector detection in design.Fig. 1 has reflected the thought of above-mentioned theorem, and under identical vector effect, the response of standard and realization is respectively 0 and 1, so realize that the black box of circuit is outside wrong certainly.Note,, can not illustrate that necessarily there is mistake in the outside of black box when both responses are 0 (1) and during the X value.In addition, because the shielding of X value, this method can not guarantee to detect all mistakes, so the method that the present invention proposes is a kind of incomplete method.In containing the logic simulation process of X value, how to give the coding of circuit signal and the logical operation scheme of circuit signal is the problem that at first will solve.In order to represent the X value, this method is used two (0 or 1) each signal of encoding.Following table provides encoding scheme:
W W1 W2
0 0 1
1 1 0
X 1 1
Here, W is an arbitrary signal in the circuit, and W1 and W2 represent two codings of W, and promptly (W1, W2), last table has provided W and has been respectively 0,1 W=, the coding during X.
Following form has provided the logical operation scheme of circuit signal.Wherein, W1 and W2 represent to participate in two signals of computing, their coding be respectively W1=(A1, A2), W2=(B1, B2).Here, “ ﹠amp; " presentation logic and computing, " | " presentation logic exclusive disjunction.As can be seen from the table, the inverse of a signal just exchanges its dibit encoding.
The computing class
W1 W2
Type
With A1 ﹠amp; B1 A2 | B2
Or A1|B1 A2 ﹠amp; B2
Non-A2 A1
The method of Wolfgang Gunther is verified the function correctness of design by the standard relatively and the characteristic function of design, and its computational complexity is very high, is easy to cause the internal memory blast, and the stratification that therefore can not be applied to large-scale design is verified.Though the method for A.Jain is based on the method for SAT, has reduced memory requirements, need the modification of circuit structure, also to use dibit encoding to represent each circuit signal simultaneously, cause the SAT formula to become big easily, the time complexity height.The method that the present invention proposes is based on the method that logic simulation combines with satisfiability, does not need to revise circuit structure, has saved computational resource, has significantly improved algorithm performance.The present invention gives the detailed protocol that this method of application improves the design mistake diagnostic accuracy.
The verification method that comprises the circuit design of black box, can be used for improving the accuracy of design mistake diagnosis, as black box, whether the perimeter of checking black box is wrong candidate's zone errors, if wrong, illustrate that this zone can deletion from the tabulation of candidate region.To each candidate region repeated application above-mentioned steps, eliminate false candidate region as much as possible, make location of mistake more accurate, easier.
The invention technical scheme
A kind of verification method that comprises the circuit design of black box divides four steps to carry out, and the first step is a parallel logic simulation; Second step was comparison standard circuit and the response that realizes circuit, if can not prove that the realization circuit is wrong, then entered for the 3rd step; The boolean that the 3rd step was based on satisfiability compares; The 4th step was more whether the boolean who checked for the 3rd step separates, if separate, illustrated and realized that circuit is wrong.This method can be used to improve the accuracy of design mistake diagnosis in addition.
This method at first uses the parallel logic simulation checking to contain the design of black box, uses the boolean based on satisfiability (SAT) to compare (Boolean comparison) enhancing simulation algorithm then.Comprise two core procedures: first step parallel logic simulation, second step, the boolean based on satisfiability compared.Its main feature is: 1) the stuck-at fault test set Parallel Simulation of operating specification circuit contains the design of black box, in the simulation process with two Booleans coding (0 and 1) each circuit signal.2) in boolean's comparison procedure based on satisfiability, the unknown constraint of conjunctive normal form formula (CNF) expression of using full name to quantize.3) this method does not need to revise circuit structure, has reduced computational complexity, can be applied to large-scale design verification.4) this method can directly apply to the accuracy that improves the design mistake diagnosis.
The format circuit that the method that the present invention proposes is handled is a gate level netlist.This method was divided into for two stages and finishes the design verification that contains black box, and use the parallel logic simulation that contains X value previous stage, if design mistake has been found in logic simulation, and algorithm end so.Otherwise enter second stage, promptly use the boolean who contains the X value to compare based on SAT.Fig. 2 has provided this overview flow chart in conjunction with logic simulation and boolean's verification method relatively, describes the embodiment of this method below in detail.
Our algorithm is described with a simple case below.Fig. 6 has provided the schematic diagram that the application simulation method validation contains the circuit design of black box, supposes that NAND gate e is arranged in black box in realizing circuit, and the NAND gate d of black box outside then has been replaced by or door d.Under the effect of vector (000), though black box output is changed to the X value, the output of standard and realization is respectively 0 and 1, and promptly no matter what value black box is output as, and the response of standard and realization all is 0 and 1.So the door displacement mistake in the realization circuit has been detected.Certainly just simulate the result who obtains here with a vector, if a plurality of vectors of Parallel Simulation, and a plurality of outputs are arranged in the circuit; Need the response of storing each circuit signal so with two 32 machine work, respectively first of the expression response with second, then at each original output their response word relatively.If finding certain response to corresponding original output is respectively 0 (1) and 1 (0), explanation has detected design mistake so, and simulation process finishes.Otherwise, continue its complement vector of simulation, up to detecting design mistake or having simulated all test vectors.
Next, how to use the satisfiability proof of algorithm to contain the design of black box again.For the example of Fig. 6, standard is connected to an XOR gate res with the corresponding original output d and the d of realization, set up the miter model, as shown in Figure 7.Then a new original input z who realizes circuit is used as in black box output, the CNF formula of structure miter model:
In the following formula, the first line display NAND gate d, e, the CNF formula of g, the CNF formula of second line display or door d and NAND gate g ', the third line is then represented the CNF formula of XOR gate res.Last unitary clause res is used for detecting the test that miter output is fixed as 0 fault.In order to reflect all possible realization of black box, need be changed to the X value to black box output, in the CNF formula, need only get final product the literal deletion of expression black box output.So just obtain following CNF formula:
Be easy to now to try to achieve of above-mentioned formula separate into a=0, b=0, c=0}, thus explanation realizes having mistake in the circuit.
Below, we introduce method how to use the present invention's proposition again and improve the accuracy of error diagnosis.Usually when carrying out the design mistake diagnosis, diagnostic tool can provide the zone errors of some candidates in the circuit.Need then according to standard, further screening is done in these zones, false candidate region as much as possible is eliminated, so that locate mistake more accurately in definite zone of most possibly making a mistake.The prerequisite of using the method that the present invention proposes is, the false candidates zone of given some, and design mistake necessarily is positioned at wherein within least one zone fully.Judge any one candidate region whether be false flow process as shown in Figure 8.
Description of drawings
Fig. 1 is to use the logic simulation checking that contains the X value to contain the schematic diagram of black box design.
Fig. 2 has described the overview flow chart in conjunction with logic simulation and boolean's verification method relatively that the present invention proposes.
Fig. 3 has described and has used the Parallel Simulation method validation to contain the flow chart of black box design.
Fig. 4 has described and has used the flow chart that contains the black box design based on boolean's comparative approach checking of SAT.
Fig. 5 has provided the miter structural model figure of checking two circuit (standard and realization) function equivalences.
Fig. 6 has provided an Examples set and has used the analogy method detection to contain mistake in the black box design.
Fig. 7 has illustrated the boolean who how to use based on satisfiability and has relatively verified the design drawing that contains black box.
Fig. 8 has described the flow chart that the method for using the present invention to propose improves the design mistake diagnostic accuracy.
In the accompanying drawing, the element that each label is represented is as follows respectively:
1: any given design specification circuit.
2: with the corresponding realization circuit that contains black box of standard.
3: realize a black box in the circuit.
4: the design specification of single output.
5: XOR gate.
6: the realization circuit that contains black box of single output.
7: black box.
8: NAND gate.
9: or door.
10: black box.
Among Fig. 1, because the function and the specific implementation of standard circuit (1) all know fully, so when using the boolean vector simulation, the Boolean of its output response for determining, promptly 0 or 1.But when simulation contains the realization circuit (2) of black box (3), because black box (3) output will be changed to the X value, so the X value may appear in its output response.
Among Fig. 2, S100, S200, S300 and S400 represent four key steps of verification method respectively, promptly the output response phase of parallel logic simulation stage, comparison standard and realization, based on boolean's comparison phase of SAT and check boolean's comparative result stage.
S100: the stuck-at fault test set of operating specification circuit, Parallel Simulation standard and realization circuit simultaneously.Fig. 3 has provided the realization flow of this Parallel Simulation method.When simulation contains the realization circuit of black box, all black boxs are set be output as the X value.
S200: the relatively response of standard and realization.If given test set is more than 32 vectors, there are mistake in so each 32 vectors of Parallel Simulation, and the response of comparison standard and realization if prove the realization circuit, so end simulation process and whole algorithm.Otherwise get back to previous step, continue remaining vector of Parallel Simulation, up to detecting design mistake or having simulated all test vectors.Be over if all vectors all are used, still fail to find the design mistake in the realization, algorithm enters the S300 step so.
S300: the boolean who contains unknown constraint based on SAT compares.Fig. 4 has provided the realization flow of this boolean's comparative approach.At this moment, every pair of corresponding original output be connected to an XOR gate in need and realizing standard, if the circuit of a plurality of outputs, also need these XOR gate be connected to one or, we claim that this structural model is miter, as shown in Figure 5 (circuit of single output).Then the new original input that realizes circuit is treated as in all black box outputs, and the CNF formula of structure miter.For the institute that reflects black box might realize, these black boxs need be set be output as the X value, these need are with all represent that the variable of new original input and negative deletion thereof get final product in the CNF formula.Use the CNF formula of the last gained of SAT program solution then.
S400: if the CNF formula that obtains at last is satiable, promptly exist one to separate (vector), make no matter how black box is realized, the response of standard and realization is respectively 0 (1) and 1 (0), illustrates that so the black box outside is wrong.
Among Fig. 3, S1, S2, S3 correspond respectively to three steps of the parallel logic simulation method described in claims.
The first step is used parallel logic simulation, and its concrete steps are as follows:
Step S1: all black boxs are set are output as the X value;
Step S2: the stuck-at fault test set of operating specification circuit, simultaneously Parallel Simulation standard and the realization circuit that contains black box when test and excitation during more than 32, are simulated 32 vectors at every turn, after every simulation once, enter step S3;
Step S3: relatively whether the response of standard and realization is respectively 0 (1) and 1 (0), if, then design mistake is arranged in the black box outside of realizing circuit, otherwise, continue other vector of simulation (promptly returning the S2 step), finish up to finding that design mistake or institute's directed quantity all simulated.
Among Fig. 4, S10, S20, S30 correspond respectively to three steps based on boolean's comparative approach of SAT described in claims.
Second step used the boolean based on satisfiability to compare, and its key step is as follows:
Step S10: the new original input of all outputs of black box as design, the more required CNF formula of structure boolean;
Step S20: the method for using full name to quantize is represented unknown constraint, is about to the directly deletion from the CNF formula of all variablees of representing new original input;
Step S30: use the SAT program to solve above-mentioned CNF formula,, illustrate that the black box outside is wrong if formula is separated.
Among Fig. 5,, only F and G need be connected to an XOR gate, prove that then 0 fault that is fixed as of this XOR gate (5) output is immesurable for output function F and the G equivalence of verifying two correspondences.It should be noted that when using the satisfiability proof of algorithm, do not need to realize this connection physically, and just construct corresponding C NF formula.
Among Fig. 6, how this example just explanation is simulated by test and excitation, and relatively mistake is found in the response of standard and realization, and does not relate to the specific implementation details of Parallel Simulation.
Among Fig. 7, use based on the boolean of SAT relatively before, to set up the miter model earlier.At this moment will standard with realize in corresponding every pair of original output be connected to an XOR gate (5), if the circuit of many outputs, also each XOR gate to be connected to again one or.Whether the output of verifying the miter structure then is fixed as 0 fault and can surveys, if can survey, then there is a vector in explanation, makes no matter how black box is realized, the response of standard and realization is respectively 1 (0) and 0 (1).Thereby know the outside wrong of black box in the design.
Among Fig. 8, S1000, S2000, S3000 and S4000 represent that respectively the verification method that uses the present invention to propose improves four key steps of design mistake diagnostic accuracy, specifically describes as follows:
S1000: an optional candidate region of realizing in the circuit, it is set to black box;
S2000: all that black box is set are output as the X value, the stuck-at fault test set of operating specification circuit, simultaneously parallel logic simulation standard circuit with realize circuit, if can prove that the black box outside is wrong, forward the S4000 step so to, be not to forward the S3000 step to;
S3000: use boolean's comparative approach,, forward the S4000 step so to if there is design mistake in checking black box outside based on SAT, otherwise, think that this candidate region is real candidate region;
S4000: this candidate region is false, this candidate region of deletion from the tabulation of candidate region.
The present invention proposes a kind of circuit design verification method that comprises black box, and provided the concrete scheme that this method improves the design mistake diagnostic accuracy of using.This method at first stuck-at fault test set of operating specification circuit is done logic simulation, to find design mistake as much as possible.If analogy method does not have to find design mistake, further use the function correctness that contains the black box design based on boolean's comparatively validate of satisfiability again.Because this method do not need to construct BDD, and do not need the modification of circuit structure, therefore greatly saved computational resource, the experiment of many reference circuits is shown this method is than traditional fast 1 to 2 order of magnitude of black box design and verification method that contains.At present, the IP based design increased popularity, the verification method that contains black box is often used in the stratification verification methodology, and carries out design mistake diagnosis and debugging can be saved more costs at the commitment of design.The method that the present invention proposes realizes simple, can be integrated in the electronic design automation tool easily.