You are on page 1of 10

Sequential-Equivalence Verification

Principles of
Sequential-Equivalence
Verification
Maher N. Mneimneh and Karem A. Sakallah
University of Michigan

functional equivalence of specification


Editor’s note:
and implementation models. Although
This article is a general survey of conceptual and algorithmic approaches to
simulation can eliminate some or most
sequential-equivalence checking. Although this fundamental problem is very
design errors, it can never completely cer-
complex, recent advances in satisfiability solvers and ATPG approaches are
making good headway. tify design correctness. Formal equiva-
—Carl Pixley, Synopsys lence verification (FEV) is a viable
alternative that has gained wide industri-
al acceptance. FEV, which uses automata
CHECKING WHETHER two models of a design are theory and mathematical logic to formally reason about
functionally equivalent is a crucial step in a transforma- the correctness of design transformations, is broadly
tion-based design flow, in which a designer obtains lower- divided into two categories: combinational and sequen-
level implementation models by manual or automatic tial. Combinational-equivalence verification (CEV) is
translation from higher-level specification models. In a appropriate when the transformations applied affect the
manual translation, the designer constructs a transistor- circuit’s combinational logic only. Examples of such
or gate-level model of a register-transfer-level (RTL) spec- optimizations are two-level and multilevel minimization,
ification. In an automatic translation, synthesis tools trans- timing optimization, and technology mapping. CEV has
form the RTL model into a gate-level model. Usually, become mainstream in today’s design flows, and current
designers use automatic translation to synthesize a CEV tools can handle fairly complex designs.
design’s control portion and manual translation to syn- Designers use sequential-equivalence verification
thesize its data path components. (SEV) for transformations that don’t preserve the corre-
In either case, the process is not guaranteed to be spondence between memory elements in both circuits.
error free. For example, a designer might erroneously Examples of such transformations include retiming,1
interpret the RTL description and generate a nonequiv- state minimization,2 state encoding,2 sequential-redun-
alent implementation. With synthesis tools, problems dancy removal, and redundancy addition and removal.
are less frequent but are not completely eliminated. Despite considerable research, SEV tools and algo-
Although the algorithms used for synthesis are pre- rithms suffer from an inherent, widely acknowledged
sumed to be correct by construction, errors might exist state explosion problem. That is, for a given design, the
in their software implementations. Because of the sheer number of potential states is exponential in the number
size of such implementations, applying software verifi- of state devices. Checking equivalence requires, in one
cation to check their correctness is currently beyond form or another, exploration of the design’s state space.
the scope of most tools. In addition to software errors, Thus, this problem has exponential complexity. As a
manual changes, usually applied after automatic syn- result, designers rarely use sequential optimizations
thesis to improve a design parameter, might introduce despite their potential improvements of design para-
errors in the implementation models. meters such as area, speed, and power.
Traditionally, designers use simulation to check the In recent years, researchers have proposed new

248 0740-7475/05/$20.00 © 2005 IEEE Copublished by the IEEE CS and the IEEE CASS IEEE Design & Test of Computers
approaches to tackling the limitations of the basic SEV x1 z1
x2 z2
algorithms. Although the problem is very hard from a
xm Combinational zl
complexity theory perspective, many heuristic improve- logic
ments have worked well in practice. Among recent
advances are symbolic traversal, induction, and struc-
tural approaches. In this article, we review SEV solutions y1
ranging from basic algorithms to more scalable y2
approaches. In addition to efficient algorithms, much
research has dealt with understanding the meaning of yn
sequential equivalence, resulting in various notions of
equivalence. We summarize these notions and their (a) clk
interrelationships.

w3
Preliminaries x1 w4 w8
w1 w2 y1
Basic SEV concepts include sequential circuits, state w5 w6 w9
equivalence, synchronizing and initializing sequences, y2
w7 w11
sequential equivalence, and product machines.
z1
Sequential-circuit representation w10
w12
(b)
Figure 1a shows the structure of a synchronous
sequential circuit. The circuit has a finite number m of
0/0
inputs (x1, x2, …, xm), a finite number l of outputs (z1, z2, 1/0
…, zl), and a finite number n of state or memory ele-
00 0/1
ments (y1, y2, …, yn). The circuit’s combinational part 10
consists of k internal signals (w1, w2, …, wk) represent-
ing the outputs of combinational gates. Each of these sig- 1/1

