A failed equivalence check gives you one input vector and two different outputs. In a netlist with millions of gates, that is only the beginning: the difference has to be traced back to the gate, wire or register that causes it. This article shows a practical method: find which outputs differ and which agree, narrow the search to the logic only the failing outputs share, and evaluate that logic on the counterexample. It also lists the usual causes of false non-equivalence, which are as common as real bugs.

8 min read | Intermediate

What You'll Learn

  • Use the list of proven and unproven outputs to localize a difference
  • Narrow the search to the logic the failing outputs share
  • Evaluate the suspect logic on the counterexample to find the wrong gate
  • Recognize false non-equivalence from setup problems

Step 1: Which Outputs Differ?

The Yosys equiv flow checks every output pair separately and reports which ones it could not prove. For the hand-edited adder netlist from the combinational equivalence article:

Output
  Of those cells 2 are proven and 3 are unproven.
  Unproven $equiv $auto$equiv_make.cc:258:find_same_wires$27: \s_gold [3] \s_gate [3]
  Unproven $equiv $auto$equiv_make.cc:258:find_same_wires$26: \s_gold [2] \s_gate [2]
  Unproven $equiv $auto$equiv_make.cc:258:find_same_wires$23: \cout_gold \cout_gate

Sum bits 0 and 1 are proven equivalent; sum bits 2 and 3 and the carry out are not. Commercial tools give the same kind of list, usually per compare point, which for a real netlist includes every register input as well as every output.

Step 2: Narrow the Cone

The bug must be in logic that feeds every failing output, and it is unlikely to be in logic that feeds only passing ones. For the adder, the failing outputs share the carry chain into bit 2, while bits 0 and 1 do not depend on it. That leaves a handful of gates: the carry logic of bits 1 and 2.

In a large design, this step turns a million gates into a few dozen. Tools help with schematic views of the cone and with "first difference" analysis on internal compare points.

Quick Check

Q: In a 32-bit adder netlist, sum bits 0 to 11 are proven and bits 12 to 31 are not. Where do you look first?

Show Answer

At the carry logic into bit 12. All failing bits depend on it, and the passing bits below do not.

Step 3: Evaluate on the Counterexample

The counterexample was a = 8, b = 6, cin = 0. Evaluate the suspect gates by hand or in a simulator:

SignalMeaningCorrectNetlist
_06_carry into bit 100
_07_bit 1 propagates (a[1] ^ b[1])11
_08_carry passes through bit 10 (0 AND 1)1 (0 OR 1)
_09_carry into bit 201

The first signal whose value differs from what the function requires is _08_, and its gate is an OR where an AND belongs. That is the edit.

False Non-Equivalence

Not every failure is a design bug. Common setup causes:

  • Test logic not disabled: scan multiplexers inserted into the netlist are not in the RTL. The scan-enable input must be tied off in the netlist check, or every register looks different.
  • Unmatched or merged registers: synthesis merged two equal registers, or renamed them, and the tool paired them wrongly.
  • Don't-care values: the RTL leaves some outputs unspecified (X), and synthesis chose a value. Options like -ignore_gold_x in Yosys treat X in the gold design as "anything allowed".
  • Different reset or initial values: registers reset to different values in the two versions.
  • Constant inputs: a mode pin that is constant in the chip is free in the check, exposing logic that never matters.

Quick Check

Q: After scan insertion, every register of a block fails equivalence. What is the most likely cause?

Show Answer

The scan-enable input is free in the check. With scan enabled, every register loads from the scan chain instead of the functional logic. Tie scan-enable to its functional value in the setup.

Running It in ChipVerify Lab

The example contains the adder RTL, a netlist with a different wrong gate, and the miter from the combinational equivalence article. The lab trace shows the inputs and both sums. Use the method of this article to find the gate.

Common Mistakes

Mistake #1: Starting with the gate-level schematic of the whole design

Use the list of failing and passing compare points first. It cuts the search space far more than any amount of staring at schematics.

Mistake #2: Assuming every failure is a netlist bug

Check the setup first: test modes, constants, register pairing and don't-cares. A wrong setup can make correct netlists fail.

Mistake #3: Fixing the netlist without rerunning the full check

An ECO that fixes one difference can create another. Rerun the complete equivalence check after every edit.

Practice Exercise

Challenge: A Different Wrong Gate

Open the example and run it. From the counterexample, find the lowest sum bit that differs. Then look at the carry logic feeding that bit in the netlist and evaluate it on the counterexample to find the wrong gate.

Hint

On the lab engine the counterexample had a = 8, b = 4 and cin = 1; if yours differs, use your values. Compare the RTL sum with the netlist sum in binary.

Solution

The RTL sum is 13 (1101) and the netlist sum is 15 (1111), so bit 1 is the lowest differing bit. Its carry in is _06_ = _03_ | _05_, and _05_ should be cin & _04_: a carry in passes bit 0 only if bit 0 propagates. The netlist has cin | _04_, which is 1 here although a[0] ^ b[0] is 0. Restoring the AND makes the miter pass. The Yosys equiv flow agrees: only s[0] is proven, everything from bit 1 up is not.

Open the ready-made example in the lab and run the formal check from the formal panel. The free tier allows a depth of up to 10 cycles, and PRO allows up to 100.

Summary

  • Start from the list of failing and passing compare points: the bug sits in logic the failing ones share.
  • Evaluate the suspect logic on the counterexample; the first wrong signal points to the faulty gate.
  • An OR typed for an AND in the carry chain made bits 2 and up fail, while bits 0 and 1 passed.
  • Setup problems cause many failures: test logic, register pairing, don't-cares, resets and constant pins.
  • Rerun the full check after every fix.
Did you find what you were looking for?

Quiz

No quiz questions available for this article.