Problemcore
Latch mapping
Also called register matching, register correspondence for equivalence checking.
Pair the registers of two sequential designs so that combinational equivalence checking can compare their next-state and output functions.
Latch mapping pairs each latch of one sequential design with a latch of the other, so that two designs with the same register structure can be compared by a combinational check. Once each latch output and its partner are the same free variable, the next-state function of each latch and the output functions become combinational functions of the inputs and the latch values, and a miter compares them. On this page "mapping" means this correspondence between latches, not technology mapping. If the paired functions are equal and the initial values agree, the designs are sequentially equivalent. The converse fails: designs changed by retiming or by state re-encoding have no such pairing, and then a sequential method is needed. Burch and Singhal (1998) made latch mapping robust to the loss of names in synthesis.
In plain words
Two versions of a chip should do the same thing. The memory cells of one usually have partners in the other, but synthesis tools rename cells, so you cannot match them by name. If you can find the right partner for every cell, you can cut the chips open at the memory cells and check the logic between them, one cell at a time, as if there were no memory at all. That check is much easier. The hard part is to find the partners, and to notice when there are none.
Definition
Input. Two synchronous circuits and with the same primary inputs and outputs. has latches with next-state functions and initial values , and has latches with and . The output functions are and . All are functions of the inputs and the latch outputs.
Mapping. A bijection , with an optional polarity for latches that store an inverted value. Under , the latch output is replaced by the variable , so that all functions are over and .
Output. A mapping that is valid:
- for every and every ;
- for every ;
or the answer that none exists. The initial values are checked apart: .
Proposition (soundness). If is valid and the initial values agree, then and are sequentially equivalent.
Proof. Let be the state of with . We show by induction on that after any inputs, is in when is in . At this is the agreement of the initial values. If it holds at with input , then latch of gets at , which is by validity, so the next state is . The output functions agree at every , so the outputs agree at every step.
Variants
- Many to one. Synthesis can duplicate a latch, or remove one that is constant or that copies another. Then the mapping pairs classes of latches, not single latches, and constant latches are mapped to constants.
- Unequal latch counts. After retiming, the counts differ, and no mapping exists. Methods then check the retimed circuit against the original with the retiming lags, or fall back on sequential equivalence.
- Register correspondence by induction. Ask only that paired latches hold equal values in every reachable state, not that the next-state functions be equal everywhere. This weaker notion is the latch part of signal correspondence; its combinational check is relative to the assumption that the pairs are equal.
- Partial mapping. Map what is clear, cut the rest as free inputs, and accept the risk of false negatives.
Examples
Swapped latches. has latches with , and output . has latches with , and output . The mapping , is valid: , becomes , and the outputs are and . The mapping , is not: it would need , which becomes , to equal .
An inverted latch. If stores in a latch with and uses where uses , the mapping with polarity 1 is valid.
Equivalent, but no valid mapping. has latches , both with next value and initial value 0, and output . has latches , both with next value and initial value 0, and output . In the invariant holds, so the output is , and the circuits are equivalent. The mapping , fails at the output: at the unreachable state . The other mapping fails at , which becomes , against . Register correspondence by induction proves this pair, because it assumes .
Retiming. The example on the sequential equivalence page has 1 latch against 2, so no mapping exists.
Known algorithms
- By name. Match the latch names, with rules for the renaming of the synthesis tool. Fast, but it breaks when names are lost.
- By structure. Compare the fanin cones of the latches, as a graph isomorphism problem on the two netlists. Gemini does this kind of netlist comparison by iterative labelling of vertices.
- By function. Burch and Singhal (1998) map latches by their functions, not their names: a latch and its partner must have equal next-state functions once their fanin latches are mapped. A natural way to find partners is partition refinement of the latches of both designs: give the latches of one class the same random value, simulate, and split a class when the next-state values of its members differ, until no class splits. We describe this scheme only in outline; the exact procedure of Burch and Singhal is in their paper.
- The check after the mapping. Any combinational method works; see cutpoint equivalence checking and SAT sweeping.
- By induction. Signal correspondence restricted to latches computes the coarsest register correspondence that is inductive. It also covers the invariant case above.
Bounds
The problem of deciding whether a valid mapping exists is coNP-hard and in .
Proof. coNP-hard. With no latches, the only mapping is the empty one, and it is valid exactly when the output functions are equal. That is combinational equivalence, which is coNP-complete. In . Guess and , then check validity, which is the statement that a combinational miter has no satisfying input, a coNP question.
We do not know a tighter bound; the search over the bijections is the part that heuristics attack. In practice signatures from simulation leave few candidates, and each candidate costs one combinational check.
Reductions
- To combinational equivalence. A fixed mapping turns the check into combinational equivalence of pairs of functions, by the proposition above.
- From sequential equivalence, as a sound step. A valid mapping proves sequential equivalence. No mapping proves nothing, as the examples show.
- To signal correspondence. Register correspondence by induction is signal correspondence with only latches in the classes.
Applications
- Combinational equivalence checking of netlists. Commercial checkers compare RTL with gates, or gates before and after optimization, by mapping latches first and then running a combinational check on each cone.
- Engineering change orders. After a small change to a netlist, most latches keep their partners, and the mapping is quick.
- Diagnosis. A latch with no partner, or a mapped pair whose functions differ, points at the location of a bug.
References
- J. R. Burch and V. Singhal, Robust latch mapping for combinational equivalence checking, ICCAD 1998, 563 to 569, the latch mapping problem, the functional method that does not rely on names, and its results on industrial designs
- J. R. Burch and V. Singhal, Tight integration of combinational verification methods, ICCAD 1998, 570 to 576, the combinational check that runs after the latches are mapped
- A. Kuehlmann and C. A. J. van Eijk, Combinational and sequential equivalence checking, in S. Hassoun and T. Sasao (editors), Logic Synthesis and Verification, Kluwer, 2002, 343 to 372, the reduction of sequential equivalence to combinational equivalence by a register correspondence, and register correspondence by induction
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 10EBSW Edit this page History Report an error Markdown