nals takes one of two possible values, 0 or 1. Clock signal 0/0 0/0
clk synchronizes the memory elements’ operation. We
1/0 01
assume that all the memory elements are edge sensitive 1/1 11
and change their values on the rising edge of the clock. (c)
We refer to these memory elements as flip-flops.
Figure 1b shows an example of a sequential circuit. Figure 1. Huffman model of a synchronous sequential circuit
We model sequential circuits using finite-state machines (a), example sequential circuit (b), and its corresponding
(FSMs). A Mealy FSM M is defined as a sextuple: M = (Q, state transition graph (c).
Σ, ∆, δ, λ, Q0), where Q is a finite set of states, Σ is the
input alphabet, ∆ is the output alphabet, δ : Q × Σ → Q
is the state-transition function, λ : Q × Σ → ∆ is the out- y1, y2) = ∃ x1 T(y1+, y2+, y1, y2, x1). The output function is
put function, and Q0 is the set of initial states. In model- λ(y1, y2, x1) = z1 = x1y1y2 + x1y1′y2′ + x1′y1y2′.
ing the circuit in Figure 1b with an FSM, we have Q = An FSM is represented visually by a state transition
{00, 01, 10, 11}, Σ = {0, 1}, and ∆ = {0, 1}. Denoting the graph. STG(M), the state transition graph of FSM M, is a
next-state value of state variable y as y+, we have y1+ = labeled directed graph 〈V, E〉 in which each vertex v ∈ V
x1′y2 + x1y1y2′ and y2+ = x1y1′ + x1y2 representing the next- corresponds to state si of M (and is labeled si), and each
state equations. The next-state function is (y1+, y2+) = edge e ∈ E between two vertices labeled si and sj corre-
δ(y1, y2, x1) = (x1′y2 + x1y1y2′, x1y1′ + x1y2). We define the sponds to a transition from state si to state sj in M. The edge
transition relation T(y1+, y2+, y1, y2, x1) as the conjunction is labeled ik/ol, where ik is the input that causes the transi-
of all the next-state equations: T(y1+, y2+, y1, y2, x1) = (y1+ tion from si to sj and ol is the output during that transition.
= x1′y2 + x1y1y2′)(y2+ = x1y1′ + x1y2). Alternatively, we can Figure 1c shows the STG of the circuit in Figure 1b.
define the transition relation T(y1+, y2+, y1, y2) on present We denote by xi (i ≥ 0) the input in clock cycle i to the
and next-state variables only by existential elimination FSM where x = (x1, x2, …, xm), and by x0 ⋅ x1 ⋅ …⋅ xu−1
of the input variables from T(y1+, y2+, y1, y2, x1): T(y1+, y2+, a sequence of u consecutive inputs. If applying this input

May–June 2005
249
Sequential-Equivalence Verification

suffers from information loss, a synchronizing sequence


Circuit C1
is not necessarily an initializing sequence. If we denote
the set of synchronizing sequences and the set of initial-
Next-state and
output logic
izing sequences of machine M as SM and IM, IM ⊆ SM.

n1 Sequential equivalence
m
x y We can check whether two circuits are sequentially
equivalent by applying the classical notion of FSM
equivalence.2,3 Classical FSM equivalence requires each
Next-state and state in one FSM to be equivalent to a state in the other
output logic and vice versa. However, this requirement may be too
stringent for some sequential circuits. Usually, a sequen-
n2
y
tial circuit has an input sequence, called the reset
sequence, that is applied when circuit operation starts.
Circuit C2 The reset sequence forces the value of some or all mem-
ory elements to 0 or 1 and consequently limits the pos-
Figure 2. Product machine (miter) of two sequential circuits. sible initial states. When the reset operation brings the
circuit to a single initial state, the classical notion
reduces to proving the initial states’ equivalence. For
sequence from state s0 causes the machine to transition some circuits (for example, data path circuits), many
from state si−1 to state si on input xi−1, we write flip-flops can remain uninitialized after reset. For others,
0 1 u−1
s0 x → s1 x
→ s2 … su−1 x→ su . If the input sequence the reset sequence might not be available until very late
is irrelevant, we write s0 → s1 → s2 … su−1 → su. in the design cycle. For these cases, various equivalence
We can generalize the modeling just described as cir- notions have been devised.
cuits containing multiple clock domains, gated clocks,
and level-sensitive memory elements (or latches). Product machine
To check for equivalence, we must search for an
State equivalence input sequence that produces different outputs. We can
Two states s1 and s2 of machine M are equivalent do this by connecting together both machines’ inputs,
(s1 ~ s2) if for every possible input sequence applied connecting the corresponding outputs to an exclusive
from these states, the same output sequence results. If NOR (XNOR) gate’s inputs, and connecting the XNOR
s1 and s2 are not equivalent, they are distinguishable. gate’s outputs to an AND gate. The resulting circuit is
Any input sequence that produces different outputs is usually called a miter circuit, and its FSM is called the
called a distinguishing sequence for these two states. In product machine. Figure 2 shows the product machine
Figure 1c, 00 and 10 are not equivalent because they of two sequential circuits. Each state of the product
produce different outputs when the input is 1. machine corresponds to a state pair s1s2, where s1 is a
state of M1 and s2 is a state of M2. We call a state of the
Synchronizing and initializing sequences product machine with output 0 unsafe, and a state with
A synchronizing sequence of machine M is an input output 1 safe. State sj is reachable from si if there is an
sequence that drives M to a specific state ssynch when input sequence that takes the machine from state si to
applied from any state of M; ssynch is a synchronizing state sj or if i = j.
of M. M is synchronizable if it has at least one synchro- Two states s1 of M1 and s2 of M2 are equivalent if all
nizing sequence. In Figure 1d, input sequence 0 ⋅ 0 is a states reachable from state s1s2 of the product machine
synchronizing sequence because applying it from any are safe. Figure 3a shows two FSMs, and Figure 3b
state takes the machine to state 00. shows their product machine. A pointer indicates that
An initializing sequence is a synchronizing sequence a state is an initial state. Unsafe states of the product
identifiable through three-valued logic simulation. In machine are shaded.
three-valued logic simulation, a signal in the circuit takes
a value from the set {0, 1, X}, where X represents the Circuits with one initial state
unknown value. Because three-valued logic simulation When each circuit has one initial state, verifying

250 IEEE Design & Test of Computers


Initial Initial
0/0 state 0/1 state
1/0
1/1 1/1
s1 0/1 s1t1
s3
s 2 t2
1/1
s4t1 0/1 1/0
1/1
0/1 0/1 s t
0/0 0/0 42
1/0
0/0 1/1
1/0 s2 s3t3
s4 s3t4
1/1 s3t1 1/0
0/0 0/1
s4t3 0/1
0/0
1/0 0/1 s1t2
s2t3
Initial 1/0 1/1
0/0 state
0/1 1/0 s1t3
1/0 0/0
0/0
t1 1/0 0/1 s2t1
t3 1/1 s1t4

1/1 0/0 1/1


s3t2 0/0
0/0 s2t4
1/1

1/0 1/1 1/0


t2 t4 0/0 s4t4
0/1
(a) (b)

Iteration i Reach i New i


0 {s1 t1} {s1 t1}
1 {s1 t1, s2 t2} {s2 t2}
2 {s1 t1, s2 t2, s3 t3} {s3 t3}
{s1 t1, s2 t2, s3 t3,
3 s1 t3, s3 t1} {s1 t3, s3 t1}

(c)

Figure 3. Two FSMs (a), their product FSM (b), and the iterations of forward traversal on the product machine (c).
Unsafe product machine states are shaded.

equivalence reduces to checking the initial states’ New0 to the initial state. In Figure 3, to check whether the
equivalence. There are two common approaches. The initial states s1 and t1 are equivalent, we traverse the prod-
first locally checks whether the two states are equiva- uct machine starting from state s1t1. Figure 3c shows the
lent; the second works globally by computing the whole traversal iterations. Iteration 3 reaches unsafe states s1t3
set of nonequivalent state pairs and checking whether and s3t1. Thus, s1 and t1 are not equivalent, and conse-
the initial state pair belongs to this set. quently the two machines are not equivalent.
In the first approach, we apply breadth-first search to In the alternative procedure, we compute the set of
find the set of states reachable from the product nonequivalent state pairs. If the initial state pair does
machine’s initial state. We call this procedure forward not belong to this set of nonequivalent state pairs, the
FSM traversal. If all reachable states are safe, the two cir- two circuits are equivalent; otherwise, they are not.
cuits are equivalent; otherwise, they are not. The product Observe that an unsafe state of the product machine
FSM in Figure 3b illustrates this procedure. At a given iter- corresponds to a nonequivalent state pair, and that a
ation, we keep track of Reachi, the set of states reached state that can reach an unsafe state also corresponds to
at iteration i from the initial state, and Newi, the set of new a nonequivalent state pair. Thus, we start with the set of
states reached at iteration i. Initially, we set Reach0 and unsafe states and add their predecessors by backward

May–June 2005
251
Sequential-Equivalence Verification

Initial traversal4,5 is one example that has


state s5 proven effective in practice. The main
s7 s8 idea of symbolic approaches is to per-
s0 s1 form the search by manipulating the
s6 characteristic functions of sets and rela-
s3 tions instead of enumerating states one
s2 by one. These approaches use binary
decision diagrams (BDDs),6 an efficient
s4 data structure for representing and
manipulating Boolean functions. Despite
(a)
the success of BDDs on various practical
cases, their memory requirements can be
Initial prohibitive—known as the memory
state s5
explosion problem.
s7 s8
s0 s1 CNF-based induction approaches
s6
Induction approaches7 are based on
s3
the following observation: If we show that
s2 the initial state is safe and that every safe
s9 s10 state transitions to safe states only, we can
s4
conclude that all states reachable from
(b) the initial state are safe. This observation
is similar to mathematical induction, in
Figure 4. Examples of product machines: satisfying induction at depth 4 which checking whether the initial state
(a) and violating induction at all depths (b). Edge labels are omitted for is safe corresponds to the base step, and
simplicity. Unsafe states are shaded. checking whether every safe state transi-
tions to safe states corresponds to the
inductive step. However, notice that this
FSM traversal until we reach a fixed point. As in the pre- observation, unlike mathematical induction, makes a
vious approach, we keep track of BReachi, the set of one-way implication. Consequently, it is sufficient but not
states reached at iteration i from unsafe states, and necessary to prove equivalence, because although safe
BNewi, the set of new states reached at iteration i. For state Ssafe might transition to an unsafe state, Ssafe might not
Figure 3, it is easy to verify that after three iterations, the be reachable from the initial state. For example, transi-
initial state pair belongs to BReach3. Thus, the two tion s7 → s8 in Figure 4a violates the inductive step (s7 is
machines are not equivalent. safe but s8 is not) even though all reachable states from
the initial state are safe. When the inductive step fails, we
State explosion and BDD-based symbolic repeat the proof by increasing the induction depth. At an
approaches induction depth of 2, the base step checks the validity of
Reducing sequential equivalence to a graph traver- I(s0) ⋅ T(s0, s1) → P(s0) ⋅ P(s1), and the inductive step
sal problem causes exponential complexity because checks the validity of T(s0, s1) ⋅ T(s1, s2) ⋅ P(s0) ⋅ P(s1) →
the state transition graph’s size is exponential in the P(s2), where I(s) is 1 if s is an initial state and 0 otherwise,
number of memory elements of the corresponding cir- and P(s) is 1 if s is safe and 0 otherwise.
cuit. In particular, a circuit with n memory elements In Figure 4a, transitions s5 → s7 → s8 violate the induc-
results in a graph with 2 vertices. This phenomenon tive step at depth 2, and transitions s6 → s5 → s7 → s8 vio-
n

is known as the “state explosion” problem. From a late it at depth 3. At depth 4, the inductive step holds.
computational-complexity perspective, we know of no Thus, we can conclude that the product machine cor-
algorithms that can verify sequential equivalence in responds to equivalent circuits.
polynomial time. This approach cannot disprove equivalence even if
Several heuristic approaches have been devised to we increase the induction depth indefinitely. For exam-
tackle this state explosion problem. Symbolic graph ple, consider the transition system in Figure 4b.

252 IEEE Design & Test of Computers


Induction of any depth fails: For depth i, the transitions Incomplete Complete Iterations to
prove property

9 → s9 → K → s9 → s10
s1 Computational
444424444 3 resources
i transitions
per iteration

violate the inductive step. We can fix this by providing


stronger versions of the inductive step. To do this, we
define a walk and a path of length i of the STG:

walki(s0, s1, …, si) = T(s0, s1) ⋅ … ⋅ T(si–1, si) Inductive


steps
Walk Path Shortestpath
pathi(s0, s1, …, si) =
T(s0, s1) ⋅ … ⋅ T(si–1, si) ⋅ ∏s
0 ≤ j <k ≤i
j ≠ sk Figure 5. Trade-offs among inductive steps.

Intuitively, walki(s0, s1, …, si) = 1 if there is a walk of


length i in the STG, and pathi(s0, s1, …, si) = 1 if there is a with no repeated vertices, whereas shortestpath search-
path (no repeated states) of length i in the STG. For the es for the longest shortest path in the transition graph.
complete algorithm, the base step at depth i checks the With this stronger inductive step, we can conclude that
validity of in Figure 4b, equivalence holds at depth 3 instead of
depth 4. Figure 5 illustrates the trade-offs among differ-
I(s0) ⋅ walki(s0, s1, …, si) → P(s0) ⋅ … ⋅ P(si) ent inductive steps. For walk, path, and shortestpath, we
compare the required number of iterations to prove the
and the inductive step at depth i checks the validity of property and the required computational resources for a
given iteration. Walk requires the largest number of iter-
pathi+1(s0, s1, …, si, si+1) ⋅ P(s0) ⋅ … ⋅ P(si) → P(si+1) ations but the least computational resources per itera-
tion. Shortestpath requires the least number of iterations
Thus, we can prove the STG in Figure 4b safe at but the most computational resources per iteration.
induction depth 4. As another example, consider the Walk is incomplete because it might fail to prove equiv-
FSM of Figure 3b. For i = 0, base step I(s0) → P(s0) is alence even with an indefinitely increased induction
valid. Inductive step pathi(s0, s1) × P(s0) → P(s1) is not depth, whereas path and shortestpath are complete.
valid because s3t3 satisfies P, but it transitions to s1t3,
which does not satisfy P. Next, we increase the induc- Structure-driven approaches
tion depth to 1. The base step is still valid, but the induc- Structure-driven approaches use functional relations
tive step is not; a counterexample is s2t2 → s3t3 → s3t1. that exist among the two circuits’ signals to simplify the
When we increase the induction depth to 2, the induc- verification task.8-11 The observation behind these
tive step is not valid because of the following counter- approaches is that the circuits being compared are
example: s1t2 → s2t2 → s3t3 → s3t1. When we increase the related in some fashion, typically one being derived
induction depth to 3, the base step is not valid because from the other through a sequence of transformations.
of counterexample s1t1 → s2t2 → s3t3 → s1t3. Thus, the two A by-product of such transformations are functional
circuits are not equivalent. relations, which, appropriately used, can make verifi-
The advantage of the induction-based approach is cation more tractable. In general, these relations take
that we can verify both the base and inductive steps with the form of implication, equality, or more complex
a satisfiability solver. To do this, we convert the base and Boolean functions.
inductive steps to conjunctive normal form (CNF), thus As an example, consider the circuit in Figure 6a and
circumventing the memory explosion problem of BDD- its corresponding STG in Figure 6b. Figure 6c shows the
based symbolic approaches. However, a disadvantage result of applying forward traversal on the product
is that proving a property might require a very high machine formed between the circuits of Figure 1b and
induction depth. To correct this, we strengthen the Figure 6a. Examining the states reachable at iterations
inductive step by replacing pathi(s0, si) with shortest- 0, 1, and 2, we notice that state variables y2 and y5 are
pathi(s0, s1, …, si). Intuitively, path searches for a path equivalent. Such equivalence relations can substantially

May–June 2005
253
Sequential-Equivalence Verification

ing the reachable states at iteration 2 in Figure 6c, we


w13 notice that y1y2 and y1′y2′ are both implicants of y3. More-
x1 y3 w16
complex functional relations can be identified as well.
For instance, it is easy to verify that the functional rela-
w15 y4
z2 tion y4 = y1′ + y2 holds for all iterations in Figure 6c. For
this relation, we call y4 a functionally dependent vari-
w14 y5 w17
able since its value can be derived from other variables
(y1 and y2 in this case). Functionally dependent vari-
(a)
ables are one cause of BDD blowups. Detecting and
100 removing these variables during forward traversal can
Initial
0/0 state 0/1 1/1
enhance the basic algorithm.
1/0

110 0/1 000 Circuits with an unknown initial state


0/1, 1/0
001 Because additional transistors are needed to imple-
0/0 1/1 0/1 ment the reset operation, a reset flip-flop has a larger area
,1
/1
010 than a nonreset flip-flop. Furthermore, routing a global
1/0 reset signal to every flip-flop introduces additional area
0/0 0/0 101
overhead. We can avoid this overhead by using nonreset
011 111
1/1 flip-flops. With such flip-flops, the assumption of a single
initial state no longer holds. To remedy this, researchers
1/0
have proposed various notions of sequential equivalence
(b) for circuits with an unknown initial state.

Iteration i Reach i
Classical FSM equivalence
0 {(00;110)} Under the classical notion of FSM equivalence, two
1 {(00;110), (01;011)} machines are equivalent if for each state in one
2 {(00;110), (01;011), (10;000)} machine, there is a corresponding equivalent state in
the other and vice versa.2,3 Using this definition, it is
(c)
easy to show that the two machines M1 and M2 in Figure
Figure 6. Sequential circuit (a), its STG (b), and forward 7 are equivalent. Classical FSM equivalence makes no
traversal on the product machine of the circuit in Figure 1b assumptions about the circuit’s operation. In the pres-
and Figure 6a (c). ence of a reset sequence, some states might never
occur during operation, and thus this notion becomes
too restrictive.
speed up verification by eliminating the need for search-
ing states violating the equivalence relation. As a gen- Sequential hardware equivalence
eralization, we can also look for delayed-equivalent Sequential hardware equivalence (SHE) is a theory
signals. Two signals are delayed-equivalent if the output of sequential equivalence for circuits with no known
of one is identical to that of the other but delayed by initial state.12 Under SHE, two machines are equivalent
some number of clock cycles. For example, in the cir- if, regardless of what power-up states they are in, they
cuits of Figure 1b and Figure 6a, w13(t) = w9(t + 1) for can be driven to two equivalent states after which their
t ≥ 0, where wi(t) is the value of signal wi at time t. To behavior will be identical. The input sequence that
verify this, we notice that w13(t) = x1′(t) ⋅ y5′(t) and w9(t brings both circuits to equivalent states is called an
+ 1) = y1(t + 1) ⋅ y2(t + 1) + y1′(t + 1) ⋅ y2′(t + 1). By substi- aligning sequence. The two machines need not pro-
tuting the next-state values for y1 and y2, we get w9(t + 1) duce identical outputs during the aligning process (that
= x1′(t) ⋅ y2′(t). But we have seen previously that y2(t) = is, their transient behavior can be arbitrary.) We can
y5(t); thus, we conclude that w13(t) = w9(t + 1). show that two machines are equivalent if and only if
In addition to equivalences, we can use implication there exists a single aligning sequence that aligns all
relations between state variables of the product state pairs to some equivalent state pair. In addition, if
machine to simplify verification. For example, examin- the two machines having equivalent states are syn-

254 IEEE Design & Test of Computers


M2 1/0

M1 0/1 t5
0/0 0/0
1/0 1/0

s1 0/1 t1 0/1
s3 t3

1/0 1/0
0/0 0/0 0/0 0/0

1/0 s2 1/0 t2
s4 t4
1/1 1/1

M3 M4
0/0 0/0
1/0 1/0

v1 0/1 w1 0/1
v3 w3

1/0 1/0
0/0
0/0
0/0
1/0 v2 1/1 1/0 w2
v4 w4
0/0 1/1

Figure 7. Examples of machine equivalence notions. M1 ≈ fsmM2 because t1 ~ s1, t2 ~ s2, t3 ~ s3, t4 ~ s4,
and t5 ~ s3. M1 ≈ sheM3 because input sequence 0 ⋅ 0 ⋅ 0 aligns all state pairs to equivalent pair (s1, v1).
M4 ≤ safeM1 because for all input sequences, states w1, w2, and w3 of M4 behave like states s1, s2, and
s3 of M1. State w4 behaves like state s1 for all input sequences starting with a 0 and like state s4 for
all input sequences starting with a 1. Similarly, M1 ≤ safeM4 and thus M1 ≈ safeM4.

chronizable, we can form one possible universal align- SHE acts as a necessary (but not sufficient) equiva-
ing sequence by concatenating a synchronizing lence requirement.
sequence of one machine with that of the other.
Machines M1 and M3 of Figure 7 are equivalent under Safe-replacement equivalence
SHE. Note that SHE imposes no restrictions on the syn- Safe-replacement equivalence is the least distin-
chronizing sequences of the two machines checked for guishing equivalence notion that makes no assumptions
equivalence. This is problematic when the circuit’s envi- about a circuit’s operation.13 Machine M2 is a safe
ronment can generate some sequences but not others. For replacement for machine M1 (written M2 ≤ safeM1) if and
example, the environment of M1 might not be able to pro- only if for any state s2 of M2 and for any input sequence
duce M3’s synchronizing sequence 0 ⋅ 0 ⋅ 0 because it allows π ∈ Σk ( π = k), there exists some state s1 of M1 that pro-
only two cycles for initialization. Consequently, replacing duces the same output as s2 when input sequence π is
M1 with M3 might result in unexpected behavior. applied. Machines M1 and M2 are safe-replacement
Practically, SHE can be very effective in checking equivalent (M1 ≈ safeM2) if M1 ≤ safeM2 and M2 ≤ safeM1.
sequential equivalence in the absence of a reset The preceding definition states that M2 is safe-
sequence. If the two designs are equivalent under SHE, replacement equivalent to M1 as long as the I/O behav-
we know that they are equivalent in their steady-state ior of every state of M2 (M1) can be reproduced by some
behavior. Once the reset sequence is available, we can state of M1 (M2). Note that this definition allows a state
use a stronger notion of equivalence based on the of M2 to behave like some state of M1 for input sequence
assumptions made about circuit operation. In that case, π and like some other state of M1 for input sequence π′.

May–June 2005
255
Sequential-Equivalence Verification

states), the replacement machine must preserve that


