Combinational Equivalence Checking Using Satisfiability and Recursive Learning
Combinational Equivalence Checking Using Satisfiability and Recursive Learning
Joo Marques-Silva
Thomas Glass
Siemens AG
Corporate Technology
81730 Munich, Germany
e-mail: [email protected]
Abstract
The problem of checking the equivalence of combinational circuits is of key significance in the verification of
digital circuits. In recent years, several approaches have
been proposed for solving this problem. Still, the hardness
of the problem and the ever-growing complexity of logic
circuits motivates studying and developing alternative
solutions. In this paper we study the application of Boolean Satisfiability (SAT) algorithms for solving the Combinational Equivalence Checking (CEC) problem. Although
existing SAT algorithms are in general ineffective for solving CEC, in this paper we show how to improve SAT algorithms by extending and applying Recursive Learning
techniques to the analysis of instances of SAT. This in turn
provides a new alternative and competitive approach for
solving CEC. Preliminary experimental results indicate
that the proposed improved SAT algorithm can be useful
for a large variety of instances of CEC, in particular when
compared with pure BDD-based approaches.
1. Introduction
The problem of checking the equivalence of combinational circuits is of key significance in the verification of
digital circuits, and has been the subject of significant contributions in recent years. As a result, several approaches
have been proposed for solving the Combinational Equivalence Checking (CEC) problem. These approaches can be
characterized as being structure-based [3, 9, 20], functionbased [12], or a mix of the two [6, 8, 17]1. Structure-based
approaches can either use ATPG algorithms [3], or recursive learning [9, 10], whereas mixed approaches use structural information, Reduced Ordered Binary Decision
Diagrams (ROBDDs) and, in some cases, different forms
of learning [6, 17]. Approaches that relate and substitute
internal circuit nodes can exhibit the false negative problem [2], i.e. declaring two circuits not equivalent when
they are in fact equivalent. Different techniques have been
proposed for handling the false negative problem [9, 13].
Despite the recent improvements for solving the CEC
problem, its computational hardness and the ever-growing
complexity of logic circuits motivates studying, developing and evaluating new alternative algorithmic solutions.
In this paper we study the application of Boolean Satis1. Huang and Cheng [5] provide an alternative taxonomy, that distinguishes between incremental and symbolic approaches.
2. Preliminaries
The Conjunctive Normal Form (CNF) formula of a
combinational circuit is the conjunction of the CNF formulas for each gate output, where the CNF formula of
each gate denotes the valid input-output assignments to
the gate. (The derivation of the CNF formulas for simple
gates can be found for example in [11].) If we view a CNF
formula as a set of clauses, the CNF formula for the circuit is defined by the set union (or the conjunction) of the
CNF formulas for each gate. Hence, given a combinational circuit it is straightforward to create the CNF for-
// Input arg:
Current decision level d
// Output arg:
Backtrack decision level
// Return value:
SATISFIABLE or UNSATISFIABLE
//
SAT (d, & )
{
if (Decide (d) != DECISION)
return SATISFIABLE;
while (TRUE) {
if (Deduce (d) != CONFLICT) {
if (SAT (d + 1, ) == SATISFIABLE)
return SATISFIABLE;
else if ( != d || d == 0) {
Erase (d); return UNSATISFIABLE;
}
}
if (Diagnose (d, ) == CONFLICT) {
return UNSATISFIABLE;
}
}
}
Figure 1: Generic backtrack search SAT algorithm
a
c
v = 1
b
x
z = 0
y = 1
d
u = 1
f
e
Figure 2: Example circuit
Assignments: { z = 1, u = 0 }
1 = ( u + x + w )
2 = ( x + y )
3 = ( w + y + z )
Incorrect miters
(satisfiable)
Standard miters
(unsatisfiable)
Class Circuit
C432
C499
C1355
C1908
C2670
C3540
C5315
C6288
C7552
C1908
C2670
rel_sat
sato
1.4
19.5
> 2,500
> 2,500
> 2,500
> 2,500
> 2,500
> 2,500
> 2,500
> 2,500
0.2
11.7
> 2,500
> 2,500
> 2,500
> 2,500
631.3
> 2,500
> 2,500
> 2,500
0.34
> 2,500
grasp
time
2.1
1.4
8
> 176.0
3.4
0
> 2,500
9.0
0
394.2 47.4
5
991.9 28.2
19
> 2,500 2,003 3,727
> 493.8 222.7 618
> 346.4 54.8
0
> 2,400 1,062 592
258.9 47.5
0
11.9 29.3
0
grasp-rl
#B #NCB
24.8
LJ
1
2
1
4
13
8
961 22
352 109
290 62
761
205
10
413
0
210
35
6. Experimental Results
In this section, different algorithms for solving CEC are
evaluated. Given the number of tools compared, different
architectures were used. The CPU times presented correspond to approximately the equivalent times on a PII 266
MHz Linux machine with 128 MByte of physical memory.
Some experiments were conducted on a SUN Ultra 170
workstation with 384 MByte of physical memory, and the
run times were scaled accordingly.
In order to evaluate the different SAT algorithms, we
start by analyzing the ISCAS85 miters [9]. The results are
shown in Table 1. For each algorithm and for each
instance, the allowed CPU time was 2,500 seconds3.
Moreover, in this experiment GRASP-RL was run with
recursive learning of depth 1 at each level in the decision
tree. A first conclusion is that the most efficient SAT algorithms, including REL_SAT [1], SATO [21] and
GRASP [13] are in general inadequate for solving
instances of CEC. In contrast, by including recursive
learning, GRASP-RL is able to solve all instances in reasonable amounts of CPU times. Another interesting result,
is that the other features of efficient SAT algorithms,
including non-chronological backtracking, actually occur
while solving instances of CEC. As can be observed, the
number of non-chronological backtracks (#NCB) can be a
significant percentage of the overall number of backtracks
(#B). Moreover, the value of the largest backjump in the
decision tree (LJ) can be significant, thus justifying using
conflict diagnosis techniques in combinational equivalence checking.
3. Instances that abort and terminate with a CPU time less than
2,500 seconds result from other computational resources being
exceeded, in most cases the allowed number of recorded clauses.
tue-bdd
time #aborted
13,853
296
35,491
290
58,145
202
53,465
197
66,790
195
cudd
time #aborted
141,909
28
154,787
5
147,407
5
162,492
5
153,544
5
grasp-rl
281
725
0
95,246
Besides the ISCAS85 benchmarks, we also experimented with a large set of industrial equivalence checking
instances4. Statistical data regarding these instances of
CEC is shown in Table 2. Observe that each instance
already denotes a miter [3]; hence the number of primary
outputs is necessarily 1.
memory
16 Mbyte 32 Mbyte 64 Mbyte 128 Mbyte 256 Mbyte
sis+grasp-rl
51,483
8,418
10,473
15,114
19,509
Table 5: CPU times for SIS+GRASP-RL (in seconds)
References
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
7. Conclusions
In this paper we address the problem of solving combinational equivalence checking using Boolean Satisfiability
algorithms. For this purpose, a new dedicated SAT algorithm that incorporates an extended recursive learning procedure for CNF formulas is described and has been
implemented. Preliminary experimental results clearly
indicate that SAT algorithms may be of practical use for
CEC, either as stand-alone tools or as part of an incremental strategy for equivalence checking [5]. Moreover, the
new SAT algorithm allows applying the recursive learning
technique to any problem domain where SAT can also be
used.
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
[20]
[21]