Algorithm Search⌘K

Definitionadvanced

Safe replaceability

Also called Pixley equivalence.

A design safely replaces another if every output sequence that it can give from any power-up state, the old design can also give from some power-up state.

Safe replaceability is a correctness notion for designs that have no reset, so that they can power up in any state. A new design D′D' safely replaces an old design DD if, for every power-up state of D′D' and every input sequence, some power-up state of DD gives the same output sequence. Then no environment that only drives the inputs and watches the outputs can tell that DD was replaced, because whatever D′D' does, DD could also have done. Singhal and Pixley (1994) defined it. It needs no initial state and no aligning input sequence. So it differs from sequential equivalence checking from a reset state, which is a reachability question on the product machine, and from the earlier notion of Pixley (1992), which asks that some input sequence bring the two designs to states with the same behaviour.

Definition

Let M=(X,Y,S,δ,λ)M = (X, Y, S, \delta, \lambda) and M′=(X,Y,S′,δ′,λ′)M' = (X, Y, S', \delta', \lambda') be deterministic Mealy machines with the same inputs and outputs and no initial state. For a state ss and an input sequence π=x0⋯xt\pi = x^0 \cdots x^t, write λ(s,π)\lambda(s, \pi) for the output sequence that MM gives from ss on π\pi.

M′M' is a safe replacement for MM, written M′⊑MM' \sqsubseteq M, if

∀s′∈S′  ∀π∈X∗  ∃s∈S:λ′(s′,π)=λ(s,π).\forall s' \in S'\ \ \forall \pi \in X^*\ \ \exists s \in S : \quad \lambda'(s', \pi) = \lambda(s, \pi).

The state ss may depend on π\pi. A state of MM that agrees with s′s' on every input sequence is not required.

Proposition 1 (preorder). ⊑\sqsubseteq is reflexive and transitive, and it is not symmetric.

Proof. Reflexive: take s=s′s = s'. Transitive: if M′′⊑M′M'' \sqsubseteq M' and M′⊑MM' \sqsubseteq M, then for s′′s'' and π\pi there is s′s' with λ′′(s′′,π)=λ′(s′,π)\lambda''(s'', \pi) = \lambda'(s', \pi), and then ss with λ′(s′,π)=λ(s,π)\lambda'(s', \pi) = \lambda(s, \pi). The fanout example below is not symmetric. □\square

Proposition 2 (a language inclusion). Let NN be MM read as a nondeterministic machine in which every state is initial, and let T(N)T(N) be the set of input-output sequences of NN. Then M′⊑MM' \sqsubseteq M if and only if T(M′)⊆T(N)T(M') \subseteq T(N), where M′M' also starts in every state.

Proof. Both sides say that every pair (π,λ′(s′,π))(\pi, \lambda'(s', \pi)) equals (π,λ(s,π))(\pi, \lambda(s, \pi)) for some ss. □\square

So an exact check is an inclusion into a nondeterministic machine. It follows sets of states of MM that are still consistent with the outputs seen, as in the subset construction, and M′⊑MM' \sqsubseteq M fails exactly when some input sequence from some state of M′M' makes that set empty. The number of such sets can be exponential in the number of states of MM, which is why cheaper sufficient tests, such as a simulation relation (see below), are attractive.

Examples and non-examples

Retiming forward across a fanout. DD has one latch rr with next value aa and two outputs o1=ro_1 = r and o2=ro_2 = r. Retiming the latch forward across the fanout gives D′D' with two latches r1,r2r_1, r_2, both with next value aa, and outputs o1=r1o_1 = r_1 and o2=r2o_2 = r_2.

  • DD is a safe replacement for D′D'. For a state rr of DD, take r1=r2=rr_1 = r_2 = r; the outputs then agree on every input sequence.
  • D′D' is not a safe replacement for DD. The power-up state r1r2=01r_1 r_2 = 01 gives o1o2=01o_1 o_2 = 01 on the first cycle for every input, and DD always gives o1=o2o_1 = o_2. So no state of DD matches.
  • After one clock cycle, D′D' is in a state with r1=r2r_1 = r_2, and from then on it behaves like DD. One cycle of any input brings every pair of states of the two designs to a pair with the same behaviour, so the two designs are equivalent in the sense of Pixley (1992), but not in both directions in the sense of safe replacement. Safe replacement counts the first cycle; the earlier notion does not.

Singhal, Pixley, Rudell and Brayton (1995) studied this effect of retiming in general: a retimed circuit need not be a safe replacement, but it becomes one after a bounded number of clock cycles. We do not prove their bound here.

A different state encoding. If M′M' is MM with its states renamed by a bijection, then M′⊑MM' \sqsubseteq M and M⊑M′M \sqsubseteq M': take the matching state. This is the case of state assignment with all codes used.

Safe replacement, but not equivalence from reset. Let MM be a 2-bit counter that outputs 1 when it holds 3, and let M′M' output 1 when it holds 2. Both count up by 1 on every clock and ignore the input. From state cc, M′M' outputs 1 at the clocks tt with c+t≡2(mod4)c + t \equiv 2 \pmod 4, and MM from state c+1 mod 4c + 1 \bmod 4 outputs 1 at the same clocks. So each state of M′M' is matched by a state of MM for all input sequences, the reverse holds in the same way, and the two are safe replacements of each other. With a reset to 0, the same designs are not equivalent: the first 1 comes at clock 2 in M′M' and at clock 3 in MM. Without a reset, the environment cannot know the phase.

  • Sequential equivalence checking fixes one initial state for each design and asks for equal outputs. It is the right notion when a reset exists.
  • The earlier notion of Pixley (1992) asks for an aligning sequence after which the two designs are in states with the same behaviour. Safe replacement needs no such sequence and holds from the first cycle.
  • Trace equivalence of transition systems is the symmetric closure of the inclusion in Proposition 2, with all states initial.
  • A simulation relation from M′M' to MM that relates each state of M′M' to some state of MM is a sufficient condition for M′⊑MM' \sqsubseteq M: the related state matches s′s' on every sequence at once. It is not necessary, because safe replacement lets the state of MM depend on π\pi.
  • Latch mapping with a combinational check gives equivalence from all states of a matched pair, so it also gives safe replacement in both directions when the mapping is a bijection of all latches.

References

  1. V. Singhal and C. Pixley, The verification problem for safe replaceability, CAV 1994, LNCS 818, 311 to 323, the definition of safe replacement with no assumption on the initial state, and the methods to check it
  2. C. Pixley, V. Singhal, A. Aziz and R. K. Brayton, Multi-level synthesis for safe replaceability, ICCAD 1994, 442 to 449, the use of safe replacement as the correctness notion for sequential logic optimization
  3. V. Singhal, C. Pixley, A. Aziz and R. K. Brayton, Theory of safe replacements for sequential circuits, IEEE TCAD 20(2), 249 to 265, 2001, the full theory, its comparison with other notions of equivalence for designs without reset, and its use in any environment
  4. V. Singhal, C. Pixley, R. L. Rudell and R. K. Brayton, The validity of retiming sequential circuits, DAC 1995, 316 to 321, when a retimed circuit is a safe replacement of the original, and the delay after which it becomes one
  5. C. Pixley, A theory and implementation of sequential hardware equivalence, IEEE TCAD 11(12), 1469 to 1478, 1992, equivalence of designs without reset based on aligning sequences, the earlier notion that safe replacement is compared with

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/749N61/text.yaml