No assumptions made about Classical finite-state
design operation machine equivalence behavior. After initialization, the original machine will
be in a known state, and consequently its output will be
predictable. Thus, any replacement machine must have
Safe-replacement identical behavior after initialization.
equivalence
Other notions of sequential equivalence are defined
Assumptions made about in the literature. We refer the reader to Singhal’s disser-
design operation tation for definitions of delay and delay-preserving
Delay-preserving equivalence.13 Figure 8 illustrates the relationship of the
Three-valued safe-replacement equivalence
various equivalence notions. An arrow from A to B indi-
equivalence
cates that if M1 and M2 are equivalent under A, they are
equivalent under B.
IM1 ≠ φ , IM2 ≠ φ SM1 ≠ φ , SM2 ≠ φ

Sequential hardware SEQUENTIAL SYNTHESIS and optimization of digital


equivalence
circuits demand robust equivalence-checking algo-
Reset operation rithms. The heuristic approaches reviewed here
modeled in design
increase the capacity of the basic algorithms so that
Known-initial-state they can handle circuits with hundreds to thousands
equivalence of memory elements. Although this is a significant
enhancement, it is still inadequate for state-of-the-art
Figure 8. Relationship of sequential-equivalence notions for designs. More research in this area is essential to suc-
machines M1 and M2. Labeling on the arrows indicate cessfully deploying sequential-equivalence-checking
conditions under which the relationship holds. tools in industrial environments. ■

References
Consequently, a state in one machine need not be 1. C.E. Leiserson and J.B. Saxe, “Retiming Synchronous
equivalent to a state in another. What is guaranteed by Circuitry,” Algorithmica, vol. 6, no. 1, 1991, pp. 5-35.
safe replaceability is that any start-up state in M2 behaves 2. Z. Kohavi, Switching and Finite Automata Theory,
like some start-up state of M1 and vice versa. McGraw-Hill, 1978.
In Figure 7, M3 is not safe-replacement equivalent to 3. J. Hartmanis and R.E. Stearns, Algebraic Structure The-
M1 because in state v4, input sequence 11 results in out- ory of Sequential Machines, Prentice-Hall, 1966.
put sequence 11. This I/O behavior cannot be repro- 4. O. Coudert, B. Berthet, and J. Madre, “Verification of
duced from any state in M1. On the other hand, machine Synchronous Sequential Machines Based on Symbolic
M4 is safe-replacement equivalent to M1. Execution,” Proc. Int’l Workshop Automatic Verification
Methods for Finite State Systems, LNCS 407, Springer,
Three-valued safe equivalence 1989, pp. 365-373.
Three-valued safe equivalence is a relaxed form of 5. F. Somenzi, “Binary Decision Diagrams,” Calculational
safe-replacement equivalence that allows some free- System Design, vol. 173, NATO Science Series F, IOS
dom in the machine’s transient behavior.9 Two Press, 1999, pp. 303-366.
machines M1 and M2 are three-valued equivalent if for 6. R. Bryant, “Graph-Based Algorithms for Boolean Func-
any input sequence π ∈ Σk, k > 0, their outputs belong tion Manipulation,” IEEE Trans. Computers, vol. 35, no.
to the set {(0, 0), (1, 1), (X, X)} when π is applied from 8, Aug. 1986, pp. 677-691.
an unknown state (all flip-flops initialized to X). The 7. M. Sheeran, S. Singh, and G. Stalmarck, “Checking Safe-
intuition behind this definition is the following: If dur- ty Properties Using Induction and a SAT Solver,” Proc. 3rd
ing initialization the original machine produces a 0 or Int’l Conf. Formal Methods in Computer-Aided Design
1 depending on its power-up state, the replacement (FMCAD 2000), LNCS 1954, Springer, 2000, pp. 108-125.
machine can produce any value for that output. 8. P. Bjesse and K. Claessen, “SAT-Based Verification
However, if during initialization the output is pre- without State Space Traversal,” Proc. 3rd Int’l Conf. For-
dictable (that is, always 0 or always 1 from all power-up mal Methods in Computer-Aided Design (FMCAD 2000),

256 IEEE Design & Test of Computers


LNCS 1954, Springer, 2000, pp. 372-389. checking, binary decision diagrams, and satisfiability
9. S.-Y. Huang, K.-T. Cheng, and K.-C. Chen, “Verifying solvers. Mneimneh has a BE in computer and com-
Sequential Equivalence Using ATPG Techniques,” ACM munications engineering from the American Universi-
Trans. Design Automation of Electronic Systems, vol. 6, ty of Beirut and an MS in computer science and
no. 2, Apr. 2001, pp. 244-275. engineering from the University of Michigan.
10. D. Stoffel and W. Kunz, Structural FSM Traversal—Theo-
ry and a Practical Algorithm, tech. report 005/1997, Dept. Karem A. Sakallah is a professor of
of Computer Science, Univ. of Potsdam, Germany, 1997. electrical engineering and computer
11. C.A.J. van Eijk, “Sequential Equivalence Checking science at the University of Michigan,
Based on Structural Similarities,” IEEE Trans. Computer- Ann Arbor. His research interests
Aided Design of Integrated Circuits and Systems, vol. include CAD with emphasis on simula-
19, no. 7, July 2000, pp. 814-819. tion, timing verification and optimal clocking, logic and
12. C. Pixley, “A Theory and Implementation of Sequential layout synthesis, Boolean satisfiability, and design veri-
Hardware Equivalence,” IEEE Trans. Computer-Aided fication. Sakallah has a BE in electrical engineering from
Design of Integrated Circuits and Systems, vol. 11, no. the American University of Beirut and an MSEE and a
12, Dec. 1992, pp. 1469-1494. PhD in electrical and computer engineering from
13. V. Singhal, Design Replacements for Sequential Carnegie Mellon University. He is a fellow of the IEEE
Circuits, doctoral dissertation, Univ. of California, Berke- and a member of the ACM and Sigma Xi.
ley, Electronics Research Laboratory, College of Engi-
neering, 1996. Direct questions and comments about this article to
Maher N. Mneimneh, University of Michigan, Dept. of
Maher N. Mneimneh is pursuing a Computer Science and Engineering, 1301 Beal Avenue,
PhD in computer science and engi- Ann Arbor, MI 48109-2122; maherm@umich.edu.
neering at the University of Michigan.
His research interests include formal For further information on this or any other computing
verification of VLSI systems: model topic, visit our Digital Library at http://www.computer.
checking, combinational and sequential equivalence org/publications/dlib.

Get access
to individual IEEE Computer Society

documents online.

More than 100,000 articles

and conference papers available!

US$9 per article for members

US$19 for nonmembers

http://computer.org/publications/dlib/

May–June 2005
257

You might also like